Added RtlAllocateAndInitializeSid entry.
[wine] / graphics / psdrv / brush.c
1 /*
2  *      PostScript brush handling
3  *
4  * Copyright 1998  Huw D M Davies
5  *
6  */
7
8 #include "windows.h"
9 #include "psdrv.h"
10 #include "brush.h"
11 #include "debug.h"
12
13
14 /***********************************************************************
15  *           PSDRV_BRUSH_SelectObject
16  */
17 HBRUSH32 PSDRV_BRUSH_SelectObject( DC * dc, HBRUSH32 hbrush, BRUSHOBJ * brush )
18 {
19     HBRUSH32 prevbrush = dc->w.hBrush;
20     PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
21
22     TRACE(psdrv, "hbrush = %08x\n", hbrush);
23     dc->w.hBrush = hbrush;
24
25     switch(brush->logbrush.lbStyle) {
26
27     case BS_SOLID:
28         physDev->brush.style = BS_SOLID;
29         PSDRV_CreateColor(physDev, &physDev->brush.color, 
30                           brush->logbrush.lbColor);
31         break;
32
33     case BS_NULL:
34         physDev->brush.style = BS_NULL;
35         break;
36
37     case BS_HATCHED:
38     case BS_PATTERN:
39         FIXME(psdrv, "Unsupported brush style %d\n", brush->logbrush.lbStyle);
40         break;
41
42     default:
43         FIXME(psdrv, "Unrecognized brush style %d\n", brush->logbrush.lbStyle);
44         break;
45     }
46
47     physDev->brush.set = FALSE;
48     return prevbrush;
49 }
50
51
52 /**********************************************************************
53  *
54  *      PSDRV_SetBrush
55  *
56  */
57 BOOL32 PSDRV_SetBrush(DC *dc)
58 {
59     PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
60
61     switch (physDev->brush.style) {
62     case BS_SOLID:
63         PSDRV_WriteSetColor(dc, &physDev->brush.color);
64         break;
65
66     default:
67         return FALSE;
68         break;
69
70     }
71     physDev->brush.set = TRUE;
72     return TRUE;
73 }