gpointing-device-settings r188 - in trunk/modules: . gnome-settings-daemon-plugins
- From: hiikezoe svn gnome org
- To: svn-commits-list gnome org
- Subject: gpointing-device-settings r188 - in trunk/modules: . gnome-settings-daemon-plugins
- Date: Mon, 9 Mar 2009 03:23:45 +0000 (UTC)
Author: hiikezoe
Date: Mon Mar 9 03:23:45 2009
New Revision: 188
URL: http://svn.gnome.org/viewvc/gpointing-device-settings?rev=188&view=rev
Log:
set user's values when gnome-settings-daemon plugin starts.
I totally forgot to do this.
Modified:
trunk/modules/gnome-settings-daemon-plugins/gsd-mouse-extension-manager.c
trunk/modules/gnome-settings-daemon-plugins/gsd-pointing-device-manager.c
trunk/modules/gnome-settings-daemon-plugins/gsd-pointing-device-manager.h
trunk/modules/gnome-settings-daemon-plugins/gsd-touchpad-manager.c
trunk/modules/gpds-mouse-ui.c
Modified: trunk/modules/gnome-settings-daemon-plugins/gsd-mouse-extension-manager.c
==============================================================================
--- trunk/modules/gnome-settings-daemon-plugins/gsd-mouse-extension-manager.c (original)
+++ trunk/modules/gnome-settings-daemon-plugins/gsd-mouse-extension-manager.c Mon Mar 9 03:23:45 2009
@@ -33,10 +33,13 @@
G_DEFINE_TYPE (GsdMouseExtensionManager, gsd_mouse_extension_manager, GSD_TYPE_POINTING_DEVICE_MANAGER)
-static void _gconf_client_notify (GsdPointingDeviceManager *manager,
- GConfClient *client,
- guint cnxn_id,
- GConfEntry *entry);
+static gboolean start (GsdPointingDeviceManager *manager,
+ GError **error);
+static void stop (GsdPointingDeviceManager *manager);
+static void _gconf_client_notify (GsdPointingDeviceManager *manager,
+ GConfClient *client,
+ guint cnxn_id,
+ GConfEntry *entry);
static void
gsd_mouse_extension_manager_init (GsdMouseExtensionManager *manager)
@@ -48,9 +51,118 @@
{
GsdPointingDeviceManagerClass *manager_class = GSD_POINTING_DEVICE_MANAGER_CLASS(klass);
+ manager_class->start = start;
+ manager_class->stop = stop;
manager_class->gconf_client_notify = _gconf_client_notify;
}
+#define DEFINE_SET_VALUE_FUNCTION(function_name, key_name, value_type) \
+static void \
+set_ ## function_name (GsdPointingDeviceManager *manager, \
+ GpdsXInput *xinput, \
+ GConfClient *gconf) \
+{ \
+ g ## value_type value; \
+ gint properties[1]; \
+ gchar *key; \
+ gboolean value_exist; \
+ key = gsd_pointing_device_manager_build_gconf_key(manager, key_name ## _KEY); \
+ value_exist = gpds_gconf_get_ ## value_type (gconf, key_name ## _KEY, &value); \
+ g_free(key); \
+ if (!value_exist) \
+ return; \
+ properties[0] = value; \
+ gpds_xinput_set_int_properties(xinput, \
+ gpds_mouse_xinput_get_name(key_name), \
+ gpds_mouse_xinput_get_format_type(key_name), \
+ NULL, \
+ properties, \
+ 1); \
+}
+
+#define DEFINE_SET_BOOLEAN_FUNCTION(function_name, key_name) \
+ DEFINE_SET_VALUE_FUNCTION(function_name, key_name, boolean)
+
+#define DEFINE_SET_INT_FUNCTION(function_name, key_name) \
+ DEFINE_SET_VALUE_FUNCTION(function_name, key_name, int)
+
+DEFINE_SET_BOOLEAN_FUNCTION (wheel_emulation, GPDS_MOUSE_WHEEL_EMULATION)
+DEFINE_SET_BOOLEAN_FUNCTION (middle_button_emulation, GPDS_MOUSE_MIDDLE_BUTTON_EMULATION)
+DEFINE_SET_INT_FUNCTION (middle_button_timeout, GPDS_MOUSE_MIDDLE_BUTTON_TIMEOUT)
+DEFINE_SET_INT_FUNCTION (wheel_emulation_button, GPDS_MOUSE_WHEEL_EMULATION_BUTTON)
+DEFINE_SET_INT_FUNCTION (wheel_emulation_timeout, GPDS_MOUSE_WHEEL_EMULATION_TIMEOUT)
+DEFINE_SET_INT_FUNCTION (wheel_emulation_inertia, GPDS_MOUSE_WHEEL_EMULATION_INERTIA)
+
+static void
+set_horizontal_and_vertical_scroll (GsdPointingDeviceManager *manager,
+ GpdsXInput *xinput,
+ GConfClient *gconf)
+{
+ gboolean y_enable, x_enable;
+ gint properties[4];
+
+ if (!gpds_gconf_get_boolean(gconf, GPDS_MOUSE_WHEEL_EMULATION_Y_AXIS_KEY, &y_enable))
+ return;
+ if (!gpds_gconf_get_boolean(gconf, GPDS_MOUSE_WHEEL_EMULATION_X_AXIS_KEY, &x_enable))
+ return;
+
+ if (y_enable) {
+ properties[0] = 6;
+ properties[1] = 7;
+ } else {
+ properties[0] = 0;
+ properties[1] = 0;
+ }
+ if (x_enable) {
+ properties[2] = 4;
+ properties[3] = 5;
+ } else {
+ properties[2] = 0;
+ properties[3] = 0;
+ }
+ gpds_xinput_set_int_properties(xinput,
+ gpds_mouse_xinput_get_name(GPDS_MOUSE_WHEEL_EMULATION_AXES),
+ gpds_mouse_xinput_get_format_type(GPDS_MOUSE_WHEEL_EMULATION_AXES),
+ NULL,
+ properties,
+ 4);
+}
+
+static gboolean
+start (GsdPointingDeviceManager *manager, GError **error)
+{
+ GpdsXInput *xinput;
+ GConfClient *gconf;
+
+ xinput = gsd_pointing_device_manager_get_xinput(manager);
+ if (!xinput)
+ return FALSE;
+
+ gconf = gconf_client_get_default();
+ if (!gconf) {
+ g_object_unref(xinput);
+ return FALSE;
+ }
+
+ set_middle_button_emulation(manager, xinput, gconf);
+ set_wheel_emulation(manager, xinput, gconf);
+ set_middle_button_timeout(manager, xinput, gconf);
+ set_wheel_emulation_button(manager, xinput, gconf);
+ set_wheel_emulation_timeout(manager, xinput, gconf);
+ set_wheel_emulation_inertia(manager, xinput, gconf);
+ set_horizontal_and_vertical_scroll(manager, xinput, gconf);
+
+ g_object_unref(gconf);
+ g_object_unref(xinput);
+
+ return TRUE;
+}
+
+static void
+stop (GsdPointingDeviceManager *manager)
+{
+}
+
static void
_gconf_client_notify (GsdPointingDeviceManager *manager,
GConfClient *client,
@@ -60,102 +172,34 @@
GConfValue *value;
const gchar *key;
GpdsXInput *xinput;
- gint properties[4];
- const gchar *device_name;
- device_name = gsd_pointing_device_manager_get_device_name(manager);
- if (!device_name)
+ xinput = gsd_pointing_device_manager_get_xinput(manager);
+ if (!xinput)
return;
- if (!gpds_xinput_utils_exist_device(device_name))
- return;
-
- xinput = gpds_xinput_new(device_name);
-
value = gconf_entry_get_value(entry);
key = gpds_gconf_get_key_from_path(gconf_entry_get_key(entry));
switch (value->type) {
case GCONF_VALUE_BOOL:
if (!strcmp(key, GPDS_MOUSE_MIDDLE_BUTTON_EMULATION_KEY)) {
- properties[0] = gconf_value_get_bool(value) ? 1 : 0;
- gpds_xinput_set_int_properties(xinput,
- gpds_mouse_xinput_get_name(GPDS_MOUSE_MIDDLE_BUTTON_EMULATION),
- gpds_mouse_xinput_get_format_type(GPDS_MOUSE_MIDDLE_BUTTON_EMULATION),
- NULL,
- properties,
- 1);
+ set_middle_button_emulation(manager, xinput, client);
} else if (!strcmp(key, GPDS_MOUSE_WHEEL_EMULATION_KEY)) {
- properties[0] = gconf_value_get_bool(value) ? 1 : 0;
- gpds_xinput_set_int_properties(xinput,
- gpds_mouse_xinput_get_name(GPDS_MOUSE_WHEEL_EMULATION),
- gpds_mouse_xinput_get_format_type(GPDS_MOUSE_WHEEL_EMULATION),
- NULL,
- properties,
- 1);
+ set_wheel_emulation(manager, xinput, client);
} else if (!strcmp(key, GPDS_MOUSE_WHEEL_EMULATION_X_AXIS_KEY) ||
- !strcmp(key, GPDS_MOUSE_WHEEL_EMULATION_Y_AXIS_KEY)) {
- gboolean enable;
- enable = gconf_client_get_bool(client,
- GPDS_MOUSE_WHEEL_EMULATION_Y_AXIS_KEY,
- NULL);
- if (enable) {
- properties[0] = 6;
- properties[1] = 7;
- } else {
- properties[0] = 0;
- properties[1] = 0;
- }
-
- enable = gconf_client_get_bool(client,
- GPDS_MOUSE_WHEEL_EMULATION_X_AXIS_KEY,
- NULL);
- if (enable) {
- properties[2] = 4;
- properties[3] = 5;
- } else {
- properties[2] = 0;
- properties[3] = 0;
- }
- gpds_xinput_set_int_properties(xinput,
- gpds_mouse_xinput_get_name(GPDS_MOUSE_WHEEL_EMULATION_AXES),
- gpds_mouse_xinput_get_format_type(GPDS_MOUSE_WHEEL_EMULATION_AXES),
- NULL,
- properties,
- 4);
+ !strcmp(key, GPDS_MOUSE_WHEEL_EMULATION_Y_AXIS_KEY)) {
+ set_horizontal_and_vertical_scroll(manager, xinput, client);
}
break;
case GCONF_VALUE_INT:
- properties[0] = gconf_value_get_int(value);
- if (!strcmp(key, GPDS_MOUSE_MIDDLE_BUTTON_TIMEOUT_KEY)) {
- gpds_xinput_set_int_properties(xinput,
- gpds_mouse_xinput_get_name(GPDS_MOUSE_MIDDLE_BUTTON_TIMEOUT),
- gpds_mouse_xinput_get_format_type(GPDS_MOUSE_MIDDLE_BUTTON_TIMEOUT),
- NULL,
- properties,
- 1);
- } else if (!strcmp(key, GPDS_MOUSE_WHEEL_EMULATION_TIMEOUT_KEY)) {
- gpds_xinput_set_int_properties(xinput,
- gpds_mouse_xinput_get_name(GPDS_MOUSE_WHEEL_EMULATION_TIMEOUT),
- gpds_mouse_xinput_get_format_type(GPDS_MOUSE_WHEEL_EMULATION_TIMEOUT),
- NULL,
- properties,
- 1);
- } else if (!strcmp(key, GPDS_MOUSE_WHEEL_EMULATION_INERTIA_KEY)) {
- gpds_xinput_set_int_properties(xinput,
- gpds_mouse_xinput_get_name(GPDS_MOUSE_WHEEL_EMULATION_INERTIA),
- gpds_mouse_xinput_get_format_type(GPDS_MOUSE_WHEEL_EMULATION_INERTIA),
- NULL,
- properties,
- 1);
- } else if (!strcmp(key, GPDS_MOUSE_WHEEL_EMULATION_BUTTON_KEY)) {
- gpds_xinput_set_int_properties(xinput,
- gpds_mouse_xinput_get_name(GPDS_MOUSE_WHEEL_EMULATION_BUTTON),
- gpds_mouse_xinput_get_format_type(GPDS_MOUSE_WHEEL_EMULATION_BUTTON),
- NULL,
- properties,
- 1);
- }
+ if (!strcmp(key, GPDS_MOUSE_MIDDLE_BUTTON_TIMEOUT_KEY))
+ set_middle_button_timeout(manager, xinput, client);
+ else if (!strcmp(key, GPDS_MOUSE_WHEEL_EMULATION_TIMEOUT_KEY))
+ set_wheel_emulation_timeout(manager, xinput, client);
+ else if (!strcmp(key, GPDS_MOUSE_WHEEL_EMULATION_INERTIA_KEY))
+ set_wheel_emulation_inertia(manager, xinput, client);
+ else if (!strcmp(key, GPDS_MOUSE_WHEEL_EMULATION_BUTTON_KEY))
+ set_wheel_emulation_button(manager, xinput, client);
break;
default:
break;
Modified: trunk/modules/gnome-settings-daemon-plugins/gsd-pointing-device-manager.c
==============================================================================
--- trunk/modules/gnome-settings-daemon-plugins/gsd-pointing-device-manager.c (original)
+++ trunk/modules/gnome-settings-daemon-plugins/gsd-pointing-device-manager.c Mon Mar 9 03:23:45 2009
@@ -204,8 +204,9 @@
gboolean
gsd_pointing_device_manager_start (GsdPointingDeviceManager *manager,
- GError **error)
+ GError **error)
{
+ GsdPointingDeviceManagerClass *klass;
GsdPointingDeviceManagerPrivate *priv;
gchar *gconf_dir;
@@ -222,12 +223,21 @@
NULL);
g_free(gconf_dir);
- return TRUE;
+ klass = GSD_POINTING_DEVICE_MANAGER_GET_CLASS(manager);
+
+ return (klass->start) ? klass->start(manager, error) : TRUE;
}
void
gsd_pointing_device_manager_stop (GsdPointingDeviceManager *manager)
{
+ GsdPointingDeviceManagerClass *klass;
+
+ klass = GSD_POINTING_DEVICE_MANAGER_GET_CLASS(manager);
+
+ if (klass->stop)
+ klass->stop(manager);
+
dispose_gconf(GSD_POINTING_DEVICE_MANAGER_GET_PRIVATE(manager));
}
@@ -237,6 +247,40 @@
return GSD_POINTING_DEVICE_MANAGER_GET_PRIVATE(manager)->device_name;
}
+GpdsXInput *
+gsd_pointing_device_manager_get_xinput (GsdPointingDeviceManager *manager)
+{
+ const gchar *device_name;
+
+ device_name = gsd_pointing_device_manager_get_device_name(manager);
+ if (!device_name)
+ return NULL;
+
+ if (!gpds_xinput_utils_exist_device(device_name))
+ return NULL;
+
+ return gpds_xinput_new(device_name);
+}
+
+gchar *
+gsd_pointing_device_manager_build_gconf_key (GsdPointingDeviceManager *manager, const gchar *key)
+{
+ const gchar *device_name;
+ gchar *escaped_device_name, *gconf_key;
+
+ device_name = gsd_pointing_device_manager_get_device_name(manager);
+ if (!device_name)
+ return NULL;
+
+ escaped_device_name = gconf_escape_key(device_name, -1);
+ gconf_key = g_strdup_printf("%s/%s/%s",
+ GPDS_GCONF_DIR,
+ escaped_device_name,
+ key);
+ g_free(escaped_device_name);
+
+ return gconf_key;
+}
/*
vi:ts=4:nowrap:ai:expandtab:sw=4
*/
Modified: trunk/modules/gnome-settings-daemon-plugins/gsd-pointing-device-manager.h
==============================================================================
--- trunk/modules/gnome-settings-daemon-plugins/gsd-pointing-device-manager.h (original)
+++ trunk/modules/gnome-settings-daemon-plugins/gsd-pointing-device-manager.h Mon Mar 9 03:23:45 2009
@@ -22,6 +22,7 @@
#include <glib-object.h>
#include <gconf/gconf-client.h>
+#include <gpds-xinput.h>
G_BEGIN_DECLS
@@ -44,10 +45,13 @@
{
GObjectClass parent_class;
- void (*gconf_client_notify) (GsdPointingDeviceManager *manager,
- GConfClient *client,
- guint cnxn_id,
- GConfEntry *entry);
+ gboolean (*start) (GsdPointingDeviceManager *manager,
+ GError **error);
+ void (*stop) (GsdPointingDeviceManager *manager);
+ void (*gconf_client_notify) (GsdPointingDeviceManager *manager,
+ GConfClient *client,
+ guint cnxn_id,
+ GConfEntry *entry);
};
GType gsd_pointing_device_manager_get_type (void) G_GNUC_CONST;
@@ -59,6 +63,11 @@
gboolean gsd_pointing_device_manager_start (GsdPointingDeviceManager *manager,
GError **error);
void gsd_pointing_device_manager_stop (GsdPointingDeviceManager *manager);
+GpdsXInput *gsd_pointing_device_manager_get_xinput
+ (GsdPointingDeviceManager *manager);
+gchar *gsd_pointing_device_manager_build_gconf_key
+ (GsdPointingDeviceManager *manager,
+ const gchar *key);
G_END_DECLS
Modified: trunk/modules/gnome-settings-daemon-plugins/gsd-touchpad-manager.c
==============================================================================
--- trunk/modules/gnome-settings-daemon-plugins/gsd-touchpad-manager.c (original)
+++ trunk/modules/gnome-settings-daemon-plugins/gsd-touchpad-manager.c Mon Mar 9 03:23:45 2009
@@ -33,10 +33,13 @@
G_DEFINE_TYPE (GsdTouchpadManager, gsd_touchpad_manager, GSD_TYPE_POINTING_DEVICE_MANAGER)
-static void _gconf_client_notify (GsdPointingDeviceManager *manager,
- GConfClient *client,
- guint cnxn_id,
- GConfEntry *entry);
+static gboolean start (GsdPointingDeviceManager *manager,
+ GError **error);
+static void stop (GsdPointingDeviceManager *manager);
+static void _gconf_client_notify (GsdPointingDeviceManager *manager,
+ GConfClient *client,
+ guint cnxn_id,
+ GConfEntry *entry);
static void
gsd_touchpad_manager_init (GsdTouchpadManager *manager)
@@ -48,9 +51,143 @@
{
GsdPointingDeviceManagerClass *manager_class = GSD_POINTING_DEVICE_MANAGER_CLASS(klass);
+ manager_class->start = start;
+ manager_class->stop = stop;
manager_class->gconf_client_notify = _gconf_client_notify;
}
+static GpdsXInput *
+get_xinput (GsdPointingDeviceManager *manager)
+{
+ const gchar *device_name;
+
+ device_name = gsd_pointing_device_manager_get_device_name(manager);
+ if (!device_name)
+ return NULL;
+
+ if (!gpds_xinput_utils_exist_device(device_name))
+ return NULL;
+
+ return gpds_xinput_new(device_name);
+}
+
+#define DEFINE_SET_VALUE_FUNCTION(function_name, key_name, value_type) \
+static void \
+set_ ## function_name (GsdPointingDeviceManager *manager, \
+ GpdsXInput *xinput, \
+ GConfClient *gconf) \
+{ \
+ g ## value_type value; \
+ gint properties[1]; \
+ gchar *key; \
+ gboolean value_exist; \
+ key = gsd_pointing_device_manager_build_gconf_key(manager, key_name ## _KEY); \
+ value_exist = gpds_gconf_get_ ## value_type (gconf, key_name ## _KEY, &value); \
+ g_free(key); \
+ if (!value_exist) \
+ return; \
+ properties[0] = value; \
+ gpds_xinput_set_int_properties(xinput, \
+ gpds_touchpad_xinput_get_name(key_name), \
+ gpds_touchpad_xinput_get_format_type(key_name), \
+ NULL, \
+ properties, \
+ 1); \
+}
+
+#define DEFINE_SET_BOOLEAN_FUNCTION(function_name, key_name) \
+ DEFINE_SET_VALUE_FUNCTION(function_name, key_name, boolean)
+
+#define DEFINE_SET_INT_FUNCTION(function_name, key_name) \
+ DEFINE_SET_VALUE_FUNCTION(function_name, key_name, int)
+
+DEFINE_SET_BOOLEAN_FUNCTION (tap_fast_tap, GPDS_TOUCHPAD_TAP_FAST_TAP)
+DEFINE_SET_BOOLEAN_FUNCTION (circular_scrolling, GPDS_TOUCHPAD_CIRCULAR_SCROLLING)
+DEFINE_SET_INT_FUNCTION (touchpad_off, GPDS_TOUCHPAD_OFF)
+DEFINE_SET_INT_FUNCTION (tap_time, GPDS_TOUCHPAD_TAP_TIME)
+
+static void
+set_horizontal_and_vertical_scrolling (GsdPointingDeviceManager *manager,
+ GpdsXInput *xinput,
+ GConfClient *gconf)
+{
+ gboolean h_enable, v_enable;
+ gint properties[3];
+
+ if (!gpds_gconf_get_boolean(gconf, GPDS_TOUCHPAD_VERTICAL_SCROLLING_KEY, &v_enable))
+ return;
+ if (!gpds_gconf_get_boolean(gconf, GPDS_TOUCHPAD_HORIZONTAL_SCROLLING_KEY, &h_enable))
+ return;
+
+ properties[0] = v_enable ? 1 : 0;
+ properties[1] = h_enable ? 1 : 0;
+ properties[2] = 0;
+
+ gpds_xinput_set_int_properties(xinput,
+ gpds_touchpad_xinput_get_name(GPDS_TOUCHPAD_EDGE_SCROLLING),
+ gpds_touchpad_xinput_get_format_type(GPDS_TOUCHPAD_EDGE_SCROLLING),
+ NULL,
+ properties,
+ 3);
+}
+
+static void
+set_horizontal_and_vertical_scrolling_distance (GsdPointingDeviceManager *manager,
+ GpdsXInput *xinput,
+ GConfClient *gconf)
+{
+ gint h_distance, v_distance;
+ gint properties[2];
+
+ if (!gpds_gconf_get_boolean(gconf, GPDS_TOUCHPAD_VERTICAL_SCROLLING_DISTANCE_KEY, &v_distance))
+ return;
+ if (!gpds_gconf_get_boolean(gconf, GPDS_TOUCHPAD_HORIZONTAL_SCROLLING_DISTANCE_KEY, &h_distance))
+ return;
+
+ properties[0] = v_distance ? 1 : 0;
+ properties[1] = h_distance ? 1 : 0;
+
+ gpds_xinput_set_int_properties(xinput,
+ gpds_touchpad_xinput_get_name(GPDS_TOUCHPAD_SCROLLING_DISTANCE),
+ gpds_touchpad_xinput_get_format_type(GPDS_TOUCHPAD_SCROLLING_DISTANCE),
+ NULL,
+ properties,
+ 2);
+}
+
+static gboolean
+start (GsdPointingDeviceManager *manager, GError **error)
+{
+ GpdsXInput *xinput;
+ GConfClient *gconf;
+
+ xinput = get_xinput(manager);
+ if (!xinput)
+ return FALSE;
+
+ gconf = gconf_client_get_default();
+ if (!gconf) {
+ g_object_unref(xinput);
+ return FALSE;
+ }
+
+ set_tap_fast_tap(manager, xinput, gconf);
+ set_circular_scrolling(manager, xinput, gconf);
+ set_touchpad_off(manager, xinput, gconf);
+ set_tap_time(manager, xinput, gconf);
+ set_horizontal_and_vertical_scrolling(manager, xinput, gconf);
+
+ g_object_unref(gconf);
+ g_object_unref(xinput);
+
+ return TRUE;
+}
+
+static void
+stop (GsdPointingDeviceManager *manager)
+{
+}
+
static void
_gconf_client_notify (GsdPointingDeviceManager *manager,
GConfClient *client,
@@ -60,92 +197,33 @@
GConfValue *value;
const gchar *key;
GpdsXInput *xinput;
- gint properties[4];
- const gchar *device_name;
- device_name = gsd_pointing_device_manager_get_device_name(manager);
- if (!device_name)
- return;
-
- if (!gpds_xinput_utils_exist_device(device_name))
+ xinput = gsd_pointing_device_manager_get_xinput(manager);
+ if (!xinput)
return;
- xinput = gpds_xinput_new(device_name);
-
value = gconf_entry_get_value(entry);
key = gpds_gconf_get_key_from_path(gconf_entry_get_key(entry));
switch (value->type) {
case GCONF_VALUE_BOOL:
if (!strcmp(key, GPDS_TOUCHPAD_TAP_FAST_TAP_KEY)) {
- properties[0] = gconf_value_get_bool(value) ? 1 : 0;
- gpds_xinput_set_int_properties(xinput,
- gpds_touchpad_xinput_get_name(GPDS_TOUCHPAD_TAP_FAST_TAP),
- gpds_touchpad_xinput_get_format_type(GPDS_TOUCHPAD_TAP_FAST_TAP),
- NULL,
- properties,
- 1);
+ set_tap_fast_tap(manager, xinput, client);
} else if (!strcmp(key, GPDS_TOUCHPAD_CIRCULAR_SCROLLING_KEY)) {
- properties[0] = gconf_value_get_bool(value) ? 1 : 0;
- gpds_xinput_set_int_properties(xinput,
- gpds_touchpad_xinput_get_name(GPDS_TOUCHPAD_CIRCULAR_SCROLLING),
- gpds_touchpad_xinput_get_format_type(GPDS_TOUCHPAD_CIRCULAR_SCROLLING),
- NULL,
- properties,
- 1);
+ set_circular_scrolling(manager, xinput, client);
} else if (!strcmp(key, GPDS_TOUCHPAD_VERTICAL_SCROLLING_KEY) ||
!strcmp(key, GPDS_TOUCHPAD_HORIZONTAL_SCROLLING_KEY)) {
- gboolean enable;
- enable = gconf_client_get_bool(client,
- GPDS_TOUCHPAD_VERTICAL_SCROLLING_KEY,
- NULL);
- properties[0] = enable ? 1 : 0;
- enable = gconf_client_get_bool(client,
- GPDS_TOUCHPAD_HORIZONTAL_SCROLLING_KEY,
- NULL);
- properties[1] = enable ? 1 : 0;
-
- gpds_xinput_set_int_properties(xinput,
- gpds_touchpad_xinput_get_name(GPDS_TOUCHPAD_EDGE_SCROLLING),
- gpds_touchpad_xinput_get_format_type(GPDS_TOUCHPAD_EDGE_SCROLLING),
- NULL,
- properties,
- 2);
+ set_horizontal_and_vertical_scrolling(manager, xinput, client);
}
break;
case GCONF_VALUE_INT:
if (!strcmp(key, GPDS_TOUCHPAD_OFF_KEY)) {
- properties[0] = gconf_value_get_int(value);
- gpds_xinput_set_int_properties(xinput,
- gpds_touchpad_xinput_get_name(GPDS_TOUCHPAD_OFF),
- gpds_touchpad_xinput_get_format_type(GPDS_TOUCHPAD_OFF),
- NULL,
- properties,
- 1);
+ set_touchpad_off(manager, xinput, client);
} else if (!strcmp(key, GPDS_TOUCHPAD_TAP_TIME_KEY)) {
- properties[0] = gconf_value_get_int(value);
- gpds_xinput_set_int_properties(xinput,
- gpds_touchpad_xinput_get_name(GPDS_TOUCHPAD_TAP_TIME),
- gpds_touchpad_xinput_get_format_type(GPDS_TOUCHPAD_TAP_TIME),
- NULL,
- properties,
- 1);
+ set_tap_time(manager, xinput, client);
} else if (!strcmp(key, GPDS_TOUCHPAD_VERTICAL_SCROLLING_DISTANCE_KEY) ||
!strcmp(key, GPDS_TOUCHPAD_HORIZONTAL_SCROLLING_DISTANCE_KEY)) {
- properties[0] =
- gconf_client_get_int(client,
- GPDS_TOUCHPAD_VERTICAL_SCROLLING_DISTANCE_KEY,
- NULL);
- properties[1] =
- gconf_client_get_int(client,
- GPDS_TOUCHPAD_HORIZONTAL_SCROLLING_DISTANCE_KEY,
- NULL);
- gpds_xinput_set_int_properties(xinput,
- gpds_touchpad_xinput_get_name(GPDS_TOUCHPAD_SCROLLING_DISTANCE),
- gpds_touchpad_xinput_get_format_type(GPDS_TOUCHPAD_SCROLLING_DISTANCE),
- NULL,
- properties,
- 2);
+ set_horizontal_and_vertical_scrolling_distance(manager, xinput, client);
}
break;
default:
Modified: trunk/modules/gpds-mouse-ui.c
==============================================================================
--- trunk/modules/gpds-mouse-ui.c (original)
+++ trunk/modules/gpds-mouse-ui.c Mon Mar 9 03:23:45 2009
@@ -550,6 +550,7 @@
g_free(values);
}
+
static void
setup_current_values (GpdsUI *ui, GtkBuilder *builder)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]