4 * Copyright 1994 Bob Amstadt
13 #include "debugtools.h"
15 DEFAULT_DEBUG_CHANNEL(driver)
18 INT16 WINAPI Escape16( HDC16 hdc, INT16 nEscape, INT16 cbInput,
19 SEGPTR lpszInData, SEGPTR lpvOutData )
21 DC * dc = DC_GetDCPtr( hdc );
22 if (!dc || !dc->funcs->pEscape) return 0;
23 return dc->funcs->pEscape( dc, nEscape, cbInput, lpszInData, lpvOutData );
26 INT WINAPI Escape( HDC hdc, INT nEscape, INT cbInput,
27 LPCSTR lpszInData, LPVOID lpvOutData )
29 DC *dc = DC_GetDCPtr( hdc );
33 if (!dc || !dc->funcs->pEscape) return 0;
34 segin = (SEGPTR)lpszInData;
35 segout = (SEGPTR)lpvOutData;
37 /* Escape(hdc,QUERYESCSUPPORT,LPINT,NULL) */
38 /* Escape(hdc,EXT_DEVICE_CAPS,LPINT,NULL) */
42 LPINT16 x = (LPINT16)SEGPTR_NEW(INT16);
43 *x = *(INT*)lpszInData;
44 segin = SEGPTR_GET(x);
48 /* Escape(hdc,GETSCALINGFACTOR,NULL,LPPOINT32) */
49 /* Escape(hdc,GETPHYSPAGESIZE,NULL,LPPOINT32) */
50 /* Escape(hdc,GETPRINTINGOFFSET,NULL,LPPOINT32) */
52 case GETSCALINGFACTOR:
54 case GETPRINTINGOFFSET:
55 segout = SEGPTR_GET(SEGPTR_NEW(POINT16));
58 /* Escape(hdc,GETTECHNOLOGY,NULL,LPSTR); */
61 segout = SEGPTR_GET(SEGPTR_ALLOC(200)); /* enough I hope */
66 /* Escape(hdc,ENABLEPAIRKERNING,LPINT16,LPINT16); */
68 case ENABLEPAIRKERNING: {
69 LPINT16 enab = SEGPTR_NEW(INT16);
70 segout = SEGPTR_GET(SEGPTR_NEW(INT16));
71 segin = SEGPTR_GET(enab);
72 *enab = *(INT*)lpszInData;
76 /* Escape(hdc,GETFACENAME,NULL,LPSTR); */
79 segout = SEGPTR_GET(SEGPTR_ALLOC(200));
83 /* Escape(hdc,STARTDOC,LPSTR,NULL); */
85 case STARTDOC: /* string may not be \0 terminated */
87 char *cp = SEGPTR_ALLOC(cbInput);
88 memcpy(cp, lpszInData, cbInput);
89 segin = SEGPTR_GET(cp);
99 ret = dc->funcs->pEscape( dc, nEscape, cbInput, segin, segout );
102 case QUERYESCSUPPORT:
104 TRACE("target DC implements Escape %d\n",nEscape);
105 SEGPTR_FREE(PTR_SEG_TO_LIN(segin));
107 case EXT_DEVICE_CAPS:
108 SEGPTR_FREE(PTR_SEG_TO_LIN(segin));
110 case GETSCALINGFACTOR:
111 case GETPRINTINGOFFSET:
112 case GETPHYSPAGESIZE: {
113 LPPOINT16 x = (LPPOINT16)PTR_SEG_TO_LIN(segout);
114 CONV_POINT16TO32(x,(LPPOINT)lpvOutData);
118 case GETTECHNOLOGY: {
119 LPSTR x=PTR_SEG_TO_LIN(segout);
120 lstrcpyA(lpvOutData,x);
124 case ENABLEPAIRKERNING: {
125 LPINT16 enab = (LPINT16)PTR_SEG_TO_LIN(segout);
127 *(LPINT)lpvOutData = *enab;
129 SEGPTR_FREE(PTR_SEG_TO_LIN(segin));
133 LPSTR x = (LPSTR)PTR_SEG_TO_LIN(segout);
134 lstrcpyA(lpvOutData,x);
139 SEGPTR_FREE(PTR_SEG_TO_LIN(segin));
148 /******************************************************************************
149 * ExtEscape [GDI32.95]
152 * hdc [I] Handle to device context
153 * nEscape [I] Escape function
154 * cbInput [I] Number of bytes in input structure
155 * lpszInData [I] Pointer to input structure
156 * cbOutput [I] Number of bytes in output structure
157 * lpszOutData [O] Pointer to output structure
164 INT WINAPI ExtEscape( HDC hdc, INT nEscape, INT cbInput,
165 LPCSTR lpszInData, INT cbOutput, LPSTR lpszOutData )
167 FIXME("(0x%04x,0x%x,%d,%s,%d,%p):stub\n",
168 hdc,nEscape,cbInput,debugstr_a(lpszInData),cbOutput,lpszOutData);
172 /*******************************************************************
173 * DrawEscape [GDI32.74]
177 INT WINAPI DrawEscape(HDC hdc, INT nEscape, INT cbInput, LPCSTR lpszInData)
179 FIXME("DrawEscape, stub\n");