2 * System metrics functions
4 * Copyright 1994 Alexandre Julliard
12 #include "sysmetrics.h"
14 short sysMetrics
[SM_CMETRICS
+1];
16 /***********************************************************************
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
];
31 sysMetrics
[SM_CYCAPTION
] =
32 PROFILE_GetWineIniInt("Tweak.Layout", "CaptionHeight", 19);
34 sysMetrics
[SM_CYCAPTION
] = 2 +
35 PROFILE_GetWineIniInt("Tweak.Layout", "CaptionHeight", 18);
36 sysMetrics
[SM_CXBORDER
] = 1;
37 sysMetrics
[SM_CYBORDER
] = sysMetrics
[SM_CXBORDER
];
38 sysMetrics
[SM_CXDLGFRAME
] =
39 PROFILE_GetWineIniInt("Tweak.Layout", "DialogFrameWidth",
40 TWEAK_Win95Look
? 3 : 4);
41 sysMetrics
[SM_CYDLGFRAME
] = sysMetrics
[SM_CXDLGFRAME
];
42 sysMetrics
[SM_CYVTHUMB
] = sysMetrics
[SM_CXVSCROLL
] - 1;
43 sysMetrics
[SM_CXHTHUMB
] = sysMetrics
[SM_CYVTHUMB
];
44 sysMetrics
[SM_CXICON
] = 32;
45 sysMetrics
[SM_CYICON
] = 32;
47 sysMetrics
[SM_CYMENU
] =
48 PROFILE_GetWineIniInt("Tweak.Layout", "MenuHeight", 19);
50 sysMetrics
[SM_CYMENU
] =
51 PROFILE_GetWineIniInt("Tweak.Layout", "MenuHeight", 18);
52 sysMetrics
[SM_CXFULLSCREEN
] = sysMetrics
[SM_CXSCREEN
];
53 sysMetrics
[SM_CYFULLSCREEN
] =
54 sysMetrics
[SM_CYSCREEN
] - sysMetrics
[SM_CYCAPTION
];
55 sysMetrics
[SM_CYKANJIWINDOW
] = 0;
56 sysMetrics
[SM_MOUSEPRESENT
] = 1;
57 sysMetrics
[SM_CYVSCROLL
] = sysMetrics
[SM_CYVTHUMB
];
58 sysMetrics
[SM_CXHSCROLL
] = sysMetrics
[SM_CXHTHUMB
];
59 sysMetrics
[SM_DEBUG
] = 0;
61 /* FIXME: The following should look for the registry key to see if the
62 buttons should be swapped. */
63 sysMetrics
[SM_SWAPBUTTON
] = 0;
65 sysMetrics
[SM_RESERVED1
] = 0;
66 sysMetrics
[SM_RESERVED2
] = 0;
67 sysMetrics
[SM_RESERVED3
] = 0;
68 sysMetrics
[SM_RESERVED4
] = 0;
70 /* FIXME: The following two are calculated, but how? */
71 sysMetrics
[SM_CXMIN
] = TWEAK_Win95Look
? 112 : 100;
72 sysMetrics
[SM_CYMIN
] = TWEAK_Win95Look
? 27 : 28;
74 sysMetrics
[SM_CXSIZE
] = sysMetrics
[SM_CYCAPTION
] - 2;
75 sysMetrics
[SM_CYSIZE
] = sysMetrics
[SM_CXSIZE
];
76 sysMetrics
[SM_CXFRAME
] = GetProfileInt32A("Windows", "BorderWidth", 4);
77 sysMetrics
[SM_CYFRAME
] = sysMetrics
[SM_CXFRAME
];
78 sysMetrics
[SM_CXMINTRACK
] = sysMetrics
[SM_CXMIN
];
79 sysMetrics
[SM_CYMINTRACK
] = sysMetrics
[SM_CYMIN
];
80 sysMetrics
[SM_CXDOUBLECLK
] =
81 (GetProfileInt32A("Windows", "DoubleClickWidth", 4) + 1) & ~1;
82 sysMetrics
[SM_CYDOUBLECLK
] =
83 (GetProfileInt32A("Windows","DoubleClickHeight", 4) + 1) & ~1;
84 sysMetrics
[SM_CXICONSPACING
] =
85 GetProfileInt32A("Desktop","IconSpacing", 75);
86 sysMetrics
[SM_CYICONSPACING
] =
87 GetProfileInt32A("Desktop", "IconVerticalSpacing", 75);
88 sysMetrics
[SM_MENUDROPALIGNMENT
] =
89 GetProfileInt32A("Windows", "MenuDropAlignment", 0);
90 sysMetrics
[SM_PENWINDOWS
] = 0;
91 sysMetrics
[SM_DBCSENABLED
] = 0;
93 /* FIXME: Need to query X for the following */
94 sysMetrics
[SM_CMOUSEBUTTONS
] = 3;
96 sysMetrics
[SM_SECURE
] = 0;
97 sysMetrics
[SM_CXEDGE
] = sysMetrics
[SM_CXBORDER
] + 1;
98 sysMetrics
[SM_CYEDGE
] = sysMetrics
[SM_CXEDGE
];
99 sysMetrics
[SM_CXMINSPACING
] = 160;
100 sysMetrics
[SM_CYMINSPACING
] = 24;
101 sysMetrics
[SM_CXSMICON
] =
102 sysMetrics
[SM_CYSIZE
] - (sysMetrics
[SM_CYSIZE
] % 2) - 2;
103 sysMetrics
[SM_CYSMICON
] = sysMetrics
[SM_CXSMICON
];
104 sysMetrics
[SM_CYSMCAPTION
] = 16;
105 sysMetrics
[SM_CXSMSIZE
] = 15;
106 sysMetrics
[SM_CYSMSIZE
] = sysMetrics
[SM_CXSMSIZE
];
107 sysMetrics
[SM_CXMENUSIZE
] = sysMetrics
[SM_CYMENU
];
108 sysMetrics
[SM_CYMENUSIZE
] = sysMetrics
[SM_CXMENUSIZE
];
110 /* FIXME: What do these mean? */
111 sysMetrics
[SM_ARRANGE
] = 8;
112 sysMetrics
[SM_CXMINIMIZED
] = 160;
113 sysMetrics
[SM_CYMINIMIZED
] = 24;
115 /* FIXME: How do I calculate these? */
116 sysMetrics
[SM_CXMAXTRACK
] =
117 sysMetrics
[SM_CXSCREEN
] + 4 + 2 * sysMetrics
[SM_CXFRAME
];
118 sysMetrics
[SM_CYMAXTRACK
] =
119 sysMetrics
[SM_CYSCREEN
] + 4 + 2 * sysMetrics
[SM_CYFRAME
];
120 sysMetrics
[SM_CXMAXIMIZED
] =
121 sysMetrics
[SM_CXSCREEN
] + 2 * sysMetrics
[SM_CXFRAME
];
122 sysMetrics
[SM_CYMAXIMIZED
] =
123 sysMetrics
[SM_CYSCREEN
] - 45;
124 sysMetrics
[SM_NETWORK
] = 3;
126 /* For the following: 0 = ok, 1 = failsafe, 2 = failsafe + network */
127 sysMetrics
[SM_CLEANBOOT
] = 0;
129 sysMetrics
[SM_CXDRAG
] = 2;
130 sysMetrics
[SM_CYDRAG
] = 2;
131 sysMetrics
[SM_SHOWSOUNDS
] = 0;
132 sysMetrics
[SM_CXMENUCHECK
] = 2;
133 sysMetrics
[SM_CYMENUCHECK
] = 2;
135 /* FIXME: Should check the type of processor for the following */
136 sysMetrics
[SM_SLOWMACHINE
] = 0;
138 /* FIXME: Should perform a check */
139 sysMetrics
[SM_MIDEASTENABLED
] = 0;
141 sysMetrics
[SM_MOUSEWHEELPRESENT
] = 0;
142 sysMetrics
[SM_CMETRICS
] = SM_CMETRICS
;
146 /***********************************************************************
147 * GetSystemMetrics16 (USER.179)
149 INT16 WINAPI
GetSystemMetrics16( INT16 index
)
151 if ((index
< 0) || (index
> SM_CMETRICS
)) return 0;
152 else return sysMetrics
[index
];
156 /***********************************************************************
157 * GetSystemMetrics32 (USER32.292)
159 INT32 WINAPI
GetSystemMetrics32( INT32 index
)
161 if ((index
< 0) || (index
> SM_CMETRICS
)) return 0;
162 else return sysMetrics
[index
];