28330faf3205d54008357905826bec842cccf36b
[wine/hacks.git] / dlls / winedib.drv / dib.c
blob28330faf3205d54008357905826bec842cccf36b
1 /*
2 * DIBDRV device-independent bitmaps
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);
28 /***********************************************************************
29 * DIBDRV_CreateDIBSection
31 HBITMAP DIBDRV_CreateDIBSection( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap,
32 const BITMAPINFO *bmi, UINT usage )
34 HBITMAP res;
36 TRACE("physDev:%p, hbitmap:%p, bmi:%p, usage:%d\n", physDev, hbitmap, bmi, usage);
38 /* createDIBSection is only DIB-related, so we just use the engine */
39 ONCE(FIXME("TEMPORARY - fallback to X11 driver\n"));
40 res = _DIBDRV_GetDisplayDriver()->pCreateDIBSection(physDev->X11PhysDev, hbitmap, bmi, usage);
42 return res;
45 /***********************************************************************
46 * DIBDRV_GetDIBits
48 INT DIBDRV_GetDIBits( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap, UINT startscan,
49 UINT lines, LPCVOID bits, const BITMAPINFO *bmi, UINT coloruse )
51 INT res;
53 TRACE("physDev:%p, hbitmap:%p, startscan:%d, lines:%d, bits:%p, bmi:%p, coloruse:%d\n",
54 physDev, hbitmap, startscan, lines, bits, bmi, coloruse);
56 /* GetDIBits reads bits from a DDB, so we should use the X11 driver */
57 res = _DIBDRV_GetDisplayDriver()->pGetDIBits(physDev->X11PhysDev, hbitmap, startscan, lines, bits, bmi, coloruse);
59 return res;
62 /***********************************************************************
63 * DIBDRV_SetDIBColorTable
65 UINT DIBDRV_SetDIBColorTable( DIBDRVPHYSDEV *physDev, UINT start, UINT count,
66 const RGBQUAD *colors )
68 UINT res;
70 TRACE("physDev:%p, start:%d, count:%d, colors:%p\n", physDev, start, count, colors);
72 /* SetDIBColorTable operates on a DIB, so we use the engine */
73 ONCE(FIXME("TEMPORARY - fallback to X11 driver\n"));
74 res = _DIBDRV_GetDisplayDriver()->pSetDIBColorTable(physDev->X11PhysDev, start, count, colors);
76 return res;
79 /***********************************************************************
80 * DIBDRV_SetDIBits
82 INT DIBDRV_SetDIBits( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap, UINT startscan,
83 UINT lines, LPCVOID bits, const BITMAPINFO *info, UINT coloruse )
85 INT res;
87 TRACE("physDev:%p, hbitmap:%p, startscan:%d, lines:%d, bits:%p, bmi:%p, coloruse:%d\n",
88 physDev, hbitmap, startscan, lines, bits, info, coloruse);
90 /* SetDIBits writes bits to a DDB, so we should use the X11 driver */
91 res = _DIBDRV_GetDisplayDriver()->pSetDIBits(physDev->X11PhysDev, hbitmap, startscan, lines, bits, info, coloruse);
93 return res;
96 /*************************************************************************
97 * DIBDRV_SetDIBitsToDevice
99 INT DIBDRV_SetDIBitsToDevice( DIBDRVPHYSDEV *physDev, INT xDest, INT yDest, DWORD cx,
100 DWORD cy, INT xSrc, INT ySrc,
101 UINT startscan, UINT lines, LPCVOID bits,
102 const BITMAPINFO *info, UINT coloruse )
104 INT res;
106 TRACE("physDev:%p, xDest:%d, yDest:%d, cx:%x, cy:%x, xSrc:%d, ySrc:%d, startscan:%d, lines:%d, bits:%p, info:%p, coloruse:%d\n",
107 physDev, xDest, yDest, cx, cy, xSrc, ySrc, startscan, lines, bits, info, coloruse);
109 /* SetDIBitsToDevice operates on a physical device, so we should use the X11 driver */
110 res = _DIBDRV_GetDisplayDriver()->pSetDIBitsToDevice(physDev->X11PhysDev, xDest, yDest, cx, cy, xSrc, ySrc,
111 startscan, lines, bits, info, coloruse);
113 return res;