glimmer-dsl-libui 0.2.14 → 0.2.18

Sign up to get free protection for your applications and to get access to all the features.
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.2.14
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.2.18
2
2
  ## Prerequisite-Free Ruby Desktop Development GUI Library
3
3
  [![Gem Version](https://badge.fury.io/rb/glimmer-dsl-libui.svg)](http://badge.fury.io/rb/glimmer-dsl-libui)
4
4
  [![Join the chat at https://gitter.im/AndyObtiva/glimmer](https://badges.gitter.im/AndyObtiva/glimmer.svg)](https://gitter.im/AndyObtiva/glimmer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
@@ -28,7 +28,16 @@ include Glimmer
28
28
  window('hello world').show
29
29
  ```
30
30
 
31
+ Mac
32
+
31
33
  ![glimmer-dsl-libui-mac-basic-window.png](images/glimmer-dsl-libui-mac-basic-window.png)
34
+
35
+ Windows
36
+
37
+ ![glimmer-dsl-libui-windows-basic-window.png](images/glimmer-dsl-libui-windows-basic-window.png)
38
+
39
+ Linux
40
+
32
41
  ![glimmer-dsl-libui-linux-basic-window.png](images/glimmer-dsl-libui-linux-basic-window.png)
33
42
 
34
43
  Basic Table Progress Bar
@@ -68,7 +77,16 @@ window('Task Progress', 300, 200) {
68
77
  }.show
69
78
  ```
70
79
 
80
+ Mac
81
+
71
82
  ![glimmer-dsl-libui-mac-basic-table-progress-bar.png](images/glimmer-dsl-libui-mac-basic-table-progress-bar.png)
83
+
84
+ Windows
85
+
86
+ ![glimmer-dsl-libui-windows-basic-table-progress-bar.png](images/glimmer-dsl-libui-windows-basic-table-progress-bar.png)
87
+
88
+ Linux
89
+
72
90
  ![glimmer-dsl-libui-linux-basic-table-progress-bar.png](images/glimmer-dsl-libui-linux-basic-table-progress-bar.png)
73
91
 
74
92
  Area Gallery
@@ -94,31 +112,24 @@ window('Area Gallery', 400, 400) {
94
112
  fill x0: 10, y0: 10, x1: 350, y1: 350, stops: [{pos: 0.25, r: 204, g: 102, b: 204}, {pos: 0.75, r: 102, g: 102, b: 204}]
95
113
  }
96
114
  path { # declarative stable path
97
- figure(100, 100) {
98
- line(100, 400)
99
- line(400, 100)
100
- line(400, 400)
101
-
102
- closed true
103
- }
104
-
115
+ polygon(100, 100, 100, 400, 400, 100, 400, 400)
116
+
105
117
  fill r: 202, g: 102, b: 104, a: 0.5
106
118
  stroke r: 0, g: 0, b: 0
107
119
  }
108
120
  path { # declarative stable path
109
- figure(0, 0) {
110
- bezier(200, 100, 100, 200, 400, 100)
111
- bezier(300, 100, 100, 300, 100, 400)
112
- bezier(100, 300, 300, 100, 400, 400)
113
-
114
- closed true
115
- }
121
+ polybezier(0, 0, 200, 100, 100, 200, 400, 100, 300, 100, 100, 300, 100, 400, 100, 300, 300, 100, 400, 400)
116
122
 
117
123
  fill r: 202, g: 102, b: 204, a: 0.5
118
124
  stroke r: 0, g: 0, b: 0, thickness: 2, dashes: [50, 10, 10, 10], dash_phase: -50.0
119
125
  }
120
126
  path { # declarative stable path
121
- arc(400, 220, 180, 90, 90, false)
127
+ polyline(100, 100, 400, 100, 100, 400, 400, 400, 0, 0)
128
+
129
+ stroke r: 0, g: 0, b: 0, thickness: 2
130
+ }
131
+ path { # declarative stable path
132
+ arc(404, 216, 190, 90, 90, false)
122
133
 
123
134
  # radial gradient (has an outer_radius in addition to x0, y0, x1, y1, and stops)
124
135
  fill outer_radius: 90, x0: 0, y0: 0, x1: 500, y1: 500, stops: [{pos: 0.25, r: 102, g: 102, b: 204, a: 0.5}, {pos: 0.75, r: 204, g: 102, b: 204}]
@@ -130,9 +141,9 @@ window('Area Gallery', 400, 400) {
130
141
  fill r: 202, g: 102, b: 204, a: 0.5
131
142
  stroke r: 0, g: 0, b: 0, thickness: 2
132
143
  }
133
- text(160, 40, 100) { # x, y, width
144
+ text(161, 40, 100) { # x, y, width
134
145
  string('Area Gallery') {
135
- font family: 'Times', size: 14
146
+ font family: 'Arial', size: 14
136
147
  color :black
137
148
  }
138
149
  }
@@ -188,7 +199,16 @@ window('Area Gallery', 400, 400) {
188
199
  }.show
189
200
  ```
190
201
 
202
+ Mac
203
+
191
204
  ![glimmer-dsl-libui-mac-area-gallery.png](images/glimmer-dsl-libui-mac-area-gallery.png)
205
+
206
+ Windows
207
+
208
+ ![glimmer-dsl-libui-windows-area-gallery.png](images/glimmer-dsl-libui-windows-area-gallery.png)
209
+
210
+ Linux
211
+
192
212
  ![glimmer-dsl-libui-linux-area-gallery.png](images/glimmer-dsl-libui-linux-area-gallery.png)
193
213
 
194
214
  [Check Out Many More Examples Over Here!](#examples)
@@ -257,16 +277,19 @@ Other [Glimmer](https://rubygems.org/gems/glimmer) DSL gems you might be interes
257
277
  - [Basic Draw Text](#basic-draw-text)
258
278
  - [Custom Draw Text](#custom-draw-text)
259
279
  - [Method-Based Custom Keyword](#method-based-custom-keyword)
280
+ - [Tetris](#tetris)
260
281
  - [Applications](#applications)
261
282
  - [Manga2PDF](#manga2pdf)
262
283
  - [Befunge98 GUI](#befunge98-gui)
263
- - [Contributing to glimmer-dsl-libui](#contributing-to-glimmer-dsl-libui)
284
+ - [i3off Gtk Ruby](#i3off-gtk-ruby)
285
+ - [Process](#process)
286
+ - [Resources](#resources)
264
287
  - [Help](#help)
265
288
  - [Issues](#issues)
266
289
  - [Chat](#chat)
267
- - [Process](#process)
268
290
  - [Planned Features and Feature Suggestions](#planned-features-and-feature-suggestions)
269
291
  - [Change Log](#change-log)
292
+ - [Contributing](#contributing)
270
293
  - [Contributors](#contributors)
271
294
  - [License](#license)
272
295
 
@@ -347,7 +370,7 @@ gem install glimmer-dsl-libui
347
370
  Or install via Bundler `Gemfile`:
348
371
 
349
372
  ```ruby
350
- gem 'glimmer-dsl-libui', '~> 0.2.14'
373
+ gem 'glimmer-dsl-libui', '~> 0.2.18'
351
374
  ```
352
375
 
353
376
  Add `require 'glimmer-dsl-libui'` at the top, and then `include Glimmer` into the top-level main object for testing or into an actual class for serious usage.
@@ -464,6 +487,9 @@ Keyword(Args) | Properties | Listeners
464
487
  `non_wrapping_multiline_entry` | `read_only` (Boolean), `text` (`String`) | `on_changed`
465
488
  `password_entry` | `read_only` (Boolean), `text` (`String`) | `on_changed`
466
489
  `path(draw_fill_mode = :winding)` | `fill` (`Hash` of `:r` as `0`-`255`, `:g` as `0`-`255`, `:b` as `0`-`255`, `:a` as `0.0`-`1.0`, hex, or [X11](https://en.wikipedia.org/wiki/X11_color_names) color), `stroke` (`Hash` of `:r` as `0`-`255`, `:g` as `0`-`255`, `:b` as `0`-`255`, `:a` as `0.0`-`1.0`, hex, or [X11](https://en.wikipedia.org/wiki/X11_color_names) color), `:cap` as (`:round`, `:square`, `:flat`), `:join` as (`:miter`, `:round`, `:bevel`), `:thickness` as `Numeric`, `:miter_limit` as `Numeric`, `:dashes` as `Array` of `Numeric` ) | None
490
+ `polygon(point_array as Array of Arrays of Numeric or Array of Numeric)` | `point_array` (`Array of Arrays of Numeric or Array of Numeric`) | None
491
+ `polyline(point_array as Array of Arrays of Numeric or Array of Numeric)` | `point_array` (`Array of Arrays of Numeric or Array of Numeric`) | None
492
+ `polybezier(point_array as Array of Arrays of Numeric or Array of Numeric)` | `point_array` (`Array of Arrays of Numeric or Array of Numeric`) | None
467
493
  `preferences_menu_item` | None | `on_clicked`
468
494
  `progress_bar` | `value` (`Numeric`) | None
469
495
  `progress_bar_column(name as String)` | None | None
@@ -715,6 +741,9 @@ Available nested `path` shapes:
715
741
  - `arc(x_center as Numeric, y_center as Numeric, radius as Numeric, start_angle as Numeric, sweep as Numeric, is_negative as Boolean)`
716
742
  - `line(x as Numeric, y as Numeric)`
717
743
  - `bezier(c1_x as Numeric, c1_y as Numeric, c2_x as Numeric, c2_y as Numeric, end_x as Numeric, end_y as Numeric)`
744
+ - `polygon(point_array as Array of Arrays of Numeric or Array of Numeric)`: closed figure of lines; can receive points as [[x1, y1], [x2, y2], ...] or [x1, y1, x2, y2, ...]
745
+ - `polyline(point_array as Array of Arrays of Numeric or Array of Numeric)`: open figure of lines; can receive points as [[x1, y1], [x2, y2], ...] or [x1, y1, x2, y2, ...]
746
+ - `polybezier(point_array as Array of Arrays of Numeric or Array of Numeric)`: open figure of beziers; can receive points as [[start_x1, start_y1], [c1_x2, c1_y2, c2_x2, c2_y2, end_x2, end_y2], [c1_x3, c1_y3, c2_x3, c2_y3, end_x3, end_y3], ...] or [start_x1, start_y1, c1_x2, c1_y2, c2_x2, c2_y2, end_x2, end_y2, c1_x3, c1_y3, c2_x3, c2_y3, end_x3, end_y3, ...]
718
747
  - `figure(x=nil as Numeric, y=nil as Numeric)` (composite that can contain other shapes) (can set `closed true` to connect last point to first point automatically)
719
748
 
720
749
  Check [examples/area_gallery.rb](#area-gallery) for an overiew of all `path` shapes.
@@ -769,6 +798,12 @@ Note that when nesting an `area` directly underneath `window` (without a layout
769
798
 
770
799
  To redraw an `area`, you may call the `#queue_redraw_all` method, or simply `#redraw`.
771
800
 
801
+ `area` has the following Glimmer-added API methods/attributes:
802
+ - `request_auto_redraw`: requests auto redraw upon changes to nested stable `path` or shapes
803
+ - `pause_auto_redraw`: pause auto redraw upon changes to nested stable `path` or shapes (useful to avoid too many micro-change redraws, to group all redraws as one after many micro-changes)
804
+ - `resume_auto_redraw`: resume auto redraw upon changes to nested stable `path` or shapes
805
+ - `auto_redraw_enabled`/`auto_redraw_enabled?`/`auto_redraw_enabled=`: an attribute to disable/enable auto redraw on an `area` upon changes to nested stable `path` or shapes
806
+
772
807
  A transform `matrix` can be set on a path by building a `matrix(m11 = nil, m12 = nil, m21 = nil, m22 = nil, m31 = nil, m32 = nil) {operations}` proxy object and then setting via `transform` property, or alternatively by building and setting the matrix in one call to `transform(m11 = nil, m12 = nil, m21 = nil, m22 = nil, m31 = nil, m32 = nil) {operations}` passing it the matrix arguments and/or content operations.
773
808
 
774
809
  When instantiating a `matrix` object, it always starts with identity matrix.
@@ -1044,10 +1079,10 @@ window('Method-Based Custom Keyword') {
1044
1079
  - `table` `checkbox_column` and `checkbox_text_column` checkbox editing only works on Linux and Windows (not Mac) due to a current limitation in [libui](https://github.com/andlabs/ui/issues/357).
1045
1080
  - `text` `align` property seems not to work on the Mac ([libui](https://github.com/andlabs/libui) has an [issue](https://github.com/andlabs/libui/pull/407) about it)
1046
1081
  - `text` `string` `background` does not work on Windows due to an [issue in libui](https://github.com/andlabs/libui/issues/347).
1047
- - `arc` shape does not work on Windows unless a figure is started due to implementation of [libui](https://github.com/andlabs/libui).
1048
1082
  - `table` controls on Windows intentionally get an extra empty row at the end because if any row were to be deleted for the first time, double-deletion happens due to an issue in [libui](https://github.com/andlabs/libui) on Windows.
1049
1083
  - `table` `progress_bar` column on Windows cannot be updated with a positive value if it started initially with `-1` (it ignores update to avoid crashing due to an issue in [libui](https://github.com/andlabs/libui) on Windows.
1050
1084
  - It seems that [libui](https://github.com/andlabs/libui) does not support nesting multiple `area` controls under a `grid` as only the first one shows up in that scenario. To workaround that limitation, use a `vertical_box` with nested `horizontal_box`s instead to include multiple `area`s in a GUI.
1085
+ - As per the code of [examples/basic_transform.rb](#basic-transform), Windows requires different ordering of transforms than Mac and Linux.
1051
1086
 
1052
1087
  ### Original API
1053
1088
 
@@ -1099,6 +1134,10 @@ Mac
1099
1134
 
1100
1135
  ![glimmer-dsl-libui-mac-meta-example.png](images/glimmer-dsl-libui-mac-meta-example.png)
1101
1136
 
1137
+ Windows
1138
+
1139
+ ![glimmer-dsl-libui-windows-meta-example.png](images/glimmer-dsl-libui-windows-meta-example.png)
1140
+
1102
1141
  Linux
1103
1142
 
1104
1143
  ![glimmer-dsl-libui-linux-meta-example.png](images/glimmer-dsl-libui-linux-meta-example.png)
@@ -1149,15 +1188,20 @@ class MetaExample
1149
1188
  end
1150
1189
 
1151
1190
  def run_example(example)
1152
- command = "ruby -r #{glimmer_dsl_libui_file} #{example} 2>&1"
1153
- result = ''
1154
- IO.popen(command) do |f|
1155
- f.each_line do |line|
1156
- result << line
1157
- puts line
1191
+ Thread.new do
1192
+ command = "ruby -r #{glimmer_dsl_libui_file} #{example} 2>&1"
1193
+ result = ''
1194
+ IO.popen(command) do |f|
1195
+ sleep(0.0001) # yield to main thread
1196
+ f.each_line do |line|
1197
+ result << line
1198
+ puts line
1199
+ $stdout.flush # for Windows
1200
+ sleep(0.0001) # yield to main thread
1201
+ end
1158
1202
  end
1203
+ Glimmer::LibUI.queue_main { msg_box('Error Running Example', result) } if result.downcase.include?('error')
1159
1204
  end
1160
- msg_box('Error Running Example', result) if result.downcase.include?('error')
1161
1205
  end
1162
1206
 
1163
1207
  def launch
@@ -1258,6 +1302,10 @@ Mac
1258
1302
 
1259
1303
  ![glimmer-dsl-libui-mac-basic-window.png](images/glimmer-dsl-libui-mac-basic-window.png)
1260
1304
 
1305
+ Windows
1306
+
1307
+ ![glimmer-dsl-libui-windows-basic-window.png](images/glimmer-dsl-libui-windows-basic-window.png)
1308
+
1261
1309
  Linux
1262
1310
 
1263
1311
  ![glimmer-dsl-libui-linux-basic-window.png](images/glimmer-dsl-libui-linux-basic-window.png)
@@ -1338,6 +1386,11 @@ Mac
1338
1386
  ![glimmer-dsl-libui-mac-basic-button.png](images/glimmer-dsl-libui-mac-basic-button.png)
1339
1387
  ![glimmer-dsl-libui-mac-basic-button-msg-box.png](images/glimmer-dsl-libui-mac-basic-button-msg-box.png)
1340
1388
 
1389
+ Windows
1390
+
1391
+ ![glimmer-dsl-libui-windows-basic-button.png](images/glimmer-dsl-libui-windows-basic-button.png)
1392
+ ![glimmer-dsl-libui-windows-basic-button-msg-box.png](images/glimmer-dsl-libui-windows-basic-button-msg-box.png)
1393
+
1341
1394
  Linux
1342
1395
 
1343
1396
  ![glimmer-dsl-libui-linux-basic-button.png](images/glimmer-dsl-libui-linux-basic-button.png)
@@ -1415,6 +1468,11 @@ Mac
1415
1468
  ![glimmer-dsl-libui-mac-basic-entry.png](images/glimmer-dsl-libui-mac-basic-entry.png)
1416
1469
  ![glimmer-dsl-libui-mac-basic-entry-msg-box.png](images/glimmer-dsl-libui-mac-basic-entry-msg-box.png)
1417
1470
 
1471
+ Windows
1472
+
1473
+ ![glimmer-dsl-libui-windows-basic-entry.png](images/glimmer-dsl-libui-windows-basic-entry.png)
1474
+ ![glimmer-dsl-libui-windows-basic-entry-msg-box.png](images/glimmer-dsl-libui-windows-basic-entry-msg-box.png)
1475
+
1418
1476
  Linux
1419
1477
 
1420
1478
  ![glimmer-dsl-libui-linux-basic-entry.png](images/glimmer-dsl-libui-linux-basic-entry.png)
@@ -1515,6 +1573,10 @@ Mac
1515
1573
 
1516
1574
  ![glimmer-dsl-libui-mac-simple-notepad.png](images/glimmer-dsl-libui-mac-simple-notepad.png)
1517
1575
 
1576
+ Windows
1577
+
1578
+ ![glimmer-dsl-libui-windows-simple-notepad.png](images/glimmer-dsl-libui-windows-simple-notepad.png)
1579
+
1518
1580
  Linux
1519
1581
 
1520
1582
  ![glimmer-dsl-libui-linux-simple-notepad.png](images/glimmer-dsl-libui-linux-simple-notepad.png)
@@ -1588,6 +1650,11 @@ Mac
1588
1650
  ![glimmer-dsl-libui-mac-midi-player.png](images/glimmer-dsl-libui-mac-midi-player.png)
1589
1651
  ![glimmer-dsl-libui-mac-midi-player-msg-box.png](images/glimmer-dsl-libui-mac-midi-player-msg-box.png)
1590
1652
 
1653
+ Windows
1654
+
1655
+ ![glimmer-dsl-libui-windows-midi-player.png](images/glimmer-dsl-libui-windows-midi-player.png)
1656
+ ![glimmer-dsl-libui-windows-midi-player-msg-box.png](images/glimmer-dsl-libui-windows-midi-player-msg-box.png)
1657
+
1591
1658
  Linux
1592
1659
 
1593
1660
  ![glimmer-dsl-libui-linux-midi-player.png](images/glimmer-dsl-libui-linux-midi-player.png)
@@ -1805,6 +1872,10 @@ Mac
1805
1872
 
1806
1873
  ![glimmer-dsl-libui-mac-control-gallery.png](images/glimmer-dsl-libui-mac-control-gallery.png)
1807
1874
 
1875
+ Windows
1876
+
1877
+ ![glimmer-dsl-libui-windows-control-gallery.png](images/glimmer-dsl-libui-windows-control-gallery.png)
1878
+
1808
1879
  Linux
1809
1880
 
1810
1881
  ![glimmer-dsl-libui-linux-control-gallery.png](images/glimmer-dsl-libui-linux-control-gallery.png)
@@ -2196,6 +2267,11 @@ Mac
2196
2267
  ![glimmer-dsl-libui-mac-font-button.png](images/glimmer-dsl-libui-mac-font-button.png)
2197
2268
  ![glimmer-dsl-libui-mac-font-button-selection.png](images/glimmer-dsl-libui-mac-font-button-selection.png)
2198
2269
 
2270
+ Windows
2271
+
2272
+ ![glimmer-dsl-libui-windows-font-button.png](images/glimmer-dsl-libui-windows-font-button.png)
2273
+ ![glimmer-dsl-libui-windows-font-button-selection.png](images/glimmer-dsl-libui-windows-font-button-selection.png)
2274
+
2199
2275
  Linux
2200
2276
 
2201
2277
  ![glimmer-dsl-libui-linux-font-button.png](images/glimmer-dsl-libui-linux-font-button.png)
@@ -2280,6 +2356,11 @@ Mac
2280
2356
  ![glimmer-dsl-libui-mac-color-button.png](images/glimmer-dsl-libui-mac-color-button.png)
2281
2357
  ![glimmer-dsl-libui-mac-color-button-selection.png](images/glimmer-dsl-libui-mac-color-button-selection.png)
2282
2358
 
2359
+ Windows
2360
+
2361
+ ![glimmer-dsl-libui-windows-color-button.png](images/glimmer-dsl-libui-windows-color-button.png)
2362
+ ![glimmer-dsl-libui-windows-color-button-selection.png](images/glimmer-dsl-libui-windows-color-button-selection.png)
2363
+
2283
2364
  Linux
2284
2365
 
2285
2366
  ![glimmer-dsl-libui-linux-color-button.png](images/glimmer-dsl-libui-linux-color-button.png)
@@ -2292,7 +2373,7 @@ require 'glimmer-dsl-libui'
2292
2373
 
2293
2374
  include Glimmer
2294
2375
 
2295
- window('color button', 230) {
2376
+ window('color button', 240) {
2296
2377
  color_button { |cb|
2297
2378
  color :blue
2298
2379
 
@@ -2324,6 +2405,10 @@ Mac
2324
2405
 
2325
2406
  ![glimmer-dsl-libui-mac-date-time-picker.png](images/glimmer-dsl-libui-mac-date-time-picker.png)
2326
2407
 
2408
+ Windows
2409
+
2410
+ ![glimmer-dsl-libui-windows-date-time-picker.png](images/glimmer-dsl-libui-windows-date-time-picker.png)
2411
+
2327
2412
  Linux
2328
2413
 
2329
2414
  ![glimmer-dsl-libui-linux-date-time-picker.png](images/glimmer-dsl-libui-linux-date-time-picker.png)
@@ -2416,6 +2501,12 @@ Mac
2416
2501
  ![glimmer-dsl-libui-mac-grid-expand.png](images/glimmer-dsl-libui-mac-grid-expand.png)
2417
2502
  ![glimmer-dsl-libui-mac-grid-align.png](images/glimmer-dsl-libui-mac-grid-align.png)
2418
2503
 
2504
+ Windows
2505
+
2506
+ ![glimmer-dsl-libui-windows-grid-span.png](images/glimmer-dsl-libui-windows-grid-span.png)
2507
+ ![glimmer-dsl-libui-windows-grid-expand.png](images/glimmer-dsl-libui-windows-grid-expand.png)
2508
+ ![glimmer-dsl-libui-windows-grid-align.png](images/glimmer-dsl-libui-windows-grid-align.png)
2509
+
2419
2510
  Linux
2420
2511
 
2421
2512
  ![glimmer-dsl-libui-linux-grid-span.png](images/glimmer-dsl-libui-linux-grid-span.png)
@@ -2554,6 +2645,11 @@ Mac
2554
2645
  ![glimmer-dsl-libui-mac-form.png](images/glimmer-dsl-libui-mac-form.png)
2555
2646
  ![glimmer-dsl-libui-mac-form-msg-box.png](images/glimmer-dsl-libui-mac-form-msg-box.png)
2556
2647
 
2648
+ Windows
2649
+
2650
+ ![glimmer-dsl-libui-windows-form.png](images/glimmer-dsl-libui-windows-form.png)
2651
+ ![glimmer-dsl-libui-windows-form-msg-box.png](images/glimmer-dsl-libui-windows-form-msg-box.png)
2652
+
2557
2653
  Linux
2558
2654
 
2559
2655
  ![glimmer-dsl-libui-linux-form.png](images/glimmer-dsl-libui-linux-form.png)
@@ -2619,6 +2715,10 @@ Mac
2619
2715
 
2620
2716
  ![glimmer-dsl-libui-mac-basic-table.png](images/glimmer-dsl-libui-mac-basic-table.png)
2621
2717
 
2718
+ Windows
2719
+
2720
+ ![glimmer-dsl-libui-windows-basic-table.png](images/glimmer-dsl-libui-windows-basic-table.png)
2721
+
2622
2722
  Linux
2623
2723
 
2624
2724
  ![glimmer-dsl-libui-linux-basic-table.png](images/glimmer-dsl-libui-linux-basic-table.png)
@@ -2741,6 +2841,12 @@ Mac
2741
2841
  ![glimmer-dsl-libui-mac-editable-table-editing.png](images/glimmer-dsl-libui-mac-editable-table-editing.png)
2742
2842
  ![glimmer-dsl-libui-mac-editable-table-edited.png](images/glimmer-dsl-libui-mac-editable-table-edited.png)
2743
2843
 
2844
+ Windows
2845
+
2846
+ ![glimmer-dsl-libui-windows-editable-table.png](images/glimmer-dsl-libui-windows-editable-table.png)
2847
+ ![glimmer-dsl-libui-windows-editable-table-editing.png](images/glimmer-dsl-libui-windows-editable-table-editing.png)
2848
+ ![glimmer-dsl-libui-windows-editable-table-edited.png](images/glimmer-dsl-libui-windows-editable-table-edited.png)
2849
+
2744
2850
  Linux
2745
2851
 
2746
2852
  ![glimmer-dsl-libui-linux-editable-table.png](images/glimmer-dsl-libui-linux-editable-table.png)
@@ -2808,6 +2914,11 @@ Mac
2808
2914
  ![glimmer-dsl-libui-mac-editable-column-table-editing.png](images/glimmer-dsl-libui-mac-editable-column-table-editing.png)
2809
2915
  ![glimmer-dsl-libui-mac-editable-column-table-edited.png](images/glimmer-dsl-libui-mac-editable-column-table-edited.png)
2810
2916
 
2917
+ Windows
2918
+
2919
+ ![glimmer-dsl-libui-windows-editable-column-table-editing.png](images/glimmer-dsl-libui-windows-editable-column-table-editing.png)
2920
+ ![glimmer-dsl-libui-windows-editable-column-table-edited.png](images/glimmer-dsl-libui-windows-editable-column-table-edited.png)
2921
+
2811
2922
  Linux
2812
2923
 
2813
2924
  ![glimmer-dsl-libui-linux-editable-column-table-editing.png](images/glimmer-dsl-libui-linux-editable-column-table-editing.png)
@@ -2875,6 +2986,10 @@ Mac
2875
2986
 
2876
2987
  ![glimmer-dsl-libui-mac-basic-table-image.png](images/glimmer-dsl-libui-mac-basic-table-image.png)
2877
2988
 
2989
+ Windows
2990
+
2991
+ ![glimmer-dsl-libui-windows-basic-table-image.png](images/glimmer-dsl-libui-windows-basic-table-image.png)
2992
+
2878
2993
  Linux
2879
2994
 
2880
2995
  ![glimmer-dsl-libui-linux-basic-table-image.png](images/glimmer-dsl-libui-linux-basic-table-image.png)
@@ -3033,6 +3148,10 @@ Mac
3033
3148
 
3034
3149
  ![glimmer-dsl-libui-mac-basic-table-image-text.png](images/glimmer-dsl-libui-mac-basic-table-image-text.png)
3035
3150
 
3151
+ Windows
3152
+
3153
+ ![glimmer-dsl-libui-windows-basic-table-image-text.png](images/glimmer-dsl-libui-windows-basic-table-image-text.png)
3154
+
3036
3155
  Linux
3037
3156
 
3038
3157
  ![glimmer-dsl-libui-linux-basic-table-image-text.png](images/glimmer-dsl-libui-linux-basic-table-image-text.png)
@@ -3104,6 +3223,11 @@ Mac
3104
3223
  ![glimmer-dsl-libui-mac-basic-table-button.png](images/glimmer-dsl-libui-mac-basic-table-button.png)
3105
3224
  ![glimmer-dsl-libui-mac-basic-table-button-deleted.png](images/glimmer-dsl-libui-mac-basic-table-button-deleted.png)
3106
3225
 
3226
+ Windows
3227
+
3228
+ ![glimmer-dsl-libui-windows-basic-table-button.png](images/glimmer-dsl-libui-windows-basic-table-button.png)
3229
+ ![glimmer-dsl-libui-windows-basic-table-button-deleted.png](images/glimmer-dsl-libui-windows-basic-table-button-deleted.png)
3230
+
3107
3231
  Linux
3108
3232
 
3109
3233
  ![glimmer-dsl-libui-linux-basic-table-button.png](images/glimmer-dsl-libui-linux-basic-table-button.png)
@@ -3165,6 +3289,10 @@ Mac
3165
3289
 
3166
3290
  ![glimmer-dsl-libui-mac-basic-table-checkbox.png](images/glimmer-dsl-libui-mac-basic-table-checkbox.png)
3167
3291
 
3292
+ Windows
3293
+
3294
+ ![glimmer-dsl-libui-windows-basic-table-checkbox.png](images/glimmer-dsl-libui-windows-basic-table-checkbox.png)
3295
+
3168
3296
  Linux
3169
3297
 
3170
3298
  ![glimmer-dsl-libui-linux-basic-table-checkbox.png](images/glimmer-dsl-libui-linux-basic-table-checkbox.png)
@@ -3217,6 +3345,10 @@ Mac
3217
3345
 
3218
3346
  ![glimmer-dsl-libui-mac-basic-table-checkbox-text.png](images/glimmer-dsl-libui-mac-basic-table-checkbox-text.png)
3219
3347
 
3348
+ Windows
3349
+
3350
+ ![glimmer-dsl-libui-windows-basic-table-checkbox-text.png](images/glimmer-dsl-libui-windows-basic-table-checkbox-text.png)
3351
+
3220
3352
  Linux
3221
3353
 
3222
3354
  ![glimmer-dsl-libui-linux-basic-table-checkbox-text.png](images/glimmer-dsl-libui-linux-basic-table-checkbox-text.png)
@@ -3269,6 +3401,10 @@ Mac
3269
3401
 
3270
3402
  ![glimmer-dsl-libui-mac-basic-table-progress-bar.png](images/glimmer-dsl-libui-mac-basic-table-progress-bar.png)
3271
3403
 
3404
+ Windows
3405
+
3406
+ ![glimmer-dsl-libui-windows-basic-table-progress-bar.png](images/glimmer-dsl-libui-windows-basic-table-progress-bar.png)
3407
+
3272
3408
  Linux
3273
3409
 
3274
3410
  ![glimmer-dsl-libui-linux-basic-table-progress-bar.png](images/glimmer-dsl-libui-linux-basic-table-progress-bar.png)
@@ -3336,6 +3472,10 @@ Mac
3336
3472
 
3337
3473
  ![glimmer-dsl-libui-mac-basic-table-color.png](images/glimmer-dsl-libui-mac-basic-table-color.png)
3338
3474
 
3475
+ Windows
3476
+
3477
+ ![glimmer-dsl-libui-windows-basic-table-color.png](images/glimmer-dsl-libui-windows-basic-table-color.png)
3478
+
3339
3479
  Linux
3340
3480
 
3341
3481
  ![glimmer-dsl-libui-linux-basic-table-color.png](images/glimmer-dsl-libui-linux-basic-table-color.png)
@@ -3404,6 +3544,12 @@ Mac
3404
3544
  ![glimmer-dsl-libui-mac-form-table-contact-entered.png](images/glimmer-dsl-libui-mac-form-table-contact-entered.png)
3405
3545
  ![glimmer-dsl-libui-mac-form-table-filtered.png](images/glimmer-dsl-libui-mac-form-table-filtered.png)
3406
3546
 
3547
+ Windows
3548
+
3549
+ ![glimmer-dsl-libui-windows-form-table.png](images/glimmer-dsl-libui-windows-form-table.png)
3550
+ ![glimmer-dsl-libui-windows-form-table-contact-entered.png](images/glimmer-dsl-libui-windows-form-table-contact-entered.png)
3551
+ ![glimmer-dsl-libui-windows-form-table-filtered.png](images/glimmer-dsl-libui-windows-form-table-filtered.png)
3552
+
3407
3553
  Linux
3408
3554
 
3409
3555
  ![glimmer-dsl-libui-linux-form-table.png](images/glimmer-dsl-libui-linux-form-table.png)
@@ -3524,6 +3670,10 @@ Mac
3524
3670
 
3525
3671
  ![glimmer-dsl-libui-mac-basic-area.png](images/glimmer-dsl-libui-mac-basic-area.png)
3526
3672
 
3673
+ Windows
3674
+
3675
+ ![glimmer-dsl-libui-windows-basic-area.png](images/glimmer-dsl-libui-windows-basic-area.png)
3676
+
3527
3677
  Linux
3528
3678
 
3529
3679
  ![glimmer-dsl-libui-linux-basic-area.png](images/glimmer-dsl-libui-linux-basic-area.png)
@@ -3647,6 +3797,11 @@ Mac
3647
3797
  ![glimmer-dsl-libui-mac-dynamic-area.png](images/glimmer-dsl-libui-mac-dynamic-area.png)
3648
3798
  ![glimmer-dsl-libui-mac-dynamic-area-updated.png](images/glimmer-dsl-libui-mac-dynamic-area-updated.png)
3649
3799
 
3800
+ Windows
3801
+
3802
+ ![glimmer-dsl-libui-windows-dynamic-area.png](images/glimmer-dsl-libui-windows-dynamic-area.png)
3803
+ ![glimmer-dsl-libui-windows-dynamic-area-updated.png](images/glimmer-dsl-libui-windows-dynamic-area-updated.png)
3804
+
3650
3805
  Linux
3651
3806
 
3652
3807
  ![glimmer-dsl-libui-linux-dynamic-area.png](images/glimmer-dsl-libui-linux-dynamic-area.png)
@@ -3878,6 +4033,10 @@ Mac
3878
4033
 
3879
4034
  ![glimmer-dsl-libui-mac-area-gallery.png](images/glimmer-dsl-libui-mac-area-gallery.png)
3880
4035
 
4036
+ Windows
4037
+
4038
+ ![glimmer-dsl-libui-windows-area-gallery.png](images/glimmer-dsl-libui-windows-area-gallery.png)
4039
+
3881
4040
  Linux
3882
4041
 
3883
4042
  ![glimmer-dsl-libui-linux-area-gallery.png](images/glimmer-dsl-libui-linux-area-gallery.png)
@@ -3905,31 +4064,24 @@ window('Area Gallery', 400, 400) {
3905
4064
  fill x0: 10, y0: 10, x1: 350, y1: 350, stops: [{pos: 0.25, r: 204, g: 102, b: 204}, {pos: 0.75, r: 102, g: 102, b: 204}]
3906
4065
  }
3907
4066
  path { # declarative stable path
3908
- figure(100, 100) {
3909
- line(100, 400)
3910
- line(400, 100)
3911
- line(400, 400)
3912
-
3913
- closed true
3914
- }
3915
-
4067
+ polygon(100, 100, 100, 400, 400, 100, 400, 400)
4068
+
3916
4069
  fill r: 202, g: 102, b: 104, a: 0.5
3917
4070
  stroke r: 0, g: 0, b: 0
3918
4071
  }
3919
4072
  path { # declarative stable path
3920
- figure(0, 0) {
3921
- bezier(200, 100, 100, 200, 400, 100)
3922
- bezier(300, 100, 100, 300, 100, 400)
3923
- bezier(100, 300, 300, 100, 400, 400)
3924
-
3925
- closed true
3926
- }
4073
+ polybezier(0, 0, 200, 100, 100, 200, 400, 100, 300, 100, 100, 300, 100, 400, 100, 300, 300, 100, 400, 400)
3927
4074
 
3928
4075
  fill r: 202, g: 102, b: 204, a: 0.5
3929
4076
  stroke r: 0, g: 0, b: 0, thickness: 2, dashes: [50, 10, 10, 10], dash_phase: -50.0
3930
4077
  }
3931
4078
  path { # declarative stable path
3932
- arc(400, 220, 180, 90, 90, false)
4079
+ polyline(100, 100, 400, 100, 100, 400, 400, 400, 0, 0)
4080
+
4081
+ stroke r: 0, g: 0, b: 0, thickness: 2
4082
+ }
4083
+ path { # declarative stable path
4084
+ arc(404, 216, 190, 90, 90, false)
3933
4085
 
3934
4086
  # radial gradient (has an outer_radius in addition to x0, y0, x1, y1, and stops)
3935
4087
  fill outer_radius: 90, x0: 0, y0: 0, x1: 500, y1: 500, stops: [{pos: 0.25, r: 102, g: 102, b: 204, a: 0.5}, {pos: 0.75, r: 204, g: 102, b: 204}]
@@ -3941,9 +4093,9 @@ window('Area Gallery', 400, 400) {
3941
4093
  fill r: 202, g: 102, b: 204, a: 0.5
3942
4094
  stroke r: 0, g: 0, b: 0, thickness: 2
3943
4095
  }
3944
- text(160, 40, 100) { # x, y, width
4096
+ text(161, 40, 100) { # x, y, width
3945
4097
  string('Area Gallery') {
3946
- font family: 'Times', size: 14
4098
+ font family: 'Arial', size: 14
3947
4099
  color :black
3948
4100
  }
3949
4101
  }
@@ -4092,18 +4244,42 @@ window('Area Gallery', 400, 400) {
4092
4244
  end_x 400
4093
4245
  end_y 400
4094
4246
  }
4095
-
4096
- closed true
4097
4247
  }
4098
4248
 
4099
4249
  fill r: 202, g: 102, b: 204, a: 0.5
4100
4250
  stroke r: 0, g: 0, b: 0, thickness: 2, dashes: [50, 10, 10, 10], dash_phase: -50.0
4101
4251
  }
4252
+ path { # declarative stable path
4253
+ polyline(100, 100, 400, 100, 100, 400, 400, 400, 0, 0)
4254
+ figure {
4255
+ x 100
4256
+ y 100
4257
+
4258
+ line {
4259
+ x 400
4260
+ y 100
4261
+ }
4262
+ line {
4263
+ x 100
4264
+ y 400
4265
+ }
4266
+ line {
4267
+ x 400
4268
+ y 400
4269
+ }
4270
+ line {
4271
+ x 0
4272
+ y 0
4273
+ }
4274
+ }
4275
+
4276
+ stroke r: 0, g: 0, b: 0, thickness: 2
4277
+ }
4102
4278
  path { # declarative stable path
4103
4279
  arc {
4104
- x_center 400
4105
- y_center 220
4106
- radius 180
4280
+ x_center 404
4281
+ y_center 216
4282
+ radius 190
4107
4283
  start_angle 90
4108
4284
  sweep 90
4109
4285
  is_negative false
@@ -4124,12 +4300,12 @@ window('Area Gallery', 400, 400) {
4124
4300
  stroke r: 0, g: 0, b: 0, thickness: 2
4125
4301
  }
4126
4302
  text {
4127
- x 160
4303
+ x 161
4128
4304
  y 40
4129
4305
  width 100
4130
4306
 
4131
4307
  string {
4132
- font family: 'Times', size: 14
4308
+ font family: 'Arial', size: 14
4133
4309
  color :black
4134
4310
 
4135
4311
  'Area Gallery'
@@ -4200,42 +4376,35 @@ window('Area Gallery', 400, 400) {
4200
4376
  path { # a dynamic path is added semi-declaratively inside on_draw block
4201
4377
  square(0, 0, 100)
4202
4378
  square(100, 100, 400)
4203
-
4379
+
4204
4380
  fill r: 102, g: 102, b: 204
4205
4381
  }
4206
4382
  path { # a dynamic path is added semi-declaratively inside on_draw block
4207
4383
  rectangle(0, 100, 100, 400)
4208
4384
  rectangle(100, 0, 400, 100)
4209
-
4385
+
4210
4386
  # linear gradient (has x0, y0, x1, y1, and stops)
4211
4387
  fill x0: 10, y0: 10, x1: 350, y1: 350, stops: [{pos: 0.25, r: 204, g: 102, b: 204}, {pos: 0.75, r: 102, g: 102, b: 204}]
4212
4388
  }
4213
4389
  path { # a dynamic path is added semi-declaratively inside on_draw block
4214
- figure(100, 100) {
4215
- line(100, 400)
4216
- line(400, 100)
4217
- line(400, 400)
4218
-
4219
- closed true
4220
- }
4221
-
4390
+ polygon(100, 100, 100, 400, 400, 100, 400, 400)
4391
+
4222
4392
  fill r: 202, g: 102, b: 104, a: 0.5
4223
4393
  stroke r: 0, g: 0, b: 0
4224
4394
  }
4225
4395
  path { # a dynamic path is added semi-declaratively inside on_draw block
4226
- figure(0, 0) {
4227
- bezier(200, 100, 100, 200, 400, 100)
4228
- bezier(300, 100, 100, 300, 100, 400)
4229
- bezier(100, 300, 300, 100, 400, 400)
4230
-
4231
- closed true
4232
- }
4233
-
4396
+ polybezier(0, 0, 200, 100, 100, 200, 400, 100, 300, 100, 100, 300, 100, 400, 100, 300, 300, 100, 400, 400)
4397
+
4234
4398
  fill r: 202, g: 102, b: 204, a: 0.5
4235
4399
  stroke r: 0, g: 0, b: 0, thickness: 2, dashes: [50, 10, 10, 10], dash_phase: -50.0
4236
4400
  }
4237
4401
  path { # a dynamic path is added semi-declaratively inside on_draw block
4238
- arc(400, 220, 180, 90, 90, false)
4402
+ polyline(100, 100, 400, 100, 100, 400, 400, 400, 0, 0)
4403
+
4404
+ stroke r: 0, g: 0, b: 0, thickness: 2
4405
+ }
4406
+ path { # a dynamic path is added semi-declaratively inside on_draw block
4407
+ arc(404, 216, 190, 90, 90, false)
4239
4408
 
4240
4409
  # radial gradient (has an outer_radius in addition to x0, y0, x1, y1, and stops)
4241
4410
  fill outer_radius: 90, x0: 0, y0: 0, x1: 500, y1: 500, stops: [{pos: 0.25, r: 102, g: 102, b: 204, a: 0.5}, {pos: 0.75, r: 204, g: 102, b: 204}]
@@ -4247,9 +4416,9 @@ window('Area Gallery', 400, 400) {
4247
4416
  fill r: 202, g: 102, b: 204, a: 0.5
4248
4417
  stroke r: 0, g: 0, b: 0, thickness: 2
4249
4418
  }
4250
- text(160, 40, 100) { # x, y, width
4419
+ text(161, 40, 100) { # x, y, width
4251
4420
  string('Area Gallery') {
4252
- font family: 'Times', size: 14
4421
+ font family: 'Arial', size: 14
4253
4422
  color :black
4254
4423
  }
4255
4424
  }
@@ -4364,10 +4533,10 @@ window('Area Gallery', 400, 400) {
4364
4533
  x 400
4365
4534
  y 400
4366
4535
  }
4367
-
4536
+
4368
4537
  closed true
4369
4538
  }
4370
-
4539
+
4371
4540
  fill r: 202, g: 102, b: 104, a: 0.5
4372
4541
  stroke r: 0, g: 0, b: 0
4373
4542
  }
@@ -4400,18 +4569,42 @@ window('Area Gallery', 400, 400) {
4400
4569
  end_x 400
4401
4570
  end_y 400
4402
4571
  }
4403
-
4404
- closed true
4405
4572
  }
4406
-
4573
+
4407
4574
  fill r: 202, g: 102, b: 204, a: 0.5
4408
4575
  stroke r: 0, g: 0, b: 0, thickness: 2, dashes: [50, 10, 10, 10], dash_phase: -50.0
4409
4576
  }
4577
+ path { # a dynamic path is added semi-declaratively inside on_draw block
4578
+ polyline(100, 100, 400, 100, 100, 400, 400, 400, 0, 0)
4579
+ figure {
4580
+ x 100
4581
+ y 100
4582
+
4583
+ line {
4584
+ x 400
4585
+ y 100
4586
+ }
4587
+ line {
4588
+ x 100
4589
+ y 400
4590
+ }
4591
+ line {
4592
+ x 400
4593
+ y 400
4594
+ }
4595
+ line {
4596
+ x 0
4597
+ y 0
4598
+ }
4599
+ }
4600
+
4601
+ stroke r: 0, g: 0, b: 0, thickness: 2
4602
+ }
4410
4603
  path { # a dynamic path is added semi-declaratively inside on_draw block
4411
4604
  arc {
4412
- x_center 400
4413
- y_center 220
4414
- radius 180
4605
+ x_center 404
4606
+ y_center 216
4607
+ radius 190
4415
4608
  start_angle 90
4416
4609
  sweep 90
4417
4610
  is_negative false
@@ -4432,12 +4625,12 @@ window('Area Gallery', 400, 400) {
4432
4625
  stroke r: 0, g: 0, b: 0, thickness: 2
4433
4626
  }
4434
4627
  text {
4435
- x 160
4628
+ x 161
4436
4629
  y 40
4437
4630
  width 100
4438
4631
 
4439
4632
  string {
4440
- font family: 'Times', size: 14
4633
+ font family: 'Arial', size: 14
4441
4634
  color :black
4442
4635
 
4443
4636
  'Area Gallery'
@@ -4516,6 +4709,10 @@ Mac
4516
4709
 
4517
4710
  ![glimmer-dsl-libui-mac-histogram.png](images/glimmer-dsl-libui-mac-histogram.png)
4518
4711
 
4712
+ Windows
4713
+
4714
+ ![glimmer-dsl-libui-windows-histogram.png](images/glimmer-dsl-libui-windows-histogram.png)
4715
+
4519
4716
  Linux
4520
4717
 
4521
4718
  ![glimmer-dsl-libui-linux-histogram.png](images/glimmer-dsl-libui-linux-histogram.png)
@@ -4750,20 +4947,13 @@ end
4750
4947
 
4751
4948
  # method-based custom control representing a graph path
4752
4949
  def graph_path(width, height, should_extend, &block)
4753
- locations = point_locations(width, height)
4950
+ locations = point_locations(width, height).flatten
4754
4951
  path {
4755
- first_location = locations[0] # x and y
4756
- figure(first_location[0], first_location[1]) {
4757
- locations.each do |loc|
4758
- line(loc[0], loc[1])
4759
- end
4760
- if should_extend
4761
- line(width, height)
4762
- line(0, height)
4763
-
4764
- closed true
4765
- end
4766
- }
4952
+ if should_extend
4953
+ polygon(locations + [width, height, 0, height])
4954
+ else
4955
+ polyline(locations)
4956
+ end
4767
4957
 
4768
4958
  # apply a transform to the coordinate space for this path so (0, 0) is the top-left corner of the graph
4769
4959
  transform {
@@ -4857,6 +5047,10 @@ Mac
4857
5047
 
4858
5048
  ![glimmer-dsl-libui-mac-basic-transform.png](images/glimmer-dsl-libui-mac-basic-transform.png)
4859
5049
 
5050
+ Windows
5051
+
5052
+ ![glimmer-dsl-libui-windows-basic-transform.png](images/glimmer-dsl-libui-windows-basic-transform.png)
5053
+
4860
5054
  Linux
4861
5055
 
4862
5056
  ![glimmer-dsl-libui-linux-basic-transform.png](images/glimmer-dsl-libui-linux-basic-transform.png)
@@ -4914,6 +5108,11 @@ Mac
4914
5108
  ![glimmer-dsl-libui-mac-login.png](images/glimmer-dsl-libui-mac-login.png)
4915
5109
  ![glimmer-dsl-libui-mac-login-logged-in.png](images/glimmer-dsl-libui-mac-login-logged-in.png)
4916
5110
 
5111
+ Windows
5112
+
5113
+ ![glimmer-dsl-libui-windows-login.png](images/glimmer-dsl-libui-windows-login.png)
5114
+ ![glimmer-dsl-libui-windows-login-logged-in.png](images/glimmer-dsl-libui-windows-login-logged-in.png)
5115
+
4917
5116
  Linux
4918
5117
 
4919
5118
  ![glimmer-dsl-libui-linux-login.png](images/glimmer-dsl-libui-linux-login.png)
@@ -4990,6 +5189,11 @@ Mac
4990
5189
  ![glimmer-dsl-libui-mac-timer.png](images/glimmer-dsl-libui-mac-timer.png)
4991
5190
  ![glimmer-dsl-libui-mac-timer-in-progress.png](images/glimmer-dsl-libui-mac-timer-in-progress.png)
4992
5191
 
5192
+ Windows
5193
+
5194
+ ![glimmer-dsl-libui-windows-timer.png](images/glimmer-dsl-libui-windows-timer.png)
5195
+ ![glimmer-dsl-libui-windows-timer-in-progress.png](images/glimmer-dsl-libui-windows-timer-in-progress.png)
5196
+
4993
5197
  Linux
4994
5198
 
4995
5199
  ![glimmer-dsl-libui-linux-timer.png](images/glimmer-dsl-libui-linux-timer.png)
@@ -5155,6 +5359,12 @@ Mac
5155
5359
  ![glimmer-dsl-libui-mac-color-the-circles-lost.png](images/glimmer-dsl-libui-mac-color-the-circles-lost.png)
5156
5360
  ![glimmer-dsl-libui-mac-color-the-circles-won.png](images/glimmer-dsl-libui-mac-color-the-circles-won.png)
5157
5361
 
5362
+ Windows
5363
+
5364
+ ![glimmer-dsl-libui-windows-color-the-circles.png](images/glimmer-dsl-libui-windows-color-the-circles.png)
5365
+ ![glimmer-dsl-libui-windows-color-the-circles-lost.png](images/glimmer-dsl-libui-windows-color-the-circles-lost.png)
5366
+ ![glimmer-dsl-libui-windows-color-the-circles-won.png](images/glimmer-dsl-libui-windows-color-the-circles-won.png)
5367
+
5158
5368
  Linux
5159
5369
 
5160
5370
  ![glimmer-dsl-libui-linux-color-the-circles.png](images/glimmer-dsl-libui-linux-color-the-circles.png)
@@ -5406,6 +5616,10 @@ Mac
5406
5616
 
5407
5617
  ![glimmer-dsl-libui-mac-basic-draw-text.png](images/glimmer-dsl-libui-mac-basic-draw-text.png)
5408
5618
 
5619
+ Windows
5620
+
5621
+ ![glimmer-dsl-libui-windows-basic-draw-text.png](images/glimmer-dsl-libui-windows-basic-draw-text.png)
5622
+
5409
5623
  Linux
5410
5624
 
5411
5625
  ![glimmer-dsl-libui-linux-basic-draw-text.png](images/glimmer-dsl-libui-linux-basic-draw-text.png)
@@ -5689,6 +5903,11 @@ Mac
5689
5903
  ![glimmer-dsl-libui-mac-custom-draw-text.png](images/glimmer-dsl-libui-mac-custom-draw-text.png)
5690
5904
  ![glimmer-dsl-libui-mac-custom-draw-text-changed.png](images/glimmer-dsl-libui-mac-custom-draw-text-changed.png)
5691
5905
 
5906
+ Windows
5907
+
5908
+ ![glimmer-dsl-libui-windows-custom-draw-text.png](images/glimmer-dsl-libui-windows-custom-draw-text.png)
5909
+ ![glimmer-dsl-libui-windows-custom-draw-text-changed.png](images/glimmer-dsl-libui-windows-custom-draw-text-changed.png)
5910
+
5692
5911
  Linux
5693
5912
 
5694
5913
  ![glimmer-dsl-libui-linux-custom-draw-text.png](images/glimmer-dsl-libui-linux-custom-draw-text.png)
@@ -5903,6 +6122,10 @@ Mac
5903
6122
 
5904
6123
  ![glimmer-dsl-libui-mac-method-based-custom-keyword.png](images/glimmer-dsl-libui-mac-method-based-custom-keyword.png)
5905
6124
 
6125
+ Windows
6126
+
6127
+ ![glimmer-dsl-libui-windows-method-based-custom-keyword.png](images/glimmer-dsl-libui-windows-method-based-custom-keyword.png)
6128
+
5906
6129
  Linux
5907
6130
 
5908
6131
  ![glimmer-dsl-libui-linux-method-based-custom-keyword.png](images/glimmer-dsl-libui-linux-method-based-custom-keyword.png)
@@ -6009,6 +6232,186 @@ window('Method-Based Custom Keyword') {
6009
6232
  }.show
6010
6233
  ```
6011
6234
 
6235
+ ### Tetris
6236
+
6237
+ [examples/tetris.rb](examples/tetris.rb)
6238
+
6239
+ Run with this command from the root of the project if you cloned the project:
6240
+
6241
+ ```
6242
+ ruby -r './lib/glimmer-dsl-libui' examples/tetris.rb
6243
+ ```
6244
+
6245
+ Run with this command if you installed the [Ruby gem](https://rubygems.org/gems/glimmer-dsl-libui):
6246
+
6247
+ ```
6248
+ ruby -r glimmer-dsl-libui -e "require 'examples/tetris'"
6249
+ ```
6250
+
6251
+ Mac
6252
+
6253
+ ![glimmer-dsl-libui-mac-tetris.png](images/glimmer-dsl-libui-mac-tetris.png)
6254
+
6255
+ New [Glimmer DSL for LibUI](https://rubygems.org/gems/glimmer-dsl-libui) Version:
6256
+
6257
+ ```ruby
6258
+ require 'glimmer-dsl-libui'
6259
+
6260
+ require_relative 'tetris/model/game'
6261
+
6262
+ class Tetris
6263
+ include Glimmer
6264
+
6265
+ BLOCK_SIZE = 25
6266
+ BEVEL_CONSTANT = 20
6267
+ COLOR_GRAY = {r: 192, g: 192, b: 192}
6268
+
6269
+ attr_reader :game
6270
+
6271
+ def initialize
6272
+ @game = Model::Game.new
6273
+ create_gui
6274
+ register_observers
6275
+ end
6276
+
6277
+ def launch
6278
+ @game.start!
6279
+ @main_window.show
6280
+ end
6281
+
6282
+ def create_gui
6283
+ @main_window = window('Glimmer Tetris', Model::Game::PLAYFIELD_WIDTH * BLOCK_SIZE, Model::Game::PLAYFIELD_HEIGHT * BLOCK_SIZE) {
6284
+ playfield(playfield_width: Model::Game::PLAYFIELD_WIDTH, playfield_height: Model::Game::PLAYFIELD_HEIGHT, block_size: BLOCK_SIZE)
6285
+ }
6286
+ end
6287
+
6288
+ def register_observers
6289
+ Glimmer::DataBinding::Observer.proc do |game_over|
6290
+ if game_over
6291
+ show_game_over_dialog
6292
+ else
6293
+ start_moving_tetrominos_down
6294
+ end
6295
+ end.observe(@game, :game_over)
6296
+
6297
+ Model::Game::PLAYFIELD_HEIGHT.times do |row|
6298
+ Model::Game::PLAYFIELD_HEIGHT.times do |column|
6299
+ Glimmer::DataBinding::Observer.proc do |new_color|
6300
+ Glimmer::LibUI.queue_main do
6301
+ color = Glimmer::LibUI.interpret_color(new_color)
6302
+ block = @blocks[row][column]
6303
+ block[:background_square].fill = color
6304
+ block[:top_bevel_edge].fill = {r: color[:r] + 4*BEVEL_CONSTANT, g: color[:g] + 4*BEVEL_CONSTANT, b: color[:b] + 4*BEVEL_CONSTANT}
6305
+ block[:right_bevel_edge].fill = {r: color[:r] - BEVEL_CONSTANT, g: color[:g] - BEVEL_CONSTANT, b: color[:b] - BEVEL_CONSTANT}
6306
+ block[:bottom_bevel_edge].fill = {r: color[:r] - BEVEL_CONSTANT, g: color[:g] - BEVEL_CONSTANT, b: color[:b] - BEVEL_CONSTANT}
6307
+ block[:left_bevel_edge].fill = {r: color[:r] - BEVEL_CONSTANT, g: color[:g] - BEVEL_CONSTANT, b: color[:b] - BEVEL_CONSTANT}
6308
+ block[:border_square].stroke = new_color == Model::Block::COLOR_CLEAR ? COLOR_GRAY : color
6309
+ end
6310
+ end.observe(@game.playfield[row][column], :color)
6311
+ end
6312
+ end
6313
+ end
6314
+
6315
+ def playfield(playfield_width: , playfield_height: , block_size: )
6316
+ @blocks = []
6317
+ vertical_box {
6318
+ padded false
6319
+
6320
+ playfield_height.times.map do |row|
6321
+ @blocks << []
6322
+ horizontal_box {
6323
+ padded false
6324
+
6325
+ playfield_width.times.map do |column|
6326
+ @blocks.last << block(row: row, column: column, block_size: block_size)
6327
+ end
6328
+ }
6329
+ end
6330
+ }
6331
+ end
6332
+
6333
+ def block(row: , column: , block_size: )
6334
+ block = {}
6335
+ bevel_pixel_size = 0.16 * block_size.to_f
6336
+ color = Glimmer::LibUI.interpret_color(Model::Block::COLOR_CLEAR)
6337
+ area {
6338
+ block[:background_square] = path {
6339
+ square(0, 0, block_size)
6340
+
6341
+ fill color
6342
+ }
6343
+ block[:top_bevel_edge] = path {
6344
+ polygon(0, 0, block_size, 0, block_size - bevel_pixel_size, bevel_pixel_size, bevel_pixel_size, bevel_pixel_size)
6345
+
6346
+ fill r: color[:r] + 4*BEVEL_CONSTANT, g: color[:g] + 4*BEVEL_CONSTANT, b: color[:b] + 4*BEVEL_CONSTANT
6347
+ }
6348
+ block[:right_bevel_edge] = path {
6349
+ polygon(block_size, 0, block_size - bevel_pixel_size, bevel_pixel_size, block_size - bevel_pixel_size, block_size - bevel_pixel_size, block_size, block_size)
6350
+
6351
+ fill r: color[:r] - BEVEL_CONSTANT, g: color[:g] - BEVEL_CONSTANT, b: color[:b] - BEVEL_CONSTANT
6352
+ }
6353
+ block[:bottom_bevel_edge] = path {
6354
+ polygon(block_size, block_size, 0, block_size, bevel_pixel_size, block_size - bevel_pixel_size, block_size - bevel_pixel_size, block_size - bevel_pixel_size)
6355
+
6356
+ fill r: color[:r] - BEVEL_CONSTANT, g: color[:g] - BEVEL_CONSTANT, b: color[:b] - BEVEL_CONSTANT
6357
+ }
6358
+ block[:left_bevel_edge] = path {
6359
+ polygon(0, 0, 0, block_size, bevel_pixel_size, block_size - bevel_pixel_size, bevel_pixel_size, bevel_pixel_size)
6360
+
6361
+ fill r: color[:r] - BEVEL_CONSTANT, g: color[:g] - BEVEL_CONSTANT, b: color[:b] - BEVEL_CONSTANT
6362
+ }
6363
+ block[:border_square] = path {
6364
+ square(0, 0, block_size)
6365
+
6366
+ stroke COLOR_GRAY
6367
+ }
6368
+
6369
+ on_key_down do |key_event|
6370
+ case key_event
6371
+ in ext_key: :down
6372
+ game.down!
6373
+ in ext_key: :up
6374
+ case game.up_arrow_action
6375
+ when :instant_down
6376
+ game.down!(instant: true)
6377
+ when :rotate_right
6378
+ game.rotate!(:right)
6379
+ when :rotate_left
6380
+ game.rotate!(:left)
6381
+ end
6382
+ in ext_key: :left
6383
+ game.left!
6384
+ in ext_key: :right
6385
+ game.right!
6386
+ in modifier: :shift
6387
+ game.rotate!(:right)
6388
+ in modifier: :control
6389
+ game.rotate!(:left)
6390
+ else
6391
+ # Do Nothing
6392
+ end
6393
+ end
6394
+ }
6395
+ block
6396
+ end
6397
+
6398
+ def start_moving_tetrominos_down
6399
+ Glimmer::LibUI.timer(@game.delay) do
6400
+ @game.down! if !@game.game_over? && !@game.paused?
6401
+ end
6402
+ end
6403
+
6404
+ def show_game_over_dialog
6405
+ Glimmer::LibUI.queue_main do
6406
+ msg_box('Game Over', "Score: #{@game.high_scores.first.score}\nLines: #{@game.high_scores.first.lines}\nLevel: #{@game.high_scores.first.level}")
6407
+ @game.restart!
6408
+ end
6409
+ end
6410
+ end
6411
+
6412
+ Tetris.new.launch
6413
+ ```
6414
+
6012
6415
  ## Applications
6013
6416
 
6014
6417
  Here are some applications built with [Glimmer DSL for LibUI](https://rubygems.org/gems/glimmer-dsl-libui)
@@ -6029,38 +6432,30 @@ https://github.com/AndyObtiva/befunge98/tree/gui
6029
6432
 
6030
6433
  ![befunge98 gui screenshot](https://raw.githubusercontent.com/AndyObtiva/befunge98/master/gui/glimmer-dsl-libui/befunge98_gui_glimmer_dsl_libui/screenshots/befunge98_gui_glimmer_dsl_libui_example.png)
6031
6434
 
6032
- ## Contributing to glimmer-dsl-libui
6435
+ ### i3off Gtk Ruby
6033
6436
 
6034
- - Check out the latest master to make sure the feature hasn't been
6035
- implemented or the bug hasn't been fixed yet.
6036
- - Check out the issue tracker to make sure someone already hasn't
6037
- requested it and/or contributed it.
6038
- - Fork the project.
6039
- - Start a feature/bugfix branch.
6040
- - Commit and push until you are happy with your contribution.
6041
- - Make sure to add tests for it. This is important so I don't break it
6042
- in a future version unintentionally.
6043
- - Please try not to mess with the Rakefile, version, or history. If
6044
- you want to have your own version, or is otherwise necessary, that
6045
- is fine, but please isolate to its own commit so I can cherry-pick
6046
- around it.
6437
+ https://github.com/iraamaro/i3off-gtk-ruby
6438
+
6439
+ ## Process
6440
+
6441
+ [Glimmer Process](https://github.com/AndyObtiva/glimmer/blob/master/PROCESS.md)
6442
+
6443
+ ## Resources
6444
+
6445
+ - [libui C Library](https://github.com/andlabs/libui)
6446
+ - [LibUI Ruby Bindings](https://github.com/kojix2/LibUI)
6447
+ - [Code Master Blog](https://andymaleh.blogspot.com/search/label/LibUI)
6047
6448
 
6048
6449
  ## Help
6049
6450
 
6050
6451
  ### Issues
6051
6452
 
6052
- You may submit [issues](https://github.com/AndyObtiva/glimmer/issues) on [GitHub](https://github.com/AndyObtiva/glimmer/issues).
6053
-
6054
- [Click here to submit an issue.](https://github.com/AndyObtiva/glimmer/issues)
6453
+ If you encounter [issues](https://github.com/AndyObtiva/glimmer-dsl-libui/issues) that are not reported, discover missing features that are not mentioned in [TODO.md](TODO.md), or think up better ways to use [libui](https://github.com/andlabs/libui) than what is possible with [Glimmer DSL for LibUI](https://rubygems.org/gems/glimmer-dsl-libui), you may submit an [issue](https://github.com/AndyObtiva/glimmer-dsl-libui/issues/new) or [pull request](https://github.com/AndyObtiva/glimmer-dsl-libui/compare) on [GitHub](https://github.com).
6055
6454
 
6056
6455
  ### Chat
6057
6456
 
6058
6457
  If you need live help, try to [![Join the chat at https://gitter.im/AndyObtiva/glimmer](https://badges.gitter.im/AndyObtiva/glimmer.svg)](https://gitter.im/AndyObtiva/glimmer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
6059
6458
 
6060
- ## Process
6061
-
6062
- [Glimmer Process](https://github.com/AndyObtiva/glimmer/blob/master/PROCESS.md)
6063
-
6064
6459
  ## Planned Features and Feature Suggestions
6065
6460
 
6066
6461
  These features have been planned or suggested. You might see them in a future version of [Glimmer DSL for LibUI](https://rubygems.org/gems/glimmer-dsl-libui). You are welcome to contribute more feature suggestions.
@@ -6071,6 +6466,22 @@ These features have been planned or suggested. You might see them in a future ve
6071
6466
 
6072
6467
  [CHANGELOG.md](CHANGELOG.md)
6073
6468
 
6469
+ ## Contributing
6470
+
6471
+ - Check out the latest master to make sure the feature hasn't been
6472
+ implemented or the bug hasn't been fixed yet.
6473
+ - Check out the issue tracker to make sure someone already hasn't
6474
+ requested it and/or contributed it.
6475
+ - Fork the project.
6476
+ - Start a feature/bugfix branch.
6477
+ - Commit and push until you are happy with your contribution.
6478
+ - Make sure to add tests for it. This is important so I don't break it
6479
+ in a future version unintentionally.
6480
+ - Please try not to mess with the Rakefile, version, or history. If
6481
+ you want to have your own version, or is otherwise necessary, that
6482
+ is fine, but please isolate to its own commit so I can cherry-pick
6483
+ around it.
6484
+
6074
6485
  ## Contributors
6075
6486
 
6076
6487
  * [Andy Maleh](https://github.com/AndyObtiva) (Founder)