bde2f23263441a6cae48677bdd3d9c1b6e3acef7
[wine/hacks.git] / dlls / winedib.drv / pen_brush.c
blobbde2f23263441a6cae48677bdd3d9c1b6e3acef7
1 /*
2 * DIBDRV pen objects
4 * Copyright 2009 Massimo Del Fedele
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "config.h"
22 #include "wine/port.h"
24 #include "dibdrv.h"
26 WINE_DEFAULT_DEBUG_CHANNEL(dibdrv);
29 /***********************************************************************
30 * DIBDRV_SelectPen
32 HPEN DIBDRV_SelectPen( DIBDRVPHYSDEV *physDev, HPEN hpen )
34 HPEN res;
36 TRACE("physDev:%p, hpen:%p\n", physDev, hpen);
38 if(physDev->hasDIB)
40 /* DIB section selected in, use DIB Engine */
41 ONCE(FIXME("TEMPORARY - fallback to X11 driver\n"));
42 res = _DIBDRV_GetDisplayDriver()->pSelectPen(physDev->X11PhysDev, hpen);
44 else
46 /* DDB selected in, use X11 driver */
47 res = _DIBDRV_GetDisplayDriver()->pSelectPen(physDev->X11PhysDev, hpen);
49 return res;
52 /***********************************************************************
53 * DIBDRV_SetDCPenColor
55 COLORREF DIBDRV_SetDCPenColor( DIBDRVPHYSDEV *physDev, COLORREF crColor )
57 COLORREF res;
59 TRACE("physDev:%p, crColor:%x\n", physDev, crColor);
61 if(physDev->hasDIB)
63 /* DIB section selected in, use DIB Engine */
64 ONCE(FIXME("TEMPORARY - fallback to X11 driver\n"));
65 res = _DIBDRV_GetDisplayDriver()->pSetDCPenColor(physDev->X11PhysDev, crColor);
67 else
69 /* DDB selected in, use X11 driver */
70 res = _DIBDRV_GetDisplayDriver()->pSetDCPenColor(physDev->X11PhysDev, crColor);
72 return res;
75 /***********************************************************************
76 * DIBDRV_SelectBrush
78 HBRUSH DIBDRV_SelectBrush( DIBDRVPHYSDEV *physDev, HBRUSH hbrush )
80 HBRUSH res;
82 TRACE("physDev:%p, hbrush:%p\n", physDev, hbrush);
84 if(physDev->hasDIB)
86 /* DIB section selected in, use DIB Engine */
87 ONCE(FIXME("TEMPORARY - fallback to X11 driver\n"));
88 res = _DIBDRV_GetDisplayDriver()->pSelectBrush(physDev->X11PhysDev, hbrush);
90 else
92 /* DDB selected in, use X11 driver */
93 res = _DIBDRV_GetDisplayDriver()->pSelectBrush(physDev->X11PhysDev, hbrush);
95 return res;
98 /***********************************************************************
99 * DIBDRV_SetDCBrushColor
101 COLORREF DIBDRV_SetDCBrushColor( DIBDRVPHYSDEV *physDev, COLORREF crColor )
103 COLORREF res;
105 TRACE("physDev:%p, crColor:%x\n", physDev, crColor);
107 if(physDev->hasDIB)
109 /* DIB section selected in, use DIB Engine */
110 ONCE(FIXME("TEMPORARY - fallback to X11 driver\n"));
111 res = _DIBDRV_GetDisplayDriver()->pSetDCBrushColor(physDev->X11PhysDev, crColor);
113 else
115 /* DDB selected in, use X11 driver */
116 res = _DIBDRV_GetDisplayDriver()->pSetDCBrushColor(physDev->X11PhysDev, crColor);
118 return res;
121 /***********************************************************************
122 * SetROP2
124 INT DIBDRV_SetROP2( DIBDRVPHYSDEV *physDev, INT rop )
126 INT prevRop;
128 TRACE("physDev:%p, rop:%x\n", physDev, rop);
130 prevRop = physDev->rop2;
131 physDev->rop2 = rop;
132 return prevRop;
133 /* note : X11 Driver don't have SetROP2() function exported */
136 /***********************************************************************
137 * SetBkColor
139 COLORREF DIBDRV_SetBkColor( DIBDRVPHYSDEV *physDev, COLORREF color )
141 COLORREF res;
143 TRACE("physDev:%p, color:%x\n", physDev, color);
145 if(physDev->hasDIB)
147 /* DIB section selected in, use DIB Engine */
148 ONCE(FIXME("TEMPORARY - fallback to X11 driver\n"));
149 res = _DIBDRV_GetDisplayDriver()->pSetBkColor(physDev->X11PhysDev, color);
151 else
153 /* DDB selected in, use X11 driver */
154 res = _DIBDRV_GetDisplayDriver()->pSetBkColor(physDev->X11PhysDev, color);
156 return res;