gir2glade is an XSL Transform for creating a [
glade](
https://glade.gnome.org)
catalog from a [
gobject-introspection](
200~https://wiki.gnome.org/action/show/Projects/GObjectIntrospection?action=show&redirect=GObjectIntrospection)
It can be used on any gir file with any XSLT processor.
gir2glade was written because I didn't want to have to maintain a glade catalog
especially when all of the data is already in the gir files being built as part
With it, you can add a build target to your build system that depends on your
gir and have it create the catalog and install it into the proper place.
The following will create the glade catalog and output it to stdout.
xsltproc gir2glade.xsl GtkIM-0.0.gir You can save it to a file with
xsltproc gir2glade.xsl GtkIM-0.0.gir > gtkim.xml Then add the path you wrote it to to glade's catalog search path and you're set!
Below is a quick HOWTO, to generate the catalog with meson. You may need to
tweak the path of
`gir2glade.xsl` as it's assumed to be in the root of your
This is spread a couple of files, but it can be found in the
[
GtkIM](
https://bitbucket.org/rw_grim/gtkim) source tree.
GLADEUI = dependency('gladeui-2.0', version: '>=3.0.0') XSLTPROC = find_program('xsltproc', required : true) GIR2GLADE = files('gir2glade.xsl') gtkim_gir = gnome.generate_gir(gtkim, sources : GTKIM_SOURCES + GTKIM_HEADERS + GTKIM_PUBLIC_BUILT_SOURCES + GTKIM_PUBLIC_BUILT_HEADERS, includes : ['GModule-2.0', 'GObject-2.0', 'Gtk-3.0'], nsversion : '@0@.0'.format(GTKIM_MAJOR_VERSION), gtkim_glade_catalog = custom_target('gtkim.xml', input : [gtkim_gir[0], GIR2GLADE], command : [XSLTPROC, '--output', '@OUTPUT@', '@INPUT1@', '@INPUT0@'], install_dir : GLADEUI.get_pkgconfig_variable('catalogdir'))