glimmer-dsl-swt 4.22.0.0 → 4.22.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +207 -169
- data/README.md +10 -10
- data/RUBY_VERSION +1 -1
- data/VERSION +1 -1
- data/docs/reference/GLIMMER_COMMAND.md +21 -7
- data/docs/reference/GLIMMER_CONFIGURATION.md +14 -3
- data/docs/reference/GLIMMER_GIRB.md +1 -1
- data/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md +743 -113
- data/docs/reference/GLIMMER_SAMPLES.md +22 -8
- data/glimmer-dsl-swt.gemspec +0 -0
- data/lib/ext/glimmer/config.rb +41 -24
- data/lib/glimmer/data_binding/observable_widget.rb +6 -6
- data/lib/glimmer/data_binding/widget_binding.rb +2 -1
- data/lib/glimmer/dsl/swt/dsl.rb +1 -1
- data/lib/glimmer/dsl/swt/observe_expression.rb +2 -1
- data/lib/glimmer/dsl/swt/shape_expression.rb +1 -0
- data/lib/glimmer/dsl/swt/shine_data_binding_expression.rb +3 -8
- data/lib/glimmer/dsl/swt/transform_expression.rb +1 -1
- data/lib/glimmer/launcher.rb +16 -15
- data/lib/glimmer/rake_task/scaffold.rb +5 -16
- data/lib/glimmer/swt/color_proxy.rb +5 -5
- data/lib/glimmer/swt/custom/drawable.rb +4 -0
- data/lib/glimmer/swt/custom/shape/line.rb +0 -1
- data/lib/glimmer/swt/custom/shape/path.rb +2 -2
- data/lib/glimmer/swt/custom/shape/path_segment.rb +2 -2
- data/lib/glimmer/swt/custom/shape/point.rb +8 -1
- data/lib/glimmer/swt/custom/shape.rb +171 -69
- data/lib/glimmer/swt/display_proxy.rb +15 -10
- data/lib/glimmer/swt/image_proxy.rb +5 -5
- data/lib/glimmer/swt/message_box_proxy.rb +5 -5
- data/lib/glimmer/swt/shape_listener_proxy.rb +55 -0
- data/lib/glimmer/swt/shell_proxy.rb +1 -0
- data/lib/glimmer/swt/transform_proxy.rb +3 -3
- data/lib/glimmer/swt/tray_proxy.rb +4 -4
- data/lib/glimmer/swt/widget_proxy.rb +5 -7
- data/lib/glimmer/ui/custom_shape.rb +34 -10
- data/lib/glimmer/ui/custom_widget.rb +3 -8
- data/lib/glimmer-dsl-swt.rb +6 -2
- data/samples/elaborate/klondike_solitaire/model/column_pile.rb +0 -1
- data/samples/elaborate/klondike_solitaire/view/column_pile.rb +3 -16
- data/samples/elaborate/klondike_solitaire/view/dealing_pile.rb +1 -1
- data/samples/elaborate/klondike_solitaire/view/dealt_pile.rb +12 -5
- data/samples/elaborate/klondike_solitaire/view/empty_playing_card.rb +2 -1
- data/samples/elaborate/klondike_solitaire/view/foundation_pile.rb +2 -2
- data/samples/elaborate/klondike_solitaire/view/hidden_playing_card.rb +2 -2
- data/samples/elaborate/klondike_solitaire/view/klondike_solitaire_menu_bar.rb +60 -0
- data/samples/elaborate/klondike_solitaire/view/playing_card.rb +3 -2
- data/samples/elaborate/klondike_solitaire.rb +13 -55
- data/samples/elaborate/mandelbrot_fractal.rb +3 -1
- data/samples/elaborate/quarto/model/game.rb +124 -0
- data/samples/elaborate/quarto/model/piece/cube.rb +31 -0
- data/samples/elaborate/quarto/model/piece/cylinder.rb +31 -0
- data/samples/elaborate/quarto/model/piece.rb +70 -0
- data/samples/elaborate/quarto/view/available_pieces_area.rb +72 -0
- data/samples/elaborate/quarto/view/board.rb +65 -0
- data/samples/elaborate/quarto/view/cell.rb +85 -0
- data/samples/elaborate/quarto/view/cube.rb +73 -0
- data/samples/elaborate/quarto/view/cylinder.rb +72 -0
- data/samples/elaborate/quarto/view/message_box_panel.rb +114 -0
- data/samples/elaborate/quarto/view/piece.rb +56 -0
- data/samples/elaborate/quarto/view/selected_piece_area.rb +69 -0
- data/samples/elaborate/quarto.rb +188 -0
- data/samples/hello/hello_canvas_data_binding.rb +7 -7
- data/samples/hello/hello_custom_widget.rb +23 -5
- metadata +35 -40
- data/bin/glimmer_runner.rb +0 -4
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for SWT 4.22.
|
1
|
+
# [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for SWT 4.22.2.0
|
2
2
|
## JRuby Desktop Development GUI Framework
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/glimmer-dsl-swt.svg)](http://badge.fury.io/rb/glimmer-dsl-swt)
|
4
4
|
[![Travis CI](https://travis-ci.com/AndyObtiva/glimmer-dsl-swt.svg?branch=master)](https://travis-ci.com/github/AndyObtiva/glimmer-dsl-swt)
|
@@ -17,7 +17,7 @@ Featured in JRuby Cookbook](http://shop.oreilly.com/product/9780596519650.do) an
|
|
17
17
|
|
18
18
|
![Eclipse SWT RCP NASA Mars Rover](/images/glimmer-eclipse-swt-rcp-nasa-mars-rover.png)
|
19
19
|
|
20
|
-
[Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) 4.22.
|
20
|
+
[Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) 4.22.2.0 includes [SWT 4.22](https://download.eclipse.org/eclipse/downloads/drops4/R-4.22-202111241800/), which was released on November 24, 2021. Gem version numbers are in sync with the SWT library versions. The first two digits represent the SWT version number. The last two digits represent the minor and patch versions of Glimmer DSL for SWT. Note that SWT now supports AARCH64/ARM64 on Mac and Linux!
|
21
21
|
|
22
22
|
**Starting in version 4.20.0.0, [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) comes with the new [***Shine***](/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#shine) syntax** for highly intuitive and visually expressive View/Model Attribute Mapping, relying on `<=>` for bidirectional (two-way) data-binding and `<=` for unidirectional (one-way) data-binding, providing an alternative to the `bind` keyword.
|
23
23
|
|
@@ -25,8 +25,8 @@ Please help make [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt
|
|
25
25
|
|
26
26
|
Other [Glimmer](https://rubygems.org/gems/glimmer) DSL gems you might be interested in:
|
27
27
|
- [glimmer-dsl-opal](https://github.com/AndyObtiva/glimmer-dsl-opal): Glimmer DSL for Opal (Pure Ruby Web GUI and Auto-Webifier of Desktop Apps)
|
28
|
-
- [glimmer-dsl-tk](https://github.com/AndyObtiva/glimmer-dsl-tk): Glimmer DSL for Tk (MRI Ruby Desktop Development GUI Library)
|
29
28
|
- [glimmer-dsl-libui](https://github.com/AndyObtiva/glimmer-dsl-libui): Glimmer DSL for LibUI (Prerequisite-Free Ruby Desktop Development GUI Library)
|
29
|
+
- [glimmer-dsl-tk](https://github.com/AndyObtiva/glimmer-dsl-tk): Glimmer DSL for Tk (MRI Ruby Desktop Development GUI Library)
|
30
30
|
- [glimmer-dsl-gtk](https://github.com/AndyObtiva/glimmer-dsl-gtk): Glimmer DSL for GTK (Ruby-GNOME Desktop Development GUI Library)
|
31
31
|
- [glimmer-dsl-xml](https://github.com/AndyObtiva/glimmer-dsl-xml): Glimmer DSL for XML (& HTML)
|
32
32
|
- [glimmer-dsl-css](https://github.com/AndyObtiva/glimmer-dsl-css): Glimmer DSL for CSS
|
@@ -147,9 +147,9 @@ shell {
|
|
147
147
|
font height: 14
|
148
148
|
enabled <= [BaseballGame, :selected_game]
|
149
149
|
|
150
|
-
on_widget_selected
|
150
|
+
on_widget_selected do
|
151
151
|
book_selected_game
|
152
|
-
|
152
|
+
end
|
153
153
|
}
|
154
154
|
}
|
155
155
|
```
|
@@ -295,8 +295,8 @@ https://www.eclipse.org/swt/faq.php
|
|
295
295
|
|
296
296
|
- JDK 17 (17.0.1) (find at https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html / Ensure PATH includes Java bin directory for `jpackage` command to work when packaging Glimmer applications)
|
297
297
|
- [RVM](http://rvm.io) on Mac & Linux (not available on Windows)
|
298
|
-
- JRuby 9.3.
|
299
|
-
- SWT 4.22 (already included in the [glimmer-dsl-swt](https://rubygems.org/gems/glimmer-dsl-swt) gem). Note that SWT now supports AARCH64 on Mac and Linux
|
298
|
+
- JRuby 9.3.3.0 (supporting Ruby 2.6.x syntax) (get via [RVM](http://rvm.io) on Mac and Linux by running `rvm install jruby-9.3.3.0`; On Windows, find at [https://www.jruby.org/download](https://www.jruby.org/download))
|
299
|
+
- SWT 4.22 (already included in the [glimmer-dsl-swt](https://rubygems.org/gems/glimmer-dsl-swt) gem). Note that SWT now supports AARCH64/ARM64 on Mac and Linux!
|
300
300
|
- Git (comes with Mac and Linux. Install on Windows: https://git-scm.com/download/win )
|
301
301
|
|
302
302
|
Glimmer might still work on other versions of Java, JRuby and SWT, but there are no guarantees, so it is best to stick to the pre-requisites outlined above.
|
@@ -325,7 +325,7 @@ jgem install glimmer-dsl-swt
|
|
325
325
|
|
326
326
|
Or this command if you want a specific version:
|
327
327
|
```
|
328
|
-
jgem install glimmer-dsl-swt -v 4.22.
|
328
|
+
jgem install glimmer-dsl-swt -v 4.22.2.0
|
329
329
|
```
|
330
330
|
|
331
331
|
`jgem` is JRuby's version of `gem` command.
|
@@ -353,7 +353,7 @@ Note: if you're using activerecord or activesupport, keep in mind that Glimmer u
|
|
353
353
|
|
354
354
|
Add the following to `Gemfile`:
|
355
355
|
```
|
356
|
-
gem 'glimmer-dsl-swt', '~> 4.22.
|
356
|
+
gem 'glimmer-dsl-swt', '~> 4.22.2.0'
|
357
357
|
```
|
358
358
|
|
359
359
|
And, then run:
|
@@ -376,7 +376,7 @@ glimmer
|
|
376
376
|
```
|
377
377
|
|
378
378
|
```
|
379
|
-
Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.22.
|
379
|
+
Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.22.2.0
|
380
380
|
|
381
381
|
Usage: glimmer [--bundler] [--pd] [--quiet] [--debug] [--log-level=VALUE] [[ENV_VAR=VALUE]...] [[-jruby-option]...] (application.rb or task[task_args]) [[application2.rb]...]
|
382
382
|
|
data/RUBY_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
jruby-9.3.
|
1
|
+
jruby-9.3.3.0
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
4.22.
|
1
|
+
4.22.2.0
|
@@ -1,6 +1,6 @@
|
|
1
1
|
## Glimmer Command
|
2
2
|
|
3
|
-
The `glimmer` command allows you to run, scaffold, package, and list Glimmer applications/gems.
|
3
|
+
The `glimmer` command allows you to run, scaffold, package, and list Glimmer applications/gems more conveniently.
|
4
4
|
|
5
5
|
You can bring up usage instructions by running the `glimmer` command without arguments:
|
6
6
|
|
@@ -18,6 +18,8 @@ Note: If you encounter an issue running the `glimmer` command, run `bundle exec
|
|
18
18
|
|
19
19
|
### Basic Usage
|
20
20
|
|
21
|
+
You can run any Glimmer app with `jruby` directly, which is the most lightweight way of running Glimmer DSL for SWT applications. However, if you wrote an app that does not explicitly `require 'glimmer-dsl-swt'`, then you may use the `glimmer` command for convenience instead since it automatically loads `glimmer-dsl-swt`.
|
22
|
+
|
21
23
|
```
|
22
24
|
glimmer application.rb
|
23
25
|
```
|
@@ -124,7 +126,7 @@ This brings up the [Glimmer Meta-Sample (The Sample of Samples)](#samples):
|
|
124
126
|
Glimmer borrows from Rails the idea of Scaffolding, that is generating a structure for your app files that
|
125
127
|
helps you get started just like true building scaffolding helps construction workers, civil engineers, and architects.
|
126
128
|
|
127
|
-
Glimmer scaffolding goes beyond just scaffolding the app files
|
129
|
+
Glimmer scaffolding goes beyond just scaffolding the app files. It also packages it and launches it,
|
128
130
|
getting you to a running and delivered state of an advanced "Hello, World!" Glimmer application right off the bat.
|
129
131
|
|
130
132
|
This should greatly facilitate building a new Glimmer app by helping you be productive and focus on app details while
|
@@ -207,7 +209,7 @@ And, here is the Windows version of the boilerplate Preferences dialog.
|
|
207
209
|
|
208
210
|
![Glimmer Scaffold App Windows Preferences](/images/glimmer-scaffolding-app-windows-preferences.png)
|
209
211
|
|
210
|
-
In order to run the app after making changes, you
|
212
|
+
In order to run the app after making changes, you can run the `glimmer run`. It automatically detects the generated run script under the `bin` directory and uses it as an argument.
|
211
213
|
|
212
214
|
```
|
213
215
|
glimmer run
|
@@ -216,7 +218,13 @@ glimmer run
|
|
216
218
|
Alternatively, to manually run the app, you may type:
|
217
219
|
|
218
220
|
```
|
219
|
-
|
221
|
+
jruby bin/greeter
|
222
|
+
```
|
223
|
+
|
224
|
+
or:
|
225
|
+
|
226
|
+
```
|
227
|
+
bin/greeter
|
220
228
|
```
|
221
229
|
|
222
230
|
or:
|
@@ -225,15 +233,21 @@ or:
|
|
225
233
|
glimmer bin/greeter
|
226
234
|
```
|
227
235
|
|
236
|
+
or:
|
237
|
+
|
238
|
+
```
|
239
|
+
glimmer run[bin/greeter]
|
240
|
+
```
|
241
|
+
|
228
242
|
#### Desktopify
|
229
243
|
|
230
|
-
Desktopify basically turns a website into a desktop application by wrapping the website within a [Browser Widget](#browser-widget).
|
244
|
+
Desktopify basically turns a website into a desktop application by wrapping the website within a [Browser Widget](/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#browser-widget).
|
231
245
|
|
232
246
|
The desktopify app is similar to the standard scaffolded app. It can be extended and the [browser may even be instrumented](https://help.eclipse.org/2020-09/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/browser/Browser.html).
|
233
247
|
|
234
248
|
The app even remembers your cookies if you log into the website, close the app, and reopen again.
|
235
249
|
|
236
|
-
Note that on Linux, the default SWT browser, which runs on webkit, does not support HTML5 Video out of the box. If you need video support
|
250
|
+
Note that on Linux, the default SWT browser, which runs on webkit, does not support HTML5 Video out of the box. If you need video support on Linux, you may try the [JxBrowser](https://www.teamdev.com/jxbrowser) SWT widget instead, which embeds Chromium instead.
|
237
251
|
|
238
252
|
Before you start, make sure you are in a JRuby environment with Glimmer gem installed as per "Direct Install" pre-requisites.
|
239
253
|
|
@@ -302,7 +316,7 @@ Desktopified App on Linux
|
|
302
316
|
|
303
317
|
![Glimmer Scaffold App](/images/glimmer-scaffolding-desktopify-linux.png)
|
304
318
|
|
305
|
-
In order to run the app after making changes, you
|
319
|
+
In order to run the app after making changes, you can run the `glimmer run`. It automatically detects the generated run script under the `bin` directory and uses it as an argument.
|
306
320
|
|
307
321
|
```
|
308
322
|
glimmer run
|
@@ -13,7 +13,7 @@ Example:
|
|
13
13
|
```ruby
|
14
14
|
Glimmer::Config.logger.level = :debug
|
15
15
|
```
|
16
|
-
This results in more verbose debug
|
16
|
+
This results in more verbose debug logging to `STDOUT`, which is very helpful in troubleshooting Glimmer DSL syntax when needed.
|
17
17
|
|
18
18
|
Example log:
|
19
19
|
```
|
@@ -37,9 +37,20 @@ To reset `logger` to the default instance, you may call `Glimmer::Config.reset_l
|
|
37
37
|
|
38
38
|
All logging is done lazily via blocks (e.g. `logger.debug {message}`) to avoid affecting app performance with logging when below the configured logging level threshold.
|
39
39
|
|
40
|
-
[Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt) enhances Glimmer default logging support via the Ruby [`logging`](https://github.com/TwP/logging) gem, enabling buffered asynchronous logging in a separate thread, thus completely unhindering normal desktop app performance.
|
40
|
+
Optionally, [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt) enhances Glimmer default logging support via the Ruby [`logging`](https://github.com/TwP/logging) gem, enabling buffered asynchronous logging in a separate thread, thus completely unhindering normal desktop app performance.
|
41
41
|
|
42
|
-
|
42
|
+
You can alternatively use the [logging](https://github.com/TwP/logging) gem for asynchronous logging (note that it adds about 0.5 - 1.0 second to startup time) by adding the gem:
|
43
|
+
```ruby
|
44
|
+
gem 'logging', '>= 2.3.0', '< 3.0.0'
|
45
|
+
```
|
46
|
+
|
47
|
+
And, updating the logger type:
|
48
|
+
```ruby
|
49
|
+
require 'logging'
|
50
|
+
Glimmer::Config.logger_type = :logging
|
51
|
+
```
|
52
|
+
|
53
|
+
Other config options related to the [logging](https://github.com/TwP/logging) gem are mentioned below.
|
43
54
|
|
44
55
|
#### logging_devices
|
45
56
|
|
@@ -18,7 +18,7 @@ Watch out for hands-on examples in this README indicated by "you may copy/paste
|
|
18
18
|
|
19
19
|
Keep in mind that all samples live under [https://github.com/AndyObtiva/glimmer-dsl-swt/samples](https://github.com/AndyObtiva/glimmer-dsl-swt/samples)
|
20
20
|
|
21
|
-
If you need a more GUI interactive option to
|
21
|
+
If you need a more GUI interactive option to experiment with Glimmer GUI DSL Syntax, you may try:
|
22
22
|
- [Glimmer Meta-Sample (The Sample of Samples)](#samples): allows launching Glimmer samples and viewing/editing code to learn/experiment too.
|
23
23
|
- ["Ugliest Editor Ever"](https://github.com/AndyObtiva/glimmer-cs-gladiator)
|
24
24
|
- Just build your own GUI editor using the [Glimmer DSL for SWT Ruby Gem](https://rubygems.org/gems/glimmer-dsl-swt).
|