File: fix-build-sip-4.19.14-1.patch

package info (click to toggle)
wxpython4.0 4.0.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 211,112 kB
  • sloc: cpp: 888,355; python: 223,130; makefile: 52,087; ansic: 45,780; sh: 3,012; xml: 1,534; perl: 264
file content (132 lines) | stat: -rw-r--r-- 5,165 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
From 3636ba3e606e3080942427beb68528f11cfb408e Mon Sep 17 00:00:00 2001
From: Scott Talbert <swt@techie.net>
Date: Fri, 22 Mar 2019 23:17:31 -0400
Subject: [PATCH 1/2] Fix building with SIP 4.19.14

This commit fixes building Phoenix with SIP 4.19.14.  One of the main changes
in this release was to add SIP_OVERRIDE, which adds the C++ override keyword
to method declarations that are intended to override the C++ class that SIP
is wrapping.  Unfortunately, this exposed a few bugs which caused compile
errors.  Most of the fixes are to the interface headers.  The two trickier
fixes were to wxFileConfig and wxRendererNative.

For wxFileConfig, the Save method's second parameter, 'conv', had been ignored.
This caused the override check to fail.  This was resolved by ignoring the
auto-generated Save() and adding a manually generated one without the second
parameter.

For wxRendererNative, the DrawTitleBarBitmap method is actually pure virtual
in the subclass, so the fix was to ignore it there.  In the subclass
wxDelegateRendererNative, it is concrete, but only on certain platforms.  This
was fixed in a similar way by adding a manually generated method that will
do the right thing on the platforms that support it.

There is one other fix required for SIP 4.19.14: SIP has now added its own
wrapper for size_t, so it required removing the one in wacky_ints.  This change
was omitted for now because it should probably wait until Phoenix officially
moves to 4.19.14.
---
 etg/config.py   | 10 +++++++++-
 etg/printfw.py  |  1 -
 etg/renderer.py | 18 +++++++++++-------
 etg/statbox.py  |  2 +-
 ext/wxWidgets   |  2 +-
 5 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/etg/config.py b/etg/config.py
index 8675e751..299f63b2 100644
--- a/etg/config.py
+++ b/etg/config.py
@@ -179,7 +179,7 @@ def run():
     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,6 +188,14 @@ 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
+        """)
+
 
 
     #-----------------------------------------------------------------
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..eea14676 100644
--- a/etg/renderer.py
+++ b/etg/renderer.py
@@ -43,25 +43,29 @@ def run():
     c.find('GetGeneric').mustHaveApp()
     c.find('GetDefault').mustHaveApp()
     c.find('Set').mustHaveApp()
+    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) = 0;
-    c.find('DrawTitleBarBitmap').setCppCode("""\
+    #                                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
     """)
 
 
-    c = module.find('wxDelegateRendererNative')
-    c.mustHaveApp()
-    c.addPrivateCopyCtor()
-
-
     #-----------------------------------------------------------------
     tools.doCommonTweaks(module)
     tools.runGenerators(module)
diff --git a/etg/statbox.py b/etg/statbox.py
index 2fdcb0bf..6274d376 100644
--- a/etg/statbox.py
+++ b/etg/statbox.py
@@ -41,7 +41,7 @@ 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',
+    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),
-- 
2.20.1