Cleaned up some more USER dependencies.

This commit is contained in:
Alexandre Julliard 2000-07-31 23:32:47 +00:00
parent 797f2217f3
commit 646c562f9c
32 changed files with 101 additions and 152 deletions

View file

@ -35,7 +35,6 @@
#include "debugtools.h" #include "debugtools.h"
#include "message.h" #include "message.h"
#include "options.h" #include "options.h"
#include "monitor.h"
#define RESTORE_SIGNALS #define RESTORE_SIGNALS
@ -550,8 +549,8 @@ static HRESULT WINAPI DGA_IDirectDraw2Impl_EnumDisplayModes(
} }
} }
ddsfd.dwWidth = MONITOR_GetWidth(&MONITOR_PrimaryMonitor); ddsfd.dwWidth = GetSystemMetrics(SM_CXSCREEN);
ddsfd.dwHeight = MONITOR_GetHeight(&MONITOR_PrimaryMonitor); ddsfd.dwHeight = GetSystemMetrics(SM_CYSCREEN);
TRACE(" enumerating (%ldx%ldx%d)\n",ddsfd.dwWidth,ddsfd.dwHeight,depths[i]); TRACE(" enumerating (%ldx%ldx%d)\n",ddsfd.dwWidth,ddsfd.dwHeight,depths[i]);
if (!modescb(&ddsfd,context)) return DD_OK; if (!modescb(&ddsfd,context)) return DD_OK;

View file

@ -19,7 +19,6 @@
#include "debugtools.h" #include "debugtools.h"
#include "message.h" #include "message.h"
#include "options.h" #include "options.h"
#include "monitor.h"
DEFAULT_DEBUG_CHANNEL(ddraw); DEFAULT_DEBUG_CHANNEL(ddraw);
@ -89,8 +88,8 @@ void _DGA2_Initialize_FrameBuffer(IDirectDrawImpl *This, int mode) {
/* Get the screen dimensions as seen by Wine. /* Get the screen dimensions as seen by Wine.
* In that case, it may be better to ignore the -desktop mode and return the * In that case, it may be better to ignore the -desktop mode and return the
* real screen size => print a warning */ * real screen size => print a warning */
This->d->height = MONITOR_GetHeight(&MONITOR_PrimaryMonitor); This->d->height = GetSystemMetrics(SM_CYSCREEN);
This->d->width = MONITOR_GetWidth(&MONITOR_PrimaryMonitor); This->d->width = GetSystemMetrics(SM_CXSCREEN);
ddpriv->DGA.fb_addr = ddpriv->dev->data; ddpriv->DGA.fb_addr = ddpriv->dev->data;
ddpriv->DGA.fb_memsize = (ddpriv->dev->mode.imageWidth * ddpriv->DGA.fb_memsize = (ddpriv->dev->mode.imageWidth *
ddpriv->dev->mode.imageHeight * ddpriv->dev->mode.imageHeight *

View file

@ -24,7 +24,6 @@
#include "debugtools.h" #include "debugtools.h"
#include "message.h" #include "message.h"
#include "options.h" #include "options.h"
#include "monitor.h"
DEFAULT_DEBUG_CHANNEL(ddraw); DEFAULT_DEBUG_CHANNEL(ddraw);
@ -352,8 +351,8 @@ HRESULT WINAPI IDirectDraw2Impl_EnumDisplayModes(
} }
} }
ddsfd.dwWidth = MONITOR_GetWidth(&MONITOR_PrimaryMonitor); ddsfd.dwWidth = GetSystemMetrics(SM_CXSCREEN);
ddsfd.dwHeight = MONITOR_GetHeight(&MONITOR_PrimaryMonitor); ddsfd.dwHeight = GetSystemMetrics(SM_CYSCREEN);
TRACE(" enumerating (%ldx%ldx%d)\n",ddsfd.dwWidth,ddsfd.dwHeight,depths[i]); TRACE(" enumerating (%ldx%ldx%d)\n",ddsfd.dwWidth,ddsfd.dwHeight,depths[i]);
if (!modescb(&ddsfd,context)) return DD_OK; if (!modescb(&ddsfd,context)) return DD_OK;

View file

@ -23,7 +23,6 @@
#include "debugtools.h" #include "debugtools.h"
#include "message.h" #include "message.h"
#include "options.h" #include "options.h"
#include "monitor.h"
DEFAULT_DEBUG_CHANNEL(ddraw); DEFAULT_DEBUG_CHANNEL(ddraw);
@ -676,8 +675,8 @@ static HRESULT WINAPI Xlib_IDirectDraw2Impl_EnumDisplayModes(
ddsfd.dwFlags |= DDSD_REFRESHRATE; ddsfd.dwFlags |= DDSD_REFRESHRATE;
ddsfd.u.dwRefreshRate = 60; ddsfd.u.dwRefreshRate = 60;
} }
maxWidth = MONITOR_GetWidth(&MONITOR_PrimaryMonitor); maxWidth = GetSystemMetrics(SM_CXSCREEN);
maxHeight = MONITOR_GetHeight(&MONITOR_PrimaryMonitor); maxHeight = GetSystemMetrics(SM_CYSCREEN);
vi = TSXGetVisualInfo(display, VisualNoMask, &vt, &nvisuals); vi = TSXGetVisualInfo(display, VisualNoMask, &vt, &nvisuals);
pf = TSXListPixmapFormats(display, &npixmap); pf = TSXListPixmapFormats(display, &npixmap);

View file

@ -37,7 +37,6 @@
#include "spy.h" #include "spy.h"
#include "message.h" #include "message.h"
#include "options.h" #include "options.h"
#include "monitor.h"
#include "dga_private.h" #include "dga_private.h"
@ -147,8 +146,8 @@ DGA_Create( LPDIRECTDRAW *lplpDD ) {
* In that case, it may be better to ignore the -desktop mode and * In that case, it may be better to ignore the -desktop mode and
* return the real screen size => print a warning * return the real screen size => print a warning
*/ */
ddraw->d->height = MONITOR_GetHeight(&MONITOR_PrimaryMonitor); ddraw->d->height = GetSystemMetrics(SM_CYSCREEN);
ddraw->d->width = MONITOR_GetWidth(&MONITOR_PrimaryMonitor); ddraw->d->width = GetSystemMetrics(SM_CXSCREEN);
if ((ddraw->d->height != height) || (ddraw->d->width != width)) if ((ddraw->d->height != height) || (ddraw->d->width != width))
WARN("You seem to be running in -desktop mode. This may prove dangerous in DGA mode...\n"); WARN("You seem to be running in -desktop mode. This may prove dangerous in DGA mode...\n");
dgpriv->fb_addr = addr; dgpriv->fb_addr = addr;

View file

@ -26,7 +26,6 @@
#include "spy.h" #include "spy.h"
#include "message.h" #include "message.h"
#include "options.h" #include "options.h"
#include "monitor.h"
#include "dga2_private.h" #include "dga2_private.h"
@ -140,9 +139,9 @@ DGA2_Create( LPDIRECTDRAW *lplpDD ) {
#undef XX #undef XX
DPRINTF("\n"); DPRINTF("\n");
} }
if ((MONITOR_GetHeight(&MONITOR_PrimaryMonitor) == modes[i].viewportHeight) && if ((GetSystemMetrics(SM_CYSCREEN) == modes[i].viewportHeight) &&
(MONITOR_GetWidth(&MONITOR_PrimaryMonitor) == modes[i].viewportWidth) && (GetSystemMetrics(SM_CXSCREEN) == modes[i].viewportWidth) &&
(MONITOR_GetDepth(&MONITOR_PrimaryMonitor) == modes[i].depth) (X11DRV_GetDepth() == modes[i].depth)
) { ) {
mode_to_use = modes[i].num; mode_to_use = modes[i].num;
} }

View file

@ -11,7 +11,6 @@
#include "d3d.h" #include "d3d.h"
#include "message.h" #include "message.h"
#include "options.h" #include "options.h"
#include "monitor.h"
#include "debugtools.h" #include "debugtools.h"
#include "d3d_private.h" #include "d3d_private.h"

View file

@ -11,7 +11,6 @@
#include "d3d.h" #include "d3d.h"
#include "message.h" #include "message.h"
#include "options.h" #include "options.h"
#include "monitor.h"
#include "debugtools.h" #include "debugtools.h"
#include "mesa_private.h" #include "mesa_private.h"

View file

@ -26,7 +26,6 @@
#include "spy.h" #include "spy.h"
#include "message.h" #include "message.h"
#include "options.h" #include "options.h"
#include "monitor.h"
DEFAULT_DEBUG_CHANNEL(ddraw); DEFAULT_DEBUG_CHANNEL(ddraw);

View file

@ -22,7 +22,6 @@
#include "d3d.h" #include "d3d.h"
#include "debugtools.h" #include "debugtools.h"
#include "message.h" #include "message.h"
#include "monitor.h"
/* This for all the enumeration and creation of D3D-related objects */ /* This for all the enumeration and creation of D3D-related objects */
#include "ddraw_private.h" #include "ddraw_private.h"

View file

@ -13,7 +13,6 @@
#include "winerror.h" #include "winerror.h"
#include "options.h" #include "options.h"
#include "monitor.h"
#include "debugtools.h" #include "debugtools.h"
#include "ddraw.h" #include "ddraw.h"
@ -80,8 +79,8 @@ static HRESULT X11_Create( LPDIRECTDRAW *lplpDD ) {
case 0: MESSAGE("Conversion needed from %d.\n",depth); break; case 0: MESSAGE("Conversion needed from %d.\n",depth); break;
} }
ddraw->d->height = MONITOR_GetHeight(&MONITOR_PrimaryMonitor); ddraw->d->height = GetSystemMetrics(SM_CYSCREEN);
ddraw->d->width = MONITOR_GetWidth(&MONITOR_PrimaryMonitor); ddraw->d->width = GetSystemMetrics(SM_CXSCREEN);
#ifdef HAVE_LIBXXSHM #ifdef HAVE_LIBXXSHM
/* Test if XShm is available. */ /* Test if XShm is available. */
if ((x11priv->xshm_active = DDRAW_XSHM_Available())) { if ((x11priv->xshm_active = DDRAW_XSHM_Available())) {

View file

@ -45,7 +45,6 @@
#include "user.h" #include "user.h"
#include "message.h" #include "message.h"
#include "mouse.h" #include "mouse.h"
#include "sysmetrics.h"
#include "winbase.h" #include "winbase.h"
#include "winerror.h" #include "winerror.h"
#include "windef.h" #include "windef.h"

View file

@ -14,11 +14,10 @@
#include "bitmap.h" #include "bitmap.h"
#include "debugtools.h" #include "debugtools.h"
#include "ldt.h" #include "ldt.h"
#include "monitor.h"
#include "palette.h" #include "palette.h"
#include "windef.h" #include "windef.h"
DEFAULT_DEBUG_CHANNEL(wing) DEFAULT_DEBUG_CHANNEL(wing);
typedef enum WING_DITHER_TYPE typedef enum WING_DITHER_TYPE
@ -53,24 +52,26 @@ HDC16 WINAPI WinGCreateDC16(void)
*/ */
BOOL16 WINAPI WinGRecommendDIBFormat16(BITMAPINFO *bmpi) BOOL16 WINAPI WinGRecommendDIBFormat16(BITMAPINFO *bmpi)
{ {
HDC hdc;
TRACE("(%p)\n", bmpi); TRACE("(%p)\n", bmpi);
if (!bmpi) if (!bmpi)
return FALSE; return FALSE;
hdc = CreateDCA( "DISPLAY", NULL, NULL, NULL );
bmpi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bmpi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmpi->bmiHeader.biWidth = 320; bmpi->bmiHeader.biWidth = 320;
bmpi->bmiHeader.biHeight = -1; bmpi->bmiHeader.biHeight = -1;
bmpi->bmiHeader.biPlanes = 1; bmpi->bmiHeader.biPlanes = GetDeviceCaps( hdc, PLANES );
bmpi->bmiHeader.biBitCount = MONITOR_GetDepth(&MONITOR_PrimaryMonitor); bmpi->bmiHeader.biBitCount = GetDeviceCaps( hdc, BITSPIXEL );
bmpi->bmiHeader.biCompression = BI_RGB; bmpi->bmiHeader.biCompression = BI_RGB;
bmpi->bmiHeader.biSizeImage = 0; bmpi->bmiHeader.biSizeImage = 0;
bmpi->bmiHeader.biXPelsPerMeter = 0; bmpi->bmiHeader.biXPelsPerMeter = 0;
bmpi->bmiHeader.biYPelsPerMeter = 0; bmpi->bmiHeader.biYPelsPerMeter = 0;
bmpi->bmiHeader.biClrUsed = 0; bmpi->bmiHeader.biClrUsed = 0;
bmpi->bmiHeader.biClrImportant = 0; bmpi->bmiHeader.biClrImportant = 0;
DeleteDC(hdc);
return TRUE; return TRUE;
} }
/*********************************************************************** /***********************************************************************
* WinGCreateBitmap16 (WING.1003) * WinGCreateBitmap16 (WING.1003)
@ -82,7 +83,7 @@ HBITMAP16 WINAPI WinGCreateBitmap16(HDC16 hdc, BITMAPINFO *bmpi,
TRACE(": create %ldx%ldx%d bitmap\n", bmpi->bmiHeader.biWidth, TRACE(": create %ldx%ldx%d bitmap\n", bmpi->bmiHeader.biWidth,
bmpi->bmiHeader.biHeight, bmpi->bmiHeader.biPlanes); bmpi->bmiHeader.biHeight, bmpi->bmiHeader.biPlanes);
return CreateDIBSection16(hdc, bmpi, 0, bits, 0, 0); return CreateDIBSection16(hdc, bmpi, 0, bits, 0, 0);
} }
/*********************************************************************** /***********************************************************************
* WinGGetDIBPointer (WING.1004) * WinGGetDIBPointer (WING.1004)
@ -129,8 +130,11 @@ UINT16 WINAPI WinGGetDIBColorTable16(HDC16 hdc, UINT16 start, UINT16 num,
*/ */
HPALETTE16 WINAPI WinGCreateHalfTonePalette16(void) HPALETTE16 WINAPI WinGCreateHalfTonePalette16(void)
{ {
HDC hdc = CreateCompatibleDC(0);
HPALETTE16 ret = CreateHalftonePalette16(hdc);
TRACE("(void)\n"); TRACE("(void)\n");
return CreateHalftonePalette16(GetDC16(0)); DeleteDC(hdc);
return ret;
} }
/*********************************************************************** /***********************************************************************

View file

@ -5,7 +5,6 @@
#include "heap.h" #include "heap.h"
#include "dlgs.h" #include "dlgs.h"
#include "win.h" #include "win.h"
#include "sysmetrics.h"
#include "debugtools.h" #include "debugtools.h"
#include "winreg.h" #include "winreg.h"
#include "authors.h" #include "authors.h"
@ -22,7 +21,7 @@
#include "shell32_main.h" #include "shell32_main.h"
#include "shellapi.h" #include "shellapi.h"
DEFAULT_DEBUG_CHANNEL(shell) DEFAULT_DEBUG_CHANNEL(shell);
#define IDD_TREEVIEW 99 #define IDD_TREEVIEW 99

View file

@ -15,7 +15,6 @@
#include "heap.h" #include "heap.h"
#include "dlgs.h" #include "dlgs.h"
#include "ldt.h" #include "ldt.h"
#include "sysmetrics.h"
#include "debugtools.h" #include "debugtools.h"
#include "winreg.h" #include "winreg.h"
#include "authors.h" #include "authors.h"

View file

@ -11,7 +11,6 @@
#include "clipboard.h" #include "clipboard.h"
#include "gdi.h" #include "gdi.h"
#include "message.h" #include "message.h"
#include "monitor.h"
#include "user.h" #include "user.h"
#include "win.h" #include "win.h"
#include "debugtools.h" #include "debugtools.h"
@ -53,6 +52,8 @@ static USER_DRIVER user_driver =
int cell_width = 8; int cell_width = 8;
int cell_height = 8; int cell_height = 8;
int screen_rows = 50; /* default value */
int screen_cols = 80; /* default value */
WINDOW *root_window; WINDOW *root_window;
@ -61,8 +62,6 @@ WINDOW *root_window;
*/ */
static void process_attach(void) static void process_attach(void)
{ {
int rows, cols;
USER_Driver = &user_driver; USER_Driver = &user_driver;
CLIPBOARD_Driver = &TTYDRV_CLIPBOARD_Driver; CLIPBOARD_Driver = &TTYDRV_CLIPBOARD_Driver;
WND_Driver = &TTYDRV_WND_Driver; WND_Driver = &TTYDRV_WND_Driver;
@ -73,18 +72,9 @@ static void process_attach(void)
werase(root_window); werase(root_window);
wrefresh(root_window); wrefresh(root_window);
} }
getmaxyx(root_window, rows, cols); getmaxyx(root_window, screen_rows, screen_cols);
#else /* WINE_CURSES */
rows = 60; /* FIXME: Hardcoded */
cols = 80; /* FIXME: Hardcoded */
#endif /* WINE_CURSES */ #endif /* WINE_CURSES */
MONITOR_PrimaryMonitor.rect.left = 0;
MONITOR_PrimaryMonitor.rect.top = 0;
MONITOR_PrimaryMonitor.rect.right = cell_width * cols;
MONITOR_PrimaryMonitor.rect.bottom = cell_height * rows;
MONITOR_PrimaryMonitor.depth = 1;
TTYDRV_GDI_Initialize(); TTYDRV_GDI_Initialize();
/* load display.dll */ /* load display.dll */

View file

@ -23,7 +23,6 @@
#include "clipboard.h" #include "clipboard.h"
#include "debugtools.h" #include "debugtools.h"
#include "gdi.h" #include "gdi.h"
#include "monitor.h"
#include "options.h" #include "options.h"
#include "user.h" #include "user.h"
#include "win.h" #include "win.h"
@ -69,7 +68,9 @@ static XKeyboardState keyboard_state;
Display *display; Display *display;
Screen *screen; Screen *screen;
Visual *visual; Visual *visual;
int screen_depth; unsigned int screen_width;
unsigned int screen_height;
unsigned int screen_depth;
Window root_window; Window root_window;
/*********************************************************************** /***********************************************************************
@ -176,8 +177,8 @@ static void create_desktop( const char *geometry )
#endif /* HAVE_OPENGL */ #endif /* HAVE_OPENGL */
flags = TSXParseGeometry( geometry, &x, &y, &width, &height ); flags = TSXParseGeometry( geometry, &x, &y, &width, &height );
MONITOR_PrimaryMonitor.rect.right = width; screen_width = width;
MONITOR_PrimaryMonitor.rect.bottom = height; screen_height = height;
/* Create window */ /* Create window */
win_attr.background_pixel = BlackPixel(display, 0); win_attr.background_pixel = BlackPixel(display, 0);
@ -292,11 +293,8 @@ static void process_attach(void)
if (Options.synchronous) XSetErrorHandler( error_handler ); if (Options.synchronous) XSetErrorHandler( error_handler );
MONITOR_PrimaryMonitor.rect.left = 0; screen_width = WidthOfScreen( screen );
MONITOR_PrimaryMonitor.rect.top = 0; screen_height = HeightOfScreen( screen );
MONITOR_PrimaryMonitor.rect.right = WidthOfScreen( screen );
MONITOR_PrimaryMonitor.rect.bottom = HeightOfScreen( screen );
MONITOR_PrimaryMonitor.depth = screen_depth;
if (Options.desktopGeometry) if (Options.desktopGeometry)
{ {

View file

@ -10,7 +10,6 @@
#include "dc.h" #include "dc.h"
#include "bitmap.h" #include "bitmap.h"
#include "heap.h" #include "heap.h"
#include "monitor.h"
#include "cache.h" #include "cache.h"
#include "region.h" #include "region.h"
#include "path.h" #include "path.h"

View file

@ -9,12 +9,11 @@
#include "gdi.h" #include "gdi.h"
#include "bitmap.h" #include "bitmap.h"
#include "dc.h" #include "dc.h"
#include "monitor.h"
#include "ttydrv.h" #include "ttydrv.h"
#include "winbase.h" #include "winbase.h"
#include "debugtools.h" #include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(ttydrv) DEFAULT_DEBUG_CHANNEL(ttydrv);
/**********************************************************************/ /**********************************************************************/
@ -62,15 +61,14 @@ BOOL TTYDRV_DC_CreateDC(DC *dc, LPCSTR driver, LPCSTR device,
GDI_HEAP_UNLOCK( dc->w.hBitmap ); GDI_HEAP_UNLOCK( dc->w.hBitmap );
} else { } else {
physDev->window = TTYDRV_GetRootWindow(); physDev->window = TTYDRV_GetRootWindow();
physDev->cellWidth = TTYDRV_GetCellWidth(); physDev->cellWidth = cell_width;
physDev->cellHeight = TTYDRV_GetCellHeight(); physDev->cellHeight = cell_height;
dc->w.bitsPerPixel = MONITOR_GetDepth(&MONITOR_PrimaryMonitor);
dc->w.bitsPerPixel = 1;
dc->w.totalExtent.left = 0; dc->w.totalExtent.left = 0;
dc->w.totalExtent.top = 0; dc->w.totalExtent.top = 0;
dc->w.totalExtent.right = MONITOR_GetWidth(&MONITOR_PrimaryMonitor); dc->w.totalExtent.right = cell_width * screen_cols;
dc->w.totalExtent.bottom = MONITOR_GetHeight(&MONITOR_PrimaryMonitor); dc->w.totalExtent.bottom = cell_height * screen_rows;
dc->w.hVisRgn = CreateRectRgnIndirect( &dc->w.totalExtent ); dc->w.hVisRgn = CreateRectRgnIndirect( &dc->w.totalExtent );
} }

View file

@ -15,11 +15,10 @@
#include "debugtools.h" #include "debugtools.h"
#include "ldt.h" #include "ldt.h"
#include "local.h" #include "local.h"
#include "monitor.h"
#include "winnt.h" #include "winnt.h"
#include "x11drv.h" #include "x11drv.h"
DEFAULT_DEBUG_CHANNEL(x11drv) DEFAULT_DEBUG_CHANNEL(x11drv);
static BOOL X11DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device, static BOOL X11DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
LPCSTR output, const DEVMODEA* initData ); LPCSTR output, const DEVMODEA* initData );
@ -189,12 +188,12 @@ BOOL X11DRV_GDI_Initialize(void)
WidthOfScreen(X11DRV_GetXScreen()), WidthMMOfScreen(X11DRV_GetXScreen()) ); WidthOfScreen(X11DRV_GetXScreen()), WidthMMOfScreen(X11DRV_GetXScreen()) );
#endif #endif
X11DRV_DevCaps.version = 0x300; X11DRV_DevCaps.version = 0x300;
X11DRV_DevCaps.horzSize = WidthMMOfScreen(X11DRV_GetXScreen()) * MONITOR_GetWidth(&MONITOR_PrimaryMonitor) / WidthOfScreen(X11DRV_GetXScreen()); X11DRV_DevCaps.horzSize = WidthMMOfScreen(screen) * screen_width / WidthOfScreen(screen);
X11DRV_DevCaps.vertSize = HeightMMOfScreen(X11DRV_GetXScreen()) * MONITOR_GetHeight(&MONITOR_PrimaryMonitor) / HeightOfScreen(X11DRV_GetXScreen()); X11DRV_DevCaps.vertSize = HeightMMOfScreen(screen) * screen_height / HeightOfScreen(screen);
X11DRV_DevCaps.horzRes = MONITOR_GetWidth(&MONITOR_PrimaryMonitor); X11DRV_DevCaps.horzRes = screen_width;
X11DRV_DevCaps.vertRes = MONITOR_GetHeight(&MONITOR_PrimaryMonitor); X11DRV_DevCaps.vertRes = screen_height;
X11DRV_DevCaps.bitsPixel = X11DRV_GetDepth(); X11DRV_DevCaps.bitsPixel = screen_depth;
/* Resolution will be adjusted during the font init */ /* Resolution will be adjusted during the font init */
@ -261,12 +260,12 @@ static BOOL X11DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
{ {
physDev->drawable = X11DRV_GetXRootWindow(); physDev->drawable = X11DRV_GetXRootWindow();
physDev->gc = TSXCreateGC( display, physDev->drawable, 0, NULL ); physDev->gc = TSXCreateGC( display, physDev->drawable, 0, NULL );
dc->w.bitsPerPixel = X11DRV_GetDepth(); dc->w.bitsPerPixel = screen_depth;
dc->w.totalExtent.left = 0; dc->w.totalExtent.left = 0;
dc->w.totalExtent.top = 0; dc->w.totalExtent.top = 0;
dc->w.totalExtent.right = MONITOR_GetWidth(&MONITOR_PrimaryMonitor); dc->w.totalExtent.right = screen_width;
dc->w.totalExtent.bottom = MONITOR_GetHeight(&MONITOR_PrimaryMonitor); dc->w.totalExtent.bottom = screen_height;
dc->w.hVisRgn = CreateRectRgnIndirect( &dc->w.totalExtent ); dc->w.hVisRgn = CreateRectRgnIndirect( &dc->w.totalExtent );
} }

View file

@ -1,34 +0,0 @@
/*
* Monitor definitions
*
*/
#ifndef __WINE_MONITOR_H
#define __WINE_MONITOR_H
#include "windef.h"
typedef struct tagMONITOR
{
RECT rect;
int depth;
} MONITOR;
extern MONITOR MONITOR_PrimaryMonitor;
static int inline MONITOR_GetWidth(MONITOR *pMonitor)
{
return pMonitor->rect.right - pMonitor->rect.left;
}
static int inline MONITOR_GetHeight(MONITOR *pMonitor)
{
return pMonitor->rect.bottom - pMonitor->rect.top;
}
static int inline MONITOR_GetDepth(MONITOR *pMonitor)
{
return pMonitor->depth;
}
#endif /* __WINE_MONITOR_H */

View file

@ -10,4 +10,8 @@
extern void SYSMETRICS_Init(void); /* sysmetrics.c */ extern void SYSMETRICS_Init(void); /* sysmetrics.c */
extern void SYSCOLOR_Init(void); /* syscolor.c */ extern void SYSCOLOR_Init(void); /* syscolor.c */
/* Wine extensions */
#define SM_WINE_BPP (SM_CMETRICS+1) /* screen bpp */
#define SM_WINE_CMETRICS SM_WINE_BPP
#endif /* __WINE_SYSMETRICS_H */ #endif /* __WINE_SYSMETRICS_H */

View file

@ -123,9 +123,8 @@ extern BOOL TTYDRV_PALETTE_IsDark(int pixel);
extern int cell_width; extern int cell_width;
extern int cell_height; extern int cell_height;
static inline int TTYDRV_GetCellWidth(void) { return cell_width; } extern int screen_rows;
static inline int TTYDRV_GetCellHeight(void) { return cell_height; } extern int screen_cols;
extern WINDOW *root_window; extern WINDOW *root_window;
static inline WINDOW *TTYDRV_GetRootWindow(void) { return root_window; } static inline WINDOW *TTYDRV_GetRootWindow(void) { return root_window; }

View file

@ -323,12 +323,14 @@ extern Display *display;
extern Screen *screen; extern Screen *screen;
extern Visual *visual; extern Visual *visual;
extern Window root_window; extern Window root_window;
extern int screen_depth; extern unsigned int screen_width;
extern unsigned int screen_height;
extern unsigned int screen_depth;
static inline Screen *X11DRV_GetXScreen(void) { return screen; } static inline Screen *X11DRV_GetXScreen(void) { return screen; }
static inline Visual *X11DRV_GetVisual(void) { return visual; } static inline Visual *X11DRV_GetVisual(void) { return visual; }
static inline Window X11DRV_GetXRootWindow(void) { return root_window; } static inline Window X11DRV_GetXRootWindow(void) { return root_window; }
static inline int X11DRV_GetDepth(void) { return screen_depth; } static inline unsigned int X11DRV_GetDepth(void) { return screen_depth; }
extern BOOL X11DRV_GetScreenSaveActive(void); extern BOOL X11DRV_GetScreenSaveActive(void);
extern void X11DRV_SetScreenSaveActive(BOOL bActivate); extern void X11DRV_SetScreenSaveActive(BOOL bActivate);

View file

@ -28,7 +28,6 @@
#include "version.h" #include "version.h"
#include "winnls.h" #include "winnls.h"
#include "console.h" #include "console.h"
#include "monitor.h"
#include "gdi.h" #include "gdi.h"
#include "user.h" #include "user.h"
#include "windef.h" #include "windef.h"

View file

@ -4,7 +4,6 @@
* Copyright 1998 Turchanov Sergey * Copyright 1998 Turchanov Sergey
*/ */
#include "monitor.h"
#include "windef.h" #include "windef.h"
#include "wingdi.h" #include "wingdi.h"
#include "winbase.h" #include "winbase.h"
@ -14,8 +13,6 @@
#define xPRIMARY_MONITOR ((HMONITOR)0x12340042) #define xPRIMARY_MONITOR ((HMONITOR)0x12340042)
MONITOR MONITOR_PrimaryMonitor;
/*********************************************************************** /***********************************************************************
* MonitorFromPoint * MonitorFromPoint
*/ */
@ -80,7 +77,9 @@ BOOL WINAPI GetMonitorInfoA(HMONITOR hMonitor, LPMONITORINFO lpMonitorInfo)
(lpMonitorInfo->cbSize >= sizeof(MONITORINFO)) && (lpMonitorInfo->cbSize >= sizeof(MONITORINFO)) &&
SystemParametersInfoA(SPI_GETWORKAREA, 0, &rcWork, 0)) SystemParametersInfoA(SPI_GETWORKAREA, 0, &rcWork, 0))
{ {
lpMonitorInfo->rcMonitor = MONITOR_PrimaryMonitor.rect; SetRect( &lpMonitorInfo->rcMonitor, 0, 0,
GetSystemMetrics(SM_CXSCREEN),
GetSystemMetrics(SM_CYSCREEN) );
lpMonitorInfo->rcWork = rcWork; lpMonitorInfo->rcWork = rcWork;
lpMonitorInfo->dwFlags = MONITORINFOF_PRIMARY; lpMonitorInfo->dwFlags = MONITORINFOF_PRIMARY;
@ -105,7 +104,9 @@ BOOL WINAPI GetMonitorInfoW(HMONITOR hMonitor, LPMONITORINFO lpMonitorInfo)
(lpMonitorInfo->cbSize >= sizeof(MONITORINFO)) && (lpMonitorInfo->cbSize >= sizeof(MONITORINFO)) &&
SystemParametersInfoW(SPI_GETWORKAREA, 0, &rcWork, 0)) SystemParametersInfoW(SPI_GETWORKAREA, 0, &rcWork, 0))
{ {
lpMonitorInfo->rcMonitor = MONITOR_PrimaryMonitor.rect; SetRect( &lpMonitorInfo->rcMonitor, 0, 0,
GetSystemMetrics(SM_CXSCREEN),
GetSystemMetrics(SM_CYSCREEN) );
lpMonitorInfo->rcWork = rcWork; lpMonitorInfo->rcWork = rcWork;
lpMonitorInfo->dwFlags = MONITORINFOF_PRIMARY; lpMonitorInfo->dwFlags = MONITORINFOF_PRIMARY;
@ -127,7 +128,9 @@ BOOL WINAPI EnumDisplayMonitors(
MONITORENUMPROC lpfnEnumProc, MONITORENUMPROC lpfnEnumProc,
LPARAM dwData) LPARAM dwData)
{ {
RECT rcLimit = MONITOR_PrimaryMonitor.rect; RECT rcLimit;
SetRect( &rcLimit, 0, 0, GetSystemMetrics(SM_CXSCREEN),
GetSystemMetrics(SM_CYSCREEN) );
if (!lpfnEnumProc) if (!lpfnEnumProc)
return FALSE; return FALSE;

View file

@ -6,18 +6,18 @@
*/ */
#include <stdio.h> #include <stdio.h>
#include <assert.h>
#include "windef.h" #include "windef.h"
#include "wingdi.h" #include "wingdi.h"
#include "wine/winuser16.h" #include "wine/winuser16.h"
#include "winbase.h" #include "winbase.h"
#include "winuser.h" #include "winuser.h"
#include "monitor.h"
#include "options.h" #include "options.h"
#include "sysmetrics.h" #include "sysmetrics.h"
#include "tweak.h" #include "tweak.h"
static short sysMetrics[SM_CMETRICS+1]; static int sysMetrics[SM_WINE_CMETRICS+1];
/*********************************************************************** /***********************************************************************
* SYSMETRICS_Init * SYSMETRICS_Init
@ -38,10 +38,14 @@ static short sysMetrics[SM_CMETRICS+1];
*/ */
void SYSMETRICS_Init(void) void SYSMETRICS_Init(void)
{ {
HDC hdc = CreateDCA( "DISPLAY", NULL, NULL, NULL );
assert(hdc);
sysMetrics[SM_CXCURSOR] = 32; sysMetrics[SM_CXCURSOR] = 32;
sysMetrics[SM_CYCURSOR] = 32; sysMetrics[SM_CYCURSOR] = 32;
sysMetrics[SM_CXSCREEN] = MONITOR_GetWidth(&MONITOR_PrimaryMonitor); sysMetrics[SM_CXSCREEN] = GetDeviceCaps( hdc, HORZRES );
sysMetrics[SM_CYSCREEN] = MONITOR_GetHeight(&MONITOR_PrimaryMonitor); sysMetrics[SM_CYSCREEN] = GetDeviceCaps( hdc, VERTRES );
sysMetrics[SM_WINE_BPP] = GetDeviceCaps( hdc, BITSPIXEL );
if (TWEAK_WineLook > WIN31_LOOK) if (TWEAK_WineLook > WIN31_LOOK)
sysMetrics[SM_CXVSCROLL] = sysMetrics[SM_CXVSCROLL] =
PROFILE_GetWineIniInt("Tweak.Layout", "ScrollBarWidth", 16); PROFILE_GetWineIniInt("Tweak.Layout", "ScrollBarWidth", 16);
@ -168,6 +172,8 @@ void SYSMETRICS_Init(void)
sysMetrics[SM_CMONITORS] = 1; sysMetrics[SM_CMONITORS] = 1;
sysMetrics[SM_SAMEDISPLAYFORMAT] = 1; sysMetrics[SM_SAMEDISPLAYFORMAT] = 1;
sysMetrics[SM_CMETRICS] = SM_CMETRICS; sysMetrics[SM_CMETRICS] = SM_CMETRICS;
DeleteDC( hdc );
} }
@ -185,6 +191,6 @@ INT16 WINAPI GetSystemMetrics16( INT16 index )
*/ */
INT WINAPI GetSystemMetrics( INT index ) INT WINAPI GetSystemMetrics( INT index )
{ {
if ((index < 0) || (index > SM_CMETRICS)) return 0; if ((index < 0) || (index > SM_WINE_CMETRICS)) return 0;
else return sysMetrics[index]; else return sysMetrics[index];
} }

View file

@ -5,7 +5,6 @@
*/ */
#include "clipboard.h" #include "clipboard.h"
#include "monitor.h"
#include "user.h" #include "user.h"
#include "win.h" #include "win.h"
#include "ttydrv.h" #include "ttydrv.h"

View file

@ -24,19 +24,19 @@
#include "toolhelp.h" #include "toolhelp.h"
#include "message.h" #include "message.h"
#include "module.h" #include "module.h"
#include "monitor.h"
#include "miscemu.h" #include "miscemu.h"
#include "shell.h" #include "shell.h"
#include "sysmetrics.h"
#include "callback.h" #include "callback.h"
#include "local.h" #include "local.h"
#include "process.h" #include "process.h"
#include "debugtools.h" #include "debugtools.h"
DECLARE_DEBUG_CHANNEL(hook) DECLARE_DEBUG_CHANNEL(hook);
DECLARE_DEBUG_CHANNEL(local) DECLARE_DEBUG_CHANNEL(local);
DECLARE_DEBUG_CHANNEL(system) DECLARE_DEBUG_CHANNEL(system);
DECLARE_DEBUG_CHANNEL(win) DECLARE_DEBUG_CHANNEL(win);
DECLARE_DEBUG_CHANNEL(win32) DECLARE_DEBUG_CHANNEL(win32);
/*********************************************************************** /***********************************************************************
* GetFreeSystemResources (USER.284) * GetFreeSystemResources (USER.284)
@ -333,9 +333,9 @@ LONG WINAPI ChangeDisplaySettingsA( LPDEVMODEA devmode, DWORD flags )
MESSAGE("\tflags=");_dump_CDS_flags(flags);MESSAGE("\n"); MESSAGE("\tflags=");_dump_CDS_flags(flags);MESSAGE("\n");
if (devmode==NULL) if (devmode==NULL)
FIXME_(system)(" devmode=NULL (return to default mode)\n"); FIXME_(system)(" devmode=NULL (return to default mode)\n");
else if ( (devmode->dmBitsPerPel != MONITOR_GetDepth(&MONITOR_PrimaryMonitor)) else if ( (devmode->dmBitsPerPel != GetSystemMetrics(SM_WINE_BPP))
|| (devmode->dmPelsHeight != MONITOR_GetHeight(&MONITOR_PrimaryMonitor)) || (devmode->dmPelsHeight != GetSystemMetrics(SM_CYSCREEN))
|| (devmode->dmPelsWidth != MONITOR_GetWidth(&MONITOR_PrimaryMonitor)) ) || (devmode->dmPelsWidth != GetSystemMetrics(SM_CXSCREEN)) )
{ {
@ -363,9 +363,9 @@ LONG WINAPI ChangeDisplaySettingsExA(
MESSAGE("\tflags=");_dump_CDS_flags(flags);MESSAGE("\n"); MESSAGE("\tflags=");_dump_CDS_flags(flags);MESSAGE("\n");
if (devmode==NULL) if (devmode==NULL)
FIXME_(system)(" devmode=NULL (return to default mode)\n"); FIXME_(system)(" devmode=NULL (return to default mode)\n");
else if ( (devmode->dmBitsPerPel != MONITOR_GetDepth(&MONITOR_PrimaryMonitor)) else if ( (devmode->dmBitsPerPel != GetSystemMetrics(SM_WINE_BPP))
|| (devmode->dmPelsHeight != MONITOR_GetHeight(&MONITOR_PrimaryMonitor)) || (devmode->dmPelsHeight != GetSystemMetrics(SM_CYSCREEN))
|| (devmode->dmPelsWidth != MONITOR_GetWidth(&MONITOR_PrimaryMonitor)) ) || (devmode->dmPelsWidth != GetSystemMetrics(SM_CXSCREEN)) )
{ {
@ -404,9 +404,9 @@ BOOL WINAPI EnumDisplaySettingsA(
TRACE_(system)("(%s,%ld,%p)\n",name,n,devmode); TRACE_(system)("(%s,%ld,%p)\n",name,n,devmode);
if (n==0) { if (n==0) {
devmode->dmBitsPerPel = MONITOR_GetDepth(&MONITOR_PrimaryMonitor); devmode->dmBitsPerPel = GetSystemMetrics(SM_WINE_BPP);
devmode->dmPelsHeight = MONITOR_GetHeight(&MONITOR_PrimaryMonitor); devmode->dmPelsHeight = GetSystemMetrics(SM_CYSCREEN);
devmode->dmPelsWidth = MONITOR_GetWidth(&MONITOR_PrimaryMonitor); devmode->dmPelsWidth = GetSystemMetrics(SM_CXSCREEN);
return TRUE; return TRUE;
} }
if ((n-1)<NRMODES*NRDEPTHS) { if ((n-1)<NRMODES*NRDEPTHS) {

View file

@ -20,7 +20,6 @@
#include "hook.h" #include "hook.h"
#include "menu.h" #include "menu.h"
#include "message.h" #include "message.h"
#include "monitor.h"
#include "nonclient.h" #include "nonclient.h"
#include "queue.h" #include "queue.h"
#include "winpos.h" #include "winpos.h"

View file

@ -5,7 +5,6 @@
*/ */
#include "clipboard.h" #include "clipboard.h"
#include "monitor.h"
#include "user.h" #include "user.h"
#include "win.h" #include "win.h"
#include "x11drv.h" #include "x11drv.h"

View file

@ -11,7 +11,6 @@
#include "callback.h" #include "callback.h"
#include "debugtools.h" #include "debugtools.h"
#include "mouse.h" #include "mouse.h"
#include "monitor.h"
#include "win.h" #include "win.h"
#include "windef.h" #include "windef.h"
#include "x11drv.h" #include "x11drv.h"
@ -274,8 +273,8 @@ void X11DRV_MOUSE_Init( LPMOUSE_EVENT_PROC proc )
void X11DRV_MOUSE_SendEvent( DWORD mouseStatus, DWORD posX, DWORD posY, void X11DRV_MOUSE_SendEvent( DWORD mouseStatus, DWORD posX, DWORD posY,
DWORD keyState, DWORD time, HWND hWnd ) DWORD keyState, DWORD time, HWND hWnd )
{ {
int width = MONITOR_GetWidth (&MONITOR_PrimaryMonitor); int width = GetSystemMetrics( SM_CXSCREEN );
int height = MONITOR_GetHeight(&MONITOR_PrimaryMonitor); int height = GetSystemMetrics( SM_CYSCREEN );
int iWndsLocks; int iWndsLocks;
WINE_MOUSEEVENT wme; WINE_MOUSEEVENT wme;