mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-24 07:02:30 +01:00
Change to the linux kernel coding style
for arq in `git ls-files *.c`; do
echo $arq;
indent -linux -l115 $arq;
done
The different line break at 115 columns is because
I use a widescreen monitor :-)
This commit is contained in:
@@ -1,122 +1,107 @@
|
||||
|
||||
|
||||
#include "WINGsP.h"
|
||||
#include "wconfig.h"
|
||||
|
||||
#include <X11/Xlocale.h>
|
||||
|
||||
|
||||
_WINGsConfiguration WINGsConfiguration;
|
||||
|
||||
|
||||
|
||||
#define SYSTEM_FONT "Trebuchet MS,Luxi Sans"
|
||||
#define BOLD_SYSTEM_FONT "Trebuchet MS,Luxi Sans:bold"
|
||||
#define DEFAULT_FONT_SIZE 12
|
||||
|
||||
#define FLOPPY_PATH "/floppy"
|
||||
|
||||
|
||||
static unsigned
|
||||
getButtonWithName(const char *name, unsigned defaultButton)
|
||||
static unsigned getButtonWithName(const char *name, unsigned defaultButton)
|
||||
{
|
||||
if (strncmp(name, "Button", 6)==0 && strlen(name)==7) {
|
||||
switch (name[6]) {
|
||||
case '1':
|
||||
return Button1;
|
||||
case '2':
|
||||
return Button2;
|
||||
case '3':
|
||||
return Button3;
|
||||
case '4':
|
||||
return Button4;
|
||||
case '5':
|
||||
return Button5;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (strncmp(name, "Button", 6) == 0 && strlen(name) == 7) {
|
||||
switch (name[6]) {
|
||||
case '1':
|
||||
return Button1;
|
||||
case '2':
|
||||
return Button2;
|
||||
case '3':
|
||||
return Button3;
|
||||
case '4':
|
||||
return Button4;
|
||||
case '5':
|
||||
return Button5;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return defaultButton;
|
||||
return defaultButton;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
W_ReadConfigurations(void)
|
||||
void W_ReadConfigurations(void)
|
||||
{
|
||||
WMUserDefaults *defaults;
|
||||
WMUserDefaults *defaults;
|
||||
|
||||
memset(&WINGsConfiguration, 0, sizeof(_WINGsConfiguration));
|
||||
memset(&WINGsConfiguration, 0, sizeof(_WINGsConfiguration));
|
||||
|
||||
defaults = WMGetStandardUserDefaults();
|
||||
defaults = WMGetStandardUserDefaults();
|
||||
|
||||
if (defaults) {
|
||||
char *buttonName;
|
||||
unsigned button;
|
||||
if (defaults) {
|
||||
char *buttonName;
|
||||
unsigned button;
|
||||
|
||||
WINGsConfiguration.systemFont =
|
||||
WMGetUDStringForKey(defaults, "SystemFont");
|
||||
WINGsConfiguration.systemFont = WMGetUDStringForKey(defaults, "SystemFont");
|
||||
|
||||
WINGsConfiguration.boldSystemFont =
|
||||
WMGetUDStringForKey(defaults, "BoldSystemFont");
|
||||
WINGsConfiguration.boldSystemFont = WMGetUDStringForKey(defaults, "BoldSystemFont");
|
||||
|
||||
WINGsConfiguration.antialiasedText =
|
||||
WMGetUDBoolForKey(defaults, "AntialiasedText");
|
||||
WINGsConfiguration.antialiasedText = WMGetUDBoolForKey(defaults, "AntialiasedText");
|
||||
|
||||
WINGsConfiguration.doubleClickDelay =
|
||||
WMGetUDIntegerForKey(defaults, "DoubleClickTime");
|
||||
WINGsConfiguration.doubleClickDelay = WMGetUDIntegerForKey(defaults, "DoubleClickTime");
|
||||
|
||||
WINGsConfiguration.floppyPath =
|
||||
WMGetUDStringForKey(defaults, "FloppyPath");
|
||||
WINGsConfiguration.floppyPath = WMGetUDStringForKey(defaults, "FloppyPath");
|
||||
|
||||
buttonName = WMGetUDStringForKey(defaults, "MouseWheelUp");
|
||||
if (buttonName) {
|
||||
button = getButtonWithName(buttonName, Button4);
|
||||
wfree(buttonName);
|
||||
} else {
|
||||
button = Button4;
|
||||
}
|
||||
WINGsConfiguration.mouseWheelUp = button;
|
||||
buttonName = WMGetUDStringForKey(defaults, "MouseWheelUp");
|
||||
if (buttonName) {
|
||||
button = getButtonWithName(buttonName, Button4);
|
||||
wfree(buttonName);
|
||||
} else {
|
||||
button = Button4;
|
||||
}
|
||||
WINGsConfiguration.mouseWheelUp = button;
|
||||
|
||||
buttonName = WMGetUDStringForKey(defaults, "MouseWheelDown");
|
||||
if (buttonName) {
|
||||
button = getButtonWithName(buttonName, Button5);
|
||||
wfree(buttonName);
|
||||
} else {
|
||||
button = Button5;
|
||||
}
|
||||
WINGsConfiguration.mouseWheelDown = button;
|
||||
buttonName = WMGetUDStringForKey(defaults, "MouseWheelDown");
|
||||
if (buttonName) {
|
||||
button = getButtonWithName(buttonName, Button5);
|
||||
wfree(buttonName);
|
||||
} else {
|
||||
button = Button5;
|
||||
}
|
||||
WINGsConfiguration.mouseWheelDown = button;
|
||||
|
||||
if (WINGsConfiguration.mouseWheelDown==WINGsConfiguration.mouseWheelUp) {
|
||||
WINGsConfiguration.mouseWheelUp = Button4;
|
||||
WINGsConfiguration.mouseWheelDown = Button5;
|
||||
}
|
||||
if (WINGsConfiguration.mouseWheelDown == WINGsConfiguration.mouseWheelUp) {
|
||||
WINGsConfiguration.mouseWheelUp = Button4;
|
||||
WINGsConfiguration.mouseWheelDown = Button5;
|
||||
}
|
||||
|
||||
WINGsConfiguration.defaultFontSize =
|
||||
WMGetUDIntegerForKey(defaults, "DefaultFontSize");
|
||||
}
|
||||
WINGsConfiguration.defaultFontSize = WMGetUDIntegerForKey(defaults, "DefaultFontSize");
|
||||
}
|
||||
|
||||
if (!WINGsConfiguration.systemFont) {
|
||||
WINGsConfiguration.systemFont = SYSTEM_FONT;
|
||||
}
|
||||
if (!WINGsConfiguration.boldSystemFont) {
|
||||
WINGsConfiguration.boldSystemFont = BOLD_SYSTEM_FONT;
|
||||
}
|
||||
if (WINGsConfiguration.defaultFontSize == 0) {
|
||||
WINGsConfiguration.defaultFontSize = DEFAULT_FONT_SIZE;
|
||||
}
|
||||
if (!WINGsConfiguration.floppyPath) {
|
||||
WINGsConfiguration.floppyPath = FLOPPY_PATH;
|
||||
}
|
||||
if (WINGsConfiguration.doubleClickDelay == 0) {
|
||||
WINGsConfiguration.doubleClickDelay = 250;
|
||||
}
|
||||
if (WINGsConfiguration.mouseWheelUp == 0) {
|
||||
WINGsConfiguration.mouseWheelUp = Button4;
|
||||
}
|
||||
if (WINGsConfiguration.mouseWheelDown == 0) {
|
||||
WINGsConfiguration.mouseWheelDown = Button5;
|
||||
}
|
||||
if (!WINGsConfiguration.systemFont) {
|
||||
WINGsConfiguration.systemFont = SYSTEM_FONT;
|
||||
}
|
||||
if (!WINGsConfiguration.boldSystemFont) {
|
||||
WINGsConfiguration.boldSystemFont = BOLD_SYSTEM_FONT;
|
||||
}
|
||||
if (WINGsConfiguration.defaultFontSize == 0) {
|
||||
WINGsConfiguration.defaultFontSize = DEFAULT_FONT_SIZE;
|
||||
}
|
||||
if (!WINGsConfiguration.floppyPath) {
|
||||
WINGsConfiguration.floppyPath = FLOPPY_PATH;
|
||||
}
|
||||
if (WINGsConfiguration.doubleClickDelay == 0) {
|
||||
WINGsConfiguration.doubleClickDelay = 250;
|
||||
}
|
||||
if (WINGsConfiguration.mouseWheelUp == 0) {
|
||||
WINGsConfiguration.mouseWheelUp = Button4;
|
||||
}
|
||||
if (WINGsConfiguration.mouseWheelDown == 0) {
|
||||
WINGsConfiguration.mouseWheelDown = Button5;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user