ReactOS  0.4.14-dev-77-gd9e7c48
dc.h
Go to the documentation of this file.
1 #ifndef __WIN32K_DC_H
2 #define __WIN32K_DC_H
3 
4 /* Constants ******************************************************************/
5 
6 /* flFontState */
8 {
12 };
13 
14 /* fl */
15 #define DC_FL_PAL_BACK 1
16 
18 {
19  DC_DISPLAY = 0x0001,
20  DC_DIRECT = 0x0002,
21  DC_CANCELED = 0x0004,
22  DC_PERMANANT = 0x0008,
23  DC_DIRTY_RAO = 0x0010,
24  DC_ACCUM_WMGR = 0x0020,
25  DC_ACCUM_APP = 0x0040,
26  DC_RESET = 0x0080,
29  DC_TEMPINFODC = 0x0400,
30  DC_FULLSCREEN = 0x0800,
31  DC_IN_CLONEPDEV = 0x1000,
32  DC_REDIRECTION = 0x2000,
33  DC_SHAREACCESS = 0x4000,
34 #if DBG
35  DC_PREPARED = 0x8000
36 #endif
37 };
38 
39 typedef enum _DCTYPE
40 {
44 } DCTYPE;
45 
46 
47 /* Type definitions ***********************************************************/
48 
49 typedef struct _DCLEVEL
50 {
51  HPALETTE hpal;
52  struct _PALETTE * ppal;
53  PVOID pColorSpace; /* COLORSPACE* */
61  _Notnull_ struct _LFONT * plfnt; /* LFONT* (TEXTOBJ*) */
62  HGDIOBJ hPath; /* HPATH */
64  LINEATTRS laPath; /* 0x20 bytes */
70  UNIVERSAL_FONT_ID ufiLoc[4]; /* Local List. */
89 } DCLEVEL, *PDCLEVEL;
90 
91 /* The DC object structure */
92 typedef struct _DC
93 {
94  /* Header for all gdi objects in the handle table.
95  Do not (re)move this. */
97 
98  DHPDEV dhpdev; /* <- PDEVOBJ.hPDev DHPDEV for device. */
102  PVOID hsem; /* PERESOURCE aka HSEMAPHORE */
116  _Notnull_ PREGION prgnVis; /* Visible region (must never be 0) */
126  PVOID prfnt; /* RFONT* */
127  XCLIPOBJ co; /* CLIPOBJ */
128  PVOID pPFFList; /* PPFF* */
134 } DC;
135 // typedef struct _DC *PDC;
136 
137 extern PDC defaultDCstate;
138 
139 /* Internal functions *********************************************************/
140 
141 /* dcobjs.c */
142 
147 
148 HFONT
149 NTAPI
151  _In_ PDC pdc,
152  _In_ HFONT hlfntNew);
153 
154 HPALETTE
155 NTAPI
157  _In_ HDC hDC,
158  _In_ HPALETTE hpal,
159  _In_ BOOL ForceBackground);
160 
161 /* dcutil.c */
162 
163 COLORREF
164 FASTCALL
166  _In_ HDC hDC,
168 
169 INT FASTCALL IntGdiSetBkMode(HDC hDC, INT backgroundMode);
174 ULONG TranslateCOLORREF(PDC pdc, COLORREF crColor);
175 int FASTCALL GreSetStretchBltMode(HDC hdc, int iStretchMode);
184 
185 INIT_FUNCTION NTSTATUS NTAPI InitDcImpl(VOID);
189 VOID NTAPI DC_vCleanup(PVOID ObjectBody);
191 
192 BOOL FASTCALL DC_InvertXform(const XFORM *xformSrc, XFORM *xformDest);
194 VOID FASTCALL DC_vCopyState(PDC pdcSrc, PDC pdcDst, BOOL To);
195 VOID FASTCALL DC_vFinishBlit(PDC pdc1, PDC pdc2);
196 VOID FASTCALL DC_vPrepareDCsForBlit(PDC pdcDest, const RECT* rcDest, PDC pdcSrc, const RECT* rcSrc);
197 
198 VOID NTAPI DC_vRestoreDC(IN PDC pdc, INT iSaveLevel);
199 
201 VOID NTAPI DC_vInitDc(PDC pdc, DCTYPE dctype, PPDEVOBJ ppdev);
202 
204 VOID FASTCALL IntGdiUnreferencePdev(PPDEVOBJ pPDev, DWORD CleanUpType);
205 HDC FASTCALL IntGdiCreateDisplayDC(HDEV hDev, ULONG DcType, BOOL EmptyDC);
209 
210 BOOL NTAPI GreSetDCOwner(HDC hdc, ULONG ulOwner);
212 
213 VOID
214 NTAPI
216 
218 PDC
220 {
221  PDC pdc;
222 
224  if (pdc)
225  {
226  ASSERT((GDI_HANDLE_GET_TYPE(pdc->BaseObject.hHmgr) == GDILoObjType_LO_DC_TYPE) ||
227  (GDI_HANDLE_GET_TYPE(pdc->BaseObject.hHmgr) == GDILoObjType_LO_ALTDC_TYPE));
228  ASSERT(pdc->dclevel.plfnt != NULL);
229  ASSERT(GDI_HANDLE_GET_TYPE(((POBJ)pdc->dclevel.plfnt)->hHmgr) == GDILoObjType_LO_FONT_TYPE);
230  }
231 
232  return pdc;
233 }
234 
236 VOID
238 {
239  ASSERT(pdc->dclevel.plfnt != NULL);
240  ASSERT(GDI_HANDLE_GET_TYPE(((POBJ)pdc->dclevel.plfnt)->hHmgr) == GDILoObjType_LO_FONT_TYPE);
241 
242  GDIOBJ_vUnlockObject(&pdc->BaseObject);
243 }
244 
246 VOID
248 {
249  PSURFACE psurfOld = pdc->dclevel.pSurface;
250  if (psurfOld)
251  {
252  psurfOld->hdc = NULL;
253  SURFACE_ShareUnlockSurface(psurfOld);
254  }
255  if (psurfNew)
257  pdc->dclevel.pSurface = psurfNew;
258 }
259 
261 VOID
263 {
264  PBRUSH pbrFillOld = pdc->dclevel.pbrFill;
265  if (pbrFillOld)
266  BRUSH_ShareUnlockBrush(pbrFillOld);
267  if (pbrFill)
269  pdc->dclevel.pbrFill = pbrFill;
270 }
271 
273 VOID
275 {
276  PBRUSH pbrLineOld = pdc->dclevel.pbrLine;
277  if (pbrLineOld)
278  BRUSH_ShareUnlockBrush(pbrLineOld);
279  if (pbrLine)
281  pdc->dclevel.pbrLine = pbrLine;
282 }
283 
285 VOID
287 {
288  PPALETTE ppalOld = pdc->dclevel.ppal;
289  if (ppalOld)
291  if (ppal)
293  pdc->dclevel.ppal = ppal;
294 }
295 
298 
299 #define ASSERT_DC_PREPARED(pdc) NT_ASSERT((pdc)->fs & DC_PREPARED)
300 
301 #endif /* not __WIN32K_DC_H */
#define BRUSH_ShareUnlockBrush(pBrush)
Definition: brush.h:114
ULONG TranslateCOLORREF(PDC pdc, COLORREF crColor)
Definition: dcutil.c:864
struct DC * PDC
PVOID pSurfInfo
Definition: dc.h:132
DHPDEV dhpdev
Definition: dc.h:98
Definition: dc.h:26
RECTL erclWindow
Definition: dc.h:112
DCLEVEL dclevel
Definition: dc.h:106
#define IN
Definition: typedefs.h:38
PVOID pColorSpace
Definition: dc.h:53
PGDIOBJ NTAPI GDIOBJ_LockObject(HGDIOBJ hobj, UCHAR objt)
Definition: gdiobj.c:823
_Notnull_ PDC_ATTR pdcattr
Definition: dc.h:105
int FASTCALL GreSetStretchBltMode(HDC hdc, int iStretchMode)
Definition: dcutil.c:283
#define _Notnull_
Definition: no_sal2.h:316
RECTL erclBounds
Definition: dc.h:113
typedef DHPDEV(APIENTRY FN_DrvEnablePDEV)(_In_ DEVMODEW *pdm
VOID FASTCALL DC_vUpdateLineBrush(PDC pdc)
Definition: dcobjs.c:62
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
FORCEINLINE VOID DC_vSelectSurface(PDC pdc, PSURFACE psurfNew)
Definition: dc.h:247
Definition: dc.h:92
_In_ ULONG Mode
Definition: hubbusif.h:303
VOID FASTCALL DC_vUpdateBackgroundBrush(PDC pdc)
Definition: dcobjs.c:126
#define SURFACE_ShareUnlockSurface(pBMObj)
Definition: surface.h:102
BOOL FASTCALL DC_InvertXform(const XFORM *xformSrc, XFORM *xformDest)
_Notnull_ PBRUSH pbrDefaultBrush
Definition: dclife.c:18
_DCTYPE
Definition: dc.h:39
BOOL FASTCALL IntGdiCleanDC(HDC hDC)
Definition: dcstate.c:73
EBRUSHOBJ eboFill
Definition: dc.h:119
HGDIOBJ hdcSave
Definition: dc.h:57
FORCEINLINE VOID DC_vSelectPalette(PDC pdc, PPALETTE ppal)
Definition: dc.h:286
BOOL FASTCALL IntGdiDeleteDC(HDC, BOOL)
Definition: dclife.c:892
HFONT hlfntCur
Definition: dc.h:123
FLONG flGraphicsCaps2
Definition: dc.h:104
PBRUSH pbrLine
Definition: dc.h:60
COLORADJUSTMENT ca
Definition: dc.h:67
Definition: dc.h:21
UINT FASTCALL IntGdiSetTextAlign(HDC hDC, UINT Mode)
Definition: dcutil.c:145
_Notnull_ PSURFACE psurfDefaultBitmap
Definition: dclife.c:17
LONG NTSTATUS
Definition: precomp.h:26
static HDC
Definition: imagelist.c:92
HDC hdcPrev
Definition: dc.h:109
COLORREF FASTCALL IntGdiSetBkColor(_In_ HDC hDC, _In_ COLORREF Color)
struct _DCLEVEL * PDCLEVEL
INT FASTCALL IntGdiSetBkMode(HDC hDC, INT backgroundMode)
Definition: dcutil.c:124
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
FORCEINLINE VOID DC_vSelectFillBrush(PDC pdc, PBRUSH pbrFill)
Definition: dc.h:262
FLOATOBJ efM11_TWIPS
Definition: dc.h:83
#define FASTCALL
Definition: nt_native.h:50
int32_t INT
Definition: typedefs.h:56
HPALETTE hpal
Definition: dc.h:51
PREGION prgnRao
Definition: dc.h:117
HGDIOBJ hPath
Definition: dc.h:62
_Notnull_ PREGION prgnVis
Definition: dc.h:116
UNIVERSAL_FONT_ID * pUFI
Definition: dc.h:71
RECTL erclClip
Definition: dc.h:110
FLOATOBJ efM11PtoD
Definition: dc.h:79
POINTL ptlDoBanding
Definition: dc.h:133
_DCFLAGS
Definition: dc.h:17
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
PREGION prgnMeta
Definition: dc.h:66
Definition: text.h:59
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
GLuint color
Definition: glext.h:6243
MATRIX mxWorldToPage
Definition: dc.h:78
LONG lEscapement
Definition: dc.h:125
_Notnull_ struct _LFONT * plfnt
Definition: dc.h:61
FLOATOBJ efPr11
Definition: dc.h:85
enum _DCTYPE DCTYPE
smooth NULL
Definition: ftsmooth.c:416
#define FORCEINLINE
Definition: ntbasedef.h:221
COLORREF FASTCALL IntGdiSetTextColor(HDC hDC, COLORREF color)
Definition: dcutil.c:172
MATRIX mxDeviceToWorld
Definition: dc.h:77
BOOL NTAPI DC_bAllocDcAttr(PDC pdc)
Definition: dcattr.c:31
Definition: region.h:7
unsigned long FLONG
Definition: ntbasedef.h:373
VOID NTAPI DC_vInitDc(PDC pdc, DCTYPE dctype, PPDEVOBJ ppdev)
Definition: dclife.c:129
EBRUSHOBJ eboBackground
Definition: dc.h:122
Definition: types.h:100
INIT_FUNCTION NTSTATUS NTAPI InitDcImpl(VOID)
Definition: dclife.c:53
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
HDC hdcNext
Definition: dc.h:108
EBRUSHOBJ eboLine
Definition: dc.h:120
_FONT_STATE
Definition: dc.h:7
RECTL erclBoundsApp
Definition: dc.h:114
VOID FASTCALL DC_vUpdateTextBrush(PDC pdc)
Definition: dcobjs.c:108
Definition: polytest.cpp:40
LINEATTRS laPath
Definition: dc.h:64
FLONG flSimulationFlags
Definition: dc.h:124
PBRUSH pbrFill
Definition: dc.h:59
PDC defaultDCstate
Definition: device.c:14
DWORD unk1_00000000
Definition: dc.h:56
HDC APIENTRY GreCreateCompatibleDC(HDC hdc, BOOL bAltDc)
Definition: dclife.c:817
PSURFACE pSurface
Definition: dc.h:87
DC_ATTR dcattr
Definition: dc.h:107
FLOAT FLOATOBJ
Definition: winddi.h:677
Definition: matrix.h:43
FLOATOBJ efDyPtoD
Definition: dc.h:82
DWORD COLORREF
Definition: windef.h:285
PDC NTAPI DC_AllocDcWithHandle(GDILOOBJTYPE eDcObjType)
Definition: dclife.c:69
HDC FASTCALL IntGdiCreateDisplayDC(HDEV hDev, ULONG DcType, BOOL EmptyDC)
Definition: dclife.c:1066
unsigned long DWORD
Definition: ntddk_ex.h:95
PREGION prgnClip
Definition: dc.h:65
FLOATOBJ efDxPtoD
Definition: dc.h:81
XCLIPOBJ co
Definition: dc.h:127
int FASTCALL GreGetBkMode(HDC)
Definition: dcutil.c:35
PVOID hsem
Definition: dc.h:102
PVOID pClrxFormLnk
Definition: dc.h:129
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
Definition: dc.h:20
VOID NTAPI GDIOBJ_vUnlockObject(POBJ pobj)
Definition: gdiobj.c:877
struct _DC DC
HDC hdc
Definition: main.c:9
SIZE sizl
Definition: dc.h:88
DCTYPE dctype
Definition: dc.h:99
COLORREF FASTCALL IntSetDCPenColor(HDC, COLORREF)
Definition: dcutil.c:259
UNIVERSAL_FONT_ID ufi
Definition: dc.h:69
BASEOBJECT BaseObject
Definition: dc.h:96
Definition: dc.h:43
COLORREF FASTCALL GreGetBkColor(HDC)
Definition: dcutil.c:50
FLONG fl
Definition: dc.h:74
LONG lIcmMode
Definition: dc.h:54
VOID FASTCALL DCU_SetDcUndeletable(HDC)
Definition: dcutil.c:322
UNIVERSAL_FONT_ID ufiLoc[4]
Definition: dc.h:70
Definition: dc.h:19
BOOL FASTCALL IntSetDefaultRegion(PDC)
Definition: dcutil.c:350
BOOL FASTCALL GreSetBrushOrg(HDC, INT, INT, LPPOINT)
Definition: dcutil.c:231
VOID NTAPI DC_vSetBrushOrigin(PDC pdc, LONG x, LONG y)
Definition: dcobjs.c:142
LONG lSaveDepth
Definition: dc.h:55
#define _In_
Definition: no_sal2.h:204
static HDC hDC
Definition: 3dtext.c:33
FLONG flBrush
Definition: dc.h:75
POINTL ptlBrushOrigin
Definition: dc.h:58
Definition: dc.h:49
VOID FASTCALL IntvGetDeviceCaps(PPDEVOBJ, PDEVCAPS)
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
PVOID prfnt
Definition: dc.h:126
VOID FASTCALL DC_vUpdateViewportExt(PDC pdc)
PREGION prgnAPI
Definition: dc.h:115
PPDEVOBJ ppdev
Definition: dc.h:101
FLOATOBJ efM22PtoD
Definition: dc.h:80
FLONG flPath
Definition: dc.h:63
FLOATOBJ efPr22
Definition: dc.h:86
#define PALETTE_ShareUnlockPalette(ppal)
Definition: palette.h:59
BOOL NTAPI GreSetDCOwner(HDC hdc, ULONG ulOwner)
Definition: dclife.c:455
VOID NTAPI GDIOBJ_vReferenceObjectByPointer(POBJ pobj)
Definition: gdiobj.c:731
unsigned int UINT
Definition: ndis.h:50
int FASTCALL GreGetMapMode(HDC)
Definition: dcutil.c:65
FLONG flFontState
Definition: dc.h:68
VOID FASTCALL DC_vPrepareDCsForBlit(PDC pdcDest, const RECT *rcDest, PDC pdcSrc, const RECT *rcSrc)
Definition: dclife.c:505
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
MATRIX mxWorldToDevice
Definition: dc.h:76
VOID FASTCALL IntGdiReferencePdev(PPDEVOBJ pPDev)
Definition: device.c:17
VOID FASTCALL DC_vFinishBlit(PDC pdc1, PDC pdc2)
Definition: dclife.c:614
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
COLORREF FASTCALL GreGetTextColor(HDC)
Definition: dcutil.c:80
HDC hdc
Definition: surface.h:26
INT ipfdDevMax
Definition: dc.h:130
VOID FASTCALL IntUpdateBoundsRect(PDC, PRECTL)
Definition: dcutil.c:689
POINTL ptlDCOrig
Definition: dc.h:111
unsigned int ULONG
Definition: retypes.h:1
PPDEVOBJ FASTCALL IntEnumHDev(VOID)
Definition: device.c:50
ULONG ulCopyCount
Definition: dc.h:131
VOID FASTCALL DC_vCopyState(PDC pdcSrc, PDC pdcDst, BOOL To)
Definition: dcstate.c:16
struct _PALETTE * ppal
Definition: dc.h:52
struct _DCLEVEL DCLEVEL
EBRUSHOBJ eboText
Definition: dc.h:121
FLOATOBJ efM22_TWIPS
Definition: dc.h:84
COLORREF FASTCALL IntSetDCBrushColor(HDC, COLORREF)
Definition: dcutil.c:206
VOID FASTCALL IntGdiUnreferencePdev(PPDEVOBJ pPDev, DWORD CleanUpType)
Definition: device.c:23
enum GDILoObjType GDILOOBJTYPE
BOOL ufiSet
Definition: dc.h:73
PVOID pPFFList
Definition: dc.h:128
POINTL ptlFillOrigin
Definition: dc.h:118
INT fs
Definition: dc.h:100
VOID NTAPI DC_vCleanup(PVOID ObjectBody)
Definition: dclife.c:357
FORCEINLINE VOID DC_vSelectLineBrush(PDC pdc, PBRUSH pbrLine)
Definition: dc.h:274
VOID NTAPI DC_vRestoreDC(IN PDC pdc, INT iSaveLevel)
Definition: dcstate.c:138
HPALETTE NTAPI GdiSelectPalette(_In_ HDC hDC, _In_ HPALETTE hpal, _In_ BOOL ForceBackground)
#define APIENTRY
Definition: api.h:79
FLONG flGraphicsCaps
Definition: dc.h:103
int FASTCALL GreGetGraphicsMode(HDC)
Definition: dcutil.c:306
VOID FASTCALL DC_vUpdateFillBrush(PDC pdc)
Definition: dcobjs.c:16
ULONG uNumUFIs
Definition: dc.h:72
HFONT NTAPI DC_hSelectFont(_In_ PDC pdc, _In_ HFONT hlfntNew)
Definition: dcobjs.c:550
VOID NTAPI DC_vFreeDcAttr(PDC pdc)
Definition: dcattr.c:59