wxruby3 1.5.1 → 1.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c66a3ae46adfde4f69fe289722d28b319f88a13d368babf85d8486d70ec89b81
4
- data.tar.gz: 9ada796fe609d8fadb1f4b6436d787c2e3570863eacfd65772156cf2ba4baab3
3
+ metadata.gz: d4076c5fcd81a2bd38c5e53367b337a7a0f2590f047bcf12def1bd3d3df9d301
4
+ data.tar.gz: ade42868f8a79fcc293af4b9070eab971f80a0871a1a0fe7384d55a144a77332
5
5
  SHA512:
6
- metadata.gz: 0f22f743031fe5e16981b8c01b09b9e0d505839f330b48ef25715dc73044d85cbe5a211a107d93a41203b8cc0214fad0a9f5b152f6d82f4828e08c0cef136965
7
- data.tar.gz: f04a7c5176ac19c6a7702bb61f24c9c88c643e65d345618c8a96733bd60dcbb3a0933245fc1bb4b0354881f0b4d875d2379d2982e5e7d50f3fbe1d713d01f46a
6
+ metadata.gz: 6e9d0f837e87dc24ddbcc17a4eff510ba6af44bc3f108c76301b0fb36d86a496dab422127c7fc0b917470f5b282709696448a6d0f8a1256d18c9a2a46c972a63
7
+ data.tar.gz: 9065c12716485ebcefdd5a01bbb3ef7f4a3bf56c3b8aba3e12b6b4c189766e8a1279591a55553fc9e898838488f78993f95d31cd12a0c3b5e9525398d7fd4c8c
data/lib/wx/version.rb CHANGED
@@ -3,5 +3,5 @@
3
3
  # This software is released under the MIT license.
4
4
 
5
5
  module Wx
6
- WXRUBY_VERSION = '1.5.1'
6
+ WXRUBY_VERSION = '1.5.2'
7
7
  end
@@ -62,7 +62,7 @@ module WXRuby3
62
62
  rb_raise(rb_eTypeError, "Expected Array of Integer for 1");
63
63
  }
64
64
  }
65
- __HEREDOC
65
+ __HEREDOC
66
66
  spec.map 'std::vector<wxAuiPaneLayoutInfo>' => 'Array<Wx::AuiPaneLayoutInfo>' do
67
67
  map_out code: <<~__CODE
68
68
  $result = rb_ary_new();
@@ -72,7 +72,7 @@ module WXRuby3
72
72
  VALUE r_pane = SWIG_NewPointerObj(new wxAuiPaneLayoutInfo(pane), SWIGTYPE_p_wxAuiPaneLayoutInfo, SWIG_POINTER_OWN);
73
73
  rb_ary_push($result, r_pane);
74
74
  }
75
- __CODE
75
+ __CODE
76
76
  map_directorout code: <<~__CODE
77
77
  if (TYPE($input) == T_ARRAY)
78
78
  {
@@ -88,7 +88,7 @@ module WXRuby3
88
88
  $result.push_back(*pane);
89
89
  }
90
90
  }
91
- __CODE
91
+ __CODE
92
92
  end
93
93
  spec.map 'std::vector<wxAuiTabLayoutInfo>' => 'Array<Wx::AuiTabLayoutInfo>' do
94
94
  map_out code: <<~__CODE
@@ -99,7 +99,7 @@ module WXRuby3
99
99
  VALUE r_tab = SWIG_NewPointerObj(new wxAuiTabLayoutInfo(tab), SWIGTYPE_p_wxAuiTabLayoutInfo, SWIG_POINTER_OWN);
100
100
  rb_ary_push($result, r_tab);
101
101
  }
102
- __CODE
102
+ __CODE
103
103
  map_directorout code: <<~__CODE
104
104
  if (TYPE($input) == T_ARRAY)
105
105
  {
@@ -115,8 +115,86 @@ module WXRuby3
115
115
  $result.push_back(*tab);
116
116
  }
117
117
  }
118
+ __CODE
119
+ end
120
+ # For wxAuiDeserialize::HandleOrphanedPage: the ruby method is passed the AuiNotebook
121
+ # and the page and should return either true if the orphaned page should just be appended
122
+ # to the main tab, a tuple with an AuiTabCtrl and a tab index to place the orphaned page in
123
+ # or false if the orphaned page should be removed.
124
+ spec.map 'int page, wxAuiTabCtrl **tabCtrl, int * tabIndex' do
125
+
126
+ add_header_code <<~__CODE
127
+ static WxRuby_ID s_AuiTabCtrl_id("AuiTabCtrl");
128
+ __CODE
129
+
130
+ map_in from: {type: 'Integer', index: 0}, temp: 'wxAuiTabCtrl *tab_ctrl, int tab_ix', code: <<~__CODE
131
+ $1 = NUM2INT($input);
132
+ tab_ctrl = nullptr; tab_ix = 0;
133
+ $2 = &tab_ctrl;
134
+ $3 = &tab_ix;
135
+ __CODE
136
+
137
+ # ignore C defined return value entirely (also affects directorout)
138
+ map_out ignore: 'bool'
139
+
140
+ map_argout as: {type: 'Boolean,Array(Wx::AUI::AuiTabCtrl, Integer)', index: 1}, code: <<~__CODE
141
+ if (result)
142
+ {
143
+ if (tab_ctrl$argnum)
144
+ {
145
+ VALUE rb_klass = rb_const_get(mWxAuiManager, s_AuiTabCtrl_id());
146
+ swig_type_info* swig_type = wxRuby_GetSwigTypeForClass(rb_klass);
147
+ $result = rb_ary_new();
148
+ rb_ary_push($result, SWIG_NewPointerObj(SWIG_as_voidptr(tab_ctrl$argnum), swig_type, 0));
149
+ rb_ary_push($result, INT2NUM(tab_ix$argnum));
150
+ }
151
+ else
152
+ $result = Qtrue;
153
+ }
154
+ else
155
+ $result = Qfalse;
118
156
  __CODE
157
+
158
+ # convert page and ignore rest for now
159
+ map_directorin code: '$input = INT2NUM(page);'
160
+
161
+ map_directorargout code: <<~__CODE
162
+ if (result != Qfalse)
163
+ {
164
+ if (result == Qtrue)
165
+ {
166
+ c_result = true;
167
+ *tabCtrl = nullptr;
168
+ *tabIndex = 0;
169
+ }
170
+ else if (TYPE(result) == T_ARRAY && RARRAY_LEN(result) == 2)
171
+ {
172
+ VALUE rb_klass = rb_const_get(mWxAuiManager, s_AuiTabCtrl_id());
173
+ swig_type_info* swig_type = wxRuby_GetSwigTypeForClass(rb_klass);
174
+ void *tab_ctrl;
175
+ int res = SWIG_ConvertPtr(rb_ary_entry(result, 0), &tab_ctrl, swig_type, 0);
176
+ if (!SWIG_IsOK(res))
177
+ {
178
+ Swig::DirectorTypeMismatchException::raise(swig_get_self(), "$symname", rb_eTypeError,
179
+ "HandleOrphanedPage should return false, true or Array(Wx::AUI::AuiTabCtrl, Integer)");
180
+ }
181
+ *tabCtrl = reinterpret_cast<wxAuiTabCtrl*>(tab_ctrl);
182
+ *tabIndex = NUM2INT(rb_ary_entry(result, 1));
183
+ c_result = true;
184
+ }
185
+ else
186
+ {
187
+ Swig::DirectorTypeMismatchException::raise(swig_get_self(), "$symname", rb_eTypeError,
188
+ "HandleOrphanedPage should return false, true or Array(Wx::AUI::AuiTabCtrl, Integer)");
189
+ }
190
+ }
191
+ else
192
+ c_result = false;
193
+ __CODE
194
+
119
195
  end
196
+ spec.suppress_warning(473, 'wxAuiDeserializer::CreatePaneWindow')
197
+
120
198
  end
121
199
  # need a custom implementation to handle (event handler proc) cleanup
122
200
  spec.add_header_code <<~__HEREDOC
@@ -32,7 +32,7 @@ module WXRuby3
32
32
  wxDELETEA
33
33
  wxSwap
34
34
  }
35
- if Config.instance.wx_version >= '3.3.0'
35
+ if Config.instance.wx_version >= '3.2.7'
36
36
  spec.ignore %w[wxWARN_UNUSED]
37
37
  end
38
38
  spec.ignore 'wxOVERRIDE'
@@ -19,3 +19,10 @@
19
19
  ```ruby
20
20
  @mgr.get_pane(@text1).float
21
21
  ```
22
+ :wxAuiBookDeserializer.HandleOrphanedPage:
23
+ :detail:
24
+ :pre:
25
+ :para:
26
+ - :pattern: !ruby/regexp /The overridden version may return true but modify.*appending them./
27
+ :replace: |
28
+ The overridden version may return a 2-element array with an AuiTabCtrl and tab index instead to change where the page should be inserted, e.g. by returning a tab index of 0 to insert the new pages at the beginning instead of appending them.
@@ -18,7 +18,6 @@ class FileDialogTests < Test::Unit::TestCase
18
18
  end
19
19
 
20
20
  # temporary as wxw >= 3.3.0 introduced a bug
21
- if Wx::WXWIDGETS_VERSION < '3.3.0'
22
21
  def test_file_dialog
23
22
  dlg = Wx::FileDialog.new(nil, 'Select file')
24
23
  assert_kind_of(Wx::FileDialog, dlg)
@@ -26,7 +25,6 @@ class FileDialogTests < Test::Unit::TestCase
26
25
  assert_kind_of(Wx::Window, dlg)
27
26
  assert_equal(Wx::ID_OK, dialog_tester(dlg))
28
27
  end
29
- end
30
28
 
31
29
  class FileDialogTestCustomization < Wx::FileDialogCustomizeHook
32
30
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wxruby3
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Corino
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-02-25 00:00:00.000000000 Z
10
+ date: 2025-03-22 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: nokogiri