Set console video mode when loading DOS app. (Eventually, I want to
[wine/multimedia.git] / graphics / win16drv / brush.c
bloba437d210cc8373fe5026ac60b2b33f0eb366d4c7
1 /*
2 * GDI brush objects - win16drv
4 * Copyright 1997 John Harvey
5 */
7 #include <stdlib.h>
8 #include "brush.h"
9 #include "win16drv.h"
10 #include "heap.h"
11 #include "debug.h"
13 HBRUSH32 WIN16DRV_BRUSH_SelectObject( DC * dc, HBRUSH32 hbrush,
14 BRUSHOBJ * brush )
16 WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
17 HBRUSH16 prevHandle = dc->w.hBrush;
18 int nSize;
19 LOGBRUSH16 lBrush16;
20 dc->w.hBrush = hbrush;
21 lBrush16.lbStyle = brush->logbrush.lbStyle;
22 lBrush16.lbColor = brush->logbrush.lbColor;
23 lBrush16.lbHatch = brush->logbrush.lbHatch;
26 if ( physDev->BrushInfo )
28 TRACE(win16drv, "UnRealizing BrushInfo\n");
29 nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, -DRVOBJ_BRUSH,
30 physDev->BrushInfo,
31 physDev->BrushInfo, 0);
33 else
35 nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, DRVOBJ_BRUSH,
36 &lBrush16, 0, 0);
37 physDev->BrushInfo = SEGPTR_ALLOC( nSize );
41 nSize = PRTDRV_RealizeObject(physDev->segptrPDEVICE, DRVOBJ_BRUSH,
42 &lBrush16,
43 physDev->BrushInfo,
44 win16drv_SegPtr_TextXForm);
46 return prevHandle;