wxruby3-shapes 0.9.0.pre.beta.3 → 0.9.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/INSTALL.md +5 -7
  3. data/README.md +38 -6
  4. data/assets/logo.svg +339 -0
  5. data/assets/logo.xpm +60 -0
  6. data/assets/screenshot.png +0 -0
  7. data/assets/social.png +0 -0
  8. data/bin/wx-shapes +1 -1
  9. data/lib/wx/shapes/arrow_base.rb +4 -11
  10. data/lib/wx/shapes/arrows/circle_arrow.rb +22 -11
  11. data/lib/wx/shapes/arrows/circle_prong_arrow.rb +48 -0
  12. data/lib/wx/shapes/arrows/cross_bar_arrow.rb +57 -0
  13. data/lib/wx/shapes/arrows/cross_bar_circle_arrow.rb +56 -0
  14. data/lib/wx/shapes/arrows/cross_bar_prong_arrow.rb +49 -0
  15. data/lib/wx/shapes/arrows/crossed_circle.rb +46 -0
  16. data/lib/wx/shapes/arrows/cup_arrow.rb +65 -0
  17. data/lib/wx/shapes/arrows/diamond_arrow.rb +8 -13
  18. data/lib/wx/shapes/arrows/double_cross_bar_arrow.rb +27 -0
  19. data/lib/wx/shapes/arrows/filled_arrow.rb +60 -0
  20. data/lib/wx/shapes/arrows/line_arrow.rb +67 -0
  21. data/lib/wx/shapes/arrows/open_arrow.rb +22 -23
  22. data/lib/wx/shapes/arrows/prong_arrow.rb +42 -0
  23. data/lib/wx/shapes/arrows/solid_arrow.rb +21 -35
  24. data/lib/wx/shapes/arrows/square_arrow.rb +37 -0
  25. data/lib/wx/shapes/auto_layout.rb +2 -2
  26. data/lib/wx/shapes/base.rb +1 -1
  27. data/lib/wx/shapes/canvas_history.rb +20 -0
  28. data/lib/wx/shapes/connection_point.rb +10 -6
  29. data/lib/wx/shapes/diagram.rb +98 -78
  30. data/lib/wx/shapes/events.rb +8 -8
  31. data/lib/wx/shapes/printout.rb +3 -16
  32. data/lib/wx/shapes/serializable.rb +2 -436
  33. data/lib/wx/shapes/serialize/wx.rb +30 -18
  34. data/lib/wx/shapes/shape.rb +211 -168
  35. data/lib/wx/shapes/shape_canvas.rb +728 -267
  36. data/lib/wx/shapes/shape_data_object.rb +99 -18
  37. data/lib/wx/shapes/shape_handle.rb +18 -11
  38. data/lib/wx/shapes/shape_list.rb +34 -67
  39. data/lib/wx/shapes/shapes/bitmap_shape.rb +23 -24
  40. data/lib/wx/shapes/shapes/box_shape.rb +389 -0
  41. data/lib/wx/shapes/shapes/circle_shape.rb +19 -22
  42. data/lib/wx/shapes/shapes/control_shape.rb +77 -41
  43. data/lib/wx/shapes/shapes/curve_shape.rb +38 -31
  44. data/lib/wx/shapes/shapes/diamond_shape.rb +7 -17
  45. data/lib/wx/shapes/shapes/edit_text_shape.rb +6 -9
  46. data/lib/wx/shapes/shapes/ellipse_shape.rb +12 -15
  47. data/lib/wx/shapes/shapes/flex_grid_shape.rb +58 -33
  48. data/lib/wx/shapes/shapes/grid_shape.rb +259 -161
  49. data/lib/wx/shapes/shapes/line_shape.rb +155 -161
  50. data/lib/wx/shapes/shapes/manager_shape.rb +77 -0
  51. data/lib/wx/shapes/shapes/multi_sel_rect.rb +8 -8
  52. data/lib/wx/shapes/shapes/ortho_shape.rb +31 -36
  53. data/lib/wx/shapes/shapes/polygon_shape.rb +23 -29
  54. data/lib/wx/shapes/shapes/rect_shape.rb +95 -53
  55. data/lib/wx/shapes/shapes/round_ortho_shape.rb +6 -8
  56. data/lib/wx/shapes/shapes/round_rect_shape.rb +20 -24
  57. data/lib/wx/shapes/shapes/square_shape.rb +14 -17
  58. data/lib/wx/shapes/shapes/text_shape.rb +95 -53
  59. data/lib/wx/shapes/version.rb +1 -1
  60. data/lib/wx/shapes/wx.rb +16 -7
  61. data/lib/wx/wx-shapes/cmd/test.rb +1 -1
  62. data/samples/demo/arrows.json +1 -0
  63. data/samples/demo/arrows.yaml +793 -0
  64. data/samples/demo/art/HBox.xpm +22 -0
  65. data/samples/demo/art/VBox.xpm +22 -0
  66. data/samples/demo/art/logo.xpm +60 -0
  67. data/samples/demo/class.json +1 -0
  68. data/samples/demo/class.yaml +5631 -0
  69. data/samples/demo/demo.rb +301 -91
  70. data/samples/demo/dialogs.rb +1405 -0
  71. data/samples/demo/erd.json +1 -0
  72. data/samples/demo/erd.yaml +4072 -0
  73. data/samples/demo/frame_canvas.rb +409 -33
  74. data/samples/sample1/art/logo.xpm +60 -0
  75. data/samples/sample1/sample.rb +11 -11
  76. data/samples/sample2/art/logo.xpm +60 -0
  77. data/samples/sample2/sample.rb +2 -2
  78. data/samples/sample2/sample_shape.rb +15 -15
  79. data/samples/sample3/art/logo.xpm +60 -0
  80. data/samples/sample3/sample.rb +3 -3
  81. data/samples/sample4/art/logo.xpm +60 -0
  82. data/samples/sample4/sample.rb +2 -2
  83. data/tests/lib/wxapp_runner.rb +4 -0
  84. data/tests/serializer_tests.rb +8 -441
  85. data/tests/test_grid_shapes.rb +2 -2
  86. data/tests/test_serialize_xml.rb +17 -0
  87. data/tests/test_serialize_yaml.rb +2 -2
  88. metadata +78 -28
  89. data/lib/wx/shapes/serialize/core.rb +0 -40
  90. data/lib/wx/shapes/serialize/id.rb +0 -82
  91. data/lib/wx/shapes/serializer/json.rb +0 -258
  92. data/lib/wx/shapes/serializer/yaml.rb +0 -125
  93. data/samples/demo/art/sample.xpm +0 -251
  94. data/samples/sample1/art/sample.xpm +0 -251
  95. data/samples/sample2/art/sample.xpm +0 -251
  96. data/samples/sample3/art/sample.xpm +0 -251
  97. data/samples/sample4/art/sample.xpm +0 -251
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e87fc628c22cdd597cdffbcd842d207cee3542b4b18c599abb2240b56a1b623f
4
- data.tar.gz: aca8560f77c6f20e25a25a9905ea0e2f84b6b2d4293dd8341f772882acf52880
3
+ metadata.gz: '057851261926749b3b0c1174530f5e98ea2dd9c743ca228c1d8d5d03ef1af6b3'
4
+ data.tar.gz: affa03b0ac6a1547ddc4d92a3b0a7a031bc6fe93c843428d3f9be81cc2b5c846
5
5
  SHA512:
6
- metadata.gz: 96cedb90feb6f2bf21044f17c45e55be647e34f20f14035742cf8fa0aa6e9671d732dd8d6f7878900a799d696d29aa1975434674468de15f0038a29c3b68c423
7
- data.tar.gz: 95c952c4a3c94e492eac23f854b6465dd185c063266b975ec68ec8929877d4de3302bba71dce5b9e06238ded4828cffbdeb74e258ff23f02cd256e20fa3156a2
6
+ metadata.gz: 5b5f1f3377fd54a5613023b58c02de7ec451bd50e53a3ac0ebbef1ac2d5fd792458f77a50a6295cf417839f7157853eb8db4ef45203ae1aabe7be5e9a438e973
7
+ data.tar.gz: 4400bd26bceb8eb6589aaa0571e74986084e0c9774f0a23072330f5d76e50ce81ebae1dee87000bc7069e4f925391beee29c95746017bb563b80b57551f9dcad
data/INSTALL.md CHANGED
@@ -14,13 +14,11 @@ gem install wxruby3-shapes
14
14
  ```
15
15
 
16
16
  This will install the wxruby3-shapes gem on any system supporting Ruby and wxRuby.
17
- As wxRuby3/Shapes has a dependency on wxRuby3 the wxRuby3 gem will be attempted to be installed if (the required version is)
18
- not yet installed. This will be attempted using a default installation of the wxRuby3 gem. As this is a gem building
19
- a native extension (except for Windows where the default install will be a prebuilt binary extension gem) this can take quite a
20
- while.
21
-
22
- Due to the dependencies of the wxRuby3 gem itself it might be preferable to install that gem separately beforehand. See the
23
- [INSTALL](https://github.com/mcorino/wxRuby3/blob/master/INSTALL.md) document of the wxRuby3 project for more details.
17
+ As wxRuby3/Shapes has a dependency on wxRuby3 the wxRuby3 gem will be installed as well if not yet installed.
18
+ Depending on your system this may install a prebuilt binary package (see the [wxRuby3](https://github.com/mcorino/wxRuby3)
19
+ project for more information about supported platforms) or require you to run a post-install step to build the wxRuby3
20
+ extension library binaries before you can use wxRuby3/Shapes (see the
21
+ [INSTALL](https://github.com/mcorino/wxRuby3/blob/master/INSTALL.md) document of the wxRuby3 project for more details).
24
22
 
25
23
  ## Building from source
26
24
 
data/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  # wxRuby3/Shapes - A wxRuby3 2D shapes and diagramming framework
9
9
 
10
- ![wxRuby3/Shapes demo](assets/screenshot.png)
10
+ ![Logo](assets/logo.svg)
11
11
 
12
12
  ## Introduction
13
13
 
@@ -21,7 +21,7 @@ The library consists of several classes encapsulating a so called 'Shape canvas'
21
21
  GUI control used for management of diagrams) providing the following features:
22
22
 
23
23
  - Create charts (diagrams) interactively in your wxRuby3 applications
24
- - Serialize/deserialize charts to file or any io stream in multiple formats (currently supported formats are JSON and YAML)
24
+ - Serialize/deserialize charts to file or any io stream in multiple formats (currently supported formats are JSON, YAML and XML)
25
25
  - Support for Clipboard operations (Cut/Paste) and Drag&Drop of diagram components (shapes)
26
26
  - Support for Undo/Redo operations
27
27
  - Support for alignment of diagram components.
@@ -29,9 +29,10 @@ GUI control used for management of diagrams) providing the following features:
29
29
  - Support for diagram export to bitmap (any supported type)
30
30
  - Support for Thumbnail view of diagram
31
31
  - A standard collection of diagram components
32
- - Shapes: basic rectangular, square, circle, ellipse, rounded rectangle, grid, flexible grid, text, editable text, polygonal, diamond, bitmap
32
+ - Shapes: basic rectangular, square, circle, ellipse, rounded rectangle, grid, flexible grid, horizontal box,
33
+ vertical box, text, editable text, polygonal, diamond, bitmap
33
34
  - Lines: straight, curved, orthogonal, rounded orthogonal
34
- - Line arrows: solid, open, diamond, circle
35
+ - Line arrows: solid, open, diamond, circle, cup, prong, square, crossbar, etc.
35
36
  - Highly customizable and extendable
36
37
 
37
38
  The shape framework (and shape canvas) allows to define the relationship between various
@@ -43,6 +44,37 @@ of diagrams.
43
44
  More over, the library source code is pure Ruby based on wxRuby3 GUI toolkit, so it will
44
45
  run on any platform that supports Ruby and wxRuby3.
45
46
 
47
+ ![Screenshot](assets/screenshot.png)
48
+
49
+ ### To install
50
+
51
+ The wxRuby3/Shapes project provides gems on [RubyGems](https://rubygems.org) which can be installed with the
52
+ standard `gem install` command line this:
53
+
54
+ ```shell
55
+ gem install wxruby3-shapes
56
+ ```
57
+
58
+ See [INSTALL](INSTALL.md) for more details.
59
+
60
+ ### To test
61
+
62
+ After installation run this:
63
+
64
+ ```shell
65
+ wx-shapes test
66
+ ```
67
+
68
+ ### To run a demonstration application
69
+
70
+ After installation run this:
71
+
72
+ ```shell
73
+ wx-shapes sampler
74
+ ```
75
+
76
+ See the output of `wx-shapes --help` for more options.
77
+
46
78
  ## wxRuby3/Shapes licence
47
79
 
48
80
  wxruby3/shapes is free and open-source. It is distributed under the liberal
@@ -102,13 +134,13 @@ This documentation (for the latest release) is also available online
102
134
  with the following major implementation differences:
103
135
 
104
136
  - wxRuby3/Shapes implements a totally different serialization scheme in which none of the XML serializer
105
- code has been ported. In fact wxRuby3/Shapes does not offer any XML serialization out of the box but instead
106
- provides a more adaptable implementation with (for now) two supported output formats; JSON and YAML.
137
+ code has been ported but instead relies on the [FIRM](https://github.com/mcorino/firm) gem for serialization support.
107
138
  - Related to this the internal management of shape references has been changed as well as this was tightly
108
139
  linked to the serialization implementation.
109
140
  - The API has been Ruby-fied with respect to constant names, method names and argument passing and return
110
141
  values.
111
142
  - The ScaledDC class has been integrated with wxRuby3 and is not part of wxRuby3/Shapes.
143
+ - The implementation has been noticeably improved and extended compared to the wxShapeFramework implementation.
112
144
 
113
145
  In addition many small tweaks, improvements and also bugfixes have been implemented as part of the port.
114
146
 
data/assets/logo.svg ADDED
@@ -0,0 +1,339 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <svg
3
+ xmlns:ooo="http://xml.openoffice.org/svg/export"
4
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
5
+ xmlns:cc="http://creativecommons.org/ns#"
6
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
7
+ xmlns:svg="http://www.w3.org/2000/svg"
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
10
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
11
+ version="1.2"
12
+ width="105.83334mm"
13
+ height="105.83334mm"
14
+ viewBox="0 0 10583.333 10583.333"
15
+ preserveAspectRatio="xMidYMid"
16
+ fill-rule="evenodd"
17
+ stroke-width="28.222"
18
+ stroke-linejoin="round"
19
+ xml:space="preserve"
20
+ id="svg107"
21
+ sodipodi:docname="logo.svg"
22
+ inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"><metadata
23
+ id="metadata111"><rdf:RDF><cc:Work
24
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
25
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><sodipodi:namedview
26
+ pagecolor="#ffffff"
27
+ bordercolor="#666666"
28
+ borderopacity="1"
29
+ objecttolerance="10"
30
+ gridtolerance="10"
31
+ guidetolerance="10"
32
+ inkscape:pageopacity="0"
33
+ inkscape:pageshadow="2"
34
+ inkscape:window-width="3440"
35
+ inkscape:window-height="1368"
36
+ id="namedview109"
37
+ showgrid="false"
38
+ inkscape:zoom="1.2611806"
39
+ inkscape:cx="186.73746"
40
+ inkscape:cy="181.67313"
41
+ inkscape:window-x="0"
42
+ inkscape:window-y="0"
43
+ inkscape:window-maximized="1"
44
+ inkscape:current-layer="g105"
45
+ inkscape:document-rotation="0" />
46
+ <defs
47
+ class="ClipPathGroup"
48
+ id="defs8">
49
+ <clipPath
50
+ id="presentation_clip_path"
51
+ clipPathUnits="userSpaceOnUse">
52
+ <rect
53
+ x="0"
54
+ y="0"
55
+ width="15000"
56
+ height="15000"
57
+ id="rect2" />
58
+ </clipPath>
59
+ <clipPath
60
+ id="presentation_clip_path_shrink"
61
+ clipPathUnits="userSpaceOnUse">
62
+ <rect
63
+ x="15"
64
+ y="15"
65
+ width="14970"
66
+ height="14970"
67
+ id="rect5" />
68
+ </clipPath>
69
+
70
+
71
+ </defs>
72
+ <defs
73
+ class="TextShapeIndex"
74
+ id="defs12">
75
+ <g
76
+ ooo:slide="id1"
77
+ ooo:id-list="id3 id4 id5 id6 id7 id8"
78
+ id="g10" />
79
+ </defs>
80
+ <defs
81
+ class="EmbeddedBulletChars"
82
+ id="defs44">
83
+ <g
84
+ id="bullet-char-template-57356"
85
+ transform="matrix(4.8828125e-4,0,0,-4.8828125e-4,0,0)">
86
+ <path
87
+ d="M 580,1141 1163,571 580,0 -4,571 Z"
88
+ id="path14" />
89
+ </g>
90
+ <g
91
+ id="bullet-char-template-57354"
92
+ transform="matrix(4.8828125e-4,0,0,-4.8828125e-4,0,0)">
93
+ <path
94
+ d="M 8,1128 H 1137 V 0 H 8 Z"
95
+ id="path17" />
96
+ </g>
97
+ <g
98
+ id="bullet-char-template-10146"
99
+ transform="matrix(4.8828125e-4,0,0,-4.8828125e-4,0,0)">
100
+ <path
101
+ d="M 174,0 602,739 174,1481 1456,739 Z M 1358,739 309,1346 659,739 Z"
102
+ id="path20" />
103
+ </g>
104
+ <g
105
+ id="bullet-char-template-10132"
106
+ transform="matrix(4.8828125e-4,0,0,-4.8828125e-4,0,0)">
107
+ <path
108
+ d="M 2015,739 1276,0 H 717 l 543,543 H 174 v 393 h 1086 l -543,545 h 557 z"
109
+ id="path23" />
110
+ </g>
111
+ <g
112
+ id="bullet-char-template-10007"
113
+ transform="matrix(4.8828125e-4,0,0,-4.8828125e-4,0,0)">
114
+ <path
115
+ d="m 0,-2 c -7,16 -16,29 -25,39 l 381,530 c -94,256 -141,385 -141,387 0,25 13,38 40,38 9,0 21,-2 34,-5 21,4 42,12 65,25 l 27,-13 111,-251 280,301 64,-25 24,25 c 21,-10 41,-24 62,-43 C 886,937 835,863 770,784 769,783 710,716 594,584 L 774,223 c 0,-27 -21,-55 -63,-84 l 16,-20 C 717,90 699,76 672,76 641,76 570,178 457,381 L 164,-76 c -22,-34 -53,-51 -92,-51 -42,0 -63,17 -64,51 -7,9 -10,24 -10,44 0,9 1,19 2,30 z"
116
+ id="path26" />
117
+ </g>
118
+ <g
119
+ id="bullet-char-template-10004"
120
+ transform="matrix(4.8828125e-4,0,0,-4.8828125e-4,0,0)">
121
+ <path
122
+ d="M 285,-33 C 182,-33 111,30 74,156 52,228 41,333 41,471 c 0,78 14,145 41,201 34,71 87,106 158,106 53,0 88,-31 106,-94 l 23,-176 c 8,-64 28,-97 59,-98 l 735,706 c 11,11 33,17 66,17 42,0 63,-15 63,-46 V 965 c 0,-36 -10,-64 -30,-84 L 442,47 C 390,-6 338,-33 285,-33 Z"
123
+ id="path29" />
124
+ </g>
125
+ <g
126
+ id="bullet-char-template-9679"
127
+ transform="matrix(4.8828125e-4,0,0,-4.8828125e-4,0,0)">
128
+ <path
129
+ d="M 813,0 C 632,0 489,54 383,161 276,268 223,411 223,592 c 0,181 53,324 160,431 106,107 249,161 430,161 179,0 323,-54 432,-161 108,-107 162,-251 162,-431 0,-180 -54,-324 -162,-431 C 1136,54 992,0 813,0 Z"
130
+ id="path32" />
131
+ </g>
132
+ <g
133
+ id="bullet-char-template-8226"
134
+ transform="matrix(4.8828125e-4,0,0,-4.8828125e-4,0,0)">
135
+ <path
136
+ d="m 346,457 c -73,0 -137,26 -191,78 -54,51 -81,114 -81,188 0,73 27,136 81,188 54,52 118,78 191,78 73,0 134,-26 185,-79 51,-51 77,-114 77,-187 0,-75 -25,-137 -76,-188 -50,-52 -112,-78 -186,-78 z"
137
+ id="path35" />
138
+ </g>
139
+ <g
140
+ id="bullet-char-template-8211"
141
+ transform="matrix(4.8828125e-4,0,0,-4.8828125e-4,0,0)">
142
+ <path
143
+ d="M -4,459 H 1135 V 606 H -4 Z"
144
+ id="path38" />
145
+ </g>
146
+ <g
147
+ id="bullet-char-template-61548"
148
+ transform="matrix(4.8828125e-4,0,0,-4.8828125e-4,0,0)">
149
+ <path
150
+ d="m 173,740 c 0,163 58,303 173,419 116,115 255,173 419,173 163,0 302,-58 418,-173 116,-116 174,-256 174,-419 0,-163 -58,-303 -174,-418 C 1067,206 928,148 765,148 601,148 462,206 346,322 231,437 173,577 173,740 Z"
151
+ id="path41" />
152
+ </g>
153
+ </defs>
154
+ <g
155
+ id="g49"
156
+ transform="matrix(1.1969142,0,0,1.1920121,-2057.6568,-2303.8129)">
157
+ <g
158
+ id="id2"
159
+ class="Master_Slide">
160
+ <g
161
+ id="bg-id2"
162
+ class="Background" />
163
+ <g
164
+ id="bo-id2"
165
+ class="BackgroundObjects" />
166
+ </g>
167
+ </g>
168
+ <g
169
+ class="SlideGroup"
170
+ id="g105"
171
+ transform="matrix(1.1969142,0,0,1.1920121,-2057.6568,-2303.8129)">
172
+ <g
173
+ id="container-id1"
174
+ transform="matrix(0.63636359,0,0,0.63636355,1523.6329,1517.9165)">
175
+ <g
176
+ id="id1"
177
+ class="Slide"
178
+ clip-path="url(#presentation_clip_path)">
179
+ <g
180
+ class="Page"
181
+ id="g99">
182
+ <g
183
+ class="com.sun.star.drawing.LineShape"
184
+ id="g58">
185
+ <g
186
+ id="id3">
187
+ <rect
188
+ class="BoundingBox"
189
+ stroke="none"
190
+ fill="none"
191
+ x="1979"
192
+ y="6330"
193
+ width="1013"
194
+ height="3098"
195
+ id="rect51" />
196
+ <path
197
+ fill="none"
198
+ stroke="#818181"
199
+ stroke-width="353"
200
+ stroke-linejoin="round"
201
+ d="M 2500,9250 2485,7391"
202
+ id="path53" />
203
+ <path
204
+ fill="#818181"
205
+ stroke="none"
206
+ d="m 2986,7375 -456,-1003 -22,-29 -30,-12 -33,12 -21,26 -440,1014 -5,13 v 8 l 5,21 13,21 17,13 21,3 901,-7 21,-4 21,-13 8,-21 4,-21 v -8 z"
207
+ id="path55" />
208
+ </g>
209
+ </g>
210
+ <g
211
+ class="com.sun.star.drawing.CustomShape"
212
+ id="g65">
213
+ <g
214
+ id="id4">
215
+ <rect
216
+ class="BoundingBox"
217
+ stroke="none"
218
+ fill="none"
219
+ x="1397"
220
+ y="1397"
221
+ width="4957"
222
+ height="4957"
223
+ id="rect60" />
224
+ <path
225
+ fill="none"
226
+ stroke="#ffd700"
227
+ stroke-width="706"
228
+ stroke-linejoin="round"
229
+ d="M 3875,6000 H 1750 V 1750 h 4250 v 4250 z"
230
+ id="path62" />
231
+ </g>
232
+ </g>
233
+ <g
234
+ class="com.sun.star.drawing.CustomShape"
235
+ id="g72">
236
+ <g
237
+ id="id5">
238
+ <rect
239
+ class="BoundingBox"
240
+ stroke="none"
241
+ fill="none"
242
+ x="7647"
243
+ y="4197"
244
+ width="5708"
245
+ height="5708"
246
+ id="rect67" />
247
+ <path
248
+ fill="none"
249
+ stroke="#b22222"
250
+ stroke-width="706"
251
+ stroke-linejoin="round"
252
+ d="m 13001,7051 c 0,438 -116,870 -335,1250 -219,380 -535,696 -915,915 -380,219 -812,335 -1250,335 -439,0 -871,-116 -1251,-335 -380,-219 -696,-535 -915,-915 -219,-380 -335,-812 -335,-1250 0,-439 116,-871 335,-1251 219,-380 535,-696 915,-915 380,-219 812,-335 1251,-335 438,0 870,116 1250,335 380,219 696,535 915,915 219,380 335,812 335,1250 z"
253
+ id="path69" />
254
+ </g>
255
+ </g>
256
+ <g
257
+ class="com.sun.star.drawing.CustomShape"
258
+ id="g79">
259
+ <g
260
+ id="id6">
261
+ <rect
262
+ class="BoundingBox"
263
+ stroke="none"
264
+ fill="none"
265
+ x="1197"
266
+ y="7397"
267
+ width="6208"
268
+ height="6208"
269
+ id="rect74" />
270
+ <path
271
+ fill="none"
272
+ stroke="#00008b"
273
+ stroke-width="706"
274
+ stroke-linejoin="round"
275
+ d="M 4300,7750 7051,10500 4300,13251 1550,10500 Z"
276
+ id="path76" />
277
+ </g>
278
+ </g>
279
+ <g
280
+ class="com.sun.star.drawing.PolyLineShape"
281
+ id="g88">
282
+ <g
283
+ id="id7">
284
+ <rect
285
+ class="BoundingBox"
286
+ stroke="none"
287
+ fill="none"
288
+ x="6173"
289
+ y="2373"
290
+ width="4584"
291
+ height="1869"
292
+ id="rect81" />
293
+ <path
294
+ fill="none"
295
+ stroke="#818181"
296
+ stroke-width="353"
297
+ stroke-linejoin="round"
298
+ d="m 6350,2550 h 3900 v 631"
299
+ id="path83" />
300
+ <path
301
+ fill="#818181"
302
+ stroke="none"
303
+ d="m 9748,3193 449,1006 22,30 29,12 33,-12 21,-26 449,-1010 5,-13 v -8 l -5,-21 -12,-21 -17,-13 -21,-4 h -902 l -21,4 -21,13 -9,21 -3,21 v 8 z"
304
+ id="path85" />
305
+ </g>
306
+ </g>
307
+ <g
308
+ class="com.sun.star.drawing.PolyLineShape"
309
+ id="g97">
310
+ <g
311
+ id="id8">
312
+ <rect
313
+ class="BoundingBox"
314
+ stroke="none"
315
+ fill="none"
316
+ x="5595"
317
+ y="9707"
318
+ width="5083"
319
+ height="3150"
320
+ id="rect90" />
321
+ <path
322
+ fill="none"
323
+ stroke="#818181"
324
+ stroke-width="353"
325
+ stroke-linejoin="round"
326
+ d="m 6655,12350 h 3845 V 9884"
327
+ id="path92" />
328
+ <path
329
+ fill="#818181"
330
+ stroke="none"
331
+ d="m 6643,11848 -1006,449 -30,22 -12,29 12,33 26,21 1010,449 13,5 h 8 l 21,-5 21,-12 13,-17 4,-21 v -902 l -4,-21 -13,-21 -21,-9 -21,-3 h -8 z"
332
+ id="path94" />
333
+ </g>
334
+ </g>
335
+ </g>
336
+ </g>
337
+ </g>
338
+ </g>
339
+ </svg>
data/assets/logo.xpm ADDED
@@ -0,0 +1,60 @@
1
+ /* XPM */
2
+ static char * logo_xpm[] = {
3
+ "32 32 25 1",
4
+ " c None",
5
+ ". c #FFD700",
6
+ "+ c #000000",
7
+ "@ c #B22222",
8
+ "# c #060400",
9
+ "$ c #052092",
10
+ "% c #041C91",
11
+ "& c #051F92",
12
+ "* c #062594",
13
+ "= c #041E91",
14
+ "- c #000004",
15
+ "; c #052192",
16
+ "> c #051F8F",
17
+ ", c #052293",
18
+ "' c #B22323",
19
+ ") c #751616",
20
+ "! c #062393",
21
+ "~ c #02128F",
22
+ "{ c #041B91",
23
+ "] c #000021",
24
+ "^ c #00000D",
25
+ "/ c #052091",
26
+ "( c #000002",
27
+ "_ c #041D91",
28
+ ": c #041D92",
29
+ " ",
30
+ " ............ ",
31
+ " ............ ",
32
+ " ............+++++++++ ",
33
+ " ............ + ",
34
+ " .... .... +++++ ",
35
+ " .... .... +++ ",
36
+ " .... .... + ",
37
+ " .... .... @@@@@ ",
38
+ " ............ @@@@@@@@ ",
39
+ " ............ @@@@@@@@@@@ ",
40
+ " ............ @@@ @@@ ",
41
+ " ............ @@@ @@@ ",
42
+ " # @@@ @@@ ",
43
+ " +++ @@@ @@@ ",
44
+ " +++++ @@@ @@@ ",
45
+ " + $% @@@ @@@ ",
46
+ " + &**= @@@@ @@@@ ",
47
+ " + &****$ @@@@@@@@@@@ ",
48
+ " -&******; @@@@@@@@@ ",
49
+ " >*** ***, '@@@@@@ ",
50
+ " &*** ***, ) ",
51
+ " &*** ***! + ",
52
+ " ~*** **; + ",
53
+ " {*** **; + ",
54
+ " %*** **$] + ",
55
+ " %*** **$^+ + ",
56
+ " %*****/(+++++++++++ ",
57
+ " _***$ ++ ",
58
+ " :*$ + ",
59
+ " * ",
60
+ " "};
Binary file
data/assets/social.png ADDED
Binary file
data/bin/wx-shapes CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env ruby
1
+ #!/usr/bin/env ruby3.0
2
2
  #---------------------------------
3
3
  # This file is generated
4
4
  #---------------------------------
@@ -8,14 +8,7 @@ module Wx::SF
8
8
 
9
9
  class ArrowBase
10
10
 
11
- include Wx::SF::Serializable
12
-
13
- module DEFAULT
14
- FILL = Wx::Brush.new(Wx::WHITE) if Wx::App.is_main_loop_running
15
- Wx.add_delayed_constant(self, :FILL) { Wx::Brush.new(Wx::WHITE) }
16
- BORDER = Wx::Pen.new(Wx::BLACK) if Wx::App.is_main_loop_running
17
- Wx.add_delayed_constant(self, :BORDER) { Wx::Pen.new(Wx::BLACK) }
18
- end
11
+ include FIRM::Serializable
19
12
 
20
13
  # Constructor
21
14
  # @param [Wx::SF::Shape] parent parent shape
@@ -31,7 +24,7 @@ module Wx::SF
31
24
  alias :parent_shape= :set_parent_shape
32
25
 
33
26
  # Get pointer to a parent shape.
34
- # @return [Wx::SF::Shape] parent shape if exists, otherwise nil
27
+ # @return [Wx::SF::Shape, nil] parent shape if exists, otherwise nil
35
28
  def get_parent_shape
36
29
  @parent_shape
37
30
  end
@@ -40,9 +33,9 @@ module Wx::SF
40
33
  # Draw arrow shape at the end of a virtual line.
41
34
  # @param [Wx::RealPoint] from Start of the virtual line
42
35
  # @param [Wx::RealPoint] to End of the virtual line
43
- # @param [Wx::DC] dc Device context for drawing
36
+ # @return [Wx::Point] translated connection point for arrow
44
37
  def draw(from, to, dc)
45
- # needs to be overridden
38
+ raise NotImplementedError, 'Overload missing'
46
39
  end
47
40
 
48
41
  protected
@@ -1,37 +1,48 @@
1
1
  # Wx::SF::CircleArrow - circle arrow class
2
2
  # Copyright (c) M.J.N. Corino, The Netherlands
3
3
 
4
- require 'wx/shapes/arrows/solid_arrow'
4
+ require 'wx/shapes/arrows/filled_arrow'
5
5
 
6
6
  module Wx::SF
7
7
 
8
- class CircleArrow < SolidArrow
8
+ # Class extends the Wx::FilledArrow class and encapsulates
9
+ # circle arrow shapes.
10
+ class CircleArrow < FilledArrow
9
11
 
10
12
  # Default circle radius.
11
- RADIUS = 4
12
-
13
- property :radius
13
+ RADIUS = 6
14
14
 
15
15
  # Constructor
16
16
  # @param [Wx::SF::Shape] parent parent shape
17
17
  def initialize(parent=nil)
18
18
  super
19
- @radius = 4
19
+ scale
20
+ end
21
+
22
+ # Get the circle radius
23
+ def get_radius
24
+ (RADIUS * @ratio).to_i
20
25
  end
26
+ alias :radius :get_radius
21
27
 
22
- # Get or set the circle radius
23
- attr_accessor :radius
28
+ def scale
29
+ @ratio = 1 + (pen_width / 2) * 0.5
30
+ end
31
+ protected :scale
24
32
 
25
33
  # Draw arrow shape at the end of a virtual line.
26
34
  # @param [Wx::RealPoint] from Start of the virtual line
27
35
  # @param [Wx::RealPoint] to End of the virtual line
28
36
  # @param [Wx::DC] dc Device context for drawing
29
37
  def draw(from, to, dc)
30
- dc.with_pen(@pen) do |dc|
31
- dc.with_brush(@fill) do |dc|
32
- dc.draw_circle(to.to_point, @radius)
38
+ r = radius
39
+ centre, cp = translate_arrow([Wx::RealPoint.new(r, 0), Wx::RealPoint.new(2*r, 0)], from, to)
40
+ dc.with_pen(pen) do |dc|
41
+ dc.with_brush(fill) do |dc|
42
+ dc.draw_circle(centre, r)
33
43
  end
34
44
  end
45
+ cp
35
46
  end
36
47
 
37
48
  end
@@ -0,0 +1,48 @@
1
+ # Wx::SF::CircleProngArrow - circle with prong arrow class
2
+ # Copyright (c) M.J.N. Corino, The Netherlands
3
+
4
+ require 'wx/shapes/arrows/circle_arrow'
5
+
6
+ module Wx::SF
7
+
8
+ # Class extends the Wx::CircleArrow class and encapsulates
9
+ # arrow shape consisting of single two lines bisecting before the end of the
10
+ # parent line shape with a preceding circle.
11
+ class CircleProngArrow < CircleArrow
12
+
13
+ class << self
14
+ def arrow(ratio)
15
+ x = ratio*11; y = ratio*5
16
+ [Wx::RealPoint.new(x,0), Wx::RealPoint.new(0, y), Wx::RealPoint.new(0,-y), Wx::RealPoint.new(0, 0)]
17
+ end
18
+ end
19
+
20
+ def vertices
21
+ @vertices ||= CircleProngArrow.arrow(@ratio)
22
+ end
23
+ private :vertices
24
+
25
+ def scale
26
+ @vertices = nil
27
+ super
28
+ end
29
+ protected :scale
30
+
31
+ # Draw arrow shape at the end of a virtual line.
32
+ # @param [Wx::RealPoint] from Start of the virtual line
33
+ # @param [Wx::RealPoint] to End of the virtual line
34
+ # @param [Wx::DC] dc Device context for drawing
35
+ # @return [Wx::Point] translated connection point for arrow
36
+ def draw(from, to, dc)
37
+ cp, wing1, wing2, tip = translate_arrow(vertices, from, to)
38
+ dc.with_pen(pen) do |dc|
39
+ dc.draw_line(cp, wing1)
40
+ dc.draw_line(cp, wing2)
41
+ dc.draw_line(cp, tip)
42
+ end
43
+ super(from, cp, dc)
44
+ end
45
+
46
+ end
47
+
48
+ end