コード例 #1
0
ファイル: panel-modules.c プロジェクト: mitya57/gnome-panel
void
panel_modules_ensure_loaded (void)
{
	static gboolean loaded_dirs = FALSE;
	const char *module_path;

	panel_modules_ensure_extension_points_registered ();

	if (!loaded_dirs) {
		GList *modules;
		loaded_dirs = TRUE;

		/* We load the modules explicitly instead of using scan_all
		 * so that we can leak a reference to them.  This prevents them
		 * from getting unloaded later (something they aren't designed
		 * to cope with) */
		modules = g_io_modules_load_all_in_directory (PANEL_MODULES_DIR);
		g_list_free (modules);

		module_path = g_getenv ("GNOME_PANEL_EXTRA_MODULES");

		if (module_path) {
			gchar **paths;
			int i;

			paths = g_strsplit (module_path, ":", 0);

			for (i = 0; paths[i] != NULL; i++) {
				modules = g_io_modules_load_all_in_directory (paths[i]);
				g_list_free (modules);
			}

			g_strfreev (paths);
		}

		panel_applets_manager_dbus_get_type ();
	}
}
コード例 #2
0
static void
load_panel_plugins (GnomeControlCenter *shell)
{
  GList *modules;

  /* only allow this function to be run once to prevent modules being loaded
   * twice
   */
  if (shell->priv->extension_point)
    return;

  /* make sure the base type is registered */
  g_type_from_name ("CcPanel");

  shell->priv->extension_point
    = g_io_extension_point_register (CC_SHELL_PANEL_EXTENSION_POINT);

  /* load all the plugins in the panels directory */
  modules = g_io_modules_load_all_in_directory (PANELS_DIR);
  g_list_free (modules);

}
コード例 #3
0
ファイル: giomodules.c プロジェクト: msakai/ruby-gnome2
static VALUE
rg_m_load_all_in_directory(G_GNUC_UNUSED VALUE self, VALUE dirname)
{
        return GLIST2ARY_FREE(g_io_modules_load_all_in_directory(RVAL2CSTR(dirname)));
}