[mutter/gbsneto/graphene: 24/27] Replace ClutterPoint by graphene_point_t
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/gbsneto/graphene: 24/27] Replace ClutterPoint by graphene_point_t
- Date: Wed, 27 Feb 2019 10:23:24 +0000 (UTC)
commit f0349796f455b255af5aa8b48f313c09d5b8db76
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Wed Feb 20 11:53:44 2019 -0300
Replace ClutterPoint by graphene_point_t
https://gitlab.gnome.org/GNOME/mutter/merge_requests/458
clutter/clutter/clutter-actor-private.h | 4 +-
clutter/clutter/clutter-actor.c | 42 ++---
clutter/clutter/clutter-autocleanups.h | 1 -
clutter/clutter/clutter-base-types.c | 200 +--------------------
clutter/clutter/clutter-event.c | 38 ++--
clutter/clutter/clutter-event.h | 2 +-
clutter/clutter/clutter-graphene.c | 19 ++
clutter/clutter/clutter-input-device.c | 6 +-
clutter/clutter/clutter-input-device.h | 2 +-
clutter/clutter/clutter-script-parser.c | 22 +--
clutter/clutter/clutter-script-private.h | 2 +-
clutter/clutter/clutter-scroll-actor.c | 24 +--
clutter/clutter/clutter-scroll-actor.h | 4 +-
clutter/clutter/clutter-stage.c | 2 +-
clutter/clutter/clutter-test-utils.c | 18 +-
clutter/clutter/clutter-test-utils.h | 20 +--
clutter/clutter/clutter-timeline.c | 20 +--
clutter/clutter/clutter-timeline.h | 8 +-
clutter/clutter/clutter-types.h | 72 +-------
clutter/clutter/clutter-zoom-action.c | 18 +-
clutter/clutter/clutter-zoom-action.h | 6 +-
.../deprecated/clutter-input-device-deprecated.c | 2 +-
.../clutter/evdev/clutter-device-manager-evdev.c | 4 +-
clutter/clutter/evdev/clutter-seat-evdev.c | 2 +-
clutter/clutter/evdev/clutter-seat-evdev.h | 2 +-
clutter/tests/conform/actor-layout.c | 16 +-
clutter/tests/interactive/test-events.c | 2 +-
src/backends/meta-backend.c | 2 +-
src/backends/meta-cursor-renderer.c | 4 +-
src/backends/meta-cursor-renderer.h | 2 +-
src/backends/meta-cursor-tracker.c | 2 +-
src/backends/meta-screen-cast-monitor-stream-src.c | 4 +-
src/backends/meta-screen-cast-window-stream-src.c | 10 +-
src/backends/meta-screen-cast-window.c | 4 +-
src/backends/meta-screen-cast-window.h | 8 +-
src/backends/native/meta-backend-native.c | 2 +-
src/backends/native/meta-barrier-native.c | 2 +-
src/compositor/meta-dnd-actor.c | 2 +-
src/compositor/meta-feedback-actor.c | 2 +-
src/compositor/meta-window-actor.c | 4 +-
src/wayland/meta-pointer-confinement-wayland.c | 2 +-
src/wayland/meta-wayland-cursor-surface.c | 2 +-
src/wayland/meta-wayland-data-device.c | 2 +-
src/wayland/meta-wayland-pointer.c | 4 +-
src/wayland/meta-xwayland-selection.c | 6 +-
45 files changed, 194 insertions(+), 428 deletions(-)
---
diff --git a/clutter/clutter/clutter-actor-private.h b/clutter/clutter/clutter-actor-private.h
index 4314310d39..769e913680 100644
--- a/clutter/clutter/clutter-actor-private.h
+++ b/clutter/clutter/clutter-actor-private.h
@@ -161,7 +161,7 @@ struct _SizeRequest
struct _ClutterLayoutInfo
{
/* fixed position coordinates */
- ClutterPoint fixed_pos;
+ graphene_point_t fixed_pos;
ClutterMargin margin;
@@ -207,7 +207,7 @@ struct _ClutterTransformInfo
gfloat z_position;
/* transformation center */
- ClutterPoint pivot;
+ graphene_point_t pivot;
gfloat pivot_z;
CoglMatrix transform;
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
index bc7d141865..f3e45ed56d 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -4376,7 +4376,7 @@ static const ClutterTransformInfo default_transform_info = {
0.f, /* z-position */
- CLUTTER_POINT_INIT_ZERO, /* pivot */
+ GRAPHENE_POINT_INIT_ZERO, /* pivot */
0.f, /* pivot-z */
CLUTTER_MATRIX_INIT_IDENTITY,
@@ -4455,8 +4455,8 @@ _clutter_actor_get_transform_info (ClutterActor *self)
}
static inline void
-clutter_actor_set_pivot_point_internal (ClutterActor *self,
- const ClutterPoint *pivot)
+clutter_actor_set_pivot_point_internal (ClutterActor *self,
+ const graphene_point_t *pivot)
{
ClutterTransformInfo *info;
@@ -5033,7 +5033,7 @@ clutter_actor_set_property (GObject *object,
case PROP_POSITION:
{
- const ClutterPoint *pos = g_value_get_boxed (value);
+ const graphene_point_t *pos = g_value_get_boxed (value);
if (pos != NULL)
clutter_actor_set_position (actor, pos->x, pos->y);
@@ -5138,10 +5138,10 @@ clutter_actor_set_property (GObject *object,
case PROP_PIVOT_POINT:
{
- const ClutterPoint *pivot = g_value_get_boxed (value);
+ const graphene_point_t *pivot = g_value_get_boxed (value);
if (pivot == NULL)
- pivot = clutter_point_zero ();
+ pivot = graphene_point_zero ();
clutter_actor_set_pivot_point (actor, pivot->x, pivot->y);
}
@@ -5387,11 +5387,11 @@ clutter_actor_get_property (GObject *object,
case PROP_POSITION:
{
- ClutterPoint position;
+ graphene_point_t position;
- clutter_point_init (&position,
- clutter_actor_get_x (actor),
- clutter_actor_get_y (actor));
+ graphene_point_init (&position,
+ clutter_actor_get_x (actor),
+ clutter_actor_get_y (actor));
g_value_set_boxed (value, &position);
}
break;
@@ -6382,7 +6382,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
g_param_spec_boxed ("position",
P_("Position"),
P_("The position of the origin of the actor"),
- CLUTTER_TYPE_POINT,
+ GRAPHENE_TYPE_POINT,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS |
CLUTTER_PARAM_ANIMATABLE);
@@ -6937,7 +6937,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
g_param_spec_boxed ("pivot-point",
P_("Pivot Point"),
P_("The point around which the scaling and rotation occur"),
- CLUTTER_TYPE_POINT,
+ GRAPHENE_TYPE_POINT,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS |
CLUTTER_PARAM_ANIMATABLE);
@@ -10224,17 +10224,17 @@ clutter_actor_set_position (ClutterActor *self,
gfloat x,
gfloat y)
{
- ClutterPoint new_position;
- ClutterPoint cur_position;
+ graphene_point_t new_position;
+ graphene_point_t cur_position;
g_return_if_fail (CLUTTER_IS_ACTOR (self));
- clutter_point_init (&new_position, x, y);
+ graphene_point_init (&new_position, x, y);
cur_position.x = clutter_actor_get_x (self);
cur_position.y = clutter_actor_get_y (self);
- if (!clutter_point_equals (&cur_position, &new_position))
+ if (!graphene_point_equal (&cur_position, &new_position))
_clutter_actor_create_transition (self, obj_props[PROP_POSITION],
&cur_position,
&new_position);
@@ -11188,8 +11188,8 @@ clutter_actor_set_y_internal (ClutterActor *self,
}
static void
-clutter_actor_set_position_internal (ClutterActor *self,
- const ClutterPoint *position)
+clutter_actor_set_position_internal (ClutterActor *self,
+ const graphene_point_t *position)
{
ClutterActorPrivate *priv = self->priv;
ClutterLayoutInfo *linfo;
@@ -11198,7 +11198,7 @@ clutter_actor_set_position_internal (ClutterActor *self,
linfo = _clutter_actor_get_layout_info (self);
if (priv->position_set &&
- clutter_point_equals (position, &linfo->fixed_pos))
+ graphene_point_equal (position, &linfo->fixed_pos))
return;
clutter_actor_store_old_geometry (self, &old);
@@ -12017,7 +12017,7 @@ clutter_actor_set_pivot_point (ClutterActor *self,
gfloat pivot_x,
gfloat pivot_y)
{
- ClutterPoint pivot = CLUTTER_POINT_INIT (pivot_x, pivot_y);
+ graphene_point_t pivot = GRAPHENE_POINT_INIT (pivot_x, pivot_y);
const ClutterTransformInfo *info;
g_return_if_fail (CLUTTER_IS_ACTOR (self));
@@ -18079,7 +18079,7 @@ clutter_actor_get_layout_manager (ClutterActor *self)
}
static const ClutterLayoutInfo default_layout_info = {
- CLUTTER_POINT_INIT_ZERO, /* fixed-pos */
+ GRAPHENE_POINT_INIT_ZERO, /* fixed-pos */
{ 0, 0, 0, 0 }, /* margin */
CLUTTER_ACTOR_ALIGN_FILL, /* x-align */
CLUTTER_ACTOR_ALIGN_FILL, /* y-align */
diff --git a/clutter/clutter/clutter-autocleanups.h b/clutter/clutter/clutter-autocleanups.h
index 278e7158d8..808946a3a8 100644
--- a/clutter/clutter/clutter-autocleanups.h
+++ b/clutter/clutter/clutter-autocleanups.h
@@ -96,7 +96,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterMatrix, clutter_matrix_free)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPaintNode, clutter_paint_node_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPaintVolume, clutter_paint_volume_free)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPathNode, clutter_path_node_free)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPoint, clutter_point_free)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterRect, clutter_rect_free)
#endif /* __GI_SCANNER__ */
diff --git a/clutter/clutter/clutter-base-types.c b/clutter/clutter/clutter-base-types.c
index 0bb5ba5330..5871d81c36 100644
--- a/clutter/clutter/clutter-base-types.c
+++ b/clutter/clutter/clutter-base-types.c
@@ -212,194 +212,6 @@ G_DEFINE_BOXED_TYPE (ClutterMargin, clutter_margin,
-/*
- * ClutterPoint
- */
-
-static const ClutterPoint _clutter_point_zero = CLUTTER_POINT_INIT_ZERO;
-
-/**
- * clutter_point_zero:
- *
- * A point centered at (0, 0).
- *
- * The returned value can be used as a guard.
- *
- * Return value: a point centered in (0, 0); the returned #ClutterPoint
- * is owned by Clutter and it should not be modified or freed.
- *
- * Since: 1.12
- */
-const ClutterPoint *
-clutter_point_zero (void)
-{
- return &_clutter_point_zero;
-}
-
-/**
- * clutter_point_alloc: (constructor)
- *
- * Allocates a new #ClutterPoint.
- *
- * Return value: (transfer full): the newly allocated #ClutterPoint.
- * Use clutter_point_free() to free its resources.
- *
- * Since: 1.12
- */
-ClutterPoint *
-clutter_point_alloc (void)
-{
- return g_slice_new0 (ClutterPoint);
-}
-
-/**
- * clutter_point_init:
- * @point: a #ClutterPoint
- * @x: the X coordinate of the point
- * @y: the Y coordinate of the point
- *
- * Initializes @point with the given coordinates.
- *
- * Return value: (transfer none): the initialized #ClutterPoint
- *
- * Since: 1.12
- */
-ClutterPoint *
-clutter_point_init (ClutterPoint *point,
- float x,
- float y)
-{
- g_return_val_if_fail (point != NULL, NULL);
-
- point->x = x;
- point->y = y;
-
- return point;
-}
-
-/**
- * clutter_point_copy:
- * @point: a #ClutterPoint
- *
- * Creates a new #ClutterPoint with the same coordinates of @point.
- *
- * Return value: (transfer full): a newly allocated #ClutterPoint.
- * Use clutter_point_free() to free its resources.
- *
- * Since: 1.12
- */
-ClutterPoint *
-clutter_point_copy (const ClutterPoint *point)
-{
- return g_slice_dup (ClutterPoint, point);
-}
-
-/**
- * clutter_point_free:
- * @point: a #ClutterPoint
- *
- * Frees the resources allocated for @point.
- *
- * Since: 1.12
- */
-void
-clutter_point_free (ClutterPoint *point)
-{
- if (point != NULL && point != &_clutter_point_zero)
- g_slice_free (ClutterPoint, point);
-}
-
-/**
- * clutter_point_equals:
- * @a: the first #ClutterPoint to compare
- * @b: the second #ClutterPoint to compare
- *
- * Compares two #ClutterPoint for equality.
- *
- * Return value: %TRUE if the #ClutterPoints are equal
- *
- * Since: 1.12
- */
-gboolean
-clutter_point_equals (const ClutterPoint *a,
- const ClutterPoint *b)
-{
- if (a == b)
- return TRUE;
-
- if (a == NULL || b == NULL)
- return FALSE;
-
- return fabsf (a->x - b->x) < FLOAT_EPSILON &&
- fabsf (a->y - b->y) < FLOAT_EPSILON;
-}
-
-/**
- * clutter_point_distance:
- * @a: a #ClutterPoint
- * @b: a #ClutterPoint
- * @x_distance: (out) (allow-none): return location for the horizontal
- * distance between the points
- * @y_distance: (out) (allow-none): return location for the vertical
- * distance between the points
- *
- * Computes the distance between two #ClutterPoint.
- *
- * Return value: the distance between the points.
- *
- * Since: 1.12
- */
-float
-clutter_point_distance (const ClutterPoint *a,
- const ClutterPoint *b,
- float *x_distance,
- float *y_distance)
-{
- float x_d, y_d;
-
- g_return_val_if_fail (a != NULL, 0.f);
- g_return_val_if_fail (b != NULL, 0.f);
-
- if (clutter_point_equals (a, b))
- return 0.f;
-
- x_d = (a->x - b->x);
- y_d = (a->y - b->y);
-
- if (x_distance != NULL)
- *x_distance = fabsf (x_d);
-
- if (y_distance != NULL)
- *y_distance = fabsf (y_d);
-
- return sqrt ((x_d * x_d) + (y_d * y_d));
-}
-
-static gboolean
-clutter_point_progress (const GValue *a,
- const GValue *b,
- gdouble progress,
- GValue *retval)
-{
- const ClutterPoint *ap = g_value_get_boxed (a);
- const ClutterPoint *bp = g_value_get_boxed (b);
- ClutterPoint res = CLUTTER_POINT_INIT (0, 0);
-
- res.x = ap->x + (bp->x - ap->x) * progress;
- res.y = ap->y + (bp->y - ap->y) * progress;
-
- g_value_set_boxed (retval, &res);
-
- return TRUE;
-}
-
-G_DEFINE_BOXED_TYPE_WITH_CODE (ClutterPoint, clutter_point,
- clutter_point_copy,
- clutter_point_free,
- CLUTTER_REGISTER_INTERVAL_PROGRESS (clutter_point_progress))
-
-
-
/*
* ClutterRect
*/
@@ -583,7 +395,7 @@ clutter_rect_equals (ClutterRect *a,
clutter_rect_normalize_internal (a);
clutter_rect_normalize_internal (b);
- return clutter_point_equals (&a->origin, &b->origin) &&
+ return graphene_point_equal (&a->origin, &b->origin) &&
graphene_size_equal (&a->size, &b->size);
}
@@ -616,7 +428,7 @@ clutter_rect_normalize (ClutterRect *rect)
/**
* clutter_rect_get_center:
* @rect: a #ClutterRect
- * @center: (out caller-allocates): a #ClutterPoint
+ * @center: (out caller-allocates): a #graphene_point_t
*
* Retrieves the center of @rect, after normalizing the rectangle,
* and updates @center with the correct coordinates.
@@ -624,8 +436,8 @@ clutter_rect_normalize (ClutterRect *rect)
* Since: 1.12
*/
void
-clutter_rect_get_center (ClutterRect *rect,
- ClutterPoint *center)
+clutter_rect_get_center (ClutterRect *rect,
+ graphene_point_t *center)
{
g_return_if_fail (rect != NULL);
g_return_if_fail (center != NULL);
@@ -649,8 +461,8 @@ clutter_rect_get_center (ClutterRect *rect,
* Since: 1.12
*/
gboolean
-clutter_rect_contains_point (ClutterRect *rect,
- ClutterPoint *point)
+clutter_rect_contains_point (ClutterRect *rect,
+ graphene_point_t *point)
{
g_return_val_if_fail (rect != NULL, FALSE);
g_return_val_if_fail (point != NULL, FALSE);
diff --git a/clutter/clutter/clutter-event.c b/clutter/clutter/clutter-event.c
index 8e7782df39..86d0f9c036 100644
--- a/clutter/clutter/clutter-event.c
+++ b/clutter/clutter/clutter-event.c
@@ -370,7 +370,7 @@ clutter_event_get_coords (const ClutterEvent *event,
gfloat *x,
gfloat *y)
{
- ClutterPoint coords;
+ graphene_point_t coords;
g_return_if_fail (event != NULL);
@@ -386,15 +386,15 @@ clutter_event_get_coords (const ClutterEvent *event,
/**
* clutter_event_get_position:
* @event: a #ClutterEvent
- * @position: a #ClutterPoint
+ * @position: a #graphene_point_t
*
- * Retrieves the event coordinates as a #ClutterPoint.
+ * Retrieves the event coordinates as a #graphene_point_t.
*
* Since: 1.12
*/
void
clutter_event_get_position (const ClutterEvent *event,
- ClutterPoint *position)
+ graphene_point_t *position)
{
g_return_if_fail (event != NULL);
g_return_if_fail (position != NULL);
@@ -415,42 +415,42 @@ clutter_event_get_position (const ClutterEvent *event,
case CLUTTER_PAD_BUTTON_RELEASE:
case CLUTTER_PAD_STRIP:
case CLUTTER_PAD_RING:
- clutter_point_init (position, 0.f, 0.f);
+ graphene_point_init (position, 0.f, 0.f);
break;
case CLUTTER_ENTER:
case CLUTTER_LEAVE:
- clutter_point_init (position, event->crossing.x, event->crossing.y);
+ graphene_point_init (position, event->crossing.x, event->crossing.y);
break;
case CLUTTER_BUTTON_PRESS:
case CLUTTER_BUTTON_RELEASE:
- clutter_point_init (position, event->button.x, event->button.y);
+ graphene_point_init (position, event->button.x, event->button.y);
break;
case CLUTTER_MOTION:
- clutter_point_init (position, event->motion.x, event->motion.y);
+ graphene_point_init (position, event->motion.x, event->motion.y);
break;
case CLUTTER_TOUCH_BEGIN:
case CLUTTER_TOUCH_UPDATE:
case CLUTTER_TOUCH_END:
case CLUTTER_TOUCH_CANCEL:
- clutter_point_init (position, event->touch.x, event->touch.y);
+ graphene_point_init (position, event->touch.x, event->touch.y);
break;
case CLUTTER_SCROLL:
- clutter_point_init (position, event->scroll.x, event->scroll.y);
+ graphene_point_init (position, event->scroll.x, event->scroll.y);
break;
case CLUTTER_TOUCHPAD_PINCH:
- clutter_point_init (position, event->touchpad_pinch.x,
- event->touchpad_pinch.y);
+ graphene_point_init (position, event->touchpad_pinch.x,
+ event->touchpad_pinch.y);
break;
case CLUTTER_TOUCHPAD_SWIPE:
- clutter_point_init (position, event->touchpad_swipe.x,
- event->touchpad_swipe.y);
+ graphene_point_init (position, event->touchpad_swipe.x,
+ event->touchpad_swipe.y);
break;
}
@@ -1793,12 +1793,12 @@ float
clutter_event_get_distance (const ClutterEvent *source,
const ClutterEvent *target)
{
- ClutterPoint p0, p1;
+ graphene_point_t p0, p1;
clutter_event_get_position (source, &p0);
clutter_event_get_position (source, &p1);
- return clutter_point_distance (&p0, &p1, NULL, NULL);
+ return graphene_point_distance (&p0, &p1, NULL, NULL);
}
/**
@@ -1819,17 +1819,17 @@ double
clutter_event_get_angle (const ClutterEvent *source,
const ClutterEvent *target)
{
- ClutterPoint p0, p1;
+ graphene_point_t p0, p1;
float x_distance, y_distance;
double angle;
clutter_event_get_position (source, &p0);
clutter_event_get_position (target, &p1);
- if (clutter_point_equals (&p0, &p1))
+ if (graphene_point_equal (&p0, &p1))
return 0;
- clutter_point_distance (&p0, &p1, &x_distance, &y_distance);
+ graphene_point_distance (&p0, &p1, &x_distance, &y_distance);
angle = atan2 (x_distance, y_distance);
diff --git a/clutter/clutter/clutter-event.h b/clutter/clutter/clutter-event.h
index 15596d909c..28a820000b 100644
--- a/clutter/clutter/clutter-event.h
+++ b/clutter/clutter/clutter-event.h
@@ -685,7 +685,7 @@ void clutter_event_get_coords (const ClutterEv
gfloat *y);
CLUTTER_EXPORT
void clutter_event_get_position (const ClutterEvent *event,
- ClutterPoint *position);
+ graphene_point_t *position);
CLUTTER_EXPORT
float clutter_event_get_distance (const ClutterEvent *source,
const ClutterEvent *target);
diff --git a/clutter/clutter/clutter-graphene.c b/clutter/clutter/clutter-graphene.c
index 590e320ed5..68aeb0c1a7 100644
--- a/clutter/clutter/clutter-graphene.c
+++ b/clutter/clutter/clutter-graphene.c
@@ -26,6 +26,23 @@
#include "clutter-private.h"
#include "clutter-types.h"
+static gboolean
+graphene_point_progress (const GValue *a,
+ const GValue *b,
+ gdouble progress,
+ GValue *retval)
+{
+ const graphene_point_t *ap = g_value_get_boxed (a);
+ const graphene_point_t *bp = g_value_get_boxed (b);
+ graphene_point_t res;
+
+ graphene_point_interpolate (ap, bp, progress, &res);
+
+ g_value_set_boxed (retval, &res);
+
+ return TRUE;
+}
+
static gboolean
graphene_point3d_progress (const GValue *a,
const GValue *b,
@@ -63,6 +80,8 @@ graphene_size_progress (const GValue *a,
void
clutter_graphene_init (void)
{
+ clutter_interval_register_progress_func (GRAPHENE_TYPE_POINT,
+ graphene_point_progress);
clutter_interval_register_progress_func (GRAPHENE_TYPE_POINT3D,
graphene_point3d_progress);
clutter_interval_register_progress_func (GRAPHENE_TYPE_SIZE,
diff --git a/clutter/clutter/clutter-input-device.c b/clutter/clutter/clutter-input-device.c
index 5de169c11d..9a45586a69 100644
--- a/clutter/clutter/clutter-input-device.c
+++ b/clutter/clutter/clutter-input-device.c
@@ -986,7 +986,7 @@ clutter_input_device_get_enabled (ClutterInputDevice *device)
gboolean
clutter_input_device_get_coords (ClutterInputDevice *device,
ClutterEventSequence *sequence,
- ClutterPoint *point)
+ graphene_point_t *point)
{
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), FALSE);
g_return_val_if_fail (point != NULL, FALSE);
@@ -1033,7 +1033,9 @@ _clutter_input_device_update (ClutterInputDevice *device,
ClutterStage *stage;
ClutterActor *new_cursor_actor;
ClutterActor *old_cursor_actor;
- ClutterPoint point = { -1, -1 };
+ graphene_point_t point;
+
+ point = GRAPHENE_POINT_INIT (-1.0f, -1.0f);
if (device->device_type == CLUTTER_KEYBOARD_DEVICE)
return NULL;
diff --git a/clutter/clutter/clutter-input-device.h b/clutter/clutter/clutter-input-device.h
index 8dd2a54b9c..8eaa8643a5 100644
--- a/clutter/clutter/clutter-input-device.h
+++ b/clutter/clutter/clutter-input-device.h
@@ -58,7 +58,7 @@ gint clutter_input_device_get_device_id (ClutterInputDev
CLUTTER_EXPORT
gboolean clutter_input_device_get_coords (ClutterInputDevice *device,
ClutterEventSequence *sequence,
- ClutterPoint *point);
+ graphene_point_t *point);
CLUTTER_EXPORT
ClutterModifierType clutter_input_device_get_modifier_state (ClutterInputDevice *device);
CLUTTER_EXPORT
diff --git a/clutter/clutter/clutter-script-parser.c b/clutter/clutter/clutter-script-parser.c
index 8e9ac9639e..e6a1207933 100644
--- a/clutter/clutter/clutter-script-parser.c
+++ b/clutter/clutter/clutter-script-parser.c
@@ -492,8 +492,8 @@ _clutter_script_parse_color (ClutterScript *script,
}
static gboolean
-parse_point_from_array (JsonArray *array,
- ClutterPoint *point)
+parse_point_from_array (JsonArray *array,
+ graphene_point_t *point)
{
if (json_array_get_length (array) != 2)
return FALSE;
@@ -505,8 +505,8 @@ parse_point_from_array (JsonArray *array,
}
static gboolean
-parse_point_from_object (JsonObject *object,
- ClutterPoint *point)
+parse_point_from_object (JsonObject *object,
+ graphene_point_t *point)
{
if (json_object_has_member (object, "x"))
point->x = json_object_get_double_member (object, "x");
@@ -522,9 +522,9 @@ parse_point_from_object (JsonObject *object,
}
gboolean
-_clutter_script_parse_point (ClutterScript *script,
- JsonNode *node,
- ClutterPoint *point)
+_clutter_script_parse_point (ClutterScript *script,
+ JsonNode *node,
+ graphene_point_t *point)
{
g_return_val_if_fail (CLUTTER_IS_SCRIPT (script), FALSE);
g_return_val_if_fail (node != NULL, FALSE);
@@ -1364,9 +1364,9 @@ _clutter_script_parse_node (ClutterScript *script,
return TRUE;
}
}
- else if (p_type == CLUTTER_TYPE_POINT)
+ else if (p_type == GRAPHENE_TYPE_POINT)
{
- ClutterPoint point = CLUTTER_POINT_INIT_ZERO;
+ graphene_point_t point = GRAPHENE_POINT_INIT_ZERO;
if (_clutter_script_parse_point (script, node, &point))
{
@@ -1441,9 +1441,9 @@ _clutter_script_parse_node (ClutterScript *script,
return TRUE;
}
}
- else if (G_VALUE_HOLDS (value, CLUTTER_TYPE_POINT))
+ else if (G_VALUE_HOLDS (value, GRAPHENE_TYPE_POINT))
{
- ClutterPoint point = CLUTTER_POINT_INIT_ZERO;
+ graphene_point_t point = GRAPHENE_POINT_INIT_ZERO;
if (_clutter_script_parse_point (script, node, &point))
{
diff --git a/clutter/clutter/clutter-script-private.h b/clutter/clutter/clutter-script-private.h
index 61276d359a..debdd3b629 100644
--- a/clutter/clutter/clutter-script-private.h
+++ b/clutter/clutter/clutter-script-private.h
@@ -132,7 +132,7 @@ GObject *_clutter_script_parse_alpha (ClutterScript *script,
JsonNode *node);
gboolean _clutter_script_parse_point (ClutterScript *script,
JsonNode *node,
- ClutterPoint *point);
+ graphene_point_t *point);
gboolean _clutter_script_parse_size (ClutterScript *script,
JsonNode *node,
graphene_size_t *size);
diff --git a/clutter/clutter/clutter-scroll-actor.c b/clutter/clutter/clutter-scroll-actor.c
index 8d76a0f4c8..5cefb1f938 100644
--- a/clutter/clutter/clutter-scroll-actor.c
+++ b/clutter/clutter/clutter-scroll-actor.c
@@ -56,7 +56,7 @@
struct _ClutterScrollActorPrivate
{
- ClutterPoint scroll_to;
+ graphene_point_t scroll_to;
ClutterScrollMode scroll_mode;
@@ -94,19 +94,19 @@ G_DEFINE_TYPE_WITH_CODE (ClutterScrollActor, clutter_scroll_actor, CLUTTER_TYPE_
clutter_animatable_iface_init))
static void
-clutter_scroll_actor_set_scroll_to_internal (ClutterScrollActor *self,
- const ClutterPoint *point)
+clutter_scroll_actor_set_scroll_to_internal (ClutterScrollActor *self,
+ const graphene_point_t *point)
{
ClutterScrollActorPrivate *priv = self->priv;
ClutterActor *actor = CLUTTER_ACTOR (self);
ClutterMatrix m = CLUTTER_MATRIX_INIT_IDENTITY;
float dx, dy;
- if (clutter_point_equals (&priv->scroll_to, point))
+ if (graphene_point_equal (&priv->scroll_to, point))
return;
if (point == NULL)
- clutter_point_init (&priv->scroll_to, 0.f, 0.f);
+ graphene_point_init (&priv->scroll_to, 0.f, 0.f);
else
priv->scroll_to = *point;
@@ -216,7 +216,7 @@ clutter_scroll_actor_set_final_state (ClutterAnimatable *animatable,
if (strcmp (property_name, "scroll-to") == 0)
{
ClutterScrollActor *self = CLUTTER_SCROLL_ACTOR (animatable);
- const ClutterPoint *point = g_value_get_boxed (value);
+ const graphene_point_t *point = g_value_get_boxed (value);
clutter_scroll_actor_set_scroll_to_internal (self, point);
}
@@ -248,7 +248,7 @@ clutter_animatable_iface_init (ClutterAnimatableIface *iface)
g_param_spec_boxed ("scroll-to",
"Scroll To",
"The point to scroll the actor to",
- CLUTTER_TYPE_POINT,
+ GRAPHENE_TYPE_POINT,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS |
CLUTTER_PARAM_ANIMATABLE);
@@ -322,7 +322,7 @@ clutter_scroll_actor_get_scroll_mode (ClutterScrollActor *actor)
/**
* clutter_scroll_actor_scroll_to_point:
* @actor: a #ClutterScrollActor
- * @point: a #ClutterPoint
+ * @point: a #graphene_point_t
*
* Scrolls the contents of @actor so that @point is the new origin
* of the visible area.
@@ -335,8 +335,8 @@ clutter_scroll_actor_get_scroll_mode (ClutterScrollActor *actor)
* Since: 1.12
*/
void
-clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
- const ClutterPoint *point)
+clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
+ const graphene_point_t *point)
{
ClutterScrollActorPrivate *priv;
const ClutterAnimationInfo *info;
@@ -390,10 +390,10 @@ clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
/* if a transition already exist, update its bounds */
clutter_transition_set_from (priv->transition,
- CLUTTER_TYPE_POINT,
+ GRAPHENE_TYPE_POINT,
&priv->scroll_to);
clutter_transition_set_to (priv->transition,
- CLUTTER_TYPE_POINT,
+ GRAPHENE_TYPE_POINT,
point);
/* always use the current easing state */
diff --git a/clutter/clutter/clutter-scroll-actor.h b/clutter/clutter/clutter-scroll-actor.h
index f2eada11c7..4a41714959 100644
--- a/clutter/clutter/clutter-scroll-actor.h
+++ b/clutter/clutter/clutter-scroll-actor.h
@@ -86,8 +86,8 @@ CLUTTER_EXPORT
ClutterScrollMode clutter_scroll_actor_get_scroll_mode (ClutterScrollActor *actor);
CLUTTER_EXPORT
-void clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
- const ClutterPoint *point);
+void clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
+ const graphene_point_t *point);
CLUTTER_EXPORT
void clutter_scroll_actor_scroll_to_rect (ClutterScrollActor *actor,
const ClutterRect *rect);
diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c
index 96f98589f8..58582c5510 100644
--- a/clutter/clutter/clutter-stage.c
+++ b/clutter/clutter/clutter-stage.c
@@ -1157,7 +1157,7 @@ _clutter_stage_check_updated_pointers (ClutterStage *stage)
GSList *updating = NULL;
const GSList *devices;
cairo_rectangle_int_t clip;
- ClutterPoint point;
+ graphene_point_t point;
gboolean has_clip;
has_clip = _clutter_stage_window_get_redraw_clip_bounds (priv->impl, &clip);
diff --git a/clutter/clutter/clutter-test-utils.c b/clutter/clutter/clutter-test-utils.c
index edc413e96c..8cfaadbcb4 100644
--- a/clutter/clutter/clutter-test-utils.c
+++ b/clutter/clutter/clutter-test-utils.c
@@ -273,7 +273,7 @@ clutter_test_run (void)
typedef struct {
ClutterActor *stage;
- ClutterPoint point;
+ graphene_point_t point;
gpointer result;
@@ -348,10 +348,10 @@ on_key_press_event (ClutterActor *stage,
* Since: 1.18
*/
gboolean
-clutter_test_check_actor_at_point (ClutterActor *stage,
- const ClutterPoint *point,
- ClutterActor *actor,
- ClutterActor **result)
+clutter_test_check_actor_at_point (ClutterActor *stage,
+ const graphene_point_t *point,
+ ClutterActor *actor,
+ ClutterActor **result)
{
ValidateData *data;
guint press_id = 0;
@@ -410,10 +410,10 @@ clutter_test_check_actor_at_point (ClutterActor *stage,
* Since: 1.18
*/
gboolean
-clutter_test_check_color_at_point (ClutterActor *stage,
- const ClutterPoint *point,
- const ClutterColor *color,
- ClutterColor *result)
+clutter_test_check_color_at_point (ClutterActor *stage,
+ const graphene_point_t *point,
+ const ClutterColor *color,
+ ClutterColor *result)
{
ValidateData *data;
gboolean retval;
diff --git a/clutter/clutter/clutter-test-utils.h b/clutter/clutter/clutter-test-utils.h
index 6078533c2c..51f826a9f2 100644
--- a/clutter/clutter/clutter-test-utils.h
+++ b/clutter/clutter/clutter-test-utils.h
@@ -112,7 +112,7 @@ ClutterActor * clutter_test_get_stage (void);
#define clutter_test_assert_actor_at_point(stage,point,actor) \
G_STMT_START { \
- const ClutterPoint *__p = (point); \
+ const graphene_point_t *__p = (point); \
ClutterActor *__actor = (actor); \
ClutterActor *__stage = (stage); \
ClutterActor *__res; \
@@ -132,7 +132,7 @@ G_STMT_START { \
#define clutter_test_assert_color_at_point(stage,point,color) \
G_STMT_START { \
- const ClutterPoint *__p = (point); \
+ const graphene_point_t *__p = (point); \
const ClutterColor *__c = (color); \
ClutterActor *__stage = (stage); \
ClutterColor __res; \
@@ -149,15 +149,15 @@ G_STMT_START { \
} G_STMT_END
CLUTTER_EXPORT
-gboolean clutter_test_check_actor_at_point (ClutterActor *stage,
- const ClutterPoint *point,
- ClutterActor *actor,
- ClutterActor **result);
+gboolean clutter_test_check_actor_at_point (ClutterActor *stage,
+ const graphene_point_t *point,
+ ClutterActor *actor,
+ ClutterActor **result);
CLUTTER_EXPORT
-gboolean clutter_test_check_color_at_point (ClutterActor *stage,
- const ClutterPoint *point,
- const ClutterColor *color,
- ClutterColor *result);
+gboolean clutter_test_check_color_at_point (ClutterActor *stage,
+ const graphene_point_t *point,
+ const ClutterColor *color,
+ ClutterColor *result);
G_END_DECLS
diff --git a/clutter/clutter/clutter-timeline.c b/clutter/clutter/clutter-timeline.c
index c2efdd117c..23fd221845 100644
--- a/clutter/clutter/clutter-timeline.c
+++ b/clutter/clutter/clutter-timeline.c
@@ -145,8 +145,8 @@ struct _ClutterTimelinePrivate
ClutterStepMode step_mode;
/* cubic-bezier() parameters */
- ClutterPoint cb_1;
- ClutterPoint cb_2;
+ graphene_point_t cb_1;
+ graphene_point_t cb_2;
guint is_playing : 1;
@@ -850,8 +850,8 @@ clutter_timeline_init (ClutterTimeline *self)
self->priv->step_mode = CLUTTER_STEP_MODE_END;
/* default cubic-bezier() paramereters are (0, 0, 1, 1) */
- clutter_point_init (&self->priv->cb_1, 0, 0);
- clutter_point_init (&self->priv->cb_2, 1, 1);
+ graphene_point_init (&self->priv->cb_1, 0, 0);
+ graphene_point_init (&self->priv->cb_2, 1, 1);
}
struct CheckIfMarkerHitClosure
@@ -2493,9 +2493,9 @@ clutter_timeline_get_step_progress (ClutterTimeline *timeline,
* Since: 1.12
*/
void
-clutter_timeline_set_cubic_bezier_progress (ClutterTimeline *timeline,
- const ClutterPoint *c_1,
- const ClutterPoint *c_2)
+clutter_timeline_set_cubic_bezier_progress (ClutterTimeline *timeline,
+ const graphene_point_t *c_1,
+ const graphene_point_t *c_2)
{
ClutterTimelinePrivate *priv;
@@ -2530,9 +2530,9 @@ clutter_timeline_set_cubic_bezier_progress (ClutterTimeline *timeline,
* Since: 1.12
*/
gboolean
-clutter_timeline_get_cubic_bezier_progress (ClutterTimeline *timeline,
- ClutterPoint *c_1,
- ClutterPoint *c_2)
+clutter_timeline_get_cubic_bezier_progress (ClutterTimeline *timeline,
+ graphene_point_t *c_1,
+ graphene_point_t *c_2)
{
g_return_val_if_fail (CLUTTER_IS_TIMELINE (timeline), FALSE);
diff --git a/clutter/clutter/clutter-timeline.h b/clutter/clutter/clutter-timeline.h
index 036f555f09..726026f691 100644
--- a/clutter/clutter/clutter-timeline.h
+++ b/clutter/clutter/clutter-timeline.h
@@ -209,12 +209,12 @@ gboolean clutter_timeline_get_step_progress
ClutterStepMode
*step_mode);
CLUTTER_EXPORT
void clutter_timeline_set_cubic_bezier_progress (ClutterTimeline
*timeline,
- const ClutterPoint
*c_1,
- const ClutterPoint
*c_2);
+ const graphene_point_t
*c_1,
+ const graphene_point_t
*c_2);
CLUTTER_EXPORT
gboolean clutter_timeline_get_cubic_bezier_progress (ClutterTimeline
*timeline,
- ClutterPoint
*c_1,
- ClutterPoint
*c_2);
+ graphene_point_t
*c_1,
+ graphene_point_t
*c_2);
CLUTTER_EXPORT
gint64 clutter_timeline_get_duration_hint (ClutterTimeline
*timeline);
diff --git a/clutter/clutter/clutter-types.h b/clutter/clutter/clutter-types.h
index 4238fa77e4..b3f03f0a3d 100644
--- a/clutter/clutter/clutter-types.h
+++ b/clutter/clutter/clutter-types.h
@@ -44,7 +44,6 @@ G_BEGIN_DECLS
#define CLUTTER_TYPE_MATRIX (clutter_matrix_get_type ())
#define CLUTTER_TYPE_PAINT_VOLUME (clutter_paint_volume_get_type ())
#define CLUTTER_TYPE_PERSPECTIVE (clutter_perspective_get_type ())
-#define CLUTTER_TYPE_POINT (clutter_point_get_type ())
#define CLUTTER_TYPE_RECT (clutter_rect_get_type ())
typedef struct _ClutterActor ClutterActor;
@@ -82,7 +81,6 @@ typedef struct _ClutterGeometry ClutterGeometry; /* XXX:2.0 - re
typedef struct _ClutterKnot ClutterKnot;
typedef struct _ClutterMargin ClutterMargin;
typedef struct _ClutterPerspective ClutterPerspective;
-typedef struct _ClutterPoint ClutterPoint;
typedef struct _ClutterRect ClutterRect;
typedef struct _ClutterAlpha ClutterAlpha;
@@ -133,70 +131,6 @@ typedef struct _ClutterShader ClutterShader; /* deprecated */
*/
typedef struct _ClutterPaintVolume ClutterPaintVolume;
-/**
- * ClutterPoint:
- * @x: X coordinate, in pixels
- * @y: Y coordinate, in pixels
- *
- * A point in 2D space.
- *
- * Since: 1.12
- */
-struct _ClutterPoint
-{
- float x;
- float y;
-};
-
-/**
- * CLUTTER_POINT_INIT:
- * @x: X coordinate
- * @y: Y coordinate
- *
- * A simple macro for initializing a #ClutterPoint when declaring it, e.g.:
- *
- * |[
- * ClutterPoint p = CLUTTER_POINT_INIT (100, 100);
- * ]|
- *
- * Since: 1.12
- */
-#define CLUTTER_POINT_INIT(x,y) { (x), (y) }
-
-/**
- * CLUTTER_POINT_INIT_ZERO:
- *
- * A simple macro for initializing a #ClutterPoint to (0, 0) when
- * declaring it.
- *
- * Since: 1.12
- */
-#define CLUTTER_POINT_INIT_ZERO CLUTTER_POINT_INIT (0.f, 0.f)
-
-CLUTTER_EXPORT
-GType clutter_point_get_type (void) G_GNUC_CONST;
-
-CLUTTER_EXPORT
-const ClutterPoint * clutter_point_zero (void);
-CLUTTER_EXPORT
-ClutterPoint * clutter_point_alloc (void);
-CLUTTER_EXPORT
-ClutterPoint * clutter_point_init (ClutterPoint *point,
- float x,
- float y);
-CLUTTER_EXPORT
-ClutterPoint * clutter_point_copy (const ClutterPoint *point);
-CLUTTER_EXPORT
-void clutter_point_free (ClutterPoint *point);
-CLUTTER_EXPORT
-gboolean clutter_point_equals (const ClutterPoint *a,
- const ClutterPoint *b);
-CLUTTER_EXPORT
-float clutter_point_distance (const ClutterPoint *a,
- const ClutterPoint *b,
- float *x_distance,
- float *y_distance);
-
/**
* ClutterRect:
* @origin: the origin of the rectangle
@@ -220,7 +154,7 @@ float clutter_point_distance (const ClutterPoint *a,
*/
struct _ClutterRect
{
- ClutterPoint origin;
+ graphene_point_t origin;
graphene_size_t size;
};
@@ -276,10 +210,10 @@ CLUTTER_EXPORT
ClutterRect * clutter_rect_normalize (ClutterRect *rect);
CLUTTER_EXPORT
void clutter_rect_get_center (ClutterRect *rect,
- ClutterPoint *center);
+ graphene_point_t *center);
CLUTTER_EXPORT
gboolean clutter_rect_contains_point (ClutterRect *rect,
- ClutterPoint *point);
+ graphene_point_t *point);
CLUTTER_EXPORT
gboolean clutter_rect_contains_rect (ClutterRect *a,
ClutterRect *b);
diff --git a/clutter/clutter/clutter-zoom-action.c b/clutter/clutter/clutter-zoom-action.c
index 67a3d12bd0..c25b796889 100644
--- a/clutter/clutter/clutter-zoom-action.c
+++ b/clutter/clutter/clutter-zoom-action.c
@@ -80,9 +80,9 @@ struct _ClutterZoomActionPrivate
ZoomPoint points[2];
- ClutterPoint initial_focal_point;
- ClutterPoint focal_point;
- ClutterPoint transformed_focal_point;
+ graphene_point_t initial_focal_point;
+ graphene_point_t focal_point;
+ graphene_point_t transformed_focal_point;
gfloat initial_x;
gfloat initial_y;
@@ -238,7 +238,7 @@ clutter_zoom_action_gesture_cancel (ClutterGestureAction *action,
static gboolean
clutter_zoom_action_real_zoom (ClutterZoomAction *action,
ClutterActor *actor,
- ClutterPoint *focal_point,
+ graphene_point_t *focal_point,
gdouble factor)
{
ClutterZoomActionPrivate *priv = action->priv;
@@ -400,7 +400,7 @@ clutter_zoom_action_class_init (ClutterZoomActionClass *klass)
_clutter_marshal_BOOLEAN__OBJECT_BOXED_DOUBLE,
G_TYPE_BOOLEAN, 3,
CLUTTER_TYPE_ACTOR,
- CLUTTER_TYPE_POINT,
+ GRAPHENE_TYPE_POINT,
G_TYPE_DOUBLE);
}
@@ -478,7 +478,7 @@ clutter_zoom_action_get_zoom_axis (ClutterZoomAction *action)
/**
* clutter_zoom_action_get_focal_point:
* @action: a #ClutterZoomAction
- * @point: (out): a #ClutterPoint
+ * @point: (out): a #graphene_point_t
*
* Retrieves the focal point of the current zoom
*
@@ -486,7 +486,7 @@ clutter_zoom_action_get_zoom_axis (ClutterZoomAction *action)
*/
void
clutter_zoom_action_get_focal_point (ClutterZoomAction *action,
- ClutterPoint *point)
+ graphene_point_t *point)
{
g_return_if_fail (CLUTTER_IS_ZOOM_ACTION (action));
g_return_if_fail (point != NULL);
@@ -497,7 +497,7 @@ clutter_zoom_action_get_focal_point (ClutterZoomAction *action,
/**
* clutter_zoom_action_get_transformed_focal_point:
* @action: a #ClutterZoomAction
- * @point: (out): a #ClutterPoint
+ * @point: (out): a #graphene_point_t
*
* Retrieves the focal point relative to the actor's coordinates of
* the current zoom
@@ -506,7 +506,7 @@ clutter_zoom_action_get_focal_point (ClutterZoomAction *action,
*/
void
clutter_zoom_action_get_transformed_focal_point (ClutterZoomAction *action,
- ClutterPoint *point)
+ graphene_point_t *point)
{
g_return_if_fail (CLUTTER_IS_ZOOM_ACTION (action));
g_return_if_fail (point != NULL);
diff --git a/clutter/clutter/clutter-zoom-action.h b/clutter/clutter/clutter-zoom-action.h
index 2a4601684b..f1f7e572d9 100644
--- a/clutter/clutter/clutter-zoom-action.h
+++ b/clutter/clutter/clutter-zoom-action.h
@@ -79,7 +79,7 @@ struct _ClutterZoomActionClass
/*< public >*/
gboolean (* zoom) (ClutterZoomAction *action,
ClutterActor *actor,
- ClutterPoint *focal_point,
+ graphene_point_t *focal_point,
gdouble factor);
/*< private >*/
@@ -104,10 +104,10 @@ ClutterZoomAxis clutter_zoom_action_get_zoom_axis (ClutterZoomActi
CLUTTER_EXPORT
void clutter_zoom_action_get_focal_point (ClutterZoomAction *action,
- ClutterPoint *point);
+ graphene_point_t *point);
CLUTTER_EXPORT
void clutter_zoom_action_get_transformed_focal_point (ClutterZoomAction *action,
- ClutterPoint *point);
+ graphene_point_t *point);
G_END_DECLS
diff --git a/clutter/clutter/deprecated/clutter-input-device-deprecated.c
b/clutter/clutter/deprecated/clutter-input-device-deprecated.c
index 8df5cf598a..0ba18e3413 100644
--- a/clutter/clutter/deprecated/clutter-input-device-deprecated.c
+++ b/clutter/clutter/deprecated/clutter-input-device-deprecated.c
@@ -24,7 +24,7 @@ clutter_input_device_get_device_coords (ClutterInputDevice *device,
gint *x,
gint *y)
{
- ClutterPoint point;
+ graphene_point_t point;
clutter_input_device_get_coords (device, NULL, &point);
diff --git a/clutter/clutter/evdev/clutter-device-manager-evdev.c
b/clutter/clutter/evdev/clutter-device-manager-evdev.c
index 84b0aad490..bae4164831 100644
--- a/clutter/clutter/evdev/clutter-device-manager-evdev.c
+++ b/clutter/clutter/evdev/clutter-device-manager-evdev.c
@@ -405,7 +405,7 @@ notify_pinch_gesture_event (ClutterInputDevice *input_device,
ClutterSeatEvdev *seat;
ClutterStage *stage;
ClutterEvent *event = NULL;
- ClutterPoint pos;
+ graphene_point_t pos;
/* We can drop the event on the floor if no stage has been
* associated with the device yet. */
@@ -452,7 +452,7 @@ notify_swipe_gesture_event (ClutterInputDevice *input_device,
ClutterSeatEvdev *seat;
ClutterStage *stage;
ClutterEvent *event = NULL;
- ClutterPoint pos;
+ graphene_point_t pos;
/* We can drop the event on the floor if no stage has been
* associated with the device yet. */
diff --git a/clutter/clutter/evdev/clutter-seat-evdev.c b/clutter/clutter/evdev/clutter-seat-evdev.c
index 9e8e3ffb15..91f1b9014b 100644
--- a/clutter/clutter/evdev/clutter-seat-evdev.c
+++ b/clutter/clutter/evdev/clutter-seat-evdev.c
@@ -568,7 +568,7 @@ clutter_seat_evdev_notify_button (ClutterSeatEvdev *seat,
if (clutter_input_device_get_device_type (input_device) == CLUTTER_TABLET_DEVICE)
{
- ClutterPoint point;
+ graphene_point_t point;
clutter_input_device_get_coords (input_device, NULL, &point);
event->button.x = point.x;
diff --git a/clutter/clutter/evdev/clutter-seat-evdev.h b/clutter/clutter/evdev/clutter-seat-evdev.h
index 4bb319b3ab..7f77563718 100644
--- a/clutter/clutter/evdev/clutter-seat-evdev.h
+++ b/clutter/clutter/evdev/clutter-seat-evdev.h
@@ -42,7 +42,7 @@ struct _ClutterTouchState
int device_slot;
int seat_slot;
- ClutterPoint coords;
+ graphene_point_t coords;
};
struct _ClutterSeatEvdev
diff --git a/clutter/tests/conform/actor-layout.c b/clutter/tests/conform/actor-layout.c
index 2cc89400ce..ddea9f6dcb 100644
--- a/clutter/tests/conform/actor-layout.c
+++ b/clutter/tests/conform/actor-layout.c
@@ -6,7 +6,7 @@ actor_basic_layout (void)
ClutterActor *stage = clutter_test_get_stage ();
ClutterActor *vase;
ClutterActor *flower[3];
- ClutterPoint p;
+ graphene_point_t p;
vase = clutter_actor_new ();
clutter_actor_set_name (vase, "Vase");
@@ -31,13 +31,13 @@ actor_basic_layout (void)
clutter_actor_set_name (flower[2], "Green Flower");
clutter_actor_add_child (vase, flower[2]);
- clutter_point_init (&p, 50, 50);
+ graphene_point_init (&p, 50, 50);
clutter_test_assert_actor_at_point (stage, &p, flower[0]);
- clutter_point_init (&p, 150, 50);
+ graphene_point_init (&p, 150, 50);
clutter_test_assert_actor_at_point (stage, &p, flower[1]);
- clutter_point_init (&p, 250, 50);
+ graphene_point_init (&p, 250, 50);
clutter_test_assert_actor_at_point (stage, &p, flower[2]);
}
@@ -47,7 +47,7 @@ actor_margin_layout (void)
ClutterActor *stage = clutter_test_get_stage ();
ClutterActor *vase;
ClutterActor *flower[3];
- ClutterPoint p;
+ graphene_point_t p;
vase = clutter_actor_new ();
clutter_actor_set_name (vase, "Vase");
@@ -76,13 +76,13 @@ actor_margin_layout (void)
clutter_actor_set_margin_bottom (flower[2], 6);
clutter_actor_add_child (vase, flower[2]);
- clutter_point_init (&p, 0, 7);
+ graphene_point_init (&p, 0, 7);
clutter_test_assert_actor_at_point (stage, &p, flower[0]);
- clutter_point_init (&p, 106, 50);
+ graphene_point_init (&p, 106, 50);
clutter_test_assert_actor_at_point (stage, &p, flower[1]);
- clutter_point_init (&p, 212, 7);
+ graphene_point_init (&p, 212, 7);
clutter_test_assert_actor_at_point (stage, &p, flower[2]);
}
diff --git a/clutter/tests/interactive/test-events.c b/clutter/tests/interactive/test-events.c
index bfc5c22bcc..99addea3cd 100644
--- a/clutter/tests/interactive/test-events.c
+++ b/clutter/tests/interactive/test-events.c
@@ -240,7 +240,7 @@ input_cb (ClutterActor *actor,
{
ClutterActor *stage = clutter_actor_get_stage (actor);
ClutterActor *source_actor = clutter_event_get_source (event);
- ClutterPoint position;
+ graphene_point_t position;
gchar *state;
gchar keybuf[128];
gint device_id;
diff --git a/src/backends/meta-backend.c b/src/backends/meta-backend.c
index c527114bee..1f5315de25 100644
--- a/src/backends/meta-backend.c
+++ b/src/backends/meta-backend.c
@@ -232,7 +232,7 @@ meta_backend_monitors_changed (MetaBackend *backend)
meta_backend_get_monitor_manager (backend);
ClutterDeviceManager *manager = clutter_device_manager_get_default ();
ClutterInputDevice *device = clutter_device_manager_get_core_device (manager, CLUTTER_POINTER_DEVICE);
- ClutterPoint point;
+ graphene_point_t point;
meta_backend_sync_screen_size (backend);
diff --git a/src/backends/meta-cursor-renderer.c b/src/backends/meta-cursor-renderer.c
index 34a7f91d85..68069085eb 100644
--- a/src/backends/meta-cursor-renderer.c
+++ b/src/backends/meta-cursor-renderer.c
@@ -283,13 +283,13 @@ meta_cursor_renderer_set_position (MetaCursorRenderer *renderer,
meta_cursor_renderer_update_cursor (renderer, priv->displayed_cursor);
}
-ClutterPoint
+graphene_point_t
meta_cursor_renderer_get_position (MetaCursorRenderer *renderer)
{
MetaCursorRendererPrivate *priv =
meta_cursor_renderer_get_instance_private (renderer);
- return (ClutterPoint) {
+ return (graphene_point_t) {
.x = priv->current_x,
.y = priv->current_y
};
diff --git a/src/backends/meta-cursor-renderer.h b/src/backends/meta-cursor-renderer.h
index 60f1dbe158..cfa7bc995a 100644
--- a/src/backends/meta-cursor-renderer.h
+++ b/src/backends/meta-cursor-renderer.h
@@ -62,7 +62,7 @@ void meta_cursor_renderer_set_cursor (MetaCursorRenderer *renderer,
void meta_cursor_renderer_set_position (MetaCursorRenderer *renderer,
float x,
float y);
-ClutterPoint meta_cursor_renderer_get_position (MetaCursorRenderer *renderer);
+graphene_point_t meta_cursor_renderer_get_position (MetaCursorRenderer *renderer);
void meta_cursor_renderer_force_update (MetaCursorRenderer *renderer);
MetaCursorSprite * meta_cursor_renderer_get_cursor (MetaCursorRenderer *renderer);
diff --git a/src/backends/meta-cursor-tracker.c b/src/backends/meta-cursor-tracker.c
index 0d49327f45..4c7bd4c7a2 100644
--- a/src/backends/meta-cursor-tracker.c
+++ b/src/backends/meta-cursor-tracker.c
@@ -386,7 +386,7 @@ get_pointer_position_clutter (int *x,
{
ClutterDeviceManager *cmanager;
ClutterInputDevice *cdevice;
- ClutterPoint point;
+ graphene_point_t point;
cmanager = clutter_device_manager_get_default ();
cdevice = clutter_device_manager_get_core_device (cmanager, CLUTTER_POINTER_DEVICE);
diff --git a/src/backends/meta-screen-cast-monitor-stream-src.c
b/src/backends/meta-screen-cast-monitor-stream-src.c
index cb9823148c..800d7611fb 100644
--- a/src/backends/meta-screen-cast-monitor-stream-src.c
+++ b/src/backends/meta-screen-cast-monitor-stream-src.c
@@ -164,7 +164,7 @@ is_cursor_in_stream (MetaScreenCastMonitorStreamSrc *monitor_src)
}
else
{
- ClutterPoint cursor_position;
+ graphene_point_t cursor_position;
cursor_position = meta_cursor_renderer_get_position (cursor_renderer);
return clutter_rect_contains_point (&logical_monitor_rect,
@@ -361,7 +361,7 @@ meta_screen_cast_monitor_stream_src_set_cursor_metadata (MetaScreenCastStreamSrc
ClutterRect logical_monitor_rect;
MetaRendererView *view;
float view_scale;
- ClutterPoint cursor_position;
+ graphene_point_t cursor_position;
int x, y;
cursor_sprite = meta_cursor_renderer_get_cursor (cursor_renderer);
diff --git a/src/backends/meta-screen-cast-window-stream-src.c
b/src/backends/meta-screen-cast-window-stream-src.c
index dbf330420e..48ae81dbf0 100644
--- a/src/backends/meta-screen-cast-window-stream-src.c
+++ b/src/backends/meta-screen-cast-window-stream-src.c
@@ -114,8 +114,8 @@ maybe_draw_cursor_sprite (MetaScreenCastWindowStreamSrc *window_src,
MetaCursorSprite *cursor_sprite;
CoglTexture *cursor_texture;
MetaScreenCastWindow *screen_cast_window;
- ClutterPoint cursor_position;
- ClutterPoint relative_cursor_position;
+ graphene_point_t cursor_position;
+ graphene_point_t relative_cursor_position;
cairo_surface_t *cursor_surface;
uint8_t *cursor_surface_data;
GError *error = NULL;
@@ -316,7 +316,7 @@ is_cursor_in_stream (MetaScreenCastWindowStreamSrc *window_src)
MetaCursorRenderer *cursor_renderer =
meta_backend_get_cursor_renderer (backend);
MetaCursorSprite *cursor_sprite;
- ClutterPoint cursor_position;
+ graphene_point_t cursor_position;
MetaScreenCastWindow *screen_cast_window;
cursor_sprite = meta_cursor_renderer_get_cursor (cursor_renderer);
@@ -446,9 +446,9 @@ meta_screen_cast_window_stream_src_set_cursor_metadata (MetaScreenCastStreamSrc
meta_backend_get_cursor_renderer (backend);
MetaScreenCastWindow *screen_cast_window = window_src->screen_cast_window;
MetaCursorSprite *cursor_sprite;
- ClutterPoint cursor_position;
+ graphene_point_t cursor_position;
float scale;
- ClutterPoint relative_cursor_position;
+ graphene_point_t relative_cursor_position;
int x, y;
cursor_sprite = meta_cursor_renderer_get_cursor (cursor_renderer);
diff --git a/src/backends/meta-screen-cast-window.c b/src/backends/meta-screen-cast-window.c
index ce2bf82c96..809aca9be2 100644
--- a/src/backends/meta-screen-cast-window.c
+++ b/src/backends/meta-screen-cast-window.c
@@ -54,9 +54,9 @@ meta_screen_cast_window_transform_relative_position (MetaScreenCastWindow *scree
gboolean
meta_screen_cast_window_transform_cursor_position (MetaScreenCastWindow *screen_cast_window,
MetaCursorSprite *cursor_sprite,
- ClutterPoint *cursor_position,
+ graphene_point_t *cursor_position,
float *out_cursor_scale,
- ClutterPoint *out_relative_cursor_position)
+ graphene_point_t *out_relative_cursor_position)
{
MetaScreenCastWindowInterface *iface =
META_SCREEN_CAST_WINDOW_GET_IFACE (screen_cast_window);
diff --git a/src/backends/meta-screen-cast-window.h b/src/backends/meta-screen-cast-window.h
index badd882248..b836fec5c0 100644
--- a/src/backends/meta-screen-cast-window.h
+++ b/src/backends/meta-screen-cast-window.h
@@ -48,9 +48,9 @@ struct _MetaScreenCastWindowInterface
gboolean (*transform_cursor_position) (MetaScreenCastWindow *screen_cast_window,
MetaCursorSprite *cursor_sprite,
- ClutterPoint *cursor_position,
+ graphene_point_t *cursor_position,
float *out_cursor_scale,
- ClutterPoint *out_relative_cursor_position);
+ graphene_point_t *out_relative_cursor_position);
void (*capture_into) (MetaScreenCastWindow *screen_cast_window,
MetaRectangle *bounds,
@@ -70,9 +70,9 @@ void meta_screen_cast_window_transform_relative_position (MetaScreenCastWindow *
gboolean meta_screen_cast_window_transform_cursor_position (MetaScreenCastWindow *screen_cast_window,
MetaCursorSprite *cursor_sprite,
- ClutterPoint *cursor_position,
+ graphene_point_t *cursor_position,
float *out_cursor_scale,
- ClutterPoint
*out_relative_cursor_position);
+ graphene_point_t
*out_relative_cursor_position);
void meta_screen_cast_window_capture_into (MetaScreenCastWindow *screen_cast_window,
MetaRectangle *bounds,
diff --git a/src/backends/native/meta-backend-native.c b/src/backends/native/meta-backend-native.c
index c473681cb0..904a1b3b7e 100644
--- a/src/backends/native/meta-backend-native.c
+++ b/src/backends/native/meta-backend-native.c
@@ -140,7 +140,7 @@ constrain_all_screen_monitors (ClutterInputDevice *device,
float *x,
float *y)
{
- ClutterPoint current;
+ graphene_point_t current;
float cx, cy;
GList *logical_monitors, *l;
diff --git a/src/backends/native/meta-barrier-native.c b/src/backends/native/meta-barrier-native.c
index b030921f95..e00ebb970e 100644
--- a/src/backends/native/meta-barrier-native.c
+++ b/src/backends/native/meta-barrier-native.c
@@ -467,7 +467,7 @@ meta_barrier_manager_native_process (MetaBarrierManagerNative *manager,
float *x,
float *y)
{
- ClutterPoint prev_pos;
+ graphene_point_t prev_pos;
float prev_x;
float prev_y;
float orig_x = *x;
diff --git a/src/compositor/meta-dnd-actor.c b/src/compositor/meta-dnd-actor.c
index d1e3c60ac2..23c13bb62f 100644
--- a/src/compositor/meta-dnd-actor.c
+++ b/src/compositor/meta-dnd-actor.c
@@ -206,7 +206,7 @@ meta_dnd_actor_drag_finish (MetaDnDActor *self,
if (CLUTTER_ACTOR_IS_VISIBLE (self->drag_origin))
{
int anchor_x, anchor_y;
- ClutterPoint dest;
+ graphene_point_t dest;
clutter_actor_get_transformed_position (self->drag_origin,
&dest.x, &dest.y);
diff --git a/src/compositor/meta-feedback-actor.c b/src/compositor/meta-feedback-actor.c
index 0e98faba77..9632f312c7 100644
--- a/src/compositor/meta-feedback-actor.c
+++ b/src/compositor/meta-feedback-actor.c
@@ -239,7 +239,7 @@ void
meta_feedback_actor_update (MetaFeedbackActor *self,
const ClutterEvent *event)
{
- ClutterPoint point;
+ graphene_point_t point;
g_return_if_fail (META_IS_FEEDBACK_ACTOR (self));
g_return_if_fail (event != NULL);
diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c
index b471fdd632..0f8fd7d19a 100644
--- a/src/compositor/meta-window-actor.c
+++ b/src/compositor/meta-window-actor.c
@@ -1910,9 +1910,9 @@ meta_window_actor_transform_relative_position (MetaScreenCastWindow *screen_cast
static gboolean
meta_window_actor_transform_cursor_position (MetaScreenCastWindow *screen_cast_window,
MetaCursorSprite *cursor_sprite,
- ClutterPoint *cursor_position,
+ graphene_point_t *cursor_position,
float *out_cursor_scale,
- ClutterPoint *out_relative_cursor_position)
+ graphene_point_t *out_relative_cursor_position)
{
MetaWindowActor *window_actor = META_WINDOW_ACTOR (screen_cast_window);
MetaWindowActorPrivate *priv =
diff --git a/src/wayland/meta-pointer-confinement-wayland.c b/src/wayland/meta-pointer-confinement-wayland.c
index 4c1a9f9372..d4d8b0b980 100644
--- a/src/wayland/meta-pointer-confinement-wayland.c
+++ b/src/wayland/meta-pointer-confinement-wayland.c
@@ -622,7 +622,7 @@ meta_pointer_confinement_wayland_maybe_warp (MetaPointerConfinementWayland *self
{
MetaWaylandSeat *seat;
MetaWaylandSurface *surface;
- ClutterPoint point;
+ graphene_point_t point;
float sx;
float sy;
cairo_region_t *region;
diff --git a/src/wayland/meta-wayland-cursor-surface.c b/src/wayland/meta-wayland-cursor-surface.c
index d46b3511fa..f1435f1adf 100644
--- a/src/wayland/meta-wayland-cursor-surface.c
+++ b/src/wayland/meta-wayland-cursor-surface.c
@@ -185,7 +185,7 @@ meta_wayland_cursor_surface_is_on_logical_monitor (MetaWaylandSurfaceRole *role,
META_WAYLAND_CURSOR_SURFACE (surface->role);
MetaWaylandCursorSurfacePrivate *priv =
meta_wayland_cursor_surface_get_instance_private (cursor_surface);
- ClutterPoint point;
+ graphene_point_t point;
ClutterRect logical_monitor_rect;
logical_monitor_rect =
diff --git a/src/wayland/meta-wayland-data-device.c b/src/wayland/meta-wayland-data-device.c
index 122604965b..80524ee579 100644
--- a/src/wayland/meta-wayland-data-device.c
+++ b/src/wayland/meta-wayland-data-device.c
@@ -1101,7 +1101,7 @@ meta_wayland_data_device_start_drag (MetaWaylandDataDevice *data
{
MetaWaylandSeat *seat = wl_container_of (data_device, seat, data_device);
MetaWaylandDragGrab *drag_grab;
- ClutterPoint pos, surface_pos;
+ graphene_point_t pos, surface_pos;
ClutterModifierType modifiers;
MetaSurfaceActor *surface_actor;
diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c
index 27b8f38cdc..283f9b6035 100644
--- a/src/wayland/meta-wayland-pointer.c
+++ b/src/wayland/meta-wayland-pointer.c
@@ -890,7 +890,7 @@ meta_wayland_pointer_set_focus (MetaWaylandPointer *pointer,
if (surface != NULL)
{
struct wl_client *client = wl_resource_get_client (surface->resource);
- ClutterPoint pos;
+ graphene_point_t pos;
pointer->focus_surface = surface;
@@ -1003,7 +1003,7 @@ meta_wayland_pointer_get_relative_coordinates (MetaWaylandPointer *pointer,
wl_fixed_t *sy)
{
float xf = 0.0f, yf = 0.0f;
- ClutterPoint pos;
+ graphene_point_t pos;
clutter_input_device_get_coords (pointer->device, NULL, &pos);
meta_wayland_surface_get_relative_coordinates (surface, pos.x, pos.y, &xf, &yf);
diff --git a/src/wayland/meta-xwayland-selection.c b/src/wayland/meta-xwayland-selection.c
index 8502e22540..e20d99af9e 100644
--- a/src/wayland/meta-xwayland-selection.c
+++ b/src/wayland/meta-xwayland-selection.c
@@ -992,7 +992,7 @@ meta_x11_drag_dest_update (MetaWaylandDataDevice *data_device,
{
MetaWaylandCompositor *compositor = meta_wayland_compositor_get_default ();
MetaWaylandSeat *seat = compositor->seat;
- ClutterPoint pos;
+ graphene_point_t pos;
clutter_input_device_get_coords (seat->pointer->device, NULL, &pos);
xdnd_send_position (compositor->xwayland_manager.selection_data,
@@ -1341,7 +1341,7 @@ pick_drop_surface (MetaWaylandCompositor *compositor,
{
MetaDisplay *display = meta_get_display ();
MetaWindow *focus_window = NULL;
- ClutterPoint pos;
+ graphene_point_t pos;
clutter_event_get_coords (event, &pos.x, &pos.y);
focus_window = meta_stack_get_default_focus_window_at_point (display->stack,
@@ -1531,7 +1531,7 @@ meta_xwayland_selection_handle_client_message (MetaWaylandCompositor *compositor
else if (event->message_type == xdnd_atoms[ATOM_DND_POSITION])
{
ClutterEvent *motion;
- ClutterPoint pos;
+ graphene_point_t pos;
uint32_t action = 0;
dnd->selection.client_message_timestamp = event->data.l[3];
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]