glimmer-dsl-swt 4.18.2.2 → 4.18.3.1

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 (44) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +53 -0
  3. data/README.md +213 -32
  4. data/VERSION +1 -1
  5. data/glimmer-dsl-swt.gemspec +19 -6
  6. data/lib/ext/glimmer/config.rb +24 -7
  7. data/lib/glimmer/data_binding/widget_binding.rb +14 -4
  8. data/lib/glimmer/dsl/swt/color_expression.rb +4 -4
  9. data/lib/glimmer/dsl/swt/data_binding_expression.rb +3 -3
  10. data/lib/glimmer/dsl/swt/display_expression.rb +3 -3
  11. data/lib/glimmer/dsl/swt/dsl.rb +1 -0
  12. data/lib/glimmer/dsl/swt/multiply_expression.rb +53 -0
  13. data/lib/glimmer/dsl/swt/property_expression.rb +4 -2
  14. data/lib/glimmer/dsl/swt/shape_expression.rb +2 -4
  15. data/lib/glimmer/dsl/swt/transform_expression.rb +55 -0
  16. data/lib/glimmer/dsl/swt/widget_expression.rb +2 -1
  17. data/lib/glimmer/rake_task/scaffold.rb +4 -3
  18. data/lib/glimmer/swt/color_proxy.rb +28 -6
  19. data/lib/glimmer/swt/custom/drawable.rb +8 -0
  20. data/lib/glimmer/swt/custom/shape.rb +66 -26
  21. data/lib/glimmer/swt/directory_dialog_proxy.rb +3 -3
  22. data/lib/glimmer/swt/display_proxy.rb +26 -5
  23. data/lib/glimmer/swt/file_dialog_proxy.rb +3 -3
  24. data/lib/glimmer/swt/layout_data_proxy.rb +3 -3
  25. data/lib/glimmer/swt/shell_proxy.rb +17 -5
  26. data/lib/glimmer/swt/transform_proxy.rb +109 -0
  27. data/lib/glimmer/swt/widget_listener_proxy.rb +14 -5
  28. data/lib/glimmer/swt/widget_proxy.rb +35 -26
  29. data/lib/glimmer/ui/custom_shell.rb +17 -3
  30. data/lib/glimmer/ui/custom_widget.rb +66 -45
  31. data/samples/elaborate/meta_sample.rb +102 -24
  32. data/samples/elaborate/tetris.rb +137 -0
  33. data/samples/elaborate/tetris/model/block.rb +48 -0
  34. data/samples/elaborate/tetris/model/game.rb +226 -0
  35. data/samples/elaborate/tetris/model/tetromino.rb +316 -0
  36. data/samples/elaborate/tetris/view/block.rb +70 -0
  37. data/samples/elaborate/tetris/view/game_over_dialog.rb +68 -0
  38. data/samples/elaborate/tetris/view/playfield.rb +56 -0
  39. data/samples/elaborate/tetris/view/score_lane.rb +87 -0
  40. data/samples/elaborate/tetris/view/tetris_menu_bar.rb +72 -0
  41. data/samples/elaborate/tic_tac_toe.rb +4 -4
  42. data/samples/hello/hello_canvas_transform.rb +40 -0
  43. data/samples/hello/hello_link.rb +1 -1
  44. metadata +17 -4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.18.2.2
1
+ 4.18.3.1
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: glimmer-dsl-swt 4.18.2.2 ruby lib
5
+ # stub: glimmer-dsl-swt 4.18.3.1 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "glimmer-dsl-swt".freeze
9
- s.version = "4.18.2.2"
9
+ s.version = "4.18.3.1"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["AndyMaleh".freeze]
14
- s.date = "2021-01-22"
14
+ s.date = "2021-01-27"
15
15
  s.description = "Glimmer DSL for SWT (JRuby Desktop Development GUI Framework) is a native-GUI cross-platform desktop development library written in JRuby, an OS-threaded faster JVM version of Ruby. Glimmer's main innovation is a declarative Ruby DSL that enables productive and efficient authoring of desktop application user-interfaces by relying on the robust Eclipse SWT library. Glimmer additionally innovates by having built-in data-binding support, which greatly facilitates synchronizing the GUI with domain models, thus achieving true decoupling of object oriented components and enabling developers to solve business problems (test-first) without worrying about GUI concerns, or alternatively drive development GUI-first, and then write clean business models (test-first) afterwards. Not only does Glimmer provide a large set of GUI widgets, but it also supports drawing Canvas Graphics like Shapes and Animations. To get started quickly, Glimmer offers scaffolding options for Apps, Gems, and Custom Widgets. Glimmer also includes native-executable packaging support, sorely lacking in other libraries, thus enabling the delivery of desktop apps written in Ruby as truly native DMG/PKG/APP files on the Mac + App Store, MSI/EXE files on Windows, and Gem Packaged Shell Scripts on Linux.".freeze
16
16
  s.email = "andy.am@gmail.com".freeze
17
17
  s.executables = ["glimmer".freeze, "girb".freeze]
@@ -69,6 +69,7 @@ Gem::Specification.new do |s|
69
69
  "lib/glimmer/dsl/swt/menu_bar_expression.rb",
70
70
  "lib/glimmer/dsl/swt/menu_expression.rb",
71
71
  "lib/glimmer/dsl/swt/message_box_expression.rb",
72
+ "lib/glimmer/dsl/swt/multiply_expression.rb",
72
73
  "lib/glimmer/dsl/swt/observe_expression.rb",
73
74
  "lib/glimmer/dsl/swt/property_expression.rb",
74
75
  "lib/glimmer/dsl/swt/radio_group_selection_data_binding_expression.rb",
@@ -80,6 +81,7 @@ Gem::Specification.new do |s|
80
81
  "lib/glimmer/dsl/swt/sync_exec_expression.rb",
81
82
  "lib/glimmer/dsl/swt/tab_item_expression.rb",
82
83
  "lib/glimmer/dsl/swt/table_items_data_binding_expression.rb",
84
+ "lib/glimmer/dsl/swt/transform_expression.rb",
83
85
  "lib/glimmer/dsl/swt/tree_items_data_binding_expression.rb",
84
86
  "lib/glimmer/dsl/swt/tree_properties_expression.rb",
85
87
  "lib/glimmer/dsl/swt/widget_expression.rb",
@@ -120,6 +122,7 @@ Gem::Specification.new do |s|
120
122
  "lib/glimmer/swt/tab_item_proxy.rb",
121
123
  "lib/glimmer/swt/table_column_proxy.rb",
122
124
  "lib/glimmer/swt/table_proxy.rb",
125
+ "lib/glimmer/swt/transform_proxy.rb",
123
126
  "lib/glimmer/swt/tree_proxy.rb",
124
127
  "lib/glimmer/swt/widget_listener_proxy.rb",
125
128
  "lib/glimmer/swt/widget_proxy.rb",
@@ -132,6 +135,15 @@ Gem::Specification.new do |s|
132
135
  "samples/elaborate/contact_manager/contact_repository.rb",
133
136
  "samples/elaborate/login.rb",
134
137
  "samples/elaborate/meta_sample.rb",
138
+ "samples/elaborate/tetris.rb",
139
+ "samples/elaborate/tetris/model/block.rb",
140
+ "samples/elaborate/tetris/model/game.rb",
141
+ "samples/elaborate/tetris/model/tetromino.rb",
142
+ "samples/elaborate/tetris/view/block.rb",
143
+ "samples/elaborate/tetris/view/game_over_dialog.rb",
144
+ "samples/elaborate/tetris/view/playfield.rb",
145
+ "samples/elaborate/tetris/view/score_lane.rb",
146
+ "samples/elaborate/tetris/view/tetris_menu_bar.rb",
135
147
  "samples/elaborate/tic_tac_toe.rb",
136
148
  "samples/elaborate/tic_tac_toe/board.rb",
137
149
  "samples/elaborate/tic_tac_toe/cell.rb",
@@ -140,6 +152,7 @@ Gem::Specification.new do |s|
140
152
  "samples/hello/hello_button.rb",
141
153
  "samples/hello/hello_canvas.rb",
142
154
  "samples/hello/hello_canvas_animation.rb",
155
+ "samples/hello/hello_canvas_transform.rb",
143
156
  "samples/hello/hello_checkbox.rb",
144
157
  "samples/hello/hello_checkbox_group.rb",
145
158
  "samples/hello/hello_combo.rb",
@@ -182,7 +195,7 @@ Gem::Specification.new do |s|
182
195
  s.specification_version = 4
183
196
 
184
197
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
185
- s.add_runtime_dependency(%q<glimmer>.freeze, ["~> 1.0.8"])
198
+ s.add_runtime_dependency(%q<glimmer>.freeze, ["~> 1.0.11"])
186
199
  s.add_runtime_dependency(%q<super_module>.freeze, [">= 1.4.1", "< 2.0.0"])
187
200
  s.add_runtime_dependency(%q<nested_inherited_jruby_include_package>.freeze, [">= 0.3.0", "< 2.0.0"])
188
201
  s.add_runtime_dependency(%q<puts_debuggerer>.freeze, [">= 0.11.0", "< 2.0.0"])
@@ -201,7 +214,7 @@ Gem::Specification.new do |s|
201
214
  s.add_development_dependency(%q<simplecov>.freeze, ["~> 0.16.1"])
202
215
  s.add_development_dependency(%q<simplecov-lcov>.freeze, ["~> 0.7.0"])
203
216
  else
204
- s.add_dependency(%q<glimmer>.freeze, ["~> 1.0.8"])
217
+ s.add_dependency(%q<glimmer>.freeze, ["~> 1.0.11"])
205
218
  s.add_dependency(%q<super_module>.freeze, [">= 1.4.1", "< 2.0.0"])
206
219
  s.add_dependency(%q<nested_inherited_jruby_include_package>.freeze, [">= 0.3.0", "< 2.0.0"])
207
220
  s.add_dependency(%q<puts_debuggerer>.freeze, [">= 0.11.0", "< 2.0.0"])
@@ -221,7 +234,7 @@ Gem::Specification.new do |s|
221
234
  s.add_dependency(%q<simplecov-lcov>.freeze, ["~> 0.7.0"])
222
235
  end
223
236
  else
224
- s.add_dependency(%q<glimmer>.freeze, ["~> 1.0.8"])
237
+ s.add_dependency(%q<glimmer>.freeze, ["~> 1.0.11"])
225
238
  s.add_dependency(%q<super_module>.freeze, [">= 1.4.1", "< 2.0.0"])
226
239
  s.add_dependency(%q<nested_inherited_jruby_include_package>.freeze, [">= 0.3.0", "< 2.0.0"])
227
240
  s.add_dependency(%q<puts_debuggerer>.freeze, [">= 0.11.0", "< 2.0.0"])
@@ -32,6 +32,8 @@ module Glimmer
32
32
  'org.eclipse.swt.custom',
33
33
  'org.eclipse.swt.dnd',
34
34
  ]
35
+ DEFAULT_AUTO_SYNC_EXEC = false
36
+ GUI_THREAD = Thread.current
35
37
 
36
38
  class << self
37
39
  # Tells Glimmer to import SWT packages into including class (default: true)
@@ -45,6 +47,22 @@ module Glimmer
45
47
  @@import_swt_packages
46
48
  end
47
49
 
50
+ # Tells Glimmer to avoid automatic use of sync_exec when invoking GUI calls from another thread (default: true)
51
+ def auto_sync_exec=(value)
52
+ @@auto_sync_exec = value
53
+ end
54
+
55
+ # Returns whether Glimmer will import SWT packages into including class
56
+ def auto_sync_exec
57
+ @@auto_sync_exec = DEFAULT_AUTO_SYNC_EXEC if !defined?(@@auto_sync_exec)
58
+ @@auto_sync_exec
59
+ end
60
+ alias auto_sync_exec? auto_sync_exec
61
+
62
+ def require_sync_exec?
63
+ Thread.current != GUI_THREAD
64
+ end
65
+
48
66
  # Returns Logging Devices. Default is [:stdout, :syslog]
49
67
  def logging_devices
50
68
  unless defined? @@logging_devices
@@ -140,11 +158,10 @@ end
140
158
 
141
159
  Glimmer::Config.excluded_keyword_checkers << lambda do |method_symbol, *args|
142
160
  method = method_symbol.to_s
143
- result = false
144
- result ||= method == 'dispose' && is_a?(Glimmer::UI::CustomWidget) && respond_to?(method)
145
- result ||= ['drag_source_proxy', 'drop_target_proxy'].include?(method) && is_a?(Glimmer::UI::CustomWidget)
146
- result ||= method == 'post_initialize_child'
147
- result ||= method == 'handle'
148
- result ||= method.end_with?('=')
149
- result ||= ['finish_edit!', 'search', 'all_tree_items', 'depth_first_search'].include?(method) && is_a?(Glimmer::UI::CustomWidget) && body_root.respond_to?(method)
161
+ return true if method == 'post_initialize_child'
162
+ return true if method == 'handle'
163
+ return true if method.end_with?('=')
164
+ return true if ['drag_source_proxy', 'drop_target_proxy'].include?(method) && is_a?(Glimmer::UI::CustomWidget)
165
+ return true if method == 'dispose' && is_a?(Glimmer::UI::CustomWidget) && respond_to?(method)
166
+ return true if ['finish_edit!', 'search', 'all_tree_items', 'depth_first_search'].include?(method) && is_a?(Glimmer::UI::CustomWidget) && body_root.respond_to?(method)
150
167
  end
@@ -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
@@ -22,6 +22,8 @@
22
22
  require 'glimmer/data_binding/observable'
23
23
  require 'glimmer/data_binding/observer'
24
24
 
25
+ require 'glimmer/swt/display_proxy'
26
+
25
27
  module Glimmer
26
28
  module DataBinding
27
29
  class WidgetBinding
@@ -44,7 +46,15 @@ module Glimmer
44
46
 
45
47
  def call(value)
46
48
  converted_value = translated_value = @translator.call(value)
47
- @widget.set_attribute(@property, converted_value) unless evaluate_property == converted_value
49
+
50
+ update_operation = lambda do
51
+ @widget.set_attribute(@property, converted_value) unless evaluate_property == converted_value
52
+ end
53
+ if Config.auto_sync_exec? && Config.require_sync_exec?
54
+ SWT::DisplayProxy.instance.sync_exec(&update_operation)
55
+ else
56
+ update_operation.call
57
+ end
48
58
  end
49
59
 
50
60
  def evaluate_property
@@ -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
@@ -32,7 +32,7 @@ module Glimmer
32
32
  include_package 'org.eclipse.swt.widgets'
33
33
 
34
34
  def interpret(parent, keyword, *args, &block)
35
- Glimmer::SWT::ColorProxy.new(*args)
35
+ Glimmer::SWT::ColorProxy.flyweight(*args)
36
36
  end
37
37
  end
38
38
  end
@@ -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
@@ -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
@@ -50,6 +50,7 @@ module Glimmer
50
50
  cursor
51
51
  font
52
52
  image
53
+ multiply
53
54
  property
54
55
  block_property
55
56
  widget
@@ -0,0 +1,53 @@
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
+ require 'glimmer/dsl/expression'
23
+ require 'glimmer/dsl/parent_expression'
24
+ require 'glimmer/swt/transform_proxy'
25
+
26
+ module Glimmer
27
+ module DSL
28
+ module SWT
29
+ # Special treatment for transform {multiply(){} } operation
30
+ class MultiplyExpression < Expression
31
+ include ParentExpression
32
+
33
+ def can_interpret?(parent, keyword, *args, &block)
34
+ keyword == 'multiply' and
35
+ parent.is_a?(Glimmer::SWT::TransformProxy)
36
+ end
37
+
38
+ def interpret(parent, keyword, *args, &block)
39
+ Glimmer::SWT::TransformProxy.new(parent, *args, multiply: true)
40
+ end
41
+
42
+ def add_content(parent, &block)
43
+ super
44
+ parent.post_add_content
45
+ end
46
+
47
+ end
48
+
49
+ end
50
+
51
+ end
52
+
53
+ end
@@ -21,13 +21,15 @@
21
21
 
22
22
  require 'glimmer/dsl/expression'
23
23
 
24
+ require 'glimmer/swt/transform_proxy'
25
+
24
26
  module Glimmer
25
27
  module DSL
26
28
  module SWT
27
29
  class PropertyExpression < Expression
28
30
  def can_interpret?(parent, keyword, *args, &block)
29
31
  block.nil? and
30
- args.size > 0 and
32
+ (args.size > 0 || parent.is_a?(Glimmer::SWT::TransformProxy)) and
31
33
  parent.respond_to?(:set_attribute) and
32
34
  parent.respond_to?(:has_attribute?) and
33
35
  parent.has_attribute?(keyword, *args) and
@@ -36,7 +38,7 @@ module Glimmer
36
38
 
37
39
  def interpret(parent, keyword, *args, &block)
38
40
  parent.set_attribute(keyword, *args)
39
- nil
41
+ parent
40
42
  end
41
43
  end
42
44
  end
@@ -23,6 +23,7 @@ require 'glimmer/dsl/expression'
23
23
  require 'glimmer/dsl/parent_expression'
24
24
  require 'glimmer/swt/swt_proxy'
25
25
  require 'glimmer/swt/custom/shape'
26
+ require 'glimmer/swt/custom/drawable'
26
27
 
27
28
  module Glimmer
28
29
  module DSL
@@ -31,10 +32,7 @@ module Glimmer
31
32
  include ParentExpression
32
33
 
33
34
  def can_interpret?(parent, keyword, *args, &block)
34
- (
35
- (parent.respond_to?(:swt_widget) and parent.swt_widget.is_a?(org.eclipse.swt.graphics.Drawable)) or
36
- (parent.respond_to?(:swt_display) and parent.swt_display.is_a?(org.eclipse.swt.graphics.Drawable))
37
- ) and
35
+ parent.is_a?(Glimmer::SWT::Custom::Drawable) and
38
36
  Glimmer::SWT::Custom::Shape.valid?(parent, keyword, *args, &block)
39
37
  end
40
38
 
@@ -0,0 +1,55 @@
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
+ require 'glimmer/dsl/static_expression'
23
+ require 'glimmer/dsl/top_level_expression'
24
+ require 'glimmer/dsl/parent_expression'
25
+ require 'glimmer/swt/custom/shape'
26
+ require 'glimmer/swt/transform_proxy'
27
+
28
+ module Glimmer
29
+ module DSL
30
+ module SWT
31
+ class TransformExpression < StaticExpression
32
+ include TopLevelExpression
33
+ include ParentExpression
34
+
35
+ def can_interpret?(parent, keyword, *args, &block)
36
+ super and
37
+ (parent.nil? or parent.is_a?(Glimmer::SWT::Custom::Shape))
38
+ end
39
+
40
+ def interpret(parent, keyword, *args, &block)
41
+ Glimmer::SWT::TransformProxy.new(parent, *args)
42
+ end
43
+
44
+ def add_content(parent, &block)
45
+ super
46
+ parent.post_add_content
47
+ end
48
+
49
+ end
50
+
51
+ end
52
+
53
+ end
54
+
55
+ end
@@ -22,6 +22,7 @@
22
22
  require 'glimmer'
23
23
  require 'glimmer/dsl/expression'
24
24
  require 'glimmer/dsl/parent_expression'
25
+ require 'glimmer/swt/custom/shape'
25
26
 
26
27
  module Glimmer
27
28
  module DSL
@@ -29,7 +30,7 @@ module Glimmer
29
30
  class WidgetExpression < Expression
30
31
  include ParentExpression
31
32
 
32
- EXCLUDED_KEYWORDS = %w[shell display tab_item]
33
+ EXCLUDED_KEYWORDS = %w[shell display tab_item] + Glimmer::SWT::Custom::Shape.keywords - ['text']
33
34
 
34
35
  def can_interpret?(parent, keyword, *args, &block)
35
36
  result = !EXCLUDED_KEYWORDS.include?(keyword) &&
@@ -42,6 +42,7 @@ module Glimmer
42
42
  *.gem
43
43
  *.rbc
44
44
  /.config
45
+ /.mvn/
45
46
  /coverage/
46
47
  /InstalledFiles
47
48
  /pkg/
@@ -97,9 +98,9 @@ module Glimmer
97
98
  .gladiator
98
99
 
99
100
  # Glimmer
100
- dist
101
- packages
102
- vendor/jars
101
+ /dist/
102
+ /packages/
103
+ /vendor/jars/
103
104
  MULTI_LINE_STRING
104
105
 
105
106
  GEMFILE = <<~MULTI_LINE_STRING