4 * Copyright 1993 Alexandre Julliard
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
36 #include "wine/debug.h"
38 WINE_DEFAULT_DEBUG_CHANNEL(gdi
);
40 #define HGDIOBJ_32(h16) ((HGDIOBJ)(ULONG_PTR)(h16))
42 /***********************************************************************
46 static const LOGBRUSH WhiteBrush
= { BS_SOLID
, RGB(255,255,255), 0 };
47 static const LOGBRUSH BlackBrush
= { BS_SOLID
, RGB(0,0,0), 0 };
48 static const LOGBRUSH NullBrush
= { BS_NULL
, 0, 0 };
50 /* FIXME: these should perhaps be BS_HATCHED, at least for 1 bitperpixel */
51 static const LOGBRUSH LtGrayBrush
= { BS_SOLID
, RGB(192,192,192), 0 };
52 static const LOGBRUSH GrayBrush
= { BS_SOLID
, RGB(128,128,128), 0 };
54 /* This is BS_HATCHED, for 1 bitperpixel. This makes the spray work in pbrush */
55 /* See HatchBrushes in x11drv for the HS_DIAGCROSS+1 hack */
56 static const LOGBRUSH DkGrayBrush
= { BS_HATCHED
, RGB(0,0,0), (HS_DIAGCROSS
+1) };
58 static const LOGPEN WhitePen
= { PS_SOLID
, { 0, 0 }, RGB(255,255,255) };
59 static const LOGPEN BlackPen
= { PS_SOLID
, { 0, 0 }, RGB(0,0,0) };
60 static const LOGPEN NullPen
= { PS_NULL
, { 0, 0 }, 0 };
63 /* reserve one extra entry for the stock default bitmap */
64 /* this is what Windows does too */
65 #define NB_STOCK_OBJECTS (STOCK_LAST+2)
67 static HGDIOBJ stock_objects
[NB_STOCK_OBJECTS
];
69 static SYSLEVEL GDI_level
= { CRITICAL_SECTION_INIT("GDI_level"), 3 };
70 static WORD GDI_HeapSel
;
72 inline static BOOL
get_bool(char *buffer
)
74 return (buffer
[0] == 'y' || buffer
[0] == 'Y' ||
75 buffer
[0] == 't' || buffer
[0] == 'T' ||
80 /****************************************************************************
82 * language-independent stock fonts
86 static const LOGFONTW OEMFixedFont
=
87 { 12, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, OEM_CHARSET
,
88 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
, {'\0'} };
90 static const LOGFONTW AnsiFixedFont
=
91 { 12, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, ANSI_CHARSET
,
92 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
, {'\0'} };
94 static const LOGFONTW AnsiVarFont
=
95 { 12, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, ANSI_CHARSET
,
96 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
97 {'M','S',' ','S','a','n','s',' ','S','e','r','i','f','\0'} };
99 /******************************************************************************
101 * language-dependent stock fonts
103 * 'ANSI' charset and 'DEFAULT' charset is not same.
104 * The chars in CP_ACP should be drawn with 'DEFAULT' charset.
105 * 'ANSI' charset seems to be identical with ISO-8859-1.
106 * 'DEFAULT' charset is a language-dependent charset.
108 * 'System' font seems to be an alias for language-dependent font.
112 * language-dependenet stock fonts for all known charsets
113 * please see TranslateCharsetInfo (objects/font.c) and
114 * CharsetBindingInfo (graphics/x11drv/xfont.c),
115 * and modify entries for your language if needed.
117 struct DefaultFontInfo
121 LOGFONTW DeviceDefaultFont
;
122 LOGFONTW SystemFixedFont
;
123 LOGFONTW DefaultGuiFont
;
126 static const struct DefaultFontInfo default_fonts
[] =
130 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, ANSI_CHARSET
,
131 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
132 {'S','y','s','t','e','m','\0'}
134 { /* Device Default */
135 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, ANSI_CHARSET
,
136 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
140 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, ANSI_CHARSET
,
141 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
144 { /* DefaultGuiFont */
145 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, ANSI_CHARSET
,
146 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
147 {'M','S',' ','S','a','n','s',' ','S','e','r','i','f','\0'}
150 { EASTEUROPE_CHARSET
,
152 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, EASTEUROPE_CHARSET
,
153 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
154 {'S','y','s','t','e','m','\0'}
156 { /* Device Default */
157 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, EASTEUROPE_CHARSET
,
158 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
162 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, EASTEUROPE_CHARSET
,
163 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
166 { /* DefaultGuiFont */
167 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, EASTEUROPE_CHARSET
,
168 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
169 {'M','S',' ','S','a','n','s',' ','S','e','r','i','f','\0'}
174 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, RUSSIAN_CHARSET
,
175 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
176 {'S','y','s','t','e','m','\0'}
178 { /* Device Default */
179 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, RUSSIAN_CHARSET
,
180 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
184 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, RUSSIAN_CHARSET
,
185 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
188 { /* DefaultGuiFont */
189 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, RUSSIAN_CHARSET
,
190 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
191 {'M','S',' ','S','a','n','s',' ','S','e','r','i','f','\0'}
196 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, GREEK_CHARSET
,
197 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
198 {'S','y','s','t','e','m','\0'}
200 { /* Device Default */
201 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, GREEK_CHARSET
,
202 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
206 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, GREEK_CHARSET
,
207 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
210 { /* DefaultGuiFont */
211 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, GREEK_CHARSET
,
212 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
213 {'M','S',' ','S','a','n','s',' ','S','e','r','i','f','\0'}
218 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, TURKISH_CHARSET
,
219 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
220 {'S','y','s','t','e','m','\0'}
222 { /* Device Default */
223 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, TURKISH_CHARSET
,
224 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
228 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, TURKISH_CHARSET
,
229 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
232 { /* DefaultGuiFont */
233 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, TURKISH_CHARSET
,
234 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
235 {'M','S',' ','S','a','n','s',' ','S','e','r','i','f','\0'}
240 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, HEBREW_CHARSET
,
241 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
242 {'S','y','s','t','e','m','\0'}
244 { /* Device Default */
245 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, HEBREW_CHARSET
,
246 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
250 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, HEBREW_CHARSET
,
251 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
254 { /* DefaultGuiFont */
255 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, HEBREW_CHARSET
,
256 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
257 {'M','S',' ','S','a','n','s',' ','S','e','r','i','f','\0'}
262 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, ARABIC_CHARSET
,
263 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
264 {'S','y','s','t','e','m','\0'}
266 { /* Device Default */
267 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, ARABIC_CHARSET
,
268 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
272 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, ARABIC_CHARSET
,
273 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
276 { /* DefaultGuiFont */
277 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, ARABIC_CHARSET
,
278 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
279 {'M','S',' ','S','a','n','s',' ','S','e','r','i','f','\0'}
284 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, BALTIC_CHARSET
,
285 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
286 {'S','y','s','t','e','m','\0'}
288 { /* Device Default */
289 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, BALTIC_CHARSET
,
290 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
294 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, BALTIC_CHARSET
,
295 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
298 { /* DefaultGuiFont */
299 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, BALTIC_CHARSET
,
300 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
301 {'M','S',' ','S','a','n','s',' ','S','e','r','i','f','\0'}
306 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, THAI_CHARSET
,
307 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
308 {'S','y','s','t','e','m','\0'}
310 { /* Device Default */
311 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, THAI_CHARSET
,
312 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
316 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, THAI_CHARSET
,
317 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
320 { /* DefaultGuiFont */
321 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, THAI_CHARSET
,
322 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
323 {'M','S',' ','S','a','n','s',' ','S','e','r','i','f','\0'}
328 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, SHIFTJIS_CHARSET
,
329 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
330 {'S','y','s','t','e','m','\0'}
332 { /* Device Default */
333 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, SHIFTJIS_CHARSET
,
334 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
338 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, SHIFTJIS_CHARSET
,
339 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
342 { /* DefaultGuiFont */
343 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, SHIFTJIS_CHARSET
,
344 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
345 {'M','S',' ','P',' ','g','o','t','h','i','c','\0'} /* FIXME: Is this correct? */
350 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, GB2312_CHARSET
,
351 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
352 {'S','y','s','t','e','m','\0'}
354 { /* Device Default */
355 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, GB2312_CHARSET
,
356 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
360 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, GB2312_CHARSET
,
361 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
364 { /* DefaultGuiFont */
365 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, GB2312_CHARSET
,
366 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
367 {'M','S',' ','S','o','n','g','\0'} /* FIXME: Is this correct? */
372 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, HANGEUL_CHARSET
,
373 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
374 {'S','y','s','t','e','m','\0'}
376 { /* Device Default */
377 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, HANGEUL_CHARSET
,
378 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
382 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, HANGEUL_CHARSET
,
383 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
386 { /* DefaultGuiFont */
387 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, HANGEUL_CHARSET
,
388 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
389 {'G','u','l','i','m'},
392 { CHINESEBIG5_CHARSET
,
394 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, CHINESEBIG5_CHARSET
,
395 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
396 {'S','y','s','t','e','m','\0'}
398 { /* Device Default */
399 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, CHINESEBIG5_CHARSET
,
400 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
404 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, CHINESEBIG5_CHARSET
,
405 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
408 { /* DefaultGuiFont */
409 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, CHINESEBIG5_CHARSET
,
410 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
411 {'\0'} /* FIXME - what is the native font??? */
416 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, JOHAB_CHARSET
,
417 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
418 {'S','y','s','t','e','m','\0'}
420 { /* Device Default */
421 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, JOHAB_CHARSET
,
422 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
426 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, JOHAB_CHARSET
,
427 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
430 { /* DefaultGuiFont */
431 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, JOHAB_CHARSET
,
432 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
433 {'M','S',' ','M','i','n','g','l','i','u','\0'} /* FIXME: Is this correct? */
439 /******************************************************************************
442 static const struct DefaultFontInfo
* get_default_fonts(UINT charset
)
446 for(n
=0;n
<(sizeof(default_fonts
)/sizeof(default_fonts
[0]));n
++)
448 if ( default_fonts
[n
].charset
== charset
)
449 return &default_fonts
[n
];
452 FIXME( "unhandled charset 0x%08x - use ANSI_CHARSET for default stock objects\n", charset
);
453 return &default_fonts
[0];
457 /******************************************************************************
458 * get_default_charset (internal)
460 * get the language-dependent charset that can handle CP_ACP correctly.
462 static UINT
get_default_charset( void )
468 csi
.ciCharset
= ANSI_CHARSET
;
469 if ( ! TranslateCharsetInfo( (LPDWORD
)uACP
, &csi
, TCI_SRCCODEPAGE
) )
471 FIXME( "unhandled codepage %u - use ANSI_CHARSET for default stock objects\n", uACP
);
475 return csi
.ciCharset
;
479 /******************************************************************************
482 static HFONT
create_stock_font( char const *fontName
, const LOGFONTW
*font
, HKEY hkey
)
486 char buffer
[MAX_PATH
];
489 if (!hkey
) return CreateFontIndirectW( font
);
492 sprintf(key
, "%s.Height", fontName
);
493 count
= sizeof(buffer
);
494 if(!RegQueryValueExA(hkey
, key
, 0, &type
, buffer
, &count
))
495 lf
.lfHeight
= atoi(buffer
);
497 sprintf(key
, "%s.Bold", fontName
);
498 count
= sizeof(buffer
);
499 if(!RegQueryValueExA(hkey
, key
, 0, &type
, buffer
, &count
))
500 lf
.lfWeight
= get_bool(buffer
) ? FW_BOLD
: FW_NORMAL
;
502 sprintf(key
, "%s.Italic", fontName
);
503 count
= sizeof(buffer
);
504 if(!RegQueryValueExA(hkey
, key
, 0, &type
, buffer
, &count
))
505 lf
.lfItalic
= get_bool(buffer
);
507 sprintf(key
, "%s.Underline", fontName
);
508 count
= sizeof(buffer
);
509 if(!RegQueryValueExA(hkey
, key
, 0, &type
, buffer
, &count
))
510 lf
.lfUnderline
= get_bool(buffer
);
512 sprintf(key
, "%s.StrikeOut", fontName
);
513 count
= sizeof(buffer
);
514 if(!RegQueryValueExA(hkey
, key
, 0, &type
, buffer
, &count
))
515 lf
.lfStrikeOut
= get_bool(buffer
);
516 return CreateFontIndirectW( &lf
);
520 #define TRACE_SEC(handle,text) \
521 TRACE("(%p): " text " %ld\n", (handle), GDI_level.crst.RecursionCount)
524 /***********************************************************************
527 * Increment the reference count of a GDI object.
529 inline static void inc_ref_count( HGDIOBJ handle
)
533 if ((header
= GDI_GetObjPtr( handle
, MAGIC_DONTCARE
)))
536 GDI_ReleaseObj( handle
);
541 /***********************************************************************
544 * Decrement the reference count of a GDI object.
546 inline static void dec_ref_count( HGDIOBJ handle
)
550 if ((header
= GDI_GetObjPtr( handle
, MAGIC_DONTCARE
)))
552 if (header
->dwCount
) header
->dwCount
--;
553 if (header
->dwCount
!= 0x80000000) GDI_ReleaseObj( handle
);
556 /* handle delayed DeleteObject*/
558 GDI_ReleaseObj( handle
);
559 TRACE( "executing delayed DeleteObject for %p\n", handle
);
560 DeleteObject( handle
);
566 /***********************************************************************
569 * GDI initialization.
573 HINSTANCE16 instance
;
576 const struct DefaultFontInfo
* deffonts
;
579 if (RegOpenKeyA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\Wine\\Config\\Tweak.Fonts", &hkey
))
582 /* create GDI heap */
583 if ((instance
= LoadLibrary16( "GDI.EXE" )) >= 32) GDI_HeapSel
= instance
| 7;
585 /* create stock objects */
586 stock_objects
[WHITE_BRUSH
] = CreateBrushIndirect( &WhiteBrush
);
587 stock_objects
[LTGRAY_BRUSH
] = CreateBrushIndirect( &LtGrayBrush
);
588 stock_objects
[GRAY_BRUSH
] = CreateBrushIndirect( &GrayBrush
);
589 stock_objects
[DKGRAY_BRUSH
] = CreateBrushIndirect( &DkGrayBrush
);
590 stock_objects
[BLACK_BRUSH
] = CreateBrushIndirect( &BlackBrush
);
591 stock_objects
[NULL_BRUSH
] = CreateBrushIndirect( &NullBrush
);
593 stock_objects
[WHITE_PEN
] = CreatePenIndirect( &WhitePen
);
594 stock_objects
[BLACK_PEN
] = CreatePenIndirect( &BlackPen
);
595 stock_objects
[NULL_PEN
] = CreatePenIndirect( &NullPen
);
597 stock_objects
[DEFAULT_PALETTE
] = PALETTE_Init();
598 stock_objects
[DEFAULT_BITMAP
] = CreateBitmap( 1, 1, 1, 1, NULL
);
600 /* language-independent stock fonts */
601 stock_objects
[OEM_FIXED_FONT
] = create_stock_font( "OEMFixed", &OEMFixedFont
, hkey
);
602 stock_objects
[ANSI_FIXED_FONT
] = create_stock_font( "AnsiFixed", &AnsiFixedFont
, hkey
);
603 stock_objects
[ANSI_VAR_FONT
] = create_stock_font( "AnsiVar", &AnsiVarFont
, hkey
);
605 /* language-dependent stock fonts */
606 deffonts
= get_default_fonts(get_default_charset());
607 stock_objects
[SYSTEM_FONT
] = create_stock_font( "System", &deffonts
->SystemFont
, hkey
);
608 stock_objects
[DEVICE_DEFAULT_FONT
] = create_stock_font( "DeviceDefault", &deffonts
->DeviceDefaultFont
, hkey
);
609 stock_objects
[SYSTEM_FIXED_FONT
] = create_stock_font( "SystemFixed", &deffonts
->SystemFixedFont
, hkey
);
610 stock_objects
[DEFAULT_GUI_FONT
] = create_stock_font( "DefaultGui", &deffonts
->DefaultGuiFont
, hkey
);
613 /* clear the NOSYSTEM bit on all stock objects*/
614 for (i
= 0; i
< NB_STOCK_OBJECTS
; i
++)
616 if (!stock_objects
[i
])
618 if (i
== 9) continue; /* there's no stock object 9 */
619 ERR( "could not create stock object %d\n", i
);
622 ptr
= GDI_GetObjPtr( stock_objects
[i
], MAGIC_DONTCARE
);
623 ptr
->wMagic
&= ~OBJECT_NOSYSTEM
;
624 GDI_ReleaseObj( stock_objects
[i
] );
627 if (hkey
) RegCloseKey( hkey
);
634 #define FIRST_LARGE_HANDLE 16
635 #define MAX_LARGE_HANDLES ((GDI_HEAP_SIZE >> 2) - FIRST_LARGE_HANDLE)
636 static GDIOBJHDR
*large_handles
[MAX_LARGE_HANDLES
];
637 static int next_large_handle
;
639 /***********************************************************************
642 * Allocate a GDI handle from the large heap. Helper for GDI_AllocObject
644 inline static GDIOBJHDR
*alloc_large_heap( WORD size
, HGDIOBJ
*handle
)
649 for (i
= next_large_handle
+ 1; i
< MAX_LARGE_HANDLES
; i
++)
650 if (!large_handles
[i
]) goto found
;
651 for (i
= 0; i
<= next_large_handle
; i
++)
652 if (!large_handles
[i
]) goto found
;
657 if ((obj
= HeapAlloc( GetProcessHeap(), 0, size
)))
659 large_handles
[i
] = obj
;
660 *handle
= (HGDIOBJ
)(ULONG_PTR
)((i
+ FIRST_LARGE_HANDLE
) << 2);
661 next_large_handle
= i
;
667 /***********************************************************************
670 void *GDI_AllocObject( WORD size
, WORD magic
, HGDIOBJ
*handle
, const struct gdi_obj_funcs
*funcs
)
675 _EnterSysLevel( &GDI_level
);
681 if (!(hlocal
= LOCAL_Alloc( GDI_HeapSel
, LMEM_MOVEABLE
, size
))) goto error
;
682 assert( hlocal
& 2 );
683 obj
= (GDIOBJHDR
*)LOCAL_Lock( GDI_HeapSel
, hlocal
);
684 *handle
= (HGDIOBJ
)(ULONG_PTR
)hlocal
;
689 case DISABLED_DC_MAGIC
:
692 case METAFILE_DC_MAGIC
:
693 case ENHMETAFILE_MAGIC
:
694 case ENHMETAFILE_DC_MAGIC
:
695 case MEMORY_DC_MAGIC
:
698 if (!(obj
= alloc_large_heap( size
, handle
))) goto error
;
703 obj
->wMagic
= magic
|OBJECT_NOSYSTEM
;
707 TRACE_SEC( *handle
, "enter" );
711 _LeaveSysLevel( &GDI_level
);
717 /***********************************************************************
720 * The object ptr must have been obtained with GDI_GetObjPtr.
721 * The new pointer must be released with GDI_ReleaseObj.
723 void *GDI_ReallocObject( WORD size
, HGDIOBJ handle
, void *object
)
727 if ((UINT_PTR
)handle
& 2) /* GDI heap handle */
729 HLOCAL16 h
= LOWORD(handle
);
730 LOCAL_Unlock( GDI_HeapSel
, h
);
731 if ((new_handle
= (HGDIOBJ
)(ULONG_PTR
)LOCAL_ReAlloc( GDI_HeapSel
, h
, size
, LMEM_MOVEABLE
)))
733 assert( new_handle
== handle
); /* moveable handle cannot change */
734 return LOCAL_Lock( GDI_HeapSel
, h
);
739 int i
= ((ULONG_PTR
)handle
>> 2) - FIRST_LARGE_HANDLE
;
740 if (i
>= 0 && i
< MAX_LARGE_HANDLES
&& large_handles
[i
])
742 void *new_ptr
= HeapReAlloc( GetProcessHeap(), 0, large_handles
[i
], size
);
745 large_handles
[i
] = new_ptr
;
749 else ERR( "Invalid handle %p\n", handle
);
751 TRACE_SEC( handle
, "leave" );
752 _LeaveSysLevel( &GDI_level
);
757 /***********************************************************************
760 BOOL
GDI_FreeObject( HGDIOBJ handle
, void *ptr
)
762 GDIOBJHDR
*object
= ptr
;
764 object
->wMagic
= 0; /* Mark it as invalid */
765 object
->funcs
= NULL
;
766 if ((UINT_PTR
)handle
& 2) /* GDI heap handle */
768 HLOCAL16 h
= LOWORD(handle
);
769 LOCAL_Unlock( GDI_HeapSel
, h
);
770 LOCAL_Free( GDI_HeapSel
, h
);
772 else /* large heap handle */
774 int i
= ((ULONG_PTR
)handle
>> 2) - FIRST_LARGE_HANDLE
;
775 if (i
>= 0 && i
< MAX_LARGE_HANDLES
&& large_handles
[i
])
777 HeapFree( GetProcessHeap(), 0, large_handles
[i
] );
778 large_handles
[i
] = NULL
;
780 else ERR( "Invalid handle %p\n", handle
);
782 TRACE_SEC( handle
, "leave" );
783 _LeaveSysLevel( &GDI_level
);
788 /***********************************************************************
791 * Return a pointer to the GDI object associated to the handle.
792 * Return NULL if the object has the wrong magic number.
793 * The object must be released with GDI_ReleaseObj.
795 void *GDI_GetObjPtr( HGDIOBJ handle
, WORD magic
)
797 GDIOBJHDR
*ptr
= NULL
;
799 _EnterSysLevel( &GDI_level
);
801 if ((UINT_PTR
)handle
& 2) /* GDI heap handle */
803 HLOCAL16 h
= LOWORD(handle
);
804 ptr
= (GDIOBJHDR
*)LOCAL_Lock( GDI_HeapSel
, h
);
807 if (((magic
!= MAGIC_DONTCARE
) && (GDIMAGIC(ptr
->wMagic
) != magic
)) ||
808 (GDIMAGIC(ptr
->wMagic
) < FIRST_MAGIC
) ||
809 (GDIMAGIC(ptr
->wMagic
) > LAST_MAGIC
))
811 LOCAL_Unlock( GDI_HeapSel
, h
);
816 else /* large heap handle */
818 int i
= ((UINT_PTR
)handle
>> 2) - FIRST_LARGE_HANDLE
;
819 if (i
>= 0 && i
< MAX_LARGE_HANDLES
)
821 ptr
= large_handles
[i
];
822 if (ptr
&& (magic
!= MAGIC_DONTCARE
) && (GDIMAGIC(ptr
->wMagic
) != magic
)) ptr
= NULL
;
828 _LeaveSysLevel( &GDI_level
);
829 SetLastError( ERROR_INVALID_HANDLE
);
830 WARN( "Invalid handle %p\n", handle
);
832 else TRACE_SEC( handle
, "enter" );
838 /***********************************************************************
842 void GDI_ReleaseObj( HGDIOBJ handle
)
844 if ((UINT_PTR
)handle
& 2) LOCAL_Unlock( GDI_HeapSel
, LOWORD(handle
) );
845 TRACE_SEC( handle
, "leave" );
846 _LeaveSysLevel( &GDI_level
);
850 /***********************************************************************
853 void GDI_CheckNotLock(void)
855 _CheckNotSysLevel( &GDI_level
);
859 /***********************************************************************
860 * DeleteObject (GDI32.@)
862 BOOL WINAPI
DeleteObject( HGDIOBJ obj
)
864 /* Check if object is valid */
867 if (HIWORD(obj
)) return FALSE
;
869 if (!(header
= GDI_GetObjPtr( obj
, MAGIC_DONTCARE
))) return FALSE
;
871 if (!(header
->wMagic
& OBJECT_NOSYSTEM
)
872 && (header
->wMagic
>= FIRST_MAGIC
) && (header
->wMagic
<= LAST_MAGIC
))
874 TRACE("Preserving system object %p\n", obj
);
875 GDI_ReleaseObj( obj
);
881 TRACE("delayed for %p because object in use, count %ld\n", obj
, header
->dwCount
);
882 header
->dwCount
|= 0x80000000; /* mark for delete */
883 GDI_ReleaseObj( obj
);
891 if (header
->funcs
&& header
->funcs
->pDeleteObject
)
892 return header
->funcs
->pDeleteObject( obj
, header
);
894 GDI_ReleaseObj( obj
);
899 /***********************************************************************
900 * GetStockObject (GDI32.@)
902 HGDIOBJ WINAPI
GetStockObject( INT obj
)
905 if ((obj
< 0) || (obj
>= NB_STOCK_OBJECTS
)) return 0;
906 ret
= stock_objects
[obj
];
907 TRACE("returning %p\n", ret
);
912 /***********************************************************************
915 INT16 WINAPI
GetObject16( HANDLE16 handle16
, INT16 count
, LPVOID buffer
)
918 HGDIOBJ handle
= HGDIOBJ_32( handle16
);
921 TRACE("%p %d %p\n", handle
, count
, buffer
);
922 if (!count
) return 0;
924 if (!(ptr
= GDI_GetObjPtr( handle
, MAGIC_DONTCARE
))) return 0;
926 if (ptr
->funcs
&& ptr
->funcs
->pGetObject16
)
927 result
= ptr
->funcs
->pGetObject16( handle
, ptr
, count
, buffer
);
929 SetLastError( ERROR_INVALID_HANDLE
);
931 GDI_ReleaseObj( handle
);
936 /***********************************************************************
937 * GetObjectA (GDI32.@)
939 INT WINAPI
GetObjectA( HANDLE handle
, INT count
, LPVOID buffer
)
943 TRACE("%p %d %p\n", handle
, count
, buffer
);
944 if (!count
) return 0;
946 if (!(ptr
= GDI_GetObjPtr( handle
, MAGIC_DONTCARE
))) return 0;
948 if (ptr
->funcs
&& ptr
->funcs
->pGetObjectA
)
949 result
= ptr
->funcs
->pGetObjectA( handle
, ptr
, count
, buffer
);
951 SetLastError( ERROR_INVALID_HANDLE
);
953 GDI_ReleaseObj( handle
);
957 /***********************************************************************
958 * GetObjectW (GDI32.@)
960 INT WINAPI
GetObjectW( HANDLE handle
, INT count
, LPVOID buffer
)
964 TRACE("%p %d %p\n", handle
, count
, buffer
);
965 if (!count
) return 0;
967 if (!(ptr
= GDI_GetObjPtr( handle
, MAGIC_DONTCARE
))) return 0;
969 if (ptr
->funcs
&& ptr
->funcs
->pGetObjectW
)
970 result
= ptr
->funcs
->pGetObjectW( handle
, ptr
, count
, buffer
);
972 SetLastError( ERROR_INVALID_HANDLE
);
974 GDI_ReleaseObj( handle
);
978 /***********************************************************************
979 * GetObjectType (GDI32.@)
981 DWORD WINAPI
GetObjectType( HANDLE handle
)
985 TRACE("%p\n", handle
);
987 if (!(ptr
= GDI_GetObjPtr( handle
, MAGIC_DONTCARE
))) return 0;
989 switch(GDIMAGIC(ptr
->wMagic
))
1007 result
= OBJ_REGION
;
1013 result
= OBJ_METADC
;
1015 case METAFILE_MAGIC
:
1016 result
= OBJ_METAFILE
;
1018 case METAFILE_DC_MAGIC
:
1019 result
= OBJ_METADC
;
1021 case ENHMETAFILE_MAGIC
:
1022 result
= OBJ_ENHMETAFILE
;
1024 case ENHMETAFILE_DC_MAGIC
:
1025 result
= OBJ_ENHMETADC
;
1027 case MEMORY_DC_MAGIC
:
1031 FIXME("Magic %04x not implemented\n", GDIMAGIC(ptr
->wMagic
) );
1034 GDI_ReleaseObj( handle
);
1038 /***********************************************************************
1039 * GetCurrentObject (GDI32.@)
1041 HANDLE WINAPI
GetCurrentObject(HDC hdc
,UINT type
)
1044 DC
* dc
= DC_GetDCPtr( hdc
);
1049 case OBJ_PEN
: ret
= dc
->hPen
; break;
1050 case OBJ_BRUSH
: ret
= dc
->hBrush
; break;
1051 case OBJ_PAL
: ret
= dc
->hPalette
; break;
1052 case OBJ_FONT
: ret
= dc
->hFont
; break;
1053 case OBJ_BITMAP
: ret
= dc
->hBitmap
; break;
1055 /* the SDK only mentions those above */
1056 FIXME("(%p,%d): unknown type.\n",hdc
,type
);
1059 GDI_ReleaseObj( hdc
);
1065 /***********************************************************************
1066 * SelectObject (GDI32.@)
1068 HGDIOBJ WINAPI
SelectObject( HDC hdc
, HGDIOBJ handle
)
1071 GDIOBJHDR
*header
= GDI_GetObjPtr( handle
, MAGIC_DONTCARE
);
1072 if (!header
) return 0;
1074 TRACE("hdc=%p %p\n", hdc
, handle
);
1076 if (header
->funcs
&& header
->funcs
->pSelectObject
)
1078 ret
= header
->funcs
->pSelectObject( handle
, header
, hdc
);
1079 if (ret
&& ret
!= handle
&& (INT
)ret
> COMPLEXREGION
)
1081 inc_ref_count( handle
);
1082 dec_ref_count( ret
);
1085 GDI_ReleaseObj( handle
);
1090 /***********************************************************************
1091 * UnrealizeObject (GDI32.@)
1093 BOOL WINAPI
UnrealizeObject( HGDIOBJ obj
)
1096 /* Check if object is valid */
1098 GDIOBJHDR
* header
= GDI_GetObjPtr( obj
, MAGIC_DONTCARE
);
1099 if (!header
) return FALSE
;
1101 TRACE("%p\n", obj
);
1103 /* Unrealize object */
1105 if (header
->funcs
&& header
->funcs
->pUnrealizeObject
)
1106 result
= header
->funcs
->pUnrealizeObject( obj
, header
);
1108 GDI_ReleaseObj( obj
);
1113 /* Solid colors to enumerate */
1114 static const COLORREF solid_colors
[] =
1115 { RGB(0x00,0x00,0x00), RGB(0xff,0xff,0xff),
1116 RGB(0xff,0x00,0x00), RGB(0x00,0xff,0x00),
1117 RGB(0x00,0x00,0xff), RGB(0xff,0xff,0x00),
1118 RGB(0xff,0x00,0xff), RGB(0x00,0xff,0xff),
1119 RGB(0x80,0x00,0x00), RGB(0x00,0x80,0x00),
1120 RGB(0x80,0x80,0x00), RGB(0x00,0x00,0x80),
1121 RGB(0x80,0x00,0x80), RGB(0x00,0x80,0x80),
1122 RGB(0x80,0x80,0x80), RGB(0xc0,0xc0,0xc0)
1126 /***********************************************************************
1127 * EnumObjects (GDI32.@)
1129 INT WINAPI
EnumObjects( HDC hdc
, INT nObjType
,
1130 GOBJENUMPROC lpEnumFunc
, LPARAM lParam
)
1136 TRACE("%p %d %p %08lx\n", hdc
, nObjType
, lpEnumFunc
, lParam
);
1140 /* Enumerate solid pens */
1141 for (i
= 0; i
< sizeof(solid_colors
)/sizeof(solid_colors
[0]); i
++)
1143 pen
.lopnStyle
= PS_SOLID
;
1144 pen
.lopnWidth
.x
= 1;
1145 pen
.lopnWidth
.y
= 0;
1146 pen
.lopnColor
= solid_colors
[i
];
1147 retval
= lpEnumFunc( &pen
, lParam
);
1148 TRACE("solid pen %08lx, ret=%d\n",
1149 solid_colors
[i
], retval
);
1155 /* Enumerate solid brushes */
1156 for (i
= 0; i
< sizeof(solid_colors
)/sizeof(solid_colors
[0]); i
++)
1158 brush
.lbStyle
= BS_SOLID
;
1159 brush
.lbColor
= solid_colors
[i
];
1161 retval
= lpEnumFunc( &brush
, lParam
);
1162 TRACE("solid brush %08lx, ret=%d\n",
1163 solid_colors
[i
], retval
);
1167 /* Now enumerate hatched brushes */
1168 if (retval
) for (i
= HS_HORIZONTAL
; i
<= HS_DIAGCROSS
; i
++)
1170 brush
.lbStyle
= BS_HATCHED
;
1171 brush
.lbColor
= RGB(0,0,0);
1173 retval
= lpEnumFunc( &brush
, lParam
);
1174 TRACE("hatched brush %d, ret=%d\n",
1181 /* FIXME: implement Win32 types */
1182 WARN("(%d): Invalid type\n", nObjType
);
1189 /***********************************************************************
1190 * IsGDIObject (GDI.462)
1192 * returns type of object if valid (W95 system programming secrets p. 264-5)
1194 BOOL16 WINAPI
IsGDIObject16( HGDIOBJ16 handle16
)
1197 HGDIOBJ handle
= HGDIOBJ_32( handle16
);
1199 GDIOBJHDR
*object
= GDI_GetObjPtr( handle
, MAGIC_DONTCARE
);
1202 magic
= GDIMAGIC(object
->wMagic
) - PEN_MAGIC
+ 1;
1203 GDI_ReleaseObj( handle
);
1209 /***********************************************************************
1210 * SetObjectOwner (GDI32.@)
1212 void WINAPI
SetObjectOwner( HGDIOBJ handle
, HANDLE owner
)
1218 /***********************************************************************
1219 * MakeObjectPrivate (GDI.463)
1221 * What does that mean ?
1222 * Some little docu can be found in "Undocumented Windows",
1223 * but this is basically useless.
1224 * At least we know that this flags the GDI object's wMagic
1225 * with 0x2000 (OBJECT_PRIVATE), so we just do it.
1226 * But Wine doesn't react on that yet.
1228 void WINAPI
MakeObjectPrivate16( HGDIOBJ16 handle16
, BOOL16
private )
1230 HGDIOBJ handle
= HGDIOBJ_32( handle16
);
1231 GDIOBJHDR
*ptr
= GDI_GetObjPtr( handle
, MAGIC_DONTCARE
);
1234 ERR("invalid GDI object %p !\n", handle
);
1237 ptr
->wMagic
|= OBJECT_PRIVATE
;
1238 GDI_ReleaseObj( handle
);
1242 /***********************************************************************
1243 * GdiFlush (GDI32.@)
1245 BOOL WINAPI
GdiFlush(void)
1247 return TRUE
; /* FIXME */
1251 /***********************************************************************
1252 * GdiGetBatchLimit (GDI32.@)
1254 DWORD WINAPI
GdiGetBatchLimit(void)
1256 return 1; /* FIXME */
1260 /***********************************************************************
1261 * GdiSetBatchLimit (GDI32.@)
1263 DWORD WINAPI
GdiSetBatchLimit( DWORD limit
)
1265 return 1; /* FIXME */
1269 /***********************************************************************
1270 * GdiSeeGdiDo (GDI.452)
1272 DWORD WINAPI
GdiSeeGdiDo16( WORD wReqType
, WORD wParam1
, WORD wParam2
,
1277 case 0x0001: /* LocalAlloc */
1278 return LOCAL_Alloc( GDI_HeapSel
, wParam1
, wParam3
);
1279 case 0x0002: /* LocalFree */
1280 return LOCAL_Free( GDI_HeapSel
, wParam1
);
1281 case 0x0003: /* LocalCompact */
1282 return LOCAL_Compact( GDI_HeapSel
, wParam3
, 0 );
1283 case 0x0103: /* LocalHeap */
1286 WARN("(wReqType=%04x): Unknown\n", wReqType
);
1291 /***********************************************************************
1292 * GdiSignalProc32 (GDI.610)
1294 WORD WINAPI
GdiSignalProc( UINT uCode
, DWORD dwThreadOrProcessID
,
1295 DWORD dwFlags
, HMODULE16 hModule
)
1300 /***********************************************************************
1301 * GdiInit2 (GDI.403)
1303 * See "Undocumented Windows"
1305 HANDLE16 WINAPI
GdiInit216(
1306 HANDLE16 h1
, /* [in] GDI object */
1307 HANDLE16 h2
/* [in] global data */
1310 FIXME("(%04x, %04x), stub.\n", h1
, h2
);
1312 return 0xffff; /* undefined return value */
1313 return h1
; /* FIXME: should be the memory handle of h1 */
1316 /***********************************************************************
1317 * FinalGdiInit (GDI.405)
1319 void WINAPI
FinalGdiInit16( HBRUSH16 hPattern
/* [in] fill pattern of desktop */ )
1323 /***********************************************************************
1324 * GdiFreeResources (GDI.609)
1326 WORD WINAPI
GdiFreeResources16( DWORD reserve
)
1328 return (WORD
)( (int)LOCAL_CountFree( GDI_HeapSel
) * 100 /
1329 (int)LOCAL_HeapSize( GDI_HeapSel
) );
1333 /*******************************************************************
1334 * GetColorAdjustment [GDI32.@]
1338 BOOL WINAPI
GetColorAdjustment(HDC hdc
, LPCOLORADJUSTMENT lpca
)
1340 FIXME("GetColorAdjustment, stub\n");
1344 /*******************************************************************
1345 * GetMiterLimit [GDI32.@]
1349 BOOL WINAPI
GetMiterLimit(HDC hdc
, PFLOAT peLimit
)
1351 FIXME("GetMiterLimit, stub\n");
1355 /*******************************************************************
1356 * SetMiterLimit [GDI32.@]
1360 BOOL WINAPI
SetMiterLimit(HDC hdc
, FLOAT eNewLimit
, PFLOAT peOldLimit
)
1362 FIXME("SetMiterLimit, stub\n");
1366 /*******************************************************************
1367 * GdiComment [GDI32.@]
1371 BOOL WINAPI
GdiComment(HDC hdc
, UINT cbSize
, const BYTE
*lpData
)
1373 DC
*dc
= DC_GetDCPtr(hdc
);
1377 if (dc
->funcs
->pGdiComment
)
1378 ret
= dc
->funcs
->pGdiComment( dc
->physDev
, cbSize
, lpData
);
1380 GDI_ReleaseObj( hdc
);
1384 /*******************************************************************
1385 * SetColorAdjustment [GDI32.@]
1389 BOOL WINAPI
SetColorAdjustment(HDC hdc
, const COLORADJUSTMENT
* lpca
)
1391 FIXME("SetColorAdjustment, stub\n");