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
;
70 static CRITICAL_SECTION_DEBUG critsect_debug
=
72 0, 0, &GDI_level
.crst
,
73 { &critsect_debug
.ProcessLocksList
, &critsect_debug
.ProcessLocksList
},
74 0, 0, { 0, (DWORD
)(__FILE__
": GDI_level") }
76 static SYSLEVEL GDI_level
= { { &critsect_debug
, -1, 0, 0, 0, 0 }, 3 };
78 static WORD GDI_HeapSel
;
80 inline static BOOL
get_bool(char *buffer
)
82 return (buffer
[0] == 'y' || buffer
[0] == 'Y' ||
83 buffer
[0] == 't' || buffer
[0] == 'T' ||
88 /****************************************************************************
90 * language-independent stock fonts
94 static const LOGFONTW OEMFixedFont
=
95 { 12, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, OEM_CHARSET
,
96 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
, {'\0'} };
98 static const LOGFONTW AnsiFixedFont
=
99 { 12, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, ANSI_CHARSET
,
100 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
, {'\0'} };
102 static const LOGFONTW AnsiVarFont
=
103 { 12, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, ANSI_CHARSET
,
104 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
105 {'M','S',' ','S','a','n','s',' ','S','e','r','i','f','\0'} };
107 /******************************************************************************
109 * language-dependent stock fonts
111 * 'ANSI' charset and 'DEFAULT' charset is not same.
112 * The chars in CP_ACP should be drawn with 'DEFAULT' charset.
113 * 'ANSI' charset seems to be identical with ISO-8859-1.
114 * 'DEFAULT' charset is a language-dependent charset.
116 * 'System' font seems to be an alias for language-dependent font.
120 * language-dependenet stock fonts for all known charsets
121 * please see TranslateCharsetInfo (objects/font.c) and
122 * CharsetBindingInfo (graphics/x11drv/xfont.c),
123 * and modify entries for your language if needed.
125 struct DefaultFontInfo
129 LOGFONTW DeviceDefaultFont
;
130 LOGFONTW SystemFixedFont
;
131 LOGFONTW DefaultGuiFont
;
134 static const struct DefaultFontInfo default_fonts
[] =
138 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, ANSI_CHARSET
,
139 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
140 {'S','y','s','t','e','m','\0'}
142 { /* Device Default */
143 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, ANSI_CHARSET
,
144 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
148 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, ANSI_CHARSET
,
149 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
152 { /* DefaultGuiFont */
153 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, ANSI_CHARSET
,
154 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
155 {'M','S',' ','S','a','n','s',' ','S','e','r','i','f','\0'}
158 { EASTEUROPE_CHARSET
,
160 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, EASTEUROPE_CHARSET
,
161 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
162 {'S','y','s','t','e','m','\0'}
164 { /* Device Default */
165 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, EASTEUROPE_CHARSET
,
166 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
170 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, EASTEUROPE_CHARSET
,
171 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
174 { /* DefaultGuiFont */
175 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, EASTEUROPE_CHARSET
,
176 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
177 {'M','S',' ','S','a','n','s',' ','S','e','r','i','f','\0'}
182 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, RUSSIAN_CHARSET
,
183 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
184 {'S','y','s','t','e','m','\0'}
186 { /* Device Default */
187 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, RUSSIAN_CHARSET
,
188 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
192 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, RUSSIAN_CHARSET
,
193 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
196 { /* DefaultGuiFont */
197 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, RUSSIAN_CHARSET
,
198 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
199 {'M','S',' ','S','a','n','s',' ','S','e','r','i','f','\0'}
204 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, GREEK_CHARSET
,
205 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
206 {'S','y','s','t','e','m','\0'}
208 { /* Device Default */
209 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, GREEK_CHARSET
,
210 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
214 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, GREEK_CHARSET
,
215 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
218 { /* DefaultGuiFont */
219 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, GREEK_CHARSET
,
220 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
221 {'M','S',' ','S','a','n','s',' ','S','e','r','i','f','\0'}
226 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, TURKISH_CHARSET
,
227 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
228 {'S','y','s','t','e','m','\0'}
230 { /* Device Default */
231 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, TURKISH_CHARSET
,
232 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
236 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, TURKISH_CHARSET
,
237 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
240 { /* DefaultGuiFont */
241 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, TURKISH_CHARSET
,
242 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
243 {'M','S',' ','S','a','n','s',' ','S','e','r','i','f','\0'}
248 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, HEBREW_CHARSET
,
249 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
250 {'S','y','s','t','e','m','\0'}
252 { /* Device Default */
253 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, HEBREW_CHARSET
,
254 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
258 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, HEBREW_CHARSET
,
259 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
262 { /* DefaultGuiFont */
263 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, HEBREW_CHARSET
,
264 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
265 {'M','S',' ','S','a','n','s',' ','S','e','r','i','f','\0'}
270 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, ARABIC_CHARSET
,
271 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
272 {'S','y','s','t','e','m','\0'}
274 { /* Device Default */
275 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, ARABIC_CHARSET
,
276 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
280 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, ARABIC_CHARSET
,
281 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
284 { /* DefaultGuiFont */
285 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, ARABIC_CHARSET
,
286 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
287 {'M','S',' ','S','a','n','s',' ','S','e','r','i','f','\0'}
292 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, BALTIC_CHARSET
,
293 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
294 {'S','y','s','t','e','m','\0'}
296 { /* Device Default */
297 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, BALTIC_CHARSET
,
298 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
302 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, BALTIC_CHARSET
,
303 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
306 { /* DefaultGuiFont */
307 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, BALTIC_CHARSET
,
308 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
309 {'M','S',' ','S','a','n','s',' ','S','e','r','i','f','\0'}
314 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, THAI_CHARSET
,
315 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
316 {'S','y','s','t','e','m','\0'}
318 { /* Device Default */
319 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, THAI_CHARSET
,
320 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
324 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, THAI_CHARSET
,
325 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
328 { /* DefaultGuiFont */
329 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, THAI_CHARSET
,
330 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
331 {'M','S',' ','S','a','n','s',' ','S','e','r','i','f','\0'}
336 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, SHIFTJIS_CHARSET
,
337 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
338 {'S','y','s','t','e','m','\0'}
340 { /* Device Default */
341 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, SHIFTJIS_CHARSET
,
342 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
346 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, SHIFTJIS_CHARSET
,
347 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
350 { /* DefaultGuiFont */
351 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, SHIFTJIS_CHARSET
,
352 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
353 {'M','S',' ','P',' ','g','o','t','h','i','c','\0'} /* FIXME: Is this correct? */
358 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, GB2312_CHARSET
,
359 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
360 {'S','y','s','t','e','m','\0'}
362 { /* Device Default */
363 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, GB2312_CHARSET
,
364 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
368 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, GB2312_CHARSET
,
369 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
372 { /* DefaultGuiFont */
373 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, GB2312_CHARSET
,
374 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
375 {'M','S',' ','S','o','n','g','\0'} /* FIXME: Is this correct? */
380 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, HANGEUL_CHARSET
,
381 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
382 {'S','y','s','t','e','m','\0'}
384 { /* Device Default */
385 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, HANGEUL_CHARSET
,
386 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
390 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, HANGEUL_CHARSET
,
391 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
394 { /* DefaultGuiFont */
395 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, HANGEUL_CHARSET
,
396 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
397 {'G','u','l','i','m'},
400 { CHINESEBIG5_CHARSET
,
402 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, CHINESEBIG5_CHARSET
,
403 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
404 {'S','y','s','t','e','m','\0'}
406 { /* Device Default */
407 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, CHINESEBIG5_CHARSET
,
408 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
412 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, CHINESEBIG5_CHARSET
,
413 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
416 { /* DefaultGuiFont */
417 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, CHINESEBIG5_CHARSET
,
418 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
419 {'\0'} /* FIXME - what is the native font??? */
424 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, JOHAB_CHARSET
,
425 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
426 {'S','y','s','t','e','m','\0'}
428 { /* Device Default */
429 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, JOHAB_CHARSET
,
430 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
434 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, JOHAB_CHARSET
,
435 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
438 { /* DefaultGuiFont */
439 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, JOHAB_CHARSET
,
440 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
441 {'M','S',' ','M','i','n','g','l','i','u','\0'} /* FIXME: Is this correct? */
447 /******************************************************************************
450 static const struct DefaultFontInfo
* get_default_fonts(UINT charset
)
454 for(n
=0;n
<(sizeof(default_fonts
)/sizeof(default_fonts
[0]));n
++)
456 if ( default_fonts
[n
].charset
== charset
)
457 return &default_fonts
[n
];
460 FIXME( "unhandled charset 0x%08x - use ANSI_CHARSET for default stock objects\n", charset
);
461 return &default_fonts
[0];
465 /******************************************************************************
466 * get_default_charset (internal)
468 * get the language-dependent charset that can handle CP_ACP correctly.
470 static UINT
get_default_charset( void )
476 csi
.ciCharset
= ANSI_CHARSET
;
477 if ( ! TranslateCharsetInfo( (LPDWORD
)uACP
, &csi
, TCI_SRCCODEPAGE
) )
479 FIXME( "unhandled codepage %u - use ANSI_CHARSET for default stock objects\n", uACP
);
483 return csi
.ciCharset
;
487 /******************************************************************************
490 static HFONT
create_stock_font( char const *fontName
, const LOGFONTW
*font
, HKEY hkey
)
494 char buffer
[MAX_PATH
];
497 if (!hkey
) return CreateFontIndirectW( font
);
500 sprintf(key
, "%s.Height", fontName
);
501 count
= sizeof(buffer
);
502 if(!RegQueryValueExA(hkey
, key
, 0, &type
, buffer
, &count
))
503 lf
.lfHeight
= atoi(buffer
);
505 sprintf(key
, "%s.Bold", fontName
);
506 count
= sizeof(buffer
);
507 if(!RegQueryValueExA(hkey
, key
, 0, &type
, buffer
, &count
))
508 lf
.lfWeight
= get_bool(buffer
) ? FW_BOLD
: FW_NORMAL
;
510 sprintf(key
, "%s.Italic", fontName
);
511 count
= sizeof(buffer
);
512 if(!RegQueryValueExA(hkey
, key
, 0, &type
, buffer
, &count
))
513 lf
.lfItalic
= get_bool(buffer
);
515 sprintf(key
, "%s.Underline", fontName
);
516 count
= sizeof(buffer
);
517 if(!RegQueryValueExA(hkey
, key
, 0, &type
, buffer
, &count
))
518 lf
.lfUnderline
= get_bool(buffer
);
520 sprintf(key
, "%s.StrikeOut", fontName
);
521 count
= sizeof(buffer
);
522 if(!RegQueryValueExA(hkey
, key
, 0, &type
, buffer
, &count
))
523 lf
.lfStrikeOut
= get_bool(buffer
);
524 return CreateFontIndirectW( &lf
);
528 #define TRACE_SEC(handle,text) \
529 TRACE("(%p): " text " %ld\n", (handle), GDI_level.crst.RecursionCount)
532 /***********************************************************************
535 * Increment the reference count of a GDI object.
537 inline static void inc_ref_count( HGDIOBJ handle
)
541 if ((header
= GDI_GetObjPtr( handle
, MAGIC_DONTCARE
)))
544 GDI_ReleaseObj( handle
);
549 /***********************************************************************
552 * Decrement the reference count of a GDI object.
554 inline static void dec_ref_count( HGDIOBJ handle
)
558 if ((header
= GDI_GetObjPtr( handle
, MAGIC_DONTCARE
)))
560 if (header
->dwCount
) header
->dwCount
--;
561 if (header
->dwCount
!= 0x80000000) GDI_ReleaseObj( handle
);
564 /* handle delayed DeleteObject*/
566 GDI_ReleaseObj( handle
);
567 TRACE( "executing delayed DeleteObject for %p\n", handle
);
568 DeleteObject( handle
);
574 /***********************************************************************
577 * GDI initialization.
581 HINSTANCE16 instance
;
584 const struct DefaultFontInfo
* deffonts
;
587 if (RegOpenKeyA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\Wine\\Config\\Tweak.Fonts", &hkey
))
590 /* create GDI heap */
591 if ((instance
= LoadLibrary16( "GDI.EXE" )) >= 32) GDI_HeapSel
= instance
| 7;
593 /* create stock objects */
594 stock_objects
[WHITE_BRUSH
] = CreateBrushIndirect( &WhiteBrush
);
595 stock_objects
[LTGRAY_BRUSH
] = CreateBrushIndirect( &LtGrayBrush
);
596 stock_objects
[GRAY_BRUSH
] = CreateBrushIndirect( &GrayBrush
);
597 stock_objects
[DKGRAY_BRUSH
] = CreateBrushIndirect( &DkGrayBrush
);
598 stock_objects
[BLACK_BRUSH
] = CreateBrushIndirect( &BlackBrush
);
599 stock_objects
[NULL_BRUSH
] = CreateBrushIndirect( &NullBrush
);
601 stock_objects
[WHITE_PEN
] = CreatePenIndirect( &WhitePen
);
602 stock_objects
[BLACK_PEN
] = CreatePenIndirect( &BlackPen
);
603 stock_objects
[NULL_PEN
] = CreatePenIndirect( &NullPen
);
605 stock_objects
[DEFAULT_PALETTE
] = PALETTE_Init();
606 stock_objects
[DEFAULT_BITMAP
] = CreateBitmap( 1, 1, 1, 1, NULL
);
608 /* language-independent stock fonts */
609 stock_objects
[OEM_FIXED_FONT
] = create_stock_font( "OEMFixed", &OEMFixedFont
, hkey
);
610 stock_objects
[ANSI_FIXED_FONT
] = create_stock_font( "AnsiFixed", &AnsiFixedFont
, hkey
);
611 stock_objects
[ANSI_VAR_FONT
] = create_stock_font( "AnsiVar", &AnsiVarFont
, hkey
);
613 /* language-dependent stock fonts */
614 deffonts
= get_default_fonts(get_default_charset());
615 stock_objects
[SYSTEM_FONT
] = create_stock_font( "System", &deffonts
->SystemFont
, hkey
);
616 stock_objects
[DEVICE_DEFAULT_FONT
] = create_stock_font( "DeviceDefault", &deffonts
->DeviceDefaultFont
, hkey
);
617 stock_objects
[SYSTEM_FIXED_FONT
] = create_stock_font( "SystemFixed", &deffonts
->SystemFixedFont
, hkey
);
618 stock_objects
[DEFAULT_GUI_FONT
] = create_stock_font( "DefaultGui", &deffonts
->DefaultGuiFont
, hkey
);
621 /* clear the NOSYSTEM bit on all stock objects*/
622 for (i
= 0; i
< NB_STOCK_OBJECTS
; i
++)
624 if (!stock_objects
[i
])
626 if (i
== 9) continue; /* there's no stock object 9 */
627 ERR( "could not create stock object %d\n", i
);
630 ptr
= GDI_GetObjPtr( stock_objects
[i
], MAGIC_DONTCARE
);
631 ptr
->wMagic
&= ~OBJECT_NOSYSTEM
;
632 GDI_ReleaseObj( stock_objects
[i
] );
635 if (hkey
) RegCloseKey( hkey
);
642 #define FIRST_LARGE_HANDLE 16
643 #define MAX_LARGE_HANDLES ((GDI_HEAP_SIZE >> 2) - FIRST_LARGE_HANDLE)
644 static GDIOBJHDR
*large_handles
[MAX_LARGE_HANDLES
];
645 static int next_large_handle
;
647 /***********************************************************************
650 * Allocate a GDI handle from the large heap. Helper for GDI_AllocObject
652 inline static GDIOBJHDR
*alloc_large_heap( WORD size
, HGDIOBJ
*handle
)
657 for (i
= next_large_handle
+ 1; i
< MAX_LARGE_HANDLES
; i
++)
658 if (!large_handles
[i
]) goto found
;
659 for (i
= 0; i
<= next_large_handle
; i
++)
660 if (!large_handles
[i
]) goto found
;
665 if ((obj
= HeapAlloc( GetProcessHeap(), 0, size
)))
667 large_handles
[i
] = obj
;
668 *handle
= (HGDIOBJ
)(ULONG_PTR
)((i
+ FIRST_LARGE_HANDLE
) << 2);
669 next_large_handle
= i
;
675 /***********************************************************************
678 void *GDI_AllocObject( WORD size
, WORD magic
, HGDIOBJ
*handle
, const struct gdi_obj_funcs
*funcs
)
683 _EnterSysLevel( &GDI_level
);
689 if (!(hlocal
= LOCAL_Alloc( GDI_HeapSel
, LMEM_MOVEABLE
, size
))) goto error
;
690 assert( hlocal
& 2 );
691 obj
= (GDIOBJHDR
*)LOCAL_Lock( GDI_HeapSel
, hlocal
);
692 *handle
= (HGDIOBJ
)(ULONG_PTR
)hlocal
;
697 case DISABLED_DC_MAGIC
:
700 case METAFILE_DC_MAGIC
:
701 case ENHMETAFILE_MAGIC
:
702 case ENHMETAFILE_DC_MAGIC
:
703 case MEMORY_DC_MAGIC
:
706 if (!(obj
= alloc_large_heap( size
, handle
))) goto error
;
711 obj
->wMagic
= magic
|OBJECT_NOSYSTEM
;
715 TRACE_SEC( *handle
, "enter" );
719 _LeaveSysLevel( &GDI_level
);
725 /***********************************************************************
728 * The object ptr must have been obtained with GDI_GetObjPtr.
729 * The new pointer must be released with GDI_ReleaseObj.
731 void *GDI_ReallocObject( WORD size
, HGDIOBJ handle
, void *object
)
735 if ((UINT_PTR
)handle
& 2) /* GDI heap handle */
737 HLOCAL16 h
= LOWORD(handle
);
738 LOCAL_Unlock( GDI_HeapSel
, h
);
739 if ((new_handle
= (HGDIOBJ
)(ULONG_PTR
)LOCAL_ReAlloc( GDI_HeapSel
, h
, size
, LMEM_MOVEABLE
)))
741 assert( new_handle
== handle
); /* moveable handle cannot change */
742 return LOCAL_Lock( GDI_HeapSel
, h
);
747 int i
= ((ULONG_PTR
)handle
>> 2) - FIRST_LARGE_HANDLE
;
748 if (i
>= 0 && i
< MAX_LARGE_HANDLES
&& large_handles
[i
])
750 void *new_ptr
= HeapReAlloc( GetProcessHeap(), 0, large_handles
[i
], size
);
753 large_handles
[i
] = new_ptr
;
757 else ERR( "Invalid handle %p\n", handle
);
759 TRACE_SEC( handle
, "leave" );
760 _LeaveSysLevel( &GDI_level
);
765 /***********************************************************************
768 BOOL
GDI_FreeObject( HGDIOBJ handle
, void *ptr
)
770 GDIOBJHDR
*object
= ptr
;
772 object
->wMagic
= 0; /* Mark it as invalid */
773 object
->funcs
= NULL
;
774 if ((UINT_PTR
)handle
& 2) /* GDI heap handle */
776 HLOCAL16 h
= LOWORD(handle
);
777 LOCAL_Unlock( GDI_HeapSel
, h
);
778 LOCAL_Free( GDI_HeapSel
, h
);
780 else /* large heap handle */
782 int i
= ((ULONG_PTR
)handle
>> 2) - FIRST_LARGE_HANDLE
;
783 if (i
>= 0 && i
< MAX_LARGE_HANDLES
&& large_handles
[i
])
785 HeapFree( GetProcessHeap(), 0, large_handles
[i
] );
786 large_handles
[i
] = NULL
;
788 else ERR( "Invalid handle %p\n", handle
);
790 TRACE_SEC( handle
, "leave" );
791 _LeaveSysLevel( &GDI_level
);
796 /***********************************************************************
799 * Return a pointer to the GDI object associated to the handle.
800 * Return NULL if the object has the wrong magic number.
801 * The object must be released with GDI_ReleaseObj.
803 void *GDI_GetObjPtr( HGDIOBJ handle
, WORD magic
)
805 GDIOBJHDR
*ptr
= NULL
;
807 _EnterSysLevel( &GDI_level
);
809 if ((UINT_PTR
)handle
& 2) /* GDI heap handle */
811 HLOCAL16 h
= LOWORD(handle
);
812 ptr
= (GDIOBJHDR
*)LOCAL_Lock( GDI_HeapSel
, h
);
815 if (((magic
!= MAGIC_DONTCARE
) && (GDIMAGIC(ptr
->wMagic
) != magic
)) ||
816 (GDIMAGIC(ptr
->wMagic
) < FIRST_MAGIC
) ||
817 (GDIMAGIC(ptr
->wMagic
) > LAST_MAGIC
))
819 LOCAL_Unlock( GDI_HeapSel
, h
);
824 else /* large heap handle */
826 int i
= ((UINT_PTR
)handle
>> 2) - FIRST_LARGE_HANDLE
;
827 if (i
>= 0 && i
< MAX_LARGE_HANDLES
)
829 ptr
= large_handles
[i
];
830 if (ptr
&& (magic
!= MAGIC_DONTCARE
) && (GDIMAGIC(ptr
->wMagic
) != magic
)) ptr
= NULL
;
836 _LeaveSysLevel( &GDI_level
);
837 SetLastError( ERROR_INVALID_HANDLE
);
838 WARN( "Invalid handle %p\n", handle
);
840 else TRACE_SEC( handle
, "enter" );
846 /***********************************************************************
850 void GDI_ReleaseObj( HGDIOBJ handle
)
852 if ((UINT_PTR
)handle
& 2) LOCAL_Unlock( GDI_HeapSel
, LOWORD(handle
) );
853 TRACE_SEC( handle
, "leave" );
854 _LeaveSysLevel( &GDI_level
);
858 /***********************************************************************
861 void GDI_CheckNotLock(void)
863 _CheckNotSysLevel( &GDI_level
);
867 /***********************************************************************
868 * DeleteObject (GDI32.@)
870 BOOL WINAPI
DeleteObject( HGDIOBJ obj
)
872 /* Check if object is valid */
875 if (HIWORD(obj
)) return FALSE
;
877 if (!(header
= GDI_GetObjPtr( obj
, MAGIC_DONTCARE
))) return FALSE
;
879 if (!(header
->wMagic
& OBJECT_NOSYSTEM
)
880 && (header
->wMagic
>= FIRST_MAGIC
) && (header
->wMagic
<= LAST_MAGIC
))
882 TRACE("Preserving system object %p\n", obj
);
883 GDI_ReleaseObj( obj
);
889 TRACE("delayed for %p because object in use, count %ld\n", obj
, header
->dwCount
);
890 header
->dwCount
|= 0x80000000; /* mark for delete */
891 GDI_ReleaseObj( obj
);
899 if (header
->funcs
&& header
->funcs
->pDeleteObject
)
900 return header
->funcs
->pDeleteObject( obj
, header
);
902 GDI_ReleaseObj( obj
);
907 /***********************************************************************
908 * GetStockObject (GDI32.@)
910 HGDIOBJ WINAPI
GetStockObject( INT obj
)
913 if ((obj
< 0) || (obj
>= NB_STOCK_OBJECTS
)) return 0;
914 ret
= stock_objects
[obj
];
915 TRACE("returning %p\n", ret
);
920 /***********************************************************************
923 INT16 WINAPI
GetObject16( HANDLE16 handle16
, INT16 count
, LPVOID buffer
)
926 HGDIOBJ handle
= HGDIOBJ_32( handle16
);
929 TRACE("%p %d %p\n", handle
, count
, buffer
);
930 if (!count
) return 0;
932 if (!(ptr
= GDI_GetObjPtr( handle
, MAGIC_DONTCARE
))) return 0;
934 if (ptr
->funcs
&& ptr
->funcs
->pGetObject16
)
935 result
= ptr
->funcs
->pGetObject16( handle
, ptr
, count
, buffer
);
937 SetLastError( ERROR_INVALID_HANDLE
);
939 GDI_ReleaseObj( handle
);
944 /***********************************************************************
945 * GetObjectA (GDI32.@)
947 INT WINAPI
GetObjectA( HANDLE handle
, INT count
, LPVOID buffer
)
951 TRACE("%p %d %p\n", handle
, count
, buffer
);
953 if (!(ptr
= GDI_GetObjPtr( handle
, MAGIC_DONTCARE
))) return 0;
955 if (ptr
->funcs
&& ptr
->funcs
->pGetObjectA
)
956 result
= ptr
->funcs
->pGetObjectA( handle
, ptr
, count
, buffer
);
958 SetLastError( ERROR_INVALID_HANDLE
);
960 GDI_ReleaseObj( handle
);
964 /***********************************************************************
965 * GetObjectW (GDI32.@)
967 INT WINAPI
GetObjectW( HANDLE handle
, INT count
, LPVOID buffer
)
971 TRACE("%p %d %p\n", handle
, count
, buffer
);
973 if (!(ptr
= GDI_GetObjPtr( handle
, MAGIC_DONTCARE
))) return 0;
975 if (ptr
->funcs
&& ptr
->funcs
->pGetObjectW
)
976 result
= ptr
->funcs
->pGetObjectW( handle
, ptr
, count
, buffer
);
978 SetLastError( ERROR_INVALID_HANDLE
);
980 GDI_ReleaseObj( handle
);
984 /***********************************************************************
985 * GetObjectType (GDI32.@)
987 DWORD WINAPI
GetObjectType( HANDLE handle
)
991 TRACE("%p\n", handle
);
993 if (!(ptr
= GDI_GetObjPtr( handle
, MAGIC_DONTCARE
))) return 0;
995 switch(GDIMAGIC(ptr
->wMagic
))
1004 result
= OBJ_BITMAP
;
1013 result
= OBJ_REGION
;
1019 result
= OBJ_METADC
;
1021 case METAFILE_MAGIC
:
1022 result
= OBJ_METAFILE
;
1024 case METAFILE_DC_MAGIC
:
1025 result
= OBJ_METADC
;
1027 case ENHMETAFILE_MAGIC
:
1028 result
= OBJ_ENHMETAFILE
;
1030 case ENHMETAFILE_DC_MAGIC
:
1031 result
= OBJ_ENHMETADC
;
1033 case MEMORY_DC_MAGIC
:
1037 FIXME("Magic %04x not implemented\n", GDIMAGIC(ptr
->wMagic
) );
1040 GDI_ReleaseObj( handle
);
1044 /***********************************************************************
1045 * GetCurrentObject (GDI32.@)
1047 HANDLE WINAPI
GetCurrentObject(HDC hdc
,UINT type
)
1050 DC
* dc
= DC_GetDCPtr( hdc
);
1055 case OBJ_PEN
: ret
= dc
->hPen
; break;
1056 case OBJ_BRUSH
: ret
= dc
->hBrush
; break;
1057 case OBJ_PAL
: ret
= dc
->hPalette
; break;
1058 case OBJ_FONT
: ret
= dc
->hFont
; break;
1059 case OBJ_BITMAP
: ret
= dc
->hBitmap
; break;
1061 /* the SDK only mentions those above */
1062 FIXME("(%p,%d): unknown type.\n",hdc
,type
);
1065 GDI_ReleaseObj( hdc
);
1071 /***********************************************************************
1072 * SelectObject (GDI32.@)
1074 HGDIOBJ WINAPI
SelectObject( HDC hdc
, HGDIOBJ handle
)
1077 GDIOBJHDR
*header
= GDI_GetObjPtr( handle
, MAGIC_DONTCARE
);
1078 if (!header
) return 0;
1080 TRACE("hdc=%p %p\n", hdc
, handle
);
1082 if (header
->funcs
&& header
->funcs
->pSelectObject
)
1084 ret
= header
->funcs
->pSelectObject( handle
, header
, hdc
);
1085 if (ret
&& ret
!= handle
&& (INT
)ret
> COMPLEXREGION
)
1087 inc_ref_count( handle
);
1088 dec_ref_count( ret
);
1091 GDI_ReleaseObj( handle
);
1096 /***********************************************************************
1097 * UnrealizeObject (GDI32.@)
1099 BOOL WINAPI
UnrealizeObject( HGDIOBJ obj
)
1102 /* Check if object is valid */
1104 GDIOBJHDR
* header
= GDI_GetObjPtr( obj
, MAGIC_DONTCARE
);
1105 if (!header
) return FALSE
;
1107 TRACE("%p\n", obj
);
1109 /* Unrealize object */
1111 if (header
->funcs
&& header
->funcs
->pUnrealizeObject
)
1112 result
= header
->funcs
->pUnrealizeObject( obj
, header
);
1114 GDI_ReleaseObj( obj
);
1119 /* Solid colors to enumerate */
1120 static const COLORREF solid_colors
[] =
1121 { RGB(0x00,0x00,0x00), RGB(0xff,0xff,0xff),
1122 RGB(0xff,0x00,0x00), RGB(0x00,0xff,0x00),
1123 RGB(0x00,0x00,0xff), RGB(0xff,0xff,0x00),
1124 RGB(0xff,0x00,0xff), RGB(0x00,0xff,0xff),
1125 RGB(0x80,0x00,0x00), RGB(0x00,0x80,0x00),
1126 RGB(0x80,0x80,0x00), RGB(0x00,0x00,0x80),
1127 RGB(0x80,0x00,0x80), RGB(0x00,0x80,0x80),
1128 RGB(0x80,0x80,0x80), RGB(0xc0,0xc0,0xc0)
1132 /***********************************************************************
1133 * EnumObjects (GDI32.@)
1135 INT WINAPI
EnumObjects( HDC hdc
, INT nObjType
,
1136 GOBJENUMPROC lpEnumFunc
, LPARAM lParam
)
1142 TRACE("%p %d %p %08lx\n", hdc
, nObjType
, lpEnumFunc
, lParam
);
1146 /* Enumerate solid pens */
1147 for (i
= 0; i
< sizeof(solid_colors
)/sizeof(solid_colors
[0]); i
++)
1149 pen
.lopnStyle
= PS_SOLID
;
1150 pen
.lopnWidth
.x
= 1;
1151 pen
.lopnWidth
.y
= 0;
1152 pen
.lopnColor
= solid_colors
[i
];
1153 retval
= lpEnumFunc( &pen
, lParam
);
1154 TRACE("solid pen %08lx, ret=%d\n",
1155 solid_colors
[i
], retval
);
1161 /* Enumerate solid brushes */
1162 for (i
= 0; i
< sizeof(solid_colors
)/sizeof(solid_colors
[0]); i
++)
1164 brush
.lbStyle
= BS_SOLID
;
1165 brush
.lbColor
= solid_colors
[i
];
1167 retval
= lpEnumFunc( &brush
, lParam
);
1168 TRACE("solid brush %08lx, ret=%d\n",
1169 solid_colors
[i
], retval
);
1173 /* Now enumerate hatched brushes */
1174 if (retval
) for (i
= HS_HORIZONTAL
; i
<= HS_DIAGCROSS
; i
++)
1176 brush
.lbStyle
= BS_HATCHED
;
1177 brush
.lbColor
= RGB(0,0,0);
1179 retval
= lpEnumFunc( &brush
, lParam
);
1180 TRACE("hatched brush %d, ret=%d\n",
1187 /* FIXME: implement Win32 types */
1188 WARN("(%d): Invalid type\n", nObjType
);
1195 /***********************************************************************
1196 * IsGDIObject (GDI.462)
1198 * returns type of object if valid (W95 system programming secrets p. 264-5)
1200 BOOL16 WINAPI
IsGDIObject16( HGDIOBJ16 handle16
)
1203 HGDIOBJ handle
= HGDIOBJ_32( handle16
);
1205 GDIOBJHDR
*object
= GDI_GetObjPtr( handle
, MAGIC_DONTCARE
);
1208 magic
= GDIMAGIC(object
->wMagic
) - PEN_MAGIC
+ 1;
1209 GDI_ReleaseObj( handle
);
1215 /***********************************************************************
1216 * SetObjectOwner (GDI32.@)
1218 void WINAPI
SetObjectOwner( HGDIOBJ handle
, HANDLE owner
)
1224 /***********************************************************************
1225 * MakeObjectPrivate (GDI.463)
1227 * What does that mean ?
1228 * Some little docu can be found in "Undocumented Windows",
1229 * but this is basically useless.
1230 * At least we know that this flags the GDI object's wMagic
1231 * with 0x2000 (OBJECT_PRIVATE), so we just do it.
1232 * But Wine doesn't react on that yet.
1234 void WINAPI
MakeObjectPrivate16( HGDIOBJ16 handle16
, BOOL16
private )
1236 HGDIOBJ handle
= HGDIOBJ_32( handle16
);
1237 GDIOBJHDR
*ptr
= GDI_GetObjPtr( handle
, MAGIC_DONTCARE
);
1240 ERR("invalid GDI object %p !\n", handle
);
1243 ptr
->wMagic
|= OBJECT_PRIVATE
;
1244 GDI_ReleaseObj( handle
);
1248 /***********************************************************************
1249 * GdiFlush (GDI32.@)
1251 BOOL WINAPI
GdiFlush(void)
1253 return TRUE
; /* FIXME */
1257 /***********************************************************************
1258 * GdiGetBatchLimit (GDI32.@)
1260 DWORD WINAPI
GdiGetBatchLimit(void)
1262 return 1; /* FIXME */
1266 /***********************************************************************
1267 * GdiSetBatchLimit (GDI32.@)
1269 DWORD WINAPI
GdiSetBatchLimit( DWORD limit
)
1271 return 1; /* FIXME */
1275 /***********************************************************************
1276 * GdiSeeGdiDo (GDI.452)
1278 DWORD WINAPI
GdiSeeGdiDo16( WORD wReqType
, WORD wParam1
, WORD wParam2
,
1283 case 0x0001: /* LocalAlloc */
1284 return LOCAL_Alloc( GDI_HeapSel
, wParam1
, wParam3
);
1285 case 0x0002: /* LocalFree */
1286 return LOCAL_Free( GDI_HeapSel
, wParam1
);
1287 case 0x0003: /* LocalCompact */
1288 return LOCAL_Compact( GDI_HeapSel
, wParam3
, 0 );
1289 case 0x0103: /* LocalHeap */
1292 WARN("(wReqType=%04x): Unknown\n", wReqType
);
1297 /***********************************************************************
1298 * GdiSignalProc32 (GDI.610)
1300 WORD WINAPI
GdiSignalProc( UINT uCode
, DWORD dwThreadOrProcessID
,
1301 DWORD dwFlags
, HMODULE16 hModule
)
1306 /***********************************************************************
1307 * GdiInit2 (GDI.403)
1309 * See "Undocumented Windows"
1311 HANDLE16 WINAPI
GdiInit216(
1312 HANDLE16 h1
, /* [in] GDI object */
1313 HANDLE16 h2
/* [in] global data */
1316 FIXME("(%04x, %04x), stub.\n", h1
, h2
);
1318 return 0xffff; /* undefined return value */
1319 return h1
; /* FIXME: should be the memory handle of h1 */
1322 /***********************************************************************
1323 * FinalGdiInit (GDI.405)
1325 void WINAPI
FinalGdiInit16( HBRUSH16 hPattern
/* [in] fill pattern of desktop */ )
1329 /***********************************************************************
1330 * GdiFreeResources (GDI.609)
1332 WORD WINAPI
GdiFreeResources16( DWORD reserve
)
1334 return (WORD
)( (int)LOCAL_CountFree( GDI_HeapSel
) * 100 /
1335 (int)LOCAL_HeapSize( GDI_HeapSel
) );
1339 /*******************************************************************
1340 * GetColorAdjustment [GDI32.@]
1344 BOOL WINAPI
GetColorAdjustment(HDC hdc
, LPCOLORADJUSTMENT lpca
)
1346 FIXME("GetColorAdjustment, stub\n");
1350 /*******************************************************************
1351 * GetMiterLimit [GDI32.@]
1355 BOOL WINAPI
GetMiterLimit(HDC hdc
, PFLOAT peLimit
)
1357 FIXME("GetMiterLimit, stub\n");
1361 /*******************************************************************
1362 * SetMiterLimit [GDI32.@]
1366 BOOL WINAPI
SetMiterLimit(HDC hdc
, FLOAT eNewLimit
, PFLOAT peOldLimit
)
1368 FIXME("SetMiterLimit, stub\n");
1372 /*******************************************************************
1373 * GdiComment [GDI32.@]
1377 BOOL WINAPI
GdiComment(HDC hdc
, UINT cbSize
, const BYTE
*lpData
)
1379 DC
*dc
= DC_GetDCPtr(hdc
);
1383 if (dc
->funcs
->pGdiComment
)
1384 ret
= dc
->funcs
->pGdiComment( dc
->physDev
, cbSize
, lpData
);
1386 GDI_ReleaseObj( hdc
);
1390 /*******************************************************************
1391 * SetColorAdjustment [GDI32.@]
1395 BOOL WINAPI
SetColorAdjustment(HDC hdc
, const COLORADJUSTMENT
* lpca
)
1397 FIXME("SetColorAdjustment, stub\n");