Fixed some issues found by winapi_check.
[wine] / dlls / wineps / objects.c
1 /*
2  *      PostScript driver object handling
3  *
4  *      Copyright 1998  Huw D M Davies
5  *
6  */
7
8 #include "psdrv.h"
9 #include "font.h"
10 #include "pen.h"
11 #include "brush.h"
12 #include "bitmap.h"
13 #include "debugtools.h"
14
15 DEFAULT_DEBUG_CHANNEL(psdrv);
16
17 /***********************************************************************
18  *           PSDRV_BITMAP_SelectObject
19  */
20 static HBITMAP16 PSDRV_BITMAP_SelectObject( DC * dc, HBITMAP16 hbitmap,
21                                             BITMAPOBJ * bmp )
22 {
23     FIXME("stub\n");
24     return 0;
25 }
26
27
28 /***********************************************************************
29  *           PSDRV_SelectObject
30  */
31 HGDIOBJ PSDRV_SelectObject( DC *dc, HGDIOBJ handle )
32 {
33     GDIOBJHDR * ptr = GDI_GetObjPtr( handle, MAGIC_DONTCARE );
34     HGDIOBJ ret = 0;
35
36     if (!ptr) return 0;
37     TRACE("hdc=%04x %04x\n", dc->hSelf, handle );
38     
39     switch(GDIMAGIC(ptr->wMagic))
40     {
41       case PEN_MAGIC:
42           ret = PSDRV_PEN_SelectObject( dc, handle, (PENOBJ *)ptr );
43           break;
44       case BRUSH_MAGIC:
45           ret = PSDRV_BRUSH_SelectObject( dc, handle, (BRUSHOBJ *)ptr );
46           break;
47       case BITMAP_MAGIC:
48           ret = PSDRV_BITMAP_SelectObject( dc, handle, (BITMAPOBJ *)ptr );
49           break;
50       case FONT_MAGIC:
51           ret = PSDRV_FONT_SelectObject( dc, handle, (FONTOBJ *)ptr );    
52           break;
53       case REGION_MAGIC:
54           ret = (HGDIOBJ)SelectClipRgn( dc->hSelf, handle );
55           break;
56       default:
57           ERR("Unknown object magic %04x\n", GDIMAGIC(ptr->wMagic));
58           break;
59     }
60     GDI_ReleaseObj( handle );
61     return ret;
62 }