[YAROTOWS] Reintegrate the branch. For a brighter future.
[reactos.git] / reactos / subsystems / win32 / win32k / include / pdevobj.h
1 #ifndef __WIN32K_PDEVOBJ_H
2 #define __WIN32K_PDEVOBJ_H
3
4 /* PDEVOBJ flags */
5 #define PDEV_DISPLAY 0x00000001 /* Display device */
6 #define PDEV_HARDWARE_POINTER 0x00000002 /* Supports hardware cursor */
7 #define PDEV_SOFTWARE_POINTER 0x00000004
8 #define PDEV_GOTFONTS 0x00000040 /* Has font driver */
9 #define PDEV_PRINTER 0x00000080
10 #define PDEV_ALLOCATEDBRUSHES 0x00000100
11 #define PDEV_HTPAL_IS_DEVPAL 0x00000200
12 #define PDEV_DISABLED 0x00000400
13 #define PDEV_SYNCHRONIZE_ENABLED 0x00000800
14 #define PDEV_FONTDRIVER 0x00002000 /* Font device */
15 #define PDEV_GAMMARAMP_TABLE 0x00004000
16 #define PDEV_UMPD 0x00008000
17 #define PDEV_SHARED_DEVLOCK 0x00010000
18 #define PDEV_META_DEVICE 0x00020000
19 #define PDEV_DRIVER_PUNTED_CALL 0x00040000 /* Driver calls back to GDI engine */
20 #define PDEV_CLONE_DEVICE 0x00080000
21
22 /* Type definitions ***********************************************************/
23
24 typedef struct _GDIPOINTER /* should stay private to ENG? No, part of PDEVOBJ aka HDEV aka PDEV. */
25 {
26 /* private GDI pointer handling information, required for software emulation */
27 BOOL Enabled;
28 SIZEL Size;
29 POINTL HotSpot;
30 XLATEOBJ *XlateObject;
31 SURFACE *psurfColor;
32 SURFACE *psurfMask;
33 SURFACE *psurfSave;
34
35 /* public pointer information */
36 RECTL Exclude; /* required publicly for SPS_ACCEPT_EXCLUDE */
37 } GDIPOINTER, *PGDIPOINTER;
38
39 typedef struct _DEVMODEINFO
40 {
41 struct _DEVMODEINFO *pdmiNext;
42 struct _LDEVOBJ *pldev;
43 ULONG cbdevmode;
44 DEVMODEW adevmode[1];
45 } DEVMODEINFO, *PDEVMODEINFO;
46
47 typedef struct
48 {
49 DWORD dwFlags;
50 PDEVMODEW pdm;
51
52 } DEVMODEENTRY, *PDEVMODEENTRY;
53
54 typedef struct _GRAPHICS_DEVICE
55 {
56 WCHAR szNtDeviceName[CCHDEVICENAME/2];
57 WCHAR szWinDeviceName[CCHDEVICENAME/2];
58 struct _GRAPHICS_DEVICE * pNextGraphicsDevice;
59 struct _GRAPHICS_DEVICE * pVgaDevice;
60 PDEVICE_OBJECT DeviceObject;
61 PVOID pDeviceHandle;
62 DWORD hkClassDriverConfig;
63 DWORD StateFlags; /* See DISPLAY_DEVICE_* */
64 ULONG cbdevmodeInfo;
65 PDEVMODEINFO pdevmodeInfo;
66 ULONG cDevModes;
67 PDEVMODEENTRY pDevModeList;
68 LPWSTR pDiplayDrivers;
69 LPWSTR pwszDescription;
70 DWORD dwUnknown;
71 PVOID pUnknown;
72 PFILE_OBJECT FileObject;
73 DWORD ProtocolType;
74 ULONG iDefaultMode;
75 ULONG iCurrentMode;
76 } GRAPHICS_DEVICE, *PGRAPHICS_DEVICE;
77
78 typedef struct _PDEVOBJ
79 {
80 BASEOBJECT BaseObject;
81
82 struct _PDEVOBJ * ppdevNext;
83 LONG cPdevRefs;
84 LONG cPdevOpenRefs;
85 struct _PDEVOBJ * ppdevParent;
86 FLONG flFlags; // flags
87 // FLONG flAccelerated;
88 HSEMAPHORE hsemDevLock; /* Device lock. */
89 // HSEMAPHORE hsemPointer;
90 POINTL ptlPointer;
91 // SIZEL szlPointer;
92 // SPRITESTATE SpriteState;
93 // HFONT hlfntDefault;
94 // HFONT hlfntAnsiVariable;
95 // HFONT hlfntAnsiFixed;
96 HSURF ahsurf[HS_DDI_MAX];
97 // PUNICODE_STRING pusPrtDataFileName;
98 // PVOID pDevHTInfo;
99 // RFONT * prfntActive;
100 // RFONT * prfntInactive;
101 // ULONG cInactive;
102 // BYTE ajbo[0x5C];
103 // ULONG cDirectDrawDisableLocks;
104 // PVOID TypeOneInfo;
105 PVOID pvGammaRamp; /* Gamma ramp pointer. */
106 // PVOID RemoteTypeOne;
107 ULONG ulHorzRes;
108 ULONG ulVertRes;
109 // PFN_DrvSetPointerShape pfnDrvSetPointerShape;
110 // PFN_DrvMovePointer pfnDrvMovePointer;
111 PFN_DrvMovePointer pfnMovePointer;
112 // PFN_DrvSynchronize pfnDrvSynchronize;
113 // PFN_DrvSynchronizeSurface pfnDrvSynchronizeSurface;
114 // PFN_DrvSetPalette pfnDrvSetPalette;
115 // PFN_DrvNotify pfnDrvNotify;
116 // ULONG TagSig;
117 struct _LDEVOBJ * pldev;
118 DHPDEV dhpdev; /* DHPDEV for device. */
119 struct _PALETTE* ppalSurf; /* PEPALOBJ/PPALETTE for this device. */
120 DEVINFO devinfo;
121 GDIINFO gdiinfo;
122 PSURFACE pSurface; /* SURFACE for this device. */
123 // HANDLE hSpooler; /* Handle to spooler, if spooler dev driver. */
124 // PVOID pDesktopId;
125 PGRAPHICS_DEVICE pGraphicsDevice;
126 POINTL ptlOrigion;
127 PDEVMODEW pdmwDev; /* Ptr->DEVMODEW.dmSize + dmDriverExtra == alloc size. */
128 // DWORD Unknown3;
129 FLONG DxDd_Flags; /* DxDD active status flags. */
130 // LONG devAttr;
131 // PVOID WatchDogContext;
132 // ULONG WatchDogs;
133 union
134 {
135 DRIVER_FUNCTIONS DriverFunctions;
136 DRIVER_FUNCTIONS pfn;
137 PVOID apfn[INDEX_LAST]; // B8C 0x0598
138 };
139
140 /* ros specific */
141 ULONG DxDd_nCount;
142 GDIPOINTER Pointer;
143 /* Stuff to keep track of software cursors; win32k gdi part */
144 UINT SafetyRemoveLevel; /* at what level was the cursor removed?
145 0 for not removed */
146 UINT SafetyRemoveCount;
147 struct _EDD_DIRECTDRAW_GLOBAL * pEDDgpl;
148 } PDEVOBJ, *PPDEVOBJ;
149
150 /* Globals ********************************************************************/
151
152 extern PPDEVOBJ gppdevPrimary;
153 #define pPrimarySurface gppdevPrimary
154
155
156 /* Function prototypes ********************************************************/
157
158 PPDEVOBJ
159 NTAPI
160 EngpGetPDEV(PUNICODE_STRING pustrDevice);
161
162 VOID
163 NTAPI
164 PDEVOBJ_vRelease(PPDEVOBJ ppdev);
165
166 PSURFACE
167 NTAPI
168 PDEVOBJ_pSurface(
169 PPDEVOBJ ppdev);
170
171 VOID
172 NTAPI
173 PDEVOBJ_vGetDeviceCaps(
174 PPDEVOBJ ppdev,
175 PDEVCAPS pDevCaps);
176
177 BOOL
178 NTAPI
179 InitPDEVImpl();
180
181 BOOL
182 NTAPI
183 InitLDEVImpl();
184
185 BOOL
186 NTAPI
187 InitDeviceImpl();
188
189 PSIZEL
190 FASTCALL
191 PDEVOBJ_sizl(PPDEVOBJ, PSIZEL);
192
193 #endif /* !__WIN32K_PDEVOBJ_H */