xref: /reactos/win32ss/gdi/eng/engobjects.h (revision cc439606)
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 typedef struct _RWNDOBJ {
43   PVOID   pvConsumer;
44   RECTL   rclClient;
45   SURFOBJ *psoOwner;
46 } RWNDOBJ;
47 
48 /* EXtended CLip and Window Region Objects */
49 #ifdef __cplusplus
50 typedef struct _XCLIPOBJ : _CLIPOBJ, _RWNDOBJ
51 {
52 #else
53 typedef struct _XCLIPOBJ
54 {
55   CLIPOBJ;
56   RWNDOBJ;
57 #endif
58   struct _REGION *pClipRgn;    /* prgnRao_ or (prgnVis_ if (prgnRao_ == z)) */
59   //
60   RECTL   rclClipRgn;
61   //PVOID   pscanClipRgn; /* Ptr to regions rect buffer based on iDirection. */
62   RECTL*  Rects;
63   DWORD   cScan;
64   DWORD   reserved;
65   ULONG   EnumPos;
66   LONG    lscnSize;
67   ULONG   EnumMax;
68   ULONG   iDirection;
69   ULONG   iType;
70   DWORD   reserved1;
71   LONG    lUpDown;
72   DWORD   reserved2;
73   BOOL    bAll;
74   //
75   DWORD   RectCount;   /* count/mode based on # of rect in regions scan. */
76   PVOID   pDDA;        /* Pointer to a large drawing structure. */
77 } XCLIPOBJ, *PXCLIPOBJ;
78 
79 /*
80   EngCreateClip allocates XCLIPOBJ and REGION, pco->co.pClipRgn = &pco->ro.
81   {
82     XCLIPOBJ co;
83     REGION   ro;
84   }
85  */
86 
87 extern XCLIPOBJ gxcoTrivial;
88 
89 #ifdef __cplusplus
90 typedef struct _EWNDOBJ : _XCLIPOBJ
91 {
92 #else
93 typedef struct _EWNDOBJ
94 {
95     XCLIPOBJ;
96 #endif
97     /* Extended WNDOBJ part */
98     HWND              Hwnd;
99     WNDOBJCHANGEPROC  ChangeProc;
100     FLONG             Flags;
101     int               PixelFormat;
102 } EWNDOBJ, *PEWNDOBJ;
103 
104 
105 /*ei What is this for? */
106 typedef struct _DRVFUNCTIONSGDI {
107   HDEV  hdev;
108   DRVFN Functions[INDEX_LAST];
109 } DRVFUNCTIONSGDI;
110 
111 typedef struct _FLOATGDI {
112   ULONG Dummy;
113 } FLOATGDI;
114 
115 typedef struct _SHARED_MEM {
116   PVOID         Buffer;
117   ULONG         BufferSize;
118   BOOL          IsMapping;
119   LONG          RefCount;
120 } SHARED_MEM, *PSHARED_MEM;
121 
122 typedef struct _SHARED_FACE_CACHE {
123     UINT OutlineRequiredSize;
124     UNICODE_STRING FontFamily;
125     UNICODE_STRING FullName;
126 } SHARED_FACE_CACHE, *PSHARED_FACE_CACHE;
127 
128 typedef struct _SHARED_FACE {
129   FT_Face       Face;
130   LONG          RefCount;
131   PSHARED_MEM   Memory;
132   SHARED_FACE_CACHE EnglishUS;
133   SHARED_FACE_CACHE UserLanguage;
134 } SHARED_FACE, *PSHARED_FACE;
135 
136 typedef struct _FONTGDI {
137   FONTOBJ       FontObj;
138   ULONG         iUnique;
139   FLONG         flType;
140 
141   DHPDEV        dhpdev;
142   PSHARED_FACE  SharedFace;
143 
144   LONG          lMaxNegA;
145   LONG          lMaxNegC;
146   LONG          lMinWidthD;
147 
148   LPWSTR        Filename;
149   BYTE          RequestUnderline;
150   BYTE          RequestStrikeOut;
151   BYTE          RequestItalic;
152   LONG          RequestWeight;
153   BYTE          OriginalItalic;
154   LONG          OriginalWeight;
155   BYTE          CharSet;
156 
157   /* Precomputed font metrics (supplements FreeType metrics) */
158   LONG          tmHeight;
159   LONG          tmAscent;
160   LONG          tmDescent;
161   LONG          tmInternalLeading;
162   LONG          EmHeight;
163   LONG          Magic;
164 } FONTGDI, *PFONTGDI;
165 
166 /* The initialized 'Magic' value in FONTGDI */
167 #define FONTGDI_MAGIC   0x20110311
168 
169 typedef struct _PATHGDI {
170   PATHOBJ PathObj;
171 } PATHGDI;
172 
173 typedef struct _XFORMGDI {
174   ULONG Dummy;
175   /* XFORMOBJ has no public members */
176 } XFORMGDI;
177 
178 /* As the *OBJ structures are located at the beginning of the *GDI structures
179    we can simply typecast the pointer */
180 #define ObjToGDI(ClipObj, Type) (Type##GDI *)(ClipObj)
181 #define GDIToObj(ClipGDI, Type) (Type##OBJ *)(ClipGDI)
182