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,689 @@
1
+ /* -----------------------------------------------------------------------------
2
+ * swigrun.swg
3
+ *
4
+ * This file contains generic C API SWIG runtime support for pointer
5
+ * type checking.
6
+ *
7
+ * Customized for wxRuby3.
8
+ * Copyright (c) 2023 M.J.N. Corino, The Netherlands
9
+ *
10
+ * This software is released under the MIT license.
11
+ * ----------------------------------------------------------------------------- */
12
+
13
+ /* This should only be incremented when either the layout of swig_type_info changes,
14
+ or for whatever reason, the runtime changes incompatibly */
15
+ #define SWIG_RUNTIME_VERSION "5"
16
+
17
+ /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
18
+ #ifdef SWIG_TYPE_TABLE
19
+ # define SWIG_TYPE_TABLE_NAME SWIG_STRINGIFY(SWIG_TYPE_TABLE)
20
+ #else
21
+ # define SWIG_TYPE_TABLE_NAME
22
+ #endif
23
+
24
+ /*
25
+ You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
26
+ creating a static or dynamic library from the SWIG runtime code.
27
+ In 99.9% of the cases, SWIG just needs to declare them as 'static'.
28
+
29
+ But only do this if strictly necessary, ie, if you have problems
30
+ with your compiler or suchlike.
31
+ */
32
+
33
+ #ifndef SWIGRUNTIME
34
+ # define SWIGRUNTIME SWIGINTERN
35
+ #endif
36
+
37
+ #ifndef SWIGRUNTIMEINLINE
38
+ # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
39
+ #endif
40
+
41
+ /* Generic buffer size */
42
+ #ifndef SWIG_BUFFER_SIZE
43
+ # define SWIG_BUFFER_SIZE 1024
44
+ #endif
45
+
46
+ /* Flags for pointer conversions */
47
+ #define SWIG_POINTER_DISOWN 0x1
48
+ #define SWIG_CAST_NEW_MEMORY 0x2
49
+ #define SWIG_POINTER_NO_NULL 0x4
50
+ #define SWIG_POINTER_CLEAR 0x8
51
+ #define SWIG_POINTER_RELEASE (SWIG_POINTER_CLEAR | SWIG_POINTER_DISOWN)
52
+
53
+ /* Flags for new pointer objects */
54
+ #define SWIG_POINTER_OWN 0x1
55
+
56
+
57
+ /*
58
+ Flags/methods for returning states.
59
+
60
+ The SWIG conversion methods, as ConvertPtr, return an integer
61
+ that tells if the conversion was successful or not. And if not,
62
+ an error code can be returned (see swigerrors.swg for the codes).
63
+
64
+ Use the following macros/flags to set or process the returning
65
+ states.
66
+
67
+ In old versions of SWIG, code such as the following was usually written:
68
+
69
+ if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
70
+ // success code
71
+ } else {
72
+ //fail code
73
+ }
74
+
75
+ Now you can be more explicit:
76
+
77
+ int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
78
+ if (SWIG_IsOK(res)) {
79
+ // success code
80
+ } else {
81
+ // fail code
82
+ }
83
+
84
+ which is the same really, but now you can also do
85
+
86
+ Type *ptr;
87
+ int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
88
+ if (SWIG_IsOK(res)) {
89
+ // success code
90
+ if (SWIG_IsNewObj(res) {
91
+ ...
92
+ delete *ptr;
93
+ } else {
94
+ ...
95
+ }
96
+ } else {
97
+ // fail code
98
+ }
99
+
100
+ I.e., now SWIG_ConvertPtr can return new objects and you can
101
+ identify the case and take care of the deallocation. Of course that
102
+ also requires SWIG_ConvertPtr to return new result values, such as
103
+
104
+ int SWIG_ConvertPtr(obj, ptr,...) {
105
+ if (<obj is ok>) {
106
+ if (<need new object>) {
107
+ *ptr = <ptr to new allocated object>;
108
+ return SWIG_NEWOBJ;
109
+ } else {
110
+ *ptr = <ptr to old object>;
111
+ return SWIG_OLDOBJ;
112
+ }
113
+ } else {
114
+ return SWIG_BADOBJ;
115
+ }
116
+ }
117
+
118
+ Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
119
+ more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
120
+ SWIG errors code.
121
+
122
+ Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
123
+ allows returning the 'cast rank', for example, if you have this
124
+
125
+ int food(double)
126
+ int fooi(int);
127
+
128
+ and you call
129
+
130
+ food(1) // cast rank '1' (1 -> 1.0)
131
+ fooi(1) // cast rank '0'
132
+
133
+ just use the SWIG_AddCast()/SWIG_CheckState()
134
+ */
135
+
136
+ #define SWIG_OK (0)
137
+ /* Runtime errors are < 0 */
138
+ #define SWIG_ERROR (-1)
139
+ /* Errors in range -1 to -99 are in swigerrors.swg (errors for all languages including those not using the runtime) */
140
+ /* Errors in range -100 to -199 are language specific errors defined in *errors.swg */
141
+ /* Errors < -200 are generic runtime specific errors */
142
+ #define SWIG_ERROR_RELEASE_NOT_OWNED (-200)
143
+
144
+ #define SWIG_IsOK(r) (r >= 0)
145
+ #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
146
+
147
+ /* The CastRankLimit says how many bits are used for the cast rank */
148
+ #define SWIG_CASTRANKLIMIT (1 << 8)
149
+ /* The NewMask denotes the object was created (using new/malloc) */
150
+ #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
151
+ /* The TmpMask is for in/out typemaps that use temporary objects */
152
+ #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
153
+ /* The binary string mask denotes using string without unicode */
154
+ #define SWIG_BINARYSTRMASK (SWIG_TMPOBJMASK << 1)
155
+ /* Simple returning values */
156
+ #define SWIG_BADOBJ (SWIG_ERROR)
157
+ #define SWIG_OLDOBJ (SWIG_OK)
158
+ #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
159
+ #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
160
+ #define SWIG_BINARYSTR (SWIG_OK | SWIG_BINARYSTRMASK)
161
+ /* Check, add and del object mask methods */
162
+ #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
163
+ #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
164
+ #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
165
+ #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
166
+ #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
167
+ #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
168
+ #define SWIG_AddBinaryStrMask(r) (SWIG_IsOK(r) ? (r | SWIG_BINARYSTRMASK) : r)
169
+ #define SWIG_DelBinaryStrMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_BINARYSTRMASK) : r)
170
+ #define SWIG_IsBinaryStr(r) (SWIG_IsOK(r) && (r & SWIG_BINARYSTRMASK))
171
+
172
+ /* Cast-Rank Mode */
173
+ #if defined(SWIG_CASTRANK_MODE)
174
+ # ifndef SWIG_TypeRank
175
+ # define SWIG_TypeRank unsigned long
176
+ # endif
177
+ # ifndef SWIG_MAXCASTRANK /* Default cast allowed */
178
+ # define SWIG_MAXCASTRANK (2)
179
+ # endif
180
+ # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
181
+ # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
182
+ SWIGINTERNINLINE int SWIG_AddCast(int r) {
183
+ return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
184
+ }
185
+ SWIGINTERNINLINE int SWIG_CheckState(int r) {
186
+ return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
187
+ }
188
+ #else /* no cast-rank mode */
189
+ # define SWIG_AddCast(r) (r)
190
+ # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
191
+ #endif
192
+
193
+
194
+ #include <string.h>
195
+
196
+ #ifdef __cplusplus
197
+ extern "C" {
198
+ #endif
199
+
200
+ typedef void *(*swig_converter_func)(void *, int *);
201
+ typedef struct swig_type_info *(*swig_dycast_func)(void **);
202
+
203
+ /* Structure to store information on one type */
204
+ typedef struct WXRUBY_EXPORT swig_type_info
205
+ {
206
+ const char *name; /* mangled name of this type */
207
+ const char *str; /* human readable name of this type */
208
+ swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
209
+ struct swig_cast_info *cast; /* linked list of types that can cast into this type */
210
+ void *clientdata; /* language specific type data */
211
+ int owndata; /* flag if the structure owns the clientdata */
212
+ } swig_type_info;
213
+
214
+ /* Structure to store a type and conversion function used for casting */
215
+ typedef struct WXRUBY_EXPORT swig_cast_info
216
+ {
217
+ swig_type_info *type; /* pointer to type that is equivalent to this type */
218
+ swig_converter_func converter; /* function to cast the void pointers */
219
+ struct swig_cast_info *next; /* pointer to next array of casts | pointer to cast hashed by value */
220
+ unsigned int value; /* index of the last valid element in the array | typename hash value */
221
+ } swig_cast_info;
222
+
223
+ /* Structure used to store module information
224
+ * Each module generates one structure like this, and the runtime collects
225
+ * all of these structures and stores them in a circularly linked list.*/
226
+ typedef struct WXRUBY_EXPORT swig_module_info
227
+ {
228
+ swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
229
+ size_t size; /* Number of types in this module */
230
+ struct swig_module_info *next; /* Pointer to next element in circularly linked list */
231
+ swig_type_info **type_initial; /* Array of initially generated type structures */
232
+ swig_cast_info **cast_initial; /* Array of initially generated casting structures */
233
+ void *clientdata; /* Language specific module data */
234
+ } swig_module_info;
235
+
236
+ /*
237
+ Compare two type names skipping the space characters, therefore
238
+ "char*" == "char *" and "Class<int>" == "Class<int >", etc.
239
+
240
+ Return 0 when the two name types are equivalent, as in
241
+ strncmp, but skipping ' '.
242
+ */
243
+ SWIGRUNTIME int
244
+ SWIG_TypeNameComp(const char *f1, const char *l1,
245
+ const char *f2, const char *l2) {
246
+ for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
247
+ while ((*f1 == ' ') && (f1 != l1)) ++f1;
248
+ while ((*f2 == ' ') && (f2 != l2)) ++f2;
249
+ if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
250
+ }
251
+ return (int)((l1 - f1) - (l2 - f2));
252
+ }
253
+
254
+ /*
255
+ Check type equivalence in a name list like <name1>|<name2>|...
256
+ Return 0 if equal, -1 if nb < tb, 1 if nb > tb
257
+ */
258
+ SWIGRUNTIME int
259
+ SWIG_TypeCmp(const char *nb, const char *tb) {
260
+ int equiv = 1;
261
+ const char* te = tb + strlen(tb);
262
+ const char* ne = nb;
263
+ while (equiv != 0 && *ne) {
264
+ for (nb = ne; *ne; ++ne) {
265
+ if (*ne == '|') break;
266
+ }
267
+ equiv = SWIG_TypeNameComp(nb, ne, tb, te);
268
+ if (*ne) ++ne;
269
+ }
270
+ return equiv;
271
+ }
272
+
273
+ /*
274
+ Check type equivalence in a name list like <name1>|<name2>|...
275
+ Return 0 if not equal, 1 if equal
276
+ */
277
+ SWIGRUNTIME int
278
+ SWIG_TypeEquiv(const char *nb, const char *tb) {
279
+ return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
280
+ }
281
+
282
+ /*
283
+ * Hash function for type name strings, based on maRushPrime1Hash (http://amsoftware.narod.ru/algo2.html)
284
+ */
285
+ SWIGRUNTIME unsigned int SWIG_Hash(const char *str, unsigned int len) {
286
+ const unsigned char *data = (const unsigned char *)str;
287
+ unsigned int hash = len, i = 0, k;
288
+ int rem = (int)len;
289
+
290
+ while (rem >= (int)sizeof(unsigned int)) {
291
+ memcpy(&k, data, sizeof(unsigned int));
292
+ k += i++;
293
+ hash ^= k;
294
+ hash *= 171717;
295
+ data += sizeof(unsigned int);
296
+ rem -= (int)sizeof(unsigned int);
297
+ }
298
+
299
+ switch (rem) {
300
+ case 3: k = (unsigned int)(data[2]) << 16;
301
+ k |= (unsigned int)(data[1]) << 8;
302
+ k |= (unsigned int)(data[0]);
303
+ k += i++;
304
+ hash ^= k;
305
+ hash *= 171717;
306
+ break;
307
+ case 2: k = (unsigned int)(data[1]) << 8;
308
+ k |= (unsigned int)(data[0]);
309
+ k += i++;
310
+ hash ^= k;
311
+ hash *= 171717;
312
+ break;
313
+ case 1: k = (unsigned int)(data[0]);
314
+ k += i++;
315
+ hash ^= k;
316
+ hash *= 171717;
317
+ break;
318
+ }
319
+ return hash;
320
+ }
321
+
322
+ /*
323
+ Check the typename
324
+ */
325
+ SWIGRUNTIME swig_cast_info *
326
+ SWIG_TypeCheck(const char *c, swig_type_info *ty) {
327
+ static const unsigned int scan_threshold = 4;
328
+ if (ty) {
329
+ swig_cast_info *head = ty->cast;
330
+ unsigned int hash_value = 0;
331
+ int hashed = 0;
332
+
333
+ while (head) {
334
+
335
+ if (strcmp(head->type->name, c) == 0) {
336
+ return head;
337
+ }
338
+
339
+ if (head->value) {
340
+ swig_cast_info *iter;
341
+ swig_cast_info *last = head + head->value;
342
+ swig_cast_info *first = head + 1;
343
+ int search = 1;
344
+
345
+ if (!hashed) {
346
+ if (head->value < scan_threshold) {
347
+ for (iter = first; iter <= last; iter++) {
348
+ if (strcmp(iter->type->name, c) == 0) {
349
+ return iter;
350
+ }
351
+ }
352
+ search = 0;
353
+ } else {
354
+ hashed = 1;
355
+ hash_value = SWIG_Hash(c, (unsigned int)strlen(c));
356
+ }
357
+ }
358
+
359
+ if (search) {
360
+ /* Binary search over sorted <'next'|'value'> pairs */
361
+ do {
362
+ iter = first + ((last - first) >> 1);
363
+ if (iter->value < hash_value) {
364
+ first = iter + 1;
365
+ } else if (iter->value == hash_value) {
366
+
367
+ if (strcmp(iter->next->type->name, c) == 0) {
368
+ return iter->next;
369
+ }
370
+
371
+ /* Hash collision check */
372
+ for (last = iter + 1; last->next && last->value == hash_value; last++) {
373
+ if (strcmp(last->next->type->name, c) == 0) {
374
+ return last->next;
375
+ }
376
+ }
377
+ for (first = iter - 1; first != head && first->value == hash_value; first--) {
378
+ if (strcmp(first->next->type->name, c) == 0) {
379
+ return first->next;
380
+ }
381
+ }
382
+ break;
383
+ } else
384
+ last = iter - 1;
385
+ } while (first <= last);
386
+ }
387
+ }
388
+ head = head->next;
389
+ }
390
+ }
391
+ return 0;
392
+ }
393
+
394
+ /*
395
+ Check the type by type address
396
+ */
397
+ SWIGRUNTIME swig_cast_info *
398
+ SWIG_TypeCheckStruct(const swig_type_info *from, swig_type_info *ty) {
399
+ if (ty) {
400
+ swig_cast_info *head = ty->cast;
401
+ while (head) {
402
+ if (head->type == from) {
403
+ return head;
404
+ }
405
+
406
+ if (head->value) {
407
+ swig_cast_info *iter;
408
+ swig_cast_info *last = head + head->value;
409
+ swig_cast_info *first = head + 1;
410
+
411
+ /* Binary search over sorted array of casts */
412
+ do {
413
+ iter = first + ((last - first) >> 1);
414
+ if (iter->type < from) {
415
+ first = iter + 1;
416
+ } else if (iter->type == from) {
417
+ return iter;
418
+ } else
419
+ last = iter - 1;
420
+ } while (first <= last);
421
+ }
422
+ head = head->next;
423
+ }
424
+ }
425
+ return 0;
426
+ }
427
+
428
+ /*
429
+ Cast a pointer up an inheritance hierarchy
430
+ */
431
+ SWIGRUNTIMEINLINE void *
432
+ SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
433
+ return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
434
+ }
435
+
436
+ /*
437
+ Dynamic pointer casting. Down an inheritance hierarchy
438
+ */
439
+ SWIGRUNTIME swig_type_info *
440
+ SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
441
+ swig_type_info *lastty = ty;
442
+ if (!ty || !ty->dcast) return ty;
443
+ while (ty && (ty->dcast)) {
444
+ ty = (*ty->dcast)(ptr);
445
+ if (ty) lastty = ty;
446
+ }
447
+ return lastty;
448
+ }
449
+
450
+ /*
451
+ Return the name associated with this type
452
+ */
453
+ SWIGRUNTIMEINLINE const char *
454
+ SWIG_TypeName(const swig_type_info *ty) {
455
+ return ty->name;
456
+ }
457
+
458
+ /*
459
+ Return the pretty name associated with this type,
460
+ that is an unmangled type name in a form presentable to the user.
461
+ */
462
+ SWIGRUNTIME const char *
463
+ SWIG_TypePrettyName(const swig_type_info *type) {
464
+ /* The "str" field contains the equivalent pretty names of the
465
+ type, separated by vertical-bar characters. Choose the last
466
+ name. It should be the most specific; a fully resolved name
467
+ but not necessarily with default template parameters expanded. */
468
+ if (!type) return NULL;
469
+ if (type->str != NULL) {
470
+ const char *last_name = type->str;
471
+ const char *s;
472
+ for (s = type->str; *s; s++)
473
+ if (*s == '|') last_name = s+1;
474
+ return last_name;
475
+ }
476
+ else
477
+ return type->name;
478
+ }
479
+
480
+ /*
481
+ Set the clientdata field for a type
482
+ */
483
+ SWIGRUNTIME void
484
+ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
485
+ swig_cast_info *head = ti->cast;
486
+ /* if (ti->clientdata == clientdata) return; */
487
+ ti->clientdata = clientdata;
488
+
489
+ while (head) {
490
+ swig_cast_info *cast;
491
+ for (cast = head; (unsigned int)(cast - head) <= head->value; cast++) {
492
+ if (!cast->converter) {
493
+ swig_type_info *tc = cast->type;
494
+ if (!tc->clientdata) {
495
+ SWIG_TypeClientData(tc, clientdata);
496
+ }
497
+ }
498
+ }
499
+ head = head->next;
500
+ }
501
+ }
502
+
503
+ SWIGRUNTIME void
504
+ SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
505
+ SWIG_TypeClientData(ti, clientdata);
506
+ ti->owndata = 1;
507
+ }
508
+
509
+ /*
510
+ Search for a swig_type_info structure only by mangled name
511
+ Search is a O(log #types)
512
+
513
+ We start searching at module start, and finish searching when start == end.
514
+ Note: if start == end at the beginning of the function, we go all the way around
515
+ the circular list.
516
+ */
517
+ SWIGRUNTIME swig_type_info *
518
+ SWIG_MangledTypeQueryModule(swig_module_info *start,
519
+ swig_module_info *end,
520
+ const char *name) {
521
+ swig_module_info *iter = start;
522
+ do {
523
+ if (iter->size) {
524
+ size_t l = 0;
525
+ size_t r = iter->size - 1;
526
+ do {
527
+ /* since l+r >= 0, we can (>> 1) instead (/ 2) */
528
+ size_t i = (l + r) >> 1;
529
+ const char *iname = iter->types[i]->name;
530
+ if (iname) {
531
+ int compare = strcmp(name, iname);
532
+ if (compare == 0) {
533
+ return iter->types[i];
534
+ } else if (compare < 0) {
535
+ if (i) {
536
+ r = i - 1;
537
+ } else {
538
+ break;
539
+ }
540
+ } else if (compare > 0) {
541
+ l = i + 1;
542
+ }
543
+ } else {
544
+ break; /* should never happen */
545
+ }
546
+ } while (l <= r);
547
+ }
548
+ iter = iter->next;
549
+ } while (iter != end);
550
+ return 0;
551
+ }
552
+
553
+ /*
554
+ Search for a swig_type_info structure for either a mangled name or a human readable name.
555
+ It first searches the mangled names of the types, which is a O(log #types)
556
+ If a type is not found it then searches the human readable names, which is O(#types).
557
+
558
+ We start searching at module start, and finish searching when start == end.
559
+ Note: if start == end at the beginning of the function, we go all the way around
560
+ the circular list.
561
+ */
562
+ SWIGRUNTIME swig_type_info *
563
+ SWIG_TypeQueryModule(swig_module_info *start,
564
+ swig_module_info *end,
565
+ const char *name) {
566
+ /* STEP 1: Search the name field using binary search */
567
+ swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
568
+ if (ret) {
569
+ return ret;
570
+ } else {
571
+ /* STEP 2: If the type hasn't been found, do a complete search
572
+ of the str field (the human readable name) */
573
+ swig_module_info *iter = start;
574
+ do {
575
+ size_t i = 0;
576
+ for (; i < iter->size; ++i) {
577
+ if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
578
+ return iter->types[i];
579
+ }
580
+ iter = iter->next;
581
+ } while (iter != end);
582
+ }
583
+
584
+ /* neither found a match */
585
+ return 0;
586
+ }
587
+
588
+ /*
589
+ Pack binary data into a string
590
+ */
591
+ SWIGRUNTIME char *
592
+ SWIG_PackData(char *c, void *ptr, size_t sz) {
593
+ static const char hex[17] = "0123456789abcdef";
594
+ const unsigned char *u = (unsigned char *) ptr;
595
+ const unsigned char *eu = u + sz;
596
+ for (; u != eu; ++u) {
597
+ unsigned char uu = *u;
598
+ *(c++) = hex[(uu & 0xf0) >> 4];
599
+ *(c++) = hex[uu & 0xf];
600
+ }
601
+ return c;
602
+ }
603
+
604
+ /*
605
+ Unpack binary data from a string
606
+ */
607
+ SWIGRUNTIME const char *
608
+ SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
609
+ unsigned char *u = (unsigned char *) ptr;
610
+ const unsigned char *eu = u + sz;
611
+ for (; u != eu; ++u) {
612
+ char d = *(c++);
613
+ unsigned char uu;
614
+ if ((d >= '0') && (d <= '9'))
615
+ uu = (unsigned char)((d - '0') << 4);
616
+ else if ((d >= 'a') && (d <= 'f'))
617
+ uu = (unsigned char)((d - ('a'-10)) << 4);
618
+ else
619
+ return (char *) 0;
620
+ d = *(c++);
621
+ if ((d >= '0') && (d <= '9'))
622
+ uu |= (unsigned char)(d - '0');
623
+ else if ((d >= 'a') && (d <= 'f'))
624
+ uu |= (unsigned char)(d - ('a'-10));
625
+ else
626
+ return (char *) 0;
627
+ *u = uu;
628
+ }
629
+ return c;
630
+ }
631
+
632
+ /*
633
+ Pack 'void *' into a string buffer.
634
+ */
635
+ SWIGRUNTIME char *
636
+ SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
637
+ char *r = buff;
638
+ if ((2*sizeof(void *) + 2) > bsz) return 0;
639
+ *(r++) = '_';
640
+ r = SWIG_PackData(r,&ptr,sizeof(void *));
641
+ if (strlen(name) + 1 > (bsz - (size_t)(r - buff))) return 0;
642
+ strcpy(r,name);
643
+ return buff;
644
+ }
645
+
646
+ SWIGRUNTIME const char *
647
+ SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
648
+ if (*c != '_') {
649
+ if (strcmp(c,"NULL") == 0) {
650
+ *ptr = (void *) 0;
651
+ return name;
652
+ } else {
653
+ return 0;
654
+ }
655
+ }
656
+ return SWIG_UnpackData(++c,ptr,sizeof(void *));
657
+ }
658
+
659
+ SWIGRUNTIME char *
660
+ SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
661
+ char *r = buff;
662
+ size_t lname = (name ? strlen(name) : 0);
663
+ if ((2*sz + 2 + lname) > bsz) return 0;
664
+ *(r++) = '_';
665
+ r = SWIG_PackData(r,ptr,sz);
666
+ if (lname) {
667
+ strncpy(r,name,lname+1);
668
+ } else {
669
+ *r = 0;
670
+ }
671
+ return buff;
672
+ }
673
+
674
+ SWIGRUNTIME const char *
675
+ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
676
+ if (*c != '_') {
677
+ if (strcmp(c,"NULL") == 0) {
678
+ memset(ptr,0,sz);
679
+ return name;
680
+ } else {
681
+ return 0;
682
+ }
683
+ }
684
+ return SWIG_UnpackData(++c,ptr,sz);
685
+ }
686
+
687
+ #ifdef __cplusplus
688
+ }
689
+ #endif
@@ -1,5 +1,13 @@
1
1
  /* -----------------------------------------------------------------------------
2
2
  * rubyprimtypes.swg
3
+ *
4
+ * Customized for wxRuby3.
5
+ * The changes involve making sure to treat wxRuby3 Enum values as FIXNUM
6
+ * and not as BIGNUM.
7
+ *
8
+ * Copyright (c) 2023 M.J.N. Corino, The Netherlands
9
+ *
10
+ * This software is released under the MIT license.
3
11
  * ----------------------------------------------------------------------------- */
4
12
  /* ------------------------------------------------------------
5
13
  * Primitive Types