From Juan Pablo Ugarte’s Cambalache talk in GUADEC, it appears that apps / libs need to export the template widget class definitions as GIR files for Cambalache to load them. This sounds fine for libraries, but I’m not exactly sure how it works for apps.
Consider the case for GNOME Software, which uses custom / template widgets in 47 of it’s 48 .ui files. All .ui and template widget definitions (.c) are located in gnome-software/src/, meaning they are not part of gnome-software/lib/ a.k.a libgnomesoftware.so.
What exactly would be required in this case, if one needs to load and edit all .ui files for GNOME Software in Cambalache ?
Back in the day one of the main features of Glade 3 was being able to extend the widgets available to use without having to modify the source code. This was done by creating a XML widget catalog unfortunately this is a high bar for every application as it required not only writing an XML file describing all the metadata but also having a library to load the new types.
Having all of your application’s UI files in the same project allows exposing all the templates for use without any extra steps, all you need to do is have all your templates types in the same project and you will be able to use them immediately.
The only current limitation is that you wont be able to use any custom properties since they are defined in code and Cambalache does not have access to the GType. For that we still going to need to create a catalog file similar to Glade.
Cambalache main, now supports loading 3rd party catalogs from GLib.get_system_data_dirs()/cambalache/catalogs and ~/.cambalache/catalogs
These files are created from gir data using a script bundled in Cambalache sources, but the whole process needs some cleanup and more importantly documentation!