1996-08-24 20:26:35 +02:00
|
|
|
/*
|
|
|
|
* X11 graphics driver initialisation functions
|
|
|
|
*
|
|
|
|
* Copyright 1996 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
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
1996-08-24 20:26:35 +02:00
|
|
|
*/
|
|
|
|
|
1999-02-04 12:11:01 +01:00
|
|
|
#include "config.h"
|
|
|
|
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
1996-08-24 20:26:35 +02:00
|
|
|
#include <string.h>
|
1999-04-01 10:16:08 +02:00
|
|
|
|
2002-12-10 23:56:43 +01:00
|
|
|
#include "windef.h"
|
2003-09-06 01:08:26 +02:00
|
|
|
#include "winbase.h"
|
2005-06-01 13:08:39 +02:00
|
|
|
#include "winreg.h"
|
1999-04-01 10:16:08 +02:00
|
|
|
#include "x11drv.h"
|
2002-03-23 22:43:56 +01:00
|
|
|
#include "x11font.h"
|
2001-04-17 19:29:59 +02:00
|
|
|
#include "ddrawi.h"
|
2002-06-02 23:40:24 +02:00
|
|
|
#include "wine/debug.h"
|
1998-02-15 20:40:49 +01:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(x11drv);
|
1999-04-19 16:56:29 +02:00
|
|
|
|
2001-05-11 02:17:47 +02:00
|
|
|
Display *gdi_display; /* display to use for all GDI functions */
|
|
|
|
|
2001-07-28 02:18:02 +02:00
|
|
|
/* a few dynamic device caps */
|
|
|
|
static int log_pixels_x; /* pixels per logical inch in x direction */
|
|
|
|
static int log_pixels_y; /* pixels per logical inch in y direction */
|
|
|
|
static int horz_size; /* horz. size of screen in millimeters */
|
|
|
|
static int vert_size; /* vert. size of screen in millimeters */
|
|
|
|
static int palette_size;
|
2002-04-03 23:18:50 +02:00
|
|
|
unsigned int text_caps = (TC_OP_CHARACTER | TC_OP_STROKE | TC_CP_STROKE |
|
|
|
|
TC_CR_ANY | TC_SA_DOUBLE | TC_SA_INTEGER |
|
|
|
|
TC_SA_CONTIN | TC_UA_ABLE | TC_SO_ABLE | TC_RA_ABLE);
|
|
|
|
/* X11R6 adds TC_SF_X_YINDEP, Xrender adds TC_VA_ABLE */
|
2001-07-28 02:18:02 +02:00
|
|
|
|
2004-08-26 20:24:49 +02:00
|
|
|
|
|
|
|
static const WCHAR dpi_key_name[] = {'S','o','f','t','w','a','r','e','\\','F','o','n','t','s','\0'};
|
|
|
|
static const WCHAR dpi_value_name[] = {'L','o','g','P','i','x','e','l','s','\0'};
|
|
|
|
|
|
|
|
static const WCHAR INIFontSection[] = {'S','o','f','t','w','a','r','e','\\','W','i','n','e','\\',
|
|
|
|
'W','i','n','e','\\','C','o','n','f','i','g','\\',
|
|
|
|
'f','o','n','t','s','\0'};
|
|
|
|
static const WCHAR INIResolution[] = {'R','e','s','o','l','u','t','i','o','n','\0'};
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* get_dpi
|
|
|
|
*
|
|
|
|
* get the dpi from the registry
|
|
|
|
*/
|
|
|
|
static DWORD get_dpi( void )
|
|
|
|
{
|
|
|
|
DWORD dpi = 96;
|
|
|
|
HKEY hkey;
|
|
|
|
|
2005-06-13 20:56:00 +02:00
|
|
|
/* @@ Wine registry key: HKLM\Software\Wine\Wine\Config\fonts */
|
2004-08-26 20:24:49 +02:00
|
|
|
if(RegOpenKeyW(HKEY_LOCAL_MACHINE, INIFontSection, &hkey) == ERROR_SUCCESS)
|
|
|
|
{
|
|
|
|
char buffer[20];
|
|
|
|
DWORD type, count = sizeof(buffer);
|
|
|
|
if(RegQueryValueExW(hkey, INIResolution, 0, &type, buffer, &count) == ERROR_SUCCESS)
|
|
|
|
if(atoi(buffer) != 96)
|
2004-08-30 20:36:35 +02:00
|
|
|
MESSAGE("Please use the registry key HKEY_CURRENT_CONFIG\\Software\\Fonts\\LogPixels\n"
|
2004-08-26 20:24:49 +02:00
|
|
|
"to set the screen resolution and remove the \"Resolution\" entry in the config file\n");
|
|
|
|
RegCloseKey(hkey);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (RegOpenKeyW(HKEY_CURRENT_CONFIG, dpi_key_name, &hkey) == ERROR_SUCCESS)
|
|
|
|
{
|
|
|
|
DWORD type, size, new_dpi;
|
|
|
|
|
|
|
|
size = sizeof(new_dpi);
|
|
|
|
if(RegQueryValueExW(hkey, dpi_value_name, NULL, &type, (void *)&new_dpi, &size) == ERROR_SUCCESS)
|
|
|
|
{
|
|
|
|
if(type == REG_DWORD && new_dpi != 0)
|
|
|
|
dpi = new_dpi;
|
|
|
|
}
|
|
|
|
RegCloseKey(hkey);
|
|
|
|
}
|
|
|
|
return dpi;
|
|
|
|
}
|
|
|
|
|
1996-08-24 20:26:35 +02:00
|
|
|
/**********************************************************************
|
1999-04-01 10:16:08 +02:00
|
|
|
* X11DRV_GDI_Initialize
|
1996-08-24 20:26:35 +02:00
|
|
|
*/
|
2004-07-13 05:49:52 +02:00
|
|
|
void X11DRV_GDI_Initialize( Display *display )
|
1996-08-24 20:26:35 +02:00
|
|
|
{
|
2001-05-11 02:17:47 +02:00
|
|
|
gdi_display = display;
|
1999-04-01 10:16:08 +02:00
|
|
|
|
2005-03-24 22:04:10 +01:00
|
|
|
/* Initialize XRender */
|
|
|
|
X11DRV_XRender_Init();
|
|
|
|
|
2001-07-28 02:18:02 +02:00
|
|
|
palette_size = X11DRV_PALETTE_Init();
|
1997-06-16 19:43:53 +02:00
|
|
|
|
2004-07-13 05:49:52 +02:00
|
|
|
X11DRV_BITMAP_Init();
|
1997-02-02 20:01:52 +01:00
|
|
|
|
2004-08-26 20:24:49 +02:00
|
|
|
/* Initialize device caps */
|
|
|
|
log_pixels_x = log_pixels_y = get_dpi();
|
2001-07-28 02:18:02 +02:00
|
|
|
horz_size = MulDiv( screen_width, 254, log_pixels_x * 10 );
|
|
|
|
vert_size = MulDiv( screen_height, 254, log_pixels_y * 10 );
|
2004-08-26 20:24:49 +02:00
|
|
|
|
|
|
|
/* Initialize fonts and text caps */
|
|
|
|
X11DRV_FONT_Init(log_pixels_x, log_pixels_y);
|
1996-08-24 20:26:35 +02:00
|
|
|
}
|
|
|
|
|
1999-04-01 10:16:08 +02:00
|
|
|
/**********************************************************************
|
|
|
|
* X11DRV_GDI_Finalize
|
|
|
|
*/
|
|
|
|
void X11DRV_GDI_Finalize(void)
|
|
|
|
{
|
2001-05-11 02:17:47 +02:00
|
|
|
X11DRV_PALETTE_Cleanup();
|
|
|
|
XCloseDisplay( gdi_display );
|
|
|
|
gdi_display = NULL;
|
1999-04-01 10:16:08 +02:00
|
|
|
}
|
|
|
|
|
1996-08-24 20:26:35 +02:00
|
|
|
/**********************************************************************
|
|
|
|
* X11DRV_CreateDC
|
|
|
|
*/
|
2004-03-04 07:26:11 +01:00
|
|
|
BOOL X11DRV_CreateDC( HDC hdc, X11DRV_PDEVICE **pdev, LPCWSTR driver, LPCWSTR device,
|
2003-08-12 22:42:18 +02:00
|
|
|
LPCWSTR output, const DEVMODEW* initData )
|
1996-08-24 20:26:35 +02:00
|
|
|
{
|
|
|
|
X11DRV_PDEVICE *physDev;
|
|
|
|
|
2002-03-28 23:22:05 +01:00
|
|
|
physDev = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*physDev) );
|
2004-02-13 21:26:27 +01:00
|
|
|
if (!physDev) return FALSE;
|
|
|
|
|
2002-06-11 00:52:47 +02:00
|
|
|
*pdev = physDev;
|
2004-03-04 07:26:11 +01:00
|
|
|
physDev->hdc = hdc;
|
1996-08-24 20:26:35 +02:00
|
|
|
|
2004-03-04 07:26:11 +01:00
|
|
|
if (GetObjectType( hdc ) == OBJ_MEMDC)
|
1996-08-24 20:26:35 +02:00
|
|
|
{
|
2005-04-12 13:59:48 +02:00
|
|
|
if (!BITMAP_stock_phys_bitmap.hbitmap)
|
|
|
|
BITMAP_stock_phys_bitmap.hbitmap = GetCurrentObject( hdc, OBJ_BITMAP );
|
|
|
|
physDev->bitmap = &BITMAP_stock_phys_bitmap;
|
|
|
|
physDev->drawable = BITMAP_stock_phys_bitmap.pixmap;
|
2004-01-18 23:20:17 +01:00
|
|
|
physDev->depth = 1;
|
1996-08-24 20:26:35 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2005-04-12 13:59:48 +02:00
|
|
|
physDev->bitmap = NULL;
|
2001-05-11 02:17:47 +02:00
|
|
|
physDev->drawable = root_window;
|
2004-01-18 23:20:17 +01:00
|
|
|
physDev->depth = screen_depth;
|
1996-08-24 20:26:35 +02:00
|
|
|
}
|
2004-02-13 21:26:27 +01:00
|
|
|
physDev->region = CreateRectRgn( 0, 0, 0, 0 );
|
2001-05-11 02:17:47 +02:00
|
|
|
|
|
|
|
wine_tsx11_lock();
|
2002-05-31 20:43:22 +02:00
|
|
|
physDev->gc = XCreateGC( gdi_display, physDev->drawable, 0, NULL );
|
2001-05-11 02:17:47 +02:00
|
|
|
XSetGraphicsExposures( gdi_display, physDev->gc, False );
|
|
|
|
XSetSubwindowMode( gdi_display, physDev->gc, IncludeInferiors );
|
|
|
|
XFlush( gdi_display );
|
|
|
|
wine_tsx11_unlock();
|
1996-08-24 20:26:35 +02:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* X11DRV_DeleteDC
|
|
|
|
*/
|
2002-03-28 23:22:05 +01:00
|
|
|
BOOL X11DRV_DeleteDC( X11DRV_PDEVICE *physDev )
|
1996-08-24 20:26:35 +02:00
|
|
|
{
|
2002-01-29 04:07:21 +01:00
|
|
|
if(physDev->xrender)
|
2002-03-28 23:22:05 +01:00
|
|
|
X11DRV_XRender_DeleteDC( physDev );
|
2004-02-13 21:26:27 +01:00
|
|
|
DeleteObject( physDev->region );
|
2001-05-11 02:17:47 +02:00
|
|
|
wine_tsx11_lock();
|
|
|
|
XFreeGC( gdi_display, physDev->gc );
|
2000-05-12 22:18:14 +02:00
|
|
|
while (physDev->used_visuals-- > 0)
|
2001-05-11 02:17:47 +02:00
|
|
|
XFree(physDev->visuals[physDev->used_visuals]);
|
|
|
|
wine_tsx11_unlock();
|
1998-11-25 13:36:03 +01:00
|
|
|
HeapFree( GetProcessHeap(), 0, physDev );
|
1996-08-24 20:26:35 +02:00
|
|
|
return TRUE;
|
|
|
|
}
|
1997-06-16 19:43:53 +02:00
|
|
|
|
2001-07-28 02:18:02 +02:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* GetDeviceCaps (X11DRV.@)
|
|
|
|
*/
|
2002-03-28 23:22:05 +01:00
|
|
|
INT X11DRV_GetDeviceCaps( X11DRV_PDEVICE *physDev, INT cap )
|
2001-07-28 02:18:02 +02:00
|
|
|
{
|
|
|
|
switch(cap)
|
|
|
|
{
|
|
|
|
case DRIVERVERSION:
|
|
|
|
return 0x300;
|
|
|
|
case TECHNOLOGY:
|
|
|
|
return DT_RASDISPLAY;
|
|
|
|
case HORZSIZE:
|
|
|
|
return horz_size;
|
|
|
|
case VERTSIZE:
|
|
|
|
return vert_size;
|
|
|
|
case HORZRES:
|
|
|
|
return screen_width;
|
|
|
|
case VERTRES:
|
|
|
|
return screen_height;
|
|
|
|
case BITSPIXEL:
|
|
|
|
return screen_depth;
|
|
|
|
case PLANES:
|
|
|
|
return 1;
|
|
|
|
case NUMBRUSHES:
|
|
|
|
return -1;
|
|
|
|
case NUMPENS:
|
|
|
|
return -1;
|
|
|
|
case NUMMARKERS:
|
|
|
|
return 0;
|
|
|
|
case NUMFONTS:
|
|
|
|
return 0;
|
|
|
|
case NUMCOLORS:
|
|
|
|
/* MSDN: Number of entries in the device's color table, if the device has
|
|
|
|
* a color depth of no more than 8 bits per pixel.For devices with greater
|
|
|
|
* color depths, -1 is returned. */
|
|
|
|
return (screen_depth > 8) ? -1 : (1 << screen_depth);
|
|
|
|
case PDEVICESIZE:
|
|
|
|
return sizeof(X11DRV_PDEVICE);
|
|
|
|
case CURVECAPS:
|
|
|
|
return (CC_CIRCLES | CC_PIE | CC_CHORD | CC_ELLIPSES | CC_WIDE |
|
|
|
|
CC_STYLED | CC_WIDESTYLED | CC_INTERIORS | CC_ROUNDRECT);
|
|
|
|
case LINECAPS:
|
|
|
|
return (LC_POLYLINE | LC_MARKER | LC_POLYMARKER | LC_WIDE |
|
|
|
|
LC_STYLED | LC_WIDESTYLED | LC_INTERIORS);
|
|
|
|
case POLYGONALCAPS:
|
|
|
|
return (PC_POLYGON | PC_RECTANGLE | PC_WINDPOLYGON | PC_SCANLINE |
|
|
|
|
PC_WIDE | PC_STYLED | PC_WIDESTYLED | PC_INTERIORS);
|
|
|
|
case TEXTCAPS:
|
|
|
|
return text_caps;
|
|
|
|
case CLIPCAPS:
|
|
|
|
return CP_REGION;
|
|
|
|
case RASTERCAPS:
|
|
|
|
return (RC_BITBLT | RC_BANDING | RC_SCALING | RC_BITMAP64 | RC_DI_BITMAP |
|
|
|
|
RC_DIBTODEV | RC_BIGFONT | RC_STRETCHBLT | RC_STRETCHDIB | RC_DEVBITS |
|
|
|
|
(palette_size ? RC_PALETTE : 0));
|
|
|
|
case ASPECTX:
|
|
|
|
case ASPECTY:
|
|
|
|
return 36;
|
|
|
|
case ASPECTXY:
|
|
|
|
return 51;
|
|
|
|
case LOGPIXELSX:
|
|
|
|
return log_pixels_x;
|
|
|
|
case LOGPIXELSY:
|
|
|
|
return log_pixels_y;
|
|
|
|
case CAPS1:
|
2002-10-31 03:38:20 +01:00
|
|
|
FIXME("(%p): CAPS1 is unimplemented, will return 0\n", physDev->hdc );
|
2001-07-28 02:18:02 +02:00
|
|
|
/* please see wingdi.h for the possible bit-flag values that need
|
2002-06-01 01:06:46 +02:00
|
|
|
to be returned. also, see
|
2001-07-28 02:18:02 +02:00
|
|
|
http://msdn.microsoft.com/library/ddkdoc/win95ddk/graphcnt_1m0p.htm */
|
|
|
|
return 0;
|
|
|
|
case SIZEPALETTE:
|
|
|
|
return palette_size;
|
|
|
|
case NUMRESERVED:
|
|
|
|
case COLORRES:
|
|
|
|
case PHYSICALWIDTH:
|
|
|
|
case PHYSICALHEIGHT:
|
|
|
|
case PHYSICALOFFSETX:
|
|
|
|
case PHYSICALOFFSETY:
|
|
|
|
case SCALINGFACTORX:
|
|
|
|
case SCALINGFACTORY:
|
|
|
|
case VREFRESH:
|
|
|
|
case DESKTOPVERTRES:
|
|
|
|
case DESKTOPHORZRES:
|
|
|
|
case BTLALIGNMENT:
|
|
|
|
return 0;
|
|
|
|
default:
|
2002-10-31 03:38:20 +01:00
|
|
|
FIXME("(%p): unsupported capability %d, will return 0\n", physDev->hdc, cap );
|
2001-07-28 02:18:02 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1997-06-16 19:43:53 +02:00
|
|
|
/**********************************************************************
|
2001-07-29 22:25:14 +02:00
|
|
|
* ExtEscape (X11DRV.@)
|
1997-06-16 19:43:53 +02:00
|
|
|
*/
|
2002-03-28 23:22:05 +01:00
|
|
|
INT X11DRV_ExtEscape( X11DRV_PDEVICE *physDev, INT escape, INT in_count, LPCVOID in_data,
|
2001-07-29 22:25:14 +02:00
|
|
|
INT out_count, LPVOID out_data )
|
1997-06-16 19:43:53 +02:00
|
|
|
{
|
2001-07-29 22:25:14 +02:00
|
|
|
switch(escape)
|
1997-06-16 19:43:53 +02:00
|
|
|
{
|
2001-07-29 22:25:14 +02:00
|
|
|
case QUERYESCSUPPORT:
|
|
|
|
if (in_data)
|
|
|
|
{
|
2004-11-30 22:38:57 +01:00
|
|
|
switch (*(const INT *)in_data)
|
2001-07-29 22:25:14 +02:00
|
|
|
{
|
|
|
|
case DCICOMMAND:
|
|
|
|
return DD_HAL_VERSION;
|
2002-03-23 22:43:56 +01:00
|
|
|
case X11DRV_ESCAPE:
|
|
|
|
return TRUE;
|
2001-07-29 22:25:14 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case DCICOMMAND:
|
|
|
|
if (in_data)
|
|
|
|
{
|
|
|
|
const DCICMD *lpCmd = in_data;
|
|
|
|
if (lpCmd->dwVersion != DD_VERSION) break;
|
|
|
|
return X11DRV_DCICommand(in_count, lpCmd, out_data);
|
|
|
|
}
|
|
|
|
break;
|
2002-03-23 22:43:56 +01:00
|
|
|
|
|
|
|
case X11DRV_ESCAPE:
|
|
|
|
if (in_data && in_count >= sizeof(enum x11drv_escape_codes))
|
|
|
|
{
|
2004-11-30 22:38:57 +01:00
|
|
|
switch(*(const enum x11drv_escape_codes *)in_data)
|
2002-03-23 22:43:56 +01:00
|
|
|
{
|
|
|
|
case X11DRV_GET_DISPLAY:
|
|
|
|
if (out_count >= sizeof(Display *))
|
|
|
|
{
|
|
|
|
*(Display **)out_data = gdi_display;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case X11DRV_GET_DRAWABLE:
|
|
|
|
if (out_count >= sizeof(Drawable))
|
|
|
|
{
|
|
|
|
*(Drawable *)out_data = physDev->drawable;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case X11DRV_GET_FONT:
|
|
|
|
if (out_count >= sizeof(Font))
|
|
|
|
{
|
|
|
|
fontObject* pfo = XFONT_GetFontObject( physDev->font );
|
2002-07-03 03:16:45 +02:00
|
|
|
if (pfo == NULL) return FALSE;
|
2002-03-23 22:43:56 +01:00
|
|
|
*(Font *)out_data = pfo->fs->fid;
|
|
|
|
return TRUE;
|
|
|
|
}
|
2004-01-14 05:53:11 +01:00
|
|
|
break;
|
|
|
|
case X11DRV_SET_DRAWABLE:
|
|
|
|
if (in_count >= sizeof(struct x11drv_escape_set_drawable))
|
|
|
|
{
|
2004-11-30 22:38:57 +01:00
|
|
|
const struct x11drv_escape_set_drawable *data = (const struct x11drv_escape_set_drawable *)in_data;
|
2004-01-14 05:53:11 +01:00
|
|
|
if(physDev->xrender) X11DRV_XRender_UpdateDrawable( physDev );
|
|
|
|
physDev->org = data->org;
|
|
|
|
physDev->drawable = data->drawable;
|
|
|
|
physDev->drawable_org = data->drawable_org;
|
|
|
|
wine_tsx11_lock();
|
|
|
|
XSetSubwindowMode( gdi_display, physDev->gc, data->mode );
|
|
|
|
wine_tsx11_unlock();
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case X11DRV_START_EXPOSURES:
|
|
|
|
wine_tsx11_lock();
|
|
|
|
XSetGraphicsExposures( gdi_display, physDev->gc, True );
|
|
|
|
wine_tsx11_unlock();
|
|
|
|
physDev->exposures = 0;
|
|
|
|
return TRUE;
|
|
|
|
case X11DRV_END_EXPOSURES:
|
|
|
|
if (out_count >= sizeof(HRGN))
|
|
|
|
{
|
|
|
|
HRGN hrgn = 0, tmp = 0;
|
|
|
|
|
|
|
|
wine_tsx11_lock();
|
|
|
|
XSetGraphicsExposures( gdi_display, physDev->gc, False );
|
|
|
|
if (physDev->exposures)
|
|
|
|
{
|
|
|
|
for (;;)
|
|
|
|
{
|
|
|
|
XEvent event;
|
|
|
|
|
|
|
|
XWindowEvent( gdi_display, physDev->drawable, ~0, &event );
|
|
|
|
if (event.type == NoExpose) break;
|
|
|
|
if (event.type == GraphicsExpose)
|
|
|
|
{
|
|
|
|
int x = event.xgraphicsexpose.x - physDev->org.x;
|
|
|
|
int y = event.xgraphicsexpose.y - physDev->org.y;
|
|
|
|
|
|
|
|
TRACE( "got %d,%d %dx%d count %d\n", x, y,
|
|
|
|
event.xgraphicsexpose.width,
|
|
|
|
event.xgraphicsexpose.height,
|
|
|
|
event.xgraphicsexpose.count );
|
|
|
|
|
|
|
|
if (!tmp) tmp = CreateRectRgn( 0, 0, 0, 0 );
|
|
|
|
SetRectRgn( tmp, x, y,
|
|
|
|
x + event.xgraphicsexpose.width,
|
|
|
|
y + event.xgraphicsexpose.height );
|
|
|
|
if (hrgn) CombineRgn( hrgn, hrgn, tmp, RGN_OR );
|
|
|
|
else
|
|
|
|
{
|
|
|
|
hrgn = tmp;
|
|
|
|
tmp = 0;
|
|
|
|
}
|
|
|
|
if (!event.xgraphicsexpose.count) break;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ERR( "got unexpected event %d\n", event.type );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (tmp) DeleteObject( tmp );
|
|
|
|
}
|
|
|
|
wine_tsx11_unlock();
|
|
|
|
*(HRGN *)out_data = hrgn;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
break;
|
2005-03-27 19:58:41 +02:00
|
|
|
case X11DRV_GET_DCE:
|
|
|
|
if (out_count >= sizeof(struct dce *))
|
|
|
|
{
|
|
|
|
*(struct dce **)out_data = physDev->dce;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case X11DRV_SET_DCE:
|
|
|
|
if (in_count >= sizeof(struct x11drv_escape_set_dce))
|
|
|
|
{
|
|
|
|
const struct x11drv_escape_set_dce *data = (const struct x11drv_escape_set_dce *)in_data;
|
|
|
|
physDev->dce = data->dce;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
break;
|
2002-03-23 22:43:56 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
1997-06-16 19:43:53 +02:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|