From 7c4728f63395c3641aa62f2b549ee693eb8be978 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sun, 27 Jul 2003 22:41:06 +0000 Subject: [PATCH] split wxBase into wxBase and wxNet libraries git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22323 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- build/bakefiles/common.bkl | 3 + build/bakefiles/files.bkl | 118 ++++++++++++++++++++++++++------- build/bakefiles/monolithic.bkl | 2 +- build/bakefiles/multilib.bkl | 23 +++++++ build/bakefiles/wxwin.py | 4 +- include/wx/defs.h | 12 ++++ include/wx/filesys.h | 1 - include/wx/fs_inet.h | 2 +- include/wx/gsocket.h | 6 +- include/wx/protocol/file.h | 2 +- include/wx/protocol/ftp.h | 2 +- include/wx/protocol/http.h | 5 +- include/wx/protocol/protocol.h | 6 +- include/wx/sckaddr.h | 8 +-- include/wx/sckipc.h | 6 +- include/wx/sckstrm.h | 6 +- include/wx/socket.h | 10 +-- include/wx/url.h | 2 +- samples/html/test/test.bkl | 1 + samples/sockets/sockets.bkl | 2 + src/common/fs_zip.cpp | 4 +- 21 files changed, 168 insertions(+), 57 deletions(-) diff --git a/build/bakefiles/common.bkl b/build/bakefiles/common.bkl index 0f29c350e2..450525a16d 100644 --- a/build/bakefiles/common.bkl +++ b/build/bakefiles/common.bkl @@ -115,6 +115,9 @@ $(mk.evalExpr(wxwin.mkLibName('base'))) + + $(mk.evalExpr(wxwin.mkLibName('net'))) + $(mk.evalExpr(wxwin.mkLibName('core'))) diff --git a/build/bakefiles/files.bkl b/build/bakefiles/files.bkl index d9f031a353..335cab0a76 100644 --- a/build/bakefiles/files.bkl +++ b/build/bakefiles/files.bkl @@ -39,7 +39,6 @@ src/unix/baseunix.cpp src/unix/dir.cpp - src/unix/gsocket.c src/unix/mimetype.cpp src/unix/snglinst.cpp src/unix/threadpsx.cpp @@ -48,13 +47,10 @@ src/unix/utilsunx.cpp - wx/unix/gsockunx.h wx/unix/mimetype.h - src/msw/gsocket.c - src/msw/gsockmsw.c src/msw/basemsw.cpp src/msw/dde.cpp src/msw/dir.cpp @@ -85,7 +81,6 @@ src/unix/baseunix.cpp src/unix/dir.cpp - src/unix/gsocket.c src/unix/mimetype.cpp src/unix/snglinst.cpp src/unix/threadpsx.cpp @@ -99,7 +94,6 @@ src/unix/baseunix.cpp src/mac/dirmac.cpp - src/mac/gsocket.c src/mac/mimetmac.cpp src/mac/utils.cpp src/mac/utilsexc.cpp @@ -139,12 +133,9 @@ src/common/filename.cpp src/common/filesys.cpp src/common/fmapbase.cpp - src/common/fs_inet.cpp src/common/fs_zip.cpp - src/common/ftp.cpp src/common/hash.cpp src/common/hashmap.cpp - src/common/http.cpp src/common/init.cpp src/common/intl.cpp src/common/ipcbase.cpp @@ -157,13 +148,7 @@ src/common/mstream.cpp src/common/object.cpp src/common/process.cpp - src/common/protocol.cpp src/common/regex.cpp - src/common/sckaddr.cpp - src/common/sckfile.cpp - src/common/sckipc.cpp - src/common/sckstrm.cpp - src/common/socket.cpp src/common/stopwatch.cpp src/common/strconv.cpp src/common/stream.cpp @@ -174,7 +159,6 @@ src/common/tokenzr.cpp src/common/txtstrm.cpp src/common/unzip.c - src/common/url.cpp src/common/variant.cpp src/common/wfstream.cpp src/common/wxchar.cpp @@ -229,10 +213,8 @@ wx/filesys.h wx/fontenc.h wx/fontmap.h - wx/fs_inet.h wx/fs_zip.h wx/fs_mem.h - wx/gsocket.h wx/hash.h wx/hashmap.h wx/iconloc.h @@ -258,10 +240,6 @@ wx/platform.h wx/process.h wx/regex.h - wx/sckaddr.h - wx/sckipc.h - wx/sckstrm.h - wx/socket.h wx/snglinst.h wx/stopwatch.h wx/strconv.h @@ -274,7 +252,6 @@ wx/thrimpl.cpp wx/tokenzr.h wx/txtstrm.h - wx/url.h wx/utils.h wx/variant.h wx/vector.h @@ -286,8 +263,71 @@ wx/wxprec.h wx/zipstrm.h wx/zstream.h + + + + + + + + + src/unix/gsocket.c + + + wx/unix/gsockunx.h + + + + src/msw/gsocket.c + src/msw/gsockmsw.c + + + wx/msw/gsockmsw.h + + + + src/unix/gsocket.c + + + wx/unix/gsockunx.h + + + + src/mac/gsocket.c + + + wx/mac/gsockmac.h + + + + + + + + + src/common/fs_inet.cpp + src/common/ftp.cpp + src/common/http.cpp + src/common/protocol.cpp + src/common/url.cpp + src/common/sckfile.cpp + src/common/sckaddr.cpp + src/common/sckipc.cpp + src/common/sckstrm.cpp + src/common/socket.cpp + + + wx/fs_inet.h + wx/url.h wx/protocol/protocol.h wx/protocol/http.h + wx/protocol/ftp.h + wx/protocol/file.h + wx/gsocket.h + wx/sckaddr.h + wx/sckipc.h + wx/sckstrm.h + wx/socket.h @@ -2008,6 +2048,8 @@ + + $(BASE_MAC_SRC) @@ -2038,8 +2080,35 @@ $(BASE_AND_GUI_CMN_SRC) $(BASE_AND_GUI_PLATFORM_SRC) + + + + + $(NET_MAC_SRC) + $(NET_DARWIN_SRC) + $(NET_DARWIN_SRC) + + + + $(NET_UNIX_SRC) + $(NET_WIN32_SRC) + $(NET_MACOSX_SRC) + + + $(NET_UNIX_HDR) + $(NET_WIN32_HDR) + $(NET_MAC_HDR) + $(NET_DARWIN_HDR) + + + + $(NET_CMN_SRC) $(NET_PLATFORM_SRC) + + + + $(GTK_LOWLEVEL_SRC) $(MOTIF_LOWLEVEL_SRC) @@ -2060,7 +2129,7 @@ $(X11_LOWLEVEL_HDR) $(MGL_LOWLEVEL_HDR) - + $(GTK_SRC) $(MOTIF_SRC) @@ -2099,6 +2168,7 @@ $(BASE_CMN_HDR) $(BASE_PLATFORM_HDR) + $(NET_CMN_HDR) $(NET_PLATFORM_HDR) $(ALL_GUI_HEADERS) $(HTML_HDR) $(XML_HDR) $(OPENGL_HDR) diff --git a/build/bakefiles/monolithic.bkl b/build/bakefiles/monolithic.bkl index b59d87fac9..cd043384ac 100644 --- a/build/bakefiles/monolithic.bkl +++ b/build/bakefiles/monolithic.bkl @@ -6,7 +6,7 @@ $(CORE_SRC) $(HTML_SRC) - $(BASE_SRC) $(BASE_AND_GUI_SRC) $(MONOLIB_GUI_SRC) $(XML_SRC) + $(BASE_SRC) $(BASE_AND_GUI_SRC) $(NET_SRC) $(MONOLIB_GUI_SRC) $(XML_SRC) $(BASE_SRC) $(BASE_AND_GUI_SRC) $(BASE_CMN_HDR) $(BASE_PLATFORM_HDR) + + + + + + + + WXUSINGDLL + WXMAKINGDLL_NET + $(NET_SRC) + $(NET_CMN_HDR) $(NET_PLATFORM_HDR) + basedll + + + + WXUSINGDLL + WXMAKINGDLL_NET + $(NET_SRC) + $(NET_CMN_HDR) + + diff --git a/build/bakefiles/wxwin.py b/build/bakefiles/wxwin.py index 78c0162b00..df23f4c9cf 100644 --- a/build/bakefiles/wxwin.py +++ b/build/bakefiles/wxwin.py @@ -30,9 +30,9 @@ def mk_wxid(id): # All libs that are part of the main library (i.e. non-contrib): -MAIN_LIBS = ['mono', 'base', 'core', 'html', 'xml'] +MAIN_LIBS = ['mono', 'base', 'core', 'html', 'xml', 'net'] # List of library names/ids for categories with different names: -LIBS_NOGUI = ['xml'] +LIBS_NOGUI = ['xml', 'net'] LIBS_GUI = ['core', 'html', 'gl'] def mkLibName(wxid): diff --git a/include/wx/defs.h b/include/wx/defs.h index 87282cf375..06eff5caa1 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -395,6 +395,7 @@ typedef int wxWindowID; #define WXMAKINGDLL_BASE #endif + #define WXMAKINGDLL_NET #define WXMAKINGDLL_CORE #define WXMAKINGDLL_HTML #define WXMAKINGDLL_XML @@ -413,6 +414,17 @@ typedef int wxWindowID; #define WXDLLIMPEXP_DATA_BASE(type) type #endif +#ifdef WXMAKINGDLL_NET + #define WXDLLIMPEXP_NET WXEXPORT + #define WXDLLIMPEXP_DATA_NET(type) WXEXPORT type +#elif defined(WXUSINGDLL) + #define WXDLLIMPEXP_NET WXIMPORT + #define WXDLLIMPEXP_DATA_NET(type) WXIMPORT type +#else // not making nor using DLL + #define WXDLLIMPEXP_NET + #define WXDLLIMPEXP_DATA_NET(type) type +#endif + #ifdef WXMAKINGDLL_CORE #define WXDLLIMPEXP_CORE WXEXPORT #define WXDLLIMPEXP_DATA_CORE(type) WXEXPORT type diff --git a/include/wx/filesys.h b/include/wx/filesys.h index f714790185..8aca77fc89 100644 --- a/include/wx/filesys.h +++ b/include/wx/filesys.h @@ -27,7 +27,6 @@ #if wxUSE_FILESYSTEM #include "wx/stream.h" -#include "wx/url.h" #include "wx/datetime.h" #include "wx/filename.h" diff --git a/include/wx/fs_inet.h b/include/wx/fs_inet.h index e7340b8ab9..c2e9bc0e1e 100644 --- a/include/wx/fs_inet.h +++ b/include/wx/fs_inet.h @@ -39,7 +39,7 @@ limitation) // wxInternetFSHandler //-------------------------------------------------------------------------------- -class WXDLLIMPEXP_BASE wxInternetFSHandler : public wxFileSystemHandler +class WXDLLIMPEXP_NET wxInternetFSHandler : public wxFileSystemHandler { private: wxHashTable m_Cache; diff --git a/include/wx/gsocket.h b/include/wx/gsocket.h index 5cd91ae001..a03616a9fc 100644 --- a/include/wx/gsocket.h +++ b/include/wx/gsocket.h @@ -17,8 +17,8 @@ /* kludge for GTK.. gsockgtk.c craps out miserably if we include defs.h ... no idea how other files get away with it.. */ -#if !defined( __WXMSW__ ) && !defined( WXDLLEXPORT ) -#define WXDLLEXPORT +#if !defined( __WXMSW__ ) && !defined( WXDLLIMPEXP_NET ) +#define WXDLLIMPEXP_NET #endif #endif @@ -251,7 +251,7 @@ void GSocket_SetTimeout(GSocket *socket, unsigned long millisec); * operations do not clear this back to GSOCK_NOERROR, so use it only * after an error. */ -GSocketError WXDLLEXPORT GSocket_GetError(GSocket *socket); +GSocketError WXDLLIMPEXP_NET GSocket_GetError(GSocket *socket); /* Callbacks */ diff --git a/include/wx/protocol/file.h b/include/wx/protocol/file.h index b9474e44e5..f277beb912 100644 --- a/include/wx/protocol/file.h +++ b/include/wx/protocol/file.h @@ -23,7 +23,7 @@ #include "wx/protocol/protocol.h" #include "wx/url.h" -class WXDLLIMPEXP_BASE wxFileProto: public wxProtocol { +class WXDLLIMPEXP_NET wxFileProto: public wxProtocol { DECLARE_DYNAMIC_CLASS_NO_COPY(wxFileProto) DECLARE_PROTOCOL(wxFileProto) protected: diff --git a/include/wx/protocol/ftp.h b/include/wx/protocol/ftp.h index 9626397036..5356267702 100644 --- a/include/wx/protocol/ftp.h +++ b/include/wx/protocol/ftp.h @@ -25,7 +25,7 @@ #include "wx/protocol/protocol.h" #include "wx/url.h" -class WXDLLIMPEXP_BASE wxFTP : public wxProtocol +class WXDLLIMPEXP_NET wxFTP : public wxProtocol { public: enum TransferMode diff --git a/include/wx/protocol/http.h b/include/wx/protocol/http.h index 05ab817ac5..b3ee9a5384 100644 --- a/include/wx/protocol/http.h +++ b/include/wx/protocol/http.h @@ -18,9 +18,10 @@ #include "wx/hashmap.h" #include "wx/protocol/protocol.h" -WX_DECLARE_EXPORTED_STRING_HASH_MAP( wxString, wxStringToStringHashMap ); +WX_DECLARE_STRING_HASH_MAP_WITH_DECL( wxString, wxStringToStringHashMap, + class WXDLLIMPEXP_NET ); -class WXDLLIMPEXP_BASE wxHTTP : public wxProtocol +class WXDLLIMPEXP_NET wxHTTP : public wxProtocol { public: wxHTTP(); diff --git a/include/wx/protocol/protocol.h b/include/wx/protocol/protocol.h index 0e823616e0..aa119b09c4 100644 --- a/include/wx/protocol/protocol.h +++ b/include/wx/protocol/protocol.h @@ -50,7 +50,7 @@ typedef enum // wxProtocol: abstract base class for all protocols // ---------------------------------------------------------------------------- -class WXDLLIMPEXP_BASE wxProtocol +class WXDLLIMPEXP_NET wxProtocol #if wxUSE_SOCKETS : public wxSocketClient #else @@ -86,7 +86,7 @@ private: }; #if wxUSE_SOCKETS -wxProtocolError WXDLLIMPEXP_BASE GetLine(wxSocketBase *sock, wxString& result); +wxProtocolError WXDLLIMPEXP_NET GetLine(wxSocketBase *sock, wxString& result); #endif // ---------------------------------------------------------------------------- @@ -108,7 +108,7 @@ bool wxProtocolUse##class = TRUE; wxProtocolUserFor##class() { wxProtocolUse##class = TRUE; } \ } wxProtocolDoUse##class; -class WXDLLIMPEXP_BASE wxProtoInfo : public wxObject +class WXDLLIMPEXP_NET wxProtoInfo : public wxObject { public: wxProtoInfo(const wxChar *name, diff --git a/include/wx/sckaddr.h b/include/wx/sckaddr.h index adb67509b2..8e7067b086 100644 --- a/include/wx/sckaddr.h +++ b/include/wx/sckaddr.h @@ -24,7 +24,7 @@ #include "wx/gsocket.h" -class WXDLLIMPEXP_BASE wxSockAddress : public wxObject { +class WXDLLIMPEXP_NET wxSockAddress : public wxObject { DECLARE_ABSTRACT_CLASS(wxSockAddress) public: typedef enum { IPV4=1, IPV6=2, UNIX=3 } Addr; @@ -52,7 +52,7 @@ private: void Init(); }; -class WXDLLIMPEXP_BASE wxIPV4address : public wxSockAddress { +class WXDLLIMPEXP_NET wxIPV4address : public wxSockAddress { DECLARE_DYNAMIC_CLASS(wxIPV4address) public: wxIPV4address(); @@ -79,7 +79,7 @@ private: }; #ifdef ENABLE_IPV6 -class WXDLLIMPEXP_BASE wxIPV6address : public wxSockAddress { +class WXDLLIMPEXP_NET wxIPV6address : public wxSockAddress { DECLARE_DYNAMIC_CLASS(wxIPV6address) private: struct sockaddr_in6 *m_addr; @@ -108,7 +108,7 @@ public: # include #endif -class WXDLLIMPEXP_BASE wxUNIXaddress : public wxSockAddress { +class WXDLLIMPEXP_NET wxUNIXaddress : public wxSockAddress { DECLARE_DYNAMIC_CLASS(wxUNIXaddress) private: struct sockaddr_un *m_addr; diff --git a/include/wx/sckipc.h b/include/wx/sckipc.h index b61a28be59..0c159f1e54 100644 --- a/include/wx/sckipc.h +++ b/include/wx/sckipc.h @@ -53,10 +53,10 @@ * */ -class WXDLLIMPEXP_BASE wxTCPServer; -class WXDLLIMPEXP_BASE wxTCPClient; +class WXDLLIMPEXP_NET wxTCPServer; +class WXDLLIMPEXP_NET wxTCPClient; -class WXDLLIMPEXP_BASE wxTCPConnection: public wxConnectionBase +class WXDLLIMPEXP_NET wxTCPConnection: public wxConnectionBase { DECLARE_DYNAMIC_CLASS(wxTCPConnection) diff --git a/include/wx/sckstrm.h b/include/wx/sckstrm.h index de42898eac..af1785542e 100644 --- a/include/wx/sckstrm.h +++ b/include/wx/sckstrm.h @@ -21,7 +21,7 @@ #include "wx/socket.h" -class WXDLLIMPEXP_BASE wxSocketOutputStream : public wxOutputStream +class WXDLLIMPEXP_NET wxSocketOutputStream : public wxOutputStream { public: wxSocketOutputStream(wxSocketBase& s); @@ -40,7 +40,7 @@ class WXDLLIMPEXP_BASE wxSocketOutputStream : public wxOutputStream DECLARE_NO_COPY_CLASS(wxSocketOutputStream) }; -class WXDLLIMPEXP_BASE wxSocketInputStream : public wxInputStream +class WXDLLIMPEXP_NET wxSocketInputStream : public wxInputStream { public: wxSocketInputStream(wxSocketBase& s); @@ -59,7 +59,7 @@ class WXDLLIMPEXP_BASE wxSocketInputStream : public wxInputStream DECLARE_NO_COPY_CLASS(wxSocketInputStream) }; -class WXDLLIMPEXP_BASE wxSocketStream : public wxSocketInputStream, +class WXDLLIMPEXP_NET wxSocketStream : public wxSocketInputStream, public wxSocketOutputStream { public: diff --git a/include/wx/socket.h b/include/wx/socket.h index 965f39a921..b3ce8ced2c 100644 --- a/include/wx/socket.h +++ b/include/wx/socket.h @@ -105,7 +105,7 @@ typedef int wxSocketFlags; // wxSocketBase // -------------------------------------------------------------------------- -class WXDLLIMPEXP_BASE wxSocketBase : public wxObject +class WXDLLIMPEXP_NET wxSocketBase : public wxObject { DECLARE_CLASS(wxSocketBase) @@ -270,7 +270,7 @@ private: // wxSocketServer // -------------------------------------------------------------------------- -class WXDLLIMPEXP_BASE wxSocketServer : public wxSocketBase +class WXDLLIMPEXP_NET wxSocketServer : public wxSocketBase { DECLARE_CLASS(wxSocketServer) @@ -290,7 +290,7 @@ public: // wxSocketClient // -------------------------------------------------------------------------- -class WXDLLIMPEXP_BASE wxSocketClient : public wxSocketBase +class WXDLLIMPEXP_NET wxSocketClient : public wxSocketBase { DECLARE_CLASS(wxSocketClient) @@ -312,7 +312,7 @@ public: // WARNING: still in alpha stage -class WXDLLIMPEXP_BASE wxDatagramSocket : public wxSocketBase +class WXDLLIMPEXP_NET wxDatagramSocket : public wxSocketBase { DECLARE_CLASS(wxDatagramSocket) @@ -337,7 +337,7 @@ public: // wxSocketEvent // -------------------------------------------------------------------------- -class WXDLLIMPEXP_BASE wxSocketEvent : public wxEvent +class WXDLLIMPEXP_NET wxSocketEvent : public wxEvent { public: wxSocketEvent(int id = 0) diff --git a/include/wx/url.h b/include/wx/url.h index 0b2c56c9a6..09e5b8d52a 100644 --- a/include/wx/url.h +++ b/include/wx/url.h @@ -37,7 +37,7 @@ typedef enum { wxURL_PROTOERR } wxURLError; -class WXDLLIMPEXP_BASE wxURL : public wxObject +class WXDLLIMPEXP_NET wxURL : public wxObject { public: wxURL(const wxString& url); diff --git a/samples/html/test/test.bkl b/samples/html/test/test.bkl index cb0497e10f..cc108142e9 100644 --- a/samples/html/test/test.bkl +++ b/samples/html/test/test.bkl @@ -9,6 +9,7 @@ test.cpp html core + net base test.rc diff --git a/samples/sockets/sockets.bkl b/samples/sockets/sockets.bkl index 27bd0bc01e..e6d17d058a 100644 --- a/samples/sockets/sockets.bkl +++ b/samples/sockets/sockets.bkl @@ -6,6 +6,7 @@ client.cpp core + net base client.rc @@ -13,6 +14,7 @@ server.cpp core + net base server.rc diff --git a/src/common/fs_zip.cpp b/src/common/fs_zip.cpp index 3e879ecfdd..73f404a888 100644 --- a/src/common/fs_zip.cpp +++ b/src/common/fs_zip.cpp @@ -38,8 +38,8 @@ #include "unzip.h" #endif -WX_DECLARE_EXPORTED_HASH_MAP( long, long, wxIntegerHash, wxIntegerEqual, - wxLongToLongHashMap ); +WX_DECLARE_HASH_MAP_WITH_DECL( long, long, wxIntegerHash, wxIntegerEqual, + wxLongToLongHashMap, class WXDLLIMPEXP_BASE ); //---------------------------------------------------------------------------- // wxZipFSHandler -- 2.45.2