wxruby3 0.9.0 → 0.9.1

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 (74) hide show
  1. checksums.yaml +4 -4
  2. data/ext/wxruby3/include/wxruby-runtime.h +3 -0
  3. data/ext/wxruby3/swig/common.i +22 -0
  4. data/ext/wxruby3/swig/custom/director.swg +296 -0
  5. data/ext/wxruby3/swig/custom/rubyapi.swg +19 -0
  6. data/ext/wxruby3/swig/custom/rubyerrors.swg +45 -0
  7. data/ext/wxruby3/swig/custom/rubyhead.swg +192 -0
  8. data/ext/wxruby3/swig/custom/rubyrun.swg +187 -0
  9. data/ext/wxruby3/swig/custom/swigrun.swg +363 -0
  10. data/ext/wxruby3/swig/custom/typemaps/swigtypemaps.swg +173 -0
  11. data/ext/wxruby3/swig/wx.i +50 -30
  12. data/lib/wx/core/const.rb +83 -0
  13. data/lib/wx/doc/const.rb +66 -66
  14. data/lib/wx/doc/event.rb +0 -6
  15. data/lib/wx/doc/functions.rb +9 -9
  16. data/lib/wx/doc/window.rb +5 -0
  17. data/lib/wx/keyword_defs.rb +43 -6
  18. data/lib/wx/version.rb +1 -1
  19. data/rakelib/lib/config/macosx.rb +1 -1
  20. data/rakelib/lib/core/include/funcall.inc +33 -14
  21. data/rakelib/lib/core/include/swigdirector.inc +384 -0
  22. data/rakelib/lib/core/include/swigrubyerrors.inc +161 -0
  23. data/{ext/wxruby3/swig/custom/swig4/rubyrun.swg → rakelib/lib/core/include/swigrubyrun.inc} +245 -120
  24. data/rakelib/lib/core/include/swigrun.inc +700 -0
  25. data/rakelib/lib/core/package.rb +5 -2
  26. data/rakelib/lib/core/parameter.rb +3 -0
  27. data/rakelib/lib/director/accelerator.rb +1 -1
  28. data/rakelib/lib/director/animation.rb +1 -1
  29. data/rakelib/lib/director/animation_ctrl.rb +20 -0
  30. data/rakelib/lib/director/app.rb +23 -5
  31. data/rakelib/lib/director/art_provider.rb +1 -1
  32. data/rakelib/lib/director/data_object_simple_base.rb +1 -2
  33. data/rakelib/lib/director/dialog.rb +5 -0
  34. data/rakelib/lib/director/dialup_event.rb +44 -0
  35. data/rakelib/lib/director/dialup_manager.rb +45 -0
  36. data/rakelib/lib/director/event.rb +20 -2
  37. data/rakelib/lib/director/file_ctrl.rb +35 -0
  38. data/rakelib/lib/director/file_ctrl_event.rb +26 -0
  39. data/rakelib/lib/director/gdicommon.rb +19 -1
  40. data/rakelib/lib/director/grid_cell_editor.rb +6 -6
  41. data/rakelib/lib/director/help_controller.rb +1 -1
  42. data/rakelib/lib/director/pgarray_editor_dialog.rb +0 -6
  43. data/rakelib/lib/director/pgeditor.rb +2 -2
  44. data/rakelib/lib/director/pgproperties.rb +2 -2
  45. data/rakelib/lib/director/richtext_buffer.rb +1 -1
  46. data/rakelib/lib/director/richtext_ctrl.rb +1 -1
  47. data/rakelib/lib/director/sash_event.rb +42 -0
  48. data/rakelib/lib/director/sizer.rb +64 -1
  49. data/rakelib/lib/director/sizer_item.rb +22 -0
  50. data/rakelib/lib/director/task_bar_icon.rb +1 -1
  51. data/rakelib/lib/director/tree_ctrl.rb +19 -44
  52. data/rakelib/lib/generate/doc/animation_ctrl.yaml +15 -0
  53. data/rakelib/lib/generate/doc/events.yaml +10 -4
  54. data/rakelib/lib/generate/doc/static_box.yaml +8 -0
  55. data/rakelib/lib/generate/doc/xml_resource.yaml +3 -0
  56. data/rakelib/lib/generate/doc.rb +14 -3
  57. data/rakelib/lib/generate/interface.rb +4 -3
  58. data/rakelib/lib/specs/interfaces.rb +5 -1
  59. data/rakelib/lib/swig_runner.rb +4 -50
  60. data/rakelib/lib/typemap/common.rb +24 -9
  61. data/rakelib/lib/typemap/data_format.rb +1 -1
  62. data/rakelib/lib/typemap/data_object_data.rb +2 -2
  63. data/rakelib/lib/typemap/pgprop_arg.rb +7 -2
  64. data/rakelib/lib/typemap/points_list.rb +5 -7
  65. data/rakelib/lib/util/string.rb +10 -8
  66. data/samples/text/richtext.rb +0 -30
  67. data/tests/test_app_exit_exception.rb +36 -0
  68. data/tests/test_app_init_exception.rb +20 -0
  69. data/tests/test_book_controls.rb +29 -0
  70. data/tests/test_exceptions.rb +41 -0
  71. data/tests/test_sizer.rb +43 -0
  72. data/tests/test_std_controls.rb +36 -0
  73. metadata +25 -4
  74. data/ext/wxruby3/swig/custom/swig3/rubyrun.swg +0 -456
@@ -1,456 +0,0 @@
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
-
9
- /* For backward compatibility only */
10
- #define SWIG_POINTER_EXCEPTION 0
11
-
12
- /* for raw pointers */
13
- #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
14
- #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, own)
15
- #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Ruby_NewPointerObj(ptr, type, flags)
16
- #define SWIG_AcquirePtr(ptr, own) SWIG_Ruby_AcquirePtr(ptr, own)
17
- #define swig_owntype swig_ruby_owntype
18
-
19
- /* for raw packed data */
20
- #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)
21
- #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
22
-
23
- /* for class or struct pointers */
24
- #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
25
- #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
26
-
27
- /* for C or C++ function pointers */
28
- #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0)
29
- #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0)
30
-
31
- /* for C++ member pointers, ie, member methods */
32
- #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty)
33
- #define SWIG_NewMemberObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
34
-
35
-
36
- /* Runtime API */
37
-
38
- #define SWIG_GetModule(clientdata) SWIG_Ruby_GetModule(clientdata)
39
- #define SWIG_SetModule(clientdata, pointer) SWIG_Ruby_SetModule(pointer)
40
-
41
-
42
- /* Error manipulation */
43
-
44
- #define SWIG_ErrorType(code) SWIG_Ruby_ErrorType(code)
45
- #define SWIG_Error(code, msg) rb_raise(SWIG_Ruby_ErrorType(code), "%s", msg)
46
- #define SWIG_fail goto fail
47
-
48
-
49
- /* Ruby-specific SWIG API */
50
-
51
- #define SWIG_InitRuntime() SWIG_Ruby_InitRuntime()
52
- #define SWIG_define_class(ty) SWIG_Ruby_define_class(ty)
53
- #define SWIG_NewClassInstance(value, ty) SWIG_Ruby_NewClassInstance(value, ty)
54
- #define SWIG_MangleStr(value) SWIG_Ruby_MangleStr(value)
55
- #define SWIG_CheckConvert(value, ty) SWIG_Ruby_CheckConvert(value, ty)
56
-
57
- #include "assert.h"
58
-
59
- /* -----------------------------------------------------------------------------
60
- * pointers/data manipulation
61
- * ----------------------------------------------------------------------------- */
62
-
63
- #ifdef __cplusplus
64
- extern "C" {
65
- #endif
66
-
67
- typedef struct {
68
- VALUE klass;
69
- VALUE mImpl;
70
- void (*mark)(void *);
71
- void (*destroy)(void *);
72
- int trackObjects;
73
- } swig_class;
74
-
75
-
76
- /* Global pointer used to keep some internal SWIG stuff */
77
- static VALUE _cSWIG_Pointer = Qnil;
78
- static VALUE swig_runtime_data_type_pointer = Qnil;
79
-
80
- /* Global IDs used to keep some internal SWIG stuff */
81
- static ID swig_arity_id = 0;
82
- static ID swig_call_id = 0;
83
-
84
- /*
85
- If your swig extension is to be run within an embedded ruby and has
86
- director callbacks, you should set -DRUBY_EMBEDDED during compilation.
87
- This will reset ruby's stack frame on each entry point from the main
88
- program the first time a virtual director function is invoked (in a
89
- non-recursive way).
90
- If this is not done, you run the risk of Ruby trashing the stack.
91
- */
92
-
93
- #ifdef RUBY_EMBEDDED
94
-
95
- # define SWIG_INIT_STACK \
96
- if ( !swig_virtual_calls ) { RUBY_INIT_STACK } \
97
- ++swig_virtual_calls;
98
- # define SWIG_RELEASE_STACK --swig_virtual_calls;
99
- # define Ruby_DirectorTypeMismatchException(x) \
100
- rb_raise( rb_eTypeError, "%s", x ); return c_result;
101
-
102
- static unsigned int swig_virtual_calls = 0;
103
-
104
- #else /* normal non-embedded extension */
105
-
106
- # define SWIG_INIT_STACK
107
- # define SWIG_RELEASE_STACK
108
- # define Ruby_DirectorTypeMismatchException(x) \
109
- throw Swig::DirectorTypeMismatchException( x );
110
-
111
- #endif /* RUBY_EMBEDDED */
112
-
113
-
114
- SWIGRUNTIME VALUE
115
- getExceptionClass(void) {
116
- static int init = 0;
117
- static VALUE rubyExceptionClass ;
118
- if (!init) {
119
- init = 1;
120
- rubyExceptionClass = rb_const_get(_mSWIG, rb_intern("Exception"));
121
- }
122
- return rubyExceptionClass;
123
- }
124
-
125
- /* This code checks to see if the Ruby object being raised as part
126
- of an exception inherits from the Ruby class Exception. If so,
127
- the object is simply returned. If not, then a new Ruby exception
128
- object is created and that will be returned to Ruby.*/
129
- SWIGRUNTIME VALUE
130
- SWIG_Ruby_ExceptionType(swig_type_info *desc, VALUE obj) {
131
- VALUE exceptionClass = getExceptionClass();
132
- if (rb_obj_is_kind_of(obj, exceptionClass)) {
133
- return obj;
134
- } else {
135
- return rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(obj));
136
- }
137
- }
138
-
139
- /* Initialize Ruby runtime support */
140
- SWIGRUNTIME void
141
- SWIG_Ruby_InitRuntime(void)
142
- {
143
- if (_mSWIG == Qnil) {
144
- _mSWIG = rb_define_module("SWIG");
145
- swig_call_id = rb_intern("call");
146
- swig_arity_id = rb_intern("arity");
147
- }
148
- }
149
-
150
- /* Define Ruby class for C type */
151
- SWIGRUNTIME void
152
- SWIG_Ruby_define_class(swig_type_info *type)
153
- {
154
- char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
155
- sprintf(klass_name, "TYPE%s", type->name);
156
- if (NIL_P(_cSWIG_Pointer)) {
157
- _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
158
- rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
159
- }
160
- rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
161
- free((void *) klass_name);
162
- }
163
-
164
- /* Create a new pointer object */
165
- SWIGRUNTIME VALUE
166
- SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
167
- {
168
- int own = flags & SWIG_POINTER_OWN;
169
- int track;
170
- char *klass_name;
171
- swig_class *sklass;
172
- VALUE klass;
173
- VALUE obj;
174
-
175
- if (!ptr)
176
- return Qnil;
177
-
178
- if (type->clientdata) {
179
- sklass = (swig_class *) type->clientdata;
180
-
181
- /* Are we tracking this class and have we already returned this Ruby object? */
182
- track = sklass->trackObjects;
183
- if (track) {
184
- obj = SWIG_RubyInstanceFor(ptr);
185
-
186
- /* Check the object's type and make sure it has the correct type.
187
- It might not in cases where methods do things like
188
- downcast methods. */
189
- if (obj != Qnil) {
190
- VALUE value = rb_iv_get(obj, "@__swigtype__");
191
- const char* type_name = RSTRING_PTR(value);
192
-
193
- if (strcmp(type->name, type_name) == 0) {
194
- return obj;
195
- }
196
- }
197
- }
198
-
199
- /* Create a new Ruby object */
200
- obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark),
201
- ( own ? VOIDFUNC(sklass->destroy) :
202
- (track ? VOIDFUNC(SWIG_RubyRemoveTracking) : 0 )
203
- ), ptr);
204
-
205
- /* If tracking is on for this class then track this object. */
206
- if (track) {
207
- SWIG_RubyAddTracking(ptr, obj);
208
- }
209
- } else {
210
- klass_name = (char *) malloc(4 + strlen(type->name) + 1);
211
- sprintf(klass_name, "TYPE%s", type->name);
212
- klass = rb_const_get(_mSWIG, rb_intern(klass_name));
213
- free((void *) klass_name);
214
- obj = Data_Wrap_Struct(klass, 0, 0, ptr);
215
- }
216
- rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
217
-
218
- return obj;
219
- }
220
-
221
- /* Create a new class instance (always owned) */
222
- SWIGRUNTIME VALUE
223
- SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
224
- {
225
- VALUE obj;
226
- swig_class *sklass = (swig_class *) type->clientdata;
227
- obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
228
- rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
229
- return obj;
230
- }
231
-
232
- /* Get type mangle from class name */
233
- SWIGRUNTIMEINLINE char *
234
- SWIG_Ruby_MangleStr(VALUE obj)
235
- {
236
- VALUE stype = rb_iv_get(obj, "@__swigtype__");
237
- return StringValuePtr(stype);
238
- }
239
-
240
- /* Acquire a pointer value */
241
- typedef struct {
242
- void (*datafree)(void *);
243
- int own;
244
- } swig_ruby_owntype;
245
-
246
- SWIGRUNTIME swig_ruby_owntype
247
- SWIG_Ruby_AcquirePtr(VALUE obj, swig_ruby_owntype own) {
248
- swig_ruby_owntype oldown = {0, 0};
249
- if (TYPE(obj) == T_DATA && !RTYPEDDATA_P(obj)) {
250
- oldown.datafree = RDATA(obj)->dfree;
251
- RDATA(obj)->dfree = own.datafree;
252
- }
253
- return oldown;
254
- }
255
-
256
- /* Convert a pointer value */
257
- SWIGRUNTIME int
258
- SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, swig_ruby_owntype *own)
259
- {
260
- char *c;
261
- swig_cast_info *tc;
262
- void *vptr = 0;
263
-
264
- /* Grab the pointer */
265
- if (NIL_P(obj)) {
266
- if (ptr)
267
- *ptr = 0;
268
- return SWIG_OK;
269
- } else {
270
- if (TYPE(obj) != T_DATA) {
271
- return SWIG_ERROR;
272
- }
273
- Data_Get_Struct(obj, void, vptr);
274
- }
275
-
276
- if (own) {
277
- own->datafree = RDATA(obj)->dfree;
278
- own->own = 0;
279
- }
280
-
281
- /* Check to see if the input object is giving up ownership
282
- of the underlying C struct or C++ object. If so then we
283
- need to reset the destructor since the Ruby object no
284
- longer owns the underlying C++ object.*/
285
- if (flags & SWIG_POINTER_DISOWN) {
286
- /* Is tracking on for this class? */
287
- int track = 0;
288
- if (ty && ty->clientdata) {
289
- swig_class *sklass = (swig_class *) ty->clientdata;
290
- track = sklass->trackObjects;
291
- }
292
-
293
- if (track) {
294
- /* We are tracking objects for this class. Thus we change the destructor
295
- * to SWIG_RubyRemoveTracking. This allows us to
296
- * remove the mapping from the C++ to Ruby object
297
- * when the Ruby object is garbage collected. If we don't
298
- * do this, then it is possible we will return a reference
299
- * to a Ruby object that no longer exists thereby crashing Ruby. */
300
- RDATA(obj)->dfree = SWIG_RubyRemoveTracking;
301
- } else {
302
- RDATA(obj)->dfree = 0;
303
- }
304
- }
305
-
306
- /* Do type-checking if type info was provided */
307
- if (ty) {
308
- if (ty->clientdata) {
309
- if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) {
310
- if (vptr == 0) {
311
- /* The object has already been deleted */
312
- return SWIG_ObjectPreviouslyDeletedError;
313
- }
314
- }
315
- }
316
- if ((c = SWIG_MangleStr(obj)) == NULL) {
317
- return SWIG_ERROR;
318
- }
319
- tc = SWIG_TypeCheck(c, ty);
320
- if (!tc) {
321
- return SWIG_ERROR;
322
- } else {
323
- if (ptr) {
324
- if (tc->type == ty) {
325
- *ptr = vptr;
326
- } else {
327
- int newmemory = 0;
328
- *ptr = SWIG_TypeCast(tc, vptr, &newmemory);
329
- if (newmemory == SWIG_CAST_NEW_MEMORY) {
330
- assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
331
- if (own)
332
- own->own = own->own | SWIG_CAST_NEW_MEMORY;
333
- }
334
- }
335
- }
336
- }
337
- } else {
338
- if (ptr)
339
- *ptr = vptr;
340
- }
341
-
342
- return SWIG_OK;
343
- }
344
-
345
- /* Check convert */
346
- SWIGRUNTIMEINLINE int
347
- SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty)
348
- {
349
- char *c = SWIG_MangleStr(obj);
350
- if (!c) return 0;
351
- return SWIG_TypeCheck(c,ty) != 0;
352
- }
353
-
354
- SWIGRUNTIME VALUE
355
- SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
356
- char result[1024];
357
- char *r = result;
358
- if ((2*sz + 1 + strlen(type->name)) > 1000) return 0;
359
- *(r++) = '_';
360
- r = SWIG_PackData(r, ptr, sz);
361
- strcpy(r, type->name);
362
- return rb_str_new2(result);
363
- }
364
-
365
- /* Convert a packed value value */
366
- SWIGRUNTIME int
367
- SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) {
368
- swig_cast_info *tc;
369
- const char *c;
370
-
371
- if (TYPE(obj) != T_STRING) goto type_error;
372
- c = StringValuePtr(obj);
373
- /* Pointer values must start with leading underscore */
374
- if (*c != '_') goto type_error;
375
- c++;
376
- c = SWIG_UnpackData(c, ptr, sz);
377
- if (ty) {
378
- tc = SWIG_TypeCheck(c, ty);
379
- if (!tc) goto type_error;
380
- }
381
- return SWIG_OK;
382
-
383
- type_error:
384
- return SWIG_ERROR;
385
- }
386
-
387
- SWIGRUNTIME swig_module_info *
388
- SWIG_Ruby_GetModule(void *SWIGUNUSEDPARM(clientdata))
389
- {
390
- VALUE pointer;
391
- swig_module_info *ret = 0;
392
- VALUE verbose = rb_gv_get("VERBOSE");
393
-
394
- /* temporarily disable warnings, since the pointer check causes warnings with 'ruby -w' */
395
- rb_gv_set("VERBOSE", Qfalse);
396
-
397
- /* first check if pointer already created */
398
- pointer = rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
399
- if (pointer != Qnil) {
400
- Data_Get_Struct(pointer, swig_module_info, ret);
401
- }
402
-
403
- /* reinstate warnings */
404
- rb_gv_set("VERBOSE", verbose);
405
- return ret;
406
- }
407
-
408
- SWIGRUNTIME void
409
- SWIG_Ruby_SetModule(swig_module_info *pointer)
410
- {
411
- /* register a new class */
412
- VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
413
- rb_undef_alloc_func(cl);
414
- /* create and store the structure pointer to a global variable */
415
- swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer);
416
- rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
417
- }
418
-
419
- /* This function can be used to check whether a proc or method or similarly
420
- callable function has been passed. Usually used in a %typecheck, like:
421
-
422
- %typecheck(c_callback_t, precedence=SWIG_TYPECHECK_POINTER) {
423
- $result = SWIG_Ruby_isCallable( $input );
424
- }
425
- */
426
- SWIGINTERN
427
- int SWIG_Ruby_isCallable( VALUE proc )
428
- {
429
- if ( rb_respond_to( proc, swig_call_id ) )
430
- return 1;
431
- return 0;
432
- }
433
-
434
- /* This function can be used to check the arity (number of arguments)
435
- a proc or method can take. Usually used in a %typecheck.
436
- Valid arities will be that equal to minimal or those < 0
437
- which indicate a variable number of parameters at the end.
438
- */
439
- SWIGINTERN
440
- int SWIG_Ruby_arity( VALUE proc, int minimal )
441
- {
442
- if ( rb_respond_to( proc, swig_arity_id ) )
443
- {
444
- VALUE num = rb_funcall( proc, swig_arity_id, 0 );
445
- int arity = NUM2INT(num);
446
- if ( arity < 0 && (arity+1) < -minimal ) return 1;
447
- if ( arity == minimal ) return 1;
448
- return 1;
449
- }
450
- return 0;
451
- }
452
-
453
-
454
- #ifdef __cplusplus
455
- }
456
- #endif