glimmer-dsl-libui 0.11.7 → 0.11.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/LICENSE.txt +1 -1
  4. data/README.md +11 -4
  5. data/VERSION +1 -1
  6. data/bin/girb +1 -1
  7. data/bin/girb_runner.rb +1 -1
  8. data/bin/glimmer +1 -1
  9. data/docs/examples/GLIMMER-DSL-LIBUI-ADVANCED-EXAMPLES.md +1 -1
  10. data/docs/examples/GLIMMER-DSL-LIBUI-BASIC-EXAMPLES.md +13 -689
  11. data/examples/basic_area.rb +3 -5
  12. data/examples/basic_area2.rb +6 -8
  13. data/examples/basic_area3.rb +5 -7
  14. data/examples/basic_area4.rb +8 -10
  15. data/examples/basic_table_button.rb +20 -22
  16. data/examples/basic_table_button2.rb +13 -15
  17. data/examples/basic_table_checkbox.rb +17 -19
  18. data/examples/basic_table_checkbox_text.rb +17 -19
  19. data/examples/basic_table_color.rb +8 -10
  20. data/examples/basic_table_color2.rb +7 -9
  21. data/examples/basic_table_color3.rb +7 -9
  22. data/examples/basic_table_image_text.rb +6 -8
  23. data/examples/basic_table_image_text2.rb +6 -8
  24. data/examples/basic_table_image_text3.rb +6 -8
  25. data/examples/date_time_picker.rb +17 -17
  26. data/examples/date_time_picker2.rb +5 -13
  27. data/examples/lazy_table.rb +8 -10
  28. data/examples/lazy_table2.rb +8 -10
  29. data/examples/lazy_table3.rb +8 -10
  30. data/examples/lazy_table4.rb +8 -10
  31. data/examples/simple_notepad.rb +1 -7
  32. data/examples/tetris/model/block.rb +1 -1
  33. data/examples/tetris/model/game.rb +1 -1
  34. data/examples/tetris/model/past_game.rb +1 -1
  35. data/examples/tetris/model/tetromino.rb +1 -1
  36. data/examples/tetris.rb +1 -1
  37. data/examples/tic_tac_toe/board.rb +1 -1
  38. data/examples/tic_tac_toe/cell.rb +1 -1
  39. data/glimmer-dsl-libui.gemspec +0 -0
  40. data/lib/glimmer/dsl/libui/bind_expression.rb +1 -1
  41. data/lib/glimmer/dsl/libui/content_expression.rb +1 -1
  42. data/lib/glimmer/dsl/libui/control_expression.rb +1 -1
  43. data/lib/glimmer/dsl/libui/custom_control_expression.rb +1 -1
  44. data/lib/glimmer/dsl/libui/custom_shape_expression.rb +1 -1
  45. data/lib/glimmer/dsl/libui/data_binding_expression.rb +1 -1
  46. data/lib/glimmer/dsl/libui/dsl.rb +1 -1
  47. data/lib/glimmer/dsl/libui/file_expression.rb +1 -1
  48. data/lib/glimmer/dsl/libui/listener_expression.rb +1 -1
  49. data/lib/glimmer/dsl/libui/observe_expression.rb +2 -1
  50. data/lib/glimmer/dsl/libui/open_file_expression.rb +1 -1
  51. data/lib/glimmer/dsl/libui/open_folder_expression.rb +1 -1
  52. data/lib/glimmer/dsl/libui/operation_expression.rb +1 -1
  53. data/lib/glimmer/dsl/libui/property_expression.rb +1 -1
  54. data/lib/glimmer/dsl/libui/save_file_expression.rb +1 -1
  55. data/lib/glimmer/dsl/libui/shape_expression.rb +1 -1
  56. data/lib/glimmer/dsl/libui/shine_data_binding_expression.rb +1 -1
  57. data/lib/glimmer/dsl/libui/string_expression.rb +1 -1
  58. data/lib/glimmer/dsl/libui/tab_item_expression.rb +1 -1
  59. data/lib/glimmer/fiddle_consumer.rb +1 -1
  60. data/lib/glimmer/libui/attributed_string.rb +1 -1
  61. data/lib/glimmer/libui/control_proxy/area_proxy/scrolling_area_proxy.rb +1 -1
  62. data/lib/glimmer/libui/control_proxy/area_proxy.rb +1 -1
  63. data/lib/glimmer/libui/control_proxy/box/horizontal_box_proxy.rb +1 -1
  64. data/lib/glimmer/libui/control_proxy/box/vertical_box_proxy.rb +1 -1
  65. data/lib/glimmer/libui/control_proxy/box.rb +1 -1
  66. data/lib/glimmer/libui/control_proxy/button_proxy.rb +1 -1
  67. data/lib/glimmer/libui/control_proxy/checkbox_proxy.rb +1 -1
  68. data/lib/glimmer/libui/control_proxy/color_button_proxy.rb +1 -1
  69. data/lib/glimmer/libui/control_proxy/column/background_color_column_proxy.rb +1 -1
  70. data/lib/glimmer/libui/control_proxy/column/button_column_proxy.rb +1 -1
  71. data/lib/glimmer/libui/control_proxy/column/checkbox_column_proxy.rb +1 -1
  72. data/lib/glimmer/libui/control_proxy/column/checkbox_text_color_column_proxy.rb +1 -1
  73. data/lib/glimmer/libui/control_proxy/column/checkbox_text_column_proxy.rb +1 -1
  74. data/lib/glimmer/libui/control_proxy/column/image_column_proxy.rb +1 -1
  75. data/lib/glimmer/libui/control_proxy/column/image_text_color_column_proxy.rb +1 -1
  76. data/lib/glimmer/libui/control_proxy/column/image_text_column_proxy.rb +1 -1
  77. data/lib/glimmer/libui/control_proxy/column/progress_bar_column_proxy.rb +1 -1
  78. data/lib/glimmer/libui/control_proxy/column/text_color_column_proxy.rb +1 -1
  79. data/lib/glimmer/libui/control_proxy/column/text_column_proxy.rb +1 -1
  80. data/lib/glimmer/libui/control_proxy/column.rb +1 -1
  81. data/lib/glimmer/libui/control_proxy/combobox_proxy.rb +1 -1
  82. data/lib/glimmer/libui/control_proxy/date_time_picker_proxy/date_picker_proxy.rb +1 -1
  83. data/lib/glimmer/libui/control_proxy/date_time_picker_proxy/time_picker_proxy.rb +1 -1
  84. data/lib/glimmer/libui/control_proxy/date_time_picker_proxy.rb +1 -1
  85. data/lib/glimmer/libui/control_proxy/dual_column.rb +1 -1
  86. data/lib/glimmer/libui/control_proxy/editable_column.rb +1 -1
  87. data/lib/glimmer/libui/control_proxy/editable_combobox_proxy.rb +1 -1
  88. data/lib/glimmer/libui/control_proxy/enableable_column.rb +1 -1
  89. data/lib/glimmer/libui/control_proxy/entry_proxy/password_entry_proxy.rb +1 -1
  90. data/lib/glimmer/libui/control_proxy/entry_proxy/search_entry_proxy.rb +1 -1
  91. data/lib/glimmer/libui/control_proxy/entry_proxy.rb +1 -1
  92. data/lib/glimmer/libui/control_proxy/font_button_proxy.rb +1 -1
  93. data/lib/glimmer/libui/control_proxy/form_proxy.rb +1 -1
  94. data/lib/glimmer/libui/control_proxy/grid_proxy.rb +1 -1
  95. data/lib/glimmer/libui/control_proxy/group_proxy.rb +1 -1
  96. data/lib/glimmer/libui/control_proxy/image_part_proxy.rb +1 -1
  97. data/lib/glimmer/libui/control_proxy/image_proxy.rb +1 -1
  98. data/lib/glimmer/libui/control_proxy/label_proxy.rb +1 -1
  99. data/lib/glimmer/libui/control_proxy/matrix_proxy.rb +1 -1
  100. data/lib/glimmer/libui/control_proxy/menu_item_proxy/about_menu_item_proxy.rb +1 -1
  101. data/lib/glimmer/libui/control_proxy/menu_item_proxy/check_menu_item_proxy.rb +1 -1
  102. data/lib/glimmer/libui/control_proxy/menu_item_proxy/preferences_menu_item_proxy.rb +1 -1
  103. data/lib/glimmer/libui/control_proxy/menu_item_proxy/quit_menu_item_proxy.rb +1 -1
  104. data/lib/glimmer/libui/control_proxy/menu_item_proxy/radio_menu_item_proxy.rb +1 -1
  105. data/lib/glimmer/libui/control_proxy/menu_item_proxy/separator_menu_item_proxy.rb +1 -1
  106. data/lib/glimmer/libui/control_proxy/menu_item_proxy.rb +1 -1
  107. data/lib/glimmer/libui/control_proxy/menu_proxy.rb +1 -1
  108. data/lib/glimmer/libui/control_proxy/message_box/msg_box_error_proxy.rb +1 -1
  109. data/lib/glimmer/libui/control_proxy/message_box/msg_box_proxy.rb +1 -1
  110. data/lib/glimmer/libui/control_proxy/message_box.rb +1 -1
  111. data/lib/glimmer/libui/control_proxy/multiline_entry_proxy/non_wrapping_multiline_entry_proxy.rb +1 -1
  112. data/lib/glimmer/libui/control_proxy/multiline_entry_proxy.rb +1 -1
  113. data/lib/glimmer/libui/control_proxy/open_type_features_proxy.rb +1 -1
  114. data/lib/glimmer/libui/control_proxy/open_type_tag_proxy.rb +1 -1
  115. data/lib/glimmer/libui/control_proxy/path_proxy.rb +1 -1
  116. data/lib/glimmer/libui/control_proxy/radio_buttons_proxy.rb +1 -1
  117. data/lib/glimmer/libui/control_proxy/slider_proxy.rb +1 -1
  118. data/lib/glimmer/libui/control_proxy/spinbox_proxy.rb +1 -1
  119. data/lib/glimmer/libui/control_proxy/tab_item_proxy.rb +1 -1
  120. data/lib/glimmer/libui/control_proxy/table_proxy.rb +6 -1
  121. data/lib/glimmer/libui/control_proxy/text_proxy.rb +1 -1
  122. data/lib/glimmer/libui/control_proxy/transformable.rb +7 -3
  123. data/lib/glimmer/libui/control_proxy/triple_column.rb +1 -1
  124. data/lib/glimmer/libui/control_proxy/window_proxy.rb +1 -1
  125. data/lib/glimmer/libui/control_proxy.rb +1 -1
  126. data/lib/glimmer/libui/custom_control/code_area.rb +1 -1
  127. data/lib/glimmer/libui/custom_control/refined_table.rb +1 -1
  128. data/lib/glimmer/libui/custom_control.rb +1 -1
  129. data/lib/glimmer/libui/custom_shape.rb +1 -1
  130. data/lib/glimmer/libui/custom_window.rb +1 -1
  131. data/lib/glimmer/libui/data_bindable.rb +1 -1
  132. data/lib/glimmer/libui/parent.rb +1 -1
  133. data/lib/glimmer/libui/shape/arc.rb +1 -1
  134. data/lib/glimmer/libui/shape/bezier.rb +1 -1
  135. data/lib/glimmer/libui/shape/circle.rb +1 -1
  136. data/lib/glimmer/libui/shape/figure.rb +1 -1
  137. data/lib/glimmer/libui/shape/line.rb +1 -1
  138. data/lib/glimmer/libui/shape/polybezier.rb +1 -1
  139. data/lib/glimmer/libui/shape/polygon.rb +1 -1
  140. data/lib/glimmer/libui/shape/polyline.rb +1 -1
  141. data/lib/glimmer/libui/shape/rectangle.rb +1 -1
  142. data/lib/glimmer/libui/shape/square.rb +1 -1
  143. data/lib/glimmer/libui/shape.rb +3 -3
  144. data/lib/glimmer/libui.rb +1 -1
  145. data/lib/glimmer/rake_task/package.rb +1 -1
  146. data/lib/glimmer/rake_task/scaffold.rb +1 -1
  147. data/lib/glimmer/rake_task.rb +1 -1
  148. data/lib/glimmer-dsl-libui.rb +1 -1
  149. metadata +5 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 07dbccff31a389edf42d2fa69ae2ef9b9542d2117d01dfdb50eb586ebc76306c
4
- data.tar.gz: ba4cd480c791257bbbf762e1dd96dff5ab0a04b152ff6c65e4eaf02acc6808e5
3
+ metadata.gz: a57b8761d40fc28195e78f1e86c6f79523b7989b74066e365c3ec8988954e8fb
4
+ data.tar.gz: 1fcd57a450862c58f262afb1327d234a8797e8f2b51411efea3aa322b61d7f87
5
5
  SHA512:
6
- metadata.gz: 6cfdf98cce4e5a8b51abdef7ed0e030314ec580f454897383189140ad01c81be98f1e134422a5e9ca8fd48ee6b96153d595935cbc1b39133c98da20f8e8122e0
7
- data.tar.gz: 4b6d53753335cdfad880df26cd6fdc2affa537a101d73ff6d833f2f050fcb0ab24943423ccbd8b08aca9c5c8a063997cb0f43f9731bad3d1eb55fcf92de11182
6
+ metadata.gz: e67eadc262f72ce1744acb89aaaa4c97d7ac4a492ddce2792fceec8f6ec12cba46332530f7182c0a751b155fa63dc6598b92ff0e8c8c9b32b7a43c78f630112b
7
+ data.tar.gz: 0d42308957235c137d69a9b31b6a000ba99cf08cb1e9efccb77781a06379627c2601a8fcfe2f03c5681e419da78ebf74aad21d1312d249ca80de4a8e6cf5d33d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
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
+
3
8
  ## 0.11.7
4
9
 
5
10
  - Fix issue with `table` `checkbox_text_color_column` checkbox edits not working
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2021-2023 Andy Maleh
1
+ Copyright (c) 2021-2024 Andy Maleh
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
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.7
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)
@@ -453,7 +453,7 @@ gem install glimmer-dsl-libui
453
453
  Or install via Bundler `Gemfile`:
454
454
 
455
455
  ```ruby
456
- gem 'glimmer-dsl-libui', '~> 0.11.7'
456
+ gem 'glimmer-dsl-libui', '~> 0.11.8'
457
457
  ```
458
458
 
459
459
  Test that installation worked by running the [Glimmer Meta-Example](#examples):
@@ -485,7 +485,7 @@ Afterwards, to access the Glimmer GUI DSL:
485
485
 
486
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).
487
487
 
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 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.
489
489
 
490
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.
491
491
 
@@ -1743,6 +1743,9 @@ window('hello world', 300, 200) {
1743
1743
  end
1744
1744
  }.show
1745
1745
  ```
1746
+
1747
+ Make sure that you follow the [Glimmer Style Guide](#glimmer-style-guide) when writing any Glimmer GUI DSL code.
1748
+
1746
1749
  ## API
1747
1750
 
1748
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`).
@@ -2141,6 +2144,8 @@ The `area` control is a canvas-like control for drawing paths that can be used i
2141
2144
 
2142
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.
2143
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
+
2144
2149
  Here is an example of a declarative `area` with a stable path (you may copy/paste in [`girb`](#girb-glimmer-irb)):
2145
2150
 
2146
2151
  ```ruby
@@ -3800,6 +3805,8 @@ Last but not least, Ruby recently supported WASM, including the ability to [pack
3800
3805
 
3801
3806
  ## Glimmer Style Guide
3802
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
+
3803
3810
  **1 - Control arguments are always wrapped by parentheses.**
3804
3811
 
3805
3812
  Example:
@@ -4292,7 +4299,7 @@ Note that the latest development sometimes takes place in the [development](http
4292
4299
 
4293
4300
  [MIT](LICENSE.txt)
4294
4301
 
4295
- Copyright (c) 2021-2023 Andy Maleh
4302
+ Copyright (c) 2021-2024 Andy Maleh
4296
4303
 
4297
4304
  --
4298
4305
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.11.7
1
+ 0.11.8
data/bin/girb CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- # Copyright (c) 2021-2023 Andy Maleh
3
+ # Copyright (c) 2021-2024 Andy Maleh
4
4
  #
5
5
  # Permission is hereby granted, free of charge, to any person obtaining
6
6
  # a copy of this software and associated documentation files (the
data/bin/girb_runner.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2021-2023 Andy Maleh
1
+ # Copyright (c) 2021-2024 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
data/bin/glimmer CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- # Copyright (c) 2021-2023 Andy Maleh
3
+ # Copyright (c) 2021-2024 Andy Maleh
4
4
  #
5
5
  # Permission is hereby granted, free of charge, to any person obtaining
6
6
  # a copy of this software and associated documentation files (the
@@ -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-2023 Andy Maleh')
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