Release 980913
[wine/multimedia.git] / graphics / psdrv / brush.c
blob8a82afd539a2325c8b0930274fcaa77cf3b40942
1 /*
2 * PostScript brush handling
4 * Copyright 1998 Huw D M Davies
6 */
8 #include "windows.h"
9 #include "psdrv.h"
10 #include "brush.h"
11 #include "debug.h"
14 /***********************************************************************
15 * PSDRV_BRUSH_SelectObject
17 HBRUSH32 PSDRV_BRUSH_SelectObject( DC * dc, HBRUSH32 hbrush, BRUSHOBJ * brush )
19 HBRUSH32 prevbrush = dc->w.hBrush;
20 PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
22 TRACE(psdrv, "hbrush = %08x\n", hbrush);
23 dc->w.hBrush = hbrush;
25 switch(brush->logbrush.lbStyle) {
27 case BS_SOLID:
28 physDev->brush.style = BS_SOLID;
29 PSDRV_CreateColor(physDev, &physDev->brush.color,
30 brush->logbrush.lbColor);
31 break;
33 case BS_NULL:
34 physDev->brush.style = BS_NULL;
35 break;
37 case BS_HATCHED:
38 case BS_PATTERN:
39 FIXME(psdrv, "Unsupported brush style %d\n", brush->logbrush.lbStyle);
40 break;
42 default:
43 FIXME(psdrv, "Unrecognized brush style %d\n", brush->logbrush.lbStyle);
44 break;
47 physDev->brush.set = FALSE;
48 return prevbrush;
52 /**********************************************************************
54 * PSDRV_SetBrush
57 BOOL32 PSDRV_SetBrush(DC *dc)
59 PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
61 switch (physDev->brush.style) {
62 case BS_SOLID:
63 PSDRV_WriteSetColor(dc, &physDev->brush.color);
64 break;
66 default:
67 return FALSE;
68 break;
71 physDev->brush.set = TRUE;
72 return TRUE;