glimmer-dsl-libui 0.11.6 → 0.11.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -3
- data/LICENSE.txt +1 -1
- data/README.md +55 -8
- data/VERSION +1 -1
- data/bin/girb +1 -1
- data/bin/girb_runner.rb +1 -1
- data/bin/glimmer +1 -1
- data/docs/examples/GLIMMER-DSL-LIBUI-ADVANCED-EXAMPLES.md +1 -1
- data/docs/examples/GLIMMER-DSL-LIBUI-BASIC-EXAMPLES.md +13 -689
- data/examples/basic_area.rb +3 -5
- data/examples/basic_area2.rb +6 -8
- data/examples/basic_area3.rb +5 -7
- data/examples/basic_area4.rb +8 -10
- data/examples/basic_table_button.rb +20 -22
- data/examples/basic_table_button2.rb +13 -15
- data/examples/basic_table_checkbox.rb +17 -19
- data/examples/basic_table_checkbox_text.rb +17 -19
- data/examples/basic_table_color.rb +8 -10
- data/examples/basic_table_color2.rb +7 -9
- data/examples/basic_table_color3.rb +7 -9
- data/examples/basic_table_image_text.rb +6 -8
- data/examples/basic_table_image_text2.rb +6 -8
- data/examples/basic_table_image_text3.rb +6 -8
- data/examples/date_time_picker.rb +17 -17
- data/examples/date_time_picker2.rb +5 -13
- data/examples/lazy_table.rb +8 -10
- data/examples/lazy_table2.rb +8 -10
- data/examples/lazy_table3.rb +8 -10
- data/examples/lazy_table4.rb +8 -10
- data/examples/simple_notepad.rb +1 -7
- data/examples/tetris/model/block.rb +1 -1
- data/examples/tetris/model/game.rb +1 -1
- data/examples/tetris/model/past_game.rb +1 -1
- data/examples/tetris/model/tetromino.rb +1 -1
- data/examples/tetris.rb +1 -1
- data/examples/tic_tac_toe/board.rb +1 -1
- data/examples/tic_tac_toe/cell.rb +1 -1
- data/glimmer-dsl-libui.gemspec +0 -0
- data/lib/glimmer/dsl/libui/bind_expression.rb +1 -1
- data/lib/glimmer/dsl/libui/content_expression.rb +1 -1
- data/lib/glimmer/dsl/libui/control_expression.rb +1 -1
- data/lib/glimmer/dsl/libui/custom_control_expression.rb +1 -1
- data/lib/glimmer/dsl/libui/custom_shape_expression.rb +1 -1
- data/lib/glimmer/dsl/libui/data_binding_expression.rb +1 -1
- data/lib/glimmer/dsl/libui/dsl.rb +1 -1
- data/lib/glimmer/dsl/libui/file_expression.rb +1 -1
- data/lib/glimmer/dsl/libui/listener_expression.rb +1 -1
- data/lib/glimmer/dsl/libui/observe_expression.rb +2 -1
- data/lib/glimmer/dsl/libui/open_file_expression.rb +1 -1
- data/lib/glimmer/dsl/libui/open_folder_expression.rb +1 -1
- data/lib/glimmer/dsl/libui/operation_expression.rb +1 -1
- data/lib/glimmer/dsl/libui/property_expression.rb +1 -1
- data/lib/glimmer/dsl/libui/save_file_expression.rb +1 -1
- data/lib/glimmer/dsl/libui/shape_expression.rb +1 -1
- data/lib/glimmer/dsl/libui/shine_data_binding_expression.rb +1 -1
- data/lib/glimmer/dsl/libui/string_expression.rb +1 -1
- data/lib/glimmer/dsl/libui/tab_item_expression.rb +1 -1
- data/lib/glimmer/fiddle_consumer.rb +1 -1
- data/lib/glimmer/libui/attributed_string.rb +1 -1
- data/lib/glimmer/libui/control_proxy/area_proxy/scrolling_area_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/area_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/box/horizontal_box_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/box/vertical_box_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/box.rb +1 -1
- data/lib/glimmer/libui/control_proxy/button_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/checkbox_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/color_button_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/column/background_color_column_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/column/button_column_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/column/checkbox_column_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/column/checkbox_text_color_column_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/column/checkbox_text_column_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/column/image_column_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/column/image_text_color_column_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/column/image_text_column_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/column/progress_bar_column_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/column/text_color_column_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/column/text_column_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/column.rb +1 -1
- data/lib/glimmer/libui/control_proxy/combobox_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/date_time_picker_proxy/date_picker_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/date_time_picker_proxy/time_picker_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/date_time_picker_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/dual_column.rb +1 -1
- data/lib/glimmer/libui/control_proxy/editable_column.rb +1 -1
- data/lib/glimmer/libui/control_proxy/editable_combobox_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/enableable_column.rb +1 -1
- data/lib/glimmer/libui/control_proxy/entry_proxy/password_entry_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/entry_proxy/search_entry_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/entry_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/font_button_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/form_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/grid_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/group_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/image_part_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/image_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/label_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/matrix_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/menu_item_proxy/about_menu_item_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/menu_item_proxy/check_menu_item_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/menu_item_proxy/preferences_menu_item_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/menu_item_proxy/quit_menu_item_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/menu_item_proxy/radio_menu_item_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/menu_item_proxy/separator_menu_item_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/menu_item_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/menu_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/message_box/msg_box_error_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/message_box/msg_box_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/message_box.rb +1 -1
- data/lib/glimmer/libui/control_proxy/multiline_entry_proxy/non_wrapping_multiline_entry_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/multiline_entry_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/open_type_features_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/open_type_tag_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/path_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/radio_buttons_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/slider_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/spinbox_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/tab_item_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/table_proxy.rb +7 -2
- data/lib/glimmer/libui/control_proxy/text_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/transformable.rb +7 -3
- data/lib/glimmer/libui/control_proxy/triple_column.rb +1 -1
- data/lib/glimmer/libui/control_proxy/window_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy.rb +1 -1
- data/lib/glimmer/libui/custom_control/code_area.rb +1 -1
- data/lib/glimmer/libui/custom_control/refined_table.rb +1 -1
- data/lib/glimmer/libui/custom_control.rb +1 -1
- data/lib/glimmer/libui/custom_shape.rb +1 -1
- data/lib/glimmer/libui/custom_window.rb +1 -1
- data/lib/glimmer/libui/data_bindable.rb +1 -1
- data/lib/glimmer/libui/parent.rb +1 -1
- data/lib/glimmer/libui/shape/arc.rb +1 -1
- data/lib/glimmer/libui/shape/bezier.rb +1 -1
- data/lib/glimmer/libui/shape/circle.rb +1 -1
- data/lib/glimmer/libui/shape/figure.rb +1 -1
- data/lib/glimmer/libui/shape/line.rb +1 -1
- data/lib/glimmer/libui/shape/polybezier.rb +1 -1
- data/lib/glimmer/libui/shape/polygon.rb +1 -1
- data/lib/glimmer/libui/shape/polyline.rb +1 -1
- data/lib/glimmer/libui/shape/rectangle.rb +1 -1
- data/lib/glimmer/libui/shape/square.rb +1 -1
- data/lib/glimmer/libui/shape.rb +3 -3
- data/lib/glimmer/libui.rb +1 -1
- data/lib/glimmer/rake_task/package.rb +1 -1
- data/lib/glimmer/rake_task/scaffold.rb +1 -1
- data/lib/glimmer/rake_task.rb +1 -1
- data/lib/glimmer-dsl-libui.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a57b8761d40fc28195e78f1e86c6f79523b7989b74066e365c3ec8988954e8fb
|
4
|
+
data.tar.gz: 1fcd57a450862c58f262afb1327d234a8797e8f2b51411efea3aa322b61d7f87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e67eadc262f72ce1744acb89aaaa4c97d7ac4a492ddce2792fceec8f6ec12cba46332530f7182c0a751b155fa63dc6598b92ff0e8c8c9b32b7a43c78f630112b
|
7
|
+
data.tar.gz: 0d42308957235c137d69a9b31b6a000ba99cf08cb1e9efccb77781a06379627c2601a8fcfe2f03c5681e419da78ebf74aad21d1312d249ca80de4a8e6cf5d33d
|
data/CHANGELOG.md
CHANGED
@@ -1,11 +1,22 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 0.11.8
|
4
|
+
|
5
|
+
- Fix issue with applying a `transform` inside a `Glimmer::LibUI::Application`, `Glimmer::LibUI::CustomControl`, `Glimmer::LibUI::CustomWindow`, or `Glimmer::LibUI::CustomShape` (it otherwise worked when using Glimmer GUI DSL in top-level object)
|
6
|
+
- Refactor/simplify examples by removing unnecessary `vertical_box`/`horizontal_box` uses
|
7
|
+
|
8
|
+
## 0.11.7
|
9
|
+
|
10
|
+
- Fix issue with `table` `checkbox_text_color_column` checkbox edits not working
|
11
|
+
|
3
12
|
## 0.11.6
|
4
13
|
|
5
14
|
- Organize scaffolded application menus under a `menu_bar` method
|
6
|
-
-
|
7
|
-
-
|
8
|
-
-
|
15
|
+
- Optimize performance of startup time, cutting ~26ms by delaying load of certain gems until needed:
|
16
|
+
- Cut ~16ms of startup time by not loading `perfect-shape` gem until area canvas graphics are used
|
17
|
+
- Cut ~10ms of startup time by not loading `color` gem until used by `Glimmer::LibUI.interpret_color` method
|
18
|
+
- Optimize performance of scaffolding, cutting ~54ms by not loading `facets` gem completely, yet load used part of facets only ('facets/string/titlecase')
|
19
|
+
- Optimize performance of glimmer command listing of gems, cutting ~54ms by not loading `facets` gem completely, yet load used part of facets only ('facets/string/titlecase')
|
9
20
|
- Fix issue with `listener_expression.rb` failing for `TextProxy` due to not having `can_handle_listener?` method.
|
10
21
|
- Fix issue with `TextProxy.can_handle_listener?` crashing when `text` is nested under `area` `on_draw`
|
11
22
|
|
data/LICENSE.txt
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 LibUI 0.11.
|
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 LibUI 0.11.8
|
2
2
|
## Prerequisite-Free Ruby Desktop Development Cross-Platform Native GUI Library ([Fukuoka Award Winning](http://www.digitalfukuoka.jp/topics/187?locale=ja))
|
3
3
|
### The Quickest Way From Zero To GUI
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/glimmer-dsl-libui.svg)](http://badge.fury.io/rb/glimmer-dsl-libui)
|
@@ -28,7 +28,7 @@ The main trade-off in using [Glimmer DSL for LibUI](https://rubygems.org/gems/gl
|
|
28
28
|
- [Declarative DSL syntax](#glimmer-gui-dsl-concepts) that visually maps to the GUI control hierarchy
|
29
29
|
- [Convention over configuration](#smart-defaults-and-conventions) via smart defaults and automation of low-level details
|
30
30
|
- Requiring the [least amount of syntax](#glimmer-gui-dsl-concepts) possible to build GUI
|
31
|
-
- [Custom Component](#custom-components) support (Custom Controls, Custom Windows, and Custom Shapes)
|
31
|
+
- [Custom Component](#custom-components) support (Custom Controls, Custom Windows, and Custom Shapes), including external Ruby gems (e.g. [Graphs and Charts](https://github.com/AndyObtiva/glimmer-libui-cc-graphs_and_charts))
|
32
32
|
- [Bidirectional/Unidirectional Data-Binding](#data-binding) to declaratively wire and automatically synchronize GUI Views with Models
|
33
33
|
- [Scaffolding](#scaffold-application) for new custom windows/controls, apps, and gems
|
34
34
|
- [Far Future Plan] Native-Executable packaging on Mac, Windows, and Linux.
|
@@ -47,8 +47,28 @@ Mac | Windows | Linux
|
|
47
47
|
----|---------|------
|
48
48
|
![glimmer-dsl-libui-mac-basic-window.png](images/glimmer-dsl-libui-mac-basic-window.png) | ![glimmer-dsl-libui-windows-basic-window.png](images/glimmer-dsl-libui-windows-basic-window.png) | ![glimmer-dsl-libui-linux-basic-window.png](images/glimmer-dsl-libui-linux-basic-window.png)
|
49
49
|
|
50
|
+
Basic Button
|
51
|
+
|
52
|
+
```ruby
|
53
|
+
require 'glimmer-dsl-libui'
|
54
|
+
|
55
|
+
include Glimmer
|
56
|
+
|
57
|
+
window('hello world', 300, 200) {
|
58
|
+
button('Button') {
|
59
|
+
on_clicked do
|
60
|
+
msg_box('Information', 'You clicked the button')
|
61
|
+
end
|
62
|
+
}
|
63
|
+
}.show
|
64
|
+
```
|
65
|
+
|
50
66
|
Basic Table Progress Bar
|
51
67
|
|
68
|
+
Mac | Windows | Linux
|
69
|
+
----|---------|------
|
70
|
+
![glimmer-dsl-libui-mac-basic-button.png](/images/glimmer-dsl-libui-mac-basic-button.png) ![glimmer-dsl-libui-mac-basic-button-msg-box.png](/images/glimmer-dsl-libui-mac-basic-button-msg-box.png) | ![glimmer-dsl-libui-windows-basic-button.png](/images/glimmer-dsl-libui-windows-basic-button.png) ![glimmer-dsl-libui-windows-basic-button-msg-box.png](/images/glimmer-dsl-libui-windows-basic-button-msg-box.png) | ![glimmer-dsl-libui-linux-basic-button.png](/images/glimmer-dsl-libui-linux-basic-button.png) ![glimmer-dsl-libui-linux-basic-button-msg-box.png](/images/glimmer-dsl-libui-linux-basic-button-msg-box.png)
|
71
|
+
|
52
72
|
```ruby
|
53
73
|
require 'glimmer-dsl-libui'
|
54
74
|
|
@@ -433,7 +453,7 @@ gem install glimmer-dsl-libui
|
|
433
453
|
Or install via Bundler `Gemfile`:
|
434
454
|
|
435
455
|
```ruby
|
436
|
-
gem 'glimmer-dsl-libui', '~> 0.11.
|
456
|
+
gem 'glimmer-dsl-libui', '~> 0.11.8'
|
437
457
|
```
|
438
458
|
|
439
459
|
Test that installation worked by running the [Glimmer Meta-Example](#examples):
|
@@ -465,7 +485,7 @@ Afterwards, to access the Glimmer GUI DSL:
|
|
465
485
|
|
466
486
|
You may learn more about the different options above with basic examples in the following subsections: [Experimentation Usage](#experimentation-usage), [Prototyping Usage](#prototyping-usage), [Serious Usage](#serious-usage).
|
467
487
|
|
468
|
-
If you are new to [Glimmer DSL for LibUI](https://rubygems.org/gems/glimmer-dsl-libui) (beginner), after going through the subsections below, check out the RubyConf 2022 talk ["Building Native GUI Apps in Ruby"](https://andymaleh.blogspot.com/2023/02/rubyconf-2022-talk-video-for-building.html), [Glimmer GUI DSL Concepts](#glimmer-gui-dsl-concepts), [Glimmer Command](#glimmer-command) (just the basics, how to run an app, and how to run examples to start), [Girb](#girb-glimmer-irb) and [Examples](#examples) to quickly learn through copy/paste. It is very important for beginners to go through all the [Examples](#examples) from the most basic to the most advanced while reading the README topics that relate to the examples. Alternatively, beginners can learn from the RubyConf 2023 workshop ["How To Build Desktop Applications in Ruby"](https://github.com/AndyObtiva/how-to-build-desktop-applications-in-ruby), which includes 27 step-by-step exercises. You may refer to the [API](#api) once you have gotten your feet wet with [Glimmer DSL for LibUI](https://rubygems.org/gems/glimmer-dsl-libui) and need a more detailed reference.
|
488
|
+
If you are new to [Glimmer DSL for LibUI](https://rubygems.org/gems/glimmer-dsl-libui) (beginner), after going through the subsections below, check out the RubyConf 2022 talk ["Building Native GUI Apps in Ruby"](https://andymaleh.blogspot.com/2023/02/rubyconf-2022-talk-video-for-building.html), [Glimmer GUI DSL Concepts](#glimmer-gui-dsl-concepts), [Glimmer Style Guide](#glimmer-style-guide), [Glimmer Command](#glimmer-command) (just the basics, how to run an app, and how to run examples to start), [Girb](#girb-glimmer-irb) and [Examples](#examples) to quickly learn through copy/paste. It is very important for beginners to go through all the [Examples](#examples) from the most basic to the most advanced while reading the README topics that relate to the examples. Alternatively, beginners can learn from the RubyConf 2023 workshop ["How To Build Desktop Applications in Ruby"](https://github.com/AndyObtiva/how-to-build-desktop-applications-in-ruby), which includes 27 step-by-step exercises. You may refer to the [API](#api) once you have gotten your feet wet with [Glimmer DSL for LibUI](https://rubygems.org/gems/glimmer-dsl-libui) and need a more detailed reference.
|
469
489
|
|
470
490
|
If you encounter any issues with the documentation, get stuck with code you do not understand, or notice some out-of-date information, you may contact the project maintainers on the [Glimmer Gitter Chat](https://app.gitter.im/#/room/#AndyObtiva_glimmer:gitter.im). Also, this could be your opportunity to be a good steward of Open-Source Software by contributing a documentation fix in a GitHub Pull Request or reporting a GitHub Issue at least.
|
471
491
|
|
@@ -640,7 +660,7 @@ Mac | Windows | Linux
|
|
640
660
|
|
641
661
|
Application scaffolding enables automatically generating the directories/files of a new desktop GUI application that follows the MVC architecture and can be packaged as a Ruby gem that includes an executable script for running the app conveniently. It also ensures that software engineers follow the recommended Glimmer DSL for LibUI conventions and best practices. Application Scaffolding greatly improves software engineering productivity when building desktop applications with [Glimmer DSL for LibUI](https://rubygems.org/gems/glimmer-dsl-libui).
|
642
662
|
|
643
|
-
Application Scaffolding relies on the
|
663
|
+
Application Scaffolding relies on the juwelier Ruby gem, which expects a local Git config of [`user.name`](https://docs.github.com/en/get-started/getting-started-with-git/setting-your-username-in-git#setting-your-git-username-for-every-repository-on-your-computer) (git config --global user.name "FirstName LastName") and `github.user` (`git config --global github.user githubusername`).
|
644
664
|
|
645
665
|
Scaffold Glimmer DSL for LibUI application with this command:
|
646
666
|
|
@@ -1356,6 +1376,8 @@ window {
|
|
1356
1376
|
...
|
1357
1377
|
```
|
1358
1378
|
|
1379
|
+
A real external Custom Control Gem is [Graphs and Charts](https://github.com/AndyObtiva/glimmer-libui-cc-graphs_and_charts).
|
1380
|
+
|
1359
1381
|
### Scaffold Custom Window Gem
|
1360
1382
|
|
1361
1383
|
A custom window is a specialization of a custom control that has a `window` as its `body` root.
|
@@ -1721,6 +1743,9 @@ window('hello world', 300, 200) {
|
|
1721
1743
|
end
|
1722
1744
|
}.show
|
1723
1745
|
```
|
1746
|
+
|
1747
|
+
Make sure that you follow the [Glimmer Style Guide](#glimmer-style-guide) when writing any Glimmer GUI DSL code.
|
1748
|
+
|
1724
1749
|
## API
|
1725
1750
|
|
1726
1751
|
Any control returned by a [Glimmer GUI DSL](#glimmer-gui-dsl-concepts) keyword declaration can be introspected for its properties and updated via object-oriented attributes (standard Ruby `attr`/`attr=` or `set_attr`).
|
@@ -1753,7 +1778,7 @@ These are all the supported keywords. Note that some keywords do not represent c
|
|
1753
1778
|
Keyword(Args) | Properties | Listeners
|
1754
1779
|
------------- | ---------- | ---------
|
1755
1780
|
`about_menu_item` | None | `on_clicked`
|
1756
|
-
`area` | `auto_draw_enabled` | `on_draw(area_draw_params)`, `on_mouse_event(area_mouse_event)`, `on_mouse_down(area_mouse_event)`, `on_mouse_up(area_mouse_event)`, `on_mouse_drag_started(area_mouse_event)`, `on_mouse_dragged(area_mouse_event)`, `on_mouse_dropped(area_mouse_event)`, `on_mouse_entered`, `on_mouse_exited`, `on_key_event(area_key_event)`, `on_key_down(area_key_event)`, `on_key_up(area_key_event)`
|
1781
|
+
`area` | `auto_draw_enabled` | `on_draw(area_draw_params)`, `on_mouse_event(area_mouse_event)`, `on_mouse_moved(area_mouse_event)`, `on_mouse_down(area_mouse_event)`, `on_mouse_up(area_mouse_event)`, `on_mouse_drag_started(area_mouse_event)`, `on_mouse_dragged(area_mouse_event)`, `on_mouse_dropped(area_mouse_event)`, `on_mouse_entered`, `on_mouse_exited`, `on_key_event(area_key_event)`, `on_key_down(area_key_event)`, `on_key_up(area_key_event)`
|
1757
1782
|
`arc(x_center as Numeric, y_center as Numeric, radius as Numeric, start_angle as Numeric, sweep as Numeric, is_negative as Boolean)` | `x_center` (`Numeric`), `y_center` (`Numeric`), `radius` (`Numeric`), `start_angle` (`Numeric`), `sweep` (`Numeric`), `is_negative` (Boolean) | None
|
1758
1783
|
`background_color_column` | None | None
|
1759
1784
|
`bezier(x = nil as Numeric, y = nil as Numeric, c1_x as Numeric, c1_y as Numeric, c2_x as Numeric, c2_y as Numeric, end_x as Numeric, end_y as Numeric)` | `x` (`Numeric`), `y` (`Numeric`), `c1_x` (`Numeric`), `c1_y` (`Numeric`), `c2_x` (`Numeric`), `c2_y` (`Numeric`), `end_x` (`Numeric`), `end_y` (`Numeric`) | None
|
@@ -2119,6 +2144,8 @@ The `area` control is a canvas-like control for drawing paths that can be used i
|
|
2119
2144
|
|
2120
2145
|
Note that when nesting an `area` directly underneath `window` (without a layout control like `vertical_box`), it is automatically reparented with `vertical_box` in between the `window` and `area` since it would not show up on Linux otherwise.
|
2121
2146
|
|
2147
|
+
Also, note that Canvas graphics performance is a bit slow today due to the Ruby LibUI binding making Canvas drawing calls with FFI. There is currently work under way to re-implement the Canvas drawing calls with C Native Extensions, which should speed up performance by 10x-100x once fully implemented. Still, if the `area` control is needed to paint simple or mostly static graphics that do not change much (not updating more than once a second), then current `area` performance should be more than fast enough for those needs.
|
2148
|
+
|
2122
2149
|
Here is an example of a declarative `area` with a stable path (you may copy/paste in [`girb`](#girb-glimmer-irb)):
|
2123
2150
|
|
2124
2151
|
```ruby
|
@@ -3001,7 +3028,7 @@ For example, you can define a custom `address_view` control as an aggregate of m
|
|
3001
3028
|
|
3002
3029
|
There are two ways to define custom components:
|
3003
3030
|
- Method-Based: simply define a method representing the custom component you want (e.g. `address_view`) with any options needed (e.g. `address(address_model: some_model)`).
|
3004
|
-
- Class-Based: define a class matching the camelcased name of the custom component by convention (e.g. the `address_view` custom component keyword would have a class called `AddressView`) and `include Glimmer::LibUI::CustomControl`, `include Glimmer::LibUI::CustomWindow`, or `include Glimmer::LibUI::CustomShape` depending on if the component represents a standard control, a whole window, or an [area canvas graphics shape](#area-path-shapes). Classes add the benefit of being able to distribute the custom components into a separate file for external reuse from multiple views or for sharing as a Ruby gem.
|
3031
|
+
- Class-Based: define a class matching the camelcased name of the custom component by convention (e.g. the `address_view` custom component keyword would have a class called `AddressView`) and `include Glimmer::LibUI::CustomControl`, `include Glimmer::LibUI::CustomWindow`, or `include Glimmer::LibUI::CustomShape` depending on if the component represents a standard control, a whole window, or an [area canvas graphics shape](#area-path-shapes). Classes add the benefit of being able to distribute the custom components into a separate file for external reuse from multiple views or for sharing as a Ruby gem (e.g. [Graphs and Charts Ruby gem](https://github.com/AndyObtiva/glimmer-libui-cc-graphs_and_charts)).
|
3005
3032
|
|
3006
3033
|
It is OK to use the terms "custom control", "custom component", and "custom keyword" synonymously though "custom component" is a broader term that covers things other than controls too like custom shapes (e.g. `cube`), custom attributed strings (e.g. `alternating_color_string`), and custom transforms (`isometric_transform`).
|
3007
3034
|
|
@@ -3778,6 +3805,8 @@ Last but not least, Ruby recently supported WASM, including the ability to [pack
|
|
3778
3805
|
|
3779
3806
|
## Glimmer Style Guide
|
3780
3807
|
|
3808
|
+
The code of the Glimmer GUI DSL is not standard imperative Ruby code because it represents a declarative Domain Specific Language for describing the hierarchical structure of a Graphical User Interface, meaning a language embedded within Ruby that is slightly separate from Ruby. So, it is important that it has a declarative style that helps Software Engineers focus on the visual aspect of the Graphical User Interface in a highly productive manner. As such, multi-line blocks intentionally do not use imperative words like `do; end` that slow readability down, yet the declarative `{}` style that helps give a quick visual view of GUI component nesting at a glance. However, MVC Views are observed for changes by listeners that then invoke imperative logic in Models, so listener multi-line blocks do have the `do; end` style to clearly distinguish imperative code from declarative code in Views. In summary, the Ruby Style Guide is not applicable when writing Glimmer GUI DSL code. Software Engineers must adhere to the Glimmer Style Guide for View code instead to cater to the style requirements of both declarative DSL code and imperative Ruby code.
|
3809
|
+
|
3781
3810
|
**1 - Control arguments are always wrapped by parentheses.**
|
3782
3811
|
|
3783
3812
|
Example:
|
@@ -4124,6 +4153,16 @@ Mac | Windows | Linux
|
|
4124
4153
|
----|---------|------
|
4125
4154
|
![glimmer-dsl-libui-mac-form-table.png](/images/glimmer-dsl-libui-mac-form-table.png) | ![glimmer-dsl-libui-windows-form-table.png](/images/glimmer-dsl-libui-windows-form-table.png) | ![glimmer-dsl-libui-linux-form-table.png](/images/glimmer-dsl-libui-linux-form-table.png)
|
4126
4155
|
|
4156
|
+
## Libraries
|
4157
|
+
|
4158
|
+
### Graphs and Charts
|
4159
|
+
|
4160
|
+
This is a Ruby gem that aims at providing support for graphs and charts (custom controls) in Glimmer DSL for LibUI.
|
4161
|
+
|
4162
|
+
https://github.com/AndyObtiva/glimmer-libui-cc-graphs_and_charts
|
4163
|
+
|
4164
|
+
![basic line graph](https://github.com/AndyObtiva/glimmer-libui-cc-graphs_and_charts/raw/master/screenshots/glimmer-libui-cc-graphs_and_charts-mac-basic-line-graph.png)
|
4165
|
+
|
4127
4166
|
## Applications
|
4128
4167
|
|
4129
4168
|
Here are some applications built with [Glimmer DSL for LibUI](https://rubygems.org/gems/glimmer-dsl-libui)
|
@@ -4190,6 +4229,14 @@ This is built as an exploratory software prototype by [Ari Brown](https://github
|
|
4190
4229
|
|
4191
4230
|
![Electric Avenue](https://user-images.githubusercontent.com/16188/260890040-b4b28429-1789-4cdd-a708-45a2bd62b70f.png)
|
4192
4231
|
|
4232
|
+
### Adamantite
|
4233
|
+
|
4234
|
+
A local password manager written in Ruby (closed source software):
|
4235
|
+
|
4236
|
+
https://rubygems.org/gems/adamantite
|
4237
|
+
|
4238
|
+
![Adamantite password manager](/images/glimmer-dsl-libui-mac-application-adamantite.png)
|
4239
|
+
|
4193
4240
|
## Process
|
4194
4241
|
|
4195
4242
|
[Glimmer Process](https://github.com/AndyObtiva/glimmer/blob/master/PROCESS.md)
|
@@ -4252,7 +4299,7 @@ Note that the latest development sometimes takes place in the [development](http
|
|
4252
4299
|
|
4253
4300
|
[MIT](LICENSE.txt)
|
4254
4301
|
|
4255
|
-
Copyright (c) 2021-
|
4302
|
+
Copyright (c) 2021-2024 Andy Maleh
|
4256
4303
|
|
4257
4304
|
--
|
4258
4305
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.11.
|
1
|
+
0.11.8
|
data/bin/girb
CHANGED
data/bin/girb_runner.rb
CHANGED
data/bin/glimmer
CHANGED
@@ -3015,7 +3015,7 @@ class Tetris
|
|
3015
3015
|
|
3016
3016
|
def show_about_dialog
|
3017
3017
|
Glimmer::LibUI.queue_main do
|
3018
|
-
msg_box('About', 'Glimmer Tetris - Glimmer DSL for LibUI Example - Copyright (c) 2021-
|
3018
|
+
msg_box('About', 'Glimmer Tetris - Glimmer DSL for LibUI Example - Copyright (c) 2021-2024 Andy Maleh')
|
3019
3019
|
end
|
3020
3020
|
end
|
3021
3021
|
end
|