You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

VncViewer.java 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586
  1. /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
  2. * Copyright 2011 Pierre Ossman <ossman@cendio.se> for Cendio AB
  3. * Copyright (C) 2011-2013 D. R. Commander. All Rights Reserved.
  4. * Copyright (C) 2011-2016 Brian P. Hinz
  5. *
  6. * This is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This software is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this software; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
  19. * USA.
  20. */
  21. //
  22. // VncViewer - the VNC viewer applet. It can also be run from the
  23. // command-line, when it behaves as much as possibly like the windows and unix
  24. // viewers.
  25. //
  26. // Unfortunately, because of the way Java classes are loaded on demand, only
  27. // configuration parameters defined in this file can be set from the command
  28. // line or in applet parameters.
  29. package com.tigervnc.vncviewer;
  30. import java.awt.*;
  31. import java.awt.event.*;
  32. import java.awt.Color;
  33. import java.awt.Graphics;
  34. import java.awt.Image;
  35. import java.io.BufferedReader;
  36. import java.io.InputStream;
  37. import java.io.InputStreamReader;
  38. import java.io.IOException;
  39. import java.io.File;
  40. import java.lang.Character;
  41. import java.lang.reflect.*;
  42. import java.net.URL;
  43. import java.nio.CharBuffer;
  44. import java.util.*;
  45. import java.util.jar.Attributes;
  46. import java.util.jar.Manifest;
  47. import javax.swing.*;
  48. import javax.swing.border.*;
  49. import javax.swing.plaf.FontUIResource;
  50. import javax.swing.SwingUtilities;
  51. import javax.swing.UIManager.*;
  52. import com.tigervnc.rdr.*;
  53. import com.tigervnc.rfb.*;
  54. import com.tigervnc.network.*;
  55. import static com.tigervnc.vncviewer.Parameters.*;
  56. public class VncViewer extends javax.swing.JApplet
  57. implements Runnable, ActionListener {
  58. public static final String aboutText =
  59. new String("TigerVNC Java Viewer v%s (%s)%n"+
  60. "Built on %s at %s%n"+
  61. "Copyright (C) 1999-2018 TigerVNC Team and many others (see README.rst)%n"+
  62. "See https://www.tigervnc.org for information on TigerVNC.");
  63. public static String version = null;
  64. public static String build = null;
  65. public static String buildDate = null;
  66. public static String buildTime = null;
  67. static ImageIcon frameIconSrc =
  68. new ImageIcon(VncViewer.class.getResource("tigervnc.ico"));
  69. public static final Image frameIcon = frameIconSrc.getImage();
  70. public static final ImageIcon logoIcon =
  71. new ImageIcon(VncViewer.class.getResource("tigervnc.png"));
  72. public static final Image logoImage = logoIcon.getImage();
  73. public static final InputStream timestamp =
  74. VncViewer.class.getResourceAsStream("timestamp");
  75. public static final String os =
  76. System.getProperty("os.name").toLowerCase(Locale.ENGLISH);
  77. private static VncViewer applet;
  78. private String defaultServerName;
  79. int VNCSERVERNAMELEN = 256;
  80. CharBuffer vncServerName = CharBuffer.allocate(VNCSERVERNAMELEN);
  81. public static void setLookAndFeel() {
  82. try {
  83. if (os.startsWith("mac os x")) {
  84. Class appClass = Class.forName("com.apple.eawt.Application");
  85. Method getApplication =
  86. appClass.getMethod("getApplication", (Class[])null);
  87. Object app = getApplication.invoke(appClass);
  88. Class paramTypes[] = new Class[1];
  89. paramTypes[0] = Image.class;
  90. Method setDockIconImage =
  91. appClass.getMethod("setDockIconImage", paramTypes);
  92. setDockIconImage.invoke(app, VncViewer.logoImage);
  93. }
  94. // Use Nimbus LookAndFeel if it's available, otherwise fallback
  95. // to the native laf, or Metal if no native laf is available.
  96. String laf = System.getProperty("swing.defaultlaf");
  97. if (laf == null) {
  98. LookAndFeelInfo[] installedLafs = UIManager.getInstalledLookAndFeels();
  99. for (int i = 0; i < installedLafs.length; i++) {
  100. if (installedLafs[i].getName().equals("Nimbus"))
  101. laf = installedLafs[i].getClassName();
  102. }
  103. if (laf == null)
  104. UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
  105. }
  106. UIManager.setLookAndFeel(laf);
  107. if (UIManager.getLookAndFeel().getName().equals("Metal")) {
  108. UIManager.put("swing.boldMetal", Boolean.FALSE);
  109. Enumeration<Object> keys = UIManager.getDefaults().keys();
  110. while (keys.hasMoreElements()) {
  111. Object key = keys.nextElement();
  112. Object value = UIManager.get(key);
  113. if (value instanceof FontUIResource) {
  114. String name = ((FontUIResource)value).getName();
  115. int style = ((FontUIResource)value).getStyle();
  116. int size = ((FontUIResource)value).getSize()-1;
  117. FontUIResource f = new FontUIResource(name, style, size);
  118. UIManager.put(key, f);
  119. }
  120. }
  121. } else if (UIManager.getLookAndFeel().getName().equals("Nimbus")) {
  122. Font f = UIManager.getFont("TitledBorder.font");
  123. String name = f.getName();
  124. int style = f.getStyle();
  125. int size = f.getSize()-2;
  126. FontUIResource r = new FontUIResource(name, style, size);
  127. UIManager.put("TitledBorder.font", r);
  128. }
  129. } catch (java.lang.Exception e) {
  130. vlog.info(e.toString());
  131. }
  132. }
  133. public static void main(String[] argv) {
  134. setLookAndFeel();
  135. VncViewer viewer = new VncViewer(argv);
  136. viewer.start();
  137. }
  138. public VncViewer() {
  139. // Only called in applet mode
  140. this(new String[0]);
  141. }
  142. public VncViewer(String[] argv) {
  143. SecurityClient.setDefaults();
  144. // Write about text to console, still using normal locale codeset
  145. getTimestamp();
  146. System.err.format("%n");
  147. System.err.format(aboutText, version, build, buildDate, buildTime);
  148. System.err.format("%n");
  149. Configuration.enableViewerParams();
  150. /* Load the default parameter settings */
  151. try {
  152. defaultServerName = loadViewerParameters(null);
  153. } catch (com.tigervnc.rfb.Exception e) {
  154. defaultServerName = "";
  155. vlog.info(e.getMessage());
  156. }
  157. // Override defaults with command-line options
  158. int i = 0;
  159. for (; i < argv.length; i++) {
  160. if (argv[i].length() == 0)
  161. continue;
  162. if (argv[i].equalsIgnoreCase("-config")) {
  163. if (++i >= argv.length)
  164. usage();
  165. defaultServerName = loadViewerParameters(argv[i]);
  166. continue;
  167. }
  168. if (argv[i].equalsIgnoreCase("-log")) {
  169. if (++i >= argv.length) usage();
  170. System.err.println("Log setting: "+argv[i]);
  171. LogWriter.setLogParams(argv[i]);
  172. continue;
  173. }
  174. if (argv[i].charAt(0) == '-') {
  175. if (i+1 < argv.length) {
  176. if (Configuration.setParam(argv[i].substring(1), argv[i+1])) {
  177. i++;
  178. continue;
  179. }
  180. }
  181. if (Configuration.setParam(argv[i]))
  182. continue;
  183. usage();
  184. }
  185. vncServerName.put(argv[i].toCharArray()).flip();
  186. }
  187. // Check if the server name in reality is a configuration file
  188. potentiallyLoadConfigurationFile(vncServerName);
  189. }
  190. public static void usage() {
  191. String usage = ("\nusage: vncviewer [options/parameters] "+
  192. "[host:displayNum]\n"+
  193. " vncviewer [options/parameters] -listen [port] "+
  194. "[options/parameters]\n"+
  195. " vncviewer [options/parameters] [.tigervnc file]\n"+
  196. "\n"+
  197. "Options:\n"+
  198. " -log <level> configure logging level\n"+
  199. "\n"+
  200. "Parameters can be turned on with -<param> or off with "+
  201. "-<param>=0\n"+
  202. "Parameters which take a value can be specified as "+
  203. "-<param> <value>\n"+
  204. "Other valid forms are <param>=<value> -<param>=<value> "+
  205. "--<param>=<value>\n"+
  206. "Parameter names are case-insensitive. The parameters "+
  207. "are:\n"+
  208. "\n");
  209. System.err.print(usage);
  210. Configuration.listParams(79, 14);
  211. String propertiesString = ("\n"+
  212. "System Properties (adapted from the TurboVNC vncviewer man page)\n"+
  213. " When started with the -via option, vncviewer reads the VNC_VIA_CMD\n"+
  214. " System property, expands patterns beginning with the \"%\" character,\n"+
  215. " and uses the resulting command line to establish the secure tunnel\n"+
  216. " to the VNC gateway. If VNC_VIA_CMD is not set, this command line\n"+
  217. " defaults to \"/usr/bin/ssh -f -L %L:%H:%R %G sleep 20\".\n"+
  218. "\n"+
  219. " The following patterns are recognized in the VNC_VIA_CMD property\n"+
  220. " (note that all of the patterns %G, %H, %L and %R must be present in \n"+
  221. " the command template):\n"+
  222. "\n"+
  223. " \t%% A literal \"%\";\n"+
  224. "\n"+
  225. " \t%G gateway machine name;\n"+
  226. "\n"+
  227. " \t%H remote VNC machine name, (as known to the gateway);\n"+
  228. "\n"+
  229. " \t%L local TCP port number;\n"+
  230. "\n"+
  231. " \t%R remote TCP port number.\n"+
  232. "\n"+
  233. " When started with the -tunnel option, vncviewer reads the VNC_TUNNEL_CMD\n"+
  234. " System property, expands patterns beginning with the \"%\" character, and\n"+
  235. " uses the resulting command line to establish the secure tunnel to the\n"+
  236. " VNC server. If VNC_TUNNEL_CMD is not set, this command line defaults\n"+
  237. " to \"/usr/bin/ssh -f -L %L:localhost:%R %H sleep 20\".\n"+
  238. "\n"+
  239. " The following patterns are recognized in the VNC_TUNNEL_CMD property\n"+
  240. " (note that all of the patterns %H, %L and %R must be present in \n"+
  241. " the command template):\n"+
  242. "\n"+
  243. " \t%% A literal \"%\";\n"+
  244. "\n"+
  245. " \t%H remote VNC machine name (as known to the client);\n"+
  246. "\n"+
  247. " \t%L local TCP port number;\n"+
  248. "\n"+
  249. " \t%R remote TCP port number.\n"+
  250. "\n");
  251. System.err.print(propertiesString);
  252. // Technically, we shouldn't use System.exit here but if there is a parameter
  253. // error then the problem is in the index/html file anyway.
  254. System.exit(1);
  255. }
  256. public static void potentiallyLoadConfigurationFile(CharBuffer vncServerName) {
  257. String serverName = vncServerName.toString();
  258. boolean hasPathSeparator = (serverName.indexOf('/') != -1 ||
  259. (serverName.indexOf('\\')) != -1);
  260. if (hasPathSeparator) {
  261. try {
  262. serverName = loadViewerParameters(vncServerName.toString());
  263. if (serverName == "") {
  264. vlog.info("Unable to load the server name from given file");
  265. System.exit(1);
  266. }
  267. vncServerName.clear();
  268. vncServerName.put(serverName).flip();
  269. } catch (com.tigervnc.rfb.Exception e) {
  270. vlog.info(e.getMessage());
  271. System.exit(1);
  272. }
  273. }
  274. }
  275. public static void newViewer() {
  276. String cmd = "java -jar ";
  277. try {
  278. URL url =
  279. VncViewer.class.getProtectionDomain().getCodeSource().getLocation();
  280. File f = new File(url.toURI());
  281. if (!f.exists() || !f.canRead()) {
  282. String msg = new String("The jar file "+f.getAbsolutePath()+
  283. " does not exist or cannot be read.");
  284. JOptionPane.showMessageDialog(null, msg, "ERROR",
  285. JOptionPane.ERROR_MESSAGE);
  286. return;
  287. }
  288. cmd = cmd.concat(f.getAbsolutePath());
  289. Thread t = new Thread(new ExtProcess(cmd, vlog));
  290. t.start();
  291. } catch (java.net.URISyntaxException e) {
  292. vlog.info(e.getMessage());
  293. } catch (java.lang.Exception e) {
  294. vlog.info(e.getMessage());
  295. }
  296. }
  297. public boolean isAppletDragStart(MouseEvent e) {
  298. if(e.getID() == MouseEvent.MOUSE_DRAGGED) {
  299. // Drag undocking on Mac works, but introduces a host of
  300. // problems so disable it for now.
  301. if (os.startsWith("mac os x"))
  302. return false;
  303. else if (os.startsWith("windows"))
  304. return (e.getModifiersEx() & MouseEvent.ALT_DOWN_MASK) != 0;
  305. else
  306. return (e.getModifiersEx() & MouseEvent.SHIFT_DOWN_MASK) != 0;
  307. } else {
  308. return false;
  309. }
  310. }
  311. public void appletDragStarted() {
  312. embed.setParam(false);
  313. //cc.recreateViewport();
  314. JFrame f = (JFrame)JOptionPane.getFrameForComponent(this);
  315. // The default JFrame created by the drag event will be
  316. // visible briefly between appletDragStarted and Finished.
  317. if (f != null)
  318. f.setSize(0, 0);
  319. }
  320. public void appletDragFinished() {
  321. JFrame f = (JFrame)JOptionPane.getFrameForComponent(this);
  322. if (f != null)
  323. f.dispose();
  324. }
  325. public void setAppletCloseListener(ActionListener cl) {
  326. cc.setCloseListener(cl);
  327. }
  328. public void appletRestored() {
  329. cc.setCloseListener(null);
  330. }
  331. public static void setupEmbeddedFrame(JScrollPane sp) {
  332. InputMap im = sp.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
  333. int ctrlAltShiftMask = Event.SHIFT_MASK | Event.CTRL_MASK | Event.ALT_MASK;
  334. if (im != null) {
  335. im.put(KeyStroke.getKeyStroke(KeyEvent.VK_UP, ctrlAltShiftMask),
  336. "unitScrollUp");
  337. im.put(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, ctrlAltShiftMask),
  338. "unitScrollDown");
  339. im.put(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, ctrlAltShiftMask),
  340. "unitScrollLeft");
  341. im.put(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, ctrlAltShiftMask),
  342. "unitScrollRight");
  343. im.put(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, ctrlAltShiftMask),
  344. "scrollUp");
  345. im.put(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, ctrlAltShiftMask),
  346. "scrollDown");
  347. im.put(KeyStroke.getKeyStroke(KeyEvent.VK_HOME, ctrlAltShiftMask),
  348. "scrollLeft");
  349. im.put(KeyStroke.getKeyStroke(KeyEvent.VK_END, ctrlAltShiftMask),
  350. "scrollRight");
  351. }
  352. applet.getContentPane().removeAll();
  353. applet.getContentPane().add(sp);
  354. applet.validate();
  355. }
  356. public void init() {
  357. // Called right after zero-arg constructor in applet mode
  358. setLookAndFeel();
  359. setBackground(Color.white);
  360. applet = this;
  361. vncServerName.put(loadAppletParameters(applet).toCharArray()).flip();
  362. if (embed.getValue()) {
  363. fullScreen.setParam(false);
  364. remoteResize.setParam(false);
  365. maximize.setParam(false);
  366. scalingFactor.setParam("100");
  367. }
  368. setFocusTraversalKeysEnabled(false);
  369. addFocusListener(new FocusAdapter() {
  370. public void focusGained(FocusEvent e) {
  371. if (cc != null && cc.desktop != null)
  372. cc.desktop.viewport.requestFocusInWindow();
  373. }
  374. });
  375. Frame frame = (Frame)getFocusCycleRootAncestor();
  376. frame.setFocusTraversalKeysEnabled(false);
  377. frame.addWindowListener(new WindowAdapter() {
  378. // Transfer focus to scrollpane when browser receives it
  379. public void windowActivated(WindowEvent e) {
  380. if (cc != null && cc.desktop != null)
  381. cc.desktop.viewport.requestFocusInWindow();
  382. }
  383. public void windowDeactivated(WindowEvent e) {
  384. if (cc != null)
  385. cc.desktop.viewport.releaseDownKeys();
  386. }
  387. });
  388. }
  389. private static void getTimestamp() {
  390. if (version == null || build == null) {
  391. try {
  392. Manifest manifest = new Manifest(timestamp);
  393. Attributes attributes = manifest.getMainAttributes();
  394. version = attributes.getValue("Version");
  395. build = attributes.getValue("Build");
  396. buildDate = attributes.getValue("Package-Date");
  397. buildTime = attributes.getValue("Package-Time");
  398. } catch (java.lang.Exception e) { }
  399. }
  400. }
  401. public static void about_vncviewer(Container parent) {
  402. String pkgDate = "";
  403. String pkgTime = "";
  404. try {
  405. Manifest manifest = new Manifest(VncViewer.timestamp);
  406. Attributes attributes = manifest.getMainAttributes();
  407. pkgDate = attributes.getValue("Package-Date");
  408. pkgTime = attributes.getValue("Package-Time");
  409. } catch (java.lang.Exception e) { }
  410. Window fullScreenWindow = DesktopWindow.getFullScreenWindow();
  411. if (fullScreenWindow != null)
  412. DesktopWindow.setFullScreenWindow(null);
  413. String msg =
  414. String.format(VncViewer.aboutText, VncViewer.version, VncViewer.build,
  415. VncViewer.buildDate, VncViewer.buildTime);
  416. Object[] options = {"Close \u21B5"};
  417. JOptionPane op =
  418. new JOptionPane(msg, JOptionPane.INFORMATION_MESSAGE,
  419. JOptionPane.DEFAULT_OPTION, VncViewer.logoIcon, options);
  420. JDialog dlg = op.createDialog(parent, "About TigerVNC Viewer for Java");
  421. dlg.setIconImage(VncViewer.frameIcon);
  422. dlg.setAlwaysOnTop(true);
  423. dlg.setVisible(true);
  424. if (fullScreenWindow != null)
  425. DesktopWindow.setFullScreenWindow(fullScreenWindow);
  426. }
  427. public void start() {
  428. (new Thread(this, "VncViewer Thread")).start();
  429. }
  430. public void exit(int n) {
  431. if (embed.getValue())
  432. destroy();
  433. else
  434. System.exit(n);
  435. }
  436. // If "Reconnect" button is pressed
  437. public void actionPerformed(ActionEvent e) {
  438. getContentPane().removeAll();
  439. start();
  440. }
  441. void reportException(java.lang.Exception e) {
  442. String title, msg = e.getMessage();
  443. int msgType = JOptionPane.ERROR_MESSAGE;
  444. title = "TigerVNC Viewer : Error";
  445. e.printStackTrace();
  446. if (embed.getValue()) {
  447. getContentPane().removeAll();
  448. JLabel label = new JLabel("<html><center><b>" + title + "</b><p><i>" +
  449. msg + "</i></center></html>", JLabel.CENTER);
  450. label.setFont(new Font("Helvetica", Font.PLAIN, 24));
  451. label.setMaximumSize(new Dimension(getSize().width, 100));
  452. label.setVerticalAlignment(JLabel.CENTER);
  453. label.setAlignmentX(Component.CENTER_ALIGNMENT);
  454. JButton button = new JButton("Reconnect");
  455. button.addActionListener(this);
  456. button.setMaximumSize(new Dimension(200, 30));
  457. button.setAlignmentX(Component.CENTER_ALIGNMENT);
  458. setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));
  459. add(label);
  460. add(button);
  461. validate();
  462. repaint();
  463. } else {
  464. JOptionPane.showMessageDialog(null, msg, title, msgType);
  465. }
  466. }
  467. public void run() {
  468. cc = null;
  469. UserDialog dlg = new UserDialog();
  470. CSecurity.upg = dlg;
  471. CSecurityTLS.msg = dlg;
  472. Socket sock = null;
  473. /* Specifying -via and -listen together is nonsense */
  474. if (listenMode.getValue() && !via.getValueStr().isEmpty()) {
  475. vlog.error("Parameters -listen and -via are incompatible");
  476. String msg =
  477. new String("Parameters -listen and -via are incompatible");
  478. JOptionPane.showMessageDialog(null, msg, "ERROR",
  479. JOptionPane.ERROR_MESSAGE);
  480. exit(1);
  481. }
  482. if (listenMode.getValue()) {
  483. int port = 5500;
  484. if (vncServerName.charAt(0) != 0 &&
  485. Character.isDigit(vncServerName.charAt(0)))
  486. port = Integer.parseInt(vncServerName.toString());
  487. TcpListener listener = null;
  488. try {
  489. listener = new TcpListener(null, port);
  490. } catch (java.lang.Exception e) {
  491. reportException(e);
  492. exit(1);
  493. }
  494. vlog.info("Listening on port "+port);
  495. while (sock == null)
  496. sock = listener.accept();
  497. } else {
  498. if (vncServerName.charAt(0) == 0) {
  499. try {
  500. SwingUtilities.invokeAndWait(
  501. new ServerDialog(defaultServerName, vncServerName));
  502. } catch (InvocationTargetException e) {
  503. reportException(e);
  504. } catch (InterruptedException e) {
  505. reportException(e);
  506. }
  507. if (vncServerName.charAt(0) == 0)
  508. exit(0);
  509. }
  510. }
  511. try {
  512. cc = new CConn(vncServerName.toString(), sock);
  513. while (!cc.shuttingDown)
  514. cc.processMsg();
  515. exit(0);
  516. } catch (java.lang.Exception e) {
  517. if (cc == null || !cc.shuttingDown) {
  518. reportException(e);
  519. if (cc != null)
  520. cc.close();
  521. } else if (embed.getValue()) {
  522. reportException(new java.lang.Exception("Connection closed"));
  523. exit(0);
  524. }
  525. exit(1);
  526. }
  527. }
  528. public static CConn cc;
  529. public static StringParameter config
  530. = new StringParameter("Config",
  531. "Specifies a configuration file to load.", null);
  532. static LogWriter vlog = new LogWriter("VncViewer");
  533. }