4 * Copyright 1993 Alexandre Julliard
17 #include "debugtools.h"
19 DEFAULT_DEBUG_CHANNEL(gdi);
22 extern HBITMAP X11DRV_BITMAP_SelectObject( DC * dc, HBITMAP hbitmap,
24 extern HBRUSH X11DRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush,
26 extern HFONT X11DRV_FONT_SelectObject( DC * dc, HFONT hfont,
28 extern HPEN X11DRV_PEN_SelectObject( DC * dc, HPEN hpen, PENOBJ * pen );
30 extern BOOL X11DRV_BITMAP_DeleteObject( HBITMAP hbitmap, BITMAPOBJ *bmp );
32 /***********************************************************************
35 HGDIOBJ X11DRV_SelectObject( DC *dc, HGDIOBJ handle )
37 GDIOBJHDR *ptr = GDI_GetObjPtr( handle, MAGIC_DONTCARE );
41 TRACE("hdc=%04x %04x\n", dc->hSelf, handle );
43 switch(GDIMAGIC(ptr->wMagic))
46 ret = X11DRV_PEN_SelectObject( dc, handle, (PENOBJ *)ptr );
49 ret = X11DRV_BRUSH_SelectObject( dc, handle, (BRUSHOBJ *)ptr );
52 ret = X11DRV_BITMAP_SelectObject( dc, handle, (BITMAPOBJ *)ptr );
55 ret = X11DRV_FONT_SelectObject( dc, handle, (FONTOBJ *)ptr );
58 ret = (HGDIOBJ16)SelectClipRgn16( dc->hSelf, handle );
61 GDI_ReleaseObj( handle );
66 /***********************************************************************
69 BOOL X11DRV_DeleteObject( HGDIOBJ handle )
71 GDIOBJHDR *ptr = GDI_GetObjPtr( handle, MAGIC_DONTCARE );
74 if (!ptr) return FALSE;
76 switch(GDIMAGIC(ptr->wMagic)) {
78 ret = X11DRV_BITMAP_DeleteObject( handle, (BITMAPOBJ *)ptr );
82 ERR("Shouldn't be here!\n");
86 GDI_ReleaseObj( handle );