forked from wesnoth/wesnoth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema-gui.cfg
192 lines (178 loc) · 7.33 KB
/
schema-gui.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
#textdomain wesnoth
[schema]
identifier="re ^[a-zA-Z_]+$"
# slash-separated filenames
path="re ^([a-z0-9\-.+]+/)*[a-z0-9\-.+]+$"
# for non-negative geometry
unsigned="re ^[0-9]+$"
border="enum top,bottom,left,right,all"
halign="enum left,right,center"
valign="enum top,bottom,center"
[root]
_gui="required gui" # or repeated? maybe we need a new 'at least one' type
[/root]
[column]
border="optional border"
border_size="optional unsigned"
grow_factor="optional unsigned"
horizontal_alignment="optional halign"
horizontal_grow="optional boolean"
vertical_alignment="optional valign"
vertical_grow="optional boolean"
#TODO: possible other stuff
# A column should contain exactly one widget
# How are we going to define that, if at all?
_button="optional button"
_horizontal_listbox="optional horizontal_listbox"
_horizontal_scrollbar="optional horizontal_scrollbar"
_image="optional image"
_label="optional label"
_listbox="optional listbox"
_menubar="optional menubar"
_minimap="optional minimap"
_multi_page="optional multi_page"
_panel="optional panel"
_repeating_button="optional repeating_button"
_scroll_label="optional scroll_label"
_scrollbar_panel="optional scrollbar_panel"
_slider="optional slider"
_spacer="optional spacer"
_stacked_widget="optional stacked_widget"
_text_box="optional text_box"
_password_box="optional password_box"
_toggle_button="optional toggle_button"
_toggle_panel="optional toggle_panel"
_tree_view="optional tree_view"
_vertical_scrollbar="optional vertical_scrollbar"
_grid="optional grid"
[/column]
[grid]
_row="repeated row"
id="optional identifier"
linked_group="optional identifier"
[/grid]
[gui]
_settings="required settings"
#TODO: make sure all the below are actually optional
_button_definition="repeated button_definition"
_horizontal_listbox_definition="repeated horizontal_listbox_definition"
_horizontal_scrollbar_definition="repeated horizontal_scrollbar_definition"
_image_definition="repeated image_definition"
_label_definition="repeated label_definition"
_listbox_definition="repeated listbox_definition"
_menubar_definition="repeated menubar_definition"
_minimap_definition="repeated minimap_definition"
_multi_page_definition="repeated multi_page_definition"
_panel_definition="repeated panel_definition"
_repeating_button_definition="repeated repeating_button_definition"
_scrollbar_panel_definition="repeated scrollbar_panel_definition"
_scroll_label_definition="repeated scroll_label_definition"
_slider_definition="repeated slider_definition"
_spacer_definition="repeated spacer_definition"
_stacked_widget_definition="repeated stacked_widget_definition"
_text_box_definition="repeated text_box_definition"
_toggle_button_definition="repeated toggle_button_definition"
_toggle_panel_definition="repeated toggle_panel_definition"
_tooltip_definition="repeated tooltip_definition"
_tree_view_definition="repeated tree_view_definition"
_vertical_scrollbar_definition="repeated vertical_scrollbar_definition"
_window_definition="repeated window_definition"
_window="repeated window"
id="required identifier"
description="required string"
[/gui]
[label:control]
wrap="optional boolean"
[/label:control]
[panel_definition:control_definition]
_resolution="repeated panel_definition-resolution"
[/panel_definition:control_definition]
[panel_definition-resolution:resolution_definition]
bottom_border="optional unsigned"
left_border="optional unsigned"
right_border="optional unsigned"
top_border="optional unsigned"
_background="optional state_definition"
_foreground="optional state_definition"
[/panel_definition-resolution:resolution_definition]
[row]
grow_factor="optional unsigned"
_column="repeated column"
[/row]
[settings]
double_click_time="required unsigned"
help_show_time="optional unsigned"
popup_show_delay="optional unsigned"
popup_show_time="optional unsigned"
repeat_button_repeat_time="optional unsigned"
sound_button_click="optional path"
sound_toggle_button_click="optional path"
sound_toggle_panel_click="optional path"
sound_slider_adjust="optional path"
[/settings]
[state_definition]
_draw="required draw"
[/state_definition]
[window:widget]
_resolution="repeated resolution"
# We *may* want to move this to widget, if all instances of tbuilder_widget actually have it
description="required string"
id="required identifier"
[/window:widget]
[window_definition:control_definition]
_resolution="repeated window_definition-resolution"
[/window_definition:control_definition]
[window_definition-resolution:panel_definition-resolution]
_grid="optional grid" #TODO: check if it's actually required
[/window_definition-resolution:panel_definition-resolution]
# Base things that are only (mostly) derived from
[control:widget]
debug_border_color="optional string"
debug_border_mode="optional unsigned"
definition="optional identifier"
help="optional string"
id="optional identifier"
label="optional string"
linked_group="optional identifier"
tooltip="optional string"
use_tooltip_on_label_overflow="optional boolean"
[/control:widget]
[control_definition]
_resolution="repeated resolution"
description="required string"
id="required identifier"
[/control_definition]
[resolution]
_grid="required grid"
_linked_group="repeated linked_group"
automatic_placement="optional boolean"
click_dismiss="optional boolean"
definition="optional identifier"
height="optional string" # A formula that returns unsigned
horizontal_placement="optional halign"
maximum_height="optional unsigned"
maximum_width="optional unsigned"
vertical_placement="optional valign"
width="optional string" # A formula that returns unsigned
window_height="optional unsigned"
window_width="optional unsigned"
x="optional string" # A formula that returns unsigned
y="optional string" # A formula that returns unsigned
[/resolution]
[resolution_definition]
default_height="optional unsigned"
default_width="optional unsigned"
max_height="optional unsigned"
max_width="optional unsigned"
min_height="optional unsigned"
min_width="optional unsigned"
text_extra_height="optional unsigned"
text_extra_width="optional unsigned"
text_font_size="optional unsigned"
window_height="optional unsigned"
window_width="optional unsigned"
text_font_style="optional string" #TODO: this is an enum
[/resolution_definition]
[widget]
[/widget]
[/schema]