[gnome-settings-daemon] common: Remove unused functions
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] common: Remove unused functions
- Date: Mon, 4 Jan 2016 14:14:39 +0000 (UTC)
commit 9287ef9ac5b119abdcbbabd920c19f353e577f90
Author: Bastien Nocera <hadess hadess net>
Date: Thu Dec 17 15:41:21 2015 +0100
common: Remove unused functions
https://bugzilla.gnome.org/show_bug.cgi?id=759599
plugins/common/gsd-input-helper.c | 189 ------------------------------------
plugins/common/gsd-input-helper.h | 12 ---
plugins/common/test-input-helper.c | 5 +-
3 files changed, 1 insertions(+), 205 deletions(-)
---
diff --git a/plugins/common/gsd-input-helper.c b/plugins/common/gsd-input-helper.c
index e3fe2d8..c8d4f51 100644
--- a/plugins/common/gsd-input-helper.c
+++ b/plugins/common/gsd-input-helper.c
@@ -118,12 +118,6 @@ supports_xinput_devices_with_opcode (int *opcode)
}
gboolean
-supports_xinput_devices (void)
-{
- return supports_xinput_devices_with_opcode (NULL);
-}
-
-gboolean
supports_xtest (void)
{
gint op_code, event, error;
@@ -163,66 +157,6 @@ supports_xinput2_devices (int *opcode)
return TRUE;
}
-gboolean
-xdevice_is_synaptics (XDevice *xdevice)
-{
- Atom realtype, prop;
- int realformat;
- unsigned long nitems, bytes_after;
- unsigned char *data;
-
- /* we don't check on the type being XI_TOUCHPAD here,
- * but having a "Synaptics Off" property should be enough */
-
- prop = XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), "Synaptics Off", False);
- if (!prop)
- return FALSE;
-
- gdk_error_trap_push ();
- if ((XGetDeviceProperty (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), xdevice, prop, 0, 1,
False,
- XA_INTEGER, &realtype, &realformat, &nitems,
- &bytes_after, &data) == Success) && (realtype != None)) {
- gdk_error_trap_pop_ignored ();
- XFree (data);
- return TRUE;
- }
- gdk_error_trap_pop_ignored ();
-
- return FALSE;
-}
-
-gboolean
-synaptics_is_present (void)
-{
- XDeviceInfo *device_info;
- gint n_devices;
- guint i;
- gboolean retval;
-
- retval = FALSE;
-
- device_info = XListInputDevices (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), &n_devices);
- if (device_info == NULL)
- return FALSE;
-
- for (i = 0; i < n_devices; i++) {
- XDevice *device;
-
- gdk_error_trap_push ();
- device = XOpenDevice (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), device_info[i].id);
- if (gdk_error_trap_pop () || (device == NULL))
- continue;
-
- retval = xdevice_is_synaptics (device);
- xdevice_close (device);
- if (retval)
- break;
- }
- XFreeDeviceList (device_info);
-
- return retval;
-}
-
static gboolean
device_type_is_present (GsdDeviceType type)
{
@@ -250,29 +184,6 @@ mouse_is_present (void)
return device_type_is_present (GSD_DEVICE_TYPE_MOUSE);
}
-gboolean
-trackball_is_present (void)
-{
- gboolean retval = FALSE;
- GList *l, *mice = gsd_device_manager_list_devices (gsd_device_manager_get (),
- GSD_DEVICE_TYPE_MOUSE);
- if (mice == NULL)
- return FALSE;
-
- for (l = mice; l != NULL; l = l->next) {
- gchar *lowercase;
- const gchar *name = gsd_device_get_name (l->data);
- if (!name)
- continue;
- lowercase = g_ascii_strdown (name, -1);
- retval = strstr (lowercase, "trackball") != NULL;
- g_free (lowercase);
- }
-
- g_list_free (mice);
- return retval;
-}
-
char *
xdevice_get_device_node (int deviceid)
{
@@ -431,29 +342,6 @@ set_device_enabled (int device_id,
return TRUE;
}
-gboolean
-set_synaptics_device_enabled (int device_id,
- gboolean enabled)
-{
- Atom prop;
- guchar value;
-
- prop = XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), "Synaptics Off", False);
- if (!prop)
- return FALSE;
-
- gdk_error_trap_push ();
-
- value = enabled ? 0 : 1;
- XIChangeProperty (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
- device_id, prop, XA_INTEGER, 8, PropModeReplace, &value, 1);
-
- if (gdk_error_trap_pop ())
- return FALSE;
-
- return TRUE;
-}
-
static const char *
custom_command_to_string (CustomCommand command)
{
@@ -544,59 +432,6 @@ run_custom_command (GdkDevice *device,
return FALSE;
}
-GList *
-get_disabled_synaptics (void)
-{
- GdkDisplay *display;
- XDeviceInfo *device_info;
- gint n_devices, act_format, rc;
- guint i;
- GList *ret;
- Atom prop, act_type;
- unsigned long nitems, bytes_after;
- unsigned char *data;
-
- ret = NULL;
-
- display = gdk_display_get_default ();
- prop = gdk_x11_get_xatom_by_name ("Synaptics Off");
-
- gdk_error_trap_push ();
-
- device_info = XListInputDevices (GDK_DISPLAY_XDISPLAY (display), &n_devices);
- if (device_info == NULL) {
- gdk_error_trap_pop_ignored ();
-
- return ret;
- }
-
- for (i = 0; i < n_devices; i++) {
- rc = XIGetProperty (GDK_DISPLAY_XDISPLAY (display),
- device_info[i].id, prop, 0, 1, False,
- XA_INTEGER, &act_type, &act_format,
- &nitems, &bytes_after, &data);
-
- if (rc != Success || act_type != XA_INTEGER ||
- act_format != 8 || nitems < 1)
- continue;
-
- if (!(data[0])) {
- XFree (data);
- continue;
- }
-
- XFree (data);
-
- ret = g_list_prepend (ret, GINT_TO_POINTER (device_info[i].id));
- }
-
- gdk_error_trap_pop_ignored ();
-
- XFreeDeviceList (device_info);
-
- return ret;
-}
-
const char *
xdevice_get_wacom_tool_type (int deviceid)
{
@@ -683,27 +518,3 @@ xdevice_get_dimensions (int deviceid,
return (w != 0 && h != 0);
}
-
-gboolean
-xdevice_is_libinput (gint deviceid)
-{
- GdkDisplay *display = gdk_display_get_default ();
- gulong nitems, bytes_after;
- gint rc, format;
- guchar *data;
- Atom type;
-
- gdk_error_trap_push ();
-
- /* Lookup a libinput driver specific property */
- rc = XIGetProperty (GDK_DISPLAY_XDISPLAY (display), deviceid,
- gdk_x11_get_xatom_by_name ("libinput Send Events Mode Enabled"),
- 0, 1, False, XA_INTEGER, &type, &format, &nitems, &bytes_after, &data);
-
- if (rc == Success)
- XFree (data);
-
- gdk_error_trap_pop_ignored ();
-
- return rc == Success && nitems > 0;
-}
diff --git a/plugins/common/gsd-input-helper.h b/plugins/common/gsd-input-helper.h
index aadd790..61addda 100644
--- a/plugins/common/gsd-input-helper.h
+++ b/plugins/common/gsd-input-helper.h
@@ -50,23 +50,15 @@ typedef struct {
} data;
} PropertyHelper;
-gboolean supports_xinput_devices (void);
gboolean supports_xinput2_devices (int *opcode);
gboolean supports_xtest (void);
gboolean set_device_enabled (int device_id,
gboolean enabled);
-gboolean set_synaptics_device_enabled (int device_id,
- gboolean enabled);
-
-gboolean xdevice_is_synaptics (XDevice *xdevice);
-
-gboolean synaptics_is_present (void);
gboolean touchpad_is_present (void);
gboolean touchscreen_is_present (void);
gboolean mouse_is_present (void);
-gboolean trackball_is_present (void);
gboolean device_set_property (XDevice *xdevice,
const char *device_name,
@@ -75,7 +67,6 @@ gboolean device_set_property (XDevice *xdevice,
gboolean run_custom_command (GdkDevice *device,
CustomCommand command);
-GList * get_disabled_synaptics (void);
char * xdevice_get_device_node (int deviceid);
int xdevice_get_last_tool_id (int deviceid);
gboolean xdevice_get_dimensions (int deviceid,
@@ -85,9 +76,6 @@ void xdevice_close (XDevice *xdevice);
const char * xdevice_get_wacom_tool_type (int deviceid);
-gboolean xdevice_is_libinput (gint deviceid);
-
-
G_END_DECLS
#endif /* __GSD_INPUT_HELPER_H */
diff --git a/plugins/common/test-input-helper.c b/plugins/common/test-input-helper.c
index e78f463..954ac30 100644
--- a/plugins/common/test-input-helper.c
+++ b/plugins/common/test-input-helper.c
@@ -32,7 +32,7 @@
int main (int argc, char **argv)
{
GList *devices, *l;
- gboolean has_touchpad, has_touchscreen, has_trackball;
+ gboolean has_touchpad, has_touchscreen;
gtk_init (&argc, &argv);
@@ -42,9 +42,6 @@ int main (int argc, char **argv)
has_touchscreen = touchscreen_is_present ();
g_print ("Has touchscreen:\t\t\t%s\n", has_touchscreen ? "yes" : "no");
- has_trackball = trackball_is_present ();
- g_print ("Has trackball:\t\t\t\t%s\n", has_trackball ? "yes" : "no");
-
devices = gsd_device_manager_list_devices (gsd_device_manager_get (), GSD_DEVICE_TYPE_MOUSE);
for (l = devices; l != NULL; l = l->next)
g_print ("Device '%s' is a mouse\n", gsd_device_get_name (l->data));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]