summaryrefslogtreecommitdiff
path: root/src/compositor/meta-plugin-manager.c
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2011-03-05 16:16:26 -0500
committerDan Winship <danw@gnome.org>2011-03-07 18:19:53 -0500
commitbb50f65532f8f513d483436de88b964f6ac0a343 (patch)
treeed438ac7b00156666125e8ad1c764905873fee69 /src/compositor/meta-plugin-manager.c
parent28752718c594201210217ba1f6d240d7f9a374a6 (diff)
downloadmutter-bb50f65532f8f513d483436de88b964f6ac0a343.tar.gz
Allow mutter to be used as a library
Move all of the mutter code into a new libmutter-wm.so, split its main() method into meta_get_option_context(), meta_init() and meta_run(), add methods for using in-process plugins, and add libmutter-wm.pc pointing to the new library. The mutter binary is now just a tiny program that links against libmutter-wm. The --version and --mutter-plugins options are handled at the mutter level, not in libmutter-wm, and a few strange unused command-line options (--no-force-fullscreen and --no-tab-popup) have been removed. https://bugzilla.gnome.org/show_bug.cgi?id=643959
Diffstat (limited to 'src/compositor/meta-plugin-manager.c')
-rw-r--r--src/compositor/meta-plugin-manager.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/compositor/meta-plugin-manager.c b/src/compositor/meta-plugin-manager.c
index 13171ffaf..1001a01d8 100644
--- a/src/compositor/meta-plugin-manager.c
+++ b/src/compositor/meta-plugin-manager.c
@@ -63,7 +63,6 @@ meta_plugin_manager_load (MetaPluginManager *plugin_mgr,
gchar *path;
MetaModule *module;
GType plugin_type;
- MetaPlugin *plugin;
if (g_path_is_absolute (plugin_name))
path = g_strdup (plugin_name);
@@ -83,13 +82,25 @@ meta_plugin_manager_load (MetaPluginManager *plugin_mgr,
}
plugin_type = meta_module_get_plugin_type (module);
+ meta_plugin_manager_register (plugin_mgr, plugin_type);
+
+ g_type_module_unuse (G_TYPE_MODULE (module));
+ g_free (path);
+}
+
+/*
+ * Registers the given plugin type
+ */
+void
+meta_plugin_manager_register (MetaPluginManager *plugin_mgr,
+ GType plugin_type)
+{
+ MetaPlugin *plugin;
+
plugin_types = g_slist_prepend (plugin_types, GSIZE_TO_POINTER (plugin_type));
plugin = g_object_new (plugin_type, NULL);
plugin_mgr->plugins = g_list_prepend (plugin_mgr->plugins, plugin);
-
- g_type_module_unuse (G_TYPE_MODULE (module));
- g_free (path);
}
void