]> source.dussan.org Git - tigervnc.git/commitdiff
Make winvnc4 and Windows vncconfig compilable via MinGW.
authorAdam Tkac <atkac@redhat.com>
Mon, 12 Oct 2009 15:54:59 +0000 (15:54 +0000)
committerAdam Tkac <atkac@redhat.com>
Mon, 12 Oct 2009 15:54:59 +0000 (15:54 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3913 3789f03b-4d11-0410-bbf8-ca57d06f2519

14 files changed:
configure.ac
win/Makefile.am
win/rfb_win32/CleanDesktop.cxx
win/rfb_win32/Makefile.am
win/vncconfig/Connections.h
win/vncconfig/Desktop.h
win/vncconfig/Legacy.cxx
win/vncconfig/Makefile.am [new file with mode: 0644]
win/vncviewer/Makefile.am
win/winvnc/JavaViewer.cxx
win/winvnc/Makefile.am [new file with mode: 0644]
win/winvnc/STrayIcon.cxx
win/winvnc/VNCServerWin32.cxx
win/winvnc/winvnc.rc

index 47091b4bb555677c61e5d841d3eb07bc34a0d510..f030412f9c268cd5d1a315dc8de66ee75acd7a32 100644 (file)
@@ -160,5 +160,7 @@ unix/vncpasswd/Makefile
 win/Makefile
 win/vncviewer/Makefile
 win/rfb_win32/Makefile
+win/vncconfig/Makefile
+win/winvnc/Makefile
 po/Makefile.in
 ])
index 945e4e8e2ebb8654dbbf242ea3c0152921f9a087..4aa1cdebb5131675bc5d042e071fd705cca00d94 100644 (file)
@@ -1,2 +1,3 @@
-SUBDIRS = rfb_win32 vncviewer
+SUBDIRS = rfb_win32 vncviewer vncconfig winvnc
 
+EXTRA_DIST = logmessages/messages.h
index 39cca1193cf5f057266821e4850e0d7ef43cfe29..60ea1597840a9a90182412d05d82df394b8ff322 100644 (file)
@@ -181,7 +181,7 @@ void CleanDesktop::disableWallpaper() {
     }
 
     // -=- Switch of normal wallpaper and notify apps
-    SysParamsInfo(SPI_SETDESKWALLPAPER, 0, "", SPIF_SENDCHANGE);
+    SysParamsInfo(SPI_SETDESKWALLPAPER, 0, (PVOID) "", SPIF_SENDCHANGE);
     restoreWallpaper = true;
 
   } catch (rdr::Exception& e) {
@@ -225,7 +225,7 @@ void CleanDesktop::disablePattern() {
     ImpersonateCurrentUser icu;
 
     vlog.debug("disable desktop pattern");
-    SysParamsInfo(SPI_SETDESKPATTERN, 0, "", SPIF_SENDCHANGE);
+    SysParamsInfo(SPI_SETDESKPATTERN, 0, (PVOID) "", SPIF_SENDCHANGE);
     restorePattern = true;
 
   } catch (rdr::Exception& e) {
index 7c5d1c54347953714b9bf585e46ad0b5405ce2e0..3d8545a93ab8383a308eaa874ef8edef4ace6c76 100644 (file)
@@ -55,12 +55,10 @@ HDRS = \
   WMShatter.h \
   WMWindowCopyRect.h
 
-
-##  CleanDesktop.cxx not built - MinGW does not provide COM
-
 librfb_win32_la_SOURCES = $(HDRS) \
   AboutDialog.cxx \
   CKeyboard.cxx \
+  CleanDesktop.cxx \
   Clipboard.cxx \
   CPointer.cxx \
   CurrentUser.cxx \
index 7512cc65cf5027e7dc5c78cc644580c033b830f8..209e4fd89db93c09eae177b87458e1e5b476d7b5 100644 (file)
@@ -62,7 +62,7 @@ namespace rfb {
         pattern.replaceBuf(0);
       }
       bool onOk() {
-        TCharArray host = getItemString(IDC_HOST_PATTERN);
+        TCharArray host(getItemString(IDC_HOST_PATTERN));
         TCharArray newPat(_tcslen(host.buf)+2);
         if (isItemChecked(IDC_ALLOW))
           newPat.buf[0] = _T('+');
@@ -248,8 +248,8 @@ namespace rfb {
       }
       bool isChanged() {
         try {
-          CharArray new_hosts = getHosts();
-          CharArray old_hosts = hosts.getData();
+          CharArray new_hosts(getHosts());
+          CharArray old_hosts(hosts.getData());
           return (strcmp(new_hosts.buf, old_hosts.buf) != 0) ||
               (localHost != isItemChecked(IDC_LOCALHOST)) ||
               (port_number != getItemInt(IDC_PORT)) ||
index 164269a298a80009616a1719ac8824dfeb765939..6479cb264989aef106bfdb85307cdf6ded41f312 100644 (file)
@@ -32,7 +32,7 @@ namespace rfb {
       DesktopPage(const RegKey& rk)
         : PropSheetPage(GetModuleHandle(0), MAKEINTRESOURCE(IDD_DESKTOP)), regKey(rk) {}
       void initDialog() {
-        CharArray action = rfb::win32::SDisplay::disconnectAction.getData();
+        CharArray action(rfb::win32::SDisplay::disconnectAction.getData());
         bool disconnectLock = stricmp(action.buf, "Lock") == 0;
         bool disconnectLogoff = stricmp(action.buf, "Logoff") == 0;
         typedef BOOL (WINAPI *_LockWorkStation_proto)();
@@ -59,7 +59,7 @@ namespace rfb {
         case IDC_REMOVE_WALLPAPER:
         case IDC_REMOVE_PATTERN:
         case IDC_DISABLE_EFFECTS:
-          CharArray action = rfb::win32::SDisplay::disconnectAction.getData();
+          CharArray action(rfb::win32::SDisplay::disconnectAction.getData());
           bool disconnectLock = stricmp(action.buf, "Lock") == 0;
           bool disconnectLogoff = stricmp(action.buf, "Logoff") == 0;
           setChanged((disconnectLogoff != isItemChecked(IDC_DISCONNECT_LOGOFF)) ||
index ae5d716655cd5c5ac12b4de0e64dfe26c204f796..f8c202807d668b92f702a86f78ace231ff7f7540 100644 (file)
@@ -71,7 +71,7 @@ void LegacyPage::LoadPrefs()
 
             // Reformat AuthHosts to Hosts.  Wish I'd left the format the same. :( :( :(
             try {
-              CharArray tmp = strDup(authHosts.buf);
+              CharArray tmp(authHosts.buf);
               while (tmp.buf) {
 
                 // Split the AuthHosts string into patterns to match
diff --git a/win/vncconfig/Makefile.am b/win/vncconfig/Makefile.am
new file mode 100644 (file)
index 0000000..17420b0
--- /dev/null
@@ -0,0 +1,20 @@
+bin_PROGRAMS = vncconfig\r
+\r
+HDRS = Authentication.h Connections.h Desktop.h Hooking.h Inputs.h Legacy.h \\r
+       PasswordDialog.h resource.h Sharing.h\r
+\r
+vncconfig_SOURCES = $(HDRS) Legacy.cxx PasswordDialog.cxx vncconfig.cxx\r
+\r
+vncconfig_CPPFLAGS = -I$(top_srcdir)/win -I$(top_srcdir)/common\r
+\r
+vncconfig_LDADD = $(top_srcdir)/win/rfb_win32/librfb_win32.la \\r
+       $(top_srcdir)/common/rfb/librfb.la \\r
+       $(top_srcdir)/common/Xregion/libXregion.la \\r
+       $(top_srcdir)/common/network/libnetwork.la \\r
+       $(top_srcdir)/common/rdr/librdr.la -lws2_32 -lgdi32 -lversion -lole32 \\r
+       -lcomctl32 resources.o\r
+\r
+EXTRA_DIST = connected.ico vncconfig.ico vncconfig.rc vncconfig.exe.manifest\r
+\r
+resources.o: vncconfig.rc\r
+       $(WINDRES) $^ -o $@\r
index 201f1e13b61b2e047c7a77e2451525d032bea36b..d58df378770f7e78c50a78152f45c9721e7ee2b0 100644 (file)
@@ -41,5 +41,8 @@ vncviewer_LDADD = $(top_srcdir)/common/rfb/librfb.la \
 
 vncviewer_LDFLAGS = -I$(top_srcdir)/win -mwindows
 
+EXTRA_DIST = vncviewer.rc vncviewer.ico cursor1.cur vncviewer.exe.manifest \
+       vncviewer.bmp toolbar.bmp
+
 resources.o: vncviewer.rc
        $(WINDRES) $^ -o $@
index 15c05c4697369127eb432bc71bcd8a3e99c993af..ca9c285f7a777f5d6faa6508e09c8b112645c615 100644 (file)
@@ -21,7 +21,7 @@
 #include <winvnc/resource.h>
 #include <rdr/MemInStream.h>
 #include <rfb/LogWriter.h>
-#include <rfb/VNCserverST.h>
+#include <rfb/VNCServerST.h>
 #include <rfb_win32/TCharArray.h>
 
 #define strcasecmp _stricmp
diff --git a/win/winvnc/Makefile.am b/win/winvnc/Makefile.am
new file mode 100644 (file)
index 0000000..da555fe
--- /dev/null
@@ -0,0 +1,27 @@
+bin_PROGRAMS = winvnc4\r
+\r
+HDRS = AddNewClientDialog.h ControlPanel.h JavaViewer.h ManagedListener.h \\r
+       QueryConnectDialog.h STrayIcon.h VNCServerService.h VNCServerWin32.h \\r
+       resource.h\r
+\r
+winvnc4_SOURCES = $(HDRS) buildTime.cxx ControlPanel.cxx JavaViewer.cxx \\r
+       ManagedListener.cxx QueryConnectDialog.cxx STrayIcon.cxx \\r
+       VNCServerService.cxx VNCServerWin32.cxx winvnc.cxx\r
+\r
+winvnc4_CPPFLAGS = -I$(top_srcdir)/common -I$(top_srcdir)/win\r
+\r
+winvnc4_LDADD = $(top_srcdir)/common/rfb/librfb.la \\r
+       $(top_srcdir)/win/rfb_win32/librfb_win32.la \\r
+       $(top_srcdir)/common/Xregion/libXregion.la \\r
+       $(top_srcdir)/common/network/libnetwork.la \\r
+       $(top_srcdir)/common/rdr/librdr.la resources.o -lws2_32 -lgdi32 \\r
+       -lole32 -lcomctl32 -lversion\r
+\r
+winvnc4_LDFLAGS = -mwindows\r
+\r
+EXTRA_DIST = winvnc.rc winvnc.ico connected.ico icon_dis.ico connecte.ico \\r
+       winvnc4.exe.manifest winvnc.bmp\r
+\r
+resources.o: winvnc.rc\r
+       $(WINDRES) $^ -o $@\r
+\r
index 0b10fa5b61c650c4f0e2224fee846a566fa1789e..354575ad8548d3191ec8fdd766b51071aae30708 100644 (file)
@@ -59,8 +59,9 @@ const WORD rfb::win32::AboutDialog::Description = IDC_DESCRIPTION;
 
 const UINT WM_SET_TOOLTIP = WM_USER + 1;
 
+namespace winvnc {
 
-class winvnc::STrayIcon : public TrayIcon {
+class STrayIcon : public TrayIcon {
 public:
   STrayIcon(STrayIconThread& t) : thread(t),
     vncConfig(_T("vncconfig.exe"), isServiceProcess() ? _T("-noconsole -service") : _T("-noconsole")),
@@ -183,7 +184,7 @@ public:
         switch (command->dwData) {
         case 1:
           {
-            CharArray viewer = new char[command->cbData + 1];
+            CharArray viewer(command->cbData + 1);
             memcpy(viewer.buf, command->lpData, command->cbData);
             viewer.buf[command->cbData] = 0;
             return thread.server.addNewClient(viewer.buf) ? 1 : 0;
@@ -277,4 +278,5 @@ void STrayIconThread::setToolTip(const TCHAR* text) {
   PostMessage(windowHandle, WM_SET_TOOLTIP, 0, 0);
 }
 
+}
 
index 9e8fa887962cce234d9d51b28bc0b721ad2821d2..cd0978b680b201d4c384aa4509067ff23005e35b 100644 (file)
@@ -112,7 +112,7 @@ void VNCServerWin32::processAddressChange(network::SocketListener* sock_) {
   _tcscpy(toolTip.buf, prefix);
   for (i=addrs.begin(); i!= addrs.end(); i=next_i) {
     next_i = i; next_i ++;
-    TCharArray addr = *i;    // Assumes ownership of string
+    TCharArray addr(*i);    // Assumes ownership of string
     _tcscat(toolTip.buf, addr.buf);
     if (next_i != addrs.end())
       _tcscat(toolTip.buf, _T(","));
index 56ce5986534219bd2da653f5b3dd63cbed13326a..db428db6fff3066b6fc1c76b6540b432c21aaae2 100644 (file)
@@ -9,6 +9,10 @@
 //
 #include "windows.h"
 
+#ifndef IDC_STATIC
+#define IDC_STATIC -1
+#endif
+
 /////////////////////////////////////////////////////////////////////////////
 #undef APSTUDIO_READONLY_SYMBOLS
 
@@ -210,8 +214,8 @@ END
 // HTTPFILE
 //
 
-/VNCVIEWER.JAR          HTTPFILE DISCARDABLE    "..\\..\\java\\src\\com\\tigervnc\\vncviewer\\VncViewer.jar"
-/INDEX.VNC              HTTPFILE DISCARDABLE    "index.vnc"
+//VNCVIEWER.JAR          HTTPFILE DISCARDABLE    "..\\..\\java\\src\\com\\tigervnc\\vncviewer\\VncViewer.jar"
+//INDEX.VNC              HTTPFILE DISCARDABLE    "index.vnc"
 
 /////////////////////////////////////////////////////////////////////////////
 //