Release 980329
[wine.git] / windows / sysmetrics.c
blob9a9cff639fd94ab9a640734a7d78d39b5b8a1c4f
1 /*
2 * System metrics functions
4 * Copyright 1994 Alexandre Julliard
6 */
8 #include <stdio.h>
9 #include "gdi.h"
10 #include "options.h"
11 #include "tweak.h"
12 #include "sysmetrics.h"
14 short sysMetrics[SM_CMETRICS+1];
16 /***********************************************************************
17 * SYSMETRICS_Init
19 * Initialisation of the system metrics array.
21 void SYSMETRICS_Init(void)
23 sysMetrics[SM_CXCURSOR] = 32;
24 sysMetrics[SM_CYCURSOR] = 32;
25 sysMetrics[SM_CXSCREEN] = screenWidth;
26 sysMetrics[SM_CYSCREEN] = screenHeight;
27 sysMetrics[SM_CXVSCROLL] =
28 PROFILE_GetWineIniInt("Tweak.Layout", "ScrollBarWidth", 16) + 1;
29 sysMetrics[SM_CYHSCROLL] = sysMetrics[SM_CXVSCROLL];
30 sysMetrics[SM_CYCAPTION] = 2 +
31 PROFILE_GetWineIniInt("Tweak.Layout", "CaptionHeight", 18);
32 sysMetrics[SM_CXBORDER] = 1;
33 sysMetrics[SM_CYBORDER] = sysMetrics[SM_CXBORDER];
34 sysMetrics[SM_CXDLGFRAME] =
35 PROFILE_GetWineIniInt("Tweak.Layout", "DialogFrameWidth",
36 TWEAK_Win95Look ? 2 : 4);
37 sysMetrics[SM_CYDLGFRAME] = sysMetrics[SM_CXDLGFRAME];
38 sysMetrics[SM_CYVTHUMB] = sysMetrics[SM_CXVSCROLL] - 1;
39 sysMetrics[SM_CXHTHUMB] = sysMetrics[SM_CYVTHUMB];
40 sysMetrics[SM_CXICON] = 32;
41 sysMetrics[SM_CYICON] = 32;
42 sysMetrics[SM_CYMENU] =
43 PROFILE_GetWineIniInt("Tweak.Layout", "MenuHeight", 18);
44 sysMetrics[SM_CXFULLSCREEN] = sysMetrics[SM_CXSCREEN];
45 sysMetrics[SM_CYFULLSCREEN] =
46 sysMetrics[SM_CYSCREEN] - sysMetrics[SM_CYCAPTION];
47 sysMetrics[SM_CYKANJIWINDOW] = 0;
48 sysMetrics[SM_MOUSEPRESENT] = 1;
49 sysMetrics[SM_CYVSCROLL] = sysMetrics[SM_CYVTHUMB];
50 sysMetrics[SM_CXHSCROLL] = sysMetrics[SM_CXHTHUMB];
51 sysMetrics[SM_DEBUG] = 0;
53 /* FIXME: The following should look for the registry key to see if the
54 buttons should be swapped. */
55 sysMetrics[SM_SWAPBUTTON] = 0;
57 sysMetrics[SM_RESERVED1] = 0;
58 sysMetrics[SM_RESERVED2] = 0;
59 sysMetrics[SM_RESERVED3] = 0;
60 sysMetrics[SM_RESERVED4] = 0;
62 /* FIXME: The following two are calculated, but how? */
63 sysMetrics[SM_CXMIN] = TWEAK_Win95Look ? 112 : 100;
64 sysMetrics[SM_CYMIN] = TWEAK_Win95Look ? 27 : 28;
66 sysMetrics[SM_CXSIZE] = sysMetrics[SM_CYCAPTION] - 2;
67 sysMetrics[SM_CYSIZE] = sysMetrics[SM_CXSIZE];
68 sysMetrics[SM_CXFRAME] = GetProfileInt32A("Windows", "BorderWidth", 4);
69 sysMetrics[SM_CYFRAME] = sysMetrics[SM_CXFRAME];
70 sysMetrics[SM_CXMINTRACK] = sysMetrics[SM_CXMIN];
71 sysMetrics[SM_CYMINTRACK] = sysMetrics[SM_CYMIN];
72 sysMetrics[SM_CXDOUBLECLK] =
73 (GetProfileInt32A("Windows", "DoubleClickWidth", 4) + 1) & ~1;
74 sysMetrics[SM_CYDOUBLECLK] =
75 (GetProfileInt32A("Windows","DoubleClickHeight", 4) + 1) & ~1;
76 sysMetrics[SM_CXICONSPACING] =
77 GetProfileInt32A("Desktop","IconSpacing", 75);
78 sysMetrics[SM_CYICONSPACING] =
79 GetProfileInt32A("Desktop", "IconVerticalSpacing", 75);
80 sysMetrics[SM_MENUDROPALIGNMENT] =
81 GetProfileInt32A("Windows", "MenuDropAlignment", 0);
82 sysMetrics[SM_PENWINDOWS] = 0;
83 sysMetrics[SM_DBCSENABLED] = 0;
85 /* FIXME: Need to query X for the following */
86 sysMetrics[SM_CMOUSEBUTTONS] = 3;
88 sysMetrics[SM_SECURE] = 0;
89 sysMetrics[SM_CXEDGE] = sysMetrics[SM_CXBORDER] + 1;
90 sysMetrics[SM_CYEDGE] = sysMetrics[SM_CXEDGE];
91 sysMetrics[SM_CXMINSPACING] = 160;
92 sysMetrics[SM_CYMINSPACING] = 24;
93 sysMetrics[SM_CXSMICON] =
94 sysMetrics[SM_CYSIZE] - (sysMetrics[SM_CYSIZE] % 2) - 2;
95 sysMetrics[SM_CYSMICON] = sysMetrics[SM_CXSMICON];
96 sysMetrics[SM_CYSMCAPTION] = 16;
97 sysMetrics[SM_CXSMSIZE] = 15;
98 sysMetrics[SM_CYSMSIZE] = sysMetrics[SM_CXSMSIZE];
99 sysMetrics[SM_CXMENUSIZE] = sysMetrics[SM_CYMENU];
100 sysMetrics[SM_CYMENUSIZE] = sysMetrics[SM_CXMENUSIZE];
102 /* FIXME: What do these mean? */
103 sysMetrics[SM_ARRANGE] = 8;
104 sysMetrics[SM_CXMINIMIZED] = 160;
105 sysMetrics[SM_CYMINIMIZED] = 24;
107 /* FIXME: How do I calculate these? */
108 sysMetrics[SM_CXMAXTRACK] =
109 sysMetrics[SM_CXSCREEN] + 4 + 2 * sysMetrics[SM_CXFRAME];
110 sysMetrics[SM_CYMAXTRACK] =
111 sysMetrics[SM_CYSCREEN] + 4 + 2 * sysMetrics[SM_CYFRAME];
112 sysMetrics[SM_CXMAXIMIZED] =
113 sysMetrics[SM_CXSCREEN] + 2 * sysMetrics[SM_CXFRAME];
114 sysMetrics[SM_CYMAXIMIZED] =
115 sysMetrics[SM_CYSCREEN] - 45;
116 sysMetrics[SM_NETWORK] = 3;
118 /* For the following: 0 = ok, 1 = failsafe, 2 = failsafe + network */
119 sysMetrics[SM_CLEANBOOT] = 0;
121 sysMetrics[SM_CXDRAG] = 0;
122 sysMetrics[SM_CYDRAG] = 0;
123 sysMetrics[SM_SHOWSOUNDS] = 0;
124 sysMetrics[SM_CXMENUCHECK] = 2;
125 sysMetrics[SM_CYMENUCHECK] = 2;
127 /* FIXME: Should check the type of processor for the following */
128 sysMetrics[SM_SLOWMACHINE] = 0;
130 /* FIXME: Should perform a check */
131 sysMetrics[SM_MIDEASTENABLED] = 0;
133 sysMetrics[SM_MOUSEWHEELPRESENT] = 0;
134 sysMetrics[SM_CMETRICS] = SM_CMETRICS;
138 /***********************************************************************
139 * GetSystemMetrics16 (USER.179)
141 INT16 WINAPI GetSystemMetrics16( INT16 index )
143 if ((index < 0) || (index > SM_CMETRICS)) return 0;
144 else return sysMetrics[index];
148 /***********************************************************************
149 * GetSystemMetrics32 (USER32.291)
151 INT32 WINAPI GetSystemMetrics32( INT32 index )
153 if ((index < 0) || (index > SM_CMETRICS)) return 0;
154 else return sysMetrics[index];