f0b4cb46d93b2225e3a5e220e0a5a417db01dcad
[reactos.git] / win32ss / gdi / gdi32 / include / gdi32p.h
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS System Libraries
4 * FILE: win32ss/gdi/gdi32/include/gdi32p.h
5 * PURPOSE: User-Mode Win32 GDI Library Private Header
6 * PROGRAMMER: Alex Ionescu (alex@relsoft.net)
7 */
8
9 #pragma once
10
11 /* DATA **********************************************************************/
12
13 extern PGDI_TABLE_ENTRY GdiHandleTable;
14 extern PGDI_SHARED_HANDLE_TABLE GdiSharedHandleTable;
15 extern HANDLE hProcessHeap;
16 extern HANDLE CurrentProcessId;
17 extern DWORD GDI_BatchLimit;
18 extern PDEVCAPS GdiDevCaps;
19 extern BOOL gbLpk; // Global bool LanguagePack
20 extern HANDLE ghSpooler;
21 extern RTL_CRITICAL_SECTION semLocal;
22
23 typedef INT
24 (CALLBACK* EMFPLAYPROC)(
25 HDC hdc,
26 INT iFunction,
27 HANDLE hPageQuery
28 );
29
30 typedef BOOL
31 (WINAPI* LPKETO)(
32 HDC hdc,
33 int x,
34 int y,
35 UINT fuOptions,
36 const RECT *lprc,
37 LPCWSTR lpString,
38 UINT uCount,
39 const INT *lpDx,
40 INT unknown
41 );
42
43 typedef DWORD
44 (WINAPI* LPKGCP)(
45 HDC hdc,
46 LPCWSTR lpString,
47 INT uCount,
48 INT nMaxExtent,
49 LPGCP_RESULTSW lpResults,
50 DWORD dwFlags,
51 DWORD dwUnused
52 );
53
54 extern HINSTANCE hLpk;
55 extern LPKETO LpkExtTextOut;
56 extern LPKGCP LpkGetCharacterPlacement;
57
58 /* DEFINES *******************************************************************/
59
60 #define HANDLE_LIST_INC 20
61
62 #define METAFILE_MEMORY 1
63 #define METAFILE_DISK 2
64
65 #define SAPCALLBACKDELAY 244
66
67 #define LPK_INIT 1
68 #define LPK_ETO 2
69 #define LPK_GCP 3
70
71 /* MACRO ********************************************************************/
72
73 #define ROP_USES_SOURCE(Rop) (((Rop) << 2 ^ Rop) & 0xCC0000)
74 #define RCAST(_Type, _Value) (*((_Type*)&_Value))
75
76
77 /* TYPES *********************************************************************/
78
79 // Based on wmfapi.h and Wine.
80 typedef struct tagMETAFILEDC
81 {
82 PVOID pvMetaBuffer;
83 HANDLE hFile;
84 DWORD Size;
85 DWORD dwWritten;
86 METAHEADER mh;
87 WORD reserved;
88 HLOCAL MFObjList;
89 HPEN hPen;
90 HBRUSH hBrush;
91 HDC hDc;
92 HGDIOBJ hMetaDc;
93 HPALETTE hPalette;
94 HFONT hFont;
95 HBITMAP hBitmap;
96 HRGN hRegion;
97 HGDIOBJ hMetafile;
98 HGDIOBJ hMemDc;
99 HPEN hExtPen;
100 HGDIOBJ hEnhMetaDc;
101 HGDIOBJ hEnhMetaFile;
102 HCOLORSPACE hColorSpace;
103 WCHAR Filename[MAX_PATH+2];
104 } METAFILEDC,*PMETAFILEDC;
105
106 // Metafile Entry handle
107 typedef struct tagMF_ENTRY
108 {
109 LIST_ENTRY List;
110 HGDIOBJ hmDC; // Handle return from NtGdiCreateClientObj.
111 PMETAFILEDC pmfDC;
112 } MF_ENTRY, *PMF_ENTRY;
113
114 typedef struct tagENHMETAFILE
115 {
116 PVOID pvMetaBuffer;
117 HANDLE hFile; /* Handle for disk based MetaFile */
118 DWORD Size;
119 INT iType;
120 PENHMETAHEADER emf;
121 UINT handles_size, cur_handles;
122 HGDIOBJ *handles;
123 INT horzres, vertres;
124 INT horzsize, vertsize;
125 INT logpixelsx, logpixelsy;
126 INT bitspixel;
127 INT textcaps;
128 INT rastercaps;
129 INT technology;
130 INT planes;
131 } ENHMETAFILE,*PENHMETAFILE;
132
133
134 #define PDEV_UMPD_ID 0xFEDCBA98
135 // UMPDEV flags
136 #define UMPDEV_NO_ESCAPE 0x0002
137 #define UMPDEV_SUPPORT_ESCAPE 0x0004
138 typedef struct _UMPDEV
139 {
140 DWORD_PTR Sig; // Init with PDEV_UMPD_ID
141 struct _UMPDEV *pumpdNext;
142 PDRIVER_INFO_5W pdi5Info;
143 HMODULE hModule;
144 DWORD dwFlags;
145 DWORD dwDriverAttributes;
146 DWORD dwConfigVersion; // Number of times the configuration
147 // file for this driver has been upgraded
148 // or downgraded since the last spooler restart.
149 DWORD dwDriverCount; // After init should be 2
150 DWORD WOW64_UMPDev;
151 DWORD WOW64_hMod;
152 DWORD Unknown;
153 PVOID apfn[INDEX_LAST]; // Print Driver pfn
154 } UMPDEV, *PUMPDEV;
155
156 #define LOCALFONT_COUNT 10
157 typedef struct _LOCALFONT
158 {
159 FONT_ATTR lfa[LOCALFONT_COUNT];
160 } LOCALFONT, *PLOCALFONT;
161
162 // sdk/winspool.h
163 typedef BOOL (WINAPI *ABORTPRINTER) (HANDLE);
164 typedef BOOL (WINAPI *CLOSEPRINTER) (HANDLE);
165 typedef BOOL (WINAPI *CLOSESPOOLFILEHANDLE) (HANDLE, HANDLE); // W2k8
166 typedef HANDLE (WINAPI *COMMITSPOOLDATA) (HANDLE,HANDLE,DWORD); // W2k8
167 typedef LONG (WINAPI *DOCUMENTPROPERTIESW) (HWND,HANDLE,LPWSTR,PDEVMODEW,PDEVMODEW,DWORD);
168 typedef BOOL (WINAPI *ENDDOCPRINTER) (HANDLE);
169 typedef BOOL (WINAPI *ENDPAGEPRINTER) (HANDLE);
170 typedef BOOL (WINAPI *GETPRINTERW) (HANDLE,DWORD,LPBYTE,DWORD,LPDWORD);
171 typedef BOOL (WINAPI *GETPRINTERDRIVERW) (HANDLE,LPWSTR,DWORD,LPBYTE,DWORD,LPDWORD);
172 typedef HANDLE (WINAPI *GETSPOOLFILEHANDLE) (HANDLE); // W2k8
173 typedef BOOL (WINAPI *ISVALIDDEVMODEW) (PDEVMODEW,size_t);
174 typedef BOOL (WINAPI *OPENPRINTERW) (LPWSTR,PHANDLE,LPPRINTER_DEFAULTSW);
175 typedef BOOL (WINAPI *READPRINTER) (HANDLE,PVOID,DWORD,PDWORD);
176 typedef BOOL (WINAPI *RESETPRINTERW) (HANDLE,LPPRINTER_DEFAULTSW);
177 typedef LPWSTR (WINAPI *STARTDOCDLGW) (HANDLE,DOCINFOW *);
178 typedef DWORD (WINAPI *STARTDOCPRINTERW) (HANDLE,DWORD,PBYTE);
179 typedef BOOL (WINAPI *STARTPAGEPRINTER) (HANDLE);
180 // ddk/winsplp.h
181 typedef BOOL (WINAPI *SEEKPRINTER) (HANDLE,LARGE_INTEGER,PLARGE_INTEGER,DWORD,BOOL);
182 typedef BOOL (WINAPI *SPLREADPRINTER) (HANDLE,LPBYTE *,DWORD);
183 // Same as ddk/winsplp.h DriverUnloadComplete?
184 typedef BOOL (WINAPI *SPLDRIVERUNLOADCOMPLETE) (LPWSTR);
185 // Driver support:
186 // DrvDocumentEvent api/winddiui.h not W2k8 DocumentEventAW
187 typedef INT (WINAPI *DOCUMENTEVENT) (HANDLE,HDC,INT,ULONG,PVOID,ULONG,PVOID);
188 // DrvQueryColorProfile
189 typedef BOOL (WINAPI *QUERYCOLORPROFILE) (HANDLE,PDEVMODEW,ULONG,VOID*,ULONG,FLONG);
190 // Unknown:
191 typedef DWORD (WINAPI *QUERYSPOOLMODE) (HANDLE,DWORD,DWORD);
192 typedef DWORD (WINAPI *QUERYREMOTEFONTS) (DWORD,DWORD,DWORD);
193
194 extern CLOSEPRINTER fpClosePrinter;
195 extern OPENPRINTERW fpOpenPrinterW;
196
197 /* FUNCTIONS *****************************************************************/
198
199 PVOID
200 HEAP_alloc(DWORD len);
201
202 NTSTATUS
203 HEAP_strdupA2W(
204 LPWSTR* ppszW,
205 LPCSTR lpszA
206 );
207
208 VOID
209 HEAP_free(LPVOID memory);
210
211 VOID
212 FASTCALL
213 FONT_TextMetricWToA(
214 const TEXTMETRICW *ptmW,
215 LPTEXTMETRICA ptmA
216 );
217
218 VOID
219 FASTCALL
220 NewTextMetricW2A(
221 NEWTEXTMETRICA *tma,
222 NEWTEXTMETRICW *tmw
223 );
224
225 VOID
226 FASTCALL
227 NewTextMetricExW2A(
228 NEWTEXTMETRICEXA *tma,
229 NEWTEXTMETRICEXW *tmw
230 );
231
232 BOOL
233 FASTCALL
234 DeleteRegion( HRGN );
235
236 BOOL
237 WINAPI
238 GdiValidateHandle(HGDIOBJ);
239
240 BOOL
241 GdiGetHandleUserData(
242 HGDIOBJ hGdiObj,
243 DWORD ObjectType,
244 PVOID *UserData
245 );
246
247 PLDC
248 FASTCALL
249 GdiGetLDC(HDC hDC);
250
251 BOOL
252 FASTCALL
253 GdiSetLDC(HDC hdc, PVOID pvLDC);
254
255 HGDIOBJ
256 WINAPI
257 GdiFixUpHandle(HGDIOBJ hGO);
258
259 BOOL
260 WINAPI
261 CalculateColorTableSize(
262 CONST BITMAPINFOHEADER *BitmapInfoHeader,
263 UINT *ColorSpec,
264 UINT *ColorTableSize
265 );
266
267 LPBITMAPINFO
268 WINAPI
269 ConvertBitmapInfo(
270 CONST BITMAPINFO *BitmapInfo,
271 UINT ColorSpec,
272 UINT *BitmapInfoSize,
273 BOOL FollowedByData
274 );
275
276 DWORD
277 WINAPI
278 GetAndSetDCDWord(
279 _In_ HDC hdc,
280 _In_ UINT u,
281 _In_ DWORD dwIn,
282 _In_ ULONG ulMFId,
283 _In_ USHORT usMF16Id,
284 _In_ DWORD dwError);
285
286 DWORD
287 WINAPI
288 GetDCDWord(
289 _In_ HDC hdc,
290 _In_ UINT u,
291 _In_ DWORD dwError);
292
293 HGDIOBJ
294 WINAPI
295 GetDCObject( HDC, INT);
296
297 VOID
298 NTAPI
299 LogFontA2W(
300 LPLOGFONTW pW,
301 CONST LOGFONTA *pA
302 );
303
304 VOID
305 NTAPI
306 LogFontW2A(
307 LPLOGFONTA pA,
308 CONST LOGFONTW *pW
309 );
310
311 VOID
312 WINAPI
313 EnumLogFontExW2A(
314 LPENUMLOGFONTEXA fontA,
315 CONST ENUMLOGFONTEXW *fontW );
316
317 BOOL
318 WINAPI
319 LoadLPK(
320 INT LpkFunctionID
321 );
322
323 VOID
324 WINAPI
325 GdiInitializeLanguagePack(
326 _In_ DWORD InitParam);
327
328 VOID
329 WINAPI
330 InitializeLpkHooks(
331 _In_ FARPROC *hookfuncs);
332
333 BOOL
334 WINAPI
335 GetETM(HDC hdc,
336 EXTTEXTMETRIC *petm);
337
338 /* FIXME: Put in some public header */
339 UINT
340 WINAPI
341 UserRealizePalette(HDC hDC);
342
343 int
344 WINAPI
345 GdiAddFontResourceW(LPCWSTR lpszFilename,FLONG fl,DESIGNVECTOR *pdv);
346
347 VOID
348 WINAPI
349 GdiSetLastError( DWORD dwErrCode );
350
351 DWORD WINAPI GdiGetCodePage(HDC);
352
353 int
354 WINAPI
355 GdiGetBitmapBitsSize(BITMAPINFO *lpbmi);
356
357 VOID GdiSAPCallback(PLDC pldc);
358 HGDIOBJ FASTCALL hGetPEBHandle(HANDLECACHETYPE,COLORREF);
359
360 int FASTCALL DocumentEventEx(PVOID,HANDLE,HDC,int,ULONG,PVOID,ULONG,PVOID);
361 BOOL FASTCALL EndPagePrinterEx(PVOID,HANDLE);
362 BOOL FASTCALL LoadTheSpoolerDrv(VOID);
363
364 FORCEINLINE
365 PVOID
366 GdiAllocBatchCommand(
367 HDC hdc,
368 USHORT Cmd)
369 {
370 PTEB pTeb;
371 USHORT cjSize;
372 PGDIBATCHHDR pHdr;
373
374 /* Get a pointer to the TEB */
375 pTeb = NtCurrentTeb();
376
377 /* Check if we have a valid environment */
378 if (!pTeb || !pTeb->Win32ThreadInfo) return NULL;
379
380 /* Do we use a DC? */
381 if (hdc)
382 {
383 /* If the batch DC is NULL, we set this one as the new one */
384 if (!pTeb->GdiTebBatch.HDC) pTeb->GdiTebBatch.HDC = hdc;
385
386 /* If not, check if the batch DC equal to our DC */
387 else if (pTeb->GdiTebBatch.HDC != hdc) return NULL;
388 }
389
390 /* Get the size of the entry */
391 if (Cmd == GdiBCPatBlt) cjSize = sizeof(GDIBSPATBLT);
392 else if (Cmd == GdiBCPolyPatBlt) cjSize = sizeof(GDIBSPPATBLT);
393 else if (Cmd == GdiBCTextOut) cjSize = sizeof(GDIBSTEXTOUT);
394 else if (Cmd == GdiBCExtTextOut) cjSize = sizeof(GDIBSEXTTEXTOUT);
395 else if (Cmd == GdiBCSetBrushOrg) cjSize = sizeof(GDIBSSETBRHORG);
396 else if (Cmd == GdiBCExtSelClipRgn) cjSize = 0;
397 else if (Cmd == GdiBCSelObj) cjSize = sizeof(GDIBSOBJECT);
398 else if (Cmd == GdiBCDelRgn) cjSize = sizeof(GDIBSOBJECT);
399 else if (Cmd == GdiBCDelObj) cjSize = sizeof(GDIBSOBJECT);
400 else cjSize = 0;
401
402 /* Unsupported operation */
403 if (cjSize == 0) return NULL;
404
405 /* Check if the buffer is full */
406 if ((pTeb->GdiBatchCount >= GDI_BatchLimit) ||
407 ((pTeb->GdiTebBatch.Offset + cjSize) > GDIBATCHBUFSIZE))
408 {
409 /* Call win32k, the kernel will call NtGdiFlushUserBatch to flush
410 the current batch */
411 NtGdiFlush();
412 }
413
414 /* Get the head of the entry */
415 pHdr = (PVOID)((PUCHAR)pTeb->GdiTebBatch.Buffer + pTeb->GdiTebBatch.Offset);
416
417 /* Update Offset and batch count */
418 pTeb->GdiTebBatch.Offset += cjSize;
419 pTeb->GdiBatchCount++;
420
421 /* Fill in the core fields */
422 pHdr->Cmd = Cmd;
423 pHdr->Size = cjSize;
424
425 return pHdr;
426 }
427
428 FORCEINLINE
429 PDC_ATTR
430 GdiGetDcAttr(HDC hdc)
431 {
432 GDILOOBJTYPE eDcObjType;
433 PDC_ATTR pdcattr;
434
435 /* Check DC object type */
436 eDcObjType = GDI_HANDLE_GET_TYPE(hdc);
437 if ((eDcObjType != GDILoObjType_LO_DC_TYPE) &&
438 (eDcObjType != GDILoObjType_LO_ALTDC_TYPE))
439 {
440 return NULL;
441 }
442
443 /* Get the DC attribute */
444 if (!GdiGetHandleUserData((HGDIOBJ)hdc, eDcObjType, (PVOID*)&pdcattr))
445 {
446 return NULL;
447 }
448
449 return pdcattr;
450 }
451
452 FORCEINLINE
453 PRGN_ATTR
454 GdiGetRgnAttr(HRGN hrgn)
455 {
456 PRGN_ATTR prgnattr;
457
458 /* Get the region attribute */
459 if (!GdiGetHandleUserData(hrgn, GDILoObjType_LO_REGION_TYPE, (PVOID*)&prgnattr))
460 {
461 return NULL;
462 }
463
464 return prgnattr;
465 }
466
467 #ifdef _M_IX86
468 FLOATL FASTCALL EFtoF(EFLOAT_S * efp);
469 #define FOtoF(pfo) EFtoF((EFLOAT_S*)pfo)
470 #else
471 #define FOtoF(pfo) (*(pfo))
472 #endif
473
474 /* This is an inlined version of lrintf. */
475 FORCEINLINE
476 int
477 _lrintf(float f)
478 {
479 #if defined(_M_IX86) && defined(__GNUC__)
480 int result;
481 __asm__ __volatile__ ("fistpl %0" : "=m" (result) : "t" (f) : "st");
482 return result;
483 #elif defined(_M_IX86) && defined(_MSC_VER)
484 int result;
485 __asm
486 {
487 fld f;
488 fistp result;
489 }
490 #else
491 /* slow, but portable */
492 return (int)(f >= 0 ? f+0.5 : f-0.5);
493 #endif
494 }
495
496 HBRUSH
497 WINAPI
498 GdiSelectBrush(
499 _In_ HDC hdc,
500 _In_ HBRUSH hbr);
501
502 HPEN
503 WINAPI
504 GdiSelectPen(
505 _In_ HDC hdc,
506 _In_ HPEN hpen);
507
508 HFONT
509 WINAPI
510 GdiSelectFont(
511 _In_ HDC hdc,
512 _In_ HFONT hfont);
513
514 HGDIOBJ
515 WINAPI
516 GdiCreateClientObj(
517 _In_ PVOID pvObject,
518 _In_ GDILOOBJTYPE eObjType);
519
520 PVOID
521 WINAPI
522 GdiDeleteClientObj(
523 _In_ HGDIOBJ hobj);
524
525 BOOL
526 WINAPI
527 GdiCreateClientObjLink(
528 _In_ HGDIOBJ hobj,
529 _In_ PVOID pvObject);
530
531 PVOID
532 WINAPI
533 GdiGetClientObjLink(
534 _In_ HGDIOBJ hobj);
535
536 PVOID
537 WINAPI
538 GdiRemoveClientObjLink(
539 _In_ HGDIOBJ hobj);
540
541 extern ULONG gcClientObj;
542
543 VOID
544 WINAPI
545 METADC_DeleteObject(HGDIOBJ hobj);
546
547 BOOL
548 WINAPI
549 METADC_DeleteDC(
550 _In_ HDC hdc);
551
552 INT
553 WINAPI
554 METADC16_Escape(
555 _In_ HDC hdc,
556 _In_ INT nEscape,
557 _In_ INT cbInput,
558 _In_ LPCSTR lpvInData,
559 _Out_ LPVOID lpvOutData);
560
561 BOOL
562 WINAPI
563 METADC_ExtTextOutW(
564 HDC hdc,
565 INT x,
566 INT y,
567 UINT fuOptions,
568 const RECT *lprc,
569 LPCWSTR lpString,
570 UINT cchString,
571 const INT *lpDx);
572
573 BOOL
574 WINAPI
575 METADC_PatBlt(
576 _In_ HDC hdc,
577 _In_ INT xLeft,
578 _In_ INT yTop,
579 _In_ INT nWidth,
580 _In_ INT nHeight,
581 _In_ DWORD dwRop);
582
583
584 /* The following METADC_* functions follow this pattern: */
585 #define HANDLE_METADC0P(_RetType, _Func, dwError, hdc, ...) \
586 if (GDI_HANDLE_GET_TYPE(hdc) != GDILoObjType_LO_DC_TYPE) \
587 { \
588 DWORD_PTR dwResult; \
589 if (METADC_Dispatch(DCFUNC_##_Func, &dwResult, (DWORD_PTR)dwError, hdc)) \
590 { \
591 return (_RetType)dwResult; \
592 } \
593 }
594
595 #define HANDLE_METADC(_RetType, _Func, dwError, hdc, ...) \
596 if (GDI_HANDLE_GET_TYPE(hdc) != GDILoObjType_LO_DC_TYPE) \
597 { \
598 DWORD_PTR dwResult = 1; \
599 if (METADC_Dispatch(DCFUNC_##_Func, &dwResult, (DWORD_PTR)dwError, hdc, __VA_ARGS__)) \
600 { \
601 return (_RetType)dwResult; \
602 } \
603 }
604
605
606 typedef enum _DCFUNC
607 {
608 //DCFUNC_AbortDoc,
609 DCFUNC_AbortPath,
610 DCFUNC_AlphaBlend, // UNIMPLEMENTED
611 DCFUNC_AngleArc, // UNIMPLEMENTED
612 DCFUNC_Arc,
613 DCFUNC_ArcTo, // UNIMPLEMENTED
614 DCFUNC_BeginPath,
615 //DCFUNC_BitBlt,
616 DCFUNC_Chord,
617 DCFUNC_CloseFigure,
618 DCFUNC_Ellipse,
619 DCFUNC_EndPath,
620 DCFUNC_ExcludeClipRect,
621 DCFUNC_ExtEscape,
622 DCFUNC_ExtFloodFill,
623 DCFUNC_ExtSelectClipRgn,
624 DCFUNC_ExtTextOut,
625 DCFUNC_FillPath,
626 DCFUNC_FillRgn,
627 DCFUNC_FlattenPath,
628 DCFUNC_FrameRgn,
629 DCFUNC_GetDeviceCaps,
630 DCFUNC_GdiComment,
631 DCFUNC_GradientFill, // UNIMPLEMENTED
632 DCFUNC_IntersectClipRect,
633 DCFUNC_InvertRgn,
634 DCFUNC_LineTo,
635 DCFUNC_MaskBlt, // UNIMPLEMENTED
636 DCFUNC_ModifyWorldTransform,
637 DCFUNC_MoveTo,
638 DCFUNC_OffsetClipRgn,
639 DCFUNC_OffsetViewportOrgEx,
640 DCFUNC_OffsetWindowOrgEx,
641 DCFUNC_PathToRegion, // UNIMPLEMENTED
642 DCFUNC_PatBlt,
643 DCFUNC_Pie,
644 DCFUNC_PlgBlt, // UNIMPLEMENTED
645 DCFUNC_PolyBezier,
646 DCFUNC_PolyBezierTo,
647 DCFUNC_PolyDraw,
648 DCFUNC_Polygon,
649 DCFUNC_Polyline,
650 DCFUNC_PolylineTo,
651 DCFUNC_PolyPolygon,
652 DCFUNC_PolyPolyline,
653 DCFUNC_RealizePalette,
654 DCFUNC_Rectangle,
655 DCFUNC_RestoreDC,
656 DCFUNC_RoundRect,
657 DCFUNC_SaveDC,
658 DCFUNC_ScaleViewportExtEx,
659 DCFUNC_ScaleWindowExtEx,
660 DCFUNC_SelectBrush,
661 DCFUNC_SelectClipPath,
662 DCFUNC_SelectFont,
663 DCFUNC_SelectPalette,
664 DCFUNC_SelectPen,
665 DCFUNC_SetDCBrushColor,
666 DCFUNC_SetDCPenColor,
667 DCFUNC_SetDIBitsToDevice,
668 DCFUNC_SetBkColor,
669 DCFUNC_SetBkMode,
670 DCFUNC_SetLayout,
671 //DCFUNC_SetMapMode,
672 DCFUNC_SetPixel,
673 DCFUNC_SetPolyFillMode,
674 DCFUNC_SetROP2,
675 DCFUNC_SetStretchBltMode,
676 DCFUNC_SetTextAlign,
677 DCFUNC_SetTextCharacterExtra,
678 DCFUNC_SetTextColor,
679 DCFUNC_SetTextJustification,
680 DCFUNC_SetViewportExtEx,
681 DCFUNC_SetViewportOrgEx,
682 DCFUNC_SetWindowExtEx,
683 DCFUNC_SetWindowOrgEx,
684 DCFUNC_SetWorldTransform,
685 DCFUNC_StretchBlt,
686 DCFUNC_StrokeAndFillPath,
687 DCFUNC_StrokePath,
688 DCFUNC_TransparentBlt, // UNIMPLEMENTED
689 DCFUNC_WidenPath,
690
691 } DCFUNC;
692
693 BOOL
694 METADC_Dispatch(
695 _In_ DCFUNC eFunction,
696 _Out_ PDWORD_PTR pdwResult,
697 _In_ DWORD_PTR dwError,
698 _In_ HDC hdc,
699 ...);
700
701 #define HANDLE_METADC2(_RetType, _Func, hdc, ...) \
702 if (GDI_HANDLE_GET_TYPE(hdc) != GDILoObjType_LO_DC_TYPE) \
703 { \
704 _RetType result; \
705 if (METADC_##_Func(&result, hdc, __VA_ARGS__)) \
706 { \
707 return result; \
708 } \
709 }
710
711 BOOL
712 WINAPI
713 METADC_GetAndSetDCDWord(
714 _Out_ PDWORD pdwResult,
715 _In_ HDC hdc,
716 _In_ UINT u,
717 _In_ DWORD dwIn,
718 _In_ ULONG ulMFId,
719 _In_ USHORT usMF16Id,
720 _In_ DWORD dwError);
721
722 /* EOF */