I want to extend XML UI in Python. I created a class that derives from a widget and Gtk.Buildable. The C API has a function: custom_tag_start that takes arguments: buildable, builder, child, tagname, parser and data; and returns bool. After some searching I found that parser and data are actually return arguments and in Python bindings you only receive arguments up to tagname and you are supposed to return 3-tuple: bool, parser, data.
The sub-parser API in GtkBuildable relies of GMarkupParser, which is a very C API, and has no proper introspection, which means it cannot be properly consumed by language bindings.
I want to receive the XML subtree of the custom element encountered by GtkBuildableParser. I can see GtkBuildableParser is just a flat C structure with 4 callbacks. I’m trying to install Python callbacks using ctypes, then hopefully they will get called.