6 #include <win32k/driver.h>
7 #include <win32k/gdiobj.h>
8 #include <win32k/path.h>
15 HSURF FillPatterns[HS_DDI_MAX];
18 DRIVER_FUNCTIONS DriverFunctions;
21 /* (RJJ) Taken from WINE */
22 typedef struct _DEVICECAPS
24 WORD version; /* 0: driver version */
25 WORD technology; /* 2: device technology */
26 WORD horzSize; /* 4: width of display in mm */
27 WORD vertSize; /* 6: height of display in mm */
28 WORD horzRes; /* 8: width of display in pixels */
29 WORD vertRes; /* 10: width of display in pixels */
30 WORD bitsPixel; /* 12: bits per pixel */
31 WORD planes; /* 14: color planes */
32 WORD numBrushes; /* 16: device-specific brushes */
33 WORD numPens; /* 18: device-specific pens */
34 WORD numMarkers; /* 20: device-specific markers */
35 WORD numFonts; /* 22: device-specific fonts */
36 WORD numColors; /* 24: size of color table */
37 WORD pdeviceSize; /* 26: size of PDEVICE structure */
38 WORD curveCaps; /* 28: curve capabilities */
39 WORD lineCaps; /* 30: line capabilities */
40 WORD polygonalCaps; /* 32: polygon capabilities */
41 WORD textCaps; /* 34: text capabilities */
42 WORD clipCaps; /* 36: clipping capabilities */
43 WORD rasterCaps; /* 38: raster capabilities */
44 WORD aspectX; /* 40: relative width of device pixel */
45 WORD aspectY; /* 42: relative height of device pixel */
46 WORD aspectXY; /* 44: relative diagonal width of device pixel */
47 WORD pad1[21]; /* 46-86: reserved */
48 WORD logPixelsX; /* 88: pixels / logical X inch */
49 WORD logPixelsY; /* 90: pixels / logical Y inch */
50 WORD pad2[6]; /* 92-102: reserved */
51 WORD sizePalette; /* 104: entries in system palette */
52 WORD numReserved; /* 106: reserved entries */
53 WORD colorRes; /* 108: color resolution */
54 } DEVICECAPS, *PDEVICECAPS;
56 typedef struct _WIN_DC_INFO
59 const PDEVICECAPS devCaps;
60 HRGN hClipRgn; /* Clip region (may be 0) */
61 HRGN hVisRgn; /* Visible region (must never be 0) */
62 HRGN hGCClipRgn; /* GC clip region (ClipRgn AND VisRgn) */
67 HBITMAP hFirstBitmap; /* Bitmap selected at creation of the DC */
81 COLORREF backgroundColor;
87 WORD textAlign; /* Text alignment from SetTextAlign() */
88 short charExtra; /* Spacing from SetTextCharacterExtra() */
89 short breakTotalExtra; /* Total extra space for justification */
90 short breakCount; /* Break char. count */
91 short breakExtra; /* breakTotalExtra / breakCount */
92 short breakRem; /* breakTotalExtra % breakCount */
98 INT GraphicsMode; /* Graphics mode */
99 INT DCOrgX; /* DC origin */
103 FARPROC lpfnPrint; /* AbortProc for Printing */
106 INT CursPosX; /* Current position */
110 XFORM xformWorld2Wnd; /* World-to-window transformation */
111 XFORM xformWorld2Vport; /* World-to-viewport transformation */
112 XFORM xformVport2World; /* Inverse of the above transformation */
113 BOOL vport2WorldValid; /* Is xformVport2World valid? */
117 #define DC_MEMORY 0x0001 /* It is a memory DC */
118 #define DC_SAVED 0x0002 /* It is a saved DC */
119 #define DC_DIRTY 0x0004 /* hVisRgn has to be updated */
120 #define DC_THUNKHOOK 0x0008 /* DC hook is in the 16-bit code */
122 #define GDI_DC_TYPE (1)
130 HSURF FillPatternSurfaces[HS_DDI_MAX];
135 DRIVER_FUNCTIONS DriverFunctions;
139 INT wndOrgX; /* Window origin */
141 INT wndExtX; /* Window extent */
143 INT vportOrgX; /* Viewport origin */
145 INT vportExtX; /* Viewport extent */
153 /* Internal functions */
156 #define DC_PtrToHandle(pDC) \
157 ((HDC) GDIOBJ_PtrToHandle ((PGDIOBJ) pDC, GO_DC_MAGIC))
160 #define DC_HandleToPtr(hDC) \
161 ((PDC) GDIOBJ_LockObj ((HGDIOBJ) hDC, GO_DC_MAGIC))
162 #define DC_ReleasePtr(hDC) \
163 GDIOBJ_UnlockObj ((HGDIOBJ) hDC, GO_DC_MAGIC)
165 HDC RetrieveDisplayHDC(VOID);
166 HDC DC_AllocDC(LPCWSTR Driver);
167 void DC_InitDC(HDC DCToInit);
168 HDC DC_FindOpenDC(LPCWSTR Driver);
169 void DC_FreeDC(HDC DCToFree);
170 HDC DC_GetNextDC (PDC pDC);
171 void DC_SetNextDC (PDC pDC, HDC hNextDC);
172 BOOL DC_InternalDeleteDC( PDC DCToDelete );
174 void DC_UpdateXforms(PDC dc);
175 BOOL DC_InvertXform(const XFORM *xformSrc, XFORM *xformDest);
177 /* User entry points */
179 BOOL STDCALL W32kCancelDC(HDC hDC);
180 HDC STDCALL W32kCreateCompatableDC(HDC hDC);
181 HDC STDCALL W32kCreateDC(LPCWSTR Driver,
184 CONST PDEVMODEW InitData);
185 HDC STDCALL W32kCreateIC(LPCWSTR Driver,
188 CONST PDEVMODEW DevMode);
189 BOOL STDCALL W32kDeleteDC(HDC hDC);
190 BOOL STDCALL W32kDeleteObject(HGDIOBJ hObject);
191 INT STDCALL W32kDrawEscape(HDC hDC,
196 /* FIXME: this typedef should go somewhere else... */
197 typedef VOID (*GOBJENUMPROC)(PVOID, LPARAM);
199 INT STDCALL W32kEnumObjects(HDC hDC,
201 GOBJENUMPROC ObjectFunc,
204 COLORREF STDCALL W32kGetBkColor(HDC hDC);
205 INT STDCALL W32kGetBkMode(HDC hDC);
206 BOOL STDCALL W32kGetBrushOrgEx(HDC hDC, LPPOINT brushOrg);
207 HRGN STDCALL W32kGetClipRgn(HDC hDC);
208 HGDIOBJ STDCALL W32kGetCurrentObject(HDC hDC, UINT ObjectType);
209 BOOL STDCALL W32kGetCurrentPositionEx(HDC hDC, LPPOINT currentPosition);
210 BOOL STDCALL W32kGetDCOrgEx(HDC hDC, LPPOINT Point);
211 HDC STDCALL W32kGetDCState16(HDC hDC);
212 INT STDCALL W32kGetDeviceCaps(HDC hDC, INT Index);
213 INT STDCALL W32kGetMapMode(HDC hDC);
214 INT STDCALL W32kGetObject(HGDIOBJ hGDIObj,
217 DWORD STDCALL W32kGetObjectType(HGDIOBJ hGDIObj);
218 INT STDCALL W32kGetPolyFillMode(HDC hDC);
219 INT STDCALL W32kGetRelAbs(HDC hDC);
220 INT STDCALL W32kGetROP2(HDC hDC);
221 HGDIOBJ STDCALL W32kGetStockObject(INT Object);
222 INT STDCALL W32kGetStretchBltMode(HDC hDC);
223 COLORREF STDCALL W32kGetTextColor(HDC hDC);
224 UINT STDCALL W32kGetTextAlign(HDC hDC);
225 BOOL STDCALL W32kGetViewportExtEx(HDC hDC, LPSIZE viewportExt);
226 BOOL STDCALL W32kGetViewportOrgEx(HDC hDC, LPPOINT viewportOrg);
227 BOOL STDCALL W32kGetWindowExtEx(HDC hDC, LPSIZE windowExt);
228 BOOL STDCALL W32kGetWindowOrgEx(HDC hDC, LPPOINT windowOrg);
229 HDC STDCALL W32kResetDC(HDC hDC, CONST DEVMODEW *InitData);
230 BOOL STDCALL W32kRestoreDC(HDC hDC, INT SavedDC);
231 INT STDCALL W32kSaveDC(HDC hDC);
232 HGDIOBJ STDCALL W32kSelectObject(HDC hDC, HGDIOBJ hGDIObj);
233 INT STDCALL W32kSetBkMode(HDC hDC, INT backgroundMode);
234 INT STDCALL W32kSetPolyFillMode(HDC hDC, INT polyFillMode);
235 INT STDCALL W32kSetRelAbs(HDC hDC, INT relAbsMode);
236 INT STDCALL W32kSetROP2(HDC hDC, INT ROPmode);
237 INT STDCALL W32kSetStretchBltMode(HDC hDC, INT stretchBltMode);
238 COLORREF STDCALL W32kSetTextColor(HDC hDC, COLORREF color);