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;
52 /* ddxInitGlobals - called by |InitGlobals| from os/util.c */
53 void ddxInitGlobals(void)
56 /* XXX terrible hack */
57 extern Bool noCompositeExtension
;
58 noCompositeExtension
= TRUE
;
62 extern Bool noXkbExtension
;
63 noXkbExtension
= TRUE
;
68 ddxProcessArgument (int argc
, char *argv
[], int i
)
70 if (!strcmp(argv
[i
], "-display")) {
72 xnestDisplayName
= argv
[i
];
77 if (!strcmp(argv
[i
], "-sync")) {
78 xnestSynchronize
= True
;
81 if (!strcmp(argv
[i
], "-full")) {
82 xnestFullGeneration
= True
;
85 if (!strcmp(argv
[i
], "-class")) {
87 if (!strcmp(argv
[i
], "StaticGray")) {
88 xnestDefaultClass
= StaticGray
;
89 xnestUserDefaultClass
= True
;
92 else if (!strcmp(argv
[i
], "GrayScale")) {
93 xnestDefaultClass
= GrayScale
;
94 xnestUserDefaultClass
= True
;
97 else if (!strcmp(argv
[i
], "StaticColor")) {
98 xnestDefaultClass
= StaticColor
;
99 xnestUserDefaultClass
= True
;
102 else if (!strcmp(argv
[i
], "PseudoColor")) {
103 xnestDefaultClass
= PseudoColor
;
104 xnestUserDefaultClass
= True
;
107 else if (!strcmp(argv
[i
], "TrueColor")) {
108 xnestDefaultClass
= TrueColor
;
109 xnestUserDefaultClass
= True
;
112 else if (!strcmp(argv
[i
], "DirectColor")) {
113 xnestDefaultClass
= DirectColor
;
114 xnestUserDefaultClass
= True
;
120 if (!strcmp(argv
[i
], "-cc")) {
121 if (++i
< argc
&& sscanf(argv
[i
], "%i", &xnestDefaultClass
) == 1) {
122 if (xnestDefaultClass
>= 0 && xnestDefaultClass
<= 5) {
123 xnestUserDefaultClass
= True
;
124 /* lex the OS layer process it as well, so return 0 */
129 if (!strcmp(argv
[i
], "-depth")) {
130 if (++i
< argc
&& sscanf(argv
[i
], "%i", &xnestDefaultDepth
) == 1) {
131 if (xnestDefaultDepth
> 0) {
132 xnestUserDefaultDepth
= True
;
138 if (!strcmp(argv
[i
], "-sss")) {
139 xnestSoftwareScreenSaver
= True
;
142 if (!strcmp(argv
[i
], "-geometry")) {
144 xnestUserGeometry
= XParseGeometry(argv
[i
],
146 &xnestWidth
, &xnestHeight
);
147 if (xnestUserGeometry
) return 2;
151 if (!strcmp(argv
[i
], "-bw")) {
152 if (++i
< argc
&& sscanf(argv
[i
], "%i", &xnestBorderWidth
) == 1) {
153 if (xnestBorderWidth
>= 0) {
154 xnestUserBorderWidth
= True
;
160 if (!strcmp(argv
[i
], "-name")) {
162 xnestWindowName
= argv
[i
];
167 if (!strcmp(argv
[i
], "-scrns")) {
168 if (++i
< argc
&& sscanf(argv
[i
], "%i", &xnestNumScreens
) == 1) {
169 if (xnestNumScreens
> 0) {
170 if (xnestNumScreens
> MAXSCREENS
) {
171 ErrorF("Maximum number of screens is %d.\n", MAXSCREENS
);
172 xnestNumScreens
= MAXSCREENS
;
179 if (!strcmp(argv
[i
], "-install")) {
180 xnestDoDirectColormaps
= True
;
183 if (!strcmp(argv
[i
], "-parent")) {
185 xnestParentWindow
= (XID
) strtol (argv
[i
], (char**)NULL
, 0);
194 ErrorF("-display string display name of the real server\n");
195 ErrorF("-sync sinchronize with the real server\n");
196 ErrorF("-full utilize full regeneration\n");
197 ErrorF("-class string default visual class\n");
198 ErrorF("-depth int default depth\n");
199 ErrorF("-sss use software screen saver\n");
200 ErrorF("-geometry WxH+X+Y window size and position\n");
201 ErrorF("-bw int window border width\n");
202 ErrorF("-name string window name\n");
203 ErrorF("-scrns int number of screens to generate\n");
204 ErrorF("-install instal colormaps directly\n");