Commit 12da0a6d authored by Matthias Clasen's avatar Matthias Clasen
Browse files

Drop gdk_device_get_position

Root coordinates are going away, so this
api does not make sense anymore. Use
gdk_surface_get_device_position instead.
We still keep this as internal api for
root-coordinate using backends.
parent b636e32d
......@@ -479,7 +479,6 @@ gdk_device_get_seat
<SUBSECTION>
gdk_device_get_state
gdk_device_get_position
gdk_device_get_surface_at_position
gdk_device_get_history
gdk_device_free_history
......
......@@ -528,24 +528,20 @@ gdk_device_get_state (GdkDevice *device,
GDK_DEVICE_GET_CLASS (device)->get_state (device, surface, axes, mask);
}
/**
/*
* gdk_device_get_position:
* @device: pointer device to query status about.
* @x: (out) (allow-none): location to store root window X coordinate of @device, or %NULL.
* @y: (out) (allow-none): location to store root window Y coordinate of @device, or %NULL.
* @x: (out): location to store root window X coordinate of @device
* @y: (out): location to store root window Y coordinate of @device
*
* Gets the current location of @device in double precision. As a slave device's
* coordinates are those of its master pointer, this function
* may not be called on devices of type %GDK_DEVICE_TYPE_SLAVE,
* unless there is an ongoing grab on them. See gdk_seat_grab().
**/
* Gets the current location of @device in double precision.
*/
void
gdk_device_get_position (GdkDevice *device,
double *x,
double *y)
{
GdkDisplay *display;
gdouble tmp_x, tmp_y;
g_return_if_fail (GDK_IS_DEVICE (device));
g_return_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD);
......@@ -555,16 +551,7 @@ gdk_device_get_position (GdkDevice *device,
g_return_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_SLAVE ||
gdk_display_device_is_grabbed (display, device));
_gdk_device_query_state (device,
NULL,
NULL,
&tmp_x, &tmp_y,
NULL, NULL, NULL);
if (x)
*x = tmp_x;
if (y)
*y = tmp_y;
_gdk_device_query_state (device, NULL, NULL, x, y, NULL, NULL, NULL);
}
/**
......
......@@ -167,10 +167,6 @@ void gdk_device_get_state (GdkDevice *device,
gdouble *axes,
GdkModifierType *mask);
GDK_AVAILABLE_IN_ALL
void gdk_device_get_position (GdkDevice *device,
double *x,
double *y);
GDK_AVAILABLE_IN_ALL
GdkSurface * gdk_device_get_surface_at_position (GdkDevice *device,
double *win_x,
double *win_y);
......
......@@ -245,6 +245,11 @@ GdkGrabStatus gdk_device_grab (GdkDevice *device,
guint32 time_);
void gdk_device_ungrab (GdkDevice *device,
guint32 time_);
void gdk_device_get_position (GdkDevice *device,
double *x,
double *y);
void gdk_surface_get_root_coords (GdkSurface *surface,
gint x,
gint y,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment