Re: where to find GIR XML documentation?



Hi,

Unfortunately, the GIR XML is basically an intermediate product, and unless you implement the same algorithms as the GIR typelib compiler, you won't end up matching the same semantics. You can see this in places where we count the number of '*' characters in the c:type as a heuristic [0]. I don't think anybody would be against improving the GIR XML to make things more high-level and have more meaningful semantics, but I think improving the typelib is going to be more fruitful, since it comes after all the processing that the GIR compiler also does.

[0] https://gitlab.gnome.org/GNOME/gobject-introspection/blob/master/girepository/girparser.c#L2034

On Tue, Feb 19, 2019 at 5:38 AM Tony Houghton <h realh co uk> wrote:

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

_______________________________________________
gir-devel-list mailing list
gir-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/gir-devel-list


--
  Jasper


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