Release 970720
[wine/gsoc-2012-control.git] / windows / sysmetrics.c
blob525088e03eccb340e901cbd97f646488a1fa91e5
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_CXSCREEN] = screenWidth;
24 sysMetrics[SM_CYSCREEN] = screenHeight;
25 sysMetrics[SM_CXVSCROLL] =
26 PROFILE_GetWineIniInt("Tweak.Layout", "ScrollBarWidth", 16) + 1;
27 sysMetrics[SM_CYHSCROLL] = sysMetrics[SM_CXVSCROLL];
28 sysMetrics[SM_CYCAPTION] = 2 +
29 PROFILE_GetWineIniInt("Tweak.Layout", "CaptionHeight", 18);
30 sysMetrics[SM_CXBORDER] = 1;
31 sysMetrics[SM_CYBORDER] = sysMetrics[SM_CXBORDER];
32 sysMetrics[SM_CXDLGFRAME] =
33 PROFILE_GetWineIniInt("Tweak.Layout", "DialogFrameWidth",
34 TWEAK_Win95Look ? 2 : 4);
35 sysMetrics[SM_CYDLGFRAME] = sysMetrics[SM_CXDLGFRAME];
36 sysMetrics[SM_CYVTHUMB] = sysMetrics[SM_CXVSCROLL] - 1;
37 sysMetrics[SM_CXHTHUMB] = sysMetrics[SM_CYVTHUMB];
38 sysMetrics[SM_CXICON] = 32;
39 sysMetrics[SM_CYICON] = 32;
40 sysMetrics[SM_CYMENU] =
41 PROFILE_GetWineIniInt("Tweak.Layout", "MenuHeight", 18);
42 sysMetrics[SM_CXFULLSCREEN] = sysMetrics[SM_CXSCREEN];
43 sysMetrics[SM_CYFULLSCREEN] =
44 sysMetrics[SM_CYSCREEN] - sysMetrics[SM_CYCAPTION];
45 sysMetrics[SM_CYKANJIWINDOW] = 0;
46 sysMetrics[SM_MOUSEPRESENT] = 1;
47 sysMetrics[SM_CYVSCROLL] = sysMetrics[SM_CYVTHUMB];
48 sysMetrics[SM_CXHSCROLL] = sysMetrics[SM_CXHTHUMB];
49 sysMetrics[SM_DEBUG] = 0;
51 /* FIXME: The following should look for the registry key to see if the
52 buttons should be swapped. */
53 sysMetrics[SM_SWAPBUTTON] = 0;
55 sysMetrics[SM_RESERVED1] = 0;
56 sysMetrics[SM_RESERVED2] = 0;
57 sysMetrics[SM_RESERVED3] = 0;
58 sysMetrics[SM_RESERVED4] = 0;
60 /* FIXME: The following two are calculated, but how? */
61 sysMetrics[SM_CXMIN] = TWEAK_Win95Look ? 112 : 100;
62 sysMetrics[SM_CYMIN] = TWEAK_Win95Look ? 27 : 28;
64 sysMetrics[SM_CXSIZE] = sysMetrics[SM_CYCAPTION] - 2;
65 sysMetrics[SM_CYSIZE] = sysMetrics[SM_CXSIZE];
66 sysMetrics[SM_CXFRAME] = GetProfileInt32A("Windows", "BorderWidth", 4);
67 sysMetrics[SM_CYFRAME] = sysMetrics[SM_CXFRAME];
68 sysMetrics[SM_CXMINTRACK] = sysMetrics[SM_CXMIN];
69 sysMetrics[SM_CYMINTRACK] = sysMetrics[SM_CYMIN];
70 sysMetrics[SM_CXDOUBLECLK] =
71 (GetProfileInt32A("Windows", "DoubleClickWidth", 4) + 1) & ~1;
72 sysMetrics[SM_CYDOUBLECLK] =
73 (GetProfileInt32A("Windows","DoubleClickHeight", 4) + 1) & ~1;
74 sysMetrics[SM_CXICONSPACING] =
75 GetProfileInt32A("Desktop","IconSpacing", 75);
76 sysMetrics[SM_CYICONSPACING] =
77 GetProfileInt32A("Desktop", "IconVerticalSpacing", 75);
78 sysMetrics[SM_MENUDROPALIGNMENT] =
79 GetProfileInt32A("Windows", "MenuDropAlignment", 0);
80 sysMetrics[SM_PENWINDOWS] = 0;
81 sysMetrics[SM_DBCSENABLED] = 0;
83 /* FIXME: Need to query X for the following */
84 sysMetrics[SM_CMOUSEBUTTONS] = 3;
86 sysMetrics[SM_SECURE] = 0;
87 sysMetrics[SM_CXEDGE] = sysMetrics[SM_CXBORDER] + 1;
88 sysMetrics[SM_CYEDGE] = sysMetrics[SM_CXEDGE];
89 sysMetrics[SM_CXMINSPACING] = 160;
90 sysMetrics[SM_CYMINSPACING] = 24;
91 sysMetrics[SM_CXSMICON] =
92 sysMetrics[SM_CYSIZE] - (sysMetrics[SM_CYSIZE] % 2) - 2;
93 sysMetrics[SM_CYSMICON] = sysMetrics[SM_CXSMICON];
94 sysMetrics[SM_CYSMCAPTION] = 16;
95 sysMetrics[SM_CXSMSIZE] = 15;
96 sysMetrics[SM_CYSMSIZE] = sysMetrics[SM_CXSMSIZE];
97 sysMetrics[SM_CXMENUSIZE] = sysMetrics[SM_CYMENU];
98 sysMetrics[SM_CYMENUSIZE] = sysMetrics[SM_CXMENUSIZE];
100 /* FIXME: What do these mean? */
101 sysMetrics[SM_ARRANGE] = 8;
102 sysMetrics[SM_CXMINIMIZED] = 160;
103 sysMetrics[SM_CYMINIMIZED] = 24;
105 /* FIXME: How do I calculate these? */
106 sysMetrics[SM_CXMAXTRACK] =
107 sysMetrics[SM_CXSCREEN] + 4 + 2 * sysMetrics[SM_CXFRAME];
108 sysMetrics[SM_CYMAXTRACK] =
109 sysMetrics[SM_CYSCREEN] + 4 + 2 * sysMetrics[SM_CYFRAME];
110 sysMetrics[SM_CXMAXIMIZED] =
111 sysMetrics[SM_CXSCREEN] + 2 * sysMetrics[SM_CXFRAME];
112 sysMetrics[SM_CYMAXIMIZED] =
113 sysMetrics[SM_CYSCREEN] - 45;
114 sysMetrics[SM_NETWORK] = 3;
116 /* For the following: 0 = ok, 1 = failsafe, 2 = failsafe + network */
117 sysMetrics[SM_CLEANBOOT] = 0;
119 sysMetrics[SM_CXDRAG] = 0;
120 sysMetrics[SM_CYDRAG] = 0;
121 sysMetrics[SM_SHOWSOUNDS] = 0;
122 sysMetrics[SM_CXMENUCHECK] = 2;
123 sysMetrics[SM_CYMENUCHECK] = 2;
125 /* FIXME: Should check the type of processor for the following */
126 sysMetrics[SM_SLOWMACHINE] = 0;
128 /* FIXME: Should perform a check */
129 sysMetrics[SM_MIDEASTENABLED] = 0;
131 sysMetrics[SM_MOUSEWHEELPRESENT] = 0;
132 sysMetrics[SM_CMETRICS] = SM_CMETRICS;
136 /***********************************************************************
137 * GetSystemMetrics16 (USER.179)
139 INT16 GetSystemMetrics16( INT16 index )
141 if ((index < 0) || (index > SM_CMETRICS)) return 0;
142 else return sysMetrics[index];
146 /***********************************************************************
147 * GetSystemMetrics32 (USER32.291)
149 INT32 GetSystemMetrics32( INT32 index )
151 if ((index < 0) || (index > SM_CMETRICS)) return 0;
152 else return sysMetrics[index];