static gboolean gtk_theme_engine_load (GTypeModule *module) { GtkThemeEngine *engine = GTK_THEME_ENGINE (module); gchar *engine_path; engine_path = gtk_rc_find_module_in_path (engine->name); if (!engine_path) { g_warning (_("Unable to locate theme engine in module_path: \"%s\","), engine->name); return FALSE; } /* load the lib */ GTK_NOTE (MISC, g_message ("Loading Theme %s\n", engine_path)); engine->library = g_module_open (engine_path, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL); g_free(engine_path); if (!engine->library) { g_warning (g_module_error()); return FALSE; } /* extract symbols from the lib */ if (!g_module_symbol (engine->library, "theme_init", (gpointer *)&engine->init) || !g_module_symbol (engine->library, "theme_exit", (gpointer *)&engine->exit) || !g_module_symbol (engine->library, "theme_create_rc_style", (gpointer *)&engine->create_rc_style)) { g_warning (g_module_error()); g_module_close (engine->library); return FALSE; } /* call the theme's init (theme_init) function to let it */ /* setup anything it needs to set up. */ engine->init (module); return TRUE; }
static VALUE rg_m_find_module_in_path(G_GNUC_UNUSED VALUE self, VALUE module_file) { return CSTR2RVAL_FREE(gtk_rc_find_module_in_path(RVAL2CSTR(module_file))); }