[WIN32SS] Cleanup fonts at process destruction + implement font memory reference...
[reactos.git] / reactos / win32ss / gdi / eng / engobjects.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 along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19 /*
20 * COPYRIGHT: See COPYING in the top level directory
21 * PROJECT: ReactOS kernel
22 * PURPOSE: GDI Internal Objects
23 * FILE: win32ss/gdi/eng/engobjects.h
24 * PROGRAMER: Jason Filby
25 * REVISION HISTORY:
26 * 21/8/1999: Created
27 */
28
29 #pragma once
30
31 /* Structure of internal gdi objects that win32k manages for ddi engine:
32 |---------------------------------|
33 | Public part |
34 | accessed from engine |
35 |---------------------------------|
36 | Private part |
37 | managed by gdi |
38 |_________________________________|
39
40 ---------------------------------------------------------------------------*/
41
42 /* EXtended CLip and Window Region Object */
43 #ifdef __cplusplus
44 typedef struct _XCLIPOBJ : _WNDOBJ
45 {
46 #else
47 typedef struct _XCLIPOBJ
48 {
49 WNDOBJ;
50 #endif
51 PVOID pClipRgn; /* prgnRao_ or (prgnVis_ if (prgnRao_ == z)) */
52 RECTL rclClipRgn;
53 PVOID pscanClipRgn; /* Ptr to regions rect buffer based on iDirection. */
54 DWORD cScan;
55 DWORD reserved;
56 ULONG ulBSize;
57 LONG lscnSize;
58 ULONG ulObjSize;
59 ULONG iDirection;
60 ULONG ulClipType;
61 DWORD reserved1;
62 LONG lUpDown;
63 DWORD reserved2;
64 BOOL bShouldDoAll;
65 DWORD nComplexity; /* count/mode based on # of rect in regions scan. */
66 PVOID pDDA; /* Pointer to a large drawing structure. */
67 } XCLIPOBJ, *PXCLIPOBJ;
68 /*
69 EngCreateClip allocates XCLIPOBJ and RGNOBJ, pco->co.pClipRgn = &pco->ro.
70 {
71 XCLIPOBJ co;
72 RGNOBJ ro;
73 }
74 */
75 typedef struct _CLIPGDI {
76 union
77 {
78 CLIPOBJ ClipObj;
79 WNDOBJ WndObj;
80 };
81 /* WNDOBJ part */
82 HWND Hwnd;
83 WNDOBJCHANGEPROC ChangeProc;
84 FLONG Flags;
85 int PixelFormat;
86 /* CLIPOBJ part */
87 ULONG EnumPos;
88 ULONG EnumOrder;
89 ULONG EnumMax;
90 ULONG RectCount;
91 RECTL* Rects;
92 } CLIPGDI, *PCLIPGDI;
93 C_ASSERT(FIELD_OFFSET(CLIPGDI, ClipObj) == FIELD_OFFSET(CLIPGDI, WndObj.coClient));
94
95 // HACK, until we use the original structure
96 #define XCLIPOBJ CLIPGDI
97
98 extern XCLIPOBJ gxcoTrivial;
99
100 /*ei What is this for? */
101 typedef struct _DRVFUNCTIONSGDI {
102 HDEV hdev;
103 DRVFN Functions[INDEX_LAST];
104 } DRVFUNCTIONSGDI;
105
106 typedef struct _FLOATGDI {
107 ULONG Dummy;
108 } FLOATGDI;
109
110 typedef struct _SHARED_MEM {
111 PVOID Buffer;
112 ULONG BufferSize;
113 BOOL IsMapping;
114 LONG RefCount;
115 } SHARED_MEM, *PSHARED_MEM;
116
117 typedef struct _SHARED_FACE {
118 FT_Face Face;
119 LONG RefCount;
120 PSHARED_MEM Memory;
121 } SHARED_FACE, *PSHARED_FACE;
122
123 typedef struct _FONTGDI {
124 FONTOBJ FontObj;
125 ULONG iUnique;
126 FLONG flType;
127
128 DHPDEV dhpdev;
129 PSHARED_FACE SharedFace;
130
131 LONG lMaxNegA;
132 LONG lMaxNegC;
133 LONG lMinWidthD;
134
135 LPWSTR Filename;
136 BYTE RequestUnderline;
137 BYTE RequestStrikeOut;
138 BYTE RequestItalic;
139 LONG RequestWeight;
140 BYTE OriginalItalic;
141 LONG OriginalWeight;
142 BYTE CharSet;
143 } FONTGDI, *PFONTGDI;
144
145 typedef struct _PATHGDI {
146 PATHOBJ PathObj;
147 } PATHGDI;
148
149 typedef struct _XFORMGDI {
150 ULONG Dummy;
151 /* XFORMOBJ has no public members */
152 } XFORMGDI;
153
154 /* As the *OBJ structures are located at the beginning of the *GDI structures
155 we can simply typecast the pointer */
156 #define ObjToGDI(ClipObj, Type) (Type##GDI *)(ClipObj)
157 #define GDIToObj(ClipGDI, Type) (Type##OBJ *)(ClipGDI)