From 1b8c7ba607a15a2ff8a04448138df9ffff7df6c5 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 23 Dec 2004 20:44:09 +0000 Subject: [PATCH] Updated to SWIG 1.3.24 (plus a patch that corrects a bug and adds back some things that were changed/removed from my patch I submitted to them.) Since it is now possible easily and simply share the SWIG type tables across modules I reverted to always using the stock SWIG runtime instead of my slightly hacked up version of it exported via the wxPython C API. The %name directive is now deprecated so replaced most uses of it with a custom %Rename macro that uses %rename internally. These will evetually need to be replaced with a DocDecl macro when docstrings are added. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31128 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/config.py | 10 +- wxPython/contrib/gizmos/gizmos.i | 22 +- wxPython/contrib/glcanvas/glcanvas.i | 4 +- wxPython/contrib/iewin/iewin.i | 2 +- wxPython/contrib/ogl/_oglshapes.i | 4 +- wxPython/contrib/ogl/_oglshapes2.i | 4 +- wxPython/include/wx/wxPython/wxPython.h | 20 +- wxPython/include/wx/wxPython/wxPython_int.h | 42 - wxPython/setup.py | 1 - wxPython/src/_artprov.i | 3 +- wxPython/src/_bitmap.i | 8 +- wxPython/src/_core_api.i | 34 +- wxPython/src/_cursor.i | 5 +- wxPython/src/_datetime.i | 38 +- wxPython/src/_dc.i | 57 +- wxPython/src/_defs.i | 50 +- wxPython/src/_dirctrl.i | 4 +- wxPython/src/_dnd.i | 12 +- wxPython/src/_dragimg.i | 19 +- wxPython/src/_filesys.i | 6 +- wxPython/src/_font.i | 36 +- wxPython/src/_gauge.i | 2 +- wxPython/src/_gbsizer.i | 39 +- wxPython/src/_gdicmn.i | 20 +- wxPython/src/_icon.i | 16 +- wxPython/src/_image.i | 54 +- wxPython/src/_imaglist.i | 6 +- wxPython/src/_listbox.i | 8 +- wxPython/src/_listctrl.i | 21 +- wxPython/src/_log.i | 28 +- wxPython/src/_mdi.i | 6 +- wxPython/src/_menu.i | 34 +- wxPython/src/_mimetype.i | 4 +- wxPython/src/_misc.i | 8 +- wxPython/src/_notebook.i | 8 +- wxPython/src/_panel.i | 4 +- wxPython/src/_popupwin.i | 14 +- wxPython/src/_printfw.i | 3 +- wxPython/src/_process.i | 3 +- wxPython/src/_pycontrol.i | 2 +- wxPython/src/_pywindows.i | 6 +- wxPython/src/_radio.i | 8 +- wxPython/src/_region.i | 42 +- wxPython/src/_sashwin.i | 4 +- wxPython/src/_scrolbar.i | 2 +- wxPython/src/_settings.i | 2 +- wxPython/src/_sizers.i | 23 +- wxPython/src/_slider.i | 2 +- wxPython/src/_sound.i | 5 +- wxPython/src/_spin.i | 6 +- wxPython/src/_statctrls.i | 8 +- wxPython/src/_statusbar.i | 2 +- wxPython/src/_streams.i | 4 +- wxPython/src/_taskbar.i | 3 +- wxPython/src/_textctrl.i | 2 +- wxPython/src/_tglbtn.i | 2 +- wxPython/src/_timer.i | 3 +- wxPython/src/_toolbar.i | 8 +- wxPython/src/_toplvl.i | 6 +- wxPython/src/_treectrl.i | 14 +- wxPython/src/_vscroll.i | 19 +- wxPython/src/_window.i | 36 +- wxPython/src/_xml.i | 18 +- wxPython/src/_xmlhandler.i | 3 +- wxPython/src/_xmlres.i | 14 +- wxPython/src/_xmlsub.i | 3 +- wxPython/src/common.swg | 75 -- wxPython/src/grid.i | 2 +- wxPython/src/html.i | 22 +- wxPython/src/libpy.c | 911 ------------------ wxPython/src/media.i | 6 +- .../src/{my_fragments.i => pyfragments.swg} | 34 +- wxPython/src/pyrun.swg | 78 -- wxPython/src/python.swg | 90 -- wxPython/src/webkit.i | 2 +- wxPython/src/wizard.i | 8 +- 76 files changed, 483 insertions(+), 1651 deletions(-) delete mode 100644 wxPython/src/common.swg delete mode 100644 wxPython/src/libpy.c rename wxPython/src/{my_fragments.i => pyfragments.swg} (60%) delete mode 100644 wxPython/src/pyrun.swg delete mode 100644 wxPython/src/python.swg diff --git a/wxPython/config.py b/wxPython/config.py index 94e9e9c76a..158d6e79a3 100644 --- a/wxPython/config.py +++ b/wxPython/config.py @@ -644,7 +644,7 @@ if os.name == 'nt': (WXPLAT, None), ('WXUSINGDLL', '1'), - ('SWIG_GLOBAL', None), + ('SWIG_TYPE_TABLE', 'wxPython_type_table'), ('WXP_USE_THREAD', '1'), ] @@ -698,7 +698,7 @@ if os.name == 'nt': elif os.name == 'posix': WXDIR = '..' includes = ['include', 'src'] - defines = [('SWIG_GLOBAL', None), + defines = [('SWIG_TYPE_TABLE', 'wxPython_type_table'), ('HAVE_CONFIG_H', None), ('WXP_USE_THREAD', '1'), ] @@ -813,7 +813,6 @@ swig_args = ['-c++', '-I' + opj(WXPY_SRC, 'src'), '-D'+WXPLAT, - '-noruntime' ] if UNICODE: swig_args.append('-DwxUSE_UNICODE') @@ -823,10 +822,7 @@ if FULL_DOCS: swig_deps = [ opj(WXPY_SRC, 'src/my_typemaps.i'), - opj(WXPY_SRC, 'src/my_fragments.i'), - opj(WXPY_SRC, 'src/common.swg'), - opj(WXPY_SRC, 'src/pyrun.swg'), - opj(WXPY_SRC, 'src/python.swg'), + opj(WXPY_SRC, 'src/pyfragments.swg'), ] depends = [ #'include/wx/wxPython/wxPython.h', diff --git a/wxPython/contrib/gizmos/gizmos.i b/wxPython/contrib/gizmos/gizmos.i index e0496bd699..bb20287ecd 100644 --- a/wxPython/contrib/gizmos/gizmos.i +++ b/wxPython/contrib/gizmos/gizmos.i @@ -150,7 +150,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCLIP_CHILDREN | wxDS_MANAGE_SCROLLBARS | wxDS_DRAG_CORNER, const wxString& name = wxPyDynamicSashNameStr); - %name(PreDynamicSashWindow)wxDynamicSashWindow(); + %RenameCtor(PreDynamicSashWindow, wxDynamicSashWindow()); bool Create(wxWindow *parent, wxWindowID id=-1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, @@ -305,7 +305,8 @@ public: MustHaveApp(wxPyTreeCompanionWindow); -%name(TreeCompanionWindow) class wxPyTreeCompanionWindow: public wxWindow +%rename(TreeCompanionWindow) wxPyTreeCompanionWindow; +class wxPyTreeCompanionWindow: public wxWindow { public: %pythonAppend wxPyTreeCompanionWindow "self._setOORInfo(self);self._setCallbackInfo(self, TreeCompanionWindow)" @@ -398,7 +399,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxLED_ALIGN_LEFT | wxLED_DRAW_FADED); - %name(PreLEDNumberCtrl) wxLEDNumberCtrl(); + %RenameCtor(PreLEDNumberCtrl, wxLEDNumberCtrl()); bool Create(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, @@ -521,7 +522,8 @@ IMPLEMENT_ABSTRACT_CLASS(wxPyTreeListCtrl, wxTreeListCtrl) MustHaveApp(wxPyTreeListCtrl); -%name(TreeListCtrl) class wxPyTreeListCtrl : public wxControl +%rename(TreeListCtrl) wxPyTreeListCtrl; +class wxPyTreeListCtrl : public wxControl { public: %pythonAppend wxPyTreeListCtrl "self._setOORInfo(self);self._setCallbackInfo(self, TreeListCtrl)" @@ -533,7 +535,7 @@ public: long style = wxTR_DEFAULT_STYLE, const wxValidator &validator = wxDefaultValidator, const wxString& name = wxPyTreeListCtrlNameStr ); - %name(PreTreeListCtrl)wxPyTreeListCtrl(); + %RenameCtor(PreTreeListCtrl, wxPyTreeListCtrl()); bool Create(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, @@ -590,11 +592,11 @@ public: // void AddColumn(const wxString& text, // size_t width, // wxTreeListColumnAlign alignment = wxTL_ALIGN_LEFT); - %name(AddColumnInfo) void AddColumn(const wxTreeListColumnInfo& col); + %Rename(AddColumnInfo, void, AddColumn(const wxTreeListColumnInfo& col)); // inserts a column before the given one void InsertColumn(size_t before, const wxString& text); - %name(InsertColumnInfo) void InsertColumn(size_t before, const wxTreeListColumnInfo& col); + %Rename(InsertColumnInfo, void, InsertColumn(size_t before, const wxTreeListColumnInfo& col)); // deletes the given column - does not delete the corresponding column // of each item @@ -861,12 +863,12 @@ public: wxPyTreeItemData *data = NULL); // insert a new item before the one with the given index - %name(InsertItemBefore) - wxTreeItemId InsertItem(const wxTreeItemId& parent, + %Rename(InsertItemBefore, + wxTreeItemId, InsertItem(const wxTreeItemId& parent, size_t index, const wxString& text, int image = -1, int selectedImage = -1, - wxPyTreeItemData *data = NULL); + wxPyTreeItemData *data = NULL)); // insert a new item in as the last child of the parent wxTreeItemId AppendItem(const wxTreeItemId& parent, diff --git a/wxPython/contrib/glcanvas/glcanvas.i b/wxPython/contrib/glcanvas/glcanvas.i index 5c44932c06..a8f7da4d85 100644 --- a/wxPython/contrib/glcanvas/glcanvas.i +++ b/wxPython/contrib/glcanvas/glcanvas.i @@ -134,7 +134,7 @@ public: const wxPalette& palette = wxNullPalette); %pythonAppend wxGLCanvas "val._setOORInfo(val)" - %name(GLCanvasWithContext) + %RenameCtor(GLCanvasWithContext, wxGLCanvas( wxWindow *parent, const wxGLContext *shared = NULL, wxWindowID id = -1, @@ -143,7 +143,7 @@ public: long style = 0, const wxString& name = wxPyGLCanvasNameStr, int *attribList = NULL, - const wxPalette& palette = wxNullPalette ); + const wxPalette& palette = wxNullPalette )); void SetCurrent(); diff --git a/wxPython/contrib/iewin/iewin.i b/wxPython/contrib/iewin/iewin.i index d232b5a42b..f55d9260a4 100644 --- a/wxPython/contrib/iewin/iewin.i +++ b/wxPython/contrib/iewin/iewin.i @@ -107,7 +107,7 @@ public: bool GoForward(); bool GoHome(); bool GoSearch(); - %name(RefreshPage)bool Refresh(wxIEHtmlRefreshLevel level); + %Rename(RefreshPage, bool, Refresh(wxIEHtmlRefreshLevel level)); bool Stop(); }; diff --git a/wxPython/contrib/ogl/_oglshapes.i b/wxPython/contrib/ogl/_oglshapes.i index 891828c550..10ed873632 100644 --- a/wxPython/contrib/ogl/_oglshapes.i +++ b/wxPython/contrib/ogl/_oglshapes.i @@ -412,9 +412,9 @@ public: } } - %name(AddSimpleConstraint)wxOGLConstraint* AddConstraint(int type, + %Rename(AddSimpleConstraint, wxOGLConstraint*, AddConstraint(int type, wxPyShape *constraining, - wxPyShape *constrained); + wxPyShape *constrained)); void CalculateSize(); bool ContainsDivision(wxPyDivisionShape *division); diff --git a/wxPython/contrib/ogl/_oglshapes2.i b/wxPython/contrib/ogl/_oglshapes2.i index 7dce30b7bd..bd2fcdd661 100644 --- a/wxPython/contrib/ogl/_oglshapes2.i +++ b/wxPython/contrib/ogl/_oglshapes2.i @@ -163,13 +163,13 @@ public: bool ClearArrow(const wxString& name); void ClearArrowsAtPosition(int position = -1); void DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool proportionalOffset); - %name(DeleteArrowHeadId)bool DeleteArrowHead(long arrowId); + %Rename(DeleteArrowHeadId, bool, DeleteArrowHead(long arrowId)); bool DeleteArrowHead(int position, const wxString& name); bool DeleteLineControlPoint(); void DrawArrows(wxDC& dc); void DrawRegion(wxDC& dc, wxShapeRegion *region, double x, double y); void EraseRegion(wxDC& dc, wxShapeRegion *region, double x, double y); - %name(FindArrowHeadId)wxArrowHead * FindArrowHead(long arrowId); + %Rename(FindArrowHeadId, wxArrowHead *, FindArrowHead(long arrowId)); wxArrowHead * FindArrowHead(int position, const wxString& name); void FindLineEndPoints(double *OUTPUT, double *OUTPUT, double *OUTPUT, double *OUTPUT); diff --git a/wxPython/include/wx/wxPython/wxPython.h b/wxPython/include/wx/wxPython/wxPython.h index dda85883aa..f95a1cb3eb 100644 --- a/wxPython/include/wx/wxPython/wxPython.h +++ b/wxPython/include/wx/wxPython/wxPython.h @@ -46,7 +46,7 @@ static bool wxPyCoreAPI_IMPORT() inline wxPyCoreAPI* wxPyGetCoreAPIPtr() { if (wxPyCoreAPIPtr == NULL) wxPyCoreAPI_IMPORT(); - // wxASSERT_MSW(wxPyCoreAPIPtr != NULL, wxT("wxPyCoreAPIPtr is NULL!!!")); // uncomment when needed for debugging + // wxASSERT_MSG(wxPyCoreAPIPtr != NULL, wxT("wxPyCoreAPIPtr is NULL!!!")); // uncomment when needed for debugging return wxPyCoreAPIPtr; } @@ -55,24 +55,6 @@ inline wxPyCoreAPI* wxPyGetCoreAPIPtr() // via the API pointer retrieved above. TODO: Should these be made into // inline fucntions? -#define SWIG_Python_TypeRegister(a) (wxPyGetCoreAPIPtr()->p_SWIG_Python_TypeRegister(a)) -#define SWIG_Python_TypeCheck(a,b) (wxPyGetCoreAPIPtr()->p_SWIG_Python_TypeCheck(a,b)) -#define SWIG_Python_TypeCast(a,b) (wxPyGetCoreAPIPtr()->p_SWIG_Python_TypeCast(a,b)) -#define SWIG_Python_TypeDynamicCast(a,b) (wxPyGetCoreAPIPtr()->p_SWIG_Python_TypeDynamicCast(a,b)) -#define SWIG_Python_TypeName(a) (wxPyGetCoreAPIPtr()->p_SWIG_Python_TypeName(a)) -#define SWIG_Python_TypeQuery(a) (wxPyGetCoreAPIPtr()->p_SWIG_Python_TypeQuery(a)) -#define SWIG_Python_TypeClientData(a,b) (wxPyGetCoreAPIPtr()->p_SWIG_Python_TypeClientData(a,b)) -#define SWIG_Python_newvarlink() (wxPyGetCoreAPIPtr()->p_SWIG_Python_newvarlink()) -#define SWIG_Python_addvarlink(a,b,c,d) (wxPyGetCoreAPIPtr()->p_SWIG_Python_addvarlink(a,b,c,d)) -#define SWIG_Python_ConvertPtr(a,b,c,d) (wxPyGetCoreAPIPtr()->p_SWIG_Python_ConvertPtr(a,b,c,d)) -#define SWIG_Python_ConvertPacked(a,b,c,d,e) (wxPyGetCoreAPIPtr()->p_SWIG_Python_ConvertPacked(a,b,c,d,e)) -#define SWIG_Python_PackData(a,b,c) (wxPyGetCoreAPIPtr()->p_SWIG_Python_PackData(a,b,c)) -#define SWIG_Python_UnpackData(a,b,c) (wxPyGetCoreAPIPtr()->p_SWIG_Python_UnpackData(a,b,c)) -#define SWIG_Python_NewPointerObj(a,b,c) (wxPyGetCoreAPIPtr()->p_SWIG_Python_NewPointerObj(a,b,c)) -#define SWIG_Python_NewPackedObj(a,b,c) (wxPyGetCoreAPIPtr()->p_SWIG_Python_NewPackedObj(a,b,c)) -#define SWIG_Python_InstallConstants(a,b) (wxPyGetCoreAPIPtr()->p_SWIG_Python_InstallConstants(a,b)) -#define SWIG_Python_MustGetPtr(a,b,c,d) (wxPyGetCoreAPIPtr()->p_SWIG_Python_MustGetPtr(a,b,c,d)) - #define wxPyCheckSwigType(a) (wxPyGetCoreAPIPtr()->p_wxPyCheckSwigType(a)) #define wxPyConstructObject(a,b,c) (wxPyGetCoreAPIPtr()->p_wxPyConstructObject(a,b,c)) #define wxPyConvertSwigPtr(a,b,c) (wxPyGetCoreAPIPtr()->p_wxPyConvertSwigPtr(a,b,c)) diff --git a/wxPython/include/wx/wxPython/wxPython_int.h b/wxPython/include/wx/wxPython/wxPython_int.h index 336c20c33e..3e81598348 100644 --- a/wxPython/include/wx/wxPython/wxPython_int.h +++ b/wxPython/include/wx/wxPython/wxPython_int.h @@ -328,51 +328,9 @@ wxPyCBInputStream* wxPyCBInputStream_create(PyObject *py, bool block); // in another shared library. class wxPyCallbackHelper; -struct swig_type_info; -struct swig_const_info; - -// Make SunCC happy and make typedef's for these that are extern "C" -typedef swig_type_info* (*p_SWIG_Python_TypeRegister_t)(swig_type_info *); -typedef swig_type_info* (*p_SWIG_Python_TypeCheck_t)(char *c, swig_type_info *); -typedef void* (*p_SWIG_Python_TypeCast_t)(swig_type_info *, void *); -typedef swig_type_info* (*p_SWIG_Python_TypeDynamicCast_t)(swig_type_info *, void **); -typedef const char* (*p_SWIG_Python_TypeName_t)(const swig_type_info *); -typedef const char * (*p_SWIG_Python_TypePrettyName_t)(const swig_type_info *); -typedef swig_type_info* (*p_SWIG_Python_TypeQuery_t)(const char *); -typedef void (*p_SWIG_Python_TypeClientData_t)(swig_type_info *, void *); -typedef PyObject* (*p_SWIG_Python_newvarlink_t)(void); -typedef void (*p_SWIG_Python_addvarlink_t)(PyObject *, char *, PyObject *(*)(void), int (*)(PyObject *)); -typedef int (*p_SWIG_Python_ConvertPtr_t)(PyObject *, void **, swig_type_info *, int); -typedef int (*p_SWIG_Python_ConvertPacked_t)(PyObject *, void *, int sz, swig_type_info *, int); -typedef char* (*p_SWIG_Python_PackData_t)(char *c, void *, int); -typedef char* (*p_SWIG_Python_UnpackData_t)(char *c, void *, int); -typedef PyObject* (*p_SWIG_Python_NewPointerObj_t)(void *, swig_type_info *,int own); -typedef PyObject* (*p_SWIG_Python_NewPackedObj_t)(void *, int sz, swig_type_info *); -typedef void (*p_SWIG_Python_InstallConstants_t)(PyObject *d, swig_const_info constants[]); -typedef void* (*p_SWIG_Python_MustGetPtr_t)(PyObject *, swig_type_info *, int, int); - struct wxPyCoreAPI { - p_SWIG_Python_TypeRegister_t p_SWIG_Python_TypeRegister; - p_SWIG_Python_TypeCheck_t p_SWIG_Python_TypeCheck; - p_SWIG_Python_TypeCast_t p_SWIG_Python_TypeCast; - p_SWIG_Python_TypeDynamicCast_t p_SWIG_Python_TypeDynamicCast; - p_SWIG_Python_TypeName_t p_SWIG_Python_TypeName; - p_SWIG_Python_TypePrettyName_t p_SWIG_Python_TypePrettyName; - p_SWIG_Python_TypeQuery_t p_SWIG_Python_TypeQuery; - p_SWIG_Python_TypeClientData_t p_SWIG_Python_TypeClientData; - p_SWIG_Python_newvarlink_t p_SWIG_Python_newvarlink; - p_SWIG_Python_addvarlink_t p_SWIG_Python_addvarlink; - p_SWIG_Python_ConvertPtr_t p_SWIG_Python_ConvertPtr; - p_SWIG_Python_ConvertPacked_t p_SWIG_Python_ConvertPacked; - p_SWIG_Python_PackData_t p_SWIG_Python_PackData; - p_SWIG_Python_UnpackData_t p_SWIG_Python_UnpackData; - p_SWIG_Python_NewPointerObj_t p_SWIG_Python_NewPointerObj; - p_SWIG_Python_NewPackedObj_t p_SWIG_Python_NewPackedObj; - p_SWIG_Python_InstallConstants_t p_SWIG_Python_InstallConstants; - p_SWIG_Python_MustGetPtr_t p_SWIG_Python_MustGetPtr; - bool (*p_wxPyCheckSwigType)(const wxChar* className); PyObject* (*p_wxPyConstructObject)(void* ptr, const wxChar* className, int setThisOwn); bool (*p_wxPyConvertSwigPtr)(PyObject* obj, void **ptr, const wxChar* className); diff --git a/wxPython/setup.py b/wxPython/setup.py index e02a1a4ea1..c10120bbda 100755 --- a/wxPython/setup.py +++ b/wxPython/setup.py @@ -137,7 +137,6 @@ else: ext = Extension('_core_', ['src/helpers.cpp', - 'src/libpy.c', ] + rc_file + swig_sources, include_dirs = includes, diff --git a/wxPython/src/_artprov.i b/wxPython/src/_artprov.i index 59337dd7a5..dba08791f3 100644 --- a/wxPython/src/_artprov.i +++ b/wxPython/src/_artprov.i @@ -210,7 +210,8 @@ MustHaveApp(wxPyArtProvider); MustHaveApp(wxPyArtProvider::GetBitmap); MustHaveApp(wxPyArtProvider::GetIcon); -%name(ArtProvider) class wxPyArtProvider /*: public wxObject*/ +%rename(ArtProvider) wxPyArtProvider; +class wxPyArtProvider /*: public wxObject*/ { public: diff --git a/wxPython/src/_bitmap.i b/wxPython/src/_bitmap.i index a4c3236c9d..ce142978dd 100644 --- a/wxPython/src/_bitmap.i +++ b/wxPython/src/_bitmap.i @@ -128,7 +128,9 @@ that a colour reduction may have to take place.", "", %extend { DocStr(wxBitmap(PyObject* listOfStrings), "Construct a Bitmap from a list of strings formatted as XPM data.", ""); - %name(BitmapFromXPMData) wxBitmap(PyObject* listOfStrings) { + + %RenameCtor(BitmapFromXPMData, wxBitmap(PyObject* listOfStrings)) + { char** cArray = NULL; wxBitmap* bmp; @@ -145,7 +147,9 @@ that a colour reduction may have to take place.", "", function for monochrome bitmaps (depth 1) in portable programs: in this case the bits parameter should contain an XBM image. For other bit depths, the behaviour is platform dependent.", ""); - %name(BitmapFromBits) wxBitmap(PyObject* bits, int width, int height, int depth=1 ) { + + %RenameCtor(BitmapFromBits, wxBitmap(PyObject* bits, int width, int height, int depth=1 )) + { char* buf; int length; PyString_AsStringAndSize(bits, &buf, &length); diff --git a/wxPython/src/_core_api.i b/wxPython/src/_core_api.i index 4138758000..8bfd2a5b03 100644 --- a/wxPython/src/_core_api.i +++ b/wxPython/src/_core_api.i @@ -42,7 +42,7 @@ swig_type_info* wxPyFindSwigType(const wxChar* className) { if (! swigType) { // it wasn't in the cache, so look it up from SWIG name.Append(wxT(" *")); - swigType = SWIG_Python_TypeQuery(name.mb_str()); + swigType = SWIG_TypeQuery(name.mb_str()); // if it still wasn't found, try looking for a mapped name if (!swigType) { @@ -53,7 +53,7 @@ swig_type_info* wxPyFindSwigType(const wxChar* className) { (char*)(const char*)name.mbc_str())) != NULL) { name = wxString(PyString_AsString(item), *wxConvCurrent); name.Append(wxT(" *")); - swigType = SWIG_Python_TypeQuery(name.mb_str()); + swigType = SWIG_TypeQuery(name.mb_str()); } } if (swigType) { @@ -109,16 +109,13 @@ PyObject* wxPyMakeSwigPtr(void* ptr, const wxChar* className) { wxCHECK_MSG(swigType != NULL, NULL, wxT("Unknown type in wxPyConvertSwigPtr")); #ifdef SWIG_COBJECT_TYPES - robj = PyCObject_FromVoidPtrAndDesc((void *) ptr, (char *) swigType->name, NULL); + robj = PySwigObject_FromVoidPtrAndDesc((void *) ptr, (char *)swigType->name); #else { char result[1024]; - char *r = result; - *(r++) = '_'; - r = SWIG_Python_PackData(r, &ptr, sizeof(void *)); - strcpy(r, swigType->name); - robj = PyString_FromString(result); - } + robj = SWIG_PackVoidPtr(result, ptr, swigType->name, sizeof(result)) ? + PyString_FromString(result) : 0; + } #endif return robj; @@ -132,25 +129,6 @@ PyObject* wxPyMakeSwigPtr(void* ptr, const wxChar* className) { // even if they are located in another shared library. static wxPyCoreAPI API = { - (p_SWIG_Python_TypeRegister_t)SWIG_Python_TypeRegister, - (p_SWIG_Python_TypeCheck_t)SWIG_Python_TypeCheck, - (p_SWIG_Python_TypeCast_t)SWIG_Python_TypeCast, - (p_SWIG_Python_TypeDynamicCast_t)SWIG_Python_TypeDynamicCast, - (p_SWIG_Python_TypeName_t)SWIG_Python_TypeName, - (p_SWIG_Python_TypePrettyName_t)SWIG_Python_TypePrettyName, - (p_SWIG_Python_TypeQuery_t)SWIG_Python_TypeQuery, - (p_SWIG_Python_TypeClientData_t)SWIG_Python_TypeClientData, - (p_SWIG_Python_newvarlink_t)SWIG_Python_newvarlink, - (p_SWIG_Python_addvarlink_t)SWIG_Python_addvarlink, - (p_SWIG_Python_ConvertPtr_t)SWIG_Python_ConvertPtr, - (p_SWIG_Python_ConvertPacked_t)SWIG_Python_ConvertPacked, - (p_SWIG_Python_PackData_t)SWIG_Python_PackData, - (p_SWIG_Python_UnpackData_t)SWIG_Python_UnpackData, - (p_SWIG_Python_NewPointerObj_t)SWIG_Python_NewPointerObj, - (p_SWIG_Python_NewPackedObj_t)SWIG_Python_NewPackedObj, - (p_SWIG_Python_InstallConstants_t)SWIG_Python_InstallConstants, - (p_SWIG_Python_MustGetPtr_t)SWIG_Python_MustGetPtr, - wxPyCheckSwigType, wxPyConstructObject, wxPyConvertSwigPtr, diff --git a/wxPython/src/_cursor.i b/wxPython/src/_cursor.i index 81fe4c90a9..9d7e87851b 100644 --- a/wxPython/src/_cursor.i +++ b/wxPython/src/_cursor.i @@ -115,9 +115,10 @@ black/white (mask respected).", // %extend { // DocStr(wxCursor, // ""); -// %name(CursorFromBits) wxCursor(PyObject* bits, int width, int height, +// %RenameCtor(CursorFromBits, wxCursor(PyObject* bits, int width, int height, // int hotSpotX=-1, int hotSpotY=-1, -// PyObject* maskBits=NULL) { +// PyObject* maskBits=NULL)) +// { // char* bitsbuf; // char* maskbuf = NULL; // int length; diff --git a/wxPython/src/_datetime.i b/wxPython/src/_datetime.i index 8db212c167..d932869e94 100644 --- a/wxPython/src/_datetime.i +++ b/wxPython/src/_datetime.i @@ -343,15 +343,15 @@ public: // returns the number of days in this year (356 or 355 for Gregorian // calendar usually :-) - %name(GetNumberOfDaysinYear) - static wxDateTime_t GetNumberOfDays(int year, Calendar cal = Gregorian); + %Rename(GetNumberOfDaysinYear, + static wxDateTime_t, GetNumberOfDays(int year, Calendar cal = Gregorian)); // get the number of the days in the given month (default value for // the year means the current one) - %name(GetNumberOfDaysInMonth) - static wxDateTime_t GetNumberOfDays(Month month, + %Rename(GetNumberOfDaysInMonth, + static wxDateTime_t, GetNumberOfDays(Month month, int year = Inv_Year, - Calendar cal = Gregorian); + Calendar cal = Gregorian)); // get the full (default) or abbreviated month name in the current // locale, returns empty string on error @@ -400,19 +400,19 @@ public: // constructors wxDateTime(); - %name(DateTimeFromTimeT)wxDateTime(time_t timet); - %name(DateTimeFromJDN)wxDateTime(double jdn); - %name(DateTimeFromHMS)wxDateTime(wxDateTime_t hour, + %RenameCtor(DateTimeFromTimeT, wxDateTime(time_t timet)); + %RenameCtor(DateTimeFromJDN, wxDateTime(double jdn)); + %RenameCtor(DateTimeFromHMS, wxDateTime(wxDateTime_t hour, wxDateTime_t minute = 0, wxDateTime_t second = 0, - wxDateTime_t millisec = 0); - %name(DateTimeFromDMY)wxDateTime(wxDateTime_t day, + wxDateTime_t millisec = 0)); + %RenameCtor(DateTimeFromDMY, wxDateTime(wxDateTime_t day, Month month = Inv_Month, int year = Inv_Year, wxDateTime_t hour = 0, wxDateTime_t minute = 0, wxDateTime_t second = 0, - wxDateTime_t millisec = 0); + wxDateTime_t millisec = 0)); ~wxDateTime(); @@ -422,16 +422,16 @@ public: wxDateTime& SetToCurrent(); // set to given time_t value - %name(SetTimeT)wxDateTime& Set(time_t timet); + %Rename(SetTimeT, wxDateTime&, Set(time_t timet)); // set to given JDN (beware of rounding errors) - %name(SetJDN)wxDateTime& Set(double jdn); + %Rename(SetJDN, wxDateTime&, Set(double jdn)); // set to given time, date = today - %name(SetHMS)wxDateTime& Set(wxDateTime_t hour, + %Rename(SetHMS, wxDateTime&, Set(wxDateTime_t hour, wxDateTime_t minute = 0, wxDateTime_t second = 0, - wxDateTime_t millisec = 0); + wxDateTime_t millisec = 0)); // from separate values for each component with explicit date // (defaults for month and year are the current values) @@ -681,15 +681,15 @@ public: // arithmetics with dates (see also below for more operators) // add a time span (positive or negative) - %name(AddTS) wxDateTime& Add(const wxTimeSpan& diff); + %Rename(AddTS, wxDateTime&, Add(const wxTimeSpan& diff)); // add a date span (positive or negative) - %name(AddDS) wxDateTime& Add(const wxDateSpan& diff); + %Rename(AddDS, wxDateTime&, Add(const wxDateSpan& diff)); // subtract a time span (positive or negative) - %name(SubtractTS) wxDateTime& Subtract(const wxTimeSpan& diff); + %Rename(SubtractTS, wxDateTime&, Subtract(const wxTimeSpan& diff)); // subtract a date span (positive or negative) - %name(SubtractDS) wxDateTime& Subtract(const wxDateSpan& diff); + %Rename(SubtractDS, wxDateTime&, Subtract(const wxDateSpan& diff)); // return the difference between two dates wxTimeSpan Subtract(const wxDateTime& dt) const; diff --git a/wxPython/src/_dc.i b/wxPython/src/_dc.i index 8d906f3d48..c69ad80675 100644 --- a/wxPython/src/_dc.i +++ b/wxPython/src/_dc.i @@ -95,7 +95,7 @@ Note: The present implementation for non-Windows platforms may fail to find colour borders if the pixels do not match the colour exactly. However the function will still return true.", ""); bool FloodFill(wxCoord x, wxCoord y, const wxColour& col, int style = wxFLOOD_SURFACE); - %name(FloodFillPoint) bool FloodFill(const wxPoint& pt, const wxColour& col, int style = wxFLOOD_SURFACE); + %Rename(FloodFillPoint, bool, FloodFill(const wxPoint& pt, const wxColour& col, int style = wxFLOOD_SURFACE)); DocStr( @@ -122,7 +122,7 @@ used for drawing the line. Note that the second point is *not* part of the line and is not drawn by this function (this is consistent with the behaviour of many other toolkits).", ""); void DrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2); - %name(DrawLinePoint) void DrawLine(const wxPoint& pt1, const wxPoint& pt2); + %Rename(DrawLinePoint, void, DrawLine(const wxPoint& pt1, const wxPoint& pt2)); DocStr( @@ -131,7 +131,7 @@ the behaviour of many other toolkits).", ""); horizontal line the height and width of the window, centred on the given point.", ""); void CrossHair(wxCoord x, wxCoord y); - %name(CrossHairPoint) void CrossHair(const wxPoint& pt); + %Rename(CrossHairPoint, void, CrossHair(const wxPoint& pt)); DocStr( @@ -143,14 +143,14 @@ and the current brush for filling the shape. The arc is drawn in an anticlockwise direction from the start point to the end point.", ""); void DrawArc(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2, wxCoord xc, wxCoord yc); - %name(DrawArcPoint) void DrawArc(const wxPoint& pt1, const wxPoint& pt2, const wxPoint& center); + %Rename(DrawArcPoint, void, DrawArc(const wxPoint& pt1, const wxPoint& pt2, const wxPoint& center)); DocStr( DrawCheckMark, "Draws a check mark inside the given rectangle.", ""); void DrawCheckMark(wxCoord x, wxCoord y, wxCoord width, wxCoord height); - %name(DrawCheckMarkRect) void DrawCheckMark(const wxRect& rect); + %Rename(DrawCheckMarkRect, void, DrawCheckMark(const wxRect& rect)); DocStr( DrawEllipticArc, @@ -164,14 +164,14 @@ rectangle. Angles are specified in degrees (360 is a complete circle). Positive values mean counter-clockwise motion. If start is equal to end, a complete ellipse will be drawn.", ""); void DrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h, double start, double end); - %name(DrawEllipticArcPointSize) void DrawEllipticArc(const wxPoint& pt, const wxSize& sz, double start, double end); + %Rename(DrawEllipticArcPointSize, void, DrawEllipticArc(const wxPoint& pt, const wxSize& sz, double start, double end)); DocStr( DrawPoint, "Draws a point using the current pen.", ""); void DrawPoint(wxCoord x, wxCoord y); - %name(DrawPointPoint) void DrawPoint(const wxPoint& pt); + %Rename(DrawPointPoint, void, DrawPoint(const wxPoint& pt)); DocStr( @@ -180,8 +180,8 @@ equal to end, a complete ellipse will be drawn.", ""); size. The current pen is used for the outline and the current brush for filling the shape.", ""); void DrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height); - %name(DrawRectangleRect)void DrawRectangle(const wxRect& rect); - %name(DrawRectanglePointSize) void DrawRectangle(const wxPoint& pt, const wxSize& sz); + %Rename(DrawRectangleRect,void, DrawRectangle(const wxRect& rect)); + %Rename(DrawRectanglePointSize, void, DrawRectangle(const wxPoint& pt, const wxSize& sz)); DocStr( @@ -198,8 +198,8 @@ means that the corner can be a sensible size relative to the size of the rectangle, and also avoids the strange effects X produces when the corners are too big for the rectangle.", ""); void DrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius); - %name(DrawRoundedRectangleRect) void DrawRoundedRectangle(const wxRect& r, double radius); - %name(DrawRoundedRectanglePointSize) void DrawRoundedRectangle(const wxPoint& pt, const wxSize& sz, double radius); + %Rename(DrawRoundedRectangleRect, void, DrawRoundedRectangle(const wxRect& r, double radius)); + %Rename(DrawRoundedRectanglePointSize, void, DrawRoundedRectangle(const wxPoint& pt, const wxSize& sz, double radius)); DocStr( @@ -210,7 +210,7 @@ shape.", " :see: `DrawEllipse`"); void DrawCircle(wxCoord x, wxCoord y, wxCoord radius); - %name(DrawCirclePoint) void DrawCircle(const wxPoint& pt, wxCoord radius); + %Rename(DrawCirclePoint, void, DrawCircle(const wxPoint& pt, wxCoord radius)); DocStr( @@ -220,8 +220,8 @@ is used for the outline and the current brush for filling the shape.", " :see: `DrawCircle`"); void DrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height); - %name(DrawEllipseRect) void DrawEllipse(const wxRect& rect); - %name(DrawEllipsePointSize) void DrawEllipse(const wxPoint& pt, const wxSize& sz); + %Rename(DrawEllipseRect, void, DrawEllipse(const wxRect& rect)); + %Rename(DrawEllipsePointSize, void, DrawEllipse(const wxPoint& pt, const wxSize& sz)); DocStr( @@ -230,7 +230,7 @@ is used for the outline and the current brush for filling the shape.", " PostScript). This can be the simplest way of drawing bitmaps on a window.", ""); void DrawIcon(const wxIcon& icon, wxCoord x, wxCoord y); - %name(DrawIconPoint) void DrawIcon(const wxIcon& icon, const wxPoint& pt); + %Rename(DrawIconPoint, void, DrawIcon(const wxIcon& icon, const wxPoint& pt)); DocStr( @@ -247,7 +247,7 @@ current text background colour to draw the background (all bits set to :see: `SetTextForeground`, `SetTextBackground` and `wx.MemoryDC`"); void DrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask = false); - %name(DrawBitmapPoint) void DrawBitmap(const wxBitmap &bmp, const wxPoint& pt, bool useMask = false); + %Rename(DrawBitmapPoint, void, DrawBitmap(const wxBitmap &bmp, const wxPoint& pt, bool useMask = false)); DocStr( @@ -265,7 +265,7 @@ logical functions with this function in portable programs.", " :see: `DrawRotatedText`"); void DrawText(const wxString& text, wxCoord x, wxCoord y); - %name(DrawTextPoint) void DrawText(const wxString& text, const wxPoint& pt); + %Rename(DrawTextPoint, void, DrawText(const wxString& text, const wxPoint& pt)); DocStr( @@ -279,7 +279,7 @@ font. ``wx.SWISS_FONT`` is an example of a font which is."," :see: `DrawText`"); void DrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle); - %name(DrawRotatedTextPoint) void DrawRotatedText(const wxString& text, const wxPoint& pt, double angle); + %Rename(DrawRotatedTextPoint, void, DrawRotatedText(const wxString& text, const wxPoint& pt, double angle)); DocDeclStr( @@ -347,9 +347,9 @@ screen is damaged.", " :see: `DestroyClippingRegion`, `wx.Region`"); void SetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height); - %name(SetClippingRegionPointSize) void SetClippingRegion(const wxPoint& pt, const wxSize& sz); - %name(SetClippingRegionAsRegion) void SetClippingRegion(const wxRegion& region); - %name(SetClippingRect) void SetClippingRegion(const wxRect& rect); + %Rename(SetClippingRegionPointSize, void, SetClippingRegion(const wxPoint& pt, const wxSize& sz)); + %Rename(SetClippingRegionAsRegion, void, SetClippingRegion(const wxRegion& region)); + %Rename(SetClippingRect, void, SetClippingRegion(const wxRect& rect)); @@ -1243,6 +1243,7 @@ class wxBufferedDC : public wxMemoryDC public: %pythonAppend wxBufferedDC "self.__dc = args[0] # save a ref so the other dc will not be deleted before self"; + %nokwargs wxBufferedDC; DocStr( @@ -1272,7 +1273,7 @@ public: // // TODO: Keep this one too? // %pythonAppend wxBufferedDC( wxDC *dc, const wxSize &area ) // "val.__dc = args[0] # save a ref so the other dc will not be deleted before self"; -// %name(BufferedDCInternalBuffer) wxBufferedDC( wxDC *dc, const wxSize &area ); +// %RenameCtor(BufferedDCInternalBuffer, wxBufferedDC( wxDC *dc, const wxSize &area )); // The buffer is blit to the real DC when the BufferedDC is destroyed. @@ -1590,11 +1591,6 @@ MustHaveApp(wxPrinterDC); class wxPrinterDC : public wxDC { public: wxPrinterDC(const wxPrintData& printData); -// %name(PrinterDC2) wxPrinterDC(const wxString& driver, -// const wxString& device, -// const wxString& output, -// bool interactive = true, -// int orientation = wxPORTRAIT); }; #else @@ -1604,19 +1600,12 @@ public: wxPrinterDC(const wxPrintData&) { wxPyRaiseNotImplemented(); } -// wxPrinterDC(const wxString&, const wxString&, const wxString&, bool, int) -// { wxPyRaiseNotImplemented(); } }; %} class wxPrinterDC : public wxDC { public: wxPrinterDC(const wxPrintData& printData); -// %name(PrinterDC2) wxPrinterDC(const wxString& driver, -// const wxString& device, -// const wxString& output, -// bool interactive = true, -// int orientation = wxPORTRAIT); }; #endif diff --git a/wxPython/src/_defs.i b/wxPython/src/_defs.i index 207b8eaf9c..6412f4c4fd 100644 --- a/wxPython/src/_defs.i +++ b/wxPython/src/_defs.i @@ -82,14 +82,16 @@ typedef unsigned long wxUIntPtr; %define MAKE_CONST_WXSTRING(strname) %{ static const wxString wxPy##strname(wx##strname); %} %immutable; - %name(strname) const wxString wxPy##strname; + %rename(strname) wxPy##strname; + const wxString wxPy##strname; %mutable; %enddef %define MAKE_CONST_WXSTRING2(strname, val) %{ static const wxString wxPy##strname(val); %} %immutable; - %name(strname) const wxString wxPy##strname; + %rename(strname) wxPy##strname; + const wxString wxPy##strname; %mutable; %enddef @@ -163,12 +165,14 @@ typedef unsigned long wxUIntPtr; #ifdef _DO_FULL_DOCS %define DocDeclStrName(type, decl, docstr, details, newname) %feature("docstring") decl docstr details; - %name(newname) type decl + %rename(newname) decl; + type decl %enddef #else %define DocDeclStrName(type, decl, docstr, details, newname) %feature("docstring") decl docstr; - %name(newname) type decl + %rename(newname) decl; + type decl %enddef #endif @@ -183,7 +187,8 @@ typedef unsigned long wxUIntPtr; // As above, but also give the decl a new %name %define DocDeclAName(type, decl, astr, newname) %feature("autodoc") decl astr; - %name(newname) type decl + %rename(newname) decl; + type decl %enddef @@ -210,13 +215,15 @@ typedef unsigned long wxUIntPtr; %define DocDeclAStrName(type, decl, astr, docstr, details, newname) %feature("autodoc") decl astr; %feature("docstring") decl docstr details; - %name(newname) type decl + %rename(newname) decl; + type decl %enddef #else %define DocDeclAStrName(type, decl, astr, docstr, details, newname) %feature("autodoc") decl astr; %feature("docstring") decl docstr; - %name(newname) type decl + %rename(newname) decl; + type decl %enddef #endif @@ -241,12 +248,14 @@ typedef unsigned long wxUIntPtr; #ifdef _DO_FULL_DOCS %define DocCtorStrName(decl, docstr, details, newname) %feature("docstring") decl docstr details; - %name(newname) decl + %rename(newname) decl; + decl %enddef #else %define DocCtorStrName(decl, docstr, details, newname) %feature("docstring") decl docstr; - %name(newname) decl + %rename(newname) decl; + decl %enddef #endif @@ -262,7 +271,8 @@ typedef unsigned long wxUIntPtr; // As above, but also give the decl a new %name %define DocCtorAName(decl, astr, newname) %feature("autodoc") decl astr; - %name(newname) decl + %rename(newname) decl; + decl %enddef @@ -290,13 +300,15 @@ typedef unsigned long wxUIntPtr; %define DocCtorAStrName(decl, astr, docstr, details, newname) %feature("autodoc") decl astr; %feature("docstring") decl docstr details; - %name(newname) decl + %rename(newname) decl; + decl %enddef #else %define DocCtorAStrName(decl, astr, docstr, details, newname) %feature("autodoc") decl astr; %feature("docstring") decl docstr; - %name(newname) decl + %rename(newname) decl; + decl %enddef #endif @@ -308,6 +320,20 @@ typedef unsigned long wxUIntPtr; } %enddef + +// A set of macros to make using %rename easier, since %name has been +// deprecated... +%define %Rename(newname, type, decl) + %rename(newname) decl; + type decl +%enddef + +%define %RenameCtor(newname, decl) + %rename(newname) decl; + decl +%enddef + + //--------------------------------------------------------------------------- // Forward declarations and %renames for some classes, so the autodoc strings // will be able to use the right types even when the real class declaration is diff --git a/wxPython/src/_dirctrl.i b/wxPython/src/_dirctrl.i index b33d701442..79a2d72a2a 100644 --- a/wxPython/src/_dirctrl.i +++ b/wxPython/src/_dirctrl.i @@ -70,7 +70,7 @@ public: const wxString& filter = wxPyEmptyString, int defaultFilter = 0, const wxString& name = wxPyTreeCtrlNameStr); - %name(PreGenericDirCtrl)wxGenericDirCtrl(); + %RenameCtor(PreGenericDirCtrl, wxGenericDirCtrl()); bool Create(wxWindow *parent, const wxWindowID id = -1, @@ -150,7 +150,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0); - %name(PreDirFilterListCtrl)wxDirFilterListCtrl(); + %RenameCtor(PreDirFilterListCtrl, wxDirFilterListCtrl()); bool Create(wxGenericDirCtrl* parent, const wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, diff --git a/wxPython/src/_dnd.i b/wxPython/src/_dnd.i index dfa264c4ae..a7f5e4ab3b 100644 --- a/wxPython/src/_dnd.i +++ b/wxPython/src/_dnd.i @@ -55,7 +55,8 @@ IMP_PYCALLBACK_BOOL_DR(wxPyDropSource, wxDropSource, GiveFeedback); %} -%name(DropSource) class wxPyDropSource { +%rename(DropSource) wxPyDropSource; +class wxPyDropSource { public: %pythonAppend wxPyDropSource "self._setCallbackInfo(self, DropSource, 0)" #ifndef __WXGTK__ @@ -115,7 +116,8 @@ IMP_PYCALLBACK_BOOL_INTINT(wxPyDropTarget, wxDropTarget, OnDrop); %} -%name(DropTarget) class wxPyDropTarget // : public wxDropTarget +%rename(DropTarget) wxPyDropTarget; +class wxPyDropTarget // : public wxDropTarget { public: %pythonAppend wxPyDropTarget @@ -178,7 +180,8 @@ IMP_PYCALLBACK_BOOL_INTINT(wxPyTextDropTarget, wxTextDropTarget, OnDrop); %} -%name(TextDropTarget) class wxPyTextDropTarget : public wxPyDropTarget { +%rename(TextDropTarget) wxPyTextDropTarget; +class wxPyTextDropTarget : public wxPyDropTarget { public: %pythonAppend wxPyTextDropTarget "self._setCallbackInfo(self, TextDropTarget)" @@ -238,7 +241,8 @@ IMP_PYCALLBACK_BOOL_INTINT(wxPyFileDropTarget, wxFileDropTarget, OnDrop); %} -%name(FileDropTarget) class wxPyFileDropTarget : public wxPyDropTarget +%rename(FileDropTarget) wxPyFileDropTarget; +class wxPyFileDropTarget : public wxPyDropTarget { public: %pythonAppend wxPyFileDropTarget "self._setCallbackInfo(self, FileDropTarget)" diff --git a/wxPython/src/_dragimg.i b/wxPython/src/_dragimg.i index a0f1d2cc09..d0d6eca9e7 100644 --- a/wxPython/src/_dragimg.i +++ b/wxPython/src/_dragimg.i @@ -26,22 +26,23 @@ MustHaveApp(wxGenericDragImage); -%name (DragImage) class wxGenericDragImage : public wxObject +%rename (DragImage) wxGenericDragImage; +class wxGenericDragImage : public wxObject { public: wxGenericDragImage(const wxBitmap& image, const wxCursor& cursor = wxNullCursor); - %name(DragIcon)wxGenericDragImage(const wxIcon& image, - const wxCursor& cursor = wxNullCursor); + %RenameCtor(DragIcon, wxGenericDragImage(const wxIcon& image, + const wxCursor& cursor = wxNullCursor)); - %name(DragString)wxGenericDragImage(const wxString& str, - const wxCursor& cursor = wxNullCursor); + %RenameCtor(DragString, wxGenericDragImage(const wxString& str, + const wxCursor& cursor = wxNullCursor)); - %name(DragTreeItem)wxGenericDragImage(const wxPyTreeCtrl& treeCtrl, wxTreeItemId& id); + %RenameCtor(DragTreeItem, wxGenericDragImage(const wxPyTreeCtrl& treeCtrl, wxTreeItemId& id)); - %name(DragListItem)wxGenericDragImage(const wxPyListCtrl& listCtrl, long id); + %RenameCtor(DragListItem, wxGenericDragImage(const wxPyListCtrl& listCtrl, long id)); ~wxGenericDragImage(); @@ -57,8 +58,8 @@ public: // Begin drag. hotspot is the location of the drag position relative to the upper-left // corner of the image. This is full screen only. fullScreenRect gives the // position of the window on the screen, to restrict the drag to. - %name(BeginDragBounded) bool BeginDrag(const wxPoint& hotspot, wxWindow* window, - wxWindow* boundingWindow); + %Rename(BeginDragBounded, bool, BeginDrag(const wxPoint& hotspot, wxWindow* window, + wxWindow* boundingWindow)); // End drag diff --git a/wxPython/src/_filesys.i b/wxPython/src/_filesys.i index fe7be734e8..a8addb513a 100644 --- a/wxPython/src/_filesys.i +++ b/wxPython/src/_filesys.i @@ -88,7 +88,8 @@ IMP_PYCALLBACK_STRING__pure(wxPyFileSystemHandler, wxFileSystemHandler, FindNext -%name(CPPFileSystemHandler) class wxFileSystemHandler //: public wxObject +%rename(CPPFileSystemHandler) wxFileSystemHandler; +class wxFileSystemHandler //: public wxObject { public: //wxFileSystemHandler(); @@ -96,7 +97,8 @@ public: -%name(FileSystemHandler) class wxPyFileSystemHandler : public wxFileSystemHandler +%rename(FileSystemHandler) wxPyFileSystemHandler; +class wxPyFileSystemHandler : public wxFileSystemHandler { public: %pythonAppend wxPyFileSystemHandler "self._setCallbackInfo(self, FileSystemHandler)"; diff --git a/wxPython/src/_font.i b/wxPython/src/_font.i index 51a138b0c5..7ee9fd9540 100644 --- a/wxPython/src/_font.i +++ b/wxPython/src/_font.i @@ -449,19 +449,21 @@ public: wxFontEncoding encoding=wxFONTENCODING_DEFAULT); ~wxFont(); - %name(FontFromNativeInfo) wxFont(const wxNativeFontInfo& info); + %RenameCtor(FontFromNativeInfo, wxFont(const wxNativeFontInfo& info)); %extend { - %name(FontFromNativeInfoString) wxFont(const wxString& info) { + %RenameCtor(FontFromNativeInfoString, wxFont(const wxString& info)) + { wxNativeFontInfo nfi; nfi.FromString(info); return new wxFont(nfi); } - %name(Font2) wxFont(int pointSize, - wxFontFamily family, - int flags = wxFONTFLAG_DEFAULT, - const wxString& face = wxPyEmptyString, - wxFontEncoding encoding = wxFONTENCODING_DEFAULT) { + %RenameCtor(Font2, wxFont(int pointSize, + wxFontFamily family, + int flags = wxFONTFLAG_DEFAULT, + const wxString& face = wxPyEmptyString, + wxFontEncoding encoding = wxFONTENCODING_DEFAULT)) + { return wxFont::New(pointSize, family, flags, face, encoding); } } @@ -469,13 +471,14 @@ public: // There is a real ctor for this on wxMSW, but not the others, so just use // the factory funciton in all cases. %extend { - %name(FontFromPixelSize) wxFont(const wxSize& pixelSize, - int family, - int style, - int weight, - bool underlined = false, - const wxString& face = wxEmptyString, - wxFontEncoding encoding = wxFONTENCODING_DEFAULT) { + %RenameCtor(FontFromPixelSize, wxFont(const wxSize& pixelSize, + int family, + int style, + int weight, + bool underlined = false, + const wxString& face = wxEmptyString, + wxFontEncoding encoding = wxFONTENCODING_DEFAULT)) + { return wxFontBase::New(pixelSize, family, style, weight, underlined, face, encoding); @@ -521,7 +524,7 @@ public: virtual void SetUnderlined( bool underlined ); virtual void SetEncoding(wxFontEncoding encoding); void SetNativeFontInfo(const wxNativeFontInfo& info); - %name(SetNativeFontInfoFromString) void SetNativeFontInfo(const wxString& info); + %Rename(SetNativeFontInfoFromString, void, SetNativeFontInfo(const wxString& info)); void SetNativeFontInfoUserDesc(const wxString& info); // translate the fonts into human-readable string (i.e. GetStyleString() @@ -565,7 +568,8 @@ IMP_PYCALLBACK_BOOL_STRINGSTRING(wxPyFontEnumerator, wxFontEnumerator, OnFontEnc MustHaveApp(wxPyFontEnumerator); -%name(FontEnumerator) class wxPyFontEnumerator { +%rename(FontEnumerator) wxPyFontEnumerator; +class wxPyFontEnumerator { public: %pythonAppend wxPyFontEnumerator "self._setCallbackInfo(self, FontEnumerator, 0)" diff --git a/wxPython/src/_gauge.i b/wxPython/src/_gauge.i index 21f1472d7a..97759d64b0 100644 --- a/wxPython/src/_gauge.i +++ b/wxPython/src/_gauge.i @@ -42,7 +42,7 @@ public: long style = wxGA_HORIZONTAL, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxPyGaugeNameStr); - %name(PreGauge)wxGauge(); + %RenameCtor(PreGauge, wxGauge()); bool Create(wxWindow* parent, wxWindowID id=-1, int range=100, const wxPoint& pos = wxDefaultPosition, diff --git a/wxPython/src/_gbsizer.i b/wxPython/src/_gbsizer.i index 9d375953a8..483c92f441 100644 --- a/wxPython/src/_gbsizer.i +++ b/wxPython/src/_gbsizer.i @@ -221,12 +221,13 @@ are created automatically when the sizer's Add method is called.", ""); %extend { DocStr(wxGBSizerItem( wxWindow *window, const wxGBPosition& pos,const wxGBSpan& span,int flag,int border,PyObject* userData=NULL ), "Construct a `wx.GBSizerItem` for a window.", ""); - %name(GBSizerItemWindow) wxGBSizerItem( wxWindow *window, - const wxGBPosition& pos, - const wxGBSpan& span, - int flag, - int border, - PyObject* userData=NULL ) + + %RenameCtor(GBSizerItemWindow, wxGBSizerItem( wxWindow *window, + const wxGBPosition& pos, + const wxGBSpan& span, + int flag, + int border, + PyObject* userData=NULL )) { wxPyUserData* data = NULL; if ( userData ) { @@ -240,12 +241,12 @@ are created automatically when the sizer's Add method is called.", ""); DocStr(wxGBSizerItem( wxSizer *sizer,const wxGBPosition& pos,const wxGBSpan& span,int flag,int border,PyObject* userData=NULL ), "Construct a `wx.GBSizerItem` for a sizer", ""); - %name(GBSizerItemSizer) wxGBSizerItem( wxSizer *sizer, - const wxGBPosition& pos, - const wxGBSpan& span, - int flag, - int border, - PyObject* userData=NULL ) + %RenameCtor(GBSizerItemSizer, wxGBSizerItem( wxSizer *sizer, + const wxGBPosition& pos, + const wxGBSpan& span, + int flag, + int border, + PyObject* userData=NULL )) { wxPyUserData* data = NULL; if ( userData ) { @@ -259,13 +260,13 @@ are created automatically when the sizer's Add method is called.", ""); DocStr(wxGBSizerItem( int width,int height,const wxGBPosition& pos,const wxGBSpan& span,int flag,int border,PyObject* userData=NULL), "Construct a `wx.GBSizerItem` for a spacer.", ""); - %name(GBSizerItemSpacer) wxGBSizerItem( int width, - int height, - const wxGBPosition& pos, - const wxGBSpan& span, - int flag, - int border, - PyObject* userData=NULL) + %RenameCtor(GBSizerItemSpacer, wxGBSizerItem( int width, + int height, + const wxGBPosition& pos, + const wxGBSpan& span, + int flag, + int border, + PyObject* userData=NULL)) { wxPyUserData* data = NULL; if ( userData ) { diff --git a/wxPython/src/_gdicmn.i b/wxPython/src/_gdicmn.i index a80f17890f..5b62dd38d2 100644 --- a/wxPython/src/_gdicmn.i +++ b/wxPython/src/_gdicmn.i @@ -113,15 +113,15 @@ enum wxStockCursor DocStr( wxSize, "wx.Size is a useful data structure used to represent the size of -something. It simply contians integer width and height proprtites. -In most places in wxPython where a wx.Size is expected a -(width,height) tuple can be used instead.", ""); +something. It simply contians integer width and height +proprtites. In most places in wxPython where a wx.Size is +expected a (width, height) tuple can be used instead.", ""); class wxSize { public: - %name(width) int x; - %name(height)int y; + %Rename(width, int, x); + %Rename(height,int, y); %pythoncode { x = width; y = height } DocCtorStr( @@ -532,7 +532,7 @@ bottom, otherwise it is moved to the left or top respectively.", "", DocStr( Inside, "Return True if the point is (not strcitly) inside the rect.", ""); - %name(InsideXY)bool Inside(int x, int y) const; + %Rename(InsideXY, bool, Inside(int x, int y) const); bool Inside(const wxPoint& pt) const; DocDeclStr( @@ -626,8 +626,8 @@ class wxPoint2D public: DocStr(wxPoint2D, "Create a w.Point2D object.", ""); wxPoint2D( double x=0.0 , double y=0.0 ); - %name(Point2DCopy) wxPoint2D( const wxPoint2D &pt ); - %name(Point2DFromPoint) wxPoint2D( const wxPoint &pt ); + %RenameCtor(Point2DCopy, wxPoint2D( const wxPoint2D &pt )); + %RenameCtor(Point2DFromPoint, wxPoint2D( const wxPoint &pt )); DocDeclAStr( void, GetFloor( int *OUTPUT , int *OUTPUT ) const, @@ -677,8 +677,8 @@ public: bool, operator!=(const wxPoint2D& pt) const, "Test for inequality", ""); - %name(x)double m_x; - %name(y)double m_y; + %Rename(x, double, m_x); + %Rename(y, double, m_y); %extend { void Set( double x=0 , double y=0 ) { diff --git a/wxPython/src/_icon.i b/wxPython/src/_icon.i index f43e09910b..d117a99ff6 100644 --- a/wxPython/src/_icon.i +++ b/wxPython/src/_icon.i @@ -30,15 +30,17 @@ public: ~wxIcon(); // alternate constructors - %name(EmptyIcon) wxIcon(); - %name(IconFromLocation) wxIcon(const wxIconLocation& loc); + %RenameCtor(EmptyIcon, wxIcon()); + %RenameCtor(IconFromLocation, wxIcon(const wxIconLocation& loc)); %extend { - %name(IconFromBitmap) wxIcon(const wxBitmap& bmp) { + %RenameCtor(IconFromBitmap, wxIcon(const wxBitmap& bmp)) + { wxIcon* icon = new wxIcon(); icon->CopyFromBitmap(bmp); return icon; } - %name(IconFromXPMData) wxIcon(PyObject* listOfStrings) { + %RenameCtor(IconFromXPMData, wxIcon(PyObject* listOfStrings)) + { char** cArray = NULL; wxIcon* icon; @@ -136,10 +138,10 @@ public: wxIconBundle(); // initializes the bundle with the icon(s) found in the file - %name(IconBundleFromFile) wxIconBundle( const wxString& file, long type ); + %RenameCtor(IconBundleFromFile, wxIconBundle( const wxString& file, long type )); // initializes the bundle with a single icon - %name(IconBundleFromIcon)wxIconBundle( const wxIcon& icon ); + %RenameCtor(IconBundleFromIcon, wxIconBundle( const wxIcon& icon )); ~wxIconBundle(); @@ -151,7 +153,7 @@ public: // adds all the icons contained in the file to the collection, // if the collection already contains icons with the same // width and height, they are replaced - %name(AddIconFromFile)void AddIcon( const wxString& file, long type ); + %Rename(AddIconFromFile,void, AddIcon( const wxString& file, long type )); // returns the icon with the given size; if no such icon exists, // returns the icon with size wxSYS_ICON_[XY]; if no such icon exists, diff --git a/wxPython/src/_image.i b/wxPython/src/_image.i index ea4cca9f10..4309d556b6 100644 --- a/wxPython/src/_image.i +++ b/wxPython/src/_image.i @@ -76,15 +76,32 @@ success flag and rgb values.", ""); class wxImage : public wxObject { public: - wxImage( const wxString& name, long type = wxBITMAP_TYPE_ANY, int index = -1 ); + DocCtorStr( + wxImage( const wxString& name, long type = wxBITMAP_TYPE_ANY, int index = -1 ), + "", ""); + ~wxImage(); // Alternate constructors - %name(ImageFromMime) wxImage(const wxString& name, const wxString& mimetype, int index = -1); - %name(ImageFromStream) wxImage(wxInputStream& stream, long type = wxBITMAP_TYPE_ANY, int index = -1); - %name(ImageFromStreamMime) wxImage(wxInputStream& stream, const wxString& mimetype, int index = -1 ); + DocCtorStrName( + wxImage(const wxString& name, const wxString& mimetype, int index = -1), + "", "", + ImageFromMime); + + DocCtorStrName( + wxImage(wxInputStream& stream, long type = wxBITMAP_TYPE_ANY, int index = -1), + "", "", + ImageFromStream); + + DocCtorStrName( + wxImage(wxInputStream& stream, const wxString& mimetype, int index = -1 ), + "", "", + ImageFromStreamMime); + %extend { - %name(EmptyImage) wxImage(int width=0, int height=0, bool clear = true) { + %rename(EmptyImage) wxImage(int width=0, int height=0, bool clear = true); + wxImage(int width=0, int height=0, bool clear = true) + { if (width > 0 && height > 0) return new wxImage(width, height, clear); else @@ -92,11 +109,15 @@ public: } MustHaveApp(wxImage(const wxBitmap &bitmap)); - %name(ImageFromBitmap) wxImage(const wxBitmap &bitmap) { + %rename(ImageFromBitmap) wxImage(const wxBitmap &bitmap); + wxImage(const wxBitmap &bitmap) + { return new wxImage(bitmap.ConvertToImage()); } - %name(ImageFromData) wxImage(int width, int height, unsigned char* data) { + %rename(ImageFromData) wxImage(int width, int height, unsigned char* data); + wxImage(int width, int height, unsigned char* data) + { // Copy the source data so the wxImage can clean it up later unsigned char* copy = (unsigned char*)malloc(width*height*3); if (copy == NULL) { @@ -106,8 +127,11 @@ public: memcpy(copy, data, width*height*3); return new wxImage(width, height, copy, false); } - %name(ImageFromDataWithAlpha) wxImage(int width, int height, - unsigned char* data, unsigned char* alpha) { + + + %rename(ImageFromDataWithAlpha) wxImage(int width, int height, unsigned char* data, unsigned char* alpha); + wxImage(int width, int height, unsigned char* data, unsigned char* alpha) + { // Copy the source data so the wxImage can clean it up later unsigned char* dcopy = (unsigned char*)malloc(width*height*3); if (dcopy == NULL) { @@ -190,14 +214,14 @@ The method will then fill up the whole image with the colour given.", ""); static int GetImageCount( const wxString& name, long type = wxBITMAP_TYPE_ANY ); bool LoadFile( const wxString& name, long type = wxBITMAP_TYPE_ANY, int index = -1 ); - %name(LoadMimeFile)bool LoadFile( const wxString& name, const wxString& mimetype, int index = -1 ); + %Rename(LoadMimeFile, bool, LoadFile( const wxString& name, const wxString& mimetype, int index = -1 )); bool SaveFile( const wxString& name, int type ); - %name(SaveMimeFile)bool SaveFile( const wxString& name, const wxString& mimetype ); + %Rename(SaveMimeFile, bool, SaveFile( const wxString& name, const wxString& mimetype )); - %name(CanReadStream) static bool CanRead( wxInputStream& stream ); - %name(LoadStream) bool LoadFile( wxInputStream& stream, long type = wxBITMAP_TYPE_ANY, int index = -1 ); - %name(LoadMimeStream) bool LoadFile( wxInputStream& stream, const wxString& mimetype, int index = -1 ); + %Rename(CanReadStream, static bool, CanRead( wxInputStream& stream )); + %Rename(LoadStream, bool, LoadFile( wxInputStream& stream, long type = wxBITMAP_TYPE_ANY, int index = -1 )); + %Rename(LoadMimeStream, bool, LoadFile( wxInputStream& stream, const wxString& mimetype, int index = -1 )); bool Ok(); int GetWidth(); @@ -341,7 +365,7 @@ The method will then fill up the whole image with the colour given.", ""); wxImage ConvertToMono( unsigned char r, unsigned char g, unsigned char b ) const; void SetOption(const wxString& name, const wxString& value); - %name(SetOptionInt)void SetOption(const wxString& name, int value); + %Rename(SetOptionInt, void, SetOption(const wxString& name, int value)); wxString GetOption(const wxString& name) const; int GetOptionInt(const wxString& name) const; bool HasOption(const wxString& name) const; diff --git a/wxPython/src/_imaglist.i b/wxPython/src/_imaglist.i index b5df300010..f2b32ab3fe 100644 --- a/wxPython/src/_imaglist.i +++ b/wxPython/src/_imaglist.i @@ -47,12 +47,12 @@ public: ~wxImageList(); int Add(const wxBitmap& bitmap, const wxBitmap& mask = wxNullBitmap); - %name(AddWithColourMask)int Add(const wxBitmap& bitmap, const wxColour& maskColour); - %name(AddIcon)int Add(const wxIcon& icon); + %Rename(AddWithColourMask,int, Add(const wxBitmap& bitmap, const wxColour& maskColour)); + %Rename(AddIcon,int, Add(const wxIcon& icon)); #ifdef __WXMSW__ bool Replace(int index, const wxBitmap& bitmap, const wxBitmap& mask = wxNullBitmap); #else -// %name(ReplaceIcon)bool Replace(int index, const wxIcon& icon); +// %Rename(ReplaceIcon,bool, Replace(int index, const wxIcon& icon)); // int Add(const wxBitmap& bitmap); bool Replace(int index, const wxBitmap& bitmap); #endif diff --git a/wxPython/src/_listbox.i b/wxPython/src/_listbox.i index 63f0324ac1..41fdd0eb02 100644 --- a/wxPython/src/_listbox.i +++ b/wxPython/src/_listbox.i @@ -42,7 +42,7 @@ public: long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxPyListBoxNameStr); - %name(PreListBox)wxListBox(); + %RenameCtor(PreListBox, wxListBox()); bool Create(wxWindow* parent, wxWindowID id=-1, const wxPoint& pos = wxDefaultPosition, @@ -95,7 +95,7 @@ public: // set the specified item at the first visible item or scroll to max // range. void SetFirstItem(int n); - %name(SetFirstItemStr) void SetFirstItem(const wxString& s); + %Rename(SetFirstItemStr, void, SetFirstItem(const wxString& s)); // ensures that the given item is visible scrolling the listbox if // necessary @@ -156,7 +156,7 @@ public: long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxPyListBoxNameStr); - %name(PreCheckListBox)wxCheckListBox(); + %RenameCtor(PreCheckListBox, wxCheckListBox()); bool Create(wxWindow *parent, wxWindowID id=-1, const wxPoint& pos = wxDefaultPosition, @@ -176,7 +176,7 @@ public: // return the index of the item at this position or wxNOT_FOUND int HitTest(const wxPoint& pt) const; - %name(HitTestXY)int HitTest(wxCoord x, wxCoord y) const; + %Rename(HitTestXY, int, HitTest(wxCoord x, wxCoord y) const); }; //--------------------------------------------------------------------------- diff --git a/wxPython/src/_listctrl.i b/wxPython/src/_listctrl.i index c342e9517f..0d3269c53f 100644 --- a/wxPython/src/_listctrl.i +++ b/wxPython/src/_listctrl.i @@ -406,7 +406,8 @@ IMP_PYCALLBACK_INT_LONG_virtual(wxPyListCtrl, wxListCtrl, OnGetItemImage); MustHaveApp(wxPyListCtrl); -%name(ListCtrl)class wxPyListCtrl : public wxControl { +%rename(ListCtrl) wxPyListCtrl; +class wxPyListCtrl : public wxControl { public: %pythonAppend wxPyListCtrl "self._setOORInfo(self);self._setCallbackInfo(self, ListCtrl)" @@ -418,7 +419,7 @@ public: long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxPyListCtrlNameStr); - %name(PreListCtrl)wxPyListCtrl(); + %RenameCtor(PreListCtrl, wxPyListCtrl()); bool Create(wxWindow* parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, @@ -494,7 +495,7 @@ public: bool SetItem(wxListItem& info) ; // Sets a string field at a particular column - %name(SetStringItem)long SetItem(long index, int col, const wxString& label, int imageId = -1); + %Rename(SetStringItem, long, SetItem(long index, int col, const wxString& label, int imageId = -1)); // Gets the item state int GetItemState(long item, long stateMask) const ; @@ -637,11 +638,11 @@ public: // Find an item whose data matches this data, starting from the item after 'start' // or the beginning if 'start' is -1. - %name(FindItemData) long FindItem(long start, long data); + %Rename(FindItemData, long, FindItem(long start, long data)); // Find an item nearest this position in the specified direction, starting from // the item after 'start' or the beginning if 'start' is -1. - %name(FindItemAtPos) long FindItem(long start, const wxPoint& pt, int direction); + %Rename(FindItemAtPos, long, FindItem(long start, const wxPoint& pt, int direction)); DocDeclAStr( @@ -655,16 +656,16 @@ details in the second return value (see wxLIST_HITTEST_... flags.)", ""); long InsertItem(wxListItem& info); // Insert a string item - %name(InsertStringItem) long InsertItem(long index, const wxString& label); + %Rename(InsertStringItem, long, InsertItem(long index, const wxString& label)); // Insert an image item - %name(InsertImageItem) long InsertItem(long index, int imageIndex); + %Rename(InsertImageItem, long, InsertItem(long index, int imageIndex)); // Insert an image/string item - %name(InsertImageStringItem) long InsertItem(long index, const wxString& label, int imageIndex); + %Rename(InsertImageStringItem, long, InsertItem(long index, const wxString& label, int imageIndex)); // For list view mode (only), inserts a column. - %name(InsertColumnInfo) long InsertColumn(long col, wxListItem& info); + %Rename(InsertColumnInfo, long, InsertColumn(long col, wxListItem& info)); long InsertColumn(long col, const wxString& heading, @@ -802,7 +803,7 @@ public: long style = wxLC_REPORT, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxPyListCtrlNameStr); - %name(PreListView)wxListView(); + %RenameCtor(PreListView, wxListView()); bool Create( wxWindow *parent, wxWindowID id = -1, diff --git a/wxPython/src/_log.i b/wxPython/src/_log.i index 17a737e292..1010059672 100644 --- a/wxPython/src/_log.i +++ b/wxPython/src/_log.i @@ -302,22 +302,22 @@ const wxString wxSysErrorMsg(unsigned long nErrCode = 0); %} -%name(LogFatalError) void wxPyLogFatalError(const wxString& msg); -%name(LogError) void wxPyLogError(const wxString& msg); -%name(LogWarning) void wxPyLogWarning(const wxString& msg); -%name(LogMessage) void wxPyLogMessage(const wxString& msg); -%name(LogInfo) void wxPyLogInfo(const wxString& msg); -%name(LogDebug) void wxPyLogDebug(const wxString& msg); -%name(LogVerbose) void wxPyLogVerbose(const wxString& msg); -%name(LogStatus) void wxPyLogStatus(const wxString& msg); -%name(LogStatusFrame) void wxPyLogStatusFrame(wxFrame *pFrame, const wxString& msg); -%name(LogSysError) void wxPyLogSysError(const wxString& msg); - -%name(LogGeneric) void wxPyLogGeneric(unsigned long level, const wxString& msg); +%Rename(LogFatalError, void, wxPyLogFatalError(const wxString& msg)); +%Rename(LogError, void, wxPyLogError(const wxString& msg)); +%Rename(LogWarning, void, wxPyLogWarning(const wxString& msg)); +%Rename(LogMessage, void, wxPyLogMessage(const wxString& msg)); +%Rename(LogInfo, void, wxPyLogInfo(const wxString& msg)); +%Rename(LogDebug, void, wxPyLogDebug(const wxString& msg)); +%Rename(LogVerbose, void, wxPyLogVerbose(const wxString& msg)); +%Rename(LogStatus, void, wxPyLogStatus(const wxString& msg)); +%Rename(LogStatusFrame, void, wxPyLogStatusFrame(wxFrame *pFrame, const wxString& msg)); +%Rename(LogSysError, void, wxPyLogSysError(const wxString& msg)); + +%Rename(LogGeneric, void, wxPyLogGeneric(unsigned long level, const wxString& msg)); %nokwargs wxPyLogTrace; -%name(LogTrace) void wxPyLogTrace(unsigned long mask, const wxString& msg); -%name(LogTrace) void wxPyLogTrace(const wxString& mask, const wxString& msg); +%Rename(LogTrace, void, wxPyLogTrace(unsigned long mask, const wxString& msg)); +%Rename(LogTrace, void, wxPyLogTrace(const wxString& mask, const wxString& msg)); // wxLogFatalError helper: show the (fatal) error to the user in a safe way, diff --git a/wxPython/src/_mdi.i b/wxPython/src/_mdi.i index ae3d1f9fbb..1ad5530ff7 100644 --- a/wxPython/src/_mdi.i +++ b/wxPython/src/_mdi.i @@ -47,7 +47,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, const wxString& name = wxPyFrameNameStr); - %name(PreMDIParentFrame)wxMDIParentFrame(); + %RenameCtor(PreMDIParentFrame, wxMDIParentFrame()); bool Create(wxWindow *parent, const wxWindowID id=-1, @@ -95,7 +95,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxPyFrameNameStr); - %name(PreMDIChildFrame)wxMDIChildFrame(); + %RenameCtor(PreMDIChildFrame, wxMDIChildFrame()); // Turn it back on again %typemap(out) wxMDIChildFrame* { $result = wxPyMake_wxObject($1, $owner); } @@ -126,7 +126,7 @@ public: %typemap(out) wxMDIClientWindow*; // turn off this typemap wxMDIClientWindow(wxMDIParentFrame* parent, long style = 0); - %name(PreMDIClientWindow)wxMDIClientWindow(); + %RenameCtor(PreMDIClientWindow, wxMDIClientWindow()); // Turn it back on again %typemap(out) wxMDIClientWindow* { $result = wxPyMake_wxObject($1, $owner); } diff --git a/wxPython/src/_menu.i b/wxPython/src/_menu.i index e1407bad00..9e9d7e7f4b 100644 --- a/wxPython/src/_menu.i +++ b/wxPython/src/_menu.i @@ -50,20 +50,20 @@ public: const wxString& text, const wxString& help = wxPyEmptyString); // append a submenu - %name(AppendMenu) wxMenuItem* Append(int id, - const wxString& text, - wxMenu *submenu, - const wxString& help = wxPyEmptyString); + %Rename(AppendMenu, wxMenuItem*, Append(int id, + const wxString& text, + wxMenu *submenu, + const wxString& help = wxPyEmptyString)); // the most generic form of Append() - append anything - %name(AppendItem) wxMenuItem* Append(wxMenuItem *item); + %Rename(AppendItem, wxMenuItem*, Append(wxMenuItem *item)); // insert a break in the menu (only works when appending the items, not // inserting them) virtual void Break(); // insert an item before given position - %name(InsertItem) wxMenuItem* Insert(size_t pos, wxMenuItem *item); + %Rename(InsertItem, wxMenuItem*, Insert(size_t pos, wxMenuItem *item)); // insert an item before given position wxMenuItem* Insert(size_t pos, @@ -88,14 +88,14 @@ public: const wxString& help = wxPyEmptyString); // insert a submenu - %name(InsertMenu) wxMenuItem* Insert(size_t pos, + %Rename(InsertMenu, wxMenuItem*, Insert(size_t pos, int id, const wxString& text, wxMenu *submenu, - const wxString& help = wxPyEmptyString); + const wxString& help = wxPyEmptyString)); // prepend an item to the menu - %name(PrependItem) wxMenuItem* Prepend(wxMenuItem *item); + %Rename(PrependItem, wxMenuItem*, Prepend(wxMenuItem *item)); // prepend any item to the menu wxMenuItem* Prepend(int id, @@ -117,26 +117,26 @@ public: const wxString& help = wxPyEmptyString); // prepend a submenu - %name(PrependMenu) wxMenuItem* Prepend(int id, + %Rename(PrependMenu, wxMenuItem*, Prepend(int id, const wxString& text, wxMenu *submenu, - const wxString& help = wxPyEmptyString); + const wxString& help = wxPyEmptyString)); // detach an item from the menu, but don't delete it so that it can be // added back later (but if it's not, the caller is responsible for // deleting it!) wxMenuItem *Remove(int id); - %name(RemoveItem) wxMenuItem *Remove(wxMenuItem *item); + %Rename(RemoveItem, wxMenuItem*, Remove(wxMenuItem *item)); // delete an item from the menu (submenus are not destroyed by this // function, see Destroy) bool Delete(int id); - %name(DeleteItem) bool Delete(wxMenuItem *item); + %Rename(DeleteItem, bool, Delete(wxMenuItem *item)); // delete the item from menu and destroy it (if it's a submenu) %extend { void Destroy() { delete self; } } - %name(DestroyId) bool Destroy(int id); - %name(DestroyItem) bool Destroy(wxMenuItem *item); + %Rename(DestroyId, bool, Destroy(int id)); + %Rename(DestroyItem, bool, Destroy(wxMenuItem *item)); // get the items @@ -150,7 +150,7 @@ public: // search int FindItem(const wxString& item) const; - %name(FindItemById) wxMenuItem* FindItem(int id /*, wxMenu **menu = NULL*/) const; + %Rename(FindItemById, wxMenuItem*, FindItem(int id /*, wxMenu **menu = NULL*/) const); // find by position wxMenuItem* FindItemByPosition(size_t position) const; @@ -263,7 +263,7 @@ public: // find item by id (in any menu), returns NULL if not found // // if menu is !NULL, it will be filled with wxMenu this item belongs to - %name(FindItemById) virtual wxMenuItem* FindItem(int id /*, wxMenu **menu = NULL*/) const; + %Rename(FindItemById, virtual wxMenuItem*, FindItem(int id /*, wxMenu **menu = NULL*/) const); // find menu by its caption, return wxNOT_FOUND on failure int FindMenu(const wxString& title) const; diff --git a/wxPython/src/_mimetype.i b/wxPython/src/_mimetype.i index 36098c8f7a..5935b7dd31 100644 --- a/wxPython/src/_mimetype.i +++ b/wxPython/src/_mimetype.i @@ -48,11 +48,11 @@ public: // the array elements correspond to the parameters of the ctor above in // the same order - %name(FileTypeInfoSequence)wxFileTypeInfo(const wxArrayString& sArray); + %Rename(FileTypeInfoSequence,, wxFileTypeInfo(const wxArrayString& sArray)); // invalid item - use this to terminate the array passed to // wxMimeTypesManager::AddFallbacks - %name(NullFileTypeInfo)wxFileTypeInfo(); + %Rename(NullFileTypeInfo,, wxFileTypeInfo()); // test if this object can be used diff --git a/wxPython/src/_misc.i b/wxPython/src/_misc.i index 3390427f94..15d4c69340 100644 --- a/wxPython/src/_misc.i +++ b/wxPython/src/_misc.i @@ -62,9 +62,9 @@ public: wxWindow *GetWindow(); - %name(MoveXY)void Move(int x, int y); + %Rename(MoveXY, void, Move(int x, int y)); void Move(const wxPoint& pt); - %name(SetSizeWH) void SetSize(int width, int height); + %Rename(SetSizeWH, void, SetSize(int width, int height)); void SetSize(const wxSize& size); void Show(int show = true); void Hide(); @@ -159,7 +159,7 @@ public: void Save(wxConfigBase& config); void AddFilesToMenu(); - %name(AddFilesToThisMenu)void AddFilesToMenu(wxMenu* menu); + %Rename(AddFilesToThisMenu, void, AddFilesToMenu(wxMenu* menu)); // Accessors wxString GetHistoryFile(int i) const; @@ -184,7 +184,7 @@ public: const wxString& path = wxPyEmptyString); // default ctor, use Create() after it - %name(PreSingleInstanceChecker) wxSingleInstanceChecker(); + %RenameCtor(PreSingleInstanceChecker, wxSingleInstanceChecker()); ~wxSingleInstanceChecker(); diff --git a/wxPython/src/_notebook.i b/wxPython/src/_notebook.i index e0dfafc31f..aa897f2220 100644 --- a/wxPython/src/_notebook.i +++ b/wxPython/src/_notebook.i @@ -36,7 +36,7 @@ public: // const wxSize& size = wxDefaultSize, // long style = 0, // const wxString& name = wxPyEmptyString); -// %name(PreBookCtrlBase)wxBookCtrlBase(); +// %RenameCtor(PreBookCtrlBase, wxBookCtrlBase()); // bool Create(wxWindow *parent, // wxWindowID id, // const wxPoint& pos = wxDefaultPosition, @@ -179,7 +179,7 @@ public: const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxPyNOTEBOOK_NAME); - %name(PreNotebook)wxNotebook(); + %RenameCtor(PreNotebook, wxNotebook()); // Turn it back on again %typemap(out) wxNotebook* { $result = wxPyMake_wxObject($1, $owner); } @@ -307,7 +307,7 @@ public: const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxPyEmptyString); - %name(PreListbook)wxListbook(); + %RenameCtor(PreListbook, wxListbook()); bool Create(wxWindow *parent, wxWindowID id=-1, @@ -371,7 +371,7 @@ public: const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxPyEmptyString); - %name(PreChoicebook)wxChoicebook(); + %RenameCtor(PreChoicebook, wxChoicebook()); // quasi ctor bool Create(wxWindow *parent, diff --git a/wxPython/src/_panel.i b/wxPython/src/_panel.i index 1a32e3cc0c..881ceefcec 100644 --- a/wxPython/src/_panel.i +++ b/wxPython/src/_panel.i @@ -37,7 +37,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL | wxNO_BORDER, const wxString& name = wxPyPanelNameStr); - %name(PrePanel)wxPanel(); + %RenameCtor(PrePanel, wxPanel()); // Turn it back on again %typemap(out) wxPanel* { $result = wxPyMake_wxObject($1, $owner); } @@ -96,7 +96,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxHSCROLL | wxVSCROLL, const wxString& name = wxPyPanelNameStr); - %name(PreScrolledWindow)wxScrolledWindow(); + %RenameCtor(PreScrolledWindow, wxScrolledWindow()); // Turn it back on again %typemap(out) wxScrolledWindow* { $result = wxPyMake_wxObject($1, $owner); } diff --git a/wxPython/src/_popupwin.i b/wxPython/src/_popupwin.i index 706fbccab0..ec47753500 100644 --- a/wxPython/src/_popupwin.i +++ b/wxPython/src/_popupwin.i @@ -35,7 +35,7 @@ public: %pythonAppend wxPopupWindow() "" wxPopupWindow(wxWindow *parent, int flags = wxBORDER_NONE); - %name(PrePopupWindow)wxPopupWindow(); + %RenameCtor(PrePopupWindow, wxPopupWindow()); bool Create(wxWindow *parent, int flags = wxBORDER_NONE); @@ -81,14 +81,15 @@ MustHaveApp(wxPyPopupTransientWindow); // wxPopupTransientWindow: a wxPopupWindow which disappears automatically // when the user clicks mouse outside it or if it loses focus in any other way -%name(PopupTransientWindow) class wxPyPopupTransientWindow : public wxPopupWindow +%rename(PopupTransientWindow) wxPyPopupTransientWindow; +class wxPyPopupTransientWindow : public wxPopupWindow { public: %pythonAppend wxPyPopupTransientWindow "self._setOORInfo(self);self._setCallbackInfo(self, PopupTransientWindow)" %pythonAppend wxPyPopupTransientWindow() "" wxPyPopupTransientWindow(wxWindow *parent, int style = wxBORDER_NONE); - %name(PrePopupTransientWindow)wxPyPopupTransientWindow(); + %RenameCtor(PrePopupTransientWindow, wxPyPopupTransientWindow()); void _setCallbackInfo(PyObject* self, PyObject* _class); @@ -124,14 +125,15 @@ public: class wxPopupWindow : public wxWindow { public: wxPopupWindow(wxWindow *parent, int flags = wxBORDER_NONE); - %name(PrePopupWindow)wxPopupWindow(); + %RenameCtor(PrePopupWindow, wxPopupWindow()); }; -%name(PopupTransientWindow) class wxPyPopupTransientWindow : public wxPopupWindow +%rename(PopupTransientWindow) wxPyPopupTransientWindow; +class wxPyPopupTransientWindow : public wxPopupWindow { public: wxPyPopupTransientWindow(wxWindow *parent, int style = wxBORDER_NONE); - %name(PrePopupTransientWindow)wxPyPopupTransientWindow(); + %RenameCtor(PrePopupTransientWindow, wxPyPopupTransientWindow()); }; diff --git a/wxPython/src/_printfw.i b/wxPython/src/_printfw.i index 6bc971b70e..115834daf2 100644 --- a/wxPython/src/_printfw.i +++ b/wxPython/src/_printfw.i @@ -376,7 +376,8 @@ IMP_PYCALLBACK_BOOL_INT(wxPyPrintout, wxPrintout, HasPage); MustHaveApp(wxPyPrintout); // Now define the custom class for SWIGging -%name(Printout) class wxPyPrintout : public wxObject { +%rename(Printout) wxPyPrintout; +class wxPyPrintout : public wxObject { public: %pythonAppend wxPyPrintout "self._setCallbackInfo(self, Printout)" diff --git a/wxPython/src/_process.i b/wxPython/src/_process.i index 5474130544..bada7e7ac4 100644 --- a/wxPython/src/_process.i +++ b/wxPython/src/_process.i @@ -78,7 +78,8 @@ IMP_PYCALLBACK_VOID_INTINT( wxPyProcess, wxProcess, OnTerminate); %} -%name(Process)class wxPyProcess : public wxEvtHandler { +%rename(Process) wxPyProcess; +class wxPyProcess : public wxEvtHandler { public: // kill the process with the given PID static wxKillError Kill(int pid, diff --git a/wxPython/src/_pycontrol.i b/wxPython/src/_pycontrol.i index dc1e8047b9..e4e18dcd58 100644 --- a/wxPython/src/_pycontrol.i +++ b/wxPython/src/_pycontrol.i @@ -113,7 +113,7 @@ public: const wxValidator& validator=wxDefaultValidator, const wxString& name = wxPyControlNameStr); - %name(PrePyControl) wxPyControl(); + %RenameCtor(PrePyControl, wxPyControl()); void _setCallbackInfo(PyObject* self, PyObject* _class); diff --git a/wxPython/src/_pywindows.i b/wxPython/src/_pywindows.i index 8edd2a3f37..5bce965252 100644 --- a/wxPython/src/_pywindows.i +++ b/wxPython/src/_pywindows.i @@ -142,7 +142,7 @@ public: long style = 0, const wxString& name = wxPyPanelNameStr); - %name(PrePyWindow) wxPyWindow(); + %RenameCtor(PrePyWindow, wxPyWindow()); void _setCallbackInfo(PyObject* self, PyObject* _class); @@ -287,7 +287,7 @@ public: long style = 0, const wxString& name = wxPyPanelNameStr); - %name(PrePyPanel) wxPyPanel(); + %RenameCtor(PrePyPanel, wxPyPanel()); void _setCallbackInfo(PyObject* self, PyObject* _class); @@ -424,7 +424,7 @@ public: long style = 0, const wxString& name = wxPyPanelNameStr); - %name(PrePyScrolledWindow) wxPyScrolledWindow(); + %RenameCtor(PrePyScrolledWindow, wxPyScrolledWindow()); void _setCallbackInfo(PyObject* self, PyObject* _class); diff --git a/wxPython/src/_radio.i b/wxPython/src/_radio.i index 93a78b647d..d71462cc00 100644 --- a/wxPython/src/_radio.i +++ b/wxPython/src/_radio.i @@ -41,7 +41,7 @@ public: long style = wxRA_HORIZONTAL, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxPyRadioBoxNameStr); - %name(PreRadioBox)wxRadioBox(); + %RenameCtor(PreRadioBox, wxRadioBox()); bool Create(wxWindow* parent, wxWindowID id=-1, const wxString& label = wxPyEmptyString, @@ -70,8 +70,8 @@ public: %pythoncode { SetItemLabel = SetString }; // change the individual radio button state - %name(EnableItem) virtual void Enable(int n, bool enable = true); - %name(ShowItem) virtual void Show(int n, bool show = true); + %Rename(EnableItem, virtual void, Enable(int n, bool enable = true)); + %Rename(ShowItem, virtual void, Show(int n, bool show = true)); #ifndef __WXGTK__ // layout parameters @@ -111,7 +111,7 @@ public: long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxPyRadioButtonNameStr); - %name(PreRadioButton)wxRadioButton(); + %RenameCtor(PreRadioButton, wxRadioButton()); bool Create(wxWindow* parent, wxWindowID id=-1, const wxString& label = wxPyEmptyString, diff --git a/wxPython/src/_region.i b/wxPython/src/_region.i index c26cbe99a1..e7d68c7351 100644 --- a/wxPython/src/_region.i +++ b/wxPython/src/_region.i @@ -46,12 +46,12 @@ MustHaveApp(wxRegion); class wxRegion : public wxGDIObject { public: wxRegion(wxCoord x=0, wxCoord y=0, wxCoord width=0, wxCoord height=0); - %name(RegionFromBitmap)wxRegion(const wxBitmap& bmp); - %name(RegionFromBitmapColour)wxRegion(const wxBitmap& bmp, - const wxColour& transColour, - int tolerance = 0); - %name(RegionFromPoints)wxRegion(int points, wxPoint* points_array, - int fillStyle = wxWINDING_RULE); + %RenameCtor(RegionFromBitmap, wxRegion(const wxBitmap& bmp)); + %RenameCtor(RegionFromBitmapColour, wxRegion(const wxBitmap& bmp, + const wxColour& transColour, + int tolerance = 0)); + %RenameCtor(RegionFromPoints, wxRegion(int points, wxPoint* points_array, + int fillStyle = wxWINDING_RULE)); ~wxRegion(); @@ -60,29 +60,29 @@ public: bool Offset(wxCoord x, wxCoord y); wxRegionContain Contains(wxCoord x, wxCoord y); - %name(ContainsPoint)wxRegionContain Contains(const wxPoint& pt); - %name(ContainsRect)wxRegionContain Contains(const wxRect& rect); - %name(ContainsRectDim)wxRegionContain Contains(wxCoord x, wxCoord y, wxCoord w, wxCoord h); + %Rename(ContainsPoint, wxRegionContain, Contains(const wxPoint& pt)); + %Rename(ContainsRect, wxRegionContain, Contains(const wxRect& rect)); + %Rename(ContainsRectDim, wxRegionContain, Contains(wxCoord x, wxCoord y, wxCoord w, wxCoord h)); wxRect GetBox(); bool Intersect(wxCoord x, wxCoord y, wxCoord width, wxCoord height); - %name(IntersectRect)bool Intersect(const wxRect& rect); - %name(IntersectRegion)bool Intersect(const wxRegion& region); + %Rename(IntersectRect, bool, Intersect(const wxRect& rect)); + %Rename(IntersectRegion, bool, Intersect(const wxRegion& region)); bool IsEmpty(); bool Union(wxCoord x, wxCoord y, wxCoord width, wxCoord height); - %name(UnionRect)bool Union(const wxRect& rect); - %name(UnionRegion)bool Union(const wxRegion& region); + %Rename(UnionRect, bool, Union(const wxRect& rect)); + %Rename(UnionRegion, bool, Union(const wxRegion& region)); bool Subtract(wxCoord x, wxCoord y, wxCoord width, wxCoord height); - %name(SubtractRect)bool Subtract(const wxRect& rect); - %name(SubtractRegion)bool Subtract(const wxRegion& region); + %Rename(SubtractRect, bool, Subtract(const wxRect& rect)); + %Rename(SubtractRegion, bool, Subtract(const wxRegion& region)); bool Xor(wxCoord x, wxCoord y, wxCoord width, wxCoord height); - %name(XorRect)bool Xor(const wxRect& rect); - %name(XorRegion)bool Xor(const wxRegion& region); + %Rename(XorRect, bool, Xor(const wxRect& rect)); + %Rename(XorRegion, bool, Xor(const wxRegion& region)); // Convert the region to a B&W bitmap with the white pixels being inside // the region. @@ -92,10 +92,10 @@ public: // with this region. If the bitmap has a mask then it will be used, // otherwise the colour to be treated as transparent may be specified, // along with an optional tolerance value. - %name(UnionBitmap)bool Union(const wxBitmap& bmp); - %name(UnionBitmapColour)bool Union(const wxBitmap& bmp, - const wxColour& transColour, - int tolerance = 0); + %Rename(UnionBitmap, bool, Union(const wxBitmap& bmp)); + %Rename(UnionBitmapColour, bool, Union(const wxBitmap& bmp, + const wxColour& transColour, + int tolerance = 0)); }; diff --git a/wxPython/src/_sashwin.i b/wxPython/src/_sashwin.i index 63ab46c33b..2ae31351a8 100644 --- a/wxPython/src/_sashwin.i +++ b/wxPython/src/_sashwin.i @@ -61,7 +61,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxCLIP_CHILDREN | wxSW_3D, const wxString& name = wxPySashNameStr); - %name(PreSashWindow)wxSashWindow(); + %RenameCtor(PreSashWindow, wxSashWindow()); bool Create(wxWindow* parent, wxWindowID id=-1, const wxPoint& pos = wxDefaultPosition, @@ -249,7 +249,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxCLIP_CHILDREN | wxSW_3D, const wxString& name = wxPySashLayoutNameStr); - %name(PreSashLayoutWindow)wxSashLayoutWindow(); + %RenameCtor(PreSashLayoutWindow, wxSashLayoutWindow()); bool Create(wxWindow* parent, wxWindowID id=-1, const wxPoint& pos = wxDefaultPosition, diff --git a/wxPython/src/_scrolbar.i b/wxPython/src/_scrolbar.i index cb87fb1013..eef02eb2f5 100644 --- a/wxPython/src/_scrolbar.i +++ b/wxPython/src/_scrolbar.i @@ -33,7 +33,7 @@ public: long style = wxSB_HORIZONTAL, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxPyScrollBarNameStr); - %name(PreScrollBar)wxScrollBar(); + %RenameCtor(PreScrollBar, wxScrollBar()); bool Create(wxWindow* parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, diff --git a/wxPython/src/_settings.i b/wxPython/src/_settings.i index 2cf16843c3..b4bc618260 100644 --- a/wxPython/src/_settings.i +++ b/wxPython/src/_settings.i @@ -195,7 +195,7 @@ public: // to implement SetSystemColour/Font/Metric static void SetOption(const wxString& name, const wxString& value); - %name(SetOptionInt) static void SetOption(const wxString& name, int value); + %Rename(SetOptionInt, static void, SetOption(const wxString& name, int value)); static wxString GetOption(const wxString& name) ; static int GetOptionInt(const wxString& name) ; static bool HasOption(const wxString& name) ; diff --git a/wxPython/src/_sizers.i b/wxPython/src/_sizers.i index 0a1f5101b9..bba510b197 100644 --- a/wxPython/src/_sizers.i +++ b/wxPython/src/_sizers.i @@ -51,8 +51,9 @@ methods are called. int border, PyObject* userData=NULL ), "Constructs a `wx.SizerItem` for tracking a window.", ""); - %name(SizerItemWindow) wxSizerItem( wxWindow *window, int proportion, int flag, - int border, PyObject* userData=NULL ) { + %RenameCtor(SizerItemWindow, wxSizerItem( wxWindow *window, int proportion, int flag, + int border, PyObject* userData=NULL )) + { wxPyUserData* data = NULL; if ( userData ) { bool blocked = wxPyBeginBlockThreads(); @@ -67,8 +68,10 @@ methods are called. wxSizerItem( int width, int height, int proportion, int flag, int border, PyObject* userData=NULL), "Constructs a `wx.SizerItem` for tracking a spacer.", ""); - %name(SizerItemSpacer) wxSizerItem( int width, int height, int proportion, int flag, - int border, PyObject* userData=NULL) { + + %RenameCtor(SizerItemSpacer, wxSizerItem( int width, int height, int proportion, int flag, + int border, PyObject* userData=NULL)) + { wxPyUserData* data = NULL; if ( userData ) { bool blocked = wxPyBeginBlockThreads(); @@ -81,9 +84,11 @@ methods are called. DocStr( wxSizerItem( wxSizer *sizer, int proportion, int flag, int border, PyObject* userData=NULL ), - "Constructs a `wx.SizerItem` for tracking a subsizer", ""); - %name(SizerItemSizer) wxSizerItem( wxSizer *sizer, int proportion, int flag, - int border, PyObject* userData=NULL ) { + "Constructs a `wx.SizerItem` for tracking a subsizer", ""); + + %RenameCtor(SizerItemSizer, wxSizerItem( wxSizer *sizer, int proportion, int flag, + int border, PyObject* userData=NULL )) + { wxPyUserData* data = NULL; if ( userData ) { bool blocked = wxPyBeginBlockThreads(); @@ -139,8 +144,8 @@ added, if needed.", ""); DocStr(SetRatio, "Set the ratio item attribute.", ""); - %name(SetRatioWH) void SetRatio( int width, int height ); - %name(SetRatioSize) void SetRatio( wxSize size ); + %Rename(SetRatioWH, void, SetRatio( int width, int height )); + %Rename(SetRatioSize, void, SetRatio( wxSize size )); void SetRatio( float ratio ); DocDeclStr( diff --git a/wxPython/src/_slider.i b/wxPython/src/_slider.i index 6ecb209afe..106c3aaf7d 100644 --- a/wxPython/src/_slider.i +++ b/wxPython/src/_slider.i @@ -41,7 +41,7 @@ public: long style = wxSL_HORIZONTAL, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxPySliderNameStr); - %name(PreSlider)wxSlider(); + %RenameCtor(PreSlider, wxSlider()); bool Create(wxWindow* parent, wxWindowID id=-1, int value=0, int minValue=0, int maxValue=100, diff --git a/wxPython/src/_sound.i b/wxPython/src/_sound.i index 9ddc7901c7..5569a08bfe 100644 --- a/wxPython/src/_sound.i +++ b/wxPython/src/_sound.i @@ -85,7 +85,8 @@ public: else return new wxSound(fileName); } - %name(SoundFromData) wxSound(PyObject* data) { + %RenameCtor(SoundFromData, wxSound(PyObject* data)) + { unsigned char* buffer; int size; wxSound *sound = NULL; @@ -135,7 +136,7 @@ public: bool Play(unsigned flags = wxSOUND_ASYNC) const; // Plays sound from filename: - %name(PlaySound) static bool Play(const wxString& filename, unsigned flags = wxSOUND_ASYNC); + %Rename(PlaySound, static bool, Play(const wxString& filename, unsigned flags = wxSOUND_ASYNC)); #ifndef __WXMAC__ static void Stop(); diff --git a/wxPython/src/_spin.i b/wxPython/src/_spin.i index 7f9f33a1da..dd8283985c 100644 --- a/wxPython/src/_spin.i +++ b/wxPython/src/_spin.i @@ -50,7 +50,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxSP_HORIZONTAL, const wxString& name = wxPySPIN_BUTTON_NAME); - %name(PreSpinButton)wxSpinButton(); + %RenameCtor(PreSpinButton, wxSpinButton()); bool Create(wxWindow* parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, @@ -97,7 +97,7 @@ public: long style = wxSP_ARROW_KEYS, int min = 0, int max = 100, int initial = 0, const wxString& name = wxPySpinCtrlNameStr); - %name(PreSpinCtrl)wxSpinCtrl(); + %RenameCtor(PreSpinCtrl, wxSpinCtrl()); bool Create(wxWindow *parent, wxWindowID id = -1, @@ -110,7 +110,7 @@ public: virtual int GetValue() const; virtual void SetValue( int value ); - %name(SetValueString) void SetValue(const wxString& text); + %Rename(SetValueString, void, SetValue(const wxString& text)); virtual void SetRange( int minVal, int maxVal ); virtual int GetMin() const; diff --git a/wxPython/src/_statctrls.i b/wxPython/src/_statctrls.i index 9c2df37ac9..a22abfe080 100644 --- a/wxPython/src/_statctrls.i +++ b/wxPython/src/_statctrls.i @@ -37,7 +37,7 @@ public: const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxPyStaticBoxNameStr); - %name(PreStaticBox)wxStaticBox(); + %RenameCtor(PreStaticBox, wxStaticBox()); // Turn it back on again %typemap(out) wxStaticBox* { $result = wxPyMake_wxObject($1, $owner); } @@ -70,7 +70,7 @@ public: const wxSize &size = wxDefaultSize, long style = wxLI_HORIZONTAL, const wxString& name = wxPyStaticTextNameStr); - %name(PreStaticLine)wxStaticLine(); + %RenameCtor(PreStaticLine, wxStaticLine()); bool Create( wxWindow *parent, wxWindowID id=-1, const wxPoint &pos = wxDefaultPosition, @@ -105,7 +105,7 @@ public: const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxPyStaticTextNameStr); - %name(PreStaticText)wxStaticText(); + %RenameCtor(PreStaticText, wxStaticText()); bool Create(wxWindow* parent, wxWindowID id=-1, const wxString& label = wxPyEmptyString, @@ -134,7 +134,7 @@ public: const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxPyStaticBitmapNameStr); - %name(PreStaticBitmap)wxStaticBitmap(); + %RenameCtor(PreStaticBitmap, wxStaticBitmap()); bool Create(wxWindow* parent, wxWindowID id=-1, const wxBitmap& bitmap = wxNullBitmap, diff --git a/wxPython/src/_statusbar.i b/wxPython/src/_statusbar.i index 14fa24cb93..6988a190a5 100644 --- a/wxPython/src/_statusbar.i +++ b/wxPython/src/_statusbar.i @@ -43,7 +43,7 @@ public: wxStatusBar(wxWindow* parent, wxWindowID id = -1, long style = wxDEFAULT_STATUSBAR_STYLE, const wxString& name = wxPyStatusLineNameStr); - %name(PreStatusBar)wxStatusBar(); + %RenameCtor(PreStatusBar, wxStatusBar()); // Turn it back on again %typemap(out) wxStatusBar* { $result = wxPyMake_wxObject($1, $owner); } diff --git a/wxPython/src/_streams.i b/wxPython/src/_streams.i index d8d9f26094..5d89908a07 100644 --- a/wxPython/src/_streams.i +++ b/wxPython/src/_streams.i @@ -68,7 +68,9 @@ enum wxSeekMode }; -%name(InputStream) class wxPyInputStream { +%rename(InputStream) wxPyInputStream; +class wxPyInputStream +{ public: %extend { wxPyInputStream(PyObject* p) { diff --git a/wxPython/src/_taskbar.i b/wxPython/src/_taskbar.i index 88fd35bae9..71b22bf22f 100644 --- a/wxPython/src/_taskbar.i +++ b/wxPython/src/_taskbar.i @@ -97,7 +97,8 @@ IMPLEMENT_ABSTRACT_CLASS(wxPyTaskBarIcon, wxTaskBarIcon); MustHaveApp(wxPyTaskBarIcon); -%name(TaskBarIcon)class wxPyTaskBarIcon : public wxEvtHandler +%rename(TaskBarIcon) wxPyTaskBarIcon; +class wxPyTaskBarIcon : public wxEvtHandler { public: %pythonAppend wxPyTaskBarIcon "self._setCallbackInfo(self, TaskBarIcon, 0)" diff --git a/wxPython/src/_textctrl.i b/wxPython/src/_textctrl.i index 9a5cca80ea..034bdcedc3 100644 --- a/wxPython/src/_textctrl.i +++ b/wxPython/src/_textctrl.i @@ -174,7 +174,7 @@ public: long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxPyTextCtrlNameStr); - %name(PreTextCtrl)wxTextCtrl(); + %RenameCtor(PreTextCtrl, wxTextCtrl()); // Turn it back on again %typemap(out) wxTextCtrl* { $result = wxPyMake_wxObject($1, $owner); } diff --git a/wxPython/src/_tglbtn.i b/wxPython/src/_tglbtn.i index 3241807ee6..4b6e6eef24 100644 --- a/wxPython/src/_tglbtn.i +++ b/wxPython/src/_tglbtn.i @@ -66,7 +66,7 @@ public: long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxPyToggleButtonNameStr); - %name(PreToggleButton)wxToggleButton(); + %RenameCtor(PreToggleButton, wxToggleButton()); bool Create(wxWindow *parent, wxWindowID id=-1, diff --git a/wxPython/src/_timer.i b/wxPython/src/_timer.i index 910a3864ca..c4bd285dbe 100644 --- a/wxPython/src/_timer.i +++ b/wxPython/src/_timer.i @@ -62,7 +62,8 @@ void wxPyTimer::base_Notify() { MustHaveApp(wxPyTimer); -%name(Timer) class wxPyTimer : public wxEvtHandler +%rename(Timer) wxPyTimer; +class wxPyTimer : public wxEvtHandler { public: // Don't let the OOR or callback info hold references to the object so diff --git a/wxPython/src/_toolbar.i b/wxPython/src/_toolbar.i index f3d0bb52f2..bb0a76de5d 100644 --- a/wxPython/src/_toolbar.i +++ b/wxPython/src/_toolbar.i @@ -303,8 +303,8 @@ public: shortHelp, longHelp, clientData) } - %name(AddToolItem) wxToolBarToolBase *AddTool (wxToolBarToolBase *tool); - %name(InsertToolItem) wxToolBarToolBase *InsertTool (size_t pos, wxToolBarToolBase *tool); + %Rename(AddToolItem, wxToolBarToolBase*, AddTool (wxToolBarToolBase *tool)); + %Rename(InsertToolItem, wxToolBarToolBase*, InsertTool (size_t pos, wxToolBarToolBase *tool)); wxToolBarToolBase *AddControl(wxControl *control); wxToolBarToolBase *InsertControl(size_t pos, wxControl *control); @@ -353,7 +353,7 @@ public: void SetToolLongHelp(int id, const wxString& helpString); wxString GetToolLongHelp(int id); - %name(SetMarginsXY) void SetMargins(int x, int y); + %Rename(SetMarginsXY, void, SetMargins(int x, int y)); void SetMargins(const wxSize& size); void SetToolPacking(int packing); void SetToolSeparation(int separation); @@ -399,7 +399,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxNO_BORDER | wxTB_HORIZONTAL, const wxString& name = wxPyToolBarNameStr); - %name(PreToolBar)wxToolBar(); + %RenameCtor(PreToolBar, wxToolBar()); // Turn it back on again %typemap(out) wxToolBar* { $result = wxPyMake_wxObject($1, $owner); } diff --git a/wxPython/src/_toplvl.i b/wxPython/src/_toplvl.i index dea3353a37..f6d8e172a1 100644 --- a/wxPython/src/_toplvl.i +++ b/wxPython/src/_toplvl.i @@ -168,7 +168,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxPyFrameNameStr); - %name(PreFrame)wxFrame(); + %RenameCtor(PreFrame, wxFrame()); // Turn it back on again %typemap(out) wxFrame* { $result = wxPyMake_wxObject($1, $owner); } @@ -287,7 +287,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxPyDialogNameStr); - %name(PreDialog)wxDialog(); + %RenameCtor(PreDialog, wxDialog()); // Turn it back on again %typemap(out) wxDialog* { $result = wxPyMake_wxObject($1, $owner); } @@ -352,7 +352,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxPyFrameNameStr); - %name(PreMiniFrame)wxMiniFrame(); + %RenameCtor(PreMiniFrame, wxMiniFrame()); bool Create(wxWindow* parent, const wxWindowID id=-1, const wxString& title = wxPyEmptyString, diff --git a/wxPython/src/_treectrl.i b/wxPython/src/_treectrl.i index 50830f0e57..94cdc1b404 100644 --- a/wxPython/src/_treectrl.i +++ b/wxPython/src/_treectrl.i @@ -117,7 +117,8 @@ public: // Python code should rarely be neccessary. Just use the GetItemPyData and // SetItemPyData tree methods instead of the GetItemData and SetItemData // methods. -%name(TreeItemData) class wxPyTreeItemData { +%rename(TreeItemData) wxPyTreeItemData; +class wxPyTreeItemData { public: wxPyTreeItemData(PyObject* obj = NULL); @@ -311,7 +312,8 @@ IMPLEMENT_ABSTRACT_CLASS(wxPyTreeCtrl, wxTreeCtrl); MustHaveApp(wxPyTreeCtrl); -%name(TreeCtrl)class wxPyTreeCtrl : public wxControl { +%rename(TreeCtrl) wxPyTreeCtrl; +class wxPyTreeCtrl : public wxControl { public: %pythonAppend wxPyTreeCtrl "self._setOORInfo(self);self._setCallbackInfo(self, TreeCtrl)" %pythonAppend wxPyTreeCtrl() "" @@ -323,7 +325,7 @@ public: long style = wxTR_DEFAULT_STYLE, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxPyTreeCtrlNameStr); - %name(PreTreeCtrl)wxPyTreeCtrl(); + %RenameCtor(PreTreeCtrl, wxPyTreeCtrl()); // Turn it back on again %typemap(out) wxPyTreeCtrl* { $result = wxPyMake_wxObject($1, $owner); } @@ -601,12 +603,12 @@ public: wxPyTreeItemData *data = NULL); // insert a new item before the one with the given index - %name(InsertItemBefore) - wxTreeItemId InsertItem(const wxTreeItemId& parent, + %Rename(InsertItemBefore, + wxTreeItemId, InsertItem(const wxTreeItemId& parent, size_t index, const wxString& text, int image = -1, int selectedImage = -1, - wxPyTreeItemData *data = NULL); + wxPyTreeItemData *data = NULL)); // insert a new item in as the last child of the parent wxTreeItemId AppendItem(const wxTreeItemId& parent, diff --git a/wxPython/src/_vscroll.i b/wxPython/src/_vscroll.i index 7a9b32dba6..db0f28cee9 100644 --- a/wxPython/src/_vscroll.i +++ b/wxPython/src/_vscroll.i @@ -127,7 +127,8 @@ IMP_PYCALLBACK_COORD_const (wxPyVScrolledWindow, wxVScrolledWindow, Est MustHaveApp(wxPyVScrolledWindow); -%name(VScrolledWindow) class wxPyVScrolledWindow : public wxPanel +%rename(VScrolledWindow) wxPyVScrolledWindow; +class wxPyVScrolledWindow : public wxPanel { public: %pythonAppend wxPyVScrolledWindow "self._setOORInfo(self); self._setCallbackInfo(self, VScrolledWindow)" @@ -141,7 +142,7 @@ public: long style = 0, const wxString& name = wxPyPanelNameStr); - %name(PreVScrolledWindow)wxPyVScrolledWindow(); + %RenameCtor(PreVScrolledWindow, wxPyVScrolledWindow()); void _setCallbackInfo(PyObject* self, PyObject* _class); @@ -176,7 +177,7 @@ public: // return the item at the specified (in physical coordinates) position or // wxNOT_FOUND if none, i.e. if it is below the last item - %name(HitTestXY) int HitTest(wxCoord x, wxCoord y) const; + %Rename(HitTestXY, int, HitTest(wxCoord x, wxCoord y) const); int HitTest(const wxPoint& pt) const; // recalculate all our parameters and redisplay all lines @@ -286,7 +287,8 @@ IMP_PYCALLBACK__DCRECTSIZET_const (wxPyVListBox, wxVListBox, OnDrawBackground */ MustHaveApp(wxPyVListBox); -%name(VListBox) class wxPyVListBox : public wxPyVScrolledWindow +%rename(VListBox) wxPyVListBox; +class wxPyVListBox : public wxPyVScrolledWindow { public: %pythonAppend wxPyVListBox "self._setOORInfo(self);self._setCallbackInfo(self, VListBox)" @@ -300,7 +302,7 @@ public: long style = 0, const wxString& name = wxPyVListBoxNameStr); - %name(PreVListBox) wxPyVListBox(); + %RenameCtor(PreVListBox, wxPyVListBox()); void _setCallbackInfo(PyObject* self, PyObject* _class); @@ -431,7 +433,7 @@ public: // // by default both margins are 0 void SetMargins(const wxPoint& pt); - %name(SetMarginsXY) void SetMargins(wxCoord x, wxCoord y); + %Rename(SetMarginsXY, void, SetMargins(wxCoord x, wxCoord y)); // change the background colour of the selected cells void SetSelectionBackground(const wxColour& col); @@ -505,7 +507,8 @@ IMP_PYCALLBACK_STRING_SIZET (wxPyHtmlListBox, wxHtmlListBox, OnGetItemMarkup // wxHtmlListBox is a listbox whose items are wxHtmlCells MustHaveApp(wxPyHtmlListBox); -%name(HtmlListBox) class wxPyHtmlListBox : public wxPyVListBox +%rename(HtmlListBox) wxPyHtmlListBox; +class wxPyHtmlListBox : public wxPyVListBox { public: %pythonAppend wxPyHtmlListBox "self._setOORInfo(self);self._setCallbackInfo(self, HtmlListBox)" @@ -520,7 +523,7 @@ public: long style = 0, const wxString& name = wxPyVListBoxNameStr); - %name(PreHtmlListBox) wxPyHtmlListBox(); + %RenameCtor(PreHtmlListBox, wxPyHtmlListBox()); void _setCallbackInfo(PyObject* self, PyObject* _class); diff --git a/wxPython/src/_window.i b/wxPython/src/_window.i index 1800efb1d8..7386f5e087 100644 --- a/wxPython/src/_window.i +++ b/wxPython/src/_window.i @@ -448,8 +448,8 @@ wx.Window.SetSize, since the application need not worry about what dimensions the border or title bar have when trying to fit the window around panel items, for example.", ""); void SetClientSize( const wxSize& size ); - %name(SetClientSizeWH) void SetClientSize( int width, int height ); - %name(SetClientRect) void SetClientSize(const wxRect& rect); + %Rename(SetClientSizeWH, void, SetClientSize( int width, int height )); + %Rename(SetClientRect, void, SetClientSize(const wxRect& rect)); DocStr(GetPosition, // sets the docstring for both @@ -603,9 +603,9 @@ The resizing increments are only significant under Motif or Xt.", " virtual void SetSizeHints( int minW, int minH, int maxW = -1, int maxH = -1, int incW = -1, int incH = -1 ); - %name(SetSizeHintsSz) void SetSizeHints( const wxSize& minSize, - const wxSize& maxSize=wxDefaultSize, - const wxSize& incSize=wxDefaultSize); + %Rename(SetSizeHintsSz, void, SetSizeHints( const wxSize& minSize, + const wxSize& maxSize=wxDefaultSize, + const wxSize& incSize=wxDefaultSize)); DocStr(SetVirtualSizeHints, @@ -615,8 +615,8 @@ used. If this function is called, the user will not be able to size the virtual area of the window outside the given bounds.", ""); virtual void SetVirtualSizeHints( int minW, int minH, int maxW = -1, int maxH = -1 ); - %name(SetVirtualSizeHintsSz)void SetVirtualSizeHints( - const wxSize& minSize, const wxSize& maxSize=wxDefaultSize); + %Rename(SetVirtualSizeHintsSz, void, SetVirtualSizeHints( + const wxSize& minSize, const wxSize& maxSize=wxDefaultSize)); @@ -663,7 +663,7 @@ max size.", ""); is just the client area of the window, but for some like scrolled windows it is more or less independent of the screen window size.", ""); void SetVirtualSize(const wxSize& size ); - %name(SetVirtualSizeWH) void SetVirtualSize( int w, int h ); + %Rename(SetVirtualSizeWH, void, SetVirtualSize( int w, int h )); DocStr(GetVirtualSize, @@ -1138,10 +1138,10 @@ changes. For the x dimension, the dialog units are multiplied by the average character width and then divided by 4. For the y dimension, the dialog units are multiplied by the average character height and then divided by 8.", ""); - %name(ConvertDialogPointToPixels) wxPoint ConvertDialogToPixels(const wxPoint& pt); - %name(ConvertDialogSizeToPixels) wxSize ConvertDialogToPixels(const wxSize& sz); - %name(DLG_PNT) wxPoint ConvertDialogToPixels(const wxPoint& pt); - %name(DLG_SZE) wxSize ConvertDialogToPixels(const wxSize& sz); + %Rename(ConvertDialogPointToPixels, wxPoint, ConvertDialogToPixels(const wxPoint& pt)); + %Rename(ConvertDialogSizeToPixels, wxSize, ConvertDialogToPixels(const wxSize& sz)); + %Rename(DLG_PNT, wxPoint, ConvertDialogToPixels(const wxPoint& pt)); + %Rename(DLG_SZE, wxSize, ConvertDialogToPixels(const wxSize& sz)); DocStr(ConvertPixelPointToDialog, @@ -1151,8 +1151,8 @@ changes. For the x dimension, the dialog units are multiplied by the average character width and then divided by 4. For the y dimension, the dialog units are multiplied by the average character height and then divided by 8.", ""); - %name(ConvertPixelPointToDialog) wxPoint ConvertPixelsToDialog(const wxPoint& pt); - %name(ConvertPixelSizeToDialog) wxSize ConvertPixelsToDialog(const wxSize& sz); + %Rename(ConvertPixelPointToDialog, wxPoint, ConvertPixelsToDialog(const wxPoint& pt)); + %Rename(ConvertPixelSizeToDialog, wxSize, ConvertPixelsToDialog(const wxSize& sz)); @@ -1277,8 +1277,8 @@ since the last repaint. Call this in an paint event handler to optimize redrawing by only redrawing those areas, which have been exposed.", ""); bool IsExposed( int x, int y, int w=1, int h=1 ) const; - %name(IsExposedPoint) bool IsExposed( const wxPoint& pt ) const; - %name(IsExposedRect) bool IsExposed( const wxRect& rect ) const; + %Rename(IsExposedPoint, bool, IsExposed( const wxPoint& pt ) const); + %Rename(IsExposedRect, bool, IsExposed( const wxRect& rect ) const); @@ -1564,7 +1564,7 @@ and returns control when the user has dismissed the menu. If a menu item is selected, the corresponding menu event is generated and will be processed as usual. If the default position is given then the current position of the mouse cursor will be used.", ""); - %name(PopupMenuXY) bool PopupMenu(wxMenu *menu, int x=-1, int y=-1); + %Rename(PopupMenuXY, bool, PopupMenu(wxMenu *menu, int x=-1, int y=-1)); bool PopupMenu(wxMenu *menu, const wxPoint& pos=wxDefaultPosition); @@ -1736,7 +1736,7 @@ wxHelpProvider implementation, and not in the window object itself.", ""); DocStr(SetToolTip, "Attach a tooltip to the window.", ""); - %name(SetToolTipString) void SetToolTip( const wxString &tip ); + %Rename(SetToolTipString, void, SetToolTip( const wxString &tip )); void SetToolTip( wxToolTip *tip ); DocDeclStr( diff --git a/wxPython/src/_xml.i b/wxPython/src/_xml.i index 067e69b8dc..a7d08fcda8 100644 --- a/wxPython/src/_xml.i +++ b/wxPython/src/_xml.i @@ -85,14 +85,14 @@ public: // user-friendly creation: - %name(XmlNodeEasy) wxXmlNode(wxXmlNodeType type, const wxString& name, - const wxString& content = wxPyEmptyString); + %RenameCtor(XmlNodeEasy, wxXmlNode(wxXmlNodeType type, const wxString& name, + const wxString& content = wxPyEmptyString)); void AddChild(wxXmlNode *child); void InsertChild(wxXmlNode *child, wxXmlNode *before_node); bool RemoveChild(wxXmlNode *child); void AddProperty(wxXmlProperty *prop); - %name(AddPropertyName) void AddProperty(const wxString& name, const wxString& value); + %Rename(AddPropertyName, void, AddProperty(const wxString& name, const wxString& value)); bool DeleteProperty(const wxString& name); // access methods: @@ -128,9 +128,9 @@ class wxXmlDocument : public wxObject public: wxXmlDocument(const wxString& filename, const wxString& encoding = wxPyUTF8String); - %name(XmlDocumentFromStream) wxXmlDocument(wxInputStream& stream, - const wxString& encoding = wxPyUTF8String); - %name(EmptyXmlDocument) wxXmlDocument(); + %RenameCtor(XmlDocumentFromStream, wxXmlDocument(wxInputStream& stream, + const wxString& encoding = wxPyUTF8String)); + %RenameCtor(EmptyXmlDocument, wxXmlDocument()); ~wxXmlDocument(); @@ -139,12 +139,12 @@ public: // otherwise. bool Load(const wxString& filename, const wxString& encoding = wxPyUTF8String); - %name(LoadFromStream)bool Load(wxInputStream& stream, - const wxString& encoding = wxPyUTF8String); + %Rename(LoadFromStream, bool, Load(wxInputStream& stream, + const wxString& encoding = wxPyUTF8String)); // Saves document as .xml file. bool Save(const wxString& filename) const; - %name(SaveToStream)bool Save(wxOutputStream& stream) const; + %Rename(SaveToStream, bool, Save(wxOutputStream& stream) const); bool IsOk() const; diff --git a/wxPython/src/_xmlhandler.i b/wxPython/src/_xmlhandler.i index ba007253a1..fc1d0f11c3 100644 --- a/wxPython/src/_xmlhandler.i +++ b/wxPython/src/_xmlhandler.i @@ -138,7 +138,8 @@ IMP_PYCALLBACK_BOOL_NODE_pure(wxPyXmlResourceHandler, wxXmlResourceHandler, CanH // Now the version that will be SWIGged. -%name(XmlResourceHandler) class wxPyXmlResourceHandler : public wxObject { +%rename(XmlResourceHandler) wxPyXmlResourceHandler; +class wxPyXmlResourceHandler : public wxObject { public: %pythonAppend wxPyXmlResourceHandler "self._setCallbackInfo(self, XmlResourceHandler)" wxPyXmlResourceHandler() : wxXmlResourceHandler() {} diff --git a/wxPython/src/_xmlres.i b/wxPython/src/_xmlres.i index cc8ac270c7..79ffbc711a 100644 --- a/wxPython/src/_xmlres.i +++ b/wxPython/src/_xmlres.i @@ -55,7 +55,7 @@ public: // subclass property of object nodes will be ignored // (useful for previews in XRC editors) wxXmlResource(const wxString& filemask, int flags = wxXRC_USE_LOCALE); - %name(EmptyXmlResource) wxXmlResource(int flags = wxXRC_USE_LOCALE); + %RenameCtor(EmptyXmlResource, wxXmlResource(int flags = wxXRC_USE_LOCALE)); ~wxXmlResource(); @@ -118,7 +118,7 @@ public: // Loads menubar from resource. Returns NULL on failure. wxMenuBar *LoadMenuBar(const wxString& name); - %name(LoadMenuBarOnFrame) wxMenuBar *LoadMenuBar(wxWindow *parent, const wxString& name); + %Rename(LoadMenuBarOnFrame, wxMenuBar* , LoadMenuBar(wxWindow *parent, const wxString& name)); // Loads toolbar @@ -132,16 +132,16 @@ public: // wxTheXmlResource->LoadDialog(&dlg, mainFrame, "my_dialog"); // dlg->ShowModal(); wxDialog *LoadDialog(wxWindow *parent, const wxString& name); - %name(LoadOnDialog)bool LoadDialog(wxDialog *dlg, wxWindow *parent, const wxString& name); + %Rename(LoadOnDialog, bool, LoadDialog(wxDialog *dlg, wxWindow *parent, const wxString& name)); // Loads panel. panel points to parent window (if any). Second form // is used to finish creation of already existing instance. wxPanel *LoadPanel(wxWindow *parent, const wxString& name); - %name(LoadOnPanel)bool LoadPanel(wxPanel *panel, wxWindow *parent, const wxString& name); + %Rename(LoadOnPanel, bool, LoadPanel(wxPanel *panel, wxWindow *parent, const wxString& name)); // Load a frame's contents from a resource wxFrame *LoadFrame(wxWindow* parent, const wxString& name); - %name(LoadOnFrame)bool LoadFrame(wxFrame* frame, wxWindow *parent, const wxString& name); + %Rename(LoadOnFrame, bool, LoadFrame(wxFrame* frame, wxWindow *parent, const wxString& name)); // Load an object from the resource specifying both the resource name and // the classname. This lets you load nonstandard container windows. @@ -151,8 +151,8 @@ public: // Load an object from the resource specifying both the resource name and // the classname. This form lets you finish the creation of an existing // instance. - %name(LoadOnObject)bool LoadObject(wxObject *instance, wxWindow *parent, const wxString& name, - const wxString& classname); + %Rename(LoadOnObject, bool, LoadObject(wxObject *instance, wxWindow *parent, const wxString& name, + const wxString& classname)); // Loads a bitmap resource from a file. wxBitmap LoadBitmap(const wxString& name); diff --git a/wxPython/src/_xmlsub.i b/wxPython/src/_xmlsub.i index 2722305c27..2d3721de70 100644 --- a/wxPython/src/_xmlsub.i +++ b/wxPython/src/_xmlsub.i @@ -32,7 +32,8 @@ IMP_PYCALLBACK_OBJECT_STRING_pure(wxPyXmlSubclassFactory, wxXmlSubclassFactory, -%name(XmlSubclassFactory)class wxPyXmlSubclassFactory { +%rename(XmlSubclassFactory) wxPyXmlSubclassFactory; +class wxPyXmlSubclassFactory { public: %pythonAppend wxPyXmlSubclassFactory "self._setCallbackInfo(self, XmlSubclassFactory)" wxPyXmlSubclassFactory(); diff --git a/wxPython/src/common.swg b/wxPython/src/common.swg deleted file mode 100644 index afdaf0b9f1..0000000000 --- a/wxPython/src/common.swg +++ /dev/null @@ -1,75 +0,0 @@ -/*********************************************************************** - * common.swg for wxPython - * - * Include only the function prototypes and such from SWIG's common.swg, - * but not the runtime functions themselves. This helps keep the - * wrapper files clean of unnecessary stuff that is in the libpy.c file - * anyway. - * - ************************************************************************/ - -#include - -#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# if defined(_MSC_VER) || defined(__GNUC__) -# if defined(STATIC_LINKED) -# define SWIGEXPORT(a) a -# define SWIGIMPORT(a) extern a -# else -# define SWIGEXPORT(a) __declspec(dllexport) a -# define SWIGIMPORT(a) extern a -# endif -# else -# if defined(__BORLANDC__) -# define SWIGEXPORT(a) a _export -# define SWIGIMPORT(a) a _export -# else -# define SWIGEXPORT(a) a -# define SWIGIMPORT(a) a -# endif -# endif -#else -# define SWIGEXPORT(a) a -# define SWIGIMPORT(a) a -#endif - -#ifdef SWIG_GLOBAL -# define SWIGRUNTIME(a) SWIGEXPORT(a) -#else -# define SWIGRUNTIME(a) static a -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void *(*swig_converter_func)(void *); -typedef struct swig_type_info *(*swig_dycast_func)(void **); - -typedef struct swig_type_info { - const char *name; - swig_converter_func converter; - const char *str; - void *clientdata; - swig_dycast_func dcast; - struct swig_type_info *next; - struct swig_type_info *prev; -} swig_type_info; - - -SWIGIMPORT(swig_type_info *) SWIG_TypeRegister(swig_type_info *); -SWIGIMPORT(swig_type_info *) SWIG_TypeCheck(char *c, swig_type_info *); -SWIGIMPORT(void *) SWIG_TypeCast(swig_type_info *, void *); -SWIGIMPORT(swig_type_info *) SWIG_TypeDynamicCast(swig_type_info *, void **); -SWIGIMPORT(const char *) SWIG_TypeName(const swig_type_info *); -SWIGIMPORT(const char *) SWIG_TypePrettyName(const swig_type_info *); -SWIGIMPORT(swig_type_info *) SWIG_TypeQuery(const char *); -SWIGIMPORT(void) SWIG_TypeClientData(swig_type_info *, void *); -SWIGIMPORT(char *) SWIG_PackData(char *, void *, int); -SWIGIMPORT(char *) SWIG_UnpackData(char *, void *, int); - - -#ifdef __cplusplus -} -#endif - diff --git a/wxPython/src/grid.i b/wxPython/src/grid.i index 6c07dec020..741c4c0915 100644 --- a/wxPython/src/grid.i +++ b/wxPython/src/grid.i @@ -1603,7 +1603,7 @@ public: long style = wxWANTS_CHARS, const wxString& name = wxPyPanelNameStr); - %name(PreGrid) wxGrid(); + %RenameCtor(PreGrid, wxGrid()); // Turn it back on again diff --git a/wxPython/src/html.i b/wxPython/src/html.i index 8450f856f3..278b302de1 100644 --- a/wxPython/src/html.i +++ b/wxPython/src/html.i @@ -258,7 +258,8 @@ IMP_PYCALLBACK_BOOL_TAG_pure(wxPyHtmlTagHandler, wxHtmlTagHandler, HandleTag); %} -%name(HtmlTagHandler) class wxPyHtmlTagHandler : public wxObject { +%rename(HtmlTagHandler) wxPyHtmlTagHandler; +class wxPyHtmlTagHandler : public wxObject { public: %pythonAppend wxPyHtmlTagHandler "self._setCallbackInfo(self, HtmlTagHandler)" wxPyHtmlTagHandler(); @@ -296,7 +297,8 @@ IMP_PYCALLBACK_BOOL_TAG_pure(wxPyHtmlWinTagHandler, wxHtmlWinTagHandler, HandleT %} -%name(HtmlWinTagHandler) class wxPyHtmlWinTagHandler : public wxPyHtmlTagHandler { +%rename(HtmlWinTagHandler) wxPyHtmlWinTagHandler; +class wxPyHtmlWinTagHandler : public wxPyHtmlTagHandler { public: %pythonAppend wxPyHtmlWinTagHandler "self._setCallbackInfo(self, HtmlWinTagHandler)" wxPyHtmlWinTagHandler(); @@ -391,7 +393,7 @@ public: void Set(const wxPoint& fromPos, const wxHtmlCell *fromCell, const wxPoint& toPos, const wxHtmlCell *toCell); - %name(SetCells)void Set(const wxHtmlCell *fromCell, const wxHtmlCell *toCell); + %Rename(SetCells, void, Set(const wxHtmlCell *fromCell, const wxHtmlCell *toCell)); const wxHtmlCell *GetFromCell() const; const wxHtmlCell *GetToCell() const; @@ -591,7 +593,7 @@ public: int GetIndentUnits(int ind); void SetAlign(const wxHtmlTag& tag); void SetWidthFloat(int w, int units); - %name(SetWidthFloatFromTag)void SetWidthFloat(const wxHtmlTag& tag); + %Rename(SetWidthFloatFromTag, void, SetWidthFloat(const wxHtmlTag& tag)); void SetMinHeight(int h, int align = wxHTML_ALIGN_TOP); void SetBackgroundColour(const wxColour& clr); wxColour GetBackgroundColour(); @@ -681,7 +683,8 @@ IMPLEMENT_ABSTRACT_CLASS(wxPyHtmlFilter, wxHtmlFilter); // And now the version seen by SWIG -%name(HtmlFilter) class wxPyHtmlFilter : public wxObject { +%rename(HtmlFilter) wxPyHtmlFilter; +class wxPyHtmlFilter : public wxObject { public: %pythonAppend wxPyHtmlFilter "self._setCallbackInfo(self, HtmlFilter)" wxPyHtmlFilter(); @@ -794,7 +797,8 @@ wxHtmlOpeningStatus wxPyHtmlWindow::OnOpeningURL(wxHtmlURLType type, MustHaveApp(wxPyHtmlWindow); -%name(HtmlWindow) class wxPyHtmlWindow : public wxScrolledWindow { +%rename(HtmlWindow) wxPyHtmlWindow; +class wxPyHtmlWindow : public wxScrolledWindow { public: %pythonAppend wxPyHtmlWindow "self._setCallbackInfo(self, HtmlWindow); self._setOORInfo(self)" %pythonAppend wxPyHtmlWindow() "" @@ -805,7 +809,7 @@ public: const wxSize& size = wxDefaultSize, int style=wxHW_DEFAULT_STYLE, const wxString& name = wxPyHtmlWindowNameStr); - %name(PreHtmlWindow)wxPyHtmlWindow(); + %RenameCtor(PreHtmlWindow, wxPyHtmlWindow()); // Turn it back on again %typemap(out) wxPyHtmlWindow* { $result = wxPyMake_wxObject($1, $owner); } @@ -1167,7 +1171,7 @@ public: wxHtmlHelpData* GetData(); void SetTitleFormat(const wxString& format); void Display(const wxString& x); - %name(DisplayID) void Display(int id); + %Rename(DisplayID, void, Display(int id)); void DisplayContents(); void DisplayIndex(); bool KeywordSearch(const wxString& keyword); @@ -1207,7 +1211,7 @@ public: void SetTempDir(const wxString& path); bool AddBook(const wxString& book, int show_wait_msg = false); void Display(const wxString& x); - %name(DisplayID) void Display(int id); + %Rename(DisplayID, void, Display(int id)); void DisplayContents(); void DisplayIndex(); bool KeywordSearch(const wxString& keyword); diff --git a/wxPython/src/libpy.c b/wxPython/src/libpy.c deleted file mode 100644 index 48680c914d..0000000000 --- a/wxPython/src/libpy.c +++ /dev/null @@ -1,911 +0,0 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 1.3.22 - * - * This file is not intended to be easily readable and contains a number of - * coding conventions designed to improve portability and efficiency. Do not make - * changes to this file unless you know what you are doing--modify the SWIG - * interface file instead. - * ----------------------------------------------------------------------------- */ - -#define SWIGPYTHON - -#define SWIG_GLOBAL 1 - - -#include "Python.h" - -/*************************************************************** -*- c -*- - * python/precommon.swg - * - * Rename all exported symbols from common.swg, to avoid symbol - * clashes if multiple interpreters are included - * - ************************************************************************/ - -#define SWIG_TypeRegister SWIG_Python_TypeRegister -#define SWIG_TypeCheck SWIG_Python_TypeCheck -#define SWIG_TypeCast SWIG_Python_TypeCast -#define SWIG_TypeDynamicCast SWIG_Python_TypeDynamicCast -#define SWIG_TypeName SWIG_Python_TypeName -#define SWIG_TypePrettyName SWIG_Python_TypePrettyName -#define SWIG_TypeQuery SWIG_Python_TypeQuery -#define SWIG_TypeClientData SWIG_Python_TypeClientData -#define SWIG_PackData SWIG_Python_PackData -#define SWIG_UnpackData SWIG_Python_UnpackData - - -/*********************************************************************** - * common.swg - * - * This file contains generic SWIG runtime support for pointer - * type checking as well as a few commonly used macros to control - * external linkage. - * - * Author : David Beazley (beazley@cs.uchicago.edu) - * - * Copyright (c) 1999-2000, The University of Chicago - * - * This file may be freely redistributed without license or fee provided - * this copyright message remains intact. - ************************************************************************/ - -#include - -#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# if defined(_MSC_VER) || defined(__GNUC__) -# if defined(STATIC_LINKED) -# define SWIGEXPORT(a) a -# define SWIGIMPORT(a) extern a -# else -# define SWIGEXPORT(a) __declspec(dllexport) a -# define SWIGIMPORT(a) extern a -# endif -# else -# if defined(__BORLANDC__) -# define SWIGEXPORT(a) a _export -# define SWIGIMPORT(a) a _export -# else -# define SWIGEXPORT(a) a -# define SWIGIMPORT(a) a -# endif -# endif -#else -# define SWIGEXPORT(a) a -# define SWIGIMPORT(a) a -#endif - -#ifdef SWIG_GLOBAL -# define SWIGRUNTIME(a) SWIGEXPORT(a) -#else -# define SWIGRUNTIME(a) static a -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void *(*swig_converter_func)(void *); -typedef struct swig_type_info *(*swig_dycast_func)(void **); - -typedef struct swig_type_info { - const char *name; - swig_converter_func converter; - const char *str; - void *clientdata; - swig_dycast_func dcast; - struct swig_type_info *next; - struct swig_type_info *prev; -} swig_type_info; - -#ifdef SWIG_NOINCLUDE - -SWIGIMPORT(swig_type_info *) SWIG_TypeRegister(swig_type_info *); -SWIGIMPORT(swig_type_info *) SWIG_TypeCheck(char *c, swig_type_info *); -SWIGIMPORT(void *) SWIG_TypeCast(swig_type_info *, void *); -SWIGIMPORT(swig_type_info *) SWIG_TypeDynamicCast(swig_type_info *, void **); -SWIGIMPORT(const char *) SWIG_TypeName(const swig_type_info *); -SWIGIMPORT(const char *) SWIG_TypePrettyName(const swig_type_info *); -SWIGIMPORT(swig_type_info *) SWIG_TypeQuery(const char *); -SWIGIMPORT(void) SWIG_TypeClientData(swig_type_info *, void *); -SWIGIMPORT(char *) SWIG_PackData(char *, void *, int); -SWIGIMPORT(char *) SWIG_UnpackData(char *, void *, int); - -#else - -static swig_type_info *swig_type_list = 0; -static swig_type_info **swig_type_list_handle = &swig_type_list; - -/* Register a type mapping with the type-checking */ -SWIGRUNTIME(swig_type_info *) -SWIG_TypeRegister(swig_type_info *ti) { - swig_type_info *tc, *head, *ret, *next; - /* Check to see if this type has already been registered */ - tc = *swig_type_list_handle; - while (tc) { - if (strcmp(tc->name, ti->name) == 0) { - /* Already exists in the table. Just add additional types to the list */ - if (tc->clientdata) ti->clientdata = tc->clientdata; - head = tc; - next = tc->next; - goto l1; - } - tc = tc->prev; - } - head = ti; - next = 0; - - /* Place in list */ - ti->prev = *swig_type_list_handle; - *swig_type_list_handle = ti; - - /* Build linked lists */ - l1: - ret = head; - tc = ti + 1; - /* Patch up the rest of the links */ - while (tc->name) { - head->next = tc; - tc->prev = head; - head = tc; - tc++; - } - if (next) next->prev = head; - head->next = next; - return ret; -} - -/* Check the typename */ -SWIGRUNTIME(swig_type_info *) -SWIG_TypeCheck(char *c, swig_type_info *ty) { - swig_type_info *s; - if (!ty) return 0; /* Void pointer */ - s = ty->next; /* First element always just a name */ - do { - if (strcmp(s->name,c) == 0) { - if (s == ty->next) return s; - /* Move s to the top of the linked list */ - s->prev->next = s->next; - if (s->next) { - s->next->prev = s->prev; - } - /* Insert s as second element in the list */ - s->next = ty->next; - if (ty->next) ty->next->prev = s; - ty->next = s; - s->prev = ty; - return s; - } - s = s->next; - } while (s && (s != ty->next)); - return 0; -} - -/* Cast a pointer up an inheritance hierarchy */ -SWIGRUNTIME(void *) -SWIG_TypeCast(swig_type_info *ty, void *ptr) { - if ((!ty) || (!ty->converter)) return ptr; - return (*ty->converter)(ptr); -} - -/* Dynamic pointer casting. Down an inheritance hierarchy */ -SWIGRUNTIME(swig_type_info *) -SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { - swig_type_info *lastty = ty; - if (!ty || !ty->dcast) return ty; - while (ty && (ty->dcast)) { - ty = (*ty->dcast)(ptr); - if (ty) lastty = ty; - } - return lastty; -} - -/* Return the name associated with this type */ -SWIGRUNTIME(const char *) -SWIG_TypeName(const swig_type_info *ty) { - return ty->name; -} - -/* Return the pretty name associated with this type, - that is an unmangled type name in a form presentable to the user. -*/ -SWIGRUNTIME(const char *) -SWIG_TypePrettyName(const swig_type_info *type) { - /* The "str" field contains the equivalent pretty names of the - type, separated by vertical-bar characters. We choose - to print the last name, as it is often (?) the most - specific. */ - if (type->str != NULL) { - const char *last_name = type->str; - const char *s; - for (s = type->str; *s; s++) - if (*s == '|') last_name = s+1; - return last_name; - } - else - return type->name; -} - -/* - Compare two type names skipping the space characters, therefore - "char*" == "char *" and "Class" == "Class", etc. - - Return 0 when the two name types are equivalent, as in - strncmp, but skipping ' '. -*/ -static int -SWIG_TypeNameComp(const char *f1, const char *l1, - const char *f2, const char *l2) { - for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { - while ((*f1 == ' ') && (f1 != l1)) ++f1; - while ((*f2 == ' ') && (f2 != l2)) ++f2; - if (*f1 != *f2) return *f1 - *f2; - } - return (l1 - f1) - (l2 - f2); -} - -/* - Check type equivalence in a name list like ||... -*/ -static int -SWIG_TypeEquiv(const char *nb, const char *tb) { - int equiv = 0; - const char* te = tb + strlen(tb); - const char* ne = nb; - while (!equiv && *ne) { - for (nb = ne; *ne; ++ne) { - if (*ne == '|') break; - } - equiv = SWIG_TypeNameComp(nb, ne, tb, te) == 0; - if (*ne) ++ne; - } - return equiv; -} - - -/* Search for a swig_type_info structure */ -SWIGRUNTIME(swig_type_info *) -SWIG_TypeQuery(const char *name) { - swig_type_info *ty = *swig_type_list_handle; - while (ty) { - if (ty->str && (SWIG_TypeEquiv(ty->str,name))) return ty; - if (ty->name && (strcmp(name,ty->name) == 0)) return ty; - ty = ty->prev; - } - return 0; -} - -/* Set the clientdata field for a type */ -SWIGRUNTIME(void) -SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { - swig_type_info *tc, *equiv; - if (ti->clientdata == clientdata) return; - ti->clientdata = clientdata; - equiv = ti->next; - while (equiv) { - if (!equiv->converter) { - tc = *swig_type_list_handle; - while (tc) { - if ((strcmp(tc->name, equiv->name) == 0)) - SWIG_TypeClientData(tc,clientdata); - tc = tc->prev; - } - } - equiv = equiv->next; - } -} - -/* Pack binary data into a string */ -SWIGRUNTIME(char *) -SWIG_PackData(char *c, void *ptr, int sz) { - static char hex[17] = "0123456789abcdef"; - unsigned char *u = (unsigned char *) ptr; - const unsigned char *eu = u + sz; - register unsigned char uu; - for (; u != eu; ++u) { - uu = *u; - *(c++) = hex[(uu & 0xf0) >> 4]; - *(c++) = hex[uu & 0xf]; - } - return c; -} - -/* Unpack binary data from a string */ -SWIGRUNTIME(char *) -SWIG_UnpackData(char *c, void *ptr, int sz) { - register unsigned char uu = 0; - register int d; - unsigned char *u = (unsigned char *) ptr; - const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - d = *(c++); - if ((d >= '0') && (d <= '9')) - uu = ((d - '0') << 4); - else if ((d >= 'a') && (d <= 'f')) - uu = ((d - ('a'-10)) << 4); - d = *(c++); - if ((d >= '0') && (d <= '9')) - uu |= (d - '0'); - else if ((d >= 'a') && (d <= 'f')) - uu |= (d - ('a'-10)); - *u = uu; - } - return c; -} - -#endif - -#ifdef __cplusplus -} -#endif - -/*********************************************************************** - * pyrun.swg - * - * This file contains the runtime support for Python modules - * and includes code for managing global variables and pointer - * type checking. - * - * Author : David Beazley (beazley@cs.uchicago.edu) - ************************************************************************/ - -#ifdef __cplusplus -extern "C" { -#endif - -#define SWIG_PY_INT 1 -#define SWIG_PY_FLOAT 2 -#define SWIG_PY_STRING 3 -#define SWIG_PY_POINTER 4 -#define SWIG_PY_BINARY 5 - -/* Flags for pointer conversion */ - -#define SWIG_POINTER_EXCEPTION 0x1 -#define SWIG_POINTER_DISOWN 0x2 - -/* Exception handling in wrappers */ -#define SWIG_fail goto fail - -/* Constant information structure */ -typedef struct swig_const_info { - int type; - char *name; - long lvalue; - double dvalue; - void *pvalue; - swig_type_info **ptype; -} swig_const_info; - -/* Common SWIG API */ -#define SWIG_ConvertPtr(obj, pp, type, flags) \ - SWIG_Python_ConvertPtr(obj, pp, type, flags) -#define SWIG_NewPointerObj(p, type, flags) \ - SWIG_Python_NewPointerObj(p, type, flags) -#define SWIG_MustGetPtr(p, type, argnum, flags) \ - SWIG_Python_MustGetPtr(p, type, argnum, flags) - -/* Python-specific SWIG API */ -#define SWIG_newvarlink() \ - SWIG_Python_newvarlink() -#define SWIG_addvarlink(p, name, get_attr, set_attr) \ - SWIG_Python_addvarlink(p, name, get_attr, set_attr) -#define SWIG_ConvertPacked(obj, ptr, sz, ty, flags) \ - SWIG_Python_ConvertPacked(obj, ptr, sz, ty, flags) -#define SWIG_NewPackedObj(ptr, sz, type) \ - SWIG_Python_NewPackedObj(ptr, sz, type) -#define SWIG_InstallConstants(d, constants) \ - SWIG_Python_InstallConstants(d, constants) - -typedef double (*py_objasdbl_conv)(PyObject *obj); - -#ifdef SWIG_NOINCLUDE - -SWIGIMPORT(int) SWIG_Python_ConvertPtr(PyObject *, void **, swig_type_info *, int); -SWIGIMPORT(PyObject *) SWIG_Python_NewPointerObj(void *, swig_type_info *,int own); -SWIGIMPORT(void *) SWIG_Python_MustGetPtr(PyObject *, swig_type_info *, int, int); -SWIGIMPORT(PyObject *) SWIG_Python_newvarlink(void); -SWIGIMPORT(void) SWIG_Python_addvarlink(PyObject *, char *, PyObject *(*)(void), int (*)(PyObject *)); -SWIGIMPORT(int) SWIG_Python_ConvertPacked(PyObject *, void *, int sz, swig_type_info *, int); -SWIGIMPORT(PyObject *) SWIG_Python_NewPackedObj(void *, int sz, swig_type_info *); -SWIGIMPORT(void) SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]); - - -#else - - -/* ----------------------------------------------------------------------------- - * global variable support code. - * ----------------------------------------------------------------------------- */ - -typedef struct swig_globalvar { - char *name; /* Name of global variable */ - PyObject *(*get_attr)(void); /* Return the current value */ - int (*set_attr)(PyObject *); /* Set the value */ - struct swig_globalvar *next; -} swig_globalvar; - -typedef struct swig_varlinkobject { - PyObject_HEAD - swig_globalvar *vars; -} swig_varlinkobject; - -static PyObject * -swig_varlink_repr(swig_varlinkobject *v) { - v = v; - return PyString_FromString(""); -} - -static int -swig_varlink_print(swig_varlinkobject *v, FILE *fp, int flags) { - swig_globalvar *var; - flags = flags; - fprintf(fp,"Global variables { "); - for (var = v->vars; var; var=var->next) { - fprintf(fp,"%s", var->name); - if (var->next) fprintf(fp,", "); - } - fprintf(fp," }\n"); - return 0; -} - -static PyObject * -swig_varlink_getattr(swig_varlinkobject *v, char *n) { - swig_globalvar *var = v->vars; - while (var) { - if (strcmp(var->name,n) == 0) { - return (*var->get_attr)(); - } - var = var->next; - } - PyErr_SetString(PyExc_NameError,"Unknown C global variable"); - return NULL; -} - -static int -swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) { - swig_globalvar *var = v->vars; - while (var) { - if (strcmp(var->name,n) == 0) { - return (*var->set_attr)(p); - } - var = var->next; - } - PyErr_SetString(PyExc_NameError,"Unknown C global variable"); - return 1; -} - -statichere PyTypeObject varlinktype = { - PyObject_HEAD_INIT(0) - 0, /* Number of items in variable part (ob_size) */ - (char *)"swigvarlink", /* Type name (tp_name) */ - sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */ - 0, /* Itemsize (tp_itemsize) */ - 0, /* Deallocator (tp_dealloc) */ - (printfunc) swig_varlink_print, /* Print (tp_print) */ - (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */ - (setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */ - 0, /* tp_compare */ - (reprfunc) swig_varlink_repr, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - 0, /* tp_flags */ - 0, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ -#if PY_VERSION_HEX >= 0x02020000 - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ - 0, /* tp_bases */ - 0, /* tp_mro */ - 0, /* tp_cache */ - 0, /* tp_subclasses */ - 0, /* tp_weaklist */ -#endif -#if PY_VERSION_HEX >= 0x02030200 - 0, /* tp_del */ -#endif -#ifdef COUNT_ALLOCS - /* these must be last */ - 0, /* tp_alloc */ - 0, /* tp_free */ - 0, /* tp_maxalloc */ - 0, /* tp_next */ -#endif -}; - -/* Create a variable linking object for use later */ -SWIGRUNTIME(PyObject *) -SWIG_Python_newvarlink(void) { - swig_varlinkobject *result = 0; - result = PyMem_NEW(swig_varlinkobject,1); - varlinktype.ob_type = &PyType_Type; /* Patch varlinktype into a PyType */ - result->ob_type = &varlinktype; - result->vars = 0; - result->ob_refcnt = 0; - Py_XINCREF((PyObject *) result); - return ((PyObject*) result); -} - -SWIGRUNTIME(void) -SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) { - swig_varlinkobject *v; - swig_globalvar *gv; - v= (swig_varlinkobject *) p; - gv = (swig_globalvar *) malloc(sizeof(swig_globalvar)); - gv->name = (char *) malloc(strlen(name)+1); - strcpy(gv->name,name); - gv->get_attr = get_attr; - gv->set_attr = set_attr; - gv->next = v->vars; - v->vars = gv; -} - -/* Convert a pointer value */ -SWIGRUNTIME(int) -SWIG_Python_ConvertPtr(PyObject *obj, void **ptr, swig_type_info *ty, int flags) { - swig_type_info *tc; - char *c = 0; - static PyObject *SWIG_this = 0; - int newref = 0; - PyObject *pyobj = 0; - - if (!obj) return 0; - if (obj == Py_None) { - *ptr = 0; - return 0; - } -#ifdef SWIG_COBJECT_TYPES - if (!(PyCObject_Check(obj))) { - if (!SWIG_this) - SWIG_this = PyString_FromString("this"); - pyobj = obj; - obj = PyObject_GetAttr(obj,SWIG_this); - newref = 1; - if (!obj) goto type_error; - if (!PyCObject_Check(obj)) { - Py_DECREF(obj); - goto type_error; - } - } - *ptr = PyCObject_AsVoidPtr(obj); - c = (char *) PyCObject_GetDesc(obj); - if (newref) Py_DECREF(obj); - goto cobject; -#else - if (!(PyString_Check(obj))) { - if (!SWIG_this) - SWIG_this = PyString_FromString("this"); - pyobj = obj; - obj = PyObject_GetAttr(obj,SWIG_this); - newref = 1; - if (!obj) goto type_error; - if (!PyString_Check(obj)) { - Py_DECREF(obj); - goto type_error; - } - } - c = PyString_AS_STRING(obj); - /* Pointer values must start with leading underscore */ - if (*c != '_') { - *ptr = (void *) 0; - if (strcmp(c,"NULL") == 0) { - if (newref) { Py_DECREF(obj); } - return 0; - } else { - if (newref) { Py_DECREF(obj); } - goto type_error; - } - } - c++; - c = SWIG_UnpackData(c,ptr,sizeof(void *)); - if (newref) { Py_DECREF(obj); } -#endif - -#ifdef SWIG_COBJECT_TYPES -cobject: -#endif - - if (ty) { - tc = SWIG_TypeCheck(c,ty); - if (!tc) goto type_error; - *ptr = SWIG_TypeCast(tc,(void*) *ptr); - } - - if ((pyobj) && (flags & SWIG_POINTER_DISOWN)) { - PyObject_SetAttrString(pyobj,(char*)"thisown",Py_False); - } - return 0; - -type_error: - PyErr_Clear(); - if (flags & SWIG_POINTER_EXCEPTION) { - if (ty && c) { - PyErr_Format(PyExc_TypeError, - "Type error. Got %s, expected %s", - c, ty->name); - } else { - PyErr_SetString(PyExc_TypeError,"Expected a pointer"); - } - } - return -1; -} - -/* Convert a pointer value, signal an exception on a type mismatch */ -SWIGRUNTIME(void *) -SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) { - void *result; - SWIG_Python_ConvertPtr(obj, &result, ty, flags | SWIG_POINTER_EXCEPTION); - return result; -} - -/* Convert a packed value value */ -SWIGRUNTIME(int) -SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, int sz, swig_type_info *ty, int flags) { - swig_type_info *tc; - char *c = 0; - - if ((!obj) || (!PyString_Check(obj))) goto type_error; - c = PyString_AS_STRING(obj); - /* Pointer values must start with leading underscore */ - if (*c != '_') goto type_error; - c++; - c = SWIG_UnpackData(c,ptr,sz); - if (ty) { - tc = SWIG_TypeCheck(c,ty); - if (!tc) goto type_error; - } - return 0; - -type_error: - - if (flags) { - if (ty && c) { - PyErr_Format(PyExc_TypeError, - "Type error. Got %s, expected %s", - c, ty->name); - } else { - PyErr_SetString(PyExc_TypeError,"Expected a pointer"); - } - } - return -1; -} - -/* Create a new pointer object */ -SWIGRUNTIME(PyObject *) -SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int own) { - PyObject *robj; - if (!ptr) { - Py_INCREF(Py_None); - return Py_None; - } -#ifdef SWIG_COBJECT_TYPES - robj = PyCObject_FromVoidPtrAndDesc((void *) ptr, (char *) type->name, NULL); -#else - { - char result[1024]; - char *r = result; - *(r++) = '_'; - r = SWIG_PackData(r,&ptr,sizeof(void *)); - strcpy(r,type->name); - robj = PyString_FromString(result); - } -#endif - if (!robj || (robj == Py_None)) return robj; - if (type->clientdata) { - PyObject *inst; - PyObject *args = Py_BuildValue((char*)"(O)", robj); - Py_DECREF(robj); - inst = PyObject_CallObject((PyObject *) type->clientdata, args); - Py_DECREF(args); - if (inst) { - if (own) { - PyObject_SetAttrString(inst,(char*)"thisown",Py_True); - } - robj = inst; - } - } - return robj; -} - -SWIGRUNTIME(PyObject *) -SWIG_Python_NewPackedObj(void *ptr, int sz, swig_type_info *type) { - char result[1024]; - char *r = result; - if ((2*sz + 1 + strlen(type->name)) > 1000) return 0; - *(r++) = '_'; - r = SWIG_PackData(r,ptr,sz); - strcpy(r,type->name); - return PyString_FromString(result); -} - -/* Install Constants */ -SWIGRUNTIME(void) -SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) { - int i; - PyObject *obj; - for (i = 0; constants[i].type; i++) { - switch(constants[i].type) { - case SWIG_PY_INT: - obj = PyInt_FromLong(constants[i].lvalue); - break; - case SWIG_PY_FLOAT: - obj = PyFloat_FromDouble(constants[i].dvalue); - break; - case SWIG_PY_STRING: - if (constants[i].pvalue) { - obj = PyString_FromString((char *) constants[i].pvalue); - } else { - Py_INCREF(Py_None); - obj = Py_None; - } - break; - case SWIG_PY_POINTER: - obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0); - break; - case SWIG_PY_BINARY: - obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype)); - break; - default: - obj = 0; - break; - } - if (obj) { - PyDict_SetItemString(d,constants[i].name,obj); - Py_DECREF(obj); - } - } -} - -#endif - -/* Contract support */ - -#define SWIG_contract_assert(expr, msg) if (!(expr)) { PyErr_SetString(PyExc_RuntimeError, (char *) msg ); goto fail; } else - -#ifdef __cplusplus -} -#endif - - -/* -------- TYPES TABLE (BEGIN) -------- */ - -#define SWIGTYPE_p_char swig_types[0] -static swig_type_info *swig_types[2]; - -/* -------- TYPES TABLE (END) -------- */ - -#define SWIG_init initswigrun - -#define SWIG_name "swigrun" - -/* Auxiliar swig macros that appear in the header */ - -#define SWIG_OLDOBJ 1 -#define SWIG_NEWOBJ SWIG_OLDOBJ + 1 -#define SWIG_PYSTR SWIG_NEWOBJ + 1 - -#ifdef __cplusplus -#define SWIGSTATICINLINE(a) static inline a -#define SWIGSTATIC(a) static a -#define swig_new_array(size,Type) (new Type[(size)]) -#define swig_delete(cptr) delete cptr -#define swig_delete_array(cptr) delete[] cptr -#define swig_const_cast(a,Type) const_cast(a) -#define swig_static_cast(a,Type) static_cast(a) -#define swig_reinterpret_cast(a,Type) reinterpret_cast(a) -#define swig_new_copy(ptr,Type) (new Type(*ptr)) -#define swig_numeric_cast(a,Type) static_cast(a) - -#else /* C case */ - -#define SWIGSTATICINLINE(a) static a -#define SWIGSTATIC(a) static a -#define swig_new_array(size,Type) ((Type*) malloc((size)*sizeof(Type))) -#define swig_delete(cptr) free((char*)cptr) -#define swig_delete_array(cptr) free((char*)cptr) -#define swig_const_cast(a,Type) (Type)(a) -#define swig_static_cast(a,Type) (Type)(a) -#define swig_reinterpret_cast(a,Type) (Type)(a) -#define swig_numeric_cast(a,Type) (Type)(a) -#define swig_new_copy(ptr,Type) ((Type*)memcpy(malloc(sizeof(Type)),ptr,sizeof(Type))) - -#endif /* __cplusplus */ - - -/*@/opt/swig/share/swig/1.3.22/python/pymacros.swg,63,SWIG_define@*/ -#define SWIG_From_signed_SS_char PyInt_FromLong -/*@@*/ -/*@/opt/swig/share/swig/1.3.22/python/pymacros.swg,63,SWIG_define@*/ -#define SWIG_From_unsigned_SS_char PyInt_FromLong -/*@@*/ -/*@/opt/swig/share/swig/1.3.22/python/pymacros.swg,63,SWIG_define@*/ -#define SWIG_From_short PyInt_FromLong -/*@@*/ -/*@/opt/swig/share/swig/1.3.22/python/pymacros.swg,63,SWIG_define@*/ -#define SWIG_From_unsigned_SS_short PyInt_FromLong -/*@@*/ -/*@/opt/swig/share/swig/1.3.22/python/pymacros.swg,63,SWIG_define@*/ -#define SWIG_From_int PyInt_FromLong -/*@@*/ -/*@/opt/swig/share/swig/1.3.22/python/pymacros.swg,63,SWIG_define@*/ -#define SWIG_From_long PyInt_FromLong -/*@@*/ -/*@/opt/swig/share/swig/1.3.22/python/pymacros.swg,63,SWIG_define@*/ -#define SWIG_From_float PyFloat_FromDouble -/*@@*/ -/*@/opt/swig/share/swig/1.3.22/python/pymacros.swg,63,SWIG_define@*/ -#define SWIG_From_double PyFloat_FromDouble -/*@@*/ - -#ifdef __cplusplus -extern "C" { -#endif -static PyMethodDef SwigMethods[] = { - { NULL, NULL, 0, NULL } -}; - - -/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ - -static swig_type_info _swigt__p_char[] = {{"_p_char", 0, "char *", 0, 0, 0, 0},{"_p_char", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; - -static swig_type_info *swig_types_initial[] = { -_swigt__p_char, -0 -}; - - -/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ - -static swig_const_info swig_const_table[] = { -{0, 0, 0, 0.0, 0, 0}}; - -#ifdef __cplusplus -} -#endif - -#ifdef __cplusplus -extern "C" -#endif -SWIGEXPORT(void) SWIG_init(void) { - static PyObject *SWIG_globals = 0; - static int typeinit = 0; - PyObject *m, *d; - int i; - if (!SWIG_globals) SWIG_globals = SWIG_newvarlink(); - m = Py_InitModule((char *) SWIG_name, SwigMethods); - d = PyModule_GetDict(m); - - if (!typeinit) { - for (i = 0; swig_types_initial[i]; i++) { - swig_types[i] = SWIG_TypeRegister(swig_types_initial[i]); - } - typeinit = 1; - } - SWIG_InstallConstants(d,swig_const_table); - -} - diff --git a/wxPython/src/media.i b/wxPython/src/media.i index 642663b2ae..d5a210f47a 100644 --- a/wxPython/src/media.i +++ b/wxPython/src/media.i @@ -183,10 +183,10 @@ public: const wxValidator& validator = wxDefaultValidator, const wxString& name = wxPyMediaCtrlNameStr); - %name(PreMediaCtrl) wxMediaCtrl(); + %RenameCtor(PreMediaCtrl, wxMediaCtrl()); // %extend { -// %name(MediaCtrlFromURI) +// %RenameCtor(MediaCtrlFromURI, // wxMediaCtrl(wxWindow* parent, // wxWindowID id=-1, // const wxString& location=wxPyEmptyString, @@ -195,7 +195,7 @@ public: // long style = 0, // const wxString& szBackend = wxPyEmptyString, // const wxValidator& validator = wxDefaultValidator, -// const wxString& name = wxPyMediaCtrlNameStr) +// const wxString& name = wxPyMediaCtrlNameStr)) // { // return new wxMediaCtrl(parent, id, wxURI(location), // pos, size, style, szBackend, validator, name); diff --git a/wxPython/src/my_fragments.i b/wxPython/src/pyfragments.swg similarity index 60% rename from wxPython/src/my_fragments.i rename to wxPython/src/pyfragments.swg index 7bf107d55f..84fc9a705a 100644 --- a/wxPython/src/my_fragments.i +++ b/wxPython/src/pyfragments.swg @@ -1,5 +1,7 @@ -// There is a bug in the standard t_output_helper, this one will replace it -// until it is fixed. + + +// There standard t_output_helper has been changed to return a list rather +// than a tuple, we'll replace it with the old implementation here. %fragment("t_output_helper","header") %{ @@ -37,17 +39,10 @@ // it can be converted to a PyInt. (Specifically, I allow floats where the // default SWIG_AsVal_long would just raise an exception. // -// NOTE: This file has to be %included very early in the SWIGging process as -// it no longer allows existing fragments to be replaced with one of the same -// name. So to make this work I had to bring a copy of python.swg into this -// project and do the %include there before most other of the standard swiglib -// files are %included. This may change in 1.3.23, so adjust accordingly then. - %fragment(SWIG_AsVal_frag(long), "header") { -// See my_fragments.i -SWIGSTATICINLINE(int) +SWIGINTERN int SWIG_AsVal(long)(PyObject* obj, long* val) { if (PyNumber_Check(obj)) { @@ -55,10 +50,7 @@ SWIG_AsVal(long)(PyObject* obj, long* val) return 1; } else { - PyObject* errmsg = PyString_FromFormat("Expected number, got %s", - obj->ob_type->tp_name); - PyErr_SetObject(PyExc_TypeError, errmsg); - Py_DECREF(errmsg); + SWIG_type_error("number", obj); } return 0; } @@ -67,14 +59,12 @@ SWIG_AsVal(long)(PyObject* obj, long* val) %fragment(SWIG_AsVal_frag(unsigned long), "header", fragment=SWIG_AsVal_frag(long)) { -// See my_fragments.i -SWIGSTATICINLINE(int) +SWIGINTERN int SWIG_AsVal(unsigned long)(PyObject* obj, unsigned long* val) { long v = 0; if (SWIG_AsVal_long(obj, &v) && v < 0) { - PyErr_SetString(PyExc_TypeError, "negative value received for unsigned type"); - return 0; + SWIG_type_error("unsigned number", obj); } else if (val) *val = (unsigned long)v; @@ -84,8 +74,7 @@ SWIG_AsVal(unsigned long)(PyObject* obj, unsigned long* val) %fragment(SWIG_AsVal_frag(double), "header") { -// See my_fragments.i -SWIGSTATICINLINE(int) +SWIGINTERN int SWIG_AsVal(double)(PyObject *obj, double* val) { if (PyNumber_Check(obj)) { @@ -93,10 +82,7 @@ SWIG_AsVal(double)(PyObject *obj, double* val) return 1; } else { - PyObject* errmsg = PyString_FromFormat("Expected number, got %s", - obj->ob_type->tp_name); - PyErr_SetObject(PyExc_TypeError, errmsg); - Py_DECREF(errmsg); + SWIG_type_error("number", obj); } return 0; } diff --git a/wxPython/src/pyrun.swg b/wxPython/src/pyrun.swg deleted file mode 100644 index a8dffa8f3c..0000000000 --- a/wxPython/src/pyrun.swg +++ /dev/null @@ -1,78 +0,0 @@ -/*********************************************************************** - * pyrun.swg for wxPython - * - * Include only the function prototypes and such from SWIG's pyrun.swg, - * but not the runtime functions themselves. This helps keep the - * wrapper files clean of unnecessary stuff that is in the libpy.c file - * anyway. - * - ************************************************************************/ - -#ifdef __cplusplus -extern "C" { -#endif - -#define SWIG_PY_INT 1 -#define SWIG_PY_FLOAT 2 -#define SWIG_PY_STRING 3 -#define SWIG_PY_POINTER 4 -#define SWIG_PY_BINARY 5 - -/* Flags for pointer conversion */ - -#define SWIG_POINTER_EXCEPTION 0x1 -#define SWIG_POINTER_DISOWN 0x2 - -/* Exception handling in wrappers */ -#define SWIG_fail goto fail - -/* Constant information structure */ -typedef struct swig_const_info { - int type; - char *name; - long lvalue; - double dvalue; - void *pvalue; - swig_type_info **ptype; -} swig_const_info; - -/* Common SWIG API */ -#define SWIG_ConvertPtr(obj, pp, type, flags) \ - SWIG_Python_ConvertPtr(obj, pp, type, flags) -#define SWIG_NewPointerObj(p, type, flags) \ - SWIG_Python_NewPointerObj(p, type, flags) -#define SWIG_MustGetPtr(p, type, argnum, flags) \ - SWIG_Python_MustGetPtr(p, type, argnum, flags) - -/* Python-specific SWIG API */ -#define SWIG_newvarlink() \ - SWIG_Python_newvarlink() -#define SWIG_addvarlink(p, name, get_attr, set_attr) \ - SWIG_Python_addvarlink(p, name, get_attr, set_attr) -#define SWIG_ConvertPacked(obj, ptr, sz, ty, flags) \ - SWIG_Python_ConvertPacked(obj, ptr, sz, ty, flags) -#define SWIG_NewPackedObj(ptr, sz, type) \ - SWIG_Python_NewPackedObj(ptr, sz, type) -#define SWIG_InstallConstants(d, constants) \ - SWIG_Python_InstallConstants(d, constants) - -typedef double (*py_objasdbl_conv)(PyObject *obj); - -SWIGIMPORT(int) SWIG_Python_ConvertPtr(PyObject *, void **, swig_type_info *, int); -SWIGIMPORT(PyObject *) SWIG_Python_NewPointerObj(void *, swig_type_info *,int own); -SWIGIMPORT(void *) SWIG_Python_MustGetPtr(PyObject *, swig_type_info *, int, int); -SWIGIMPORT(PyObject *) SWIG_Python_newvarlink(void); -SWIGIMPORT(void) SWIG_Python_addvarlink(PyObject *, char *, PyObject *(*)(void), int (*)(PyObject *)); -SWIGIMPORT(int) SWIG_Python_ConvertPacked(PyObject *, void *, int sz, swig_type_info *, int); -SWIGIMPORT(PyObject *) SWIG_Python_NewPackedObj(void *, int sz, swig_type_info *); -SWIGIMPORT(void) SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]); - - -/* Contract support */ - -#define SWIG_contract_assert(expr, msg) if (!(expr)) { PyErr_SetString(PyExc_RuntimeError, (char *) msg ); goto fail; } else - -#ifdef __cplusplus -} -#endif - diff --git a/wxPython/src/python.swg b/wxPython/src/python.swg deleted file mode 100644 index 0b0da26c60..0000000000 --- a/wxPython/src/python.swg +++ /dev/null @@ -1,90 +0,0 @@ -/* ----------------------------------------------------------------------------- - * python.swg - * - * Python configuration module. - * ----------------------------------------------------------------------------- */ - -/* Python.h has to appear first */ - -%insert(runtime) %{ -#include "Python.h" -%} - -%insert(runtime) "precommon.swg"; -%insert(runtime) "common.swg"; /* Common type-checking code */ -%insert(runtime) "pyrun.swg"; /* Python run-time code */ - -/* Special directive for shadow code */ - -#define %shadow %insert("shadow") -#define %pythoncode %insert("python") - -%include "pymacros.swg" - - -/* ----------------------------------------------------------------------------- - * SWIGTYPE typemaps - * ----------------------------------------------------------------------------- */ - -%include "pyswigtype.swg" - - -/* ----------------------------------------------------------------------------- - * Check for local fragment defintions - * ----------------------------------------------------------------------------- */ - -%include "my_fragments.i" - - -/* ----------------------------------------------------------------------------- - * Typemap specializations - * ----------------------------------------------------------------------------- */ - -%include "pyinout.swg" -%include "pyvoid.swg" -%include "pyobject.swg" -%include "pystrbase.swg" -%include "pystrings.swg" -%include "pyvaltypes.swg" -%include "pyptrtypes.swg" -%include "pyprimtypes.swg" -%include "pymisctypes.swg" -%include "pyenum.swg" - -/* ------------------------------------------------------------ - * Overloaded operator support - * ------------------------------------------------------------ */ -%include "pyopers.swg" - -/* ------------------------------------------------------------ - * Warnings for Python keywords - * ------------------------------------------------------------ */ -%include "pythonkw.swg" - -/* ------------------------------------------------------------ - * The start of the Python initialization function - * ------------------------------------------------------------ */ - -%init %{ -#ifdef __cplusplus -extern "C" -#endif -SWIGEXPORT(void) SWIG_init(void) { - static PyObject *SWIG_globals = 0; - static int typeinit = 0; - PyObject *m, *d; - int i; - if (!SWIG_globals) SWIG_globals = SWIG_newvarlink(); - m = Py_InitModule((char *) SWIG_name, SwigMethods); - d = PyModule_GetDict(m); - - if (!typeinit) { - for (i = 0; swig_types_initial[i]; i++) { - swig_types[i] = SWIG_TypeRegister(swig_types_initial[i]); - } - typeinit = 1; - } - SWIG_InstallConstants(d,swig_const_table); -%} - - diff --git a/wxPython/src/webkit.i b/wxPython/src/webkit.i index 3b5aadf643..33fa36f09e 100644 --- a/wxPython/src/webkit.i +++ b/wxPython/src/webkit.i @@ -134,7 +134,7 @@ public: const wxValidator& validator = wxDefaultValidator, const wxString& name = wxPyWebKitNameStr); - %name(PreWebKitCtrl)wxWebKitCtrl(); + %RenameCtor(PreWebKitCtrl, wxWebKitCtrl()); bool Create(wxWindow *parent, diff --git a/wxPython/src/wizard.i b/wxPython/src/wizard.i index 32c7b7cd9a..e2add09da9 100644 --- a/wxPython/src/wizard.i +++ b/wxPython/src/wizard.i @@ -96,7 +96,7 @@ public: // wxWizardPage(wxWizard *parent, // const wxBitmap& bitmap = wxNullBitmap, // const char* resource = NULL); -// %name(PreWizardPage)wxWizardPage(); +// %RenameCtor(PreWizardPage, wxWizardPage()); %extend { bool Create(wxWizard *parent, @@ -224,7 +224,7 @@ public: } } - %name(PrePyWizardPage)wxPyWizardPage(); + %RenameCtor(PrePyWizardPage, wxPyWizardPage()); // Turn it back on again %typemap(out) wxPyWizardPage* { $result = wxPyMake_wxObject($1, $owner); } @@ -297,7 +297,7 @@ public: wxWizardPage *next = NULL, const wxBitmap& bitmap = wxNullBitmap, const wxChar* resource = NULL); - %name(PreWizardPageSimple)wxWizardPageSimple(); + %RenameCtor(PreWizardPageSimple, wxWizardPageSimple()); bool Create(wxWizard *parent = NULL, wxWizardPage *prev = NULL, @@ -331,7 +331,7 @@ public: const wxBitmap& bitmap = wxNullBitmap, const wxPoint& pos = wxDefaultPosition, long style = wxDEFAULT_DIALOG_STYLE); - %name(PreWizard)wxWizard(); + %RenameCtor(PreWizard, wxWizard()); bool Create(wxWindow *parent, int id = -1, -- 2.45.2