white_gold 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (154) hide show
  1. checksums.yaml +7 -0
  2. data/ext/dll/openal32.dll +0 -0
  3. data/ext/dll/sfml-audio-2.dll +0 -0
  4. data/ext/dll/sfml-graphics-2.dll +0 -0
  5. data/ext/dll/sfml-network-2.dll +0 -0
  6. data/ext/dll/sfml-system-2.dll +0 -0
  7. data/ext/dll/sfml-window-2.dll +0 -0
  8. data/ext/dll/tgui.dll +0 -0
  9. data/ext/so/libsfml-audio.so +0 -0
  10. data/ext/so/libsfml-graphics.so +0 -0
  11. data/ext/so/libsfml-network.so +0 -0
  12. data/ext/so/libsfml-system.so +0 -0
  13. data/ext/so/libsfml-window.so +0 -0
  14. data/ext/so/libtgui.so +0 -0
  15. data/lib/white_gold/abi/alias.rb +50 -0
  16. data/lib/white_gold/abi/enum.rb +43 -0
  17. data/lib/white_gold/abi/extern_object.rb +180 -0
  18. data/lib/white_gold/abi/interface/interface.rb +114 -0
  19. data/lib/white_gold/abi/interface/interface_collection_out.rb +29 -0
  20. data/lib/white_gold/abi/interface/interface_composed_out.rb +28 -0
  21. data/lib/white_gold/abi/interface/interface_single_out.rb +19 -0
  22. data/lib/white_gold/abi/packer.rb +28 -0
  23. data/lib/white_gold/abi/reducer.rb +12 -0
  24. data/lib/white_gold/abi/unpacker.rb +27 -0
  25. data/lib/white_gold/convention/api_child.rb +30 -0
  26. data/lib/white_gold/convention/bang_def.rb +5 -0
  27. data/lib/white_gold/convention/bang_nest.rb +16 -0
  28. data/lib/white_gold/convention/bang_nested_caller.rb +48 -0
  29. data/lib/white_gold/convention/bool_property.rb +13 -0
  30. data/lib/white_gold/convention/boolean.rb +2 -0
  31. data/lib/white_gold/convention/club.rb +26 -0
  32. data/lib/white_gold/convention/container_widgets.rb +181 -0
  33. data/lib/white_gold/convention/page.rb +96 -0
  34. data/lib/white_gold/convention/proc_method_factory.rb +22 -0
  35. data/lib/white_gold/convention/unit.rb +22 -0
  36. data/lib/white_gold/convention/widget_like.rb +146 -0
  37. data/lib/white_gold/dsl/backend_gui.rb +37 -0
  38. data/lib/white_gold/dsl/bitmap_button.rb +11 -0
  39. data/lib/white_gold/dsl/box_layout.rb +47 -0
  40. data/lib/white_gold/dsl/box_layout_ratios.rb +13 -0
  41. data/lib/white_gold/dsl/button.rb +10 -0
  42. data/lib/white_gold/dsl/button_base.rb +18 -0
  43. data/lib/white_gold/dsl/chat_box.rb +65 -0
  44. data/lib/white_gold/dsl/checkbox.rb +6 -0
  45. data/lib/white_gold/dsl/child_window.rb +47 -0
  46. data/lib/white_gold/dsl/clickable_widget.rb +15 -0
  47. data/lib/white_gold/dsl/color.rb +124 -0
  48. data/lib/white_gold/dsl/color_picker.rb +12 -0
  49. data/lib/white_gold/dsl/combo_box.rb +135 -0
  50. data/lib/white_gold/dsl/container.rb +95 -0
  51. data/lib/white_gold/dsl/edit_box.rb +38 -0
  52. data/lib/white_gold/dsl/file_dialog.rb +86 -0
  53. data/lib/white_gold/dsl/font.rb +23 -0
  54. data/lib/white_gold/dsl/grid.rb +131 -0
  55. data/lib/white_gold/dsl/group.rb +6 -0
  56. data/lib/white_gold/dsl/gui.rb +16 -0
  57. data/lib/white_gold/dsl/horizontal_layout.rb +6 -0
  58. data/lib/white_gold/dsl/horizontal_wrap.rb +6 -0
  59. data/lib/white_gold/dsl/knob.rb +16 -0
  60. data/lib/white_gold/dsl/label.rb +21 -0
  61. data/lib/white_gold/dsl/list_box.rb +125 -0
  62. data/lib/white_gold/dsl/list_view.rb +239 -0
  63. data/lib/white_gold/dsl/menu_bar.rb +252 -0
  64. data/lib/white_gold/dsl/message_box.rb +90 -0
  65. data/lib/white_gold/dsl/outline.rb +52 -0
  66. data/lib/white_gold/dsl/panel.rb +16 -0
  67. data/lib/white_gold/dsl/panel_list_box.rb +83 -0
  68. data/lib/white_gold/dsl/picture.rb +12 -0
  69. data/lib/white_gold/dsl/progress_bar.rb +19 -0
  70. data/lib/white_gold/dsl/radio_button.rb +18 -0
  71. data/lib/white_gold/dsl/radio_button_group.rb +14 -0
  72. data/lib/white_gold/dsl/range_slider.rb +15 -0
  73. data/lib/white_gold/dsl/rich_text_label.rb +6 -0
  74. data/lib/white_gold/dsl/scrollable_panel.rb +53 -0
  75. data/lib/white_gold/dsl/scrollbar.rb +28 -0
  76. data/lib/white_gold/dsl/separator_line.rb +6 -0
  77. data/lib/white_gold/dsl/signal/global_signal.rb +33 -0
  78. data/lib/white_gold/dsl/signal/signal.rb +44 -0
  79. data/lib/white_gold/dsl/signal/signal_animation_type.rb +16 -0
  80. data/lib/white_gold/dsl/signal/signal_bool.rb +16 -0
  81. data/lib/white_gold/dsl/signal/signal_color.rb +16 -0
  82. data/lib/white_gold/dsl/signal/signal_float.rb +16 -0
  83. data/lib/white_gold/dsl/signal/signal_int.rb +16 -0
  84. data/lib/white_gold/dsl/signal/signal_item.rb +6 -0
  85. data/lib/white_gold/dsl/signal/signal_item_hierarchy.rb +9 -0
  86. data/lib/white_gold/dsl/signal/signal_panel_list_box_item.rb +7 -0
  87. data/lib/white_gold/dsl/signal/signal_pointer.rb +15 -0
  88. data/lib/white_gold/dsl/signal/signal_range.rb +15 -0
  89. data/lib/white_gold/dsl/signal/signal_show_effect.rb +17 -0
  90. data/lib/white_gold/dsl/signal/signal_string.rb +16 -0
  91. data/lib/white_gold/dsl/signal/signal_typed_int_bool_ptr.rb +15 -0
  92. data/lib/white_gold/dsl/signal/signal_typed_size_t.rb +6 -0
  93. data/lib/white_gold/dsl/signal/signal_u_int.rb +16 -0
  94. data/lib/white_gold/dsl/signal/signal_vector2f.rb +14 -0
  95. data/lib/white_gold/dsl/slider.rb +26 -0
  96. data/lib/white_gold/dsl/spin_button.rb +24 -0
  97. data/lib/white_gold/dsl/spin_control.rb +15 -0
  98. data/lib/white_gold/dsl/subwidget_container.rb +9 -0
  99. data/lib/white_gold/dsl/tab_container.rb +121 -0
  100. data/lib/white_gold/dsl/tabs.rb +91 -0
  101. data/lib/white_gold/dsl/text_area.rb +34 -0
  102. data/lib/white_gold/dsl/texture.rb +53 -0
  103. data/lib/white_gold/dsl/theme/boolean_attribute.rb +13 -0
  104. data/lib/white_gold/dsl/theme/button_theme.rb +19 -0
  105. data/lib/white_gold/dsl/theme/chat_box_theme.rb +16 -0
  106. data/lib/white_gold/dsl/theme/child_window_theme.rb +25 -0
  107. data/lib/white_gold/dsl/theme/color_attribute.rb +13 -0
  108. data/lib/white_gold/dsl/theme/color_picker_theme.rb +14 -0
  109. data/lib/white_gold/dsl/theme/combo_box_theme.rb +33 -0
  110. data/lib/white_gold/dsl/theme/common_renderer.rb +7 -0
  111. data/lib/white_gold/dsl/theme/edit_box_theme.rb +34 -0
  112. data/lib/white_gold/dsl/theme/file_dialog_theme.rb +22 -0
  113. data/lib/white_gold/dsl/theme/float_attribute.rb +13 -0
  114. data/lib/white_gold/dsl/theme/group_theme.rb +9 -0
  115. data/lib/white_gold/dsl/theme/knob_theme.rb +15 -0
  116. data/lib/white_gold/dsl/theme/label_theme.rb +20 -0
  117. data/lib/white_gold/dsl/theme/list_box_theme.rb +25 -0
  118. data/lib/white_gold/dsl/theme/list_view_theme.rb +27 -0
  119. data/lib/white_gold/dsl/theme/menu_bar_theme.rb +21 -0
  120. data/lib/white_gold/dsl/theme/message_box_theme.rb +11 -0
  121. data/lib/white_gold/dsl/theme/outline_attribute.rb +13 -0
  122. data/lib/white_gold/dsl/theme/progress_bar_theme.rb +19 -0
  123. data/lib/white_gold/dsl/theme/radio_button_theme.rb +30 -0
  124. data/lib/white_gold/dsl/theme/scrollbar_theme.rb +24 -0
  125. data/lib/white_gold/dsl/theme/separator_line_theme.rb +9 -0
  126. data/lib/white_gold/dsl/theme/slider_theme.rb +20 -0
  127. data/lib/white_gold/dsl/theme/spin_button_theme.rb +19 -0
  128. data/lib/white_gold/dsl/theme/tabs_theme.rb +29 -0
  129. data/lib/white_gold/dsl/theme/text_area_theme.rb +22 -0
  130. data/lib/white_gold/dsl/theme/text_styles_attribute.rb +13 -0
  131. data/lib/white_gold/dsl/theme/texture_attribute.rb +17 -0
  132. data/lib/white_gold/dsl/theme/theme_attributed.rb +51 -0
  133. data/lib/white_gold/dsl/theme/theme_component.rb +23 -0
  134. data/lib/white_gold/dsl/theme/tree_view_theme.rb +26 -0
  135. data/lib/white_gold/dsl/theme/widget_theme.rb +12 -0
  136. data/lib/white_gold/dsl/theme.rb +144 -0
  137. data/lib/white_gold/dsl/toggle_button.rb +10 -0
  138. data/lib/white_gold/dsl/tool_tip.rb +21 -0
  139. data/lib/white_gold/dsl/tree_view.rb +186 -0
  140. data/lib/white_gold/dsl/util.rb +17 -0
  141. data/lib/white_gold/dsl/vertical_layout.rb +6 -0
  142. data/lib/white_gold/dsl/widget.rb +279 -0
  143. data/lib/white_gold/dsl/window.rb +16 -0
  144. data/lib/white_gold/generated/tgui-abi-loader.gf.rb +1813 -0
  145. data/lib/white_gold/library/theme/light.rb +111 -0
  146. data/lib/white_gold/master.rb +170 -0
  147. data/lib/white_gold/path/kernel.path.rb +3 -0
  148. data/lib/white_gold/path/numeric.path.rb +9 -0
  149. data/lib/white_gold/path/object.path.rb +22 -0
  150. data/lib/white_gold/path/string.path.rb +5 -0
  151. data/lib/white_gold/tgui-abi.rb +255 -0
  152. data/lib/white_gold/tgui-config.rb +20 -0
  153. data/lib/white_gold.rb +47 -0
  154. metadata +209 -0
@@ -0,0 +1,19 @@
1
+ require_relative 'widget_theme'
2
+
3
+ module Tgui
4
+ class ButtonTheme < WidgetTheme
5
+
6
+ theme_attr :borders, :outline
7
+ [ '', :_down, :_hover, :_down_hover, :_disabled, :_down_disabled, :_focused, :_down_focused ].each do |v|
8
+ theme_attr "text_color#{v}".to_sym, :color
9
+ theme_attr "background_color#{v}".to_sym, :color
10
+ theme_attr "border_color#{v}".to_sym, :color
11
+ theme_attr "texture#{v}".to_sym, :texture
12
+ theme_attr "text_style#{v}".to_sym, :text_styles
13
+ end
14
+ theme_attr :text_outline_color, :color
15
+ theme_attr :text_outline_thickness, :float
16
+ theme_attr :rounded_border_radius, :float
17
+
18
+ end
19
+ end
@@ -0,0 +1,16 @@
1
+ require_relative 'widget_theme'
2
+ require_relative 'scrollbar_theme'
3
+
4
+ module Tgui
5
+ class ChatBoxTheme < WidgetTheme
6
+
7
+ theme_attr :borders, :outline
8
+ theme_attr :padding, :outline
9
+ theme_attr :background_color, :color
10
+ theme_attr :border_color, :color
11
+ theme_attr :texture_background, :texture
12
+ theme_comp :scrollbar, ScrollbarTheme
13
+ theme_attr :scrollbar_width, :float
14
+
15
+ end
16
+ end
@@ -0,0 +1,25 @@
1
+ require_relative 'widget_theme'
2
+
3
+ module Tgui
4
+ class ChildWindowTheme < WidgetTheme
5
+
6
+ theme_attr :borders, :outline
7
+ theme_attr :title_bar_height, :float
8
+ theme_attr :title_bar_color, :color
9
+ theme_attr :title_color, :color
10
+ theme_attr :background_color, :color
11
+ theme_attr :border_color, :color
12
+ theme_attr :border_color_focused, :color
13
+ theme_attr :border_below_title_bar, :float
14
+ theme_attr :distance_to_side, :float
15
+ theme_attr :padding_between_buttons, :float
16
+ theme_attr :minimum_resizable_border_width, :float
17
+ theme_attr :show_text_on_title_buttons, :boolean
18
+ theme_attr :texture_title_bar, :texture
19
+ theme_attr :texture_background, :texture
20
+ theme_comp :close_button, ButtonTheme
21
+ theme_comp :maximize_button, ButtonTheme
22
+ theme_comp :minimize_button, ButtonTheme
23
+
24
+ end
25
+ end
@@ -0,0 +1,13 @@
1
+ class ColorAttribute
2
+ def initialize name, value
3
+ @name = name
4
+ @value = Color.from *value
5
+ end
6
+
7
+ attr :name
8
+ attr :value
9
+
10
+ def to_theme
11
+ "#{name} = #{value.to_s};"
12
+ end
13
+ end
@@ -0,0 +1,14 @@
1
+ require_relative 'widget_theme'
2
+ require_relative 'button_theme'
3
+ require_relative 'label_theme'
4
+ require_relative 'slider_theme'
5
+
6
+ module Tgui
7
+ class ColorPickerTheme < WidgetTheme
8
+
9
+ theme_comp :button, ButtonTheme
10
+ theme_comp :label, LabelTheme
11
+ theme_comp :slider, SliderTheme
12
+
13
+ end
14
+ end
@@ -0,0 +1,33 @@
1
+ require_relative 'widget_theme'
2
+ require_relative 'list_box_theme'
3
+
4
+ module Tgui
5
+ class ComboBoxTheme < WidgetTheme
6
+
7
+ theme_attr :borders, :outline
8
+ theme_attr :padding, :outline
9
+ theme_attr :text_style, :text_styles
10
+ theme_attr :default_text_style, :text_styles
11
+ theme_attr :background_color, :color
12
+ theme_attr :background_color_disabled, :color
13
+ theme_attr :text_color, :color
14
+ theme_attr :text_color_disabled, :color
15
+ theme_attr :default_text_color, :color
16
+ theme_attr :arrow_background_color, :color
17
+ theme_attr :arrow_background_color_disabled, :color
18
+ theme_attr :arrow_background_color_hover, :color
19
+ theme_attr :arrow_color, :color
20
+ theme_attr :arrow_color_hover, :color
21
+ theme_attr :arrow_color_disabled, :color
22
+ theme_attr :texture_background, :texture
23
+ theme_attr :texture_background_disabled, :texture
24
+ theme_attr :border_color, :color
25
+ theme_attr :texture_background, :texture
26
+ theme_attr :texture_background_disabled, :texture
27
+ theme_attr :texture_arrow, :texture
28
+ theme_attr :texture_arrow_hover, :texture
29
+ theme_attr :texture_arrow_disabled, :texture
30
+ theme_comp :list_box, ListBoxTheme
31
+
32
+ end
33
+ end
@@ -0,0 +1,7 @@
1
+ class CommonRenderer
2
+ include BangNest
3
+
4
+ def initialize widget
5
+ @widget = widget
6
+ end
7
+ end
@@ -0,0 +1,34 @@
1
+ require_relative 'widget_theme'
2
+
3
+ module Tgui
4
+ class EditBoxTheme < WidgetTheme
5
+
6
+ theme_attr :text_style, :text_styles
7
+ theme_attr :default_text_style, :text_styles
8
+ theme_attr :borders, :outline
9
+ theme_attr :padding, :outline
10
+ theme_attr :caret_width, :float
11
+ theme_attr :text_color, :color
12
+ theme_attr :text_color_disabled, :color
13
+ theme_attr :text_color_focused, :color
14
+ theme_attr :selected_text_color, :color
15
+ theme_attr :selected_text_background_color, :color
16
+ theme_attr :default_text_color, :color
17
+ theme_attr :background_color, :color
18
+ theme_attr :background_color_hover, :color
19
+ theme_attr :background_color_disabled, :color
20
+ theme_attr :background_color_focused, :color
21
+ theme_attr :caret_color, :color
22
+ theme_attr :caret_color_hover, :color
23
+ theme_attr :caret_color_focused, :color
24
+ theme_attr :border_color, :color
25
+ theme_attr :border_color_hover, :color
26
+ theme_attr :border_color_disabled, :color
27
+ theme_attr :border_color_focused, :color
28
+ theme_attr :texture, :texture
29
+ theme_attr :texture_hover, :texture
30
+ theme_attr :texture_disabled, :texture
31
+ theme_attr :texture_focused, :texture
32
+
33
+ end
34
+ end
@@ -0,0 +1,22 @@
1
+ require_relative 'widget_theme'
2
+ require_relative 'button_theme'
3
+ require_relative 'label_theme'
4
+ require_relative 'list_view_theme'
5
+ require_relative 'edit_box_theme'
6
+ require_relative 'combo_box_theme'
7
+
8
+ module Tgui
9
+ class FileDialogTheme < WidgetTheme
10
+
11
+ theme_comp :list_view, ListViewTheme
12
+ theme_comp :edit_box, EditBoxTheme
13
+ theme_comp :filename_label, LabelTheme
14
+ theme_comp :file_type_combo_box, ComboBoxTheme
15
+ theme_comp :button, ButtonTheme
16
+ theme_comp :back_button, ButtonTheme
17
+ theme_comp :forward_button, ButtonTheme
18
+ theme_comp :up_button, ButtonTheme
19
+ theme_attr :arrow_on_navigation_buttons_visible, :boolean
20
+
21
+ end
22
+ end
@@ -0,0 +1,13 @@
1
+ class FloatAttribute
2
+ def initialize name, value
3
+ @name = name
4
+ @value = value[0]
5
+ end
6
+
7
+ attr :name
8
+ attr :value
9
+
10
+ def to_theme
11
+ "#{name} = #{value};"
12
+ end
13
+ end
@@ -0,0 +1,9 @@
1
+ require_relative 'widget_theme'
2
+
3
+ module Tgui
4
+ class GroupTheme < WidgetTheme
5
+
6
+ theme_attr :padding, :outline
7
+
8
+ end
9
+ end
@@ -0,0 +1,15 @@
1
+ require_relative 'widget_theme'
2
+
3
+ module Tgui
4
+ class KnobTheme < WidgetTheme
5
+
6
+ theme_attr :borders, :outline
7
+ theme_attr :background_color, :color
8
+ theme_attr :thumb_color, :color
9
+ theme_attr :border_color, :color
10
+ theme_attr :texture_background, :texture
11
+ theme_attr :texture_foreground, :texture
12
+ theme_attr :image_rotation, :float
13
+
14
+ end
15
+ end
@@ -0,0 +1,20 @@
1
+ require_relative 'widget_theme'
2
+ require_relative 'scrollbar_theme'
3
+
4
+ module Tgui
5
+ class LabelTheme < WidgetTheme
6
+
7
+ theme_attr :borders, :outline
8
+ theme_attr :padding, :outline
9
+ theme_attr :text_color, :color
10
+ theme_attr :background_color, :color
11
+ theme_attr :border_color, :color
12
+ theme_attr :text_style, :text_styles
13
+ theme_attr :text_outline_color, :color
14
+ theme_attr :text_outline_thickness, :float
15
+ theme_attr :texture_background, :texture
16
+ theme_comp :scrollbar, ScrollbarTheme
17
+ theme_attr :scrollbar_width, :float
18
+
19
+ end
20
+ end
@@ -0,0 +1,25 @@
1
+ require_relative 'widget_theme'
2
+ require_relative 'scrollbar_theme'
3
+
4
+ module Tgui
5
+ class ListBoxTheme < WidgetTheme
6
+
7
+ theme_attr :borders, :outline
8
+ theme_attr :padding, :outline
9
+ theme_attr :text_style, :text_styles
10
+ theme_attr :selected_text_style, :text_styles
11
+ theme_attr :background_color, :color
12
+ theme_attr :background_color_hover, :color
13
+ theme_attr :selected_background_color, :color
14
+ theme_attr :selected_background_color_hover, :color
15
+ theme_attr :text_color, :color
16
+ theme_attr :text_color_hover, :color
17
+ theme_attr :selected_text_color, :color
18
+ theme_attr :selected_text_color_hover, :color
19
+ theme_attr :border_color, :color
20
+ theme_attr :texture_background, :texture
21
+ theme_comp :scrollbar, ScrollbarTheme
22
+ theme_attr :scrollbar_width, :float
23
+
24
+ end
25
+ end
@@ -0,0 +1,27 @@
1
+ require_relative 'widget_theme'
2
+
3
+ module Tgui
4
+ class ListViewTheme < WidgetTheme
5
+
6
+ theme_attr :borders, :outline
7
+ theme_attr :padding, :outline
8
+ theme_attr :background_color, :color
9
+ theme_attr :background_color_hover, :color
10
+ theme_attr :selected_background_color, :color
11
+ theme_attr :selected_background_color_hover, :color
12
+ theme_attr :text_color, :color
13
+ theme_attr :text_color_hover, :color
14
+ theme_attr :selected_text_color, :color
15
+ theme_attr :selected_text_color_hover, :color
16
+ theme_attr :header_background_color, :color
17
+ theme_attr :header_text_color, :color
18
+ theme_attr :border_color, :color
19
+ theme_attr :separator_color, :color
20
+ theme_attr :grid_lines_color, :color
21
+ theme_attr :texture_header_background, :texture
22
+ theme_attr :texture_background, :texture
23
+ theme_comp :scrollbar, ScrollbarTheme
24
+ theme_attr :scrollbar_width, :float
25
+
26
+ end
27
+ end
@@ -0,0 +1,21 @@
1
+ require_relative 'widget_theme'
2
+
3
+ module Tgui
4
+ class MenuBarTheme < WidgetTheme
5
+
6
+ theme_attr :background_color, :color
7
+ theme_attr :selected_background_color, :color
8
+ theme_attr :text_color, :color
9
+ theme_attr :selected_text_color, :color
10
+ theme_attr :text_color_disabled, :color
11
+ theme_attr :separator_color, :color
12
+ theme_attr :texture_background, :texture
13
+ theme_attr :texture_item_background, :texture
14
+ theme_attr :texture_selected_item_background, :texture
15
+ theme_attr :distance_to_side, :float
16
+ theme_attr :separator_thickness, :float
17
+ theme_attr :separator_vertical_padding, :float
18
+ theme_attr :separator_side_padding, :float
19
+
20
+ end
21
+ end
@@ -0,0 +1,11 @@
1
+ require_relative 'widget_theme'
2
+ require_relative 'button_theme'
3
+
4
+ module Tgui
5
+ class MessageBoxTheme < WidgetTheme
6
+
7
+ theme_attr :text_color, :color
8
+ theme_comp :button, ButtonTheme
9
+
10
+ end
11
+ end
@@ -0,0 +1,13 @@
1
+ class OutlineAttribute
2
+ def initialize name, value
3
+ @name = name
4
+ @value = Outline.from *value
5
+ end
6
+
7
+ attr :name
8
+ attr :value
9
+
10
+ def to_theme
11
+ "#{name} = #{value.to_s};"
12
+ end
13
+ end
@@ -0,0 +1,19 @@
1
+ require_relative 'widget_theme'
2
+
3
+ module Tgui
4
+ class ProgressBarTheme < WidgetTheme
5
+
6
+ theme_attr :borders, :outline
7
+ theme_attr :text_color, :color
8
+ theme_attr :text_color_filled, :color
9
+ theme_attr :background_color, :color
10
+ theme_attr :fill_color, :color
11
+ theme_attr :border_color, :color
12
+ theme_attr :texture_background, :texture
13
+ theme_attr :texture_fill, :texture
14
+ theme_attr :text_style, :text_styles
15
+ theme_attr :text_outline_color, :color
16
+ theme_attr :text_outline_thickness, :float
17
+
18
+ end
19
+ end
@@ -0,0 +1,30 @@
1
+ require_relative 'widget_theme'
2
+
3
+ module Tgui
4
+ class RadioButtonTheme < WidgetTheme
5
+
6
+ theme_attr :borders, :outline
7
+ theme_attr :text_distance_ratio, :float
8
+ [ '', :_hover, :_disabled, :_checked, :_checked_hover, :_checked_disabled ].each do |v|
9
+ theme_attr "text_color#{v}".to_sym, :color
10
+ theme_attr "background_color#{v}".to_sym, :color
11
+ theme_attr "border_color#{v}".to_sym, :color
12
+ end
13
+ theme_attr :border_color_focused, :color
14
+ theme_attr :border_color_checked_focused, :color
15
+ theme_attr :check_color, :color
16
+ theme_attr :check_color_hover, :color
17
+ theme_attr :check_color_disabled, :color
18
+ theme_attr :texture_unchecked, :texture
19
+ theme_attr :texture_unchecked_hover, :texture
20
+ theme_attr :texture_unchecked_disabled, :texture
21
+ theme_attr :texture_unchecked_focused, :texture
22
+ theme_attr :texture_checked, :texture
23
+ theme_attr :texture_checked_hover, :texture
24
+ theme_attr :texture_checked_disabled, :texture
25
+ theme_attr :texture_checked_focused, :texture
26
+ theme_attr :text_style, :text_styles
27
+ theme_attr :text_style_checked, :text_styles
28
+
29
+ end
30
+ end
@@ -0,0 +1,24 @@
1
+ require_relative 'widget_theme'
2
+
3
+ module Tgui
4
+ class ScrollbarTheme < WidgetTheme
5
+
6
+ theme_attr :track_color, :color
7
+ theme_attr :track_color_hover, :color
8
+ theme_attr :thumb_color, :color
9
+ theme_attr :thumb_color_hover, :color
10
+ theme_attr :arrow_background_color, :color
11
+ theme_attr :arrow_background_color_hover, :color
12
+ theme_attr :arrow_color, :color
13
+ theme_attr :arrow_color_hover, :color
14
+ theme_attr :texture_track, :texture
15
+ theme_attr :texture_track_hover, :texture
16
+ theme_attr :texture_thumb, :texture
17
+ theme_attr :texture_thumb_hover, :texture
18
+ theme_attr :texture_arrow_up, :texture
19
+ theme_attr :texture_arrow_up_hover, :texture
20
+ theme_attr :texture_arrow_down, :texture
21
+ theme_attr :texture_arrow_down_hover, :texture
22
+
23
+ end
24
+ end
@@ -0,0 +1,9 @@
1
+ require_relative 'widget_theme'
2
+
3
+ module Tgui
4
+ class SeparatorLineTheme < WidgetTheme
5
+
6
+ theme_attr :color, :color
7
+
8
+ end
9
+ end
@@ -0,0 +1,20 @@
1
+ require_relative 'widget_theme'
2
+
3
+ module Tgui
4
+ class SliderTheme < WidgetTheme
5
+
6
+ theme_attr :borders, :outline
7
+ theme_attr :track_color, :color
8
+ theme_attr :track_color_hover, :color
9
+ theme_attr :thumb_color, :color
10
+ theme_attr :thumb_color_hover, :color
11
+ theme_attr :border_color, :color
12
+ theme_attr :border_color_hover, :color
13
+ theme_attr :texture_track, :texture
14
+ theme_attr :texture_track_hover, :texture
15
+ theme_attr :texture_thumb, :texture
16
+ theme_attr :texture_thumb_hover, :texture
17
+ theme_attr :thumb_within_track, :boolean
18
+
19
+ end
20
+ end
@@ -0,0 +1,19 @@
1
+ require_relative 'widget_theme'
2
+
3
+ module Tgui
4
+ class SpinButtonTheme < WidgetTheme
5
+
6
+ theme_attr :borders, :outline
7
+ theme_attr :border_between_arrows, :float
8
+ theme_attr :background_color, :color
9
+ theme_attr :background_color_hover, :color
10
+ theme_attr :arrow_color, :color
11
+ theme_attr :arrow_color_hover, :color
12
+ theme_attr :border_color, :color
13
+ theme_attr :texture_arrow_up, :texture
14
+ theme_attr :texture_arrow_up_hover, :texture
15
+ theme_attr :texture_arrow_down, :texture
16
+ theme_attr :texture_arrow_down_hover, :texture
17
+
18
+ end
19
+ end
@@ -0,0 +1,29 @@
1
+ require_relative 'widget_theme'
2
+
3
+ module Tgui
4
+ class TabsTheme < WidgetTheme
5
+
6
+ theme_attr :borders, :outline
7
+ theme_attr :background_color, :color
8
+ theme_attr :background_color_hover, :color
9
+ theme_attr :background_color_disabled, :color
10
+ theme_attr :selected_background_color, :color
11
+ theme_attr :selected_background_color_hover, :color
12
+ theme_attr :text_color, :color
13
+ theme_attr :text_color_hover, :color
14
+ theme_attr :text_color_disabled, :color
15
+ theme_attr :selected_text_color, :color
16
+ theme_attr :selected_text_color_hover, :color
17
+ theme_attr :border_color, :color
18
+ theme_attr :border_color_hover, :color
19
+ theme_attr :selected_border_color, :color
20
+ theme_attr :selected_border_color_hover, :color
21
+ theme_attr :texture_tab, :texture
22
+ theme_attr :texture_tab_hover, :texture
23
+ theme_attr :texture_selected_tab, :texture
24
+ theme_attr :texture_selected_tab_hover, :texture
25
+ theme_attr :texture_disabled_tab, :texture
26
+ theme_attr :distance_to_side, :float
27
+
28
+ end
29
+ end
@@ -0,0 +1,22 @@
1
+ require_relative 'widget_theme'
2
+ require_relative 'scrollbar_theme'
3
+
4
+ module Tgui
5
+ class TextAreaTheme < WidgetTheme
6
+
7
+ theme_attr :borders, :outline
8
+ theme_attr :padding, :outline
9
+ theme_attr :background_color, :color
10
+ theme_attr :text_color, :color
11
+ theme_attr :default_text_color, :color
12
+ theme_attr :selected_text_color, :color
13
+ theme_attr :selected_text_background_color, :color
14
+ theme_attr :border_color, :color
15
+ theme_attr :caret_color, :color
16
+ theme_attr :texture_background, :texture
17
+ theme_attr :caret_width, :float
18
+ theme_comp :scrollbar, ScrollbarTheme
19
+ theme_attr :scrollbar_width, :float
20
+
21
+ end
22
+ end
@@ -0,0 +1,13 @@
1
+ class TextStylesAttribute
2
+ def initialize name, value
3
+ @name = name
4
+ @value = value
5
+ end
6
+
7
+ attr :name
8
+ attr :value
9
+
10
+ def to_theme
11
+ "#{name} = #{value.to_s};"
12
+ end
13
+ end
@@ -0,0 +1,17 @@
1
+ class TextureAttribute
2
+ def initialize name, value
3
+ @name = name
4
+ @value = Texture.from *value
5
+ end
6
+
7
+ attr :name
8
+ attr :value
9
+
10
+ def to_theme
11
+ "#{name} = #{value.to_theme};"
12
+ end
13
+
14
+ def self.base_class
15
+ Texture
16
+ end
17
+ end
@@ -0,0 +1,51 @@
1
+ require_relative '../color'
2
+ require_relative '../outline'
3
+ require_relative '../texture'
4
+ require_relative 'boolean_attribute'
5
+ require_relative 'color_attribute'
6
+ require_relative 'float_attribute'
7
+ require_relative 'outline_attribute'
8
+ require_relative 'text_styles_attribute'
9
+ require_relative 'texture_attribute'
10
+
11
+ module Tgui
12
+ module ThemeAttributed
13
+ include BangDef
14
+
15
+ ATTRIBUTE_TYPES = {
16
+ boolean: BooleanAttribute,
17
+ color: ColorAttribute,
18
+ float: FloatAttribute,
19
+ outline: OutlineAttribute,
20
+ text_styles: TextStylesAttribute,
21
+ texture: TextureAttribute,
22
+ }.freeze
23
+
24
+ def theme_attr name, type
25
+ attr_name = name.to_s.pascalcase
26
+ attr_type = ATTRIBUTE_TYPES[type]
27
+ def! name do |*value|
28
+ attributes[attr_name] = attr_type.new attr_name, value
29
+ end
30
+ end
31
+
32
+ def theme_comp name, type, tgui_attr_name = nil
33
+ attr_name = tgui_attr_name || name.to_s.pascalcase
34
+ def! name do |custom_name = nil, base_name = nil, **na, &b|
35
+ if base_name
36
+ attribute = attributes[custom_name]
37
+ if !attribute || attribute.name != base_name
38
+ attribute = attributes[custom_name] = type.new base_name, custom_name
39
+ end
40
+ else
41
+ a_name = custom_name || attr_name
42
+ attribute = attributes[a_name]
43
+ if !attribute || attribute.name != attr_name
44
+ attribute = attributes[a_name] = type.new attr_name, custom_name
45
+ end
46
+ end
47
+ upon! attribute, **na, &b
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,23 @@
1
+ require_relative 'theme_attributed'
2
+ require_relative 'common_renderer'
3
+
4
+ module Tgui
5
+ class ThemeComponent
6
+ include BangNest
7
+ extend ThemeAttributed
8
+
9
+ def initialize name, custom_name
10
+ @name = name
11
+ @custom_name = custom_name
12
+ @attributes = {}
13
+ end
14
+
15
+ attr :name, :attributes
16
+
17
+ def to_theme
18
+ return "" if @attributes.empty?
19
+ header = @custom_name ? "#{@custom_name} : #{@name}" : @name
20
+ "#{header} {\n#{@attributes.values.map(&:to_theme).join("\n")}\n}"
21
+ end
22
+ end
23
+ end