wxruby3 1.8.1 → 2.0.0

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.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/INSTALL.md +20 -10
  3. data/README.md +3 -3
  4. data/ext/wxruby3/include/wxRubyApp.h +49 -3
  5. data/ext/wxruby3/include/wxruby-ComboPopup.h +17 -32
  6. data/ext/wxruby3/include/wxruby-Config.h +34 -11
  7. data/ext/wxruby3/include/wxruby-GCTracking.h +23 -5
  8. data/ext/wxruby3/include/wxruby-SharedEventHandler.h +7 -7
  9. data/ext/wxruby3/include/wxruby-runtime.h +65 -0
  10. data/ext/wxruby3/swig/common.i +6 -0
  11. data/ext/wxruby3/swig/custom/typed_data/rubyhead.swg +220 -0
  12. data/ext/wxruby3/swig/custom/typed_data/rubyprimtypes.swg +265 -0
  13. data/ext/wxruby3/swig/custom/typed_data/rubyrun.swg +243 -0
  14. data/ext/wxruby3/swig/custom/typed_data/swigrun.swg +689 -0
  15. data/ext/wxruby3/swig/custom/{rubyprimtypes.swg → untyped_data/rubyprimtypes.swg} +8 -0
  16. data/ext/wxruby3/swig/mark_free_impl.i +2 -2
  17. data/ext/wxruby3/swig/memory_management.i +1 -0
  18. data/ext/wxruby3/swig/wx.i +19 -6
  19. data/lib/wx/core/file_dialog.rb +3 -10
  20. data/lib/wx/doc/rbn/events.rb +32 -0
  21. data/lib/wx/doc/rbn/ribbon_backstage_mrulist.rb +25 -0
  22. data/lib/wx/keyword_ctors.rb +3 -13
  23. data/lib/wx/rbn/events.rb +18 -0
  24. data/lib/wx/rbn/require.rb +1 -0
  25. data/lib/wx/rbn/ribbon_backstage_mrulist.rb +39 -0
  26. data/lib/wx/version.rb +1 -1
  27. data/rakelib/lib/config.rb +3 -3
  28. data/rakelib/lib/core/include/typed_data/swigrubyrun.inc +629 -0
  29. data/rakelib/lib/core/include/typed_data/swigrun.inc +870 -0
  30. data/rakelib/lib/core/package.rb +2 -2
  31. data/rakelib/lib/director/app.rb +16 -0
  32. data/rakelib/lib/director/art_provider.rb +3 -3
  33. data/rakelib/lib/director/aui_mdi_child_frame.rb +24 -0
  34. data/rakelib/lib/director/aui_mdi_parent_frame.rb +0 -2
  35. data/rakelib/lib/director/aui_tab_ctrl.rb +3 -3
  36. data/rakelib/lib/director/comboctrl.rb +35 -2
  37. data/rakelib/lib/director/config_base.rb +79 -33
  38. data/rakelib/lib/director/data_object.rb +1 -1
  39. data/rakelib/lib/director/date_event.rb +10 -3
  40. data/rakelib/lib/director/event.rb +16 -7
  41. data/rakelib/lib/director/event_handler.rb +48 -10
  42. data/rakelib/lib/director/events.rb +4 -2
  43. data/rakelib/lib/director/file_history.rb +46 -0
  44. data/rakelib/lib/director/frame.rb +29 -0
  45. data/rakelib/lib/director/fs_file.rb +2 -4
  46. data/rakelib/lib/director/functions.rb +2 -2
  47. data/rakelib/lib/director/graphics_context.rb +6 -6
  48. data/rakelib/lib/director/grid_cell_editor.rb +1 -1
  49. data/rakelib/lib/director/grid_cell_renderer.rb +1 -1
  50. data/rakelib/lib/director/grid_ctrl.rb +39 -12
  51. data/rakelib/lib/director/help_controller.rb +17 -0
  52. data/rakelib/lib/director/html_help_data.rb +20 -2
  53. data/rakelib/lib/director/icon.rb +3 -0
  54. data/rakelib/lib/director/log.rb +25 -1
  55. data/rakelib/lib/director/menu.rb +38 -106
  56. data/rakelib/lib/director/menu_bar.rb +36 -70
  57. data/rakelib/lib/director/num_validator.rb +3 -3
  58. data/rakelib/lib/director/numeric_property_validator.rb +1 -1
  59. data/rakelib/lib/director/page_setup_dialog.rb +18 -1
  60. data/rakelib/lib/director/pgeditor.rb +1 -1
  61. data/rakelib/lib/director/pgvalidation_info.rb +1 -0
  62. data/rakelib/lib/director/popup_window.rb +7 -0
  63. data/rakelib/lib/director/preview_frame.rb +8 -1
  64. data/rakelib/lib/director/print_dialog.rb +17 -0
  65. data/rakelib/lib/director/printer.rb +1 -1
  66. data/rakelib/lib/director/property_grid_page.rb +2 -0
  67. data/rakelib/lib/director/region_iterator.rb +1 -1
  68. data/rakelib/lib/director/ribbon_backstage.rb +28 -0
  69. data/rakelib/lib/director/ribbon_backstage_button.rb +25 -0
  70. data/rakelib/lib/director/ribbon_backstage_callout.rb +26 -0
  71. data/rakelib/lib/director/ribbon_backstage_heading.rb +26 -0
  72. data/rakelib/lib/director/ribbon_backstage_itemlist.rb +27 -0
  73. data/rakelib/lib/director/ribbon_backstage_mrulist.rb +112 -0
  74. data/rakelib/lib/director/ribbon_bar.rb +14 -0
  75. data/rakelib/lib/director/ribbon_gallery.rb +6 -2
  76. data/rakelib/lib/director/ribbon_tool_bar.rb +6 -4
  77. data/rakelib/lib/director/richtext_composite_object.rb +4 -4
  78. data/rakelib/lib/director/richtext_paragraph_layout_box.rb +1 -1
  79. data/rakelib/lib/director/scrolled_t.rb +1 -1
  80. data/rakelib/lib/director/sizer.rb +7 -0
  81. data/rakelib/lib/director/sizer_item.rb +4 -1
  82. data/rakelib/lib/director/splitter_event.rb +2 -2
  83. data/rakelib/lib/director/task_bar_icon.rb +4 -1
  84. data/rakelib/lib/director/text_validator.rb +1 -1
  85. data/rakelib/lib/director/tree_event.rb +3 -3
  86. data/rakelib/lib/director/validator.rb +1 -1
  87. data/rakelib/lib/director/variant.rb +2 -2
  88. data/rakelib/lib/director/window.rb +27 -5
  89. data/rakelib/lib/director/window_disabler.rb +1 -1
  90. data/rakelib/lib/director/xml_resource.rb +33 -8
  91. data/rakelib/lib/extractor/class.rb +2 -1
  92. data/rakelib/lib/extractor.rb +3 -2
  93. data/rakelib/lib/generate/interface.rb +2 -3
  94. data/rakelib/lib/specs/interfaces.rb +7 -0
  95. data/rakelib/lib/swig_runner.rb +14 -3
  96. data/rakelib/lib/typemap/common.rb +2 -36
  97. data/rakelib/lib/typemap/config.rb +22 -0
  98. data/samples/ribbon/ribbon.rb +277 -20
  99. data/tests/test_shared_event_handler.rb +3 -3
  100. metadata +32 -16
  101. /data/ext/wxruby3/swig/custom/{director.swg → common/director.swg} +0 -0
  102. /data/ext/wxruby3/swig/custom/{rubyapi.swg → common/rubyapi.swg} +0 -0
  103. /data/ext/wxruby3/swig/custom/{rubyerrors.swg → common/rubyerrors.swg} +0 -0
  104. /data/ext/wxruby3/swig/custom/{rubytracking.swg → common/rubytracking.swg} +0 -0
  105. /data/ext/wxruby3/swig/custom/{swiglabels.swg → common/swiglabels.swg} +0 -0
  106. /data/ext/wxruby3/swig/custom/{typemaps → common/typemaps}/swigtypemaps.swg +0 -0
  107. /data/ext/wxruby3/swig/custom/{wx_ruby_shared_ptr.i → common/wx_ruby_shared_ptr.i} +0 -0
  108. /data/ext/wxruby3/swig/custom/{wx_shared_ptr.i → common/wx_shared_ptr.i} +0 -0
  109. /data/ext/wxruby3/swig/custom/{rubyhead.swg → untyped_data/rubyhead.swg} +0 -0
  110. /data/ext/wxruby3/swig/custom/{rubyrun.swg → untyped_data/rubyrun.swg} +0 -0
  111. /data/ext/wxruby3/swig/custom/{swigrun.swg → untyped_data/swigrun.swg} +0 -0
  112. /data/rakelib/lib/core/include/{swigrubyrun.inc → untyped_data/swigrubyrun.inc} +0 -0
  113. /data/rakelib/lib/core/include/{swigrun.inc → untyped_data/swigrun.inc} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 686537c22871168bb80d09ecffbc7170b1de0560930014b579ee35dd3f71f80d
4
- data.tar.gz: 8ea1c3c592fd0ecc5e5922f7a3fabe12def1b97a76e30a88b0f576e90fdcca8b
3
+ metadata.gz: f39e1551823b010cd5652a2a716e2a86ad2f528e75fba1cfb6c9217570a83b76
4
+ data.tar.gz: 777e9314e2607553e45203726d43b7358c599c0f5cb4642e910e2efe34015909
5
5
  SHA512:
6
- metadata.gz: 60b6061a6746bf5185e54d7c5df8de624beb633ead75d00b256d87c521c392bd7dab7f8259c061e6622bc31d4559e5a9d664914a87215c08634b74b2d9711e03
7
- data.tar.gz: 3aa90ee4d255248e7678fed9a4bce668eb8cf01b7f36ff4f43dda3fff99f44d6eb37b607acdd1de26c63101fe3757e3d5b88d88020dd05dcbc87a283b40b9642
6
+ metadata.gz: 3234e21a01015ce46024cf61d2b3c608cecd07b013798ebe0b63cac69b687a768d00f2b6533095f6e7667ac40ca414b25a26a6be75619f9ead2a7ea086f6e762
7
+ data.tar.gz: 0d1eb79b8ed7df267fdad62f398fe76dd08aca7d56132783afbb24654bb8ad4a174fbded2d5148169c200e9c81604e4901af094daaaecda738963e015ed8b2c9
data/INSTALL.md CHANGED
@@ -29,6 +29,10 @@ should always result in a successfully installed wxRuby3 version.
29
29
  > like [ruby-install](https://github.com/postmodern/ruby-install) or [RVM](https://rvm.io) (only user installations
30
30
  > supported) or [rbenv](https://rbenv.org).
31
31
 
32
+ > **NOTE**<br>
33
+ > Be aware that [Homebrew](https://brew.sh/) has discontinued support for MacOS on Intel CPU and does not update
34
+ > packages for that platform anymore. Users of MacOS on Intel CPU should switch to [MacPorts](https://www.macports.org/) instead.
35
+
32
36
  [Below](INSTALL.md#installing-software-requirements) more details regarding the software requirements for wxRuby3, the
33
37
  setup procedure and various options to tweak and customize the installation (including platform specific details for
34
38
  Linux, Windows and MacOSX) are described.
@@ -77,10 +81,12 @@ The following tables lists the packages provided by the current wxRuby3 release
77
81
  | Linux | Fedora (at least latest stable) | x86_64 <b>and</b> ARM64 | Distro provided Ruby <b>and</b> Latest stable Ruby |
78
82
  | Linux | Debian (at least latest stable) | x86_64 <b>and</b> ARM64 | Distro provided Ruby <b>and</b> Latest stable Ruby |
79
83
  | Linux | Ubuntu (at least latest stable) | x86_64 <b>and</b> ARM64 | Distro provided Ruby <b>and</b> Latest stable Ruby |
84
+ | Linux | Mint (latest stable) | x86_64 | Distro provided Ruby <b>and</b> Latest stable Ruby |
80
85
  | Windows | NA | x86_64 | Latest stable Ruby |
81
- | OSX | MacOS 14 | ARM64 | Latest stable Ruby |
82
- | OSX | MacOS 15 | x86_64 <b>and</b> ARM64 | Latest stable Ruby |
83
- | OSX | MacOS 26 | x86_64 <b>and</b> ARM64 | Latest stable Ruby |
86
+ | OSX | MacOS 15 | x86_64 [**1**] <b>and</b> ARM64 | Latest stable Ruby |
87
+ | OSX | MacOS 26 | x86_64 [**1**] <b>and</b> ARM64 | Latest stable Ruby |
88
+
89
+ [**1**] Please be aware that Apple has dropped support for MacOS on Intel CPU for versions > 26.
84
90
 
85
91
  ### Additional packages
86
92
 
@@ -106,11 +112,11 @@ Both files are required for installation and should be located at the same path
106
112
  The software requirements for setting up a wxRuby3 runtime environment are:
107
113
 
108
114
  | Sofware | Notes |
109
- |-----------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
110
- | Ruby >= 3.0 | A supported version of the Ruby interpreter needs to be installed. This is an absolute requirement for any installation as one cannot install gems without Ruby and building from source requires Ruby to drive the build process. |
111
- | C++ compiler<br>(incl. dev tools like `make`) | Required for a source based installation to build wxWidgets (optionally) and the wxRuby extension libraries.<br/>On linux a recent version of the GNU C++ compiler (with c++-14 support) is required.<br>On Windows the RubyInstaller MSYS2-Devkit would be required.<br>On MacOS XCode with commandline tools would be required. |
115
+ |-----------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
116
+ | Ruby >= 3.2 | A supported version of the Ruby interpreter needs to be installed. This is an absolute requirement for any installation as one cannot install gems without Ruby and building from source requires Ruby to drive the build process. |
117
+ | C++ compiler<br>(incl. dev tools like `make`) | Required for a source based installation to build wxWidgets (optionally) and the wxRuby extension libraries.<br/>On linux a recent version of the GNU C++ compiler (with c++-14 support) is required.<br>On Windows the RubyInstaller MSYS2-Devkit would be required.<br>On MacOS XCode with commandline tools would be required.|
112
118
  | Git version control toolkit | Required for a source based installation in to (possibly) clone a copy of the wxWidgets Github repository or to clone the Github repository of wxRuby3 itself for a fully source based installation. |
113
- | Doxygen (>= 1.9.1) | Required for building the wxRuby3 extension libraries for a source based installation. [**1**] |
119
+ | Doxygen (>= 1.9.1; < 1.18.0 on MacOS) | Required for building the wxRuby3 extension libraries for a source based installation. [**1**] |
114
120
  | SWIG >= 3.0.12 | Required for building the wxRuby3 extension libraries for a source based installation. [**2**] |
115
121
  | Patchelf (Linux) or install_name_tool (OSX) | Required for setting up embedded wxWidgets libraries. [**3**] |
116
122
  | wxWidgets (>= 3.2) | Runtime libraries required for any wxRuby3 installation (either from embedded wxWidgets installation or a system or user installation; see below). |
@@ -217,9 +223,9 @@ This command only fails when:
217
223
  >
218
224
  > Run 'wxruby -h' to see information on the available commands.
219
225
  >
220
- > Successfully installed wxruby3-0.9.8
221
- > Parsing documentation for wxruby3-0.9.8
222
- > Installing ri documentation for wxruby3-0.9.8
226
+ > Successfully installed wxruby3-2.0.0
227
+ > Parsing documentation for wxruby3-2.0.0
228
+ > Installing ri documentation for wxruby3-2.0.0
223
229
  > Done installing documentation for wxruby3 after 2 seconds
224
230
  > 1 gem installed
225
231
  > ```
@@ -283,6 +289,10 @@ If any required software needs to be added the setup procedure will ask consent
283
289
  install the missing software using appropriate tooling for the platform (on Linux standard distribution installers which
284
290
  may require a 'sudo' password and on MacOSX using either [MacPorts](https://www.macports.org/) or [Homebrew](https://brew.sh/)).
285
291
 
292
+ > **NOTE**<br>
293
+ > Be aware that [Homebrew](https://brew.sh/) has discontinued support for MacOS on Intel CPU and does not update
294
+ > packages for that platform anymore. Users of MacOS on Intel CPU should switch to [MacPorts](https://www.macports.org/) instead.
295
+
286
296
  > Running the setup command will look something like this:
287
297
  > ```
288
298
  > $ wxruby setup
data/README.md CHANGED
@@ -101,9 +101,9 @@ Currently, the following are fully supported:
101
101
 
102
102
  | Platform | Ruby version(s) | wxWidgets version(s) |
103
103
  |--------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------|----------------------|
104
- | Windows >= 10 | Ruby >= 3.0<br>(RubyInstaller MSYS2-DevKit) | wxWidgets >= 3.2 |
105
- | Linux (tested; all major AMD64 and ARM64 distributions: Ubuntu, Debian, Fedora, OpenSuSE, LinuxMint, Manjaro and ArchLinux)<br>(most likely also i686) | Ruby >= 3.0 | wxWidgets >= 3.2 |
106
- | MacOS >= 14 (MacOS 13 most likely also works) using Cocoa (tested on AMD64 and ARM64 M1/M2 Chip) | Ruby >= 3.0 (MacPorts, Homebrew, ruby-install, RVM, Rbenv) | wxWidgets >= 3.2 |
104
+ | Windows >= 10 | Ruby >= 3.2<br>(RubyInstaller MSYS2-DevKit) | wxWidgets >= 3.2 |
105
+ | Linux (tested; all major AMD64 and ARM64 distributions: Ubuntu, Debian, Fedora, OpenSuSE, LinuxMint, Manjaro and ArchLinux)<br>(most likely also i686) | Ruby >= 3.2 | wxWidgets >= 3.2 |
106
+ | MacOS >= 15 (MacOS 14 might still work) using Cocoa (tested on AMD64 and ARM64 M1/M2 Chip) | Ruby >= 3.2 (MacPorts, Homebrew, ruby-install, RVM, Rbenv) | wxWidgets >= 3.2 |
107
107
 
108
108
  Support for other platforms is not being actively developed at present,
109
109
  but patches are welcome. It is likely to be much simpler to get wxRuby
@@ -7,6 +7,7 @@ WXRUBY_TRACE_GUARD(WxRubyTraceMarkApp, "GC_MARK_APP")
7
7
  WXRUBY_TRACE_GUARD(WxRubyTraceAppRun, "APP_RUN")
8
8
 
9
9
  #include <memory>
10
+ #include <queue>
10
11
 
11
12
  #include <ruby/ractor.h>
12
13
 
@@ -79,7 +80,7 @@ private:
79
80
  if (!m_shouldExit && needs_idle_evt)
80
81
  {
81
82
  needs_idle_evt = ProcessIdle();
82
- if (needs_idle_evt)
83
+ if (!needs_idle_evt)
83
84
  break;
84
85
  }
85
86
  }
@@ -140,6 +141,22 @@ private:
140
141
  int exit_code_ {};
141
142
  };
142
143
 
144
+ // With the switch to Ruby Typed Data object wrappers for Ruby 4.1 a tricky situation comes into
145
+ // existence with regard to window destruction from unattached windows by Ruby GC handling.
146
+ // Window destruction may (will; at least the wxWindowDestroyEvent) fire events which in turn
147
+ // will lead to Ruby object allocation which is not allowed during GC handling.
148
+ // We will therefor have to defer destruction of such windows at GC time by registering the
149
+ // windows in the below queue and destroy during idle cycles.
150
+ // We cannot use the built-in delayed object delete of wxApp as that will delete objects immediately
151
+ // when there is no event loop running anymore which will probably be the case at some point of the
152
+ // final Ruby GC handling.
153
+ struct SDeferredObjectDestroyRecord
154
+ {
155
+ void* object_;
156
+ void (* free_) (void *);
157
+ };
158
+ static std::queue<SDeferredObjectDestroyRecord> deferred_object_destroy_queue_;
159
+
143
160
  public:
144
161
  static wxRubyApp* GetInstance () { return dynamic_cast<wxRubyApp*> (wxApp::GetInstance()); }
145
162
 
@@ -155,7 +172,7 @@ public:
155
172
  // unlink
156
173
  if (this->self_ != Qnil)
157
174
  {
158
- DATA_PTR(this->self_) = 0;
175
+ WXRUBY_WRAPPER_DATA_PTR_RESET(this->self_);
159
176
  }
160
177
  this->self_ = Qnil;
161
178
  }
@@ -378,7 +395,7 @@ public:
378
395
  }
379
396
 
380
397
  // perform wxRuby cleanup
381
- _wxRuby_Cleanup();
398
+ this->_wxRuby_Cleanup();
382
399
 
383
400
  WXRUBY_TRACE_IF(WxRubyTraceAppRun, 1)
384
401
  WXRUBY_TRACE("< OnExit")
@@ -424,6 +441,9 @@ public:
424
441
  // can skip any GC marking later
425
442
  this->is_running_ = false;
426
443
 
444
+ // cleanup deferred object destroy
445
+ wxRubyApp::wxRuby_DoDeferredObjectDestroy();
446
+
427
447
  // if a Ruby implemented logger has been installed clean that up
428
448
  // before we exit, otherwise let wxWidgets handle things
429
449
  wxLog *oldlog = wxLog::GetActiveTarget();
@@ -447,4 +467,30 @@ public:
447
467
  WXRUBY_TRACE("< _wxRuby_Cleanup")
448
468
  WXRUBY_TRACE_END
449
469
  }
470
+
471
+ static void wxRuby_RegisterDeferredObjectDestroy(void *object, void (* free) (void*))
472
+ {
473
+ wxRubyApp::deferred_object_destroy_queue_.push( {object, free} );
474
+ }
475
+
476
+ static void wxRuby_DoDeferredObjectDestroy()
477
+ {
478
+ while (!wxRubyApp::deferred_object_destroy_queue_.empty())
479
+ {
480
+ wxRubyApp::SDeferredObjectDestroyRecord rec = wxRubyApp::deferred_object_destroy_queue_.front();
481
+ wxRubyApp::deferred_object_destroy_queue_.pop();
482
+ rec.free_(rec.object_);
483
+ }
484
+ }
485
+
486
+ bool ProcessIdle() override
487
+ {
488
+ bool need_more = wxApp::ProcessIdle();
489
+
490
+ wxRubyApp::wxRuby_DoDeferredObjectDestroy();
491
+
492
+ return need_more;
493
+ }
450
494
  };
495
+
496
+ std::queue<wxRubyApp::SDeferredObjectDestroyRecord> wxRubyApp::deferred_object_destroy_queue_ {};
@@ -244,8 +244,7 @@ static VALUE wx_combo_popup_get_combo_ctrl(int argc, VALUE *argv, VALUE self)
244
244
  VALUE rb_cp_proxy = rb_iv_get(self, "@_wx_combo_popup_proxy");
245
245
  if (!NIL_P(rb_cp_proxy))
246
246
  {
247
- wxComboPopup* cpp = nullptr;
248
- Data_Get_Struct(rb_cp_proxy, wxComboPopup, cpp);
247
+ wxComboPopup* cpp = WXRUBY_WRAPPER_DATA_GET(rb_cp_proxy, wxComboPopup);
249
248
  if (cpp)
250
249
  {
251
250
  try {
@@ -277,8 +276,7 @@ static VALUE wx_combo_popup_get_combo_ctrl(int argc, VALUE *argv, VALUE self)
277
276
 
278
277
  static VALUE combo_popup_wx_get_combo_ctrl(int argc, VALUE *argv, VALUE self)
279
278
  {
280
- wxComboPopup *cpp;
281
- Data_Get_Struct(self, wxComboPopup, cpp);
279
+ wxComboPopup *cpp = WXRUBY_WRAPPER_DATA_GET(self, wxComboPopup);
282
280
 
283
281
  if (argc < 0 || argc > 0)
284
282
  {
@@ -309,8 +307,7 @@ static VALUE combo_popup_wx_get_combo_ctrl(int argc, VALUE *argv, VALUE self)
309
307
 
310
308
  static VALUE combo_popup_wx_lazy_create(int argc, VALUE *argv, VALUE self)
311
309
  {
312
- wxComboPopup *cpp;
313
- Data_Get_Struct(self, wxComboPopup, cpp);
310
+ wxComboPopup *cpp = WXRUBY_WRAPPER_DATA_GET(self, wxComboPopup);
314
311
 
315
312
  if (argc < 0 || argc > 0)
316
313
  {
@@ -340,8 +337,7 @@ static VALUE combo_popup_wx_lazy_create(int argc, VALUE *argv, VALUE self)
340
337
 
341
338
  static VALUE combo_popup_wx_create(int argc, VALUE *argv, VALUE self)
342
339
  {
343
- wxComboPopup *cpp;
344
- Data_Get_Struct(self, wxComboPopup, cpp);
340
+ wxComboPopup *cpp = WXRUBY_WRAPPER_DATA_GET(self, wxComboPopup);
345
341
 
346
342
  if (argc < 1 || argc > 1)
347
343
  {
@@ -384,8 +380,7 @@ static VALUE combo_popup_wx_create(int argc, VALUE *argv, VALUE self)
384
380
 
385
381
  static VALUE combo_popup_wx_find_item(int argc, VALUE *argv, VALUE self)
386
382
  {
387
- wxComboPopup *cpp;
388
- Data_Get_Struct(self, wxComboPopup, cpp);
383
+ wxComboPopup *cpp = WXRUBY_WRAPPER_DATA_GET(self, wxComboPopup);
389
384
 
390
385
  if (argc < 1 || argc > 2)
391
386
  {
@@ -419,8 +414,7 @@ static VALUE combo_popup_wx_find_item(int argc, VALUE *argv, VALUE self)
419
414
 
420
415
  static VALUE combo_popup_wx_get_adjusted_size(int argc, VALUE *argv, VALUE self)
421
416
  {
422
- wxComboPopup *cpp;
423
- Data_Get_Struct(self, wxComboPopup, cpp);
417
+ wxComboPopup *cpp = WXRUBY_WRAPPER_DATA_GET(self, wxComboPopup);
424
418
 
425
419
  if (argc < 3 || argc > 3)
426
420
  {
@@ -451,8 +445,7 @@ static VALUE combo_popup_wx_get_adjusted_size(int argc, VALUE *argv, VALUE self)
451
445
 
452
446
  static VALUE combo_popup_wx_get_control(int argc, VALUE *argv, VALUE self)
453
447
  {
454
- wxComboPopup *cpp;
455
- Data_Get_Struct(self, wxComboPopup, cpp);
448
+ wxComboPopup *cpp = WXRUBY_WRAPPER_DATA_GET(self, wxComboPopup);
456
449
 
457
450
  if (argc < 0 || argc > 0)
458
451
  {
@@ -483,8 +476,7 @@ static VALUE combo_popup_wx_get_control(int argc, VALUE *argv, VALUE self)
483
476
 
484
477
  static VALUE combo_popup_wx_set_string_value(int argc, VALUE *argv, VALUE self)
485
478
  {
486
- wxComboPopup *cpp;
487
- Data_Get_Struct(self, wxComboPopup, cpp);
479
+ wxComboPopup *cpp = WXRUBY_WRAPPER_DATA_GET(self, wxComboPopup);
488
480
 
489
481
  if (argc < 1 || argc > 1)
490
482
  {
@@ -516,8 +508,7 @@ static VALUE combo_popup_wx_set_string_value(int argc, VALUE *argv, VALUE self)
516
508
 
517
509
  static VALUE combo_popup_wx_get_string_value(int argc, VALUE *argv, VALUE self)
518
510
  {
519
- wxComboPopup *cpp;
520
- Data_Get_Struct(self, wxComboPopup, cpp);
511
+ wxComboPopup *cpp = WXRUBY_WRAPPER_DATA_GET(self, wxComboPopup);
521
512
 
522
513
  if (argc < 0 || argc > 0)
523
514
  {
@@ -548,8 +539,7 @@ static VALUE combo_popup_wx_get_string_value(int argc, VALUE *argv, VALUE self)
548
539
 
549
540
  static VALUE combo_popup_wx_on_combo_double_click(int argc, VALUE *argv, VALUE self)
550
541
  {
551
- wxComboPopup *cpp;
552
- Data_Get_Struct(self, wxComboPopup, cpp);
542
+ wxComboPopup *cpp = WXRUBY_WRAPPER_DATA_GET(self, wxComboPopup);
553
543
 
554
544
  if (argc < 0 || argc > 0)
555
545
  {
@@ -590,8 +580,7 @@ static VALUE get_key_event_class()
590
580
 
591
581
  static VALUE combo_popup_wx_on_combo_key_event(int argc, VALUE *argv, VALUE self)
592
582
  {
593
- wxComboPopup *cpp;
594
- Data_Get_Struct(self, wxComboPopup, cpp);
583
+ wxComboPopup *cpp = WXRUBY_WRAPPER_DATA_GET(self, wxComboPopup);
595
584
 
596
585
  if (argc < 1 || argc > 1)
597
586
  {
@@ -603,7 +592,7 @@ static VALUE combo_popup_wx_on_combo_key_event(int argc, VALUE *argv, VALUE self
603
592
  rb_raise(rb_eTypeError, "Expected Wx::KeyEvent for 1");
604
593
  }
605
594
 
606
- wxEvent* evt = reinterpret_cast<wxEvent*> (DATA_PTR(argv[0]));
595
+ wxEvent* evt = reinterpret_cast<wxEvent*> (WXRUBY_WRAPPER_DATA_PTR(argv[0]));
607
596
  if (evt == nullptr)
608
597
  {
609
598
  rb_raise(rb_eTypeError, "Invalid null reference for Wx::KeyEvent");
@@ -633,8 +622,7 @@ static VALUE combo_popup_wx_on_combo_key_event(int argc, VALUE *argv, VALUE self
633
622
 
634
623
  static VALUE combo_popup_wx_on_combo_char_event(int argc, VALUE *argv, VALUE self)
635
624
  {
636
- wxComboPopup *cpp;
637
- Data_Get_Struct(self, wxComboPopup, cpp);
625
+ wxComboPopup *cpp = WXRUBY_WRAPPER_DATA_GET(self, wxComboPopup);
638
626
 
639
627
  if (argc < 1 || argc > 1)
640
628
  {
@@ -646,7 +634,7 @@ static VALUE combo_popup_wx_on_combo_char_event(int argc, VALUE *argv, VALUE sel
646
634
  rb_raise(rb_eTypeError, "Expected Wx::KeyEvent for 1");
647
635
  }
648
636
 
649
- wxEvent* evt = reinterpret_cast<wxEvent*> (DATA_PTR(argv[0]));
637
+ wxEvent* evt = reinterpret_cast<wxEvent*> (WXRUBY_WRAPPER_DATA_PTR(argv[0]));
650
638
  if (evt == nullptr)
651
639
  {
652
640
  rb_raise(rb_eTypeError, "Invalid null reference for Wx::KeyEvent");
@@ -676,8 +664,7 @@ static VALUE combo_popup_wx_on_combo_char_event(int argc, VALUE *argv, VALUE sel
676
664
 
677
665
  static VALUE combo_popup_wx_on_dismiss(int argc, VALUE *argv, VALUE self)
678
666
  {
679
- wxComboPopup *cpp;
680
- Data_Get_Struct(self, wxComboPopup, cpp);
667
+ wxComboPopup *cpp = WXRUBY_WRAPPER_DATA_GET(self, wxComboPopup);
681
668
 
682
669
  if (argc < 0 || argc > 0)
683
670
  {
@@ -708,8 +695,7 @@ static VALUE combo_popup_wx_on_dismiss(int argc, VALUE *argv, VALUE self)
708
695
 
709
696
  static VALUE combo_popup_wx_on_popup(int argc, VALUE *argv, VALUE self)
710
697
  {
711
- wxComboPopup *cpp;
712
- Data_Get_Struct(self, wxComboPopup, cpp);
698
+ wxComboPopup *cpp = WXRUBY_WRAPPER_DATA_GET(self, wxComboPopup);
713
699
 
714
700
  if (argc < 0 || argc > 0)
715
701
  {
@@ -740,8 +726,7 @@ static VALUE combo_popup_wx_on_popup(int argc, VALUE *argv, VALUE self)
740
726
 
741
727
  static VALUE combo_popup_wx_paint_combo_control(int argc, VALUE *argv, VALUE self)
742
728
  {
743
- wxComboPopup *cpp;
744
- Data_Get_Struct(self, wxComboPopup, cpp);
729
+ wxComboPopup *cpp = WXRUBY_WRAPPER_DATA_GET(self, wxComboPopup);
745
730
 
746
731
  if (argc < 2 || argc > 2)
747
732
  {
@@ -35,8 +35,7 @@ struct RbCfgCounter
35
35
 
36
36
  static int wxrb_CountConfig(VALUE key, VALUE value, VALUE rbCounter)
37
37
  {
38
- RbCfgCounter* counter;
39
- Data_Get_Struct(rbCounter, RbCfgCounter, counter);
38
+ RbCfgCounter* counter = WXRUBY_WRAPPER_DATA_GET(rbCounter, RbCfgCounter);
40
39
  if (TYPE(value) == T_HASH)
41
40
  {
42
41
  if (counter->groups)
@@ -91,7 +90,7 @@ public:
91
90
  {
92
91
  if (!NIL_P(m_cfgInstance))
93
92
  {
94
- DATA_PTR(m_cfgInstance) = 0; // make sure it never get's deleted twice
93
+ WXRUBY_WRAPPER_DATA_PTR_RESET(m_cfgInstance); // make sure it never get's deleted twice
95
94
  }
96
95
  }
97
96
 
@@ -171,7 +170,15 @@ public:
171
170
  {
172
171
  RbCfgCounter counter = {false, bRecursive, 0};
173
172
  void* ptr = &counter;
174
- VALUE rbCounter = Data_Wrap_Struct(rb_cObject, 0, 0, ptr);
173
+ VALUE rbCounter;
174
+ // wrap anonymously as we only want to pass a temp arg
175
+ #ifdef WXRUBY_SWIG_UNTYPED_DATA
176
+ rbCounter = Data_Wrap_Struct(rb_cObject, 0, 0, ptr);
177
+ #else
178
+ struct swig_ruby_wrapped_object *wrobj;
179
+ rbCounter = TypedData_Make_Struct(rb_cObject, struct swig_ruby_wrapped_object, &swig_type_data_type, wrobj);
180
+ wrobj->data = ptr;
181
+ #endif
175
182
  rb_hash_foreach(m_cfgGroup, FOREACH_FUNC(wxrb_CountConfig), rbCounter);
176
183
  return counter.count;
177
184
  }
@@ -180,7 +187,15 @@ public:
180
187
  {
181
188
  RbCfgCounter counter = {true, bRecursive, 0};
182
189
  void* ptr = &counter;
183
- VALUE rbCounter = Data_Wrap_Struct(rb_cObject, 0, 0, ptr);
190
+ VALUE rbCounter;
191
+ // wrap anonymously as we only want to pass a temp arg
192
+ #ifdef WXRUBY_SWIG_UNTYPED_DATA
193
+ rbCounter = Data_Wrap_Struct(rb_cObject, 0, 0, ptr);
194
+ #else
195
+ struct swig_ruby_wrapped_object *wrobj;
196
+ rbCounter = TypedData_Make_Struct(rb_cObject, struct swig_ruby_wrapped_object, &swig_type_data_type, wrobj);
197
+ wrobj->data = ptr;
198
+ #endif
184
199
  rb_hash_foreach(m_cfgGroup, FOREACH_FUNC(wxrb_CountConfig), rbCounter);
185
200
  return counter.count;
186
201
  }
@@ -930,21 +945,19 @@ WXRUBY_EXPORT wxConfigBase* wxRuby_Ruby2ConfigBase(VALUE rbConfig)
930
945
  if (rb_obj_is_kind_of(rbConfig, g_cConfig) == Qtrue)
931
946
  {
932
947
  // check if this Ruby config instance already has a associated wrapper
933
- wxRbHashConfig* config;
934
- Data_Get_Struct(rbConfig, wxRbHashConfig, config);
948
+ wxRbHashConfig* config = WXRUBY_WRAPPER_DATA_GET(rbConfig, wxRbHashConfig);
935
949
  if (config == nullptr)
936
950
  {
937
951
  // if not, create one
938
952
  config = new wxRbHashConfig(rbConfig, rb_iv_get(rbConfig, __iv_Config_data));
939
- DATA_PTR(rbConfig) = config;
953
+ WXRUBY_WRAPPER_DATA_PTR_SET(rbConfig, config);
940
954
  }
941
955
  // return wrapper
942
956
  return config;
943
957
  }
944
958
  else if (rb_obj_is_kind_of(rbConfig, g_cConfigWx) == Qtrue)
945
959
  {
946
- wxConfigBase* cfg;
947
- Data_Get_Struct(rbConfig, wxConfigBase, cfg);
960
+ wxConfigBase* cfg = WXRUBY_WRAPPER_DATA_GET(rbConfig, wxConfigBase);
948
961
  return cfg;
949
962
  }
950
963
  return nullptr;
@@ -962,7 +975,17 @@ WXRUBY_EXPORT VALUE wxRuby_ConfigBase2Ruby(wxConfigBase* config)
962
975
  }
963
976
  else
964
977
  {
965
- return Data_Wrap_Struct(g_cConfigWx, 0, 0, config);
978
+ VALUE rb_config;
979
+ // wrap the C++ config object
980
+ #ifdef WXRUBY_SWIG_UNTYPED_DATA
981
+ rb_config = Data_Wrap_Struct(g_cConfigWx, 0, 0, config);
982
+ #else
983
+ struct swig_ruby_wrapped_object *wrobj;
984
+ rb_config = TypedData_Make_Struct(g_cConfigWx, struct swig_ruby_wrapped_object, &wxruby_config_wx_data_type, wrobj);
985
+ wrobj->data = config;
986
+ #endif
987
+ rb_iv_set(rb_config, "@__swigtype__", rb_str_new2("ConfigWx"));
988
+ return rb_config;
966
989
  }
967
990
  }
968
991
  return Qnil;
@@ -10,7 +10,7 @@
10
10
  typedef std::unordered_map<void*, VALUE> TGCTrackingValueMap;
11
11
  typedef void (* TGCMarkerFunction)(const TGCTrackingValueMap&);
12
12
 
13
- typedef struct
13
+ struct TGCTrackingItem
14
14
  {
15
15
  TGCMarkerFunction marker_ {};
16
16
  TGCTrackingValueMap values_ {};
@@ -18,7 +18,7 @@ typedef struct
18
18
  // can become true if actual values are added/removed in which case
19
19
  // the marker will only be called if there any values tracked
20
20
  bool has_data_ {true};
21
- } TGCTrackingItem;
21
+ };
22
22
 
23
23
  typedef std::unordered_map<std::string, TGCTrackingItem> TGCTrackingTable;
24
24
 
@@ -114,7 +114,7 @@ static void __wxruby_mark_SWIG_objects(const TGCTrackingValueMap& values)
114
114
  {
115
115
  // Check if it's a valid object (sometimes SWIG doesn't return what we're
116
116
  // expecting), a descendant of Wx::Window or Wx::Event; if so, mark it.
117
- if ( TYPE(vp.second) == T_DATA )
117
+ if ( WXRUBY_HAS_WRAPPED_DATA(vp.second))
118
118
  {
119
119
  if ( rb_obj_is_kind_of(vp.second, wxRuby_GetWindowClass()) )
120
120
  {
@@ -154,7 +154,7 @@ WXRUBY_EXPORT void wxRuby_AddTracking(void* ptr, VALUE object)
154
154
  // these objects but instead cause more informative exceptions.
155
155
  if (old_obj != object)
156
156
  {
157
- DATA_PTR(old_obj) = 0;
157
+ WXRUBY_WRAPPER_DATA_PTR_RESET(old_obj);
158
158
  }
159
159
 
160
160
  }
@@ -186,7 +186,16 @@ WXRUBY_EXPORT void wxRuby_UnlinkObject(void* ptr)
186
186
  VALUE object = __g_GCTracking.swig_find_tracking(ptr);
187
187
  if (object != Qnil)
188
188
  {
189
+ #if SWIG_VERSION < 0x040500 // Ruby Untyped Data Wrapping
189
190
  DATA_PTR(object) = 0;
191
+ #else // Ruby Typed Data Wrapping
192
+ // object might have the T_ZOMBIE type, but that's just
193
+ // because the GC has flagged it as such for a deferred
194
+ // destruction. Until then, it's still a T_DATA object.
195
+ struct swig_ruby_wrapped_object *wrobj = (struct swig_ruby_wrapped_object *)RTYPEDDATA_GET_DATA(object);
196
+ if (wrobj)
197
+ wrobj->data = 0;
198
+ #endif
190
199
  }
191
200
  }
192
201
 
@@ -230,7 +239,7 @@ WXRUBY_EXPORT void wxRuby_RegisterCategoryValue(const std::string &category, voi
230
239
 
231
240
  if (old_obj != object)
232
241
  {
233
- DATA_PTR(old_obj) = 0;
242
+ WXRUBY_WRAPPER_DATA_PTR_RESET(old_obj);
234
243
  }
235
244
 
236
245
  }
@@ -257,6 +266,15 @@ WXRUBY_EXPORT void wxRuby_UnlinkCategoryValue(const std::string &category, void*
257
266
  VALUE object = __g_GCTracking.find_tracking(category, ptr);
258
267
  if (object != Qnil)
259
268
  {
269
+ #if SWIG_VERSION < 0x040500 // Ruby Untyped Data Wrapping
260
270
  DATA_PTR(object) = 0;
271
+ #else // Ruby Typed Data Wrapping
272
+ // object might have the T_ZOMBIE type, but that's just
273
+ // because the GC has flagged it as such for a deferred
274
+ // destruction. Until then, it's still a T_DATA object.
275
+ struct swig_ruby_wrapped_object *wrobj = (struct swig_ruby_wrapped_object *)RTYPEDDATA_GET_DATA(object);
276
+ if (wrobj)
277
+ wrobj->data = 0;
278
+ #endif
261
279
  }
262
280
  }
@@ -55,10 +55,10 @@ static void __WxRubySharedEvtHandler_free(void* data)
55
55
 
56
56
  static const rb_data_type_t __WxRubySharedEvtHandler_type = {
57
57
  "TreeItemId",
58
- #if RUBY_API_VERSION_MAJOR >= 3
59
- { NULL, __WxRubySharedEvtHandler_free, __WxRubySharedEvtHandler_size, 0, {}},
58
+ #if RUBY_API_VERSION_MAJOR > 4 || (RUBY_API_VERSION_MAJOR == 4 && RUBY_API_VERSION_MINOR >= 1)
59
+ { NULL, __WxRubySharedEvtHandler_free, __WxRubySharedEvtHandler_size, 0, 0, {}},
60
60
  #else
61
- { NULL, __WxRubySharedEvtHandler_free, __WxRubySharedEvtHandler_size, {}},
61
+ { NULL, __WxRubySharedEvtHandler_free, __WxRubySharedEvtHandler_size, 0, {}},
62
62
  #endif
63
63
  NULL, NULL, RUBY_TYPED_FROZEN_SHAREABLE
64
64
  };
@@ -132,9 +132,9 @@ static VALUE WxRubySharedEvtHandler_queue_event(int argc, VALUE* argv, VALUE sel
132
132
  if (wxeh)
133
133
  {
134
134
  // get C++ event
135
- wxEvent* wxevt = (wxEvent*)DATA_PTR(argv[0]);
136
- RDATA(argv[0])->dfree = 0; // disown
137
- DATA_PTR(argv[0]) = nullptr; // unlink
135
+ wxEvent* wxevt = (wxEvent*)WXRUBY_WRAPPER_DATA_PTR(argv[0]);
136
+ WXRUBY_WRAPPER_DATA_DFREE_RESET(argv[0]); // disown
137
+ WXRUBY_WRAPPER_DATA_PTR_RESET(argv[0]); // unlink
138
138
  // no need to remove tracking as all Ractor safe events are untracked
139
139
  // queue event
140
140
  wxeh->QueueEvent(wxevt);
@@ -151,7 +151,7 @@ static VALUE wxRuby_EvtHandler_make_shared(VALUE self)
151
151
  {
152
152
  void *ptr;
153
153
  wxEvtHandler *wxeh = nullptr;
154
- ptr = DATA_PTR(self);
154
+ ptr = WXRUBY_WRAPPER_DATA_PTR(self);
155
155
  wxeh = reinterpret_cast< wxEvtHandler * >(ptr);
156
156
  if (wxeh)
157
157
  {
@@ -128,6 +128,7 @@ WXRUBY_EXPORT VALUE wxRuby_Funcall(bool& ex_caught, VALUE rcvr, ID func, VALUE a
128
128
  WXRUBY_EXPORT bool wxRuby_IsAppRunning();
129
129
  WXRUBY_EXPORT void wxRuby_ExitMainLoop(VALUE exception = Qnil);
130
130
  WXRUBY_EXPORT void wxRuby_PrintException(VALUE err);
131
+ WXRUBY_EXPORT void wxRuby_RegisterDeferredObjectDestroy(void*, void(*)(void*));
131
132
  typedef void (*WXRBMarkFunction)();
132
133
  WXRUBY_EXPORT void wxRuby_AppendMarker(WXRBMarkFunction marker);
133
134
 
@@ -188,6 +189,7 @@ WXRUBY_EXPORT void wxRuby_ReleaseEvtHandlerProcs(void* evt_handler);
188
189
  WXRUBY_EXPORT bool wxRuby_IsNativeMethod(VALUE object, ID method_id);
189
190
 
190
191
  WXRUBY_EXPORT VALUE wxRuby_GetWindowClass();
192
+ WXRUBY_EXPORT VALUE wxRuby_GetFrameClass();
191
193
  WXRUBY_EXPORT VALUE wxRuby_GetDialogClass();
192
194
 
193
195
  // Enum helpers
@@ -221,3 +223,66 @@ WXRUBY_EXPORT VALUE& operator << (VALUE &value, const wxVariant &variant);
221
223
  WXRUBY_EXPORT wxVariant& operator << (wxVariant &variant, const VALUE &value);
222
224
  WXRUBY_EXPORT wxVariant wxRuby_ConvertRbValue2Variant(VALUE rbval);
223
225
  #endif
226
+
227
+ #if SWIG_VERSION < 0x040500 // Ruby Untyped Data Wrapping
228
+ # define WXRUBY_SWIG_UNTYPED_DATA
229
+ #else
230
+ # define WXRUBY_SWIG_TYPED_DATA
231
+ #endif
232
+
233
+ #ifdef WXRUBY_SWIG_UNTYPED_DATA // Ruby Untyped Data Wrapping
234
+
235
+ #define WXRUBY_WRAPPER_DATA(rbobj) \
236
+ RDATA(rbobj)
237
+
238
+ #define WXRUBY_WRAPPER_DATA_PTR(rbobj) \
239
+ DATA_PTR(rbobj)
240
+
241
+ #define WXRUBY_WRAPPER_DATA_PTR_SET(rbobj, ptr) \
242
+ DATA_PTR(rbobj) = (ptr)
243
+
244
+ #define WXRUBY_WRAPPER_DATA_PTR_RESET(rbobj) \
245
+ DATA_PTR(rbobj) = 0
246
+
247
+ #define WXRUBY_HAS_WRAPPED_DATA(rbobj) \
248
+ (!RB_NIL_P(rbobj) && TYPE(rbobj) == T_DATA)
249
+
250
+ #else // Ruby Typed Data Wrapping
251
+
252
+ #define WXRUBY_WRAPPER_DATA(rbobj) \
253
+ ((struct swig_ruby_wrapped_object *)RTYPEDDATA_GET_DATA(rbobj))
254
+
255
+ #define WXRUBY_WRAPPER_DATA_PTR(rbobj) \
256
+ WXRUBY_WRAPPER_DATA(rbobj)->data
257
+
258
+ #define WXRUBY_WRAPPER_DATA_PTR_SET(rbobj, ptr) \
259
+ WXRUBY_WRAPPER_DATA(rbobj)->data = (ptr)
260
+
261
+ #define WXRUBY_WRAPPER_DATA_PTR_RESET(rbobj) \
262
+ WXRUBY_WRAPPER_DATA(rbobj)->data = 0
263
+
264
+ #define WXRUBY_HAS_WRAPPED_DATA(rbobj) \
265
+ (!RB_NIL_P(rbobj) && RB_TYPE_P(rbobj, RUBY_T_DATA) && RTYPEDDATA_P(rbobj))
266
+
267
+ #endif
268
+
269
+ #define WXRUBY_WRAPPER_DATA_GET(rbobj, type) \
270
+ reinterpret_cast< type * >(WXRUBY_WRAPPER_DATA_PTR(rbobj))
271
+
272
+ #define WXRUBY_WRAPPER_DATA_DFREE(rbobj) \
273
+ WXRUBY_WRAPPER_DATA(rbobj)->dfree
274
+
275
+ #define WXRUBY_WRAPPER_DATA_DFREE_SET(rbobj, ptr) \
276
+ WXRUBY_WRAPPER_DATA(rbobj)->dfree = (ptr)
277
+
278
+ #define WXRUBY_WRAPPER_DATA_DFREE_RESET(rbobj) \
279
+ WXRUBY_WRAPPER_DATA(rbobj)->dfree = 0
280
+
281
+ #define WXRUBY_WRAPPER_DATA_DMARK(rbobj) \
282
+ WXRUBY_WRAPPER_DATA(rbobj)->dmark
283
+
284
+ #define WXRUBY_WRAPPER_DATA_DMARK_SET(rbobj, ptr) \
285
+ WXRUBY_WRAPPER_DATA(rbobj)->dmark = (ptr)
286
+
287
+ #define WXRUBY_WRAPPER_DATA_DMARK_RESET(rbobj) \
288
+ WXRUBY_WRAPPER_DATA(rbobj)->dmark = 0
@@ -13,6 +13,12 @@
13
13
  %feature("compactdefaultargs");
14
14
  %feature("flatnested");
15
15
 
16
+ #if SWIG_VERSION < 0x040500 // Ruby Untyped Data Wrapping
17
+ # define WXRUBY_SWIG_UNTYPED_DATA
18
+ #else
19
+ # define WXRUBY_SWIG_TYPED_DATA
20
+ #endif
21
+
16
22
  %exception {
17
23
  try {
18
24
  $action