2 * WPrefs - WindowMaker Preferences Program
4 * Copyright (c) 1998 Alfredo K. Kojima
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
24 #include <X11/Xlocale.h>
27 extern void Initialize(WMScreen
*scr
);
39 stringCompareHook(proplist_t pl1
, proplist_t pl2
)
43 str1
= PLGetString(pl1
);
44 str2
= PLGetString(pl2
);
46 if (strcasecmp(str1
, str2
)==0)
54 print_help(char *progname
)
56 printf(_("usage: %s [options]\n"), progname
);
58 puts(_(" -display <display> display to be used"));
59 puts(_(" -version print version number and exit"));
64 main(int argc
, char **argv
)
70 char *display_name
="";
72 WMInitializeApplication("WPrefs", &argc
, argv
);
75 for (i
=1; i
<argc
; i
++) {
76 if (strcmp(argv
[i
], "-version")==0) {
77 printf("WPrefs %s\n", WVERSION
);
79 } else if (strcmp(argv
[i
], "-display")==0) {
82 wwarning(_("too few arguments for %s"), argv
[i
-1]);
85 display_name
= argv
[i
];
93 locale
= getenv("LANG");
94 setlocale(LC_ALL
, "");
97 if (getenv("NLSPATH"))
98 bindtextdomain("WPrefs", getenv("NLSPATH"));
100 bindtextdomain("WPrefs", NLSDIR
);
101 textdomain("WPrefs");
103 if (!XSupportsLocale()) {
104 wwarning(_("X server does not support locale"));
106 if (XSetLocaleModifiers("") == NULL
) {
107 wwarning(_("cannot set locale modifiers"));
111 dpy
= XOpenDisplay(display_name
);
113 wfatal(_("could not open display %s"), XDisplayName(display_name
));
117 XSynchronize(dpy
, 1);
119 scr
= WMCreateScreen(dpy
, DefaultScreen(dpy
));
121 wfatal(_("could not initialize application"));
125 PLSetStringCmpHook(stringCompareHook
);
132 WMNextEvent(dpy
, &event
);
133 WMHandleEvent(&event
);