Register GTypes via static constructors
@alexl
Submitted by Alexander Larsson Link to original bug (#756451)
Description
Its common to run into issues where types are not registered yet, but you still want to access them by name. For example, you have type names in .ui files. In order to fix this we sprinkle the code all over the place with g_type_ensure() calls, but even this is often not enough.
One possible way to solve this is to use a static constructor to register the get_type() function in G_DEFINE_TYPE, so that all types are initialized early.