X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/328f5751e8a06727b137189fe04891a9f43bfc8b..b2c31e32de4376d44852e2e9db7be028e383676a:/interface/dynlib.h diff --git a/interface/dynlib.h b/interface/dynlib.h index 78e611639f..c5abb1b599 100644 --- a/interface/dynlib.h +++ b/interface/dynlib.h @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// // Name: dynlib.h -// Purpose: documentation for wxDynamicLibraryDetails class +// Purpose: interface of wxDynamicLibraryDetails // Author: wxWidgets team // RCS-ID: $Id$ // Licence: wxWindows license @@ -24,14 +24,14 @@ class wxDynamicLibraryDetails public: /** Retrieves the load address and the size of this module. - + @param addr the pointer to the location to return load address in, may be @NULL @param len pointer to the location to return the size of this module in memory in, may be @NULL - + @returns @true if the load address and module size were retrieved, @false if this information is not available. */ @@ -59,6 +59,7 @@ public: }; + /** @class wxDllLoader @wxheader{dynlib.h} @@ -149,7 +150,7 @@ public: function name. Returned value will be @NULL if the symbol was not found in the DLL or if an error occurred. - + @param dllHandle Valid handle previously returned by LoadLibrary @@ -167,7 +168,7 @@ public: Returns a handle to the loaded DLL. Use @a success parameter to test if it is valid. If the handle is valid, the library must be unloaded later with UnloadLibrary(). - + @param libname Name of the shared object to load. @param success @@ -185,6 +186,7 @@ public: }; + /** @class wxDynamicLibrary @wxheader{dynlib.h} @@ -197,8 +199,7 @@ public: @library{wxbase} @category{FIXME} - @seealso - wxDynamicLibrary::CanonicalizePluginName + @see wxDynamicLibrary::CanonicalizePluginName */ class wxDynamicLibrary { @@ -217,16 +218,16 @@ public: it adds a @c ".dll" extension under Windows and @c "lib" prefix and @c ".so", @c ".sl" or maybe @c ".dylib" extension under Unix. The possible values for @a cat are: - - + + wxDL_LIBRARY - + normal library - + wxDL_MODULE - + a loadable module or plugin - + @see CanonicalizePluginName() */ static wxString CanonicalizeName(const wxString& name, @@ -239,14 +240,14 @@ public: to the name to ensure that the plugin which is going to be loaded will be compatible with the main program. The possible values for @a cat are: - - + + wxDL_PLUGIN_GUI - + plugin which uses GUI classes (default) - + wxDL_PLUGIN_BASE - + plugin which only uses wxBase */ static wxString CanonicalizePluginName(const wxString& name, @@ -268,8 +269,8 @@ public: /** Returns pointer to symbol @a name in the library or @NULL if the library contains no such symbol. - - @see wxDYNLIB_FUNCTION + + @see wxDYNLIB_FUNCTION() */ void* GetSymbol(const wxString& name) const; @@ -288,7 +289,8 @@ public: Returns @true if the symbol with the given @a name is present in the dynamic library, @false otherwise. Unlike GetSymbol(), this function doesn't log an error message if the symbol is not found. - This function is new since wxWidgets version 2.5.4 + + @wxsince{2.5.4} */ bool HasSymbol(const wxString& name) const; @@ -298,7 +300,7 @@ public: bool IsLoaded() const; /** - This static method returns an array containing the details + This static method returns an array() containing the details of all modules loaded into the address space of the current project, the array elements are object of @c wxDynamicLibraryDetails class. The array will be empty if an error occurred. @@ -310,33 +312,33 @@ public: /** Loads DLL with the given @a name into memory. The @a flags argument can be a combination of the following bits: - + wxDL_LAZY - + equivalent of RTLD_LAZY under Unix, ignored elsewhere - + wxDL_NOW - + equivalent of RTLD_NOW under Unix, ignored elsewhere - + wxDL_GLOBAL - + equivalent of RTLD_GLOBAL under Unix, ignored elsewhere - + wxDL_VERBATIM - + don't try to append the appropriate extension to the library name (this is done by default). - + wxDL_DEFAULT - + default flags, same as wxDL_NOW currently - + wxDL_QUIET - + don't log an error message if the library couldn't be loaded. - + Returns @true if the library was successfully loaded, @false otherwise. */ bool Load(const wxString& name, int flags = wxDL_DEFAULT); @@ -356,28 +358,36 @@ public: }; + // ============================================================================ // Global functions/macros // ============================================================================ +/** @ingroup group_funcmacro_misc */ +//@{ + /** When loading a function from a DLL you always have to cast the returned - @c void * pointer to the correct type and, even more annoyingly, you have to - repeat this type twice if you want to declare and define a function pointer all - in one line + void * pointer to the correct type and, even more annoyingly, you + have to repeat this type twice if you want to declare and define a function + pointer all in one line. + This macro makes this slightly less painful by allowing you to specify the - type only once, as the first parameter, and creating a variable of this type - named after the function but with @c pfn prefix and initialized with the - function @a name from the wxDynamicLibrary - @e dynlib. + type only once, as the first parameter, and creating a variable of this + type named after the function but with @c pfn prefix and initialized with + the function @a name from the wxDynamicLibrary @a dynlib. @param type - the type of the function + The type of the function. @param name - the name of the function to load, not a string (without quotes, - it is quoted automatically by the macro) + The name of the function to load, not a string (without quotes, it is + quoted automatically by the macro). @param dynlib - the library to load the function from + The library to load the function from. + + @header{wx/dynlib.h} */ -#define wxDYNLIB_FUNCTION(type, name, dynlib) /* implementation is private */ +#define wxDYNLIB_FUNCTION(type, name, dynlib) + +//@}