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