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"
8 ## Root node of a GIR repository. It contains namespaces, which can in turn be implemented in several libraries
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 }?,
18 # Other elements a repository can contain
25 ## Namespace which maps metadata entries to C functionality. This a similar concept to namespace in C++, but for GObject-based C libraries
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 }?,
41 # Other elements a namespace can contain
57 ## element defining an annotation from the source code, usually a user-defined annotation associated to a parameter or a return value
59 ## name of the attribute
60 attribute name { xsd:string },
61 ## value of the attribute
62 attribute value { xsd:string }
66 ## Dependant C header file which should be included in C programs
68 ## File name of the C header file. The path can be relative.
69 attribute name { xsd:string },
75 ## Dependant namespace to include with the current namespace. For example, Gtk will need the namespace GLib
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 }?,
86 ## Deprecated: package name containing the library
88 ## name of the package
89 attribute name { xsd:string },
95 ## Type's name substitution, representing a typedef in C
97 # Attributes of an Alias (see definition below)
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 },
104 # Other elements an alias can contain
110 ## Abstract interface to other classes
112 # Attributes of an Interface (see definition below)
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 }?,
127 # Other elements an interface can contain
143 ## GObject inherited class definition
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" }?,
174 # Other elements a class can contain
191 ## Boxed type (wrapper to opaque C structures registered by the type system)
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 }?,
203 # Other elements a Boxed type can contain
209 ## Record definition, equivalent to a C struct, that is a simple structure, not a class
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 }?,
230 # Other elements a record can contain
241 # Some base information for most elements like version, deprecation, stability, if they are introspectable or not, etc...
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 }?
255 # Documentation of elements
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
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
275 ## documentation of an element
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
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
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 },
310 # Information about elements can be a documentation of annotations
317 ## A constant entity, similar to const variable in C
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 }?,
329 # Other elements a record can contain
335 ## Property, that is a variable or members with getter and setter functions
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
351 # Other elements a property can contain
357 ## A signal as defined in the GObject system (https://developer.gnome.org/gobject/stable/signal.html)
358 element glib:signal {
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" }?,
373 # Other elements a property can contain
380 ## A field of struct of union structure, that is a C bit field, that is a fixed length in bits variable
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 }?,
394 # Other elements a property can contain
396 & (Callback | AnyType))
400 ## A callback closure, that is a function called when a signal is emitted (as an answer to that signal)
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" }?,
410 # Other elements a property can contain
417 ## Give the name of the interface it implements. This element is generally used within a class element
419 ## name of the interface implemented by a class
420 attribute name { xsd:string }
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 }
430 # A generic grammar element to represent either a simple Type or an Array of the same Type
431 AnyType = (Type | ArrayType)
434 # A simple type of data (as opposed to an array)
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" }?,
443 (DocElements & AnyType*)
447 ## An array type of data where each element is of the same type
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 }?,
462 # Type of the values contained in the array
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" }
471 ## A constructor of a class
472 element constructor {
480 ## Attributes of a Callable (functions, callbacks, closures, etc...)
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 }?
498 ## an element, usually found in a parameter element for variadic parameter in a function or callable
503 # Refer to https://wiki.gnome.org/Projects/GObjectIntrospection/Annotations#Support_for_GObject_closures
505 ## parameters element of a callable, that is in general parameters of a function or similar
507 ## parameter element of a list of parameters
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" }?,
534 & (AnyType | VarArgs))
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" }?,
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" }?,
580 ## element defining a standalone function (as usual in most programming languages)
590 ## element defining a method from a class
600 ## element defining a virtual method from a class, concept similar to C++
601 element virtual-method {
603 ## name of the callable called when invoking this virtual method
604 attribute invoker { xsd:string }?,
612 ## element defining a type of data being a union of type, similar to union in C/C++ but extended with fields and methods
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 }?,
635 ## element defining a bit field (as in C)
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 }?,
653 ## element defining a enumeration type similar to enum in C/C++
654 element enumeration {
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 }?,
673 ## element defining a member of a bit field or an enumeration
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 }?,