wxruby3 0.9.0.pre.beta.11 → 0.9.0.pre.beta.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/INSTALL.md +85 -0
- data/README.md +2 -0
- data/assets/logo.png +0 -0
- data/assets/logo.svg +170 -0
- data/assets/logo.xcf +0 -0
- data/ext/wxruby3/swig/wx.i +1 -1
- data/lib/wx/accessors.rb +8 -2
- data/lib/wx/core/array_ext.rb +26 -0
- data/lib/wx/core/art_locator.rb +92 -0
- data/lib/wx/core/artprovider.rb +1 -1
- data/lib/wx/core/bitmap.rb +90 -53
- data/lib/wx/core/cursor.rb +12 -0
- data/lib/wx/core/dataformat.rb +3 -1
- data/lib/wx/core/dc.rb +76 -52
- data/lib/wx/core/enum.rb +4 -0
- data/lib/wx/core/event.rb +38 -5
- data/lib/wx/core/evthandler.rb +64 -23
- data/lib/wx/core/icon.rb +50 -35
- data/lib/wx/core/id_helper.rb +32 -0
- data/lib/wx/core/image.rb +63 -53
- data/lib/wx/core/point.rb +14 -0
- data/lib/wx/core/real_point.rb +15 -1
- data/lib/wx/core/rect.rb +42 -7
- data/lib/wx/core/region_iterator.rb +37 -0
- data/lib/wx/core/size.rb +20 -0
- data/lib/wx/core/window.rb +8 -31
- data/lib/wx/doc/array_ext.rb +27 -0
- data/lib/wx/doc/art_locator.rb +57 -0
- data/lib/wx/doc/bitmap.rb +27 -0
- data/lib/wx/doc/clipboard.rb +12 -0
- data/lib/wx/doc/const.rb +77 -0
- data/lib/wx/doc/cursor.rb +16 -0
- data/lib/wx/doc/data_object.rb +1 -2
- data/lib/wx/doc/dc.rb +63 -46
- data/lib/wx/doc/event.rb +24 -0
- data/lib/wx/doc/events.rb +14 -0
- data/lib/wx/doc/evthandler.rb +24 -3
- data/lib/wx/doc/extra/00_starting.md +1 -1
- data/lib/wx/doc/extra/06_geometry.md +10 -4
- data/lib/wx/doc/extra/10_art.md +105 -0
- data/lib/wx/doc/gc_dc.rb +21 -0
- data/lib/wx/doc/gdi_common.rb +122 -1
- data/lib/wx/doc/graphics_context.rb +42 -0
- data/lib/wx/doc/icon.rb +18 -0
- data/lib/wx/doc/id_helper.rb +25 -0
- data/lib/wx/doc/image.rb +33 -0
- data/lib/wx/doc/region_iterator.rb +31 -0
- data/lib/wx/doc/scaled_dc.rb +1 -0
- data/lib/wx/doc/window.rb +18 -0
- data/lib/wx/global_const.rb +24 -18
- data/lib/wx/version.rb +1 -1
- data/lib/wx/wxruby/cmd/sampler.rb +3 -21
- data/rakelib/lib/config.rb +4 -4
- data/rakelib/lib/core/package.rb +3 -3
- data/rakelib/lib/director/art_provider.rb +2 -2
- data/rakelib/lib/director/busy_info.rb +9 -7
- data/rakelib/lib/director/clipboard.rb +1 -1
- data/rakelib/lib/director/colour_picker_ctrl.rb +1 -0
- data/rakelib/lib/director/data_object.rb +72 -4
- data/rakelib/lib/director/derived_dc.rb +100 -6
- data/rakelib/lib/director/dir_picker_ctrl.rb +1 -0
- data/rakelib/lib/director/event.rb +73 -8
- data/rakelib/lib/director/events.rb +19 -1
- data/rakelib/lib/director/file_picker_ctrl.rb +1 -0
- data/rakelib/lib/director/font_picker_ctrl.rb +1 -0
- data/rakelib/lib/director/gdicommon.rb +1 -3
- data/rakelib/lib/director/graphics_context.rb +89 -0
- data/rakelib/lib/director/help_controller.rb +2 -2
- data/rakelib/lib/director/html_data_object.rb +37 -0
- data/rakelib/lib/director/image.rb +55 -0
- data/rakelib/lib/director/region_iterator.rb +48 -0
- data/rakelib/lib/director/richtext_buffer.rb +1 -1
- data/rakelib/lib/director/richtext_buffer_data_object.rb +45 -0
- data/rakelib/lib/director/scroll_bar.rb +39 -0
- data/rakelib/lib/director/slider.rb +39 -0
- data/rakelib/lib/director/window.rb +36 -5
- data/rakelib/lib/director/window_disabler.rb +0 -7
- data/rakelib/lib/extractor/class.rb +1 -1
- data/rakelib/lib/extractor/function.rb +1 -1
- data/rakelib/lib/generate/doc.rb +27 -7
- data/rakelib/lib/specs/interfaces.rb +6 -1
- data/rakelib/lib/typemap/common.rb +1 -1
- data/rakelib/lib/util/string.rb +29 -8
- data/samples/art/wxruby-128x128.png +0 -0
- data/samples/art/wxruby-256x256.png +0 -0
- data/samples/art/wxruby-64x64.png +0 -0
- data/samples/art/wxruby.ico +0 -0
- data/samples/art/wxruby.png +0 -0
- data/samples/drawing/graphics_drawing.rb +1 -2
- data/samples/propgrid/propgrid.rb +65 -65
- data/samples/sample.xpm +246 -470
- data/samples/treectrl/treectrl.rb +1 -1
- data/tests/art/my_art/sample.xpm +251 -0
- data/tests/art/sample3.xpm +251 -0
- data/tests/art/test_art/bitmap/sample.xpm +251 -0
- data/tests/art/test_art/bitmap/wxruby.bmp +0 -0
- data/tests/art/test_art/bitmap/wxruby.png +0 -0
- data/tests/art/test_art/bitmap/wxruby.xpm +251 -0
- data/tests/art/test_art/cursor/wxruby.bmp +0 -0
- data/tests/art/test_art/icon/sample.xpm +251 -0
- data/tests/art/test_art/icon/wxruby.ico +0 -0
- data/tests/art/test_art/icon/wxruby.png +0 -0
- data/tests/art/test_art/image/sample.xpm +251 -0
- data/tests/art/test_art/image/wxruby.jpg +0 -0
- data/tests/art/test_art/image/wxruby.png +0 -0
- data/tests/art/test_art/sample2.xpm +251 -0
- data/tests/test_art.rb +91 -0
- data/tests/test_clipboard.rb +35 -0
- data/tests/test_dc.rb +70 -0
- data/tests/test_events.rb +12 -0
- data/tests/test_geometry.rb +13 -0
- metadata +51 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e6a85a400700ba48119fc656cf79208b3f5f603eaafb01d30206de46876dbf1
|
4
|
+
data.tar.gz: ffe7e7cde7840f547efe45893162bfc54e2bd9402d7aaf975a98f298fbdbdf8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86dc10b04a49bd56825267b23117720fa5b2398cb01194cdd050fa9d8f6c81ba5a80426447a82fa747a725cdb1802bc0138ebd43322c7c162104a14c5a71ebb3
|
7
|
+
data.tar.gz: e9aa356d29c7d571f68a99dbd33041aed71d770951cca3d32a37b5eab634da938b9da931dad7fefafb67ad33401535357c27db647798e764abdd0def4133f09a
|
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
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
|
data/ext/wxruby3/swig/wx.i
CHANGED
@@ -235,7 +235,7 @@ WXRUBY_EXPORT VALUE wxRuby_WrapWxEventInRuby(wxEvent *wx_event)
|
|
235
235
|
}
|
236
236
|
|
237
237
|
// No existing Ruby instance found, so a transitory event object; wrap
|
238
|
-
// without mark or free functions as Wx will
|
238
|
+
// without mark or free functions as Wx will deal with deletion
|
239
239
|
rb_event = Data_Wrap_Struct(rb_event_class, 0, 0, 0);
|
240
240
|
DATA_PTR(rb_event) = wx_event;
|
241
241
|
// do not forget to mark the instance with the mangled swig type name
|
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
|
-
|
60
|
-
|
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
|
data/lib/wx/core/artprovider.rb
CHANGED
data/lib/wx/core/bitmap.rb
CHANGED
@@ -1,66 +1,103 @@
|
|
1
1
|
# A platform-dependent image that can be drawn on the screen
|
2
|
-
|
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
|
-
|
24
|
-
|
25
|
-
|
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
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
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
|
-
|
36
|
-
|
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
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
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
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
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
|
data/lib/wx/core/dataformat.rb
CHANGED
@@ -22,5 +22,7 @@ module Wx
|
|
22
22
|
end
|
23
23
|
DF_FILENAME = DataFormat.new( Wx::DataFormatId::DF_FILENAME )
|
24
24
|
DF_UNICODETEXT = DataFormat.new( Wx::DataFormatId::DF_UNICODETEXT )
|
25
|
-
|
25
|
+
if Wx.has_feature?(:USE_HTML) && Wx::WXWIDGETS_VERSION >= '3.3'
|
26
|
+
DF_HTML = DataFormat.new( Wx::DataFormatId::DF_HTML )
|
27
|
+
end
|
26
28
|
end
|