gdk: Drop gdk_device_get/set_keys

This functionality was only ever half-implemented
on X11, and is not useful enough to keep around.
This commit is contained in:
Matthias Clasen 2020-06-09 15:06:38 -04:00
parent ea7c9b93ea
commit 2f98400b80
4 changed files with 0 additions and 112 deletions

View File

@ -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

View File

@ -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)

View File

@ -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_);

View File

@ -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,