[WIN32SS] Rewrite font selection code. Patch by Katayama Hirofumi MZ. CORE-6621
[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_FACE {
111 FT_Face Face;
112 LONG RefCount;
113 } SHARED_FACE, *PSHARED_FACE;
114
115 typedef struct _FONTGDI {
116 FONTOBJ FontObj;
117 ULONG iUnique;
118 FLONG flType;
119
120 DHPDEV dhpdev;
121 PSHARED_FACE SharedFace;
122
123 LONG lMaxNegA;
124 LONG lMaxNegC;
125 LONG lMinWidthD;
126
127 LPWSTR Filename;
128 BYTE RequestUnderline;
129 BYTE RequestStrikeOut;
130 BYTE RequestItalic;
131 LONG RequestWeight;
132 BYTE OriginalItalic;
133 LONG OriginalWeight;
134 BYTE CharSet;
135 } FONTGDI, *PFONTGDI;
136
137 typedef struct _PATHGDI {
138 PATHOBJ PathObj;
139 } PATHGDI;
140
141 typedef struct _XFORMGDI {
142 ULONG Dummy;
143 /* XFORMOBJ has no public members */
144 } XFORMGDI;
145
146 /* As the *OBJ structures are located at the beginning of the *GDI structures
147 we can simply typecast the pointer */
148 #define ObjToGDI(ClipObj, Type) (Type##GDI *)(ClipObj)
149 #define GDIToObj(ClipGDI, Type) (Type##OBJ *)(ClipGDI)