f4a8c29f7a
* wxClassInfo::first = NULL after the hashtable is initialized * dynlib has been simplified. * Some fix in the serialization core and in wxObject::StoreObject()/LoadObject() * Updates in utils/serialize/sermain.cpp git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@645 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
70 lines
1.5 KiB
C++
70 lines
1.5 KiB
C++
#ifndef _WX_DYNLIB_H__
|
|
#define _WX_DYNLIB_H__
|
|
|
|
#ifdef __GNUG__
|
|
#pragma interface
|
|
#endif
|
|
|
|
#include <wx/string.h>
|
|
#include <wx/list.h>
|
|
#include <wx/dynarray.h>
|
|
#include <wx/hash.h>
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// wxLibrary
|
|
|
|
class wxLibrary: public wxObject {
|
|
protected:
|
|
void *m_handle;
|
|
bool m_destroy;
|
|
public:
|
|
wxHashTable classTable;
|
|
|
|
public:
|
|
wxLibrary(void *handle);
|
|
~wxLibrary(void);
|
|
|
|
// Get a symbol from the dynamic library
|
|
void *GetSymbol(const wxString& symbname);
|
|
|
|
// Create the object whose classname is "name"
|
|
wxObject *CreateObject(const wxString& name);
|
|
|
|
// 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:
|
|
wxList m_loaded;
|
|
public:
|
|
wxLibraries(void);
|
|
~wxLibraries(void);
|
|
|
|
wxLibrary *LoadLibrary(const wxString& name);
|
|
wxObject *CreateObject(const wxString& name);
|
|
};
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Global variables
|
|
|
|
extern wxLibraries wxTheLibraries;
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Interesting defines
|
|
|
|
#define WXDLL_ENTRY_FUNCTION() \
|
|
extern "C" wxClassInfo **wxGetClassFirst(); \
|
|
wxClassInfo **wxGetClassFirst() { \
|
|
return &wxClassInfo::first; \
|
|
}
|
|
|
|
#endif
|