[gnome-settings-daemon] common: Remove unused helpers
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] common: Remove unused helpers
- Date: Mon, 6 Jun 2011 17:49:02 +0000 (UTC)
commit 58f5d1f17f771963217682c78c04cfbb7978d199
Author: Bastien Nocera <hadess hadess net>
Date: Mon Jun 6 18:22:57 2011 +0100
common: Remove unused helpers
plugins/common/gsd-input-helper.c | 115 -------------------------------------
plugins/common/gsd-input-helper.h | 2 -
2 files changed, 0 insertions(+), 117 deletions(-)
---
diff --git a/plugins/common/gsd-input-helper.c b/plugins/common/gsd-input-helper.c
index e01c522..2d82722 100644
--- a/plugins/common/gsd-input-helper.c
+++ b/plugins/common/gsd-input-helper.c
@@ -225,121 +225,6 @@ touchpad_is_present (void)
device_is_touchpad);
}
-static char *
-get_device_node (int deviceid)
-{
- Atom prop;
- Atom act_type;
- int act_format;
- unsigned long nitems, bytes_after;
- unsigned char *data;
- char *ret;
-
- gdk_display_sync (gdk_display_get_default ());
-
- prop = XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), "Device Node", False);
- if (!prop)
- return NULL;
-
- gdk_error_trap_push ();
-
- if (!XIGetProperty (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
- deviceid, prop, 0, 1000, False,
- AnyPropertyType, &act_type, &act_format,
- &nitems, &bytes_after, &data) == Success) {
- gdk_error_trap_pop_ignored ();
- return NULL;
- }
- if (gdk_error_trap_pop ())
- goto out;
-
- if (nitems == 0)
- goto out;
-
- if (act_type != XA_STRING)
- goto out;
-
- /* Unknown string format */
- if (act_format != 8)
- goto out;
-
- ret = g_strdup ((char *) data);
-
- XFree (data);
- return ret;
-
-out:
- XFree (data);
- return NULL;
-}
-
-gboolean
-accelerometer_is_present (char **device_node,
- int *device_id)
-{
- XIDeviceInfo *device_info;
- gint n_devices;
- guint i;
- gboolean retval;
-
- if (supports_xinput2_devices () == FALSE)
- return FALSE;
-
- /* Find the accelerometer device,
- * Floating, and with 3 axis */
- device_info = XIQueryDevice (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), XIAllDevices, &n_devices);
-
- if (device_info == NULL)
- return FALSE;
-
- retval = FALSE;
-
- for (i = 0; i < n_devices; i++) {
- XIDeviceInfo *device;
- gboolean all_vals;
- guint j;
- char *node;
-
- device = &device_info[i];
-
- /* Check for a floating device */
- if (device->use != XIFloatingSlave)
- continue;
-
- /* Not 3 classes? Probably not an accelerometer */
- if (device->num_classes != 3)
- continue;
-
- /* Check for a valuator class */
- all_vals = TRUE;
- for (j = 0; j < device->num_classes; j++) {
- if (device->classes[j]->type != XIValuatorClass) {
- all_vals = FALSE;
- break;
- }
- }
- if (all_vals == FALSE)
- continue;
-
- /* Look for the "Device Node" property */
- node = get_device_node (device->deviceid);
- if (device_node != NULL)
- *device_node = node;
- else
- g_free (node);
- if (device_id != NULL)
- *device_id = device->deviceid;
-
- retval = TRUE;
-
- break;
- }
-
- XIFreeDeviceInfo (device_info);
-
- return retval;
-}
-
gboolean
set_device_enabled (int device_id,
gboolean enabled)
diff --git a/plugins/common/gsd-input-helper.h b/plugins/common/gsd-input-helper.h
index d5a9329..736c452 100644
--- a/plugins/common/gsd-input-helper.h
+++ b/plugins/common/gsd-input-helper.h
@@ -51,8 +51,6 @@ typedef struct {
gboolean supports_xinput_devices (void);
gboolean supports_xinput2_devices (void);
-gboolean accelerometer_is_present (char **device_node,
- int *device_id);
gboolean set_device_enabled (int device_id,
gboolean enabled);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]