675145fbd2952e37388a1020cd58811223ba59b4
[wine/hacks.git] / dlls / winedib.drv / font.c
blob675145fbd2952e37388a1020cd58811223ba59b4
1 /*
2 * DIBDRV font 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
22 #include "config.h"
23 #include "wine/port.h"
25 #include "dibdrv.h"
27 WINE_DEFAULT_DEBUG_CHANNEL(dibdrv);
29 /**********************************************************************
30 * DIBDRV_SetTextColor
32 COLORREF DIBDRV_SetTextColor( DIBDRVPHYSDEV *physDev, COLORREF color )
34 COLORREF res;
36 TRACE("physDev:%p, color:%08x\n", physDev, color);
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()->pSetTextColor(physDev->X11PhysDev, color);
44 else
46 /* DDB selected in, use X11 driver */
47 res = _DIBDRV_GetDisplayDriver()->pSetTextColor(physDev->X11PhysDev, color);
49 return res;
52 /***********************************************************************
53 * DIBDRV_SelectFont
55 HFONT DIBDRV_SelectFont( DIBDRVPHYSDEV *physDev, HFONT hfont, HANDLE gdiFont )
57 HFONT res;
59 TRACE("physDev:%p, hfont:%p, gdiFont:%p\n", physDev, hfont, gdiFont);
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()->pSelectFont(physDev->X11PhysDev, hfont, gdiFont);
67 else
69 /* DDB selected in, use X11 driver */
70 res = _DIBDRV_GetDisplayDriver()->pSelectFont(physDev->X11PhysDev, hfont, gdiFont);
72 return res;
75 /***********************************************************************
76 * DIBDRV_EnumDeviceFonts
78 BOOL DIBDRV_EnumDeviceFonts( DIBDRVPHYSDEV *physDev, LPLOGFONTW plf,
79 FONTENUMPROCW proc, LPARAM lp )
81 BOOL res;
83 TRACE("physDev:%p, plf:%p, proc:%p, lp:%lx\n", physDev, plf, proc, lp);
85 if(physDev->hasDIB)
87 /* DIB section selected in, use DIB Engine */
88 ONCE(FIXME("TEMPORARY - fallback to X11 driver\n"));
89 res = _DIBDRV_GetDisplayDriver()->pEnumDeviceFonts(physDev->X11PhysDev, plf, proc, lp);
91 else
93 /* DDB selected in, use X11 driver */
94 res = _DIBDRV_GetDisplayDriver()->pEnumDeviceFonts(physDev->X11PhysDev, plf, proc, lp);
96 return res;
99 /***********************************************************************
100 * DIBDRV_GetTextMetrics
102 BOOL DIBDRV_GetTextMetrics( DIBDRVPHYSDEV *physDev, TEXTMETRICW *metrics )
104 BOOL res;
106 TRACE("physDev:%p, metrics:%p\n", physDev, metrics);
108 if(physDev->hasDIB)
110 /* DIB section selected in, use DIB Engine */
111 ONCE(FIXME("TEMPORARY - fallback to X11 driver\n"));
112 res = _DIBDRV_GetDisplayDriver()->pGetTextMetrics(physDev->X11PhysDev, metrics);
114 else
116 /* DDB selected in, use X11 driver */
117 res = _DIBDRV_GetDisplayDriver()->pGetTextMetrics(physDev->X11PhysDev, metrics);
119 return res;
122 /***********************************************************************
123 * DIBDRV_GetCharWidth
125 BOOL DIBDRV_GetCharWidth( DIBDRVPHYSDEV *physDev, UINT firstChar, UINT lastChar,
126 LPINT buffer )
128 BOOL res;
130 TRACE("physDev:%p, firstChar:%d, lastChar:%d, buffer:%pn", physDev, firstChar, lastChar, buffer);
132 if(physDev->hasDIB)
134 /* DIB section selected in, use DIB Engine */
135 ONCE(FIXME("TEMPORARY - fallback to X11 driver\n"));
136 res = _DIBDRV_GetDisplayDriver()->pGetCharWidth(physDev->X11PhysDev, firstChar, lastChar, buffer);
138 else
140 /* DDB selected in, use X11 driver */
141 res = _DIBDRV_GetDisplayDriver()->pGetCharWidth(physDev->X11PhysDev, firstChar, lastChar, buffer);
143 return res;