solv the issue with mouse poiter is hide, do not show the mousepointer when you are...
[reactos.git] / reactos / subsys / win32k / include / dc.h
1
2 #ifndef __WIN32K_DC_H
3 #define __WIN32K_DC_H
4
5 #include "driver.h"
6
7 typedef enum tagGdiPathState
8 {
9 PATH_Null,
10 PATH_Open,
11 PATH_Closed
12 } GdiPathState;
13
14 typedef struct tagGdiPath
15 {
16 GdiPathState state;
17 POINT *pPoints;
18 BYTE *pFlags;
19 int numEntriesUsed, numEntriesAllocated;
20 BOOL newStroke;
21 } GdiPath;
22
23 typedef struct _WIN_DC_INFO
24 {
25 int flags;
26 HRGN hClipRgn; /* Clip region (may be 0) */
27 HRGN hVisRgn; /* Visible region (must never be 0) */
28 HRGN hGCClipRgn; /* GC clip region (ClipRgn AND VisRgn) */
29 HPEN hPen;
30 HBRUSH hBrush;
31 HFONT hFont;
32 HBITMAP hBitmap;
33 HBITMAP hFirstBitmap; /* Bitmap selected at creation of the DC */
34
35 /* #if 0 */
36 HANDLE hDevice;
37 HPALETTE hPalette;
38
39 GdiPath path;
40 /* #endif */
41
42 WORD ROPmode;
43 WORD polyFillMode;
44 WORD stretchBltMode;
45 WORD relAbsMode;
46 WORD backgroundMode;
47 COLORREF backgroundColor;
48 COLORREF textColor;
49
50 short brushOrgX;
51 short brushOrgY;
52
53 WORD textAlign; /* Text alignment from SetTextAlign() */
54 short charExtra; /* Spacing from SetTextCharacterExtra() */
55 short breakTotalExtra; /* Total extra space for justification */
56 short breakCount; /* Break char. count */
57 short breakExtra; /* breakTotalExtra / breakCount */
58 short breakRem; /* breakTotalExtra % breakCount */
59
60 RECT totalExtent;
61 BYTE bitsPerPixel;
62
63 INT MapMode;
64 INT GraphicsMode; /* Graphics mode */
65 INT DCOrgX; /* DC origin */
66 INT DCOrgY;
67
68 #if 0
69 FARPROC lpfnPrint; /* AbortProc for Printing */
70 #endif
71
72 INT CursPosX; /* Current position */
73 INT CursPosY;
74 INT ArcDirection;
75
76 XFORM xformWorld2Wnd; /* World-to-window transformation */
77 XFORM xformWorld2Vport; /* World-to-viewport transformation */
78 XFORM xformVport2World; /* Inverse of the above transformation */
79 BOOL vport2WorldValid; /* Is xformVport2World valid? */
80 } WIN_DC_INFO;
81
82 /* DC flags */
83 #define DC_MEMORY 0x0001 /* It is a memory DC */
84 #define DC_SAVED 0x0002 /* It is a saved DC */
85 #define DC_DIRTY 0x0004 /* hVisRgn has to be updated */
86 #define DC_THUNKHOOK 0x0008 /* DC hook is in the 16-bit code */
87
88 #define GDI_DC_TYPE (1)
89
90 typedef struct _DC
91 {
92 HDC hSelf;
93 HDC hNext;
94 DHPDEV PDev;
95 HSURF FillPatternSurfaces[HS_DDI_MAX];
96 PGDIINFO GDIInfo;
97 PDEVINFO DevInfo;
98 HDEV GDIDevice;
99
100 DRIVER_FUNCTIONS DriverFunctions;
101 UNICODE_STRING DriverName;
102 HANDLE DeviceDriver;
103
104 INT wndOrgX; /* Window origin */
105 INT wndOrgY;
106 INT wndExtX; /* Window extent */
107 INT wndExtY;
108 INT vportOrgX; /* Viewport origin */
109 INT vportOrgY;
110 INT vportExtX; /* Viewport extent */
111 INT vportExtY;
112
113 CLIPOBJ *CombinedClip;
114
115 XLATEOBJ *XlateBrush;
116 XLATEOBJ *XlatePen;
117
118 INT saveLevel;
119 BOOL IsIC;
120
121 HPALETTE PalIndexed;
122
123 WIN_DC_INFO w;
124 } DC, *PDC;
125
126 typedef struct _GDIPOINTER /* should stay private to ENG */
127 {
128 /* private GDI pointer handling information, required for software emulation */
129 BOOL Enabled;
130 POINTL Pos;
131 SIZEL Size;
132 POINTL HotSpot;
133 XLATEOBJ *XlateObject;
134 HSURF ColorSurface;
135 HSURF MaskSurface;
136 HSURF SaveSurface;
137 BOOL ShowPointer;
138
139 /* public pointer information */
140 RECTL Exclude; /* required publicly for SPS_ACCEPT_EXCLUDE */
141 PGD_MOVEPOINTER MovePointer;
142 ULONG Status;
143 } GDIPOINTER, *PGDIPOINTER;
144
145 typedef struct
146 {
147 HANDLE Handle;
148 DHPDEV PDev;
149 DEVMODEW DMW;
150 HSURF FillPatterns[HS_DDI_MAX];
151 GDIINFO GDIInfo;
152 DEVINFO DevInfo;
153 DRIVER_FUNCTIONS DriverFunctions;
154 PFILE_OBJECT VideoFileObject;
155 BOOLEAN PreparedDriver;
156 ULONG DisplayNumber;
157
158 GDIPOINTER Pointer;
159
160 /* Stuff to keep track of software cursors; win32k gdi part */
161 UINT SafetyRemoveLevel; /* at what level was the cursor removed?
162 0 for not removed */
163 UINT SafetyRemoveCount;
164 } GDIDEVICE;
165
166 /* Internal functions */
167
168 #define DC_LockDc(hDC) \
169 ((PDC) GDIOBJ_LockObj ((HGDIOBJ) hDC, GDI_OBJECT_TYPE_DC))
170 #define DC_UnlockDc(pDC) \
171 GDIOBJ_UnlockObjByPtr (pDC)
172
173 HDC FASTCALL RetrieveDisplayHDC(VOID);
174 HDC FASTCALL DC_AllocDC(PUNICODE_STRING Driver);
175 VOID FASTCALL DC_InitDC(HDC DCToInit);
176 HDC FASTCALL DC_FindOpenDC(PUNICODE_STRING Driver);
177 VOID FASTCALL DC_FreeDC(HDC DCToFree);
178 BOOL INTERNAL_CALL DC_Cleanup(PVOID ObjectBody);
179 HDC FASTCALL DC_GetNextDC (PDC pDC);
180 VOID FASTCALL DC_SetNextDC (PDC pDC, HDC hNextDC);
181 VOID FASTCALL DC_SetOwnership(HDC DC, PEPROCESS Owner);
182
183 VOID FASTCALL DC_UpdateXforms(PDC dc);
184 BOOL FASTCALL DC_InvertXform(const XFORM *xformSrc, XFORM *xformDest);
185
186 #endif