Import upstream version 1.6.42+git20200620.4fad8d6
Kali Janitor
3 years ago
5 | 5 | ext/fox16_c/*.o |
6 | 6 | ext/fox16_c/conftest.dSYM |
7 | 7 | ext/fox16_c/include/inlinestubs.h |
8 | ext/fox16_c/extconf.h | |
8 | 9 | ext/fox16_c/swigruby.h |
9 | 10 | ext/fox16_c/fox16.bundle |
10 | 11 | ext/fox16_c/mkmf.log |
11 | 12 | lib/fox16/kwargs.rb |
13 | lib/[0-9].[0-9] | |
14 | lib/*.so | |
12 | 15 | fox-includes/diffs.py |
13 | 16 | 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-bindings', '~> 1.0' | |
19 | gem 'test-unit', '~> 3.1' | |
20 | 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 | === 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 | .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 |
0 | 0 | = FXRuby |
1 | 1 | |
2 | 2 | * 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 | ||
4 | 9 | |
5 | 10 | == DESCRIPTION: |
6 | 11 | |
13 | 18 | same time taking advantage of the performance and functionality of a |
14 | 19 | featureful, highly optimized C++ toolkit. |
15 | 20 | |
16 | == FEATURES/PROBLEMS: | |
21 | == FEATURES: | |
17 | 22 | |
18 | 23 | FXRuby supportes everything of FOX, that is useful in Ruby: |
19 | 24 | * MDI/SDI application window layouts, floating toolbars |
21 | 26 | * Flexible layout management |
22 | 27 | * Image read/write support in many formats |
23 | 28 | * Embedded OpenGL graphics |
29 | * Thread support | |
24 | 30 | |
25 | 31 | == INSTALL: |
26 | 32 | |
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 | |
28 | 34 | FOX development headers and libraries installed: |
29 | 35 | * on Debian/Ubuntu: <tt>sudo apt-get install g++ libxrandr-dev libfox-1.6-dev</tt> |
30 | 36 | * 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 | |
32 | 38 | |
33 | 39 | Then, install the gem: |
34 | 40 | * gem install fxruby |
0 | 0 | require 'rubygems' |
1 | require 'hoe' | |
2 | 1 | require 'erb' |
2 | require 'date' | |
3 | 3 | require 'rake/extensiontask' |
4 | require 'bundler' | |
5 | require 'bundler/gem_helper' | |
4 | 6 | require './lib/fox16/version.rb' |
5 | 7 | |
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 | |
16 | 69 | end |
17 | 70 | |
18 | 71 | # 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" | |
20 | 74 | |
21 | 75 | SWIG = (RUBY_PLATFORM =~ /mingw/) ? "swig.exe" : "swig" |
22 | 76 | 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" ) | |
73 | 81 | |
74 | 82 | # 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| | |
90 | 93 | ext.cross_compile = true |
91 | 94 | ext.cross_platform = ['x86-mingw32', 'x64-mingw32'] |
95 | # Enable FXTRACE and FXASSERT for 'rake compile' | |
96 | ext.config_options << "--enable-debug" | |
92 | 97 | |
93 | 98 | ext.cross_config_options += [ |
94 | 99 | "--enable-win32-cross", |
95 | 100 | "--with-fxscintilla", |
96 | 101 | ] |
102 | ext.cross_config_options << "--enable-debug" if ENV['FXRUBY_MINGW_DEBUG'] | |
97 | 103 | |
98 | 104 | # Add dependent DLLs to the cross gems |
99 | 105 | 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 | |
110 | 136 | end |
111 | 137 | 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 | ||
131 | 167 | 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 | ||
132 | 209 | 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) | |
147 | 231 | end |
148 | 232 | |
149 | 233 | def swig(swig_interface_file_name, wrapper_src_file_name) |
150 | 234 | cmd = "#{SWIG} #{SWIGFLAGS} -o #{wrapper_src_file_name} #{swig_interface_file_name}" |
151 | 235 | puts cmd |
152 | 236 | system cmd |
237 | ||
238 | # Do our own wrapper file modifications: | |
153 | 239 | 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)) | |
154 | 241 | end |
155 | 242 | |
156 | 243 | 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| | |
158 | 245 | puts "generate #{task.name}" |
159 | 246 | system "#{SWIG} -ruby -external-runtime #{task.name}" |
160 | 247 | end |
161 | 248 | |
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 | ||
162 | 256 | 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) | |
174 | 268 | end |
175 | 269 | end |
176 | 270 | |
220 | 314 | make_impl |
221 | 315 | end |
222 | 316 | |
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 | |
225 | 324 | |
226 | 325 | directory "tmp/fxscintilla" |
227 | 326 | task "tmp/fxscintilla/fxscintilla-2.28.0/include/Scintilla.iface" => ["tmp/fxscintilla", "ports/archives/fxscintilla-2.28.0.tar.gz"] do |
0 | image: Visual Studio 2019 | |
1 | ||
2 | clone_depth: 1 | |
3 | ||
4 | init: | |
5 | - SET PATH=c:/Ruby%ruby_version%/bin;c:/msys64/%MSYSTEM%/bin;%PATH% | |
6 | - SET RAKEOPT=-rdevkit | |
7 | install: | |
8 | - ps: | | |
9 | if ($env:ruby_version -like "*head*") { | |
10 | $(new-object net.webclient).DownloadFile("https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-$env:ruby_version.exe", "$pwd/ruby-setup.exe") | |
11 | cmd /c ruby-setup.exe /verysilent /dir=C:/Ruby$env:ruby_version | |
12 | } | |
13 | - ruby --version | |
14 | - gem --version | |
15 | - ridk version | |
16 | # Remove gcc-ada and gcc-objc, since they are no longer supported by msys2 and therefore cause a dependency issue | |
17 | - 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" | |
18 | - c:/msys64/usr/bin/bash -lc "pacman -Syu --noconfirm --ask 20" | |
19 | - c:/msys64/usr/bin/bash -lc "pacman -Su --noconfirm" | |
20 | - c:/msys64/usr/bin/bash -lc "pacman -S --noconfirm --needed ${MINGW_PACKAGE_PREFIX}-fox ${MINGW_PACKAGE_PREFIX}-swig" | |
21 | - swig -version | |
22 | - gem install bundler --conservative | |
23 | - bundle config set force_ruby_platform true | |
24 | - bundle install | |
25 | build_script: | |
26 | - bundle exec rake compile | |
27 | test_script: | |
28 | - bundle exec rake test | |
29 | environment: | |
30 | matrix: | |
31 | - ruby_version: "head-x64" | |
32 | MINGW_PACKAGE_PREFIX: "mingw-w64-x86_64" | |
33 | MSYSTEM: "MINGW64" | |
34 | - ruby_version: "24" | |
35 | MINGW_PACKAGE_PREFIX: "mingw-w64-i686" | |
36 | MSYSTEM: "MINGW32" |
77 | 77 | <doap:Version> |
78 | 78 | <doap:branch>fox16</doap:branch> |
79 | 79 | <doap:created><%= Date.today %></doap:created> |
80 | <doap:revision><%= PKG_VERSION %></doap:revision> | |
80 | <doap:revision><%= Fox.fxrubyversion %></doap:revision> | |
81 | 81 | </doap:Version> |
82 | 82 | </doap:release> |
83 | 83 |
133 | 133 | saveDialog = FXFileDialog.new(self, "Save Image") |
134 | 134 | saveDialog.filename = @itemList.getItemText(@itemList.currentItem) |
135 | 135 | if saveDialog.execute != 0 |
136 | if File.exists? saveDialog.filename | |
136 | if File.exist? saveDialog.filename | |
137 | 137 | if MBOX_CLICKED_NO == FXMessageBox.question(self, MBOX_YES_NO, |
138 | 138 | "Overwrite Image", "Overwrite existing image?") |
139 | 139 | return 1 |
2 | 2 | require 'fox16' |
3 | 3 | begin |
4 | 4 | require 'opengl' |
5 | require 'glu' | |
6 | 5 | rescue LoadError |
7 | 6 | require 'fox16/missingdep' |
8 | 7 | MSG = <<EOM |
9 | Sorry, this example depends on the opengl gems. Please execute: | |
10 | gem install opengl glu | |
8 | Sorry, this example depends on the opengl-bindings gems. Please execute: | |
9 | gem install opengl-bindings | |
11 | 10 | EOM |
12 | 11 | missingDependency(MSG) |
13 | 12 | end |
14 | 13 | |
15 | 14 | |
16 | include Fox | |
17 | ||
18 | class GLTestWindow < FXMainWindow | |
15 | ||
16 | class GLTestWindow < Fox::FXMainWindow | |
17 | include Fox | |
18 | include OpenGL | |
19 | 19 | |
20 | 20 | # How often our timer will fire (in milliseconds) |
21 | 21 | TIMER_INTERVAL = 100 |
22 | 22 | |
23 | 23 | # Draws a simple box using the given corners |
24 | 24 | def drawBox(xmin, ymin, zmin, xmax, ymax, zmax) |
25 | GL.Begin(GL::TRIANGLE_STRIP) | |
26 | GL.Normal(0.0, 0.0, -1.0) | |
27 | GL.Vertex(xmin, ymin, zmin) | |
28 | GL.Vertex(xmin, ymax, zmin) | |
29 | GL.Vertex(xmax, ymin, zmin) | |
30 | GL.Vertex(xmax, ymax, zmin) | |
31 | GL.End() | |
32 | ||
33 | GL.Begin(GL::TRIANGLE_STRIP) | |
34 | GL.Normal(1.0, 0.0, 0.0) | |
35 | GL.Vertex(xmax, ymin, zmin) | |
36 | GL.Vertex(xmax, ymax, zmin) | |
37 | GL.Vertex(xmax, ymin, zmax) | |
38 | GL.Vertex(xmax, ymax, zmax) | |
39 | GL.End() | |
40 | ||
41 | GL.Begin(GL::TRIANGLE_STRIP) | |
42 | GL.Normal(0.0, 0.0, 1.0) | |
43 | GL.Vertex(xmax, ymin, zmax) | |
44 | GL.Vertex(xmax, ymax, zmax) | |
45 | GL.Vertex(xmin, ymin, zmax) | |
46 | GL.Vertex(xmin, ymax, zmax) | |
47 | GL.End() | |
48 | ||
49 | GL.Begin(GL::TRIANGLE_STRIP) | |
50 | GL.Normal(-1.0, 0.0, 0.0) | |
51 | GL.Vertex(xmin, ymin, zmax) | |
52 | GL.Vertex(xmin, ymax, zmax) | |
53 | GL.Vertex(xmin, ymin, zmin) | |
54 | GL.Vertex(xmin, ymax, zmin) | |
55 | GL.End() | |
56 | ||
57 | GL.Begin(GL::TRIANGLE_STRIP) | |
58 | GL.Normal(0.0, 1.0, 0.0) | |
59 | GL.Vertex(xmin, ymax, zmin) | |
60 | GL.Vertex(xmin, ymax, zmax) | |
61 | GL.Vertex(xmax, ymax, zmin) | |
62 | GL.Vertex(xmax, ymax, zmax) | |
63 | GL.End() | |
64 | ||
65 | GL.Begin(GL::TRIANGLE_STRIP) | |
66 | GL.Normal(0.0, -1.0, 0.0) | |
67 | GL.Vertex(xmax, ymin, zmax) | |
68 | GL.Vertex(xmax, ymin, zmin) | |
69 | GL.Vertex(xmin, ymin, zmax) | |
70 | GL.Vertex(xmin, ymin, zmin) | |
71 | GL.End() | |
25 | glBegin(GL_TRIANGLE_STRIP) | |
26 | glNormal3d(0.0, 0.0, -1.0) | |
27 | glVertex3d(xmin, ymin, zmin) | |
28 | glVertex3d(xmin, ymax, zmin) | |
29 | glVertex3d(xmax, ymin, zmin) | |
30 | glVertex3d(xmax, ymax, zmin) | |
31 | glEnd() | |
32 | ||
33 | glBegin(GL_TRIANGLE_STRIP) | |
34 | glNormal3d(1.0, 0.0, 0.0) | |
35 | glVertex3d(xmax, ymin, zmin) | |
36 | glVertex3d(xmax, ymax, zmin) | |
37 | glVertex3d(xmax, ymin, zmax) | |
38 | glVertex3d(xmax, ymax, zmax) | |
39 | glEnd() | |
40 | ||
41 | glBegin(GL_TRIANGLE_STRIP) | |
42 | glNormal3d(0.0, 0.0, 1.0) | |
43 | glVertex3d(xmax, ymin, zmax) | |
44 | glVertex3d(xmax, ymax, zmax) | |
45 | glVertex3d(xmin, ymin, zmax) | |
46 | glVertex3d(xmin, ymax, zmax) | |
47 | glEnd() | |
48 | ||
49 | glBegin(GL_TRIANGLE_STRIP) | |
50 | glNormal3d(-1.0, 0.0, 0.0) | |
51 | glVertex3d(xmin, ymin, zmax) | |
52 | glVertex3d(xmin, ymax, zmax) | |
53 | glVertex3d(xmin, ymin, zmin) | |
54 | glVertex3d(xmin, ymax, zmin) | |
55 | glEnd() | |
56 | ||
57 | glBegin(GL_TRIANGLE_STRIP) | |
58 | glNormal3d(0.0, 1.0, 0.0) | |
59 | glVertex3d(xmin, ymax, zmin) | |
60 | glVertex3d(xmin, ymax, zmax) | |
61 | glVertex3d(xmax, ymax, zmin) | |
62 | glVertex3d(xmax, ymax, zmax) | |
63 | glEnd() | |
64 | ||
65 | glBegin(GL_TRIANGLE_STRIP) | |
66 | glNormal3d(0.0, -1.0, 0.0) | |
67 | glVertex3d(xmax, ymin, zmax) | |
68 | glVertex3d(xmax, ymin, zmin) | |
69 | glVertex3d(xmin, ymin, zmax) | |
70 | glVertex3d(xmin, ymin, zmin) | |
71 | glEnd() | |
72 | end | |
73 | ||
74 | def gluPerspective(fovY, aspect, zNear, zFar ) | |
75 | fH = Math.tan( fovY / 360 * Math::PI ) * zNear; | |
76 | fW = fH * aspect; | |
77 | ||
78 | glFrustum( -fW, fW, -fH, fH, zNear, zFar ); | |
79 | end | |
80 | ||
81 | # Define our own version of gluLookAt() to avoid dependency to deprecated GLU library | |
82 | def gluLookAt(ex, ey, ez, | |
83 | lx, ly, lz, | |
84 | ux, uy, uz ) | |
85 | z0 = ex - lx | |
86 | z1 = ey - ly | |
87 | z2 = ez - lz | |
88 | l = z0*z0+z1*z1+z2*z2 | |
89 | if l != 0 then | |
90 | l = 1.0 / Math.sqrt(l) | |
91 | z0 *= l | |
92 | z1 *= l | |
93 | z2 *= l | |
94 | end | |
95 | ||
96 | x0 = uy*z2-uz*z1 | |
97 | x1 = -ux*z2+uz*z0 | |
98 | x2 = ux*z1-uy*z0 | |
99 | l = x0*x0+x1*x1+x2*x2 | |
100 | if l != 0 then | |
101 | l = 1.0 / Math.sqrt(l) | |
102 | x0 *= l | |
103 | x1 *= l | |
104 | x2 *= l | |
105 | end | |
106 | ||
107 | y0 = z1*x2-z2*x1 | |
108 | y1 = -z0*x2+z2*x0 | |
109 | y2 = z0*x1-z1*x0 | |
110 | l = y0*y0+y1*y1+y2*y2 | |
111 | if l != 0 then | |
112 | l = 1.0 / Math.sqrt(l) | |
113 | y0 *= l | |
114 | y1 *= l | |
115 | y2 *= l | |
116 | end | |
117 | ||
118 | m4x4 = [ | |
119 | x0,y0,z0,0, | |
120 | x1,y1,z1,0, | |
121 | x2,y2,z2,0, | |
122 | 0, 0, 0,1, | |
123 | ].pack("d*") | |
124 | glMultMatrixd m4x4 | |
125 | glTranslated -ex,-ey,-ez | |
72 | 126 | end |
73 | 127 | |
74 | 128 | # Draw the GL scene |
86 | 140 | # Make context current |
87 | 141 | @glcanvas.makeCurrent() |
88 | 142 | |
89 | GL.Viewport(0, 0, @glcanvas.width, @glcanvas.height) | |
90 | ||
91 | GL.ClearColor(1.0, 1.0, 1.0, 1.0) | |
92 | GL.Clear(GL::COLOR_BUFFER_BIT|GL::DEPTH_BUFFER_BIT) | |
93 | GL.Enable(GL::DEPTH_TEST) | |
94 | ||
95 | GL.Disable(GL::DITHER) | |
96 | ||
97 | GL.MatrixMode(GL::PROJECTION) | |
98 | GL.LoadIdentity() | |
99 | GLU.Perspective(30.0, aspect, 1.0, 100.0) | |
100 | ||
101 | GL.MatrixMode(GL::MODELVIEW) | |
102 | GL.LoadIdentity() | |
103 | GLU.LookAt(5.0, 10.0, 15.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | |
104 | ||
105 | GL.ShadeModel(GL::SMOOTH) | |
106 | GL.Light(GL::LIGHT0, GL::POSITION, lightPosition) | |
107 | GL.Light(GL::LIGHT0, GL::AMBIENT, lightAmbient) | |
108 | GL.Light(GL::LIGHT0, GL::DIFFUSE, lightDiffuse) | |
109 | GL.Enable(GL::LIGHT0) | |
110 | GL.Enable(GL::LIGHTING) | |
111 | ||
112 | GL.Material(GL::FRONT, GL::AMBIENT, blueMaterial) | |
113 | GL.Material(GL::FRONT, GL::DIFFUSE, blueMaterial) | |
114 | ||
115 | GL.PushMatrix() | |
116 | GL.Rotated(@angle, 0.0, 1.0, 0.0) | |
143 | glViewport(0, 0, @glcanvas.width, @glcanvas.height) | |
144 | ||
145 | glClearColor(1.0, 1.0, 1.0, 1.0) | |
146 | glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT) | |
147 | glEnable(GL_DEPTH_TEST) | |
148 | ||
149 | glDisable(GL_DITHER) | |
150 | ||
151 | glMatrixMode(GL_PROJECTION) | |
152 | glLoadIdentity() | |
153 | gluPerspective(30.0, aspect, 1.0, 100.0) | |
154 | ||
155 | glMatrixMode(GL_MODELVIEW) | |
156 | glLoadIdentity() | |
157 | gluLookAt(5.0, 10.0, 15.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | |
158 | ||
159 | glShadeModel(GL_SMOOTH) | |
160 | glLightfv(GL_LIGHT0, GL_POSITION, lightPosition.pack("f*")) | |
161 | glLightfv(GL_LIGHT0, GL_AMBIENT, lightAmbient.pack("f*")) | |
162 | glLightfv(GL_LIGHT0, GL_DIFFUSE, lightDiffuse.pack("f*")) | |
163 | glEnable(GL_LIGHT0) | |
164 | glEnable(GL_LIGHTING) | |
165 | ||
166 | glMaterialfv(GL_FRONT, GL_AMBIENT, blueMaterial.pack("f*")) | |
167 | glMaterialfv(GL_FRONT, GL_DIFFUSE, blueMaterial.pack("f*")) | |
168 | ||
169 | glPushMatrix() | |
170 | glRotated(@angle, 0.0, 1.0, 0.0) | |
117 | 171 | drawBox(-1, -1, -1, 1, 1, 1) |
118 | 172 | |
119 | GL.Material(GL::FRONT, GL::AMBIENT, redMaterial) | |
120 | GL.Material(GL::FRONT, GL::DIFFUSE, redMaterial) | |
121 | ||
122 | GL.PushMatrix() | |
123 | GL.Translated(0.0, 1.75, 0.0) | |
124 | GL.Rotated(@angle, 0.0, 1.0, 0.0) | |
173 | glMaterialfv(GL_FRONT, GL_AMBIENT, redMaterial.pack("f*")) | |
174 | glMaterialfv(GL_FRONT, GL_DIFFUSE, redMaterial.pack("f*")) | |
175 | ||
176 | glPushMatrix() | |
177 | glTranslated(0.0, 1.75, 0.0) | |
178 | glRotated(@angle, 0.0, 1.0, 0.0) | |
125 | 179 | drawBox(-0.5, -0.5, -0.5, 0.5, 0.5, 0.5) |
126 | GL.PopMatrix() | |
127 | ||
128 | GL.PushMatrix() | |
129 | GL.Translated(0.0, -1.75, 0.0) | |
130 | GL.Rotated(@angle, 0.0, 1.0, 0.0) | |
180 | glPopMatrix() | |
181 | ||
182 | glPushMatrix() | |
183 | glTranslated(0.0, -1.75, 0.0) | |
184 | glRotated(@angle, 0.0, 1.0, 0.0) | |
131 | 185 | drawBox(-0.5, -0.5, -0.5, 0.5, 0.5, 0.5) |
132 | GL.PopMatrix() | |
133 | ||
134 | GL.PushMatrix() | |
135 | GL.Rotated(90.0, 1.0, 0.0, 0.0) | |
136 | GL.Translated(0.0, 1.75, 0.0) | |
137 | GL.Rotated(@angle, 0.0, 1.0, 0.0) | |
186 | glPopMatrix() | |
187 | ||
188 | glPushMatrix() | |
189 | glRotated(90.0, 1.0, 0.0, 0.0) | |
190 | glTranslated(0.0, 1.75, 0.0) | |
191 | glRotated(@angle, 0.0, 1.0, 0.0) | |
138 | 192 | drawBox(-0.5,-0.5,-0.5,0.5,0.5,0.5) |
139 | GL.PopMatrix() | |
140 | ||
141 | GL.PushMatrix() | |
142 | GL.Rotated(90.0, -1.0, 0.0, 0.0) | |
143 | GL.Translated(0.0,1.75,0.0) | |
144 | GL.Rotated(@angle, 0.0, 1.0, 0.0) | |
193 | glPopMatrix() | |
194 | ||
195 | glPushMatrix() | |
196 | glRotated(90.0, -1.0, 0.0, 0.0) | |
197 | glTranslated(0.0,1.75,0.0) | |
198 | glRotated(@angle, 0.0, 1.0, 0.0) | |
145 | 199 | drawBox(-0.5,-0.5,-0.5,0.5,0.5,0.5) |
146 | GL.PopMatrix() | |
147 | ||
148 | GL.PushMatrix() | |
149 | GL.Rotated(90.0, 0.0, 0.0, 1.0) | |
150 | GL.Translated(0.0,1.75,0.0) | |
151 | GL.Rotated(@angle, 0.0, 1.0, 0.0) | |
200 | glPopMatrix() | |
201 | ||
202 | glPushMatrix() | |
203 | glRotated(90.0, 0.0, 0.0, 1.0) | |
204 | glTranslated(0.0,1.75,0.0) | |
205 | glRotated(@angle, 0.0, 1.0, 0.0) | |
152 | 206 | drawBox(-0.5,-0.5,-0.5,0.5,0.5,0.5) |
153 | GL.PopMatrix() | |
154 | ||
155 | GL.PushMatrix() | |
156 | GL.Rotated(90.0, 0.0, 0.0, -1.0) | |
157 | GL.Translated(0.0,1.75,0.0) | |
158 | GL.Rotated(@angle, 0.0, 1.0, 0.0) | |
207 | glPopMatrix() | |
208 | ||
209 | glPushMatrix() | |
210 | glRotated(90.0, 0.0, 0.0, -1.0) | |
211 | glTranslated(0.0,1.75,0.0) | |
212 | glRotated(@angle, 0.0, 1.0, 0.0) | |
159 | 213 | drawBox(-0.5,-0.5,-0.5,0.5,0.5,0.5) |
160 | GL.PopMatrix() | |
161 | ||
162 | GL.PopMatrix() | |
214 | glPopMatrix() | |
215 | ||
216 | glPopMatrix() | |
163 | 217 | |
164 | 218 | # Swap if it is double-buffered |
165 | 219 | if @glvisual.isDoubleBuffer |
173 | 227 | def initialize(app) |
174 | 228 | # Invoke the base class initializer |
175 | 229 | super(app, "OpenGL Test Application", :opts => DECOR_ALL, :width => 800, :height => 600) |
230 | ||
231 | OpenGL.load_lib | |
176 | 232 | |
177 | 233 | # Construct the main window elements |
178 | 234 | frame = FXHorizontalFrame.new(self, LAYOUT_SIDE_TOP|LAYOUT_FILL_X|LAYOUT_FILL_Y) |
206 | 262 | @glcanvas.connect(SEL_PAINT) { drawScene } |
207 | 263 | @glcanvas.connect(SEL_CONFIGURE) do |
208 | 264 | if @glcanvas.makeCurrent |
209 | GL.Viewport(0, 0, @glcanvas.width, @glcanvas.height) | |
265 | glViewport(0, 0, @glcanvas.width, @glcanvas.height) | |
210 | 266 | @glcanvas.makeNonCurrent |
211 | 267 | end |
212 | 268 | end |
309 | 365 | |
310 | 366 | if __FILE__ == $0 |
311 | 367 | # Construct the application |
312 | application = FXApp.new("GLTest", "FoxTest") | |
313 | ||
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 | |
368 | application = Fox::FXApp.new("GLTest", "FoxTest") | |
320 | 369 | |
321 | 370 | # Construct the main window |
322 | 371 | GLTestWindow.new(application) |
6 | 6 | rescue LoadError |
7 | 7 | require 'fox16/missingdep' |
8 | 8 | MSG = <<EOM |
9 | Sorry, this example depends on the OpenGL extension. Please | |
10 | check the Ruby Application Archives for an appropriate | |
11 | download site. | |
9 | Sorry, this example depends on the opengl-bindings gems. Please execute: | |
10 | gem install opengl-bindings | |
12 | 11 | EOM |
13 | 12 | missingDependency(MSG) |
14 | 13 | end |
15 | 14 | |
16 | include Fox | |
17 | ||
18 | class TabBook < FXTabBook | |
15 | class TabBook < Fox::FXTabBook | |
16 | include Fox | |
17 | ||
19 | 18 | def createAnglesPage(panels, mdiclient) |
20 | 19 | # Angles tab |
21 | 20 | FXTabItem.new(panels, |
142 | 141 | end |
143 | 142 | end |
144 | 143 | |
145 | class GLViewWindow < FXMainWindow | |
146 | ||
144 | class GLViewWindow < Fox::FXMainWindow | |
145 | include Fox | |
147 | 146 | include Responder |
148 | 147 | |
149 | 148 | ID_QUERY_MODE = FXMainWindow::ID_LAST |
160 | 159 | def initialize(app) |
161 | 160 | # Initialize base class first |
162 | 161 | super(app, "OpenGL Example Application", :opts => DECOR_ALL, :width => 800, :height => 600) |
162 | ||
163 | OpenGL.load_lib | |
164 | GLU.load_lib | |
163 | 165 | |
164 | 166 | # Define message identifiers for this class |
165 | 167 | |
480 | 482 | sphere = FXGLSphere.new(1.0, 1.0, 0.0, 0.5) |
481 | 483 | sphere2 = FXGLSphere.new(0.0, 0.0, 0.0, 0.8) |
482 | 484 | sphere.tipText = "Sphere" |
485 | gp2.append(FXGLLine.new(-2.0, 0.0, 0.0, -1.0, 1.0, 1.0)) | |
486 | gp2.append(FXGLPoint.new(-2.0, 0.0, 0.0)) | |
483 | 487 | gp2.append(FXGLCube.new(-1.0, 0.0, 0.0, 1.0, 1.0, 1.0)) |
484 | 488 | gp2.append(FXGLCube.new( 1.0, 0.0, 0.0, 1.0, 1.0, 1.0)) |
485 | 489 | gp2.append(FXGLCube.new( 0.0,-1.0, 0.0, 1.0, 1.0, 1.0)) |
555 | 559 | |
556 | 560 | if __FILE__ == $0 |
557 | 561 | # Make application |
558 | application = FXApp.new("GLViewer", "FoxTest") | |
562 | application = Fox::FXApp.new("GLViewer", "FoxTest") | |
559 | 563 | application.threadsEnabled = false |
560 | 564 | |
561 | 565 | # Make window |
360 | 360 | show(PLACEMENT_SCREEN) |
361 | 361 | |
362 | 362 | # Create a thread to update the clock |
363 | @clockThread = Thread.new(@clockLabel) { |clockLabel| | |
363 | @clockThread = Thread.new(@clockLabel) do |clockLabel| | |
364 | 364 | 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 | |
366 | 368 | sleep(1) |
367 | 369 | end |
368 | } | |
370 | end | |
369 | 371 | end |
370 | 372 | end |
371 | 373 |
325 | 325 | def onCmdSave(sender, sel, ptr) |
326 | 326 | saveDialog = FXFileDialog.new(self, "Save Image") |
327 | 327 | if saveDialog.execute != 0 |
328 | if File.exists? saveDialog.filename | |
328 | if File.exist? saveDialog.filename | |
329 | 329 | if MBOX_CLICKED_NO == FXMessageBox.question(self, MBOX_YES_NO, |
330 | 330 | "Overwrite Image", "Overwrite existing image?") |
331 | 331 | return 1 |
20 | 20 | |
21 | 21 | # Output will be displayed in a multiline text area |
22 | 22 | @cmdOutput = FXText.new(textFrame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y) |
23 | @cmdInput.text = "ping rubyinstaller.org" | |
23 | 24 | |
24 | 25 | # Initialize the pipe |
25 | 26 | @pipe = nil |
29 | 30 | def create |
30 | 31 | super |
31 | 32 | show(PLACEMENT_SCREEN) |
33 | @cmdInput.setFocus | |
32 | 34 | end |
33 | 35 | |
34 | 36 | # Remove previous input (if any) |
53 | 55 | getApp().addInput(@pipe, INPUT_READ|INPUT_EXCEPT) do |sender, sel, ptr| |
54 | 56 | case FXSELTYPE(sel) |
55 | 57 | 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 | |
58 | 65 | @cmdOutput.appendText(text) |
59 | else | |
60 | closePipe | |
61 | 66 | end |
62 | 67 | when SEL_IO_EXCEPT |
63 | 68 | # puts 'onPipeExcept' |
46 | 46 | theLabel.layoutHints = LAYOUT_FILL_X |
47 | 47 | end |
48 | 48 | |
49 | FXTextField.new(top, 20, @text, FXDataTarget::ID_VALUE) do |theTextField| | |
49 | @theTextField = FXTextField.new(top, 20, @text, FXDataTarget::ID_VALUE) do |theTextField| | |
50 | 50 | theTextField.layoutHints = LAYOUT_FILL_X |
51 | theTextField.setFocus() | |
52 | 51 | end |
53 | 52 | |
54 | 53 | FXButton.new(top, 'Pig It') do |pigButton| |
65 | 64 | def create |
66 | 65 | super |
67 | 66 | show(PLACEMENT_SCREEN) |
67 | @theTextField.setFocus | |
68 | 68 | end |
69 | 69 | end |
70 | 70 |
1024 | 1024 | return false if (savedialog.execute == 0) |
1025 | 1025 | setCurrentPattern(savedialog.currentPattern) |
1026 | 1026 | file = savedialog.filename |
1027 | if File.exists?(file) | |
1027 | if File.exist?(file) | |
1028 | 1028 | if MBOX_CLICKED_NO == FXMessageBox.question(self, MBOX_YES_NO, |
1029 | 1029 | "Overwrite Document", "Overwrite existing document: #{file}?") |
1030 | 1030 | return false |
1091 | 1091 | if savedialog.execute != 0 |
1092 | 1092 | setCurrentPattern(savedialog.currentPattern) |
1093 | 1093 | file = savedialog.filename |
1094 | if File.exists?(file) | |
1094 | if File.exist?(file) | |
1095 | 1095 | if MBOX_CLICKED_NO == FXMessageBox.question(self, MBOX_YES_NO, |
1096 | 1096 | "Overwrite Document", "Overwrite existing document: #{file}?") |
1097 | 1097 | return 1 |
1133 | 1133 | # Attempt to extract the file name from various forms |
1134 | 1134 | if string =~ /#include \".*\"/ |
1135 | 1135 | file = File.expand_path(name, dir) |
1136 | if !File.exists?(file) | |
1136 | if !File.exist?(file) | |
1137 | 1137 | Find.find(@searchpath) { |f| file = f if (f == name) } |
1138 | 1138 | end |
1139 | 1139 | elsif string =~ /#include <.*>/ |
1140 | 1140 | file = File.expand_path(name, dir) |
1141 | if !File.exists?(file) | |
1141 | if !File.exist?(file) | |
1142 | 1142 | Find.find(@searchpath) { |f| file = f if (f == name) } |
1143 | 1143 | end |
1144 | 1144 | elsif string =~ /.*:.*:.*/ |
1145 | 1145 | file = File.expand_path(name, dir) |
1146 | if !File.exists?(file) | |
1146 | if !File.exist?(file) | |
1147 | 1147 | Find.find(@searchpath) { |f| file = f if (f == name) } |
1148 | 1148 | end |
1149 | 1149 | else |
1150 | 1150 | file = File.expand_path(string, dir) |
1151 | 1151 | end |
1152 | 1152 | |
1153 | if File.exists?(file) | |
1153 | if File.exist?(file) | |
1154 | 1154 | # Different from current file? |
1155 | 1155 | if file != @filename |
1156 | 1156 | # Save old file first |
1212 | 1212 | if savedialog.execute != 0 |
1213 | 1213 | setCurrentPattern(savedialog.currentPattern) |
1214 | 1214 | file = savedialog.filename |
1215 | if File.exists?(file) | |
1215 | if File.exist?(file) | |
1216 | 1216 | if MBOX_CLICKED_NO == FXMessageBox.question(self, MBOX_YES_NO, |
1217 | 1217 | "Overwrite Document", "Overwrite existing document: #{file}?") |
1218 | 1218 | return 1 |
1689 | 1689 | |
1690 | 1690 | # Update box for readonly display |
1691 | 1691 | def onCheckFile(sender, sel, ptr) |
1692 | mtime = File.exists?(@filename) ? File.mtime(@filename) : nil | |
1692 | mtime = File.exist?(@filename) ? File.mtime(@filename) : nil | |
1693 | 1693 | if @filetime && mtime && mtime != @filetime |
1694 | 1694 | @filetime = mtime |
1695 | 1695 | 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 |
0 | 0 | #!/usr/bin/env ruby |
1 | # -*- encoding: UTF-8 -*- | |
1 | 2 | |
2 | 3 | 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 | |
25 | 4 | |
26 | 5 | # 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?" | |
28 | 7 | |
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) | |
32 | 11 | app.create |
33 | main.show(PLACEMENT_SCREEN) | |
12 | main.show(Fox::PLACEMENT_SCREEN) | |
34 | 13 | app.run |
35 | 14 | end |
25 | 25 | |
26 | 26 | #include "FXRbCommon.h" |
27 | 27 | |
28 | #if defined(RUBY_1_8) | |
29 | extern "C" { | |
30 | #include "rubysig.h" /* For CHECK_INTS */ | |
31 | } | |
32 | #endif | |
33 | ||
34 | 28 | #ifdef HAVE_SYS_TIME_H |
35 | 29 | #include <sys/time.h> /* For struct timeval */ |
36 | 30 | #endif |
37 | 31 | |
32 | #ifndef WIN32 | |
33 | #include <unistd.h> | |
34 | #include <fcntl.h> | |
35 | #endif | |
36 | ||
38 | 37 | // Message map |
39 | 38 | 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 | |
40 | 42 | FXMAPFUNC(SEL_CHORE,FXRbApp::ID_CHORE_THREADS,FXRbApp::onChoreThreads), |
43 | #endif | |
41 | 44 | }; |
42 | 45 | |
43 | 46 | // Class implementation |
44 | 47 | FXRbIMPLEMENT(FXRbApp,FXApp,FXRbAppMap,ARRAYNUMBER(FXRbAppMap)) |
45 | 48 | |
49 | #ifdef WIN32 | |
50 | WSAEVENT FXRbApp::interrupt_event = NULL; | |
51 | #else | |
52 | int FXRbApp::interrupt_fds[2] = {-1, -1}; | |
53 | #endif | |
54 | ||
46 | 55 | // 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); | |
51 | 58 | } |
52 | 59 | |
53 | 60 | |
66 | 73 | if(enabled){ |
67 | 74 | if(!m_bThreadsEnabled){ |
68 | 75 | 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 | |
69 | 86 | addChore(this,ID_CHORE_THREADS); |
87 | #endif | |
70 | 88 | } |
71 | 89 | } |
72 | 90 | else{ |
73 | 91 | 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 | |
74 | 102 | removeChore(this,ID_CHORE_THREADS); |
103 | #endif | |
75 | 104 | } |
76 | 105 | } |
77 | 106 | |
87 | 116 | return sleepTime; |
88 | 117 | } |
89 | 118 | |
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 | } | |
90 | 135 | |
91 | 136 | // 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 | |
93 | 140 | // Pause for 'sleepTime' millseconds |
94 | 141 | struct timeval wait; |
95 | 142 | wait.tv_sec=0; |
96 | 143 | wait.tv_usec=100*sleepTime; |
97 | 144 | |
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); | |
105 | 145 | rb_thread_wait_for(wait); |
106 | #endif /* RUBY_1_8 */ | |
107 | 146 | |
108 | 147 | // Re-register this chore for next time |
109 | 148 | addChore(this,ID_CHORE_THREADS); |
149 | #endif | |
110 | 150 | |
111 | 151 | // Back to work... |
112 | 152 | return 1; |
113 | 153 | } |
114 | 154 | |
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 | |
115 | 164 | |
116 | 165 | // Destructor |
117 | 166 | FXRbApp::~FXRbApp(){ |
118 | 167 | FXTRACE((100,"FXRbApp::~FXRbApp()\n")); |
119 | 168 | VALUE myRegistry; |
169 | setThreadsEnabled(FALSE); | |
120 | 170 | FXRbDestroyAppSensitiveObjects(); |
121 | 171 | myRegistry=FXRbGetRubyObj(&(reg()),true); |
122 | 172 | 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; |
28 | 28 | #endif |
29 | 29 | |
30 | 30 | #include "FXRbCommon.h" |
31 | #include "FXRbObjRegistry.h" | |
31 | 32 | #include "impl.h" |
32 | 33 | |
33 | 34 | // SWIG runtime functions we need |
41 | 42 | #include <signal.h> // for definitions of SIGINT, etc. |
42 | 43 | #endif |
43 | 44 | |
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 | ||
53 | 45 | #include "ruby/io.h" |
54 | 46 | #include "ruby/st.h" |
55 | 47 | |
56 | #endif /* RUBY_1_8 */ | |
57 | ||
58 | 48 | |
59 | 49 | // Opaque type declaration from SWIG runtime |
60 | 50 | 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 | ||
61 | 56 | |
62 | 57 | // Wrapper around SWIG_TypeQuery() that caches results for performance |
63 | 58 | swig_type_info *FXRbTypeQuery(const char *desc){ |
73 | 68 | } |
74 | 69 | |
75 | 70 | |
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 | ||
110 | 71 | 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 | } | |
134 | 78 | |
135 | 79 | |
136 | 80 | /** |
139 | 83 | */ |
140 | 84 | |
141 | 85 | 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 | } | |
151 | 88 | |
152 | 89 | 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 | } | |
161 | 92 | |
162 | 93 | 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 | } | |
231 | 96 | |
232 | 97 | |
233 | 98 | // Register this Ruby class instance |
234 | 99 | 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 | } | |
266 | 106 | |
267 | 107 | /** |
268 | 108 | * Remove this mapping between a Ruby instance and a C++ object |
269 | 109 | */ |
270 | 110 | 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 | */ | |
296 | 139 | |
297 | 140 | /** |
298 | 141 | * Return the registered Ruby class instance associated with this |
299 | 142 | * FOX object, or Qnil if not found. |
300 | 143 | */ |
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 | } | |
316 | 147 | |
317 | 148 | /** |
318 | 149 | * 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. | |
320 | 155 | */ |
321 | 156 | VALUE FXRbGetRubyObj(const void *foxObj,swig_type_info* ty){ |
322 | 157 | if(foxObj!=0){ |
323 | 158 | 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{ | |
327 | 167 | return Qnil; |
328 | } | |
329 | } | |
168 | } | |
169 | } | |
330 | 170 | |
331 | 171 | 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){ | |
332 | 182 | 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{ | |
338 | 192 | 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 | ||
341 | 216 | |
342 | 217 | /** |
343 | 218 | * Look up the Ruby instance associated with this C++ object, if any, and mark |
361 | 236 | * example program works if you invoke the GC in ShutterWindow#create; |
362 | 237 | * make sure that the shutter items' contents don't get blown away! |
363 | 238 | */ |
364 | VALUE value=FXRbGetRubyObj(obj,true); | |
239 | VALUE value=FXRbGetRubyObj(obj, true, true); | |
365 | 240 | if(!NIL_P(value)){ |
366 | 241 | rb_gc_mark(value); |
367 | 242 | } |
414 | 289 | VALUE FXRbMakeArray(const FXArc* arcs,FXuint narcs){ |
415 | 290 | VALUE result=rb_ary_new(); |
416 | 291 | 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 *"))); | |
418 | 293 | return result; |
419 | 294 | } |
420 | 295 | |
422 | 297 | VALUE FXRbMakeArray(const FXPoint* points,FXuint npoints){ |
423 | 298 | VALUE result=rb_ary_new(); |
424 | 299 | 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 *"))); | |
426 | 301 | return result; |
427 | 302 | } |
428 | 303 | |
430 | 305 | VALUE FXRbMakeArray(const FXRectangle* rectangles,FXuint nrectangles){ |
431 | 306 | VALUE result=rb_ary_new(); |
432 | 307 | 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 *"))); | |
434 | 309 | return result; |
435 | 310 | } |
436 | 311 | |
438 | 313 | VALUE FXRbMakeArray(const FXSegment* segments,FXuint nsegments){ |
439 | 314 | VALUE result=rb_ary_new(); |
440 | 315 | 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 *"))); | |
442 | 317 | return result; |
443 | 318 | } |
444 | 319 | |
445 | 320 | // Returns a Ruby array of FXColor values |
446 | 321 | VALUE FXRbMakeColorArray(const FXColor* colors,FXint w,FXint h){ |
447 | 322 | VALUE result=rb_ary_new(); |
448 | FXint size=w*h; | |
323 | FXuint size=w*h; | |
449 | 324 | for(FXuint i=0; i<size; i++) |
450 | 325 | rb_ary_push(result,to_ruby(colors[i])); |
451 | 326 | return result; |
498 | 373 | */ |
499 | 374 | static VALUE FXRbConvertMessageData(FXObject* sender,FXObject* recv,FXSelector sel,void* ptr){ |
500 | 375 | FXTRACE((1,"FXRbConvertMessageData(%s(%p),FXSEL(%s,%d),%p)\n",sender->getClassName(),sender,FXDebugTarget::messageTypeName[FXSELTYPE(sel)],FXSELID(sel),ptr)); |
501 | FXInputHandle fff; | |
502 | 376 | FXushort type=FXSELTYPE(sel); |
503 | 377 | FXushort id=FXSELID(sel); |
504 | 378 | |
554 | 428 | type==SEL_PICKED || |
555 | 429 | type==SEL_SESSION_NOTIFY || |
556 | 430 | type==SEL_SESSION_CLOSED) { |
557 | return to_ruby(reinterpret_cast<FXEvent*>(ptr)); | |
431 | return to_ruby_cb(reinterpret_cast<FXEvent*>(ptr)); | |
558 | 432 | } |
559 | 433 | 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)); | |
561 | 435 | } |
562 | 436 | 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))); | |
564 | 438 | } |
565 | 439 | else if(type==SEL_IO_READ || |
566 | 440 | type==SEL_IO_WRITE || |
567 | 441 | 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 | |
573 | 442 | return Qnil; |
574 | 443 | } |
575 | 444 | else if(type==SEL_CLOSE || |
587 | 456 | if(type==SEL_CHANGED||type==SEL_COMMAND) return Qnil; |
588 | 457 | } |
589 | 458 | 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))); | |
591 | 460 | } |
592 | 461 | 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)); | |
594 | 463 | } |
595 | 464 | else if(sender->isMemberOf(FXMETACLASS(FXButton))){ |
596 | 465 | if(type==SEL_CLICKED || |
597 | 466 | type==SEL_DOUBLECLICKED || |
598 | 467 | 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))); | |
600 | 469 | } |
601 | 470 | 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))); | |
603 | 472 | } |
604 | 473 | else if(sender->isMemberOf(FXMETACLASS(FXColorBar))){ |
605 | 474 | if(type==SEL_CHANGED || type==SEL_COMMAND){ |
606 | 475 | 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])); | |
608 | 477 | } |
609 | 478 | } |
610 | 479 | 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))); | |
612 | 481 | } |
613 | 482 | else if(sender->isMemberOf(FXMETACLASS(FXColorRing))){ |
614 | 483 | if(type==SEL_CHANGED || type==SEL_COMMAND){ |
615 | 484 | 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])); | |
617 | 486 | } |
618 | 487 | } |
619 | 488 | 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))); | |
621 | 490 | } |
622 | 491 | else if(sender->isMemberOf(FXMETACLASS(FXColorWell))){ |
623 | 492 | if(type==SEL_CHANGED || |
625 | 494 | type==SEL_CLICKED || |
626 | 495 | type==SEL_DOUBLECLICKED || |
627 | 496 | 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))); | |
629 | 498 | return v; |
630 | 499 | } |
631 | 500 | } |
632 | 501 | else if(sender->isMemberOf(FXMETACLASS(FXColorWheel))){ |
633 | 502 | if(type==SEL_CHANGED || type==SEL_COMMAND){ |
634 | 503 | 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])); | |
636 | 505 | } |
637 | 506 | } |
638 | 507 | 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)); | |
640 | 509 | } |
641 | 510 | else if(sender->isMemberOf(FXMETACLASS(FXDataTarget))){ |
642 | 511 | if(type==SEL_COMMAND || type==SEL_CHANGED){ |
643 | 512 | if(recv->isMemberOf(FXMETACLASS(FXWindow))){ |
644 | 513 | switch(id){ |
645 | 514 | case FXWindow::ID_SETINTVALUE: |
646 | return to_ruby(*reinterpret_cast<FXint*>(ptr)); | |
515 | return to_ruby_cb(*reinterpret_cast<FXint*>(ptr)); | |
647 | 516 | case FXWindow::ID_SETREALVALUE: |
648 | return to_ruby(*reinterpret_cast<FXdouble*>(ptr)); | |
517 | return to_ruby_cb(*reinterpret_cast<FXdouble*>(ptr)); | |
649 | 518 | case FXWindow::ID_SETSTRINGVALUE: |
650 | return to_ruby(*reinterpret_cast<FXString*>(ptr)); | |
519 | return to_ruby_cb(*reinterpret_cast<FXString*>(ptr)); | |
651 | 520 | case FXWindow::ID_GETINTVALUE: |
652 | 521 | case FXWindow::ID_GETREALVALUE: |
653 | 522 | case FXWindow::ID_GETSTRINGVALUE: |
665 | 534 | } |
666 | 535 | } |
667 | 536 | 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))); | |
669 | 538 | } |
670 | 539 | 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)); | |
672 | 541 | } |
673 | 542 | 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 *")); | |
675 | 544 | } |
676 | 545 | else if(sender->isMemberOf(FXMETACLASS(FXFileList))){ |
677 | 546 | if (type==SEL_CHANGED || |
678 | 547 | type==SEL_CLICKED || |
679 | 548 | type==SEL_DOUBLECLICKED || |
680 | 549 | 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))); | |
682 | 551 | } |
683 | 552 | else if(sender->isMemberOf(FXMETACLASS(FXFoldingList))){ |
684 | 553 | if(type==SEL_COLLAPSED || |
694 | 563 | type==SEL_DESELECTED || |
695 | 564 | type==SEL_INSERTED || |
696 | 565 | type==SEL_DELETED){ |
697 | return FXRbGetRubyObj(ptr,FXRbTypeQuery("FXFoldingItem *")); | |
566 | return FXRbGetRubyObjCb(ptr,FXRbTypeQuery("FXFoldingItem *")); | |
698 | 567 | } |
699 | 568 | } |
700 | 569 | else if(sender->isMemberOf(FXMETACLASS(FXGLViewer))){ |
703 | 572 | type==SEL_DOUBLECLICKED || |
704 | 573 | type==SEL_TRIPLECLICKED || |
705 | 574 | type==SEL_DRAGGED){ |
706 | return FXRbGetRubyObj(ptr,FXRbTypeQuery("FXGLObject *")); | |
575 | return FXRbGetRubyObjCb(ptr,FXRbTypeQuery("FXGLObject *")); | |
707 | 576 | } |
708 | 577 | else if(type==SEL_COMMAND){ |
709 | 578 | if(id==FXWindow::ID_QUERY_MENU) |
710 | return to_ruby(reinterpret_cast<FXEvent*>(ptr)); | |
579 | return to_ruby_cb(reinterpret_cast<FXEvent*>(ptr)); | |
711 | 580 | else |
712 | return FXRbGetRubyObj(ptr,FXRbTypeQuery("FXGLObject *")); | |
581 | return FXRbGetRubyObjCb(ptr,FXRbTypeQuery("FXGLObject *")); | |
713 | 582 | } |
714 | 583 | else if(type==SEL_LASSOED || |
715 | 584 | type==SEL_INSERTED || |
724 | 593 | } |
725 | 594 | else if(sender->isMemberOf(FXMETACLASS(FXGradientBar))){ |
726 | 595 | 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))); | |
728 | 597 | } |
729 | 598 | else if(type==SEL_SELECTED || type==SEL_DESELECTED){ |
730 | 599 | return Qnil; |
736 | 605 | type==SEL_CLICKED || |
737 | 606 | type==SEL_REPLACED || |
738 | 607 | 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))); | |
740 | 609 | } |
741 | 610 | else if(sender->isMemberOf(FXMETACLASS(FXIconList))){ |
742 | 611 | if(type==SEL_CHANGED || |
748 | 617 | type==SEL_DESELECTED || |
749 | 618 | type==SEL_REPLACED || |
750 | 619 | 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))); | |
752 | 621 | } |
753 | 622 | 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))); | |
755 | 624 | } |
756 | 625 | else if(sender->isMemberOf(FXMETACLASS(FXList))){ |
757 | 626 | if(type==SEL_CHANGED || |
763 | 632 | type==SEL_REPLACED || |
764 | 633 | type==SEL_INSERTED || |
765 | 634 | 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))); | |
767 | 636 | } |
768 | 637 | 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))); | |
770 | 639 | else if(type==SEL_CHANGED) return Qnil; |
771 | 640 | } |
772 | 641 | else if(sender->isMemberOf(FXMETACLASS(FXMDIChild))){ |
778 | 647 | } |
779 | 648 | else if(type==SEL_SELECTED || |
780 | 649 | type==SEL_DESELECTED){ |
781 | return FXRbGetRubyObj(ptr,FXRbTypeQuery("FXMDIChild *")); | |
650 | return FXRbGetRubyObjCb(ptr,FXRbTypeQuery("FXMDIChild *")); | |
782 | 651 | } |
783 | 652 | } |
784 | 653 | 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 *")); | |
786 | 655 | } |
787 | 656 | 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)); | |
789 | 658 | } |
790 | 659 | 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)); | |
792 | 661 | } |
793 | 662 | 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); | |
795 | 664 | } |
796 | 665 | 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)); | |
798 | 667 | } |
799 | 668 | 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))); | |
801 | 670 | } |
802 | 671 | 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))); | |
804 | 673 | } |
805 | 674 | else if(sender->isMemberOf(FXMETACLASS(FXRealSlider))){ |
806 | 675 | if(type==SEL_CHANGED || type==SEL_COMMAND) |
807 | return to_ruby(*(reinterpret_cast<FXdouble *>(ptr))); | |
676 | return to_ruby_cb(*(reinterpret_cast<FXdouble *>(ptr))); | |
808 | 677 | } |
809 | 678 | 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))); | |
811 | 680 | } |
812 | 681 | 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)); | |
814 | 683 | } |
815 | 684 | else if(sender->isMemberOf(FXMETACLASS(FXRuler))){ |
816 | 685 | if(type==SEL_CHANGED) return Qnil; |
817 | 686 | } |
818 | 687 | 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))); | |
820 | 689 | } |
821 | 690 | 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))); | |
823 | 692 | } |
824 | 693 | else if(sender->isMemberOf(FXMETACLASS(FXSlider))){ |
825 | 694 | 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))); | |
827 | 696 | } |
828 | 697 | else if(sender->isMemberOf(FXMETACLASS(FXSpinner))){ |
829 | 698 | 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))); | |
831 | 700 | } |
832 | 701 | else if(sender->isMemberOf(FXMETACLASS(FXSplitter))){ |
833 | 702 | if(type==SEL_CHANGED || type==SEL_COMMAND) |
834 | return to_ruby(reinterpret_cast<FXWindow *>(ptr)); | |
703 | return to_ruby_cb(reinterpret_cast<FXWindow *>(ptr)); | |
835 | 704 | } |
836 | 705 | 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))); | |
838 | 707 | } |
839 | 708 | 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))); | |
841 | 710 | } |
842 | 711 | else if(sender->isMemberOf(FXMETACLASS(FXTable))){ |
843 | 712 | if(type==SEL_CLICKED || |
846 | 715 | type==SEL_CHANGED || |
847 | 716 | type==SEL_COMMAND || |
848 | 717 | 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)); | |
850 | 719 | else if(type == SEL_INSERTED || |
851 | 720 | type == SEL_DELETED || |
852 | 721 | type == SEL_REPLACED){ |
853 | return to_ruby(reinterpret_cast<FXTableRange*>(ptr)); | |
722 | return to_ruby_cb(reinterpret_cast<FXTableRange*>(ptr)); | |
854 | 723 | } |
855 | 724 | } |
856 | 725 | else if(sender->isMemberOf(FXMETACLASS(FXText))){ |
867 | 736 | } |
868 | 737 | } |
869 | 738 | 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))); | |
871 | 740 | } |
872 | 741 | else if(type==SEL_SELECTED || |
873 | 742 | type == SEL_DESELECTED) { |
874 | 743 | FXint* what=reinterpret_cast<FXint*>(ptr); |
875 | 744 | FXASSERT(what!=0); |
876 | 745 | 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 | |
879 | 748 | return ary; |
880 | 749 | } |
881 | 750 | 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)); | |
883 | 752 | } |
884 | 753 | } |
885 | 754 | else if(sender->isMemberOf(FXMETACLASS(FXTextField))){ |
886 | 755 | if(type==SEL_CHANGED || |
887 | 756 | 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)); | |
889 | 758 | } |
890 | 759 | 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))); | |
892 | 761 | } |
893 | 762 | 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))); | |
895 | 764 | } |
896 | 765 | else if(sender->isMemberOf(FXMETACLASS(FXTopWindow))){ |
897 | 766 | if(type==SEL_MINIMIZE || |
902 | 771 | } |
903 | 772 | else if (type==SEL_SESSION_NOTIFY || |
904 | 773 | type==SEL_SESSION_CLOSED) { |
905 | return to_ruby(reinterpret_cast<FXEvent*>(ptr)); | |
774 | return to_ruby_cb(reinterpret_cast<FXEvent*>(ptr)); | |
906 | 775 | } |
907 | 776 | } |
908 | 777 | else if(sender->isMemberOf(FXMETACLASS(FXTreeList))){ |
919 | 788 | type==SEL_DESELECTED || |
920 | 789 | type==SEL_INSERTED || |
921 | 790 | type==SEL_DELETED){ |
922 | return FXRbGetRubyObj(ptr,FXRbTypeQuery("FXTreeItem *")); | |
791 | return FXRbGetRubyObjCb(ptr,FXRbTypeQuery("FXTreeItem *")); | |
923 | 792 | } |
924 | 793 | } |
925 | 794 | else if(sender->isMemberOf(FXMETACLASS(FXTreeListBox))){ |
926 | 795 | if(type==SEL_CHANGED || type==SEL_COMMAND) |
927 | return FXRbGetRubyObj(ptr,FXRbTypeQuery("FXTreeItem *")); | |
796 | return FXRbGetRubyObjCb(ptr,FXRbTypeQuery("FXTreeItem *")); | |
928 | 797 | } |
929 | 798 | #ifdef WITH_FXSCINTILLA |
930 | 799 | else if(sender->isMemberOf(FXMETACLASS(FXScintilla))){ |
931 | 800 | if(type==SEL_COMMAND){ |
932 | return FXRbGetRubyObj(ptr,FXRbTypeQuery("SCNotification *")); | |
801 | return FXRbGetRubyObjCb(ptr,FXRbTypeQuery("SCNotification *")); | |
933 | 802 | } |
934 | 803 | } |
935 | 804 | #endif |
1048 | 917 | case SEL_CLICKED: |
1049 | 918 | case SEL_DOUBLECLICKED: |
1050 | 919 | case SEL_TRIPLECLICKED: |
1051 | case SEL_CHANGED: | |
1052 | 920 | case SEL_DESELECTED: |
1053 | 921 | case SEL_SELECTED: |
1054 | 922 | case SEL_INSERTED: |
1164 | 1032 | return NULL; |
1165 | 1033 | case FXWindow::ID_HSCROLLED: |
1166 | 1034 | 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))); | |
1168 | 1036 | case FXWindow::ID_SETINTVALUE: |
1169 | 1037 | if(obj->isMemberOf(FXMETACLASS(FXColorWell))){ |
1170 | 1038 | colorValue=NUM2UINT(value); |
1205 | 1073 | if(obj->isMemberOf(FXMETACLASS(FXPicker))){ |
1206 | 1074 | SWIG_ConvertPtr(value,&ptr,FXRbTypeQuery("FXPoint *"),1); |
1207 | 1075 | 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 | } | |
1211 | 1086 | |
1212 | 1087 | if(type==SEL_DRAGGED){ |
1213 | 1088 | SWIG_ConvertPtr(value,&ptr,FXRbTypeQuery("FXEvent *"),1); |
1228 | 1103 | * or return zero if the designated receiver doesn't handle this |
1229 | 1104 | * message. |
1230 | 1105 | */ |
1231 | ID FXRbLookupHandler(FXObject* recv,FXSelector key){ | |
1106 | ID FXRbLookupHandler_gvlcb(FXObject* recv,FXSelector key){ | |
1232 | 1107 | FXTRACE((100,"FXRbLookupHandler(recv=%p(%s),FXSEL(%d,%d))\n",recv,recv->getClassName(),FXSELTYPE(key),FXSELID(key))); |
1233 | 1108 | ID id=0; |
1234 | 1109 | VALUE rubyObj=to_ruby(recv); |
1275 | 1150 | static VALUE handle_rescue(VALUE args,VALUE error){ |
1276 | 1151 | VALUE info=rb_gv_get("$!"); |
1277 | 1152 | 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); | |
1279 | 1155 | fprintf(stderr,"%s: %s (%s)\n", |
1280 | StringValuePtr(mesg), | |
1281 | RSTRING_PTR(rb_obj_as_string(info)), | |
1156 | StringValueCStr(mesg), | |
1157 | StringValueCStr(info_str), | |
1282 | 1158 | rb_class2name(CLASS_OF(info))); |
1283 | 1159 | 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)); | |
1286 | 1163 | } |
1287 | 1164 | } |
1288 | 1165 | return Qnil; |
1289 | 1166 | } |
1290 | 1167 | |
1291 | 1168 | |
1169 | // Should we catch exceptions thrown by message handlers? | |
1170 | FXbool FXRbCatchExceptions=FALSE; | |
1171 | ||
1172 | ||
1292 | 1173 | // 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){ | |
1294 | 1175 | 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); | |
1298 | 1179 | hArgs.data=FXRbConvertMessageData(sender,recv,key,ptr); |
1299 | 1180 | hArgs.id=func; |
1300 | 1181 | hArgs.nargs=3; |
1303 | 1184 | FXTRACE((100,"FXRbHandleMessage(recv=%p(%s),FXSEL(%s,%d)\n",recv,recv->getClassName(),FXDebugTarget::messageTypeName[FXSELTYPE(key)],FXSELID(key))); |
1304 | 1185 | |
1305 | 1186 | 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, | |
1308 | 1189 | rb_eStandardError, rb_eNameError, 0); |
1309 | 1190 | } |
1310 | 1191 | else{ |
1350 | 1231 | rb_raise(rb_eTypeError,"wrong argument type %s (expected %s)",rb_class2name(CLASS_OF(range)),rb_class2name(rb_cRange)); |
1351 | 1232 | } |
1352 | 1233 | 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); | |
1356 | 1237 | lo=NUM2INT(beg); |
1357 | 1238 | hi=NUM2INT(end); |
1358 | 1239 | if(excl==Qtrue){ |
1366 | 1247 | rb_raise(rb_eTypeError,"wrong argument type %s (expected %s)",rb_class2name(CLASS_OF(range)),rb_class2name(rb_cRange)); |
1367 | 1248 | } |
1368 | 1249 | 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); | |
1372 | 1253 | lo=NUM2DBL(beg); |
1373 | 1254 | hi=NUM2DBL(end); |
1374 | 1255 | if(excl==Qtrue){ |
1379 | 1260 | |
1380 | 1261 | //---------------------------------------------------------------------- |
1381 | 1262 | |
1382 | void FXRbCallVoidMethod(FXObject* recv, ID func) { | |
1263 | void FXRbCallVoidMethod_gvlcb(FXObject* recv, const char *func) { | |
1383 | 1264 | VALUE obj=FXRbGetRubyObj(recv,false); |
1384 | 1265 | FXASSERT(!NIL_P(obj)); |
1385 | 1266 | 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) { | |
1390 | 1271 | VALUE obj=FXRbGetRubyObj(recv,false); |
1391 | 1272 | 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){ | |
1398 | 1279 | VALUE obj=FXRbGetRubyObj(recv,false); |
1399 | 1280 | FXASSERT(!NIL_P(obj)); |
1400 | VALUE v=rb_funcall(obj,func,0,NULL); | |
1281 | VALUE v=rb_funcall(obj,rb_intern(func),0); | |
1401 | 1282 | return (v==Qtrue); |
1402 | 1283 | } |
1403 | 1284 | |
1404 | 1285 | //---------------------------------------------------------------------- |
1405 | 1286 | |
1406 | 1287 | // Call function with "FXint" return value |
1407 | FXint FXRbCallIntMethod(const FXObject* recv,ID func){ | |
1288 | FXint FXRbCallIntMethod_gvlcb(const FXObject* recv,const char *func){ | |
1408 | 1289 | VALUE obj=FXRbGetRubyObj(recv,false); |
1409 | 1290 | FXASSERT(!NIL_P(obj)); |
1410 | VALUE result=rb_funcall(obj,func,0,NULL); | |
1291 | VALUE result=rb_funcall(obj,rb_intern(func),0); | |
1411 | 1292 | return static_cast<FXint>(NUM2INT(result)); |
1412 | 1293 | } |
1413 | 1294 | |
1414 | 1295 | //---------------------------------------------------------------------- |
1415 | 1296 | |
1416 | 1297 | // Call function with "FXGLObject*" return value |
1417 | FXGLObject* FXRbCallGLObjectMethod(FXGLObject* recv,ID func){ | |
1298 | FXGLObject* FXRbCallGLObjectMethod_gvlcb(FXGLObject* recv,const char *func){ | |
1418 | 1299 | VALUE obj=FXRbGetRubyObj(recv,false); |
1419 | 1300 | FXASSERT(!NIL_P(obj)); |
1420 | VALUE result=rb_funcall(obj,func,0,NULL); | |
1301 | VALUE result=rb_funcall(obj,rb_intern(func),0); | |
1421 | 1302 | return NIL_P(result) ? 0 : reinterpret_cast<FXGLObject*>(DATA_PTR(result)); |
1422 | 1303 | } |
1423 | 1304 | |
1424 | FXGLObject* FXRbCallGLObjectMethod(FXGLViewer* recv,ID func,FXint x,FXint y){ | |
1305 | FXGLObject* FXRbCallGLObjectMethod_gvlcb(FXGLViewer* recv,const char *func,FXint x,FXint y){ | |
1425 | 1306 | VALUE obj=FXRbGetRubyObj(recv,false); |
1426 | 1307 | 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)); | |
1428 | 1309 | return NIL_P(result) ? 0 : reinterpret_cast<FXGLObject*>(DATA_PTR(result)); |
1429 | 1310 | } |
1430 | 1311 | |
1431 | FXGLObject* FXRbCallGLObjectMethod(FXGLObject* recv,ID func,FXuint* path,FXint n){ | |
1312 | FXGLObject* FXRbCallGLObjectMethod_gvlcb(FXGLObject* recv,const char *func,FXuint* path,FXint n){ | |
1432 | 1313 | VALUE obj=FXRbGetRubyObj(recv,false); |
1433 | 1314 | 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)); | |
1435 | 1316 | return NIL_P(result) ? 0 : reinterpret_cast<FXGLObject*>(DATA_PTR(result)); |
1436 | 1317 | } |
1437 | 1318 | |
1438 | 1319 | //---------------------------------------------------------------------- |
1439 | 1320 | |
1440 | 1321 | // 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){ | |
1442 | 1323 | FXGLObject** objects=NULL; |
1443 | 1324 | VALUE obj=FXRbGetRubyObj(recv,false); |
1444 | 1325 | 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)); | |
1446 | 1327 | if(!NIL_P(result)){ |
1447 | 1328 | Check_Type(result,T_ARRAY); |
1448 | 1329 | if(FXMALLOC(&objects,FXGLObject*,RARRAY_LEN(result)+1)){ |
1457 | 1338 | |
1458 | 1339 | //---------------------------------------------------------------------- |
1459 | 1340 | |
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){ | |
1461 | 1342 | VALUE itemData=(ptr==0)?Qnil:reinterpret_cast<VALUE>(ptr); |
1462 | 1343 | VALUE obj=FXRbGetRubyObj(recv,false); |
1463 | 1344 | 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); | |
1465 | 1346 | return NIL_P(result)?0:reinterpret_cast<FXTableItem*>(DATA_PTR(result)); |
1466 | 1347 | } |
1467 | 1348 | |
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){ | |
1469 | 1350 | VALUE obj=FXRbGetRubyObj(recv,false); |
1470 | 1351 | 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)); | |
1472 | 1353 | return NIL_P(result)?0:reinterpret_cast<FXTableItem*>(DATA_PTR(result)); |
1473 | 1354 | } |
1474 | 1355 | |
1475 | 1356 | //---------------------------------------------------------------------- |
1476 | 1357 | |
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){ | |
1478 | 1359 | VALUE obj=FXRbGetRubyObj(recv,false); |
1479 | 1360 | 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)); | |
1481 | 1362 | return NIL_P(result) ? 0 : reinterpret_cast<FXTreeItem*>(DATA_PTR(result)); |
1482 | 1363 | } |
1483 | 1364 | |
1484 | 1365 | //---------------------------------------------------------------------- |
1485 | 1366 | |
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){ | |
1487 | 1368 | VALUE obj=FXRbGetRubyObj(recv,false); |
1488 | 1369 | 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)); | |
1490 | 1371 | return NIL_P(result) ? 0 : reinterpret_cast<FXFoldingItem*>(DATA_PTR(result)); |
1491 | 1372 | } |
1492 | 1373 | |
1493 | 1374 | //---------------------------------------------------------------------- |
1494 | 1375 | |
1495 | FXFileAssoc* FXRbCallFileAssocMethod(const FXFileDict* recv,ID func,const FXchar* pathname){ | |
1376 | FXFileAssoc* FXRbCallFileAssocMethod_gvlcb(const FXFileDict* recv,const char *func,const FXchar* pathname){ | |
1496 | 1377 | VALUE obj=FXRbGetRubyObj(recv,false); |
1497 | 1378 | 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)); | |
1499 | 1380 | return NIL_P(result) ? 0 : reinterpret_cast<FXFileAssoc*>(DATA_PTR(result)); |
1500 | 1381 | } |
1501 | 1382 | |
1502 | 1383 | //---------------------------------------------------------------------- |
1503 | 1384 | |
1504 | FXIcon* FXRbCallIconMethod(const FXTableItem* recv,ID func){ | |
1385 | FXIcon* FXRbCallIconMethod_gvlcb(const FXTableItem* recv,const char *func){ | |
1505 | 1386 | VALUE obj=FXRbGetRubyObj(recv,false); |
1506 | 1387 | FXASSERT(!NIL_P(obj)); |
1507 | 1388 | if(!NIL_P(obj)){ |
1508 | VALUE result=rb_funcall(obj,func,0,NULL); | |
1389 | VALUE result=rb_funcall(obj,rb_intern(func),0); | |
1509 | 1390 | return NIL_P(result) ? 0 : reinterpret_cast<FXIcon*>(DATA_PTR(result)); |
1510 | 1391 | } |
1511 | 1392 | else{ |
1515 | 1396 | |
1516 | 1397 | //---------------------------------------------------------------------- |
1517 | 1398 | |
1518 | FXWindow* FXRbCallWindowMethod(const FXTableItem* recv,ID func,FXTable* table){ | |
1399 | FXWindow* FXRbCallWindowMethod_gvlcb(const FXTableItem* recv,const char *func,FXTable* table){ | |
1519 | 1400 | VALUE obj=FXRbGetRubyObj(recv,false); |
1520 | 1401 | 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)); | |
1522 | 1403 | return NIL_P(result) ? 0 : reinterpret_cast<FXWindow*>(DATA_PTR(result)); |
1523 | 1404 | } |
1524 | 1405 | |
1525 | 1406 | //---------------------------------------------------------------------- |
1526 | 1407 | |
1527 | 1408 | // Call function with "FXRange" return value |
1528 | FXRangef FXRbCallRangeMethod(FXObject* recv,ID func){ | |
1409 | FXRangef FXRbCallRangeMethod_gvlcb(FXObject* recv,const char *func){ | |
1529 | 1410 | VALUE obj=FXRbGetRubyObj(recv,false); |
1530 | 1411 | FXASSERT(!NIL_P(obj)); |
1531 | VALUE result=rb_funcall(obj,func,0,NULL); | |
1412 | VALUE result=rb_funcall(obj,rb_intern(func),0); | |
1532 | 1413 | return *reinterpret_cast<FXRangef*>(DATA_PTR(result)); |
1533 | 1414 | } |
1534 | 1415 | |
1535 | 1416 | //---------------------------------------------------------------------- |
1536 | 1417 | |
1537 | 1418 | // Call functions with FXString return value |
1538 | FXString FXRbCallStringMethod(const FXObject* recv, ID func){ | |
1419 | FXString FXRbCallStringMethod_gvlcb(const FXObject* recv, const char *func){ | |
1539 | 1420 | VALUE obj=FXRbGetRubyObj(recv,false); |
1540 | 1421 | FXASSERT(!NIL_P(obj)); |
1541 | VALUE result=rb_funcall(obj,func,0,NULL); | |
1422 | VALUE result=rb_funcall(obj,rb_intern(func),0); | |
1542 | 1423 | return FXString(StringValuePtr(result)); |
1543 | 1424 | } |
1544 | 1425 | |
1545 | 1426 | //---------------------------------------------------------------------- |
1546 | 1427 | |
1547 | 1428 | // 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){ | |
1549 | 1430 | VALUE obj=FXRbGetRubyObj(recv,false); |
1550 | 1431 | 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)); | |
1552 | 1433 | return NIL_P(result) ? 0 : StringValuePtr(result); |
1553 | 1434 | } |
1554 | 1435 | |
1555 | 1436 | // 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){ | |
1557 | 1438 | VALUE obj=FXRbGetRubyObj(recv,false); |
1558 | 1439 | 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)); | |
1560 | 1441 | return NIL_P(result) ? 0 : StringValuePtr(result); |
1561 | 1442 | } |
1562 | 1443 | //---------------------------------------------------------------------- |
1563 | 1444 | |
1564 | 1445 | // Call functions with FXwchar return value |
1565 | FXwchar FXRbCallWCharMethod(const FXObject* recv, ID func){ | |
1446 | FXwchar FXRbCallWCharMethod_gvlcb(const FXObject* recv, const char *func){ | |
1566 | 1447 | VALUE obj=FXRbGetRubyObj(recv,false); |
1567 | 1448 | FXASSERT(!NIL_P(obj)); |
1568 | VALUE result=rb_funcall(obj,func,0,NULL); | |
1449 | VALUE result=rb_funcall(obj,rb_intern(func),0); | |
1569 | 1450 | 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)); \ | |
1570 | 1463 | } |
1571 | 1464 | |
1572 | 1465 | //---------------------------------------------------------------------- |
1584 | 1477 | } |
1585 | 1478 | } |
1586 | 1479 | } |
1587 | acckey=(FXHotKey)NULL; | |
1480 | acckey=(FXHotKey)0; | |
1588 | 1481 | FXRbUnregisterRubyObj(this); |
1589 | 1482 | } |
1590 | 1483 | |
1600 | 1493 | } |
1601 | 1494 | } |
1602 | 1495 | } |
1603 | acckey=(FXHotKey)NULL; | |
1496 | acckey=(FXHotKey)0; | |
1604 | 1497 | FXRbUnregisterRubyObj(this); |
1605 | 1498 | } |
1606 | 1499 | |
1616 | 1509 | } |
1617 | 1510 | } |
1618 | 1511 | } |
1619 | acckey=(FXHotKey)NULL; | |
1512 | acckey=(FXHotKey)0; | |
1620 | 1513 | FXRbUnregisterRubyObj(this); |
1621 | 1514 | } |
1622 | 1515 | |
1683 | 1576 | |
1684 | 1577 | static ID id_cmp; |
1685 | 1578 | |
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 | |
1739 | 1598 | |
1740 | 1599 | // Feedback buffer sort routine stand-in for FXGLViewer |
1741 | 1600 | FXbool FXRbGLViewer::sortProc(FXfloat*& buffer,FXint& used,FXint& size){ |
1742 | 1601 | return TRUE; |
1743 | 1602 | } |
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 | } | |
1744 | 1686 | |
1745 | 1687 | //---------------------------------------------------------------------- |
1746 | 1688 | |
1944 | 1886 | FXASSERT(st_lookup(appSensitiveDCs,reinterpret_cast<st_data_t>(dc),reinterpret_cast<st_data_t *>(0))==0); |
1945 | 1887 | } |
1946 | 1888 | |
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){ | |
1948 | 1890 | FXASSERT(key!=0); |
1949 | 1891 | FXASSERT(arg!=0); |
1950 | 1892 | FXObjectListOf<FXObject> *pObjectList=reinterpret_cast<FXObjectListOf<FXObject>*>(arg); |
1953 | 1895 | return 0; |
1954 | 1896 | } |
1955 | 1897 | |
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){ | |
1957 | 1899 | FXASSERT(key!=0); |
1958 | 1900 | FXASSERT(arg!=0); |
1959 | 1901 | FXArray<FXDC*> *pDCArray=reinterpret_cast<FXArray<FXDC*>*>(arg); |
1966 | 1908 | FXTRACE((100,"%s:%d: Begin destroying objects that hold references to the FXApp...\n",__FILE__,__LINE__)); |
1967 | 1909 | |
1968 | 1910 | 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)); | |
1970 | 1912 | for(FXint i=0;i<objs.no();i++){ |
1971 | 1913 | if(objs[i]->isMemberOf(FXMETACLASS(FXRbCursor))){ |
1972 | 1914 | if(dynamic_cast<FXRbCursor*>(objs[i])->ownedByApp) |
1996 | 1938 | } |
1997 | 1939 | |
1998 | 1940 | 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)); | |
2000 | 1942 | for(FXint j=0;j<dcs.no();j++){ |
2001 | 1943 | delete dcs[j]; |
2002 | 1944 | } |
2065 | 2007 | utf8_enc_idx = rb_enc_find_index("UTF-8"); |
2066 | 2008 | #endif |
2067 | 2009 | |
2068 | FXRuby_Objects=st_init_numtable(); | |
2069 | 2010 | appSensitiveObjs=st_init_numtable(); |
2070 | 2011 | appSensitiveDCs=st_init_numtable(); |
2071 | 2012 | } |
2 | 2 | require 'fileutils' |
3 | 3 | require 'mkmf' |
4 | 4 | |
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' | |
32 | 7 | |
33 | 8 | $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 | |
60 | 9 | |
61 | 10 | def is_fxscintilla_build? |
62 | 11 | # No means no |
63 | 12 | return false if fxscintilla_support_suppressed? |
64 | 13 | |
65 | 14 | # Check arguments |
66 | args = ARGV.delete_if { |e| !(e =~ /--with-fxscintilla/) } | |
67 | (args.length > 0) || $autodetected_fxscintilla | |
15 | with_config("fxscintilla", false) || $autodetected_fxscintilla | |
68 | 16 | end |
69 | 17 | |
70 | 18 | 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' | |
91 | 27 | LIBPNG_SOURCE_URI = "http://prdownloads.sourceforge.net/libpng/libpng-#{LIBPNG_VERSION}.tar.gz" |
92 | 28 | |
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' | |
97 | 36 | LIBTIFF_SOURCE_URI = "http://download.osgeo.org/libtiff/tiff-#{LIBTIFF_VERSION}.tar.gz" |
98 | 37 | |
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" | |
101 | 40 | |
102 | 41 | LIBFXSCINTILLA_VERSION = ENV['LIBFXSCINTILLA_VERSION'] || '2.28.0' |
103 | 42 | 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 | |
104 | 120 | |
105 | 121 | def do_rake_compiler_setup |
106 | 122 | if enable_config("win32-cross") |
107 | require 'mini_portile' | |
108 | ||
109 | 123 | dir_config("installed") |
110 | 124 | |
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| | |
117 | 126 | class << recipe |
118 | 127 | def configure |
119 | 128 | Dir.chdir work_path do |
143 | 152 | end |
144 | 153 | end |
145 | 154 | |
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 += [ | |
227 | 177 | "--without-xft", |
228 | 178 | "--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| | |
263 | 187 | class << recipe |
264 | 188 | attr_accessor :libfox_path |
265 | 189 | def mk |
266 | 190 | "#{ENV['MAKE'] || "make"}" |
267 | 191 | 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 | |
268 | 198 | |
269 | 199 | def compile |
270 | 200 | execute "compile_lexers", "cd lexers && #{mk}" |
279 | 209 | end |
280 | 210 | recipe.libfox_path = libfox_recipe.path |
281 | 211 | |
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", | |
308 | 214 | ] |
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") | |
312 | 220 | |
313 | 221 | 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] |
314 | 222 | gcc_shared_dlls.each do |dll| |
315 | cmd = "#{CONFIG['CC']} -print-file-name=#{dll}" | |
223 | cmd = "#{CONFIG['CC']} -print-file-name=\"#{dll}\"" | |
316 | 224 | res = `#{cmd}`.chomp |
317 | 225 | next if dll == res |
318 | 226 | 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 | |
323 | 231 | CONFIG['CC'] += "\nCXX=#{CONFIG['CXX']}" # Hack CXX into Makefile for cross compilation |
324 | 232 | CONFIG['LDSHARED'].gsub!('gcc', 'g++') # ensure C++ linker is used, so that libstdc++ is linked static |
325 | 233 | $LDFLAGS += " -s" # remove symbol table informations from shared lib |
234 | $libs = append_library($libs, "fxscintilla") | |
326 | 235 | |
327 | 236 | elsif RUBY_PLATFORM =~ /mingw/ |
328 | 237 | $CFLAGS = $CFLAGS + " -I/usr/local/include" |
349 | 258 | find_library("GLU", "gluNewQuadric", "/usr/X11R6/lib") |
350 | 259 | $libs = append_library($libs, "Xrandr") unless RUBY_PLATFORM =~ /mingw/ || enable_config("win32-static-build") |
351 | 260 | $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')) | |
353 | 261 | $libs = append_library($libs, "FOX-1.6") |
262 | $INCFLAGS << " -I#{File.join(File.dirname(__FILE__), 'include')}" | |
354 | 263 | if is_fxscintilla_build? |
355 | FileUtils.move('scintilla_wrap.cpp.bak', 'scintilla_wrap.cpp') if FileTest.exist?('scintilla_wrap.cpp.bak') | |
356 | 264 | $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') | |
361 | 282 | end |
362 | 283 | |
363 | 284 | # This directive processes the "--with-fox-include" and "--with-fox-lib" |
371 | 292 | |
372 | 293 | dir_config('fxscintilla', '/usr/local/include/fxscintilla', '/usr/local/lib') |
373 | 294 | |
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" | |
383 | 329 | end |
384 | 330 | |
385 | 331 | # Platform-specific modifications |
386 | 332 | do_rake_compiler_setup |
387 | 333 | |
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 | |
391 | 338 | |
392 | 339 | # Last step: build the makefile |
340 | create_header | |
393 | 341 | 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 ); |
651 | 651 | IMPLEMENT_FXTOPWINDOW_STUBS(FXRbMessageBox) |
652 | 652 | IMPLEMENT_FXDIALOGBOX_STUBS(FXRbMessageBox) |
653 | 653 | |
654 | /* Start stub implementations for class FXRbObjRegistry */ | |
655 | ||
654 | 656 | /* Start stub implementations for class FXRbObject */ |
655 | 657 | IMPLEMENT_FXOBJECT_STUBS(FXRbObject) |
656 | 658 | |
1023 | 1025 | IMPLEMENT_FXDRAWABLE_STUBS(FXRbText) |
1024 | 1026 | IMPLEMENT_FXWINDOW_STUBS(FXRbText) |
1025 | 1027 | IMPLEMENT_FXSCROLLAREA_STUBS(FXRbText) |
1026 | IMPLEMENT_FXTEXT_STUBS(FXRbText) | |
1028 | IMPLEMENT_FXTEXT_STUBS(FXRbText,FXText) | |
1027 | 1029 | |
1028 | 1030 | /* Start stub implementations for class FXRbTextField */ |
1029 | 1031 | IMPLEMENT_FXOBJECT_STUBS(FXRbTextField) |
37 | 37 | inline void cls ## _create(cls *self){ \ |
38 | 38 | self->cls::create(); \ |
39 | 39 | } \ |
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 | } \ | |
40 | 67 | static void cls ## _init(cls* self,VALUE ary,bool connect){ \ |
41 | 68 | int i; \ |
42 | 69 | char **argv; \ |
45 | 72 | argv[0]=const_cast<char *>("foo"); \ |
46 | 73 | for(i=1;i<argc;i++){ \ |
47 | 74 | VALUE e=rb_ary_entry(ary,i-1); \ |
48 | argv[i]=StringValuePtr(e); \ | |
75 | argv[i]=StringValueCStr(e); \ | |
49 | 76 | } \ |
50 | 77 | argv[argc]=0; \ |
51 | 78 | self->cls::init(argc,argv,connect); \ |
60 | 87 | inline void cls ## _exit(cls *self,FXint code){ \ |
61 | 88 | self->cls::exit(code); \ |
62 | 89 | } |
63 | ||
64 | 90 | |
65 | 91 | /** |
66 | 92 | * For C/C++ applications, the argument count (argc) will always be at least |
82 | 108 | */ |
83 | 109 | #define IMPLEMENT_FXAPP_STUBS(cls) \ |
84 | 110 | void cls::create(){ \ |
85 | FXRbCallVoidMethod(this,rb_intern("create")); \ | |
111 | FXRbCallVoidMethod(this,"create"); \ | |
86 | 112 | } \ |
87 | 113 | void cls::detach(){ \ |
88 | FXRbCallVoidMethod(this,rb_intern("detach")); \ | |
114 | FXRbCallVoidMethod(this,"detach"); \ | |
89 | 115 | } \ |
90 | 116 | void cls::destroy(){ \ |
91 | FXRbCallVoidMethod(this,rb_intern("destroy")); \ | |
117 | FXRbCallVoidMethod(this,"destroy"); \ | |
92 | 118 | } \ |
93 | 119 | void cls::init(int& argc,char** argv,bool connect){ \ |
94 | 120 | int i; \ |
96 | 122 | for(i=1; i<argc; i++){ \ |
97 | 123 | rb_ary_push(ary,rb_str_new2(argv[i])); \ |
98 | 124 | } \ |
99 | FXRbCallVoidMethod(this,rb_intern("init"),ary,connect); \ | |
125 | FXRbCallVoidMethod(this,"init",ary,connect); \ | |
100 | 126 | argc=static_cast<int>(RARRAY_LEN(ary)+1); \ |
101 | 127 | for(i=1; i<argc; i++){ \ |
102 | 128 | VALUE e=rb_ary_entry(ary,i-1); \ |
103 | argv[i]=StringValuePtr(e); \ | |
129 | argv[i]=StringValueCStr(e); \ | |
104 | 130 | } \ |
105 | 131 | } \ |
106 | 132 | void cls::exit(FXint code){ \ |
107 | FXRbCallVoidMethod(this,rb_intern("exit"),code); \ | |
133 | FXRbCallVoidMethod(this,"exit",code); \ | |
108 | 134 | } |
109 | 135 | |
110 | 136 | |
113 | 139 | protected: |
114 | 140 | FXbool m_bThreadsEnabled; |
115 | 141 | FXuint sleepTime; |
142 | public: | |
143 | #ifdef WIN32 | |
144 | static WSAEVENT interrupt_event; | |
145 | #else | |
146 | static int interrupt_fds[2]; | |
147 | #endif | |
116 | 148 | protected: |
117 | 149 | FXRbApp(){} |
118 | 150 | public: |
125 | 157 | }; |
126 | 158 | public: |
127 | 159 | long onChoreThreads(FXObject*,FXSelector,void*); |
160 | long onChoreThreads_gvlcb(FXObject*,FXSelector,void*); | |
128 | 161 | public: |
129 | 162 | // Constructor |
130 | 163 | FXRbApp(const FXchar* name,const FXchar* vendor); |
151 | 184 | virtual ~FXRbApp(); |
152 | 185 | }; |
153 | 186 | |
187 | long FXRbApp_onChoreThreads_gvlcb(FXRbApp*,FXObject*,FXSelector,void*); | |
188 | ||
154 | 189 | #endif |
67 | 67 | |
68 | 68 | #define IMPLEMENT_FXBITMAP_STUBS(cls) \ |
69 | 69 | void cls::restore(){ \ |
70 | FXRbCallVoidMethod(this,rb_intern("restore")); \ | |
70 | FXRbCallVoidMethod(this,"restore"); \ | |
71 | 71 | } \ |
72 | 72 | void cls::render(){ \ |
73 | FXRbCallVoidMethod(this,rb_intern("render")); \ | |
73 | FXRbCallVoidMethod(this,"render"); \ | |
74 | 74 | } \ |
75 | 75 | void cls::release(){ \ |
76 | FXRbCallVoidMethod(this,rb_intern("release")); \ | |
76 | FXRbCallVoidMethod(this,"release"); \ | |
77 | 77 | } \ |
78 | 78 | bool cls::savePixels(FXStream& store) const { \ |
79 | return FXRbCallBoolMethod(this,rb_intern("savePixels"),store); \ | |
79 | return FXRbCallBoolMethod(this,"savePixels",store); \ | |
80 | 80 | } \ |
81 | 81 | bool cls::loadPixels(FXStream& store){ \ |
82 | return FXRbCallBoolMethod(this,rb_intern("loadPixels"),store); \ | |
82 | return FXRbCallBoolMethod(this,"loadPixels",store); \ | |
83 | 83 | } \ |
84 | 84 | void cls::scale(FXint w,FXint h){ \ |
85 | FXRbCallVoidMethod(this,rb_intern("scale"),w,h); \ | |
85 | FXRbCallVoidMethod(this,"scale",w,h); \ | |
86 | 86 | } \ |
87 | 87 | void cls::mirror(FXbool horizontal,FXbool vertical){ \ |
88 | FXRbCallVoidMethod(this,rb_intern("mirror"),horizontal,vertical); \ | |
88 | FXRbCallVoidMethod(this,"mirror",horizontal,vertical); \ | |
89 | 89 | } \ |
90 | 90 | void cls::rotate(FXint degrees){ \ |
91 | FXRbCallVoidMethod(this,rb_intern("rotate"),degrees); \ | |
91 | FXRbCallVoidMethod(this,"rotate",degrees); \ | |
92 | 92 | } \ |
93 | 93 | 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); \ | |
95 | 95 | } \ |
96 | 96 | void cls::fill(FXbool color){ \ |
97 | FXRbCallVoidMethod(this,rb_intern("fill"),color); \ | |
97 | FXRbCallVoidMethod(this,"fill",color); \ | |
98 | 98 | } \ |
99 | 99 | void cls::setData(FXuchar* pix,FXuint opts){ \ |
100 | FXRbCallVoidMethod(this,rb_intern("setData"),pix,opts); \ | |
100 | FXRbCallVoidMethod(this,"setData",pix,opts); \ | |
101 | 101 | } \ |
102 | 102 | 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); \ | |
104 | 104 | } |
105 | 105 | |
106 | 106 |
23 | 23 | * $Id: FXRbCommon.h 2303 2005-12-09 03:17:28Z lyle $ |
24 | 24 | ***********************************************************************/ |
25 | 25 | |
26 | extern "C" { | |
27 | 26 | #include "ruby.h" |
27 | ||
28 | #include "extconf.h" | |
28 | 29 | |
29 | 30 | #ifdef HAVE_RUBY_ENCODING_H |
30 | 31 | #include "ruby/encoding.h" |
31 | 32 | #endif |
32 | } | |
33 | 33 | |
34 | 34 | /** |
35 | 35 | * The Ruby header files for Win32 redefine the symbol "select", which |
96 | 96 | #include "FXScintilla.h" |
97 | 97 | #endif |
98 | 98 | #include "FXRuby.h" |
99 | #include "gvl_wrappers.h" |
37 | 37 | |
38 | 38 | #define IMPLEMENT_FXCURSOR_STUBS(cls) \ |
39 | 39 | bool cls::savePixels(FXStream& store) const { \ |
40 | return FXRbCallBoolMethod(this,rb_intern("savePixels"),store); \ | |
40 | return FXRbCallBoolMethod(this,"savePixels",store); \ | |
41 | 41 | } \ |
42 | 42 | bool cls::loadPixels(FXStream& store){ \ |
43 | return FXRbCallBoolMethod(this,rb_intern("loadPixels"),store); \ | |
43 | return FXRbCallBoolMethod(this,"loadPixels",store); \ | |
44 | 44 | } |
45 | 45 | |
46 | 46 | class FXRbCursor : public FXCursor { |
217 | 217 | |
218 | 218 | #define IMPLEMENT_FXDC_STUBS(cls) \ |
219 | 219 | FXColor cls::readPixel(FXint x,FXint y){ \ |
220 | return FXRbCallColorMethod(this,rb_intern("readPixel"),x,y); \ | |
220 | return FXRbCallColorMethod(this,"readPixel",x,y); \ | |
221 | 221 | } \ |
222 | 222 | void cls::drawPoint(FXint x,FXint y){ \ |
223 | FXRbCallVoidMethod(this,rb_intern("drawPoint"),x,y); \ | |
223 | FXRbCallVoidMethod(this,"drawPoint",x,y); \ | |
224 | 224 | } \ |
225 | 225 | 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); \ | |
227 | 227 | } \ |
228 | 228 | 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); \ | |
230 | 230 | } \ |
231 | 231 | 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); \ | |
233 | 233 | } \ |
234 | 234 | 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); \ | |
236 | 236 | } \ |
237 | 237 | 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); \ | |
239 | 239 | } \ |
240 | 240 | 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); \ | |
242 | 242 | } \ |
243 | 243 | 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); \ | |
245 | 245 | } \ |
246 | 246 | 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); \ | |
248 | 248 | } \ |
249 | 249 | 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); \ | |
251 | 251 | } \ |
252 | 252 | 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); \ | |
254 | 254 | } \ |
255 | 255 | 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); \ | |
257 | 257 | } \ |
258 | 258 | 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); \ | |
260 | 260 | } \ |
261 | 261 | 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); \ | |
263 | 263 | } \ |
264 | 264 | 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); \ | |
266 | 266 | } \ |
267 | 267 | 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); \ | |
269 | 269 | } \ |
270 | 270 | 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); \ | |
272 | 272 | } \ |
273 | 273 | 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); \ | |
275 | 275 | } \ |
276 | 276 | 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); \ | |
278 | 278 | } \ |
279 | 279 | 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); \ | |
281 | 281 | } \ |
282 | 282 | 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); \ | |
284 | 284 | } \ |
285 | 285 | 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); \ | |
287 | 287 | } \ |
288 | 288 | 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); \ | |
290 | 290 | } \ |
291 | 291 | 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); \ | |
293 | 293 | } \ |
294 | 294 | 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); \ | |
296 | 296 | } \ |
297 | 297 | 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); \ | |
299 | 299 | } \ |
300 | 300 | 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); \ | |
302 | 302 | } \ |
303 | 303 | 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); \ | |
305 | 305 | } \ |
306 | 306 | 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); \ | |
308 | 308 | } \ |
309 | 309 | 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); \ | |
311 | 311 | } \ |
312 | 312 | 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); \ | |
314 | 314 | } \ |
315 | 315 | 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); \ | |
317 | 317 | } \ |
318 | 318 | 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); \ | |
320 | 320 | } \ |
321 | 321 | 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); \ | |
323 | 323 | } \ |
324 | 324 | 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); \ | |
326 | 326 | } \ |
327 | 327 | 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); \ | |
329 | 329 | } \ |
330 | 330 | 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); \ | |
332 | 332 | } \ |
333 | 333 | 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); \ | |
335 | 335 | } \ |
336 | 336 | 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); \ | |
338 | 338 | } \ |
339 | 339 | 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); \ | |
341 | 341 | } \ |
342 | 342 | void cls::setForeground(FXColor clr){ \ |
343 | FXRbCallVoidMethod(this,rb_intern("setForeground"),clr); \ | |
343 | FXRbCallVoidMethod(this,"setForeground",clr); \ | |
344 | 344 | } \ |
345 | 345 | void cls::setBackground(FXColor clr){ \ |
346 | FXRbCallVoidMethod(this,rb_intern("setBackground"),clr); \ | |
346 | FXRbCallVoidMethod(this,"setBackground",clr); \ | |
347 | 347 | } \ |
348 | 348 | 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); \ | |
350 | 350 | } \ |
351 | 351 | void cls::setLineWidth(FXuint linewidth){ \ |
352 | FXRbCallVoidMethod(this,rb_intern("setLineWidth"),linewidth); \ | |
352 | FXRbCallVoidMethod(this,"setLineWidth",linewidth); \ | |
353 | 353 | } \ |
354 | 354 | void cls::setLineCap(FXCapStyle capstyle){ \ |
355 | FXRbCallVoidMethod(this,rb_intern("setLineCap"),capstyle); \ | |
355 | FXRbCallVoidMethod(this,"setLineCap",capstyle); \ | |
356 | 356 | } \ |
357 | 357 | void cls::setLineJoin(FXJoinStyle joinstyle){ \ |
358 | FXRbCallVoidMethod(this,rb_intern("setLineJoin"),joinstyle); \ | |
358 | FXRbCallVoidMethod(this,"setLineJoin",joinstyle); \ | |
359 | 359 | } \ |
360 | 360 | void cls::setLineStyle(FXLineStyle linestyle){ \ |
361 | FXRbCallVoidMethod(this,rb_intern("setLineStyle"),linestyle); \ | |
361 | FXRbCallVoidMethod(this,"setLineStyle",linestyle); \ | |
362 | 362 | } \ |
363 | 363 | void cls::setFillStyle(FXFillStyle fillstyle){ \ |
364 | FXRbCallVoidMethod(this,rb_intern("setFillStyle"),fillstyle); \ | |
364 | FXRbCallVoidMethod(this,"setFillStyle",fillstyle); \ | |
365 | 365 | } \ |
366 | 366 | void cls::setFillRule(FXFillRule fillrule){ \ |
367 | FXRbCallVoidMethod(this,rb_intern("setFillRule"),fillrule); \ | |
367 | FXRbCallVoidMethod(this,"setFillRule",fillrule); \ | |
368 | 368 | } \ |
369 | 369 | void cls::setFunction(FXFunction func){ \ |
370 | FXRbCallVoidMethod(this,rb_intern("setFunction"),func); \ | |
370 | FXRbCallVoidMethod(this,"setFunction",func); \ | |
371 | 371 | } \ |
372 | 372 | 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); \ | |
374 | 374 | } \ |
375 | 375 | 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); \ | |
377 | 377 | } \ |
378 | 378 | 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); \ | |
380 | 380 | } \ |
381 | 381 | void cls::setClipRegion(const FXRegion& region){ \ |
382 | FXRbCallVoidMethod(this,rb_intern("setClipRegion"),region); \ | |
382 | FXRbCallVoidMethod(this,"setClipRegion",region); \ | |
383 | 383 | } \ |
384 | 384 | 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); \ | |
386 | 386 | } \ |
387 | 387 | void cls::setClipRectangle(const FXRectangle& rectangle){ \ |
388 | FXRbCallVoidMethod(this,rb_intern("setClipRectangle"),rectangle); \ | |
388 | FXRbCallVoidMethod(this,"setClipRectangle",rectangle); \ | |
389 | 389 | } \ |
390 | 390 | void cls::clearClipRectangle(){ \ |
391 | FXRbCallVoidMethod(this,rb_intern("clearClipRectangle")); \ | |
391 | FXRbCallVoidMethod(this,"clearClipRectangle"); \ | |
392 | 392 | } \ |
393 | 393 | 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); \ | |
395 | 395 | } \ |
396 | 396 | void cls::clearClipMask(){ \ |
397 | FXRbCallVoidMethod(this,rb_intern("clearClipMask")); \ | |
397 | FXRbCallVoidMethod(this,"clearClipMask"); \ | |
398 | 398 | } \ |
399 | 399 | void cls::setFont(FXFont *fnt){ \ |
400 | FXRbCallVoidMethod(this,rb_intern("setFont"),fnt); \ | |
400 | FXRbCallVoidMethod(this,"setFont",fnt); \ | |
401 | 401 | } \ |
402 | 402 | void cls::clipChildren(FXbool yes){ \ |
403 | FXRbCallVoidMethod(this,rb_intern("clipChildren"),yes); \ | |
403 | FXRbCallVoidMethod(this,"clipChildren",yes); \ | |
404 | 404 | } |
405 | 405 | |
406 | 406 |
27 | 27 | #define FXRBDIALOGBOX_H |
28 | 28 | |
29 | 29 | #define DECLARE_FXDIALOGBOX_STUBS(klass) \ |
30 | inline FXuint klass ## _execute(klass* self,FXuint placement){ \ | |
30 | inline FXuint klass ## _execute_gvl(klass* self,FXuint placement){ \ | |
31 | 31 | return self->klass::execute(placement); \ |
32 | 32 | } |
33 | 33 | |
34 | 34 | |
35 | 35 | #define IMPLEMENT_FXDIALOGBOX_STUBS(cls) \ |
36 | 36 | FXuint cls::execute(FXuint placement){ \ |
37 | return FXRbCallUIntMethod(this,rb_intern("execute"),placement); \ | |
37 | return FXRbCallUIntMethod(this,"execute",placement); \ | |
38 | 38 | } |
39 | 39 | |
40 | 40 |
39 | 39 | |
40 | 40 | #define IMPLEMENT_FXDOCKBAR_STUBS(cls) \ |
41 | 41 | 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); \ | |
43 | 43 | } \ |
44 | 44 | 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); \ | |
46 | 46 | } \ |
47 | 47 | 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); \ | |
49 | 49 | } |
50 | 50 | |
51 | 51 |
42 | 42 | |
43 | 43 | #define IMPLEMENT_FXDOCKSITE_STUBS(cls) \ |
44 | 44 | 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); \ | |
46 | 46 | } \ |
47 | 47 | void cls::dockToolBar(FXDockBar* bar,FXWindow* before){ \ |
48 | FXRbCallVoidMethod(this,rb_intern("dockToolBar"),bar,before); \ | |
48 | FXRbCallVoidMethod(this,"dockToolBar",bar,before); \ | |
49 | 49 | } \ |
50 | 50 | 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); \ | |
52 | 52 | } \ |
53 | 53 | void cls::undockToolBar(FXDockBar* bar){ \ |
54 | FXRbCallVoidMethod(this,rb_intern("undockToolBar"),bar); \ | |
54 | FXRbCallVoidMethod(this,"undockToolBar",bar); \ | |
55 | 55 | } |
56 | 56 | |
57 | 57 |
34 | 34 | |
35 | 35 | #define IMPLEMENT_FXDRAWABLE_STUBS(cls) \ |
36 | 36 | void cls::resize(FXint w,FXint h){ \ |
37 | FXRbCallVoidMethod(this,rb_intern("resize"),w,h); \ | |
37 | FXRbCallVoidMethod(this, "resize", w, h); \ | |
38 | 38 | } |
39 | 39 | |
40 | 40 |
60 | 60 | |
61 | 61 | #define IMPLEMENT_FXFILEDICT_STUBS(cls) \ |
62 | 62 | FXFileAssoc* cls::findFileBinding(const FXchar* pathname){ \ |
63 | return FXRbCallFileAssocMethod(this,rb_intern("findFileBinding"),pathname); \ | |
63 | return FXRbCallFileAssocMethod(this,"findFileBinding",pathname); \ | |
64 | 64 | } \ |
65 | 65 | FXFileAssoc* cls::findDirBinding(const FXchar* pathname){ \ |
66 | return FXRbCallFileAssocMethod(this,rb_intern("findDirBinding"),pathname); \ | |
66 | return FXRbCallFileAssocMethod(this,"findDirBinding",pathname); \ | |
67 | 67 | } \ |
68 | 68 | FXFileAssoc* cls::findExecBinding(const FXchar* pathname){ \ |
69 | return FXRbCallFileAssocMethod(this,rb_intern("findExecBinding"),pathname); \ | |
69 | return FXRbCallFileAssocMethod(this,"findExecBinding",pathname); \ | |
70 | 70 | } |
71 | 71 | |
72 | 72 |
73 | 73 | |
74 | 74 | #define IMPLEMENT_FXFOLDINGITEM_STUBS(cls) \ |
75 | 75 | void cls::setText(const FXString& txt){ \ |
76 | FXRbCallVoidMethod(this,rb_intern("setText"),txt); \ | |
76 | FXRbCallVoidMethod(this,"setText",txt); \ | |
77 | 77 | } \ |
78 | 78 | void cls::setOpenIcon(FXIcon* icn,FXbool owned){ \ |
79 | FXRbCallVoidMethod(this,rb_intern("setOpenIcon"),icn,owned); \ | |
79 | FXRbCallVoidMethod(this,"setOpenIcon",icn,owned); \ | |
80 | 80 | } \ |
81 | 81 | void cls::setClosedIcon(FXIcon* icn,FXbool owned){ \ |
82 | FXRbCallVoidMethod(this,rb_intern("setClosedIcon"),icn,owned); \ | |
82 | FXRbCallVoidMethod(this,"setClosedIcon",icn,owned); \ | |
83 | 83 | } \ |
84 | 84 | void cls::setFocus(FXbool focus){ \ |
85 | FXRbCallVoidMethod(this,rb_intern("setFocus"),focus); \ | |
85 | FXRbCallVoidMethod(this,"setFocus",focus); \ | |
86 | 86 | } \ |
87 | 87 | void cls::setSelected(FXbool selected){ \ |
88 | FXRbCallVoidMethod(this,rb_intern("setSelected"),selected); \ | |
88 | FXRbCallVoidMethod(this,"setSelected",selected); \ | |
89 | 89 | } \ |
90 | 90 | void cls::setOpened(FXbool opened){ \ |
91 | FXRbCallVoidMethod(this,rb_intern("setOpened"),opened); \ | |
91 | FXRbCallVoidMethod(this,"setOpened",opened); \ | |
92 | 92 | } \ |
93 | 93 | void cls::setExpanded(FXbool expanded){ \ |
94 | FXRbCallVoidMethod(this,rb_intern("setExpanded"),expanded); \ | |
94 | FXRbCallVoidMethod(this,"setExpanded",expanded); \ | |
95 | 95 | } \ |
96 | 96 | void cls::setEnabled(FXbool enabled){ \ |
97 | FXRbCallVoidMethod(this,rb_intern("setEnabled"),enabled); \ | |
97 | FXRbCallVoidMethod(this,"setEnabled",enabled); \ | |
98 | 98 | } \ |
99 | 99 | void cls::setDraggable(FXbool draggable){ \ |
100 | FXRbCallVoidMethod(this,rb_intern("setDraggable"),draggable); \ | |
100 | FXRbCallVoidMethod(this,"setDraggable",draggable); \ | |
101 | 101 | } \ |
102 | 102 | FXint cls::getWidth(const FXFoldingList* list) const { \ |
103 | return FXRbCallIntMethod(this,rb_intern("getWidth"),list); \ | |
103 | return FXRbCallIntMethod(this,"getWidth",list); \ | |
104 | 104 | } \ |
105 | 105 | FXint cls::getHeight(const FXFoldingList* list) const { \ |
106 | return FXRbCallIntMethod(this,rb_intern("getHeight"),list); \ | |
106 | return FXRbCallIntMethod(this,"getHeight",list); \ | |
107 | 107 | } \ |
108 | 108 | void cls::create(){ \ |
109 | FXRbCallVoidMethod(this,rb_intern("create")); \ | |
109 | FXRbCallVoidMethod(this,"create"); \ | |
110 | 110 | } \ |
111 | 111 | void cls::detach(){ \ |
112 | FXRbCallVoidMethod(this,rb_intern("detach")); \ | |
112 | FXRbCallVoidMethod(this,"detach"); \ | |
113 | 113 | } \ |
114 | 114 | void cls::destroy(){ \ |
115 | FXRbCallVoidMethod(this,rb_intern("destroy")); \ | |
115 | FXRbCallVoidMethod(this,"destroy"); \ | |
116 | 116 | } |
117 | 117 | |
118 | 118 | |
188 | 188 | |
189 | 189 | #define IMPLEMENT_FXFOLDINGLIST_STUBS(cls) \ |
190 | 190 | FXFoldingItem * cls::getItemAt(FXint x,FXint y) const { \ |
191 | return FXRbCallFoldingItemMethod(this,rb_intern("getItemAt"),x,y); \ | |
191 | return FXRbCallFoldingItemMethod(this,"getItemAt",x,y); \ | |
192 | 192 | } \ |
193 | 193 | void cls::makeItemVisible(FXFoldingItem *item) { \ |
194 | FXRbCallVoidMethod(this,rb_intern("makeItemVisible"),item); \ | |
194 | FXRbCallVoidMethod(this,"makeItemVisible",item); \ | |
195 | 195 | } \ |
196 | 196 | FXbool cls::enableItem(FXFoldingItem *item) { \ |
197 | return FXRbCallBoolMethod(this,rb_intern("enableItem"),item); \ | |
197 | return FXRbCallBoolMethod(this,"enableItem",item); \ | |
198 | 198 | } \ |
199 | 199 | FXbool cls::disableItem(FXFoldingItem *item) { \ |
200 | return FXRbCallBoolMethod(this,rb_intern("disableItem"),item); \ | |
200 | return FXRbCallBoolMethod(this,"disableItem",item); \ | |
201 | 201 | } \ |
202 | 202 | FXbool cls::selectItem(FXFoldingItem *item,FXbool notify) { \ |
203 | return FXRbCallBoolMethod(this,rb_intern("selectItem"),item,notify); \ | |
203 | return FXRbCallBoolMethod(this,"selectItem",item,notify); \ | |
204 | 204 | } \ |
205 | 205 | FXbool cls::deselectItem(FXFoldingItem *item,FXbool notify) { \ |
206 | return FXRbCallBoolMethod(this,rb_intern("deselectItem"),item,notify); \ | |
206 | return FXRbCallBoolMethod(this,"deselectItem",item,notify); \ | |
207 | 207 | } \ |
208 | 208 | FXbool cls::toggleItem(FXFoldingItem *item,FXbool notify) { \ |
209 | return FXRbCallBoolMethod(this,rb_intern("toggleItem"),item,notify); \ | |
209 | return FXRbCallBoolMethod(this,"toggleItem",item,notify); \ | |
210 | 210 | } \ |
211 | 211 | FXbool cls::extendSelection(FXFoldingItem *item,FXbool notify) { \ |
212 | return FXRbCallBoolMethod(this,rb_intern("extendSelection"),item,notify); \ | |
212 | return FXRbCallBoolMethod(this,"extendSelection",item,notify); \ | |
213 | 213 | } \ |
214 | 214 | FXbool cls::killSelection(FXbool notify) { \ |
215 | return FXRbCallBoolMethod(this,rb_intern("killSelection"),notify); \ | |
215 | return FXRbCallBoolMethod(this,"killSelection",notify); \ | |
216 | 216 | } \ |
217 | 217 | FXbool cls::openItem(FXFoldingItem *item,FXbool notify) { \ |
218 | return FXRbCallBoolMethod(this,rb_intern("openItem"),item,notify); \ | |
218 | return FXRbCallBoolMethod(this,"openItem",item,notify); \ | |
219 | 219 | } \ |
220 | 220 | FXbool cls::closeItem(FXFoldingItem *item,FXbool notify) { \ |
221 | return FXRbCallBoolMethod(this,rb_intern("closeItem"),item,notify); \ | |
221 | return FXRbCallBoolMethod(this,"closeItem",item,notify); \ | |
222 | 222 | } \ |
223 | 223 | FXbool cls::collapseTree(FXFoldingItem *item,FXbool notify) { \ |
224 | return FXRbCallBoolMethod(this,rb_intern("collapseTree"),item,notify); \ | |
224 | return FXRbCallBoolMethod(this,"collapseTree",item,notify); \ | |
225 | 225 | } \ |
226 | 226 | FXbool cls::expandTree(FXFoldingItem *item,FXbool notify) { \ |
227 | return FXRbCallBoolMethod(this,rb_intern("expandTree"),item,notify); \ | |
227 | return FXRbCallBoolMethod(this,"expandTree",item,notify); \ | |
228 | 228 | } \ |
229 | 229 | void cls::setCurrentItem(FXFoldingItem *item,FXbool notify) { \ |
230 | FXRbCallVoidMethod(this,rb_intern("setCurrentItem"),item,notify); \ | |
230 | FXRbCallVoidMethod(this,"setCurrentItem",item,notify); \ | |
231 | 231 | } |
232 | 232 | |
233 | 233 | class FXRbFoldingList : public FXFoldingList { |
84 | 84 | |
85 | 85 | #define IMPLEMENT_FXFONT_STUBS(cls) \ |
86 | 86 | void cls::setFontDesc(const FXFontDesc& desc) { \ |
87 | FXRbCallVoidMethod(this,rb_intern("setFontDesc"),desc); \ | |
87 | FXRbCallVoidMethod(this,"setFontDesc",desc); \ | |
88 | 88 | } \ |
89 | 89 | void cls::setAngle(FXint ang) { \ |
90 | FXRbCallVoidMethod(this,rb_intern("setAngle"),ang); \ | |
90 | FXRbCallVoidMethod(this,"setAngle",ang); \ | |
91 | 91 | } \ |
92 | 92 | void cls::setFont(const FXString& string) { \ |
93 | FXRbCallVoidMethod(this,rb_intern("setFont"),string); \ | |
93 | FXRbCallVoidMethod(this,"setFont",string); \ | |
94 | 94 | } \ |
95 | 95 | FXbool cls::isFontMono() const { \ |
96 | return FXRbCallBoolMethod(this,rb_intern("isFontMono")); \ | |
96 | return FXRbCallBoolMethod(this,"isFontMono"); \ | |
97 | 97 | } \ |
98 | 98 | FXbool cls::hasChar(FXwchar ch) const { \ |
99 | return FXRbCallBoolMethod(this,rb_intern("hasChar"),ch); \ | |
99 | return FXRbCallBoolMethod(this,"hasChar",ch); \ | |
100 | 100 | } \ |
101 | 101 | FXwchar cls::getMinChar() const { \ |
102 | return FXRbCallWCharMethod(this,rb_intern("getMinChar")); \ | |
102 | return FXRbCallWCharMethod(this,"getMinChar"); \ | |
103 | 103 | } \ |
104 | 104 | FXwchar cls::getMaxChar() const { \ |
105 | return FXRbCallWCharMethod(this,rb_intern("getMaxChar")); \ | |
105 | return FXRbCallWCharMethod(this,"getMaxChar"); \ | |
106 | 106 | } \ |
107 | 107 | FXint cls::leftBearing(FXwchar ch) const { \ |
108 | return FXRbCallIntMethod(this,rb_intern("leftBearing"),ch); \ | |
108 | return FXRbCallIntMethod(this,"leftBearing",ch); \ | |
109 | 109 | } \ |
110 | 110 | FXint cls::rightBearing(FXwchar ch) const { \ |
111 | return FXRbCallIntMethod(this,rb_intern("rightBearing"),ch); \ | |
111 | return FXRbCallIntMethod(this,"rightBearing",ch); \ | |
112 | 112 | } \ |
113 | 113 | FXint cls::getFontWidth() const { \ |
114 | return FXRbCallIntMethod(this,rb_intern("getFontWidth")); \ | |
114 | return FXRbCallIntMethod(this,"getFontWidth"); \ | |
115 | 115 | } \ |
116 | 116 | FXint cls::getFontHeight() const { \ |
117 | return FXRbCallIntMethod(this,rb_intern("getFontHeight")); \ | |
117 | return FXRbCallIntMethod(this,"getFontHeight"); \ | |
118 | 118 | } \ |
119 | 119 | FXint cls::getFontAscent() const { \ |
120 | return FXRbCallIntMethod(this,rb_intern("getFontAscent")); \ | |
120 | return FXRbCallIntMethod(this,"getFontAscent"); \ | |
121 | 121 | } \ |
122 | 122 | FXint cls::getFontDescent() const { \ |
123 | return FXRbCallIntMethod(this,rb_intern("getFontDescent")); \ | |
123 | return FXRbCallIntMethod(this,"getFontDescent"); \ | |
124 | 124 | } \ |
125 | 125 | FXint cls::getFontLeading() const { \ |
126 | return FXRbCallIntMethod(this,rb_intern("getFontLeading")); \ | |
126 | return FXRbCallIntMethod(this,"getFontLeading"); \ | |
127 | 127 | } \ |
128 | 128 | FXint cls::getFontSpacing() const { \ |
129 | return FXRbCallIntMethod(this,rb_intern("getFontSpacing")); \ | |
129 | return FXRbCallIntMethod(this,"getFontSpacing"); \ | |
130 | 130 | } \ |
131 | 131 | FXint cls::getCharWidth(FXwchar ch) const { \ |
132 | return FXRbCallIntMethod(this,rb_intern("getCharWidth"),ch); \ | |
132 | return FXRbCallIntMethod(this,"getCharWidth",ch); \ | |
133 | 133 | } \ |
134 | 134 | FXint cls::getTextWidth(const FXString& str) const { \ |
135 | return FXRbCallIntMethod(this,rb_intern("getTextWidth"),str); \ | |
135 | return FXRbCallIntMethod(this,"getTextWidth",str); \ | |
136 | 136 | } \ |
137 | 137 | FXint cls::getTextHeight(const FXString& str) const { \ |
138 | return FXRbCallIntMethod(this,rb_intern("getTextHeight"),str); \ | |
138 | return FXRbCallIntMethod(this,"getTextHeight",str); \ | |
139 | 139 | } |
140 | 140 | |
141 | 141 | class FXRbFont : public FXFont { |
43 | 43 | |
44 | 44 | #define IMPLEMENT_FXGLCANVAS_STUBS(cls) \ |
45 | 45 | FXbool cls::makeCurrent(){ \ |
46 | return FXRbCallBoolMethod(this,rb_intern("makeCurrent")); \ | |
46 | return FXRbCallBoolMethod(this,"makeCurrent"); \ | |
47 | 47 | } \ |
48 | 48 | FXbool cls::makeNonCurrent(){ \ |
49 | return FXRbCallBoolMethod(this,rb_intern("makeNonCurrent")); \ | |
49 | return FXRbCallBoolMethod(this,"makeNonCurrent"); \ | |
50 | 50 | } \ |
51 | 51 | FXbool cls::isCurrent() const { \ |
52 | return FXRbCallBoolMethod(this,rb_intern("isCurrent")); \ | |
52 | return FXRbCallBoolMethod(this,"isCurrent"); \ | |
53 | 53 | } \ |
54 | 54 | void cls::swapBuffers(){ \ |
55 | FXRbCallVoidMethod(this,rb_intern("swapBuffers")); \ | |
55 | FXRbCallVoidMethod(this,"swapBuffers"); \ | |
56 | 56 | } |
57 | 57 | |
58 | 58 |
54 | 54 | |
55 | 55 | #define IMPLEMENT_FXGLOBJECT_STUBS(cls) \ |
56 | 56 | void cls::bounds(FXRangef& box){ \ |
57 | box=FXRbCallRangeMethod(this,rb_intern("bounds")); \ | |
57 | box=FXRbCallRangeMethod(this,"bounds"); \ | |
58 | 58 | } \ |
59 | 59 | void cls::draw(FXGLViewer* viewer){ \ |
60 | FXRbCallVoidMethod(this,rb_intern("draw"),viewer); \ | |
60 | FXRbCallVoidMethod(this,"draw",viewer); \ | |
61 | 61 | } \ |
62 | 62 | void cls::hit(FXGLViewer* viewer){ \ |
63 | FXRbCallVoidMethod(this,rb_intern("hit"),viewer); \ | |
63 | FXRbCallVoidMethod(this,"hit",viewer); \ | |
64 | 64 | } \ |
65 | 65 | FXGLObject* cls::copy(){ \ |
66 | return FXRbCallGLObjectMethod(this,rb_intern("copy")); \ | |
66 | return FXRbCallGLObjectMethod(this,"copy"); \ | |
67 | 67 | } \ |
68 | 68 | FXGLObject* cls::identify(FXuint* path,FXint n){ \ |
69 | return FXRbCallGLObjectMethod(this,rb_intern("identify"),path,n); \ | |
69 | return FXRbCallGLObjectMethod(this,"identify",path,n); \ | |
70 | 70 | } \ |
71 | 71 | FXbool cls::canDrag() const { \ |
72 | return FXRbCallBoolMethod(this,rb_intern("canDrag")); \ | |
72 | return FXRbCallBoolMethod(this,"canDrag"); \ | |
73 | 73 | } \ |
74 | 74 | FXbool cls::canDelete() const{ \ |
75 | return FXRbCallBoolMethod(this,rb_intern("canDelete")); \ | |
75 | return FXRbCallBoolMethod(this,"canDelete"); \ | |
76 | 76 | } \ |
77 | 77 | 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); \ | |
79 | 79 | } |
80 | 80 | |
81 | 81 |
34 | 34 | |
35 | 35 | #define IMPLEMENT_FXGLSHAPE_STUBS(klass,superklass) \ |
36 | 36 | void klass::drawshape(FXGLViewer* viewer){ \ |
37 | FXRbCallVoidMethod(this,rb_intern("drawshape"),viewer); \ | |
37 | FXRbCallVoidMethod(this,"drawshape",viewer); \ | |
38 | 38 | } \ |
39 | 39 | void klass::_drawshape(FXGLViewer* viewer){ \ |
40 | 40 | superklass::drawshape(viewer); \ |
41 | 41 | |
42 | 42 | #define IMPLEMENT_FXGLVIEWER_STUBS(cls) \ |
43 | 43 | 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); \ | |
45 | 45 | } \ |
46 | 46 | FXGLObject* cls::pick(FXint x,FXint y){ \ |
47 | return FXRbCallGLObjectMethod(this,rb_intern("pick"),x,y); \ | |
47 | return FXRbCallGLObjectMethod(this,"pick",x,y); \ | |
48 | 48 | } \ |
49 | 49 | FXbool cls::setBounds(const FXRangef& box){ \ |
50 | return FXRbCallBoolMethod(this,rb_intern("setBounds"),box); \ | |
50 | return FXRbCallBoolMethod(this,"setBounds",box); \ | |
51 | 51 | } |
52 | 52 | |
53 | 53 |
52 | 52 | |
53 | 53 | #define IMPLEMENT_FXHEADERITEM_STUBS(cls) \ |
54 | 54 | void cls::setText(const FXString& text){ \ |
55 | FXRbCallVoidMethod(this,rb_intern("setText"),text); \ | |
55 | FXRbCallVoidMethod(this,"setText",text); \ | |
56 | 56 | } \ |
57 | 57 | void cls::setIcon(FXIcon* icn){ \ |
58 | FXRbCallVoidMethod(this,rb_intern("setIcon"),icn); \ | |
58 | FXRbCallVoidMethod(this,"setIcon",icn); \ | |
59 | 59 | } \ |
60 | 60 | FXint cls::getWidth(const FXHeader* header) const { \ |
61 | return FXRbCallIntMethod(this,rb_intern("getWidth"),header); \ | |
61 | return FXRbCallIntMethod(this,"getWidth",header); \ | |
62 | 62 | } \ |
63 | 63 | FXint cls::getHeight(const FXHeader* header) const { \ |
64 | return FXRbCallIntMethod(this,rb_intern("getHeight"),header); \ | |
64 | return FXRbCallIntMethod(this,"getHeight",header); \ | |
65 | 65 | } \ |
66 | 66 | void cls::create(){ \ |
67 | FXRbCallVoidMethod(this,rb_intern("create")); \ | |
67 | FXRbCallVoidMethod(this,"create"); \ | |
68 | 68 | } \ |
69 | 69 | void cls::detach(){ \ |
70 | FXRbCallVoidMethod(this,rb_intern("detach")); \ | |
70 | FXRbCallVoidMethod(this,"detach"); \ | |
71 | 71 | } \ |
72 | 72 | void cls::destroy(){ \ |
73 | FXRbCallVoidMethod(this,rb_intern("destroy")); \ | |
73 | FXRbCallVoidMethod(this,"destroy"); \ | |
74 | 74 | } |
75 | 75 | |
76 | 76 |
87 | 87 | |
88 | 88 | #define IMPLEMENT_FXICONITEM_STUBS(klass,superklass) \ |
89 | 89 | 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); \ | |
91 | 91 | } \ |
92 | 92 | void klass::public_draw(const FXIconList* list,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const { \ |
93 | 93 | superklass::draw(list,dc,x,y,w,h); \ |
94 | 94 | } \ |
95 | 95 | 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); \ | |
97 | 97 | } \ |
98 | 98 | FXint klass::public_hitItem(const FXIconList* list,FXint rx,FXint ry,FXint rw,FXint rh) const { \ |
99 | 99 | return superklass::hitItem(list,rx,ry,rw,rh); \ |
100 | 100 | } \ |
101 | 101 | 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); \ | |
103 | 103 | } \ |
104 | 104 | void klass::public_drawBigIcon(const FXIconList* list,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const { \ |
105 | 105 | superklass::drawBigIcon(list,dc,x,y,w,h); \ |
106 | 106 | } \ |
107 | 107 | 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); \ | |
109 | 109 | } \ |
110 | 110 | void klass::public_drawMiniIcon(const FXIconList* list,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const { \ |
111 | 111 | superklass::drawMiniIcon(list,dc,x,y,w,h); \ |
112 | 112 | } \ |
113 | 113 | 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); \ | |
115 | 115 | } \ |
116 | 116 | void klass::public_drawDetails(const FXIconList* list,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const { \ |
117 | 117 | superklass::drawDetails(list,dc,x,y,w,h); \ |
118 | 118 | } \ |
119 | 119 | void klass::setText(const FXString& txt){ \ |
120 | FXRbCallVoidMethod(this,rb_intern("setText"),txt); \ | |
120 | FXRbCallVoidMethod(this,"setText",txt); \ | |
121 | 121 | } \ |
122 | 122 | void klass::setBigIcon(FXIcon* icn,FXbool owned){ \ |
123 | FXRbCallVoidMethod(this,rb_intern("setBigIcon"),icn,owned); \ | |
123 | FXRbCallVoidMethod(this,"setBigIcon",icn,owned); \ | |
124 | 124 | } \ |
125 | 125 | void klass::setMiniIcon(FXIcon* icn,FXbool owned){ \ |
126 | FXRbCallVoidMethod(this,rb_intern("setMiniIcon"),icn,owned); \ | |
126 | FXRbCallVoidMethod(this,"setMiniIcon",icn,owned); \ | |
127 | 127 | } \ |
128 | 128 | void klass::setFocus(FXbool focus){ \ |
129 | FXRbCallVoidMethod(this,rb_intern("setFocus"),focus); \ | |
129 | FXRbCallVoidMethod(this,"setFocus",focus); \ | |
130 | 130 | } \ |
131 | 131 | void klass::setSelected(FXbool selected){ \ |
132 | FXRbCallVoidMethod(this,rb_intern("setSelected"),selected); \ | |
132 | FXRbCallVoidMethod(this,"setSelected",selected); \ | |
133 | 133 | } \ |
134 | 134 | void klass::setEnabled(FXbool enabled){ \ |
135 | FXRbCallVoidMethod(this,rb_intern("setEnabled"),enabled); \ | |
135 | FXRbCallVoidMethod(this,"setEnabled",enabled); \ | |
136 | 136 | } \ |
137 | 137 | void klass::setDraggable(FXbool draggable){ \ |
138 | FXRbCallVoidMethod(this,rb_intern("setDraggable"),draggable); \ | |
138 | FXRbCallVoidMethod(this,"setDraggable",draggable); \ | |
139 | 139 | } \ |
140 | 140 | FXint klass::getWidth(const FXIconList* list) const { \ |
141 | return FXRbCallIntMethod(this,rb_intern("getWidth"),list); \ | |
141 | return FXRbCallIntMethod(this,"getWidth",list); \ | |
142 | 142 | } \ |
143 | 143 | FXint klass::getHeight(const FXIconList* list) const { \ |
144 | return FXRbCallIntMethod(this,rb_intern("getHeight"),list); \ | |
144 | return FXRbCallIntMethod(this,"getHeight",list); \ | |
145 | 145 | } \ |
146 | 146 | void klass::create(){ \ |
147 | FXRbCallVoidMethod(this,rb_intern("create")); \ | |
147 | FXRbCallVoidMethod(this,"create"); \ | |
148 | 148 | } \ |
149 | 149 | void klass::detach(){ \ |
150 | FXRbCallVoidMethod(this,rb_intern("detach")); \ | |
150 | FXRbCallVoidMethod(this,"detach"); \ | |
151 | 151 | } \ |
152 | 152 | void klass::destroy(){ \ |
153 | FXRbCallVoidMethod(this,rb_intern("destroy")); \ | |
153 | FXRbCallVoidMethod(this,"destroy"); \ | |
154 | 154 | } |
155 | 155 | |
156 | 156 | |
218 | 218 | |
219 | 219 | #define IMPLEMENT_FXICONLIST_STUBS(cls) \ |
220 | 220 | FXbool cls::selectItem(FXint index,FXbool notify){ \ |
221 | return FXRbCallBoolMethod(this,rb_intern("selectItem"),index,notify); \ | |
221 | return FXRbCallBoolMethod(this,"selectItem",index,notify); \ | |
222 | 222 | } \ |
223 | 223 | FXbool cls::deselectItem(FXint index,FXbool notify){ \ |
224 | return FXRbCallBoolMethod(this,rb_intern("deselectItem"),index,notify); \ | |
224 | return FXRbCallBoolMethod(this,"deselectItem",index,notify); \ | |
225 | 225 | } \ |
226 | 226 | FXbool cls::toggleItem(FXint index,FXbool notify){ \ |
227 | return FXRbCallBoolMethod(this,rb_intern("toggleItem"),index,notify); \ | |
227 | return FXRbCallBoolMethod(this,"toggleItem",index,notify); \ | |
228 | 228 | } \ |
229 | 229 | 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); \ | |
231 | 231 | } \ |
232 | 232 | FXbool cls::extendSelection(FXint index,FXbool notify){ \ |
233 | return FXRbCallBoolMethod(this,rb_intern("extendSelection"),index,notify); \ | |
233 | return FXRbCallBoolMethod(this,"extendSelection",index,notify); \ | |
234 | 234 | } \ |
235 | 235 | FXbool cls::killSelection(FXbool notify){ \ |
236 | return FXRbCallBoolMethod(this,rb_intern("killSelection"),notify); \ | |
236 | return FXRbCallBoolMethod(this,"killSelection",notify); \ | |
237 | 237 | } \ |
238 | 238 | void cls::setCurrentItem(FXint index,FXbool notify){ \ |
239 | FXRbCallVoidMethod(this,rb_intern("setCurrentItem"),index,notify); \ | |
239 | FXRbCallVoidMethod(this,"setCurrentItem",index,notify); \ | |
240 | 240 | } \ |
241 | 241 | FXint cls::getItemAt(FXint x,FXint y) const { \ |
242 | return FXRbCallIntMethod(this,rb_intern("getItemAt"),x,y); \ | |
242 | return FXRbCallIntMethod(this,"getItemAt",x,y); \ | |
243 | 243 | } \ |
244 | 244 | void cls::makeItemVisible(FXint index){ \ |
245 | FXRbCallVoidMethod(this,rb_intern("makeItemVisible"),index); \ | |
245 | FXRbCallVoidMethod(this,"makeItemVisible",index); \ | |
246 | 246 | } \ |
247 | 247 | FXbool cls::enableItem(FXint index){ \ |
248 | return FXRbCallBoolMethod(this,rb_intern("enableItem"),index); \ | |
248 | return FXRbCallBoolMethod(this,"enableItem",index); \ | |
249 | 249 | } \ |
250 | 250 | FXbool cls::disableItem(FXint index){ \ |
251 | return FXRbCallBoolMethod(this,rb_intern("disableItem"),index); \ | |
251 | return FXRbCallBoolMethod(this,"disableItem",index); \ | |
252 | 252 | } |
253 | 253 | |
254 | 254 |
67 | 67 | |
68 | 68 | #define IMPLEMENT_FXICONSOURCE_STUBS(cls) \ |
69 | 69 | 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); \ | |
71 | 71 | } \ |
72 | 72 | 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); \ | |
74 | 74 | } \ |
75 | 75 | 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); \ | |
77 | 77 | } \ |
78 | 78 | 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); \ | |
80 | 80 | } \ |
81 | 81 | 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); \ | |
83 | 83 | } \ |
84 | 84 | 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); \ | |
86 | 86 | } \ |
87 | 87 | 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); \ | |
89 | 89 | } \ |
90 | 90 | 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); \ | |
92 | 92 | } \ |
93 | 93 | 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); \ | |
95 | 95 | } \ |
96 | 96 | 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); \ | |
98 | 98 | } \ |
99 | 99 | 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); \ | |
101 | 101 | } \ |
102 | 102 | 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); \ | |
104 | 104 | } |
105 | 105 | |
106 | 106 |
40 | 40 | |
41 | 41 | #define IMPLEMENT_FXID_STUBS(cls) \ |
42 | 42 | void cls::create(){ \ |
43 | FXRbCallVoidMethod(this,rb_intern("create")); \ | |
43 | FXRbCallVoidMethod(this,"create"); \ | |
44 | 44 | } \ |
45 | 45 | void cls::detach(){ \ |
46 | FXRbCallVoidMethod(this,rb_intern("detach")); \ | |
46 | FXRbCallVoidMethod(this,"detach"); \ | |
47 | 47 | } \ |
48 | 48 | void cls::destroy(){ \ |
49 | FXRbCallVoidMethod(this,rb_intern("destroy")); \ | |
49 | FXRbCallVoidMethod(this,"destroy"); \ | |
50 | 50 | } |
51 | 51 | |
52 | 52 |
72 | 72 | inline void klass ## _blend(klass* self,FXColor color){ \ |
73 | 73 | self->klass::blend(color); \ |
74 | 74 | } \ |
75 | inline bool klass ## _savePixels(const klass* self,FXStream& store){ \ | |
75 | inline bool klass ## _savePixels_gvl(const klass* self,FXStream& store){ \ | |
76 | 76 | return self->klass::savePixels(store); \ |
77 | 77 | } \ |
78 | inline bool klass ## _loadPixels(klass* self,FXStream& store){ \ | |
78 | inline bool klass ## _loadPixels_gvl(klass* self,FXStream& store){ \ | |
79 | 79 | return self->klass::loadPixels(store); \ |
80 | 80 | } |
81 | 81 | |
82 | 82 | |
83 | 83 | #define IMPLEMENT_FXIMAGE_STUBS(cls) \ |
84 | 84 | void cls::restore(){ \ |
85 | FXRbCallVoidMethod(this,rb_intern("restore")); \ | |
85 | FXRbCallVoidMethod(this,"restore"); \ | |
86 | 86 | } \ |
87 | 87 | void cls::render(){ \ |
88 | FXRbCallVoidMethod(this,rb_intern("render")); \ | |
88 | FXRbCallVoidMethod(this,"render"); \ | |
89 | 89 | } \ |
90 | 90 | void cls::release(){ \ |
91 | FXRbCallVoidMethod(this,rb_intern("release")); \ | |
91 | FXRbCallVoidMethod(this,"release"); \ | |
92 | 92 | } \ |
93 | 93 | 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); \ | |
95 | 95 | } \ |
96 | 96 | void cls::mirror(bool horizontal,bool vertical){ \ |
97 | FXRbCallVoidMethod(this,rb_intern("mirror"),horizontal,vertical); \ | |
97 | FXRbCallVoidMethod(this,"mirror",horizontal,vertical); \ | |
98 | 98 | } \ |
99 | 99 | void cls::rotate(FXint degrees){ \ |
100 | FXRbCallVoidMethod(this,rb_intern("rotate"),degrees); \ | |
100 | FXRbCallVoidMethod(this,"rotate",degrees); \ | |
101 | 101 | } \ |
102 | 102 | 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); \ | |
104 | 104 | } \ |
105 | 105 | void cls::fill(FXColor color){ \ |
106 | FXRbCallVoidMethod(this,rb_intern("fill"),color); \ | |
106 | FXRbCallVoidMethod(this,"fill",color); \ | |
107 | 107 | } \ |
108 | 108 | void cls::fade(FXColor color,FXint factor){ \ |
109 | FXRbCallVoidMethod(this,rb_intern("fade"),color,factor); \ | |
109 | FXRbCallVoidMethod(this,"fade",color,factor); \ | |
110 | 110 | } \ |
111 | 111 | void cls::xshear(FXint shear,FXColor clr){ \ |
112 | FXRbCallVoidMethod(this,rb_intern("xshear"),shear,clr); \ | |
112 | FXRbCallVoidMethod(this,"xshear",shear,clr); \ | |
113 | 113 | } \ |
114 | 114 | void cls::yshear(FXint shear,FXColor clr){ \ |
115 | FXRbCallVoidMethod(this,rb_intern("yshear"),shear,clr); \ | |
115 | FXRbCallVoidMethod(this,"yshear",shear,clr); \ | |
116 | 116 | } \ |
117 | 117 | void cls::hgradient(FXColor left,FXColor right){ \ |
118 | FXRbCallVoidMethod(this,rb_intern("hgradient"),left,right); \ | |
118 | FXRbCallVoidMethod(this,"hgradient",left,right); \ | |
119 | 119 | } \ |
120 | 120 | void cls::vgradient(FXColor top,FXColor bottom){ \ |
121 | FXRbCallVoidMethod(this,rb_intern("vgradient"),top,bottom); \ | |
121 | FXRbCallVoidMethod(this,"vgradient",top,bottom); \ | |
122 | 122 | } \ |
123 | 123 | 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); \ | |
125 | 125 | } \ |
126 | 126 | void cls::blend(FXColor color){ \ |
127 | FXRbCallVoidMethod(this,rb_intern("blend"),color); \ | |
127 | FXRbCallVoidMethod(this,"blend",color); \ | |
128 | 128 | } \ |
129 | 129 | bool cls::savePixels(FXStream& store) const { \ |
130 | return FXRbCallBoolMethod(this,rb_intern("savePixels"),store); \ | |
130 | return FXRbCallBoolMethod(this,"savePixels",store); \ | |
131 | 131 | } \ |
132 | 132 | bool cls::loadPixels(FXStream& store){ \ |
133 | return FXRbCallBoolMethod(this,rb_intern("loadPixels"),store); \ | |
133 | return FXRbCallBoolMethod(this,"loadPixels",store); \ | |
134 | 134 | } |
135 | 135 | |
136 | 136 |
64 | 64 | |
65 | 65 | #define IMPLEMENT_FXLISTITEM_STUBS(cls) \ |
66 | 66 | void cls::create(){ \ |
67 | FXRbCallVoidMethod(this,rb_intern("create")); \ | |
67 | FXRbCallVoidMethod(this,"create"); \ | |
68 | 68 | } \ |
69 | 69 | void cls::detach(){ \ |
70 | FXRbCallVoidMethod(this,rb_intern("detach")); \ | |
70 | FXRbCallVoidMethod(this,"detach"); \ | |
71 | 71 | } \ |
72 | 72 | void cls::destroy(){ \ |
73 | FXRbCallVoidMethod(this,rb_intern("destroy")); \ | |
73 | FXRbCallVoidMethod(this,"destroy"); \ | |
74 | 74 | } \ |
75 | 75 | void cls::setText(const FXString& txt){ \ |
76 | FXRbCallVoidMethod(this,rb_intern("setText"),txt); \ | |
76 | FXRbCallVoidMethod(this,"setText",txt); \ | |
77 | 77 | } \ |
78 | 78 | void cls::setIcon(FXIcon* icn,FXbool owned){ \ |
79 | FXRbCallVoidMethod(this,rb_intern("setIcon"),icn,owned); \ | |
79 | FXRbCallVoidMethod(this,"setIcon",icn,owned); \ | |
80 | 80 | } \ |
81 | 81 | void cls::setFocus(FXbool focus){ \ |
82 | FXRbCallVoidMethod(this,rb_intern("setFocus"),focus); \ | |
82 | FXRbCallVoidMethod(this,"setFocus",focus); \ | |
83 | 83 | } \ |
84 | 84 | void cls::setSelected(FXbool selected){ \ |
85 | FXRbCallVoidMethod(this,rb_intern("setSelected"),selected); \ | |
85 | FXRbCallVoidMethod(this,"setSelected",selected); \ | |
86 | 86 | } \ |
87 | 87 | void cls::setEnabled(FXbool enabled){ \ |
88 | FXRbCallVoidMethod(this,rb_intern("setEnabled"),enabled); \ | |
88 | FXRbCallVoidMethod(this,"setEnabled",enabled); \ | |
89 | 89 | } \ |
90 | 90 | void cls::setDraggable(FXbool draggable){ \ |
91 | FXRbCallVoidMethod(this,rb_intern("setDraggable"),draggable); \ | |
91 | FXRbCallVoidMethod(this,"setDraggable",draggable); \ | |
92 | 92 | } \ |
93 | 93 | FXint cls::getWidth(const FXList* list) const { \ |
94 | return FXRbCallIntMethod(this,rb_intern("getWidth"),list); \ | |
94 | return FXRbCallIntMethod(this,"getWidth",list); \ | |
95 | 95 | } \ |
96 | 96 | FXint cls::getHeight(const FXList* list) const { \ |
97 | return FXRbCallIntMethod(this,rb_intern("getHeight"),list); \ | |
97 | return FXRbCallIntMethod(this,"getHeight",list); \ | |
98 | 98 | } |
99 | 99 | |
100 | 100 | |
159 | 159 | |
160 | 160 | #define IMPLEMENT_FXLIST_STUBS(cls) \ |
161 | 161 | FXbool cls::enableItem(FXint index){ \ |
162 | return FXRbCallBoolMethod(this,rb_intern("enableItem"),index); \ | |
162 | return FXRbCallBoolMethod(this,"enableItem",index); \ | |
163 | 163 | } \ |
164 | 164 | FXbool cls::disableItem(FXint index){ \ |
165 | return FXRbCallBoolMethod(this,rb_intern("disableItem"),index); \ | |
165 | return FXRbCallBoolMethod(this,"disableItem",index); \ | |
166 | 166 | } \ |
167 | 167 | void cls::makeItemVisible(FXint index) { \ |
168 | FXRbCallVoidMethod(this,rb_intern("makeItemVisible"),index); \ | |
168 | FXRbCallVoidMethod(this,"makeItemVisible",index); \ | |
169 | 169 | } \ |
170 | 170 | FXint cls::getItemAt(FXint x,FXint y) const { \ |
171 | return FXRbCallIntMethod(this,rb_intern("getItemAt"),x,y); \ | |
171 | return FXRbCallIntMethod(this,"getItemAt",x,y); \ | |
172 | 172 | } \ |
173 | 173 | FXbool cls::selectItem(FXint index,FXbool notify){ \ |
174 | return FXRbCallBoolMethod(this,rb_intern("selectItem"),index,notify); \ | |
174 | return FXRbCallBoolMethod(this,"selectItem",index,notify); \ | |
175 | 175 | } \ |
176 | 176 | FXbool cls::deselectItem(FXint index,FXbool notify){ \ |
177 | return FXRbCallBoolMethod(this,rb_intern("deselectItem"),index,notify); \ | |
177 | return FXRbCallBoolMethod(this,"deselectItem",index,notify); \ | |
178 | 178 | } \ |
179 | 179 | FXbool cls::toggleItem(FXint index,FXbool notify){ \ |
180 | return FXRbCallBoolMethod(this,rb_intern("toggleItem"),index,notify); \ | |
180 | return FXRbCallBoolMethod(this,"toggleItem",index,notify); \ | |
181 | 181 | } \ |
182 | 182 | FXbool cls::extendSelection(FXint index,FXbool notify){ \ |
183 | return FXRbCallBoolMethod(this,rb_intern("extendSelection"),index,notify); \ | |
183 | return FXRbCallBoolMethod(this,"extendSelection",index,notify); \ | |
184 | 184 | } \ |
185 | 185 | FXbool cls::killSelection(FXbool notify){ \ |
186 | return FXRbCallBoolMethod(this,rb_intern("killSelection"),notify); \ | |
186 | return FXRbCallBoolMethod(this,"killSelection",notify); \ | |
187 | 187 | } \ |
188 | 188 | void cls::setCurrentItem(FXint index,FXbool notify){ \ |
189 | FXRbCallVoidMethod(this,rb_intern("setCurrentItem"),index,notify); \ | |
189 | FXRbCallVoidMethod(this,"setCurrentItem",index,notify); \ | |
190 | 190 | } |
191 | 191 | |
192 | 192 |
33 | 33 | |
34 | 34 | #define IMPLEMENT_FXLISTBOX_STUBS(cls) \ |
35 | 35 | void cls::setCurrentItem(FXint index,FXbool notify){ \ |
36 | FXRbCallVoidMethod(this,rb_intern("setCurrentItem"),index,notify); \ | |
36 | FXRbCallVoidMethod(this,"setCurrentItem",index,notify); \ | |
37 | 37 | } |
38 | 38 | |
39 | 39 | class FXRbListBox : public FXListBox { |
43 | 43 | |
44 | 44 | #define IMPLEMENT_FXMDICHILD_STUBS(cls) \ |
45 | 45 | FXbool cls::minimize(FXbool notify){ \ |
46 | return FXRbCallBoolMethod(this,rb_intern("minimize"),notify); \ | |
46 | return FXRbCallBoolMethod(this,"minimize",notify); \ | |
47 | 47 | } \ |
48 | 48 | FXbool cls::maximize(FXbool notify){ \ |
49 | return FXRbCallBoolMethod(this,rb_intern("maximize"),notify); \ | |
49 | return FXRbCallBoolMethod(this,"maximize",notify); \ | |
50 | 50 | } \ |
51 | 51 | FXbool cls::restore(FXbool notify){ \ |
52 | return FXRbCallBoolMethod(this,rb_intern("restore"),notify); \ | |
52 | return FXRbCallBoolMethod(this,"restore",notify); \ | |
53 | 53 | } \ |
54 | 54 | FXbool cls::close(FXbool notify){ \ |
55 | return FXRbCallBoolMethod(this,rb_intern("close"),notify); \ | |
55 | return FXRbCallBoolMethod(this,"close",notify); \ | |
56 | 56 | } |
57 | 57 | |
58 | 58 |
42 | 42 | |
43 | 43 | #define IMPLEMENT_FXMDICLIENT_STUBS(cls) \ |
44 | 44 | FXbool cls::setActiveChild(FXMDIChild* child,FXbool notify){ \ |
45 | return FXRbCallBoolMethod(this,rb_intern("setActiveChild"),child,notify); \ | |
45 | return FXRbCallBoolMethod(this,"setActiveChild",child,notify); \ | |
46 | 46 | } \ |
47 | 47 | void cls::cascade(FXbool notify){ \ |
48 | FXRbCallVoidMethod(this,rb_intern("cascade"),notify); \ | |
48 | FXRbCallVoidMethod(this,"cascade",notify); \ | |
49 | 49 | } \ |
50 | 50 | void cls::horizontal(FXbool notify){ \ |
51 | FXRbCallVoidMethod(this,rb_intern("horizontal"),notify); \ | |
51 | FXRbCallVoidMethod(this,"horizontal",notify); \ | |
52 | 52 | } \ |
53 | 53 | void cls::vertical(FXbool notify){ \ |
54 | FXRbCallVoidMethod(this,rb_intern("vertical"),notify); \ | |
54 | FXRbCallVoidMethod(this,"vertical",notify); \ | |
55 | 55 | } |
56 | 56 | |
57 | 57 | 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 |
37 | 37 | |
38 | 38 | #define IMPLEMENT_FXOBJECT_STUBS(cls) \ |
39 | 39 | void cls::save(FXStream& store) const { \ |
40 | FXRbCallVoidMethod(this,rb_intern("save"),store); \ | |
40 | FXRbCallVoidMethod(this,"save",store); \ | |
41 | 41 | } \ |
42 | 42 | void cls::load(FXStream& store){ \ |
43 | FXRbCallVoidMethod(this,rb_intern("load"),store); \ | |
43 | FXRbCallVoidMethod(this,"load",store); \ | |
44 | 44 | } |
45 | 45 | |
46 | 46 |
37 | 37 | |
38 | 38 | #define IMPLEMENT_FXPOPUP_STUBS(cls) \ |
39 | 39 | 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); \ | |
41 | 41 | } \ |
42 | 42 | void cls::popdown(){ \ |
43 | FXRbCallVoidMethod(this,rb_intern("popdown")); \ | |
43 | FXRbCallVoidMethod(this,"popdown"); \ | |
44 | 44 | } |
45 | 45 | |
46 | 46 |
34 | 34 | |
35 | 35 | #define IMPLEMENT_FXREALSPINNER_STUBS(cls) \ |
36 | 36 | void cls::setValue(FXdouble value,FXbool notify){ \ |
37 | FXRbCallVoidMethod(this,rb_intern("setValue"),value,notify); \ | |
37 | FXRbCallVoidMethod(this,"setValue",value,notify); \ | |
38 | 38 | } |
39 | 39 | |
40 | 40 |
43 | 43 | |
44 | 44 | #define IMPLEMENT_FXSCROLLAREA_STUBS(cls) \ |
45 | 45 | FXint cls::getContentWidth(){ \ |
46 | return FXRbCallIntMethod(this,rb_intern("getContentWidth")); \ | |
46 | return FXRbCallIntMethod(this,"getContentWidth"); \ | |
47 | 47 | } \ |
48 | 48 | FXint cls::getContentHeight(){ \ |
49 | return FXRbCallIntMethod(this,rb_intern("getContentHeight")); \ | |
49 | return FXRbCallIntMethod(this,"getContentHeight"); \ | |
50 | 50 | } \ |
51 | 51 | FXint cls::getViewportWidth(){ \ |
52 | return FXRbCallIntMethod(this,rb_intern("getViewportWidth")); \ | |
52 | return FXRbCallIntMethod(this,"getViewportWidth"); \ | |
53 | 53 | } \ |
54 | 54 | FXint cls::getViewportHeight(){ \ |
55 | return FXRbCallIntMethod(this,rb_intern("getViewportHeight")); \ | |
55 | return FXRbCallIntMethod(this,"getViewportHeight"); \ | |
56 | 56 | } |
57 | 57 | |
58 | 58 |
56 | 56 | |
57 | 57 | #define IMPLEMENT_FXSHUTTER_STUBS(cls) \ |
58 | 58 | void cls::setCurrent(FXint panel){ \ |
59 | FXRbCallVoidMethod(this,rb_intern("setCurrent"),panel); \ | |
59 | FXRbCallVoidMethod(this,"setCurrent",panel); \ | |
60 | 60 | } |
61 | 61 | |
62 | 62 |
34 | 34 | |
35 | 35 | #define IMPLEMENT_FXSPINNER_STUBS(cls) \ |
36 | 36 | void cls::setValue(FXint value,FXbool notify){ \ |
37 | FXRbCallVoidMethod(this,rb_intern("setValue"),value,notify); \ | |
37 | FXRbCallVoidMethod(this,"setValue",value,notify); \ | |
38 | 38 | } |
39 | 39 | |
40 | 40 |
40 | 40 | |
41 | 41 | #define IMPLEMENT_FXSTREAM_STUBS(cls) \ |
42 | 42 | bool cls::close(){ \ |
43 | return FXRbCallBoolMethod(this,rb_intern("close")); \ | |
43 | return FXRbCallBoolMethod(this,"close"); \ | |
44 | 44 | } \ |
45 | 45 | bool cls::flush(){ \ |
46 | return FXRbCallBoolMethod(this,rb_intern("flush")); \ | |
46 | return FXRbCallBoolMethod(this,"flush"); \ | |
47 | 47 | } \ |
48 | 48 | bool cls::position(FXlong p,FXWhence whence){ \ |
49 | return FXRbCallBoolMethod(this,rb_intern("setPosition"),p,whence); \ | |
49 | return FXRbCallBoolMethod(this,"setPosition",p,whence); \ | |
50 | 50 | } |
51 | 51 | |
52 | 52 |
34 | 34 | |
35 | 35 | #define IMPLEMENT_FXTABBAR_STUBS(cls) \ |
36 | 36 | void cls::setCurrent(FXint panel,FXbool notify){ \ |
37 | FXRbCallVoidMethod(this,rb_intern("setCurrent"),panel,notify); \ | |
37 | FXRbCallVoidMethod(this,"setCurrent",panel,notify); \ | |
38 | 38 | } |
39 | 39 | |
40 | 40 |
108 | 108 | |
109 | 109 | #define IMPLEMENT_FXTABLEITEM_STUBS(klass,superklass) \ |
110 | 110 | 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); \ | |
112 | 112 | } \ |
113 | 113 | void klass::public_draw(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const { \ |
114 | 114 | superklass::draw(table,dc,x,y,w,h); \ |
115 | 115 | } \ |
116 | 116 | 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); \ | |
118 | 118 | } \ |
119 | 119 | void klass::public_drawBorders(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const { \ |
120 | 120 | superklass::drawBorders(table,dc,x,y,w,h); \ |
121 | 121 | } \ |
122 | 122 | 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); \ | |
124 | 124 | } \ |
125 | 125 | void klass::public_drawContent(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const { \ |
126 | 126 | superklass::drawContent(table,dc,x,y,w,h); \ |
127 | 127 | } \ |
128 | 128 | 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); \ | |
130 | 130 | } \ |
131 | 131 | void klass::public_drawPattern(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const { \ |
132 | 132 | superklass::drawPattern(table,dc,x,y,w,h); \ |
133 | 133 | } \ |
134 | 134 | 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); \ | |
136 | 136 | } \ |
137 | 137 | void klass::public_drawBackground(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const { \ |
138 | 138 | superklass::drawBackground(table,dc,x,y,w,h); \ |
139 | 139 | } \ |
140 | 140 | void klass::setText(const FXString& txt){ \ |
141 | FXRbCallVoidMethod(this,rb_intern("setText"),txt); \ | |
141 | FXRbCallVoidMethod(this,"setText",txt); \ | |
142 | 142 | } \ |
143 | 143 | FXString klass::getText() const { \ |
144 | return FXRbCallStringMethod(this,rb_intern("getText")); \ | |
144 | return FXRbCallStringMethod(this,"getText"); \ | |
145 | 145 | } \ |
146 | 146 | void klass::setIcon(FXIcon* icn,FXbool owned){ \ |
147 | FXRbCallVoidMethod(this,rb_intern("setIcon"),icn,owned); \ | |
147 | FXRbCallVoidMethod(this,"setIcon",icn,owned); \ | |
148 | 148 | } \ |
149 | 149 | FXIcon* klass::getIcon() const { \ |
150 | return FXRbCallIconMethod(this,rb_intern("getIcon")); \ | |
150 | return FXRbCallIconMethod(this,"getIcon"); \ | |
151 | 151 | } \ |
152 | 152 | void klass::setFocus(FXbool focus){ \ |
153 | FXRbCallVoidMethod(this,rb_intern("setFocus"),focus); \ | |
153 | FXRbCallVoidMethod(this,"setFocus",focus); \ | |
154 | 154 | } \ |
155 | 155 | void klass::setSelected(FXbool selected){ \ |
156 | FXRbCallVoidMethod(this,rb_intern("setSelected"),selected); \ | |
156 | FXRbCallVoidMethod(this,"setSelected",selected); \ | |
157 | 157 | } \ |
158 | 158 | void klass::setEnabled(FXbool enabled){ \ |
159 | FXRbCallVoidMethod(this,rb_intern("setEnabled"),enabled); \ | |
159 | FXRbCallVoidMethod(this,"setEnabled",enabled); \ | |
160 | 160 | } \ |
161 | 161 | void klass::setDraggable(FXbool draggable){ \ |
162 | FXRbCallVoidMethod(this,rb_intern("setDraggable"),draggable); \ | |
162 | FXRbCallVoidMethod(this,"setDraggable",draggable); \ | |
163 | 163 | } \ |
164 | 164 | void klass::setJustify(FXuint justify){ \ |
165 | FXRbCallVoidMethod(this,rb_intern("setJustify"),justify); \ | |
165 | FXRbCallVoidMethod(this,"setJustify",justify); \ | |
166 | 166 | } \ |
167 | 167 | void klass::setIconPosition(FXuint mode){ \ |
168 | FXRbCallVoidMethod(this,rb_intern("setIconPosition"),mode); \ | |
168 | FXRbCallVoidMethod(this,"setIconPosition",mode); \ | |
169 | 169 | } \ |
170 | 170 | void klass::setBorders(FXuint borders){ \ |
171 | FXRbCallVoidMethod(this,rb_intern("setBorders"),borders); \ | |
171 | FXRbCallVoidMethod(this,"setBorders",borders); \ | |
172 | 172 | } \ |
173 | 173 | void klass::setStipple(FXStipplePattern pattern){ \ |
174 | FXRbCallVoidMethod(this,rb_intern("setStipple"),pattern); \ | |
174 | FXRbCallVoidMethod(this,"setStipple",pattern); \ | |
175 | 175 | } \ |
176 | 176 | FXWindow* klass::getControlFor(FXTable* table){ \ |
177 | return FXRbCallWindowMethod(this,rb_intern("getControlFor"),table); \ | |
177 | return FXRbCallWindowMethod(this,"getControlFor",table); \ | |
178 | 178 | } \ |
179 | 179 | void klass::setFromControl(FXWindow* control){ \ |
180 | FXRbCallVoidMethod(this,rb_intern("setFromControl"),control); \ | |
180 | FXRbCallVoidMethod(this,"setFromControl",control); \ | |
181 | 181 | } \ |
182 | 182 | FXint klass::getWidth(const FXTable* table) const { \ |
183 | return FXRbCallIntMethod(this,rb_intern("getWidth"),table); \ | |
183 | return FXRbCallIntMethod(this,"getWidth",table); \ | |
184 | 184 | } \ |
185 | 185 | FXint klass::getHeight(const FXTable* table) const { \ |
186 | return FXRbCallIntMethod(this,rb_intern("getHeight"),table); \ | |
186 | return FXRbCallIntMethod(this,"getHeight",table); \ | |
187 | 187 | } \ |
188 | 188 | void klass::create(){ \ |
189 | FXRbCallVoidMethod(this,rb_intern("create")); \ | |
189 | FXRbCallVoidMethod(this,"create"); \ | |
190 | 190 | } \ |
191 | 191 | void klass::detach(){ \ |
192 | FXRbCallVoidMethod(this,rb_intern("detach")); \ | |
192 | FXRbCallVoidMethod(this,"detach"); \ | |
193 | 193 | } \ |
194 | 194 | void klass::destroy(){ \ |
195 | FXRbCallVoidMethod(this,rb_intern("destroy")); \ | |
195 | FXRbCallVoidMethod(this,"destroy"); \ | |
196 | 196 | } |
197 | 197 | |
198 | 198 | |
370 | 370 | |
371 | 371 | #define IMPLEMENT_FXTABLE_STUBS(klass,superklass) \ |
372 | 372 | 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); \ | |
374 | 374 | } \ |
375 | 375 | void klass::public_drawCell(FXDC& dc,FXint sr,FXint er,FXint sc,FXint ec){ \ |
376 | 376 | superklass::drawCell(dc,sr,er,sc,ec); \ |
377 | 377 | } \ |
378 | 378 | 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); \ | |
380 | 380 | } \ |
381 | 381 | void klass::public_drawRange(FXDC& dc,FXint rlo,FXint rhi,FXint clo,FXint chi){ \ |
382 | 382 | superklass::drawRange(dc,rlo,rhi,clo,chi); \ |
383 | 383 | } \ |
384 | 384 | 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); \ | |
386 | 386 | } \ |
387 | 387 | void klass::public_drawHGrid(FXDC& dc,FXint rlo,FXint rhi,FXint clo,FXint chi){ \ |
388 | 388 | superklass::drawHGrid(dc,rlo,rhi,clo,chi); \ |
389 | 389 | } \ |
390 | 390 | 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); \ | |
392 | 392 | } \ |
393 | 393 | void klass::public_drawVGrid(FXDC& dc,FXint rlo,FXint rhi,FXint clo,FXint chi){ \ |
394 | 394 | superklass::drawVGrid(dc,rlo,rhi,clo,chi); \ |
395 | 395 | } \ |
396 | 396 | 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); \ | |
398 | 398 | } \ |
399 | 399 | void klass::public_drawContents(FXDC& dc,FXint x,FXint y,FXint w,FXint h){ \ |
400 | 400 | superklass::drawContents(dc,x,y,w,h); \ |
401 | 401 | } \ |
402 | 402 | 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); \ | |
404 | 404 | } \ |
405 | 405 | FXTableItem* klass::public_createItem(const FXString& text,FXIcon* icon,void* ptr){ \ |
406 | 406 | return superklass::createItem(text,icon,ptr); \ |
407 | 407 | } \ |
408 | 408 | 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); \ | |
410 | 410 | } \ |
411 | 411 | 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); \ | |
413 | 413 | } \ |
414 | 414 | 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); \ | |
416 | 416 | } \ |
417 | 417 | 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); \ | |
419 | 419 | } \ |
420 | 420 | 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); \ | |
422 | 422 | } \ |
423 | 423 | 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); \ | |
425 | 425 | } \ |
426 | 426 | 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); \ | |
428 | 428 | } \ |
429 | 429 | 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); \ | |
431 | 431 | } \ |
432 | 432 | void klass::clearItems(FXbool notify){ \ |
433 | FXRbCallVoidMethod(this,rb_intern("clearItems"),notify); \ | |
433 | FXRbCallVoidMethod(this,"clearItems",notify); \ | |
434 | 434 | } \ |
435 | 435 | void klass::setColumnWidth(FXint col,FXint cwidth){ \ |
436 | FXRbCallVoidMethod(this,rb_intern("setColumnWidth"),col,cwidth); \ | |
436 | FXRbCallVoidMethod(this,"setColumnWidth",col,cwidth); \ | |
437 | 437 | } \ |
438 | 438 | void klass::setRowHeight(FXint row,FXint rheight){ \ |
439 | FXRbCallVoidMethod(this,rb_intern("setRowHeight"),row,rheight); \ | |
439 | FXRbCallVoidMethod(this,"setRowHeight",row,rheight); \ | |
440 | 440 | } \ |
441 | 441 | 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); \ | |
443 | 443 | } \ |
444 | 444 | FXbool klass::selectRow(FXint row,FXbool notify){ \ |
445 | return FXRbCallBoolMethod(this,rb_intern("selectRow"),row,notify); \ | |
445 | return FXRbCallBoolMethod(this,"selectRow",row,notify); \ | |
446 | 446 | } \ |
447 | 447 | FXbool klass::selectColumn(FXint col,FXbool notify){ \ |
448 | return FXRbCallBoolMethod(this,rb_intern("selectColumn"),col,notify); \ | |
448 | return FXRbCallBoolMethod(this,"selectColumn",col,notify); \ | |
449 | 449 | } \ |
450 | 450 | 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); \ | |
452 | 452 | } \ |
453 | 453 | 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); \ | |
455 | 455 | } \ |
456 | 456 | FXbool klass::killSelection(FXbool notify){ \ |
457 | return FXRbCallBoolMethod(this,rb_intern("killSelection"),notify); \ | |
457 | return FXRbCallBoolMethod(this,"killSelection",notify); \ | |
458 | 458 | } \ |
459 | 459 | void klass::startInput(FXint row,FXint col){ \ |
460 | FXRbCallVoidMethod(this,rb_intern("startInput"),row,col); \ | |
460 | FXRbCallVoidMethod(this,"startInput",row,col); \ | |
461 | 461 | } \ |
462 | 462 | void klass::cancelInput(){ \ |
463 | FXRbCallVoidMethod(this,rb_intern("cancelInput")); \ | |
463 | FXRbCallVoidMethod(this,"cancelInput"); \ | |
464 | 464 | } \ |
465 | 465 | void klass::acceptInput(FXbool notify){ \ |
466 | FXRbCallVoidMethod(this,rb_intern("acceptInput"),notify); \ | |
466 | FXRbCallVoidMethod(this,"acceptInput",notify); \ | |
467 | 467 | } \ |
468 | 468 | void klass::makePositionVisible(FXint r,FXint c){ \ |
469 | FXRbCallVoidMethod(this,rb_intern("makePositionVisible"),r,c); \ | |
469 | FXRbCallVoidMethod(this,"makePositionVisible",r,c); \ | |
470 | 470 | } \ |
471 | 471 | FXbool klass::enableItem(FXint r,FXint c){ \ |
472 | return FXRbCallBoolMethod(this,rb_intern("enableItem"),r,c); \ | |
472 | return FXRbCallBoolMethod(this,"enableItem",r,c); \ | |
473 | 473 | } \ |
474 | 474 | FXbool klass::disableItem(FXint r,FXint c){ \ |
475 | return FXRbCallBoolMethod(this,rb_intern("disableItem"),r,c); \ | |
475 | return FXRbCallBoolMethod(this,"disableItem",r,c); \ | |
476 | 476 | } |
477 | 477 | |
478 | 478 | class FXRbTable : public FXTable { |
26 | 26 | #ifndef FXRBTEXT_H |
27 | 27 | #define FXRBTEXT_H |
28 | 28 | |
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 | } \ | |
30 | 62 | inline void klass ## _setCursorPos(klass* self,FXint pos,FXbool notify){ \ |
31 | 63 | self->klass::setCursorPos(pos,notify); \ |
32 | 64 | } \ |
71 | 103 | } |
72 | 104 | |
73 | 105 | |
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 | } \ | |
75 | 155 | void cls::setCursorPos(FXint pos,FXbool notify){ \ |
76 | FXRbCallVoidMethod(this,rb_intern("setCursorPos"),pos,notify); \ | |
156 | FXRbCallVoidMethod(this,"setCursorPos",pos,notify); \ | |
77 | 157 | } \ |
78 | 158 | 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); \ | |
80 | 160 | } \ |
81 | 161 | FXbool cls::killSelection(FXbool notify){ \ |
82 | return FXRbCallBoolMethod(this,rb_intern("killSelection"),notify); \ | |
162 | return FXRbCallBoolMethod(this,"killSelection",notify); \ | |
83 | 163 | } \ |
84 | 164 | 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); \ | |
86 | 166 | } \ |
87 | 167 | 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); \ | |
89 | 169 | } \ |
90 | 170 | 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); \ | |
92 | 172 | } \ |
93 | 173 | 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); \ | |
95 | 175 | } \ |
96 | 176 | 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); \ | |
98 | 178 | } \ |
99 | 179 | void cls::appendText(const FXString& text,FXbool notify){ \ |
100 | FXRbCallVoidMethod(this,rb_intern("appendText"),text,notify); \ | |
180 | FXRbCallVoidMethod(this,"appendText",text,notify); \ | |
101 | 181 | } \ |
102 | 182 | 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); \ | |
104 | 184 | } \ |
105 | 185 | 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); \ | |
107 | 187 | } \ |
108 | 188 | 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); \ | |
110 | 190 | } \ |
111 | 191 | 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); \ | |
113 | 193 | } \ |
114 | 194 | 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); \ | |
116 | 196 | } \ |
117 | 197 | 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); \ | |
119 | 199 | } \ |
120 | 200 | 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); \ | |
122 | 202 | } \ |
123 | 203 | 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); \ | |
125 | 205 | } \ |
126 | 206 | 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)); \ | |
128 | 208 | } \ |
129 | 209 | void cls::changeStyle(FXint pos,const FXString& style){ \ |
130 | FXRbCallVoidMethod(this,rb_intern("changeStyle"),pos,style); \ | |
210 | FXRbCallVoidMethod(this,"changeStyle",pos,style); \ | |
131 | 211 | } \ |
132 | 212 | 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); \ | |
134 | 214 | } \ |
135 | 215 | void cls::setText(const FXString& text,FXbool notify){ \ |
136 | FXRbCallVoidMethod(this,rb_intern("setText"),text,notify); \ | |
216 | FXRbCallVoidMethod(this,"setText",text,notify); \ | |
137 | 217 | } \ |
138 | 218 | 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); \ | |
140 | 220 | } \ |
141 | 221 | 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); \ | |
143 | 223 | } |
144 | 224 | |
145 | 225 |
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 | ||
0 | 22 | public: |
1 | 23 | // Overrides the base class version of setCursorPos() |
2 | 24 | virtual void setCursorPos(FXint pos,FXbool notify=FALSE); |
46 | 46 | |
47 | 47 | #define IMPLEMENT_FXTOPWINDOW_STUBS(cls) \ |
48 | 48 | void cls::show(FXuint placement){ \ |
49 | FXRbCallVoidMethod(this,rb_intern("show"),placement); \ | |
49 | FXRbCallVoidMethod(this,"show",placement); \ | |
50 | 50 | } \ |
51 | 51 | FXbool cls::maximize(FXbool notify){ \ |
52 | return FXRbCallBoolMethod(this,rb_intern("maximize"),notify); \ | |
52 | return FXRbCallBoolMethod(this,"maximize",notify); \ | |
53 | 53 | } \ |
54 | 54 | FXbool cls::minimize(FXbool notify){ \ |
55 | return FXRbCallBoolMethod(this,rb_intern("minimize"),notify); \ | |
55 | return FXRbCallBoolMethod(this,"minimize",notify); \ | |
56 | 56 | } \ |
57 | 57 | FXbool cls::restore(FXbool notify){ \ |
58 | return FXRbCallBoolMethod(this,rb_intern("restore"),notify); \ | |
58 | return FXRbCallBoolMethod(this,"restore",notify); \ | |
59 | 59 | } \ |
60 | 60 | FXbool cls::close(FXbool notify){ \ |
61 | return FXRbCallBoolMethod(this,rb_intern("close"),notify); \ | |
61 | return FXRbCallBoolMethod(this,"close",notify); \ | |
62 | 62 | } |
63 | 63 | |
64 | 64 |
34 | 34 | |
35 | 35 | #define IMPLEMENT_FXTRANSLATOR_STUBS(cls) \ |
36 | 36 | 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); \ | |
38 | 38 | } |
39 | 39 | |
40 | 40 | class FXRbTranslator : public FXTranslator { |
73 | 73 | |
74 | 74 | #define IMPLEMENT_FXTREEITEM_STUBS(klass,superklass) \ |
75 | 75 | void klass::setText(const FXString& txt){ \ |
76 | FXRbCallVoidMethod(this,rb_intern("setText"),txt); \ | |
76 | FXRbCallVoidMethod(this,"setText",txt); \ | |
77 | 77 | } \ |
78 | 78 | void klass::setOpenIcon(FXIcon* icn,FXbool owned){ \ |
79 | FXRbCallVoidMethod(this,rb_intern("setOpenIcon"),icn,owned); \ | |
79 | FXRbCallVoidMethod(this,"setOpenIcon",icn,owned); \ | |
80 | 80 | } \ |
81 | 81 | void klass::setClosedIcon(FXIcon* icn,FXbool owned){ \ |
82 | FXRbCallVoidMethod(this,rb_intern("setClosedIcon"),icn,owned); \ | |
82 | FXRbCallVoidMethod(this,"setClosedIcon",icn,owned); \ | |
83 | 83 | } \ |
84 | 84 | void klass::setFocus(FXbool focus){ \ |
85 | 85 | if(NIL_P(FXRbGetRubyObj(this,false))){ \ |
86 | 86 | superklass::setFocus(focus); \ |
87 | 87 | } \ |
88 | 88 | else{ \ |
89 | FXRbCallVoidMethod(this,rb_intern("setFocus"),focus); \ | |
89 | FXRbCallVoidMethod(this,"setFocus",focus); \ | |
90 | 90 | } \ |
91 | 91 | } \ |
92 | 92 | void klass::setSelected(FXbool selected){ \ |
93 | FXRbCallVoidMethod(this,rb_intern("setSelected"),selected); \ | |
93 | FXRbCallVoidMethod(this,"setSelected",selected); \ | |
94 | 94 | } \ |
95 | 95 | void klass::setOpened(FXbool opened){ \ |
96 | FXRbCallVoidMethod(this,rb_intern("setOpened"),opened); \ | |
96 | FXRbCallVoidMethod(this,"setOpened",opened); \ | |
97 | 97 | } \ |
98 | 98 | void klass::setExpanded(FXbool expanded){ \ |
99 | FXRbCallVoidMethod(this,rb_intern("setExpanded"),expanded); \ | |
99 | FXRbCallVoidMethod(this,"setExpanded",expanded); \ | |
100 | 100 | } \ |
101 | 101 | void klass::setEnabled(FXbool enabled){ \ |
102 | FXRbCallVoidMethod(this,rb_intern("setEnabled"),enabled); \ | |
102 | FXRbCallVoidMethod(this,"setEnabled",enabled); \ | |
103 | 103 | } \ |
104 | 104 | void klass::setDraggable(FXbool draggable){ \ |
105 | FXRbCallVoidMethod(this,rb_intern("setDraggable"),draggable); \ | |
105 | FXRbCallVoidMethod(this,"setDraggable",draggable); \ | |
106 | 106 | } \ |
107 | 107 | FXint klass::getWidth(const FXTreeList* list) const { \ |
108 | return FXRbCallIntMethod(this,rb_intern("getWidth"),list); \ | |
108 | return FXRbCallIntMethod(this,"getWidth",list); \ | |
109 | 109 | } \ |
110 | 110 | FXint klass::getHeight(const FXTreeList* list) const { \ |
111 | return FXRbCallIntMethod(this,rb_intern("getHeight"),list); \ | |
111 | return FXRbCallIntMethod(this,"getHeight",list); \ | |
112 | 112 | } \ |
113 | 113 | void klass::create(){ \ |
114 | FXRbCallVoidMethod(this,rb_intern("create")); \ | |
114 | FXRbCallVoidMethod(this,"create"); \ | |
115 | 115 | } \ |
116 | 116 | void klass::detach(){ \ |
117 | FXRbCallVoidMethod(this,rb_intern("detach")); \ | |
117 | FXRbCallVoidMethod(this,"detach"); \ | |
118 | 118 | } \ |
119 | 119 | void klass::destroy(){ \ |
120 | FXRbCallVoidMethod(this,rb_intern("destroy")); \ | |
120 | FXRbCallVoidMethod(this,"destroy"); \ | |
121 | 121 | } |
122 | 122 | |
123 | 123 | |
194 | 194 | |
195 | 195 | #define IMPLEMENT_FXTREELIST_STUBS(cls) \ |
196 | 196 | FXbool cls::selectItem(FXTreeItem* item,FXbool notify){ \ |
197 | return FXRbCallBoolMethod(this,rb_intern("selectItem"),item,notify); \ | |
197 | return FXRbCallBoolMethod(this,"selectItem",item,notify); \ | |
198 | 198 | } \ |
199 | 199 | FXbool cls::deselectItem(FXTreeItem* item,FXbool notify){ \ |
200 | return FXRbCallBoolMethod(this,rb_intern("deselectItem"),item,notify); \ | |
200 | return FXRbCallBoolMethod(this,"deselectItem",item,notify); \ | |
201 | 201 | } \ |
202 | 202 | FXbool cls::toggleItem(FXTreeItem* item,FXbool notify){ \ |
203 | return FXRbCallBoolMethod(this,rb_intern("toggleItem"),item,notify); \ | |
203 | return FXRbCallBoolMethod(this,"toggleItem",item,notify); \ | |
204 | 204 | } \ |
205 | 205 | FXbool cls::extendSelection(FXTreeItem* item,FXbool notify){ \ |
206 | return FXRbCallBoolMethod(this,rb_intern("extendSelection"),item,notify); \ | |
206 | return FXRbCallBoolMethod(this,"extendSelection",item,notify); \ | |
207 | 207 | } \ |
208 | 208 | FXbool cls::killSelection(FXbool notify){ \ |
209 | return FXRbCallBoolMethod(this,rb_intern("killSelection"),notify); \ | |
209 | return FXRbCallBoolMethod(this,"killSelection",notify); \ | |
210 | 210 | } \ |
211 | 211 | FXbool cls::openItem(FXTreeItem* item,FXbool notify){ \ |
212 | return FXRbCallBoolMethod(this,rb_intern("openItem"),item,notify); \ | |
212 | return FXRbCallBoolMethod(this,"openItem",item,notify); \ | |
213 | 213 | } \ |
214 | 214 | FXbool cls::closeItem(FXTreeItem* item,FXbool notify){ \ |
215 | return FXRbCallBoolMethod(this,rb_intern("closeItem"),item,notify); \ | |
215 | return FXRbCallBoolMethod(this,"closeItem",item,notify); \ | |
216 | 216 | } \ |
217 | 217 | FXbool cls::collapseTree(FXTreeItem* tree,FXbool notify){ \ |
218 | return FXRbCallBoolMethod(this,rb_intern("collapseTree"),tree,notify); \ | |
218 | return FXRbCallBoolMethod(this,"collapseTree",tree,notify); \ | |
219 | 219 | } \ |
220 | 220 | FXbool cls::expandTree(FXTreeItem* tree,FXbool notify){ \ |
221 | return FXRbCallBoolMethod(this,rb_intern("expandTree"),tree,notify); \ | |
221 | return FXRbCallBoolMethod(this,"expandTree",tree,notify); \ | |
222 | 222 | } \ |
223 | 223 | void cls::setCurrentItem(FXTreeItem* item,FXbool notify){ \ |
224 | FXRbCallVoidMethod(this,rb_intern("setCurrentItem"),item,notify); \ | |
224 | FXRbCallVoidMethod(this,"setCurrentItem",item,notify); \ | |
225 | 225 | } \ |
226 | 226 | FXTreeItem* cls::getItemAt(FXint x,FXint y) const { \ |
227 | return FXRbCallTreeItemMethod(this,rb_intern("getItemAt"),x,y); \ | |
227 | return FXRbCallTreeItemMethod(this,"getItemAt",x,y); \ | |
228 | 228 | } \ |
229 | 229 | void cls::makeItemVisible(FXTreeItem* item) { \ |
230 | FXRbCallVoidMethod(this,rb_intern("makeItemVisible"),item); \ | |
230 | FXRbCallVoidMethod(this,"makeItemVisible",item); \ | |
231 | 231 | } \ |
232 | 232 | FXbool cls::enableItem(FXTreeItem* item){ \ |
233 | return FXRbCallBoolMethod(this,rb_intern("enableItem"),item); \ | |
233 | return FXRbCallBoolMethod(this,"enableItem",item); \ | |
234 | 234 | } \ |
235 | 235 | FXbool cls::disableItem(FXTreeItem* item){ \ |
236 | return FXRbCallBoolMethod(this,rb_intern("disableItem"),item); \ | |
236 | return FXRbCallBoolMethod(this,"disableItem",item); \ | |
237 | 237 | } |
238 | 238 | |
239 | 239 |
33 | 33 | |
34 | 34 | #define IMPLEMENT_FXTREELISTBOX_STUBS(cls) \ |
35 | 35 | void cls::setCurrentItem(FXTreeItem* item,FXbool notify){ \ |
36 | FXRbCallVoidMethod(this,rb_intern("setCurrentItem"),item,notify); \ | |
36 | FXRbCallVoidMethod(this,"setCurrentItem",item,notify); \ | |
37 | 37 | } |
38 | 38 | |
39 | 39 | class FXRbTreeListBox : public FXTreeListBox { |
124 | 124 | |
125 | 125 | #define IMPLEMENT_FXWINDOW_STUBS(cls) \ |
126 | 126 | void cls::layout(){ \ |
127 | FXRbCallVoidMethod(this,rb_intern("layout")); \ | |
127 | FXRbCallVoidMethod(this,"layout"); \ | |
128 | 128 | } \ |
129 | 129 | FXint cls::getDefaultWidth(){ \ |
130 | return FXRbCallIntMethod(this,rb_intern("getDefaultWidth")); \ | |
130 | return FXRbCallIntMethod(this,"getDefaultWidth"); \ | |
131 | 131 | } \ |
132 | 132 | FXint cls::getDefaultHeight(){ \ |
133 | return FXRbCallIntMethod(this,rb_intern("getDefaultHeight")); \ | |
133 | return FXRbCallIntMethod(this,"getDefaultHeight"); \ | |
134 | 134 | } \ |
135 | 135 | FXint cls::getWidthForHeight(FXint givenheight){ \ |
136 | return FXRbCallIntMethod(this,rb_intern("getWidthForHeight"),givenheight); \ | |
136 | return FXRbCallIntMethod(this,"getWidthForHeight",givenheight); \ | |
137 | 137 | } \ |
138 | 138 | FXint cls::getHeightForWidth(FXint givenwidth){ \ |
139 | return FXRbCallIntMethod(this,rb_intern("getHeightForWidth"),givenwidth); \ | |
139 | return FXRbCallIntMethod(this,"getHeightForWidth",givenwidth); \ | |
140 | 140 | } \ |
141 | 141 | bool cls::canFocus() const { \ |
142 | return FXRbCallBoolMethod(this,rb_intern("canFocus")); \ | |
142 | return FXRbCallBoolMethod(this,"canFocus"); \ | |
143 | 143 | } \ |
144 | 144 | void cls::setFocus(){ \ |
145 | FXRbCallVoidMethod(this,rb_intern("setFocus")); \ | |
145 | FXRbCallVoidMethod(this,"setFocus"); \ | |
146 | 146 | } \ |
147 | 147 | void cls::killFocus(){ \ |
148 | FXRbCallVoidMethod(this,rb_intern("killFocus")); \ | |
148 | FXRbCallVoidMethod(this,"killFocus"); \ | |
149 | 149 | } \ |
150 | 150 | void cls::changeFocus(FXWindow* child){ \ |
151 | if(!FXRbIsInGC(this)) FXRbCallVoidMethod(this,rb_intern("changeFocus"),child); \ | |
151 | if(!FXRbIsInGC(this)) FXRbCallVoidMethod(this,"changeFocus",child); \ | |
152 | 152 | } \ |
153 | 153 | void cls::setDefault(FXbool enable){ \ |
154 | FXRbCallVoidMethod(this,rb_intern("setDefault"),enable); \ | |
154 | FXRbCallVoidMethod(this,"setDefault",enable); \ | |
155 | 155 | } \ |
156 | 156 | void cls::enable(){ \ |
157 | FXRbCallVoidMethod(this,rb_intern("enable")); \ | |
157 | FXRbCallVoidMethod(this,"enable"); \ | |
158 | 158 | } \ |
159 | 159 | void cls::disable(){ \ |
160 | FXRbCallVoidMethod(this,rb_intern("disable")); \ | |
160 | FXRbCallVoidMethod(this,"disable"); \ | |
161 | 161 | } \ |
162 | 162 | void cls::raise(){ \ |
163 | FXRbCallVoidMethod(this,rb_intern("raiseWindow")); \ | |
163 | FXRbCallVoidMethod(this,"raiseWindow"); \ | |
164 | 164 | } \ |
165 | 165 | void cls::lower(){ \ |
166 | FXRbCallVoidMethod(this,rb_intern("lower")); \ | |
166 | FXRbCallVoidMethod(this,"lower"); \ | |
167 | 167 | } \ |
168 | 168 | void cls::move(FXint x,FXint y){ \ |
169 | FXRbCallVoidMethod(this,rb_intern("move"),x,y); \ | |
169 | FXRbCallVoidMethod(this,"move",x,y); \ | |
170 | 170 | } \ |
171 | 171 | 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); \ | |
173 | 173 | } \ |
174 | 174 | void cls::recalc(){ \ |
175 | if(!FXRbIsInGC(this)) FXRbCallVoidMethod(this,rb_intern("recalc")); \ | |
175 | if(!FXRbIsInGC(this)) FXRbCallVoidMethod(this,"recalc"); \ | |
176 | 176 | } \ |
177 | 177 | void cls::reparent(FXWindow* father,FXWindow* other){ \ |
178 | FXRbCallVoidMethod(this,rb_intern("reparent"),father,other); \ | |
178 | FXRbCallVoidMethod(this,"reparent",father,other); \ | |
179 | 179 | } \ |
180 | 180 | void cls::show(){ \ |
181 | FXRbCallVoidMethod(this,rb_intern("show")); \ | |
181 | FXRbCallVoidMethod(this,"show"); \ | |
182 | 182 | } \ |
183 | 183 | void cls::hide(){ \ |
184 | FXRbCallVoidMethod(this,rb_intern("hide")); \ | |
184 | FXRbCallVoidMethod(this,"hide"); \ | |
185 | 185 | } \ |
186 | 186 | bool cls::isComposite() const { \ |
187 | return FXRbCallBoolMethod(this,rb_intern("isComposite")); \ | |
187 | return FXRbCallBoolMethod(this,"isComposite"); \ | |
188 | 188 | } \ |
189 | 189 | bool cls::contains(FXint parentx,FXint parenty) const{ \ |
190 | return FXRbCallBoolMethod(this,rb_intern("contains"),parentx,parenty); \ | |
190 | return FXRbCallBoolMethod(this,"contains",parentx,parenty); \ | |
191 | 191 | } \ |
192 | 192 | bool cls::doesSaveUnder() const { \ |
193 | return FXRbCallBoolMethod(this,rb_intern("doesSaveUnder")); \ | |
193 | return FXRbCallBoolMethod(this,"doesSaveUnder"); \ | |
194 | 194 | } \ |
195 | 195 | void cls::setBackColor(FXColor clr) { \ |
196 | FXRbCallVoidMethod(this,rb_intern("setBackColor"),clr); \ | |
196 | FXRbCallVoidMethod(this,"setBackColor",clr); \ | |
197 | 197 | } \ |
198 | 198 | 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); \ | |
200 | 200 | } \ |
201 | 201 | void cls::setShape(const FXRegion& region) { \ |
202 | FXRbCallVoidMethod(this,rb_intern("setShape"),region); \ | |
202 | FXRbCallVoidMethod(this,"setShape",region); \ | |
203 | 203 | } \ |
204 | 204 | void cls::setShape(FXBitmap* bitmap) { \ |
205 | FXRbCallVoidMethod(this,rb_intern("setShape"),bitmap); \ | |
205 | FXRbCallVoidMethod(this,"setShape",bitmap); \ | |
206 | 206 | } \ |
207 | 207 | void cls::setShape(FXIcon* icon) { \ |
208 | FXRbCallVoidMethod(this,rb_intern("setShape"),icon); \ | |
208 | FXRbCallVoidMethod(this,"setShape",icon); \ | |
209 | 209 | } \ |
210 | 210 | void cls::clearShape() { \ |
211 | FXRbCallVoidMethod(this,rb_intern("clearShape")); \ | |
211 | FXRbCallVoidMethod(this,"clearShape"); \ | |
212 | 212 | } \ |
213 | 213 | void cls::dropEnable() { \ |
214 | FXRbCallVoidMethod(this,rb_intern("dropEnable")); \ | |
214 | FXRbCallVoidMethod(this,"dropEnable"); \ | |
215 | 215 | } \ |
216 | 216 | void cls::dropDisable() { \ |
217 | FXRbCallVoidMethod(this,rb_intern("dropDisable")); \ | |
217 | FXRbCallVoidMethod(this,"dropDisable"); \ | |
218 | 218 | } |
219 | 219 | |
220 | 220 | class FXRbWindow : public FXWindow { |
26 | 26 | #ifndef FXRUBY_H |
27 | 27 | #define FXRUBY_H |
28 | 28 | |
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 | ||
43 | 29 | #ifndef NUM2SIZET |
44 | 30 | #define NUM2SIZET(s) NUM2ULONG(s) |
45 | 31 | #endif |
54 | 40 | extern "C" { |
55 | 41 | static const char * SWIG_TypeName(const swig_type_info *ty); |
56 | 42 | 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); | |
60 | 44 | } |
61 | 45 | |
62 | 46 | // Helper for overloaded show() functions |
63 | 47 | template <class TYPE> |
64 | 48 | VALUE showHelper(VALUE self, int argc, VALUE *argv, TYPE *p, swig_type_info *typeinfo) { |
65 | 49 | TYPE *win; |
66 | SWIG_ConvertPtr(self,(void**)&win,typeinfo,1); | |
50 | FXSWIG_ConvertPtr(self,(void**)&win,typeinfo,1); | |
67 | 51 | if (argc == 0) { |
68 | 52 | win->_show(); |
69 | 53 | } |
79 | 63 | |
80 | 64 | // Wrapper around SWIG_Ruby_NewPointerObj() |
81 | 65 | VALUE FXRbNewPointerObj(void *ptr, swig_type_info *typeinfo); |
66 | VALUE FXRbNewPointerObjCb(void *ptr, swig_type_info *typeinfo); | |
82 | 67 | bool FXRbIsBorrowed(void* ptr); |
83 | 68 | bool FXRbSetInGC(const void* ptr, bool enabled); |
84 | 69 | bool FXRbIsInGC(const void* ptr); |
90 | 75 | void* FXRbConvertPtr(VALUE obj,swig_type_info* typeinfo); |
91 | 76 | |
92 | 77 | // 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); | |
95 | 82 | |
96 | 83 | // Register mapping from Ruby objects to FOX objects |
97 | 84 | void FXRbRegisterRubyObj(VALUE rubyObj, const void* foxObj); |
116 | 103 | * FOX object (if any). If searchBoth is false, only considers the |
117 | 104 | * Ruby-owned objects; otherwise considers all outstanding references. |
118 | 105 | */ |
119 | VALUE FXRbGetRubyObj(const void *foxObj, bool searchBoth); | |
106 | VALUE FXRbGetRubyObj(const void *foxObj, bool searchBoth, bool in_gc_mark=false); | |
120 | 107 | |
121 | 108 | /** |
122 | 109 | * Return the registered Ruby class instance associated with this |
124 | 111 | */ |
125 | 112 | VALUE FXRbGetRubyObj(const void *foxObj, const char *type); |
126 | 113 | VALUE FXRbGetRubyObj(const void *foxObj, swig_type_info *type); |
114 | VALUE FXRbGetRubyObjCb(const void *foxObj, swig_type_info *type); | |
115 | ||
127 | 116 | |
128 | 117 | // Mark this object as used for the garbage collector |
129 | 118 | void FXRbGcMark(void *obj); |
167 | 156 | extern void* FXRbGetExpectedData(VALUE recv,FXSelector key,VALUE data); |
168 | 157 | |
169 | 158 | // 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); | |
171 | 160 | |
172 | 161 | // 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); | |
174 | 163 | |
175 | 164 | // Convert a signal name string to its corresponding signal number |
176 | 165 | FXint FXRbSignalNameToNumber(const char* name); |
320 | 309 | inline VALUE to_ruby(FXDC& dc){ |
321 | 310 | return FXRbGetRubyObj(reinterpret_cast<void*>(&dc),FXRbTypeQuery("FXDC *")); |
322 | 311 | } |
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 | ||
323 | 370 | |
324 | 371 | /** |
325 | 372 | * Remember: FXID is typedef'd as an unsigned int on non-Windows platforms, |
350 | 397 | void FXRbRange2LoHi(VALUE range,FXdouble& lo,FXdouble& hi); |
351 | 398 | |
352 | 399 | // 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); | |
356 | 403 | |
357 | 404 | /* One argument */ |
358 | 405 | template<class TYPE> |
359 | void FXRbCallVoidMethod(FXObject* recv,ID func, TYPE& arg){ | |
406 | void FXRbCallVoidMethod_gvlcb(FXObject* recv,const char *func, TYPE& arg){ | |
360 | 407 | VALUE obj=FXRbGetRubyObj(recv,false); |
361 | 408 | FXASSERT(!NIL_P(obj)); |
362 | 409 | FXASSERT(!FXRbIsInGC(recv)); |
363 | rb_funcall(obj,func,1,to_ruby(arg)); | |
410 | rb_funcall(obj,rb_intern(func),1,to_ruby_cb(arg)); | |
364 | 411 | } |
365 | 412 | |
366 | 413 | 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)); | |
371 | 418 | } |
372 | 419 | |
373 | 420 | 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){ | |
375 | 422 | VALUE obj=FXRbGetRubyObj(recv,false); |
376 | 423 | FXASSERT(!NIL_P(obj)); |
377 | 424 | FXASSERT(!FXRbIsInGC(recv)); |
378 | rb_funcall(obj,func,1,to_ruby(arg)); | |
425 | rb_funcall(obj,rb_intern(func),1,to_ruby_cb(arg)); | |
379 | 426 | } |
380 | 427 | |
381 | 428 | /* Two arguments */ |
382 | 429 | 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)); | |
387 | 434 | } |
388 | 435 | |
389 | 436 | 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); | |
398 | 453 | |
399 | 454 | /* Three arguments */ |
400 | 455 | 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)); | |
405 | 460 | } |
406 | 461 | |
407 | 462 | 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)); | |
412 | 467 | } |
413 | 468 | |
414 | 469 | /* Four arguments */ |
415 | 470 | 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)); | |
420 | 475 | } |
421 | 476 | |
422 | 477 | 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)); | |
427 | 482 | } |
428 | 483 | |
429 | 484 | /* Five arguments */ |
430 | 485 | 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)); | |
435 | 490 | } |
436 | 491 | |
437 | 492 | 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)); | |
442 | 497 | } |
443 | 498 | |
444 | 499 | /* Six arguments */ |
445 | 500 | 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)); | |
450 | 505 | } |
451 | 506 | |
452 | 507 | 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)); | |
457 | 512 | } |
458 | 513 | |
459 | 514 | /* Seven arguments */ |
460 | 515 | 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)); | |
465 | 527 | } |
466 | 528 | |
467 | 529 | /* Nine arguments */ |
468 | 530 | 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)); | |
473 | 535 | } |
474 | 536 | |
475 | 537 | /* Eleven arguments (!) */ |
476 | 538 | 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)); | |
481 | 543 | } |
482 | 544 | |
483 | 545 | // 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); | |
486 | 548 | return (v==Qtrue); |
487 | 549 | } |
488 | 550 | |
489 | 551 | 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)); | |
492 | 554 | return (v==Qtrue); |
493 | 555 | } |
494 | 556 | |
495 | 557 | 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)); | |
498 | 560 | return (v==Qtrue); |
499 | 561 | } |
500 | 562 | |
501 | bool FXRbCallBoolMethod(const FXObject* recv,ID func); | |
563 | bool FXRbCallBoolMethod_gvlcb(const FXObject* recv,const char *func); | |
502 | 564 | |
503 | 565 | 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)); | |
508 | 570 | return (v==Qtrue); |
509 | 571 | } |
510 | 572 | |
511 | 573 | 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)); | |
514 | 576 | return (v==Qtrue); |
515 | 577 | } |
516 | 578 | |
517 | 579 | 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)); | |
522 | 584 | return (v==Qtrue); |
523 | 585 | } |
524 | 586 | |
525 | 587 | 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)); | |
530 | 592 | return (v==Qtrue); |
531 | 593 | } |
532 | 594 | |
533 | 595 | 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)); | |
538 | 600 | return (v==Qtrue); |
539 | 601 | } |
540 | 602 | |
541 | 603 | // Call function with "FXint" return value |
542 | FXint FXRbCallIntMethod(const FXObject* recv,ID func); | |
604 | FXint FXRbCallIntMethod_gvlcb(const FXObject* recv,const char *func); | |
543 | 605 | |
544 | 606 | 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)); | |
549 | 611 | return static_cast<FXint>(NUM2INT(v)); |
550 | 612 | } |
551 | 613 | |
552 | 614 | 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)); | |
557 | 619 | return static_cast<FXint>(NUM2INT(v)); |
558 | 620 | } |
559 | 621 | |
560 | 622 | 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)); | |
565 | 627 | return static_cast<FXint>(NUM2INT(result)); |
566 | 628 | } |
567 | 629 | |
568 | 630 | 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)); | |
573 | 635 | return static_cast<FXint>(NUM2INT(result)); |
574 | 636 | } |
575 | 637 | |
576 | 638 | // Call function with "long" return value |
577 | 639 | 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)); | |
582 | 644 | return static_cast<long>(NUM2LONG(v)); |
583 | 645 | } |
584 | 646 | |
585 | 647 | // Call functions with "FXuint" return value |
586 | 648 | 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)); | |
591 | 653 | return static_cast<FXuint>(NUM2UINT(v)); |
592 | 654 | } |
593 | 655 | |
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 | ||
594 | 664 | // Call functions with FXString return value |
595 | FXString FXRbCallStringMethod(const FXObject* recv, ID func); | |
665 | FXString FXRbCallStringMethod_gvlcb(const FXObject* recv, const char *func); | |
596 | 666 | |
597 | 667 | // 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*); | |
600 | 670 | |
601 | 671 | // 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); | |
605 | 675 | |
606 | 676 | // 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); | |
608 | 678 | |
609 | 679 | // 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); | |
611 | 681 | |
612 | 682 | // 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); | |
614 | 684 | |
615 | 685 | // 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); | |
617 | 687 | |
618 | 688 | // Call functions with "FXIcon*" return value |
619 | FXIcon* FXRbCallIconMethod(const FXTableItem* recv,ID func); | |
689 | FXIcon* FXRbCallIconMethod_gvlcb(const FXTableItem* recv,const char *func); | |
620 | 690 | |
621 | 691 | 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)); | |
626 | 696 | return NIL_P(result) ? 0 : reinterpret_cast<FXIcon*>(DATA_PTR(result)); |
627 | 697 | } |
628 | 698 | |
629 | 699 | 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)); | |
634 | 704 | return NIL_P(result) ? 0 : reinterpret_cast<FXIcon*>(DATA_PTR(result)); |
635 | 705 | } |
636 | 706 | |
637 | 707 | // Call functions with FXImage* return value |
638 | 708 | 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)); | |
643 | 713 | return NIL_P(result) ? 0 : reinterpret_cast<FXImage*>(DATA_PTR(result)); |
644 | 714 | } |
645 | 715 | |
646 | 716 | 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)); | |
651 | 721 | return NIL_P(result) ? 0 : reinterpret_cast<FXImage*>(DATA_PTR(result)); |
652 | 722 | } |
653 | 723 | |
654 | 724 | // 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); | |
656 | 726 | |
657 | 727 | // Call functions with "FXColor" return value |
658 | 728 | 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)); | |
663 | 733 | return static_cast<FXColor>(NUM2UINT(v)); |
664 | 734 | } |
665 | 735 | |
666 | 736 | // Call functions with "FXRangef" return value |
667 | FXRangef FXRbCallRangeMethod(FXObject* recv,ID func); | |
737 | FXRangef FXRbCallRangeMethod_gvlcb(FXObject* recv,const char *func); | |
668 | 738 | |
669 | 739 | // 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); | |
671 | 746 | |
672 | 747 | /** |
673 | 748 | * Macro to set up class implementation. |
692 | 767 | } \ |
693 | 768 | } |
694 | 769 | |
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 | |
695 | 782 | |
696 | 783 | // FXRuby classes |
697 | 784 | #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, ¶ms, 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)>, ¶ms); \ | |
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 */ |
0 | 0 | #!/bin/env ruby |
1 | 1 | |
2 | $special_stubclasses = ["FXGLSHAPE", "FXICONITEM", "FXTABLE", "FXTABLEITEM", "FXTREEITEM"] | |
2 | $special_stubclasses = ["FXGLSHAPE", "FXICONITEM", "FXTABLE", "FXTABLEITEM", "FXTEXT", "FXTREEITEM"] | |
3 | 3 | |
4 | 4 | class Processor |
5 | 5 | def initialize |
530 | 530 | |
531 | 531 | |
532 | 532 | void FXRbTable::markfunc(FXTable* self){ |
533 | register FXTableItem* item; | |
534 | 533 | FXRbScrollArea::markfunc(self); |
535 | 534 | if(self){ |
536 | 535 | FXRbGcMark(self->FXTable::getFont()); |
538 | 537 | FXRbGcMark(self->FXTable::getColumnHeaderFont()); |
539 | 538 | for(FXint row=0;row<self->FXTable::getNumRows();row++){ |
540 | 539 | for(FXint col=0;col<self->FXTable::getNumColumns();col++){ |
541 | item=self->FXTable::getItem(row,col); | |
540 | FXTableItem* item=self->FXTable::getItem(row,col); | |
542 | 541 | FXRbGcMark(item); |
543 | 542 | } |
544 | 543 | } |
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 |
1975 | 1975 | end |
1976 | 1976 | class FXGLVisual |
1977 | 1977 | def FXGLVisual.supported?(*args) # :nodoc: |
1978 | FXGLVisual.supported(*args) | |
1978 | FXGLVisual.supported(*args)[0] | |
1979 | 1979 | end |
1980 | 1980 | def redSize(*args) # :nodoc: |
1981 | 1981 | getRedSize(*args) |
2412 | 2412 | class FXImage |
2413 | 2413 | def data(*args) # :nodoc: |
2414 | 2414 | getData(*args) |
2415 | end | |
2416 | def dataPtr(*args) # :nodoc: | |
2417 | getDataPtr(*args) | |
2415 | 2418 | end |
2416 | 2419 | def pixels=(*args) # :nodoc: |
2417 | 2420 | setPixels(*args) |
98 | 98 | btn.connect(SEL_COMMAND) do |send, sel, ev| |
99 | 99 | @selected = Time.local(@date_showing.year, @date_showing.month, |
100 | 100 | 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 | |
102 | 102 | end |
103 | 103 | end |
104 | 104 | _build_date_matrix() |
201 | 201 | |
202 | 202 | if __FILE__ == $0 |
203 | 203 | |
204 | include Fox | |
205 | ||
206 | app = FXApp.new('Calendar', 'FXRuby') | |
204 | app = Fox::FXApp.new('Calendar', 'FXRuby') | |
207 | 205 | 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| | |
211 | 209 | puts data.to_s |
212 | 210 | end |
213 | 211 | app.create |
214 | mainwin.show(PLACEMENT_SCREEN) | |
212 | mainwin.show(Fox::PLACEMENT_SCREEN) | |
215 | 213 | app.run |
216 | 214 | end |
311 | 311 | shape.select |
312 | 312 | @canvas.updateShape(shape) |
313 | 313 | 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) | |
315 | 315 | end |
316 | 316 | end |
317 | 317 | end |
321 | 321 | shape.deselect |
322 | 322 | @canvas.updateShape(shape) |
323 | 323 | 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) | |
325 | 325 | end |
326 | 326 | end |
327 | 327 | end |
462 | 462 | updateShape(shape) |
463 | 463 | changes = true |
464 | 464 | if notify && (target != nil) |
465 | target.handle(self, MKUINT(message, SEL_DESELECTED), shape) | |
465 | target.handle(self, Fox.MKUINT(message, SEL_DESELECTED), shape) | |
466 | 466 | end |
467 | 467 | end |
468 | 468 | end |
485 | 485 | def onMotion(sender, sel, evt) |
486 | 486 | # Drag and drop mode |
487 | 487 | if (@flags & FLAG_DODRAG) != 0 |
488 | handle(self, MKUINT(0, SEL_DRAGGED), evt) | |
488 | handle(self, Fox.MKUINT(0, SEL_DRAGGED), evt) | |
489 | 489 | return 1 |
490 | 490 | end |
491 | 491 | |
493 | 493 | if (@flags & FLAG_TRYDRAG) != 0 |
494 | 494 | if evt.moved? |
495 | 495 | @flags &= ~FLAG_TRYDRAG |
496 | if handle(this, MKUINT(0, SEL_BEGINDRAG), evt) != 0 | |
496 | if handle(this, Fox.MKUINT(0, SEL_BEGINDRAG), evt) != 0 | |
497 | 497 | @flags |= FLAG_DODRAG |
498 | 498 | end |
499 | 499 | end |
503 | 503 | |
504 | 504 | # Left button press |
505 | 505 | def onLeftBtnPress(sender, sel, evt) |
506 | handle(self, MKUINT(0, SEL_FOCUS_SELF), evt) | |
506 | handle(self, Fox.MKUINT(0, SEL_FOCUS_SELF), evt) | |
507 | 507 | if enabled? |
508 | 508 | grab |
509 | 509 | flags &= ~FLAG_UPDATE |
510 | 510 | |
511 | 511 | # 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) | |
513 | 513 | |
514 | 514 | # Locate shape |
515 | 515 | shape = findShape(evt.win_x, evt.win_y) |
547 | 547 | @flags &= ~(FLAG_PRESSED|FLAG_TRYDRAG|FLAG_LASSO|FLAG_DODRAG) |
548 | 548 | |
549 | 549 | # 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 | |
551 | 551 | |
552 | 552 | # Was dragging |
553 | 553 | if (flg & FLAG_DODRAG) != 0 |
554 | handle(self, MKUINT(0, SEL_ENDDRAG), evt) | |
554 | handle(self, Fox.MKUINT(0, SEL_ENDDRAG), evt) | |
555 | 555 | return 1 |
556 | 556 | end |
557 | 557 | |
564 | 564 | |
565 | 565 | # Generate clicked callbacks |
566 | 566 | if evt.click_count == 1 |
567 | handle(self, MKUINT(0, SEL_CLICKED), @currentShape) | |
567 | handle(self, Fox.MKUINT(0, SEL_CLICKED), @currentShape) | |
568 | 568 | elsif evt.click_count == 2 |
569 | handle(self, MKUINT(0, SEL_DOUBLECLICKED), @currentShape) | |
569 | handle(self, Fox.MKUINT(0, SEL_DOUBLECLICKED), @currentShape) | |
570 | 570 | elseif evt.click_count == 3 |
571 | handle(self, MKUINT(0, SEL_TRIPLECLICKED), @currentShape) | |
571 | handle(self, Fox.MKUINT(0, SEL_TRIPLECLICKED), @currentShape) | |
572 | 572 | end |
573 | 573 | |
574 | 574 | # Generate command callback only when clicked on item |
575 | 575 | if @currentShape && @currentShape.enabled? |
576 | handle(self, MKUINT(0, SEL_COMMAND), @currentShape) | |
576 | handle(self, Fox.MKUINT(0, SEL_COMMAND), @currentShape) | |
577 | 577 | end |
578 | 578 | return 1 |
579 | 579 | end |
583 | 583 | |
584 | 584 | # Command message |
585 | 585 | 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) | |
587 | 587 | end |
588 | 588 | |
589 | 589 | # Clicked on canvas |
590 | 590 | 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) | |
592 | 592 | end |
593 | 593 | |
594 | 594 | # Double-clicked on canvas |
595 | 595 | 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) | |
597 | 597 | end |
598 | 598 | |
599 | 599 | # Triple-clicked on canvas |
600 | 600 | 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) | |
602 | 602 | end |
603 | 603 | end |
604 | 604 | end |
420 | 420 | # |
421 | 421 | def FXStreamError.makeStreamError(status) |
422 | 422 | 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 | |
441 | 441 | end |
442 | 442 | end |
443 | 443 | end |
624 | 624 | end |
625 | 625 | end |
626 | 626 | |
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 | ||
635 | 627 | class FXTable |
636 | 628 | # |
637 | 629 | # Append _numColumns_ columns to the right of the table.. |
8 | 8 | # A group of OpenGL objects |
9 | 9 | # |
10 | 10 | class FXGLGroup < FXGLObject |
11 | ||
11 | include OpenGL | |
12 | 12 | include Enumerable |
13 | 13 | |
14 | 14 | FLT_MAX = 1.0e+20 |
79 | 79 | # |
80 | 80 | def hit(viewer) |
81 | 81 | # GL.PushName(0xffffffff) |
82 | GL.PushName(1000000) | |
82 | glPushName(1000000) | |
83 | 83 | @list.each_with_index do |obj, i| |
84 | GL.LoadName(i) | |
85 | obj.hit(viewer) | |
84 | glLoadName(i) | |
85 | obj.hit(viewer) | |
86 | 86 | end |
87 | GL.PopName | |
87 | glPopName | |
88 | 88 | end |
89 | 89 | |
90 | 90 | # |
8 | 8 | # OpenGL point object |
9 | 9 | # |
10 | 10 | class FXGLPoint < FXGLObject |
11 | include OpenGL | |
11 | 12 | |
12 | 13 | # Point position, in model coordinates (a 3-element array) |
13 | 14 | attr_accessor :pos |
46 | 47 | # Draw this point into _viewer_ (an FXGLViewer instance). |
47 | 48 | # |
48 | 49 | def draw(viewer) |
49 | GL::Color(0.0, 0.0, 1.0) | |
50 | GL::PointSize(HANDLE_SIZE) | |
51 | GL::Begin(GL::POINTS) | |
52 | GL::Vertex(@pos) | |
53 | GL::End() | |
50 | glColor3d(0.0, 0.0, 1.0) | |
51 | glPointSize(HANDLE_SIZE) | |
52 | glBegin(GL_POINTS) | |
53 | glVertex3d(*@pos) | |
54 | glEnd() | |
54 | 55 | end |
55 | 56 | |
56 | 57 | # |
57 | 58 | # Perform hit test for this point in _viewer_ (an FXGLViewer instance). |
58 | 59 | # |
59 | 60 | def hit(viewer) |
60 | GL::Begin(GL::POINTS) | |
61 | GL::Vertex(@pos) | |
62 | GL::End() | |
61 | glBegin(GL_POINTS) | |
62 | glVertex3d(*@pos) | |
63 | glEnd() | |
63 | 64 | end |
64 | 65 | end |
65 | 66 | |
67 | 68 | # OpenGL line object |
68 | 69 | # |
69 | 70 | class FXGLLine < FXGLObject |
71 | include OpenGL | |
70 | 72 | |
71 | 73 | # Starting point for line [FXGLPoint] |
72 | 74 | attr_accessor :fm |
92 | 94 | def initialize(*args) |
93 | 95 | super() |
94 | 96 | if args.length == 0 |
95 | @fm = FXGLPoint.new(-0.5, 0.0, 0.0) | |
96 | @to = FXGLPoint.new( 0.5, 0.0, 0.0) | |
97 | @fm = FXGLPoint.new(-0.5, 0.0, 0.0) | |
98 | @to = FXGLPoint.new( 0.5, 0.0, 0.0) | |
97 | 99 | elsif args.length == 1 |
98 | @fm = args[0].fm | |
99 | @to = args[0].to | |
100 | @fm = args[0].fm | |
101 | @to = args[0].to | |
100 | 102 | else |
101 | @fm = FXGLPoint.new(args[0], args[1], args[2]) | |
102 | @to = FXGLPoint.new(args[3], args[4], args[5]) | |
103 | @fm = FXGLPoint.new(args[0], args[1], args[2]) | |
104 | @to = FXGLPoint.new(args[3], args[4], args[5]) | |
103 | 105 | end |
104 | 106 | end |
105 | 107 | |
119 | 121 | # Draw this line into _viewer_ (an FXGLViewer instance). |
120 | 122 | # |
121 | 123 | def draw(viewer) |
122 | GL::Color(1.0, 0.0, 0.0) | |
123 | GL::PointSize(HANDLE_SIZE) | |
124 | GL::Begin(GL::LINES) | |
125 | GL::Vertex(@fm.pos) | |
126 | GL::Vertex(@to.pos) | |
127 | GL::End() | |
124 | glColor3d(1.0, 0.0, 0.0) | |
125 | glPointSize(HANDLE_SIZE) | |
126 | glBegin(GL_LINES) | |
127 | glVertex3d(*@fm.pos) | |
128 | glVertex3d(*@to.pos) | |
129 | glEnd() | |
128 | 130 | end |
129 | 131 | |
130 | 132 | # |
131 | 133 | # Perform hit-test for this line in _viewer_ (an FXGLViewer instance). |
132 | 134 | # |
133 | 135 | def hit(viewer) |
134 | GL::Begin(GL::LINES) | |
135 | GL::Vertex(@fm.pos) | |
136 | GL::Vertex(@to.pos) | |
137 | GL::End() | |
136 | glBegin(GL_LINES) | |
137 | glVertex3d(*@fm.pos) | |
138 | glVertex3d(*@to.pos) | |
139 | glEnd() | |
138 | 140 | end |
139 | 141 | end |
140 | 142 | |
142 | 144 | # OpenGL cube object |
143 | 145 | # |
144 | 146 | class FXGLCube < FXGLShape |
147 | include OpenGL | |
145 | 148 | |
146 | 149 | # Cube width [Float] |
147 | 150 | attr_accessor :width |
172 | 175 | # |
173 | 176 | def initialize(*args) |
174 | 177 | if args.length == 7 |
175 | super(args[0], args[1], args[2], SHADING_SMOOTH|STYLE_SURFACE, | |
178 | super(args[0], args[1], args[2], SHADING_SMOOTH|STYLE_SURFACE, | |
176 | 179 | args[6], args[6]) |
177 | 180 | else |
178 | super(args[0], args[1], args[2], SHADING_SMOOTH|STYLE_SURFACE) | |
181 | super(args[0], args[1], args[2], SHADING_SMOOTH|STYLE_SURFACE) | |
179 | 182 | end |
180 | 183 | @width = args[3] ? args[3] : 1.0 |
181 | 184 | @height = args[4] ? args[4] : 1.0 |
182 | 185 | @depth = args[5] ? args[5] : 1.0 |
183 | 186 | setRange(FXRangef.new(-0.5*@width, 0.5*@width, |
184 | -0.5*@height, 0.5*@height, | |
185 | -0.5*@depth, 0.5*@depth)) | |
187 | -0.5*@height, 0.5*@height, | |
188 | -0.5*@depth, 0.5*@depth)) | |
186 | 189 | end |
187 | 190 | |
188 | 191 | # |
194 | 197 | zmin, zmax = -0.5*@depth, 0.5*@depth |
195 | 198 | |
196 | 199 | # Draw low face |
197 | GL::Begin(GL::TRIANGLE_STRIP) | |
198 | GL::Normal(0.0, 0.0, -1.0) | |
199 | GL::Vertex(xmin, ymin, zmin) | |
200 | GL::Vertex(xmin, ymax, zmin) | |
201 | GL::Vertex(xmax, ymin, zmin) | |
202 | GL::Vertex(xmax, ymax, zmin) | |
203 | GL::End() | |
200 | glBegin(GL_TRIANGLE_STRIP) | |
201 | glNormal3d(0.0, 0.0, -1.0) | |
202 | glVertex3d(xmin, ymin, zmin) | |
203 | glVertex3d(xmin, ymax, zmin) | |
204 | glVertex3d(xmax, ymin, zmin) | |
205 | glVertex3d(xmax, ymax, zmin) | |
206 | glEnd() | |
204 | 207 | |
205 | 208 | # Draw east face |
206 | GL::Begin(GL::TRIANGLE_STRIP) | |
207 | GL::Normal(1.0, 0.0, 0.0) | |
208 | GL::Vertex(xmax, ymin, zmin) | |
209 | GL::Vertex(xmax, ymax, zmin) | |
210 | GL::Vertex(xmax, ymin, zmax) | |
211 | GL::Vertex(xmax, ymax, zmax) | |
212 | GL::End() | |
209 | glBegin(GL_TRIANGLE_STRIP) | |
210 | glNormal3d(1.0, 0.0, 0.0) | |
211 | glVertex3d(xmax, ymin, zmin) | |
212 | glVertex3d(xmax, ymax, zmin) | |
213 | glVertex3d(xmax, ymin, zmax) | |
214 | glVertex3d(xmax, ymax, zmax) | |
215 | glEnd() | |
213 | 216 | |
214 | 217 | # Draw high face |
215 | GL::Begin(GL::TRIANGLE_STRIP) | |
216 | GL::Normal(0.0, 0.0, 1.0) | |
217 | GL::Vertex(xmax, ymin, zmax) | |
218 | GL::Vertex(xmax, ymax, zmax) | |
219 | GL::Vertex(xmin, ymin, zmax) | |
220 | GL::Vertex(xmin, ymax, zmax) | |
221 | GL::End() | |
218 | glBegin(GL_TRIANGLE_STRIP) | |
219 | glNormal3d(0.0, 0.0, 1.0) | |
220 | glVertex3d(xmax, ymin, zmax) | |
221 | glVertex3d(xmax, ymax, zmax) | |
222 | glVertex3d(xmin, ymin, zmax) | |
223 | glVertex3d(xmin, ymax, zmax) | |
224 | glEnd() | |
222 | 225 | |
223 | 226 | # Draw west face |
224 | GL::Begin(GL::TRIANGLE_STRIP) | |
225 | GL::Normal(-1.0, 0.0, 0.0) | |
226 | GL::Vertex(xmin, ymin, zmax) | |
227 | GL::Vertex(xmin, ymax, zmax) | |
228 | GL::Vertex(xmin, ymin, zmin) | |
229 | GL::Vertex(xmin, ymax, zmin) | |
230 | GL::End() | |
227 | glBegin(GL_TRIANGLE_STRIP) | |
228 | glNormal3d(-1.0, 0.0, 0.0) | |
229 | glVertex3d(xmin, ymin, zmax) | |
230 | glVertex3d(xmin, ymax, zmax) | |
231 | glVertex3d(xmin, ymin, zmin) | |
232 | glVertex3d(xmin, ymax, zmin) | |
233 | glEnd() | |
231 | 234 | |
232 | 235 | # Draw north face |
233 | GL::Begin(GL::TRIANGLE_STRIP) | |
234 | GL::Normal(0.0, 1.0, 0.0) | |
235 | GL::Vertex(xmin, ymax, zmin) | |
236 | GL::Vertex(xmin, ymax, zmax) | |
237 | GL::Vertex(xmax, ymax, zmin) | |
238 | GL::Vertex(xmax, ymax, zmax) | |
239 | GL::End() | |
236 | glBegin(GL_TRIANGLE_STRIP) | |
237 | glNormal3d(0.0, 1.0, 0.0) | |
238 | glVertex3d(xmin, ymax, zmin) | |
239 | glVertex3d(xmin, ymax, zmax) | |
240 | glVertex3d(xmax, ymax, zmin) | |
241 | glVertex3d(xmax, ymax, zmax) | |
242 | glEnd() | |
240 | 243 | |
241 | 244 | # Draw south face |
242 | GL::Begin(GL::TRIANGLE_STRIP) | |
243 | GL::Normal(0.0, -1.0, 0.0) | |
244 | GL::Vertex(xmin, ymin, zmax) | |
245 | GL::Vertex(xmin, ymin, zmin) | |
246 | GL::Vertex(xmax, ymin, zmax) | |
247 | GL::Vertex(xmax, ymin, zmin) | |
248 | GL::End() | |
245 | glBegin(GL_TRIANGLE_STRIP) | |
246 | glNormal3d(0.0, -1.0, 0.0) | |
247 | glVertex3d(xmin, ymin, zmax) | |
248 | glVertex3d(xmin, ymin, zmin) | |
249 | glVertex3d(xmax, ymin, zmax) | |
250 | glVertex3d(xmax, ymin, zmin) | |
251 | glEnd() | |
249 | 252 | end |
250 | 253 | end |
251 | 254 | |
253 | 256 | # OpenGL cone object |
254 | 257 | # |
255 | 258 | class FXGLCone < FXGLShape |
259 | include OpenGL | |
260 | include GLU | |
261 | ||
256 | 262 | # Cone fidelity |
257 | 263 | SLICES_NUMBER = 20 |
258 | 264 | STACKS_NUMBER = 20 |
292 | 298 | # |
293 | 299 | def initialize(*args) |
294 | 300 | if args.length == 5 |
295 | super(args[0], args[1], args[2], SHADING_SMOOTH|STYLE_SURFACE) | |
301 | super(args[0], args[1], args[2], SHADING_SMOOTH|STYLE_SURFACE) | |
296 | 302 | elsif args.length == 6 |
297 | super(args[0], args[1], args[2], SHADING_SMOOTH|STYLE_SURFACE, | |
303 | super(args[0], args[1], args[2], SHADING_SMOOTH|STYLE_SURFACE, | |
298 | 304 | args[5], args[5]) |
299 | 305 | end |
300 | 306 | @height = args[3] ? args[3] : 1.0 |
309 | 315 | # Draw this cone into _viewer_ (an FXGLViewer instance). |
310 | 316 | # |
311 | 317 | def drawshape(viewer) |
312 | quad = GLU::NewQuadric() | |
313 | GLU::QuadricDrawStyle(quad, GLU::FILL) | |
314 | GL::PushMatrix() | |
315 | GL::Rotate(-90, 1, 0, 0) | |
316 | GLU::Cylinder(quad, @radius, 0, @height, @slices, @stacks) | |
317 | GLU::QuadricOrientation(quad, GLU::INSIDE) | |
318 | GLU::Disk(quad, 0, @radius, @slices, @loops) | |
319 | GLU::DeleteQuadric(quad) | |
320 | GL::PopMatrix() | |
318 | quad = gluNewQuadric() | |
319 | gluQuadricDrawStyle(quad, GLU_FILL) | |
320 | glPushMatrix() | |
321 | glRotated(-90, 1, 0, 0) | |
322 | gluCylinder(quad, @radius, 0, @height, @slices, @stacks) | |
323 | gluQuadricOrientation(quad, GLU_INSIDE) | |
324 | gluDisk(quad, 0, @radius, @slices, @loops) | |
325 | gluDeleteQuadric(quad) | |
326 | glPopMatrix() | |
321 | 327 | end |
322 | 328 | end |
323 | 329 | |
325 | 331 | # OpenGL cylinder object |
326 | 332 | # |
327 | 333 | class FXGLCylinder < FXGLShape |
334 | include OpenGL | |
335 | include GLU | |
336 | ||
328 | 337 | # Cylinder fidelity |
329 | 338 | SLICES_NUMBER = 20 |
330 | 339 | STACKS_NUMBER = 20 |
364 | 373 | # |
365 | 374 | def initialize(*args) |
366 | 375 | if args.length == 5 |
367 | super(args[0], args[1], args[2], SHADING_SMOOTH|STYLE_SURFACE) | |
376 | super(args[0], args[1], args[2], SHADING_SMOOTH|STYLE_SURFACE) | |
368 | 377 | else |
369 | super(args[0], args[1], args[2], SHADING_SMOOTH|STYLE_SURFACE, | |
378 | super(args[0], args[1], args[2], SHADING_SMOOTH|STYLE_SURFACE, | |
370 | 379 | args[5], args[5]) |
371 | 380 | end |
372 | 381 | @height = args[3] ? args[3] : 1.0 |
381 | 390 | # Draw this cylinder into _viewer_ (an FXGLViewer instance). |
382 | 391 | # |
383 | 392 | def drawshape(viewer) |
384 | quad = GLU::NewQuadric() | |
385 | GLU::QuadricDrawStyle(quad, GLU::FILL) | |
386 | GL::PushMatrix() | |
387 | GL::Rotate(-90, 1, 0, 0) | |
388 | GLU::Cylinder(quad, @radius, @radius, @height, @slices, @stacks) | |
389 | GLU::QuadricOrientation(quad, GLU::INSIDE) | |
390 | GLU::Disk(quad, 0, @radius, @slices, @loops) | |
391 | GL::Translate(0, 0, @height) | |
392 | GLU::QuadricOrientation(quad, GLU::OUTSIDE) | |
393 | GLU::Disk(quad, 0, @radius, @slices, @loops) | |
394 | GL::PopMatrix() | |
395 | GLU::DeleteQuadric(quad) | |
393 | quad = gluNewQuadric() | |
394 | gluQuadricDrawStyle(quad, GLU_FILL) | |
395 | glPushMatrix() | |
396 | glRotated(-90, 1, 0, 0) | |
397 | gluCylinder(quad, @radius, @radius, @height, @slices, @stacks) | |
398 | gluQuadricOrientation(quad, GLU_INSIDE) | |
399 | gluDisk(quad, 0, @radius, @slices, @loops) | |
400 | glTranslated(0, 0, @height) | |
401 | gluQuadricOrientation(quad, GLU_OUTSIDE) | |
402 | gluDisk(quad, 0, @radius, @slices, @loops) | |
403 | glPopMatrix() | |
404 | gluDeleteQuadric(quad) | |
396 | 405 | end |
397 | 406 | end |
398 | 407 | |
400 | 409 | # OpenGL sphere object |
401 | 410 | # |
402 | 411 | class FXGLSphere < FXGLShape |
412 | include OpenGL | |
413 | include GLU | |
414 | ||
403 | 415 | # Sphere fidelity |
404 | 416 | SLICES_NUMBER = 20 |
405 | 417 | STACKS_NUMBER = 20 |
447 | 459 | # Draw this sphere into _viewer_ (an FXGLViewer instance). |
448 | 460 | # |
449 | 461 | def drawshape(viewer) |
450 | quad = GLU::NewQuadric() | |
451 | GLU::QuadricDrawStyle(quad, GLU::FILL) | |
452 | GLU::Sphere(quad, @radius, @slices, @stacks) | |
453 | GLU::DeleteQuadric(quad) | |
462 | quad = gluNewQuadric() | |
463 | gluQuadricDrawStyle(quad, GLU_FILL) | |
464 | gluSphere(quad, @radius, @slices, @stacks) | |
465 | gluDeleteQuadric(quad) | |
454 | 466 | end |
455 | 467 | end |
456 | 468 | end |
4 | 4 | alias addInputOrig addInput # :nodoc: |
5 | 5 | |
6 | 6 | # |
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. | |
11 | 14 | # |
12 | 15 | # There are several forms for #addInput; the original form (from FOX) |
13 | 16 | # takes four arguments: |
29 | 32 | # ... handle the I/O event ... |
30 | 33 | # } |
31 | 34 | # |
32 | ||
33 | def addInput(fd, mode, *args, &block) | |
35 | def addInput(io, mode, *args, &block) | |
34 | 36 | params = {} |
35 | 37 | params = args.pop if args.last.is_a? Hash |
36 | 38 | tgt, sel = nil, 0 |
50 | 52 | tgt.pconnect(SEL_IO_WRITE, block, params) |
51 | 53 | tgt.pconnect(SEL_IO_EXCEPT, block, params) |
52 | 54 | end |
53 | addInputOrig(fd, mode, tgt, sel) | |
55 | addInputOrig(io, mode, tgt, sel) | |
54 | 56 | end |
55 | 57 | |
56 | 58 | end # class FXApp |
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 |
343 | 343 | |
344 | 344 | def onUpdUndo(sender, sel, ptr) # :nodoc: |
345 | 345 | 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) | |
349 | 349 | end |
350 | 350 | return 1 |
351 | 351 | end |
357 | 357 | |
358 | 358 | def onUpdRedo(sender, sel, ptr) # :nodoc: |
359 | 359 | 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) | |
363 | 363 | end |
364 | 364 | return 1 |
365 | 365 | end |
371 | 371 | |
372 | 372 | def onUpdClear(sender, sel, ptr) # :nodoc: |
373 | 373 | 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) | |
377 | 377 | end |
378 | 378 | return 1 |
379 | 379 | end |
385 | 385 | |
386 | 386 | def onUpdRevert(sender, sel, ptr) # :nodoc: |
387 | 387 | 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) | |
391 | 391 | end |
392 | 392 | return 1 |
393 | 393 | end |
5 | 5 | major_minor = RUBY_VERSION[ /^(\d+\.\d+)/ ] or |
6 | 6 | raise "Oops, can't extract the major/minor version from #{RUBY_VERSION.dump}" |
7 | 7 | |
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 | |
13 | 28 | else |
14 | 29 | raise |
15 | 30 | end |
27 | 42 | require "fox16/version" |
28 | 43 | require "fox16/kwargs" |
29 | 44 | require "fox16/exceptions_for_fxerror" |
45 | require "fox16/thread" |
537 | 537 | |
538 | 538 | # Check to see if multithreaded applications are supported |
539 | 539 | 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 | |
540 | 545 | end |
541 | 546 | end |
76 | 76 | # even support no OpenGL at all! This function returns the lesser |
77 | 77 | # of the client support level and the display server support level. |
78 | 78 | # |
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 | # | |
79 | 87 | def FXGLVisual.supported?(app); end |
80 | 88 | |
81 | 89 | # Return +true+ if double-buffered |
266 | 266 | # after the item is appended. |
267 | 267 | def appendItem(text, bigIcon=nil, miniIcon=nil, data=nil, notify=false); end |
268 | 268 | |
269 | alias << appendItem | |
270 | ||
269 | 271 | # Prepend a new (possibly subclassed) _item_ to the beginning of the list. |
270 | 272 | # If _notify_ is +true+, a +SEL_INSERTED+ message is sent to the list's message target |
271 | 273 | # after the item is prepended. |
29 | 29 | # Destroy resource. |
30 | 30 | # |
31 | 31 | 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 | |
32 | 37 | end |
33 | 38 | end |
44 | 44 | # [deprecated] Pixel data {FXMemoryBuffer} |
45 | 45 | attr_reader :data |
46 | 46 | |
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 | ||
47 | 52 | # Array of colors of all image pixels. Can also be written as String of raw [RGBA] values. |
48 | 53 | attr_accessor :pixels |
49 | 54 |
216 | 216 | # Returns the integer index of the newly appended item. |
217 | 217 | def appendItem(text, icon=nil, data=nil, notify=false) ; end |
218 | 218 | |
219 | alias << appendItem | |
220 | ||
219 | 221 | # Prepend a (possibly subclassed) _item_ to the list, e.g. |
220 | 222 | # |
221 | 223 | # list.prependItem(FXListItem.new("clyde")) |
185 | 185 | # Sort items using current sort function |
186 | 186 | def sortItems; end |
187 | 187 | |
188 | alias appendItem << | |
188 | alias << appendItem | |
189 | 189 | end |
190 | 190 | end |
435 | 435 | # |
436 | 436 | # Search for _string_ in text buffer, and return the extent of |
437 | 437 | # 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. | |
440 | 440 | # The search starts from the given |
441 | 441 | # _start_ position, scans forward (+SEARCH_FORWARD+) or backward |
442 | 442 | # (+SEARCH_BACKWARD+), and wraps around if +SEARCH_WRAP+ has been |
444 | 444 | # case insensitive search (+SEARCH_IGNORECASE+), or regular expression |
445 | 445 | # search (+SEARCH_REGEX+). |
446 | 446 | # |
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 | # | |
447 | 449 | def findText(string, start=0, flags=SEARCH_FORWARD|SEARCH_WRAP|SEARCH_EXACT); end |
448 | 450 | |
449 | 451 | # Return +true+ if position _pos_ is selected |
356 | 356 | */ |
357 | 357 | bool addInput(VALUE obj,FXuint mode,FXObject *tgt,FXSelector sel){ |
358 | 358 | 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); | |
371 | 366 | } |
372 | 367 | return true; |
373 | 368 | } |
378 | 373 | */ |
379 | 374 | bool removeInput(VALUE obj,FXuint mode){ |
380 | 375 | 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); | |
393 | 385 | } |
394 | 386 | return true; |
395 | 387 | } |
400 | 392 | |
401 | 393 | /// Peek to determine if there's an event |
402 | 394 | 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); | |
459 | 395 | |
460 | 396 | /// True if the window is modal |
461 | 397 | bool isModal(FXWindow* window) const; |
40 | 40 | * of the client support level and the display server support level. |
41 | 41 | */ |
42 | 42 | %extend { |
43 | static FXbool supported(FXApp* application){ | |
43 | static VALUE supported(FXApp* application){ | |
44 | 44 | int major,minor; |
45 | 45 | FXbool answer=FXGLVisual::supported(application,major,minor); |
46 | 46 | return rb_ary_new3(3,answer?Qtrue:Qfalse,INT2NUM(major),INT2NUM(minor)); |
57 | 57 | FXImage(FXApp* a,VALUE string_or_ary=Qnil,FXuint opts=0,FXint w=1,FXint h=1){ |
58 | 58 | FXColor* pix=0; |
59 | 59 | if(!NIL_P(string_or_ary)){ |
60 | FXuint len=FXRbNumberOfFXColors(string_or_ary); | |
60 | FXint len=FXRbNumberOfFXColors(string_or_ary); | |
61 | 61 | if(w*h != len){ |
62 | 62 | rb_raise( rb_eArgError, "Array size does not match image size" ); |
63 | 63 | } |
74 | 74 | else{ |
75 | 75 | return 0; |
76 | 76 | } |
77 | } | |
78 | ||
79 | /// Get a pointer to the pixel data | |
80 | VALUE getDataPtr() const { | |
81 | return ULL2NUM((uintptr_t)self->getData()); | |
77 | 82 | } |
78 | 83 | } |
79 | 84 | |
91 | 96 | * This can be done by calling render(). |
92 | 97 | */ |
93 | 98 | 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); | |
95 | 100 | 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)){ | |
97 | 102 | rb_raise( rb_eArgError, "Array size does not match image size" ); |
98 | 103 | } |
99 | 104 | |
110 | 115 | if (data) { |
111 | 116 | FXuint size = self->getWidth()*self->getHeight(); |
112 | 117 | VALUE ary = rb_ary_new2(size); |
113 | for (int i = 0; i < size; i++) | |
118 | for (FXuint i = 0; i < size; i++) | |
114 | 119 | rb_ary_store(ary, i, UINT2NUM(data[i])); |
115 | 120 | return ary; |
116 | 121 | } else { |
26 | 26 | class FXMemoryBuffer { |
27 | 27 | public: |
28 | 28 | // Create an memory buffer object |
29 | FXMemoryBuffer(FXColor *data,FXuint size); | |
29 | FXMemoryBuffer(FXColor *data,FXint size); | |
30 | 30 | |
31 | 31 | // Returns the size (in bytes) |
32 | 32 | FXuint getSize() const; |
33 | 33 | |
34 | 34 | %extend { |
35 | // Returns the data as an array of Bignums | |
35 | // Returns the data as an array of Integers | |
36 | 36 | VALUE getData() const { |
37 | 37 | FXColor* data = self->getData(); |
38 | 38 | if (data) { |
39 | 39 | FXuint size = self->getSize(); |
40 | 40 | VALUE ary = rb_ary_new2(size); |
41 | for (int i = 0; i < size; i++) | |
41 | for (FXuint i = 0; i < size; i++) | |
42 | 42 | rb_ary_store(ary, i, UINT2NUM(data[i])); |
43 | 43 | return ary; |
44 | 44 | } |
518 | 518 | |
519 | 519 | %extend { |
520 | 520 | /** |
521 | * TODO: Change API to return [beg, end] instead of [[beg], [end]] for non regex. | |
522 | * | |
521 | 523 | * Search for string in text buffer, returning the extent of |
522 | 524 | * the string in beg and end. The search starts from the given |
523 | 525 | * starting position, scans forward (SEARCH_FORWARD) or backward |
535 | 537 | FXint* beg; |
536 | 538 | FXint* end; |
537 | 539 | 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? | |
539 | 541 | if(!FXMALLOC(&beg,FXint,ngroups)){ |
540 | 542 | return Qnil; |
541 | } | |
543 | } | |
542 | 544 | if(!FXMALLOC(&end,FXint,ngroups)){ |
543 | 545 | FXFREE(&beg); |
544 | return Qnil; | |
545 | } | |
546 | return Qnil; | |
547 | } | |
546 | 548 | if(self->findText(string,beg,end,start,flags,ngroups)){ |
547 | 549 | 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 | } | |
551 | 553 | FXFREE(&beg); |
552 | 554 | FXFREE(&end); |
553 | 555 | return ary; |
554 | } | |
556 | } | |
555 | 557 | } |
556 | 558 | |
557 | 559 | /// Return TRUE if position pos is selected |
19 | 19 | * at "[email protected]". |
20 | 20 | ***********************************************************************/ |
21 | 21 | |
22 | %naturalvar FXVec2d; | |
22 | 23 | /// Double-precision 2-element vector |
23 | 24 | class FXVec2d { |
24 | 25 | public: |
19 | 19 | * at "[email protected]". |
20 | 20 | ***********************************************************************/ |
21 | 21 | |
22 | %naturalvar FXVec2f; | |
22 | 23 | /// Single-precision 2-element vector |
23 | 24 | class FXVec2f { |
24 | 25 | public: |
19 | 19 | * at "[email protected]". |
20 | 20 | ***********************************************************************/ |
21 | 21 | |
22 | %naturalvar FXVec3d; | |
22 | 23 | /// Double-precision 3-element vector |
23 | 24 | class FXVec3d { |
24 | 25 | public: |
19 | 19 | * at "[email protected]". |
20 | 20 | ***********************************************************************/ |
21 | 21 | |
22 | %naturalvar FXVec3f; | |
22 | 23 | /// Single-precision 3-element vector |
23 | 24 | class FXVec3f { |
24 | 25 | public: |
20 | 20 | ***********************************************************************/ |
21 | 21 | |
22 | 22 | %rename("crosses?") FXVec4d::crosses(const FXVec3d& a,const FXVec3d& b) const; |
23 | %naturalvar FXVec4d; | |
23 | 24 | |
24 | 25 | /// Double-precision 4-element vector |
25 | 26 | class FXVec4d { |
20 | 20 | ***********************************************************************/ |
21 | 21 | |
22 | 22 | %rename("crosses?") FXVec4f::crosses(const FXVec3f& a,const FXVec3f& b) const; |
23 | %naturalvar FXVec4f; | |
23 | 24 | |
24 | 25 | /// Single-precision 4-element vector |
25 | 26 | class FXVec4f { |
31 | 31 | virtual void detach(); |
32 | 32 | |
33 | 33 | /** |
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 | /** | |
34 | 90 | * Initialize application. |
35 | 91 | * Parses and removes common command line arguments, reads the registry. |
36 | 92 | * Finally, if connect is TRUE, it opens the display. |
1108 | 1164 | |
1109 | 1165 | %define DECLARE_FXTEXT_VIRTUALS(klass) |
1110 | 1166 | %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 | ||
1111 | 1176 | virtual void setCursorPos(FXint pos,FXbool notify=FALSE); |
1112 | 1177 | virtual FXbool extendSelection(FXint pos,FXTextSelectionMode mode=SELECT_CHARS,FXbool notify=FALSE); |
1113 | 1178 | virtual FXbool killSelection(FXbool notify=FALSE); |
492 | 492 | %typemap(out) FXVec2f* "$result = FXRbGetRubyObj($1, \"$1_ltype\");"; |
493 | 493 | %typemap(out) FXVec2f& "$result = FXRbGetRubyObj($1, \"$1_ltype\");"; |
494 | 494 | |
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 | ||
495 | 506 | /* Output typemap for FXVec4f instances */ |
496 | 507 | %typemap(out) FXVec4f { |
497 | 508 | FXVec4f* resultptr = new FXVec4f($1); |
498 | 509 | $result = FXRbGetRubyObj(resultptr, "FXVec4f *"); |
499 | 510 | } |
500 | 511 | %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 | } | |
502 | 516 | |
503 | 517 | /* Output typemap for FXIcon instances */ |
504 | 518 | %typemap(out) FXIcon * = FXObject *; |
608 | 622 | |
609 | 623 | /* Output typemap for FXTreeItem instances */ |
610 | 624 | %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\");"; | |
619 | 625 | |
620 | 626 | /* Output typemap for FXVerticalFrame instances */ |
621 | 627 | %typemap(out) FXVerticalFrame * = FXObject *; |
708 | 714 | $2 = RSTRING_LEN($input); |
709 | 715 | } |
710 | 716 | |
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 | |
712 | 718 | %typemap(in) (const FXchar* dashpattern, FXuint dashlength) { |
713 | 719 | Check_Type($input, T_ARRAY); |
714 | 720 | $1 = new FXchar[RARRAY_LEN($input)]; |
756 | 762 | */ |
757 | 763 | |
758 | 764 | %typemap(in) FXWindow* TOOLBAR_DOCK_AFTER { |
759 | if (TYPE($input) == T_FIXNUM) { | |
765 | if (TYPE($input) == T_FIXNUM || TYPE($input) == T_BIGNUM)) { | |
760 | 766 | $1 = reinterpret_cast<FXWindow *>(static_cast<long>(NUM2INT($input))); |
761 | 767 | } else { |
762 | 768 | SWIG_ConvertPtr($input, (void **) &$1, SWIGTYPE_p_FXWindow, 1); |
6 | 6 | include Fox |
7 | 7 | |
8 | 8 | def test_exception_for_second_app |
9 | app = FXApp.new | |
10 | mainWindow = FXMainWindow.new(app, "") | |
11 | app.create | |
12 | 9 | assert_raise RuntimeError do |
13 | app2 = FXApp.new | |
10 | FXApp.new | |
14 | 11 | end |
15 | 12 | end |
16 | 13 | end |
32 | 29 | app.removeInput(pipe_wr, INPUT_WRITE) |
33 | 30 | |
34 | 31 | 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) | |
39 | 41 | end |
40 | app.run | |
41 | assert data_sent, "the read input event shouldn't fire before some data is available" | |
42 | ||
43 | 42 | app.removeInput(pipe_rd, INPUT_READ) |
44 | 43 | pipe_wr.close |
45 | 44 | pipe_rd.close unless pipe_rd.closed? |
46 | 45 | end |
47 | 46 | |
48 | 47 | 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 | |
50 | 66 | end |
51 | 67 | |
52 | 68 | def test_addInput_on_socket |
59 | 75 | end |
60 | 76 | |
61 | 77 | def test_addInput_on_popen |
78 | pend "addInput on IO.popen object isn't supported on Windows" if RUBY_PLATFORM=~/mingw|mswin/i | |
62 | 79 | pipe_rdwr = IO.popen("cat", "r+") |
63 | 80 | check_events pipe_rdwr, pipe_rdwr |
64 | 81 | 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 | |
65 | 117 | end |
25 | 25 | |
26 | 26 | def testStyle |
27 | 27 | assert(@button.buttonStyle) |
28 | assert_instance_of(Fixnum, @button.buttonStyle) | |
28 | assert_kind_of(Integer, @button.buttonStyle) | |
29 | 29 | |
30 | 30 | @button.buttonStyle |= BUTTON_AUTOGRAY |
31 | 31 | assert((@button.buttonStyle & BUTTON_AUTOGRAY) != 0) |
55 | 55 | |
56 | 56 | def testState |
57 | 57 | assert(@button.state) |
58 | assert_kind_of(Fixnum, @button.state) | |
58 | assert_kind_of(Integer, @button.state) | |
59 | 59 | |
60 | 60 | @button.state = STATE_UP |
61 | 61 | assert_equal(STATE_UP, @button.state) |
11 | 11 | |
12 | 12 | def test_setCheck_TRUE |
13 | 13 | @checkButton.check = Fox::TRUE |
14 | assert_equal(true, @checkButton.check) | |
15 | 14 | assert_equal(Fox::TRUE, @checkButton.checkState) |
16 | 15 | assert(@checkButton.checked?) |
17 | 16 | assert([email protected]?) |
20 | 19 | |
21 | 20 | def test_setCheck_FALSE |
22 | 21 | @checkButton.check = Fox::FALSE |
23 | assert_equal(false, @checkButton.check) | |
24 | 22 | assert_equal(Fox::FALSE, @checkButton.checkState) |
25 | 23 | assert([email protected]?) |
26 | 24 | assert(@checkButton.unchecked?) |
29 | 27 | |
30 | 28 | def test_setCheck_MAYBE |
31 | 29 | @checkButton.check = Fox::MAYBE |
32 | assert_equal(true, @checkButton.check) # this is not a typo! | |
33 | 30 | assert_equal(Fox::MAYBE, @checkButton.checkState) |
34 | 31 | assert([email protected]?) |
35 | 32 | assert([email protected]?) |
38 | 35 | |
39 | 36 | def test_setCheck_true |
40 | 37 | @checkButton.check = true |
41 | assert_equal(true, @checkButton.check) | |
42 | 38 | assert_equal(Fox::TRUE, @checkButton.checkState) |
43 | 39 | assert(@checkButton.checked?) |
44 | 40 | assert([email protected]?) |
47 | 43 | |
48 | 44 | def test_setCheck_false |
49 | 45 | @checkButton.check = false |
50 | assert_equal(false, @checkButton.check) | |
51 | 46 | assert_equal(Fox::FALSE, @checkButton.checkState) |
52 | 47 | assert([email protected]?) |
53 | 48 | assert(@checkButton.unchecked?) |
94 | 94 | end |
95 | 95 | |
96 | 96 | def teardown |
97 | if File.exists?("output.ps") | |
97 | if File.exist?("output.ps") | |
98 | 98 | FileUtils.rm_f("output.ps") |
99 | 99 | end |
100 | 100 | end |
61 | 61 | FXFileStream.open("non_existing_file", FXStreamLoad) { |s| } |
62 | 62 | } |
63 | 63 | |
64 | pend "chmod isn't supported on Windows" if RUBY_PLATFORM=~/mingw|mswin/i | |
65 | ||
64 | 66 | # Write-only file (i.e. no read permissions) |
65 | 67 | tf = Tempfile.new("write_only_file") |
66 | 68 | tf.puts("junk") |
81 | 83 | end |
82 | 84 | |
83 | 85 | def teardown |
84 | if File.exists?("goobers") | |
86 | if File.exist?("goobers") | |
85 | 87 | FileUtils.rm_f("goobers") |
86 | 88 | end |
87 | 89 | end |
14 | 14 | |
15 | 15 | def testConstructFromFontDescription |
16 | 16 | fontdesc = @app.normalFont.fontDesc |
17 | font = FXFont.new(@app, fontdesc) | |
17 | FXFont.new(@app, fontdesc) | |
18 | 18 | end |
19 | 19 | |
20 | 20 | def testConstructFromParameters |
41 | 41 | end |
42 | 42 | |
43 | 43 | def testConstructFromFontString |
44 | font = FXFont.new(@app, "") | |
44 | FXFont.new(@app, "") | |
45 | 45 | end |
46 | 46 | |
47 | 47 | def testGetTextWidthAndHeight |
11 | 11 | end |
12 | 12 | |
13 | 13 | 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" | |
15 | 22 | end |
16 | 23 | |
17 | 24 | def test_nil_app_raises_argument_error |
21 | 21 | |
22 | 22 | def test_getArrowDir |
23 | 23 | @header.appendItem("") |
24 | assert_instance_of(Fixnum, @header.getArrowDir(0)) | |
24 | assert_kind_of(Integer, @header.getArrowDir(0)) | |
25 | 25 | end |
26 | 26 | |
27 | 27 | def test_arrowUp? |
10 | 10 | |
11 | 11 | def test_created? |
12 | 12 | assert !mainWindow.created? |
13 | app.create | |
13 | mainWindow.create | |
14 | 14 | assert mainWindow.created?, "main window should be created after call to FXApp#create" |
15 | 15 | mainWindow.destroy |
16 | 16 | assert !mainWindow.created? |
0 | 0 | require 'test/unit' |
1 | 1 | require 'testcase' |
2 | 2 | require 'fox16' |
3 | require 'fiddle' | |
3 | 4 | |
4 | 5 | class TC_FXImage < Fox::TestCase |
5 | 6 | include Fox |
79 | 80 | assert_equal("rgbaRGBA", img.pixel_string) |
80 | 81 | end |
81 | 82 | |
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 | ||
82 | 90 | def test_create |
83 | 91 | # |
84 | 92 | # If the image owns its pixel data and IMAGE_KEEP was not specified, |
118 | 126 | def test_create_with_non_owned_data |
119 | 127 | GC.stress = true |
120 | 128 | img = image_with_non_owned_data |
121 | " " * 10000 | |
129 | _ = " " * 10000 | |
122 | 130 | GC.stress = false |
123 | 131 | assert_equal("rgbaRGBA", img.pixel_string) |
124 | 132 | assert_equal(0, img.options) |
133 | 141 | img = FXImage.new(app, nil, 0, 1, 2) |
134 | 142 | GC.stress = true |
135 | 143 | set_non_owned_data(img) |
136 | " " * 10000 | |
144 | _ = " " * 10000 | |
137 | 145 | GC.stress = false |
138 | 146 | assert_equal("rgbaRGBA", img.pixel_string) |
139 | 147 | 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 |
45 | 45 | |
46 | 46 | def test_appendItem_byText |
47 | 47 | assert_equal(0, @list.numItems) |
48 | itemIndex = @list.appendItem("") | |
48 | assert_equal 0, @list.appendItem("") | |
49 | 49 | assert_equal(1, @list.numItems) |
50 | itemIndex = @list.appendItem("anItem") | |
50 | assert_equal 1, @list.appendItem("anItem") | |
51 | 51 | assert_equal(2, @list.numItems) |
52 | itemIndex = @list.appendItem("anItem", nil) | |
52 | assert_equal 2, @list.appendItem("anItem", nil) | |
53 | 53 | assert_equal(3, @list.numItems) |
54 | itemIndex = @list.appendItem("anItem", nil, "someData") | |
54 | assert_equal 3, @list.appendItem("anItem", nil, "someData") | |
55 | 55 | assert_equal(4, @list.numItems) |
56 | itemIndex = @list.appendItem("anItem", nil, "someData", true) | |
56 | assert_equal 4, @list.appendItem("anItem", nil, "someData", true) | |
57 | 57 | assert_equal(5, @list.numItems) |
58 | itemIndex = @list.appendItem("anItem", nil, "someData", false) | |
58 | assert_equal 5, @list.appendItem("anItem", nil, "someData", false) | |
59 | 59 | assert_equal(6, @list.numItems) |
60 | 60 | assert_raises(ArgumentError) do |
61 | 61 | @list.appendItem("anItem", nil, "someData", 42) # last argument must be true or false |
102 | 102 | end |
103 | 103 | |
104 | 104 | def test_makeItemVisible |
105 | items = [] | |
106 | 105 | 0.upto(2) { |i| |
107 | items << @list.appendItem("item#{i}") | |
106 | itemIndex = @list.appendItem("item#{i}") | |
107 | assert_equal i, itemIndex | |
108 | 108 | } |
109 | 109 | assert_raises(IndexError) { |
110 | 110 | @list.makeItemVisible(-1) |
10 | 10 | end |
11 | 11 | |
12 | 12 | def test_non_created_app_raises_runtime_error |
13 | pend "two FXApp are not allowed" | |
13 | 14 | app = FXApp.new |
14 | 15 | assert_raise RuntimeError do |
15 | 16 | FXMainWindow.new(app, "title").create |
80 | 80 | def test_mul_by_scalar |
81 | 81 | p = FXMat4f.new.eye |
82 | 82 | 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) | |
86 | 86 | r = p*4.0 |
87 | 87 | assert_instance_of(FXMat4f, r) |
88 | 88 | # assert_equal(q, r) |
47 | 47 | assert_in_delta(0.7, @mat.emission[2], DELTA) |
48 | 48 | assert_in_delta(0.8, @mat.emission[3], DELTA) |
49 | 49 | |
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) | |
51 | 51 | assert_in_delta(0.5, @mat.emission[0], DELTA) |
52 | 52 | assert_in_delta(0.6, @mat.emission[1], DELTA) |
53 | 53 | assert_in_delta(0.7, @mat.emission[2], DELTA) |
11 | 11 | |
12 | 12 | def test_setCheck_TRUE |
13 | 13 | @menuCheck.check = Fox::TRUE |
14 | assert_equal(true, @menuCheck.check) | |
15 | 14 | assert_equal(Fox::TRUE, @menuCheck.checkState) |
16 | 15 | assert(@menuCheck.checked?) |
17 | 16 | assert([email protected]?) |
20 | 19 | |
21 | 20 | def test_setCheck_FALSE |
22 | 21 | @menuCheck.check = Fox::FALSE |
23 | assert_equal(false, @menuCheck.check) | |
24 | 22 | assert_equal(Fox::FALSE, @menuCheck.checkState) |
25 | 23 | assert([email protected]?) |
26 | 24 | assert(@menuCheck.unchecked?) |
29 | 27 | |
30 | 28 | def test_setCheck_MAYBE |
31 | 29 | @menuCheck.check = Fox::MAYBE |
32 | assert_equal(true, @menuCheck.check) # this is not a typo! | |
33 | 30 | assert_equal(Fox::MAYBE, @menuCheck.checkState) |
34 | 31 | assert([email protected]?) |
35 | 32 | assert([email protected]?) |
38 | 35 | |
39 | 36 | def test_setCheck_true |
40 | 37 | @menuCheck.check = true |
41 | assert_equal(true, @menuCheck.check) | |
42 | 38 | assert_equal(Fox::TRUE, @menuCheck.checkState) |
43 | 39 | assert(@menuCheck.checked?) |
44 | 40 | assert([email protected]?) |
47 | 43 | |
48 | 44 | def test_setCheck_false |
49 | 45 | @menuCheck.check = false |
50 | assert_equal(false, @menuCheck.check) | |
51 | 46 | assert_equal(Fox::FALSE, @menuCheck.checkState) |
52 | 47 | assert([email protected]?) |
53 | 48 | assert(@menuCheck.unchecked?) |
11 | 11 | |
12 | 12 | def test_setCheck_TRUE |
13 | 13 | @menuRadio.check = Fox::TRUE |
14 | assert_equal(true, @menuRadio.check) | |
15 | 14 | assert_equal(Fox::TRUE, @menuRadio.checkState) |
16 | 15 | assert(@menuRadio.checked?) |
17 | 16 | assert([email protected]?) |
20 | 19 | |
21 | 20 | def test_setCheck_FALSE |
22 | 21 | @menuRadio.check = Fox::FALSE |
23 | assert_equal(false, @menuRadio.check) | |
24 | 22 | assert_equal(Fox::FALSE, @menuRadio.checkState) |
25 | 23 | assert([email protected]?) |
26 | 24 | assert(@menuRadio.unchecked?) |
29 | 27 | |
30 | 28 | def test_setCheck_MAYBE |
31 | 29 | @menuRadio.check = Fox::MAYBE |
32 | assert_equal(true, @menuRadio.check) # this is not a typo! | |
33 | 30 | assert_equal(Fox::MAYBE, @menuRadio.checkState) |
34 | 31 | assert([email protected]?) |
35 | 32 | assert([email protected]?) |
38 | 35 | |
39 | 36 | def test_setCheck_true |
40 | 37 | @menuRadio.check = true |
41 | assert_equal(true, @menuRadio.check) | |
42 | 38 | assert_equal(Fox::TRUE, @menuRadio.checkState) |
43 | 39 | assert(@menuRadio.checked?) |
44 | 40 | assert([email protected]?) |
47 | 43 | |
48 | 44 | def test_setCheck_false |
49 | 45 | @menuRadio.check = false |
50 | assert_equal(false, @menuRadio.check) | |
51 | 46 | assert_equal(Fox::FALSE, @menuRadio.checkState) |
52 | 47 | assert([email protected]?) |
53 | 48 | assert(@menuRadio.unchecked?) |
8 | 8 | end |
9 | 9 | |
10 | 10 | def test_default_constructor |
11 | q = FXQuatf.new | |
11 | FXQuatf.new | |
12 | 12 | end |
13 | 13 | |
14 | 14 | def test_construct_from_axis_and_angle |
15 | 15 | 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) | |
18 | 18 | end |
19 | 19 | |
20 | 20 | def test_construct_from_components |
21 | 21 | 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) | |
23 | 23 | end |
24 | 24 | |
25 | 25 | def test_construct_from_roll_pitch_yaw |
26 | 26 | roll, pitch, yaw = 45.0, 45.0, 45.0 |
27 | q = FXQuatf.new(roll, pitch, yaw) | |
27 | FXQuatf.new(roll, pitch, yaw) | |
28 | 28 | end |
29 | 29 | |
30 | 30 | def test_adjust! |
11 | 11 | |
12 | 12 | def test_setCheck_TRUE |
13 | 13 | @radioButton.check = Fox::TRUE |
14 | assert_equal(true, @radioButton.check) | |
15 | 14 | assert_equal(Fox::TRUE, @radioButton.checkState) |
16 | 15 | assert(@radioButton.checked?) |
17 | 16 | assert([email protected]?) |
20 | 19 | |
21 | 20 | def test_setCheck_FALSE |
22 | 21 | @radioButton.check = Fox::FALSE |
23 | assert_equal(false, @radioButton.check) | |
24 | 22 | assert_equal(Fox::FALSE, @radioButton.checkState) |
25 | 23 | assert([email protected]?) |
26 | 24 | assert(@radioButton.unchecked?) |
29 | 27 | |
30 | 28 | def test_setCheck_MAYBE |
31 | 29 | @radioButton.check = Fox::MAYBE |
32 | assert_equal(true, @radioButton.check) # this is not a typo! | |
33 | 30 | assert_equal(Fox::MAYBE, @radioButton.checkState) |
34 | 31 | assert([email protected]?) |
35 | 32 | assert([email protected]?) |
38 | 35 | |
39 | 36 | def test_setCheck_true |
40 | 37 | @radioButton.check = true |
41 | assert_equal(true, @radioButton.check) | |
42 | 38 | assert_equal(Fox::TRUE, @radioButton.checkState) |
43 | 39 | assert(@radioButton.checked?) |
44 | 40 | assert([email protected]?) |
47 | 43 | |
48 | 44 | def test_setCheck_false |
49 | 45 | @radioButton.check = false |
50 | assert_equal(false, @radioButton.check) | |
51 | 46 | assert_equal(Fox::FALSE, @radioButton.checkState) |
52 | 47 | assert([email protected]?) |
53 | 48 | assert(@radioButton.unchecked?) |
16 | 16 | FXPoint.new(100, 100), |
17 | 17 | FXPoint.new(0, 0) |
18 | 18 | ] |
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) | |
22 | 22 | end |
23 | 23 | |
24 | 24 | def test_copy_constructor |
21 | 21 | def test_new |
22 | 22 | # Free-floating |
23 | 23 | shell1 = FXShell.new(@app, 0, 0, 0, 0, 0) |
24 | assert_nil(shell1.owner) | |
24 | 25 | |
25 | 26 | # Owned |
26 | 27 | shell2 = FXShell.new(@mainWin, 0, 0, 0, 0, 0) |
75 | 75 | clearEdges(extending) |
76 | 76 | |
77 | 77 | old_nr = @table.numRows |
78 | old_nc = @table.numColumns | |
78 | _old_nc = @table.numColumns | |
79 | 79 | |
80 | 80 | # resize the table |
81 | 81 | nr = @data_lines.size + 2 |
86 | 86 | assert_equal([10], endIndex) |
87 | 87 | end |
88 | 88 | |
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 | ||
89 | 96 | def test_find_text_with_groups |
90 | 97 | @text.text = "I came, I saw, I conquered" |
91 | 98 | startIndex, endIndex = @text.findText("I ([a-z]+)(, )?", 0, SEARCH_REGEX) |
92 | 99 | assert_equal([0, 2, 6], startIndex) |
93 | 100 | 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 | |
94 | 113 | end |
95 | 114 | |
96 | 115 | if ''.respond_to?(:encoding) |
66 | 66 | @treeList.connect(SEL_INSERTED) { |sender, sel, ptr| |
67 | 67 | anItem = ptr |
68 | 68 | } |
69 | theItem = @treeList.appendItem(nil, "", nil, nil, nil, true) | |
69 | theItem = @treeList.appendItem(nil, FXTreeItem.new(""), true) | |
70 | 70 | assert_same(theItem, anItem) |
71 | 71 | end |
72 | 72 | |
73 | 73 | def test_SEL_DELETED |
74 | theItem = @treeList.appendItem(nil, "") | |
74 | theItem = @treeList.appendItem(nil, FXTreeItem.new("")) | |
75 | 75 | anItem = nil |
76 | 76 | @treeList.connect(SEL_DELETED) { |sender, sel, ptr| |
77 | 77 | anItem = ptr |
4 | 4 | class TC_FXVec4f < Test::Unit::TestCase |
5 | 5 | include Fox |
6 | 6 | |
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 | |
7 | 21 | |
8 | 22 | def test_new |
9 | 23 | FXVec4f.new |
38 | 52 | end |
39 | 53 | |
40 | 54 | def test_new5 |
41 | c = FXVec4f.new(FXRGB(128, 128, 128)) | |
55 | FXVec4f.new(FXRGB(128, 128, 128)) | |
42 | 56 | end |
43 | 57 | |
44 | 58 | def test_getitem |
64 | 78 | def test_neg |
65 | 79 | vec = FXVec4f.new(1.0, 2.0, 3.0, 4.0) |
66 | 80 | 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) | |
71 | 85 | end |
72 | 86 | |
73 | 87 | def test_add |
74 | 88 | v1 = FXVec4f.new(1.0, 2.0, 3.0, 4.0) |
75 | 89 | v2 = FXVec4f.new(2.0, 4.0, 6.0, 8.0) |
76 | 90 | 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) | |
78 | 92 | end |
79 | 93 | |
80 | 94 | def test_sub |
81 | 95 | v1 = FXVec4f.new(3.0, 6.0, 9.0, 12.0) |
82 | 96 | v2 = FXVec4f.new(2.0, 4.0, 6.0, 8.0) |
83 | 97 | 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) | |
85 | 99 | end |
86 | 100 | |
87 | 101 | def test_mul |
88 | 102 | v1 = FXVec4f.new(3.0, 6.0, 9.0, 12.0) |
89 | 103 | 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) | |
91 | 105 | end |
92 | 106 | |
93 | 107 | def test_mul2 # same as dot product |
94 | 108 | v1 = FXVec4f.new(3.0, 6.0, 9.0, 12.0) |
95 | 109 | 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) | |
98 | 112 | end |
99 | 113 | |
100 | 114 | def test_div |
109 | 123 | def test_dot |
110 | 124 | v1 = FXVec4f.new(3.0, 6.0, 9.0, 12.0) |
111 | 125 | 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) | |
114 | 128 | end |
115 | 129 | |
116 | 130 | def test_length |
120 | 134 | |
121 | 135 | def test_normalize |
122 | 136 | 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) | |
124 | 138 | end |
125 | 139 | |
126 | 140 | def test_lo |
11 | 11 | |
12 | 12 | def test_width_accessor |
13 | 13 | pos = @window.width |
14 | assert_instance_of(Fixnum, pos) | |
14 | assert_kind_of(Integer, pos) | |
15 | 15 | @window.width = pos + 1 |
16 | 16 | assert_equal(pos + 1, @window.width) |
17 | 17 | @window.width = pos + 2.7 |
1 | 1 | require 'test/unit' |
2 | 2 | |
3 | 3 | 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 | |
7 | 10 | end |
8 | 11 | 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 |