Commit 4c80d9f4 authored by William Jon McCann's avatar William Jon McCann Committed by William Jon McCann

Add a stub for xsettings plugin.

2007-10-25  William Jon McCann  <mccann@jhu.edu>

	* configure.ac:
	* gui/settings-daemon/Makefile.am:
	* gui/settings-daemon/gdm-settings-manager.c:
	(gdm_settings_manager_start), (gdm_settings_manager_stop),
	(gdm_settings_manager_dispose), (gdm_settings_manager_init):
	* gui/settings-daemon/gdm-settings-module.c:
	(gdm_settings_module_load), (gdm_settings_module_unload),
	(gdm_settings_module_get_path), (gdm_settings_module_new_object),
	(gdm_settings_module_init), (gdm_settings_module_finalize),
	(gdm_settings_module_class_init), (gdm_settings_module_new):
	* gui/settings-daemon/gdm-settings-module.h:
	* gui/settings-daemon/gdm-settings-plugin.c: (dummy),
	(gdm_settings_plugin_class_init), (gdm_settings_plugin_init),
	(gdm_settings_plugin_activate), (gdm_settings_plugin_deactivate):
	* gui/settings-daemon/gdm-settings-plugin.h:
	* gui/settings-daemon/gdm-settings-plugins-engine.c:
	(gdm_settings_plugin_info_free),
	(gdm_settings_plugins_engine_load), (compare_plugin_info),
	(gdm_settings_plugins_engine_load_dir),
	(gdm_settings_plugins_engine_load_all),
	(gdm_settings_plugins_engine_init),
	(gdm_settings_plugins_engine_garbage_collect),
	(gdm_settings_plugins_engine_shutdown),
	(gdm_settings_plugins_engine_get_plugins_list),
	(load_plugin_module),
	(gdm_settings_plugins_engine_activate_plugin_real),
	(gdm_settings_plugins_engine_activate_plugin),
	(gdm_settings_plugins_engine_deactivate_plugin_real),
	(gdm_settings_plugins_engine_deactivate_plugin),
	(gdm_settings_plugins_engine_plugin_is_active),
	(gdm_settings_plugins_engine_plugin_is_available),
	(reactivate_all), (gdm_settings_plugins_engine_activate_all),
	(gdm_settings_plugins_engine_get_plugin_name),
	(gdm_settings_plugins_engine_get_plugin_description),
	(gdm_settings_plugins_engine_get_plugin_authors),
	(gdm_settings_plugins_engine_get_plugin_website),
	(gdm_settings_plugins_engine_get_plugin_copyright):
	* gui/settings-daemon/gdm-settings-plugins-engine.h:
	* gui/settings-daemon/main.c: (main):
	* gui/settings-daemon/plugins/Makefile.am:
	* gui/settings-daemon/plugins/xsettings/Makefile.am:
	* gui/settings-daemon/plugins/xsettings/gdm-xsettings-plugin.c:
	(gdm_xsettings_plugin_init), (gdm_xsettings_plugin_finalize),
	(impl_activate), (impl_deactivate),
	(gdm_xsettings_plugin_class_init):
	* gui/settings-daemon/plugins/xsettings/gdm-xsettings-plugin.h:
	* gui/settings-daemon/plugins/xsettings/xsettings.gdm-settings-plug
	in.desktop.in:
	Add a stub for xsettings plugin.


svn path=/trunk/; revision=5412
parent ad976561
2007-10-25 William Jon McCann <mccann@jhu.edu>
* configure.ac:
* gui/settings-daemon/Makefile.am:
* gui/settings-daemon/gdm-settings-manager.c:
(gdm_settings_manager_start), (gdm_settings_manager_stop),
(gdm_settings_manager_dispose), (gdm_settings_manager_init):
* gui/settings-daemon/gdm-settings-module.c:
(gdm_settings_module_load), (gdm_settings_module_unload),
(gdm_settings_module_get_path), (gdm_settings_module_new_object),
(gdm_settings_module_init), (gdm_settings_module_finalize),
(gdm_settings_module_class_init), (gdm_settings_module_new):
* gui/settings-daemon/gdm-settings-module.h:
* gui/settings-daemon/gdm-settings-plugin.c: (dummy),
(gdm_settings_plugin_class_init), (gdm_settings_plugin_init),
(gdm_settings_plugin_activate), (gdm_settings_plugin_deactivate):
* gui/settings-daemon/gdm-settings-plugin.h:
* gui/settings-daemon/gdm-settings-plugins-engine.c:
(gdm_settings_plugin_info_free),
(gdm_settings_plugins_engine_load), (compare_plugin_info),
(gdm_settings_plugins_engine_load_dir),
(gdm_settings_plugins_engine_load_all),
(gdm_settings_plugins_engine_init),
(gdm_settings_plugins_engine_garbage_collect),
(gdm_settings_plugins_engine_shutdown),
(gdm_settings_plugins_engine_get_plugins_list),
(load_plugin_module),
(gdm_settings_plugins_engine_activate_plugin_real),
(gdm_settings_plugins_engine_activate_plugin),
(gdm_settings_plugins_engine_deactivate_plugin_real),
(gdm_settings_plugins_engine_deactivate_plugin),
(gdm_settings_plugins_engine_plugin_is_active),
(gdm_settings_plugins_engine_plugin_is_available),
(reactivate_all), (gdm_settings_plugins_engine_activate_all),
(gdm_settings_plugins_engine_get_plugin_name),
(gdm_settings_plugins_engine_get_plugin_description),
(gdm_settings_plugins_engine_get_plugin_authors),
(gdm_settings_plugins_engine_get_plugin_website),
(gdm_settings_plugins_engine_get_plugin_copyright):
* gui/settings-daemon/gdm-settings-plugins-engine.h:
* gui/settings-daemon/main.c: (main):
* gui/settings-daemon/plugins/Makefile.am:
* gui/settings-daemon/plugins/xsettings/Makefile.am:
* gui/settings-daemon/plugins/xsettings/gdm-xsettings-plugin.c:
(gdm_xsettings_plugin_init), (gdm_xsettings_plugin_finalize),
(impl_activate), (impl_deactivate),
(gdm_xsettings_plugin_class_init):
* gui/settings-daemon/plugins/xsettings/gdm-xsettings-plugin.h:
* gui/settings-daemon/plugins/xsettings/xsettings.gdm-settings-plug
in.desktop.in:
Add a stub for xsettings plugin.
2007-10-25 William Jon McCann <mccann@jhu.edu>
* gui/settings-daemon/Makefile.am:
......
......@@ -90,6 +90,15 @@ PKG_CHECK_MODULES(SETTINGS_DAEMON,
AC_SUBST(SETTINGS_DAEMON_CFLAGS)
AC_SUBST(SETTINGS_DAEMON_LIBS)
PKG_CHECK_MODULES(SETTINGS_PLUGIN,
gtk+-2.0 >= $GTK_REQUIRED_VERSION
)
AC_SUBST(SETTINGS_PLUGIN_CFLAGS)
AC_SUBST(SETTINGS_PLUGIN_LIBS)
PLUGIN_LIBTOOL_FLAGS="-export_dynamic -module -avoid-version"
AC_SUBST(PLUGIN_LIBTOOL_FLAGS)
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
AC_PATH_XTRA
......@@ -1272,6 +1281,8 @@ Makefile
daemon/Makefile
gui/Makefile
gui/settings-daemon/Makefile
gui/settings-daemon/plugins/Makefile
gui/settings-daemon/plugins/xsettings/Makefile
gui/simple-greeter/Makefile
gui/simple-greeter/libnotificationarea/Makefile
gui/simple-chooser/Makefile
......
NULL =
SUBDIRS = \
plugins \
$(NULL)
INCLUDES = \
-I$(top_srcdir)/common \
-DAUTHDIR=\""$(authdir)"\" \
-DDATADIR=\""$(datadir)"\" \
-DGDMCONFDIR=\"$(gdmconfdir)\" \
-DDMCONFDIR=\""$(dmconfdir)"\" \
-DGDMLOCALEDIR=\""$(gdmlocaledir)"\" \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-DGDM_SETTINGS_LOCALEDIR=\""$(datadir)/locale"\"\
-DLIBEXECDIR=\""$(libexecdir)"\" \
-DSBINDIR=\""$(sbindir)"\" \
-DPIXMAPDIR=\""$(pixmapdir)"\" \
-DGDM_SETTINGS_PLUGINDIR=\""$(libdir)/gdm/settings/plugins"\" \
$(SETTINGS_DAEMON_CFLAGS) \
$(NULL)
......@@ -22,6 +22,12 @@ gdm_settings_daemon_SOURCES = \
main.c \
gdm-settings-manager.c \
gdm-settings-manager.h \
gdm-settings-plugin.c \
gdm-settings-plugin.h \
gdm-settings-plugins-engine.c \
gdm-settings-plugins-engine.h \
gdm-settings-module.c \
gdm-settings-module.h \
$(NULL)
gdm_settings_daemon_LDADD = \
......
......@@ -30,6 +30,7 @@
#include <glib-object.h>
#include "gdm-settings-manager.h"
#include "gdm-settings-plugins-engine.h"
#define GDM_SETTINGS_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GDM_TYPE_SETTINGS_MANAGER, GdmSettingsManagerPrivate))
......@@ -56,7 +57,10 @@ gdm_settings_manager_start (GdmSettingsManager *manager,
{
gboolean ret;
g_debug ("Starting settings manager");
ret = TRUE;
gdm_settings_plugins_engine_activate_all ();
return ret;
}
......@@ -64,6 +68,7 @@ gdm_settings_manager_start (GdmSettingsManager *manager,
void
gdm_settings_manager_stop (GdmSettingsManager *manager)
{
g_debug ("Stopping settings manager");
}
static void
......@@ -124,6 +129,8 @@ gdm_settings_manager_dispose (GObject *object)
settings_manager = GDM_SETTINGS_MANAGER (object);
gdm_settings_plugins_engine_shutdown ();
G_OBJECT_CLASS (gdm_settings_manager_parent_class)->dispose (object);
}
......@@ -146,6 +153,8 @@ gdm_settings_manager_init (GdmSettingsManager *manager)
{
manager->priv = GDM_SETTINGS_MANAGER_GET_PRIVATE (manager);
gdm_settings_plugins_engine_init ();
}
static void
......
......@@ -40,7 +40,7 @@ typedef struct GdmSettingsManagerPrivate GdmSettingsManagerPrivate;
typedef struct
{
GObject parent;
GObject parent;
GdmSettingsManagerPrivate *priv;
} GdmSettingsManager;
......
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2005 - Paolo Maggi
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "gdm-settings-module.h"
#include <gmodule.h>
typedef struct _GdmSettingsModuleClass GdmSettingsModuleClass;
struct _GdmSettingsModuleClass
{
GTypeModuleClass parent_class;
};
struct _GdmSettingsModule
{
GTypeModule parent_instance;
GModule *library;
char *path;
GType type;
};
typedef GType (*GdmSettingsModuleRegisterFunc) (GTypeModule *);
G_DEFINE_TYPE (GdmSettingsModule, gdm_settings_module, G_TYPE_TYPE_MODULE)
static gboolean
gdm_settings_module_load (GTypeModule *gmodule)
{
GdmSettingsModule *module;
GdmSettingsModuleRegisterFunc register_func;
gboolean res;
module = GDM_SETTINGS_MODULE (gmodule);
g_debug ("Loading %s", module->path);
module->library = g_module_open (module->path, 0);
if (module->library == NULL) {
g_warning (g_module_error ());
return FALSE;
}
/* extract symbols from the lib */
res = g_module_symbol (module->library, "register_gdm_settings_plugin", (void *) &register_func);
if (! res) {
g_warning (g_module_error ());
g_module_close (module->library);
return FALSE;
}
g_assert (register_func);
module->type = register_func (gmodule);
if (module->type == 0) {
g_warning ("Invalid gdm settings plugin in module %s", module->path);
return FALSE;
}
return TRUE;
}
static void
gdm_settings_module_unload (GTypeModule *gmodule)
{
GdmSettingsModule *module = GDM_SETTINGS_MODULE (gmodule);
g_debug ("Unloading %s", module->path);
g_module_close (module->library);
module->library = NULL;
module->type = 0;
}
const gchar *
gdm_settings_module_get_path (GdmSettingsModule *module)
{
g_return_val_if_fail (GDM_IS_SETTINGS_MODULE (module), NULL);
return module->path;
}
GObject *
gdm_settings_module_new_object (GdmSettingsModule *module)
{
g_debug ("Creating object of type %s", g_type_name (module->type));
if (module->type == 0) {
return NULL;
}
return g_object_new (module->type, NULL);
}
static void
gdm_settings_module_init (GdmSettingsModule *module)
{
g_debug ("GdmSettingsModule %p initialising", module);
}
static void
gdm_settings_module_finalize (GObject *object)
{
GdmSettingsModule *module = GDM_SETTINGS_MODULE (object);
g_debug ("GdmSettingsModule %p finalizing", module);
g_free (module->path);
G_OBJECT_CLASS (gdm_settings_module_parent_class)->finalize (object);
}
static void
gdm_settings_module_class_init (GdmSettingsModuleClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
GTypeModuleClass *module_class = G_TYPE_MODULE_CLASS (class);
object_class->finalize = gdm_settings_module_finalize;
module_class->load = gdm_settings_module_load;
module_class->unload = gdm_settings_module_unload;
}
GdmSettingsModule *
gdm_settings_module_new (const char *path)
{
GdmSettingsModule *result;
if (path == NULL || path[0] == '\0') {
return NULL;
}
result = g_object_new (GDM_TYPE_SETTINGS_MODULE, NULL);
g_type_module_set_name (G_TYPE_MODULE (result), path);
result->path = g_strdup (path);
return result;
}
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2005 - Paolo Maggi
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef GDM_SETTINGS_MODULE_H
#define GDM_SETTINGS_MODULE_H
#include <glib-object.h>
G_BEGIN_DECLS
#define GDM_TYPE_SETTINGS_MODULE (gdm_settings_module_get_type ())
#define GDM_SETTINGS_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDM_TYPE_SETTINGS_MODULE, GdmSettingsModule))
#define GDM_SETTINGS_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDM_TYPE_SETTINGS_MODULE, GdmSettingsModuleClass))
#define GDM_IS_SETTINGS_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDM_TYPE_SETTINGS_MODULE))
#define GDM_IS_SETTINGS_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), GDM_TYPE_SETTINGS_MODULE))
#define GDM_SETTINGS_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GDM_TYPE_SETTINGS_MODULE, GdmSettingsModuleClass))
typedef struct _GdmSettingsModule GdmSettingsModule;
GType gdm_settings_module_get_type (void) G_GNUC_CONST;
GdmSettingsModule *gdm_settings_module_new (const gchar *path);
const char *gdm_settings_module_get_path (GdmSettingsModule *module);
GObject *gdm_settings_module_new_object (GdmSettingsModule *module);
G_END_DECLS
#endif
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2002-2005 Paolo Maggi
* Copyright (C) 2007 William Jon McCann <mccann@jhu.edu>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "gdm-settings-plugin.h"
G_DEFINE_TYPE (GdmSettingsPlugin, gdm_settings_plugin, G_TYPE_OBJECT)
static void
dummy (GdmSettingsPlugin *plugin)
{
/* Empty */
}
static void
gdm_settings_plugin_class_init (GdmSettingsPluginClass *klass)
{
klass->activate = dummy;
klass->deactivate = dummy;
}
static void
gdm_settings_plugin_init (GdmSettingsPlugin *plugin)
{
/* Empty */
}
void
gdm_settings_plugin_activate (GdmSettingsPlugin *plugin)
{
g_return_if_fail (GDM_IS_SETTINGS_PLUGIN (plugin));
GDM_SETTINGS_PLUGIN_GET_CLASS (plugin)->activate (plugin);
}
void
gdm_settings_plugin_deactivate (GdmSettingsPlugin *plugin)
{
g_return_if_fail (GDM_IS_SETTINGS_PLUGIN (plugin));
GDM_SETTINGS_PLUGIN_GET_CLASS (plugin)->deactivate (plugin);
}
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2002-2005 Paolo Maggi
* Copyright (C) 2007 William Jon McCann <mccann@jhu.edu>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GDM_SETTINGS_PLUGIN_H__
#define __GDM_SETTINGS_PLUGIN_H__
#include <glib-object.h>
#include <gmodule.h>
G_BEGIN_DECLS
#define GDM_TYPE_SETTINGS_PLUGIN (gdm_settings_plugin_get_type())
#define GDM_SETTINGS_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GDM_TYPE_SETTINGS_PLUGIN, GdmSettingsPlugin))
#define GDM_SETTINGS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GDM_TYPE_SETTINGS_PLUGIN, GdmSettingsPluginClass))
#define GDM_IS_SETTINGS_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GDM_TYPE_SETTINGS_PLUGIN))
#define GDM_IS_SETTINGS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDM_TYPE_SETTINGS_PLUGIN))
#define GDM_SETTINGS_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GDM_TYPE_SETTINGS_PLUGIN, GdmSettingsPluginClass))
typedef struct
{
GObject parent;
} GdmSettingsPlugin;
typedef struct
{
GObjectClass parent_class;
/* Virtual public methods */
void (*activate) (GdmSettingsPlugin *plugin);
void (*deactivate) (GdmSettingsPlugin *plugin);
} GdmSettingsPluginClass;
GType gdm_settings_plugin_get_type (void) G_GNUC_CONST;
void gdm_settings_plugin_activate (GdmSettingsPlugin *plugin);
void gdm_settings_plugin_deactivate (GdmSettingsPlugin *plugin);
/*
* Utility macro used to register plugins
*
* use: GDM_SETTINGS_PLUGIN_REGISTER (PluginName, plugin_name)
*/
#define GDM_SETTINGS_PLUGIN_REGISTER(PluginName, plugin_name) \
\
static GType plugin_name##_type = 0; \
static GTypeModule *plugin_module_type = 0; \
\
GType \
plugin_name##_get_type (void) \
{ \
return plugin_name##_type; \
} \
\
static void plugin_name##_init (PluginName *self); \
static void plugin_name##_class_init (PluginName##Class *klass); \
static gpointer plugin_name##_parent_class = NULL; \
static void plugin_name##_class_intern_init (gpointer klass) \
{ \
plugin_name##_parent_class = g_type_class_peek_parent (klass); \
plugin_name##_class_init ((PluginName##Class *) klass); \
} \
\
G_MODULE_EXPORT GType \
register_gdm_settings_plugin (GTypeModule *module) \
{ \
static const GTypeInfo our_info = \
{ \
sizeof (PluginName##Class), \
NULL, /* base_init */ \
NULL, /* base_finalize */ \
(GClassInitFunc) plugin_name##_class_intern_init, \
NULL, \
NULL, /* class_data */ \
sizeof (PluginName), \
0, /* n_preallocs */ \
(GInstanceInitFunc) plugin_name##_init \
}; \
\
g_debug ("Registering " #PluginName); \
\
/* Initialise the i18n stuff */ \
bindtextdomain (GETTEXT_PACKAGE, GDM_SETTINGS_LOCALEDIR); \
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); \
\
plugin_module_type = module; \
plugin_name##_type = g_type_module_register_type (module, \
GDM_TYPE_SETTINGS_PLUGIN, \
#PluginName, \
&our_info, \
0); \
\
return plugin_name##_type; \
}
/*
* Utility macro used to register gobject types in plugins with additional code
*
* use: GDM_SETTINGS_PLUGIN_DEFINE_TYPE_WITH_CODE(ObjectName, object_name, PARENT_TYPE, CODE)
*/
#define GDM_SETTINGS_PLUGIN_DEFINE_TYPE_WITH_CODE(ObjectName, object_name, PARENT_TYPE, CODE) \
static void object_name##_init (ObjectName *self); \
static void object_name##_class_init (ObjectName##Class *klass); \
static gpointer object_name##_parent_class = ((void *)0); \
static GType ojbect_name##_type_id = 0; \
\
static void object_name##_class_intern_init (gpointer klass) \
{ \
object_name##_parent_class = g_type_class_peek_parent (klass); \
object_name##_class_init ((ObjectName##Class *) klass); \
} \
\
\
GType \
object_name##_get_type (void) \
{ \
g_assert (object_name##_type_id != 0); \
\
return object_name##_type_id; \
} \
\
GType \
object_name##_register_type (GTypeModule *module) \
{ \
if ((object_name##_type_id == 0)) { \
const GTypeInfo g_define_type_info = { \
sizeof (ObjectName##Class), \
(GBaseInitFunc) ((void *)0), \
(GBaseFinalizeFunc) ((void *)0), \
(GClassInitFunc) object_name##_class_intern_init, \
(GClassFinalizeFunc) ((void *)0), \
((void *)0), \
sizeof (ObjectName), \
0, \
(GInstanceInitFunc) object_name##_init, \
((void *)0) \
}; \
object_name##_type_id = \
g_type_module_register_type (module, \
PARENT_TYPE, \
#ObjectName, \
&g_define_type_info, \
(GTypeFlags) 0); \
} \
\
g_debug ("Registering " #ObjectName); \
\
CODE \
\
return type_name##_type_id; \
}
/*
* Utility macro used to register gobject types in plugins
*
* use: GDM_SETTINGS_PLUGIN_DEFINE_TYPE(ObjectName, object_name, PARENT_TYPE)
*/
#define GDM_SETTINGS_PLUGIN_DEFINE_TYPE(ObjectName, object_name, PARENT_TYPE) \
GDM_SETTINGS_PLUGIN_DEFINE_TYPE_WITH_CODE(ObjectName, object_name, PARENT_TYPE, ;)
G_END_DECLS
#endif /* __GDM_SETTINGS_PLUGIN_H__ */
This diff is collapsed.
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2002-2005 - Paolo Maggi
* Copyright (C) 2007 William Jon McCann <mccann@jhu.edu>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GDM_SETTINGS_PLUGINS_ENGINE_H__
#define __GDM_SETTINGS_PLUGINS_ENGINE_H__
#include <glib.h>
typedef struct _GdmSettingsPluginInfo GdmSettingsPluginInfo;
gboolean gdm_settings_plugins_engine_init (void);
void gdm_settings_plugins_engine_shutdown (void);
void gdm_settings_plugins_engine_garbage_collect (void);
const GList *gdm_settings_plugins_engine_get_plugins_list (void);
void gdm_settings_plugins_engine_activate_all (void);
gboolean gdm_settings_plugins_engine_activate_plugin (GdmSettingsPluginInfo *info);
gboolean gdm_settings_plugins_engine_deactivate_plugin (GdmSettingsPluginInfo *info);
gboolean gdm_settings_plugins_engine_plugin_is_active (GdmSettingsPluginInfo *info);
gboolean gdm_settings_plugins_engine_plugin_is_available (GdmSettingsPluginInfo *info);
const char *gdm_settings_plugins_engine_get_plugin_name (GdmSettingsPluginInfo *info);
const char *gdm_settings_plugins_engine_get_plugin_description (GdmSettingsPluginInfo *info);
const char **gdm_settings_plugins_engine_get_plugin_authors (GdmSettingsPluginInfo *info);
const char *gdm_settings_plugins_engine_get_plugin_website (GdmSettingsPluginInfo *info);
const char *gdm_settings_plugins_engine_get_plugin_copyright (GdmSettingsPluginInfo *info);
#endif /* __GDM_SETTINGS_PLUGINS_ENGINE_H__ */
......@@ -36,7 +36,7 @@ main (int argc, char *argv[])
gboolean res;
GError *error;
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
bindtextdomain (GETTEXT_PACKAGE, GDM_SETTINGS_LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
......
NULL =
SUBDIRS = \
xsettings \
$(NULL)
NULL =
modules_flags = -export_dynamic -avoid-version -module
plugindir = $(libdir)/gdm/settings/plugins
INCLUDES = \
-I$(top_srcdir)/common \
-I$(top_srcdir)/gui/settings-daemon \
-DGDM_SETTINGS_LOCALEDIR=\""$(datadir)/locale"\"\
$(SETTINGS_PLUGIN_CFLAGS) \
$(NULL)
plugin_LTLIBRARIES = \
libxsettings.la \
$(NULL)
libxsettings_la_SOURCES = \
gdm-xsettings-plugin.h \
gdm-xsettings-plugin.c \
$(NULL)
libxsettings_la_LDFLAGS = \
$(PLUGIN_LIBTOOL_FLAGS) \
$(modules_flags) \
$(NULL)
libxsettings_la_LIBADD = \
$(SETTINGS_PLUGIN_LIBS) \
$(NULL)
libxsettings_la_CFLAGS = \
-I$(top_srcdir)/gui/settings-daemon \
$(NULL)
plugin_in_files = \
xsettings.gdm-settings-plugin.desktop.in \
$(NULL)
%.gdm-settings-plugin: %.gdm-settings-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
plugin_DATA = $(plugin_in_files:.gdm-settings-plugin.desktop.in=.gdm-settings-plugin)