gpointing-device-settings r61 - in trunk: . modules



Author: hiikezoe
Date: Sat Feb 28 10:07:28 2009
New Revision: 61
URL: http://svn.gnome.org/viewvc/gpointing-device-settings?rev=61&view=rev

Log:
added plugins for gnome-settings-daemon. But not worked yet.

Added:
   trunk/modules/gnome-settings-plugin.h
   trunk/modules/gsd-touchpad-plugin.c
   trunk/modules/gsd-trackpoint-plugin.c
   trunk/modules/touchpad.gnome-settings-plugin.in
   trunk/modules/trackpoint.gnome-settings-plugin.in
Modified:
   trunk/.gitignore
   trunk/autogen.sh
   trunk/configure.ac
   trunk/modules/Makefile.am

Modified: trunk/.gitignore
==============================================================================
--- trunk/.gitignore	(original)
+++ trunk/.gitignore	Sat Feb 28 10:07:28 2009
@@ -30,3 +30,5 @@
 po/gpointing-device-settings.pot
 po/stamp-it
 src/gpointing-device-settings
+modules/touchpad.gnome-settings-plugin
+modules/trackpoint.gnome-settings-plugin

Modified: trunk/autogen.sh
==============================================================================
--- trunk/autogen.sh	(original)
+++ trunk/autogen.sh	Sat Feb 28 10:07:28 2009
@@ -14,7 +14,7 @@
 
 run ${ACLOCAL:-aclocal} $ACLOCAL_OPTIONS
 run ${LIBTOOLIZE:-libtoolize} --copy --force
-run ${INTLTOOLIZE:-intltoolize} --force --copy
+run ${INTLTOOLIZE:-intltoolize} --force --copy --automake
 run ${AUTOHEADER:-autoheader}
 run ${AUTOMAKE:-automake} --add-missing --foreign --copy
 run ${AUTOCONF:-autoconf}

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Sat Feb 28 10:07:28 2009
@@ -111,6 +111,12 @@
 gpds_help_datadir="\${datadir}"
 AC_SUBST(gpds_help_datadir)
 
+gsd_plugindir="\${libdir}/gnome-settings-daemon-2.0"
+AC_SUBST([gsd_plugindir])
+
+GSD_INTLTOOL_PLUGIN_RULE='%.gnome-settings-plugin:   %.gnome-settings-plugin.in   $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
+AC_SUBST([GSD_INTLTOOL_PLUGIN_RULE])
+
 dnl **************************************************************
 dnl Check for Cutter
 dnl **************************************************************

Modified: trunk/modules/Makefile.am
==============================================================================
--- trunk/modules/Makefile.am	(original)
+++ trunk/modules/Makefile.am	Sat Feb 28 10:07:28 2009
@@ -1,3 +1,5 @@
+ GSD_INTLTOOL_PLUGIN_RULE@
+
 INCLUDES = 			\
 	 -I$(top_builddir)	\
 	 -I$(top_srcdir)	\
@@ -6,7 +8,6 @@
 AM_CFLAGS =				\
 	$(GPDS_CFLAGS)			\
 	$(GCONF2_CFLAGS)		\
-	$(GNOME_SETTINGS_DAEMON_CFLAGS)
 	$(COVERAGE_CFLAGS)
 
 AM_LDFLAGS =			\
@@ -31,3 +32,38 @@
 touchpad_la_SOURCES = 		\
 	gpds-touchpad-ui.c	\
 	gpds-touchpad-gconf.h
+
+# plugins for gnome-settings-daemon
+gsd_plugin_LTLIBRARIES =	\
+	libtrackpoint.la	\
+	libtouchpad.la
+
+gsd_plugin_CFLAGS =					\
+	$(AM_CFLAGS)					\
+	$(GNOME_SETTINGS_DAEMON_CFLAGS)			\
+	-DGNOME_SETTINGS_LOCALEDIR=\""$(localedir)"\"
+
+libtrackpoint_la_CFLAGS = $(gsd_plugin_CFLAGS)
+libtrackpoint_la_SOURCES = 	\
+	gsd-trackpoint-plugin.c
+
+libtouchpad_la_CFLAGS = $(gsd_plugin_CFLAGS)
+libtouchpad_la_SOURCES = 	\
+	gsd-touchpad-plugin.c
+
+gsd_plugin_in_files =	 			\
+	trackpoint.gnome-settings-plugin.in	\
+	touchpad.gnome-settings-plugin.in
+
+gsd_plugin_DATA = $(gsd_plugin_in_files:.gnome-settings-plugin.in=.gnome-settings-plugin)
+
+EXTRA_DIST = 			\
+	$(gsd_plugin_in_files)	\
+	gnome-settings-plugin.h
+
+CLEANFILES = 			\
+	$(gsd_plugin_DATA)
+
+DISTCLEANFILES =		\
+	$(gsd_plugin_DATA)
+

Added: trunk/modules/gnome-settings-plugin.h
==============================================================================
--- (empty file)
+++ trunk/modules/gnome-settings-plugin.h	Sat Feb 28 10:07:28 2009
@@ -0,0 +1,179 @@
+/* -*- 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 __GNOME_SETTINGS_PLUGIN_H__
+#define __GNOME_SETTINGS_PLUGIN_H__
+
+#include <glib-object.h>
+#include <gmodule.h>
+
+G_BEGIN_DECLS
+#define GNOME_TYPE_SETTINGS_PLUGIN              (gnome_settings_plugin_get_type())
+#define GNOME_SETTINGS_PLUGIN(obj)              (G_TYPE_CHECK_INSTANCE_CAST((obj), GNOME_TYPE_SETTINGS_PLUGIN, GnomeSettingsPlugin))
+#define GNOME_SETTINGS_PLUGIN_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass),  GNOME_TYPE_SETTINGS_PLUGIN, GnomeSettingsPluginClass))
+#define GNOME_IS_SETTINGS_PLUGIN(obj)           (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNOME_TYPE_SETTINGS_PLUGIN))
+#define GNOME_IS_SETTINGS_PLUGIN_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_TYPE_SETTINGS_PLUGIN))
+#define GNOME_SETTINGS_PLUGIN_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS((obj),  GNOME_TYPE_SETTINGS_PLUGIN, GnomeSettingsPluginClass))
+
+typedef struct
+{
+        GObject parent;
+} GnomeSettingsPlugin;
+
+typedef struct
+{
+        GObjectClass parent_class;
+
+        /* Virtual public methods */
+        void            (*activate)                     (GnomeSettingsPlugin *plugin);
+        void            (*deactivate)                   (GnomeSettingsPlugin *plugin);
+} GnomeSettingsPluginClass;
+
+GType            gnome_settings_plugin_get_type           (void) G_GNUC_CONST;
+
+void             gnome_settings_plugin_activate           (GnomeSettingsPlugin *plugin);
+void             gnome_settings_plugin_deactivate         (GnomeSettingsPlugin *plugin);
+
+/*
+ * Utility macro used to register plugins
+ *
+ * use: GNOME_SETTINGS_PLUGIN_REGISTER (PluginName, plugin_name)
+ */
+#define GNOME_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_gnome_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, GNOME_SETTINGS_LOCALEDIR);               \
+        bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");                     \
+                                                                                \
+        plugin_module_type = module;                                            \
+        plugin_name##_type = g_type_module_register_type (module,               \
+                                            GNOME_TYPE_SETTINGS_PLUGIN,           \
+                                            #PluginName,                        \
+                                            &our_info,                          \
+                                            0);                                 \
+                                                                                \
+        return plugin_name##_type;                                              \
+}
+
+/*
+ * Utility macro used to register gobject types in plugins with additional code
+ *
+ * use: GNOME_SETTINGS_PLUGIN_DEFINE_TYPE_WITH_CODE(ObjectName, object_name, PARENT_TYPE, CODE)
+ */
+#define GNOME_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: GNOME_SETTINGS_PLUGIN_DEFINE_TYPE(ObjectName, object_name, PARENT_TYPE)
+ */
+#define GNOME_SETTINGS_PLUGIN_DEFINE_TYPE(ObjectName, object_name, PARENT_TYPE)           \
+        GNOME_SETTINGS_PLUGIN_DEFINE_TYPE_WITH_CODE(ObjectName, object_name, PARENT_TYPE, ;)
+
+G_END_DECLS
+
+#endif  /* __GNOME_SETTINGS_PLUGIN_H__ */

Added: trunk/modules/gsd-touchpad-plugin.c
==============================================================================
--- (empty file)
+++ trunk/modules/gsd-touchpad-plugin.c	Sat Feb 28 10:07:28 2009
@@ -0,0 +1,78 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ *  Copyright (C) 2009 Hiroyuki Ikezoe  <poincare ikezoe net>
+ *
+ *  This library is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This library 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 Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+/* #include <gnome-settings-daemon/gnome-settings-plugin.h> */
+#include "gnome-settings-plugin.h"
+#include <glib/gi18n.h>
+
+#define GSD_TYPE_TOUCHPAD_PLUGIN            (gsd_touchpad_plugin_get_type ())
+#define GSD_TOUCHPAD_PLUGIN(jbj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GSD_TYPE_TOUCHPAD_PLUGIN, GsdTrackPobjintPlugin))
+#define GSD_TOUCHPAD_PLUGIN_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GSD_TYPE_TOUCHPAD_PLUGIN, GsdTracklassPobjintPluginClass))
+#define GSD_IS_TOUCHPAD_PLUGIN(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GSD_TYPE_TOUCHPAD_PLUGIN))
+#define GSD_IS_TOUCHPAD_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GSD_TYPE_TOUCHPAD_PLUGIN))
+#define GSD_TOUCHPAD_PLUGIN_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GSD_TYPE_TOUCHPAD_PLUGIN, GsdTracklassPobjintPluginClass))
+
+typedef struct _GsdTouchpadPlugin GsdTouchpadPlugin;
+typedef struct _GsdTouchpadPluginClass GsdTouchpadPluginClass;
+
+struct _GsdTouchpadPlugin
+{
+    GnomeSettingsPlugin parent;
+};
+
+struct _GsdTouchpadPluginClass
+{
+    GnomeSettingsPluginClass parent_class;
+}; 
+
+GType gsd_touchpad_plugin_get_type (void) G_GNUC_CONST;
+G_MODULE_EXPORT GType register_gnome_settings_plugin (GTypeModule *module);
+
+GNOME_SETTINGS_PLUGIN_REGISTER(GsdTouchpadPlugin, gsd_touchpad_plugin)
+
+static void
+gsd_touchpad_plugin_init (GsdTouchpadPlugin *plugin)
+{
+}
+
+static void
+activate (GnomeSettingsPlugin *plugin)
+{
+}
+
+static void
+deactivate (GnomeSettingsPlugin *plugin)
+{
+}
+
+static void
+gsd_touchpad_plugin_class_init (GsdTouchpadPluginClass *klass)
+{
+    GnomeSettingsPluginClass *plugin_class = GNOME_SETTINGS_PLUGIN_CLASS(klass);
+
+    plugin_class->activate = activate;
+    plugin_class->deactivate = deactivate;
+}
+/*
+vi:ts=4:nowrap:ai:expandtab:sw=4
+*/

Added: trunk/modules/gsd-trackpoint-plugin.c
==============================================================================
--- (empty file)
+++ trunk/modules/gsd-trackpoint-plugin.c	Sat Feb 28 10:07:28 2009
@@ -0,0 +1,78 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ *  Copyright (C) 2009 Hiroyuki Ikezoe  <poincare ikezoe net>
+ *
+ *  This library is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This library 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 Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+/* #include <gnome-settings-daemon/gnome-settings-plugin.h> */
+#include "gnome-settings-plugin.h"
+#include <glib/gi18n.h>
+
+#define GSD_TYPE_TRACK_POINT_PLUGIN            (gsd_track_point_plugin_get_type ())
+#define GSD_TRACK_POINT_PLUGIN(jbj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GSD_TYPE_TRACK_POINT_PLUGIN, GsdTrackPobjintPlugin))
+#define GSD_TRACK_POINT_PLUGIN_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GSD_TYPE_TRACK_POINT_PLUGIN, GsdTracklassPobjintPluginClass))
+#define GSD_IS_TRACK_POINT_PLUGIN(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GSD_TYPE_TRACK_POINT_PLUGIN))
+#define GSD_IS_TRACK_POINT_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GSD_TYPE_TRACK_POINT_PLUGIN))
+#define GSD_TRACK_POINT_PLUGIN_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GSD_TYPE_TRACK_POINT_PLUGIN, GsdTracklassPobjintPluginClass))
+
+typedef struct _GsdTrackPointPlugin GsdTrackPointPlugin;
+typedef struct _GsdTrackPointPluginClass GsdTrackPointPluginClass;
+
+struct _GsdTrackPointPlugin
+{
+    GnomeSettingsPlugin parent;
+};
+
+struct _GsdTrackPointPluginClass
+{
+    GnomeSettingsPluginClass parent_class;
+}; 
+
+GType gsd_track_point_plugin_get_type (void) G_GNUC_CONST;
+G_MODULE_EXPORT GType register_gnome_settings_plugin (GTypeModule *module);
+
+GNOME_SETTINGS_PLUGIN_REGISTER(GsdTrackPointPlugin, gsd_track_point_plugin)
+
+static void
+gsd_track_point_plugin_init (GsdTrackPointPlugin *plugin)
+{
+}
+
+static void
+activate (GnomeSettingsPlugin *plugin)
+{
+}
+
+static void
+deactivate (GnomeSettingsPlugin *plugin)
+{
+}
+
+static void
+gsd_track_point_plugin_class_init (GsdTrackPointPluginClass *klass)
+{
+    GnomeSettingsPluginClass *plugin_class = GNOME_SETTINGS_PLUGIN_CLASS(klass);
+
+    plugin_class->activate = activate;
+    plugin_class->deactivate = deactivate;
+}
+/*
+vi:ts=4:nowrap:ai:expandtab:sw=4
+*/

Added: trunk/modules/touchpad.gnome-settings-plugin.in
==============================================================================
--- (empty file)
+++ trunk/modules/touchpad.gnome-settings-plugin.in	Sat Feb 28 10:07:28 2009
@@ -0,0 +1,8 @@
+[GNOME Settings Plugin]
+Module=touchpad
+IAge=0
+_Name=Touchpad
+_Description=Touchpad plugin
+Authors=
+Copyright=Copyright  2009
+Website=

Added: trunk/modules/trackpoint.gnome-settings-plugin.in
==============================================================================
--- (empty file)
+++ trunk/modules/trackpoint.gnome-settings-plugin.in	Sat Feb 28 10:07:28 2009
@@ -0,0 +1,8 @@
+[GNOME Settings Plugin]
+Module=trackpoint
+IAge=0
+_Name=TrackPoint
+_Description=TrackPoint plugin
+Authors=
+Copyright=Copyright  2009
+Website=



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