From 8a4df1595bc8ce70286afe99f122f64916790ad4 Mon Sep 17 00:00:00 2001
From: Robert Roebling <robert@roebling.de>
Date: Thu, 29 Jul 1999 19:52:37 +0000
Subject: [PATCH]   Now its possible to run wxHTML without wxSockets     if
 wxUSE_FS_ZIP = 1, wxUSE_HTML = 1   Fixed typo in filelist   Compile fix for
 spinbutton,

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3202 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 distrib/msw/tmake/filelist.txt  |  2 +-
 distrib/msw/tmake/g95.t         |  6 ++++++
 include/wx/fs_inet.h            |  4 ++++
 include/wx/fs_zip.h             |  5 +++++
 include/wx/protocol/protocol.h  | 17 +++++++++++++----
 include/wx/url.h                | 11 ++++++++++-
 samples/html/about/Makefile.g95 |  2 +-
 src/common/filesys.cpp          |  2 --
 src/common/fs_zip.cpp           |  5 -----
 src/common/protocol.cpp         | 16 ++++++++++++----
 src/common/sckfile.cpp          |  4 ----
 src/common/url.cpp              | 21 ++++++++++++++++-----
 src/gtk/Makefile                |  8 ++++----
 src/gtk1/Makefile               |  8 ++++----
 src/msw/button.cpp              |  1 +
 src/msw/choice.cpp              |  2 +-
 src/msw/makefile.g95            | 19 ++++++++++++++++++-
 src/msw/spinbutt.cpp            |  4 ++++
 18 files changed, 100 insertions(+), 37 deletions(-)

diff --git a/distrib/msw/tmake/filelist.txt b/distrib/msw/tmake/filelist.txt
index 5c0c4d48ce..7f94c0f039 100644
--- a/distrib/msw/tmake/filelist.txt
+++ b/distrib/msw/tmake/filelist.txt
@@ -314,7 +314,7 @@ mod_fonts.cpp	H
 mod_hline.cpp	H
 mod_image.cpp	H
 mod_layout.cpp	H
-mod_links.cpp 	H
+mod_links.cpp	H
 mod_list.cpp	H
 mod_pre.cpp	H
 mod_tables.cpp	H
diff --git a/distrib/msw/tmake/g95.t b/distrib/msw/tmake/g95.t
index 65243e90cc..bebd32bbff 100644
--- a/distrib/msw/tmake/g95.t
+++ b/distrib/msw/tmake/g95.t
@@ -45,6 +45,12 @@
         $file =~ s/cp?p?$/\$(OBJSUFF)/;
         $project{"WXMSWOBJS"} .= '$(MSWDIR)/' . $file . " "
     }
+
+    foreach $file (sort keys %wxHTML) {
+        $file =~ s/cp?p?$/\$(OBJSUFF)/;
+        $project{"WXHTMLOBJS"} .= '$(HTMLDIR)/' . $file . " "
+    }
+
 #$}
 # This file was automatically generated by tmake at #$ Now()
 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE G95.T!
diff --git a/include/wx/fs_inet.h b/include/wx/fs_inet.h
index 695bdb425f..a8ba0f52f9 100644
--- a/include/wx/fs_inet.h
+++ b/include/wx/fs_inet.h
@@ -29,6 +29,8 @@ limitation)
 #pragma hdrstop
 #endif
 
+#if wxUSE_FS_INET && wxUSE_STREAMS && wxUSE_SOCKETS
+
 #ifndef WXPRECOMP
 #include <wx/wx.h>
 #endif
@@ -52,4 +54,6 @@ class wxInternetFSHandler : public wxFileSystemHandler
         ~wxInternetFSHandler();
 };
 
+#endif
+  // wxUSE_FS_INET && wxUSE_STREAMS && wxUSE_SOCKETS
 
diff --git a/include/wx/fs_zip.h b/include/wx/fs_zip.h
index f0b481d78f..c0161fec70 100644
--- a/include/wx/fs_zip.h
+++ b/include/wx/fs_zip.h
@@ -17,6 +17,9 @@
 #pragma hdrstop
 #endif
 
+#if wxUSE_FS_ZIP && wxUSE_STREAMS
+
+
 #ifndef WXPRECOMP
 #include <wx/wx.h>
 #endif
@@ -38,4 +41,6 @@ class wxZipFSHandler : public wxFileSystemHandler
 };
 
 
+#endif
+  // wxUSE_FS_ZIP && wxUSE_STREAMS
 
diff --git a/include/wx/protocol/protocol.h b/include/wx/protocol/protocol.h
index ad3cf86f83..48bf1996af 100644
--- a/include/wx/protocol/protocol.h
+++ b/include/wx/protocol/protocol.h
@@ -17,12 +17,14 @@
 
 #include "wx/defs.h"
 
-#if wxUSE_SOCKETS
 
 #include "wx/object.h"
 #include "wx/string.h"
 #include "wx/stream.h"
+
+#if wxUSE_SOCKETS
 #include "wx/socket.h"
+#endif
 
 typedef enum {
  wxPROTO_NOERR = 0,
@@ -61,14 +63,21 @@ public:
               wxClassInfo *info);
 };
 
-class WXDLLEXPORT wxProtocol : public wxSocketClient {
+class WXDLLEXPORT wxProtocol
+#if wxUSE_SOCKETS
+ : public wxSocketClient {
+#else
+ : public wxObject {
+#endif
   DECLARE_ABSTRACT_CLASS(wxProtocol)
 public:
   wxProtocol();
 
+#if wxUSE_SOCKETS
   bool Reconnect();
   virtual bool Connect( const wxString& WXUNUSED(host) ) { return FALSE; }
   virtual bool Connect( wxSockAddress& addr, bool WXUNUSED(wait) = TRUE) { return wxSocketClient::Connect(addr); }
+#endif
 
   virtual bool Abort() = 0;
   virtual wxInputStream *GetInputStream(const wxString& path) = 0;
@@ -78,8 +87,8 @@ public:
   virtual void SetPassword(const wxString& WXUNUSED(passwd) ) {}
 };
 
+#if wxUSE_SOCKETS
 wxProtocolError WXDLLEXPORT GetLine(wxSocketBase *sock, wxString& result);
-
-#endif // wxUSE_SOCKETS
+#endif
 
 #endif // _WX_PROTOCOL_PROTOCOL_H
diff --git a/include/wx/url.h b/include/wx/url.h
index 66d974b449..0b145297ef 100644
--- a/include/wx/url.h
+++ b/include/wx/url.h
@@ -20,7 +20,10 @@
 
 // wxSocket headers
 #include "wx/protocol/protocol.h"
-#include "wx/protocol/http.h"
+
+#if wxUSE_SOCKETS
+  #include "wx/protocol/http.h"
+#endif
 
 typedef enum {
   wxURL_NOERR = 0,
@@ -36,10 +39,14 @@ class WXDLLEXPORT wxURL : public wxObject {
   DECLARE_DYNAMIC_CLASS(wxURL)
 protected:
   static wxProtoInfo *g_protocols;
+#if wxUSE_SOCKETS
   static wxHTTP *g_proxy;
+#endif
   wxProtoInfo *m_protoinfo;
   wxProtocol *m_protocol;
+#if wxUSE_SOCKETS
   wxHTTP *m_proxy;
+#endif
   wxURLError m_error;
   wxString m_protoname, m_hostname, m_servname, m_path, m_url;
   wxString m_user, m_password;
@@ -69,8 +76,10 @@ public:
 
   wxInputStream *GetInputStream();
 
+#if wxUSE_SOCKETS
   static void SetDefaultProxy(const wxString& url_proxy);
   void SetProxy(const wxString& url_proxy);
+#endif
 
   static wxString ConvertToValidURI(const wxString& uri);
 };
diff --git a/samples/html/about/Makefile.g95 b/samples/html/about/Makefile.g95
index 10e78a119d..bde3fb1700 100644
--- a/samples/html/about/Makefile.g95
+++ b/samples/html/about/Makefile.g95
@@ -7,7 +7,7 @@
 #
 # Makefile for wxWindows sample (Cygwin/Mingw32).
 
-WXDIR = $(WXWIN)
+WXDIR = ../../..
 
 TARGET=about
 OBJECTS = $(TARGET).o
diff --git a/src/common/filesys.cpp b/src/common/filesys.cpp
index 068024fa6a..503d691a03 100644
--- a/src/common/filesys.cpp
+++ b/src/common/filesys.cpp
@@ -17,9 +17,7 @@
 #endif
 
 #if !wxUSE_SOCKETS
-    #undef wxUSE_FS_ZIP
     #undef wxUSE_FS_INET
-    #define wxUSE_FS_ZIP 0
     #define wxUSE_FS_INET 0
 #endif
 
diff --git a/src/common/fs_zip.cpp b/src/common/fs_zip.cpp
index 56647fcd12..a77a338dff 100644
--- a/src/common/fs_zip.cpp
+++ b/src/common/fs_zip.cpp
@@ -17,11 +17,6 @@
 #pragma hdrstop
 #endif
 
-#if !wxUSE_SOCKETS
-    #undef wxUSE_FS_ZIP
-    #define wxUSE_FS_ZIP 0
-#endif
-
 #if wxUSE_FS_ZIP
 
 #ifndef WXPRECOMP
diff --git a/src/common/protocol.cpp b/src/common/protocol.cpp
index 1f5fb7adfd..c535c79258 100644
--- a/src/common/protocol.cpp
+++ b/src/common/protocol.cpp
@@ -20,8 +20,6 @@
   #pragma hdrstop
 #endif
 
-#if wxUSE_SOCKETS
-
 #include "wx/protocol/protocol.h"
 #include "wx/url.h"
 #include "wx/module.h"
@@ -53,13 +51,20 @@ wxProtoInfo::wxProtoInfo(const wxChar *name, const wxChar *serv,
 // wxProtocol ///////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////
 
+#if wxUSE_SOCKETS
 IMPLEMENT_ABSTRACT_CLASS(wxProtocol, wxSocketClient)
+#else
+IMPLEMENT_ABSTRACT_CLASS(wxProtocol, wxObject)
+#endif
 
 wxProtocol::wxProtocol()
+#if wxUSE_SOCKETS
  : wxSocketClient()
+#endif
 {
 }
 
+#if wxUSE_SOCKETS
 bool wxProtocol::Reconnect()
 {
   wxIPV4address addr;
@@ -109,6 +114,7 @@ wxProtocolError GetLine(wxSocketBase *sock, wxString& result) {
   return wxPROTO_NOERR;
 #undef PROTO_BSIZE
 }
+#endif
 
 // ----------------------------------------------------------------------
 // Module
@@ -128,6 +134,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxProtocolModule, wxModule)
 
 bool wxProtocolModule::OnInit()
 {
+#if wxUSE_SOCKETS
   char *env_http_prox;
 
   wxURL::g_proxy = NULL;
@@ -135,16 +142,17 @@ bool wxProtocolModule::OnInit()
   env_http_prox = getenv("HTTP_PROXY");
   if (env_http_prox)
     wxURL::SetDefaultProxy(env_http_prox);
+#endif
   
   return TRUE;
 }
 
 void wxProtocolModule::OnExit()
 {
+#if wxUSE_SOCKETS
   if (wxURL::g_proxy)
     delete wxURL::g_proxy;
   wxURL::g_proxy = NULL;
+#endif
 }
 
-#endif
-  // wxUSE_SOCKETS
diff --git a/src/common/sckfile.cpp b/src/common/sckfile.cpp
index 6c472fe224..7cfb56086c 100644
--- a/src/common/sckfile.cpp
+++ b/src/common/sckfile.cpp
@@ -23,8 +23,6 @@
   #include "wx/defs.h"
 #endif
 
-#if wxUSE_SOCKETS
-
 #include <stdio.h>
 #include <wx/wfstream.h>
 #include <wx/protocol/file.h>
@@ -48,5 +46,3 @@ wxInputStream *wxFileProto::GetInputStream(const wxString& path)
   return new wxFileInputStream(path);
 }
 
-#endif
-  // wxUSE_SOCKETS
diff --git a/src/common/url.cpp b/src/common/url.cpp
index 307bf7627f..db4517e3d9 100644
--- a/src/common/url.cpp
+++ b/src/common/url.cpp
@@ -20,8 +20,6 @@
 #pragma hdrstop
 #endif
 
-#if wxUSE_SOCKETS
-
 #include <string.h>
 #include <ctype.h>
 
@@ -37,7 +35,10 @@ IMPLEMENT_CLASS(wxURL, wxObject)
 
 // Protocols list
 wxProtoInfo *wxURL::g_protocols = NULL;
+
+#if wxUSE_SOCKETS
 wxHTTP *wxURL::g_proxy = NULL;
+#endif
 
 // --------------------------------------------------------------
 // wxURL
@@ -52,8 +53,10 @@ wxURL::wxURL(const wxString& url)
   m_protocol = NULL;
   m_error = wxURL_NOERR;
   m_url = url;
+#if wxUSE_SOCKETS
   m_useProxy = (g_proxy != NULL);
   m_proxy = g_proxy;
+#endif
   ParseURL();
 }
 
@@ -96,6 +99,7 @@ bool wxURL::ParseURL()
   }
   // URL parse finished.
 
+#if wxUSE_SOCKETS
   if (m_useProxy) {
     // We destroy the newly created protocol.
     CleanData();
@@ -110,6 +114,7 @@ bool wxURL::ParseURL()
     // We initialize specific variables.
     m_protocol = m_proxy; // FIXME: we should clone the protocol
   }
+#endif
 
   m_error = wxURL_NOERR;
   return TRUE;
@@ -117,15 +122,19 @@ bool wxURL::ParseURL()
 
 void wxURL::CleanData()
 {
+#if wxUSE_SOCKETS
   if (!m_useProxy)
+#endif
     delete m_protocol;
 }
 
 wxURL::~wxURL()
 {
   CleanData();
+#if wxUSE_SOCKETS
   if (m_proxy && m_proxy != g_proxy)
     delete m_proxy;
+#endif
 }
 
 // --------------------------------------------------------------
@@ -233,7 +242,6 @@ bool wxURL::FetchProtocol()
 
 wxInputStream *wxURL::GetInputStream(void)
 {
-  wxIPV4address addr;
   wxInputStream *the_i_stream = NULL;
 
   if (!m_protocol) {
@@ -247,6 +255,7 @@ wxInputStream *wxURL::GetInputStream(void)
     m_protocol->SetPassword(m_password);
   }
 
+#if wxUSE_SOCKETS
   // m_protoinfo is NULL when we use a proxy
   if (!m_useProxy && m_protoinfo->m_needhost) {
     if (!addr.Hostname(m_hostname)) {
@@ -254,6 +263,7 @@ wxInputStream *wxURL::GetInputStream(void)
       return NULL;
     }
 
+    wxIPV4address addr;
     addr.Service(m_servname);
 
     if (!m_protocol->Connect(addr, TRUE)) // Watcom needs the 2nd arg for some reason
@@ -262,6 +272,7 @@ wxInputStream *wxURL::GetInputStream(void)
       return NULL;
     }
   }
+#endif
 
   // When we use a proxy, we have to pass the whole URL to it.
   if (m_useProxy)
@@ -277,6 +288,7 @@ wxInputStream *wxURL::GetInputStream(void)
   return the_i_stream;
 }
 
+#if wxUSE_SOCKETS
 void wxURL::SetDefaultProxy(const wxString& url_proxy)
 {
   if (url_proxy.IsNull()) {
@@ -347,6 +359,7 @@ void wxURL::SetProxy(const wxString& url_proxy)
   m_useProxy = TRUE;
   ParseURL();
 }
+#endif
 
 wxString wxURL::ConvertToValidURI(const wxString& uri)
 {
@@ -371,5 +384,3 @@ wxString wxURL::ConvertToValidURI(const wxString& uri)
   return out_str;
 }
 
-#endif
-  // wxUSE_SOCKETS
diff --git a/src/gtk/Makefile b/src/gtk/Makefile
index 5d23867ff3..962c7d908b 100644
--- a/src/gtk/Makefile
+++ b/src/gtk/Makefile
@@ -1,9 +1,9 @@
 
-# This file was automatically generated by tmake at 03:16, 1999/07/29
-# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE GNU.T!
+# This file was automatically generated by tmake at 21:49, 1999/07/29
+# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE GTK.T!
 
 #
-# File:     makefile.gnu
+# File:     Makefile
 # Author:   Julian Smart, Robert Roebling, Vadim Zeitlin
 # Created:  1993
 # Updated:  1999
@@ -148,7 +148,7 @@ HTMLOBJS = \
 		$(HTMLDIR)/mod_hline.$(OBJSUFF) \
 		$(HTMLDIR)/mod_image.$(OBJSUFF) \
 		$(HTMLDIR)/mod_layout.$(OBJSUFF) \
-		$(HTMLDIR)/mod_links.cpp \
+		$(HTMLDIR)/mod_links.$(OBJSUFF) \
 		$(HTMLDIR)/mod_list.$(OBJSUFF) \
 		$(HTMLDIR)/mod_pre.$(OBJSUFF) \
 		$(HTMLDIR)/mod_tables.$(OBJSUFF) \
diff --git a/src/gtk1/Makefile b/src/gtk1/Makefile
index 5d23867ff3..962c7d908b 100644
--- a/src/gtk1/Makefile
+++ b/src/gtk1/Makefile
@@ -1,9 +1,9 @@
 
-# This file was automatically generated by tmake at 03:16, 1999/07/29
-# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE GNU.T!
+# This file was automatically generated by tmake at 21:49, 1999/07/29
+# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE GTK.T!
 
 #
-# File:     makefile.gnu
+# File:     Makefile
 # Author:   Julian Smart, Robert Roebling, Vadim Zeitlin
 # Created:  1993
 # Updated:  1999
@@ -148,7 +148,7 @@ HTMLOBJS = \
 		$(HTMLDIR)/mod_hline.$(OBJSUFF) \
 		$(HTMLDIR)/mod_image.$(OBJSUFF) \
 		$(HTMLDIR)/mod_layout.$(OBJSUFF) \
-		$(HTMLDIR)/mod_links.cpp \
+		$(HTMLDIR)/mod_links.$(OBJSUFF) \
 		$(HTMLDIR)/mod_list.$(OBJSUFF) \
 		$(HTMLDIR)/mod_pre.$(OBJSUFF) \
 		$(HTMLDIR)/mod_tables.$(OBJSUFF) \
diff --git a/src/msw/button.cpp b/src/msw/button.cpp
index 9368423350..307fad45d9 100644
--- a/src/msw/button.cpp
+++ b/src/msw/button.cpp
@@ -31,6 +31,7 @@
     #include "wx/button.h"
     #include "wx/brush.h"
     #include "wx/panel.h"
+    #include "wx/bmpbuttn.h"
 #endif
 
 #include "wx/msw/private.h"
diff --git a/src/msw/choice.cpp b/src/msw/choice.cpp
index 92cab89387..a40148b58b 100644
--- a/src/msw/choice.cpp
+++ b/src/msw/choice.cpp
@@ -186,7 +186,7 @@ void* wxChoice::DoGetClientData( int n ) const
         wxLogLastError(_T("CB_GETITEMDATA"));
 
         // unfortunately, there is no way to return an error code to the user
-        rc = NULL;
+	rc = (LPARAM) NULL;
     }
 
     return (void *)rc;
diff --git a/src/msw/makefile.g95 b/src/msw/makefile.g95
index 67e34debb1..63fa7dc63f 100644
--- a/src/msw/makefile.g95
+++ b/src/msw/makefile.g95
@@ -1,5 +1,5 @@
 
-# This file was automatically generated by tmake at 02:15, 1999/07/29
+# This file was automatically generated by tmake at 21:49, 1999/07/29
 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE G95.T!
 
 #
@@ -138,6 +138,23 @@ COMMONOBJS  = \
 		$(COMMDIR)/zstream.$(OBJSUFF)
 
 HTMLOBJS = \
+                $(HTMLDIR)/htmlcell.$(OBJSUFF) \
+		$(HTMLDIR)/htmlfilter.$(OBJSUFF) \
+		$(HTMLDIR)/htmlhelp.$(OBJSUFF) \
+		$(HTMLDIR)/htmlhelp_io.$(OBJSUFF) \
+		$(HTMLDIR)/htmlparser.$(OBJSUFF) \
+		$(HTMLDIR)/htmltag.$(OBJSUFF) \
+		$(HTMLDIR)/htmlwin.$(OBJSUFF) \
+		$(HTMLDIR)/htmlwinparser.$(OBJSUFF) \
+		$(HTMLDIR)/mod_fonts.$(OBJSUFF) \
+		$(HTMLDIR)/mod_hline.$(OBJSUFF) \
+		$(HTMLDIR)/mod_image.$(OBJSUFF) \
+		$(HTMLDIR)/mod_layout.$(OBJSUFF) \
+		$(HTMLDIR)/mod_links.$(OBJSUFF) \
+		$(HTMLDIR)/mod_list.$(OBJSUFF) \
+		$(HTMLDIR)/mod_pre.$(OBJSUFF) \
+		$(HTMLDIR)/mod_tables.$(OBJSUFF) \
+		$(HTMLDIR)/search.$(OBJSUFF)
 
 MSWOBJS     = \
 		$(MSWDIR)/accel.$(OBJSUFF) \
diff --git a/src/msw/spinbutt.cpp b/src/msw/spinbutt.cpp
index 9f93deb0b6..86e07a7f84 100644
--- a/src/msw/spinbutt.cpp
+++ b/src/msw/spinbutt.cpp
@@ -150,6 +150,7 @@ bool wxSpinButton::MSWOnScroll(int orientation, WXWORD wParam,
 
 bool wxSpinButton::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
 {
+#ifndef __GNUWIN32__
     LPNMUPDOWN lpnmud = (LPNMUPDOWN)lParam;
 
     wxSpinEvent event(lpnmud->iDelta > 0 ? wxEVT_SCROLL_LINEUP
@@ -163,6 +164,9 @@ bool wxSpinButton::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
     *result = event.IsAllowed() ? 0 : 1;
 
     return processed;
+#else
+    return FALSE;
+#endif
 }
 
 bool wxSpinButton::MSWCommand(WXUINT cmd, WXWORD id)
-- 
2.47.2