Stubs for EnumServiceStatus32, small changes.
[wine/multimedia.git] / graphics / x11drv / objects.c
bloba2a59767e2c4e9d5685d0683a6b7b27395727c83
1 /*
2 * GDI objects
4 * Copyright 1993 Alexandre Julliard
5 */
7 #include <stdlib.h>
8 #include <stdio.h>
9 #include "bitmap.h"
10 #include "brush.h"
11 #include "font.h"
12 #include "pen.h"
13 #include "debug.h"
16 extern HBITMAP32 X11DRV_BITMAP_SelectObject( DC * dc, HBITMAP32 hbitmap,
17 BITMAPOBJ * bmp );
18 extern HBRUSH32 X11DRV_BRUSH_SelectObject( DC * dc, HBRUSH32 hbrush,
19 BRUSHOBJ * brush );
20 extern HFONT32 X11DRV_FONT_SelectObject( DC * dc, HFONT32 hfont,
21 FONTOBJ * font );
22 extern HPEN32 X11DRV_PEN_SelectObject( DC * dc, HPEN32 hpen, PENOBJ * pen );
24 extern BOOL32 X11DRV_BITMAP_DeleteObject( HBITMAP32 hbitmap, BITMAPOBJ *bmp );
26 /***********************************************************************
27 * X11DRV_SelectObject
29 HGDIOBJ32 X11DRV_SelectObject( DC *dc, HGDIOBJ32 handle )
31 GDIOBJHDR *ptr = GDI_GetObjPtr( handle, MAGIC_DONTCARE );
32 HGDIOBJ32 ret = 0;
34 if (!ptr) return 0;
35 TRACE(gdi, "hdc=%04x %04x\n", dc->hSelf, handle );
37 switch(ptr->wMagic)
39 case PEN_MAGIC:
40 ret = X11DRV_PEN_SelectObject( dc, handle, (PENOBJ *)ptr );
41 break;
42 case BRUSH_MAGIC:
43 ret = X11DRV_BRUSH_SelectObject( dc, handle, (BRUSHOBJ *)ptr );
44 break;
45 case BITMAP_MAGIC:
46 ret = X11DRV_BITMAP_SelectObject( dc, handle, (BITMAPOBJ *)ptr );
47 break;
48 case FONT_MAGIC:
49 ret = X11DRV_FONT_SelectObject( dc, handle, (FONTOBJ *)ptr );
50 break;
51 case REGION_MAGIC:
52 ret = (HGDIOBJ16)SelectClipRgn16( dc->hSelf, handle );
53 break;
55 GDI_HEAP_UNLOCK( handle );
56 return ret;
60 /***********************************************************************
61 * X11DRV_DeleteObject
63 BOOL32 X11DRV_DeleteObject( HGDIOBJ32 handle )
65 GDIOBJHDR *ptr = GDI_GetObjPtr( handle, MAGIC_DONTCARE );
66 BOOL32 ret = 0;
68 if (!ptr) return FALSE;
70 switch(ptr->wMagic) {
71 case BITMAP_MAGIC:
72 ret = X11DRV_BITMAP_DeleteObject( handle, (BITMAPOBJ *)ptr );
73 break;
75 default:
76 ERR(gdi, "Shouldn't be here!\n");
77 ret = FALSE;
78 break;
80 GDI_HEAP_UNLOCK( handle );
81 return ret;