mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-14 17:06:19 +00:00
03468f7d4b
Sun Feb 15 12:02:59 1998 Alexandre Julliard <julliard@lrc.epfl.ch> * [graphics/x11drv/*.c] [objects/*.c] A few X11 critical section optimizations, mostly with XGet/PutPixel. * [scheduler/sysdeps.c] [misc/main.c] Make sure X11 critical section is available before any Xlib call. * [if1632/relay.c] [tools/build.c] Yet another attempt at fixing Catch/Throw. * [loader/pe_image.c] Fixed broken PE DLL loading. * [include/winnt.h] [scheduler/handle.c] [scheduler/*.c] Implemented handle access rights. Added Get/SetHandleInformation. Sun Feb 15 09:45:23 1997 Andreas Mohr <100.30936@germany.net> * [misc/winsock.c] Fixed bug in WSACleanup which lead to crashes in WINSOCK_HandleIO. * [graphics/fontengine.c] [include/font.h] Minor improvements. * [memory/global.c] Implemented GlobalEntryHandle. * [misc/toolhelp.c] Fixed a memory bug in Notify*register. * [misc/w32scomb.c] Improved Get16DLLAddress. * [objects/gdiobj.c] Implemented GdiSeeGdiDo. Sat Feb 14 14:57:39 1998 John Richardson <jrichard@zko.dec.com> * [win32/console.c] Added the console implementation, AllocConsole, FreeConsole, CONSOLE_InheritConsole. * [documentation/console] Some documentation on the console. * [include/winerror.h] Added some error defines. * [scheduler/k32obj.c] Registered the scheduler ops. Fri Feb 13 19:35:35 1998 James Moody <013263m@dragon.acadiau.ca> * [ole/ole2nls.c] Some English language fixes for missing values. * [controls/listbox.c] Fix to allow an empty listbox to deselect all items. * [relay32/user32.spec] [windows/keyboard.c] CreateAcceleratorTableA stub method. * [windows/sysmetrics.c] Added missing SM_CXCURSOR & SM_CYCURSOR initializers. * [windows/message.c] PostThreadMessage32A stub method. Fri Feb 13 17:12:24 1998 Jim Peterson <jspeter@roanoke.infi.net> * [libtest/hello3res.rc] [libtest/hello3.c] [libtest/Makefile.in] Updated the 'hello3' test so that it functions properly again. Fri Feb 13 14:08:07 1998 Martin Boehme <boehme@informatik.mu-luebeck.de> * [graphics/mapping.c] Fixed the embarrassing bugs I introduced into DPtoLP and LPtoDP. * [windows/scroll.c] Prevent ScrollWindow32 from sending WM_ERASEBKGND. Thu Feb 12 22:46:53 1998 Huw D M Davies <h.davies1@physics.oxford.ac.uk> * [objects/metafile] [include/ldt.h] Fix to cope with records longer than 64K. * [windows/clipboard.c] Clean up bitmaps and metapicts properly. Mon Feb 3 21:52:18 1998 Karl Backström <karl_b@geocities.com> * [programs/winhelp/Sw.rc] [resources/sysres_Sw.rc] Minor update of Swedish language support.
156 lines
5.3 KiB
C
156 lines
5.3 KiB
C
/*
|
|
* System metrics functions
|
|
*
|
|
* Copyright 1994 Alexandre Julliard
|
|
*
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
#include "gdi.h"
|
|
#include "options.h"
|
|
#include "tweak.h"
|
|
#include "sysmetrics.h"
|
|
|
|
short sysMetrics[SM_CMETRICS+1];
|
|
|
|
/***********************************************************************
|
|
* SYSMETRICS_Init
|
|
*
|
|
* Initialisation of the system metrics array.
|
|
*/
|
|
void SYSMETRICS_Init(void)
|
|
{
|
|
sysMetrics[SM_CXCURSOR] = 32;
|
|
sysMetrics[SM_CYCURSOR] = 32;
|
|
sysMetrics[SM_CXSCREEN] = screenWidth;
|
|
sysMetrics[SM_CYSCREEN] = screenHeight;
|
|
sysMetrics[SM_CXVSCROLL] =
|
|
PROFILE_GetWineIniInt("Tweak.Layout", "ScrollBarWidth", 16) + 1;
|
|
sysMetrics[SM_CYHSCROLL] = sysMetrics[SM_CXVSCROLL];
|
|
sysMetrics[SM_CYCAPTION] = 2 +
|
|
PROFILE_GetWineIniInt("Tweak.Layout", "CaptionHeight", 18);
|
|
sysMetrics[SM_CXBORDER] = 1;
|
|
sysMetrics[SM_CYBORDER] = sysMetrics[SM_CXBORDER];
|
|
sysMetrics[SM_CXDLGFRAME] =
|
|
PROFILE_GetWineIniInt("Tweak.Layout", "DialogFrameWidth",
|
|
TWEAK_Win95Look ? 2 : 4);
|
|
sysMetrics[SM_CYDLGFRAME] = sysMetrics[SM_CXDLGFRAME];
|
|
sysMetrics[SM_CYVTHUMB] = sysMetrics[SM_CXVSCROLL] - 1;
|
|
sysMetrics[SM_CXHTHUMB] = sysMetrics[SM_CYVTHUMB];
|
|
sysMetrics[SM_CXICON] = 32;
|
|
sysMetrics[SM_CYICON] = 32;
|
|
sysMetrics[SM_CYMENU] =
|
|
PROFILE_GetWineIniInt("Tweak.Layout", "MenuHeight", 18);
|
|
sysMetrics[SM_CXFULLSCREEN] = sysMetrics[SM_CXSCREEN];
|
|
sysMetrics[SM_CYFULLSCREEN] =
|
|
sysMetrics[SM_CYSCREEN] - sysMetrics[SM_CYCAPTION];
|
|
sysMetrics[SM_CYKANJIWINDOW] = 0;
|
|
sysMetrics[SM_MOUSEPRESENT] = 1;
|
|
sysMetrics[SM_CYVSCROLL] = sysMetrics[SM_CYVTHUMB];
|
|
sysMetrics[SM_CXHSCROLL] = sysMetrics[SM_CXHTHUMB];
|
|
sysMetrics[SM_DEBUG] = 0;
|
|
|
|
/* FIXME: The following should look for the registry key to see if the
|
|
buttons should be swapped. */
|
|
sysMetrics[SM_SWAPBUTTON] = 0;
|
|
|
|
sysMetrics[SM_RESERVED1] = 0;
|
|
sysMetrics[SM_RESERVED2] = 0;
|
|
sysMetrics[SM_RESERVED3] = 0;
|
|
sysMetrics[SM_RESERVED4] = 0;
|
|
|
|
/* FIXME: The following two are calculated, but how? */
|
|
sysMetrics[SM_CXMIN] = TWEAK_Win95Look ? 112 : 100;
|
|
sysMetrics[SM_CYMIN] = TWEAK_Win95Look ? 27 : 28;
|
|
|
|
sysMetrics[SM_CXSIZE] = sysMetrics[SM_CYCAPTION] - 2;
|
|
sysMetrics[SM_CYSIZE] = sysMetrics[SM_CXSIZE];
|
|
sysMetrics[SM_CXFRAME] = GetProfileInt32A("Windows", "BorderWidth", 4);
|
|
sysMetrics[SM_CYFRAME] = sysMetrics[SM_CXFRAME];
|
|
sysMetrics[SM_CXMINTRACK] = sysMetrics[SM_CXMIN];
|
|
sysMetrics[SM_CYMINTRACK] = sysMetrics[SM_CYMIN];
|
|
sysMetrics[SM_CXDOUBLECLK] =
|
|
(GetProfileInt32A("Windows", "DoubleClickWidth", 4) + 1) & ~1;
|
|
sysMetrics[SM_CYDOUBLECLK] =
|
|
(GetProfileInt32A("Windows","DoubleClickHeight", 4) + 1) & ~1;
|
|
sysMetrics[SM_CXICONSPACING] =
|
|
GetProfileInt32A("Desktop","IconSpacing", 75);
|
|
sysMetrics[SM_CYICONSPACING] =
|
|
GetProfileInt32A("Desktop", "IconVerticalSpacing", 75);
|
|
sysMetrics[SM_MENUDROPALIGNMENT] =
|
|
GetProfileInt32A("Windows", "MenuDropAlignment", 0);
|
|
sysMetrics[SM_PENWINDOWS] = 0;
|
|
sysMetrics[SM_DBCSENABLED] = 0;
|
|
|
|
/* FIXME: Need to query X for the following */
|
|
sysMetrics[SM_CMOUSEBUTTONS] = 3;
|
|
|
|
sysMetrics[SM_SECURE] = 0;
|
|
sysMetrics[SM_CXEDGE] = sysMetrics[SM_CXBORDER] + 1;
|
|
sysMetrics[SM_CYEDGE] = sysMetrics[SM_CXEDGE];
|
|
sysMetrics[SM_CXMINSPACING] = 160;
|
|
sysMetrics[SM_CYMINSPACING] = 24;
|
|
sysMetrics[SM_CXSMICON] =
|
|
sysMetrics[SM_CYSIZE] - (sysMetrics[SM_CYSIZE] % 2) - 2;
|
|
sysMetrics[SM_CYSMICON] = sysMetrics[SM_CXSMICON];
|
|
sysMetrics[SM_CYSMCAPTION] = 16;
|
|
sysMetrics[SM_CXSMSIZE] = 15;
|
|
sysMetrics[SM_CYSMSIZE] = sysMetrics[SM_CXSMSIZE];
|
|
sysMetrics[SM_CXMENUSIZE] = sysMetrics[SM_CYMENU];
|
|
sysMetrics[SM_CYMENUSIZE] = sysMetrics[SM_CXMENUSIZE];
|
|
|
|
/* FIXME: What do these mean? */
|
|
sysMetrics[SM_ARRANGE] = 8;
|
|
sysMetrics[SM_CXMINIMIZED] = 160;
|
|
sysMetrics[SM_CYMINIMIZED] = 24;
|
|
|
|
/* FIXME: How do I calculate these? */
|
|
sysMetrics[SM_CXMAXTRACK] =
|
|
sysMetrics[SM_CXSCREEN] + 4 + 2 * sysMetrics[SM_CXFRAME];
|
|
sysMetrics[SM_CYMAXTRACK] =
|
|
sysMetrics[SM_CYSCREEN] + 4 + 2 * sysMetrics[SM_CYFRAME];
|
|
sysMetrics[SM_CXMAXIMIZED] =
|
|
sysMetrics[SM_CXSCREEN] + 2 * sysMetrics[SM_CXFRAME];
|
|
sysMetrics[SM_CYMAXIMIZED] =
|
|
sysMetrics[SM_CYSCREEN] - 45;
|
|
sysMetrics[SM_NETWORK] = 3;
|
|
|
|
/* For the following: 0 = ok, 1 = failsafe, 2 = failsafe + network */
|
|
sysMetrics[SM_CLEANBOOT] = 0;
|
|
|
|
sysMetrics[SM_CXDRAG] = 0;
|
|
sysMetrics[SM_CYDRAG] = 0;
|
|
sysMetrics[SM_SHOWSOUNDS] = 0;
|
|
sysMetrics[SM_CXMENUCHECK] = 2;
|
|
sysMetrics[SM_CYMENUCHECK] = 2;
|
|
|
|
/* FIXME: Should check the type of processor for the following */
|
|
sysMetrics[SM_SLOWMACHINE] = 0;
|
|
|
|
/* FIXME: Should perform a check */
|
|
sysMetrics[SM_MIDEASTENABLED] = 0;
|
|
|
|
sysMetrics[SM_MOUSEWHEELPRESENT] = 0;
|
|
sysMetrics[SM_CMETRICS] = SM_CMETRICS;
|
|
}
|
|
|
|
|
|
/***********************************************************************
|
|
* GetSystemMetrics16 (USER.179)
|
|
*/
|
|
INT16 WINAPI GetSystemMetrics16( INT16 index )
|
|
{
|
|
if ((index < 0) || (index > SM_CMETRICS)) return 0;
|
|
else return sysMetrics[index];
|
|
}
|
|
|
|
|
|
/***********************************************************************
|
|
* GetSystemMetrics32 (USER32.291)
|
|
*/
|
|
INT32 WINAPI GetSystemMetrics32( INT32 index )
|
|
{
|
|
if ((index < 0) || (index > SM_CMETRICS)) return 0;
|
|
else return sysMetrics[index];
|
|
}
|