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
@@ -0,0 +1,47 @@
1
+ # Copyright (c) 2021-2022 Andy Maleh
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining
4
+ # a copy of this software and associated documentation files (the
5
+ # "Software"), to deal in the Software without restriction, including
6
+ # without limitation the rights to use, copy, modify, merge, publish,
7
+ # distribute, sublicense, and/or sell copies of the Software, and to
8
+ # permit persons to whom the Software is furnished to do so, subject to
9
+ # the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be
12
+ # included in all copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
22
+ require 'glimmer/dsl/expression'
23
+ require 'glimmer/libui/control_proxy'
24
+ require 'glimmer/libui/shape'
25
+ require 'glimmer/libui/attributed_string'
26
+
27
+ module Glimmer
28
+ module DSL
29
+ module Libui
30
+ class OperationExpression < Expression
31
+ def can_interpret?(parent, keyword, *args, &block)
32
+ (
33
+ parent.is_a?(Glimmer::LibUI::ControlProxy) or
34
+ parent.is_a?(Glimmer::LibUI::Shape) or
35
+ parent.is_a?(Glimmer::LibUI::AttributedString)
36
+ ) and
37
+ block.nil? and
38
+ parent.respond_to?(keyword, *args)
39
+ end
40
+
41
+ def interpret(parent, keyword, *args, &block)
42
+ parent.send(keyword, *args)
43
+ end
44
+ end
45
+ end
46
+ end
47
+ 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
@@ -35,11 +35,11 @@ module Glimmer
35
35
  parent.is_a?(Glimmer::LibUI::AttributedString)
36
36
  ) and
37
37
  block.nil? and
38
- parent.respond_to?(keyword, *args)
38
+ parent.respond_to?("#{keyword}=", *args)
39
39
  end
40
40
 
41
41
  def interpret(parent, keyword, *args, &block)
42
- parent.send(keyword, *args)
42
+ parent.send("#{keyword}=", *args)
43
43
  end
44
44
  end
45
45
  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
@@ -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
@@ -45,6 +45,7 @@ module Glimmer
45
45
  child.deregister_all_custom_listeners
46
46
  ::LibUI.send("box_delete", @libui, children.index(child))
47
47
  ControlProxy.control_proxies.delete(child)
48
+ children.delete(child)
48
49
  end
49
50
 
50
51
  private
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -42,6 +42,7 @@ module Glimmer
42
42
  child.deregister_all_custom_listeners
43
43
  ::LibUI.send("form_delete", @libui, children.index(child))
44
44
  ControlProxy.control_proxies.delete(child)
45
+ children.delete(child)
45
46
  end
46
47
 
47
48
  private
@@ -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
@@ -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
@@ -46,7 +46,6 @@ module Glimmer
46
46
  if return_value.is_a?(Numeric)
47
47
  return_value
48
48
  else
49
- destroy
50
49
  ControlProxy.main_window_proxy&.destroy
51
50
  ::LibUI.quit
52
51
  0
@@ -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
@@ -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
@@ -70,7 +70,8 @@ module Glimmer
70
70
  else
71
71
  new_color = Glimmer::LibUI.interpret_color(args)
72
72
  if new_color != @fill
73
- @fill_observer&.unobserve(@fill) if @fill
73
+ # TODO consider replacing unobserve with observer_registration.deregister
74
+ @fill_observer&.unobserve(@fill, attribute_writer_type: [:attribute=, :set_attribute]) if @fill
74
75
  @fill = new_color
75
76
  request_auto_redraw
76
77
  end
@@ -79,7 +80,7 @@ module Glimmer
79
80
  @fill_observer ||= Glimmer::DataBinding::Observer.proc do
80
81
  request_auto_redraw
81
82
  end
82
- @fill_observer.observe(@fill)
83
+ @fill_observer.observe(@fill, attribute_writer_type: [:attribute=, :set_attribute])
83
84
  end
84
85
  end
85
86
  alias fill= fill
@@ -98,7 +99,8 @@ module Glimmer
98
99
  else
99
100
  new_color = Glimmer::LibUI.interpret_color(args)
100
101
  if new_color != @stroke
101
- @stroke_observer&.unobserve(@stroke) if @stroke
102
+ # TODO consider replacing unobserve with observer_registration.deregister
103
+ @stroke_observer&.unobserve(@stroke, attribute_writer_type: [:attribute=, :set_attribute]) if @stroke
102
104
  @stroke = Glimmer::LibUI.interpret_color(args)
103
105
  request_auto_redraw
104
106
  end
@@ -107,7 +109,7 @@ module Glimmer
107
109
  @stroke_observer ||= Glimmer::DataBinding::Observer.proc do
108
110
  request_auto_redraw
109
111
  end
110
- @stroke_observer.observe(@stroke)
112
+ @stroke_observer.observe(@stroke, attribute_writer_type: [:attribute=, :set_attribute])
111
113
  end
112
114
  end
113
115
  alias stroke= stroke
@@ -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