4 * Copyright 2002 Alexandre Julliard
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
27 #include "wine/wingdi16.h"
28 #include "gdi_private.h"
29 #include "wine/debug.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(gdi
);
33 #define HGDIOBJ_32(handle16) ((HGDIOBJ)(ULONG_PTR)(handle16))
34 #define HGDIOBJ_16(handle32) ((HGDIOBJ16)(ULONG_PTR)(handle32))
36 struct callback16_info
42 /* callback for LineDDA16 */
43 static void CALLBACK
linedda_callback( INT x
, INT y
, LPARAM param
)
45 const struct callback16_info
*info
= (struct callback16_info
*)param
;
50 args
[1] = HIWORD(info
->param
);
51 args
[0] = LOWORD(info
->param
);
52 WOWCallback16Ex( (DWORD
)info
->proc
, WCB16_PASCAL
, sizeof(args
), args
, NULL
);
55 /* callback for EnumObjects16 */
56 static INT CALLBACK
enum_pens_callback( void *ptr
, LPARAM param
)
58 const struct callback16_info
*info
= (struct callback16_info
*)param
;
65 pen16
.lopnStyle
= pen
->lopnStyle
;
66 pen16
.lopnWidth
.x
= pen
->lopnWidth
.x
;
67 pen16
.lopnWidth
.y
= pen
->lopnWidth
.y
;
68 pen16
.lopnColor
= pen
->lopnColor
;
69 segptr
= MapLS( &pen16
);
70 args
[3] = SELECTOROF(segptr
);
71 args
[2] = OFFSETOF(segptr
);
72 args
[1] = HIWORD(info
->param
);
73 args
[0] = LOWORD(info
->param
);
74 WOWCallback16Ex( (DWORD
)info
->proc
, WCB16_PASCAL
, sizeof(args
), args
, &ret
);
79 /* callback for EnumObjects16 */
80 static INT CALLBACK
enum_brushes_callback( void *ptr
, LPARAM param
)
82 const struct callback16_info
*info
= (struct callback16_info
*)param
;
83 LOGBRUSH
*brush
= ptr
;
89 brush16
.lbStyle
= brush
->lbStyle
;
90 brush16
.lbColor
= brush
->lbColor
;
91 brush16
.lbHatch
= brush
->lbHatch
;
92 segptr
= MapLS( &brush16
);
93 args
[3] = SELECTOROF(segptr
);
94 args
[2] = OFFSETOF(segptr
);
95 args
[1] = HIWORD(info
->param
);
96 args
[0] = LOWORD(info
->param
);
97 WOWCallback16Ex( (DWORD
)info
->proc
, WCB16_PASCAL
, sizeof(args
), args
, &ret
);
102 /* convert a LOGFONT16 to a LOGFONTW */
103 static void logfont_16_to_W( const LOGFONT16
*font16
, LPLOGFONTW font32
)
105 font32
->lfHeight
= font16
->lfHeight
;
106 font32
->lfWidth
= font16
->lfWidth
;
107 font32
->lfEscapement
= font16
->lfEscapement
;
108 font32
->lfOrientation
= font16
->lfOrientation
;
109 font32
->lfWeight
= font16
->lfWeight
;
110 font32
->lfItalic
= font16
->lfItalic
;
111 font32
->lfUnderline
= font16
->lfUnderline
;
112 font32
->lfStrikeOut
= font16
->lfStrikeOut
;
113 font32
->lfCharSet
= font16
->lfCharSet
;
114 font32
->lfOutPrecision
= font16
->lfOutPrecision
;
115 font32
->lfClipPrecision
= font16
->lfClipPrecision
;
116 font32
->lfQuality
= font16
->lfQuality
;
117 font32
->lfPitchAndFamily
= font16
->lfPitchAndFamily
;
118 MultiByteToWideChar( CP_ACP
, 0, font16
->lfFaceName
, -1, font32
->lfFaceName
, LF_FACESIZE
);
119 font32
->lfFaceName
[LF_FACESIZE
-1] = 0;
122 /* convert a LOGFONTW to a LOGFONT16 */
123 static void logfont_W_to_16( const LOGFONTW
* font32
, LPLOGFONT16 font16
)
125 font16
->lfHeight
= font32
->lfHeight
;
126 font16
->lfWidth
= font32
->lfWidth
;
127 font16
->lfEscapement
= font32
->lfEscapement
;
128 font16
->lfOrientation
= font32
->lfOrientation
;
129 font16
->lfWeight
= font32
->lfWeight
;
130 font16
->lfItalic
= font32
->lfItalic
;
131 font16
->lfUnderline
= font32
->lfUnderline
;
132 font16
->lfStrikeOut
= font32
->lfStrikeOut
;
133 font16
->lfCharSet
= font32
->lfCharSet
;
134 font16
->lfOutPrecision
= font32
->lfOutPrecision
;
135 font16
->lfClipPrecision
= font32
->lfClipPrecision
;
136 font16
->lfQuality
= font32
->lfQuality
;
137 font16
->lfPitchAndFamily
= font32
->lfPitchAndFamily
;
138 WideCharToMultiByte( CP_ACP
, 0, font32
->lfFaceName
, -1, font16
->lfFaceName
, LF_FACESIZE
, NULL
, NULL
);
139 font16
->lfFaceName
[LF_FACESIZE
-1] = 0;
142 /***********************************************************************
145 COLORREF WINAPI
SetBkColor16( HDC16 hdc
, COLORREF color
)
147 return SetBkColor( HDC_32(hdc
), color
);
151 /***********************************************************************
154 INT16 WINAPI
SetBkMode16( HDC16 hdc
, INT16 mode
)
156 return SetBkMode( HDC_32(hdc
), mode
);
160 /***********************************************************************
163 INT16 WINAPI
SetMapMode16( HDC16 hdc
, INT16 mode
)
165 return SetMapMode( HDC_32(hdc
), mode
);
169 /***********************************************************************
172 INT16 WINAPI
SetROP216( HDC16 hdc
, INT16 mode
)
174 return SetROP2( HDC_32(hdc
), mode
);
178 /***********************************************************************
181 INT16 WINAPI
SetRelAbs16( HDC16 hdc
, INT16 mode
)
183 return SetRelAbs( HDC_32(hdc
), mode
);
187 /***********************************************************************
188 * SetPolyFillMode (GDI.6)
190 INT16 WINAPI
SetPolyFillMode16( HDC16 hdc
, INT16 mode
)
192 return SetPolyFillMode( HDC_32(hdc
), mode
);
196 /***********************************************************************
197 * SetStretchBltMode (GDI.7)
199 INT16 WINAPI
SetStretchBltMode16( HDC16 hdc
, INT16 mode
)
201 return SetStretchBltMode( HDC_32(hdc
), mode
);
205 /***********************************************************************
206 * SetTextCharacterExtra (GDI.8)
208 INT16 WINAPI
SetTextCharacterExtra16( HDC16 hdc
, INT16 extra
)
210 return SetTextCharacterExtra( HDC_32(hdc
), extra
);
214 /***********************************************************************
215 * SetTextColor (GDI.9)
217 COLORREF WINAPI
SetTextColor16( HDC16 hdc
, COLORREF color
)
219 return SetTextColor( HDC_32(hdc
), color
);
223 /***********************************************************************
224 * SetTextJustification (GDI.10)
226 INT16 WINAPI
SetTextJustification16( HDC16 hdc
, INT16 extra
, INT16 breaks
)
228 return SetTextJustification( HDC_32(hdc
), extra
, breaks
);
232 /***********************************************************************
233 * SetWindowOrg (GDI.11)
235 DWORD WINAPI
SetWindowOrg16( HDC16 hdc
, INT16 x
, INT16 y
)
238 if (!SetWindowOrgEx( HDC_32(hdc
), x
, y
, &pt
)) return 0;
239 return MAKELONG( pt
.x
, pt
.y
);
243 /***********************************************************************
244 * SetWindowExt (GDI.12)
246 DWORD WINAPI
SetWindowExt16( HDC16 hdc
, INT16 x
, INT16 y
)
249 if (!SetWindowExtEx( HDC_32(hdc
), x
, y
, &size
)) return 0;
250 return MAKELONG( size
.cx
, size
.cy
);
254 /***********************************************************************
255 * SetViewportOrg (GDI.13)
257 DWORD WINAPI
SetViewportOrg16( HDC16 hdc
, INT16 x
, INT16 y
)
260 if (!SetViewportOrgEx( HDC_32(hdc
), x
, y
, &pt
)) return 0;
261 return MAKELONG( pt
.x
, pt
.y
);
265 /***********************************************************************
266 * SetViewportExt (GDI.14)
268 DWORD WINAPI
SetViewportExt16( HDC16 hdc
, INT16 x
, INT16 y
)
271 if (!SetViewportExtEx( HDC_32(hdc
), x
, y
, &size
)) return 0;
272 return MAKELONG( size
.cx
, size
.cy
);
276 /***********************************************************************
277 * OffsetWindowOrg (GDI.15)
279 DWORD WINAPI
OffsetWindowOrg16( HDC16 hdc
, INT16 x
, INT16 y
)
282 if (!OffsetWindowOrgEx( HDC_32(hdc
), x
, y
, &pt
)) return 0;
283 return MAKELONG( pt
.x
, pt
.y
);
287 /***********************************************************************
288 * ScaleWindowExt (GDI.16)
290 DWORD WINAPI
ScaleWindowExt16( HDC16 hdc
, INT16 xNum
, INT16 xDenom
,
291 INT16 yNum
, INT16 yDenom
)
294 if (!ScaleWindowExtEx( HDC_32(hdc
), xNum
, xDenom
, yNum
, yDenom
, &size
))
296 return MAKELONG( size
.cx
, size
.cy
);
300 /***********************************************************************
301 * OffsetViewportOrg (GDI.17)
303 DWORD WINAPI
OffsetViewportOrg16( HDC16 hdc
, INT16 x
, INT16 y
)
306 if (!OffsetViewportOrgEx( HDC_32(hdc
), x
, y
, &pt
)) return 0;
307 return MAKELONG( pt
.x
, pt
.y
);
311 /***********************************************************************
312 * ScaleViewportExt (GDI.18)
314 DWORD WINAPI
ScaleViewportExt16( HDC16 hdc
, INT16 xNum
, INT16 xDenom
,
315 INT16 yNum
, INT16 yDenom
)
318 if (!ScaleViewportExtEx( HDC_32(hdc
), xNum
, xDenom
, yNum
, yDenom
, &size
))
320 return MAKELONG( size
.cx
, size
.cy
);
324 /***********************************************************************
327 BOOL16 WINAPI
LineTo16( HDC16 hdc
, INT16 x
, INT16 y
)
329 return LineTo( HDC_32(hdc
), x
, y
);
333 /***********************************************************************
336 DWORD WINAPI
MoveTo16( HDC16 hdc
, INT16 x
, INT16 y
)
340 if (!MoveToEx( HDC_32(hdc
), x
, y
, &pt
)) return 0;
341 return MAKELONG(pt
.x
,pt
.y
);
345 /***********************************************************************
346 * ExcludeClipRect (GDI.21)
348 INT16 WINAPI
ExcludeClipRect16( HDC16 hdc
, INT16 left
, INT16 top
,
349 INT16 right
, INT16 bottom
)
351 return ExcludeClipRect( HDC_32(hdc
), left
, top
, right
, bottom
);
355 /***********************************************************************
356 * IntersectClipRect (GDI.22)
358 INT16 WINAPI
IntersectClipRect16( HDC16 hdc
, INT16 left
, INT16 top
,
359 INT16 right
, INT16 bottom
)
361 return IntersectClipRect( HDC_32(hdc
), left
, top
, right
, bottom
);
365 /***********************************************************************
368 BOOL16 WINAPI
Arc16( HDC16 hdc
, INT16 left
, INT16 top
, INT16 right
,
369 INT16 bottom
, INT16 xstart
, INT16 ystart
,
370 INT16 xend
, INT16 yend
)
372 return Arc( HDC_32(hdc
), left
, top
, right
, bottom
, xstart
, ystart
, xend
, yend
);
376 /***********************************************************************
379 BOOL16 WINAPI
Ellipse16( HDC16 hdc
, INT16 left
, INT16 top
,
380 INT16 right
, INT16 bottom
)
382 return Ellipse( HDC_32(hdc
), left
, top
, right
, bottom
);
386 /**********************************************************************
389 BOOL16 WINAPI
FloodFill16( HDC16 hdc
, INT16 x
, INT16 y
, COLORREF color
)
391 return ExtFloodFill( HDC_32(hdc
), x
, y
, color
, FLOODFILLBORDER
);
395 /***********************************************************************
398 BOOL16 WINAPI
Pie16( HDC16 hdc
, INT16 left
, INT16 top
,
399 INT16 right
, INT16 bottom
, INT16 xstart
, INT16 ystart
,
400 INT16 xend
, INT16 yend
)
402 return Pie( HDC_32(hdc
), left
, top
, right
, bottom
, xstart
, ystart
, xend
, yend
);
406 /***********************************************************************
409 BOOL16 WINAPI
Rectangle16( HDC16 hdc
, INT16 left
, INT16 top
,
410 INT16 right
, INT16 bottom
)
412 return Rectangle( HDC_32(hdc
), left
, top
, right
, bottom
);
416 /***********************************************************************
419 BOOL16 WINAPI
RoundRect16( HDC16 hdc
, INT16 left
, INT16 top
, INT16 right
,
420 INT16 bottom
, INT16 ell_width
, INT16 ell_height
)
422 return RoundRect( HDC_32(hdc
), left
, top
, right
, bottom
, ell_width
, ell_height
);
426 /***********************************************************************
429 BOOL16 WINAPI
PatBlt16( HDC16 hdc
, INT16 left
, INT16 top
,
430 INT16 width
, INT16 height
, DWORD rop
)
432 return PatBlt( HDC_32(hdc
), left
, top
, width
, height
, rop
);
436 /***********************************************************************
439 INT16 WINAPI
SaveDC16( HDC16 hdc
)
441 return SaveDC( HDC_32(hdc
) );
445 /***********************************************************************
448 COLORREF WINAPI
SetPixel16( HDC16 hdc
, INT16 x
, INT16 y
, COLORREF color
)
450 return SetPixel( HDC_32(hdc
), x
, y
, color
);
454 /***********************************************************************
455 * OffsetClipRgn (GDI.32)
457 INT16 WINAPI
OffsetClipRgn16( HDC16 hdc
, INT16 x
, INT16 y
)
459 return OffsetClipRgn( HDC_32(hdc
), x
, y
);
463 /***********************************************************************
466 BOOL16 WINAPI
TextOut16( HDC16 hdc
, INT16 x
, INT16 y
, LPCSTR str
, INT16 count
)
468 return TextOutA( HDC_32(hdc
), x
, y
, str
, count
);
472 /***********************************************************************
475 BOOL16 WINAPI
BitBlt16( HDC16 hdcDst
, INT16 xDst
, INT16 yDst
, INT16 width
,
476 INT16 height
, HDC16 hdcSrc
, INT16 xSrc
, INT16 ySrc
,
479 return BitBlt( HDC_32(hdcDst
), xDst
, yDst
, width
, height
, HDC_32(hdcSrc
), xSrc
, ySrc
, rop
);
483 /***********************************************************************
484 * StretchBlt (GDI.35)
486 BOOL16 WINAPI
StretchBlt16( HDC16 hdcDst
, INT16 xDst
, INT16 yDst
,
487 INT16 widthDst
, INT16 heightDst
,
488 HDC16 hdcSrc
, INT16 xSrc
, INT16 ySrc
,
489 INT16 widthSrc
, INT16 heightSrc
, DWORD rop
)
491 return StretchBlt( HDC_32(hdcDst
), xDst
, yDst
, widthDst
, heightDst
,
492 HDC_32(hdcSrc
), xSrc
, ySrc
, widthSrc
, heightSrc
, rop
);
496 /**********************************************************************
499 BOOL16 WINAPI
Polygon16( HDC16 hdc
, const POINT16
* pt
, INT16 count
)
503 LPPOINT pt32
= HeapAlloc( GetProcessHeap(), 0, count
*sizeof(POINT
) );
505 if (!pt32
) return FALSE
;
511 ret
= Polygon(HDC_32(hdc
),pt32
,count
);
512 HeapFree( GetProcessHeap(), 0, pt32
);
517 /**********************************************************************
520 BOOL16 WINAPI
Polyline16( HDC16 hdc
, const POINT16
* pt
, INT16 count
)
524 LPPOINT pt32
= HeapAlloc( GetProcessHeap(), 0, count
*sizeof(POINT
) );
526 if (!pt32
) return FALSE
;
532 ret
= Polyline(HDC_32(hdc
),pt32
,count
);
533 HeapFree( GetProcessHeap(), 0, pt32
);
538 /***********************************************************************
541 INT16 WINAPI
Escape16( HDC16 hdc
, INT16 escape
, INT16 in_count
, SEGPTR in_data
, LPVOID out_data
)
547 /* Escape(hdc,CLIP_TO_PATH,LPINT16,NULL) */
548 /* Escape(hdc,DRAFTMODE,LPINT16,NULL) */
549 /* Escape(hdc,ENUMPAPERBINS,LPINT16,LPSTR); */
550 /* Escape(hdc,EPSPRINTING,LPINT16,NULL) */
551 /* Escape(hdc,EXT_DEVICE_CAPS,LPINT16,LPDWORD) */
552 /* Escape(hdc,GETCOLORTABLE,LPINT16,LPDWORD) */
553 /* Escape(hdc,MOUSETRAILS,LPINT16,NULL) */
554 /* Escape(hdc,POSTSCRIPT_IGNORE,LPINT16,NULL) */
555 /* Escape(hdc,QUERYESCSUPPORT,LPINT16,NULL) */
556 /* Escape(hdc,SET_ARC_DIRECTION,LPINT16,NULL) */
557 /* Escape(hdc,SET_POLY_MODE,LPINT16,NULL) */
558 /* Escape(hdc,SET_SCREEN_ANGLE,LPINT16,NULL) */
559 /* Escape(hdc,SET_SPREAD,LPINT16,NULL) */
564 case EXT_DEVICE_CAPS
:
567 case POSTSCRIPT_IGNORE
:
568 case QUERYESCSUPPORT
:
569 case SET_ARC_DIRECTION
:
571 case SET_SCREEN_ANGLE
:
574 INT16
*ptr
= MapSL(in_data
);
576 return Escape( HDC_32(hdc
), escape
, sizeof(data
), (LPCSTR
)&data
, out_data
);
579 /* Escape(hdc,ENABLEDUPLEX,LPUINT16,NULL) */
582 UINT16
*ptr
= MapSL(in_data
);
584 return Escape( HDC_32(hdc
), escape
, sizeof(data
), (LPCSTR
)&data
, NULL
);
587 /* Escape(hdc,GETPHYSPAGESIZE,NULL,LPPOINT16) */
588 /* Escape(hdc,GETPRINTINGOFFSET,NULL,LPPOINT16) */
589 /* Escape(hdc,GETSCALINGFACTOR,NULL,LPPOINT16) */
590 case GETPHYSPAGESIZE
:
591 case GETPRINTINGOFFSET
:
592 case GETSCALINGFACTOR
:
594 POINT16
*ptr
= out_data
;
596 ret
= Escape( HDC_32(hdc
), escape
, 0, NULL
, &pt32
);
602 /* Escape(hdc,ENABLEPAIRKERNING,LPINT16,LPINT16); */
603 /* Escape(hdc,ENABLERELATIVEWIDTHS,LPINT16,LPINT16); */
604 /* Escape(hdc,SETCOPYCOUNT,LPINT16,LPINT16) */
605 /* Escape(hdc,SETKERNTRACK,LPINT16,LPINT16) */
606 /* Escape(hdc,SETLINECAP,LPINT16,LPINT16) */
607 /* Escape(hdc,SETLINEJOIN,LPINT16,LPINT16) */
608 /* Escape(hdc,SETMITERLIMIT,LPINT16,LPINT16) */
609 case ENABLEPAIRKERNING
:
610 case ENABLERELATIVEWIDTHS
:
617 INT16
*new = MapSL(in_data
);
618 INT16
*old
= out_data
;
620 ret
= Escape( HDC_32(hdc
), escape
, sizeof(in
), (LPCSTR
)&in
, &out
);
625 /* Escape(hdc,SETABORTPROC,ABORTPROC,NULL); */
627 return SetAbortProc16( hdc
, (ABORTPROC16
)in_data
);
629 /* Escape(hdc,STARTDOC,LPSTR,LPDOCINFO16);
630 * lpvOutData is actually a pointer to the DocInfo structure and used as
631 * a second input parameter */
635 ret
= StartDoc16( hdc
, out_data
);
636 if (ret
> 0) ret
= StartPage( HDC_32(hdc
) );
639 return Escape( HDC_32(hdc
), escape
, in_count
, MapSL(in_data
), NULL
);
641 /* Escape(hdc,SET_BOUNDS,LPRECT16,NULL); */
642 /* Escape(hdc,SET_CLIP_BOX,LPRECT16,NULL); */
646 RECT16
*rc16
= MapSL(in_data
);
648 rc
.left
= rc16
->left
;
650 rc
.right
= rc16
->right
;
651 rc
.bottom
= rc16
->bottom
;
652 return Escape( HDC_32(hdc
), escape
, sizeof(rc
), (LPCSTR
)&rc
, NULL
);
655 /* Escape(hdc,NEXTBAND,NULL,LPRECT16); */
659 RECT16
*rc16
= out_data
;
660 ret
= Escape( HDC_32(hdc
), escape
, 0, NULL
, &rc
);
661 rc16
->left
= rc
.left
;
663 rc16
->right
= rc
.right
;
664 rc16
->bottom
= rc
.bottom
;
667 /* Escape(hdc,DRAWPATTERNRECT,PRECT_STRUCT*,NULL); */
668 case DRAWPATTERNRECT
:
671 DRAWPATRECT16
*pr16
= (DRAWPATRECT16
*)MapSL(in_data
);
673 pr
.ptPosition
.x
= pr16
->ptPosition
.x
;
674 pr
.ptPosition
.y
= pr16
->ptPosition
.y
;
675 pr
.ptSize
.x
= pr16
->ptSize
.x
;
676 pr
.ptSize
.y
= pr16
->ptSize
.y
;
677 pr
.wStyle
= pr16
->wStyle
;
678 pr
.wPattern
= pr16
->wPattern
;
679 return Escape( HDC_32(hdc
), escape
, sizeof(pr
), (LPCSTR
)&pr
, NULL
);
682 /* Escape(hdc,ABORTDOC,NULL,NULL); */
683 /* Escape(hdc,BANDINFO,BANDINFOSTRUCT*,BANDINFOSTRUCT*); */
684 /* Escape(hdc,BEGIN_PATH,NULL,NULL); */
685 /* Escape(hdc,ENDDOC,NULL,NULL); */
686 /* Escape(hdc,END_PATH,PATHINFO,NULL); */
687 /* Escape(hdc,EXTTEXTOUT,EXTTEXT_STRUCT*,NULL); */
688 /* Escape(hdc,FLUSHOUTPUT,NULL,NULL); */
689 /* Escape(hdc,GETFACENAME,NULL,LPSTR); */
690 /* Escape(hdc,GETPAIRKERNTABLE,NULL,KERNPAIR*); */
691 /* Escape(hdc,GETSETPAPERBINS,BinInfo*,BinInfo*); */
692 /* Escape(hdc,GETSETPRINTORIENT,ORIENT*,NULL); */
693 /* Escape(hdc,GETSETSCREENPARAMS,SCREENPARAMS*,SCREENPARAMS*); */
694 /* Escape(hdc,GETTECHNOLOGY,NULL,LPSTR); */
695 /* Escape(hdc,GETTRACKKERNTABLE,NULL,KERNTRACK*); */
696 /* Escape(hdc,MFCOMMENT,LPSTR,NULL); */
697 /* Escape(hdc,NEWFRAME,NULL,NULL); */
698 /* Escape(hdc,PASSTHROUGH,LPSTR,NULL); */
699 /* Escape(hdc,RESTORE_CTM,NULL,NULL); */
700 /* Escape(hdc,SAVE_CTM,NULL,NULL); */
701 /* Escape(hdc,SETALLJUSTVALUES,EXTTEXTDATA*,NULL); */
702 /* Escape(hdc,SETCOLORTABLE,COLORTABLE_STRUCT*,LPDWORD); */
703 /* Escape(hdc,SET_BACKGROUND_COLOR,LPDWORD,LPDWORD); */
704 /* Escape(hdc,TRANSFORM_CTM,LPSTR,NULL); */
713 case GETPAIRKERNTABLE
:
714 case GETSETPAPERBINS
:
715 case GETSETPRINTORIENT
:
716 case GETSETSCREENPARAMS
:
718 case GETTRACKKERNTABLE
:
724 case SETALLJUSTVALUES
:
726 case SET_BACKGROUND_COLOR
:
728 /* pass it unmodified to the 32-bit function */
729 return Escape( HDC_32(hdc
), escape
, in_count
, MapSL(in_data
), out_data
);
731 /* Escape(hdc,ENUMPAPERMETRICS,LPINT16,LPRECT16); */
732 /* Escape(hdc,GETEXTENDEDTEXTMETRICS,LPUINT16,EXTTEXTMETRIC*); */
733 /* Escape(hdc,GETEXTENTTABLE,LPSTR,LPINT16); */
734 /* Escape(hdc,GETSETPAPERMETRICS,LPRECT16,LPRECT16); */
735 /* Escape(hdc,GETVECTORBRUSHSIZE,LPLOGBRUSH16,LPPOINT16); */
736 /* Escape(hdc,GETVECTORPENSIZE,LPLOGPEN16,LPPOINT16); */
737 case ENUMPAPERMETRICS
:
738 case GETEXTENDEDTEXTMETRICS
:
740 case GETSETPAPERMETRICS
:
741 case GETVECTORBRUSHSIZE
:
742 case GETVECTORPENSIZE
:
744 FIXME("unknown/unsupported 16-bit escape %x (%d,%p,%p\n",
745 escape
, in_count
, MapSL(in_data
), out_data
);
746 return Escape( HDC_32(hdc
), escape
, in_count
, MapSL(in_data
), out_data
);
751 /***********************************************************************
754 BOOL16 WINAPI
RestoreDC16( HDC16 hdc
, INT16 level
)
756 return RestoreDC( HDC_32(hdc
), level
);
760 /***********************************************************************
763 BOOL16 WINAPI
FillRgn16( HDC16 hdc
, HRGN16 hrgn
, HBRUSH16 hbrush
)
765 return FillRgn( HDC_32(hdc
), HRGN_32(hrgn
), HBRUSH_32(hbrush
) );
769 /***********************************************************************
772 BOOL16 WINAPI
FrameRgn16( HDC16 hdc
, HRGN16 hrgn
, HBRUSH16 hbrush
,
773 INT16 nWidth
, INT16 nHeight
)
775 return FrameRgn( HDC_32(hdc
), HRGN_32(hrgn
), HBRUSH_32(hbrush
), nWidth
, nHeight
);
779 /***********************************************************************
782 BOOL16 WINAPI
InvertRgn16( HDC16 hdc
, HRGN16 hrgn
)
784 return InvertRgn( HDC_32(hdc
), HRGN_32(hrgn
) );
788 /***********************************************************************
791 BOOL16 WINAPI
PaintRgn16( HDC16 hdc
, HRGN16 hrgn
)
793 return PaintRgn( HDC_32(hdc
), HRGN_32(hrgn
) );
797 /***********************************************************************
798 * SelectClipRgn (GDI.44)
800 INT16 WINAPI
SelectClipRgn16( HDC16 hdc
, HRGN16 hrgn
)
802 return SelectClipRgn( HDC_32(hdc
), HRGN_32(hrgn
) );
806 /***********************************************************************
807 * SelectObject (GDI.45)
809 HGDIOBJ16 WINAPI
SelectObject16( HDC16 hdc
, HGDIOBJ16 handle
)
811 return HGDIOBJ_16( SelectObject( HDC_32(hdc
), HGDIOBJ_32(handle
) ) );
815 /***********************************************************************
816 * CombineRgn (GDI.47)
818 INT16 WINAPI
CombineRgn16(HRGN16 hDest
, HRGN16 hSrc1
, HRGN16 hSrc2
, INT16 mode
)
820 return CombineRgn( HRGN_32(hDest
), HRGN_32(hSrc1
), HRGN_32(hSrc2
), mode
);
824 /***********************************************************************
825 * CreateBitmap (GDI.48)
827 HBITMAP16 WINAPI
CreateBitmap16( INT16 width
, INT16 height
, UINT16 planes
,
828 UINT16 bpp
, LPCVOID bits
)
830 return HBITMAP_16( CreateBitmap( width
, height
, planes
& 0xff, bpp
& 0xff, bits
) );
834 /***********************************************************************
835 * CreateBitmapIndirect (GDI.49)
837 HBITMAP16 WINAPI
CreateBitmapIndirect16( const BITMAP16
* bmp
)
839 return CreateBitmap16( bmp
->bmWidth
, bmp
->bmHeight
, bmp
->bmPlanes
,
840 bmp
->bmBitsPixel
, MapSL( bmp
->bmBits
) );
844 /***********************************************************************
845 * CreateBrushIndirect (GDI.50)
847 HBRUSH16 WINAPI
CreateBrushIndirect16( const LOGBRUSH16
* brush
)
851 if (brush
->lbStyle
== BS_DIBPATTERN
|| brush
->lbStyle
== BS_DIBPATTERN8X8
)
852 return CreateDIBPatternBrush16( brush
->lbHatch
, brush
->lbColor
);
854 brush32
.lbStyle
= brush
->lbStyle
;
855 brush32
.lbColor
= brush
->lbColor
;
856 brush32
.lbHatch
= brush
->lbHatch
;
857 return HBRUSH_16( CreateBrushIndirect(&brush32
) );
861 /***********************************************************************
862 * CreateCompatibleBitmap (GDI.51)
864 HBITMAP16 WINAPI
CreateCompatibleBitmap16( HDC16 hdc
, INT16 width
, INT16 height
)
866 return HBITMAP_16( CreateCompatibleBitmap( HDC_32(hdc
), width
, height
) );
870 /***********************************************************************
871 * CreateCompatibleDC (GDI.52)
873 HDC16 WINAPI
CreateCompatibleDC16( HDC16 hdc
)
875 return HDC_16( CreateCompatibleDC( HDC_32(hdc
) ) );
879 /***********************************************************************
882 HDC16 WINAPI
CreateDC16( LPCSTR driver
, LPCSTR device
, LPCSTR output
,
883 const DEVMODEA
*initData
)
885 return HDC_16( CreateDCA( driver
, device
, output
, initData
) );
889 /***********************************************************************
890 * CreateEllipticRgn (GDI.54)
892 HRGN16 WINAPI
CreateEllipticRgn16( INT16 left
, INT16 top
, INT16 right
, INT16 bottom
)
894 return HRGN_16( CreateEllipticRgn( left
, top
, right
, bottom
) );
898 /***********************************************************************
899 * CreateEllipticRgnIndirect (GDI.55)
901 HRGN16 WINAPI
CreateEllipticRgnIndirect16( const RECT16
*rect
)
903 return HRGN_16( CreateEllipticRgn( rect
->left
, rect
->top
, rect
->right
, rect
->bottom
) );
907 /***********************************************************************
908 * CreateFont (GDI.56)
910 HFONT16 WINAPI
CreateFont16(INT16 height
, INT16 width
, INT16 esc
, INT16 orient
,
911 INT16 weight
, BYTE italic
, BYTE underline
,
912 BYTE strikeout
, BYTE charset
, BYTE outpres
,
913 BYTE clippres
, BYTE quality
, BYTE pitch
,
916 return HFONT_16( CreateFontA( height
, width
, esc
, orient
, weight
, italic
, underline
,
917 strikeout
, charset
, outpres
, clippres
, quality
, pitch
, name
));
920 /***********************************************************************
921 * CreateFontIndirect (GDI.57)
923 HFONT16 WINAPI
CreateFontIndirect16( const LOGFONT16
*plf16
)
930 logfont_16_to_W( plf16
, &lfW
);
931 ret
= CreateFontIndirectW( &lfW
);
933 else ret
= CreateFontIndirectW( NULL
);
934 return HFONT_16(ret
);
938 /***********************************************************************
939 * CreateHatchBrush (GDI.58)
941 HBRUSH16 WINAPI
CreateHatchBrush16( INT16 style
, COLORREF color
)
943 return HBRUSH_16( CreateHatchBrush( style
, color
) );
947 /***********************************************************************
948 * CreatePatternBrush (GDI.60)
950 HBRUSH16 WINAPI
CreatePatternBrush16( HBITMAP16 hbitmap
)
952 return HBRUSH_16( CreatePatternBrush( HBITMAP_32(hbitmap
) ));
956 /***********************************************************************
959 HPEN16 WINAPI
CreatePen16( INT16 style
, INT16 width
, COLORREF color
)
963 logpen
.lopnStyle
= style
;
964 logpen
.lopnWidth
.x
= width
;
965 logpen
.lopnWidth
.y
= 0;
966 logpen
.lopnColor
= color
;
967 return HPEN_16( CreatePenIndirect( &logpen
) );
971 /***********************************************************************
972 * CreatePenIndirect (GDI.62)
974 HPEN16 WINAPI
CreatePenIndirect16( const LOGPEN16
* pen
)
978 if (pen
->lopnStyle
> PS_INSIDEFRAME
) return 0;
979 logpen
.lopnStyle
= pen
->lopnStyle
;
980 logpen
.lopnWidth
.x
= pen
->lopnWidth
.x
;
981 logpen
.lopnWidth
.y
= pen
->lopnWidth
.y
;
982 logpen
.lopnColor
= pen
->lopnColor
;
983 return HPEN_16( CreatePenIndirect( &logpen
) );
987 /***********************************************************************
988 * CreatePolygonRgn (GDI.63)
990 HRGN16 WINAPI
CreatePolygonRgn16( const POINT16
* points
, INT16 count
, INT16 mode
)
992 return CreatePolyPolygonRgn16( points
, &count
, 1, mode
);
996 /***********************************************************************
997 * CreateRectRgn (GDI.64)
999 * NOTE: cf. SetRectRgn16
1001 HRGN16 WINAPI
CreateRectRgn16( INT16 left
, INT16 top
, INT16 right
, INT16 bottom
)
1005 if (left
< right
) hrgn
= CreateRectRgn( left
, top
, right
, bottom
);
1006 else hrgn
= CreateRectRgn( 0, 0, 0, 0 );
1007 return HRGN_16(hrgn
);
1011 /***********************************************************************
1012 * CreateRectRgnIndirect (GDI.65)
1014 HRGN16 WINAPI
CreateRectRgnIndirect16( const RECT16
* rect
)
1016 return CreateRectRgn16( rect
->left
, rect
->top
, rect
->right
, rect
->bottom
);
1020 /***********************************************************************
1021 * CreateSolidBrush (GDI.66)
1023 HBRUSH16 WINAPI
CreateSolidBrush16( COLORREF color
)
1025 return HBRUSH_16( CreateSolidBrush( color
) );
1029 /***********************************************************************
1032 BOOL16 WINAPI
DeleteDC16( HDC16 hdc
)
1034 return DeleteDC( HDC_32(hdc
) );
1038 /***********************************************************************
1039 * DeleteObject (GDI.69)
1040 * SysDeleteObject (GDI.605)
1042 BOOL16 WINAPI
DeleteObject16( HGDIOBJ16 obj
)
1044 return DeleteObject( HGDIOBJ_32(obj
) );
1048 /***********************************************************************
1049 * EnumObjects (GDI.71)
1051 INT16 WINAPI
EnumObjects16( HDC16 hdc
, INT16 obj
, GOBJENUMPROC16 proc
, LPARAM lParam
)
1053 struct callback16_info info
;
1055 info
.proc
= (FARPROC16
)proc
;
1056 info
.param
= lParam
;
1060 return EnumObjects( HDC_32(hdc
), OBJ_PEN
, enum_pens_callback
, (LPARAM
)&info
);
1062 return EnumObjects( HDC_32(hdc
), OBJ_BRUSH
, enum_brushes_callback
, (LPARAM
)&info
);
1068 /***********************************************************************
1071 BOOL16 WINAPI
EqualRgn16( HRGN16 rgn1
, HRGN16 rgn2
)
1073 return EqualRgn( HRGN_32(rgn1
), HRGN_32(rgn2
) );
1077 /***********************************************************************
1078 * GetBitmapBits (GDI.74)
1080 LONG WINAPI
GetBitmapBits16( HBITMAP16 hbitmap
, LONG count
, LPVOID buffer
)
1082 return GetBitmapBits( HBITMAP_32(hbitmap
), count
, buffer
);
1086 /***********************************************************************
1087 * GetBkColor (GDI.75)
1089 COLORREF WINAPI
GetBkColor16( HDC16 hdc
)
1091 return GetBkColor( HDC_32(hdc
) );
1095 /***********************************************************************
1096 * GetBkMode (GDI.76)
1098 INT16 WINAPI
GetBkMode16( HDC16 hdc
)
1100 return GetBkMode( HDC_32(hdc
) );
1104 /***********************************************************************
1105 * GetClipBox (GDI.77)
1107 INT16 WINAPI
GetClipBox16( HDC16 hdc
, LPRECT16 rect
)
1110 INT ret
= GetClipBox( HDC_32(hdc
), &rect32
);
1114 rect
->left
= rect32
.left
;
1115 rect
->top
= rect32
.top
;
1116 rect
->right
= rect32
.right
;
1117 rect
->bottom
= rect32
.bottom
;
1123 /***********************************************************************
1124 * GetCurrentPosition (GDI.78)
1126 DWORD WINAPI
GetCurrentPosition16( HDC16 hdc
)
1129 if (!GetCurrentPositionEx( HDC_32(hdc
), &pt32
)) return 0;
1130 return MAKELONG( pt32
.x
, pt32
.y
);
1134 /***********************************************************************
1137 DWORD WINAPI
GetDCOrg16( HDC16 hdc
)
1140 if (GetDCOrgEx( HDC_32(hdc
), &pt
)) return MAKELONG( pt
.x
, pt
.y
);
1145 /***********************************************************************
1146 * GetDeviceCaps (GDI.80)
1148 INT16 WINAPI
GetDeviceCaps16( HDC16 hdc
, INT16 cap
)
1150 INT16 ret
= GetDeviceCaps( HDC_32(hdc
), cap
);
1151 /* some apps don't expect -1 and think it's a B&W screen */
1152 if ((cap
== NUMCOLORS
) && (ret
== -1)) ret
= 2048;
1157 /***********************************************************************
1158 * GetMapMode (GDI.81)
1160 INT16 WINAPI
GetMapMode16( HDC16 hdc
)
1162 return GetMapMode( HDC_32(hdc
) );
1166 /***********************************************************************
1167 * GetObject (GDI.82)
1169 INT16 WINAPI
GetObject16( HGDIOBJ16 handle16
, INT16 count
, LPVOID buffer
)
1171 HGDIOBJ handle
= HGDIOBJ_32( handle16
);
1172 switch( GetObjectType( handle
))
1177 LOGPEN16
*pen16
= buffer
;
1180 if (count
< sizeof(LOGPEN16
)) return 0;
1181 if (!GetObjectW( handle
, sizeof(pen
), &pen
)) return 0;
1183 pen16
->lopnStyle
= pen
.lopnStyle
;
1184 pen16
->lopnColor
= pen
.lopnColor
;
1185 pen16
->lopnWidth
.x
= pen
.lopnWidth
.x
;
1186 pen16
->lopnWidth
.y
= pen
.lopnWidth
.y
;
1188 return sizeof(LOGPEN16
);
1196 if (!GetObjectW( handle
, sizeof(brush
), &brush
)) return 0;
1197 brush16
.lbStyle
= brush
.lbStyle
;
1198 brush16
.lbColor
= brush
.lbColor
;
1199 brush16
.lbHatch
= brush
.lbHatch
;
1200 if (count
> sizeof(brush16
)) count
= sizeof(brush16
);
1201 memcpy( buffer
, &brush16
, count
);
1204 return sizeof(LOGBRUSH16
);
1207 return GetObjectW( handle
, count
, buffer
);
1215 if (!GetObjectW( handle
, sizeof(font
), &font
)) return 0;
1216 logfont_W_to_16( &font
, &font16
);
1217 if (count
> sizeof(font16
)) count
= sizeof(font16
);
1218 memcpy( buffer
, &font16
, count
);
1221 return sizeof(LOGFONT16
);
1227 BITMAP16
*bmp16
= buffer
;
1229 if (!(size
= GetObjectW( handle
, sizeof(dib
), &dib
))) return 0;
1230 if (size
== sizeof(DIBSECTION
) && count
> sizeof(BITMAP16
))
1232 FIXME("not implemented for DIBs: count %d\n", count
);
1237 if (count
< sizeof(BITMAP16
)) return 0;
1238 bmp16
->bmType
= dib
.dsBm
.bmType
;
1239 bmp16
->bmWidth
= dib
.dsBm
.bmWidth
;
1240 bmp16
->bmHeight
= dib
.dsBm
.bmHeight
;
1241 bmp16
->bmWidthBytes
= dib
.dsBm
.bmWidthBytes
;
1242 bmp16
->bmPlanes
= dib
.dsBm
.bmPlanes
;
1243 bmp16
->bmBitsPixel
= dib
.dsBm
.bmBitsPixel
;
1245 return sizeof(BITMAP16
);
1255 /***********************************************************************
1258 COLORREF WINAPI
GetPixel16( HDC16 hdc
, INT16 x
, INT16 y
)
1260 return GetPixel( HDC_32(hdc
), x
, y
);
1264 /***********************************************************************
1265 * GetPolyFillMode (GDI.84)
1267 INT16 WINAPI
GetPolyFillMode16( HDC16 hdc
)
1269 return GetPolyFillMode( HDC_32(hdc
) );
1273 /***********************************************************************
1276 INT16 WINAPI
GetROP216( HDC16 hdc
)
1278 return GetROP2( HDC_32(hdc
) );
1282 /***********************************************************************
1283 * GetRelAbs (GDI.86)
1285 INT16 WINAPI
GetRelAbs16( HDC16 hdc
)
1287 return GetRelAbs( HDC_32(hdc
), 0 );
1291 /***********************************************************************
1292 * GetStockObject (GDI.87)
1294 HGDIOBJ16 WINAPI
GetStockObject16( INT16 obj
)
1296 return HGDIOBJ_16( GetStockObject( obj
) );
1300 /***********************************************************************
1301 * GetStretchBltMode (GDI.88)
1303 INT16 WINAPI
GetStretchBltMode16( HDC16 hdc
)
1305 return GetStretchBltMode( HDC_32(hdc
) );
1309 /***********************************************************************
1310 * GetTextCharacterExtra (GDI.89)
1312 INT16 WINAPI
GetTextCharacterExtra16( HDC16 hdc
)
1314 return GetTextCharacterExtra( HDC_32(hdc
) );
1318 /***********************************************************************
1319 * GetTextColor (GDI.90)
1321 COLORREF WINAPI
GetTextColor16( HDC16 hdc
)
1323 return GetTextColor( HDC_32(hdc
) );
1327 /***********************************************************************
1328 * GetTextExtent (GDI.91)
1330 DWORD WINAPI
GetTextExtent16( HDC16 hdc
, LPCSTR str
, INT16 count
)
1333 if (!GetTextExtentPoint32A( HDC_32(hdc
), str
, count
, &size
)) return 0;
1334 return MAKELONG( size
.cx
, size
.cy
);
1338 /***********************************************************************
1339 * GetTextFace (GDI.92)
1341 INT16 WINAPI
GetTextFace16( HDC16 hdc
, INT16 count
, LPSTR name
)
1343 return GetTextFaceA( HDC_32(hdc
), count
, name
);
1347 /***********************************************************************
1348 * GetTextMetrics (GDI.93)
1350 BOOL16 WINAPI
GetTextMetrics16( HDC16 hdc
, TEXTMETRIC16
*tm
)
1354 if (!GetTextMetricsW( HDC_32(hdc
), &tm32
)) return FALSE
;
1356 tm
->tmHeight
= tm32
.tmHeight
;
1357 tm
->tmAscent
= tm32
.tmAscent
;
1358 tm
->tmDescent
= tm32
.tmDescent
;
1359 tm
->tmInternalLeading
= tm32
.tmInternalLeading
;
1360 tm
->tmExternalLeading
= tm32
.tmExternalLeading
;
1361 tm
->tmAveCharWidth
= tm32
.tmAveCharWidth
;
1362 tm
->tmMaxCharWidth
= tm32
.tmMaxCharWidth
;
1363 tm
->tmWeight
= tm32
.tmWeight
;
1364 tm
->tmOverhang
= tm32
.tmOverhang
;
1365 tm
->tmDigitizedAspectX
= tm32
.tmDigitizedAspectX
;
1366 tm
->tmDigitizedAspectY
= tm32
.tmDigitizedAspectY
;
1367 tm
->tmFirstChar
= tm32
.tmFirstChar
;
1368 tm
->tmLastChar
= tm32
.tmLastChar
;
1369 tm
->tmDefaultChar
= tm32
.tmDefaultChar
;
1370 tm
->tmBreakChar
= tm32
.tmBreakChar
;
1371 tm
->tmItalic
= tm32
.tmItalic
;
1372 tm
->tmUnderlined
= tm32
.tmUnderlined
;
1373 tm
->tmStruckOut
= tm32
.tmStruckOut
;
1374 tm
->tmPitchAndFamily
= tm32
.tmPitchAndFamily
;
1375 tm
->tmCharSet
= tm32
.tmCharSet
;
1380 /***********************************************************************
1381 * GetViewportExt (GDI.94)
1383 DWORD WINAPI
GetViewportExt16( HDC16 hdc
)
1386 if (!GetViewportExtEx( HDC_32(hdc
), &size
)) return 0;
1387 return MAKELONG( size
.cx
, size
.cy
);
1391 /***********************************************************************
1392 * GetViewportOrg (GDI.95)
1394 DWORD WINAPI
GetViewportOrg16( HDC16 hdc
)
1397 if (!GetViewportOrgEx( HDC_32(hdc
), &pt
)) return 0;
1398 return MAKELONG( pt
.x
, pt
.y
);
1402 /***********************************************************************
1403 * GetWindowExt (GDI.96)
1405 DWORD WINAPI
GetWindowExt16( HDC16 hdc
)
1408 if (!GetWindowExtEx( HDC_32(hdc
), &size
)) return 0;
1409 return MAKELONG( size
.cx
, size
.cy
);
1413 /***********************************************************************
1414 * GetWindowOrg (GDI.97)
1416 DWORD WINAPI
GetWindowOrg16( HDC16 hdc
)
1419 if (!GetWindowOrgEx( HDC_32(hdc
), &pt
)) return 0;
1420 return MAKELONG( pt
.x
, pt
.y
);
1426 /**********************************************************************
1429 void WINAPI
LineDDA16( INT16 nXStart
, INT16 nYStart
, INT16 nXEnd
,
1430 INT16 nYEnd
, LINEDDAPROC16 proc
, LPARAM lParam
)
1432 struct callback16_info info
;
1433 info
.proc
= (FARPROC16
)proc
;
1434 info
.param
= lParam
;
1435 LineDDA( nXStart
, nYStart
, nXEnd
, nYEnd
, linedda_callback
, (LPARAM
)&info
);
1439 /***********************************************************************
1440 * OffsetRgn (GDI.101)
1442 INT16 WINAPI
OffsetRgn16( HRGN16 hrgn
, INT16 x
, INT16 y
)
1444 return OffsetRgn( HRGN_32(hrgn
), x
, y
);
1448 /***********************************************************************
1449 * PtVisible (GDI.103)
1451 BOOL16 WINAPI
PtVisible16( HDC16 hdc
, INT16 x
, INT16 y
)
1453 return PtVisible( HDC_32(hdc
), x
, y
);
1457 /***********************************************************************
1458 * SelectVisRgn (GDI.105)
1460 INT16 WINAPI
SelectVisRgn16( HDC16 hdc
, HRGN16 hrgn
)
1462 return SelectVisRgn( HDC_32(hdc
), HRGN_32(hrgn
) );
1466 /***********************************************************************
1467 * SetBitmapBits (GDI.106)
1469 LONG WINAPI
SetBitmapBits16( HBITMAP16 hbitmap
, LONG count
, LPCVOID buffer
)
1471 return SetBitmapBits( HBITMAP_32(hbitmap
), count
, buffer
);
1475 /***********************************************************************
1476 * AddFontResource (GDI.119)
1478 INT16 WINAPI
AddFontResource16( LPCSTR filename
)
1480 return AddFontResourceA( filename
);
1484 /***********************************************************************
1487 * Disables GDI, switches back to text mode.
1488 * We don't have to do anything here,
1489 * just let console support handle everything
1491 void WINAPI
Death16(HDC16 hdc
)
1493 MESSAGE("Death(%04x) called. Application enters text mode...\n", hdc
);
1497 /***********************************************************************
1498 * Resurrection (GDI.122)
1500 * Restores GDI functionality
1502 void WINAPI
Resurrection16(HDC16 hdc
,
1503 WORD w1
, WORD w2
, WORD w3
, WORD w4
, WORD w5
, WORD w6
)
1505 MESSAGE("Resurrection(%04x, %04x, %04x, %04x, %04x, %04x, %04x) called. Application left text mode.\n",
1506 hdc
, w1
, w2
, w3
, w4
, w5
, w6
);
1510 /**********************************************************************
1511 * CreateMetaFile (GDI.125)
1513 HDC16 WINAPI
CreateMetaFile16( LPCSTR filename
)
1515 return HDC_16( CreateMetaFileA( filename
) );
1519 /***********************************************************************
1522 INT16 WINAPI
MulDiv16( INT16 nMultiplicand
, INT16 nMultiplier
, INT16 nDivisor
)
1525 if (!nDivisor
) return -32768;
1526 /* We want to deal with a positive divisor to simplify the logic. */
1529 nMultiplicand
= - nMultiplicand
;
1530 nDivisor
= -nDivisor
;
1532 /* If the result is positive, we "add" to round. else,
1533 * we subtract to round. */
1534 if ( ( (nMultiplicand
< 0) && (nMultiplier
< 0) ) ||
1535 ( (nMultiplicand
>= 0) && (nMultiplier
>= 0) ) )
1536 ret
= (((int)nMultiplicand
* nMultiplier
) + (nDivisor
/2)) / nDivisor
;
1538 ret
= (((int)nMultiplicand
* nMultiplier
) - (nDivisor
/2)) / nDivisor
;
1539 if ((ret
> 32767) || (ret
< -32767)) return -32768;
1544 /***********************************************************************
1545 * GetRgnBox (GDI.134)
1547 INT16 WINAPI
GetRgnBox16( HRGN16 hrgn
, LPRECT16 rect
)
1550 INT16 ret
= GetRgnBox( HRGN_32(hrgn
), &r
);
1551 rect
->left
= r
.left
;
1553 rect
->right
= r
.right
;
1554 rect
->bottom
= r
.bottom
;
1559 /***********************************************************************
1560 * RemoveFontResource (GDI.136)
1562 BOOL16 WINAPI
RemoveFontResource16( LPCSTR str
)
1564 return RemoveFontResourceA(str
);
1568 /***********************************************************************
1569 * SetBrushOrg (GDI.148)
1571 DWORD WINAPI
SetBrushOrg16( HDC16 hdc
, INT16 x
, INT16 y
)
1575 if (!SetBrushOrgEx( HDC_32(hdc
), x
, y
, &pt
)) return 0;
1576 return MAKELONG( pt
.x
, pt
.y
);
1580 /***********************************************************************
1581 * GetBrushOrg (GDI.149)
1583 DWORD WINAPI
GetBrushOrg16( HDC16 hdc
)
1586 if (!GetBrushOrgEx( HDC_32(hdc
), &pt
)) return 0;
1587 return MAKELONG( pt
.x
, pt
.y
);
1591 /***********************************************************************
1592 * UnrealizeObject (GDI.150)
1594 BOOL16 WINAPI
UnrealizeObject16( HGDIOBJ16 obj
)
1596 return UnrealizeObject( HGDIOBJ_32(obj
) );
1600 /***********************************************************************
1601 * CreateIC (GDI.153)
1603 HDC16 WINAPI
CreateIC16( LPCSTR driver
, LPCSTR device
, LPCSTR output
,
1604 const DEVMODEA
* initData
)
1606 return HDC_16( CreateICA( driver
, device
, output
, initData
) );
1610 /***********************************************************************
1611 * GetNearestColor (GDI.154)
1613 COLORREF WINAPI
GetNearestColor16( HDC16 hdc
, COLORREF color
)
1615 return GetNearestColor( HDC_32(hdc
), color
);
1619 /***********************************************************************
1620 * CreateDiscardableBitmap (GDI.156)
1622 HBITMAP16 WINAPI
CreateDiscardableBitmap16( HDC16 hdc
, INT16 width
, INT16 height
)
1624 return HBITMAP_16( CreateDiscardableBitmap( HDC_32(hdc
), width
, height
) );
1628 /***********************************************************************
1629 * PtInRegion (GDI.161)
1631 BOOL16 WINAPI
PtInRegion16( HRGN16 hrgn
, INT16 x
, INT16 y
)
1633 return PtInRegion( HRGN_32(hrgn
), x
, y
);
1637 /***********************************************************************
1638 * GetBitmapDimension (GDI.162)
1640 DWORD WINAPI
GetBitmapDimension16( HBITMAP16 hbitmap
)
1643 if (!GetBitmapDimensionEx16( hbitmap
, &size
)) return 0;
1644 return MAKELONG( size
.cx
, size
.cy
);
1648 /***********************************************************************
1649 * SetBitmapDimension (GDI.163)
1651 DWORD WINAPI
SetBitmapDimension16( HBITMAP16 hbitmap
, INT16 x
, INT16 y
)
1654 if (!SetBitmapDimensionEx16( hbitmap
, x
, y
, &size
)) return 0;
1655 return MAKELONG( size
.cx
, size
.cy
);
1659 /***********************************************************************
1660 * SetRectRgn (GDI.172)
1662 * NOTE: Win 3.1 sets region to empty if left > right
1664 void WINAPI
SetRectRgn16( HRGN16 hrgn
, INT16 left
, INT16 top
, INT16 right
, INT16 bottom
)
1666 if (left
< right
) SetRectRgn( HRGN_32(hrgn
), left
, top
, right
, bottom
);
1667 else SetRectRgn( HRGN_32(hrgn
), 0, 0, 0, 0 );
1671 /******************************************************************
1672 * PlayMetaFileRecord (GDI.176)
1674 void WINAPI
PlayMetaFileRecord16( HDC16 hdc
, HANDLETABLE16
*ht
, METARECORD
*mr
, UINT16 handles
)
1676 HANDLETABLE
*ht32
= HeapAlloc( GetProcessHeap(), 0, handles
* sizeof(*ht32
) );
1679 for (i
= 0; i
< handles
; i
++) ht32
->objectHandle
[i
] = (HGDIOBJ
)(ULONG_PTR
)ht
->objectHandle
[i
];
1680 PlayMetaFileRecord( HDC_32(hdc
), ht32
, mr
, handles
);
1681 for (i
= 0; i
< handles
; i
++) ht
->objectHandle
[i
] = LOWORD(ht32
->objectHandle
[i
]);
1682 HeapFree( GetProcessHeap(), 0, ht32
);
1686 /***********************************************************************
1687 * SetHookFlags (GDI.192)
1689 WORD WINAPI
SetHookFlags16( HDC16 hdc
, WORD flags
)
1691 return SetHookFlags( HDC_32(hdc
), flags
);
1695 /***********************************************************************
1696 * SetBoundsRect (GDI.193)
1698 UINT16 WINAPI
SetBoundsRect16( HDC16 hdc
, const RECT16
* rect
, UINT16 flags
)
1703 rect32
.left
= rect
->left
;
1704 rect32
.top
= rect
->top
;
1705 rect32
.right
= rect
->right
;
1706 rect32
.bottom
= rect
->bottom
;
1707 return SetBoundsRect( HDC_32( hdc
), &rect32
, flags
);
1709 else return SetBoundsRect( HDC_32( hdc
), NULL
, flags
);
1713 /***********************************************************************
1714 * GetBoundsRect (GDI.194)
1716 UINT16 WINAPI
GetBoundsRect16( HDC16 hdc
, LPRECT16 rect
, UINT16 flags
)
1719 UINT ret
= GetBoundsRect( HDC_32( hdc
), &rect32
, flags
);
1722 rect
->left
= rect32
.left
;
1723 rect
->top
= rect32
.top
;
1724 rect
->right
= rect32
.right
;
1725 rect
->bottom
= rect32
.bottom
;
1731 /***********************************************************************
1732 * EngineEnumerateFont (GDI.300)
1734 WORD WINAPI
EngineEnumerateFont16(LPSTR fontname
, FARPROC16 proc
, DWORD data
)
1736 FIXME("(%s,%p,%x),stub\n",fontname
,proc
,data
);
1741 /***********************************************************************
1742 * EngineDeleteFont (GDI.301)
1744 WORD WINAPI
EngineDeleteFont16(LPFONTINFO16 lpFontInfo
)
1748 /* untested, don't know if it works.
1749 We seem to access some structure that is located after the
1750 FONTINFO. The FONTINFO documentation says that there may
1751 follow some char-width table or font bitmap or vector info.
1752 I think it is some kind of font bitmap that begins at offset 0x52,
1753 as FONTINFO goes up to 0x51.
1754 If this is correct, everything should be implemented correctly.
1756 if ( ((lpFontInfo
->dfType
& (RASTER_FONTTYPE
|DEVICE_FONTTYPE
)) == (RASTER_FONTTYPE
|DEVICE_FONTTYPE
))
1757 && (LOWORD(lpFontInfo
->dfFace
) == LOWORD(lpFontInfo
)+0x6e)
1758 && (handle
= *(WORD
*)(lpFontInfo
+0x54)) )
1760 *(WORD
*)(lpFontInfo
+0x54) = 0;
1761 GlobalFree16(handle
);
1767 /***********************************************************************
1768 * EngineRealizeFont (GDI.302)
1770 WORD WINAPI
EngineRealizeFont16(LPLOGFONT16 lplogFont
, LPTEXTXFORM16 lptextxform
, LPFONTINFO16 lpfontInfo
)
1772 FIXME("(%p,%p,%p),stub\n",lplogFont
,lptextxform
,lpfontInfo
);
1778 /***********************************************************************
1779 * EngineRealizeFontExt (GDI.315)
1781 WORD WINAPI
EngineRealizeFontExt16(LONG l1
, LONG l2
, LONG l3
, LONG l4
)
1783 FIXME("(%08x,%08x,%08x,%08x),stub\n",l1
,l2
,l3
,l4
);
1789 /***********************************************************************
1790 * EngineGetCharWidth (GDI.303)
1792 WORD WINAPI
EngineGetCharWidth16(LPFONTINFO16 lpFontInfo
, BYTE firstChar
, BYTE lastChar
, LPINT16 buffer
)
1796 for (i
= firstChar
; i
<= lastChar
; i
++)
1797 FIXME(" returns font's average width for range %d to %d\n", firstChar
, lastChar
);
1798 *buffer
++ = lpFontInfo
->dfAvgWidth
; /* insert some charwidth functionality here; use average width for now */
1803 /***********************************************************************
1804 * EngineSetFontContext (GDI.304)
1806 WORD WINAPI
EngineSetFontContext(LPFONTINFO16 lpFontInfo
, WORD data
)
1812 /***********************************************************************
1813 * EngineGetGlyphBMP (GDI.305)
1815 WORD WINAPI
EngineGetGlyphBMP(WORD word
, LPFONTINFO16 lpFontInfo
, WORD w1
, WORD w2
,
1816 LPSTR string
, DWORD dword
, /*LPBITMAPMETRICS16*/ LPVOID metrics
)
1823 /***********************************************************************
1824 * EngineMakeFontDir (GDI.306)
1826 DWORD WINAPI
EngineMakeFontDir(HDC16 hdc
, LPFONTDIR16 fontdir
, LPCSTR string
)
1828 FIXME(" stub! (always fails)\n");
1829 return ~0UL; /* error */
1833 /***********************************************************************
1834 * GetCharABCWidths (GDI.307)
1836 BOOL16 WINAPI
GetCharABCWidths16( HDC16 hdc
, UINT16 firstChar
, UINT16 lastChar
, LPABC16 abc
)
1840 LPABC abc32
= HeapAlloc( GetProcessHeap(), 0, sizeof(ABC
) * (lastChar
- firstChar
+ 1) );
1842 if ((ret
= GetCharABCWidthsA( HDC_32(hdc
), firstChar
, lastChar
, abc32
)))
1844 for (i
= firstChar
; i
<= lastChar
; i
++)
1846 abc
[i
-firstChar
].abcA
= abc32
[i
-firstChar
].abcA
;
1847 abc
[i
-firstChar
].abcB
= abc32
[i
-firstChar
].abcB
;
1848 abc
[i
-firstChar
].abcC
= abc32
[i
-firstChar
].abcC
;
1851 HeapFree( GetProcessHeap(), 0, abc32
);
1856 /***********************************************************************
1857 * GetOutlineTextMetrics (GDI.308)
1859 * Gets metrics for TrueType fonts.
1862 * hdc [In] Handle of device context
1863 * cbData [In] Size of metric data array
1864 * lpOTM [Out] Address of metric data array
1867 * Success: Non-zero or size of required buffer
1871 * lpOTM should be LPOUTLINETEXTMETRIC
1873 UINT16 WINAPI
GetOutlineTextMetrics16( HDC16 hdc
, UINT16 cbData
,
1874 LPOUTLINETEXTMETRIC16 lpOTM
)
1876 FIXME("(%04x,%04x,%p): stub\n", hdc
,cbData
,lpOTM
);
1881 /***********************************************************************
1882 * GetGlyphOutline (GDI.309)
1884 DWORD WINAPI
GetGlyphOutline16( HDC16 hdc
, UINT16 uChar
, UINT16 fuFormat
,
1885 LPGLYPHMETRICS16 lpgm
, DWORD cbBuffer
,
1886 LPVOID lpBuffer
, const MAT2
*lpmat2
)
1891 ret
= GetGlyphOutlineA( HDC_32(hdc
), uChar
, fuFormat
, &gm32
, cbBuffer
, lpBuffer
, lpmat2
);
1892 lpgm
->gmBlackBoxX
= gm32
.gmBlackBoxX
;
1893 lpgm
->gmBlackBoxY
= gm32
.gmBlackBoxY
;
1894 lpgm
->gmptGlyphOrigin
.x
= gm32
.gmptGlyphOrigin
.x
;
1895 lpgm
->gmptGlyphOrigin
.y
= gm32
.gmptGlyphOrigin
.y
;
1896 lpgm
->gmCellIncX
= gm32
.gmCellIncX
;
1897 lpgm
->gmCellIncY
= gm32
.gmCellIncY
;
1902 /***********************************************************************
1903 * CreateScalableFontResource (GDI.310)
1905 BOOL16 WINAPI
CreateScalableFontResource16( UINT16 fHidden
, LPCSTR lpszResourceFile
,
1906 LPCSTR fontFile
, LPCSTR path
)
1908 return CreateScalableFontResourceA( fHidden
, lpszResourceFile
, fontFile
, path
);
1912 /*************************************************************************
1913 * GetFontData (GDI.311)
1916 DWORD WINAPI
GetFontData16( HDC16 hdc
, DWORD table
, DWORD offset
, LPVOID buffer
, DWORD count
)
1918 return GetFontData( HDC_32(hdc
), table
, offset
, buffer
, count
);
1922 /*************************************************************************
1923 * GetRasterizerCaps (GDI.313)
1925 BOOL16 WINAPI
GetRasterizerCaps16( LPRASTERIZER_STATUS lprs
, UINT16 cbNumBytes
)
1927 return GetRasterizerCaps( lprs
, cbNumBytes
);
1931 /*************************************************************************
1932 * GetKerningPairs (GDI.332)
1935 INT16 WINAPI
GetKerningPairs16( HDC16 hdc
, INT16 count
, LPKERNINGPAIR16 pairs
)
1937 KERNINGPAIR
*pairs32
;
1940 if (!count
) return 0;
1942 if (!(pairs32
= HeapAlloc( GetProcessHeap(), 0, count
* sizeof(*pairs32
) ))) return 0;
1943 if ((ret
= GetKerningPairsA( HDC_32(hdc
), count
, pairs32
)))
1945 for (i
= 0; i
< ret
; i
++)
1947 pairs
->wFirst
= pairs32
->wFirst
;
1948 pairs
->wSecond
= pairs32
->wSecond
;
1949 pairs
->iKernAmount
= pairs32
->iKernAmount
;
1952 HeapFree( GetProcessHeap(), 0, pairs32
);
1958 /***********************************************************************
1959 * GetTextAlign (GDI.345)
1961 UINT16 WINAPI
GetTextAlign16( HDC16 hdc
)
1963 return GetTextAlign( HDC_32(hdc
) );
1967 /***********************************************************************
1968 * SetTextAlign (GDI.346)
1970 UINT16 WINAPI
SetTextAlign16( HDC16 hdc
, UINT16 align
)
1972 return SetTextAlign( HDC_32(hdc
), align
);
1976 /***********************************************************************
1979 BOOL16 WINAPI
Chord16( HDC16 hdc
, INT16 left
, INT16 top
,
1980 INT16 right
, INT16 bottom
, INT16 xstart
, INT16 ystart
,
1981 INT16 xend
, INT16 yend
)
1983 return Chord( HDC_32(hdc
), left
, top
, right
, bottom
, xstart
, ystart
, xend
, yend
);
1987 /***********************************************************************
1988 * SetMapperFlags (GDI.349)
1990 DWORD WINAPI
SetMapperFlags16( HDC16 hdc
, DWORD flags
)
1992 return SetMapperFlags( HDC_32(hdc
), flags
);
1996 /***********************************************************************
1997 * GetCharWidth (GDI.350)
1999 BOOL16 WINAPI
GetCharWidth16( HDC16 hdc
, UINT16 firstChar
, UINT16 lastChar
, LPINT16 buffer
)
2001 BOOL retVal
= FALSE
;
2003 if( firstChar
!= lastChar
)
2005 LPINT buf32
= HeapAlloc(GetProcessHeap(), 0, sizeof(INT
)*(1 + (lastChar
- firstChar
)));
2008 LPINT obuf32
= buf32
;
2011 retVal
= GetCharWidth32A( HDC_32(hdc
), firstChar
, lastChar
, buf32
);
2014 for (i
= firstChar
; i
<= lastChar
; i
++) *buffer
++ = *buf32
++;
2016 HeapFree(GetProcessHeap(), 0, obuf32
);
2019 else /* happens quite often to warrant a special treatment */
2022 retVal
= GetCharWidth32A( HDC_32(hdc
), firstChar
, lastChar
, &chWidth
);
2029 /***********************************************************************
2030 * ExtTextOut (GDI.351)
2032 BOOL16 WINAPI
ExtTextOut16( HDC16 hdc
, INT16 x
, INT16 y
, UINT16 flags
,
2033 const RECT16
*lprect
, LPCSTR str
, UINT16 count
,
2039 LPINT lpdx32
= NULL
;
2042 lpdx32
= HeapAlloc( GetProcessHeap(),0, sizeof(INT
)*count
);
2043 if(lpdx32
== NULL
) return FALSE
;
2044 for (i
=count
;i
--;) lpdx32
[i
]=lpDx
[i
];
2048 rect32
.left
= lprect
->left
;
2049 rect32
.top
= lprect
->top
;
2050 rect32
.right
= lprect
->right
;
2051 rect32
.bottom
= lprect
->bottom
;
2053 ret
= ExtTextOutA(HDC_32(hdc
),x
,y
,flags
,lprect
?&rect32
:NULL
,str
,count
,lpdx32
);
2054 HeapFree( GetProcessHeap(), 0, lpdx32
);
2059 /***********************************************************************
2060 * CreatePalette (GDI.360)
2062 HPALETTE16 WINAPI
CreatePalette16( const LOGPALETTE
* palette
)
2064 return HPALETTE_16( CreatePalette( palette
) );
2068 /***********************************************************************
2069 * GDISelectPalette (GDI.361)
2071 HPALETTE16 WINAPI
GDISelectPalette16( HDC16 hdc
, HPALETTE16 hpalette
, WORD wBkg
)
2073 return HPALETTE_16( GDISelectPalette( HDC_32(hdc
), HPALETTE_32(hpalette
), wBkg
));
2077 /***********************************************************************
2078 * GDIRealizePalette (GDI.362)
2080 UINT16 WINAPI
GDIRealizePalette16( HDC16 hdc
)
2082 return GDIRealizePalette( HDC_32(hdc
) );
2086 /***********************************************************************
2087 * GetPaletteEntries (GDI.363)
2089 UINT16 WINAPI
GetPaletteEntries16( HPALETTE16 hpalette
, UINT16 start
,
2090 UINT16 count
, LPPALETTEENTRY entries
)
2092 return GetPaletteEntries( HPALETTE_32(hpalette
), start
, count
, entries
);
2096 /***********************************************************************
2097 * SetPaletteEntries (GDI.364)
2099 UINT16 WINAPI
SetPaletteEntries16( HPALETTE16 hpalette
, UINT16 start
,
2100 UINT16 count
, const PALETTEENTRY
*entries
)
2102 return SetPaletteEntries( HPALETTE_32(hpalette
), start
, count
, entries
);
2106 /**********************************************************************
2107 * UpdateColors (GDI.366)
2109 INT16 WINAPI
UpdateColors16( HDC16 hdc
)
2111 UpdateColors( HDC_32(hdc
) );
2116 /***********************************************************************
2117 * AnimatePalette (GDI.367)
2119 void WINAPI
AnimatePalette16( HPALETTE16 hpalette
, UINT16 StartIndex
,
2120 UINT16 NumEntries
, const PALETTEENTRY
* PaletteColors
)
2122 AnimatePalette( HPALETTE_32(hpalette
), StartIndex
, NumEntries
, PaletteColors
);
2126 /***********************************************************************
2127 * ResizePalette (GDI.368)
2129 BOOL16 WINAPI
ResizePalette16( HPALETTE16 hpalette
, UINT16 cEntries
)
2131 return ResizePalette( HPALETTE_32(hpalette
), cEntries
);
2135 /***********************************************************************
2136 * GetNearestPaletteIndex (GDI.370)
2138 UINT16 WINAPI
GetNearestPaletteIndex16( HPALETTE16 hpalette
, COLORREF color
)
2140 return GetNearestPaletteIndex( HPALETTE_32(hpalette
), color
);
2144 /**********************************************************************
2145 * ExtFloodFill (GDI.372)
2147 BOOL16 WINAPI
ExtFloodFill16( HDC16 hdc
, INT16 x
, INT16 y
, COLORREF color
,
2150 return ExtFloodFill( HDC_32(hdc
), x
, y
, color
, fillType
);
2154 /***********************************************************************
2155 * SetSystemPaletteUse (GDI.373)
2157 UINT16 WINAPI
SetSystemPaletteUse16( HDC16 hdc
, UINT16 use
)
2159 return SetSystemPaletteUse( HDC_32(hdc
), use
);
2163 /***********************************************************************
2164 * GetSystemPaletteUse (GDI.374)
2166 UINT16 WINAPI
GetSystemPaletteUse16( HDC16 hdc
)
2168 return GetSystemPaletteUse( HDC_32(hdc
) );
2172 /***********************************************************************
2173 * GetSystemPaletteEntries (GDI.375)
2175 UINT16 WINAPI
GetSystemPaletteEntries16( HDC16 hdc
, UINT16 start
, UINT16 count
,
2176 LPPALETTEENTRY entries
)
2178 return GetSystemPaletteEntries( HDC_32(hdc
), start
, count
, entries
);
2182 /***********************************************************************
2185 HDC16 WINAPI
ResetDC16( HDC16 hdc
, const DEVMODEA
*devmode
)
2187 return HDC_16( ResetDCA(HDC_32(hdc
), devmode
) );
2191 /******************************************************************
2192 * StartDoc (GDI.377)
2194 INT16 WINAPI
StartDoc16( HDC16 hdc
, const DOCINFO16
*lpdoc
)
2198 docA
.cbSize
= lpdoc
->cbSize
;
2199 docA
.lpszDocName
= MapSL(lpdoc
->lpszDocName
);
2200 docA
.lpszOutput
= MapSL(lpdoc
->lpszOutput
);
2201 if(lpdoc
->cbSize
> offsetof(DOCINFO16
,lpszDatatype
))
2202 docA
.lpszDatatype
= MapSL(lpdoc
->lpszDatatype
);
2204 docA
.lpszDatatype
= NULL
;
2205 if(lpdoc
->cbSize
> offsetof(DOCINFO16
,fwType
))
2206 docA
.fwType
= lpdoc
->fwType
;
2209 return StartDocA( HDC_32(hdc
), &docA
);
2213 /******************************************************************
2216 INT16 WINAPI
EndDoc16( HDC16 hdc
)
2218 return EndDoc( HDC_32(hdc
) );
2222 /******************************************************************
2223 * StartPage (GDI.379)
2225 INT16 WINAPI
StartPage16( HDC16 hdc
)
2227 return StartPage( HDC_32(hdc
) );
2231 /******************************************************************
2234 INT16 WINAPI
EndPage16( HDC16 hdc
)
2236 return EndPage( HDC_32(hdc
) );
2240 /******************************************************************************
2241 * AbortDoc (GDI.382)
2243 INT16 WINAPI
AbortDoc16( HDC16 hdc
)
2245 return AbortDoc( HDC_32(hdc
) );
2249 /***********************************************************************
2250 * FastWindowFrame (GDI.400)
2252 BOOL16 WINAPI
FastWindowFrame16( HDC16 hdc
, const RECT16
*rect
,
2253 INT16 width
, INT16 height
, DWORD rop
)
2255 HDC hdc32
= HDC_32(hdc
);
2256 HBRUSH hbrush
= SelectObject( hdc32
, GetStockObject( GRAY_BRUSH
) );
2257 PatBlt( hdc32
, rect
->left
, rect
->top
,
2258 rect
->right
- rect
->left
- width
, height
, rop
);
2259 PatBlt( hdc32
, rect
->left
, rect
->top
+ height
, width
,
2260 rect
->bottom
- rect
->top
- height
, rop
);
2261 PatBlt( hdc32
, rect
->left
+ width
, rect
->bottom
- 1,
2262 rect
->right
- rect
->left
- width
, -height
, rop
);
2263 PatBlt( hdc32
, rect
->right
- 1, rect
->top
, -width
,
2264 rect
->bottom
- rect
->top
- height
, rop
);
2265 SelectObject( hdc32
, hbrush
);
2270 /***********************************************************************
2271 * GdiInit2 (GDI.403)
2273 * See "Undocumented Windows"
2277 * h2 [I] global data
2279 HANDLE16 WINAPI
GdiInit216( HANDLE16 h1
, HANDLE16 h2
)
2281 FIXME("(%04x, %04x), stub.\n", h1
, h2
);
2282 if (h2
== 0xffff) return 0xffff; /* undefined return value */
2283 return h1
; /* FIXME: should be the memory handle of h1 */
2287 /***********************************************************************
2288 * FinalGdiInit (GDI.405)
2290 void WINAPI
FinalGdiInit16( HBRUSH16 hPattern
/* [in] fill pattern of desktop */ )
2295 /***********************************************************************
2296 * CreateUserBitmap (GDI.407)
2298 HBITMAP16 WINAPI
CreateUserBitmap16( INT16 width
, INT16 height
, UINT16 planes
,
2299 UINT16 bpp
, LPCVOID bits
)
2301 return CreateBitmap16( width
, height
, planes
, bpp
, bits
);
2305 /***********************************************************************
2306 * CreateUserDiscardableBitmap (GDI.409)
2308 HBITMAP16 WINAPI
CreateUserDiscardableBitmap16( WORD dummy
, INT16 width
, INT16 height
)
2310 HDC hdc
= CreateDCA( "DISPLAY", NULL
, NULL
, NULL
);
2311 HBITMAP ret
= CreateCompatibleBitmap( hdc
, width
, height
);
2313 return HBITMAP_16(ret
);
2317 /***********************************************************************
2318 * GetCurLogFont (GDI.411)
2320 HFONT16 WINAPI
GetCurLogFont16( HDC16 hdc
)
2322 return HFONT_16( GetCurrentObject( HDC_32(hdc
), OBJ_FONT
) );
2326 /***********************************************************************
2327 * StretchDIBits (GDI.439)
2329 INT16 WINAPI
StretchDIBits16( HDC16 hdc
, INT16 xDst
, INT16 yDst
, INT16 widthDst
,
2330 INT16 heightDst
, INT16 xSrc
, INT16 ySrc
, INT16 widthSrc
,
2331 INT16 heightSrc
, const VOID
*bits
,
2332 const BITMAPINFO
*info
, UINT16 wUsage
, DWORD dwRop
)
2334 return StretchDIBits( HDC_32(hdc
), xDst
, yDst
, widthDst
, heightDst
,
2335 xSrc
, ySrc
, widthSrc
, heightSrc
, bits
,
2336 info
, wUsage
, dwRop
);
2340 /***********************************************************************
2341 * SetDIBits (GDI.440)
2343 INT16 WINAPI
SetDIBits16( HDC16 hdc
, HBITMAP16 hbitmap
, UINT16 startscan
,
2344 UINT16 lines
, LPCVOID bits
, const BITMAPINFO
*info
,
2347 return SetDIBits( HDC_32(hdc
), HBITMAP_32(hbitmap
), startscan
, lines
, bits
, info
, coloruse
);
2351 /***********************************************************************
2352 * GetDIBits (GDI.441)
2354 INT16 WINAPI
GetDIBits16( HDC16 hdc
, HBITMAP16 hbitmap
, UINT16 startscan
,
2355 UINT16 lines
, LPVOID bits
, BITMAPINFO
* info
,
2358 return GetDIBits( HDC_32(hdc
), HBITMAP_32(hbitmap
), startscan
, lines
, bits
, info
, coloruse
);
2362 /***********************************************************************
2363 * CreateDIBitmap (GDI.442)
2365 HBITMAP16 WINAPI
CreateDIBitmap16( HDC16 hdc
, const BITMAPINFOHEADER
* header
,
2366 DWORD init
, LPCVOID bits
, const BITMAPINFO
* data
,
2369 return HBITMAP_16( CreateDIBitmap( HDC_32(hdc
), header
, init
, bits
, data
, coloruse
) );
2373 /***********************************************************************
2374 * SetDIBitsToDevice (GDI.443)
2376 INT16 WINAPI
SetDIBitsToDevice16( HDC16 hdc
, INT16 xDest
, INT16 yDest
, INT16 cx
,
2377 INT16 cy
, INT16 xSrc
, INT16 ySrc
, UINT16 startscan
,
2378 UINT16 lines
, LPCVOID bits
, const BITMAPINFO
*info
,
2381 return SetDIBitsToDevice( HDC_32(hdc
), xDest
, yDest
, cx
, cy
, xSrc
, ySrc
,
2382 startscan
, lines
, bits
, info
, coloruse
);
2386 /***********************************************************************
2387 * CreateRoundRectRgn (GDI.444)
2389 * If either ellipse dimension is zero we call CreateRectRgn16 for its
2390 * `special' behaviour. -ve ellipse dimensions can result in GPFs under win3.1
2391 * we just let CreateRoundRectRgn convert them to +ve values.
2394 HRGN16 WINAPI
CreateRoundRectRgn16( INT16 left
, INT16 top
, INT16 right
, INT16 bottom
,
2395 INT16 ellipse_width
, INT16 ellipse_height
)
2397 if( ellipse_width
== 0 || ellipse_height
== 0 )
2398 return CreateRectRgn16( left
, top
, right
, bottom
);
2400 return HRGN_16( CreateRoundRectRgn( left
, top
, right
, bottom
,
2401 ellipse_width
, ellipse_height
));
2405 /***********************************************************************
2406 * CreateDIBPatternBrush (GDI.445)
2408 HBRUSH16 WINAPI
CreateDIBPatternBrush16( HGLOBAL16 hbitmap
, UINT16 coloruse
)
2413 if (!(bmi
= GlobalLock16( hbitmap
))) return 0;
2414 ret
= HBRUSH_16( CreateDIBPatternBrushPt( bmi
, coloruse
));
2415 GlobalUnlock16( hbitmap
);
2420 /**********************************************************************
2421 * PolyPolygon (GDI.450)
2423 BOOL16 WINAPI
PolyPolygon16( HDC16 hdc
, const POINT16
* pt
, const INT16
* counts
,
2432 for (i
=polygons
;i
--;)
2434 pt32
= HeapAlloc( GetProcessHeap(), 0, sizeof(POINT
)*nrpts
);
2435 if(pt32
== NULL
) return FALSE
;
2438 pt32
[i
].x
= pt
[i
].x
;
2439 pt32
[i
].y
= pt
[i
].y
;
2441 counts32
= HeapAlloc( GetProcessHeap(), 0, polygons
*sizeof(INT
) );
2442 if(counts32
== NULL
) {
2443 HeapFree( GetProcessHeap(), 0, pt32
);
2446 for (i
=polygons
;i
--;) counts32
[i
]=counts
[i
];
2448 ret
= PolyPolygon(HDC_32(hdc
),pt32
,counts32
,polygons
);
2449 HeapFree( GetProcessHeap(), 0, counts32
);
2450 HeapFree( GetProcessHeap(), 0, pt32
);
2455 /***********************************************************************
2456 * CreatePolyPolygonRgn (GDI.451)
2458 HRGN16 WINAPI
CreatePolyPolygonRgn16( const POINT16
*points
,
2459 const INT16
*count
, INT16 nbpolygons
, INT16 mode
)
2466 for (i
= 0; i
< nbpolygons
; i
++) npts
+= count
[i
];
2467 points32
= HeapAlloc( GetProcessHeap(), 0, npts
* sizeof(POINT
) );
2468 for (i
= 0; i
< npts
; i
++)
2470 points32
[i
].x
= points
[i
].x
;
2471 points32
[i
].y
= points
[i
].y
;
2474 count32
= HeapAlloc( GetProcessHeap(), 0, nbpolygons
* sizeof(INT
) );
2475 for (i
= 0; i
< nbpolygons
; i
++) count32
[i
] = count
[i
];
2476 hrgn
= CreatePolyPolygonRgn( points32
, count32
, nbpolygons
, mode
);
2477 HeapFree( GetProcessHeap(), 0, count32
);
2478 HeapFree( GetProcessHeap(), 0, points32
);
2479 return HRGN_16(hrgn
);
2483 /***********************************************************************
2484 * GdiSeeGdiDo (GDI.452)
2486 DWORD WINAPI
GdiSeeGdiDo16( WORD wReqType
, WORD wParam1
, WORD wParam2
,
2493 case 0x0001: /* LocalAlloc */
2494 WARN("LocalAlloc16(%x, %x): ignoring\n", wParam1
, wParam3
);
2497 case 0x0002: /* LocalFree */
2498 WARN("LocalFree16(%x): ignoring\n", wParam1
);
2501 case 0x0003: /* LocalCompact */
2502 WARN("LocalCompact16(%x): ignoring\n", wParam3
);
2503 ret
= 65000; /* lie about the amount of free space */
2505 case 0x0103: /* LocalHeap */
2506 WARN("LocalHeap16(): ignoring\n");
2509 WARN("(wReqType=%04x): Unknown\n", wReqType
);
2516 /***********************************************************************
2517 * SetObjectOwner (GDI.461)
2519 void WINAPI
SetObjectOwner16( HGDIOBJ16 handle
, HANDLE16 owner
)
2525 /***********************************************************************
2526 * IsGDIObject (GDI.462)
2528 * returns type of object if valid (W95 system programming secrets p. 264-5)
2530 BOOL16 WINAPI
IsGDIObject16( HGDIOBJ16 handle16
)
2532 static const BYTE type_map
[] =
2543 10, /* OBJ_METAFILE */
2546 9, /* OBJ_ENHMETADC */
2547 12, /* OBJ_ENHMETAFILE */
2548 0 /* OBJ_COLORSPACE */
2551 UINT type
= GetObjectType( HGDIOBJ_32( handle16
));
2553 if (type
>= sizeof(type_map
)/sizeof(type_map
[0])) return 0;
2554 return type_map
[type
];
2558 /***********************************************************************
2559 * RectVisible (GDI.465)
2560 * RectVisibleOld (GDI.104)
2562 BOOL16 WINAPI
RectVisible16( HDC16 hdc
, const RECT16
* rect16
)
2566 rect
.left
= rect16
->left
;
2567 rect
.top
= rect16
->top
;
2568 rect
.right
= rect16
->right
;
2569 rect
.bottom
= rect16
->bottom
;
2570 return RectVisible( HDC_32(hdc
), &rect
);
2574 /***********************************************************************
2575 * RectInRegion (GDI.466)
2576 * RectInRegionOld (GDI.181)
2578 BOOL16 WINAPI
RectInRegion16( HRGN16 hrgn
, const RECT16
*rect
)
2582 r32
.left
= rect
->left
;
2583 r32
.top
= rect
->top
;
2584 r32
.right
= rect
->right
;
2585 r32
.bottom
= rect
->bottom
;
2586 return RectInRegion( HRGN_32(hrgn
), &r32
);
2590 /***********************************************************************
2591 * GetBitmapDimensionEx (GDI.468)
2593 BOOL16 WINAPI
GetBitmapDimensionEx16( HBITMAP16 hbitmap
, LPSIZE16 size
)
2596 BOOL ret
= GetBitmapDimensionEx( HBITMAP_32(hbitmap
), &size32
);
2600 size
->cx
= size32
.cx
;
2601 size
->cy
= size32
.cy
;
2607 /***********************************************************************
2608 * GetBrushOrgEx (GDI.469)
2610 BOOL16 WINAPI
GetBrushOrgEx16( HDC16 hdc
, LPPOINT16 pt
)
2613 if (!GetBrushOrgEx( HDC_32(hdc
), &pt32
)) return FALSE
;
2620 /***********************************************************************
2621 * GetCurrentPositionEx (GDI.470)
2623 BOOL16 WINAPI
GetCurrentPositionEx16( HDC16 hdc
, LPPOINT16 pt
)
2626 if (!GetCurrentPositionEx( HDC_32(hdc
), &pt32
)) return FALSE
;
2633 /***********************************************************************
2634 * GetTextExtentPoint (GDI.471)
2636 * FIXME: Should this have a bug for compatibility?
2637 * Original Windows versions of GetTextExtentPoint{A,W} have documented
2638 * bugs (-> MSDN KB q147647.txt).
2640 BOOL16 WINAPI
GetTextExtentPoint16( HDC16 hdc
, LPCSTR str
, INT16 count
, LPSIZE16 size
)
2643 BOOL ret
= GetTextExtentPoint32A( HDC_32(hdc
), str
, count
, &size32
);
2647 size
->cx
= size32
.cx
;
2648 size
->cy
= size32
.cy
;
2654 /***********************************************************************
2655 * GetViewportExtEx (GDI.472)
2657 BOOL16 WINAPI
GetViewportExtEx16( HDC16 hdc
, LPSIZE16 size
)
2660 if (!GetViewportExtEx( HDC_32(hdc
), &size32
)) return FALSE
;
2661 size
->cx
= size32
.cx
;
2662 size
->cy
= size32
.cy
;
2667 /***********************************************************************
2668 * GetViewportOrgEx (GDI.473)
2670 BOOL16 WINAPI
GetViewportOrgEx16( HDC16 hdc
, LPPOINT16 pt
)
2673 if (!GetViewportOrgEx( HDC_32(hdc
), &pt32
)) return FALSE
;
2680 /***********************************************************************
2681 * GetWindowExtEx (GDI.474)
2683 BOOL16 WINAPI
GetWindowExtEx16( HDC16 hdc
, LPSIZE16 size
)
2686 if (!GetWindowExtEx( HDC_32(hdc
), &size32
)) return FALSE
;
2687 size
->cx
= size32
.cx
;
2688 size
->cy
= size32
.cy
;
2693 /***********************************************************************
2694 * GetWindowOrgEx (GDI.475)
2696 BOOL16 WINAPI
GetWindowOrgEx16( HDC16 hdc
, LPPOINT16 pt
)
2699 if (!GetWindowOrgEx( HDC_32(hdc
), &pt32
)) return FALSE
;
2706 /***********************************************************************
2707 * OffsetViewportOrgEx (GDI.476)
2709 BOOL16 WINAPI
OffsetViewportOrgEx16( HDC16 hdc
, INT16 x
, INT16 y
, LPPOINT16 pt
)
2712 BOOL16 ret
= OffsetViewportOrgEx( HDC_32(hdc
), x
, y
, &pt32
);
2722 /***********************************************************************
2723 * OffsetWindowOrgEx (GDI.477)
2725 BOOL16 WINAPI
OffsetWindowOrgEx16( HDC16 hdc
, INT16 x
, INT16 y
, LPPOINT16 pt
)
2728 BOOL16 ret
= OffsetWindowOrgEx( HDC_32(hdc
), x
, y
, &pt32
);
2738 /***********************************************************************
2739 * SetBitmapDimensionEx (GDI.478)
2741 BOOL16 WINAPI
SetBitmapDimensionEx16( HBITMAP16 hbitmap
, INT16 x
, INT16 y
, LPSIZE16 prevSize
)
2744 BOOL ret
= SetBitmapDimensionEx( HBITMAP_32(hbitmap
), x
, y
, &size32
);
2746 if (ret
&& prevSize
)
2748 prevSize
->cx
= size32
.cx
;
2749 prevSize
->cy
= size32
.cy
;
2755 /***********************************************************************
2756 * SetViewportExtEx (GDI.479)
2758 BOOL16 WINAPI
SetViewportExtEx16( HDC16 hdc
, INT16 x
, INT16 y
, LPSIZE16 size
)
2761 BOOL16 ret
= SetViewportExtEx( HDC_32(hdc
), x
, y
, &size32
);
2762 if (size
) { size
->cx
= size32
.cx
; size
->cy
= size32
.cy
; }
2767 /***********************************************************************
2768 * SetViewportOrgEx (GDI.480)
2770 BOOL16 WINAPI
SetViewportOrgEx16( HDC16 hdc
, INT16 x
, INT16 y
, LPPOINT16 pt
)
2773 BOOL16 ret
= SetViewportOrgEx( HDC_32(hdc
), x
, y
, &pt32
);
2783 /***********************************************************************
2784 * SetWindowExtEx (GDI.481)
2786 BOOL16 WINAPI
SetWindowExtEx16( HDC16 hdc
, INT16 x
, INT16 y
, LPSIZE16 size
)
2789 BOOL16 ret
= SetWindowExtEx( HDC_32(hdc
), x
, y
, &size32
);
2790 if (size
) { size
->cx
= size32
.cx
; size
->cy
= size32
.cy
; }
2795 /***********************************************************************
2796 * SetWindowOrgEx (GDI.482)
2798 BOOL16 WINAPI
SetWindowOrgEx16( HDC16 hdc
, INT16 x
, INT16 y
, LPPOINT16 pt
)
2801 BOOL16 ret
= SetWindowOrgEx( HDC_32(hdc
), x
, y
, &pt32
);
2811 /***********************************************************************
2812 * MoveToEx (GDI.483)
2814 BOOL16 WINAPI
MoveToEx16( HDC16 hdc
, INT16 x
, INT16 y
, LPPOINT16 pt
)
2818 if (!MoveToEx( HDC_32(hdc
), x
, y
, &pt32
)) return FALSE
;
2828 /***********************************************************************
2829 * ScaleViewportExtEx (GDI.484)
2831 BOOL16 WINAPI
ScaleViewportExtEx16( HDC16 hdc
, INT16 xNum
, INT16 xDenom
,
2832 INT16 yNum
, INT16 yDenom
, LPSIZE16 size
)
2835 BOOL16 ret
= ScaleViewportExtEx( HDC_32(hdc
), xNum
, xDenom
, yNum
, yDenom
,
2837 if (size
) { size
->cx
= size32
.cx
; size
->cy
= size32
.cy
; }
2842 /***********************************************************************
2843 * ScaleWindowExtEx (GDI.485)
2845 BOOL16 WINAPI
ScaleWindowExtEx16( HDC16 hdc
, INT16 xNum
, INT16 xDenom
,
2846 INT16 yNum
, INT16 yDenom
, LPSIZE16 size
)
2849 BOOL16 ret
= ScaleWindowExtEx( HDC_32(hdc
), xNum
, xDenom
, yNum
, yDenom
,
2851 if (size
) { size
->cx
= size32
.cx
; size
->cy
= size32
.cy
; }
2856 /***********************************************************************
2857 * GetAspectRatioFilterEx (GDI.486)
2859 BOOL16 WINAPI
GetAspectRatioFilterEx16( HDC16 hdc
, LPSIZE16 pAspectRatio
)
2861 FIXME("(%04x, %p): -- Empty Stub !\n", hdc
, pAspectRatio
);
2866 /******************************************************************************
2867 * PolyBezier (GDI.502)
2869 BOOL16 WINAPI
PolyBezier16( HDC16 hdc
, const POINT16
* lppt
, INT16 cPoints
)
2873 LPPOINT pt32
= HeapAlloc( GetProcessHeap(), 0, cPoints
*sizeof(POINT
) );
2874 if(!pt32
) return FALSE
;
2875 for (i
=cPoints
;i
--;)
2877 pt32
[i
].x
= lppt
[i
].x
;
2878 pt32
[i
].y
= lppt
[i
].y
;
2880 ret
= PolyBezier(HDC_32(hdc
), pt32
, cPoints
);
2881 HeapFree( GetProcessHeap(), 0, pt32
);
2886 /******************************************************************************
2887 * PolyBezierTo (GDI.503)
2889 BOOL16 WINAPI
PolyBezierTo16( HDC16 hdc
, const POINT16
* lppt
, INT16 cPoints
)
2893 LPPOINT pt32
= HeapAlloc( GetProcessHeap(), 0,
2894 cPoints
*sizeof(POINT
) );
2895 if(!pt32
) return FALSE
;
2896 for (i
=cPoints
;i
--;)
2898 pt32
[i
].x
= lppt
[i
].x
;
2899 pt32
[i
].y
= lppt
[i
].y
;
2901 ret
= PolyBezierTo(HDC_32(hdc
), pt32
, cPoints
);
2902 HeapFree( GetProcessHeap(), 0, pt32
);
2907 /******************************************************************************
2908 * ExtSelectClipRgn (GDI.508)
2910 INT16 WINAPI
ExtSelectClipRgn16( HDC16 hdc
, HRGN16 hrgn
, INT16 fnMode
)
2912 return ExtSelectClipRgn( HDC_32(hdc
), HRGN_32(hrgn
), fnMode
);
2916 /***********************************************************************
2917 * AbortPath (GDI.511)
2919 BOOL16 WINAPI
AbortPath16(HDC16 hdc
)
2921 return AbortPath( HDC_32(hdc
) );
2925 /***********************************************************************
2926 * BeginPath (GDI.512)
2928 BOOL16 WINAPI
BeginPath16(HDC16 hdc
)
2930 return BeginPath( HDC_32(hdc
) );
2934 /***********************************************************************
2935 * CloseFigure (GDI.513)
2937 BOOL16 WINAPI
CloseFigure16(HDC16 hdc
)
2939 return CloseFigure( HDC_32(hdc
) );
2943 /***********************************************************************
2946 BOOL16 WINAPI
EndPath16(HDC16 hdc
)
2948 return EndPath( HDC_32(hdc
) );
2952 /***********************************************************************
2953 * FillPath (GDI.515)
2955 BOOL16 WINAPI
FillPath16(HDC16 hdc
)
2957 return FillPath( HDC_32(hdc
) );
2961 /*******************************************************************
2962 * FlattenPath (GDI.516)
2964 BOOL16 WINAPI
FlattenPath16(HDC16 hdc
)
2966 return FlattenPath( HDC_32(hdc
) );
2970 /***********************************************************************
2973 INT16 WINAPI
GetPath16(HDC16 hdc
, LPPOINT16 pPoints
, LPBYTE pTypes
, INT16 nSize
)
2975 FIXME("(%d,%p,%p): stub\n",hdc
,pPoints
,pTypes
);
2980 /***********************************************************************
2981 * PathToRegion (GDI.518)
2983 HRGN16 WINAPI
PathToRegion16(HDC16 hdc
)
2985 return HRGN_16( PathToRegion( HDC_32(hdc
) ));
2989 /***********************************************************************
2990 * SelectClipPath (GDI.519)
2992 BOOL16 WINAPI
SelectClipPath16(HDC16 hdc
, INT16 iMode
)
2994 return SelectClipPath( HDC_32(hdc
), iMode
);
2998 /*******************************************************************
2999 * StrokeAndFillPath (GDI.520)
3001 BOOL16 WINAPI
StrokeAndFillPath16(HDC16 hdc
)
3003 return StrokeAndFillPath( HDC_32(hdc
) );
3007 /*******************************************************************
3008 * StrokePath (GDI.521)
3010 BOOL16 WINAPI
StrokePath16(HDC16 hdc
)
3012 return StrokePath( HDC_32(hdc
) );
3016 /*******************************************************************
3017 * WidenPath (GDI.522)
3019 BOOL16 WINAPI
WidenPath16(HDC16 hdc
)
3021 return WidenPath( HDC_32(hdc
) );
3025 /***********************************************************************
3026 * GetArcDirection (GDI.524)
3028 INT16 WINAPI
GetArcDirection16( HDC16 hdc
)
3030 return GetArcDirection( HDC_32(hdc
) );
3034 /***********************************************************************
3035 * SetArcDirection (GDI.525)
3037 INT16 WINAPI
SetArcDirection16( HDC16 hdc
, INT16 nDirection
)
3039 return SetArcDirection( HDC_32(hdc
), (INT
)nDirection
);
3043 /***********************************************************************
3044 * CreateHalftonePalette (GDI.529)
3046 HPALETTE16 WINAPI
CreateHalftonePalette16( HDC16 hdc
)
3048 return HPALETTE_16( CreateHalftonePalette( HDC_32(hdc
) ));
3052 /***********************************************************************
3053 * SetDIBColorTable (GDI.602)
3055 UINT16 WINAPI
SetDIBColorTable16( HDC16 hdc
, UINT16 startpos
, UINT16 entries
, RGBQUAD
*colors
)
3057 return SetDIBColorTable( HDC_32(hdc
), startpos
, entries
, colors
);
3061 /***********************************************************************
3062 * GetDIBColorTable (GDI.603)
3064 UINT16 WINAPI
GetDIBColorTable16( HDC16 hdc
, UINT16 startpos
, UINT16 entries
, RGBQUAD
*colors
)
3066 return GetDIBColorTable( HDC_32(hdc
), startpos
, entries
, colors
);
3070 /***********************************************************************
3071 * GetRegionData (GDI.607)
3073 * FIXME: is LPRGNDATA the same in Win16 and Win32 ?
3075 DWORD WINAPI
GetRegionData16( HRGN16 hrgn
, DWORD count
, LPRGNDATA rgndata
)
3077 return GetRegionData( HRGN_32(hrgn
), count
, rgndata
);
3081 /***********************************************************************
3082 * GdiFreeResources (GDI.609)
3084 WORD WINAPI
GdiFreeResources16( DWORD reserve
)
3086 return 90; /* lie about it, it shouldn't matter */
3090 /***********************************************************************
3091 * GdiSignalProc32 (GDI.610)
3093 WORD WINAPI
GdiSignalProc( UINT uCode
, DWORD dwThreadOrProcessID
,
3094 DWORD dwFlags
, HMODULE16 hModule
)
3100 /***********************************************************************
3101 * GetTextCharset (GDI.612)
3103 UINT16 WINAPI
GetTextCharset16( HDC16 hdc
)
3105 return GetTextCharset( HDC_32(hdc
) );
3109 /*************************************************************************
3110 * GetFontLanguageInfo (GDI.616)
3112 DWORD WINAPI
GetFontLanguageInfo16( HDC16 hdc
)
3114 return GetFontLanguageInfo( HDC_32(hdc
) );
3118 /***********************************************************************
3119 * SetLayout (GDI.1000)
3121 * Sets left->right or right->left text layout flags of a dc.
3123 BOOL16 WINAPI
SetLayout16( HDC16 hdc
, DWORD layout
)
3125 return SetLayout( HDC_32(hdc
), layout
);