Added missing dependency for 16-bit resource files.
[wine] / graphics / win16drv / objects.c
1 /*
2  * GDI objects
3  *
4  * Copyright 1993 Alexandre Julliard
5  */
6
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 "debugtools.h"
14
15 DEFAULT_DEBUG_CHANNEL(gdi)
16
17
18 extern HBITMAP WIN16DRV_BITMAP_SelectObject( DC * dc, HBITMAP hbitmap,
19                                              BITMAPOBJ * bmp );
20 extern HBRUSH WIN16DRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush,
21                                            BRUSHOBJ * brush );
22 extern HFONT WIN16DRV_FONT_SelectObject( DC * dc, HFONT hfont,
23                                          FONTOBJ * font );
24 extern HPEN WIN16DRV_PEN_SelectObject( DC * dc, HPEN hpen, PENOBJ * pen );
25
26
27 /***********************************************************************
28  *           WIN16DRV_SelectObject
29  */
30 HGDIOBJ WIN16DRV_SelectObject( DC *dc, HGDIOBJ handle )
31 {
32     GDIOBJHDR *ptr = GDI_GetObjPtr( handle, MAGIC_DONTCARE );
33     HGDIOBJ ret = 0;
34
35     if (!ptr) return 0;
36     TRACE("hdc=%04x %04x\n", dc->hSelf, handle );
37     
38     switch(GDIMAGIC(ptr->wMagic))
39     {
40     case PEN_MAGIC:
41         ret = WIN16DRV_PEN_SelectObject( dc, handle, (PENOBJ *)ptr );     
42         break;
43     case BRUSH_MAGIC:
44         ret = WIN16DRV_BRUSH_SelectObject( dc, handle, (BRUSHOBJ *)ptr );         
45         break;
46     case BITMAP_MAGIC:
47         FIXME("WIN16DRV_SelectObject for BITMAP not implemented\n");
48         ret = 1;
49         break;
50     case FONT_MAGIC:
51         ret = WIN16DRV_FONT_SelectObject( dc, handle, (FONTOBJ *)ptr );   
52         break;
53     case REGION_MAGIC:
54         ret = (HGDIOBJ16)SelectClipRgn16( dc->hSelf, handle );
55         break;
56     }
57     GDI_ReleaseObj( handle );
58     return ret;
59 }