4 * Copyright 2002 Alexandre Julliard
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
28 #include "wine/wingdi16.h"
29 #include "wine/list.h"
30 #include "wine/debug.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(gdi
);
34 #define HGDIOBJ_32(handle16) ((HGDIOBJ)(ULONG_PTR)(handle16))
35 #define HGDIOBJ_16(handle32) ((HGDIOBJ16)(ULONG_PTR)(handle32))
44 static struct list saved_regions
= LIST_INIT( saved_regions
);
46 static HPALETTE16 hPrimaryPalette
;
49 * ############################################################################
53 #define GDI_MAX_THUNKS 32
55 static struct gdi_thunk
57 BYTE popl_eax
; /* popl %eax (return address) */
58 BYTE pushl_pfn16
; /* pushl pfn16 */
59 DWORD pfn16
; /* pfn16 */
60 BYTE pushl_eax
; /* pushl %eax */
61 BYTE jmp
; /* ljmp GDI_Callback3216 */
68 /**********************************************************************
71 static BOOL CALLBACK
GDI_Callback3216( DWORD pfn16
, HDC hdc
, INT code
)
78 args
[1] = HDC_16(hdc
);
80 WOWCallback16Ex( pfn16
, WCB16_PASCAL
, sizeof(args
), args
, &ret
);
87 /******************************************************************
91 static struct gdi_thunk
* GDI_AddThunk(HDC16 dc16
, ABORTPROC16 pfn16
)
93 struct gdi_thunk
* thunk
;
97 GDI_Thunks
= VirtualAlloc(NULL
, GDI_MAX_THUNKS
* sizeof(*GDI_Thunks
),
98 MEM_COMMIT
, PAGE_EXECUTE_READWRITE
);
103 for (thunk
= GDI_Thunks
; thunk
< &GDI_Thunks
[GDI_MAX_THUNKS
]; thunk
++)
105 thunk
->popl_eax
= 0x58; /* popl %eax */
106 thunk
->pushl_pfn16
= 0x68; /* pushl pfn16 */
108 thunk
->pushl_eax
= 0x50; /* pushl %eax */
109 thunk
->jmp
= 0xe9; /* jmp GDI_Callback3216 */
110 thunk
->callback
= (char *)GDI_Callback3216
- (char *)(&thunk
->callback
+ 1);
113 for (thunk
= GDI_Thunks
; thunk
< &GDI_Thunks
[GDI_MAX_THUNKS
]; thunk
++)
115 if (thunk
->pfn16
== 0)
117 thunk
->pfn16
= (DWORD
)pfn16
;
122 FIXME("Out of mmdrv-thunks. Bump GDI_MAX_THUNKS\n");
126 /******************************************************************
129 static void GDI_DeleteThunk(struct gdi_thunk
* thunk
)
134 /******************************************************************
137 static struct gdi_thunk
* GDI_FindThunk(HDC16 hdc
)
139 struct gdi_thunk
* thunk
;
141 if (!GDI_Thunks
) return NULL
;
142 for (thunk
= GDI_Thunks
; thunk
< &GDI_Thunks
[GDI_MAX_THUNKS
]; thunk
++)
144 if (thunk
->hdc
== hdc
) return thunk
;
149 /**********************************************************************
150 * QueryAbort (GDI.155)
152 * Calls the app's AbortProc function if avail.
155 * TRUE if no AbortProc avail or AbortProc wants to continue printing.
156 * FALSE if AbortProc wants to abort printing.
158 BOOL16 WINAPI
QueryAbort16(HDC16 hdc16
, INT16 reserved
)
160 struct gdi_thunk
* thunk
= GDI_FindThunk(hdc16
);
163 ERR("Invalid hdc 0x%x\n", hdc16
);
166 return GDI_Callback3216( thunk
->pfn16
, HDC_32(hdc16
), 0 );
170 /**********************************************************************
171 * SetAbortProc (GDI.381)
173 INT16 WINAPI
SetAbortProc16(HDC16 hdc16
, ABORTPROC16 abrtprc
)
175 struct gdi_thunk
* thunk
;
177 thunk
= GDI_AddThunk(hdc16
, abrtprc
);
178 if (!thunk
) return FALSE
;
179 if (!SetAbortProc(HDC_32( hdc16
), (ABORTPROC
)thunk
))
181 GDI_DeleteThunk(thunk
);
188 * ############################################################################
191 struct callback16_info
197 /* callback for LineDDA16 */
198 static void CALLBACK
linedda_callback( INT x
, INT y
, LPARAM param
)
200 const struct callback16_info
*info
= (struct callback16_info
*)param
;
205 args
[1] = HIWORD(info
->param
);
206 args
[0] = LOWORD(info
->param
);
207 WOWCallback16Ex( (DWORD
)info
->proc
, WCB16_PASCAL
, sizeof(args
), args
, NULL
);
210 /* callback for EnumObjects16 */
211 static INT CALLBACK
enum_pens_callback( void *ptr
, LPARAM param
)
213 const struct callback16_info
*info
= (struct callback16_info
*)param
;
220 pen16
.lopnStyle
= pen
->lopnStyle
;
221 pen16
.lopnWidth
.x
= pen
->lopnWidth
.x
;
222 pen16
.lopnWidth
.y
= pen
->lopnWidth
.y
;
223 pen16
.lopnColor
= pen
->lopnColor
;
224 segptr
= MapLS( &pen16
);
225 args
[3] = SELECTOROF(segptr
);
226 args
[2] = OFFSETOF(segptr
);
227 args
[1] = HIWORD(info
->param
);
228 args
[0] = LOWORD(info
->param
);
229 WOWCallback16Ex( (DWORD
)info
->proc
, WCB16_PASCAL
, sizeof(args
), args
, &ret
);
234 /* callback for EnumObjects16 */
235 static INT CALLBACK
enum_brushes_callback( void *ptr
, LPARAM param
)
237 const struct callback16_info
*info
= (struct callback16_info
*)param
;
238 LOGBRUSH
*brush
= ptr
;
244 brush16
.lbStyle
= brush
->lbStyle
;
245 brush16
.lbColor
= brush
->lbColor
;
246 brush16
.lbHatch
= brush
->lbHatch
;
247 segptr
= MapLS( &brush16
);
248 args
[3] = SELECTOROF(segptr
);
249 args
[2] = OFFSETOF(segptr
);
250 args
[1] = HIWORD(info
->param
);
251 args
[0] = LOWORD(info
->param
);
252 WOWCallback16Ex( (DWORD
)info
->proc
, WCB16_PASCAL
, sizeof(args
), args
, &ret
);
257 /* convert a LOGFONT16 to a LOGFONTW */
258 static void logfont_16_to_W( const LOGFONT16
*font16
, LPLOGFONTW font32
)
260 font32
->lfHeight
= font16
->lfHeight
;
261 font32
->lfWidth
= font16
->lfWidth
;
262 font32
->lfEscapement
= font16
->lfEscapement
;
263 font32
->lfOrientation
= font16
->lfOrientation
;
264 font32
->lfWeight
= font16
->lfWeight
;
265 font32
->lfItalic
= font16
->lfItalic
;
266 font32
->lfUnderline
= font16
->lfUnderline
;
267 font32
->lfStrikeOut
= font16
->lfStrikeOut
;
268 font32
->lfCharSet
= font16
->lfCharSet
;
269 font32
->lfOutPrecision
= font16
->lfOutPrecision
;
270 font32
->lfClipPrecision
= font16
->lfClipPrecision
;
271 font32
->lfQuality
= font16
->lfQuality
;
272 font32
->lfPitchAndFamily
= font16
->lfPitchAndFamily
;
273 MultiByteToWideChar( CP_ACP
, 0, font16
->lfFaceName
, -1, font32
->lfFaceName
, LF_FACESIZE
);
274 font32
->lfFaceName
[LF_FACESIZE
-1] = 0;
277 /* convert a LOGFONTW to a LOGFONT16 */
278 static void logfont_W_to_16( const LOGFONTW
* font32
, LPLOGFONT16 font16
)
280 font16
->lfHeight
= font32
->lfHeight
;
281 font16
->lfWidth
= font32
->lfWidth
;
282 font16
->lfEscapement
= font32
->lfEscapement
;
283 font16
->lfOrientation
= font32
->lfOrientation
;
284 font16
->lfWeight
= font32
->lfWeight
;
285 font16
->lfItalic
= font32
->lfItalic
;
286 font16
->lfUnderline
= font32
->lfUnderline
;
287 font16
->lfStrikeOut
= font32
->lfStrikeOut
;
288 font16
->lfCharSet
= font32
->lfCharSet
;
289 font16
->lfOutPrecision
= font32
->lfOutPrecision
;
290 font16
->lfClipPrecision
= font32
->lfClipPrecision
;
291 font16
->lfQuality
= font32
->lfQuality
;
292 font16
->lfPitchAndFamily
= font32
->lfPitchAndFamily
;
293 WideCharToMultiByte( CP_ACP
, 0, font32
->lfFaceName
, -1, font16
->lfFaceName
, LF_FACESIZE
, NULL
, NULL
);
294 font16
->lfFaceName
[LF_FACESIZE
-1] = 0;
297 /* convert a ENUMLOGFONTEXW to a ENUMLOGFONTEX16 */
298 static void enumlogfontex_W_to_16( const ENUMLOGFONTEXW
*fontW
,
299 LPENUMLOGFONTEX16 font16
)
301 logfont_W_to_16( (const LOGFONTW
*)fontW
, (LPLOGFONT16
)font16
);
303 WideCharToMultiByte( CP_ACP
, 0, fontW
->elfFullName
, -1,
304 (LPSTR
) font16
->elfFullName
, LF_FULLFACESIZE
, NULL
, NULL
);
305 font16
->elfFullName
[LF_FULLFACESIZE
-1] = '\0';
306 WideCharToMultiByte( CP_ACP
, 0, fontW
->elfStyle
, -1,
307 (LPSTR
) font16
->elfStyle
, LF_FACESIZE
, NULL
, NULL
);
308 font16
->elfStyle
[LF_FACESIZE
-1] = '\0';
309 WideCharToMultiByte( CP_ACP
, 0, fontW
->elfScript
, -1,
310 (LPSTR
) font16
->elfScript
, LF_FACESIZE
, NULL
, NULL
);
311 font16
->elfScript
[LF_FACESIZE
-1] = '\0';
314 /* convert a NEWTEXTMETRICEXW to a NEWTEXTMETRICEX16 */
315 static void newtextmetricex_W_to_16( const NEWTEXTMETRICEXW
*ptmW
,
316 LPNEWTEXTMETRICEX16 ptm16
)
318 ptm16
->ntmTm
.tmHeight
= ptmW
->ntmTm
.tmHeight
;
319 ptm16
->ntmTm
.tmAscent
= ptmW
->ntmTm
.tmAscent
;
320 ptm16
->ntmTm
.tmDescent
= ptmW
->ntmTm
.tmDescent
;
321 ptm16
->ntmTm
.tmInternalLeading
= ptmW
->ntmTm
.tmInternalLeading
;
322 ptm16
->ntmTm
.tmExternalLeading
= ptmW
->ntmTm
.tmExternalLeading
;
323 ptm16
->ntmTm
.tmAveCharWidth
= ptmW
->ntmTm
.tmAveCharWidth
;
324 ptm16
->ntmTm
.tmMaxCharWidth
= ptmW
->ntmTm
.tmMaxCharWidth
;
325 ptm16
->ntmTm
.tmWeight
= ptmW
->ntmTm
.tmWeight
;
326 ptm16
->ntmTm
.tmOverhang
= ptmW
->ntmTm
.tmOverhang
;
327 ptm16
->ntmTm
.tmDigitizedAspectX
= ptmW
->ntmTm
.tmDigitizedAspectX
;
328 ptm16
->ntmTm
.tmDigitizedAspectY
= ptmW
->ntmTm
.tmDigitizedAspectY
;
329 ptm16
->ntmTm
.tmFirstChar
= ptmW
->ntmTm
.tmFirstChar
> 255 ? 255 : ptmW
->ntmTm
.tmFirstChar
;
330 ptm16
->ntmTm
.tmLastChar
= ptmW
->ntmTm
.tmLastChar
> 255 ? 255 : ptmW
->ntmTm
.tmLastChar
;
331 ptm16
->ntmTm
.tmDefaultChar
= ptmW
->ntmTm
.tmDefaultChar
> 255 ? 255 : ptmW
->ntmTm
.tmDefaultChar
;
332 ptm16
->ntmTm
.tmBreakChar
= ptmW
->ntmTm
.tmBreakChar
> 255 ? 255 : ptmW
->ntmTm
.tmBreakChar
;
333 ptm16
->ntmTm
.tmItalic
= ptmW
->ntmTm
.tmItalic
;
334 ptm16
->ntmTm
.tmUnderlined
= ptmW
->ntmTm
.tmUnderlined
;
335 ptm16
->ntmTm
.tmStruckOut
= ptmW
->ntmTm
.tmStruckOut
;
336 ptm16
->ntmTm
.tmPitchAndFamily
= ptmW
->ntmTm
.tmPitchAndFamily
;
337 ptm16
->ntmTm
.tmCharSet
= ptmW
->ntmTm
.tmCharSet
;
338 ptm16
->ntmTm
.ntmFlags
= ptmW
->ntmTm
.ntmFlags
;
339 ptm16
->ntmTm
.ntmSizeEM
= ptmW
->ntmTm
.ntmSizeEM
;
340 ptm16
->ntmTm
.ntmCellHeight
= ptmW
->ntmTm
.ntmCellHeight
;
341 ptm16
->ntmTm
.ntmAvgWidth
= ptmW
->ntmTm
.ntmAvgWidth
;
342 ptm16
->ntmFontSig
= ptmW
->ntmFontSig
;
346 * callback for EnumFontFamiliesEx16
347 * Note: plf is really an ENUMLOGFONTEXW, and ptm is a NEWTEXTMETRICEXW.
348 * We have to use other types because of the FONTENUMPROCW definition.
350 static INT CALLBACK
enum_font_callback( const LOGFONTW
*plf
,
351 const TEXTMETRICW
*ptm
, DWORD fType
,
354 const struct callback16_info
*info
= (struct callback16_info
*)param
;
355 ENUMLOGFONTEX16 elfe16
;
356 NEWTEXTMETRICEX16 ntm16
;
362 enumlogfontex_W_to_16((const ENUMLOGFONTEXW
*)plf
, &elfe16
);
363 newtextmetricex_W_to_16((const NEWTEXTMETRICEXW
*)ptm
, &ntm16
);
364 segelfe16
= MapLS( &elfe16
);
365 segntm16
= MapLS( &ntm16
);
366 args
[6] = SELECTOROF(segelfe16
);
367 args
[5] = OFFSETOF(segelfe16
);
368 args
[4] = SELECTOROF(segntm16
);
369 args
[3] = OFFSETOF(segntm16
);
371 args
[1] = HIWORD(info
->param
);
372 args
[0] = LOWORD(info
->param
);
374 WOWCallback16Ex( (DWORD
)info
->proc
, WCB16_PASCAL
, sizeof(args
), args
, &ret
);
375 UnMapLS( segelfe16
);
380 struct dib_segptr_bits
388 static struct list dib_segptr_list
= LIST_INIT( dib_segptr_list
);
390 static SEGPTR
alloc_segptr_bits( HBITMAP bmp
, void *bits32
)
393 unsigned int i
, size
;
394 struct dib_segptr_bits
*bits
;
396 if (!(bits
= HeapAlloc( GetProcessHeap(), 0, sizeof(*bits
) ))) return 0;
398 GetObjectW( bmp
, sizeof(dib
), &dib
);
399 size
= dib
.dsBm
.bmHeight
* dib
.dsBm
.bmWidthBytes
;
401 /* calculate number of sel's needed for size with 64K steps */
402 bits
->bmp
= HBITMAP_16( bmp
);
403 bits
->count
= (size
+ 0xffff) / 0x10000;
404 bits
->sel
= AllocSelectorArray16( bits
->count
);
406 for (i
= 0; i
< bits
->count
; i
++)
408 SetSelectorBase(bits
->sel
+ (i
<< __AHSHIFT
), (DWORD
)bits32
+ i
* 0x10000);
409 SetSelectorLimit16(bits
->sel
+ (i
<< __AHSHIFT
), size
- 1); /* yep, limit is correct */
412 list_add_head( &dib_segptr_list
, &bits
->entry
);
413 return MAKESEGPTR( bits
->sel
, 0 );
416 static void free_segptr_bits( HBITMAP16 bmp
)
419 struct dib_segptr_bits
*bits
;
421 LIST_FOR_EACH_ENTRY( bits
, &dib_segptr_list
, struct dib_segptr_bits
, entry
)
423 if (bits
->bmp
!= bmp
) continue;
424 for (i
= 0; i
< bits
->count
; i
++) FreeSelector16( bits
->sel
+ (i
<< __AHSHIFT
) );
426 list_remove( &bits
->entry
);
427 HeapFree( GetProcessHeap(), 0, bits
);
433 /***********************************************************************
436 COLORREF WINAPI
SetBkColor16( HDC16 hdc
, COLORREF color
)
438 return SetBkColor( HDC_32(hdc
), color
);
442 /***********************************************************************
445 INT16 WINAPI
SetBkMode16( HDC16 hdc
, INT16 mode
)
447 return SetBkMode( HDC_32(hdc
), mode
);
451 /***********************************************************************
454 INT16 WINAPI
SetMapMode16( HDC16 hdc
, INT16 mode
)
456 return SetMapMode( HDC_32(hdc
), mode
);
460 /***********************************************************************
463 INT16 WINAPI
SetROP216( HDC16 hdc
, INT16 mode
)
465 return SetROP2( HDC_32(hdc
), mode
);
469 /***********************************************************************
472 INT16 WINAPI
SetRelAbs16( HDC16 hdc
, INT16 mode
)
474 return SetRelAbs( HDC_32(hdc
), mode
);
478 /***********************************************************************
479 * SetPolyFillMode (GDI.6)
481 INT16 WINAPI
SetPolyFillMode16( HDC16 hdc
, INT16 mode
)
483 return SetPolyFillMode( HDC_32(hdc
), mode
);
487 /***********************************************************************
488 * SetStretchBltMode (GDI.7)
490 INT16 WINAPI
SetStretchBltMode16( HDC16 hdc
, INT16 mode
)
492 return SetStretchBltMode( HDC_32(hdc
), mode
);
496 /***********************************************************************
497 * SetTextCharacterExtra (GDI.8)
499 INT16 WINAPI
SetTextCharacterExtra16( HDC16 hdc
, INT16 extra
)
501 return SetTextCharacterExtra( HDC_32(hdc
), extra
);
505 /***********************************************************************
506 * SetTextColor (GDI.9)
508 COLORREF WINAPI
SetTextColor16( HDC16 hdc
, COLORREF color
)
510 return SetTextColor( HDC_32(hdc
), color
);
514 /***********************************************************************
515 * SetTextJustification (GDI.10)
517 INT16 WINAPI
SetTextJustification16( HDC16 hdc
, INT16 extra
, INT16 breaks
)
519 return SetTextJustification( HDC_32(hdc
), extra
, breaks
);
523 /***********************************************************************
524 * SetWindowOrg (GDI.11)
526 DWORD WINAPI
SetWindowOrg16( HDC16 hdc
, INT16 x
, INT16 y
)
529 if (!SetWindowOrgEx( HDC_32(hdc
), x
, y
, &pt
)) return 0;
530 return MAKELONG( pt
.x
, pt
.y
);
534 /***********************************************************************
535 * SetWindowExt (GDI.12)
537 DWORD WINAPI
SetWindowExt16( HDC16 hdc
, INT16 x
, INT16 y
)
540 if (!SetWindowExtEx( HDC_32(hdc
), x
, y
, &size
)) return 0;
541 return MAKELONG( size
.cx
, size
.cy
);
545 /***********************************************************************
546 * SetViewportOrg (GDI.13)
548 DWORD WINAPI
SetViewportOrg16( HDC16 hdc
, INT16 x
, INT16 y
)
551 if (!SetViewportOrgEx( HDC_32(hdc
), x
, y
, &pt
)) return 0;
552 return MAKELONG( pt
.x
, pt
.y
);
556 /***********************************************************************
557 * SetViewportExt (GDI.14)
559 DWORD WINAPI
SetViewportExt16( HDC16 hdc
, INT16 x
, INT16 y
)
562 if (!SetViewportExtEx( HDC_32(hdc
), x
, y
, &size
)) return 0;
563 return MAKELONG( size
.cx
, size
.cy
);
567 /***********************************************************************
568 * OffsetWindowOrg (GDI.15)
570 DWORD WINAPI
OffsetWindowOrg16( HDC16 hdc
, INT16 x
, INT16 y
)
573 if (!OffsetWindowOrgEx( HDC_32(hdc
), x
, y
, &pt
)) return 0;
574 return MAKELONG( pt
.x
, pt
.y
);
578 /***********************************************************************
579 * ScaleWindowExt (GDI.16)
581 DWORD WINAPI
ScaleWindowExt16( HDC16 hdc
, INT16 xNum
, INT16 xDenom
,
582 INT16 yNum
, INT16 yDenom
)
585 if (!ScaleWindowExtEx( HDC_32(hdc
), xNum
, xDenom
, yNum
, yDenom
, &size
))
587 return MAKELONG( size
.cx
, size
.cy
);
591 /***********************************************************************
592 * OffsetViewportOrg (GDI.17)
594 DWORD WINAPI
OffsetViewportOrg16( HDC16 hdc
, INT16 x
, INT16 y
)
597 if (!OffsetViewportOrgEx( HDC_32(hdc
), x
, y
, &pt
)) return 0;
598 return MAKELONG( pt
.x
, pt
.y
);
602 /***********************************************************************
603 * ScaleViewportExt (GDI.18)
605 DWORD WINAPI
ScaleViewportExt16( HDC16 hdc
, INT16 xNum
, INT16 xDenom
,
606 INT16 yNum
, INT16 yDenom
)
609 if (!ScaleViewportExtEx( HDC_32(hdc
), xNum
, xDenom
, yNum
, yDenom
, &size
))
611 return MAKELONG( size
.cx
, size
.cy
);
615 /***********************************************************************
618 BOOL16 WINAPI
LineTo16( HDC16 hdc
, INT16 x
, INT16 y
)
620 return LineTo( HDC_32(hdc
), x
, y
);
624 /***********************************************************************
627 DWORD WINAPI
MoveTo16( HDC16 hdc
, INT16 x
, INT16 y
)
631 if (!MoveToEx( HDC_32(hdc
), x
, y
, &pt
)) return 0;
632 return MAKELONG(pt
.x
,pt
.y
);
636 /***********************************************************************
637 * ExcludeClipRect (GDI.21)
639 INT16 WINAPI
ExcludeClipRect16( HDC16 hdc
, INT16 left
, INT16 top
,
640 INT16 right
, INT16 bottom
)
642 return ExcludeClipRect( HDC_32(hdc
), left
, top
, right
, bottom
);
646 /***********************************************************************
647 * IntersectClipRect (GDI.22)
649 INT16 WINAPI
IntersectClipRect16( HDC16 hdc
, INT16 left
, INT16 top
,
650 INT16 right
, INT16 bottom
)
652 return IntersectClipRect( HDC_32(hdc
), left
, top
, right
, bottom
);
656 /***********************************************************************
659 BOOL16 WINAPI
Arc16( HDC16 hdc
, INT16 left
, INT16 top
, INT16 right
,
660 INT16 bottom
, INT16 xstart
, INT16 ystart
,
661 INT16 xend
, INT16 yend
)
663 return Arc( HDC_32(hdc
), left
, top
, right
, bottom
, xstart
, ystart
, xend
, yend
);
667 /***********************************************************************
670 BOOL16 WINAPI
Ellipse16( HDC16 hdc
, INT16 left
, INT16 top
,
671 INT16 right
, INT16 bottom
)
673 return Ellipse( HDC_32(hdc
), left
, top
, right
, bottom
);
677 /**********************************************************************
680 BOOL16 WINAPI
FloodFill16( HDC16 hdc
, INT16 x
, INT16 y
, COLORREF color
)
682 return ExtFloodFill( HDC_32(hdc
), x
, y
, color
, FLOODFILLBORDER
);
686 /***********************************************************************
689 BOOL16 WINAPI
Pie16( HDC16 hdc
, INT16 left
, INT16 top
,
690 INT16 right
, INT16 bottom
, INT16 xstart
, INT16 ystart
,
691 INT16 xend
, INT16 yend
)
693 return Pie( HDC_32(hdc
), left
, top
, right
, bottom
, xstart
, ystart
, xend
, yend
);
697 /***********************************************************************
700 BOOL16 WINAPI
Rectangle16( HDC16 hdc
, INT16 left
, INT16 top
,
701 INT16 right
, INT16 bottom
)
703 return Rectangle( HDC_32(hdc
), left
, top
, right
, bottom
);
707 /***********************************************************************
710 BOOL16 WINAPI
RoundRect16( HDC16 hdc
, INT16 left
, INT16 top
, INT16 right
,
711 INT16 bottom
, INT16 ell_width
, INT16 ell_height
)
713 return RoundRect( HDC_32(hdc
), left
, top
, right
, bottom
, ell_width
, ell_height
);
717 /***********************************************************************
720 BOOL16 WINAPI
PatBlt16( HDC16 hdc
, INT16 left
, INT16 top
,
721 INT16 width
, INT16 height
, DWORD rop
)
723 return PatBlt( HDC_32(hdc
), left
, top
, width
, height
, rop
);
727 /***********************************************************************
730 INT16 WINAPI
SaveDC16( HDC16 hdc
)
732 return SaveDC( HDC_32(hdc
) );
736 /***********************************************************************
739 COLORREF WINAPI
SetPixel16( HDC16 hdc
, INT16 x
, INT16 y
, COLORREF color
)
741 return SetPixel( HDC_32(hdc
), x
, y
, color
);
745 /***********************************************************************
746 * OffsetClipRgn (GDI.32)
748 INT16 WINAPI
OffsetClipRgn16( HDC16 hdc
, INT16 x
, INT16 y
)
750 return OffsetClipRgn( HDC_32(hdc
), x
, y
);
754 /***********************************************************************
757 BOOL16 WINAPI
TextOut16( HDC16 hdc
, INT16 x
, INT16 y
, LPCSTR str
, INT16 count
)
759 return TextOutA( HDC_32(hdc
), x
, y
, str
, count
);
763 /***********************************************************************
766 BOOL16 WINAPI
BitBlt16( HDC16 hdcDst
, INT16 xDst
, INT16 yDst
, INT16 width
,
767 INT16 height
, HDC16 hdcSrc
, INT16 xSrc
, INT16 ySrc
,
770 return BitBlt( HDC_32(hdcDst
), xDst
, yDst
, width
, height
, HDC_32(hdcSrc
), xSrc
, ySrc
, rop
);
774 /***********************************************************************
775 * StretchBlt (GDI.35)
777 BOOL16 WINAPI
StretchBlt16( HDC16 hdcDst
, INT16 xDst
, INT16 yDst
,
778 INT16 widthDst
, INT16 heightDst
,
779 HDC16 hdcSrc
, INT16 xSrc
, INT16 ySrc
,
780 INT16 widthSrc
, INT16 heightSrc
, DWORD rop
)
782 return StretchBlt( HDC_32(hdcDst
), xDst
, yDst
, widthDst
, heightDst
,
783 HDC_32(hdcSrc
), xSrc
, ySrc
, widthSrc
, heightSrc
, rop
);
787 /**********************************************************************
790 BOOL16 WINAPI
Polygon16( HDC16 hdc
, const POINT16
* pt
, INT16 count
)
794 LPPOINT pt32
= HeapAlloc( GetProcessHeap(), 0, count
*sizeof(POINT
) );
796 if (!pt32
) return FALSE
;
802 ret
= Polygon(HDC_32(hdc
),pt32
,count
);
803 HeapFree( GetProcessHeap(), 0, pt32
);
808 /**********************************************************************
811 BOOL16 WINAPI
Polyline16( HDC16 hdc
, const POINT16
* pt
, INT16 count
)
815 LPPOINT pt32
= HeapAlloc( GetProcessHeap(), 0, count
*sizeof(POINT
) );
817 if (!pt32
) return FALSE
;
823 ret
= Polyline(HDC_32(hdc
),pt32
,count
);
824 HeapFree( GetProcessHeap(), 0, pt32
);
829 /***********************************************************************
832 INT16 WINAPI
Escape16( HDC16 hdc
, INT16 escape
, INT16 in_count
, SEGPTR in_data
, LPVOID out_data
)
838 /* Escape(hdc,CLIP_TO_PATH,LPINT16,NULL) */
839 /* Escape(hdc,DRAFTMODE,LPINT16,NULL) */
840 /* Escape(hdc,ENUMPAPERBINS,LPINT16,LPSTR); */
841 /* Escape(hdc,EPSPRINTING,LPINT16,NULL) */
842 /* Escape(hdc,EXT_DEVICE_CAPS,LPINT16,LPDWORD) */
843 /* Escape(hdc,GETCOLORTABLE,LPINT16,LPDWORD) */
844 /* Escape(hdc,MOUSETRAILS,LPINT16,NULL) */
845 /* Escape(hdc,POSTSCRIPT_IGNORE,LPINT16,NULL) */
846 /* Escape(hdc,QUERYESCSUPPORT,LPINT16,NULL) */
847 /* Escape(hdc,SET_ARC_DIRECTION,LPINT16,NULL) */
848 /* Escape(hdc,SET_POLY_MODE,LPINT16,NULL) */
849 /* Escape(hdc,SET_SCREEN_ANGLE,LPINT16,NULL) */
850 /* Escape(hdc,SET_SPREAD,LPINT16,NULL) */
855 case EXT_DEVICE_CAPS
:
858 case POSTSCRIPT_IGNORE
:
859 case QUERYESCSUPPORT
:
860 case SET_ARC_DIRECTION
:
862 case SET_SCREEN_ANGLE
:
865 INT16
*ptr
= MapSL(in_data
);
867 return Escape( HDC_32(hdc
), escape
, sizeof(data
), (LPCSTR
)&data
, out_data
);
870 /* Escape(hdc,ENABLEDUPLEX,LPUINT16,NULL) */
873 UINT16
*ptr
= MapSL(in_data
);
875 return Escape( HDC_32(hdc
), escape
, sizeof(data
), (LPCSTR
)&data
, NULL
);
878 /* Escape(hdc,GETPHYSPAGESIZE,NULL,LPPOINT16) */
879 /* Escape(hdc,GETPRINTINGOFFSET,NULL,LPPOINT16) */
880 /* Escape(hdc,GETSCALINGFACTOR,NULL,LPPOINT16) */
881 case GETPHYSPAGESIZE
:
882 case GETPRINTINGOFFSET
:
883 case GETSCALINGFACTOR
:
885 POINT16
*ptr
= out_data
;
887 ret
= Escape( HDC_32(hdc
), escape
, 0, NULL
, &pt32
);
893 /* Escape(hdc,ENABLEPAIRKERNING,LPINT16,LPINT16); */
894 /* Escape(hdc,ENABLERELATIVEWIDTHS,LPINT16,LPINT16); */
895 /* Escape(hdc,SETCOPYCOUNT,LPINT16,LPINT16) */
896 /* Escape(hdc,SETKERNTRACK,LPINT16,LPINT16) */
897 /* Escape(hdc,SETLINECAP,LPINT16,LPINT16) */
898 /* Escape(hdc,SETLINEJOIN,LPINT16,LPINT16) */
899 /* Escape(hdc,SETMITERLIMIT,LPINT16,LPINT16) */
900 case ENABLEPAIRKERNING
:
901 case ENABLERELATIVEWIDTHS
:
908 INT16
*new = MapSL(in_data
);
909 INT16
*old
= out_data
;
911 ret
= Escape( HDC_32(hdc
), escape
, sizeof(in
), (LPCSTR
)&in
, &out
);
916 /* Escape(hdc,SETABORTPROC,ABORTPROC,NULL); */
918 return SetAbortProc16( hdc
, (ABORTPROC16
)in_data
);
920 /* Escape(hdc,STARTDOC,LPSTR,LPDOCINFO16);
921 * lpvOutData is actually a pointer to the DocInfo structure and used as
922 * a second input parameter */
926 ret
= StartDoc16( hdc
, out_data
);
927 if (ret
> 0) ret
= StartPage( HDC_32(hdc
) );
930 return Escape( HDC_32(hdc
), escape
, in_count
, MapSL(in_data
), NULL
);
932 /* Escape(hdc,SET_BOUNDS,LPRECT16,NULL); */
933 /* Escape(hdc,SET_CLIP_BOX,LPRECT16,NULL); */
937 RECT16
*rc16
= MapSL(in_data
);
939 rc
.left
= rc16
->left
;
941 rc
.right
= rc16
->right
;
942 rc
.bottom
= rc16
->bottom
;
943 return Escape( HDC_32(hdc
), escape
, sizeof(rc
), (LPCSTR
)&rc
, NULL
);
946 /* Escape(hdc,NEXTBAND,NULL,LPRECT16); */
950 RECT16
*rc16
= out_data
;
951 ret
= Escape( HDC_32(hdc
), escape
, 0, NULL
, &rc
);
952 rc16
->left
= rc
.left
;
954 rc16
->right
= rc
.right
;
955 rc16
->bottom
= rc
.bottom
;
958 /* Escape(hdc,DRAWPATTERNRECT,PRECT_STRUCT*,NULL); */
959 case DRAWPATTERNRECT
:
962 DRAWPATRECT16
*pr16
= MapSL(in_data
);
964 pr
.ptPosition
.x
= pr16
->ptPosition
.x
;
965 pr
.ptPosition
.y
= pr16
->ptPosition
.y
;
966 pr
.ptSize
.x
= pr16
->ptSize
.x
;
967 pr
.ptSize
.y
= pr16
->ptSize
.y
;
968 pr
.wStyle
= pr16
->wStyle
;
969 pr
.wPattern
= pr16
->wPattern
;
970 return Escape( HDC_32(hdc
), escape
, sizeof(pr
), (LPCSTR
)&pr
, NULL
);
973 /* Escape(hdc,ABORTDOC,NULL,NULL); */
974 /* Escape(hdc,BANDINFO,BANDINFOSTRUCT*,BANDINFOSTRUCT*); */
975 /* Escape(hdc,BEGIN_PATH,NULL,NULL); */
976 /* Escape(hdc,ENDDOC,NULL,NULL); */
977 /* Escape(hdc,END_PATH,PATHINFO,NULL); */
978 /* Escape(hdc,EXTTEXTOUT,EXTTEXT_STRUCT*,NULL); */
979 /* Escape(hdc,FLUSHOUTPUT,NULL,NULL); */
980 /* Escape(hdc,GETFACENAME,NULL,LPSTR); */
981 /* Escape(hdc,GETPAIRKERNTABLE,NULL,KERNPAIR*); */
982 /* Escape(hdc,GETSETPAPERBINS,BinInfo*,BinInfo*); */
983 /* Escape(hdc,GETSETPRINTORIENT,ORIENT*,NULL); */
984 /* Escape(hdc,GETSETSCREENPARAMS,SCREENPARAMS*,SCREENPARAMS*); */
985 /* Escape(hdc,GETTECHNOLOGY,NULL,LPSTR); */
986 /* Escape(hdc,GETTRACKKERNTABLE,NULL,KERNTRACK*); */
987 /* Escape(hdc,MFCOMMENT,LPSTR,NULL); */
988 /* Escape(hdc,NEWFRAME,NULL,NULL); */
989 /* Escape(hdc,PASSTHROUGH,LPSTR,NULL); */
990 /* Escape(hdc,RESTORE_CTM,NULL,NULL); */
991 /* Escape(hdc,SAVE_CTM,NULL,NULL); */
992 /* Escape(hdc,SETALLJUSTVALUES,EXTTEXTDATA*,NULL); */
993 /* Escape(hdc,SETCOLORTABLE,COLORTABLE_STRUCT*,LPDWORD); */
994 /* Escape(hdc,SET_BACKGROUND_COLOR,LPDWORD,LPDWORD); */
995 /* Escape(hdc,TRANSFORM_CTM,LPSTR,NULL); */
1004 case GETPAIRKERNTABLE
:
1005 case GETSETPAPERBINS
:
1006 case GETSETPRINTORIENT
:
1007 case GETSETSCREENPARAMS
:
1009 case GETTRACKKERNTABLE
:
1015 case SETALLJUSTVALUES
:
1017 case SET_BACKGROUND_COLOR
:
1019 /* pass it unmodified to the 32-bit function */
1020 return Escape( HDC_32(hdc
), escape
, in_count
, MapSL(in_data
), out_data
);
1022 /* Escape(hdc,ENUMPAPERMETRICS,LPINT16,LPRECT16); */
1023 /* Escape(hdc,GETEXTENDEDTEXTMETRICS,LPUINT16,EXTTEXTMETRIC*); */
1024 /* Escape(hdc,GETEXTENTTABLE,LPSTR,LPINT16); */
1025 /* Escape(hdc,GETSETPAPERMETRICS,LPRECT16,LPRECT16); */
1026 /* Escape(hdc,GETVECTORBRUSHSIZE,LPLOGBRUSH16,LPPOINT16); */
1027 /* Escape(hdc,GETVECTORPENSIZE,LPLOGPEN16,LPPOINT16); */
1028 case ENUMPAPERMETRICS
:
1029 case GETEXTENDEDTEXTMETRICS
:
1030 case GETEXTENTTABLE
:
1031 case GETSETPAPERMETRICS
:
1032 case GETVECTORBRUSHSIZE
:
1033 case GETVECTORPENSIZE
:
1035 FIXME("unknown/unsupported 16-bit escape %x (%d,%p,%p\n",
1036 escape
, in_count
, MapSL(in_data
), out_data
);
1037 return Escape( HDC_32(hdc
), escape
, in_count
, MapSL(in_data
), out_data
);
1042 /***********************************************************************
1043 * RestoreDC (GDI.39)
1045 BOOL16 WINAPI
RestoreDC16( HDC16 hdc
, INT16 level
)
1047 return RestoreDC( HDC_32(hdc
), level
);
1051 /***********************************************************************
1054 BOOL16 WINAPI
FillRgn16( HDC16 hdc
, HRGN16 hrgn
, HBRUSH16 hbrush
)
1056 return FillRgn( HDC_32(hdc
), HRGN_32(hrgn
), HBRUSH_32(hbrush
) );
1060 /***********************************************************************
1063 BOOL16 WINAPI
FrameRgn16( HDC16 hdc
, HRGN16 hrgn
, HBRUSH16 hbrush
,
1064 INT16 nWidth
, INT16 nHeight
)
1066 return FrameRgn( HDC_32(hdc
), HRGN_32(hrgn
), HBRUSH_32(hbrush
), nWidth
, nHeight
);
1070 /***********************************************************************
1071 * InvertRgn (GDI.42)
1073 BOOL16 WINAPI
InvertRgn16( HDC16 hdc
, HRGN16 hrgn
)
1075 return InvertRgn( HDC_32(hdc
), HRGN_32(hrgn
) );
1079 /***********************************************************************
1082 BOOL16 WINAPI
PaintRgn16( HDC16 hdc
, HRGN16 hrgn
)
1084 return PaintRgn( HDC_32(hdc
), HRGN_32(hrgn
) );
1088 /***********************************************************************
1089 * SelectClipRgn (GDI.44)
1091 INT16 WINAPI
SelectClipRgn16( HDC16 hdc
, HRGN16 hrgn
)
1093 return SelectClipRgn( HDC_32(hdc
), HRGN_32(hrgn
) );
1097 /***********************************************************************
1098 * SelectObject (GDI.45)
1100 HGDIOBJ16 WINAPI
SelectObject16( HDC16 hdc
, HGDIOBJ16 handle
)
1102 return HGDIOBJ_16( SelectObject( HDC_32(hdc
), HGDIOBJ_32(handle
) ) );
1106 /***********************************************************************
1107 * CombineRgn (GDI.47)
1109 INT16 WINAPI
CombineRgn16(HRGN16 hDest
, HRGN16 hSrc1
, HRGN16 hSrc2
, INT16 mode
)
1111 return CombineRgn( HRGN_32(hDest
), HRGN_32(hSrc1
), HRGN_32(hSrc2
), mode
);
1115 /***********************************************************************
1116 * CreateBitmap (GDI.48)
1118 HBITMAP16 WINAPI
CreateBitmap16( INT16 width
, INT16 height
, UINT16 planes
,
1119 UINT16 bpp
, LPCVOID bits
)
1121 return HBITMAP_16( CreateBitmap( width
, height
, planes
& 0xff, bpp
& 0xff, bits
) );
1125 /***********************************************************************
1126 * CreateBitmapIndirect (GDI.49)
1128 HBITMAP16 WINAPI
CreateBitmapIndirect16( const BITMAP16
* bmp
)
1130 return CreateBitmap16( bmp
->bmWidth
, bmp
->bmHeight
, bmp
->bmPlanes
,
1131 bmp
->bmBitsPixel
, MapSL( bmp
->bmBits
) );
1135 /***********************************************************************
1136 * CreateBrushIndirect (GDI.50)
1138 HBRUSH16 WINAPI
CreateBrushIndirect16( const LOGBRUSH16
* brush
)
1142 if (brush
->lbStyle
== BS_DIBPATTERN
|| brush
->lbStyle
== BS_DIBPATTERN8X8
)
1143 return CreateDIBPatternBrush16( brush
->lbHatch
, brush
->lbColor
);
1145 brush32
.lbStyle
= brush
->lbStyle
;
1146 brush32
.lbColor
= brush
->lbColor
;
1147 brush32
.lbHatch
= brush
->lbHatch
;
1148 return HBRUSH_16( CreateBrushIndirect(&brush32
) );
1152 /***********************************************************************
1153 * CreateCompatibleBitmap (GDI.51)
1155 HBITMAP16 WINAPI
CreateCompatibleBitmap16( HDC16 hdc
, INT16 width
, INT16 height
)
1157 return HBITMAP_16( CreateCompatibleBitmap( HDC_32(hdc
), width
, height
) );
1161 /***********************************************************************
1162 * CreateCompatibleDC (GDI.52)
1164 HDC16 WINAPI
CreateCompatibleDC16( HDC16 hdc
)
1166 return HDC_16( CreateCompatibleDC( HDC_32(hdc
) ) );
1170 /***********************************************************************
1173 HDC16 WINAPI
CreateDC16( LPCSTR driver
, LPCSTR device
, LPCSTR output
,
1174 const DEVMODEA
*initData
)
1176 if (!lstrcmpiA( driver
, "dib" ) || !lstrcmpiA( driver
, "dirdib" ))
1178 DRIVER_INFO_2W driver_info
= { .cVersion
= NTGDI_WIN16_DIB
};
1179 return HDC_16( NtGdiOpenDCW( NULL
, NULL
, NULL
, 0, TRUE
, 0, &driver_info
, (void *)initData
));
1181 return HDC_16( CreateDCA( driver
, device
, output
, initData
) );
1185 /***********************************************************************
1186 * CreateEllipticRgn (GDI.54)
1188 HRGN16 WINAPI
CreateEllipticRgn16( INT16 left
, INT16 top
, INT16 right
, INT16 bottom
)
1190 return HRGN_16( CreateEllipticRgn( left
, top
, right
, bottom
) );
1194 /***********************************************************************
1195 * CreateEllipticRgnIndirect (GDI.55)
1197 HRGN16 WINAPI
CreateEllipticRgnIndirect16( const RECT16
*rect
)
1199 return HRGN_16( CreateEllipticRgn( rect
->left
, rect
->top
, rect
->right
, rect
->bottom
) );
1203 /***********************************************************************
1204 * CreateFont (GDI.56)
1206 HFONT16 WINAPI
CreateFont16(INT16 height
, INT16 width
, INT16 esc
, INT16 orient
,
1207 INT16 weight
, BYTE italic
, BYTE underline
,
1208 BYTE strikeout
, BYTE charset
, BYTE outpres
,
1209 BYTE clippres
, BYTE quality
, BYTE pitch
,
1212 return HFONT_16( CreateFontA( height
, width
, esc
, orient
, weight
, italic
, underline
,
1213 strikeout
, charset
, outpres
, clippres
, quality
, pitch
, name
));
1216 /***********************************************************************
1217 * CreateFontIndirect (GDI.57)
1219 HFONT16 WINAPI
CreateFontIndirect16( const LOGFONT16
*plf16
)
1226 logfont_16_to_W( plf16
, &lfW
);
1227 ret
= CreateFontIndirectW( &lfW
);
1229 else ret
= CreateFontIndirectW( NULL
);
1230 return HFONT_16(ret
);
1234 /***********************************************************************
1235 * CreateHatchBrush (GDI.58)
1237 HBRUSH16 WINAPI
CreateHatchBrush16( INT16 style
, COLORREF color
)
1239 return HBRUSH_16( CreateHatchBrush( style
, color
) );
1243 /***********************************************************************
1244 * CreatePatternBrush (GDI.60)
1246 HBRUSH16 WINAPI
CreatePatternBrush16( HBITMAP16 hbitmap
)
1248 return HBRUSH_16( CreatePatternBrush( HBITMAP_32(hbitmap
) ));
1252 /***********************************************************************
1253 * CreatePen (GDI.61)
1255 HPEN16 WINAPI
CreatePen16( INT16 style
, INT16 width
, COLORREF color
)
1259 logpen
.lopnStyle
= style
;
1260 logpen
.lopnWidth
.x
= width
;
1261 logpen
.lopnWidth
.y
= 0;
1262 logpen
.lopnColor
= color
;
1263 return HPEN_16( CreatePenIndirect( &logpen
) );
1267 /***********************************************************************
1268 * CreatePenIndirect (GDI.62)
1270 HPEN16 WINAPI
CreatePenIndirect16( const LOGPEN16
* pen
)
1274 if (pen
->lopnStyle
> PS_INSIDEFRAME
) return 0;
1275 logpen
.lopnStyle
= pen
->lopnStyle
;
1276 logpen
.lopnWidth
.x
= pen
->lopnWidth
.x
;
1277 logpen
.lopnWidth
.y
= pen
->lopnWidth
.y
;
1278 logpen
.lopnColor
= pen
->lopnColor
;
1279 return HPEN_16( CreatePenIndirect( &logpen
) );
1283 /***********************************************************************
1284 * CreatePolygonRgn (GDI.63)
1286 HRGN16 WINAPI
CreatePolygonRgn16( const POINT16
* points
, INT16 count
, INT16 mode
)
1288 return CreatePolyPolygonRgn16( points
, &count
, 1, mode
);
1292 /***********************************************************************
1293 * CreateRectRgn (GDI.64)
1295 * NOTE: cf. SetRectRgn16
1297 HRGN16 WINAPI
CreateRectRgn16( INT16 left
, INT16 top
, INT16 right
, INT16 bottom
)
1301 if (left
< right
) hrgn
= CreateRectRgn( left
, top
, right
, bottom
);
1302 else hrgn
= CreateRectRgn( 0, 0, 0, 0 );
1303 return HRGN_16(hrgn
);
1307 /***********************************************************************
1308 * CreateRectRgnIndirect (GDI.65)
1310 HRGN16 WINAPI
CreateRectRgnIndirect16( const RECT16
* rect
)
1312 return CreateRectRgn16( rect
->left
, rect
->top
, rect
->right
, rect
->bottom
);
1316 /***********************************************************************
1317 * CreateSolidBrush (GDI.66)
1319 HBRUSH16 WINAPI
CreateSolidBrush16( COLORREF color
)
1321 return HBRUSH_16( CreateSolidBrush( color
) );
1325 /***********************************************************************
1328 BOOL16 WINAPI
DeleteDC16( HDC16 hdc
)
1330 if (DeleteDC( HDC_32(hdc
) ))
1332 struct saved_visrgn
*saved
, *next
;
1333 struct gdi_thunk
* thunk
;
1335 if ((thunk
= GDI_FindThunk(hdc
))) GDI_DeleteThunk(thunk
);
1337 LIST_FOR_EACH_ENTRY_SAFE( saved
, next
, &saved_regions
, struct saved_visrgn
, entry
)
1339 if (saved
->hdc
!= HDC_32(hdc
)) continue;
1340 list_remove( &saved
->entry
);
1341 DeleteObject( saved
->hrgn
);
1342 HeapFree( GetProcessHeap(), 0, saved
);
1350 /***********************************************************************
1351 * DeleteObject (GDI.69)
1352 * SysDeleteObject (GDI.605)
1354 BOOL16 WINAPI
DeleteObject16( HGDIOBJ16 obj
)
1356 if (GetObjectType( HGDIOBJ_32(obj
) ) == OBJ_BITMAP
) free_segptr_bits( obj
);
1357 return DeleteObject( HGDIOBJ_32(obj
) );
1361 /***********************************************************************
1362 * EnumFonts (GDI.70)
1364 INT16 WINAPI
EnumFonts16( HDC16 hDC
, LPCSTR lpName
, FONTENUMPROC16 efproc
,
1367 return EnumFontFamilies16( hDC
, lpName
, efproc
, lpData
);
1371 /***********************************************************************
1372 * EnumObjects (GDI.71)
1374 INT16 WINAPI
EnumObjects16( HDC16 hdc
, INT16 obj
, GOBJENUMPROC16 proc
, LPARAM lParam
)
1376 struct callback16_info info
;
1378 info
.proc
= (FARPROC16
)proc
;
1379 info
.param
= lParam
;
1383 return EnumObjects( HDC_32(hdc
), OBJ_PEN
, enum_pens_callback
, (LPARAM
)&info
);
1385 return EnumObjects( HDC_32(hdc
), OBJ_BRUSH
, enum_brushes_callback
, (LPARAM
)&info
);
1391 /***********************************************************************
1394 BOOL16 WINAPI
EqualRgn16( HRGN16 rgn1
, HRGN16 rgn2
)
1396 return EqualRgn( HRGN_32(rgn1
), HRGN_32(rgn2
) );
1400 /***********************************************************************
1401 * GetBitmapBits (GDI.74)
1403 LONG WINAPI
GetBitmapBits16( HBITMAP16 hbitmap
, LONG count
, LPVOID buffer
)
1405 return GetBitmapBits( HBITMAP_32(hbitmap
), count
, buffer
);
1409 /***********************************************************************
1410 * GetBkColor (GDI.75)
1412 COLORREF WINAPI
GetBkColor16( HDC16 hdc
)
1414 return GetBkColor( HDC_32(hdc
) );
1418 /***********************************************************************
1419 * GetBkMode (GDI.76)
1421 INT16 WINAPI
GetBkMode16( HDC16 hdc
)
1423 return GetBkMode( HDC_32(hdc
) );
1427 /***********************************************************************
1428 * GetClipBox (GDI.77)
1430 INT16 WINAPI
GetClipBox16( HDC16 hdc
, LPRECT16 rect
)
1433 INT ret
= GetClipBox( HDC_32(hdc
), &rect32
);
1437 rect
->left
= rect32
.left
;
1438 rect
->top
= rect32
.top
;
1439 rect
->right
= rect32
.right
;
1440 rect
->bottom
= rect32
.bottom
;
1446 /***********************************************************************
1447 * GetCurrentPosition (GDI.78)
1449 DWORD WINAPI
GetCurrentPosition16( HDC16 hdc
)
1452 if (!GetCurrentPositionEx( HDC_32(hdc
), &pt32
)) return 0;
1453 return MAKELONG( pt32
.x
, pt32
.y
);
1457 /***********************************************************************
1460 DWORD WINAPI
GetDCOrg16( HDC16 hdc
)
1463 if (GetDCOrgEx( HDC_32(hdc
), &pt
)) return MAKELONG( pt
.x
, pt
.y
);
1468 /***********************************************************************
1469 * GetDeviceCaps (GDI.80)
1471 INT16 WINAPI
GetDeviceCaps16( HDC16 hdc
, INT16 cap
)
1473 INT16 ret
= GetDeviceCaps( HDC_32(hdc
), cap
);
1474 /* some apps don't expect -1 and think it's a B&W screen */
1475 if ((cap
== NUMCOLORS
) && (ret
== -1)) ret
= 2048;
1480 /***********************************************************************
1481 * GetMapMode (GDI.81)
1483 INT16 WINAPI
GetMapMode16( HDC16 hdc
)
1485 return GetMapMode( HDC_32(hdc
) );
1489 /***********************************************************************
1490 * GetObject (GDI.82)
1492 INT16 WINAPI
GetObject16( HGDIOBJ16 handle16
, INT16 count
, LPVOID buffer
)
1494 HGDIOBJ handle
= HGDIOBJ_32( handle16
);
1495 switch( GetObjectType( handle
))
1500 LOGPEN16
*pen16
= buffer
;
1503 if (count
< sizeof(LOGPEN16
)) return 0;
1504 if (!GetObjectW( handle
, sizeof(pen
), &pen
)) return 0;
1506 pen16
->lopnStyle
= pen
.lopnStyle
;
1507 pen16
->lopnColor
= pen
.lopnColor
;
1508 pen16
->lopnWidth
.x
= pen
.lopnWidth
.x
;
1509 pen16
->lopnWidth
.y
= pen
.lopnWidth
.y
;
1511 return sizeof(LOGPEN16
);
1519 if (!GetObjectW( handle
, sizeof(brush
), &brush
)) return 0;
1520 brush16
.lbStyle
= brush
.lbStyle
;
1521 brush16
.lbColor
= brush
.lbColor
;
1522 brush16
.lbHatch
= brush
.lbHatch
;
1523 if (count
> sizeof(brush16
)) count
= sizeof(brush16
);
1524 memcpy( buffer
, &brush16
, count
);
1527 return sizeof(LOGBRUSH16
);
1530 return GetObjectW( handle
, count
, buffer
);
1538 if (!GetObjectW( handle
, sizeof(font
), &font
)) return 0;
1539 logfont_W_to_16( &font
, &font16
);
1540 if (count
> sizeof(font16
)) count
= sizeof(font16
);
1541 memcpy( buffer
, &font16
, count
);
1544 return sizeof(LOGFONT16
);
1550 BITMAP16
*bmp16
= buffer
;
1552 if (!(size
= GetObjectW( handle
, sizeof(dib
), &dib
))) return 0;
1553 if (size
== sizeof(DIBSECTION
) && count
> sizeof(BITMAP16
))
1555 FIXME("not implemented for DIBs: count %d\n", count
);
1560 if (count
< sizeof(BITMAP16
)) return 0;
1561 bmp16
->bmType
= dib
.dsBm
.bmType
;
1562 bmp16
->bmWidth
= dib
.dsBm
.bmWidth
;
1563 bmp16
->bmHeight
= dib
.dsBm
.bmHeight
;
1564 bmp16
->bmWidthBytes
= dib
.dsBm
.bmWidthBytes
;
1565 bmp16
->bmPlanes
= dib
.dsBm
.bmPlanes
;
1566 bmp16
->bmBitsPixel
= dib
.dsBm
.bmBitsPixel
;
1568 return sizeof(BITMAP16
);
1578 /***********************************************************************
1581 COLORREF WINAPI
GetPixel16( HDC16 hdc
, INT16 x
, INT16 y
)
1583 return GetPixel( HDC_32(hdc
), x
, y
);
1587 /***********************************************************************
1588 * GetPolyFillMode (GDI.84)
1590 INT16 WINAPI
GetPolyFillMode16( HDC16 hdc
)
1592 return GetPolyFillMode( HDC_32(hdc
) );
1596 /***********************************************************************
1599 INT16 WINAPI
GetROP216( HDC16 hdc
)
1601 return GetROP2( HDC_32(hdc
) );
1605 /***********************************************************************
1606 * GetRelAbs (GDI.86)
1608 INT16 WINAPI
GetRelAbs16( HDC16 hdc
)
1610 return GetRelAbs( HDC_32(hdc
), 0 );
1614 /***********************************************************************
1615 * GetStockObject (GDI.87)
1617 HGDIOBJ16 WINAPI
GetStockObject16( INT16 obj
)
1619 return HGDIOBJ_16( GetStockObject( obj
) );
1623 /***********************************************************************
1624 * GetStretchBltMode (GDI.88)
1626 INT16 WINAPI
GetStretchBltMode16( HDC16 hdc
)
1628 return GetStretchBltMode( HDC_32(hdc
) );
1632 /***********************************************************************
1633 * GetTextCharacterExtra (GDI.89)
1635 INT16 WINAPI
GetTextCharacterExtra16( HDC16 hdc
)
1637 return GetTextCharacterExtra( HDC_32(hdc
) );
1641 /***********************************************************************
1642 * GetTextColor (GDI.90)
1644 COLORREF WINAPI
GetTextColor16( HDC16 hdc
)
1646 return GetTextColor( HDC_32(hdc
) );
1650 /***********************************************************************
1651 * GetTextExtent (GDI.91)
1653 DWORD WINAPI
GetTextExtent16( HDC16 hdc
, LPCSTR str
, INT16 count
)
1656 if (!GetTextExtentPoint32A( HDC_32(hdc
), str
, count
, &size
)) return 0;
1657 return MAKELONG( size
.cx
, size
.cy
);
1661 /***********************************************************************
1662 * GetTextFace (GDI.92)
1664 INT16 WINAPI
GetTextFace16( HDC16 hdc
, INT16 count
, LPSTR name
)
1666 return GetTextFaceA( HDC_32(hdc
), count
, name
);
1670 /***********************************************************************
1671 * GetTextMetrics (GDI.93)
1673 BOOL16 WINAPI
GetTextMetrics16( HDC16 hdc
, TEXTMETRIC16
*tm
)
1677 if (!GetTextMetricsW( HDC_32(hdc
), &tm32
)) return FALSE
;
1679 tm
->tmHeight
= tm32
.tmHeight
;
1680 tm
->tmAscent
= tm32
.tmAscent
;
1681 tm
->tmDescent
= tm32
.tmDescent
;
1682 tm
->tmInternalLeading
= tm32
.tmInternalLeading
;
1683 tm
->tmExternalLeading
= tm32
.tmExternalLeading
;
1684 tm
->tmAveCharWidth
= tm32
.tmAveCharWidth
;
1685 tm
->tmMaxCharWidth
= tm32
.tmMaxCharWidth
;
1686 tm
->tmWeight
= tm32
.tmWeight
;
1687 tm
->tmOverhang
= tm32
.tmOverhang
;
1688 tm
->tmDigitizedAspectX
= tm32
.tmDigitizedAspectX
;
1689 tm
->tmDigitizedAspectY
= tm32
.tmDigitizedAspectY
;
1690 tm
->tmFirstChar
= tm32
.tmFirstChar
;
1691 tm
->tmLastChar
= tm32
.tmLastChar
;
1692 tm
->tmDefaultChar
= tm32
.tmDefaultChar
;
1693 tm
->tmBreakChar
= tm32
.tmBreakChar
;
1694 tm
->tmItalic
= tm32
.tmItalic
;
1695 tm
->tmUnderlined
= tm32
.tmUnderlined
;
1696 tm
->tmStruckOut
= tm32
.tmStruckOut
;
1697 tm
->tmPitchAndFamily
= tm32
.tmPitchAndFamily
;
1698 tm
->tmCharSet
= tm32
.tmCharSet
;
1703 /***********************************************************************
1704 * GetViewportExt (GDI.94)
1706 DWORD WINAPI
GetViewportExt16( HDC16 hdc
)
1709 if (!GetViewportExtEx( HDC_32(hdc
), &size
)) return 0;
1710 return MAKELONG( size
.cx
, size
.cy
);
1714 /***********************************************************************
1715 * GetViewportOrg (GDI.95)
1717 DWORD WINAPI
GetViewportOrg16( HDC16 hdc
)
1720 if (!GetViewportOrgEx( HDC_32(hdc
), &pt
)) return 0;
1721 return MAKELONG( pt
.x
, pt
.y
);
1725 /***********************************************************************
1726 * GetWindowExt (GDI.96)
1728 DWORD WINAPI
GetWindowExt16( HDC16 hdc
)
1731 if (!GetWindowExtEx( HDC_32(hdc
), &size
)) return 0;
1732 return MAKELONG( size
.cx
, size
.cy
);
1736 /***********************************************************************
1737 * GetWindowOrg (GDI.97)
1739 DWORD WINAPI
GetWindowOrg16( HDC16 hdc
)
1742 if (!GetWindowOrgEx( HDC_32(hdc
), &pt
)) return 0;
1743 return MAKELONG( pt
.x
, pt
.y
);
1749 /**********************************************************************
1752 void WINAPI
LineDDA16( INT16 nXStart
, INT16 nYStart
, INT16 nXEnd
,
1753 INT16 nYEnd
, LINEDDAPROC16 proc
, LPARAM lParam
)
1755 struct callback16_info info
;
1756 info
.proc
= (FARPROC16
)proc
;
1757 info
.param
= lParam
;
1758 LineDDA( nXStart
, nYStart
, nXEnd
, nYEnd
, linedda_callback
, (LPARAM
)&info
);
1762 /***********************************************************************
1763 * OffsetRgn (GDI.101)
1765 INT16 WINAPI
OffsetRgn16( HRGN16 hrgn
, INT16 x
, INT16 y
)
1767 return OffsetRgn( HRGN_32(hrgn
), x
, y
);
1771 /***********************************************************************
1772 * PtVisible (GDI.103)
1774 BOOL16 WINAPI
PtVisible16( HDC16 hdc
, INT16 x
, INT16 y
)
1776 return PtVisible( HDC_32(hdc
), x
, y
);
1780 /***********************************************************************
1781 * SelectVisRgn (GDI.105)
1783 INT16 WINAPI
SelectVisRgn16( HDC16 hdc
, HRGN16 hrgn
)
1785 FIXME( "%04x %04x no longer supported\n", hdc
, hrgn
);
1790 /***********************************************************************
1791 * SetBitmapBits (GDI.106)
1793 LONG WINAPI
SetBitmapBits16( HBITMAP16 hbitmap
, LONG count
, LPCVOID buffer
)
1795 return SetBitmapBits( HBITMAP_32(hbitmap
), count
, buffer
);
1799 /***********************************************************************
1800 * AddFontResource (GDI.119)
1802 INT16 WINAPI
AddFontResource16( LPCSTR filename
)
1804 return AddFontResourceA( filename
);
1808 /***********************************************************************
1811 * Disables GDI, switches back to text mode.
1812 * We don't have to do anything here,
1813 * just let console support handle everything
1815 void WINAPI
Death16(HDC16 hdc
)
1817 MESSAGE("Death(%04x) called. Application enters text mode...\n", hdc
);
1821 /***********************************************************************
1822 * Resurrection (GDI.122)
1824 * Restores GDI functionality
1826 void WINAPI
Resurrection16(HDC16 hdc
,
1827 WORD w1
, WORD w2
, WORD w3
, WORD w4
, WORD w5
, WORD w6
)
1829 MESSAGE("Resurrection(%04x, %04x, %04x, %04x, %04x, %04x, %04x) called. Application left text mode.\n",
1830 hdc
, w1
, w2
, w3
, w4
, w5
, w6
);
1834 /***********************************************************************
1837 INT16 WINAPI
MulDiv16( INT16 nMultiplicand
, INT16 nMultiplier
, INT16 nDivisor
)
1840 if (!nDivisor
) return -32768;
1841 /* We want to deal with a positive divisor to simplify the logic. */
1844 nMultiplicand
= - nMultiplicand
;
1845 nDivisor
= -nDivisor
;
1847 /* If the result is positive, we "add" to round. else,
1848 * we subtract to round. */
1849 if ( ( (nMultiplicand
< 0) && (nMultiplier
< 0) ) ||
1850 ( (nMultiplicand
>= 0) && (nMultiplier
>= 0) ) )
1851 ret
= (((int)nMultiplicand
* nMultiplier
) + (nDivisor
/2)) / nDivisor
;
1853 ret
= (((int)nMultiplicand
* nMultiplier
) - (nDivisor
/2)) / nDivisor
;
1854 if ((ret
> 32767) || (ret
< -32767)) return -32768;
1859 /***********************************************************************
1860 * GetRgnBox (GDI.134)
1862 INT16 WINAPI
GetRgnBox16( HRGN16 hrgn
, LPRECT16 rect
)
1865 INT16 ret
= GetRgnBox( HRGN_32(hrgn
), &r
);
1866 rect
->left
= r
.left
;
1868 rect
->right
= r
.right
;
1869 rect
->bottom
= r
.bottom
;
1874 /***********************************************************************
1875 * RemoveFontResource (GDI.136)
1877 BOOL16 WINAPI
RemoveFontResource16( LPCSTR str
)
1879 return RemoveFontResourceA(str
);
1883 /***********************************************************************
1884 * SetBrushOrg (GDI.148)
1886 DWORD WINAPI
SetBrushOrg16( HDC16 hdc
, INT16 x
, INT16 y
)
1890 if (!SetBrushOrgEx( HDC_32(hdc
), x
, y
, &pt
)) return 0;
1891 return MAKELONG( pt
.x
, pt
.y
);
1895 /***********************************************************************
1896 * GetBrushOrg (GDI.149)
1898 DWORD WINAPI
GetBrushOrg16( HDC16 hdc
)
1901 if (!GetBrushOrgEx( HDC_32(hdc
), &pt
)) return 0;
1902 return MAKELONG( pt
.x
, pt
.y
);
1906 /***********************************************************************
1907 * UnrealizeObject (GDI.150)
1909 BOOL16 WINAPI
UnrealizeObject16( HGDIOBJ16 obj
)
1911 return UnrealizeObject( HGDIOBJ_32(obj
) );
1915 /***********************************************************************
1916 * CreateIC (GDI.153)
1918 HDC16 WINAPI
CreateIC16( LPCSTR driver
, LPCSTR device
, LPCSTR output
,
1919 const DEVMODEA
* initData
)
1921 return HDC_16( CreateICA( driver
, device
, output
, initData
) );
1925 /***********************************************************************
1926 * GetNearestColor (GDI.154)
1928 COLORREF WINAPI
GetNearestColor16( HDC16 hdc
, COLORREF color
)
1930 return GetNearestColor( HDC_32(hdc
), color
);
1934 /***********************************************************************
1935 * CreateDiscardableBitmap (GDI.156)
1937 HBITMAP16 WINAPI
CreateDiscardableBitmap16( HDC16 hdc
, INT16 width
, INT16 height
)
1939 return HBITMAP_16( CreateDiscardableBitmap( HDC_32(hdc
), width
, height
) );
1943 /***********************************************************************
1944 * PtInRegion (GDI.161)
1946 BOOL16 WINAPI
PtInRegion16( HRGN16 hrgn
, INT16 x
, INT16 y
)
1948 return PtInRegion( HRGN_32(hrgn
), x
, y
);
1952 /***********************************************************************
1953 * GetBitmapDimension (GDI.162)
1955 DWORD WINAPI
GetBitmapDimension16( HBITMAP16 hbitmap
)
1958 if (!GetBitmapDimensionEx16( hbitmap
, &size
)) return 0;
1959 return MAKELONG( size
.cx
, size
.cy
);
1963 /***********************************************************************
1964 * SetBitmapDimension (GDI.163)
1966 DWORD WINAPI
SetBitmapDimension16( HBITMAP16 hbitmap
, INT16 x
, INT16 y
)
1969 if (!SetBitmapDimensionEx16( hbitmap
, x
, y
, &size
)) return 0;
1970 return MAKELONG( size
.cx
, size
.cy
);
1974 /***********************************************************************
1975 * SetRectRgn (GDI.172)
1977 * NOTE: Win 3.1 sets region to empty if left > right
1979 void WINAPI
SetRectRgn16( HRGN16 hrgn
, INT16 left
, INT16 top
, INT16 right
, INT16 bottom
)
1981 if (left
< right
) SetRectRgn( HRGN_32(hrgn
), left
, top
, right
, bottom
);
1982 else SetRectRgn( HRGN_32(hrgn
), 0, 0, 0, 0 );
1986 /******************************************************************
1987 * PlayMetaFileRecord (GDI.176)
1989 void WINAPI
PlayMetaFileRecord16( HDC16 hdc
, HANDLETABLE16
*ht
, METARECORD
*mr
, UINT16 handles
)
1991 HANDLETABLE
*ht32
= HeapAlloc( GetProcessHeap(), 0, FIELD_OFFSET(HANDLETABLE
, objectHandle
[handles
] ));
1994 for (i
= 0; i
< handles
; i
++) ht32
->objectHandle
[i
] = HGDIOBJ_32(ht
->objectHandle
[i
]);
1995 PlayMetaFileRecord( HDC_32(hdc
), ht32
, mr
, handles
);
1996 for (i
= 0; i
< handles
; i
++) ht
->objectHandle
[i
] = HGDIOBJ_16(ht32
->objectHandle
[i
]);
1997 HeapFree( GetProcessHeap(), 0, ht32
);
2001 /***********************************************************************
2002 * SetDCHook (GDI.190)
2004 BOOL16 WINAPI
SetDCHook16( HDC16 hdc16
, FARPROC16 hookProc
, DWORD dwHookData
)
2006 FIXME( "%04x %p %lx: not supported\n", hdc16
, hookProc
, dwHookData
);
2011 /***********************************************************************
2012 * GetDCHook (GDI.191)
2014 DWORD WINAPI
GetDCHook16( HDC16 hdc16
, FARPROC16
*phookProc
)
2016 FIXME( "%04x: not supported\n", hdc16
);
2021 /***********************************************************************
2022 * SetHookFlags (GDI.192)
2024 WORD WINAPI
SetHookFlags16( HDC16 hdc
, WORD flags
)
2026 FIXME( "%04x %x: not supported\n", hdc
, flags
);
2031 /***********************************************************************
2032 * SetBoundsRect (GDI.193)
2034 UINT16 WINAPI
SetBoundsRect16( HDC16 hdc
, const RECT16
* rect
, UINT16 flags
)
2039 rect32
.left
= rect
->left
;
2040 rect32
.top
= rect
->top
;
2041 rect32
.right
= rect
->right
;
2042 rect32
.bottom
= rect
->bottom
;
2043 return SetBoundsRect( HDC_32( hdc
), &rect32
, flags
);
2045 else return SetBoundsRect( HDC_32( hdc
), NULL
, flags
);
2049 /***********************************************************************
2050 * GetBoundsRect (GDI.194)
2052 UINT16 WINAPI
GetBoundsRect16( HDC16 hdc
, LPRECT16 rect
, UINT16 flags
)
2055 UINT ret
= GetBoundsRect( HDC_32( hdc
), &rect32
, flags
);
2058 rect
->left
= rect32
.left
;
2059 rect
->top
= rect32
.top
;
2060 rect
->right
= rect32
.right
;
2061 rect
->bottom
= rect32
.bottom
;
2067 /***********************************************************************
2068 * EngineEnumerateFont (GDI.300)
2070 WORD WINAPI
EngineEnumerateFont16(LPSTR fontname
, FARPROC16 proc
, DWORD data
)
2072 FIXME("(%s,%p,%lx),stub\n",fontname
,proc
,data
);
2077 /***********************************************************************
2078 * EngineDeleteFont (GDI.301)
2080 WORD WINAPI
EngineDeleteFont16(LPFONTINFO16 lpFontInfo
)
2084 /* untested, don't know if it works.
2085 We seem to access some structure that is located after the
2086 FONTINFO. The FONTINFO documentation says that there may
2087 follow some char-width table or font bitmap or vector info.
2088 I think it is some kind of font bitmap that begins at offset 0x52,
2089 as FONTINFO goes up to 0x51.
2090 If this is correct, everything should be implemented correctly.
2092 if ( ((lpFontInfo
->dfType
& (RASTER_FONTTYPE
|DEVICE_FONTTYPE
)) == (RASTER_FONTTYPE
|DEVICE_FONTTYPE
))
2093 && (LOWORD(lpFontInfo
->dfFace
) == LOWORD(lpFontInfo
)+0x6e)
2094 && (handle
= *(WORD
*)(lpFontInfo
+0x54)) )
2096 *(WORD
*)(lpFontInfo
+0x54) = 0;
2097 GlobalFree16(handle
);
2103 /***********************************************************************
2104 * EngineRealizeFont (GDI.302)
2106 WORD WINAPI
EngineRealizeFont16(LPLOGFONT16 lplogFont
, LPTEXTXFORM16 lptextxform
, LPFONTINFO16 lpfontInfo
)
2108 FIXME("(%p,%p,%p),stub\n",lplogFont
,lptextxform
,lpfontInfo
);
2114 /***********************************************************************
2115 * EngineRealizeFontExt (GDI.315)
2117 WORD WINAPI
EngineRealizeFontExt16(LONG l1
, LONG l2
, LONG l3
, LONG l4
)
2119 FIXME("(%08lx,%08lx,%08lx,%08lx),stub\n",l1
,l2
,l3
,l4
);
2125 /***********************************************************************
2126 * EngineGetCharWidth (GDI.303)
2128 WORD WINAPI
EngineGetCharWidth16(LPFONTINFO16 lpFontInfo
, BYTE firstChar
, BYTE lastChar
, LPINT16 buffer
)
2132 for (i
= firstChar
; i
<= lastChar
; i
++)
2133 FIXME(" returns font's average width for range %d to %d\n", firstChar
, lastChar
);
2134 *buffer
++ = lpFontInfo
->dfAvgWidth
; /* insert some charwidth functionality here; use average width for now */
2139 /***********************************************************************
2140 * EngineSetFontContext (GDI.304)
2142 WORD WINAPI
EngineSetFontContext16(LPFONTINFO16 lpFontInfo
, WORD data
)
2148 /***********************************************************************
2149 * EngineGetGlyphBMP (GDI.305)
2151 WORD WINAPI
EngineGetGlyphBMP16(WORD word
, LPFONTINFO16 lpFontInfo
, WORD w1
, WORD w2
,
2152 LPSTR string
, DWORD dword
, /*LPBITMAPMETRICS16*/ LPVOID metrics
)
2159 /***********************************************************************
2160 * EngineMakeFontDir (GDI.306)
2162 DWORD WINAPI
EngineMakeFontDir16(HDC16 hdc
, LPFONTDIR16 fontdir
, LPCSTR string
)
2164 FIXME(" stub! (always fails)\n");
2165 return ~0UL; /* error */
2169 /***********************************************************************
2170 * GetCharABCWidths (GDI.307)
2172 BOOL16 WINAPI
GetCharABCWidths16( HDC16 hdc
, UINT16 firstChar
, UINT16 lastChar
, LPABC16 abc
)
2176 LPABC abc32
= HeapAlloc( GetProcessHeap(), 0, sizeof(ABC
) * (lastChar
- firstChar
+ 1) );
2178 if ((ret
= GetCharABCWidthsA( HDC_32(hdc
), firstChar
, lastChar
, abc32
)))
2180 for (i
= firstChar
; i
<= lastChar
; i
++)
2182 abc
[i
-firstChar
].abcA
= abc32
[i
-firstChar
].abcA
;
2183 abc
[i
-firstChar
].abcB
= abc32
[i
-firstChar
].abcB
;
2184 abc
[i
-firstChar
].abcC
= abc32
[i
-firstChar
].abcC
;
2187 HeapFree( GetProcessHeap(), 0, abc32
);
2192 /***********************************************************************
2193 * GetOutlineTextMetrics (GDI.308)
2195 * Gets metrics for TrueType fonts.
2198 * hdc [In] Handle of device context
2199 * cbData [In] Size of metric data array
2200 * lpOTM [Out] Address of metric data array
2203 * Success: Non-zero or size of required buffer
2207 * lpOTM should be LPOUTLINETEXTMETRIC
2209 UINT16 WINAPI
GetOutlineTextMetrics16( HDC16 hdc
, UINT16 cbData
,
2210 LPOUTLINETEXTMETRIC16 lpOTM
)
2212 FIXME("(%04x,%04x,%p): stub\n", hdc
,cbData
,lpOTM
);
2217 /***********************************************************************
2218 * GetGlyphOutline (GDI.309)
2220 DWORD WINAPI
GetGlyphOutline16( HDC16 hdc
, UINT16 uChar
, UINT16 fuFormat
,
2221 LPGLYPHMETRICS16 lpgm
, DWORD cbBuffer
,
2222 LPVOID lpBuffer
, const MAT2
*lpmat2
)
2227 ret
= GetGlyphOutlineA( HDC_32(hdc
), uChar
, fuFormat
, &gm32
, cbBuffer
, lpBuffer
, lpmat2
);
2228 if (ret
&& ret
!= GDI_ERROR
)
2230 lpgm
->gmBlackBoxX
= gm32
.gmBlackBoxX
;
2231 lpgm
->gmBlackBoxY
= gm32
.gmBlackBoxY
;
2232 lpgm
->gmptGlyphOrigin
.x
= gm32
.gmptGlyphOrigin
.x
;
2233 lpgm
->gmptGlyphOrigin
.y
= gm32
.gmptGlyphOrigin
.y
;
2234 lpgm
->gmCellIncX
= gm32
.gmCellIncX
;
2235 lpgm
->gmCellIncY
= gm32
.gmCellIncY
;
2241 /***********************************************************************
2242 * CreateScalableFontResource (GDI.310)
2244 BOOL16 WINAPI
CreateScalableFontResource16( UINT16 fHidden
, LPCSTR lpszResourceFile
,
2245 LPCSTR fontFile
, LPCSTR path
)
2247 return CreateScalableFontResourceA( fHidden
, lpszResourceFile
, fontFile
, path
);
2251 /*************************************************************************
2252 * GetFontData (GDI.311)
2255 DWORD WINAPI
GetFontData16( HDC16 hdc
, DWORD table
, DWORD offset
, LPVOID buffer
, DWORD count
)
2257 return GetFontData( HDC_32(hdc
), table
, offset
, buffer
, count
);
2261 /*************************************************************************
2262 * GetRasterizerCaps (GDI.313)
2264 BOOL16 WINAPI
GetRasterizerCaps16( LPRASTERIZER_STATUS lprs
, UINT16 cbNumBytes
)
2266 return GetRasterizerCaps( lprs
, cbNumBytes
);
2270 /***********************************************************************
2271 * EnumFontFamilies (GDI.330)
2273 INT16 WINAPI
EnumFontFamilies16( HDC16 hDC
, LPCSTR lpFamily
,
2274 FONTENUMPROC16 efproc
, LPARAM lpData
)
2280 if (!*lpFamily
) return 1;
2281 lstrcpynA( lf
.lfFaceName
, lpFamily
, LF_FACESIZE
);
2282 lf
.lfCharSet
= DEFAULT_CHARSET
;
2283 lf
.lfPitchAndFamily
= 0;
2288 return EnumFontFamiliesEx16( hDC
, plf
, efproc
, lpData
, 0 );
2292 /*************************************************************************
2293 * GetKerningPairs (GDI.332)
2296 INT16 WINAPI
GetKerningPairs16( HDC16 hdc
, INT16 count
, LPKERNINGPAIR16 pairs
)
2298 KERNINGPAIR
*pairs32
;
2301 if (!count
) return 0;
2303 if (!(pairs32
= HeapAlloc( GetProcessHeap(), 0, count
* sizeof(*pairs32
) ))) return 0;
2304 if ((ret
= GetKerningPairsA( HDC_32(hdc
), count
, pairs32
)))
2306 for (i
= 0; i
< ret
; i
++)
2308 pairs
->wFirst
= pairs32
->wFirst
;
2309 pairs
->wSecond
= pairs32
->wSecond
;
2310 pairs
->iKernAmount
= pairs32
->iKernAmount
;
2313 HeapFree( GetProcessHeap(), 0, pairs32
);
2319 /***********************************************************************
2320 * GetTextAlign (GDI.345)
2322 UINT16 WINAPI
GetTextAlign16( HDC16 hdc
)
2324 return GetTextAlign( HDC_32(hdc
) );
2328 /***********************************************************************
2329 * SetTextAlign (GDI.346)
2331 UINT16 WINAPI
SetTextAlign16( HDC16 hdc
, UINT16 align
)
2333 return SetTextAlign( HDC_32(hdc
), align
);
2337 /***********************************************************************
2340 BOOL16 WINAPI
Chord16( HDC16 hdc
, INT16 left
, INT16 top
,
2341 INT16 right
, INT16 bottom
, INT16 xstart
, INT16 ystart
,
2342 INT16 xend
, INT16 yend
)
2344 return Chord( HDC_32(hdc
), left
, top
, right
, bottom
, xstart
, ystart
, xend
, yend
);
2348 /***********************************************************************
2349 * SetMapperFlags (GDI.349)
2351 DWORD WINAPI
SetMapperFlags16( HDC16 hdc
, DWORD flags
)
2353 return SetMapperFlags( HDC_32(hdc
), flags
);
2357 /***********************************************************************
2358 * GetCharWidth (GDI.350)
2360 BOOL16 WINAPI
GetCharWidth16( HDC16 hdc
, UINT16 firstChar
, UINT16 lastChar
, LPINT16 buffer
)
2362 BOOL retVal
= FALSE
;
2364 if( firstChar
!= lastChar
)
2366 LPINT buf32
= HeapAlloc(GetProcessHeap(), 0, sizeof(INT
)*(1 + (lastChar
- firstChar
)));
2369 LPINT obuf32
= buf32
;
2372 retVal
= GetCharWidth32A( HDC_32(hdc
), firstChar
, lastChar
, buf32
);
2375 for (i
= firstChar
; i
<= lastChar
; i
++) *buffer
++ = *buf32
++;
2377 HeapFree(GetProcessHeap(), 0, obuf32
);
2380 else /* happens quite often to warrant a special treatment */
2383 retVal
= GetCharWidth32A( HDC_32(hdc
), firstChar
, lastChar
, &chWidth
);
2390 /***********************************************************************
2391 * ExtTextOut (GDI.351)
2393 BOOL16 WINAPI
ExtTextOut16( HDC16 hdc
, INT16 x
, INT16 y
, UINT16 flags
,
2394 const RECT16
*lprect
, LPCSTR str
, UINT16 count
,
2400 LPINT lpdx32
= NULL
;
2403 lpdx32
= HeapAlloc( GetProcessHeap(),0, sizeof(INT
)*count
);
2404 if(lpdx32
== NULL
) return FALSE
;
2405 for (i
=count
;i
--;) lpdx32
[i
]=lpDx
[i
];
2409 rect32
.left
= lprect
->left
;
2410 rect32
.top
= lprect
->top
;
2411 rect32
.right
= lprect
->right
;
2412 rect32
.bottom
= lprect
->bottom
;
2414 ret
= ExtTextOutA(HDC_32(hdc
),x
,y
,flags
,lprect
?&rect32
:NULL
,str
,count
,lpdx32
);
2415 HeapFree( GetProcessHeap(), 0, lpdx32
);
2420 /***********************************************************************
2421 * CreatePalette (GDI.360)
2423 HPALETTE16 WINAPI
CreatePalette16( const LOGPALETTE
* palette
)
2425 return HPALETTE_16( CreatePalette( palette
) );
2429 /***********************************************************************
2430 * GDISelectPalette (GDI.361)
2432 HPALETTE16 WINAPI
GDISelectPalette16( HDC16 hdc
, HPALETTE16 hpalette
, WORD wBkg
)
2434 HPALETTE16 ret
= HPALETTE_16( SelectPalette( HDC_32(hdc
), HPALETTE_32(hpalette
), wBkg
));
2435 if (ret
&& !wBkg
) hPrimaryPalette
= hpalette
;
2440 /***********************************************************************
2441 * GDIRealizePalette (GDI.362)
2443 UINT16 WINAPI
GDIRealizePalette16( HDC16 hdc
)
2445 return RealizePalette( HDC_32(hdc
) );
2449 /***********************************************************************
2450 * GetPaletteEntries (GDI.363)
2452 UINT16 WINAPI
GetPaletteEntries16( HPALETTE16 hpalette
, UINT16 start
,
2453 UINT16 count
, LPPALETTEENTRY entries
)
2455 return GetPaletteEntries( HPALETTE_32(hpalette
), start
, count
, entries
);
2459 /***********************************************************************
2460 * SetPaletteEntries (GDI.364)
2462 UINT16 WINAPI
SetPaletteEntries16( HPALETTE16 hpalette
, UINT16 start
,
2463 UINT16 count
, const PALETTEENTRY
*entries
)
2465 return SetPaletteEntries( HPALETTE_32(hpalette
), start
, count
, entries
);
2469 /**********************************************************************
2470 * UpdateColors (GDI.366)
2472 INT16 WINAPI
UpdateColors16( HDC16 hdc
)
2474 UpdateColors( HDC_32(hdc
) );
2479 /***********************************************************************
2480 * AnimatePalette (GDI.367)
2482 void WINAPI
AnimatePalette16( HPALETTE16 hpalette
, UINT16 StartIndex
,
2483 UINT16 NumEntries
, const PALETTEENTRY
* PaletteColors
)
2485 AnimatePalette( HPALETTE_32(hpalette
), StartIndex
, NumEntries
, PaletteColors
);
2489 /***********************************************************************
2490 * ResizePalette (GDI.368)
2492 BOOL16 WINAPI
ResizePalette16( HPALETTE16 hpalette
, UINT16 cEntries
)
2494 return ResizePalette( HPALETTE_32(hpalette
), cEntries
);
2498 /***********************************************************************
2499 * GetNearestPaletteIndex (GDI.370)
2501 UINT16 WINAPI
GetNearestPaletteIndex16( HPALETTE16 hpalette
, COLORREF color
)
2503 return GetNearestPaletteIndex( HPALETTE_32(hpalette
), color
);
2507 /**********************************************************************
2508 * ExtFloodFill (GDI.372)
2510 BOOL16 WINAPI
ExtFloodFill16( HDC16 hdc
, INT16 x
, INT16 y
, COLORREF color
,
2513 return ExtFloodFill( HDC_32(hdc
), x
, y
, color
, fillType
);
2517 /***********************************************************************
2518 * SetSystemPaletteUse (GDI.373)
2520 UINT16 WINAPI
SetSystemPaletteUse16( HDC16 hdc
, UINT16 use
)
2522 return SetSystemPaletteUse( HDC_32(hdc
), use
);
2526 /***********************************************************************
2527 * GetSystemPaletteUse (GDI.374)
2529 UINT16 WINAPI
GetSystemPaletteUse16( HDC16 hdc
)
2531 return GetSystemPaletteUse( HDC_32(hdc
) );
2535 /***********************************************************************
2536 * GetSystemPaletteEntries (GDI.375)
2538 UINT16 WINAPI
GetSystemPaletteEntries16( HDC16 hdc
, UINT16 start
, UINT16 count
,
2539 LPPALETTEENTRY entries
)
2541 return GetSystemPaletteEntries( HDC_32(hdc
), start
, count
, entries
);
2545 /***********************************************************************
2548 HDC16 WINAPI
ResetDC16( HDC16 hdc
, const DEVMODEA
*devmode
)
2550 return HDC_16( ResetDCA(HDC_32(hdc
), devmode
) );
2554 /******************************************************************
2555 * StartDoc (GDI.377)
2557 INT16 WINAPI
StartDoc16( HDC16 hdc
, const DOCINFO16
*lpdoc
)
2561 docA
.cbSize
= lpdoc
->cbSize
;
2562 docA
.lpszDocName
= MapSL(lpdoc
->lpszDocName
);
2563 docA
.lpszOutput
= MapSL(lpdoc
->lpszOutput
);
2564 if(lpdoc
->cbSize
> offsetof(DOCINFO16
,lpszDatatype
))
2565 docA
.lpszDatatype
= MapSL(lpdoc
->lpszDatatype
);
2567 docA
.lpszDatatype
= NULL
;
2568 if(lpdoc
->cbSize
> offsetof(DOCINFO16
,fwType
))
2569 docA
.fwType
= lpdoc
->fwType
;
2572 return StartDocA( HDC_32(hdc
), &docA
);
2576 /******************************************************************
2579 INT16 WINAPI
EndDoc16( HDC16 hdc
)
2581 return EndDoc( HDC_32(hdc
) );
2585 /******************************************************************
2586 * StartPage (GDI.379)
2588 INT16 WINAPI
StartPage16( HDC16 hdc
)
2590 return StartPage( HDC_32(hdc
) );
2594 /******************************************************************
2597 INT16 WINAPI
EndPage16( HDC16 hdc
)
2599 return EndPage( HDC_32(hdc
) );
2603 /******************************************************************************
2604 * AbortDoc (GDI.382)
2606 INT16 WINAPI
AbortDoc16( HDC16 hdc
)
2608 return AbortDoc( HDC_32(hdc
) );
2612 /***********************************************************************
2613 * FastWindowFrame (GDI.400)
2615 BOOL16 WINAPI
FastWindowFrame16( HDC16 hdc
, const RECT16
*rect
,
2616 INT16 width
, INT16 height
, DWORD rop
)
2618 HDC hdc32
= HDC_32(hdc
);
2619 HBRUSH hbrush
= SelectObject( hdc32
, GetStockObject( GRAY_BRUSH
) );
2620 PatBlt( hdc32
, rect
->left
, rect
->top
,
2621 rect
->right
- rect
->left
- width
, height
, rop
);
2622 PatBlt( hdc32
, rect
->left
, rect
->top
+ height
, width
,
2623 rect
->bottom
- rect
->top
- height
, rop
);
2624 PatBlt( hdc32
, rect
->left
+ width
, rect
->bottom
- 1,
2625 rect
->right
- rect
->left
- width
, -height
, rop
);
2626 PatBlt( hdc32
, rect
->right
- 1, rect
->top
, -width
,
2627 rect
->bottom
- rect
->top
- height
, rop
);
2628 SelectObject( hdc32
, hbrush
);
2633 /***********************************************************************
2634 * GdiInit2 (GDI.403)
2636 * See "Undocumented Windows"
2640 * h2 [I] global data
2642 HANDLE16 WINAPI
GdiInit216( HANDLE16 h1
, HANDLE16 h2
)
2644 FIXME("(%04x, %04x), stub.\n", h1
, h2
);
2645 if (h2
== 0xffff) return 0xffff; /* undefined return value */
2646 return h1
; /* FIXME: should be the memory handle of h1 */
2650 /***********************************************************************
2651 * FinalGdiInit (GDI.405)
2653 void WINAPI
FinalGdiInit16( HBRUSH16 hPattern
/* [in] fill pattern of desktop */ )
2658 /***********************************************************************
2659 * CreateUserBitmap (GDI.407)
2661 HBITMAP16 WINAPI
CreateUserBitmap16( INT16 width
, INT16 height
, UINT16 planes
,
2662 UINT16 bpp
, LPCVOID bits
)
2664 return CreateBitmap16( width
, height
, planes
, bpp
, bits
);
2668 /***********************************************************************
2669 * CreateUserDiscardableBitmap (GDI.409)
2671 HBITMAP16 WINAPI
CreateUserDiscardableBitmap16( WORD dummy
, INT16 width
, INT16 height
)
2673 HDC hdc
= CreateDCA( "DISPLAY", NULL
, NULL
, NULL
);
2674 HBITMAP ret
= CreateCompatibleBitmap( hdc
, width
, height
);
2676 return HBITMAP_16(ret
);
2680 /***********************************************************************
2681 * GetCurLogFont (GDI.411)
2683 HFONT16 WINAPI
GetCurLogFont16( HDC16 hdc
)
2685 return HFONT_16( GetCurrentObject( HDC_32(hdc
), OBJ_FONT
) );
2689 /***********************************************************************
2690 * StretchDIBits (GDI.439)
2692 INT16 WINAPI
StretchDIBits16( HDC16 hdc
, INT16 xDst
, INT16 yDst
, INT16 widthDst
,
2693 INT16 heightDst
, INT16 xSrc
, INT16 ySrc
, INT16 widthSrc
,
2694 INT16 heightSrc
, const VOID
*bits
,
2695 const BITMAPINFO
*info
, UINT16 wUsage
, DWORD dwRop
)
2697 return StretchDIBits( HDC_32(hdc
), xDst
, yDst
, widthDst
, heightDst
,
2698 xSrc
, ySrc
, widthSrc
, heightSrc
, bits
,
2699 info
, wUsage
, dwRop
);
2703 /***********************************************************************
2704 * SetDIBits (GDI.440)
2706 INT16 WINAPI
SetDIBits16( HDC16 hdc
, HBITMAP16 hbitmap
, UINT16 startscan
,
2707 UINT16 lines
, LPCVOID bits
, const BITMAPINFO
*info
,
2710 return SetDIBits( HDC_32(hdc
), HBITMAP_32(hbitmap
), startscan
, lines
, bits
, info
, coloruse
);
2714 /***********************************************************************
2715 * GetDIBits (GDI.441)
2717 INT16 WINAPI
GetDIBits16( HDC16 hdc
, HBITMAP16 hbitmap
, UINT16 startscan
,
2718 UINT16 lines
, LPVOID bits
, BITMAPINFO
* info
,
2721 return GetDIBits( HDC_32(hdc
), HBITMAP_32(hbitmap
), startscan
, lines
, bits
, info
, coloruse
);
2725 /***********************************************************************
2726 * CreateDIBitmap (GDI.442)
2728 HBITMAP16 WINAPI
CreateDIBitmap16( HDC16 hdc
, const BITMAPINFOHEADER
* header
,
2729 DWORD init
, LPCVOID bits
, const BITMAPINFO
* data
,
2732 return HBITMAP_16( CreateDIBitmap( HDC_32(hdc
), header
, init
, bits
, data
, coloruse
) );
2736 /***********************************************************************
2737 * SetDIBitsToDevice (GDI.443)
2739 INT16 WINAPI
SetDIBitsToDevice16( HDC16 hdc
, INT16 xDest
, INT16 yDest
, INT16 cx
,
2740 INT16 cy
, INT16 xSrc
, INT16 ySrc
, UINT16 startscan
,
2741 UINT16 lines
, LPCVOID bits
, const BITMAPINFO
*info
,
2744 return SetDIBitsToDevice( HDC_32(hdc
), xDest
, yDest
, cx
, cy
, xSrc
, ySrc
,
2745 startscan
, lines
, bits
, info
, coloruse
);
2749 /***********************************************************************
2750 * CreateRoundRectRgn (GDI.444)
2752 * If either ellipse dimension is zero we call CreateRectRgn16 for its
2753 * `special' behaviour. -ve ellipse dimensions can result in GPFs under win3.1
2754 * we just let CreateRoundRectRgn convert them to +ve values.
2757 HRGN16 WINAPI
CreateRoundRectRgn16( INT16 left
, INT16 top
, INT16 right
, INT16 bottom
,
2758 INT16 ellipse_width
, INT16 ellipse_height
)
2760 if( ellipse_width
== 0 || ellipse_height
== 0 )
2761 return CreateRectRgn16( left
, top
, right
, bottom
);
2763 return HRGN_16( CreateRoundRectRgn( left
, top
, right
, bottom
,
2764 ellipse_width
, ellipse_height
));
2768 /***********************************************************************
2769 * CreateDIBPatternBrush (GDI.445)
2771 HBRUSH16 WINAPI
CreateDIBPatternBrush16( HGLOBAL16 hbitmap
, UINT16 coloruse
)
2776 if (!(bmi
= GlobalLock16( hbitmap
))) return 0;
2777 ret
= HBRUSH_16( CreateDIBPatternBrushPt( bmi
, coloruse
));
2778 GlobalUnlock16( hbitmap
);
2783 /**********************************************************************
2784 * PolyPolygon (GDI.450)
2786 BOOL16 WINAPI
PolyPolygon16( HDC16 hdc
, const POINT16
* pt
, const INT16
* counts
,
2795 for (i
=polygons
;i
--;)
2797 pt32
= HeapAlloc( GetProcessHeap(), 0, sizeof(POINT
)*nrpts
);
2798 if(pt32
== NULL
) return FALSE
;
2801 pt32
[i
].x
= pt
[i
].x
;
2802 pt32
[i
].y
= pt
[i
].y
;
2804 counts32
= HeapAlloc( GetProcessHeap(), 0, polygons
*sizeof(INT
) );
2805 if(counts32
== NULL
) {
2806 HeapFree( GetProcessHeap(), 0, pt32
);
2809 for (i
=polygons
;i
--;) counts32
[i
]=counts
[i
];
2811 ret
= PolyPolygon(HDC_32(hdc
),pt32
,counts32
,polygons
);
2812 HeapFree( GetProcessHeap(), 0, counts32
);
2813 HeapFree( GetProcessHeap(), 0, pt32
);
2818 /***********************************************************************
2819 * CreatePolyPolygonRgn (GDI.451)
2821 HRGN16 WINAPI
CreatePolyPolygonRgn16( const POINT16
*points
,
2822 const INT16
*count
, INT16 nbpolygons
, INT16 mode
)
2829 for (i
= 0; i
< nbpolygons
; i
++) npts
+= count
[i
];
2830 points32
= HeapAlloc( GetProcessHeap(), 0, npts
* sizeof(POINT
) );
2831 for (i
= 0; i
< npts
; i
++)
2833 points32
[i
].x
= points
[i
].x
;
2834 points32
[i
].y
= points
[i
].y
;
2837 count32
= HeapAlloc( GetProcessHeap(), 0, nbpolygons
* sizeof(INT
) );
2838 for (i
= 0; i
< nbpolygons
; i
++) count32
[i
] = count
[i
];
2839 hrgn
= CreatePolyPolygonRgn( points32
, count32
, nbpolygons
, mode
);
2840 HeapFree( GetProcessHeap(), 0, count32
);
2841 HeapFree( GetProcessHeap(), 0, points32
);
2842 return HRGN_16(hrgn
);
2846 /***********************************************************************
2847 * GdiSeeGdiDo (GDI.452)
2849 DWORD WINAPI
GdiSeeGdiDo16( WORD wReqType
, WORD wParam1
, WORD wParam2
,
2856 case 0x0001: /* LocalAlloc */
2857 WARN("LocalAlloc16(%x, %x): ignoring\n", wParam1
, wParam3
);
2860 case 0x0002: /* LocalFree */
2861 WARN("LocalFree16(%x): ignoring\n", wParam1
);
2864 case 0x0003: /* LocalCompact */
2865 WARN("LocalCompact16(%x): ignoring\n", wParam3
);
2866 ret
= 65000; /* lie about the amount of free space */
2868 case 0x0103: /* LocalHeap */
2869 WARN("LocalHeap16(): ignoring\n");
2872 WARN("(wReqType=%04x): Unknown\n", wReqType
);
2879 /***********************************************************************
2880 * SetObjectOwner (GDI.461)
2882 void WINAPI
SetObjectOwner16( HGDIOBJ16 handle
, HANDLE16 owner
)
2888 /***********************************************************************
2889 * IsGDIObject (GDI.462)
2891 * returns type of object if valid (W95 system programming secrets p. 264-5)
2893 BOOL16 WINAPI
IsGDIObject16( HGDIOBJ16 handle16
)
2895 static const BYTE type_map
[] =
2906 10, /* OBJ_METAFILE */
2909 9, /* OBJ_ENHMETADC */
2910 12, /* OBJ_ENHMETAFILE */
2911 0 /* OBJ_COLORSPACE */
2914 UINT type
= GetObjectType( HGDIOBJ_32( handle16
));
2916 if (type
>= ARRAY_SIZE(type_map
)) return FALSE
;
2917 return type_map
[type
];
2921 /***********************************************************************
2922 * RectVisible (GDI.465)
2923 * RectVisibleOld (GDI.104)
2925 BOOL16 WINAPI
RectVisible16( HDC16 hdc
, const RECT16
* rect16
)
2929 rect
.left
= rect16
->left
;
2930 rect
.top
= rect16
->top
;
2931 rect
.right
= rect16
->right
;
2932 rect
.bottom
= rect16
->bottom
;
2933 return RectVisible( HDC_32(hdc
), &rect
);
2937 /***********************************************************************
2938 * RectInRegion (GDI.466)
2939 * RectInRegionOld (GDI.181)
2941 BOOL16 WINAPI
RectInRegion16( HRGN16 hrgn
, const RECT16
*rect
)
2945 r32
.left
= rect
->left
;
2946 r32
.top
= rect
->top
;
2947 r32
.right
= rect
->right
;
2948 r32
.bottom
= rect
->bottom
;
2949 return RectInRegion( HRGN_32(hrgn
), &r32
);
2953 /***********************************************************************
2954 * GetBitmapDimensionEx (GDI.468)
2956 BOOL16 WINAPI
GetBitmapDimensionEx16( HBITMAP16 hbitmap
, LPSIZE16 size
)
2959 BOOL ret
= GetBitmapDimensionEx( HBITMAP_32(hbitmap
), &size32
);
2963 size
->cx
= size32
.cx
;
2964 size
->cy
= size32
.cy
;
2970 /***********************************************************************
2971 * GetBrushOrgEx (GDI.469)
2973 BOOL16 WINAPI
GetBrushOrgEx16( HDC16 hdc
, LPPOINT16 pt
)
2976 if (!GetBrushOrgEx( HDC_32(hdc
), &pt32
)) return FALSE
;
2983 /***********************************************************************
2984 * GetCurrentPositionEx (GDI.470)
2986 BOOL16 WINAPI
GetCurrentPositionEx16( HDC16 hdc
, LPPOINT16 pt
)
2989 if (!GetCurrentPositionEx( HDC_32(hdc
), &pt32
)) return FALSE
;
2996 /***********************************************************************
2997 * GetTextExtentPoint (GDI.471)
2999 * FIXME: Should this have a bug for compatibility?
3000 * Original Windows versions of GetTextExtentPoint{A,W} have documented
3001 * bugs (-> MSDN KB q147647.txt).
3003 BOOL16 WINAPI
GetTextExtentPoint16( HDC16 hdc
, LPCSTR str
, INT16 count
, LPSIZE16 size
)
3006 BOOL ret
= GetTextExtentPoint32A( HDC_32(hdc
), str
, count
, &size32
);
3010 size
->cx
= size32
.cx
;
3011 size
->cy
= size32
.cy
;
3017 /***********************************************************************
3018 * GetViewportExtEx (GDI.472)
3020 BOOL16 WINAPI
GetViewportExtEx16( HDC16 hdc
, LPSIZE16 size
)
3023 if (!GetViewportExtEx( HDC_32(hdc
), &size32
)) return FALSE
;
3024 size
->cx
= size32
.cx
;
3025 size
->cy
= size32
.cy
;
3030 /***********************************************************************
3031 * GetViewportOrgEx (GDI.473)
3033 BOOL16 WINAPI
GetViewportOrgEx16( HDC16 hdc
, LPPOINT16 pt
)
3036 if (!GetViewportOrgEx( HDC_32(hdc
), &pt32
)) return FALSE
;
3043 /***********************************************************************
3044 * GetWindowExtEx (GDI.474)
3046 BOOL16 WINAPI
GetWindowExtEx16( HDC16 hdc
, LPSIZE16 size
)
3049 if (!GetWindowExtEx( HDC_32(hdc
), &size32
)) return FALSE
;
3050 size
->cx
= size32
.cx
;
3051 size
->cy
= size32
.cy
;
3056 /***********************************************************************
3057 * GetWindowOrgEx (GDI.475)
3059 BOOL16 WINAPI
GetWindowOrgEx16( HDC16 hdc
, LPPOINT16 pt
)
3062 if (!GetWindowOrgEx( HDC_32(hdc
), &pt32
)) return FALSE
;
3069 /***********************************************************************
3070 * OffsetViewportOrgEx (GDI.476)
3072 BOOL16 WINAPI
OffsetViewportOrgEx16( HDC16 hdc
, INT16 x
, INT16 y
, LPPOINT16 pt
)
3075 BOOL16 ret
= OffsetViewportOrgEx( HDC_32(hdc
), x
, y
, &pt32
);
3085 /***********************************************************************
3086 * OffsetWindowOrgEx (GDI.477)
3088 BOOL16 WINAPI
OffsetWindowOrgEx16( HDC16 hdc
, INT16 x
, INT16 y
, LPPOINT16 pt
)
3091 BOOL16 ret
= OffsetWindowOrgEx( HDC_32(hdc
), x
, y
, &pt32
);
3101 /***********************************************************************
3102 * SetBitmapDimensionEx (GDI.478)
3104 BOOL16 WINAPI
SetBitmapDimensionEx16( HBITMAP16 hbitmap
, INT16 x
, INT16 y
, LPSIZE16 prevSize
)
3107 BOOL ret
= SetBitmapDimensionEx( HBITMAP_32(hbitmap
), x
, y
, &size32
);
3109 if (ret
&& prevSize
)
3111 prevSize
->cx
= size32
.cx
;
3112 prevSize
->cy
= size32
.cy
;
3118 /***********************************************************************
3119 * SetViewportExtEx (GDI.479)
3121 BOOL16 WINAPI
SetViewportExtEx16( HDC16 hdc
, INT16 x
, INT16 y
, LPSIZE16 size
)
3124 BOOL16 ret
= SetViewportExtEx( HDC_32(hdc
), x
, y
, &size32
);
3125 if (size
) { size
->cx
= size32
.cx
; size
->cy
= size32
.cy
; }
3130 /***********************************************************************
3131 * SetViewportOrgEx (GDI.480)
3133 BOOL16 WINAPI
SetViewportOrgEx16( HDC16 hdc
, INT16 x
, INT16 y
, LPPOINT16 pt
)
3136 BOOL16 ret
= SetViewportOrgEx( HDC_32(hdc
), x
, y
, &pt32
);
3146 /***********************************************************************
3147 * SetWindowExtEx (GDI.481)
3149 BOOL16 WINAPI
SetWindowExtEx16( HDC16 hdc
, INT16 x
, INT16 y
, LPSIZE16 size
)
3152 BOOL16 ret
= SetWindowExtEx( HDC_32(hdc
), x
, y
, &size32
);
3153 if (size
) { size
->cx
= size32
.cx
; size
->cy
= size32
.cy
; }
3158 /***********************************************************************
3159 * SetWindowOrgEx (GDI.482)
3161 BOOL16 WINAPI
SetWindowOrgEx16( HDC16 hdc
, INT16 x
, INT16 y
, LPPOINT16 pt
)
3164 BOOL16 ret
= SetWindowOrgEx( HDC_32(hdc
), x
, y
, &pt32
);
3174 /***********************************************************************
3175 * MoveToEx (GDI.483)
3177 BOOL16 WINAPI
MoveToEx16( HDC16 hdc
, INT16 x
, INT16 y
, LPPOINT16 pt
)
3181 if (!MoveToEx( HDC_32(hdc
), x
, y
, &pt32
)) return FALSE
;
3191 /***********************************************************************
3192 * ScaleViewportExtEx (GDI.484)
3194 BOOL16 WINAPI
ScaleViewportExtEx16( HDC16 hdc
, INT16 xNum
, INT16 xDenom
,
3195 INT16 yNum
, INT16 yDenom
, LPSIZE16 size
)
3198 BOOL16 ret
= ScaleViewportExtEx( HDC_32(hdc
), xNum
, xDenom
, yNum
, yDenom
,
3200 if (size
) { size
->cx
= size32
.cx
; size
->cy
= size32
.cy
; }
3205 /***********************************************************************
3206 * ScaleWindowExtEx (GDI.485)
3208 BOOL16 WINAPI
ScaleWindowExtEx16( HDC16 hdc
, INT16 xNum
, INT16 xDenom
,
3209 INT16 yNum
, INT16 yDenom
, LPSIZE16 size
)
3212 BOOL16 ret
= ScaleWindowExtEx( HDC_32(hdc
), xNum
, xDenom
, yNum
, yDenom
,
3214 if (size
) { size
->cx
= size32
.cx
; size
->cy
= size32
.cy
; }
3219 /***********************************************************************
3220 * GetAspectRatioFilterEx (GDI.486)
3222 BOOL16 WINAPI
GetAspectRatioFilterEx16( HDC16 hdc
, LPSIZE16 pAspectRatio
)
3224 FIXME("(%04x, %p): -- Empty Stub !\n", hdc
, pAspectRatio
);
3229 /******************************************************************************
3230 * PolyBezier (GDI.502)
3232 BOOL16 WINAPI
PolyBezier16( HDC16 hdc
, const POINT16
* lppt
, INT16 cPoints
)
3236 LPPOINT pt32
= HeapAlloc( GetProcessHeap(), 0, cPoints
*sizeof(POINT
) );
3237 if(!pt32
) return FALSE
;
3238 for (i
=cPoints
;i
--;)
3240 pt32
[i
].x
= lppt
[i
].x
;
3241 pt32
[i
].y
= lppt
[i
].y
;
3243 ret
= PolyBezier(HDC_32(hdc
), pt32
, cPoints
);
3244 HeapFree( GetProcessHeap(), 0, pt32
);
3249 /******************************************************************************
3250 * PolyBezierTo (GDI.503)
3252 BOOL16 WINAPI
PolyBezierTo16( HDC16 hdc
, const POINT16
* lppt
, INT16 cPoints
)
3256 LPPOINT pt32
= HeapAlloc( GetProcessHeap(), 0,
3257 cPoints
*sizeof(POINT
) );
3258 if(!pt32
) return FALSE
;
3259 for (i
=cPoints
;i
--;)
3261 pt32
[i
].x
= lppt
[i
].x
;
3262 pt32
[i
].y
= lppt
[i
].y
;
3264 ret
= PolyBezierTo(HDC_32(hdc
), pt32
, cPoints
);
3265 HeapFree( GetProcessHeap(), 0, pt32
);
3270 /******************************************************************************
3271 * ExtSelectClipRgn (GDI.508)
3273 INT16 WINAPI
ExtSelectClipRgn16( HDC16 hdc
, HRGN16 hrgn
, INT16 fnMode
)
3275 return ExtSelectClipRgn( HDC_32(hdc
), HRGN_32(hrgn
), fnMode
);
3279 /***********************************************************************
3280 * AbortPath (GDI.511)
3282 BOOL16 WINAPI
AbortPath16(HDC16 hdc
)
3284 return AbortPath( HDC_32(hdc
) );
3288 /***********************************************************************
3289 * BeginPath (GDI.512)
3291 BOOL16 WINAPI
BeginPath16(HDC16 hdc
)
3293 return BeginPath( HDC_32(hdc
) );
3297 /***********************************************************************
3298 * CloseFigure (GDI.513)
3300 BOOL16 WINAPI
CloseFigure16(HDC16 hdc
)
3302 return CloseFigure( HDC_32(hdc
) );
3306 /***********************************************************************
3309 BOOL16 WINAPI
EndPath16(HDC16 hdc
)
3311 return EndPath( HDC_32(hdc
) );
3315 /***********************************************************************
3316 * FillPath (GDI.515)
3318 BOOL16 WINAPI
FillPath16(HDC16 hdc
)
3320 return FillPath( HDC_32(hdc
) );
3324 /*******************************************************************
3325 * FlattenPath (GDI.516)
3327 BOOL16 WINAPI
FlattenPath16(HDC16 hdc
)
3329 return FlattenPath( HDC_32(hdc
) );
3333 /***********************************************************************
3336 INT16 WINAPI
GetPath16(HDC16 hdc
, LPPOINT16 pPoints
, LPBYTE pTypes
, INT16 nSize
)
3338 FIXME("(%d,%p,%p): stub\n",hdc
,pPoints
,pTypes
);
3343 /***********************************************************************
3344 * PathToRegion (GDI.518)
3346 HRGN16 WINAPI
PathToRegion16(HDC16 hdc
)
3348 return HRGN_16( PathToRegion( HDC_32(hdc
) ));
3352 /***********************************************************************
3353 * SelectClipPath (GDI.519)
3355 BOOL16 WINAPI
SelectClipPath16(HDC16 hdc
, INT16 iMode
)
3357 return SelectClipPath( HDC_32(hdc
), iMode
);
3361 /*******************************************************************
3362 * StrokeAndFillPath (GDI.520)
3364 BOOL16 WINAPI
StrokeAndFillPath16(HDC16 hdc
)
3366 return StrokeAndFillPath( HDC_32(hdc
) );
3370 /*******************************************************************
3371 * StrokePath (GDI.521)
3373 BOOL16 WINAPI
StrokePath16(HDC16 hdc
)
3375 return StrokePath( HDC_32(hdc
) );
3379 /*******************************************************************
3380 * WidenPath (GDI.522)
3382 BOOL16 WINAPI
WidenPath16(HDC16 hdc
)
3384 return WidenPath( HDC_32(hdc
) );
3388 /***********************************************************************
3389 * GetArcDirection (GDI.524)
3391 INT16 WINAPI
GetArcDirection16( HDC16 hdc
)
3393 return GetArcDirection( HDC_32(hdc
) );
3397 /***********************************************************************
3398 * SetArcDirection (GDI.525)
3400 INT16 WINAPI
SetArcDirection16( HDC16 hdc
, INT16 nDirection
)
3402 return SetArcDirection( HDC_32(hdc
), (INT
)nDirection
);
3406 /***********************************************************************
3407 * CreateHalftonePalette (GDI.529)
3409 HPALETTE16 WINAPI
CreateHalftonePalette16( HDC16 hdc
)
3411 return HPALETTE_16( CreateHalftonePalette( HDC_32(hdc
) ));
3415 /***********************************************************************
3416 * SetDIBColorTable (GDI.602)
3418 UINT16 WINAPI
SetDIBColorTable16( HDC16 hdc
, UINT16 startpos
, UINT16 entries
, RGBQUAD
*colors
)
3420 return SetDIBColorTable( HDC_32(hdc
), startpos
, entries
, colors
);
3424 /***********************************************************************
3425 * GetDIBColorTable (GDI.603)
3427 UINT16 WINAPI
GetDIBColorTable16( HDC16 hdc
, UINT16 startpos
, UINT16 entries
, RGBQUAD
*colors
)
3429 return GetDIBColorTable( HDC_32(hdc
), startpos
, entries
, colors
);
3433 /***********************************************************************
3434 * GetRegionData (GDI.607)
3436 * FIXME: is LPRGNDATA the same in Win16 and Win32 ?
3438 DWORD WINAPI
GetRegionData16( HRGN16 hrgn
, DWORD count
, LPRGNDATA rgndata
)
3440 return GetRegionData( HRGN_32(hrgn
), count
, rgndata
);
3444 /***********************************************************************
3445 * GdiFreeResources (GDI.609)
3447 WORD WINAPI
GdiFreeResources16( DWORD reserve
)
3449 return 90; /* lie about it, it shouldn't matter */
3453 /***********************************************************************
3454 * GdiSignalProc32 (GDI.610)
3456 WORD WINAPI
GdiSignalProc( UINT uCode
, DWORD dwThreadOrProcessID
,
3457 DWORD dwFlags
, HMODULE16 hModule
)
3463 /***********************************************************************
3464 * GetTextCharset (GDI.612)
3466 UINT16 WINAPI
GetTextCharset16( HDC16 hdc
)
3468 return GetTextCharset( HDC_32(hdc
) );
3472 /***********************************************************************
3473 * EnumFontFamiliesEx (GDI.613)
3475 INT16 WINAPI
EnumFontFamiliesEx16( HDC16 hdc
, LPLOGFONT16 plf
,
3476 FONTENUMPROC16 proc
, LPARAM lParam
,
3479 struct callback16_info info
;
3480 LOGFONTW lfW
, *plfW
;
3482 info
.proc
= (FARPROC16
)proc
;
3483 info
.param
= lParam
;
3487 logfont_16_to_W(plf
, &lfW
);
3492 return EnumFontFamiliesExW( HDC_32(hdc
), plfW
, enum_font_callback
,
3493 (LPARAM
)&info
, dwFlags
);
3497 /*************************************************************************
3498 * GetFontLanguageInfo (GDI.616)
3500 DWORD WINAPI
GetFontLanguageInfo16( HDC16 hdc
)
3502 return GetFontLanguageInfo( HDC_32(hdc
) );
3506 /***********************************************************************
3507 * SetLayout (GDI.1000)
3509 * Sets left->right or right->left text layout flags of a dc.
3511 BOOL16 WINAPI
SetLayout16( HDC16 hdc
, DWORD layout
)
3513 return SetLayout( HDC_32(hdc
), layout
);
3517 /***********************************************************************
3518 * SetSolidBrush (GDI.604)
3520 * Change the color of a solid brush.
3523 * hBrush [I] Brush to change the color of
3524 * newColor [I] New color for hBrush
3527 * Success: TRUE. The color of hBrush is set to newColor.
3531 * This function is undocumented and untested. The implementation may
3534 BOOL16 WINAPI
SetSolidBrush16(HBRUSH16 hBrush
, COLORREF newColor
)
3536 FIXME( "%04x %08lx no longer supported\n", hBrush
, newColor
);
3541 /***********************************************************************
3544 void WINAPI
Copy16( LPVOID src
, LPVOID dst
, WORD size
)
3546 memcpy( dst
, src
, size
);
3549 /***********************************************************************
3550 * RealizeDefaultPalette (GDI.365)
3552 UINT16 WINAPI
RealizeDefaultPalette16( HDC16 hdc
)
3554 FIXME( "%04x semi-stub\n", hdc
);
3555 return GDIRealizePalette16( hdc
);
3558 /***********************************************************************
3559 * IsDCCurrentPalette (GDI.412)
3561 BOOL16 WINAPI
IsDCCurrentPalette16(HDC16 hDC
)
3563 return HPALETTE_16( GetCurrentObject( HDC_32(hDC
), OBJ_PAL
)) == hPrimaryPalette
;
3566 /*********************************************************************
3567 * SetMagicColors (GDI.606)
3569 VOID WINAPI
SetMagicColors16(HDC16 hDC
, COLORREF color
, UINT16 index
)
3571 FIXME("(hDC %04x, color %04x, index %04x): stub\n", hDC
, (int)color
, index
);
3576 /***********************************************************************
3579 BOOL16 WINAPI
DPtoLP16( HDC16 hdc
, LPPOINT16 points
, INT16 count
)
3581 POINT points32
[8], *pt32
= points32
;
3587 if (!(pt32
= HeapAlloc( GetProcessHeap(), 0, count
* sizeof(*pt32
) ))) return FALSE
;
3589 for (i
= 0; i
< count
; i
++)
3591 pt32
[i
].x
= points
[i
].x
;
3592 pt32
[i
].y
= points
[i
].y
;
3594 if ((ret
= DPtoLP( HDC_32(hdc
), pt32
, count
)))
3596 for (i
= 0; i
< count
; i
++)
3598 points
[i
].x
= pt32
[i
].x
;
3599 points
[i
].y
= pt32
[i
].y
;
3602 if (pt32
!= points32
) HeapFree( GetProcessHeap(), 0, pt32
);
3607 /***********************************************************************
3610 BOOL16 WINAPI
LPtoDP16( HDC16 hdc
, LPPOINT16 points
, INT16 count
)
3612 POINT points32
[8], *pt32
= points32
;
3618 if (!(pt32
= HeapAlloc( GetProcessHeap(), 0, count
* sizeof(*pt32
) ))) return FALSE
;
3620 for (i
= 0; i
< count
; i
++)
3622 pt32
[i
].x
= points
[i
].x
;
3623 pt32
[i
].y
= points
[i
].y
;
3625 if ((ret
= LPtoDP( HDC_32(hdc
), pt32
, count
)))
3627 for (i
= 0; i
< count
; i
++)
3629 points
[i
].x
= pt32
[i
].x
;
3630 points
[i
].y
= pt32
[i
].y
;
3633 if (pt32
!= points32
) HeapFree( GetProcessHeap(), 0, pt32
);
3638 /***********************************************************************
3639 * GetDCState (GDI.179)
3641 HDC16 WINAPI
GetDCState16( HDC16 hdc
)
3643 ERR( "no longer supported\n" );
3648 /***********************************************************************
3649 * SetDCState (GDI.180)
3651 void WINAPI
SetDCState16( HDC16 hdc
, HDC16 hdcs
)
3653 ERR( "no longer supported\n" );
3656 /***********************************************************************
3657 * SetDCOrg (GDI.117)
3659 DWORD WINAPI
SetDCOrg16( HDC16 hdc16
, INT16 x
, INT16 y
)
3661 FIXME( "%04x %d,%d no longer supported\n", hdc16
, x
, y
);
3666 /***********************************************************************
3667 * InquireVisRgn (GDI.131)
3669 HRGN16 WINAPI
InquireVisRgn16( HDC16 hdc
)
3673 if (!hrgn
) hrgn
= CreateRectRgn( 0, 0, 0, 0 );
3674 GetRandomRgn( HDC_32(hdc
), hrgn
, SYSRGN
);
3675 return HRGN_16(hrgn
);
3679 /***********************************************************************
3680 * OffsetVisRgn (GDI.102)
3682 INT16 WINAPI
OffsetVisRgn16( HDC16 hdc16
, INT16 x
, INT16 y
)
3684 FIXME( "%04x %d,%d no longer supported\n", hdc16
, x
, y
);
3689 /***********************************************************************
3690 * ExcludeVisRect (GDI.73)
3692 INT16 WINAPI
ExcludeVisRect16( HDC16 hdc16
, INT16 left
, INT16 top
, INT16 right
, INT16 bottom
)
3694 FIXME( "%04x %d,%d-%d,%d no longer supported\n", hdc16
, left
, top
, right
, bottom
);
3699 /***********************************************************************
3700 * IntersectVisRect (GDI.98)
3702 INT16 WINAPI
IntersectVisRect16( HDC16 hdc16
, INT16 left
, INT16 top
, INT16 right
, INT16 bottom
)
3704 FIXME( "%04x %d,%d-%d,%d no longer supported\n", hdc16
, left
, top
, right
, bottom
);
3709 /***********************************************************************
3710 * SaveVisRgn (GDI.129)
3712 HRGN16 WINAPI
SaveVisRgn16( HDC16 hdc16
)
3714 FIXME( "%04x no longer supported\n", hdc16
);
3719 /***********************************************************************
3720 * RestoreVisRgn (GDI.130)
3722 INT16 WINAPI
RestoreVisRgn16( HDC16 hdc16
)
3724 FIXME( "%04x no longer supported\n", hdc16
);
3729 /***********************************************************************
3730 * GetClipRgn (GDI.173)
3732 HRGN16 WINAPI
GetClipRgn16( HDC16 hdc
)
3736 if (!hrgn
) hrgn
= CreateRectRgn( 0, 0, 0, 0 );
3737 GetClipRgn( HDC_32(hdc
), hrgn
);
3738 return HRGN_16(hrgn
);
3742 /***********************************************************************
3743 * MakeObjectPrivate (GDI.463)
3745 * What does that mean ?
3746 * Some little docu can be found in "Undocumented Windows",
3747 * but this is basically useless.
3749 void WINAPI
MakeObjectPrivate16( HGDIOBJ16 handle16
, BOOL16
private )
3751 FIXME( "stub: %x %u\n", handle16
, private );
3754 /***********************************************************************
3755 * CreateDIBSection (GDI.489)
3757 HBITMAP16 WINAPI
CreateDIBSection16 (HDC16 hdc
, const BITMAPINFO
*bmi
, UINT16 usage
,
3758 SEGPTR
*bits16
, HANDLE section
, DWORD offset
)
3763 hbitmap
= CreateDIBSection( HDC_32(hdc
), bmi
, usage
, &bits32
, section
, offset
);
3764 if (hbitmap
&& bits32
&& bits16
) *bits16
= alloc_segptr_bits( hbitmap
, bits32
);
3765 return HBITMAP_16(hbitmap
);