1
/* $Xorg: Args.c,v 1.3 2000/08/17 19:53:26 cpqbld Exp $ */
4
Copyright 1993 by Davor Matic
6
Permission to use, copy, modify, distribute, and sell this software
7
and its documentation for any purpose is hereby granted without fee,
8
provided that the above copyright notice appear in all copies and that
9
both that copyright notice and this permission notice appear in
10
supporting documentation. Davor Matic makes no representations about
11
the suitability of this software for any purpose. It is provided "as
12
is" without express or implied warranty.
17
#include "screenint.h"
20
#include "scrnintstr.h"
28
char *xnestDisplayName = NULL;
29
Bool xnestSynchronize = False;
30
Bool xnestFullGeneration = False;
31
int xnestDefaultClass;
32
Bool xnestUserDefaultClass = False;
33
int xnestDefaultDepth;
34
Bool xnestUserDefaultDepth = False;
35
Bool xnestSoftwareScreenSaver = False;
38
unsigned int xnestWidth;
39
unsigned int xnestHeight;
40
int xnestUserGeometry = 0;
42
Bool xnestUserBorderWidth = False;
43
char *xnestWindowName = NULL;
44
int xnestNumScreens = 0;
45
Bool xnestDoDirectColormaps = False;
46
Window xnestParentWindow = 0;
48
int ddxProcessArgument (argc, argv, i)
53
if (!strcmp(argv[i], "-display")) {
55
xnestDisplayName = argv[i];
60
if (!strcmp(argv[i], "-sync")) {
61
xnestSynchronize = True;
64
if (!strcmp(argv[i], "-full")) {
65
xnestFullGeneration = True;
68
if (!strcmp(argv[i], "-class")) {
70
if (!strcmp(argv[i], "StaticGray")) {
71
xnestDefaultClass = StaticGray;
72
xnestUserDefaultClass = True;
75
else if (!strcmp(argv[i], "GrayScale")) {
76
xnestDefaultClass = GrayScale;
77
xnestUserDefaultClass = True;
80
else if (!strcmp(argv[i], "StaticColor")) {
81
xnestDefaultClass = StaticColor;
82
xnestUserDefaultClass = True;
85
else if (!strcmp(argv[i], "PseudoColor")) {
86
xnestDefaultClass = PseudoColor;
87
xnestUserDefaultClass = True;
90
else if (!strcmp(argv[i], "TrueColor")) {
91
xnestDefaultClass = TrueColor;
92
xnestUserDefaultClass = True;
95
else if (!strcmp(argv[i], "DirectColor")) {
96
xnestDefaultClass = DirectColor;
97
xnestUserDefaultClass = True;
103
if (!strcmp(argv[i], "-cc")) {
104
if (++i < argc && sscanf(argv[i], "%i", &xnestDefaultClass) == 1) {
105
if (xnestDefaultClass >= 0 && xnestDefaultClass <= 5) {
106
xnestUserDefaultClass = True;
107
/* lex the OS layer process it as well, so return 0 */
112
if (!strcmp(argv[i], "-depth")) {
113
if (++i < argc && sscanf(argv[i], "%i", &xnestDefaultDepth) == 1) {
114
if (xnestDefaultDepth > 0) {
115
xnestUserDefaultDepth = True;
121
if (!strcmp(argv[i], "-sss")) {
122
xnestSoftwareScreenSaver = True;
125
if (!strcmp(argv[i], "-geometry")) {
127
xnestUserGeometry = XParseGeometry(argv[i],
129
&xnestWidth, &xnestHeight);
130
if (xnestUserGeometry) return 2;
134
if (!strcmp(argv[i], "-bw")) {
135
if (++i < argc && sscanf(argv[i], "%i", &xnestBorderWidth) == 1) {
136
if (xnestBorderWidth >= 0) {
137
xnestUserBorderWidth = True;
143
if (!strcmp(argv[i], "-name")) {
145
xnestWindowName = argv[i];
150
if (!strcmp(argv[i], "-scrns")) {
151
if (++i < argc && sscanf(argv[i], "%i", &xnestNumScreens) == 1) {
152
if (xnestNumScreens > 0) {
153
if (xnestNumScreens > MAXSCREENS) {
154
ErrorF("Maximum number of screens is %d.\n", MAXSCREENS);
155
xnestNumScreens = MAXSCREENS;
162
if (!strcmp(argv[i], "-install")) {
163
xnestDoDirectColormaps = True;
166
if (!strcmp(argv[i], "-parent")) {
168
xnestParentWindow = (XID) strtol (argv[i], (char**)NULL, 0);
177
ErrorF("-display string display name of the real server\n");
178
ErrorF("-sync sinchronize with the real server\n");
179
ErrorF("-full utilize full regeneration\n");
180
ErrorF("-class string default visual class\n");
181
ErrorF("-depth int default depth\n");
182
ErrorF("-sss use software screen saver\n");
183
ErrorF("-geometry WxH+X+Y window size and position\n");
184
ErrorF("-bw int window border width\n");
185
ErrorF("-name string window name\n");
186
ErrorF("-scrns int number of screens to generate\n");
187
ErrorF("-install instal colormaps directly\n");