mirror of
https://github.com/gryf/wmaker.git
synced 2026-02-13 20:35:54 +01:00
changed indentation to use spaces only
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
|
||||
/*
|
||||
* Author: Len Trigg <trigg@cs.waikato.ac.nz>
|
||||
* Author: Len Trigg <trigg@cs.waikato.ac.nz>
|
||||
*/
|
||||
|
||||
|
||||
@@ -23,78 +23,81 @@ wAbort()
|
||||
|
||||
char *ProgName;
|
||||
|
||||
void usage(void)
|
||||
void
|
||||
usage(void)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"usage:\n"
|
||||
"\t%s [-options]\n"
|
||||
"\n"
|
||||
"options:\n"
|
||||
" -i <str>\tInitial entry contents (default none)\n"
|
||||
" -p <str>\tPrompt message (default none)\n"
|
||||
" -t <str>\tQuery window title (default none)\n"
|
||||
"\n"
|
||||
"information:\n"
|
||||
"\t%s pops up a WindowMaker style input panel.\n"
|
||||
"\n"
|
||||
"version:\n"
|
||||
"\t%s\n"
|
||||
,ProgName,ProgName,__DATE__
|
||||
);
|
||||
exit(0);
|
||||
fprintf(stderr,
|
||||
"usage:\n"
|
||||
"\t%s [-options]\n"
|
||||
"\n"
|
||||
"options:\n"
|
||||
" -i <str>\tInitial entry contents (default none)\n"
|
||||
" -p <str>\tPrompt message (default none)\n"
|
||||
" -t <str>\tQuery window title (default none)\n"
|
||||
"\n"
|
||||
"information:\n"
|
||||
"\t%s pops up a WindowMaker style input panel.\n"
|
||||
"\n"
|
||||
"version:\n"
|
||||
"\t%s\n"
|
||||
,ProgName,ProgName,__DATE__
|
||||
);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
Display *dpy = XOpenDisplay("");
|
||||
WMScreen *scr;
|
||||
WMPixmap *pixmap;
|
||||
char *title = NULL;
|
||||
char *prompt = NULL;
|
||||
char *initial = NULL;
|
||||
char *result = NULL;
|
||||
int ch;
|
||||
extern char *optarg;
|
||||
extern int optind;
|
||||
Display *dpy = XOpenDisplay("");
|
||||
WMScreen *scr;
|
||||
WMPixmap *pixmap;
|
||||
char *title = NULL;
|
||||
char *prompt = NULL;
|
||||
char *initial = NULL;
|
||||
char *result = NULL;
|
||||
int ch;
|
||||
extern char *optarg;
|
||||
extern int optind;
|
||||
|
||||
WMInitializeApplication("WMQuery", &argc, argv);
|
||||
|
||||
ProgName = argv[0];
|
||||
WMInitializeApplication("WMQuery", &argc, argv);
|
||||
|
||||
if (!dpy) {
|
||||
puts("could not open display");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
while((ch = getopt(argc, argv, "i:hp:t:")) != -1)
|
||||
switch(ch)
|
||||
{
|
||||
case 'i':
|
||||
initial = optarg;
|
||||
break;
|
||||
case 'p':
|
||||
prompt = optarg;
|
||||
break;
|
||||
case 't':
|
||||
title = optarg;
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
ProgName = argv[0];
|
||||
|
||||
if (!dpy) {
|
||||
puts("could not open display");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
for(; optind <argc; optind++)
|
||||
usage();
|
||||
while((ch = getopt(argc, argv, "i:hp:t:")) != -1)
|
||||
switch(ch)
|
||||
{
|
||||
case 'i':
|
||||
initial = optarg;
|
||||
break;
|
||||
case 'p':
|
||||
prompt = optarg;
|
||||
break;
|
||||
case 't':
|
||||
title = optarg;
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
}
|
||||
|
||||
for(; optind <argc; optind++)
|
||||
usage();
|
||||
|
||||
|
||||
scr = WMCreateSimpleApplicationScreen(dpy);
|
||||
scr = WMCreateSimpleApplicationScreen(dpy);
|
||||
|
||||
pixmap = WMCreatePixmapFromXPMData(scr, GNUSTEP_XPM);
|
||||
pixmap = WMCreatePixmapFromXPMData(scr, GNUSTEP_XPM);
|
||||
|
||||
WMSetApplicationIconPixmap(scr, pixmap); WMReleasePixmap(pixmap);
|
||||
WMSetApplicationIconPixmap(scr, pixmap); WMReleasePixmap(pixmap);
|
||||
|
||||
if ((result = WMRunInputPanel(scr, NULL, title, prompt, initial, "OK", "Cancel")) != NULL)
|
||||
printf("%s\n", result);
|
||||
else
|
||||
printf("\n");
|
||||
return 0;
|
||||
if ((result = WMRunInputPanel(scr, NULL, title, prompt, initial, "OK", "Cancel")) != NULL)
|
||||
printf("%s\n", result);
|
||||
else
|
||||
printf("\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user