device: Use a double for translate_axis() argument

While XI1 has axis data in events exposed as integers, XI2 uses double
precision floating point values.
This commit is contained in:
Emmanuele Bassi 2011-01-19 13:53:20 +00:00
parent f54044f7e4
commit 50e52f550a
2 changed files with 17 additions and 2 deletions

View File

@ -163,7 +163,7 @@ void _clutter_input_device_select_stage_events (ClutterInputDev
gboolean _clutter_input_device_translate_axis (ClutterInputDevice *device,
guint index_,
gint value,
gdouble value,
gdouble *axis_value);
G_END_DECLS

View File

@ -915,10 +915,25 @@ _clutter_input_device_add_axis (ClutterInputDevice *device,
return pos;
}
/*< private >
* clutter_input_translate_axis:
* @device: a #ClutterInputDevice
* @index_: the index of the axis
* @gint: the absolute value of the axis
* @axis_value: (out): the translated value of the axis
*
* Performs a conversion from the absolute value of the axis
* to a relative value.
*
* The axis at @index_ must not be %CLUTTER_INPUT_AXIS_X or
* %CLUTTER_INPUT_AXIS_Y.
*
* Return value: %TRUE if the conversion was successful
*/
gboolean
_clutter_input_device_translate_axis (ClutterInputDevice *device,
guint index_,
gint value,
gdouble value,
gdouble *axis_value)
{
ClutterAxisInfo *info;