1 | /************************************************************************ |
---|
2 | * |
---|
3 | * Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. |
---|
4 | * |
---|
5 | * This 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. |
---|
9 | * |
---|
10 | * This software 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. |
---|
14 | * |
---|
15 | * You should have received a copy of the GNU General Public License |
---|
16 | * along with this software; if not, write to the Free Software |
---|
17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
---|
18 | * USA. |
---|
19 | ************************************************************************/ |
---|
20 | |
---|
21 | /* |
---|
22 | * argsresources.c - deal with command-line args and resources. |
---|
23 | */ |
---|
24 | #include "vncviewer.h" |
---|
25 | |
---|
26 | |
---|
27 | void |
---|
28 | VNCViewer::GetArgsAndResources(int argc, char **argv) |
---|
29 | { |
---|
30 | int i; |
---|
31 | char *vncServerName; |
---|
32 | |
---|
33 | //encodingsString = strdup("tight copyrect"); |
---|
34 | //encodingsString = strdup("zlib copyrect"); |
---|
35 | //encodingsString = strdup("copyrect hextile"); |
---|
36 | //encodingsString = strdup("hextile corre rre raw copyrect"); |
---|
37 | //default : raw copyrect hextile corre rre |
---|
38 | encodingsString = strdup("tight hextile copyrect"); |
---|
39 | |
---|
40 | |
---|
41 | shareDesktop = True; |
---|
42 | viewOnly = False; |
---|
43 | fullScreen = False; |
---|
44 | |
---|
45 | //passwordFile = strdup("/home/luc/.vnc/passwd"); |
---|
46 | //passwordFile = strdup("/home/renambot/.vnc/passwd"); |
---|
47 | //passwordFile = strdup("passwd"); |
---|
48 | passwordFile = NULL; |
---|
49 | |
---|
50 | passwordDialog = False; |
---|
51 | useBGR233 = False; |
---|
52 | nColours = 256; |
---|
53 | useSharedColours = True; |
---|
54 | forceOwnCmap = False; |
---|
55 | forceTrueColour = False; |
---|
56 | requestedDepth = 0; |
---|
57 | wmDecorationWidth = 4; |
---|
58 | wmDecorationHeight = 24; |
---|
59 | popupButtonCount = 0; |
---|
60 | debug = False; |
---|
61 | rawDelay = 0; |
---|
62 | copyRectDelay = 0; |
---|
63 | bumpScrollTime = 25; |
---|
64 | bumpScrollPixels = 20; |
---|
65 | |
---|
66 | compressLevel = 6; |
---|
67 | qualityLevel = 4; |
---|
68 | useRemoteCursor = False; |
---|
69 | |
---|
70 | if (argc == 2) |
---|
71 | { |
---|
72 | vncServerName = argv[1]; |
---|
73 | |
---|
74 | if (vncServerName[0] == '-') |
---|
75 | { |
---|
76 | aLog("invalid command line argument\n"); |
---|
77 | exit(-1); |
---|
78 | } |
---|
79 | } |
---|
80 | |
---|
81 | if (strlen(vncServerName) > 255) |
---|
82 | aError("VNC server name too long\n"); |
---|
83 | |
---|
84 | for (i = 0; vncServerName[i] != ':' && vncServerName[i] != 0; i++); |
---|
85 | |
---|
86 | memset(vncServerHost, 0, 256); |
---|
87 | strncpy(vncServerHost, vncServerName, i); |
---|
88 | |
---|
89 | if (vncServerName[i] == ':') |
---|
90 | vncServerPort = atoi(&vncServerName[i+1]); |
---|
91 | else |
---|
92 | vncServerPort = 0; |
---|
93 | |
---|
94 | if (vncServerPort < 100) |
---|
95 | vncServerPort += SERVER_PORT_OFFSET; |
---|
96 | } |
---|