[gtk/device-cleanup: 2/4] gdk: Drop gdk_device_get/set_keys



commit 2f98400b80749534687c7806845dbc9dc87d0cc5
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Jun 9 15:06:38 2020 -0400

    gdk: Drop gdk_device_get/set_keys
    
    This functionality was only ever half-implemented
    on X11, and is not useful enough to keep around.

 docs/reference/gdk/gdk4-sections.txt |  3 --
 gdk/gdkdevice.c                      | 84 ------------------------------------
 gdk/gdkdevice.h                      | 13 ------
 gdk/gdkdeviceprivate.h               | 12 ------
 4 files changed, 112 deletions(-)
---
diff --git a/docs/reference/gdk/gdk4-sections.txt b/docs/reference/gdk/gdk4-sections.txt
index cc1bdd0189..cb235271a8 100644
--- a/docs/reference/gdk/gdk4-sections.txt
+++ b/docs/reference/gdk/gdk4-sections.txt
@@ -357,8 +357,6 @@ gdk_device_get_name
 gdk_device_get_vendor_id
 gdk_device_get_product_id
 gdk_device_get_source
-gdk_device_set_key
-gdk_device_get_key
 gdk_device_set_axis_use
 gdk_device_get_axis_use
 gdk_device_get_associated_device
@@ -367,7 +365,6 @@ gdk_device_get_device_type
 gdk_device_get_display
 gdk_device_get_has_cursor
 gdk_device_get_n_axes
-gdk_device_get_n_keys
 gdk_device_get_axes
 gdk_device_get_seat
 gdk_device_get_num_touches
diff --git a/gdk/gdkdevice.c b/gdk/gdkdevice.c
index 969d05f777..6201631b07 100644
--- a/gdk/gdkdevice.c
+++ b/gdk/gdkdevice.c
@@ -393,7 +393,6 @@ gdk_device_finalize (GObject *object)
     }
 
   g_clear_pointer (&device->name, g_free);
-  g_clear_pointer (&device->keys, g_free);
   g_clear_pointer (&device->vendor_id, g_free);
   g_clear_pointer (&device->product_id, g_free);
 
@@ -684,79 +683,6 @@ gdk_device_get_source (GdkDevice *device)
   return device->source;
 }
 
-/**
- * gdk_device_get_n_keys:
- * @device: a #GdkDevice
- *
- * Returns the number of keys the device currently has.
- *
- * Returns: the number of keys.
- **/
-gint
-gdk_device_get_n_keys (GdkDevice *device)
-{
-  g_return_val_if_fail (GDK_IS_DEVICE (device), 0);
-
-  return device->num_keys;
-}
-
-/**
- * gdk_device_get_key:
- * @device: a #GdkDevice.
- * @index_: the index of the macro button to get.
- * @keyval: (out): return value for the keyval.
- * @modifiers: (out): return value for modifiers.
- *
- * If @index_ has a valid keyval, this function will return %TRUE
- * and fill in @keyval and @modifiers with the keyval settings.
- *
- * Returns: %TRUE if keyval is set for @index.
- **/
-gboolean
-gdk_device_get_key (GdkDevice       *device,
-                    guint            index_,
-                    guint           *keyval,
-                    GdkModifierType *modifiers)
-{
-  g_return_val_if_fail (GDK_IS_DEVICE (device), FALSE);
-  g_return_val_if_fail (index_ < device->num_keys, FALSE);
-
-  if (!device->keys[index_].keyval &&
-      !device->keys[index_].modifiers)
-    return FALSE;
-
-  if (keyval)
-    *keyval = device->keys[index_].keyval;
-
-  if (modifiers)
-    *modifiers = device->keys[index_].modifiers;
-
-  return TRUE;
-}
-
-/**
- * gdk_device_set_key:
- * @device: a #GdkDevice
- * @index_: the index of the macro button to set
- * @keyval: the keyval to generate
- * @modifiers: the modifiers to set
- *
- * Specifies the X key event to generate when a macro button of a device
- * is pressed.
- **/
-void
-gdk_device_set_key (GdkDevice      *device,
-                    guint           index_,
-                    guint           keyval,
-                    GdkModifierType modifiers)
-{
-  g_return_if_fail (GDK_IS_DEVICE (device));
-  g_return_if_fail (index_ < device->num_keys);
-
-  device->keys[index_].keyval = keyval;
-  device->keys[index_].modifiers = modifiers;
-}
-
 /**
  * gdk_device_get_axis_use:
  * @device: a pointer #GdkDevice.
@@ -1273,16 +1199,6 @@ _gdk_device_get_axis_info (GdkDevice   *device,
   *resolution = info->resolution;
 }
 
-void
-_gdk_device_set_keys (GdkDevice *device,
-                      guint      num_keys)
-{
-  g_free (device->keys);
-
-  device->num_keys = num_keys;
-  device->keys = g_new0 (GdkDeviceKey, num_keys);
-}
-
 static GdkAxisInfo *
 find_axis_info (GArray     *array,
                 GdkAxisUse  use)
diff --git a/gdk/gdkdevice.h b/gdk/gdkdevice.h
index a45a3163fb..7f7aea3bfe 100644
--- a/gdk/gdkdevice.h
+++ b/gdk/gdkdevice.h
@@ -115,19 +115,6 @@ gboolean              gdk_device_get_has_cursor (GdkDevice *device);
 GDK_AVAILABLE_IN_ALL
 GdkInputSource gdk_device_get_source (GdkDevice    *device);
 
-GDK_AVAILABLE_IN_ALL
-gint           gdk_device_get_n_keys    (GdkDevice       *device);
-GDK_AVAILABLE_IN_ALL
-gboolean       gdk_device_get_key       (GdkDevice       *device,
-                                         guint            index_,
-                                         guint           *keyval,
-                                         GdkModifierType *modifiers);
-GDK_AVAILABLE_IN_ALL
-void           gdk_device_set_key       (GdkDevice      *device,
-                                         guint           index_,
-                                         guint           keyval,
-                                         GdkModifierType modifiers);
-
 GDK_AVAILABLE_IN_ALL
 GdkAxisUse     gdk_device_get_axis_use  (GdkDevice         *device,
                                          guint              index_);
diff --git a/gdk/gdkdeviceprivate.h b/gdk/gdkdeviceprivate.h
index de7c9e5c34..4ca7c99694 100644
--- a/gdk/gdkdeviceprivate.h
+++ b/gdk/gdkdeviceprivate.h
@@ -31,13 +31,6 @@ G_BEGIN_DECLS
 #define GDK_DEVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE, GdkDeviceClass))
 
 typedef struct _GdkDeviceClass GdkDeviceClass;
-typedef struct _GdkDeviceKey GdkDeviceKey;
-
-struct _GdkDeviceKey
-{
-  guint keyval;
-  GdkModifierType modifiers;
-};
 
 struct _GdkDevice
 {
@@ -46,9 +39,7 @@ struct _GdkDevice
   gchar *name;
   GdkInputSource source;
   gboolean has_cursor;
-  gint num_keys;
   GdkAxisFlags axis_flags;
-  GdkDeviceKey *keys;
   GdkDisplay *display;
   /* Paired master for master,
    * associated master for slaves
@@ -119,9 +110,6 @@ void _gdk_device_get_axis_info (GdkDevice  *device,
                                gdouble    *max_value,
                                gdouble    *resolution);
 
-void _gdk_device_set_keys    (GdkDevice   *device,
-                              guint        num_keys);
-
 gboolean   _gdk_device_translate_surface_coord (GdkDevice *device,
                                                 GdkSurface *surface,
                                                 guint      index,


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