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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #include "wine/wingdi16.h"
25 #include "wine/debug.h"
27 WINE_DEFAULT_DEBUG_CHANNEL(gdi);
29 #define HGDIOBJ_32(handle16) ((HGDIOBJ)(ULONG_PTR)(handle16))
30 #define HGDIOBJ_16(handle32) ((HGDIOBJ16)(ULONG_PTR)(handle32))
32 #define HDC_32(hdc16) ((HDC)HGDIOBJ_32(hdc16))
33 #define HRGN_32(hrgn16) ((HRGN)HGDIOBJ_32(hrgn16))
34 #define HBRUSH_32(hbrush16) ((HBRUSH)HGDIOBJ_32(hbrush16))
35 #define HBITMAP_32(hbitmap16) ((HBITMAP)HGDIOBJ_32(hbitmap16))
36 #define HPALETTE_32(hpalette16) ((HPALETTE)HGDIOBJ_32(hpalette16))
38 #define HDC_16(hdc) ((HDC16)HGDIOBJ_16(hdc))
39 #define HPEN_16(hpen) ((HPEN16)HGDIOBJ_16(hpen))
40 #define HRGN_16(hrgn) ((HRGN16)HGDIOBJ_16(hrgn))
41 #define HFONT_16(hfont) ((HFONT16)HGDIOBJ_16(hfont))
42 #define HBRUSH_16(hbrush) ((HBRUSH16)HGDIOBJ_16(hbrush))
43 #define HBITMAP_16(hbitmap) ((HBITMAP16)HGDIOBJ_16(hbitmap))
44 #define HPALETTE_16(hpalette) ((HPALETTE16)HGDIOBJ_16(hpalette))
47 /* convert a LOGFONT16 to a LOGFONTW */
48 static void logfont_16_to_W( const LOGFONT16 *font16, LPLOGFONTW font32 )
50 font32->lfHeight = font16->lfHeight;
51 font32->lfWidth = font16->lfWidth;
52 font32->lfEscapement = font16->lfEscapement;
53 font32->lfOrientation = font16->lfOrientation;
54 font32->lfWeight = font16->lfWeight;
55 font32->lfItalic = font16->lfItalic;
56 font32->lfUnderline = font16->lfUnderline;
57 font32->lfStrikeOut = font16->lfStrikeOut;
58 font32->lfCharSet = font16->lfCharSet;
59 font32->lfOutPrecision = font16->lfOutPrecision;
60 font32->lfClipPrecision = font16->lfClipPrecision;
61 font32->lfQuality = font16->lfQuality;
62 font32->lfPitchAndFamily = font16->lfPitchAndFamily;
63 MultiByteToWideChar( CP_ACP, 0, font16->lfFaceName, -1, font32->lfFaceName, LF_FACESIZE );
64 font32->lfFaceName[LF_FACESIZE-1] = 0;
68 /***********************************************************************
71 COLORREF WINAPI SetBkColor16( HDC16 hdc, COLORREF color )
73 return SetBkColor( HDC_32(hdc), color );
77 /***********************************************************************
80 INT16 WINAPI SetBkMode16( HDC16 hdc, INT16 mode )
82 return SetBkMode( HDC_32(hdc), mode );
86 /***********************************************************************
89 INT16 WINAPI SetMapMode16( HDC16 hdc, INT16 mode )
91 return SetMapMode( HDC_32(hdc), mode );
95 /***********************************************************************
98 INT16 WINAPI SetROP216( HDC16 hdc, INT16 mode )
100 return SetROP2( HDC_32(hdc), mode );
104 /***********************************************************************
107 INT16 WINAPI SetRelAbs16( HDC16 hdc, INT16 mode )
109 return SetRelAbs( HDC_32(hdc), mode );
113 /***********************************************************************
114 * SetPolyFillMode (GDI.6)
116 INT16 WINAPI SetPolyFillMode16( HDC16 hdc, INT16 mode )
118 return SetPolyFillMode( HDC_32(hdc), mode );
122 /***********************************************************************
123 * SetStretchBltMode (GDI.7)
125 INT16 WINAPI SetStretchBltMode16( HDC16 hdc, INT16 mode )
127 return SetStretchBltMode( HDC_32(hdc), mode );
131 /***********************************************************************
132 * SetTextCharacterExtra (GDI.8)
134 INT16 WINAPI SetTextCharacterExtra16( HDC16 hdc, INT16 extra )
136 return SetTextCharacterExtra( HDC_32(hdc), extra );
140 /***********************************************************************
141 * SetTextColor (GDI.9)
143 COLORREF WINAPI SetTextColor16( HDC16 hdc, COLORREF color )
145 return SetTextColor( HDC_32(hdc), color );
149 /***********************************************************************
150 * SetTextJustification (GDI.10)
152 INT16 WINAPI SetTextJustification16( HDC16 hdc, INT16 extra, INT16 breaks )
154 return SetTextJustification( HDC_32(hdc), extra, breaks );
158 /***********************************************************************
159 * SetWindowOrg (GDI.11)
161 DWORD WINAPI SetWindowOrg16( HDC16 hdc, INT16 x, INT16 y )
164 if (!SetWindowOrgEx( HDC_32(hdc), x, y, &pt )) return 0;
165 return MAKELONG( pt.x, pt.y );
169 /***********************************************************************
170 * SetWindowExt (GDI.12)
172 DWORD WINAPI SetWindowExt16( HDC16 hdc, INT16 x, INT16 y )
175 if (!SetWindowExtEx( HDC_32(hdc), x, y, &size )) return 0;
176 return MAKELONG( size.cx, size.cy );
180 /***********************************************************************
181 * SetViewportOrg (GDI.13)
183 DWORD WINAPI SetViewportOrg16( HDC16 hdc, INT16 x, INT16 y )
186 if (!SetViewportOrgEx( HDC_32(hdc), x, y, &pt )) return 0;
187 return MAKELONG( pt.x, pt.y );
191 /***********************************************************************
192 * SetViewportExt (GDI.14)
194 DWORD WINAPI SetViewportExt16( HDC16 hdc, INT16 x, INT16 y )
197 if (!SetViewportExtEx( HDC_32(hdc), x, y, &size )) return 0;
198 return MAKELONG( size.cx, size.cy );
202 /***********************************************************************
203 * OffsetWindowOrg (GDI.15)
205 DWORD WINAPI OffsetWindowOrg16( HDC16 hdc, INT16 x, INT16 y )
208 if (!OffsetWindowOrgEx( HDC_32(hdc), x, y, &pt )) return 0;
209 return MAKELONG( pt.x, pt.y );
213 /***********************************************************************
214 * ScaleWindowExt (GDI.16)
216 DWORD WINAPI ScaleWindowExt16( HDC16 hdc, INT16 xNum, INT16 xDenom,
217 INT16 yNum, INT16 yDenom )
220 if (!ScaleWindowExtEx( HDC_32(hdc), xNum, xDenom, yNum, yDenom, &size ))
222 return MAKELONG( size.cx, size.cy );
226 /***********************************************************************
227 * OffsetViewportOrg (GDI.17)
229 DWORD WINAPI OffsetViewportOrg16( HDC16 hdc, INT16 x, INT16 y )
232 if (!OffsetViewportOrgEx( HDC_32(hdc), x, y, &pt )) return 0;
233 return MAKELONG( pt.x, pt.y );
237 /***********************************************************************
238 * ScaleViewportExt (GDI.18)
240 DWORD WINAPI ScaleViewportExt16( HDC16 hdc, INT16 xNum, INT16 xDenom,
241 INT16 yNum, INT16 yDenom )
244 if (!ScaleViewportExtEx( HDC_32(hdc), xNum, xDenom, yNum, yDenom, &size ))
246 return MAKELONG( size.cx, size.cy );
250 /***********************************************************************
253 BOOL16 WINAPI LineTo16( HDC16 hdc, INT16 x, INT16 y )
255 return LineTo( HDC_32(hdc), x, y );
259 /***********************************************************************
262 DWORD WINAPI MoveTo16( HDC16 hdc, INT16 x, INT16 y )
266 if (!MoveToEx( HDC_32(hdc), x, y, &pt )) return 0;
267 return MAKELONG(pt.x,pt.y);
271 /***********************************************************************
272 * ExcludeClipRect (GDI.21)
274 INT16 WINAPI ExcludeClipRect16( HDC16 hdc, INT16 left, INT16 top,
275 INT16 right, INT16 bottom )
277 return ExcludeClipRect( HDC_32(hdc), left, top, right, bottom );
281 /***********************************************************************
282 * IntersectClipRect (GDI.22)
284 INT16 WINAPI IntersectClipRect16( HDC16 hdc, INT16 left, INT16 top,
285 INT16 right, INT16 bottom )
287 return IntersectClipRect( HDC_32(hdc), left, top, right, bottom );
291 /***********************************************************************
294 BOOL16 WINAPI Arc16( HDC16 hdc, INT16 left, INT16 top, INT16 right,
295 INT16 bottom, INT16 xstart, INT16 ystart,
296 INT16 xend, INT16 yend )
298 return Arc( HDC_32(hdc), left, top, right, bottom, xstart, ystart, xend, yend );
302 /***********************************************************************
305 BOOL16 WINAPI Ellipse16( HDC16 hdc, INT16 left, INT16 top,
306 INT16 right, INT16 bottom )
308 return Ellipse( HDC_32(hdc), left, top, right, bottom );
312 /**********************************************************************
315 BOOL16 WINAPI FloodFill16( HDC16 hdc, INT16 x, INT16 y, COLORREF color )
317 return ExtFloodFill( HDC_32(hdc), x, y, color, FLOODFILLBORDER );
321 /***********************************************************************
324 BOOL16 WINAPI Pie16( HDC16 hdc, INT16 left, INT16 top,
325 INT16 right, INT16 bottom, INT16 xstart, INT16 ystart,
326 INT16 xend, INT16 yend )
328 return Pie( HDC_32(hdc), left, top, right, bottom, xstart, ystart, xend, yend );
332 /***********************************************************************
335 BOOL16 WINAPI Rectangle16( HDC16 hdc, INT16 left, INT16 top,
336 INT16 right, INT16 bottom )
338 return Rectangle( HDC_32(hdc), left, top, right, bottom );
342 /***********************************************************************
345 BOOL16 WINAPI RoundRect16( HDC16 hdc, INT16 left, INT16 top, INT16 right,
346 INT16 bottom, INT16 ell_width, INT16 ell_height )
348 return RoundRect( HDC_32(hdc), left, top, right, bottom, ell_width, ell_height );
352 /***********************************************************************
355 BOOL16 WINAPI PatBlt16( HDC16 hdc, INT16 left, INT16 top,
356 INT16 width, INT16 height, DWORD rop)
358 return PatBlt( HDC_32(hdc), left, top, width, height, rop );
362 /***********************************************************************
365 INT16 WINAPI SaveDC16( HDC16 hdc )
367 return SaveDC( HDC_32(hdc) );
371 /***********************************************************************
374 COLORREF WINAPI SetPixel16( HDC16 hdc, INT16 x, INT16 y, COLORREF color )
376 return SetPixel( HDC_32(hdc), x, y, color );
380 /***********************************************************************
381 * OffsetClipRgn (GDI.32)
383 INT16 WINAPI OffsetClipRgn16( HDC16 hdc, INT16 x, INT16 y )
385 return OffsetClipRgn( HDC_32(hdc), x, y );
389 /***********************************************************************
392 BOOL16 WINAPI TextOut16( HDC16 hdc, INT16 x, INT16 y, LPCSTR str, INT16 count )
394 return TextOutA( HDC_32(hdc), x, y, str, count );
398 /***********************************************************************
401 BOOL16 WINAPI BitBlt16( HDC16 hdcDst, INT16 xDst, INT16 yDst, INT16 width,
402 INT16 height, HDC16 hdcSrc, INT16 xSrc, INT16 ySrc,
405 return BitBlt( HDC_32(hdcDst), xDst, yDst, width, height, HDC_32(hdcSrc), xSrc, ySrc, rop );
409 /***********************************************************************
410 * StretchBlt (GDI.35)
412 BOOL16 WINAPI StretchBlt16( HDC16 hdcDst, INT16 xDst, INT16 yDst,
413 INT16 widthDst, INT16 heightDst,
414 HDC16 hdcSrc, INT16 xSrc, INT16 ySrc,
415 INT16 widthSrc, INT16 heightSrc, DWORD rop )
417 return StretchBlt( HDC_32(hdcDst), xDst, yDst, widthDst, heightDst,
418 HDC_32(hdcSrc), xSrc, ySrc, widthSrc, heightSrc, rop );
422 /**********************************************************************
425 BOOL16 WINAPI Polygon16( HDC16 hdc, const POINT16* pt, INT16 count )
429 LPPOINT pt32 = (LPPOINT)HeapAlloc( GetProcessHeap(), 0,
430 count*sizeof(POINT) );
432 if (!pt32) return FALSE;
433 for (i=count;i--;) CONV_POINT16TO32(&(pt[i]),&(pt32[i]));
434 ret = Polygon(HDC_32(hdc),pt32,count);
435 HeapFree( GetProcessHeap(), 0, pt32 );
440 /**********************************************************************
443 BOOL16 WINAPI Polyline16( HDC16 hdc, const POINT16* pt, INT16 count )
447 LPPOINT pt32 = (LPPOINT)HeapAlloc( GetProcessHeap(), 0,
448 count*sizeof(POINT) );
450 if (!pt32) return FALSE;
451 for (i=count;i--;) CONV_POINT16TO32(&(pt[i]),&(pt32[i]));
452 ret = Polyline(HDC_32(hdc),pt32,count);
453 HeapFree( GetProcessHeap(), 0, pt32 );
458 /***********************************************************************
461 INT16 WINAPI Escape16( HDC16 hdc, INT16 escape, INT16 in_count, SEGPTR in_data, LPVOID out_data )
467 /* Escape(hdc,CLIP_TO_PATH,LPINT16,NULL) */
468 /* Escape(hdc,DRAFTMODE,LPINT16,NULL) */
469 /* Escape(hdc,ENUMPAPERBINS,LPINT16,LPSTR); */
470 /* Escape(hdc,EPSPRINTING,LPINT16,NULL) */
471 /* Escape(hdc,EXT_DEVICE_CAPS,LPINT16,LPDWORD) */
472 /* Escape(hdc,GETCOLORTABLE,LPINT16,LPDWORD) */
473 /* Escape(hdc,MOUSETRAILS,LPINT16,NULL) */
474 /* Escape(hdc,POSTSCRIPT_IGNORE,LPINT16,NULL) */
475 /* Escape(hdc,QUERYESCSUPPORT,LPINT16,NULL) */
476 /* Escape(hdc,SET_ARC_DIRECTION,LPINT16,NULL) */
477 /* Escape(hdc,SET_POLY_MODE,LPINT16,NULL) */
478 /* Escape(hdc,SET_SCREEN_ANGLE,LPINT16,NULL) */
479 /* Escape(hdc,SET_SPREAD,LPINT16,NULL) */
484 case EXT_DEVICE_CAPS:
487 case POSTSCRIPT_IGNORE:
488 case QUERYESCSUPPORT:
489 case SET_ARC_DIRECTION:
491 case SET_SCREEN_ANGLE:
494 INT16 *ptr = MapSL(in_data);
496 return Escape( HDC_32(hdc), escape, sizeof(data), (LPCSTR)&data, out_data );
499 /* Escape(hdc,ENABLEDUPLEX,LPUINT16,NULL) */
502 UINT16 *ptr = MapSL(in_data);
504 return Escape( HDC_32(hdc), escape, sizeof(data), (LPCSTR)&data, NULL );
507 /* Escape(hdc,GETPHYSPAGESIZE,NULL,LPPOINT16) */
508 /* Escape(hdc,GETPRINTINGOFFSET,NULL,LPPOINT16) */
509 /* Escape(hdc,GETSCALINGFACTOR,NULL,LPPOINT16) */
510 case GETPHYSPAGESIZE:
511 case GETPRINTINGOFFSET:
512 case GETSCALINGFACTOR:
514 POINT16 *ptr = out_data;
516 ret = Escape( HDC_32(hdc), escape, 0, NULL, &pt32 );
522 /* Escape(hdc,ENABLEPAIRKERNING,LPINT16,LPINT16); */
523 /* Escape(hdc,ENABLERELATIVEWIDTHS,LPINT16,LPINT16); */
524 /* Escape(hdc,SETCOPYCOUNT,LPINT16,LPINT16) */
525 /* Escape(hdc,SETKERNTRACK,LPINT16,LPINT16) */
526 /* Escape(hdc,SETLINECAP,LPINT16,LPINT16) */
527 /* Escape(hdc,SETLINEJOIN,LPINT16,LPINT16) */
528 /* Escape(hdc,SETMITERLIMIT,LPINT16,LPINT16) */
529 case ENABLEPAIRKERNING:
530 case ENABLERELATIVEWIDTHS:
537 INT16 *new = MapSL(in_data);
538 INT16 *old = out_data;
540 ret = Escape( HDC_32(hdc), escape, sizeof(in), (LPCSTR)&in, &out );
545 /* Escape(hdc,SETABORTPROC,ABORTPROC,NULL); */
547 return SetAbortProc16( hdc, (ABORTPROC16)in_data );
549 /* Escape(hdc,STARTDOC,LPSTR,LPDOCINFO16);
550 * lpvOutData is actually a pointer to the DocInfo structure and used as
551 * a second input parameter */
555 ret = StartDoc16( hdc, out_data );
556 if (ret > 0) ret = StartPage( HDC_32(hdc) );
559 return Escape( HDC_32(hdc), escape, in_count, MapSL(in_data), NULL );
561 /* Escape(hdc,SET_BOUNDS,LPRECT16,NULL); */
562 /* Escape(hdc,SET_CLIP_BOX,LPRECT16,NULL); */
566 RECT16 *rc16 = MapSL(in_data);
568 rc.left = rc16->left;
570 rc.right = rc16->right;
571 rc.bottom = rc16->bottom;
572 return Escape( HDC_32(hdc), escape, sizeof(rc), (LPCSTR)&rc, NULL );
575 /* Escape(hdc,NEXTBAND,NULL,LPRECT16); */
579 RECT16 *rc16 = out_data;
580 ret = Escape( HDC_32(hdc), escape, 0, NULL, &rc );
581 rc16->left = rc.left;
583 rc16->right = rc.right;
584 rc16->bottom = rc.bottom;
588 /* Escape(hdc,ABORTDOC,NULL,NULL); */
589 /* Escape(hdc,BANDINFO,BANDINFOSTRUCT*,BANDINFOSTRUCT*); */
590 /* Escape(hdc,BEGIN_PATH,NULL,NULL); */
591 /* Escape(hdc,DRAWPATTERNRECT,PRECT_STRUCT*,NULL); */
592 /* Escape(hdc,ENDDOC,NULL,NULL); */
593 /* Escape(hdc,END_PATH,PATHINFO,NULL); */
594 /* Escape(hdc,EXTTEXTOUT,EXTTEXT_STRUCT*,NULL); */
595 /* Escape(hdc,FLUSHOUTPUT,NULL,NULL); */
596 /* Escape(hdc,GETFACENAME,NULL,LPSTR); */
597 /* Escape(hdc,GETPAIRKERNTABLE,NULL,KERNPAIR*); */
598 /* Escape(hdc,GETSETPAPERBINS,BinInfo*,BinInfo*); */
599 /* Escape(hdc,GETSETPRINTORIENT,ORIENT*,NULL); */
600 /* Escape(hdc,GETSETSCREENPARAMS,SCREENPARAMS*,SCREENPARAMS*); */
601 /* Escape(hdc,GETTECHNOLOGY,NULL,LPSTR); */
602 /* Escape(hdc,GETTRACKKERNTABLE,NULL,KERNTRACK*); */
603 /* Escape(hdc,MFCOMMENT,LPSTR,NULL); */
604 /* Escape(hdc,NEWFRAME,NULL,NULL); */
605 /* Escape(hdc,PASSTHROUGH,LPSTR,NULL); */
606 /* Escape(hdc,RESTORE_CTM,NULL,NULL); */
607 /* Escape(hdc,SAVE_CTM,NULL,NULL); */
608 /* Escape(hdc,SETALLJUSTVALUES,EXTTEXTDATA*,NULL); */
609 /* Escape(hdc,SETCOLORTABLE,COLORTABLE_STRUCT*,LPDWORD); */
610 /* Escape(hdc,SET_BACKGROUND_COLOR,LPDWORD,LPDWORD); */
611 /* Escape(hdc,TRANSFORM_CTM,LPSTR,NULL); */
615 case DRAWPATTERNRECT:
621 case GETPAIRKERNTABLE:
622 case GETSETPAPERBINS:
623 case GETSETPRINTORIENT:
624 case GETSETSCREENPARAMS:
626 case GETTRACKKERNTABLE:
632 case SETALLJUSTVALUES:
634 case SET_BACKGROUND_COLOR:
636 /* pass it unmodified to the 32-bit function */
637 return Escape( HDC_32(hdc), escape, in_count, MapSL(in_data), out_data );
639 /* Escape(hdc,ENUMPAPERMETRICS,LPINT16,LPRECT16); */
640 /* Escape(hdc,GETEXTENDEDTEXTMETRICS,LPUINT16,EXTTEXTMETRIC*); */
641 /* Escape(hdc,GETEXTENTTABLE,LPSTR,LPINT16); */
642 /* Escape(hdc,GETSETPAPERMETRICS,LPRECT16,LPRECT16); */
643 /* Escape(hdc,GETVECTORBRUSHSIZE,LPLOGBRUSH16,LPPOINT16); */
644 /* Escape(hdc,GETVECTORPENSIZE,LPLOGPEN16,LPPOINT16); */
645 case ENUMPAPERMETRICS:
646 case GETEXTENDEDTEXTMETRICS:
648 case GETSETPAPERMETRICS:
649 case GETVECTORBRUSHSIZE:
650 case GETVECTORPENSIZE:
652 FIXME("unknown/unsupported 16-bit escape %x (%d,%p,%p\n",
653 escape, in_count, MapSL(in_data), out_data );
654 return Escape( HDC_32(hdc), escape, in_count, MapSL(in_data), out_data );
659 /***********************************************************************
662 BOOL16 WINAPI RestoreDC16( HDC16 hdc, INT16 level )
664 return RestoreDC( HDC_32(hdc), level );
668 /***********************************************************************
671 BOOL16 WINAPI FillRgn16( HDC16 hdc, HRGN16 hrgn, HBRUSH16 hbrush )
673 return FillRgn( HDC_32(hdc), HRGN_32(hrgn), HBRUSH_32(hbrush) );
677 /***********************************************************************
680 BOOL16 WINAPI FrameRgn16( HDC16 hdc, HRGN16 hrgn, HBRUSH16 hbrush,
681 INT16 nWidth, INT16 nHeight )
683 return FrameRgn( HDC_32(hdc), HRGN_32(hrgn), HBRUSH_32(hbrush), nWidth, nHeight );
687 /***********************************************************************
690 BOOL16 WINAPI InvertRgn16( HDC16 hdc, HRGN16 hrgn )
692 return InvertRgn( HDC_32(hdc), HRGN_32(hrgn) );
696 /***********************************************************************
699 BOOL16 WINAPI PaintRgn16( HDC16 hdc, HRGN16 hrgn )
701 return PaintRgn( HDC_32(hdc), HRGN_32(hrgn) );
705 /***********************************************************************
706 * SelectClipRgn (GDI.44)
708 INT16 WINAPI SelectClipRgn16( HDC16 hdc, HRGN16 hrgn )
710 return SelectClipRgn( HDC_32(hdc), HRGN_32(hrgn) );
714 /***********************************************************************
715 * SelectObject (GDI.45)
717 HGDIOBJ16 WINAPI SelectObject16( HDC16 hdc, HGDIOBJ16 handle )
719 return HGDIOBJ_16( SelectObject( HDC_32(hdc), HGDIOBJ_32(handle) ) );
723 /***********************************************************************
724 * CombineRgn (GDI.47)
726 INT16 WINAPI CombineRgn16(HRGN16 hDest, HRGN16 hSrc1, HRGN16 hSrc2, INT16 mode)
728 return CombineRgn( HRGN_32(hDest), HRGN_32(hSrc1), HRGN_32(hSrc2), mode );
732 /***********************************************************************
733 * CreateBitmap (GDI.48)
735 HBITMAP16 WINAPI CreateBitmap16( INT16 width, INT16 height, UINT16 planes,
736 UINT16 bpp, LPCVOID bits )
738 return HBITMAP_16( CreateBitmap( width, height, planes, bpp, bits ) );
742 /***********************************************************************
743 * CreateBitmapIndirect (GDI.49)
745 HBITMAP16 WINAPI CreateBitmapIndirect16( const BITMAP16 * bmp )
747 return CreateBitmap16( bmp->bmWidth, bmp->bmHeight, bmp->bmPlanes,
748 bmp->bmBitsPixel, MapSL( bmp->bmBits ) );
752 /***********************************************************************
753 * CreateCompatibleBitmap (GDI.51)
755 HBITMAP16 WINAPI CreateCompatibleBitmap16( HDC16 hdc, INT16 width, INT16 height )
757 return HBITMAP_16( CreateCompatibleBitmap( HDC_32(hdc), width, height ) );
761 /***********************************************************************
762 * CreateCompatibleDC (GDI.52)
764 HDC16 WINAPI CreateCompatibleDC16( HDC16 hdc )
766 return HDC_16( CreateCompatibleDC( HDC_32(hdc) ) );
770 /***********************************************************************
773 HDC16 WINAPI CreateDC16( LPCSTR driver, LPCSTR device, LPCSTR output,
774 const DEVMODEA *initData )
776 return HDC_16( CreateDCA( driver, device, output, initData ) );
780 /***********************************************************************
781 * CreateEllipticRgn (GDI.54)
783 HRGN16 WINAPI CreateEllipticRgn16( INT16 left, INT16 top, INT16 right, INT16 bottom )
785 return HRGN_16( CreateEllipticRgn( left, top, right, bottom ) );
789 /***********************************************************************
790 * CreateEllipticRgnIndirect (GDI.55)
792 HRGN16 WINAPI CreateEllipticRgnIndirect16( const RECT16 *rect )
794 return HRGN_16( CreateEllipticRgn( rect->left, rect->top, rect->right, rect->bottom ) );
798 /***********************************************************************
799 * CreateFontIndirect (GDI.57)
801 HFONT16 WINAPI CreateFontIndirect16( const LOGFONT16 *plf16 )
808 logfont_16_to_W( plf16, &lfW );
809 ret = CreateFontIndirectW( &lfW );
811 else ret = CreateFontIndirectW( NULL );
812 return HFONT_16(ret);
816 /***********************************************************************
817 * CreateHatchBrush (GDI.58)
819 HBRUSH16 WINAPI CreateHatchBrush16( INT16 style, COLORREF color )
821 return HBRUSH_16( CreateHatchBrush( style, color ) );
825 /***********************************************************************
826 * CreatePatternBrush (GDI.60)
828 HBRUSH16 WINAPI CreatePatternBrush16( HBITMAP16 hbitmap )
830 return HBRUSH_16( CreatePatternBrush( HBITMAP_32(hbitmap) ));
834 /***********************************************************************
837 HPEN16 WINAPI CreatePen16( INT16 style, INT16 width, COLORREF color )
841 logpen.lopnStyle = style;
842 logpen.lopnWidth.x = width;
843 logpen.lopnWidth.y = 0;
844 logpen.lopnColor = color;
845 return HPEN_16( CreatePenIndirect( &logpen ) );
849 /***********************************************************************
850 * CreatePenIndirect (GDI.62)
852 HPEN16 WINAPI CreatePenIndirect16( const LOGPEN16 * pen )
856 if (pen->lopnStyle > PS_INSIDEFRAME) return 0;
857 logpen.lopnStyle = pen->lopnStyle;
858 logpen.lopnWidth.x = pen->lopnWidth.x;
859 logpen.lopnWidth.y = pen->lopnWidth.y;
860 logpen.lopnColor = pen->lopnColor;
861 return HPEN_16( CreatePenIndirect( &logpen ) );
865 /***********************************************************************
866 * CreatePolygonRgn (GDI.63)
868 HRGN16 WINAPI CreatePolygonRgn16( const POINT16 * points, INT16 count, INT16 mode )
870 return CreatePolyPolygonRgn16( points, &count, 1, mode );
874 /***********************************************************************
875 * CreateRectRgn (GDI.64)
877 * NOTE: cf. SetRectRgn16
879 HRGN16 WINAPI CreateRectRgn16( INT16 left, INT16 top, INT16 right, INT16 bottom )
883 if (left < right) hrgn = CreateRectRgn( left, top, right, bottom );
884 else hrgn = CreateRectRgn( 0, 0, 0, 0 );
885 return HRGN_16(hrgn);
889 /***********************************************************************
890 * CreateRectRgnIndirect (GDI.65)
892 HRGN16 WINAPI CreateRectRgnIndirect16( const RECT16* rect )
894 return CreateRectRgn16( rect->left, rect->top, rect->right, rect->bottom );
898 /***********************************************************************
899 * CreateSolidBrush (GDI.66)
901 HBRUSH16 WINAPI CreateSolidBrush16( COLORREF color )
903 return HBRUSH_16( CreateSolidBrush( color ) );
907 /***********************************************************************
910 BOOL16 WINAPI DeleteDC16( HDC16 hdc )
912 return DeleteDC( HDC_32(hdc) );
916 /***********************************************************************
917 * DeleteObject (GDI.69)
918 * SysDeleteObject (GDI.605)
920 BOOL16 WINAPI DeleteObject16( HGDIOBJ16 obj )
922 return DeleteObject( HGDIOBJ_32(obj) );
926 /***********************************************************************
929 BOOL16 WINAPI EqualRgn16( HRGN16 rgn1, HRGN16 rgn2 )
931 return EqualRgn( HRGN_32(rgn1), HRGN_32(rgn2) );
935 /***********************************************************************
936 * GetBitmapBits (GDI.74)
938 LONG WINAPI GetBitmapBits16( HBITMAP16 hbitmap, LONG count, LPVOID buffer )
940 return GetBitmapBits( HBITMAP_32(hbitmap), count, buffer );
944 /***********************************************************************
945 * GetBkColor (GDI.75)
947 COLORREF WINAPI GetBkColor16( HDC16 hdc )
949 return GetBkColor( HDC_32(hdc) );
953 /***********************************************************************
956 INT16 WINAPI GetBkMode16( HDC16 hdc )
958 return GetBkMode( HDC_32(hdc) );
962 /***********************************************************************
963 * GetClipBox (GDI.77)
965 INT16 WINAPI GetClipBox16( HDC16 hdc, LPRECT16 rect )
968 INT ret = GetClipBox( HDC_32(hdc), &rect32 );
972 rect->left = rect32.left;
973 rect->top = rect32.top;
974 rect->right = rect32.right;
975 rect->bottom = rect32.bottom;
981 /***********************************************************************
982 * GetCurrentPosition (GDI.78)
984 DWORD WINAPI GetCurrentPosition16( HDC16 hdc )
987 if (!GetCurrentPositionEx( HDC_32(hdc), &pt32 )) return 0;
988 return MAKELONG( pt32.x, pt32.y );
992 /***********************************************************************
995 DWORD WINAPI GetDCOrg16( HDC16 hdc )
998 if (GetDCOrgEx( HDC_32(hdc), &pt )) return MAKELONG( pt.x, pt.y );
1003 /***********************************************************************
1004 * GetDeviceCaps (GDI.80)
1006 INT16 WINAPI GetDeviceCaps16( HDC16 hdc, INT16 cap )
1008 INT16 ret = GetDeviceCaps( HDC_32(hdc), cap );
1009 /* some apps don't expect -1 and think it's a B&W screen */
1010 if ((cap == NUMCOLORS) && (ret == -1)) ret = 2048;
1015 /***********************************************************************
1016 * GetMapMode (GDI.81)
1018 INT16 WINAPI GetMapMode16( HDC16 hdc )
1020 return GetMapMode( HDC_32(hdc) );
1024 /***********************************************************************
1027 COLORREF WINAPI GetPixel16( HDC16 hdc, INT16 x, INT16 y )
1029 return GetPixel( HDC_32(hdc), x, y );
1033 /***********************************************************************
1034 * GetPolyFillMode (GDI.84)
1036 INT16 WINAPI GetPolyFillMode16( HDC16 hdc )
1038 return GetPolyFillMode( HDC_32(hdc) );
1042 /***********************************************************************
1045 INT16 WINAPI GetROP216( HDC16 hdc )
1047 return GetROP2( HDC_32(hdc) );
1051 /***********************************************************************
1052 * GetRelAbs (GDI.86)
1054 INT16 WINAPI GetRelAbs16( HDC16 hdc )
1056 return GetRelAbs( HDC_32(hdc), 0 );
1060 /***********************************************************************
1061 * GetStockObject (GDI.87)
1063 HGDIOBJ16 WINAPI GetStockObject16( INT16 obj )
1065 return HGDIOBJ_16( GetStockObject( obj ) );
1069 /***********************************************************************
1070 * GetStretchBltMode (GDI.88)
1072 INT16 WINAPI GetStretchBltMode16( HDC16 hdc )
1074 return GetStretchBltMode( HDC_32(hdc) );
1078 /***********************************************************************
1079 * GetTextCharacterExtra (GDI.89)
1081 INT16 WINAPI GetTextCharacterExtra16( HDC16 hdc )
1083 return GetTextCharacterExtra( HDC_32(hdc) );
1087 /***********************************************************************
1088 * GetTextColor (GDI.90)
1090 COLORREF WINAPI GetTextColor16( HDC16 hdc )
1092 return GetTextColor( HDC_32(hdc) );
1096 /***********************************************************************
1097 * GetTextExtent (GDI.91)
1099 DWORD WINAPI GetTextExtent16( HDC16 hdc, LPCSTR str, INT16 count )
1102 if (!GetTextExtentPoint32A( HDC_32(hdc), str, count, &size )) return 0;
1103 return MAKELONG( size.cx, size.cy );
1107 /***********************************************************************
1108 * GetTextFace (GDI.92)
1110 INT16 WINAPI GetTextFace16( HDC16 hdc, INT16 count, LPSTR name )
1112 return GetTextFaceA( HDC_32(hdc), count, name );
1116 /***********************************************************************
1117 * GetTextMetrics (GDI.93)
1119 BOOL16 WINAPI GetTextMetrics16( HDC16 hdc, TEXTMETRIC16 *tm )
1123 if (!GetTextMetricsW( HDC_32(hdc), &tm32 )) return FALSE;
1125 tm->tmHeight = tm32.tmHeight;
1126 tm->tmAscent = tm32.tmAscent;
1127 tm->tmDescent = tm32.tmDescent;
1128 tm->tmInternalLeading = tm32.tmInternalLeading;
1129 tm->tmExternalLeading = tm32.tmExternalLeading;
1130 tm->tmAveCharWidth = tm32.tmAveCharWidth;
1131 tm->tmMaxCharWidth = tm32.tmMaxCharWidth;
1132 tm->tmWeight = tm32.tmWeight;
1133 tm->tmOverhang = tm32.tmOverhang;
1134 tm->tmDigitizedAspectX = tm32.tmDigitizedAspectX;
1135 tm->tmDigitizedAspectY = tm32.tmDigitizedAspectY;
1136 tm->tmFirstChar = tm32.tmFirstChar;
1137 tm->tmLastChar = tm32.tmLastChar;
1138 tm->tmDefaultChar = tm32.tmDefaultChar;
1139 tm->tmBreakChar = tm32.tmBreakChar;
1140 tm->tmItalic = tm32.tmItalic;
1141 tm->tmUnderlined = tm32.tmUnderlined;
1142 tm->tmStruckOut = tm32.tmStruckOut;
1143 tm->tmPitchAndFamily = tm32.tmPitchAndFamily;
1144 tm->tmCharSet = tm32.tmCharSet;
1149 /***********************************************************************
1150 * GetViewportExt (GDI.94)
1152 DWORD WINAPI GetViewportExt16( HDC16 hdc )
1155 if (!GetViewportExtEx( HDC_32(hdc), &size )) return 0;
1156 return MAKELONG( size.cx, size.cy );
1160 /***********************************************************************
1161 * GetViewportOrg (GDI.95)
1163 DWORD WINAPI GetViewportOrg16( HDC16 hdc )
1166 if (!GetViewportOrgEx( HDC_32(hdc), &pt )) return 0;
1167 return MAKELONG( pt.x, pt.y );
1171 /***********************************************************************
1172 * GetWindowExt (GDI.96)
1174 DWORD WINAPI GetWindowExt16( HDC16 hdc )
1177 if (!GetWindowExtEx( HDC_32(hdc), &size )) return 0;
1178 return MAKELONG( size.cx, size.cy );
1182 /***********************************************************************
1183 * GetWindowOrg (GDI.97)
1185 DWORD WINAPI GetWindowOrg16( HDC16 hdc )
1188 if (!GetWindowOrgEx( HDC_32(hdc), &pt )) return 0;
1189 return MAKELONG( pt.x, pt.y );
1193 /***********************************************************************
1194 * OffsetRgn (GDI.101)
1196 INT16 WINAPI OffsetRgn16( HRGN16 hrgn, INT16 x, INT16 y )
1198 return OffsetRgn( HRGN_32(hrgn), x, y );
1202 /***********************************************************************
1203 * PtVisible (GDI.103)
1205 BOOL16 WINAPI PtVisible16( HDC16 hdc, INT16 x, INT16 y )
1207 return PtVisible( HDC_32(hdc), x, y );
1211 /***********************************************************************
1212 * SetBitmapBits (GDI.106)
1214 LONG WINAPI SetBitmapBits16( HBITMAP16 hbitmap, LONG count, LPCVOID buffer )
1216 return SetBitmapBits( HBITMAP_32(hbitmap), count, buffer );
1220 /***********************************************************************
1221 * AddFontResource (GDI.119)
1223 INT16 WINAPI AddFontResource16( LPCSTR filename )
1225 return AddFontResourceA( filename );
1229 /***********************************************************************
1232 * Disables GDI, switches back to text mode.
1233 * We don't have to do anything here,
1234 * just let console support handle everything
1236 void WINAPI Death16(HDC16 hdc)
1238 MESSAGE("Death(%04x) called. Application enters text mode...\n", hdc);
1242 /***********************************************************************
1243 * Resurrection (GDI.122)
1245 * Restores GDI functionality
1247 void WINAPI Resurrection16(HDC16 hdc,
1248 WORD w1, WORD w2, WORD w3, WORD w4, WORD w5, WORD w6)
1250 MESSAGE("Resurrection(%04x, %04x, %04x, %04x, %04x, %04x, %04x) called. Application left text mode.\n",
1251 hdc, w1, w2, w3, w4, w5, w6);
1255 /**********************************************************************
1256 * CreateMetaFile (GDI.125)
1257 * CreateMetaFile16 (GDI32.@)
1259 HDC16 WINAPI CreateMetaFile16( LPCSTR filename )
1261 return HDC_16( CreateMetaFileA( filename ) );
1265 /***********************************************************************
1268 INT16 WINAPI MulDiv16( INT16 nMultiplicand, INT16 nMultiplier, INT16 nDivisor)
1271 if (!nDivisor) return -32768;
1272 /* We want to deal with a positive divisor to simplify the logic. */
1275 nMultiplicand = - nMultiplicand;
1276 nDivisor = -nDivisor;
1278 /* If the result is positive, we "add" to round. else,
1279 * we subtract to round. */
1280 if ( ( (nMultiplicand < 0) && (nMultiplier < 0) ) ||
1281 ( (nMultiplicand >= 0) && (nMultiplier >= 0) ) )
1282 ret = (((int)nMultiplicand * nMultiplier) + (nDivisor/2)) / nDivisor;
1284 ret = (((int)nMultiplicand * nMultiplier) - (nDivisor/2)) / nDivisor;
1285 if ((ret > 32767) || (ret < -32767)) return -32768;
1290 /***********************************************************************
1291 * GetRgnBox (GDI.134)
1293 INT16 WINAPI GetRgnBox16( HRGN16 hrgn, LPRECT16 rect )
1296 INT16 ret = GetRgnBox( HRGN_32(hrgn), &r );
1297 CONV_RECT32TO16( &r, rect );
1302 /***********************************************************************
1303 * RemoveFontResource (GDI.136)
1305 BOOL16 WINAPI RemoveFontResource16( LPCSTR str )
1307 return RemoveFontResourceA(str);
1311 /***********************************************************************
1312 * SetBrushOrg (GDI.148)
1314 DWORD WINAPI SetBrushOrg16( HDC16 hdc, INT16 x, INT16 y )
1318 if (!SetBrushOrgEx( HDC_32(hdc), x, y, &pt )) return 0;
1319 return MAKELONG( pt.x, pt.y );
1323 /***********************************************************************
1324 * GetBrushOrg (GDI.149)
1326 DWORD WINAPI GetBrushOrg16( HDC16 hdc )
1329 if (!GetBrushOrgEx( HDC_32(hdc), &pt )) return 0;
1330 return MAKELONG( pt.x, pt.y );
1334 /***********************************************************************
1335 * UnrealizeObject (GDI.150)
1337 BOOL16 WINAPI UnrealizeObject16( HGDIOBJ16 obj )
1339 return UnrealizeObject( HGDIOBJ_32(obj) );
1343 /***********************************************************************
1344 * CreateIC (GDI.153)
1346 HDC16 WINAPI CreateIC16( LPCSTR driver, LPCSTR device, LPCSTR output,
1347 const DEVMODEA* initData )
1349 return HDC_16( CreateICA( driver, device, output, initData ) );
1353 /***********************************************************************
1354 * GetNearestColor (GDI.154)
1356 COLORREF WINAPI GetNearestColor16( HDC16 hdc, COLORREF color )
1358 return GetNearestColor( HDC_32(hdc), color );
1362 /***********************************************************************
1363 * CreateDiscardableBitmap (GDI.156)
1365 HBITMAP16 WINAPI CreateDiscardableBitmap16( HDC16 hdc, INT16 width, INT16 height )
1367 return HBITMAP_16( CreateDiscardableBitmap( HDC_32(hdc), width, height ) );
1371 /***********************************************************************
1372 * PtInRegion (GDI.161)
1374 BOOL16 WINAPI PtInRegion16( HRGN16 hrgn, INT16 x, INT16 y )
1376 return PtInRegion( HRGN_32(hrgn), x, y );
1380 /***********************************************************************
1381 * GetBitmapDimension (GDI.162)
1383 DWORD WINAPI GetBitmapDimension16( HBITMAP16 hbitmap )
1386 if (!GetBitmapDimensionEx16( hbitmap, &size )) return 0;
1387 return MAKELONG( size.cx, size.cy );
1391 /***********************************************************************
1392 * SetBitmapDimension (GDI.163)
1394 DWORD WINAPI SetBitmapDimension16( HBITMAP16 hbitmap, INT16 x, INT16 y )
1397 if (!SetBitmapDimensionEx16( hbitmap, x, y, &size )) return 0;
1398 return MAKELONG( size.cx, size.cy );
1402 /***********************************************************************
1403 * SetRectRgn (GDI.172)
1405 * NOTE: Win 3.1 sets region to empty if left > right
1407 void WINAPI SetRectRgn16( HRGN16 hrgn, INT16 left, INT16 top, INT16 right, INT16 bottom )
1409 if (left < right) SetRectRgn( HRGN_32(hrgn), left, top, right, bottom );
1410 else SetRectRgn( HRGN_32(hrgn), 0, 0, 0, 0 );
1414 /***********************************************************************
1415 * GetCharABCWidths (GDI.307)
1417 BOOL16 WINAPI GetCharABCWidths16( HDC16 hdc, UINT16 firstChar, UINT16 lastChar, LPABC16 abc )
1421 LPABC abc32 = HeapAlloc( GetProcessHeap(), 0, sizeof(ABC) * (lastChar - firstChar + 1) );
1423 if ((ret = GetCharABCWidthsA( HDC_32(hdc), firstChar, lastChar, abc32 )))
1425 for (i = firstChar; i <= lastChar; i++)
1427 abc[i-firstChar].abcA = abc32[i-firstChar].abcA;
1428 abc[i-firstChar].abcB = abc32[i-firstChar].abcB;
1429 abc[i-firstChar].abcC = abc32[i-firstChar].abcC;
1432 HeapFree( GetProcessHeap(), 0, abc32 );
1437 /***********************************************************************
1438 * CreateScalableFontResource (GDI.310)
1440 BOOL16 WINAPI CreateScalableFontResource16( UINT16 fHidden, LPCSTR lpszResourceFile,
1441 LPCSTR fontFile, LPCSTR path )
1443 return CreateScalableFontResourceA( fHidden, lpszResourceFile, fontFile, path );
1447 /*************************************************************************
1448 * GetFontData (GDI.311)
1451 DWORD WINAPI GetFontData16( HDC16 hdc, DWORD table, DWORD offset, LPVOID buffer, DWORD count )
1453 return GetFontData( HDC_32(hdc), table, offset, buffer, count );
1457 /*************************************************************************
1458 * GetRasterizerCaps (GDI.313)
1460 BOOL16 WINAPI GetRasterizerCaps16( LPRASTERIZER_STATUS lprs, UINT16 cbNumBytes )
1462 return GetRasterizerCaps( lprs, cbNumBytes );
1466 /*************************************************************************
1467 * GetKerningPairs (GDI.332)
1470 INT16 WINAPI GetKerningPairs16( HDC16 hdc, INT16 count, LPKERNINGPAIR16 pairs )
1472 KERNINGPAIR *pairs32;
1475 if (!count) return 0;
1477 if (!(pairs32 = HeapAlloc( GetProcessHeap(), 0, count * sizeof(*pairs32) ))) return 0;
1478 if ((ret = GetKerningPairsA( HDC_32(hdc), count, pairs32 )))
1480 for (i = 0; i < ret; i++)
1482 pairs->wFirst = pairs32->wFirst;
1483 pairs->wSecond = pairs32->wSecond;
1484 pairs->iKernAmount = pairs32->iKernAmount;
1487 HeapFree( GetProcessHeap(), 0, pairs32 );
1493 /***********************************************************************
1494 * GetTextAlign (GDI.345)
1496 UINT16 WINAPI GetTextAlign16( HDC16 hdc )
1498 return GetTextAlign( HDC_32(hdc) );
1502 /***********************************************************************
1503 * SetTextAlign (GDI.346)
1505 UINT16 WINAPI SetTextAlign16( HDC16 hdc, UINT16 align )
1507 return SetTextAlign( HDC_32(hdc), align );
1511 /***********************************************************************
1514 BOOL16 WINAPI Chord16( HDC16 hdc, INT16 left, INT16 top,
1515 INT16 right, INT16 bottom, INT16 xstart, INT16 ystart,
1516 INT16 xend, INT16 yend )
1518 return Chord( HDC_32(hdc), left, top, right, bottom, xstart, ystart, xend, yend );
1522 /***********************************************************************
1523 * SetMapperFlags (GDI.349)
1525 DWORD WINAPI SetMapperFlags16( HDC16 hdc, DWORD flags )
1527 return SetMapperFlags( HDC_32(hdc), flags );
1531 /***********************************************************************
1532 * GetCharWidth (GDI.350)
1534 BOOL16 WINAPI GetCharWidth16( HDC16 hdc, UINT16 firstChar, UINT16 lastChar, LPINT16 buffer )
1536 BOOL retVal = FALSE;
1538 if( firstChar != lastChar )
1540 LPINT buf32 = HeapAlloc(GetProcessHeap(), 0, sizeof(INT)*(1 + (lastChar - firstChar)));
1543 LPINT obuf32 = buf32;
1546 retVal = GetCharWidth32A( HDC_32(hdc), firstChar, lastChar, buf32);
1549 for (i = firstChar; i <= lastChar; i++) *buffer++ = *buf32++;
1551 HeapFree(GetProcessHeap(), 0, obuf32);
1554 else /* happens quite often to warrant a special treatment */
1557 retVal = GetCharWidth32A( HDC_32(hdc), firstChar, lastChar, &chWidth );
1564 /***********************************************************************
1565 * ExtTextOut (GDI.351)
1567 BOOL16 WINAPI ExtTextOut16( HDC16 hdc, INT16 x, INT16 y, UINT16 flags,
1568 const RECT16 *lprect, LPCSTR str, UINT16 count,
1574 LPINT lpdx32 = NULL;
1577 lpdx32 = (LPINT)HeapAlloc( GetProcessHeap(),0, sizeof(INT)*count );
1578 if(lpdx32 == NULL) return FALSE;
1579 for (i=count;i--;) lpdx32[i]=lpDx[i];
1581 if (lprect) CONV_RECT16TO32(lprect,&rect32);
1582 ret = ExtTextOutA(HDC_32(hdc),x,y,flags,lprect?&rect32:NULL,str,count,lpdx32);
1583 if (lpdx32) HeapFree( GetProcessHeap(), 0, lpdx32 );
1588 /***********************************************************************
1589 * CreatePalette (GDI.360)
1591 HPALETTE16 WINAPI CreatePalette16( const LOGPALETTE* palette )
1593 return HPALETTE_16( CreatePalette( palette ) );
1597 /***********************************************************************
1598 * GDISelectPalette (GDI.361)
1600 HPALETTE16 WINAPI GDISelectPalette16( HDC16 hdc, HPALETTE16 hpalette, WORD wBkg )
1602 return HPALETTE_16( GDISelectPalette( HDC_32(hdc), HPALETTE_32(hpalette), wBkg ));
1606 /***********************************************************************
1607 * GDIRealizePalette (GDI.362)
1609 UINT16 WINAPI GDIRealizePalette16( HDC16 hdc )
1611 return GDIRealizePalette( HDC_32(hdc) );
1615 /***********************************************************************
1616 * GetPaletteEntries (GDI.363)
1618 UINT16 WINAPI GetPaletteEntries16( HPALETTE16 hpalette, UINT16 start,
1619 UINT16 count, LPPALETTEENTRY entries )
1621 return GetPaletteEntries( HPALETTE_32(hpalette), start, count, entries );
1625 /***********************************************************************
1626 * SetPaletteEntries (GDI.364)
1628 UINT16 WINAPI SetPaletteEntries16( HPALETTE16 hpalette, UINT16 start,
1629 UINT16 count, const PALETTEENTRY *entries )
1631 return SetPaletteEntries( HPALETTE_32(hpalette), start, count, entries );
1635 /**********************************************************************
1636 * UpdateColors (GDI.366)
1638 INT16 WINAPI UpdateColors16( HDC16 hdc )
1640 UpdateColors( HDC_32(hdc) );
1645 /***********************************************************************
1646 * AnimatePalette (GDI.367)
1648 void WINAPI AnimatePalette16( HPALETTE16 hpalette, UINT16 StartIndex,
1649 UINT16 NumEntries, const PALETTEENTRY* PaletteColors)
1651 AnimatePalette( HPALETTE_32(hpalette), StartIndex, NumEntries, PaletteColors );
1655 /***********************************************************************
1656 * ResizePalette (GDI.368)
1658 BOOL16 WINAPI ResizePalette16( HPALETTE16 hpalette, UINT16 cEntries )
1660 return ResizePalette( HPALETTE_32(hpalette), cEntries );
1664 /***********************************************************************
1665 * GetNearestPaletteIndex (GDI.370)
1667 UINT16 WINAPI GetNearestPaletteIndex16( HPALETTE16 hpalette, COLORREF color )
1669 return GetNearestPaletteIndex( HPALETTE_32(hpalette), color );
1673 /**********************************************************************
1674 * ExtFloodFill (GDI.372)
1676 BOOL16 WINAPI ExtFloodFill16( HDC16 hdc, INT16 x, INT16 y, COLORREF color,
1679 return ExtFloodFill( HDC_32(hdc), x, y, color, fillType );
1683 /***********************************************************************
1684 * SetSystemPaletteUse (GDI.373)
1686 UINT16 WINAPI SetSystemPaletteUse16( HDC16 hdc, UINT16 use )
1688 return SetSystemPaletteUse( HDC_32(hdc), use );
1692 /***********************************************************************
1693 * GetSystemPaletteUse (GDI.374)
1695 UINT16 WINAPI GetSystemPaletteUse16( HDC16 hdc )
1697 return GetSystemPaletteUse( HDC_32(hdc) );
1701 /***********************************************************************
1702 * GetSystemPaletteEntries (GDI.375)
1704 UINT16 WINAPI GetSystemPaletteEntries16( HDC16 hdc, UINT16 start, UINT16 count,
1705 LPPALETTEENTRY entries )
1707 return GetSystemPaletteEntries( HDC_32(hdc), start, count, entries );
1711 /***********************************************************************
1714 HDC16 WINAPI ResetDC16( HDC16 hdc, const DEVMODEA *devmode )
1716 return HDC_16( ResetDCA(HDC_32(hdc), devmode) );
1720 /******************************************************************
1721 * StartDoc (GDI.377)
1723 INT16 WINAPI StartDoc16( HDC16 hdc, const DOCINFO16 *lpdoc )
1727 docA.cbSize = lpdoc->cbSize;
1728 docA.lpszDocName = MapSL(lpdoc->lpszDocName);
1729 docA.lpszOutput = MapSL(lpdoc->lpszOutput);
1730 if(lpdoc->cbSize > offsetof(DOCINFO16,lpszDatatype))
1731 docA.lpszDatatype = MapSL(lpdoc->lpszDatatype);
1733 docA.lpszDatatype = NULL;
1734 if(lpdoc->cbSize > offsetof(DOCINFO16,fwType))
1735 docA.fwType = lpdoc->fwType;
1738 return StartDocA( HDC_32(hdc), &docA );
1742 /******************************************************************
1745 INT16 WINAPI EndDoc16( HDC16 hdc )
1747 return EndDoc( HDC_32(hdc) );
1751 /******************************************************************
1752 * StartPage (GDI.379)
1754 INT16 WINAPI StartPage16( HDC16 hdc )
1756 return StartPage( HDC_32(hdc) );
1760 /******************************************************************
1763 INT16 WINAPI EndPage16( HDC16 hdc )
1765 return EndPage( HDC_32(hdc) );
1769 /******************************************************************************
1770 * AbortDoc (GDI.382)
1772 INT16 WINAPI AbortDoc16( HDC16 hdc )
1774 return AbortDoc( HDC_32(hdc) );
1778 /***********************************************************************
1779 * FastWindowFrame (GDI.400)
1781 BOOL16 WINAPI FastWindowFrame16( HDC16 hdc, const RECT16 *rect,
1782 INT16 width, INT16 height, DWORD rop )
1784 HDC hdc32 = HDC_32(hdc);
1785 HBRUSH hbrush = SelectObject( hdc32, GetStockObject( GRAY_BRUSH ) );
1786 PatBlt( hdc32, rect->left, rect->top,
1787 rect->right - rect->left - width, height, rop );
1788 PatBlt( hdc32, rect->left, rect->top + height, width,
1789 rect->bottom - rect->top - height, rop );
1790 PatBlt( hdc32, rect->left + width, rect->bottom - 1,
1791 rect->right - rect->left - width, -height, rop );
1792 PatBlt( hdc32, rect->right - 1, rect->top, -width,
1793 rect->bottom - rect->top - height, rop );
1794 SelectObject( hdc32, hbrush );
1799 /***********************************************************************
1800 * CreateUserBitmap (GDI.407)
1802 HBITMAP16 WINAPI CreateUserBitmap16( INT16 width, INT16 height, UINT16 planes,
1803 UINT16 bpp, LPCVOID bits )
1805 return CreateBitmap16( width, height, planes, bpp, bits );
1809 /***********************************************************************
1810 * CreateUserDiscardableBitmap (GDI.409)
1812 HBITMAP16 WINAPI CreateUserDiscardableBitmap16( WORD dummy, INT16 width, INT16 height )
1814 HDC hdc = CreateDCA( "DISPLAY", NULL, NULL, NULL );
1815 HBITMAP ret = CreateCompatibleBitmap( hdc, width, height );
1817 return HBITMAP_16(ret);
1821 /***********************************************************************
1822 * GetCurLogFont (GDI.411)
1824 HFONT16 WINAPI GetCurLogFont16( HDC16 hdc )
1826 return HFONT_16( GetCurrentObject( HDC_32(hdc), OBJ_FONT ) );
1830 /***********************************************************************
1831 * StretchDIBits (GDI.439)
1833 INT16 WINAPI StretchDIBits16( HDC16 hdc, INT16 xDst, INT16 yDst, INT16 widthDst,
1834 INT16 heightDst, INT16 xSrc, INT16 ySrc, INT16 widthSrc,
1835 INT16 heightSrc, const VOID *bits,
1836 const BITMAPINFO *info, UINT16 wUsage, DWORD dwRop )
1838 return StretchDIBits( HDC_32(hdc), xDst, yDst, widthDst, heightDst,
1839 xSrc, ySrc, widthSrc, heightSrc, bits,
1840 info, wUsage, dwRop );
1844 /***********************************************************************
1845 * SetDIBits (GDI.440)
1847 INT16 WINAPI SetDIBits16( HDC16 hdc, HBITMAP16 hbitmap, UINT16 startscan,
1848 UINT16 lines, LPCVOID bits, const BITMAPINFO *info,
1851 return SetDIBits( HDC_32(hdc), HBITMAP_32(hbitmap), startscan, lines, bits, info, coloruse );
1855 /***********************************************************************
1856 * GetDIBits (GDI.441)
1858 INT16 WINAPI GetDIBits16( HDC16 hdc, HBITMAP16 hbitmap, UINT16 startscan,
1859 UINT16 lines, LPVOID bits, BITMAPINFO * info,
1862 return GetDIBits( HDC_32(hdc), HBITMAP_32(hbitmap), startscan, lines, bits, info, coloruse );
1866 /***********************************************************************
1867 * CreateDIBitmap (GDI.442)
1869 HBITMAP16 WINAPI CreateDIBitmap16( HDC16 hdc, const BITMAPINFOHEADER * header,
1870 DWORD init, LPCVOID bits, const BITMAPINFO * data,
1873 return HBITMAP_16( CreateDIBitmap( HDC_32(hdc), header, init, bits, data, coloruse ) );
1877 /***********************************************************************
1878 * SetDIBitsToDevice (GDI.443)
1880 INT16 WINAPI SetDIBitsToDevice16( HDC16 hdc, INT16 xDest, INT16 yDest, INT16 cx,
1881 INT16 cy, INT16 xSrc, INT16 ySrc, UINT16 startscan,
1882 UINT16 lines, LPCVOID bits, const BITMAPINFO *info,
1885 return SetDIBitsToDevice( HDC_32(hdc), xDest, yDest, cx, cy, xSrc, ySrc,
1886 startscan, lines, bits, info, coloruse );
1890 /***********************************************************************
1891 * CreateRoundRectRgn (GDI.444)
1893 * If either ellipse dimension is zero we call CreateRectRgn16 for its
1894 * `special' behaviour. -ve ellipse dimensions can result in GPFs under win3.1
1895 * we just let CreateRoundRectRgn convert them to +ve values.
1898 HRGN16 WINAPI CreateRoundRectRgn16( INT16 left, INT16 top, INT16 right, INT16 bottom,
1899 INT16 ellipse_width, INT16 ellipse_height )
1901 if( ellipse_width == 0 || ellipse_height == 0 )
1902 return CreateRectRgn16( left, top, right, bottom );
1904 return HRGN_16( CreateRoundRectRgn( left, top, right, bottom,
1905 ellipse_width, ellipse_height ));
1909 /**********************************************************************
1910 * PolyPolygon (GDI.450)
1912 BOOL16 WINAPI PolyPolygon16( HDC16 hdc, const POINT16* pt, const INT16* counts,
1921 for (i=polygons;i--;)
1923 pt32 = (LPPOINT)HeapAlloc( GetProcessHeap(), 0, sizeof(POINT)*nrpts);
1924 if(pt32 == NULL) return FALSE;
1926 CONV_POINT16TO32(&(pt[i]),&(pt32[i]));
1927 counts32 = (LPINT)HeapAlloc( GetProcessHeap(), 0, polygons*sizeof(INT) );
1928 if(counts32 == NULL) {
1929 HeapFree( GetProcessHeap(), 0, pt32 );
1932 for (i=polygons;i--;) counts32[i]=counts[i];
1934 ret = PolyPolygon(HDC_32(hdc),pt32,counts32,polygons);
1935 HeapFree( GetProcessHeap(), 0, counts32 );
1936 HeapFree( GetProcessHeap(), 0, pt32 );
1941 /***********************************************************************
1942 * CreatePolyPolygonRgn (GDI.451)
1944 HRGN16 WINAPI CreatePolyPolygonRgn16( const POINT16 *points,
1945 const INT16 *count, INT16 nbpolygons, INT16 mode )
1952 for (i = 0; i < nbpolygons; i++) npts += count[i];
1953 points32 = HeapAlloc( GetProcessHeap(), 0, npts * sizeof(POINT) );
1954 for (i = 0; i < npts; i++) CONV_POINT16TO32( &(points[i]), &(points32[i]) );
1956 count32 = HeapAlloc( GetProcessHeap(), 0, nbpolygons * sizeof(INT) );
1957 for (i = 0; i < nbpolygons; i++) count32[i] = count[i];
1958 hrgn = CreatePolyPolygonRgn( points32, count32, nbpolygons, mode );
1959 HeapFree( GetProcessHeap(), 0, count32 );
1960 HeapFree( GetProcessHeap(), 0, points32 );
1961 return HRGN_16(hrgn);
1965 /***********************************************************************
1966 * SetObjectOwner (GDI.461)
1968 void WINAPI SetObjectOwner16( HGDIOBJ16 handle, HANDLE16 owner )
1974 /***********************************************************************
1975 * RectVisible (GDI.465)
1976 * RectVisibleOld (GDI.104)
1978 BOOL16 WINAPI RectVisible16( HDC16 hdc, const RECT16* rect16 )
1981 CONV_RECT16TO32( rect16, &rect );
1982 return RectVisible( HDC_32(hdc), &rect );
1986 /***********************************************************************
1987 * RectInRegion (GDI.466)
1988 * RectInRegionOld (GDI.181)
1990 BOOL16 WINAPI RectInRegion16( HRGN16 hrgn, const RECT16 *rect )
1994 CONV_RECT16TO32(rect, &r32);
1995 return RectInRegion( HRGN_32(hrgn), &r32 );
1999 /***********************************************************************
2000 * GetBitmapDimensionEx (GDI.468)
2002 BOOL16 WINAPI GetBitmapDimensionEx16( HBITMAP16 hbitmap, LPSIZE16 size )
2005 BOOL ret = GetBitmapDimensionEx( HBITMAP_32(hbitmap), &size32 );
2009 size->cx = size32.cx;
2010 size->cy = size32.cy;
2016 /***********************************************************************
2017 * GetBrushOrgEx (GDI.469)
2019 BOOL16 WINAPI GetBrushOrgEx16( HDC16 hdc, LPPOINT16 pt )
2022 if (!GetBrushOrgEx( HDC_32(hdc), &pt32 )) return FALSE;
2029 /***********************************************************************
2030 * GetCurrentPositionEx (GDI.470)
2032 BOOL16 WINAPI GetCurrentPositionEx16( HDC16 hdc, LPPOINT16 pt )
2035 if (!GetCurrentPositionEx( HDC_32(hdc), &pt32 )) return FALSE;
2042 /***********************************************************************
2043 * GetTextExtentPoint (GDI.471)
2045 * FIXME: Should this have a bug for compatibility?
2046 * Original Windows versions of GetTextExtentPoint{A,W} have documented
2047 * bugs (-> MSDN KB q147647.txt).
2049 BOOL16 WINAPI GetTextExtentPoint16( HDC16 hdc, LPCSTR str, INT16 count, LPSIZE16 size )
2052 BOOL ret = GetTextExtentPoint32A( HDC_32(hdc), str, count, &size32 );
2056 size->cx = size32.cx;
2057 size->cy = size32.cy;
2063 /***********************************************************************
2064 * GetViewportExtEx (GDI.472)
2066 BOOL16 WINAPI GetViewportExtEx16( HDC16 hdc, LPSIZE16 size )
2069 if (!GetViewportExtEx( HDC_32(hdc), &size32 )) return FALSE;
2070 size->cx = size32.cx;
2071 size->cy = size32.cy;
2076 /***********************************************************************
2077 * GetViewportOrgEx (GDI.473)
2079 BOOL16 WINAPI GetViewportOrgEx16( HDC16 hdc, LPPOINT16 pt )
2082 if (!GetViewportOrgEx( HDC_32(hdc), &pt32 )) return FALSE;
2089 /***********************************************************************
2090 * GetWindowExtEx (GDI.474)
2092 BOOL16 WINAPI GetWindowExtEx16( HDC16 hdc, LPSIZE16 size )
2095 if (!GetWindowExtEx( HDC_32(hdc), &size32 )) return FALSE;
2096 size->cx = size32.cx;
2097 size->cy = size32.cy;
2102 /***********************************************************************
2103 * GetWindowOrgEx (GDI.475)
2105 BOOL16 WINAPI GetWindowOrgEx16( HDC16 hdc, LPPOINT16 pt )
2108 if (!GetWindowOrgEx( HDC_32(hdc), &pt32 )) return FALSE;
2115 /***********************************************************************
2116 * OffsetViewportOrgEx (GDI.476)
2118 BOOL16 WINAPI OffsetViewportOrgEx16( HDC16 hdc, INT16 x, INT16 y, LPPOINT16 pt)
2121 BOOL16 ret = OffsetViewportOrgEx( HDC_32(hdc), x, y, &pt32 );
2122 if (pt) CONV_POINT32TO16( &pt32, pt );
2127 /***********************************************************************
2128 * OffsetWindowOrgEx (GDI.477)
2130 BOOL16 WINAPI OffsetWindowOrgEx16( HDC16 hdc, INT16 x, INT16 y, LPPOINT16 pt )
2133 BOOL16 ret = OffsetWindowOrgEx( HDC_32(hdc), x, y, &pt32 );
2134 if (pt) CONV_POINT32TO16( &pt32, pt );
2139 /***********************************************************************
2140 * SetBitmapDimensionEx (GDI.478)
2142 BOOL16 WINAPI SetBitmapDimensionEx16( HBITMAP16 hbitmap, INT16 x, INT16 y, LPSIZE16 prevSize )
2145 BOOL ret = SetBitmapDimensionEx( HBITMAP_32(hbitmap), x, y, &size32 );
2147 if (ret && prevSize)
2149 prevSize->cx = size32.cx;
2150 prevSize->cy = size32.cy;
2156 /***********************************************************************
2157 * SetViewportExtEx (GDI.479)
2159 BOOL16 WINAPI SetViewportExtEx16( HDC16 hdc, INT16 x, INT16 y, LPSIZE16 size )
2162 BOOL16 ret = SetViewportExtEx( HDC_32(hdc), x, y, &size32 );
2163 if (size) { size->cx = size32.cx; size->cy = size32.cy; }
2168 /***********************************************************************
2169 * SetViewportOrgEx (GDI.480)
2171 BOOL16 WINAPI SetViewportOrgEx16( HDC16 hdc, INT16 x, INT16 y, LPPOINT16 pt )
2174 BOOL16 ret = SetViewportOrgEx( HDC_32(hdc), x, y, &pt32 );
2175 if (pt) CONV_POINT32TO16( &pt32, pt );
2180 /***********************************************************************
2181 * SetWindowExtEx (GDI.481)
2183 BOOL16 WINAPI SetWindowExtEx16( HDC16 hdc, INT16 x, INT16 y, LPSIZE16 size )
2186 BOOL16 ret = SetWindowExtEx( HDC_32(hdc), x, y, &size32 );
2187 if (size) { size->cx = size32.cx; size->cy = size32.cy; }
2192 /***********************************************************************
2193 * SetWindowOrgEx (GDI.482)
2195 BOOL16 WINAPI SetWindowOrgEx16( HDC16 hdc, INT16 x, INT16 y, LPPOINT16 pt )
2198 BOOL16 ret = SetWindowOrgEx( HDC_32(hdc), x, y, &pt32 );
2199 if (pt) CONV_POINT32TO16( &pt32, pt );
2204 /***********************************************************************
2205 * MoveToEx (GDI.483)
2207 BOOL16 WINAPI MoveToEx16( HDC16 hdc, INT16 x, INT16 y, LPPOINT16 pt )
2211 if (!MoveToEx( HDC_32(hdc), x, y, &pt32 )) return FALSE;
2212 if (pt) CONV_POINT32TO16( &pt32, pt );
2217 /***********************************************************************
2218 * ScaleViewportExtEx (GDI.484)
2220 BOOL16 WINAPI ScaleViewportExtEx16( HDC16 hdc, INT16 xNum, INT16 xDenom,
2221 INT16 yNum, INT16 yDenom, LPSIZE16 size )
2224 BOOL16 ret = ScaleViewportExtEx( HDC_32(hdc), xNum, xDenom, yNum, yDenom,
2226 if (size) { size->cx = size32.cx; size->cy = size32.cy; }
2231 /***********************************************************************
2232 * ScaleWindowExtEx (GDI.485)
2234 BOOL16 WINAPI ScaleWindowExtEx16( HDC16 hdc, INT16 xNum, INT16 xDenom,
2235 INT16 yNum, INT16 yDenom, LPSIZE16 size )
2238 BOOL16 ret = ScaleWindowExtEx( HDC_32(hdc), xNum, xDenom, yNum, yDenom,
2240 if (size) { size->cx = size32.cx; size->cy = size32.cy; }
2245 /******************************************************************************
2246 * PolyBezier (GDI.502)
2248 BOOL16 WINAPI PolyBezier16( HDC16 hdc, const POINT16* lppt, INT16 cPoints )
2252 LPPOINT pt32 = (LPPOINT)HeapAlloc( GetProcessHeap(), 0,
2253 cPoints*sizeof(POINT) );
2254 if(!pt32) return FALSE;
2255 for (i=cPoints;i--;) CONV_POINT16TO32(&(lppt[i]),&(pt32[i]));
2256 ret= PolyBezier(HDC_32(hdc), pt32, cPoints);
2257 HeapFree( GetProcessHeap(), 0, pt32 );
2262 /******************************************************************************
2263 * PolyBezierTo (GDI.503)
2265 BOOL16 WINAPI PolyBezierTo16( HDC16 hdc, const POINT16* lppt, INT16 cPoints )
2269 LPPOINT pt32 = (LPPOINT)HeapAlloc( GetProcessHeap(), 0,
2270 cPoints*sizeof(POINT) );
2271 if(!pt32) return FALSE;
2272 for (i=cPoints;i--;) CONV_POINT16TO32(&(lppt[i]),&(pt32[i]));
2273 ret= PolyBezierTo(HDC_32(hdc), pt32, cPoints);
2274 HeapFree( GetProcessHeap(), 0, pt32 );
2279 /******************************************************************************
2280 * ExtSelectClipRgn (GDI.508)
2282 INT16 WINAPI ExtSelectClipRgn16( HDC16 hdc, HRGN16 hrgn, INT16 fnMode )
2284 return ExtSelectClipRgn( HDC_32(hdc), HRGN_32(hrgn), fnMode);
2288 /***********************************************************************
2289 * AbortPath (GDI.511)
2291 BOOL16 WINAPI AbortPath16(HDC16 hdc)
2293 return AbortPath( HDC_32(hdc) );
2297 /***********************************************************************
2298 * BeginPath (GDI.512)
2300 BOOL16 WINAPI BeginPath16(HDC16 hdc)
2302 return BeginPath( HDC_32(hdc) );
2306 /***********************************************************************
2307 * CloseFigure (GDI.513)
2309 BOOL16 WINAPI CloseFigure16(HDC16 hdc)
2311 return CloseFigure( HDC_32(hdc) );
2315 /***********************************************************************
2318 BOOL16 WINAPI EndPath16(HDC16 hdc)
2320 return EndPath( HDC_32(hdc) );
2324 /***********************************************************************
2325 * FillPath (GDI.515)
2327 BOOL16 WINAPI FillPath16(HDC16 hdc)
2329 return FillPath( HDC_32(hdc) );
2333 /*******************************************************************
2334 * FlattenPath (GDI.516)
2336 BOOL16 WINAPI FlattenPath16(HDC16 hdc)
2338 return FlattenPath( HDC_32(hdc) );
2342 /***********************************************************************
2345 INT16 WINAPI GetPath16(HDC16 hdc, LPPOINT16 pPoints, LPBYTE pTypes, INT16 nSize)
2347 FIXME("(%d,%p,%p): stub\n",hdc,pPoints,pTypes);
2352 /***********************************************************************
2353 * PathToRegion (GDI.518)
2355 HRGN16 WINAPI PathToRegion16(HDC16 hdc)
2357 return HRGN_16( PathToRegion( HDC_32(hdc) ));
2361 /***********************************************************************
2362 * SelectClipPath (GDI.519)
2364 BOOL16 WINAPI SelectClipPath16(HDC16 hdc, INT16 iMode)
2366 return SelectClipPath( HDC_32(hdc), iMode );
2370 /*******************************************************************
2371 * StrokeAndFillPath (GDI.520)
2373 BOOL16 WINAPI StrokeAndFillPath16(HDC16 hdc)
2375 return StrokeAndFillPath( HDC_32(hdc) );
2379 /*******************************************************************
2380 * StrokePath (GDI.521)
2382 BOOL16 WINAPI StrokePath16(HDC16 hdc)
2384 return StrokePath( HDC_32(hdc) );
2388 /*******************************************************************
2389 * WidenPath (GDI.522)
2391 BOOL16 WINAPI WidenPath16(HDC16 hdc)
2393 return WidenPath( HDC_32(hdc) );
2397 /***********************************************************************
2398 * GetArcDirection (GDI.524)
2400 INT16 WINAPI GetArcDirection16( HDC16 hdc )
2402 return GetArcDirection( HDC_32(hdc) );
2406 /***********************************************************************
2407 * SetArcDirection (GDI.525)
2409 INT16 WINAPI SetArcDirection16( HDC16 hdc, INT16 nDirection )
2411 return SetArcDirection( HDC_32(hdc), (INT)nDirection );
2415 /***********************************************************************
2416 * CreateHalftonePalette (GDI.529)
2418 HPALETTE16 WINAPI CreateHalftonePalette16( HDC16 hdc )
2420 return HPALETTE_16( CreateHalftonePalette( HDC_32(hdc) ));
2424 /***********************************************************************
2425 * SetDIBColorTable (GDI.602)
2427 UINT16 WINAPI SetDIBColorTable16( HDC16 hdc, UINT16 startpos, UINT16 entries, RGBQUAD *colors )
2429 return SetDIBColorTable( HDC_32(hdc), startpos, entries, colors );
2433 /***********************************************************************
2434 * GetDIBColorTable (GDI.603)
2436 UINT16 WINAPI GetDIBColorTable16( HDC16 hdc, UINT16 startpos, UINT16 entries, RGBQUAD *colors )
2438 return GetDIBColorTable( HDC_32(hdc), startpos, entries, colors );
2442 /***********************************************************************
2443 * GetRegionData (GDI.607)
2445 * FIXME: is LPRGNDATA the same in Win16 and Win32 ?
2447 DWORD WINAPI GetRegionData16( HRGN16 hrgn, DWORD count, LPRGNDATA rgndata )
2449 return GetRegionData( HRGN_32(hrgn), count, rgndata );
2453 /***********************************************************************
2454 * GetTextCharset (GDI.612)
2456 UINT16 WINAPI GetTextCharset16( HDC16 hdc )
2458 return GetTextCharset( HDC_32(hdc) );
2462 /*************************************************************************
2463 * GetFontLanguageInfo (GDI.616)
2465 DWORD WINAPI GetFontLanguageInfo16( HDC16 hdc )
2467 return GetFontLanguageInfo( HDC_32(hdc) );
2471 /***********************************************************************
2472 * SetLayout (GDI.1000)
2474 * Sets left->right or right->left text layout flags of a dc.
2476 BOOL16 WINAPI SetLayout16( HDC16 hdc, DWORD layout )
2478 return SetLayout( HDC_32(hdc), layout );