Commit r20366:20368 again.
[reactos.git] / reactos / 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 <ft2build.h>
33 #include <freetype/freetype.h>
34
35 /* Structure of internal gdi objects that win32k manages for ddi engine:
36 |---------------------------------|
37 | Public part |
38 | accessed from engine |
39 |---------------------------------|
40 | Private part |
41 | managed by gdi |
42 |_________________________________|
43
44 ---------------------------------------------------------------------------*/
45
46 typedef struct _CLIPGDI {
47 CLIPOBJ ClipObj;
48 ULONG EnumPos;
49 ULONG EnumOrder;
50 ULONG EnumMax;
51 ENUMRECTS EnumRects;
52 } CLIPGDI, *PCLIPGDI;
53
54 typedef struct _DRIVERGDI {
55 DRIVEROBJ DriverObj;
56 LIST_ENTRY ListEntry;
57 FAST_MUTEX Lock;
58 } DRIVERGDI, *PDRIVERGDI;
59
60 /*ei What is this for? */
61 typedef struct _DRVFUNCTIONSGDI {
62 HDEV hdev;
63 DRVFN Functions[INDEX_LAST];
64 } DRVFUNCTIONSGDI;
65
66 typedef struct _FLOATGDI {
67 ULONG Dummy;
68 } FLOATGDI;
69
70 typedef struct _FONTGDI {
71 FONTOBJ FontObj;
72
73 LPCWSTR Filename;
74 FT_Face face;
75 TEXTMETRICW TextMetric;
76 } FONTGDI, *PFONTGDI;
77
78 typedef struct _PATHGDI {
79 PATHOBJ PathObj;
80 } PATHGDI;
81
82 typedef struct _STRGDI {
83 STROBJ StrObj;
84 } STRGDI;
85
86 typedef BOOL (STDCALL *PFN_BitBlt)(SURFOBJ *, SURFOBJ *, SURFOBJ *, CLIPOBJ *,
87 XLATEOBJ *, RECTL *, POINTL *, POINTL *,
88 BRUSHOBJ *, POINTL *, ROP4);
89
90 typedef BOOL (STDCALL *PFN_TransparentBlt)(SURFOBJ *, SURFOBJ *, CLIPOBJ *, XLATEOBJ *, RECTL *, RECTL *, ULONG, ULONG);
91
92 typedef BOOL (STDCALL *PFN_StretchBlt)(SURFOBJ *, SURFOBJ *, SURFOBJ *, CLIPOBJ *,
93 XLATEOBJ *, COLORADJUSTMENT *, POINTL *,
94 RECTL *, RECTL *, PPOINT, ULONG);
95
96 typedef BOOL (STDCALL *PFN_TextOut)(SURFOBJ *, STROBJ *, FONTOBJ *, CLIPOBJ *,
97 RECTL *, RECTL *, BRUSHOBJ *, BRUSHOBJ *,
98 POINTL *, MIX);
99
100 typedef BOOL (STDCALL *PFN_Paint)(SURFOBJ *, CLIPOBJ *, BRUSHOBJ *, POINTL *, MIX);
101
102 typedef BOOL (STDCALL *PFN_StrokePath)(SURFOBJ *, PATHOBJ *, CLIPOBJ *, XFORMOBJ *,
103 BRUSHOBJ *, POINTL *, LINEATTRS *, MIX);
104
105 typedef BOOL (STDCALL *PFN_FillPath)(SURFOBJ *, PATHOBJ *, CLIPOBJ *, BRUSHOBJ *,
106 POINTL *, MIX, ULONG);
107
108 typedef BOOL (STDCALL *PFN_StrokeAndFillPath)(SURFOBJ *, PATHOBJ *, CLIPOBJ *,
109 XFORMOBJ *, BRUSHOBJ *, LINEATTRS *, BRUSHOBJ *,
110 POINTL *, MIX, ULONG);
111
112 typedef BOOL (STDCALL *PFN_LineTo)(SURFOBJ *, CLIPOBJ *, BRUSHOBJ *,
113 LONG, LONG, LONG, LONG, RECTL *, MIX);
114
115 typedef BOOL (STDCALL *PFN_CopyBits)(SURFOBJ *, SURFOBJ *, CLIPOBJ *,
116 XLATEOBJ *, RECTL *, POINTL *);
117
118 typedef VOID (STDCALL *PFN_Synchronize)(DHPDEV, RECTL *);
119
120 typedef VOID (STDCALL *PFN_MovePointer)(SURFOBJ *, LONG, LONG, RECTL *);
121
122 typedef ULONG (STDCALL *PFN_SetPointerShape)(SURFOBJ *, SURFOBJ *, SURFOBJ *, XLATEOBJ *,
123 LONG, LONG, LONG, LONG, RECTL *, FLONG);
124
125 typedef HBITMAP (STDCALL *PFN_CreateDeviceBitmap)(DHPDEV, SIZEL, ULONG);
126
127 typedef BOOL (STDCALL *PFN_SetPalette)(DHPDEV, PALOBJ*, ULONG, ULONG, ULONG);
128
129 typedef BOOL (STDCALL *PFN_GradientFill)(SURFOBJ*, CLIPOBJ*, XLATEOBJ*, TRIVERTEX*, ULONG, PVOID, ULONG, RECTL*, POINTL*, ULONG);
130
131 typedef struct _WNDGDI {
132 WNDOBJ WndObj;
133 LIST_ENTRY ListEntry;
134 HWND Hwnd;
135 CLIPOBJ *ClientClipObj;
136 WNDOBJCHANGEPROC ChangeProc;
137 FLONG Flags;
138 int PixelFormat;
139 } WNDGDI, *PWNDGDI;
140
141 typedef struct _XFORMGDI {
142 ULONG Dummy;
143 /* XFORMOBJ has no public members */
144 } XFORMGDI;
145
146 typedef struct _XLATEGDI {
147 XLATEOBJ XlateObj;
148 HPALETTE DestPal;
149 HPALETTE SourcePal;
150 BOOL UseShiftAndMask;
151
152 // union {
153 // struct { /* For Shift Translations */
154 ULONG RedMask;
155 ULONG GreenMask;
156 ULONG BlueMask;
157 INT RedShift;
158 INT GreenShift;
159 INT BlueShift;
160 // };
161 // struct { /* For Table Translations */
162 ULONG *translationTable;
163 // };
164 // struct { /* For Color -> Mono Translations */
165 ULONG BackgroundColor;
166 // };
167 // };
168 } XLATEGDI;
169
170 /* as the *OBJ structures are located at the beginning of the *GDI structures
171 we can simply typecast the pointer */
172 #define ObjToGDI(ClipObj, Type) (Type##GDI *)(ClipObj)
173 #define GDIToObj(ClipGDI, Type) (Type##OBJ *)(ClipGDI)
174
175
176 #endif //__ENG_OBJECTS_H