[gnome-settings-daemon/wip/ibus: 1/4] Add support for input source-related shortcuts



commit dcb4a4ac17f864dd07d9242fa328a0debd666a63
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Nov 16 19:02:28 2011 -0500

    Add support for input source-related shortcuts
    
    This adds desktop.ibus.shortcuts as a place in dconf to store
    previous/next input source shortcuts, in the syntax understood
    by the keyboard panel. It also adds a small gsd plugin to forward
    these settings to IBus, which has its own configuration storage
    for shortcuts (unfortunately).

 configure.ac                                       |   32 +++
 ....settings-daemon.plugins.ibus.gschema.xml.in.in |   26 +++
 plugins/Makefile.am                                |    6 +
 plugins/ibus/Makefile.am                           |   49 ++++
 plugins/ibus/gsd-ibus-manager.c                    |  232 ++++++++++++++++++++
 plugins/ibus/gsd-ibus-manager.h                    |   57 +++++
 plugins/ibus/gsd-ibus-plugin.c                     |  110 +++++++++
 plugins/ibus/gsd-ibus-plugin.h                     |   59 +++++
 plugins/ibus/ibus.gnome-settings-plugin.in         |    8 +
 9 files changed, 579 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 06ac0cb..d5f0b07 100644
--- a/configure.ac
+++ b/configure.ac
@@ -371,6 +371,7 @@ fi
 
 AM_CONDITIONAL(BUILD_PRINT_NOTIFICATIONS, [test x"$enable_cups" = x"yes"])
 
+
 # ---------------------------------------------------------------------------
 # Enable Profiling
 # ---------------------------------------------------------------------------
@@ -382,6 +383,35 @@ if test "x$enable_profiling" = "xyes"; then
     AC_DEFINE(ENABLE_PROFILING,1,[enable profiling])
 fi
 
+#----------------------------------------------------------------------------
+# IBus
+# ---------------------------------------------------------------------------
+
+IBUS_CFLAGS=
+IBUS_LIBS=
+AC_ARG_ENABLE(ibus,
+              AS_HELP_STRING([--enable-ibus],
+                             [Enable IBus support (auto)]),
+              enable_ibus=$enableval,
+              enable_ibus=auto)
+
+if test "x$enable_ibus" = "xno" ; then
+  HAVE_IBUS=no
+else
+  HAVE_IBUS=no
+  PKG_CHECK_MODULES(IBUS, ibus-1.0, HAVE_IBUS=yes, HAVE_IBUS=no)
+
+  if test "x$enable_ibus" = "xyes" -a "x$HAVE_IBUS" = "xno" ; then
+    AC_MSG_ERROR(IBus support explicity enabled but not available)
+  fi
+
+  if test "x$HAVE_IBUS" = "xyes" ; then
+    AC_DEFINE(HAVE_IBUS, 1, [Defined if IBus support is enabled])
+  fi
+fi
+AM_CONDITIONAL(HAVE_IBUS, test "x$HAVE_IBUS" = "xyes")
+AC_SUBST(IBUS_CFLAGS)
+AC_SUBST(IBUS_LIBS)
 
 # ---------------------------------------------------------------------------
 # Plugins
@@ -471,6 +501,7 @@ plugins/common/Makefile
 plugins/cursor/Makefile
 plugins/datetime/Makefile
 plugins/dummy/Makefile
+plugins/ibus/Makefile
 plugins/power/Makefile
 plugins/housekeeping/Makefile
 plugins/keyboard/Makefile
@@ -494,6 +525,7 @@ data/org.gnome.settings-daemon.plugins.xsettings.gschema.xml.in
 data/org.gnome.settings-daemon.plugins.keyboard.gschema.xml.in
 data/org.gnome.settings-daemon.plugins.power.gschema.xml.in
 data/org.gnome.settings-daemon.plugins.color.gschema.xml.in
+data/org.gnome.settings-daemon.plugins.ibus.gschema.xml.in
 data/org.gnome.settings-daemon.plugins.media-keys.gschema.xml.in
 data/org.gnome.settings-daemon.peripherals.gschema.xml.in
 data/org.gnome.settings-daemon.plugins.housekeeping.gschema.xml.in
diff --git a/data/org.gnome.settings-daemon.plugins.ibus.gschema.xml.in.in b/data/org.gnome.settings-daemon.plugins.ibus.gschema.xml.in.in
new file mode 100644
index 0000000..96bffcb
--- /dev/null
+++ b/data/org.gnome.settings-daemon.plugins.ibus.gschema.xml.in.in
@@ -0,0 +1,26 @@
+<schemalist>
+  <schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.settings-daemon.plugins.ibus" path="/org/gnome/settings-daemon/plugins/ibus/">
+    <key name="active" type="b">
+      <default>true</default>
+      <_summary>Activation of this plugin</_summary>
+      <_description>Whether this plugin would be activated by gnome-settings-daemon or not</_description>
+    </key>
+    <key name="priority" type="i">
+      <default>1</default>
+      <_summary>Priority to use for this plugin</_summary>
+      <_description>Priority to use for this plugin in gnome-settings-daemon startup queue</_description>
+    </key>
+  </schema>
+  <schema gettext-domain="@GETTEXT_PACKAGE@" path="/desktop/ibus/shortcuts/" id="desktop.ibus.shortcuts">
+    <key type="s" name="next-input-source">
+      <default>''</default>
+      <summary>Switch to next source</summary>
+      <description>Switch to the next input source.</description>
+    </key>
+    <key type="s" name="previous-input-source">
+      <default>''</default>
+      <summary>Switch to previous source</summary>
+      <description>Switch to the previous input source.</description>
+    </key>
+  </schema>
+</schemalist>
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index 83d223a..2dd5c50 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -29,6 +29,12 @@ else
 disabled_plugins += updates
 endif
 
+if HAVE_IBUS
+enabled_plugins += ibus
+else
+disabled_plugins += ibus
+endif
+
 if SMARTCARD_SUPPORT
 enabled_plugins += smartcard
 else
diff --git a/plugins/ibus/Makefile.am b/plugins/ibus/Makefile.am
new file mode 100644
index 0000000..cc5f102
--- /dev/null
+++ b/plugins/ibus/Makefile.am
@@ -0,0 +1,49 @@
+plugin_name = ibus
+
+plugin_LTLIBRARIES = \
+	libibus.la
+
+libibus_la_SOURCES = 		\
+	gsd-ibus-manager.c	\
+	gsd-ibus-manager.h	\
+	gsd-ibus-plugin.c	\
+	gsd-ibus-plugin.h
+
+libibus_la_CPPFLAGS = \
+	-I$(top_srcdir)/gnome-settings-daemon		\
+	-DGNOME_SETTINGS_LOCALEDIR=\""$(datadir)/locale"\" \
+	$(AM_CPPFLAGS)
+
+libibus_la_CFLAGS = \
+	$(IBUS_CFLAGS) \
+	$(PLUGIN_CFLAGS)		\
+	$(SETTINGS_PLUGIN_CFLAGS)	\
+	$(AM_CFLAGS)
+
+libibus_la_LDFLAGS = 		\
+	$(GSD_PLUGIN_LDFLAGS)
+
+libibus_la_LIBADD  = 		\
+	$(IBUS_LIBS)	\
+	$(SETTINGS_PLUGIN_LIBS)
+
+plugin_in_files = 		\
+	ibus.gnome-settings-plugin.in
+
+plugin_DATA = $(plugin_in_files:.gnome-settings-plugin.in=.gnome-settings-plugin)
+
+EXTRA_DIST = 			\
+	$(plugin_in_files)
+
+CLEANFILES = 			\
+	$(plugin_DATA)
+
+DISTCLEANFILES =		\
+	$(plugin_DATA)
+
+ GSD_INTLTOOL_PLUGIN_RULE@
+
+# override to _not_ install the test plugin
+# do not copy into your plugin
+install-pluginDATA:
+install-pluginLTLIBRARIES:
diff --git a/plugins/ibus/gsd-ibus-manager.c b/plugins/ibus/gsd-ibus-manager.c
new file mode 100644
index 0000000..986a15d
--- /dev/null
+++ b/plugins/ibus/gsd-ibus-manager.c
@@ -0,0 +1,232 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2011 Red Hat, Inc
+ *
+ * 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 <sys/types.h>
+#include <sys/wait.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+
+#include <locale.h>
+
+#include <glib.h>
+#include <glib/gi18n.h>
+#include <gdk/gdk.h>
+#include <gdk/gdkx.h>
+#include <gtk/gtk.h>
+
+#include <ibus.h>
+
+#include "gnome-settings-profile.h"
+#include "gsd-ibus-manager.h"
+
+#define IBUS_SETTINGS "desktop.ibus.shortcuts"
+#define NEXT_INPUT_SOURCE_KEY "next-input-source"
+#define PREV_INPUT_SOURCE_KEY "previous-input-source"
+
+#define GSD_IBUS_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSD_TYPE_IBUS_MANAGER, GsdIBusManagerPrivate))
+
+struct GsdIBusManagerPrivate
+{
+        GSettings *ibus_settings;
+};
+
+enum {
+        PROP_0,
+};
+
+static void     gsd_ibus_manager_class_init  (GsdIBusManagerClass *klass);
+static void     gsd_ibus_manager_init        (GsdIBusManager      *ibus_manager);
+static void     gsd_ibus_manager_finalize    (GObject             *object);
+
+G_DEFINE_TYPE (GsdIBusManager, gsd_ibus_manager, G_TYPE_OBJECT)
+
+static gpointer manager_object = NULL;
+
+static void
+set_ibus_shortcut (GsdIBusManager *manager,
+                   const gchar    *key,
+                   const gchar    *value)
+{
+        IBusBus *bus;
+        IBusConfig *config;
+        GVariant *v;
+        const gchar *str[2];
+
+        bus = ibus_bus_new ();
+        config = ibus_bus_get_config (bus);
+
+        str[0] = value;
+        str[1] = NULL;
+
+        v = g_variant_new_strv (str, 1);
+
+        if (g_str_equal (key, NEXT_INPUT_SOURCE_KEY)) {
+                ibus_config_set_value (config, "general/hotkey", "next_engine_in_menu", v);
+        }
+        else if (g_str_equal (key, PREV_INPUT_SOURCE_KEY)) {
+                ibus_config_set_value (config, "general/hotkey", "previous_engine", v);
+        }
+
+        g_variant_unref (v);
+
+        g_object_unref (bus);
+}
+
+static void
+ibus_settings_changed (GSettings      *settings,
+                       const gchar    *key,
+                       GsdIBusManager *manager)
+{
+        if (g_str_equal (key, NEXT_INPUT_SOURCE_KEY) ||
+            g_str_equal (key, PREV_INPUT_SOURCE_KEY)) {
+                gchar *value;
+
+                value = g_settings_get_string (settings, key);
+                set_ibus_shortcut (manager, key, value);
+                g_free (value);
+        }
+}
+
+gboolean
+gsd_ibus_manager_start (GsdIBusManager  *manager,
+                        GError         **error)
+{
+        g_debug ("Starting ibus manager");
+        gnome_settings_profile_start (NULL);
+
+        ibus_init ();
+
+        manager->priv->ibus_settings = g_settings_new (IBUS_SETTINGS);
+        g_signal_connect (manager->priv->ibus_settings, "changed",
+                          G_CALLBACK (ibus_settings_changed), manager);
+
+        gnome_settings_profile_end (NULL);
+        return TRUE;
+}
+
+void
+gsd_ibus_manager_stop (GsdIBusManager *manager)
+{
+        g_debug ("Stopping ibus manager");
+
+        g_object_unref (manager->priv->ibus_settings);
+        manager->priv->ibus_settings = NULL;
+}
+
+static void
+gsd_ibus_manager_set_property (GObject        *object,
+                               guint           prop_id,
+                               const GValue   *value,
+                               GParamSpec     *pspec)
+{
+        switch (prop_id) {
+        default:
+                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+                break;
+        }
+}
+
+static void
+gsd_ibus_manager_get_property (GObject        *object,
+                               guint           prop_id,
+                               GValue         *value,
+                               GParamSpec     *pspec)
+{
+        switch (prop_id) {
+        default:
+                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+                break;
+        }
+}
+
+static GObject *
+gsd_ibus_manager_constructor (GType                  type,
+                              guint                  n_construct_properties,
+                              GObjectConstructParam *construct_properties)
+{
+        GsdIBusManager      *ibus_manager;
+
+        ibus_manager = GSD_IBUS_MANAGER (G_OBJECT_CLASS (gsd_ibus_manager_parent_class)->constructor (type,
+                                                                                                      n_construct_properties,
+                                                                                                      construct_properties));
+
+        return G_OBJECT (ibus_manager);
+}
+
+static void
+gsd_ibus_manager_dispose (GObject *object)
+{
+        G_OBJECT_CLASS (gsd_ibus_manager_parent_class)->dispose (object);
+}
+
+static void
+gsd_ibus_manager_class_init (GsdIBusManagerClass *klass)
+{
+        GObjectClass   *object_class = G_OBJECT_CLASS (klass);
+
+        object_class->get_property = gsd_ibus_manager_get_property;
+        object_class->set_property = gsd_ibus_manager_set_property;
+        object_class->constructor = gsd_ibus_manager_constructor;
+        object_class->dispose = gsd_ibus_manager_dispose;
+        object_class->finalize = gsd_ibus_manager_finalize;
+
+        g_type_class_add_private (klass, sizeof (GsdIBusManagerPrivate));
+}
+
+static void
+gsd_ibus_manager_init (GsdIBusManager *manager)
+{
+        manager->priv = GSD_IBUS_MANAGER_GET_PRIVATE (manager);
+
+}
+
+static void
+gsd_ibus_manager_finalize (GObject *object)
+{
+        GsdIBusManager *ibus_manager;
+
+        g_return_if_fail (object != NULL);
+        g_return_if_fail (GSD_IS_IBUS_MANAGER (object));
+
+        ibus_manager = GSD_IBUS_MANAGER (object);
+
+        g_return_if_fail (ibus_manager->priv != NULL);
+
+        G_OBJECT_CLASS (gsd_ibus_manager_parent_class)->finalize (object);
+}
+
+GsdIBusManager *
+gsd_ibus_manager_new (void)
+{
+        if (manager_object != NULL) {
+                g_object_ref (manager_object);
+        } else {
+                manager_object = g_object_new (GSD_TYPE_IBUS_MANAGER, NULL);
+                g_object_add_weak_pointer (manager_object,
+                                           (gpointer *) &manager_object);
+        }
+
+        return GSD_IBUS_MANAGER (manager_object);
+}
diff --git a/plugins/ibus/gsd-ibus-manager.h b/plugins/ibus/gsd-ibus-manager.h
new file mode 100644
index 0000000..757f9e8
--- /dev/null
+++ b/plugins/ibus/gsd-ibus-manager.h
@@ -0,0 +1,57 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2011 Red Hat, Inc
+ *
+ * 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 __GSD_IBUS_MANAGER_H
+#define __GSD_IBUS_MANAGER_H
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define GSD_TYPE_IBUS_MANAGER         (gsd_ibus_manager_get_type ())
+#define GSD_IBUS_MANAGER(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), GSD_TYPE_IBUS_MANAGER, GsdIBusManager))
+#define GSD_IBUS_MANAGER_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), GSD_TYPE_IBUS_MANAGER, GsdIBusManagerClass))
+#define GSD_IS_IBUS_MANAGER(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSD_TYPE_IBUS_MANAGER))
+#define GSD_IS_IBUS_MANAGER_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), GSD_TYPE_IBUS_MANAGER))
+#define GSD_IBUS_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSD_TYPE_IBUS_MANAGER, GsdIBusManagerClass))
+
+typedef struct GsdIBusManagerPrivate GsdIBusManagerPrivate;
+
+typedef struct
+{
+        GObject parent;
+        GsdIBusManagerPrivate *priv;
+} GsdIBusManager;
+
+typedef struct
+{
+        GObjectClass   parent_class;
+} GsdIBusManagerClass;
+
+GType                   gsd_ibus_manager_get_type            (void);
+
+GsdIBusManager *        gsd_ibus_manager_new                 (void);
+gboolean                gsd_ibus_manager_start               (GsdIBusManager *manager,
+                                                              GError         **error);
+void                    gsd_ibus_manager_stop                (GsdIBusManager *manager);
+
+G_END_DECLS
+
+#endif /* __GSD_IBUS_MANAGER_H */
diff --git a/plugins/ibus/gsd-ibus-plugin.c b/plugins/ibus/gsd-ibus-plugin.c
new file mode 100644
index 0000000..03b6550
--- /dev/null
+++ b/plugins/ibus/gsd-ibus-plugin.c
@@ -0,0 +1,110 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2011 Matthias Clasen
+ *
+ * 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, 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 <glib/gi18n-lib.h>
+#include <gmodule.h>
+
+#include "gnome-settings-plugin.h"
+#include "gsd-ibus-plugin.h"
+#include "gsd-ibus-manager.h"
+
+struct GsdIBusPluginPrivate {
+        GsdIBusManager *manager;
+};
+
+#define GSD_IBUS_PLUGIN_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), GSD_TYPE_IBUS_PLUGIN, GsdIBusPluginPrivate))
+
+GNOME_SETTINGS_PLUGIN_REGISTER (GsdIBusPlugin, gsd_ibus_plugin)
+
+static void
+gsd_ibus_plugin_init (GsdIBusPlugin *plugin)
+{
+        plugin->priv = GSD_IBUS_PLUGIN_GET_PRIVATE (plugin);
+
+        g_debug ("GsdIBusPlugin initializing");
+
+        plugin->priv->manager = gsd_ibus_manager_new ();
+}
+
+static void
+gsd_ibus_plugin_finalize (GObject *object)
+{
+        GsdIBusPlugin *plugin;
+
+        g_return_if_fail (object != NULL);
+        g_return_if_fail (GSD_IS_IBUS_PLUGIN (object));
+
+        g_debug ("GsdIBusPlugin finalizing");
+
+        plugin = GSD_IBUS_PLUGIN (object);
+
+        g_return_if_fail (plugin->priv != NULL);
+
+        if (plugin->priv->manager != NULL) {
+                g_object_unref (plugin->priv->manager);
+        }
+
+        G_OBJECT_CLASS (gsd_ibus_plugin_parent_class)->finalize (object);
+}
+
+static void
+impl_activate (GnomeSettingsPlugin *plugin)
+{
+        gboolean res;
+        GError  *error;
+
+        g_debug ("Activating ibus plugin");
+
+        error = NULL;
+        res = gsd_ibus_manager_start (GSD_IBUS_PLUGIN (plugin)->priv->manager, &error);
+        if (! res) {
+                g_warning ("Unable to start ibus manager: %s", error->message);
+                g_error_free (error);
+        }
+}
+
+static void
+impl_deactivate (GnomeSettingsPlugin *plugin)
+{
+        g_debug ("Deactivating ibus plugin");
+        gsd_ibus_manager_stop (GSD_IBUS_PLUGIN (plugin)->priv->manager);
+}
+
+static void
+gsd_ibus_plugin_class_init (GsdIBusPluginClass *klass)
+{
+        GObjectClass           *object_class = G_OBJECT_CLASS (klass);
+        GnomeSettingsPluginClass *plugin_class = GNOME_SETTINGS_PLUGIN_CLASS (klass);
+
+        object_class->finalize = gsd_ibus_plugin_finalize;
+
+        plugin_class->activate = impl_activate;
+        plugin_class->deactivate = impl_deactivate;
+
+        g_type_class_add_private (klass, sizeof (GsdIBusPluginPrivate));
+}
+
+static void
+gsd_ibus_plugin_class_finalize (GsdIBusPluginClass *klass)
+{
+}
+
diff --git a/plugins/ibus/gsd-ibus-plugin.h b/plugins/ibus/gsd-ibus-plugin.h
new file mode 100644
index 0000000..1d72cf4
--- /dev/null
+++ b/plugins/ibus/gsd-ibus-plugin.h
@@ -0,0 +1,59 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2011 Red Hat, Inc
+ *
+ * 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, 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 __GSD_IBUS_PLUGIN_H__
+#define __GSD_IBUS_PLUGIN_H__
+
+#include <glib.h>
+#include <glib-object.h>
+#include <gmodule.h>
+
+#include "gnome-settings-plugin.h"
+
+G_BEGIN_DECLS
+
+#define GSD_TYPE_IBUS_PLUGIN                (gsd_ibus_plugin_get_type ())
+#define GSD_IBUS_PLUGIN(o)                  (G_TYPE_CHECK_INSTANCE_CAST ((o), GSD_TYPE_IBUS_PLUGIN, GsdIBusPlugin))
+#define GSD_IBUS_PLUGIN_CLASS(k)            (G_TYPE_CHECK_CLASS_CAST((k), GSD_TYPE_IBUS_PLUGIN, GsdIBusPluginClass))
+#define GSD_IS_IBUS_PLUGIN(o)               (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSD_TYPE_IBUS_PLUGIN))
+#define GSD_IS_IBUS_PLUGIN_CLASS(k)         (G_TYPE_CHECK_CLASS_TYPE ((k), GSD_TYPE_IBUS_PLUGIN))
+#define GSD_IBUS_PLUGIN_GET_CLASS(o)        (G_TYPE_INSTANCE_GET_CLASS ((o), GSD_TYPE_IBUS_PLUGIN, GsdIBusPluginClass))
+
+typedef struct GsdIBusPluginPrivate GsdIBusPluginPrivate;
+
+typedef struct
+{
+        GnomeSettingsPlugin    parent;
+        GsdIBusPluginPrivate *priv;
+} GsdIBusPlugin;
+
+typedef struct
+{
+        GnomeSettingsPluginClass parent_class;
+} GsdIBusPluginClass;
+
+GType   gsd_ibus_plugin_get_type            (void) G_GNUC_CONST;
+
+/* All the plugins must implement this function */
+G_MODULE_EXPORT GType register_gnome_settings_plugin (GTypeModule *module);
+
+G_END_DECLS
+
+#endif /* __GSD_IBUS_PLUGIN_H__ */
diff --git a/plugins/ibus/ibus.gnome-settings-plugin.in b/plugins/ibus/ibus.gnome-settings-plugin.in
new file mode 100644
index 0000000..3632a8c
--- /dev/null
+++ b/plugins/ibus/ibus.gnome-settings-plugin.in
@@ -0,0 +1,8 @@
+[GNOME Settings Plugin]
+Module=dummy
+IAge=0
+_Name=Dummy
+_Description=Dummy plugin
+Authors=AUTHOR
+Copyright=Copyright  2007 AUTHOR
+Website=



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]