6 #include <X11/Xlocale.h>
9 _WINGsConfiguration WINGsConfiguration
;
13 #define SYSTEM_FONT "Trebuchet MS,Luxi Sans"
14 #define BOLD_SYSTEM_FONT "Trebuchet MS,Luxi Sans:bold"
15 #define DEFAULT_FONT_SIZE 12
17 #define FLOPPY_PATH "/floppy"
21 getButtonWithName(const char *name
, unsigned defaultButton
)
23 if (strncmp(name
, "Button", 6)==0 && strlen(name
)==7) {
45 W_ReadConfigurations(void)
47 WMUserDefaults
*defaults
;
49 memset(&WINGsConfiguration
, 0, sizeof(_WINGsConfiguration
));
51 defaults
= WMGetStandardUserDefaults();
57 WINGsConfiguration
.systemFont
=
58 WMGetUDStringForKey(defaults
, "SystemFont");
60 WINGsConfiguration
.boldSystemFont
=
61 WMGetUDStringForKey(defaults
, "BoldSystemFont");
63 WINGsConfiguration
.antialiasedText
=
64 WMGetUDBoolForKey(defaults
, "AntialiasedText");
66 WINGsConfiguration
.doubleClickDelay
=
67 WMGetUDIntegerForKey(defaults
, "DoubleClickTime");
69 WINGsConfiguration
.floppyPath
=
70 WMGetUDStringForKey(defaults
, "FloppyPath");
72 buttonName
= WMGetUDStringForKey(defaults
, "MouseWheelUp");
74 button
= getButtonWithName(buttonName
, Button4
);
79 WINGsConfiguration
.mouseWheelUp
= button
;
81 buttonName
= WMGetUDStringForKey(defaults
, "MouseWheelDown");
83 button
= getButtonWithName(buttonName
, Button5
);
88 WINGsConfiguration
.mouseWheelDown
= button
;
90 if (WINGsConfiguration
.mouseWheelDown
==WINGsConfiguration
.mouseWheelUp
) {
91 WINGsConfiguration
.mouseWheelUp
= Button4
;
92 WINGsConfiguration
.mouseWheelDown
= Button5
;
95 WINGsConfiguration
.defaultFontSize
=
96 WMGetUDIntegerForKey(defaults
, "DefaultFontSize");
99 if (!WINGsConfiguration
.systemFont
) {
100 WINGsConfiguration
.systemFont
= SYSTEM_FONT
;
102 if (!WINGsConfiguration
.boldSystemFont
) {
103 WINGsConfiguration
.boldSystemFont
= BOLD_SYSTEM_FONT
;
105 if (WINGsConfiguration
.defaultFontSize
== 0) {
106 WINGsConfiguration
.defaultFontSize
= DEFAULT_FONT_SIZE
;
108 if (!WINGsConfiguration
.floppyPath
) {
109 WINGsConfiguration
.floppyPath
= FLOPPY_PATH
;
111 if (WINGsConfiguration
.doubleClickDelay
== 0) {
112 WINGsConfiguration
.doubleClickDelay
= 250;
114 if (WINGsConfiguration
.mouseWheelUp
== 0) {
115 WINGsConfiguration
.mouseWheelUp
= Button4
;
117 if (WINGsConfiguration
.mouseWheelDown
== 0) {
118 WINGsConfiguration
.mouseWheelDown
= Button5
;