Release 980201
[wine.git] / graphics / win16drv / brush.c
blob305cde50943e34594ad9d108f37a50e1375500ba
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 "stddebug.h"
12 #include "debug.h"
14 HBRUSH32 WIN16DRV_BRUSH_SelectObject( DC * dc, HBRUSH32 hbrush,
15 BRUSHOBJ * brush )
17 WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
18 HBRUSH16 prevHandle = dc->w.hBrush;
19 int nSize;
20 LOGBRUSH16 lBrush16;
21 dc->w.hBrush = hbrush;
22 lBrush16.lbStyle = brush->logbrush.lbStyle;
23 lBrush16.lbColor = brush->logbrush.lbColor;
24 lBrush16.lbHatch = brush->logbrush.lbHatch;
27 if ( physDev->BrushInfo )
29 dprintf_win16drv(stddeb, "UnRealizing BrushInfo\n");
30 nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, -DRVOBJ_BRUSH,
31 physDev->BrushInfo,
32 physDev->BrushInfo, 0);
34 else
36 nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, DRVOBJ_BRUSH,
37 &lBrush16, 0, 0);
38 physDev->BrushInfo = SEGPTR_ALLOC( nSize );
42 nSize = PRTDRV_RealizeObject(physDev->segptrPDEVICE, DRVOBJ_BRUSH,
43 &lBrush16,
44 physDev->BrushInfo,
45 win16drv_SegPtr_TextXForm);
47 return prevHandle;