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,LPINT32,NULL) */
38 case QUERYESCSUPPORT
: {
39 LPINT16 x
= (LPINT16
)SEGPTR_NEW(INT16
);
40 *x
= *(INT
*)lpszInData
;
41 segin
= SEGPTR_GET(x
);
45 /* Escape(hdc,GETSCALINGFACTOR,NULL,LPPOINT32) */
46 /* Escape(hdc,GETPHYSPAGESIZE,NULL,LPPOINT32) */
47 /* Escape(hdc,GETPRINTINGOFFSET,NULL,LPPOINT32) */
49 case GETSCALINGFACTOR
:
51 case GETPRINTINGOFFSET
:
52 segout
= SEGPTR_GET(SEGPTR_NEW(POINT16
));
55 /* Escape(hdc,GETTECHNOLOGY,NULL,LPSTR); */
58 segout
= SEGPTR_GET(SEGPTR_ALLOC(200)); /* enough I hope */
63 /* Escape(hdc,ENABLEPAIRKERNING,LPINT16,LPINT16); */
65 case ENABLEPAIRKERNING
: {
66 LPINT16 enab
= SEGPTR_NEW(INT16
);
67 segout
= SEGPTR_GET(SEGPTR_NEW(INT16
));
68 segin
= SEGPTR_GET(enab
);
69 *enab
= *(INT
*)lpszInData
;
73 /* Escape(hdc,GETFACENAME,NULL,LPSTR); */
76 segout
= SEGPTR_GET(SEGPTR_ALLOC(200));
80 /* Escape(hdc,STARTDOC,LPSTR,NULL); */
82 case STARTDOC
: /* string may not be \0 terminated */
84 char *cp
= SEGPTR_ALLOC(cbInput
);
85 memcpy(cp
, lpszInData
, cbInput
);
86 segin
= SEGPTR_GET(cp
);
96 ret
= dc
->funcs
->pEscape( dc
, nEscape
, cbInput
, segin
, segout
);
101 TRACE("target DC implements Escape %d\n",nEscape
);
102 SEGPTR_FREE(PTR_SEG_TO_LIN(segin
));
104 case GETSCALINGFACTOR
:
105 case GETPRINTINGOFFSET
:
106 case GETPHYSPAGESIZE
: {
107 LPPOINT16 x
= (LPPOINT16
)PTR_SEG_TO_LIN(segout
);
108 CONV_POINT16TO32(x
,(LPPOINT
)lpvOutData
);
112 case GETTECHNOLOGY
: {
113 LPSTR x
=PTR_SEG_TO_LIN(segout
);
114 lstrcpyA(lpvOutData
,x
);
118 case ENABLEPAIRKERNING
: {
119 LPINT16 enab
= (LPINT16
)PTR_SEG_TO_LIN(segout
);
121 *(LPINT
)lpvOutData
= *enab
;
123 SEGPTR_FREE(PTR_SEG_TO_LIN(segin
));
127 LPSTR x
= (LPSTR
)PTR_SEG_TO_LIN(segout
);
128 lstrcpyA(lpvOutData
,x
);
133 SEGPTR_FREE(PTR_SEG_TO_LIN(segin
));
142 /******************************************************************************
143 * ExtEscape [GDI32.95]
146 * hdc [I] Handle to device context
147 * nEscape [I] Escape function
148 * cbInput [I] Number of bytes in input structure
149 * lpszInData [I] Pointer to input structure
150 * cbOutput [I] Number of bytes in output structure
151 * lpszOutData [O] Pointer to output structure
158 INT WINAPI
ExtEscape( HDC hdc
, INT nEscape
, INT cbInput
,
159 LPCSTR lpszInData
, INT cbOutput
, LPSTR lpszOutData
)
161 FIXME("(0x%04x,0x%x,%d,%s,%d,%p):stub\n",
162 hdc
,nEscape
,cbInput
,debugstr_a(lpszInData
),cbOutput
,lpszOutData
);
166 /*******************************************************************
167 * DrawEscape [GDI32.74]
171 INT WINAPI
DrawEscape(HDC hdc
, INT nEscape
, INT cbInput
, LPCSTR lpszInData
)
173 FIXME("DrawEscape, stub\n");