wxruby3 0.9.0.pre.beta.11-x64-mingw-ucrt → 0.9.0.pre.beta.14-x64-mingw-ucrt

Sign up to get free protection for your applications and to get access to all the features.
Files changed (272) hide show
  1. checksums.yaml +4 -4
  2. data/INSTALL.md +85 -0
  3. data/README.md +2 -0
  4. data/assets/logo.png +0 -0
  5. data/assets/logo.svg +170 -0
  6. data/assets/logo.xcf +0 -0
  7. data/ext/wxbase32u_gcc_custom.dll +0 -0
  8. data/ext/wxbase32u_net_gcc_custom.dll +0 -0
  9. data/ext/wxbase32u_xml_gcc_custom.dll +0 -0
  10. data/ext/wxmsw32u_aui_gcc_custom.dll +0 -0
  11. data/ext/wxmsw32u_core_gcc_custom.dll +0 -0
  12. data/ext/wxmsw32u_gl_gcc_custom.dll +0 -0
  13. data/ext/wxmsw32u_html_gcc_custom.dll +0 -0
  14. data/ext/wxmsw32u_media_gcc_custom.dll +0 -0
  15. data/ext/wxmsw32u_propgrid_gcc_custom.dll +0 -0
  16. data/ext/wxmsw32u_qa_gcc_custom.dll +0 -0
  17. data/ext/wxmsw32u_ribbon_gcc_custom.dll +0 -0
  18. data/ext/wxmsw32u_richtext_gcc_custom.dll +0 -0
  19. data/ext/wxmsw32u_stc_gcc_custom.dll +0 -0
  20. data/ext/wxmsw32u_webview_gcc_custom.dll +0 -0
  21. data/ext/wxmsw32u_xrc_gcc_custom.dll +0 -0
  22. data/lib/wx/accessors.rb +8 -2
  23. data/lib/wx/core/array_ext.rb +26 -0
  24. data/lib/wx/core/art_locator.rb +92 -0
  25. data/lib/wx/core/artprovider.rb +1 -1
  26. data/lib/wx/core/bitmap.rb +90 -53
  27. data/lib/wx/core/cursor.rb +12 -0
  28. data/lib/wx/core/dataformat.rb +3 -1
  29. data/lib/wx/core/dc.rb +76 -52
  30. data/lib/wx/core/enum.rb +4 -0
  31. data/lib/wx/core/event.rb +38 -5
  32. data/lib/wx/core/events/evt_list.rb +3 -2
  33. data/lib/wx/core/evthandler.rb +64 -23
  34. data/lib/wx/core/icon.rb +50 -35
  35. data/lib/wx/core/id_helper.rb +32 -0
  36. data/lib/wx/core/image.rb +63 -53
  37. data/lib/wx/core/point.rb +14 -0
  38. data/lib/wx/core/real_point.rb +15 -1
  39. data/lib/wx/core/rect.rb +42 -7
  40. data/lib/wx/core/region_iterator.rb +37 -0
  41. data/lib/wx/core/size.rb +20 -0
  42. data/lib/wx/core/window.rb +8 -31
  43. data/lib/wx/doc/array_ext.rb +27 -0
  44. data/lib/wx/doc/art_locator.rb +57 -0
  45. data/lib/wx/doc/bitmap.rb +27 -0
  46. data/lib/wx/doc/clipboard.rb +12 -0
  47. data/lib/wx/doc/const.rb +77 -0
  48. data/lib/wx/doc/cursor.rb +16 -0
  49. data/lib/wx/doc/data_object.rb +1 -2
  50. data/lib/wx/doc/dc.rb +63 -46
  51. data/lib/wx/doc/event.rb +24 -0
  52. data/lib/wx/doc/events.rb +14 -0
  53. data/lib/wx/doc/evthandler.rb +24 -3
  54. data/lib/wx/doc/extra/00_starting.md +1 -1
  55. data/lib/wx/doc/extra/06_geometry.md +10 -4
  56. data/lib/wx/doc/extra/10_art.md +105 -0
  57. data/lib/wx/doc/gc_dc.rb +21 -0
  58. data/lib/wx/doc/gdi_common.rb +122 -1
  59. data/lib/wx/doc/gen/about_dialog_info.rb +1 -4
  60. data/lib/wx/doc/gen/animation.rb +3 -3
  61. data/lib/wx/doc/gen/animation_ctrl.rb +4 -4
  62. data/lib/wx/doc/gen/any_button.rb +1 -1
  63. data/lib/wx/doc/gen/aui/aui_floating_frame.rb +1 -1
  64. data/lib/wx/doc/gen/aui/aui_manager.rb +2 -2
  65. data/lib/wx/doc/gen/aui/aui_mdi_child_frame.rb +3 -3
  66. data/lib/wx/doc/gen/aui/aui_mdi_parent_frame.rb +3 -3
  67. data/lib/wx/doc/gen/aui/aui_notebook.rb +2 -2
  68. data/lib/wx/doc/gen/aui/aui_tool_bar.rb +6 -6
  69. data/lib/wx/doc/gen/bitmap.rb +1 -1
  70. data/lib/wx/doc/gen/bitmap_button.rb +2 -2
  71. data/lib/wx/doc/gen/book_ctrl_base.rb +4 -4
  72. data/lib/wx/doc/gen/brush.rb +1 -1
  73. data/lib/wx/doc/gen/button.rb +2 -2
  74. data/lib/wx/doc/gen/calendar_ctrl.rb +3 -3
  75. data/lib/wx/doc/gen/calendar_date_attr.rb +1 -1
  76. data/lib/wx/doc/gen/check_box.rb +2 -2
  77. data/lib/wx/doc/gen/check_list_box.rb +3 -3
  78. data/lib/wx/doc/gen/choice.rb +2 -2
  79. data/lib/wx/doc/gen/choicebook.rb +2 -2
  80. data/lib/wx/doc/gen/collapsible_pane.rb +2 -2
  81. data/lib/wx/doc/gen/colour.rb +1 -3
  82. data/lib/wx/doc/gen/colour_dialog.rb +1 -2
  83. data/lib/wx/doc/gen/colour_picker_ctrl.rb +2 -2
  84. data/lib/wx/doc/gen/combo_box.rb +4 -4
  85. data/lib/wx/doc/gen/context_help_button.rb +1 -1
  86. data/lib/wx/doc/gen/control.rb +3 -3
  87. data/lib/wx/doc/gen/core.rb +2 -2
  88. data/lib/wx/doc/gen/data_format.rb +1 -1
  89. data/lib/wx/doc/gen/data_object.rb +6 -6
  90. data/lib/wx/doc/gen/date_picker_ctrl.rb +2 -2
  91. data/lib/wx/doc/gen/dc.rb +9 -9
  92. data/lib/wx/doc/gen/defs.rb +0 -4
  93. data/lib/wx/doc/gen/dialog.rb +3 -3
  94. data/lib/wx/doc/gen/dir_dialog.rb +2 -4
  95. data/lib/wx/doc/gen/dir_filter_list_ctrl.rb +2 -2
  96. data/lib/wx/doc/gen/dir_picker_ctrl.rb +2 -2
  97. data/lib/wx/doc/gen/drag_drop.rb +13 -1
  98. data/lib/wx/doc/gen/editable_list_box.rb +2 -2
  99. data/lib/wx/doc/gen/event.rb +0 -1
  100. data/lib/wx/doc/gen/event_list.rb +18 -16
  101. data/lib/wx/doc/gen/events.rb +87 -2
  102. data/lib/wx/doc/gen/ext_help_controller.rb +2 -2
  103. data/lib/wx/doc/gen/file_dialog.rb +1 -1
  104. data/lib/wx/doc/gen/file_picker_ctrl.rb +2 -2
  105. data/lib/wx/doc/gen/font.rb +6 -6
  106. data/lib/wx/doc/gen/font_dialog.rb +1 -2
  107. data/lib/wx/doc/gen/font_picker_ctrl.rb +2 -2
  108. data/lib/wx/doc/gen/frame.rb +5 -5
  109. data/lib/wx/doc/gen/fs_file.rb +2 -2
  110. data/lib/wx/doc/gen/gauge.rb +2 -2
  111. data/lib/wx/doc/gen/gdi_common.rb +18 -21
  112. data/lib/wx/doc/gen/generic_dir_ctrl.rb +2 -2
  113. data/lib/wx/doc/gen/graphics_context.rb +4 -4
  114. data/lib/wx/doc/gen/graphics_object.rb +2 -2
  115. data/lib/wx/doc/gen/grid/grid_cell_bool_editor.rb +1 -1
  116. data/lib/wx/doc/gen/grid/grid_cell_date_time_renderer.rb +1 -1
  117. data/lib/wx/doc/gen/grid/grid_cell_enum_editor.rb +1 -1
  118. data/lib/wx/doc/gen/grid/grid_cell_enum_renderer.rb +1 -1
  119. data/lib/wx/doc/gen/grid/grid_cell_float_editor.rb +1 -1
  120. data/lib/wx/doc/gen/grid/grid_cell_float_renderer.rb +1 -1
  121. data/lib/wx/doc/gen/grid/grid_ctrl.rb +7 -7
  122. data/lib/wx/doc/gen/help_controller.rb +1 -1
  123. data/lib/wx/doc/gen/html/html_cell.rb +4 -4
  124. data/lib/wx/doc/gen/html/html_easy_printing.rb +6 -6
  125. data/lib/wx/doc/gen/html/html_help_controller.rb +6 -6
  126. data/lib/wx/doc/gen/html/html_help_frame.rb +2 -2
  127. data/lib/wx/doc/gen/html/html_help_window.rb +6 -6
  128. data/lib/wx/doc/gen/html/html_list_box.rb +6 -6
  129. data/lib/wx/doc/gen/html/html_printout.rb +4 -4
  130. data/lib/wx/doc/gen/html/html_window.rb +4 -4
  131. data/lib/wx/doc/gen/icon.rb +6 -6
  132. data/lib/wx/doc/gen/image.rb +7 -7
  133. data/lib/wx/doc/gen/list_box.rb +4 -4
  134. data/lib/wx/doc/gen/list_ctrl.rb +5 -5
  135. data/lib/wx/doc/gen/listbook.rb +2 -2
  136. data/lib/wx/doc/gen/locale.rb +8 -8
  137. data/lib/wx/doc/gen/log.rb +2 -2
  138. data/lib/wx/doc/gen/mdi_frame.rb +5 -5
  139. data/lib/wx/doc/gen/media_ctrl.rb +4 -4
  140. data/lib/wx/doc/gen/menu.rb +12 -12
  141. data/lib/wx/doc/gen/menu_item.rb +1 -1
  142. data/lib/wx/doc/gen/message_dialog.rb +2 -4
  143. data/lib/wx/doc/gen/mini_frame.rb +2 -2
  144. data/lib/wx/doc/gen/notebook.rb +3 -3
  145. data/lib/wx/doc/gen/number_entry_dialog.rb +0 -1
  146. data/lib/wx/doc/gen/object.rb +0 -1
  147. data/lib/wx/doc/gen/panel.rb +2 -2
  148. data/lib/wx/doc/gen/pen.rb +2 -2
  149. data/lib/wx/doc/gen/pg/pg_array_editor_dialog.rb +1 -1
  150. data/lib/wx/doc/gen/pg/pg_cell.rb +1 -1
  151. data/lib/wx/doc/gen/pg/pg_properties.rb +20 -20
  152. data/lib/wx/doc/gen/pg/pg_property.rb +12 -12
  153. data/lib/wx/doc/gen/pg/property_grid.rb +3 -3
  154. data/lib/wx/doc/gen/pg/property_grid_interface.rb +14 -14
  155. data/lib/wx/doc/gen/pg/property_grid_manager.rb +3 -3
  156. data/lib/wx/doc/gen/pg/property_grid_page.rb +2 -2
  157. data/lib/wx/doc/gen/pg/property_grid_page_state.rb +2 -2
  158. data/lib/wx/doc/gen/popup_window.rb +3 -3
  159. data/lib/wx/doc/gen/property_sheet_dialog.rb +3 -3
  160. data/lib/wx/doc/gen/prt/print_abort_dialog.rb +1 -1
  161. data/lib/wx/doc/gen/prt/printer.rb +1 -1
  162. data/lib/wx/doc/gen/radio_box.rb +4 -4
  163. data/lib/wx/doc/gen/radio_button.rb +2 -2
  164. data/lib/wx/doc/gen/rbn/ribbon_bar.rb +2 -2
  165. data/lib/wx/doc/gen/rbn/ribbon_button_bar.rb +12 -12
  166. data/lib/wx/doc/gen/rbn/ribbon_control.rb +1 -1
  167. data/lib/wx/doc/gen/rbn/ribbon_gallery.rb +2 -2
  168. data/lib/wx/doc/gen/rbn/ribbon_page.rb +2 -2
  169. data/lib/wx/doc/gen/rbn/ribbon_panel.rb +2 -2
  170. data/lib/wx/doc/gen/rbn/ribbon_tool_bar.rb +11 -11
  171. data/lib/wx/doc/gen/region.rb +1 -1
  172. data/lib/wx/doc/gen/region_iterator.rb +76 -0
  173. data/lib/wx/doc/gen/rtc/rich_text_buffer.rb +10 -10
  174. data/lib/wx/doc/gen/rtc/rich_text_ctrl.rb +19 -19
  175. data/lib/wx/doc/gen/rtc/rich_text_file_handler.rb +2 -2
  176. data/lib/wx/doc/gen/rtc/rich_text_header_footer_data.rb +4 -4
  177. data/lib/wx/doc/gen/rtc/rich_text_html_handler.rb +1 -1
  178. data/lib/wx/doc/gen/rtc/rich_text_printing.rb +6 -6
  179. data/lib/wx/doc/gen/rtc/rich_text_xml_handler.rb +1 -1
  180. data/lib/wx/doc/gen/rtc/symbol_picker_dialog.rb +2 -2
  181. data/lib/wx/doc/gen/sash_event.rb +1 -1
  182. data/lib/wx/doc/gen/sash_layout_window.rb +2 -2
  183. data/lib/wx/doc/gen/sash_window.rb +1 -1
  184. data/lib/wx/doc/gen/scroll_bar.rb +150 -0
  185. data/lib/wx/doc/gen/scrolled_canvas.rb +2 -2
  186. data/lib/wx/doc/gen/scrolled_control.rb +2 -2
  187. data/lib/wx/doc/gen/scrolled_window.rb +2 -2
  188. data/lib/wx/doc/gen/simplebook.rb +2 -2
  189. data/lib/wx/doc/gen/sizer.rb +3 -3
  190. data/lib/wx/doc/gen/slider.rb +2 -2
  191. data/lib/wx/doc/gen/spin_button.rb +2 -2
  192. data/lib/wx/doc/gen/spin_ctrl.rb +2 -2
  193. data/lib/wx/doc/gen/splash_screen.rb +1 -1
  194. data/lib/wx/doc/gen/splitter_window.rb +2 -2
  195. data/lib/wx/doc/gen/static_bitmap.rb +2 -2
  196. data/lib/wx/doc/gen/static_box.rb +4 -4
  197. data/lib/wx/doc/gen/static_box_sizer.rb +1 -1
  198. data/lib/wx/doc/gen/static_line.rb +2 -2
  199. data/lib/wx/doc/gen/static_text.rb +2 -2
  200. data/lib/wx/doc/gen/status_bar.rb +2 -2
  201. data/lib/wx/doc/gen/stc/styled_text_ctrl.rb +3 -3
  202. data/lib/wx/doc/gen/task_bar_icon.rb +2 -2
  203. data/lib/wx/doc/gen/text_attr.rb +3 -3
  204. data/lib/wx/doc/gen/text_ctrl.rb +3 -3
  205. data/lib/wx/doc/gen/text_entry_dialog.rb +6 -8
  206. data/lib/wx/doc/gen/text_validator.rb +1 -1
  207. data/lib/wx/doc/gen/time_picker_ctrl.rb +2 -2
  208. data/lib/wx/doc/gen/tip_provider.rb +1 -3
  209. data/lib/wx/doc/gen/toggle_button.rb +2 -2
  210. data/lib/wx/doc/gen/tool_bar.rb +10 -10
  211. data/lib/wx/doc/gen/toolbook.rb +2 -2
  212. data/lib/wx/doc/gen/top_level_window.rb +4 -4
  213. data/lib/wx/doc/gen/tree_ctrl.rb +4 -4
  214. data/lib/wx/doc/gen/treebook.rb +2 -2
  215. data/lib/wx/doc/gen/utils.rb +5 -42
  216. data/lib/wx/doc/gen/v_list_box.rb +2 -2
  217. data/lib/wx/doc/gen/v_scrolled_window.rb +2 -2
  218. data/lib/wx/doc/gen/variant.rb +10 -10
  219. data/lib/wx/doc/gen/window.rb +9 -14
  220. data/lib/wx/doc/gen/wizard.rb +2 -2
  221. data/lib/wx/doc/gen/wizard_event.rb +1 -1
  222. data/lib/wx/doc/gen/xml_node.rb +2 -2
  223. data/lib/wx/doc/gen/xml_resource.rb +3 -3
  224. data/lib/wx/doc/graphics_context.rb +42 -0
  225. data/lib/wx/doc/icon.rb +18 -0
  226. data/lib/wx/doc/id_helper.rb +25 -0
  227. data/lib/wx/doc/image.rb +33 -0
  228. data/lib/wx/doc/region_iterator.rb +31 -0
  229. data/lib/wx/doc/scaled_dc.rb +1 -0
  230. data/lib/wx/doc/window.rb +18 -0
  231. data/lib/wx/global_const.rb +24 -18
  232. data/lib/wx/version.rb +1 -1
  233. data/lib/wx/wxruby/cmd/sampler.rb +3 -21
  234. data/lib/wxruby_aui.so +0 -0
  235. data/lib/wxruby_core.so +0 -0
  236. data/lib/wxruby_grid.so +0 -0
  237. data/lib/wxruby_html.so +0 -0
  238. data/lib/wxruby_pg.so +0 -0
  239. data/lib/wxruby_prt.so +0 -0
  240. data/lib/wxruby_rbn.so +0 -0
  241. data/lib/wxruby_rtc.so +0 -0
  242. data/lib/wxruby_stc.so +0 -0
  243. data/rakelib/lib/config.rb +4 -4
  244. data/samples/art/wxruby-128x128.png +0 -0
  245. data/samples/art/wxruby-256x256.png +0 -0
  246. data/samples/art/wxruby-64x64.png +0 -0
  247. data/samples/art/wxruby.ico +0 -0
  248. data/samples/art/wxruby.png +0 -0
  249. data/samples/drawing/graphics_drawing.rb +1 -2
  250. data/samples/propgrid/propgrid.rb +65 -65
  251. data/samples/sample.xpm +246 -470
  252. data/samples/treectrl/treectrl.rb +1 -1
  253. data/tests/art/my_art/sample.xpm +251 -0
  254. data/tests/art/sample3.xpm +251 -0
  255. data/tests/art/test_art/bitmap/sample.xpm +251 -0
  256. data/tests/art/test_art/bitmap/wxruby.bmp +0 -0
  257. data/tests/art/test_art/bitmap/wxruby.png +0 -0
  258. data/tests/art/test_art/bitmap/wxruby.xpm +251 -0
  259. data/tests/art/test_art/cursor/wxruby.bmp +0 -0
  260. data/tests/art/test_art/icon/sample.xpm +251 -0
  261. data/tests/art/test_art/icon/wxruby.ico +0 -0
  262. data/tests/art/test_art/icon/wxruby.png +0 -0
  263. data/tests/art/test_art/image/sample.xpm +251 -0
  264. data/tests/art/test_art/image/wxruby.jpg +0 -0
  265. data/tests/art/test_art/image/wxruby.png +0 -0
  266. data/tests/art/test_art/sample2.xpm +251 -0
  267. data/tests/test_art.rb +91 -0
  268. data/tests/test_clipboard.rb +35 -0
  269. data/tests/test_dc.rb +70 -0
  270. data/tests/test_events.rb +12 -0
  271. data/tests/test_geometry.rb +13 -0
  272. metadata +48 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 21e4dd4492cc5886ff3b6a3479a98aeb4de31836504fccbe95573b62b46733c4
4
- data.tar.gz: 1348defec7496457813b29e61149c7ec9662aebc9b958f4faabaa6961f194d84
3
+ metadata.gz: c9566b98341d3e7555931975c60c3facd1b10060b45187705b5603b86d084aff
4
+ data.tar.gz: 71b138ada2a3a20d5db75ba119afba4a6096685bde9d7e0c3d456b6b2070619e
5
5
  SHA512:
6
- metadata.gz: 27d3fb31968f3d657c2c6199750250331b103f48c5e3d7a6908e302b51ab9ae616e9434fbbc25241335d0791527e07f4354bb59a65da322ac66d85c69b0b42ee
7
- data.tar.gz: e8adac23ee31c8a447228bdf2e11c87aa4aaa93d7af30450bc17ff57e620d2cbd885a8979ba82e6fdf6b21e87656846a25456a0a5a7c5a87faced833f0c5df5f
6
+ metadata.gz: '09a36c57dffb1c98acb5203f4336b00c1863df09334f3d6e323b197f51e3661bafde7a3adf6951abd748d5ccb64130114f06b86a0251326892e3caf882b1a118'
7
+ data.tar.gz: 17f1643a1e7e22fa74b7ccc6f1ed3dae336e33a6a40702831dc46c318166f6de52b1dfd5445938de4dd1fd143a3e4d5555312b77ccc58aaf0fe904986d913b07
data/INSTALL.md ADDED
@@ -0,0 +1,85 @@
1
+ <!--
2
+ # @markup markdown
3
+ -->
4
+
5
+ # Installation of wxRuby3
6
+
7
+ ## Installation of a wxRuby3 Gem
8
+
9
+ The wxRuby3 project provides gems on [RubyGems](https://rubygems.org) which can be installed with the
10
+ standard `gem install` command line this:
11
+
12
+ ```sh
13
+ gem install wxruby3
14
+ ```
15
+
16
+ On Linux systems this will install the source based gem which will automatically build the native wxruby3 extension
17
+ for the platform on which wxRuby3 is being installed.
18
+ On Windows systems a prebuilt binary gem is available for the latest stable release(s) of [RubyInstaller](https://rubyinstaller.org)
19
+ installed rubies that will be installed by default if installing for that platform. Alternatively the source gem can be
20
+ installed on Windows by installing with explicit platform specification like this:
21
+
22
+ ```sh
23
+ gem install wxruby3 --platform=ruby
24
+ ```
25
+
26
+ When installing the source gem the following basic requirements apply:
27
+
28
+ - Git version control toolkit
29
+ - Ruby 2.5 or later (including development package)
30
+ - GNU g++ 4.8 or later on Linux, RubyInstaller+DevKit on Windows
31
+ - [SWIG](https://www.swig.org) 3.0.12 or later
32
+ - [Doxygen](https://www.doxygen.nl/)
33
+
34
+ Also a wxWidgets installation (version 3.2 or later) is required for which there are multiple options.
35
+
36
+ 1. System installed wxWidgets version (including development package)<br>
37
+ <br>
38
+ This is the default method used when installing the source gem without any options.<br>
39
+ The wxRuby build procedure will determine the availability and version of wxWidgets by locating and calling
40
+ the `wx-config` utility script. In case no (compatible) wxWidgets version is found installation ends with an error.<br>
41
+ Please note that even with this method a copy of the wxWidgets project will be checked out from GitHUb as the wxRuby3
42
+ build procedure requires access to the wxWidgets interface specification sources (see [here](TODO) for more details).
43
+
44
+
45
+ 2. User installed wxWidgets version<br>
46
+ <br>
47
+ In case the being system installed on does not provide (a compatible) wxWidgets version or a specific (possibly updated)
48
+ wxWidgets version is required the source gem can be installed using a user installed version like this (where the
49
+ `WXWIN` path should provide the location where the wxWidgets binaries are installed under `<wxwin path>/bin`):<br>
50
+
51
+ ```sh
52
+ gem install wxruby3 -- WXWIN=/path/to/wx/install
53
+ ```
54
+
55
+ 3. Automatic installed wxWidgets version<br>
56
+ <br>
57
+ This is the easiest method when the being system installed on does not provide (a compatible) wxWidgets version (and
58
+ no specific user defined version is required) and can be used by installing the source gem like this (which will
59
+ cause automatic checkout and building of the latest wxWidgets release (>= 3.2) from GitHub:
60
+
61
+
62
+ ```sh
63
+ gem install wxruby3 -- WITH_WXWIN=1
64
+ ```
65
+
66
+ > **NOTE:** Be patient when installing the source gem. Building wxRuby3 takes a while and when wxWidgets is included event more.
67
+
68
+ ## Building from source
69
+
70
+ Checkout the wxRuby3 sources from [GitHub](https://github.com/mcorino/wxRuby3).
71
+
72
+ Basic requirements are the same as for installing the source gem. Gem dependencies are listed in the Gemfile in the root
73
+ of the wxRuby3 tree.
74
+
75
+ The wxRuby3 project provides a Rake based build system. Call `rake help` to get an overview of the available commands.
76
+ As mentioned there the `rake configure` command is required as the very first command. Call `rake configure[--help]` to
77
+ get a detailed overview of the options for this command.<br>
78
+ As with the source gem 3 options exist for the wxWidgets installation which will have to be specified to `rake configure`.
79
+
80
+ When wxRuby3 has been configured the extensions can be build by calling the `rake build` command. The wxRuby3 build
81
+ commands are executed using parallel task execution by default.
82
+
83
+ When the build has finished without errors the regression tests can be run by calling `rake test`.
84
+
85
+ For more details concerning the wxRuby3 development strategy and build options see [here](TODO).
data/README.md CHANGED
@@ -7,6 +7,8 @@
7
7
 
8
8
  # README for wxRuby3
9
9
 
10
+ ![Logo](assets/logo.svg "wxRuby3")
11
+
10
12
  Reviving wxRuby
11
13
 
12
14
  ## Introduction
data/assets/logo.png ADDED
Binary file
data/assets/logo.svg ADDED
@@ -0,0 +1,170 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg version="1.2" width="120.53mm" height="85.15mm" viewBox="1364 6894 12053 8515" preserveAspectRatio="xMidYMid" fill-rule="evenodd" stroke-width="28.222" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" xmlns:ooo="http://xml.openoffice.org/svg/export" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:presentation="http://sun.com/xmlns/staroffice/presentation" xmlns:smil="http://www.w3.org/2001/SMIL20/" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" xml:space="preserve">
4
+ <defs class="EmbeddedBulletChars">
5
+ <g id="bullet-char-template-57356" transform="scale(0.00048828125,-0.00048828125)">
6
+ <path d="M 580,1141 L 1163,571 580,0 -4,571 580,1141 Z"/>
7
+ </g>
8
+ <g id="bullet-char-template-57354" transform="scale(0.00048828125,-0.00048828125)">
9
+ <path d="M 8,1128 L 1137,1128 1137,0 8,0 8,1128 Z"/>
10
+ </g>
11
+ <g id="bullet-char-template-10146" transform="scale(0.00048828125,-0.00048828125)">
12
+ <path d="M 174,0 L 602,739 174,1481 1456,739 174,0 Z M 1358,739 L 309,1346 659,739 1358,739 Z"/>
13
+ </g>
14
+ <g id="bullet-char-template-10132" transform="scale(0.00048828125,-0.00048828125)">
15
+ <path d="M 2015,739 L 1276,0 717,0 1260,543 174,543 174,936 1260,936 717,1481 1274,1481 2015,739 Z"/>
16
+ </g>
17
+ <g id="bullet-char-template-10007" transform="scale(0.00048828125,-0.00048828125)">
18
+ <path d="M 0,-2 C -7,14 -16,27 -25,37 L 356,567 C 262,823 215,952 215,954 215,979 228,992 255,992 264,992 276,990 289,987 310,991 331,999 354,1012 L 381,999 492,748 772,1049 836,1024 860,1049 C 881,1039 901,1025 922,1006 886,937 835,863 770,784 769,783 710,716 594,584 L 774,223 C 774,196 753,168 711,139 L 727,119 C 717,90 699,76 672,76 641,76 570,178 457,381 L 164,-76 C 142,-110 111,-127 72,-127 30,-127 9,-110 8,-76 1,-67 -2,-52 -2,-32 -2,-23 -1,-13 0,-2 Z"/>
19
+ </g>
20
+ <g id="bullet-char-template-10004" transform="scale(0.00048828125,-0.00048828125)">
21
+ <path d="M 285,-33 C 182,-33 111,30 74,156 52,228 41,333 41,471 41,549 55,616 82,672 116,743 169,778 240,778 293,778 328,747 346,684 L 369,508 C 377,444 397,411 428,410 L 1163,1116 C 1174,1127 1196,1133 1229,1133 1271,1133 1292,1118 1292,1087 L 1292,965 C 1292,929 1282,901 1262,881 L 442,47 C 390,-6 338,-33 285,-33 Z"/>
22
+ </g>
23
+ <g id="bullet-char-template-9679" transform="scale(0.00048828125,-0.00048828125)">
24
+ <path d="M 813,0 C 632,0 489,54 383,161 276,268 223,411 223,592 223,773 276,916 383,1023 489,1130 632,1184 813,1184 992,1184 1136,1130 1245,1023 1353,916 1407,772 1407,592 1407,412 1353,268 1245,161 1136,54 992,0 813,0 Z"/>
25
+ </g>
26
+ <g id="bullet-char-template-8226" transform="scale(0.00048828125,-0.00048828125)">
27
+ <path d="M 346,457 C 273,457 209,483 155,535 101,586 74,649 74,723 74,796 101,859 155,911 209,963 273,989 346,989 419,989 480,963 531,910 582,859 608,796 608,723 608,648 583,586 532,535 482,483 420,457 346,457 Z"/>
28
+ </g>
29
+ <g id="bullet-char-template-8211" transform="scale(0.00048828125,-0.00048828125)">
30
+ <path d="M -4,459 L 1135,459 1135,606 -4,606 -4,459 Z"/>
31
+ </g>
32
+ <g id="bullet-char-template-61548" transform="scale(0.00048828125,-0.00048828125)">
33
+ <path d="M 173,740 C 173,903 231,1043 346,1159 462,1274 601,1332 765,1332 928,1332 1067,1274 1183,1159 1299,1043 1357,903 1357,740 1357,577 1299,437 1183,322 1067,206 928,148 765,148 601,148 462,206 346,322 231,437 173,577 173,740 Z"/>
34
+ </g>
35
+ </defs>
36
+ <g class="Page">
37
+ <g class="Group">
38
+ <g class="com.sun.star.drawing.PolyPolygonShape">
39
+ <g id="id3">
40
+ <rect class="BoundingBox" stroke="none" fill="none" x="1364" y="6894" width="5653" height="1964"/>
41
+ <path fill="rgb(241,13,12)" stroke="none" d="M 1470,8751 L 6910,8751 6044,7000 2334,7000 1470,8751 Z"/>
42
+ <path fill="none" stroke="rgb(51,51,51)" stroke-width="212" stroke-linejoin="round" d="M 1470,8751 L 6910,8751 6044,7000 2334,7000 1470,8751 Z"/>
43
+ </g>
44
+ </g>
45
+ <g class="com.sun.star.drawing.PolyPolygonShape">
46
+ <g id="id4">
47
+ <rect class="BoundingBox" stroke="none" fill="none" x="2224" y="6894" width="3933" height="1964"/>
48
+ <path fill="rgb(241,13,12)" stroke="none" d="M 2330,7000 L 6050,7000 5458,8751 2921,8751 2330,7000 Z"/>
49
+ <path fill="none" stroke="rgb(51,51,51)" stroke-width="212" stroke-linejoin="round" d="M 2330,7000 L 6050,7000 5458,8751 2921,8751 2330,7000 Z"/>
50
+ </g>
51
+ </g>
52
+ <g class="com.sun.star.drawing.PolyPolygonShape">
53
+ <g id="id5">
54
+ <rect class="BoundingBox" stroke="none" fill="none" x="2706" y="6894" width="2939" height="1964"/>
55
+ <path fill="rgb(241,13,12)" stroke="none" d="M 4216,7000 L 5538,8751 2812,8751 4216,7000 Z"/>
56
+ <path fill="none" stroke="rgb(51,51,51)" stroke-width="212" stroke-linejoin="round" d="M 4216,7000 L 5538,8751 2812,8751 4216,7000 Z"/>
57
+ </g>
58
+ </g>
59
+ <g class="com.sun.star.drawing.PolyPolygonShape">
60
+ <g id="id6">
61
+ <rect class="BoundingBox" stroke="none" fill="none" x="1374" y="8642" width="5634" height="3965"/>
62
+ <path fill="rgb(241,13,12)" stroke="none" d="M 4189,12500 L 6900,8749 1480,8749 4189,12500 Z"/>
63
+ <path fill="none" stroke="rgb(51,51,51)" stroke-width="212" stroke-linejoin="round" d="M 4189,12500 L 6900,8749 1480,8749 4189,12500 Z"/>
64
+ </g>
65
+ </g>
66
+ <g class="com.sun.star.drawing.PolyPolygonShape">
67
+ <g id="id7">
68
+ <rect class="BoundingBox" stroke="none" fill="none" x="2794" y="8644" width="1513" height="3964"/>
69
+ <path fill="rgb(241,13,12)" stroke="none" d="M 2900,8750 L 4200,12500 2900,8750 Z"/>
70
+ <path fill="none" stroke="rgb(51,51,51)" stroke-width="212" stroke-linejoin="round" d="M 2900,8750 L 4200,12500 2900,8750 Z"/>
71
+ </g>
72
+ </g>
73
+ <g class="com.sun.star.drawing.PolyPolygonShape">
74
+ <g id="id8">
75
+ <rect class="BoundingBox" stroke="none" fill="none" x="4064" y="8645" width="1513" height="3964"/>
76
+ <path fill="rgb(241,13,12)" stroke="none" d="M 5470,8751 L 4170,12501 5470,8751 Z"/>
77
+ <path fill="none" stroke="rgb(51,51,51)" stroke-width="212" stroke-linejoin="round" d="M 5470,8751 L 4170,12501 5470,8751 Z"/>
78
+ </g>
79
+ </g>
80
+ </g>
81
+ <g class="Group">
82
+ <g class="com.sun.star.drawing.PolyPolygonShape">
83
+ <g id="id9">
84
+ <rect class="BoundingBox" stroke="none" fill="none" x="7764" y="6895" width="5653" height="1964"/>
85
+ <path fill="rgb(255,255,0)" stroke="none" d="M 7870,8752 L 13310,8752 12444,7001 8734,7001 7870,8752 Z"/>
86
+ <path fill="none" stroke="rgb(51,51,51)" stroke-width="212" stroke-linejoin="round" d="M 7870,8752 L 13310,8752 12444,7001 8734,7001 7870,8752 Z"/>
87
+ </g>
88
+ </g>
89
+ <g class="com.sun.star.drawing.PolyPolygonShape">
90
+ <g id="id10">
91
+ <rect class="BoundingBox" stroke="none" fill="none" x="8624" y="6895" width="3933" height="1964"/>
92
+ <path fill="rgb(255,255,0)" stroke="none" d="M 8730,7001 L 12450,7001 11858,8752 9321,8752 8730,7001 Z"/>
93
+ <path fill="none" stroke="rgb(51,51,51)" stroke-width="212" stroke-linejoin="round" d="M 8730,7001 L 12450,7001 11858,8752 9321,8752 8730,7001 Z"/>
94
+ </g>
95
+ </g>
96
+ <g class="com.sun.star.drawing.PolyPolygonShape">
97
+ <g id="id11">
98
+ <rect class="BoundingBox" stroke="none" fill="none" x="9106" y="6895" width="2939" height="1964"/>
99
+ <path fill="rgb(255,255,0)" stroke="none" d="M 10616,7001 L 11938,8752 9212,8752 10616,7001 Z"/>
100
+ <path fill="none" stroke="rgb(51,51,51)" stroke-width="212" stroke-linejoin="round" d="M 10616,7001 L 11938,8752 9212,8752 10616,7001 Z"/>
101
+ </g>
102
+ </g>
103
+ <g class="com.sun.star.drawing.PolyPolygonShape">
104
+ <g id="id12">
105
+ <rect class="BoundingBox" stroke="none" fill="none" x="7774" y="8644" width="5634" height="3964"/>
106
+ <path fill="rgb(255,255,0)" stroke="none" d="M 10589,12501 L 13300,8750 7880,8750 10589,12501 Z"/>
107
+ <path fill="none" stroke="rgb(51,51,51)" stroke-width="212" stroke-linejoin="round" d="M 10589,12501 L 13300,8750 7880,8750 10589,12501 Z"/>
108
+ </g>
109
+ </g>
110
+ <g class="com.sun.star.drawing.PolyPolygonShape">
111
+ <g id="id13">
112
+ <rect class="BoundingBox" stroke="none" fill="none" x="9194" y="8645" width="1513" height="3964"/>
113
+ <path fill="rgb(255,255,0)" stroke="none" d="M 9300,8751 L 10600,12501 9300,8751 Z"/>
114
+ <path fill="none" stroke="rgb(51,51,51)" stroke-width="212" stroke-linejoin="round" d="M 9300,8751 L 10600,12501 9300,8751 Z"/>
115
+ </g>
116
+ </g>
117
+ <g class="com.sun.star.drawing.PolyPolygonShape">
118
+ <g id="id14">
119
+ <rect class="BoundingBox" stroke="none" fill="none" x="10464" y="8646" width="1513" height="3964"/>
120
+ <path fill="rgb(255,255,0)" stroke="none" d="M 11870,8752 L 10570,12502 11870,8752 Z"/>
121
+ <path fill="none" stroke="rgb(51,51,51)" stroke-width="212" stroke-linejoin="round" d="M 11870,8752 L 10570,12502 11870,8752 Z"/>
122
+ </g>
123
+ </g>
124
+ </g>
125
+ <g class="Group">
126
+ <g class="com.sun.star.drawing.PolyPolygonShape">
127
+ <g id="id15">
128
+ <rect class="BoundingBox" stroke="none" fill="none" x="4564" y="13444" width="5653" height="1965"/>
129
+ <path fill="rgb(36,83,255)" stroke="none" d="M 4670,13550 L 10110,13550 9244,15301 5534,15301 4670,13550 Z"/>
130
+ <path fill="none" stroke="rgb(51,51,51)" stroke-width="212" stroke-linejoin="round" d="M 4670,13550 L 10110,13550 9244,15301 5534,15301 4670,13550 Z"/>
131
+ </g>
132
+ </g>
133
+ <g class="com.sun.star.drawing.PolyPolygonShape">
134
+ <g id="id16">
135
+ <rect class="BoundingBox" stroke="none" fill="none" x="5424" y="13444" width="3933" height="1965"/>
136
+ <path fill="rgb(36,83,255)" stroke="none" d="M 5530,15301 L 9250,15301 8658,13550 6121,13550 5530,15301 Z"/>
137
+ <path fill="none" stroke="rgb(51,51,51)" stroke-width="212" stroke-linejoin="round" d="M 5530,15301 L 9250,15301 8658,13550 6121,13550 5530,15301 Z"/>
138
+ </g>
139
+ </g>
140
+ <g class="com.sun.star.drawing.PolyPolygonShape">
141
+ <g id="id17">
142
+ <rect class="BoundingBox" stroke="none" fill="none" x="5906" y="13444" width="2939" height="1965"/>
143
+ <path fill="rgb(36,83,255)" stroke="none" d="M 7416,15301 L 8738,13550 6012,13550 7416,15301 Z"/>
144
+ <path fill="none" stroke="rgb(51,51,51)" stroke-width="212" stroke-linejoin="round" d="M 7416,15301 L 8738,13550 6012,13550 7416,15301 Z"/>
145
+ </g>
146
+ </g>
147
+ <g class="com.sun.star.drawing.PolyPolygonShape">
148
+ <g id="id18">
149
+ <rect class="BoundingBox" stroke="none" fill="none" x="4574" y="9695" width="5633" height="3964"/>
150
+ <path fill="rgb(36,83,255)" stroke="none" d="M 7389,9801 L 10100,13552 4680,13552 7389,9801 Z"/>
151
+ <path fill="none" stroke="rgb(51,51,51)" stroke-width="212" stroke-linejoin="round" d="M 7389,9801 L 10100,13552 4680,13552 7389,9801 Z"/>
152
+ </g>
153
+ </g>
154
+ <g class="com.sun.star.drawing.PolyPolygonShape">
155
+ <g id="id19">
156
+ <rect class="BoundingBox" stroke="none" fill="none" x="5994" y="9694" width="1513" height="3964"/>
157
+ <path fill="rgb(36,83,255)" stroke="none" d="M 6100,13551 L 7400,9801 6100,13551 Z"/>
158
+ <path fill="none" stroke="rgb(51,51,51)" stroke-width="212" stroke-linejoin="round" d="M 6100,13551 L 7400,9801 6100,13551 Z"/>
159
+ </g>
160
+ </g>
161
+ <g class="com.sun.star.drawing.PolyPolygonShape">
162
+ <g id="id20">
163
+ <rect class="BoundingBox" stroke="none" fill="none" x="7264" y="9693" width="1513" height="3964"/>
164
+ <path fill="rgb(36,83,255)" stroke="none" d="M 8670,13550 L 7370,9800 8670,13550 Z"/>
165
+ <path fill="none" stroke="rgb(51,51,51)" stroke-width="212" stroke-linejoin="round" d="M 8670,13550 L 7370,9800 8670,13550 Z"/>
166
+ </g>
167
+ </g>
168
+ </g>
169
+ </g>
170
+ </svg>
data/assets/logo.xcf ADDED
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
data/lib/wx/accessors.rb CHANGED
@@ -56,8 +56,14 @@ module WxRubyStyleAccessors
56
56
 
57
57
  def self.included(mod)
58
58
  mod.extend WxRubyStyleAccessors
59
- mod.constants.collect { | c | mod.const_get(c) }.grep(Module).each do |mod|
60
- mod.include WxRubyStyleAccessors if mod.name.start_with?('Wx::') # only setup Wx namespace
59
+ org_verbose = $VERBOSE
60
+ begin
61
+ $VERBOSE = nil
62
+ mod.constants.collect { | c | mod.const_get(c) }.grep(Module).each do |mod|
63
+ mod.include WxRubyStyleAccessors if mod.name.start_with?('Wx::') # only setup Wx namespace
64
+ end
65
+ ensure
66
+ $VERBOSE = org_verbose
61
67
  end
62
68
  end
63
69
  end
@@ -0,0 +1,26 @@
1
+
2
+ module Wx
3
+
4
+ # Mixin module providing Array extensions.
5
+ module ArrayExt
6
+
7
+ def to_size
8
+ w, h = self
9
+ Wx::Size.new(w || Wx::DEFAULT_COORD, h || Wx::DEFAULT_COORD)
10
+ end
11
+
12
+ def to_point
13
+ x, y = self
14
+ Wx::Point.new(x || Wx::DEFAULT_COORD, y || Wx::DEFAULT_COORD)
15
+ end
16
+
17
+ def to_real_point
18
+ x, y = self
19
+ Wx::RealPoint.new(x || Wx::DEFAULT_COORD, y || Wx::DEFAULT_COORD)
20
+ end
21
+
22
+ end
23
+
24
+ # extend standard Array class
25
+ ::Array.include(Wx::ArrayExt)
26
+ end
@@ -0,0 +1,92 @@
1
+
2
+ module Wx
3
+
4
+ module ArtLocator
5
+
6
+ ART_FOLDER = 'art'
7
+
8
+ class << self
9
+
10
+ # This is not put in a constants as cannot retrieve image handler info
11
+ # before an app has started
12
+ def art_extensions(art_type)
13
+ unless @art_extensions
14
+ @art_extensions = {
15
+ icon: if Wx::PLATFORM == 'WXMSW'
16
+ %w[ico xpm]
17
+ elsif Wx::PLATFORM == 'WXGTK'
18
+ (%w[xpm]+Image.extensions).uniq
19
+ else
20
+ (%w[xbm xpm]+Image.extensions).uniq
21
+ end,
22
+ bitmap: if Wx::PLATFORM == 'WXMSW'
23
+ (%w[bmp xpm]+Image.extensions).uniq
24
+ elsif Wx::PLATFORM == 'WXGTK'
25
+ (%w[xpm]+Image.extensions).uniq
26
+ else
27
+ (%w[xbm xpm]+Image.extensions).uniq
28
+ end,
29
+ cursor: if Wx::PLATFORM == 'WXMSW'
30
+ %w[cur ico bmp]
31
+ elsif Wx::PLATFORM == 'WXGTK'
32
+ []
33
+ else
34
+ %w[xbm]
35
+ end,
36
+ image: Image.extensions
37
+ }
38
+ end
39
+ @art_extensions[(art_type || :image).to_sym] || []
40
+ end
41
+ private :art_extensions
42
+
43
+ def art_folder
44
+ @art_folder ||= ART_FOLDER
45
+ end
46
+
47
+ def art_folder=(name)
48
+ @art_folder = name ? name.to_s : ART_FOLDER
49
+ end
50
+
51
+ def search_paths
52
+ @search_paths ||= []
53
+ end
54
+ private :search_paths
55
+
56
+ def add_search_path(*paths)
57
+ paths.flatten.each { |p| paths << s.to_s unless paths.include?(s.to_s) }
58
+ end
59
+ alias :add_search_paths :add_search_path
60
+
61
+ def _find_art(art_name, art_type, art_path, art_section, bmp_type)
62
+ art_paths = [art_path, File.join(art_path, art_folder)]
63
+ art_paths << File.join(art_paths.last, art_section) if art_section
64
+ art_paths << File.join(art_paths.last, art_type.to_s) if art_type
65
+ art_paths.reverse_each do |sp|
66
+ (bmp_type ? (Image.handler_extensions[bmp_type] || []) : art_extensions(art_type)).each do |ext|
67
+ fp = File.join(sp, "#{art_name}.#{ext}")
68
+ return fp if File.file?(fp)
69
+ end
70
+ end
71
+ nil
72
+ end
73
+ private :_find_art
74
+
75
+ def find_art(art_name, art_type: nil, art_path: nil, art_section: nil, bmp_type: nil)
76
+ unless art_path
77
+ caller_path = caller_locations(1).first.absolute_path
78
+ art_path = File.dirname(caller_path)
79
+ art_section ||= File.basename(caller_path, '.*')
80
+ end
81
+ bmp_type = nil if bmp_type == Wx::BitmapType::BITMAP_TYPE_ANY
82
+ unless fp = _find_art(art_name.to_s, art_type, art_path, art_section, bmp_type)
83
+ search_paths.find { |sp| fp = _find_art(art_name.to_s, art_type, sp, art_section, bmp_type) }
84
+ end
85
+ fp
86
+ end
87
+
88
+ end
89
+
90
+ end
91
+
92
+ end
@@ -24,7 +24,7 @@ class Wx::ArtProvider
24
24
 
25
25
  wx_delete = instance_method(:delete)
26
26
  define_method(:delete) do | art_prov |
27
- wx_push.bind(self).call(art_prov)
27
+ wx_delete.bind(self).call(art_prov)
28
28
  @__art_provs.delete(art_prov)
29
29
  end
30
30
  end
@@ -1,66 +1,103 @@
1
1
  # A platform-dependent image that can be drawn on the screen
2
- class Wx::Bitmap
3
- # Allow wxRuby to guess the type of an image file from its extension.
4
- BITMAP_TYPE_GUESS = {
5
- 'bmp' => Wx::BitmapType::BITMAP_TYPE_BMP,
6
- 'gif' => Wx::BitmapType::BITMAP_TYPE_GIF,
7
- 'ico' => Wx::BitmapType::BITMAP_TYPE_ICO,
8
- 'jpeg' => Wx::BitmapType::BITMAP_TYPE_JPEG,
9
- 'jpg' => Wx::BitmapType::BITMAP_TYPE_JPEG,
10
- 'pbm' => Wx::BitmapType::BITMAP_TYPE_PNM,
11
- 'pcx' => Wx::BitmapType::BITMAP_TYPE_PCX,
12
- 'pgm' => Wx::BitmapType::BITMAP_TYPE_PNM,
13
- 'png' => Wx::BitmapType::BITMAP_TYPE_PNG,
14
- 'pnm' => Wx::BitmapType::BITMAP_TYPE_PNM,
15
- 'ppm' => Wx::BitmapType::BITMAP_TYPE_PNM,
16
- 'tga' => Wx::BitmapType::BITMAP_TYPE_TGA,
17
- 'tif' => Wx::BitmapType::BITMAP_TYPE_TIF,
18
- 'tiff' => Wx::BitmapType::BITMAP_TYPE_TIF,
19
- 'xbm' => Wx::BitmapType::BITMAP_TYPE_XBM,
20
- 'xpm' => Wx::BitmapType::BITMAP_TYPE_XPM
21
- }
2
+ module Wx
22
3
 
23
- # Constructor copying data from an image
24
- def self.from_image(img, depth = -1)
25
- new(img, depth)
4
+ if Wx::PLATFORM == 'WXMSW'
5
+ ICON_DEFAULT_TYPE = BitmapType::BITMAP_TYPE_ICO
6
+ elsif Wx::PLATFORM == 'WXGTK'
7
+ ICON_DEFAULT_TYPE = BitmapType::BITMAP_TYPE_XPM
8
+ elsif Wx::PLATFORM == 'WXOSX'
9
+ ICON_DEFAULT_TYPE = BitmapType::BITMAP_TYPE_ICO
10
+ else
11
+ ICON_DEFAULT_TYPE = BitmapType::BITMAP_TYPE_XPM
26
12
  end
27
13
 
28
- # Create a new bitmap from an icon
29
- def self.from_icon(icon)
30
- bmp = self.new
31
- bmp.copy_from_icon(icon)
32
- bmp
14
+ if Wx::PLATFORM == 'WXMSW'
15
+ BITMAP_DEFAULT_TYPE = BitmapType::BITMAP_TYPE_BMP
16
+ elsif Wx::PLATFORM == 'WXGTK'
17
+ BITMAP_DEFAULT_TYPE = BitmapType::BITMAP_TYPE_XPM
18
+ elsif Wx::PLATFORM == 'WXOSX'
19
+ BITMAP_DEFAULT_TYPE = BitmapType::BITMAP_TYPE_PICT
20
+ else
21
+ BITMAP_DEFAULT_TYPE = BitmapType::BITMAP_TYPE_XPM
33
22
  end
34
23
 
35
- # Ruby methods that switch class are conventionally named to_foo
36
- alias :to_image :convert_to_image
24
+ if Wx::PLATFORM == 'WXMSW'
25
+ CURSOR_DEFAULT_TYPE = BitmapType::BITMAP_TYPE_CUR
26
+ else
27
+ CURSOR_DEFAULT_TYPE = BitmapType::BITMAP_TYPE_INVALID # not supported
28
+ end
37
29
 
38
- # Redefine the initialize method so it raises an exception if a
39
- # non-existent file is given to the constructor; otherwise, wx Widgets
40
- # just carries on with an empty bitmap, which may cause faults
41
- # later. Also, be helpful and try to guess the bitmap type from the
42
- # filename if it's not specified
43
- wx_init = self.instance_method(:initialize)
44
- define_method(:initialize) do | *args |
45
- # If creating from a file, check it exists
46
- if args[0].kind_of? String
47
- if not File.exist?( File.expand_path(args[0]) )
48
- Kernel.raise(ArgumentError, "Bitmap file does not exist: #{args[0]}")
49
- end
50
- # If type not specified, try to guess it from the file extension
51
- if not args[1] and file_ext = args[0][/\w+$/]
52
- args[1] = BITMAP_TYPE_GUESS[file_ext.downcase]
30
+ class Bitmap
31
+ # Allow wxRuby to guess the type of an image file from its extension.
32
+ BITMAP_TYPE_GUESS = {
33
+ 'bmp' => Wx::BitmapType::BITMAP_TYPE_BMP,
34
+ 'gif' => Wx::BitmapType::BITMAP_TYPE_GIF,
35
+ 'ico' => Wx::BitmapType::BITMAP_TYPE_ICO,
36
+ 'jpeg' => Wx::BitmapType::BITMAP_TYPE_JPEG,
37
+ 'jpg' => Wx::BitmapType::BITMAP_TYPE_JPEG,
38
+ 'pbm' => Wx::BitmapType::BITMAP_TYPE_PNM,
39
+ 'pcx' => Wx::BitmapType::BITMAP_TYPE_PCX,
40
+ 'pgm' => Wx::BitmapType::BITMAP_TYPE_PNM,
41
+ 'png' => Wx::BitmapType::BITMAP_TYPE_PNG,
42
+ 'pnm' => Wx::BitmapType::BITMAP_TYPE_PNM,
43
+ 'ppm' => Wx::BitmapType::BITMAP_TYPE_PNM,
44
+ 'tga' => Wx::BitmapType::BITMAP_TYPE_TGA,
45
+ 'tif' => Wx::BitmapType::BITMAP_TYPE_TIF,
46
+ 'tiff' => Wx::BitmapType::BITMAP_TYPE_TIF,
47
+ 'xbm' => Wx::BitmapType::BITMAP_TYPE_XBM,
48
+ 'xpm' => Wx::BitmapType::BITMAP_TYPE_XPM
49
+ }
50
+
51
+ # Constructor copying data from an image
52
+ def self.from_image(img, depth = -1)
53
+ new(img, depth)
54
+ end
55
+
56
+ # Create a new bitmap from an icon
57
+ def self.from_icon(icon)
58
+ bmp = self.new
59
+ bmp.copy_from_icon(icon)
60
+ bmp
61
+ end
62
+
63
+ # Ruby methods that switch class are conventionally named to_foo
64
+ alias :to_image :convert_to_image
65
+
66
+ # Redefine the initialize method so it raises an exception if a
67
+ # non-existent file is given to the constructor; otherwise, wx Widgets
68
+ # just carries on with an empty bitmap, which may cause faults
69
+ # later. Also, be helpful and try to guess the bitmap type from the
70
+ # filename if it's not specified
71
+ wx_init = self.instance_method(:initialize)
72
+ define_method(:initialize) do | *args |
73
+ # If creating from a file, check it exists
74
+ if args[0].kind_of? String
75
+ if not File.exist?( File.expand_path(args[0]) )
76
+ Kernel.raise(ArgumentError, "Bitmap file does not exist: #{args[0]}")
77
+ end
78
+ # If type not specified, try to guess it from the file extension
79
+ if not args[1] and file_ext = args[0][/\w+$/]
80
+ args[1] = BITMAP_TYPE_GUESS[file_ext.downcase]
81
+ end
53
82
  end
83
+ wx_init.bind(self).call(*args)
84
+ end
85
+
86
+ # Accepts a block, which will be passed a device context which can be
87
+ # used to draw upon the Bitmap
88
+ def draw
89
+ dc = Wx::MemoryDC.new
90
+ dc.select_object(self)
91
+ yield dc
92
+ dc.select_object( Wx::NULL_BITMAP )
54
93
  end
55
- wx_init.bind(self).call(*args)
56
94
  end
57
95
 
58
- # Accepts a block, which will be passed a device context which can be
59
- # used to draw upon the Bitmap
60
- def draw
61
- dc = Wx::MemoryDC.new
62
- dc.select_object(self)
63
- yield dc
64
- dc.select_object( Wx::NULL_BITMAP )
96
+ def self.Bitmap(name, bmp_type = nil)
97
+ art_path = File.dirname(caller_path = caller_locations(1).first.absolute_path)
98
+ art_owner = File.basename(caller_path, '.*')
99
+ art_file = ArtLocator.find_art(name, art_type: :bitmap, art_path: art_path, art_section: art_owner, bmp_type: bmp_type)
100
+ ::Kernel.raise ArgumentError, "Cannot locate art file for #{name}:Bitmap" unless art_file
101
+ Bitmap.new(art_file, bmp_type)
65
102
  end
66
103
  end
@@ -0,0 +1,12 @@
1
+
2
+ module Wx
3
+
4
+ def self.Cursor(name, bmp_type = nil, *rest)
5
+ art_path = File.dirname(caller_path = caller_locations(1).first.absolute_path)
6
+ art_owner = File.basename(caller_path, '.*')
7
+ art_file = ArtLocator.find_art(name, art_type: :icon, art_path: art_path, art_section: art_owner, bmp_type: bmp_type)
8
+ ::Kernel.raise ArgumentError, "Cannot locate art file for #{name}:Cursor" unless art_file
9
+ Cursor.new(art_file, bmp_type || Wx::Bitmap::BITMAP_TYPE_GUESS[File.extname(art_file).sub(/\A\./,'')], *rest)
10
+ end
11
+
12
+ end