1 // Basewindow.cc for bbtools.
3 // Copyright (c) 1998-1999 by John Kennis, jkennis@chello.nl
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 // (See the included file COPYING / GPL-2.0)
27 fprintf(stderr
, "\n%s version %s \n", BBTOOL
, BBTOOL_VERSION
);
28 fprintf(stderr
, "Usage: %s [options]\n", BBTOOL
);
29 fprintf(stderr
, "Options:\n");
31 "-display <display name> X server to connect to\n");
32 fprintf(stderr
, "-c[onfig] <filename> Alternate config file\n");
34 "-n[obb] Fall back on default configuration\n");
36 "-v[ersion] Display version number\n");
37 fprintf(stderr
, "-h[elp] Display this help\n");
39 "-geom[etry] <geometry> Set geometry of window\n");
41 "-d[ecorated] Show 'normal' decorated window\n");
43 "-w[ithdrawn] Place bbtool in the Slit\n");
45 "-i[conic] Start bbkeys in a minimized state\n"
46 " (will override -withdrawn directive)\n");
48 "-s[hape] Don't display groundplate\n");
50 "-no[qt] Use non-qt configuration tool.\n");
52 "-m[iniMe] Like Austin Powers 2. bbkeys, "
55 "-t[inyMe] All you can see is his keyhole *sniff*.\n\n");
59 int main(int argc
, char **argv
)
62 struct CMDOPTIONS options
;
63 options
.display_name
= NULL
;
64 options
.geometry
= NULL
;
65 options
.withdrawn
= False
;
66 options
.iconic
= False
;
67 options
.shape
= False
;
68 options
.config_file
= NULL
;
69 options
.nobb_config
= False
;
70 options
.decorated
= False
;
72 options
.miniMe
= False
;
73 options
.tinyMe
= False
;
76 for (i
= 1; i
< argc
; i
++) {
77 if ((!strcmp(argv
[i
], "-display"))) {
82 options
.display_name
= argv
[i
];
84 else if ((!strcmp(argv
[i
], "-config")) |
85 (!strcmp(argv
[i
], "-c"))) {
90 options
.config_file
= argv
[i
];
91 } else if ((!strcmp(argv
[i
], "-nobb")) | (!strcmp(argv
[i
], "-n"))) {
92 options
.nobb_config
= True
;
93 } else if ((!strcmp(argv
[i
], "-v"))
94 || (!strcmp(argv
[i
], "-version"))) {
95 fprintf(stderr
, " %s version %s\n", BBTOOL
, BBTOOL_VERSION
);
97 } else if ((!strcmp(argv
[i
], "-h")) || (!strcmp(argv
[i
], "-help"))) {
100 } else if ((!strcmp(argv
[i
], "-geometry"))
101 || (!strcmp(argv
[i
], "-geom"))) {
106 options
.geometry
= argv
[i
];
107 } else if ((!strcmp(argv
[i
], "-withdrawn"))
108 || (!strcmp(argv
[i
], "-w"))) {
109 options
.withdrawn
= True
;
110 } else if ((!strcmp(argv
[i
], "-iconic"))
111 || (!strcmp(argv
[i
], "-i"))) {
112 options
.iconic
= True
;
113 } else if ((!strcmp(argv
[i
], "-shape"))
114 || (!strcmp(argv
[i
], "-s"))) {
115 options
.shape
= True
;
116 } else if ((!strcmp(argv
[i
], "-decorated"))
117 || (!strcmp(argv
[i
], "-d"))) {
118 options
.decorated
= True
;
119 } else if ((!strcmp(argv
[i
], "-noqt"))
120 || (!strcmp(argv
[i
], "-no"))) {
122 } else if ((!strcmp(argv
[i
], "-miniMe"))
123 || (!strcmp(argv
[i
], "-m"))) {
124 options
.miniMe
= True
;
125 options
.tinyMe
= False
;
126 } else if ((!strcmp(argv
[i
], "-tinyMe"))
127 || (!strcmp(argv
[i
], "-t"))) {
128 options
.tinyMe
= True
;
129 options
.miniMe
= False
;
136 if (options
.iconic
) {
137 options
.withdrawn
= False
;
140 ToolWindow
bbkeys(argc
, argv
, &options
);