ReactOS  0.4.14-dev-114-gc8cbd56
dc.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _DCLEVEL
 
struct  _DC
 

Macros

#define DC_FL_PAL_BACK   1
 
#define ASSERT_DC_PREPARED(pdc)   NT_ASSERT((pdc)->fs & DC_PREPARED)
 

Typedefs

typedef enum _DCTYPE DCTYPE
 
typedef struct _DCLEVEL DCLEVEL
 
typedef struct _DCLEVELPDCLEVEL
 
typedef struct _DC DC
 

Enumerations

enum  _FONT_STATE { DC_DIRTYFONT_XFORM = 1, DC_DIRTYFONT_LFONT = 2, DC_UFI_MAPPING = 4 }
 
enum  _DCFLAGS {
  DC_DISPLAY = 0x0001, DC_DIRECT = 0x0002, DC_CANCELED = 0x0004, DC_PERMANANT = 0x0008,
  DC_DIRTY_RAO = 0x0010, DC_ACCUM_WMGR = 0x0020, DC_ACCUM_APP = 0x0040, DC_RESET = 0x0080,
  DC_SYNCHRONIZEACCESS = 0x0100, DC_EPSPRINTINGESCAPE = 0x0200, DC_TEMPINFODC = 0x0400, DC_FULLSCREEN = 0x0800,
  DC_IN_CLONEPDEV = 0x1000, DC_REDIRECTION = 0x2000, DC_SHAREACCESS = 0x4000
}
 
enum  _DCTYPE { DCTYPE_DIRECT = 0, DCTYPE_MEMORY = 1, DCTYPE_INFO = 2 }
 

Functions

VOID FASTCALL DC_vUpdateFillBrush (PDC pdc)
 
VOID FASTCALL DC_vUpdateLineBrush (PDC pdc)
 
VOID FASTCALL DC_vUpdateTextBrush (PDC pdc)
 
VOID FASTCALL DC_vUpdateBackgroundBrush (PDC pdc)
 
HFONT NTAPI DC_hSelectFont (_In_ PDC pdc, _In_ HFONT hlfntNew)
 
HPALETTE NTAPI GdiSelectPalette (_In_ HDC hDC, _In_ HPALETTE hpal, _In_ BOOL ForceBackground)
 
COLORREF FASTCALL IntGdiSetBkColor (_In_ HDC hDC, _In_ COLORREF Color)
 
INT FASTCALL IntGdiSetBkMode (HDC hDC, INT backgroundMode)
 
COLORREF FASTCALL IntGdiSetTextColor (HDC hDC, COLORREF color)
 
UINT FASTCALL IntGdiSetTextAlign (HDC hDC, UINT Mode)
 
VOID FASTCALL DCU_SetDcUndeletable (HDC)
 
BOOL FASTCALL IntSetDefaultRegion (PDC)
 
ULONG TranslateCOLORREF (PDC pdc, COLORREF crColor)
 
int FASTCALL GreSetStretchBltMode (HDC hdc, int iStretchMode)
 
int FASTCALL GreGetBkMode (HDC)
 
int FASTCALL GreGetMapMode (HDC)
 
COLORREF FASTCALL GreGetTextColor (HDC)
 
COLORREF FASTCALL GreGetBkColor (HDC)
 
COLORREF FASTCALL IntSetDCBrushColor (HDC, COLORREF)
 
COLORREF FASTCALL IntSetDCPenColor (HDC, COLORREF)
 
int FASTCALL GreGetGraphicsMode (HDC)
 
BOOL FASTCALL GreSetBrushOrg (HDC, INT, INT, LPPOINT)
 
INIT_FUNCTION NTSTATUS NTAPI InitDcImpl (VOID)
 
PPDEVOBJ FASTCALL IntEnumHDev (VOID)
 
PDC NTAPI DC_AllocDcWithHandle (GDILOOBJTYPE eDcObjType)
 
BOOL NTAPI DC_bAllocDcAttr (PDC pdc)
 
VOID NTAPI DC_vCleanup (PVOID ObjectBody)
 
BOOL FASTCALL IntGdiDeleteDC (HDC, BOOL)
 
BOOL FASTCALL DC_InvertXform (const XFORM *xformSrc, XFORM *xformDest)
 
VOID FASTCALL DC_vUpdateViewportExt (PDC pdc)
 
VOID FASTCALL DC_vCopyState (PDC pdcSrc, PDC pdcDst, BOOL To)
 
VOID FASTCALL DC_vFinishBlit (PDC pdc1, PDC pdc2)
 
VOID FASTCALL DC_vPrepareDCsForBlit (PDC pdcDest, const RECT *rcDest, PDC pdcSrc, const RECT *rcSrc)
 
VOID NTAPI DC_vRestoreDC (IN PDC pdc, INT iSaveLevel)
 
VOID NTAPI DC_vFreeDcAttr (PDC pdc)
 
VOID NTAPI DC_vInitDc (PDC pdc, DCTYPE dctype, PPDEVOBJ ppdev)
 
VOID FASTCALL IntGdiReferencePdev (PPDEVOBJ pPDev)
 
VOID FASTCALL IntGdiUnreferencePdev (PPDEVOBJ pPDev, DWORD CleanUpType)
 
HDC FASTCALL IntGdiCreateDisplayDC (HDEV hDev, ULONG DcType, BOOL EmptyDC)
 
BOOL FASTCALL IntGdiCleanDC (HDC hDC)
 
VOID FASTCALL IntvGetDeviceCaps (PPDEVOBJ, PDEVCAPS)
 
VOID FASTCALL IntUpdateBoundsRect (PDC, PRECTL)
 
BOOL NTAPI GreSetDCOwner (HDC hdc, ULONG ulOwner)
 
HDC APIENTRY GreCreateCompatibleDC (HDC hdc, BOOL bAltDc)
 
VOID NTAPI DC_vSetBrushOrigin (PDC pdc, LONG x, LONG y)
 
FORCEINLINE PDC DC_LockDc (HDC hdc)
 
FORCEINLINE VOID DC_UnlockDc (PDC pdc)
 
FORCEINLINE VOID DC_vSelectSurface (PDC pdc, PSURFACE psurfNew)
 
FORCEINLINE VOID DC_vSelectFillBrush (PDC pdc, PBRUSH pbrFill)
 
FORCEINLINE VOID DC_vSelectLineBrush (PDC pdc, PBRUSH pbrLine)
 
FORCEINLINE VOID DC_vSelectPalette (PDC pdc, PPALETTE ppal)
 

Variables

PDC defaultDCstate
 
_Notnull_ PBRUSH pbrDefaultBrush
 
_Notnull_ PSURFACE psurfDefaultBitmap
 

Macro Definition Documentation

◆ ASSERT_DC_PREPARED

#define ASSERT_DC_PREPARED (   pdc)    NT_ASSERT((pdc)->fs & DC_PREPARED)

Definition at line 299 of file dc.h.

◆ DC_FL_PAL_BACK

#define DC_FL_PAL_BACK   1

Definition at line 15 of file dc.h.

Typedef Documentation

◆ DC

typedef struct _DC DC

◆ DCLEVEL

◆ DCTYPE

typedef enum _DCTYPE DCTYPE

◆ PDCLEVEL

Enumeration Type Documentation

◆ _DCFLAGS

Enumerator
DC_DISPLAY 
DC_DIRECT 
DC_CANCELED 
DC_PERMANANT 
DC_DIRTY_RAO 
DC_ACCUM_WMGR 
DC_ACCUM_APP 
DC_RESET 
DC_SYNCHRONIZEACCESS 
DC_EPSPRINTINGESCAPE 
DC_TEMPINFODC 
DC_FULLSCREEN 
DC_IN_CLONEPDEV 
DC_REDIRECTION 
DC_SHAREACCESS 

Definition at line 17 of file dc.h.

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,
27  DC_SYNCHRONIZEACCESS = 0x0100,
28  DC_EPSPRINTINGESCAPE = 0x0200,
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 };
Definition: dc.h:26
Definition: dc.h:21
Definition: dc.h:20
Definition: dc.h:19

◆ _DCTYPE

Enumerator
DCTYPE_DIRECT 
DCTYPE_MEMORY 
DCTYPE_INFO 

Definition at line 39 of file dc.h.

40 {
41  DCTYPE_DIRECT = 0,
42  DCTYPE_MEMORY = 1,
43  DCTYPE_INFO = 2,
44 } DCTYPE;
enum _DCTYPE DCTYPE
Definition: dc.h:43

◆ _FONT_STATE

Enumerator
DC_DIRTYFONT_XFORM 
DC_DIRTYFONT_LFONT 
DC_UFI_MAPPING 

Definition at line 7 of file dc.h.

8 {
11  DC_UFI_MAPPING = 4
12 };

Function Documentation

◆ DC_AllocDcWithHandle()

PDC NTAPI DC_AllocDcWithHandle ( GDILOOBJTYPE  eDcObjType)

Definition at line 69 of file dclife.c.

70 {
71  PDC pdc;
72 
73  NT_ASSERT((eDcObjType == GDILoObjType_LO_DC_TYPE) ||
74  (eDcObjType == GDILoObjType_LO_ALTDC_TYPE));
75 
76  /* Allocate the object */
78  sizeof(DC),
80  if (!pdc)
81  {
82  DPRINT1("Could not allocate a DC.\n");
83  return NULL;
84  }
85 
86  /* Set the actual DC type */
87  pdc->BaseObject.hHmgr = UlongToHandle(eDcObjType);
88 
89  pdc->pdcattr = &pdc->dcattr;
90 
91  /* Insert the object */
92  if (!GDIOBJ_hInsertObject(&pdc->BaseObject, GDI_OBJ_HMGR_POWNED))
93  {
94  DPRINT1("Could not insert DC into handle table.\n");
95  GDIOBJ_vFreeObject(&pdc->BaseObject);
96  return NULL;
97  }
98 
99  return pdc;
100 }
struct DC * PDC
smooth NULL
Definition: ftsmooth.c:416
Definition: polytest.cpp:40
#define UlongToHandle(ul)
Definition: basetsd.h:97
#define GDI_OBJ_HMGR_POWNED
Definition: ntgdihdl.h:117
#define DPRINT1
Definition: precomp.h:8
POBJ NTAPI GDIOBJ_AllocateObject(UCHAR objt, ULONG cjSize, FLONG fl)
Definition: gdiobj.c:559
VOID NTAPI GDIOBJ_vFreeObject(POBJ pobj)
Definition: gdiobj.c:593
#define NT_ASSERT
Definition: rtlfuncs.h:3312
HGDIOBJ NTAPI GDIOBJ_hInsertObject(POBJ pobj, ULONG ulOwner)
Definition: gdiobj.c:909

Referenced by GreCreateCompatibleDC(), GreOpenDCW(), and NtGdiSaveDC().

◆ DC_bAllocDcAttr()

BOOL NTAPI DC_bAllocDcAttr ( PDC  pdc)

Definition at line 31 of file dcattr.c.

32 {
33  PPROCESSINFO ppi;
34  PDC_ATTR pdcattr;
35 
37  ASSERT(ppi);
38 
39  pdcattr = GdiPoolAllocate(ppi->pPoolDcAttr);
40  if (!pdcattr)
41  {
42  DPRINT1("Could not allocate DC attr\n");
43  return FALSE;
44  }
45 
46  /* Copy the content from the kernel mode dc attr */
47  pdc->pdcattr = pdcattr;
48  *pdc->pdcattr = pdc->dcattr;
49 
50  /* Set the object attribute in the handle table */
51  GDIOBJ_vSetObjectAttr(&pdc->BaseObject, pdcattr);
52 
53  DPRINT("DC_AllocDcAttr: pdc=%p, pdc->pdcattr=%p\n", pdc, pdc->pdcattr);
54  return TRUE;
55 }
#define TRUE
Definition: types.h:120
struct _GDI_POOL * pPoolDcAttr
Definition: win32.h:282
void DPRINT(...)
Definition: polytest.cpp:61
PVOID NTAPI GdiPoolAllocate(PGDI_POOL pPool)
Definition: gdipool.c:122
VOID NTAPI GDIOBJ_vSetObjectAttr(POBJ pobj, PVOID pvObjAttr)
Definition: gdiobj.c:1093
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
PVOID NTAPI PsGetCurrentProcessWin32Process(VOID)
Definition: process.c:1183
#define DPRINT1
Definition: precomp.h:8

Referenced by DC_vSetOwner(), GreCreateCompatibleDC(), and GreOpenDCW().

◆ DC_hSelectFont()

HFONT NTAPI DC_hSelectFont ( _In_ PDC  pdc,
_In_ HFONT  hlfntNew 
)

Definition at line 550 of file dcobjs.c.

553 {
554  PLFONT plfntNew;
555  HFONT hlfntOld;
556 
557  // Legacy crap that will die with font engine rewrite
558  if (!NT_SUCCESS(TextIntRealizeFont(hlfntNew, NULL)))
559  {
560  return NULL;
561  }
562 
563  /* Get the current selected font */
564  hlfntOld = pdc->dclevel.plfnt->BaseObject.hHmgr;
565 
566  /* Check if a new font should be selected */
567  if (hlfntNew != hlfntOld)
568  {
569  /* Lock the new font */
570  plfntNew = LFONT_ShareLockFont(hlfntNew);
571  if (plfntNew)
572  {
573  /* Success, dereference the old font */
574  LFONT_ShareUnlockFont(pdc->dclevel.plfnt);
575 
576  /* Select the new font */
577  pdc->dclevel.plfnt = plfntNew;
578  pdc->pdcattr->hlfntNew = hlfntNew;
579 
580  /* Update dirty flags */
581  pdc->pdcattr->ulDirty_ |= DIRTY_CHARSET;
582  pdc->pdcattr->ulDirty_ &= ~SLOW_WIDTHS;
583  }
584  else
585  {
586  /* Failed, restore old, return NULL */
587  pdc->pdcattr->hlfntNew = hlfntOld;
588  hlfntOld = NULL;
589  }
590  }
591 
592  return hlfntOld;
593 }
#define DIRTY_CHARSET
Definition: ntgdihdl.h:149
#define LFONT_ShareUnlockFont(plfnt)
Definition: text.h:78
NTSTATUS FASTCALL TextIntRealizeFont(HFONT FontHandle, PTEXTOBJ pTextObj)
Definition: freetype.c:5342
Definition: text.h:59
smooth NULL
Definition: ftsmooth.c:416
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define SLOW_WIDTHS
Definition: ntgdihdl.h:150
#define LFONT_ShareLockFont(hfont)
Definition: text.h:77
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)

Referenced by GdiFlushUserBatch(), and NtGdiSelectFont().

◆ DC_InvertXform()

BOOL FASTCALL DC_InvertXform ( const XFORM xformSrc,
XFORM xformDest 
)

◆ DC_LockDc()

FORCEINLINE PDC DC_LockDc ( HDC  hdc)

Definition at line 219 of file dc.h.

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 }
struct DC * PDC
PGDIOBJ NTAPI GDIOBJ_LockObject(HGDIOBJ hobj, UCHAR objt)
Definition: gdiobj.c:823
smooth NULL
Definition: ftsmooth.c:416
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
Definition: polytest.cpp:40
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
HDC hdc
Definition: main.c:9

Referenced by _Success_(), DC_vRestoreDC(), DceResetActiveDCEs(), DCU_SetDcUndeletable(), DxEngGetDCState(), DxEngLockDC(), DxEngSetDCState(), ftGdiGetTextMetricsW(), GdiSelectPalette(), GdiSelectVisRgn(), GreCreateCompatibleDC(), GreCreateDIBitmapInternal(), GreDPtoLP(), GreExtTextOutW(), GreGetBkColor(), GreGetBkMode(), GreGetDCOrgEx(), GreGetDCPoint(), GreGetDIBitsInternal(), GreGetGraphicsMode(), GreGetKerningPairs(), GreGetMapMode(), GreGetSetColorTable(), GreGetTextColor(), GreGetTextExtentExW(), GreGetTextExtentW(), GreGradientFill(), GreLPtoDP(), GreMovePointer(), GreMoveTo(), GreSetBrushOrg(), GreSetDCOrg(), GreSetDCOwner(), GreSetPointerShape(), GreSetStretchBltMode(), GreSetViewportOrgEx(), IntAnimatePalette(), intEnableReactXDriver(), IntGdiCleanDC(), IntGdiDeleteDC(), IntGdiPolyPatBlt(), IntGdiRealizePalette(), IntGdiSetBkColor(), IntGdiSetBkMode(), IntGdiSetHookFlags(), IntGdiSetTextAlign(), IntGdiSetTextColor(), IntGetCharDimensions(), IntGetSystemPaletteEntries(), IntPaintDesktop(), IntPolygon(), IntSetDCBrushColor(), IntSetDCPenColor(), NtGdiAbortPath(), NtGdiAngleArc(), NtGdiArcInternal(), NtGdiBeginPath(), NtGdiCloseFigure(), NtGdiCreateCompatibleBitmap(), NtGdiCreateDIBSection(), NtGdiCreateHalftonePalette(), NtGdiEllipse(), NtGdiEndPath(), NtGdiEscape(), NtGdiExcludeClipRect(), NtGdiExtEscape(), NtGdiExtFloodFill(), NtGdiExtSelectClipRgn(), NtGdiFillPath(), NtGdiFillRgn(), NtGdiFlattenPath(), NtGdiFlushUserBatch(), NtGdiGetBoundsRect(), NtGdiGetCharABCWidthsW(), NtGdiGetCharSet(), NtGdiGetCharWidthW(), NtGdiGetDCDword(), NtGdiGetDCObject(), NtGdiGetDeviceCaps(), NtGdiGetDeviceGammaRamp(), NtGdiGetDeviceWidth(), NtGdiGetFontData(), NtGdiGetFontUnicodeRanges(), NtGdiGetGlyphIndicesW(), NtGdiGetGlyphOutline(), NtGdiGetKerningPairs(), NtGdiGetNearestColor(), NtGdiGetOutlineTextMetricsInternalW(), NtGdiGetPath(), NtGdiGetPixel(), NtGdiGetRandomRgn(), NtGdiGetRealizationInfo(), NtGdiGetTextCharsetInfo(), NtGdiGetTextExtentExW(), NtGdiGetTextFaceW(), NtGdiGetTransform(), NtGdiIntersectClipRect(), NtGdiInvertRgn(), NtGdiLineTo(), NtGdiMakeInfoDC(), NtGdiMirrorWindowOrg(), NtGdiModifyWorldTransform(), NtGdiOffsetClipRgn(), NtGdiOffsetViewportOrgEx(), NtGdiOffsetWindowOrgEx(), NtGdiPatBlt(), NtGdiPathToRegion(), NtGdiPolyDraw(), NtGdiPolyPolyDraw(), NtGdiPtVisible(), NtGdiRectangle(), NtGdiRectVisible(), NtGdiRestoreDC(), NtGdiRoundRect(), NtGdiSaveDC(), NtGdiScaleViewportExtEx(), NtGdiScaleWindowExtEx(), NtGdiSelectBitmap(), NtGdiSelectBrush(), NtGdiSelectClipPath(), NtGdiSelectFont(), NtGdiSelectPen(), NtGdiSetBoundsRect(), NtGdiSetColorSpace(), NtGdiSetDeviceGammaRamp(), NtGdiSetDIBitsToDeviceInternal(), NtGdiSetLayout(), NtGdiSetMetaRgn(), NtGdiSetMiterLimit(), NtGdiSetPixel(), NtGdiSetPixelFormat(), NtGdiSetSizeDevice(), NtGdiSetTextJustification(), NtGdiSetViewportOrgEx(), NtGdiSetVirtualResolution(), NtGdiSetWindowOrgEx(), NtGdiStretchDIBitsInternal(), NtGdiStrokeAndFillPath(), NtGdiStrokePath(), NtGdiSwapBuffers(), NtGdiTransformPoints(), NtGdiWidenPath(), NtUserEnumDisplayMonitors(), UserDrawIconEx(), and UserScrollDC().

◆ DC_UnlockDc()

FORCEINLINE VOID DC_UnlockDc ( PDC  pdc)

Definition at line 237 of file dc.h.

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 }
smooth NULL
Definition: ftsmooth.c:416
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
VOID NTAPI GDIOBJ_vUnlockObject(POBJ pobj)
Definition: gdiobj.c:877

Referenced by _Success_(), DC_vRestoreDC(), DceResetActiveDCEs(), DCU_SetDcUndeletable(), DxEngGetDCState(), DxEngSetDCState(), DxEngUnlockDC(), ftGdiGetTextMetricsW(), GdiSelectPalette(), GdiSelectVisRgn(), GreCreateCompatibleDC(), GreCreateDIBitmapInternal(), GreDPtoLP(), GreExtTextOutW(), GreGetBkColor(), GreGetBkMode(), GreGetDCOrgEx(), GreGetDCPoint(), GreGetDIBitsInternal(), GreGetGraphicsMode(), GreGetKerningPairs(), GreGetMapMode(), GreGetSetColorTable(), GreGetTextColor(), GreGetTextExtentExW(), GreGetTextExtentW(), GreGradientFill(), GreLPtoDP(), GreMovePointer(), GreMoveTo(), GreOpenDCW(), GreSetBrushOrg(), GreSetDCOrg(), GreSetDCOwner(), GreSetPointerShape(), GreSetStretchBltMode(), GreSetViewportOrgEx(), GreStretchBltMask(), IntAnimatePalette(), intEnableReactXDriver(), IntGdiCleanDC(), IntGdiDeleteDC(), IntGdiPolyPatBlt(), IntGdiRealizePalette(), IntGdiSetBkColor(), IntGdiSetBkMode(), IntGdiSetHookFlags(), IntGdiSetTextAlign(), IntGdiSetTextColor(), IntGetCharDimensions(), IntGetSystemPaletteEntries(), IntPaintDesktop(), IntPolygon(), IntSetDCBrushColor(), IntSetDCPenColor(), NtGdiAbortPath(), NtGdiAngleArc(), NtGdiArcInternal(), NtGdiBeginPath(), NtGdiCloseFigure(), NtGdiCreateCompatibleBitmap(), NtGdiCreateDIBSection(), NtGdiCreateHalftonePalette(), NtGdiEllipse(), NtGdiEndPath(), NtGdiEscape(), NtGdiExcludeClipRect(), NtGdiExtEscape(), NtGdiExtFloodFill(), NtGdiExtSelectClipRgn(), NtGdiFillPath(), NtGdiFillRgn(), NtGdiFlattenPath(), NtGdiFlushUserBatch(), NtGdiGetBoundsRect(), NtGdiGetCharABCWidthsW(), NtGdiGetCharSet(), NtGdiGetCharWidthW(), NtGdiGetDCDword(), NtGdiGetDCObject(), NtGdiGetDeviceCaps(), NtGdiGetDeviceGammaRamp(), NtGdiGetDeviceWidth(), NtGdiGetFontData(), NtGdiGetFontUnicodeRanges(), NtGdiGetGlyphIndicesW(), NtGdiGetGlyphOutline(), NtGdiGetKerningPairs(), NtGdiGetNearestColor(), NtGdiGetOutlineTextMetricsInternalW(), NtGdiGetPath(), NtGdiGetPixel(), NtGdiGetRandomRgn(), NtGdiGetRealizationInfo(), NtGdiGetTextCharsetInfo(), NtGdiGetTextExtentExW(), NtGdiGetTextFaceW(), NtGdiGetTransform(), NtGdiIntersectClipRect(), NtGdiInvertRgn(), NtGdiLineTo(), NtGdiMakeInfoDC(), NtGdiMaskBlt(), NtGdiMirrorWindowOrg(), NtGdiModifyWorldTransform(), NtGdiOffsetClipRgn(), NtGdiOffsetViewportOrgEx(), NtGdiOffsetWindowOrgEx(), NtGdiPatBlt(), NtGdiPathToRegion(), NtGdiPolyDraw(), NtGdiPolyPolyDraw(), NtGdiPtVisible(), NtGdiRectangle(), NtGdiRectVisible(), NtGdiRestoreDC(), NtGdiRoundRect(), NtGdiSaveDC(), NtGdiScaleViewportExtEx(), NtGdiScaleWindowExtEx(), NtGdiSelectBitmap(), NtGdiSelectBrush(), NtGdiSelectClipPath(), NtGdiSelectFont(), NtGdiSelectPen(), NtGdiSetBoundsRect(), NtGdiSetColorSpace(), NtGdiSetDeviceGammaRamp(), NtGdiSetDIBitsToDeviceInternal(), NtGdiSetLayout(), NtGdiSetMetaRgn(), NtGdiSetMiterLimit(), NtGdiSetPixel(), NtGdiSetPixelFormat(), NtGdiSetSizeDevice(), NtGdiSetTextJustification(), NtGdiSetViewportOrgEx(), NtGdiSetVirtualResolution(), NtGdiSetWindowOrgEx(), NtGdiStretchDIBitsInternal(), NtGdiStrokeAndFillPath(), NtGdiStrokePath(), NtGdiSwapBuffers(), NtGdiTransformPoints(), NtGdiWidenPath(), NtUserEnumDisplayMonitors(), UserDrawIconEx(), and UserScrollDC().

◆ DC_vCleanup()

VOID NTAPI DC_vCleanup ( PVOID  ObjectBody)

Definition at line 357 of file dclife.c.

358 {
359  PDC pdc = (PDC)ObjectBody;
360 
361  /* Free DC_ATTR */
362  DC_vFreeDcAttr(pdc);
363 
364  /* Delete saved DCs */
365  DC_vRestoreDC(pdc, 1);
366 
367  /* Deselect dc objects */
368  DC_vSelectSurface(pdc, NULL);
371  DC_vSelectPalette(pdc, NULL);
372 
373  /* Cleanup the dc brushes */
374  EBRUSHOBJ_vCleanup(&pdc->eboFill);
375  EBRUSHOBJ_vCleanup(&pdc->eboLine);
376  EBRUSHOBJ_vCleanup(&pdc->eboText);
377  EBRUSHOBJ_vCleanup(&pdc->eboBackground);
378 
379  /* Release font */
380  if (pdc->dclevel.plfnt)
381  LFONT_ShareUnlockFont(pdc->dclevel.plfnt);
382 
383  /* Free regions */
384  if (pdc->dclevel.prgnClip)
385  REGION_Delete(pdc->dclevel.prgnClip);
386  if (pdc->dclevel.prgnMeta)
387  REGION_Delete(pdc->dclevel.prgnMeta);
388  if (pdc->prgnVis)
389  REGION_Delete(pdc->prgnVis);
390  if (pdc->prgnRao)
391  REGION_Delete(pdc->prgnRao);
392  if (pdc->prgnAPI)
393  REGION_Delete(pdc->prgnAPI);
394 
395  /* Free CLIPOBJ resources */
396  IntEngFreeClipResources(&pdc->co);
397 
398  if (pdc->dclevel.hPath)
399  {
400  DPRINT("DC_vCleanup Path\n");
401  PATH_Delete(pdc->dclevel.hPath);
402  pdc->dclevel.hPath = 0;
403  pdc->dclevel.flPath = 0;
404  }
405  if (pdc->dclevel.pSurface)
406  SURFACE_ShareUnlockSurface(pdc->dclevel.pSurface);
407 
408  if (pdc->ppdev)
409  PDEVOBJ_vRelease(pdc->ppdev);
410 }
struct DC * PDC
VOID NTAPI EBRUSHOBJ_vCleanup(EBRUSHOBJ *pebo)
Definition: engbrush.c:153
FORCEINLINE VOID DC_vSelectSurface(PDC pdc, PSURFACE psurfNew)
Definition: dc.h:247
#define SURFACE_ShareUnlockSurface(pBMObj)
Definition: surface.h:102
FORCEINLINE VOID DC_vSelectPalette(PDC pdc, PPALETTE ppal)
Definition: dc.h:286
#define LFONT_ShareUnlockFont(plfnt)
Definition: text.h:78
FORCEINLINE VOID DC_vSelectFillBrush(PDC pdc, PBRUSH pbrFill)
Definition: dc.h:262
VOID FASTCALL IntEngFreeClipResources(XCLIPOBJ *Clip)
Definition: clip.c:164
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
Definition: polytest.cpp:40
VOID FASTCALL REGION_Delete(PREGION pRgn)
Definition: region.c:2468
FORCEINLINE VOID DC_vSelectLineBrush(PDC pdc, PBRUSH pbrLine)
Definition: dc.h:274
BOOL FASTCALL PATH_Delete(HPATH hPath)
Definition: path.c:91
VOID NTAPI DC_vRestoreDC(IN PDC pdc, INT iSaveLevel)
Definition: dcstate.c:138
VOID NTAPI PDEVOBJ_vRelease(PPDEVOBJ ppdev)
Definition: pdevobj.c:93
VOID NTAPI DC_vFreeDcAttr(PDC pdc)
Definition: dcattr.c:59

◆ DC_vCopyState()

VOID FASTCALL DC_vCopyState ( PDC  pdcSrc,
PDC  pdcDst,
BOOL  To 
)
Todo:
should aways be != NULL

Definition at line 16 of file dcstate.c.

17 {
18  DPRINT("DC_vCopyState(%p, %p)\n", pdcSrc->BaseObject.hHmgr, pdcDst->BaseObject.hHmgr);
19 
20  /* Copy full DC attribute */
21  *pdcDst->pdcattr = *pdcSrc->pdcattr;
22 
23  /* Get/SetDCState() don't change hVisRgn field ("Undoc. Windows" p.559). */
24  /* The VisRectRegion field needs to be set to a valid state */
25 
26  /* Mark some fields as dirty */
27  pdcDst->pdcattr->ulDirty_ |= (DIRTY_FILL|DIRTY_LINE|DIRTY_TEXT|DIRTY_BACKGROUND|DIRTY_CHARSET|DC_ICM_NOT_CALIBRATED|DC_ICM_NOT_SET); // Note: Use if, To is FALSE....
28 
29  /* Copy DC level */
30  pdcDst->dclevel.pColorSpace = pdcSrc->dclevel.pColorSpace;
31  pdcDst->dclevel.laPath = pdcSrc->dclevel.laPath;
32  pdcDst->dclevel.ca = pdcSrc->dclevel.ca;
33  pdcDst->dclevel.mxWorldToDevice = pdcSrc->dclevel.mxWorldToDevice;
34  pdcDst->dclevel.mxDeviceToWorld = pdcSrc->dclevel.mxDeviceToWorld;
35  pdcDst->dclevel.mxWorldToPage = pdcSrc->dclevel.mxWorldToPage;
36  pdcDst->dclevel.efM11PtoD = pdcSrc->dclevel.efM11PtoD;
37  pdcDst->dclevel.efM22PtoD = pdcSrc->dclevel.efM22PtoD;
38  pdcDst->dclevel.sizl = pdcSrc->dclevel.sizl;
39  pdcDst->dclevel.hpal = pdcSrc->dclevel.hpal;
40 
41  /* Handle references here correctly */
42  DC_vSelectFillBrush(pdcDst, pdcSrc->dclevel.pbrFill);
43  DC_vSelectLineBrush(pdcDst, pdcSrc->dclevel.pbrLine);
44  DC_vSelectPalette(pdcDst, pdcSrc->dclevel.ppal);
45 
46  /* Dereference the old font, reference the new one */
47  if (pdcDst->dclevel.plfnt) LFONT_ShareUnlockFont(pdcDst->dclevel.plfnt);
48  GDIOBJ_vReferenceObjectByPointer(&pdcSrc->dclevel.plfnt->BaseObject);
49  pdcDst->dclevel.plfnt = pdcSrc->dclevel.plfnt;
50 
51  /* Get/SetDCState() don't change hVisRgn field ("Undoc. Windows" p.559). */
52  if (!To)
53  {
54  IntGdiExtSelectClipRgn(pdcDst, pdcSrc->dclevel.prgnClip, RGN_COPY);
55  if (pdcDst->dclevel.prgnMeta)
56  {
57  REGION_Delete(pdcDst->dclevel.prgnMeta);
58  pdcDst->dclevel.prgnMeta = NULL;
59  }
60  /* The only way to reset the Meta Region to its original state is to return to a previously saved version of the DC with SaveDC. */
61  if (pdcSrc->dclevel.prgnMeta)
62  {
63  pdcDst->dclevel.prgnMeta = IntSysCreateRectpRgn(0, 0, 0, 0);
64  IntGdiCombineRgn(pdcDst->dclevel.prgnMeta, pdcSrc->dclevel.prgnMeta, NULL, RGN_COPY);
65  }
66  pdcDst->fs |= DC_FLAG_DIRTY_RAO;
67  }
68 }
FORCEINLINE VOID DC_vSelectPalette(PDC pdc, PPALETTE ppal)
Definition: dc.h:286
#define DIRTY_CHARSET
Definition: ntgdihdl.h:149
#define LFONT_ShareUnlockFont(plfnt)
Definition: text.h:78
FORCEINLINE VOID DC_vSelectFillBrush(PDC pdc, PBRUSH pbrFill)
Definition: dc.h:262
#define DIRTY_BACKGROUND
Definition: ntgdihdl.h:148
INT FASTCALL IntGdiExtSelectClipRgn(PDC dc, PREGION prgn, int fnMode)
PREGION FASTCALL IntSysCreateRectpRgn(INT LeftRect, INT TopRect, INT RightRect, INT BottomRect)
Definition: region.c:2426
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
INT FASTCALL IntGdiCombineRgn(PREGION prgnDest, PREGION prgnSrc1, PREGION prgnSrc2, INT iCombineMode)
Definition: region.c:2506
#define DC_FLAG_DIRTY_RAO
Definition: ntgdihdl.h:132
#define DIRTY_TEXT
Definition: ntgdihdl.h:147
#define DC_ICM_NOT_CALIBRATED
Definition: ntgdihdl.h:162
#define DIRTY_FILL
Definition: ntgdihdl.h:145
#define RGN_COPY
Definition: wingdi.h:356
VOID NTAPI GDIOBJ_vReferenceObjectByPointer(POBJ pobj)
Definition: gdiobj.c:731
#define DIRTY_LINE
Definition: ntgdihdl.h:146
#define DC_ICM_NOT_SET
Definition: ntgdihdl.h:165
VOID FASTCALL REGION_Delete(PREGION pRgn)
Definition: region.c:2468
FORCEINLINE VOID DC_vSelectLineBrush(PDC pdc, PBRUSH pbrLine)
Definition: dc.h:274

Referenced by DC_InitHack(), DC_vRestoreDC(), IntGdiCleanDC(), and NtGdiSaveDC().

◆ DC_vFinishBlit()

VOID FASTCALL DC_vFinishBlit ( PDC  pdc1,
PDC  pdc2 
)

Definition at line 614 of file dclife.c.

615 {
616  if (pdc1->dctype == DCTYPE_DIRECT)
617  {
618  MouseSafetyOnDrawEnd(pdc1->ppdev);
619  EngReleaseSemaphore(pdc1->ppdev->hsemDevLock);
620  }
621 #if DBG
622  pdc1->fs &= ~DC_PREPARED;
623 #endif
624 
625  if (pdc2)
626  {
627  if (pdc2->dctype == DCTYPE_DIRECT)
628  {
629  MouseSafetyOnDrawEnd(pdc2->ppdev);
630  EngReleaseSemaphore(pdc2->ppdev->hsemDevLock);
631  }
632 #if DBG
633  pdc2->fs &= ~DC_PREPARED;
634 #endif
635  }
636 }
VOID WINAPI EngReleaseSemaphore(IN HSEMAPHORE hsem)
Definition: eng.c:235
_Requires_lock_held_ ppdev BOOL NTAPI MouseSafetyOnDrawEnd(_Inout_ PPDEVOBJ ppdev)
Definition: mouse.c:99

Referenced by GreGradientFill(), GreStretchBltMask(), IntExtTextOutW(), IntGdiBitBltRgn(), IntGdiFillRgn(), IntGdiPolyline(), IntPatBlt(), IntRectangle(), IntRoundRect(), NtGdiAlphaBlend(), NtGdiAngleArc(), NtGdiArcInternal(), NtGdiEllipse(), NtGdiExtFloodFill(), NtGdiFillPath(), NtGdiGetPixel(), NtGdiLineTo(), NtGdiMaskBlt(), NtGdiPolyPolyDraw(), NtGdiSetDIBitsToDeviceInternal(), NtGdiStretchDIBitsInternal(), NtGdiStrokeAndFillPath(), NtGdiStrokePath(), NtGdiTransparentBlt(), and UserDrawIconEx().

◆ DC_vFreeDcAttr()

VOID NTAPI DC_vFreeDcAttr ( PDC  pdc)

Definition at line 59 of file dcattr.c.

60 {
61  PPROCESSINFO ppi;
62 
63  if (pdc->pdcattr == &pdc->dcattr)
64  {
65  // Internal DC object!
66  return;
67  }
68 
69  /* Reset the object attribute in the handle table */
70  GDIOBJ_vSetObjectAttr(&pdc->BaseObject, NULL);
71 
73  ASSERT(ppi);
74  GdiPoolFree(ppi->pPoolDcAttr, pdc->pdcattr);
75 
76  /* Reset to kmode dcattr */
77  pdc->pdcattr = &pdc->dcattr;
78 }
VOID NTAPI GdiPoolFree(PGDI_POOL pPool, PVOID pvAlloc)
Definition: gdipool.c:233
struct _GDI_POOL * pPoolDcAttr
Definition: win32.h:282
smooth NULL
Definition: ftsmooth.c:416
VOID NTAPI GDIOBJ_vSetObjectAttr(POBJ pobj, PVOID pvObjAttr)
Definition: gdiobj.c:1093
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
PVOID NTAPI PsGetCurrentProcessWin32Process(VOID)
Definition: process.c:1183

Referenced by DC_vCleanup(), and DC_vSetOwner().

◆ DC_vInitDc()

VOID NTAPI DC_vInitDc ( PDC  pdc,
DCTYPE  dctype,
PPDEVOBJ  ppdev 
)

Definition at line 129 of file dclife.c.

133 {
134  /* Setup some basic fields */
135  pdc->dctype = dctype;
136  pdc->ppdev = ppdev;
137  pdc->dhpdev = ppdev->dhpdev;
138  pdc->hsem = ppdev->hsemDevLock;
139  pdc->flGraphicsCaps = ppdev->devinfo.flGraphicsCaps;
140  pdc->flGraphicsCaps2 = ppdev->devinfo.flGraphicsCaps2;
141  pdc->fs = DC_DIRTY_RAO;
142 
143  /* Setup dc attribute */
144  pdc->pdcattr = &pdc->dcattr;
145  pdc->dcattr.pvLDC = NULL;
146  pdc->dcattr.ulDirty_ = DIRTY_DEFAULT;
147  if (ppdev == gppdevPrimary)
148  pdc->dcattr.ulDirty_ |= DC_PRIMARY_DISPLAY;
149 
150  /* Setup the DC size */
151  if (dctype == DCTYPE_MEMORY)
152  {
153  /* Memory DCs have a 1 x 1 bitmap by default */
154  pdc->dclevel.sizl.cx = 1;
155  pdc->dclevel.sizl.cy = 1;
156  }
157  else
158  {
159  /* Other DC's are as big as the related PDEV */
160  pdc->dclevel.sizl.cx = ppdev->gdiinfo.ulHorzRes;
161  pdc->dclevel.sizl.cy = ppdev->gdiinfo.ulVertRes;
162  }
163 
164  /* Setup Window rect based on DC size */
165  pdc->erclWindow.left = 0;
166  pdc->erclWindow.top = 0;
167  pdc->erclWindow.right = pdc->dclevel.sizl.cx;
168  pdc->erclWindow.bottom = pdc->dclevel.sizl.cy;
169 
170  if (dctype == DCTYPE_DIRECT)
171  {
172  /* Direct DCs get the surface from the PDEV */
173  pdc->dclevel.pSurface = PDEVOBJ_pSurface(ppdev);
174 
175  pdc->erclBounds.left = 0x7fffffff;
176  pdc->erclBounds.top = 0x7fffffff;
177  pdc->erclBounds.right = 0x80000000;
178  pdc->erclBounds.bottom = 0x80000000;
179  pdc->erclBoundsApp.left = 0xffffffff;
180  pdc->erclBoundsApp.top = 0xfffffffc;
181  pdc->erclBoundsApp.right = 0x00007ffc; // FIXME
182  pdc->erclBoundsApp.bottom = 0x00000333; // FIXME
183  pdc->erclClip = pdc->erclBounds;
184  pdc->co = gxcoTrivial;
185  }
186  else
187  {
188  /* Non-direct DCs don't have a surface by default */
189  pdc->dclevel.pSurface = NULL;
190 
191  pdc->erclBounds.left = 0;
192  pdc->erclBounds.top = 0;
193  pdc->erclBounds.right = 0;
194  pdc->erclBounds.bottom = 0;
195  pdc->erclBoundsApp = pdc->erclBounds;
196  pdc->erclClip = pdc->erclWindow;
197  pdc->co = gxcoTrivial;
198  }
199 
200  //pdc->dcattr.VisRectRegion:
201 
202  /* Setup coordinate transformation data */
203  pdc->dclevel.mxWorldToDevice = gmxWorldToDeviceDefault;
204  pdc->dclevel.mxDeviceToWorld = gmxDeviceToWorldDefault;
205  pdc->dclevel.mxWorldToPage = gmxWorldToPageDefault;
206  pdc->dclevel.efM11PtoD = gef16;
207  pdc->dclevel.efM22PtoD = gef16;
208  pdc->dclevel.efDxPtoD = gef0;
209  pdc->dclevel.efDyPtoD = gef0;
210  pdc->dclevel.efM11_TWIPS = gef0;
211  pdc->dclevel.efM22_TWIPS = gef0;
212  pdc->dclevel.efPr11 = gef0;
213  pdc->dclevel.efPr22 = gef0;
214  pdc->dcattr.mxWorldToDevice = pdc->dclevel.mxWorldToDevice;
215  pdc->dcattr.mxDeviceToWorld = pdc->dclevel.mxDeviceToWorld;
216  pdc->dcattr.mxWorldToPage = pdc->dclevel.mxWorldToPage;
217  pdc->dcattr.efM11PtoD = pdc->dclevel.efM11PtoD;
218  pdc->dcattr.efM22PtoD = pdc->dclevel.efM22PtoD;
219  pdc->dcattr.efDxPtoD = pdc->dclevel.efDxPtoD;
220  pdc->dcattr.efDyPtoD = pdc->dclevel.efDyPtoD;
221  pdc->dcattr.iMapMode = MM_TEXT;
222  pdc->dcattr.dwLayout = 0;
223  pdc->dcattr.flXform = PAGE_TO_DEVICE_SCALE_IDENTITY |
226 
227  /* Setup more coordinates */
228  pdc->ptlDCOrig.x = 0;
229  pdc->ptlDCOrig.y = 0;
230  pdc->dcattr.lWindowOrgx = 0;
231  pdc->dcattr.ptlWindowOrg.x = 0;
232  pdc->dcattr.ptlWindowOrg.y = 0;
233  pdc->dcattr.szlWindowExt.cx = 1;
234  pdc->dcattr.szlWindowExt.cy = 1;
235  pdc->dcattr.ptlViewportOrg.x = 0;
236  pdc->dcattr.ptlViewportOrg.y = 0;
237  pdc->dcattr.szlViewportExt.cx = 1;
238  pdc->dcattr.szlViewportExt.cy = 1;
239  pdc->dcattr.szlVirtualDevicePixel.cx = ppdev->gdiinfo.ulHorzRes;
240  pdc->dcattr.szlVirtualDevicePixel.cy = ppdev->gdiinfo.ulVertRes;
241  pdc->dcattr.szlVirtualDeviceMm.cx = ppdev->gdiinfo.ulHorzSize;
242  pdc->dcattr.szlVirtualDeviceMm.cy = ppdev->gdiinfo.ulVertSize;
243  pdc->dcattr.szlVirtualDeviceSize.cx = 0;
244  pdc->dcattr.szlVirtualDeviceSize.cy = 0;
245 
246  /* Setup regions */
247  pdc->prgnAPI = NULL;
248  pdc->prgnRao = NULL;
249  pdc->dclevel.prgnClip = NULL;
250  pdc->dclevel.prgnMeta = NULL;
251  /* Allocate a Vis region */
252  pdc->prgnVis = IntSysCreateRectpRgn(0, 0, pdc->dclevel.sizl.cx, pdc->dclevel.sizl.cy);
253  ASSERT(pdc->prgnVis);
254 
255  /* Setup Vis Region Attribute information */
256  UpdateVisRgn(pdc);
257 
258  /* Initialize Clip object */
259  IntEngInitClipObj(&pdc->co);
260 
261  /* Setup palette */
262  pdc->dclevel.hpal = StockObjects[DEFAULT_PALETTE];
263  pdc->dclevel.ppal = PALETTE_ShareLockPalette(pdc->dclevel.hpal);
264 
265  /* Setup path */
266  pdc->dclevel.hPath = NULL;
267  pdc->dclevel.flPath = 0;
268 // pdc->dclevel.lapath:
269 
270  /* Setup colors */
271  pdc->dcattr.crBackgroundClr = RGB(0xff, 0xff, 0xff);
272  pdc->dcattr.ulBackgroundClr = RGB(0xff, 0xff, 0xff);
273  pdc->dcattr.crForegroundClr = RGB(0, 0, 0);
274  pdc->dcattr.ulForegroundClr = RGB(0, 0, 0);
275  pdc->dcattr.crBrushClr = RGB(0xff, 0xff, 0xff);
276  pdc->dcattr.ulBrushClr = RGB(0xff, 0xff, 0xff);
277  pdc->dcattr.crPenClr = RGB(0, 0, 0);
278  pdc->dcattr.ulPenClr = RGB(0, 0, 0);
279 
280  /* Select the default fill and line brush */
281  pdc->dcattr.hbrush = StockObjects[WHITE_BRUSH];
282  pdc->dcattr.hpen = StockObjects[BLACK_PEN];
283  pdc->dclevel.pbrFill = BRUSH_ShareLockBrush(pdc->pdcattr->hbrush);
284  pdc->dclevel.pbrLine = PEN_ShareLockPen(pdc->pdcattr->hpen);
285  pdc->dclevel.ptlBrushOrigin.x = 0;
286  pdc->dclevel.ptlBrushOrigin.y = 0;
287  pdc->dcattr.ptlBrushOrigin = pdc->dclevel.ptlBrushOrigin;
288 
289  /* Initialize EBRUSHOBJs */
290  EBRUSHOBJ_vInitFromDC(&pdc->eboFill, pdc->dclevel.pbrFill, pdc);
291  EBRUSHOBJ_vInitFromDC(&pdc->eboLine, pdc->dclevel.pbrLine, pdc);
292  EBRUSHOBJ_vInitFromDC(&pdc->eboText, pbrDefaultBrush, pdc);
293  EBRUSHOBJ_vInitFromDC(&pdc->eboBackground, pbrDefaultBrush, pdc);
294 
295  /* Setup fill data */
296  pdc->dcattr.jROP2 = R2_COPYPEN;
297  pdc->dcattr.jBkMode = 2;
298  pdc->dcattr.lBkMode = 2;
299  pdc->dcattr.jFillMode = ALTERNATE;
300  pdc->dcattr.lFillMode = 1;
301  pdc->dcattr.jStretchBltMode = 1;
302  pdc->dcattr.lStretchBltMode = 1;
303  pdc->ptlFillOrigin.x = 0;
304  pdc->ptlFillOrigin.y = 0;
305 
306  /* Setup drawing position */
307  pdc->dcattr.ptlCurrent.x = 0;
308  pdc->dcattr.ptlCurrent.y = 0;
309  pdc->dcattr.ptfxCurrent.x = 0;
310  pdc->dcattr.ptfxCurrent.y = 0;
311 
312  /* Setup ICM data */
313  pdc->dclevel.lIcmMode = 0;
314  pdc->dcattr.lIcmMode = 0;
315  pdc->dcattr.hcmXform = NULL;
316  pdc->dcattr.flIcmFlags = 0;
317  pdc->dcattr.IcmBrushColor = CLR_INVALID;
318  pdc->dcattr.IcmPenColor = CLR_INVALID;
319  pdc->dcattr.pvLIcm = NULL;
320  pdc->dcattr.hColorSpace = NULL; // FIXME: 0189001f
321  pdc->dclevel.pColorSpace = NULL; // FIXME
322  pdc->pClrxFormLnk = NULL;
323 // pdc->dclevel.ca =
324 
325  /* Setup font data */
326  pdc->hlfntCur = NULL; // FIXME: 2f0a0cf8
327  pdc->pPFFList = NULL;
328  pdc->flSimulationFlags = 0;
329  pdc->lEscapement = 0;
330  pdc->prfnt = NULL;
331  pdc->dcattr.flFontMapper = 0;
332  pdc->dcattr.flTextAlign = 0;
333  pdc->dcattr.lTextAlign = 0;
334  pdc->dcattr.lTextExtra = 0;
335  pdc->dcattr.lRelAbs = 1;
336  pdc->dcattr.lBreakExtra = 0;
337  pdc->dcattr.cBreak = 0;
338  pdc->dcattr.hlfntNew = StockObjects[SYSTEM_FONT];
339  pdc->dclevel.plfnt = LFONT_ShareLockFont(pdc->dcattr.hlfntNew);
340 
341  /* Other stuff */
342  pdc->hdcNext = NULL;
343  pdc->hdcPrev = NULL;
344  pdc->ipfdDevMax = 0;
345  pdc->ulCopyCount = -1;
346  pdc->ptlDoBanding.x = 0;
347  pdc->ptlDoBanding.y = 0;
348  pdc->dclevel.lSaveDepth = 1;
349  pdc->dclevel.hdcSave = NULL;
350  pdc->dcattr.iGraphicsMode = GM_COMPATIBLE;
351  pdc->dcattr.iCS_CP = 0;
352  pdc->pSurfInfo = NULL;
353 }
DHPDEV dhpdev
Definition: pdevobj.h:121
PBRUSH pbrDefaultBrush
Definition: dclife.c:18
VOID FASTCALL IntEngInitClipObj(XCLIPOBJ *Clip)
Definition: clip.c:158
XCLIPOBJ gxcoTrivial
Definition: bitblt.c:15
#define BRUSH_ShareLockBrush(hBrush)
Definition: brush.h:113
PSURFACE NTAPI PDEVOBJ_pSurface(PPDEVOBJ ppdev)
Definition: pdevobj.c:233
GDIINFO gdiinfo
Definition: pdevobj.h:124
PPDEVOBJ gppdevPrimary
Definition: pdevobj.c:13
#define PAGE_TO_DEVICE_IDENTITY
Definition: ntgdihdl.h:199
#define CLR_INVALID
Definition: wingdi.h:882
VOID FASTCALL UpdateVisRgn(PDC pdc)
Definition: cliprgn.c:39
#define gmxDeviceToWorldDefault
Definition: dclife.c:46
#define WHITE_BRUSH
Definition: wingdi.h:901
#define R2_COPYPEN
Definition: wingdi.h:338
#define DC_PRIMARY_DISPLAY
Definition: ntgdihdl.h:161
ULONG ulVertSize
Definition: winddi.h:881
PREGION FASTCALL IntSysCreateRectpRgn(INT LeftRect, INT TopRect, INT RightRect, INT BottomRect)
Definition: region.c:2426
HGDIOBJ StockObjects[]
Definition: stockobj.c:100
#define ALTERNATE
Definition: constants.h:278
ULONG ulHorzRes
Definition: winddi.h:882
smooth NULL
Definition: ftsmooth.c:416
#define SYSTEM_FONT
Definition: wingdi.h:910
HSEMAPHORE hsemDevLock
Definition: pdevobj.h:91
#define PALETTE_ShareLockPalette(hpal)
Definition: palette.h:57
#define DEFAULT_PALETTE
Definition: wingdi.h:912
DEVINFO devinfo
Definition: pdevobj.h:123
#define RGB(r, g, b)
Definition: wingdi.h:2935
ULONG ulHorzSize
Definition: winddi.h:880
static const FLOATOBJ gef0
Definition: floatobj.h:115
#define GM_COMPATIBLE
Definition: wingdi.h:863
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define WORLD_TO_PAGE_IDENTITY
Definition: ntgdihdl.h:190
static const FLOATOBJ gef16
Definition: floatobj.h:117
#define PAGE_TO_DEVICE_SCALE_IDENTITY
Definition: ntgdihdl.h:200
VOID NTAPI EBRUSHOBJ_vInitFromDC(EBRUSHOBJ *pebo, PBRUSH pbrush, PDC pdc)
Definition: engbrush.c:112
#define BLACK_PEN
Definition: wingdi.h:902
FLONG flGraphicsCaps
Definition: winddi.h:390
#define DIRTY_DEFAULT
Definition: dclife.c:15
#define LFONT_ShareLockFont(hfont)
Definition: text.h:77
#define gmxWorldToDeviceDefault
Definition: dclife.c:45
#define MM_TEXT
Definition: wingdi.h:872
const MATRIX gmxWorldToPageDefault
Definition: dclife.c:36
ULONG ulVertRes
Definition: winddi.h:883
PBRUSH FASTCALL PEN_ShareLockPen(HPEN hobj)
Definition: pen.c:61
FLONG flGraphicsCaps2
Definition: winddi.h:399

Referenced by GreCreateCompatibleDC(), GreOpenDCW(), and NtGdiSaveDC().

◆ DC_vPrepareDCsForBlit()

VOID FASTCALL DC_vPrepareDCsForBlit ( PDC  pdcDest,
const RECT rcDest,
PDC  pdcSrc,
const RECT rcSrc 
)

Definition at line 505 of file dclife.c.

510 {
511  PDC pdcFirst, pdcSecond;
512  const RECT *prcFirst, *prcSecond;
513 
514  /* Update brushes */
515  if (pdcDest->pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
516  DC_vUpdateFillBrush(pdcDest);
517  if (pdcDest->pdcattr->ulDirty_ & (DIRTY_LINE | DC_PEN_DIRTY))
518  DC_vUpdateLineBrush(pdcDest);
519  if(pdcDest->pdcattr->ulDirty_ & DIRTY_TEXT)
520  DC_vUpdateTextBrush(pdcDest);
521 
522  /* Lock them in good order */
523  if (pdcSrc)
524  {
525  if((ULONG_PTR)pdcDest->ppdev->hsemDevLock >=
526  (ULONG_PTR)pdcSrc->ppdev->hsemDevLock)
527  {
528  pdcFirst = pdcDest;
529  prcFirst = rcDest;
530  pdcSecond = pdcSrc;
531  prcSecond = rcSrc;
532  }
533  else
534  {
535  pdcFirst = pdcSrc;
536  prcFirst = rcSrc;
537  pdcSecond = pdcDest;
538  prcSecond = rcDest;
539  }
540  }
541  else
542  {
543  pdcFirst = pdcDest;
544  prcFirst = rcDest;
545  pdcSecond = NULL;
546  prcSecond = NULL;
547  }
548 
549  if (pdcDest->fs & DC_FLAG_DIRTY_RAO)
550  CLIPPING_UpdateGCRegion(pdcDest);
551 
552  /* Lock and update first DC */
553  if (pdcFirst->dctype == DCTYPE_DIRECT)
554  {
555  EngAcquireSemaphore(pdcFirst->ppdev->hsemDevLock);
556 
557  /* Update surface if needed */
558  if (pdcFirst->ppdev->pSurface != pdcFirst->dclevel.pSurface)
559  {
560  DC_vUpdateDC(pdcFirst);
561  }
562  }
563 
564  if (pdcFirst->dctype == DCTYPE_DIRECT)
565  {
566  if (!prcFirst)
567  prcFirst = &pdcFirst->erclClip;
568 
569  MouseSafetyOnDrawStart(pdcFirst->ppdev,
570  prcFirst->left,
571  prcFirst->top,
572  prcFirst->right,
573  prcFirst->bottom) ;
574  }
575 
576 #if DBG
577  pdcFirst->fs |= DC_PREPARED;
578 #endif
579 
580  if (!pdcSecond)
581  return;
582 
583  /* Lock and update second DC */
584  if (pdcSecond->dctype == DCTYPE_DIRECT)
585  {
586  EngAcquireSemaphore(pdcSecond->ppdev->hsemDevLock);
587 
588  /* Update surface if needed */
589  if (pdcSecond->ppdev->pSurface != pdcSecond->dclevel.pSurface)
590  {
591  DC_vUpdateDC(pdcSecond);
592  }
593  }
594 
595  if (pdcSecond->dctype == DCTYPE_DIRECT)
596  {
597  if (!prcSecond)
598  prcSecond = &pdcSecond->erclClip;
599  MouseSafetyOnDrawStart(pdcSecond->ppdev,
600  prcSecond->left,
601  prcSecond->top,
602  prcSecond->right,
603  prcSecond->bottom) ;
604  }
605 
606 #if DBG
607  pdcSecond->fs |= DC_PREPARED;
608 #endif
609 }
VOID FASTCALL DC_vUpdateLineBrush(PDC pdc)
Definition: dcobjs.c:62
static void DC_vUpdateDC(PDC pdc)
Definition: dclife.c:475
#define DC_PEN_DIRTY
Definition: ntgdihdl.h:158
LONG top
Definition: windef.h:292
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
uint32_t ULONG_PTR
Definition: typedefs.h:63
_Requires_lock_held_ ppdev BOOL NTAPI MouseSafetyOnDrawStart(_Inout_ PPDEVOBJ ppdev, _In_ LONG HazardX1, _In_ LONG HazardY1, _In_ LONG HazardX2, _In_ LONG HazardY2)
Definition: mouse.c:41
ENGAPI VOID APIENTRY EngAcquireSemaphore(_Inout_ HSEMAPHORE hsem)
smooth NULL
Definition: ftsmooth.c:416
VOID FASTCALL DC_vUpdateTextBrush(PDC pdc)
Definition: dcobjs.c:108
Definition: polytest.cpp:40
#define DC_FLAG_DIRTY_RAO
Definition: ntgdihdl.h:132
VOID FASTCALL CLIPPING_UpdateGCRegion(PDC pDC)
Definition: cliprgn.c:771
#define DIRTY_TEXT
Definition: ntgdihdl.h:147
#define DIRTY_FILL
Definition: ntgdihdl.h:145
#define DC_BRUSH_DIRTY
Definition: ntgdihdl.h:157
LONG bottom
Definition: windef.h:294
#define DIRTY_LINE
Definition: ntgdihdl.h:146
VOID FASTCALL DC_vUpdateFillBrush(PDC pdc)
Definition: dcobjs.c:16

Referenced by GreGradientFill(), GreStretchBltMask(), IntExtTextOutW(), IntGdiBitBltRgn(), IntGdiFillRgn(), IntGdiPolyline(), IntPatBlt(), IntRectangle(), IntRoundRect(), NtGdiAlphaBlend(), NtGdiAngleArc(), NtGdiArcInternal(), NtGdiEllipse(), NtGdiExtFloodFill(), NtGdiFillPath(), NtGdiGetPixel(), NtGdiLineTo(), NtGdiMaskBlt(), NtGdiPolyPolyDraw(), NtGdiSetDIBitsToDeviceInternal(), NtGdiStretchDIBitsInternal(), NtGdiStrokeAndFillPath(), NtGdiStrokePath(), NtGdiTransparentBlt(), and UserDrawIconEx().

◆ DC_vRestoreDC()

VOID NTAPI DC_vRestoreDC ( IN PDC  pdc,
INT  iSaveLevel 
)

Definition at line 138 of file dcstate.c.

141 {
142  HDC hdcSave;
143  PDC pdcSave;
144 
145  NT_ASSERT(iSaveLevel > 0);
146  DPRINT("DC_vRestoreDC(%p, %ld)\n", pdc->BaseObject.hHmgr, iSaveLevel);
147 
148  /* Loop the save levels */
149  while (pdc->dclevel.lSaveDepth > iSaveLevel)
150  {
151  hdcSave = pdc->dclevel.hdcSave;
152  DPRINT("RestoreDC = %p\n", hdcSave);
153 
154  /* Set us as the owner */
155  if (!GreSetObjectOwner(hdcSave, GDI_OBJ_HMGR_POWNED))
156  {
157  /* Could not get ownership. That's bad! */
158  DPRINT1("Could not get ownership of saved DC (%p) for hdc %p!\n",
159  hdcSave, pdc->BaseObject.hHmgr);
160  NT_ASSERT(FALSE);
161  return;// FALSE;
162  }
163 
164  /* Lock the saved dc */
165  pdcSave = DC_LockDc(hdcSave);
166  if (!pdcSave)
167  {
168  /* WTF? Internal error! */
169  DPRINT1("Could not lock the saved DC (%p) for dc %p!\n",
170  hdcSave, pdc->BaseObject.hHmgr);
171  NT_ASSERT(FALSE);
172  return;// FALSE;
173  }
174 
175  /* Remove the saved dc from the queue */
176  pdc->dclevel.hdcSave = pdcSave->dclevel.hdcSave;
177 
178  /* Decrement save level */
179  pdc->dclevel.lSaveDepth--;
180 
181  /* Is this the state we want? */
182  if (pdc->dclevel.lSaveDepth == iSaveLevel)
183  {
184  /* Copy the state back */
185  DC_vCopyState(pdcSave, pdc, FALSE);
186 
187  /* Only memory DC's change their surface */
188  if (pdc->dctype == DCTYPE_MEMORY)
189  DC_vSelectSurface(pdc, pdcSave->dclevel.pSurface);
190 
191  if (pdcSave->dclevel.hPath)
192  {
193  PATH_RestorePath( pdc, pdcSave );
194  }
195  }
196 
197  /* Prevent save dc from being restored */
198  pdcSave->dclevel.lSaveDepth = 1;
199 
200  /* Unlock it */
201  DC_UnlockDc(pdcSave);
202  /* Delete the saved dc */
203  GreDeleteObject(hdcSave);
204  }
205 
206  DPRINT("Leave DC_vRestoreDC()\n");
207 }
BOOL NTAPI GreSetObjectOwner(HGDIOBJ hobj, ULONG ulOwner)
Definition: gdiobj.c:1252
BOOL NTAPI GreDeleteObject(HGDIOBJ hobj)
Definition: gdiobj.c:1155
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
FORCEINLINE VOID DC_vSelectSurface(PDC pdc, PSURFACE psurfNew)
Definition: dc.h:247
BOOL PATH_RestorePath(DC *dst, DC *src)
Definition: path.c:210
static HDC
Definition: imagelist.c:92
void DPRINT(...)
Definition: polytest.cpp:61
Definition: polytest.cpp:40
#define GDI_OBJ_HMGR_POWNED
Definition: ntgdihdl.h:117
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
#define DPRINT1
Definition: precomp.h:8
VOID FASTCALL DC_vCopyState(PDC pdcSrc, PDC pdcDst, BOOL To)
Definition: dcstate.c:16
#define NT_ASSERT
Definition: rtlfuncs.h:3312

Referenced by DC_vCleanup(), DC_vSetOwner(), and NtGdiRestoreDC().

◆ DC_vSelectFillBrush()

FORCEINLINE VOID DC_vSelectFillBrush ( PDC  pdc,
PBRUSH  pbrFill 
)

Definition at line 262 of file dc.h.

263 {
264  PBRUSH pbrFillOld = pdc->dclevel.pbrFill;
265  if (pbrFillOld)
266  BRUSH_ShareUnlockBrush(pbrFillOld);
267  if (pbrFill)
269  pdc->dclevel.pbrFill = pbrFill;
270 }
#define BRUSH_ShareUnlockBrush(pBrush)
Definition: brush.h:114
Definition: types.h:100
VOID NTAPI GDIOBJ_vReferenceObjectByPointer(POBJ pobj)
Definition: gdiobj.c:731

Referenced by DC_vCleanup(), and DC_vCopyState().

◆ DC_vSelectLineBrush()

FORCEINLINE VOID DC_vSelectLineBrush ( PDC  pdc,
PBRUSH  pbrLine 
)

Definition at line 274 of file dc.h.

275 {
276  PBRUSH pbrLineOld = pdc->dclevel.pbrLine;
277  if (pbrLineOld)
278  BRUSH_ShareUnlockBrush(pbrLineOld);
279  if (pbrLine)
281  pdc->dclevel.pbrLine = pbrLine;
282 }
#define BRUSH_ShareUnlockBrush(pBrush)
Definition: brush.h:114
Definition: types.h:100
VOID NTAPI GDIOBJ_vReferenceObjectByPointer(POBJ pobj)
Definition: gdiobj.c:731

Referenced by DC_vCleanup(), and DC_vCopyState().

◆ DC_vSelectPalette()

FORCEINLINE VOID DC_vSelectPalette ( PDC  pdc,
PPALETTE  ppal 
)

Definition at line 286 of file dc.h.

287 {
288  PPALETTE ppalOld = pdc->dclevel.ppal;
289  if (ppalOld)
291  if (ppal)
293  pdc->dclevel.ppal = ppal;
294 }
#define PALETTE_ShareUnlockPalette(ppal)
Definition: palette.h:59
VOID NTAPI GDIOBJ_vReferenceObjectByPointer(POBJ pobj)
Definition: gdiobj.c:731

Referenced by DC_vCleanup(), DC_vCopyState(), and GdiSelectPalette().

◆ DC_vSelectSurface()

FORCEINLINE VOID DC_vSelectSurface ( PDC  pdc,
PSURFACE  psurfNew 
)

Definition at line 247 of file dc.h.

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 }
#define SURFACE_ShareUnlockSurface(pBMObj)
Definition: surface.h:102
smooth NULL
Definition: ftsmooth.c:416
VOID NTAPI GDIOBJ_vReferenceObjectByPointer(POBJ pobj)
Definition: gdiobj.c:731
HDC hdc
Definition: surface.h:26

Referenced by DC_vCleanup(), DC_vRestoreDC(), and NtGdiSaveDC().

◆ DC_vSetBrushOrigin()

VOID NTAPI DC_vSetBrushOrigin ( PDC  pdc,
LONG  x,
LONG  y 
)

Definition at line 142 of file dcobjs.c.

143 {
144  /* Set the brush origin */
145  pdc->dclevel.ptlBrushOrigin.x = x;
146  pdc->dclevel.ptlBrushOrigin.y = y;
147 
148  /* Set the fill origin */
149  pdc->ptlFillOrigin.x = x + pdc->ptlDCOrig.x;
150  pdc->ptlFillOrigin.y = y + pdc->ptlDCOrig.y;
151 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

Referenced by GdiFlushUserBatch(), and GreSetBrushOrg().

◆ DC_vUpdateBackgroundBrush()

VOID FASTCALL DC_vUpdateBackgroundBrush ( PDC  pdc)

Definition at line 126 of file dcobjs.c.

127 {
128  PDC_ATTR pdcattr = pdc->pdcattr;
129 
130  if(pdcattr->ulDirty_ & DIRTY_BACKGROUND)
131  EBRUSHOBJ_vUpdateFromDC(&pdc->eboBackground, pbrDefaultBrush, pdc);
132 
133  /* Update the eboBackground's solid color */
134  EBRUSHOBJ_vSetSolidRGBColor(&pdc->eboBackground, pdcattr->crBackgroundClr);
135 
136  /* Clear flag */
137  pdcattr->ulDirty_ &= ~DIRTY_BACKGROUND;
138 }
VOID FASTCALL EBRUSHOBJ_vSetSolidRGBColor(EBRUSHOBJ *pebo, COLORREF crColor)
Definition: engbrush.c:122
_Notnull_ PBRUSH pbrDefaultBrush
Definition: dclife.c:18
VOID NTAPI EBRUSHOBJ_vUpdateFromDC(EBRUSHOBJ *pebo, PBRUSH pbrush, PDC pdc)
Definition: engbrush.c:194
#define DIRTY_BACKGROUND
Definition: ntgdihdl.h:148
ULONG ulDirty_
Definition: ntgdihdl.h:298
COLORREF crBackgroundClr
Definition: ntgdihdl.h:301

Referenced by GdiFlushUserBatch(), IntExtTextOutW(), and IntGdiCleanDC().

◆ DC_vUpdateFillBrush()

VOID FASTCALL DC_vUpdateFillBrush ( PDC  pdc)

Definition at line 16 of file dcobjs.c.

17 {
18  PDC_ATTR pdcattr = pdc->pdcattr;
19  PBRUSH pbrFill;
20 
21  /* Check if the brush handle has changed */
22  if (pdcattr->hbrush != pdc->dclevel.pbrFill->BaseObject.hHmgr)
23  {
24  /* Try to lock the new brush */
25  pbrFill = BRUSH_ShareLockBrush(pdcattr->hbrush);
26  if (pbrFill)
27  {
28  /* Unlock old brush, set new brush */
29  BRUSH_ShareUnlockBrush(pdc->dclevel.pbrFill);
30  pdc->dclevel.pbrFill = pbrFill;
31 
32  /* Mark eboFill as dirty */
33  pdcattr->ulDirty_ |= DIRTY_FILL;
34  }
35  else
36  {
37  /* Invalid brush handle, restore old one */
38  pdcattr->hbrush = pdc->dclevel.pbrFill->BaseObject.hHmgr;
39  }
40  }
41 
42  /* Check if the EBRUSHOBJ needs update */
43  if (pdcattr->ulDirty_ & DIRTY_FILL)
44  {
45  /* Update eboFill */
46  EBRUSHOBJ_vUpdateFromDC(&pdc->eboFill, pdc->dclevel.pbrFill, pdc);
47  }
48 
49  /* Check for DC brush */
50  if (pdcattr->hbrush == StockObjects[DC_BRUSH])
51  {
52  /* Update the eboFill's solid color */
53  EBRUSHOBJ_vSetSolidRGBColor(&pdc->eboFill, pdcattr->crBrushClr);
54  }
55 
56  /* Clear flags */
57  pdcattr->ulDirty_ &= ~(DIRTY_FILL | DC_BRUSH_DIRTY);
58 }
#define BRUSH_ShareUnlockBrush(pBrush)
Definition: brush.h:114
VOID FASTCALL EBRUSHOBJ_vSetSolidRGBColor(EBRUSHOBJ *pebo, COLORREF crColor)
Definition: engbrush.c:122
HANDLE hbrush
Definition: ntgdihdl.h:299
#define BRUSH_ShareLockBrush(hBrush)
Definition: brush.h:113
VOID NTAPI EBRUSHOBJ_vUpdateFromDC(EBRUSHOBJ *pebo, PBRUSH pbrush, PDC pdc)
Definition: engbrush.c:194
HGDIOBJ StockObjects[]
Definition: stockobj.c:100
ULONG ulDirty_
Definition: ntgdihdl.h:298
Definition: types.h:100
COLORREF crBrushClr
Definition: ntgdihdl.h:305
#define DIRTY_FILL
Definition: ntgdihdl.h:145
#define DC_BRUSH_DIRTY
Definition: ntgdihdl.h:157

Referenced by DC_vPrepareDCsForBlit(), GdiFlushUserBatch(), GreStretchBltMask(), IntGdiCleanDC(), IntGdiFillRgn(), IntGdiPolygon(), IntGdiSetTextColor(), IntRectangle(), IntRoundRect(), NtGdiAngleArc(), NtGdiArcInternal(), NtGdiEllipse(), NtGdiFillPath(), NtGdiGetDCObject(), NtGdiMaskBlt(), NtGdiPatBlt(), NtGdiPolyDraw(), NtGdiPolyPolyDraw(), NtGdiSelectBrush(), and NtGdiStrokeAndFillPath().

◆ DC_vUpdateLineBrush()

VOID FASTCALL DC_vUpdateLineBrush ( PDC  pdc)

Definition at line 62 of file dcobjs.c.

63 {
64  PDC_ATTR pdcattr = pdc->pdcattr;
65  PBRUSH pbrLine;
66 
67  /* Check if the pen handle has changed */
68  if (pdcattr->hpen != pdc->dclevel.pbrLine->BaseObject.hHmgr)
69  {
70  /* Try to lock the new pen */
71  pbrLine = PEN_ShareLockPen(pdcattr->hpen);
72  if (pbrLine)
73  {
74  /* Unlock old brush, set new brush */
75  BRUSH_ShareUnlockBrush(pdc->dclevel.pbrLine);
76  pdc->dclevel.pbrLine = pbrLine;
77 
78  /* Mark eboLine as dirty */
79  pdcattr->ulDirty_ |= DIRTY_LINE;
80  }
81  else
82  {
83  /* Invalid pen handle, restore old one */
84  pdcattr->hpen = pdc->dclevel.pbrLine->BaseObject.hHmgr;
85  }
86  }
87 
88  /* Check if the EBRUSHOBJ needs update */
89  if (pdcattr->ulDirty_ & DIRTY_LINE)
90  {
91  /* Update eboLine */
92  EBRUSHOBJ_vUpdateFromDC(&pdc->eboLine, pdc->dclevel.pbrLine, pdc);
93  }
94 
95  /* Check for DC pen */
96  if (pdcattr->hpen == StockObjects[DC_PEN])
97  {
98  /* Update the eboLine's solid color */
99  EBRUSHOBJ_vSetSolidRGBColor(&pdc->eboLine, pdcattr->crPenClr);
100  }
101 
102  /* Clear flags */
103  pdcattr->ulDirty_ &= ~(DIRTY_LINE | DC_PEN_DIRTY);
104 }
#define BRUSH_ShareUnlockBrush(pBrush)
Definition: brush.h:114
VOID FASTCALL EBRUSHOBJ_vSetSolidRGBColor(EBRUSHOBJ *pebo, COLORREF crColor)
Definition: engbrush.c:122
HANDLE hpen
Definition: ntgdihdl.h:300
#define DC_PEN_DIRTY
Definition: ntgdihdl.h:158
COLORREF crPenClr
Definition: ntgdihdl.h:307
VOID NTAPI EBRUSHOBJ_vUpdateFromDC(EBRUSHOBJ *pebo, PBRUSH pbrush, PDC pdc)
Definition: engbrush.c:194
HGDIOBJ StockObjects[]
Definition: stockobj.c:100
ULONG ulDirty_
Definition: ntgdihdl.h:298
Definition: types.h:100
#define DIRTY_LINE
Definition: ntgdihdl.h:146
PBRUSH FASTCALL PEN_ShareLockPen(HPEN hobj)
Definition: pen.c:61

Referenced by DC_vPrepareDCsForBlit(), IntGdiCleanDC(), IntGdiPolygon(), IntGdiSetTextColor(), IntRectangle(), IntRoundRect(), NtGdiAngleArc(), NtGdiArcInternal(), NtGdiEllipse(), NtGdiFillPath(), NtGdiGetDCObject(), NtGdiPolyDraw(), NtGdiPolyPolyDraw(), NtGdiSelectPen(), NtGdiStrokeAndFillPath(), and NtGdiStrokePath().

◆ DC_vUpdateTextBrush()

VOID FASTCALL DC_vUpdateTextBrush ( PDC  pdc)

Definition at line 108 of file dcobjs.c.

109 {
110  PDC_ATTR pdcattr = pdc->pdcattr;
111 
112  /* Timo : The text brush should never be changed.
113  * Jérôme : Yeah, but its palette must be updated anyway! */
114  if(pdcattr->ulDirty_ & DIRTY_TEXT)
115  EBRUSHOBJ_vUpdateFromDC(&pdc->eboText, pbrDefaultBrush, pdc);
116 
117  /* Update the eboText's solid color */
118  EBRUSHOBJ_vSetSolidRGBColor(&pdc->eboText, pdcattr->crForegroundClr);
119 
120  /* Clear flag */
121  pdcattr->ulDirty_ &= ~DIRTY_TEXT;
122 }
VOID FASTCALL EBRUSHOBJ_vSetSolidRGBColor(EBRUSHOBJ *pebo, COLORREF crColor)
Definition: engbrush.c:122
_Notnull_ PBRUSH pbrDefaultBrush
Definition: dclife.c:18
VOID NTAPI EBRUSHOBJ_vUpdateFromDC(EBRUSHOBJ *pebo, PBRUSH pbrush, PDC pdc)
Definition: engbrush.c:194
ULONG ulDirty_
Definition: ntgdihdl.h:298
#define DIRTY_TEXT
Definition: ntgdihdl.h:147
COLORREF crForegroundClr
Definition: ntgdihdl.h:303

Referenced by DC_vPrepareDCsForBlit(), GdiFlushUserBatch(), IntExtTextOutW(), IntGdiCleanDC(), and IntGdiSetTextColor().

◆ DC_vUpdateViewportExt()

VOID FASTCALL DC_vUpdateViewportExt ( PDC  pdc)

◆ DCU_SetDcUndeletable()

VOID FASTCALL DCU_SetDcUndeletable ( HDC  )

Definition at line 322 of file dcutil.c.

323 {
324  PDC dc = DC_LockDc(hDC);
325  if (!dc)
326  {
328  return;
329  }
330 
331  dc->fs |= DC_FLAG_PERMANENT;
332  DC_UnlockDc(dc);
333  return;
334 }
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
HDC dc
Definition: cylfrac.c:34
Definition: polytest.cpp:40
#define DC_FLAG_PERMANENT
Definition: ntgdihdl.h:131
static HDC hDC
Definition: 3dtext.c:33
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27

Referenced by DceAllocDCE().

◆ GdiSelectPalette()

HPALETTE NTAPI GdiSelectPalette ( _In_ HDC  hDC,
_In_ HPALETTE  hpal,
_In_ BOOL  ForceBackground 
)

Referenced by NtUserSelectPalette().

◆ GreCreateCompatibleDC()

HDC APIENTRY GreCreateCompatibleDC ( HDC  hdc,
BOOL  bAltDc 
)

Definition at line 817 of file dclife.c.

818 {
819  GDILOOBJTYPE eDcObjType;
820  HDC hdcNew;
821  PPDEVOBJ ppdev;
822  PDC pdc, pdcNew;
823 
824  DPRINT("NtGdiCreateCompatibleDC(0x%p)\n", hdc);
825 
826  /* Did the caller provide a DC? */
827  if (hdc)
828  {
829  /* Yes, try to lock it */
830  pdc = DC_LockDc(hdc);
831  if (!pdc)
832  {
833  DPRINT1("Could not lock source DC %p\n", hdc);
834  return NULL;
835  }
836 
837  /* Get the pdev from the DC */
838  ppdev = pdc->ppdev;
840 
841  /* Unlock the source DC */
842  DC_UnlockDc(pdc);
843  }
844  else
845  {
846  /* No DC given, get default device */
847  ppdev = EngpGetPDEV(NULL);
848  }
849 
850  if (!ppdev)
851  {
852  DPRINT1("Didn't find a suitable PDEV\n");
853  return NULL;
854  }
855 
856  /* Allocate a new DC */
857  eDcObjType = bAltDc ? GDILoObjType_LO_ALTDC_TYPE : GDILoObjType_LO_DC_TYPE;
858  pdcNew = DC_AllocDcWithHandle(eDcObjType);
859  if (!pdcNew)
860  {
861  DPRINT1("Could not allocate a new DC\n");
862  PDEVOBJ_vRelease(ppdev);
863  return NULL;
864  }
865  hdcNew = pdcNew->BaseObject.hHmgr;
866 
867  /* Lock ppdev and initialize the new DC */
868  DC_vInitDc(pdcNew, bAltDc ? DCTYPE_INFO : DCTYPE_MEMORY, ppdev);
869  /* FIXME: HACK! */
870  DC_InitHack(pdcNew);
871 
872  /* Allocate a dc attribute */
873  DC_bAllocDcAttr(pdcNew);
874 
875  DC_UnlockDc(pdcNew);
876 
877  DPRINT("Leave NtGdiCreateCompatibleDC hdcNew = %p\n", hdcNew);
878 
879  return hdcNew;
880 }
LONG cPdevRefs
Definition: pdevobj.h:86
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
PDC NTAPI DC_AllocDcWithHandle(GDILOOBJTYPE eDcObjType)
Definition: dclife.c:69
static HDC
Definition: imagelist.c:92
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
BOOL NTAPI DC_bAllocDcAttr(PDC pdc)
Definition: dcattr.c:31
Definition: polytest.cpp:40
HDC hdc
Definition: main.c:9
Definition: dc.h:43
VOID NTAPI DC_vInitDc(PDC pdc, DCTYPE dctype, PPDEVOBJ ppdev)
Definition: dclife.c:129
#define InterlockedIncrement
Definition: armddk.h:53
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
#define DPRINT1
Definition: precomp.h:8
void DC_InitHack(PDC pdc)
Definition: dclife.c:104
enum GDILoObjType GDILOOBJTYPE
PPDEVOBJ NTAPI EngpGetPDEV(_In_opt_ PUNICODE_STRING pustrDeviceName)
Definition: pdevobj.c:593
VOID NTAPI PDEVOBJ_vRelease(PPDEVOBJ ppdev)
Definition: pdevobj.c:93

Referenced by NtGdiCreateCompatibleDC(), and NtGdiCreateMetafileDC().

◆ GreGetBkColor()

COLORREF FASTCALL GreGetBkColor ( HDC  )

Definition at line 50 of file dcutil.c.

51 {
52  PDC dc;
53  COLORREF crBk;
54  if (!(dc = DC_LockDc(hdc)))
55  {
57  return CLR_INVALID;
58  }
59  crBk = dc->pdcattr->ulBackgroundClr;
60  DC_UnlockDc(dc);
61  return crBk;
62 }
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
#define CLR_INVALID
Definition: wingdi.h:882
HDC dc
Definition: cylfrac.c:34
Definition: polytest.cpp:40
DWORD COLORREF
Definition: windef.h:285
HDC hdc
Definition: main.c:9
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27

Referenced by MENU_DrawMenuItem().

◆ GreGetBkMode()

int FASTCALL GreGetBkMode ( HDC  )

Definition at line 35 of file dcutil.c.

36 {
37  PDC dc;
38  LONG lBkMode;
39  if (!(dc = DC_LockDc(hdc)))
40  {
42  return CLR_INVALID;
43  }
44  lBkMode = dc->pdcattr->lBkMode;
45  DC_UnlockDc(dc);
46  return lBkMode;
47 }
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
#define CLR_INVALID
Definition: wingdi.h:882
HDC dc
Definition: cylfrac.c:34
long LONG
Definition: pedump.c:60
Definition: polytest.cpp:40
HDC hdc
Definition: main.c:9
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27

Referenced by MENU_DrawPopupGlyph(), UITOOLS95_DFC_ButtonCheckRadio(), UITOOLS95_DrawFrameCaption(), and UITOOLS95_DrawFrameScroll().

◆ GreGetGraphicsMode()

int FASTCALL GreGetGraphicsMode ( HDC  )

Definition at line 306 of file dcutil.c.

307 {
308  PDC dc;
309  int GraphicsMode;
310  if (!(dc = DC_LockDc(hdc)))
311  {
313  return CLR_INVALID;
314  }
315  GraphicsMode = dc->pdcattr->iGraphicsMode;
316  DC_UnlockDc(dc);
317  return GraphicsMode;
318 }
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
#define CLR_INVALID
Definition: wingdi.h:882
HDC dc
Definition: cylfrac.c:34
Definition: polytest.cpp:40
HDC hdc
Definition: main.c:9
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27

Referenced by DrawTextExWorker().

◆ GreGetMapMode()

int FASTCALL GreGetMapMode ( HDC  )

Definition at line 65 of file dcutil.c.

66 {
67  PDC dc;
68  INT iMapMode;
69  if (!(dc = DC_LockDc(hdc)))
70  {
72  return CLR_INVALID;
73  }
74  iMapMode = dc->pdcattr->iMapMode;
75  DC_UnlockDc(dc);
76  return iMapMode;
77 }
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
#define CLR_INVALID
Definition: wingdi.h:882
HDC dc
Definition: cylfrac.c:34
int32_t INT
Definition: typedefs.h:56
Definition: polytest.cpp:40
HDC hdc
Definition: main.c:9
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27

Referenced by DrawFrameControl().

◆ GreGetTextColor()

COLORREF FASTCALL GreGetTextColor ( HDC  )

Definition at line 80 of file dcutil.c.

81 {
82  PDC dc;
83  ULONG ulForegroundClr;
84  if (!(dc = DC_LockDc(hdc)))
85  {
87  return CLR_INVALID;
88  }
89  ulForegroundClr = dc->pdcattr->ulForegroundClr;
90  DC_UnlockDc(dc);
91  return ulForegroundClr;
92 }
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
#define CLR_INVALID
Definition: wingdi.h:882
HDC dc
Definition: cylfrac.c:34
Definition: polytest.cpp:40
HDC hdc
Definition: main.c:9
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
unsigned int ULONG
Definition: retypes.h:1
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27

Referenced by MENU_DrawMenuItem(), MENU_DrawPopupGlyph(), TEXT_DrawUnderscore(), UITOOLS95_DrawFrameCaption(), and UITOOLS95_DrawFrameScroll().

◆ GreSetBrushOrg()

BOOL FASTCALL GreSetBrushOrg ( HDC  ,
INT  ,
INT  ,
LPPOINT   
)

Definition at line 231 of file dcutil.c.

236 {
237  PDC pdc = DC_LockDc(hdc);
238  if (pdc == NULL)
239  {
241  return FALSE;
242  }
243 
244  if (pptOut != NULL)
245  {
246  *pptOut = pdc->pdcattr->ptlBrushOrigin;
247  }
248 
249  pdc->pdcattr->ptlBrushOrigin.x = x;
250  pdc->pdcattr->ptlBrushOrigin.y = y;
251 
252  DC_vSetBrushOrigin(pdc, x, y);
253 
254  DC_UnlockDc(pdc);
255  return TRUE;
256 }
#define TRUE
Definition: types.h:120
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
smooth NULL
Definition: ftsmooth.c:416
Definition: polytest.cpp:40
HDC hdc
Definition: main.c:9
_In_ UINT _Out_ PPOINTL pptOut
Definition: ntgdi.h:2197
VOID NTAPI DC_vSetBrushOrigin(PDC pdc, LONG x, LONG y)
Definition: dcobjs.c:142
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27

Referenced by _Success_(), and IntFillWindow().

◆ GreSetDCOwner()

BOOL NTAPI GreSetDCOwner ( HDC  hdc,
ULONG  ulOwner 
)

Definition at line 455 of file dclife.c.

456 {
457  PDC pdc;
458 
459  pdc = DC_LockDc(hdc);
460  if (!pdc)
461  {
462  DPRINT1("GreSetDCOwner: Could not lock DC\n");
463  return FALSE;
464  }
465 
466  /* Call the internal DC function */
467  DC_vSetOwner(pdc, ulOwner);
468 
469  DC_UnlockDc(pdc);
470  return TRUE;
471 }
#define TRUE
Definition: types.h:120
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
Definition: polytest.cpp:40
HDC hdc
Definition: main.c:9
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
VOID NTAPI DC_vSetOwner(PDC pdc, ULONG ulOwner)
Definition: dclife.c:414
#define DPRINT1
Definition: precomp.h:8

Referenced by co_IntInitializeDesktopGraphics(), DceAllocDCE(), DceFreeDCE(), DceFreeWindowDCE(), DceReleaseDC(), DxEngSetDCOwner(), IntEndDesktopGraphics(), and UserGetDCEx().

◆ GreSetStretchBltMode()

int FASTCALL GreSetStretchBltMode ( HDC  hdc,
int  iStretchMode 
)

Definition at line 283 of file dcutil.c.

284 {
285  PDC pdc;
286  PDC_ATTR pdcattr;
287  INT oSMode = 0;
288 
289  pdc = DC_LockDc(hDC);
290  if (pdc)
291  {
292  pdcattr = pdc->pdcattr;
293  oSMode = pdcattr->lStretchBltMode;
294  pdcattr->lStretchBltMode = iStretchMode;
295 
296  // Wine returns an error here. We set the default.
297  if ((iStretchMode <= 0) || (iStretchMode > MAXSTRETCHBLTMODE)) iStretchMode = WHITEONBLACK;
298 
299  pdcattr->jStretchBltMode = iStretchMode;
300  DC_UnlockDc(pdc);
301  }
302  return oSMode;
303 }
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
BYTE jStretchBltMode
Definition: ntgdihdl.h:314
#define MAXSTRETCHBLTMODE
Definition: wingdi.h:955
int32_t INT
Definition: typedefs.h:56
Definition: polytest.cpp:40
static HDC hDC
Definition: 3dtext.c:33
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
LONG lStretchBltMode
Definition: ntgdihdl.h:319
#define WHITEONBLACK
Definition: wingdi.h:952

◆ InitDcImpl()

INIT_FUNCTION NTSTATUS NTAPI InitDcImpl ( VOID  )

Internal functions

Definition at line 53 of file dclife.c.

54 {
56  if (!psurfDefaultBitmap)
57  return STATUS_UNSUCCESSFUL;
58 
60  if (!pbrDefaultBrush)
61  return STATUS_UNSUCCESSFUL;
62 
63  return STATUS_SUCCESS;
64 }
PBRUSH pbrDefaultBrush
Definition: dclife.c:18
#define BRUSH_ShareLockBrush(hBrush)
Definition: brush.h:113
PSURFACE psurfDefaultBitmap
Definition: dclife.c:17
#define SURFACE_ShareLockSurface(hBMObj)
Definition: surface.h:91
HGDIOBJ StockObjects[]
Definition: stockobj.c:100
#define DEFAULT_BITMAP
Definition: ntgdityp.h:194
#define BLACK_BRUSH
Definition: wingdi.h:895
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
return STATUS_SUCCESS
Definition: btrfs.c:2966

Referenced by DriverEntry().

◆ IntEnumHDev()

PPDEVOBJ FASTCALL IntEnumHDev ( VOID  )

Definition at line 50 of file device.c.

51 {
52 // I guess we will soon have more than one primary surface.
53 // This will do for now.
54  return gppdevPrimary;
55 }
PPDEVOBJ gppdevPrimary
Definition: pdevobj.c:13

◆ IntGdiCleanDC()

BOOL FASTCALL IntGdiCleanDC ( HDC  hDC)

Definition at line 73 of file dcstate.c.

74 {
75  PDC dc;
76  if (!hDC) return FALSE;
77  dc = DC_LockDc(hDC);
78  if (!dc) return FALSE;
79  // Clean the DC
80  if (defaultDCstate)
81  {
83  /* Update the brushes now, because they reference some objects (the DC palette)
84  * Which belong to the current process, and this DC might be used for another process
85  * after being cleaned up (for GetDC(0) for instance) */
90  }
91 
92  // Remove Path and reset flags.
93  if (dc->dclevel.hPath)
94  {
95  DPRINT("Clean DC Remove Path\n");
96  if (!PATH_Delete(dc->dclevel.hPath))
97  {
98  DPRINT1("Failed to remove Path\n");
99  }
100  dc->dclevel.hPath = 0;
101  dc->dclevel.flPath = 0;
102  }
103 
104  /* DC_vCopyState frees the Clip rgn and the Meta rgn. Take care of the other ones
105  * There is no need to clear prgnVis, as UserGetDC updates it immediately. */
106  if (dc->prgnRao)
107  REGION_Delete(dc->prgnRao);
108  if (dc->prgnAPI)
109  REGION_Delete(dc->prgnAPI);
110  dc->prgnRao = dc->prgnAPI = NULL;
111 
112  dc->fs |= DC_FLAG_DIRTY_RAO;
113 
114  DC_UnlockDc(dc);
115 
116  return TRUE;
117 }
#define TRUE
Definition: types.h:120
VOID FASTCALL DC_vUpdateLineBrush(PDC pdc)
Definition: dcobjs.c:62
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
VOID FASTCALL DC_vUpdateBackgroundBrush(PDC pdc)
Definition: dcobjs.c:126
HDC dc
Definition: cylfrac.c:34
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
VOID FASTCALL DC_vUpdateTextBrush(PDC pdc)
Definition: dcobjs.c:108
Definition: polytest.cpp:40
PDC defaultDCstate
Definition: device.c:14
#define DC_FLAG_DIRTY_RAO
Definition: ntgdihdl.h:132
static HDC hDC
Definition: 3dtext.c:33
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
#define DPRINT1
Definition: precomp.h:8
VOID FASTCALL DC_vCopyState(PDC pdcSrc, PDC pdcDst, BOOL To)
Definition: dcstate.c:16
VOID FASTCALL REGION_Delete(PREGION pRgn)
Definition: region.c:2468
BOOL FASTCALL PATH_Delete(HPATH hPath)
Definition: path.c:91
VOID FASTCALL DC_vUpdateFillBrush(PDC pdc)
Definition: dcobjs.c:16

Referenced by DceReleaseDC(), and DxEngCleanDC().

◆ IntGdiCreateDisplayDC()

HDC FASTCALL IntGdiCreateDisplayDC ( HDEV  hDev,
ULONG  DcType,
BOOL  EmptyDC 
)

Definition at line 1066 of file dclife.c.

1067 {
1068  HDC hDC;
1069  UNIMPLEMENTED;
1070  ASSERT(FALSE);
1071 
1072  if (DcType == DC_TYPE_MEMORY)
1073  hDC = NtGdiCreateCompatibleDC(NULL); // OH~ Yuck! I think I taste vomit in my mouth!
1074  else
1075  hDC = IntGdiCreateDC(NULL, NULL, NULL, NULL, (DcType == DC_TYPE_INFO));
1076 
1077  return hDC;
1078 }
HDC APIENTRY NtGdiCreateCompatibleDC(HDC hdc)
Definition: dclife.c:884
static HDC
Definition: imagelist.c:92
smooth NULL
Definition: ftsmooth.c:416
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define DC_TYPE_MEMORY
Definition: ntgdihdl.h:124
static HDC hDC
Definition: 3dtext.c:33
#define DC_TYPE_INFO
Definition: ntgdihdl.h:125
HDC FASTCALL IntGdiCreateDC(PUNICODE_STRING Driver, PUNICODE_STRING pustrDevice, PVOID pUMdhpdev, CONST PDEVMODEW pdmInit, BOOL CreateAsIC)
Definition: dclife.c:1043
#define UNIMPLEMENTED
Definition: debug.h:114

Referenced by DxEngCreateMemoryDC(), and UserGetDesktopDC().

◆ IntGdiDeleteDC()

BOOL FASTCALL IntGdiDeleteDC ( HDC  ,
BOOL   
)

Definition at line 892 of file dclife.c.

893 {
894  PDC DCToDelete = DC_LockDc(hDC);
895 
896  if (DCToDelete == NULL)
897  {
899  return FALSE;
900  }
901 
902  if (!Force)
903  {
904  /* Windows permits NtGdiDeleteObjectApp to delete a permanent DC
905  * For some reason, it's still a valid handle, pointing to some kernel data.
906  * Not sure if this is a bug, a feature, some cache stuff... Who knows?
907  * See NtGdiDeleteObjectApp test for details */
908  if (DCToDelete->fs & DC_FLAG_PERMANENT)
909  {
910  DC_UnlockDc(DCToDelete);
911  if(UserReleaseDC(NULL, hDC, FALSE))
912  {
913  /* ReactOS feature: Call UserReleaseDC
914  * I don't think Windows does it.
915  * Still, complain, no one should ever call DeleteDC
916  * on a window DC */
917  DPRINT1("No, you naughty application!\n");
918  return TRUE;
919  }
920  else
921  {
922  /* This is not a window owned DC.
923  * Force its deletion */
924  return IntGdiDeleteDC(hDC, TRUE);
925  }
926  }
927  }
928 
929  DC_UnlockDc(DCToDelete);
930 
931  if (GreIsHandleValid(hDC))
932  {
933  if (!GreDeleteObject(hDC))
934  {
935  DPRINT1("DC_FreeDC failed\n");
936  return FALSE;
937  }
938  }
939  else
940  {
941  DPRINT1("Attempted to Delete 0x%p currently being destroyed!!!\n", hDC);
942  return FALSE;
943  }
944 
945  return TRUE;
946 }
BOOL NTAPI GreDeleteObject(HGDIOBJ hobj)
Definition: gdiobj.c:1155
#define TRUE
Definition: types.h:120
BOOL NTAPI GreIsHandleValid(HGDIOBJ hobj)
Definition: gdiobj.c:1143
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
smooth NULL
Definition: ftsmooth.c:416
Definition: polytest.cpp:40
#define DC_FLAG_PERMANENT
Definition: ntgdihdl.h:131
static HDC hDC
Definition: 3dtext.c:33
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
INT FASTCALL UserReleaseDC(PWND Window, HDC hDc, BOOL EndPaint)
Definition: windc.c:917
#define DPRINT1
Definition: precomp.h:8
BOOL FASTCALL IntGdiDeleteDC(HDC hDC, BOOL Force)
Definition: dclife.c:892
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27
_Inout_ PVCB _In_ BOOLEAN Force
Definition: cdprocs.h:1425

Referenced by DceFreeDCE(), DxEngDeleteDC(), IntUpdateLayeredWindowI(), MENU_DrawBitmapItem(), MENU_DrawMenuItem(), NtGdiDeleteObjectApp(), and SnapWindow().

◆ IntGdiReferencePdev()

VOID FASTCALL IntGdiReferencePdev ( PPDEVOBJ  pPDev)

Definition at line 17 of file device.c.

18 {
20 }
#define UNIMPLEMENTED
Definition: debug.h:114

Referenced by DxEngReferenceHdev().

◆ IntGdiSetBkColor()

◆ IntGdiSetBkMode()

INT FASTCALL IntGdiSetBkMode ( HDC  hDC,
INT  backgroundMode 
)

Definition at line 124 of file dcutil.c.

125 {
126  COLORREF oldMode;
127  PDC dc;
128  PDC_ATTR pdcattr;
129 
130  if (!(dc = DC_LockDc(hDC)))
131  {
133  return CLR_INVALID;
134  }
135  pdcattr = dc->pdcattr;
136  oldMode = pdcattr->lBkMode;
137  pdcattr->jBkMode = Mode;
138  pdcattr->lBkMode = Mode;
139  DC_UnlockDc(dc);
140  return oldMode;
141 }
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
_In_ ULONG Mode
Definition: hubbusif.h:303
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
#define CLR_INVALID
Definition: wingdi.h:882
HDC dc
Definition: cylfrac.c:34
Definition: polytest.cpp:40
DWORD COLORREF
Definition: windef.h:285
BYTE jBkMode
Definition: ntgdihdl.h:312
static HDC hDC
Definition: 3dtext.c:33
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
LONG lBkMode
Definition: ntgdihdl.h:317
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27

Referenced by IntPaintDesktop(), MENU_DrawMenuItem(), MENU_DrawPopupGlyph(), UITOOLS95_DFC_ButtonCheckRadio(), UITOOLS95_DrawFrameCaption(), UITOOLS95_DrawFrameMenu(), UITOOLS95_DrawFrameScroll(), and UserDrawCaptionText().

◆ IntGdiSetTextAlign()

UINT FASTCALL IntGdiSetTextAlign ( HDC  hDC,
UINT  Mode 
)

Definition at line 145 of file dcutil.c.

147 {
148  UINT prevAlign;
149  DC *dc;
150  PDC_ATTR pdcattr;
151 
152  dc = DC_LockDc(hDC);
153  if (!dc)
154  {
156  return GDI_ERROR;
157  }
158  pdcattr = dc->pdcattr;
159  prevAlign = pdcattr->lTextAlign;
160  pdcattr->lTextAlign = Mode;
161  if (pdcattr->dwLayout & LAYOUT_RTL)
162  {
163  if ((Mode & TA_CENTER) != TA_CENTER) Mode ^= TA_RIGHT;
164  }
165  pdcattr->flTextAlign = Mode & TA_MASK;
166  DC_UnlockDc(dc);
167  return prevAlign;
168 }
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
#define LAYOUT_RTL
Definition: wingdi.h:1370
_In_ ULONG Mode
Definition: hubbusif.h:303
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
HDC dc
Definition: cylfrac.c:34
#define TA_RIGHT
Definition: wingdi.h:932
Definition: polytest.cpp:40
#define TA_MASK
Definition: wingdi.h:936
static HDC hDC
Definition: 3dtext.c:33
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
unsigned int UINT
Definition: ndis.h:50
FLONG flTextAlign
Definition: ntgdihdl.h:328
DWORD dwLayout
Definition: ntgdihdl.h:343
#define TA_CENTER
Definition: wingdi.h:930
#define GDI_ERROR
Definition: wingdi.h:1308
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27
LONG lTextAlign
Definition: ntgdihdl.h:329

Referenced by IntPaintDesktop().

◆ IntGdiSetTextColor()

COLORREF FASTCALL IntGdiSetTextColor ( HDC  hDC,
COLORREF  color 
)

Definition at line 172 of file dcutil.c.

174 {
175  COLORREF crOldColor;
176  PDC pdc;
177  PDC_ATTR pdcattr;
178 
179  pdc = DC_LockDc(hDC);
180  if (!pdc)
181  {
183  return CLR_INVALID;
184  }
185  pdcattr = pdc->pdcattr;
186 
187  crOldColor = (COLORREF) pdcattr->ulForegroundClr;
188  pdcattr->ulForegroundClr = (ULONG)color;
189 
190  if (pdcattr->crForegroundClr != color)
191  {
193  pdcattr->crForegroundClr = color;
194  }
195 
196  DC_vUpdateTextBrush(pdc);
197  DC_vUpdateLineBrush(pdc);
198  DC_vUpdateFillBrush(pdc);
199 
200  DC_UnlockDc(pdc);
201 
202  return crOldColor;
203 }
VOID FASTCALL DC_vUpdateLineBrush(PDC pdc)
Definition: dcobjs.c:62
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
#define CLR_INVALID
Definition: wingdi.h:882
GLuint color
Definition: glext.h:6243
ULONG ulDirty_
Definition: ntgdihdl.h:298
VOID FASTCALL DC_vUpdateTextBrush(PDC pdc)
Definition: dcobjs.c:108
Definition: polytest.cpp:40
DWORD COLORREF
Definition: windef.h:285
#define DIRTY_TEXT
Definition: ntgdihdl.h:147
#define DIRTY_FILL
Definition: ntgdihdl.h:145
static HDC hDC
Definition: 3dtext.c:33
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
ULONG ulForegroundClr
Definition: ntgdihdl.h:304
COLORREF crForegroundClr
Definition: ntgdihdl.h:303
unsigned int ULONG
Definition: retypes.h:1
#define DIRTY_LINE
Definition: ntgdihdl.h:146
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27
VOID FASTCALL DC_vUpdateFillBrush(PDC pdc)
Definition: dcobjs.c:16

Referenced by DefWndControlColor(), IntPaintDesktop(), MENU_DrawMenuItem(), MENU_DrawPopupGlyph(), UITOOLS95_DFC_ButtonCheckRadio(), UITOOLS95_DrawFrameCaption(), UITOOLS95_DrawFrameMenu(), UITOOLS95_DrawFrameScroll(), and UserDrawCaptionText().

◆ IntGdiUnreferencePdev()

VOID FASTCALL IntGdiUnreferencePdev ( PPDEVOBJ  pPDev,
DWORD  CleanUpType 
)

Definition at line 23 of file device.c.

24 {
26 }
#define UNIMPLEMENTED
Definition: debug.h:114

Referenced by DxEngUnreferenceHdev().

◆ IntSetDCBrushColor()

COLORREF FASTCALL IntSetDCBrushColor ( HDC  ,
COLORREF   
)

Definition at line 206 of file dcutil.c.

207 {
208  COLORREF OldColor = CLR_INVALID;
209  PDC dc;
210  if (!(dc = DC_LockDc(hdc)))
211  {
213  return CLR_INVALID;
214  }
215  else
216  {
217  OldColor = (COLORREF) dc->pdcattr->ulBrushClr;
218  dc->pdcattr->ulBrushClr = (ULONG) crColor;
219 
220  if ( dc->pdcattr->crBrushClr != crColor )
221  {
222  dc->pdcattr->ulDirty_ |= DIRTY_FILL;
223  dc->pdcattr->crBrushClr = crColor;
224  }
225  }
226  DC_UnlockDc(dc);
227  return OldColor;
228 }
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
#define CLR_INVALID
Definition: wingdi.h:882
HDC dc
Definition: cylfrac.c:34
Definition: polytest.cpp:40
DWORD COLORREF
Definition: windef.h:285
#define DIRTY_FILL
Definition: ntgdihdl.h:145
HDC hdc
Definition: main.c:9
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
unsigned int ULONG
Definition: retypes.h:1
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27

Referenced by IntDrawDiagEdge().

◆ IntSetDCPenColor()

COLORREF FASTCALL IntSetDCPenColor ( HDC  ,
COLORREF   
)

Definition at line 259 of file dcutil.c.

260 {
261  COLORREF OldColor;
262  PDC dc;
263  if (!(dc = DC_LockDc(hdc)))
264  {
266  return CLR_INVALID;
267  }
268 
269  OldColor = (COLORREF)dc->pdcattr->ulPenClr;
270  dc->pdcattr->ulPenClr = (ULONG)crColor;
271 
272  if (dc->pdcattr->crPenClr != crColor)
273  {
274  dc->pdcattr->ulDirty_ |= DIRTY_LINE;
275  dc->pdcattr->crPenClr = crColor;
276  }
277  DC_UnlockDc(dc);
278  return OldColor;
279 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
#define CLR_INVALID
Definition: wingdi.h:882
HDC dc
Definition: cylfrac.c:34
Definition: polytest.cpp:40
DWORD COLORREF
Definition: windef.h:285
HDC hdc
Definition: main.c:9
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
unsigned int ULONG
Definition: retypes.h:1
#define DIRTY_LINE
Definition: ntgdihdl.h:146
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27

Referenced by IntDrawDiagEdge(), IntDrawMenuBarTemp(), IntDrawRectEdge(), MENU_DrawMenuItem(), NC_DoNCPaint(), and UserDrawCaptionBar().

◆ IntSetDefaultRegion()

BOOL FASTCALL IntSetDefaultRegion ( PDC  )

Definition at line 350 of file dcutil.c.

351 {
353  PREGION prgn;
354  RECTL rclWnd, rclClip;
355 
356  IntGdiReleaseRaoRgn(pdc);
357 
358  rclWnd.left = 0;
359  rclWnd.top = 0;
360  rclWnd.right = pdc->dclevel.sizl.cx;
361  rclWnd.bottom = pdc->dclevel.sizl.cy;
362  rclClip = rclWnd;
363 
364  //EngAcquireSemaphoreShared(pdc->ppdev->hsemDevLock);
365  if (pdc->ppdev->flFlags & PDEV_META_DEVICE)
366  {
367  pSurface = pdc->dclevel.pSurface;
368  if (pSurface && pSurface->flags & PDEV_SURFACE)
369  {
370  rclClip.left += pdc->ppdev->ptlOrigion.x;
371  rclClip.top += pdc->ppdev->ptlOrigion.y;
372  rclClip.right += pdc->ppdev->ptlOrigion.x;
373  rclClip.bottom += pdc->ppdev->ptlOrigion.y;
374  }
375  }
376  //EngReleaseSemaphore(pdc->ppdev->hsemDevLock);
377 
378  prgn = pdc->prgnVis;
379 
380  if (prgn && prgn != prgnDefault)
381  {
382  REGION_SetRectRgn( prgn,
383  rclClip.left,
384  rclClip.top,
385  rclClip.right ,
386  rclClip.bottom );
387  }
388  else
389  {
390  prgn = IntSysCreateRectpRgn( rclClip.left,
391  rclClip.top,
392  rclClip.right ,
393  rclClip.bottom );
394  pdc->prgnVis = prgn;
395  }
396 
397  if (prgn)
398  {
399  pdc->ptlDCOrig.x = 0;
400  pdc->ptlDCOrig.y = 0;
401  pdc->erclWindow = rclWnd;
402  pdc->erclClip = rclClip;
403  /* Might be an InitDC or DCE... */
404  pdc->ptlFillOrigin = pdc->dcattr.ptlBrushOrigin;
405  return TRUE;
406  }
407  // No Vis use the Default System Region.
408  pdc->prgnVis = prgnDefault;
409  return FALSE;
410 }
#define TRUE
Definition: types.h:120
long bottom
Definition: polytest.cpp:53
VOID FASTCALL IntGdiReleaseRaoRgn(PDC pDC)
Definition: cliprgn.c:16
long right
Definition: polytest.cpp:53
PREGION FASTCALL IntSysCreateRectpRgn(INT LeftRect, INT TopRect, INT RightRect, INT BottomRect)
Definition: region.c:2426
long top
Definition: polytest.cpp:53
Definition: region.h:7
long left
Definition: polytest.cpp:53
PREGION prgnDefault
Definition: region.c:130
_In_ DD_SURFACE_LOCAL * pSurface
Definition: winddi.h:3481
VOID FASTCALL REGION_SetRectRgn(PREGION rgn, INT LeftRect, INT TopRect, INT RightRect, INT BottomRect)
Definition: region.c:2685

Referenced by GdiSelectVisRgn(), and MakeInfoDC().

◆ IntUpdateBoundsRect()

VOID FASTCALL IntUpdateBoundsRect ( PDC  ,
PRECTL   
)

Definition at line 689 of file dcutil.c.

690 {
691  if (pdc->fs & DC_ACCUM_APP)
692  {
693  RECTL_bUnionRect(&pdc->erclBoundsApp, &pdc->erclBoundsApp, pRect);
694  }
695  if (pdc->fs & DC_ACCUM_WMGR)
696  {
697  RECTL_bUnionRect(&pdc->erclBounds, &pdc->erclBounds, pRect);
698  }
699 }
BOOL FASTCALL RECTL_bUnionRect(_Out_ RECTL *prclDst, _In_ const RECTL *prcl1, _In_ const RECTL *prcl2)
Definition: rect.c:18

Referenced by AddPenLinesBounds(), GreGradientFill(), GreStretchBltMask(), IntExtTextOutW(), IntGdiBitBltRgn(), IntGdiFillRgn(), IntPatBlt(), IntRectangle(), NtGdiAlphaBlend(), NtGdiExtFloodFill(), NtGdiMaskBlt(), NtGdiSetDIBitsToDeviceInternal(), NtGdiSetPixel(), NtGdiStretchDIBitsInternal(), and NtGdiTransparentBlt().

◆ IntvGetDeviceCaps()

VOID FASTCALL IntvGetDeviceCaps ( PPDEVOBJ  ,
PDEVCAPS   
)

◆ TranslateCOLORREF()

ULONG TranslateCOLORREF ( PDC  pdc,
COLORREF  crColor 
)

Definition at line 864 of file dcutil.c.

865 {
866  PSURFACE psurfDC;
867  PPALETTE ppalDC;
868  ULONG index, ulColor, iBitmapFormat;
869  EXLATEOBJ exlo;
870 
871  /* Get the DC surface */
872  psurfDC = pdc->dclevel.pSurface;
873 
874  /* If no surface is selected, use the default bitmap */
875  if (!psurfDC)
876  psurfDC = psurfDefaultBitmap;
877 
878  /* Check what color type this is */
879  switch (crColor >> 24)
880  {
881  case 0x00: /* RGB color */
882  break;
883 
884  case 0x01: /* PALETTEINDEX */
885  index = crColor & 0xFFFFFF;
886  ppalDC = pdc->dclevel.ppal;
887  if (index >= ppalDC->NumColors) index = 0;
888 
889  /* Get the RGB value */
890  crColor = PALETTE_ulGetRGBColorFromIndex(ppalDC, index);
891  break;
892 
893  case 0x02: /* PALETTERGB */
894 
895  if (pdc->dclevel.hpal != StockObjects[DEFAULT_PALETTE])
896  {
897  /* First find the nearest index in the dc palette */
898  ppalDC = pdc->dclevel.ppal;
899  index = PALETTE_ulGetNearestIndex(ppalDC, crColor & 0xFFFFFF);
900 
901  /* Get the RGB value */
902  crColor = PALETTE_ulGetRGBColorFromIndex(ppalDC, index);
903  }
904  else
905  {
906  /* Use the pure color */
907  crColor = crColor & 0x00FFFFFF;
908  }
909  break;
910 
911  case 0x10: /* DIBINDEX */
912  /* Mask the value to match the target bpp */
913  iBitmapFormat = psurfDC->SurfObj.iBitmapFormat;
914  if (iBitmapFormat == BMF_1BPP) index = crColor & 0x1;
915  else if (iBitmapFormat == BMF_4BPP) index = crColor & 0xf;
916  else if (iBitmapFormat == BMF_8BPP) index = crColor & 0xFF;
917  else if (iBitmapFormat == BMF_16BPP) index = crColor & 0xFFFF;
918  else index = crColor & 0xFFFFFF;
919  return index;
920 
921  default:
922  DPRINT("Unsupported color type %u passed\n", crColor >> 24);
923  crColor &= 0xFFFFFF;
924  }
925 
926  /* Initialize an XLATEOBJ from RGB to the target surface */
927  EXLATEOBJ_vInitialize(&exlo, &gpalRGB, psurfDC->ppal, 0xFFFFFF, 0, 0);
928 
929  /* Translate the color to the target format */
930  ulColor = XLATEOBJ_iXlate(&exlo.xlo, crColor);
931 
932  /* Cleanup the XLATEOBJ */
933  EXLATEOBJ_vCleanup(&exlo);
934 
935  return ulColor;
936 }
_Notnull_ PSURFACE psurfDefaultBitmap
Definition: dclife.c:17
struct _PALETTE *const ppal
Definition: surface.h:11
Definition: xlate.c:10
ULONG iBitmapFormat
Definition: winddi.h:1215
XLATEOBJ xlo
Definition: xlateobj.h:21
VOID NTAPI EXLATEOBJ_vInitialize(_Out_ PEXLATEOBJ pexlo, _In_opt_ PALETTE *ppalSrc, _In_opt_ PALETTE *ppalDst, _In_ COLORREF crSrcBackColor, _In_ COLORREF crDstBackColor, _In_ COLORREF crDstForeColor)
Definition: xlateobj.c:358
HGDIOBJ StockObjects[]
Definition: stockobj.c:100
SURFOBJ SurfObj
Definition: surface.h:8
void DPRINT(...)
Definition: polytest.cpp:61
GLuint index
Definition: glext.h:6031
VOID NTAPI EXLATEOBJ_vCleanup(_Inout_ PEXLATEOBJ pexlo)
Definition: xlateobj.c:649
#define BMF_16BPP
Definition: winddi.h:358
#define DEFAULT_PALETTE
Definition: wingdi.h:912
FORCEINLINE ULONG PALETTE_ulGetRGBColorFromIndex(PPALETTE ppal, ULONG ulIndex)
Definition: palette.h:142
ULONG NTAPI PALETTE_ulGetNearestIndex(PALETTE *ppal, ULONG ulColor)
Definition: palette.c:312
#define index(s, c)
Definition: various.h:29
Definition: xlate.c:9
ULONG NumColors
Definition: palette.h:41
Definition: xlate.c:8
unsigned int ULONG
Definition: retypes.h:1
PALETTE gpalRGB
Definition: palette.c:20
ENGAPI ULONG APIENTRY XLATEOBJ_iXlate(_In_ XLATEOBJ *pxlo, _In_ ULONG iColor)
Definition: xlateobj.c:664

Referenced by NtGdiGetNearestColor(), and NtGdiSetPixel().

Variable Documentation

◆ defaultDCstate

PDC defaultDCstate

Definition at line 14 of file device.c.

Referenced by DC_InitHack(), and IntGdiCleanDC().

◆ pbrDefaultBrush

_Notnull_ PBRUSH pbrDefaultBrush

Definition at line 18 of file dclife.c.

Referenced by DC_vInitDc(), DC_vUpdateBackgroundBrush(), DC_vUpdateTextBrush(), and InitDcImpl().

◆ psurfDefaultBitmap

_Notnull_ PSURFACE psurfDefaultBitmap

Definition at line 17 of file dclife.c.

Referenced by EBRUSHOBJ_vInit(), InitDcImpl(), IntCreateCompatibleBitmap(), and TranslateCOLORREF().