glimmer-dsl-swt 4.22.2.4 → 4.23.0.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 +15 -0
- data/README.md +69 -15
- data/VERSION +1 -1
- data/docs/reference/GLIMMER_COMMAND.md +3 -1
- data/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md +33 -31
- data/docs/reference/GLIMMER_SAMPLES.md +11 -19
- data/glimmer-dsl-swt.gemspec +0 -0
- data/lib/glimmer/launcher.rb +7 -4
- data/lib/glimmer/rake_task/package.rb +1 -1
- data/lib/glimmer/rake_task/scaffold.rb +25 -13
- data/lib/glimmer/swt/custom/shape.rb +6 -2
- data/samples/elaborate/calculator.rb +12 -12
- data/samples/elaborate/contact_manager.rb +26 -14
- data/samples/elaborate/game_of_life.rb +8 -8
- data/samples/elaborate/klondike_solitaire/view/action_panel.rb +2 -2
- data/samples/elaborate/klondike_solitaire/view/klondike_solitaire_menu_bar.rb +15 -10
- data/samples/elaborate/login.rb +16 -10
- data/samples/elaborate/mandelbrot_fractal.rb +26 -20
- data/samples/elaborate/meta_sample.rb +6 -6
- data/samples/elaborate/metronome.rb +4 -4
- data/samples/elaborate/stock_ticker.rb +12 -12
- data/samples/elaborate/tetris.rb +4 -4
- data/samples/elaborate/timer.rb +36 -26
- data/samples/elaborate/user_profile.rb +53 -14
- data/samples/elaborate/weather.rb +2 -2
- data/samples/hello/hello_button.rb +3 -3
- data/samples/hello/hello_canvas_animation.rb +2 -2
- data/samples/hello/hello_color_dialog.rb +4 -4
- data/samples/hello/hello_custom_shell.rb +2 -2
- data/samples/hello/hello_dialog.rb +4 -4
- data/samples/hello/hello_directory_dialog.rb +2 -2
- data/samples/hello/hello_expand_bar.rb +4 -5
- data/samples/hello/hello_file_dialog.rb +2 -2
- data/samples/hello/hello_font_dialog.rb +2 -2
- data/samples/hello/hello_link.rb +5 -4
- data/samples/hello/hello_list_multi_selection.rb +3 -1
- data/samples/hello/hello_list_single_selection.rb +3 -1
- data/samples/hello/hello_menu_bar.rb +28 -28
- data/samples/hello/hello_message_box.rb +2 -2
- data/samples/hello/hello_pop_up_context_menu.rb +18 -8
- data/samples/hello/hello_shell.rb +16 -16
- data/samples/hello/hello_styled_text.rb +2 -2
- data/samples/hello/hello_table.rb +4 -4
- data/samples/hello/hello_tray_item.rb +2 -2
- data/vendor/swt/linux/swt.jar +0 -0
- data/vendor/swt/linux_aarch64/swt.jar +0 -0
- data/vendor/swt/mac/swt.jar +0 -0
- data/vendor/swt/mac_aarch64/swt.jar +0 -0
- data/vendor/swt/windows/swt.jar +0 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70b153d34d857c64b4e3f54df18efb074ae657c277d88e09d91b5e1614b593b4
|
4
|
+
data.tar.gz: b9272e8c317894a705473c14cf3c83dbd404e12a8ef7a06005432febab165aca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45837c3393efa7740a398ef2e2678cf311985dcb4bfbd63e0e9d3b6aa8aa787bf76c23149d7eecf45379a2ed0ceb61eebd89fb7a0cf5f7080c9bd5a8d0aac65d
|
7
|
+
data.tar.gz: 2cfba102838340cbdf2e7d2af818b2d98a82d111501689937095ffda3c11c2131b6be737911d2c542a21ae126187f6c47f803952e001fa7c829bae4ed27d19bd
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,20 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 4.23.0.0
|
4
|
+
|
5
|
+
- Upgrade to SWT 4.23
|
6
|
+
- Upgrade to JDK 18
|
7
|
+
|
8
|
+
## 4.22.2.6
|
9
|
+
|
10
|
+
- Fix issue whereby updating `string` property on the `text`/`string` shape does not trigger a redraw on the shape because the text dimensions remained the same despite the change of content (e.g. switching from `string` content of letter `A` to `S` results in the same dimensions)
|
11
|
+
- Canvas Shape DSL graduated from Beta to Final
|
12
|
+
|
13
|
+
## 4.22.2.5
|
14
|
+
|
15
|
+
- Update all samples to match the [GLIMMER_STYLE_GUIDE.md](/docs/reference/GLIMMER_STYLE_GUIDE.md)
|
16
|
+
- Update scaffolding code to match the [GLIMMER_STYLE_GUIDE.md](/docs/reference/GLIMMER_STYLE_GUIDE.md)
|
17
|
+
|
3
18
|
## 4.22.2.4
|
4
19
|
|
5
20
|
- Address the warning regarding using Ruby singletons on Java objects (shows up when running `glimmer samples`)
|
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.
|
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.23.0.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)
|
@@ -8,6 +8,8 @@
|
|
8
8
|
|
9
9
|
**(The Original Glimmer Library Handling the World’s Ruby GUI Needs Since 2007. Beware of Imitators!)**
|
10
10
|
|
11
|
+
[GLIMMER VIDEO TUTORIAL CHANNEL](https://www.youtube.com/channel/UC5hzDE23HZXsZLAxYk2UJEw)
|
12
|
+
|
11
13
|
[Glimmer](https://github.com/AndyObtiva/glimmer) DSL for [SWT](https://www.eclipse.org/swt/) is a native-GUI cross-platform desktop development library written in [JRuby](https://www.jruby.org/), an OS-threaded faster JVM version of [Ruby](https://www.ruby-lang.org/en/). [Glimmer](https://github.com/AndyObtiva/glimmer)'s main innovation is a declarative [Ruby DSL](docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#glimmer-dsl-syntax) that enables productive and efficient authoring of desktop application user-interfaces by relying on the robust [Eclipse SWT library](https://www.eclipse.org/swt/). [Glimmer](https://rubygems.org/gems/glimmer) additionally innovates by having built-in [data-binding](docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#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 afterwards. Not only does Glimmer provide a large set of GUI [widgets](docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#widgets), but it also supports drawing Canvas Graphics like [Shapes](docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#canvas-shape-dsl) and [Animations](docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#canvas-animation-dsl). To get started quickly, [Glimmer](https://rubygems.org/gems/glimmer) offers [scaffolding](docs/reference/GLIMMER_COMMAND.md#scaffolding) options for [Apps](#in-production), [Gems](docs/reference/GLIMMER_COMMAND.md#custom-shell-gem), and [Custom Widgets](docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#custom-widgets). [Glimmer](https://rubygems.org/gems/glimmer) also includes native-executable [packaging](docs/reference/GLIMMER_PACKAGING_AND_DISTRIBUTION.md) support, sorely lacking in other libraries, thus enabling the delivery of desktop apps written in [Ruby](https://www.ruby-lang.org/en/) as truly native DMG/PKG/APP files on the [Mac](https://www.apple.com/ca/macos), MSI/EXE files on [Windows](https://www.microsoft.com/en-ca/windows), and DEB/RPM files on [Linux](https://www.linux.org/). [Glimmer](https://github.com/AndyObtiva/glimmer) was the [first Ruby gem](https://rubygems.org/gems/glimmer) to bring [SWT](https://www.eclipse.org/swt/) (Standard Widget Toolkit) to [Ruby](https://www.ruby-lang.org/en/), thanks to creator [Andy Maleh](https://andymaleh.blogspot.com/), EclipseCon/EclipseWorld/RubyConf speaker.
|
12
14
|
|
13
15
|
[<img src="https://covers.oreillystatic.com/images/9780596519650/lrg.jpg" width=105 /><br />
|
@@ -17,19 +19,19 @@ Featured in JRuby Cookbook](http://shop.oreilly.com/product/9780596519650.do) an
|
|
17
19
|
|
18
20
|
![Eclipse SWT RCP NASA Mars Rover](/images/glimmer-eclipse-swt-rcp-nasa-mars-rover.png)
|
19
21
|
|
20
|
-
[Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) 4.
|
22
|
+
[Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) 4.23.0.0 includes [SWT 4.23](https://download.eclipse.org/eclipse/downloads/drops4/R-4.23-202203080310/), which was released on March 8, 2022. 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.
|
21
23
|
|
22
24
|
**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
25
|
|
24
26
|
Please help make [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) better by providing feedback and [contributing](#contributing) whenever possible. Any feature suggestions that are accepted could be implemented within weeks if not days.
|
25
27
|
|
26
|
-
**[Glimmer](https://
|
28
|
+
**[Glimmer](https://github.com/AndyObtiva/glimmer) DSL Comparison Table:**
|
27
29
|
DSL | Platforms | Native? | Vector Graphics? | Pros | Cons | Prereqs
|
28
30
|
----|-----------|---------|------------------|------|------|--------
|
29
|
-
[Glimmer DSL for SWT (JRuby Desktop Development GUI Framework)](https://github.com/AndyObtiva/glimmer-dsl-swt) | Mac / Windows / Linux | Yes | Yes (Canvas Shape DSL) | Very Mature / Scaffolding / Native Executable Packaging / Custom Widgets | Slow JRuby Startup Time / Heavy Memory Footprint | Java / JRuby
|
30
|
-
[Glimmer DSL for Opal (Pure Ruby Web GUI and Auto-Webifier of Desktop Apps)](https://github.com/AndyObtiva/glimmer-dsl-opal) | All Web Browsers | No | Yes (Canvas Shape DSL) | Simpler than All JavaScript Technologies / Auto-Webify Desktop Apps | Setup Process /
|
31
|
+
[Glimmer DSL for SWT (JRuby Desktop Development GUI Framework)](https://github.com/AndyObtiva/glimmer-dsl-swt) | Mac / Windows / Linux | Yes | Yes (Canvas Shape DSL) | Very Mature / Scaffolding / Native Executable Packaging / Custom Widgets | Slow JRuby Startup Time / Heavy Memory Footprint | Java / JRuby
|
32
|
+
[Glimmer DSL for Opal (Pure Ruby Web GUI and Auto-Webifier of Desktop Apps)](https://github.com/AndyObtiva/glimmer-dsl-opal) | All Web Browsers | No | Yes (Canvas Shape DSL) | Simpler than All JavaScript Technologies / Auto-Webify Desktop Apps | Setup Process / Incomplete Alpha | Rails
|
31
33
|
[Glimmer DSL for LibUI (Prerequisite-Free Ruby Desktop Development GUI Library)](https://github.com/AndyObtiva/glimmer-dsl-libui) | Mac / Windows / Linux | Yes | Yes (Area API) | Fast Startup Time / Light Memory Footprint | LibUI is an Incomplete Mid-Alpha Only | None Other Than MRI Ruby
|
32
|
-
[Glimmer DSL for Tk (
|
34
|
+
[Glimmer DSL for Tk (Ruby Tk Desktop Development GUI Library)](https://github.com/AndyObtiva/glimmer-dsl-tk) | Mac / Windows / Linux | Some Native-Themed Widgets (Not Truly Native) | Yes (Canvas) | Fast Startup Time / Light Memory Footprint | Widgets Do Not Look Truly Native, Espcially on Linux | ActiveTcl / MRI Ruby
|
33
35
|
[Glimmer DSL for GTK (Ruby-GNOME Desktop Development GUI Library)](https://github.com/AndyObtiva/glimmer-dsl-gtk) | Mac / Windows / Linux | Only on Linux | Yes (Cairo) | Complete Access to GNOME Features on Linux (Forte) | Not Native on Mac and Windows | None Other Than MRI Ruby on Linux / Brew Packages on Mac / MSYS & MING Toolchains on Windows / MRI Ruby
|
34
36
|
[Glimmer DSL for FX (FOX Toolkit Ruby Desktop Development GUI Library)](https://github.com/AndyObtiva/glimmer-dsl-fx) | Mac (requires XQuartz) / Windows / Linux | No | Yes (Canvas) | No Prerequisites on Windows (Forte Since Binaries Are Included Out of The Box) | Widgets Do Not Look Native / Mac Usage Obtrusively Starts XQuartz | None Other Than MRI Ruby on Windows / XQuarts on Mac / MRI Ruby
|
35
37
|
[Glimmer DSL for JFX (JRuby JavaFX Desktop Development GUI Library)](https://github.com/AndyObtiva/glimmer-dsl-jfx) | Mac / Windows / Linux | No | Yes (javafx.scene.shape and javafx.scene.canvas) | Rich in Custom Widgets | Slow JRuby Startup Time / Heavy Memory Footprint / Widgets Do Not Look Native | Java / JRuby / JavaFX SDK
|
@@ -240,7 +242,7 @@ Glimmer app:
|
|
240
242
|
|
241
243
|
## Background
|
242
244
|
|
243
|
-
[Ruby](https://www.ruby-lang.org) is a dynamically-typed object-oriented language, which provides great productivity gains due to its
|
245
|
+
[Ruby](https://www.ruby-lang.org) is a dynamically-typed object-oriented language, which provides great productivity gains due to its expressive syntax and dynamic nature. While it is proven by the [Ruby](https://www.ruby-lang.org) on Rails framework for web development, it currently lacks a robust platform-independent framework for building desktop applications. Given that [Java](https://www.oracle.com/ca-en/java/) libraries can now be utilized in Ruby code through JRuby, Eclipse technologies, such as [SWT](https://www.eclipse.org/swt/), JFace, and RCP can help fill the gap of desktop application development with Ruby.
|
244
246
|
|
245
247
|
## Software Architecture
|
246
248
|
|
@@ -299,10 +301,10 @@ https://www.eclipse.org/swt/faq.php
|
|
299
301
|
|
300
302
|
## Pre-requisites
|
301
303
|
|
302
|
-
- JDK
|
303
|
-
- [RVM](http://rvm.io) on Mac & Linux (not
|
304
|
+
- JDK 18 (find at https://www.oracle.com/java/technologies/downloads / Ensure `PATH` env var includes Java bin directory for `jpackage` command to work when packaging Glimmer applications / Preferably setup `JAVA_HOME` env var too to point to JDK home directory before installing JRuby)
|
305
|
+
- [RVM](http://rvm.io) on Mac & Linux (not needed on Windows)
|
304
306
|
- 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))
|
305
|
-
- SWT 4.
|
307
|
+
- SWT 4.23 (already included in the [glimmer-dsl-swt](https://rubygems.org/gems/glimmer-dsl-swt) gem). Note that SWT supports ARM64/AARCH64 on Mac and Linux since version 4.20
|
306
308
|
- Git (comes with Mac and Linux. Install on Windows: https://git-scm.com/download/win )
|
307
309
|
|
308
310
|
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.
|
@@ -331,7 +333,7 @@ jgem install glimmer-dsl-swt
|
|
331
333
|
|
332
334
|
Or this command if you want a specific version:
|
333
335
|
```
|
334
|
-
jgem install glimmer-dsl-swt -v 4.
|
336
|
+
jgem install glimmer-dsl-swt -v 4.23.0.0
|
335
337
|
```
|
336
338
|
|
337
339
|
`jgem` is JRuby's version of `gem` command.
|
@@ -359,7 +361,7 @@ Note: if you're using activerecord or activesupport, keep in mind that Glimmer u
|
|
359
361
|
|
360
362
|
Add the following to `Gemfile`:
|
361
363
|
```
|
362
|
-
gem 'glimmer-dsl-swt', '~> 4.
|
364
|
+
gem 'glimmer-dsl-swt', '~> 4.23.0.0'
|
363
365
|
```
|
364
366
|
|
365
367
|
And, then run:
|
@@ -382,7 +384,7 @@ glimmer
|
|
382
384
|
```
|
383
385
|
|
384
386
|
```
|
385
|
-
Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.
|
387
|
+
Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.23.0.0
|
386
388
|
|
387
389
|
Usage: glimmer [--bundler] [--pd] [--quiet] [--debug] [--log-level=VALUE] [[ENV_VAR=VALUE]...] [[-jruby-option]...] (application.rb or task[task_args]) [[application2.rb]...]
|
388
390
|
|
@@ -459,13 +461,15 @@ In a nutshell, the Glimmer GUI DSL syntax consists mainly of:
|
|
459
461
|
|
460
462
|
1. Keywords
|
461
463
|
|
464
|
+
Widgets are declared with keywords denoting their name in underscored format.
|
465
|
+
|
462
466
|
Example of a keyword representing a table widget:
|
463
467
|
|
464
468
|
```ruby
|
465
469
|
table
|
466
470
|
```
|
467
471
|
|
468
|
-
|
472
|
+
Widgets may optionally receive symbol-style/args within parentheses (otherwise, when there are no style/args, the parentheses are left out).
|
469
473
|
|
470
474
|
Example of a multi-line selection table widget:
|
471
475
|
|
@@ -473,7 +477,9 @@ Example of a multi-line selection table widget:
|
|
473
477
|
table(:multi)
|
474
478
|
```
|
475
479
|
|
476
|
-
|
480
|
+
2. Content/Properties
|
481
|
+
|
482
|
+
Widget content is always housed within a curly-brace (`{}`) style block.
|
477
483
|
|
478
484
|
Example of a multi-line selection table widget with a table column as content that has a header `text` property as 'Name'.
|
479
485
|
|
@@ -485,6 +491,37 @@ table(:multi) {
|
|
485
491
|
}
|
486
492
|
```
|
487
493
|
|
494
|
+
3. Listeners
|
495
|
+
|
496
|
+
Listeners embody the [Observer Design Pattern](https://en.wikipedia.org/wiki/Observer_pattern) and always start with `on_` followed by an event name (e.g. `on_widget_selected`). Also, they are an exception to Glimmer's syntax that requires a `do; end` style block to clearly demarcate as logic as opposed to View syntax.
|
497
|
+
|
498
|
+
Example of a button widget with a `text` property and an `on_widget_selected` listener.
|
499
|
+
|
500
|
+
```ruby
|
501
|
+
button {
|
502
|
+
text 'Click'
|
503
|
+
|
504
|
+
on_widget_selected do
|
505
|
+
message_box {
|
506
|
+
text 'Clicked'
|
507
|
+
message 'Thank you for clicking!'
|
508
|
+
}.open
|
509
|
+
end
|
510
|
+
}
|
511
|
+
```
|
512
|
+
|
513
|
+
4. Methods
|
514
|
+
|
515
|
+
Widgets have methods that invoke operations on them. Sometimes, they are required to be called in order to display the widgets (like the `open` method on `shell` and `message_box`)
|
516
|
+
|
517
|
+
Example of a shell with a `text` property and an invoked `open` method operation.
|
518
|
+
|
519
|
+
```ruby
|
520
|
+
shell {
|
521
|
+
text 'Hello, World!'
|
522
|
+
}.open
|
523
|
+
```
|
524
|
+
|
488
525
|
If you need more widgets, you can check out the [Nebula Project](https://github.com/AndyObtiva/glimmer-cw-nebula) (50+ enterprise-grade custom widgets)
|
489
526
|
|
490
527
|
Learn more at:
|
@@ -530,10 +567,14 @@ If you have a Glimmer app you would like referenced here, please mention in a Pu
|
|
530
567
|
|
531
568
|
### Are We There Yet?
|
532
569
|
|
570
|
+
This [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) application connects to a database using [ActiveRecord](https://rubygems.org/gems/activerecord).
|
571
|
+
|
533
572
|
[<img alt="Are We There Yet Logo" src="https://raw.githubusercontent.com/AndyObtiva/are-we-there-yet/master/are-we-there-yet-logo.svg" width="40" />Are We There Yet?](https://github.com/AndyObtiva/are-we-there-yet): A tool that helps you learn when your small projects will finish
|
534
573
|
|
535
574
|
### Garderie Rainbow Daily Agenda
|
536
575
|
|
576
|
+
This [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) application connects to a [Rails](https://rubyonrails.org/) server to submit an application.
|
577
|
+
|
537
578
|
[<img alt="Garderie Rainbow Daily Agenda Logo" src="https://github.com/AndyObtiva/garderie_rainbow_daily_agenda/raw/master/images/garderie_rainbow_daily_agenda_logo.png" width="40" />Garderie Rainbow Daily Agenda](https://github.com/AndyObtiva/garderie_rainbow_daily_agenda): A child nursery daily agenda reporting desktop app
|
538
579
|
|
539
580
|
### Glimmer Gab
|
@@ -552,6 +593,18 @@ If you have a Glimmer app you would like referenced here, please mention in a Pu
|
|
552
593
|
|
553
594
|
[Befunge 98 GUI](https://github.com/AndyObtiva/befunge98/tree/gui)
|
554
595
|
|
596
|
+
### Glimmer Klondike Solitaire
|
597
|
+
|
598
|
+
[<img alt="Glimmer Klondike Solitaire Icon" src="https://raw.githubusercontent.com/AndyObtiva/glimmer_klondike_solitaire/master/icons/linux/Glimmer%20Klondike%20Solitaire.png" height=40 /> Glimmer Klondike Solitaire](https://github.com/AndyObtiva/glimmer_klondike_solitaire)
|
599
|
+
|
600
|
+
### Glimmer Metronome
|
601
|
+
|
602
|
+
[<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer_metronome/master/icons/linux/Glimmer%20Metronome.png" height=40 /> Glimmer Metronome](https://github.com/AndyObtiva/glimmer_metronome)
|
603
|
+
|
604
|
+
### Glimmer Wordle
|
605
|
+
|
606
|
+
[<img src='https://raw.githubusercontent.com/AndyObtiva/glimmer_wordle/master/icons/linux/Glimmer Wordle.png' height=40 /> Glimmer Wordle - Word Game](https://github.com/AndyObtiva/glimmer_wordle)
|
607
|
+
|
555
608
|
## Packaging & Distribution
|
556
609
|
|
557
610
|
Glimmer simplifies the process of native-executable packaging and distribution on Mac and Windows via a single command:
|
@@ -589,6 +642,7 @@ Learn more by reading the [GPG](https://github.com/AndyObtiva/glimmer/blob/maste
|
|
589
642
|
|
590
643
|
## Resources
|
591
644
|
|
645
|
+
* [Glimmer DSL for SWT Video Tutorials](https://andymaleh.blogspot.com/search/label/Tutorial+SWT) ([Video Tutorial Playlist](https://www.youtube.com/watch?v=Mi5phsSdNAA&list=PLSN9HhZ_0-n741vRa_dL-M81cLbqD_kem) and [Video Tutorial Channel](https://www.youtube.com/channel/UC5hzDE23HZXsZLAxYk2UJEw))
|
592
646
|
* [Code Master Blog](http://andymaleh.blogspot.com/search/label/Glimmer)
|
593
647
|
* [JRuby Cookbook by Justin Edelson & Henry Liu](http://shop.oreilly.com/product/9780596519650.do)
|
594
648
|
* [InfoQ Article](http://www.infoq.com/news/2008/02/glimmer-jruby-swt)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
4.
|
1
|
+
4.23.0.0
|
@@ -10,6 +10,8 @@ glimmer
|
|
10
10
|
|
11
11
|
On Mac and Linux, it additionally brings up a TUI (Text-based User Interface) for interactive navigation and execution of Glimmer tasks (courtesy of [rake-tui](https://github.com/AndyObtiva/rake-tui)).
|
12
12
|
|
13
|
+
(note that in ARM64 machines, the TUI does not seem to work at the moment, so simply use glimmer commands directly without the TUI until this is fixed)
|
14
|
+
|
13
15
|
On Windows, it simply lists the available Glimmer tasks at the end (courtsey of [rake](https://github.com/ruby/rake)).
|
14
16
|
|
15
17
|
If you are new to Glimmer, you may read the Basic Usage section and skip the rest until you have gone through [Girb (Glimmer irb) Command](#girb-glimmer-irb-command), [Glimmer GUI DSL Syntax](#glimmer-gui-dsl-syntax), and [Samples](#samples).
|
@@ -107,7 +109,7 @@ glimmer samples/hello/hello_world.rb samples/hello/hello_tab.rb
|
|
107
109
|
|
108
110
|
Launches samples/hello/hello_world.rb and samples/hello_tab.rb at the same time, each in a separate JRuby thread.
|
109
111
|
|
110
|
-
Note: under Zsh (Z Shell), glimmer can only be used in its advanced
|
112
|
+
Note: under Zsh (Z Shell), glimmer can only be used in its advanced \ mode (e.g. `glimmer` and then selecting a task) not the primitive rake task mode (e.g. `glimmer scaffold[app]`)
|
111
113
|
|
112
114
|
### Glimmer Samples
|
113
115
|
|
@@ -1736,8 +1736,6 @@ https://help.eclipse.org/2019-12/nftopic/org.eclipse.platform.doc.isv/reference/
|
|
1736
1736
|
|
1737
1737
|
### Canvas Shape DSL
|
1738
1738
|
|
1739
|
-
**(BETA FEATURE)**
|
1740
|
-
|
1741
1739
|
While other GUI toolkits only offer a way to draw graphics imperatively (e.g. draw_arc, draw_rectangle, move_to, line_to, etc...), Glimmer DSL for SWT breaks away from the mold by enabling software engineers to draw graphics declaratively. Simply declare all the shapes you want to see with their attributes, like background/foreground colors, and Glimmer DSL for SWT takes care of the rest, painting graphics on a blank `canvas` widget or amending/decorating an existing widget. This is accomplished through the Canvas Shape DSL, a sub-DSL of the Glimmer GUI DSL, which makes it possible to draw graphics declaratively with very understandable and maintainable syntax. Still, for the rare cases where imperative logic is needed, Glimmer DSL for SWT supports imperative painting of graphics through direct usage of SWT.
|
1742
1740
|
|
1743
1741
|
![Canvas Shape DSL Line](/images/glimmer-canvas-shape-dsl-line.png)
|
@@ -2723,8 +2721,6 @@ Check [Hello, Canvas!](/docs/reference/GLIMMER_SAMPLES.md#hello-canvas) for an e
|
|
2723
2721
|
|
2724
2722
|
#### Pixel Graphics
|
2725
2723
|
|
2726
|
-
**(BETA FEATURE)**
|
2727
|
-
|
2728
2724
|
If you need to paint pixel graphics, use the optimized `pixel` keyword alternative to `point`, which takes foreground as a hash argument and bypasses the [Glimmer DSL Engine chain of responsibility](https://github.com/AndyObtiva/glimmer#dsl-engine), thus rendering faster when having very large pixel counts.
|
2729
2725
|
|
2730
2726
|
Example (you may copy/paste in [`girb`](GLIMMER_GIRB.md)):
|
@@ -2905,8 +2901,6 @@ As they say, there are many ways to skin a cat! This is in line with the Ruby wa
|
|
2905
2901
|
|
2906
2902
|
### Canvas Path DSL
|
2907
2903
|
|
2908
|
-
**(BETA FEATURE)**
|
2909
|
-
|
2910
2904
|
Unlike common imperative GUI graphing toolkits, Glimmer enables declarative rendering of paths with the new Canvas Path DSL (Early Alpha) via the new `path { }` keyword and by nesting one of the following path segment keywords underneath:
|
2911
2905
|
- `point(x1, y1)`: renders a Point (Dot) as part of a path.
|
2912
2906
|
- `line(x1, y1, x2=nil, y2=nil)`: renders a Line as part of a path. If you drop x2, y2, it joins to the previous point automatically. You may repeat for a series of lines forming a curve.
|
@@ -2951,8 +2945,6 @@ Every path segment object (mixing in [`Glimmer::SWT::Custom::PathSegment`](/lib/
|
|
2951
2945
|
|
2952
2946
|
### Canvas Transform DSL
|
2953
2947
|
|
2954
|
-
**(BETA FEATURE)**
|
2955
|
-
|
2956
2948
|
The transform DSL builds [org.eclipse.swt.graphics.Transform](https://help.eclipse.org/2020-12/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/graphics/Transform.html) objects with a nice declarative syntax.
|
2957
2949
|
|
2958
2950
|
`transform` keyword builds a `Transform` object. It optionally takes the transformation matrix elements: (m11, m12, m21, m22, dx, dy)
|
@@ -3811,7 +3803,7 @@ Custom widgets are brand new Glimmer DSL keywords that represent aggregates of e
|
|
3811
3803
|
|
3812
3804
|
You can find out about [published Glimmer Custom Widgets](https://github.com/AndyObtiva/glimmer-dsl-swt#gem-listing) by running the `glimmer list:gems:customwidget` command
|
3813
3805
|
|
3814
|
-
Glimmer supports
|
3806
|
+
Glimmer supports two ways of creating custom widgets with minimal code:
|
3815
3807
|
1. Method-based Custom Widgets (for single-view-internal reuse): Extract a method containing Glimmer DSL widget syntax. Useful for quickly eliminating redundant code within a single view.
|
3816
3808
|
2. Class-based Custom Widgets (for multiple-view-external reuse): Create a class that includes the `Glimmer::UI::CustomWidget` module and Glimmer DSL widget syntax in a `body {}` block. This will automatically extend Glimmer's DSL syntax with an underscored lowercase keyword matching the class name by convention. Useful in making a custom widget available in many views.
|
3817
3809
|
|
@@ -4429,9 +4421,11 @@ Also, you may check out [Hello, Custom Widget!](/docs/reference/GLIMMER_SAMPLES.
|
|
4429
4421
|
|
4430
4422
|
### Custom Shells
|
4431
4423
|
|
4432
|
-
Custom
|
4424
|
+
Custom shell is a kind of a [custom widget](#custom-widgets) that has `shell` (window) as the body root widget. It can be used to represent an application or a reusable window that may be opened/hidden/closed independently of the main application.
|
4425
|
+
|
4426
|
+
Except in the case of small demos, it is always recommended to build [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) applications as custom shells.
|
4433
4427
|
|
4434
|
-
|
4428
|
+
Custom shells may also be chained in a wizard fashion in some cases.
|
4435
4429
|
|
4436
4430
|
You can find out about [published Glimmer Custom Shells](https://github.com/AndyObtiva/glimmer-dsl-swt#gem-listing) by running the `glimmer list:gems:customshell` command
|
4437
4431
|
|
@@ -4468,33 +4462,41 @@ class WizardStep
|
|
4468
4462
|
}
|
4469
4463
|
end
|
4470
4464
|
|
4471
|
-
|
4472
|
-
|
4473
|
-
|
4474
|
-
|
4475
|
-
|
4476
|
-
|
4477
|
-
|
4478
|
-
|
4479
|
-
|
4465
|
+
class Wizard
|
4466
|
+
include Glimmer::UI::CustomShell
|
4467
|
+
|
4468
|
+
body {
|
4469
|
+
shell { |app_shell|
|
4470
|
+
text "Wizard"
|
4471
|
+
minimum_size 200, 100
|
4472
|
+
@current_step_number = 1
|
4473
|
+
@wizard_steps = 5.times.map { |n|
|
4474
|
+
wizard_step(number: n+1, step_count: 5) {
|
4475
|
+
on_swt_hide do
|
4476
|
+
if @current_step_number < 5
|
4477
|
+
@current_step_number += 1
|
4478
|
+
app_shell.hide
|
4479
|
+
@wizard_steps[@current_step_number - 1].open
|
4480
|
+
end
|
4481
|
+
end
|
4482
|
+
}
|
4483
|
+
}
|
4484
|
+
button {
|
4485
|
+
text "Start"
|
4486
|
+
font height: 40
|
4487
|
+
on_widget_selected do
|
4480
4488
|
app_shell.hide
|
4481
4489
|
@wizard_steps[@current_step_number - 1].open
|
4482
4490
|
end
|
4483
|
-
|
4491
|
+
}
|
4484
4492
|
}
|
4485
4493
|
}
|
4486
|
-
|
4487
|
-
|
4488
|
-
|
4489
|
-
on_widget_selected do
|
4490
|
-
app_shell.hide
|
4491
|
-
@wizard_steps[@current_step_number - 1].open
|
4492
|
-
end
|
4493
|
-
}
|
4494
|
-
}.open
|
4494
|
+
end
|
4495
|
+
|
4496
|
+
Wizard.launch
|
4495
4497
|
```
|
4496
4498
|
|
4497
|
-
If you use a Custom Shell as the top-level app shell, you may invoke the class method `.launch` instead to avoid building an app class yourself or including Glimmer into the top-level namespace (e.g. `Tetris.launch` instead of `include Glimmer; tetris.open`)
|
4499
|
+
If you use a Custom Shell as the top-level app shell, you may invoke the class method `.launch` instead of `open` to avoid building an app class yourself or including Glimmer into the top-level namespace (e.g. `Tetris.launch` instead of `include Glimmer; tetris.open`)
|
4498
4500
|
|
4499
4501
|
You may check out [Hello, Custom Shell!](/docs/reference/GLIMMER_SAMPLES.md#hello-custom-shell) for another example.
|
4500
4502
|
|
@@ -84,8 +84,6 @@
|
|
84
84
|
- [Glimmer Calculator](#glimmer-calculator)
|
85
85
|
- [Gladiator](#gladiator)
|
86
86
|
- [Timer](#timer)
|
87
|
-
- [Glimmer Klondike Solitaire](#glimmer-klondike-solitaire)
|
88
|
-
- [Glimmer Metronome](#glimmer-metronome)
|
89
87
|
- [License](#license)
|
90
88
|
|
91
89
|
## Samples
|
@@ -116,6 +114,8 @@ For hello-type simple samples, check the following.
|
|
116
114
|
|
117
115
|
#### Hello, World!
|
118
116
|
|
117
|
+
[Hello, World! Video Tutorial](https://www.youtube.com/watch?v=Mi5phsSdNAA&list=PLSN9HhZ_0-n741vRa_dL-M81cLbqD_kem&index=1)
|
118
|
+
|
119
119
|
Code:
|
120
120
|
|
121
121
|
[samples/hello/hello_world.rb](/samples/hello/hello_world.rb)
|
@@ -196,6 +196,8 @@ Code:
|
|
196
196
|
|
197
197
|
#### Hello, Layout!
|
198
198
|
|
199
|
+
[Hello, Layout! Video Tutorial](https://www.youtube.com/watch?v=dAVFR9Y_thY&list=PLSN9HhZ_0-n741vRa_dL-M81cLbqD_kem&index=4)
|
200
|
+
|
199
201
|
This sample demonstrates the standard 3 layouts in SWT (though one can write their own for very advanced applications): `fill_layout`, `row_layout`, and `grid_layout`
|
200
202
|
|
201
203
|
Code:
|
@@ -262,6 +264,8 @@ Always On Top Shell
|
|
262
264
|
|
263
265
|
#### Hello, Tab!
|
264
266
|
|
267
|
+
[Hello, Tab! Video Tutorial](https://www.youtube.com/watch?v=cMwlYZ78uaQ&list=PLSN9HhZ_0-n741vRa_dL-M81cLbqD_kem&index=3)
|
268
|
+
|
265
269
|
Code:
|
266
270
|
|
267
271
|
[samples/hello/hello_tab.rb](/samples/hello/hello_tab.rb)
|
@@ -361,6 +365,8 @@ Code:
|
|
361
365
|
|
362
366
|
#### Hello, Message Box!
|
363
367
|
|
368
|
+
[Hello, Message Box! Video Tutorial](https://www.youtube.com/watch?v=N0sDcr0xp40&list=PLSN9HhZ_0-n741vRa_dL-M81cLbqD_kem&index=2)
|
369
|
+
|
364
370
|
This sample demonstrates a `message_box` dialog.
|
365
371
|
|
366
372
|
Code:
|
@@ -1252,7 +1258,7 @@ Code:
|
|
1252
1258
|
|
1253
1259
|
![Klondike Solitaire Played](/images/glimmer-klondike-solitaire-played.png)
|
1254
1260
|
|
1255
|
-
Check out a souped up large-card-size packaged version of the game in the [Glimmer Klondike Solitaire](
|
1261
|
+
Check out a souped up large-card-size packaged version of the game in the [Glimmer Klondike Solitaire](https://github.com/AndyObtiva/glimmer_klondike_solitaire) application.
|
1256
1262
|
|
1257
1263
|
#### Battleship
|
1258
1264
|
|
@@ -1336,6 +1342,8 @@ This sample demonstrates a Metronome that accepts a beat count and bpm rate, tic
|
|
1336
1342
|
|
1337
1343
|
It takes advantage of the Canvas Shape DSL, data-binding, and the Java Sound library. It employs a hybrid approach of relying on standard widget layouts (grid layout) and canvas shape x,y placement.
|
1338
1344
|
|
1345
|
+
An external more full-fledged version exists too as [Glimmer Metronome](https://github.com/AndyObtiva/glimmer_metronome).
|
1346
|
+
|
1339
1347
|
Code:
|
1340
1348
|
|
1341
1349
|
[samples/elaborate/metronome.rb](/samples/elaborate/metronome.rb)
|
@@ -1421,22 +1429,6 @@ Gladiator is a good demonstration of:
|
|
1421
1429
|
|
1422
1430
|
[<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer-cs-timer/master/glimmer-timer-screenshot.png" />](https://github.com/AndyObtiva/glimmer-cs-timer)
|
1423
1431
|
|
1424
|
-
#### Glimmer Klondike Solitaire
|
1425
|
-
|
1426
|
-
This is a souped up version of the Klondike Solitaire elaborate sample, which is built as an external application to enable packaging as a native executable installer. Enjoy!
|
1427
|
-
|
1428
|
-
[<img alt="Glimmer Klondike Solitaire Icon" src="https://raw.githubusercontent.com/AndyObtiva/glimmer_klondike_solitaire/master/package/linux/Glimmer%20Klondike%20Solitaire.png" height=40 /> Glimmer Klondike Solitaire](https://github.com/AndyObtiva/glimmer_klondike_solitaire)
|
1429
|
-
|
1430
|
-
![Glimmer Klondike Solitaire](https://raw.githubusercontent.com/AndyObtiva/glimmer_klondike_solitaire/master/images/glimmer-klondike-solitaire.png)
|
1431
|
-
|
1432
|
-
#### Glimmer Metronome
|
1433
|
-
|
1434
|
-
This is an external enhanced version of [Metronome](#metronome) that can be packaged as an independent native executable.
|
1435
|
-
|
1436
|
-
[<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer_metronome/master/icons/linux/Glimmer%20Metronome.png" height=40 /> Glimmer Metronome](https://github.com/AndyObtiva/glimmer_metronome)
|
1437
|
-
|
1438
|
-
![Metronome](https://raw.githubusercontent.com/AndyObtiva/glimmer_metronome/master/screenshots/glimmer-metronome.png)
|
1439
|
-
|
1440
1432
|
## License
|
1441
1433
|
|
1442
1434
|
[MIT](LICENSE.txt)
|
data/glimmer-dsl-swt.gemspec
CHANGED
Binary file
|
data/lib/glimmer/launcher.rb
CHANGED
@@ -72,10 +72,13 @@ module Glimmer
|
|
72
72
|
OPERATING_SYSTEMS_SUPPORTED.detect {|os| OS.send("#{os}?")}
|
73
73
|
end
|
74
74
|
|
75
|
-
def
|
75
|
+
def is_arm64?
|
76
76
|
host_cpu = OS.host_cpu.downcase
|
77
|
-
|
78
|
-
|
77
|
+
host_cpu.include?('aarch64') || host_cpu.include?('arm')
|
78
|
+
end
|
79
|
+
|
80
|
+
def special_cpu_architecture_suffix
|
81
|
+
is_arm64? ? "_aarch64" : ''
|
79
82
|
end
|
80
83
|
|
81
84
|
def swt_jar_file
|
@@ -187,7 +190,7 @@ module Glimmer
|
|
187
190
|
end
|
188
191
|
|
189
192
|
def display_tasks
|
190
|
-
if OS.windows?
|
193
|
+
if OS.windows? || Launcher.is_arm64?
|
191
194
|
require 'rake'
|
192
195
|
Rake::TaskManager.record_task_metadata = true
|
193
196
|
require_relative 'rake_task'
|
@@ -597,12 +597,13 @@ module Glimmer
|
|
597
597
|
Display.app_name = '#{shell_type == :gem ? human_name(custom_shell_name) : human_name(namespace)}'
|
598
598
|
Display.app_version = VERSION
|
599
599
|
@display = display {
|
600
|
-
on_about
|
600
|
+
on_about do
|
601
601
|
display_about_dialog
|
602
|
-
|
603
|
-
|
602
|
+
end
|
603
|
+
|
604
|
+
on_preferences do
|
604
605
|
#{shell_type == :desktopify ? 'display_about_dialog' : 'display_preferences_dialog'}
|
605
|
-
|
606
|
+
end
|
606
607
|
}
|
607
608
|
end
|
608
609
|
MULTI_LINE_STRING
|
@@ -658,17 +659,21 @@ module Glimmer
|
|
658
659
|
menu_bar {
|
659
660
|
menu {
|
660
661
|
text '&File'
|
662
|
+
|
661
663
|
menu_item {
|
662
664
|
text '&About...'
|
663
|
-
|
665
|
+
|
666
|
+
on_widget_selected do
|
664
667
|
display_about_dialog
|
665
|
-
|
668
|
+
end
|
666
669
|
}
|
670
|
+
|
667
671
|
menu_item {
|
668
672
|
text '&Preferences...'
|
669
|
-
|
673
|
+
|
674
|
+
on_widget_selected do
|
670
675
|
#{shell_type == :desktopify ? 'display_about_dialog' : 'display_preferences_dialog'}
|
671
|
-
|
676
|
+
end
|
672
677
|
}
|
673
678
|
}
|
674
679
|
}
|
@@ -697,31 +702,37 @@ module Glimmer
|
|
697
702
|
custom_shell_file_content += <<-MULTI_LINE_STRING
|
698
703
|
def display_preferences_dialog
|
699
704
|
dialog(swt_widget) {
|
700
|
-
text 'Preferences'
|
701
705
|
grid_layout {
|
702
706
|
margin_height 5
|
703
707
|
margin_width 5
|
704
708
|
}
|
709
|
+
|
710
|
+
text 'Preferences'
|
711
|
+
|
705
712
|
group {
|
706
713
|
row_layout {
|
707
714
|
type :vertical
|
708
715
|
spacing 10
|
709
716
|
}
|
717
|
+
|
710
718
|
text 'Greeting'
|
711
719
|
font style: :bold
|
720
|
+
|
712
721
|
[
|
713
722
|
'Hello, World!',
|
714
723
|
'Howdy, Partner!'
|
715
724
|
].each do |greeting_text|
|
716
725
|
button(:radio) {
|
717
|
-
text greeting_text
|
718
|
-
selection <= [self, :greeting, on_read: ->(g) { g == greeting_text }]
|
719
726
|
layout_data {
|
720
727
|
width 160
|
721
728
|
}
|
722
|
-
|
729
|
+
|
730
|
+
text greeting_text
|
731
|
+
selection <= [self, :greeting, on_read: ->(g) { g == greeting_text }]
|
732
|
+
|
733
|
+
on_widget_selected do |event|
|
723
734
|
self.greeting = event.widget.getText
|
724
|
-
|
735
|
+
end
|
725
736
|
}
|
726
737
|
end
|
727
738
|
}
|
@@ -823,6 +834,7 @@ end
|
|
823
834
|
background background_color
|
824
835
|
cubic size_width - size_width*0.66, size_height/2 - size_height*0.33, size_width*0.65 - size_width*0.66, 0 - size_height*0.33, size_width/2 - size_width*0.66, size_height*0.75 - size_height*0.33, size_width - size_width*0.66, size_height - size_height*0.33
|
825
836
|
}
|
837
|
+
|
826
838
|
path {
|
827
839
|
background background_color
|
828
840
|
cubic size_width - size_width*0.66, size_height/2 - size_height*0.33, size_width*1.35 - size_width*0.66, 0 - size_height*0.33, size_width*1.5 - size_width*0.66, size_height*0.75 - size_height*0.33, size_width - size_width*0.66, size_height - size_height*0.33
|
@@ -1026,14 +1026,17 @@ module Glimmer
|
|
1026
1026
|
|
1027
1027
|
def ensure_extent(paint_event)
|
1028
1028
|
old_extent = @extent
|
1029
|
+
old_extent_args = @extent_args
|
1029
1030
|
if ['text', 'string'].include?(@name)
|
1030
1031
|
extent_args = [string]
|
1031
1032
|
extent_flags = SWTProxy[:draw_transparent, :draw_delimiter] if current_parameter_name?(:is_transparent) && is_transparent
|
1032
1033
|
extent_flags = flags if current_parameter_name?(:flags)
|
1033
1034
|
extent_args << extent_flags unless extent_flags.nil?
|
1034
1035
|
self.extent = paint_event.gc.send("#{@name}Extent", *extent_args)
|
1036
|
+
@extent_args = extent_args
|
1035
1037
|
end
|
1036
|
-
|
1038
|
+
# comparing extent_args with old ones ensures that if content changes, calculated_args_changed! is called
|
1039
|
+
if !@extent.nil? && (old_extent&.x != @extent&.x || old_extent&.y != @extent&.y || @extent_args != old_extent_args)
|
1037
1040
|
calculated_args_changed!
|
1038
1041
|
parent.calculated_args_changed_for_defaults! if parent.is_a?(Shape)
|
1039
1042
|
end
|
@@ -1101,10 +1104,11 @@ module Glimmer
|
|
1101
1104
|
default_x? && x_delta,
|
1102
1105
|
default_y? && default_y,
|
1103
1106
|
default_y? && y_delta,
|
1107
|
+
(['text', 'string'].include?(@name) && string),
|
1104
1108
|
]
|
1105
1109
|
if calculated_args_dependencies != @calculated_args_dependencies
|
1106
1110
|
# avoid recalculating values again
|
1107
|
-
x, y, parent_absolute_x, parent_absolute_y, default_width, default_width_delta, default_height, default_height_delta, max_width, max_width_delta, max_height, max_height_delta, default_x, default_x_delta, default_y, default_y_delta = @calculated_args_dependencies = calculated_args_dependencies
|
1111
|
+
x, y, parent_absolute_x, parent_absolute_y, default_width, default_width_delta, default_height, default_height_delta, max_width, max_width_delta, max_height, max_height_delta, default_x, default_x_delta, default_y, default_y_delta, string = @calculated_args_dependencies = calculated_args_dependencies
|
1108
1112
|
# Note: Must set x and move_by because not all shapes have a real x and some must translate all their points with move_by
|
1109
1113
|
# TODO change that by setting a bounding box for all shapes with a calculated top-left x, y and
|
1110
1114
|
# a setter that does the moving inside them instead so that I could rely on absolute_x and absolute_y
|