Release 971012
[wine/multimedia.git] / graphics / win16drv / objects.c
blobc2e1f82dbb7b5631c8274d907b4aaf894a759b88
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 "stddebug.h"
14 #include "debug.h"
17 extern HBITMAP32 WIN16DRV_BITMAP_SelectObject( DC * dc, HBITMAP32 hbitmap,
18 BITMAPOBJ * bmp );
19 extern HBRUSH32 WIN16DRV_BRUSH_SelectObject( DC * dc, HBRUSH32 hbrush,
20 BRUSHOBJ * brush );
21 extern HFONT32 WIN16DRV_FONT_SelectObject( DC * dc, HFONT32 hfont,
22 FONTOBJ * font );
23 extern HPEN32 WIN16DRV_PEN_SelectObject( DC * dc, HPEN32 hpen, PENOBJ * pen );
26 /***********************************************************************
27 * WIN16DRV_SelectObject
29 HGDIOBJ32 WIN16DRV_SelectObject( DC *dc, HGDIOBJ32 handle )
31 GDIOBJHDR *ptr = GDI_GetObjPtr( handle, MAGIC_DONTCARE );
32 HGDIOBJ32 ret = 0;
34 if (!ptr) return 0;
35 dprintf_gdi(stddeb, "SelectObject: hdc=%04x %04x\n", dc->hSelf, handle );
37 switch(ptr->wMagic)
39 case PEN_MAGIC:
40 ret = WIN16DRV_PEN_SelectObject( dc, handle, (PENOBJ *)ptr );
41 break;
42 case BRUSH_MAGIC:
43 ret = WIN16DRV_BRUSH_SelectObject( dc, handle, (BRUSHOBJ *)ptr );
44 break;
45 case BITMAP_MAGIC:
46 fprintf(stderr, "WIN16DRV_SelectObject for BITMAP not implemented\n");
47 ret = 1;
48 break;
49 case FONT_MAGIC:
50 ret = WIN16DRV_FONT_SelectObject( dc, handle, (FONTOBJ *)ptr );
51 break;
52 case REGION_MAGIC:
53 ret = (HGDIOBJ16)SelectClipRgn16( dc->hSelf, handle );
54 break;
56 GDI_HEAP_UNLOCK( handle );
57 return ret;