X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/34138703c3997ce676a1e713d9ff9eb020640da7..de1359180540b5c5e11eddd4c3d08db4e38d59ea:/include/wx/dynlib.h diff --git a/include/wx/dynlib.h b/include/wx/dynlib.h index 428048ce14..ceecce4a58 100644 --- a/include/wx/dynlib.h +++ b/include/wx/dynlib.h @@ -8,53 +8,23 @@ #include #include #include +#include -// --------------------------------------------------------------------------- -// Some more info on a class - -typedef struct { - wxClassInfo *class_info; - wxString path; -} wxClassLibInfo; - -// --------------------------------------------------------------------------- -// Useful arrays - -WX_DEFINE_ARRAY(wxClassInfo *, wxArrayClassInfo); -WX_DEFINE_ARRAY(wxClassLibInfo *, wxArrayClassLibInfo); - -// --------------------------------------------------------------------------- -// wxClassLibrary - -class wxClassLibrary { -protected: - wxArrayClassLibInfo m_list; -public: - wxClassLibrary(void); - ~wxClassLibrary(void); - - // Dynamic (un)register a (new) class in the database - void RegisterClass(wxClassInfo *class_info, const wxString& path); - void UnregisterClass(wxClassInfo *class_info); - - // Fetch all infos whose name matches the string (wildcards allowed) - bool FetchInfos(const wxString& path, wxArrayClassLibInfo& infos); - - // Create all objects whose name matches the string (wildcards allowed) - bool CreateObjects(const wxString& path, wxArrayClassInfo& objs); - - // Create one object using the EXACT name - wxObject *CreateObject(const wxString& path); -}; +#ifdef LoadLibrary +#undef LoadLibrary +#endif // --------------------------------------------------------------------------- // wxLibrary class wxLibrary: public wxObject { -protected: - wxClassLibrary *m_liblist; + protected: void *m_handle; -public: + bool m_destroy; + public: + wxHashTable classTable; + + public: wxLibrary(void *handle); ~wxLibrary(void); @@ -64,16 +34,21 @@ public: // Create the object whose classname is "name" wxObject *CreateObject(const wxString& name); - wxClassLibrary *ClassLib() const; + // Merge the symbols with the main symbols: WARNING! the library will not + // be unloaded. + void MergeWithSystem(); + + protected: + void PrepareClasses(wxClassInfo *first); }; // --------------------------------------------------------------------------- // wxLibraries class wxLibraries { -protected: + protected: wxList m_loaded; -public: + public: wxLibraries(void); ~wxLibraries(void); @@ -89,7 +64,10 @@ extern wxLibraries wxTheLibraries; // --------------------------------------------------------------------------- // Interesting defines -#define WXDLL_ENTRY_FUNCTION() extern "C" wxClassLibrary *GetClassList() -#define WXDLL_EXIT_FUNCTION(param) extern "C" void FreeClassList(wxClassLibrary *param) +#define WXDLL_ENTRY_FUNCTION() \ +extern "C" wxClassInfo *wxGetClassFirst(); \ +wxClassInfo *wxGetClassFirst() { \ + return wxClassInfo::GetFirst(); \ +} #endif