Commit 8d8703cb authored by Patrik Stridvall's avatar Patrik Stridvall Committed by Alexandre Julliard

Moved some more code to the X11 driver.

parent c6e6a9af
......@@ -4,14 +4,50 @@
* Copyright 1994 Alexandre Julliard
*/
#include "x11drv.h"
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "win.h"
#include "desktop.h"
#include "heap.h"
#include "monitor.h"
#include "win.h"
#include "wine/winuser16.h"
/***********************************************************************
* DESKTOP_GetScreenWidth
*
* Return the width of the screen associated to the current desktop.
*/
int DESKTOP_GetScreenWidth()
{
DESKTOP *pDesktop = (DESKTOP *) WIN_GetDesktop()->wExtra;
return MONITOR_GetWidth(pDesktop->pPrimaryMonitor);
}
/***********************************************************************
* DESKTOP_GetScreenHeight
*
* Return the height of the screen associated to the current desktop.
*/
int DESKTOP_GetScreenHeight()
{
DESKTOP *pDesktop = (DESKTOP *) WIN_GetDesktop()->wExtra;
return MONITOR_GetHeight(pDesktop->pPrimaryMonitor);
}
/***********************************************************************
* DESKTOP_GetScreenDepth
*
* Return the depth of the screen associated to the current desktop.
*/
int DESKTOP_GetScreenDepth()
{
DESKTOP *pDesktop = (DESKTOP *) WIN_GetDesktop()->wExtra;
return MONITOR_GetDepth(pDesktop->pPrimaryMonitor);
}
/***********************************************************************
* DESKTOP_LoadBitmap
......@@ -74,7 +110,7 @@ static HBITMAP32 DESKTOP_LoadBitmap( HDC32 hdc, const char *filename )
* Handle the WM_ERASEBKGND message.
*/
static LRESULT DESKTOP_DoEraseBkgnd( HWND32 hwnd, HDC32 hdc,
DESKTOPINFO *infoPtr )
DESKTOP *desktopPtr )
{
RECT32 rect;
WND* Wnd = WIN_FindWndPtr( hwnd );
......@@ -86,40 +122,40 @@ static LRESULT DESKTOP_DoEraseBkgnd( HWND32 hwnd, HDC32 hdc,
/* Paint desktop pattern (only if wall paper does not cover everything) */
if (!infoPtr->hbitmapWallPaper ||
(!infoPtr->fTileWallPaper && ((infoPtr->bitmapSize.cx < rect.right) ||
(infoPtr->bitmapSize.cy < rect.bottom))))
if (!desktopPtr->hbitmapWallPaper ||
(!desktopPtr->fTileWallPaper && ((desktopPtr->bitmapSize.cx < rect.right) ||
(desktopPtr->bitmapSize.cy < rect.bottom))))
{
/* Set colors in case pattern is a monochrome bitmap */
SetBkColor32( hdc, RGB(0,0,0) );
SetTextColor32( hdc, GetSysColor32(COLOR_BACKGROUND) );
FillRect32( hdc, &rect, infoPtr->hbrushPattern );
FillRect32( hdc, &rect, desktopPtr->hbrushPattern );
}
/* Paint wall paper */
if (infoPtr->hbitmapWallPaper)
if (desktopPtr->hbitmapWallPaper)
{
INT32 x, y;
HDC32 hMemDC = CreateCompatibleDC32( hdc );
SelectObject32( hMemDC, infoPtr->hbitmapWallPaper );
SelectObject32( hMemDC, desktopPtr->hbitmapWallPaper );
if (infoPtr->fTileWallPaper)
if (desktopPtr->fTileWallPaper)
{
for (y = 0; y < rect.bottom; y += infoPtr->bitmapSize.cy)
for (x = 0; x < rect.right; x += infoPtr->bitmapSize.cx)
BitBlt32( hdc, x, y, infoPtr->bitmapSize.cx,
infoPtr->bitmapSize.cy, hMemDC, 0, 0, SRCCOPY );
for (y = 0; y < rect.bottom; y += desktopPtr->bitmapSize.cy)
for (x = 0; x < rect.right; x += desktopPtr->bitmapSize.cx)
BitBlt32( hdc, x, y, desktopPtr->bitmapSize.cx,
desktopPtr->bitmapSize.cy, hMemDC, 0, 0, SRCCOPY );
}
else
{
x = (rect.left + rect.right - infoPtr->bitmapSize.cx) / 2;
y = (rect.top + rect.bottom - infoPtr->bitmapSize.cy) / 2;
x = (rect.left + rect.right - desktopPtr->bitmapSize.cx) / 2;
y = (rect.top + rect.bottom - desktopPtr->bitmapSize.cy) / 2;
if (x < 0) x = 0;
if (y < 0) y = 0;
BitBlt32( hdc, x, y, infoPtr->bitmapSize.cx,
infoPtr->bitmapSize.cy, hMemDC, 0, 0, SRCCOPY );
BitBlt32( hdc, x, y, desktopPtr->bitmapSize.cx,
desktopPtr->bitmapSize.cy, hMemDC, 0, 0, SRCCOPY );
}
DeleteDC32( hMemDC );
}
......@@ -137,7 +173,7 @@ LRESULT WINAPI DesktopWndProc( HWND32 hwnd, UINT32 message,
WPARAM32 wParam, LPARAM lParam )
{
WND *wndPtr = WIN_FindWndPtr( hwnd );
DESKTOPINFO *infoPtr = (DESKTOPINFO *)wndPtr->wExtra;
DESKTOP *desktopPtr = (DESKTOP *)wndPtr->wExtra;
/* Most messages are ignored (we DON'T call DefWindowProc) */
......@@ -146,15 +182,17 @@ LRESULT WINAPI DesktopWndProc( HWND32 hwnd, UINT32 message,
/* Warning: this message is sent directly by */
/* WIN_CreateDesktopWindow() and does not contain a valid lParam */
case WM_NCCREATE:
infoPtr->hbrushPattern = 0;
infoPtr->hbitmapWallPaper = 0;
desktopPtr->hbrushPattern = 0;
desktopPtr->hbitmapWallPaper = 0;
SetDeskPattern();
SetDeskWallPaper32( (LPSTR)-1 );
return 1;
case WM_ERASEBKGND:
if (rootWindow == DefaultRootWindow(display)) return 1;
return DESKTOP_DoEraseBkgnd( hwnd, (HDC32)wParam, infoPtr );
if (X11DRV_WND_GetXRootWindow(wndPtr) ==
DefaultRootWindow(display))
return 1;
return DESKTOP_DoEraseBkgnd( hwnd, (HDC32)wParam, desktopPtr );
case WM_SYSCOMMAND:
if ((wParam & 0xfff0) != SC_CLOSE) return 0;
......@@ -175,9 +213,9 @@ BOOL32 WINAPI PaintDesktop(HDC32 hdc)
{
HWND32 hwnd = GetDesktopWindow32();
WND *wndPtr = WIN_FindWndPtr( hwnd );
DESKTOPINFO *infoPtr = (DESKTOPINFO *)wndPtr->wExtra;
DESKTOP *desktopPtr = (DESKTOP *)wndPtr->wExtra;
return DESKTOP_DoEraseBkgnd( hwnd, hdc, infoPtr );
return DESKTOP_DoEraseBkgnd( hwnd, hdc, desktopPtr );
}
/***********************************************************************
......@@ -211,7 +249,7 @@ BOOL32 WINAPI SetDeskWallPaper32( LPCSTR filename )
HDC32 hdc;
char buffer[256];
WND *wndPtr = WIN_GetDesktop();
DESKTOPINFO *infoPtr = (DESKTOPINFO *)wndPtr->wExtra;
DESKTOP *desktopPtr = (DESKTOP *)wndPtr->wExtra;
if (filename == (LPSTR)-1)
{
......@@ -221,15 +259,15 @@ BOOL32 WINAPI SetDeskWallPaper32( LPCSTR filename )
hdc = GetDC32( 0 );
hbitmap = DESKTOP_LoadBitmap( hdc, filename );
ReleaseDC32( 0, hdc );
if (infoPtr->hbitmapWallPaper) DeleteObject32( infoPtr->hbitmapWallPaper );
infoPtr->hbitmapWallPaper = hbitmap;
infoPtr->fTileWallPaper = GetProfileInt32A( "desktop", "TileWallPaper", 0 );
if (desktopPtr->hbitmapWallPaper) DeleteObject32( desktopPtr->hbitmapWallPaper );
desktopPtr->hbitmapWallPaper = hbitmap;
desktopPtr->fTileWallPaper = GetProfileInt32A( "desktop", "TileWallPaper", 0 );
if (hbitmap)
{
BITMAP32 bmp;
GetObject32A( hbitmap, sizeof(bmp), &bmp );
infoPtr->bitmapSize.cx = (bmp.bmWidth != 0) ? bmp.bmWidth : 1;
infoPtr->bitmapSize.cy = (bmp.bmHeight != 0) ? bmp.bmHeight : 1;
desktopPtr->bitmapSize.cx = (bmp.bmWidth != 0) ? bmp.bmWidth : 1;
desktopPtr->bitmapSize.cy = (bmp.bmHeight != 0) ? bmp.bmHeight : 1;
}
return TRUE;
}
......@@ -243,10 +281,10 @@ BOOL32 WINAPI SetDeskWallPaper32( LPCSTR filename )
BOOL32 DESKTOP_SetPattern( LPCSTR pattern )
{
WND *wndPtr = WIN_GetDesktop();
DESKTOPINFO *infoPtr = (DESKTOPINFO *)wndPtr->wExtra;
DESKTOP *desktopPtr = (DESKTOP *)wndPtr->wExtra;
int pat[8];
if (infoPtr->hbrushPattern) DeleteObject32( infoPtr->hbrushPattern );
if (desktopPtr->hbrushPattern) DeleteObject32( desktopPtr->hbrushPattern );
memset( pat, 0, sizeof(pat) );
if (pattern && sscanf( pattern, " %d %d %d %d %d %d %d %d",
&pat[0], &pat[1], &pat[2], &pat[3],
......@@ -258,10 +296,10 @@ BOOL32 DESKTOP_SetPattern( LPCSTR pattern )
for (i = 0; i < 8; i++) pattern[i] = pat[i] & 0xffff;
hbitmap = CreateBitmap32( 8, 8, 1, 1, (LPSTR)pattern );
infoPtr->hbrushPattern = CreatePatternBrush32( hbitmap );
desktopPtr->hbrushPattern = CreatePatternBrush32( hbitmap );
DeleteObject32( hbitmap );
}
else infoPtr->hbrushPattern = CreateSolidBrush32( GetSysColor32(COLOR_BACKGROUND) );
else desktopPtr->hbrushPattern = CreateSolidBrush32( GetSysColor32(COLOR_BACKGROUND) );
return TRUE;
}
......@@ -68,7 +68,7 @@ static WNDCLASS32A WIDGETS_BuiltinClasses[BIC32_NB_CLASSES] =
{ CS_GLOBALCLASS, MDIClientWndProc,
0, sizeof(MDICLIENTINFO), 0, 0, 0, STOCK_LTGRAY_BRUSH, 0, "MDIClient" },
/* BIC32_DESKTOP */
{ CS_GLOBALCLASS, DesktopWndProc, 0, sizeof(DESKTOPINFO),
{ CS_GLOBALCLASS, DesktopWndProc, 0, sizeof(DESKTOP),
0, 0, (HCURSOR32)IDC_ARROW32A, 0, 0, DESKTOP_CLASS_NAME },
/* BIC32_DIALOG */
{ CS_GLOBALCLASS | CS_SAVEBITS, DefDlgProc32A, 0, DLGWINDOWEXTRA,
......
......@@ -7,6 +7,7 @@
*/
#include "ts_xlib.h"
#include "x11drv.h"
#include <stdio.h>
#include <signal.h>
......@@ -24,8 +25,6 @@
#include "neexe.h"
#include "process.h"
#include "main.h"
#include "ts_xlib.h"
#include "expr.h"
extern FILE * yyin;
......
......@@ -15,22 +15,38 @@
*/
#include "config.h"
#include <unistd.h>
#include <assert.h>
#include "ts_xlib.h"
#include "ts_xutil.h"
#include <sys/signal.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
#include "windows.h"
#ifdef HAVE_LIBXXSHM
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include "ts_xshm.h"
#endif /* defined(HAVE_LIBXXSHM) */
#ifdef HAVE_LIBXXF86DGA
#include "ts_xf86dga.h"
#endif /* defined(HAVE_LIBXXF86DGA) */
#ifdef HAVE_LIBXXF86VM
/* X is retarted and insists on declaring INT32, INT16 etc in Xmd.h,
this is a crude hack to get around it */
#define XMD_H
#include "wintypes.h"
#include "ts_xf86vmode.h"
#endif
#endif /* defined(HAVE_LIBXXF86VM) */
#include "x11drv.h"
#include <unistd.h>
#include <assert.h>
#include <sys/signal.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
#include "windows.h"
#include "winerror.h"
#include "gdi.h"
......@@ -44,21 +60,9 @@
#include "debug.h"
#include "spy.h"
#include "message.h"
#include "x11drv.h"
#include "options.h"
#include "objbase.h"
#ifdef HAVE_LIBXXF86DGA
#include "ts_xf86dga.h"
#include <sys/mman.h>
#endif
#ifdef HAVE_LIBXXSHM
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include "ts_xshm.h"
#endif
#include "monitor.h"
/* This for all the enumeration and creation of D3D-related objects */
#include "d3d_private.h"
......@@ -444,7 +448,7 @@ static void Xlib_copy_surface_on_screen(LPDIRECTDRAWSURFACE4 this) {
if (this->s.ddraw->e.xlib.xshm_active)
TSXShmPutImage(display,
this->s.ddraw->d.drawable,
DefaultGCOfScreen(screen),
DefaultGCOfScreen(X11DRV_GetXScreen()),
this->t.xlib.image,
0, 0, 0, 0,
this->t.xlib.image->width,
......@@ -454,7 +458,7 @@ static void Xlib_copy_surface_on_screen(LPDIRECTDRAWSURFACE4 this) {
#endif
TSXPutImage( display,
this->s.ddraw->d.drawable,
DefaultGCOfScreen(screen),
DefaultGCOfScreen(X11DRV_GetXScreen()),
this->t.xlib.image,
0, 0, 0, 0,
this->t.xlib.image->width,
......@@ -570,7 +574,8 @@ static HRESULT WINAPI Xlib_IDirectDrawSurface4_SetPalette(
if( !(pal->cm) && (this->s.ddraw->d.screen_depth<=8))
{
pal->cm = TSXCreateColormap(display,this->s.ddraw->d.drawable,DefaultVisualOfScreen(screen),AllocAll);
pal->cm = TSXCreateColormap(display,this->s.ddraw->d.drawable,
DefaultVisualOfScreen(X11DRV_GetXScreen()),AllocAll);
if (!Options.managed)
TSXInstallColormap(display,pal->cm);
......@@ -2286,7 +2291,7 @@ static XImage *create_ximage(LPDIRECTDRAW2 this, LPDIRECTDRAWSURFACE4 lpdsf) {
#ifdef HAVE_LIBXXSHM
if (this->e.xlib.xshm_active) {
img = TSXShmCreateImage(display,
DefaultVisualOfScreen(screen),
DefaultVisualOfScreen(X11DRV_GetXScreen()),
this->d.screen_depth,
ZPixmap,
NULL,
......@@ -2345,7 +2350,7 @@ static XImage *create_ximage(LPDIRECTDRAW2 this, LPDIRECTDRAWSURFACE4 lpdsf) {
/* In this case, create an XImage */
img =
TSXCreateImage(display,
DefaultVisualOfScreen(screen),
DefaultVisualOfScreen(X11DRV_GetXScreen()),
this->d.screen_depth,
ZPixmap,
0,
......@@ -2510,7 +2515,7 @@ static HRESULT WINAPI IDirectDraw2_SetCooperativeLevel(
/* This will be overwritten in the case of Full Screen mode.
Windowed games could work with that :-) */
if (hwnd)
this->d.drawable = ((X11DRV_WND_DATA *) WIN_FindWndPtr(hwnd)->pDriverData)->window;
this->d.drawable = X11DRV_WND_GetXWindow(WIN_FindWndPtr(hwnd));
return DD_OK;
}
......@@ -2571,6 +2576,7 @@ static HRESULT WINAPI DGA_IDirectDraw_SetDisplayMode(
this->d.screen_depth = depth;
depths = TSXListDepths(display,DefaultScreen(display),&depcount);
for (i=0;i<depcount;i++)
if (depths[i]==depth)
break;
......@@ -2671,8 +2677,9 @@ static HRESULT WINAPI Xlib_IDirectDraw_SetDisplayMode(
/* We hope getting the asked for depth */
this->d.screen_depth = depth;
depths = TSXListDepths(display,DefaultScreen(display),&depcount);
for (i=0;i<depcount;i++)
if (depths[i]==depth)
break;
......@@ -2859,7 +2866,7 @@ static HRESULT WINAPI DGA_IDirectDraw2_CreatePalette(
if (res != 0) return res;
(*lpddpal)->lpvtbl = &dga_ddpalvt;
if (this->d.depth<=8) {
(*lpddpal)->cm = TSXCreateColormap(display,DefaultRootWindow(display),DefaultVisualOfScreen(screen),AllocAll);
(*lpddpal)->cm = TSXCreateColormap(display,DefaultRootWindow(display),DefaultVisualOfScreen(X11DRV_GetXScreen()),AllocAll);
} else {
FIXME(ddraw,"why are we doing CreatePalette in hi/truecolor?\n");
(*lpddpal)->cm = 0;
......@@ -3182,8 +3189,8 @@ static HRESULT WINAPI IDirectDraw2_EnumDisplayModes(
}
}
ddsfd.dwWidth = screenWidth;
ddsfd.dwHeight = screenHeight;
ddsfd.dwWidth = MONITOR_GetWidth(&MONITOR_PrimaryMonitor);
ddsfd.dwHeight = MONITOR_GetHeight(&MONITOR_PrimaryMonitor);
TRACE(ddraw," enumerating (%ldx%ldx%d)\n",ddsfd.dwWidth,ddsfd.dwHeight,depths[i]);
if (!modescb(&ddsfd,context)) return DD_OK;
......@@ -3212,8 +3219,8 @@ static HRESULT WINAPI DGA_IDirectDraw2_GetDisplayMode(
#ifdef HAVE_LIBXXF86DGA
TRACE(ddraw,"(%p)->(%p)\n",this,lpddsfd);
lpddsfd->dwFlags = DDSD_HEIGHT|DDSD_WIDTH|DDSD_PITCH|DDSD_BACKBUFFERCOUNT|DDSD_PIXELFORMAT|DDSD_CAPS;
lpddsfd->dwHeight = screenHeight;
lpddsfd->dwWidth = screenWidth;
lpddsfd->dwHeight = MONITOR_GetHeight(&MONITOR_PrimaryMonitor);
lpddsfd->dwWidth = MONITOR_GetWidth(&MONITOR_PrimaryMonitor);
lpddsfd->lPitch = this->e.dga.fb_width*this->d.depth/8;
lpddsfd->dwBackBufferCount = 1;
lpddsfd->x.dwRefreshRate = 60;
......@@ -3230,8 +3237,8 @@ static HRESULT WINAPI Xlib_IDirectDraw2_GetDisplayMode(
) {
TRACE(ddraw,"(%p)->GetDisplayMode(%p)\n",this,lpddsfd);
lpddsfd->dwFlags = DDSD_HEIGHT|DDSD_WIDTH|DDSD_PITCH|DDSD_BACKBUFFERCOUNT|DDSD_PIXELFORMAT|DDSD_CAPS;
lpddsfd->dwHeight = screenHeight;
lpddsfd->dwWidth = screenWidth;
lpddsfd->dwHeight = MONITOR_GetHeight(&MONITOR_PrimaryMonitor);
lpddsfd->dwWidth = MONITOR_GetWidth(&MONITOR_PrimaryMonitor);
/* POOLE FIXME: Xlib */
lpddsfd->lPitch = this->e.dga.fb_width*this->d.depth/8;
/* END FIXME: Xlib */
......@@ -3660,7 +3667,7 @@ HRESULT WINAPI DGA_DirectDrawCreate( LPDIRECTDRAW *lplpDD, LPUNKNOWN pUnkOuter)
TSXF86DGAGetViewPortSize(display,DefaultScreen(display),&width,&height);
TSXF86DGASetViewPort(display,DefaultScreen(display),0,0);
(*lplpDD)->e.dga.fb_height = screenHeight;
(*lplpDD)->e.dga.fb_height = MONITOR_GetHeight(&MONITOR_PrimaryMonitor);
#ifdef DIABLO_HACK
(*lplpDD)->e.dga.vpmask = 1;
#else
......@@ -3668,8 +3675,8 @@ HRESULT WINAPI DGA_DirectDrawCreate( LPDIRECTDRAW *lplpDD, LPUNKNOWN pUnkOuter)
#endif
/* just assume the default depth is the DGA depth too */
(*lplpDD)->d.screen_depth = DefaultDepthOfScreen(screen);
(*lplpDD)->d.depth = DefaultDepthOfScreen(screen);
(*lplpDD)->d.screen_depth = DefaultDepthOfScreen(X11DRV_GetXScreen());
(*lplpDD)->d.depth = DefaultDepthOfScreen(X11DRV_GetXScreen());
#ifdef RESTORE_SIGNALS
if (SIGNAL_Reinit) SIGNAL_Reinit();
#endif
......@@ -3708,10 +3715,9 @@ HRESULT WINAPI Xlib_DirectDrawCreate( LPDIRECTDRAW *lplpDD, LPUNKNOWN pUnkOuter)
(*lplpDD)->ref = 1;
(*lplpDD)->d.drawable = 0; /* in SetDisplayMode */
(*lplpDD)->d.screen_depth = DefaultDepthOfScreen(screen);
(*lplpDD)->d.depth = DefaultDepthOfScreen(screen);
(*lplpDD)->d.height = screenHeight;
(*lplpDD)->d.width = screenWidth;
(*lplpDD)->d.screen_depth = DefaultDepthOfScreen(X11DRV_GetXScreen());
(*lplpDD)->d.height = MONITOR_GetHeight(&MONITOR_PrimaryMonitor);
(*lplpDD)->d.width = MONITOR_GetWidth(&MONITOR_PrimaryMonitor);
#ifdef HAVE_LIBXXSHM
/* Test if XShm is available. */
......@@ -3771,6 +3777,7 @@ HRESULT WINAPI DirectDrawCreate( LPGUID lpGUID, LPDIRECTDRAW *lplpDD, LPUNKNOWN
else
goto err;
(*lplpDD)->d.winclass = RegisterClass32A(&wc);
return ret;
......
......@@ -5,11 +5,13 @@
* Copyright 1997 Bertho A. Stultiens
*/
#include <math.h>
#include <stdlib.h>
#include <X11/Intrinsic.h>
#include "ts_xlib.h"
#include "ts_xutil.h"
#include <X11/Intrinsic.h>
#include "x11drv.h"
#include <math.h>
#include <stdlib.h>
#ifndef PI
#define PI M_PI
#endif
......@@ -19,13 +21,14 @@
#include "callback.h"
#include "heap.h"
#include "metafile.h"
#include "monitor.h"
#include "palette.h"
#include "cache.h"
#include "region.h"
#include "path.h"
#include "debug.h"
#include "winerror.h"
#include "x11drv.h"
/***********************************************************************
* LineTo16 (GDI.19)
......@@ -681,7 +684,7 @@ void WINAPI DrawFocusRect32( HDC32 hdc, const RECT32* rc )
oldBkMode = SetBkMode32(hdc, TRANSPARENT);
/* Hack: make sure the XORPEN operation has an effect */
physDev->pen.pixel = (1 << screenDepth) - 1;
physDev->pen.pixel = (1 << MONITOR_GetDepth(&MONITOR_PrimaryMonitor)) - 1;
if (X11DRV_SetupGCForPen( dc ))
TSXDrawRectangle( display, physDev->drawable, physDev->gc,
......
......@@ -4,21 +4,26 @@
* Started by Robert Pouliot <krynos@clic.net>
*/
#include "config.h"
#include "ts_xlib.h"
#include "ts_xshm.h"
#ifdef HAVE_LIBXXSHM
#include <sys/types.h>
#include <sys/ipc.h>
#ifndef __EMX__
#include <sys/shm.h>
#endif
#endif /* !defined(__EMX__) */
#include "ts_xshm.h"
#endif /* defined(HAVE_LIBXXSHM) */
#include "x11drv.h"
#include "windows.h"
#include "bitmap.h"
#include "dc.h"
#include "debug.h"
#include "gdi.h"
#include "monitor.h"
#include "wintypes.h"
#include "xmalloc.h"
#include "x11drv.h"
#include "debug.h"
typedef enum WING_DITHER_TYPE
{
......@@ -46,18 +51,20 @@ static void __initWinG(void)
{
if( __WinGOK < 0 )
{
#ifdef HAVE_LIBXXSHM
Status s = TSXShmQueryExtension(display);
if( s )
{
int i = TSXShmPixmapFormat(display);
if( i == ZPixmap && screenDepth == 8 )
if( i == ZPixmap && MONITOR_GetDepth(&MONITOR_PrimaryMonitor) == 8 )
{
__WinGOK = True;
__WinGOK = 1;
return;
}
}
#endif /* defined(HAVE_LIBXXSHM) */
FIXME(wing,"WinG: incorrect depth or unsupported card.\n");
__WinGOK = False;
__WinGOK = 0;
}
}
......@@ -126,7 +133,9 @@ HBITMAP16 WINAPI WinGCreateBitmap16(HDC16 winDC, BITMAPINFO *header,
HBITMAP16 hbitmap = GDI_AllocObject( sizeof(BITMAPOBJ), BITMAP_MAGIC );
if (hbitmap)
{
__ShmBitmapCtl* p = (__ShmBitmapCtl*)xmalloc(sizeof(__ShmBitmapCtl));
#ifdef HAVE_LIBXXSHM
__ShmBitmapCtl* p = (__ShmBitmapCtl*)xmalloc(sizeof(__ShmBitmapCtl));
#endif /* defined(HAVE_LIBXXSHM) */
BITMAPOBJ* bmpObjPtr = (BITMAPOBJ *) GDI_HEAP_LOCK( hbitmap );
bmpObjPtr->size.cx = 0;
......@@ -138,6 +147,8 @@ HBITMAP16 WINAPI WinGCreateBitmap16(HDC16 winDC, BITMAPINFO *header,
bmpObjPtr->bitmap.bmBitsPixel = (BYTE)bmpi->biBitCount;
bmpObjPtr->bitmap.bmWidthBytes =
(INT16)BITMAP_WIDTH_BYTES( bmpObjPtr->bitmap.bmWidth, bmpi->biBitCount );
#ifdef HAVE_LIBXXSHM
bmpObjPtr->bitmap.bmBits = (SEGPTR)p;
p->si.shmid = key;
......@@ -170,12 +181,16 @@ HBITMAP16 WINAPI WinGCreateBitmap16(HDC16 winDC, BITMAPINFO *header,
GDI_FreeObject( hbitmap );
hbitmap = 0;
}
#else /* defined(HAVE_LIBXXSHM) */
bmpObjPtr->bitmap.bmBits = (SEGPTR) NULL;
bmpObjPtr->pixmap = NULL;
#endif /* defined(HAVE_LIBXXSHM) */
}
GDI_HEAP_UNLOCK( hbitmap );
return hbitmap;
}
}
#endif
#endif /* defined(PRELIMINARY_WING16_SUPPORT) */
}
return 0;
}
......@@ -186,6 +201,7 @@ HBITMAP16 WINAPI WinGCreateBitmap16(HDC16 winDC, BITMAPINFO *header,
SEGPTR WINAPI WinGGetDIBPointer16(HBITMAP16 hWinGBitmap, BITMAPINFO* bmpi)
{
#ifdef PRELIMINARY_WING16_SUPPORT
#ifdef HAVE_LIBXXSHM
BITMAPOBJ* bmp = (BITMAPOBJ *) GDI_GetObjPtr( hWinGBitmap, BITMAP_MAGIC );
if( bmp )
......@@ -198,7 +214,8 @@ SEGPTR WINAPI WinGGetDIBPointer16(HBITMAP16 hWinGBitmap, BITMAPINFO* bmpi)
return p->bits;
}
}
#endif
#endif /* defined(HAVE_LIBXXSHM) */
#endif /* defined(PRELIMINARY_WING16_SUPPORT) */
return (SEGPTR)NULL;
}
......@@ -279,10 +296,12 @@ BOOL16 WINAPI WinGBitBlt16(HDC16 destDC, INT16 xDest, INT16 yDest,
widDest = widDest * dcDst->vportExtX / dcDst->wndExtX;
heiDest = heiDest * dcDst->vportExtY / dcDst->wndExtY;
TSXSetFunction( display, physDevDst->gc, GXcopy );
TSXCopyArea( display, physDevSrc->drawable,
physDevDst->drawable, physDevDst->gc,
xSrc, ySrc, widDest, heiDest, xDest, yDest );
return TRUE;
}
......@@ -7,9 +7,9 @@
#ifndef __WINE_BITMAP_H
#define __WINE_BITMAP_H
#include <X11/Xlib.h>
#include "gdi.h"
#include "ts_xlib.h"
#include "ts_xutil.h"
/* Additional info for DIB section objects */
typedef struct
......
......@@ -3,7 +3,6 @@
#include "palette.h"
#include "gdi.h"
#include "x11drv.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 */
......@@ -21,7 +20,6 @@ extern COLORREF COLOR_ToLogical(int pixel);
extern int COLOR_ToPhysical( DC *dc, COLORREF color );
extern int COLOR_SetMapping( PALETTEOBJ* pal, UINT32 uStart, UINT32 uNum, BOOL32 mapOnly );
extern BOOL32 COLOR_IsSolid( COLORREF color );
extern Colormap COLOR_GetColormap(void);
extern UINT16 COLOR_GetSystemPaletteSize(void);
extern UINT16 COLOR_GetSystemPaletteFlags(void);
extern const PALETTEENTRY* COLOR_GetSystemPaletteTemplate(void);
......
#ifndef __WINE_DDRAW_H
#define __WINE_DDRAW_H
#include "wine/obj_base.h"
#include "config.h"
#ifndef X_DISPLAY_MISSING
#include <X11/Xlib.h>
#ifdef HAVE_LIBXXSHM
#include <X11/extensions/XShm.h>
#endif /* defined(HAVE_LIBXXSHM) */
#endif /* !defined(X_DISPLAY_MISSING) */
#include "wine/obj_base.h"
#ifndef DIRECTDRAW_VERSION
#define DIRECTDRAW_VERSION 0x0500
......@@ -936,7 +932,7 @@ struct _dga_directdrawdata {
struct _xlib_directdrawdata {
#ifdef HAVE_LIBXXSHM
int xshm_active;
#endif
#endif /* defined(HAVE_LIBXXSHM) */
/* are these needed for anything? (draw_surf is the active surface)
IDirectDrawSurface *surfs;
......
......@@ -139,21 +139,22 @@
#define dbch_tooltips 131
#define dbch_trackbar 132
#define dbch_treeview 133
#define dbch_tweak 134
#define dbch_uitools 135
#define dbch_updown 136
#define dbch_ver 137
#define dbch_virtual 138
#define dbch_vxd 139
#define dbch_wave 140
#define dbch_win 141
#define dbch_win16drv 142
#define dbch_win32 143
#define dbch_wing 144
#define dbch_winsock 145
#define dbch_wnet 146
#define dbch_x11 147
#define dbch_x11drv 148
#define dbch_ttydrv 134
#define dbch_tweak 135
#define dbch_uitools 136
#define dbch_updown 137
#define dbch_ver 138
#define dbch_virtual 139
#define dbch_vxd 140
#define dbch_wave 141
#define dbch_win 142
#define dbch_win16drv 143
#define dbch_win32 144
#define dbch_wing 145
#define dbch_winsock 146
#define dbch_wnet 147
#define dbch_x11 148
#define dbch_x11drv 149
/* Definitions for classes identifiers */
#define dbcl_fixme 0
#define dbcl_err 1
......
......@@ -4,7 +4,7 @@
#include "debugtools.h"
#endif
#define DEBUG_CHANNEL_COUNT 149
#define DEBUG_CHANNEL_COUNT 150
#ifdef DEBUG_RUNTIME
short debug_msg_enabled[][DEBUG_CLASS_COUNT] = {
{1, 1, 0, 0},
......@@ -156,6 +156,7 @@ short debug_msg_enabled[][DEBUG_CLASS_COUNT] = {
{1, 1, 0, 0},
{1, 1, 0, 0},
{1, 1, 0, 0},
{1, 1, 0, 0},
};
const char* debug_ch_name[] = {
"accel",
......@@ -292,6 +293,7 @@ const char* debug_ch_name[] = {
"tooltips",
"trackbar",
"treeview",
"ttydrv",
"tweak",
"uitools",
"updown",
......
......@@ -9,13 +9,29 @@
#include "windows.h"
typedef struct
struct tagMONITOR;
struct _DESKTOP_DRIVER;
typedef struct tagDESKTOP
{
HBRUSH32 hbrushPattern;
HBITMAP32 hbitmapWallPaper;
SIZE32 bitmapSize;
BOOL32 fTileWallPaper;
} DESKTOPINFO;
HBRUSH32 hbrushPattern;
HBITMAP32 hbitmapWallPaper;
SIZE32 bitmapSize;
BOOL32 fTileWallPaper;
struct tagMONITOR *pPrimaryMonitor;
struct _DESKTOP_DRIVER *pDriver; /* Desktop driver */
void *pDriverData; /* Desktop driver data */
} DESKTOP;
typedef struct _DESKTOP_DRIVER {
void (*pInitialize)(struct tagDESKTOP *pDesktop);
void (*pFinalize)(struct tagDESKTOP *pDesktop);
} DESKTOP_DRIVER;
extern int DESKTOP_GetScreenWidth();
extern int DESKTOP_GetScreenHeight();
extern int DESKTOP_GetScreenDepth();
extern BOOL32 DESKTOP_SetPattern( LPCSTR pattern );
extern LRESULT WINAPI DesktopWndProc( HWND32 hwnd, UINT32 message,
......
......@@ -11,11 +11,11 @@
#include "wine/winuser16.h"
#pragma pack(1)
typedef struct _CURSORINFO
typedef struct tagCURSORINFO
{
WORD wXMickeys;
WORD wYMickeys;
} CURSORINFO, *LPCURSORINFO;
} CURSORINFO, *PCURSORINFO, *LPCURSORINFO;
#pragma pack(4)
typedef struct _MOUSE_DRIVER {
......
......@@ -12,6 +12,9 @@ extern HINSTANCE32 MAIN_WinelibInit( int *argc, char *argv[] );
extern int MAIN_GetLanguageID(char*lang, char*country, char*charset, char*dialect);
extern BOOL32 MAIN_ParseDebugOptions(char *options);
extern void MAIN_ParseLanguageOption( char *arg );
extern void MAIN_ParseModeOption( char *arg );
extern BOOL32 RELAY_Init(void);
extern int RELAY_ShowDebugmsgRelay(const char *func);
extern void* CALL32_Init(void);
......
......@@ -51,6 +51,8 @@ typedef enum
struct options
{
int *argc;
char **argv;
char * desktopGeometry; /* NULL when no desktop */
char * programName; /* To use when loading resources */
char * argv0; /* argv[0] of Wine process */
......@@ -71,6 +73,7 @@ struct options
int noDGA; /* Disable XFree86 DGA extensions */
char * configFileName; /* Command line config file */
char * consoleDrivers; /* Console driver list */
int screenDepth;
};
extern struct options Options;
......
......@@ -5,22 +5,47 @@
#ifndef __WINE_TTYDRV_H
#define __WINE_TTYDRV_H
#include "clipboard.h"
#include "keyboard.h"
#include "message.h"
#include "windows.h"
#include "wine/winuser16.h"
struct tagCLASS;
struct tagDC;
struct tagDESKTOP;
struct tagWND;
/* TTY GDI driver */
typedef struct {
} TTYDRV_PDEVICE;
extern BOOL32 TTYDRV_GDI_Initialize();
extern void TTDRV_GDI_Finalize();
extern BOOL32 TTYDRV_GDI_CreateDC(struct tagDC *dc, LPCSTR driver, LPCSTR device, LPCSTR output, const DEVMODE16 *initData);
extern BOOL32 TTYDRV_GDI_DeleteDC(struct tagDC *dc);
extern INT32 TTYDRV_GDI_Escape(struct tagDC *dc, INT32 nEscape, INT32 cbInput, SEGPTR lpInData, SEGPTR lpOutData);
/* TTY clipboard driver */
extern CLIPBOARD_DRIVER TTYDRV_CLIPBOARD_Driver;
extern struct _CLIPBOARD_DRIVER TTYDRV_CLIPBOARD_Driver;
extern void TTYDRV_CLIPBOARD_EmptyClipboard();
extern void TTYDRV_CLIPBOARD_SetClipboardData(UINT32 wFormat);
extern BOOL32 TTYDRV_CLIPBOARD_RequestSelection();
extern void TTYDRV_CLIPBOARD_ResetOwner(WND *pWnd, BOOL32 bFooBar);
extern void TTYDRV_CLIPBOARD_ResetOwner(struct tagWND *pWnd, BOOL32 bFooBar);
/* TTY desktop driver */
extern struct _DESKTOP_DRIVER TTYDRV_DESKTOP_Driver;
extern void TTYDRV_DESKTOP_Initialize(struct tagDESKTOP *pDesktop);
extern void TTYDRV_DESKTOP_Finalize(struct tagDESKTOP *pDesktop);
extern int TTYDRV_DESKTOP_GetScreenWidth(struct tagDESKTOP *pDesktop);
extern int TTYDRV_DESKTOP_GetScreenHeight(struct tagDESKTOP *pDesktop);
extern int TTYDRV_DESKTOP_GetScreenDepth(struct tagDESKTOP *pDesktop);
/* TTY event driver */
extern EVENT_DRIVER TTYDRV_EVENT_Driver;
extern struct _EVENT_DRIVER TTYDRV_EVENT_Driver;
extern BOOL32 TTYDRV_EVENT_Init(void);
extern void TTYDRV_EVENT_AddIO(int fd, unsigned flag);
......@@ -35,7 +60,7 @@ extern BOOL16 TTYDRV_EVENT_IsUserIdle(void);
/* TTY keyboard driver */
extern KEYBOARD_DRIVER TTYDRV_KEYBOARD_Driver;
extern struct _KEYBOARD_DRIVER TTYDRV_KEYBOARD_Driver;
extern void TTYDRV_KEYBOARD_Init(void);
extern WORD TTYDRV_KEYBOARD_VkKeyScan(CHAR cChar);
......@@ -43,4 +68,58 @@ 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();
extern void TTYDRV_MAIN_Initialize();
extern void TTYDRV_MAIN_ParseOptions(int *argc, char *argv[]);
extern void TTYDRV_MAIN_Create();
extern void TTYDRV_MAIN_SaveSetup();
extern void TTYDRV_MAIN_RestoreSetup();
/* TTY monitor driver */
extern struct tagMONITOR_DRIVER TTYDRV_MONITOR_Driver;
typedef struct _TTYDRV_MONITOR_DATA {
int width;
int height;
int depth;
} TTYDRV_MONITOR_DATA;
struct tagMONITOR;
extern void TTYDRV_MONITOR_Initialize(struct tagMONITOR *pMonitor);
extern void TTYDRV_MONITOR_Finalize(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);
/* TTY mouse driver */
extern struct _MOUSE_DRIVER TTYDRV_MOUSE_Driver;
extern void TTYDRV_MOUSE_SetCursor(CURSORICONINFO *lpCursor);
extern void TTYDRV_MOUSE_MoveCursor(WORD wAbsX, WORD wAbsY);
/* TTY windows driver */
extern struct _WND_DRIVER TTYDRV_WND_Driver;
extern void TTYDRV_WND_Initialize(struct tagWND *wndPtr);
extern void TTYDRV_WND_Finalize(struct tagWND *wndPtr);
extern BOOL32 TTYDRV_WND_CreateDesktopWindow(struct tagWND *wndPtr, struct tagCLASS *classPtr, BOOL32 bUnicode);
extern BOOL32 TTYDRV_WND_CreateWindow(struct tagWND *wndPtr, struct tagCLASS *classPtr, CREATESTRUCT32A *cs, BOOL32 bUnicode);
extern BOOL32 TTYDRV_WND_DestroyWindow(struct tagWND *pWnd);
extern struct tagWND *TTYDRV_WND_SetParent(struct tagWND *wndPtr, struct tagWND *pWndParent);
extern void TTYDRV_WND_ForceWindowRaise(struct tagWND *pWnd);
extern void TTYDRV_WND_SetWindowPos(struct tagWND *wndPtr, const WINDOWPOS32 *winpos, BOOL32 bSMC_SETXPOS);
extern void TTYDRV_WND_SetText(struct tagWND *wndPtr, LPCSTR text);
extern void TTYDRV_WND_SetFocus(struct tagWND *wndPtr);
extern void TTYDRV_WND_PreSizeMove(struct tagWND *wndPtr);
extern void TTYDRV_WND_PostSizeMove(struct tagWND *wndPtr);
extern void TTYDRV_WND_ScrollWindow(struct tagWND *wndPtr, struct tagDC *dcPtr, INT32 dx, INT32 dy, const RECT32 *clipRect, BOOL32 bUpdate);
extern void TTYDRV_WND_SetDrawable(struct tagWND *wndPtr, struct tagDC *dc, WORD flags, BOOL32 bSetClipOrigin);
extern BOOL32 TTYDRV_WND_IsSelfClipping(struct tagWND *wndPtr);
#endif /* !defined(__WINE_TTYDRV_H) */
......@@ -7,14 +7,9 @@
#ifndef __WINE_WIN_H
#define __WINE_WIN_H
#include "config.h"
#ifndef X_DISPLAY_MISSING
#include <X11/Xlib.h>
#endif /* !defined(X_DISPLAY_MISSING) */
#include "ldt.h"
#include "class.h"
#include "ldt.h"
#include "windows.h"
#include "winproc.h"
#define WND_MAGIC 0x444e4957 /* 'WIND' */
......@@ -54,6 +49,7 @@ typedef enum
#define RDW_C_USEHRGN 0x0001
#define RDW_C_DELETEHRGN 0x0002
struct tagCLASS;
struct tagDCE;
struct tagDC;
struct _WND_DRIVER;
......@@ -64,7 +60,7 @@ typedef struct tagWND
struct tagWND *child; /* First child */
struct tagWND *parent; /* Window parent (from CreateWindow) */
struct tagWND *owner; /* Window owner */
CLASS *class; /* Window class */
struct tagCLASS *class; /* Window class */
HWINDOWPROC winproc; /* Window procedure */
DWORD dwMagic; /* Magic number (must be WND_MAGIC) */
HWND32 hwndSelf; /* Handle of this window */
......@@ -84,9 +80,6 @@ typedef struct tagWND
UINT32 wIDmenu; /* ID or hmenu (from CreateWindow) */
DWORD helpContext; /* Help context ID */
WORD flags; /* Misc. flags (see below) */
#if 0
Window window; /* X window (only for top-level windows) */
#endif
HMENU16 hSysMenu; /* window's copy of System Menu */
DWORD userdata; /* User private data */
struct _WND_DRIVER *pDriver; /* Window driver */
......@@ -98,8 +91,8 @@ typedef struct _WND_DRIVER
{
void (*pInitialize)(WND *);
void (*pFinalize)(WND *);
BOOL32 (*pCreateDesktopWindow)(WND *, CLASS *, BOOL32);
BOOL32 (*pCreateWindow)(WND *, CLASS *, CREATESTRUCT32A *, BOOL32);
BOOL32 (*pCreateDesktopWindow)(WND *, struct tagCLASS *, BOOL32);
BOOL32 (*pCreateWindow)(WND *, struct tagCLASS *, CREATESTRUCT32A *, BOOL32);
BOOL32 (*pDestroyWindow)(WND *);
WND* (*pSetParent)(WND *, WND *);
void (*pForceWindowRaise)(WND *);
......@@ -181,8 +174,4 @@ extern BOOL32 ICONTITLE_Init( void );
/* windows/focus.c */
extern void FOCUS_SwitchFocus( HWND32 , HWND32 );
extern Display * display;
extern Screen * screen;
extern Window rootWindow;
#endif /* __WINE_WIN_H */
......@@ -14,15 +14,14 @@
#include <X11/Xatom.h>
#endif /* !defined(X_DISPLAY_MISSING) */
#include "winbase.h"
#include "wintypes.h"
#include "display.h"
#include "gdi.h"
#include "xmalloc.h" /* for XCREATEIMAGE macro */
#include "clipboard.h"
#include "keyboard.h"
#include "message.h"
#include "win.h"
#include "wintypes.h"
#include "wine/winuser16.h"
struct tagCLASS;
struct tagDC;
struct tagDeviceCaps;
struct tagWND;
/* X physical pen */
typedef struct
......@@ -75,9 +74,6 @@ extern GC BITMAP_monoGC, BITMAP_colorGC;
/* Wine driver X11 functions */
struct tagDC;
struct tagDeviceCaps;
extern BOOL32 X11DRV_Init(void);
extern BOOL32 X11DRV_BitBlt( struct tagDC *dcDst, INT32 xDst, INT32 yDst,
INT32 width, INT32 height, struct tagDC *dcSrc,
......@@ -173,12 +169,6 @@ extern BOOL32 X11DRV_SetupGCForText( struct tagDC *dc );
extern const int X11DRV_XROPfunction[];
extern Display * display;
extern Screen * screen;
extern Window rootWindow;
extern int screenWidth, screenHeight, screenDepth;
/* Xlib critical section */
extern CRITICAL_SECTION X11DRV_CritSection;
......@@ -188,7 +178,7 @@ extern void _XInitImageFuncPtrs(XImage *);
#define XCREATEIMAGE(image,width,height,bpp) \
{ \
int width_bytes = X11DRV_DIB_GetXImageWidthBytes( (width), (bpp) ); \
(image) = TSXCreateImage(display, DefaultVisualOfScreen(screen), \
(image) = TSXCreateImage(display, DefaultVisualOfScreen(X11DRV_GetXScreen()), \
(bpp), ZPixmap, 0, xcalloc( (height)*width_bytes ),\
(width), (height), 32, width_bytes ); \
}
......@@ -224,67 +214,43 @@ extern int *X11DRV_DIB_BuildColorMap( struct tagDC *dc, WORD coloruse,
WORD depth, const BITMAPINFO *info,
int *nColors );
/* X11 windows driver */
extern WND_DRIVER X11DRV_WND_Driver;
typedef struct _X11DRV_WND_DATA {
Window window;
} X11DRV_WND_DATA;
extern Window X11DRV_WND_GetXWindow(WND *wndPtr);
extern Window X11DRV_WND_FindXWindow(WND *wndPtr);
extern void X11DRV_WND_Initialize(WND *wndPtr);
extern void X11DRV_WND_Finalize(WND *wndPtr);
extern BOOL32 X11DRV_WND_CreateDesktopWindow(WND *wndPtr, CLASS *classPtr, BOOL32 bUnicode);
extern BOOL32 X11DRV_WND_CreateWindow(WND *wndPtr, CLASS *classPtr, CREATESTRUCT32A *cs, BOOL32 bUnicode);
extern BOOL32 X11DRV_WND_DestroyWindow(WND *pWnd);
extern WND *X11DRV_WND_SetParent(WND *wndPtr, WND *pWndParent);
extern void X11DRV_WND_ForceWindowRaise(WND *pWnd);
extern void X11DRV_WND_SetWindowPos(WND *wndPtr, const WINDOWPOS32 *winpos, BOOL32 bSMC_SETXPOS);
extern void X11DRV_WND_SetText(WND *wndPtr, LPCSTR text);
extern void X11DRV_WND_SetFocus(WND *wndPtr);
extern void X11DRV_WND_PreSizeMove(WND *wndPtr);
extern void X11DRV_WND_PostSizeMove(WND *wndPtr);
extern void X11DRV_WND_ScrollWindow(WND *wndPtr, DC *dcPtr, INT32 dx, INT32 dy, const RECT32 *clipRect, BOOL32 bUpdate);
extern void X11DRV_WND_SetDrawable(WND *wndPtr, DC *dc, WORD flags, BOOL32 bSetClipOrigin);
extern BOOL32 X11DRV_WND_IsSelfClipping(WND *wndPtr);
/* X11 clipboard driver */
extern CLIPBOARD_DRIVER X11DRV_CLIPBOARD_Driver;
extern struct _CLIPBOARD_DRIVER X11DRV_CLIPBOARD_Driver;
extern void X11DRV_CLIPBOARD_EmptyClipboard();
extern void X11DRV_CLIPBOARD_SetClipboardData(UINT32 wFormat);
extern BOOL32 X11DRV_CLIPBOARD_RequestSelection();
extern void X11DRV_CLIPBOARD_ResetOwner(WND *pWnd, BOOL32 bFooBar);
extern void X11DRV_CLIPBOARD_ResetOwner(struct tagWND *pWnd, BOOL32 bFooBar);
void X11DRV_CLIPBOARD_ReadSelection(Window w, Atom prop);
void X11DRV_CLIPBOARD_ReleaseSelection(Window w, HWND32 hwnd);
/* X11 keyboard driver */
/* X11 color driver */
extern KEYBOARD_DRIVER X11DRV_KEYBOARD_Driver;
extern Colormap X11DRV_COLOR_GetColormap(void);
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( WND *pWnd, XKeyEvent *event );
extern void KEYBOARD_UpdateState ( void );
/* X11 desktop driver */
/* X11 mouse driver */
extern struct _DESKTOP_DRIVER X11DRV_DESKTOP_Driver;
extern MOUSE_DRIVER X11DRV_MOUSE_Driver;
typedef struct _X11DRV_DESKTOP_DATA {
} X11DRV_DESKTOP_DATA;
extern void X11DRV_MOUSE_SetCursor(CURSORICONINFO *lpCursor);
extern void X11DRV_MOUSE_MoveCursor(WORD wAbsX, WORD wAbsY);
struct tagDESKTOP;
extern Screen *X11DRV_DESKTOP_GetXScreen(struct tagDESKTOP *pDesktop);
extern Window X11DRV_DESKTOP_GetXRootWindow(struct tagDESKTOP *pDesktop);
extern void X11DRV_DESKTOP_Initialize(struct tagDESKTOP *pDesktop);
extern void X11DRV_DESKTOP_Finalize(struct tagDESKTOP *pDesktop);
extern int X11DRV_DESKTOP_GetScreenWidth(struct tagDESKTOP *pDesktop);
extern int X11DRV_DESKTOP_GetScreenHeight(struct tagDESKTOP *pDesktop);
extern int X11DRV_DESKTOP_GetScreenDepth(struct tagDESKTOP *pDesktop);
/* X11 event driver */
extern EVENT_DRIVER X11DRV_EVENT_Driver;
extern struct _EVENT_DRIVER X11DRV_EVENT_Driver;
extern BOOL32 X11DRV_EVENT_Init(void);
extern void X11DRV_EVENT_AddIO(int fd, unsigned flag);
......@@ -297,4 +263,88 @@ extern void X11DRV_EVENT_DummyMotionNotify(void);
extern BOOL32 X11DRV_EVENT_Pending(void);
extern BOOL16 X11DRV_EVENT_IsUserIdle(void);
/* X11 keyboard driver */
extern struct _KEYBOARD_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 );
/* X11 main driver */
extern Display *display;
extern Screen *X11DRV_GetXScreen();
extern Window X11DRV_GetXRootWindow();
extern void X11DRV_MAIN_Finalize();
extern void X11DRV_MAIN_Initialize();
extern void X11DRV_MAIN_ParseOptions(int *argc, char *argv[]);
extern void X11DRV_MAIN_Create();
extern void X11DRV_MAIN_SaveSetup();
extern void X11DRV_MAIN_RestoreSetup();
/* X11 monitor driver */
extern struct tagMONITOR_DRIVER X11DRV_MONITOR_Driver;
typedef struct _X11DRV_MONITOR_DATA {
Screen *screen;
Window rootWindow;
int width;
int height;
int depth;
} X11DRV_MONITOR_DATA;
struct tagMONITOR;
extern Screen *X11DRV_MONITOR_GetXScreen(struct tagMONITOR *pMonitor);
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 int X11DRV_MONITOR_GetWidth(struct tagMONITOR *pMonitor);
extern int X11DRV_MONITOR_GetHeight(struct tagMONITOR *pMonitor);
extern int X11DRV_MONITOR_GetDepth(struct tagMONITOR *pMonitor);
/* X11 mouse driver */
extern struct _MOUSE_DRIVER X11DRV_MOUSE_Driver;
extern void X11DRV_MOUSE_SetCursor(CURSORICONINFO *lpCursor);
extern void X11DRV_MOUSE_MoveCursor(WORD wAbsX, WORD wAbsY);
/* X11 windows driver */
extern struct _WND_DRIVER X11DRV_WND_Driver;
typedef struct _X11DRV_WND_DATA {
Window window;
} X11DRV_WND_DATA;
extern Window X11DRV_WND_GetXWindow(struct tagWND *wndPtr);
extern Window X11DRV_WND_FindXWindow(struct tagWND *wndPtr);
extern Screen *X11DRV_WND_GetXScreen(struct tagWND *wndPtr);
extern Window X11DRV_WND_GetXRootWindow(struct tagWND *wndPtr);
extern void X11DRV_WND_Initialize(struct tagWND *wndPtr);
extern void X11DRV_WND_Finalize(struct tagWND *wndPtr);
extern BOOL32 X11DRV_WND_CreateDesktopWindow(struct tagWND *wndPtr, struct tagCLASS *classPtr, BOOL32 bUnicode);
extern BOOL32 X11DRV_WND_CreateWindow(struct tagWND *wndPtr, struct tagCLASS *classPtr, CREATESTRUCT32A *cs, BOOL32 bUnicode);
extern BOOL32 X11DRV_WND_DestroyWindow(struct tagWND *pWnd);
extern struct tagWND *X11DRV_WND_SetParent(struct tagWND *wndPtr, struct tagWND *pWndParent);
extern void X11DRV_WND_ForceWindowRaise(struct tagWND *pWnd);
extern void X11DRV_WND_SetWindowPos(struct tagWND *wndPtr, const WINDOWPOS32 *winpos, BOOL32 bSMC_SETXPOS);
extern void X11DRV_WND_SetText(struct tagWND *wndPtr, LPCSTR text);
extern void X11DRV_WND_SetFocus(struct tagWND *wndPtr);
extern void X11DRV_WND_PreSizeMove(struct tagWND *wndPtr);
extern void X11DRV_WND_PostSizeMove(struct tagWND *wndPtr);
extern void X11DRV_WND_ScrollWindow(struct tagWND *wndPtr, struct tagDC *dcPtr, INT32 dx, INT32 dy, const RECT32 *clipRect, BOOL32 bUpdate);
extern void X11DRV_WND_SetDrawable(struct tagWND *wndPtr, struct tagDC *dc, WORD flags, BOOL32 bSetClipOrigin);
extern BOOL32 X11DRV_WND_IsSelfClipping(struct tagWND *wndPtr);
#endif /* __WINE_X11DRV_H */
......@@ -15,7 +15,8 @@
#include "sysmetrics.h"
#include "cursoricon.h"
#include "debug.h"
#include "x11drv.h"
#include "monitor.h"
#include "wine/winuser16.h"
/***********************************************************************
* BITMAP_GetPadding
......@@ -107,7 +108,7 @@ HBITMAP16 WINAPI CreateUserBitmap16( INT16 width, INT16 height, UINT16 planes,
HBITMAP16 WINAPI CreateUserDiscardableBitmap16( WORD dummy,
INT16 width, INT16 height )
{
return CreateUserBitmap16( width, height, 1, screenDepth, NULL );
return CreateUserBitmap16( width, height, 1, MONITOR_GetDepth(&MONITOR_PrimaryMonitor), NULL );
}
......
......@@ -5,16 +5,18 @@
* Copyright 1996 Alex Korobka
*/
#include <stdlib.h>
#include "ts_xlib.h"
#include "x11drv.h"
#include <stdlib.h>
#include <string.h>
#include "windows.h"
#include "wintypes.h"
#include "options.h"
#include "gdi.h"
#include "color.h"
#include "debug.h"
#include "xmalloc.h"
#include "x11drv.h"
#include "monitor.h"
/* Palette indexed mode:
......@@ -121,7 +123,7 @@ int COLOR_mapEGAPixel[16];
/***********************************************************************
* Misc auxiliary functions
*/
Colormap COLOR_GetColormap(void)
Colormap X11DRV_COLOR_GetColormap(void)
{
return cSpace.colorMap;
}
......@@ -238,7 +240,6 @@ static void COLOR_FillDefaultColors(void)
(DoRed | DoGreen | DoBlue) };
TSXStoreColor(display, cSpace.colorMap, &color);
}
idx = COLOR_freeList[idx];
}
......@@ -327,6 +328,7 @@ static BOOL32 COLOR_BuildPrivateMap(CSPACE* cs)
COLOR_gapStart = 256; COLOR_gapEnd = -1;
COLOR_firstFree = (cs->size > NB_RESERVED_COLORS)?NB_RESERVED_COLORS/2 : -1;
return FALSE;
}
......@@ -369,7 +371,7 @@ static BOOL32 COLOR_BuildSharedMap(CSPACE* cs)
bp = BlackPixel(display, DefaultScreen(display));
wp = WhitePixel(display, DefaultScreen(display));
max = (0xffffffff)>>(32 - screenDepth);
max = (0xffffffff)>>(32 - MONITOR_GetDepth(&MONITOR_PrimaryMonitor));
if( max > 256 )
{
step = max/256;
......@@ -470,7 +472,7 @@ static BOOL32 COLOR_BuildSharedMap(CSPACE* cs)
* to maintain compatibility
*/
cs->size = 256;
TRACE(palette,"Virtual colorspace - screendepth %i\n", screenDepth);
TRACE(palette,"Virtual colorspace - screendepth %i\n", MONITOR_GetDepth(&MONITOR_PrimaryMonitor));
}
else cs->size = NB_RESERVED_COLORS; /* system palette only - however we can alloc a bunch
* of colors and map to them */
......@@ -493,7 +495,7 @@ static BOOL32 COLOR_BuildSharedMap(CSPACE* cs)
/* setup system palette entry <-> pixel mappings and fill in 20 fixed entries */
if( screenDepth <= 8 )
if( MONITOR_GetDepth(&MONITOR_PrimaryMonitor) <= 8 )
{
COLOR_PixelToPalette = (int*)xmalloc(sizeof(int)*256);
memset( COLOR_PixelToPalette, 0, 256*sizeof(int) );
......@@ -536,6 +538,7 @@ static BOOL32 COLOR_BuildSharedMap(CSPACE* cs)
}
if( pixDynMapping ) free(pixDynMapping);
return TRUE;
}
......@@ -576,8 +579,8 @@ BOOL32 COLOR_Init(void)
TRACE(palette,"initializing palette manager...\n");
white = WhitePixelOfScreen( screen );
black = BlackPixelOfScreen( screen );
white = WhitePixelOfScreen( X11DRV_GetXScreen() );
black = BlackPixelOfScreen( X11DRV_GetXScreen() );
cSpace.monoPlane = 1;
for( mask = 1; !((white & mask)^(black & mask)); mask <<= 1 )
cSpace.monoPlane++;
......@@ -594,7 +597,7 @@ BOOL32 COLOR_Init(void)
{
XSetWindowAttributes win_attr;
cSpace.colorMap = TSXCreateColormap( display, rootWindow,
cSpace.colorMap = TSXCreateColormap( display, X11DRV_GetXRootWindow(),
visual, AllocAll );
if (cSpace.colorMap)
{
......@@ -604,22 +607,22 @@ BOOL32 COLOR_Init(void)
for( white = cSpace.size - 1; !(white & 1); white >>= 1 )
cSpace.monoPlane++;
if( rootWindow != DefaultRootWindow(display) )
if( X11DRV_GetXRootWindow() != DefaultRootWindow(display) )
{
win_attr.colormap = cSpace.colorMap;
TSXChangeWindowAttributes( display, rootWindow,
TSXChangeWindowAttributes( display, X11DRV_GetXRootWindow(),
CWColormap, &win_attr );
}
break;
}
}
cSpace.colorMap = DefaultColormapOfScreen( screen );
cSpace.colorMap = DefaultColormapOfScreen( X11DRV_GetXScreen() );
break;
case StaticGray:
cSpace.colorMap = DefaultColormapOfScreen( screen );
cSpace.colorMap = DefaultColormapOfScreen( X11DRV_GetXScreen() );
cSpace.flags |= COLOR_FIXED;
COLOR_Graymax = (1<<screenDepth)-1;
COLOR_Graymax = (1<<MONITOR_GetDepth(&MONITOR_PrimaryMonitor))-1;
break;
case TrueColor:
......@@ -635,12 +638,12 @@ BOOL32 COLOR_Init(void)
for( white = cSpace.size - 1; !(white & 1); white >>= 1 )
cSpace.monoPlane++;
cSpace.flags = (white & mask) ? COLOR_WHITESET : 0;
cSpace.colorMap = DefaultColormapOfScreen( screen );
cSpace.colorMap = DefaultColormapOfScreen( X11DRV_GetXScreen() );
TSXFree(depths);
break;
}
TSXFree(depths);
cSpace.colorMap = DefaultColormapOfScreen( screen );
cSpace.colorMap = DefaultColormapOfScreen( X11DRV_GetXScreen() );
cSpace.flags |= COLOR_FIXED;
COLOR_Computeshifts(visual->red_mask, &COLOR_Redshift, &COLOR_Redmax);
COLOR_Computeshifts(visual->green_mask, &COLOR_Greenshift, &COLOR_Greenmax);
......@@ -822,7 +825,7 @@ COLORREF COLOR_ToLogical(int pixel)
#if 0
/* truecolor visual */
if (screenDepth >= 24) return pixel;
if (MONITOR_GetDepth(&MONITOR_PrimaryMonitor) >= 24) return pixel;
#endif
/* check for hicolor visuals first */
......@@ -839,7 +842,7 @@ COLORREF COLOR_ToLogical(int pixel)
/* check if we can bypass X */
if ((screenDepth <= 8) && (pixel < 256) &&
if ((MONITOR_GetDepth(&MONITOR_PrimaryMonitor) <= 8) && (pixel < 256) &&
!(cSpace.flags & (COLOR_VIRTUAL | COLOR_FIXED)) )
return ( *(COLORREF*)(COLOR_sysPal +
((COLOR_PixelToPalette)?COLOR_PixelToPalette[pixel]:pixel)) ) & 0x00ffffff;
......
......@@ -5,6 +5,9 @@
*
*/
#include "ts_xlib.h"
#include "x11drv.h"
#include <stdlib.h>
#include <string.h>
#include "dc.h"
......@@ -14,8 +17,7 @@
#include "debug.h"
#include "font.h"
#include "winerror.h"
#include "x11drv.h"
#include "ts_xlib.h"
#include "wine/winuser16.h"
/***********************************************************************
* DC_Init_DC_INFO
......
......@@ -6,6 +6,9 @@
* TODO: Still contains some references to X11DRV.
*/
#include "ts_xlib.h"
#include "x11drv.h"
#include <stdlib.h>
#include "dc.h"
#include "bitmap.h"
......@@ -13,7 +16,9 @@
#include "palette.h"
#include "global.h"
#include "debug.h"
#include "x11drv.h"
#include "local.h"
#include "xmalloc.h" /* for XCREATEIMAGE macro */
#include "monitor.h"
/***********************************************************************
......@@ -696,7 +701,7 @@ HBITMAP32 WINAPI CreateDIBitmap32( HDC32 hdc, const BITMAPINFOHEADER *header,
/* Now create the bitmap */
handle = fColor ? CreateBitmap32( width, height, 1, screenDepth, NULL ) :
handle = fColor ? CreateBitmap32( width, height, 1, MONITOR_GetDepth(&MONITOR_PrimaryMonitor), NULL ) :
CreateBitmap32( width, height, 1, 1, NULL );
if (!handle) return 0;
......
......@@ -4,6 +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) */
#include <stdlib.h>
#include "bitmap.h"
#include "brush.h"
......@@ -16,7 +24,6 @@
#include "region.h"
#include "debug.h"
#include "gdi.h"
#include "x11drv.h"
/***********************************************************************
* GDI stock objects
......@@ -243,8 +250,13 @@ BOOL32 GDI_Init(void)
/* Initialize drivers */
#ifndef X_DISPLAY_MISSING
if( ! X11DRV_Init() )
return FALSE;
#else /* !defined(X_DISPLAY_MISSING) */
if( ! TTYDRV_GDI_Initialize() )
return FALSE;
#endif /* !defined(X_DISPLAY_MISSING) */
/* Create default palette */
......
......@@ -15,6 +15,7 @@
#include "palette.h"
#include "xmalloc.h"
#include "debug.h"
#include "wine/winuser16.h"
FARPROC32 pfnSelectPalette = NULL;
FARPROC32 pfnRealizePalette = NULL;
......
......@@ -22,7 +22,11 @@
#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
......@@ -75,7 +79,11 @@ static LPCLIPFORMAT __lookup_format( LPCLIPFORMAT lpFormat, WORD wID )
*/
CLIPBOARD_DRIVER *CLIPBOARD_GetDriver()
{
return &X11DRV_CLIPBOARD_Driver;
#ifndef X_DISPLAY_MISSING
return &X11DRV_CLIPBOARD_Driver;
#else /* X_DISPLAY_MISSING */
return &TTYDRV_CLIPBOARD_Driver;
#endif /* X_DISPLAY_MISSING */
};
/**************************************************************************
......
......@@ -17,6 +17,8 @@
* DCX_WINDOWPAINT - BeginPaint() is in effect
*/
#include "x11drv.h"
#include "options.h"
#include "dce.h"
#include "class.h"
......@@ -25,6 +27,7 @@
#include "region.h"
#include "heap.h"
#include "sysmetrics.h"
#include "local.h"
#include "debug.h"
#include "wine/winuser16.h"
......@@ -725,7 +728,7 @@ HDC32 WINAPI GetDCEx32( HWND32 hwnd, HRGN32 hrgnClip, DWORD flags )
}
else
if ((hwnd == GetDesktopWindow32()) &&
(rootWindow == DefaultRootWindow(display)))
(X11DRV_WND_GetXRootWindow(wndPtr) == DefaultRootWindow(display)))
hrgnVisible = CreateRectRgn32( 0, 0, SYSMETRICS_CXSCREEN,
SYSMETRICS_CYSCREEN );
else
......
......@@ -5,18 +5,28 @@
*
*/
#include "config.h"
#include "debug.h"
#include "display.h"
#include "wintypes.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 */
}
/***********************************************************************
......
......@@ -5,16 +5,26 @@
*
*/
#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 */
}
/***********************************************************************
......
......@@ -9,6 +9,8 @@
*
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
......@@ -26,14 +28,22 @@
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_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 */
}
/***********************************************************************
......
......@@ -11,7 +11,11 @@
#include "mouse.h"
#include "debug.h"
#include "debugtools.h"
#include "x11drv.h"
#include "desktop.h"
/**********************************************************************/
extern BOOL32 X11DRV_MOUSE_DisableWarpPointer;
static LPMOUSE_EVENT_PROC DefMouseEventProc = NULL;
......@@ -55,7 +59,6 @@ VOID WINAPI MOUSE_Disable(VOID)
void MOUSE_SendEvent( DWORD mouseStatus, DWORD posX, DWORD posY,
DWORD keyState, DWORD time, HWND32 hWnd )
{
extern BOOL32 DISPLAY_DisableWarpPointer;
WINE_MOUSEEVENT wme;
if ( !DefMouseEventProc ) return;
......@@ -63,16 +66,16 @@ void MOUSE_SendEvent( DWORD mouseStatus, DWORD posX, DWORD posY,
TRACE( event, "(%04lX,%ld,%ld)\n", mouseStatus, posX, posY );
mouseStatus |= MOUSEEVENTF_ABSOLUTE;
posX = (((long)posX << 16) + screenWidth-1) / screenWidth;
posY = (((long)posY << 16) + screenHeight-1) / screenHeight;
posX = (((long)posX << 16) + DESKTOP_GetScreenWidth()-1) / DESKTOP_GetScreenWidth();
posY = (((long)posY << 16) + DESKTOP_GetScreenHeight()-1) / DESKTOP_GetScreenHeight();
wme.magic = WINE_MOUSEEVENT_MAGIC;
wme.keyState = keyState;
wme.time = time;
wme.hWnd = hWnd;
DISPLAY_DisableWarpPointer = TRUE;
X11DRV_MOUSE_DisableWarpPointer = TRUE;
DefMouseEventProc( mouseStatus, posX, posY, 0, (DWORD)&wme );
DISPLAY_DisableWarpPointer = FALSE;
X11DRV_MOUSE_DisableWarpPointer = FALSE;
}
......@@ -7,10 +7,10 @@
#include <stdio.h>
#include "gdi.h"
#include "monitor.h"
#include "options.h"
#include "tweak.h"
#include "sysmetrics.h"
#include "x11drv.h"
#include "tweak.h"
short sysMetrics[SM_CMETRICS+1];
......@@ -35,8 +35,8 @@ void SYSMETRICS_Init(void)
{
sysMetrics[SM_CXCURSOR] = 32;
sysMetrics[SM_CYCURSOR] = 32;
sysMetrics[SM_CXSCREEN] = screenWidth;
sysMetrics[SM_CYSCREEN] = screenHeight;
sysMetrics[SM_CXSCREEN] = MONITOR_GetWidth(&MONITOR_PrimaryMonitor);
sysMetrics[SM_CYSCREEN] = MONITOR_GetHeight(&MONITOR_PrimaryMonitor);
sysMetrics[SM_CXVSCROLL] =
PROFILE_GetWineIniInt("Tweak.Layout", "ScrollBarWidth", 16) + 1;
sysMetrics[SM_CYHSCROLL] = sysMetrics[SM_CXVSCROLL];
......
......@@ -24,7 +24,9 @@
#include "miscemu.h"
#include "shell.h"
#include "callback.h"
#include "x11drv.h"
#include "local.h"
#include "class.h"
#include "desktop.h"
/***********************************************************************
* GetFreeSystemResources (USER.284)
......@@ -312,9 +314,9 @@ LONG WINAPI ChangeDisplaySettings32A( LPDEVMODE32A devmode, DWORD flags )
FIXME(system, ": stub\n");
if (devmode==NULL)
FIXME(system," devmode=NULL (return to default mode)\n");
else if ( (devmode->dmBitsPerPel != DefaultDepthOfScreen(screen))
|| (devmode->dmPelsHeight != screenHeight)
|| (devmode->dmPelsWidth != screenWidth) )
else if ( (devmode->dmBitsPerPel != DESKTOP_GetScreenDepth())
|| (devmode->dmPelsHeight != DESKTOP_GetScreenHeight())
|| (devmode->dmPelsWidth != DESKTOP_GetScreenWidth()) )
{
......@@ -353,9 +355,9 @@ BOOL32 WINAPI EnumDisplaySettings32A(
TRACE(system,"(%s,%ld,%p)\n",name,n,devmode);
if (n==0) {
devmode->dmBitsPerPel = DefaultDepthOfScreen(screen);
devmode->dmPelsHeight = screenHeight;
devmode->dmPelsWidth = screenWidth;
devmode->dmBitsPerPel = DESKTOP_GetScreenDepth();
devmode->dmPelsHeight = DESKTOP_GetScreenHeight();
devmode->dmPelsWidth = DESKTOP_GetScreenWidth();
return TRUE;
}
if ((n-1)<NRMODES*NRDEPTHS) {
......
......@@ -4,6 +4,8 @@
* Copyright 1993, 1994 Alexandre Julliard
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include "options.h"
......@@ -31,8 +33,16 @@
#include "debug.h"
#include "winerror.h"
#include "mdi.h"
#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 */
/* Desktop window */
static WND *pWndDesktop = NULL;
......@@ -387,6 +397,7 @@ BOOL32 WIN_CreateDesktopWindow(void)
{
CLASS *class;
HWND32 hwndDesktop;
DESKTOP *pDesktop;
TRACE(win,"Creating desktop window\n");
......@@ -399,7 +410,16 @@ BOOL32 WIN_CreateDesktopWindow(void)
if (!hwndDesktop) return FALSE;
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->pInitialize(pDesktop);
pWndDesktop->pDriver->pInitialize(pWndDesktop);
pWndDesktop->next = NULL;
......
......@@ -5,6 +5,8 @@
* 1995, 1996 Alex Korobka
*/
#include "x11drv.h"
#include <string.h>
#include "sysmetrics.h"
#include "heap.h"
......@@ -20,7 +22,8 @@
#include "dce.h"
#include "nonclient.h"
#include "debug.h"
#include "x11drv.h"
#include "local.h"
#include "ldt.h"
#define HAS_DLGFRAME(style,exStyle) \
(((exStyle) & WS_EX_DLGMODALFRAME) || \
......@@ -2120,7 +2123,7 @@ BOOL32 WINAPI SetWindowPos32( HWND32 hwnd, HWND32 hwndInsertAfter,
if( wnd->next == wndPtr ) flags |= SWP_NOZORDER;
}
}
else if (!((X11DRV_WND_DATA *) wndPtr->pDriverData)->window)
else if (!X11DRV_WND_GetXWindow(wndPtr))
{
/* FIXME: the following optimization is no good for "X-ed" windows */
if (hwndInsertAfter == HWND_TOP)
......@@ -2177,21 +2180,21 @@ BOOL32 WINAPI SetWindowPos32( HWND32 hwnd, HWND32 hwndInsertAfter,
if( wndPtr->parent == WIN_GetDesktop() )
hwndInsertAfter = WINPOS_ReorderOwnedPopups( hwndInsertAfter,
wndPtr, winpos.flags );
if (X11DRV_WND_GetXWindow(wndPtr))
if (((X11DRV_WND_DATA *) wndPtr->pDriverData)->window)
{
WIN_UnlinkWindow( winpos.hwnd );
WIN_LinkWindow( winpos.hwnd, hwndInsertAfter );
}
else WINPOS_MoveWindowZOrder( winpos.hwnd, hwndInsertAfter );
else
WINPOS_MoveWindowZOrder( winpos.hwnd, hwndInsertAfter );
}
if ( !((X11DRV_WND_DATA *) wndPtr->pDriverData)->window && !(winpos.flags & SWP_NOREDRAW) &&
if ( !X11DRV_WND_GetXWindow(wndPtr) && !(winpos.flags & SWP_NOREDRAW) &&
((winpos.flags & (SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED))
!= (SWP_NOMOVE | SWP_NOSIZE)) )
visRgn = DCE_GetVisRgn(hwnd, DCX_WINDOW | DCX_CLIPSIBLINGS);
/* Send WM_NCCALCSIZE message to get new client area */
if( (winpos.flags & (SWP_FRAMECHANGED | SWP_NOSIZE)) != SWP_NOSIZE )
{
......@@ -2234,7 +2237,7 @@ BOOL32 WINAPI SetWindowPos32( HWND32 hwnd, HWND32 hwndInsertAfter,
oldWindowRect = wndPtr->rectWindow;
if (((X11DRV_WND_DATA *) wndPtr->pDriverData)->window)
if (X11DRV_WND_GetXWindow(wndPtr))
{
RECT32 oldClientRect = wndPtr->rectClient;
......@@ -2337,7 +2340,7 @@ BOOL32 WINAPI SetWindowPos32( HWND32 hwnd, HWND32 hwndInsertAfter,
if (flags & SWP_SHOWWINDOW)
{
wndPtr->dwStyle |= WS_VISIBLE;
if (((X11DRV_WND_DATA *) wndPtr->pDriverData)->window)
if (X11DRV_WND_GetXWindow(wndPtr))
{
HWND32 focus, curr;
......@@ -2371,8 +2374,7 @@ BOOL32 WINAPI SetWindowPos32( HWND32 hwnd, HWND32 hwndInsertAfter,
else if (flags & SWP_HIDEWINDOW)
{
wndPtr->dwStyle &= ~WS_VISIBLE;
if (((X11DRV_WND_DATA *) wndPtr->pDriverData)->window)
if (X11DRV_WND_GetXWindow(wndPtr))
{
wndPtr->pDriver->pSetWindowPos(wndPtr, &winpos, uFlags & SMC_SETXPOS );
if( uFlags & SMC_SETXPOS )
......@@ -2402,7 +2404,7 @@ BOOL32 WINAPI SetWindowPos32( HWND32 hwnd, HWND32 hwndInsertAfter,
/* Repaint the window */
if (((X11DRV_WND_DATA *) wndPtr->pDriverData)->window)
if (X11DRV_WND_GetXWindow(wndPtr))
EVENT_Synchronize(); /* Wait for all expose events */
if (!GetCapture32())
......
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