X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1948bb3274f2d39649c63b88f0e8781d0fc9b693..66c2bf7b1d9326fb650acfaae22ec50528cfbf7c:/include/wx/dynload.h diff --git a/include/wx/dynload.h b/include/wx/dynload.h index 7271c2ea8e..7cb4d25bac 100644 --- a/include/wx/dynload.h +++ b/include/wx/dynload.h @@ -1,11 +1,10 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: dynload.h +// Name: wx/dynload.h // Purpose: Dynamic loading framework // Author: Ron Lee, David Falkinder, Vadim Zeitlin and a cast of 1000's // (derived in part from dynlib.cpp (c) 1998 Guilhem Lavaux) // Modified by: // Created: 03/12/01 -// RCS-ID: $Id$ // Copyright: (c) 2001 Ron Lee // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -13,10 +12,6 @@ #ifndef _WX_DYNAMICLOADER_H__ #define _WX_DYNAMICLOADER_H__ -#if defined(__GNUG__) && !defined(__APPLE__) -#pragma interface "dynload.h" -#endif - // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- @@ -29,7 +24,7 @@ #include "wx/hashmap.h" #include "wx/module.h" -class WXDLLIMPEXP_BASE wxPluginLibrary; +class WXDLLIMPEXP_FWD_BASE wxPluginLibrary; WX_DECLARE_STRING_HASH_MAP_WITH_DECL(wxPluginLibrary *, wxDLManifest, @@ -75,7 +70,7 @@ public: void RefObj() { ++m_objcount; } void UnrefObj() { - wxASSERT_MSG( m_objcount > 0, _T("Too many objects deleted??") ); + wxASSERT_MSG( m_objcount > 0, wxT("Too many objects deleted??") ); --m_objcount; } @@ -86,19 +81,22 @@ public: private: - wxClassInfo *m_before; // sm_first before loading this lib - wxClassInfo *m_after; // ..and after. + // These pointers may be NULL but if they are not, then m_ourLast follows + // m_ourFirst in the linked list, i.e. can be found by calling GetNext() a + // sufficient number of times. + const wxClassInfo *m_ourFirst; // first class info in this plugin + const wxClassInfo *m_ourLast; // ..and the last one size_t m_linkcount; // Ref count of library link calls size_t m_objcount; // ..and (pluggable) object instantiations. wxModuleList m_wxmodules; // any wxModules that we initialised. - void UpdateClassInfo(); // Update the wxClassInfo table - void RestoreClassInfo(); // Restore the original wxClassInfo state. + void UpdateClasses(); // Update ms_classes + void RestoreClasses(); // Removes this library from ms_classes void RegisterModules(); // Init any wxModules in the lib. void UnregisterModules(); // Cleanup any wxModules we installed. - DECLARE_NO_COPY_CLASS(wxPluginLibrary) + wxDECLARE_NO_COPY_CLASS(wxPluginLibrary); }; @@ -112,21 +110,14 @@ public: int flags = wxDL_DEFAULT ); static bool UnloadLibrary(const wxString &libname); - // This is used by wxDllLoader. It's wrapped in the compatibility - // macro because it's of arguable use outside of that. - -#if WXWIN_COMPATIBILITY_2_2 - static wxPluginLibrary *GetObjectFromHandle(wxDllType handle); -#endif - // Instance methods. - wxPluginManager() : m_entry(NULL) {}; + wxPluginManager() : m_entry(NULL) {} wxPluginManager(const wxString &libname, int flags = wxDL_DEFAULT) { Load(libname, flags); } - ~wxPluginManager() { Unload(); } + ~wxPluginManager() { if ( IsLoaded() ) Unload(); } bool Load(const wxString &libname, int flags = wxDL_DEFAULT); void Unload(); @@ -155,7 +146,7 @@ private: // We could allow this class to be copied if we really // wanted to, but not without modification. - DECLARE_NO_COPY_CLASS(wxPluginManager) + wxDECLARE_NO_COPY_CLASS(wxPluginManager); };