mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +01:00
Collect low-hanging fruits
This commit is contained in:
committed by
Carlos R. Mafra
parent
5f02b1b5f4
commit
d51bbe6626
@@ -373,16 +373,9 @@ void print_help()
|
|||||||
puts(" --no-cursors ignore cursor related options");
|
puts(" --no-cursors ignore cursor related options");
|
||||||
puts(" --ignore <option> ignore changes in the specified option");
|
puts(" --ignore <option> ignore changes in the specified option");
|
||||||
puts(" --help display this help and exit");
|
puts(" --help display this help and exit");
|
||||||
/*
|
|
||||||
puts(" --format <format> specifies the format of the theme to be converted");
|
|
||||||
*/
|
|
||||||
puts(" --version output version information and exit");
|
puts(" --version output version information and exit");
|
||||||
/*puts("");
|
|
||||||
puts("Supported formats: blackbox"); */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define F_BLACKBOX 1
|
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
WMPropList *prop, *style;
|
WMPropList *prop, *style;
|
||||||
@@ -422,20 +415,6 @@ int main(int argc, char **argv)
|
|||||||
} else if (strcmp("--help", argv[i]) == 0) {
|
} else if (strcmp("--help", argv[i]) == 0) {
|
||||||
print_help();
|
print_help();
|
||||||
exit(0);
|
exit(0);
|
||||||
#if 0
|
|
||||||
} else if (strcmp("--format", argv[i]) == 0) {
|
|
||||||
i++;
|
|
||||||
if (i == argc) {
|
|
||||||
printf("%s: missing argument for option --format\n", ProgName);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
if (strcasecmp(argv[i], "blackbox") == 0) {
|
|
||||||
format = F_BLACKBOX;
|
|
||||||
} else {
|
|
||||||
printf("%s: unknown theme format '%s'\n", ProgName, argv[i]);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
} else {
|
} else {
|
||||||
if (file) {
|
if (file) {
|
||||||
printf("%s: invalid argument '%s'\n", ProgName, argv[i]);
|
printf("%s: invalid argument '%s'\n", ProgName, argv[i]);
|
||||||
@@ -461,16 +440,6 @@ int main(int argc, char **argv)
|
|||||||
perror(file);
|
perror(file);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
#if 0
|
|
||||||
if (format == F_BLACKBOX) {
|
|
||||||
style = readBlackBoxStyle(file);
|
|
||||||
if (!style) {
|
|
||||||
printf("%s: could not open style file\n", ProgName);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
if (S_ISDIR(statbuf.st_mode)) {
|
if (S_ISDIR(statbuf.st_mode)) {
|
||||||
char buffer[4018];
|
char buffer[4018];
|
||||||
char *prefix;
|
char *prefix;
|
||||||
@@ -519,7 +488,6 @@ int main(int argc, char **argv)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!WMIsPLDictionary(style)) {
|
if (!WMIsPLDictionary(style)) {
|
||||||
printf("%s: '%s' is not a style file/theme\n", ProgName, file);
|
printf("%s: '%s' is not a style file/theme\n", ProgName, file);
|
||||||
@@ -561,32 +529,3 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
char *getToken(char *str, int i, char *buf)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static WMPropList *readBlackBoxStyle(char *path)
|
|
||||||
{
|
|
||||||
FILE *f;
|
|
||||||
char buffer[128], char token[128];
|
|
||||||
WMPropList *style, *p;
|
|
||||||
|
|
||||||
f = fopen(path, "rb");
|
|
||||||
if (!f) {
|
|
||||||
perror(path);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (1) {
|
|
||||||
if (!fgets(buffer, 127, f))
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (strncasecmp(buffer, "menu.title:", 11) == 0) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -306,21 +306,6 @@ void closeWindow(WMWidget * w, void *d)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
static void clickHandler(XEvent * event, void *d)
|
|
||||||
{
|
|
||||||
BufferData *data = (BufferData *) d;
|
|
||||||
|
|
||||||
data->win = WMCreateWindow(scr, "setup");
|
|
||||||
WMSetWindowTitle(data->win, "Magnify Options");
|
|
||||||
|
|
||||||
data->speed = WMCreateSlider(data->win);
|
|
||||||
|
|
||||||
data->magnify = WMCreateSlider(data->win);
|
|
||||||
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void keyHandler(XEvent * event, void *d)
|
static void keyHandler(XEvent * event, void *d)
|
||||||
{
|
{
|
||||||
BufferData *data = (BufferData *) d;
|
BufferData *data = (BufferData *) d;
|
||||||
@@ -417,9 +402,7 @@ int main(int argc, char **argv)
|
|||||||
char *display = "";
|
char *display = "";
|
||||||
char *vdisplay = NULL;
|
char *vdisplay = NULL;
|
||||||
int magfactor = 2;
|
int magfactor = 2;
|
||||||
#if 0
|
|
||||||
WMButton *radio, *tradio;
|
|
||||||
#endif
|
|
||||||
WMInitializeApplication("Magnify", &argc, argv);
|
WMInitializeApplication("Magnify", &argc, argv);
|
||||||
|
|
||||||
for (i = 1; i < argc; i++) {
|
for (i = 1; i < argc; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user