Ticket #245: gui.rnc

File gui.rnc, 5.0 KB (added by François Poirotte, 15 years ago)

Compact Relax NG schema for GUI

Line 
1namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
2
3start = (objects | setup | sprites | styles)
4
5
6#########
7# Types #
8#########
9
10# xsd:boolean could be used instead of this definition,
11# though it considers "1" & "0" as valid values.
12bool = "true" | "false"
13align = "left" | "center" | "right"
14valign = "top" | "middle" | "bottom"
15
16
17###########
18# Defines #
19###########
20
21unique_settings =
22 attribute name { text }?,
23 [ a:defaultValue = "empty" ]
24 attribute type { text }?,
25 attribute style { text }?
26
27# This could probably be made more specific/strict
28# with more information regarding the use/meaning
29# of these attributes.
30
31base_settings =
32 attribute absolute { bool }?,
33 attribute enable { bool }?,
34 attribute ghost { bool }?,
35 attribute hidden { bool }?,
36 attribute size { text }?,
37 attribute z { text }?
38
39# Defaults are not put in here, because it ruins the concept of styles.
40
41ex_settings =
42 attribute buffer_zone { text }?,
43 attribute buffer_width { text }?,
44 attribute checked { bool }?,
45 attribute dropdown_size { text }?,
46 attribute dropdown_buffer { text }?,
47 attribute font { text }?,
48 attribute fov_wedge_color { text }?,
49 attribute hotkey { text }?,
50 attribute cell_id { text }?,
51 attribute input_initvalue_destroyed_at_focus { bool }?,
52 attribute max_length { text }?,
53 attribute multiline { bool }?,
54 attribute rectcolor_selected { text }?,
55 attribute scrollbar { bool }?,
56 attribute scrollbar_style { text }?,
57 attribute sprite { text }?,
58 attribute sprite2 { text }?,
59 attribute sprite_bar { text }?,
60 attribute sprite_background { text }?,
61 attribute sprite_disabled { text }?,
62 attribute sprite_list { text }?,
63 attribute sprite2_disabled { text }?,
64 attribute sprite_over { text }?,
65 attribute sprite2_over { text }?,
66 attribute sprite_pressed { text }?,
67 attribute sprite2_pressed { text }?,
68 attribute sprite_selectarea { text }?,
69 attribute square_side { text }?,
70 attribute textcolor { text }?,
71 attribute textcolor_disabled { text }?,
72 attribute textcolor_over { text }?,
73 attribute textcolor_pressed { text }?,
74 attribute textcolor_selected { text }?,
75 attribute text_align { align }?,
76 attribute text_valign { valign }?,
77 attribute tooltip { text }?,
78 attribute tooltip_style { text }?
79
80
81###########
82# Objects #
83###########
84
85objects = element objects {
86 (script | object)*
87}
88
89script = element script {
90 text,
91
92 attribute file { text }?
93}
94
95object = element object {
96 ((object | action | item)* | text),
97
98 unique_settings,
99 base_settings,
100 ex_settings
101}
102
103action = element action {
104 text,
105
106 attribute on { text },
107 attribute file { text }?
108}
109
110item = element item {
111 text,
112
113 attribute enabled { bool }?
114}
115
116
117##########
118# Styles #
119##########
120
121styles = element styles {
122 style*
123}
124
125style = element style {
126 attribute name { text },
127 base_settings,
128 ex_settings
129}
130
131
132#########
133# Setup #
134##########
135
136setup = element setup {
137 (icon | scrollbar | tooltip | color)*
138}
139
140scrollbar = element scrollbar {
141 attribute name { text },
142 attribute width { text },
143 attribute scroll_wheel { bool }?,
144 attribute alwaysshown { bool }?,
145 attribute scroll_speed { text }?,
146 attribute sprite_button_top { text }?,
147 attribute sprite_button_top_pressed { text }?,
148 attribute sprite_button_top_disabled { text }?,
149 attribute sprite_button_top_over { text }?,
150 attribute sprite_button_bottom { text }?,
151 attribute sprite_button_bottom_pressed { text }?,
152 attribute sprite_button_bottom_disabled { text }?,
153 attribute sprite_button_bottom_over { text }?,
154 attribute sprite_bar_vertical { text }?,
155 attribute sprite_bar_vertical_over { text }?,
156 attribute sprite_bar_vertical_pressed { text }?,
157 attribute sprite_back_vertical { text }?,
158 attribute minimum_bar_size { text }?
159}
160
161icon = element icon {
162 attribute name { text },
163 attribute size { text },
164 attribute sprite { text },
165 attribute cell_id { text }?
166}
167
168tooltip = element tooltip {
169 attribute name { text },
170 attribute sprite { text }?,
171 attribute anchor { text }?,
172 attribute buffer_zone { text }?,
173 attribute font { text }?,
174 attribute maxwidth { text }?,
175 attribute offset { text }?,
176 attribute textcolor { text }?,
177 attribute delay { text }?,
178 attribute use_object { text }?,
179 attribute hide_object { text }?
180}
181
182color = element color {
183 text,
184
185 attribute name { text }
186}
187
188
189###########
190# Sprites #
191###########
192
193sprites = element sprites {
194 sprite*
195}
196
197sprite = element sprite {
198 (effect?, image+),
199
200 attribute name { text }
201}
202
203image = element image {
204 effect?,
205
206 attribute texture { text }?,
207 attribute size { text }?,
208 attribute texture_size { text }?,
209 attribute real_texture_placement { text }?,
210 attribute cell_size { text }?,
211 attribute backcolor { text }?,
212 attribute bordercolor { text }?,
213 attribute border { bool }?,
214 attribute z_level { text }?
215}
216
217effect = element effect {
218 attribute add_color { text }?,
219 attribute multiply_color { text }?,
220 attribute grayscale { text }?
221}
222