From: John L. <jr...@us...> - 2007-06-27 19:57:02
|
Update of /cvsroot/wxlua/wxLua/bindings/wxwidgets In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv18874/wxLua/bindings/wxwidgets Modified Files: appframe.i help.i wx_datatypes.lua Log Message: Add wxDynamicLibrary and friends to bindings Index: help.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/help.i,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** help.i 25 Jun 2007 03:19:37 -0000 1.21 --- help.i 27 Jun 2007 19:56:28 -0000 1.22 *************** *** 272,276 **** //void DisplayContents() - see wxHelpControllerBase void DisplayIndex() ! bool KeywordSearch(const wxString& keyword, wxHelpSearchMode mode = wxHELP_SEARCH_ALL) void ReadCustomization(wxConfigBase* cfg, wxString path = "") void SetTempDir(const wxString& path) --- 272,276 ---- //void DisplayContents() - see wxHelpControllerBase void DisplayIndex() ! // bool KeywordSearch(const wxString& keyword, wxHelpSearchMode mode = wxHELP_SEARCH_ALL) // see base void ReadCustomization(wxConfigBase* cfg, wxString path = "") void SetTempDir(const wxString& path) Index: appframe.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/appframe.i,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** appframe.i 26 Jun 2007 03:22:04 -0000 1.44 --- appframe.i 27 Jun 2007 19:56:28 -0000 1.45 *************** *** 900,901 **** --- 900,1049 ---- //bool operator!=(const wxPlatformInfo &t) const %endclass + + + // --------------------------------------------------------------------------- + // wxDynamicLibrary - No a lot you can do with this, but it might make + // testing or debugging a C++ program easier to test thing + // out in wxLua first. + + %if // wxLUA_USE_wxDynamicLibrary && wxUSE_DYNLIB_CLASS + + %include "wx/dynlib.h" + + %enum wxDLFlags + wxDL_LAZY // resolve undefined symbols at first use + // (only works on some Unix versions) + wxDL_NOW // resolve undefined symbols on load + // (default, always the case under Win32) + wxDL_GLOBAL // export extern symbols to subsequently + // loaded libs. + wxDL_VERBATIM // attempt to load the supplied library + // name without appending the usual dll + // filename extension. + wxDL_NOSHARE // load new DLL, don't reuse already loaded + // (only for wxPluginManager) + + wxDL_DEFAULT // = wxDL_NOW // default flags correspond to Win32 + %endenum + + %enum wxDynamicLibraryCategory + wxDL_LIBRARY, // standard library + wxDL_MODULE // loadable module/plugin + %endenum + + %enum wxPluginCategory + wxDL_PLUGIN_GUI, // plugin that uses GUI classes + wxDL_PLUGIN_BASE // wxBase-only plugin + %endenum + + + %class %delete %noclassinfo %encapsulate wxDynamicLibraryDetails + // ctor, normally never used as these objects are only created by + // wxDynamicLibrary::ListLoaded() + //wxDynamicLibraryDetails() { m_address = NULL; m_length = 0; } + + wxString GetName() const // get the (base) name + wxString GetPath() const // get the full path of this object + + // get the load address and the extent, return true if this information is available + //bool GetAddress(void **addr, size_t *len) const + + wxString GetVersion() const // return the version of the DLL (may be empty if no version info) + %endclass + + %class %delete %noclassinfo %encapsulate wxDynamicLibraryDetailsArray + //wxDynamicLibraryDetailsArray() // Get this from wxDynamicLibrary::ListLoaded + + int GetCount() const + wxDynamicLibraryDetails Item( int n ) + %endclass + + + %class %delete %noclassinfo %encapsulate wxDynamicLibrary + wxDynamicLibrary() + wxDynamicLibrary(const wxString& libname, int flags = wxDL_DEFAULT) + + // 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 wxChar *GetDllExt() + static wxString GetDllExt() + + // return true if the library was loaded successfully + bool IsLoaded() const + + // load the library with the given name (full or not), return true if ok + bool Load(const wxString& libname, int flags = wxDL_DEFAULT); + + // raw function for loading dynamic libs: always behaves as if + // wxDL_VERBATIM were specified and doesn't log error message if the + // library couldn't be loaded but simply returns NULL + //static wxDllType RawLoad(const wxString& libname, int flags = wxDL_DEFAULT); + + // detach the library object from its handle, i.e. prevent the object from + // unloading the library in its dtor -- the caller is now responsible for doing this + //wxDllType Detach() + + // unload the given library handle (presumably returned by Detach() before) + //static void Unload(wxDllType handle); + + // unload the library, also done automatically in dtor + void Unload() + + // Return the raw handle from dlopen and friends. + //wxDllType GetLibHandle() const { return m_handle; } + + // check if the given symbol is present in the library, useful to verify if + // a loadable module is our plugin, for example, without provoking error + // messages from GetSymbol() + bool HasSymbol(const wxString& name) const + + // resolve a symbol in a loaded DLL, such as a variable or function name. + // 'name' is the (possibly mangled) name of the symbol. (use extern "C" to + // export unmangled names) + // Since it is perfectly valid for the returned symbol to actually be NULL, + // that is not always indication of an error. Pass and test the parameter + // 'success' for a true indication of success or failure to load the symbol. + // Returns a pointer to the symbol on success, or NULL if an error occurred + // or the symbol wasn't found. + //void *GetSymbol(const wxString& name, bool *success = NULL) const; + + // low-level version of GetSymbol() + //static void *RawGetSymbol(wxDllType handle, const wxString& name); + //void *RawGetSymbol(const wxString& name) const + + //#ifdef __WXMSW__ + // this function is useful for loading functions from the standard Windows + // DLLs: such functions have an 'A' (in ANSI build) or 'W' (in Unicode, or + // wide character build) suffix if they take string parameters + //static void *RawGetSymbolAorW(wxDllType handle, const wxString& name) + //void *GetSymbolAorW(const wxString& name) const + //#endif // __WXMSW__ + + // return all modules/shared libraries in the address space of this process + // returns an empty array if not implemented or an error occurred + static wxDynamicLibraryDetailsArray ListLoaded(); + + // return platform-specific name of dynamic library with proper extension + // and prefix (e.g. "foo.dll" on Windows or "libfoo.so" on Linux) + static wxString CanonicalizeName(const wxString& name, wxDynamicLibraryCategory cat = wxDL_LIBRARY); + + // return name of wxWidgets plugin (adds compiler and version info + // to the filename): + 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: + static wxString GetPluginsDirectory() + %endclass + + + // --------------------------------------------------------------------------- + // wxPluginLibrary - You cannot use this within wxLua + + // --------------------------------------------------------------------------- + // wxPluginManager - You cannot use this within wxLua + + + %endif // wxLUA_USE_wxDynamicLibrary && wxUSE_DYNLIB_CLASS \ No newline at end of file Index: wx_datatypes.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wx_datatypes.lua,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** wx_datatypes.lua 27 Jun 2007 03:11:27 -0000 1.79 --- wx_datatypes.lua 27 Jun 2007 19:56:28 -0000 1.80 *************** *** 783,786 **** --- 783,791 ---- Name = "wxDCClipper", }, + wxDLFlags = { + DefType = "enum", + IsNumber = true, + Name = "wxDLFlags", + }, wxDataFormat = { Condition = "wxLUA_USE_wxDataObject && wxUSE_DATAOBJ", *************** *** 1050,1053 **** --- 1055,1081 ---- Name = "wxDuplexMode", }, + wxDynamicLibrary = { + DefType = "class", + Encapsulate = true, + IsNumber = false, + Name = "wxDynamicLibrary", + }, + wxDynamicLibraryCategory = { + DefType = "enum", + IsNumber = true, + Name = "wxDynamicLibraryCategory", + }, + wxDynamicLibraryDetails = { + DefType = "class", + Encapsulate = true, + IsNumber = false, + Name = "wxDynamicLibraryDetails", + }, + wxDynamicLibraryDetailsArray = { + DefType = "class", + Encapsulate = true, + IsNumber = false, + Name = "wxDynamicLibraryDetailsArray", + }, wxEOL = { Condition = "wxUSE_STREAMS", *************** *** 2744,2747 **** --- 2772,2780 ---- Name = "wxPlatformInfo", }, + wxPluginCategory = { + DefType = "enum", + IsNumber = true, + Name = "wxPluginCategory", + }, wxPoint = { Condition = "wxLUA_USE_wxPointSizeRect", *************** *** 4136,4139 **** --- 4169,4173 ---- wxLUA_USE_wxDisplay = "wxLUA_USE_wxDisplay", wxLUA_USE_wxDragDrop = "wxLUA_USE_wxDragDrop", + wxLUA_USE_wxDynamicLibrary = "wxLUA_USE_wxDynamicLibrary", wxLUA_USE_wxFile = "wxLUA_USE_wxFile", wxLUA_USE_wxFileDialog = "wxLUA_USE_wxFileDialog", |