Imported Upstream version 1.61.1
[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   ## Root node of a GIR repository. It contains  namespaces, which can in turn be implemented in several libraries
9   Repository =
10     element repository {
11       ## version number of the repository
12       attribute version { xsd:string }?,
13       ## prefixes to filter out from C identifiers for data structures and types. For example, GtkWindow will be Window. If c:symbol-prefixes is not used, then this element is used for both
14       attribute c:identifier-prefixes { xsd:string }?,
15       ## prefixes to filter out from C functions. For example, gtk_window_new will lose gtk_
16       attribute c:symbol-prefixes { xsd:string }?,
17
18       # Other elements a repository can contain
19       (Include*
20        & CInclude*
21        & Package*
22        & Namespace*)
23     }
24
25   ## Namespace which maps metadata entries to C functionality. This a similar concept to namespace in C++, but for GObject-based C libraries
26   Namespace =
27     element namespace {
28       ## name of the namespace. For example, 'Gtk'
29       attribute name { xsd:string }?,
30       ## version number of the namespace
31       attribute version { xsd:string }?,
32       ## prefixes to filter out from C identifiers for data structures and types. For example, GtkWindow will be Window. If c:symbol-prefixes is not used, then this element is used for both
33       attribute c:identifier-prefixes { xsd:string }?,
34       ## prefixes to filter out from C functions. For example, gtk_window_new will lose gtk_
35       attribute c:symbol-prefixes { xsd:string }?,
36       ## Deprecated: the same as c:identifier-prefixes. Only used for backward compatibility 
37       attribute c:prefix { xsd:string }?,
38       ## Path to the shared library implementing the namespace. It can be a comma-separated list, with relative path only
39       attribute shared-library { xsd:string }?,
40
41       # Other elements a namespace can contain
42       (Alias*
43        & Class*
44        & Interface*
45        & Record*
46        & Enum*
47        & Function*
48        & Union*
49        & BitField*
50        & Callback*
51        & Constant*
52        & Annotation*
53        & Boxed*)
54     }
55
56   Annotation =
57     ## element defining an annotation from the source code, usually a user-defined annotation associated to a parameter or a return value
58     element attribute {
59       ## name of the attribute
60       attribute name { xsd:string },
61       ## value of the attribute
62       attribute value { xsd:string }
63     }
64
65   CInclude =
66     ## Dependant C header file which should be included in C programs
67     element c:include {
68       ## File name of the C header file. The path can be relative.
69       attribute name { xsd:string },
70
71       empty
72     }
73
74   Include =
75     ## Dependant namespace to include with the current namespace. For example, Gtk will need the namespace GLib
76     element include {
77       ## name of the dependant namespace to include
78       attribute name { xsd:string },
79       ## version of the dependant namespace to use
80       attribute version { xsd:string }?,
81
82       empty
83     }
84
85   Package =
86     ## Deprecated: package name containing the library
87     element package {
88       ## name of the package
89       attribute name { xsd:string },
90
91       empty
92     }
93
94   Alias =
95     ## Type's name substitution, representing a typedef in C
96     element alias {
97       # Attributes of an Alias (see definition below)
98       Info.attrs,
99       ## the new name or typedef'd name
100       attribute name { xsd:string },
101       ## the corresponding C type's name
102       attribute c:type { xsd:string },
103
104       # Other elements an alias can contain
105       (Info.elements
106        & Type)
107     }
108
109   Interface =
110     ## Abstract interface to other classes
111     element interface {
112       # Attributes of an Interface (see definition below)
113       Info.attrs,
114       ## name of the interface
115       attribute name { xsd:string },
116       ## Type name compatible with the GObject type system
117       attribute glib:type-name { xsd:string },
118       ## Function to get the GObject compatible type of the interface 
119       attribute glib:get-type { xsd:string },
120       ## prefix to filter out from C functions. For example, gtk_window_new will lose gtk_
121       attribute c:symbol-prefix { xsd:string }?,
122       ## Corresponding C type
123       attribute c:type { xsd:string }?,
124       ## GObject compatible C structure defining the Interface
125       attribute glib:type-struct { xsd:string }?,
126
127       # Other elements an interface can contain
128       (Info.elements
129        & Prerequisite*
130        & Implements*
131        & Function*
132        & Constructor?
133        & Method*
134        & VirtualMethod*
135        & Field*
136        & Property*
137        & Signal*
138        & Callback*
139        & Constant*)
140     }
141
142   Class =
143     ## GObject inherited class definition
144     element class {
145       Info.attrs,
146       
147       ## Name of the class
148       attribute name { xsd:string },
149       ## GObject compatible type name of the class
150       attribute glib:type-name { xsd:string },
151       ## Function to get the GObject compatible type of the class
152       attribute glib:get-type { xsd:string },
153       ## Name of the parent class if any
154       attribute parent { xsd:string }?,
155       ## GObject compatible C structure defining the class
156       attribute glib:type-struct { xsd:string }?,
157       ## GObject compatible function to reference or increase the reference count of the class
158       attribute glib:ref-func { xsd:string }?,
159       ## GObject compatible function to unreference or decrease the reference count of the class
160       attribute glib:unref-func { xsd:string }?,
161       ## GObject compatible function to set a value of a property of the class
162       attribute glib:set-value-func { xsd:string }?,
163       ## GObject compatible function to get a value of a property of the class
164       attribute glib:get-value-func { xsd:string }?,
165       ## C type of the class
166       attribute c:type { xsd:string }?,
167       ## prefix to filter out from C functions. For example, gtk_window_new will lose gtk_
168       attribute c:symbol-prefix { xsd:string }?,
169       ## Binary attribute to declare the class abstract or not
170       attribute abstract { "0" | "1" }?,
171       ## Binary attribute to declare the class fundamental or not (top-level class which do not derives from any other type)
172       attribute glib:fundamental { "0" | "1" }?,
173
174       # Other elements a class can contain
175       (Info.elements
176        & Implements*
177        & Constructor*
178        & Method*
179        & Function*
180        & VirtualMethod*
181        & Field*
182        & Property*
183        & Signal*
184        & Union*
185        & Constant*
186        & Record*
187        & Callback*)
188     }
189
190   Boxed =
191     ## Boxed type (wrapper to opaque C structures registered by the type system)
192     element glib:boxed {
193       Info.attrs,
194       ## GObject compatible type name of the boxed type
195       attribute glib:name { xsd:string },
196       ## prefix to filter out from C functions. For example, gtk_window_new will lose gtk_
197       attribute c:symbol-prefix { xsd:string }?,
198       ## GObject compatible type name of the boxed type
199       attribute glib:type-name { xsd:string }?,
200       ## Function to get the GObject compatible type of the boxed type
201       attribute glib:get-type { xsd:string }?,
202
203       # Other elements a Boxed type can contain
204       (Info.elements
205        & Function*)
206     }
207
208   Record =
209     ## Record definition, equivalent to a C struct, that is a simple structure, not a class
210     element record {
211       Info.attrs,
212       ## name of the record
213       attribute name { xsd:string },
214       ## Corresponding C type of the record
215       attribute c:type { xsd:string }?,
216       ## Binary attribute to tell if the record is disguised, i.e. whether the c:type is a typedef that doesn't look like a pointer, but is one internally
217           ## Its second meaning is "private" and is set when any typedef struct is parsed which doesn't also include a full struct with fields (https://gitlab.gnome.org/GNOME/gobject-introspection/issues/101)
218       attribute disguised { "0" | "1" }?,
219       ## GObject compatible C type of the record
220       attribute glib:type-name { xsd:string }?,
221       ## Function to get the GObject compatible type of the record
222       attribute glib:get-type { xsd:string }?,
223       ## prefix to filter out from C functions. For example, gtk_window_new will lose gtk_
224       attribute c:symbol-prefix { xsd:string }?,
225       ## Binary attribute to tell if the record is foreign, that is it is not available in a g-i supported library
226       attribute foreign { "0" | "1" }?,
227       ## Name of the GObject compatible gtype this record represents. If empty, this record will be hidden from generated public APIs.
228       attribute glib:is-gtype-struct-for { xsd:string }?,
229
230       # Other elements a record can contain
231         # mandatory 
232       (Info.elements
233        & Field*
234        & Function*
235        & Union*
236        & Method*
237        & Constructor*
238        & Property*)
239     }
240
241   # Some base information for most elements like version, deprecation, stability, if they are introspectable or not, etc...
242   Info.attrs = (
243     ## Binary attribute which is "0" (false) if the element is not introspectable. It doesn't exist in the bindings, due in general to missing information in the annotations in the original C code
244     attribute introspectable { "0" | "1" }?,
245     ## Binary attribute which is "1" (true) if the element has been deprecated
246     attribute deprecated { xsd:string }?,
247     ## Version number from which this element is deprecated
248     attribute deprecated-version { xsd:string }?,
249     ## version number of an element
250     attribute version { xsd:string }?,
251     ## give the statibility status of the element. Can take the values "Stable", "Unstable" or "Private"
252     attribute stability { xsd:string }?
253   )
254
255   # Documentation of elements
256   DocElements = (
257     ## Version of the documentation
258     element doc-version {
259       ## Preserve the original formatting of the documentation from the source code
260       attribute xml:space { "preserve" }?,
261       ## Preserve the original formatting of the documentation from the source code. Recommended to use this instead of xml:space
262       attribute xml:whitespace { "preserve" }?,
263       ## the text of the version of the documentation
264       text
265     }?
266     ## give the stability of the documentation
267     & element doc-stability {
268       ## Preserve the original formatting of the documentation from the source code
269       attribute xml:space { "preserve" }?,
270       ## Preserve the original formatting of the documentation from the source code. Recommended to use this instead of xml:space
271       attribute xml:whitespace { "preserve" }?,
272       ## a text value about the stability of the documentation. Usually a simple description like stable or unstable
273       text
274     }?
275     ## documentation of an element
276     & element doc {
277       ## Preserve the original formatting of the documentation from the source code
278       attribute xml:space { "preserve" }?,
279       ## Keep the whitespace as they were in the source code
280       attribute xml:whitespace { "preserve" }?,
281       ## The file containing this documentation
282       attribute filename { xsd:string },
283       ## The first line of the documentation in the source code
284       attribute line { xsd:string },
285       ## The first column of the documentation in the source code
286       attribute column { xsd:string },
287       ## the text of the documentation
288       text
289     }?
290     ## Deprecated documentation of an element. Kept for historical reasons in general
291     & element doc-deprecated {
292       ## Preserve the original formatting of the documentation from the source code
293       attribute xml:space { "preserve" }?,
294       ## Keep the whitespace as they were in the source code
295       attribute xml:whitespace { "preserve" }?,
296       ## the text of the deprecated documentation
297       text
298     }?
299     ## Position of the documentation in the original source code
300     & element source-position {
301       ## File name of the source of the documentation
302       attribute filename { xsd:string },
303       ## The first line of the documentation in the source code
304       attribute line { xsd:string },
305       ## The first column of the documentation in the source code
306       attribute column { xsd:string },
307     }?
308   )
309
310   # Information about elements can be a documentation of annotations
311   Info.elements = (
312     DocElements
313     & Annotation*
314   )
315
316   Constant =
317     ## A constant entity, similar to const variable in C
318     element constant {
319         Info.attrs,
320         ## name of the constant
321         attribute name { xsd:string },
322         ## value of the constant
323         attribute value { xsd:string },
324         ## corresponding C type of the constant in C
325         attribute c:type { xsd:string }?,
326         ## corresponding C identifier in the source code
327         attribute c:identifier { xsd:string }?,
328
329         # Other elements a record can contain
330         (Info.elements
331          & AnyType?)
332     }
333
334   Property =
335     ## Property, that is a variable or members with getter and setter functions
336     element property {
337       Info.attrs,
338       ## name of the property
339       attribute name { xsd:string },
340       ## Binary attribute, true if the property is writeable, that is it has a setter function
341       attribute writable { "0" | "1" }?,
342       ## Binary attribute, true if the property is readable, that is it has a getter function
343       attribute readable { "0" | "1" }?,
344       ## Binary attribute, true if the property will be set upon construction
345       attribute construct { "0" | "1" }?,
346       ## Binary attribute, true if the property can only be set upon construction
347       attribute construct-only { "0" | "1" }?,
348       # Define the transfer of ownership of the property element
349       TransferOwnership?,
350
351       # Other elements a property can contain
352       (Info.elements
353        & AnyType)
354     }
355
356   Signal =
357     ## A signal as defined in the GObject system (https://developer.gnome.org/gobject/stable/signal.html)
358     element glib:signal {
359       Info.attrs,
360       ## name of the signal
361       attribute name { xsd:string },
362       ## Binary attribute, true if the signal has a detailed parameter (https://developer.gnome.org/gobject/stable/signal.html#signal-detail# and https://developer.gnome.org/gobject/unstable/gobject-Signals.html#GSignalFlags)
363       attribute detailed { "0" | "1" }?,
364       ## When to run the signal during the 5 steps of signal emission (https://developer.gnome.org/gobject/stable/signal.html#signal-emission and https://developer.gnome.org/gobject/unstable/gobject-Signals.html#GSignalFlags)
365       attribute when { "first" | "last" | "cleanup" }?,
366       ## Binary attribute, true if the signal can be freely emitted on alive objects from user code (https://developer.gnome.org/gobject/unstable/gobject-Signals.html#GSignalFlags)
367       attribute action { "0" | "1" }?,
368       ## Binary attribute, true if no emission hooks are supported for this signal (https://developer.gnome.org/gobject/unstable/gobject-Signals.html#GSignalFlags) 
369       attribute no-hooks { "0" | "1" }?,
370       ## Binary attribute, true if signals emitted for an object while currently being in emission for this very object will not be emitted recursively, but instead cause the first emission to be restarted (https://developer.gnome.org/gobject/unstable/gobject-Signals.html#GSignalFlags)
371       attribute no-recurse { "0" | "1" }?,
372
373       # Other elements a property can contain
374       (Info.elements
375        & Callable.params?
376        & Callable.return?)
377     }
378
379   Field =
380     ## A field of struct of union structure, that is a C bit field, that is a fixed length in bits variable
381     element field {
382       Info.attrs,
383       ## name of the field
384       attribute name { xsd:string },
385       ## Binary attribute, true if the field is writeable
386       attribute writable { "0" | "1" }?,
387       ## Binary attribute, true if the field is readable
388       attribute readable { "0" | "1" }?,
389       ## Binary attribute, true if the field is private to the structure or has public ("0") visibility
390       attribute private { "0" | "1" }?,
391       ## number of bits of the field
392       attribute bits { xsd:integer }?,
393
394       # Other elements a property can contain
395       (Info.elements
396        & (Callback | AnyType))
397     }
398
399   Callback =
400     ## A callback closure, that is a function called when a signal is emitted (as an answer to that signal)
401     element callback {
402       Info.attrs,
403       ## name of the callback
404       attribute name { xsd:string },
405       ## the C type returned by the callback closure (i.e. function)
406       attribute c:type { xsd:string }?,
407       ## Binary attribute, true if the callback can throw an error
408       attribute throws { "0" | "1" }?,
409
410       # Other elements a property can contain
411       (Info.elements
412        & Callable.params?
413        & Callable.return?)
414     }
415
416   Implements  =
417     ## Give the name of the interface it implements. This element is generally used within a class element
418     element implements {
419       ## name of the interface implemented by a class
420       attribute name { xsd:string }
421     }
422
423   Prerequisite  =
424     ## Interface which is pre-required to implement another interface. This node is generally using within an interface element
425     element prerequisite {
426       ## name of the required interface
427       attribute name { xsd:string }
428     }
429
430   # A generic grammar element to represent either a simple Type or an Array of the same Type
431   AnyType = (Type | ArrayType)
432
433   Type =
434     # A simple type of data (as opposed to an array)
435     element type {
436       ## name of the type
437       attribute name { xsd:string }?,
438       ## the C representation of the type
439       attribute c:type { xsd:string }?,
440       ## Binary attribute which is "0" (false) if the element is not introspectable. It doesn't exist in the bindings, due in general to missing information in the annotations in the original C code
441       attribute introspectable { "0" | "1" }?,
442
443       (DocElements & AnyType*)
444     }
445
446   ArrayType =
447     ## An array type of data where each element is of the same type
448     element array {
449       ## name of the array type
450       attribute name { xsd:string }?,
451       ## Binary attribute, true if the last element of the array is zero. For example, in an array of pointers, the last pointer would be NULL
452       attribute zero-terminated { "0" | "1" }?,
453       ## size of an array of predetermined fixed size. For example a C array declared as char arr[5].
454       attribute fixed-size { xsd:integer }?,
455       ## Binary attribute which is "0" (false) if the element is not introspectable. It doesn't exist in the bindings, due in general to missing information in the annotations in the original C code
456       attribute introspectable { "0" | "1" }?,
457           ## 0-based index of parameter element that specifies the length of the array
458       attribute length { xsd:integer }?,
459       ## the C representation of the array type
460       attribute c:type { xsd:string }?,
461
462       # Type of the values contained in the array
463       AnyType
464     }
465
466   TransferOwnership =
467     ## attributes used by many elements for the transfer of ownership, with for example, a returned value. "none" if the recipient does not own the value, "container" if the recipient owns the container but not the value (for arrays or lists for example) , "full" the recipient owns the entire value. For details, see https://wiki.gnome.org/Projects/GObjectIntrospection/Annotations#Memory_and_lifecycle_management
468     attribute transfer-ownership { "none" | "container" | "full" }
469
470   Constructor =
471     ## A constructor of a class
472     element constructor {
473       Callable.attrs,
474
475       (Info.elements
476        & Callable.params?
477        & Callable.return?)
478     }
479
480   ## Attributes of a Callable (functions, callbacks, closures, etc...)
481   Callable.attrs = (
482     Info.attrs,
483     ## name of the Callable
484     attribute name { xsd:string },
485     # C identifier in the source code of the Callable
486     attribute c:identifier { xsd:string }?,
487     ## Callable it is shadowed by. For example, in C++, only one version of an overloaded callable will appear
488     attribute shadowed-by { xsd:string }?,
489     ## Callable it shadows. For example, in C++, only one version of an overloaded callable will appear
490     attribute shadows { xsd:string }?,
491     ## Binary attribute, true if the callable can throw an error
492     attribute throws { "0" | "1" }?,
493     ## if for backward compatibility reason the callable has a name in the source code but should be known by another one, this attribute contains the new name    
494     attribute moved-to { xsd:string }?
495   )
496
497   VarArgs =
498     ## an element, usually found in a parameter element for variadic parameter in a function or callable
499     element varargs {
500       empty
501     }
502
503   # Refer to https://wiki.gnome.org/Projects/GObjectIntrospection/Annotations#Support_for_GObject_closures 
504   Callable.params =
505     ## parameters element of a callable, that is in general parameters of a function or similar
506     element parameters {
507       ## parameter element of a list of parameters
508       element parameter {
509         ## name of the parameter
510         attribute name { xsd:string }?,
511         ## Binary attribute, true if the parameter can have a null value
512         attribute nullable { "0" | "1" }?,
513         ## Deprecated. Replaced by nullable and optional
514         attribute allow-none { "0" | "1" }?,
515       ## Binary attribute which is "0" (false) if the element is not introspectable. It doesn't exist in the bindings, due in general to missing information in the annotations in the original C code
516         attribute introspectable { "0" | "1" }?,
517         ## the parameter is a user_data for callbacks. The value points to a different parameter that is the actual callback
518         attribute closure { xsd:integer }?,
519         ## the parameter is a destroy_data for callbacks. The value points to a different parameter that is the actual callback
520         attribute destroy { xsd:integer }?,
521         ## the parameter is a callback, the value indicates the lifetime of the call. For language bindings which want to know when the resources required to do the call can be freed. "notified" valid until a GDestroyNotify argument is called, "async" only valid for the duration of the first callback invocationi (can only be called once), "call" only valid for the duration of the call, can be called multiple times during the call. 
522         attribute scope { "notified" | "async" | "call" }?,
523         ## direction of the parameter. "in" goes into the callable, "out" for output parameters from the callable (reference in C++, var in Pascal, etc...), "inout" for both (like a pre-allocated structure which will be filled-in by the callable)
524         attribute direction { "out" | "in" | "inout" }?,
525         ## Binary attribute, true if the caller should allocate the parameter before calling the callable
526         attribute caller-allocates { "0" | "1" }?,
527         ## Binary attribute, true if the parameter is optional
528         attribute optional { "0" | "1" }?,
529         ##  Binary attribute, true if the parameter can be omitted from the introspected output
530         attribute skip { "0" | "1" }?,
531         TransferOwnership?,
532
533         (DocElements
534          & (AnyType | VarArgs))
535       }*
536
537       ## instance-parameter is a parameter of a C function which is an instance of an existing object. So the callable is surely a method of a class, and this parameter points to the instance of the object. In C++, this would be equivalent to the pointer this which is not passed to the method, in Python it's equivalent to self.
538       & element instance-parameter {
539         ## name of the instance-parameter
540         attribute name { xsd:string },
541         ## Binary attribute, true if the parameter can have a null value
542         attribute nullable { "0" | "1" }?,
543         ## Deprecated. Replaced by nullable and optional
544         attribute allow-none { "0" | "1" }?,
545         ## direction of the parameter. "in" goes into the callable, "out" for output parameters from the callable (reference in C++, var in Pascal, etc...), "inout" for both (like a pre-allocated structure which will be filled-in by the callable)
546         attribute direction { "out" | "in" | "inout" }?,
547         ## Binary attribute, true if the caller should allocate the parameter before calling the callable
548         attribute caller-allocates { "0" | "1" }?,
549         TransferOwnership?,
550
551         (DocElements
552          & Type)
553       }?
554     }
555
556   Callable.return =
557     ## return value of a callable
558     element return-value {
559       ## Binary attribute which is "0" (false) if the element is not introspectable. It doesn't exist in the bindings, due in general to missing information in the annotations in the original C code
560       attribute introspectable { "0" | "1" }?,
561       ## Binary attribute, true if the parameter can have a null value
562       attribute nullable { "0" | "1" }?,
563       ## the parameter is a user_data for callbacks. The value points to a different parameter that is the actual callback
564       attribute closure { xsd:integer }?,
565       ## the parameter is a callback, the value indicates the lifetime of the call. For language bindings which want to know when the resources required to do the call can be freed. "notified" valid until a GDestroyNotify argument is called, "async" only valid for the duration of the first callback invocationi (can only be called once), "call" only valid for the duration of the call, can be called multiple times during the call. 
566       attribute scope { "notified" | "async" | "call" }?,
567       ## the parameter is a destroy_data for callbacks. The value points to a different parameter that is the actual callback
568       attribute destroy { xsd:integer }?,
569       ##  Binary attribute, true if the parameter can be omitted from the introspected output
570       attribute skip { "0" | "1" }?,
571       ## Deprecated. Replaced by nullable and optional
572       attribute allow-none { "0" | "1" }?,
573       TransferOwnership?,
574
575       (DocElements
576        & AnyType)
577     }
578
579   Function =
580     ## element defining a standalone function (as usual in most programming languages)
581     element function {
582       Callable.attrs,
583
584       (Callable.params?
585        & Callable.return?
586        & DocElements)
587     }
588
589   Method =
590     ## element defining a method from a class
591     element method {
592       Callable.attrs,
593
594       (Info.elements
595        & Callable.params?
596        & Callable.return?)
597     }
598
599   VirtualMethod =
600     ## element defining a virtual method from a class, concept similar to C++
601     element virtual-method {
602       Callable.attrs,
603       ## name of the callable called when invoking this virtual method
604       attribute invoker { xsd:string }?,
605
606       (Info.elements
607        & Callable.params?
608        & Callable.return?)
609     }
610
611   Union =
612     ## element defining a type of data being a union of type, similar to union in C/C++ but extended with fields and methods
613     element union {
614       Info.attrs,
615       ## name of the union
616       attribute name { xsd:string }?,
617       ## C type defining the union
618       attribute c:type { xsd:string }?,
619       ## prefix to filter out from C functions. For example, gtk_window_new will lose gtk_
620       attribute c:symbol-prefix { xsd:string }?,
621       ## GObject compatible type name
622       attribute glib:type-name { xsd:string }?,
623       ## function to retrieve the GObject compatible type of the element
624       attribute glib:get-type { xsd:string }?,
625
626       (Info.elements
627        & Field*
628        & Constructor*
629        & Method*
630        & Function*
631        & Record*)
632     }
633
634   BitField =
635     ## element defining a bit field (as in C)
636     element bitfield {
637       Info.attrs,
638       ## name of the bit field
639       attribute name { xsd:string },
640       ## corresponding C type of the bit field type
641       attribute c:type { xsd:string },
642       ## GObject compatible type name
643       attribute glib:type-name { xsd:string }?,
644       ## function to retrieve the GObject compatible type of the element
645       attribute glib:get-type { xsd:string }?,
646
647       (Info.elements
648        & Member*
649        & Function*)
650     }
651
652   Enum =
653     ## element defining a enumeration type similar to enum in C/C++
654     element enumeration {
655       Info.attrs,
656       ## name of the enumeration
657       attribute name { xsd:string },
658       ## corresponding C type of the enumeration type
659       attribute c:type { xsd:string },
660       ## GObject compatible type name
661       attribute glib:type-name { xsd:string }?,
662       ## function to retrieve the GObject compatible type of the element
663       attribute glib:get-type { xsd:string }?,
664       ## Error domain of this enumeration in a stringified form
665       attribute glib:error-domain { xsd:string }?,
666
667       (Info.elements
668        & Member*
669        & Function*)
670     }
671
672   Member =
673     ## element defining a member of a bit field or an enumeration
674     element member {
675       Info.attrs,
676       ## name of the member
677       attribute name { xsd:string },
678       ## value of the member
679       attribute value { xsd:string },
680       ## corresponding C type of the member
681       attribute c:identifier { xsd:string },
682       ## short nickname of the member
683       attribute glib:nick { xsd:string }?,
684
685       Info.elements
686     }
687 }