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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
36 #include "gdi_private.h"
37 #include "wine/debug.h"
39 WINE_DEFAULT_DEBUG_CHANNEL(gdi
);
41 #define FIRST_GDI_HANDLE 16
42 #define MAX_GDI_HANDLES 16384
47 struct hdc_list
*next
;
50 struct gdi_handle_entry
52 void *obj
; /* pointer to the object-specific data */
53 const struct gdi_obj_funcs
*funcs
; /* type-specific functions */
54 struct hdc_list
*hdcs
; /* list of HDCs interested in this object */
55 WORD generation
; /* generation count for reusing handle values */
56 WORD type
; /* object type (one of the OBJ_* constants) */
57 WORD selcount
; /* number of times the object is selected in a DC */
58 WORD system
: 1; /* system object flag */
59 WORD deleted
: 1; /* whether DeleteObject has been called on this object */
62 static struct gdi_handle_entry gdi_handles
[MAX_GDI_HANDLES
];
63 static struct gdi_handle_entry
*next_free
;
64 static struct gdi_handle_entry
*next_unused
= gdi_handles
;
65 static LONG debug_count
;
66 HMODULE gdi32_module
= 0;
68 static inline HGDIOBJ
entry_to_handle( struct gdi_handle_entry
*entry
)
70 unsigned int idx
= entry
- gdi_handles
+ FIRST_GDI_HANDLE
;
71 return LongToHandle( idx
| (entry
->generation
<< 16) );
74 static inline struct gdi_handle_entry
*handle_entry( HGDIOBJ handle
)
76 unsigned int idx
= LOWORD(handle
) - FIRST_GDI_HANDLE
;
78 if (idx
< MAX_GDI_HANDLES
&& gdi_handles
[idx
].type
)
80 if (!HIWORD( handle
) || HIWORD( handle
) == gdi_handles
[idx
].generation
)
81 return &gdi_handles
[idx
];
83 if (handle
) WARN( "invalid handle %p\n", handle
);
87 /***********************************************************************
91 static const LOGBRUSH WhiteBrush
= { BS_SOLID
, RGB(255,255,255), 0 };
92 static const LOGBRUSH BlackBrush
= { BS_SOLID
, RGB(0,0,0), 0 };
93 static const LOGBRUSH NullBrush
= { BS_NULL
, 0, 0 };
95 static const LOGBRUSH LtGrayBrush
= { BS_SOLID
, RGB(192,192,192), 0 };
96 static const LOGBRUSH GrayBrush
= { BS_SOLID
, RGB(128,128,128), 0 };
97 static const LOGBRUSH DkGrayBrush
= { BS_SOLID
, RGB(64,64,64), 0 };
99 static const LOGPEN WhitePen
= { PS_SOLID
, { 0, 0 }, RGB(255,255,255) };
100 static const LOGPEN BlackPen
= { PS_SOLID
, { 0, 0 }, RGB(0,0,0) };
101 static const LOGPEN NullPen
= { PS_NULL
, { 0, 0 }, 0 };
103 static const LOGBRUSH DCBrush
= { BS_SOLID
, RGB(255,255,255), 0 };
104 static const LOGPEN DCPen
= { PS_SOLID
, { 0, 0 }, RGB(0,0,0) };
106 /* reserve one extra entry for the stock default bitmap */
107 /* this is what Windows does too */
108 #define NB_STOCK_OBJECTS (STOCK_LAST+2)
110 static HGDIOBJ stock_objects
[NB_STOCK_OBJECTS
];
112 static CRITICAL_SECTION gdi_section
;
113 static CRITICAL_SECTION_DEBUG critsect_debug
=
116 { &critsect_debug
.ProcessLocksList
, &critsect_debug
.ProcessLocksList
},
117 0, 0, { (DWORD_PTR
)(__FILE__
": gdi_section") }
119 static CRITICAL_SECTION gdi_section
= { &critsect_debug
, -1, 0, 0, 0, 0 };
122 /****************************************************************************
124 * language-independent stock fonts
128 static const LOGFONTW OEMFixedFont
=
129 { 12, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, OEM_CHARSET
,
130 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
, {'\0'} };
132 static const LOGFONTW AnsiFixedFont
=
133 { 12, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, ANSI_CHARSET
,
134 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
135 {'C','o','u','r','i','e','r','\0'} };
137 static const LOGFONTW AnsiVarFont
=
138 { 12, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, ANSI_CHARSET
,
139 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
140 {'M','S',' ','S','a','n','s',' ','S','e','r','i','f','\0'} };
142 /******************************************************************************
144 * language-dependent stock fonts
146 * 'ANSI' charset and 'DEFAULT' charset is not same.
147 * The chars in CP_ACP should be drawn with 'DEFAULT' charset.
148 * 'ANSI' charset seems to be identical with ISO-8859-1.
149 * 'DEFAULT' charset is a language-dependent charset.
151 * 'System' font seems to be an alias for language-dependent font.
155 * language-dependent stock fonts for all known charsets
156 * please see TranslateCharsetInfo (dlls/gdi/font.c) and
157 * CharsetBindingInfo (dlls/x11drv/xfont.c),
158 * and modify entries for your language if needed.
160 struct DefaultFontInfo
164 LOGFONTW DeviceDefaultFont
;
165 LOGFONTW SystemFixedFont
;
166 LOGFONTW DefaultGuiFont
;
169 static const struct DefaultFontInfo default_fonts
[] =
173 16, 7, 0, 0, FW_BOLD
, FALSE
, FALSE
, FALSE
, ANSI_CHARSET
,
174 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
175 {'S','y','s','t','e','m','\0'}
177 { /* Device Default */
178 16, 0, 0, 0, FW_BOLD
, FALSE
, FALSE
, FALSE
, ANSI_CHARSET
,
179 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
180 {'S','y','s','t','e','m','\0'}
183 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, ANSI_CHARSET
,
184 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
185 {'C','o','u','r','i','e','r','\0'}
187 { /* DefaultGuiFont */
188 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, ANSI_CHARSET
,
189 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
190 {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
193 { EASTEUROPE_CHARSET
,
195 16, 7, 0, 0, FW_BOLD
, FALSE
, FALSE
, FALSE
, EASTEUROPE_CHARSET
,
196 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
197 {'S','y','s','t','e','m','\0'}
199 { /* Device Default */
200 16, 0, 0, 0, FW_BOLD
, FALSE
, FALSE
, FALSE
, EASTEUROPE_CHARSET
,
201 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
202 {'S','y','s','t','e','m','\0'}
205 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, EASTEUROPE_CHARSET
,
206 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
207 {'C','o','u','r','i','e','r','\0'}
209 { /* DefaultGuiFont */
210 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, EASTEUROPE_CHARSET
,
211 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
212 {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
217 16, 7, 0, 0, FW_BOLD
, FALSE
, FALSE
, FALSE
, RUSSIAN_CHARSET
,
218 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
219 {'S','y','s','t','e','m','\0'}
221 { /* Device Default */
222 16, 0, 0, 0, FW_BOLD
, FALSE
, FALSE
, FALSE
, RUSSIAN_CHARSET
,
223 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
224 {'S','y','s','t','e','m','\0'}
227 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, RUSSIAN_CHARSET
,
228 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
229 {'C','o','u','r','i','e','r','\0'}
231 { /* DefaultGuiFont */
232 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, RUSSIAN_CHARSET
,
233 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
234 {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
239 16, 7, 0, 0, FW_BOLD
, FALSE
, FALSE
, FALSE
, GREEK_CHARSET
,
240 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
241 {'S','y','s','t','e','m','\0'}
243 { /* Device Default */
244 16, 0, 0, 0, FW_BOLD
, FALSE
, FALSE
, FALSE
, GREEK_CHARSET
,
245 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
246 {'S','y','s','t','e','m','\0'}
249 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, GREEK_CHARSET
,
250 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
251 {'C','o','u','r','i','e','r','\0'}
253 { /* DefaultGuiFont */
254 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, GREEK_CHARSET
,
255 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
256 {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
261 16, 7, 0, 0, FW_BOLD
, FALSE
, FALSE
, FALSE
, TURKISH_CHARSET
,
262 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
263 {'S','y','s','t','e','m','\0'}
265 { /* Device Default */
266 16, 0, 0, 0, FW_BOLD
, FALSE
, FALSE
, FALSE
, TURKISH_CHARSET
,
267 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
268 {'S','y','s','t','e','m','\0'}
271 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, TURKISH_CHARSET
,
272 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
273 {'C','o','u','r','i','e','r','\0'}
275 { /* DefaultGuiFont */
276 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, TURKISH_CHARSET
,
277 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
278 {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
283 16, 7, 0, 0, FW_BOLD
, FALSE
, FALSE
, FALSE
, HEBREW_CHARSET
,
284 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
285 {'S','y','s','t','e','m','\0'}
287 { /* Device Default */
288 16, 0, 0, 0, FW_BOLD
, FALSE
, FALSE
, FALSE
, HEBREW_CHARSET
,
289 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
290 {'S','y','s','t','e','m','\0'}
293 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, HEBREW_CHARSET
,
294 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
295 {'C','o','u','r','i','e','r','\0'}
297 { /* DefaultGuiFont */
298 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, HEBREW_CHARSET
,
299 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
300 {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
305 16, 7, 0, 0, FW_BOLD
, FALSE
, FALSE
, FALSE
, ARABIC_CHARSET
,
306 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
307 {'S','y','s','t','e','m','\0'}
309 { /* Device Default */
310 16, 0, 0, 0, FW_BOLD
, FALSE
, FALSE
, FALSE
, ARABIC_CHARSET
,
311 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
312 {'S','y','s','t','e','m','\0'}
315 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, ARABIC_CHARSET
,
316 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
317 {'C','o','u','r','i','e','r','\0'}
319 { /* DefaultGuiFont */
320 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, ARABIC_CHARSET
,
321 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
322 {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
327 16, 7, 0, 0, FW_BOLD
, FALSE
, FALSE
, FALSE
, BALTIC_CHARSET
,
328 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
329 {'S','y','s','t','e','m','\0'}
331 { /* Device Default */
332 16, 0, 0, 0, FW_BOLD
, FALSE
, FALSE
, FALSE
, BALTIC_CHARSET
,
333 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
334 {'S','y','s','t','e','m','\0'}
337 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, BALTIC_CHARSET
,
338 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
339 {'C','o','u','r','i','e','r','\0'}
341 { /* DefaultGuiFont */
342 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, BALTIC_CHARSET
,
343 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
344 {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
349 16, 7, 0, 0, FW_BOLD
, FALSE
, FALSE
, FALSE
, THAI_CHARSET
,
350 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
351 {'S','y','s','t','e','m','\0'}
353 { /* Device Default */
354 16, 0, 0, 0, FW_BOLD
, FALSE
, FALSE
, FALSE
, THAI_CHARSET
,
355 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
356 {'S','y','s','t','e','m','\0'}
359 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, THAI_CHARSET
,
360 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
361 {'C','o','u','r','i','e','r','\0'}
363 { /* DefaultGuiFont */
364 -11, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, THAI_CHARSET
,
365 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
366 {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
371 18, 8, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, SHIFTJIS_CHARSET
,
372 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
373 {'S','y','s','t','e','m','\0'}
375 { /* Device Default */
376 18, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, SHIFTJIS_CHARSET
,
377 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
378 {'S','y','s','t','e','m','\0'}
381 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, SHIFTJIS_CHARSET
,
382 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
383 {'C','o','u','r','i','e','r','\0'}
385 { /* DefaultGuiFont */
386 -12, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, SHIFTJIS_CHARSET
,
387 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
388 {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
393 16, 7, 0, 0, FW_BOLD
, FALSE
, FALSE
, FALSE
, GB2312_CHARSET
,
394 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
395 {'S','y','s','t','e','m','\0'}
397 { /* Device Default */
398 16, 0, 0, 0, FW_BOLD
, FALSE
, FALSE
, FALSE
, GB2312_CHARSET
,
399 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
400 {'S','y','s','t','e','m','\0'}
403 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, GB2312_CHARSET
,
404 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
405 {'C','o','u','r','i','e','r','\0'}
407 { /* DefaultGuiFont */
408 -12, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, GB2312_CHARSET
,
409 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
410 {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
415 16, 8, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, HANGEUL_CHARSET
,
416 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
417 {'S','y','s','t','e','m','\0'}
419 { /* Device Default */
420 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, HANGEUL_CHARSET
,
421 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
422 {'S','y','s','t','e','m','\0'}
425 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, HANGEUL_CHARSET
,
426 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
427 {'C','o','u','r','i','e','r','\0'}
429 { /* DefaultGuiFont */
430 -12, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, HANGEUL_CHARSET
,
431 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
432 {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
435 { CHINESEBIG5_CHARSET
,
437 16, 7, 0, 0, FW_BOLD
, FALSE
, FALSE
, FALSE
, CHINESEBIG5_CHARSET
,
438 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
439 {'S','y','s','t','e','m','\0'}
441 { /* Device Default */
442 16, 0, 0, 0, FW_BOLD
, FALSE
, FALSE
, FALSE
, CHINESEBIG5_CHARSET
,
443 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
444 {'S','y','s','t','e','m','\0'}
447 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, CHINESEBIG5_CHARSET
,
448 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
449 {'C','o','u','r','i','e','r','\0'}
451 { /* DefaultGuiFont */
452 -12, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, CHINESEBIG5_CHARSET
,
453 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
454 {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
459 16, 7, 0, 0, FW_BOLD
, FALSE
, FALSE
, FALSE
, JOHAB_CHARSET
,
460 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
461 {'S','y','s','t','e','m','\0'}
463 { /* Device Default */
464 16, 0, 0, 0, FW_BOLD
, FALSE
, FALSE
, FALSE
, JOHAB_CHARSET
,
465 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
466 {'S','y','s','t','e','m','\0'}
469 16, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, JOHAB_CHARSET
,
470 0, 0, DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
,
471 {'C','o','u','r','i','e','r','\0'}
473 { /* DefaultGuiFont */
474 -12, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, JOHAB_CHARSET
,
475 0, 0, DEFAULT_QUALITY
, VARIABLE_PITCH
| FF_SWISS
,
476 {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
482 /*************************************************************************
483 * __wine_make_gdi_object_system (GDI32.@)
485 * USER has to tell GDI that its system brushes and pens are non-deletable.
486 * For a description of the GDI object magics and their flags,
487 * see "Undocumented Windows" (wrong about the OBJECT_NOSYSTEM flag, though).
489 void CDECL
__wine_make_gdi_object_system( HGDIOBJ handle
, BOOL set
)
491 struct gdi_handle_entry
*entry
;
493 EnterCriticalSection( &gdi_section
);
494 if ((entry
= handle_entry( handle
))) entry
->system
= !!set
;
495 LeaveCriticalSection( &gdi_section
);
498 /******************************************************************************
501 static const struct DefaultFontInfo
* get_default_fonts(UINT charset
)
505 for(n
=0;n
<(sizeof(default_fonts
)/sizeof(default_fonts
[0]));n
++)
507 if ( default_fonts
[n
].charset
== charset
)
508 return &default_fonts
[n
];
511 FIXME( "unhandled charset 0x%08x - use ANSI_CHARSET for default stock objects\n", charset
);
512 return &default_fonts
[0];
516 /******************************************************************************
517 * get_default_charset (internal)
519 * get the language-dependent charset that can handle CP_ACP correctly.
521 static UINT
get_default_charset( void )
527 csi
.ciCharset
= ANSI_CHARSET
;
528 if ( !TranslateCharsetInfo( ULongToPtr(uACP
), &csi
, TCI_SRCCODEPAGE
) )
530 FIXME( "unhandled codepage %u - use ANSI_CHARSET for default stock objects\n", uACP
);
534 return csi
.ciCharset
;
538 /***********************************************************************
541 * Retrieve the reference count of a GDI object.
542 * Note: the object must be locked otherwise the count is meaningless.
544 UINT
GDI_get_ref_count( HGDIOBJ handle
)
546 struct gdi_handle_entry
*entry
;
549 EnterCriticalSection( &gdi_section
);
550 if ((entry
= handle_entry( handle
))) ret
= entry
->selcount
;
551 LeaveCriticalSection( &gdi_section
);
556 /***********************************************************************
559 * Increment the reference count of a GDI object.
561 HGDIOBJ
GDI_inc_ref_count( HGDIOBJ handle
)
563 struct gdi_handle_entry
*entry
;
565 EnterCriticalSection( &gdi_section
);
566 if ((entry
= handle_entry( handle
))) entry
->selcount
++;
568 LeaveCriticalSection( &gdi_section
);
573 /***********************************************************************
576 * Decrement the reference count of a GDI object.
578 BOOL
GDI_dec_ref_count( HGDIOBJ handle
)
580 struct gdi_handle_entry
*entry
;
582 EnterCriticalSection( &gdi_section
);
583 if ((entry
= handle_entry( handle
)))
585 assert( entry
->selcount
);
586 if (!--entry
->selcount
&& entry
->deleted
)
588 /* handle delayed DeleteObject*/
590 LeaveCriticalSection( &gdi_section
);
591 TRACE( "executing delayed DeleteObject for %p\n", handle
);
592 DeleteObject( handle
);
596 LeaveCriticalSection( &gdi_section
);
597 return entry
!= NULL
;
600 /******************************************************************************
603 * get the dpi from the registry
605 static int get_dpi( void )
607 static const WCHAR dpi_key_name
[] = {'S','o','f','t','w','a','r','e','\\','F','o','n','t','s','\0'};
608 static const WCHAR dpi_value_name
[] = {'L','o','g','P','i','x','e','l','s','\0'};
612 if (dpi
!= -1) return dpi
;
614 if (RegOpenKeyW(HKEY_CURRENT_CONFIG
, dpi_key_name
, &hkey
) == ERROR_SUCCESS
)
619 size
= sizeof(new_dpi
);
620 if (RegQueryValueExW(hkey
, dpi_value_name
, NULL
, &type
, (void *)&new_dpi
, &size
) == ERROR_SUCCESS
)
622 if (type
== REG_DWORD
&& new_dpi
!= 0)
627 if (dpi
<= 0) dpi
= 96;
632 static HFONT
create_scaled_font( const LOGFONTW
*deffont
)
638 height
= abs(lf
.lfHeight
) * get_dpi() / 96;
639 lf
.lfHeight
= deffont
->lfHeight
< 0 ? -height
: height
;
641 return CreateFontIndirectW( &lf
);
644 /***********************************************************************
647 * GDI initialization.
649 BOOL WINAPI
DllMain( HINSTANCE inst
, DWORD reason
, LPVOID reserved
)
651 const struct DefaultFontInfo
* deffonts
;
654 if (reason
!= DLL_PROCESS_ATTACH
) return TRUE
;
657 DisableThreadLibraryCalls( inst
);
660 /* create stock objects */
661 stock_objects
[WHITE_BRUSH
] = CreateBrushIndirect( &WhiteBrush
);
662 stock_objects
[LTGRAY_BRUSH
] = CreateBrushIndirect( &LtGrayBrush
);
663 stock_objects
[GRAY_BRUSH
] = CreateBrushIndirect( &GrayBrush
);
664 stock_objects
[DKGRAY_BRUSH
] = CreateBrushIndirect( &DkGrayBrush
);
665 stock_objects
[BLACK_BRUSH
] = CreateBrushIndirect( &BlackBrush
);
666 stock_objects
[NULL_BRUSH
] = CreateBrushIndirect( &NullBrush
);
668 stock_objects
[WHITE_PEN
] = CreatePenIndirect( &WhitePen
);
669 stock_objects
[BLACK_PEN
] = CreatePenIndirect( &BlackPen
);
670 stock_objects
[NULL_PEN
] = CreatePenIndirect( &NullPen
);
672 stock_objects
[DEFAULT_PALETTE
] = PALETTE_Init();
673 stock_objects
[DEFAULT_BITMAP
] = CreateBitmap( 1, 1, 1, 1, NULL
);
675 /* language-independent stock fonts */
676 stock_objects
[OEM_FIXED_FONT
] = CreateFontIndirectW( &OEMFixedFont
);
677 stock_objects
[ANSI_FIXED_FONT
] = CreateFontIndirectW( &AnsiFixedFont
);
678 stock_objects
[ANSI_VAR_FONT
] = CreateFontIndirectW( &AnsiVarFont
);
680 /* language-dependent stock fonts */
681 deffonts
= get_default_fonts(get_default_charset());
682 stock_objects
[SYSTEM_FONT
] = create_scaled_font( &deffonts
->SystemFont
);
683 stock_objects
[DEVICE_DEFAULT_FONT
] = create_scaled_font( &deffonts
->DeviceDefaultFont
);
684 stock_objects
[SYSTEM_FIXED_FONT
] = CreateFontIndirectW( &deffonts
->SystemFixedFont
);
685 stock_objects
[DEFAULT_GUI_FONT
] = create_scaled_font( &deffonts
->DefaultGuiFont
);
687 stock_objects
[DC_BRUSH
] = CreateBrushIndirect( &DCBrush
);
688 stock_objects
[DC_PEN
] = CreatePenIndirect( &DCPen
);
690 /* clear the NOSYSTEM bit on all stock objects*/
691 for (i
= 0; i
< NB_STOCK_OBJECTS
; i
++)
693 if (!stock_objects
[i
])
695 if (i
== 9) continue; /* there's no stock object 9 */
696 ERR( "could not create stock object %d\n", i
);
699 __wine_make_gdi_object_system( stock_objects
[i
], TRUE
);
705 static const char *gdi_obj_type( unsigned type
)
709 case OBJ_PEN
: return "OBJ_PEN";
710 case OBJ_BRUSH
: return "OBJ_BRUSH";
711 case OBJ_DC
: return "OBJ_DC";
712 case OBJ_METADC
: return "OBJ_METADC";
713 case OBJ_PAL
: return "OBJ_PAL";
714 case OBJ_FONT
: return "OBJ_FONT";
715 case OBJ_BITMAP
: return "OBJ_BITMAP";
716 case OBJ_REGION
: return "OBJ_REGION";
717 case OBJ_METAFILE
: return "OBJ_METAFILE";
718 case OBJ_MEMDC
: return "OBJ_MEMDC";
719 case OBJ_EXTPEN
: return "OBJ_EXTPEN";
720 case OBJ_ENHMETADC
: return "OBJ_ENHMETADC";
721 case OBJ_ENHMETAFILE
: return "OBJ_ENHMETAFILE";
722 case OBJ_COLORSPACE
: return "OBJ_COLORSPACE";
723 default: return "UNKNOWN";
727 static void dump_gdi_objects( void )
729 struct gdi_handle_entry
*entry
;
731 TRACE( "%u objects:\n", MAX_GDI_HANDLES
);
733 EnterCriticalSection( &gdi_section
);
734 for (entry
= gdi_handles
; entry
< next_unused
; entry
++)
737 TRACE( "handle %p FREE\n", entry_to_handle( entry
));
739 TRACE( "handle %p obj %p type %s selcount %u deleted %u\n",
740 entry_to_handle( entry
), entry
->obj
, gdi_obj_type( entry
->type
),
741 entry
->selcount
, entry
->deleted
);
743 LeaveCriticalSection( &gdi_section
);
746 /***********************************************************************
749 * Allocate a GDI handle for an object, which must have been allocated on the process heap.
751 HGDIOBJ
alloc_gdi_handle( void *obj
, WORD type
, const struct gdi_obj_funcs
*funcs
)
753 struct gdi_handle_entry
*entry
;
756 assert( type
); /* type 0 is reserved to mark free entries */
758 EnterCriticalSection( &gdi_section
);
762 next_free
= entry
->obj
;
763 else if (next_unused
< gdi_handles
+ MAX_GDI_HANDLES
)
764 entry
= next_unused
++;
767 LeaveCriticalSection( &gdi_section
);
768 ERR( "out of GDI object handles, expect a crash\n" );
769 if (TRACE_ON(gdi
)) dump_gdi_objects();
773 entry
->funcs
= funcs
;
779 if (++entry
->generation
== 0xffff) entry
->generation
= 1;
780 ret
= entry_to_handle( entry
);
781 LeaveCriticalSection( &gdi_section
);
782 TRACE( "allocated %s %p %u/%u\n", gdi_obj_type(type
), ret
,
783 InterlockedIncrement( &debug_count
), MAX_GDI_HANDLES
);
788 /***********************************************************************
791 * Free a GDI handle and return a pointer to the object.
793 void *free_gdi_handle( HGDIOBJ handle
)
796 struct gdi_handle_entry
*entry
;
798 EnterCriticalSection( &gdi_section
);
799 if ((entry
= handle_entry( handle
)))
801 TRACE( "freed %s %p %u/%u\n", gdi_obj_type( entry
->type
), handle
,
802 InterlockedDecrement( &debug_count
) + 1, MAX_GDI_HANDLES
);
805 entry
->obj
= next_free
;
808 LeaveCriticalSection( &gdi_section
);
813 /***********************************************************************
814 * get_full_gdi_handle
816 * Return the full GDI handle from a possibly truncated value.
818 HGDIOBJ
get_full_gdi_handle( HGDIOBJ handle
)
820 struct gdi_handle_entry
*entry
;
822 if (!HIWORD( handle
))
824 EnterCriticalSection( &gdi_section
);
825 if ((entry
= handle_entry( handle
))) handle
= entry_to_handle( entry
);
826 LeaveCriticalSection( &gdi_section
);
831 /***********************************************************************
834 * Return a pointer to the GDI object associated to the handle.
835 * Return NULL if the object has the wrong magic number.
836 * The object must be released with GDI_ReleaseObj.
838 void *GDI_GetObjPtr( HGDIOBJ handle
, WORD type
)
841 struct gdi_handle_entry
*entry
;
843 EnterCriticalSection( &gdi_section
);
845 if ((entry
= handle_entry( handle
)))
847 if (!type
|| entry
->type
== type
) ptr
= entry
->obj
;
850 if (!ptr
) LeaveCriticalSection( &gdi_section
);
855 /***********************************************************************
859 void GDI_ReleaseObj( HGDIOBJ handle
)
861 LeaveCriticalSection( &gdi_section
);
865 /***********************************************************************
868 void GDI_CheckNotLock(void)
870 if (gdi_section
.OwningThread
== ULongToHandle(GetCurrentThreadId()) && gdi_section
.RecursionCount
)
872 ERR( "BUG: holding GDI lock\n" );
878 /***********************************************************************
879 * DeleteObject (GDI32.@)
881 * Delete a Gdi object.
884 * obj [I] Gdi object to delete
887 * Success: TRUE. If obj was not returned from GetStockObject(), any resources
888 * it consumed are released.
889 * Failure: FALSE, if obj is not a valid Gdi object, or is currently selected
892 BOOL WINAPI
DeleteObject( HGDIOBJ obj
)
894 struct gdi_handle_entry
*entry
;
895 struct hdc_list
*hdcs_head
;
896 const struct gdi_obj_funcs
*funcs
= NULL
;
898 EnterCriticalSection( &gdi_section
);
899 if (!(entry
= handle_entry( obj
)))
901 LeaveCriticalSection( &gdi_section
);
907 TRACE("Preserving system object %p\n", obj
);
908 LeaveCriticalSection( &gdi_section
);
912 obj
= entry_to_handle( entry
); /* make it a full handle */
914 hdcs_head
= entry
->hdcs
;
919 TRACE("delayed for %p because object in use, count %u\n", obj
, entry
->selcount
);
920 entry
->deleted
= 1; /* mark for delete */
922 else funcs
= entry
->funcs
;
924 LeaveCriticalSection( &gdi_section
);
928 struct hdc_list
*next
= hdcs_head
->next
;
929 DC
*dc
= get_dc_ptr(hdcs_head
->hdc
);
931 TRACE("hdc %p has interest in %p\n", hdcs_head
->hdc
, obj
);
934 PHYSDEV physdev
= GET_DC_PHYSDEV( dc
, pDeleteObject
);
935 physdev
->funcs
->pDeleteObject( physdev
, obj
);
936 release_dc_ptr( dc
);
938 HeapFree(GetProcessHeap(), 0, hdcs_head
);
944 if (funcs
&& funcs
->pDeleteObject
) return funcs
->pDeleteObject( obj
);
948 /***********************************************************************
949 * GDI_hdc_using_object
951 * Call this if the dc requires DeleteObject notification
953 void GDI_hdc_using_object(HGDIOBJ obj
, HDC hdc
)
955 struct gdi_handle_entry
*entry
;
956 struct hdc_list
*phdc
;
958 TRACE("obj %p hdc %p\n", obj
, hdc
);
960 EnterCriticalSection( &gdi_section
);
961 if ((entry
= handle_entry( obj
)) && !entry
->system
)
963 for (phdc
= entry
->hdcs
; phdc
; phdc
= phdc
->next
)
964 if (phdc
->hdc
== hdc
) break;
968 phdc
= HeapAlloc(GetProcessHeap(), 0, sizeof(*phdc
));
970 phdc
->next
= entry
->hdcs
;
974 LeaveCriticalSection( &gdi_section
);
977 /***********************************************************************
978 * GDI_hdc_not_using_object
981 void GDI_hdc_not_using_object(HGDIOBJ obj
, HDC hdc
)
983 struct gdi_handle_entry
*entry
;
984 struct hdc_list
**pphdc
;
986 TRACE("obj %p hdc %p\n", obj
, hdc
);
988 EnterCriticalSection( &gdi_section
);
989 if ((entry
= handle_entry( obj
)) && !entry
->system
)
991 for (pphdc
= &entry
->hdcs
; *pphdc
; pphdc
= &(*pphdc
)->next
)
992 if ((*pphdc
)->hdc
== hdc
)
994 struct hdc_list
*phdc
= *pphdc
;
996 HeapFree(GetProcessHeap(), 0, phdc
);
1000 LeaveCriticalSection( &gdi_section
);
1003 /***********************************************************************
1004 * GetStockObject (GDI32.@)
1006 HGDIOBJ WINAPI
GetStockObject( INT obj
)
1009 if ((obj
< 0) || (obj
>= NB_STOCK_OBJECTS
)) return 0;
1010 ret
= stock_objects
[obj
];
1011 TRACE("returning %p\n", ret
);
1016 /***********************************************************************
1017 * GetObjectA (GDI32.@)
1019 INT WINAPI
GetObjectA( HGDIOBJ handle
, INT count
, LPVOID buffer
)
1021 struct gdi_handle_entry
*entry
;
1022 const struct gdi_obj_funcs
*funcs
= NULL
;
1025 TRACE("%p %d %p\n", handle
, count
, buffer
);
1027 EnterCriticalSection( &gdi_section
);
1028 if ((entry
= handle_entry( handle
)))
1030 funcs
= entry
->funcs
;
1031 handle
= entry_to_handle( entry
); /* make it a full handle */
1033 LeaveCriticalSection( &gdi_section
);
1037 if (!funcs
->pGetObjectA
)
1038 SetLastError( ERROR_INVALID_HANDLE
);
1039 else if (buffer
&& ((ULONG_PTR
)buffer
>> 16) == 0) /* catch apps getting argument order wrong */
1040 SetLastError( ERROR_NOACCESS
);
1042 result
= funcs
->pGetObjectA( handle
, count
, buffer
);
1047 /***********************************************************************
1048 * GetObjectW (GDI32.@)
1050 INT WINAPI
GetObjectW( HGDIOBJ handle
, INT count
, LPVOID buffer
)
1052 struct gdi_handle_entry
*entry
;
1053 const struct gdi_obj_funcs
*funcs
= NULL
;
1056 TRACE("%p %d %p\n", handle
, count
, buffer
);
1058 EnterCriticalSection( &gdi_section
);
1059 if ((entry
= handle_entry( handle
)))
1061 funcs
= entry
->funcs
;
1062 handle
= entry_to_handle( entry
); /* make it a full handle */
1064 LeaveCriticalSection( &gdi_section
);
1068 if (!funcs
->pGetObjectW
)
1069 SetLastError( ERROR_INVALID_HANDLE
);
1070 else if (buffer
&& ((ULONG_PTR
)buffer
>> 16) == 0) /* catch apps getting argument order wrong */
1071 SetLastError( ERROR_NOACCESS
);
1073 result
= funcs
->pGetObjectW( handle
, count
, buffer
);
1078 /***********************************************************************
1079 * GetObjectType (GDI32.@)
1081 DWORD WINAPI
GetObjectType( HGDIOBJ handle
)
1083 struct gdi_handle_entry
*entry
;
1086 EnterCriticalSection( &gdi_section
);
1087 if ((entry
= handle_entry( handle
))) result
= entry
->type
;
1088 LeaveCriticalSection( &gdi_section
);
1090 TRACE("%p -> %u\n", handle
, result
);
1091 if (!result
) SetLastError( ERROR_INVALID_HANDLE
);
1095 /***********************************************************************
1096 * GetCurrentObject (GDI32.@)
1098 * Get the currently selected object of a given type in a device context.
1101 * hdc [I] Device context to get the current object from
1102 * type [I] Type of current object to get (OBJ_* defines from "wingdi.h")
1105 * Success: The current object of the given type selected in hdc.
1106 * Failure: A NULL handle.
1109 * - only the following object types are supported:
1116 HGDIOBJ WINAPI
GetCurrentObject(HDC hdc
,UINT type
)
1119 DC
* dc
= get_dc_ptr( hdc
);
1124 case OBJ_EXTPEN
: /* fall through */
1125 case OBJ_PEN
: ret
= dc
->hPen
; break;
1126 case OBJ_BRUSH
: ret
= dc
->hBrush
; break;
1127 case OBJ_PAL
: ret
= dc
->hPalette
; break;
1128 case OBJ_FONT
: ret
= dc
->hFont
; break;
1129 case OBJ_BITMAP
: ret
= dc
->hBitmap
; break;
1131 /* tests show that OBJ_REGION is explicitly ignored */
1132 case OBJ_REGION
: break;
1134 /* the SDK only mentions those above */
1135 FIXME("(%p,%d): unknown type.\n",hdc
,type
);
1138 release_dc_ptr( dc
);
1143 /***********************************************************************
1144 * SelectObject (GDI32.@)
1146 * Select a Gdi object into a device context.
1149 * hdc [I] Device context to associate the object with
1150 * hObj [I] Gdi object to associate with hdc
1153 * Success: A non-NULL handle representing the previously selected object of
1154 * the same type as hObj.
1155 * Failure: A NULL object. If hdc is invalid, GetLastError() returns ERROR_INVALID_HANDLE.
1156 * if hObj is not a valid object handle, no last error is set. In either
1157 * case, hdc is unaffected by the call.
1159 HGDIOBJ WINAPI
SelectObject( HDC hdc
, HGDIOBJ hObj
)
1161 struct gdi_handle_entry
*entry
;
1162 const struct gdi_obj_funcs
*funcs
= NULL
;
1164 TRACE( "(%p,%p)\n", hdc
, hObj
);
1166 EnterCriticalSection( &gdi_section
);
1167 if ((entry
= handle_entry( hObj
)))
1169 funcs
= entry
->funcs
;
1170 hObj
= entry_to_handle( entry
); /* make it a full handle */
1172 LeaveCriticalSection( &gdi_section
);
1174 if (funcs
&& funcs
->pSelectObject
) return funcs
->pSelectObject( hObj
, hdc
);
1179 /***********************************************************************
1180 * UnrealizeObject (GDI32.@)
1182 BOOL WINAPI
UnrealizeObject( HGDIOBJ obj
)
1184 const struct gdi_obj_funcs
*funcs
= NULL
;
1185 struct gdi_handle_entry
*entry
;
1187 EnterCriticalSection( &gdi_section
);
1188 if ((entry
= handle_entry( obj
)))
1190 funcs
= entry
->funcs
;
1191 obj
= entry_to_handle( entry
); /* make it a full handle */
1193 LeaveCriticalSection( &gdi_section
);
1195 if (funcs
&& funcs
->pUnrealizeObject
) return funcs
->pUnrealizeObject( obj
);
1196 return funcs
!= NULL
;
1200 /* Solid colors to enumerate */
1201 static const COLORREF solid_colors
[] =
1202 { RGB(0x00,0x00,0x00), RGB(0xff,0xff,0xff),
1203 RGB(0xff,0x00,0x00), RGB(0x00,0xff,0x00),
1204 RGB(0x00,0x00,0xff), RGB(0xff,0xff,0x00),
1205 RGB(0xff,0x00,0xff), RGB(0x00,0xff,0xff),
1206 RGB(0x80,0x00,0x00), RGB(0x00,0x80,0x00),
1207 RGB(0x80,0x80,0x00), RGB(0x00,0x00,0x80),
1208 RGB(0x80,0x00,0x80), RGB(0x00,0x80,0x80),
1209 RGB(0x80,0x80,0x80), RGB(0xc0,0xc0,0xc0)
1213 /***********************************************************************
1214 * EnumObjects (GDI32.@)
1216 INT WINAPI
EnumObjects( HDC hdc
, INT nObjType
,
1217 GOBJENUMPROC lpEnumFunc
, LPARAM lParam
)
1224 TRACE("%p %d %p %08lx\n", hdc
, nObjType
, lpEnumFunc
, lParam
);
1228 /* Enumerate solid pens */
1229 for (i
= 0; i
< sizeof(solid_colors
)/sizeof(solid_colors
[0]); i
++)
1231 pen
.lopnStyle
= PS_SOLID
;
1232 pen
.lopnWidth
.x
= 1;
1233 pen
.lopnWidth
.y
= 0;
1234 pen
.lopnColor
= solid_colors
[i
];
1235 retval
= lpEnumFunc( &pen
, lParam
);
1236 TRACE("solid pen %08x, ret=%d\n",
1237 solid_colors
[i
], retval
);
1243 /* Enumerate solid brushes */
1244 for (i
= 0; i
< sizeof(solid_colors
)/sizeof(solid_colors
[0]); i
++)
1246 brush
.lbStyle
= BS_SOLID
;
1247 brush
.lbColor
= solid_colors
[i
];
1249 retval
= lpEnumFunc( &brush
, lParam
);
1250 TRACE("solid brush %08x, ret=%d\n",
1251 solid_colors
[i
], retval
);
1255 /* Now enumerate hatched brushes */
1256 if (retval
) for (i
= HS_HORIZONTAL
; i
<= HS_DIAGCROSS
; i
++)
1258 brush
.lbStyle
= BS_HATCHED
;
1259 brush
.lbColor
= RGB(0,0,0);
1261 retval
= lpEnumFunc( &brush
, lParam
);
1262 TRACE("hatched brush %d, ret=%d\n",
1269 /* FIXME: implement Win32 types */
1270 WARN("(%d): Invalid type\n", nObjType
);
1277 /***********************************************************************
1278 * SetObjectOwner (GDI32.@)
1280 void WINAPI
SetObjectOwner( HGDIOBJ handle
, HANDLE owner
)
1285 /***********************************************************************
1286 * GdiInitializeLanguagePack (GDI32.@)
1288 DWORD WINAPI
GdiInitializeLanguagePack( DWORD arg
)
1294 /***********************************************************************
1295 * GdiFlush (GDI32.@)
1297 BOOL WINAPI
GdiFlush(void)
1299 return TRUE
; /* FIXME */
1303 /***********************************************************************
1304 * GdiGetBatchLimit (GDI32.@)
1306 DWORD WINAPI
GdiGetBatchLimit(void)
1308 return 1; /* FIXME */
1312 /***********************************************************************
1313 * GdiSetBatchLimit (GDI32.@)
1315 DWORD WINAPI
GdiSetBatchLimit( DWORD limit
)
1317 return 1; /* FIXME */
1321 /*******************************************************************
1322 * GetColorAdjustment [GDI32.@]
1326 BOOL WINAPI
GetColorAdjustment(HDC hdc
, LPCOLORADJUSTMENT lpca
)
1332 /*******************************************************************
1333 * GdiComment [GDI32.@]
1337 BOOL WINAPI
GdiComment(HDC hdc
, UINT cbSize
, const BYTE
*lpData
)
1339 DC
*dc
= get_dc_ptr(hdc
);
1344 PHYSDEV physdev
= GET_DC_PHYSDEV( dc
, pGdiComment
);
1345 ret
= physdev
->funcs
->pGdiComment( physdev
, cbSize
, lpData
);
1346 release_dc_ptr( dc
);
1351 /*******************************************************************
1352 * SetColorAdjustment [GDI32.@]
1356 BOOL WINAPI
SetColorAdjustment(HDC hdc
, const COLORADJUSTMENT
* lpca
)