Codebase list ruby-fxruby / a045fea
New upstream version 1.6.42 Sophie Brun 2 years ago
149 changed file(s) with 4973 addition(s) and 3062 deletion(s). Raw diff Collapse all Expand all
55 ext/fox16_c/*.o
66 ext/fox16_c/conftest.dSYM
77 ext/fox16_c/include/inlinestubs.h
8 ext/fox16_c/extconf.h
89 ext/fox16_c/swigruby.h
910 ext/fox16_c/fox16.bundle
1011 ext/fox16_c/mkmf.log
1112 lib/fox16/kwargs.rb
13 lib/[0-9].[0-9]
14 lib/*.so
1215 fox-includes/diffs.py
1316 fox-includes/diffs.txt
17 pkg
18 tmp
19 vendor
20 *.orig
21 *.rej
22 /Gemfile.lock
23 /ports
24 /.bundle
25 /.yardoc
0 dist: xenial
1 language: ruby
2
3 addons:
4 apt:
5 packages:
6 - xpra
7 - xserver-xorg-video-dummy
8 - g++
9 - libxrandr-dev
10 - libfox-1.6-dev
11 - libfxscintilla-dev
12 - swig
13
14 install:
15 - swig -version
16 - ls -l /usr/lib/libfxscintilla*
17 - bundle install
18
19 before_script:
20 - "xpra --xvfb=\"Xorg +extension GLX -config `pwd`/test/dummy.xorg.conf -logfile ${HOME}/.xpra/xorg.log\" start :9"
21
22 script: bundle exec rake test DISPLAY=:9
23
24 after_failure:
25 - "cat ~/.xpra/*"
26
27 after_script:
28 - "xpra stop :9"
29
30 rvm:
31 - "ruby-head"
32 - "2.6.0"
33 - "2.2"
0 source 'https://rubygems.org'
1
2 # Specify your gem's runtime dependencies in fxruby.gemspec
3 gemspec
4
5 # For some reason this is required in addition to the gemspec
6 # when 'bundle config force_ruby_platform true' is active:
7 gem 'mini_portile2'
8
9 group :development do
10 gem 'rake-compiler', '~> 1.0'
11 gem 'rake-compiler-dock', '~> 1.0'
12 gem 'yard', '~> 0.8'
13 gem "bundler", ">= 1.12", "< 3.a"
14 gem "rake", "~> 13.0"
15 end
16
17 group :test do
18 gem 'opengl', '~> 0.8'
19 gem 'glu', '~> 8.0'
20 gem 'test-unit', '~> 3.1'
21 end
0 ## 1.6.42 / 2020-02-01
1
2 * Fix a packing issue in 1.6.41: `lib/fox16/input.rb` had owner permission only.
3
4 ## 1.6.41 / 2020-01-26
5
6 * Add support for Ruby-2.7
7 * Fix build error on FreeBSD. #51
8 * Fix handling of scroll events to FXText instance.
9 * Add 8 virtual methods of FXText to be passed through ruby.
10 * FXText#findText: Return multi entry array only when searching Regex.
11 * Fix several example apps in example/ dir.
12 * Update to rake-compiler-dock-1.0 and use parallel cross build.
13 * Update to libpng-1.6.37, jpeg-turbo-2.0.4, libtiff-4.1.0 on Windows binary gem.
14
15 ## 1.6.40 / 2018-12-28
16
17 * Fix some library classes which failed, when Fox was not included into the global namespace.
18 * Add new accessor FXImage#dataPtr to access raw image data from FFI, Fiddle or OpenGL.
19 * Ensure zero terminated strings in values of C-argv.
20 * Remove various Ruby and C++ warnings.
21 * Update libfox to 1.6.57.
22 * Add support for RubyInstaller-2.6
23 * Set minimum required ruby version to 2.2.
24
25 ## 1.6.39 / 2017-12-26
26
27 * Fix FXGLVisual.supported and .supported?
28 * Add support for RubyInstaller-2.5
29
30 ## 1.6.38 / 2017-07-27
31
32 * Update dependent libraries for Windows binary gem.
33 * Replace libjpeg-9b by libjpeg-turbo-1.5.2 on Windows binary gem.
34 * Fix build with clang on FreeBSD (and possibly other OS). Fixes #41
35
36 ## 1.6.37 / 2017-06-24
37
38 * Add a 3rd type of FXRbObjects which is used for callbacks. Fixes #39
39
40 ## 1.6.36 / 2017-06-04
41
42 * Support the fxruby source gem on Windows (only RubyInstaller-2.4).
43 * Replace our self-made directory search methods by pgk-config.
44 * Enable the use of Win32 unicode functions. Fixes #30 and #38
45 * Fix segfault in vsprintf on Windows 10.
46 * Update support for RubyInstaller-2.4.1-1
47 * Update to libjpeg-9b
48 * More automation for gem releases
49
50 ## 1.6.35 / 2017-02-15
51
52 * Adjust for Ruby-2.4 with unified Integers
53 * Add support for RubyInstaller-2.4
54 * Drop support for Ruby-1.8 and 1.9. It may work with them, but is no longer tested.
55 * Add compat with SWIG-3.0
56 * Fix an issue with FXApp#removeInput introduced in fxruby-1.6.30.
57 * Work around missing /usr/lib/libfxscintilla.so file in Ubuntu
58 * Update dependent gems.
59 * Update libraries for Windows build.
60
61 ## 1.6.34 / 2016-04-26
62
63 * Add support for RubyInstaller-2.3
64 * Avoid RARRAY_PTR() which broke fxruby on ruby-2.3.0.
65 * Make use of StringValueCStr() where it is suitable.
66 * Fix initialisation of runOnUiThread event handler, when FXApp is called with a block.
67 * Disable GVL on RubyInstaller-1.9.3. Fixes #24
68
69 ## 1.6.33 / 2015-08-20
70
71 * Avoid rb_* calls that are prohibited during GC. Fixes #23
72 * Use copy'ing getters for FXVec members in FXMat*, FXMaterial and FXLight.
73 This fixes the TC_FXMaterial#test_bug test case.
74 * Fix test suite, so that all tests pass.
75 * Add a travis-ci test setup and connect it to the github account.
76
77 ## 1.6.32 / 2015-08-07
78
79 * Avoid call to rb_class2name() during GC. Fixes #21
80 * Use release mode, unless extconf.rb is called with --enable-debug,
81 so that all FXTRACE() and FXASSERT() calls are skiped, per default.
82 * Remove self made GC detection by ruby's rb_during_gc().
83 * Fix Windows binary x86-mingw32.gem for Ruby versions < 2.0
84
85 ## 1.6.31 / 2015-07-21
86
87 * Replace pipe2() by pipe() and fcntl(), because pipe2() is not as portable.
88 * Add missing include statement. Fixes #20
89
90 ## 1.6.30 / 2015-07-07
91
92 * Fix crashes in rb_gc_mark(): 0x00000003f54af8 is T_ZOMBIE / T_NONE
93 * Release Ruby's GVL while calls to FXImage#savePixels, #loadPixels
94 and FXApp#run* methods.
95 * Add a working version for FXApp#addInput event handling on Windows.
96 This works for sockets only for now.
97 * Add FXApp#runOnUiThread and FXId#runOnUiThread .
98 This allows to safely execute GUI code from other threads.
99 * Use rake-compiler-dock for building windows binary gems.
100
101 ## 1.6.29 / 2015-02-17
102
103 * Add Windows binaries for Ruby-2.1 and 2.2.
104 * Use shared libs for Windows binary gems to reduce gem size.
105 * Allow non owned assignment of image data to FXImage derivations
106 without copy'ing pixel data.
107 * Allow retrival of parts of the pixel data.
108 * Fix namespace specifier for FXRGB in kwargs.rb.
109 * Change GC'ing of TreeListBox and FXTreeItem. Fixes #10
110 * Update to swig version 2.0 or newer. Fixes #13
111
112 ## 1.6.28 / 2013-07-05
113
114 * Fix build for Ruby-2.0.0-p127+
115 * Update libraries for win32 build: libfox-1.6.49
116
117 ## 1.6.27 / 2013-04-05
118
119 * Add support for Ruby-2.0.
120 * Add cross compilation for x64-mingw32 target.
121
122 ## 1.6.26 / 2013-02-16
123
124 * Mark all text strings retrieved from fox as UTF-8 when running on Ruby 1.9
125 * Fix loading error on Ruby 1.8.7 by renaming the C++ extension to fox16_c
126 * Update libraries for windows cross compilation
127
128 ## 1.6.25 / 2012-06-17
129
130 * Windows: Fix slow loading of fox16.so by using a more recent mingw-w64 compiler
131 (reported by Allen Doug and Igor Jorobus)
132 * Fix two possible segfaults in conjunction with FXSplashWindow (reported by Igor Jorobus)
133
134 ## 1.6.24 / 2012-06-06
135
136 * Update libraries for win32 build: libz-1.2.7 libpng-1.5.10 libjpeg-8d libtiff-4.0.1 libfox-1.6.45
137 * Avoid Segfauls in lots of methods when called with nil instead of FXApp, FXComposite or FXWindow objects
138
139 ## 1.6.23 / 2012-03-08
140
141 * Add YARD documentation support
142 * Use generated Manifest.txt
143 * Support for parallel task execution with drake
144
145 ## 1.6.22 / 2012-02-21
146
147 * Allow better access to raw pixel data of FXImage and derivatives
148 * Build Windows binary gem per cross compiler on Linux
149 * Add support for Rubinius (currently requires rubinius from git)
150 * Add alias FXApp#modalWindow, as described in rdoc
151 * Add quality parameter to FXJPGImage and FXJPGIcon
152 * Fix invalid memory access in final GC call when using FXMenuCommand with acckey
153 * Fix double referenced foxObj when borrowed object registration is triggered from C++
154 * Fix Segfault while GC'ing FXWindows
155 * Fix 'object allocation not allowed while garbage collection' bug
156 * Fix clipboard handling on windows
157 * Add missing namespace qualifier to FXSEL in FXAccelTable
158 * Fix GC bug in FXAccelTable
159 * Fix double free in FXMemoryStream#giveBuffer
160 * Fix invalid memory access in typemap to zero terminated FXchar* (such as fillItems methods)
161 * Fix FXApp#addInput for Ruby 1.9 on Linux
162 * Fix "ruby_code case not handled: Regexp" issue with newer rubygems
163
164 ## Changes For Version 1.6.20 (November 09, 2009)
165
166 * Integrated the Hoe and rake-compiler extensions into the Rakefile and
167 removed redundant tasks.
168 * Did some work to provide support for MinGW builds.
169 * The previous release of FXRuby couldn't be built from source against Ruby 1.9.1 final
170 due to a change in some of the file-related utility libraries
171 (see RubyForge Bug #23786). This problem has been corrected.
172
173
174 ## Changes For Version 1.6.19 (March 6, 2009)
175
176 * The previous release of FXRuby couldn't be built from source against Ruby 1.9.1 final
177 due to a change in some of the file-related utility libraries
178 (see RubyForge Bug #23786). This problem has been corrected.
179 * The previous release of FXRuby couldn't be built from source against Ruby versions 1.8.5 or
180 earlier (see RubyForge Bug #23967). This problem has been corrected.
181 * A change in the return value for Ruby's `instance_variables` method broke
182 some of the code related to message handling in FXRuby (see RubyForge
183 Bug #23787). This problem has been corrected.
184 * The `addAccel` method for the `FXAccelTable` class
185 now accepts lambda functions (or any other objects that respond to `call`). See
186 the API documentation
187 for `FXAccelTable` for examples of how this works.
188
189
190 ## Changes For Version 1.6.18 (December 29, 2008)
191
192 * Some users were having trouble building FXRuby on 64-bit operating systems
193 (see RubyForge Bug #23375). This problem has been corrected.
194
195
196 ## Changes For Version 1.6.17 (December 24, 2008)
197
198 * The Ruby interpreter was generating a large number of warning messages about redefined methods
199 in the `kwargs.rb` library
200 (see RubyForge
201 Bug #19231 and elsewhere). This problem has been corrected.
202
203 * Due to recent changes in Ruby's garbage collection algorithm, FXRuby applications could under some circumstances
204 crash for large numbers of table items
205 (see RubyForge bugs ).
206 This bug has been fixed.
207
208 * The documentation for the `FXTable` class referred to the non-existent `setColumnX`
209 and `setRowY` instance methods
210 (see RubyForge
211 Bug #21987). These entries have been removed from the documentation.
212
213 * A number of instance methods for the `FXTable` class could crash an application if they
214 were passed out-of-bounds index arguments
215 (see RubyForge
216 Bug #21987). These methods now raise `IndexError` when they're passed out-of-bounds
217 indexes.
218
219 * Due to a change in the URL scheme for the Dilbert web site, the `dilbert.rb` example
220 program was no longer working properly
221 (see RubyForge
222 Bug #21538). This has been fixed.
223
224 * The `lower` method for the `FXRangef` was returning
225 ´self´ instead of an `FXVec3f` instance for the range's low
226 bound
227 (see RubyForge
228 Bug #22488). This has been fixed.
229
230 * Made a number of minor fixes for compatibility with Ruby 1.9.1.
231
232
233 ## Changes For Version 1.6.16 (July 3, 2008)
234
235 * Historically, if you called `create` on a
236 window before its parent window was created, your application would
237 crash (see RubyForge
238 Bug #20702 and elsewhere). Now, the code should raise a
239 ´RuntimeError´ with a message indicating the
240 problem.
241
242 * The message data that the `FXPicker` widget
243 sends along with its ´SEL_CHANGED´ and
244 ´SEL_COMMAND´ messages wasn't being handled
245 properly, and as a result, applications using this widget could crash
246 (see RubyForge
247 Bug #20780). This problem has been fixed.
248
249
250 ## Changes For Version 1.6.15 (June 4, 2008)
251
252 * FXRuby applications could crash (with a segmentation fault) if
253 ´nil´ was passed in as the first argument to
254 `FXDialogBox.new` or
255 `FXMainWindow.new` (see RubyForge
256 Bug #14642). These methods now raise an
257 ´ArgumentError´ if ´nil´ is
258 passed as the first argument.
259
260 * You should only ever construct one `FXApp`
261 object per application, but there was no protection against doing so
262 in the code (see RubyForge
263 Bug #16275). Now, `FXApp.new` will
264 raise a `RuntimeException` if an
265 `FXApp` object already exists.
266
267 * The `babelfish.rb` example program, which
268 previously depended on an external web service to perform translation
269 between languages, was broken since that web service no longer exists
270 (see RubyForge
271 Bug #16962). The example has now been updated to use Dr. Nic's
272 Tranexp library instead.
273
274 * The value of the ´MBOX_SAVE_CANCEL_DONTSAVE´
275 option (for the `FXMessageBox` class) wasn't
276 wrapped properly and was unusable (see RubyForge
277 Bug #17094). There was also no constant corresponding to the
278 ´MBOX_CLICKED_DONTSAVE´ return value. Both of these
279 problems have been fixed.
280
281 * The fields for new `FXHiliteStyle` objects
282 were uninitialized and as a result sometimes gave unpredictable
283 results (see RubyForge
284 Bug #19637). This has been fixed.
285
286 * The `columnHeaderFont` and
287 `rowHeaderFont` attributes for
288 `FXTable` weren't implemented properly (see
289 RubyForge
290 Bug #20142). This has been fixed.
291
292 * Ruby 1.8.7 adds a new `first` method to
293 the `Enumerable` module, and this conflicts with
294 the existing `first` method defined in the
295 `FXWindow` base class for a number of FXRuby
296 classes which mix in `Enumerable` (see RubyForge
297 Bug #20418). This problem has been resolved.
298
299 * Due to a bug in the `extconf.rb` script, the
300 build was failing for Ruby 1.9.0 (see RubyForge
301 Bug #20426). This has been fixed.
302
303
304 ## Changes For Version 1.6.14 (March 29, 2008)
305
306 * Updated the documentation for the `FXImage`
307 class to indicate which methods call `render`
308 after they're finished, and which ones do not.
309
310 * Corrected a little typo in the
311 `gembrowser.rb` example program.
312
313 * Updated the `dilbert.rb` example program to
314 use the more popular-and-likely-to-be-installed Hpricot HTML
315 parser library instead of Rubyful Soup.
316
317 * Re-added the documentation for the
318 ´TOGGLEBUTTON_KEEPSTATE´ option, which had
319 mysteriously disappeared (see RubyForge
320 Bug #2286).
321
322 * Made a number of minor fixes to support building FXRuby against
323 Ruby 1.9.
324
325 * Added a binary gem for OS X. This works with the Ruby that's
326 included with OS X (Leopard).
327
328 * The binary gem for Windows was built with FOX version 1.6.32 and
329 FXScintilla version 1.71.
330
331
332 ## Changes For Version 1.6.13 (November 9, 2007)
333
334 * Calls to the `extractText` method for the
335 `FXTable` class were causing various
336 memory-related errors on certain platforms (see RubyForge
337 Bug #15444). This problem has been fixed.
338
339 * The binary gem for Windows was built with FOX version 1.6.28 and
340 FXScintilla version 1.71.
341
342 ## Changes For Version 1.6.12 (October 19, 2007)
343
344 * The API documentation for `FXMDIClient`
345 referred to the non-existent instance method
346 `activeChild=` (see RubyForge
347 Bug #10259). This method has been added.
348
349 * The API documentation for `FXMDIClient`
350 also referred to the non-existent instance methods
351 `getMDIChildFirst` and
352 `getMDIChildLast`. These entries have been
353 removed.
354
355 * The API documentation for `FXMDIChild`
356 referred to non-existent instance methods
357 `getMDINext` and
358 `getMDIPrev` (see RubyForge
359 Bug #10436). The documentation has been corrected.
360
361 * Added the ´:repeat´ parameter for the
362 `addChore` and
363 `addTimeout` methods. See the documentation for
364 more details, and `gltest.rb` for an example of its
365 use.
366
367 * Corrected a number of minor typos in the API
368 documentation.
369
370 * Corrected a typo in the `imageviewer.rb`
371 example.
372
373 * Modified the `inputs.rb` example program to
374 use `Pipe.read_nonblock()` instead of
375 `Pipe.read()`.
376
377 * Fixed a bug in the implementation of the
378 `findText` method for the
379 `FXText` class, when used with the
380 ´SEARCH_REGEX´ option.
381
382 * The binary gem for Windows was built with FOX version 1.6.28 and
383 FXScintilla version 1.71.
384
385
386 ## Changes For Version 1.6.11 (April 18, 2007)
387
388 * Added `editable` as an alias for
389 `FXTextField#editable?`.
390
391 * Added `each_child_recursive` instance
392 method for the `FXWindow` class. This method
393 performs a depth-first traversal of the widget tree starting at the
394 receiver window.
395
396 * Corrected some errors in the keyword arguments support for the
397 `FXVec2d`, `FXVec2f`,
398 `FXVec3d`, `FVec3f`,
399 `FXVec4d` and `FXVec4f`
400 classes.
401
402 * Corrected an error in the keyword arguments support for the
403 `FXIconDict` class.
404
405 * Modified the gem specification so that the RDoc generated during
406 a gem install is consistent with that generated by other methods (see
407 RubyForge
408 Bug #10035).
409
410 * Changes to the `iterators` library in version
411 1.6.6 introduced a bug in the `each` method for
412 the `FXFoldingList`,
413 `FXTreeList` and
414 `FXTreeListBox` classes (see RubyForge
415 Bug #10175). This problem has been fixed.
416
417 * Applied submitted patches for building FXRuby against Ruby 1.9
418 (see RubyForge
419 Bug #10181). Please note that building FXRuby against the Ruby
420 1.9 code base is still officially unsupported; however, I'm glad to
421 accept patches that will help make this possible.
422
423 * The binary gem for Windows was built with FOX version 1.6.25 and
424 FXScintilla version 1.71.
425
426
427 ## Changes For Version 1.6.9 (April 8, 2007)
428
429 * A bug was discovered in the keyword arguments library support
430 for the `FXMenuBar` class (see RubyForge
431 Bug #9927). This problem has been fixed.
432
433 * The binary gem for Windows was built with FOX version 1.6.25 and
434 FXScintilla version 1.71.
435
436
437 ## Changes For Version 1.6.8 (April 5, 2007)
438
439 * Due to an internal bookkeeping error, applications like the
440 `glviewer.rb` example program which create multiple
441 `FXGLViewer` instances could cause an assertion
442 to fail. When this assertion fails on Windows, the program simply
443 crashes (see RubyForge
444 Bug #9775). This problem has been fixed.
445
446 * The keyword arguments library, introduced in version 1.6.5, is
447 now included automatically when you load FXRuby; it is no longer
448 necessary to explicitly require it.
449
450 * The binary gem for Windows was built with FOX version 1.6.25 and
451 FXScintilla version 1.71.
452
453
454 ## Changes For Version 1.6.7 (March 31, 2007)
455
456 * The binary gem for Windows was built with FOX version 1.6.25 and
457 FXScintilla version 1.71.
458
459
460 ## Changes For Version 1.6.6 (February 10, 2007)
461
462 * Somewhere along the way, the RAA browser example program got
463 broken due to changes in the SOAP interface to RAA (see RubyForge
464 Bug #7977). This has been fixed.
465
466 * Some debugging code that was meant to detect errors in FXRuby
467 message data conversion was inadvertently causing some user
468 applications to crash when running under Windows (see RubyForge
469 Bug #8049). This debugging code has been changed to avoid the
470 problem.
471
472 * Modified the implementations of the each iterator methods for
473 `FXFoldingList`,
474 `FXFoldingItem`,
475 `FXTreeItem`, `FXTreeList`
476 and `FXTreeListBox` (see RubyForge
477 Bug #8090). The new implementation is a bit more robust in
478 terms of modifications (such as deletion) of the iterated-over
479 elements.
480
481 * A bug in the new keyword arguments library (introduced in
482 version 1.6.5) caused the `initialize` method
483 for the `FXDCWindow` class to do the wrong thing
484 (see RubyForge
485 Bug #8441). This has been corrected.
486
487 * A different bug in the keyword arguments library caused the
488 `initialize` method for the
489 `FXFont` class to do the wrong thing (see RubyForge
490 Bug #8517). This also has been corrected.
491
492 * Yet another bug in the keyword arguments library broke the part
493 of the code that used to yield ´self´ to an
494 optional block attached to the call to `new`
495 (see RubyForge
496 Bug #8518). This has been corrected.
497
498 * Most of the FXRuby example programs have been updated to use the
499 keyword arguments library.
500
501 * Added a new "virtual" keyword argument
502 ´:padding´ that can be used in place of (or in
503 addition to) the ´:padLeft´,
504 ´:padRight´, ´:padTop´ and
505 ´:padBottom´ arguments for a constructor. When a
506 ´:padding´ value is passed in to the arguments
507 hash, that value will be used for any of the four regular padding
508 values that aren't otherwise specified. See the example programs for,
509 you know, examples.
510
511 * The binary gem for Windows was built with FOX version 1.6.20 and
512 FXScintilla version 1.71.
513
514
515 ## Changes For Version 1.6.5 (January 20, 2007)
516
517 * Clicking outside of the visible cells for an
518 `FXTable` when there was no current selection
519 caused the code to raise an exception (see RubyForge
520 Bug #5907). This problem has been fixed.
521
522 * The `hasTimeout?` method for the
523 `FXApp` class was implemented incorrectly (see
524 RubyForge
525 Bug #7564). This problem has been fixed.
526
527 * The `FXFoldingList` and
528 `FXFoldingItem` classes did not have each
529 iterator methods like most of the other list-based widgets (see RubyForge
530 Patch #7978). These have been added.
531
532 * The API documentation for `FXMDIClient`
533 claimed that `FXScrollArea` was its base class
534 (see RubyForge
535 Bug #7979). This has been corrected; the base class for
536 `FXMDIClient` is
537 `FXComposite`.
538
539 * There was a small typo in the documentation for the
540 `FXFoldingList` class options (see RubyForge
541 Bug #7981). This has been fixed.
542
543 * Added preliminary support for keyword-style arguments, as
544 described in the "Differences Between
545 FOX and FXRuby" section of the FXRuby User's Guide.
546
547 * The binary gem for Windows was built with FOX version 1.6.20 and
548 FXScintilla version 1.71.
549
550
551 ## Changes For Version 1.6.4 (November 30, 2006)
552
553 * A change made in Ruby 1.8.5 for cyclic requires led to a problem
554 that caused the Ruby interpreter to emit a large number of warnings
555 (see RubyForge
556 Bug #5633). This problem has been fixed.
557
558 * The binary gem for Windows was built with FOX version 1.6.16 and
559 FXScintilla version 1.71.
560
561
562 ## Changes For Version 1.6.3 (October 27, 2006)
563
564 * Widgets of some classes (namely
565 `FXTopWindow` and
566 `FXMDIChild`) weren't properly sending a
567 ´SEL_CLOSE´ message to their message targets (see
568 RubyForge
569 Bug #5498). Thanks to a change in FOX version 1.6.16, this
570 problem has been fixed.
571
572 * The `getControlFor` method for the
573 `FXComboTableItem` class was coded incorrectly
574 (see RubyForge
575 Bug #5906). This has been fixed.
576
577 * There was a minor typo in the API documentation for the
578 `FXTriStateButton` class (see RubyForge Bug #5962). This has been fixed.
579
580 * The `each_row` and
581 `each_column` iterator methods for the
582 `FXTable` class were incorrectly coded (see
583 RubyForge
584 Bug #6036). This has been fixed.
585
586 * The `new` class methods for
587 `FXColorItem`, `FXDirItem`,
588 `FXFileItem`,
589 `FXFoldingItem`,
590 `FXHeaderItem`,
591 `FXIconItem`, `FXListItem`
592 and `FXTreeItem` were all raising exceptions when
593 a non-´nil´ value was passed in for the last
594 argument (see RubyForge
595 Bug #6197). A similar problem was present for various instance
596 methods in the `FXColorList`,
597 `FXListBox` and
598 `FXMDIClient` classes. These problems have been
599 fixed.
600
601 * A few problems were discovered for the
602 `inputs.rb` example program (see RubyForge
603 Bug #6209). These problems have been fixed.
604
605 * Several instance methods for the `FXTable`
606 class were not actually present under their documented names (see
607 RubyForge
608 Bug #6211). This has been fixed.
609
610 * The build script was not compatible with changes made in the
611 recently-released FXScintilla 1.71 (see RubyForge
612 Bug #6313). This has been fixed.
613
614 * The binary gem for Windows was built with FOX version 1.6.16 and
615 FXScintilla version 1.71.
616
617
618 ## Changes For Version 1.6.2 (September 13, 2006)
619
620 * The `expandTree()` and
621 `collapseTree()` methods for the
622 `FXFoldingList` class were incorrectly identified
623 as `expandFolding()` and
624 `collapseFolding()` in the API documentation
625 (see RubyForge
626 Bug #5354). This has been fixed.
627
628 * The `FXDockTitle` class was not supported
629 (see RubyForge
630 Bug #5632). This has been fixed.
631
632 * The API documentation for the `FXGLCanvas`
633 class claimed it had a `shared?` method, but it
634 didn't (see RubyForge
635 Bug #5591). Now it does.
636
637 * The `FXGradientBar` class was not supported
638 (see RubyForge
639 Bug #5746). This has been fixed.
640
641 * The binary gem for Windows was built with FOX version 1.6.14 and
642 FXScintilla version 1.67 (from CVS).
643
644
645 ## Changes For Version 1.4.7 (September 13, 2006)
646
647 * The `children` instance method for the
648 `FXWindow` class always returned an array of
649 `FXWindow` instances, even if the actual types
650 should have been instances of subclasses of
651 `FXWindow` (see RubyForge
652 Bug #4342). This has been fixed.
653
654 * The `dilbert.rb` example program was broken
655 due to a change in the Dilbert.com web site structure (see RubyForge
656 Bug #4597). This has been fixed.
657
658 * The `expandTree()` and
659 `collapseTree()` methods for the
660 `FXFoldingList` class were incorrectly identified
661 as `expandFolding()` and
662 `collapseFolding()` in the API documentation
663 (see RubyForge
664 Bug #5354). This has been fixed.
665
666 * The `FXDockTitle` class was not supported
667 (see RubyForge
668 Bug #5632). This has been fixed.
669
670 * The API documentation for the `FXGLCanvas`
671 class claimed it had a `shared?` method, but it
672 didn't (see RubyForge
673 Bug #5591). Now it does.
674
675 * The `FXGradientBar` class was not supported
676 (see RubyForge
677 Bug #5746). This has been fixed.
678
679 * The binary gem for Windows was built with FOX version 1.4.34 and
680 FXScintilla version 1.63.
681
682
683 ## Changes For Version 1.6.1 (July 21, 2006)
684
685 * The message data sent along for the
686 ´SEL_INSERTED´, ´SEL_DELETED´
687 and ´SEL_REPLACED´ messages from an a
688 `FXText` widget to its target was not being
689 converted properly (see RubyForge
690 Bug #4666). This has been fixed.
691
692 * The code related to the localization of application messages in
693 FOX wasn't implemented properly in FXRuby, and as a result,
694 constructing certain dialogs (like the color dialog) could cause a
695 program to crash (see RubyForge
696 Bug #5000). This has been fixed.
697
698 * The "Stop Spin" button in the gltest.rb example program didn't
699 stop the cubes from spinning after either the "Spin Timer" or "Spin
700 Chore" option was selected (see RubyForge
701 Bug #5001). This was actually a symptom of a larger problem,
702 that FXRuby wasn't properly handling timers and chores. These problems
703 have been fixed.
704
705 * Setting the current item for an
706 `FXComboBox` to -1 (to indicate that there's no
707 current item) would cause FXRuby to erroneously raise an
708 `IndexError` (see RubyForge
709 Bug #5007). This has been fixed.
710
711 * The documentation for the `reparent`
712 instance method for the `FXWindow` class was
713 incorrect (see RubyForge
714 Bug #5035). This has been fixed.
715
716 * The `textedit.rb` example program was not up
717 to date with some of the changes for FOX 1.6. This example has been
718 updated.
719
720 * The new `font` method for the
721 `FXFont` class was not documented. This has been
722 fixed.
723
724 * The `dilbert.rb` example program has been
725 modified to use the RubyfulSoup HTML library instead of the
726 html-parser library.
727
728 * As discussed in various forums (see for example [this
729 post](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/182827), the `autorequire` directive for
730 RubyGems specifications is now deprecated. As a result, this has been
731 removed from the FXRuby gem specification. This change will break any
732 code that was using a statement like:´require_gem 'fxruby'´as
733 the sole means for loading FXRuby. Such programs should instead
734 use:´require 'fox16'´which will work
735 for either gem based or non-gem based installations.
736
737 * The binary gem for Windows was built with FOX version 1.6.8 and
738 FXScintilla version 1.67 (from CVS).
739
740
741 ## Changes For Version 1.6.0 (May 29, 2006)
742
743 * This is the first release of FXRuby compatible with FOX version
744 1.6. One of the most signficant changes for FOX 1.6 has been the
745 addition of Unicode support; all FOX widgets and internal string
746 processing routines are now Unicode aware. For a comprehensive
747 overview of the changes made to FOX since version 1.4 (including those
748 made in the FOX 1.5 development series), please refer to the
749 [News archives](http://www.fox-toolkit.com/news.html) at
750 the FOX web site.
751
752 * Added the `allowSide`,
753 `disallowSide` and
754 `allowedSide?` methods for the
755 `FXDockBar` class, as complements to the
756 `allowedSides` accessor methods (see RubyForge
757 Feature Request #2307).
758
759 * Added the `visible=` and
760 `visible?` accessor methods for the
761 `FXWindow` class, as complements to the
762 `show`, `hide` and
763 `shown?` methods (see RubyForge
764 Feature Request #3579).
765
766 * The `browser.rb` example was making use of a
767 deprecated API (see RubyForge
768 Bug #4325). This has been fixed.
769
770 * The `children` instance method for the
771 `FXWindow` class always returned an array of
772 `FXWindow` instances, even if the actual types
773 should have been instances of subclasses of
774 `FXWindow` (see RubyForge
775 Bug #4342). This has been fixed.
776
777 * The `dilbert.rb` example program was broken
778 due to a change in the Dilbert.com web site structure (see RubyForge
779 Bug #4597). This has been fixed.
780
781 * The binary gem for Windows was built with FOX version 1.6.5 and
782 FXScintilla version 1.67 (from CVS).
783
784
785 ## Changes For Version 1.4.6 (April 26, 2006)
786
787 * FXRuby would not compile properly on some x86-64 systems (see
788 RubyForge
789 Bug #3729). This error has been corrected. Thanks to Javier
790 Goizueta for initially reporting this problem, and especially to
791 Tobias Peters for providing a patch.
792
793 * The `FXIconDict` widget was accidentally
794 "lost" in the transition between FXRuby versions 1.2 and 1.4 (see
795 RubyForge
796 Bug #4117). This error has been corrected. Thanks to Manfred
797 Usselmann for reporting this problem.
798
799 * The `FXSwitcher` widget was not sending the
800 appropriate message data to its message target for the
801 ´SEL_COMMAND´ message type (see RubyForge
802 Bug #4157). This error has been corrected. Thanks to Manfred
803 Usselmann for reporting this problem.
804
805 * The `FXSeparator` class wasn't implemented
806 properly (see RubyForge
807 Bug #4158). This error has been corrected. Thanks to Gerard
808 Menochet for reporting this problem.
809
810 * The `findItemByData` method was
811 implemented incorrectly for the `FXComboBox`,
812 `FXFoldingList`,
813 `FXIconList`, `FXList` and
814 `FXListBox` classes (see RubyForge
815 Bug #4172). This error has been corrected. Thanks to Gerard
816 Menochet for reporting this problem.
817
818 * The `FXListBox` widget was not sending the
819 appropriate message data to its message target for the
820 ´SEL_COMMAND´ message type (see RubyForge
821 Bug #4255). This error has been corrected. Thanks to Gerard
822 Menochet for reporting this problem.
823
824 * The binary gem for Windows was built with FOX version 1.4.29 and
825 FXScintilla version 1.63.
826
827
828 ## Changes For Version 1.4.5 (April 10, 2006)
829
830 * The `FXTextField` class was not properly
831 responding to the ´ID_INSERT_STRING´ command (see
832 RubyForge
833 Bug #3320). This error has been corrected. Thanks to Uwe Hartl
834 for reporting this problem.
835
836 * The `text` and
837 `getText` methods for the
838 `FXMenuCaption` class were returning
839 ´nil´ instead of the actual value (see RubyForge
840 Bug #3458). This error has been corrected. Thanks to Meinrad
841 Recheis (Henon) for reporting this problem.
842
843 * The API documentation for the `FXMDIChild`
844 class erroneously listed ´SEL_CLOSEALL´ as one of
845 the message types that an MDI child window might send to its message
846 target (see RubyForge
847 Bug #3508). This error has been corrected. Thanks to Meinrad
848 Recheis (Henon) for reporting this problem.
849
850 * Calling the `selectRange` method for
851 class `FXTable` would cause a fatal error instead
852 of merely raising an `IndexError` exception (see
853 RubyForge
854 Bug #3615). This error has been corrected. Thanks to Meinrad
855 Recheis (Henon) for reporting this problem.
856
857 * Due to an error in the SWIG interface files, the
858 `FXChoiceBox` class was basically unusable (see
859 RubyForge
860 Bug #3676). This error has been corrected. Thanks to Uwe Hartl
861 for reporting this problem.
862
863 * The API documentation for the
864 `FXRealSlider` and
865 `FXRealSpinner` classes erroneously claimed that
866 the message data for the ´SEL_COMMAND´ and
867 ´SEL_CHANGED´ messages sent by these widgets to
868 their targets were integers (see RubyForge
869 Bug #3749). Along the same lines, the message data for those
870 widgets wasn't being converted correctly (see RubyForge
871 Bug #3750). Both of these errors have been corrected. Thanks
872 to Meinrad Recheis (Henon) for reporting these problems.
873
874 * The API documentation for the Fox module incorrectly listed the
875 names of the `FXSELTYPE` and
876 `FXSELID` methods as
877 `SELTYPE` and `SELID`
878 (see RubyForge
879 Bug #3940). This error has been corrected. Thanks to Joel
880 VanderWerf for reporting this problem.
881
882 * The `FXTableItem` constructor was supposed
883 to (optionally) accept a reference to an arbitrary Ruby object as its
884 third argument, but this wasn't working properly (see RubyForge
885 Bug #4005). This error has been corrected. Thanks to Mark
886 Volkman for reporting this problem.
887
888 * The binary gem for Windows was built with FOX version 1.4.29 and
889 FXScintilla version 1.63.
890
891
892 ## Changes For Version 1.4.4 (January 21, 2006)
893
894 * The build instructions for Unix platforms had not been updated
895 recently and as such contained some errors (see RubyForge
896 Bug #3014). These errors have been corrected. Thanks to Dave
897 Burns for reporting this problem.
898
899 * The `extendSelection` method for the
900 `FXTable` class was raising an exception if an
901 out of bounds row or column index was passed in (see RubyForge
902 Bug #3050). This has been changed so that
903 `extendSelection` instead returns false for out
904 of bounds arguments. Thanks to Leonid Moiseichuk for reporting this
905 problem.
906
907 * The `each_child` iterator method for the
908 `FXWindow` class would fail if the child window
909 was destroyed in the block (see RubyForge
910 Bug #3134). Thanks to Liam Irish for reporting this problem
911 and providing a patch.
912
913 * The message data for the ´SEL_REPLACED´
914 message sent by the `FXTable` class to its target
915 was not being handled properly (see RubyForge
916 Bug #3244). There were also problems with the message data for
917 the ´SEL_SELECTED´ and
918 ´SEL_DESELECTED´ messages. Furthermore, the
919 ´SEL_REPLACED´ message was not documented in the
920 RDoc documentation for the `FXTable` class. All
921 of these problems have been corrected. Thanks to _blackdog for
922 reporting this problem.
923
924 * The binary gem for Windows was built with FOX version 1.4.29 and
925 FXScintilla version 1.63.
926
927
928 ## Changes For Version 1.4.3 (November 7, 2005)
929
930 * The ´TOGGLEBUTTON_KEEPSTATE´ option for the
931 `FXToggleButton` class was not documented (see
932 RubyForge
933 Bug #2286). This oversight has been corrected. Thanks to Tim
934 Smith for reporting this problem.
935
936 * The `scintilla.rb` library file was not up to
937 date with the latest FXScintilla release, and as a result it was
938 missing some methods (see RubyForge
939 Bug #2479). This oversight has been corrected. Thanks to Maxim
940 Kulkin for reporting this problem.
941
942 * Due to changes in the APIs for timers and chores, the mechanisms
943 for removing chores and timeouts were broken (see RubyForge
944 Bug #2563). This bug has been fixed. Thanks to "moinker" for
945 reporting this problem.
946
947 * An error in the test setup caused all of the tests for the
948 `FXList` class to fail (see RubyForge
949 Bug #2564). This bug has been fixed. Thanks to Peter for
950 reporting this problem.
951
952 * Due to a bug in the test suite runner script, not all test cases
953 were being exercised (see RubyForge
954 Bug #2565). This bug has been fixed.
955
956 * Calling the `getPixel` method for the
957 `FXImage` class when the client-side pixel buffer
958 for the image has already been released would cause a program to crash
959 (see RubyForge
960 Bug #2611). Now, `getPixel` will raise
961 an exception if it's called after the pixel buffer has been released.
962 The documentation for `getPixel` has been
963 updated accordingly. Thanks to Gonzalo Garramuno for reporting this
964 problem.
965
966 * The `makePositionVisible` method for the
967 `FXTable` class was raising an exception when
968 passed out-of-bounds values for the row or column index (see RubyForge
969 Bug #2660). This could happen, for example, if you were to
970 click in a table area outside of the regular cells (which indirectly
971 triggers a call to `makePositionVisible`). This
972 was actually inconsistent with standard FOX behavior, which simply
973 ignores out of bounds values for that method's arguments. This bug has
974 been fixed, and the documentation for
975 `makePositionVisible` has been updated
976 accordingly. Thanks to Ralf Jonas for reporting this problem.
977
978 * The binary gem for Windows was built with FOX version 1.4.21 and
979 FXScintilla version 1.63.
980
981
982 ## Changes For Version 1.4.2 (August 22, 2005)
983
984 * Due to a bug in the implementation, the
985 `checked?` method for the
986 `FXCheckButton` class always returned
987 ´false´ (see RubyForge
988 Bug #1852). This bug has been fixed. Thanks to Meinrad Recheis
989 for reporting this problem.
990
991 * The API documentation for the `FXTable`
992 class listed several obsolete attributes (see RubyForge
993 Bug #1928). Those errors have been corrected. Thanks to Pavel
994 Sokolov for reporting these problems.
995
996 * There were a number of bugs in the
997 `textedit.rb` example program (see RubyForge
998 Bug #1979), and those bugs have been fixed. Thanks to Claude
999 Marinier for reporting these problems.
1000
1001 * The API documentation for the `FXTreeList`
1002 class' `new` method still showed the number of
1003 visible items (´nvis´) as its second argument
1004 (see RubyForge
1005 Bug #2171). This problem has been corrected. Thanks to Bill
1006 Atkins for reporting this problem.
1007
1008 * The API documentation for the `FXTopWindow`
1009 class had a number of errors (see RubyForge
1010 Bug #2269). This problem has been corrected.
1011
1012 * The API documentation for the `FXTreeList`
1013 class still listed the obsolete `reparentItem`
1014 method (see RubyForge
1015 Bug #2270). This problem has been corrected. Thanks to Jacob
1016 Hansen for reporting this problem.
1017
1018 * Due to a bug in how the SWIG typemaps for the
1019 ´FXlong´ type were defined, some methods for the
1020 `FXFileStream` class were broken (see RubyForge
1021 Bug #2275). This problem has been corrected. Thanks to Gonzalo
1022 Garramuno for reporting this problem.
1023
1024 * Merged in all of the fixes for FXRuby 1.2.6.
1025
1026 * The binary gem for Windows was built with FOX version 1.4.17 and
1027 FXScintilla version 1.63.
1028
1029
1030 ## Changes For Version 1.4.1 (August 20, 2005)
1031
1032 * This is the second release of FXRuby which is compatible with
1033 FOX 1.4, and as such should be considered an "unstable" release. For a
1034 history of the changes made during the FOX 1.3 and 1.4 development,
1035 see the [News](http://www.fox-toolkit.com/news.html)
1036 page at the FOX Web site.
1037
1038 * The unit tests (in the `tests` subdirectory)
1039 had not been updated to require the ´fox14´
1040 feature, and were still looking at ´fox12´. This
1041 has been corrected.
1042
1043 * A number of minor problems were corrected for the Windows build
1044 of FXRuby.
1045
1046 * The binary gem for Windows was built with FOX version 1.4.17 and
1047 FXScintilla version 1.63.
1048
1049
1050 ## Changes For Version 1.4.0 (August 19, 2005)
1051
1052 * This is the first release of FXRuby which is compatible with FOX
1053 1.4, and as such should be considered an "unstable" release. For a
1054 history of the changes made during the FOX 1.3 and 1.4 development,
1055 see the [News](http://www.fox-toolkit.com/news.html)
1056 page at the FOX Web site.
1057
1058
1059 ## Changes For Version 1.2.6 (April 15, 2005)
1060
1061 * Some additional problems related to calling the
1062 `setTableSize` method for an
1063 `FXTable` were discovered (see RubyForge
1064 Bug #1597). This problem has been corrected. Thanks to Joel
1065 VanderWerf for reporting this problem.
1066
1067 * The `iconlist.rb` example program had a
1068 "Sort" pulldown menu filled with a number of commands that didn't
1069 really do anything, including sorting the items (see RubyForge
1070 Bug #1654). This pulldown menu has been removed from that
1071 example.
1072
1073 * The API documentation for the `FXDC` class
1074 erroneously referred to the `font` attribute as
1075 `textFont` (see RubyForge
1076 Bug #1667). This problem has been corrected. Thanks to Meinrad
1077 Recheis for reporting this problem.
1078
1079 * The `checked?`,
1080 `unchecked?` and
1081 `maybe?` methods for the
1082 `FXMenuCheck` class were missing (see RubyForge
1083 Bug #1677). This problem has been corrected. Thanks to Oliver
1084 Smith for reporting this problem.
1085
1086 * The API documentation for the
1087 `FXScrollArea` class incorrectly spelled the
1088 names of the `horizontalScrollBar` and
1089 `verticalScrollBar` methods as
1090 `horizontalScrollbar` and
1091 `verticalScrollbar` (see RubyForge
1092 Bug #1678). The documentation has been corrected. Thanks to
1093 Jannis Pohlmann for reporting this mistake.
1094
1095 * Some code in the `groupbox.rb` example
1096 program was calling the `getRootWindow` method,
1097 but that method has been renamed to `getRoot`
1098 (see RubyForge
1099 Bug #1692). This problem has been corrected. Thanks to
1100 Jaroslav Stika for reporting this problem.
1101
1102 * The `hasChar?` method for the
1103 `FXFont` class was spelled without a trailing
1104 question mark, but it seems more Ruby-like that it should, so we've
1105 added an alias for that (see RubyForge
1106 Bug #1714). This method also now accepts a string of size 1
1107 (i.e. a single character) as its input, as an alternative to an
1108 ordinal value. Thanks to Meinrad Recheis for these suggestions.
1109
1110 * The API documentation for the `FXImage`
1111 class mistakenly listed ´IMAGE_ALPHA´ as a valid
1112 image rendering hint, but this flag is no longer needed since FOX
1113 images now always contain an alpha channel (see RubyForge
1114 Bug #1715). The documentation has been corrected. Thanks to
1115 Meinrad Recheis for reporting this mistake.
1116
1117 * Due to an error in the SWIG interface files, the
1118 `data` method for the
1119 `FXSettings` class was not being wrapped
1120 properly. As a result, this method was unavailable and in turn led to
1121 other dependent methods (like `each_section`)
1122 to be unavailable as well (see RubyForge
1123 Bug #1771). This error has been corrected. Thanks to Jannis
1124 Pohlmann for reporting this problem.
1125
1126 * The binary gem for Windows was built with FOX version 1.2.16 and
1127 FXScintilla version 1.62.
1128
1129
1130 ## Changes For Version 1.2.5 (March 1, 2005)
1131
1132 * The change made for FXRuby version 1.2.4 regarding garbage
1133 collection for table items corrected only one of the problems
1134 described in RubyForge
1135 Bug #1445; There was still a problem related to the
1136 "destructive" effects of the `setTableSize`
1137 method for the `FXTable` class. This problem has
1138 now been corrected as well. Thanks to David Peoples, Jamey Cribbs and
1139 Joel VanderWerf for their assistance in helping me to track down this
1140 problem.
1141
1142 * The `extractText` and
1143 `overlayText` methods for the
1144 `FXTable` class were implemented incorrectly and
1145 weren't listed in the API documentation. These problems have been
1146 corrected.
1147
1148 * The checks for out-of-bounds indices in the
1149 `getColumnX`,
1150 `setColumnX`, `getRowY`,
1151 `setRowY` and
1152 `updateRange` methods for the
1153 `FXTable` class were incorrect. These have been
1154 fixed.
1155
1156 * The `setTableSize` method for the
1157 `FXTable` class now raises
1158 `ArgError` if either the number of rows or
1159 columns passed in as arguments is less than zero.
1160
1161 * A typo in one of the source files was causing the build to fail
1162 when compiled against Ruby versions 1.8.1 or earlier (see RubyForge
1163 Bug #1551). This error has been corrected. Thanks to Alex
1164 McGuire for reporting this problem.
1165
1166 * The `selectItem` method for the
1167 `FXTable` class was removed in FOX 1.2, so we've
1168 added a convenience method for this that just calls the
1169 `selectRange` method under the hood (see RubyForge
1170 Bug #1562). Thanks to Joel VanderWerf for this
1171 suggestion.
1172
1173 * The binary gem for Windows was built with FOX version 1.2.13 and
1174 FXScintilla version 1.62.
1175
1176
1177 ## Changes For Version 1.2.4 (February 23, 2005)
1178
1179 * Due to a change in some of the internal Ruby C APIs, a
1180 compile-time error for FXRuby was introduced in some of the Ruby 1.8.2
1181 preview releases (see RubyForge
1182 Bug #1039). One should not see any compile-time errors when
1183 compiling FXRuby (versions 1.2.3 or later) against the Ruby 1.8.2
1184 final release, but I've neverthless made a change to how those
1185 internal APIs are used, to avoid any potential problems. Thanks to the
1186 many users who pointed out this problem.
1187
1188 * Joel VanderWerf suggested some enhancements to the
1189 `image.rb` example program in order to improve its
1190 startup time (see RubyForge
1191 Bug #1281). Those changes have been incorporated. Thanks to
1192 Joel for this suggestion.
1193
1194 * One change for the `FXImage` class between
1195 FOX versions 1.0 and 1.2 is the nature of the pixel buffer that's
1196 passed to the `FXImage` constructor. Previously,
1197 this pixel buffer was expected to be a string of bytes; now it's
1198 expected to be an array of ´FXColor´ values. This
1199 modification was not implemented correctly for FXRuby versions 1.2.3
1200 and earlier (see RubyForge
1201 Bug #1427). This bug has been corrected, and the example
1202 program (`image.rb`) and test cases have been
1203 updated as well. Thanks to Oliver Smith and others for reporting this
1204 problem.
1205
1206 * A couple of different problems, reported by Patrick Fernie and
1207 David Peoples, exposed a flaw in how FXRuby manages the links between
1208 FOX objects and their Ruby peers when the FOX objects are destroyed
1209 (see RubyForge
1210 Bug #1445). Without going into all the gory details, let's
1211 just say that since we have no explicit control over when Ruby's
1212 garbage collector decides to "collect" those Ruby peers that point to
1213 C++ objects that have been destroyed, we need to take steps to
1214 neutralize those Ruby peer objects so that they can't cause your
1215 application to crash in the meantime; I've implemented a fix to take
1216 care of this situation. Thanks to Patrick and David for reporting
1217 these problems.
1218
1219 * The API documentation for FXRuby 1.2 still contained references
1220 to the old "spellings" of the `fxparseAccel`
1221 and `fxparseHotKey` method names, which were
1222 all lowercase (i.e. `fxparseaccel` and
1223 `fxparsehotkey`). (see RubyForge
1224 Bug #1470). These errors have been corrected.
1225
1226 * Added the `FXScrollArea#scrollCorner`
1227 method, which returns a reference to the scroll corner for any window
1228 derived from `FXScrollArea` (see RubyForge
1229 Feature Request #1226). Thanks to Brian Sheehan for this
1230 suggestion.
1231
1232 * Added the `FXMemoryBuffer#to_a` method,
1233 which is just an alias for the `data` accessor
1234 method that returns a copy of the data buffer as an array (see RubyForge
1235 Feature Request #1295). Thanks to Meinrad Recheis for this
1236 suggestion.
1237
1238 * Added the `appendRows` and
1239 `appendColumns` methods to the
1240 `FXTable` class (see RubyForge
1241 Feature Request #1295). Thanks to Brett Hallett for this
1242 suggestion.
1243
1244 * The binary gem for Windows was built with FOX version 1.2.13 and
1245 FXScintilla version 1.62.
1246
1247
1248 ## Changes For Version 1.2.3 (January 22, 2005)
1249
1250 * Since group boxes containing radio buttons no longer enforce the
1251 radio behavior of radio buttons (i.e. keeping only one radio button
1252 selected at a time), some of the example programs were no longer
1253 working as desired (see RubyForge
1254 Bug #751 and RubyForge
1255 Bug #1280). This problem has been corrected. Thanks to Yuri
1256 Leikind and Barry DeZonia for reporting this problem.
1257
1258 * Bob Sidebotham reported a little typo in the
1259 `table.rb` example program (see RubyForge
1260 Bug #990). This has been corrected.
1261
1262 * The API documentation for `FXList` did not
1263 reflect the changes for FOX 1.2; the
1264 `retrieveItem()` has been renamed to
1265 `getItem()` and
1266 `insertItem()` has been renamed to
1267 `setItem()` (see RubyForge
1268 Bug #1037 and RubyForge
1269 Bug #1257). This has been corrected. Thanks to Remy Drouilhet
1270 and Stephan Kamper for reporting this problem.
1271
1272 * The Windows installer was missing some of the documentation
1273 files (see RubyForge
1274 Bug #1139). This has been corrected. Thanks to Curt Hibbs and
1275 Mark Smith for reporting this problem.
1276
1277 * The `browser.rb` example program was broken
1278 (see RubyForge
1279 Bug #1146). This has been corrected. Thanks to Stefan Lang for
1280 reporting this problem.
1281
1282 * The attribute setter for
1283 `FXHeaderItem#justification` was defined
1284 incorrectly (see RubyForge
1285 Bug #1276). This has been corrected. Thanks to Joel VanderWerf
1286 for reporting this problem (and providing a patch to fix it).
1287
1288 * The `filenames` alias for the
1289 `FXFileDialog#getFilenames()` instance method
1290 was missing (see RubyForge
1291 Bug #1277). This error has been corrected. Thanks to Barry
1292 DeZonia for reporting this problem.
1293
1294 * The API documentation for the
1295 `FXFileDialog` class methods
1296 `getOpenFilenames()`,
1297 `getOpenDirectory()`,
1298 `getOpenFilename()` and
1299 `getSaveFilename()` was extremely inadequate
1300 (see RubyForge
1301 Bug #1279). This documentation has been improved. Thanks to
1302 Barry DeZonia for reporting this problem.
1303
1304 * Brett Hallett contributed a Ruby port of the "ratio" example
1305 program from the regular FOX distribution, for demonstrating the use
1306 of the new `FXSpring` layout manager (see RubyForge
1307 Bug #1282). Many thanks to Brett for this addition!
1308
1309 * Joel VanderWerf contributed code to simplify how programs
1310 interact with modal and non-modal dialog boxes (see RubyForge
1311 Bug #1283). See the API documentation for the new
1312 `FXDialogBox#execute_modal` and
1313 `FXDialogBox#execute_nonmodal` methods for
1314 examples of their use.
1315
1316 * The attribute setters for
1317 `FXRealSpinner#selBackColor` and
1318 `FXSpinner#selBackColor` were defined
1319 incorrectly (see RubyForge
1320 Bug #1297). These have been corrected. Thanks to Meinrad
1321 Recheis for reporting this problem.
1322
1323 * The `tooltipPause` attribute reader for
1324 the `FXApp` class was missing (see RubyForge
1325 Patch #1306). Thanks to Joel VanderWerf for reporting this
1326 omission and providing a patch to fix it.
1327
1328 * The API documentation for the
1329 `FXToolBarTab` class was missing (see RubyForge
1330 Bug #1322). Thanks to Joel VanderWerf for reporting this
1331 omission.
1332
1333 * The attribute accessors for
1334 `FXText#visibleRows` and
1335 `FXText#visibleColumns` were defined and
1336 documented incorrectly (see RubyForge
1337 Bug #1325). These have been corrected. Thanks to Karl El-Koura
1338 for reporting this problem.
1339
1340 * The binary gem for Windows was built with FOX version 1.2.13 and
1341 FXScintilla version 1.62.
1342
1343
1344 ## Changes For Version 1.2.2 (October 1, 2004)
1345
1346 * In order to avoid versioning problems when dealing with a mix of
1347 applications based on either FXRuby 1.0 or 1.2, the feature name for
1348 FXRuby has been changed from "fox" to "fox12". For most application
1349 developers, this means that you will need to modify the source code
1350 for applications targeted at FXRuby 1.2 to begin with the line
1351 ´require 'fox12'´Note that no
1352 changes should be required for legacy applications targeted at FXRuby
1353 1.0.
1354
1355 * Made a number of updates to the documentation, to reflect API
1356 changes for FXRuby 1.2.
1357
1358 * The binary gem for Windows was built with FOX version 1.2.9 and
1359 FXScintilla version 1.61.
1360
1361
1362 ## Changes For Version 1.2a2 (July 10, 2004)
1363
1364 * This is the second "alpha" release of FXRuby 1.2. This release
1365 should be compatible with any FOX library version 1.2; it is not
1366 compatible with any previous FOX library versions. As this is an alpha
1367 release, users should expect a certain amount of instability, bugs,
1368 etc.
1369
1370 * For this release, all of the FOX 1.2 classes are available with
1371 the exception of the `FXBitmapView` class. There
1372 is a small problem with how the `FXBitmapView`
1373 class is declared in the FOX 1.2 header files, and I'm trying to
1374 decide how best to resolve that problem. The goal is to have this
1375 problem resolved by the next alpha release of FXRuby.
1376
1377 * For this release, all of the RDoc-based online documentation has
1378 been brought up to date with the new APIs.
1379
1380 * Portions of the FXRuby User's Guide were still out of date with
1381 respect to the new APIs (see SourceForge Bug #988623). This has been fixed.
1382
1383 * The `mditest.rb` example program was not up
1384 to date with the new APIs. This has been fixed.
1385
1386 * The `glviewer.rb` example program was not up
1387 to date with the new APIs (see SourceForge Bug #986479). This has been fixed. Thanks to Remy Drouilhet
1388 for reporting this problem and suggesting the fixes.
1389
1390 * The `FXGLGroup#bounds` method was defined
1391 incorrectly (see SourceForge Bug #986476). This has been fixed. Thanks to Remy Drouilhet
1392 for reporting this problem and suggesting the fix.
1393
1394 * The `scintilla-test.rb` example program was
1395 not up to date with the new APIs (see SourceForge Bug #986172). This has been fixed. Thanks to Peter Watkins for
1396 reporting this problem and submitting a corrected version of the
1397 program.
1398
1399 * There was a small typo in the table.rb example program (see
1400 SourceForge Bug #988152). This has been fixed. Thanks to Jamey Cribbs for
1401 reporting this problem and suggesting the fix.
1402
1403 * Due to an oversight on my part, one of the overloaded
1404 constructors for the `FXRegion` class wasn't
1405 wrapped properly (see SourceForge Bug #986181). This has been fixed. Thanks to Bil Bas for
1406 reporting this problem.
1407
1408 * Removed some obsolete aliases for the old leading and trailing
1409 rows and columns for the `FXTable` class (see
1410 SourceForge Bug #988038). Thanks to Yuri Leikind for reporting this
1411 problem.
1412
1413 * Added `FXTable` instance methods
1414 `horizontalGridShown=()` and
1415 `verticalGridShown=()` to complement the
1416 already available `horizontalGridShown?` and
1417 `verticalGridShown?` methods.
1418
1419 * The binary gem for the 1.2a1 release on Windows didn't have PNG
1420 or JPEG image support built-in (see SourceForge Bug #986180). This has been fixed. Thanks to Bil Bas for
1421 reporting this problem.
1422
1423 * The binary gem for Windows was built with FOX version 1.2.7 and
1424 FXScintilla version 1.61.
1425
1426
1427 ## Changes For Version 1.2a1 (June 28, 2004)
1428
1429 * This is the first "alpha" release of FXRuby 1.2. This release
1430 should be compatible with any FOX library version 1.2; it is not
1431 compatible with any previous FOX library versions. As this is an alpha
1432 release, users should expect a certain amount of instability, bugs,
1433 etc.
1434 The intent of this first alpha release is twofold. The primary
1435 intent is allow application developers who have current projects based
1436 on FXRuby 1.0 to begin the process of updating their applications for
1437 compatibility with FXRuby 1.2. For this release, all of the classes
1438 that existed in FXRuby 1.0 have been updated for compatibility with
1439 FOX 1.2, and so developers should at least be able to begin to "port"
1440 their applications forward now. Note that there have been a number of
1441 changes for FOX 1.2 and FXRuby 1.2, both in terms of API changes and
1442 less obvious "behavioral" changes. For a detailed summary of these
1443 changes, please see "What's New in FOX 1.2" (also available as a PDF).
1444 Note that few, if any, of the new classes introduced in FOX 1.2 are
1445 available in this first alpha release of FXRuby 1.2. Support for those
1446 new classes should come along quickly in subsequent alpha releases of
1447 FXRuby 1.2.
1448 The secondary intent of this first alpha release is to introduce
1449 the new RubyGems-based packaging
1450 of FXRuby and to begin to work out the inevitable kinks in that
1451 system.
1452
1453 * The binary gem for Windows was built with FOX version 1.2.4 and
1454 FXScintilla version 1.57.
1455
+0
-73
History.txt less more
0 === 1.6.29 / 2015-02-17
1
2 * Add Windows binaries for Ruby-2.1 and 2.2.
3 * Use shared libs for Windows binary gems to reduce gem size.
4 * Allow non owned assignment of image data to FXImage derivations
5 without copy'ing pixel data.
6 * Allow retrival of parts of the pixel data.
7 * Fix namespace specifier for FXRGB in kwargs.rb.
8 * Change GC'ing of TreeListBox and FXTreeItem. Fixes #10
9 * Update to swig version 2.0 or newer. Fixes #13
10
11 === 1.6.28 / 2013-07-05
12
13 * Fix build for Ruby-2.0.0-p127+
14 * Update libraries for win32 build: libfox-1.6.49
15
16 === 1.6.27 / 2013-04-05
17
18 * Add support for Ruby-2.0.
19 * Add cross compilation for x64-mingw32 target.
20
21 === 1.6.26 / 2013-02-16
22
23 * Mark all text strings retrieved from fox as UTF-8 when running on Ruby 1.9
24 * Fix loading error on Ruby 1.8.7 by renaming the C++ extension to fox16_c
25 * Update libraries for windows cross compilation
26
27 === 1.6.25 / 2012-06-17
28
29 * Windows: Fix slow loading of fox16.so by using a more recent mingw-w64 compiler
30 (reported by Allen Doug and Igor Jorobus)
31 * Fix two possible segfaults in conjunction with FXSplashWindow (reported by Igor Jorobus)
32
33 === 1.6.24 / 2012-06-06
34
35 * Update libraries for win32 build: libz-1.2.7 libpng-1.5.10 libjpeg-8d libtiff-4.0.1 libfox-1.6.45
36 * Avoid Segfauls in lots of methods when called with nil instead of FXApp, FXComposite or FXWindow objects
37
38 === 1.6.23 / 2012-03-08
39
40 * Add YARD documentation support
41 * Use generated Manifest.txt
42 * Support for parallel task execution with drake
43
44 === 1.6.22 / 2012-02-21
45
46 * Allow better access to raw pixel data of FXImage and derivatives
47 * Build Windows binary gem per cross compiler on Linux
48 * Add support for Rubinius (currently requires rubinius from git)
49 * Add alias FXApp#modalWindow, as described in rdoc
50 * Add quality parameter to FXJPGImage and FXJPGIcon
51 * Fix invalid memory access in final GC call when using FXMenuCommand with acckey
52 * Fix double referenced foxObj when borrowed object registration is triggered from C++
53 * Fix Segfault while GC'ing FXWindows
54 * Fix 'object allocation not allowed while garbage collection' bug
55 * Fix clipboard handling on windows
56 * Add missing namespace qualifier to FXSEL in FXAccelTable
57 * Fix GC bug in FXAccelTable
58 * Fix double free in FXMemoryStream#giveBuffer
59 * Fix invalid memory access in typemap to zero terminated FXchar* (such as fillItems methods)
60 * Fix FXApp#addInput for Ruby 1.9 on Linux
61 * Fix "ruby_code case not handled: Regexp" issue with newer rubygems
62
63 === 1.6.20 / 2009-03-06
64
65 * Integrated the Hoe and rake-compiler extensions into the Rakefile and
66 removed redundant tasks.
67 * Did some work to provide support for MinGW builds.
68
69 === 1.6.19 / 2009-03-06
70
71 * Please see http://www.fxruby.org/doc/changes.html
72 for a complete list of the changes in this release.
+0
-1214
Manifest.txt less more
0 .gemtest
1 .gitignore
2 .yardopts
3 History.txt
4 Manifest.txt
5 README.rdoc
6 Rakefile
7 TODO
8 doap.rdf.erb
9 examples/RAA.rb
10 examples/README
11 examples/WhatAQuietStiff.rb
12 examples/babelfish.rb
13 examples/bounce.rb
14 examples/browser.rb
15 examples/button.rb
16 examples/canvasdemo.rb
17 examples/charts.rb
18 examples/custom_table_item.rb
19 examples/datatarget.rb
20 examples/dctest.rb
21 examples/dialog.rb
22 examples/dilbert.rb
23 examples/dirlist.rb
24 examples/dragdrop.rb
25 examples/dragsource.rb
26 examples/dropsite.rb
27 examples/foursplit.rb
28 examples/gdchart.rb
29 examples/gembrowser.rb
30 examples/gltest.rb
31 examples/glviewer.rb
32 examples/groupbox.rb
33 examples/header.rb
34 examples/hello.rb
35 examples/hello2.rb
36 examples/iRAA.rb
37 examples/iconlist.rb
38 examples/icons/AngryGuyInBunnySuit.ico
39 examples/icons/FatBot.ico
40 examples/icons/FlippedySwitch.ico
41 examples/icons/LeGoon.ico
42 examples/icons/Net.ico
43 examples/icons/RedMacOS.ico
44 examples/icons/SawBlade.ico
45 examples/icons/backview.png
46 examples/icons/big.png
47 examples/icons/bigfolder.png
48 examples/icons/bigpenguin.png
49 examples/icons/bluebullet14x14.gif
50 examples/icons/bottomview.png
51 examples/icons/camera.png
52 examples/icons/capbutt.png
53 examples/icons/capnotlast.png
54 examples/icons/capproj.png
55 examples/icons/capround.png
56 examples/icons/colorpal.png
57 examples/icons/copy.png
58 examples/icons/cut.png
59 examples/icons/delimit.png
60 examples/icons/dippy.png
61 examples/icons/double_dash.png
62 examples/icons/filenew.png
63 examples/icons/fileopen.png
64 examples/icons/filesave.png
65 examples/icons/filesaveas.png
66 examples/icons/fonts.png
67 examples/icons/fox.png
68 examples/icons/foxicon.png
69 examples/icons/frontview.png
70 examples/icons/gem_big.png
71 examples/icons/gem_small.png
72 examples/icons/hello2.png
73 examples/icons/help.png
74 examples/icons/indent.png
75 examples/icons/jbevel.png
76 examples/icons/jmiter.png
77 examples/icons/jround.png
78 examples/icons/kill.png
79 examples/icons/leftview.png
80 examples/icons/light.png
81 examples/icons/minidoc.png
82 examples/icons/minifolder.png
83 examples/icons/minifolderopen.png
84 examples/icons/newfolder.png
85 examples/icons/nolight.png
86 examples/icons/onoff_dash.png
87 examples/icons/palette.png
88 examples/icons/parallel.png
89 examples/icons/paste.png
90 examples/icons/pattern.png
91 examples/icons/penguin.png
92 examples/icons/perspective.png
93 examples/icons/printicon.png
94 examples/icons/prop.png
95 examples/icons/redo.png
96 examples/icons/rightview.png
97 examples/icons/saveas.png
98 examples/icons/shutter1.png
99 examples/icons/shutter2.png
100 examples/icons/small.png
101 examples/icons/smoothlight.png
102 examples/icons/solid_line.png
103 examples/icons/tbuplevel.png
104 examples/icons/topview.png
105 examples/icons/transpbullet14x14.gif
106 examples/icons/undo.png
107 examples/icons/winapp.png
108 examples/icons/zoom.png
109 examples/image.rb
110 examples/imageviewer.rb
111 examples/inputs.rb
112 examples/mditest.rb
113 examples/pig.rb
114 examples/raabrowser.rb
115 examples/ratio.rb
116 examples/rmagick.rb
117 examples/rulerview.rb
118 examples/scintilla-test.rb
119 examples/scribble-orig.rb
120 examples/scribble.rb
121 examples/shutter.rb
122 examples/splitter.rb
123 examples/styledtext.rb
124 examples/tabbook.rb
125 examples/table.rb
126 examples/textedit/commands.rb
127 examples/textedit/helpwindow.rb
128 examples/textedit/prefdialog.rb
129 examples/textedit/textedit.rb
130 examples/unicode.rb
131 ext/fox16_c/FXRbApp.cpp
132 ext/fox16_c/FXRbDataTarget.cpp
133 ext/fox16_c/FXRbGLViewer.cpp
134 ext/fox16_c/FXRuby.cpp
135 ext/fox16_c/MANIFEST
136 ext/fox16_c/extconf.rb
137 ext/fox16_c/impl.cpp
138 ext/fox16_c/include/FXMemoryBuffer.h
139 ext/fox16_c/include/FXRb4Splitter.h
140 ext/fox16_c/include/FXRb7Segment.h
141 ext/fox16_c/include/FXRbAccelTable.h
142 ext/fox16_c/include/FXRbApp.h
143 ext/fox16_c/include/FXRbAppVirtuals.h
144 ext/fox16_c/include/FXRbArrowButton.h
145 ext/fox16_c/include/FXRbBMPIcon.h
146 ext/fox16_c/include/FXRbBMPImage.h
147 ext/fox16_c/include/FXRbBitmap.h
148 ext/fox16_c/include/FXRbBitmapFrame.h
149 ext/fox16_c/include/FXRbBitmapView.h
150 ext/fox16_c/include/FXRbBitmapVirtuals.h
151 ext/fox16_c/include/FXRbButton.h
152 ext/fox16_c/include/FXRbCURCursor.h
153 ext/fox16_c/include/FXRbCanvas.h
154 ext/fox16_c/include/FXRbCheckButton.h
155 ext/fox16_c/include/FXRbChoiceBox.h
156 ext/fox16_c/include/FXRbColorBar.h
157 ext/fox16_c/include/FXRbColorDialog.h
158 ext/fox16_c/include/FXRbColorList.h
159 ext/fox16_c/include/FXRbColorRing.h
160 ext/fox16_c/include/FXRbColorSelector.h
161 ext/fox16_c/include/FXRbColorWell.h
162 ext/fox16_c/include/FXRbColorWheel.h
163 ext/fox16_c/include/FXRbComboBox.h
164 ext/fox16_c/include/FXRbCommon.h
165 ext/fox16_c/include/FXRbComposite.h
166 ext/fox16_c/include/FXRbCursor.h
167 ext/fox16_c/include/FXRbCursorVirtuals.h
168 ext/fox16_c/include/FXRbDC.h
169 ext/fox16_c/include/FXRbDCPrint.h
170 ext/fox16_c/include/FXRbDCVirtuals.h
171 ext/fox16_c/include/FXRbDCWindow.h
172 ext/fox16_c/include/FXRbDataTarget.h
173 ext/fox16_c/include/FXRbDebugTarget.h
174 ext/fox16_c/include/FXRbDelegator.h
175 ext/fox16_c/include/FXRbDial.h
176 ext/fox16_c/include/FXRbDialogBox.h
177 ext/fox16_c/include/FXRbDialogBoxVirtuals.h
178 ext/fox16_c/include/FXRbDict.h
179 ext/fox16_c/include/FXRbDirBox.h
180 ext/fox16_c/include/FXRbDirDialog.h
181 ext/fox16_c/include/FXRbDirList.h
182 ext/fox16_c/include/FXRbDirSelector.h
183 ext/fox16_c/include/FXRbDockBar.h
184 ext/fox16_c/include/FXRbDockBarVirtuals.h
185 ext/fox16_c/include/FXRbDockHandler.h
186 ext/fox16_c/include/FXRbDockSite.h
187 ext/fox16_c/include/FXRbDockSiteVirtuals.h
188 ext/fox16_c/include/FXRbDockTitle.h
189 ext/fox16_c/include/FXRbDocument.h
190 ext/fox16_c/include/FXRbDragCorner.h
191 ext/fox16_c/include/FXRbDrawable.h
192 ext/fox16_c/include/FXRbDrawableVirtuals.h
193 ext/fox16_c/include/FXRbDriveBox.h
194 ext/fox16_c/include/FXRbFileDialog.h
195 ext/fox16_c/include/FXRbFileDict.h
196 ext/fox16_c/include/FXRbFileDictVirtuals.h
197 ext/fox16_c/include/FXRbFileList.h
198 ext/fox16_c/include/FXRbFileSelector.h
199 ext/fox16_c/include/FXRbFoldingItemVirtuals.h
200 ext/fox16_c/include/FXRbFoldingList.h
201 ext/fox16_c/include/FXRbFoldingListVirtuals.h
202 ext/fox16_c/include/FXRbFont.h
203 ext/fox16_c/include/FXRbFontDialog.h
204 ext/fox16_c/include/FXRbFontSelector.h
205 ext/fox16_c/include/FXRbFontVirtuals.h
206 ext/fox16_c/include/FXRbFrame.h
207 ext/fox16_c/include/FXRbGIFCursor.h
208 ext/fox16_c/include/FXRbGIFIcon.h
209 ext/fox16_c/include/FXRbGIFImage.h
210 ext/fox16_c/include/FXRbGLCanvas.h
211 ext/fox16_c/include/FXRbGLCanvasVirtuals.h
212 ext/fox16_c/include/FXRbGLContext.h
213 ext/fox16_c/include/FXRbGLObject.h
214 ext/fox16_c/include/FXRbGLObjectVirtuals.h
215 ext/fox16_c/include/FXRbGLShape.h
216 ext/fox16_c/include/FXRbGLShapeVirtuals.h
217 ext/fox16_c/include/FXRbGLViewer.h
218 ext/fox16_c/include/FXRbGLViewerVirtuals.h
219 ext/fox16_c/include/FXRbGLVisual.h
220 ext/fox16_c/include/FXRbGradientBar.h
221 ext/fox16_c/include/FXRbGroupBox.h
222 ext/fox16_c/include/FXRbHeader.h
223 ext/fox16_c/include/FXRbHeaderItemVirtuals.h
224 ext/fox16_c/include/FXRbHorizontalFrame.h
225 ext/fox16_c/include/FXRbICOIcon.h
226 ext/fox16_c/include/FXRbICOImage.h
227 ext/fox16_c/include/FXRbIcon.h
228 ext/fox16_c/include/FXRbIconItemVirtuals.h
229 ext/fox16_c/include/FXRbIconList.h
230 ext/fox16_c/include/FXRbIconListVirtuals.h
231 ext/fox16_c/include/FXRbIconSource.h
232 ext/fox16_c/include/FXRbIconSourceVirtuals.h
233 ext/fox16_c/include/FXRbId.h
234 ext/fox16_c/include/FXRbIdVirtuals.h
235 ext/fox16_c/include/FXRbImage.h
236 ext/fox16_c/include/FXRbImageFrame.h
237 ext/fox16_c/include/FXRbImageView.h
238 ext/fox16_c/include/FXRbImageVirtuals.h
239 ext/fox16_c/include/FXRbInputDialog.h
240 ext/fox16_c/include/FXRbJPGIcon.h
241 ext/fox16_c/include/FXRbJPGImage.h
242 ext/fox16_c/include/FXRbKnob.h
243 ext/fox16_c/include/FXRbLabel.h
244 ext/fox16_c/include/FXRbList.h
245 ext/fox16_c/include/FXRbListBox.h
246 ext/fox16_c/include/FXRbListBoxVirtuals.h
247 ext/fox16_c/include/FXRbListItemVirtuals.h
248 ext/fox16_c/include/FXRbListVirtuals.h
249 ext/fox16_c/include/FXRbMDIButton.h
250 ext/fox16_c/include/FXRbMDIChild.h
251 ext/fox16_c/include/FXRbMDIChildVirtuals.h
252 ext/fox16_c/include/FXRbMDIClient.h
253 ext/fox16_c/include/FXRbMDIClientVirtuals.h
254 ext/fox16_c/include/FXRbMainWindow.h
255 ext/fox16_c/include/FXRbMatrix.h
256 ext/fox16_c/include/FXRbMenuBar.h
257 ext/fox16_c/include/FXRbMenuButton.h
258 ext/fox16_c/include/FXRbMenuCaption.h
259 ext/fox16_c/include/FXRbMenuCascade.h
260 ext/fox16_c/include/FXRbMenuCheck.h
261 ext/fox16_c/include/FXRbMenuCommand.h
262 ext/fox16_c/include/FXRbMenuPane.h
263 ext/fox16_c/include/FXRbMenuRadio.h
264 ext/fox16_c/include/FXRbMenuSeparator.h
265 ext/fox16_c/include/FXRbMenuTitle.h
266 ext/fox16_c/include/FXRbMessageBox.h
267 ext/fox16_c/include/FXRbObject.h
268 ext/fox16_c/include/FXRbObjectVirtuals.h
269 ext/fox16_c/include/FXRbOptionMenu.h
270 ext/fox16_c/include/FXRbPCXIcon.h
271 ext/fox16_c/include/FXRbPCXImage.h
272 ext/fox16_c/include/FXRbPNGIcon.h
273 ext/fox16_c/include/FXRbPNGImage.h
274 ext/fox16_c/include/FXRbPPMIcon.h
275 ext/fox16_c/include/FXRbPPMImage.h
276 ext/fox16_c/include/FXRbPacker.h
277 ext/fox16_c/include/FXRbPicker.h
278 ext/fox16_c/include/FXRbPopup.h
279 ext/fox16_c/include/FXRbPopupVirtuals.h
280 ext/fox16_c/include/FXRbPrintDialog.h
281 ext/fox16_c/include/FXRbProgressBar.h
282 ext/fox16_c/include/FXRbProgressDialog.h
283 ext/fox16_c/include/FXRbRGBIcon.h
284 ext/fox16_c/include/FXRbRGBImage.h
285 ext/fox16_c/include/FXRbRadioButton.h
286 ext/fox16_c/include/FXRbRealSlider.h
287 ext/fox16_c/include/FXRbRealSpinner.h
288 ext/fox16_c/include/FXRbRealSpinnerVirtuals.h
289 ext/fox16_c/include/FXRbRecentFiles.h
290 ext/fox16_c/include/FXRbRegistry.h
291 ext/fox16_c/include/FXRbReplaceDialog.h
292 ext/fox16_c/include/FXRbRootWindow.h
293 ext/fox16_c/include/FXRbRuler.h
294 ext/fox16_c/include/FXRbRulerView.h
295 ext/fox16_c/include/FXRbScintilla.h
296 ext/fox16_c/include/FXRbScrollArea.h
297 ext/fox16_c/include/FXRbScrollAreaVirtuals.h
298 ext/fox16_c/include/FXRbScrollBar.h
299 ext/fox16_c/include/FXRbScrollPane.h
300 ext/fox16_c/include/FXRbScrollWindow.h
301 ext/fox16_c/include/FXRbSearchDialog.h
302 ext/fox16_c/include/FXRbSeparator.h
303 ext/fox16_c/include/FXRbSettings.h
304 ext/fox16_c/include/FXRbShell.h
305 ext/fox16_c/include/FXRbShutter.h
306 ext/fox16_c/include/FXRbShutterVirtuals.h
307 ext/fox16_c/include/FXRbSlider.h
308 ext/fox16_c/include/FXRbSpinner.h
309 ext/fox16_c/include/FXRbSpinnerVirtuals.h
310 ext/fox16_c/include/FXRbSplashWindow.h
311 ext/fox16_c/include/FXRbSplitter.h
312 ext/fox16_c/include/FXRbSpring.h
313 ext/fox16_c/include/FXRbStatusBar.h
314 ext/fox16_c/include/FXRbStatusLine.h
315 ext/fox16_c/include/FXRbStream.h
316 ext/fox16_c/include/FXRbStreamVirtuals.h
317 ext/fox16_c/include/FXRbStringDict.h
318 ext/fox16_c/include/FXRbSwitcher.h
319 ext/fox16_c/include/FXRbTGAIcon.h
320 ext/fox16_c/include/FXRbTGAImage.h
321 ext/fox16_c/include/FXRbTIFIcon.h
322 ext/fox16_c/include/FXRbTIFImage.h
323 ext/fox16_c/include/FXRbTabBar.h
324 ext/fox16_c/include/FXRbTabBarVirtuals.h
325 ext/fox16_c/include/FXRbTabBook.h
326 ext/fox16_c/include/FXRbTabItem.h
327 ext/fox16_c/include/FXRbTable.h
328 ext/fox16_c/include/FXRbTableItemVirtuals.h
329 ext/fox16_c/include/FXRbTableVirtuals.h
330 ext/fox16_c/include/FXRbText.h
331 ext/fox16_c/include/FXRbTextField.h
332 ext/fox16_c/include/FXRbTextVirtuals.h
333 ext/fox16_c/include/FXRbToggleButton.h
334 ext/fox16_c/include/FXRbToolBar.h
335 ext/fox16_c/include/FXRbToolBarGrip.h
336 ext/fox16_c/include/FXRbToolBarShell.h
337 ext/fox16_c/include/FXRbToolBarTab.h
338 ext/fox16_c/include/FXRbToolTip.h
339 ext/fox16_c/include/FXRbTopWindow.h
340 ext/fox16_c/include/FXRbTopWindowVirtuals.h
341 ext/fox16_c/include/FXRbTranslator.h
342 ext/fox16_c/include/FXRbTranslatorVirtuals.h
343 ext/fox16_c/include/FXRbTreeItemVirtuals.h
344 ext/fox16_c/include/FXRbTreeList.h
345 ext/fox16_c/include/FXRbTreeListBox.h
346 ext/fox16_c/include/FXRbTreeListBoxVirtuals.h
347 ext/fox16_c/include/FXRbTreeListVirtuals.h
348 ext/fox16_c/include/FXRbTriStateButton.h
349 ext/fox16_c/include/FXRbVerticalFrame.h
350 ext/fox16_c/include/FXRbVisual.h
351 ext/fox16_c/include/FXRbWindow.h
352 ext/fox16_c/include/FXRbWindowVirtuals.h
353 ext/fox16_c/include/FXRbWizard.h
354 ext/fox16_c/include/FXRbXBMIcon.h
355 ext/fox16_c/include/FXRbXBMImage.h
356 ext/fox16_c/include/FXRbXPMIcon.h
357 ext/fox16_c/include/FXRbXPMImage.h
358 ext/fox16_c/include/FXRuby.h
359 ext/fox16_c/include/impl.h
360 ext/fox16_c/make_impl.rb
361 ext/fox16_c/markfuncs.cpp
362 ext/fox16_c/unregisterOwnedObjects.cpp
363 fox-includes/FX4Splitter.h
364 fox-includes/FX7Segment.h
365 fox-includes/FX885910Codec.h
366 fox-includes/FX885911Codec.h
367 fox-includes/FX885913Codec.h
368 fox-includes/FX885914Codec.h
369 fox-includes/FX885915Codec.h
370 fox-includes/FX885916Codec.h
371 fox-includes/FX88591Codec.h
372 fox-includes/FX88592Codec.h
373 fox-includes/FX88593Codec.h
374 fox-includes/FX88594Codec.h
375 fox-includes/FX88595Codec.h
376 fox-includes/FX88596Codec.h
377 fox-includes/FX88597Codec.h
378 fox-includes/FX88598Codec.h
379 fox-includes/FX88599Codec.h
380 fox-includes/FXAccelTable.h
381 fox-includes/FXApp.h
382 fox-includes/FXArray.h
383 fox-includes/FXArrowButton.h
384 fox-includes/FXBMPIcon.h
385 fox-includes/FXBMPImage.h
386 fox-includes/FXBZFileStream.h
387 fox-includes/FXBitmap.h
388 fox-includes/FXBitmapFrame.h
389 fox-includes/FXBitmapView.h
390 fox-includes/FXButton.h
391 fox-includes/FXCP1250Codec.h
392 fox-includes/FXCP1251Codec.h
393 fox-includes/FXCP1252Codec.h
394 fox-includes/FXCP1253Codec.h
395 fox-includes/FXCP1254Codec.h
396 fox-includes/FXCP1255Codec.h
397 fox-includes/FXCP1256Codec.h
398 fox-includes/FXCP1257Codec.h
399 fox-includes/FXCP1258Codec.h
400 fox-includes/FXCP437Codec.h
401 fox-includes/FXCP850Codec.h
402 fox-includes/FXCP852Codec.h
403 fox-includes/FXCP855Codec.h
404 fox-includes/FXCP856Codec.h
405 fox-includes/FXCP857Codec.h
406 fox-includes/FXCP860Codec.h
407 fox-includes/FXCP861Codec.h
408 fox-includes/FXCP862Codec.h
409 fox-includes/FXCP863Codec.h
410 fox-includes/FXCP864Codec.h
411 fox-includes/FXCP865Codec.h
412 fox-includes/FXCP866Codec.h
413 fox-includes/FXCP869Codec.h
414 fox-includes/FXCP874Codec.h
415 fox-includes/FXCURCursor.h
416 fox-includes/FXCanvas.h
417 fox-includes/FXCheckButton.h
418 fox-includes/FXChoiceBox.h
419 fox-includes/FXColorBar.h
420 fox-includes/FXColorDialog.h
421 fox-includes/FXColorList.h
422 fox-includes/FXColorRing.h
423 fox-includes/FXColorSelector.h
424 fox-includes/FXColorWell.h
425 fox-includes/FXColorWheel.h
426 fox-includes/FXComboBox.h
427 fox-includes/FXComposeContext.h
428 fox-includes/FXComposite.h
429 fox-includes/FXCursor.h
430 fox-includes/FXDC.h
431 fox-includes/FXDCPrint.h
432 fox-includes/FXDCWindow.h
433 fox-includes/FXDLL.h
434 fox-includes/FXDataTarget.h
435 fox-includes/FXDate.h
436 fox-includes/FXDebugTarget.h
437 fox-includes/FXDelegator.h
438 fox-includes/FXDial.h
439 fox-includes/FXDialogBox.h
440 fox-includes/FXDict.h
441 fox-includes/FXDir.h
442 fox-includes/FXDirBox.h
443 fox-includes/FXDirDialog.h
444 fox-includes/FXDirList.h
445 fox-includes/FXDirSelector.h
446 fox-includes/FXDockBar.h
447 fox-includes/FXDockHandler.h
448 fox-includes/FXDockSite.h
449 fox-includes/FXDockTitle.h
450 fox-includes/FXDocument.h
451 fox-includes/FXDragCorner.h
452 fox-includes/FXDrawable.h
453 fox-includes/FXDriveBox.h
454 fox-includes/FXElement.h
455 fox-includes/FXException.h
456 fox-includes/FXExpression.h
457 fox-includes/FXExtentd.h
458 fox-includes/FXExtentf.h
459 fox-includes/FXFile.h
460 fox-includes/FXFileDialog.h
461 fox-includes/FXFileDict.h
462 fox-includes/FXFileList.h
463 fox-includes/FXFileSelector.h
464 fox-includes/FXFileStream.h
465 fox-includes/FXFoldingList.h
466 fox-includes/FXFont.h
467 fox-includes/FXFontDialog.h
468 fox-includes/FXFontSelector.h
469 fox-includes/FXFrame.h
470 fox-includes/FXGIFCursor.h
471 fox-includes/FXGIFIcon.h
472 fox-includes/FXGIFImage.h
473 fox-includes/FXGLCanvas.h
474 fox-includes/FXGLCone.h
475 fox-includes/FXGLContext.h
476 fox-includes/FXGLCube.h
477 fox-includes/FXGLCylinder.h
478 fox-includes/FXGLObject.h
479 fox-includes/FXGLShape.h
480 fox-includes/FXGLSphere.h
481 fox-includes/FXGLTriangleMesh.h
482 fox-includes/FXGLViewer.h
483 fox-includes/FXGLVisual.h
484 fox-includes/FXGUISignal.h
485 fox-includes/FXGZFileStream.h
486 fox-includes/FXGradientBar.h
487 fox-includes/FXGroupBox.h
488 fox-includes/FXHash.h
489 fox-includes/FXHeader.h
490 fox-includes/FXHorizontalFrame.h
491 fox-includes/FXICOIcon.h
492 fox-includes/FXICOImage.h
493 fox-includes/FXIFFIcon.h
494 fox-includes/FXIFFImage.h
495 fox-includes/FXIO.h
496 fox-includes/FXIcon.h
497 fox-includes/FXIconDict.h
498 fox-includes/FXIconList.h
499 fox-includes/FXIconSource.h
500 fox-includes/FXId.h
501 fox-includes/FXImage.h
502 fox-includes/FXImageFrame.h
503 fox-includes/FXImageView.h
504 fox-includes/FXInputDialog.h
505 fox-includes/FXJPGIcon.h
506 fox-includes/FXJPGImage.h
507 fox-includes/FXKOI8RCodec.h
508 fox-includes/FXKnob.h
509 fox-includes/FXLabel.h
510 fox-includes/FXList.h
511 fox-includes/FXListBox.h
512 fox-includes/FXMDIButton.h
513 fox-includes/FXMDIChild.h
514 fox-includes/FXMDIClient.h
515 fox-includes/FXMainWindow.h
516 fox-includes/FXMat3d.h
517 fox-includes/FXMat3f.h
518 fox-includes/FXMat4d.h
519 fox-includes/FXMat4f.h
520 fox-includes/FXMatrix.h
521 fox-includes/FXMemMap.h
522 fox-includes/FXMemoryStream.h
523 fox-includes/FXMenuBar.h
524 fox-includes/FXMenuButton.h
525 fox-includes/FXMenuCaption.h
526 fox-includes/FXMenuCascade.h
527 fox-includes/FXMenuCheck.h
528 fox-includes/FXMenuCommand.h
529 fox-includes/FXMenuPane.h
530 fox-includes/FXMenuRadio.h
531 fox-includes/FXMenuSeparator.h
532 fox-includes/FXMenuTitle.h
533 fox-includes/FXMessageBox.h
534 fox-includes/FXObject.h
535 fox-includes/FXObjectList.h
536 fox-includes/FXOptionMenu.h
537 fox-includes/FXPCXIcon.h
538 fox-includes/FXPCXImage.h
539 fox-includes/FXPNGIcon.h
540 fox-includes/FXPNGImage.h
541 fox-includes/FXPPMIcon.h
542 fox-includes/FXPPMImage.h
543 fox-includes/FXPacker.h
544 fox-includes/FXPath.h
545 fox-includes/FXPicker.h
546 fox-includes/FXPipe.h
547 fox-includes/FXPoint.h
548 fox-includes/FXPopup.h
549 fox-includes/FXPrintDialog.h
550 fox-includes/FXProgressBar.h
551 fox-includes/FXProgressDialog.h
552 fox-includes/FXQuatd.h
553 fox-includes/FXQuatf.h
554 fox-includes/FXRASIcon.h
555 fox-includes/FXRASImage.h
556 fox-includes/FXRGBIcon.h
557 fox-includes/FXRGBImage.h
558 fox-includes/FXRadioButton.h
559 fox-includes/FXRanged.h
560 fox-includes/FXRangef.h
561 fox-includes/FXRealSlider.h
562 fox-includes/FXRealSpinner.h
563 fox-includes/FXRecentFiles.h
564 fox-includes/FXRectangle.h
565 fox-includes/FXRegion.h
566 fox-includes/FXRegistry.h
567 fox-includes/FXReplaceDialog.h
568 fox-includes/FXRex.h
569 fox-includes/FXRootWindow.h
570 fox-includes/FXRuler.h
571 fox-includes/FXRulerView.h
572 fox-includes/FXScrollArea.h
573 fox-includes/FXScrollBar.h
574 fox-includes/FXScrollPane.h
575 fox-includes/FXScrollWindow.h
576 fox-includes/FXSearchDialog.h
577 fox-includes/FXSeparator.h
578 fox-includes/FXSettings.h
579 fox-includes/FXShell.h
580 fox-includes/FXShutter.h
581 fox-includes/FXSize.h
582 fox-includes/FXSlider.h
583 fox-includes/FXSocket.h
584 fox-includes/FXSphered.h
585 fox-includes/FXSpheref.h
586 fox-includes/FXSpinner.h
587 fox-includes/FXSplashWindow.h
588 fox-includes/FXSplitter.h
589 fox-includes/FXSpring.h
590 fox-includes/FXStat.h
591 fox-includes/FXStatusBar.h
592 fox-includes/FXStatusLine.h
593 fox-includes/FXStream.h
594 fox-includes/FXString.h
595 fox-includes/FXStringDict.h
596 fox-includes/FXSwitcher.h
597 fox-includes/FXSystem.h
598 fox-includes/FXTGAIcon.h
599 fox-includes/FXTGAImage.h
600 fox-includes/FXTIFIcon.h
601 fox-includes/FXTIFImage.h
602 fox-includes/FXTabBar.h
603 fox-includes/FXTabBook.h
604 fox-includes/FXTabItem.h
605 fox-includes/FXTable.h
606 fox-includes/FXText.h
607 fox-includes/FXTextCodec.h
608 fox-includes/FXTextField.h
609 fox-includes/FXThread.h
610 fox-includes/FXToggleButton.h
611 fox-includes/FXToolBar.h
612 fox-includes/FXToolBarGrip.h
613 fox-includes/FXToolBarShell.h
614 fox-includes/FXToolBarTab.h
615 fox-includes/FXToolTip.h
616 fox-includes/FXTopWindow.h
617 fox-includes/FXTranslator.h
618 fox-includes/FXTreeList.h
619 fox-includes/FXTreeListBox.h
620 fox-includes/FXTriStateButton.h
621 fox-includes/FXURL.h
622 fox-includes/FXUTF16Codec.h
623 fox-includes/FXUTF32Codec.h
624 fox-includes/FXUTF8Codec.h
625 fox-includes/FXUndoList.h
626 fox-includes/FXVec2d.h
627 fox-includes/FXVec2f.h
628 fox-includes/FXVec3d.h
629 fox-includes/FXVec3f.h
630 fox-includes/FXVec4d.h
631 fox-includes/FXVec4f.h
632 fox-includes/FXVerticalFrame.h
633 fox-includes/FXVisual.h
634 fox-includes/FXWindow.h
635 fox-includes/FXWizard.h
636 fox-includes/FXXBMIcon.h
637 fox-includes/FXXBMImage.h
638 fox-includes/FXXPMIcon.h
639 fox-includes/FXXPMImage.h
640 fox-includes/README
641 fox-includes/fx.h
642 fox-includes/fx3d.h
643 fox-includes/fxascii.h
644 fox-includes/fxdefs.h
645 fox-includes/fxkeys.h
646 fox-includes/fxunicode.h
647 fox-includes/fxver.h
648 fox-includes/xincs.h
649 index.html
650 lib/fox16.rb
651 lib/fox16/accel_table.rb
652 lib/fox16/aliases.rb
653 lib/fox16/bitmapview.rb
654 lib/fox16/calendar.rb
655 lib/fox16/canvas.rb
656 lib/fox16/chore.rb
657 lib/fox16/colors.rb
658 lib/fox16/core.rb
659 lib/fox16/dict.rb
660 lib/fox16/exceptions_for_fxerror.rb
661 lib/fox16/execute_nonmodal.rb
662 lib/fox16/glgroup.rb
663 lib/fox16/glshapes.rb
664 lib/fox16/input.rb
665 lib/fox16/irb.rb
666 lib/fox16/iterators.rb
667 lib/fox16/keys.rb
668 lib/fox16/missingdep.rb
669 lib/fox16/pseudokeyboard.rb
670 lib/fox16/pseudomouse.rb
671 lib/fox16/responder.rb
672 lib/fox16/responder2.rb
673 lib/fox16/scintilla.rb
674 lib/fox16/settings.rb
675 lib/fox16/signal.rb
676 lib/fox16/splashscreen.rb
677 lib/fox16/timeout.rb
678 lib/fox16/tkcompat.rb
679 lib/fox16/undolist.rb
680 lib/fox16/version.rb
681 rdoc-sources/FX4Splitter.rb
682 rdoc-sources/FX7Segment.rb
683 rdoc-sources/FXAccelTable.rb
684 rdoc-sources/FXApp.rb
685 rdoc-sources/FXArrowButton.rb
686 rdoc-sources/FXBMPIcon.rb
687 rdoc-sources/FXBMPImage.rb
688 rdoc-sources/FXBitmap.rb
689 rdoc-sources/FXBitmapFrame.rb
690 rdoc-sources/FXBitmapView.rb
691 rdoc-sources/FXButton.rb
692 rdoc-sources/FXCURCursor.rb
693 rdoc-sources/FXCanvas.rb
694 rdoc-sources/FXCheckButton.rb
695 rdoc-sources/FXChoiceBox.rb
696 rdoc-sources/FXColorBar.rb
697 rdoc-sources/FXColorDialog.rb
698 rdoc-sources/FXColorList.rb
699 rdoc-sources/FXColorRing.rb
700 rdoc-sources/FXColorSelector.rb
701 rdoc-sources/FXColorWell.rb
702 rdoc-sources/FXColorWheel.rb
703 rdoc-sources/FXComboBox.rb
704 rdoc-sources/FXComposite.rb
705 rdoc-sources/FXCursor.rb
706 rdoc-sources/FXDC.rb
707 rdoc-sources/FXDCPrint.rb
708 rdoc-sources/FXDCWindow.rb
709 rdoc-sources/FXDataTarget.rb
710 rdoc-sources/FXDebugTarget.rb
711 rdoc-sources/FXDelegator.rb
712 rdoc-sources/FXDial.rb
713 rdoc-sources/FXDialogBox.rb
714 rdoc-sources/FXDict.rb
715 rdoc-sources/FXDirBox.rb
716 rdoc-sources/FXDirDialog.rb
717 rdoc-sources/FXDirList.rb
718 rdoc-sources/FXDirSelector.rb
719 rdoc-sources/FXDockBar.rb
720 rdoc-sources/FXDockHandler.rb
721 rdoc-sources/FXDockSite.rb
722 rdoc-sources/FXDockTitle.rb
723 rdoc-sources/FXDocument.rb
724 rdoc-sources/FXDragCorner.rb
725 rdoc-sources/FXDrawable.rb
726 rdoc-sources/FXDriveBox.rb
727 rdoc-sources/FXExtentd.rb
728 rdoc-sources/FXExtentf.rb
729 rdoc-sources/FXFileDialog.rb
730 rdoc-sources/FXFileDict.rb
731 rdoc-sources/FXFileList.rb
732 rdoc-sources/FXFileSelector.rb
733 rdoc-sources/FXFileStream.rb
734 rdoc-sources/FXFoldingList.rb
735 rdoc-sources/FXFont.rb
736 rdoc-sources/FXFontDialog.rb
737 rdoc-sources/FXFontSelector.rb
738 rdoc-sources/FXFrame.rb
739 rdoc-sources/FXGIFCursor.rb
740 rdoc-sources/FXGIFIcon.rb
741 rdoc-sources/FXGIFImage.rb
742 rdoc-sources/FXGLCanvas.rb
743 rdoc-sources/FXGLContext.rb
744 rdoc-sources/FXGLObject.rb
745 rdoc-sources/FXGLShape.rb
746 rdoc-sources/FXGLViewer.rb
747 rdoc-sources/FXGLVisual.rb
748 rdoc-sources/FXGradientBar.rb
749 rdoc-sources/FXGroupBox.rb
750 rdoc-sources/FXHeader.rb
751 rdoc-sources/FXHorizontalFrame.rb
752 rdoc-sources/FXICOIcon.rb
753 rdoc-sources/FXICOImage.rb
754 rdoc-sources/FXIcon.rb
755 rdoc-sources/FXIconDict.rb
756 rdoc-sources/FXIconList.rb
757 rdoc-sources/FXIconSource.rb
758 rdoc-sources/FXId.rb
759 rdoc-sources/FXImage.rb
760 rdoc-sources/FXImageFrame.rb
761 rdoc-sources/FXImageView.rb
762 rdoc-sources/FXInputDialog.rb
763 rdoc-sources/FXJPGIcon.rb
764 rdoc-sources/FXJPGImage.rb
765 rdoc-sources/FXKnob.rb
766 rdoc-sources/FXLabel.rb
767 rdoc-sources/FXList.rb
768 rdoc-sources/FXListBox.rb
769 rdoc-sources/FXMDIButton.rb
770 rdoc-sources/FXMDIChild.rb
771 rdoc-sources/FXMDIClient.rb
772 rdoc-sources/FXMainWindow.rb
773 rdoc-sources/FXMatrix.rb
774 rdoc-sources/FXMemoryBuffer.rb
775 rdoc-sources/FXMemoryStream.rb
776 rdoc-sources/FXMenuBar.rb
777 rdoc-sources/FXMenuButton.rb
778 rdoc-sources/FXMenuCaption.rb
779 rdoc-sources/FXMenuCascade.rb
780 rdoc-sources/FXMenuCheck.rb
781 rdoc-sources/FXMenuCommand.rb
782 rdoc-sources/FXMenuPane.rb
783 rdoc-sources/FXMenuRadio.rb
784 rdoc-sources/FXMenuSeparator.rb
785 rdoc-sources/FXMenuTitle.rb
786 rdoc-sources/FXMessageBox.rb
787 rdoc-sources/FXObject.rb
788 rdoc-sources/FXOptionMenu.rb
789 rdoc-sources/FXPCXIcon.rb
790 rdoc-sources/FXPCXImage.rb
791 rdoc-sources/FXPNGIcon.rb
792 rdoc-sources/FXPNGImage.rb
793 rdoc-sources/FXPPMIcon.rb
794 rdoc-sources/FXPPMImage.rb
795 rdoc-sources/FXPacker.rb
796 rdoc-sources/FXPicker.rb
797 rdoc-sources/FXPopup.rb
798 rdoc-sources/FXPrintDialog.rb
799 rdoc-sources/FXProgressBar.rb
800 rdoc-sources/FXProgressDialog.rb
801 rdoc-sources/FXQuatd.rb
802 rdoc-sources/FXQuatf.rb
803 rdoc-sources/FXRGBIcon.rb
804 rdoc-sources/FXRGBImage.rb
805 rdoc-sources/FXRadioButton.rb
806 rdoc-sources/FXRanged.rb
807 rdoc-sources/FXRangef.rb
808 rdoc-sources/FXRealSlider.rb
809 rdoc-sources/FXRealSpinner.rb
810 rdoc-sources/FXRecentFiles.rb
811 rdoc-sources/FXRectangle.rb
812 rdoc-sources/FXRegion.rb
813 rdoc-sources/FXRegistry.rb
814 rdoc-sources/FXReplaceDialog.rb
815 rdoc-sources/FXRootWindow.rb
816 rdoc-sources/FXRuler.rb
817 rdoc-sources/FXRulerView.rb
818 rdoc-sources/FXScintilla.rb
819 rdoc-sources/FXScrollArea.rb
820 rdoc-sources/FXScrollBar.rb
821 rdoc-sources/FXScrollPane.rb
822 rdoc-sources/FXScrollWindow.rb
823 rdoc-sources/FXSearchDialog.rb
824 rdoc-sources/FXSeparator.rb
825 rdoc-sources/FXSettings.rb
826 rdoc-sources/FXShell.rb
827 rdoc-sources/FXShutter.rb
828 rdoc-sources/FXSize.rb
829 rdoc-sources/FXSlider.rb
830 rdoc-sources/FXSphered.rb
831 rdoc-sources/FXSpheref.rb
832 rdoc-sources/FXSpinner.rb
833 rdoc-sources/FXSplashWindow.rb
834 rdoc-sources/FXSplitter.rb
835 rdoc-sources/FXSpring.rb
836 rdoc-sources/FXStatusBar.rb
837 rdoc-sources/FXStatusLine.rb
838 rdoc-sources/FXStream.rb
839 rdoc-sources/FXStringDict.rb
840 rdoc-sources/FXSwitcher.rb
841 rdoc-sources/FXTGAIcon.rb
842 rdoc-sources/FXTGAImage.rb
843 rdoc-sources/FXTIFIcon.rb
844 rdoc-sources/FXTIFImage.rb
845 rdoc-sources/FXTabBar.rb
846 rdoc-sources/FXTabBook.rb
847 rdoc-sources/FXTabItem.rb
848 rdoc-sources/FXTable.rb
849 rdoc-sources/FXText.rb
850 rdoc-sources/FXTextField.rb
851 rdoc-sources/FXToggleButton.rb
852 rdoc-sources/FXToolBar.rb
853 rdoc-sources/FXToolBarGrip.rb
854 rdoc-sources/FXToolBarShell.rb
855 rdoc-sources/FXToolBarTab.rb
856 rdoc-sources/FXToolTip.rb
857 rdoc-sources/FXTopWindow.rb
858 rdoc-sources/FXTranslator.rb
859 rdoc-sources/FXTreeList.rb
860 rdoc-sources/FXTreeListBox.rb
861 rdoc-sources/FXTriStateButton.rb
862 rdoc-sources/FXVec2d.rb
863 rdoc-sources/FXVec2f.rb
864 rdoc-sources/FXVec3d.rb
865 rdoc-sources/FXVec3f.rb
866 rdoc-sources/FXVec4d.rb
867 rdoc-sources/FXVec4f.rb
868 rdoc-sources/FXVerticalFrame.rb
869 rdoc-sources/FXVisual.rb
870 rdoc-sources/FXWindow.rb
871 rdoc-sources/FXWizard.rb
872 rdoc-sources/FXXBMIcon.rb
873 rdoc-sources/FXXBMImage.rb
874 rdoc-sources/FXXPMIcon.rb
875 rdoc-sources/FXXPMImage.rb
876 rdoc-sources/Makefile
877 rdoc-sources/README.rdoc
878 rdoc-sources/fxdefs.rb
879 scripts/build-fox.rb
880 scripts/generate_kwargs_lib.rb
881 scripts/iface.rb
882 swig-interfaces/FX4Splitter.i
883 swig-interfaces/FX7Segment.i
884 swig-interfaces/FXAccelTable.i
885 swig-interfaces/FXApp.i
886 swig-interfaces/FXArrowButton.i
887 swig-interfaces/FXBMPIcon.i
888 swig-interfaces/FXBMPImage.i
889 swig-interfaces/FXBitmap.i
890 swig-interfaces/FXBitmapFrame.i
891 swig-interfaces/FXBitmapView.i
892 swig-interfaces/FXButton.i
893 swig-interfaces/FXCURCursor.i
894 swig-interfaces/FXCanvas.i
895 swig-interfaces/FXCheckButton.i
896 swig-interfaces/FXChoiceBox.i
897 swig-interfaces/FXColorBar.i
898 swig-interfaces/FXColorDialog.i
899 swig-interfaces/FXColorList.i
900 swig-interfaces/FXColorRing.i
901 swig-interfaces/FXColorSelector.i
902 swig-interfaces/FXColorWell.i
903 swig-interfaces/FXColorWheel.i
904 swig-interfaces/FXComboBox.i
905 swig-interfaces/FXComposeContext.i
906 swig-interfaces/FXComposite.i
907 swig-interfaces/FXCursor.i
908 swig-interfaces/FXDC.i
909 swig-interfaces/FXDCPrint.i
910 swig-interfaces/FXDCWindow.i
911 swig-interfaces/FXDataTarget.i
912 swig-interfaces/FXDebugTarget.i
913 swig-interfaces/FXDelegator.i
914 swig-interfaces/FXDial.i
915 swig-interfaces/FXDialogBox.i
916 swig-interfaces/FXDict.i
917 swig-interfaces/FXDirBox.i
918 swig-interfaces/FXDirDialog.i
919 swig-interfaces/FXDirList.i
920 swig-interfaces/FXDirSelector.i
921 swig-interfaces/FXDockBar.i
922 swig-interfaces/FXDockHandler.i
923 swig-interfaces/FXDockSite.i
924 swig-interfaces/FXDockTitle.i
925 swig-interfaces/FXDocument.i
926 swig-interfaces/FXDragCorner.i
927 swig-interfaces/FXDrawable.i
928 swig-interfaces/FXDriveBox.i
929 swig-interfaces/FXExtentd.i
930 swig-interfaces/FXExtentf.i
931 swig-interfaces/FXFileDialog.i
932 swig-interfaces/FXFileDict.i
933 swig-interfaces/FXFileList.i
934 swig-interfaces/FXFileSelector.i
935 swig-interfaces/FXFileStream.i
936 swig-interfaces/FXFoldingList.i
937 swig-interfaces/FXFont.i
938 swig-interfaces/FXFontDialog.i
939 swig-interfaces/FXFontSelector.i
940 swig-interfaces/FXFrame.i
941 swig-interfaces/FXGIFCursor.i
942 swig-interfaces/FXGIFIcon.i
943 swig-interfaces/FXGIFImage.i
944 swig-interfaces/FXGLCanvas.i
945 swig-interfaces/FXGLContext.i
946 swig-interfaces/FXGLObject.i
947 swig-interfaces/FXGLShape.i
948 swig-interfaces/FXGLViewer.i
949 swig-interfaces/FXGLVisual.i
950 swig-interfaces/FXGradientBar.i
951 swig-interfaces/FXGroupBox.i
952 swig-interfaces/FXHeader.i
953 swig-interfaces/FXHorizontalFrame.i
954 swig-interfaces/FXICOIcon.i
955 swig-interfaces/FXICOImage.i
956 swig-interfaces/FXIcon.i
957 swig-interfaces/FXIconDict.i
958 swig-interfaces/FXIconList.i
959 swig-interfaces/FXIconSource.i
960 swig-interfaces/FXId.i
961 swig-interfaces/FXImage.i
962 swig-interfaces/FXImageFrame.i
963 swig-interfaces/FXImageView.i
964 swig-interfaces/FXInputDialog.i
965 swig-interfaces/FXJPGIcon.i
966 swig-interfaces/FXJPGImage.i
967 swig-interfaces/FXKnob.i
968 swig-interfaces/FXLabel.i
969 swig-interfaces/FXList.i
970 swig-interfaces/FXListBox.i
971 swig-interfaces/FXMDIButton.i
972 swig-interfaces/FXMDIChild.i
973 swig-interfaces/FXMDIClient.i
974 swig-interfaces/FXMainWindow.i
975 swig-interfaces/FXMat3d.i
976 swig-interfaces/FXMat3f.i
977 swig-interfaces/FXMat4d.i
978 swig-interfaces/FXMat4f.i
979 swig-interfaces/FXMatrix.i
980 swig-interfaces/FXMemoryBuffer.i
981 swig-interfaces/FXMemoryStream.i
982 swig-interfaces/FXMenuBar.i
983 swig-interfaces/FXMenuButton.i
984 swig-interfaces/FXMenuCaption.i
985 swig-interfaces/FXMenuCascade.i
986 swig-interfaces/FXMenuCheck.i
987 swig-interfaces/FXMenuCommand.i
988 swig-interfaces/FXMenuPane.i
989 swig-interfaces/FXMenuRadio.i
990 swig-interfaces/FXMenuSeparator.i
991 swig-interfaces/FXMenuTitle.i
992 swig-interfaces/FXMessageBox.i
993 swig-interfaces/FXObject.i
994 swig-interfaces/FXOptionMenu.i
995 swig-interfaces/FXPCXIcon.i
996 swig-interfaces/FXPCXImage.i
997 swig-interfaces/FXPNGIcon.i
998 swig-interfaces/FXPNGImage.i
999 swig-interfaces/FXPPMIcon.i
1000 swig-interfaces/FXPPMImage.i
1001 swig-interfaces/FXPacker.i
1002 swig-interfaces/FXPicker.i
1003 swig-interfaces/FXPoint.i
1004 swig-interfaces/FXPopup.i
1005 swig-interfaces/FXPrintDialog.i
1006 swig-interfaces/FXProgressBar.i
1007 swig-interfaces/FXProgressDialog.i
1008 swig-interfaces/FXQuatd.i
1009 swig-interfaces/FXQuatf.i
1010 swig-interfaces/FXRGBIcon.i
1011 swig-interfaces/FXRGBImage.i
1012 swig-interfaces/FXRadioButton.i
1013 swig-interfaces/FXRanged.i
1014 swig-interfaces/FXRangef.i
1015 swig-interfaces/FXRealSlider.i
1016 swig-interfaces/FXRealSpinner.i
1017 swig-interfaces/FXRecentFiles.i
1018 swig-interfaces/FXRectangle.i
1019 swig-interfaces/FXRegion.i
1020 swig-interfaces/FXRegistry.i
1021 swig-interfaces/FXReplaceDialog.i
1022 swig-interfaces/FXRootWindow.i
1023 swig-interfaces/FXRuler.i
1024 swig-interfaces/FXRulerView.i
1025 swig-interfaces/FXScintilla.i
1026 swig-interfaces/FXScrollArea.i
1027 swig-interfaces/FXScrollBar.i
1028 swig-interfaces/FXScrollPane.i
1029 swig-interfaces/FXScrollWindow.i
1030 swig-interfaces/FXSearchDialog.i
1031 swig-interfaces/FXSeparator.i
1032 swig-interfaces/FXSettings.i
1033 swig-interfaces/FXShell.i
1034 swig-interfaces/FXShutter.i
1035 swig-interfaces/FXSize.i
1036 swig-interfaces/FXSlider.i
1037 swig-interfaces/FXSphered.i
1038 swig-interfaces/FXSpheref.i
1039 swig-interfaces/FXSpinner.i
1040 swig-interfaces/FXSplashWindow.i
1041 swig-interfaces/FXSplitter.i
1042 swig-interfaces/FXSpring.i
1043 swig-interfaces/FXStatusBar.i
1044 swig-interfaces/FXStatusLine.i
1045 swig-interfaces/FXStream.i
1046 swig-interfaces/FXStringDict.i
1047 swig-interfaces/FXSwitcher.i
1048 swig-interfaces/FXTGAIcon.i
1049 swig-interfaces/FXTGAImage.i
1050 swig-interfaces/FXTIFIcon.i
1051 swig-interfaces/FXTIFImage.i
1052 swig-interfaces/FXTabBar.i
1053 swig-interfaces/FXTabBook.i
1054 swig-interfaces/FXTabItem.i
1055 swig-interfaces/FXTable.i
1056 swig-interfaces/FXText.i
1057 swig-interfaces/FXTextField.i
1058 swig-interfaces/FXToggleButton.i
1059 swig-interfaces/FXToolBar.i
1060 swig-interfaces/FXToolBarGrip.i
1061 swig-interfaces/FXToolBarShell.i
1062 swig-interfaces/FXToolBarTab.i
1063 swig-interfaces/FXToolTip.i
1064 swig-interfaces/FXTopWindow.i
1065 swig-interfaces/FXTranslator.i
1066 swig-interfaces/FXTreeList.i
1067 swig-interfaces/FXTreeListBox.i
1068 swig-interfaces/FXTriStateButton.i
1069 swig-interfaces/FXURL.i
1070 swig-interfaces/FXVec2d.i
1071 swig-interfaces/FXVec2f.i
1072 swig-interfaces/FXVec3d.i
1073 swig-interfaces/FXVec3f.i
1074 swig-interfaces/FXVec4d.i
1075 swig-interfaces/FXVec4f.i
1076 swig-interfaces/FXVerticalFrame.i
1077 swig-interfaces/FXVisual.i
1078 swig-interfaces/FXWindow.i
1079 swig-interfaces/FXWizard.i
1080 swig-interfaces/FXXBMIcon.i
1081 swig-interfaces/FXXBMImage.i
1082 swig-interfaces/FXXPMIcon.i
1083 swig-interfaces/FXXPMImage.i
1084 swig-interfaces/README
1085 swig-interfaces/common.i
1086 swig-interfaces/core.i
1087 swig-interfaces/dcmodule.i
1088 swig-interfaces/dialogs.i
1089 swig-interfaces/exceptions.i
1090 swig-interfaces/framesmodule.i
1091 swig-interfaces/freefuncs.i
1092 swig-interfaces/fx3d.i
1093 swig-interfaces/fxdefs.i
1094 swig-interfaces/handlers.i
1095 swig-interfaces/iconlistmodule.i
1096 swig-interfaces/icons.i
1097 swig-interfaces/ignore-message-handlers.rb
1098 swig-interfaces/image.i
1099 swig-interfaces/labelmodule.i
1100 swig-interfaces/layout.i
1101 swig-interfaces/listmodule.i
1102 swig-interfaces/macros.i
1103 swig-interfaces/markfuncs.i
1104 swig-interfaces/mdi.i
1105 swig-interfaces/menumodule.i
1106 swig-interfaces/ruby-typemaps.i
1107 swig-interfaces/scintilla.i
1108 swig-interfaces/table-module.i
1109 swig-interfaces/text-module.i
1110 swig-interfaces/treelist-module.i
1111 swig-interfaces/ui.i
1112 test/README
1113 test/TC_FXAccelTable.rb
1114 test/TC_FXApp.rb
1115 test/TC_FXArc.rb
1116 test/TC_FXBMPIcon.rb
1117 test/TC_FXBMPImage.rb
1118 test/TC_FXButton.rb
1119 test/TC_FXCheckButton.rb
1120 test/TC_FXComboBox.rb
1121 test/TC_FXDC.rb
1122 test/TC_FXDCPrint.rb
1123 test/TC_FXDCWindow.rb
1124 test/TC_FXDataTarget.rb
1125 test/TC_FXDialogBox.rb
1126 test/TC_FXDirList.rb
1127 test/TC_FXExtentd.rb
1128 test/TC_FXExtentf.rb
1129 test/TC_FXFileAssoc.rb
1130 test/TC_FXFileStream.rb
1131 test/TC_FXFoldingList.rb
1132 test/TC_FXFont.rb
1133 test/TC_FXFontDesc.rb
1134 test/TC_FXGLGroup.rb
1135 test/TC_FXGLShape.rb
1136 test/TC_FXGLViewer.rb
1137 test/TC_FXGradientBar.rb
1138 test/TC_FXHeader.rb
1139 test/TC_FXHiliteStyle.rb
1140 test/TC_FXIconDict.rb
1141 test/TC_FXIconList.rb
1142 test/TC_FXId.rb
1143 test/TC_FXImage.rb
1144 test/TC_FXLight.rb
1145 test/TC_FXList.rb
1146 test/TC_FXListBox.rb
1147 test/TC_FXMainWindow.rb
1148 test/TC_FXMat4f.rb
1149 test/TC_FXMaterial.rb
1150 test/TC_FXMemoryStream.rb
1151 test/TC_FXMenuCheck.rb
1152 test/TC_FXMenuCommand.rb
1153 test/TC_FXMenuRadio.rb
1154 test/TC_FXMessageBox.rb
1155 test/TC_FXPoint.rb
1156 test/TC_FXQuatf.rb
1157 test/TC_FXRadioButton.rb
1158 test/TC_FXRanged.rb
1159 test/TC_FXRangef.rb
1160 test/TC_FXRectangle.rb
1161 test/TC_FXRegion.rb
1162 test/TC_FXRegistry.rb
1163 test/TC_FXScrollArea.rb
1164 test/TC_FXScrollWindow.rb
1165 test/TC_FXSegment.rb
1166 test/TC_FXSettings.rb
1167 test/TC_FXShell.rb
1168 test/TC_FXSize.rb
1169 test/TC_FXStream.rb
1170 test/TC_FXTable.rb
1171 test/TC_FXTableItem.rb
1172 test/TC_FXText.rb
1173 test/TC_FXTopWindow.rb
1174 test/TC_FXTreeList.rb
1175 test/TC_FXTreeListBox.rb
1176 test/TC_FXUndoList.rb
1177 test/TC_FXVec2d.rb
1178 test/TC_FXVec2f.rb
1179 test/TC_FXVec3d.rb
1180 test/TC_FXVec3f.rb
1181 test/TC_FXVec4f.rb
1182 test/TC_FXViewport.rb
1183 test/TC_FXWindow.rb
1184 test/TC_FXXBMIcon.rb
1185 test/TC_FXXBMImage.rb
1186 test/TC_FXXPMIcon.rb
1187 test/TC_FXXPMImage.rb
1188 test/TC_Misc.rb
1189 test/TC_downcast.rb
1190 test/TS_All.rb
1191 test/blankpage.ps
1192 test/howdypage.ps
1193 test/stress1.rb
1194 test/stress2.rb
1195 test/stress3.rb
1196 test/testcase.rb
1197 web/community.html
1198 web/css/style.css
1199 web/documentation.html
1200 web/downloads.html
1201 web/images/bullet.gif
1202 web/images/button-bg.jpg
1203 web/images/comment.gif
1204 web/images/content.jpg
1205 web/images/dots.jpg
1206 web/images/footer.jpg
1207 web/images/fxruby-book.jpg
1208 web/images/header.png
1209 web/images/menu.jpg
1210 web/images/page.gif
1211 web/images/quote.gif
1212 web/images/square-green.png
1213 web/index.html
00 = FXRuby
11
22 * http://github.com/larskanis/fxruby
3 * API: http://rubydoc.info/gems/fxruby/frames
3 * Full API-description: http://rubydoc.info/gems/fxruby/frames
4 * Latest fxruby {<img src="https://badge.fury.io/rb/fxruby.svg" alt="Gem Version" />}[http://badge.fury.io/rb/fxruby]
5 * Status on Linux: {<img src="https://travis-ci.org/larskanis/fxruby.svg?branch=1.6" alt="Build Status on Linux" />}[https://travis-ci.org/larskanis/fxruby]
6 on Windows: {<img src="https://ci.appveyor.com/api/projects/status/too7sj4gq643ts8w/branch/1.6?svg=true" alt="Build Status on Windows" />}[https://ci.appveyor.com/project/larskanis/fxruby/branch/1.6]
7
8
49
510 == DESCRIPTION:
611
1318 same time taking advantage of the performance and functionality of a
1419 featureful, highly optimized C++ toolkit.
1520
16 == FEATURES/PROBLEMS:
21 == FEATURES:
1722
1823 FXRuby supportes everything of FOX, that is useful in Ruby:
1924 * MDI/SDI application window layouts, floating toolbars
2126 * Flexible layout management
2227 * Image read/write support in many formats
2328 * Embedded OpenGL graphics
29 * Thread support
2430
2531 == INSTALL:
2632
27 FXRuby runs on Linux, Windows and OS-X. Installation on *nix requires
33 FXRuby runs on Linux, Windows and OS-X with Ruby-2.2 or newer. Installation on Unix requires
2834 FOX development headers and libraries installed:
2935 * on Debian/Ubuntu: <tt>sudo apt-get install g++ libxrandr-dev libfox-1.6-dev</tt>
3036 * see also detailed installation instructions in the {https://github.com/lylejohnson/fxruby/wiki Wiki}
31 * no preparation needed on Windows - the binary gem can be used
37 * on Windows: the binary fxruby gems already contain all required libararies
3238
3339 Then, install the gem:
3440 * gem install fxruby
+233
-134
Rakefile less more
00 require 'rubygems'
1 require 'hoe'
21 require 'erb'
2 require 'date'
33 require 'rake/extensiontask'
4 require 'bundler'
5 require 'bundler/gem_helper'
46 require './lib/fox16/version.rb'
57
6 # Use forked process for chdir'ed environment, to allow parallel execution with drake
7 module FileUtils
8 alias unforked_fileutils_cd cd
9 def cd(dir, options={}, &block)
10 raise "chdir called without block" unless block_given?
11 Process.waitpid(fork{ unforked_fileutils_cd(dir, options, &block) })
12 end
13 module_function :cd
14 alias chdir cd
15 module_function :chdir
8
9 class FoxGemHelper < Bundler::GemHelper
10 attr_accessor :cross_platforms
11
12 def install
13 super
14
15 task "release:guard_clean" => ["release:update_history"]
16
17 task "release:update_history" do
18 update_history
19 end
20
21 task "release:rubygem_push" => ["gem:windows"]
22 end
23
24 def hfile
25 "History.md"
26 end
27
28 def headline
29 '([^\w]*)(\d+\.\d+\.\d+(?:\.\w+)?)([^\w]+)([2Y][0Y][0-9Y][0-9Y]-[0-1M][0-9M]-[0-3D][0-9D])([^\w]*|$)'
30 end
31
32 def reldate
33 Time.now.strftime("%Y-%m-%d")
34 end
35
36 def update_history
37 hin = File.read(hfile)
38 hout = hin.sub(/#{headline}/) do
39 raise "#{hfile} isn't up-to-date for version #{version}" unless $2==version.to_s
40 $1 + $2 + $3 + reldate + $5
41 end
42 if hout != hin
43 Bundler.ui.confirm "Updating #{hfile} for release."
44 File.write(hfile, hout)
45 Rake::FileUtilsExt.sh "git", "commit", hfile, "-m", "Update release date in #{hfile}"
46 end
47 end
48
49 def tag_version
50 Bundler.ui.confirm "Tag release with annotation:"
51 m = File.read(hfile).match(/(?<annotation>#{headline}.*?)#{headline}/m) || raise("Unable to find release notes in #{hfile}")
52 Bundler.ui.info(m[:annotation].gsub(/^/, " "))
53 IO.popen(["git", "tag", "--file=-", version_tag], "w") do |fd|
54 fd.write m[:annotation]
55 end
56 yield if block_given?
57 rescue
58 Bundler.ui.error "Untagging #{version_tag} due to error."
59 sh_with_code "git tag -d #{version_tag}"
60 raise
61 end
62
63 def rubygem_push(path)
64 cross_platforms.each do |ruby_platform|
65 super(path.gsub(/\.gem\z/, "-#{ruby_platform}.gem"))
66 end
67 super(path)
68 end
1669 end
1770
1871 # Some constants we'll need
19 PKG_VERSION = Fox.fxrubyversion
72 LIBFXSCINTILLA_VERSION = ENV['LIBFXSCINTILLA_VERSION'] || '2.28.0'
73 LIBFXSCINTILLA_SOURCE_URI = "http://download.savannah.gnu.org/releases/fxscintilla/fxscintilla-#{LIBFXSCINTILLA_VERSION}.tar.gz"
2074
2175 SWIG = (RUBY_PLATFORM =~ /mingw/) ? "swig.exe" : "swig"
2276 SWIGFLAGS = "-c++ -ruby -nodefaultdtor -nodefaultctor -w302 -features compactdefaultargs -I../fox-includes"
23 SWIG_LIB = `#{SWIG} -swiglib`.chomp
24 SWIG_MODULES = {
25 "core.i" => "core_wrap.cpp",
26 "dcmodule.i" => "dc_wrap.cpp",
27 "dialogs.i" => "dialogs_wrap.cpp",
28 "framesmodule.i" => "frames_wrap.cpp",
29 "iconlistmodule.i" => "iconlist_wrap.cpp",
30 "icons.i" => "icons_wrap.cpp",
31 "image.i" => "image_wrap.cpp",
32 "labelmodule.i" => "label_wrap.cpp",
33 "layout.i" => "layout_wrap.cpp",
34 "listmodule.i" => "list_wrap.cpp",
35 "mdi.i" => "mdi_wrap.cpp",
36 "menumodule.i" => "menu_wrap.cpp",
37 "fx3d.i" => "fx3d_wrap.cpp",
38 "scintilla.i" => "scintilla_wrap.cpp",
39 "table-module.i" => "table_wrap.cpp",
40 "text-module.i" => "text_wrap.cpp",
41 "treelist-module.i" => "treelist_wrap.cpp",
42 "ui.i" => "ui_wrap.cpp"
43 }
44
45
46 hoe = Hoe.spec "fxruby" do
47 # ... project specific data ...
48 self.blog_categories = %w{FXRuby}
49 self.clean_globs = [".config", "ext/fox16_c/Makefile", "ext/fox16_c/*.o", "ext/fox16_c/*.bundle", "ext/fox16_c/mkmf.log", "ext/fox16_c/conftest.dSYM", "ext/fox16_c/include/swigrubyrun.h", "ext/fox16_c/librb.c", "ext/fox16_c/include/inlinestubs.h", "ext/fox16_c/*_wrap.cpp"]
50 developer("Lyle Johnson", "[email protected]")
51 developer("Lars Kanis", "[email protected]")
52 self.extra_rdoc_files = ["rdoc-sources", File.join("rdoc-sources", "README.rdoc")]
53 self.remote_rdoc_dir = "doc/api"
54 self.spec_extras = {
55 :description => "FXRuby is the Ruby binding to the FOX GUI toolkit.",
56 :extensions => ["ext/fox16_c/extconf.rb"],
57 :rdoc_options => ['--main', File.join('rdoc-sources', 'README.rdoc'), '--exclude', 'ext/fox16_c', '--exclude', %r{aliases|kwargs|missingdep|responder}.inspect],
58 :require_paths => ['lib'],
59 :summary => "FXRuby is the Ruby binding to the FOX GUI toolkit."
60 }
61 self.test_globs = ["test/**/TC_*.rb"]
62 self.version = PKG_VERSION
63 self.readme_file = 'README.rdoc'
64 self.extra_rdoc_files << self.readme_file
65
66 spec_extras[:files] = File.read_utf("Manifest.txt").split(/\r?\n\r?/).reject{|f| f=~/^fox-includes|^web/ }
67 spec_extras[:files] += SWIG_MODULES.values.map{|f| File.join("ext/fox16_c", f) }
68 spec_extras[:files] << 'ext/fox16_c/include/inlinestubs.h'
69 spec_extras[:files] << 'ext/fox16_c/swigruby.h'
70 spec_extras[:files] << 'doap.rdf'
71 spec_extras[:files] << 'lib/fox16/kwargs.rb'
72 end
77
78 CLEAN.include( ".config", "ext/fox16_c/Makefile", "ext/fox16_c/*.o", "ext/fox16_c/*.bundle", "ext/fox16_c/mkmf.log", "ext/fox16_c/conftest.dSYM", "ext/fox16_c/swigruby.h*", "ext/fox16_c/librb.c", "ext/fox16_c/include/inlinestubs.h", "ext/fox16_c/*_wrap.cpp", "tmp", "ports/*.installed", "ports/*mingw32*" )
79
80 CLOBBER.include( "pkg" )
7381
7482 # Make sure extension is built before tests are run
75 task :test => [:compile]
76
77 # The "docs" task created by Hoe assumes that we want to run RDoc
78 # over everything under the "lib" and "ext" subdirectories.
79 # We need to go back and tell it to skip the stuff under ext.
80 # rdoc_target = Rake::Task['docs'].prerequisites.first
81 # rdoc_files = Rake::Task[rdoc_target].prerequisites
82 # rdoc_files.reject! {|x| x == "ext/fox16_c" }
83
84 # Make sure that all of the package contents exist before we try to build the package
85 #Rake::Task['package'].prerequisites.unshift("swig:swig", "fxruby:setversions", "fxruby:generate_kwargs_lib")
86
87 # ... project specific tasks ...
88
89 Rake::ExtensionTask.new("fox16_c", hoe.spec) do |ext|
83 task :test => [:compile] do
84 sh "ruby -w -W2 -Ilib test/TS_All.rb -v"
85 end
86
87 task :gem => ["ext/fox16_c/extconf.rb", "fxruby:configure", :build]
88
89
90 gem_spec = Bundler.load_gemspec('fxruby.gemspec')
91
92 ext_task = Rake::ExtensionTask.new("fox16_c", gem_spec) do |ext|
9093 ext.cross_compile = true
9194 ext.cross_platform = ['x86-mingw32', 'x64-mingw32']
95 # Enable FXTRACE and FXASSERT for 'rake compile'
96 ext.config_options << "--enable-debug"
9297
9398 ext.cross_config_options += [
9499 "--enable-win32-cross",
95100 "--with-fxscintilla",
96101 ]
102 ext.cross_config_options << "--enable-debug" if ENV['FXRUBY_MINGW_DEBUG']
97103
98104 # Add dependent DLLs to the cross gems
99105 ext.cross_compiling do |spec|
100 plat = spec.platform
101 dlls = Dir["tmp/#{plat}/#{ext.name}/*/*.dll"].map{|dll| File.basename(dll) }.uniq
102 spec.files += dlls.map{|dll| "lib/#{plat}/#{dll}" }
103
104 directory "tmp/#{plat}/stage/lib/#{plat}/"
105 dlls.each do |dll|
106 ENV['RUBY_CC_VERSION'].to_s.split(':').last.tap do |ruby_version|
107 file "tmp/#{plat}/stage/lib/#{plat}/#{dll}" => ["tmp/#{plat}/stage/lib/#{plat}/", "tmp/#{plat}/#{ext.name}/#{ruby_version}/#{dll}"] do
108 cp "tmp/#{plat}/#{ext.name}/#{ruby_version}/#{dll}", "tmp/#{plat}/stage/lib/#{plat}"
109 sh "x86_64-w64-mingw32-strip", "tmp/#{plat}/stage/lib/#{plat}/#{dll}"
106 # The fat binary gem doesn't depend on the fox package, since it bundles the libraries.
107 spec.metadata.delete('msys2_mingw_dependencies')
108
109 platform_host_map = {
110 'x86-mingw32' => ['i686-w64-mingw32'],
111 'x64-mingw32' => ['x86_64-w64-mingw32'],
112 }
113
114 gemplat = spec.platform.to_s
115 platform_host_map[gemplat].each do |host|
116
117 gcc_shared_dlls = %w[libwinpthread-1.dll libgcc_s_dw2-1.dll libgcc_s_sjlj-1.dll libgcc_s_seh-1.dll libstdc++-6.dll]
118
119 dlls = gcc_shared_dlls.select{|dll| File.exist?("ports/#{host}/bin/#{dll}") }
120 dlls += [
121 "libfxscintilla-20.dll",
122 "libFOX-1.6-0.dll",
123 "libjpeg-62.dll",
124 "libpng16-16.dll",
125 "libtiff-5.dll",
126 "zlib1.dll",
127 ]
128
129 spec.files += dlls.map{|dll| "ports/#{host}/bin/#{dll}" }
130
131 unless ENV['FXRUBY_MINGW_DEBUG']
132 dlls.each do |dll|
133 task "ports/#{host}/bin/#{dll}" do |t|
134 sh "#{host}-strip", t.name
135 end
110136 end
111137 end
112 file "lib/#{plat}/#{dll}" => "tmp/#{plat}/stage/lib/#{plat}/#{dll}"
113 end
114 end
115 end
116
117 # To reduce the gem file size strip mingw32 dlls before packaging
118 ENV['RUBY_CC_VERSION'].to_s.split(':').each do |ruby_version|
119 task "tmp/x86-mingw32/stage/lib/#{ruby_version[/^\d+\.\d+/]}/fox16_c.so" do |t|
120 sh "i686-w64-mingw32-strip -S tmp/x86-mingw32/stage/lib/#{ruby_version[/^\d+\.\d+/]}/fox16_c.so"
121 end
122
123 task "tmp/x64-mingw32/stage/lib/#{ruby_version[/^\d+\.\d+/]}/fox16_c.so" do |t|
124 sh "x86_64-w64-mingw32-strip -S tmp/x64-mingw32/stage/lib/#{ruby_version[/^\d+\.\d+/]}/fox16_c.so"
125 end
126 end
127
128 # Set environment variable SWIG_LIB to
129 # c:/ruby-1.8.6-p383-preview2/devkit/msys/1.0.11/usr/local/share/swig/1.3.22
130 # before running swig on MinGW.
138 end
139 end
140
141 FoxGemHelper.install_tasks
142 Bundler::GemHelper.instance.cross_platforms = ext.cross_platform
143 end
144
145 namespace :gem do
146 ext_task.cross_platform.each do |plat|
147 desc "Build the windows binary gems"
148 multitask 'windows' => plat
149
150 task 'prepare' do
151 require 'rake_compiler_dock'
152 sh "bundle package"
153 end
154
155 task plat => ['gem', 'prepare'] do
156 debug = "FXRUBY_MINGW_DEBUG=#{ENV['FXRUBY_MINGW_DEBUG'].inspect}" if ENV['FXRUBY_MINGW_DEBUG']
157 RakeCompilerDock.sh <<-EOT, platform: plat
158 sudo apt update &&
159 sudo apt install yasm &&
160 bundle --local --without=test &&
161 rake native:#{plat} pkg/#{ext_task.gem_spec.full_name}-#{plat}.gem MAKE=\"nice make V=1 VERBOSE=1 -j `nproc`\" #{debug}
162 EOT
163 end
164 end
165 end
166
131167 namespace :swig do
168 def patch_swigruby(line)
169 # Ruby-2.7+ finally changed callback function signatures from (*)(ANYARGS) to a proper signature, on which the compiler is able to check parameter types.
170 # Unfortunately this requires a bunch of patches to swig's generated code.
171
172 line.gsub! '#include <ruby.h>', <<-EOT
173 #include <ruby.h>
174
175 #if defined(RB_METHOD_DEFINITION_DECL)
176 # define RUBY_VALUE_METHOD_FUNC(func) (func)
177 # define RUBY_INT_METHOD_FUNC(func) (func)
178 # define RUBY_VOID_METHOD_FUNC(func) (func)
179 # define RUBY_VOIDP_METHOD_FUNC(func) (func)
180 #else
181 # define RUBY_VALUE_METHOD_FUNC(func) ((VALUE (*)(ANYARGS))(func))
182 # define RUBY_INT_METHOD_FUNC(func) ((int (*)(ANYARGS))(func))
183 # define RUBY_VOID_METHOD_FUNC(func) ((void (*)(ANYARGS))(func))
184 # define RUBY_VOIDP_METHOD_FUNC(func) ((void *(*)(ANYARGS))(func))
185 #endif
186 EOT
187 line.gsub! /rb_define_virtual_variable\((.*?), (\w+), NULL\)/, <<-EOT
188 rb_define_virtual_variable(\\1, RUBY_VALUE_METHOD_FUNC(\\2), RUBY_VOID_METHOD_FUNC((rb_gvar_setter_t*)NULL))
189 EOT
190
191 line.gsub!('static VALUE swig_ruby_trackings_count(ANYARGS)', 'static VALUE swig_ruby_trackings_count(ID id, VALUE *var)')
192 line.gsub!('SWIG_ruby_failed(void)', 'SWIG_ruby_failed(VALUE, VALUE)')
193
194 line.gsub!(/SWIGINTERN VALUE SWIG_AUX_(\w+)\(VALUE \*args\)\s\{/m, 'SWIGINTERN VALUE SWIG_AUX_\\1(VALUE pargs){VALUE *args=(VALUE *)pargs;')
195
196 line.gsub! /static int swig_ruby_internal_iterate_callback\(void\* ptr, VALUE obj, void\(\*meth\)\(void\* ptr, VALUE obj\)\)\s*{\s*\(\*meth\)\(ptr, obj\);/m, <<-EOT
197 static int swig_ruby_internal_iterate_callback(st_data_t ptr, st_data_t obj, st_data_t meth) {
198 ((void(*)(void*, VALUE))meth)((void*)ptr, (VALUE)obj);
199 EOT
200
201 line.gsub!('(int (*)(ANYARGS))&swig_ruby_internal_iterate_callback', 'RUBY_INT_METHOD_FUNC(swig_ruby_internal_iterate_callback)')
202
203 line.gsub! /rb_ensure\(VALUEFUNC\((.*)\), self, VALUEFUNC\((.*)\), self\);/, 'rb_ensure(RUBY_VALUE_METHOD_FUNC(\\1), self, RUBY_VALUE_METHOD_FUNC(\\2), self);'
204 line.gsub! /rb_rescue\(RUBY_METHOD_FUNC\((.*)\), \(VALUE\)a, RUBY_METHOD_FUNC\((.*)\), 0\)/, 'rb_rescue(RUBY_VALUE_METHOD_FUNC(\\1), (VALUE)a, RUBY_VALUE_METHOD_FUNC(\\2), 0)'
205
206 line
207 end
208
132209 def sed(wrapper_src_file_name)
133 results = []
134 IO.readlines(wrapper_src_file_name).each do |line|
135 line.gsub!(/static VALUE mCore;/, "VALUE mCore;")
136 line.gsub!(/mCore = rb_define_module\("Core"\)/, "mFox = rb_define_module(\"Fox\")")
137 line.gsub!(/mCore/, "mFox")
138 next if line =~ /static VALUE m(Dc|Dialogs|Frames|Iconlist|Icons|Image|Label|Layout|List|Mdi|Menu|Fx3d|Scintilla|Table|Text|Treelist|Ui);/
139 next if line =~ /m(Dc|Dialogs|Frames|Iconlist|Icons|Image|Label|Layout|List|Mdi|Menu|Fx3d|Scintilla|Table|Text|Treelist|Ui) = rb_define_module/
140 next if line =~ /rb_require/
141 line.gsub!(/m(Dc|Dialogs|Frames|Iconlist|Icons|Image|Label|Layout|List|Mdi|Menu|Fx3d|Scintilla|Table|Text|Treelist|Ui),/, "mFox,")
142 results << line
143 end
144 File.open(wrapper_src_file_name, "w") do |io|
145 io.write(results.join)
146 end
210 puts "Update #{wrapper_src_file_name}"
211
212 line = File.read(wrapper_src_file_name)
213 line.gsub!(/static VALUE mCore;/, "VALUE mCore;")
214 line.gsub!(/mCore = rb_define_module\("Core"\)/, "mFox = rb_define_module(\"Fox\")")
215 line.gsub!(/mCore/, "mFox")
216 line.gsub!(/static VALUE m(Dc|Dialogs|Frames|Iconlist|Icons|Image|Label|Layout|List|Mdi|Menu|Fx3d|Scintilla|Table|Text|Treelist|Ui);/, '')
217 line.gsub!(/m(Dc|Dialogs|Frames|Iconlist|Icons|Image|Label|Layout|List|Mdi|Menu|Fx3d|Scintilla|Table|Text|Treelist|Ui) = rb_define_module.*/, '')
218 line.gsub!(/rb_require.*/, '')
219 line.gsub!(/m(Dc|Dialogs|Frames|Iconlist|Icons|Image|Label|Layout|List|Mdi|Menu|Fx3d|Scintilla|Table|Text|Treelist|Ui),/, "mFox,")
220
221 line = patch_swigruby(line)
222
223 File.write(wrapper_src_file_name, line)
224 end
225
226 def add_with_fxscintilla_cond(file)
227 puts "Update #{file} for fxscintilla"
228 content = File.binread(file)
229 content = "#ifdef WITH_FXSCINTILLA\n" + content + "#endif /* WITH_FXSCINTILLA */\n"
230 File.binwrite(file, content)
147231 end
148232
149233 def swig(swig_interface_file_name, wrapper_src_file_name)
150234 cmd = "#{SWIG} #{SWIGFLAGS} -o #{wrapper_src_file_name} #{swig_interface_file_name}"
151235 puts cmd
152236 system cmd
237
238 # Do our own wrapper file modifications:
153239 sed wrapper_src_file_name
240 add_with_fxscintilla_cond(wrapper_src_file_name) if ["scintilla_wrap.cpp"].include?(File.basename(wrapper_src_file_name))
154241 end
155242
156243 task :swigruby_h => ["ext/fox16_c/swigruby.h"]
157 file "ext/fox16_c/swigruby.h" do |task|
244 file "ext/fox16_c/swigruby.h.orig" do |task|
158245 puts "generate #{task.name}"
159246 system "#{SWIG} -ruby -external-runtime #{task.name}"
160247 end
161248
249 file "ext/fox16_c/swigruby.h"=>["ext/fox16_c/swigruby.h.orig"] do |task|
250 puts "generate #{task.name}"
251 text = File.read(task.prerequisites[0])
252 text = patch_swigruby(text)
253 File.write(task.name, text)
254 end
255
162256 desc "Run SWIG to generate the wrapper files."
163 task :swig => [:swigruby_h] + SWIG_MODULES.map{|ifile, cppfile| File.join("ext/fox16_c", cppfile) }
164
165 # add dependencies for compile *.i to *_wrap.cpp
166 SWIG_MODULES.each do |ifile, cppfile|
167 cppfile_path = File.join("ext/fox16_c", cppfile)
168
169 file cppfile_path => [ifile, 'macros.i', 'common.i', 'fxdefs.i', 'ruby-typemaps.i',
170 'markfuncs.i', 'exceptions.i', 'freefuncs.i', 'macros.i', 'handlers.i'
171 ].map{|f| File.join("swig-interfaces", f) } do |task|
172 swig(File.join("swig-interfaces", ifile), cppfile_path)
173 end
257 multitask :swig => [:swigruby_h] + SWIG_MODULES.map{|ifile, cppfile| File.join("ext/fox16_c", cppfile) }
258 end
259
260 # add dependencies for compile *.i to *_wrap.cpp
261 SWIG_MODULES.each do |ifile, cppfile|
262 cppfile_path = File.join("ext/fox16_c", cppfile)
263
264 file cppfile_path => [ifile, 'macros.i', 'common.i', 'fxdefs.i', 'ruby-typemaps.i',
265 'markfuncs.i', 'exceptions.i', 'freefuncs.i', 'macros.i', 'handlers.i'
266 ].map{|f| File.join("swig-interfaces", f) } do |task|
267 swig(File.join("swig-interfaces", ifile), cppfile_path)
174268 end
175269 end
176270
220314 make_impl
221315 end
222316
223 file "ext/fox16_c/extconf.rb" => ['ext/fox16_c/swigruby.h', 'ext/fox16_c/impl.cpp', 'ext/fox16_c/include/inlinestubs.h'] +
224 SWIG_MODULES.map{|ifile, cppfile| File.join("ext/fox16_c", cppfile) }
317 file "ext/fox16_c/extconf.rb" => ['ext/fox16_c/impl.cpp', 'ext/fox16_c/include/inlinestubs.h', 'swig:swig']
318
319
320 directory "ports/archives"
321 file "ports/archives/fxscintilla-2.28.0.tar.gz" => ["ports/archives"] do |t|
322 sh "wget #{LIBFXSCINTILLA_SOURCE_URI} -O #{t.name}"
323 end
225324
226325 directory "tmp/fxscintilla"
227326 task "tmp/fxscintilla/fxscintilla-2.28.0/include/Scintilla.iface" => ["tmp/fxscintilla", "ports/archives/fxscintilla-2.28.0.tar.gz"] do
0 init:
1 - SET PATH=c:/Ruby%ruby_version%/bin;c:/msys64/%MSYSTEM%/bin;%PATH%
2 - SET RAKEOPT=-rdevkit
3 install:
4 - ps: |
5 if ($env:ruby_version -like "*head*") {
6 $(new-object net.webclient).DownloadFile("https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-$env:ruby_version.exe", "$pwd/ruby-setup.exe")
7 cmd /c ruby-setup.exe /verysilent /dir=C:/Ruby$env:ruby_version
8 }
9 - ruby --version
10 - gem --version
11 - ridk version
12 # Remove gcc-ada and gcc-objc, since they are no longer supported by msys2 and therefore cause a dependency issue
13 - c:/msys64/usr/bin/bash -lc "pacman --noconfirm --remove mingw-w64-i686-gcc-ada mingw-w64-i686-gcc-objc mingw-w64-x86_64-gcc-ada mingw-w64-x86_64-gcc-objc"
14 - c:/msys64/usr/bin/bash -lc "pacman -Syu --noconfirm --ask 20"
15 - c:/msys64/usr/bin/bash -lc "pacman -Su --noconfirm"
16 - c:/msys64/usr/bin/bash -lc "pacman -S --noconfirm --needed ${MINGW_PACKAGE_PREFIX}-fox ${MINGW_PACKAGE_PREFIX}-swig"
17 - swig -version
18 - gem install bundler --conservative
19 - bundle config set force_ruby_platform true
20 - bundle install
21 build_script:
22 - bundle exec rake compile
23 test_script:
24 - bundle exec rake test
25 environment:
26 matrix:
27 - ruby_version: "head-x64"
28 MINGW_PACKAGE_PREFIX: "mingw-w64-x86_64"
29 MSYSTEM: "MINGW64"
30 - ruby_version: "24"
31 MINGW_PACKAGE_PREFIX: "mingw-w64-i686"
32 MSYSTEM: "MINGW32"
7777 <doap:Version>
7878 <doap:branch>fox16</doap:branch>
7979 <doap:created><%= Date.today %></doap:created>
80 <doap:revision><%= PKG_VERSION %></doap:revision>
80 <doap:revision><%= Fox.fxrubyversion %></doap:revision>
8181 </doap:Version>
8282 </doap:release>
8383
133133 saveDialog = FXFileDialog.new(self, "Save Image")
134134 saveDialog.filename = @itemList.getItemText(@itemList.currentItem)
135135 if saveDialog.execute != 0
136 if File.exists? saveDialog.filename
136 if File.exist? saveDialog.filename
137137 if MBOX_CLICKED_NO == FXMessageBox.question(self, MBOX_YES_NO,
138138 "Overwrite Image", "Overwrite existing image?")
139139 return 1
311311 # Construct the application
312312 application = FXApp.new("GLTest", "FoxTest")
313313
314 # To ensure that the chores-based spin will run as fast as possible,
315 # we can disable the chore in FXRuby's event loop that tries to schedule
316 # other threads. This is OK for this program because there aren't any
317 # other Ruby threads running.
318
319 application.disableThreads
320
321314 # Construct the main window
322315 GLTestWindow.new(application)
323316
360360 show(PLACEMENT_SCREEN)
361361
362362 # Create a thread to update the clock
363 @clockThread = Thread.new(@clockLabel) { |clockLabel|
363 @clockThread = Thread.new(@clockLabel) do |clockLabel|
364364 while true
365 clockLabel.text = Time.now.strftime("%I:%M:%S %p")
365 runOnUiThread do
366 clockLabel.text = Time.now.strftime("%I:%M:%S %p")
367 end
366368 sleep(1)
367369 end
368 }
370 end
369371 end
370372 end
371373
325325 def onCmdSave(sender, sel, ptr)
326326 saveDialog = FXFileDialog.new(self, "Save Image")
327327 if saveDialog.execute != 0
328 if File.exists? saveDialog.filename
328 if File.exist? saveDialog.filename
329329 if MBOX_CLICKED_NO == FXMessageBox.question(self, MBOX_YES_NO,
330330 "Overwrite Image", "Overwrite existing image?")
331331 return 1
2020
2121 # Output will be displayed in a multiline text area
2222 @cmdOutput = FXText.new(textFrame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
23 @cmdInput.text = "ping rubyinstaller.org"
2324
2425 # Initialize the pipe
2526 @pipe = nil
2930 def create
3031 super
3132 show(PLACEMENT_SCREEN)
33 @cmdInput.setFocus
3234 end
3335
3436 # Remove previous input (if any)
5355 getApp().addInput(@pipe, INPUT_READ|INPUT_EXCEPT) do |sender, sel, ptr|
5456 case FXSELTYPE(sel)
5557 when SEL_IO_READ
56 text = @pipe.read_nonblock(256)
57 if text && text.length > 0
58 begin
59 text = @pipe.read_nonblock(256)
60 rescue IO::WaitReadable
61 rescue EOFError
62 @cmdOutput.appendText("[EOF]")
63 closePipe
64 else
5865 @cmdOutput.appendText(text)
59 else
60 closePipe
6166 end
6267 when SEL_IO_EXCEPT
6368 # puts 'onPipeExcept'
4646 theLabel.layoutHints = LAYOUT_FILL_X
4747 end
4848
49 FXTextField.new(top, 20, @text, FXDataTarget::ID_VALUE) do |theTextField|
49 @theTextField = FXTextField.new(top, 20, @text, FXDataTarget::ID_VALUE) do |theTextField|
5050 theTextField.layoutHints = LAYOUT_FILL_X
51 theTextField.setFocus()
5251 end
5352
5453 FXButton.new(top, 'Pig It') do |pigButton|
6564 def create
6665 super
6766 show(PLACEMENT_SCREEN)
67 @theTextField.setFocus
6868 end
6969 end
7070
10241024 return false if (savedialog.execute == 0)
10251025 setCurrentPattern(savedialog.currentPattern)
10261026 file = savedialog.filename
1027 if File.exists?(file)
1027 if File.exist?(file)
10281028 if MBOX_CLICKED_NO == FXMessageBox.question(self, MBOX_YES_NO,
10291029 "Overwrite Document", "Overwrite existing document: #{file}?")
10301030 return false
10911091 if savedialog.execute != 0
10921092 setCurrentPattern(savedialog.currentPattern)
10931093 file = savedialog.filename
1094 if File.exists?(file)
1094 if File.exist?(file)
10951095 if MBOX_CLICKED_NO == FXMessageBox.question(self, MBOX_YES_NO,
10961096 "Overwrite Document", "Overwrite existing document: #{file}?")
10971097 return 1
11331133 # Attempt to extract the file name from various forms
11341134 if string =~ /#include \".*\"/
11351135 file = File.expand_path(name, dir)
1136 if !File.exists?(file)
1136 if !File.exist?(file)
11371137 Find.find(@searchpath) { |f| file = f if (f == name) }
11381138 end
11391139 elsif string =~ /#include <.*>/
11401140 file = File.expand_path(name, dir)
1141 if !File.exists?(file)
1141 if !File.exist?(file)
11421142 Find.find(@searchpath) { |f| file = f if (f == name) }
11431143 end
11441144 elsif string =~ /.*:.*:.*/
11451145 file = File.expand_path(name, dir)
1146 if !File.exists?(file)
1146 if !File.exist?(file)
11471147 Find.find(@searchpath) { |f| file = f if (f == name) }
11481148 end
11491149 else
11501150 file = File.expand_path(string, dir)
11511151 end
11521152
1153 if File.exists?(file)
1153 if File.exist?(file)
11541154 # Different from current file?
11551155 if file != @filename
11561156 # Save old file first
12121212 if savedialog.execute != 0
12131213 setCurrentPattern(savedialog.currentPattern)
12141214 file = savedialog.filename
1215 if File.exists?(file)
1215 if File.exist?(file)
12161216 if MBOX_CLICKED_NO == FXMessageBox.question(self, MBOX_YES_NO,
12171217 "Overwrite Document", "Overwrite existing document: #{file}?")
12181218 return 1
16891689
16901690 # Update box for readonly display
16911691 def onCheckFile(sender, sel, ptr)
1692 mtime = File.exists?(@filename) ? File.mtime(@filename) : nil
1692 mtime = File.exist?(@filename) ? File.mtime(@filename) : nil
16931693 if @filetime && mtime && mtime != @filetime
16941694 @filetime = mtime
16951695 if MBOX_CLICKED_OK == FXMessageBox.warning(self, MBOX_OK_CANCEL,
0 #!/usr/bin/env ruby
1
2 require 'fox16'
3
4 class ThreadedWindow < Fox::FXMainWindow
5 include Fox
6
7 def initialize(app)
8 # Call the base class initializer first
9 super(app, "Threaded Widget Test", :opts => DECOR_ALL, width: 200, height: 500)
10
11 @vframe = FXVerticalFrame.new(self,
12 FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL, :padding => 0) do |frame|
13 FXButton.new(frame, "Click to add", opts: FRAME_RAISED|FRAME_THICK|LAYOUT_FILL_X) do |button|
14 button.connect(SEL_COMMAND, method(:on_button_clicked))
15 end
16 end
17 end
18
19 def on_button_clicked(sender, sel, ptr)
20 FXHorizontalFrame.new(@vframe,
21 FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL, :padding => 10) do |frame|
22
23 label = FXLabel.new frame, "..."
24
25 Thread.new do
26 50.times do |seconds|
27 runOnUiThread do
28 label.text = "#{(50 - seconds)/10.0} seconds to remove"
29 end
30 sleep 0.1
31 end
32
33 runOnUiThread do
34 @vframe.removeChild(frame)
35 @vframe.create; @vframe.show; @vframe.recalc
36 end
37 end
38 end
39 @vframe.create; @vframe.show; @vframe.recalc
40 end
41
42 # Create and show this window
43 def create
44 super
45 show(PLACEMENT_SCREEN)
46 end
47 end
48
49 if __FILE__ == $0
50 application = Fox::FXApp.new("ThreadApp", "FoxTest")
51 ThreadedWindow.new(application)
52 application.create
53 application.run
54 end
00 #!/usr/bin/env ruby
1 # -*- encoding: UTF-8 -*-
12
23 require 'fox16'
3 require 'jcode'
4
5 $KCODE = 'UTF8'
6
7 class UString < String
8 # Show u-prefix as in Python
9 def inspect; "u#{ super }" end
10
11 # Count multibyte characters
12 def length; self.scan(/./).length end
13
14 # Reverse the string
15 def reverse; self.scan(/./).reverse.join end
16 end
17
18 module Kernel
19 def u( str )
20 UString.new str.gsub(/U\+([0-9a-fA-F]{4,4})/u){["#$1".hex ].pack('U*')}
21 end
22 end
23
24 include Fox
254
265 # Pass UTF-8 encoded Unicode strings to FXRuby.
27 label = u"Les enfants vont U+00E0 l'U+00E9cole.\nLa boulangU+00E8re vend-elle le pain en aoU+00FBt?"
6 label = "Les enfants vont \u00E0 l'\u00E9cole.\nLa boulang\u00E8re vend-elle le pain en ao\u00FBt?"
287
29 FXApp.new("Unicode Example", "FoxTest") do |app|
30 main = FXMainWindow.new(app, "Unicode Text", nil, nil, DECOR_ALL)
31 FXLabel.new(main, label)
8 Fox::FXApp.new("Unicode Example", "FoxTest") do |app|
9 main = Fox::FXMainWindow.new(app, "Unicode Text", nil, nil, Fox::DECOR_ALL)
10 Fox::FXLabel.new(main, label)
3211 app.create
33 main.show(PLACEMENT_SCREEN)
12 main.show(Fox::PLACEMENT_SCREEN)
3413 app.run
3514 end
2525
2626 #include "FXRbCommon.h"
2727
28 #if defined(RUBY_1_8)
29 extern "C" {
30 #include "rubysig.h" /* For CHECK_INTS */
31 }
32 #endif
33
3428 #ifdef HAVE_SYS_TIME_H
3529 #include <sys/time.h> /* For struct timeval */
3630 #endif
3731
32 #ifndef WIN32
33 #include <unistd.h>
34 #include <fcntl.h>
35 #endif
36
3837 // Message map
3938 FXDEFMAP(FXRbApp) FXRbAppMap[]={
39 #if defined(HAVE_RB_THREAD_CALL_WITHOUT_GVL)
40 FXMAPFUNC(SEL_IO_READ,FXRbApp::ID_CHORE_THREADS,FXRbApp::onChoreThreads),
41 #else
4042 FXMAPFUNC(SEL_CHORE,FXRbApp::ID_CHORE_THREADS,FXRbApp::onChoreThreads),
43 #endif
4144 };
4245
4346 // Class implementation
4447 FXRbIMPLEMENT(FXRbApp,FXApp,FXRbAppMap,ARRAYNUMBER(FXRbAppMap))
4548
49 #ifdef WIN32
50 WSAEVENT FXRbApp::interrupt_event = NULL;
51 #else
52 int FXRbApp::interrupt_fds[2] = {-1, -1};
53 #endif
54
4655 // Constructor
47 FXRbApp::FXRbApp(const FXchar* appname,const FXchar* vendor) : FXApp(appname,vendor),m_bThreadsEnabled(TRUE),sleepTime(100){
48 if(m_bThreadsEnabled){
49 addChore(this,ID_CHORE_THREADS);
50 }
56 FXRbApp::FXRbApp(const FXchar* appname,const FXchar* vendor) : FXApp(appname,vendor),m_bThreadsEnabled(FALSE),sleepTime(100){
57 setThreadsEnabled(TRUE);
5158 }
5259
5360
6673 if(enabled){
6774 if(!m_bThreadsEnabled){
6875 m_bThreadsEnabled=TRUE;
76 #if defined(HAVE_RB_THREAD_CALL_WITHOUT_GVL)
77 #ifdef WIN32
78 interrupt_event = CreateEvent(NULL, TRUE, FALSE, NULL);
79 addInput(interrupt_event,INPUT_READ,this,ID_CHORE_THREADS);
80 #else
81 if(pipe(interrupt_fds) == -1) rb_fatal("failed to allocate pipe for interrupt events");
82 fcntl(interrupt_fds[0], F_SETFL, O_NONBLOCK);
83 addInput(interrupt_fds[0],INPUT_READ,this,ID_CHORE_THREADS);
84 #endif
85 #else
6986 addChore(this,ID_CHORE_THREADS);
87 #endif
7088 }
7189 }
7290 else{
7391 m_bThreadsEnabled=FALSE;
92 #if defined(HAVE_RB_THREAD_CALL_WITHOUT_GVL)
93 #ifdef WIN32
94 removeInput(interrupt_event,INPUT_READ);
95 CloseHandle(interrupt_event); interrupt_event = NULL;
96 #else
97 removeInput(interrupt_fds[0],INPUT_READ);
98 close(interrupt_fds[0]); interrupt_fds[0] = -1;
99 close(interrupt_fds[1]); interrupt_fds[1] = -1;
100 #endif
101 #else
74102 removeChore(this,ID_CHORE_THREADS);
103 #endif
75104 }
76105 }
77106
87116 return sleepTime;
88117 }
89118
119 long FXRbApp::onChoreThreads(FXObject *obj,FXSelector sel,void *p){
120 #if defined(HAVE_RB_THREAD_CALL_WITHOUT_GVL)
121 #ifdef WIN32
122 ResetEvent(interrupt_event);
123 #else
124 char byte;
125 // clear the pipe
126 if(read(interrupt_fds[0], &byte, 1) != 1) rb_fatal("failed to read from pipe for interrupt events");
127 #endif
128 #endif
129 return FXRbApp_onChoreThreads(this, obj, sel, p);
130 }
131
132 long FXRbApp_onChoreThreads_gvlcb(FXRbApp *self,FXObject *obj,FXSelector sel,void *p){
133 return self->onChoreThreads_gvlcb(obj, sel, p);
134 }
90135
91136 // Process threads
92 long FXRbApp::onChoreThreads(FXObject*,FXSelector,void*){
137 long FXRbApp::onChoreThreads_gvlcb(FXObject*,FXSelector,void*){
138 #if defined(HAVE_RB_THREAD_CALL_WITHOUT_GVL)
139 #else
93140 // Pause for 'sleepTime' millseconds
94141 struct timeval wait;
95142 wait.tv_sec=0;
96143 wait.tv_usec=100*sleepTime;
97144
98 // Confirm that this thread can be interrupted, then go to sleep
99 #if defined(RUBY_1_8)
100 CHECK_INTS;
101 if(!rb_thread_critical)
102 rb_thread_wait_for(wait);
103 #else
104 // if(!rb_thread_critical) rb_thread_wait_for(wait);
105145 rb_thread_wait_for(wait);
106 #endif /* RUBY_1_8 */
107146
108147 // Re-register this chore for next time
109148 addChore(this,ID_CHORE_THREADS);
149 #endif
110150
111151 // Back to work...
112152 return 1;
113153 }
114154
155 #if defined(HAVE_RB_THREAD_CALL_WITHOUT_GVL)
156 void fxrb_wakeup_fox(void *){
157 #ifdef WIN32
158 SetEvent(FXRbApp::interrupt_event);
159 #else
160 if(write(FXRbApp::interrupt_fds[1], "X", 1) != 1) rb_fatal("failed to write to pipe for interrupt events");
161 #endif
162 }
163 #endif
115164
116165 // Destructor
117166 FXRbApp::~FXRbApp(){
118167 FXTRACE((100,"FXRbApp::~FXRbApp()\n"));
119168 VALUE myRegistry;
169 setThreadsEnabled(FALSE);
120170 FXRbDestroyAppSensitiveObjects();
121171 myRegistry=FXRbGetRubyObj(&(reg()),true);
122172 if(!NIL_P(myRegistry)){
0 /***********************************************************************
1 * FXRuby -- the Ruby language bindings for the FOX GUI toolkit.
2 * Copyright (c) 2017-2017 by Lyle Johnson. All Rights Reserved.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * For further information please contact the author by e-mail
19 * at "[email protected]".
20 ***********************************************************************/
21
22 #include "FXRbCommon.h"
23 #include "FXRbObjRegistry.h"
24 #include "swigruby.h"
25
26 FXRbObjRegistry::FXRbObjRegistry(){
27 FXRuby_Objects=st_init_numtable();
28 }
29
30 const char * FXRbObjRegistry::safe_rb_obj_classname(VALUE obj)
31 {
32 int tdata = TYPE(obj)==T_DATA;
33 if( (tdata && IsInGC(DATA_PTR(obj)))
34 #ifdef HAVE_RB_DURING_GC
35 || rb_during_gc()
36 #endif
37 ){
38 /* It's not safe to call rb_obj_classname() during GC.
39 * Return dummy value in this case. */
40 return "during GC";
41 } else if (tdata) {
42 return rb_obj_classname(obj);
43 } else {
44 return "no T_DATA";
45 }
46 }
47
48 VALUE FXRbObjRegistry::NewBorrowedObj(void *ptr,swig_type_info* ty){
49 if(ptr!=0){
50 FXASSERT(ty!=0);
51 ObjDesc *desc;
52
53 if(FXMALLOC(&desc,ObjDesc,1)){
54 VALUE obj = SWIG_Ruby_NewPointerObj(ptr,ty,1);
55 FXTRACE((1,"FXRbNewPointerObj(foxObj=%p) => rubyObj=%p (%s)\n",ptr,(void *)obj,safe_rb_obj_classname(obj)));
56 desc->obj = obj;
57 desc->type = borrowed;
58 desc->in_gc = false;
59 int overwritten = st_insert(FXRuby_Objects,reinterpret_cast<st_data_t>(ptr),reinterpret_cast<st_data_t>(desc));
60 FXASSERT(!overwritten);
61 return obj;
62 } else {
63 FXASSERT(FALSE);
64 return Qnil;
65 }
66 }
67 else{
68 return Qnil;
69 }
70 }
71
72 void FXRbObjRegistry::RegisterRubyObj(VALUE rubyObj,const void* foxObj) {
73 FXASSERT(!NIL_P(rubyObj));
74 FXASSERT(foxObj!=0);
75 ObjDesc* desc;
76 FXTRACE((1,"FXRbRegisterRubyObj(rubyObj=%p (%s),foxObj=%p)\n",(void *)rubyObj,safe_rb_obj_classname(rubyObj),foxObj));
77 if(st_lookup(FXRuby_Objects,reinterpret_cast<st_data_t>(const_cast<void*>(foxObj)),reinterpret_cast<st_data_t *>(&desc))!=0){
78 FXASSERT(desc->type == borrowed);
79 /* There is already a Ruby object registered for this foxObj.
80 * This can happen, if libfox calls methods out of the C++ object constructor,
81 * that can be overwritten in Ruby (like changeFocus) with the object as
82 * parameter. FXFileSelector is one example.
83 * To avoid double references to the same foxObj from different Ruby objects,
84 * we decouple the foxObj from previoius ruby object and point to the new one.
85 */
86 DATA_PTR(desc->obj) = 0;
87 desc->obj = rubyObj;
88 desc->type = own;
89 } else {
90 if(FXMALLOC(&desc,ObjDesc,1)){
91 desc->obj = rubyObj;
92 desc->type = own;
93 desc->in_gc = false;
94 int overwritten = st_insert(FXRuby_Objects,reinterpret_cast<st_data_t>(const_cast<void*>(foxObj)),reinterpret_cast<st_data_t>(desc));
95 FXASSERT(!overwritten);
96 } else {
97 FXASSERT(FALSE);
98 }
99 }
100 FXASSERT(GetRubyObj(foxObj,false)==rubyObj);
101 }
102
103 void FXRbObjRegistry::UnregisterRubyObj(const void* foxObj, bool alsoOwned){
104 if(foxObj!=0){
105 ObjDesc* desc;
106 if(st_lookup(FXRuby_Objects,reinterpret_cast<st_data_t>(const_cast<void*>(foxObj)),reinterpret_cast<st_data_t *>(&desc))!=0){
107 if( !alsoOwned && desc->type!=borrowed ) return;
108 FXTRACE((1,"FXRbUnregisterRubyObj(rubyObj=%p (%s),foxObj=%p)\n",(void *)desc->obj,safe_rb_obj_classname(desc->obj),foxObj));
109 DATA_PTR(desc->obj)=0;
110 FXFREE(&desc);
111 st_delete(FXRuby_Objects,reinterpret_cast<st_data_t *>(const_cast<void**>(&foxObj)),reinterpret_cast<st_data_t *>(0));
112 FXASSERT(st_lookup(FXRuby_Objects,reinterpret_cast<st_data_t>(const_cast<void*>(foxObj)),reinterpret_cast<st_data_t *>(0))==0);
113 }
114 }
115 }
116
117
118 VALUE FXRbObjRegistry::GetRubyObj(const void *foxObj,bool alsoBorrowed, bool in_gc_mark){
119 ObjDesc* desc;
120 if(foxObj!=0 && st_lookup(FXRuby_Objects,reinterpret_cast<st_data_t>(const_cast<void*>(foxObj)),reinterpret_cast<st_data_t *>(&desc))!=0){
121 FXASSERT(desc!=0);
122 if(alsoBorrowed || desc->type!=borrowed){
123 const char *classname = in_gc_mark ? "in GC" : safe_rb_obj_classname(desc->obj);
124 FXTRACE((2,"%s(foxObj=%p) => rubyObj=%p (%s)\n", in_gc_mark ? "FXRbGcMark" : "FXRbGetRubyObj", foxObj, (void *)desc->obj, classname));
125 return desc->obj;
126 }
127 }
128 return Qnil;
129 }
130
131
132 bool FXRbObjRegistry::IsBorrowed(void* ptr){
133 FXASSERT(ptr!=0);
134 ObjDesc *desc;
135 if(st_lookup(FXRuby_Objects,reinterpret_cast<st_data_t>(ptr),reinterpret_cast<st_data_t *>(&desc))!=0){
136 return desc->type == borrowed;
137 }
138 else{
139 return true;
140 }
141 }
142
143 bool FXRbObjRegistry::SetInGC(const void* ptr, bool enabled){
144 FXASSERT(ptr!=0);
145 ObjDesc *desc;
146 if(st_lookup(FXRuby_Objects,reinterpret_cast<st_data_t>(ptr),reinterpret_cast<st_data_t *>(&desc))!=0){
147 desc->in_gc=enabled;
148 return enabled;
149 }
150 return false;
151 }
152
153 bool FXRbObjRegistry::IsInGC(const void* ptr){
154 FXASSERT(ptr!=0);
155 ObjDesc *desc;
156
157 #ifdef HAVE_RB_DURING_GC
158 if( rb_during_gc() ){
159 return true;
160 }
161 #endif
162 if(st_lookup(FXRuby_Objects,reinterpret_cast<st_data_t>(ptr),reinterpret_cast<st_data_t *>(&desc))!=0){
163 return desc->in_gc;
164 }
165 return false;
166 }
167
168 FXRbObjRegistry FXRbObjRegistry::main;
2828 #endif
2929
3030 #include "FXRbCommon.h"
31 #include "FXRbObjRegistry.h"
3132 #include "impl.h"
3233
3334 // SWIG runtime functions we need
4142 #include <signal.h> // for definitions of SIGINT, etc.
4243 #endif
4344
44 #if defined(RUBY_1_8)
45
46 extern "C" {
47 #include "st.h"
48 #include "rubyio.h" // for GetOpenFile(), etc.
49 }
50
51 #else
52
5345 #include "ruby/io.h"
5446 #include "ruby/st.h"
5547
56 #endif /* RUBY_1_8 */
57
5848
5949 // Opaque type declaration from SWIG runtime
6050 struct swig_type_info;
51
52 static int FXSWIG_ConvertPtr(VALUE obj, void **ptr, swig_type_info *ty, int flags){
53 return SWIG_ConvertPtr(obj, ptr, ty, flags);
54 }
55
6156
6257 // Wrapper around SWIG_TypeQuery() that caches results for performance
6358 swig_type_info *FXRbTypeQuery(const char *desc){
7368 }
7469
7570
76 /**
77 * The FXRuby_Objects hash table basically maps C++ objects to Ruby instances.
78 * Each key in the table is a pointer to a C++ object we've seen before, and
79 * the corresponding value is an FXRubyObjDesc struct (see below) that tells
80 * us which Ruby instance corresponds to that C++ object.
81 */
82
83 static st_table * FXRuby_Objects;
84
85 /**
86 * Each value in the FXRuby_Objects hash table is an instance of this
87 * struct. It identifies the Ruby instance associated with a C++ object.
88 * It also indicates whether this is merely a "borrowed" reference to
89 * some C++ object (i.e. it's not one we need to destroy later).
90 *
91 * in_gc is set for FXWindows that are in garbage collection and must
92 * not call ruby code anymore.
93 */
94
95 struct FXRubyObjDesc {
96 VALUE obj;
97 bool borrowed;
98 bool in_gc;
99 };
100
101
102 /**
103 * FXRbNewPointerObj() is a wrapper around SWIG_Ruby_NewPointerObj() that also
104 * registers this C++ object & Ruby instance pair in our FXRuby_Objects
105 * hash table. This function should only get called for methods that return
106 * a reference to an already-existing C++ object (i.e. one that FOX "owns")
107 * and for that reason we mark these objects as "borrowed".
108 */
109
11071 VALUE FXRbNewPointerObj(void *ptr,swig_type_info* ty){
111 if(ptr!=0){
112 FXASSERT(ty!=0);
113 VALUE obj;
114 FXRubyObjDesc *desc;
115 if(FXMALLOC(&desc,FXRubyObjDesc,1)){
116 obj=SWIG_Ruby_NewPointerObj(ptr,ty,1);
117 FXTRACE((1,"FXRbNewPointerObj(rubyObj=%d,foxObj=%p)\n",static_cast<int>(obj),ptr));
118 desc->obj=obj;
119 desc->borrowed=true;
120 desc->in_gc=false;
121 int overwritten = st_insert(FXRuby_Objects,reinterpret_cast<st_data_t>(ptr),reinterpret_cast<st_data_t>(desc));
122 FXASSERT(!overwritten);
123 return obj;
124 }
125 else{
126 FXASSERT(FALSE);
127 return Qnil;
128 }
129 }
130 else{
131 return Qnil;
132 }
133 }
72 return FXRbObjRegistry::main.NewBorrowedObj(ptr,ty);
73 }
74
75 VALUE FXRbNewPointerObjCb(void *ptr,swig_type_info* ty){
76 return SWIG_Ruby_NewPointerObj(ptr, ty, 1);
77 }
13478
13579
13680 /**
13983 */
14084
14185 bool FXRbIsBorrowed(void* ptr){
142 FXASSERT(ptr!=0);
143 FXRubyObjDesc *desc;
144 if(st_lookup(FXRuby_Objects,reinterpret_cast<st_data_t>(ptr),reinterpret_cast<st_data_t *>(&desc))!=0){
145 return desc->borrowed;
146 }
147 else{
148 return true;
149 }
150 }
86 return FXRbObjRegistry::main.IsBorrowed(ptr);
87 }
15188
15289 bool FXRbSetInGC(const void* ptr, bool enabled){
153 FXASSERT(ptr!=0);
154 FXRubyObjDesc *desc;
155 if(st_lookup(FXRuby_Objects,reinterpret_cast<st_data_t>(ptr),reinterpret_cast<st_data_t *>(&desc))!=0){
156 desc->in_gc=enabled;
157 return enabled;
158 }
159 return false;
160 }
90 return FXRbObjRegistry::main.SetInGC(ptr, enabled);
91 }
16192
16293 bool FXRbIsInGC(const void* ptr){
163 FXASSERT(ptr!=0);
164 FXRubyObjDesc *desc;
165 if(st_lookup(FXRuby_Objects,reinterpret_cast<st_data_t>(ptr),reinterpret_cast<st_data_t *>(&desc))!=0){
166 return desc->in_gc;
167 }
168 return false;
169 }
170
171
172 /**
173 * FXRbConvertPtr() is just a wrapper around SWIG_ConvertPtr().
174 */
175
176 void* FXRbConvertPtr(VALUE obj,swig_type_info* ty){
177 void *ptr;
178 SWIG_ConvertPtr(obj,&ptr,ty,1);
179 return ptr;
180 }
181
182
183 // Should we catch exceptions thrown by message handlers?
184 FXbool FXRbCatchExceptions=FALSE;
185
186 // Returns an FXInputHandle for this Ruby file object
187 FXInputHandle FXRbGetReadFileHandle(VALUE obj) {
188 int fd;
189 fd = FIX2INT(rb_funcall(obj, rb_intern("fileno"), 0));
190 #ifdef WIN32
191 #ifdef __CYGWIN__
192 return (FXInputHandle) get_osfhandle(fd);
193 #else
194 return (FXInputHandle) _get_osfhandle(fd);
195 #endif
196 #else
197 return (FXInputHandle) fd;
198 #endif
199 }
200
201
202 // Returns an FXInputHandle for this Ruby file object
203 FXInputHandle FXRbGetWriteFileHandle(VALUE obj) {
204 int fd;
205 #if defined(RUBINIUS)
206 VALUE vwrite = rb_intern("@write");
207 if(rb_ivar_defined(obj, vwrite)) obj = rb_ivar_get(obj, vwrite);
208 fd = FIX2INT(rb_funcall(obj, rb_intern("fileno"), 0));
209 #elif defined(RUBY_1_8)
210 OpenFile *fptr;
211 GetOpenFile(obj, fptr);
212 FILE *fpw=GetWriteFile(fptr);
213 fd = fileno(fpw);
214 #else
215 rb_io_t *fptr;
216 GetOpenFile(obj, fptr);
217 VALUE wrio = fptr->tied_io_for_writing;
218 if(wrio) obj = wrio;
219 fd = FIX2INT(rb_funcall(obj, rb_intern("fileno"), 0));
220 #endif
221 #ifdef WIN32
222 #ifdef __CYGWIN__
223 return (FXInputHandle) get_osfhandle(fd);
224 #else
225 return (FXInputHandle) _get_osfhandle(fd);
226 #endif
227 #else
228 return (FXInputHandle) fd;
229 #endif
230 }
94 return FXRbObjRegistry::main.IsInGC(ptr);
95 }
23196
23297
23398 // Register this Ruby class instance
23499 void FXRbRegisterRubyObj(VALUE rubyObj,const void* foxObj) {
235 FXASSERT(!NIL_P(rubyObj));
236 FXASSERT(foxObj!=0);
237 FXRubyObjDesc* desc;
238 FXTRACE((1,"FXRbRegisterRubyObj(rubyObj=%d,foxObj=%p)\n",static_cast<int>(rubyObj),foxObj));
239 if(st_lookup(FXRuby_Objects,reinterpret_cast<st_data_t>(const_cast<void*>(foxObj)),reinterpret_cast<st_data_t *>(&desc))!=0){
240 FXASSERT(desc->borrowed);
241 /* There is already a Ruby object registered for this foxObj.
242 * This can happen, if libfox calls methods out of the C++ object constructor,
243 * that can be overwritten in Ruby (like changeFocus) with the object as
244 * parameter. FXFileSelector is one example.
245 * To avoid double references to the same foxObj from different Ruby objects,
246 * we decouple the foxObj from previoius ruby object and point to the new one.
247 */
248 DATA_PTR(desc->obj) = 0;
249 desc->obj=rubyObj;
250 desc->borrowed=false;
251 }
252 else{
253 if(FXMALLOC(&desc,FXRubyObjDesc,1)){
254 desc->obj=rubyObj;
255 desc->borrowed=false;
256 desc->in_gc=false;
257 int overwritten = st_insert(FXRuby_Objects,reinterpret_cast<st_data_t>(const_cast<void*>(foxObj)),reinterpret_cast<st_data_t>(desc));
258 FXASSERT(!overwritten);
259 }
260 else{
261 FXASSERT(FALSE);
262 }
263 }
264 FXASSERT(FXRbGetRubyObj(foxObj,false)==rubyObj);
265 }
100 return FXRbObjRegistry::main.RegisterRubyObj(rubyObj, foxObj);
101 }
102
103 static void FXRbUnregisterRubyObj2(const void* foxObj, bool alsoOwned){
104 return FXRbObjRegistry::main.UnregisterRubyObj(foxObj, alsoOwned);
105 }
266106
267107 /**
268108 * Remove this mapping between a Ruby instance and a C++ object
269109 */
270110 void FXRbUnregisterRubyObj(const void* foxObj){
271 if(foxObj!=0){
272 FXRubyObjDesc* desc;
273 if(st_lookup(FXRuby_Objects,reinterpret_cast<st_data_t>(const_cast<void*>(foxObj)),reinterpret_cast<st_data_t *>(&desc))!=0){
274 FXTRACE((1,"FXRbUnregisterRubyObj(rubyObj=%d,foxObj=%p)\n",static_cast<int>(desc->obj),foxObj));
275 DATA_PTR(desc->obj)=0;
276 FXFREE(&desc);
277 st_delete(FXRuby_Objects,reinterpret_cast<st_data_t *>(const_cast<void**>(&foxObj)),reinterpret_cast<st_data_t *>(0));
278 FXASSERT(st_lookup(FXRuby_Objects,reinterpret_cast<st_data_t>(const_cast<void*>(foxObj)),reinterpret_cast<st_data_t *>(0))==0);
279 }
280 }
281 }
282
283
284 VALUE to_ruby(const FXObject* obj){
285 if(obj!=0){
286 FXString className=obj->getClassName();
287 if(className.length()>3){
288 if(className.left(4)=="FXRb"){ className.replace(0,4,"FX"); }
289 }
290 FXString desc=className+" *";
291 return FXRbGetRubyObj(obj,desc.text());
292 }
293 return Qnil;
294 }
295
111 FXRbUnregisterRubyObj2(foxObj, true);
112 }
113
114
115 /* We now have 3 types of FXObject wrappers:
116 *
117 * Own objects :
118 * These objects are allocated by FXRuby on the heap.
119 * They are free'd when the FXRuby wrapper is GC'ed and no other reference to the object exists.
120 * They are registered in FXRbObjRegistry as owned object.
121 * They are built per FXRbRegisterRubyObj().
122 *
123 * Borrowed objects :
124 * These objects are allocated by libfox on the heap.
125 * They are free'd by libfox when the owning fox object gets destroyed.
126 * Only the ruby wrapper is GC'ed.
127 * They are registered in FXRbObjRegistry as borrowed object.
128 * They are built per FXGetRubyObj().
129 *
130 * Callback objects :
131 * This is the new type.
132 * These objects are allocated by libfox on the heap or on the stack.
133 * They are wrapped for the time of one callback only, because stack memory is free'd afterwards.
134 * They are not registered in FXRbObjRegistry, but stored on the stack only.
135 * Therefore callback objects aren't re-used, but newly wrapped for each call.
136 * The same goes for arguments to ruby blocks.
137 * They are built per FXGetRubyObjCb().
138 */
296139
297140 /**
298141 * Return the registered Ruby class instance associated with this
299142 * FOX object, or Qnil if not found.
300143 */
301 VALUE FXRbGetRubyObj(const void *foxObj,bool searchBoth){
302 FXRubyObjDesc* desc;
303 if(foxObj!=0 && st_lookup(FXRuby_Objects,reinterpret_cast<st_data_t>(const_cast<void*>(foxObj)),reinterpret_cast<st_data_t *>(&desc))!=0){
304 FXASSERT(desc!=0);
305 if(searchBoth){
306 return desc->obj;
307 }
308 else{
309 return desc->borrowed ? Qnil : desc->obj;
310 }
311 }
312 else{
313 return Qnil;
314 }
315 }
144 VALUE FXRbGetRubyObj(const void *foxObj,bool alsoBorrowed, bool in_gc_mark){
145 return FXRbObjRegistry::main.GetRubyObj(foxObj, alsoBorrowed, in_gc_mark);
146 }
316147
317148 /**
318149 * Return the registered Ruby class instance associated with this
319 * FOX object, or a new registered instance if not found.
150 * FOX object, or a new registered instance of a borrowed object if not found.
151 *
152 * This is suitable for objects on the heap, but not suitable for callbacks,
153 * because callback values might be on the stack.
154 * These stack objects should not be registered, because they are temporary only.
320155 */
321156 VALUE FXRbGetRubyObj(const void *foxObj,swig_type_info* ty){
322157 if(foxObj!=0){
323158 VALUE rbObj=FXRbGetRubyObj(foxObj,true);
324 return NIL_P(rbObj) ? FXRbNewPointerObj(const_cast<void*>(foxObj),ty) : rbObj;
325 }
326 else{
159 if( NIL_P(rbObj) ){
160 return FXRbNewPointerObj(const_cast<void*>(foxObj),ty);
161 }else{
162 // The requested type should match the registered class.
163 FXASSERT(SWIG_CheckConvert(rbObj, ty));
164 return rbObj;
165 }
166 }else{
327167 return Qnil;
328 }
329 }
168 }
169 }
330170
331171 VALUE FXRbGetRubyObj(const void *foxObj,const char *type){
172 return FXRbGetRubyObj(foxObj, FXRbTypeQuery(type));
173 }
174
175 /* Get an already registered object or wrap a new one for use in a callback.
176 *
177 * This is suitable for objects on the heap or on the stack.
178 * If an object is already registered per FXRbGetRubyObj(), this instance is returned.
179 * If it is not registered, a new wrapping object is built and returned, but is not registered.
180 */
181 VALUE FXRbGetRubyObjCb(const void *foxObj,swig_type_info* ty){
332182 if(foxObj!=0){
333 FXASSERT(type!=0);
334 VALUE rbObj=FXRbGetRubyObj(foxObj,true);
335 return NIL_P(rbObj) ? FXRbNewPointerObj(const_cast<void*>(foxObj),FXRbTypeQuery(type)) : rbObj;
336 }
337 else{
183 VALUE rbObj=FXRbGetRubyObj(foxObj, true);
184 if( NIL_P(rbObj) ){
185 return FXRbNewPointerObjCb(const_cast<void*>(foxObj), ty);
186 }else{
187 // The requested type should match the registered class.
188 FXASSERT(SWIG_CheckConvert(rbObj, ty));
189 return rbObj;
190 }
191 }else{
338192 return Qnil;
339 }
340 }
193 }
194 }
195
196 static VALUE to_ruby_obj(const FXObject* obj, VALUE (*get_value)(const void*, swig_type_info*)){
197 if(obj){
198 FXString className = obj->getClassName();
199 if(className.length() > 3){
200 if(className.left(4)=="FXRb"){ className.replace(0,4,"FX"); }
201 }
202 FXString desc = className+" *";
203 return get_value(obj, FXRbTypeQuery(desc.text()));
204 }
205 return Qnil;
206 }
207
208 VALUE to_ruby(const FXObject* obj){
209 return to_ruby_obj(obj, FXRbGetRubyObj);
210 }
211
212 VALUE to_ruby_cb(const FXObject* obj){
213 return to_ruby_obj(obj, FXRbGetRubyObjCb);
214 }
215
341216
342217 /**
343218 * Look up the Ruby instance associated with this C++ object, if any, and mark
361236 * example program works if you invoke the GC in ShutterWindow#create;
362237 * make sure that the shutter items' contents don't get blown away!
363238 */
364 VALUE value=FXRbGetRubyObj(obj,true);
239 VALUE value=FXRbGetRubyObj(obj, true, true);
365240 if(!NIL_P(value)){
366241 rb_gc_mark(value);
367242 }
414289 VALUE FXRbMakeArray(const FXArc* arcs,FXuint narcs){
415290 VALUE result=rb_ary_new();
416291 for(FXuint i=0; i<narcs; i++)
417 rb_ary_push(result,FXRbGetRubyObj(&arcs[i],"FXArc *"));
292 rb_ary_push(result, FXRbNewPointerObjCb(const_cast<FXArc*>(&arcs[i]), FXRbTypeQuery("FXArc *")));
418293 return result;
419294 }
420295
422297 VALUE FXRbMakeArray(const FXPoint* points,FXuint npoints){
423298 VALUE result=rb_ary_new();
424299 for(FXuint i=0; i<npoints; i++)
425 rb_ary_push(result,FXRbGetRubyObj(&points[i],"FXPoint *"));
300 rb_ary_push(result,FXRbNewPointerObjCb(const_cast<FXPoint*>(&points[i]), FXRbTypeQuery("FXPoint *")));
426301 return result;
427302 }
428303
430305 VALUE FXRbMakeArray(const FXRectangle* rectangles,FXuint nrectangles){
431306 VALUE result=rb_ary_new();
432307 for(FXuint i=0; i<nrectangles; i++)
433 rb_ary_push(result,FXRbGetRubyObj(&rectangles[i],"FXRectangle *"));
308 rb_ary_push(result,FXRbNewPointerObjCb(const_cast<FXRectangle*>(&rectangles[i]), FXRbTypeQuery("FXRectangle *")));
434309 return result;
435310 }
436311
438313 VALUE FXRbMakeArray(const FXSegment* segments,FXuint nsegments){
439314 VALUE result=rb_ary_new();
440315 for(FXuint i=0; i<nsegments; i++)
441 rb_ary_push(result,FXRbGetRubyObj(&segments[i],"FXSegment *"));
316 rb_ary_push(result,FXRbNewPointerObjCb(const_cast<FXSegment*>(&segments[i]), FXRbTypeQuery("FXSegment *")));
442317 return result;
443318 }
444319
445320 // Returns a Ruby array of FXColor values
446321 VALUE FXRbMakeColorArray(const FXColor* colors,FXint w,FXint h){
447322 VALUE result=rb_ary_new();
448 FXint size=w*h;
323 FXuint size=w*h;
449324 for(FXuint i=0; i<size; i++)
450325 rb_ary_push(result,to_ruby(colors[i]));
451326 return result;
498373 */
499374 static VALUE FXRbConvertMessageData(FXObject* sender,FXObject* recv,FXSelector sel,void* ptr){
500375 FXTRACE((1,"FXRbConvertMessageData(%s(%p),FXSEL(%s,%d),%p)\n",sender->getClassName(),sender,FXDebugTarget::messageTypeName[FXSELTYPE(sel)],FXSELID(sel),ptr));
501 FXInputHandle fff;
502376 FXushort type=FXSELTYPE(sel);
503377 FXushort id=FXSELID(sel);
504378
554428 type==SEL_PICKED ||
555429 type==SEL_SESSION_NOTIFY ||
556430 type==SEL_SESSION_CLOSED) {
557 return to_ruby(reinterpret_cast<FXEvent*>(ptr));
431 return to_ruby_cb(reinterpret_cast<FXEvent*>(ptr));
558432 }
559433 else if(type==SEL_DRAGGED && !sender->isMemberOf(FXMETACLASS(FXGLViewer))){
560 return to_ruby(reinterpret_cast<FXEvent*>(ptr));
434 return to_ruby_cb(reinterpret_cast<FXEvent*>(ptr));
561435 }
562436 else if(type==SEL_SIGNAL){
563 return to_ruby(static_cast<int>(reinterpret_cast<FXuval>(ptr)));
437 return to_ruby_cb(static_cast<int>(reinterpret_cast<FXuval>(ptr)));
564438 }
565439 else if(type==SEL_IO_READ ||
566440 type==SEL_IO_WRITE ||
567441 type==SEL_IO_EXCEPT){
568 #ifdef WIN32
569 fff=reinterpret_cast<FXInputHandle>(ptr);
570 #else
571 fff=static_cast<FXInputHandle>(reinterpret_cast<long>(ptr));
572 #endif
573442 return Qnil;
574443 }
575444 else if(type==SEL_CLOSE ||
587456 if(type==SEL_CHANGED||type==SEL_COMMAND) return Qnil;
588457 }
589458 else if(sender->isMemberOf(FXMETACLASS(FXArrowButton))){
590 if(type==SEL_COMMAND) return to_ruby(static_cast<FXuint>(reinterpret_cast<FXuval>(ptr)));
459 if(type==SEL_COMMAND) return to_ruby_cb(static_cast<FXuint>(reinterpret_cast<FXuval>(ptr)));
591460 }
592461 else if(sender->isMemberOf(FXMETACLASS(FXPicker))){
593 if(type==SEL_COMMAND || type==SEL_CHANGED) return to_ruby(reinterpret_cast<FXPoint*>(ptr));
462 if(type==SEL_COMMAND || type==SEL_CHANGED) return to_ruby_cb(reinterpret_cast<FXPoint*>(ptr));
594463 }
595464 else if(sender->isMemberOf(FXMETACLASS(FXButton))){
596465 if(type==SEL_CLICKED ||
597466 type==SEL_DOUBLECLICKED ||
598467 type==SEL_TRIPLECLICKED ||
599 type==SEL_COMMAND) return to_ruby(static_cast<FXuint>(reinterpret_cast<FXuval>(ptr)));
468 type==SEL_COMMAND) return to_ruby_cb(static_cast<FXuint>(reinterpret_cast<FXuval>(ptr)));
600469 }
601470 else if(sender->isMemberOf(FXMETACLASS(FXCheckButton))){
602 if(type==SEL_COMMAND) return to_ruby(static_cast<FXuchar>(reinterpret_cast<FXuval>(ptr)));
471 if(type==SEL_COMMAND) return to_ruby_cb(static_cast<FXuchar>(reinterpret_cast<FXuval>(ptr)));
603472 }
604473 else if(sender->isMemberOf(FXMETACLASS(FXColorBar))){
605474 if(type==SEL_CHANGED || type==SEL_COMMAND){
606475 FXfloat* hsv=reinterpret_cast<FXfloat*>(ptr);
607 return rb_ary_new3(3,to_ruby(hsv[0]),to_ruby(hsv[1]),to_ruby(hsv[2]));
476 return rb_ary_new3(3,to_ruby_cb(hsv[0]),to_ruby_cb(hsv[1]),to_ruby_cb(hsv[2]));
608477 }
609478 }
610479 else if(sender->isMemberOf(FXMETACLASS(FXColorDialog))){
611 if(type==SEL_CHANGED || type==SEL_COMMAND) return to_ruby(static_cast<FXColor>(reinterpret_cast<FXuval>(ptr)));
480 if(type==SEL_CHANGED || type==SEL_COMMAND) return to_ruby_cb(static_cast<FXColor>(reinterpret_cast<FXuval>(ptr)));
612481 }
613482 else if(sender->isMemberOf(FXMETACLASS(FXColorRing))){
614483 if(type==SEL_CHANGED || type==SEL_COMMAND){
615484 FXfloat* hsv=reinterpret_cast<FXfloat*>(ptr);
616 return rb_ary_new3(3,to_ruby(hsv[0]),to_ruby(hsv[1]),to_ruby(hsv[2]));
485 return rb_ary_new3(3,to_ruby_cb(hsv[0]),to_ruby_cb(hsv[1]),to_ruby_cb(hsv[2]));
617486 }
618487 }
619488 else if(sender->isMemberOf(FXMETACLASS(FXColorSelector))){
620 if(type==SEL_CHANGED || type==SEL_COMMAND) return to_ruby(static_cast<FXColor>(reinterpret_cast<FXuval>(ptr)));
489 if(type==SEL_CHANGED || type==SEL_COMMAND) return to_ruby_cb(static_cast<FXColor>(reinterpret_cast<FXuval>(ptr)));
621490 }
622491 else if(sender->isMemberOf(FXMETACLASS(FXColorWell))){
623492 if(type==SEL_CHANGED ||
625494 type==SEL_CLICKED ||
626495 type==SEL_DOUBLECLICKED ||
627496 type==SEL_TRIPLECLICKED) {
628 VALUE v=to_ruby(static_cast<FXColor>(reinterpret_cast<FXuval>(ptr)));
497 VALUE v=to_ruby_cb(static_cast<FXColor>(reinterpret_cast<FXuval>(ptr)));
629498 return v;
630499 }
631500 }
632501 else if(sender->isMemberOf(FXMETACLASS(FXColorWheel))){
633502 if(type==SEL_CHANGED || type==SEL_COMMAND){
634503 FXfloat* hsv=reinterpret_cast<FXfloat*>(ptr);
635 return rb_ary_new3(3,to_ruby(hsv[0]),to_ruby(hsv[1]),to_ruby(hsv[2]));
504 return rb_ary_new3(3,to_ruby_cb(hsv[0]),to_ruby_cb(hsv[1]),to_ruby_cb(hsv[2]));
636505 }
637506 }
638507 else if(sender->isMemberOf(FXMETACLASS(FXComboBox))){
639 if(type==SEL_CHANGED || type==SEL_COMMAND) return to_ruby(reinterpret_cast<FXchar*>(ptr));
508 if(type==SEL_CHANGED || type==SEL_COMMAND) return to_ruby_cb(reinterpret_cast<FXchar*>(ptr));
640509 }
641510 else if(sender->isMemberOf(FXMETACLASS(FXDataTarget))){
642511 if(type==SEL_COMMAND || type==SEL_CHANGED){
643512 if(recv->isMemberOf(FXMETACLASS(FXWindow))){
644513 switch(id){
645514 case FXWindow::ID_SETINTVALUE:
646 return to_ruby(*reinterpret_cast<FXint*>(ptr));
515 return to_ruby_cb(*reinterpret_cast<FXint*>(ptr));
647516 case FXWindow::ID_SETREALVALUE:
648 return to_ruby(*reinterpret_cast<FXdouble*>(ptr));
517 return to_ruby_cb(*reinterpret_cast<FXdouble*>(ptr));
649518 case FXWindow::ID_SETSTRINGVALUE:
650 return to_ruby(*reinterpret_cast<FXString*>(ptr));
519 return to_ruby_cb(*reinterpret_cast<FXString*>(ptr));
651520 case FXWindow::ID_GETINTVALUE:
652521 case FXWindow::ID_GETREALVALUE:
653522 case FXWindow::ID_GETSTRINGVALUE:
665534 }
666535 }
667536 else if(sender->isMemberOf(FXMETACLASS(FXDial))){
668 if(type==SEL_CHANGED || type==SEL_COMMAND) return to_ruby(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
537 if(type==SEL_CHANGED || type==SEL_COMMAND) return to_ruby_cb(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
669538 }
670539 else if(sender->isMemberOf(FXMETACLASS(FXDirBox))){
671 if(type==SEL_CHANGED || type==SEL_COMMAND) return to_ruby(reinterpret_cast<FXchar*>(ptr));
540 if(type==SEL_CHANGED || type==SEL_COMMAND) return to_ruby_cb(reinterpret_cast<FXchar*>(ptr));
672541 }
673542 else if(sender->isMemberOf(FXMETACLASS(FXDockBar))){
674 if(type==SEL_DOCKED || type==SEL_FLOATED) return FXRbGetRubyObj(ptr,FXRbTypeQuery("FXDockSite *"));
543 if(type==SEL_DOCKED || type==SEL_FLOATED) return FXRbGetRubyObjCb(ptr,FXRbTypeQuery("FXDockSite *"));
675544 }
676545 else if(sender->isMemberOf(FXMETACLASS(FXFileList))){
677546 if (type==SEL_CHANGED ||
678547 type==SEL_CLICKED ||
679548 type==SEL_DOUBLECLICKED ||
680549 type==SEL_TRIPLECLICKED ||
681 type==SEL_COMMAND) return to_ruby(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
550 type==SEL_COMMAND) return to_ruby_cb(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
682551 }
683552 else if(sender->isMemberOf(FXMETACLASS(FXFoldingList))){
684553 if(type==SEL_COLLAPSED ||
694563 type==SEL_DESELECTED ||
695564 type==SEL_INSERTED ||
696565 type==SEL_DELETED){
697 return FXRbGetRubyObj(ptr,FXRbTypeQuery("FXFoldingItem *"));
566 return FXRbGetRubyObjCb(ptr,FXRbTypeQuery("FXFoldingItem *"));
698567 }
699568 }
700569 else if(sender->isMemberOf(FXMETACLASS(FXGLViewer))){
703572 type==SEL_DOUBLECLICKED ||
704573 type==SEL_TRIPLECLICKED ||
705574 type==SEL_DRAGGED){
706 return FXRbGetRubyObj(ptr,FXRbTypeQuery("FXGLObject *"));
575 return FXRbGetRubyObjCb(ptr,FXRbTypeQuery("FXGLObject *"));
707576 }
708577 else if(type==SEL_COMMAND){
709578 if(id==FXWindow::ID_QUERY_MENU)
710 return to_ruby(reinterpret_cast<FXEvent*>(ptr));
579 return to_ruby_cb(reinterpret_cast<FXEvent*>(ptr));
711580 else
712 return FXRbGetRubyObj(ptr,FXRbTypeQuery("FXGLObject *"));
581 return FXRbGetRubyObjCb(ptr,FXRbTypeQuery("FXGLObject *"));
713582 }
714583 else if(type==SEL_LASSOED ||
715584 type==SEL_INSERTED ||
724593 }
725594 else if(sender->isMemberOf(FXMETACLASS(FXGradientBar))){
726595 if(type==SEL_CHANGED){
727 return to_ruby(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
596 return to_ruby_cb(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
728597 }
729598 else if(type==SEL_SELECTED || type==SEL_DESELECTED){
730599 return Qnil;
736605 type==SEL_CLICKED ||
737606 type==SEL_REPLACED ||
738607 type==SEL_INSERTED ||
739 type==SEL_DELETED) return to_ruby(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
608 type==SEL_DELETED) return to_ruby_cb(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
740609 }
741610 else if(sender->isMemberOf(FXMETACLASS(FXIconList))){
742611 if(type==SEL_CHANGED ||
748617 type==SEL_DESELECTED ||
749618 type==SEL_REPLACED ||
750619 type==SEL_INSERTED ||
751 type==SEL_DELETED) return to_ruby(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
620 type==SEL_DELETED) return to_ruby_cb(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
752621 }
753622 else if(sender->isMemberOf(FXMETACLASS(FXKnob))){
754 if(type==SEL_CHANGED || type==SEL_COMMAND) return to_ruby(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
623 if(type==SEL_CHANGED || type==SEL_COMMAND) return to_ruby_cb(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
755624 }
756625 else if(sender->isMemberOf(FXMETACLASS(FXList))){
757626 if(type==SEL_CHANGED ||
763632 type==SEL_REPLACED ||
764633 type==SEL_INSERTED ||
765634 type==SEL_DELETED ||
766 type==SEL_COMMAND) return to_ruby(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
635 type==SEL_COMMAND) return to_ruby_cb(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
767636 }
768637 else if(sender->isMemberOf(FXMETACLASS(FXListBox))){
769 if(type==SEL_COMMAND) return to_ruby(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
638 if(type==SEL_COMMAND) return to_ruby_cb(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
770639 else if(type==SEL_CHANGED) return Qnil;
771640 }
772641 else if(sender->isMemberOf(FXMETACLASS(FXMDIChild))){
778647 }
779648 else if(type==SEL_SELECTED ||
780649 type==SEL_DESELECTED){
781 return FXRbGetRubyObj(ptr,FXRbTypeQuery("FXMDIChild *"));
650 return FXRbGetRubyObjCb(ptr,FXRbTypeQuery("FXMDIChild *"));
782651 }
783652 }
784653 else if(sender->isMemberOf(FXMETACLASS(FXMDIClient))){
785 if(type==SEL_CHANGED) return FXRbGetRubyObj(ptr,FXRbTypeQuery("FXMDIChild *"));
654 if(type==SEL_CHANGED) return FXRbGetRubyObjCb(ptr,FXRbTypeQuery("FXMDIChild *"));
786655 }
787656 else if(sender->isMemberOf(FXMETACLASS(FXMenuCheck))){
788 if(type==SEL_COMMAND) return to_ruby(reinterpret_cast<FXuval>(ptr));
657 if(type==SEL_COMMAND) return to_ruby_cb(reinterpret_cast<FXuval>(ptr));
789658 }
790659 else if(sender->isMemberOf(FXMETACLASS(FXMenuRadio))){
791 if(type==SEL_COMMAND) return to_ruby(reinterpret_cast<FXuval>(ptr));
660 if(type==SEL_COMMAND) return to_ruby_cb(reinterpret_cast<FXuval>(ptr));
792661 }
793662 else if(sender->isMemberOf(FXMETACLASS(FXMenuCommand))){
794 if(type==SEL_COMMAND) return to_ruby(true);
663 if(type==SEL_COMMAND) return to_ruby_cb(true);
795664 }
796665 else if(sender->isMemberOf(FXMETACLASS(FXOption))){
797 if(type==SEL_COMMAND) return to_ruby(reinterpret_cast<FXEvent*>(ptr));
666 if(type==SEL_COMMAND) return to_ruby_cb(reinterpret_cast<FXEvent*>(ptr));
798667 }
799668 else if(sender->isMemberOf(FXMETACLASS(FXOptionMenu))){
800 if(type==SEL_COMMAND) return to_ruby(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
669 if(type==SEL_COMMAND) return to_ruby_cb(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
801670 }
802671 else if(sender->isMemberOf(FXMETACLASS(FXRadioButton))){
803 if(type==SEL_COMMAND) return to_ruby(static_cast<FXuchar>(reinterpret_cast<FXuval>(ptr)));
672 if(type==SEL_COMMAND) return to_ruby_cb(static_cast<FXuchar>(reinterpret_cast<FXuval>(ptr)));
804673 }
805674 else if(sender->isMemberOf(FXMETACLASS(FXRealSlider))){
806675 if(type==SEL_CHANGED || type==SEL_COMMAND)
807 return to_ruby(*(reinterpret_cast<FXdouble *>(ptr)));
676 return to_ruby_cb(*(reinterpret_cast<FXdouble *>(ptr)));
808677 }
809678 else if(sender->isMemberOf(FXMETACLASS(FXRealSpinner))){
810 if(type==SEL_COMMAND || type==SEL_CHANGED) return to_ruby(*(reinterpret_cast<FXdouble *>(ptr)));
679 if(type==SEL_COMMAND || type==SEL_CHANGED) return to_ruby_cb(*(reinterpret_cast<FXdouble *>(ptr)));
811680 }
812681 else if(sender->isMemberOf(FXMETACLASS(FXRecentFiles))){
813 if(type==SEL_COMMAND) return to_ruby(reinterpret_cast<FXchar*>(ptr));
682 if(type==SEL_COMMAND) return to_ruby_cb(reinterpret_cast<FXchar*>(ptr));
814683 }
815684 else if(sender->isMemberOf(FXMETACLASS(FXRuler))){
816685 if(type==SEL_CHANGED) return Qnil;
817686 }
818687 else if(sender->isMemberOf(FXMETACLASS(FXScrollBar))){
819 if(type==SEL_CHANGED || type==SEL_COMMAND) return to_ruby(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
688 if(type==SEL_CHANGED || type==SEL_COMMAND) return to_ruby_cb(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
820689 }
821690 else if(sender->isMemberOf(FXMETACLASS(FXShutter))){
822 if(type==SEL_COMMAND) return to_ruby(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
691 if(type==SEL_COMMAND) return to_ruby_cb(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
823692 }
824693 else if(sender->isMemberOf(FXMETACLASS(FXSlider))){
825694 if(type==SEL_CHANGED || type==SEL_COMMAND)
826 return to_ruby(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
695 return to_ruby_cb(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
827696 }
828697 else if(sender->isMemberOf(FXMETACLASS(FXSpinner))){
829698 if(type==SEL_CHANGED || type==SEL_COMMAND)
830 return to_ruby(static_cast<FXint>(reinterpret_cast<FXuval>(ptr)));
699 return to_ruby_cb(static_cast<FXint>(reinterpret_cast<FXuval>(ptr)));
831700 }
832701 else if(sender->isMemberOf(FXMETACLASS(FXSplitter))){
833702 if(type==SEL_CHANGED || type==SEL_COMMAND)
834 return to_ruby(reinterpret_cast<FXWindow *>(ptr));
703 return to_ruby_cb(reinterpret_cast<FXWindow *>(ptr));
835704 }
836705 else if(sender->isMemberOf(FXMETACLASS(FXSwitcher))){
837 if(type==SEL_COMMAND) return to_ruby(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
706 if(type==SEL_COMMAND) return to_ruby_cb(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
838707 }
839708 else if(sender->isMemberOf(FXMETACLASS(FXTabBar))){
840 if(type==SEL_COMMAND) return to_ruby(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
709 if(type==SEL_COMMAND) return to_ruby_cb(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
841710 }
842711 else if(sender->isMemberOf(FXMETACLASS(FXTable))){
843712 if(type==SEL_CLICKED ||
846715 type==SEL_CHANGED ||
847716 type==SEL_COMMAND ||
848717 type==SEL_SELECTED ||
849 type == SEL_DESELECTED) return to_ruby(reinterpret_cast<FXTablePos*>(ptr));
718 type == SEL_DESELECTED) return to_ruby_cb(reinterpret_cast<FXTablePos*>(ptr));
850719 else if(type == SEL_INSERTED ||
851720 type == SEL_DELETED ||
852721 type == SEL_REPLACED){
853 return to_ruby(reinterpret_cast<FXTableRange*>(ptr));
722 return to_ruby_cb(reinterpret_cast<FXTableRange*>(ptr));
854723 }
855724 }
856725 else if(sender->isMemberOf(FXMETACLASS(FXText))){
867736 }
868737 }
869738 else if(type==SEL_CHANGED){
870 return to_ruby(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
739 return to_ruby_cb(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
871740 }
872741 else if(type==SEL_SELECTED ||
873742 type == SEL_DESELECTED) {
874743 FXint* what=reinterpret_cast<FXint*>(ptr);
875744 FXASSERT(what!=0);
876745 VALUE ary=rb_ary_new();
877 rb_ary_push(ary,to_ruby(what[0])); // start position of text
878 rb_ary_push(ary,to_ruby(what[1])); // length of text
746 rb_ary_push(ary,to_ruby_cb(what[0])); // start position of text
747 rb_ary_push(ary,to_ruby_cb(what[1])); // length of text
879748 return ary;
880749 }
881750 else if(type==SEL_INSERTED || type==SEL_DELETED || type==SEL_REPLACED) {
882 return to_ruby(reinterpret_cast<FXTextChange*>(ptr));
751 return to_ruby_cb(reinterpret_cast<FXTextChange*>(ptr));
883752 }
884753 }
885754 else if(sender->isMemberOf(FXMETACLASS(FXTextField))){
886755 if(type==SEL_CHANGED ||
887756 type==SEL_COMMAND ||
888 type==SEL_VERIFY) return to_ruby(reinterpret_cast<FXchar*>(ptr));
757 type==SEL_VERIFY) return to_ruby_cb(reinterpret_cast<FXchar*>(ptr));
889758 }
890759 else if(sender->isMemberOf(FXMETACLASS(FXToggleButton))){
891 if(type==SEL_COMMAND) return to_ruby(static_cast<FXuchar>(reinterpret_cast<FXuval>(ptr)));
760 if(type==SEL_COMMAND) return to_ruby_cb(static_cast<FXuchar>(reinterpret_cast<FXuval>(ptr)));
892761 }
893762 else if(sender->isMemberOf(FXMETACLASS(FXToolBarTab))){
894 if (type==SEL_COMMAND) return to_ruby(static_cast<FXbool>(reinterpret_cast<FXuval>(ptr)));
763 if (type==SEL_COMMAND) return to_ruby_cb(static_cast<FXbool>(reinterpret_cast<FXuval>(ptr)));
895764 }
896765 else if(sender->isMemberOf(FXMETACLASS(FXTopWindow))){
897766 if(type==SEL_MINIMIZE ||
902771 }
903772 else if (type==SEL_SESSION_NOTIFY ||
904773 type==SEL_SESSION_CLOSED) {
905 return to_ruby(reinterpret_cast<FXEvent*>(ptr));
774 return to_ruby_cb(reinterpret_cast<FXEvent*>(ptr));
906775 }
907776 }
908777 else if(sender->isMemberOf(FXMETACLASS(FXTreeList))){
919788 type==SEL_DESELECTED ||
920789 type==SEL_INSERTED ||
921790 type==SEL_DELETED){
922 return FXRbGetRubyObj(ptr,FXRbTypeQuery("FXTreeItem *"));
791 return FXRbGetRubyObjCb(ptr,FXRbTypeQuery("FXTreeItem *"));
923792 }
924793 }
925794 else if(sender->isMemberOf(FXMETACLASS(FXTreeListBox))){
926795 if(type==SEL_CHANGED || type==SEL_COMMAND)
927 return FXRbGetRubyObj(ptr,FXRbTypeQuery("FXTreeItem *"));
796 return FXRbGetRubyObjCb(ptr,FXRbTypeQuery("FXTreeItem *"));
928797 }
929798 #ifdef WITH_FXSCINTILLA
930799 else if(sender->isMemberOf(FXMETACLASS(FXScintilla))){
931800 if(type==SEL_COMMAND){
932 return FXRbGetRubyObj(ptr,FXRbTypeQuery("SCNotification *"));
801 return FXRbGetRubyObjCb(ptr,FXRbTypeQuery("SCNotification *"));
933802 }
934803 }
935804 #endif
1048917 case SEL_CLICKED:
1049918 case SEL_DOUBLECLICKED:
1050919 case SEL_TRIPLECLICKED:
1051 case SEL_CHANGED:
1052920 case SEL_DESELECTED:
1053921 case SEL_SELECTED:
1054922 case SEL_INSERTED:
11641032 return NULL;
11651033 case FXWindow::ID_HSCROLLED:
11661034 case FXWindow::ID_VSCROLLED:
1167 return reinterpret_cast<void*>(static_cast<unsigned long>(NUM2UINT(value)));
1035 return reinterpret_cast<void*>(static_cast<long>(NUM2INT(value)));
11681036 case FXWindow::ID_SETINTVALUE:
11691037 if(obj->isMemberOf(FXMETACLASS(FXColorWell))){
11701038 colorValue=NUM2UINT(value);
12051073 if(obj->isMemberOf(FXMETACLASS(FXPicker))){
12061074 SWIG_ConvertPtr(value,&ptr,FXRbTypeQuery("FXPoint *"),1);
12071075 return ptr;
1208 }
1209 return 0;
1210 }
1076 }
1077 if(obj->isMemberOf(FXMETACLASS(FXWindow))){
1078 switch(id){
1079 case FXWindow::ID_HSCROLLED:
1080 case FXWindow::ID_VSCROLLED:
1081 return reinterpret_cast<void*>(static_cast<long>(NUM2INT(value)));
1082 }
1083 }
1084 return 0;
1085 }
12111086
12121087 if(type==SEL_DRAGGED){
12131088 SWIG_ConvertPtr(value,&ptr,FXRbTypeQuery("FXEvent *"),1);
12281103 * or return zero if the designated receiver doesn't handle this
12291104 * message.
12301105 */
1231 ID FXRbLookupHandler(FXObject* recv,FXSelector key){
1106 ID FXRbLookupHandler_gvlcb(FXObject* recv,FXSelector key){
12321107 FXTRACE((100,"FXRbLookupHandler(recv=%p(%s),FXSEL(%d,%d))\n",recv,recv->getClassName(),FXSELTYPE(key),FXSELID(key)));
12331108 ID id=0;
12341109 VALUE rubyObj=to_ruby(recv);
12751150 static VALUE handle_rescue(VALUE args,VALUE error){
12761151 VALUE info=rb_gv_get("$!");
12771152 VALUE errat=rb_funcall(info,id_backtrace,0);
1278 VALUE mesg=RARRAY_PTR(errat)[0];
1153 VALUE mesg=rb_ary_entry(errat, 0);
1154 VALUE info_str=rb_obj_as_string(info);
12791155 fprintf(stderr,"%s: %s (%s)\n",
1280 StringValuePtr(mesg),
1281 RSTRING_PTR(rb_obj_as_string(info)),
1156 StringValueCStr(mesg),
1157 StringValueCStr(info_str),
12821158 rb_class2name(CLASS_OF(info)));
12831159 for(int i=1;i<RARRAY_LEN(errat);i++){
1284 if(TYPE(RARRAY_PTR(errat)[i])==T_STRING){
1285 fprintf(stderr,"\tfrom %s\n",StringValuePtr(RARRAY_PTR(errat)[i]));
1160 VALUE entry = rb_ary_entry(errat, i);
1161 if(TYPE(entry)==T_STRING){
1162 fprintf(stderr,"\tfrom %s\n",StringValueCStr(entry));
12861163 }
12871164 }
12881165 return Qnil;
12891166 }
12901167
12911168
1169 // Should we catch exceptions thrown by message handlers?
1170 FXbool FXRbCatchExceptions=FALSE;
1171
1172
12921173 // Call the designated function and return its result (which should be a long).
1293 long FXRbHandleMessage(FXObject* recv,ID func,FXObject* sender,FXSelector key,void* ptr){
1174 long FXRbHandleMessage_gvlcb(FXObject* recv,ID func,FXObject* sender,FXSelector key,void* ptr){
12941175 FXRbHandleArgs hArgs;
1295 hArgs.recv=to_ruby(recv);
1296 hArgs.sender=to_ruby(sender);
1297 hArgs.key=to_ruby(key);
1176 hArgs.recv=to_ruby_cb(recv);
1177 hArgs.sender=to_ruby_cb(sender);
1178 hArgs.key=to_ruby_cb(key);
12981179 hArgs.data=FXRbConvertMessageData(sender,recv,key,ptr);
12991180 hArgs.id=func;
13001181 hArgs.nargs=3;
13031184 FXTRACE((100,"FXRbHandleMessage(recv=%p(%s),FXSEL(%s,%d)\n",recv,recv->getClassName(),FXDebugTarget::messageTypeName[FXSELTYPE(key)],FXSELID(key)));
13041185
13051186 if(FXRbCatchExceptions){
1306 retval=rb_rescue2((VALUE(*)(ANYARGS)) handle_body, reinterpret_cast<VALUE>(&hArgs),
1307 (VALUE(*)(ANYARGS)) handle_rescue, Qnil,
1187 retval=rb_rescue2(RUBY_VALUE_METHOD_FUNC(handle_body), reinterpret_cast<VALUE>(&hArgs),
1188 RUBY_VALUE_METHOD_FUNC(handle_rescue), Qnil,
13081189 rb_eStandardError, rb_eNameError, 0);
13091190 }
13101191 else{
13501231 rb_raise(rb_eTypeError,"wrong argument type %s (expected %s)",rb_class2name(CLASS_OF(range)),rb_class2name(rb_cRange));
13511232 }
13521233 else{
1353 VALUE beg=rb_funcall(range,id_begin,0,NULL);
1354 VALUE end=rb_funcall(range,id_end,0,NULL);
1355 VALUE excl=rb_funcall(range,id_exclude_endp,0,NULL);
1234 VALUE beg=rb_funcall(range,id_begin,0);
1235 VALUE end=rb_funcall(range,id_end,0);
1236 VALUE excl=rb_funcall(range,id_exclude_endp,0);
13561237 lo=NUM2INT(beg);
13571238 hi=NUM2INT(end);
13581239 if(excl==Qtrue){
13661247 rb_raise(rb_eTypeError,"wrong argument type %s (expected %s)",rb_class2name(CLASS_OF(range)),rb_class2name(rb_cRange));
13671248 }
13681249 else{
1369 VALUE beg=rb_funcall(range,id_begin,0,NULL);
1370 VALUE end=rb_funcall(range,id_end,0,NULL);
1371 VALUE excl=rb_funcall(range,id_exclude_endp,0,NULL);
1250 VALUE beg=rb_funcall(range,id_begin,0);
1251 VALUE end=rb_funcall(range,id_end,0);
1252 VALUE excl=rb_funcall(range,id_exclude_endp,0);
13721253 lo=NUM2DBL(beg);
13731254 hi=NUM2DBL(end);
13741255 if(excl==Qtrue){
13791260
13801261 //----------------------------------------------------------------------
13811262
1382 void FXRbCallVoidMethod(FXObject* recv, ID func) {
1263 void FXRbCallVoidMethod_gvlcb(FXObject* recv, const char *func) {
13831264 VALUE obj=FXRbGetRubyObj(recv,false);
13841265 FXASSERT(!NIL_P(obj));
13851266 FXASSERT(!FXRbIsInGC(recv));
1386 rb_funcall(obj,func,0,NULL);
1387 }
1388
1389 void FXRbCallVoidMethod(FXDC* recv,ID func) {
1267 rb_funcall(obj,rb_intern(func),0);
1268 }
1269
1270 void FXRbCallVoidMethod_gvlcb(FXDC* recv,const char *func) {
13901271 VALUE obj=FXRbGetRubyObj(recv,false);
13911272 FXASSERT(!NIL_P(obj));
1392 rb_funcall(obj,func,0,NULL);
1393 }
1394
1395 //----------------------------------------------------------------------
1396
1397 bool FXRbCallBoolMethod(const FXObject* recv,ID func){
1273 rb_funcall(obj,rb_intern(func),0);
1274 }
1275
1276 //----------------------------------------------------------------------
1277
1278 bool FXRbCallBoolMethod_gvlcb(const FXObject* recv,const char *func){
13981279 VALUE obj=FXRbGetRubyObj(recv,false);
13991280 FXASSERT(!NIL_P(obj));
1400 VALUE v=rb_funcall(obj,func,0,NULL);
1281 VALUE v=rb_funcall(obj,rb_intern(func),0);
14011282 return (v==Qtrue);
14021283 }
14031284
14041285 //----------------------------------------------------------------------
14051286
14061287 // Call function with "FXint" return value
1407 FXint FXRbCallIntMethod(const FXObject* recv,ID func){
1288 FXint FXRbCallIntMethod_gvlcb(const FXObject* recv,const char *func){
14081289 VALUE obj=FXRbGetRubyObj(recv,false);
14091290 FXASSERT(!NIL_P(obj));
1410 VALUE result=rb_funcall(obj,func,0,NULL);
1291 VALUE result=rb_funcall(obj,rb_intern(func),0);
14111292 return static_cast<FXint>(NUM2INT(result));
14121293 }
14131294
14141295 //----------------------------------------------------------------------
14151296
14161297 // Call function with "FXGLObject*" return value
1417 FXGLObject* FXRbCallGLObjectMethod(FXGLObject* recv,ID func){
1298 FXGLObject* FXRbCallGLObjectMethod_gvlcb(FXGLObject* recv,const char *func){
14181299 VALUE obj=FXRbGetRubyObj(recv,false);
14191300 FXASSERT(!NIL_P(obj));
1420 VALUE result=rb_funcall(obj,func,0,NULL);
1301 VALUE result=rb_funcall(obj,rb_intern(func),0);
14211302 return NIL_P(result) ? 0 : reinterpret_cast<FXGLObject*>(DATA_PTR(result));
14221303 }
14231304
1424 FXGLObject* FXRbCallGLObjectMethod(FXGLViewer* recv,ID func,FXint x,FXint y){
1305 FXGLObject* FXRbCallGLObjectMethod_gvlcb(FXGLViewer* recv,const char *func,FXint x,FXint y){
14251306 VALUE obj=FXRbGetRubyObj(recv,false);
14261307 FXASSERT(!NIL_P(obj));
1427 VALUE result=rb_funcall(obj,func,2,INT2NUM(x),INT2NUM(y));
1308 VALUE result=rb_funcall(obj,rb_intern(func),2,INT2NUM(x),INT2NUM(y));
14281309 return NIL_P(result) ? 0 : reinterpret_cast<FXGLObject*>(DATA_PTR(result));
14291310 }
14301311
1431 FXGLObject* FXRbCallGLObjectMethod(FXGLObject* recv,ID func,FXuint* path,FXint n){
1312 FXGLObject* FXRbCallGLObjectMethod_gvlcb(FXGLObject* recv,const char *func,FXuint* path,FXint n){
14321313 VALUE obj=FXRbGetRubyObj(recv,false);
14331314 FXASSERT(!NIL_P(obj));
1434 VALUE result=rb_funcall(obj,func,1,FXRbMakeArray(path,n));
1315 VALUE result=rb_funcall(obj,rb_intern(func),1,FXRbMakeArray(path,n));
14351316 return NIL_P(result) ? 0 : reinterpret_cast<FXGLObject*>(DATA_PTR(result));
14361317 }
14371318
14381319 //----------------------------------------------------------------------
14391320
14401321 // Call function with "FXGLObject**" return value
1441 FXGLObject** FXRbCallGLObjectArrayMethod(FXGLViewer* recv,ID func,FXint x,FXint y,FXint w,FXint h){
1322 FXGLObject** FXRbCallGLObjectArrayMethod_gvlcb(FXGLViewer* recv,const char *func,FXint x,FXint y,FXint w,FXint h){
14421323 FXGLObject** objects=NULL;
14431324 VALUE obj=FXRbGetRubyObj(recv,false);
14441325 FXASSERT(!NIL_P(obj));
1445 VALUE result=rb_funcall(obj,func,4,INT2NUM(x),INT2NUM(y),INT2NUM(w),INT2NUM(h));
1326 VALUE result=rb_funcall(obj,rb_intern(func),4,INT2NUM(x),INT2NUM(y),INT2NUM(w),INT2NUM(h));
14461327 if(!NIL_P(result)){
14471328 Check_Type(result,T_ARRAY);
14481329 if(FXMALLOC(&objects,FXGLObject*,RARRAY_LEN(result)+1)){
14571338
14581339 //----------------------------------------------------------------------
14591340
1460 FXTableItem* FXRbCallTableItemMethod(FXTable* recv,ID func,const FXString& text,FXIcon* icon,void* ptr){
1341 FXTableItem* FXRbCallTableItemMethod_gvlcb(FXTable* recv,const char *func,const FXString& text,FXIcon* icon,void* ptr){
14611342 VALUE itemData=(ptr==0)?Qnil:reinterpret_cast<VALUE>(ptr);
14621343 VALUE obj=FXRbGetRubyObj(recv,false);
14631344 FXASSERT(!NIL_P(obj));
1464 VALUE result=rb_funcall(obj,func,3,to_ruby(text),to_ruby(icon),itemData);
1345 VALUE result=rb_funcall(obj,rb_intern(func),3,to_ruby(text),to_ruby_cb(icon),itemData);
14651346 return NIL_P(result)?0:reinterpret_cast<FXTableItem*>(DATA_PTR(result));
14661347 }
14671348
1468 FXTableItem* FXRbCallTableItemMethod(FXTable* recv,ID func,FXint row,FXint col,FXbool notify){
1349 FXTableItem* FXRbCallTableItemMethod_gvlcb(FXTable* recv,const char *func,FXint row,FXint col,FXbool notify){
14691350 VALUE obj=FXRbGetRubyObj(recv,false);
14701351 FXASSERT(!NIL_P(obj));
1471 VALUE result=rb_funcall(obj,func,3,to_ruby(row),to_ruby(col),to_ruby(notify));
1352 VALUE result=rb_funcall(obj,rb_intern(func),3,to_ruby(row),to_ruby(col),to_ruby(notify));
14721353 return NIL_P(result)?0:reinterpret_cast<FXTableItem*>(DATA_PTR(result));
14731354 }
14741355
14751356 //----------------------------------------------------------------------
14761357
1477 FXTreeItem* FXRbCallTreeItemMethod(const FXTreeList* recv,ID func,FXint x,FXint y){
1358 FXTreeItem* FXRbCallTreeItemMethod_gvlcb(const FXTreeList* recv,const char *func,FXint x,FXint y){
14781359 VALUE obj=FXRbGetRubyObj(recv,false);
14791360 FXASSERT(!NIL_P(obj));
1480 VALUE result=rb_funcall(obj,func,2,INT2NUM(x),INT2NUM(y));
1361 VALUE result=rb_funcall(obj,rb_intern(func),2,INT2NUM(x),INT2NUM(y));
14811362 return NIL_P(result) ? 0 : reinterpret_cast<FXTreeItem*>(DATA_PTR(result));
14821363 }
14831364
14841365 //----------------------------------------------------------------------
14851366
1486 FXFoldingItem* FXRbCallFoldingItemMethod(const FXFoldingList* recv,ID func,FXint x,FXint y){
1367 FXFoldingItem* FXRbCallFoldingItemMethod_gvlcb(const FXFoldingList* recv,const char *func,FXint x,FXint y){
14871368 VALUE obj=FXRbGetRubyObj(recv,false);
14881369 FXASSERT(!NIL_P(obj));
1489 VALUE result=rb_funcall(obj,func,2,INT2NUM(x),INT2NUM(y));
1370 VALUE result=rb_funcall(obj,rb_intern(func),2,INT2NUM(x),INT2NUM(y));
14901371 return NIL_P(result) ? 0 : reinterpret_cast<FXFoldingItem*>(DATA_PTR(result));
14911372 }
14921373
14931374 //----------------------------------------------------------------------
14941375
1495 FXFileAssoc* FXRbCallFileAssocMethod(const FXFileDict* recv,ID func,const FXchar* pathname){
1376 FXFileAssoc* FXRbCallFileAssocMethod_gvlcb(const FXFileDict* recv,const char *func,const FXchar* pathname){
14961377 VALUE obj=FXRbGetRubyObj(recv,false);
14971378 FXASSERT(!NIL_P(obj));
1498 VALUE result=rb_funcall(obj,func,1,to_ruby(pathname));
1379 VALUE result=rb_funcall(obj,rb_intern(func),1,to_ruby(pathname));
14991380 return NIL_P(result) ? 0 : reinterpret_cast<FXFileAssoc*>(DATA_PTR(result));
15001381 }
15011382
15021383 //----------------------------------------------------------------------
15031384
1504 FXIcon* FXRbCallIconMethod(const FXTableItem* recv,ID func){
1385 FXIcon* FXRbCallIconMethod_gvlcb(const FXTableItem* recv,const char *func){
15051386 VALUE obj=FXRbGetRubyObj(recv,false);
15061387 FXASSERT(!NIL_P(obj));
15071388 if(!NIL_P(obj)){
1508 VALUE result=rb_funcall(obj,func,0,NULL);
1389 VALUE result=rb_funcall(obj,rb_intern(func),0);
15091390 return NIL_P(result) ? 0 : reinterpret_cast<FXIcon*>(DATA_PTR(result));
15101391 }
15111392 else{
15151396
15161397 //----------------------------------------------------------------------
15171398
1518 FXWindow* FXRbCallWindowMethod(const FXTableItem* recv,ID func,FXTable* table){
1399 FXWindow* FXRbCallWindowMethod_gvlcb(const FXTableItem* recv,const char *func,FXTable* table){
15191400 VALUE obj=FXRbGetRubyObj(recv,false);
15201401 FXASSERT(!NIL_P(obj));
1521 VALUE result=rb_funcall(obj,func,1,to_ruby(table));
1402 VALUE result=rb_funcall(obj,rb_intern(func),1,to_ruby_cb(table));
15221403 return NIL_P(result) ? 0 : reinterpret_cast<FXWindow*>(DATA_PTR(result));
15231404 }
15241405
15251406 //----------------------------------------------------------------------
15261407
15271408 // Call function with "FXRange" return value
1528 FXRangef FXRbCallRangeMethod(FXObject* recv,ID func){
1409 FXRangef FXRbCallRangeMethod_gvlcb(FXObject* recv,const char *func){
15291410 VALUE obj=FXRbGetRubyObj(recv,false);
15301411 FXASSERT(!NIL_P(obj));
1531 VALUE result=rb_funcall(obj,func,0,NULL);
1412 VALUE result=rb_funcall(obj,rb_intern(func),0);
15321413 return *reinterpret_cast<FXRangef*>(DATA_PTR(result));
15331414 }
15341415
15351416 //----------------------------------------------------------------------
15361417
15371418 // Call functions with FXString return value
1538 FXString FXRbCallStringMethod(const FXObject* recv, ID func){
1419 FXString FXRbCallStringMethod_gvlcb(const FXObject* recv, const char *func){
15391420 VALUE obj=FXRbGetRubyObj(recv,false);
15401421 FXASSERT(!NIL_P(obj));
1541 VALUE result=rb_funcall(obj,func,0,NULL);
1422 VALUE result=rb_funcall(obj,rb_intern(func),0);
15421423 return FXString(StringValuePtr(result));
15431424 }
15441425
15451426 //----------------------------------------------------------------------
15461427
15471428 // Call functions with const FXchar* return value
1548 const FXchar* FXRbCallCStringMethod(const FXObject* recv, ID func, const FXchar* message, const FXchar* hint){
1429 const FXchar* FXRbCallCStringMethod_gvlcb(const FXObject* recv, const char *func, const FXchar* message, const FXchar* hint){
15491430 VALUE obj=FXRbGetRubyObj(recv,false);
15501431 FXASSERT(!NIL_P(obj));
1551 VALUE result=rb_funcall(obj,func,2,to_ruby(message),to_ruby(hint));
1432 VALUE result=rb_funcall(obj,rb_intern(func),2,to_ruby(message),to_ruby(hint));
15521433 return NIL_P(result) ? 0 : StringValuePtr(result);
15531434 }
15541435
15551436 // Call functions with const FXchar* return value
1556 const FXchar* FXRbCallCStringMethod(const FXObject* recv, ID func, const FXchar* context, const FXchar* message, const FXchar* hint){
1437 const FXchar* FXRbCallCStringMethod_gvlcb(const FXObject* recv, const char *func, const FXchar* context, const FXchar* message, const FXchar* hint){
15571438 VALUE obj=FXRbGetRubyObj(recv,false);
15581439 FXASSERT(!NIL_P(obj));
1559 VALUE result=rb_funcall(obj,func,3,to_ruby(context),to_ruby(message),to_ruby(hint));
1440 VALUE result=rb_funcall(obj,rb_intern(func),3,to_ruby(context),to_ruby(message),to_ruby(hint));
15601441 return NIL_P(result) ? 0 : StringValuePtr(result);
15611442 }
15621443 //----------------------------------------------------------------------
15631444
15641445 // Call functions with FXwchar return value
1565 FXwchar FXRbCallWCharMethod(const FXObject* recv, ID func){
1446 FXwchar FXRbCallWCharMethod_gvlcb(const FXObject* recv, const char *func){
15661447 VALUE obj=FXRbGetRubyObj(recv,false);
15671448 FXASSERT(!NIL_P(obj));
1568 VALUE result=rb_funcall(obj,func,0,NULL);
1449 VALUE result=rb_funcall(obj,rb_intern(func),0);
15691450 return static_cast<FXwchar>(NUM2ULONG(result));
1451 }
1452
1453 void FXRbCallSetDashes_gvlcb(FXDC* recv,const char *func,FXuint dashoffset,const FXchar *dashpattern,FXuint dashlength){
1454 rb_funcall(FXRbGetRubyObj(recv,false),rb_intern(func),2,to_ruby(dashoffset),FXRbMakeArray(dashpattern,dashlength));
1455 }
1456
1457 void FXRbCallDCDrawMethod_gvlcb(FXDC* recv, const char * func, FXint x,FXint y,const FXString& string){
1458 rb_funcall(FXRbGetRubyObj(recv,false),rb_intern(func),3,to_ruby(x),to_ruby(y),to_ruby(string)); \
1459 }
1460
1461 void FXRbCallDCDrawMethod_gvlcb(FXDC* recv, const char * func, FXint x,FXint y,const FXchar* string,FXuint length){
1462 rb_funcall(FXRbGetRubyObj(recv,false),rb_intern(func),3,to_ruby(x),to_ruby(y),to_ruby(string,length)); \
15701463 }
15711464
15721465 //----------------------------------------------------------------------
15841477 }
15851478 }
15861479 }
1587 acckey=(FXHotKey)NULL;
1480 acckey=(FXHotKey)0;
15881481 FXRbUnregisterRubyObj(this);
15891482 }
15901483
16001493 }
16011494 }
16021495 }
1603 acckey=(FXHotKey)NULL;
1496 acckey=(FXHotKey)0;
16041497 FXRbUnregisterRubyObj(this);
16051498 }
16061499
16161509 }
16171510 }
16181511 }
1619 acckey=(FXHotKey)NULL;
1512 acckey=(FXHotKey)0;
16201513 FXRbUnregisterRubyObj(this);
16211514 }
16221515
16831576
16841577 static ID id_cmp;
16851578
1686 // Sort function stand-in for FXComboBox
1687 FXint FXRbComboBox::sortFunc(const FXListItem* a,const FXListItem* b){
1688 VALUE itemA = FXRbGetRubyObj(const_cast<FXListItem*>(a), "FXListItem *");
1689 VALUE itemB = FXRbGetRubyObj(const_cast<FXListItem*>(b), "FXListItem *");
1690 VALUE result=rb_funcall(itemA,id_cmp,1,itemB);
1691 return static_cast<FXint>(NUM2INT(result));
1692 }
1693
1694
1695 // Sort function stand-in for FXFoldingList
1696 FXint FXRbFoldingList::sortFunc(const FXFoldingItem* a,const FXFoldingItem* b){
1697 VALUE itemA = FXRbGetRubyObj(const_cast<FXFoldingItem*>(a), "FXFoldingItem *");
1698 VALUE itemB = FXRbGetRubyObj(const_cast<FXFoldingItem*>(b), "FXFoldingItem *");
1699 VALUE result=rb_funcall(itemA,id_cmp,1,itemB);
1700 return static_cast<FXint>(NUM2INT(result));
1701 }
1702
1703
1704 // Sort function stand-in for FXIconList
1705 FXint FXRbIconList::sortFunc(const FXIconItem* a,const FXIconItem* b){
1706 VALUE itemA = FXRbGetRubyObj(const_cast<FXIconItem*>(a), "FXIconItem *");
1707 VALUE itemB = FXRbGetRubyObj(const_cast<FXIconItem*>(b), "FXIconItem *");
1708 VALUE result = rb_funcall(itemA,id_cmp,1,itemB);
1709 return static_cast<FXint>(NUM2INT(result));
1710 }
1711
1712
1713 // Sort function stand-in for FXList
1714 FXint FXRbList::sortFunc(const FXListItem* a,const FXListItem* b){
1715 VALUE itemA = FXRbGetRubyObj(const_cast<FXListItem*>(a), "FXListItem *");
1716 VALUE itemB = FXRbGetRubyObj(const_cast<FXListItem*>(b), "FXListItem *");
1717 VALUE result=rb_funcall(itemA,id_cmp,1,itemB);
1718 return static_cast<FXint>(NUM2INT(result));
1719 }
1720
1721
1722 // Sort function stand-in for FXListBox
1723 FXint FXRbListBox::sortFunc(const FXListItem* a,const FXListItem* b){
1724 VALUE itemA = FXRbGetRubyObj(const_cast<FXListItem*>(a), "FXListItem *");
1725 VALUE itemB = FXRbGetRubyObj(const_cast<FXListItem*>(b), "FXListItem *");
1726 VALUE result=rb_funcall(itemA,id_cmp,1,itemB);
1727 return static_cast<FXint>(NUM2INT(result));
1728 }
1729
1730
1731 // Sort function stand-in for FXTreeList
1732 FXint FXRbTreeList::sortFunc(const FXTreeItem* a,const FXTreeItem* b){
1733 VALUE itemA = FXRbGetRubyObj(const_cast<FXTreeItem*>(a), "FXTreeItem *");
1734 VALUE itemB = FXRbGetRubyObj(const_cast<FXTreeItem*>(b), "FXTreeItem *");
1735 VALUE result=rb_funcall(itemA,id_cmp,1,itemB);
1736 return static_cast<FXint>(NUM2INT(result));
1737 }
1738
1579 #define SORTFUNC(list, item) \
1580 FXint list::sortFunc(const item* a,const item* b){ \
1581 return list##_sortFunc(a, b); \
1582 } \
1583 FXint list##_sortFunc_gvlcb(const item* a,const item* b){ \
1584 VALUE itemA = FXRbGetRubyObj(const_cast<item*>(a), #item " *"); \
1585 VALUE itemB = FXRbGetRubyObj(const_cast<item*>(b), #item " *"); \
1586 VALUE result=rb_funcall(itemA,id_cmp,1,itemB); \
1587 return static_cast<FXint>(NUM2INT(result)); \
1588 }
1589
1590 SORTFUNC( FXRbComboBox, FXListItem )
1591 SORTFUNC( FXRbFoldingList, FXFoldingItem )
1592 SORTFUNC( FXRbIconList, FXIconItem )
1593 SORTFUNC( FXRbList, FXListItem )
1594 SORTFUNC( FXRbListBox, FXListItem )
1595 SORTFUNC( FXRbTreeList, FXTreeItem )
1596
1597 #undef SORTFUNC
17391598
17401599 // Feedback buffer sort routine stand-in for FXGLViewer
17411600 FXbool FXRbGLViewer::sortProc(FXfloat*& buffer,FXint& used,FXint& size){
17421601 return TRUE;
17431602 }
1603
1604 /**
1605 * FXRbConvertPtr() is just a wrapper around SWIG_ConvertPtr().
1606 */
1607
1608 void* FXRbConvertPtr(VALUE obj,swig_type_info* ty){
1609 void *ptr;
1610 SWIG_ConvertPtr(obj,&ptr,ty,1);
1611 return ptr;
1612 }
1613
1614
1615 // Returns an FXInputHandle for this Ruby file object
1616 FXInputHandle FXRbGetReadFileHandle(VALUE obj,FXuint mode) {
1617 int fd;
1618 fd = FIX2INT(rb_funcall(obj, rb_intern("fileno"), 0));
1619 #ifdef WIN32
1620 #ifdef __CYGWIN__
1621 return (FXInputHandle) get_osfhandle(fd);
1622 #else
1623 WSAEVENT hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
1624 long events = 0;
1625 if(mode&INPUT_READ) events |= FD_READ|FD_ACCEPT|FD_OOB;
1626 if(mode&INPUT_EXCEPT) events |= FD_CLOSE|FD_QOS|FD_GROUP_QOS|FD_ROUTING_INTERFACE_CHANGE|FD_ADDRESS_LIST_CHANGE;
1627 if ( WSAEventSelect(_get_osfhandle(fd), hEvent, events) == SOCKET_ERROR ) {
1628 WSACloseEvent( hEvent );
1629 rb_raise( rb_eRuntimeError, "WSAEventSelect sockett error: %d", WSAGetLastError() );
1630 }
1631 rb_iv_set(obj, "FXRuby::FXRbGetReadFileHandle", ULL2NUM((intptr_t)hEvent));
1632 return (FXInputHandle) hEvent;
1633 #endif
1634 #else
1635 return (FXInputHandle) fd;
1636 #endif
1637 }
1638
1639 void FXRbRemoveReadFileHandle(VALUE obj,FXuint mode) {
1640 #ifdef WIN32
1641 WSAEVENT hEvent = (HANDLE)NUM2ULL(rb_iv_get(obj, "FXRuby::FXRbGetReadFileHandle"));
1642 CloseHandle( hEvent );
1643 #endif
1644 }
1645
1646 // Returns an FXInputHandle for this Ruby file object
1647 FXInputHandle FXRbGetWriteFileHandle(VALUE obj,FXuint mode) {
1648 int fd;
1649 #if defined(RUBINIUS)
1650 VALUE vwrite = rb_intern("@write");
1651 if(rb_ivar_defined(obj, vwrite)) obj = rb_ivar_get(obj, vwrite);
1652 fd = FIX2INT(rb_funcall(obj, rb_intern("fileno"), 0));
1653 #else
1654 rb_io_t *fptr;
1655 GetOpenFile(obj, fptr);
1656 VALUE wrio = fptr->tied_io_for_writing;
1657 if(wrio) obj = wrio;
1658 fd = FIX2INT(rb_funcall(obj, rb_intern("fileno"), 0));
1659 #endif
1660 #ifdef WIN32
1661 #ifdef __CYGWIN__
1662 return (FXInputHandle) get_osfhandle(fd);
1663 #else
1664 WSAEVENT hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
1665 long events = 0;
1666 if(mode&INPUT_WRITE) events |= FD_WRITE|FD_CONNECT;
1667 if(mode&INPUT_EXCEPT) events |= FD_CLOSE|FD_QOS|FD_GROUP_QOS|FD_ROUTING_INTERFACE_CHANGE|FD_ADDRESS_LIST_CHANGE;
1668 if ( WSAEventSelect(_get_osfhandle(fd), hEvent, events) == SOCKET_ERROR ) {
1669 WSACloseEvent( hEvent );
1670 rb_raise( rb_eRuntimeError, "WSAEventSelect sockettt error: %d", WSAGetLastError() );
1671 }
1672 rb_iv_set(obj, "FXRuby::FXRbGetWriteFileHandle", ULL2NUM((intptr_t)hEvent));
1673 return (FXInputHandle) hEvent;
1674 #endif
1675 #else
1676 return (FXInputHandle) fd;
1677 #endif
1678 }
1679
1680 void FXRbRemoveWriteFileHandle(VALUE obj,FXuint mode) {
1681 #ifdef WIN32
1682 WSAEVENT hEvent = (HANDLE)NUM2ULL(rb_iv_get(obj, "FXRuby::FXRbGetWriteFileHandle"));
1683 CloseHandle( hEvent );
1684 #endif
1685 }
17441686
17451687 //----------------------------------------------------------------------
17461688
19441886 FXASSERT(st_lookup(appSensitiveDCs,reinterpret_cast<st_data_t>(dc),reinterpret_cast<st_data_t *>(0))==0);
19451887 }
19461888
1947 static int st_cbfunc_obj(st_data_t key,st_data_t,st_data_t arg,int){
1889 static int st_cbfunc_obj(st_data_t key,st_data_t,st_data_t arg){
19481890 FXASSERT(key!=0);
19491891 FXASSERT(arg!=0);
19501892 FXObjectListOf<FXObject> *pObjectList=reinterpret_cast<FXObjectListOf<FXObject>*>(arg);
19531895 return 0;
19541896 }
19551897
1956 static int st_cbfunc_dc(st_data_t key,st_data_t,st_data_t arg,int){
1898 static int st_cbfunc_dc(st_data_t key,st_data_t,st_data_t arg){
19571899 FXASSERT(key!=0);
19581900 FXASSERT(arg!=0);
19591901 FXArray<FXDC*> *pDCArray=reinterpret_cast<FXArray<FXDC*>*>(arg);
19661908 FXTRACE((100,"%s:%d: Begin destroying objects that hold references to the FXApp...\n",__FILE__,__LINE__));
19671909
19681910 FXObjectListOf<FXObject> objs;
1969 st_foreach(appSensitiveObjs,reinterpret_cast<int (*)(ANYARGS)>(st_cbfunc_obj),reinterpret_cast<st_data_t>(&objs));
1911 st_foreach(appSensitiveObjs,RUBY_INT_METHOD_FUNC(st_cbfunc_obj),reinterpret_cast<st_data_t>(&objs));
19701912 for(FXint i=0;i<objs.no();i++){
19711913 if(objs[i]->isMemberOf(FXMETACLASS(FXRbCursor))){
19721914 if(dynamic_cast<FXRbCursor*>(objs[i])->ownedByApp)
19961938 }
19971939
19981940 FXArray<FXDC*> dcs;
1999 st_foreach(appSensitiveDCs,reinterpret_cast<int (*)(ANYARGS)>(st_cbfunc_dc),reinterpret_cast<st_data_t>(&dcs));
1941 st_foreach(appSensitiveDCs,RUBY_INT_METHOD_FUNC(st_cbfunc_dc),reinterpret_cast<st_data_t>(&dcs));
20001942 for(FXint j=0;j<dcs.no();j++){
20011943 delete dcs[j];
20021944 }
20652007 utf8_enc_idx = rb_enc_find_index("UTF-8");
20662008 #endif
20672009
2068 FXRuby_Objects=st_init_numtable();
20692010 appSensitiveObjs=st_init_numtable();
20702011 appSensitiveDCs=st_init_numtable();
20712012 }
22 require 'fileutils'
33 require 'mkmf'
44
5 def find_installed_fox_version
6 stddirs = ["/usr/include/fox-1.6",
7 "/usr/local/include/fox-1.6",
8 "/sw/include/fox-1.6",
9 "/opt/local/include/fox-1.6"]
10 usrdirs = []
11 ARGV.each do |arg|
12 if arg =~ /--with-fox-include/
13 option, value = arg.split('=')
14 usrdirs = [ value ] + usrdirs
15 end
16 end
17 incdirs = usrdirs + stddirs
18 incdirs.uniq! # remove duplicates
19
20 incdirs.each do |incdir|
21 filename = File.join(incdir, "fxver.h")
22 if FileTest.exist?(filename)
23 idircflag = "-I" + incdir
24 $CPPFLAGS += " " + idircflag unless $CPPFLAGS.split.include?(idircflag)
25 return
26 end
27 end
28
29 # Couldn't find it; this should have been caught by the pre-config script
30 raise RuntimeError, "couldn't find FOX header files"
31 end
5 gem 'mini_portile2', '~>2.1'
6 require 'mini_portile2'
327
338 $autodetected_fxscintilla = false
34
35 def find_installed_fxscintilla_version
36 stddirs = ["/usr/include/fxscintilla",
37 "/usr/local/include/fxscintilla",
38 "/sw/include/fxscintilla",
39 "/opt/local/include/fxscintilla"]
40 usrdirs = []
41 ARGV.each do |arg|
42 if arg =~ /--with-fxscintilla-include/
43 option, value = arg.split('=')
44 usrdirs = [ value ] + usrdirs
45 end
46 end
47 incdirs = usrdirs + stddirs
48 incdirs.uniq! # remove duplicates
49
50 incdirs.each do |incdir|
51 filename = File.join(incdir, "FXScintilla.h")
52 if FileTest.exist?(filename)
53 $autodetected_fxscintilla = true
54 idircflag = "-I" + incdir
55 $CPPFLAGS += " " + idircflag unless $CPPFLAGS.split.include?(idircflag)
56 return
57 end
58 end
59 end
609
6110 def is_fxscintilla_build?
6211 # No means no
6312 return false if fxscintilla_support_suppressed?
6413
6514 # Check arguments
66 args = ARGV.delete_if { |e| !(e =~ /--with-fxscintilla/) }
67 (args.length > 0) || $autodetected_fxscintilla
15 with_config("fxscintilla", false) || $autodetected_fxscintilla
6816 end
6917
7018 def fxscintilla_support_suppressed?
71 ARGV.include? "--without-fxscintilla"
72 end
73
74 def with_env(hash)
75 hash.each do |k, v|
76 ENV[k] = v
77 end
78 begin
79 yield
80 ensure
81 hash.each do |k, v|
82 ENV.delete(k)
83 end
84 end
85 end
86
87 LIBZ_VERSION = ENV['LIBZ_VERSION'] || '1.2.7'
88 LIBZ_SOURCE_URI = "http://downloads.sourceforge.net/project/libpng/zlib/#{LIBZ_VERSION}/zlib-#{LIBZ_VERSION}.tar.bz2"
89
90 LIBPNG_VERSION = ENV['LIBPNG_VERSION'] || '1.5.13'
19 !with_config("fxscintilla", true)
20 end
21
22 # Stick at zlib-1.2.7 for compatibility to MSYS1 based RubyInstaller.
23 LIBZ_VERSION = ENV['LIBZ_VERSION'] || '1.2.7.3'
24 LIBZ_SOURCE_URI = "http://zlib.net/fossils/zlib-#{LIBZ_VERSION}.tar.gz"
25
26 LIBPNG_VERSION = ENV['LIBPNG_VERSION'] || '1.6.37'
9127 LIBPNG_SOURCE_URI = "http://prdownloads.sourceforge.net/libpng/libpng-#{LIBPNG_VERSION}.tar.gz"
9228
93 LIBJPEG_VERSION = ENV['LIBJPEG_VERSION'] || '8d'
94 LIBJPEG_SOURCE_URI = "http://www.ijg.org/files/jpegsrc.v#{LIBJPEG_VERSION}.tar.gz"
95
96 LIBTIFF_VERSION = ENV['LIBTIFF_VERSION'] || '4.0.3'
29 # LIBJPEG_VERSION = ENV['LIBJPEG_VERSION'] || '9b'
30 # LIBJPEG_SOURCE_URI = "http://www.ijg.org/files/jpegsrc.v#{LIBJPEG_VERSION}.tar.gz"
31
32 LIBJPEG_VERSION = ENV['LIBJPEG_VERSION'] || '2.0.4'
33 LIBJPEG_SOURCE_URI = "https://downloads.sourceforge.net/libjpeg-turbo/libjpeg-turbo-#{LIBJPEG_VERSION}.tar.gz"
34
35 LIBTIFF_VERSION = ENV['LIBTIFF_VERSION'] || '4.1.0'
9736 LIBTIFF_SOURCE_URI = "http://download.osgeo.org/libtiff/tiff-#{LIBTIFF_VERSION}.tar.gz"
9837
99 LIBFOX_VERSION = ENV['LIBFOX_VERSION'] || '1.6.49'
100 LIBFOX_SOURCE_URI = "http://ftp.fox-toolkit.org/pub/fox-#{LIBFOX_VERSION}.tar.gz"
38 LIBFOX_VERSION = ENV['LIBFOX_VERSION'] || '1.6.57'
39 LIBFOX_SOURCE_URI = "http://fox-toolkit.org/ftp/fox-#{LIBFOX_VERSION}.tar.gz"
10140
10241 LIBFXSCINTILLA_VERSION = ENV['LIBFXSCINTILLA_VERSION'] || '2.28.0'
10342 LIBFXSCINTILLA_SOURCE_URI = "http://download.savannah.gnu.org/releases/fxscintilla/fxscintilla-#{LIBFXSCINTILLA_VERSION}.tar.gz"
43 # LIBFXSCINTILLA_VERSION = ENV['LIBFXSCINTILLA_VERSION'] || '3.5.2'
44 # LIBFXSCINTILLA_SOURCE_URI = "https://github.com/yetanothergeek/fxscintilla/archive/FXSCINTILLA-#{LIBFXSCINTILLA_VERSION.gsub(".","_")}.tar.gz"
45
46 module BuildRecipeCommons
47 def initialize(name, version, files)
48 super(name, version)
49 self.files = files
50 rootdir = File.expand_path('../../..', __FILE__)
51 self.target = File.join(rootdir, "ports")
52 self.host = RbConfig::CONFIG["host"]
53 self.patch_files = Dir[File.join(rootdir, "patches", self.name, self.version, "*.diff")].sort
54 end
55
56 def port_path
57 "#{target}/#{host}"
58 end
59
60 # When using rake-compiler-dock on Windows, the underlying Virtualbox shared
61 # folders don't support symlinks, but libiconv expects it for a build on
62 # Linux. We work around this limitation by using the temp dir for cooking.
63 def chdir_for_build
64 build_dir = ENV['RCD_HOST_RUBY_PLATFORM'].to_s =~ /mingw|mswin|cygwin/ ? '/tmp' : '.'
65 Dir.chdir(build_dir) do
66 yield
67 end
68 end
69
70 def cook_and_activate
71 checkpoint = File.join(self.target, "#{self.name}-#{self.version}-#{self.host}.installed")
72 unless File.exist?(checkpoint)
73 chdir_for_build do
74 self.cook
75 end
76 FileUtils.touch checkpoint
77 end
78 self.activate
79 self
80 end
81 end
82
83 class BuildRecipe < MiniPortile
84 include BuildRecipeCommons
85
86 def configure_defaults
87 [
88 "--host=#{host}", # build for specific target (host)
89 "--disable-static",
90 "--enable-shared",
91 ]
92 end
93 end
94 class BuildRecipeCMake < MiniPortileCMake
95 include BuildRecipeCommons
96
97 def system_processor
98 case host
99 when /x86_64/ then "amd64"
100 when /i686/ then "x86"
101 else raise "unknown host #{host}"
102 end
103 end
104
105 def configure_defaults
106 [
107 "-DENABLE_STATIC=0",
108 "-DENABLE_SHARED=1",
109 "-DCMAKE_SYSTEM_NAME=Windows",
110 "-DCMAKE_C_COMPILER=#{host}-gcc",
111 "-DCMAKE_CXX_COMPILER=#{host}-g++",
112 "-DCMAKE_SYSTEM_PROCESSOR=#{system_processor}",
113 ]
114 end
115
116 def make_cmd
117 ENV["MAKE"] || "make"
118 end
119 end
104120
105121 def do_rake_compiler_setup
106122 if enable_config("win32-cross")
107 require 'mini_portile'
108
109123 dir_config("installed")
110124
111 libz_recipe = MiniPortile.new("libz", LIBZ_VERSION).tap do |recipe|
112 recipe.files = [LIBZ_SOURCE_URI]
113 recipe.target = portsdir = File.expand_path('../../../ports', __FILE__)
114 # Prefer host_alias over host in order to use i586-mingw32msvc as
115 # correct compiler prefix for cross build, but use host if not set.
116 recipe.host = RbConfig::CONFIG["host_alias"].empty? ? RbConfig::CONFIG["host"] : RbConfig::CONFIG["host_alias"]
125 libz_recipe = BuildRecipe.new("libz", LIBZ_VERSION, [LIBZ_SOURCE_URI]).tap do |recipe|
117126 class << recipe
118127 def configure
119128 Dir.chdir work_path do
143152 end
144153 end
145154
146 checkpoint = File.join(portsdir, "#{recipe.name}-#{recipe.version}-#{recipe.host}.installed")
147 unless File.exist?(checkpoint)
148 recipe.cook
149 FileUtils.touch checkpoint
150 end
151 recipe.activate
152 end
153
154 libpng_recipe = MiniPortile.new("libpng", LIBPNG_VERSION).tap do |recipe|
155 recipe.files = [LIBPNG_SOURCE_URI]
156 recipe.target = portsdir = File.expand_path('../../../ports', __FILE__)
157 # Prefer host_alias over host in order to use i586-mingw32msvc as
158 # correct compiler prefix for cross build, but use host if not set.
159 recipe.host = RbConfig::CONFIG["host_alias"].empty? ? RbConfig::CONFIG["host"] : RbConfig::CONFIG["host_alias"]
160 recipe.configure_options = [
161 "--host=#{recipe.host}",
162 "--enable-shared",
163 "--disable-static",
164 ]
165
166 checkpoint = File.join(portsdir, "#{recipe.name}-#{recipe.version}-#{recipe.host}.installed")
167 unless File.exist?(checkpoint)
168 with_env(
169 'CPPFLAGS' => "-I#{libz_recipe.path}/include",
170 'LDFLAGS' => "-L#{libz_recipe.path}/lib"
171 ) do
172 recipe.cook
173 FileUtils.touch checkpoint
174 end
175 end
176 recipe.activate
177 end
178
179 libjpeg_recipe = MiniPortile.new("libjpeg", LIBJPEG_VERSION).tap do |recipe|
180 recipe.files = [LIBJPEG_SOURCE_URI]
181 recipe.target = portsdir = File.expand_path('../../../ports', __FILE__)
182 # Prefer host_alias over host in order to use i586-mingw32msvc as
183 # correct compiler prefix for cross build, but use host if not set.
184 recipe.host = RbConfig::CONFIG["host_alias"].empty? ? RbConfig::CONFIG["host"] : RbConfig::CONFIG["host_alias"]
185 recipe.configure_options = [
186 "--host=#{recipe.host}",
187 "--enable-shared",
188 "--disable-static",
189 ]
190
191 checkpoint = File.join(portsdir, "#{recipe.name}-#{recipe.version}-#{recipe.host}.installed")
192 unless File.exist?(checkpoint)
193 recipe.cook
194 FileUtils.touch checkpoint
195 end
196 recipe.activate
197 end
198
199 libtiff_recipe = MiniPortile.new("libtiff", LIBTIFF_VERSION).tap do |recipe|
200 recipe.files = [LIBTIFF_SOURCE_URI]
201 recipe.target = portsdir = File.expand_path('../../../ports', __FILE__)
202 # Prefer host_alias over host in order to use i586-mingw32msvc as
203 # correct compiler prefix for cross build, but use host if not set.
204 recipe.host = RbConfig::CONFIG["host_alias"].empty? ? RbConfig::CONFIG["host"] : RbConfig::CONFIG["host_alias"]
205 recipe.configure_options = [
206 "--host=#{recipe.host}",
207 "--enable-shared",
208 "--disable-static",
209 ]
210
211 checkpoint = File.join(portsdir, "#{recipe.name}-#{recipe.version}-#{recipe.host}.installed")
212 unless File.exist?(checkpoint)
213 recipe.cook
214 FileUtils.touch checkpoint
215 end
216 recipe.activate
217 end
218
219 libfox_recipe = MiniPortile.new("libfox", LIBFOX_VERSION).tap do |recipe|
220 recipe.files = [LIBFOX_SOURCE_URI]
221 recipe.target = portsdir = File.expand_path('../../../ports', __FILE__)
222 # Prefer host_alias over host in order to use i586-mingw32msvc as
223 # correct compiler prefix for cross build, but use host if not set.
224 recipe.host = RbConfig::CONFIG["host_alias"].empty? ? RbConfig::CONFIG["host"] : RbConfig::CONFIG["host_alias"]
225 recipe.configure_options = [
226 "--host=#{recipe.host}",
155 recipe.cook_and_activate
156 end
157
158 libpng_recipe = BuildRecipe.new("libpng", LIBPNG_VERSION, [LIBPNG_SOURCE_URI]).tap do |recipe|
159 recipe.configure_options += [
160 "CPPFLAGS=-I#{libz_recipe.path}/include",
161 "LDFLAGS=-L#{libz_recipe.path}/lib",
162 ]
163 recipe.cook_and_activate
164 end
165
166 libjpeg_recipe = BuildRecipeCMake.new("libjpeg", LIBJPEG_VERSION, [LIBJPEG_SOURCE_URI]).tap do |recipe|
167 recipe.cook_and_activate
168 end
169
170 libtiff_recipe = BuildRecipe.new("libtiff", LIBTIFF_VERSION, [LIBTIFF_SOURCE_URI]).tap do |recipe|
171 recipe.cook_and_activate
172 end
173
174 libfox_recipe = BuildRecipe.new("libfox", LIBFOX_VERSION, [LIBFOX_SOURCE_URI]).tap do |recipe|
175 debug = enable_config("debug")
176 recipe.configure_options += [
227177 "--without-xft",
228178 "--without-x",
229 "--enable-shared",
230 "--disable-static",
231 ]
232 class << recipe
233 def compile
234 # Add param -no-undefined to libtool to build a win32 shared lib
235 execute "compile", "#{ENV['MAKE'] || "make"} libFOX_1_6_la_LDFLAGS='-version-info 0:49:0 -export-dynamic -no-undefined'"
236 end
237 end
238
239 checkpoint = File.join(portsdir, "#{recipe.name}-#{recipe.version}-#{recipe.host}.installed")
240 unless File.exist?(checkpoint)
241 with_env(
242 "CPPFLAGS" => "-I#{libjpeg_recipe.path}/include -I#{libpng_recipe.path}/include -I#{libtiff_recipe.path}/include -I#{libz_recipe.path}/include",
243 "LDFLAGS" => "-L#{libjpeg_recipe.path}/lib -L#{libpng_recipe.path}/lib -L#{libtiff_recipe.path}/lib -L#{libz_recipe.path}/lib"
244 ) do
245 recipe.cook
246 FileUtils.touch checkpoint
247 end
248 end
249 recipe.activate
250 end
251
252 libfxscintills_recipe = MiniPortile.new("libfxscintilla", LIBFXSCINTILLA_VERSION).tap do |recipe|
253 recipe.files = [LIBFXSCINTILLA_SOURCE_URI]
254 recipe.target = portsdir = File.expand_path('../../../ports', __FILE__)
255 # Prefer host_alias over host in order to use i586-mingw32msvc as
256 # correct compiler prefix for cross build, but use host if not set.
257 recipe.host = RbConfig::CONFIG["host_alias"].empty? ? RbConfig::CONFIG["host"] : RbConfig::CONFIG["host_alias"]
258 recipe.configure_options = [
259 "--host=#{recipe.host}",
260 "--enable-shared",
261 "--disable-static",
262 ]
179 debug ? "--enable-debug" : "--enable-release",
180 "CPPFLAGS=-I#{libjpeg_recipe.path}/include -I#{libpng_recipe.path}/include -I#{libtiff_recipe.path}/include -I#{libz_recipe.path}/include -DUNICODE=1 #{debug ? "-ggdb" : ""}",
181 "LDFLAGS=-L#{libjpeg_recipe.path}/lib -L#{libpng_recipe.path}/lib -L#{libtiff_recipe.path}/lib -L#{libz_recipe.path}/lib #{debug ? "-ggdb" : ""}",
182 ]
183 recipe.cook_and_activate
184 end
185
186 libfxscintills_recipe = BuildRecipe.new("libfxscintilla", LIBFXSCINTILLA_VERSION, [LIBFXSCINTILLA_SOURCE_URI]).tap do |recipe|
263187 class << recipe
264188 attr_accessor :libfox_path
265189 def mk
266190 "#{ENV['MAKE'] || "make"}"
267191 end
192
193 # # This can be uncommented when fxscintilla is used from the source repository.
194 # def configure
195 # execute "bootstrap", "./bootstrap.sh"
196 # super
197 # end
268198
269199 def compile
270200 execute "compile_lexers", "cd lexers && #{mk}"
279209 end
280210 recipe.libfox_path = libfox_recipe.path
281211
282 checkpoint = File.join(portsdir, "#{recipe.name}-#{recipe.version}-#{recipe.host}.installed")
283 unless File.exist?(checkpoint)
284 recipe.cook
285 FileUtils.touch checkpoint
286 end
287 recipe.activate
288 end
289
290 # have_library( 'gdi32', 'CreateDC' ) && append_library( $libs, 'gdi32' )
291 # have_library( 'opengl32' ) && append_library( $libs, 'opengl32' )
292 # have_library( 'winspool', 'EnumPrintersA') && append_library( $libs, 'winspool' )
293
294 # dir_config('libz', "#{libz_recipe.path}/include", "#{libz_recipe.path}/lib")
295 # dir_config('libpng', "#{libpng_recipe.path}/include", "#{libpng_recipe.path}/lib")
296 # dir_config('libtiff', "#{libtiff_recipe.path}/include", "#{libtiff_recipe.path}/lib")
297 # dir_config('libjpeg', "#{libjpeg_recipe.path}/include", "#{libjpeg_recipe.path}/lib")
298 dir_config('libfox', "#{libfox_recipe.path}/include", "#{libfox_recipe.path}/lib")
299 dir_config('libfxscintilla', "#{libfxscintills_recipe.path}/include", "#{libfxscintills_recipe.path}/lib")
300
301 shared_dlls = [
302 "#{libfxscintills_recipe.path}/bin/libfxscintilla-20.dll",
303 "#{libfox_recipe.path}/bin/libFOX-1.6-0.dll",
304 "#{libjpeg_recipe.path}/bin/libjpeg-8.dll",
305 "#{libpng_recipe.path}/bin/libpng15-15.dll",
306 "#{libtiff_recipe.path}/bin/libtiff-5.dll",
307 "#{libz_recipe.path}/bin/zlib1.dll",
212 recipe.configure_options += [
213 "PKG_CONFIG_PATH=#{libfox_recipe.path}/lib/pkgconfig",
308214 ]
309 shared_dlls.each do |dll|
310 FileUtils.cp dll, '.', verbose: true
311 end
215 recipe.cook_and_activate
216 end
217
218 dir_config('libfox', "#{libfox_recipe.path}/include/fox-1.6", "#{libfox_recipe.path}/lib")
219 dir_config('libfxscintilla', "#{libfxscintills_recipe.path}/include/fxscintilla", "#{libfxscintills_recipe.path}/lib")
312220
313221 gcc_shared_dlls = %w[libwinpthread-1.dll libgcc_s_dw2-1.dll libgcc_s_sjlj-1.dll libgcc_s_seh-1.dll libstdc++-6.dll]
314222 gcc_shared_dlls.each do |dll|
315 cmd = "#{CONFIG['CC']} -print-file-name=#{dll}"
223 cmd = "#{CONFIG['CC']} -print-file-name=\"#{dll}\""
316224 res = `#{cmd}`.chomp
317225 next if dll == res
318226 puts "#{cmd} => #{res}"
319 FileUtils.cp `#{cmd}`.chomp, '.', verbose: true
320 end
321
322 CONFIG['CXX'] = "#{RbConfig::CONFIG["host"]}-g++" # CXX setting must be prefixed for cross build
227 FileUtils.cp `#{cmd}`.chomp, "#{libfox_recipe.path}/bin/", verbose: true
228 end
229
230 CONFIG['CXX'] = "#{libfox_recipe.host}-g++" # CXX setting must be prefixed for cross build
323231 CONFIG['CC'] += "\nCXX=#{CONFIG['CXX']}" # Hack CXX into Makefile for cross compilation
324232 CONFIG['LDSHARED'].gsub!('gcc', 'g++') # ensure C++ linker is used, so that libstdc++ is linked static
325233 $LDFLAGS += " -s" # remove symbol table informations from shared lib
234 $libs = append_library($libs, "fxscintilla")
326235
327236 elsif RUBY_PLATFORM =~ /mingw/
328237 $CFLAGS = $CFLAGS + " -I/usr/local/include"
349258 find_library("GLU", "gluNewQuadric", "/usr/X11R6/lib")
350259 $libs = append_library($libs, "Xrandr") unless RUBY_PLATFORM =~ /mingw/ || enable_config("win32-static-build")
351260 $libs = append_library($libs, "Xcursor") unless RUBY_PLATFORM =~ /mingw/ || enable_config("win32-static-build")
352 find_header('FXRbCommon.h', File.join(File.dirname(__FILE__), 'include'))
353261 $libs = append_library($libs, "FOX-1.6")
262 $INCFLAGS << " -I#{File.join(File.dirname(__FILE__), 'include')}"
354263 if is_fxscintilla_build?
355 FileUtils.move('scintilla_wrap.cpp.bak', 'scintilla_wrap.cpp') if FileTest.exist?('scintilla_wrap.cpp.bak')
356264 $CPPFLAGS = $CPPFLAGS + " -DWITH_FXSCINTILLA -DHAVE_FOX_1_6"
357 $libs = append_library($libs, "fxscintilla")
358 else
359 FileUtils.move('scintilla_wrap.cpp', 'scintilla_wrap.cpp.bak') if FileTest.exist?('scintilla_wrap.cpp')
360 end
265 end
266
267 checking_for("thread local variables") do
268 $defs.push( "-DHAVE___THREAD" ) if try_compile <<-EOT
269 __thread int x=1;
270 #if defined(__MINGW32__)
271 #include <windows.h>
272 #if !defined(__MINGW64_VERSION_MAJOR)
273 #error "Old mingw32 compiler doesn't implement thread local variables properly."
274 #endif
275 #endif
276 EOT
277 end &&
278 have_func('rb_thread_call_without_gvl') &&
279 have_func('rb_thread_call_with_gvl')
280
281 have_func('rb_during_gc')
361282 end
362283
363284 # This directive processes the "--with-fox-include" and "--with-fox-lib"
371292
372293 dir_config('fxscintilla', '/usr/local/include/fxscintilla', '/usr/local/lib')
373294
374 find_installed_fox_version
375
376 #
377 # Check for FXScintilla header files, unless FXScintilla support has
378 # been explicitly suppressed with the '--without-fxscintilla' flag.
379 #
380
381 unless fxscintilla_support_suppressed?
382 find_installed_fxscintilla_version
295 unless enable_config("win32-cross")
296 checking_for "fox per pkg-config" do
297 pkg_config("fox")
298 end
299
300 #
301 # Check for FXScintilla header files, unless FXScintilla support has
302 # been explicitly suppressed with the '--without-fxscintilla' flag.
303 #
304
305 unless fxscintilla_support_suppressed?
306 checking_for "fxscintilla per pkg-config" do
307 $autodetected_fxscintilla = pkg_config("fxscintilla")
308 end
309
310 unless $autodetected_fxscintilla
311 checking_for "fxscintilla on Ubuntu with missing libfxscintilla.so link" do
312 if find_library(":libfxscintilla.so.19", nil) && (cflags = RUBY_VERSION>="2.1" ? pkg_config("fxscintilla", "cflags") : `pkg-config --cflags fxscintilla`)
313 $CXXFLAGS += " " + cflags
314 $autodetected_fxscintilla = true
315 end
316 end
317 end
318 end
319 checking_for "fxscintilla build" do
320 is_fxscintilla_build?
321 end
322 end
323
324 if enable_config("debug")
325 $CPPFLAGS += " -ggdb"
326 $LDFLAGS += " -ggdb"
327 else
328 $CPPFLAGS += " -DNDEBUG"
383329 end
384330
385331 # Platform-specific modifications
386332 do_rake_compiler_setup
387333
388 $CFLAGS += " -DRUBY_1_8" if RUBY_VERSION =~ /1\.8\./
389 $CFLAGS += " -DRUBY_1_9" if RUBY_VERSION =~ /1\.9\./
390 $CFLAGS += " -DRUBY_2_0" if RUBY_VERSION =~ /2\.0\./
334 if RbConfig::MAKEFILE_CONFIG['CC'] =~ /gcc/
335 $CXXFLAGS += " -Wno-unused-function"
336 $CXXFLAGS += " -Wno-maybe-uninitialized"
337 end
391338
392339 # Last step: build the makefile
340 create_header
393341 create_makefile("fox16_c")
0 /*
1 * gvl_wrappers.c - Wrapper functions for locking/unlocking the Ruby GVL
2 *
3 */
4
5 #include "FXRbCommon.h"
6
7 #ifdef HAVE___THREAD
8 __thread int g_fxrb_thread_has_gvl = 1;
9 #endif
10
11 FOR_EACH_BLOCKING_FUNCTION( DEFINE_GVL_WRAPPER_STRUCT );
12 FOR_EACH_BLOCKING_FUNCTION( DEFINE_GVL_SKELETON );
13 FOR_EACH_BLOCKING_FUNCTION( DEFINE_GVL_STUB );
651651 IMPLEMENT_FXTOPWINDOW_STUBS(FXRbMessageBox)
652652 IMPLEMENT_FXDIALOGBOX_STUBS(FXRbMessageBox)
653653
654 /* Start stub implementations for class FXRbObjRegistry */
655
654656 /* Start stub implementations for class FXRbObject */
655657 IMPLEMENT_FXOBJECT_STUBS(FXRbObject)
656658
10231025 IMPLEMENT_FXDRAWABLE_STUBS(FXRbText)
10241026 IMPLEMENT_FXWINDOW_STUBS(FXRbText)
10251027 IMPLEMENT_FXSCROLLAREA_STUBS(FXRbText)
1026 IMPLEMENT_FXTEXT_STUBS(FXRbText)
1028 IMPLEMENT_FXTEXT_STUBS(FXRbText,FXText)
10271029
10281030 /* Start stub implementations for class FXRbTextField */
10291031 IMPLEMENT_FXOBJECT_STUBS(FXRbTextField)
3737 inline void cls ## _create(cls *self){ \
3838 self->cls::create(); \
3939 } \
40 inline FXint cls ## _run_gvl(cls *self){ \
41 return self->cls::run(); \
42 } \
43 inline FXint cls ## _runOneEvent_gvl(cls *self, bool blocking=true){ \
44 return self->cls::runOneEvent(blocking); \
45 } \
46 inline FXint cls ## _runUntil_gvl(cls *self, FXuint& condition){ \
47 return self->cls::runUntil(condition); \
48 } \
49 inline FXint cls ## _runWhileEvents_gvl(cls *self){ \
50 return self->cls::runWhileEvents(); \
51 } \
52 inline FXint cls ## _runModalWhileEvents_gvl(cls *self, FXWindow* window=NULL){ \
53 return self->cls::runModalWhileEvents(window); \
54 } \
55 inline FXint cls ## _runModal_gvl(cls *self){ \
56 return self->cls::runModal(); \
57 } \
58 inline FXint cls ## _runModalFor_gvl(cls *self, FXWindow* window){ \
59 return self->cls::runModalFor(window); \
60 } \
61 inline FXint cls ## _runModalWhileShown_gvl(cls *self, FXWindow* window){ \
62 return self->cls::runModalWhileShown(window); \
63 } \
64 inline FXint cls ## _runPopup_gvl(cls *self, FXWindow* owner){ \
65 return self->cls::runPopup(owner); \
66 } \
4067 static void cls ## _init(cls* self,VALUE ary,bool connect){ \
4168 int i; \
4269 char **argv; \
4572 argv[0]=const_cast<char *>("foo"); \
4673 for(i=1;i<argc;i++){ \
4774 VALUE e=rb_ary_entry(ary,i-1); \
48 argv[i]=StringValuePtr(e); \
75 argv[i]=StringValueCStr(e); \
4976 } \
5077 argv[argc]=0; \
5178 self->cls::init(argc,argv,connect); \
6087 inline void cls ## _exit(cls *self,FXint code){ \
6188 self->cls::exit(code); \
6289 }
63
6490
6591 /**
6692 * For C/C++ applications, the argument count (argc) will always be at least
82108 */
83109 #define IMPLEMENT_FXAPP_STUBS(cls) \
84110 void cls::create(){ \
85 FXRbCallVoidMethod(this,rb_intern("create")); \
111 FXRbCallVoidMethod(this,"create"); \
86112 } \
87113 void cls::detach(){ \
88 FXRbCallVoidMethod(this,rb_intern("detach")); \
114 FXRbCallVoidMethod(this,"detach"); \
89115 } \
90116 void cls::destroy(){ \
91 FXRbCallVoidMethod(this,rb_intern("destroy")); \
117 FXRbCallVoidMethod(this,"destroy"); \
92118 } \
93119 void cls::init(int& argc,char** argv,bool connect){ \
94120 int i; \
96122 for(i=1; i<argc; i++){ \
97123 rb_ary_push(ary,rb_str_new2(argv[i])); \
98124 } \
99 FXRbCallVoidMethod(this,rb_intern("init"),ary,connect); \
125 FXRbCallVoidMethod(this,"init",ary,connect); \
100126 argc=static_cast<int>(RARRAY_LEN(ary)+1); \
101127 for(i=1; i<argc; i++){ \
102128 VALUE e=rb_ary_entry(ary,i-1); \
103 argv[i]=StringValuePtr(e); \
129 argv[i]=StringValueCStr(e); \
104130 } \
105131 } \
106132 void cls::exit(FXint code){ \
107 FXRbCallVoidMethod(this,rb_intern("exit"),code); \
133 FXRbCallVoidMethod(this,"exit",code); \
108134 }
109135
110136
113139 protected:
114140 FXbool m_bThreadsEnabled;
115141 FXuint sleepTime;
142 public:
143 #ifdef WIN32
144 static WSAEVENT interrupt_event;
145 #else
146 static int interrupt_fds[2];
147 #endif
116148 protected:
117149 FXRbApp(){}
118150 public:
125157 };
126158 public:
127159 long onChoreThreads(FXObject*,FXSelector,void*);
160 long onChoreThreads_gvlcb(FXObject*,FXSelector,void*);
128161 public:
129162 // Constructor
130163 FXRbApp(const FXchar* name,const FXchar* vendor);
151184 virtual ~FXRbApp();
152185 };
153186
187 long FXRbApp_onChoreThreads_gvlcb(FXRbApp*,FXObject*,FXSelector,void*);
188
154189 #endif
6767
6868 #define IMPLEMENT_FXBITMAP_STUBS(cls) \
6969 void cls::restore(){ \
70 FXRbCallVoidMethod(this,rb_intern("restore")); \
70 FXRbCallVoidMethod(this,"restore"); \
7171 } \
7272 void cls::render(){ \
73 FXRbCallVoidMethod(this,rb_intern("render")); \
73 FXRbCallVoidMethod(this,"render"); \
7474 } \
7575 void cls::release(){ \
76 FXRbCallVoidMethod(this,rb_intern("release")); \
76 FXRbCallVoidMethod(this,"release"); \
7777 } \
7878 bool cls::savePixels(FXStream& store) const { \
79 return FXRbCallBoolMethod(this,rb_intern("savePixels"),store); \
79 return FXRbCallBoolMethod(this,"savePixels",store); \
8080 } \
8181 bool cls::loadPixels(FXStream& store){ \
82 return FXRbCallBoolMethod(this,rb_intern("loadPixels"),store); \
82 return FXRbCallBoolMethod(this,"loadPixels",store); \
8383 } \
8484 void cls::scale(FXint w,FXint h){ \
85 FXRbCallVoidMethod(this,rb_intern("scale"),w,h); \
85 FXRbCallVoidMethod(this,"scale",w,h); \
8686 } \
8787 void cls::mirror(FXbool horizontal,FXbool vertical){ \
88 FXRbCallVoidMethod(this,rb_intern("mirror"),horizontal,vertical); \
88 FXRbCallVoidMethod(this,"mirror",horizontal,vertical); \
8989 } \
9090 void cls::rotate(FXint degrees){ \
91 FXRbCallVoidMethod(this,rb_intern("rotate"),degrees); \
91 FXRbCallVoidMethod(this,"rotate",degrees); \
9292 } \
9393 void cls::crop(FXint x,FXint y,FXint w,FXint h,FXbool color){ \
94 FXRbCallVoidMethod(this,rb_intern("crop"),x,y,w,h,color); \
94 FXRbCallVoidMethod(this,"crop",x,y,w,h,color); \
9595 } \
9696 void cls::fill(FXbool color){ \
97 FXRbCallVoidMethod(this,rb_intern("fill"),color); \
97 FXRbCallVoidMethod(this,"fill",color); \
9898 } \
9999 void cls::setData(FXuchar* pix,FXuint opts){ \
100 FXRbCallVoidMethod(this,rb_intern("setData"),pix,opts); \
100 FXRbCallVoidMethod(this,"setData",pix,opts); \
101101 } \
102102 void cls::setData(FXuchar* pix,FXuint opts,FXint w,FXint h){ \
103 FXRbCallVoidMethod(this,rb_intern("setData"),pix,opts,w,h); \
103 FXRbCallVoidMethod(this,"setData",pix,opts,w,h); \
104104 }
105105
106106
2323 * $Id: FXRbCommon.h 2303 2005-12-09 03:17:28Z lyle $
2424 ***********************************************************************/
2525
26 extern "C" {
2726 #include "ruby.h"
27
28 #include "extconf.h"
2829
2930 #ifdef HAVE_RUBY_ENCODING_H
3031 #include "ruby/encoding.h"
3132 #endif
32 }
3333
3434 /**
3535 * The Ruby header files for Win32 redefine the symbol "select", which
9696 #include "FXScintilla.h"
9797 #endif
9898 #include "FXRuby.h"
99 #include "gvl_wrappers.h"
3737
3838 #define IMPLEMENT_FXCURSOR_STUBS(cls) \
3939 bool cls::savePixels(FXStream& store) const { \
40 return FXRbCallBoolMethod(this,rb_intern("savePixels"),store); \
40 return FXRbCallBoolMethod(this,"savePixels",store); \
4141 } \
4242 bool cls::loadPixels(FXStream& store){ \
43 return FXRbCallBoolMethod(this,rb_intern("loadPixels"),store); \
43 return FXRbCallBoolMethod(this,"loadPixels",store); \
4444 }
4545
4646 class FXRbCursor : public FXCursor {
217217
218218 #define IMPLEMENT_FXDC_STUBS(cls) \
219219 FXColor cls::readPixel(FXint x,FXint y){ \
220 return FXRbCallColorMethod(this,rb_intern("readPixel"),x,y); \
220 return FXRbCallColorMethod(this,"readPixel",x,y); \
221221 } \
222222 void cls::drawPoint(FXint x,FXint y){ \
223 FXRbCallVoidMethod(this,rb_intern("drawPoint"),x,y); \
223 FXRbCallVoidMethod(this,"drawPoint",x,y); \
224224 } \
225225 void cls::drawPoints(const FXPoint* points,FXuint npoints){ \
226 rb_funcall(FXRbGetRubyObj(this,false),rb_intern("drawPoints"),1,FXRbMakeArray(points,npoints)); \
226 FXRbCallVoidArrayMethod(this,"drawPoints",points,npoints); \
227227 } \
228228 void cls::drawPointsRel(const FXPoint* points,FXuint npoints){ \
229 rb_funcall(FXRbGetRubyObj(this,false),rb_intern("drawPointsRel"),1,FXRbMakeArray(points,npoints)); \
229 FXRbCallVoidArrayMethod(this,"drawPointsRel",points,npoints); \
230230 } \
231231 void cls::drawLine(FXint x1,FXint y1,FXint x2,FXint y2){ \
232 FXRbCallVoidMethod(this,rb_intern("drawLine"),x1,y1,x2,y2); \
232 FXRbCallVoidMethod(this,"drawLine",x1,y1,x2,y2); \
233233 } \
234234 void cls::drawLines(const FXPoint* points,FXuint npoints){ \
235 rb_funcall(FXRbGetRubyObj(this,false),rb_intern("drawLines"),1,FXRbMakeArray(points,npoints)); \
235 FXRbCallVoidArrayMethod(this,"drawLines",points,npoints); \
236236 } \
237237 void cls::drawLinesRel(const FXPoint* points,FXuint npoints){ \
238 rb_funcall(FXRbGetRubyObj(this,false),rb_intern("drawLinesRel"),1,FXRbMakeArray(points,npoints)); \
238 FXRbCallVoidArrayMethod(this,"drawLinesRel",points,npoints); \
239239 } \
240240 void cls::drawLineSegments(const FXSegment* segments,FXuint nsegments){ \
241 rb_funcall(FXRbGetRubyObj(this,false),rb_intern("drawLineSegments"),1,FXRbMakeArray(segments,nsegments)); \
241 FXRbCallVoidArrayMethod(this,"drawLineSegments",segments,nsegments); \
242242 } \
243243 void cls::drawRectangle(FXint x,FXint y,FXint w,FXint h){ \
244 FXRbCallVoidMethod(this,rb_intern("drawRectangle"),x,y,w,h); \
244 FXRbCallVoidMethod(this,"drawRectangle",x,y,w,h); \
245245 } \
246246 void cls::drawRoundRectangle(FXint x,FXint y,FXint w,FXint h,FXint ew,FXint eh){ \
247 FXRbCallVoidMethod(this,rb_intern("drawRoundRectangle"),x,y,w,h,ew,eh); \
247 FXRbCallVoidMethod(this,"drawRoundRectangle",x,y,w,h,ew,eh); \
248248 } \
249249 void cls::drawRectangles(const FXRectangle* rectangles,FXuint nrectangles){ \
250 rb_funcall(FXRbGetRubyObj(this,false),rb_intern("drawRectangles"),1,FXRbMakeArray(rectangles,nrectangles)); \
250 FXRbCallVoidArrayMethod(this,"drawRectangles",rectangles,nrectangles); \
251251 } \
252252 void cls::drawArc(FXint x,FXint y,FXint w,FXint h,FXint ang1,FXint ang2){ \
253 FXRbCallVoidMethod(this,rb_intern("drawArc"),x,y,w,h,ang1,ang2); \
253 FXRbCallVoidMethod(this,"drawArc",x,y,w,h,ang1,ang2); \
254254 } \
255255 void cls::drawArcs(const FXArc* arcs,FXuint narcs){ \
256 rb_funcall(FXRbGetRubyObj(this,false),rb_intern("drawArcs"),1,FXRbMakeArray(arcs,narcs)); \
256 FXRbCallVoidArrayMethod(this,"drawArcs",arcs,narcs); \
257257 } \
258258 void cls::drawEllipse(FXint x,FXint y,FXint w,FXint h){ \
259 FXRbCallVoidMethod(this,rb_intern("drawEllipse"),x,y,w,h); \
259 FXRbCallVoidMethod(this,"drawEllipse",x,y,w,h); \
260260 } \
261261 void cls::fillRectangle(FXint x,FXint y,FXint w,FXint h){ \
262 FXRbCallVoidMethod(this,rb_intern("fillRectangle"),x,y,w,h); \
262 FXRbCallVoidMethod(this,"fillRectangle",x,y,w,h); \
263263 } \
264264 void cls::fillRectangles(const FXRectangle* rectangles,FXuint nrectangles){ \
265 rb_funcall(FXRbGetRubyObj(this,false),rb_intern("fillRectangles"),1,FXRbMakeArray(rectangles,nrectangles)); \
265 FXRbCallVoidArrayMethod(this,"fillRectangles",rectangles,nrectangles); \
266266 } \
267267 void cls::fillRoundRectangle(FXint x,FXint y,FXint w,FXint h,FXint ew,FXint eh){ \
268 FXRbCallVoidMethod(this,rb_intern("fillRoundRectangle"),x,y,w,h,ew,eh); \
268 FXRbCallVoidMethod(this,"fillRoundRectangle",x,y,w,h,ew,eh); \
269269 } \
270270 void cls::fillChord(FXint x,FXint y,FXint w,FXint h,FXint ang1,FXint ang2){ \
271 FXRbCallVoidMethod(this,rb_intern("fillChord"),x,y,w,h,ang1,ang2); \
271 FXRbCallVoidMethod(this,"fillChord",x,y,w,h,ang1,ang2); \
272272 } \
273273 void cls::fillChords(const FXArc* chords,FXuint nchords){ \
274 rb_funcall(FXRbGetRubyObj(this,false),rb_intern("fillChords"),1,FXRbMakeArray(chords,nchords)); \
274 FXRbCallVoidArrayMethod(this,"fillChords",chords,nchords); \
275275 } \
276276 void cls::fillArc(FXint x,FXint y,FXint w,FXint h,FXint ang1,FXint ang2){ \
277 FXRbCallVoidMethod(this,rb_intern("fillArc"),x,y,w,h,ang1,ang2); \
277 FXRbCallVoidMethod(this,"fillArc",x,y,w,h,ang1,ang2); \
278278 } \
279279 void cls::fillArcs(const FXArc* arcs,FXuint narcs){ \
280 rb_funcall(FXRbGetRubyObj(this,false),rb_intern("fillArcs"),1,FXRbMakeArray(arcs,narcs)); \
280 FXRbCallVoidArrayMethod(this,"fillArcs",arcs,narcs); \
281281 } \
282282 void cls::fillEllipse(FXint x,FXint y,FXint w,FXint h){ \
283 FXRbCallVoidMethod(this,rb_intern("fillEllipse"),x,y,w,h); \
283 FXRbCallVoidMethod(this,"fillEllipse",x,y,w,h); \
284284 } \
285285 void cls::fillPolygon(const FXPoint* points,FXuint npoints){ \
286 rb_funcall(FXRbGetRubyObj(this,false),rb_intern("fillPolygon"),1,FXRbMakeArray(points,npoints)); \
286 FXRbCallVoidArrayMethod(this,"fillPolygon",points,npoints); \
287287 } \
288288 void cls::fillConcavePolygon(const FXPoint* points,FXuint npoints){ \
289 rb_funcall(FXRbGetRubyObj(this,false),rb_intern("fillConcavePolygon"),1,FXRbMakeArray(points,npoints)); \
289 FXRbCallVoidArrayMethod(this,"fillConcavePolygon",points,npoints); \
290290 } \
291291 void cls::fillComplexPolygon(const FXPoint* points,FXuint npoints){ \
292 rb_funcall(FXRbGetRubyObj(this,false),rb_intern("fillComplexPolygon"),1,FXRbMakeArray(points,npoints)); \
292 FXRbCallVoidArrayMethod(this,"fillComplexPolygon",points,npoints); \
293293 } \
294294 void cls::fillPolygonRel(const FXPoint* points,FXuint npoints){ \
295 rb_funcall(FXRbGetRubyObj(this,false),rb_intern("fillPolygonRel"),1,FXRbMakeArray(points,npoints)); \
295 FXRbCallVoidArrayMethod(this,"fillPolygonRel",points,npoints); \
296296 } \
297297 void cls::fillConcavePolygonRel(const FXPoint* points,FXuint npoints){ \
298 rb_funcall(FXRbGetRubyObj(this,false),rb_intern("fillConcavePolygonRel"),1,FXRbMakeArray(points,npoints)); \
298 FXRbCallVoidArrayMethod(this,"fillConcavePolygonRel",points,npoints); \
299299 } \
300300 void cls::fillComplexPolygonRel(const FXPoint* points,FXuint npoints){ \
301 rb_funcall(FXRbGetRubyObj(this,false),rb_intern("fillComplexPolygonRel"),1,FXRbMakeArray(points,npoints)); \
301 FXRbCallVoidArrayMethod(this,"fillComplexPolygonRel",points,npoints); \
302302 } \
303303 void cls::drawHashBox(FXint x,FXint y,FXint w,FXint h,FXint b){ \
304 FXRbCallVoidMethod(this,rb_intern("drawHashBox"),x,y,w,h,b); \
304 FXRbCallVoidMethod(this,"drawHashBox",x,y,w,h,b); \
305305 } \
306306 void cls::drawFocusRectangle(FXint x,FXint y,FXint w,FXint h){ \
307 FXRbCallVoidMethod(this,rb_intern("drawFocusRectangle"),x,y,w,h); \
307 FXRbCallVoidMethod(this,"drawFocusRectangle",x,y,w,h); \
308308 } \
309309 void cls::drawArea(const FXDrawable* source,FXint sx,FXint sy,FXint sw,FXint sh,FXint dx,FXint dy){ \
310 FXRbCallVoidMethod(this,rb_intern("drawArea"),source,sx,sy,sw,sh,dx,dy); \
310 FXRbCallVoidMethod(this,"drawArea",source,sx,sy,sw,sh,dx,dy); \
311311 } \
312312 void cls::drawArea(const FXDrawable* source,FXint sx,FXint sy,FXint sw,FXint sh,FXint dx,FXint dy,FXint dw,FXint dh){ \
313 FXRbCallVoidMethod(this,rb_intern("drawArea"),source,sx,sy,sw,sh,dx,dy,dw,dh); \
313 FXRbCallVoidMethod(this,"drawArea",source,sx,sy,sw,sh,dx,dy,dw,dh); \
314314 } \
315315 void cls::drawImage(const FXImage* image,FXint dx,FXint dy){ \
316 FXRbCallVoidMethod(this,rb_intern("drawImage"),image,dx,dy); \
316 FXRbCallVoidMethod(this,"drawImage",image,dx,dy); \
317317 } \
318318 void cls::drawBitmap(const FXBitmap* bitmap,FXint dx,FXint dy){ \
319 FXRbCallVoidMethod(this,rb_intern("drawBitmap"),bitmap,dx,dy); \
319 FXRbCallVoidMethod(this,"drawBitmap",bitmap,dx,dy); \
320320 } \
321321 void cls::drawIcon(const FXIcon* icon,FXint dx,FXint dy){ \
322 FXRbCallVoidMethod(this,rb_intern("drawIcon"),icon,dx,dy); \
322 FXRbCallVoidMethod(this,"drawIcon",icon,dx,dy); \
323323 } \
324324 void cls::drawIconShaded(const FXIcon* icon,FXint dx,FXint dy){ \
325 FXRbCallVoidMethod(this,rb_intern("drawIconShaded"),icon,dx,dy); \
325 FXRbCallVoidMethod(this,"drawIconShaded",icon,dx,dy); \
326326 } \
327327 void cls::drawIconSunken(const FXIcon* icon,FXint dx,FXint dy){ \
328 FXRbCallVoidMethod(this,rb_intern("drawIconSunken"),icon,dx,dy); \
328 FXRbCallVoidMethod(this,"drawIconSunken",icon,dx,dy); \
329329 } \
330330 void cls::drawText(FXint x,FXint y,const FXString& string){ \
331 rb_funcall(FXRbGetRubyObj(this,false),rb_intern("drawText"),3,to_ruby(x),to_ruby(y),to_ruby(string)); \
331 FXRbCallDCDrawMethod(this, "drawText", x, y, string); \
332332 } \
333333 void cls::drawText(FXint x,FXint y,const FXchar* string,FXuint length){ \
334 rb_funcall(FXRbGetRubyObj(this,false),rb_intern("drawText"),3,to_ruby(x),to_ruby(y),to_ruby(string,length)); \
334 FXRbCallDCDrawMethod(this, "drawText", x, y, string, length); \
335335 } \
336336 void cls::drawImageText(FXint x,FXint y,const FXString& string){ \
337 rb_funcall(FXRbGetRubyObj(this,false),rb_intern("drawImageText"),3,to_ruby(x),to_ruby(y),to_ruby(string)); \
337 FXRbCallDCDrawMethod(this, "drawImageText", x, y, string); \
338338 } \
339339 void cls::drawImageText(FXint x,FXint y,const FXchar* string,FXuint length){ \
340 rb_funcall(FXRbGetRubyObj(this,false),rb_intern("drawImageText"),3,to_ruby(x),to_ruby(y),to_ruby(string,length)); \
340 FXRbCallDCDrawMethod(this, "drawImageText", x, y, string, length); \
341341 } \
342342 void cls::setForeground(FXColor clr){ \
343 FXRbCallVoidMethod(this,rb_intern("setForeground"),clr); \
343 FXRbCallVoidMethod(this,"setForeground",clr); \
344344 } \
345345 void cls::setBackground(FXColor clr){ \
346 FXRbCallVoidMethod(this,rb_intern("setBackground"),clr); \
346 FXRbCallVoidMethod(this,"setBackground",clr); \
347347 } \
348348 void cls::setDashes(FXuint dashoffset,const FXchar *dashpattern,FXuint dashlength){ \
349 rb_funcall(FXRbGetRubyObj(this,false),rb_intern("setDashes"),2,to_ruby(dashoffset),FXRbMakeArray(dashpattern,dashlength)); \
349 FXRbCallSetDashes(this,"setDashes",dashoffset,dashpattern,dashlength); \
350350 } \
351351 void cls::setLineWidth(FXuint linewidth){ \
352 FXRbCallVoidMethod(this,rb_intern("setLineWidth"),linewidth); \
352 FXRbCallVoidMethod(this,"setLineWidth",linewidth); \
353353 } \
354354 void cls::setLineCap(FXCapStyle capstyle){ \
355 FXRbCallVoidMethod(this,rb_intern("setLineCap"),capstyle); \
355 FXRbCallVoidMethod(this,"setLineCap",capstyle); \
356356 } \
357357 void cls::setLineJoin(FXJoinStyle joinstyle){ \
358 FXRbCallVoidMethod(this,rb_intern("setLineJoin"),joinstyle); \
358 FXRbCallVoidMethod(this,"setLineJoin",joinstyle); \
359359 } \
360360 void cls::setLineStyle(FXLineStyle linestyle){ \
361 FXRbCallVoidMethod(this,rb_intern("setLineStyle"),linestyle); \
361 FXRbCallVoidMethod(this,"setLineStyle",linestyle); \
362362 } \
363363 void cls::setFillStyle(FXFillStyle fillstyle){ \
364 FXRbCallVoidMethod(this,rb_intern("setFillStyle"),fillstyle); \
364 FXRbCallVoidMethod(this,"setFillStyle",fillstyle); \
365365 } \
366366 void cls::setFillRule(FXFillRule fillrule){ \
367 FXRbCallVoidMethod(this,rb_intern("setFillRule"),fillrule); \
367 FXRbCallVoidMethod(this,"setFillRule",fillrule); \
368368 } \
369369 void cls::setFunction(FXFunction func){ \
370 FXRbCallVoidMethod(this,rb_intern("setFunction"),func); \
370 FXRbCallVoidMethod(this,"setFunction",func); \
371371 } \
372372 void cls::setTile(FXImage* image,FXint dx,FXint dy){ \
373 FXRbCallVoidMethod(this,rb_intern("setTile"),image,dx,dy); \
373 FXRbCallVoidMethod(this,"setTile",image,dx,dy); \
374374 } \
375375 void cls::setStipple(FXBitmap *bitmap,FXint dx,FXint dy){ \
376 FXRbCallVoidMethod(this,rb_intern("setStipple"),bitmap,dx,dy); \
376 FXRbCallVoidMethod(this,"setStipple",bitmap,dx,dy); \
377377 } \
378378 void cls::setStipple(FXStipplePattern pat,FXint dx,FXint dy){ \
379 FXRbCallVoidMethod(this,rb_intern("setStipple"),pat,dx,dy); \
379 FXRbCallVoidMethod(this,"setStipple",pat,dx,dy); \
380380 } \
381381 void cls::setClipRegion(const FXRegion& region){ \
382 FXRbCallVoidMethod(this,rb_intern("setClipRegion"),region); \
382 FXRbCallVoidMethod(this,"setClipRegion",region); \
383383 } \
384384 void cls::setClipRectangle(FXint x,FXint y,FXint w,FXint h){ \
385 FXRbCallVoidMethod(this,rb_intern("setClipRectangle"),x,y,w,h); \
385 FXRbCallVoidMethod(this,"setClipRectangle",x,y,w,h); \
386386 } \
387387 void cls::setClipRectangle(const FXRectangle& rectangle){ \
388 FXRbCallVoidMethod(this,rb_intern("setClipRectangle"),rectangle); \
388 FXRbCallVoidMethod(this,"setClipRectangle",rectangle); \
389389 } \
390390 void cls::clearClipRectangle(){ \
391 FXRbCallVoidMethod(this,rb_intern("clearClipRectangle")); \
391 FXRbCallVoidMethod(this,"clearClipRectangle"); \
392392 } \
393393 void cls::setClipMask(FXBitmap* bitmap,FXint dx,FXint dy){ \
394 FXRbCallVoidMethod(this,rb_intern("setClipMask"),bitmap,dx,dy); \
394 FXRbCallVoidMethod(this,"setClipMask",bitmap,dx,dy); \
395395 } \
396396 void cls::clearClipMask(){ \
397 FXRbCallVoidMethod(this,rb_intern("clearClipMask")); \
397 FXRbCallVoidMethod(this,"clearClipMask"); \
398398 } \
399399 void cls::setFont(FXFont *fnt){ \
400 FXRbCallVoidMethod(this,rb_intern("setFont"),fnt); \
400 FXRbCallVoidMethod(this,"setFont",fnt); \
401401 } \
402402 void cls::clipChildren(FXbool yes){ \
403 FXRbCallVoidMethod(this,rb_intern("clipChildren"),yes); \
403 FXRbCallVoidMethod(this,"clipChildren",yes); \
404404 }
405405
406406
2727 #define FXRBDIALOGBOX_H
2828
2929 #define DECLARE_FXDIALOGBOX_STUBS(klass) \
30 inline FXuint klass ## _execute(klass* self,FXuint placement){ \
30 inline FXuint klass ## _execute_gvl(klass* self,FXuint placement){ \
3131 return self->klass::execute(placement); \
3232 }
3333
3434
3535 #define IMPLEMENT_FXDIALOGBOX_STUBS(cls) \
3636 FXuint cls::execute(FXuint placement){ \
37 return FXRbCallUIntMethod(this,rb_intern("execute"),placement); \
37 return FXRbCallUIntMethod(this,"execute",placement); \
3838 }
3939
4040
3939
4040 #define IMPLEMENT_FXDOCKBAR_STUBS(cls) \
4141 void cls::dock(FXDockSite* docksite,FXWindow* before,FXbool notify){ \
42 FXRbCallVoidMethod(this,rb_intern("dock"),docksite,before,notify); \
42 FXRbCallVoidMethod(this,"dock",docksite,before,notify); \
4343 } \
4444 void cls::dock(FXDockSite* docksite,FXint localx,FXint localy,FXbool notify){ \
45 FXRbCallVoidMethod(this,rb_intern("dock"),docksite,localx,localy,notify); \
45 FXRbCallVoidMethod(this,"dock",docksite,localx,localy,notify); \
4646 } \
4747 void cls::undock(FXint rootx,FXint rooty, FXbool notify){ \
48 FXRbCallVoidMethod(this,rb_intern("undock"),rootx,rooty,notify); \
48 FXRbCallVoidMethod(this,"undock",rootx,rooty,notify); \
4949 }
5050
5151
4242
4343 #define IMPLEMENT_FXDOCKSITE_STUBS(cls) \
4444 void cls::moveToolBar(FXDockBar* bar,FXint barx,FXint bary){ \
45 FXRbCallVoidMethod(this,rb_intern("moveToolBar"),bar,barx,bary); \
45 FXRbCallVoidMethod(this,"moveToolBar",bar,barx,bary); \
4646 } \
4747 void cls::dockToolBar(FXDockBar* bar,FXWindow* before){ \
48 FXRbCallVoidMethod(this,rb_intern("dockToolBar"),bar,before); \
48 FXRbCallVoidMethod(this,"dockToolBar",bar,before); \
4949 } \
5050 void cls::dockToolBar(FXDockBar* bar,FXint barx,FXint bary){ \
51 FXRbCallVoidMethod(this,rb_intern("dockToolBar"),bar,barx,bary); \
51 FXRbCallVoidMethod(this,"dockToolBar",bar,barx,bary); \
5252 } \
5353 void cls::undockToolBar(FXDockBar* bar){ \
54 FXRbCallVoidMethod(this,rb_intern("undockToolBar"),bar); \
54 FXRbCallVoidMethod(this,"undockToolBar",bar); \
5555 }
5656
5757
3434
3535 #define IMPLEMENT_FXDRAWABLE_STUBS(cls) \
3636 void cls::resize(FXint w,FXint h){ \
37 FXRbCallVoidMethod(this,rb_intern("resize"),w,h); \
37 FXRbCallVoidMethod(this, "resize", w, h); \
3838 }
3939
4040
6060
6161 #define IMPLEMENT_FXFILEDICT_STUBS(cls) \
6262 FXFileAssoc* cls::findFileBinding(const FXchar* pathname){ \
63 return FXRbCallFileAssocMethod(this,rb_intern("findFileBinding"),pathname); \
63 return FXRbCallFileAssocMethod(this,"findFileBinding",pathname); \
6464 } \
6565 FXFileAssoc* cls::findDirBinding(const FXchar* pathname){ \
66 return FXRbCallFileAssocMethod(this,rb_intern("findDirBinding"),pathname); \
66 return FXRbCallFileAssocMethod(this,"findDirBinding",pathname); \
6767 } \
6868 FXFileAssoc* cls::findExecBinding(const FXchar* pathname){ \
69 return FXRbCallFileAssocMethod(this,rb_intern("findExecBinding"),pathname); \
69 return FXRbCallFileAssocMethod(this,"findExecBinding",pathname); \
7070 }
7171
7272
7373
7474 #define IMPLEMENT_FXFOLDINGITEM_STUBS(cls) \
7575 void cls::setText(const FXString& txt){ \
76 FXRbCallVoidMethod(this,rb_intern("setText"),txt); \
76 FXRbCallVoidMethod(this,"setText",txt); \
7777 } \
7878 void cls::setOpenIcon(FXIcon* icn,FXbool owned){ \
79 FXRbCallVoidMethod(this,rb_intern("setOpenIcon"),icn,owned); \
79 FXRbCallVoidMethod(this,"setOpenIcon",icn,owned); \
8080 } \
8181 void cls::setClosedIcon(FXIcon* icn,FXbool owned){ \
82 FXRbCallVoidMethod(this,rb_intern("setClosedIcon"),icn,owned); \
82 FXRbCallVoidMethod(this,"setClosedIcon",icn,owned); \
8383 } \
8484 void cls::setFocus(FXbool focus){ \
85 FXRbCallVoidMethod(this,rb_intern("setFocus"),focus); \
85 FXRbCallVoidMethod(this,"setFocus",focus); \
8686 } \
8787 void cls::setSelected(FXbool selected){ \
88 FXRbCallVoidMethod(this,rb_intern("setSelected"),selected); \
88 FXRbCallVoidMethod(this,"setSelected",selected); \
8989 } \
9090 void cls::setOpened(FXbool opened){ \
91 FXRbCallVoidMethod(this,rb_intern("setOpened"),opened); \
91 FXRbCallVoidMethod(this,"setOpened",opened); \
9292 } \
9393 void cls::setExpanded(FXbool expanded){ \
94 FXRbCallVoidMethod(this,rb_intern("setExpanded"),expanded); \
94 FXRbCallVoidMethod(this,"setExpanded",expanded); \
9595 } \
9696 void cls::setEnabled(FXbool enabled){ \
97 FXRbCallVoidMethod(this,rb_intern("setEnabled"),enabled); \
97 FXRbCallVoidMethod(this,"setEnabled",enabled); \
9898 } \
9999 void cls::setDraggable(FXbool draggable){ \
100 FXRbCallVoidMethod(this,rb_intern("setDraggable"),draggable); \
100 FXRbCallVoidMethod(this,"setDraggable",draggable); \
101101 } \
102102 FXint cls::getWidth(const FXFoldingList* list) const { \
103 return FXRbCallIntMethod(this,rb_intern("getWidth"),list); \
103 return FXRbCallIntMethod(this,"getWidth",list); \
104104 } \
105105 FXint cls::getHeight(const FXFoldingList* list) const { \
106 return FXRbCallIntMethod(this,rb_intern("getHeight"),list); \
106 return FXRbCallIntMethod(this,"getHeight",list); \
107107 } \
108108 void cls::create(){ \
109 FXRbCallVoidMethod(this,rb_intern("create")); \
109 FXRbCallVoidMethod(this,"create"); \
110110 } \
111111 void cls::detach(){ \
112 FXRbCallVoidMethod(this,rb_intern("detach")); \
112 FXRbCallVoidMethod(this,"detach"); \
113113 } \
114114 void cls::destroy(){ \
115 FXRbCallVoidMethod(this,rb_intern("destroy")); \
115 FXRbCallVoidMethod(this,"destroy"); \
116116 }
117117
118118
188188
189189 #define IMPLEMENT_FXFOLDINGLIST_STUBS(cls) \
190190 FXFoldingItem * cls::getItemAt(FXint x,FXint y) const { \
191 return FXRbCallFoldingItemMethod(this,rb_intern("getItemAt"),x,y); \
191 return FXRbCallFoldingItemMethod(this,"getItemAt",x,y); \
192192 } \
193193 void cls::makeItemVisible(FXFoldingItem *item) { \
194 FXRbCallVoidMethod(this,rb_intern("makeItemVisible"),item); \
194 FXRbCallVoidMethod(this,"makeItemVisible",item); \
195195 } \
196196 FXbool cls::enableItem(FXFoldingItem *item) { \
197 return FXRbCallBoolMethod(this,rb_intern("enableItem"),item); \
197 return FXRbCallBoolMethod(this,"enableItem",item); \
198198 } \
199199 FXbool cls::disableItem(FXFoldingItem *item) { \
200 return FXRbCallBoolMethod(this,rb_intern("disableItem"),item); \
200 return FXRbCallBoolMethod(this,"disableItem",item); \
201201 } \
202202 FXbool cls::selectItem(FXFoldingItem *item,FXbool notify) { \
203 return FXRbCallBoolMethod(this,rb_intern("selectItem"),item,notify); \
203 return FXRbCallBoolMethod(this,"selectItem",item,notify); \
204204 } \
205205 FXbool cls::deselectItem(FXFoldingItem *item,FXbool notify) { \
206 return FXRbCallBoolMethod(this,rb_intern("deselectItem"),item,notify); \
206 return FXRbCallBoolMethod(this,"deselectItem",item,notify); \
207207 } \
208208 FXbool cls::toggleItem(FXFoldingItem *item,FXbool notify) { \
209 return FXRbCallBoolMethod(this,rb_intern("toggleItem"),item,notify); \
209 return FXRbCallBoolMethod(this,"toggleItem",item,notify); \
210210 } \
211211 FXbool cls::extendSelection(FXFoldingItem *item,FXbool notify) { \
212 return FXRbCallBoolMethod(this,rb_intern("extendSelection"),item,notify); \
212 return FXRbCallBoolMethod(this,"extendSelection",item,notify); \
213213 } \
214214 FXbool cls::killSelection(FXbool notify) { \
215 return FXRbCallBoolMethod(this,rb_intern("killSelection"),notify); \
215 return FXRbCallBoolMethod(this,"killSelection",notify); \
216216 } \
217217 FXbool cls::openItem(FXFoldingItem *item,FXbool notify) { \
218 return FXRbCallBoolMethod(this,rb_intern("openItem"),item,notify); \
218 return FXRbCallBoolMethod(this,"openItem",item,notify); \
219219 } \
220220 FXbool cls::closeItem(FXFoldingItem *item,FXbool notify) { \
221 return FXRbCallBoolMethod(this,rb_intern("closeItem"),item,notify); \
221 return FXRbCallBoolMethod(this,"closeItem",item,notify); \
222222 } \
223223 FXbool cls::collapseTree(FXFoldingItem *item,FXbool notify) { \
224 return FXRbCallBoolMethod(this,rb_intern("collapseTree"),item,notify); \
224 return FXRbCallBoolMethod(this,"collapseTree",item,notify); \
225225 } \
226226 FXbool cls::expandTree(FXFoldingItem *item,FXbool notify) { \
227 return FXRbCallBoolMethod(this,rb_intern("expandTree"),item,notify); \
227 return FXRbCallBoolMethod(this,"expandTree",item,notify); \
228228 } \
229229 void cls::setCurrentItem(FXFoldingItem *item,FXbool notify) { \
230 FXRbCallVoidMethod(this,rb_intern("setCurrentItem"),item,notify); \
230 FXRbCallVoidMethod(this,"setCurrentItem",item,notify); \
231231 }
232232
233233 class FXRbFoldingList : public FXFoldingList {
8484
8585 #define IMPLEMENT_FXFONT_STUBS(cls) \
8686 void cls::setFontDesc(const FXFontDesc& desc) { \
87 FXRbCallVoidMethod(this,rb_intern("setFontDesc"),desc); \
87 FXRbCallVoidMethod(this,"setFontDesc",desc); \
8888 } \
8989 void cls::setAngle(FXint ang) { \
90 FXRbCallVoidMethod(this,rb_intern("setAngle"),ang); \
90 FXRbCallVoidMethod(this,"setAngle",ang); \
9191 } \
9292 void cls::setFont(const FXString& string) { \
93 FXRbCallVoidMethod(this,rb_intern("setFont"),string); \
93 FXRbCallVoidMethod(this,"setFont",string); \
9494 } \
9595 FXbool cls::isFontMono() const { \
96 return FXRbCallBoolMethod(this,rb_intern("isFontMono")); \
96 return FXRbCallBoolMethod(this,"isFontMono"); \
9797 } \
9898 FXbool cls::hasChar(FXwchar ch) const { \
99 return FXRbCallBoolMethod(this,rb_intern("hasChar"),ch); \
99 return FXRbCallBoolMethod(this,"hasChar",ch); \
100100 } \
101101 FXwchar cls::getMinChar() const { \
102 return FXRbCallWCharMethod(this,rb_intern("getMinChar")); \
102 return FXRbCallWCharMethod(this,"getMinChar"); \
103103 } \
104104 FXwchar cls::getMaxChar() const { \
105 return FXRbCallWCharMethod(this,rb_intern("getMaxChar")); \
105 return FXRbCallWCharMethod(this,"getMaxChar"); \
106106 } \
107107 FXint cls::leftBearing(FXwchar ch) const { \
108 return FXRbCallIntMethod(this,rb_intern("leftBearing"),ch); \
108 return FXRbCallIntMethod(this,"leftBearing",ch); \
109109 } \
110110 FXint cls::rightBearing(FXwchar ch) const { \
111 return FXRbCallIntMethod(this,rb_intern("rightBearing"),ch); \
111 return FXRbCallIntMethod(this,"rightBearing",ch); \
112112 } \
113113 FXint cls::getFontWidth() const { \
114 return FXRbCallIntMethod(this,rb_intern("getFontWidth")); \
114 return FXRbCallIntMethod(this,"getFontWidth"); \
115115 } \
116116 FXint cls::getFontHeight() const { \
117 return FXRbCallIntMethod(this,rb_intern("getFontHeight")); \
117 return FXRbCallIntMethod(this,"getFontHeight"); \
118118 } \
119119 FXint cls::getFontAscent() const { \
120 return FXRbCallIntMethod(this,rb_intern("getFontAscent")); \
120 return FXRbCallIntMethod(this,"getFontAscent"); \
121121 } \
122122 FXint cls::getFontDescent() const { \
123 return FXRbCallIntMethod(this,rb_intern("getFontDescent")); \
123 return FXRbCallIntMethod(this,"getFontDescent"); \
124124 } \
125125 FXint cls::getFontLeading() const { \
126 return FXRbCallIntMethod(this,rb_intern("getFontLeading")); \
126 return FXRbCallIntMethod(this,"getFontLeading"); \
127127 } \
128128 FXint cls::getFontSpacing() const { \
129 return FXRbCallIntMethod(this,rb_intern("getFontSpacing")); \
129 return FXRbCallIntMethod(this,"getFontSpacing"); \
130130 } \
131131 FXint cls::getCharWidth(FXwchar ch) const { \
132 return FXRbCallIntMethod(this,rb_intern("getCharWidth"),ch); \
132 return FXRbCallIntMethod(this,"getCharWidth",ch); \
133133 } \
134134 FXint cls::getTextWidth(const FXString& str) const { \
135 return FXRbCallIntMethod(this,rb_intern("getTextWidth"),str); \
135 return FXRbCallIntMethod(this,"getTextWidth",str); \
136136 } \
137137 FXint cls::getTextHeight(const FXString& str) const { \
138 return FXRbCallIntMethod(this,rb_intern("getTextHeight"),str); \
138 return FXRbCallIntMethod(this,"getTextHeight",str); \
139139 }
140140
141141 class FXRbFont : public FXFont {
4343
4444 #define IMPLEMENT_FXGLCANVAS_STUBS(cls) \
4545 FXbool cls::makeCurrent(){ \
46 return FXRbCallBoolMethod(this,rb_intern("makeCurrent")); \
46 return FXRbCallBoolMethod(this,"makeCurrent"); \
4747 } \
4848 FXbool cls::makeNonCurrent(){ \
49 return FXRbCallBoolMethod(this,rb_intern("makeNonCurrent")); \
49 return FXRbCallBoolMethod(this,"makeNonCurrent"); \
5050 } \
5151 FXbool cls::isCurrent() const { \
52 return FXRbCallBoolMethod(this,rb_intern("isCurrent")); \
52 return FXRbCallBoolMethod(this,"isCurrent"); \
5353 } \
5454 void cls::swapBuffers(){ \
55 FXRbCallVoidMethod(this,rb_intern("swapBuffers")); \
55 FXRbCallVoidMethod(this,"swapBuffers"); \
5656 }
5757
5858
5454
5555 #define IMPLEMENT_FXGLOBJECT_STUBS(cls) \
5656 void cls::bounds(FXRangef& box){ \
57 box=FXRbCallRangeMethod(this,rb_intern("bounds")); \
57 box=FXRbCallRangeMethod(this,"bounds"); \
5858 } \
5959 void cls::draw(FXGLViewer* viewer){ \
60 FXRbCallVoidMethod(this,rb_intern("draw"),viewer); \
60 FXRbCallVoidMethod(this,"draw",viewer); \
6161 } \
6262 void cls::hit(FXGLViewer* viewer){ \
63 FXRbCallVoidMethod(this,rb_intern("hit"),viewer); \
63 FXRbCallVoidMethod(this,"hit",viewer); \
6464 } \
6565 FXGLObject* cls::copy(){ \
66 return FXRbCallGLObjectMethod(this,rb_intern("copy")); \
66 return FXRbCallGLObjectMethod(this,"copy"); \
6767 } \
6868 FXGLObject* cls::identify(FXuint* path,FXint n){ \
69 return FXRbCallGLObjectMethod(this,rb_intern("identify"),path,n); \
69 return FXRbCallGLObjectMethod(this,"identify",path,n); \
7070 } \
7171 FXbool cls::canDrag() const { \
72 return FXRbCallBoolMethod(this,rb_intern("canDrag")); \
72 return FXRbCallBoolMethod(this,"canDrag"); \
7373 } \
7474 FXbool cls::canDelete() const{ \
75 return FXRbCallBoolMethod(this,rb_intern("canDelete")); \
75 return FXRbCallBoolMethod(this,"canDelete"); \
7676 } \
7777 FXbool cls::drag(FXGLViewer* viewer,FXint fx,FXint fy,FXint tx,FXint ty){ \
78 return FXRbCallBoolMethod(this,rb_intern("drag"),viewer,fx,fy,tx,ty); \
78 return FXRbCallBoolMethod(this,"drag",viewer,fx,fy,tx,ty); \
7979 }
8080
8181
3434
3535 #define IMPLEMENT_FXGLSHAPE_STUBS(klass,superklass) \
3636 void klass::drawshape(FXGLViewer* viewer){ \
37 FXRbCallVoidMethod(this,rb_intern("drawshape"),viewer); \
37 FXRbCallVoidMethod(this,"drawshape",viewer); \
3838 } \
3939 void klass::_drawshape(FXGLViewer* viewer){ \
4040 superklass::drawshape(viewer); \
4141
4242 #define IMPLEMENT_FXGLVIEWER_STUBS(cls) \
4343 FXGLObject** cls::select(FXint x,FXint y,FXint w,FXint h){ \
44 return FXRbCallGLObjectArrayMethod(this,rb_intern("select"),x,y,w,h); \
44 return FXRbCallGLObjectArrayMethod(this,"select",x,y,w,h); \
4545 } \
4646 FXGLObject* cls::pick(FXint x,FXint y){ \
47 return FXRbCallGLObjectMethod(this,rb_intern("pick"),x,y); \
47 return FXRbCallGLObjectMethod(this,"pick",x,y); \
4848 } \
4949 FXbool cls::setBounds(const FXRangef& box){ \
50 return FXRbCallBoolMethod(this,rb_intern("setBounds"),box); \
50 return FXRbCallBoolMethod(this,"setBounds",box); \
5151 }
5252
5353
5252
5353 #define IMPLEMENT_FXHEADERITEM_STUBS(cls) \
5454 void cls::setText(const FXString& text){ \
55 FXRbCallVoidMethod(this,rb_intern("setText"),text); \
55 FXRbCallVoidMethod(this,"setText",text); \
5656 } \
5757 void cls::setIcon(FXIcon* icn){ \
58 FXRbCallVoidMethod(this,rb_intern("setIcon"),icn); \
58 FXRbCallVoidMethod(this,"setIcon",icn); \
5959 } \
6060 FXint cls::getWidth(const FXHeader* header) const { \
61 return FXRbCallIntMethod(this,rb_intern("getWidth"),header); \
61 return FXRbCallIntMethod(this,"getWidth",header); \
6262 } \
6363 FXint cls::getHeight(const FXHeader* header) const { \
64 return FXRbCallIntMethod(this,rb_intern("getHeight"),header); \
64 return FXRbCallIntMethod(this,"getHeight",header); \
6565 } \
6666 void cls::create(){ \
67 FXRbCallVoidMethod(this,rb_intern("create")); \
67 FXRbCallVoidMethod(this,"create"); \
6868 } \
6969 void cls::detach(){ \
70 FXRbCallVoidMethod(this,rb_intern("detach")); \
70 FXRbCallVoidMethod(this,"detach"); \
7171 } \
7272 void cls::destroy(){ \
73 FXRbCallVoidMethod(this,rb_intern("destroy")); \
73 FXRbCallVoidMethod(this,"destroy"); \
7474 }
7575
7676
8787
8888 #define IMPLEMENT_FXICONITEM_STUBS(klass,superklass) \
8989 void klass::draw(const FXIconList* list,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const { \
90 FXRbCallVoidMethod(this,rb_intern("draw"),list,dc,x,y,w,h); \
90 FXRbCallVoidMethod(this,"draw",list,dc,x,y,w,h); \
9191 } \
9292 void klass::public_draw(const FXIconList* list,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const { \
9393 superklass::draw(list,dc,x,y,w,h); \
9494 } \
9595 FXint klass::hitItem(const FXIconList* list,FXint rx,FXint ry,FXint rw,FXint rh) const { \
96 return FXRbCallIntMethod(this,rb_intern("hitItem"),list,rx,ry,rw,rh); \
96 return FXRbCallIntMethod(this,"hitItem",list,rx,ry,rw,rh); \
9797 } \
9898 FXint klass::public_hitItem(const FXIconList* list,FXint rx,FXint ry,FXint rw,FXint rh) const { \
9999 return superklass::hitItem(list,rx,ry,rw,rh); \
100100 } \
101101 void klass::drawBigIcon(const FXIconList* list,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const { \
102 FXRbCallVoidMethod(this,rb_intern("drawBigIcon"),list,dc,x,y,w,h); \
102 FXRbCallVoidMethod(this,"drawBigIcon",list,dc,x,y,w,h); \
103103 } \
104104 void klass::public_drawBigIcon(const FXIconList* list,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const { \
105105 superklass::drawBigIcon(list,dc,x,y,w,h); \
106106 } \
107107 void klass::drawMiniIcon(const FXIconList* list,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const { \
108 FXRbCallVoidMethod(this,rb_intern("drawMiniIcon"),list,dc,x,y,w,h); \
108 FXRbCallVoidMethod(this,"drawMiniIcon",list,dc,x,y,w,h); \
109109 } \
110110 void klass::public_drawMiniIcon(const FXIconList* list,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const { \
111111 superklass::drawMiniIcon(list,dc,x,y,w,h); \
112112 } \
113113 void klass::drawDetails(const FXIconList* list,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const { \
114 FXRbCallVoidMethod(this,rb_intern("drawDetails"),list,dc,x,y,w,h); \
114 FXRbCallVoidMethod(this,"drawDetails",list,dc,x,y,w,h); \
115115 } \
116116 void klass::public_drawDetails(const FXIconList* list,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const { \
117117 superklass::drawDetails(list,dc,x,y,w,h); \
118118 } \
119119 void klass::setText(const FXString& txt){ \
120 FXRbCallVoidMethod(this,rb_intern("setText"),txt); \
120 FXRbCallVoidMethod(this,"setText",txt); \
121121 } \
122122 void klass::setBigIcon(FXIcon* icn,FXbool owned){ \
123 FXRbCallVoidMethod(this,rb_intern("setBigIcon"),icn,owned); \
123 FXRbCallVoidMethod(this,"setBigIcon",icn,owned); \
124124 } \
125125 void klass::setMiniIcon(FXIcon* icn,FXbool owned){ \
126 FXRbCallVoidMethod(this,rb_intern("setMiniIcon"),icn,owned); \
126 FXRbCallVoidMethod(this,"setMiniIcon",icn,owned); \
127127 } \
128128 void klass::setFocus(FXbool focus){ \
129 FXRbCallVoidMethod(this,rb_intern("setFocus"),focus); \
129 FXRbCallVoidMethod(this,"setFocus",focus); \
130130 } \
131131 void klass::setSelected(FXbool selected){ \
132 FXRbCallVoidMethod(this,rb_intern("setSelected"),selected); \
132 FXRbCallVoidMethod(this,"setSelected",selected); \
133133 } \
134134 void klass::setEnabled(FXbool enabled){ \
135 FXRbCallVoidMethod(this,rb_intern("setEnabled"),enabled); \
135 FXRbCallVoidMethod(this,"setEnabled",enabled); \
136136 } \
137137 void klass::setDraggable(FXbool draggable){ \
138 FXRbCallVoidMethod(this,rb_intern("setDraggable"),draggable); \
138 FXRbCallVoidMethod(this,"setDraggable",draggable); \
139139 } \
140140 FXint klass::getWidth(const FXIconList* list) const { \
141 return FXRbCallIntMethod(this,rb_intern("getWidth"),list); \
141 return FXRbCallIntMethod(this,"getWidth",list); \
142142 } \
143143 FXint klass::getHeight(const FXIconList* list) const { \
144 return FXRbCallIntMethod(this,rb_intern("getHeight"),list); \
144 return FXRbCallIntMethod(this,"getHeight",list); \
145145 } \
146146 void klass::create(){ \
147 FXRbCallVoidMethod(this,rb_intern("create")); \
147 FXRbCallVoidMethod(this,"create"); \
148148 } \
149149 void klass::detach(){ \
150 FXRbCallVoidMethod(this,rb_intern("detach")); \
150 FXRbCallVoidMethod(this,"detach"); \
151151 } \
152152 void klass::destroy(){ \
153 FXRbCallVoidMethod(this,rb_intern("destroy")); \
153 FXRbCallVoidMethod(this,"destroy"); \
154154 }
155155
156156
218218
219219 #define IMPLEMENT_FXICONLIST_STUBS(cls) \
220220 FXbool cls::selectItem(FXint index,FXbool notify){ \
221 return FXRbCallBoolMethod(this,rb_intern("selectItem"),index,notify); \
221 return FXRbCallBoolMethod(this,"selectItem",index,notify); \
222222 } \
223223 FXbool cls::deselectItem(FXint index,FXbool notify){ \
224 return FXRbCallBoolMethod(this,rb_intern("deselectItem"),index,notify); \
224 return FXRbCallBoolMethod(this,"deselectItem",index,notify); \
225225 } \
226226 FXbool cls::toggleItem(FXint index,FXbool notify){ \
227 return FXRbCallBoolMethod(this,rb_intern("toggleItem"),index,notify); \
227 return FXRbCallBoolMethod(this,"toggleItem",index,notify); \
228228 } \
229229 FXbool cls::selectInRectangle(FXint x,FXint y,FXint w,FXint h,FXbool notify){ \
230 return FXRbCallBoolMethod(this,rb_intern("selectInRectangle"),x,y,w,h,notify); \
230 return FXRbCallBoolMethod(this,"selectInRectangle",x,y,w,h,notify); \
231231 } \
232232 FXbool cls::extendSelection(FXint index,FXbool notify){ \
233 return FXRbCallBoolMethod(this,rb_intern("extendSelection"),index,notify); \
233 return FXRbCallBoolMethod(this,"extendSelection",index,notify); \
234234 } \
235235 FXbool cls::killSelection(FXbool notify){ \
236 return FXRbCallBoolMethod(this,rb_intern("killSelection"),notify); \
236 return FXRbCallBoolMethod(this,"killSelection",notify); \
237237 } \
238238 void cls::setCurrentItem(FXint index,FXbool notify){ \
239 FXRbCallVoidMethod(this,rb_intern("setCurrentItem"),index,notify); \
239 FXRbCallVoidMethod(this,"setCurrentItem",index,notify); \
240240 } \
241241 FXint cls::getItemAt(FXint x,FXint y) const { \
242 return FXRbCallIntMethod(this,rb_intern("getItemAt"),x,y); \
242 return FXRbCallIntMethod(this,"getItemAt",x,y); \
243243 } \
244244 void cls::makeItemVisible(FXint index){ \
245 FXRbCallVoidMethod(this,rb_intern("makeItemVisible"),index); \
245 FXRbCallVoidMethod(this,"makeItemVisible",index); \
246246 } \
247247 FXbool cls::enableItem(FXint index){ \
248 return FXRbCallBoolMethod(this,rb_intern("enableItem"),index); \
248 return FXRbCallBoolMethod(this,"enableItem",index); \
249249 } \
250250 FXbool cls::disableItem(FXint index){ \
251 return FXRbCallBoolMethod(this,rb_intern("disableItem"),index); \
251 return FXRbCallBoolMethod(this,"disableItem",index); \
252252 }
253253
254254
6767
6868 #define IMPLEMENT_FXICONSOURCE_STUBS(cls) \
6969 FXIcon* cls::loadIconFile(const FXString& filename,const FXString& type) const { \
70 return FXRbCallIconMethod(this,rb_intern("loadIconFile"),filename,type); \
70 return FXRbCallIconMethod(this,"loadIconFile",filename,type); \
7171 } \
7272 FXIcon* cls::loadIconData(const void* pixels,const FXString& type) const { \
73 return FXRbCallIconMethod(this,rb_intern("loadIconData"),pixels,type); \
73 return FXRbCallIconMethod(this,"loadIconData",pixels,type); \
7474 } \
7575 FXIcon* cls::loadIconStream(FXStream& store,const FXString& type) const { \
76 return FXRbCallIconMethod(this,rb_intern("loadIconStream"),store,type); \
76 return FXRbCallIconMethod(this,"loadIconStream",store,type); \
7777 } \
7878 FXImage* cls::loadImageFile(const FXString& filename,const FXString& type) const { \
79 return FXRbCallImageMethod(this,rb_intern("loadImageFile"),filename,type); \
79 return FXRbCallImageMethod(this,"loadImageFile",filename,type); \
8080 } \
8181 FXImage* cls::loadImageData(const void* pixels,const FXString& type) const { \
82 return FXRbCallImageMethod(this,rb_intern("loadImageData"),pixels,type); \
82 return FXRbCallImageMethod(this,"loadImageData",pixels,type); \
8383 } \
8484 FXImage* cls::loadImageStream(FXStream& store,const FXString& type) const { \
85 return FXRbCallImageMethod(this,rb_intern("loadImageStream"),store,type); \
85 return FXRbCallImageMethod(this,"loadImageStream",store,type); \
8686 } \
8787 FXIcon* cls::loadScaledIconFile(const FXString& filename,FXint size,FXint qual,const FXString& type) const { \
88 return FXRbCallIconMethod(this,rb_intern("loadScaledIconFile"),filename,size,qual,type); \
88 return FXRbCallIconMethod(this,"loadScaledIconFile",filename,size,qual,type); \
8989 } \
9090 FXIcon* cls::loadScaledIconData(const void* pixels,FXint size,FXint qual,const FXString& type) const { \
91 return FXRbCallIconMethod(this,rb_intern("loadScaledIconData"),pixels,size,qual,type); \
91 return FXRbCallIconMethod(this,"loadScaledIconData",pixels,size,qual,type); \
9292 } \
9393 FXIcon* cls::loadScaledIconStream(FXStream& store,FXint size,FXint qual,const FXString& type) const { \
94 return FXRbCallIconMethod(this,rb_intern("loadScaledIconStream"),store,size,qual,type); \
94 return FXRbCallIconMethod(this,"loadScaledIconStream",store,size,qual,type); \
9595 } \
9696 FXImage* cls::loadScaledImageFile(const FXString& filename,FXint size,FXint qual,const FXString& type) const { \
97 return FXRbCallImageMethod(this,rb_intern("loadScaledImageFile"),filename,size,qual,type); \
97 return FXRbCallImageMethod(this,"loadScaledImageFile",filename,size,qual,type); \
9898 } \
9999 FXImage* cls::loadScaledImageData(const void* pixels,FXint size,FXint qual,const FXString& type) const { \
100 return FXRbCallImageMethod(this,rb_intern("loadScaledImageData"),pixels,size,qual,type); \
100 return FXRbCallImageMethod(this,"loadScaledImageData",pixels,size,qual,type); \
101101 } \
102102 FXImage* cls::loadScaledImageStream(FXStream& store,FXint size,FXint qual,const FXString& type) const { \
103 return FXRbCallImageMethod(this,rb_intern("loadScaledImageStream"),store,size,qual,type); \
103 return FXRbCallImageMethod(this,"loadScaledImageStream",store,size,qual,type); \
104104 }
105105
106106
4040
4141 #define IMPLEMENT_FXID_STUBS(cls) \
4242 void cls::create(){ \
43 FXRbCallVoidMethod(this,rb_intern("create")); \
43 FXRbCallVoidMethod(this,"create"); \
4444 } \
4545 void cls::detach(){ \
46 FXRbCallVoidMethod(this,rb_intern("detach")); \
46 FXRbCallVoidMethod(this,"detach"); \
4747 } \
4848 void cls::destroy(){ \
49 FXRbCallVoidMethod(this,rb_intern("destroy")); \
49 FXRbCallVoidMethod(this,"destroy"); \
5050 }
5151
5252
7272 inline void klass ## _blend(klass* self,FXColor color){ \
7373 self->klass::blend(color); \
7474 } \
75 inline bool klass ## _savePixels(const klass* self,FXStream& store){ \
75 inline bool klass ## _savePixels_gvl(const klass* self,FXStream& store){ \
7676 return self->klass::savePixels(store); \
7777 } \
78 inline bool klass ## _loadPixels(klass* self,FXStream& store){ \
78 inline bool klass ## _loadPixels_gvl(klass* self,FXStream& store){ \
7979 return self->klass::loadPixels(store); \
8080 }
8181
8282
8383 #define IMPLEMENT_FXIMAGE_STUBS(cls) \
8484 void cls::restore(){ \
85 FXRbCallVoidMethod(this,rb_intern("restore")); \
85 FXRbCallVoidMethod(this,"restore"); \
8686 } \
8787 void cls::render(){ \
88 FXRbCallVoidMethod(this,rb_intern("render")); \
88 FXRbCallVoidMethod(this,"render"); \
8989 } \
9090 void cls::release(){ \
91 FXRbCallVoidMethod(this,rb_intern("release")); \
91 FXRbCallVoidMethod(this,"release"); \
9292 } \
9393 void cls::scale(FXint w,FXint h,FXint quality){ \
94 FXRbCallVoidMethod(this,rb_intern("scale"),w,h,quality); \
94 FXRbCallVoidMethod(this,"scale",w,h,quality); \
9595 } \
9696 void cls::mirror(bool horizontal,bool vertical){ \
97 FXRbCallVoidMethod(this,rb_intern("mirror"),horizontal,vertical); \
97 FXRbCallVoidMethod(this,"mirror",horizontal,vertical); \
9898 } \
9999 void cls::rotate(FXint degrees){ \
100 FXRbCallVoidMethod(this,rb_intern("rotate"),degrees); \
100 FXRbCallVoidMethod(this,"rotate",degrees); \
101101 } \
102102 void cls::crop(FXint x,FXint y,FXint w,FXint h,FXColor color){ \
103 FXRbCallVoidMethod(this,rb_intern("crop"),x,y,w,h,color); \
103 FXRbCallVoidMethod(this,"crop",x,y,w,h,color); \
104104 } \
105105 void cls::fill(FXColor color){ \
106 FXRbCallVoidMethod(this,rb_intern("fill"),color); \
106 FXRbCallVoidMethod(this,"fill",color); \
107107 } \
108108 void cls::fade(FXColor color,FXint factor){ \
109 FXRbCallVoidMethod(this,rb_intern("fade"),color,factor); \
109 FXRbCallVoidMethod(this,"fade",color,factor); \
110110 } \
111111 void cls::xshear(FXint shear,FXColor clr){ \
112 FXRbCallVoidMethod(this,rb_intern("xshear"),shear,clr); \
112 FXRbCallVoidMethod(this,"xshear",shear,clr); \
113113 } \
114114 void cls::yshear(FXint shear,FXColor clr){ \
115 FXRbCallVoidMethod(this,rb_intern("yshear"),shear,clr); \
115 FXRbCallVoidMethod(this,"yshear",shear,clr); \
116116 } \
117117 void cls::hgradient(FXColor left,FXColor right){ \
118 FXRbCallVoidMethod(this,rb_intern("hgradient"),left,right); \
118 FXRbCallVoidMethod(this,"hgradient",left,right); \
119119 } \
120120 void cls::vgradient(FXColor top,FXColor bottom){ \
121 FXRbCallVoidMethod(this,rb_intern("vgradient"),top,bottom); \
121 FXRbCallVoidMethod(this,"vgradient",top,bottom); \
122122 } \
123123 void cls::gradient(FXColor topleft,FXColor topright,FXColor bottomleft,FXColor bottomright){ \
124 FXRbCallVoidMethod(this,rb_intern("gradient"),topleft,topright,bottomleft,bottomright); \
124 FXRbCallVoidMethod(this,"gradient",topleft,topright,bottomleft,bottomright); \
125125 } \
126126 void cls::blend(FXColor color){ \
127 FXRbCallVoidMethod(this,rb_intern("blend"),color); \
127 FXRbCallVoidMethod(this,"blend",color); \
128128 } \
129129 bool cls::savePixels(FXStream& store) const { \
130 return FXRbCallBoolMethod(this,rb_intern("savePixels"),store); \
130 return FXRbCallBoolMethod(this,"savePixels",store); \
131131 } \
132132 bool cls::loadPixels(FXStream& store){ \
133 return FXRbCallBoolMethod(this,rb_intern("loadPixels"),store); \
133 return FXRbCallBoolMethod(this,"loadPixels",store); \
134134 }
135135
136136
6464
6565 #define IMPLEMENT_FXLISTITEM_STUBS(cls) \
6666 void cls::create(){ \
67 FXRbCallVoidMethod(this,rb_intern("create")); \
67 FXRbCallVoidMethod(this,"create"); \
6868 } \
6969 void cls::detach(){ \
70 FXRbCallVoidMethod(this,rb_intern("detach")); \
70 FXRbCallVoidMethod(this,"detach"); \
7171 } \
7272 void cls::destroy(){ \
73 FXRbCallVoidMethod(this,rb_intern("destroy")); \
73 FXRbCallVoidMethod(this,"destroy"); \
7474 } \
7575 void cls::setText(const FXString& txt){ \
76 FXRbCallVoidMethod(this,rb_intern("setText"),txt); \
76 FXRbCallVoidMethod(this,"setText",txt); \
7777 } \
7878 void cls::setIcon(FXIcon* icn,FXbool owned){ \
79 FXRbCallVoidMethod(this,rb_intern("setIcon"),icn,owned); \
79 FXRbCallVoidMethod(this,"setIcon",icn,owned); \
8080 } \
8181 void cls::setFocus(FXbool focus){ \
82 FXRbCallVoidMethod(this,rb_intern("setFocus"),focus); \
82 FXRbCallVoidMethod(this,"setFocus",focus); \
8383 } \
8484 void cls::setSelected(FXbool selected){ \
85 FXRbCallVoidMethod(this,rb_intern("setSelected"),selected); \
85 FXRbCallVoidMethod(this,"setSelected",selected); \
8686 } \
8787 void cls::setEnabled(FXbool enabled){ \
88 FXRbCallVoidMethod(this,rb_intern("setEnabled"),enabled); \
88 FXRbCallVoidMethod(this,"setEnabled",enabled); \
8989 } \
9090 void cls::setDraggable(FXbool draggable){ \
91 FXRbCallVoidMethod(this,rb_intern("setDraggable"),draggable); \
91 FXRbCallVoidMethod(this,"setDraggable",draggable); \
9292 } \
9393 FXint cls::getWidth(const FXList* list) const { \
94 return FXRbCallIntMethod(this,rb_intern("getWidth"),list); \
94 return FXRbCallIntMethod(this,"getWidth",list); \
9595 } \
9696 FXint cls::getHeight(const FXList* list) const { \
97 return FXRbCallIntMethod(this,rb_intern("getHeight"),list); \
97 return FXRbCallIntMethod(this,"getHeight",list); \
9898 }
9999
100100
159159
160160 #define IMPLEMENT_FXLIST_STUBS(cls) \
161161 FXbool cls::enableItem(FXint index){ \
162 return FXRbCallBoolMethod(this,rb_intern("enableItem"),index); \
162 return FXRbCallBoolMethod(this,"enableItem",index); \
163163 } \
164164 FXbool cls::disableItem(FXint index){ \
165 return FXRbCallBoolMethod(this,rb_intern("disableItem"),index); \
165 return FXRbCallBoolMethod(this,"disableItem",index); \
166166 } \
167167 void cls::makeItemVisible(FXint index) { \
168 FXRbCallVoidMethod(this,rb_intern("makeItemVisible"),index); \
168 FXRbCallVoidMethod(this,"makeItemVisible",index); \
169169 } \
170170 FXint cls::getItemAt(FXint x,FXint y) const { \
171 return FXRbCallIntMethod(this,rb_intern("getItemAt"),x,y); \
171 return FXRbCallIntMethod(this,"getItemAt",x,y); \
172172 } \
173173 FXbool cls::selectItem(FXint index,FXbool notify){ \
174 return FXRbCallBoolMethod(this,rb_intern("selectItem"),index,notify); \
174 return FXRbCallBoolMethod(this,"selectItem",index,notify); \
175175 } \
176176 FXbool cls::deselectItem(FXint index,FXbool notify){ \
177 return FXRbCallBoolMethod(this,rb_intern("deselectItem"),index,notify); \
177 return FXRbCallBoolMethod(this,"deselectItem",index,notify); \
178178 } \
179179 FXbool cls::toggleItem(FXint index,FXbool notify){ \
180 return FXRbCallBoolMethod(this,rb_intern("toggleItem"),index,notify); \
180 return FXRbCallBoolMethod(this,"toggleItem",index,notify); \
181181 } \
182182 FXbool cls::extendSelection(FXint index,FXbool notify){ \
183 return FXRbCallBoolMethod(this,rb_intern("extendSelection"),index,notify); \
183 return FXRbCallBoolMethod(this,"extendSelection",index,notify); \
184184 } \
185185 FXbool cls::killSelection(FXbool notify){ \
186 return FXRbCallBoolMethod(this,rb_intern("killSelection"),notify); \
186 return FXRbCallBoolMethod(this,"killSelection",notify); \
187187 } \
188188 void cls::setCurrentItem(FXint index,FXbool notify){ \
189 FXRbCallVoidMethod(this,rb_intern("setCurrentItem"),index,notify); \
189 FXRbCallVoidMethod(this,"setCurrentItem",index,notify); \
190190 }
191191
192192
3333
3434 #define IMPLEMENT_FXLISTBOX_STUBS(cls) \
3535 void cls::setCurrentItem(FXint index,FXbool notify){ \
36 FXRbCallVoidMethod(this,rb_intern("setCurrentItem"),index,notify); \
36 FXRbCallVoidMethod(this,"setCurrentItem",index,notify); \
3737 }
3838
3939 class FXRbListBox : public FXListBox {
4343
4444 #define IMPLEMENT_FXMDICHILD_STUBS(cls) \
4545 FXbool cls::minimize(FXbool notify){ \
46 return FXRbCallBoolMethod(this,rb_intern("minimize"),notify); \
46 return FXRbCallBoolMethod(this,"minimize",notify); \
4747 } \
4848 FXbool cls::maximize(FXbool notify){ \
49 return FXRbCallBoolMethod(this,rb_intern("maximize"),notify); \
49 return FXRbCallBoolMethod(this,"maximize",notify); \
5050 } \
5151 FXbool cls::restore(FXbool notify){ \
52 return FXRbCallBoolMethod(this,rb_intern("restore"),notify); \
52 return FXRbCallBoolMethod(this,"restore",notify); \
5353 } \
5454 FXbool cls::close(FXbool notify){ \
55 return FXRbCallBoolMethod(this,rb_intern("close"),notify); \
55 return FXRbCallBoolMethod(this,"close",notify); \
5656 }
5757
5858
4242
4343 #define IMPLEMENT_FXMDICLIENT_STUBS(cls) \
4444 FXbool cls::setActiveChild(FXMDIChild* child,FXbool notify){ \
45 return FXRbCallBoolMethod(this,rb_intern("setActiveChild"),child,notify); \
45 return FXRbCallBoolMethod(this,"setActiveChild",child,notify); \
4646 } \
4747 void cls::cascade(FXbool notify){ \
48 FXRbCallVoidMethod(this,rb_intern("cascade"),notify); \
48 FXRbCallVoidMethod(this,"cascade",notify); \
4949 } \
5050 void cls::horizontal(FXbool notify){ \
51 FXRbCallVoidMethod(this,rb_intern("horizontal"),notify); \
51 FXRbCallVoidMethod(this,"horizontal",notify); \
5252 } \
5353 void cls::vertical(FXbool notify){ \
54 FXRbCallVoidMethod(this,rb_intern("vertical"),notify); \
54 FXRbCallVoidMethod(this,"vertical",notify); \
5555 }
5656
5757 class FXRbMDIClient : public FXMDIClient {
0 /***********************************************************************
1 * FXRuby -- the Ruby language bindings for the FOX GUI toolkit.
2 * Copyright (c) 2017-2017 by Lyle Johnson. All Rights Reserved.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * For further information please contact the author by e-mail
19 * at "[email protected]".
20 ***********************************************************************/
21
22 #ifndef FXRBOBJREGISTRY_H
23 #define FXRBOBJREGISTRY_H
24
25 extern "C" {
26 // Opaque type declaration for SWIG runtime support
27 struct swig_type_info;
28 }
29
30 class FXRbObjRegistry {
31
32 /**
33 * The FXRuby_Objects hash table basically maps C++ objects to Ruby instances.
34 * Each key in the table is a pointer to a C++ object we've seen before, and
35 * the corresponding value is an FXRubyObjDesc struct (see below) that tells
36 * us which Ruby instance corresponds to that C++ object.
37 */
38
39 st_table * FXRuby_Objects;
40
41 /**
42 * Each value in the FXRuby_Objects hash table is an instance of this
43 * struct. It identifies the Ruby instance associated with a C++ object.
44 * It also indicates whether this is merely a "borrowed" reference to
45 * some C++ object (i.e. it's not one we need to destroy later).
46 *
47 * in_gc is set for FXWindows that are in garbage collection and must
48 * not call ruby code anymore.
49 */
50
51 enum ObjType { own, borrowed, callback };
52
53 struct ObjDesc {
54 VALUE obj;
55 enum ObjType type;
56 bool in_gc;
57 };
58
59 const char * safe_rb_obj_classname(VALUE obj);
60
61 public:
62
63 FXRbObjRegistry();
64
65 /**
66 * NewBorrowedObj() is a wrapper around SWIG_Ruby_NewPointerObj() that also
67 * registers this C++ object & Ruby instance pair in our FXRuby_Objects
68 * hash table. This function should only get called for methods that return
69 * a reference to an already-existing C++ object (i.e. one that FOX "owns")
70 * and for that reason we mark these objects as "borrowed".
71 */
72 VALUE NewBorrowedObj(void *ptr,swig_type_info* ty);
73
74 // Register this Ruby class instance
75 void RegisterRubyObj(VALUE rubyObj,const void* foxObj);
76
77 void UnregisterRubyObj(const void* foxObj, bool alsoOwned);
78
79 /**
80 * Return the registered Ruby class instance associated with this
81 * FOX object, or Qnil if not found.
82 */
83 VALUE GetRubyObj(const void *foxObj,bool alsoBorrowed, bool in_gc_mark=false);
84
85 /**
86 * FXRbIsBorrowed() returns true if the specified C++ object is one that
87 * FOX owns (i.e. it's borrowed).
88 */
89 bool IsBorrowed(void* ptr);
90
91 bool SetInGC(const void* ptr, bool enabled);
92 bool IsInGC(const void* ptr);
93
94 static FXRbObjRegistry main;
95 };
96
97 #endif
3737
3838 #define IMPLEMENT_FXOBJECT_STUBS(cls) \
3939 void cls::save(FXStream& store) const { \
40 FXRbCallVoidMethod(this,rb_intern("save"),store); \
40 FXRbCallVoidMethod(this,"save",store); \
4141 } \
4242 void cls::load(FXStream& store){ \
43 FXRbCallVoidMethod(this,rb_intern("load"),store); \
43 FXRbCallVoidMethod(this,"load",store); \
4444 }
4545
4646
3737
3838 #define IMPLEMENT_FXPOPUP_STUBS(cls) \
3939 void cls::popup(FXWindow* grabto,FXint x,FXint y,FXint w,FXint h){ \
40 FXRbCallVoidMethod(this,rb_intern("popup"),grabto,x,y,w,h); \
40 FXRbCallVoidMethod(this,"popup",grabto,x,y,w,h); \
4141 } \
4242 void cls::popdown(){ \
43 FXRbCallVoidMethod(this,rb_intern("popdown")); \
43 FXRbCallVoidMethod(this,"popdown"); \
4444 }
4545
4646
3434
3535 #define IMPLEMENT_FXREALSPINNER_STUBS(cls) \
3636 void cls::setValue(FXdouble value,FXbool notify){ \
37 FXRbCallVoidMethod(this,rb_intern("setValue"),value,notify); \
37 FXRbCallVoidMethod(this,"setValue",value,notify); \
3838 }
3939
4040
4343
4444 #define IMPLEMENT_FXSCROLLAREA_STUBS(cls) \
4545 FXint cls::getContentWidth(){ \
46 return FXRbCallIntMethod(this,rb_intern("getContentWidth")); \
46 return FXRbCallIntMethod(this,"getContentWidth"); \
4747 } \
4848 FXint cls::getContentHeight(){ \
49 return FXRbCallIntMethod(this,rb_intern("getContentHeight")); \
49 return FXRbCallIntMethod(this,"getContentHeight"); \
5050 } \
5151 FXint cls::getViewportWidth(){ \
52 return FXRbCallIntMethod(this,rb_intern("getViewportWidth")); \
52 return FXRbCallIntMethod(this,"getViewportWidth"); \
5353 } \
5454 FXint cls::getViewportHeight(){ \
55 return FXRbCallIntMethod(this,rb_intern("getViewportHeight")); \
55 return FXRbCallIntMethod(this,"getViewportHeight"); \
5656 }
5757
5858
5656
5757 #define IMPLEMENT_FXSHUTTER_STUBS(cls) \
5858 void cls::setCurrent(FXint panel){ \
59 FXRbCallVoidMethod(this,rb_intern("setCurrent"),panel); \
59 FXRbCallVoidMethod(this,"setCurrent",panel); \
6060 }
6161
6262
3434
3535 #define IMPLEMENT_FXSPINNER_STUBS(cls) \
3636 void cls::setValue(FXint value,FXbool notify){ \
37 FXRbCallVoidMethod(this,rb_intern("setValue"),value,notify); \
37 FXRbCallVoidMethod(this,"setValue",value,notify); \
3838 }
3939
4040
4040
4141 #define IMPLEMENT_FXSTREAM_STUBS(cls) \
4242 bool cls::close(){ \
43 return FXRbCallBoolMethod(this,rb_intern("close")); \
43 return FXRbCallBoolMethod(this,"close"); \
4444 } \
4545 bool cls::flush(){ \
46 return FXRbCallBoolMethod(this,rb_intern("flush")); \
46 return FXRbCallBoolMethod(this,"flush"); \
4747 } \
4848 bool cls::position(FXlong p,FXWhence whence){ \
49 return FXRbCallBoolMethod(this,rb_intern("setPosition"),p,whence); \
49 return FXRbCallBoolMethod(this,"setPosition",p,whence); \
5050 }
5151
5252
3434
3535 #define IMPLEMENT_FXTABBAR_STUBS(cls) \
3636 void cls::setCurrent(FXint panel,FXbool notify){ \
37 FXRbCallVoidMethod(this,rb_intern("setCurrent"),panel,notify); \
37 FXRbCallVoidMethod(this,"setCurrent",panel,notify); \
3838 }
3939
4040
108108
109109 #define IMPLEMENT_FXTABLEITEM_STUBS(klass,superklass) \
110110 void klass::draw(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const { \
111 FXRbCallVoidMethod(this,rb_intern("draw"),table,dc,x,y,w,h); \
111 FXRbCallVoidMethod(this,"draw",table,dc,x,y,w,h); \
112112 } \
113113 void klass::public_draw(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const { \
114114 superklass::draw(table,dc,x,y,w,h); \
115115 } \
116116 void klass::drawBorders(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const { \
117 FXRbCallVoidMethod(this,rb_intern("drawBorders"),table,dc,x,y,w,h); \
117 FXRbCallVoidMethod(this,"drawBorders",table,dc,x,y,w,h); \
118118 } \
119119 void klass::public_drawBorders(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const { \
120120 superklass::drawBorders(table,dc,x,y,w,h); \
121121 } \
122122 void klass::drawContent(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const { \
123 FXRbCallVoidMethod(this,rb_intern("drawContent"),table,dc,x,y,w,h); \
123 FXRbCallVoidMethod(this,"drawContent",table,dc,x,y,w,h); \
124124 } \
125125 void klass::public_drawContent(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const { \
126126 superklass::drawContent(table,dc,x,y,w,h); \
127127 } \
128128 void klass::drawPattern(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const { \
129 FXRbCallVoidMethod(this,rb_intern("drawPattern"),table,dc,x,y,w,h); \
129 FXRbCallVoidMethod(this,"drawPattern",table,dc,x,y,w,h); \
130130 } \
131131 void klass::public_drawPattern(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const { \
132132 superklass::drawPattern(table,dc,x,y,w,h); \
133133 } \
134134 void klass::drawBackground(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const { \
135 FXRbCallVoidMethod(this,rb_intern("drawBackground"),table,dc,x,y,w,h); \
135 FXRbCallVoidMethod(this,"drawBackground",table,dc,x,y,w,h); \
136136 } \
137137 void klass::public_drawBackground(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const { \
138138 superklass::drawBackground(table,dc,x,y,w,h); \
139139 } \
140140 void klass::setText(const FXString& txt){ \
141 FXRbCallVoidMethod(this,rb_intern("setText"),txt); \
141 FXRbCallVoidMethod(this,"setText",txt); \
142142 } \
143143 FXString klass::getText() const { \
144 return FXRbCallStringMethod(this,rb_intern("getText")); \
144 return FXRbCallStringMethod(this,"getText"); \
145145 } \
146146 void klass::setIcon(FXIcon* icn,FXbool owned){ \
147 FXRbCallVoidMethod(this,rb_intern("setIcon"),icn,owned); \
147 FXRbCallVoidMethod(this,"setIcon",icn,owned); \
148148 } \
149149 FXIcon* klass::getIcon() const { \
150 return FXRbCallIconMethod(this,rb_intern("getIcon")); \
150 return FXRbCallIconMethod(this,"getIcon"); \
151151 } \
152152 void klass::setFocus(FXbool focus){ \
153 FXRbCallVoidMethod(this,rb_intern("setFocus"),focus); \
153 FXRbCallVoidMethod(this,"setFocus",focus); \
154154 } \
155155 void klass::setSelected(FXbool selected){ \
156 FXRbCallVoidMethod(this,rb_intern("setSelected"),selected); \
156 FXRbCallVoidMethod(this,"setSelected",selected); \
157157 } \
158158 void klass::setEnabled(FXbool enabled){ \
159 FXRbCallVoidMethod(this,rb_intern("setEnabled"),enabled); \
159 FXRbCallVoidMethod(this,"setEnabled",enabled); \
160160 } \
161161 void klass::setDraggable(FXbool draggable){ \
162 FXRbCallVoidMethod(this,rb_intern("setDraggable"),draggable); \
162 FXRbCallVoidMethod(this,"setDraggable",draggable); \
163163 } \
164164 void klass::setJustify(FXuint justify){ \
165 FXRbCallVoidMethod(this,rb_intern("setJustify"),justify); \
165 FXRbCallVoidMethod(this,"setJustify",justify); \
166166 } \
167167 void klass::setIconPosition(FXuint mode){ \
168 FXRbCallVoidMethod(this,rb_intern("setIconPosition"),mode); \
168 FXRbCallVoidMethod(this,"setIconPosition",mode); \
169169 } \
170170 void klass::setBorders(FXuint borders){ \
171 FXRbCallVoidMethod(this,rb_intern("setBorders"),borders); \
171 FXRbCallVoidMethod(this,"setBorders",borders); \
172172 } \
173173 void klass::setStipple(FXStipplePattern pattern){ \
174 FXRbCallVoidMethod(this,rb_intern("setStipple"),pattern); \
174 FXRbCallVoidMethod(this,"setStipple",pattern); \
175175 } \
176176 FXWindow* klass::getControlFor(FXTable* table){ \
177 return FXRbCallWindowMethod(this,rb_intern("getControlFor"),table); \
177 return FXRbCallWindowMethod(this,"getControlFor",table); \
178178 } \
179179 void klass::setFromControl(FXWindow* control){ \
180 FXRbCallVoidMethod(this,rb_intern("setFromControl"),control); \
180 FXRbCallVoidMethod(this,"setFromControl",control); \
181181 } \
182182 FXint klass::getWidth(const FXTable* table) const { \
183 return FXRbCallIntMethod(this,rb_intern("getWidth"),table); \
183 return FXRbCallIntMethod(this,"getWidth",table); \
184184 } \
185185 FXint klass::getHeight(const FXTable* table) const { \
186 return FXRbCallIntMethod(this,rb_intern("getHeight"),table); \
186 return FXRbCallIntMethod(this,"getHeight",table); \
187187 } \
188188 void klass::create(){ \
189 FXRbCallVoidMethod(this,rb_intern("create")); \
189 FXRbCallVoidMethod(this,"create"); \
190190 } \
191191 void klass::detach(){ \
192 FXRbCallVoidMethod(this,rb_intern("detach")); \
192 FXRbCallVoidMethod(this,"detach"); \
193193 } \
194194 void klass::destroy(){ \
195 FXRbCallVoidMethod(this,rb_intern("destroy")); \
195 FXRbCallVoidMethod(this,"destroy"); \
196196 }
197197
198198
370370
371371 #define IMPLEMENT_FXTABLE_STUBS(klass,superklass) \
372372 void klass::drawCell(FXDC& dc,FXint sr,FXint er,FXint sc,FXint ec){ \
373 FXRbCallVoidMethod(this,rb_intern("drawCell"),dc,sr,er,sc,ec); \
373 FXRbCallVoidMethod(this,"drawCell",dc,sr,er,sc,ec); \
374374 } \
375375 void klass::public_drawCell(FXDC& dc,FXint sr,FXint er,FXint sc,FXint ec){ \
376376 superklass::drawCell(dc,sr,er,sc,ec); \
377377 } \
378378 void klass::drawRange(FXDC& dc,FXint rlo,FXint rhi,FXint clo,FXint chi){ \
379 FXRbCallVoidMethod(this,rb_intern("drawRange"),dc,rlo,rhi,clo,chi); \
379 FXRbCallVoidMethod(this,"drawRange",dc,rlo,rhi,clo,chi); \
380380 } \
381381 void klass::public_drawRange(FXDC& dc,FXint rlo,FXint rhi,FXint clo,FXint chi){ \
382382 superklass::drawRange(dc,rlo,rhi,clo,chi); \
383383 } \
384384 void klass::drawHGrid(FXDC& dc,FXint rlo,FXint rhi,FXint clo,FXint chi){ \
385 FXRbCallVoidMethod(this,rb_intern("drawHGrid"),dc,rlo,rhi,clo,chi); \
385 FXRbCallVoidMethod(this,"drawHGrid",dc,rlo,rhi,clo,chi); \
386386 } \
387387 void klass::public_drawHGrid(FXDC& dc,FXint rlo,FXint rhi,FXint clo,FXint chi){ \
388388 superklass::drawHGrid(dc,rlo,rhi,clo,chi); \
389389 } \
390390 void klass::drawVGrid(FXDC& dc,FXint rlo,FXint rhi,FXint clo,FXint chi){ \
391 FXRbCallVoidMethod(this,rb_intern("drawVGrid"),dc,rlo,rhi,clo,chi); \
391 FXRbCallVoidMethod(this,"drawVGrid",dc,rlo,rhi,clo,chi); \
392392 } \
393393 void klass::public_drawVGrid(FXDC& dc,FXint rlo,FXint rhi,FXint clo,FXint chi){ \
394394 superklass::drawVGrid(dc,rlo,rhi,clo,chi); \
395395 } \
396396 void klass::drawContents(FXDC& dc,FXint x,FXint y,FXint w,FXint h){ \
397 FXRbCallVoidMethod(this,rb_intern("drawContents"),dc,x,y,w,h); \
397 FXRbCallVoidMethod(this,"drawContents",dc,x,y,w,h); \
398398 } \
399399 void klass::public_drawContents(FXDC& dc,FXint x,FXint y,FXint w,FXint h){ \
400400 superklass::drawContents(dc,x,y,w,h); \
401401 } \
402402 FXTableItem* klass::createItem(const FXString& text,FXIcon* icon,void* ptr){ \
403 return FXRbCallTableItemMethod(this,rb_intern("createItem"),text,icon,ptr); \
403 return FXRbCallTableItemMethod(this,"createItem",text,icon,ptr); \
404404 } \
405405 FXTableItem* klass::public_createItem(const FXString& text,FXIcon* icon,void* ptr){ \
406406 return superklass::createItem(text,icon,ptr); \
407407 } \
408408 void klass::setTableSize(FXint nr,FXint nc,FXbool notify){ \
409 FXRbCallVoidMethod(this,rb_intern("setTableSize"),nr,nc,notify); \
409 FXRbCallVoidMethod(this,"setTableSize",nr,nc,notify); \
410410 } \
411411 void klass::insertRows(FXint row,FXint nr,FXbool notify){ \
412 FXRbCallVoidMethod(this,rb_intern("insertRows"),row,nr,notify); \
412 FXRbCallVoidMethod(this,"insertRows",row,nr,notify); \
413413 } \
414414 void klass::insertColumns(FXint col,FXint nc,FXbool notify){ \
415 FXRbCallVoidMethod(this,rb_intern("insertColumns"),col,nc,notify); \
415 FXRbCallVoidMethod(this,"insertColumns",col,nc,notify); \
416416 } \
417417 void klass::removeRows(FXint row,FXint nr,FXbool notify){ \
418 FXRbCallVoidMethod(this,rb_intern("removeRows"),row,nr,notify); \
418 FXRbCallVoidMethod(this,"removeRows",row,nr,notify); \
419419 } \
420420 void klass::removeColumns(FXint col,FXint nc,FXbool notify){ \
421 FXRbCallVoidMethod(this,rb_intern("removeColumns"),col,nc,notify); \
421 FXRbCallVoidMethod(this,"removeColumns",col,nc,notify); \
422422 } \
423423 FXTableItem* klass::extractItem(FXint row,FXint col,FXbool notify){ \
424 return FXRbCallTableItemMethod(this,rb_intern("extractItem"),row,col,notify); \
424 return FXRbCallTableItemMethod(this,"extractItem",row,col,notify); \
425425 } \
426426 void klass::removeItem(FXint row,FXint col,FXbool notify){ \
427 FXRbCallVoidMethod(this,rb_intern("removeItem"),row,col,notify); \
427 FXRbCallVoidMethod(this,"removeItem",row,col,notify); \
428428 } \
429429 void klass::removeRange(FXint startrow,FXint startcol,FXint endrow,FXint endcol,FXbool notify){ \
430 FXRbCallVoidMethod(this,rb_intern("removeRange"),startrow,startcol,endrow,endcol,notify); \
430 FXRbCallVoidMethod(this,"removeRange",startrow,startcol,endrow,endcol,notify); \
431431 } \
432432 void klass::clearItems(FXbool notify){ \
433 FXRbCallVoidMethod(this,rb_intern("clearItems"),notify); \
433 FXRbCallVoidMethod(this,"clearItems",notify); \
434434 } \
435435 void klass::setColumnWidth(FXint col,FXint cwidth){ \
436 FXRbCallVoidMethod(this,rb_intern("setColumnWidth"),col,cwidth); \
436 FXRbCallVoidMethod(this,"setColumnWidth",col,cwidth); \
437437 } \
438438 void klass::setRowHeight(FXint row,FXint rheight){ \
439 FXRbCallVoidMethod(this,rb_intern("setRowHeight"),row,rheight); \
439 FXRbCallVoidMethod(this,"setRowHeight",row,rheight); \
440440 } \
441441 void klass::setCurrentItem(FXint r,FXint c,FXbool notify){ \
442 FXRbCallVoidMethod(this,rb_intern("setCurrentItem"),r,c,notify); \
442 FXRbCallVoidMethod(this,"setCurrentItem",r,c,notify); \
443443 } \
444444 FXbool klass::selectRow(FXint row,FXbool notify){ \
445 return FXRbCallBoolMethod(this,rb_intern("selectRow"),row,notify); \
445 return FXRbCallBoolMethod(this,"selectRow",row,notify); \
446446 } \
447447 FXbool klass::selectColumn(FXint col,FXbool notify){ \
448 return FXRbCallBoolMethod(this,rb_intern("selectColumn"),col,notify); \
448 return FXRbCallBoolMethod(this,"selectColumn",col,notify); \
449449 } \
450450 FXbool klass::selectRange(FXint sr,FXint er,FXint sc,FXint ec,FXbool notify){ \
451 return FXRbCallBoolMethod(this,rb_intern("selectRange"),sr,er,sc,ec,notify); \
451 return FXRbCallBoolMethod(this,"selectRange",sr,er,sc,ec,notify); \
452452 } \
453453 FXbool klass::extendSelection(FXint r,FXint c,FXbool notify){ \
454 return FXRbCallBoolMethod(this,rb_intern("extendSelection"),r,c,notify); \
454 return FXRbCallBoolMethod(this,"extendSelection",r,c,notify); \
455455 } \
456456 FXbool klass::killSelection(FXbool notify){ \
457 return FXRbCallBoolMethod(this,rb_intern("killSelection"),notify); \
457 return FXRbCallBoolMethod(this,"killSelection",notify); \
458458 } \
459459 void klass::startInput(FXint row,FXint col){ \
460 FXRbCallVoidMethod(this,rb_intern("startInput"),row,col); \
460 FXRbCallVoidMethod(this,"startInput",row,col); \
461461 } \
462462 void klass::cancelInput(){ \
463 FXRbCallVoidMethod(this,rb_intern("cancelInput")); \
463 FXRbCallVoidMethod(this,"cancelInput"); \
464464 } \
465465 void klass::acceptInput(FXbool notify){ \
466 FXRbCallVoidMethod(this,rb_intern("acceptInput"),notify); \
466 FXRbCallVoidMethod(this,"acceptInput",notify); \
467467 } \
468468 void klass::makePositionVisible(FXint r,FXint c){ \
469 FXRbCallVoidMethod(this,rb_intern("makePositionVisible"),r,c); \
469 FXRbCallVoidMethod(this,"makePositionVisible",r,c); \
470470 } \
471471 FXbool klass::enableItem(FXint r,FXint c){ \
472 return FXRbCallBoolMethod(this,rb_intern("enableItem"),r,c); \
472 return FXRbCallBoolMethod(this,"enableItem",r,c); \
473473 } \
474474 FXbool klass::disableItem(FXint r,FXint c){ \
475 return FXRbCallBoolMethod(this,rb_intern("disableItem"),r,c); \
475 return FXRbCallBoolMethod(this,"disableItem",r,c); \
476476 }
477477
478478 class FXRbTable : public FXTable {
2626 #ifndef FXRBTEXT_H
2727 #define FXRBTEXT_H
2828
29 #define DECLARE_FXTEXT_STUBS(klass) \
29 #define DECLARE_FXTEXT_STUBS(klass,subklass) \
30 inline void klass ## _eraseCursorOverhang(klass* self){ \
31 FXASSERT(self->isMemberOf(FXMETACLASS(subklass))); \
32 dynamic_cast<subklass*>(self)->public_eraseCursorOverhang(); \
33 } \
34 inline void klass ## _drawCursor(klass* self,FXuint state){ \
35 FXASSERT(self->isMemberOf(FXMETACLASS(subklass))); \
36 dynamic_cast<subklass*>(self)->public_drawCursor(state); \
37 } \
38 inline FXuint klass ## _style(klass* self,FXint row,FXint beg,FXint end,FXint pos){ \
39 FXASSERT(self->isMemberOf(FXMETACLASS(subklass))); \
40 return dynamic_cast<subklass*>(self)->public_style(row, beg, end, pos); \
41 } \
42 inline void klass ## _drawBufferText(klass* self,FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h,FXint pos,FXint n,FXuint style){ \
43 FXASSERT(self->isMemberOf(FXMETACLASS(subklass))); \
44 dynamic_cast<subklass*>(self)->public_drawBufferText(dc, x, y, w, h, pos, n, style); \
45 } \
46 inline void klass ## _fillBufferRect(klass* self,FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h,FXuint style){ \
47 FXASSERT(self->isMemberOf(FXMETACLASS(subklass))); \
48 dynamic_cast<subklass*>(self)->public_fillBufferRect(dc, x, y, w, h, style); \
49 } \
50 inline void klass ## _drawTextRow(klass* self,FXDCWindow& dc,FXint line,FXint left,FXint right){ \
51 FXASSERT(self->isMemberOf(FXMETACLASS(subklass))); \
52 dynamic_cast<subklass*>(self)->public_drawTextRow(dc, line, left, right); \
53 } \
54 inline void klass ## _drawContents(klass* self,FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h){ \
55 FXASSERT(self->isMemberOf(FXMETACLASS(subklass))); \
56 dynamic_cast<subklass*>(self)->public_drawContents(dc, x, y, w, h); \
57 } \
58 inline void klass ## _drawNumbers(klass* self,FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h){ \
59 FXASSERT(self->isMemberOf(FXMETACLASS(subklass))); \
60 dynamic_cast<subklass*>(self)->public_drawNumbers(dc, x, y, w, h); \
61 } \
3062 inline void klass ## _setCursorPos(klass* self,FXint pos,FXbool notify){ \
3163 self->klass::setCursorPos(pos,notify); \
3264 } \
71103 }
72104
73105
74 #define IMPLEMENT_FXTEXT_STUBS(cls) \
106 #define IMPLEMENT_FXTEXT_STUBS(cls,superklass) \
107 void cls::eraseCursorOverhang(){ \
108 FXRbCallVoidMethod(this,"eraseCursorOverhang"); \
109 } \
110 void cls::public_eraseCursorOverhang(){ \
111 superklass::eraseCursorOverhang(); \
112 } \
113 void cls::drawCursor(FXuint state){ \
114 FXRbCallVoidMethod(this,"drawCursor", state); \
115 } \
116 void cls::public_drawCursor(FXuint state){ \
117 superklass::drawCursor(state); \
118 } \
119 FXuint cls::style(FXint row,FXint beg,FXint end,FXint pos){ \
120 return FXRbCallUIntMethod(this,"style", row, beg, end, pos); \
121 } \
122 FXuint cls::public_style(FXint row,FXint beg,FXint end,FXint pos){ \
123 return superklass::style(row, beg, end, pos); \
124 } \
125 void cls::drawBufferText(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h,FXint pos,FXint n,FXuint style){ \
126 FXRbCallVoidMethod(this,"drawBufferText", dc, x, y, w, h, pos, n, style); \
127 } \
128 void cls::public_drawBufferText(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h,FXint pos,FXint n,FXuint style){ \
129 superklass::drawBufferText(dc, x, y, w, h, pos, n, style); \
130 } \
131 void cls::fillBufferRect(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h,FXuint style){ \
132 FXRbCallVoidMethod(this,"fillBufferRect", dc, x, y, w, h, style); \
133 } \
134 void cls::public_fillBufferRect(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h,FXuint style){ \
135 superklass::fillBufferRect(dc, x, y, w, h, style); \
136 } \
137 void cls::drawTextRow(FXDCWindow& dc,FXint line,FXint left,FXint right){ \
138 FXRbCallVoidMethod(this,"drawTextRow", dc, line, left, right); \
139 } \
140 void cls::public_drawTextRow(FXDCWindow& dc,FXint line,FXint left,FXint right){ \
141 superklass::drawTextRow(dc, line, left, right); \
142 } \
143 void cls::drawContents(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h){ \
144 FXRbCallVoidMethod(this,"drawContents", dc, x, y, w, h); \
145 } \
146 void cls::public_drawContents(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h){ \
147 superklass::drawContents(dc, x, y, w, h); \
148 } \
149 void cls::drawNumbers(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h){ \
150 FXRbCallVoidMethod(this,"drawNumbers", dc, x, y, w, h); \
151 } \
152 void cls::public_drawNumbers(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h){ \
153 superklass::drawNumbers(dc, x, y, w, h); \
154 } \
75155 void cls::setCursorPos(FXint pos,FXbool notify){ \
76 FXRbCallVoidMethod(this,rb_intern("setCursorPos"),pos,notify); \
156 FXRbCallVoidMethod(this,"setCursorPos",pos,notify); \
77157 } \
78158 FXbool cls::extendSelection(FXint pos,FXTextSelectionMode mode,FXbool notify){ \
79 return FXRbCallBoolMethod(this,rb_intern("extendSelection"),pos,mode,notify); \
159 return FXRbCallBoolMethod(this,"extendSelection",pos,mode,notify); \
80160 } \
81161 FXbool cls::killSelection(FXbool notify){ \
82 return FXRbCallBoolMethod(this,rb_intern("killSelection"),notify); \
162 return FXRbCallBoolMethod(this,"killSelection",notify); \
83163 } \
84164 void cls::replaceText(FXint pos,FXint m,const FXchar *text,FXint n,FXbool notify){ \
85 FXRbCallVoidMethod(this,rb_intern("replaceText"),pos,m,FXString(text,n),notify); \
165 FXRbCallVoidMethod(this,"replaceText",pos,m,FXString(text,n),notify); \
86166 } \
87167 void cls::replaceText(FXint pos,FXint m,const FXString& text,FXbool notify){ \
88 FXRbCallVoidMethod(this,rb_intern("replaceText"),pos,m,text,notify); \
168 FXRbCallVoidMethod(this,"replaceText",pos,m,text,notify); \
89169 } \
90170 void cls::replaceStyledText(FXint pos,FXint m,const FXchar *text,FXint n,FXint style,FXbool notify){ \
91 FXRbCallVoidMethod(this,rb_intern("replaceStyledText"),pos,m,FXString(text,n),style,notify); \
171 FXRbCallVoidMethod(this,"replaceStyledText",pos,m,FXString(text,n),style,notify); \
92172 } \
93173 void cls::replaceStyledText(FXint pos,FXint m,const FXString& text,FXint style,FXbool notify){ \
94 FXRbCallVoidMethod(this,rb_intern("replaceStyledText"),pos,m,text,style,notify); \
174 FXRbCallVoidMethod(this,"replaceStyledText",pos,m,text,style,notify); \
95175 } \
96176 void cls::appendText(const FXchar *text,FXint n,FXbool notify){ \
97 FXRbCallVoidMethod(this,rb_intern("appendText"),FXString(text,n),notify); \
177 FXRbCallVoidMethod(this,"appendText",FXString(text,n),notify); \
98178 } \
99179 void cls::appendText(const FXString& text,FXbool notify){ \
100 FXRbCallVoidMethod(this,rb_intern("appendText"),text,notify); \
180 FXRbCallVoidMethod(this,"appendText",text,notify); \
101181 } \
102182 void cls::appendStyledText(const FXchar *text,FXint n,FXint style,FXbool notify){ \
103 FXRbCallVoidMethod(this,rb_intern("appendStyledText"),FXString(text,n),style,notify); \
183 FXRbCallVoidMethod(this,"appendStyledText",FXString(text,n),style,notify); \
104184 } \
105185 void cls::appendStyledText(const FXString& text,FXint style,FXbool notify){ \
106 FXRbCallVoidMethod(this,rb_intern("appendStyledText"),text,style,notify); \
186 FXRbCallVoidMethod(this,"appendStyledText",text,style,notify); \
107187 } \
108188 void cls::insertText(FXint pos,const FXchar *text,FXint n,FXbool notify){ \
109 FXRbCallVoidMethod(this,rb_intern("insertText"),pos,FXString(text,n),notify); \
189 FXRbCallVoidMethod(this,"insertText",pos,FXString(text,n),notify); \
110190 } \
111191 void cls::insertText(FXint pos,const FXString& text,FXbool notify){ \
112 FXRbCallVoidMethod(this,rb_intern("insertText"),pos,text,notify); \
192 FXRbCallVoidMethod(this,"insertText",pos,text,notify); \
113193 } \
114194 void cls::insertStyledText(FXint pos,const FXchar *text,FXint n,FXint style,FXbool notify){ \
115 FXRbCallVoidMethod(this,rb_intern("insertStyledText"),pos,FXString(text,n),style,notify); \
195 FXRbCallVoidMethod(this,"insertStyledText",pos,FXString(text,n),style,notify); \
116196 } \
117197 void cls::insertStyledText(FXint pos,const FXString& text,FXint style,FXbool notify){ \
118 FXRbCallVoidMethod(this,rb_intern("insertStyledText"),pos,text,style,notify); \
198 FXRbCallVoidMethod(this,"insertStyledText",pos,text,style,notify); \
119199 } \
120200 void cls::removeText(FXint pos,FXint n,FXbool notify){ \
121 FXRbCallVoidMethod(this,rb_intern("removeText"),pos,n,notify); \
201 FXRbCallVoidMethod(this,"removeText",pos,n,notify); \
122202 } \
123203 void cls::changeStyle(FXint pos,FXint n,FXint style){ \
124 FXRbCallVoidMethod(this,rb_intern("changeStyle"),pos,n,style); \
204 FXRbCallVoidMethod(this,"changeStyle",pos,n,style); \
125205 } \
126206 void cls::changeStyle(FXint pos,const FXchar* style,FXint n){ \
127 FXRbCallVoidMethod(this,rb_intern("changeStyle"),pos,FXString(style,n)); \
207 FXRbCallVoidMethod(this,"changeStyle",pos,FXString(style,n)); \
128208 } \
129209 void cls::changeStyle(FXint pos,const FXString& style){ \
130 FXRbCallVoidMethod(this,rb_intern("changeStyle"),pos,style); \
210 FXRbCallVoidMethod(this,"changeStyle",pos,style); \
131211 } \
132212 void cls::setText(const FXchar* text,FXint n,FXbool notify){ \
133 FXRbCallVoidMethod(this,rb_intern("setText"),FXString(text,n),notify); \
213 FXRbCallVoidMethod(this,"setText",FXString(text,n),notify); \
134214 } \
135215 void cls::setText(const FXString& text,FXbool notify){ \
136 FXRbCallVoidMethod(this,rb_intern("setText"),text,notify); \
216 FXRbCallVoidMethod(this,"setText",text,notify); \
137217 } \
138218 void cls::setStyledText(const FXchar* text,FXint n,FXint style,FXbool notify){ \
139 FXRbCallVoidMethod(this,rb_intern("setStyledText"),FXString(text,n),style,notify); \
219 FXRbCallVoidMethod(this,"setStyledText",FXString(text,n),style,notify); \
140220 } \
141221 void cls::setStyledText(const FXString& text,FXint style,FXbool notify){ \
142 FXRbCallVoidMethod(this,rb_intern("setStyledText"),text,style,notify); \
222 FXRbCallVoidMethod(this,"setStyledText",text,style,notify); \
143223 }
144224
145225
0 protected:
1 // Overrides the base class versions of these virtual functions
2 virtual void eraseCursorOverhang();
3 virtual void drawCursor(FXuint state);
4 virtual FXuint style(FXint row,FXint beg,FXint end,FXint pos);
5 virtual void drawBufferText(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h,FXint pos,FXint n,FXuint style);
6 virtual void fillBufferRect(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h,FXuint style);
7 virtual void drawTextRow(FXDCWindow& dc,FXint line,FXint left,FXint right);
8 virtual void drawContents(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
9 virtual void drawNumbers(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
10
11 public:
12 // Publically accessible versions of those protected functions
13 void public_eraseCursorOverhang();
14 void public_drawCursor(FXuint state);
15 FXuint public_style(FXint row,FXint beg,FXint end,FXint pos);
16 void public_drawBufferText(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h,FXint pos,FXint n,FXuint style);
17 void public_fillBufferRect(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h,FXuint style);
18 void public_drawTextRow(FXDCWindow& dc,FXint line,FXint left,FXint right);
19 void public_drawContents(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
20 void public_drawNumbers(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
21
022 public:
123 // Overrides the base class version of setCursorPos()
224 virtual void setCursorPos(FXint pos,FXbool notify=FALSE);
4646
4747 #define IMPLEMENT_FXTOPWINDOW_STUBS(cls) \
4848 void cls::show(FXuint placement){ \
49 FXRbCallVoidMethod(this,rb_intern("show"),placement); \
49 FXRbCallVoidMethod(this,"show",placement); \
5050 } \
5151 FXbool cls::maximize(FXbool notify){ \
52 return FXRbCallBoolMethod(this,rb_intern("maximize"),notify); \
52 return FXRbCallBoolMethod(this,"maximize",notify); \
5353 } \
5454 FXbool cls::minimize(FXbool notify){ \
55 return FXRbCallBoolMethod(this,rb_intern("minimize"),notify); \
55 return FXRbCallBoolMethod(this,"minimize",notify); \
5656 } \
5757 FXbool cls::restore(FXbool notify){ \
58 return FXRbCallBoolMethod(this,rb_intern("restore"),notify); \
58 return FXRbCallBoolMethod(this,"restore",notify); \
5959 } \
6060 FXbool cls::close(FXbool notify){ \
61 return FXRbCallBoolMethod(this,rb_intern("close"),notify); \
61 return FXRbCallBoolMethod(this,"close",notify); \
6262 }
6363
6464
3434
3535 #define IMPLEMENT_FXTRANSLATOR_STUBS(cls) \
3636 const FXchar* cls::tr(const FXchar* context,const FXchar* message,const FXchar* hint) const { \
37 return FXRbCallCStringMethod(this,rb_intern("tr"),context,message,hint); \
37 return FXRbCallCStringMethod(this,"tr",context,message,hint); \
3838 }
3939
4040 class FXRbTranslator : public FXTranslator {
7373
7474 #define IMPLEMENT_FXTREEITEM_STUBS(klass,superklass) \
7575 void klass::setText(const FXString& txt){ \
76 FXRbCallVoidMethod(this,rb_intern("setText"),txt); \
76 FXRbCallVoidMethod(this,"setText",txt); \
7777 } \
7878 void klass::setOpenIcon(FXIcon* icn,FXbool owned){ \
79 FXRbCallVoidMethod(this,rb_intern("setOpenIcon"),icn,owned); \
79 FXRbCallVoidMethod(this,"setOpenIcon",icn,owned); \
8080 } \
8181 void klass::setClosedIcon(FXIcon* icn,FXbool owned){ \
82 FXRbCallVoidMethod(this,rb_intern("setClosedIcon"),icn,owned); \
82 FXRbCallVoidMethod(this,"setClosedIcon",icn,owned); \
8383 } \
8484 void klass::setFocus(FXbool focus){ \
8585 if(NIL_P(FXRbGetRubyObj(this,false))){ \
8686 superklass::setFocus(focus); \
8787 } \
8888 else{ \
89 FXRbCallVoidMethod(this,rb_intern("setFocus"),focus); \
89 FXRbCallVoidMethod(this,"setFocus",focus); \
9090 } \
9191 } \
9292 void klass::setSelected(FXbool selected){ \
93 FXRbCallVoidMethod(this,rb_intern("setSelected"),selected); \
93 FXRbCallVoidMethod(this,"setSelected",selected); \
9494 } \
9595 void klass::setOpened(FXbool opened){ \
96 FXRbCallVoidMethod(this,rb_intern("setOpened"),opened); \
96 FXRbCallVoidMethod(this,"setOpened",opened); \
9797 } \
9898 void klass::setExpanded(FXbool expanded){ \
99 FXRbCallVoidMethod(this,rb_intern("setExpanded"),expanded); \
99 FXRbCallVoidMethod(this,"setExpanded",expanded); \
100100 } \
101101 void klass::setEnabled(FXbool enabled){ \
102 FXRbCallVoidMethod(this,rb_intern("setEnabled"),enabled); \
102 FXRbCallVoidMethod(this,"setEnabled",enabled); \
103103 } \
104104 void klass::setDraggable(FXbool draggable){ \
105 FXRbCallVoidMethod(this,rb_intern("setDraggable"),draggable); \
105 FXRbCallVoidMethod(this,"setDraggable",draggable); \
106106 } \
107107 FXint klass::getWidth(const FXTreeList* list) const { \
108 return FXRbCallIntMethod(this,rb_intern("getWidth"),list); \
108 return FXRbCallIntMethod(this,"getWidth",list); \
109109 } \
110110 FXint klass::getHeight(const FXTreeList* list) const { \
111 return FXRbCallIntMethod(this,rb_intern("getHeight"),list); \
111 return FXRbCallIntMethod(this,"getHeight",list); \
112112 } \
113113 void klass::create(){ \
114 FXRbCallVoidMethod(this,rb_intern("create")); \
114 FXRbCallVoidMethod(this,"create"); \
115115 } \
116116 void klass::detach(){ \
117 FXRbCallVoidMethod(this,rb_intern("detach")); \
117 FXRbCallVoidMethod(this,"detach"); \
118118 } \
119119 void klass::destroy(){ \
120 FXRbCallVoidMethod(this,rb_intern("destroy")); \
120 FXRbCallVoidMethod(this,"destroy"); \
121121 }
122122
123123
194194
195195 #define IMPLEMENT_FXTREELIST_STUBS(cls) \
196196 FXbool cls::selectItem(FXTreeItem* item,FXbool notify){ \
197 return FXRbCallBoolMethod(this,rb_intern("selectItem"),item,notify); \
197 return FXRbCallBoolMethod(this,"selectItem",item,notify); \
198198 } \
199199 FXbool cls::deselectItem(FXTreeItem* item,FXbool notify){ \
200 return FXRbCallBoolMethod(this,rb_intern("deselectItem"),item,notify); \
200 return FXRbCallBoolMethod(this,"deselectItem",item,notify); \
201201 } \
202202 FXbool cls::toggleItem(FXTreeItem* item,FXbool notify){ \
203 return FXRbCallBoolMethod(this,rb_intern("toggleItem"),item,notify); \
203 return FXRbCallBoolMethod(this,"toggleItem",item,notify); \
204204 } \
205205 FXbool cls::extendSelection(FXTreeItem* item,FXbool notify){ \
206 return FXRbCallBoolMethod(this,rb_intern("extendSelection"),item,notify); \
206 return FXRbCallBoolMethod(this,"extendSelection",item,notify); \
207207 } \
208208 FXbool cls::killSelection(FXbool notify){ \
209 return FXRbCallBoolMethod(this,rb_intern("killSelection"),notify); \
209 return FXRbCallBoolMethod(this,"killSelection",notify); \
210210 } \
211211 FXbool cls::openItem(FXTreeItem* item,FXbool notify){ \
212 return FXRbCallBoolMethod(this,rb_intern("openItem"),item,notify); \
212 return FXRbCallBoolMethod(this,"openItem",item,notify); \
213213 } \
214214 FXbool cls::closeItem(FXTreeItem* item,FXbool notify){ \
215 return FXRbCallBoolMethod(this,rb_intern("closeItem"),item,notify); \
215 return FXRbCallBoolMethod(this,"closeItem",item,notify); \
216216 } \
217217 FXbool cls::collapseTree(FXTreeItem* tree,FXbool notify){ \
218 return FXRbCallBoolMethod(this,rb_intern("collapseTree"),tree,notify); \
218 return FXRbCallBoolMethod(this,"collapseTree",tree,notify); \
219219 } \
220220 FXbool cls::expandTree(FXTreeItem* tree,FXbool notify){ \
221 return FXRbCallBoolMethod(this,rb_intern("expandTree"),tree,notify); \
221 return FXRbCallBoolMethod(this,"expandTree",tree,notify); \
222222 } \
223223 void cls::setCurrentItem(FXTreeItem* item,FXbool notify){ \
224 FXRbCallVoidMethod(this,rb_intern("setCurrentItem"),item,notify); \
224 FXRbCallVoidMethod(this,"setCurrentItem",item,notify); \
225225 } \
226226 FXTreeItem* cls::getItemAt(FXint x,FXint y) const { \
227 return FXRbCallTreeItemMethod(this,rb_intern("getItemAt"),x,y); \
227 return FXRbCallTreeItemMethod(this,"getItemAt",x,y); \
228228 } \
229229 void cls::makeItemVisible(FXTreeItem* item) { \
230 FXRbCallVoidMethod(this,rb_intern("makeItemVisible"),item); \
230 FXRbCallVoidMethod(this,"makeItemVisible",item); \
231231 } \
232232 FXbool cls::enableItem(FXTreeItem* item){ \
233 return FXRbCallBoolMethod(this,rb_intern("enableItem"),item); \
233 return FXRbCallBoolMethod(this,"enableItem",item); \
234234 } \
235235 FXbool cls::disableItem(FXTreeItem* item){ \
236 return FXRbCallBoolMethod(this,rb_intern("disableItem"),item); \
236 return FXRbCallBoolMethod(this,"disableItem",item); \
237237 }
238238
239239
3333
3434 #define IMPLEMENT_FXTREELISTBOX_STUBS(cls) \
3535 void cls::setCurrentItem(FXTreeItem* item,FXbool notify){ \
36 FXRbCallVoidMethod(this,rb_intern("setCurrentItem"),item,notify); \
36 FXRbCallVoidMethod(this,"setCurrentItem",item,notify); \
3737 }
3838
3939 class FXRbTreeListBox : public FXTreeListBox {
124124
125125 #define IMPLEMENT_FXWINDOW_STUBS(cls) \
126126 void cls::layout(){ \
127 FXRbCallVoidMethod(this,rb_intern("layout")); \
127 FXRbCallVoidMethod(this,"layout"); \
128128 } \
129129 FXint cls::getDefaultWidth(){ \
130 return FXRbCallIntMethod(this,rb_intern("getDefaultWidth")); \
130 return FXRbCallIntMethod(this,"getDefaultWidth"); \
131131 } \
132132 FXint cls::getDefaultHeight(){ \
133 return FXRbCallIntMethod(this,rb_intern("getDefaultHeight")); \
133 return FXRbCallIntMethod(this,"getDefaultHeight"); \
134134 } \
135135 FXint cls::getWidthForHeight(FXint givenheight){ \
136 return FXRbCallIntMethod(this,rb_intern("getWidthForHeight"),givenheight); \
136 return FXRbCallIntMethod(this,"getWidthForHeight",givenheight); \
137137 } \
138138 FXint cls::getHeightForWidth(FXint givenwidth){ \
139 return FXRbCallIntMethod(this,rb_intern("getHeightForWidth"),givenwidth); \
139 return FXRbCallIntMethod(this,"getHeightForWidth",givenwidth); \
140140 } \
141141 bool cls::canFocus() const { \
142 return FXRbCallBoolMethod(this,rb_intern("canFocus")); \
142 return FXRbCallBoolMethod(this,"canFocus"); \
143143 } \
144144 void cls::setFocus(){ \
145 FXRbCallVoidMethod(this,rb_intern("setFocus")); \
145 FXRbCallVoidMethod(this,"setFocus"); \
146146 } \
147147 void cls::killFocus(){ \
148 FXRbCallVoidMethod(this,rb_intern("killFocus")); \
148 FXRbCallVoidMethod(this,"killFocus"); \
149149 } \
150150 void cls::changeFocus(FXWindow* child){ \
151 if(!FXRbIsInGC(this)) FXRbCallVoidMethod(this,rb_intern("changeFocus"),child); \
151 if(!FXRbIsInGC(this)) FXRbCallVoidMethod(this,"changeFocus",child); \
152152 } \
153153 void cls::setDefault(FXbool enable){ \
154 FXRbCallVoidMethod(this,rb_intern("setDefault"),enable); \
154 FXRbCallVoidMethod(this,"setDefault",enable); \
155155 } \
156156 void cls::enable(){ \
157 FXRbCallVoidMethod(this,rb_intern("enable")); \
157 FXRbCallVoidMethod(this,"enable"); \
158158 } \
159159 void cls::disable(){ \
160 FXRbCallVoidMethod(this,rb_intern("disable")); \
160 FXRbCallVoidMethod(this,"disable"); \
161161 } \
162162 void cls::raise(){ \
163 FXRbCallVoidMethod(this,rb_intern("raiseWindow")); \
163 FXRbCallVoidMethod(this,"raiseWindow"); \
164164 } \
165165 void cls::lower(){ \
166 FXRbCallVoidMethod(this,rb_intern("lower")); \
166 FXRbCallVoidMethod(this,"lower"); \
167167 } \
168168 void cls::move(FXint x,FXint y){ \
169 FXRbCallVoidMethod(this,rb_intern("move"),x,y); \
169 FXRbCallVoidMethod(this,"move",x,y); \
170170 } \
171171 void cls::position(FXint x,FXint y,FXint w,FXint h){ \
172 FXRbCallVoidMethod(this,rb_intern("position"),x,y,w,h); \
172 FXRbCallVoidMethod(this,"position",x,y,w,h); \
173173 } \
174174 void cls::recalc(){ \
175 if(!FXRbIsInGC(this)) FXRbCallVoidMethod(this,rb_intern("recalc")); \
175 if(!FXRbIsInGC(this)) FXRbCallVoidMethod(this,"recalc"); \
176176 } \
177177 void cls::reparent(FXWindow* father,FXWindow* other){ \
178 FXRbCallVoidMethod(this,rb_intern("reparent"),father,other); \
178 FXRbCallVoidMethod(this,"reparent",father,other); \
179179 } \
180180 void cls::show(){ \
181 FXRbCallVoidMethod(this,rb_intern("show")); \
181 FXRbCallVoidMethod(this,"show"); \
182182 } \
183183 void cls::hide(){ \
184 FXRbCallVoidMethod(this,rb_intern("hide")); \
184 FXRbCallVoidMethod(this,"hide"); \
185185 } \
186186 bool cls::isComposite() const { \
187 return FXRbCallBoolMethod(this,rb_intern("isComposite")); \
187 return FXRbCallBoolMethod(this,"isComposite"); \
188188 } \
189189 bool cls::contains(FXint parentx,FXint parenty) const{ \
190 return FXRbCallBoolMethod(this,rb_intern("contains"),parentx,parenty); \
190 return FXRbCallBoolMethod(this,"contains",parentx,parenty); \
191191 } \
192192 bool cls::doesSaveUnder() const { \
193 return FXRbCallBoolMethod(this,rb_intern("doesSaveUnder")); \
193 return FXRbCallBoolMethod(this,"doesSaveUnder"); \
194194 } \
195195 void cls::setBackColor(FXColor clr) { \
196 FXRbCallVoidMethod(this,rb_intern("setBackColor"),clr); \
196 FXRbCallVoidMethod(this,"setBackColor",clr); \
197197 } \
198198 const FXchar* cls::tr(const FXchar* message,const FXchar* hint) const { \
199 return FXRbCallCStringMethod(this,rb_intern("tr"),message,hint); \
199 return FXRbCallCStringMethod(this,"tr",message,hint); \
200200 } \
201201 void cls::setShape(const FXRegion& region) { \
202 FXRbCallVoidMethod(this,rb_intern("setShape"),region); \
202 FXRbCallVoidMethod(this,"setShape",region); \
203203 } \
204204 void cls::setShape(FXBitmap* bitmap) { \
205 FXRbCallVoidMethod(this,rb_intern("setShape"),bitmap); \
205 FXRbCallVoidMethod(this,"setShape",bitmap); \
206206 } \
207207 void cls::setShape(FXIcon* icon) { \
208 FXRbCallVoidMethod(this,rb_intern("setShape"),icon); \
208 FXRbCallVoidMethod(this,"setShape",icon); \
209209 } \
210210 void cls::clearShape() { \
211 FXRbCallVoidMethod(this,rb_intern("clearShape")); \
211 FXRbCallVoidMethod(this,"clearShape"); \
212212 } \
213213 void cls::dropEnable() { \
214 FXRbCallVoidMethod(this,rb_intern("dropEnable")); \
214 FXRbCallVoidMethod(this,"dropEnable"); \
215215 } \
216216 void cls::dropDisable() { \
217 FXRbCallVoidMethod(this,rb_intern("dropDisable")); \
217 FXRbCallVoidMethod(this,"dropDisable"); \
218218 }
219219
220220 class FXRbWindow : public FXWindow {
2626 #ifndef FXRUBY_H
2727 #define FXRUBY_H
2828
29 // RARRAY_LEN, RARRAY_PTR, RSTRING_LEN and RSTRING_PTR macros not defined before Ruby 1.8.6
30 #ifndef RARRAY_LEN
31 #define RARRAY_LEN(a) RARRAY((a))->len
32 #endif
33 #ifndef RARRAY_PTR
34 #define RARRAY_PTR(a) RARRAY((a))->ptr
35 #endif
36 #ifndef RSTRING_LEN
37 #define RSTRING_LEN(s) RSTRING((s))->len
38 #endif
39 #ifndef RSTRING_PTR
40 #define RSTRING_PTR(s) RSTRING((s))->ptr
41 #endif
42
4329 #ifndef NUM2SIZET
4430 #define NUM2SIZET(s) NUM2ULONG(s)
4531 #endif
5440 extern "C" {
5541 static const char * SWIG_TypeName(const swig_type_info *ty);
5642 static VALUE SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int own);
57 #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
58 typedef void (*ruby_owntype)(void*);
59 static int SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, ruby_owntype *own);
43 static int FXSWIG_ConvertPtr(VALUE obj, void **ptr, swig_type_info *ty, int flags);
6044 }
6145
6246 // Helper for overloaded show() functions
6347 template <class TYPE>
6448 VALUE showHelper(VALUE self, int argc, VALUE *argv, TYPE *p, swig_type_info *typeinfo) {
6549 TYPE *win;
66 SWIG_ConvertPtr(self,(void**)&win,typeinfo,1);
50 FXSWIG_ConvertPtr(self,(void**)&win,typeinfo,1);
6751 if (argc == 0) {
6852 win->_show();
6953 }
7963
8064 // Wrapper around SWIG_Ruby_NewPointerObj()
8165 VALUE FXRbNewPointerObj(void *ptr, swig_type_info *typeinfo);
66 VALUE FXRbNewPointerObjCb(void *ptr, swig_type_info *typeinfo);
8267 bool FXRbIsBorrowed(void* ptr);
8368 bool FXRbSetInGC(const void* ptr, bool enabled);
8469 bool FXRbIsInGC(const void* ptr);
9075 void* FXRbConvertPtr(VALUE obj,swig_type_info* typeinfo);
9176
9277 // Returns an FXInputHandle for this Ruby file object
93 FXInputHandle FXRbGetReadFileHandle(VALUE obj);
94 FXInputHandle FXRbGetWriteFileHandle(VALUE obj);
78 FXInputHandle FXRbGetReadFileHandle(VALUE obj,FXuint mode);
79 FXInputHandle FXRbGetWriteFileHandle(VALUE obj,FXuint mode);
80 void FXRbRemoveReadFileHandle(VALUE obj,FXuint mode);
81 void FXRbRemoveWriteFileHandle(VALUE obj,FXuint mode);
9582
9683 // Register mapping from Ruby objects to FOX objects
9784 void FXRbRegisterRubyObj(VALUE rubyObj, const void* foxObj);
116103 * FOX object (if any). If searchBoth is false, only considers the
117104 * Ruby-owned objects; otherwise considers all outstanding references.
118105 */
119 VALUE FXRbGetRubyObj(const void *foxObj, bool searchBoth);
106 VALUE FXRbGetRubyObj(const void *foxObj, bool searchBoth, bool in_gc_mark=false);
120107
121108 /**
122109 * Return the registered Ruby class instance associated with this
124111 */
125112 VALUE FXRbGetRubyObj(const void *foxObj, const char *type);
126113 VALUE FXRbGetRubyObj(const void *foxObj, swig_type_info *type);
114 VALUE FXRbGetRubyObjCb(const void *foxObj, swig_type_info *type);
115
127116
128117 // Mark this object as used for the garbage collector
129118 void FXRbGcMark(void *obj);
167156 extern void* FXRbGetExpectedData(VALUE recv,FXSelector key,VALUE data);
168157
169158 // Returns the name of the message handler function (or NULL)
170 ID FXRbLookupHandler(FXObject* recv,FXSelector key);
159 ID FXRbLookupHandler_gvlcb(FXObject* recv,FXSelector key);
171160
172161 // Handle this message
173 long FXRbHandleMessage(FXObject* recv,ID func,FXObject* sender,FXSelector key,void* data);
162 long FXRbHandleMessage_gvlcb(FXObject* recv,ID func,FXObject* sender,FXSelector key,void* data);
174163
175164 // Convert a signal name string to its corresponding signal number
176165 FXint FXRbSignalNameToNumber(const char* name);
320309 inline VALUE to_ruby(FXDC& dc){
321310 return FXRbGetRubyObj(reinterpret_cast<void*>(&dc),FXRbTypeQuery("FXDC *"));
322311 }
312
313
314
315
316 extern VALUE to_ruby_cb(const FXObject* obj);
317
318 inline VALUE to_ruby_cb(const FXRangef& range){
319 return FXRbNewPointerObjCb(static_cast<void*>(const_cast<FXRangef*>(&range)), FXRbTypeQuery("FXRangef *"));
320 }
321
322 inline VALUE to_ruby_cb(FXStream& store){
323 return (VALUE) 0; // FIXME
324 }
325
326 inline VALUE to_ruby_cb(const FXPoint* point){
327 return FXRbNewPointerObjCb(static_cast<void*>(const_cast<FXPoint*>(point)), FXRbTypeQuery("FXPoint *"));
328 }
329
330 inline VALUE to_ruby_cb(const FXSegment* segment){
331 return FXRbNewPointerObjCb(static_cast<void*>(const_cast<FXSegment*>(segment)), FXRbTypeQuery("FXSegment *"));
332 }
333
334 inline VALUE to_ruby_cb(const FXRectangle* rect){
335 return FXRbNewPointerObjCb(static_cast<void*>(const_cast<FXRectangle*>(rect)), FXRbTypeQuery("FXRectangle *"));
336 }
337
338 inline VALUE to_ruby_cb(const FXRectangle& rect){
339 return FXRbNewPointerObjCb(static_cast<void*>(const_cast<FXRectangle*>(&rect)), FXRbTypeQuery("FXRectangle *"));
340 }
341
342 inline VALUE to_ruby_cb(const FXArc* arc){
343 return FXRbNewPointerObjCb(static_cast<void*>(const_cast<FXArc*>(arc)), FXRbTypeQuery("FXArc *"));
344 }
345
346 inline VALUE to_ruby_cb(FXEvent* event){
347 return FXRbGetRubyObjCb(reinterpret_cast<void*>(event), FXRbTypeQuery("FXEvent *"));
348 }
349
350 inline VALUE to_ruby_cb(FXFontDesc* fontdesc){
351 return FXRbNewPointerObjCb(reinterpret_cast<void*>(fontdesc), FXRbTypeQuery("FXFontDesc *"));
352 }
353
354 inline VALUE to_ruby_cb(const FXFontDesc& fontdesc){
355 return FXRbNewPointerObjCb(reinterpret_cast<void*>(const_cast<FXFontDesc*>(&fontdesc)), FXRbTypeQuery("FXFontDesc *"));
356 }
357
358 inline VALUE to_ruby_cb(FXDC& dc){
359 return FXRbGetRubyObjCb(reinterpret_cast<void*>(&dc), FXRbTypeQuery("FXDC *"));
360 }
361 inline VALUE to_ruby_cb(FXDCWindow& dc){
362 return FXRbGetRubyObjCb(reinterpret_cast<void*>(&dc), FXRbTypeQuery("FXDCWindow *"));
363 }
364
365 template<class TYPE>
366 VALUE to_ruby_cb(TYPE obj){
367 return to_ruby(obj);
368 }
369
323370
324371 /**
325372 * Remember: FXID is typedef'd as an unsigned int on non-Windows platforms,
350397 void FXRbRange2LoHi(VALUE range,FXdouble& lo,FXdouble& hi);
351398
352399 // Call function with "void" return value
353 void FXRbCallVoidMethod(FXObject* recv,ID func);
354
355 void FXRbCallVoidMethod(FXDC* recv,ID func);
400 void FXRbCallVoidMethod_gvlcb(FXObject* recv,const char *func);
401
402 void FXRbCallVoidMethod_gvlcb(FXDC* recv,const char *func);
356403
357404 /* One argument */
358405 template<class TYPE>
359 void FXRbCallVoidMethod(FXObject* recv,ID func, TYPE& arg){
406 void FXRbCallVoidMethod_gvlcb(FXObject* recv,const char *func, TYPE& arg){
360407 VALUE obj=FXRbGetRubyObj(recv,false);
361408 FXASSERT(!NIL_P(obj));
362409 FXASSERT(!FXRbIsInGC(recv));
363 rb_funcall(obj,func,1,to_ruby(arg));
410 rb_funcall(obj,rb_intern(func),1,to_ruby_cb(arg));
364411 }
365412
366413 template<class TYPE>
367 void FXRbCallVoidMethod(FXDC* recv,ID func,TYPE arg){
368 VALUE obj=FXRbGetRubyObj(recv,false);
369 FXASSERT(!NIL_P(obj));
370 rb_funcall(obj,func,1,to_ruby(arg));
414 void FXRbCallVoidMethod_gvlcb(FXDC* recv,const char *func,TYPE arg){
415 VALUE obj=FXRbGetRubyObj(recv,false);
416 FXASSERT(!NIL_P(obj));
417 rb_funcall(obj,rb_intern(func),1,to_ruby_cb(arg));
371418 }
372419
373420 template<class TYPE>
374 void FXRbCallVoidMethod(const FXObject* recv, ID func, TYPE& arg){
421 void FXRbCallVoidMethod_gvlcb(const FXObject* recv, const char *func, TYPE& arg){
375422 VALUE obj=FXRbGetRubyObj(recv,false);
376423 FXASSERT(!NIL_P(obj));
377424 FXASSERT(!FXRbIsInGC(recv));
378 rb_funcall(obj,func,1,to_ruby(arg));
425 rb_funcall(obj,rb_intern(func),1,to_ruby_cb(arg));
379426 }
380427
381428 /* Two arguments */
382429 template<class TYPE1, class TYPE2>
383 void FXRbCallVoidMethod(FXObject* recv,ID func,TYPE1 arg1,TYPE2 arg2){
384 VALUE obj=FXRbGetRubyObj(recv,false);
385 FXASSERT(!NIL_P(obj));
386 rb_funcall(obj,func,2,to_ruby(arg1),to_ruby(arg2));
430 void FXRbCallVoidMethod_gvlcb(FXObject* recv,const char *func,TYPE1 arg1,TYPE2 arg2){
431 VALUE obj=FXRbGetRubyObj(recv,false);
432 FXASSERT(!NIL_P(obj));
433 rb_funcall(obj,rb_intern(func),2,to_ruby_cb(arg1),to_ruby_cb(arg2));
387434 }
388435
389436 template<class TYPE1, class TYPE2>
390 void FXRbCallVoidMethod(FXDC* recv,ID func,TYPE1 arg1,TYPE2 arg2){
391 VALUE obj=FXRbGetRubyObj(recv,false);
392 FXASSERT(!NIL_P(obj));
393 rb_funcall(obj,func,2,to_ruby(arg1),to_ruby(arg2));
394 }
395
396 FXTreeItem* FXRbCallTreeItemMethod(const FXTreeList* recv,ID func,FXint x,FXint y);
397 FXFoldingItem* FXRbCallFoldingItemMethod(const FXFoldingList* recv,ID func,FXint x,FXint y);
437 void FXRbCallVoidMethod_gvlcb(FXDC* recv,const char *func,TYPE1 arg1,TYPE2 arg2){
438 VALUE obj=FXRbGetRubyObj(recv,false);
439 FXASSERT(!NIL_P(obj));
440 rb_funcall(obj,rb_intern(func),2,to_ruby_cb(arg1),to_ruby_cb(arg2));
441 }
442
443 template<class TYPE>
444 void FXRbCallVoidArrayMethod(FXDC* recv,const char *func,TYPE objs,FXuint num){
445 VALUE obj=FXRbGetRubyObj(recv,false);
446 VALUE array=FXRbMakeArray(objs,num);
447 FXASSERT(!NIL_P(obj));
448 rb_funcall(obj,rb_intern(func),1,array);
449 }
450
451 FXTreeItem* FXRbCallTreeItemMethod_gvlcb(const FXTreeList* recv,const char *func,FXint x,FXint y);
452 FXFoldingItem* FXRbCallFoldingItemMethod_gvlcb(const FXFoldingList* recv,const char *func,FXint x,FXint y);
398453
399454 /* Three arguments */
400455 template<class TYPE1, class TYPE2, class TYPE3>
401 void FXRbCallVoidMethod(FXObject* recv,ID func,TYPE1 arg1,TYPE2 arg2,TYPE3 arg3){
402 VALUE obj=FXRbGetRubyObj(recv,false);
403 FXASSERT(!NIL_P(obj));
404 rb_funcall(obj,func,3,to_ruby(arg1),to_ruby(arg2),to_ruby(arg3));
456 void FXRbCallVoidMethod_gvlcb(FXObject* recv,const char *func,TYPE1 arg1,TYPE2 arg2,TYPE3 arg3){
457 VALUE obj=FXRbGetRubyObj(recv,false);
458 FXASSERT(!NIL_P(obj));
459 rb_funcall(obj,rb_intern(func),3,to_ruby_cb(arg1),to_ruby_cb(arg2),to_ruby_cb(arg3));
405460 }
406461
407462 template<class TYPE1, class TYPE2, class TYPE3>
408 void FXRbCallVoidMethod(FXDC* recv,ID func,TYPE1 arg1,TYPE2 arg2,TYPE3 arg3){
409 VALUE obj=FXRbGetRubyObj(recv,false);
410 FXASSERT(!NIL_P(obj));
411 rb_funcall(obj,func,3,to_ruby(arg1),to_ruby(arg2),to_ruby(arg3));
463 void FXRbCallVoidMethod_gvlcb(FXDC* recv,const char *func,TYPE1 arg1,TYPE2 arg2,TYPE3 arg3){
464 VALUE obj=FXRbGetRubyObj(recv,false);
465 FXASSERT(!NIL_P(obj));
466 rb_funcall(obj,rb_intern(func),3,to_ruby_cb(arg1),to_ruby_cb(arg2),to_ruby_cb(arg3));
412467 }
413468
414469 /* Four arguments */
415470 template<class TYPE1, class TYPE2, class TYPE3, class TYPE4>
416 void FXRbCallVoidMethod(FXObject* recv,ID func, TYPE1 arg1, TYPE2 arg2, TYPE3 arg3, TYPE4 arg4){
417 VALUE obj=FXRbGetRubyObj(recv,false);
418 FXASSERT(!NIL_P(obj));
419 rb_funcall(obj,func,4,to_ruby(arg1),to_ruby(arg2),to_ruby(arg3),to_ruby(arg4));
471 void FXRbCallVoidMethod_gvlcb(FXObject* recv,const char *func, TYPE1& arg1, TYPE2 arg2, TYPE3 arg3, TYPE4 arg4){
472 VALUE obj=FXRbGetRubyObj(recv,false);
473 FXASSERT(!NIL_P(obj));
474 rb_funcall(obj,rb_intern(func),4,to_ruby_cb(arg1),to_ruby_cb(arg2),to_ruby_cb(arg3),to_ruby_cb(arg4));
420475 }
421476
422477 template<class TYPE1, class TYPE2, class TYPE3, class TYPE4>
423 void FXRbCallVoidMethod(FXDC* recv,ID func,TYPE1 arg1,TYPE2 arg2,TYPE3 arg3,TYPE4 arg4){
424 VALUE obj=FXRbGetRubyObj(recv,false);
425 FXASSERT(!NIL_P(obj));
426 rb_funcall(obj,func,4,to_ruby(arg1),to_ruby(arg2),to_ruby(arg3),to_ruby(arg4));
478 void FXRbCallVoidMethod_gvlcb(FXDC* recv,const char *func,TYPE1 arg1,TYPE2 arg2,TYPE3 arg3,TYPE4 arg4){
479 VALUE obj=FXRbGetRubyObj(recv,false);
480 FXASSERT(!NIL_P(obj));
481 rb_funcall(obj,rb_intern(func),4,to_ruby_cb(arg1),to_ruby_cb(arg2),to_ruby_cb(arg3),to_ruby_cb(arg4));
427482 }
428483
429484 /* Five arguments */
430485 template<class TYPE1, class TYPE2, class TYPE3, class TYPE4, class TYPE5>
431 void FXRbCallVoidMethod(FXObject* recv,ID func,TYPE1& arg1,TYPE2 arg2,TYPE3 arg3,TYPE4 arg4,TYPE5 arg5){
432 VALUE obj=FXRbGetRubyObj(recv,false);
433 FXASSERT(!NIL_P(obj));
434 rb_funcall(obj,func,5,to_ruby(arg1),to_ruby(arg2),to_ruby(arg3),to_ruby(arg4),to_ruby(arg5));
486 void FXRbCallVoidMethod_gvlcb(FXObject* recv,const char *func,TYPE1& arg1,TYPE2 arg2,TYPE3 arg3,TYPE4 arg4,TYPE5 arg5){
487 VALUE obj=FXRbGetRubyObj(recv,false);
488 FXASSERT(!NIL_P(obj));
489 rb_funcall(obj,rb_intern(func),5,to_ruby_cb(arg1),to_ruby_cb(arg2),to_ruby_cb(arg3),to_ruby_cb(arg4),to_ruby_cb(arg5));
435490 }
436491
437492 template<class TYPE1, class TYPE2, class TYPE3, class TYPE4, class TYPE5>
438 void FXRbCallVoidMethod(FXDC* recv, ID func, TYPE1 arg1, TYPE2 arg2, TYPE3 arg3, TYPE4 arg4, TYPE5 arg5){
439 VALUE obj=FXRbGetRubyObj(recv,false);
440 FXASSERT(!NIL_P(obj));
441 rb_funcall(obj,func,5,to_ruby(arg1),to_ruby(arg2),to_ruby(arg3),to_ruby(arg4),to_ruby(arg5));
493 void FXRbCallVoidMethod_gvlcb(FXDC* recv, const char *func, TYPE1 arg1, TYPE2 arg2, TYPE3 arg3, TYPE4 arg4, TYPE5 arg5){
494 VALUE obj=FXRbGetRubyObj(recv,false);
495 FXASSERT(!NIL_P(obj));
496 rb_funcall(obj,rb_intern(func),5,to_ruby_cb(arg1),to_ruby_cb(arg2),to_ruby_cb(arg3),to_ruby_cb(arg4),to_ruby_cb(arg5));
442497 }
443498
444499 /* Six arguments */
445500 template<class TYPE1, class TYPE2, class TYPE3, class TYPE4, class TYPE5, class TYPE6>
446 void FXRbCallVoidMethod(const FXObject* recv, ID func, TYPE1 arg1, TYPE2& arg2, TYPE3 arg3, TYPE4 arg4, TYPE5 arg5, TYPE6 arg6){
447 VALUE obj=FXRbGetRubyObj(recv,false);
448 FXASSERT(!NIL_P(obj));
449 rb_funcall(obj,func,6,to_ruby(arg1),to_ruby(arg2),to_ruby(arg3),to_ruby(arg4),to_ruby(arg5),to_ruby(arg6));
501 void FXRbCallVoidMethod_gvlcb(const FXObject* recv, const char *func, TYPE1& arg1, TYPE2& arg2, TYPE3 arg3, TYPE4 arg4, TYPE5 arg5, TYPE6 arg6){
502 VALUE obj=FXRbGetRubyObj(recv,false);
503 FXASSERT(!NIL_P(obj));
504 rb_funcall(obj,rb_intern(func),6,to_ruby_cb(arg1),to_ruby_cb(arg2),to_ruby_cb(arg3),to_ruby_cb(arg4),to_ruby_cb(arg5),to_ruby_cb(arg6));
450505 }
451506
452507 template<class TYPE1, class TYPE2, class TYPE3, class TYPE4, class TYPE5, class TYPE6>
453 void FXRbCallVoidMethod(FXDC* recv, ID func, TYPE1 arg1, TYPE2 arg2, TYPE3 arg3, TYPE4 arg4, TYPE5 arg5, TYPE6 arg6){
454 VALUE obj=FXRbGetRubyObj(recv,false);
455 FXASSERT(!NIL_P(obj));
456 rb_funcall(obj,func,6,to_ruby(arg1),to_ruby(arg2),to_ruby(arg3),to_ruby(arg4),to_ruby(arg5),to_ruby(arg6));
508 void FXRbCallVoidMethod_gvlcb(FXDC* recv, const char *func, TYPE1 arg1, TYPE2 arg2, TYPE3 arg3, TYPE4 arg4, TYPE5 arg5, TYPE6 arg6){
509 VALUE obj=FXRbGetRubyObj(recv,false);
510 FXASSERT(!NIL_P(obj));
511 rb_funcall(obj,rb_intern(func),6,to_ruby_cb(arg1),to_ruby_cb(arg2),to_ruby_cb(arg3),to_ruby_cb(arg4),to_ruby_cb(arg5),to_ruby_cb(arg6));
457512 }
458513
459514 /* Seven arguments */
460515 template<class TYPE1, class TYPE2, class TYPE3, class TYPE4, class TYPE5, class TYPE6, class TYPE7>
461 void FXRbCallVoidMethod(FXDC* recv, ID func, TYPE1 arg1, TYPE2 arg2, TYPE3 arg3, TYPE4 arg4, TYPE5 arg5, TYPE6 arg6, TYPE7 arg7){
462 VALUE obj=FXRbGetRubyObj(recv,false);
463 FXASSERT(!NIL_P(obj));
464 rb_funcall(obj,func,7,to_ruby(arg1),to_ruby(arg2),to_ruby(arg3),to_ruby(arg4),to_ruby(arg5),to_ruby(arg6),to_ruby(arg7));
516 void FXRbCallVoidMethod_gvlcb(FXDC* recv, const char *func, TYPE1 arg1, TYPE2 arg2, TYPE3 arg3, TYPE4 arg4, TYPE5 arg5, TYPE6 arg6, TYPE7 arg7){
517 VALUE obj=FXRbGetRubyObj(recv,false);
518 FXASSERT(!NIL_P(obj));
519 rb_funcall(obj,rb_intern(func),7,to_ruby_cb(arg1),to_ruby_cb(arg2),to_ruby_cb(arg3),to_ruby_cb(arg4),to_ruby_cb(arg5),to_ruby_cb(arg6),to_ruby_cb(arg7));
520 }
521
522 template<class TYPE1, class TYPE2, class TYPE3, class TYPE4, class TYPE5, class TYPE6, class TYPE7, class TYPE8>
523 void FXRbCallVoidMethod_gvlcb(FXObject* recv, const char *func, TYPE1& arg1, TYPE2 arg2, TYPE3 arg3, TYPE4 arg4, TYPE5 arg5, TYPE6 arg6, TYPE7 arg7, TYPE8 arg8){
524 VALUE obj=FXRbGetRubyObj(recv,false);
525 FXASSERT(!NIL_P(obj));
526 rb_funcall(obj,rb_intern(func),8,to_ruby_cb(arg1),to_ruby_cb(arg2),to_ruby_cb(arg3),to_ruby_cb(arg4),to_ruby_cb(arg5),to_ruby_cb(arg6),to_ruby_cb(arg7), to_ruby_cb(arg8));
465527 }
466528
467529 /* Nine arguments */
468530 template<class TYPE1, class TYPE2, class TYPE3, class TYPE4, class TYPE5, class TYPE6, class TYPE7, class TYPE8, class TYPE9>
469 void FXRbCallVoidMethod(FXDC* recv, ID func, TYPE1 arg1, TYPE2 arg2, TYPE3 arg3, TYPE4 arg4, TYPE5 arg5, TYPE6 arg6, TYPE7 arg7, TYPE8 arg8, TYPE9 arg9){
470 VALUE obj=FXRbGetRubyObj(recv,false);
471 FXASSERT(!NIL_P(obj));
472 rb_funcall(obj,func,9,to_ruby(arg1),to_ruby(arg2),to_ruby(arg3),to_ruby(arg4),to_ruby(arg5),to_ruby(arg6),to_ruby(arg7), to_ruby(arg8), to_ruby(arg9));
531 void FXRbCallVoidMethod_gvlcb(FXDC* recv, const char *func, TYPE1 arg1, TYPE2 arg2, TYPE3 arg3, TYPE4 arg4, TYPE5 arg5, TYPE6 arg6, TYPE7 arg7, TYPE8 arg8, TYPE9 arg9){
532 VALUE obj=FXRbGetRubyObj(recv,false);
533 FXASSERT(!NIL_P(obj));
534 rb_funcall(obj,rb_intern(func),9,to_ruby_cb(arg1),to_ruby_cb(arg2),to_ruby_cb(arg3),to_ruby_cb(arg4),to_ruby_cb(arg5),to_ruby_cb(arg6),to_ruby_cb(arg7), to_ruby_cb(arg8), to_ruby_cb(arg9));
473535 }
474536
475537 /* Eleven arguments (!) */
476538 template<class TYPE1,class TYPE2,class TYPE3,class TYPE4,class TYPE5,class TYPE6,class TYPE7,class TYPE8,class TYPE9,class TYPE10,class TYPE11>
477 void FXRbCallVoidMethod(FXObject* recv,ID func,TYPE1& arg1,TYPE2 arg2,TYPE3 arg3,TYPE4 arg4,TYPE5 arg5,TYPE6 arg6,TYPE7 arg7,TYPE8 arg8,TYPE9 arg9,TYPE10 arg10,TYPE11 arg11){
478 VALUE obj=FXRbGetRubyObj(recv,false);
479 FXASSERT(!NIL_P(obj));
480 rb_funcall(obj,func,11,to_ruby(arg1),to_ruby(arg2),to_ruby(arg3),to_ruby(arg4),to_ruby(arg5),to_ruby(arg6),to_ruby(arg7),to_ruby(arg8),to_ruby(arg9),to_ruby(arg10),to_ruby(arg11));
539 void FXRbCallVoidMethod_gvlcb(FXObject* recv,const char *func,TYPE1& arg1,TYPE2 arg2,TYPE3 arg3,TYPE4 arg4,TYPE5 arg5,TYPE6 arg6,TYPE7 arg7,TYPE8 arg8,TYPE9 arg9,TYPE10 arg10,TYPE11 arg11){
540 VALUE obj=FXRbGetRubyObj(recv,false);
541 FXASSERT(!NIL_P(obj));
542 rb_funcall(obj,rb_intern(func),11,to_ruby_cb(arg1),to_ruby_cb(arg2),to_ruby_cb(arg3),to_ruby_cb(arg4),to_ruby_cb(arg5),to_ruby_cb(arg6),to_ruby_cb(arg7),to_ruby_cb(arg8),to_ruby_cb(arg9),to_ruby_cb(arg10),to_ruby_cb(arg11));
481543 }
482544
483545 // Call function with "FXbool" return value
484 inline bool FXRbCallBoolMethod(FXStream* recv,ID func){
485 VALUE v=rb_funcall(FXRbGetRubyObj(recv,false),func,0,NULL);
546 inline bool FXRbCallBoolMethod_gvlcb(FXStream* recv,const char *func){
547 VALUE v=rb_funcall(FXRbGetRubyObj(recv,false),rb_intern(func),0);
486548 return (v==Qtrue);
487549 }
488550
489551 template<class TYPE1>
490 bool FXRbCallBoolMethod(FXStream* recv,ID func,TYPE1 arg){
491 VALUE v=rb_funcall(FXRbGetRubyObj(recv,false),func,1,to_ruby(arg));
552 bool FXRbCallBoolMethod_gvlcb(FXStream* recv,const char *func,TYPE1 arg){
553 VALUE v=rb_funcall(FXRbGetRubyObj(recv,false),rb_intern(func),1,to_ruby_cb(arg));
492554 return (v==Qtrue);
493555 }
494556
495557 template<class TYPE1,class TYPE2>
496 bool FXRbCallBoolMethod(FXStream* recv,ID func,TYPE1 arg1,TYPE2 arg2){
497 VALUE v=rb_funcall(FXRbGetRubyObj(recv,false),func,2,to_ruby(arg1),to_ruby(arg2));
558 bool FXRbCallBoolMethod_gvlcb(FXStream* recv,const char *func,TYPE1 arg1,TYPE2 arg2){
559 VALUE v=rb_funcall(FXRbGetRubyObj(recv,false),rb_intern(func),2,to_ruby_cb(arg1),to_ruby_cb(arg2));
498560 return (v==Qtrue);
499561 }
500562
501 bool FXRbCallBoolMethod(const FXObject* recv,ID func);
563 bool FXRbCallBoolMethod_gvlcb(const FXObject* recv,const char *func);
502564
503565 template<class TYPE>
504 bool FXRbCallBoolMethod(FXObject* recv, ID func, TYPE& arg){
505 VALUE obj=FXRbGetRubyObj(recv,false);
506 FXASSERT(!NIL_P(obj));
507 VALUE v=rb_funcall(obj,func,1,to_ruby(arg));
566 bool FXRbCallBoolMethod_gvlcb(FXObject* recv, const char *func, TYPE& arg){
567 VALUE obj=FXRbGetRubyObj(recv,false);
568 FXASSERT(!NIL_P(obj));
569 VALUE v=rb_funcall(obj,rb_intern(func),1,to_ruby_cb(arg));
508570 return (v==Qtrue);
509571 }
510572
511573 template<class TYPE>
512 bool FXRbCallBoolMethod(const FXObject* recv,ID func,TYPE& arg){
513 VALUE v=rb_funcall(FXRbGetRubyObj(recv,false),func,1,to_ruby(arg));
574 bool FXRbCallBoolMethod_gvlcb(const FXObject* recv,const char *func,TYPE& arg){
575 VALUE v=rb_funcall(FXRbGetRubyObj(recv,false),rb_intern(func),1,to_ruby_cb(arg));
514576 return (v==Qtrue);
515577 }
516578
517579 template<class TYPE1, class TYPE2>
518 bool FXRbCallBoolMethod(const FXObject* recv, ID func, TYPE1 arg1, TYPE2 arg2){
519 VALUE obj=FXRbGetRubyObj(recv,false);
520 FXASSERT(!NIL_P(obj));
521 VALUE v=rb_funcall(obj,func,2,to_ruby(arg1),to_ruby(arg2));
580 bool FXRbCallBoolMethod_gvlcb(const FXObject* recv, const char *func, TYPE1 arg1, TYPE2 arg2){
581 VALUE obj=FXRbGetRubyObj(recv,false);
582 FXASSERT(!NIL_P(obj));
583 VALUE v=rb_funcall(obj,rb_intern(func),2,to_ruby_cb(arg1),to_ruby_cb(arg2));
522584 return (v==Qtrue);
523585 }
524586
525587 template<class TYPE1, class TYPE2, class TYPE3>
526 bool FXRbCallBoolMethod(const FXObject* recv, ID func, TYPE1 arg1, TYPE2 arg2, TYPE3 arg3){
527 VALUE obj=FXRbGetRubyObj(recv,false);
528 FXASSERT(!NIL_P(obj));
529 VALUE v=rb_funcall(obj,func,3,to_ruby(arg1),to_ruby(arg2),to_ruby(arg3));
588 bool FXRbCallBoolMethod_gvlcb(const FXObject* recv, const char *func, TYPE1 arg1, TYPE2 arg2, TYPE3 arg3){
589 VALUE obj=FXRbGetRubyObj(recv,false);
590 FXASSERT(!NIL_P(obj));
591 VALUE v=rb_funcall(obj,rb_intern(func),3,to_ruby_cb(arg1),to_ruby_cb(arg2),to_ruby_cb(arg3));
530592 return (v==Qtrue);
531593 }
532594
533595 template<class TYPE1, class TYPE2, class TYPE3, class TYPE4, class TYPE5>
534 bool FXRbCallBoolMethod(const FXObject* recv, ID func, TYPE1 arg1, TYPE2 arg2, TYPE3 arg3, TYPE4 arg4, TYPE5 arg5){
535 VALUE obj=FXRbGetRubyObj(recv,false);
536 FXASSERT(!NIL_P(obj));
537 VALUE v=rb_funcall(obj,func,5,to_ruby(arg1),to_ruby(arg2),to_ruby(arg3),to_ruby(arg4),to_ruby(arg5));
596 bool FXRbCallBoolMethod_gvlcb(const FXObject* recv, const char *func, TYPE1 arg1, TYPE2 arg2, TYPE3 arg3, TYPE4 arg4, TYPE5 arg5){
597 VALUE obj=FXRbGetRubyObj(recv,false);
598 FXASSERT(!NIL_P(obj));
599 VALUE v=rb_funcall(obj,rb_intern(func),5,to_ruby_cb(arg1),to_ruby_cb(arg2),to_ruby_cb(arg3),to_ruby_cb(arg4),to_ruby_cb(arg5));
538600 return (v==Qtrue);
539601 }
540602
541603 // Call function with "FXint" return value
542 FXint FXRbCallIntMethod(const FXObject* recv,ID func);
604 FXint FXRbCallIntMethod_gvlcb(const FXObject* recv,const char *func);
543605
544606 template<class TYPE>
545 FXint FXRbCallIntMethod(FXObject* recv, ID func, TYPE arg){
546 VALUE obj=FXRbGetRubyObj(recv,false);
547 FXASSERT(!NIL_P(obj));
548 VALUE v=rb_funcall(obj,func,1,to_ruby(arg));
607 FXint FXRbCallIntMethod_gvlcb(FXObject* recv, const char *func, TYPE arg){
608 VALUE obj=FXRbGetRubyObj(recv,false);
609 FXASSERT(!NIL_P(obj));
610 VALUE v=rb_funcall(obj,rb_intern(func),1,to_ruby_cb(arg));
549611 return static_cast<FXint>(NUM2INT(v));
550612 }
551613
552614 template<class TYPE>
553 FXint FXRbCallIntMethod(const FXObject* recv, ID func, TYPE arg){
554 VALUE obj=FXRbGetRubyObj(recv,false);
555 FXASSERT(!NIL_P(obj));
556 VALUE v=rb_funcall(obj,func,1,to_ruby(arg));
615 FXint FXRbCallIntMethod_gvlcb(const FXObject* recv, const char *func, TYPE arg){
616 VALUE obj=FXRbGetRubyObj(recv,false);
617 FXASSERT(!NIL_P(obj));
618 VALUE v=rb_funcall(obj,rb_intern(func),1,to_ruby_cb(arg));
557619 return static_cast<FXint>(NUM2INT(v));
558620 }
559621
560622 template<class TYPE1, class TYPE2>
561 FXint FXRbCallIntMethod(const FXObject* recv, ID func, TYPE1 arg1, TYPE2 arg2){
562 VALUE obj=FXRbGetRubyObj(recv,false);
563 FXASSERT(!NIL_P(obj));
564 VALUE result=rb_funcall(obj,func,2,to_ruby(arg1),to_ruby(arg2));
623 FXint FXRbCallIntMethod_gvlcb(const FXObject* recv, const char *func, TYPE1 arg1, TYPE2 arg2){
624 VALUE obj=FXRbGetRubyObj(recv,false);
625 FXASSERT(!NIL_P(obj));
626 VALUE result=rb_funcall(obj,rb_intern(func),2,to_ruby_cb(arg1),to_ruby_cb(arg2));
565627 return static_cast<FXint>(NUM2INT(result));
566628 }
567629
568630 template<class TYPE1, class TYPE2, class TYPE3, class TYPE4, class TYPE5>
569 FXint FXRbCallIntMethod(const FXObject* recv, ID func, TYPE1 arg1, TYPE2 arg2, TYPE3 arg3, TYPE4 arg4, TYPE5 arg5){
570 VALUE obj=FXRbGetRubyObj(recv,false);
571 FXASSERT(!NIL_P(obj));
572 VALUE result=rb_funcall(obj,func,5,to_ruby(arg1),to_ruby(arg2),to_ruby(arg3),to_ruby(arg4),to_ruby(arg5));
631 FXint FXRbCallIntMethod_gvlcb(const FXObject* recv, const char *func, TYPE1 arg1, TYPE2 arg2, TYPE3 arg3, TYPE4 arg4, TYPE5 arg5){
632 VALUE obj=FXRbGetRubyObj(recv,false);
633 FXASSERT(!NIL_P(obj));
634 VALUE result=rb_funcall(obj,rb_intern(func),5,to_ruby_cb(arg1),to_ruby_cb(arg2),to_ruby_cb(arg3),to_ruby_cb(arg4),to_ruby_cb(arg5));
573635 return static_cast<FXint>(NUM2INT(result));
574636 }
575637
576638 // Call function with "long" return value
577639 template<class TYPE1, class TYPE2, class TYPE3>
578 long FXRbCallLongMethod(FXObject* recv, ID func, TYPE1 arg1, TYPE2 arg2, TYPE3 arg3){
579 VALUE obj=FXRbGetRubyObj(recv,false);
580 FXASSERT(!NIL_P(obj));
581 VALUE v=rb_funcall(obj,func,3,to_ruby(arg1),to_ruby(arg2),to_ruby(arg3));
640 long FXRbCallLongMethod_gvlcb(FXObject* recv, const char *func, TYPE1 arg1, TYPE2 arg2, TYPE3 arg3){
641 VALUE obj=FXRbGetRubyObj(recv,false);
642 FXASSERT(!NIL_P(obj));
643 VALUE v=rb_funcall(obj,rb_intern(func),3,to_ruby_cb(arg1),to_ruby_cb(arg2),to_ruby_cb(arg3));
582644 return static_cast<long>(NUM2LONG(v));
583645 }
584646
585647 // Call functions with "FXuint" return value
586648 template<class TYPE>
587 FXuint FXRbCallUIntMethod(FXObject* recv, ID func, TYPE arg){
588 VALUE obj=FXRbGetRubyObj(recv,false);
589 FXASSERT(!NIL_P(obj));
590 VALUE v=rb_funcall(obj,func,1,to_ruby(arg));
649 FXuint FXRbCallUIntMethod_gvlcb(FXObject* recv, const char *func, TYPE arg){
650 VALUE obj=FXRbGetRubyObj(recv,false);
651 FXASSERT(!NIL_P(obj));
652 VALUE v=rb_funcall(obj,rb_intern(func),1,to_ruby_cb(arg));
591653 return static_cast<FXuint>(NUM2UINT(v));
592654 }
593655
656 template<class TYPE1, class TYPE2, class TYPE3, class TYPE4>
657 FXuint FXRbCallUIntMethod_gvlcb(FXObject* recv, const char *func, TYPE1 arg1, TYPE2 arg2, TYPE3 arg3, TYPE4 arg4){
658 VALUE obj=FXRbGetRubyObj(recv,false);
659 FXASSERT(!NIL_P(obj));
660 VALUE v=rb_funcall(obj,rb_intern(func),4,to_ruby_cb(arg1),to_ruby_cb(arg2),to_ruby_cb(arg3),to_ruby_cb(arg4));
661 return static_cast<FXuint>(NUM2UINT(v));
662 }
663
594664 // Call functions with FXString return value
595 FXString FXRbCallStringMethod(const FXObject* recv, ID func);
665 FXString FXRbCallStringMethod_gvlcb(const FXObject* recv, const char *func);
596666
597667 // Call functions with const FXchar* return value
598 const FXchar* FXRbCallCStringMethod(const FXObject* recv, ID func, const FXchar*, const FXchar*);
599 const FXchar* FXRbCallCStringMethod(const FXObject* recv, ID func, const FXchar*, const FXchar*, const FXchar*);
668 const FXchar* FXRbCallCStringMethod_gvlcb(const FXObject* recv, const char *func, const FXchar*, const FXchar*);
669 const FXchar* FXRbCallCStringMethod_gvlcb(const FXObject* recv, const char *func, const FXchar*, const FXchar*, const FXchar*);
600670
601671 // Call functions with "FXGLObject*" return value
602 FXGLObject* FXRbCallGLObjectMethod(FXGLObject* recv,ID func);
603 FXGLObject* FXRbCallGLObjectMethod(FXGLObject* recv,ID func,FXuint* path,FXint n);
604 FXGLObject* FXRbCallGLObjectMethod(FXGLViewer* recv,ID func,FXint x,FXint y);
672 FXGLObject* FXRbCallGLObjectMethod_gvlcb(FXGLObject* recv,const char *func);
673 FXGLObject* FXRbCallGLObjectMethod_gvlcb(FXGLObject* recv,const char *func,FXuint* path,FXint n);
674 FXGLObject* FXRbCallGLObjectMethod_gvlcb(FXGLViewer* recv,const char *func,FXint x,FXint y);
605675
606676 // Call functions with "FXGLObject**" return value
607 FXGLObject** FXRbCallGLObjectArrayMethod(FXGLViewer* recv,ID func,FXint x,FXint y,FXint w,FXint h);
677 FXGLObject** FXRbCallGLObjectArrayMethod_gvlcb(FXGLViewer* recv,const char *func,FXint x,FXint y,FXint w,FXint h);
608678
609679 // Call functions with "FXTreeItem*" return value
610 FXTableItem* FXRbCallTableItemMethod(FXTable* recv,ID func,const FXString& text,FXIcon* icon,void* ptr);
680 FXTableItem* FXRbCallTableItemMethod_gvlcb(FXTable* recv,const char *func,const FXString& text,FXIcon* icon,void* ptr);
611681
612682 // Call functions with "FXTreeItem*" return value
613 FXTableItem* FXRbCallTableItemMethod(FXTable* recv,ID func,FXint,FXint,FXbool);
683 FXTableItem* FXRbCallTableItemMethod_gvlcb(FXTable* recv,const char *func,FXint,FXint,FXbool);
614684
615685 // Call functions with "FXFileAssoc*" return value
616 FXFileAssoc* FXRbCallFileAssocMethod(const FXFileDict* recv,ID func,const FXchar* pathname);
686 FXFileAssoc* FXRbCallFileAssocMethod_gvlcb(const FXFileDict* recv,const char *func,const FXchar* pathname);
617687
618688 // Call functions with "FXIcon*" return value
619 FXIcon* FXRbCallIconMethod(const FXTableItem* recv,ID func);
689 FXIcon* FXRbCallIconMethod_gvlcb(const FXTableItem* recv,const char *func);
620690
621691 template<class TYPE1, class TYPE2>
622 FXIcon* FXRbCallIconMethod(const FXIconSource *recv,ID func,TYPE1& arg1,const TYPE2& arg2){
623 VALUE obj=FXRbGetRubyObj(recv,false);
624 FXASSERT(!NIL_P(obj));
625 VALUE result=rb_funcall(obj,func,2,to_ruby(arg1),to_ruby(arg2));
692 FXIcon* FXRbCallIconMethod_gvlcb(const FXIconSource *recv,const char *func,TYPE1& arg1,const TYPE2& arg2){
693 VALUE obj=FXRbGetRubyObj(recv,false);
694 FXASSERT(!NIL_P(obj));
695 VALUE result=rb_funcall(obj,rb_intern(func),2,to_ruby(arg1),to_ruby(arg2));
626696 return NIL_P(result) ? 0 : reinterpret_cast<FXIcon*>(DATA_PTR(result));
627697 }
628698
629699 template<class TYPE1, class TYPE2, class TYPE3, class TYPE4>
630 FXIcon* FXRbCallIconMethod(const FXIconSource *recv,ID func,TYPE1& arg1,TYPE2 arg2,TYPE3 arg3,const TYPE4& arg4){
631 VALUE obj=FXRbGetRubyObj(recv,false);
632 FXASSERT(!NIL_P(obj));
633 VALUE result=rb_funcall(obj,func,4,to_ruby(arg1),to_ruby(arg2),to_ruby(arg3),to_ruby(arg4));
700 FXIcon* FXRbCallIconMethod_gvlcb(const FXIconSource *recv,const char *func,TYPE1& arg1,TYPE2 arg2,TYPE3 arg3,const TYPE4& arg4){
701 VALUE obj=FXRbGetRubyObj(recv,false);
702 FXASSERT(!NIL_P(obj));
703 VALUE result=rb_funcall(obj,rb_intern(func),4,to_ruby(arg1),to_ruby(arg2),to_ruby(arg3),to_ruby(arg4));
634704 return NIL_P(result) ? 0 : reinterpret_cast<FXIcon*>(DATA_PTR(result));
635705 }
636706
637707 // Call functions with FXImage* return value
638708 template<class TYPE1, class TYPE2>
639 FXImage* FXRbCallImageMethod(const FXIconSource *recv,ID func,TYPE1& arg1,const TYPE2& arg2){
640 VALUE obj=FXRbGetRubyObj(recv,false);
641 FXASSERT(!NIL_P(obj));
642 VALUE result=rb_funcall(obj,func,2,to_ruby(arg1),to_ruby(arg2));
709 FXImage* FXRbCallImageMethod_gvlcb(const FXIconSource *recv,const char *func,TYPE1& arg1,const TYPE2& arg2){
710 VALUE obj=FXRbGetRubyObj(recv,false);
711 FXASSERT(!NIL_P(obj));
712 VALUE result=rb_funcall(obj,rb_intern(func),2,to_ruby(arg1),to_ruby(arg2));
643713 return NIL_P(result) ? 0 : reinterpret_cast<FXImage*>(DATA_PTR(result));
644714 }
645715
646716 template<class TYPE1, class TYPE2, class TYPE3, class TYPE4>
647 FXImage* FXRbCallImageMethod(const FXIconSource *recv,ID func,TYPE1& arg1,TYPE2 arg2,TYPE3 arg3,const TYPE4& arg4){
648 VALUE obj=FXRbGetRubyObj(recv,false);
649 FXASSERT(!NIL_P(obj));
650 VALUE result=rb_funcall(obj,func,4,to_ruby(arg1),to_ruby(arg2),to_ruby(arg3),to_ruby(arg4));
717 FXImage* FXRbCallImageMethod_gvlcb(const FXIconSource *recv,const char *func,TYPE1& arg1,TYPE2 arg2,TYPE3 arg3,const TYPE4& arg4){
718 VALUE obj=FXRbGetRubyObj(recv,false);
719 FXASSERT(!NIL_P(obj));
720 VALUE result=rb_funcall(obj,rb_intern(func),4,to_ruby(arg1),to_ruby(arg2),to_ruby(arg3),to_ruby(arg4));
651721 return NIL_P(result) ? 0 : reinterpret_cast<FXImage*>(DATA_PTR(result));
652722 }
653723
654724 // Call functions with "FXWindow*" return value
655 FXWindow* FXRbCallWindowMethod(const FXTableItem* recv,ID func,FXTable* table);
725 FXWindow* FXRbCallWindowMethod_gvlcb(const FXTableItem* recv,const char *func,FXTable* table);
656726
657727 // Call functions with "FXColor" return value
658728 template<class TYPE1, class TYPE2>
659 FXColor FXRbCallColorMethod(FXDC* recv, ID func, TYPE1 arg1, TYPE2 arg2){
660 VALUE obj=FXRbGetRubyObj(recv,false);
661 FXASSERT(!NIL_P(obj));
662 VALUE v=rb_funcall(obj,func,2,to_ruby(arg1),to_ruby(arg2));
729 FXColor FXRbCallColorMethod_gvlcb(FXDC* recv, const char *func, TYPE1 arg1, TYPE2 arg2){
730 VALUE obj=FXRbGetRubyObj(recv,false);
731 FXASSERT(!NIL_P(obj));
732 VALUE v=rb_funcall(obj,rb_intern(func),2,to_ruby(arg1),to_ruby(arg2));
663733 return static_cast<FXColor>(NUM2UINT(v));
664734 }
665735
666736 // Call functions with "FXRangef" return value
667 FXRangef FXRbCallRangeMethod(FXObject* recv,ID func);
737 FXRangef FXRbCallRangeMethod_gvlcb(FXObject* recv,const char *func);
668738
669739 // Call functions with FXwchar return value
670 FXwchar FXRbCallWCharMethod(const FXObject* recv,ID func);
740 FXwchar FXRbCallWCharMethod_gvlcb(const FXObject* recv,const char *func);
741
742 void FXRbCallSetDashes_gvlcb(FXDC* recv,const char *func,FXuint dashoffset,const FXchar *dashpattern,FXuint dashlength);
743
744 void FXRbCallDCDrawMethod_gvlcb(FXDC* recv, const char * func, FXint x,FXint y,const FXString& string);
745 void FXRbCallDCDrawMethod_gvlcb(FXDC* recv, const char * func, FXint x,FXint y,const FXchar* string,FXuint length);
671746
672747 /**
673748 * Macro to set up class implementation.
692767 } \
693768 }
694769
770
771 #define SORTFUNC(list, item) \
772 FXint list##_sortFunc_gvlcb(const item* a,const item* b);
773
774 SORTFUNC( FXRbComboBox, FXListItem )
775 SORTFUNC( FXRbFoldingList, FXFoldingItem )
776 SORTFUNC( FXRbIconList, FXIconItem )
777 SORTFUNC( FXRbList, FXListItem )
778 SORTFUNC( FXRbListBox, FXListItem )
779 SORTFUNC( FXRbTreeList, FXTreeItem )
780
781 #undef SORTFUNC
695782
696783 // FXRuby classes
697784 #include "FXRbStream.h"
0 /*
1 * gvl_wrappers.h - Wrapper functions for locking/unlocking the Ruby GVL
2 *
3 * These are some obscure preprocessor directives that allow to generate
4 * drop-in replacement wrapper functions in a declarative manner.
5 * These wrapper functions ensure that ruby's GVL is released on each
6 * function call and reacquired at the end of the call or in callbacks.
7 * This way blocking functions calls don't block concurrent ruby threads.
8 *
9 * The wrapper of each function is prefixed by "gvl_".
10 *
11 * Use "gcc -E" to retrieve the generated code.
12 */
13
14 #ifndef __gvl_wrappers_h
15 #define __gvl_wrappers_h
16
17 #if defined(HAVE_RB_THREAD_CALL_WITH_GVL)
18 extern "C" void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1);
19 #endif
20
21 #if defined(HAVE_RB_THREAD_CALL_WITHOUT_GVL)
22 extern "C" void *rb_thread_call_without_gvl(void *(*func)(void *), void *data1,
23 rb_unblock_function_t *ubf, void *data2);
24 #endif
25
26 void fxrb_wakeup_fox(void *);
27
28 #define DEFINE_PARAM_LIST1(type, ref, name) \
29 , name
30
31 #define DEFINE_PARAM_LIST2(type, ref, name) \
32 , p->params.name
33
34 #define DEFINE_PARAM_LIST3(type, ref, name) \
35 , type ref name
36
37 #define DEFINE_PARAM_LIST4(type, ref, name) \
38 , typename type
39
40 #define DEFINE_PARAM_LIST5(type, ref, name) \
41 , type
42
43 #define DEFINE_PARAM_DECL(type, ref, name) \
44 type ref name;
45
46 #define DEFINE_GVL_WRAPPER_STRUCT(klass, name, baseclass, when_non_void, rettype, firstparamtype, firstparamname) \
47 struct gvl_wrapper_##klass##_##name##_params { \
48 struct { \
49 firstparamtype firstparamname; \
50 FOR_EACH_PARAM_OF_##baseclass##_##name(DEFINE_PARAM_DECL) \
51 } params; \
52 when_non_void( rettype retval; ) \
53 };
54
55 #ifdef HAVE___THREAD
56 extern __thread int g_fxrb_thread_has_gvl;
57 #endif
58
59 #if defined(HAVE_RB_THREAD_CALL_WITHOUT_GVL)
60 #define DEFINE_GVL_SKELETON(klass, name, baseclass, when_non_void, rettype, firstparamtype, firstparamname) \
61 static void * gvl_##klass##_##name##_skeleton( void *data ){ \
62 struct gvl_wrapper_##klass##_##name##_params *p = (struct gvl_wrapper_##klass##_##name##_params*)data; \
63 g_fxrb_thread_has_gvl = 0; \
64 when_non_void( p->retval = ) \
65 klass##_##name##_gvl( p->params.firstparamname FOR_EACH_PARAM_OF_##baseclass##_##name(DEFINE_PARAM_LIST2) ); \
66 g_fxrb_thread_has_gvl = 1; \
67 return NULL; \
68 }
69
70 #define DEFINE_GVL_STUB(klass, name, baseclass, when_non_void, rettype, firstparamtype, firstparamname) \
71 rettype klass##_##name(firstparamtype firstparamname FOR_EACH_PARAM_OF_##baseclass##_##name(DEFINE_PARAM_LIST3)){ \
72 struct gvl_wrapper_##klass##_##name##_params params = { \
73 {firstparamname FOR_EACH_PARAM_OF_##baseclass##_##name(DEFINE_PARAM_LIST1)}, when_non_void((rettype)0) \
74 }; \
75 rb_thread_call_without_gvl(gvl_##klass##_##name##_skeleton, &params, fxrb_wakeup_fox, 0); \
76 when_non_void( return params.retval; ) \
77 }
78 #else
79 #define DEFINE_GVL_SKELETON(klass, name, baseclass, when_non_void, rettype, firstparamtype, firstparamname)
80
81 #define DEFINE_GVL_STUB(klass, name, baseclass, when_non_void, rettype, firstparamtype, firstparamname) \
82 rettype klass##_##name(firstparamtype firstparamname FOR_EACH_PARAM_OF_##baseclass##_##name(DEFINE_PARAM_LIST3)){ \
83 return klass##_##name##_gvl(firstparamname FOR_EACH_PARAM_OF_##baseclass##_##name(DEFINE_PARAM_LIST1)); \
84 }
85 #endif
86
87 #define DEFINE_GVL_STUB_DECL(klass, name, baseclass, when_non_void, rettype, firstparamtype, firstparamname) \
88 rettype klass##_##name( firstparamtype firstparamname FOR_EACH_PARAM_OF_##baseclass##_##name(DEFINE_PARAM_LIST3));
89
90
91
92 #define DEFINE_GVLCB_WRAPPER_STRUCT(name, when_non_void, rettype, firstparamtype, firstparamname, paramcount) \
93 template<typename firstparamtype FOR_EACH_PARAM_OF_##name##_##paramcount(DEFINE_PARAM_LIST4)> \
94 struct gvl_wrapper_##name##_##paramcount##_params { \
95 struct { \
96 firstparamtype firstparamname; \
97 FOR_EACH_PARAM_OF_##name##_##paramcount(DEFINE_PARAM_DECL) \
98 } params; \
99 when_non_void( rettype retval; ) \
100 };
101
102 #define DEFINE_GVLCB_STUB_DECL(name, when_non_void, rettype, firstparamtype, firstparamname, paramcount) \
103 template<typename firstparamtype FOR_EACH_PARAM_OF_##name##_##paramcount(DEFINE_PARAM_LIST4)> \
104 rettype name( firstparamtype firstparamname FOR_EACH_PARAM_OF_##name##_##paramcount(DEFINE_PARAM_LIST3));
105
106 #define DEFINE_GVLCB_SKELETON(name, when_non_void, rettype, firstparamtype, firstparamname, paramcount) \
107 template<typename firstparamtype FOR_EACH_PARAM_OF_##name##_##paramcount(DEFINE_PARAM_LIST4)> \
108 static void * gvl_##name##_##paramcount##_skeleton( void *data ){ \
109 struct gvl_wrapper_##name##_##paramcount##_params<firstparamtype FOR_EACH_PARAM_OF_##name##_##paramcount(DEFINE_PARAM_LIST5)> *p = \
110 (struct gvl_wrapper_##name##_##paramcount##_params<firstparamtype FOR_EACH_PARAM_OF_##name##_##paramcount(DEFINE_PARAM_LIST5)>*)data; \
111 when_non_void( p->retval = ) \
112 name##_gvlcb( p->params.firstparamname FOR_EACH_PARAM_OF_##name##_##paramcount(DEFINE_PARAM_LIST2) ); \
113 return NULL; \
114 }
115
116 #if defined(HAVE_RB_THREAD_CALL_WITH_GVL)
117 #define DEFINE_GVLCB_STUB(name, when_non_void, rettype, firstparamtype, firstparamname, paramcount) \
118 template<typename firstparamtype FOR_EACH_PARAM_OF_##name##_##paramcount(DEFINE_PARAM_LIST4)> \
119 rettype name(firstparamtype firstparamname FOR_EACH_PARAM_OF_##name##_##paramcount(DEFINE_PARAM_LIST3)){ \
120 if( g_fxrb_thread_has_gvl ){ \
121 return name##_gvlcb( firstparamname FOR_EACH_PARAM_OF_##name##_##paramcount(DEFINE_PARAM_LIST1) ); \
122 } else { \
123 struct gvl_wrapper_##name##_##paramcount##_params<firstparamtype FOR_EACH_PARAM_OF_##name##_##paramcount(DEFINE_PARAM_LIST5)> params = { \
124 {firstparamname FOR_EACH_PARAM_OF_##name##_##paramcount(DEFINE_PARAM_LIST1)} \
125 }; \
126 g_fxrb_thread_has_gvl = 1; \
127 rb_thread_call_with_gvl(gvl_##name##_##paramcount##_skeleton<firstparamtype FOR_EACH_PARAM_OF_##name##_##paramcount(DEFINE_PARAM_LIST5)>, &params); \
128 g_fxrb_thread_has_gvl = 0; \
129 when_non_void( return params.retval; ) \
130 } \
131 }
132 #else
133 #define DEFINE_GVLCB_STUB(name, when_non_void, rettype, firstparamtype, firstparamname, paramcount) \
134 template<typename firstparamtype FOR_EACH_PARAM_OF_##name##_##paramcount(DEFINE_PARAM_LIST4)> \
135 rettype name(firstparamtype firstparamname FOR_EACH_PARAM_OF_##name##_##paramcount(DEFINE_PARAM_LIST3)){ \
136 return name##_gvlcb( firstparamname FOR_EACH_PARAM_OF_##name##_##paramcount(DEFINE_PARAM_LIST1) ); \
137 }
138 #endif
139
140 #define GVL_TYPE_VOID(string)
141 #define GVL_TYPE_NONVOID(string) string
142
143
144 /*
145 * Definitions of blocking functions and their parameters
146 */
147
148 #define FOR_EACH_PARAM_OF_FXImage_loadPixels(param) \
149 param(FXStream, &, store)
150 #define FOR_EACH_PARAM_OF_FXImage_savePixels(param) \
151 param(FXStream, &, store)
152
153 #define FOR_EACH_PARAM_OF_FXDialogBox_execute(param) \
154 param(FXuint, , placement)
155
156 #define FOR_EACH_PARAM_OF_FXApp_run(param)
157
158 #define FOR_EACH_PARAM_OF_FXApp_runOneEvent(param) \
159 param(bool, , blocking)
160
161 #define FOR_EACH_PARAM_OF_FXApp_runUntil(param) \
162 param(FXuint, &, condition)
163
164 #define FOR_EACH_PARAM_OF_FXApp_runWhileEvents(param)
165
166 #define FOR_EACH_PARAM_OF_FXApp_runModalWhileEvents(param) \
167 param(FXWindow*, , window)
168
169 #define FOR_EACH_PARAM_OF_FXApp_runModal(param)
170
171 #define FOR_EACH_PARAM_OF_FXApp_runModalFor(param) \
172 param(FXWindow*, , window)
173
174 #define FOR_EACH_PARAM_OF_FXApp_runModalWhileShown(param) \
175 param(FXWindow*, , window)
176
177 #define FOR_EACH_PARAM_OF_FXApp_runPopup(param) \
178 param(FXWindow*, , owner)
179
180
181
182 /* function( class, name, baseclass, void_or_nonvoid, returntype, firstparamtype, firstparamname ) */
183 #define FOR_EACH_BLOCKING_FUNCTION(function) \
184 function(FXImage, loadPixels, FXImage, GVL_TYPE_NONVOID, bool, FXImage *, self) \
185 function(FXImage, savePixels, FXImage, GVL_TYPE_NONVOID, bool, const FXImage *, self) \
186 function(FXBMPImage, loadPixels, FXImage, GVL_TYPE_NONVOID, bool, FXBMPImage *, self) \
187 function(FXBMPImage, savePixels, FXImage, GVL_TYPE_NONVOID, bool, const FXBMPImage *, self) \
188 function(FXJPGImage, loadPixels, FXImage, GVL_TYPE_NONVOID, bool, FXJPGImage *, self) \
189 function(FXJPGImage, savePixels, FXImage, GVL_TYPE_NONVOID, bool, const FXJPGImage *, self) \
190 function(FXGIFImage, loadPixels, FXImage, GVL_TYPE_NONVOID, bool, FXGIFImage *, self) \
191 function(FXGIFImage, savePixels, FXImage, GVL_TYPE_NONVOID, bool, const FXGIFImage *, self) \
192 function(FXICOImage, loadPixels, FXImage, GVL_TYPE_NONVOID, bool, FXICOImage *, self) \
193 function(FXICOImage, savePixels, FXImage, GVL_TYPE_NONVOID, bool, const FXICOImage *, self) \
194 function(FXPNGImage, loadPixels, FXImage, GVL_TYPE_NONVOID, bool, FXPNGImage *, self) \
195 function(FXPNGImage, savePixels, FXImage, GVL_TYPE_NONVOID, bool, const FXPNGImage *, self) \
196 function(FXPPMImage, loadPixels, FXImage, GVL_TYPE_NONVOID, bool, FXPPMImage *, self) \
197 function(FXPPMImage, savePixels, FXImage, GVL_TYPE_NONVOID, bool, const FXPPMImage *, self) \
198 function(FXPCXImage, loadPixels, FXImage, GVL_TYPE_NONVOID, bool, FXPCXImage *, self) \
199 function(FXPCXImage, savePixels, FXImage, GVL_TYPE_NONVOID, bool, const FXPCXImage *, self) \
200 function(FXRGBImage, loadPixels, FXImage, GVL_TYPE_NONVOID, bool, FXRGBImage *, self) \
201 function(FXRGBImage, savePixels, FXImage, GVL_TYPE_NONVOID, bool, const FXRGBImage *, self) \
202 function(FXTGAImage, loadPixels, FXImage, GVL_TYPE_NONVOID, bool, FXTGAImage *, self) \
203 function(FXTGAImage, savePixels, FXImage, GVL_TYPE_NONVOID, bool, const FXTGAImage *, self) \
204 function(FXTIFImage, loadPixels, FXImage, GVL_TYPE_NONVOID, bool, FXTIFImage *, self) \
205 function(FXTIFImage, savePixels, FXImage, GVL_TYPE_NONVOID, bool, const FXTIFImage *, self) \
206 function(FXXBMImage, loadPixels, FXImage, GVL_TYPE_NONVOID, bool, FXXBMImage *, self) \
207 function(FXXBMImage, savePixels, FXImage, GVL_TYPE_NONVOID, bool, const FXXBMImage *, self) \
208 function(FXXPMImage, loadPixels, FXImage, GVL_TYPE_NONVOID, bool, FXXPMImage *, self) \
209 function(FXXPMImage, savePixels, FXImage, GVL_TYPE_NONVOID, bool, const FXXPMImage *, self) \
210 function(FXIcon, loadPixels, FXImage, GVL_TYPE_NONVOID, bool, FXIcon *, self) \
211 function(FXIcon, savePixels, FXImage, GVL_TYPE_NONVOID, bool, const FXIcon *, self) \
212 function(FXBMPIcon, loadPixels, FXImage, GVL_TYPE_NONVOID, bool, FXBMPIcon *, self) \
213 function(FXBMPIcon, savePixels, FXImage, GVL_TYPE_NONVOID, bool, const FXBMPIcon *, self) \
214 function(FXJPGIcon, loadPixels, FXImage, GVL_TYPE_NONVOID, bool, FXJPGIcon *, self) \
215 function(FXJPGIcon, savePixels, FXImage, GVL_TYPE_NONVOID, bool, const FXJPGIcon *, self) \
216 function(FXGIFIcon, loadPixels, FXImage, GVL_TYPE_NONVOID, bool, FXGIFIcon *, self) \
217 function(FXGIFIcon, savePixels, FXImage, GVL_TYPE_NONVOID, bool, const FXGIFIcon *, self) \
218 function(FXICOIcon, loadPixels, FXImage, GVL_TYPE_NONVOID, bool, FXICOIcon *, self) \
219 function(FXICOIcon, savePixels, FXImage, GVL_TYPE_NONVOID, bool, const FXICOIcon *, self) \
220 function(FXPNGIcon, loadPixels, FXImage, GVL_TYPE_NONVOID, bool, FXPNGIcon *, self) \
221 function(FXPNGIcon, savePixels, FXImage, GVL_TYPE_NONVOID, bool, const FXPNGIcon *, self) \
222 function(FXPPMIcon, loadPixels, FXImage, GVL_TYPE_NONVOID, bool, FXPPMIcon *, self) \
223 function(FXPPMIcon, savePixels, FXImage, GVL_TYPE_NONVOID, bool, const FXPPMIcon *, self) \
224 function(FXPCXIcon, loadPixels, FXImage, GVL_TYPE_NONVOID, bool, FXPCXIcon *, self) \
225 function(FXPCXIcon, savePixels, FXImage, GVL_TYPE_NONVOID, bool, const FXPCXIcon *, self) \
226 function(FXRGBIcon, loadPixels, FXImage, GVL_TYPE_NONVOID, bool, FXRGBIcon *, self) \
227 function(FXRGBIcon, savePixels, FXImage, GVL_TYPE_NONVOID, bool, const FXRGBIcon *, self) \
228 function(FXTGAIcon, loadPixels, FXImage, GVL_TYPE_NONVOID, bool, FXTGAIcon *, self) \
229 function(FXTGAIcon, savePixels, FXImage, GVL_TYPE_NONVOID, bool, const FXTGAIcon *, self) \
230 function(FXTIFIcon, loadPixels, FXImage, GVL_TYPE_NONVOID, bool, FXTIFIcon *, self) \
231 function(FXTIFIcon, savePixels, FXImage, GVL_TYPE_NONVOID, bool, const FXTIFIcon *, self) \
232 function(FXXBMIcon, loadPixels, FXImage, GVL_TYPE_NONVOID, bool, FXXBMIcon *, self) \
233 function(FXXBMIcon, savePixels, FXImage, GVL_TYPE_NONVOID, bool, const FXXBMIcon *, self) \
234 function(FXXPMIcon, loadPixels, FXImage, GVL_TYPE_NONVOID, bool, FXXPMIcon *, self) \
235 function(FXXPMIcon, savePixels, FXImage, GVL_TYPE_NONVOID, bool, const FXXPMIcon *, self) \
236 function(FXChoiceBox, execute, FXDialogBox, GVL_TYPE_NONVOID, FXuint, FXChoiceBox *, self) \
237 function(FXColorDialog, execute, FXDialogBox, GVL_TYPE_NONVOID, FXuint, FXColorDialog *, self) \
238 function(FXDialogBox, execute, FXDialogBox, GVL_TYPE_NONVOID, FXuint, FXDialogBox *, self) \
239 function(FXDirDialog, execute, FXDialogBox, GVL_TYPE_NONVOID, FXuint, FXDirDialog *, self) \
240 function(FXFileDialog, execute, FXDialogBox, GVL_TYPE_NONVOID, FXuint, FXFileDialog *, self) \
241 function(FXFontDialog, execute, FXDialogBox, GVL_TYPE_NONVOID, FXuint, FXFontDialog *, self) \
242 function(FXInputDialog, execute, FXDialogBox, GVL_TYPE_NONVOID, FXuint, FXInputDialog *, self) \
243 function(FXMessageBox, execute, FXDialogBox, GVL_TYPE_NONVOID, FXuint, FXMessageBox *, self) \
244 function(FXPrintDialog, execute, FXDialogBox, GVL_TYPE_NONVOID, FXuint, FXPrintDialog *, self) \
245 function(FXProgressDialog, execute, FXDialogBox, GVL_TYPE_NONVOID, FXuint, FXProgressDialog *, self) \
246 function(FXReplaceDialog, execute, FXDialogBox, GVL_TYPE_NONVOID, FXuint, FXReplaceDialog *, self) \
247 function(FXSearchDialog, execute, FXDialogBox, GVL_TYPE_NONVOID, FXuint, FXSearchDialog *, self) \
248 function(FXWizard, execute, FXDialogBox, GVL_TYPE_NONVOID, FXuint, FXWizard *, self) \
249 function(FXApp, run, FXApp, GVL_TYPE_NONVOID, FXint, FXApp *, self) \
250 function(FXApp, runOneEvent, FXApp, GVL_TYPE_NONVOID, bool, FXApp *, self) \
251 function(FXApp, runUntil, FXApp, GVL_TYPE_NONVOID, FXint, FXApp *, self) \
252 function(FXApp, runWhileEvents, FXApp, GVL_TYPE_NONVOID, FXint, FXApp *, self) \
253 function(FXApp, runModalWhileEvents, FXApp, GVL_TYPE_NONVOID, FXint, FXApp *, self) \
254 function(FXApp, runModal, FXApp, GVL_TYPE_NONVOID, FXint, FXApp *, self) \
255 function(FXApp, runModalFor, FXApp, GVL_TYPE_NONVOID, FXint, FXApp *, self) \
256 function(FXApp, runModalWhileShown, FXApp, GVL_TYPE_NONVOID, FXint, FXApp *, self) \
257 function(FXApp, runPopup, FXApp, GVL_TYPE_NONVOID, FXint, FXApp *, self) \
258
259
260
261 FOR_EACH_BLOCKING_FUNCTION( DEFINE_GVL_STUB_DECL )
262
263 /*
264 * Definitions of callback functions and their parameters
265 */
266
267 #define FOR_EACH_PARAM_OF_FXRbCallVoidMethod_2(param) \
268 param(ID, , func)
269
270 #define FOR_EACH_PARAM_OF_FXRbCallVoidMethod_3(param) \
271 param(ID, , func) \
272 param(TYPE1, &, arg1)
273
274 #define FOR_EACH_PARAM_OF_FXRbCallVoidMethod_4(param) \
275 param(ID, , func) \
276 param(TYPE1, , arg1) \
277 param(TYPE2, , arg2)
278
279 #define FOR_EACH_PARAM_OF_FXRbCallVoidMethod_5(param) \
280 param(ID, , func) \
281 param(TYPE1, , arg1) \
282 param(TYPE2, , arg2) \
283 param(TYPE3, , arg3)
284
285 #define FOR_EACH_PARAM_OF_FXRbCallVoidMethod_6(param) \
286 param(ID, , func) \
287 param(TYPE1, &, arg1) \
288 param(TYPE2, , arg2) \
289 param(TYPE3, , arg3) \
290 param(TYPE4, , arg4)
291
292 #define FOR_EACH_PARAM_OF_FXRbCallVoidMethod_7(param) \
293 param(ID, , func) \
294 param(TYPE1, &, arg1) \
295 param(TYPE2, , arg2) \
296 param(TYPE3, , arg3) \
297 param(TYPE4, , arg4) \
298 param(TYPE5, , arg5)
299
300 #define FOR_EACH_PARAM_OF_FXRbCallVoidMethod_8(param) \
301 param(ID, , func) \
302 param(TYPE1, &, arg1) \
303 param(TYPE2, &, arg2) \
304 param(TYPE3, , arg3) \
305 param(TYPE4, , arg4) \
306 param(TYPE5, , arg5) \
307 param(TYPE6, , arg6)
308
309 #define FOR_EACH_PARAM_OF_FXRbCallVoidMethod_9(param) \
310 param(ID, , func) \
311 param(TYPE1, , arg1) \
312 param(TYPE2, , arg2) \
313 param(TYPE3, , arg3) \
314 param(TYPE4, , arg4) \
315 param(TYPE5, , arg5) \
316 param(TYPE6, , arg6) \
317 param(TYPE7, , arg7)
318
319 #define FOR_EACH_PARAM_OF_FXRbCallVoidMethod_10(param) \
320 param(ID, , func) \
321 param(TYPE1, &, arg1) \
322 param(TYPE2, , arg2) \
323 param(TYPE3, , arg3) \
324 param(TYPE4, , arg4) \
325 param(TYPE5, , arg5) \
326 param(TYPE6, , arg6) \
327 param(TYPE7, , arg7) \
328 param(TYPE8, , arg8)
329
330 #define FOR_EACH_PARAM_OF_FXRbCallVoidMethod_11(param) \
331 param(ID, , func) \
332 param(TYPE1, , arg1) \
333 param(TYPE2, , arg2) \
334 param(TYPE3, , arg3) \
335 param(TYPE4, , arg4) \
336 param(TYPE5, , arg5) \
337 param(TYPE6, , arg6) \
338 param(TYPE7, , arg7) \
339 param(TYPE8, , arg8) \
340 param(TYPE9, , arg9)
341
342 #define FOR_EACH_PARAM_OF_FXRbCallBoolMethod_2(param) \
343 param(ID, , func)
344
345 #define FOR_EACH_PARAM_OF_FXRbCallBoolMethod_3(param) \
346 param(ID, , func) \
347 param(TYPE1, &, arg1)
348
349 #define FOR_EACH_PARAM_OF_FXRbCallBoolMethod_4(param) \
350 param(ID, , func) \
351 param(TYPE1, , arg1) \
352 param(TYPE2, , arg2)
353
354 #define FOR_EACH_PARAM_OF_FXRbCallBoolMethod_5(param) \
355 param(ID, , func) \
356 param(TYPE1, , arg1) \
357 param(TYPE2, , arg2) \
358 param(TYPE3, , arg3)
359
360 #define FOR_EACH_PARAM_OF_FXRbCallBoolMethod_7(param) \
361 param(ID, , func) \
362 param(TYPE1, , arg1) \
363 param(TYPE2, , arg2) \
364 param(TYPE3, , arg3) \
365 param(TYPE4, , arg4) \
366 param(TYPE5, , arg5)
367
368 #define FOR_EACH_PARAM_OF_FXRbCallIntMethod_2(param) \
369 param(ID, , func)
370
371 #define FOR_EACH_PARAM_OF_FXRbCallIntMethod_3(param) \
372 param(ID, , func) \
373 param(TYPE1, , arg1)
374
375 #define FOR_EACH_PARAM_OF_FXRbCallIntMethod_4(param) \
376 param(ID, , func) \
377 param(TYPE1, , arg1) \
378 param(TYPE2, , arg2)
379
380 #define FOR_EACH_PARAM_OF_FXRbCallIntMethod_7(param) \
381 param(ID, , func) \
382 param(TYPE1, , arg1) \
383 param(TYPE2, , arg2) \
384 param(TYPE3, , arg3) \
385 param(TYPE4, , arg4) \
386 param(TYPE5, , arg5)
387
388 #define FOR_EACH_PARAM_OF_FXRbCallLongMethod_5(param) \
389 param(ID, , func) \
390 param(TYPE1, , arg1) \
391 param(TYPE2, , arg2) \
392 param(TYPE3, , arg3)
393
394 #define FOR_EACH_PARAM_OF_FXRbCallUIntMethod_3(param) \
395 param(ID, , func) \
396 param(TYPE1, , arg1)
397
398 #define FOR_EACH_PARAM_OF_FXRbCallUIntMethod_6(param) \
399 param(ID, , func) \
400 param(TYPE1, , arg1) \
401 param(TYPE2, , arg2) \
402 param(TYPE3, , arg3) \
403 param(TYPE4, , arg4)
404
405 #define FOR_EACH_PARAM_OF_FXRbCallGLObjectMethod_2(param) \
406 param(ID, , func)
407
408 #define FOR_EACH_PARAM_OF_FXRbCallGLObjectMethod_3(param) \
409 param(ID, , func) \
410 param(TYPE1, , arg1)
411
412 #define FOR_EACH_PARAM_OF_FXRbCallGLObjectMethod_4(param) \
413 param(ID, , func) \
414 param(TYPE1, , arg1) \
415 param(TYPE2, , arg2)
416
417 #define FOR_EACH_PARAM_OF_FXRbCallStringMethod_2(param) \
418 param(ID, , func)
419
420 #define FOR_EACH_PARAM_OF_FXRbCallCStringMethod_4(param) \
421 param(ID, , func) \
422 param(TYPE1, , arg1) \
423 param(TYPE2, , arg2)
424
425 #define FOR_EACH_PARAM_OF_FXRbCallCStringMethod_5(param) \
426 param(ID, , func) \
427 param(TYPE1, , arg1) \
428 param(TYPE2, , arg2) \
429 param(TYPE3, , arg3)
430
431 #define FOR_EACH_PARAM_OF_FXRbCallGLObjectArrayMethod_6(param) \
432 param(ID, , func) \
433 param(TYPE1, , arg1) \
434 param(TYPE2, , arg2) \
435 param(TYPE3, , arg3) \
436 param(TYPE4, , arg4)
437
438 #define FOR_EACH_PARAM_OF_FXRbCallTableItemMethod_5(param) \
439 param(ID, , func) \
440 param(TYPE1, , arg1) \
441 param(TYPE2, , arg2) \
442 param(TYPE3, , arg3)
443
444 #define FOR_EACH_PARAM_OF_FXRbCallFileAssocMethod_3(param) \
445 param(ID, , func) \
446 param(TYPE1, , arg1)
447
448 #define FOR_EACH_PARAM_OF_FXRbCallIconMethod_2(param) \
449 param(ID, , func)
450
451 #define FOR_EACH_PARAM_OF_FXRbCallIconMethod_4(param) \
452 param(ID, , func) \
453 param(TYPE1, &, arg1) \
454 param(TYPE2, &, arg2)
455
456 #define FOR_EACH_PARAM_OF_FXRbCallIconMethod_6(param) \
457 param(ID, , func) \
458 param(TYPE1, &, arg1) \
459 param(TYPE2, &, arg2) \
460 param(TYPE3, &, arg3) \
461 param(TYPE4, &, arg4)
462
463 #define FOR_EACH_PARAM_OF_FXRbCallImageMethod_4(param) \
464 param(ID, , func) \
465 param(TYPE1, &, arg1) \
466 param(TYPE2, &, arg2)
467
468 #define FOR_EACH_PARAM_OF_FXRbCallImageMethod_6(param) \
469 param(ID, , func) \
470 param(TYPE1, &, arg1) \
471 param(TYPE2, &, arg2) \
472 param(TYPE3, &, arg3) \
473 param(TYPE4, &, arg4)
474
475 #define FOR_EACH_PARAM_OF_FXRbCallWindowMethod_3(param) \
476 param(ID, , func) \
477 param(TYPE1, , arg1)
478
479 #define FOR_EACH_PARAM_OF_FXRbCallColorMethod_4(param) \
480 param(ID, , func) \
481 param(TYPE1, , arg1) \
482 param(TYPE2, , arg2)
483
484 #define FOR_EACH_PARAM_OF_FXRbCallRangeMethod_2(param) \
485 param(ID, , func)
486
487 #define FOR_EACH_PARAM_OF_FXRbCallWCharMethod_2(param) \
488 param(ID, , func)
489
490 #define FOR_EACH_PARAM_OF_FXRbCallSetDashes_5(param) \
491 param(ID, , func) \
492 param(TYPE1, , arg1) \
493 param(TYPE2, , arg2) \
494 param(TYPE3, , arg3)
495
496 #define FOR_EACH_PARAM_OF_FXRbLookupHandler_2(param) \
497 param(ITEMB, , itemb)
498
499 #define FOR_EACH_PARAM_OF_FXRbHandleMessage_5(param) \
500 param(ID, , func) \
501 param(TYPE1, , arg1) \
502 param(TYPE2, , arg2) \
503 param(TYPE3, , arg3)
504
505 #define FOR_EACH_PARAM_OF_FXRbComboBox_sortFunc_2(param) \
506 param(ITEMB, , itemb)
507
508 #define FOR_EACH_PARAM_OF_FXRbFoldingList_sortFunc_2(param) \
509 param(ITEMB, , itemb)
510
511 #define FOR_EACH_PARAM_OF_FXRbIconList_sortFunc_2(param) \
512 param(ITEMB, , itemb)
513
514 #define FOR_EACH_PARAM_OF_FXRbList_sortFunc_2(param) \
515 param(ITEMB, , itemb)
516
517 #define FOR_EACH_PARAM_OF_FXRbListBox_sortFunc_2(param) \
518 param(ITEMB, , itemb)
519
520 #define FOR_EACH_PARAM_OF_FXRbTreeList_sortFunc_2(param) \
521 param(ITEMB, , itemb)
522
523 #define FOR_EACH_PARAM_OF_FXRbCallDCDrawMethod_5(param) \
524 param(ID, , func) \
525 param(TYPE1, , arg1) \
526 param(TYPE2, , arg2) \
527 param(TYPE3, &, arg3)
528
529 #define FOR_EACH_PARAM_OF_FXRbCallDCDrawMethod_6(param) \
530 param(ID, , func) \
531 param(TYPE1, , arg1) \
532 param(TYPE2, , arg2) \
533 param(TYPE3, , arg3) \
534 param(TYPE4, , arg4)
535
536 #define FOR_EACH_PARAM_OF_FXRbCallTreeItemMethod_4(param) \
537 param(ID, , func) \
538 param(TYPE1, , arg1) \
539 param(TYPE2, , arg2)
540
541 #define FOR_EACH_PARAM_OF_FXRbCallFoldingItemMethod_4(param) \
542 param(ID, , func) \
543 param(TYPE1, , arg1) \
544 param(TYPE2, , arg2)
545
546 #define FOR_EACH_PARAM_OF_FXRbApp_onChoreThreads_4(param) \
547 param(ID, , func) \
548 param(TYPE1, , arg1) \
549 param(TYPE2, , arg2)
550
551
552 /* function( name, void_or_nonvoid, returntype, firstparamtype, firstparamname, paramcount ) */
553 #define FOR_EACH_CALLBACK_FUNCTION(function) \
554 function(FXRbCallVoidMethod, GVL_TYPE_VOID, void, RECV, recv, 2) \
555 function(FXRbCallVoidMethod, GVL_TYPE_VOID, void, RECV, recv, 3) \
556 function(FXRbCallVoidMethod, GVL_TYPE_VOID, void, RECV, recv, 4) \
557 function(FXRbCallVoidMethod, GVL_TYPE_VOID, void, RECV, recv, 5) \
558 function(FXRbCallVoidMethod, GVL_TYPE_VOID, void, RECV, recv, 6) \
559 function(FXRbCallVoidMethod, GVL_TYPE_VOID, void, RECV, recv, 7) \
560 function(FXRbCallVoidMethod, GVL_TYPE_VOID, void, RECV, recv, 8) \
561 function(FXRbCallVoidMethod, GVL_TYPE_VOID, void, RECV, recv, 9) \
562 function(FXRbCallVoidMethod, GVL_TYPE_VOID, void, RECV, recv, 10) \
563 function(FXRbCallVoidMethod, GVL_TYPE_VOID, void, RECV, recv, 11) \
564 function(FXRbCallBoolMethod, GVL_TYPE_NONVOID, bool, RECV, recv, 2) \
565 function(FXRbCallBoolMethod, GVL_TYPE_NONVOID, bool, RECV, recv, 3) \
566 function(FXRbCallBoolMethod, GVL_TYPE_NONVOID, bool, RECV, recv, 4) \
567 function(FXRbCallBoolMethod, GVL_TYPE_NONVOID, bool, RECV, recv, 5) \
568 function(FXRbCallBoolMethod, GVL_TYPE_NONVOID, bool, RECV, recv, 7) \
569 function(FXRbCallIntMethod, GVL_TYPE_NONVOID, FXint, RECV, recv, 2) \
570 function(FXRbCallIntMethod, GVL_TYPE_NONVOID, FXint, RECV, recv, 3) \
571 function(FXRbCallIntMethod, GVL_TYPE_NONVOID, FXint, RECV, recv, 4) \
572 function(FXRbCallIntMethod, GVL_TYPE_NONVOID, FXint, RECV, recv, 7) \
573 function(FXRbCallLongMethod, GVL_TYPE_NONVOID, FXint, RECV, recv, 5) \
574 function(FXRbCallUIntMethod, GVL_TYPE_NONVOID, FXint, RECV, recv, 3) \
575 function(FXRbCallUIntMethod, GVL_TYPE_NONVOID, FXint, RECV, recv, 6) \
576 function(FXRbCallGLObjectMethod, GVL_TYPE_NONVOID, FXGLObject*, RECV, recv, 2) \
577 function(FXRbCallGLObjectMethod, GVL_TYPE_NONVOID, FXGLObject*, RECV, recv, 3) \
578 function(FXRbCallGLObjectMethod, GVL_TYPE_NONVOID, FXGLObject*, RECV, recv, 4) \
579 function(FXRbCallStringMethod, GVL_TYPE_NONVOID, FXString, RECV, recv, 2) \
580 function(FXRbCallCStringMethod, GVL_TYPE_NONVOID, const FXchar*, RECV, recv, 4) \
581 function(FXRbCallCStringMethod, GVL_TYPE_NONVOID, const FXchar*, RECV, recv, 5) \
582 function(FXRbCallGLObjectArrayMethod, GVL_TYPE_NONVOID, FXGLObject**, RECV, recv, 6) \
583 function(FXRbCallTableItemMethod, GVL_TYPE_NONVOID, FXTableItem*, RECV, recv, 5) \
584 function(FXRbCallFileAssocMethod, GVL_TYPE_NONVOID, FXFileAssoc*, RECV, recv, 3) \
585 function(FXRbCallIconMethod, GVL_TYPE_NONVOID, FXIcon*, RECV, recv, 2) \
586 function(FXRbCallIconMethod, GVL_TYPE_NONVOID, FXIcon*, RECV, recv, 4) \
587 function(FXRbCallIconMethod, GVL_TYPE_NONVOID, FXIcon*, RECV, recv, 6) \
588 function(FXRbCallImageMethod, GVL_TYPE_NONVOID, FXImage*, RECV, recv, 4) \
589 function(FXRbCallImageMethod, GVL_TYPE_NONVOID, FXImage*, RECV, recv, 6) \
590 function(FXRbCallWindowMethod, GVL_TYPE_NONVOID, FXWindow*, RECV, recv, 3) \
591 function(FXRbCallColorMethod, GVL_TYPE_NONVOID, FXColor, RECV, recv, 4) \
592 function(FXRbCallRangeMethod, GVL_TYPE_NONVOID, FXRangef, RECV, recv, 2) \
593 function(FXRbCallWCharMethod, GVL_TYPE_NONVOID, FXwchar, RECV, recv, 2) \
594 function(FXRbCallSetDashes, GVL_TYPE_VOID, void, RECV, recv, 5) \
595 function(FXRbLookupHandler, GVL_TYPE_NONVOID, ID, RECV, recv, 2) \
596 function(FXRbHandleMessage, GVL_TYPE_NONVOID, long, RECV, recv, 5) \
597 function(FXRbComboBox_sortFunc, GVL_TYPE_NONVOID, FXint, ITEMA, itema, 2) \
598 function(FXRbFoldingList_sortFunc, GVL_TYPE_NONVOID, FXint, ITEMA, itema, 2) \
599 function(FXRbIconList_sortFunc, GVL_TYPE_NONVOID, FXint, ITEMA, itema, 2) \
600 function(FXRbList_sortFunc, GVL_TYPE_NONVOID, FXint, ITEMA, itema, 2) \
601 function(FXRbListBox_sortFunc, GVL_TYPE_NONVOID, FXint, ITEMA, itema, 2) \
602 function(FXRbTreeList_sortFunc, GVL_TYPE_NONVOID, FXint, ITEMA, itema, 2) \
603 function(FXRbCallDCDrawMethod, GVL_TYPE_VOID, void, RECV, recv, 5) \
604 function(FXRbCallDCDrawMethod, GVL_TYPE_VOID, void, RECV, recv, 6) \
605 function(FXRbCallTreeItemMethod, GVL_TYPE_NONVOID, FXTreeItem*, RECV, recv, 4) \
606 function(FXRbCallFoldingItemMethod, GVL_TYPE_NONVOID, FXFoldingItem*, RECV, recv, 4) \
607 function(FXRbApp_onChoreThreads, GVL_TYPE_NONVOID, long, RECV, recv, 4) \
608
609
610 FOR_EACH_CALLBACK_FUNCTION( DEFINE_GVLCB_STUB_DECL )
611 FOR_EACH_CALLBACK_FUNCTION( DEFINE_GVLCB_WRAPPER_STRUCT )
612 FOR_EACH_CALLBACK_FUNCTION( DEFINE_GVLCB_SKELETON )
613 FOR_EACH_CALLBACK_FUNCTION( DEFINE_GVLCB_STUB )
614
615 #endif /* end __gvl_wrappers_h */
00 #!/bin/env ruby
11
2 $special_stubclasses = ["FXGLSHAPE", "FXICONITEM", "FXTABLE", "FXTABLEITEM", "FXTREEITEM"]
2 $special_stubclasses = ["FXGLSHAPE", "FXICONITEM", "FXTABLE", "FXTABLEITEM", "FXTEXT", "FXTREEITEM"]
33
44 class Processor
55 def initialize
530530
531531
532532 void FXRbTable::markfunc(FXTable* self){
533 register FXTableItem* item;
534533 FXRbScrollArea::markfunc(self);
535534 if(self){
536535 FXRbGcMark(self->FXTable::getFont());
538537 FXRbGcMark(self->FXTable::getColumnHeaderFont());
539538 for(FXint row=0;row<self->FXTable::getNumRows();row++){
540539 for(FXint col=0;col<self->FXTable::getNumColumns();col++){
541 item=self->FXTable::getItem(row,col);
540 FXTableItem* item=self->FXTable::getItem(row,col);
542541 FXRbGcMark(item);
543542 }
544543 }
0 # coding: utf-8
1 lib = File.expand_path('../lib', __FILE__)
2 $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3 require 'fox16/version'
4
5 SWIG_MODULES = {
6 "core.i" => "core_wrap.cpp",
7 "dcmodule.i" => "dc_wrap.cpp",
8 "dialogs.i" => "dialogs_wrap.cpp",
9 "framesmodule.i" => "frames_wrap.cpp",
10 "iconlistmodule.i" => "iconlist_wrap.cpp",
11 "icons.i" => "icons_wrap.cpp",
12 "image.i" => "image_wrap.cpp",
13 "labelmodule.i" => "label_wrap.cpp",
14 "layout.i" => "layout_wrap.cpp",
15 "listmodule.i" => "list_wrap.cpp",
16 "mdi.i" => "mdi_wrap.cpp",
17 "menumodule.i" => "menu_wrap.cpp",
18 "fx3d.i" => "fx3d_wrap.cpp",
19 "scintilla.i" => "scintilla_wrap.cpp",
20 "table-module.i" => "table_wrap.cpp",
21 "text-module.i" => "text_wrap.cpp",
22 "treelist-module.i" => "treelist_wrap.cpp",
23 "ui.i" => "ui_wrap.cpp"
24 }
25
26 Gem::Specification.new do |spec|
27 spec.name = "fxruby"
28 spec.version = Fox.fxrubyversion
29 spec.authors = ["Lyle Johnson", "Lars Kanis"]
30 spec.email = ["[email protected]", "[email protected]"]
31
32 spec.summary = %q{FXRuby is the Ruby binding to the FOX GUI toolkit.}
33 spec.homepage = "https://github.com/larskanis/fxruby"
34 spec.license = 'LGPL-2.1'
35
36 spec.files = `git ls-files -z`.split("\x0").reject do |f|
37 f=~/^fox-includes|^web/
38 end
39 spec.files += SWIG_MODULES.values.map{|f| File.join("ext/fox16_c", f) }
40 spec.files << 'ext/fox16_c/include/inlinestubs.h'
41 spec.files << 'ext/fox16_c/swigruby.h'
42 spec.files << 'doap.rdf'
43 spec.files << 'lib/fox16/kwargs.rb'
44
45 spec.bindir = "exe"
46 spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
47 spec.require_paths = ["lib"]
48 spec.extensions = ["ext/fox16_c/extconf.rb"]
49 spec.metadata['msys2_mingw_dependencies'] = 'fox'
50 spec.required_ruby_version = "~> 2.2"
51
52 spec.add_runtime_dependency 'mini_portile2', '~> 2.1'
53 end
19751975 end
19761976 class FXGLVisual
19771977 def FXGLVisual.supported?(*args) # :nodoc:
1978 FXGLVisual.supported(*args)
1978 FXGLVisual.supported(*args)[0]
19791979 end
19801980 def redSize(*args) # :nodoc:
19811981 getRedSize(*args)
24122412 class FXImage
24132413 def data(*args) # :nodoc:
24142414 getData(*args)
2415 end
2416 def dataPtr(*args) # :nodoc:
2417 getDataPtr(*args)
24152418 end
24162419 def pixels=(*args) # :nodoc:
24172420 setPixels(*args)
9898 btn.connect(SEL_COMMAND) do |send, sel, ev|
9999 @selected = Time.local(@date_showing.year, @date_showing.month,
100100 send.text.to_i)
101 target.handle(self, MKUINT(selector, SEL_COMMAND), @selected) if target
101 target.handle(self, Fox.MKUINT(selector, SEL_COMMAND), @selected) if target
102102 end
103103 end
104104 _build_date_matrix()
201201
202202 if __FILE__ == $0
203203
204 include Fox
205
206 app = FXApp.new('Calendar', 'FXRuby')
204 app = Fox::FXApp.new('Calendar', 'FXRuby')
207205 app.init(ARGV)
208 mainwin = FXMainWindow.new(app, "Calendar Test", nil, nil, DECOR_ALL, 0, 0, 500, 500)
209 calendar = FXCalendar.new(mainwin, Time.now, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y)
210 calendar.connect(SEL_COMMAND) do |sender, sel, data|
206 mainwin = Fox::FXMainWindow.new(app, "Calendar Test", nil, nil, Fox::DECOR_ALL, 0, 0, 500, 500)
207 calendar = Fox::FXCalendar.new(mainwin, Time.now, nil, 0, Fox::LAYOUT_FILL_X|Fox::LAYOUT_FILL_Y)
208 calendar.connect(Fox::SEL_COMMAND) do |sender, sel, data|
211209 puts data.to_s
212210 end
213211 app.create
214 mainwin.show(PLACEMENT_SCREEN)
212 mainwin.show(Fox::PLACEMENT_SCREEN)
215213 app.run
216214 end
311311 shape.select
312312 @canvas.updateShape(shape)
313313 if notify && (@canvas.target != nil)
314 @canvas.target.handle(@canvas, MKUINT(@canvas.message, SEL_SELECTED), shape)
314 @canvas.target.handle(@canvas, Fox.MKUINT(@canvas.message, SEL_SELECTED), shape)
315315 end
316316 end
317317 end
321321 shape.deselect
322322 @canvas.updateShape(shape)
323323 if notify && (@canvas.target != nil)
324 @canvas.target.handle(@canvas, MKUINT(@canvas.message, SEL_DESELECTED), shape)
324 @canvas.target.handle(@canvas, Fox.MKUINT(@canvas.message, SEL_DESELECTED), shape)
325325 end
326326 end
327327 end
462462 updateShape(shape)
463463 changes = true
464464 if notify && (target != nil)
465 target.handle(self, MKUINT(message, SEL_DESELECTED), shape)
465 target.handle(self, Fox.MKUINT(message, SEL_DESELECTED), shape)
466466 end
467467 end
468468 end
485485 def onMotion(sender, sel, evt)
486486 # Drag and drop mode
487487 if (@flags & FLAG_DODRAG) != 0
488 handle(self, MKUINT(0, SEL_DRAGGED), evt)
488 handle(self, Fox.MKUINT(0, SEL_DRAGGED), evt)
489489 return 1
490490 end
491491
493493 if (@flags & FLAG_TRYDRAG) != 0
494494 if evt.moved?
495495 @flags &= ~FLAG_TRYDRAG
496 if handle(this, MKUINT(0, SEL_BEGINDRAG), evt) != 0
496 if handle(this, Fox.MKUINT(0, SEL_BEGINDRAG), evt) != 0
497497 @flags |= FLAG_DODRAG
498498 end
499499 end
503503
504504 # Left button press
505505 def onLeftBtnPress(sender, sel, evt)
506 handle(self, MKUINT(0, SEL_FOCUS_SELF), evt)
506 handle(self, Fox.MKUINT(0, SEL_FOCUS_SELF), evt)
507507 if enabled?
508508 grab
509509 flags &= ~FLAG_UPDATE
510510
511511 # Give target the first chance at handling this
512 return 1 if target && (target.handle(self, MKUINT(message, SEL_LEFTBUTTONPRESS), evt) != 0)
512 return 1 if target && (target.handle(self, Fox.MKUINT(message, SEL_LEFTBUTTONPRESS), evt) != 0)
513513
514514 # Locate shape
515515 shape = findShape(evt.win_x, evt.win_y)
547547 @flags &= ~(FLAG_PRESSED|FLAG_TRYDRAG|FLAG_LASSO|FLAG_DODRAG)
548548
549549 # First chance callback
550 return 1 if target && target.handle(self, MKUINT(message, SEL_LEFTBUTTONRELEASE), evt) != 0
550 return 1 if target && target.handle(self, Fox.MKUINT(message, SEL_LEFTBUTTONRELEASE), evt) != 0
551551
552552 # Was dragging
553553 if (flg & FLAG_DODRAG) != 0
554 handle(self, MKUINT(0, SEL_ENDDRAG), evt)
554 handle(self, Fox.MKUINT(0, SEL_ENDDRAG), evt)
555555 return 1
556556 end
557557
564564
565565 # Generate clicked callbacks
566566 if evt.click_count == 1
567 handle(self, MKUINT(0, SEL_CLICKED), @currentShape)
567 handle(self, Fox.MKUINT(0, SEL_CLICKED), @currentShape)
568568 elsif evt.click_count == 2
569 handle(self, MKUINT(0, SEL_DOUBLECLICKED), @currentShape)
569 handle(self, Fox.MKUINT(0, SEL_DOUBLECLICKED), @currentShape)
570570 elseif evt.click_count == 3
571 handle(self, MKUINT(0, SEL_TRIPLECLICKED), @currentShape)
571 handle(self, Fox.MKUINT(0, SEL_TRIPLECLICKED), @currentShape)
572572 end
573573
574574 # Generate command callback only when clicked on item
575575 if @currentShape && @currentShape.enabled?
576 handle(self, MKUINT(0, SEL_COMMAND), @currentShape)
576 handle(self, Fox.MKUINT(0, SEL_COMMAND), @currentShape)
577577 end
578578 return 1
579579 end
583583
584584 # Command message
585585 def onCommand(sender, sel, ptr)
586 return target && target.handle(self, MKUINT(message, SEL_COMMAND), ptr)
586 return target && target.handle(self, Fox.MKUINT(message, SEL_COMMAND), ptr)
587587 end
588588
589589 # Clicked on canvas
590590 def onClicked(sender, sel, ptr)
591 return target && target.handle(self, MKUINT(message, SEL_CLICKED), ptr)
591 return target && target.handle(self, Fox.MKUINT(message, SEL_CLICKED), ptr)
592592 end
593593
594594 # Double-clicked on canvas
595595 def onDoubleClicked(sender, sel, ptr)
596 return target && target.handle(self, MKUINT(message, SEL_DOUBLECLICKED), ptr)
596 return target && target.handle(self, Fox.MKUINT(message, SEL_DOUBLECLICKED), ptr)
597597 end
598598
599599 # Triple-clicked on canvas
600600 def onTripleClicked(sender, sel, ptr)
601 return target && target.handle(self, MKUINT(message, SEL_TRIPLECLICKED), ptr)
601 return target && target.handle(self, Fox.MKUINT(message, SEL_TRIPLECLICKED), ptr)
602602 end
603603 end
604604 end
(No changes)
(No changes)
420420 #
421421 def FXStreamError.makeStreamError(status)
422422 case status
423 when FXStreamEnd
424 FXStreamEndError
425 when FXStreamFull
426 FXStreamFullError
427 when FXStreamNoWrite
428 FXStreamNoWriteError
429 when FXStreamNoRead
430 FXStreamNoReadError
431 when FXStreamFormat
432 FXStreamFormatError
433 when FXStreamUnknown
434 FXStreamUnknownError
435 when FXStreamAlloc
436 FXStreamAllocError
437 when FXStreamFailure
438 FXStreamFailureError
439 else
440 FXStreamError
423 when FXStreamEnd
424 FXStreamEndError
425 when FXStreamFull
426 FXStreamFullError
427 when FXStreamNoWrite
428 FXStreamNoWriteError
429 when FXStreamNoRead
430 FXStreamNoReadError
431 when FXStreamFormat
432 FXStreamFormatError
433 when FXStreamUnknown
434 FXStreamUnknownError
435 when FXStreamAlloc
436 FXStreamAllocError
437 when FXStreamFailure
438 FXStreamFailureError
439 else
440 FXStreamError
441441 end
442442 end
443443 end
624624 end
625625 end
626626
627 class FXHVec
628 def normalize!
629 normalized = self.normalize
630 0.upto(3) { |idx| self[idx] = normalized[idx] }
631 self
632 end
633 end
634
635627 class FXTable
636628 #
637629 # Append _numColumns_ columns to the right of the table..
(No changes)
(No changes)
(No changes)
44 alias addInputOrig addInput # :nodoc:
55
66 #
7 # Add a file descriptor _fileDesc_ to be watched for activity as determined
8 # by _mode_, where _mode_ is a bitwise OR (+INPUT_READ+, +INPUT_WRITE+, +INPUT_EXCEPT+).
9 # A message of type +SEL_IO_READ+, +SEL_IO_WRITE+, or +SEL_IO_EXCEPT+ will be sent
10 # to the target when the specified activity is detected on the file descriptor.
7 # Add an IO object as _io_ to be watched for activity as determined by _mode_, where _mode_ is a bitwise OR (+INPUT_READ+, +INPUT_WRITE+, +INPUT_EXCEPT+).
8 # A message of type +SEL_IO_READ+, +SEL_IO_WRITE+, or +SEL_IO_EXCEPT+ will be sent to the target when the specified activity is detected on the file descriptor.
9 #
10 # On POSIX operating systems all kinds of file descriptors can be watched.
11 # It works for +Socket.new+, +IO.popen+, +IO.pipe+, +IO.for_fd+, +File.open+, etc.
12 # Windows provides level triggered events only for network sockets.
13 # So on Windows only socket IO objects like +TCPSocket.new+ and +TCPServer.new+ are currently supported to be watched.
1114 #
1215 # There are several forms for #addInput; the original form (from FOX)
1316 # takes four arguments:
2932 # ... handle the I/O event ...
3033 # }
3134 #
32
33 def addInput(fd, mode, *args, &block)
35 def addInput(io, mode, *args, &block)
3436 params = {}
3537 params = args.pop if args.last.is_a? Hash
3638 tgt, sel = nil, 0
5052 tgt.pconnect(SEL_IO_WRITE, block, params)
5153 tgt.pconnect(SEL_IO_EXCEPT, block, params)
5254 end
53 addInputOrig(fd, mode, tgt, sel)
55 addInputOrig(io, mode, tgt, sel)
5456 end
5557
5658 end # class FXApp
(No changes)
(No changes)
(No changes)
(No changes)
0 require 'thread'
1
2 module Fox
3
4 class FXApp
5
6 alias initialize_before_thread initialize # :nodoc:
7
8 def initialize(*args, &block)
9 initialize_before_thread(*args)
10 event_handler_setup
11 block.call(self) if block_given?
12 end
13
14 def runOnUiThread(&block)
15 @event_handler_events << block
16 @event_handler_pwr.write 'e'
17 end
18
19 private
20
21 def event_handler_setup
22 if RUBY_PLATFORM =~ /mingw|mswin/i
23 require 'socket'
24 gs = TCPServer.open('localhost', 0)
25 prd = TCPSocket.open('localhost', gs.addr[1])
26 pwr = gs.accept
27 gs.close
28 else
29 prd, pwr = IO.pipe
30 end
31 self.addInput(prd, Fox::INPUT_READ){ event_handler_pull(prd) }
32 @event_handler_pwr = pwr
33 @event_handler_events = Queue.new
34 end
35
36 def event_handler_pull(prd)
37 prd.read(1)
38 while !@event_handler_events.empty?
39 ev = @event_handler_events.shift
40 ev.call
41 end
42 end
43
44 end # class FXApp
45
46 class FXId
47 def runOnUiThread(&block)
48 app.runOnUiThread(&block)
49 end
50 end
51 end # module Fox
(No changes)
(No changes)
343343
344344 def onUpdUndo(sender, sel, ptr) # :nodoc:
345345 if canUndo?
346 sender.handle(self, MKUINT(FXWindow::ID_ENABLE, SEL_COMMAND), nil)
347 else
348 sender.handle(self, MKUINT(FXWindow::ID_DISABLE, SEL_COMMAND), nil)
346 sender.handle(self, Fox.MKUINT(FXWindow::ID_ENABLE, SEL_COMMAND), nil)
347 else
348 sender.handle(self, Fox.MKUINT(FXWindow::ID_DISABLE, SEL_COMMAND), nil)
349349 end
350350 return 1
351351 end
357357
358358 def onUpdRedo(sender, sel, ptr) # :nodoc:
359359 if canRedo?
360 sender.handle(self, MKUINT(FXWindow::ID_ENABLE, SEL_COMMAND), nil)
361 else
362 sender.handle(self, MKUINT(FXWindow::ID_DISABLE, SEL_COMMAND), nil)
360 sender.handle(self, Fox.MKUINT(FXWindow::ID_ENABLE, SEL_COMMAND), nil)
361 else
362 sender.handle(self, Fox.MKUINT(FXWindow::ID_DISABLE, SEL_COMMAND), nil)
363363 end
364364 return 1
365365 end
371371
372372 def onUpdClear(sender, sel, ptr) # :nodoc:
373373 if canUndo? || canRedo?
374 sender.handle(self, MKUINT(FXWindow::ID_ENABLE, SEL_COMMAND), nil)
375 else
376 sender.handle(self, MKUINT(FXWindow::ID_DISABLE, SEL_COMMAND), nil)
374 sender.handle(self, Fox.MKUINT(FXWindow::ID_ENABLE, SEL_COMMAND), nil)
375 else
376 sender.handle(self, Fox.MKUINT(FXWindow::ID_DISABLE, SEL_COMMAND), nil)
377377 end
378378 return 1
379379 end
385385
386386 def onUpdRevert(sender, sel, ptr) # :nodoc:
387387 if canRevert?
388 sender.handle(self, MKUINT(FXWindow::ID_ENABLE, SEL_COMMAND), nil)
389 else
390 sender.handle(self, MKUINT(FXWindow::ID_DISABLE, SEL_COMMAND), nil)
388 sender.handle(self, Fox.MKUINT(FXWindow::ID_ENABLE, SEL_COMMAND), nil)
389 else
390 sender.handle(self, Fox.MKUINT(FXWindow::ID_DISABLE, SEL_COMMAND), nil)
391391 end
392392 return 1
393393 end
00 module Fox
11 def Fox.fxrubyversion
2 "1.6.29"
2 "1.6.42"
33 end
44 end
55 major_minor = RUBY_VERSION[ /^(\d+\.\d+)/ ] or
66 raise "Oops, can't extract the major/minor version from #{RUBY_VERSION.dump}"
77
8 # Set the PATH environment variable, so that libpq.dll can be found.
9 old_path = ENV['PATH']
10 ENV['PATH'] = "#{File.expand_path("../#{RUBY_PLATFORM.gsub("i386", "x86")}", __FILE__)};#{old_path}"
11 require "#{major_minor}/fox16_c"
12 ENV['PATH'] = old_path
8 add_dll_path = proc do |path, &block|
9 begin
10 require 'ruby_installer/runtime'
11 RubyInstaller::Runtime.add_dll_directory(path, &block)
12 rescue LoadError
13 old_path = ENV['PATH']
14 ENV['PATH'] = "#{path};#{old_path}"
15 block.call
16 ENV['PATH'] = old_path
17 end
18 end
19
20 # Temporary add this directory for DLL search, so that bundled DLLs can be found.
21 ports_dir = RbConfig::CONFIG["host"].gsub('i686-pc-mingw32') do
22 major_minor < '2.0' ? 'i586-mingw32msvc' : 'i686-w64-mingw32'
23 end
24 ports_bin = File.expand_path("../../ports/#{ports_dir}/bin", __FILE__)
25 add_dll_path.call(ports_bin) do
26 require "#{major_minor}/fox16_c"
27 end
1328 else
1429 raise
1530 end
2742 require "fox16/version"
2843 require "fox16/kwargs"
2944 require "fox16/exceptions_for_fxerror"
45 require "fox16/thread"
537537
538538 # Check to see if multithreaded applications are supported
539539 def threadsEnabled?(); end
540
541 # Runs the specified block on the UI thread.
542 #
543 # The block is posted to the event queue of the UI thread.
544 def runOnUiThread(&block); end
540545 end
541546 end
7676 # even support no OpenGL at all! This function returns the lesser
7777 # of the client support level and the display server support level.
7878 #
79 # Return an array with the following 3 elements: [supported, major, minor]
80 #
81 def FXGLVisual.supported(app); end
82
83 # Test if OpenGL is possible.
84 #
85 # Same as {FXGLVisual.supported}, but returns the first element (true/false) only.
86 #
7987 def FXGLVisual.supported?(app); end
8088
8189 # Return +true+ if double-buffered
266266 # after the item is appended.
267267 def appendItem(text, bigIcon=nil, miniIcon=nil, data=nil, notify=false); end
268268
269 alias << appendItem
270
269271 # Prepend a new (possibly subclassed) _item_ to the beginning of the list.
270272 # If _notify_ is +true+, a +SEL_INSERTED+ message is sent to the list's message target
271273 # after the item is prepended.
2929 # Destroy resource.
3030 #
3131 def destroy(); end
32
33 # Runs the specified block on the UI thread.
34 #
35 # The block is posted to the event queue of the UI thread.
36 def runOnUiThread(&block); end
3237 end
3338 end
4444 # [deprecated] Pixel data {FXMemoryBuffer}
4545 attr_reader :data
4646
47 # The pointer to the raw color representation of all image pixels.
48 #
49 # It can be used to pass raw image data to FFI, Fiddle or OpenGL.
50 attr_reader :dataPtr
51
4752 # Array of colors of all image pixels. Can also be written as String of raw [RGBA] values.
4853 attr_accessor :pixels
4954
216216 # Returns the integer index of the newly appended item.
217217 def appendItem(text, icon=nil, data=nil, notify=false) ; end
218218
219 alias << appendItem
220
219221 # Prepend a (possibly subclassed) _item_ to the list, e.g.
220222 #
221223 # list.prependItem(FXListItem.new("clyde"))
185185 # Sort items using current sort function
186186 def sortItems; end
187187
188 alias appendItem <<
188 alias << appendItem
189189 end
190190 end
435435 #
436436 # Search for _string_ in text buffer, and return the extent of
437437 # the string as a two-element array of arrays.
438 # The first array contains the beginning index (or indices)
439 # and the second array contains the ending index (or indices).
438 # The first array contains the beginning index (or indices if +SEARCH_REGEX+)
439 # and the second array contains the ending index (or indices if +SEARCH_REGEX+) of the first match.
440440 # The search starts from the given
441441 # _start_ position, scans forward (+SEARCH_FORWARD+) or backward
442442 # (+SEARCH_BACKWARD+), and wraps around if +SEARCH_WRAP+ has been
444444 # case insensitive search (+SEARCH_IGNORECASE+), or regular expression
445445 # search (+SEARCH_REGEX+).
446446 #
447 # For regular expression searches, the found regex match begin and end is returned at index 0 and captures are returned as entries starting at index 1 in both beginning and ending arrays.
448 #
447449 def findText(string, start=0, flags=SEARCH_FORWARD|SEARCH_WRAP|SEARCH_EXACT); end
448450
449451 # Return +true+ if position _pos_ is selected
356356 */
357357 bool addInput(VALUE obj,FXuint mode,FXObject *tgt,FXSelector sel){
358358 FXInputHandle fd;
359 FXuint m;
360 if(mode&INPUT_READ){
361 m=INPUT_READ;
362 if(mode&INPUT_EXCEPT) m|=INPUT_EXCEPT;
363 fd=FXRbGetReadFileHandle(obj);
364 self->addInput(fd,m,tgt,sel);
365 }
366 if(mode&INPUT_WRITE){
367 m=INPUT_WRITE;
368 if(mode&INPUT_EXCEPT) m|=INPUT_EXCEPT;
369 fd=FXRbGetWriteFileHandle(obj);
370 self->addInput(fd,m,tgt,sel);
359 if(mode&(INPUT_READ|INPUT_EXCEPT)){
360 fd=FXRbGetReadFileHandle(obj, mode);
361 self->addInput(fd,mode,tgt,sel);
362 }
363 if(mode&(INPUT_WRITE|INPUT_EXCEPT)){
364 fd=FXRbGetWriteFileHandle(obj, mode);
365 self->addInput(fd,mode,tgt,sel);
371366 }
372367 return true;
373368 }
378373 */
379374 bool removeInput(VALUE obj,FXuint mode){
380375 FXInputHandle fd;
381 FXuint m;
382 if(mode&INPUT_READ){
383 m=INPUT_READ;
384 if(mode&INPUT_EXCEPT) m|=INPUT_EXCEPT;
385 fd=FXRbGetReadFileHandle(obj);
386 self->removeInput(fd,m);
387 }
388 if(mode&INPUT_WRITE){
389 m=INPUT_WRITE;
390 if(mode&INPUT_EXCEPT) m|=INPUT_EXCEPT;
391 fd=FXRbGetWriteFileHandle(obj);
392 self->removeInput(fd,m);
376 if(mode&(INPUT_READ|INPUT_EXCEPT)){
377 fd=FXRbGetReadFileHandle(obj, mode);
378 self->removeInput(fd,mode);
379 FXRbRemoveReadFileHandle(obj, mode);
380 }
381 if(mode&(INPUT_WRITE|INPUT_EXCEPT)){
382 fd=FXRbGetWriteFileHandle(obj, mode);
383 self->removeInput(fd,mode);
384 FXRbRemoveWriteFileHandle(obj, mode);
393385 }
394386 return true;
395387 }
400392
401393 /// Peek to determine if there's an event
402394 bool peekEvent();
403
404 /// Perform one event dispatch; return true if event was dispatched
405 bool runOneEvent(bool blocking=true);
406
407 /**
408 * Run the main application event loop until stop() is called,
409 * and return the exit code passed as argument to stop().
410 */
411 FXint run();
412
413 /**
414 * Run an event loop till some flag becomes non-zero, and
415 * then return.
416 */
417 FXint runUntil(FXuint& condition); // FIXME
418
419 /**
420 * Run event loop while events are available, non-modally.
421 * Return when no more events, timers, or chores are outstanding.
422 */
423 FXint runWhileEvents();
424
425 /**
426 * Run event loop while there are events are available in the queue.
427 * Returns 1 when all events in the queue have been handled, and 0 when
428 * the event loop was terminated due to stop() or stopModal().
429 * Except for the modal window and its children, user input to all windows
430 * is blocked; if the modal window is NULL, all user input is blocked.
431 */
432 FXint runModalWhileEvents(FXWindow* window=NULL);
433
434 /**
435 * Run modal event loop, blocking keyboard and mouse events to all windows
436 * until stopModal is called.
437 */
438 FXint runModal();
439
440 /**
441 * Run a modal event loop for the given window, until stop() or stopModal() is
442 * called. Except for the modal window and its children, user input to all
443 * windows is blocked; if the modal window is NULL all user input is blocked.
444 */
445 FXint runModalFor(FXWindow* window);
446
447 /**
448 * Run modal while window is shown, or until stop() or stopModal() is called.
449 * Except for the modal window and its children, user input to all windows
450 * is blocked; if the modal window is NULL all user input is blocked.
451 */
452 FXint runModalWhileShown(FXWindow* window);
453
454 /**
455 * Run popup menu while shown, until stop() or stopModal() is called.
456 * Also returns when entering previous cascading popup menu.
457 */
458 FXint runPopup(FXWindow* owner);
459395
460396 /// True if the window is modal
461397 bool isModal(FXWindow* window) const;
4040 * of the client support level and the display server support level.
4141 */
4242 %extend {
43 static FXbool supported(FXApp* application){
43 static VALUE supported(FXApp* application){
4444 int major,minor;
4545 FXbool answer=FXGLVisual::supported(application,major,minor);
4646 return rb_ary_new3(3,answer?Qtrue:Qfalse,INT2NUM(major),INT2NUM(minor));
5757 FXImage(FXApp* a,VALUE string_or_ary=Qnil,FXuint opts=0,FXint w=1,FXint h=1){
5858 FXColor* pix=0;
5959 if(!NIL_P(string_or_ary)){
60 FXuint len=FXRbNumberOfFXColors(string_or_ary);
60 FXint len=FXRbNumberOfFXColors(string_or_ary);
6161 if(w*h != len){
6262 rb_raise( rb_eArgError, "Array size does not match image size" );
6363 }
7474 else{
7575 return 0;
7676 }
77 }
78
79 /// Get a pointer to the pixel data
80 VALUE getDataPtr() const {
81 return ULL2NUM((uintptr_t)self->getData());
7782 }
7883 }
7984
9196 * This can be done by calling render().
9297 */
9398 void setPixels(VALUE string_or_ary,FXuint opts=0,VALUE w=Qnil,VALUE h=Qnil){
94 FXuint len=FXRbNumberOfFXColors(string_or_ary);
99 FXint len=FXRbNumberOfFXColors(string_or_ary);
95100 if( ( (NIL_P(w) || NIL_P(h)) && self->getWidth()*self->getHeight() != len) ||
96 (!(NIL_P(w) || NIL_P(h)) && NUM2UINT(w)*NUM2UINT(h) != len)){
101 (!(NIL_P(w) || NIL_P(h)) && NUM2INT(w)*NUM2INT(h) != len)){
97102 rb_raise( rb_eArgError, "Array size does not match image size" );
98103 }
99104
110115 if (data) {
111116 FXuint size = self->getWidth()*self->getHeight();
112117 VALUE ary = rb_ary_new2(size);
113 for (int i = 0; i < size; i++)
118 for (FXuint i = 0; i < size; i++)
114119 rb_ary_store(ary, i, UINT2NUM(data[i]));
115120 return ary;
116121 } else {
2626 class FXMemoryBuffer {
2727 public:
2828 // Create an memory buffer object
29 FXMemoryBuffer(FXColor *data,FXuint size);
29 FXMemoryBuffer(FXColor *data,FXint size);
3030
3131 // Returns the size (in bytes)
3232 FXuint getSize() const;
3333
3434 %extend {
35 // Returns the data as an array of Bignums
35 // Returns the data as an array of Integers
3636 VALUE getData() const {
3737 FXColor* data = self->getData();
3838 if (data) {
3939 FXuint size = self->getSize();
4040 VALUE ary = rb_ary_new2(size);
41 for (int i = 0; i < size; i++)
41 for (FXuint i = 0; i < size; i++)
4242 rb_ary_store(ary, i, UINT2NUM(data[i]));
4343 return ary;
4444 }
518518
519519 %extend {
520520 /**
521 * TODO: Change API to return [beg, end] instead of [[beg], [end]] for non regex.
522 *
521523 * Search for string in text buffer, returning the extent of
522524 * the string in beg and end. The search starts from the given
523525 * starting position, scans forward (SEARCH_FORWARD) or backward
535537 FXint* beg;
536538 FXint* end;
537539 VALUE ary=Qnil;
538 FXint ngroups=string.contains('(')+1; // FIXME: is this right?
540 FXint ngroups = flags&SEARCH_REGEX ? string.contains('(')+1 : 1; // FIXME: is this right?
539541 if(!FXMALLOC(&beg,FXint,ngroups)){
540542 return Qnil;
541 }
543 }
542544 if(!FXMALLOC(&end,FXint,ngroups)){
543545 FXFREE(&beg);
544 return Qnil;
545 }
546 return Qnil;
547 }
546548 if(self->findText(string,beg,end,start,flags,ngroups)){
547549 ary=rb_ary_new();
548 rb_ary_push(ary,FXRbMakeArray(beg,ngroups));
549 rb_ary_push(ary,FXRbMakeArray(end,ngroups));
550 }
550 rb_ary_push(ary,FXRbMakeArray(beg,ngroups));
551 rb_ary_push(ary,FXRbMakeArray(end,ngroups));
552 }
551553 FXFREE(&beg);
552554 FXFREE(&end);
553555 return ary;
554 }
556 }
555557 }
556558
557559 /// Return TRUE if position pos is selected
1919 * at "[email protected]".
2020 ***********************************************************************/
2121
22 %naturalvar FXVec2d;
2223 /// Double-precision 2-element vector
2324 class FXVec2d {
2425 public:
1919 * at "[email protected]".
2020 ***********************************************************************/
2121
22 %naturalvar FXVec2f;
2223 /// Single-precision 2-element vector
2324 class FXVec2f {
2425 public:
1919 * at "[email protected]".
2020 ***********************************************************************/
2121
22 %naturalvar FXVec3d;
2223 /// Double-precision 3-element vector
2324 class FXVec3d {
2425 public:
1919 * at "[email protected]".
2020 ***********************************************************************/
2121
22 %naturalvar FXVec3f;
2223 /// Single-precision 3-element vector
2324 class FXVec3f {
2425 public:
2020 ***********************************************************************/
2121
2222 %rename("crosses?") FXVec4d::crosses(const FXVec3d& a,const FXVec3d& b) const;
23 %naturalvar FXVec4d;
2324
2425 /// Double-precision 4-element vector
2526 class FXVec4d {
2020 ***********************************************************************/
2121
2222 %rename("crosses?") FXVec4f::crosses(const FXVec3f& a,const FXVec3f& b) const;
23 %naturalvar FXVec4f;
2324
2425 /// Single-precision 4-element vector
2526 class FXVec4f {
3131 virtual void detach();
3232
3333 /**
34 * Run the main application event loop until stop() is called,
35 * and return the exit code passed as argument to stop().
36 */
37 FXint run();
38
39 /// Perform one event dispatch; return true if event was dispatched
40 bool runOneEvent(bool blocking=true);
41
42 /**
43 * Run an event loop till some flag becomes non-zero, and
44 * then return.
45 */
46 FXint runUntil(FXuint& condition); // FIXME
47
48 /**
49 * Run event loop while events are available, non-modally.
50 * Return when no more events, timers, or chores are outstanding.
51 */
52 FXint runWhileEvents();
53
54 /**
55 * Run event loop while there are events are available in the queue.
56 * Returns 1 when all events in the queue have been handled, and 0 when
57 * the event loop was terminated due to stop() or stopModal().
58 * Except for the modal window and its children, user input to all windows
59 * is blocked; if the modal window is NULL, all user input is blocked.
60 */
61 FXint runModalWhileEvents(FXWindow* window=NULL);
62
63 /**
64 * Run modal event loop, blocking keyboard and mouse events to all windows
65 * until stopModal is called.
66 */
67 FXint runModal();
68
69 /**
70 * Run a modal event loop for the given window, until stop() or stopModal() is
71 * called. Except for the modal window and its children, user input to all
72 * windows is blocked; if the modal window is NULL all user input is blocked.
73 */
74 FXint runModalFor(FXWindow* window);
75
76 /**
77 * Run modal while window is shown, or until stop() or stopModal() is called.
78 * Except for the modal window and its children, user input to all windows
79 * is blocked; if the modal window is NULL all user input is blocked.
80 */
81 FXint runModalWhileShown(FXWindow* window);
82
83 /**
84 * Run popup menu while shown, until stop() or stopModal() is called.
85 * Also returns when entering previous cascading popup menu.
86 */
87 FXint runPopup(FXWindow* owner);
88
89 /**
3490 * Initialize application.
3591 * Parses and removes common command line arguments, reads the registry.
3692 * Finally, if connect is TRUE, it opens the display.
11081164
11091165 %define DECLARE_FXTEXT_VIRTUALS(klass)
11101166 %extend klass {
1167 virtual void eraseCursorOverhang();
1168 virtual void drawCursor(FXuint state);
1169 virtual FXuint style(FXint row,FXint beg,FXint end,FXint pos);
1170 virtual void drawBufferText(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h,FXint pos,FXint n,FXuint style);
1171 virtual void fillBufferRect(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h,FXuint style);
1172 virtual void drawTextRow(FXDCWindow& dc,FXint line,FXint left,FXint right);
1173 virtual void drawContents(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
1174 virtual void drawNumbers(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
1175
11111176 virtual void setCursorPos(FXint pos,FXbool notify=FALSE);
11121177 virtual FXbool extendSelection(FXint pos,FXTextSelectionMode mode=SELECT_CHARS,FXbool notify=FALSE);
11131178 virtual FXbool killSelection(FXbool notify=FALSE);
492492 %typemap(out) FXVec2f* "$result = FXRbGetRubyObj($1, \"$1_ltype\");";
493493 %typemap(out) FXVec2f& "$result = FXRbGetRubyObj($1, \"$1_ltype\");";
494494
495 /* Output typemap for FXVec3f instances */
496 %typemap(out) FXVec3f {
497 FXVec3f* resultptr = new FXVec3f($1);
498 $result = FXRbGetRubyObj(resultptr, "FXVec3f *");
499 }
500 %typemap(out) FXVec3f* "$result = FXRbGetRubyObj($1, \"$1_ltype\");";
501 %typemap(out) const FXVec3f& {
502 FXVec3f* resultptr = new FXVec3f(*$1);
503 $result = FXRbGetRubyObj(resultptr, "FXVec3f *");
504 }
505
495506 /* Output typemap for FXVec4f instances */
496507 %typemap(out) FXVec4f {
497508 FXVec4f* resultptr = new FXVec4f($1);
498509 $result = FXRbGetRubyObj(resultptr, "FXVec4f *");
499510 }
500511 %typemap(out) FXVec4f* "$result = FXRbGetRubyObj($1, \"$1_ltype\");";
501 %typemap(out) FXVec4f& "$result = FXRbGetRubyObj($1, \"$1_ltype\");";
512 %typemap(out) const FXVec4f& {
513 FXVec4f* resultptr = new FXVec4f(*$1);
514 $result = FXRbGetRubyObj(resultptr, "FXVec4f *");
515 }
502516
503517 /* Output typemap for FXIcon instances */
504518 %typemap(out) FXIcon * = FXObject *;
608622
609623 /* Output typemap for FXTreeItem instances */
610624 %typemap(out) FXTreeItem * = FXObject *;
611
612 /* Output typemap for FXVec3f instances */
613 %typemap(out) FXVec3f {
614 FXVec3f* resultptr = new FXVec3f($1);
615 $result = FXRbGetRubyObj(resultptr, "FXVec3f *");
616 }
617 %typemap(out) FXVec3f* "$result = FXRbGetRubyObj($1, \"$1_ltype\");";
618 %typemap(out) const FXVec3f& "$result = FXRbGetRubyObj($1, \"$1_ltype\");";
619625
620626 /* Output typemap for FXVerticalFrame instances */
621627 %typemap(out) FXVerticalFrame * = FXObject *;
708714 $2 = RSTRING_LEN($input);
709715 }
710716
711 // Extract a C array (dashpattern) and its length (dashlength) from a Ruby array of Fixnums
717 // Extract a C array (dashpattern) and its length (dashlength) from a Ruby array of Integers
712718 %typemap(in) (const FXchar* dashpattern, FXuint dashlength) {
713719 Check_Type($input, T_ARRAY);
714720 $1 = new FXchar[RARRAY_LEN($input)];
756762 */
757763
758764 %typemap(in) FXWindow* TOOLBAR_DOCK_AFTER {
759 if (TYPE($input) == T_FIXNUM) {
765 if (TYPE($input) == T_FIXNUM || TYPE($input) == T_BIGNUM)) {
760766 $1 = reinterpret_cast<FXWindow *>(static_cast<long>(NUM2INT($input)));
761767 } else {
762768 SWIG_ConvertPtr($input, (void **) &$1, SWIGTYPE_p_FXWindow, 1);
66 include Fox
77
88 def test_exception_for_second_app
9 app = FXApp.new
10 mainWindow = FXMainWindow.new(app, "")
11 app.create
129 assert_raise RuntimeError do
13 app2 = FXApp.new
10 FXApp.new
1411 end
1512 end
1613 end
3229 app.removeInput(pipe_wr, INPUT_WRITE)
3330
3431 app.addInput(pipe_rd, INPUT_READ, app, FXApp::ID_QUIT)
35 data_sent = false
36 app.addTimeout(1) do
37 data_sent = true
38 pipe_wr.write " "
32 2.times do
33 data_sent = false
34 app.addTimeout(1) do
35 data_sent = true
36 pipe_wr.write " "
37 end
38 app.run
39 assert data_sent, "the read input event shouldn't fire before some data is available"
40 assert " ", pipe_rd.read(1)
3941 end
40 app.run
41 assert data_sent, "the read input event shouldn't fire before some data is available"
42
4342 app.removeInput(pipe_rd, INPUT_READ)
4443 pipe_wr.close
4544 pipe_rd.close unless pipe_rd.closed?
4645 end
4746
4847 def test_addInput_on_pipe
49 check_events *IO.pipe
48 pend "addInput on IO.pipe object isn't supported on Windows" if RUBY_PLATFORM=~/mingw|mswin/i
49 check_events(*IO.pipe)
50 end
51
52 def test_addInput_on_socket_accept
53 s = TCPServer.open 'localhost', 0
54 app.addInput(s, INPUT_READ, app, FXApp::ID_QUIT)
55 2.times do
56 pipe_wr = nil
57 app.addTimeout(1) do
58 pipe_wr = TCPSocket.open 'localhost', s.addr[1]
59 end
60 app.run
61 assert pipe_wr, "the read input event shouldn't fire before client connection happens"
62 s.accept.close
63 end
64 app.removeInput(s, INPUT_READ)
65 s.close
5066 end
5167
5268 def test_addInput_on_socket
5975 end
6076
6177 def test_addInput_on_popen
78 pend "addInput on IO.popen object isn't supported on Windows" if RUBY_PLATFORM=~/mingw|mswin/i
6279 pipe_rdwr = IO.popen("cat", "r+")
6380 check_events pipe_rdwr, pipe_rdwr
6481 end
82
83 def test_runOnUiThread
84 count = 0
85 thread = nil
86 Thread.new do
87 10.times do |idx|
88 app.runOnUiThread do
89 count += 1
90 thread = Thread.current
91 app.stop if idx == 9
92 end
93 sleep 0.001
94 end
95 end
96 app.run
97
98 assert_equal Thread.current, thread
99 assert_equal 10, count
100 end
101
102 def test_runOnUiThread_same_thread
103 count = 0
104 app.addTimeout(1) do
105 10.times do |idx|
106 app.runOnUiThread do
107 count += 1
108 app.stop if idx == 9
109 end
110 sleep 0.001
111 end
112 end
113 app.run
114
115 assert_equal 10, count
116 end
65117 end
2525
2626 def testStyle
2727 assert(@button.buttonStyle)
28 assert_instance_of(Fixnum, @button.buttonStyle)
28 assert_kind_of(Integer, @button.buttonStyle)
2929
3030 @button.buttonStyle |= BUTTON_AUTOGRAY
3131 assert((@button.buttonStyle & BUTTON_AUTOGRAY) != 0)
5555
5656 def testState
5757 assert(@button.state)
58 assert_kind_of(Fixnum, @button.state)
58 assert_kind_of(Integer, @button.state)
5959
6060 @button.state = STATE_UP
6161 assert_equal(STATE_UP, @button.state)
1111
1212 def test_setCheck_TRUE
1313 @checkButton.check = Fox::TRUE
14 assert_equal(true, @checkButton.check)
1514 assert_equal(Fox::TRUE, @checkButton.checkState)
1615 assert(@checkButton.checked?)
1716 assert([email protected]?)
2019
2120 def test_setCheck_FALSE
2221 @checkButton.check = Fox::FALSE
23 assert_equal(false, @checkButton.check)
2422 assert_equal(Fox::FALSE, @checkButton.checkState)
2523 assert([email protected]?)
2624 assert(@checkButton.unchecked?)
2927
3028 def test_setCheck_MAYBE
3129 @checkButton.check = Fox::MAYBE
32 assert_equal(true, @checkButton.check) # this is not a typo!
3330 assert_equal(Fox::MAYBE, @checkButton.checkState)
3431 assert([email protected]?)
3532 assert([email protected]?)
3835
3936 def test_setCheck_true
4037 @checkButton.check = true
41 assert_equal(true, @checkButton.check)
4238 assert_equal(Fox::TRUE, @checkButton.checkState)
4339 assert(@checkButton.checked?)
4440 assert([email protected]?)
4743
4844 def test_setCheck_false
4945 @checkButton.check = false
50 assert_equal(false, @checkButton.check)
5146 assert_equal(Fox::FALSE, @checkButton.checkState)
5247 assert([email protected]?)
5348 assert(@checkButton.unchecked?)
9494 end
9595
9696 def teardown
97 if File.exists?("output.ps")
97 if File.exist?("output.ps")
9898 FileUtils.rm_f("output.ps")
9999 end
100100 end
6161 FXFileStream.open("non_existing_file", FXStreamLoad) { |s| }
6262 }
6363
64 pend "chmod isn't supported on Windows" if RUBY_PLATFORM=~/mingw|mswin/i
65
6466 # Write-only file (i.e. no read permissions)
6567 tf = Tempfile.new("write_only_file")
6668 tf.puts("junk")
8183 end
8284
8385 def teardown
84 if File.exists?("goobers")
86 if File.exist?("goobers")
8587 FileUtils.rm_f("goobers")
8688 end
8789 end
1414
1515 def testConstructFromFontDescription
1616 fontdesc = @app.normalFont.fontDesc
17 font = FXFont.new(@app, fontdesc)
17 FXFont.new(@app, fontdesc)
1818 end
1919
2020 def testConstructFromParameters
4141 end
4242
4343 def testConstructFromFontString
44 font = FXFont.new(@app, "")
44 FXFont.new(@app, "")
4545 end
4646
4747 def testGetTextWidthAndHeight
1111 end
1212
1313 def test_supported
14 assert FXGLVisual.supported?(app)
14 arr = FXGLVisual.supported(app)
15 assert_equal 3, arr.length, "return array should have elements [support, major, minor]"
16 assert_true arr[0], "OpenGL should be supported"
17 assert_operator 1, :<=, arr[1], "OpenGL should be version 1.0 or greater"
18 end
19
20 def test_supported?
21 assert_true FXGLVisual.supported?(app), "OpenGL should be supported"
1522 end
1623
1724 def test_nil_app_raises_argument_error
2121
2222 def test_getArrowDir
2323 @header.appendItem("")
24 assert_instance_of(Fixnum, @header.getArrowDir(0))
24 assert_kind_of(Integer, @header.getArrowDir(0))
2525 end
2626
2727 def test_arrowUp?
1010
1111 def test_created?
1212 assert !mainWindow.created?
13 app.create
13 mainWindow.create
1414 assert mainWindow.created?, "main window should be created after call to FXApp#create"
1515 mainWindow.destroy
1616 assert !mainWindow.created?
00 require 'test/unit'
11 require 'testcase'
22 require 'fox16'
3 require 'fiddle'
34
45 class TC_FXImage < Fox::TestCase
56 include Fox
7980 assert_equal("rgbaRGBA", img.pixel_string)
8081 end
8182
83 def test_dataPtr
84 img = FXImage.new(app, nil, 0, 2, 1)
85 img.pixels = "rgbaRGBA"
86 assert_equal(0, img.options)
87 assert_equal("rgbaRGBA", Fiddle::Pointer.new(img.dataPtr)[0, 8])
88 end
89
8290 def test_create
8391 #
8492 # If the image owns its pixel data and IMAGE_KEEP was not specified,
118126 def test_create_with_non_owned_data
119127 GC.stress = true
120128 img = image_with_non_owned_data
121 " " * 10000
129 _ = " " * 10000
122130 GC.stress = false
123131 assert_equal("rgbaRGBA", img.pixel_string)
124132 assert_equal(0, img.options)
133141 img = FXImage.new(app, nil, 0, 1, 2)
134142 GC.stress = true
135143 set_non_owned_data(img)
136 " " * 10000
144 _ = " " * 10000
137145 GC.stress = false
138146 assert_equal("rgbaRGBA", img.pixel_string)
139147 assert_equal(0, img.options)
0 require 'fox16'
1 require 'test/unit'
2 require 'testcase'
3 require 'openssl'
4
5 class TC_FXJPGImage < Fox::TestCase
6 include Fox
7
8 def setup
9 super(self.class.name)
10 end
11
12 def test_save_with_thread
13 w, h = 4000, 3000
14 img_data = OpenSSL::Random.random_bytes(w) * h * 4
15
16 count = 0
17 th = Thread.new do
18 loop do
19 count += 1
20 end
21 end
22
23 img = FXJPGImage.new(app)
24 img.setPixels( img_data, 0, w, h )
25
26 jpeg_data = FXMemoryStream.open(FXStreamSave, nil) do |outfile|
27 img.savePixels(outfile)
28 outfile.takeBuffer
29 end
30
31 assert_operator(count, :>=, 500000)
32 assert_operator(jpeg_data.bytesize, :>=, 1000)
33
34 count = 0
35 img = FXJPGImage.new(app)
36 FXMemoryStream.open(FXStreamLoad, jpeg_data) do |infile|
37 img.loadPixels(infile)
38 end
39
40 th.kill
41
42 assert_equal 4000, img.width
43 assert_equal 3000, img.height
44 assert_operator(count, :>=, 500000)
45 end
46 end
4545
4646 def test_appendItem_byText
4747 assert_equal(0, @list.numItems)
48 itemIndex = @list.appendItem("")
48 assert_equal 0, @list.appendItem("")
4949 assert_equal(1, @list.numItems)
50 itemIndex = @list.appendItem("anItem")
50 assert_equal 1, @list.appendItem("anItem")
5151 assert_equal(2, @list.numItems)
52 itemIndex = @list.appendItem("anItem", nil)
52 assert_equal 2, @list.appendItem("anItem", nil)
5353 assert_equal(3, @list.numItems)
54 itemIndex = @list.appendItem("anItem", nil, "someData")
54 assert_equal 3, @list.appendItem("anItem", nil, "someData")
5555 assert_equal(4, @list.numItems)
56 itemIndex = @list.appendItem("anItem", nil, "someData", true)
56 assert_equal 4, @list.appendItem("anItem", nil, "someData", true)
5757 assert_equal(5, @list.numItems)
58 itemIndex = @list.appendItem("anItem", nil, "someData", false)
58 assert_equal 5, @list.appendItem("anItem", nil, "someData", false)
5959 assert_equal(6, @list.numItems)
6060 assert_raises(ArgumentError) do
6161 @list.appendItem("anItem", nil, "someData", 42) # last argument must be true or false
102102 end
103103
104104 def test_makeItemVisible
105 items = []
106105 0.upto(2) { |i|
107 items << @list.appendItem("item#{i}")
106 itemIndex = @list.appendItem("item#{i}")
107 assert_equal i, itemIndex
108108 }
109109 assert_raises(IndexError) {
110110 @list.makeItemVisible(-1)
1010 end
1111
1212 def test_non_created_app_raises_runtime_error
13 pend "two FXApp are not allowed"
1314 app = FXApp.new
1415 assert_raise RuntimeError do
1516 FXMainWindow.new(app, "title").create
8080 def test_mul_by_scalar
8181 p = FXMat4f.new.eye
8282 q = FXMat4f.new(4.0, 0.0, 0.0, 0.0,
83 0.0, 4.0, 0.0, 0.0,
84 0.0, 0.0, 4.0, 0.0,
85 0.0, 0.0, 0.0, 4.0)
83 0.0, 4.0, 0.0, 0.0,
84 0.0, 0.0, 4.0, 0.0,
85 0.0, 0.0, 0.0, 4.0)
8686 r = p*4.0
8787 assert_instance_of(FXMat4f, r)
8888 # assert_equal(q, r)
4747 assert_in_delta(0.7, @mat.emission[2], DELTA)
4848 assert_in_delta(0.8, @mat.emission[3], DELTA)
4949
50 @mat.emission = FXHVec.new(0.5, 0.6, 0.7, 0.8)
50 @mat.emission = FXVec4f.new(0.5, 0.6, 0.7, 0.8)
5151 assert_in_delta(0.5, @mat.emission[0], DELTA)
5252 assert_in_delta(0.6, @mat.emission[1], DELTA)
5353 assert_in_delta(0.7, @mat.emission[2], DELTA)
1111
1212 def test_setCheck_TRUE
1313 @menuCheck.check = Fox::TRUE
14 assert_equal(true, @menuCheck.check)
1514 assert_equal(Fox::TRUE, @menuCheck.checkState)
1615 assert(@menuCheck.checked?)
1716 assert([email protected]?)
2019
2120 def test_setCheck_FALSE
2221 @menuCheck.check = Fox::FALSE
23 assert_equal(false, @menuCheck.check)
2422 assert_equal(Fox::FALSE, @menuCheck.checkState)
2523 assert([email protected]?)
2624 assert(@menuCheck.unchecked?)
2927
3028 def test_setCheck_MAYBE
3129 @menuCheck.check = Fox::MAYBE
32 assert_equal(true, @menuCheck.check) # this is not a typo!
3330 assert_equal(Fox::MAYBE, @menuCheck.checkState)
3431 assert([email protected]?)
3532 assert([email protected]?)
3835
3936 def test_setCheck_true
4037 @menuCheck.check = true
41 assert_equal(true, @menuCheck.check)
4238 assert_equal(Fox::TRUE, @menuCheck.checkState)
4339 assert(@menuCheck.checked?)
4440 assert([email protected]?)
4743
4844 def test_setCheck_false
4945 @menuCheck.check = false
50 assert_equal(false, @menuCheck.check)
5146 assert_equal(Fox::FALSE, @menuCheck.checkState)
5247 assert([email protected]?)
5348 assert(@menuCheck.unchecked?)
1111
1212 def test_setCheck_TRUE
1313 @menuRadio.check = Fox::TRUE
14 assert_equal(true, @menuRadio.check)
1514 assert_equal(Fox::TRUE, @menuRadio.checkState)
1615 assert(@menuRadio.checked?)
1716 assert([email protected]?)
2019
2120 def test_setCheck_FALSE
2221 @menuRadio.check = Fox::FALSE
23 assert_equal(false, @menuRadio.check)
2422 assert_equal(Fox::FALSE, @menuRadio.checkState)
2523 assert([email protected]?)
2624 assert(@menuRadio.unchecked?)
2927
3028 def test_setCheck_MAYBE
3129 @menuRadio.check = Fox::MAYBE
32 assert_equal(true, @menuRadio.check) # this is not a typo!
3330 assert_equal(Fox::MAYBE, @menuRadio.checkState)
3431 assert([email protected]?)
3532 assert([email protected]?)
3835
3936 def test_setCheck_true
4037 @menuRadio.check = true
41 assert_equal(true, @menuRadio.check)
4238 assert_equal(Fox::TRUE, @menuRadio.checkState)
4339 assert(@menuRadio.checked?)
4440 assert([email protected]?)
4743
4844 def test_setCheck_false
4945 @menuRadio.check = false
50 assert_equal(false, @menuRadio.check)
5146 assert_equal(Fox::FALSE, @menuRadio.checkState)
5247 assert([email protected]?)
5348 assert(@menuRadio.unchecked?)
88 end
99
1010 def test_default_constructor
11 q = FXQuatf.new
11 FXQuatf.new
1212 end
1313
1414 def test_construct_from_axis_and_angle
1515 axis = FXVec3f.new(1.0, 1.0, 1.0)
16 q = FXQuatf.new(axis)
17 q = FXQuatf.new(axis, 0.0)
16 FXQuatf.new(axis)
17 FXQuatf.new(axis, 0.0)
1818 end
1919
2020 def test_construct_from_components
2121 x, y, z, w = 1.0, 1.0, 1.0, 1.0
22 q = FXQuatf.new(x, y, z, w)
22 FXQuatf.new(x, y, z, w)
2323 end
2424
2525 def test_construct_from_roll_pitch_yaw
2626 roll, pitch, yaw = 45.0, 45.0, 45.0
27 q = FXQuatf.new(roll, pitch, yaw)
27 FXQuatf.new(roll, pitch, yaw)
2828 end
2929
3030 def test_adjust!
1111
1212 def test_setCheck_TRUE
1313 @radioButton.check = Fox::TRUE
14 assert_equal(true, @radioButton.check)
1514 assert_equal(Fox::TRUE, @radioButton.checkState)
1615 assert(@radioButton.checked?)
1716 assert([email protected]?)
2019
2120 def test_setCheck_FALSE
2221 @radioButton.check = Fox::FALSE
23 assert_equal(false, @radioButton.check)
2422 assert_equal(Fox::FALSE, @radioButton.checkState)
2523 assert([email protected]?)
2624 assert(@radioButton.unchecked?)
2927
3028 def test_setCheck_MAYBE
3129 @radioButton.check = Fox::MAYBE
32 assert_equal(true, @radioButton.check) # this is not a typo!
3330 assert_equal(Fox::MAYBE, @radioButton.checkState)
3431 assert([email protected]?)
3532 assert([email protected]?)
3835
3936 def test_setCheck_true
4037 @radioButton.check = true
41 assert_equal(true, @radioButton.check)
4238 assert_equal(Fox::TRUE, @radioButton.checkState)
4339 assert(@radioButton.checked?)
4440 assert([email protected]?)
4743
4844 def test_setCheck_false
4945 @radioButton.check = false
50 assert_equal(false, @radioButton.check)
5146 assert_equal(Fox::FALSE, @radioButton.checkState)
5247 assert([email protected]?)
5348 assert(@radioButton.unchecked?)
1616 FXPoint.new(100, 100),
1717 FXPoint.new(0, 0)
1818 ]
19 r1 = FXRegion.new(points, true)
20 r2 = FXRegion.new(points, false)
21 r3 = FXRegion.new(points)
19 FXRegion.new(points, true)
20 FXRegion.new(points, false)
21 FXRegion.new(points)
2222 end
2323
2424 def test_copy_constructor
2121 def test_new
2222 # Free-floating
2323 shell1 = FXShell.new(@app, 0, 0, 0, 0, 0)
24 assert_nil(shell1.owner)
2425
2526 # Owned
2627 shell2 = FXShell.new(@mainWin, 0, 0, 0, 0, 0)
7575 clearEdges(extending)
7676
7777 old_nr = @table.numRows
78 old_nc = @table.numColumns
78 _old_nc = @table.numColumns
7979
8080 # resize the table
8181 nr = @data_lines.size + 2
8686 assert_equal([10], endIndex)
8787 end
8888
89 def test_find_text_with_startpos_wrap_nocase
90 @text.text = "I came, i saw, I conquered"
91 startIndex, endIndex = @text.findText("i ", 16, SEARCH_FORWARD|SEARCH_IGNORECASE|SEARCH_WRAP)
92 assert_equal([0], startIndex)
93 assert_equal([2], endIndex)
94 end
95
8996 def test_find_text_with_groups
9097 @text.text = "I came, I saw, I conquered"
9198 startIndex, endIndex = @text.findText("I ([a-z]+)(, )?", 0, SEARCH_REGEX)
9299 assert_equal([0, 2, 6], startIndex)
93100 assert_equal([8, 6, 8], endIndex)
101 end
102
103 def test_find_text_with_loop
104 @text.text = "() ()()"
105 e = Enumerator.new do |y|
106 pos = 0
107 while [email protected]("()", pos, SEARCH_FORWARD|SEARCH_EXACT)
108 y << a
109 pos = a[1][0]
110 end
111 end
112 assert_equal [[[0], [2]], [[4], [6]], [[6], [8]]], e.to_a
94113 end
95114
96115 if ''.respond_to?(:encoding)
6666 @treeList.connect(SEL_INSERTED) { |sender, sel, ptr|
6767 anItem = ptr
6868 }
69 theItem = @treeList.appendItem(nil, "", nil, nil, nil, true)
69 theItem = @treeList.appendItem(nil, FXTreeItem.new(""), true)
7070 assert_same(theItem, anItem)
7171 end
7272
7373 def test_SEL_DELETED
74 theItem = @treeList.appendItem(nil, "")
74 theItem = @treeList.appendItem(nil, FXTreeItem.new(""))
7575 anItem = nil
7676 @treeList.connect(SEL_DELETED) { |sender, sel, ptr|
7777 anItem = ptr
44 class TC_FXVec4f < Test::Unit::TestCase
55 include Fox
66
7 def assert_in_delta(v1, v2, delta)
8 case v1
9 when FXVec3f
10 3.times do |i|
11 super(v1[i], v2[i], delta)
12 end
13 when FXVec4f
14 4.times do |i|
15 super(v1[i], v2[i], delta)
16 end
17 else
18 super(v1, v2, delta)
19 end
20 end
721
822 def test_new
923 FXVec4f.new
3852 end
3953
4054 def test_new5
41 c = FXVec4f.new(FXRGB(128, 128, 128))
55 FXVec4f.new(FXRGB(128, 128, 128))
4256 end
4357
4458 def test_getitem
6478 def test_neg
6579 vec = FXVec4f.new(1.0, 2.0, 3.0, 4.0)
6680 vec = -vec
67 assert_equal(vec[0], -1.0)
68 assert_equal(vec[1], -2.0)
69 assert_equal(vec[2], -3.0)
70 assert_equal(vec[3], -4.0)
81 assert_in_delta(vec[0], -1.0, 0.001)
82 assert_in_delta(vec[1], -2.0, 0.001)
83 assert_in_delta(vec[2], -3.0, 0.001)
84 assert_in_delta(vec[3], -4.0, 0.001)
7185 end
7286
7387 def test_add
7488 v1 = FXVec4f.new(1.0, 2.0, 3.0, 4.0)
7589 v2 = FXVec4f.new(2.0, 4.0, 6.0, 8.0)
7690 v3 = FXVec4f.new(3.0, 6.0, 9.0, 12.0)
77 assert_equal(v3, v1 + v2)
91 assert_in_delta(v3, v1 + v2, 0.001)
7892 end
7993
8094 def test_sub
8195 v1 = FXVec4f.new(3.0, 6.0, 9.0, 12.0)
8296 v2 = FXVec4f.new(2.0, 4.0, 6.0, 8.0)
8397 v3 = FXVec4f.new(1.0, 2.0, 3.0, 4.0)
84 assert_equal(v3, v1 - v2)
98 assert_in_delta(v3, v1 - v2, 0.001)
8599 end
86100
87101 def test_mul
88102 v1 = FXVec4f.new(3.0, 6.0, 9.0, 12.0)
89103 v2 = FXVec4f.new(6.0, 12.0, 18.0, 24.0)
90 assert_equal(v2, v1 * 2)
104 assert_in_delta(v2, v1 * 2, 0.001)
91105 end
92106
93107 def test_mul2 # same as dot product
94108 v1 = FXVec4f.new(3.0, 6.0, 9.0, 12.0)
95109 v2 = FXVec4f.new(2.0, 4.0, 6.0, 8.0)
96 assert_equal(180.0, v1*v2)
97 assert_equal(180.0, v2*v1)
110 assert_in_delta(180.0, v1*v2, 0.001)
111 assert_in_delta(180.0, v2*v1, 0.001)
98112 end
99113
100114 def test_div
109123 def test_dot
110124 v1 = FXVec4f.new(3.0, 6.0, 9.0, 12.0)
111125 v2 = FXVec4f.new(2.0, 4.0, 6.0, 8.0)
112 assert_equal(180.0, v1.dot(v2))
113 assert_equal(180.0, v2.dot(v1))
126 assert_in_delta(180.0, v1.dot(v2), 0.001)
127 assert_in_delta(180.0, v2.dot(v1), 0.001)
114128 end
115129
116130 def test_length
120134
121135 def test_normalize
122136 vec = FXVec4f.new(1.0, 1.0, 1.0, 1.0)
123 assert_equal(FXVec4f.new(0.5, 0.5, 0.5, 0.5), vec.normalize)
137 assert_in_delta(FXVec4f.new(0.5, 0.5, 0.5, 0.5), vec.normalize, 0.001)
124138 end
125139
126140 def test_lo
1111
1212 def test_width_accessor
1313 pos = @window.width
14 assert_instance_of(Fixnum, pos)
14 assert_kind_of(Integer, pos)
1515 @window.width = pos + 1
1616 assert_equal(pos + 1, @window.width)
1717 @window.width = pos + 2.7
11 require 'test/unit'
22
33 if __FILE__ == $0
4 $: << File.dirname(__FILE__)
5 Dir.glob("TC_*.rb").each do |testcase|
6 require "#{testcase}"
4 testdir = File.expand_path("..", __FILE__)
5 $: << testdir
6 Dir.chdir(testdir) do
7 Dir.glob("TC_*.rb").each do |testcase|
8 require "#{testcase}"
9 end
710 end
811 end
0 # This file is used to setup a dummy X server for testing on http://travis-ci.org
1 # See config file ".travis.yml"
2
3 ##Xdummy:##
4 Section "ServerFlags"
5 Option "DontVTSwitch" "true"
6 Option "AllowMouseOpenFail" "true"
7 Option "PciForceNone" "true"
8 Option "AutoEnableDevices" "false"
9 Option "AutoAddDevices" "false"
10 EndSection
11
12 Section "Module"
13 Load "/usr/lib/xorg/modules/extensions/libglx.so"
14 EndSection
15
16 Section "Extensions"
17 Option "GLX" "Enable"
18 Option "NV-GLX" "Disable"
19 EndSection
20
21
22 ##Xdummy:##
23 Section "InputDevice"
24 Identifier "NoMouse"
25 Option "CorePointer" "true"
26 Driver "void"
27 EndSection
28
29 Section "InputDevice"
30 Identifier "NoKeyboard"
31 Option "CoreKeyboard" "true"
32 Driver "void"
33 EndSection
34
35 ##Xdummy:##
36 Section "Device"
37 Identifier "Videocard0"
38 Driver "dummy"
39 #VideoRam 4096000
40 VideoRam 256000
41 EndSection
42
43 ##Xdummy:##
44 Section "Monitor"
45 Identifier "Monitor0"
46 HorizSync 10.0 - 300.0
47 VertRefresh 10.0 - 200.0
48 DisplaySize 4335 1084
49 #The following modeline is invalid (calculator overflowed):
50 #Modeline "32000x32000@0" -38917.43 32000 32032 -115848 -115816 32000 32775 32826 33601
51 Modeline "16384x8192@10" 2101.93 16384 16416 24400 24432 8192 8390 8403 8602
52 Modeline "8192x4096@10" 424.46 8192 8224 9832 9864 4096 4195 4202 4301
53 Modeline "5120x3200@10" 199.75 5120 5152 5904 5936 3200 3277 3283 3361
54 Modeline "3840x2880@10" 133.43 3840 3872 4376 4408 2880 2950 2955 3025
55 Modeline "3840x2560@10" 116.93 3840 3872 4312 4344 2560 2622 2627 2689
56 Modeline "3840x2048@10" 91.45 3840 3872 4216 4248 2048 2097 2101 2151
57 Modeline "2048x2048@10" 49.47 2048 2080 2264 2296 2048 2097 2101 2151
58 Modeline "2560x1600@10" 47.12 2560 2592 2768 2800 1600 1639 1642 1681
59 Modeline "1920x1200@10" 26.28 1920 1952 2048 2080 1200 1229 1231 1261
60 Modeline "1920x1080@10" 23.53 1920 1952 2040 2072 1080 1106 1108 1135
61 Modeline "1680x1050@10" 20.08 1680 1712 1784 1816 1050 1075 1077 1103
62 Modeline "1600x900@20" 33.92 1600 1632 1760 1792 900 921 924 946
63 Modeline "1440x900@20" 30.66 1440 1472 1584 1616 900 921 924 946
64 Modeline "1360x768@20" 24.49 1360 1392 1480 1512 768 786 789 807
65 #common resolutions for android devices (both orientations):
66 Modeline "800x1280@20" 25.89 800 832 928 960 1280 1310 1315 1345
67 Modeline "1280x800@20" 24.15 1280 1312 1400 1432 800 819 822 841
68 Modeline "720x1280@25" 30.22 720 752 864 896 1280 1309 1315 1345
69 Modeline "1280x720@25" 27.41 1280 1312 1416 1448 720 737 740 757
70 Modeline "768x1024@25" 24.93 768 800 888 920 1024 1047 1052 1076
71 Modeline "1024x768@25" 23.77 1024 1056 1144 1176 768 785 789 807
72 Modeline "600x1024@25" 19.90 600 632 704 736 1024 1047 1052 1076
73 Modeline "1024x600@25" 18.26 1024 1056 1120 1152 600 614 617 631
74 Modeline "536x960@25" 16.74 536 568 624 656 960 982 986 1009
75 Modeline "960x536@25" 15.23 960 992 1048 1080 536 548 551 563
76 Modeline "600x800@25" 15.17 600 632 688 720 800 818 822 841
77 Modeline "800x600@25" 14.50 800 832 880 912 600 614 617 631
78 Modeline "480x854@25" 13.34 480 512 560 592 854 873 877 897
79 Modeline "848x480@25" 12.09 848 880 920 952 480 491 493 505
80 Modeline "480x800@25" 12.43 480 512 552 584 800 818 822 841
81 Modeline "800x480@25" 11.46 800 832 872 904 480 491 493 505
82 Modeline "320x480@50" 10.73 320 352 392 424 480 490 494 505
83 Modeline "480x320@50" 9.79 480 512 544 576 320 327 330 337
84 Modeline "240x400@50" 6.96 240 272 296 328 400 408 412 421
85 Modeline "400x240@50" 6.17 400 432 448 480 240 245 247 253
86 Modeline "240x320@50" 5.47 240 272 288 320 320 327 330 337
87 Modeline "320x240@50" 5.10 320 352 368 400 240 245 247 253
88 #resolutions for android devices (both orientations)
89 #minus the status bar
90 #38px status bar (and width rounded up)
91 Modeline "800x1242@20" 25.03 800 832 920 952 1242 1271 1275 1305
92 Modeline "1280x762@20" 22.93 1280 1312 1392 1424 762 780 783 801
93 Modeline "720x1242@25" 29.20 720 752 856 888 1242 1271 1276 1305
94 Modeline "1280x682@25" 25.85 1280 1312 1408 1440 682 698 701 717
95 Modeline "768x986@25" 23.90 768 800 888 920 986 1009 1013 1036
96 Modeline "1024x730@25" 22.50 1024 1056 1136 1168 730 747 750 767
97 Modeline "600x986@25" 19.07 600 632 704 736 986 1009 1013 1036
98 Modeline "1024x562@25" 17.03 1024 1056 1120 1152 562 575 578 591
99 Modeline "536x922@25" 16.01 536 568 624 656 922 943 947 969
100 Modeline "960x498@25" 14.09 960 992 1040 1072 498 509 511 523
101 Modeline "600x762@25" 14.39 600 632 680 712 762 779 783 801
102 Modeline "800x562@25" 13.52 800 832 880 912 562 575 578 591
103 Modeline "480x810@25" 12.59 480 512 552 584 810 828 832 851
104 Modeline "848x442@25" 11.09 848 880 920 952 442 452 454 465
105 Modeline "480x762@25" 11.79 480 512 552 584 762 779 783 801
106 Modeline "800x442@25" 10.51 800 832 864 896 442 452 454 465
107 #32px status bar (no need for rounding):
108 Modeline "320x448@50" 9.93 320 352 384 416 448 457 461 471
109 Modeline "480x288@50" 8.75 480 512 544 576 288 294 297 303
110 #24px status bar:
111 Modeline "240x376@50" 6.49 240 272 296 328 376 384 387 395
112 Modeline "400x216@50" 5.50 400 432 448 480 216 220 222 227
113 Modeline "240x296@50" 5.02 240 272 288 320 296 302 305 311
114 Modeline "320x216@50" 4.55 320 352 368 400 216 220 222 227
115 EndSection
116
117 ##Xdummy:##
118 Section "Screen"
119 Identifier "Screen0"
120 Device "Videocard0"
121 Monitor "Monitor0"
122 DefaultDepth 24
123 SubSection "Display"
124 Viewport 0 0
125 Depth 24
126 Modes "32000x32000" "16384x8192" "8192x4096" "5120x3200" "3840x2880" "3840x2560" "3840x2048" "2048x2048" "2560x1600" "1920x1440" "1920x1200" "1920x1080" "1600x1200" "1680x1050" "1600x900" "1400x1050" "1440x900" "1280x1024" "1366x768" "1280x800" "1024x768" "1024x600" "800x600" "320x200"
127 #Virtual 32000 32000
128 #Virtual 16384 8192
129 #Virtual 8192 4096
130 Virtual 1920 1440
131 EndSubSection
132 EndSection
133
134 Section "ServerLayout"
135 Identifier "dummy_layout"
136 Screen "screen0"
137 InputDevice "NoMouse"
138 InputDevice "NoKeyboard"
139 EndSection