update for HEAD-2003091401
[reactos.git] / subsys / win32k / eng / objects.h
1 /*
2  *  ReactOS kernel
3  *  Copyright (C) 1998, 1999, 2000, 2001 ReactOS Team
4  *
5  *  This program is free software; you can redistribute it and/or modify
6  *  it under the terms of the GNU General Public License as published by
7  *  the Free Software Foundation; either version 2 of the License, or
8  *  (at your option) any later version.
9  *
10  *  This program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License
16  *  along with this program; if not, write to the Free Software
17  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */
19 /* $Id$
20  * 
21  * COPYRIGHT:         See COPYING in the top level directory
22  * PROJECT:           ReactOS kernel
23  * PURPOSE:           GDI Internal Objects
24  * FILE:              subsys/win32k/eng/objects.h
25  * PROGRAMER:         Jason Filby
26  * REVISION HISTORY:
27  *                 21/8/1999: Created
28  */
29 #ifndef __ENG_OBJECTS_H
30 #define __ENG_OBJECTS_H
31
32 #include <freetype/freetype.h>
33
34 /* Structure of internal gdi objects that win32k manages for ddi engine:
35    |---------------------------------|
36    |           EngObj                |
37    |---------------------------------|
38    |         Public part             |
39    |      accessed from engine       |
40    |---------------------------------|
41    |        Private part             |
42    |       managed by gdi            |
43    |_________________________________|
44
45 ---------------------------------------------------------------------------*/
46
47 typedef struct _ENGOBJ {
48         ULONG  hObj;
49         ULONG  InternalSize;
50         ULONG  UserSize;
51 }ENGOBJ, *PENGOBJ;
52
53
54
55 typedef struct _BRUSHGDI {
56   ENGOBJ                Header;
57   BRUSHOBJ      BrushObj;
58 } BRUSHGDI;
59
60 typedef struct _CLIPGDI {
61   ENGOBJ                Header;
62   CLIPOBJ               ClipObj;
63   /* ei what were these for?
64   ULONG NumRegionRects;
65   ULONG NumIntersectRects;
66   RECTL *RegionRects;
67   RECTL *IntersectRects;
68   */
69   ULONG EnumPos;
70   ULONG EnumOrder;
71   ULONG EnumMax;
72   ENUMRECTS EnumRects;
73 } CLIPGDI, *PCLIPGDI;
74
75 /*ei What is this for? */
76 typedef struct _DRVFUNCTIONSGDI {
77   HDEV  hdev;
78   DRVFN Functions[INDEX_LAST];
79 } DRVFUNCTIONSGDI;
80
81 typedef struct _FLOATGDI {
82
83 } FLOATGDI;
84
85 typedef struct _FONTGDI {
86   ENGOBJ                Header;
87   FONTOBJ               FontObj;
88
89   LPCWSTR Filename;
90   FT_Face face;
91   TEXTMETRICW TextMetric;
92 } FONTGDI, *PFONTGDI;
93
94 typedef struct _PATHGDI {
95   ENGOBJ                Header;
96   PATHOBJ               PathObj;
97 } PATHGDI;
98
99 typedef struct _STRGDI {
100   ENGOBJ                Header;
101   STROBJ                StrObj;
102 } STRGDI;
103
104 typedef BOOL STDCALL (*PFN_BitBlt)(PSURFOBJ, PSURFOBJ, PSURFOBJ, PCLIPOBJ,
105                            PXLATEOBJ, PRECTL, PPOINTL, PPOINTL,
106                            PBRUSHOBJ, PPOINTL, ROP4);
107
108 typedef BOOL STDCALL (*PFN_TransparentBlt)(PSURFOBJ, PSURFOBJ, PCLIPOBJ, PXLATEOBJ, PRECTL, PRECTL, ULONG, ULONG);
109
110 typedef BOOL STDCALL (*PFN_StretchBlt)(PSURFOBJ, PSURFOBJ, PSURFOBJ, PCLIPOBJ,
111                                PXLATEOBJ, PCOLORADJUSTMENT, PPOINTL,
112                                PRECTL, PRECTL, PPOINT, ULONG);
113
114 typedef BOOL STDCALL (*PFN_TextOut)(PSURFOBJ, PSTROBJ, PFONTOBJ, PCLIPOBJ,
115                             PRECTL, PRECTL, PBRUSHOBJ, PBRUSHOBJ,
116                             PPOINTL, MIX);
117
118 typedef BOOL STDCALL (*PFN_Paint)(PSURFOBJ, PCLIPOBJ, PBRUSHOBJ, PPOINTL, MIX);
119
120 typedef BOOL STDCALL (*PFN_StrokePath)(PSURFOBJ, PPATHOBJ, PCLIPOBJ, PXFORMOBJ,
121                                PBRUSHOBJ, PPOINTL, PLINEATTRS, MIX);
122
123 typedef BOOL STDCALL (*PFN_FillPath)(PSURFOBJ, PPATHOBJ, PCLIPOBJ, PBRUSHOBJ,
124                              PPOINTL, MIX, ULONG);
125
126 typedef BOOL STDCALL (*PFN_StrokeAndFillPath)(PSURFOBJ, PPATHOBJ, PCLIPOBJ,
127                 PXFORMOBJ, PBRUSHOBJ, PLINEATTRS, PBRUSHOBJ,
128                 PPOINTL, MIX, ULONG);
129
130 typedef BOOL STDCALL (*PFN_LineTo)(PSURFOBJ, PCLIPOBJ, PBRUSHOBJ,
131                            LONG, LONG, LONG, LONG, PRECTL, MIX);
132
133 typedef BOOL STDCALL (*PFN_CopyBits)(PSURFOBJ, PSURFOBJ, PCLIPOBJ,
134                              PXLATEOBJ, PRECTL, PPOINTL);
135
136 typedef VOID STDCALL (*PFN_Synchronize)(DHPDEV, PRECTL);
137
138 typedef VOID STDCALL (*PFN_MovePointer)(PSURFOBJ, LONG, LONG, PRECTL);
139
140 typedef ULONG STDCALL (*PFN_SetPointerShape)(PSURFOBJ, PSURFOBJ, PSURFOBJ, PXLATEOBJ,
141                             LONG, LONG, LONG, LONG, PRECTL, ULONG);
142
143 typedef HBITMAP STDCALL (*PFN_CreateDeviceBitmap)(DHPDEV, SIZEL, ULONG);
144
145 typedef BOOL STDCALL (*PFN_SetPalette)(DHPDEV, PALOBJ*, ULONG, ULONG, ULONG);
146
147 /* Forward declare (circular reference) */
148 typedef struct _SURFGDI *PSURFGDI;
149
150 typedef VOID    (*PFN_DIB_PutPixel)(PSURFOBJ, LONG, LONG, ULONG);
151 typedef ULONG   (*PFN_DIB_GetPixel)(PSURFOBJ, LONG, LONG);
152 typedef VOID    (*PFN_DIB_HLine)   (PSURFOBJ, LONG, LONG, LONG, ULONG);
153 typedef VOID    (*PFN_DIB_VLine)   (PSURFOBJ, LONG, LONG, LONG, ULONG);
154 typedef BOOLEAN (*PFN_DIB_BitBlt)  (PSURFOBJ DestSurf, PSURFOBJ SourceSurf,
155                                     PSURFGDI DestGDI,  PSURFGDI SourceGDI,
156                                     PRECTL   DestRect, PPOINTL  SourcePoint,
157                                     PBRUSHOBJ BrushObj, PPOINTL BrushOrigin,
158                                     XLATEOBJ *ColorTranslation, ULONG Rop4);
159
160 typedef struct _SURFGDI {
161   ENGOBJ                Header;
162   SURFOBJ               SurfObj;
163
164   INT BitsPerPixel;
165
166   /* Driver functions */
167   PFN_BitBlt BitBlt;
168   PFN_TransparentBlt TransparentBlt;
169   PFN_StretchBlt StretchBlt;
170   PFN_TextOut TextOut;
171   PFN_Paint Paint;
172   PFN_StrokePath StrokePath;
173   PFN_FillPath FillPath;
174   PFN_StrokeAndFillPath StrokeAndFillPath;
175   PFN_LineTo LineTo;
176   PFN_CopyBits CopyBits;
177   PFN_Synchronize Synchronize;
178   BOOL SynchronizeAccess;
179   PFN_CreateDeviceBitmap CreateDeviceBitmap;
180   PFN_SetPalette SetPalette;
181   PFN_MovePointer MovePointer;
182   PFN_SetPointerShape SetPointerShape;
183
184   /* DIB functions */
185   PFN_DIB_PutPixel DIB_PutPixel;
186   PFN_DIB_HLine    DIB_HLine;
187   PFN_DIB_VLine    DIB_VLine;
188   PFN_DIB_BitBlt   DIB_BitBlt;
189 } SURFGDI;
190
191 typedef struct _XFORMGDI {
192   ENGOBJ                Header;
193   /* XFORMOBJ has no public members */
194 } XFORMGDI;
195
196 typedef struct _XLATEGDI {
197   ENGOBJ                Header;
198   XLATEOBJ              XlateObj;
199   HPALETTE DestPal;
200   HPALETTE SourcePal;
201
202   ULONG *translationTable;
203
204   ULONG RedMask;
205   ULONG GreenMask;
206   ULONG BlueMask;
207   INT RedShift;
208   INT GreenShift;
209   INT BlueShift;
210   BOOL UseShiftAndMask;
211 } XLATEGDI;
212
213 // List of GDI objects
214 // FIXME: Make more dynamic
215
216 #define MAX_GDI_BRUSHES      255
217 #define MAX_GDI_CLIPS        255
218 #define MAX_GDI_DRVFUNCTIONS  16
219 #define MAX_GDI_FLOATS       255
220 #define MAX_GDI_FONTS        255
221 #define MAX_GDI_PALS         255
222 #define MAX_GDI_PATHS        255
223 #define MAX_GDI_STRS         255
224 #define MAX_GDI_SURFS        255
225 #define MAX_GDI_XFORMS       255
226 #define MAX_GDI_XLATES       255
227
228 #endif //__ENG_OBJECTS_H