Commit b87fe2e9 authored by Patrik Stridvall's avatar Patrik Stridvall Committed by Alexandre Julliard

More code moved to the X11 driver (bitmap and palette and misc).

parent 24b1c9c3
......@@ -4,8 +4,6 @@
* Copyright 1994 Alexandre Julliard
*/
#include "x11drv.h"
#include <stdio.h>
#include <string.h>
#include <unistd.h>
......@@ -17,6 +15,19 @@
#include "win.h"
#include "wine/winuser16.h"
/**********************************************************************/
DESKTOP_DRIVER *DESKTOP_Driver = NULL;
/***********************************************************************
* DESKTOP_IsSingleWindow
*/
BOOL DESKTOP_IsSingleWindow()
{
DESKTOP *pDesktop = (DESKTOP *) WIN_GetDesktop()->wExtra;
return MONITOR_IsSingleWindow(pDesktop->pPrimaryMonitor);
}
/***********************************************************************
* DESKTOP_GetScreenWidth
*
......@@ -206,8 +217,7 @@ LRESULT WINAPI DesktopWndProc( HWND hwnd, UINT message,
goto END;
case WM_ERASEBKGND:
if (X11DRV_WND_GetXRootWindow(wndPtr) ==
DefaultRootWindow(display))
if(!DESKTOP_IsSingleWindow())
{
retvalue = 1;
goto END;
......
......@@ -6,16 +6,13 @@
* Copyright 1995 Morten Welinder
*/
#include "config.h"
#include "ts_xlib.h"
#include "x11drv.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <sys/stat.h>
#include <unistd.h>
#include "winbase.h"
#include "class.h"
#include "module.h"
......@@ -30,6 +27,7 @@
#include "process.h"
#include "main.h"
#include "expr.h"
#include "user.h"
extern FILE * yyin;
unsigned int dbg_mode = 0;
......@@ -494,9 +492,7 @@ static void DEBUG_Main( int signal )
GlobalUnlock16( GetCurrentTask() );
/* Put the display in a correct state */
TSXUngrabServer( display );
TSXFlush( display );
USER_Driver->pBeginDebugging();
newmode = ISV86(&DEBUG_context) ? 16 : IS_SELECTOR_32BIT(addr.seg) ? 32 : 16;
if (newmode != dbg_mode)
......@@ -569,6 +565,8 @@ static void DEBUG_Main( int signal )
}
in_debugger = FALSE;
USER_Driver->pEndDebugging();
}
......
......@@ -24,6 +24,8 @@ static const DC_FUNCTIONS MFDRV_Funcs =
NULL, /* pCreateBitmap */
NULL, /* no implementation */ /* pCreateDC */
NULL, /* no implementation */ /* pDeleteDC */
NULL, /* pCreateDIBSection */
NULL, /* pCreateDIBSection16 */
NULL, /* pDeleteObject */
MFDRV_Ellipse, /* pEllipse */
NULL, /* pEnumDeviceFonts */
......
......@@ -27,6 +27,8 @@ static const DC_FUNCTIONS PSDRV_Funcs =
NULL, /* pCreateBitmap */
PSDRV_CreateDC, /* pCreateDC */
PSDRV_DeleteDC, /* pDeleteDC */
NULL, /* pCreateDIBSection */
NULL, /* pCreateDIBSection16 */
NULL, /* pDeleteObject */
PSDRV_Ellipse, /* pEllipse */
PSDRV_EnumDeviceFonts, /* pEnumDeviceFonts */
......
......@@ -6,7 +6,9 @@ VPATH = @srcdir@
MODULE = ttydrv
C_SRCS = \
init.c
bitmap.c \
init.c \
palette.c
all: $(MODULE).o
......
/*
* TTY bitmap driver
*
* Copyright 1999 Patrik Stridvall
*/
#include "dc.h"
#include "bitmap.h"
#include "ttydrv.h"
/**********************************************************************
* TTYDRV_BITMAP_CreateDIBSection
*/
HBITMAP TTYDRV_BITMAP_CreateDIBSection(
DC *dc, BITMAPINFO *bmi, UINT usage,
LPVOID *bits, HANDLE section, DWORD offset)
{
return (HBITMAP) NULL;
}
/**********************************************************************
* TTYDRV_BITMAP_CreateDIBSection16
*/
HBITMAP16 TTYDRV_DIB_CreateDIBSection16(
DC *dc, BITMAPINFO *bmi, UINT16 usage,
SEGPTR *bits, HANDLE section, DWORD offset)
{
return (HBITMAP16) NULL;
}
/**********************************************************************
* TTYDRV_BITMAP_SetDIBits
*/
INT TTYDRV_BITMAP_SetDIBits(
BITMAPOBJ *bmp, DC *dc, UINT startscan, UINT lines,
LPCVOID bits, const BITMAPINFO *info, UINT coloruse, HBITMAP hbitmap)
{
return 0;
}
/**********************************************************************
* TTYDRV_BITMAP_GetDIBits
*/
INT TTYDRV_BITMAP_GetDIBits(
BITMAPOBJ *bmp, DC *dc, UINT startscan, UINT lines,
LPVOID bits, BITMAPINFO *info, UINT coloruse, HBITMAP hbitmap)
{
return 0;
}
/**********************************************************************
* TTYDRV_BITMAP_DeleteDIBSection
*/
void TTYDRV_BITMAP_DeleteDIBSection(BITMAPOBJ *bmp)
{
}
......@@ -4,25 +4,30 @@
* Copyright 1998 Patrik Stridvall
*/
#include "gdi.h"
#include "bitmap.h"
#include "color.h"
#include "dc.h"
#include "debug.h"
#include "heap.h"
#include "palette.h"
#include "ttydrv.h"
static const DC_FUNCTIONS TTYDRV_GDI_Driver =
static const DC_FUNCTIONS TTYDRV_DC_Driver =
{
NULL, /* pArc */
NULL, /* pBitBlt */
NULL, /* pBitmapBits */
NULL, /* pChord */
NULL, /* pCreateBitmap */
TTYDRV_GDI_CreateDC, /* pCreateDC */
TTYDRV_GDI_DeleteDC, /* pDeleteDC */
TTYDRV_DC_CreateDC, /* pCreateDC */
TTYDRV_DC_DeleteDC, /* pDeleteDC */
NULL, /* pCreateDIBSection */
NULL, /* pCreateDIBSection16 */
NULL, /* pDeleteObject */
NULL, /* pEllipse */
NULL, /* pEnumDeviceFonts */
TTYDRV_GDI_Escape, /* pEscape */
TTYDRV_DC_Escape, /* pEscape */
NULL, /* pExcludeClipRect */
NULL, /* pExcludeVisRect */
NULL, /* pExtFloodFill */
......@@ -80,9 +85,29 @@ static const DC_FUNCTIONS TTYDRV_GDI_Driver =
NULL /* pStretchDIBits */
};
GDI_DRIVER TTYDRV_GDI_Driver =
{
TTYDRV_GDI_Initialize,
TTYDRV_GDI_Finalize
};
BITMAP_DRIVER TTYDRV_BITMAP_Driver =
{
TTYDRV_BITMAP_SetDIBits,
TTYDRV_BITMAP_GetDIBits,
TTYDRV_BITMAP_DeleteDIBSection
};
PALETTE_DRIVER TTYDRV_PALETTE_Driver =
{
TTYDRV_PALETTE_SetMapping,
TTYDRV_PALETTE_UpdateMapping
};
/* FIXME: Adapt to the TTY driver. Copied from the X11 driver */
static DeviceCaps TTYDRV_GDI_DevCaps = {
static DeviceCaps TTYDRV_DC_DevCaps = {
/* version */ 0,
/* technology */ DT_RASDISPLAY,
/* size, resolution */ 0, 0, 0, 0, 0,
......@@ -110,37 +135,41 @@ static DeviceCaps TTYDRV_GDI_DevCaps = {
*/
BOOL TTYDRV_GDI_Initialize(void)
{
TTYDRV_GDI_DevCaps.version = 0x300;
TTYDRV_GDI_DevCaps.horzSize = 0; /* FIXME: Screen width in mm */
TTYDRV_GDI_DevCaps.vertSize = 0; /* FIXME: Screen height in mm */
TTYDRV_GDI_DevCaps.horzRes = 640; /* FIXME: Screen width in pixel */
TTYDRV_GDI_DevCaps.vertRes = 480; /* FIXME: Screen height in pixel */
TTYDRV_GDI_DevCaps.bitsPixel = 1; /* FIXME: Bits per pixel */
TTYDRV_GDI_DevCaps.sizePalette = 0; /* FIXME: ??? */
BITMAP_Driver = &TTYDRV_BITMAP_Driver;
PALETTE_Driver = &TTYDRV_PALETTE_Driver;
TTYDRV_DC_DevCaps.version = 0x300;
TTYDRV_DC_DevCaps.horzSize = 0; /* FIXME: Screen width in mm */
TTYDRV_DC_DevCaps.vertSize = 0; /* FIXME: Screen height in mm */
TTYDRV_DC_DevCaps.horzRes = 640; /* FIXME: Screen width in pixel */
TTYDRV_DC_DevCaps.vertRes = 480; /* FIXME: Screen height in pixel */
TTYDRV_DC_DevCaps.bitsPixel = 1; /* FIXME: Bits per pixel */
TTYDRV_DC_DevCaps.sizePalette = 0; /* FIXME: ??? */
/* Resolution will be adjusted during the font init */
TTYDRV_GDI_DevCaps.logPixelsX = (int) (TTYDRV_GDI_DevCaps.horzRes * 25.4 / TTYDRV_GDI_DevCaps.horzSize);
TTYDRV_GDI_DevCaps.logPixelsY = (int) (TTYDRV_GDI_DevCaps.vertRes * 25.4 / TTYDRV_GDI_DevCaps.vertSize);
TTYDRV_DC_DevCaps.logPixelsX = (int) (TTYDRV_DC_DevCaps.horzRes * 25.4 / TTYDRV_DC_DevCaps.horzSize);
TTYDRV_DC_DevCaps.logPixelsY = (int) (TTYDRV_DC_DevCaps.vertRes * 25.4 / TTYDRV_DC_DevCaps.vertSize);
if( !COLOR_Init() ) return FALSE;
if(!TTYDRV_PALETTE_Initialize())
return FALSE;
return DRIVER_RegisterDriver( "DISPLAY", &TTYDRV_GDI_Driver );
return DRIVER_RegisterDriver( "DISPLAY", &TTYDRV_DC_Driver );
}
/**********************************************************************
* TTYDRV_GDI_Finalize
*/
void TTDRV_GDI_Finalize()
void TTYDRV_GDI_Finalize(void)
{
TTYDRV_PALETTE_Finalize();
}
/**********************************************************************
* TTYDRV_GDI_CreateDC
* TTYDRV_DC_CreateDC
*/
BOOL TTYDRV_GDI_CreateDC(DC *dc, LPCSTR driver, LPCSTR device,
LPCSTR output, const DEVMODE16 *initData)
BOOL TTYDRV_DC_CreateDC(DC *dc, LPCSTR driver, LPCSTR device,
LPCSTR output, const DEVMODE16 *initData)
{
FIXME(ttydrv, "(%p, %s, %s, %s, %p): semistub\n",
dc, debugstr_a(driver), debugstr_a(device),
......@@ -155,16 +184,16 @@ BOOL TTYDRV_GDI_CreateDC(DC *dc, LPCSTR driver, LPCSTR device,
return FALSE;
}
dc->w.devCaps = &TTYDRV_GDI_DevCaps;
dc->w.devCaps = &TTYDRV_DC_DevCaps;
return TRUE;
}
/**********************************************************************
* TTYDRV_GDI_DeleteDC
* TTYDRV_DC_DeleteDC
*/
BOOL TTYDRV_GDI_DeleteDC(DC *dc)
BOOL TTYDRV_DC_DeleteDC(DC *dc)
{
FIXME(ttydrv, "(%p): semistub\n", dc);
......@@ -175,11 +204,10 @@ BOOL TTYDRV_GDI_DeleteDC(DC *dc)
}
/**********************************************************************
* TTYDRV_GDI_Escape
* TTYDRV_DC_Escape
*/
INT TTYDRV_GDI_Escape(DC *dc, INT nEscape, INT cbInput,
SEGPTR lpInData, SEGPTR lpOutData)
INT TTYDRV_DC_Escape(DC *dc, INT nEscape, INT cbInput,
SEGPTR lpInData, SEGPTR lpOutData)
{
return 0;
}
/*
* TTY palette driver
*
* Copyright 1999 Patrik Stridvall
*/
#include "palette.h"
#include "ttydrv.h"
/**********************************************************************
* TTYDRV_PALETTE_Initialize
*/
BOOL TTYDRV_PALETTE_Initialize(void)
{
return TRUE;
}
/**********************************************************************
* TTYDRV_PALETTE_Finalize
*
*/
void TTYDRV_PALETTE_Finalize(void)
{
}
/***********************************************************************
* TTYDRV_PALETTE_SetMapping
*/
int TTYDRV_PALETTE_SetMapping(
PALETTEOBJ *palPtr, UINT uStart, UINT uNum, BOOL mapOnly)
{
return 0;
}
/***********************************************************************
* TTYDRV_PALETTE_UpdateMapping
*/
int TTYDRV_PALETTE_UpdateMapping(PALETTEOBJ *palPtr)
{
return 0;
}
......@@ -49,6 +49,8 @@ static const DC_FUNCTIONS WIN16DRV_Funcs =
NULL, /* pCreateBitmap */
WIN16DRV_CreateDC, /* pCreateDC */
NULL, /* pDeleteDC */
NULL, /* pCreateDIBSection */
NULL, /* pCreateDIBSection16 */
NULL, /* pDeleteObject */
WIN16DRV_Ellipse, /* pEllipse */
WIN16DRV_EnumDeviceFonts, /* pEnumDeviceFonts */
......
......@@ -6,28 +6,19 @@
#include "config.h"
#include "ts_xlib.h"
#ifdef HAVE_LIBXXSHM
#include <sys/types.h>
#include <sys/ipc.h>
#ifndef __EMX__
#include <sys/shm.h>
#endif /* !defined(__EMX__) */
#include "ts_xshm.h"
#endif /* defined(HAVE_LIBXXSHM) */
#ifndef X_DISPLAY_MISSING
#include "x11drv.h"
#endif /* !defined(X_DISPLAY_MISSING) */
#include "wine/winuser16.h"
#include "bitmap.h"
#include "palette.h"
#include "dc.h"
#include "debug.h"
#include "gdi.h"
#include "heap.h"
#include "selectors.h"
#include "ldt.h"
#include "monitor.h"
#include "palette.h"
#include "windef.h"
#include "xmalloc.h"
#include "wine/winuser16.h"
typedef enum WING_DITHER_TYPE
{
......@@ -105,7 +96,11 @@ SEGPTR WINAPI WinGGetDIBPointer16(HBITMAP16 hWinGBitmap, BITMAPINFO* bmpi)
if (bmpi)
FIXME(wing, ": Todo - implement setting BITMAPINFO\n");
return PTR_SEG_OFF_TO_SEGPTR(bmp->dib->selector, 0);
#ifndef X_DISPLAY_MISSING
return PTR_SEG_OFF_TO_SEGPTR(((X11DRV_DIBSECTION *) bmp->dib)->selector, 0);
#else /* !defined(X_DISPLAY_MISSING) */
return NULL;
#endif /* !defined(X_DISPLAY_MISSING) */
}
/***********************************************************************
......
......@@ -15,6 +15,7 @@ C_SRCS = \
init.c \
objects.c \
oembitmap.c \
palette.c \
pen.c \
text.c \
xfont.c
......
......@@ -596,11 +596,11 @@ static void BITBLT_GetRow( XImage *image, int *pdata, INT row,
pdata += swap ? start+width-1 : start;
if (image->depth == depthDst) /* color -> color */
{
if (COLOR_PixelToPalette && (depthDst != 1))
if (X11DRV_PALETTE_XPixelToPalette && (depthDst != 1))
if (swap) for (i = 0; i < width; i++)
*pdata-- = COLOR_PixelToPalette[XGetPixel( image, i, row )];
*pdata-- = X11DRV_PALETTE_XPixelToPalette[XGetPixel( image, i, row )];
else for (i = 0; i < width; i++)
*pdata++ = COLOR_PixelToPalette[XGetPixel( image, i, row )];
*pdata++ = X11DRV_PALETTE_XPixelToPalette[XGetPixel( image, i, row )];
else
if (swap) for (i = 0; i < width; i++)
*pdata-- = XGetPixel( image, i, row );
......@@ -611,10 +611,10 @@ static void BITBLT_GetRow( XImage *image, int *pdata, INT row,
{
if (image->depth == 1) /* monochrome -> color */
{
if (COLOR_PixelToPalette)
if (X11DRV_PALETTE_XPixelToPalette)
{
fg = COLOR_PixelToPalette[fg];
bg = COLOR_PixelToPalette[bg];
fg = X11DRV_PALETTE_XPixelToPalette[fg];
bg = X11DRV_PALETTE_XPixelToPalette[bg];
}
if (swap) for (i = 0; i < width; i++)
*pdata-- = XGetPixel( image, i, row ) ? bg : fg;
......@@ -873,7 +873,7 @@ static void BITBLT_GetSrcArea( DC *dcSrc, DC *dcDst, Pixmap pixmap, GC gc,
if (dcSrc->w.bitsPerPixel == dcDst->w.bitsPerPixel)
{
if (!COLOR_PixelToPalette ||
if (!X11DRV_PALETTE_XPixelToPalette ||
(dcDst->w.bitsPerPixel == 1)) /* monochrome -> monochrome */
{
XCopyArea( display, physDevSrc->drawable, pixmap, gc,
......@@ -897,7 +897,7 @@ static void BITBLT_GetSrcArea( DC *dcSrc, DC *dcDst, Pixmap pixmap, GC gc,
for (y = 0; y < height; y++)
for (x = 0; x < width; x++)
XPutPixel(imageSrc, x, y,
COLOR_PixelToPalette[XGetPixel(imageSrc, x, y)]);
X11DRV_PALETTE_XPixelToPalette[XGetPixel(imageSrc, x, y)]);
XPutImage( display, pixmap, gc, imageSrc,
0, 0, 0, 0, width, height );
XDestroyImage( imageSrc );
......@@ -907,12 +907,12 @@ static void BITBLT_GetSrcArea( DC *dcSrc, DC *dcDst, Pixmap pixmap, GC gc,
{
if (dcSrc->w.bitsPerPixel == 1) /* monochrome -> color */
{
if (COLOR_PixelToPalette)
if (X11DRV_PALETTE_XPixelToPalette)
{
XSetBackground( display, gc,
COLOR_PixelToPalette[physDevDst->textPixel] );
X11DRV_PALETTE_XPixelToPalette[physDevDst->textPixel] );
XSetForeground( display, gc,
COLOR_PixelToPalette[physDevDst->backgroundPixel]);
X11DRV_PALETTE_XPixelToPalette[physDevDst->backgroundPixel]);
}
else
{
......@@ -955,8 +955,8 @@ static void BITBLT_GetDstArea(DC *dc, Pixmap pixmap, GC gc, RECT *visRectDst)
INT height = visRectDst->bottom - visRectDst->top;
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
if (!COLOR_PixelToPalette || (dc->w.bitsPerPixel == 1) ||
(COLOR_GetSystemPaletteFlags() & COLOR_VIRTUAL) )
if (!X11DRV_PALETTE_XPixelToPalette || (dc->w.bitsPerPixel == 1) ||
(X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_VIRTUAL) )
{
XCopyArea( display, physDev->drawable, pixmap, gc,
visRectDst->left, visRectDst->top, width, height, 0, 0 );
......@@ -981,7 +981,7 @@ static void BITBLT_GetDstArea(DC *dc, Pixmap pixmap, GC gc, RECT *visRectDst)
for (y = 0; y < height; y++)
for (x = 0; x < width; x++)
XPutPixel( image, x, y,
COLOR_PixelToPalette[XGetPixel( image, x, y )]);
X11DRV_PALETTE_XPixelToPalette[XGetPixel( image, x, y )]);
XPutImage( display, pixmap, gc, image, 0, 0, 0, 0, width, height );
XDestroyImage( image );
}
......@@ -1000,10 +1000,10 @@ static void BITBLT_PutDstArea(DC *dc, Pixmap pixmap, GC gc, RECT *visRectDst)
INT height = visRectDst->bottom - visRectDst->top;
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
/* !COLOR_PaletteToPixel is _NOT_ enough */
/* !X11DRV_PALETTE_PaletteToXPixel is _NOT_ enough */
if (!COLOR_PaletteToPixel || (dc->w.bitsPerPixel == 1) ||
(COLOR_GetSystemPaletteFlags() & COLOR_VIRTUAL) )
if (!X11DRV_PALETTE_PaletteToXPixel || (dc->w.bitsPerPixel == 1) ||
(X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_VIRTUAL) )
{
XCopyArea( display, pixmap, physDev->drawable, gc, 0, 0,
width, height, visRectDst->left, visRectDst->top );
......@@ -1017,7 +1017,7 @@ static void BITBLT_PutDstArea(DC *dc, Pixmap pixmap, GC gc, RECT *visRectDst)
for (x = 0; x < width; x++)
{
XPutPixel( image, x, y,
COLOR_PaletteToPixel[XGetPixel( image, x, y )]);
X11DRV_PALETTE_PaletteToXPixel[XGetPixel( image, x, y )]);
}
XPutImage( display, physDev->drawable, gc, image, 0, 0,
visRectDst->left, visRectDst->top, width, height );
......@@ -1192,12 +1192,12 @@ static BOOL BITBLT_InternalStretchBlt( DC *dcDst, INT xDst, INT yDst,
if (!fStretch) switch(rop) /* A few optimisations */
{
case BLACKNESS: /* 0x00 */
if ((dcDst->w.bitsPerPixel == 1) || !COLOR_PaletteToPixel)
if ((dcDst->w.bitsPerPixel == 1) || !X11DRV_PALETTE_PaletteToXPixel)
XSetFunction( display, physDevDst->gc, GXclear );
else
{
XSetFunction( display, physDevDst->gc, GXcopy );
XSetForeground( display, physDevDst->gc, COLOR_PaletteToPixel[0] );
XSetForeground( display, physDevDst->gc, X11DRV_PALETTE_PaletteToXPixel[0] );
XSetFillStyle( display, physDevDst->gc, FillSolid );
}
XFillRectangle( display, physDevDst->drawable, physDevDst->gc,
......@@ -1205,12 +1205,12 @@ static BOOL BITBLT_InternalStretchBlt( DC *dcDst, INT xDst, INT yDst,
return TRUE;
case DSTINVERT: /* 0x55 */
if ((dcDst->w.bitsPerPixel == 1) || !COLOR_PaletteToPixel ||
if ((dcDst->w.bitsPerPixel == 1) || !X11DRV_PALETTE_PaletteToXPixel ||
!Options.perfectGraphics)
{
XSetFunction( display, physDevDst->gc, GXinvert );
if( COLOR_GetSystemPaletteFlags() & (COLOR_PRIVATE | COLOR_VIRTUAL) )
if( X11DRV_PALETTE_PaletteFlags & (X11DRV_PALETTE_PRIVATE | X11DRV_PALETTE_VIRTUAL) )
XSetFunction( display, physDevDst->gc, GXinvert);
else
{
......@@ -1287,13 +1287,13 @@ static BOOL BITBLT_InternalStretchBlt( DC *dcDst, INT xDst, INT yDst,
return TRUE;
case WHITENESS: /* 0xff */
if ((dcDst->w.bitsPerPixel == 1) || !COLOR_PaletteToPixel)
if ((dcDst->w.bitsPerPixel == 1) || !X11DRV_PALETTE_PaletteToXPixel)
XSetFunction( display, physDevDst->gc, GXset );
else
{
XSetFunction( display, physDevDst->gc, GXcopy );
XSetForeground( display, physDevDst->gc,
COLOR_PaletteToPixel[COLOR_GetSystemPaletteSize() - 1]);
X11DRV_PALETTE_PaletteToXPixel[X11DRV_DevCaps.sizePalette - 1]);
XSetFillStyle( display, physDevDst->gc, FillSolid );
}
XFillRectangle( display, physDevDst->drawable, physDevDst->gc,
......@@ -1407,11 +1407,11 @@ BOOL X11DRV_PatBlt( DC *dc, INT left, INT top,
struct StretchBlt_params params = { dc, left, top, width, height,
NULL, 0, 0, 0, 0, rop };
BOOL result;
DIB_UpdateDIBSection( dc, FALSE );
X11DRV_DIB_UpdateDIBSection( dc, FALSE );
EnterCriticalSection( &X11DRV_CritSection );
result = (BOOL)CALL_LARGE_STACK( BITBLT_DoStretchBlt, &params );
LeaveCriticalSection( &X11DRV_CritSection );
DIB_UpdateDIBSection( dc, TRUE );
X11DRV_DIB_UpdateDIBSection( dc, TRUE );
return result;
}
......@@ -1426,12 +1426,12 @@ BOOL X11DRV_BitBlt( DC *dcDst, INT xDst, INT yDst,
struct StretchBlt_params params = { dcDst, xDst, yDst, width, height,
dcSrc, xSrc, ySrc, width, height, rop};
BOOL result;
DIB_UpdateDIBSection( dcDst, FALSE );
DIB_UpdateDIBSection( dcSrc, FALSE );
X11DRV_DIB_UpdateDIBSection( dcDst, FALSE );
X11DRV_DIB_UpdateDIBSection( dcSrc, FALSE );
EnterCriticalSection( &X11DRV_CritSection );
result = (BOOL)CALL_LARGE_STACK( BITBLT_DoStretchBlt, &params );
LeaveCriticalSection( &X11DRV_CritSection );
DIB_UpdateDIBSection( dcDst, TRUE );
X11DRV_DIB_UpdateDIBSection( dcDst, TRUE );
return result;
}
......@@ -1448,12 +1448,12 @@ BOOL X11DRV_StretchBlt( DC *dcDst, INT xDst, INT yDst,
dcSrc, xSrc, ySrc, widthSrc, heightSrc,
rop };
BOOL result;
DIB_UpdateDIBSection( dcDst, FALSE );
DIB_UpdateDIBSection( dcSrc, FALSE );
X11DRV_DIB_UpdateDIBSection( dcDst, FALSE );
X11DRV_DIB_UpdateDIBSection( dcSrc, FALSE );
EnterCriticalSection( &X11DRV_CritSection );
result = (BOOL)CALL_LARGE_STACK( BITBLT_DoStretchBlt, &params );
LeaveCriticalSection( &X11DRV_CritSection );
DIB_UpdateDIBSection( dcDst, TRUE );
X11DRV_DIB_UpdateDIBSection( dcDst, TRUE );
return result;
}
......
......@@ -88,7 +88,7 @@ static const int EGAmapping[TOTAL_LEVELS] =
};
#define PIXEL_VALUE(r,g,b) \
COLOR_mapEGAPixel[EGAmapping[((r)*PRIMARY_LEVELS+(g))*PRIMARY_LEVELS+(b)]]
X11DRV_PALETTE_mapEGAPixel[EGAmapping[((r)*PRIMARY_LEVELS+(g))*PRIMARY_LEVELS+(b)]]
/* X image for building dithered pixmap */
static XImage *ditherImage = NULL;
......@@ -163,7 +163,7 @@ static void BRUSH_SelectSolidBrush( DC *dc, COLORREF color )
else
{
/* Solid brush */
physDev->brush.pixel = COLOR_ToPhysical( dc, color );
physDev->brush.pixel = X11DRV_PALETTE_ToPhysical( dc, color );
physDev->brush.fillStyle = FillSolid;
}
}
......@@ -258,7 +258,7 @@ HBRUSH X11DRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush, BRUSHOBJ * brush )
case BS_HATCHED:
TRACE(gdi, "BS_HATCHED\n" );
physDev->brush.pixel = COLOR_ToPhysical( dc, brush->logbrush.lbColor );
physDev->brush.pixel = X11DRV_PALETTE_ToPhysical( dc, brush->logbrush.lbColor );
physDev->brush.pixmap = TSXCreateBitmapFromData( display, X11DRV_GetXRootWindow(),
HatchBrushes[brush->logbrush.lbHatch], 8, 8 );
physDev->brush.fillStyle = FillStippled;
......
......@@ -96,10 +96,10 @@ BOOL X11DRV_SetupGCForPatBlt( DC * dc, GC gc, BOOL fMapColors )
val.foreground = physDev->brush.pixel;
val.background = physDev->backgroundPixel;
}
if (fMapColors && COLOR_PixelToPalette)
if (fMapColors && X11DRV_PALETTE_XPixelToPalette)
{
val.foreground = COLOR_PixelToPalette[val.foreground];
val.background = COLOR_PixelToPalette[val.background];
val.foreground = X11DRV_PALETTE_XPixelToPalette[val.foreground];
val.background = X11DRV_PALETTE_XPixelToPalette[val.background];
}
if (dc->w.flags & DC_DIRTY) CLIPPING_UpdateGCRegion(dc);
......@@ -126,7 +126,7 @@ BOOL X11DRV_SetupGCForPatBlt( DC * dc, GC gc, BOOL fMapColors )
break;
case FillTiled:
if (fMapColors && COLOR_PixelToPalette)
if (fMapColors && X11DRV_PALETTE_XPixelToPalette)
{
register int x, y;
XImage *image;
......@@ -140,7 +140,7 @@ BOOL X11DRV_SetupGCForPatBlt( DC * dc, GC gc, BOOL fMapColors )
for (y = 0; y < 8; y++)
for (x = 0; x < 8; x++)
XPutPixel( image, x, y,
COLOR_PixelToPalette[XGetPixel( image, x, y)] );
X11DRV_PALETTE_XPixelToPalette[XGetPixel( image, x, y)] );
XPutImage( display, pixmap, gc, image, 0, 0, 0, 0, 8, 8 );
XDestroyImage( image );
LeaveCriticalSection( &X11DRV_CritSection );
......@@ -829,7 +829,7 @@ X11DRV_SetPixel( DC *dc, INT x, INT y, COLORREF color )
x = dc->w.DCOrgX + XLPTODP( dc, x );
y = dc->w.DCOrgY + YLPTODP( dc, y );
pixel = COLOR_ToPhysical( dc, color );
pixel = X11DRV_PALETTE_ToPhysical( dc, color );
TSXSetForeground( display, physDev->gc, pixel );
TSXSetFunction( display, physDev->gc, GXcopy );
......@@ -837,7 +837,7 @@ X11DRV_SetPixel( DC *dc, INT x, INT y, COLORREF color )
/* inefficient but simple... */
return COLOR_ToLogical(pixel);
return X11DRV_PALETTE_ToLogical(pixel);
}
......@@ -874,7 +874,7 @@ X11DRV_GetPixel( DC *dc, INT x, INT y )
XDestroyImage( image );
LeaveCriticalSection( &X11DRV_CritSection );
return COLOR_ToLogical(pixel);
return X11DRV_PALETTE_ToLogical(pixel);
}
......@@ -1171,7 +1171,7 @@ static BOOL X11DRV_DoFloodFill( const struct FloodFill_params *params )
YLPTODP(dc,params->y) + dc->w.DCOrgY - rect.top,
rect.left,
rect.top,
COLOR_ToPhysical( dc, params->color ),
X11DRV_PALETTE_ToPhysical( dc, params->color ),
params->fillType );
}
......@@ -1416,7 +1416,7 @@ X11DRV_SetBkColor( DC *dc, COLORREF color )
oldColor = dc->w.backgroundColor;
dc->w.backgroundColor = color;
physDev->backgroundPixel = COLOR_ToPhysical( dc, color );
physDev->backgroundPixel = X11DRV_PALETTE_ToPhysical( dc, color );
return oldColor;
}
......@@ -1433,7 +1433,7 @@ X11DRV_SetTextColor( DC *dc, COLORREF color )
oldColor = dc->w.textColor;
dc->w.textColor = color;
physDev->textPixel = COLOR_ToPhysical( dc, color );
physDev->textPixel = X11DRV_PALETTE_ToPhysical( dc, color );
return oldColor;
}
......
......@@ -11,14 +11,15 @@
#include "ts_xlib.h"
#include <string.h>
#include "x11drv.h"
#include "color.h"
#include "bitmap.h"
#include "winnt.h"
#include "local.h"
#include "color.h"
#include "debug.h"
#include "ldt.h"
#include "local.h"
#include "monitor.h"
#include "winnt.h"
#include "x11drv.h"
static BOOL X11DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
LPCSTR output, const DEVMODE16* initData );
......@@ -36,6 +37,8 @@ static const DC_FUNCTIONS X11DRV_Funcs =
X11DRV_CreateBitmap, /* pCreateBitmap */
X11DRV_CreateDC, /* pCreateDC */
X11DRV_DeleteDC, /* pDeleteDC */
X11DRV_DIB_CreateDIBSection, /* pCreateDIBSection */
X11DRV_DIB_CreateDIBSection16, /* pCreateDIBSection16 */
X11DRV_DeleteObject, /* pDeleteObject */
X11DRV_Ellipse, /* pEllipse */
X11DRV_EnumDeviceFonts, /* pEnumDeviceFonts */
......@@ -97,7 +100,26 @@ static const DC_FUNCTIONS X11DRV_Funcs =
NULL /* pStretchDIBits */
};
static DeviceCaps X11DRV_DevCaps = {
GDI_DRIVER X11DRV_GDI_Driver =
{
X11DRV_GDI_Initialize,
X11DRV_GDI_Finalize
};
BITMAP_DRIVER X11DRV_BITMAP_Driver =
{
X11DRV_DIB_SetDIBits,
X11DRV_DIB_GetDIBits,
X11DRV_DIB_DeleteDIBSection
};
PALETTE_DRIVER X11DRV_PALETTE_Driver =
{
X11DRV_PALETTE_SetMapping,
X11DRV_PALETTE_UpdateMapping
};
DeviceCaps X11DRV_DevCaps = {
/* version */ 0,
/* technology */ DT_RASDISPLAY,
/* size, resolution */ 0, 0, 0, 0, 0,
......@@ -120,15 +142,18 @@ static DeviceCaps X11DRV_DevCaps = {
/* ..etc */ 0, 0 };
/**********************************************************************
* X11DRV_Init
* X11DRV_GDI_Initialize
*/
BOOL X11DRV_Init(void)
BOOL X11DRV_GDI_Initialize(void)
{
BITMAP_Driver = &X11DRV_BITMAP_Driver;
PALETTE_Driver = &X11DRV_PALETTE_Driver;
/* FIXME: colormap management should be merged with the X11DRV */
if( !X11DRV_DIB_Init() ) return FALSE;
if( !COLOR_Init() ) return FALSE;
if( !X11DRV_PALETTE_Init() ) return FALSE;
if( !X11DRV_OBM_Init() ) return FALSE;
......@@ -146,14 +171,6 @@ BOOL X11DRV_Init(void)
X11DRV_DevCaps.horzRes = MONITOR_GetWidth(&MONITOR_PrimaryMonitor);
X11DRV_DevCaps.vertRes = MONITOR_GetHeight(&MONITOR_PrimaryMonitor);
X11DRV_DevCaps.bitsPixel = MONITOR_GetDepth(&MONITOR_PrimaryMonitor);
if( COLOR_GetSystemPaletteFlags() & COLOR_VIRTUAL )
X11DRV_DevCaps.sizePalette = 0;
else
{
X11DRV_DevCaps.rasterCaps |= RC_PALETTE;
X11DRV_DevCaps.sizePalette = DefaultVisual(display,DefaultScreen(display))->map_entries;
}
/* Resolution will be adjusted during the font init */
......@@ -176,6 +193,14 @@ BOOL X11DRV_Init(void)
}
/**********************************************************************
* X11DRV_GDI_Finalize
*/
void X11DRV_GDI_Finalize(void)
{
X11DRV_PALETTE_Cleanup();
}
/**********************************************************************
* X11DRV_CreateDC
*/
static BOOL X11DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
......
......@@ -322,10 +322,10 @@ static BOOL OBM_InitColorSymbols()
for (i = 0; i < NB_COLOR_SYMBOLS; i++)
{
if (OBM_Colors[i].pixel & 0xff000000) /* PALETTEINDEX */
OBM_Colors[i].pixel = COLOR_ToPhysical( NULL,
OBM_Colors[i].pixel = X11DRV_PALETTE_ToPhysical( NULL,
GetSysColor(OBM_Colors[i].pixel & 0xff));
else /* RGB*/
OBM_Colors[i].pixel = COLOR_ToPhysical( NULL, OBM_Colors[i].pixel);
OBM_Colors[i].pixel = X11DRV_PALETTE_ToPhysical( NULL, OBM_Colors[i].pixel);
}
return TRUE;
}
......@@ -387,7 +387,7 @@ static BOOL OBM_CreateBitmaps( OBM_BITMAP_DESCR *descr )
attrs = (XpmAttributes *)HEAP_xalloc( GetProcessHeap(), 0,
XpmAttributesSize() );
attrs->valuemask = XpmColormap | XpmDepth | XpmColorSymbols |XpmHotspot;
attrs->colormap = X11DRV_COLOR_GetColormap();
attrs->colormap = X11DRV_PALETTE_PaletteXColormap;
attrs->depth = descr->color ? MONITOR_GetDepth(&MONITOR_PrimaryMonitor) : 1;
attrs->colorsymbols = (attrs->depth > 1) ? OBM_Colors : OBM_BlackAndWhite;
attrs->numsymbols = (attrs->depth > 1) ? NB_COLOR_SYMBOLS : 2;
......@@ -543,7 +543,7 @@ static HGLOBAL16 OBM_LoadCursorIcon( WORD id, BOOL fCursor )
{
X11DRV_PHYSBITMAP *pbitmapXor = bmpXor->DDBitmap->physBitmap;
TSXSetForeground( display, BITMAP_colorGC,
COLOR_ToPhysical( NULL, RGB(0,0,0) ));
X11DRV_PALETTE_ToPhysical( NULL, RGB(0,0,0) ));
TSXSetBackground( display, BITMAP_colorGC, 0 );
TSXSetFunction( display, BITMAP_colorGC, GXor );
TSXCopyPlane(display, pbitmapAnd->pixmap, pbitmapXor->pixmap, BITMAP_colorGC,
......
......@@ -37,7 +37,7 @@ HPEN X11DRV_PEN_SelectObject( DC * dc, HPEN hpen, PENOBJ * pen )
dc->wndExtX / 2) / dc->wndExtX;
if (physDev->pen.width < 0) physDev->pen.width = -physDev->pen.width;
if (physDev->pen.width == 1) physDev->pen.width = 0; /* Faster */
physDev->pen.pixel = COLOR_ToPhysical( dc, pen->logpen.lopnColor );
physDev->pen.pixel = X11DRV_PALETTE_ToPhysical( dc, pen->logpen.lopnColor );
switch(pen->logpen.lopnStyle & PS_STYLE_MASK)
{
case PS_DASH:
......
......@@ -7,30 +7,9 @@
#ifndef __WINE_BITMAP_H
#define __WINE_BITMAP_H
#include <X11/Xlib.h>
#include "gdi.h"
/* Additional info for DIB section objects */
typedef struct
{
/* Windows DIB section */
DIBSECTION dibSection;
/* Mapping status */
enum { DIB_NoHandler, DIB_InSync, DIB_AppMod, DIB_GdiMod } status;
/* Color map info */
int nColorMap;
int *colorMap;
/* Cached XImage */
XImage *image;
/* Selector for 16-bit access to bits */
WORD selector;
} DIBSECTIONOBJ;
struct tagGDI_BITMAP_DRIVER;
/* Flags used for BitmapBits. We only use the first two at the moment */
......@@ -48,16 +27,24 @@ typedef struct {
typedef struct tagBITMAPOBJ
{
GDIOBJHDR header;
BITMAP bitmap;
SIZE size; /* For SetBitmapDimension() */
BITMAP bitmap;
SIZE size; /* For SetBitmapDimension() */
DDBITMAP *DDBitmap;
DDBITMAP *DDBitmap;
/* For device-independent bitmaps: */
DIBSECTIONOBJ *dib;
DIBSECTION *dib;
} BITMAPOBJ;
typedef struct tagBITMAP_DRIVER
{
INT (*pSetDIBits)(struct tagBITMAPOBJ *,struct tagDC *,UINT,UINT,LPCVOID,const BITMAPINFO *,UINT,HBITMAP);
INT (*pGetDIBits)(struct tagBITMAPOBJ *,struct tagDC *,UINT,UINT,LPVOID,BITMAPINFO *,UINT,HBITMAP);
VOID (*pDeleteDIBSection)(struct tagBITMAPOBJ *);
} BITMAP_DRIVER;
extern BITMAP_DRIVER *BITMAP_Driver;
/* objects/bitmap.c */
extern INT16 BITMAP_GetObject16( BITMAPOBJ * bmp, INT16 count, LPVOID buffer );
extern INT BITMAP_GetObject( BITMAPOBJ * bmp, INT count, LPVOID buffer );
......
#ifndef __WINE_CLIPBOARD_H
#define __WINE_CLIPBOARD_H
#include "win.h"
#include "windef.h"
struct tagWND;
typedef struct tagWINE_CLIPFORMAT {
WORD wFormatID;
WORD wRefCount;
......@@ -16,15 +17,15 @@ typedef struct tagWINE_CLIPFORMAT {
HANDLE16 hData16;
} WINE_CLIPFORMAT, *LPWINE_CLIPFORMAT;
typedef struct _CLIPBOARD_DRIVER
typedef struct tagCLIPBOARD_DRIVER
{
void (*pEmptyClipboard)(void);
void (*pSetClipboardData)(UINT);
BOOL (*pRequestSelection)(void);
void (*pResetOwner)(WND *, BOOL);
void (*pResetOwner)(struct tagWND *, BOOL);
} CLIPBOARD_DRIVER;
CLIPBOARD_DRIVER *CLIPBOARD_GetDriver(void);
extern CLIPBOARD_DRIVER *CLIPBOARD_Driver;
extern void CLIPBOARD_ResetLock(HQUEUE16 hqRef, HQUEUE16 hqNew);
extern void CLIPBOARD_DeleteRecord(LPWINE_CLIPFORMAT lpFormat, BOOL bChange);
......
#ifndef __WINE_COLOR_H
#define __WINE_COLOR_H
#include "wingdi.h"
#include "palette.h"
#include "gdi.h"
#define COLOR_FIXED 0x0001 /* read-only colormap - have to use XAllocColor (if not virtual)*/
#define COLOR_VIRTUAL 0x0002 /* no mapping needed - pixel == pixel color */
#define COLOR_PRIVATE 0x1000 /* private colormap, identity mapping */
#define COLOR_WHITESET 0x2000
#define PC_SYS_USED 0x80 /* palentry is used (both system and logical) */
#define PC_SYS_RESERVED 0x40 /* system palentry is not to be mapped to */
#define PC_SYS_MAPPED 0x10 /* logical palentry is a direct alias for system palentry */
extern BOOL COLOR_Init(void);
extern void COLOR_Cleanup(void);
extern COLORREF COLOR_ToLogical(int pixel);
extern int COLOR_ToPhysical( DC *dc, COLORREF color );
extern int COLOR_SetMapping( PALETTEOBJ* pal, UINT uStart, UINT uNum, BOOL mapOnly );
extern BOOL COLOR_IsSolid( COLORREF color );
extern UINT16 COLOR_GetSystemPaletteSize(void);
extern UINT16 COLOR_GetSystemPaletteFlags(void);
extern const PALETTEENTRY* COLOR_GetSystemPaletteTemplate(void);
extern BOOL COLOR_GetMonoPlane( int* );
extern BOOL COLOR_IsSolid(COLORREF color);
extern COLORREF COLOR_LookupNearestColor( PALETTEENTRY*, int, COLORREF );
extern int COLOR_PaletteLookupPixel( PALETTEENTRY*, int, int* , COLORREF, BOOL );
extern COLORREF COLOR_GetSystemPaletteEntry(UINT);
extern int COLOR_LookupSystemPixel(COLORREF col);
extern COLORREF COLOR_GetSystemPaletteEntry(UINT);
extern const PALETTEENTRY *COLOR_GetSystemPaletteTemplate(void);
extern int COLOR_mapEGAPixel[16];
extern int* COLOR_PaletteToPixel;
extern int* COLOR_PixelToPalette;
extern int COLOR_ColormapSize;
extern COLORREF COLOR_LookupNearestColor(PALETTEENTRY *, int, COLORREF);
extern int COLOR_PaletteLookupExactIndex(PALETTEENTRY *palPalEntry, int size, COLORREF col);
extern int COLOR_PaletteLookupPixel(PALETTEENTRY *, int, int * , COLORREF, BOOL);
#endif /* __WINE_COLOR_H */
......@@ -9,10 +9,9 @@
#include "windef.h"
struct tagDESKTOP_DRIVER;
struct tagMONITOR;
struct _DESKTOP_DRIVER;
typedef struct tagDESKTOP
{
HBRUSH hbrushPattern;
......@@ -20,15 +19,18 @@ typedef struct tagDESKTOP
SIZE bitmapSize;
BOOL fTileWallPaper;
struct tagMONITOR *pPrimaryMonitor;
struct _DESKTOP_DRIVER *pDriver; /* Desktop driver */
struct tagDESKTOP_DRIVER *pDriver; /* Desktop driver */
void *pDriverData; /* Desktop driver data */
} DESKTOP;
typedef struct _DESKTOP_DRIVER {
typedef struct tagDESKTOP_DRIVER {
void (*pInitialize)(struct tagDESKTOP *pDesktop);
void (*pFinalize)(struct tagDESKTOP *pDesktop);
} DESKTOP_DRIVER;
extern DESKTOP_DRIVER *DESKTOP_Driver;
extern BOOL DESKTOP_IsSingleWindow();
extern int DESKTOP_GetScreenWidth(void);
extern int DESKTOP_GetScreenHeight(void);
extern int DESKTOP_GetScreenDepth(void);
......
......@@ -7,8 +7,9 @@
#ifndef __WINE_DISPLAY_H
#define __WINE_DISPLAY_H
#include "cursoricon.h"
#include "wine/winuser16.h"
#include "windef.h"
struct tagCURSORICONINFO;
#pragma pack(1)
typedef struct tagCURSORINFO
......@@ -18,13 +19,8 @@ typedef struct tagCURSORINFO
} CURSORINFO, *PCURSORINFO, *LPCURSORINFO;
#pragma pack(4)
typedef struct _MOUSE_DRIVER {
VOID (*pSetCursor)(CURSORICONINFO *);
VOID (*pMoveCursor)(WORD, WORD);
} MOUSE_DRIVER;
WORD WINAPI DISPLAY_Inquire(LPCURSORINFO lpCursorInfo);
VOID WINAPI DISPLAY_SetCursor( CURSORICONINFO *lpCursor );
VOID WINAPI DISPLAY_SetCursor( struct tagCURSORICONINFO *lpCursor );
VOID WINAPI DISPLAY_MoveCursor( WORD wAbsX, WORD wAbsY );
VOID WINAPI DISPLAY_CheckCursor();
......
......@@ -70,6 +70,13 @@ typedef struct tagDeviceCaps
WORD colorRes; /* 108: color resolution */
} DeviceCaps;
typedef struct tagGDI_DRIVER
{
BOOL (*pInitialize)(void);
void (*pFinalize)(void);
} GDI_DRIVER;
extern GDI_DRIVER *GDI_Driver;
/* Device independent DC information */
typedef struct
......@@ -159,6 +166,8 @@ typedef struct tagDC_FUNCS
BOOL (*pCreateBitmap)(HBITMAP);
BOOL (*pCreateDC)(DC*,LPCSTR,LPCSTR,LPCSTR,const DEVMODE16*);
BOOL (*pDeleteDC)(DC*);
HBITMAP (*pCreateDIBSection)(DC *,BITMAPINFO *,UINT,LPVOID *,HANDLE,DWORD);
HBITMAP16 (*pCreateDIBSection16)(DC *,BITMAPINFO *,UINT16,SEGPTR *,HANDLE,DWORD);
BOOL (*pDeleteObject)(HGDIOBJ);
BOOL (*pEllipse)(DC*,INT,INT,INT,INT);
BOOL (*pEnumDeviceFonts)(DC*,LPLOGFONT16,DEVICEFONTENUMPROC,LPARAM);
......
......@@ -29,15 +29,22 @@ VOID WINAPI KEYBOARD_Disable(VOID);
/* Wine internals */
typedef struct _KEYBOARD_DRIVER {
typedef struct tagKEYBOARD_DRIVER {
void (*pInit)(void);
WORD (*pVkKeyScan)(CHAR);
UINT16 (*pMapVirtualKey)(UINT16, UINT16);
INT16 (*pGetKeyNameText)(LONG, LPSTR, INT16);
INT16 (*pToAscii)(UINT16, UINT16, LPBYTE, LPVOID, UINT16);
BOOL (*pGetBeepActive)(void);
void (*pSetBeepActive)(BOOL bActivate);
void (*pBeep)(void);
} KEYBOARD_DRIVER;
extern KEYBOARD_DRIVER *KEYBOARD_GetDriver(void);
extern KEYBOARD_DRIVER *KEYBOARD_Driver;
extern BOOL KEYBOARD_GetBeepActive(void);
extern void KEYBOARD_SetBeepActive(BOOL bActivate);
extern void KEYBOARD_Beep(void);
extern void KEYBOARD_SendEvent(BYTE bVk, BYTE bScan, DWORD dwFlags, DWORD posX, DWORD posY, DWORD time);
......
......@@ -32,21 +32,22 @@ extern BOOL TIMER_GetTimerMsg( MSG *msg, HWND hwnd,
#define EVENT_IO_EXCEPT 2
/* event.c */
typedef struct _EVENT_DRIVER {
BOOL (*pInit)(void);
typedef struct tagEVENT_DRIVER {
BOOL (*pInit)(void);
void (*pAddIO)(int, unsigned);
void (*pDeleteIO)(int, unsigned);
BOOL (*pWaitNetEvent)(BOOL, BOOL);
BOOL (*pWaitNetEvent)(BOOL, BOOL);
void (*pSynchronize)(void);
BOOL (*pCheckFocus)(void);
BOOL (*pQueryPointer)(DWORD *, DWORD *, DWORD *);
BOOL (*pCheckFocus)(void);
BOOL (*pQueryPointer)(DWORD *, DWORD *, DWORD *);
void (*pDummyMotionNotify)(void);
BOOL (*pPending)(void);
BOOL (*pPending)(void);
BOOL16 (*pIsUserIdle)(void);
void (*pWakeUp)(void);
} EVENT_DRIVER;
extern EVENT_DRIVER *EVENT_Driver;
extern void EVENT_AddIO( int fd, unsigned flag );
extern void EVENT_DeleteIO( int fd, unsigned flag );
extern BOOL EVENT_Init( void );
......
......@@ -6,28 +6,42 @@
#ifndef __WINE_MONITOR_H
#define __WINE_MONITOR_H
#include "windef.h"
struct tagMONITOR_DRIVER;
typedef struct tagMONITOR
{
struct tagMONITOR_DRIVER *pDriver;
void *pDriverData;
void *pDriverData;
} MONITOR;
typedef struct tagMONITOR_DRIVER {
void (*pInitialize)(MONITOR *);
void (*pFinalize)(MONITOR *);
int (*pGetWidth)(MONITOR *);
int (*pGetHeight)(MONITOR *);
int (*pGetDepth)(MONITOR *);
void (*pInitialize)(struct tagMONITOR *);
void (*pFinalize)(struct tagMONITOR *);
BOOL (*pIsSingleWindow)(struct tagMONITOR *);
int (*pGetWidth)(struct tagMONITOR *);
int (*pGetHeight)(struct tagMONITOR *);
int (*pGetDepth)(struct tagMONITOR *);
BOOL (*pGetScreenSaveActive)(struct tagMONITOR *);
void (*pSetScreenSaveActive)(struct tagMONITOR *, BOOL);
int (*pGetScreenSaveTimeout)(struct tagMONITOR *);
void (*pSetScreenSaveTimeout)(struct tagMONITOR *, int);
} MONITOR_DRIVER;
extern MONITOR_DRIVER *MONITOR_Driver;
extern MONITOR MONITOR_PrimaryMonitor;
extern void MONITOR_Initialize(MONITOR *pMonitor);
extern void MONITOR_Finalize(MONITOR *pMonitor);
extern BOOL MONITOR_IsSingleWindow(MONITOR *pMonitor);
extern int MONITOR_GetWidth(MONITOR *pMonitor);
extern int MONITOR_GetHeight(MONITOR *pMonitor);
extern int MONITOR_GetDepth(MONITOR *pMonitor);
extern BOOL MONITOR_GetScreenSaveActive(MONITOR *pMonitor);
extern void MONITOR_SetScreenSaveActive(MONITOR *pMonitor, BOOL bActivate);
extern int MONITOR_GetScreenSaveTimeout(MONITOR *pMonitor);
extern void MONITOR_SetScreenSaveTimeout(MONITOR *pMonitor, int nTimeout);
#endif /* __WINE_MONITOR_H */
......@@ -7,6 +7,10 @@
#ifndef __WINE_MOUSE_H
#define __WINE_MOUSE_H
#include "windef.h"
struct tagCURSORICONINFO;
#pragma pack(1)
typedef struct _MOUSEINFO
{
......@@ -30,6 +34,14 @@ VOID WINAPI MOUSE_Disable(VOID);
/* Wine internals */
typedef struct tagMOUSE_DRIVER {
VOID (*pSetCursor)(struct tagCURSORICONINFO *);
VOID (*pMoveCursor)(WORD, WORD);
BOOL (*pEnableWarpPointer)(BOOL);
} MOUSE_DRIVER;
extern MOUSE_DRIVER *MOUSE_Driver;
#define WINE_MOUSEEVENT_MAGIC ( ('M'<<24)|('A'<<16)|('U'<<8)|'S' )
typedef struct _WINE_MOUSEEVENT
{
......
......@@ -12,13 +12,22 @@
#define NB_RESERVED_COLORS 20 /* number of fixed colors in system palette */
/* GDI logical palette object */
typedef struct
typedef struct tagPALETTEOBJ
{
GDIOBJHDR header;
int *mapping;
LOGPALETTE logpalette; /* _MUST_ be the last field */
GDIOBJHDR header;
int *mapping;
LOGPALETTE logpalette; /* _MUST_ be the last field */
} PALETTEOBJ;
typedef struct tagPALETTE_DRIVER
{
int (*pSetMapping)(struct tagPALETTEOBJ *, UINT, UINT, BOOL);
int (*pUpdateMapping)(struct tagPALETTEOBJ *);
BOOL (*pIsDark)(int pixel);
} PALETTE_DRIVER;
extern PALETTE_DRIVER *PALETTE_Driver;
extern HPALETTE16 PALETTE_Init(void);
extern int PALETTE_GetObject( PALETTEOBJ * palette, int count, LPSTR buffer );
extern BOOL PALETTE_DeleteObject( HPALETTE16 hpalette, PALETTEOBJ *palette );
......
......@@ -7,7 +7,8 @@
#ifndef __WINE_SYSMETRICS_H
#define __WINE_SYSMETRICS_H
#include "windef.h"
#include "wingdi.h"
/* Constant system metrics */
#if 0
#ifdef WIN_95_LOOK
......
......@@ -6,27 +6,67 @@
#define __WINE_TTYDRV_H
#include "windef.h"
#include "wingdi.h"
#include "wine/winuser16.h"
struct tagBITMAPOBJ;
struct tagCLASS;
struct tagDC;
struct tagDESKTOP;
struct tagPALETTEOBJ;
struct tagWND;
/* TTY GDI driver */
/**************************************************************************
* TTY GDI driver
*/
extern struct tagGDI_DRIVER TTYDRV_GDI_Driver;
extern BOOL TTYDRV_GDI_Initialize(void);
extern void TTYDRV_GDI_Finalize(void);
/* TTY GDI bitmap driver */
extern HBITMAP TTYDRV_BITMAP_CreateDIBSection(struct tagDC *dc, BITMAPINFO *bmi, UINT usage, LPVOID *bits, HANDLE section, DWORD offset);
extern HBITMAP16 TTYDRV_BITMAP_CreateDIBSection16(struct tagDC *dc, BITMAPINFO *bmi, UINT16 usage, SEGPTR *bits, HANDLE section, DWORD offset);
extern INT TTYDRV_BITMAP_SetDIBits(struct tagBITMAPOBJ *bmp, struct tagDC *dc, UINT startscan, UINT lines, LPCVOID bits, const BITMAPINFO *info, UINT coloruse, HBITMAP hbitmap);
extern INT TTYDRV_BITMAP_GetDIBits(struct tagBITMAPOBJ *bmp, struct tagDC *dc, UINT startscan, UINT lines, LPVOID bits, BITMAPINFO *info, UINT coloruse, HBITMAP hbitmap);
extern void TTYDRV_BITMAP_DeleteDIBSection(struct tagBITMAPOBJ *bmp);
typedef struct {
int dummy;
} TTYDRV_PDEVICE;
extern BOOL TTYDRV_GDI_Initialize(void);
extern void TTDRV_GDI_Finalize(void);
extern BOOL TTYDRV_GDI_CreateDC(struct tagDC *dc, LPCSTR driver, LPCSTR device, LPCSTR output, const DEVMODE16 *initData);
extern BOOL TTYDRV_GDI_DeleteDC(struct tagDC *dc);
extern INT TTYDRV_GDI_Escape(struct tagDC *dc, INT nEscape, INT cbInput, SEGPTR lpInData, SEGPTR lpOutData);
extern BOOL TTYDRV_DC_CreateDC(struct tagDC *dc, LPCSTR driver, LPCSTR device, LPCSTR output, const DEVMODE16 *initData);
extern BOOL TTYDRV_DC_DeleteDC(struct tagDC *dc);
extern INT TTYDRV_DC_Escape(struct tagDC *dc, INT nEscape, INT cbInput, SEGPTR lpInData, SEGPTR lpOutData);
/* TTY GDI palette driver */
extern struct tagPALETTE_DRIVER TTYDRV_PALETTE_Driver;
extern BOOL TTYDRV_PALETTE_Initialize(void);
extern void TTYDRV_PALETTE_Finalize(void);
extern int TTYDRV_PALETTE_SetMapping(struct tagPALETTEOBJ *palPtr, UINT uStart, UINT uNum, BOOL mapOnly);
extern int TTYDRV_PALETTE_UpdateMapping(struct tagPALETTEOBJ *palPtr);
extern BOOL TTYDRV_PALETTE_IsDark(int pixel);
/**************************************************************************
* TTY USER driver
*/
extern struct tagUSER_DRIVER TTYDRV_USER_Driver;
extern BOOL TTYDRV_USER_Initialize(void);
extern void TTYDRV_USER_Finalize(void);
extern void TTYDRV_USER_BeginDebugging(void);
extern void TTYDRV_USER_EndDebugging(void);
/* TTY clipboard driver */
extern struct _CLIPBOARD_DRIVER TTYDRV_CLIPBOARD_Driver;
extern struct tagCLIPBOARD_DRIVER TTYDRV_CLIPBOARD_Driver;
extern void TTYDRV_CLIPBOARD_EmptyClipboard(void);
extern void TTYDRV_CLIPBOARD_SetClipboardData(UINT wFormat);
......@@ -35,7 +75,7 @@ extern void TTYDRV_CLIPBOARD_ResetOwner(struct tagWND *pWnd, BOOL bFooBar);
/* TTY desktop driver */
extern struct _DESKTOP_DRIVER TTYDRV_DESKTOP_Driver;
extern struct tagDESKTOP_DRIVER TTYDRV_DESKTOP_Driver;
extern void TTYDRV_DESKTOP_Initialize(struct tagDESKTOP *pDesktop);
extern void TTYDRV_DESKTOP_Finalize(struct tagDESKTOP *pDesktop);
......@@ -45,7 +85,7 @@ extern int TTYDRV_DESKTOP_GetScreenDepth(struct tagDESKTOP *pDesktop);
/* TTY event driver */
extern struct _EVENT_DRIVER TTYDRV_EVENT_Driver;
extern struct tagEVENT_DRIVER TTYDRV_EVENT_Driver;
extern BOOL TTYDRV_EVENT_Init(void);
extern void TTYDRV_EVENT_AddIO(int fd, unsigned flag);
......@@ -61,22 +101,16 @@ extern void TTYDRV_EVENT_WakeUp(void);
/* TTY keyboard driver */
extern struct _KEYBOARD_DRIVER TTYDRV_KEYBOARD_Driver;
extern struct tagKEYBOARD_DRIVER TTYDRV_KEYBOARD_Driver;
extern void TTYDRV_KEYBOARD_Init(void);
extern WORD TTYDRV_KEYBOARD_VkKeyScan(CHAR cChar);
extern UINT16 TTYDRV_KEYBOARD_MapVirtualKey(UINT16 wCode, UINT16 wMapType);
extern INT16 TTYDRV_KEYBOARD_GetKeyNameText(LONG lParam, LPSTR lpBuffer, INT16 nSize);
extern INT16 TTYDRV_KEYBOARD_ToAscii(UINT16 virtKey, UINT16 scanCode, LPBYTE lpKeyState, LPVOID lpChar, UINT16 flags);
/* TTY main driver */
extern void TTYDRV_MAIN_Finalize(void);
extern void TTYDRV_MAIN_Initialize(void);
extern void TTYDRV_MAIN_ParseOptions(int *argc, char *argv[]);
extern void TTYDRV_MAIN_Create(void);
extern void TTYDRV_MAIN_SaveSetup(void);
extern void TTYDRV_MAIN_RestoreSetup(void);
extern BOOL TTYDRV_KEYBOARD_GetBeepActive(void);
extern void TTYDRV_KEYBOARD_SetBeepActive(BOOL bActivate);
extern void TTYDRV_KEYBOARD_Beep(void);
/* TTY monitor driver */
......@@ -92,20 +126,26 @@ struct tagMONITOR;
extern void TTYDRV_MONITOR_Initialize(struct tagMONITOR *pMonitor);
extern void TTYDRV_MONITOR_Finalize(struct tagMONITOR *pMonitor);
extern BOOL TTYDRV_MONITOR_IsSingleWindow(struct tagMONITOR *pMonitor);
extern int TTYDRV_MONITOR_GetWidth(struct tagMONITOR *pMonitor);
extern int TTYDRV_MONITOR_GetHeight(struct tagMONITOR *pMonitor);
extern int TTYDRV_MONITOR_GetDepth(struct tagMONITOR *pMonitor);
extern BOOL TTYDRV_MONITOR_GetScreenSaveActive(struct tagMONITOR *pMonitor);
extern void TTYDRV_MONITOR_SetScreenSaveActive(struct tagMONITOR *pMonitor, BOOL bActivate);
extern int TTYDRV_MONITOR_GetScreenSaveTimeout(struct tagMONITOR *pMonitor);
extern void TTYDRV_MONITOR_SetScreenSaveTimeout(struct tagMONITOR *pMonitor, int nTimeout);
/* TTY mouse driver */
extern struct _MOUSE_DRIVER TTYDRV_MOUSE_Driver;
extern struct tagMOUSE_DRIVER TTYDRV_MOUSE_Driver;
extern void TTYDRV_MOUSE_SetCursor(CURSORICONINFO *lpCursor);
extern void TTYDRV_MOUSE_MoveCursor(WORD wAbsX, WORD wAbsY);
extern BOOL TTYDRV_MOUSE_EnableWarpPointer(BOOL bEnable);
/* TTY windows driver */
extern struct _WND_DRIVER TTYDRV_WND_Driver;
extern struct tagWND_DRIVER TTYDRV_WND_Driver;
extern void TTYDRV_WND_Initialize(struct tagWND *wndPtr);
extern void TTYDRV_WND_Finalize(struct tagWND *wndPtr);
......
......@@ -29,6 +29,15 @@ extern WORD USER_HeapSel;
#define USUD_LOCALHEAP 0x0004
#define USUD_FIRSTCLASS 0x0005
typedef struct tagUSER_DRIVER {
BOOL (*pInitialize)(void);
void (*pFinalize)(void);
void (*pBeginDebugging)(void);
void (*pEndDebugging)(void);
} USER_DRIVER;
extern USER_DRIVER *USER_Driver;
void WINAPI USER_SignalProc(HANDLE16, UINT16, UINT16, HINSTANCE16, HQUEUE16);
void USER_ExitWindows(void);
void USER_QueueCleanup( HQUEUE16 hQueue );
......
......@@ -52,7 +52,7 @@ typedef enum
struct tagCLASS;
struct tagDCE;
struct tagDC;
struct _WND_DRIVER;
struct tagWND_DRIVER;
typedef struct tagWND
{
......@@ -83,7 +83,7 @@ typedef struct tagWND
HMENU16 hSysMenu; /* window's copy of System Menu */
int irefCount; /* window's reference count*/
DWORD userdata; /* User private data */
struct _WND_DRIVER *pDriver; /* Window driver */
struct tagWND_DRIVER *pDriver; /* Window driver */
void *pDriverData; /* Window driver data */
DWORD wExtra[1]; /* Window extra bytes */
} WND;
......@@ -107,7 +107,7 @@ typedef struct tagWND
#define BGSouthEast 9
#define BGStatic 10
typedef struct _WND_DRIVER
typedef struct tagWND_DRIVER
{
void (*pInitialize)(WND *);
void (*pFinalize)(WND *);
......@@ -127,6 +127,8 @@ typedef struct _WND_DRIVER
BOOL (*pIsSelfClipping)(WND *);
} WND_DRIVER;
extern WND_DRIVER *WND_Driver;
typedef struct
{
RECT16 rectNormal;
......
/*
* X11 display driver definitions
* X11 driver definitions
*/
#ifndef __WINE_X11DRV_H
......@@ -18,13 +18,15 @@
#include "gdi.h"
#include "windef.h"
struct tagBITMAPOBJ;
struct tagCLASS;
struct tagCREATESTRUCTA;
struct tagCURSORICONINFO;
struct tagDC;
struct tagDeviceCaps;
struct tagPALETTEOBJ;
struct tagWND;
struct tagCREATESTRUCTA;
struct tagWINDOWPOS;
struct tagCURSORICONINFO;
/* X physical pen */
typedef struct
......@@ -74,6 +76,7 @@ extern GC BITMAP_monoGC, BITMAP_colorGC;
#define BITMAP_GC(bmp) \
(((bmp)->bitmap.bmBitsPixel == 1) ? BITMAP_monoGC : BITMAP_colorGC)
extern DeviceCaps X11DRV_DevCaps;
/* Wine driver X11 functions */
......@@ -188,6 +191,26 @@ extern void _XInitImageFuncPtrs(XImage *);
/* exported dib functions for now */
/* Additional info for DIB section objects */
typedef struct
{
/* Windows DIB section */
DIBSECTION dibSection;
/* Mapping status */
enum { X11DRV_DIB_NoHandler, X11DRV_DIB_InSync, X11DRV_DIB_AppMod, X11DRV_DIB_GdiMod } status;
/* Color map info */
int nColorMap;
int *colorMap;
/* Cached XImage */
XImage *image;
/* Selector for 16-bit access to bits */
WORD selector;
} X11DRV_DIBSECTION;
/* This structure holds the arguments for DIB_SetImageBits() */
typedef struct
{
......@@ -209,17 +232,86 @@ typedef struct
int yDest;
int width;
int height;
} DIB_SETIMAGEBITS_DESCR;
} X11DRV_DIB_SETIMAGEBITS_DESCR;
extern int X11DRV_DIB_GetImageBits( const DIB_SETIMAGEBITS_DESCR *descr );
extern int X11DRV_DIB_SetImageBits( const DIB_SETIMAGEBITS_DESCR *descr );
extern int X11DRV_DIB_GetImageBits( const X11DRV_DIB_SETIMAGEBITS_DESCR *descr );
extern int X11DRV_DIB_SetImageBits( const X11DRV_DIB_SETIMAGEBITS_DESCR *descr );
extern int *X11DRV_DIB_BuildColorMap( struct tagDC *dc, WORD coloruse,
WORD depth, const BITMAPINFO *info,
int *nColors );
extern void X11DRV_DIB_UpdateDIBSection(struct tagDC *dc, BOOL toDIB);
extern HBITMAP X11DRV_DIB_CreateDIBSection(struct tagDC *dc, BITMAPINFO *bmi, UINT usage,
LPVOID *bits, HANDLE section, DWORD offset);
extern HBITMAP16 X11DRV_DIB_CreateDIBSection16(struct tagDC *dc, BITMAPINFO *bmi, UINT16 usage,
SEGPTR *bits, HANDLE section, DWORD offset);
extern struct tagBITMAP_DRIVER X11DRV_BITMAP_Driver;
extern INT X11DRV_DIB_SetDIBits(struct tagBITMAPOBJ *bmp, struct tagDC *dc, UINT startscan,
UINT lines, LPCVOID bits, const BITMAPINFO *info,
UINT coloruse, HBITMAP hbitmap);
extern INT X11DRV_DIB_GetDIBits(struct tagBITMAPOBJ *bmp, struct tagDC *dc, UINT startscan,
UINT lines, LPVOID bits, BITMAPINFO *info,
UINT coloruse, HBITMAP hbitmap);
extern void X11DRV_DIB_DeleteDIBSection(struct tagBITMAPOBJ *bmp);
/**************************************************************************
* X11 GDI driver
*/
extern struct tagGDI_DRIVER X11DRV_GDI_Driver;
BOOL X11DRV_GDI_Initialize(void);
void X11DRV_GDI_Finalize(void);
/* X11 GDI palette driver */
#define X11DRV_PALETTE_FIXED 0x0001 /* read-only colormap - have to use XAllocColor (if not virtual)*/
#define X11DRV_PALETTE_VIRTUAL 0x0002 /* no mapping needed - pixel == pixel color */
#define X11DRV_PALETTE_PRIVATE 0x1000 /* private colormap, identity mapping */
#define X11DRV_PALETTE_WHITESET 0x2000
extern Colormap X11DRV_PALETTE_PaletteXColormap;
extern UINT16 X11DRV_PALETTE_PaletteFlags;
extern int *X11DRV_PALETTE_PaletteToXPixel;
extern int *X11DRV_PALETTE_XPixelToPalette;
extern int X11DRV_PALETTE_mapEGAPixel[16];
extern BOOL X11DRV_PALETTE_Init(void);
extern void X11DRV_PALETTE_Cleanup(void);
extern COLORREF X11DRV_PALETTE_ToLogical(int pixel);
extern int X11DRV_PALETTE_ToPhysical(struct tagDC *dc, COLORREF color);
extern int X11DRV_PALETTE_LookupSystemXPixel(COLORREF col);
extern struct tagPALETTE_DRIVER X11DRV_PALETTE_Driver;
extern int X11DRV_PALETTE_SetMapping(struct tagPALETTEOBJ *palPtr, UINT uStart, UINT uNum, BOOL mapOnly);
extern int X11DRV_PALETTE_UpdateMapping(struct tagPALETTEOBJ *palPtr);
extern BOOL X11DRV_PALETTE_IsDark(int pixel);
/**************************************************************************
* X11 USER driver
*/
extern struct tagUSER_DRIVER X11DRV_USER_Driver;
extern Display *display;
extern Screen *X11DRV_GetXScreen(void);
extern Window X11DRV_GetXRootWindow(void);
extern BOOL X11DRV_USER_Initialize(void);
extern void X11DRV_USER_Finalize(void);
extern void X11DRV_USER_BeginDebugging(void);
extern void X11DRV_USER_EndDebugging(void);
/* X11 clipboard driver */
extern struct _CLIPBOARD_DRIVER X11DRV_CLIPBOARD_Driver;
extern struct tagCLIPBOARD_DRIVER X11DRV_CLIPBOARD_Driver;
extern void X11DRV_CLIPBOARD_EmptyClipboard(void);
extern void X11DRV_CLIPBOARD_SetClipboardData(UINT wFormat);
......@@ -229,15 +321,12 @@ extern void X11DRV_CLIPBOARD_ResetOwner(struct tagWND *pWnd, BOOL bFooBar);
void X11DRV_CLIPBOARD_ReadSelection(Window w, Atom prop);
void X11DRV_CLIPBOARD_ReleaseSelection(Window w, HWND hwnd);
/* X11 color driver */
extern Colormap X11DRV_COLOR_GetColormap(void);
/* X11 desktop driver */
extern struct _DESKTOP_DRIVER X11DRV_DESKTOP_Driver;
extern struct tagDESKTOP_DRIVER X11DRV_DESKTOP_Driver;
typedef struct _X11DRV_DESKTOP_DATA {
int dummy;
} X11DRV_DESKTOP_DATA;
struct tagDESKTOP;
......@@ -253,7 +342,7 @@ extern int X11DRV_DESKTOP_GetScreenDepth(struct tagDESKTOP *pDesktop);
/* X11 event driver */
extern struct _EVENT_DRIVER X11DRV_EVENT_Driver;
extern struct tagEVENT_DRIVER X11DRV_EVENT_Driver;
extern BOOL X11DRV_EVENT_Init(void);
extern void X11DRV_EVENT_AddIO(int fd, unsigned flag);
......@@ -269,28 +358,18 @@ extern void X11DRV_EVENT_WakeUp(void);
/* X11 keyboard driver */
extern struct _KEYBOARD_DRIVER X11DRV_KEYBOARD_Driver;
extern struct tagKEYBOARD_DRIVER X11DRV_KEYBOARD_Driver;
extern void X11DRV_KEYBOARD_Init(void);
extern WORD X11DRV_KEYBOARD_VkKeyScan(CHAR cChar);
extern UINT16 X11DRV_KEYBOARD_MapVirtualKey(UINT16 wCode, UINT16 wMapType);
extern INT16 X11DRV_KEYBOARD_GetKeyNameText(LONG lParam, LPSTR lpBuffer, INT16 nSize);
extern INT16 X11DRV_KEYBOARD_ToAscii(UINT16 virtKey, UINT16 scanCode, LPBYTE lpKeyState, LPVOID lpChar, UINT16 flags);
extern void KEYBOARD_HandleEvent( struct tagWND *pWnd, XKeyEvent *event );
extern void KEYBOARD_UpdateState ( void );
extern BOOL X11DRV_KEYBOARD_GetBeepActive(void);
extern void X11DRV_KEYBOARD_SetBeepActive(BOOL bActivate);
extern void X11DRV_KEYBOARD_Beep(void);
/* X11 main driver */
extern Display *display;
extern Screen *X11DRV_GetXScreen(void);
extern Window X11DRV_GetXRootWindow(void);
extern void X11DRV_MAIN_Finalize(void);
extern void X11DRV_MAIN_Initialize(void);
extern void X11DRV_MAIN_ParseOptions(int *argc, char *argv[]);
extern void X11DRV_MAIN_Create(void);
extern void X11DRV_MAIN_SaveSetup(void);
extern void X11DRV_MAIN_RestoreSetup(void);
extern void X11DRV_KEYBOARD_HandleEvent(struct tagWND *pWnd, XKeyEvent *event);
/* X11 monitor driver */
......@@ -311,20 +390,28 @@ extern Window X11DRV_MONITOR_GetXRootWindow(struct tagMONITOR *pMonitor);
extern void X11DRV_MONITOR_Initialize(struct tagMONITOR *pMonitor);
extern void X11DRV_MONITOR_Finalize(struct tagMONITOR *pMonitor);
extern BOOL X11DRV_MONITOR_IsSingleWindow(struct tagMONITOR *pMonitor);
extern int X11DRV_MONITOR_GetWidth(struct tagMONITOR *pMonitor);
extern int X11DRV_MONITOR_GetHeight(struct tagMONITOR *pMonitor);
extern int X11DRV_MONITOR_GetDepth(struct tagMONITOR *pMonitor);
extern BOOL X11DRV_MONITOR_GetScreenSaveActive(struct tagMONITOR *pMonitor);
extern void X11DRV_MONITOR_SetScreenSaveActive(struct tagMONITOR *pMonitor, BOOL bActivate);
extern int X11DRV_MONITOR_GetScreenSaveTimeout(struct tagMONITOR *pMonitor);
extern void X11DRV_MONITOR_SetScreenSaveTimeout(struct tagMONITOR *pMonitor, int nTimeout);
/* X11 mouse driver */
extern struct _MOUSE_DRIVER X11DRV_MOUSE_Driver;
extern struct tagMOUSE_DRIVER X11DRV_MOUSE_Driver;
extern BOOL X11DRV_MOUSE_DisableWarpPointer;
extern void X11DRV_MOUSE_SetCursor(struct tagCURSORICONINFO *lpCursor);
extern void X11DRV_MOUSE_MoveCursor(WORD wAbsX, WORD wAbsY);
extern BOOL X11DRV_MOUSE_EnableWarpPointer(BOOL bEnable);
/* X11 windows driver */
extern struct _WND_DRIVER X11DRV_WND_Driver;
extern struct tagWND_DRIVER X11DRV_WND_Driver;
typedef struct _X11DRV_WND_DATA {
Window window;
......
......@@ -7,11 +7,10 @@
#include "config.h"
#ifndef X_DISPLAY_MISSING
#include "ts_xlib.h"
#include "x11drv.h"
#else /* X_DISPLAY_MISSING */
#else /* !defined(X_DISPLAY_MISSING) */
#include "ttydrv.h"
#endif /* X_DISPLAY_MISSING */
#endif /* !defined(X_DISPLAY_MISSING) */
#include <locale.h>
#include <ctype.h>
......@@ -21,7 +20,7 @@
#ifdef MALLOC_DEBUGGING
# include <malloc.h>
#endif
#include "wine/winuser16.h"
#include "winbase.h"
#include "winsock.h"
#include "heap.h"
......@@ -39,6 +38,14 @@
#include "winnls.h"
#include "console.h"
#include "monitor.h"
#include "keyboard.h"
#include "gdi.h"
#include "user.h"
#include "wine/winuser16.h"
/**********************************************************************/
USER_DRIVER *USER_Driver = NULL;
/* when adding new languages look at ole/ole2nls.c
* for proper iso name and Windows code (add 0x0400
......@@ -100,7 +107,6 @@ struct options Options =
static char szUsage[] =
"%s\n"
"Usage: %s [options] \"program_name [arguments]\"\n"
#ifndef X_DISPLAY_MISSING
"\n"
"Options:\n"
" -backingstore Turn on backing store\n"
......@@ -128,7 +134,6 @@ static char szUsage[] =
" -version Display the Wine version\n"
" -winver Version to imitate (one of win31,win95,nt351,nt40)\n"
" -dosver DOS version to imitate (x.xx, e.g. 6.22). Only valid with -winver win31\n"
#endif /* X_DISPLAY_MISSING */
;
/***********************************************************************
......@@ -744,12 +749,6 @@ static void MAIN_ParseOptions( int *argc, char *argv[] )
exit(0);
}
}
#ifndef X_DISPLAY_MISSING
X11DRV_MAIN_ParseOptions(argc,argv);
#else /* X_DISPLAY_MISSING */
TTYDRV_MAIN_ParseOptions(argc,argv);
#endif /* X_DISPLAY_MISSING */
}
/***********************************************************************
......@@ -757,12 +756,9 @@ static void MAIN_ParseOptions( int *argc, char *argv[] )
*/
static void called_at_exit(void)
{
#ifndef X_DISPLAY_MISSING
X11DRV_MAIN_RestoreSetup();
#else /* X_DISPLAY_MISSING */
TTYDRV_MAIN_RestoreSetup();
#endif /* X_DISPLAY_MISSING */
COLOR_Cleanup();
GDI_Driver->pFinalize();
USER_Driver->pFinalize();
WINSOCK_Shutdown();
CONSOLE_Close();
}
......@@ -798,23 +794,16 @@ BOOL MAIN_WineInit( int *argc, char *argv[] )
gettimeofday( &tv, NULL);
MSG_WineStartTicks = (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
#ifndef X_DISPLAY_MISSING
X11DRV_MAIN_Initialize();
MAIN_ParseOptions( argc, argv );
X11DRV_MAIN_Create();
X11DRV_MAIN_SaveSetup();
#else /* !defined(X_DISPLAY_MISSING) */
TTYDRV_MAIN_Initialize();
MAIN_ParseOptions( argc, argv );
TTYDRV_MAIN_Create();
TTYDRV_MAIN_SaveSetup();
#endif /* !defined(X_DISPLAY_MISSING) */
MAIN_ParseOptions(argc, argv);
#ifndef X_DISPLAY_MISSING
MONITOR_PrimaryMonitor.pDriver = &X11DRV_MONITOR_Driver;
USER_Driver = &X11DRV_USER_Driver;
#else /* !defined(X_DISPLAY_MISSING) */
MONITOR_PrimaryMonitor.pDriver = &TTYDRV_MONITOR_Driver;
USER_Driver = &TTYDRV_USER_Driver;
#endif /* !defined(X_DISPLAY_MISSING) */
USER_Driver->pInitialize();
MONITOR_Initialize(&MONITOR_PrimaryMonitor);
if (Options.dllFlags)
......@@ -839,7 +828,7 @@ void WINAPI MessageBeep16( UINT16 i )
*/
BOOL WINAPI MessageBeep( UINT i )
{
TSXBell( display, 0 );
KEYBOARD_Beep();
return TRUE;
}
......@@ -850,7 +839,7 @@ BOOL WINAPI MessageBeep( UINT i )
BOOL WINAPI Beep( DWORD dwFreq, DWORD dwDur )
{
/* dwFreq and dwDur are ignored by Win95 */
TSXBell(display, 0);
KEYBOARD_Beep();
return TRUE;
}
......@@ -870,17 +859,14 @@ BOOL WINAPI SystemParametersInfoA( UINT uAction, UINT uParam,
LPVOID lpvParam, UINT fuWinIni )
{
int timeout;
int temp;
XKeyboardState keyboard_state;
switch (uAction) {
case SPI_GETBEEP:
TSXGetKeyboardControl(display, &keyboard_state);
if (keyboard_state.bell_percent == 0)
*(BOOL *) lpvParam = FALSE;
else
*(BOOL *) lpvParam = TRUE;
*(BOOL *) lpvParam = KEYBOARD_GetBeepActive();
break;
case SPI_SETBEEP:
KEYBOARD_SetBeepActive(uParam);
break;
case SPI_GETBORDER:
*(INT *)lpvParam = GetSystemMetrics( SM_CXFRAME );
......@@ -920,19 +906,18 @@ BOOL WINAPI SystemParametersInfoA( UINT uAction, UINT uParam,
*(BOOL*)lpvParam=GetSystemMetrics(SM_MENUDROPALIGNMENT); /* XXX check this */
break;
case SPI_GETSCREENSAVEACTIVE:
if ( GetProfileIntA( "windows", "ScreenSaveActive", 1 ) == 1 )
*(BOOL*)lpvParam = TRUE;
case SPI_GETSCREENSAVEACTIVE:
if(MONITOR_GetScreenSaveActive(&MONITOR_PrimaryMonitor) ||
GetProfileIntA( "windows", "ScreenSaveActive", 1 ) == 1)
*(BOOL*)lpvParam = TRUE;
else
*(BOOL*)lpvParam = FALSE;
break;
case SPI_GETSCREENSAVETIMEOUT:
#ifndef X_DISPLAY_MISSING
TSXGetScreenSaver(display, &timeout, &temp,&temp,&temp);
#else /* X_DISPLAY_MISSING */
timeout = GetProfileIntA( "windows", "ScreenSaveTimeout", 300 );
#endif /* X_DISPLAY_MISSING */
timeout = MONITOR_GetScreenSaveTimeout(&MONITOR_PrimaryMonitor);
if(!timeout)
timeout = GetProfileIntA( "windows", "ScreenSaveTimeout", 300 );
*(INT *) lpvParam = timeout * 1000;
break;
......@@ -1056,18 +1041,11 @@ BOOL16 WINAPI SystemParametersInfo16( UINT16 uAction, UINT16 uParam,
{
int timeout;
char buffer[256];
int temp;
XKeyboardState keyboard_state;
XKeyboardControl keyboard_value;
switch (uAction)
{
case SPI_GETBEEP:
TSXGetKeyboardControl(display, &keyboard_state);
if (keyboard_state.bell_percent == 0)
*(BOOL16 *) lpvParam = FALSE;
else
*(BOOL16 *) lpvParam = TRUE;
*(BOOL *) lpvParam = KEYBOARD_GetBeepActive();
break;
case SPI_GETBORDER:
......@@ -1109,18 +1087,17 @@ BOOL16 WINAPI SystemParametersInfo16( UINT16 uAction, UINT16 uParam,
break;
case SPI_GETSCREENSAVEACTIVE:
if ( GetProfileIntA( "windows", "ScreenSaveActive", 1 ) == 1 )
*(BOOL16 *) lpvParam = TRUE;
if(MONITOR_GetScreenSaveActive(&MONITOR_PrimaryMonitor) ||
GetProfileIntA( "windows", "ScreenSaveActive", 1 ) == 1)
*(BOOL16 *) lpvParam = TRUE;
else
*(BOOL16 *) lpvParam = FALSE;
break;
case SPI_GETSCREENSAVETIMEOUT:
#ifndef X_DISPLAY_MISSING
TSXGetScreenSaver(display, &timeout, &temp,&temp,&temp);
#else /* X_DISPLAY_MISSING */
timeout = GetProfileIntA( "windows", "ScreenSaveTimeout", 300 );
#endif /* X_DISPLAY_MISSING */
timeout = MONITOR_GetScreenSaveTimeout(&MONITOR_PrimaryMonitor);
if(!timeout)
timeout = GetProfileIntA( "windows", "ScreenSaveTimeout", 300 );
*(INT16 *) lpvParam = timeout;
break;
......@@ -1141,24 +1118,15 @@ BOOL16 WINAPI SystemParametersInfo16( UINT16 uAction, UINT16 uParam,
break;
case SPI_SETBEEP:
if (uParam == TRUE)
keyboard_value.bell_percent = -1;
else
keyboard_value.bell_percent = 0;
TSXChangeKeyboardControl(display, KBBellPercent,
&keyboard_value);
KEYBOARD_SetBeepActive(uParam);
break;
case SPI_SETSCREENSAVEACTIVE:
if (uParam == TRUE)
TSXActivateScreenSaver(display);
else
TSXResetScreenSaver(display);
MONITOR_SetScreenSaveActive(&MONITOR_PrimaryMonitor, uParam);
break;
case SPI_SETSCREENSAVETIMEOUT:
TSXSetScreenSaver(display, uParam, 60, DefaultBlanking,
DefaultExposures);
MONITOR_SetScreenSaveTimeout(&MONITOR_PrimaryMonitor, uParam);
break;
case SPI_SETDESKWALLPAPER:
......
......@@ -20,6 +20,50 @@
#include "monitor.h"
#include "wine/winuser16.h"
/**********************************************************************/
BITMAP_DRIVER *BITMAP_Driver = NULL;
/***********************************************************************
* BITMAP_GetPadding
*
* Return number of bytes to pad a scanline of 16-bit aligned Windows DDB data.
*/
INT BITMAP_GetPadding( int bmWidth, int bpp )
{
INT pad;
switch (bpp)
{
case 1:
pad = ((bmWidth-1) & 8) ? 0 : 1;
break;
case 8:
pad = (2 - (bmWidth & 1)) & 1;
break;
case 24:
pad = (bmWidth*3) & 1;
break;
case 32:
case 16:
case 15:
pad = 0; /* we have 16bit alignment already */
break;
case 4:
if (!(bmWidth & 3)) pad = 0;
else pad = ((4 - (bmWidth & 3)) + 1) / 2;
break;
default:
WARN(bitmap,"Unknown depth %d, please report.\n", bpp );
return -1;
}
return pad;
}
/***********************************************************************
* BITMAP_GetWidthBytes
......@@ -717,7 +761,7 @@ INT16 BITMAP_GetObject16( BITMAPOBJ * bmp, INT16 count, LPVOID buffer )
{
if ( count <= sizeof(BITMAP16) )
{
BITMAP *bmp32 = &bmp->dib->dibSection.dsBm;
BITMAP *bmp32 = &bmp->dib->dsBm;
BITMAP16 bmp16;
bmp16.bmType = bmp32->bmType;
bmp16.bmWidth = bmp32->bmWidth;
......@@ -768,7 +812,7 @@ INT BITMAP_GetObject( BITMAPOBJ * bmp, INT count, LPVOID buffer )
if (count > sizeof(DIBSECTION)) count = sizeof(DIBSECTION);
}
memcpy( buffer, &bmp->dib->dibSection, count );
memcpy( buffer, bmp->dib, count );
return count;
}
else
......
......@@ -31,7 +31,9 @@
#include <string.h>
#include <stdlib.h>
#include "wine/winbase16.h"
#include "wine/winuser16.h"
#include "heap.h"
#include "color.h"
#include "bitmap.h"
......@@ -827,7 +829,6 @@ HCURSOR16 CURSORICON_IconToCursor(HICON16 hIcon, BOOL bSemiTransparent)
unsigned xor_width, and_width, val_base = 0xffffffff >> (32 - bpp);
BYTE* pbc = NULL;
COLORREF col;
CURSORICONINFO cI;
TRACE(icon, "[%04x] %ix%i %ibpp (bogus %ibps)\n",
......@@ -867,8 +868,7 @@ HCURSOR16 CURSORICON_IconToCursor(HICON16 hIcon, BOOL bSemiTransparent)
unsigned *psc = (unsigned*)(psPtr + (ix * bpp)/8);
unsigned val = ((*psc) >> (ix * bpp)%8) & val_base;
col = COLOR_ToLogical(val);
if( (GetRValue(col) + GetGValue(col) + GetBValue(col)) > 0x180 )
if(!PALETTE_Driver->pIsDark(val))
{
pbc = pxbPtr + ix/8;
*pbc |= 0x80 >> (ix%8);
......
......@@ -5,8 +5,10 @@
*
*/
#ifndef X_DISPLAY_MISSING
#include "ts_xlib.h"
#include "x11drv.h"
#endif /* !defined(X_DISPLAY_MISSING) */
#include <stdlib.h>
#include <string.h>
......@@ -856,21 +858,27 @@ UINT WINAPI SetTextAlign( HDC hdc, UINT textAlign )
BOOL WINAPI GetDCOrgEx( HDC hDC, LPPOINT lpp )
{
DC * dc;
X11DRV_PDEVICE *physDev;
if (!lpp) return FALSE;
if (!(dc = (DC *) GDI_GetObjPtr( hDC, DC_MAGIC ))) return FALSE;
physDev = (X11DRV_PDEVICE *)dc->physDev;
#ifndef X_DISPLAY_MISSING
if (!(dc->w.flags & DC_MEMORY))
{
X11DRV_PDEVICE *physDev;
Window root;
int w, h, border, depth;
physDev = (X11DRV_PDEVICE *) dc->physDev;
/* FIXME: this is not correct for managed windows */
TSXGetGeometry( display, physDev->drawable, &root,
(int*)&lpp->x, (int*)&lpp->y, &w, &h, &border, &depth );
}
else lpp->x = lpp->y = 0;
else
#endif /* !defined(X_DISPLAY_MISSING) */
lpp->x = lpp->y = 0;
lpp->x += dc->w.DCOrgX; lpp->y += dc->w.DCOrgY;
GDI_HEAP_UNLOCK( hDC );
return TRUE;
......
......@@ -4,15 +4,14 @@
* Copyright 1993 Alexandre Julliard
*/
#include "config.h"
#ifndef X_DISPLAY_MISSING
#include "x11drv.h"
#else /* !defined(X_DISPLAY_MISSING) */
#include "ttydrv.h"
#endif /* !defined(X_DISPLAY_MISSING) */
#endif /* !defined(X_DISPLAY_MISSING */
#include <stdlib.h>
#include "bitmap.h"
#include "brush.h"
#include "dc.h"
......@@ -25,6 +24,10 @@
#include "debug.h"
#include "gdi.h"
/**********************************************************************/
GDI_DRIVER *GDI_Driver = NULL;
/***********************************************************************
* GDI stock objects
*/
......@@ -251,16 +254,16 @@ BOOL GDI_Init(void)
/* Initialize drivers */
#ifndef X_DISPLAY_MISSING
if( ! X11DRV_Init() )
return FALSE;
GDI_Driver = &X11DRV_GDI_Driver;
#else /* !defined(X_DISPLAY_MISSING) */
if( ! TTYDRV_GDI_Initialize() )
return FALSE;
#endif /* !defined(X_DISPLAY_MISSING) */
GDI_Driver = &TTYDRV_GDI_Driver;
#endif /* !defined(X_DISPLAY_MISSING */
GDI_Driver->pInitialize();
/* Create default palette */
/* Create default palette */
/* DR well *this* palette can't be moveable (?) */
/* DR well *this* palette can't be moveable (?) */
{
HPALETTE16 hpalette = PALETTE_Init();
if( !hpalette )
......
......@@ -10,6 +10,7 @@
#include <stdlib.h>
#include <string.h>
#include "gdi.h"
#include "color.h"
#include "palette.h"
......@@ -17,6 +18,8 @@
#include "debug.h"
#include "wine/winuser16.h"
PALETTE_DRIVER *PALETTE_Driver = NULL;
FARPROC pfnSelectPalette = NULL;
FARPROC pfnRealizePalette = NULL;
......@@ -134,7 +137,7 @@ HPALETTE16 WINAPI CreateHalftonePalette16(
HDC16 hdc) /* [in] Handle to device context */
{
return CreateHalftonePalette(hdc);
}
}
/***********************************************************************
......@@ -381,8 +384,9 @@ BOOL WINAPI AnimatePalette(
UINT u;
for( u = 0; u < NumEntries; u++ )
palPtr->logpalette.palPalEntry[u + StartIndex] = PaletteColors[u];
COLOR_SetMapping(palPtr, StartIndex, NumEntries,
hPal != hPrimaryPalette );
PALETTE_Driver->
pSetMapping(palPtr, StartIndex, NumEntries,
hPal != hPrimaryPalette );
GDI_HEAP_UNLOCK( hPal );
return TRUE;
}
......@@ -469,7 +473,7 @@ UINT WINAPI GetSystemPaletteEntries(
TRACE(palette, "hdc=%04x,start=%i,count=%i\n", hdc,start,count);
if (!(dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ))) return 0;
if (!entries) return COLOR_GetSystemPaletteSize();
if (!entries) return dc->w.devCaps->sizePalette;
if (start >= dc->w.devCaps->sizePalette)
{
GDI_HEAP_UNLOCK( hdc );
......@@ -516,9 +520,9 @@ UINT WINAPI GetNearestPaletteIndex(
UINT index = 0;
if( palObj )
index = COLOR_PaletteLookupPixel( palObj->logpalette.palPalEntry,
palObj->logpalette.palNumEntries,
NULL, color, FALSE );
index = COLOR_PaletteLookupPixel(palObj->logpalette.palPalEntry,
palObj->logpalette.palNumEntries,
NULL, color, FALSE );
TRACE(palette,"(%04x,%06lx): returning %d\n", hpalette, color, index );
GDI_HEAP_UNLOCK( hpalette );
......@@ -660,9 +664,10 @@ UINT16 WINAPI GDIRealizePalette16( HDC16 hdc )
return 0;
}
realized = COLOR_SetMapping(palPtr,0,palPtr->logpalette.palNumEntries,
(dc->w.hPalette != hPrimaryPalette) ||
(dc->w.hPalette == STOCK_DEFAULT_PALETTE));
realized = PALETTE_Driver->
pSetMapping(palPtr,0,palPtr->logpalette.palNumEntries,
(dc->w.hPalette != hPrimaryPalette) ||
(dc->w.hPalette == STOCK_DEFAULT_PALETTE));
GDI_HEAP_UNLOCK( dc->w.hPalette );
hLastRealizedPalette = dc->w.hPalette;
}
......@@ -682,7 +687,6 @@ UINT16 WINAPI RealizeDefaultPalette16( HDC16 hdc )
{
DC *dc;
PALETTEOBJ* palPtr;
int i, index, realized = 0;
TRACE(palette,"%04x\n", hdc );
......@@ -707,15 +711,7 @@ UINT16 WINAPI RealizeDefaultPalette16( HDC16 hdc )
/* lookup is needed to account for SetSystemPaletteUse() stuff */
for( i = 0; i < 20; i++ )
{
index = COLOR_LookupSystemPixel(*(COLORREF*)(palPtr->logpalette.palPalEntry + i));
/* mapping is allocated in COLOR_InitPalette() */
if( index != palPtr->mapping[i] ) { palPtr->mapping[i]=index; realized++; }
}
return realized;
return PALETTE_Driver->pUpdateMapping(palPtr);
}
/***********************************************************************
......@@ -798,12 +794,17 @@ UINT16 WINAPI RealizePalette16( HDC16 hDC )
UINT WINAPI RealizePalette(
HDC hDC) /* [in] Handle of device context */
{
UINT realized = GDIRealizePalette16( hDC );
DC *dc;
UINT realized;
if (!(dc = (DC *) GDI_GetObjPtr( hDC, DC_MAGIC ))) return 0;
realized = GDIRealizePalette16( hDC );
/* do not send anything if no colors were changed */
if( IsDCCurrentPalette16( hDC ) && realized &&
!(COLOR_GetSystemPaletteFlags() & COLOR_VIRTUAL) )
if( IsDCCurrentPalette16( hDC ) && realized &&
dc->w.devCaps->sizePalette )
{
/* Send palette change notification */
......@@ -811,6 +812,8 @@ UINT WINAPI RealizePalette(
if( (hWnd = WindowFromDC( hDC )) )
SendMessage16( HWND_BROADCAST, WM_PALETTECHANGED, hWnd, 0L);
}
GDI_HEAP_UNLOCK( hDC );
return realized;
}
......@@ -820,13 +823,21 @@ UINT WINAPI RealizePalette(
*/
INT16 WINAPI UpdateColors16( HDC16 hDC )
{
HWND hWnd = WindowFromDC( hDC );
DC *dc;
HWND hWnd;
if (!(dc = (DC *) GDI_GetObjPtr( hDC, DC_MAGIC ))) return 0;
hWnd = WindowFromDC( hDC );
/* Docs say that we have to remap current drawable pixel by pixel
* but it would take forever given the speed of XGet/PutPixel.
*/
if (hWnd && !(COLOR_GetSystemPaletteFlags() & COLOR_VIRTUAL) )
if (hWnd && dc->w.devCaps->sizePalette )
InvalidateRect( hWnd, NULL, FALSE );
GDI_HEAP_UNLOCK( hDC );
return 0x666;
}
......
......@@ -821,7 +821,6 @@ BOOL REGION_FrameRgn( HRGN hDest, HRGN hSrc, INT x, INT y )
* REGION_LPTODP
*
* Convert region to device co-ords for the supplied dc.
* Used by X11DRV_PaintRgn.
*/
BOOL REGION_LPTODP( HDC hdc, HRGN hDest, HRGN hSrc )
{
......
......@@ -21,18 +21,14 @@
#include "xmalloc.h"
#include "debug.h"
#ifndef X_DISPLAY_MISSING
extern CLIPBOARD_DRIVER X11DRV_CLIPBOARD_Driver;
#else /* X_DISPLAY_MISSING */
extern CLIPBOARD_DRIVER TTYDRV_CLIPBOARD_Driver;
#endif /* X_DISPLAY_MISSING */
#define CF_REGFORMATBASE 0xC000
/**************************************************************************
* internal variables
*/
CLIPBOARD_DRIVER *CLIPBOARD_Driver = NULL;
static HQUEUE16 hqClipLock = 0;
static BOOL bCBHasChanged = FALSE;
......@@ -72,19 +68,6 @@ static LPWINE_CLIPFORMAT __lookup_format( LPWINE_CLIPFORMAT lpFormat, WORD wID )
return lpFormat;
}
/**************************************************************************
* CLIPBOARD_GetDriver
*/
CLIPBOARD_DRIVER *CLIPBOARD_GetDriver()
{
#ifndef X_DISPLAY_MISSING
return &X11DRV_CLIPBOARD_Driver;
#else /* X_DISPLAY_MISSING */
return &TTYDRV_CLIPBOARD_Driver;
#endif /* X_DISPLAY_MISSING */
};
/**************************************************************************
* CLIPBOARD_ResetLock
*/
......@@ -267,7 +250,7 @@ BOOL WINAPI EmptyClipboard(void)
hWndClipOwner = hWndClipWindow;
CLIPBOARD_GetDriver()->pEmptyClipboard();
CLIPBOARD_Driver->pEmptyClipboard();
return TRUE;
}
......@@ -310,7 +293,7 @@ HANDLE16 WINAPI SetClipboardData16( UINT16 wFormat, HANDLE16 hData )
if( (hqClipLock != GetFastQueue16()) || !lpFormat ||
(!hData && (!hWndClipOwner || (hWndClipOwner != hWndClipWindow))) ) return 0;
CLIPBOARD_GetDriver()->pSetClipboardData(wFormat);
CLIPBOARD_Driver->pSetClipboardData(wFormat);
if ( lpFormat->wDataPresent || lpFormat->hData16 || lpFormat->hData32 )
{
......@@ -358,7 +341,7 @@ HANDLE WINAPI SetClipboardData( UINT wFormat, HANDLE hData )
if( (hqClipLock != GetFastQueue16()) || !lpFormat ||
(!hData && (!hWndClipOwner || (hWndClipOwner != hWndClipWindow))) ) return 0;
CLIPBOARD_GetDriver()->pSetClipboardData(wFormat);
CLIPBOARD_Driver->pSetClipboardData(wFormat);
if ( lpFormat->wDataPresent || lpFormat->hData16 || lpFormat->hData32 )
{
......@@ -626,7 +609,7 @@ INT WINAPI CountClipboardFormats(void)
TRACE(clipboard,"(void)\n");
/* FIXME: Returns BOOL32 */
CLIPBOARD_GetDriver()->pRequestSelection();
CLIPBOARD_Driver->pRequestSelection();
FormatCount += abs(lpFormat[CF_TEXT-1].wDataPresent -
lpFormat[CF_OEMTEXT-1].wDataPresent);
......@@ -668,7 +651,7 @@ UINT WINAPI EnumClipboardFormats( UINT wFormat )
if( hqClipLock != GetFastQueue16() ) return 0;
if( (!wFormat || wFormat == CF_TEXT || wFormat == CF_OEMTEXT) )
CLIPBOARD_GetDriver()->pRequestSelection();
CLIPBOARD_Driver->pRequestSelection();
if (wFormat == 0)
{
......@@ -895,7 +878,7 @@ BOOL WINAPI IsClipboardFormatAvailable( UINT wFormat )
TRACE(clipboard,"(%04X) !\n", wFormat);
if( (wFormat == CF_TEXT || wFormat == CF_OEMTEXT) )
CLIPBOARD_GetDriver()->pRequestSelection();
CLIPBOARD_Driver->pRequestSelection();
return CLIPBOARD_IsPresent(wFormat);
}
......
......@@ -17,8 +17,7 @@
* DCX_WINDOWPAINT - BeginPaint() is in effect
*/
#include "x11drv.h"
#include "desktop.h"
#include "options.h"
#include "dce.h"
#include "class.h"
......@@ -798,11 +797,9 @@ HDC WINAPI GetDCEx( HWND hwnd, HRGN hrgnClip, DWORD flags )
hrgnVisible = CreateRectRgn( 0, 0, 0, 0 );
WIN_ReleaseWndPtr(parentPtr);
}
else
if ((hwnd == GetDesktopWindow()) &&
(X11DRV_WND_GetXRootWindow(wndPtr) == DefaultRootWindow(display)))
hrgnVisible = CreateRectRgn( 0, 0, SYSMETRICS_CXSCREEN,
SYSMETRICS_CYSCREEN );
else
if ((hwnd == GetDesktopWindow()) && !DESKTOP_IsSingleWindow())
hrgnVisible = CreateRectRgn( 0, 0, SYSMETRICS_CXSCREEN, SYSMETRICS_CYSCREEN );
else
{
hrgnVisible = DCE_GetVisRgn( hwnd, flags, 0, 0 );
......
......@@ -6,6 +6,7 @@
*/
#include <string.h>
#include "win.h"
#include "user.h"
#include "heap.h"
......
......@@ -5,29 +5,11 @@
*
*/
#include "config.h"
#include "display.h"
#include "debug.h"
#include "display.h"
#include "mouse.h"
#include "windef.h"
#ifndef X_DISPLAY_MISSING
extern MOUSE_DRIVER X11DRV_MOUSE_Driver;
#else /* X_DISPLAY_MISSING */
extern MOUSE_DRIVER TTYDRV_MOUSE_Driver;
#endif /* X_DISPLAY_MISSING */
/***********************************************************************
* MOUSE_GetDriver()
*/
MOUSE_DRIVER *MOUSE_GetDriver()
{
#ifndef X_DISPLAY_MISSING
return &X11DRV_MOUSE_Driver;
#else /* X_DISPLAY_MISSING */
return &TTYDRV_MOUSE_Driver;
#endif /* X_DISPLAY_MISSING */
}
#include "wine/winuser16.h"
/***********************************************************************
* DISPLAY_Inquire (DISPLAY.101)
......@@ -45,7 +27,7 @@ WORD WINAPI DISPLAY_Inquire(LPCURSORINFO lpCursorInfo)
*/
VOID WINAPI DISPLAY_SetCursor( CURSORICONINFO *lpCursor )
{
MOUSE_GetDriver()->pSetCursor(lpCursor);
MOUSE_Driver->pSetCursor(lpCursor);
}
/***********************************************************************
......@@ -53,7 +35,7 @@ VOID WINAPI DISPLAY_SetCursor( CURSORICONINFO *lpCursor )
*/
VOID WINAPI DISPLAY_MoveCursor( WORD wAbsX, WORD wAbsY )
{
MOUSE_GetDriver()->pMoveCursor(wAbsX, wAbsY);
MOUSE_Driver->pMoveCursor(wAbsX, wAbsY);
}
/***********************************************************************
......
......@@ -5,27 +5,11 @@
*
*/
#include "config.h"
#include "message.h"
#ifndef X_DISPLAY_MISSING
extern EVENT_DRIVER X11DRV_EVENT_Driver;
#else /* X_DISPLAY_MISSING */
extern EVENT_DRIVER TTYDRV_EVENT_Driver;
#endif /* X_DISPLAY_MISSING */
/**********************************************************************/
/***********************************************************************
* EVENT_GetDriver
*/
EVENT_DRIVER *EVENT_GetDriver(void)
{
#ifndef X_DISPLAY_MISSING
return &X11DRV_EVENT_Driver;
#else /* X_DISPLAY_MISSING */
return &TTYDRV_EVENT_Driver;
#endif /* X_DISPLAY_MISSING */
}
EVENT_DRIVER *EVENT_Driver = NULL;
/***********************************************************************
* EVENT_Init
......@@ -34,7 +18,7 @@ EVENT_DRIVER *EVENT_GetDriver(void)
*/
BOOL EVENT_Init(void)
{
return EVENT_GetDriver()->pInit();
return EVENT_Driver->pInit();
}
/***********************************************************************
......@@ -42,7 +26,7 @@ BOOL EVENT_Init(void)
*/
void EVENT_AddIO(int fd, unsigned io_type)
{
EVENT_GetDriver()->pAddIO(fd, io_type);
EVENT_Driver->pAddIO(fd, io_type);
}
/***********************************************************************
......@@ -50,7 +34,7 @@ void EVENT_AddIO(int fd, unsigned io_type)
*/
void EVENT_DeleteIO(int fd, unsigned io_type)
{
EVENT_GetDriver()->pDeleteIO(fd, io_type);
EVENT_Driver->pDeleteIO(fd, io_type);
}
/***********************************************************************
......@@ -62,7 +46,7 @@ void EVENT_DeleteIO(int fd, unsigned io_type)
*/
BOOL EVENT_WaitNetEvent(BOOL sleep, BOOL peek)
{
return EVENT_GetDriver()->pWaitNetEvent(sleep, peek);
return EVENT_Driver->pWaitNetEvent(sleep, peek);
}
/***********************************************************************
......@@ -72,7 +56,7 @@ BOOL EVENT_WaitNetEvent(BOOL sleep, BOOL peek)
*/
void EVENT_Synchronize(void)
{
EVENT_GetDriver()->pSynchronize();
EVENT_Driver->pSynchronize();
}
/**********************************************************************
......@@ -80,7 +64,7 @@ void EVENT_Synchronize(void)
*/
BOOL EVENT_CheckFocus(void)
{
return EVENT_GetDriver()->pCheckFocus();
return EVENT_Driver->pCheckFocus();
}
/***********************************************************************
......@@ -88,7 +72,7 @@ BOOL EVENT_CheckFocus(void)
*/
BOOL EVENT_QueryPointer(DWORD *posX, DWORD *posY, DWORD *state)
{
return EVENT_GetDriver()->pQueryPointer(posX, posY, state);
return EVENT_Driver->pQueryPointer(posX, posY, state);
}
......@@ -99,15 +83,15 @@ BOOL EVENT_QueryPointer(DWORD *posX, DWORD *posY, DWORD *state)
*/
void EVENT_DummyMotionNotify(void)
{
EVENT_GetDriver()->pDummyMotionNotify();
EVENT_Driver->pDummyMotionNotify();
}
/**********************************************************************
* X11DRV_EVENT_Pending
* EVENT_Pending
*/
BOOL EVENT_Pending()
{
return EVENT_GetDriver()->pPending();
return EVENT_Driver->pPending();
}
/***********************************************************************
......@@ -117,7 +101,7 @@ BOOL EVENT_Pending()
*/
BOOL16 WINAPI IsUserIdle16(void)
{
return EVENT_GetDriver()->pIsUserIdle();
return EVENT_Driver->pIsUserIdle();
}
/***********************************************************************
......@@ -129,5 +113,5 @@ BOOL16 WINAPI IsUserIdle16(void)
*/
void EVENT_WakeUp(void)
{
EVENT_GetDriver()->pWakeUp();
EVENT_Driver->pWakeUp();
}
......@@ -9,11 +9,10 @@
*
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "winuser.h"
#include "wine/keyboard16.h"
#include "win.h"
......@@ -25,26 +24,12 @@
#include "struct32.h"
#include "winerror.h"
static LPKEYBD_EVENT_PROC DefKeybEventProc = NULL;
LPBYTE pKeyStateTable = NULL;
/**********************************************************************/
#ifndef X_DISPLAY_MISSING
extern KEYBOARD_DRIVER X11DRV_KEYBOARD_Driver;
#else /* X_DISPLAY_MISSING */
extern KEYBOARD_DRIVER TTYDRV_KEYBOARD_Driver;
#endif /* X_DISPLAY_MISSING */
KEYBOARD_DRIVER *KEYBOARD_Driver = NULL;
/***********************************************************************
* KEYBOARD_GetDriver
*/
KEYBOARD_DRIVER *KEYBOARD_GetDriver()
{
#ifndef X_DISPLAY_MISSING
return &X11DRV_KEYBOARD_Driver;
#else /* X_DISPLAY_MISSING */
return &TTYDRV_KEYBOARD_Driver;
#endif /* X_DISPLAY_MISSING */
}
static LPKEYBD_EVENT_PROC DefKeybEventProc = NULL;
LPBYTE pKeyStateTable = NULL;
/***********************************************************************
* KEYBOARD_Inquire (KEYBOARD.1)
......@@ -74,7 +59,7 @@ VOID WINAPI KEYBOARD_Enable( LPKEYBD_EVENT_PROC lpKeybEventProc,
/* all states to false */
memset( lpKeyState, 0, sizeof(lpKeyState) );
if (!initDone) KEYBOARD_GetDriver()->pInit();
if (!initDone) KEYBOARD_Driver->pInit();
initDone = TRUE;
}
......@@ -145,7 +130,7 @@ DWORD WINAPI OemKeyScan(WORD wOemChar)
WORD WINAPI VkKeyScan16(CHAR cChar)
{
return KEYBOARD_GetDriver()->pVkKeyScan(cChar);
return KEYBOARD_Driver->pVkKeyScan(cChar);
}
/******************************************************************************
......@@ -178,7 +163,7 @@ INT16 WINAPI GetKeyboardType16(INT16 nTypeFlag)
*/
UINT16 WINAPI MapVirtualKey16(UINT16 wCode, UINT16 wMapType)
{
return KEYBOARD_GetDriver()->pMapVirtualKey(wCode,wMapType);
return KEYBOARD_Driver->pMapVirtualKey(wCode,wMapType);
}
/****************************************************************************
......@@ -195,7 +180,7 @@ INT16 WINAPI GetKBCodePage16(void)
*/
INT16 WINAPI GetKeyNameText16(LONG lParam, LPSTR lpBuffer, INT16 nSize)
{
return KEYBOARD_GetDriver()->pGetKeyNameText(lParam, lpBuffer, nSize);
return KEYBOARD_Driver->pGetKeyNameText(lParam, lpBuffer, nSize);
}
/****************************************************************************
......@@ -219,8 +204,32 @@ INT16 WINAPI GetKeyNameText16(LONG lParam, LPSTR lpBuffer, INT16 nSize)
INT16 WINAPI ToAscii16(UINT16 virtKey,UINT16 scanCode, LPBYTE lpKeyState,
LPVOID lpChar, UINT16 flags)
{
return KEYBOARD_GetDriver()->pToAscii(
return KEYBOARD_Driver->pToAscii(
virtKey, scanCode, lpKeyState, lpChar, flags
);
}
/***********************************************************************
* KEYBOARD_GetBeepActive
*/
BOOL KEYBOARD_GetBeepActive()
{
return KEYBOARD_Driver->pGetBeepActive();
}
/***********************************************************************
* KEYBOARD_SetBeepActive
*/
void KEYBOARD_SetBeepActive(BOOL bActivate)
{
KEYBOARD_Driver->pSetBeepActive(bActivate);
}
/***********************************************************************
* KEYBOARD_Beep
*/
void KEYBOARD_Beep(void)
{
KEYBOARD_Driver->pBeep();
}
......@@ -5,17 +5,14 @@
*
*/
#include <assert.h>
#include "winuser.h"
#include "gdi.h"
#include "mouse.h"
#include "debug.h"
#include "debugtools.h"
#include "mouse.h"
#include "monitor.h"
#include "winuser.h"
/**********************************************************************/
extern BOOL X11DRV_MOUSE_DisableWarpPointer;
MOUSE_DRIVER *MOUSE_Driver = NULL;
static LPMOUSE_EVENT_PROC DefMouseEventProc = NULL;
......@@ -62,6 +59,7 @@ void MOUSE_SendEvent( DWORD mouseStatus, DWORD posX, DWORD posY,
int width = MONITOR_GetWidth (&MONITOR_PrimaryMonitor);
int height = MONITOR_GetHeight(&MONITOR_PrimaryMonitor);
WINE_MOUSEEVENT wme;
BOOL bOldWarpPointer;
if ( !DefMouseEventProc ) return;
......@@ -76,8 +74,7 @@ void MOUSE_SendEvent( DWORD mouseStatus, DWORD posX, DWORD posY,
wme.time = time;
wme.hWnd = hWnd;
X11DRV_MOUSE_DisableWarpPointer = TRUE;
bOldWarpPointer = MOUSE_Driver->pEnableWarpPointer(FALSE);
DefMouseEventProc( mouseStatus, posX, posY, 0, (DWORD)&wme );
X11DRV_MOUSE_DisableWarpPointer = FALSE;
MOUSE_Driver->pEnableWarpPointer(bOldWarpPointer);
}
......@@ -4,9 +4,13 @@
* Copyright 1998 Turchanov Sergey
*/
#include "monitor.h"
#include "winbase.h"
#include "winuser.h"
#include "monitor.h"
/**********************************************************************/
MONITOR_DRIVER *MONITOR_Driver;
/**********************************************************************/
......@@ -15,11 +19,26 @@
MONITOR MONITOR_PrimaryMonitor;
/***********************************************************************
* MONITOR_GetMonitor
*/
MONITOR *MONITOR_GetMonitor(HMONITOR hMonitor)
{
if(hMonitor == xPRIMARY_MONITOR)
{
return &MONITOR_PrimaryMonitor;
}
else
{
return NULL;
}
}
/***********************************************************************
* MONITOR_Initialize
*/
void MONITOR_Initialize(MONITOR *pMonitor)
{
pMonitor->pDriver->pInitialize(pMonitor);
MONITOR_Driver->pInitialize(pMonitor);
}
/***********************************************************************
......@@ -27,7 +46,15 @@ void MONITOR_Initialize(MONITOR *pMonitor)
*/
void MONITOR_Finalize(MONITOR *pMonitor)
{
pMonitor->pDriver->pFinalize(pMonitor);
MONITOR_Driver->pFinalize(pMonitor);
}
/***********************************************************************
* MONITOR_IsSingleWindow
*/
BOOL MONITOR_IsSingleWindow(MONITOR *pMonitor)
{
return MONITOR_Driver->pIsSingleWindow(pMonitor);
}
/***********************************************************************
......@@ -35,7 +62,7 @@ void MONITOR_Finalize(MONITOR *pMonitor)
*/
int MONITOR_GetWidth(MONITOR *pMonitor)
{
return pMonitor->pDriver->pGetWidth(pMonitor);
return MONITOR_Driver->pGetWidth(pMonitor);
}
/***********************************************************************
......@@ -43,7 +70,7 @@ int MONITOR_GetWidth(MONITOR *pMonitor)
*/
int MONITOR_GetHeight(MONITOR *pMonitor)
{
return pMonitor->pDriver->pGetHeight(pMonitor);
return MONITOR_Driver->pGetHeight(pMonitor);
}
/***********************************************************************
......@@ -51,9 +78,42 @@ int MONITOR_GetHeight(MONITOR *pMonitor)
*/
int MONITOR_GetDepth(MONITOR *pMonitor)
{
return pMonitor->pDriver->pGetDepth(pMonitor);
return MONITOR_Driver->pGetDepth(pMonitor);
}
/***********************************************************************
* MONITOR_GetScreenSaveActive
*/
BOOL MONITOR_GetScreenSaveActive(MONITOR *pMonitor)
{
return MONITOR_Driver->pGetScreenSaveActive(pMonitor);
}
/***********************************************************************
* MONITOR_SetScreenSaveActive
*/
void MONITOR_SetScreenSaveActive(MONITOR *pMonitor, BOOL bActivate)
{
MONITOR_Driver->pSetScreenSaveActive(pMonitor, bActivate);
}
/***********************************************************************
* MONITOR_GetScreenSaveTimeout
*/
int MONITOR_GetScreenSaveTimeout(MONITOR *pMonitor)
{
return MONITOR_Driver->pGetScreenSaveTimeout(pMonitor);
}
/***********************************************************************
* MONITOR_SetScreenSaveTimeout
*/
void MONITOR_SetScreenSaveTimeout(MONITOR *pMonitor, int nTimeout)
{
MONITOR_Driver->pSetScreenSaveTimeout(pMonitor, nTimeout);
}
/**********************************************************************/
HMONITOR WINAPI MonitorFromPoint(POINT ptScreenCoords, DWORD dwFlags)
......
......@@ -8,6 +8,7 @@
*/
#include <stdlib.h>
#include "winuser.h"
#include "class.h"
#include "dc.h"
......
......@@ -6,12 +6,22 @@
#include "clipboard.h"
#include "desktop.h"
#include "display.h"
#include "keyboard.h"
#include "message.h"
#include "monitor.h"
#include "mouse.h"
#include "user.h"
#include "win.h"
#include "ttydrv.h"
USER_DRIVER TTYDRV_USER_Driver =
{
TTYDRV_USER_Initialize,
TTYDRV_USER_Finalize,
TTYDRV_USER_BeginDebugging,
TTYDRV_USER_EndDebugging
};
CLIPBOARD_DRIVER TTYDRV_CLIPBOARD_Driver =
{
TTYDRV_CLIPBOARD_EmptyClipboard,
......@@ -47,22 +57,31 @@ KEYBOARD_DRIVER TTYDRV_KEYBOARD_Driver =
TTYDRV_KEYBOARD_VkKeyScan,
TTYDRV_KEYBOARD_MapVirtualKey,
TTYDRV_KEYBOARD_GetKeyNameText,
TTYDRV_KEYBOARD_ToAscii
TTYDRV_KEYBOARD_ToAscii,
TTYDRV_KEYBOARD_GetBeepActive,
TTYDRV_KEYBOARD_SetBeepActive,
TTYDRV_KEYBOARD_Beep
};
MONITOR_DRIVER TTYDRV_MONITOR_Driver =
{
TTYDRV_MONITOR_Initialize,
TTYDRV_MONITOR_Finalize,
TTYDRV_MONITOR_IsSingleWindow,
TTYDRV_MONITOR_GetWidth,
TTYDRV_MONITOR_GetHeight,
TTYDRV_MONITOR_GetDepth
TTYDRV_MONITOR_GetDepth,
TTYDRV_MONITOR_GetScreenSaveActive,
TTYDRV_MONITOR_SetScreenSaveActive,
TTYDRV_MONITOR_GetScreenSaveTimeout,
TTYDRV_MONITOR_SetScreenSaveTimeout
};
MOUSE_DRIVER TTYDRV_MOUSE_Driver =
{
TTYDRV_MOUSE_SetCursor,
TTYDRV_MOUSE_MoveCursor
TTYDRV_MOUSE_MoveCursor,
TTYDRV_MOUSE_EnableWarpPointer
};
WND_DRIVER TTYDRV_WND_Driver =
......
......@@ -53,6 +53,27 @@ INT16 TTYDRV_KEYBOARD_ToAscii(
return 0;
}
/***********************************************************************
* TTYDRV_KEYBOARD_GetBeepActive
*/
BOOL TTYDRV_KEYBOARD_GetBeepActive()
{
return FALSE;
}
/***********************************************************************
* TTYDRV_KEYBOARD_SetBeepActive
*/
void TTYDRV_KEYBOARD_SetBeepActive(BOOL bActivate)
{
}
/***********************************************************************
* TTYDRV_KEYBOARD_Beep
*/
void TTYDRV_KEYBOARD_Beep()
{
}
......
......@@ -5,46 +5,50 @@
*
*/
#include "clipboard.h"
#include "desktop.h"
#include "message.h"
#include "keyboard.h"
#include "monitor.h"
#include "mouse.h"
#include "ttydrv.h"
#include "win.h"
/***********************************************************************
* TTYDRV_MAIN_Initialize
* TTYDRV_USER_Initialize
*/
void TTYDRV_MAIN_Initialize()
BOOL TTYDRV_USER_Initialize(void)
{
}
CLIPBOARD_Driver = &TTYDRV_CLIPBOARD_Driver;
DESKTOP_Driver = &TTYDRV_DESKTOP_Driver;
EVENT_Driver = &TTYDRV_EVENT_Driver;
KEYBOARD_Driver = &TTYDRV_KEYBOARD_Driver;
MONITOR_Driver = &TTYDRV_MONITOR_Driver;
MOUSE_Driver = &TTYDRV_MOUSE_Driver;
WND_Driver = &TTYDRV_WND_Driver;
/***********************************************************************
* TTYDRV_MAIN_Finalize
*/
void TTYDRV_MAIN_Finalize()
{
return TRUE;
}
/***********************************************************************
* TTYDRV_MAIN_ParseOptions
* TTYDRV_USER_Finalize
*/
void TTYDRV_MAIN_ParseOptions(int *argc, char *argv[])
void TTYDRV_USER_Finalize(void)
{
}
/***********************************************************************
* TTYDRV_MAIN_Create
/**************************************************************************
* TTYDRV_USER_BeginDebugging
*/
void TTYDRV_MAIN_Create()
void TTYDRV_USER_BeginDebugging(void)
{
}
/***********************************************************************
* TTYDRV_MAIN_SaveSetup
/**************************************************************************
* TTYDRV_USER_EndDebugging
*/
void TTYDRV_MAIN_SaveSetup()
void TTYDRV_USER_EndDebugging(void)
{
}
/***********************************************************************
* TTYDRV_MAIN_RestoreSetup
*/
void TTYDRV_MAIN_RestoreSetup()
{
}
......@@ -34,6 +34,14 @@ void TTYDRV_MONITOR_Finalize(MONITOR *pMonitor)
}
/***********************************************************************
* TTYDRV_MONITOR_IsSingleWindow
*/
BOOL TTYDRV_MONITOR_IsSingleWindow(MONITOR *pMonitor)
{
return TRUE;
}
/***********************************************************************
* TTYDRV_MONITOR_GetWidth
*
* Return the width of the monitor
......@@ -71,3 +79,42 @@ int TTYDRV_MONITOR_GetDepth(MONITOR *pMonitor)
return pTTYMonitor->depth;
}
/***********************************************************************
* TTYDRV_MONITOR_GetScreenSaveActive
*
* Returns the active status of the screen saver
*/
BOOL TTYDRV_MONITOR_GetScreenSaveActive(MONITOR *pMonitor)
{
return FALSE;
}
/***********************************************************************
* TTYDRV_MONITOR_SetScreenSaveActive
*
* Activate/Deactivate the screen saver
*/
void TTYDRV_MONITOR_SetScreenSaveActive(MONITOR *pMonitor, BOOL bActivate)
{
}
/***********************************************************************
* TTYDRV_MONITOR_GetScreenSaveTimeout
*
* Return the screen saver timeout
*/
int TTYDRV_MONITOR_GetScreenSaveTimeout(MONITOR *pMonitor)
{
return 0;
}
/***********************************************************************
* TTYDRV_MONITOR_SetScreenSaveTimeout
*
* Set the screen saver timeout
*/
void TTYDRV_MONITOR_SetScreenSaveTimeout(
MONITOR *pMonitor, int nTimeout)
{
}
......@@ -19,3 +19,11 @@ void TTYDRV_MOUSE_SetCursor( CURSORICONINFO *lpCursor )
void TTYDRV_MOUSE_MoveCursor(WORD wAbsX, WORD wAbsY)
{
}
/***********************************************************************
* TTYDRV_MOUSE_EnableWarpPointer
*/
BOOL TTYDRV_MOUSE_EnableWarpPointer(BOOL bEnable)
{
return TRUE;
}
......@@ -48,7 +48,7 @@ BOOL TTYDRV_WND_DestroyWindow(WND *wndPtr)
}
/*****************************************************************
* X11DRV_WND_SetParent
* TTYDRV_WND_SetParent
*/
WND *TTYDRV_WND_SetParent(WND *wndPtr, WND *pWndParent)
{
......@@ -64,8 +64,6 @@ void TTYDRV_WND_ForceWindowRaise(WND *wndPtr)
/***********************************************************************
* WINPOS_SetXWindowPos
*
* SetWindowPos() for an X window. Used by the real SetWindowPos().
*/
void TTYDRV_WND_SetWindowPos(WND *wndPtr, const WINDOWPOS *winpos, BOOL bSMC_SETXPOS)
{
......@@ -131,4 +129,3 @@ BOOL TTYDRV_WND_IsSelfClipping(WND *wndPtr)
{
return FALSE;
}
......@@ -4,8 +4,6 @@
* Copyright 1993, 1994 Alexandre Julliard
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include "wine/winbase16.h"
......@@ -36,13 +34,9 @@
#include "local.h"
#include "desktop.h"
#ifndef X_DISPLAY_MISSING
extern DESKTOP_DRIVER X11DRV_DESKTOP_Driver;
extern WND_DRIVER X11DRV_WND_Driver;
#else /* X_DISPLAY_MISSING */
extern DESKTOP_DRIVER TTYDRV_DESKTOP_Driver;
extern WND_DRIVER TTYDRV_WND_Driver;
#endif /* X_DISPLAY_MISSING */
/**********************************************************************/
WND_DRIVER *WND_Driver = NULL;
/* Desktop window */
static WND *pWndDesktop = NULL;
......@@ -624,13 +618,8 @@ BOOL WIN_CreateDesktopWindow(void)
pWndDesktop = (WND *) USER_HEAP_LIN_ADDR( hwndDesktop );
pDesktop = (DESKTOP *) pWndDesktop->wExtra;
#ifndef X_DISPLAY_MISSING
pDesktop->pDriver = &X11DRV_DESKTOP_Driver;
pWndDesktop->pDriver = &X11DRV_WND_Driver;
#else /* X_DISPLAY_MISSING */
pDesktop->pDriver = &TTYDRV_DESKTOP_Driver;
pWndDesktop->pDriver = &TTYDRV_WND_Driver;
#endif /* X_DISPLAY_MISSING */
pDesktop->pDriver = DESKTOP_Driver;
pWndDesktop->pDriver = WND_Driver;
pDesktop->pDriver->pInitialize(pDesktop);
pWndDesktop->pDriver->pInitialize(pWndDesktop);
......@@ -1179,7 +1168,7 @@ static void WIN_SendDestroyMsg( WND* pWnd )
WIN_CheckFocus(pWnd);
if( CARET_GetHwnd() == pWnd->hwndSelf ) DestroyCaret();
CLIPBOARD_GetDriver()->pResetOwner( pWnd, TRUE );
CLIPBOARD_Driver->pResetOwner( pWnd, TRUE );
/*
* Send the WM_DESTROY to the window.
......@@ -1320,7 +1309,7 @@ BOOL WINAPI DestroyWindow( HWND hwnd )
}
}
CLIPBOARD_GetDriver()->pResetOwner( wndPtr, FALSE ); /* before the window is unmapped */
CLIPBOARD_Driver->pResetOwner( wndPtr, FALSE ); /* before the window is unmapped */
/* Hide the window */
......
......@@ -5,8 +5,6 @@
* 1995, 1996, 1999 Alex Korobka
*/
#include "x11drv.h"
#include <string.h>
#include "sysmetrics.h"
#include "heap.h"
......
......@@ -1156,7 +1156,10 @@ static void EVENT_DropFromOffiX( WND *pWnd, XClientMessageEvent *event )
unsigned char* p_data = NULL;
union {
Atom atom_aux;
POINT pt_aux;
struct {
int x;
int y;
} pt_aux;
int i;
} u;
int x, y;
......@@ -1278,7 +1281,6 @@ static void EVENT_DropURLs( WND *pWnd, XClientMessageEvent *event )
int x, y, drop32 = FALSE ;
union {
Atom atom_aux;
POINT pt_aux;
int i;
Window w_aux;
} u; /* unused */
......@@ -1456,7 +1458,7 @@ void EVENT_EnterNotify( WND *pWnd, XCrossingEvent *event )
{
if( !Options.managed && X11DRV_GetXRootWindow() == DefaultRootWindow(display) &&
(COLOR_GetSystemPaletteFlags() & COLOR_PRIVATE) && GetFocus() )
TSXInstallColormap( display, X11DRV_COLOR_GetColormap() );
TSXInstallColormap( display, X11DRV_PALETTE_GetColormap() );
}
#endif
......
......@@ -10,13 +10,22 @@
#include "clipboard.h"
#include "desktop.h"
#include "display.h"
#include "keyboard.h"
#include "message.h"
#include "monitor.h"
#include "mouse.h"
#include "user.h"
#include "win.h"
#include "x11drv.h"
USER_DRIVER X11DRV_USER_Driver =
{
X11DRV_USER_Initialize,
X11DRV_USER_Finalize,
X11DRV_USER_BeginDebugging,
X11DRV_USER_EndDebugging
};
CLIPBOARD_DRIVER X11DRV_CLIPBOARD_Driver =
{
X11DRV_CLIPBOARD_EmptyClipboard,
......@@ -52,22 +61,31 @@ KEYBOARD_DRIVER X11DRV_KEYBOARD_Driver =
X11DRV_KEYBOARD_VkKeyScan,
X11DRV_KEYBOARD_MapVirtualKey,
X11DRV_KEYBOARD_GetKeyNameText,
X11DRV_KEYBOARD_ToAscii
X11DRV_KEYBOARD_ToAscii,
X11DRV_KEYBOARD_GetBeepActive,
X11DRV_KEYBOARD_SetBeepActive,
X11DRV_KEYBOARD_Beep
};
MONITOR_DRIVER X11DRV_MONITOR_Driver =
{
X11DRV_MONITOR_Initialize,
X11DRV_MONITOR_Finalize,
X11DRV_MONITOR_IsSingleWindow,
X11DRV_MONITOR_GetWidth,
X11DRV_MONITOR_GetHeight,
X11DRV_MONITOR_GetDepth
X11DRV_MONITOR_GetDepth,
X11DRV_MONITOR_GetScreenSaveActive,
X11DRV_MONITOR_SetScreenSaveActive,
X11DRV_MONITOR_GetScreenSaveTimeout,
X11DRV_MONITOR_SetScreenSaveTimeout
};
MOUSE_DRIVER X11DRV_MOUSE_Driver =
{
X11DRV_MOUSE_SetCursor,
X11DRV_MOUSE_MoveCursor
X11DRV_MOUSE_MoveCursor,
X11DRV_MOUSE_EnableWarpPointer
};
WND_DRIVER X11DRV_WND_Driver =
......
......@@ -1144,6 +1144,40 @@ INT16 X11DRV_KEYBOARD_ToAscii(
return ret;
}
#endif /* !defined(X_DISPLAY_MISSING) */
/***********************************************************************
* X11DRV_KEYBOARD_GetBeepActive
*/
BOOL X11DRV_KEYBOARD_GetBeepActive()
{
XKeyboardState keyboard_state;
TSXGetKeyboardControl(display, &keyboard_state);
return keyboard_state.bell_percent != 0;
}
/***********************************************************************
* X11DRV_KEYBOARD_SetBeepActive
*/
void X11DRV_KEYBOARD_SetBeepActive(BOOL bActivate)
{
XKeyboardControl keyboard_value;
if(bActivate)
keyboard_value.bell_percent = -1;
else
keyboard_value.bell_percent = 0;
TSXChangeKeyboardControl(display, KBBellPercent, &keyboard_value);
}
/***********************************************************************
* X11DRV_KEYBOARD_Beep
*/
void X11DRV_KEYBOARD_Beep()
{
TSXBell(display, 0);
}
#endif /* !defined(X_DISPLAY_MISSING) */
......@@ -18,17 +18,30 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "clipboard.h"
#include "console.h"
#include "debug.h"
#include "desktop.h"
#include "keyboard.h"
#include "main.h"
#include "message.h"
#include "monitor.h"
#include "mouse.h"
#include "options.h"
#include "win.h"
#include "windef.h"
#include "x11drv.h"
#include "xmalloc.h"
#include "version.h"
#include "win.h"
/**********************************************************************/
void X11DRV_USER_ParseOptions(int *argc, char *argv[]);
void X11DRV_USER_Create(void);
void X11DRV_USER_SaveSetup(void);
void X11DRV_USER_RestoreSetup(void);
/**********************************************************************/
......@@ -89,10 +102,18 @@ Window X11DRV_GetXRootWindow()
}
/***********************************************************************
* X11DRV_MAIN_Initialize
* X11DRV_USER_Initialize
*/
void X11DRV_MAIN_Initialize()
BOOL X11DRV_USER_Initialize(void)
{
CLIPBOARD_Driver = &X11DRV_CLIPBOARD_Driver;
DESKTOP_Driver = &X11DRV_DESKTOP_Driver;
EVENT_Driver = &X11DRV_EVENT_Driver;
KEYBOARD_Driver = &X11DRV_KEYBOARD_Driver;
MONITOR_Driver = &X11DRV_MONITOR_Driver;
MOUSE_Driver = &X11DRV_MOUSE_Driver;
WND_Driver = &X11DRV_WND_Driver;
/* We need this before calling any Xlib function */
InitializeCriticalSection( &X11DRV_CritSection );
MakeCriticalSectionGlobal( &X11DRV_CritSection );
......@@ -100,22 +121,43 @@ void X11DRV_MAIN_Initialize()
TSXrmInitialize();
putenv("XKB_DISABLE="); /* Disable XKB extension if present. */
X11DRV_USER_ParseOptions( Options.argc, Options.argv );
X11DRV_USER_Create();
X11DRV_USER_SaveSetup();
}
/***********************************************************************
* X11DRV_MAIN_Finalize
* X11DRV_USER_Finalize
*/
void X11DRV_USER_Finalize(void)
{
X11DRV_USER_RestoreSetup();
}
/**************************************************************************
* X11DRV_USER_BeginDebugging
*/
void X11DRV_USER_BeginDebugging(void)
{
TSXUngrabServer(display);
TSXFlush(display);
}
/**************************************************************************
* X11DRV_USER_EndDebugging
*/
void X11DRV_MAIN_Finalize()
void X11DRV_USER_EndDebugging(void)
{
}
/***********************************************************************
* X11DRV_MAIN_GetResource
* X11DRV_USER_GetResource
*
* Fetch the value of resource 'name' using the correct instance name.
* 'name' must begin with '.' or '*'
*/
static int X11DRV_MAIN_GetResource( XrmDatabase db, char *name, XrmValue *value )
static int X11DRV_USER_GetResource( XrmDatabase db, char *name, XrmValue *value )
{
char *buff_instance, *buff_class;
char *dummy;
......@@ -135,10 +177,10 @@ static int X11DRV_MAIN_GetResource( XrmDatabase db, char *name, XrmValue *value
}
/***********************************************************************
* X11DRV_MAIN_ParseOptions
* X11DRV_USER_ParseOptions
* Parse command line options and open display.
*/
void X11DRV_MAIN_ParseOptions(int *argc, char *argv[])
void X11DRV_USER_ParseOptions(int *argc, char *argv[])
{
int i;
char *display_name = NULL;
......@@ -155,7 +197,7 @@ void X11DRV_MAIN_ParseOptions(int *argc, char *argv[])
/* Open display */
if (display_name == NULL &&
X11DRV_MAIN_GetResource( db, ".display", &value )) display_name = value.addr;
X11DRV_USER_GetResource( db, ".display", &value )) display_name = value.addr;
if (!(display = TSXOpenDisplay( display_name )))
{
......@@ -184,35 +226,35 @@ void X11DRV_MAIN_ParseOptions(int *argc, char *argv[])
Options.programName, argc, argv );
/* Get all options */
if (X11DRV_MAIN_GetResource( db, ".iconic", &value ))
if (X11DRV_USER_GetResource( db, ".iconic", &value ))
Options.cmdShow = SW_SHOWMINIMIZED;
if (X11DRV_MAIN_GetResource( db, ".privatemap", &value ))
if (X11DRV_USER_GetResource( db, ".privatemap", &value ))
Options.usePrivateMap = TRUE;
if (X11DRV_MAIN_GetResource( db, ".fixedmap", &value ))
if (X11DRV_USER_GetResource( db, ".fixedmap", &value ))
Options.useFixedMap = TRUE;
if (X11DRV_MAIN_GetResource( db, ".synchronous", &value ))
if (X11DRV_USER_GetResource( db, ".synchronous", &value ))
Options.synchronous = TRUE;
if (X11DRV_MAIN_GetResource( db, ".backingstore", &value ))
if (X11DRV_USER_GetResource( db, ".backingstore", &value ))
Options.backingstore = TRUE;
if (X11DRV_MAIN_GetResource( db, ".debug", &value ))
if (X11DRV_USER_GetResource( db, ".debug", &value ))
Options.debug = TRUE;
if (X11DRV_MAIN_GetResource( db, ".failreadonly", &value ))
if (X11DRV_USER_GetResource( db, ".failreadonly", &value ))
Options.failReadOnly = TRUE;
if (X11DRV_MAIN_GetResource( db, ".perfect", &value ))
if (X11DRV_USER_GetResource( db, ".perfect", &value ))
Options.perfectGraphics = TRUE;
if (X11DRV_MAIN_GetResource( db, ".depth", &value))
if (X11DRV_USER_GetResource( db, ".depth", &value))
Options.screenDepth = atoi( value.addr );
if (X11DRV_MAIN_GetResource( db, ".desktop", &value))
if (X11DRV_USER_GetResource( db, ".desktop", &value))
Options.desktopGeometry = value.addr;
if (X11DRV_MAIN_GetResource( db, ".language", &value))
if (X11DRV_USER_GetResource( db, ".language", &value))
MAIN_ParseLanguageOption( (char *)value.addr );
if (X11DRV_MAIN_GetResource( db, ".managed", &value))
if (X11DRV_USER_GetResource( db, ".managed", &value))
Options.managed = TRUE;
if (X11DRV_MAIN_GetResource( db, ".mode", &value))
if (X11DRV_USER_GetResource( db, ".mode", &value))
MAIN_ParseModeOption( (char *)value.addr );
if (X11DRV_MAIN_GetResource( db, ".debugoptions", &value))
if (X11DRV_USER_GetResource( db, ".debugoptions", &value))
MAIN_ParseDebugOptions((char*)value.addr);
if (X11DRV_MAIN_GetResource( db, ".debugmsg", &value))
if (X11DRV_USER_GetResource( db, ".debugmsg", &value))
{
#ifndef DEBUG_RUNTIME
MSG("%s: Option \"-debugmsg\" not implemented.\n" \
......@@ -224,7 +266,7 @@ void X11DRV_MAIN_ParseOptions(int *argc, char *argv[])
#endif
}
if (X11DRV_MAIN_GetResource( db, ".dll", &value))
if (X11DRV_USER_GetResource( db, ".dll", &value))
{
if (Options.dllFlags)
{
......@@ -236,35 +278,35 @@ void X11DRV_MAIN_ParseOptions(int *argc, char *argv[])
else Options.dllFlags = xstrdup((char *)value.addr);
}
if (X11DRV_MAIN_GetResource( db, ".winver", &value))
if (X11DRV_USER_GetResource( db, ".winver", &value))
VERSION_ParseWinVersion( (char*)value.addr );
if (X11DRV_MAIN_GetResource( db, ".dosver", &value))
if (X11DRV_USER_GetResource( db, ".dosver", &value))
VERSION_ParseDosVersion( (char*)value.addr );
if (X11DRV_MAIN_GetResource( db, ".config", &value))
if (X11DRV_USER_GetResource( db, ".config", &value))
Options.configFileName = xstrdup((char *)value.addr);
if (X11DRV_MAIN_GetResource( db, ".nodga", &value))
if (X11DRV_USER_GetResource( db, ".nodga", &value))
Options.noDGA = TRUE;
if (X11DRV_MAIN_GetResource( db, ".console", &value))
if (X11DRV_USER_GetResource( db, ".console", &value))
driver.driver_list = xstrdup((char *)value.addr);
else
driver.driver_list = CONSOLE_DEFAULT_DRIVER;
}
/***********************************************************************
* X11DRV_MAIN_ErrorHandler
* X11DRV_USER_ErrorHandler
*/
static int X11DRV_MAIN_ErrorHandler(Display *display, XErrorEvent *error_evt)
static int X11DRV_USER_ErrorHandler(Display *display, XErrorEvent *error_evt)
{
kill( getpid(), SIGHUP ); /* force an entry in the debugger */
return 0;
}
/***********************************************************************
* X11DRV_MAIN_Create
* X11DRV_USER_Create
*/
void X11DRV_MAIN_Create()
void X11DRV_USER_Create()
{
if (Options.synchronous) XSetErrorHandler( X11DRV_MAIN_ErrorHandler );
if (Options.synchronous) XSetErrorHandler( X11DRV_USER_ErrorHandler );
if (Options.desktopGeometry && Options.managed)
{
......@@ -279,17 +321,17 @@ void X11DRV_MAIN_Create()
}
/***********************************************************************
* X11DRV_MAIN_SaveSetup
* X11DRV_USER_SaveSetup
*/
void X11DRV_MAIN_SaveSetup()
void X11DRV_USER_SaveSetup()
{
TSXGetKeyboardControl(display, &X11DRV_XKeyboardState);
}
/***********************************************************************
* X11DRV_MAIN_RestoreSetup
* X11DRV_USER_RestoreSetup
*/
void X11DRV_MAIN_RestoreSetup()
void X11DRV_USER_RestoreSetup()
{
XKeyboardControl keyboard_value;
......
......@@ -184,6 +184,17 @@ void X11DRV_MONITOR_Finalize(MONITOR *pMonitor)
}
/***********************************************************************
* X11DRV_MONITOR_IsSingleWindow
*/
BOOL X11DRV_MONITOR_IsSingleWindow(MONITOR *pMonitor)
{
X11DRV_MONITOR_DATA *pX11Monitor =
(X11DRV_MONITOR_DATA *) pMonitor->pDriverData;
return (pX11Monitor->rootWindow != DefaultRootWindow(display));
}
/***********************************************************************
* X11DRV_MONITOR_GetWidth
*
* Return the width of the monitor
......@@ -222,6 +233,53 @@ int X11DRV_MONITOR_GetDepth(MONITOR *pMonitor)
return pX11Monitor->depth;
}
#endif /* X_DISPLAY_MISSING */
/***********************************************************************
* X11DRV_MONITOR_GetScreenSaveActive
*
* Returns the active status of the screen saver
*/
BOOL X11DRV_MONITOR_GetScreenSaveActive(MONITOR *pMonitor)
{
int timeout, temp;
TSXGetScreenSaver(display, &timeout, &temp, &temp, &temp);
return timeout!=NULL;
}
/***********************************************************************
* X11DRV_MONITOR_SetScreenSaveActive
*
* Activate/Deactivate the screen saver
*/
void X11DRV_MONITOR_SetScreenSaveActive(MONITOR *pMonitor, BOOL bActivate)
{
if(bActivate)
TSXActivateScreenSaver(display);
else
TSXResetScreenSaver(display);
}
/***********************************************************************
* X11DRV_MONITOR_GetScreenSaveTimeout
*
* Return the screen saver timeout
*/
int X11DRV_MONITOR_GetScreenSaveTimeout(MONITOR *pMonitor)
{
int timeout, temp;
TSXGetScreenSaver(display, &timeout, &temp, &temp, &temp);
return timeout;
}
/***********************************************************************
* X11DRV_MONITOR_SetScreenSaveTimeout
*
* Set the screen saver timeout
*/
void X11DRV_MONITOR_SetScreenSaveTimeout(
MONITOR *pMonitor, int nTimeout)
{
TSXSetScreenSaver(display, nTimeout, 60,
DefaultBlanking, DefaultExposures);
}
#endif /* X_DISPLAY_MISSING */
......@@ -12,7 +12,7 @@
#include "callback.h"
#include "debug.h"
#include "display.h"
#include "mouse.h"
#include "win.h"
#include "windef.h"
#include "x11drv.h"
......@@ -21,7 +21,7 @@
Cursor X11DRV_MOUSE_XCursor = None; /* Current X cursor */
BOOL X11DRV_MOUSE_DisableWarpPointer = FALSE; /* hack; see DISPLAY_MoveCursor */
static BOOL X11DRV_MOUSE_WarpPointer = FALSE; /* hack; see DISPLAY_MoveCursor */
/***********************************************************************
* X11DRV_MOUSE_DoSetCursor
......@@ -203,7 +203,7 @@ void X11DRV_MOUSE_MoveCursor(WORD wAbsX, WORD wAbsY)
int rootX, rootY, winX, winY;
unsigned int xstate;
if (X11DRV_MOUSE_DisableWarpPointer) return;
if (!X11DRV_MOUSE_WarpPointer) return;
if (!TSXQueryPointer( display, X11DRV_GetXRootWindow(), &root, &child,
&rootX, &rootY, &winX, &winY, &xstate ))
......@@ -218,4 +218,16 @@ void X11DRV_MOUSE_MoveCursor(WORD wAbsX, WORD wAbsY)
0, 0, 0, 0, wAbsX, wAbsY );
}
/***********************************************************************
* X11DRV_MOUSE_EnableWarpPointer
*/
BOOL X11DRV_MOUSE_EnableWarpPointer(BOOL bEnable)
{
BOOL bOldEnable = X11DRV_MOUSE_WarpPointer;
X11DRV_MOUSE_WarpPointer = bEnable;
return bOldEnable;
}
#endif /* !defined(X_DISPLAY_MISSING) */
......@@ -196,7 +196,7 @@ BOOL X11DRV_WND_CreateWindow(WND *wndPtr, CLASS *classPtr, CREATESTRUCTA *cs, BO
wndPtr->flags |= WIN_NATIVE;
win_attr.bit_gravity = BGNorthWest;
win_attr.colormap = X11DRV_COLOR_GetColormap();
win_attr.colormap = X11DRV_PALETTE_PaletteXColormap;
win_attr.backing_store = Options.backingstore ? WhenMapped : NotUseful;
win_attr.save_under = ((classPtr->style & CS_SAVEBITS) != 0);
win_attr.cursor = X11DRV_MOUSE_XCursor;
......@@ -548,8 +548,8 @@ void X11DRV_WND_SetFocus(WND *wndPtr)
if (!hwnd) /* If setting the focus to 0, uninstall the colormap */
{
if (COLOR_GetSystemPaletteFlags() & COLOR_PRIVATE)
TSXUninstallColormap( display, X11DRV_COLOR_GetColormap() );
if (X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_PRIVATE)
TSXUninstallColormap( display, X11DRV_PALETTE_PaletteXColormap );
return;
}
......@@ -561,8 +561,8 @@ void X11DRV_WND_SetFocus(WND *wndPtr)
return; /* If window is not viewable, don't change anything */
TSXSetInputFocus( display, win, RevertToParent, CurrentTime );
if (COLOR_GetSystemPaletteFlags() & COLOR_PRIVATE)
TSXInstallColormap( display, X11DRV_COLOR_GetColormap() );
if (X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_PRIVATE)
TSXInstallColormap( display, X11DRV_PALETTE_PaletteXColormap );
EVENT_Synchronize();
}
......@@ -716,10 +716,7 @@ BOOL X11DRV_WND_SetHostAttr(WND* wnd, INT ha, INT value)
*/
BOOL X11DRV_WND_IsSelfClipping(WND *wndPtr)
{
if( X11DRV_WND_GetXWindow(wndPtr) )
return TRUE; /* X itself will do the clipping */
return FALSE;
return X11DRV_WND_GetXWindow(wndPtr) != None;
}
#endif /* !defined(X_DISPLAY_MISSING) */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment