c8e3b91ad97187be97a2b53693fdcc42f5ca9426
2 * DIB driver initialization functions
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 "wine/port.h"
26 WINE_DEFAULT_DEBUG_CHANNEL(dibdrv
);
28 /**********************************************************************
31 BOOL
DIBDRV_CreateDC( HDC hdc
, DIBDRVPHYSDEV
**pdev
, LPCWSTR driver
, LPCWSTR device
,
32 LPCWSTR output
, const DEVMODEW
* initData
)
34 DIBDRVPHYSDEV
*physDev
;
37 TRACE("hdc:%p, pdev:%p, driver:%s, device:%s, output:%s, initData:%p\n",
38 hdc
, pdev
, debugstr_w(driver
), debugstr_w(device
), debugstr_w(output
), initData
);
40 /* allocates physical device */
41 physDev
= HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(DIBDRVPHYSDEV
) );
45 /* creates X11 physical device */
46 if(!_DIBDRV_GetDisplayDriver()->pCreateDC(hdc
, &X11PhysDev
, driver
, device
, output
, initData
))
48 HeapFree(GetProcessHeap(), 0, physDev
);
52 /* sets X11 Device pointer in DIB Engine device */
53 physDev
->X11PhysDev
= X11PhysDev
;
55 /* stock bitmap selected on DC creation */
56 physDev
->hbitmap
= GetStockObject(DEFAULT_BITMAP
);
58 /* no DIB selected into DC on creation */
59 physDev
->hasDIB
= FALSE
;
61 /* sets the result value and returns */
67 /**********************************************************************
70 BOOL
DIBDRV_DeleteDC( DIBDRVPHYSDEV
*physDev
)
74 TRACE("physDev:%p\n", physDev
);
76 /* frees X11 device */
77 res
= _DIBDRV_GetDisplayDriver()->pDeleteDC(physDev
->X11PhysDev
);
78 physDev
->X11PhysDev
= NULL
;
80 /* frees DIB Engine device */
81 HeapFree(GetProcessHeap(), 0, physDev
);
83 ONCE(FIXME("stub\n"));
87 /**********************************************************************
90 INT
DIBDRV_ExtEscape( DIBDRVPHYSDEV
*physDev
, INT escape
, INT in_count
, LPCVOID in_data
,
91 INT out_count
, LPVOID out_data
)
95 TRACE("physDev:%p, escape:%d, in_count:%d, in_data:%p, out_count:%d, out_data:%p\n",
96 physDev
, escape
, in_count
, in_data
, out_count
, out_data
);
100 /* DIB section selected in, use DIB Engine */
101 ONCE(FIXME("TEMPORARY - fallback to X11 driver\n"));
102 res
= _DIBDRV_GetDisplayDriver()->pExtEscape(physDev
->X11PhysDev
, escape
, in_count
, in_data
, out_count
, out_data
);
106 /* DDB selected in, use X11 driver */
107 res
= _DIBDRV_GetDisplayDriver()->pExtEscape(physDev
->X11PhysDev
, escape
, in_count
, in_data
, out_count
, out_data
);
112 /***********************************************************************
113 * DIBDRV_GetDeviceCaps
115 INT
DIBDRV_GetDeviceCaps( DIBDRVPHYSDEV
*physDev
, INT cap
)
119 TRACE("physDev:%p, cap:%d\n", physDev
, cap
);
123 /* DIB section selected in, use DIB Engine */
124 ONCE(FIXME("TEMPORARY - fallback to X11 driver\n"));
125 res
= _DIBDRV_GetDisplayDriver()->pGetDeviceCaps(physDev
->X11PhysDev
, cap
);
129 /* DDB selected in, use X11 driver */
130 res
= _DIBDRV_GetDisplayDriver()->pGetDeviceCaps(physDev
->X11PhysDev
, cap
);