New debug scheme with explicit debug channels declaration.
[wine] / graphics / win16drv / brush.c
1 /*
2  * GDI brush objects - win16drv
3  *
4  * Copyright 1997  John Harvey
5  */
6
7 #include <stdlib.h>
8 #include "brush.h"
9 #include "win16drv.h"
10 #include "heap.h"
11 #include "debug.h"
12
13 DEFAULT_DEBUG_CHANNEL(win16drv)
14
15 HBRUSH WIN16DRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush,
16                                       BRUSHOBJ * brush )
17 {
18     WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
19     HBRUSH16     prevHandle = dc->w.hBrush;
20     int          nSize;
21     LOGBRUSH16   lBrush16;
22     dc->w.hBrush = hbrush;
23     lBrush16.lbStyle = brush->logbrush.lbStyle;
24     lBrush16.lbColor = brush->logbrush.lbColor;
25     lBrush16.lbHatch = brush->logbrush.lbHatch;
26
27
28     if ( physDev->BrushInfo )
29     {
30         TRACE(win16drv, "UnRealizing BrushInfo\n");
31         nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, -DRVOBJ_BRUSH,
32                                       physDev->BrushInfo,
33                                       physDev->BrushInfo, 0);
34     }
35     else 
36     {
37         nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, DRVOBJ_BRUSH,
38                                   &lBrush16, 0, 0); 
39         physDev->BrushInfo = SEGPTR_ALLOC( nSize );
40     }
41
42
43     nSize = PRTDRV_RealizeObject(physDev->segptrPDEVICE, DRVOBJ_BRUSH,
44                                  &lBrush16, 
45                                  physDev->BrushInfo, 
46                                  win16drv_SegPtr_TextXForm); 
47                          
48     return prevHandle;
49 }