]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/dynlib.h
__WINCE__ -> __WXWINCE__
[wxWidgets.git] / include / wx / dynlib.h
index d718cb6b9a1596ff547471145975e41a2b895b64..03da571c63f32de2aab7c0920935eae569044341 100644 (file)
@@ -12,7 +12,7 @@
 #ifndef _WX_DYNLIB_H__
 #define _WX_DYNLIB_H__
 
 #ifndef _WX_DYNLIB_H__
 #define _WX_DYNLIB_H__
 
-#if defined(__GNUG__) && !defined(__APPLE__)
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #   pragma interface "dynlib.h"
 #endif
 
 #   pragma interface "dynlib.h"
 #endif
 
@@ -49,6 +49,7 @@
 #elif defined(__DARWIN__)
     typedef void               *wxDllType;
 #elif defined(__WXMAC__)
 #elif defined(__DARWIN__)
     typedef void               *wxDllType;
 #elif defined(__WXMAC__)
+    #include <CodeFragments.h>
     typedef CFragConnectionID   wxDllType;
 #else
     #error "Dynamic Loading classes can't be compiled on this platform, sorry."
     typedef CFragConnectionID   wxDllType;
 #else
     #error "Dynamic Loading classes can't be compiled on this platform, sorry."
@@ -130,7 +131,7 @@ public:
     //       to use it polymorphically.
     ~wxDynamicLibrary() { Unload(); }
 
     //       to use it polymorphically.
     ~wxDynamicLibrary() { Unload(); }
 
-    // return TRUE if the library was loaded successfully
+    // 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 if ok
     bool IsLoaded() const { return m_handle != 0; }
 
     // load the library with the given name (full or not), return true if ok
@@ -141,8 +142,11 @@ public:
     // doing this
     wxDllType Detach() { wxDllType h = m_handle; m_handle = 0; return h; }
 
     // doing this
     wxDllType Detach() { wxDllType h = m_handle; m_handle = 0; return h; }
 
+    // unload the given library handle (presumably returned by Detach() before)
+    static void Unload(wxDllType handle);
+
     // unload the library, also done automatically in dtor
     // unload the library, also done automatically in dtor
-    void Unload();
+    void Unload() { if ( IsLoaded() ) { Unload(m_handle); m_handle = 0; } }
 
     // Return the raw handle from dlopen and friends.
     wxDllType GetLibHandle() const { return m_handle; }
 
     // Return the raw handle from dlopen and friends.
     wxDllType GetLibHandle() const { return m_handle; }
@@ -166,10 +170,11 @@ public:
     static wxString CanonicalizeName(const wxString& name,
                                      wxDynamicLibraryCategory cat = wxDL_LIBRARY);
 
     static wxString CanonicalizeName(const wxString& name,
                                      wxDynamicLibraryCategory cat = wxDL_LIBRARY);
 
-    // return name of wxWindows plugin (adds compiler and version info
+    // return name of wxWidgets plugin (adds compiler and version info
     // to the filename):
     // to the filename):
-    static wxString CanonicalizePluginName(const wxString& name,
-                                           wxPluginCategory cat);
+    static wxString
+    CanonicalizePluginName(const wxString& name,
+                           wxPluginCategory cat = wxDL_PLUGIN_GUI);
 
     // return plugin directory on platforms where it makes sense and empty
     // string on others:
 
     // return plugin directory on platforms where it makes sense and empty
     // string on others:
@@ -215,11 +220,11 @@ public:
       which case the library is searched for in all standard locations
       (use GetDllExt() to construct the filename)
 
       which case the library is searched for in all standard locations
       (use GetDllExt() to construct the filename)
 
-      if success pointer is not NULL, it will be filled with TRUE if everything
-      went ok and FALSE otherwise
+      if success pointer is not NULL, it will be filled with true if everything
+      went ok and false otherwise
      */
     static wxDllType LoadLibrary(const wxString& name, bool *success = NULL);
      */
     static wxDllType LoadLibrary(const wxString& name, bool *success = NULL);
-    
+
     /*
       This function unloads the shared library previously loaded with
       LoadLibrary
     /*
       This function unloads the shared library previously loaded with
       LoadLibrary