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) */
39 /* Escape(hdc,SETLINECAP,LPINT,NULL) */
45 LPINT16 x = (LPINT16)SEGPTR_NEW(INT16);
46 *x = *(INT*)lpszInData;
47 segin = SEGPTR_GET(x);
48 cbInput = sizeof(INT16);
52 /* Escape(hdc,GETSCALINGFACTOR,NULL,LPPOINT32) */
53 /* Escape(hdc,GETPHYSPAGESIZE,NULL,LPPOINT32) */
54 /* Escape(hdc,GETPRINTINGOFFSET,NULL,LPPOINT32) */
56 case GETSCALINGFACTOR:
58 case GETPRINTINGOFFSET:
59 segout = SEGPTR_GET(SEGPTR_NEW(POINT16));
60 cbInput = sizeof(POINT16);
63 /* Escape(hdc,GETTECHNOLOGY,NULL,LPSTR); */
66 segout = SEGPTR_GET(SEGPTR_ALLOC(200)); /* enough I hope */
71 /* Escape(hdc,ENABLEPAIRKERNING,LPINT16,LPINT16); */
73 case ENABLEPAIRKERNING: {
74 LPINT16 enab = SEGPTR_NEW(INT16);
75 segout = SEGPTR_GET(SEGPTR_NEW(INT16));
76 segin = SEGPTR_GET(enab);
77 *enab = *(INT*)lpszInData;
78 cbInput = sizeof(INT16);
82 /* Escape(hdc,GETFACENAME,NULL,LPSTR); */
85 segout = SEGPTR_GET(SEGPTR_ALLOC(200));
89 /* Escape(hdc,STARTDOC,LPSTR,NULL); */
91 case STARTDOC: /* string may not be \0 terminated */
93 char *cp = SEGPTR_ALLOC(cbInput);
94 memcpy(cp, lpszInData, cbInput);
95 segin = SEGPTR_GET(cp);
105 ret = dc->funcs->pEscape( dc, nEscape, cbInput, segin, segout );
108 case QUERYESCSUPPORT:
110 TRACE("target DC implements Escape %d\n",nEscape);
111 SEGPTR_FREE(PTR_SEG_TO_LIN(segin));
113 case EXT_DEVICE_CAPS:
116 SEGPTR_FREE(PTR_SEG_TO_LIN(segin));
118 case GETSCALINGFACTOR:
119 case GETPRINTINGOFFSET:
120 case GETPHYSPAGESIZE: {
121 LPPOINT16 x = (LPPOINT16)PTR_SEG_TO_LIN(segout);
122 CONV_POINT16TO32(x,(LPPOINT)lpvOutData);
126 case GETTECHNOLOGY: {
127 LPSTR x=PTR_SEG_TO_LIN(segout);
128 lstrcpyA(lpvOutData,x);
132 case ENABLEPAIRKERNING: {
133 LPINT16 enab = (LPINT16)PTR_SEG_TO_LIN(segout);
135 *(LPINT)lpvOutData = *enab;
137 SEGPTR_FREE(PTR_SEG_TO_LIN(segin));
141 LPSTR x = (LPSTR)PTR_SEG_TO_LIN(segout);
142 lstrcpyA(lpvOutData,x);
147 SEGPTR_FREE(PTR_SEG_TO_LIN(segin));
156 /******************************************************************************
157 * ExtEscape [GDI32.95]
160 * hdc [I] Handle to device context
161 * nEscape [I] Escape function
162 * cbInput [I] Number of bytes in input structure
163 * lpszInData [I] Pointer to input structure
164 * cbOutput [I] Number of bytes in output structure
165 * lpszOutData [O] Pointer to output structure
172 INT WINAPI ExtEscape( HDC hdc, INT nEscape, INT cbInput,
173 LPCSTR lpszInData, INT cbOutput, LPSTR lpszOutData )
175 FIXME("(0x%04x,0x%x,%d,%s,%d,%p):stub\n",
176 hdc,nEscape,cbInput,debugstr_a(lpszInData),cbOutput,lpszOutData);
180 /*******************************************************************
181 * DrawEscape [GDI32.74]
185 INT WINAPI DrawEscape(HDC hdc, INT nEscape, INT cbInput, LPCSTR lpszInData)
187 FIXME("DrawEscape, stub\n");