white_gold 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/ext/dll/tgui.dll +0 -0
  3. data/ext/so/libtgui.so +0 -0
  4. data/lib/white_gold/abi/enum.rb +1 -1
  5. data/lib/white_gold/abi/interface/interface.rb +3 -7
  6. data/lib/white_gold/convention/bang_def.rb +14 -0
  7. data/lib/white_gold/convention/bang_nest.rb +1 -1
  8. data/lib/white_gold/convention/bang_nested_caller.rb +55 -22
  9. data/lib/white_gold/convention/container_widgets.rb +46 -86
  10. data/lib/white_gold/convention/page.rb +10 -4
  11. data/lib/white_gold/convention/theme/boolean_attribute.rb +11 -9
  12. data/lib/white_gold/convention/theme/color_attribute.rb +11 -9
  13. data/lib/white_gold/convention/theme/float_attribute.rb +11 -9
  14. data/lib/white_gold/convention/theme/outline_attribute.rb +11 -9
  15. data/lib/white_gold/convention/theme/text_styles_attribute.rb +14 -12
  16. data/lib/white_gold/convention/theme/texture_attribute.rb +14 -12
  17. data/lib/white_gold/convention/theme/theme_attributed.rb +1 -1
  18. data/lib/white_gold/convention/theme/theme_component.rb +1 -1
  19. data/lib/white_gold/convention/theme_attributes.rb +6 -2
  20. data/lib/white_gold/convention/widget/keyboard_control.rb +30 -0
  21. data/lib/white_gold/convention/widget_class_aliases.rb +24 -0
  22. data/lib/white_gold/dsl/canvas.rb +5 -5
  23. data/lib/white_gold/dsl/chat_box.rb +1 -1
  24. data/lib/white_gold/dsl/child_window.rb +1 -1
  25. data/lib/white_gold/dsl/color.rb +4 -2
  26. data/lib/white_gold/dsl/combo_box.rb +2 -2
  27. data/lib/white_gold/dsl/container.rb +1 -1
  28. data/lib/white_gold/dsl/custom_widget.rb +28 -0
  29. data/lib/white_gold/dsl/grid.rb +34 -10
  30. data/lib/white_gold/dsl/gui.rb +10 -1
  31. data/lib/white_gold/dsl/label.rb +3 -0
  32. data/lib/white_gold/dsl/list_box.rb +2 -2
  33. data/lib/white_gold/dsl/list_view.rb +6 -6
  34. data/lib/white_gold/dsl/menu_bar.rb +4 -4
  35. data/lib/white_gold/dsl/message_box.rb +3 -3
  36. data/lib/white_gold/dsl/panel.rb +8 -0
  37. data/lib/white_gold/dsl/panel_list_box.rb +12 -3
  38. data/lib/white_gold/dsl/radio_button.rb +15 -2
  39. data/lib/white_gold/dsl/scrollable_panel.rb +7 -0
  40. data/lib/white_gold/dsl/sfml/circle_shape.rb +4 -0
  41. data/lib/white_gold/dsl/sfml/convex_shape.rb +4 -0
  42. data/lib/white_gold/dsl/sfml/rectangle_shape.rb +4 -0
  43. data/lib/white_gold/dsl/sfml/text.rb +4 -0
  44. data/lib/white_gold/dsl/signal/global_signal.rb +1 -1
  45. data/lib/white_gold/dsl/signal/signal.rb +1 -1
  46. data/lib/white_gold/dsl/signal/signal_animation_type.rb +1 -1
  47. data/lib/white_gold/dsl/signal/signal_bool.rb +1 -1
  48. data/lib/white_gold/dsl/signal/signal_color.rb +1 -1
  49. data/lib/white_gold/dsl/signal/signal_float.rb +1 -1
  50. data/lib/white_gold/dsl/signal/signal_int.rb +1 -1
  51. data/lib/white_gold/dsl/signal/signal_pointer.rb +1 -1
  52. data/lib/white_gold/dsl/signal/signal_range.rb +1 -1
  53. data/lib/white_gold/dsl/signal/signal_show_effect.rb +1 -1
  54. data/lib/white_gold/dsl/signal/signal_string.rb +1 -1
  55. data/lib/white_gold/dsl/signal/signal_u_int.rb +1 -1
  56. data/lib/white_gold/dsl/signal/signal_vector2f.rb +1 -1
  57. data/lib/white_gold/dsl/tab_container.rb +2 -2
  58. data/lib/white_gold/dsl/tabs.rb +2 -2
  59. data/lib/white_gold/dsl/theme.rb +2 -2
  60. data/lib/white_gold/dsl/toggle_button.rb +3 -0
  61. data/lib/white_gold/dsl/tree_view.rb +2 -2
  62. data/lib/white_gold/dsl/widget.rb +53 -23
  63. data/lib/white_gold/dsl/window.rb +7 -0
  64. data/lib/white_gold/generated/tgui-abi-loader.gf.rb +76 -1
  65. data/lib/white_gold/library/theme/light.rb +8 -1
  66. data/lib/white_gold/master.rb +30 -10
  67. data/lib/white_gold/path/array.path.rb +16 -0
  68. data/lib/white_gold/tgui-abi.rb +32 -22
  69. data/lib/white_gold/version.rb +1 -1
  70. data/lib/white_gold.rb +3 -1
  71. metadata +6 -3
  72. data/lib/white_gold/abi/reducer.rb +0 -12
@@ -0,0 +1,24 @@
1
+ module Tgui
2
+ Chatbox = ChatBox
3
+ Checkbox = CheckBox
4
+ Combobox = ComboBox
5
+ Editbox = EditBox
6
+ Hlayout = HorizontalLayout
7
+ Hwrap = HorizontalWrap
8
+ Listbox = ListBox
9
+ Listview = ListView
10
+ Menu = MenuBar
11
+ Messagebox = MessageBox
12
+ PanelListbox = PanelListBox
13
+ PanelTabs = TabContainer
14
+ Progressbar = ProgressBar
15
+ FancyLabel = RichTextLabel
16
+ Radio = RadioButton
17
+ RadioGroup = RadioButtonGroup
18
+ Separator = SeparatorLine
19
+ Spinner = SpinButton
20
+ Spinbox = SpinControl
21
+ Textarea = TextArea
22
+ Treeview = TreeView
23
+ Vlayout = VerticalLayout
24
+ end
@@ -10,29 +10,29 @@ module Tgui
10
10
  end
11
11
 
12
12
  def! :rectangle do |**na, &b|
13
- shape = RectangleShape.new.send! **na, &b
13
+ shape = scope! RectangleShape.new, **na, &b
14
14
  host._abi_draw shape
15
15
  end
16
16
 
17
17
  def! :circle do |**na, &b|
18
- shape = CircleShape.new.send! **na, &b
18
+ shape = scope! CircleShape.new, **na, &b
19
19
  host._abi_draw shape
20
20
  end
21
21
 
22
22
  def! :convex do |**na, &b|
23
- shape = ConvexShape.new.send! **na, &b
23
+ shape = scope! ConvexShape.new, **na, &b
24
24
  host._abi_draw shape
25
25
  end
26
26
 
27
27
  def! :text do |**na, &b|
28
- text = Text.new.send! **na, &b
28
+ text = scope! Text.new, **na, &b
29
29
  host._abi_draw text
30
30
  end
31
31
 
32
32
  end
33
33
 
34
34
  def! :draw do |&b|
35
- Draw.new(self, nil).send! &b
35
+ scope! Draw.new(self, nil), &b
36
36
  _abi_display
37
37
  end
38
38
 
@@ -44,7 +44,7 @@ module Tgui
44
44
  _abi_add_line abi_pack_string(text), abi_pack(Color, color), abi_pack(TextStyles, *style)
45
45
  line = Line.new self, objects.size
46
46
  objects << object
47
- line.send! **na, &b
47
+ scope! line, **na, &b
48
48
  end
49
49
 
50
50
  def [](index)
@@ -28,7 +28,7 @@ module Tgui
28
28
  class SignalClosing < Tgui::Signal
29
29
  def block_caller &b
30
30
  Fiddle::Closure::BlockCaller.new(0, [Fiddle::TYPE_VOIDP]) do |ptr|
31
- @widget.send! do
31
+ @widget.host! do
32
32
  b.(ptr, @widget)
33
33
  end
34
34
  end
@@ -8,8 +8,10 @@ module Tgui
8
8
  green: [0, 200, 0, 255],
9
9
  blue: [0, 0, 200, 255],
10
10
  yellow: [200, 200, 0, 255],
11
- white: [200, 200, 200, 255],
12
- black: [0, 0, 0, 255]
11
+ white: [255, 255, 255, 255],
12
+ black: [0, 0, 0, 255],
13
+ gray: [100, 100, 100, 255],
14
+ transparent: [255, 255, 255, 0]
13
15
  }
14
16
 
15
17
  def self.from *arg
@@ -37,7 +37,7 @@ module Tgui
37
37
  def block_caller &b
38
38
  Fiddle::Closure::BlockCaller.new(0, [Fiddle::TYPE_VOIDP, Fiddle::TYPE_VOIDP]) do |str1, str2|
39
39
  id = @widget.abi_unpack_string(str2)
40
- @widget.send! do
40
+ @widget.host! do
41
41
  b.(@widget.self_get_object_by_id(id), @widget)
42
42
  end
43
43
  end
@@ -99,7 +99,7 @@ module Tgui
99
99
  _abi_add_item abi_pack_string(text), abi_pack_string(id)
100
100
  item = Item.new self, id
101
101
  self_objects[id] = object
102
- item.send! **na, &b
102
+ scope! item, **na, &b
103
103
  end
104
104
 
105
105
  def selected
@@ -12,7 +12,7 @@ module Tgui
12
12
  return widgets
13
13
  end
14
14
 
15
- abi_def :add, [Object, String] => nil
15
+ abi_def :self_add, :add, [Object, String] => nil
16
16
  abi_def :remove_all
17
17
  abi_def :inner_size, :get_, nil => Vector2f
18
18
  abi_def :child_offset, :get_, nil => Vector2f
@@ -0,0 +1,28 @@
1
+ require_relative 'widget'
2
+
3
+ module Tgui
4
+ class CustomWidget < Widget
5
+
6
+ api_attr :callbacks do
7
+ {}
8
+ end
9
+
10
+ def self_key_press=(value)
11
+ block_caller = Fiddle::Closure::BlockCaller.new(0, [Fiddle::TYPE_INT, Fiddle::TYPE_INT, Fiddle::TYPE_INT, Fiddle::TYPE_INT], &value)
12
+ _abi_impl_key_pressed block_caller
13
+ self.callbacks[:self_key_press] = block_caller
14
+ end
15
+
16
+ def self_can_gain_focus=(value)
17
+ block_caller = Fiddle::Closure::BlockCaller.new(Fiddle::TYPE_INT, [0], &value)
18
+ _abi_impl_can_gain_focus block_caller
19
+ self.callbacks[:self_can_gain_focus] = block_caller
20
+ end
21
+
22
+ def self_focus_changed=(value)
23
+ block_caller = Fiddle::Closure::BlockCaller.new(0, [Fiddle::TYPE_INT], &value)
24
+ _abi_impl_focus_changed block_caller
25
+ self.callbacks[:self_focus_changed] = block_caller
26
+ end
27
+ end
28
+ end
@@ -27,23 +27,47 @@ module Tgui
27
27
  abi_unpack(Outline, _abi_get_widget_padding(w))
28
28
  end
29
29
 
30
- abi_enum "Alignment", :center, :upper_left, :up, :upper_right, :right, :bottom_right, :bottom, :bottom_left, :left,
31
- top_left: :upper_left, left_top: :upper_left,
32
- top_right: :upper_right, right_top: :upper_right,
33
- right_bottom: :bottom_right, left_bottom: :bottom_left
30
+ abi_enum "Alignment", :center, :top_left, :top, :top_right, :right, :bottom_right, :bottom, :bottom_left, :left,
31
+ left_top: :top_left, right_top: :upper_right, right_bottom: :bottom_right, left_bottom: :bottom_left
32
+
33
+ abi_packer Alignment do |*arg|
34
+ case arg.size
35
+ when 1
36
+ o = arg.first
37
+ when 2
38
+ a = case arg[0]
39
+ when :begin then :left
40
+ when :end then :right
41
+ else arg[0]
42
+ end
43
+ b = case arg[1]
44
+ when :begin then :top
45
+ when :end then :bottom
46
+ else arg[1]
47
+ end
48
+ o = if a == :center && b == :center
49
+ :center
50
+ elsif a == :center
51
+ b
52
+ elsif b == :center
53
+ a
54
+ else
55
+ "#{a}_#{b}".to_sym
56
+ end
57
+ else raise "Unsupported argument #{arg}"
58
+ end
59
+ Alignment.sym_to_i o
60
+ end
34
61
 
35
62
  api_child :alignment= do |w, alignment|
36
- _abi_set_widget_alignment w, abi_pack(Alignment, alignment)
63
+ p abi_pack(Alignment, *alignment)
64
+ _abi_set_widget_alignment w, abi_pack(Alignment, *alignment)
37
65
  end
38
66
 
39
67
  api_child :alignment do |w|
40
68
  abi_unpack(Alignment, _abi_get_widget_alignment(w))
41
69
  end
42
70
 
43
- api_child :alignment do |w|
44
- Alignment[_abi_get_widget_alignment]
45
- end
46
-
47
71
  api_child :cell= do |w, cell|
48
72
  _abi_set_widget_cell w, abi_pack_integer(cell[0]), abi_pack_integer(cell[1])
49
73
  end
@@ -82,7 +106,7 @@ module Tgui
82
106
  return widgets
83
107
  end
84
108
 
85
- def add widget, id
109
+ def self_add widget, id
86
110
  super
87
111
  _abi_set_widget_cell abi_pack(Widget, widget), *cell
88
112
  _abi_set_widget_alignment abi_pack(Widget, widget), abi_pack(Alignment, alignment) if alignment
@@ -9,8 +9,17 @@ module Tgui
9
9
  abi_def :self_active?, :is_active, nil => Boolean
10
10
  abi_def :self_poll_events, :poll_events
11
11
  abi_def :self_draw, :draw
12
- abi_def :clear_color=, Color => nil
12
+ abi_def :background_color=, :set_clear_color, Color => nil
13
13
  abi_attr :clipboard, String
14
+ abi_def :screen_size, :get_, nil => Vector2u
15
+
16
+ attr_accessor :page
17
+
18
+ def! :messagebox do |*a, **na, &b|
19
+ messagebox = MessageBox.new
20
+ @page.send! :add, messagebox
21
+ @page.scope! messagebox, *a, **na, &b
22
+ end
14
23
 
15
24
  end
16
25
  end
@@ -26,6 +26,9 @@ module Tgui
26
26
  abi_def :ignore_mouse_events?, :ignoring_mouse_events, nil => Boolean
27
27
  abi_enum "HorizontalAlignment", :left, :center, :right
28
28
  abi_attr :horizontal_alignment, HorizontalAlignment
29
+ def alignment=(a)
30
+ self.horizontal_alignment = a
31
+ end
29
32
  abi_enum "VerticalAlignment", :top, :center, :bottom
30
33
  abi_attr :vertical_alignment, VerticalAlignment
31
34
  abi_enum Scrollbar::Policy
@@ -29,7 +29,7 @@ module Tgui
29
29
  def block_caller &b
30
30
  Fiddle::Closure::BlockCaller.new(0, [Fiddle::TYPE_VOIDP, Fiddle::TYPE_VOIDP]) do |str1, str2|
31
31
  id = @widget.abi_unpack_string(str2)
32
- @widget.send! do
32
+ @widget.host! do
33
33
  b.(@widget.self_get_object_by_id(id), @widget)
34
34
  end
35
35
  end
@@ -80,7 +80,7 @@ module Tgui
80
80
  _abi_add_item abi_pack_string(text), abi_pack_string(id)
81
81
  item = Item.new self, id
82
82
  na[:object] ||= object
83
- item.send! **na, &b
83
+ scope! item, **na, &b
84
84
  end
85
85
 
86
86
  def remove_all
@@ -31,7 +31,7 @@ module Tgui
31
31
  class ListViewItemSignal < Tgui::SignalInt
32
32
  def block_caller &b
33
33
  Fiddle::Closure::BlockCaller.new(0, [Fiddle::TYPE_INT]) do |index|
34
- @widget.send! do
34
+ @widget.host! do
35
35
  b.(@widget.self_objects[index], @widget)
36
36
  end
37
37
  end
@@ -41,7 +41,7 @@ module Tgui
41
41
  class ListViewColumnSignal < Tgui::SignalInt
42
42
  def block_caller &b
43
43
  Fiddle::Closure::BlockCaller.new(0, [Fiddle::TYPE_INT]) do |index|
44
- @widget.send! do
44
+ @widget.host! do
45
45
  b.(@widget.columns[index], @widget)
46
46
  end
47
47
  end
@@ -93,14 +93,14 @@ module Tgui
93
93
  index = _abi_add_column
94
94
  column = Column.new self, index
95
95
  columns << column
96
- column.send! **na, &b
96
+ scope! column, **na, &b
97
97
  end
98
98
 
99
99
  def! :item do |object, **na, &b|
100
100
  self_add_object object, na[:index]
101
101
  item = Item.new self, object
102
102
  na.delete :index
103
- item.send! **na, &b
103
+ scope! item, **na, &b
104
104
  end
105
105
 
106
106
  def items=(items)
@@ -173,7 +173,7 @@ module Tgui
173
173
 
174
174
  def! :grid_lines do | **na, &b|
175
175
  lines = GridLines.new self
176
- lines.send! **na, &b
176
+ scope! lines, **na, &b
177
177
  end
178
178
 
179
179
  def grid_lines=(grid_lines)
@@ -199,7 +199,7 @@ module Tgui
199
199
 
200
200
  def! :header do |**na, &b|
201
201
  header = Header.new self
202
- header.send! **na, &b
202
+ scope! header, **na, &b
203
203
  end
204
204
 
205
205
  def header=(header)
@@ -30,7 +30,7 @@ module Tgui
30
30
 
31
31
  def connect &b
32
32
  on_press = Fiddle::Closure::BlockCaller.new(0, [0]) do
33
- @menu_bar.send! do
33
+ @menu_bar.host! do
34
34
  b.(@path.last, @path, @menu_bar)
35
35
  end
36
36
  end
@@ -57,7 +57,7 @@ module Tgui
57
57
  end
58
58
  SignalItemHierarchy.fetch_path vector, loader
59
59
  object_path = @widget.self_object_path path
60
- @widget.send! do
60
+ @widget.host! do
61
61
  b.(object_path.last, object_path, @widget)
62
62
  end
63
63
  end
@@ -79,7 +79,7 @@ module Tgui
79
79
  host._abi_add_menu_item _1, _2
80
80
  end
81
81
  item = Item.new host, item_path
82
- item.send! **na, &b
82
+ scope! item, **na, &b
83
83
  end
84
84
 
85
85
  def! :separator do
@@ -165,7 +165,7 @@ module Tgui
165
165
  self_tree[object, grow: true].text = text
166
166
  _abi_add_menu abi_pack_string(text)
167
167
  item = Menu.new self, object
168
- item.send! **na, &b
168
+ scope! item, **na, &b
169
169
  end
170
170
 
171
171
  def items=(items)
@@ -37,7 +37,7 @@ module Tgui
37
37
  end
38
38
 
39
39
  def press_signal_execute
40
- host.send! do
40
+ host.host! do
41
41
  @on_press_callbacks.each do |c|
42
42
  c.(id, self, host)
43
43
  end
@@ -52,7 +52,7 @@ module Tgui
52
52
  _abi_add_button abi_pack_string(text)
53
53
  button = Button.new self, object
54
54
  self_buttons[text] = button
55
- button.send! **na, &b
55
+ scope! button, **na, &b
56
56
  end
57
57
 
58
58
  def [](object)
@@ -73,7 +73,7 @@ module Tgui
73
73
  self_buttons[text] = button
74
74
  text
75
75
  end
76
- self_change_buttons names
76
+ self_change_buttons *names
77
77
  end
78
78
 
79
79
  def buttons
@@ -4,6 +4,14 @@ require_relative 'signal/signal_vector2f'
4
4
  module Tgui
5
5
  class Panel < Group
6
6
 
7
+ class Theme < Group::Theme
8
+ theme_attr :borders, :outline
9
+ theme_attr :border_color, :color
10
+ theme_attr :background_color, :color
11
+ theme_attr :texture_background, :texture
12
+ theme_attr :rounded_border_radius, :float
13
+ end
14
+
7
15
  abi_signal :on_mouse_press, SignalVector2f
8
16
  abi_signal :on_mouse_release, SignalVector2f
9
17
  abi_signal :on_click, SignalVector2f
@@ -5,10 +5,19 @@ require_relative 'signal/signal_panel_list_box_item'
5
5
  module Tgui
6
6
  class PanelListBox < ScrollablePanel
7
7
 
8
+ class Theme < ScrollablePanel::Theme
9
+
10
+ theme_attr :items_background_color, :color
11
+ theme_attr :items_background_color_hover, :color
12
+ theme_attr :selected_items_background_color, :color
13
+ theme_attr :selected_items_background_color_hover, :color
14
+
15
+ end
16
+
8
17
  class SignalPanelListBoxItem < Tgui::SignalPanelListBoxItem
9
18
  def block_caller &b
10
19
  Fiddle::Closure::BlockCaller.new(0, [Fiddle::TYPE_VOIDP]) do |id|
11
- @widget.send! do
20
+ @widget.host! do
12
21
  b.(@widget.self_objects.key(@widget.abi_unpack_string(id)), @widget)
13
22
  end
14
23
  end
@@ -22,7 +31,7 @@ module Tgui
22
31
  panel = Panel.new pointer: _abi_add_item(id, abi_pack_integer(index))
23
32
  panel.page = page
24
33
  self_objects[object] = id
25
- panel.send! **na, &b
34
+ scope! panel, **na, &b
26
35
  end
27
36
 
28
37
  def [](object)
@@ -71,7 +80,7 @@ module Tgui
71
80
  def! :template do |**na, &b|
72
81
  panel = Panel.new(pointer: _abi_get_panel_template)
73
82
  panel.page = page
74
- panel.send! **na, &b
83
+ scope! panel, **na, &b
75
84
  end
76
85
 
77
86
  # internal
@@ -28,6 +28,10 @@ module Tgui
28
28
  theme_attr :text_style, :text_styles
29
29
  theme_attr :text_style_checked, :text_styles
30
30
  end
31
+
32
+ api_attr :format do
33
+ :to_s
34
+ end
31
35
 
32
36
  abi_attr :checked?
33
37
  abi_attr :text, String
@@ -35,9 +39,18 @@ module Tgui
35
39
  abi_signal :on_check, Signal
36
40
  abi_signal :on_uncheck, Signal
37
41
  abi_signal :on_change, SignalBoolean
38
- api_attr :object do
42
+
43
+ def object
44
+ self_object
45
+ end
46
+
47
+ def object=(object)
48
+ self.self_object = object
49
+ self.text = object.then(&format)
50
+ end
51
+
52
+ api_attr :self_object do
39
53
  nil
40
54
  end
41
-
42
55
  end
43
56
  end
@@ -5,6 +5,13 @@ require_relative 'scrollbar'
5
5
  module Tgui
6
6
  class ScrollablePanel < Panel
7
7
 
8
+ class Theme < Panel::Theme
9
+
10
+ theme_comp :scrollbar, Tgui::Scrollbar::Theme
11
+ theme_attr :scrollbar_width, :float
12
+
13
+ end
14
+
8
15
  abi_attr :content_size, Vector2f
9
16
  abi_def :content_offset, :get_, nil => Vector2f
10
17
  abi_def :scrollbar_width, :get_, nil => Float
@@ -3,5 +3,9 @@ require_relative 'shape'
3
3
  module Tgui
4
4
  class CircleShape < Shape
5
5
  abi_attr :radius, Float
6
+
7
+ def self.finalizer pointer
8
+ _abi_delete pointer
9
+ end
6
10
  end
7
11
  end
@@ -11,5 +11,9 @@ module Tgui
11
11
  _abi_set_point @point_count, *abi_pack(Vector2f, x, y)
12
12
  @point_count += 1
13
13
  end
14
+
15
+ def self.finalizer pointer
16
+ _abi_delete pointer
17
+ end
14
18
  end
15
19
  end
@@ -3,5 +3,9 @@ require_relative 'shape'
3
3
  module Tgui
4
4
  class RectangleShape < Shape
5
5
  abi_attr :size, Vector2f
6
+
7
+ def self.finalizer pointer
8
+ _abi_delete pointer
9
+ end
6
10
  end
7
11
  end
@@ -18,5 +18,9 @@ module Tgui
18
18
  abi_attr :rotation, Float
19
19
  abi_attr :scale, Vector2f
20
20
  abi_attr :origin, Vector2f
21
+
22
+ def self.finalizer pointer
23
+ _abi_delete pointer
24
+ end
21
25
  end
22
26
  end
@@ -6,7 +6,7 @@ module Tgui
6
6
 
7
7
  def block_caller &b
8
8
  Fiddle::Closure::BlockCaller.new(0, [0]) do
9
- @widget.send! do
9
+ @widget.host! do
10
10
  b.(@widget)
11
11
  end
12
12
  end
@@ -10,7 +10,7 @@ module Tgui
10
10
 
11
11
  def block_caller &b
12
12
  Fiddle::Closure::BlockCaller.new(0, [0]) do
13
- @widget.send! do
13
+ @widget.host! do
14
14
  b.(@widget)
15
15
  end
16
16
  end
@@ -6,7 +6,7 @@ module Tgui
6
6
  def block_caller
7
7
  block_caller = Fiddle::Closure::BlockCaller.new(0, [Fiddle::TYPE_INT]) do |animation_type|
8
8
  at = @widget.abi_unpack AnimationType, animation_type
9
- @widget.send! do
9
+ @widget.host! do
10
10
  b.(at, @widget)
11
11
  end
12
12
  end
@@ -6,7 +6,7 @@ module Tgui
6
6
  def block_caller &b
7
7
  Fiddle::Closure::BlockCaller.new(0, [Fiddle::TYPE_INT]) do |int|
8
8
  b = @widget.abi_unpack Boolean, int
9
- @widget.send! do
9
+ @widget.host! do
10
10
  b.(b, @widget)
11
11
  end
12
12
  end
@@ -6,7 +6,7 @@ module Tgui
6
6
  def block_caller &b
7
7
  Fiddle::Closure::BlockCaller.new(0, [Fiddle::TYPE_VOIDP]) do |ptr|
8
8
  c = @widget.abi_unpack Color, ptr
9
- @widget.send! do
9
+ @widget.host! do
10
10
  b.(c, @widget)
11
11
  end
12
12
  end
@@ -6,7 +6,7 @@ module Tgui
6
6
  def block_caller &b
7
7
  Fiddle::Closure::BlockCaller.new(0, [Fiddle::TYPE_FLOAT]) do |float|
8
8
  f = @widget.abi_unpack_float float
9
- @widget.send! do
9
+ @widget.host! do
10
10
  b.(f, @widget)
11
11
  end
12
12
  end
@@ -6,7 +6,7 @@ module Tgui
6
6
  def block_caller &b
7
7
  Fiddle::Closure::BlockCaller.new(0, [Fiddle::TYPE_VOIDP]) do |int|
8
8
  i = @widget.abi_unpack_integer int
9
- @widget.send! do
9
+ @widget.host! do
10
10
  b.(i, @widget)
11
11
  end
12
12
  end
@@ -5,7 +5,7 @@ module Tgui
5
5
 
6
6
  def block_caller &b
7
7
  Fiddle::Closure::BlockCaller.new(0, [Fiddle::TYPE_VOIDP]) do |pointer|
8
- @widget.send! do
8
+ @widget.host! do
9
9
  b.(pointer, @widget)
10
10
  end
11
11
  end
@@ -5,7 +5,7 @@ module Tgui
5
5
 
6
6
  def block_caller &b
7
7
  Fiddle::Closure::BlockCaller.new(0, [Fiddle::TYPE_FLOAT, Fiddle::TYPE_FLOAT]) do |min, max|
8
- @widget.send! do
8
+ @widget.host! do
9
9
  b.(min..max, @widget)
10
10
  end
11
11
  end
@@ -7,7 +7,7 @@ module Tgui
7
7
  Fiddle::Closure::BlockCaller.new(0, [Fiddle::TYPE_INT, Fiddle::TYPE_INT]) do |show_effect_type, shown|
8
8
  effect_type = @widget.abi_unpack ShowEffectType, show_effect_type
9
9
  shown = @widget.abi_unpack Boolean, shown
10
- @widget.send! do
10
+ @widget.host! do
11
11
  b.(effect_type, shown, @widget)
12
12
  end
13
13
  end
@@ -6,7 +6,7 @@ module Tgui
6
6
  def block_caller &b
7
7
  Fiddle::Closure::BlockCaller.new(0, [Fiddle::TYPE_VOIDP]) do |str|
8
8
  string = @widget.abi_unpack_string(str)
9
- @widget.send! do
9
+ @widget.host! do
10
10
  b.(string, @widget)
11
11
  end
12
12
  end
@@ -6,7 +6,7 @@ module Tgui
6
6
  def block_caller &b
7
7
  Fiddle::Closure::BlockCaller.new(0, [Fiddle::TYPE_INT]) do |uint|
8
8
  int = @widget.abi_unpack Integer, uint
9
- @widget.send! do
9
+ @widget.host! do
10
10
  b.(int, @widget)
11
11
  end
12
12
  end
@@ -5,7 +5,7 @@ module Tgui
5
5
  def block_caller &b
6
6
  Fiddle::Closure::BlockCaller.new(0, [Fiddle::TYPE_VOIDP]) do |ptr|
7
7
  vector = @widget.abi_unpack Vector2f, ptr
8
- @widget.send! do
8
+ @widget.host! do
9
9
  b.(vector, @widget)
10
10
  end
11
11
  end