4 * Copyright 1993 Alexandre Julliard
16 #include "debugtools.h"
18 DEFAULT_DEBUG_CHANNEL(gdi);
21 extern HBITMAP X11DRV_BITMAP_SelectObject( DC * dc, HBITMAP hbitmap,
23 extern HBRUSH X11DRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush,
25 extern HFONT X11DRV_FONT_SelectObject( DC * dc, HFONT hfont,
27 extern HPEN X11DRV_PEN_SelectObject( DC * dc, HPEN hpen, PENOBJ * pen );
29 extern BOOL X11DRV_BITMAP_DeleteObject( HBITMAP hbitmap, BITMAPOBJ *bmp );
31 /***********************************************************************
34 HGDIOBJ X11DRV_SelectObject( DC *dc, HGDIOBJ handle )
36 GDIOBJHDR *ptr = GDI_GetObjPtr( handle, MAGIC_DONTCARE );
40 TRACE("hdc=%04x %04x\n", dc->hSelf, handle );
42 switch(GDIMAGIC(ptr->wMagic))
45 ret = X11DRV_PEN_SelectObject( dc, handle, (PENOBJ *)ptr );
48 ret = X11DRV_BRUSH_SelectObject( dc, handle, (BRUSHOBJ *)ptr );
51 ret = X11DRV_BITMAP_SelectObject( dc, handle, (BITMAPOBJ *)ptr );
54 ret = X11DRV_FONT_SelectObject( dc, handle, (FONTOBJ *)ptr );
57 ret = (HGDIOBJ16)SelectClipRgn16( dc->hSelf, handle );
60 GDI_ReleaseObj( handle );
65 /***********************************************************************
68 BOOL X11DRV_DeleteObject( HGDIOBJ handle )
70 GDIOBJHDR *ptr = GDI_GetObjPtr( handle, MAGIC_DONTCARE );
73 if (!ptr) return FALSE;
75 switch(GDIMAGIC(ptr->wMagic)) {
77 ret = X11DRV_BITMAP_DeleteObject( handle, (BITMAPOBJ *)ptr );
81 ERR("Shouldn't be here!\n");
85 GDI_ReleaseObj( handle );