glimmer-dsl-swt 4.20.5.2 → 4.20.6.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 +4 -0
- data/README.md +5 -5
- data/VERSION +1 -1
- data/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md +4 -4
- data/glimmer-dsl-swt.gemspec +0 -0
- data/lib/glimmer/swt/custom/animation.rb +7 -2
- data/samples/hello/hello_canvas_animation.rb +45 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d7ca988f6d990ae7520a2b6319c538a793f7499a23713e97ce02f32e3db2bec
|
4
|
+
data.tar.gz: a50dfa303380c6415d6a286f351a55931a4b1e09d73d7cc3e4602b52a00c179d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8739fded7624fc8a007850dfa84fabeba144ffd3830fb83284e6abd733be75d8500da1be339d4827f30e14d702a4472f271198d90101d30573696f6a6dfdb14
|
7
|
+
data.tar.gz: c95d53ca9b574ec413b1630c2b415deb2fa3e65a091bc3d5d40b391b3c6083db5e74158c3f9d3572523682c4a02e75afee465ffef2e83f96cbc3bbc7e671698a
|
data/CHANGELOG.md
CHANGED
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.20.
|
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.20.6.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)
|
@@ -15,7 +15,7 @@
|
|
15
15
|
[<img src="https://covers.oreillystatic.com/images/9780596519650/lrg.jpg" width=105 /><br />
|
16
16
|
Featured in JRuby Cookbook](http://shop.oreilly.com/product/9780596519650.do) and [Chalmers/Gothenburg University Software Engineering Master's Lecture Material](http://www.cse.chalmers.se/~bergert/slides/guest_lecture_DSLs.pdf)
|
17
17
|
|
18
|
-
[Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) 4.20.
|
18
|
+
[Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) 4.20.6.0 includes [SWT 4.20](https://download.eclipse.org/eclipse/downloads/drops4/R-4.20-202106111600/), which was released on June 11, 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 on Mac and Linux, but it is not fully tested in Glimmer DSL for SWT yet, so deem its support experimental for the time being without guarantees for functionality until declared otherwise (report any issues you may encounter).
|
19
19
|
|
20
20
|
**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 (keep in mind that it is still a beta, so default back to `bind` whenever needed).
|
21
21
|
|
@@ -347,7 +347,7 @@ jgem install glimmer-dsl-swt
|
|
347
347
|
|
348
348
|
Or this command if you want a specific version:
|
349
349
|
```
|
350
|
-
jgem install glimmer-dsl-swt -v 4.20.
|
350
|
+
jgem install glimmer-dsl-swt -v 4.20.6.0
|
351
351
|
```
|
352
352
|
|
353
353
|
`jgem` is JRuby's version of `gem` command.
|
@@ -375,7 +375,7 @@ Note: if you're using activerecord or activesupport, keep in mind that Glimmer u
|
|
375
375
|
|
376
376
|
Add the following to `Gemfile`:
|
377
377
|
```
|
378
|
-
gem 'glimmer-dsl-swt', '~> 4.20.
|
378
|
+
gem 'glimmer-dsl-swt', '~> 4.20.6.0'
|
379
379
|
```
|
380
380
|
|
381
381
|
And, then run:
|
@@ -396,7 +396,7 @@ glimmer
|
|
396
396
|
```
|
397
397
|
|
398
398
|
```
|
399
|
-
Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.20.
|
399
|
+
Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.20.6.0
|
400
400
|
|
401
401
|
Usage: glimmer [--bundler] [--pd] [--quiet] [--debug] [--log-level=VALUE] [[ENV_VAR=VALUE]...] [[-jruby-option]...] (application.rb or task[task_args]) [[application2.rb]...]
|
402
402
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
4.20.
|
1
|
+
4.20.6.0
|
@@ -2243,13 +2243,13 @@ Learn more at the [Hello, Canvas Transform! Sample](GLIMMER_SAMPLES.md#hello-can
|
|
2243
2243
|
|
2244
2244
|
(note: this is a very new feature of Glimmer. It may change a bit while getting battle tested. As always, you could default to basic SWT usage if needed.)
|
2245
2245
|
|
2246
|
-
Glimmer
|
2246
|
+
Glimmer provides built-in support for animations via a declarative Animation DSL, another sub-DSL of the Glimmer GUI DSL.
|
2247
2247
|
|
2248
|
-
Animations take advantage of multi-threading, automatically running each animation in its own independent thread of execution while updating the GUI asynchronously.
|
2248
|
+
Animations take advantage of multi-threading, with Glimmer DSL for SWT automatically running each animation in its own independent thread of execution while updating the GUI asynchronously.
|
2249
2249
|
|
2250
|
-
Multiple simultaneous animations are supported
|
2250
|
+
Multiple simultaneous animations are supported per `canvas` (or widget) parent (they do not compete or starve each other).
|
2251
2251
|
|
2252
|
-
`canvas` has the `:double_buffered` SWT style by default to ensure flicker-free rendering. If you need to disable it for whatever reason, just pass the `:none` SWT style instead (e.g. `canvas(:none)`)
|
2252
|
+
`canvas` has the `:double_buffered` SWT style by default on platforms other than the Mac to ensure flicker-free rendering (Mac does not need it). If you need to disable it for whatever reason, just pass the `:none` SWT style instead (e.g. `canvas(:none)`)
|
2253
2253
|
|
2254
2254
|
This example says it all (it moves a tiny red square across a blue background) (you may copy/paste in [`girb`](GLIMMER_GIRB.md)):
|
2255
2255
|
|
data/glimmer-dsl-swt.gemspec
CHANGED
Binary file
|
@@ -20,6 +20,7 @@
|
|
20
20
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
21
|
|
22
22
|
require 'glimmer/swt/properties'
|
23
|
+
require 'glimmer/swt/custom/shape'
|
23
24
|
|
24
25
|
module Glimmer
|
25
26
|
module SWT
|
@@ -222,8 +223,12 @@ module Glimmer
|
|
222
223
|
self.class.schedule_frame_animation(self) do
|
223
224
|
if started? && start_number == @start_number && within_duration_limit?
|
224
225
|
unless @parent.isDisposed
|
225
|
-
@
|
226
|
-
@parent.
|
226
|
+
@shapes.to_a.each(&:dispose)
|
227
|
+
parent_shapes_before = @parent.shapes.clone
|
228
|
+
@parent.content {
|
229
|
+
frame_block.call(*block_args)
|
230
|
+
}
|
231
|
+
@shapes = @parent.shapes - parent_shapes_before
|
227
232
|
end
|
228
233
|
else
|
229
234
|
if stopped? && @frame_index > current_frame_index
|
@@ -25,27 +25,30 @@ include Glimmer
|
|
25
25
|
|
26
26
|
shell {
|
27
27
|
text 'Hello, Canvas Animation!'
|
28
|
-
minimum_size
|
28
|
+
minimum_size 1200, 420
|
29
29
|
|
30
30
|
canvas {
|
31
|
+
background :white
|
32
|
+
|
31
33
|
animation {
|
32
34
|
every 0.01 # in seconds (one hundredth)
|
33
35
|
|
34
36
|
frame { |index| # frame block loops indefinitely (unless frame_count is set to an integer)
|
35
|
-
background rgb(index%255, 100, 200) # sets canvas background color
|
36
|
-
|
37
37
|
oval(0, 0, 400, 400) { # x, y, width, height
|
38
38
|
foreground :black # sets oval background color
|
39
39
|
}
|
40
40
|
arc(0, 0, 400, 400, -1.4*index%360, 10) { # x, y, width, height, start angle, arc angle
|
41
|
-
background rgb(
|
41
|
+
background rgb(50, 200, 50) # sets arc background color
|
42
42
|
}
|
43
43
|
}
|
44
44
|
}
|
45
45
|
}
|
46
46
|
|
47
47
|
canvas {
|
48
|
+
background :white
|
49
|
+
|
48
50
|
colors = [:yellow, :red]
|
51
|
+
|
49
52
|
animation {
|
50
53
|
every 0.25 # in seconds (one quarter)
|
51
54
|
cycle colors # cycles array of colors into the second variable of the frame block below
|
@@ -65,4 +68,42 @@ shell {
|
|
65
68
|
}
|
66
69
|
}
|
67
70
|
}
|
71
|
+
|
72
|
+
canvas {
|
73
|
+
background :white
|
74
|
+
|
75
|
+
colors = [:yellow, :red]
|
76
|
+
|
77
|
+
animation {
|
78
|
+
every 0.25 # in seconds (one quarter)
|
79
|
+
cycle colors # cycles array of colors into the second variable of the frame block below
|
80
|
+
|
81
|
+
frame { |index, color| # frame block loops indefinitely (unless frame_count or cycle_count is set to an integer)
|
82
|
+
outside_color = colors[index % 2]
|
83
|
+
inside_color = colors[(index + 1) % 2]
|
84
|
+
|
85
|
+
background outside_color # sets canvas background color
|
86
|
+
|
87
|
+
rectangle(0, 0, 200, 200) {
|
88
|
+
background inside_color # sets rectangle background color
|
89
|
+
}
|
90
|
+
rectangle(200, 200, 200, 200) {
|
91
|
+
background inside_color # sets rectangle background color
|
92
|
+
}
|
93
|
+
}
|
94
|
+
}
|
95
|
+
|
96
|
+
animation {
|
97
|
+
every 0.01 # in seconds (one hundredth)
|
98
|
+
|
99
|
+
frame { |index| # frame block loops indefinitely (unless frame_count is set to an integer)
|
100
|
+
oval(0, 0, 400, 400) { # x, y, width, height
|
101
|
+
foreground :black # sets oval background color
|
102
|
+
}
|
103
|
+
arc(0, 0, 400, 400, -1.4*index%360, 10) { # x, y, width, height, start angle, arc angle
|
104
|
+
background rgb(50, 200, 50) # sets arc background color
|
105
|
+
}
|
106
|
+
}
|
107
|
+
}
|
108
|
+
}
|
68
109
|
}.open
|