mirror of
https://github.com/gryf/wmaker.git
synced 2026-01-10 15:54:17 +01:00
changed indentation to use spaces only
This commit is contained in:
114
util/seticons.c
114
util/seticons.c
@@ -1,9 +1,9 @@
|
||||
/* seticons.c - sets icon configuration in WindowMaker
|
||||
*
|
||||
* WindowMaker window manager
|
||||
*
|
||||
*
|
||||
* Copyright (c) 1997-2003 Alfredo K. Kojima
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
* USA.
|
||||
*/
|
||||
|
||||
@@ -40,19 +40,19 @@ defaultsPathForDomain(char *domain)
|
||||
|
||||
gspath = getenv("GNUSTEP_USER_ROOT");
|
||||
if (gspath) {
|
||||
strcpy(path, gspath);
|
||||
strcat(path, "/");
|
||||
strcpy(path, gspath);
|
||||
strcat(path, "/");
|
||||
} else {
|
||||
char *home;
|
||||
|
||||
home = getenv("HOME");
|
||||
if (!home) {
|
||||
printf("%s:could not get HOME environment variable!\n", ProgName);
|
||||
exit(0);
|
||||
}
|
||||
char *home;
|
||||
|
||||
strcpy(path, home);
|
||||
strcat(path, "/GNUstep/");
|
||||
home = getenv("HOME");
|
||||
if (!home) {
|
||||
printf("%s:could not get HOME environment variable!\n", ProgName);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
strcpy(path, home);
|
||||
strcat(path, "/GNUstep/");
|
||||
}
|
||||
strcat(path, DEFAULTS_DIR);
|
||||
strcat(path, "/");
|
||||
@@ -73,7 +73,7 @@ print_help()
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
WMPropList *window_name, *icon_key, *window_attrs, *icon_value;
|
||||
@@ -85,66 +85,66 @@ main(int argc, char **argv)
|
||||
|
||||
|
||||
if (argc < 2) {
|
||||
printf("%s: missing argument\n", ProgName);
|
||||
printf("Try '%s --help' for more information\n", ProgName);
|
||||
printf("%s: missing argument\n", ProgName);
|
||||
printf("Try '%s --help' for more information\n", ProgName);
|
||||
}
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (strcmp(argv[i], "-h")==0
|
||||
|| strcmp(argv[i], "--help")==0) {
|
||||
print_help();
|
||||
exit(0);
|
||||
} else if (strcmp(argv[i], "--version")==0) {
|
||||
puts(PROG_VERSION);
|
||||
exit(0);
|
||||
} else {
|
||||
if (path) {
|
||||
printf("%s: invalid argument '%s'\n", ProgName, argv[i]);
|
||||
printf("Try '%s --help' for more information\n", ProgName);
|
||||
exit(1);
|
||||
}
|
||||
path = argv[i];
|
||||
}
|
||||
if (strcmp(argv[i], "-h")==0
|
||||
|| strcmp(argv[i], "--help")==0) {
|
||||
print_help();
|
||||
exit(0);
|
||||
} else if (strcmp(argv[i], "--version")==0) {
|
||||
puts(PROG_VERSION);
|
||||
exit(0);
|
||||
} else {
|
||||
if (path) {
|
||||
printf("%s: invalid argument '%s'\n", ProgName, argv[i]);
|
||||
printf("Try '%s --help' for more information\n", ProgName);
|
||||
exit(1);
|
||||
}
|
||||
path = argv[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
path = defaultsPathForDomain("WMWindowAttributes");
|
||||
|
||||
|
||||
all_windows = WMReadPropListFromFile(path);
|
||||
if (!all_windows) {
|
||||
printf("%s:could not load WindowMaker configuration file \"%s\".\n",
|
||||
ProgName, path);
|
||||
exit(1);
|
||||
printf("%s:could not load WindowMaker configuration file \"%s\".\n",
|
||||
ProgName, path);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
iconset = WMReadPropListFromFile(argv[1]);
|
||||
if (!iconset) {
|
||||
printf("%s:could not load icon set file \"%s\".\n", ProgName, argv[1]);
|
||||
exit(1);
|
||||
printf("%s:could not load icon set file \"%s\".\n", ProgName, argv[1]);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
keylist = WMGetPLDictionaryKeys(iconset);
|
||||
icon_key = WMCreatePLString("Icon");
|
||||
|
||||
for (i=0; i<WMGetPropListItemCount(keylist); i++) {
|
||||
window_name = WMGetFromPLArray(keylist, i);
|
||||
if (!WMIsPLString(window_name))
|
||||
continue;
|
||||
|
||||
icon_value = WMGetFromPLDictionary(iconset, window_name);
|
||||
if (!icon_value || !WMIsPLDictionary(icon_value))
|
||||
continue;
|
||||
for (i=0; i<WMGetPropListItemCount(keylist); i++) {
|
||||
window_name = WMGetFromPLArray(keylist, i);
|
||||
if (!WMIsPLString(window_name))
|
||||
continue;
|
||||
|
||||
window_attrs = WMGetFromPLDictionary(all_windows, window_name);
|
||||
if (window_attrs) {
|
||||
if (WMIsPLDictionary(window_attrs)) {
|
||||
WMMergePLDictionaries(window_attrs, icon_value, True);
|
||||
}
|
||||
} else {
|
||||
WMPutInPLDictionary(all_windows, window_name, icon_value);
|
||||
}
|
||||
icon_value = WMGetFromPLDictionary(iconset, window_name);
|
||||
if (!icon_value || !WMIsPLDictionary(icon_value))
|
||||
continue;
|
||||
|
||||
window_attrs = WMGetFromPLDictionary(all_windows, window_name);
|
||||
if (window_attrs) {
|
||||
if (WMIsPLDictionary(window_attrs)) {
|
||||
WMMergePLDictionaries(window_attrs, icon_value, True);
|
||||
}
|
||||
} else {
|
||||
WMPutInPLDictionary(all_windows, window_name, icon_value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
WMWritePropListToFile(all_windows, path, True);
|
||||
|
||||
exit(0);
|
||||
|
||||
Reference in New Issue
Block a user