glimmer-dsl-libui 0.4.18 → 0.4.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -0
- data/LICENSE.txt +1 -1
- data/README.md +448 -74
- data/VERSION +1 -1
- data/bin/girb +0 -0
- data/bin/girb_runner.rb +1 -1
- data/examples/area_based_custom_controls.rb +282 -0
- data/examples/method_based_custom_keyword.rb +9 -9
- data/examples/method_based_custom_keyword2.rb +9 -9
- data/examples/snake/model/game.rb +18 -1
- data/examples/snake.rb +6 -2
- data/examples/snake2.rb +6 -2
- data/examples/tetris/model/block.rb +1 -1
- data/examples/tetris/model/game.rb +26 -24
- data/examples/tetris/model/past_game.rb +1 -1
- data/examples/tetris/model/tetromino.rb +1 -1
- data/examples/tetris.rb +51 -20
- 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/control_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 -2
- data/lib/glimmer/dsl/libui/open_file_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 +2 -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 +2 -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 +1 -1
- data/lib/glimmer/libui/control_proxy/text_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/transformable.rb +1 -1
- 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 +2 -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 +21 -4
- 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 +24 -4
- 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 +1 -1
- data/lib/glimmer/libui.rb +1 -1
- data/lib/glimmer-dsl-libui.rb +1 -1
- metadata +8 -6
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) 2021 Andy Maleh
|
1
|
+
# Copyright (c) 2021-2022 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
|
@@ -334,6 +334,7 @@ module Glimmer
|
|
334
334
|
|
335
335
|
def destroy_child(child)
|
336
336
|
child.default_destroy
|
337
|
+
children.delete(child)
|
337
338
|
end
|
338
339
|
|
339
340
|
def default_destroy
|
data/lib/glimmer/libui/parent.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) 2021 Andy Maleh
|
1
|
+
# Copyright (c) 2021-2022 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
|
@@ -25,13 +25,30 @@ module Glimmer
|
|
25
25
|
module LibUI
|
26
26
|
class Shape
|
27
27
|
class Bezier < Shape
|
28
|
-
parameters :c1_x, :c1_y, :c2_x, :c2_y, :end_x, :end_y
|
29
|
-
parameter_defaults 0, 0, 0, 0, 0, 0
|
28
|
+
parameters :x, :y, :c1_x, :c1_y, :c2_x, :c2_y, :end_x, :end_y
|
29
|
+
parameter_defaults nil, nil, 0, 0, 0, 0, 0, 0
|
30
|
+
|
31
|
+
def initialize(keyword, parent, args, &block)
|
32
|
+
args.prepend nil until args.size == 8
|
33
|
+
super(keyword, parent, args, &block)
|
34
|
+
end
|
30
35
|
|
31
36
|
def draw(area_draw_params)
|
32
|
-
|
37
|
+
if !parent.is_a?(Figure)
|
38
|
+
if include_start_point?
|
39
|
+
::LibUI.draw_path_new_figure(path_proxy.libui, x, y)
|
40
|
+
else
|
41
|
+
::LibUI.draw_path_new_figure(path_proxy.libui, 0, 0)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
::LibUI.draw_path_bezier_to(path_proxy.libui, c1_x, c1_y, c2_x, c2_y, end_x, end_y)
|
33
45
|
super
|
34
46
|
end
|
47
|
+
|
48
|
+
# Indicates if bezier is not part of a figure and yet it includes the start point in addition to other points
|
49
|
+
def include_start_point?
|
50
|
+
x && y
|
51
|
+
end
|
35
52
|
end
|
36
53
|
end
|
37
54
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) 2021 Andy Maleh
|
1
|
+
# Copyright (c) 2021-2022 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
|
@@ -24,14 +24,34 @@ require 'glimmer/libui/shape'
|
|
24
24
|
module Glimmer
|
25
25
|
module LibUI
|
26
26
|
class Shape
|
27
|
+
# Line to use as part of a figure (when having 2 args)
|
28
|
+
# or independently (when having 4 args representing start point x/y and end point x/y)
|
27
29
|
class Line < Shape
|
28
|
-
parameters :x, :y
|
29
|
-
parameter_defaults 0, 0
|
30
|
+
parameters :x, :y, :end_x, :end_y
|
31
|
+
parameter_defaults 0, 0, nil, nil
|
30
32
|
|
31
33
|
def draw(area_draw_params)
|
32
|
-
|
34
|
+
if parent.is_a?(Figure)
|
35
|
+
::LibUI.draw_path_line_to(path_proxy.libui, x, y)
|
36
|
+
else
|
37
|
+
if include_start_point?
|
38
|
+
::LibUI.draw_path_new_figure(path_proxy.libui, x, y)
|
39
|
+
::LibUI.draw_path_line_to(path_proxy.libui, end_x, end_y)
|
40
|
+
else
|
41
|
+
::LibUI.draw_path_new_figure(path_proxy.libui, 0, 0)
|
42
|
+
::LibUI.draw_path_line_to(path_proxy.libui, x, y)
|
43
|
+
end
|
44
|
+
end
|
33
45
|
super
|
34
46
|
end
|
47
|
+
|
48
|
+
# Indicates if line is not part of a figure and yet it includes the start point in addition to end point
|
49
|
+
def include_start_point?
|
50
|
+
# if the last 2 args are available, it means that the first 2 args represent the start point
|
51
|
+
# if line is part of a figure, then the last 2 args are ignored and it is never assumed to include
|
52
|
+
# start point
|
53
|
+
!parent.is_a?(Figure) && end_x && end_y
|
54
|
+
end
|
35
55
|
end
|
36
56
|
end
|
37
57
|
end
|
data/lib/glimmer/libui/shape.rb
CHANGED
data/lib/glimmer/libui.rb
CHANGED
data/lib/glimmer-dsl-libui.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glimmer-dsl-libui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Maleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: glimmer
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.5.
|
19
|
+
version: 2.5.5
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.5.
|
26
|
+
version: 2.5.5
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: os
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -209,7 +209,8 @@ description: Glimmer DSL for LibUI (Prerequisite-Free Ruby Desktop Development G
|
|
209
209
|
platform-independent native GUI that just works! Glimmer DSL for LibUI aims to provide
|
210
210
|
declarative DSL syntax that visually maps to GUI control hierarchy, convention over
|
211
211
|
configuration via smart defaults, automation of low-level details, requiring the
|
212
|
-
least amount of syntax possible to build GUI, and custom
|
212
|
+
least amount of syntax possible to build GUI, bidirectional data-binding, and custom
|
213
|
+
keyword support.
|
213
214
|
email: andy.am@gmail.com
|
214
215
|
executables:
|
215
216
|
- girb
|
@@ -225,6 +226,7 @@ files:
|
|
225
226
|
- VERSION
|
226
227
|
- bin/girb
|
227
228
|
- bin/girb_runner.rb
|
229
|
+
- examples/area_based_custom_controls.rb
|
228
230
|
- examples/area_gallery.rb
|
229
231
|
- examples/area_gallery2.rb
|
230
232
|
- examples/area_gallery3.rb
|
@@ -449,7 +451,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
449
451
|
- !ruby/object:Gem::Version
|
450
452
|
version: '0'
|
451
453
|
requirements: []
|
452
|
-
rubygems_version: 3.
|
454
|
+
rubygems_version: 3.3.1
|
453
455
|
signing_key:
|
454
456
|
specification_version: 4
|
455
457
|
summary: Glimmer DSL for LibUI
|