/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved. * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ // -=- VNC Viewer for Win32 #include #ifdef WIN32 #define strcasecmp _stricmp #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef _DIALOG_CAPTURE #include #endif using namespace rfb; using namespace rfb::win32; using namespace rdr; using namespace network; static LogWriter vlog("main"); TStr rfb::win32::AppName("VNC Viewer"); #ifdef _DIALOG_CAPTURE BoolParameter captureDialogs("CaptureDialogs", "", false); #endif // // -=- Listener // Class to handle listening on a particular port for incoming connections // from servers, and spawning of clients // static BoolParameter acceptIncoming("Listen", "Accept incoming connections from VNC servers.", false); // // -=- AboutDialog global values // const WORD rfb::win32::AboutDialog::DialogId = IDD_ABOUT; const WORD rfb::win32::AboutDialog::Copyright = IDC_COPYRIGHT; const WORD rfb::win32::AboutDialog::Version = IDC_VERSION; const WORD rfb::win32::AboutDialog::BuildTime = IDC_BUILDTIME; const WORD rfb::win32::AboutDialog::Description = IDC_DESCRIPTION; // // -=- processParams // Read in the command-line parameters and interpret them. // void programInfo() { win32::FileVersionInfo inf; _tprintf(_T("%s - %s, Version %s\n"), inf.getVerString(_T("ProductName")), inf.getVerString(_T("FileDescription")), inf.getVerString(_T("FileVersion"))); printf("%s\n", buildTime); _tprintf(_T("%s\n\n"), inf.getVerString(_T("LegalCopyright"))); } void programUsage() { printf("usage: vncviewer [:]\n"); printf("Command-line options:\n"); printf(" -help - Provide usage information.\n"); printf(" -config - Load connection settings from VNC Viewer 3.3 settings file\n"); printf(" -console - Run with a console window visible.\n"); printf(" = - Set the named configuration parameter.\n"); printf(" (Parameter values specified on the command-line override those specified by other configuration methods.)\n"); printf("\nLog names:\n"); LogWriter::listLogWriters(); printf("\nLog destinations:\n"); Logger::listLoggers(); printf("\nParameters:\n"); Configuration::listParams(ConfViewer); printf("Press Enter/Return key to continue\n"); getchar(); exit(1); } bool print_usage = false; bool close_console = true; std::list hosts; std::list configFiles; void processParams(int argc, char* argv[]) { Configuration::enableViewerParams(); for (int i=1; i=, or - if (Configuration::setParam(argv[i], true)) continue; // Try to process -