The code that implements glade_project_get_typeis in the library libgladeui, which is compiled separately and associated with the executable file glade.
libgladeui glade. glade_project_get_type glade-project.c. glade_project_get_type , , glade_project_get_type:
G_DEFINE_TYPE_WITH_CODE (GladeProject, glade_project, G_TYPE_OBJECT,
G_ADD_PRIVATE (GladeProject)
G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_MODEL,
glade_project_model_iface_init)
G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_DRAG_SOURCE,
glade_project_drag_source_init))
glib, gobject/gtype.h. - , ( ##) ( glade_project) , , _get_type.
, :
#define MAKE_FUNC(name, val) int my_ ## name ## _function (void) { return val; }
MAKE_FUNC(magic, 42)
int main(void) {
printf("%d\n", my_magic_function());
return 0;
}
my_magic_function, MAKE_FUNC . MAKE_FUNC(magic, 42)
int my_magic_function(void) { return 42; }