2001-07-27 21:37:31 +02:00
|
|
|
/*
|
|
|
|
* Graphics driver management functions
|
|
|
|
*
|
2004-02-12 03:17:51 +01:00
|
|
|
* Copyright 1994 Bob Amstadt
|
|
|
|
* Copyright 1996, 2001 Alexandre Julliard
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2001-07-27 21:37:31 +02:00
|
|
|
*/
|
|
|
|
|
2002-08-31 21:04:14 +02:00
|
|
|
#include "config.h"
|
|
|
|
#include "wine/port.h"
|
|
|
|
|
2011-03-16 21:45:39 +01:00
|
|
|
#include <assert.h>
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
2001-07-27 21:37:31 +02:00
|
|
|
#include <string.h>
|
2005-05-06 21:38:50 +02:00
|
|
|
#include <stdio.h>
|
2003-09-06 01:08:26 +02:00
|
|
|
#include "windef.h"
|
2001-07-27 21:37:31 +02:00
|
|
|
#include "winbase.h"
|
|
|
|
#include "winreg.h"
|
2009-06-05 18:58:55 +02:00
|
|
|
#include "ddrawgdi.h"
|
2009-12-05 11:45:31 +01:00
|
|
|
#include "wine/winbase16.h"
|
2001-07-27 21:37:31 +02:00
|
|
|
|
2004-01-15 01:35:38 +01:00
|
|
|
#include "gdi_private.h"
|
2003-08-12 22:42:18 +02:00
|
|
|
#include "wine/unicode.h"
|
2010-04-20 13:20:49 +02:00
|
|
|
#include "wine/list.h"
|
2002-03-10 00:29:33 +01:00
|
|
|
#include "wine/debug.h"
|
2001-07-27 21:37:31 +02:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(driver);
|
2001-07-27 21:37:31 +02:00
|
|
|
|
|
|
|
struct graphics_driver
|
|
|
|
{
|
2011-07-13 14:18:26 +02:00
|
|
|
struct list entry;
|
|
|
|
HMODULE module; /* module handle */
|
|
|
|
const struct gdi_dc_funcs *funcs;
|
2001-07-27 21:37:31 +02:00
|
|
|
};
|
|
|
|
|
2010-04-20 13:20:49 +02:00
|
|
|
static struct list drivers = LIST_INIT( drivers );
|
2001-07-27 21:37:31 +02:00
|
|
|
static struct graphics_driver *display_driver;
|
2003-08-13 01:50:54 +02:00
|
|
|
|
|
|
|
static CRITICAL_SECTION driver_section;
|
|
|
|
static CRITICAL_SECTION_DEBUG critsect_debug =
|
|
|
|
{
|
|
|
|
0, 0, &driver_section,
|
|
|
|
{ &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
|
2005-09-09 12:19:44 +02:00
|
|
|
0, 0, { (DWORD_PTR)(__FILE__ ": driver_section") }
|
2003-08-13 01:50:54 +02:00
|
|
|
};
|
|
|
|
static CRITICAL_SECTION driver_section = { &critsect_debug, -1, 0, 0, 0, 0 };
|
2001-07-27 21:37:31 +02:00
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* create_driver
|
|
|
|
*
|
|
|
|
* Allocate and fill the driver structure for a given module.
|
|
|
|
*/
|
|
|
|
static struct graphics_driver *create_driver( HMODULE module )
|
|
|
|
{
|
2011-07-13 14:18:26 +02:00
|
|
|
static const struct gdi_dc_funcs empty_funcs;
|
|
|
|
const struct gdi_dc_funcs *funcs = NULL;
|
2001-07-27 21:37:31 +02:00
|
|
|
struct graphics_driver *driver;
|
|
|
|
|
|
|
|
if (!(driver = HeapAlloc( GetProcessHeap(), 0, sizeof(*driver)))) return NULL;
|
|
|
|
driver->module = module;
|
|
|
|
|
2005-10-31 16:43:10 +01:00
|
|
|
if (module)
|
|
|
|
{
|
2011-07-13 14:18:26 +02:00
|
|
|
const struct gdi_dc_funcs * (CDECL *wine_get_gdi_driver)( unsigned int version );
|
2006-10-03 19:52:17 +02:00
|
|
|
|
2011-07-13 14:18:26 +02:00
|
|
|
if ((wine_get_gdi_driver = (void *)GetProcAddress( module, "wine_get_gdi_driver" )))
|
|
|
|
funcs = wine_get_gdi_driver( WINE_GDI_DRIVER_VERSION );
|
2005-10-31 16:43:10 +01:00
|
|
|
}
|
2011-07-13 14:18:26 +02:00
|
|
|
if (!funcs) funcs = &empty_funcs;
|
|
|
|
driver->funcs = funcs;
|
2001-07-27 21:37:31 +02:00
|
|
|
return driver;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************
|
2010-05-06 13:50:30 +02:00
|
|
|
* DRIVER_get_display_driver
|
2001-07-27 21:37:31 +02:00
|
|
|
*
|
|
|
|
* Special case for loading the display driver: get the name from the config file
|
|
|
|
*/
|
2010-05-06 13:50:30 +02:00
|
|
|
const DC_FUNCTIONS *DRIVER_get_display_driver(void)
|
2001-07-27 21:37:31 +02:00
|
|
|
{
|
2010-05-06 13:48:24 +02:00
|
|
|
struct graphics_driver *driver;
|
2005-05-06 21:38:50 +02:00
|
|
|
char buffer[MAX_PATH], libname[32], *name, *next;
|
2004-07-13 05:53:55 +02:00
|
|
|
HMODULE module = 0;
|
2001-07-27 21:37:31 +02:00
|
|
|
HKEY hkey;
|
|
|
|
|
2011-07-13 14:18:26 +02:00
|
|
|
if (display_driver) return display_driver->funcs; /* already loaded */
|
2001-07-27 21:37:31 +02:00
|
|
|
|
2005-10-31 16:43:10 +01:00
|
|
|
strcpy( buffer, "x11" ); /* default value */
|
2005-06-20 18:04:32 +02:00
|
|
|
/* @@ Wine registry key: HKCU\Software\Wine\Drivers */
|
|
|
|
if (!RegOpenKeyA( HKEY_CURRENT_USER, "Software\\Wine\\Drivers", &hkey ))
|
2001-07-27 21:37:31 +02:00
|
|
|
{
|
|
|
|
DWORD type, count = sizeof(buffer);
|
2005-07-05 13:02:37 +02:00
|
|
|
RegQueryValueExA( hkey, "Graphics", 0, &type, (LPBYTE) buffer, &count );
|
2001-07-27 21:37:31 +02:00
|
|
|
RegCloseKey( hkey );
|
|
|
|
}
|
|
|
|
|
2004-07-13 05:53:55 +02:00
|
|
|
name = buffer;
|
|
|
|
while (name)
|
|
|
|
{
|
|
|
|
next = strchr( name, ',' );
|
|
|
|
if (next) *next++ = 0;
|
|
|
|
|
2005-05-06 21:38:50 +02:00
|
|
|
snprintf( libname, sizeof(libname), "wine%s.drv", name );
|
|
|
|
if ((module = LoadLibraryA( libname )) != 0) break;
|
2004-07-13 05:53:55 +02:00
|
|
|
name = next;
|
|
|
|
}
|
2001-07-27 21:37:31 +02:00
|
|
|
|
2010-05-06 13:48:24 +02:00
|
|
|
if (!(driver = create_driver( module )))
|
2001-07-27 21:37:31 +02:00
|
|
|
{
|
|
|
|
MESSAGE( "Could not create graphics driver '%s'\n", buffer );
|
|
|
|
FreeLibrary( module );
|
2004-07-13 05:53:55 +02:00
|
|
|
ExitProcess(1);
|
2001-07-27 21:37:31 +02:00
|
|
|
}
|
2010-05-06 13:48:24 +02:00
|
|
|
if (InterlockedCompareExchangePointer( (void **)&display_driver, driver, NULL ))
|
|
|
|
{
|
|
|
|
/* somebody beat us to it */
|
|
|
|
FreeLibrary( driver->module );
|
|
|
|
HeapFree( GetProcessHeap(), 0, driver );
|
|
|
|
}
|
2011-07-13 14:18:26 +02:00
|
|
|
return display_driver->funcs;
|
2001-07-27 21:37:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* DRIVER_load_driver
|
|
|
|
*/
|
2003-08-12 22:42:18 +02:00
|
|
|
const DC_FUNCTIONS *DRIVER_load_driver( LPCWSTR name )
|
2001-07-27 21:37:31 +02:00
|
|
|
{
|
|
|
|
HMODULE module;
|
2010-05-06 13:48:24 +02:00
|
|
|
struct graphics_driver *driver, *new_driver;
|
2003-08-12 22:42:18 +02:00
|
|
|
static const WCHAR displayW[] = { 'd','i','s','p','l','a','y',0 };
|
2006-01-03 12:05:54 +01:00
|
|
|
static const WCHAR display1W[] = {'\\','\\','.','\\','D','I','S','P','L','A','Y','1',0};
|
2001-07-27 21:37:31 +02:00
|
|
|
|
|
|
|
/* display driver is a special case */
|
2010-05-06 13:50:30 +02:00
|
|
|
if (!strcmpiW( name, displayW ) || !strcmpiW( name, display1W )) return DRIVER_get_display_driver();
|
|
|
|
|
2003-08-12 22:42:18 +02:00
|
|
|
if ((module = GetModuleHandleW( name )))
|
2001-07-27 21:37:31 +02:00
|
|
|
{
|
2011-07-13 14:18:26 +02:00
|
|
|
if (display_driver && display_driver->module == module) return display_driver->funcs;
|
2010-05-06 13:48:24 +02:00
|
|
|
EnterCriticalSection( &driver_section );
|
2010-04-20 13:20:49 +02:00
|
|
|
LIST_FOR_EACH_ENTRY( driver, &drivers, struct graphics_driver, entry )
|
2001-07-27 21:37:31 +02:00
|
|
|
{
|
2010-05-06 13:48:24 +02:00
|
|
|
if (driver->module == module) goto done;
|
2001-07-27 21:37:31 +02:00
|
|
|
}
|
2010-05-06 13:48:24 +02:00
|
|
|
LeaveCriticalSection( &driver_section );
|
2001-07-27 21:37:31 +02:00
|
|
|
}
|
|
|
|
|
2010-05-06 13:48:24 +02:00
|
|
|
if (!(module = LoadLibraryW( name ))) return NULL;
|
|
|
|
|
|
|
|
if (!(new_driver = create_driver( module )))
|
2001-07-27 21:37:31 +02:00
|
|
|
{
|
2010-05-06 13:48:24 +02:00
|
|
|
FreeLibrary( module );
|
2003-02-27 01:11:54 +01:00
|
|
|
return NULL;
|
2001-07-27 21:37:31 +02:00
|
|
|
}
|
|
|
|
|
2010-05-06 13:48:24 +02:00
|
|
|
/* check if someone else added it in the meantime */
|
|
|
|
EnterCriticalSection( &driver_section );
|
|
|
|
LIST_FOR_EACH_ENTRY( driver, &drivers, struct graphics_driver, entry )
|
2001-07-27 21:37:31 +02:00
|
|
|
{
|
2010-05-06 13:48:24 +02:00
|
|
|
if (driver->module != module) continue;
|
2001-07-27 21:37:31 +02:00
|
|
|
FreeLibrary( module );
|
2010-05-06 13:48:24 +02:00
|
|
|
HeapFree( GetProcessHeap(), 0, new_driver );
|
|
|
|
goto done;
|
2001-07-27 21:37:31 +02:00
|
|
|
}
|
2010-05-06 13:48:24 +02:00
|
|
|
driver = new_driver;
|
|
|
|
list_add_head( &drivers, &driver->entry );
|
2003-08-12 22:42:18 +02:00
|
|
|
TRACE( "loaded driver %p for %s\n", driver, debugstr_w(name) );
|
2010-05-06 13:48:24 +02:00
|
|
|
done:
|
2003-04-01 02:12:50 +02:00
|
|
|
LeaveCriticalSection( &driver_section );
|
2011-07-13 14:18:26 +02:00
|
|
|
return driver->funcs;
|
2001-07-27 21:37:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static INT nulldrv_AbortDoc( PHYSDEV dev )
|
2011-03-08 21:36:52 +01:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_AlphaBlend( PHYSDEV dst_dev, struct bitblt_coords *dst,
|
|
|
|
PHYSDEV src_dev, struct bitblt_coords *src, BLENDFUNCTION func)
|
2011-03-18 12:59:26 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
|
|
|
|
INT xstart, INT ystart, INT xend, INT yend )
|
2011-03-08 20:30:03 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static INT nulldrv_ChoosePixelFormat( PHYSDEV dev, const PIXELFORMATDESCRIPTOR *descr )
|
2011-03-11 12:26:25 +01:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_Chord( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
|
|
|
|
INT xstart, INT ystart, INT xend, INT yend )
|
2011-03-08 20:30:03 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_CreateBitmap( PHYSDEV dev, HBITMAP bitmap, LPVOID bits )
|
2011-03-15 19:51:06 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_CreateDC( HDC hdc, PHYSDEV *dev, LPCWSTR driver, LPCWSTR device,
|
|
|
|
LPCWSTR output, const DEVMODEW *devmode )
|
2011-03-16 21:45:39 +01:00
|
|
|
{
|
|
|
|
assert(0); /* should never be called */
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static HBITMAP nulldrv_CreateDIBSection( PHYSDEV dev, HBITMAP bitmap, const BITMAPINFO *info, UINT usage )
|
2011-03-16 21:14:24 +01:00
|
|
|
{
|
|
|
|
return bitmap;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_DeleteBitmap( HBITMAP bitmap )
|
2011-03-15 19:51:06 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_DeleteDC( PHYSDEV dev )
|
2011-03-16 21:45:39 +01:00
|
|
|
{
|
|
|
|
assert(0); /* should never be called */
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_DeleteObject( PHYSDEV dev, HGDIOBJ obj )
|
2011-03-09 21:19:09 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static INT nulldrv_DescribePixelFormat( PHYSDEV dev, INT format, UINT size, PIXELFORMATDESCRIPTOR * descr )
|
2011-03-11 12:26:25 +01:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static DWORD nulldrv_DeviceCapabilities( LPSTR buffer, LPCSTR device, LPCSTR port,
|
|
|
|
WORD cap, LPSTR output, DEVMODEA *devmode )
|
2011-03-11 12:15:38 +01:00
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_Ellipse( PHYSDEV dev, INT left, INT top, INT right, INT bottom )
|
2011-03-08 20:30:03 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static INT nulldrv_EndDoc( PHYSDEV dev )
|
2011-03-08 21:36:52 +01:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static INT nulldrv_EndPage( PHYSDEV dev )
|
2011-03-08 21:36:52 +01:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_EnumDeviceFonts( PHYSDEV dev, LOGFONTW *logfont, FONTENUMPROCW proc, LPARAM lParam )
|
2011-03-15 20:42:49 +01:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static INT nulldrv_EnumICMProfiles( PHYSDEV dev, ICMENUMPROCW func, LPARAM lparam )
|
2011-03-11 12:33:34 +01:00
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static INT nulldrv_ExtDeviceMode( LPSTR buffer, HWND hwnd, DEVMODEA *output, LPSTR device,
|
|
|
|
LPSTR port, DEVMODEA *input, LPSTR profile, DWORD mode )
|
2011-03-11 12:15:38 +01:00
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static INT nulldrv_ExtEscape( PHYSDEV dev, INT escape, INT in_size, const void *in_data,
|
2011-03-11 12:15:38 +01:00
|
|
|
INT out_size, void *out_data )
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT type )
|
2011-03-08 20:30:03 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const RECT *rect,
|
|
|
|
LPCWSTR str, UINT count, const INT *dx )
|
2011-03-15 20:42:49 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_GdiComment( PHYSDEV dev, UINT size, const BYTE *data )
|
2011-03-11 12:15:38 +01:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_GetCharWidth( PHYSDEV dev, UINT first, UINT last, INT *buffer )
|
2011-03-15 20:42:49 +01:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static INT nulldrv_GetDeviceCaps( PHYSDEV dev, INT cap )
|
2011-03-16 22:04:51 +01:00
|
|
|
{
|
|
|
|
switch (cap) /* return meaningful values for some entries */
|
|
|
|
{
|
|
|
|
case HORZRES: return 640;
|
|
|
|
case VERTRES: return 480;
|
|
|
|
case BITSPIXEL: return 1;
|
|
|
|
case PLANES: return 1;
|
|
|
|
case NUMCOLORS: return 2;
|
|
|
|
case ASPECTX: return 36;
|
|
|
|
case ASPECTY: return 36;
|
|
|
|
case ASPECTXY: return 51;
|
|
|
|
case LOGPIXELSX: return 72;
|
|
|
|
case LOGPIXELSY: return 72;
|
|
|
|
case SIZEPALETTE: return 2;
|
|
|
|
case TEXTCAPS: return (TC_OP_CHARACTER | TC_OP_STROKE | TC_CP_STROKE |
|
|
|
|
TC_CR_ANY | TC_SF_X_YINDEP | TC_SA_DOUBLE | TC_SA_INTEGER |
|
|
|
|
TC_SA_CONTIN | TC_UA_ABLE | TC_SO_ABLE | TC_RA_ABLE | TC_VA_ABLE);
|
|
|
|
default: return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_GetDeviceGammaRamp( PHYSDEV dev, void *ramp )
|
2011-03-11 12:33:34 +01:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_GetICMProfile( PHYSDEV dev, LPDWORD size, LPWSTR filename )
|
2011-03-11 12:33:34 +01:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2011-07-14 11:30:58 +02:00
|
|
|
static DWORD nulldrv_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info,
|
|
|
|
struct gdi_image_bits *bits, const RECT *rect )
|
|
|
|
{
|
|
|
|
return ERROR_NOT_SUPPORTED;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static COLORREF nulldrv_GetPixel( PHYSDEV dev, INT x, INT y )
|
2011-03-08 20:30:03 +01:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static INT nulldrv_GetPixelFormat( PHYSDEV dev )
|
2011-03-11 12:26:25 +01:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static UINT nulldrv_GetSystemPaletteEntries( PHYSDEV dev, UINT start, UINT count, PALETTEENTRY *entries )
|
2011-03-11 18:26:55 +01:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_GetTextExtentExPoint( PHYSDEV dev, LPCWSTR str, INT count, INT max_ext,
|
|
|
|
INT *fit, INT *dx, SIZE *size )
|
2011-03-15 20:42:49 +01:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_GetTextMetrics( PHYSDEV dev, TEXTMETRICW *metrics )
|
2011-03-15 20:42:49 +01:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_LineTo( PHYSDEV dev, INT x, INT y )
|
2011-03-08 20:30:03 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_MoveTo( PHYSDEV dev, INT x, INT y )
|
2011-03-08 20:30:03 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_PaintRgn( PHYSDEV dev, HRGN rgn )
|
2011-03-08 20:30:03 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_PatBlt( PHYSDEV dev, struct bitblt_coords *dst, DWORD rop )
|
2011-03-17 14:54:56 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_Pie( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
|
|
|
|
INT xstart, INT ystart, INT xend, INT yend )
|
2011-03-08 20:30:03 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_PolyPolygon( PHYSDEV dev, const POINT *points, const INT *counts, UINT polygons )
|
2011-03-08 20:30:03 +01:00
|
|
|
{
|
|
|
|
/* FIXME: could be implemented with Polygon */
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_PolyPolyline( PHYSDEV dev, const POINT *points, const DWORD *counts, DWORD lines )
|
2011-03-08 20:30:03 +01:00
|
|
|
{
|
|
|
|
/* FIXME: could be implemented with Polyline */
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_Polygon( PHYSDEV dev, const POINT *points, INT count )
|
2011-03-08 20:30:03 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_Polyline( PHYSDEV dev, const POINT *points, INT count )
|
2011-03-08 20:30:03 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2011-07-14 11:30:58 +02:00
|
|
|
static DWORD nulldrv_PutImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info,
|
|
|
|
const struct gdi_image_bits *bits, const RECT *rect, DWORD rop )
|
|
|
|
{
|
|
|
|
return ERROR_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static UINT nulldrv_RealizeDefaultPalette( PHYSDEV dev )
|
2011-03-11 18:26:55 +01:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static UINT nulldrv_RealizePalette( PHYSDEV dev, HPALETTE palette, BOOL primary )
|
2011-03-11 18:26:55 +01:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_Rectangle( PHYSDEV dev, INT left, INT top, INT right, INT bottom )
|
2011-03-08 20:30:03 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static HDC nulldrv_ResetDC( PHYSDEV dev, const DEVMODEW *devmode )
|
2011-03-15 20:17:58 +01:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
|
|
|
|
INT ell_width, INT ell_height )
|
2011-03-08 20:30:03 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static HBITMAP nulldrv_SelectBitmap( PHYSDEV dev, HBITMAP bitmap )
|
2011-03-09 21:19:09 +01:00
|
|
|
{
|
|
|
|
return bitmap;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static HBRUSH nulldrv_SelectBrush( PHYSDEV dev, HBRUSH brush )
|
2011-03-09 21:19:09 +01:00
|
|
|
{
|
|
|
|
return brush;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static HFONT nulldrv_SelectFont( PHYSDEV dev, HFONT font, HANDLE gdi_font )
|
2011-03-09 21:19:09 +01:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static HPALETTE nulldrv_SelectPalette( PHYSDEV dev, HPALETTE palette, BOOL bkgnd )
|
2011-03-09 21:19:09 +01:00
|
|
|
{
|
|
|
|
return palette;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static HPEN nulldrv_SelectPen( PHYSDEV dev, HPEN pen )
|
2011-03-09 21:19:09 +01:00
|
|
|
{
|
|
|
|
return pen;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static INT nulldrv_SetArcDirection( PHYSDEV dev, INT dir )
|
2011-03-10 21:58:47 +01:00
|
|
|
{
|
|
|
|
return dir;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static COLORREF nulldrv_SetBkColor( PHYSDEV dev, COLORREF color )
|
2011-03-10 21:58:47 +01:00
|
|
|
{
|
|
|
|
return color;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static INT nulldrv_SetBkMode( PHYSDEV dev, INT mode )
|
2011-03-10 21:58:47 +01:00
|
|
|
{
|
|
|
|
return mode;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static COLORREF nulldrv_SetDCBrushColor( PHYSDEV dev, COLORREF color )
|
2011-03-10 20:42:05 +01:00
|
|
|
{
|
|
|
|
return color;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static COLORREF nulldrv_SetDCPenColor( PHYSDEV dev, COLORREF color )
|
2011-03-10 20:42:05 +01:00
|
|
|
{
|
|
|
|
return color;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static UINT nulldrv_SetDIBColorTable( PHYSDEV dev, UINT pos, UINT count, const RGBQUAD *colors )
|
2011-03-16 21:14:24 +01:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static INT nulldrv_SetDIBitsToDevice( PHYSDEV dev, INT x_dst, INT y_dst, DWORD width, DWORD height,
|
|
|
|
INT x_src, INT y_src, UINT start, UINT lines,
|
|
|
|
const void *bits, const BITMAPINFO *info, UINT coloruse )
|
2011-03-16 21:14:24 +01:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static void nulldrv_SetDeviceClipping( PHYSDEV dev, HRGN vis_rgn, HRGN clip_rgn )
|
2011-03-09 16:21:45 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static DWORD nulldrv_SetLayout( PHYSDEV dev, DWORD layout )
|
2011-03-10 22:10:16 +01:00
|
|
|
{
|
|
|
|
return layout;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_SetDeviceGammaRamp( PHYSDEV dev, void *ramp )
|
2011-03-11 12:33:34 +01:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static DWORD nulldrv_SetMapperFlags( PHYSDEV dev, DWORD flags )
|
2011-03-10 21:58:47 +01:00
|
|
|
{
|
|
|
|
return flags;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static COLORREF nulldrv_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color )
|
2011-03-08 20:30:03 +01:00
|
|
|
{
|
|
|
|
return color;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_SetPixelFormat( PHYSDEV dev, INT format, const PIXELFORMATDESCRIPTOR *descr )
|
2011-03-11 12:26:25 +01:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static INT nulldrv_SetPolyFillMode( PHYSDEV dev, INT mode )
|
2011-03-10 21:58:47 +01:00
|
|
|
{
|
|
|
|
return mode;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static INT nulldrv_SetROP2( PHYSDEV dev, INT rop )
|
2011-03-10 21:58:47 +01:00
|
|
|
{
|
|
|
|
return rop;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static INT nulldrv_SetRelAbs( PHYSDEV dev, INT mode )
|
2011-03-10 21:58:47 +01:00
|
|
|
{
|
|
|
|
return mode;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static INT nulldrv_SetStretchBltMode( PHYSDEV dev, INT mode )
|
2011-03-10 21:58:47 +01:00
|
|
|
{
|
|
|
|
return mode;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static UINT nulldrv_SetTextAlign( PHYSDEV dev, UINT align )
|
2011-03-10 21:58:47 +01:00
|
|
|
{
|
|
|
|
return align;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static INT nulldrv_SetTextCharacterExtra( PHYSDEV dev, INT extra )
|
2011-03-10 21:58:47 +01:00
|
|
|
{
|
|
|
|
return extra;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static COLORREF nulldrv_SetTextColor( PHYSDEV dev, COLORREF color )
|
2011-03-10 21:58:47 +01:00
|
|
|
{
|
|
|
|
return color;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_SetTextJustification( PHYSDEV dev, INT extra, INT breaks )
|
2011-03-10 21:58:47 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static INT nulldrv_StartDoc( PHYSDEV dev, const DOCINFOW *info )
|
2011-03-08 21:36:52 +01:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static INT nulldrv_StartPage( PHYSDEV dev )
|
2011-03-08 21:36:52 +01:00
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_SwapBuffers( PHYSDEV dev )
|
2011-03-11 12:26:25 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_UnrealizePalette( HPALETTE palette )
|
2011-03-16 22:58:07 +01:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_wglCopyContext( HGLRC ctx_src, HGLRC ctx_dst, UINT mask )
|
2011-03-09 20:51:06 +01:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static HGLRC nulldrv_wglCreateContext( PHYSDEV dev )
|
2011-03-09 20:51:06 +01:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static HGLRC nulldrv_wglCreateContextAttribsARB( PHYSDEV dev, HGLRC share_ctx, const int *attribs )
|
2011-03-09 20:51:06 +01:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_wglDeleteContext( HGLRC ctx )
|
2011-03-09 20:51:06 +01:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static PROC nulldrv_wglGetProcAddress( LPCSTR name )
|
2011-03-09 20:51:06 +01:00
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static HDC nulldrv_wglGetPbufferDCARB( PHYSDEV dev, void *pbuffer )
|
2011-03-09 20:51:06 +01:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_wglMakeCurrent( PHYSDEV dev, HGLRC ctx )
|
2011-03-09 20:51:06 +01:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_wglMakeContextCurrentARB( PHYSDEV dev_draw, PHYSDEV dev_read, HGLRC ctx )
|
2011-03-09 20:51:06 +01:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_wglSetPixelFormatWINE( PHYSDEV dev, INT format, const PIXELFORMATDESCRIPTOR *descr )
|
2011-03-09 20:51:06 +01:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_wglShareLists( HGLRC ctx1, HGLRC ctx2 )
|
2011-03-09 20:51:06 +01:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_wglUseFontBitmapsA( PHYSDEV dev, DWORD start, DWORD count, DWORD base )
|
2011-03-09 20:51:06 +01:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
static BOOL nulldrv_wglUseFontBitmapsW( PHYSDEV dev, DWORD start, DWORD count, DWORD base )
|
2011-03-09 20:51:06 +01:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2011-03-08 19:37:08 +01:00
|
|
|
const DC_FUNCTIONS null_driver =
|
|
|
|
{
|
2011-03-08 21:36:52 +01:00
|
|
|
nulldrv_AbortDoc, /* pAbortDoc */
|
2011-03-11 20:43:15 +01:00
|
|
|
nulldrv_AbortPath, /* pAbortPath */
|
2011-03-18 12:59:26 +01:00
|
|
|
nulldrv_AlphaBlend, /* pAlphaBlend */
|
2011-03-08 21:15:59 +01:00
|
|
|
nulldrv_AngleArc, /* pAngleArc */
|
2011-03-08 20:30:03 +01:00
|
|
|
nulldrv_Arc, /* pArc */
|
2011-03-08 21:15:59 +01:00
|
|
|
nulldrv_ArcTo, /* pArcTo */
|
2011-03-11 20:43:15 +01:00
|
|
|
nulldrv_BeginPath, /* pBeginPath */
|
2011-03-11 12:26:25 +01:00
|
|
|
nulldrv_ChoosePixelFormat, /* pChoosePixelFormat */
|
2011-03-08 20:30:03 +01:00
|
|
|
nulldrv_Chord, /* pChord */
|
2011-03-11 20:43:15 +01:00
|
|
|
nulldrv_CloseFigure, /* pCloseFigure */
|
2011-03-15 19:51:06 +01:00
|
|
|
nulldrv_CreateBitmap, /* pCreateBitmap */
|
2011-03-16 21:45:39 +01:00
|
|
|
nulldrv_CreateDC, /* pCreateDC */
|
2011-03-16 21:14:24 +01:00
|
|
|
nulldrv_CreateDIBSection, /* pCreateDIBSection */
|
2011-03-15 19:51:06 +01:00
|
|
|
nulldrv_DeleteBitmap, /* pDeleteBitmap */
|
2011-03-16 21:45:39 +01:00
|
|
|
nulldrv_DeleteDC, /* pDeleteDC */
|
2011-03-09 21:19:09 +01:00
|
|
|
nulldrv_DeleteObject, /* pDeleteObject */
|
2011-03-11 12:26:25 +01:00
|
|
|
nulldrv_DescribePixelFormat, /* pDescribePixelFormat */
|
2011-03-11 12:15:38 +01:00
|
|
|
nulldrv_DeviceCapabilities, /* pDeviceCapabilities */
|
2011-03-08 20:30:03 +01:00
|
|
|
nulldrv_Ellipse, /* pEllipse */
|
2011-03-08 21:36:52 +01:00
|
|
|
nulldrv_EndDoc, /* pEndDoc */
|
|
|
|
nulldrv_EndPage, /* pEndPage */
|
2011-03-11 20:43:15 +01:00
|
|
|
nulldrv_EndPath, /* pEndPath */
|
2011-03-15 20:42:49 +01:00
|
|
|
nulldrv_EnumDeviceFonts, /* pEnumDeviceFonts */
|
2011-03-11 12:33:34 +01:00
|
|
|
nulldrv_EnumICMProfiles, /* pEnumICMProfiles */
|
2011-03-09 16:21:45 +01:00
|
|
|
nulldrv_ExcludeClipRect, /* pExcludeClipRect */
|
2011-03-11 12:15:38 +01:00
|
|
|
nulldrv_ExtDeviceMode, /* pExtDeviceMode */
|
|
|
|
nulldrv_ExtEscape, /* pExtEscape */
|
2011-03-08 20:30:03 +01:00
|
|
|
nulldrv_ExtFloodFill, /* pExtFloodFill */
|
2011-03-09 16:21:45 +01:00
|
|
|
nulldrv_ExtSelectClipRgn, /* pExtSelectClipRgn */
|
2011-03-15 20:42:49 +01:00
|
|
|
nulldrv_ExtTextOut, /* pExtTextOut */
|
2011-03-11 20:43:15 +01:00
|
|
|
nulldrv_FillPath, /* pFillPath */
|
2011-03-08 21:15:59 +01:00
|
|
|
nulldrv_FillRgn, /* pFillRgn */
|
2011-03-11 20:43:15 +01:00
|
|
|
nulldrv_FlattenPath, /* pFlattenPath */
|
2011-03-08 21:15:59 +01:00
|
|
|
nulldrv_FrameRgn, /* pFrameRgn */
|
2011-03-11 12:15:38 +01:00
|
|
|
nulldrv_GdiComment, /* pGdiComment */
|
2011-03-15 19:51:06 +01:00
|
|
|
nulldrv_GetBitmapBits, /* pGetBitmapBits */
|
2011-03-15 20:42:49 +01:00
|
|
|
nulldrv_GetCharWidth, /* pGetCharWidth */
|
2011-03-15 19:51:06 +01:00
|
|
|
nulldrv_GetDIBits, /* pGetDIBits */
|
2011-03-16 22:04:51 +01:00
|
|
|
nulldrv_GetDeviceCaps, /* pGetDeviceCaps */
|
2011-03-11 12:33:34 +01:00
|
|
|
nulldrv_GetDeviceGammaRamp, /* pGetDeviceGammaRamp */
|
|
|
|
nulldrv_GetICMProfile, /* pGetICMProfile */
|
2011-07-14 11:30:58 +02:00
|
|
|
nulldrv_GetImage, /* pGetImage */
|
2011-03-11 18:26:55 +01:00
|
|
|
nulldrv_GetNearestColor, /* pGetNearestColor */
|
2011-03-08 20:30:03 +01:00
|
|
|
nulldrv_GetPixel, /* pGetPixel */
|
2011-03-11 12:26:25 +01:00
|
|
|
nulldrv_GetPixelFormat, /* pGetPixelFormat */
|
2011-03-11 18:26:55 +01:00
|
|
|
nulldrv_GetSystemPaletteEntries, /* pGetSystemPaletteEntries */
|
2011-03-15 20:42:49 +01:00
|
|
|
nulldrv_GetTextExtentExPoint, /* pGetTextExtentExPoint */
|
|
|
|
nulldrv_GetTextMetrics, /* pGetTextMetrics */
|
2011-03-09 16:21:45 +01:00
|
|
|
nulldrv_IntersectClipRect, /* pIntersectClipRect */
|
2011-03-08 21:15:59 +01:00
|
|
|
nulldrv_InvertRgn, /* pInvertRgn */
|
2011-03-08 20:30:03 +01:00
|
|
|
nulldrv_LineTo, /* pLineTo */
|
2011-03-15 14:03:02 +01:00
|
|
|
nulldrv_ModifyWorldTransform, /* pModifyWorldTransform */
|
2011-03-08 20:30:03 +01:00
|
|
|
nulldrv_MoveTo, /* pMoveTo */
|
2011-03-09 16:21:45 +01:00
|
|
|
nulldrv_OffsetClipRgn, /* pOffsetClipRgn */
|
2011-03-09 16:21:45 +01:00
|
|
|
nulldrv_OffsetViewportOrgEx, /* pOffsetViewportOrg */
|
|
|
|
nulldrv_OffsetWindowOrgEx, /* pOffsetWindowOrg */
|
2011-03-08 20:30:03 +01:00
|
|
|
nulldrv_PaintRgn, /* pPaintRgn */
|
2011-03-17 14:54:56 +01:00
|
|
|
nulldrv_PatBlt, /* pPatBlt */
|
2011-03-08 20:30:03 +01:00
|
|
|
nulldrv_Pie, /* pPie */
|
2011-03-08 21:15:59 +01:00
|
|
|
nulldrv_PolyBezier, /* pPolyBezier */
|
|
|
|
nulldrv_PolyBezierTo, /* pPolyBezierTo */
|
|
|
|
nulldrv_PolyDraw, /* pPolyDraw */
|
2011-03-08 20:30:03 +01:00
|
|
|
nulldrv_PolyPolygon, /* pPolyPolygon */
|
|
|
|
nulldrv_PolyPolyline, /* pPolyPolyline */
|
|
|
|
nulldrv_Polygon, /* pPolygon */
|
|
|
|
nulldrv_Polyline, /* pPolyline */
|
2011-03-08 21:15:59 +01:00
|
|
|
nulldrv_PolylineTo, /* pPolylineTo */
|
2011-07-14 11:30:58 +02:00
|
|
|
nulldrv_PutImage, /* pPutImage */
|
2011-03-11 18:26:55 +01:00
|
|
|
nulldrv_RealizeDefaultPalette, /* pRealizeDefaultPalette */
|
|
|
|
nulldrv_RealizePalette, /* pRealizePalette */
|
2011-03-08 20:30:03 +01:00
|
|
|
nulldrv_Rectangle, /* pRectangle */
|
2011-03-15 20:17:58 +01:00
|
|
|
nulldrv_ResetDC, /* pResetDC */
|
|
|
|
nulldrv_RestoreDC, /* pRestoreDC */
|
2011-03-08 20:30:03 +01:00
|
|
|
nulldrv_RoundRect, /* pRoundRect */
|
2011-03-15 20:17:58 +01:00
|
|
|
nulldrv_SaveDC, /* pSaveDC */
|
2011-03-09 16:21:45 +01:00
|
|
|
nulldrv_ScaleViewportExtEx, /* pScaleViewportExt */
|
|
|
|
nulldrv_ScaleWindowExtEx, /* pScaleWindowExt */
|
2011-03-09 21:19:09 +01:00
|
|
|
nulldrv_SelectBitmap, /* pSelectBitmap */
|
|
|
|
nulldrv_SelectBrush, /* pSelectBrush */
|
2011-03-11 20:43:15 +01:00
|
|
|
nulldrv_SelectClipPath, /* pSelectClipPath */
|
2011-03-09 21:19:09 +01:00
|
|
|
nulldrv_SelectFont, /* pSelectFont */
|
|
|
|
nulldrv_SelectPalette, /* pSelectPalette */
|
|
|
|
nulldrv_SelectPen, /* pSelectPen */
|
2011-03-10 21:58:47 +01:00
|
|
|
nulldrv_SetArcDirection, /* pSetArcDirection */
|
2011-03-15 19:51:06 +01:00
|
|
|
nulldrv_SetBitmapBits, /* pSetBitmapBits */
|
2011-03-10 21:58:47 +01:00
|
|
|
nulldrv_SetBkColor, /* pSetBkColor */
|
|
|
|
nulldrv_SetBkMode, /* pSetBkMode */
|
2011-03-10 20:42:05 +01:00
|
|
|
nulldrv_SetDCBrushColor, /* pSetDCBrushColor */
|
|
|
|
nulldrv_SetDCPenColor, /* pSetDCPenColor */
|
2011-03-16 21:14:24 +01:00
|
|
|
nulldrv_SetDIBColorTable, /* pSetDIBColorTable */
|
2011-03-15 19:51:06 +01:00
|
|
|
nulldrv_SetDIBits, /* pSetDIBits */
|
2011-03-16 21:14:24 +01:00
|
|
|
nulldrv_SetDIBitsToDevice, /* pSetDIBitsToDevice */
|
2011-03-09 16:21:45 +01:00
|
|
|
nulldrv_SetDeviceClipping, /* pSetDeviceClipping */
|
2011-03-11 12:33:34 +01:00
|
|
|
nulldrv_SetDeviceGammaRamp, /* pSetDeviceGammaRamp */
|
2011-03-10 22:10:16 +01:00
|
|
|
nulldrv_SetLayout, /* pSetLayout */
|
2011-03-09 16:21:45 +01:00
|
|
|
nulldrv_SetMapMode, /* pSetMapMode */
|
2011-03-10 21:58:47 +01:00
|
|
|
nulldrv_SetMapperFlags, /* pSetMapperFlags */
|
2011-03-08 20:30:03 +01:00
|
|
|
nulldrv_SetPixel, /* pSetPixel */
|
2011-03-11 12:26:25 +01:00
|
|
|
nulldrv_SetPixelFormat, /* pSetPixelFormat */
|
2011-03-10 21:58:47 +01:00
|
|
|
nulldrv_SetPolyFillMode, /* pSetPolyFillMode */
|
|
|
|
nulldrv_SetROP2, /* pSetROP2 */
|
|
|
|
nulldrv_SetRelAbs, /* pSetRelAbs */
|
|
|
|
nulldrv_SetStretchBltMode, /* pSetStretchBltMode */
|
|
|
|
nulldrv_SetTextAlign, /* pSetTextAlign */
|
|
|
|
nulldrv_SetTextCharacterExtra, /* pSetTextCharacterExtra */
|
|
|
|
nulldrv_SetTextColor, /* pSetTextColor */
|
|
|
|
nulldrv_SetTextJustification, /* pSetTextJustification */
|
2011-03-09 16:21:45 +01:00
|
|
|
nulldrv_SetViewportExtEx, /* pSetViewportExt */
|
|
|
|
nulldrv_SetViewportOrgEx, /* pSetViewportOrg */
|
|
|
|
nulldrv_SetWindowExtEx, /* pSetWindowExt */
|
|
|
|
nulldrv_SetWindowOrgEx, /* pSetWindowOrg */
|
2011-03-15 14:03:02 +01:00
|
|
|
nulldrv_SetWorldTransform, /* pSetWorldTransform */
|
2011-03-08 21:36:52 +01:00
|
|
|
nulldrv_StartDoc, /* pStartDoc */
|
|
|
|
nulldrv_StartPage, /* pStartPage */
|
2011-03-18 12:59:26 +01:00
|
|
|
nulldrv_StretchBlt, /* pStretchBlt */
|
2011-03-18 12:42:56 +01:00
|
|
|
nulldrv_StretchDIBits, /* pStretchDIBits */
|
2011-03-11 20:43:15 +01:00
|
|
|
nulldrv_StrokeAndFillPath, /* pStrokeAndFillPath */
|
|
|
|
nulldrv_StrokePath, /* pStrokePath */
|
2011-03-11 12:26:25 +01:00
|
|
|
nulldrv_SwapBuffers, /* pSwapBuffers */
|
2011-03-16 22:58:07 +01:00
|
|
|
nulldrv_UnrealizePalette, /* pUnrealizePalette */
|
2011-03-11 20:43:15 +01:00
|
|
|
nulldrv_WidenPath, /* pWidenPath */
|
2011-03-09 20:51:06 +01:00
|
|
|
nulldrv_wglCopyContext, /* pwglCopyContext */
|
|
|
|
nulldrv_wglCreateContext, /* pwglCreateContext */
|
|
|
|
nulldrv_wglCreateContextAttribsARB, /* pwglCreateContextAttribsARB */
|
|
|
|
nulldrv_wglDeleteContext, /* pwglDeleteContext */
|
|
|
|
nulldrv_wglGetPbufferDCARB, /* pwglGetPbufferDCARB */
|
2011-07-13 14:22:59 +02:00
|
|
|
nulldrv_wglGetProcAddress, /* pwglGetProcAddress */
|
2011-03-09 20:51:06 +01:00
|
|
|
nulldrv_wglMakeContextCurrentARB, /* pwglMakeContextCurrentARB */
|
2011-07-13 14:22:59 +02:00
|
|
|
nulldrv_wglMakeCurrent, /* pwglMakeCurrent */
|
2011-03-09 20:51:06 +01:00
|
|
|
nulldrv_wglSetPixelFormatWINE, /* pwglSetPixelFormatWINE */
|
|
|
|
nulldrv_wglShareLists, /* pwglShareLists */
|
|
|
|
nulldrv_wglUseFontBitmapsA, /* pwglUseFontBitmapsA */
|
|
|
|
nulldrv_wglUseFontBitmapsW, /* pwglUseFontBitmapsW */
|
2011-03-08 19:37:08 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2001-07-27 21:37:31 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
* DRIVER_GetDriverName
|
|
|
|
*
|
|
|
|
*/
|
2003-08-12 22:42:18 +02:00
|
|
|
BOOL DRIVER_GetDriverName( LPCWSTR device, LPWSTR driver, DWORD size )
|
2001-07-27 21:37:31 +02:00
|
|
|
{
|
2003-08-12 22:42:18 +02:00
|
|
|
static const WCHAR displayW[] = { 'd','i','s','p','l','a','y',0 };
|
|
|
|
static const WCHAR devicesW[] = { 'd','e','v','i','c','e','s',0 };
|
2006-03-18 19:20:03 +01:00
|
|
|
static const WCHAR display1W[] = {'\\','\\','.','\\','D','I','S','P','L','A','Y','1',0};
|
2003-08-12 22:42:18 +02:00
|
|
|
static const WCHAR empty_strW[] = { 0 };
|
|
|
|
WCHAR *p;
|
2003-06-23 22:51:41 +02:00
|
|
|
|
|
|
|
/* display is a special case */
|
2006-03-18 19:20:03 +01:00
|
|
|
if (!strcmpiW( device, displayW ) ||
|
|
|
|
!strcmpiW( device, display1W ))
|
2003-06-23 22:51:41 +02:00
|
|
|
{
|
2003-08-12 22:42:18 +02:00
|
|
|
lstrcpynW( driver, displayW, size );
|
2003-06-23 22:51:41 +02:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2003-08-12 22:42:18 +02:00
|
|
|
size = GetProfileStringW(devicesW, device, empty_strW, driver, size);
|
2001-07-27 21:37:31 +02:00
|
|
|
if(!size) {
|
2003-08-12 22:42:18 +02:00
|
|
|
WARN("Unable to find %s in [devices] section of win.ini\n", debugstr_w(device));
|
2001-07-27 21:37:31 +02:00
|
|
|
return FALSE;
|
|
|
|
}
|
2003-08-12 22:42:18 +02:00
|
|
|
p = strchrW(driver, ',');
|
2001-07-27 21:37:31 +02:00
|
|
|
if(!p)
|
|
|
|
{
|
2003-08-12 22:42:18 +02:00
|
|
|
WARN("%s entry in [devices] section of win.ini is malformed.\n", debugstr_w(device));
|
2001-07-27 21:37:31 +02:00
|
|
|
return FALSE;
|
|
|
|
}
|
2003-08-12 22:42:18 +02:00
|
|
|
*p = 0;
|
|
|
|
TRACE("Found %s for %s\n", debugstr_w(driver), debugstr_w(device));
|
2001-07-27 21:37:31 +02:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2003-08-12 22:42:18 +02:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* GdiConvertToDevmodeW (GDI32.@)
|
|
|
|
*/
|
|
|
|
DEVMODEW * WINAPI GdiConvertToDevmodeW(const DEVMODEA *dmA)
|
|
|
|
{
|
|
|
|
DEVMODEW *dmW;
|
2007-12-19 04:43:05 +01:00
|
|
|
WORD dmW_size, dmA_size;
|
2003-08-12 22:42:18 +02:00
|
|
|
|
2007-12-19 04:43:05 +01:00
|
|
|
dmA_size = dmA->dmSize;
|
2007-12-20 07:49:59 +01:00
|
|
|
|
|
|
|
/* this is the minimal dmSize that XP accepts */
|
|
|
|
if (dmA_size < FIELD_OFFSET(DEVMODEA, dmFields))
|
|
|
|
return NULL;
|
|
|
|
|
2007-12-19 04:43:05 +01:00
|
|
|
if (dmA_size > sizeof(DEVMODEA))
|
|
|
|
dmA_size = sizeof(DEVMODEA);
|
2007-12-18 13:21:40 +01:00
|
|
|
|
2007-12-19 04:43:05 +01:00
|
|
|
dmW_size = dmA_size + CCHDEVICENAME;
|
|
|
|
if (dmA_size >= FIELD_OFFSET(DEVMODEA, dmFormName) + CCHFORMNAME)
|
2003-08-12 22:42:18 +02:00
|
|
|
dmW_size += CCHFORMNAME;
|
|
|
|
|
|
|
|
dmW = HeapAlloc(GetProcessHeap(), 0, dmW_size + dmA->dmDriverExtra);
|
|
|
|
if (!dmW) return NULL;
|
|
|
|
|
2008-06-22 23:22:06 +02:00
|
|
|
MultiByteToWideChar(CP_ACP, 0, (const char*) dmA->dmDeviceName, -1,
|
2003-08-12 22:42:18 +02:00
|
|
|
dmW->dmDeviceName, CCHDEVICENAME);
|
|
|
|
/* copy slightly more, to avoid long computations */
|
2007-12-19 04:43:05 +01:00
|
|
|
memcpy(&dmW->dmSpecVersion, &dmA->dmSpecVersion, dmA_size - CCHDEVICENAME);
|
2003-08-12 22:42:18 +02:00
|
|
|
|
2007-12-19 04:43:05 +01:00
|
|
|
if (dmA_size >= FIELD_OFFSET(DEVMODEA, dmFormName) + CCHFORMNAME)
|
2003-08-12 22:42:18 +02:00
|
|
|
{
|
2008-06-22 23:22:06 +02:00
|
|
|
if (dmA->dmFields & DM_FORMNAME)
|
|
|
|
MultiByteToWideChar(CP_ACP, 0, (const char*) dmA->dmFormName, -1,
|
2003-08-12 22:42:18 +02:00
|
|
|
dmW->dmFormName, CCHFORMNAME);
|
2008-06-22 23:22:06 +02:00
|
|
|
else
|
|
|
|
dmW->dmFormName[0] = 0;
|
|
|
|
|
2007-12-19 04:43:05 +01:00
|
|
|
if (dmA_size > FIELD_OFFSET(DEVMODEA, dmLogPixels))
|
|
|
|
memcpy(&dmW->dmLogPixels, &dmA->dmLogPixels, dmA_size - FIELD_OFFSET(DEVMODEA, dmLogPixels));
|
2003-08-12 22:42:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (dmA->dmDriverExtra)
|
2007-12-19 04:43:05 +01:00
|
|
|
memcpy((char *)dmW + dmW_size, (const char *)dmA + dmA_size, dmA->dmDriverExtra);
|
2003-08-12 22:42:18 +02:00
|
|
|
|
|
|
|
dmW->dmSize = dmW_size;
|
|
|
|
|
|
|
|
return dmW;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-07-27 21:37:31 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
* @ [GDI32.100]
|
|
|
|
*
|
|
|
|
* This should thunk to 16-bit and simply call the proc with the given args.
|
|
|
|
*/
|
|
|
|
INT WINAPI GDI_CallDevInstall16( FARPROC16 lpfnDevInstallProc, HWND hWnd,
|
|
|
|
LPSTR lpModelName, LPSTR OldPort, LPSTR NewPort )
|
|
|
|
{
|
2002-11-22 23:16:53 +01:00
|
|
|
FIXME("(%p, %p, %s, %s, %s)\n", lpfnDevInstallProc, hWnd, lpModelName, OldPort, NewPort );
|
2001-07-27 21:37:31 +02:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* @ [GDI32.101]
|
|
|
|
*
|
|
|
|
* This should load the correct driver for lpszDevice and calls this driver's
|
2002-06-01 01:06:46 +02:00
|
|
|
* ExtDeviceModePropSheet proc.
|
2001-07-27 21:37:31 +02:00
|
|
|
*
|
2002-06-01 01:06:46 +02:00
|
|
|
* Note: The driver calls a callback routine for each property sheet page; these
|
2001-07-27 21:37:31 +02:00
|
|
|
* pages are supposed to be filled into the structure pointed to by lpPropSheet.
|
|
|
|
* The layout of this structure is:
|
2002-06-01 01:06:46 +02:00
|
|
|
*
|
2001-07-27 21:37:31 +02:00
|
|
|
* struct
|
|
|
|
* {
|
|
|
|
* DWORD nPages;
|
|
|
|
* DWORD unknown;
|
|
|
|
* HPROPSHEETPAGE pages[10];
|
|
|
|
* };
|
|
|
|
*/
|
|
|
|
INT WINAPI GDI_CallExtDeviceModePropSheet16( HWND hWnd, LPCSTR lpszDevice,
|
|
|
|
LPCSTR lpszPort, LPVOID lpPropSheet )
|
|
|
|
{
|
2002-11-22 23:16:53 +01:00
|
|
|
FIXME("(%p, %s, %s, %p)\n", hWnd, lpszDevice, lpszPort, lpPropSheet );
|
2001-07-27 21:37:31 +02:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* @ [GDI32.102]
|
|
|
|
*
|
2009-02-11 13:35:25 +01:00
|
|
|
* This should load the correct driver for lpszDevice and call this driver's
|
2001-07-27 21:37:31 +02:00
|
|
|
* ExtDeviceMode proc.
|
2003-08-12 22:42:18 +02:00
|
|
|
*
|
|
|
|
* FIXME: convert ExtDeviceMode to unicode in the driver interface
|
2001-07-27 21:37:31 +02:00
|
|
|
*/
|
|
|
|
INT WINAPI GDI_CallExtDeviceMode16( HWND hwnd,
|
|
|
|
LPDEVMODEA lpdmOutput, LPSTR lpszDevice,
|
|
|
|
LPSTR lpszPort, LPDEVMODEA lpdmInput,
|
|
|
|
LPSTR lpszProfile, DWORD fwMode )
|
|
|
|
{
|
2003-08-12 22:42:18 +02:00
|
|
|
WCHAR deviceW[300];
|
|
|
|
WCHAR bufW[300];
|
2001-07-27 21:37:31 +02:00
|
|
|
char buf[300];
|
|
|
|
HDC hdc;
|
|
|
|
DC *dc;
|
|
|
|
INT ret = -1;
|
|
|
|
|
2006-10-12 22:56:56 +02:00
|
|
|
TRACE("(%p, %p, %s, %s, %p, %s, %d)\n",
|
2001-07-27 21:37:31 +02:00
|
|
|
hwnd, lpdmOutput, lpszDevice, lpszPort, lpdmInput, lpszProfile, fwMode );
|
|
|
|
|
2003-08-12 22:42:18 +02:00
|
|
|
if (!lpszDevice) return -1;
|
|
|
|
if (!MultiByteToWideChar(CP_ACP, 0, lpszDevice, -1, deviceW, 300)) return -1;
|
|
|
|
|
|
|
|
if(!DRIVER_GetDriverName( deviceW, bufW, 300 )) return -1;
|
|
|
|
|
|
|
|
if (!WideCharToMultiByte(CP_ACP, 0, bufW, -1, buf, 300, NULL, NULL)) return -1;
|
2001-07-27 21:37:31 +02:00
|
|
|
|
2001-07-31 19:25:47 +02:00
|
|
|
if (!(hdc = CreateICA( buf, lpszDevice, lpszPort, NULL ))) return -1;
|
2001-07-27 21:37:31 +02:00
|
|
|
|
2007-09-24 18:23:42 +02:00
|
|
|
if ((dc = get_dc_ptr( hdc )))
|
2001-07-27 21:37:31 +02:00
|
|
|
{
|
2011-03-11 12:15:38 +01:00
|
|
|
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pExtDeviceMode );
|
|
|
|
ret = physdev->funcs->pExtDeviceMode( buf, hwnd, lpdmOutput, lpszDevice, lpszPort,
|
|
|
|
lpdmInput, lpszProfile, fwMode );
|
2007-09-24 18:23:42 +02:00
|
|
|
release_dc_ptr( dc );
|
2001-07-27 21:37:31 +02:00
|
|
|
}
|
|
|
|
DeleteDC( hdc );
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* @ [GDI32.103]
|
|
|
|
*
|
|
|
|
* This should load the correct driver for lpszDevice and calls this driver's
|
|
|
|
* AdvancedSetupDialog proc.
|
|
|
|
*/
|
|
|
|
INT WINAPI GDI_CallAdvancedSetupDialog16( HWND hwnd, LPSTR lpszDevice,
|
|
|
|
LPDEVMODEA devin, LPDEVMODEA devout )
|
|
|
|
{
|
2002-11-22 23:16:53 +01:00
|
|
|
TRACE("(%p, %s, %p, %p)\n", hwnd, lpszDevice, devin, devout );
|
2001-07-27 21:37:31 +02:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* @ [GDI32.104]
|
|
|
|
*
|
|
|
|
* This should load the correct driver for lpszDevice and calls this driver's
|
|
|
|
* DeviceCapabilities proc.
|
2003-08-12 22:42:18 +02:00
|
|
|
*
|
|
|
|
* FIXME: convert DeviceCapabilities to unicode in the driver interface
|
2001-07-27 21:37:31 +02:00
|
|
|
*/
|
|
|
|
DWORD WINAPI GDI_CallDeviceCapabilities16( LPCSTR lpszDevice, LPCSTR lpszPort,
|
|
|
|
WORD fwCapability, LPSTR lpszOutput,
|
|
|
|
LPDEVMODEA lpdm )
|
|
|
|
{
|
2003-08-12 22:42:18 +02:00
|
|
|
WCHAR deviceW[300];
|
|
|
|
WCHAR bufW[300];
|
2001-07-27 21:37:31 +02:00
|
|
|
char buf[300];
|
|
|
|
HDC hdc;
|
|
|
|
DC *dc;
|
|
|
|
INT ret = -1;
|
|
|
|
|
|
|
|
TRACE("(%s, %s, %d, %p, %p)\n", lpszDevice, lpszPort, fwCapability, lpszOutput, lpdm );
|
|
|
|
|
2003-08-12 22:42:18 +02:00
|
|
|
if (!lpszDevice) return -1;
|
|
|
|
if (!MultiByteToWideChar(CP_ACP, 0, lpszDevice, -1, deviceW, 300)) return -1;
|
|
|
|
|
|
|
|
if(!DRIVER_GetDriverName( deviceW, bufW, 300 )) return -1;
|
|
|
|
|
|
|
|
if (!WideCharToMultiByte(CP_ACP, 0, bufW, -1, buf, 300, NULL, NULL)) return -1;
|
2001-07-27 21:37:31 +02:00
|
|
|
|
2001-07-31 19:25:47 +02:00
|
|
|
if (!(hdc = CreateICA( buf, lpszDevice, lpszPort, NULL ))) return -1;
|
2001-07-27 21:37:31 +02:00
|
|
|
|
2007-09-24 18:23:42 +02:00
|
|
|
if ((dc = get_dc_ptr( hdc )))
|
2001-07-27 21:37:31 +02:00
|
|
|
{
|
2011-03-11 12:15:38 +01:00
|
|
|
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pDeviceCapabilities );
|
|
|
|
ret = physdev->funcs->pDeviceCapabilities( buf, lpszDevice, lpszPort,
|
|
|
|
fwCapability, lpszOutput, lpdm );
|
2007-09-24 18:23:42 +02:00
|
|
|
release_dc_ptr( dc );
|
2001-07-27 21:37:31 +02:00
|
|
|
}
|
|
|
|
DeleteDC( hdc );
|
|
|
|
return ret;
|
|
|
|
}
|
2004-02-12 03:17:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* Escape [GDI32.@]
|
|
|
|
*/
|
|
|
|
INT WINAPI Escape( HDC hdc, INT escape, INT in_count, LPCSTR in_data, LPVOID out_data )
|
|
|
|
{
|
|
|
|
INT ret;
|
|
|
|
POINT *pt;
|
|
|
|
|
|
|
|
switch (escape)
|
|
|
|
{
|
|
|
|
case ABORTDOC:
|
|
|
|
return AbortDoc( hdc );
|
|
|
|
|
|
|
|
case ENDDOC:
|
|
|
|
return EndDoc( hdc );
|
|
|
|
|
|
|
|
case GETPHYSPAGESIZE:
|
|
|
|
pt = out_data;
|
|
|
|
pt->x = GetDeviceCaps( hdc, PHYSICALWIDTH );
|
|
|
|
pt->y = GetDeviceCaps( hdc, PHYSICALHEIGHT );
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
case GETPRINTINGOFFSET:
|
|
|
|
pt = out_data;
|
|
|
|
pt->x = GetDeviceCaps( hdc, PHYSICALOFFSETX );
|
|
|
|
pt->y = GetDeviceCaps( hdc, PHYSICALOFFSETY );
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
case GETSCALINGFACTOR:
|
|
|
|
pt = out_data;
|
|
|
|
pt->x = GetDeviceCaps( hdc, SCALINGFACTORX );
|
|
|
|
pt->y = GetDeviceCaps( hdc, SCALINGFACTORY );
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
case NEWFRAME:
|
|
|
|
return EndPage( hdc );
|
|
|
|
|
|
|
|
case SETABORTPROC:
|
|
|
|
return SetAbortProc( hdc, (ABORTPROC)in_data );
|
|
|
|
|
|
|
|
case STARTDOC:
|
|
|
|
{
|
|
|
|
DOCINFOA doc;
|
|
|
|
char *name = NULL;
|
|
|
|
|
|
|
|
/* in_data may not be 0 terminated so we must copy it */
|
|
|
|
if (in_data)
|
|
|
|
{
|
|
|
|
name = HeapAlloc( GetProcessHeap(), 0, in_count+1 );
|
|
|
|
memcpy( name, in_data, in_count );
|
|
|
|
name[in_count] = 0;
|
|
|
|
}
|
|
|
|
/* out_data is actually a pointer to the DocInfo structure and used as
|
|
|
|
* a second input parameter */
|
|
|
|
if (out_data) doc = *(DOCINFOA *)out_data;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
doc.cbSize = sizeof(doc);
|
|
|
|
doc.lpszOutput = NULL;
|
|
|
|
doc.lpszDatatype = NULL;
|
|
|
|
doc.fwType = 0;
|
|
|
|
}
|
|
|
|
doc.lpszDocName = name;
|
|
|
|
ret = StartDocA( hdc, &doc );
|
2004-12-23 18:06:43 +01:00
|
|
|
HeapFree( GetProcessHeap(), 0, name );
|
2004-02-12 03:17:51 +01:00
|
|
|
if (ret > 0) ret = StartPage( hdc );
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
case QUERYESCSUPPORT:
|
|
|
|
{
|
2004-11-30 22:38:57 +01:00
|
|
|
const INT *ptr = (const INT *)in_data;
|
2004-02-12 03:17:51 +01:00
|
|
|
if (in_count < sizeof(INT)) return 0;
|
|
|
|
switch(*ptr)
|
|
|
|
{
|
|
|
|
case ABORTDOC:
|
|
|
|
case ENDDOC:
|
|
|
|
case GETPHYSPAGESIZE:
|
|
|
|
case GETPRINTINGOFFSET:
|
|
|
|
case GETSCALINGFACTOR:
|
|
|
|
case NEWFRAME:
|
|
|
|
case QUERYESCSUPPORT:
|
|
|
|
case SETABORTPROC:
|
|
|
|
case STARTDOC:
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* if not handled internally, pass it to the driver */
|
|
|
|
return ExtEscape( hdc, escape, in_count, in_data, 0, out_data );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* ExtEscape [GDI32.@]
|
|
|
|
*
|
2005-11-05 11:45:02 +01:00
|
|
|
* Access capabilities of a particular device that are not available through GDI.
|
|
|
|
*
|
2004-02-12 03:17:51 +01:00
|
|
|
* PARAMS
|
|
|
|
* hdc [I] Handle to device context
|
|
|
|
* nEscape [I] Escape function
|
|
|
|
* cbInput [I] Number of bytes in input structure
|
|
|
|
* lpszInData [I] Pointer to input structure
|
|
|
|
* cbOutput [I] Number of bytes in output structure
|
|
|
|
* lpszOutData [O] Pointer to output structure
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: >0
|
|
|
|
* Not implemented: 0
|
|
|
|
* Failure: <0
|
|
|
|
*/
|
|
|
|
INT WINAPI ExtEscape( HDC hdc, INT nEscape, INT cbInput, LPCSTR lpszInData,
|
|
|
|
INT cbOutput, LPSTR lpszOutData )
|
|
|
|
{
|
|
|
|
INT ret = 0;
|
2007-09-24 18:23:42 +02:00
|
|
|
DC * dc = get_dc_ptr( hdc );
|
2011-03-11 12:15:38 +01:00
|
|
|
|
2004-02-12 03:17:51 +01:00
|
|
|
if (dc)
|
|
|
|
{
|
2011-03-11 12:15:38 +01:00
|
|
|
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pExtEscape );
|
|
|
|
ret = physdev->funcs->pExtEscape( physdev, nEscape, cbInput, lpszInData, cbOutput, lpszOutData );
|
2007-09-24 18:23:42 +02:00
|
|
|
release_dc_ptr( dc );
|
2004-02-12 03:17:51 +01:00
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*******************************************************************
|
|
|
|
* DrawEscape [GDI32.@]
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
INT WINAPI DrawEscape(HDC hdc, INT nEscape, INT cbInput, LPCSTR lpszInData)
|
|
|
|
{
|
|
|
|
FIXME("DrawEscape, stub\n");
|
|
|
|
return 0;
|
|
|
|
}
|
2009-01-25 08:04:25 +01:00
|
|
|
|
|
|
|
/*******************************************************************
|
|
|
|
* NamedEscape [GDI32.@]
|
|
|
|
*/
|
|
|
|
INT WINAPI NamedEscape( HDC hdc, LPCWSTR pDriver, INT nEscape, INT cbInput, LPCSTR lpszInData,
|
|
|
|
INT cbOutput, LPSTR lpszOutData )
|
|
|
|
{
|
|
|
|
FIXME("(%p, %s, %d, %d, %p, %d, %p)\n",
|
|
|
|
hdc, wine_dbgstr_w(pDriver), nEscape, cbInput, lpszInData, cbOutput,
|
|
|
|
lpszOutData);
|
|
|
|
return 0;
|
|
|
|
}
|
2009-06-05 18:58:55 +02:00
|
|
|
|
|
|
|
/*******************************************************************
|
|
|
|
* DdQueryDisplaySettingsUniqueness [GDI32.@]
|
|
|
|
* GdiEntry13 [GDI32.@]
|
|
|
|
*/
|
|
|
|
ULONG WINAPI DdQueryDisplaySettingsUniqueness(VOID)
|
|
|
|
{
|
2010-03-26 10:33:21 +01:00
|
|
|
static int warn_once;
|
|
|
|
|
|
|
|
if (!warn_once++)
|
|
|
|
FIXME("stub\n");
|
2009-06-05 18:58:55 +02:00
|
|
|
return 0;
|
|
|
|
}
|