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
@@ -0,0 +1,243 @@
1
+ /* -----------------------------------------------------------------------------
2
+ * rubyrun.swg
3
+ *
4
+ * This file contains the runtime support for Ruby modules
5
+ * and includes code for managing global variables and pointer
6
+ * type checking.
7
+ *
8
+ * Customized for wxRuby3.
9
+ * Copyright (c) 2023 M.J.N. Corino, The Netherlands
10
+ *
11
+ * This software is released under the MIT license.
12
+ * ----------------------------------------------------------------------------- */
13
+
14
+ /* For backward compatibility only */
15
+ #define SWIG_POINTER_EXCEPTION 0
16
+
17
+ /* for raw pointers */
18
+ #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
19
+ #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, own)
20
+ #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Ruby_NewPointerObj(ptr, type, flags)
21
+ #define SWIG_AcquirePtr(ptr, own) SWIG_Ruby_AcquirePtr(ptr, own)
22
+ #define swig_owntype swig_ruby_owntype
23
+
24
+ /* for raw packed data */
25
+ #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)
26
+ #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
27
+
28
+ /* for class or struct pointers */
29
+ #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
30
+ #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
31
+
32
+ /* for C or C++ function pointers */
33
+ #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0)
34
+ #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0)
35
+
36
+ /* for C++ member pointers, ie, member methods */
37
+ #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty)
38
+ #define SWIG_NewMemberObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
39
+
40
+
41
+ /* Runtime API */
42
+
43
+ #define SWIG_GetModule(clientdata) SWIG_Ruby_GetModule(clientdata)
44
+ #define SWIG_SetModule(clientdata, pointer) SWIG_Ruby_SetModule(pointer)
45
+
46
+
47
+ /* Error manipulation */
48
+
49
+ #define SWIG_ErrorType(code) SWIG_Ruby_ErrorType(code)
50
+ #define SWIG_Error(code, msg) rb_raise(SWIG_Ruby_ErrorType(code), "%s", msg)
51
+ #define SWIG_fail goto fail
52
+
53
+
54
+ /* Ruby-specific SWIG API */
55
+
56
+ #define SWIG_InitRuntime() SWIG_Ruby_InitRuntime()
57
+ #define SWIG_define_class(ty) SWIG_Ruby_define_class(ty)
58
+ #define SWIG_NewClassInstance(value, ty) SWIG_Ruby_NewClassInstance(value, ty)
59
+ #define SWIG_MangleStr(value) SWIG_Ruby_MangleStr(value)
60
+ #define SWIG_CheckConvert(value, ty) SWIG_Ruby_CheckConvert(value, ty)
61
+
62
+ #include "assert.h"
63
+
64
+ /* -----------------------------------------------------------------------------
65
+ * pointers/data manipulation
66
+ * ----------------------------------------------------------------------------- */
67
+
68
+ #ifdef __cplusplus
69
+ extern "C" {
70
+ #endif
71
+
72
+ typedef struct WXRUBY_EXPORT swig_class {
73
+ VALUE klass;
74
+ VALUE mImpl;
75
+ void (*mark)(void *);
76
+ void (*destroy)(void *);
77
+ rb_data_type_t cext_type;
78
+ int trackObjects;
79
+ } swig_class;
80
+
81
+
82
+ /* Global IDs used to keep some internal SWIG stuff */
83
+ extern ID swig_lowerthan_id;
84
+
85
+ extern const WXRUBY_EXPORT rb_data_type_t swig_type_data_type;
86
+
87
+ /*
88
+ If your swig extension is to be run within an embedded ruby and has
89
+ director callbacks, you should set -DRUBY_EMBEDDED during compilation.
90
+ This will reset ruby's stack frame on each entry point from the main
91
+ program the first time a virtual director function is invoked (in a
92
+ non-recursive way).
93
+ If this is not done, you run the risk of Ruby trashing the stack.
94
+ */
95
+
96
+ #ifdef RUBY_EMBEDDED
97
+
98
+ # define SWIG_INIT_STACK \
99
+ if ( !swig_virtual_calls ) { RUBY_INIT_STACK } \
100
+ ++swig_virtual_calls;
101
+ # define SWIG_RELEASE_STACK --swig_virtual_calls;
102
+ # define Ruby_DirectorTypeMismatchException(x) \
103
+ rb_raise( rb_eTypeError, "%s", x ); return c_result;
104
+
105
+ static unsigned int swig_virtual_calls = 0;
106
+
107
+ #else /* normal non-embedded extension */
108
+
109
+ # define SWIG_INIT_STACK
110
+ # define SWIG_RELEASE_STACK
111
+ # define Ruby_DirectorTypeMismatchException(x) \
112
+ throw Swig::DirectorTypeMismatchException( x );
113
+
114
+ #endif /* RUBY_EMBEDDED */
115
+
116
+ /* This code checks to see if the Ruby object being raised as part
117
+ of an exception inherits from the Ruby class Exception. If so,
118
+ the object is simply returned. If not, then a new Ruby exception
119
+ object is created and that will be returned to Ruby.*/
120
+ WXRUBY_EXPORT VALUE
121
+ SWIG_Ruby_ExceptionType(swig_type_info *desc, VALUE obj);
122
+
123
+ /* Initialize Ruby runtime support */
124
+ WXRUBY_EXPORT void
125
+ SWIG_Ruby_InitRuntime(void);
126
+
127
+ /* Define Ruby class for C type */
128
+ WXRUBY_EXPORT void
129
+ SWIG_Ruby_define_class(swig_type_info *type);
130
+
131
+ /* ---------------------------------------------------------------------------
132
+ * SWIG_Ruby_mark_swig_type()
133
+ *
134
+ * Generic mark callback for the TypedData wrapper. It forwards to the per-object
135
+ * mark function recorded in the wrapper, if one was set.
136
+ * --------------------------------------------------------------------------- */
137
+ static void SWIG_Ruby_mark_swig_type(void *data) {
138
+ struct swig_ruby_wrapped_object *wrobj = (struct swig_ruby_wrapped_object *)data;
139
+ if (!wrobj)
140
+ return;
141
+ if (wrobj->dmark)
142
+ wrobj->dmark(wrobj->data);
143
+ }
144
+
145
+ /* ---------------------------------------------------------------------------
146
+ * SWIG_Ruby_free_swig_type()
147
+ *
148
+ * Generic free callback for the TypedData wrapper. It forwards to the per-object
149
+ * free function recorded in the wrapper, if one was set, then frees the wrapper.
150
+ * --------------------------------------------------------------------------- */
151
+ static void SWIG_Ruby_free_swig_type(void *data) {
152
+ struct swig_ruby_wrapped_object *wrobj = (struct swig_ruby_wrapped_object *)data;
153
+ if (!wrobj)
154
+ return;
155
+ if (wrobj->dfree)
156
+ wrobj->dfree(wrobj->data);
157
+ #ifndef TYPED_DATA_EMBEDDED
158
+ ruby_xfree(wrobj);
159
+ #endif
160
+ }
161
+
162
+ /* ---------------------------------------------------------------------------
163
+ * WxRuby_Ruby_free_swig_window_type()
164
+ *
165
+ * wxWindow specific free callback for the TypedData wrapper. It defers the
166
+ * destruction if a window is still linked and owned, then frees the wrapper.
167
+ * --------------------------------------------------------------------------- */
168
+ WXRUBY_EXPORT void wxRuby_RegisterDeferredObjectDestroy(void*, void(*)(void*));
169
+
170
+ static void WxRuby_Ruby_free_swig_window_type(void *data) {
171
+ struct swig_ruby_wrapped_object *wrobj = (struct swig_ruby_wrapped_object *)data;
172
+ if (!wrobj)
173
+ return;
174
+ if (wrobj->data && wrobj->dfree)
175
+ wxRuby_RegisterDeferredObjectDestroy(wrobj->data, wrobj->dfree);
176
+ #ifndef TYPED_DATA_EMBEDDED
177
+ ruby_xfree(wrobj);
178
+ #endif
179
+ }
180
+
181
+ /* Create a new pointer object */
182
+ WXRUBY_EXPORT VALUE
183
+ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags);
184
+
185
+ /* Create a new class instance (always owned) */
186
+ WXRUBY_EXPORT VALUE
187
+ SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type);
188
+
189
+ /* Get type mangle from class name */
190
+ WXRUBY_EXPORT char *
191
+ SWIG_Ruby_MangleStr(VALUE obj);
192
+
193
+ /* Acquire a pointer value */
194
+ typedef struct {
195
+ void (*datafree)(void *);
196
+ int own;
197
+ } swig_ruby_owntype;
198
+
199
+ WXRUBY_EXPORT swig_ruby_owntype
200
+ SWIG_Ruby_AcquirePtr(VALUE obj, swig_ruby_owntype own);
201
+
202
+ /* Convert a pointer value */
203
+ WXRUBY_EXPORT int
204
+ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, swig_ruby_owntype *own);
205
+
206
+ /* Check convert */
207
+ WXRUBY_EXPORT int
208
+ SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty);
209
+
210
+ WXRUBY_EXPORT VALUE
211
+ SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type);
212
+
213
+ /* Convert a packed pointer value */
214
+ WXRUBY_EXPORT int
215
+ SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty);
216
+
217
+ WXRUBY_EXPORT swig_module_info *
218
+ SWIG_Ruby_GetModule(void *SWIGUNUSEDPARM(clientdata));
219
+
220
+ WXRUBY_EXPORT void
221
+ SWIG_Ruby_SetModule(swig_module_info *pointer);
222
+
223
+ /* This function can be used to check whether a proc or method or similarly
224
+ callable function has been passed. Usually used in a %typecheck, like:
225
+
226
+ %typecheck(c_callback_t, precedence=SWIG_TYPECHECK_POINTER) {
227
+ $result = SWIG_Ruby_isCallable( $input );
228
+ }
229
+ */
230
+ WXRUBY_EXPORT
231
+ int SWIG_Ruby_isCallable( VALUE proc );
232
+
233
+ /* This function can be used to check the arity (number of arguments)
234
+ a proc or method can take. Usually used in a %typecheck.
235
+ Valid arities will be that equal to minimal or those < 0
236
+ which indicate a variable number of parameters at the end.
237
+ */
238
+ WXRUBY_EXPORT
239
+ int SWIG_Ruby_arity( VALUE proc, int minimal );
240
+
241
+ #ifdef __cplusplus
242
+ }
243
+ #endif