3 Copyright 1993 by Davor Matic
5 Permission to use, copy, modify, distribute, and sell this software
6 and its documentation for any purpose is hereby granted without fee,
7 provided that the above copyright notice appear in all copies and that
8 both that copyright notice and this permission notice appear in
9 supporting documentation. Davor Matic makes no representations about
10 the suitability of this software for any purpose. It is provided "as
11 is" without express or implied warranty.
15 #ifdef HAVE_XNEST_CONFIG_H
16 #include <xnest-config.h>
20 #include <X11/Xproto.h>
21 #include "screenint.h"
24 #include "scrnintstr.h"
32 char *xnestDisplayName
= NULL
;
33 Bool xnestSynchronize
= False
;
34 Bool xnestFullGeneration
= False
;
35 int xnestDefaultClass
;
36 Bool xnestUserDefaultClass
= False
;
37 int xnestDefaultDepth
;
38 Bool xnestUserDefaultDepth
= False
;
39 Bool xnestSoftwareScreenSaver
= False
;
42 unsigned int xnestWidth
;
43 unsigned int xnestHeight
;
44 int xnestUserGeometry
= 0;
46 Bool xnestUserBorderWidth
= False
;
47 char *xnestWindowName
= NULL
;
48 int xnestNumScreens
= 0;
49 Bool xnestDoDirectColormaps
= False
;
50 Window xnestParentWindow
= 0;
53 ddxProcessArgument(int argc
, char *argv
[], int i
)
55 if (!strcmp(argv
[i
], "-display")) {
57 xnestDisplayName
= argv
[i
];
62 if (!strcmp(argv
[i
], "-sync")) {
63 xnestSynchronize
= True
;
66 if (!strcmp(argv
[i
], "-full")) {
67 xnestFullGeneration
= True
;
70 if (!strcmp(argv
[i
], "-class")) {
72 if (!strcmp(argv
[i
], "StaticGray")) {
73 xnestDefaultClass
= StaticGray
;
74 xnestUserDefaultClass
= True
;
77 else if (!strcmp(argv
[i
], "GrayScale")) {
78 xnestDefaultClass
= GrayScale
;
79 xnestUserDefaultClass
= True
;
82 else if (!strcmp(argv
[i
], "StaticColor")) {
83 xnestDefaultClass
= StaticColor
;
84 xnestUserDefaultClass
= True
;
87 else if (!strcmp(argv
[i
], "PseudoColor")) {
88 xnestDefaultClass
= PseudoColor
;
89 xnestUserDefaultClass
= True
;
92 else if (!strcmp(argv
[i
], "TrueColor")) {
93 xnestDefaultClass
= TrueColor
;
94 xnestUserDefaultClass
= True
;
97 else if (!strcmp(argv
[i
], "DirectColor")) {
98 xnestDefaultClass
= DirectColor
;
99 xnestUserDefaultClass
= True
;
105 if (!strcmp(argv
[i
], "-cc")) {
106 if (++i
< argc
&& sscanf(argv
[i
], "%i", &xnestDefaultClass
) == 1) {
107 if (xnestDefaultClass
>= 0 && xnestDefaultClass
<= 5) {
108 xnestUserDefaultClass
= True
;
109 /* lex the OS layer process it as well, so return 0 */
114 if (!strcmp(argv
[i
], "-depth")) {
115 if (++i
< argc
&& sscanf(argv
[i
], "%i", &xnestDefaultDepth
) == 1) {
116 if (xnestDefaultDepth
> 0) {
117 xnestUserDefaultDepth
= True
;
123 if (!strcmp(argv
[i
], "-sss")) {
124 xnestSoftwareScreenSaver
= True
;
127 if (!strcmp(argv
[i
], "-geometry")) {
129 xnestUserGeometry
= XParseGeometry(argv
[i
],
131 &xnestWidth
, &xnestHeight
);
132 if (xnestUserGeometry
)
137 if (!strcmp(argv
[i
], "-bw")) {
138 if (++i
< argc
&& sscanf(argv
[i
], "%i", &xnestBorderWidth
) == 1) {
139 if (xnestBorderWidth
>= 0) {
140 xnestUserBorderWidth
= True
;
146 if (!strcmp(argv
[i
], "-name")) {
148 xnestWindowName
= argv
[i
];
153 if (!strcmp(argv
[i
], "-scrns")) {
154 if (++i
< argc
&& sscanf(argv
[i
], "%i", &xnestNumScreens
) == 1) {
155 if (xnestNumScreens
> 0) {
156 if (xnestNumScreens
> MAXSCREENS
) {
157 ErrorF("Maximum number of screens is %d.\n", MAXSCREENS
);
158 xnestNumScreens
= MAXSCREENS
;
165 if (!strcmp(argv
[i
], "-install")) {
166 xnestDoDirectColormaps
= True
;
169 if (!strcmp(argv
[i
], "-parent")) {
171 xnestParentWindow
= (XID
) strtol(argv
[i
], (char **) NULL
, 0);
181 ErrorF("-display string display name of the real server\n");
182 ErrorF("-sync sinchronize with the real server\n");
183 ErrorF("-full utilize full regeneration\n");
184 ErrorF("-class string default visual class\n");
185 ErrorF("-depth int default depth\n");
186 ErrorF("-sss use software screen saver\n");
187 ErrorF("-geometry WxH+X+Y window size and position\n");
188 ErrorF("-bw int window border width\n");
189 ErrorF("-name string window name\n");
190 ErrorF("-scrns int number of screens to generate\n");
191 ErrorF("-install instal colormaps directly\n");