Commit 646c562f authored by Alexandre Julliard's avatar Alexandre Julliard

Cleaned up some more USER dependencies.

parent 797f2217
......@@ -35,7 +35,6 @@
#include "debugtools.h"
#include "message.h"
#include "options.h"
#include "monitor.h"
#define RESTORE_SIGNALS
......@@ -550,8 +549,8 @@ static HRESULT WINAPI DGA_IDirectDraw2Impl_EnumDisplayModes(
}
}
ddsfd.dwWidth = MONITOR_GetWidth(&MONITOR_PrimaryMonitor);
ddsfd.dwHeight = MONITOR_GetHeight(&MONITOR_PrimaryMonitor);
ddsfd.dwWidth = GetSystemMetrics(SM_CXSCREEN);
ddsfd.dwHeight = GetSystemMetrics(SM_CYSCREEN);
TRACE(" enumerating (%ldx%ldx%d)\n",ddsfd.dwWidth,ddsfd.dwHeight,depths[i]);
if (!modescb(&ddsfd,context)) return DD_OK;
......
......@@ -19,7 +19,6 @@
#include "debugtools.h"
#include "message.h"
#include "options.h"
#include "monitor.h"
DEFAULT_DEBUG_CHANNEL(ddraw);
......@@ -89,8 +88,8 @@ void _DGA2_Initialize_FrameBuffer(IDirectDrawImpl *This, int mode) {
/* Get the screen dimensions as seen by Wine.
* In that case, it may be better to ignore the -desktop mode and return the
* real screen size => print a warning */
This->d->height = MONITOR_GetHeight(&MONITOR_PrimaryMonitor);
This->d->width = MONITOR_GetWidth(&MONITOR_PrimaryMonitor);
This->d->height = GetSystemMetrics(SM_CYSCREEN);
This->d->width = GetSystemMetrics(SM_CXSCREEN);
ddpriv->DGA.fb_addr = ddpriv->dev->data;
ddpriv->DGA.fb_memsize = (ddpriv->dev->mode.imageWidth *
ddpriv->dev->mode.imageHeight *
......
......@@ -24,7 +24,6 @@
#include "debugtools.h"
#include "message.h"
#include "options.h"
#include "monitor.h"
DEFAULT_DEBUG_CHANNEL(ddraw);
......@@ -352,8 +351,8 @@ HRESULT WINAPI IDirectDraw2Impl_EnumDisplayModes(
}
}
ddsfd.dwWidth = MONITOR_GetWidth(&MONITOR_PrimaryMonitor);
ddsfd.dwHeight = MONITOR_GetHeight(&MONITOR_PrimaryMonitor);
ddsfd.dwWidth = GetSystemMetrics(SM_CXSCREEN);
ddsfd.dwHeight = GetSystemMetrics(SM_CYSCREEN);
TRACE(" enumerating (%ldx%ldx%d)\n",ddsfd.dwWidth,ddsfd.dwHeight,depths[i]);
if (!modescb(&ddsfd,context)) return DD_OK;
......
......@@ -23,7 +23,6 @@
#include "debugtools.h"
#include "message.h"
#include "options.h"
#include "monitor.h"
DEFAULT_DEBUG_CHANNEL(ddraw);
......@@ -676,8 +675,8 @@ static HRESULT WINAPI Xlib_IDirectDraw2Impl_EnumDisplayModes(
ddsfd.dwFlags |= DDSD_REFRESHRATE;
ddsfd.u.dwRefreshRate = 60;
}
maxWidth = MONITOR_GetWidth(&MONITOR_PrimaryMonitor);
maxHeight = MONITOR_GetHeight(&MONITOR_PrimaryMonitor);
maxWidth = GetSystemMetrics(SM_CXSCREEN);
maxHeight = GetSystemMetrics(SM_CYSCREEN);
vi = TSXGetVisualInfo(display, VisualNoMask, &vt, &nvisuals);
pf = TSXListPixmapFormats(display, &npixmap);
......
......@@ -37,7 +37,6 @@
#include "spy.h"
#include "message.h"
#include "options.h"
#include "monitor.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
* return the real screen size => print a warning
*/
ddraw->d->height = MONITOR_GetHeight(&MONITOR_PrimaryMonitor);
ddraw->d->width = MONITOR_GetWidth(&MONITOR_PrimaryMonitor);
ddraw->d->height = GetSystemMetrics(SM_CYSCREEN);
ddraw->d->width = GetSystemMetrics(SM_CXSCREEN);
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");
dgpriv->fb_addr = addr;
......
......@@ -26,7 +26,6 @@
#include "spy.h"
#include "message.h"
#include "options.h"
#include "monitor.h"
#include "dga2_private.h"
......@@ -140,9 +139,9 @@ DGA2_Create( LPDIRECTDRAW *lplpDD ) {
#undef XX
DPRINTF("\n");
}
if ((MONITOR_GetHeight(&MONITOR_PrimaryMonitor) == modes[i].viewportHeight) &&
(MONITOR_GetWidth(&MONITOR_PrimaryMonitor) == modes[i].viewportWidth) &&
(MONITOR_GetDepth(&MONITOR_PrimaryMonitor) == modes[i].depth)
if ((GetSystemMetrics(SM_CYSCREEN) == modes[i].viewportHeight) &&
(GetSystemMetrics(SM_CXSCREEN) == modes[i].viewportWidth) &&
(X11DRV_GetDepth() == modes[i].depth)
) {
mode_to_use = modes[i].num;
}
......
......@@ -11,7 +11,6 @@
#include "d3d.h"
#include "message.h"
#include "options.h"
#include "monitor.h"
#include "debugtools.h"
#include "d3d_private.h"
......
......@@ -11,7 +11,6 @@
#include "d3d.h"
#include "message.h"
#include "options.h"
#include "monitor.h"
#include "debugtools.h"
#include "mesa_private.h"
......
......@@ -26,7 +26,6 @@
#include "spy.h"
#include "message.h"
#include "options.h"
#include "monitor.h"
DEFAULT_DEBUG_CHANNEL(ddraw);
......
......@@ -22,7 +22,6 @@
#include "d3d.h"
#include "debugtools.h"
#include "message.h"
#include "monitor.h"
/* This for all the enumeration and creation of D3D-related objects */
#include "ddraw_private.h"
......
......@@ -13,7 +13,6 @@
#include "winerror.h"
#include "options.h"
#include "monitor.h"
#include "debugtools.h"
#include "ddraw.h"
......@@ -80,8 +79,8 @@ static HRESULT X11_Create( LPDIRECTDRAW *lplpDD ) {
case 0: MESSAGE("Conversion needed from %d.\n",depth); break;
}
ddraw->d->height = MONITOR_GetHeight(&MONITOR_PrimaryMonitor);
ddraw->d->width = MONITOR_GetWidth(&MONITOR_PrimaryMonitor);
ddraw->d->height = GetSystemMetrics(SM_CYSCREEN);
ddraw->d->width = GetSystemMetrics(SM_CXSCREEN);
#ifdef HAVE_LIBXXSHM
/* Test if XShm is available. */
if ((x11priv->xshm_active = DDRAW_XSHM_Available())) {
......
......@@ -45,7 +45,6 @@
#include "user.h"
#include "message.h"
#include "mouse.h"
#include "sysmetrics.h"
#include "winbase.h"
#include "winerror.h"
#include "windef.h"
......
......@@ -14,11 +14,10 @@
#include "bitmap.h"
#include "debugtools.h"
#include "ldt.h"
#include "monitor.h"
#include "palette.h"
#include "windef.h"
DEFAULT_DEBUG_CHANNEL(wing)
DEFAULT_DEBUG_CHANNEL(wing);
typedef enum WING_DITHER_TYPE
......@@ -53,24 +52,26 @@ HDC16 WINAPI WinGCreateDC16(void)
*/
BOOL16 WINAPI WinGRecommendDIBFormat16(BITMAPINFO *bmpi)
{
HDC hdc;
TRACE("(%p)\n", bmpi);
if (!bmpi)
return FALSE;
hdc = CreateDCA( "DISPLAY", NULL, NULL, NULL );
bmpi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmpi->bmiHeader.biWidth = 320;
bmpi->bmiHeader.biHeight = -1;
bmpi->bmiHeader.biPlanes = 1;
bmpi->bmiHeader.biBitCount = MONITOR_GetDepth(&MONITOR_PrimaryMonitor);
bmpi->bmiHeader.biPlanes = GetDeviceCaps( hdc, PLANES );
bmpi->bmiHeader.biBitCount = GetDeviceCaps( hdc, BITSPIXEL );
bmpi->bmiHeader.biCompression = BI_RGB;
bmpi->bmiHeader.biSizeImage = 0;
bmpi->bmiHeader.biXPelsPerMeter = 0;
bmpi->bmiHeader.biYPelsPerMeter = 0;
bmpi->bmiHeader.biClrUsed = 0;
bmpi->bmiHeader.biClrImportant = 0;
DeleteDC(hdc);
return TRUE;
}
}
/***********************************************************************
* WinGCreateBitmap16 (WING.1003)
......@@ -82,7 +83,7 @@ HBITMAP16 WINAPI WinGCreateBitmap16(HDC16 hdc, BITMAPINFO *bmpi,
TRACE(": create %ldx%ldx%d bitmap\n", bmpi->bmiHeader.biWidth,
bmpi->bmiHeader.biHeight, bmpi->bmiHeader.biPlanes);
return CreateDIBSection16(hdc, bmpi, 0, bits, 0, 0);
}
}
/***********************************************************************
* WinGGetDIBPointer (WING.1004)
......@@ -129,8 +130,11 @@ UINT16 WINAPI WinGGetDIBColorTable16(HDC16 hdc, UINT16 start, UINT16 num,
*/
HPALETTE16 WINAPI WinGCreateHalfTonePalette16(void)
{
HDC hdc = CreateCompatibleDC(0);
HPALETTE16 ret = CreateHalftonePalette16(hdc);
TRACE("(void)\n");
return CreateHalftonePalette16(GetDC16(0));
DeleteDC(hdc);
return ret;
}
/***********************************************************************
......
......@@ -5,7 +5,6 @@
#include "heap.h"
#include "dlgs.h"
#include "win.h"
#include "sysmetrics.h"
#include "debugtools.h"
#include "winreg.h"
#include "authors.h"
......@@ -22,7 +21,7 @@
#include "shell32_main.h"
#include "shellapi.h"
DEFAULT_DEBUG_CHANNEL(shell)
DEFAULT_DEBUG_CHANNEL(shell);
#define IDD_TREEVIEW 99
......
......@@ -15,7 +15,6 @@
#include "heap.h"
#include "dlgs.h"
#include "ldt.h"
#include "sysmetrics.h"
#include "debugtools.h"
#include "winreg.h"
#include "authors.h"
......
......@@ -11,7 +11,6 @@
#include "clipboard.h"
#include "gdi.h"
#include "message.h"
#include "monitor.h"
#include "user.h"
#include "win.h"
#include "debugtools.h"
......@@ -53,6 +52,8 @@ static USER_DRIVER user_driver =
int cell_width = 8;
int cell_height = 8;
int screen_rows = 50; /* default value */
int screen_cols = 80; /* default value */
WINDOW *root_window;
......@@ -61,8 +62,6 @@ WINDOW *root_window;
*/
static void process_attach(void)
{
int rows, cols;
USER_Driver = &user_driver;
CLIPBOARD_Driver = &TTYDRV_CLIPBOARD_Driver;
WND_Driver = &TTYDRV_WND_Driver;
......@@ -73,18 +72,9 @@ static void process_attach(void)
werase(root_window);
wrefresh(root_window);
}
getmaxyx(root_window, rows, cols);
#else /* WINE_CURSES */
rows = 60; /* FIXME: Hardcoded */
cols = 80; /* FIXME: Hardcoded */
getmaxyx(root_window, screen_rows, screen_cols);
#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();
/* load display.dll */
......
......@@ -23,7 +23,6 @@
#include "clipboard.h"
#include "debugtools.h"
#include "gdi.h"
#include "monitor.h"
#include "options.h"
#include "user.h"
#include "win.h"
......@@ -69,7 +68,9 @@ static XKeyboardState keyboard_state;
Display *display;
Screen *screen;
Visual *visual;
int screen_depth;
unsigned int screen_width;
unsigned int screen_height;
unsigned int screen_depth;
Window root_window;
/***********************************************************************
......@@ -176,8 +177,8 @@ static void create_desktop( const char *geometry )
#endif /* HAVE_OPENGL */
flags = TSXParseGeometry( geometry, &x, &y, &width, &height );
MONITOR_PrimaryMonitor.rect.right = width;
MONITOR_PrimaryMonitor.rect.bottom = height;
screen_width = width;
screen_height = height;
/* Create window */
win_attr.background_pixel = BlackPixel(display, 0);
......@@ -292,11 +293,8 @@ static void process_attach(void)
if (Options.synchronous) XSetErrorHandler( error_handler );
MONITOR_PrimaryMonitor.rect.left = 0;
MONITOR_PrimaryMonitor.rect.top = 0;
MONITOR_PrimaryMonitor.rect.right = WidthOfScreen( screen );
MONITOR_PrimaryMonitor.rect.bottom = HeightOfScreen( screen );
MONITOR_PrimaryMonitor.depth = screen_depth;
screen_width = WidthOfScreen( screen );
screen_height = HeightOfScreen( screen );
if (Options.desktopGeometry)
{
......
......@@ -10,7 +10,6 @@
#include "dc.h"
#include "bitmap.h"
#include "heap.h"
#include "monitor.h"
#include "cache.h"
#include "region.h"
#include "path.h"
......
......@@ -9,12 +9,11 @@
#include "gdi.h"
#include "bitmap.h"
#include "dc.h"
#include "monitor.h"
#include "ttydrv.h"
#include "winbase.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 );
} else {
physDev->window = TTYDRV_GetRootWindow();
physDev->cellWidth = TTYDRV_GetCellWidth();
physDev->cellHeight = TTYDRV_GetCellHeight();
dc->w.bitsPerPixel = MONITOR_GetDepth(&MONITOR_PrimaryMonitor);
physDev->cellWidth = cell_width;
physDev->cellHeight = cell_height;
dc->w.bitsPerPixel = 1;
dc->w.totalExtent.left = 0;
dc->w.totalExtent.top = 0;
dc->w.totalExtent.right = MONITOR_GetWidth(&MONITOR_PrimaryMonitor);
dc->w.totalExtent.bottom = MONITOR_GetHeight(&MONITOR_PrimaryMonitor);
dc->w.totalExtent.right = cell_width * screen_cols;
dc->w.totalExtent.bottom = cell_height * screen_rows;
dc->w.hVisRgn = CreateRectRgnIndirect( &dc->w.totalExtent );
}
......
......@@ -15,11 +15,10 @@
#include "debugtools.h"
#include "ldt.h"
#include "local.h"
#include "monitor.h"
#include "winnt.h"
#include "x11drv.h"
DEFAULT_DEBUG_CHANNEL(x11drv)
DEFAULT_DEBUG_CHANNEL(x11drv);
static BOOL X11DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
LPCSTR output, const DEVMODEA* initData );
......@@ -189,12 +188,12 @@ BOOL X11DRV_GDI_Initialize(void)
WidthOfScreen(X11DRV_GetXScreen()), WidthMMOfScreen(X11DRV_GetXScreen()) );
#endif
X11DRV_DevCaps.version = 0x300;
X11DRV_DevCaps.horzSize = WidthMMOfScreen(X11DRV_GetXScreen()) * MONITOR_GetWidth(&MONITOR_PrimaryMonitor) / WidthOfScreen(X11DRV_GetXScreen());
X11DRV_DevCaps.vertSize = HeightMMOfScreen(X11DRV_GetXScreen()) * MONITOR_GetHeight(&MONITOR_PrimaryMonitor) / HeightOfScreen(X11DRV_GetXScreen());
X11DRV_DevCaps.horzRes = MONITOR_GetWidth(&MONITOR_PrimaryMonitor);
X11DRV_DevCaps.vertRes = MONITOR_GetHeight(&MONITOR_PrimaryMonitor);
X11DRV_DevCaps.bitsPixel = X11DRV_GetDepth();
X11DRV_DevCaps.version = 0x300;
X11DRV_DevCaps.horzSize = WidthMMOfScreen(screen) * screen_width / WidthOfScreen(screen);
X11DRV_DevCaps.vertSize = HeightMMOfScreen(screen) * screen_height / HeightOfScreen(screen);
X11DRV_DevCaps.horzRes = screen_width;
X11DRV_DevCaps.vertRes = screen_height;
X11DRV_DevCaps.bitsPixel = screen_depth;
/* 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->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.top = 0;
dc->w.totalExtent.right = MONITOR_GetWidth(&MONITOR_PrimaryMonitor);
dc->w.totalExtent.bottom = MONITOR_GetHeight(&MONITOR_PrimaryMonitor);
dc->w.totalExtent.right = screen_width;
dc->w.totalExtent.bottom = screen_height;
dc->w.hVisRgn = CreateRectRgnIndirect( &dc->w.totalExtent );
}
......
/*
* 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 */
......@@ -10,4 +10,8 @@
extern void SYSMETRICS_Init(void); /* sysmetrics.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 */
......@@ -123,9 +123,8 @@ extern BOOL TTYDRV_PALETTE_IsDark(int pixel);
extern int cell_width;
extern int cell_height;
static inline int TTYDRV_GetCellWidth(void) { return cell_width; }
static inline int TTYDRV_GetCellHeight(void) { return cell_height; }
extern int screen_rows;
extern int screen_cols;
extern WINDOW *root_window;
static inline WINDOW *TTYDRV_GetRootWindow(void) { return root_window; }
......
......@@ -323,12 +323,14 @@ extern Display *display;
extern Screen *screen;
extern Visual *visual;
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 Visual *X11DRV_GetVisual(void) { return visual; }
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 void X11DRV_SetScreenSaveActive(BOOL bActivate);
......
......@@ -28,7 +28,6 @@
#include "version.h"
#include "winnls.h"
#include "console.h"
#include "monitor.h"
#include "gdi.h"
#include "user.h"
#include "windef.h"
......
......@@ -4,7 +4,6 @@
* Copyright 1998 Turchanov Sergey
*/
#include "monitor.h"
#include "windef.h"
#include "wingdi.h"
#include "winbase.h"
......@@ -14,8 +13,6 @@
#define xPRIMARY_MONITOR ((HMONITOR)0x12340042)
MONITOR MONITOR_PrimaryMonitor;
/***********************************************************************
* MonitorFromPoint
*/
......@@ -80,7 +77,9 @@ BOOL WINAPI GetMonitorInfoA(HMONITOR hMonitor, LPMONITORINFO lpMonitorInfo)
(lpMonitorInfo->cbSize >= sizeof(MONITORINFO)) &&
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->dwFlags = MONITORINFOF_PRIMARY;
......@@ -105,7 +104,9 @@ BOOL WINAPI GetMonitorInfoW(HMONITOR hMonitor, LPMONITORINFO lpMonitorInfo)
(lpMonitorInfo->cbSize >= sizeof(MONITORINFO)) &&
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->dwFlags = MONITORINFOF_PRIMARY;
......@@ -127,7 +128,9 @@ BOOL WINAPI EnumDisplayMonitors(
MONITORENUMPROC lpfnEnumProc,
LPARAM dwData)
{
RECT rcLimit = MONITOR_PrimaryMonitor.rect;
RECT rcLimit;
SetRect( &rcLimit, 0, 0, GetSystemMetrics(SM_CXSCREEN),
GetSystemMetrics(SM_CYSCREEN) );
if (!lpfnEnumProc)
return FALSE;
......
......@@ -6,18 +6,18 @@
*/
#include <stdio.h>
#include <assert.h>
#include "windef.h"
#include "wingdi.h"
#include "wine/winuser16.h"
#include "winbase.h"
#include "winuser.h"
#include "monitor.h"
#include "options.h"
#include "sysmetrics.h"
#include "tweak.h"
static short sysMetrics[SM_CMETRICS+1];
static int sysMetrics[SM_WINE_CMETRICS+1];
/***********************************************************************
* SYSMETRICS_Init
......@@ -38,10 +38,14 @@ static short sysMetrics[SM_CMETRICS+1];
*/
void SYSMETRICS_Init(void)
{
HDC hdc = CreateDCA( "DISPLAY", NULL, NULL, NULL );
assert(hdc);
sysMetrics[SM_CXCURSOR] = 32;
sysMetrics[SM_CYCURSOR] = 32;
sysMetrics[SM_CXSCREEN] = MONITOR_GetWidth(&MONITOR_PrimaryMonitor);
sysMetrics[SM_CYSCREEN] = MONITOR_GetHeight(&MONITOR_PrimaryMonitor);
sysMetrics[SM_CXSCREEN] = GetDeviceCaps( hdc, HORZRES );
sysMetrics[SM_CYSCREEN] = GetDeviceCaps( hdc, VERTRES );
sysMetrics[SM_WINE_BPP] = GetDeviceCaps( hdc, BITSPIXEL );
if (TWEAK_WineLook > WIN31_LOOK)
sysMetrics[SM_CXVSCROLL] =
PROFILE_GetWineIniInt("Tweak.Layout", "ScrollBarWidth", 16);
......@@ -168,6 +172,8 @@ void SYSMETRICS_Init(void)
sysMetrics[SM_CMONITORS] = 1;
sysMetrics[SM_SAMEDISPLAYFORMAT] = 1;
sysMetrics[SM_CMETRICS] = SM_CMETRICS;
DeleteDC( hdc );
}
......@@ -185,6 +191,6 @@ INT16 WINAPI GetSystemMetrics16( INT16 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];
}
......@@ -5,7 +5,6 @@
*/
#include "clipboard.h"
#include "monitor.h"
#include "user.h"
#include "win.h"
#include "ttydrv.h"
......
......@@ -24,19 +24,19 @@
#include "toolhelp.h"
#include "message.h"
#include "module.h"
#include "monitor.h"
#include "miscemu.h"
#include "shell.h"
#include "sysmetrics.h"
#include "callback.h"
#include "local.h"
#include "process.h"
#include "debugtools.h"
DECLARE_DEBUG_CHANNEL(hook)
DECLARE_DEBUG_CHANNEL(local)
DECLARE_DEBUG_CHANNEL(system)
DECLARE_DEBUG_CHANNEL(win)
DECLARE_DEBUG_CHANNEL(win32)
DECLARE_DEBUG_CHANNEL(hook);
DECLARE_DEBUG_CHANNEL(local);
DECLARE_DEBUG_CHANNEL(system);
DECLARE_DEBUG_CHANNEL(win);
DECLARE_DEBUG_CHANNEL(win32);
/***********************************************************************
* GetFreeSystemResources (USER.284)
......@@ -333,9 +333,9 @@ LONG WINAPI ChangeDisplaySettingsA( LPDEVMODEA devmode, DWORD flags )
MESSAGE("\tflags=");_dump_CDS_flags(flags);MESSAGE("\n");
if (devmode==NULL)
FIXME_(system)(" devmode=NULL (return to default mode)\n");
else if ( (devmode->dmBitsPerPel != MONITOR_GetDepth(&MONITOR_PrimaryMonitor))
|| (devmode->dmPelsHeight != MONITOR_GetHeight(&MONITOR_PrimaryMonitor))
|| (devmode->dmPelsWidth != MONITOR_GetWidth(&MONITOR_PrimaryMonitor)) )
else if ( (devmode->dmBitsPerPel != GetSystemMetrics(SM_WINE_BPP))
|| (devmode->dmPelsHeight != GetSystemMetrics(SM_CYSCREEN))
|| (devmode->dmPelsWidth != GetSystemMetrics(SM_CXSCREEN)) )
{
......@@ -363,9 +363,9 @@ LONG WINAPI ChangeDisplaySettingsExA(
MESSAGE("\tflags=");_dump_CDS_flags(flags);MESSAGE("\n");
if (devmode==NULL)
FIXME_(system)(" devmode=NULL (return to default mode)\n");
else if ( (devmode->dmBitsPerPel != MONITOR_GetDepth(&MONITOR_PrimaryMonitor))
|| (devmode->dmPelsHeight != MONITOR_GetHeight(&MONITOR_PrimaryMonitor))
|| (devmode->dmPelsWidth != MONITOR_GetWidth(&MONITOR_PrimaryMonitor)) )
else if ( (devmode->dmBitsPerPel != GetSystemMetrics(SM_WINE_BPP))
|| (devmode->dmPelsHeight != GetSystemMetrics(SM_CYSCREEN))
|| (devmode->dmPelsWidth != GetSystemMetrics(SM_CXSCREEN)) )
{
......@@ -404,9 +404,9 @@ BOOL WINAPI EnumDisplaySettingsA(
TRACE_(system)("(%s,%ld,%p)\n",name,n,devmode);
if (n==0) {
devmode->dmBitsPerPel = MONITOR_GetDepth(&MONITOR_PrimaryMonitor);
devmode->dmPelsHeight = MONITOR_GetHeight(&MONITOR_PrimaryMonitor);
devmode->dmPelsWidth = MONITOR_GetWidth(&MONITOR_PrimaryMonitor);
devmode->dmBitsPerPel = GetSystemMetrics(SM_WINE_BPP);
devmode->dmPelsHeight = GetSystemMetrics(SM_CYSCREEN);
devmode->dmPelsWidth = GetSystemMetrics(SM_CXSCREEN);
return TRUE;
}
if ((n-1)<NRMODES*NRDEPTHS) {
......
......@@ -20,7 +20,6 @@
#include "hook.h"
#include "menu.h"
#include "message.h"
#include "monitor.h"
#include "nonclient.h"
#include "queue.h"
#include "winpos.h"
......
......@@ -5,7 +5,6 @@
*/
#include "clipboard.h"
#include "monitor.h"
#include "user.h"
#include "win.h"
#include "x11drv.h"
......
......@@ -11,7 +11,6 @@
#include "callback.h"
#include "debugtools.h"
#include "mouse.h"
#include "monitor.h"
#include "win.h"
#include "windef.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,
DWORD keyState, DWORD time, HWND hWnd )
{
int width = MONITOR_GetWidth (&MONITOR_PrimaryMonitor);
int height = MONITOR_GetHeight(&MONITOR_PrimaryMonitor);
int width = GetSystemMetrics( SM_CXSCREEN );
int height = GetSystemMetrics( SM_CYSCREEN );
int iWndsLocks;
WINE_MOUSEEVENT wme;
......
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