Re: where to find GIR XML documentation?




On Tue, 19 Feb 2019 at 09:40, Philip Withnall <philip tecnocode co uk> wrote:
On Tue, 2019-02-19 at 17:26 +1100, David Bellot via gir-devel-list wrote:
Hi,

I'm looking for a complete description of the GIR xml format. The website is a bit outdated and misses a lot of documentation (or at least it's my impression).

https://developer.gnome.org/gi/stable/gi-gir-reference.html is the best I know of, but it’s pretty thin and you probably found it in the docs/ directory instead.

https://developer.gnome.org/gi/stable/index.html and https://wiki.gnome.org/Projects/GObjectIntrospection/Annotations are helpful for summarising what sort of information should be available in each type of node, but unfortunately there's no direct mapping between the three types of representation. 

Why do you need a description of the XML format? Typically, using the GIR utilities means you don’t need to know the XML format.

Parsing the XML seems to be the only way to generate good quality static definitions for a typesafe language eg Java, Kotlin, Typescript. For a start there are a few useful immediate children of the root node that you can't read with the typelib API (eg C headers, pkg-config package name). But most of all, GITypeInfo doesn't contain a type name (calling g_base_inf_get_name() on a GITypeInfo causes an abort!). So any function definitions in the target language would have argument and return types limited to primitive types, opaque pointers, generic GObjects and other generic boxed types.

--
TH



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]