gdk: add gdk_device_get_n_keys() to access the sealed num_keys member

This commit is contained in:
Michael Natterer 2010-11-24 20:15:29 +01:00
parent 07c00b9969
commit d0f2b13309
6 changed files with 44 additions and 0 deletions

View File

@ -281,6 +281,14 @@ gdk_device_get_axis_use (GdkDevice *device,
return device->axes[index].use;
}
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_n_axes:
* @device: a #GdkDevice.

View File

@ -388,6 +388,7 @@ gdk_device_get_key
gdk_device_get_mode
gdk_device_get_name
gdk_device_get_n_axes
gdk_device_get_n_keys
gdk_device_get_source
gdk_device_get_type G_GNUC_CONST
gdk_device_set_axis_use

View File

@ -141,6 +141,7 @@ void gdk_device_get_key (GdkDevice *device,
GdkModifierType *modifiers);
GdkAxisUse gdk_device_get_axis_use (GdkDevice *device,
guint index);
gint gdk_device_get_n_keys (GdkDevice *device);
gint gdk_device_get_n_axes (GdkDevice *device);
/* Functions to configure a device */

View File

@ -198,6 +198,14 @@ gdk_device_get_axis_use (GdkDevice *device,
return device->axes[index].use;
}
gint
gdk_device_get_n_keys (GdkDevice *device)
{
g_return_val_if_fail (GDK_IS_DEVICE (device), 0);
return device->num_keys;
}
gint
gdk_device_get_n_axes (GdkDevice *device)
{

View File

@ -193,6 +193,14 @@ gdk_device_get_axis_use (GdkDevice *device,
return device->axes[index].use;
}
gint
gdk_device_get_n_keys (GdkDevice *device)
{
g_return_val_if_fail (GDK_IS_DEVICE (device), 0);
return device->num_keys;
}
gint
gdk_device_get_n_axes (GdkDevice *device)
{

View File

@ -317,6 +317,24 @@ gdk_device_get_axis_use (GdkDevice *device,
return device->axes[index].use;
}
/**
* gdk_device_get_n_keys:
* @device: a #GdkDevice.
*
* Gets the number of keys of a device.
*
* Returns: the number of keys of @device
*
* Since: 2.24
**/
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_n_axes:
* @device: a #GdkDevice.