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 * CreateBrushIndirect (GDI.50)
755 HBRUSH16 WINAPI CreateBrushIndirect16( const LOGBRUSH16 * brush )
759 if (brush->lbStyle == BS_DIBPATTERN || brush->lbStyle == BS_DIBPATTERN8X8)
760 return CreateDIBPatternBrush16( brush->lbHatch, brush->lbColor );
762 brush32.lbStyle = brush->lbStyle;
763 brush32.lbColor = brush->lbColor;
764 brush32.lbHatch = brush->lbHatch;
765 return HBRUSH_16( CreateBrushIndirect(&brush32) );
769 /***********************************************************************
770 * CreateCompatibleBitmap (GDI.51)
772 HBITMAP16 WINAPI CreateCompatibleBitmap16( HDC16 hdc, INT16 width, INT16 height )
774 return HBITMAP_16( CreateCompatibleBitmap( HDC_32(hdc), width, height ) );
778 /***********************************************************************
779 * CreateCompatibleDC (GDI.52)
781 HDC16 WINAPI CreateCompatibleDC16( HDC16 hdc )
783 return HDC_16( CreateCompatibleDC( HDC_32(hdc) ) );
787 /***********************************************************************
790 HDC16 WINAPI CreateDC16( LPCSTR driver, LPCSTR device, LPCSTR output,
791 const DEVMODEA *initData )
793 return HDC_16( CreateDCA( driver, device, output, initData ) );
797 /***********************************************************************
798 * CreateEllipticRgn (GDI.54)
800 HRGN16 WINAPI CreateEllipticRgn16( INT16 left, INT16 top, INT16 right, INT16 bottom )
802 return HRGN_16( CreateEllipticRgn( left, top, right, bottom ) );
806 /***********************************************************************
807 * CreateEllipticRgnIndirect (GDI.55)
809 HRGN16 WINAPI CreateEllipticRgnIndirect16( const RECT16 *rect )
811 return HRGN_16( CreateEllipticRgn( rect->left, rect->top, rect->right, rect->bottom ) );
815 /***********************************************************************
816 * CreateFontIndirect (GDI.57)
818 HFONT16 WINAPI CreateFontIndirect16( const LOGFONT16 *plf16 )
825 logfont_16_to_W( plf16, &lfW );
826 ret = CreateFontIndirectW( &lfW );
828 else ret = CreateFontIndirectW( NULL );
829 return HFONT_16(ret);
833 /***********************************************************************
834 * CreateHatchBrush (GDI.58)
836 HBRUSH16 WINAPI CreateHatchBrush16( INT16 style, COLORREF color )
838 return HBRUSH_16( CreateHatchBrush( style, color ) );
842 /***********************************************************************
843 * CreatePatternBrush (GDI.60)
845 HBRUSH16 WINAPI CreatePatternBrush16( HBITMAP16 hbitmap )
847 return HBRUSH_16( CreatePatternBrush( HBITMAP_32(hbitmap) ));
851 /***********************************************************************
854 HPEN16 WINAPI CreatePen16( INT16 style, INT16 width, COLORREF color )
858 logpen.lopnStyle = style;
859 logpen.lopnWidth.x = width;
860 logpen.lopnWidth.y = 0;
861 logpen.lopnColor = color;
862 return HPEN_16( CreatePenIndirect( &logpen ) );
866 /***********************************************************************
867 * CreatePenIndirect (GDI.62)
869 HPEN16 WINAPI CreatePenIndirect16( const LOGPEN16 * pen )
873 if (pen->lopnStyle > PS_INSIDEFRAME) return 0;
874 logpen.lopnStyle = pen->lopnStyle;
875 logpen.lopnWidth.x = pen->lopnWidth.x;
876 logpen.lopnWidth.y = pen->lopnWidth.y;
877 logpen.lopnColor = pen->lopnColor;
878 return HPEN_16( CreatePenIndirect( &logpen ) );
882 /***********************************************************************
883 * CreatePolygonRgn (GDI.63)
885 HRGN16 WINAPI CreatePolygonRgn16( const POINT16 * points, INT16 count, INT16 mode )
887 return CreatePolyPolygonRgn16( points, &count, 1, mode );
891 /***********************************************************************
892 * CreateRectRgn (GDI.64)
894 * NOTE: cf. SetRectRgn16
896 HRGN16 WINAPI CreateRectRgn16( INT16 left, INT16 top, INT16 right, INT16 bottom )
900 if (left < right) hrgn = CreateRectRgn( left, top, right, bottom );
901 else hrgn = CreateRectRgn( 0, 0, 0, 0 );
902 return HRGN_16(hrgn);
906 /***********************************************************************
907 * CreateRectRgnIndirect (GDI.65)
909 HRGN16 WINAPI CreateRectRgnIndirect16( const RECT16* rect )
911 return CreateRectRgn16( rect->left, rect->top, rect->right, rect->bottom );
915 /***********************************************************************
916 * CreateSolidBrush (GDI.66)
918 HBRUSH16 WINAPI CreateSolidBrush16( COLORREF color )
920 return HBRUSH_16( CreateSolidBrush( color ) );
924 /***********************************************************************
927 BOOL16 WINAPI DeleteDC16( HDC16 hdc )
929 return DeleteDC( HDC_32(hdc) );
933 /***********************************************************************
934 * DeleteObject (GDI.69)
935 * SysDeleteObject (GDI.605)
937 BOOL16 WINAPI DeleteObject16( HGDIOBJ16 obj )
939 return DeleteObject( HGDIOBJ_32(obj) );
943 /***********************************************************************
946 BOOL16 WINAPI EqualRgn16( HRGN16 rgn1, HRGN16 rgn2 )
948 return EqualRgn( HRGN_32(rgn1), HRGN_32(rgn2) );
952 /***********************************************************************
953 * GetBitmapBits (GDI.74)
955 LONG WINAPI GetBitmapBits16( HBITMAP16 hbitmap, LONG count, LPVOID buffer )
957 return GetBitmapBits( HBITMAP_32(hbitmap), count, buffer );
961 /***********************************************************************
962 * GetBkColor (GDI.75)
964 COLORREF WINAPI GetBkColor16( HDC16 hdc )
966 return GetBkColor( HDC_32(hdc) );
970 /***********************************************************************
973 INT16 WINAPI GetBkMode16( HDC16 hdc )
975 return GetBkMode( HDC_32(hdc) );
979 /***********************************************************************
980 * GetClipBox (GDI.77)
982 INT16 WINAPI GetClipBox16( HDC16 hdc, LPRECT16 rect )
985 INT ret = GetClipBox( HDC_32(hdc), &rect32 );
989 rect->left = rect32.left;
990 rect->top = rect32.top;
991 rect->right = rect32.right;
992 rect->bottom = rect32.bottom;
998 /***********************************************************************
999 * GetCurrentPosition (GDI.78)
1001 DWORD WINAPI GetCurrentPosition16( HDC16 hdc )
1004 if (!GetCurrentPositionEx( HDC_32(hdc), &pt32 )) return 0;
1005 return MAKELONG( pt32.x, pt32.y );
1009 /***********************************************************************
1012 DWORD WINAPI GetDCOrg16( HDC16 hdc )
1015 if (GetDCOrgEx( HDC_32(hdc), &pt )) return MAKELONG( pt.x, pt.y );
1020 /***********************************************************************
1021 * GetDeviceCaps (GDI.80)
1023 INT16 WINAPI GetDeviceCaps16( HDC16 hdc, INT16 cap )
1025 INT16 ret = GetDeviceCaps( HDC_32(hdc), cap );
1026 /* some apps don't expect -1 and think it's a B&W screen */
1027 if ((cap == NUMCOLORS) && (ret == -1)) ret = 2048;
1032 /***********************************************************************
1033 * GetMapMode (GDI.81)
1035 INT16 WINAPI GetMapMode16( HDC16 hdc )
1037 return GetMapMode( HDC_32(hdc) );
1041 /***********************************************************************
1044 COLORREF WINAPI GetPixel16( HDC16 hdc, INT16 x, INT16 y )
1046 return GetPixel( HDC_32(hdc), x, y );
1050 /***********************************************************************
1051 * GetPolyFillMode (GDI.84)
1053 INT16 WINAPI GetPolyFillMode16( HDC16 hdc )
1055 return GetPolyFillMode( HDC_32(hdc) );
1059 /***********************************************************************
1062 INT16 WINAPI GetROP216( HDC16 hdc )
1064 return GetROP2( HDC_32(hdc) );
1068 /***********************************************************************
1069 * GetRelAbs (GDI.86)
1071 INT16 WINAPI GetRelAbs16( HDC16 hdc )
1073 return GetRelAbs( HDC_32(hdc), 0 );
1077 /***********************************************************************
1078 * GetStockObject (GDI.87)
1080 HGDIOBJ16 WINAPI GetStockObject16( INT16 obj )
1082 return HGDIOBJ_16( GetStockObject( obj ) );
1086 /***********************************************************************
1087 * GetStretchBltMode (GDI.88)
1089 INT16 WINAPI GetStretchBltMode16( HDC16 hdc )
1091 return GetStretchBltMode( HDC_32(hdc) );
1095 /***********************************************************************
1096 * GetTextCharacterExtra (GDI.89)
1098 INT16 WINAPI GetTextCharacterExtra16( HDC16 hdc )
1100 return GetTextCharacterExtra( HDC_32(hdc) );
1104 /***********************************************************************
1105 * GetTextColor (GDI.90)
1107 COLORREF WINAPI GetTextColor16( HDC16 hdc )
1109 return GetTextColor( HDC_32(hdc) );
1113 /***********************************************************************
1114 * GetTextExtent (GDI.91)
1116 DWORD WINAPI GetTextExtent16( HDC16 hdc, LPCSTR str, INT16 count )
1119 if (!GetTextExtentPoint32A( HDC_32(hdc), str, count, &size )) return 0;
1120 return MAKELONG( size.cx, size.cy );
1124 /***********************************************************************
1125 * GetTextFace (GDI.92)
1127 INT16 WINAPI GetTextFace16( HDC16 hdc, INT16 count, LPSTR name )
1129 return GetTextFaceA( HDC_32(hdc), count, name );
1133 /***********************************************************************
1134 * GetTextMetrics (GDI.93)
1136 BOOL16 WINAPI GetTextMetrics16( HDC16 hdc, TEXTMETRIC16 *tm )
1140 if (!GetTextMetricsW( HDC_32(hdc), &tm32 )) return FALSE;
1142 tm->tmHeight = tm32.tmHeight;
1143 tm->tmAscent = tm32.tmAscent;
1144 tm->tmDescent = tm32.tmDescent;
1145 tm->tmInternalLeading = tm32.tmInternalLeading;
1146 tm->tmExternalLeading = tm32.tmExternalLeading;
1147 tm->tmAveCharWidth = tm32.tmAveCharWidth;
1148 tm->tmMaxCharWidth = tm32.tmMaxCharWidth;
1149 tm->tmWeight = tm32.tmWeight;
1150 tm->tmOverhang = tm32.tmOverhang;
1151 tm->tmDigitizedAspectX = tm32.tmDigitizedAspectX;
1152 tm->tmDigitizedAspectY = tm32.tmDigitizedAspectY;
1153 tm->tmFirstChar = tm32.tmFirstChar;
1154 tm->tmLastChar = tm32.tmLastChar;
1155 tm->tmDefaultChar = tm32.tmDefaultChar;
1156 tm->tmBreakChar = tm32.tmBreakChar;
1157 tm->tmItalic = tm32.tmItalic;
1158 tm->tmUnderlined = tm32.tmUnderlined;
1159 tm->tmStruckOut = tm32.tmStruckOut;
1160 tm->tmPitchAndFamily = tm32.tmPitchAndFamily;
1161 tm->tmCharSet = tm32.tmCharSet;
1166 /***********************************************************************
1167 * GetViewportExt (GDI.94)
1169 DWORD WINAPI GetViewportExt16( HDC16 hdc )
1172 if (!GetViewportExtEx( HDC_32(hdc), &size )) return 0;
1173 return MAKELONG( size.cx, size.cy );
1177 /***********************************************************************
1178 * GetViewportOrg (GDI.95)
1180 DWORD WINAPI GetViewportOrg16( HDC16 hdc )
1183 if (!GetViewportOrgEx( HDC_32(hdc), &pt )) return 0;
1184 return MAKELONG( pt.x, pt.y );
1188 /***********************************************************************
1189 * GetWindowExt (GDI.96)
1191 DWORD WINAPI GetWindowExt16( HDC16 hdc )
1194 if (!GetWindowExtEx( HDC_32(hdc), &size )) return 0;
1195 return MAKELONG( size.cx, size.cy );
1199 /***********************************************************************
1200 * GetWindowOrg (GDI.97)
1202 DWORD WINAPI GetWindowOrg16( HDC16 hdc )
1205 if (!GetWindowOrgEx( HDC_32(hdc), &pt )) return 0;
1206 return MAKELONG( pt.x, pt.y );
1210 /***********************************************************************
1211 * OffsetRgn (GDI.101)
1213 INT16 WINAPI OffsetRgn16( HRGN16 hrgn, INT16 x, INT16 y )
1215 return OffsetRgn( HRGN_32(hrgn), x, y );
1219 /***********************************************************************
1220 * PtVisible (GDI.103)
1222 BOOL16 WINAPI PtVisible16( HDC16 hdc, INT16 x, INT16 y )
1224 return PtVisible( HDC_32(hdc), x, y );
1228 /***********************************************************************
1229 * SetBitmapBits (GDI.106)
1231 LONG WINAPI SetBitmapBits16( HBITMAP16 hbitmap, LONG count, LPCVOID buffer )
1233 return SetBitmapBits( HBITMAP_32(hbitmap), count, buffer );
1237 /***********************************************************************
1238 * AddFontResource (GDI.119)
1240 INT16 WINAPI AddFontResource16( LPCSTR filename )
1242 return AddFontResourceA( filename );
1246 /***********************************************************************
1249 * Disables GDI, switches back to text mode.
1250 * We don't have to do anything here,
1251 * just let console support handle everything
1253 void WINAPI Death16(HDC16 hdc)
1255 MESSAGE("Death(%04x) called. Application enters text mode...\n", hdc);
1259 /***********************************************************************
1260 * Resurrection (GDI.122)
1262 * Restores GDI functionality
1264 void WINAPI Resurrection16(HDC16 hdc,
1265 WORD w1, WORD w2, WORD w3, WORD w4, WORD w5, WORD w6)
1267 MESSAGE("Resurrection(%04x, %04x, %04x, %04x, %04x, %04x, %04x) called. Application left text mode.\n",
1268 hdc, w1, w2, w3, w4, w5, w6);
1272 /**********************************************************************
1273 * CreateMetaFile (GDI.125)
1275 HDC16 WINAPI CreateMetaFile16( LPCSTR filename )
1277 return HDC_16( CreateMetaFileA( filename ) );
1281 /***********************************************************************
1284 INT16 WINAPI MulDiv16( INT16 nMultiplicand, INT16 nMultiplier, INT16 nDivisor)
1287 if (!nDivisor) return -32768;
1288 /* We want to deal with a positive divisor to simplify the logic. */
1291 nMultiplicand = - nMultiplicand;
1292 nDivisor = -nDivisor;
1294 /* If the result is positive, we "add" to round. else,
1295 * we subtract to round. */
1296 if ( ( (nMultiplicand < 0) && (nMultiplier < 0) ) ||
1297 ( (nMultiplicand >= 0) && (nMultiplier >= 0) ) )
1298 ret = (((int)nMultiplicand * nMultiplier) + (nDivisor/2)) / nDivisor;
1300 ret = (((int)nMultiplicand * nMultiplier) - (nDivisor/2)) / nDivisor;
1301 if ((ret > 32767) || (ret < -32767)) return -32768;
1306 /***********************************************************************
1307 * GetRgnBox (GDI.134)
1309 INT16 WINAPI GetRgnBox16( HRGN16 hrgn, LPRECT16 rect )
1312 INT16 ret = GetRgnBox( HRGN_32(hrgn), &r );
1313 CONV_RECT32TO16( &r, rect );
1318 /***********************************************************************
1319 * RemoveFontResource (GDI.136)
1321 BOOL16 WINAPI RemoveFontResource16( LPCSTR str )
1323 return RemoveFontResourceA(str);
1327 /***********************************************************************
1328 * SetBrushOrg (GDI.148)
1330 DWORD WINAPI SetBrushOrg16( HDC16 hdc, INT16 x, INT16 y )
1334 if (!SetBrushOrgEx( HDC_32(hdc), x, y, &pt )) return 0;
1335 return MAKELONG( pt.x, pt.y );
1339 /***********************************************************************
1340 * GetBrushOrg (GDI.149)
1342 DWORD WINAPI GetBrushOrg16( HDC16 hdc )
1345 if (!GetBrushOrgEx( HDC_32(hdc), &pt )) return 0;
1346 return MAKELONG( pt.x, pt.y );
1350 /***********************************************************************
1351 * UnrealizeObject (GDI.150)
1353 BOOL16 WINAPI UnrealizeObject16( HGDIOBJ16 obj )
1355 return UnrealizeObject( HGDIOBJ_32(obj) );
1359 /***********************************************************************
1360 * CreateIC (GDI.153)
1362 HDC16 WINAPI CreateIC16( LPCSTR driver, LPCSTR device, LPCSTR output,
1363 const DEVMODEA* initData )
1365 return HDC_16( CreateICA( driver, device, output, initData ) );
1369 /***********************************************************************
1370 * GetNearestColor (GDI.154)
1372 COLORREF WINAPI GetNearestColor16( HDC16 hdc, COLORREF color )
1374 return GetNearestColor( HDC_32(hdc), color );
1378 /***********************************************************************
1379 * CreateDiscardableBitmap (GDI.156)
1381 HBITMAP16 WINAPI CreateDiscardableBitmap16( HDC16 hdc, INT16 width, INT16 height )
1383 return HBITMAP_16( CreateDiscardableBitmap( HDC_32(hdc), width, height ) );
1387 /***********************************************************************
1388 * PtInRegion (GDI.161)
1390 BOOL16 WINAPI PtInRegion16( HRGN16 hrgn, INT16 x, INT16 y )
1392 return PtInRegion( HRGN_32(hrgn), x, y );
1396 /***********************************************************************
1397 * GetBitmapDimension (GDI.162)
1399 DWORD WINAPI GetBitmapDimension16( HBITMAP16 hbitmap )
1402 if (!GetBitmapDimensionEx16( hbitmap, &size )) return 0;
1403 return MAKELONG( size.cx, size.cy );
1407 /***********************************************************************
1408 * SetBitmapDimension (GDI.163)
1410 DWORD WINAPI SetBitmapDimension16( HBITMAP16 hbitmap, INT16 x, INT16 y )
1413 if (!SetBitmapDimensionEx16( hbitmap, x, y, &size )) return 0;
1414 return MAKELONG( size.cx, size.cy );
1418 /***********************************************************************
1419 * SetRectRgn (GDI.172)
1421 * NOTE: Win 3.1 sets region to empty if left > right
1423 void WINAPI SetRectRgn16( HRGN16 hrgn, INT16 left, INT16 top, INT16 right, INT16 bottom )
1425 if (left < right) SetRectRgn( HRGN_32(hrgn), left, top, right, bottom );
1426 else SetRectRgn( HRGN_32(hrgn), 0, 0, 0, 0 );
1430 /***********************************************************************
1431 * GetCharABCWidths (GDI.307)
1433 BOOL16 WINAPI GetCharABCWidths16( HDC16 hdc, UINT16 firstChar, UINT16 lastChar, LPABC16 abc )
1437 LPABC abc32 = HeapAlloc( GetProcessHeap(), 0, sizeof(ABC) * (lastChar - firstChar + 1) );
1439 if ((ret = GetCharABCWidthsA( HDC_32(hdc), firstChar, lastChar, abc32 )))
1441 for (i = firstChar; i <= lastChar; i++)
1443 abc[i-firstChar].abcA = abc32[i-firstChar].abcA;
1444 abc[i-firstChar].abcB = abc32[i-firstChar].abcB;
1445 abc[i-firstChar].abcC = abc32[i-firstChar].abcC;
1448 HeapFree( GetProcessHeap(), 0, abc32 );
1453 /***********************************************************************
1454 * CreateScalableFontResource (GDI.310)
1456 BOOL16 WINAPI CreateScalableFontResource16( UINT16 fHidden, LPCSTR lpszResourceFile,
1457 LPCSTR fontFile, LPCSTR path )
1459 return CreateScalableFontResourceA( fHidden, lpszResourceFile, fontFile, path );
1463 /*************************************************************************
1464 * GetFontData (GDI.311)
1467 DWORD WINAPI GetFontData16( HDC16 hdc, DWORD table, DWORD offset, LPVOID buffer, DWORD count )
1469 return GetFontData( HDC_32(hdc), table, offset, buffer, count );
1473 /*************************************************************************
1474 * GetRasterizerCaps (GDI.313)
1476 BOOL16 WINAPI GetRasterizerCaps16( LPRASTERIZER_STATUS lprs, UINT16 cbNumBytes )
1478 return GetRasterizerCaps( lprs, cbNumBytes );
1482 /*************************************************************************
1483 * GetKerningPairs (GDI.332)
1486 INT16 WINAPI GetKerningPairs16( HDC16 hdc, INT16 count, LPKERNINGPAIR16 pairs )
1488 KERNINGPAIR *pairs32;
1491 if (!count) return 0;
1493 if (!(pairs32 = HeapAlloc( GetProcessHeap(), 0, count * sizeof(*pairs32) ))) return 0;
1494 if ((ret = GetKerningPairsA( HDC_32(hdc), count, pairs32 )))
1496 for (i = 0; i < ret; i++)
1498 pairs->wFirst = pairs32->wFirst;
1499 pairs->wSecond = pairs32->wSecond;
1500 pairs->iKernAmount = pairs32->iKernAmount;
1503 HeapFree( GetProcessHeap(), 0, pairs32 );
1509 /***********************************************************************
1510 * GetTextAlign (GDI.345)
1512 UINT16 WINAPI GetTextAlign16( HDC16 hdc )
1514 return GetTextAlign( HDC_32(hdc) );
1518 /***********************************************************************
1519 * SetTextAlign (GDI.346)
1521 UINT16 WINAPI SetTextAlign16( HDC16 hdc, UINT16 align )
1523 return SetTextAlign( HDC_32(hdc), align );
1527 /***********************************************************************
1530 BOOL16 WINAPI Chord16( HDC16 hdc, INT16 left, INT16 top,
1531 INT16 right, INT16 bottom, INT16 xstart, INT16 ystart,
1532 INT16 xend, INT16 yend )
1534 return Chord( HDC_32(hdc), left, top, right, bottom, xstart, ystart, xend, yend );
1538 /***********************************************************************
1539 * SetMapperFlags (GDI.349)
1541 DWORD WINAPI SetMapperFlags16( HDC16 hdc, DWORD flags )
1543 return SetMapperFlags( HDC_32(hdc), flags );
1547 /***********************************************************************
1548 * GetCharWidth (GDI.350)
1550 BOOL16 WINAPI GetCharWidth16( HDC16 hdc, UINT16 firstChar, UINT16 lastChar, LPINT16 buffer )
1552 BOOL retVal = FALSE;
1554 if( firstChar != lastChar )
1556 LPINT buf32 = HeapAlloc(GetProcessHeap(), 0, sizeof(INT)*(1 + (lastChar - firstChar)));
1559 LPINT obuf32 = buf32;
1562 retVal = GetCharWidth32A( HDC_32(hdc), firstChar, lastChar, buf32);
1565 for (i = firstChar; i <= lastChar; i++) *buffer++ = *buf32++;
1567 HeapFree(GetProcessHeap(), 0, obuf32);
1570 else /* happens quite often to warrant a special treatment */
1573 retVal = GetCharWidth32A( HDC_32(hdc), firstChar, lastChar, &chWidth );
1580 /***********************************************************************
1581 * ExtTextOut (GDI.351)
1583 BOOL16 WINAPI ExtTextOut16( HDC16 hdc, INT16 x, INT16 y, UINT16 flags,
1584 const RECT16 *lprect, LPCSTR str, UINT16 count,
1590 LPINT lpdx32 = NULL;
1593 lpdx32 = (LPINT)HeapAlloc( GetProcessHeap(),0, sizeof(INT)*count );
1594 if(lpdx32 == NULL) return FALSE;
1595 for (i=count;i--;) lpdx32[i]=lpDx[i];
1597 if (lprect) CONV_RECT16TO32(lprect,&rect32);
1598 ret = ExtTextOutA(HDC_32(hdc),x,y,flags,lprect?&rect32:NULL,str,count,lpdx32);
1599 if (lpdx32) HeapFree( GetProcessHeap(), 0, lpdx32 );
1604 /***********************************************************************
1605 * CreatePalette (GDI.360)
1607 HPALETTE16 WINAPI CreatePalette16( const LOGPALETTE* palette )
1609 return HPALETTE_16( CreatePalette( palette ) );
1613 /***********************************************************************
1614 * GDISelectPalette (GDI.361)
1616 HPALETTE16 WINAPI GDISelectPalette16( HDC16 hdc, HPALETTE16 hpalette, WORD wBkg )
1618 return HPALETTE_16( GDISelectPalette( HDC_32(hdc), HPALETTE_32(hpalette), wBkg ));
1622 /***********************************************************************
1623 * GDIRealizePalette (GDI.362)
1625 UINT16 WINAPI GDIRealizePalette16( HDC16 hdc )
1627 return GDIRealizePalette( HDC_32(hdc) );
1631 /***********************************************************************
1632 * GetPaletteEntries (GDI.363)
1634 UINT16 WINAPI GetPaletteEntries16( HPALETTE16 hpalette, UINT16 start,
1635 UINT16 count, LPPALETTEENTRY entries )
1637 return GetPaletteEntries( HPALETTE_32(hpalette), start, count, entries );
1641 /***********************************************************************
1642 * SetPaletteEntries (GDI.364)
1644 UINT16 WINAPI SetPaletteEntries16( HPALETTE16 hpalette, UINT16 start,
1645 UINT16 count, const PALETTEENTRY *entries )
1647 return SetPaletteEntries( HPALETTE_32(hpalette), start, count, entries );
1651 /**********************************************************************
1652 * UpdateColors (GDI.366)
1654 INT16 WINAPI UpdateColors16( HDC16 hdc )
1656 UpdateColors( HDC_32(hdc) );
1661 /***********************************************************************
1662 * AnimatePalette (GDI.367)
1664 void WINAPI AnimatePalette16( HPALETTE16 hpalette, UINT16 StartIndex,
1665 UINT16 NumEntries, const PALETTEENTRY* PaletteColors)
1667 AnimatePalette( HPALETTE_32(hpalette), StartIndex, NumEntries, PaletteColors );
1671 /***********************************************************************
1672 * ResizePalette (GDI.368)
1674 BOOL16 WINAPI ResizePalette16( HPALETTE16 hpalette, UINT16 cEntries )
1676 return ResizePalette( HPALETTE_32(hpalette), cEntries );
1680 /***********************************************************************
1681 * GetNearestPaletteIndex (GDI.370)
1683 UINT16 WINAPI GetNearestPaletteIndex16( HPALETTE16 hpalette, COLORREF color )
1685 return GetNearestPaletteIndex( HPALETTE_32(hpalette), color );
1689 /**********************************************************************
1690 * ExtFloodFill (GDI.372)
1692 BOOL16 WINAPI ExtFloodFill16( HDC16 hdc, INT16 x, INT16 y, COLORREF color,
1695 return ExtFloodFill( HDC_32(hdc), x, y, color, fillType );
1699 /***********************************************************************
1700 * SetSystemPaletteUse (GDI.373)
1702 UINT16 WINAPI SetSystemPaletteUse16( HDC16 hdc, UINT16 use )
1704 return SetSystemPaletteUse( HDC_32(hdc), use );
1708 /***********************************************************************
1709 * GetSystemPaletteUse (GDI.374)
1711 UINT16 WINAPI GetSystemPaletteUse16( HDC16 hdc )
1713 return GetSystemPaletteUse( HDC_32(hdc) );
1717 /***********************************************************************
1718 * GetSystemPaletteEntries (GDI.375)
1720 UINT16 WINAPI GetSystemPaletteEntries16( HDC16 hdc, UINT16 start, UINT16 count,
1721 LPPALETTEENTRY entries )
1723 return GetSystemPaletteEntries( HDC_32(hdc), start, count, entries );
1727 /***********************************************************************
1730 HDC16 WINAPI ResetDC16( HDC16 hdc, const DEVMODEA *devmode )
1732 return HDC_16( ResetDCA(HDC_32(hdc), devmode) );
1736 /******************************************************************
1737 * StartDoc (GDI.377)
1739 INT16 WINAPI StartDoc16( HDC16 hdc, const DOCINFO16 *lpdoc )
1743 docA.cbSize = lpdoc->cbSize;
1744 docA.lpszDocName = MapSL(lpdoc->lpszDocName);
1745 docA.lpszOutput = MapSL(lpdoc->lpszOutput);
1746 if(lpdoc->cbSize > offsetof(DOCINFO16,lpszDatatype))
1747 docA.lpszDatatype = MapSL(lpdoc->lpszDatatype);
1749 docA.lpszDatatype = NULL;
1750 if(lpdoc->cbSize > offsetof(DOCINFO16,fwType))
1751 docA.fwType = lpdoc->fwType;
1754 return StartDocA( HDC_32(hdc), &docA );
1758 /******************************************************************
1761 INT16 WINAPI EndDoc16( HDC16 hdc )
1763 return EndDoc( HDC_32(hdc) );
1767 /******************************************************************
1768 * StartPage (GDI.379)
1770 INT16 WINAPI StartPage16( HDC16 hdc )
1772 return StartPage( HDC_32(hdc) );
1776 /******************************************************************
1779 INT16 WINAPI EndPage16( HDC16 hdc )
1781 return EndPage( HDC_32(hdc) );
1785 /******************************************************************************
1786 * AbortDoc (GDI.382)
1788 INT16 WINAPI AbortDoc16( HDC16 hdc )
1790 return AbortDoc( HDC_32(hdc) );
1794 /***********************************************************************
1795 * FastWindowFrame (GDI.400)
1797 BOOL16 WINAPI FastWindowFrame16( HDC16 hdc, const RECT16 *rect,
1798 INT16 width, INT16 height, DWORD rop )
1800 HDC hdc32 = HDC_32(hdc);
1801 HBRUSH hbrush = SelectObject( hdc32, GetStockObject( GRAY_BRUSH ) );
1802 PatBlt( hdc32, rect->left, rect->top,
1803 rect->right - rect->left - width, height, rop );
1804 PatBlt( hdc32, rect->left, rect->top + height, width,
1805 rect->bottom - rect->top - height, rop );
1806 PatBlt( hdc32, rect->left + width, rect->bottom - 1,
1807 rect->right - rect->left - width, -height, rop );
1808 PatBlt( hdc32, rect->right - 1, rect->top, -width,
1809 rect->bottom - rect->top - height, rop );
1810 SelectObject( hdc32, hbrush );
1815 /***********************************************************************
1816 * CreateUserBitmap (GDI.407)
1818 HBITMAP16 WINAPI CreateUserBitmap16( INT16 width, INT16 height, UINT16 planes,
1819 UINT16 bpp, LPCVOID bits )
1821 return CreateBitmap16( width, height, planes, bpp, bits );
1825 /***********************************************************************
1826 * CreateUserDiscardableBitmap (GDI.409)
1828 HBITMAP16 WINAPI CreateUserDiscardableBitmap16( WORD dummy, INT16 width, INT16 height )
1830 HDC hdc = CreateDCA( "DISPLAY", NULL, NULL, NULL );
1831 HBITMAP ret = CreateCompatibleBitmap( hdc, width, height );
1833 return HBITMAP_16(ret);
1837 /***********************************************************************
1838 * GetCurLogFont (GDI.411)
1840 HFONT16 WINAPI GetCurLogFont16( HDC16 hdc )
1842 return HFONT_16( GetCurrentObject( HDC_32(hdc), OBJ_FONT ) );
1846 /***********************************************************************
1847 * StretchDIBits (GDI.439)
1849 INT16 WINAPI StretchDIBits16( HDC16 hdc, INT16 xDst, INT16 yDst, INT16 widthDst,
1850 INT16 heightDst, INT16 xSrc, INT16 ySrc, INT16 widthSrc,
1851 INT16 heightSrc, const VOID *bits,
1852 const BITMAPINFO *info, UINT16 wUsage, DWORD dwRop )
1854 return StretchDIBits( HDC_32(hdc), xDst, yDst, widthDst, heightDst,
1855 xSrc, ySrc, widthSrc, heightSrc, bits,
1856 info, wUsage, dwRop );
1860 /***********************************************************************
1861 * SetDIBits (GDI.440)
1863 INT16 WINAPI SetDIBits16( HDC16 hdc, HBITMAP16 hbitmap, UINT16 startscan,
1864 UINT16 lines, LPCVOID bits, const BITMAPINFO *info,
1867 return SetDIBits( HDC_32(hdc), HBITMAP_32(hbitmap), startscan, lines, bits, info, coloruse );
1871 /***********************************************************************
1872 * GetDIBits (GDI.441)
1874 INT16 WINAPI GetDIBits16( HDC16 hdc, HBITMAP16 hbitmap, UINT16 startscan,
1875 UINT16 lines, LPVOID bits, BITMAPINFO * info,
1878 return GetDIBits( HDC_32(hdc), HBITMAP_32(hbitmap), startscan, lines, bits, info, coloruse );
1882 /***********************************************************************
1883 * CreateDIBitmap (GDI.442)
1885 HBITMAP16 WINAPI CreateDIBitmap16( HDC16 hdc, const BITMAPINFOHEADER * header,
1886 DWORD init, LPCVOID bits, const BITMAPINFO * data,
1889 return HBITMAP_16( CreateDIBitmap( HDC_32(hdc), header, init, bits, data, coloruse ) );
1893 /***********************************************************************
1894 * SetDIBitsToDevice (GDI.443)
1896 INT16 WINAPI SetDIBitsToDevice16( HDC16 hdc, INT16 xDest, INT16 yDest, INT16 cx,
1897 INT16 cy, INT16 xSrc, INT16 ySrc, UINT16 startscan,
1898 UINT16 lines, LPCVOID bits, const BITMAPINFO *info,
1901 return SetDIBitsToDevice( HDC_32(hdc), xDest, yDest, cx, cy, xSrc, ySrc,
1902 startscan, lines, bits, info, coloruse );
1906 /***********************************************************************
1907 * CreateRoundRectRgn (GDI.444)
1909 * If either ellipse dimension is zero we call CreateRectRgn16 for its
1910 * `special' behaviour. -ve ellipse dimensions can result in GPFs under win3.1
1911 * we just let CreateRoundRectRgn convert them to +ve values.
1914 HRGN16 WINAPI CreateRoundRectRgn16( INT16 left, INT16 top, INT16 right, INT16 bottom,
1915 INT16 ellipse_width, INT16 ellipse_height )
1917 if( ellipse_width == 0 || ellipse_height == 0 )
1918 return CreateRectRgn16( left, top, right, bottom );
1920 return HRGN_16( CreateRoundRectRgn( left, top, right, bottom,
1921 ellipse_width, ellipse_height ));
1925 /***********************************************************************
1926 * CreateDIBPatternBrush (GDI.445)
1928 HBRUSH16 WINAPI CreateDIBPatternBrush16( HGLOBAL16 hbitmap, UINT16 coloruse )
1933 if (!(bmi = GlobalLock16( hbitmap ))) return 0;
1934 ret = HBRUSH_16( CreateDIBPatternBrushPt( bmi, coloruse ));
1935 GlobalUnlock16( hbitmap );
1940 /**********************************************************************
1941 * PolyPolygon (GDI.450)
1943 BOOL16 WINAPI PolyPolygon16( HDC16 hdc, const POINT16* pt, const INT16* counts,
1952 for (i=polygons;i--;)
1954 pt32 = (LPPOINT)HeapAlloc( GetProcessHeap(), 0, sizeof(POINT)*nrpts);
1955 if(pt32 == NULL) return FALSE;
1957 CONV_POINT16TO32(&(pt[i]),&(pt32[i]));
1958 counts32 = (LPINT)HeapAlloc( GetProcessHeap(), 0, polygons*sizeof(INT) );
1959 if(counts32 == NULL) {
1960 HeapFree( GetProcessHeap(), 0, pt32 );
1963 for (i=polygons;i--;) counts32[i]=counts[i];
1965 ret = PolyPolygon(HDC_32(hdc),pt32,counts32,polygons);
1966 HeapFree( GetProcessHeap(), 0, counts32 );
1967 HeapFree( GetProcessHeap(), 0, pt32 );
1972 /***********************************************************************
1973 * CreatePolyPolygonRgn (GDI.451)
1975 HRGN16 WINAPI CreatePolyPolygonRgn16( const POINT16 *points,
1976 const INT16 *count, INT16 nbpolygons, INT16 mode )
1983 for (i = 0; i < nbpolygons; i++) npts += count[i];
1984 points32 = HeapAlloc( GetProcessHeap(), 0, npts * sizeof(POINT) );
1985 for (i = 0; i < npts; i++) CONV_POINT16TO32( &(points[i]), &(points32[i]) );
1987 count32 = HeapAlloc( GetProcessHeap(), 0, nbpolygons * sizeof(INT) );
1988 for (i = 0; i < nbpolygons; i++) count32[i] = count[i];
1989 hrgn = CreatePolyPolygonRgn( points32, count32, nbpolygons, mode );
1990 HeapFree( GetProcessHeap(), 0, count32 );
1991 HeapFree( GetProcessHeap(), 0, points32 );
1992 return HRGN_16(hrgn);
1996 /***********************************************************************
1997 * SetObjectOwner (GDI.461)
1999 void WINAPI SetObjectOwner16( HGDIOBJ16 handle, HANDLE16 owner )
2005 /***********************************************************************
2006 * RectVisible (GDI.465)
2007 * RectVisibleOld (GDI.104)
2009 BOOL16 WINAPI RectVisible16( HDC16 hdc, const RECT16* rect16 )
2012 CONV_RECT16TO32( rect16, &rect );
2013 return RectVisible( HDC_32(hdc), &rect );
2017 /***********************************************************************
2018 * RectInRegion (GDI.466)
2019 * RectInRegionOld (GDI.181)
2021 BOOL16 WINAPI RectInRegion16( HRGN16 hrgn, const RECT16 *rect )
2025 CONV_RECT16TO32(rect, &r32);
2026 return RectInRegion( HRGN_32(hrgn), &r32 );
2030 /***********************************************************************
2031 * GetBitmapDimensionEx (GDI.468)
2033 BOOL16 WINAPI GetBitmapDimensionEx16( HBITMAP16 hbitmap, LPSIZE16 size )
2036 BOOL ret = GetBitmapDimensionEx( HBITMAP_32(hbitmap), &size32 );
2040 size->cx = size32.cx;
2041 size->cy = size32.cy;
2047 /***********************************************************************
2048 * GetBrushOrgEx (GDI.469)
2050 BOOL16 WINAPI GetBrushOrgEx16( HDC16 hdc, LPPOINT16 pt )
2053 if (!GetBrushOrgEx( HDC_32(hdc), &pt32 )) return FALSE;
2060 /***********************************************************************
2061 * GetCurrentPositionEx (GDI.470)
2063 BOOL16 WINAPI GetCurrentPositionEx16( HDC16 hdc, LPPOINT16 pt )
2066 if (!GetCurrentPositionEx( HDC_32(hdc), &pt32 )) return FALSE;
2073 /***********************************************************************
2074 * GetTextExtentPoint (GDI.471)
2076 * FIXME: Should this have a bug for compatibility?
2077 * Original Windows versions of GetTextExtentPoint{A,W} have documented
2078 * bugs (-> MSDN KB q147647.txt).
2080 BOOL16 WINAPI GetTextExtentPoint16( HDC16 hdc, LPCSTR str, INT16 count, LPSIZE16 size )
2083 BOOL ret = GetTextExtentPoint32A( HDC_32(hdc), str, count, &size32 );
2087 size->cx = size32.cx;
2088 size->cy = size32.cy;
2094 /***********************************************************************
2095 * GetViewportExtEx (GDI.472)
2097 BOOL16 WINAPI GetViewportExtEx16( HDC16 hdc, LPSIZE16 size )
2100 if (!GetViewportExtEx( HDC_32(hdc), &size32 )) return FALSE;
2101 size->cx = size32.cx;
2102 size->cy = size32.cy;
2107 /***********************************************************************
2108 * GetViewportOrgEx (GDI.473)
2110 BOOL16 WINAPI GetViewportOrgEx16( HDC16 hdc, LPPOINT16 pt )
2113 if (!GetViewportOrgEx( HDC_32(hdc), &pt32 )) return FALSE;
2120 /***********************************************************************
2121 * GetWindowExtEx (GDI.474)
2123 BOOL16 WINAPI GetWindowExtEx16( HDC16 hdc, LPSIZE16 size )
2126 if (!GetWindowExtEx( HDC_32(hdc), &size32 )) return FALSE;
2127 size->cx = size32.cx;
2128 size->cy = size32.cy;
2133 /***********************************************************************
2134 * GetWindowOrgEx (GDI.475)
2136 BOOL16 WINAPI GetWindowOrgEx16( HDC16 hdc, LPPOINT16 pt )
2139 if (!GetWindowOrgEx( HDC_32(hdc), &pt32 )) return FALSE;
2146 /***********************************************************************
2147 * OffsetViewportOrgEx (GDI.476)
2149 BOOL16 WINAPI OffsetViewportOrgEx16( HDC16 hdc, INT16 x, INT16 y, LPPOINT16 pt)
2152 BOOL16 ret = OffsetViewportOrgEx( HDC_32(hdc), x, y, &pt32 );
2153 if (pt) CONV_POINT32TO16( &pt32, pt );
2158 /***********************************************************************
2159 * OffsetWindowOrgEx (GDI.477)
2161 BOOL16 WINAPI OffsetWindowOrgEx16( HDC16 hdc, INT16 x, INT16 y, LPPOINT16 pt )
2164 BOOL16 ret = OffsetWindowOrgEx( HDC_32(hdc), x, y, &pt32 );
2165 if (pt) CONV_POINT32TO16( &pt32, pt );
2170 /***********************************************************************
2171 * SetBitmapDimensionEx (GDI.478)
2173 BOOL16 WINAPI SetBitmapDimensionEx16( HBITMAP16 hbitmap, INT16 x, INT16 y, LPSIZE16 prevSize )
2176 BOOL ret = SetBitmapDimensionEx( HBITMAP_32(hbitmap), x, y, &size32 );
2178 if (ret && prevSize)
2180 prevSize->cx = size32.cx;
2181 prevSize->cy = size32.cy;
2187 /***********************************************************************
2188 * SetViewportExtEx (GDI.479)
2190 BOOL16 WINAPI SetViewportExtEx16( HDC16 hdc, INT16 x, INT16 y, LPSIZE16 size )
2193 BOOL16 ret = SetViewportExtEx( HDC_32(hdc), x, y, &size32 );
2194 if (size) { size->cx = size32.cx; size->cy = size32.cy; }
2199 /***********************************************************************
2200 * SetViewportOrgEx (GDI.480)
2202 BOOL16 WINAPI SetViewportOrgEx16( HDC16 hdc, INT16 x, INT16 y, LPPOINT16 pt )
2205 BOOL16 ret = SetViewportOrgEx( HDC_32(hdc), x, y, &pt32 );
2206 if (pt) CONV_POINT32TO16( &pt32, pt );
2211 /***********************************************************************
2212 * SetWindowExtEx (GDI.481)
2214 BOOL16 WINAPI SetWindowExtEx16( HDC16 hdc, INT16 x, INT16 y, LPSIZE16 size )
2217 BOOL16 ret = SetWindowExtEx( HDC_32(hdc), x, y, &size32 );
2218 if (size) { size->cx = size32.cx; size->cy = size32.cy; }
2223 /***********************************************************************
2224 * SetWindowOrgEx (GDI.482)
2226 BOOL16 WINAPI SetWindowOrgEx16( HDC16 hdc, INT16 x, INT16 y, LPPOINT16 pt )
2229 BOOL16 ret = SetWindowOrgEx( HDC_32(hdc), x, y, &pt32 );
2230 if (pt) CONV_POINT32TO16( &pt32, pt );
2235 /***********************************************************************
2236 * MoveToEx (GDI.483)
2238 BOOL16 WINAPI MoveToEx16( HDC16 hdc, INT16 x, INT16 y, LPPOINT16 pt )
2242 if (!MoveToEx( HDC_32(hdc), x, y, &pt32 )) return FALSE;
2243 if (pt) CONV_POINT32TO16( &pt32, pt );
2248 /***********************************************************************
2249 * ScaleViewportExtEx (GDI.484)
2251 BOOL16 WINAPI ScaleViewportExtEx16( HDC16 hdc, INT16 xNum, INT16 xDenom,
2252 INT16 yNum, INT16 yDenom, LPSIZE16 size )
2255 BOOL16 ret = ScaleViewportExtEx( HDC_32(hdc), xNum, xDenom, yNum, yDenom,
2257 if (size) { size->cx = size32.cx; size->cy = size32.cy; }
2262 /***********************************************************************
2263 * ScaleWindowExtEx (GDI.485)
2265 BOOL16 WINAPI ScaleWindowExtEx16( HDC16 hdc, INT16 xNum, INT16 xDenom,
2266 INT16 yNum, INT16 yDenom, LPSIZE16 size )
2269 BOOL16 ret = ScaleWindowExtEx( HDC_32(hdc), xNum, xDenom, yNum, yDenom,
2271 if (size) { size->cx = size32.cx; size->cy = size32.cy; }
2276 /******************************************************************************
2277 * PolyBezier (GDI.502)
2279 BOOL16 WINAPI PolyBezier16( HDC16 hdc, const POINT16* lppt, INT16 cPoints )
2283 LPPOINT pt32 = (LPPOINT)HeapAlloc( GetProcessHeap(), 0,
2284 cPoints*sizeof(POINT) );
2285 if(!pt32) return FALSE;
2286 for (i=cPoints;i--;) CONV_POINT16TO32(&(lppt[i]),&(pt32[i]));
2287 ret= PolyBezier(HDC_32(hdc), pt32, cPoints);
2288 HeapFree( GetProcessHeap(), 0, pt32 );
2293 /******************************************************************************
2294 * PolyBezierTo (GDI.503)
2296 BOOL16 WINAPI PolyBezierTo16( HDC16 hdc, const POINT16* lppt, INT16 cPoints )
2300 LPPOINT pt32 = (LPPOINT)HeapAlloc( GetProcessHeap(), 0,
2301 cPoints*sizeof(POINT) );
2302 if(!pt32) return FALSE;
2303 for (i=cPoints;i--;) CONV_POINT16TO32(&(lppt[i]),&(pt32[i]));
2304 ret= PolyBezierTo(HDC_32(hdc), pt32, cPoints);
2305 HeapFree( GetProcessHeap(), 0, pt32 );
2310 /******************************************************************************
2311 * ExtSelectClipRgn (GDI.508)
2313 INT16 WINAPI ExtSelectClipRgn16( HDC16 hdc, HRGN16 hrgn, INT16 fnMode )
2315 return ExtSelectClipRgn( HDC_32(hdc), HRGN_32(hrgn), fnMode);
2319 /***********************************************************************
2320 * AbortPath (GDI.511)
2322 BOOL16 WINAPI AbortPath16(HDC16 hdc)
2324 return AbortPath( HDC_32(hdc) );
2328 /***********************************************************************
2329 * BeginPath (GDI.512)
2331 BOOL16 WINAPI BeginPath16(HDC16 hdc)
2333 return BeginPath( HDC_32(hdc) );
2337 /***********************************************************************
2338 * CloseFigure (GDI.513)
2340 BOOL16 WINAPI CloseFigure16(HDC16 hdc)
2342 return CloseFigure( HDC_32(hdc) );
2346 /***********************************************************************
2349 BOOL16 WINAPI EndPath16(HDC16 hdc)
2351 return EndPath( HDC_32(hdc) );
2355 /***********************************************************************
2356 * FillPath (GDI.515)
2358 BOOL16 WINAPI FillPath16(HDC16 hdc)
2360 return FillPath( HDC_32(hdc) );
2364 /*******************************************************************
2365 * FlattenPath (GDI.516)
2367 BOOL16 WINAPI FlattenPath16(HDC16 hdc)
2369 return FlattenPath( HDC_32(hdc) );
2373 /***********************************************************************
2376 INT16 WINAPI GetPath16(HDC16 hdc, LPPOINT16 pPoints, LPBYTE pTypes, INT16 nSize)
2378 FIXME("(%d,%p,%p): stub\n",hdc,pPoints,pTypes);
2383 /***********************************************************************
2384 * PathToRegion (GDI.518)
2386 HRGN16 WINAPI PathToRegion16(HDC16 hdc)
2388 return HRGN_16( PathToRegion( HDC_32(hdc) ));
2392 /***********************************************************************
2393 * SelectClipPath (GDI.519)
2395 BOOL16 WINAPI SelectClipPath16(HDC16 hdc, INT16 iMode)
2397 return SelectClipPath( HDC_32(hdc), iMode );
2401 /*******************************************************************
2402 * StrokeAndFillPath (GDI.520)
2404 BOOL16 WINAPI StrokeAndFillPath16(HDC16 hdc)
2406 return StrokeAndFillPath( HDC_32(hdc) );
2410 /*******************************************************************
2411 * StrokePath (GDI.521)
2413 BOOL16 WINAPI StrokePath16(HDC16 hdc)
2415 return StrokePath( HDC_32(hdc) );
2419 /*******************************************************************
2420 * WidenPath (GDI.522)
2422 BOOL16 WINAPI WidenPath16(HDC16 hdc)
2424 return WidenPath( HDC_32(hdc) );
2428 /***********************************************************************
2429 * GetArcDirection (GDI.524)
2431 INT16 WINAPI GetArcDirection16( HDC16 hdc )
2433 return GetArcDirection( HDC_32(hdc) );
2437 /***********************************************************************
2438 * SetArcDirection (GDI.525)
2440 INT16 WINAPI SetArcDirection16( HDC16 hdc, INT16 nDirection )
2442 return SetArcDirection( HDC_32(hdc), (INT)nDirection );
2446 /***********************************************************************
2447 * CreateHalftonePalette (GDI.529)
2449 HPALETTE16 WINAPI CreateHalftonePalette16( HDC16 hdc )
2451 return HPALETTE_16( CreateHalftonePalette( HDC_32(hdc) ));
2455 /***********************************************************************
2456 * SetDIBColorTable (GDI.602)
2458 UINT16 WINAPI SetDIBColorTable16( HDC16 hdc, UINT16 startpos, UINT16 entries, RGBQUAD *colors )
2460 return SetDIBColorTable( HDC_32(hdc), startpos, entries, colors );
2464 /***********************************************************************
2465 * GetDIBColorTable (GDI.603)
2467 UINT16 WINAPI GetDIBColorTable16( HDC16 hdc, UINT16 startpos, UINT16 entries, RGBQUAD *colors )
2469 return GetDIBColorTable( HDC_32(hdc), startpos, entries, colors );
2473 /***********************************************************************
2474 * GetRegionData (GDI.607)
2476 * FIXME: is LPRGNDATA the same in Win16 and Win32 ?
2478 DWORD WINAPI GetRegionData16( HRGN16 hrgn, DWORD count, LPRGNDATA rgndata )
2480 return GetRegionData( HRGN_32(hrgn), count, rgndata );
2484 /***********************************************************************
2485 * GetTextCharset (GDI.612)
2487 UINT16 WINAPI GetTextCharset16( HDC16 hdc )
2489 return GetTextCharset( HDC_32(hdc) );
2493 /*************************************************************************
2494 * GetFontLanguageInfo (GDI.616)
2496 DWORD WINAPI GetFontLanguageInfo16( HDC16 hdc )
2498 return GetFontLanguageInfo( HDC_32(hdc) );
2502 /***********************************************************************
2503 * SetLayout (GDI.1000)
2505 * Sets left->right or right->left text layout flags of a dc.
2507 BOOL16 WINAPI SetLayout16( HDC16 hdc, DWORD layout )
2509 return SetLayout( HDC_32(hdc), layout );