From 4fd3b4e55d232b04c5c837371221492afffc5eaa Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 12 Apr 2019 22:12:50 -0700 Subject: [PATCH] Various updates needed to fix builds with sip 4.19.16 --- docs/sphinx/itemToModuleMap.json | 5 ++++- etg/config.py | 11 ++++++++--- etg/printfw.py | 1 - etg/renderer.py | 31 +++++++++++++++++-------------- etg/statbox.py | 11 ++++++----- src/wacky_ints.sip | 29 ----------------------------- 6 files changed, 35 insertions(+), 53 deletions(-) diff --git a/docs/sphinx/itemToModuleMap.json b/docs/sphinx/itemToModuleMap.json index 83326459..a0dfc90b 100644 --- a/docs/sphinx/itemToModuleMap.json +++ b/docs/sphinx/itemToModuleMap.json @@ -887,7 +887,7 @@ "DirProperty":"wx.propgrid.", "DirSelector":"wx.", "DirSelectorPromptStr":"wx.", -"Direction":"wx.", +"Direction":"wx.DataObject.", "DisableAsserts":"wx.", "Display":"wx.", "DisplayChangedEvent":"wx.", @@ -2247,6 +2247,8 @@ "LOCALE_CAT_NUMBER":"wx.", "LOCALE_DATE_TIME_FMT":"wx.", "LOCALE_DECIMAL_POINT":"wx.", +"LOCALE_DONT_LOAD_DEFAULT":"wx.", +"LOCALE_LOAD_DEFAULT":"wx.", "LOCALE_LONG_DATE_FMT":"wx.", "LOCALE_SHORT_DATE_FMT":"wx.", "LOCALE_THOUSANDS_SEP":"wx.", @@ -2292,6 +2294,7 @@ "Locale":"wx.", "LocaleCategory":"wx.", "LocaleInfo":"wx.", +"LocaleInitFlags":"wx.", "Log":"wx.", "LogBuffer":"wx.", "LogChain":"wx.", diff --git a/etg/config.py b/etg/config.py index 8675e751..30e41c64 100644 --- a/etg/config.py +++ b/etg/config.py @@ -178,8 +178,7 @@ def run(): c.addPrivateCopyCtor() c.find('wxFileConfig').findOverload('wxInputStream').find('conv').ignore() ctor = c.find('wxFileConfig').findOverload('wxString').find('conv').ignore() - #ctor.items.remove(ctor.find('conv')) - ctor = c.find('Save').find('conv').ignore() + c.find('Save').ignore() c.find('GetGlobalFile').ignore() c.find('GetLocalFile').ignore() @@ -188,7 +187,13 @@ def run(): c.find('GetFirstEntry').ignore() c.find('GetNextEntry').ignore() - + c.addCppMethod('bool', 'Save', '(wxOutputStream& os)', doc=c.find('Save').briefDoc, body="""\ + #if wxUSE_STREAMS + return self->Save(*os); + #else + wxPyRaiseNotImplemented(); + #endif + """) #----------------------------------------------------------------- # In C++ wxConfig is a #define to some other config class. We'll let our diff --git a/etg/printfw.py b/etg/printfw.py index 0d0500ff..90f5f75a 100644 --- a/etg/printfw.py +++ b/etg/printfw.py @@ -61,7 +61,6 @@ def run(): c.find('CreateCanvas').isVirtual = True c.find('CreateControlBar').isVirtual = True c.find('Initialize').isVirtual = True - c.find('InitializeWithModality').isVirtual = True diff --git a/etg/renderer.py b/etg/renderer.py index 2319b62d..b87d6952 100644 --- a/etg/renderer.py +++ b/etg/renderer.py @@ -43,24 +43,28 @@ def run(): c.find('GetGeneric').mustHaveApp() c.find('GetDefault').mustHaveApp() c.find('Set').mustHaveApp() - - - #virtual void DrawTitleBarBitmap(wxWindow *win, - # wxDC& dc, - # const wxRect& rect, - # wxTitleBarButton button, - # int flags = 0) = 0; - c.find('DrawTitleBarBitmap').setCppCode("""\ - #ifdef wxHAS_DRAW_TITLE_BAR_BITMAP - self->DrawTitleBarBitmap(win, *dc, *rect, button, flags); - #endif - """) - + c.find('DrawTitleBarBitmap').ignore() + draw_tb_bmp_doc = c.find('DrawTitleBarBitmap').briefDoc c = module.find('wxDelegateRendererNative') c.mustHaveApp() c.addPrivateCopyCtor() + #virtual void DrawTitleBarBitmap(wxWindow *win, + # wxDC& dc, + # const wxRect& rect, + # wxTitleBarButton button, + # int flags = 0); + c.addCppMethod('void', 'DrawTitleBarBitmap', + '(wxWindow* win, wxDC& dc, const wxRect& rect, wxTitleBarButton button, int flags = 0)', + doc=draw_tb_bmp_doc, + body="""\ + #ifdef wxHAS_DRAW_TITLE_BAR_BITMAP + self->DrawTitleBarBitmap(win, *dc, *rect, button, flags); + #else + wxPyRaiseNotImplemented(); + #endif + """) #----------------------------------------------------------------- tools.doCommonTweaks(module) @@ -70,4 +74,3 @@ def run(): #--------------------------------------------------------------------------- if __name__ == '__main__': run() - diff --git a/etg/statbox.py b/etg/statbox.py index 2fdcb0bf..5b25da26 100644 --- a/etg/statbox.py +++ b/etg/statbox.py @@ -41,11 +41,12 @@ def run(): # This is intentionally not documented, but I think it would be handy to # use from wxPython. - meth = MethodDef(name='GetBordersForSizer', isVirtual=True, type='void', protection='public', - briefDoc="Returns extra space that may be needed for borders within a StaticBox.", - items=[ParamDef(name='borderTop', type='int*', out=True), - ParamDef(name='borderOther', type='int*', out=True), - ]) + meth = MethodDef( + name='GetBordersForSizer', isConst=True, isVirtual=True, type='void', protection='public', + briefDoc="Returns extra space that may be needed for borders within a StaticBox.", + items=[ParamDef(name='borderTop', type='int*', out=True), + ParamDef(name='borderOther', type='int*', out=True), + ]) c.addItem(meth) module.addGlobalStr('wxStaticBoxNameStr', c) diff --git a/src/wacky_ints.sip b/src/wacky_ints.sip index 4677e537..7fd804a5 100644 --- a/src/wacky_ints.sip +++ b/src/wacky_ints.sip @@ -13,35 +13,6 @@ //-------------------------------------------------------------------------- -// size_t will either be equivalent to an unsigned long, or to an -// unsigned long long. wxWidgets' configure script has already figured out -// which it is, so we can make it conditional on those results. - -%MappedType size_t { - - %TypeHeaderCode - #include - %End - - %ConvertToTypeCode - // Allow conversions from any number type - if (!sipIsErr) { - if (PyNumber_Check(sipPy)) - return TRUE; - return FALSE; - } - - // Do the conversion - *sipCppPtr = new size_t(wxPyInt_AsSize_t(sipPy)); - return sipGetState(sipTransferObj); - %End - - %ConvertFromTypeCode - return wxPyInt_FromSize_t(*sipCpp); - %End -}; - - // This type is a signed integer value that is large enough to hold a // pointer. Again we'll use the results of wxWidgets configuration. %MappedType wxIntPtr {