glimmer-dsl-swt 4.18.3.0 → 4.18.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +59 -0
  3. data/README.md +440 -18
  4. data/VERSION +1 -1
  5. data/glimmer-dsl-swt.gemspec +11 -7
  6. data/lib/ext/glimmer/config.rb +24 -7
  7. data/lib/ext/rouge/themes/glimmer.rb +29 -0
  8. data/lib/glimmer-dsl-swt.rb +0 -1
  9. data/lib/glimmer/data_binding/table_items_binding.rb +8 -5
  10. data/lib/glimmer/data_binding/widget_binding.rb +22 -4
  11. data/lib/glimmer/dsl/swt/image_expression.rb +14 -6
  12. data/lib/glimmer/dsl/swt/layout_data_expression.rb +4 -4
  13. data/lib/glimmer/dsl/swt/layout_expression.rb +5 -3
  14. data/lib/glimmer/swt/custom/code_text.rb +132 -37
  15. data/lib/glimmer/swt/custom/drawable.rb +3 -2
  16. data/lib/glimmer/swt/custom/shape.rb +25 -11
  17. data/lib/glimmer/swt/date_time_proxy.rb +1 -3
  18. data/lib/glimmer/swt/directory_dialog_proxy.rb +3 -3
  19. data/lib/glimmer/swt/display_proxy.rb +26 -5
  20. data/lib/glimmer/swt/file_dialog_proxy.rb +3 -3
  21. data/lib/glimmer/swt/font_proxy.rb +1 -0
  22. data/lib/glimmer/swt/image_proxy.rb +68 -1
  23. data/lib/glimmer/swt/shell_proxy.rb +23 -3
  24. data/lib/glimmer/swt/table_proxy.rb +43 -15
  25. data/lib/glimmer/swt/widget_listener_proxy.rb +14 -5
  26. data/lib/glimmer/swt/widget_proxy.rb +7 -3
  27. data/lib/glimmer/ui/custom_shell.rb +11 -9
  28. data/lib/glimmer/ui/custom_widget.rb +32 -17
  29. data/samples/elaborate/meta_sample.rb +81 -24
  30. data/samples/elaborate/tetris.rb +146 -42
  31. data/samples/elaborate/tetris/model/game.rb +259 -137
  32. data/samples/elaborate/tetris/{view/game_over_dialog.rb → model/past_game.rb} +11 -44
  33. data/samples/elaborate/tetris/model/tetromino.rb +45 -29
  34. data/samples/elaborate/tetris/view/block.rb +8 -13
  35. data/samples/elaborate/tetris/view/high_score_dialog.rb +131 -0
  36. data/samples/elaborate/tetris/view/playfield.rb +1 -1
  37. data/samples/elaborate/tetris/view/score_lane.rb +11 -11
  38. data/samples/elaborate/tetris/view/tetris_menu_bar.rb +139 -0
  39. data/samples/elaborate/tic_tac_toe.rb +4 -4
  40. data/samples/hello/hello_canvas.rb +4 -4
  41. data/samples/hello/hello_canvas_animation.rb +3 -3
  42. data/samples/hello/hello_canvas_transform.rb +1 -1
  43. data/samples/hello/hello_code_text.rb +84 -0
  44. data/samples/hello/hello_link.rb +1 -1
  45. metadata +9 -5
@@ -1,5 +1,5 @@
1
1
  # Copyright (c) 2007-2021 Andy Maleh
2
- #
2
+ #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
5
5
  # "Software"), to deal in the Software without restriction, including
@@ -7,10 +7,10 @@
7
7
  # distribute, sublicense, and/or sell copies of the Software, and to
8
8
  # permit persons to whom the Software is furnished to do so, subject to
9
9
  # the following conditions:
10
- #
10
+ #
11
11
  # The above copyright notice and this permission notice shall be
12
12
  # included in all copies or substantial portions of the Software.
13
- #
13
+ #
14
14
  # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
15
  # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
16
  # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -28,7 +28,7 @@ class TicTacToe
28
28
  @tic_tac_toe_board = Board.new
29
29
  @shell = shell {
30
30
  text "Tic-Tac-Toe"
31
- minimum_size 150, 178
31
+ minimum_size 176, 200
32
32
  composite {
33
33
  grid_layout 3, true
34
34
  (1..3).each { |row|
@@ -30,7 +30,7 @@ shell {
30
30
  rectangle(0, 0, 220, 400, fill: true) {
31
31
  background :red
32
32
  }
33
- rectangle(50, 20, 300, 150, 30, 50, round: true, fill: true) {
33
+ rectangle(50, 20, 300, 150, 30, 50, round: true) {
34
34
  background :magenta
35
35
  }
36
36
  rectangle(150, 200, 100, 70, true, gradient: true) {
@@ -49,13 +49,13 @@ shell {
49
49
  foreground :dark_magenta
50
50
  font name: 'Courier', height: 30
51
51
  }
52
- oval(110, 310, 100, 100, fill: true) {
52
+ oval(110, 310, 100, 100) {
53
53
  background rgb(128, 138, 248)
54
54
  }
55
- arc(210, 210, 100, 100, 30, -77, fill: true) {
55
+ arc(210, 210, 100, 100, 30, -77) {
56
56
  background :red
57
57
  }
58
- polygon(250, 210, 260, 170, 270, 210, 290, 230, fill: true) {
58
+ polygon(250, 210, 260, 170, 270, 210, 290, 230) {
59
59
  background :dark_yellow
60
60
  }
61
61
  polyline(250, 110, 260, 70, 270, 110, 290, 130, 250, 110)
@@ -35,7 +35,7 @@ shell {
35
35
  oval(0, 0, 400, 400) { # x, y, width, height
36
36
  foreground :black # sets oval background color
37
37
  }
38
- arc(0, 0, 400, 400, -1.4*index%360, 10, fill: true) { # x, y, width, height, start angle, arc angle
38
+ arc(0, 0, 400, 400, -1.4*index%360, 10) { # x, y, width, height, start angle, arc angle
39
39
  background rgb(200, 200, 50) # sets arc background color
40
40
  }
41
41
  }
@@ -54,10 +54,10 @@ shell {
54
54
 
55
55
  background outside_color # sets canvas background color
56
56
 
57
- rectangle(0, 0, 200, 200, fill: true) {
57
+ rectangle(0, 0, 200, 200) {
58
58
  background inside_color # sets rectangle background color
59
59
  }
60
- rectangle(200, 200, 200, 200, fill: true) {
60
+ rectangle(200, 200, 200, 200) {
61
61
  background inside_color # sets rectangle background color
62
62
  }
63
63
  }
@@ -6,7 +6,7 @@ shell {
6
6
  text 'Hello, Canvas Transform!'
7
7
  minimum_size 330, 352
8
8
 
9
- canvas { |canvas_proxy|
9
+ canvas {
10
10
  background :white
11
11
 
12
12
  image(glimmer_logo, 0, 0) {
@@ -0,0 +1,84 @@
1
+ # Copyright (c) 2007-2021 Andy Maleh
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining
4
+ # a copy of this software and associated documentation files (the
5
+ # "Software"), to deal in the Software without restriction, including
6
+ # without limitation the rights to use, copy, modify, merge, publish,
7
+ # distribute, sublicense, and/or sell copies of the Software, and to
8
+ # permit persons to whom the Software is furnished to do so, subject to
9
+ # the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be
12
+ # included in all copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
22
+ include Glimmer
23
+
24
+ shell {
25
+ minimum_size 640, 480
26
+ text 'Hello, Code Text!'
27
+
28
+ tab_folder {
29
+ tab_item {
30
+ fill_layout
31
+ text 'ruby (glimmer theme)'
32
+ code_text(language: 'ruby', theme: 'glimmer') {
33
+ text <<~CODE
34
+ greeting = 'Hello, World!'
35
+
36
+ include Glimmer
37
+
38
+ shell {
39
+ text 'Glimmer'
40
+
41
+ label {
42
+ text greeting
43
+ font height: 30, style: :bold
44
+ }
45
+ }
46
+ CODE
47
+ }
48
+ }
49
+ tab_item {
50
+ fill_layout
51
+ text 'html (github theme)'
52
+ code_text(language: 'html', theme: 'github') {
53
+ text <<~CODE
54
+ <html>
55
+ <body>
56
+ <section class="accordion">
57
+ <form method="post" id="name">
58
+ <label for="name">
59
+ Name
60
+ </label>
61
+ <input name="name" type="text" />
62
+ <input type="submit" />
63
+ </form>
64
+ </section>
65
+ </body>
66
+ </html>
67
+ CODE
68
+ }
69
+ }
70
+ tab_item {
71
+ fill_layout
72
+ text 'javascript (pastie theme)'
73
+ code_text(language: 'javascript', theme: 'pastie') {
74
+ text <<~CODE
75
+ function helloWorld(greeting) {
76
+ alert(greeting);
77
+ }
78
+ var greetingString = 'Hello, World!';
79
+ helloWorld(greetingString);
80
+ CODE
81
+ }
82
+ }
83
+ }
84
+ }.open
@@ -49,7 +49,7 @@ shell { |main_shell|
49
49
  }
50
50
  on_mouse_up { |mouse_event|
51
51
  unless @selected_link.nil?
52
- @help_shell.close unless @help_shell.nil? || @help_shell.is_disposed
52
+ @help_shell.close unless @help_shell.nil? || @help_shell.disposed?
53
53
  @help_shell = shell(:no_trim) {
54
54
  grid_layout {
55
55
  margin_width 10
metadata CHANGED
@@ -1,21 +1,21 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimmer-dsl-swt
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.18.3.0
4
+ version: 4.18.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - AndyMaleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-26 00:00:00.000000000 Z
11
+ date: 2021-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 1.0.9
18
+ version: 1.0.11
19
19
  name: glimmer
20
20
  type: :runtime
21
21
  prerelease: false
@@ -23,7 +23,7 @@ dependencies:
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.0.9
26
+ version: 1.0.11
27
27
  - !ruby/object:Gem::Dependency
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
@@ -367,6 +367,7 @@ files:
367
367
  - icons/scaffold_app.png
368
368
  - lib/ext/glimmer.rb
369
369
  - lib/ext/glimmer/config.rb
370
+ - lib/ext/rouge/themes/glimmer.rb
370
371
  - lib/glimmer-dsl-swt.rb
371
372
  - lib/glimmer/Rakefile
372
373
  - lib/glimmer/data_binding/list_selection_binding.rb
@@ -471,11 +472,13 @@ files:
471
472
  - samples/elaborate/tetris.rb
472
473
  - samples/elaborate/tetris/model/block.rb
473
474
  - samples/elaborate/tetris/model/game.rb
475
+ - samples/elaborate/tetris/model/past_game.rb
474
476
  - samples/elaborate/tetris/model/tetromino.rb
475
477
  - samples/elaborate/tetris/view/block.rb
476
- - samples/elaborate/tetris/view/game_over_dialog.rb
478
+ - samples/elaborate/tetris/view/high_score_dialog.rb
477
479
  - samples/elaborate/tetris/view/playfield.rb
478
480
  - samples/elaborate/tetris/view/score_lane.rb
481
+ - samples/elaborate/tetris/view/tetris_menu_bar.rb
479
482
  - samples/elaborate/tic_tac_toe.rb
480
483
  - samples/elaborate/tic_tac_toe/board.rb
481
484
  - samples/elaborate/tic_tac_toe/cell.rb
@@ -487,6 +490,7 @@ files:
487
490
  - samples/hello/hello_canvas_transform.rb
488
491
  - samples/hello/hello_checkbox.rb
489
492
  - samples/hello/hello_checkbox_group.rb
493
+ - samples/hello/hello_code_text.rb
490
494
  - samples/hello/hello_combo.rb
491
495
  - samples/hello/hello_computed.rb
492
496
  - samples/hello/hello_computed/contact.rb