Imported Upstream version 1.51.5
[platform/upstream/gobject-introspection.git] / docs / gir-1.2.rnc
1 default namespace core = "http://www.gtk.org/introspection/core/1.0"
2 namespace c = "http://www.gtk.org/introspection/c/1.0"
3 namespace glib = "http://www.gtk.org/introspection/glib/1.0"
4
5 grammar {
6   start = Repository
7
8   Repository =
9     element repository {
10       attribute version { xsd:string }?,
11       attribute c:identifier-prefixes { xsd:string }?,
12       attribute c:symbol-prefixes { xsd:string }?,
13
14       (Include*
15        & CInclude*
16        & Package*
17        & Namespace*)
18     }
19
20   Namespace =
21     element namespace {
22       attribute name { xsd:string }?,
23       attribute version { xsd:string }?,
24       attribute c:identifier-prefixes { xsd:string }?,
25       attribute c:symbol-prefixes { xsd:string }?,
26       attribute c:prefix { xsd:string }?,
27       attribute shared-library { xsd:string }?,
28
29       (Alias*
30        & Class*
31        & Interface*
32        & Record*
33        & Enum*
34        & Function*
35        & Union*
36        & BitField*
37        & Callback*
38        & Constant*
39        & Annotation*
40        & Boxed*)
41     }
42
43   Annotation =
44     element attribute {
45       attribute name { xsd:string },
46       attribute value { xsd:string }
47     }
48
49   CInclude =
50     element c:include {
51       attribute name { xsd:string },
52
53       empty
54     }
55
56   Include =
57     element include {
58       attribute name { xsd:string },
59       attribute version { xsd:string }?,
60
61       empty
62     }
63
64   Package =
65     element package {
66       attribute name { xsd:string },
67
68       empty
69     }
70
71   Alias =
72     element alias {
73       Info.attrs,
74       attribute name { xsd:string },
75       attribute c:type { xsd:string },
76
77       (Info.elements
78        & Type)
79     }
80
81   Interface =
82     element interface {
83       Info.attrs,
84       attribute name { xsd:string },
85       attribute glib:type-name { xsd:string },
86       attribute glib:get-type { xsd:string },
87
88       attribute c:symbol-prefix { xsd:string }?,
89       attribute c:type { xsd:string }?,
90       attribute glib:type-struct { xsd:string }?,
91
92       (Info.elements
93        & Prerequisite*
94        & Implements*
95        & Function*
96        & Constructor?
97        & Method*
98        & VirtualMethod*
99        & Field*
100        & Property*
101        & Signal*
102        & Callback*
103        & Constant*)
104     }
105
106   Class =
107     element class {
108       Info.attrs,
109       attribute name { xsd:string },
110       attribute glib:type-name { xsd:string },
111       attribute glib:get-type { xsd:string },
112
113       attribute parent { xsd:string }?,
114       attribute glib:type-struct { xsd:string }?,
115       attribute glib:ref-func { xsd:string }?,
116       attribute glib:unref-func { xsd:string }?,
117       attribute glib:set-value-func { xsd:string }?,
118       attribute glib:get-value-func { xsd:string }?,
119       attribute c:type { xsd:string }?,
120       attribute c:symbol-prefix { xsd:string }?,
121       attribute abstract { "0" | "1" }?,
122       attribute glib:fundamental { "0" | "1" }?,
123
124       (Info.elements
125        & Implements*
126        & Constructor*
127        & Method*
128        & Function*
129        & VirtualMethod*
130        & Field*
131        & Property*
132        & Signal*
133        & Union*
134        & Constant*
135        & Record*
136        & Callback*)
137     }
138
139   Boxed =
140     element glib:boxed {
141       Info.attrs,
142       attribute glib:name { xsd:string },
143
144       attribute c:symbol-prefix { xsd:string }?,
145       attribute glib:type-name { xsd:string }?,
146       attribute glib:get-type { xsd:string }?,
147
148       (Info.elements
149        & Function*)
150     }
151
152   Record =
153     element record {
154       Info.attrs,
155       attribute name { xsd:string },
156
157       attribute c:type { xsd:string }?,
158       attribute disguised { "0" | "1" }?,
159       attribute glib:type-name { xsd:string }?,
160       attribute glib:get-type { xsd:string }?,
161       attribute c:symbol-prefix { xsd:string }?,
162       attribute foreign { "0" | "1" }?,
163       attribute glib:is-gtype-struct-for { xsd:string }?,
164
165       (Info.elements
166        & Field*
167        & Function*
168        & Union*
169        & Method*
170        & Constructor*
171        & Property*)
172     }
173
174   Info.attrs = (
175     attribute introspectable { "0" | "1" }?,
176     attribute deprecated { xsd:string }?,
177     attribute deprecated-version { xsd:string }?,
178     attribute version { xsd:string }?,
179     attribute stability { xsd:string }?
180   )
181
182   DocElements = (
183     element doc-version {
184       attribute xml:space { "preserve" }?,
185       attribute xml:whitespace { "preserve" }?,
186
187       text
188     }?
189     & element doc-stability {
190       attribute xml:space { "preserve" }?,
191       attribute xml:whitespace { "preserve" }?,
192
193       text
194     }?
195     & element doc {
196       attribute xml:space { "preserve" }?,
197       attribute xml:whitespace { "preserve" }?,
198
199       text
200     }?
201     & element doc-deprecated {
202       attribute xml:space { "preserve" }?,
203       attribute xml:whitespace { "preserve" }?,
204
205       text
206     }?
207   )
208
209   Info.elements = (
210     DocElements
211     & Annotation*
212   )
213
214   Constant =
215     element constant {
216         Info.attrs,
217         attribute name { xsd:string },
218         attribute value { xsd:string },
219         attribute c:type { xsd:string }?,
220         attribute c:identifier { xsd:string }?,
221
222         (Info.elements
223          & AnyType?)
224     }
225
226   Property =
227     element property {
228       Info.attrs,
229       attribute name { xsd:string },
230
231       attribute writable { "0" | "1" }?,
232       attribute readable { "0" | "1" }?,
233       attribute construct { "0" | "1" }?,
234       attribute construct-only { "0" | "1" }?,
235       TransferOwnership?,
236
237       (Info.elements
238        & AnyType)
239     }
240
241   Signal =
242     element glib:signal {
243       Info.attrs,
244       attribute name { xsd:string },
245
246       attribute detailed { "0" | "1" }?,
247       attribute when { "first" | "last" | "cleanup" }?,
248       attribute action { "0" | "1" }?,
249       attribute no-hooks { "0" | "1" }?,
250       attribute no-recurse { "0" | "1" }?,
251
252       (Info.elements
253        & Callable.params?
254        & Callable.return?)
255     }
256
257   Field =
258     element field {
259       Info.attrs,
260       attribute name { xsd:string },
261
262       attribute writable { "0" | "1" }?,
263       attribute readable { "0" | "1" }?,
264       attribute private { "0" | "1" }?,
265       attribute bits { xsd:integer }?,
266
267       (Info.elements
268        & (Callback | AnyType))
269     }
270
271   Callback =
272     element callback {
273       Info.attrs,
274       attribute name { xsd:string },
275
276       attribute c:type { xsd:string }?,
277       attribute throws { "0" | "1" }?,
278
279       (Info.elements
280        & Callable.params?
281        & Callable.return?)
282     }
283
284   Implements  =
285     element implements {
286       attribute name { xsd:string }
287     }
288
289   Prerequisite  =
290     element prerequisite {
291       attribute name { xsd:string }
292     }
293
294   AnyType = (Type | ArrayType)
295
296   Type =
297     element type {
298       attribute name { xsd:string }?,
299       attribute c:type { xsd:string }?,
300       attribute introspectable { xsd:string }?,
301
302       (DocElements & AnyType*)
303     }
304
305   ArrayType =
306     element array {
307       attribute name { xsd:string }?,
308       attribute zero-terminated { "0" | "1" }?,
309       attribute fixed-size { xsd:integer }?,
310       attribute introspectable { xsd:string }?,
311       attribute length { xsd:integer }?,
312       attribute c:type { xsd:string }?,
313
314       AnyType
315     }
316
317   TransferOwnership =
318     attribute transfer-ownership { "none" | "container" | "full" }
319
320   Constructor =
321     element constructor {
322       Callable.attrs,
323
324       (Info.elements
325        & Callable.params?
326        & Callable.return?)
327     }
328
329   Callable.attrs = (
330     Info.attrs,
331     attribute name { xsd:string },
332
333     attribute c:identifier { xsd:string }?,
334     attribute shadowed-by { xsd:string }?,
335     attribute shadows { xsd:string }?,
336     attribute throws { "0" | "1" }?,
337     attribute moved-to { xsd:string }?
338   )
339
340   VarArgs =
341     element varargs {
342       empty
343     }
344
345   Callable.params =
346     element parameters {
347       element parameter {
348         attribute name { xsd:string }?,
349         attribute nullable { "0" | "1" }?,
350         attribute allow-none { "0" | "1" }?,
351         attribute introspectable { "0" | "1" }?,
352         attribute closure { xsd:integer }?,
353         attribute destroy { xsd:integer }?,
354         attribute scope { "notified" | "async" | "call" }?,
355         attribute direction { "out" | "in" | "inout" }?,
356         attribute caller-allocates { "0" | "1" }?,
357         attribute optional { "0" | "1" }?,
358         attribute skip { "0" | "1" }?,
359         TransferOwnership?,
360
361         (DocElements
362          & (AnyType | VarArgs))
363       }*
364
365       & element instance-parameter {
366         attribute name { xsd:string },
367
368         attribute nullable { "0" | "1" }?,
369         attribute allow-none { "0" | "1" }?,
370         attribute direction { "out" | "in" | "inout" }?,
371         attribute caller-allocates { "0" | "1" }?,
372         TransferOwnership?,
373
374         (DocElements
375          & Type)
376       }?
377     }
378
379   Callable.return =
380     element return-value {
381       attribute introspectable { xsd:string }?,
382       attribute nullable { "0" | "1" }?,
383       attribute closure { xsd:integer }?,
384       attribute scope { "notified" | "async" | "call" }?,
385       attribute destroy { xsd:integer }?,
386       attribute skip { "0" | "1" }?,
387       attribute allow-none { "0" | "1" }?,
388       TransferOwnership?,
389
390       (DocElements
391        & AnyType)
392     }
393
394   Function =
395     element function {
396       Callable.attrs,
397
398       (Callable.params?
399        & Callable.return?
400        & DocElements)
401     }
402
403   Method =
404     element method {
405       Callable.attrs,
406
407       (Info.elements
408        & Callable.params?
409        & Callable.return?)
410     }
411
412   VirtualMethod =
413     element virtual-method {
414       Callable.attrs,
415       attribute invoker { xsd:string }?,
416
417       (Info.elements
418        & Callable.params?
419        & Callable.return?)
420     }
421
422   Union =
423     element union {
424       Info.attrs,
425       attribute name { xsd:string }?,
426       attribute c:type { xsd:string }?,
427       attribute c:symbol-prefix { xsd:string }?,
428       attribute glib:get-type { xsd:string }?,
429       attribute glib:type-name { xsd:string }?,
430
431       (Info.elements
432        & Field*
433        & Constructor*
434        & Method*
435        & Function*
436        & Record*)
437     }
438
439   BitField =
440     element bitfield {
441       Info.attrs,
442       attribute name { xsd:string },
443       attribute c:type { xsd:string },
444
445       attribute glib:type-name { xsd:string }?,
446       attribute glib:get-type { xsd:string }?,
447
448       (Info.elements
449        & Member*
450        & Function*)
451     }
452
453   Enum =
454     element enumeration {
455       Info.attrs,
456       attribute name { xsd:string },
457       attribute c:type { xsd:string },
458
459       attribute glib:type-name { xsd:string }?,
460       attribute glib:get-type { xsd:string }?,
461       attribute glib:error-domain { xsd:string }?,
462
463       (Info.elements
464        & Member*
465        & Function*)
466     }
467
468   Member =
469     element member {
470       Info.attrs,
471       attribute name { xsd:string },
472       attribute value { xsd:string },
473       attribute c:identifier { xsd:string },
474
475       attribute glib:nick { xsd:string }?,
476
477       Info.elements
478     }
479 }