glimmer-dsl-libui 0.4.17 → 0.4.21

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -0
  3. data/LICENSE.txt +1 -1
  4. data/README.md +474 -75
  5. data/VERSION +1 -1
  6. data/bin/girb +0 -0
  7. data/bin/girb_runner.rb +1 -1
  8. data/examples/area_based_custom_controls.rb +282 -0
  9. data/examples/basic_table.rb +1 -1
  10. data/examples/custom_draw_text.rb +14 -7
  11. data/examples/custom_draw_text2.rb +15 -8
  12. data/examples/method_based_custom_keyword.rb +9 -9
  13. data/examples/method_based_custom_keyword2.rb +9 -9
  14. data/examples/snake/model/game.rb +18 -1
  15. data/examples/snake.rb +6 -2
  16. data/examples/snake2.rb +6 -2
  17. data/examples/tetris/model/block.rb +1 -1
  18. data/examples/tetris/model/game.rb +1 -1
  19. data/examples/tetris/model/past_game.rb +1 -1
  20. data/examples/tetris/model/tetromino.rb +1 -1
  21. data/examples/tetris.rb +1 -1
  22. data/examples/tic_tac_toe/board.rb +1 -1
  23. data/examples/tic_tac_toe/cell.rb +1 -1
  24. data/glimmer-dsl-libui.gemspec +0 -0
  25. data/lib/glimmer/dsl/libui/bind_expression.rb +1 -1
  26. data/lib/glimmer/dsl/libui/control_expression.rb +1 -1
  27. data/lib/glimmer/dsl/libui/data_binding_expression.rb +1 -1
  28. data/lib/glimmer/dsl/libui/dsl.rb +2 -1
  29. data/lib/glimmer/dsl/libui/file_expression.rb +1 -1
  30. data/lib/glimmer/dsl/libui/listener_expression.rb +1 -1
  31. data/lib/glimmer/dsl/libui/observe_expression.rb +2 -2
  32. data/lib/glimmer/dsl/libui/open_file_expression.rb +1 -1
  33. data/lib/glimmer/dsl/libui/operation_expression.rb +47 -0
  34. data/lib/glimmer/dsl/libui/property_expression.rb +3 -3
  35. data/lib/glimmer/dsl/libui/save_file_expression.rb +1 -1
  36. data/lib/glimmer/dsl/libui/shape_expression.rb +1 -1
  37. data/lib/glimmer/dsl/libui/shine_data_binding_expression.rb +1 -1
  38. data/lib/glimmer/dsl/libui/string_expression.rb +1 -1
  39. data/lib/glimmer/dsl/libui/tab_item_expression.rb +1 -1
  40. data/lib/glimmer/fiddle_consumer.rb +1 -1
  41. data/lib/glimmer/libui/attributed_string.rb +1 -1
  42. data/lib/glimmer/libui/control_proxy/area_proxy/scrolling_area_proxy.rb +1 -1
  43. data/lib/glimmer/libui/control_proxy/area_proxy.rb +1 -1
  44. data/lib/glimmer/libui/control_proxy/box/horizontal_box_proxy.rb +1 -1
  45. data/lib/glimmer/libui/control_proxy/box/vertical_box_proxy.rb +1 -1
  46. data/lib/glimmer/libui/control_proxy/box.rb +2 -1
  47. data/lib/glimmer/libui/control_proxy/button_proxy.rb +1 -1
  48. data/lib/glimmer/libui/control_proxy/checkbox_proxy.rb +1 -1
  49. data/lib/glimmer/libui/control_proxy/color_button_proxy.rb +1 -1
  50. data/lib/glimmer/libui/control_proxy/column/background_color_column_proxy.rb +1 -1
  51. data/lib/glimmer/libui/control_proxy/column/button_column_proxy.rb +1 -1
  52. data/lib/glimmer/libui/control_proxy/column/checkbox_column_proxy.rb +1 -1
  53. data/lib/glimmer/libui/control_proxy/column/checkbox_text_color_column_proxy.rb +1 -1
  54. data/lib/glimmer/libui/control_proxy/column/checkbox_text_column_proxy.rb +1 -1
  55. data/lib/glimmer/libui/control_proxy/column/image_column_proxy.rb +1 -1
  56. data/lib/glimmer/libui/control_proxy/column/image_text_color_column_proxy.rb +1 -1
  57. data/lib/glimmer/libui/control_proxy/column/image_text_column_proxy.rb +1 -1
  58. data/lib/glimmer/libui/control_proxy/column/progress_bar_column_proxy.rb +1 -1
  59. data/lib/glimmer/libui/control_proxy/column/text_color_column_proxy.rb +1 -1
  60. data/lib/glimmer/libui/control_proxy/column/text_column_proxy.rb +1 -1
  61. data/lib/glimmer/libui/control_proxy/column.rb +1 -1
  62. data/lib/glimmer/libui/control_proxy/combobox_proxy.rb +1 -1
  63. data/lib/glimmer/libui/control_proxy/date_time_picker_proxy/date_picker_proxy.rb +1 -1
  64. data/lib/glimmer/libui/control_proxy/date_time_picker_proxy/time_picker_proxy.rb +1 -1
  65. data/lib/glimmer/libui/control_proxy/date_time_picker_proxy.rb +1 -1
  66. data/lib/glimmer/libui/control_proxy/dual_column.rb +1 -1
  67. data/lib/glimmer/libui/control_proxy/editable_column.rb +1 -1
  68. data/lib/glimmer/libui/control_proxy/editable_combobox_proxy.rb +1 -1
  69. data/lib/glimmer/libui/control_proxy/enableable_column.rb +1 -1
  70. data/lib/glimmer/libui/control_proxy/entry_proxy/password_entry_proxy.rb +1 -1
  71. data/lib/glimmer/libui/control_proxy/entry_proxy/search_entry_proxy.rb +1 -1
  72. data/lib/glimmer/libui/control_proxy/entry_proxy.rb +1 -1
  73. data/lib/glimmer/libui/control_proxy/font_button_proxy.rb +1 -1
  74. data/lib/glimmer/libui/control_proxy/form_proxy.rb +2 -1
  75. data/lib/glimmer/libui/control_proxy/grid_proxy.rb +1 -1
  76. data/lib/glimmer/libui/control_proxy/group_proxy.rb +1 -1
  77. data/lib/glimmer/libui/control_proxy/image_part_proxy.rb +1 -1
  78. data/lib/glimmer/libui/control_proxy/image_proxy.rb +1 -1
  79. data/lib/glimmer/libui/control_proxy/label_proxy.rb +1 -1
  80. data/lib/glimmer/libui/control_proxy/matrix_proxy.rb +1 -1
  81. data/lib/glimmer/libui/control_proxy/menu_item_proxy/about_menu_item_proxy.rb +1 -1
  82. data/lib/glimmer/libui/control_proxy/menu_item_proxy/check_menu_item_proxy.rb +1 -1
  83. data/lib/glimmer/libui/control_proxy/menu_item_proxy/preferences_menu_item_proxy.rb +1 -1
  84. data/lib/glimmer/libui/control_proxy/menu_item_proxy/quit_menu_item_proxy.rb +1 -2
  85. data/lib/glimmer/libui/control_proxy/menu_item_proxy/radio_menu_item_proxy.rb +1 -1
  86. data/lib/glimmer/libui/control_proxy/menu_item_proxy/separator_menu_item_proxy.rb +1 -1
  87. data/lib/glimmer/libui/control_proxy/menu_item_proxy.rb +1 -1
  88. data/lib/glimmer/libui/control_proxy/menu_proxy.rb +1 -1
  89. data/lib/glimmer/libui/control_proxy/message_box/msg_box_error_proxy.rb +1 -1
  90. data/lib/glimmer/libui/control_proxy/message_box/msg_box_proxy.rb +1 -1
  91. data/lib/glimmer/libui/control_proxy/message_box.rb +1 -1
  92. data/lib/glimmer/libui/control_proxy/multiline_entry_proxy/non_wrapping_multiline_entry_proxy.rb +1 -1
  93. data/lib/glimmer/libui/control_proxy/multiline_entry_proxy.rb +1 -1
  94. data/lib/glimmer/libui/control_proxy/open_type_features_proxy.rb +1 -1
  95. data/lib/glimmer/libui/control_proxy/open_type_tag_proxy.rb +1 -1
  96. data/lib/glimmer/libui/control_proxy/path_proxy.rb +7 -5
  97. data/lib/glimmer/libui/control_proxy/radio_buttons_proxy.rb +1 -1
  98. data/lib/glimmer/libui/control_proxy/slider_proxy.rb +1 -1
  99. data/lib/glimmer/libui/control_proxy/spinbox_proxy.rb +1 -1
  100. data/lib/glimmer/libui/control_proxy/tab_item_proxy.rb +1 -1
  101. data/lib/glimmer/libui/control_proxy/table_proxy.rb +48 -34
  102. data/lib/glimmer/libui/control_proxy/text_proxy.rb +1 -1
  103. data/lib/glimmer/libui/control_proxy/transformable.rb +1 -1
  104. data/lib/glimmer/libui/control_proxy/triple_column.rb +1 -1
  105. data/lib/glimmer/libui/control_proxy/window_proxy.rb +1 -1
  106. data/lib/glimmer/libui/control_proxy.rb +2 -1
  107. data/lib/glimmer/libui/data_bindable.rb +2 -2
  108. data/lib/glimmer/libui/parent.rb +1 -1
  109. data/lib/glimmer/libui/shape/arc.rb +1 -1
  110. data/lib/glimmer/libui/shape/bezier.rb +21 -4
  111. data/lib/glimmer/libui/shape/circle.rb +1 -1
  112. data/lib/glimmer/libui/shape/figure.rb +1 -1
  113. data/lib/glimmer/libui/shape/line.rb +24 -4
  114. data/lib/glimmer/libui/shape/polybezier.rb +1 -1
  115. data/lib/glimmer/libui/shape/polygon.rb +1 -1
  116. data/lib/glimmer/libui/shape/polyline.rb +1 -1
  117. data/lib/glimmer/libui/shape/rectangle.rb +1 -1
  118. data/lib/glimmer/libui/shape/square.rb +1 -1
  119. data/lib/glimmer/libui/shape.rb +1 -1
  120. data/lib/glimmer/libui.rb +1 -1
  121. data/lib/glimmer-dsl-libui.rb +2 -2
  122. metadata +9 -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
@@ -48,6 +48,8 @@ module Glimmer
48
48
  @enabled = true
49
49
  @columns = []
50
50
  @cell_rows = []
51
+ @last_cell_rows = []
52
+ register_cell_rows_observer
51
53
  window_proxy.on_destroy do
52
54
  # the following unless condition is an exceptional condition stumbled upon that fails freeing the table model
53
55
  ::LibUI.free_table_model(@model) unless @destroyed && parent_proxy.is_a?(Box)
@@ -75,7 +77,8 @@ module Glimmer
75
77
 
76
78
  def destroy
77
79
  super
78
- @cell_rows_observer&.unobserve(self, :cell_rows, recursive: true)
80
+ # TODO consider replacing unobserve with observer_registration.deregister
81
+ @cell_rows_observer&.unobserve(self, :cell_rows, recursive: true, ignore_frozen: true, attribute_writer_type: [:attribute=, :set_attribute])
79
82
  @destroyed = true
80
83
  end
81
84
 
@@ -86,31 +89,6 @@ module Glimmer
86
89
  if rows != @cell_rows
87
90
  @cell_rows = rows
88
91
  @cell_rows = @cell_rows.to_a if @cell_rows.is_a?(Enumerator)
89
- @last_cell_rows ||= array_deep_clone(@cell_rows)
90
- @cell_rows_observer ||= Glimmer::DataBinding::Observer.proc do |new_cell_rows|
91
- if @cell_rows.size < @last_cell_rows.size && @last_cell_rows.include_all?(*@cell_rows)
92
- @last_cell_rows.array_diff_indexes(@cell_rows).reverse.each do |row|
93
- ::LibUI.table_model_row_deleted(model, row) if model && row
94
- notify_custom_listeners('on_changed', row, :deleted, @last_cell_rows[row])
95
- end
96
- elsif @cell_rows.size > @last_cell_rows.size && @cell_rows.include_all?(*@last_cell_rows)
97
- @cell_rows.array_diff_indexes(@last_cell_rows).each do |row|
98
- ::LibUI.table_model_row_inserted(model, row) if model && row
99
- notify_custom_listeners('on_changed', row, :inserted, @cell_rows[row])
100
- end
101
- else
102
- @cell_rows.each_with_index do |new_row_data, row|
103
- if new_row_data != @last_cell_rows[row]
104
- ::LibUI.table_model_row_changed(model, row) if model && row
105
- notify_custom_listeners('on_changed', row, :changed, @cell_rows[row])
106
- end
107
- end
108
- end
109
- @last_last_cell_rows = array_deep_clone(@last_cell_rows)
110
- @last_cell_rows = array_deep_clone(@cell_rows)
111
- end.tap do |cell_rows_observer|
112
- cell_rows_observer.observe(self, :cell_rows, recursive: true, ignore_frozen: true)
113
- end
114
92
  end
115
93
  @cell_rows
116
94
  end
@@ -153,13 +131,13 @@ module Glimmer
153
131
  new_value = new_value.to_a if new_value.is_a?(Enumerator)
154
132
  if model_binding.binding_options[:column_attributes] || (!new_value.empty? && !new_value.first.is_a?(Array))
155
133
  @model_attribute_array_observer_registration&.deregister
156
- @model_attribute_array_observer_registration = model_attribute_observer.observe(new_value, @column_attributes, ignore_frozen: true)
134
+ @model_attribute_array_observer_registration = model_attribute_observer.observe(new_value, @column_attributes, ignore_frozen: true, attribute_writer_type: [:attribute=, :set_attribute])
157
135
  model_attribute_observer.add_dependent(model_attribute_observer_registration => @model_attribute_array_observer_registration)
158
136
  end
159
137
  # TODO look if multiple notifications are happening as a result of observing array and observing model binding
160
138
  send("#{property}=", new_value) unless @last_cell_rows == new_value
161
139
  end
162
- model_attribute_observer_registration = model_attribute_observer.observe(model_binding)
140
+ model_attribute_observer_registration = model_attribute_observer.observe(model_binding, attribute_writer_type: [:attribute=, :set_attribute])
163
141
  model_attribute_observer.call # initial update
164
142
  data_binding_model_attribute_observer_registrations << model_attribute_observer_registration
165
143
  model_attribute_observer
@@ -313,11 +291,7 @@ module Glimmer
313
291
 
314
292
  if !@applied_windows_fix && OS.windows?
315
293
  @applied_windows_fix = true
316
- new_row = @columns&.select {|column| column.is_a?(Column)}&.map {|column| column.class.default_value}
317
- if new_row
318
- @cell_rows << new_row
319
- @cell_rows.pop
320
- end
294
+ apply_windows_fix
321
295
  end
322
296
  end
323
297
 
@@ -325,6 +299,46 @@ module Glimmer
325
299
  @next_column_index ||= -1
326
300
  @next_column_index += 1
327
301
  end
302
+
303
+ def register_cell_rows_observer
304
+ @cell_rows_observer = Glimmer::DataBinding::Observer.proc do |new_cell_rows|
305
+ if @cell_rows.size < @last_cell_rows.size && @last_cell_rows.include_all?(*@cell_rows)
306
+ @last_cell_rows.array_diff_indexes(@cell_rows).reverse.each do |row|
307
+ ::LibUI.table_model_row_deleted(model, row) if model && row
308
+ notify_custom_listeners('on_changed', row, :deleted, @last_cell_rows[row])
309
+ end
310
+ elsif @cell_rows.size > @last_cell_rows.size && @cell_rows.include_all?(*@last_cell_rows)
311
+ @cell_rows.array_diff_indexes(@last_cell_rows).each do |row|
312
+ ::LibUI.table_model_row_inserted(model, row) if model && row
313
+ notify_custom_listeners('on_changed', row, :inserted, @cell_rows[row])
314
+ end
315
+ else
316
+ @cell_rows.each_with_index do |new_row_data, row|
317
+ if new_row_data != @last_cell_rows[row]
318
+ ::LibUI.table_model_row_changed(model, row) if model && row
319
+ notify_custom_listeners('on_changed', row, :changed, @cell_rows[row])
320
+ end
321
+ end
322
+ end
323
+ @last_last_cell_rows = array_deep_clone(@last_cell_rows)
324
+ @last_cell_rows = array_deep_clone(@cell_rows)
325
+ if !@applied_windows_fix_on_first_cell_rows_update && OS.windows?
326
+ @applied_windows_fix_on_first_cell_rows_update = true
327
+ apply_windows_fix
328
+ end
329
+ end
330
+ @cell_rows_observer_registration = @cell_rows_observer.observe(self, :cell_rows, recursive: true, ignore_frozen: true, attribute_writer_type: [:attribute=, :set_attribute])
331
+ end
332
+
333
+ def apply_windows_fix
334
+ Glimmer::LibUI.queue_main do
335
+ new_row = @columns&.select {|column| column.is_a?(Column)}&.map {|column| column.class.default_value}
336
+ if new_row
337
+ @cell_rows << new_row
338
+ @cell_rows.pop
339
+ end
340
+ end
341
+ end
328
342
  end
329
343
  end
330
344
  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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -46,7 +46,7 @@ module Glimmer
46
46
  new_value = model_binding.evaluate_property
47
47
  send("#{property}=", new_value) unless send(property) == new_value
48
48
  end
49
- observer_registration = model_attribute_observer.observe(model_binding)
49
+ observer_registration = model_attribute_observer.observe(model_binding, attribute_writer_type: [:attribute=, :set_attribute])
50
50
  model_attribute_observer.call # initial update
51
51
  data_binding_model_attribute_observer_registrations << observer_registration
52
52
  observer_registration
@@ -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
@@ -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
@@ -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
- ::LibUI.draw_path_bezier_to(path_proxy.libui, *@args)
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
@@ -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
@@ -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
- ::LibUI.draw_path_line_to(path_proxy.libui, *@args)
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
data/lib/glimmer/libui.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
@@ -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
@@ -50,5 +50,5 @@ end
50
50
  # begin
51
51
  # PutsDebuggerer.printer = lambda { |m| puts m; $stdout.flush}
52
52
  # rescue
53
- ## No Op if puts_debuggerer is not loaded
53
+ ##### No Op if puts_debuggerer is not loaded
54
54
  # end
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.17
4
+ version: 0.4.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Maleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-07 00:00:00.000000000 Z
11
+ date: 2022-01-30 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.3
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.3
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 keyword support.
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
@@ -334,6 +336,7 @@ files:
334
336
  - lib/glimmer/dsl/libui/listener_expression.rb
335
337
  - lib/glimmer/dsl/libui/observe_expression.rb
336
338
  - lib/glimmer/dsl/libui/open_file_expression.rb
339
+ - lib/glimmer/dsl/libui/operation_expression.rb
337
340
  - lib/glimmer/dsl/libui/property_expression.rb
338
341
  - lib/glimmer/dsl/libui/save_file_expression.rb
339
342
  - lib/glimmer/dsl/libui/shape_expression.rb
@@ -448,7 +451,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
448
451
  - !ruby/object:Gem::Version
449
452
  version: '0'
450
453
  requirements: []
451
- rubygems_version: 3.2.22
454
+ rubygems_version: 3.3.1
452
455
  signing_key:
453
456
  specification_version: 4
454
457
  summary: Glimmer DSL for LibUI