Commit df357093 authored by Alexandre Julliard's avatar Alexandre Julliard

gdi32: Get rid of the GDIOBJHDR type.

parent 3964aa4a
......@@ -211,7 +211,7 @@ HBITMAP WINAPI CreateBitmapIndirect( const BITMAP *bmp )
bmpobj->dib.dsBm = bm;
bmpobj->dib.dsBm.bmBits = NULL;
if (!(hbitmap = alloc_gdi_handle( &bmpobj->header, OBJ_BITMAP, &bitmap_funcs )))
if (!(hbitmap = alloc_gdi_handle( bmpobj, OBJ_BITMAP, &bitmap_funcs )))
{
HeapFree( GetProcessHeap(), 0, bmpobj );
return 0;
......
......@@ -34,7 +34,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(gdi);
/* GDI logical brush object */
typedef struct
{
GDIOBJHDR header;
LOGBRUSH logbrush;
struct brush_pattern pattern;
} BRUSHOBJ;
......@@ -201,7 +200,7 @@ HBRUSH WINAPI CreateBrushIndirect( const LOGBRUSH * brush )
ptr->logbrush = *brush;
if (store_brush_pattern( &ptr->logbrush, &ptr->pattern ) &&
(hbrush = alloc_gdi_handle( &ptr->header, OBJ_BRUSH, &brush_funcs )))
(hbrush = alloc_gdi_handle( ptr, OBJ_BRUSH, &brush_funcs )))
{
TRACE("%p\n", hbrush);
return hbrush;
......
......@@ -118,7 +118,7 @@ DC *alloc_dc_ptr( WORD magic )
reset_bounds( &dc->bounds );
if (!(dc->hSelf = alloc_gdi_handle( &dc->header, magic, &dc_funcs )))
if (!(dc->hSelf = alloc_gdi_handle( dc, magic, &dc_funcs )))
{
HeapFree( GetProcessHeap(), 0, dc );
return NULL;
......
......@@ -1549,7 +1549,7 @@ HBITMAP WINAPI CreateDIBSection(HDC hdc, CONST BITMAPINFO *bmi, UINT usage,
if (!bmp->dib.dsBm.bmBits) goto error;
if (!(ret = alloc_gdi_handle( &bmp->header, OBJ_BITMAP, &dib_funcs ))) goto error;
if (!(ret = alloc_gdi_handle( bmp, OBJ_BITMAP, &dib_funcs ))) goto error;
if (bits) *bits = bmp->dib.dsBm.bmBits;
return ret;
......
......@@ -50,7 +50,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(enhmetafile);
typedef struct
{
GDIOBJHDR header;
ENHMETAHEADER *emh;
BOOL on_disk; /* true if metafile is on disk */
} ENHMETAFILEOBJ;
......@@ -270,7 +269,7 @@ HENHMETAFILE EMF_Create_HENHMETAFILE(ENHMETAHEADER *emh, BOOL on_disk )
metaObj->emh = emh;
metaObj->on_disk = on_disk;
if (!(hmf = alloc_gdi_handle( &metaObj->header, OBJ_ENHMETAFILE, NULL )))
if (!(hmf = alloc_gdi_handle( metaObj, OBJ_ENHMETAFILE, NULL )))
HeapFree( GetProcessHeap(), 0, metaObj );
return hmf;
}
......
......@@ -110,7 +110,6 @@ static const struct gdi_obj_funcs font_funcs =
typedef struct
{
GDIOBJHDR header;
LOGFONTW logfont;
} FONTOBJ;
......@@ -447,7 +446,7 @@ HFONT WINAPI CreateFontIndirectExW( const ENUMLOGFONTEXDVW *penumex )
plf->lfOrientation/10., plf->lfEscapement/10., fontPtr);
}
if (!(hFont = alloc_gdi_handle( &fontPtr->header, OBJ_FONT, &font_funcs )))
if (!(hFont = alloc_gdi_handle( fontPtr, OBJ_FONT, &font_funcs )))
{
HeapFree( GetProcessHeap(), 0, fontPtr );
return 0;
......
......@@ -57,15 +57,10 @@ struct gdi_obj_funcs
BOOL (*pDeleteObject)( HGDIOBJ handle );
};
typedef struct tagGDIOBJHDR
{
} GDIOBJHDR;
typedef struct tagGdiFont GdiFont;
typedef struct tagDC
{
GDIOBJHDR header;
HDC hSelf; /* Handle to this DC */
struct gdi_physdev nulldrv; /* physdev for the null driver */
PHYSDEV physDev; /* current top of the physdev stack */
......@@ -180,7 +175,6 @@ static inline PHYSDEV find_dc_driver( DC *dc, const struct gdi_dc_funcs *funcs )
typedef struct tagBITMAPOBJ
{
GDIOBJHDR header;
DIBSECTION dib;
SIZE size; /* For SetBitmapDimension() */
RGBQUAD *color_table; /* DIB color table if <= 8bpp (always 1 << bpp in size) */
......
......@@ -744,7 +744,7 @@ HGDIOBJ alloc_gdi_handle( void *obj, WORD type, const struct gdi_obj_funcs *func
*/
void *free_gdi_handle( HGDIOBJ handle )
{
GDIOBJHDR *object = NULL;
void *object = NULL;
struct gdi_handle_entry *entry;
EnterCriticalSection( &gdi_section );
......@@ -769,7 +769,7 @@ void *free_gdi_handle( HGDIOBJ handle )
*/
void *GDI_GetObjPtr( HGDIOBJ handle, WORD type )
{
GDIOBJHDR *ptr = NULL;
void *ptr = NULL;
struct gdi_handle_entry *entry;
EnterCriticalSection( &gdi_section );
......
......@@ -42,7 +42,6 @@ typedef BOOL (*unrealize_function)(HPALETTE);
typedef struct tagPALETTEOBJ
{
GDIOBJHDR header;
unrealize_function unrealize;
WORD version; /* palette version */
WORD count; /* count of palette entries */
......@@ -130,7 +129,7 @@ HPALETTE WINAPI CreatePalette(
return 0;
}
memcpy( palettePtr->entries, palette->palPalEntry, size );
if (!(hpalette = alloc_gdi_handle( &palettePtr->header, OBJ_PAL, &palette_funcs )))
if (!(hpalette = alloc_gdi_handle( palettePtr, OBJ_PAL, &palette_funcs )))
{
HeapFree( GetProcessHeap(), 0, palettePtr->entries );
HeapFree( GetProcessHeap(), 0, palettePtr );
......
......@@ -36,7 +36,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(gdi);
/* GDI logical pen object */
typedef struct
{
GDIOBJHDR header;
struct brush_pattern pattern;
EXTLOGPEN logpen;
} PENOBJ;
......@@ -113,7 +112,7 @@ HPEN WINAPI CreatePenIndirect( const LOGPEN * pen )
break;
}
if (!(hpen = alloc_gdi_handle( &penPtr->header, OBJ_PEN, &pen_funcs )))
if (!(hpen = alloc_gdi_handle( penPtr, OBJ_PEN, &pen_funcs )))
HeapFree( GetProcessHeap(), 0, penPtr );
return hpen;
}
......@@ -203,7 +202,7 @@ HPEN WINAPI ExtCreatePen( DWORD style, DWORD width,
penPtr->logpen.elpNumEntries = style_count;
memcpy(penPtr->logpen.elpStyleEntry, style_bits, style_count * sizeof(DWORD));
if (!(hpen = alloc_gdi_handle( &penPtr->header, OBJ_EXTPEN, &pen_funcs )))
if (!(hpen = alloc_gdi_handle( penPtr, OBJ_EXTPEN, &pen_funcs )))
{
free_brush_pattern( &penPtr->pattern );
HeapFree( GetProcessHeap(), 0, penPtr );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment