-// FIXME: can this go in private.h or something too??
-#if defined(__WXPM__) || defined(__EMX__)
-#define INCL_DOS
-#include <os2.h>
-#endif
-
-#ifdef __WXMSW__
-#include "wx/msw/private.h"
-#endif
-
-// Ugh, I'd much rather this was typesafe, but no time
-// to rewrite wxHashTable right now..
-
-typedef wxHashTable wxDLManifest;
-typedef wxHashTable wxDLImports;
-
-// ----------------------------------------------------------------------------
-// conditional compilation
-// ----------------------------------------------------------------------------
-
- // Note: WXPM/EMX has to be tested first, since we want to use
- // native version, even if configure detected presence of DLOPEN.
-
-#if defined(__WXPM__) || defined(__EMX__) || defined(__WINDOWS__)
-typedef HMODULE wxDllType;
-#elif defined(HAVE_DLOPEN)
-#include <dlfcn.h>
-typedef void *wxDllType;
-#elif defined(HAVE_SHL_LOAD)
-#include <dl.h>
-typedef shl_t wxDllType;
-#elif defined(__DARWIN__)
-typedef void *wxDllType;
-#elif defined(__WXMAC__)
-typedef CFragConnectionID wxDllType;
-#else
-#error "Dynamic Loading classes can't be compiled on this platform, sorry."
-#endif
-
-
-// ---------------------------------------------------------------------------
-// wxDynamicLibrary
-// ---------------------------------------------------------------------------
-
-//FIXME: This class isn't really common at all, it should be moved
-// into platform dependent files.
-
-// NOTE: this class is (deliberately) not virtual, do not attempt
-// to use it polymorphically.
-
-enum wxDLFlags
-{
- wxDL_LAZY = 0x00000001, // resolve undefined symbols at first use
- wxDL_NOW = 0x00000002, // resolve undefined symbols on load
- wxDL_GLOBAL = 0x00000004, // export extern symbols to subsequently
- // loaded libs.
- wxDL_VERBATIM = 0x00000008, // Attempt to load the supplied library
- // name without appending the usual dll
- // filename extension.
-#ifdef __osf__
- wxDL_DEFAULT = wxDL_LAZY
-#else
- wxDL_DEFAULT = wxDL_LAZY | wxDL_GLOBAL
-#endif
-};
-
-
-class WXDLLEXPORT wxDynamicLibrary
-{
-public:
-
- // return a valid handle for the main program itself or NULL if
- // back linking is not supported by the current platform (e.g. Win32)
-
- static wxDllType GetProgramHandle();
-
- // return the platform standard DLL extension (with leading dot)
-
- static const wxString &GetDllExt() { return ms_dllext; }
-
- wxDynamicLibrary() : m_handle(0) {}
- wxDynamicLibrary(wxString libname, int flags = wxDL_DEFAULT)
- : m_handle(0)
- {
- Load(libname, flags);
- }
- ~wxDynamicLibrary() { Unload(); }
-
- // return TRUE if the library was loaded successfully
-
- bool IsLoaded() const { return m_handle != 0; }
-
- // load the library with the given name
- // (full or not), return TRUE on success
-
- bool Load(wxString libname, int flags = wxDL_DEFAULT);
-
- // unload the library, also done automatically in dtor
-
- void Unload();