Contents
Core
The goal of the core namespace is to define metadata common to most programming languages. It will *not* cover everything available in all, or even popular languages. Just the most important parts.
Repository
This is the root node for all metadata specifications.
Meant to represent a shared library, module:
<repository version="0.1"> ... </repository>
Children: implementation, namespace
Namespace
Meant to represent a bunch of classes/interfaces:
<namespace name="Gtk"> ... </namespace>
Children: class, interface, enumeration, bitfield, record, functions, callback, constant
Implementation
FIXME: Carefully review this part.
<implementation uri="..."> ... </implementation>
It may make sense to move the implementation information to a separate file (possibly a GKeyFile), as this can be very system- and language-specific and we want to keep the GIR file platform-independent.
Class
Does not support multiple inheritance.
<class name="Window" parent="Widget"> ... </class>
Children: implements, constructors, methods, properties, members
Implements
<implements> <interface name="Buildable"/> </implements>
Constructors/Methods/Functions
Constructors and Functions are identical to methods, apart from the names.
<methods> <method name="set_title"> ... </method> </methods>
Methods children: parameters, return-values
Parameters
Return values are identical, apart from the tag names
<parameters> <parameter name="title" direction="in"> <type name="String"/> </parameter> </parameters>
Direction can be either, "in", "out" or "in-out".
Members/Properties
See wikipedia on property and wikipedia on field.
Members are identical to properties, apart from the tag names.
<properties> <property name="title" readable="True" writable="True"> <type name="String"/> </property> </properties>
Enumeration
See wikipedia on enumerated type and wikipedia on bit field
bitfield is identical to enumerations, apart from the tag names.
<enumeration name="WindowType"> <members> <member name="toplevel" value="0"/> </members> </enumeration>
Record
<record name="GdkRectangle"> <members> <member name="x"> <type name="Integer"> </member> </members> </record>
Callback
<callback name="GtkTranslateFunc"> <return-values> <return-value> <type="String"/> </return-value> </return-values> <parameters> <parameter name="path"> <type name="String"/> </parameter> <parameter name="func_data"> <type name=""/> </parameter> </parameters> </callback>
Constant
<constant name="STOCK_NEW" type="String" value="gtk-new"/>
C Language
See C Language
GObject
See GLib