[mutter/gbsneto/graphene: 29/31] Replace ClutterRect by graphene_rect_t
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/gbsneto/graphene: 29/31] Replace ClutterRect by graphene_rect_t
- Date: Tue, 26 Feb 2019 18:44:09 +0000 (UTC)
commit 12949bf7137cbafafa11b07de35bf69d01926c99
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Wed Feb 20 12:23:04 2019 -0300
Replace ClutterRect by graphene_rect_t
https://gitlab.gnome.org/GNOME/mutter/merge_requests/458
clutter/clutter/clutter-actor.c | 8 +-
clutter/clutter/clutter-autocleanups.h | 1 -
clutter/clutter/clutter-base-types.c | 583 +--------------------
clutter/clutter/clutter-deform-effect.c | 6 +-
clutter/clutter/clutter-drag-action.c | 16 +-
clutter/clutter/clutter-drag-action.h | 6 +-
clutter/clutter/clutter-graphene.c | 19 +
clutter/clutter/clutter-input-focus.c | 4 +-
clutter/clutter/clutter-input-focus.h | 4 +-
clutter/clutter/clutter-input-method-private.h | 4 +-
clutter/clutter/clutter-input-method.c | 6 +-
clutter/clutter/clutter-input-method.h | 4 +-
clutter/clutter/clutter-offscreen-effect.c | 12 +-
clutter/clutter/clutter-offscreen-effect.h | 2 +-
clutter/clutter/clutter-scroll-actor.c | 8 +-
clutter/clutter/clutter-scroll-actor.h | 4 +-
clutter/clutter/clutter-text.c | 34 +-
clutter/clutter/clutter-text.h | 2 +-
clutter/clutter/clutter-types.h | 117 +----
src/backends/meta-cursor-renderer.c | 8 +-
src/backends/meta-cursor-renderer.h | 4 +-
src/backends/meta-screen-cast-monitor-stream-src.c | 16 +-
src/backends/meta-stage-private.h | 8 +-
src/backends/meta-stage.c | 18 +-
src/backends/native/meta-cursor-renderer-native.c | 44 +-
src/compositor/meta-shaped-texture-private.h | 2 +-
src/compositor/meta-shaped-texture.c | 12 +-
src/compositor/meta-surface-actor.c | 4 +-
src/compositor/meta-surface-actor.h | 4 +-
src/compositor/region-utils.c | 8 +-
src/compositor/region-utils.h | 8 +-
src/core/boxes-private.h | 6 +-
src/core/boxes.c | 2 +-
src/core/display.c | 10 +-
src/wayland/meta-wayland-cursor-surface.c | 4 +-
src/wayland/meta-wayland-surface.c | 6 +-
src/wayland/meta-wayland-surface.h | 4 +-
src/wayland/meta-wayland-text-input-legacy.c | 4 +-
src/wayland/meta-wayland-text-input.c | 4 +-
39 files changed, 170 insertions(+), 846 deletions(-)
---
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
index b5af178bd..9f15a3237 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -693,7 +693,7 @@ struct _ClutterActorPrivate
ClutterAllocationFlags allocation_flags;
/* clip, in actor coordinates */
- ClutterRect clip;
+ graphene_rect_t clip;
/* the cached transformation matrix; see apply_transform() */
CoglMatrix transform;
@@ -5012,8 +5012,8 @@ clutter_actor_set_anchor_coord (ClutterActor *self,
}
static void
-clutter_actor_set_clip_rect (ClutterActor *self,
- const ClutterRect *clip)
+clutter_actor_set_clip_rect (ClutterActor *self,
+ const graphene_rect_t *clip)
{
ClutterActorPrivate *priv = self->priv;
GObject *obj = G_OBJECT (self);
@@ -6921,7 +6921,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
g_param_spec_boxed ("clip-rect",
P_("Clip Rectangle"),
P_("The visible region of the actor"),
- CLUTTER_TYPE_RECT,
+ GRAPHENE_TYPE_RECT,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
diff --git a/clutter/clutter/clutter-autocleanups.h b/clutter/clutter/clutter-autocleanups.h
index 808946a3a..e9ee38b33 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 (ClutterRect, clutter_rect_free)
#endif /* __GI_SCANNER__ */
diff --git a/clutter/clutter/clutter-base-types.c b/clutter/clutter/clutter-base-types.c
index 5871d81c3..83920519b 100644
--- a/clutter/clutter/clutter-base-types.c
+++ b/clutter/clutter/clutter-base-types.c
@@ -68,7 +68,7 @@ clutter_geometry_free (ClutterGeometry *geometry)
*
* Since: 1.4
*
- * Deprecated: 1.16: Use #ClutterRect and clutter_rect_union()
+ * Deprecated: 1.16: Use #graphene_rect_t and graphene_rect_union()
*/
void
clutter_geometry_union (const ClutterGeometry *geometry_a,
@@ -102,7 +102,7 @@ clutter_geometry_union (const ClutterGeometry *geometry_a,
*
* Since: 1.4
*
- * Deprecated: 1.16: Use #ClutterRect and clutter_rect_intersection()
+ * Deprecated: 1.16: Use #graphene_rect_t and graphene_rect_intersection()
*/
gboolean
clutter_geometry_intersects (const ClutterGeometry *geometry0,
@@ -210,585 +210,6 @@ G_DEFINE_BOXED_TYPE (ClutterMargin, clutter_margin,
clutter_margin_copy,
clutter_margin_free)
-
-
-/*
- * ClutterRect
- */
-
-static const ClutterRect _clutter_rect_zero = CLUTTER_RECT_INIT_ZERO;
-
-static gboolean clutter_rect_progress (const GValue *a,
- const GValue *b,
- gdouble progress,
- GValue *res);
-
-G_DEFINE_BOXED_TYPE_WITH_CODE (ClutterRect, clutter_rect,
- clutter_rect_copy,
- clutter_rect_free,
- CLUTTER_REGISTER_INTERVAL_PROGRESS (clutter_rect_progress))
-
-static inline void
-clutter_rect_normalize_internal (ClutterRect *rect)
-{
- if (rect->size.width >= 0.f && rect->size.height >= 0.f)
- return;
-
- if (rect->size.width < 0.f)
- {
- float size = fabsf (rect->size.width);
-
- rect->origin.x -= size;
- rect->size.width = size;
- }
-
- if (rect->size.height < 0.f)
- {
- float size = fabsf (rect->size.height);
-
- rect->origin.y -= size;
- rect->size.height = size;
- }
-}
-
-/**
- * clutter_rect_zero:
- *
- * A #ClutterRect with #ClutterRect.origin set at (0, 0) and a size
- * of 0.
- *
- * The returned value can be used as a guard.
- *
- * Return value: a rectangle with origin in (0, 0) and a size of 0.
- * The returned #ClutterRect is owned by Clutter and it should not
- * be modified or freed.
- *
- * Since: 1.12
- */
-const ClutterRect *
-clutter_rect_zero (void)
-{
- return &_clutter_rect_zero;
-}
-
-/**
- * clutter_rect_alloc: (constructor)
- *
- * Creates a new, empty #ClutterRect.
- *
- * You can use clutter_rect_init() to initialize the returned rectangle,
- * for instance:
- *
- * |[
- * rect = clutter_rect_init (clutter_rect_alloc (), x, y, width, height);
- * ]|
- *
- * Return value: (transfer full): the newly allocated #ClutterRect.
- * Use clutter_rect_free() to free its resources
- *
- * Since: 1.12
- */
-ClutterRect *
-clutter_rect_alloc (void)
-{
- return g_slice_new0 (ClutterRect);
-}
-
-/**
- * clutter_rect_init:
- * @rect: a #ClutterRect
- * @x: X coordinate of the origin
- * @y: Y coordinate of the origin
- * @width: width of the rectangle
- * @height: height of the rectangle
- *
- * Initializes a #ClutterRect with the given origin and size.
- *
- * Return value: (transfer none): the updated rectangle
- *
- * Since: 1.12
- */
-ClutterRect *
-clutter_rect_init (ClutterRect *rect,
- float x,
- float y,
- float width,
- float height)
-{
- g_return_val_if_fail (rect != NULL, NULL);
-
- rect->origin.x = x;
- rect->origin.y = y;
-
- rect->size.width = width;
- rect->size.height = height;
-
- return rect;
-}
-
-/**
- * clutter_rect_copy:
- * @rect: a #ClutterRect
- *
- * Copies @rect into a new #ClutterRect instance.
- *
- * Return value: (transfer full): the newly allocate copy of @rect.
- * Use clutter_rect_free() to free the associated resources
- *
- * Since: 1.12
- */
-ClutterRect *
-clutter_rect_copy (const ClutterRect *rect)
-{
- if (rect != NULL)
- {
- ClutterRect *res;
-
- res = g_slice_dup (ClutterRect, rect);
- clutter_rect_normalize_internal (res);
-
- return res;
- }
-
- return NULL;
-}
-
-/**
- * clutter_rect_free:
- * @rect: a #ClutterRect
- *
- * Frees the resources allocated by @rect.
- *
- * Since: 1.12
- */
-void
-clutter_rect_free (ClutterRect *rect)
-{
- if (rect != NULL && rect != &_clutter_rect_zero)
- g_slice_free (ClutterRect, rect);
-}
-
-/**
- * clutter_rect_equals:
- * @a: a #ClutterRect
- * @b: a #ClutterRect
- *
- * Checks whether @a and @b are equals.
- *
- * This function will normalize both @a and @b before comparing
- * their origin and size.
- *
- * Return value: %TRUE if the rectangles match in origin and size.
- *
- * Since: 1.12
- */
-gboolean
-clutter_rect_equals (ClutterRect *a,
- ClutterRect *b)
-{
- if (a == b)
- return TRUE;
-
- if (a == NULL || b == NULL)
- return FALSE;
-
- clutter_rect_normalize_internal (a);
- clutter_rect_normalize_internal (b);
-
- return graphene_point_equal (&a->origin, &b->origin) &&
- graphene_size_equal (&a->size, &b->size);
-}
-
-/**
- * clutter_rect_normalize:
- * @rect: a #ClutterRect
- *
- * Normalizes a #ClutterRect.
- *
- * A #ClutterRect is defined by the area covered by its size; this means
- * that a #ClutterRect with #ClutterRect.origin in [ 0, 0 ] and a
- * #ClutterRect.size of [ 10, 10 ] is equivalent to a #ClutterRect with
- * #ClutterRect.origin in [ 10, 10 ] and a #ClutterRect.size of [ -10, -10 ].
- *
- * This function is useful to ensure that a rectangle has positive width
- * and height; it will modify the passed @rect and normalize its size.
- *
- * Since: 1.12
- */
-ClutterRect *
-clutter_rect_normalize (ClutterRect *rect)
-{
- g_return_val_if_fail (rect != NULL, NULL);
-
- clutter_rect_normalize_internal (rect);
-
- return rect;
-}
-
-/**
- * clutter_rect_get_center:
- * @rect: a #ClutterRect
- * @center: (out caller-allocates): a #graphene_point_t
- *
- * Retrieves the center of @rect, after normalizing the rectangle,
- * and updates @center with the correct coordinates.
- *
- * Since: 1.12
- */
-void
-clutter_rect_get_center (ClutterRect *rect,
- graphene_point_t *center)
-{
- g_return_if_fail (rect != NULL);
- g_return_if_fail (center != NULL);
-
- clutter_rect_normalize_internal (rect);
-
- center->x = rect->origin.x + (rect->size.width / 2.0f);
- center->y = rect->origin.y + (rect->size.height / 2.0f);
-}
-
-/**
- * clutter_rect_contains_point:
- * @rect: a #ClutterRect
- * @point: the point to check
- *
- * Checks whether @point is contained by @rect, after normalizing the
- * rectangle.
- *
- * Return value: %TRUE if the @point is contained by @rect.
- *
- * Since: 1.12
- */
-gboolean
-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);
-
- clutter_rect_normalize_internal (rect);
-
- return (point->x >= rect->origin.x) &&
- (point->y >= rect->origin.y) &&
- (point->x <= (rect->origin.x + rect->size.width)) &&
- (point->y <= (rect->origin.y + rect->size.height));
-}
-
-/**
- * clutter_rect_contains_rect:
- * @a: a #ClutterRect
- * @b: a #ClutterRect
- *
- * Checks whether @a contains @b.
- *
- * The first rectangle contains the second if the union of the
- * two #ClutterRect is equal to the first rectangle.
- *
- * Return value: %TRUE if the first rectangle contains the second.
- *
- * Since: 1.12
- */
-gboolean
-clutter_rect_contains_rect (ClutterRect *a,
- ClutterRect *b)
-{
- ClutterRect res;
-
- g_return_val_if_fail (a != NULL, FALSE);
- g_return_val_if_fail (b != NULL, FALSE);
-
- clutter_rect_union (a, b, &res);
-
- return clutter_rect_equals (a, &res);
-}
-
-/**
- * clutter_rect_union:
- * @a: a #ClutterRect
- * @b: a #ClutterRect
- * @res: (out caller-allocates): a #ClutterRect
- *
- * Computes the smallest possible rectangle capable of fully containing
- * both @a and @b, and places it into @res.
- *
- * This function will normalize both @a and @b prior to computing their
- * union.
- *
- * Since: 1.12
- */
-void
-clutter_rect_union (ClutterRect *a,
- ClutterRect *b,
- ClutterRect *res)
-{
- g_return_if_fail (a != NULL);
- g_return_if_fail (b != NULL);
- g_return_if_fail (res != NULL);
-
- clutter_rect_normalize_internal (a);
- clutter_rect_normalize_internal (b);
-
- res->origin.x = MIN (a->origin.x, b->origin.x);
- res->origin.y = MIN (a->origin.y, b->origin.y);
-
- res->size.width = MAX (a->size.width, b->size.width);
- res->size.height = MAX (a->size.height, b->size.height);
-}
-
-/**
- * clutter_rect_intersection:
- * @a: a #ClutterRect
- * @b: a #ClutterRect
- * @res: (out caller-allocates) (allow-none): a #ClutterRect, or %NULL
- *
- * Computes the intersection of @a and @b, and places it in @res, if @res
- * is not %NULL.
- *
- * This function will normalize both @a and @b prior to computing their
- * intersection.
- *
- * This function can be used to simply check if the intersection of @a and @b
- * is not empty, by using %NULL for @res.
- *
- * Return value: %TRUE if the intersection of @a and @b is not empty
- *
- * Since: 1.12
- */
-gboolean
-clutter_rect_intersection (ClutterRect *a,
- ClutterRect *b,
- ClutterRect *res)
-{
- float x_1, y_1, x_2, y_2;
-
- g_return_val_if_fail (a != NULL, FALSE);
- g_return_val_if_fail (b != NULL, FALSE);
-
- clutter_rect_normalize_internal (a);
- clutter_rect_normalize_internal (b);
-
- x_1 = MAX (a->origin.x, b->origin.x);
- y_1 = MAX (a->origin.y, b->origin.y);
- x_2 = MIN (a->origin.x + a->size.width, b->origin.x + b->size.width);
- y_2 = MIN (a->origin.y + a->size.height, b->origin.y + b->size.height);
-
- if (x_1 >= x_2 || y_1 >= y_2)
- {
- if (res != NULL)
- clutter_rect_init (res, 0.f, 0.f, 0.f, 0.f);
-
- return FALSE;
- }
-
- if (res != NULL)
- clutter_rect_init (res, x_1, y_1, x_2 - x_1, y_2 - y_1);
-
- return TRUE;
-}
-
-/**
- * clutter_rect_offset:
- * @rect: a #ClutterRect
- * @d_x: the horizontal offset value
- * @d_y: the vertical offset value
- *
- * Offsets the origin of @rect by the given values, after normalizing
- * the rectangle.
- *
- * Since: 1.12
- */
-void
-clutter_rect_offset (ClutterRect *rect,
- float d_x,
- float d_y)
-{
- g_return_if_fail (rect != NULL);
-
- clutter_rect_normalize_internal (rect);
-
- rect->origin.x += d_x;
- rect->origin.y += d_y;
-}
-
-/**
- * clutter_rect_inset:
- * @rect: a #ClutterRect
- * @d_x: an horizontal value; a positive @d_x will create an inset rectangle,
- * and a negative value will create a larger rectangle
- * @d_y: a vertical value; a positive @d_x will create an inset rectangle,
- * and a negative value will create a larger rectangle
- *
- * Normalizes the @rect and offsets its origin by the @d_x and @d_y values;
- * the size is adjusted by (2 * @d_x, 2 * @d_y).
- *
- * If @d_x and @d_y are positive the size of the rectangle is decreased; if
- * the values are negative, the size of the rectangle is increased.
- *
- * If the resulting rectangle has a negative width or height, the size is
- * set to 0.
- *
- * Since: 1.12
- */
-void
-clutter_rect_inset (ClutterRect *rect,
- float d_x,
- float d_y)
-{
- g_return_if_fail (rect != NULL);
-
- clutter_rect_normalize_internal (rect);
-
- rect->origin.x += d_x;
- rect->origin.y += d_y;
-
- if (d_x >= 0.f)
- rect->size.width -= (d_x * 2.f);
- else
- rect->size.width += (d_x * -2.f);
-
- if (d_y >= 0.f)
- rect->size.height -= (d_y * 2.f);
- else
- rect->size.height += (d_y * -2.f);
-
- if (rect->size.width < 0.f)
- rect->size.width = 0.f;
-
- if (rect->size.height < 0.f)
- rect->size.height = 0.f;
-}
-
-/**
- * clutter_rect_clamp_to_pixel:
- * @rect: a #ClutterRect
- *
- * Rounds the origin of @rect downwards to the nearest integer, and rounds
- * the size of @rect upwards to the nearest integer, so that @rect is
- * updated to the smallest rectangle capable of fully containing the
- * original, fractional rectangle.
- *
- * Since: 1.12
- */
-void
-clutter_rect_clamp_to_pixel (ClutterRect *rect)
-{
- g_return_if_fail (rect != NULL);
-
- clutter_rect_normalize_internal (rect);
-
- rect->origin.x = floorf (rect->origin.x);
- rect->origin.y = floorf (rect->origin.y);
-
- rect->size.width = ceilf (rect->size.width);
- rect->size.height = ceilf (rect->size.height);
-}
-
-/**
- * clutter_rect_get_x:
- * @rect: a #ClutterRect
- *
- * Retrieves the X coordinate of the origin of @rect.
- *
- * Return value: the X coordinate of the origin of the rectangle
- *
- * Since: 1.12
- */
-float
-clutter_rect_get_x (ClutterRect *rect)
-{
- g_return_val_if_fail (rect != NULL, 0.f);
-
- clutter_rect_normalize_internal (rect);
-
- return rect->origin.x;
-}
-
-/**
- * clutter_rect_get_y:
- * @rect: a #ClutterRect
- *
- * Retrieves the Y coordinate of the origin of @rect.
- *
- * Return value: the Y coordinate of the origin of the rectangle
- *
- * Since: 1.12
- */
-float
-clutter_rect_get_y (ClutterRect *rect)
-{
- g_return_val_if_fail (rect != NULL, 0.f);
-
- clutter_rect_normalize_internal (rect);
-
- return rect->origin.y;
-}
-
-/**
- * clutter_rect_get_width:
- * @rect: a #ClutterRect
- *
- * Retrieves the width of @rect.
- *
- * Return value: the width of the rectangle
- *
- * Since: 1.12
- */
-float
-clutter_rect_get_width (ClutterRect *rect)
-{
- g_return_val_if_fail (rect != NULL, 0.f);
-
- clutter_rect_normalize_internal (rect);
-
- return rect->size.width;
-}
-
-/**
- * clutter_rect_get_height:
- * @rect: a #ClutterRect
- *
- * Retrieves the height of @rect.
- *
- * Return value: the height of the rectangle
- *
- * Since: 1.12
- */
-float
-clutter_rect_get_height (ClutterRect *rect)
-{
- g_return_val_if_fail (rect != NULL, 0.f);
-
- clutter_rect_normalize_internal (rect);
-
- return rect->size.height;
-}
-
-static gboolean
-clutter_rect_progress (const GValue *a,
- const GValue *b,
- gdouble progress,
- GValue *retval)
-{
- const ClutterRect *rect_a = g_value_get_boxed (a);
- const ClutterRect *rect_b = g_value_get_boxed (b);
- ClutterRect res = CLUTTER_RECT_INIT_ZERO;
-
-#define INTERPOLATE(r_a,r_b,member,field,factor) ((r_a)->member.field + (((r_b)->member.field -
((r_a)->member.field)) * (factor)))
-
- res.origin.x = INTERPOLATE (rect_a, rect_b, origin, x, progress);
- res.origin.y = INTERPOLATE (rect_a, rect_b, origin, y, progress);
-
- res.size.width = INTERPOLATE (rect_a, rect_b, size, width, progress);
- res.size.height = INTERPOLATE (rect_a, rect_b, size, height, progress);
-
-#undef INTERPOLATE
-
- g_value_set_boxed (retval, &res);
-
- return TRUE;
-}
-
/**
* ClutterMatrix:
*
diff --git a/clutter/clutter/clutter-deform-effect.c b/clutter/clutter/clutter-deform-effect.c
index a52e8b93f..73bef4dde 100644
--- a/clutter/clutter/clutter-deform-effect.c
+++ b/clutter/clutter/clutter-deform-effect.c
@@ -177,7 +177,7 @@ clutter_deform_effect_paint_target (ClutterOffscreenEffect *effect)
if (priv->is_dirty)
{
- ClutterRect rect;
+ graphene_rect_t rect;
gboolean mapped_buffer;
CoglVertexP3T2C4 *verts;
ClutterActor *actor;
@@ -193,8 +193,8 @@ clutter_deform_effect_paint_target (ClutterOffscreenEffect *effect)
*/
if (clutter_offscreen_effect_get_target_rect (effect, &rect))
{
- width = clutter_rect_get_width (&rect);
- height = clutter_rect_get_height (&rect);
+ width = graphene_rect_get_width (&rect);
+ height = graphene_rect_get_height (&rect);
}
else
clutter_actor_get_size (actor, &width, &height);
diff --git a/clutter/clutter/clutter-drag-action.c b/clutter/clutter/clutter-drag-action.c
index 54e991bf8..829889472 100644
--- a/clutter/clutter/clutter-drag-action.c
+++ b/clutter/clutter/clutter-drag-action.c
@@ -81,7 +81,7 @@ struct _ClutterDragActionPrivate
gint y_drag_threshold;
ClutterActor *drag_handle;
ClutterDragAxis drag_axis;
- ClutterRect drag_area;
+ graphene_rect_t drag_area;
ClutterInputDevice *device;
ClutterEventSequence *sequence;
@@ -542,7 +542,7 @@ clutter_drag_action_real_drag_motion (ClutterDragAction *action,
if (action->priv->drag_area_set)
{
- ClutterRect *drag_area = &action->priv->drag_area;
+ graphene_rect_t *drag_area = &action->priv->drag_area;
x = CLAMP (x, drag_area->origin.x, drag_area->origin.x + drag_area->size.width);
y = CLAMP (y, drag_area->origin.y, drag_area->origin.y + drag_area->size.height);
@@ -811,7 +811,7 @@ clutter_drag_action_class_init (ClutterDragActionClass *klass)
g_param_spec_boxed ("drag-area",
P_("Drag Area"),
P_("Constrains the dragging to a rectangle"),
- CLUTTER_TYPE_RECT,
+ GRAPHENE_TYPE_RECT,
CLUTTER_PARAM_READWRITE);
/**
@@ -1267,10 +1267,10 @@ clutter_drag_action_get_motion_coords (ClutterDragAction *action,
/**
* clutter_drag_action_get_drag_area:
* @action: a #ClutterDragAction
- * @drag_area: (out caller-allocates): a #ClutterRect to be filled
+ * @drag_area: (out caller-allocates): a #graphene_rect_t to be filled
*
* Retrieves the "drag area" associated with @action, that
- * is a #ClutterRect that constrains the actor movements,
+ * is a #graphene_rect_t that constrains the actor movements,
* in parents coordinates.
*
* Returns: %TRUE if the actor is actually constrained (and thus
@@ -1278,7 +1278,7 @@ clutter_drag_action_get_motion_coords (ClutterDragAction *action,
*/
gboolean
clutter_drag_action_get_drag_area (ClutterDragAction *action,
- ClutterRect *drag_area)
+ graphene_rect_t *drag_area)
{
g_return_val_if_fail (CLUTTER_IS_DRAG_ACTION (action), FALSE);
@@ -1298,8 +1298,8 @@ clutter_drag_action_get_drag_area (ClutterDragAction *action,
* If @drag_area is %NULL, the actor is not constrained.
*/
void
-clutter_drag_action_set_drag_area (ClutterDragAction *action,
- const ClutterRect *drag_area)
+clutter_drag_action_set_drag_area (ClutterDragAction *action,
+ const graphene_rect_t *drag_area)
{
ClutterDragActionPrivate *priv;
diff --git a/clutter/clutter/clutter-drag-action.h b/clutter/clutter/clutter-drag-action.h
index c0df62238..6904dc5ed 100644
--- a/clutter/clutter/clutter-drag-action.h
+++ b/clutter/clutter/clutter-drag-action.h
@@ -141,11 +141,11 @@ void clutter_drag_action_get_motion_coords (ClutterDragAction *actio
CLUTTER_EXPORT
gboolean clutter_drag_action_get_drag_area (ClutterDragAction *action,
- ClutterRect *drag_area);
+ graphene_rect_t *drag_area);
CLUTTER_EXPORT
-void clutter_drag_action_set_drag_area (ClutterDragAction *action,
- const ClutterRect *drag_area);
+void clutter_drag_action_set_drag_area (ClutterDragAction *action,
+ const graphene_rect_t *drag_area);
G_END_DECLS
diff --git a/clutter/clutter/clutter-graphene.c b/clutter/clutter/clutter-graphene.c
index 68aeb0c1a..93a6b4fdb 100644
--- a/clutter/clutter/clutter-graphene.c
+++ b/clutter/clutter/clutter-graphene.c
@@ -60,6 +60,23 @@ graphene_point3d_progress (const GValue *a,
return TRUE;
}
+static gboolean
+graphene_rect_progress (const GValue *a,
+ const GValue *b,
+ gdouble progress,
+ GValue *retval)
+{
+ const graphene_rect_t *rect_a = g_value_get_boxed (a);
+ const graphene_rect_t *rect_b = g_value_get_boxed (b);
+ graphene_rect_t res;
+
+ graphene_rect_interpolate (rect_a, rect_b, progress, &res);
+
+ g_value_set_boxed (retval, &res);
+
+ return TRUE;
+}
+
static gboolean
graphene_size_progress (const GValue *a,
const GValue *b,
@@ -84,6 +101,8 @@ clutter_graphene_init (void)
graphene_point_progress);
clutter_interval_register_progress_func (GRAPHENE_TYPE_POINT3D,
graphene_point3d_progress);
+ clutter_interval_register_progress_func (GRAPHENE_TYPE_RECT,
+ graphene_rect_progress);
clutter_interval_register_progress_func (GRAPHENE_TYPE_SIZE,
graphene_size_progress);
}
diff --git a/clutter/clutter/clutter-input-focus.c b/clutter/clutter/clutter-input-focus.c
index 51381ace6..299405209 100644
--- a/clutter/clutter/clutter-input-focus.c
+++ b/clutter/clutter/clutter-input-focus.c
@@ -89,8 +89,8 @@ clutter_input_focus_reset (ClutterInputFocus *focus)
}
void
-clutter_input_focus_set_cursor_location (ClutterInputFocus *focus,
- const ClutterRect *rect)
+clutter_input_focus_set_cursor_location (ClutterInputFocus *focus,
+ const graphene_rect_t *rect)
{
ClutterInputFocusPrivate *priv;
diff --git a/clutter/clutter/clutter-input-focus.h b/clutter/clutter/clutter-input-focus.h
index 619060382..f19d57527 100644
--- a/clutter/clutter/clutter-input-focus.h
+++ b/clutter/clutter/clutter-input-focus.h
@@ -57,8 +57,8 @@ gboolean clutter_input_focus_is_focused (ClutterInputFocus *focus);
CLUTTER_EXPORT
void clutter_input_focus_reset (ClutterInputFocus *focus);
CLUTTER_EXPORT
-void clutter_input_focus_set_cursor_location (ClutterInputFocus *focus,
- const ClutterRect *rect);
+void clutter_input_focus_set_cursor_location (ClutterInputFocus *focus,
+ const graphene_rect_t *rect);
CLUTTER_EXPORT
void clutter_input_focus_set_surrounding (ClutterInputFocus *focus,
diff --git a/clutter/clutter/clutter-input-method-private.h b/clutter/clutter/clutter-input-method-private.h
index e8ab2cabf..61e575e7e 100644
--- a/clutter/clutter/clutter-input-method-private.h
+++ b/clutter/clutter/clutter-input-method-private.h
@@ -26,8 +26,8 @@ ClutterInputFocus * clutter_input_method_get_focus (ClutterInputMethod *method);
void clutter_input_method_reset (ClutterInputMethod *method);
-void clutter_input_method_set_cursor_location (ClutterInputMethod *method,
- const ClutterRect *rect);
+void clutter_input_method_set_cursor_location (ClutterInputMethod *method,
+ const graphene_rect_t *rect);
void clutter_input_method_set_surrounding (ClutterInputMethod *method,
const gchar *text,
guint cursor,
diff --git a/clutter/clutter/clutter-input-method.c b/clutter/clutter/clutter-input-method.c
index cb5364b21..670886cc9 100644
--- a/clutter/clutter/clutter-input-method.c
+++ b/clutter/clutter/clutter-input-method.c
@@ -185,7 +185,7 @@ clutter_input_method_class_init (ClutterInputMethodClass *klass)
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
0, NULL, NULL, NULL,
- G_TYPE_NONE, 1, CLUTTER_TYPE_RECT);
+ G_TYPE_NONE, 1, GRAPHENE_TYPE_RECT);
pspecs[PROP_CONTENT_HINTS] =
g_param_spec_flags ("content-hints",
@@ -378,8 +378,8 @@ clutter_input_method_reset (ClutterInputMethod *im)
}
void
-clutter_input_method_set_cursor_location (ClutterInputMethod *im,
- const ClutterRect *rect)
+clutter_input_method_set_cursor_location (ClutterInputMethod *im,
+ const graphene_rect_t *rect)
{
g_return_if_fail (CLUTTER_IS_INPUT_METHOD (im));
diff --git a/clutter/clutter/clutter-input-method.h b/clutter/clutter/clutter-input-method.h
index be0dee7b6..aee29f4e0 100644
--- a/clutter/clutter/clutter-input-method.h
+++ b/clutter/clutter/clutter-input-method.h
@@ -42,8 +42,8 @@ struct _ClutterInputMethodClass
void (* reset) (ClutterInputMethod *im);
- void (* set_cursor_location) (ClutterInputMethod *im,
- const ClutterRect *rect);
+ void (* set_cursor_location) (ClutterInputMethod *im,
+ const graphene_rect_t *rect);
void (* set_surrounding) (ClutterInputMethod *im,
const gchar *text,
guint cursor,
diff --git a/clutter/clutter/clutter-offscreen-effect.c b/clutter/clutter/clutter-offscreen-effect.c
index 6f8a94484..42f1d126a 100644
--- a/clutter/clutter/clutter-offscreen-effect.c
+++ b/clutter/clutter/clutter-offscreen-effect.c
@@ -632,7 +632,7 @@ clutter_offscreen_effect_get_target_size (ClutterOffscreenEffect *effect,
*/
gboolean
clutter_offscreen_effect_get_target_rect (ClutterOffscreenEffect *effect,
- ClutterRect *rect)
+ graphene_rect_t *rect)
{
ClutterOffscreenEffectPrivate *priv;
@@ -644,11 +644,11 @@ clutter_offscreen_effect_get_target_rect (ClutterOffscreenEffect *effect,
if (priv->texture == NULL)
return FALSE;
- clutter_rect_init (rect,
- priv->position.x,
- priv->position.y,
- cogl_texture_get_width (priv->texture),
- cogl_texture_get_height (priv->texture));
+ graphene_rect_init (rect,
+ priv->position.x,
+ priv->position.y,
+ cogl_texture_get_width (priv->texture),
+ cogl_texture_get_height (priv->texture));
return TRUE;
}
diff --git a/clutter/clutter/clutter-offscreen-effect.h b/clutter/clutter/clutter-offscreen-effect.h
index 07619441e..6ab1637ae 100644
--- a/clutter/clutter/clutter-offscreen-effect.h
+++ b/clutter/clutter/clutter-offscreen-effect.h
@@ -114,7 +114,7 @@ gboolean clutter_offscreen_effect_get_target_size (ClutterOffscree
CLUTTER_EXPORT
gboolean clutter_offscreen_effect_get_target_rect (ClutterOffscreenEffect *effect,
- ClutterRect *rect);
+ graphene_rect_t *rect);
G_END_DECLS
diff --git a/clutter/clutter/clutter-scroll-actor.c b/clutter/clutter/clutter-scroll-actor.c
index 5cefb1f93..1ea47aaed 100644
--- a/clutter/clutter/clutter-scroll-actor.c
+++ b/clutter/clutter/clutter-scroll-actor.c
@@ -417,10 +417,10 @@ clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
* Since: 1.12
*/
void
-clutter_scroll_actor_scroll_to_rect (ClutterScrollActor *actor,
- const ClutterRect *rect)
+clutter_scroll_actor_scroll_to_rect (ClutterScrollActor *actor,
+ const graphene_rect_t *rect)
{
- ClutterRect n_rect;
+ graphene_rect_t n_rect;
g_return_if_fail (CLUTTER_IS_SCROLL_ACTOR (actor));
g_return_if_fail (rect != NULL);
@@ -428,7 +428,7 @@ clutter_scroll_actor_scroll_to_rect (ClutterScrollActor *actor,
n_rect = *rect;
/* normalize, so that we have a valid origin */
- clutter_rect_normalize (&n_rect);
+ graphene_rect_normalize (&n_rect);
clutter_scroll_actor_scroll_to_point (actor, &n_rect.origin);
}
diff --git a/clutter/clutter/clutter-scroll-actor.h b/clutter/clutter/clutter-scroll-actor.h
index 4a4171495..e6a176521 100644
--- a/clutter/clutter/clutter-scroll-actor.h
+++ b/clutter/clutter/clutter-scroll-actor.h
@@ -89,8 +89,8 @@ CLUTTER_EXPORT
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);
+void clutter_scroll_actor_scroll_to_rect (ClutterScrollActor *actor,
+ const graphene_rect_t *rect);
G_END_DECLS
diff --git a/clutter/clutter/clutter-text.c b/clutter/clutter/clutter-text.c
index 0926e659a..88a835822 100644
--- a/clutter/clutter/clutter-text.c
+++ b/clutter/clutter/clutter-text.c
@@ -155,7 +155,7 @@ struct _ClutterTextPrivate
gint text_y;
/* Where to draw the cursor */
- ClutterRect cursor_rect;
+ graphene_rect_t cursor_rect;
ClutterColor cursor_color;
guint cursor_size;
@@ -1132,7 +1132,7 @@ static inline void
update_cursor_location (ClutterText *self)
{
ClutterTextPrivate *priv = self->priv;
- ClutterRect rect;
+ graphene_rect_t rect;
float x, y;
if (!priv->editable)
@@ -1140,7 +1140,7 @@ update_cursor_location (ClutterText *self)
rect = priv->cursor_rect;
clutter_actor_get_transformed_position (CLUTTER_ACTOR (self), &x, &y);
- clutter_rect_offset (&rect, x, y);
+ graphene_rect_offset (&rect, x, y);
clutter_input_focus_set_cursor_location (priv->input_focus, &rect);
}
@@ -1149,7 +1149,7 @@ clutter_text_ensure_cursor_position (ClutterText *self)
{
ClutterTextPrivate *priv = self->priv;
gfloat x, y, cursor_height;
- ClutterRect cursor_rect = CLUTTER_RECT_INIT_ZERO;
+ graphene_rect_t cursor_rect = GRAPHENE_RECT_INIT (0, 0, 0, 0);
gint position;
position = priv->position;
@@ -1172,23 +1172,23 @@ clutter_text_ensure_cursor_position (ClutterText *self)
&x, &y,
&cursor_height);
- clutter_rect_init (&cursor_rect,
- x,
- y + CURSOR_Y_PADDING,
- priv->cursor_size,
- cursor_height - 2 * CURSOR_Y_PADDING);
+ graphene_rect_init (&cursor_rect,
+ x,
+ y + CURSOR_Y_PADDING,
+ priv->cursor_size,
+ cursor_height - 2 * CURSOR_Y_PADDING);
- if (!clutter_rect_equals (&priv->cursor_rect, &cursor_rect))
+ if (!graphene_rect_equal (&priv->cursor_rect, &cursor_rect))
{
ClutterGeometry cursor_pos;
priv->cursor_rect = cursor_rect;
/* XXX:2.0 - remove */
- cursor_pos.x = clutter_rect_get_x (&priv->cursor_rect);
- cursor_pos.y = clutter_rect_get_y (&priv->cursor_rect);
- cursor_pos.width = clutter_rect_get_width (&priv->cursor_rect);
- cursor_pos.height = clutter_rect_get_height (&priv->cursor_rect);
+ cursor_pos.x = graphene_rect_get_x (&priv->cursor_rect);
+ cursor_pos.y = graphene_rect_get_y (&priv->cursor_rect);
+ cursor_pos.width = graphene_rect_get_width (&priv->cursor_rect);
+ cursor_pos.height = graphene_rect_get_height (&priv->cursor_rect);
g_signal_emit (self, text_signals[CURSOR_EVENT], 0, &cursor_pos);
g_signal_emit (self, text_signals[CURSOR_CHANGED], 0);
@@ -2498,7 +2498,7 @@ clutter_text_paint (ClutterActor *self)
if (actor_width < text_width)
{
- gint cursor_x = clutter_rect_get_x (&priv->cursor_rect);
+ gint cursor_x = graphene_rect_get_x (&priv->cursor_rect);
if (priv->position == -1)
{
@@ -6534,8 +6534,8 @@ clutter_text_get_layout_offsets (ClutterText *self,
* Since: 1.16
*/
void
-clutter_text_get_cursor_rect (ClutterText *self,
- ClutterRect *rect)
+clutter_text_get_cursor_rect (ClutterText *self,
+ graphene_rect_t *rect)
{
g_return_if_fail (CLUTTER_IS_TEXT (self));
g_return_if_fail (rect != NULL);
diff --git a/clutter/clutter/clutter-text.h b/clutter/clutter/clutter-text.h
index aa65ba2e6..5ca279f48 100644
--- a/clutter/clutter/clutter-text.h
+++ b/clutter/clutter/clutter-text.h
@@ -230,7 +230,7 @@ CLUTTER_EXPORT
guint clutter_text_get_cursor_size (ClutterText *self);
CLUTTER_EXPORT
void clutter_text_get_cursor_rect (ClutterText *self,
- ClutterRect *rect);
+ graphene_rect_t *rect);
CLUTTER_EXPORT
void clutter_text_set_selectable (ClutterText *self,
gboolean selectable);
diff --git a/clutter/clutter/clutter-types.h b/clutter/clutter/clutter-types.h
index 398950b98..e54663273 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_RECT (clutter_rect_get_type ())
typedef struct _ClutterActor ClutterActor;
@@ -81,7 +80,6 @@ typedef struct _ClutterGeometry ClutterGeometry; /* XXX:2.0 - re
typedef struct _ClutterKnot ClutterKnot;
typedef struct _ClutterMargin ClutterMargin;
typedef struct _ClutterPerspective ClutterPerspective;
-typedef struct _ClutterRect ClutterRect;
typedef struct _ClutterAlpha ClutterAlpha;
typedef struct _ClutterAnimation ClutterAnimation;
@@ -132,119 +130,6 @@ typedef struct _ClutterShader ClutterShader; /* deprecated */
*/
typedef struct _ClutterPaintVolume ClutterPaintVolume;
-/**
- * ClutterRect:
- * @origin: the origin of the rectangle
- * @size: the size of the rectangle
- *
- * The location and size of a rectangle.
- *
- * The width and height of a #ClutterRect can be negative; Clutter considers
- * a rectangle with an origin of [ 0.0, 0.0 ] and a size of [ 10.0, 10.0 ] to
- * be equivalent to a rectangle with origin of [ 10.0, 10.0 ] and size of
- * [ -10.0, -10.0 ].
- *
- * Application code can normalize rectangles using clutter_rect_normalize():
- * this function will ensure that the width and height of a #ClutterRect are
- * positive values. All functions taking a #ClutterRect as an argument will
- * implicitly normalize it before computing eventual results. For this reason
- * it is safer to access the contents of a #ClutterRect by using the provided
- * API at all times, instead of directly accessing the structure members.
- *
- * Since: 1.12
- */
-struct _ClutterRect
-{
- graphene_point_t origin;
- graphene_size_t size;
-};
-
-/**
- * CLUTTER_RECT_INIT:
- * @x: the X coordinate
- * @y: the Y coordinate
- * @width: the width
- * @height: the height
- *
- * A simple macro for initializing a #ClutterRect when declaring it, e.g.:
- *
- * |[
- * ClutterRect r = CLUTTER_RECT_INIT (100, 100, 200, 200);
- * ]|
- *
- * Since: 1.12
- */
-#define CLUTTER_RECT_INIT(x,y,width,height) { { (x), (y) }, { (width), (height) } }
-
-/**
- * CLUTTER_RECT_INIT_ZERO:
- *
- * A simple macro for initializing a #ClutterRect to (0, 0, 0, 0) when
- * declaring it.
- *
- * Since: 1.12
- */
-#define CLUTTER_RECT_INIT_ZERO CLUTTER_RECT_INIT (0.f, 0.f, 0.f, 0.f)
-
-CLUTTER_EXPORT
-GType clutter_rect_get_type (void) G_GNUC_CONST;
-
-CLUTTER_EXPORT
-const ClutterRect * clutter_rect_zero (void);
-CLUTTER_EXPORT
-ClutterRect * clutter_rect_alloc (void);
-CLUTTER_EXPORT
-ClutterRect * clutter_rect_init (ClutterRect *rect,
- float x,
- float y,
- float width,
- float height);
-CLUTTER_EXPORT
-ClutterRect * clutter_rect_copy (const ClutterRect *rect);
-CLUTTER_EXPORT
-void clutter_rect_free (ClutterRect *rect);
-CLUTTER_EXPORT
-gboolean clutter_rect_equals (ClutterRect *a,
- ClutterRect *b);
-
-CLUTTER_EXPORT
-ClutterRect * clutter_rect_normalize (ClutterRect *rect);
-CLUTTER_EXPORT
-void clutter_rect_get_center (ClutterRect *rect,
- graphene_point_t *center);
-CLUTTER_EXPORT
-gboolean clutter_rect_contains_point (ClutterRect *rect,
- graphene_point_t *point);
-CLUTTER_EXPORT
-gboolean clutter_rect_contains_rect (ClutterRect *a,
- ClutterRect *b);
-CLUTTER_EXPORT
-void clutter_rect_union (ClutterRect *a,
- ClutterRect *b,
- ClutterRect *res);
-CLUTTER_EXPORT
-gboolean clutter_rect_intersection (ClutterRect *a,
- ClutterRect *b,
- ClutterRect *res);
-CLUTTER_EXPORT
-void clutter_rect_offset (ClutterRect *rect,
- float d_x,
- float d_y);
-CLUTTER_EXPORT
-void clutter_rect_inset (ClutterRect *rect,
- float d_x,
- float d_y);
-CLUTTER_EXPORT
-void clutter_rect_clamp_to_pixel (ClutterRect *rect);
-CLUTTER_EXPORT
-float clutter_rect_get_x (ClutterRect *rect);
-CLUTTER_EXPORT
-float clutter_rect_get_y (ClutterRect *rect);
-CLUTTER_EXPORT
-float clutter_rect_get_width (ClutterRect *rect);
-CLUTTER_EXPORT
-float clutter_rect_get_height (ClutterRect *rect);
-
/**
* ClutterActorBox:
* @x1: X coordinate of the top left corner
@@ -381,7 +266,7 @@ void clutter_actor_box_set_size (ClutterActorBox *box,
* The rectangle containing an actor's bounding box, measured in pixels.
*
* You should not use #ClutterGeometry, or operate on its fields
- * directly; you should use #cairo_rectangle_int_t or #ClutterRect if you
+ * directly; you should use #cairo_rectangle_int_t or #graphene_rect_t if you
* need a rectangle type, depending on the precision required.
*
* Deprecated: 1.16
diff --git a/src/backends/meta-cursor-renderer.c b/src/backends/meta-cursor-renderer.c
index 68069085e..e8faf9330 100644
--- a/src/backends/meta-cursor-renderer.c
+++ b/src/backends/meta-cursor-renderer.c
@@ -89,7 +89,7 @@ queue_redraw (MetaCursorRenderer *renderer,
MetaBackend *backend = meta_get_backend ();
ClutterActor *stage = meta_backend_get_stage (backend);
CoglTexture *texture;
- ClutterRect rect = CLUTTER_RECT_INIT_ZERO;
+ graphene_rect_t rect = GRAPHENE_RECT_INIT (0, 0, 0, 0);
if (cursor_sprite)
rect = meta_cursor_renderer_calculate_rect (renderer, cursor_sprite);
@@ -179,7 +179,7 @@ meta_cursor_renderer_init (MetaCursorRenderer *renderer)
NULL);
}
-ClutterRect
+graphene_rect_t
meta_cursor_renderer_calculate_rect (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite)
{
@@ -192,14 +192,14 @@ meta_cursor_renderer_calculate_rect (MetaCursorRenderer *renderer,
texture = meta_cursor_sprite_get_cogl_texture (cursor_sprite);
if (!texture)
- return (ClutterRect) CLUTTER_RECT_INIT_ZERO;
+ return (graphene_rect_t) GRAPHENE_RECT_INIT (0, 0, 0, 0);
meta_cursor_sprite_get_hotspot (cursor_sprite, &hot_x, &hot_y);
texture_scale = meta_cursor_sprite_get_texture_scale (cursor_sprite);
width = cogl_texture_get_width (texture);
height = cogl_texture_get_height (texture);
- return (ClutterRect) {
+ return (graphene_rect_t) {
.origin = {
.x = priv->current_x - (hot_x * texture_scale),
.y = priv->current_y - (hot_y * texture_scale)
diff --git a/src/backends/meta-cursor-renderer.h b/src/backends/meta-cursor-renderer.h
index cfa7bc995..852551355 100644
--- a/src/backends/meta-cursor-renderer.h
+++ b/src/backends/meta-cursor-renderer.h
@@ -76,8 +76,8 @@ void meta_cursor_renderer_remove_hw_cursor_inhibitor (MetaCursorRenderer *ren
gboolean meta_cursor_renderer_is_hw_cursors_inhibited (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite);
-ClutterRect meta_cursor_renderer_calculate_rect (MetaCursorRenderer *renderer,
- MetaCursorSprite *cursor_sprite);
+graphene_rect_t meta_cursor_renderer_calculate_rect (MetaCursorRenderer *renderer,
+ MetaCursorSprite *cursor_sprite);
void meta_cursor_renderer_emit_painted (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite);
diff --git a/src/backends/meta-screen-cast-monitor-stream-src.c
b/src/backends/meta-screen-cast-monitor-stream-src.c
index 800d7611f..b2e633e3f 100644
--- a/src/backends/meta-screen-cast-monitor-stream-src.c
+++ b/src/backends/meta-screen-cast-monitor-stream-src.c
@@ -142,7 +142,7 @@ is_cursor_in_stream (MetaScreenCastMonitorStreamSrc *monitor_src)
MetaMonitor *monitor;
MetaLogicalMonitor *logical_monitor;
MetaRectangle logical_monitor_layout;
- ClutterRect logical_monitor_rect;
+ graphene_rect_t logical_monitor_rect;
MetaCursorSprite *cursor_sprite;
monitor = get_monitor (monitor_src);
@@ -154,21 +154,21 @@ is_cursor_in_stream (MetaScreenCastMonitorStreamSrc *monitor_src)
cursor_sprite = meta_cursor_renderer_get_cursor (cursor_renderer);
if (cursor_sprite)
{
- ClutterRect cursor_rect;
+ graphene_rect_t cursor_rect;
cursor_rect = meta_cursor_renderer_calculate_rect (cursor_renderer,
cursor_sprite);
- return clutter_rect_intersection (&cursor_rect,
- &logical_monitor_rect,
- NULL);
+ return graphene_rect_intersection (&cursor_rect,
+ &logical_monitor_rect,
+ NULL);
}
else
{
graphene_point_t cursor_position;
cursor_position = meta_cursor_renderer_get_position (cursor_renderer);
- return clutter_rect_contains_point (&logical_monitor_rect,
- &cursor_position);
+ return graphene_rect_contains_point (&logical_monitor_rect,
+ &cursor_position);
}
}
@@ -358,7 +358,7 @@ meta_screen_cast_monitor_stream_src_set_cursor_metadata (MetaScreenCastStreamSrc
MetaMonitor *monitor;
MetaLogicalMonitor *logical_monitor;
MetaRectangle logical_monitor_layout;
- ClutterRect logical_monitor_rect;
+ graphene_rect_t logical_monitor_rect;
MetaRendererView *view;
float view_scale;
graphene_point_t cursor_position;
diff --git a/src/backends/meta-stage-private.h b/src/backends/meta-stage-private.h
index 21feab3ac..691ceb29c 100644
--- a/src/backends/meta-stage-private.h
+++ b/src/backends/meta-stage-private.h
@@ -34,10 +34,10 @@ MetaOverlay *meta_stage_create_cursor_overlay (MetaStage *stage);
void meta_stage_remove_cursor_overlay (MetaStage *stage,
MetaOverlay *overlay);
-void meta_stage_update_cursor_overlay (MetaStage *stage,
- MetaOverlay *overlay,
- CoglTexture *texture,
- ClutterRect *rect);
+void meta_stage_update_cursor_overlay (MetaStage *stage,
+ MetaOverlay *overlay,
+ CoglTexture *texture,
+ graphene_rect_t *rect);
void meta_stage_set_active (MetaStage *stage,
gboolean is_active);
diff --git a/src/backends/meta-stage.c b/src/backends/meta-stage.c
index c009f1022..a229cb2b0 100644
--- a/src/backends/meta-stage.c
+++ b/src/backends/meta-stage.c
@@ -46,8 +46,8 @@ struct _MetaOverlay
CoglPipeline *pipeline;
CoglTexture *texture;
- ClutterRect current_rect;
- ClutterRect previous_rect;
+ graphene_rect_t current_rect;
+ graphene_rect_t previous_rect;
gboolean previous_is_valid;
};
@@ -83,9 +83,9 @@ meta_overlay_free (MetaOverlay *overlay)
}
static void
-meta_overlay_set (MetaOverlay *overlay,
- CoglTexture *texture,
- ClutterRect *rect)
+meta_overlay_set (MetaOverlay *overlay,
+ CoglTexture *texture,
+ graphene_rect_t *rect)
{
if (overlay->texture != texture)
{
@@ -267,10 +267,10 @@ meta_stage_remove_cursor_overlay (MetaStage *stage,
}
void
-meta_stage_update_cursor_overlay (MetaStage *stage,
- MetaOverlay *overlay,
- CoglTexture *texture,
- ClutterRect *rect)
+meta_stage_update_cursor_overlay (MetaStage *stage,
+ MetaOverlay *overlay,
+ CoglTexture *texture,
+ graphene_rect_t *rect)
{
g_assert (meta_is_wayland_compositor () || texture == NULL);
diff --git a/src/backends/native/meta-cursor-renderer-native.c
b/src/backends/native/meta-cursor-renderer-native.c
index 44c3c5499..e2d6eb52e 100644
--- a/src/backends/native/meta-cursor-renderer-native.c
+++ b/src/backends/native/meta-cursor-renderer-native.c
@@ -286,7 +286,7 @@ typedef struct
{
MetaCursorRendererNative *in_cursor_renderer_native;
MetaLogicalMonitor *in_logical_monitor;
- ClutterRect in_local_cursor_rect;
+ graphene_rect_t in_local_cursor_rect;
MetaCursorSprite *in_cursor_sprite;
gboolean out_painted;
@@ -306,7 +306,7 @@ update_monitor_crtc_cursor (MetaMonitor *monitor,
meta_cursor_renderer_native_get_instance_private (cursor_renderer_native);
MetaCrtc *crtc;
MetaMonitorTransform transform;
- ClutterRect scaled_crtc_rect;
+ graphene_rect_t scaled_crtc_rect;
float scale;
int crtc_x, crtc_y;
int crtc_width, crtc_height;
@@ -333,7 +333,7 @@ update_monitor_crtc_cursor (MetaMonitor *monitor,
crtc_height = monitor_crtc_mode->crtc_mode->height;
}
- scaled_crtc_rect = (ClutterRect) {
+ scaled_crtc_rect = (graphene_rect_t) {
.origin = {
.x = crtc_x / scale,
.y = crtc_y / scale
@@ -347,9 +347,9 @@ update_monitor_crtc_cursor (MetaMonitor *monitor,
crtc = meta_output_get_assigned_crtc (monitor_crtc_mode->output);
if (priv->has_hw_cursor &&
- clutter_rect_intersection (&scaled_crtc_rect,
- &data->in_local_cursor_rect,
- NULL))
+ graphene_rect_intersection (&scaled_crtc_rect,
+ &data->in_local_cursor_rect,
+ NULL))
{
MetaGpuKms *gpu_kms;
int kms_fd;
@@ -390,13 +390,13 @@ update_hw_cursor (MetaCursorRendererNative *native,
MetaMonitorManager *monitor_manager = priv->monitor_manager;
GList *logical_monitors;
GList *l;
- ClutterRect rect;
+ graphene_rect_t rect;
gboolean painted = FALSE;
if (cursor_sprite)
rect = meta_cursor_renderer_calculate_rect (renderer, cursor_sprite);
else
- rect = (ClutterRect) { 0 };
+ rect = GRAPHENE_RECT_INIT (0, 0, 0, 0);
logical_monitors =
meta_monitor_manager_get_logical_monitors (monitor_manager);
@@ -410,7 +410,7 @@ update_hw_cursor (MetaCursorRendererNative *native,
data = (UpdateCrtcCursorData) {
.in_cursor_renderer_native = native,
.in_logical_monitor = logical_monitor,
- .in_local_cursor_rect = (ClutterRect) {
+ .in_local_cursor_rect = (graphene_rect_t) {
.origin = {
.x = rect.origin.x - logical_monitor->rect.x,
.y = rect.origin.y - logical_monitor->rect.y
@@ -483,7 +483,7 @@ cursor_over_transformed_logical_monitor (MetaCursorRenderer *renderer,
MetaMonitorManager *monitor_manager = priv->monitor_manager;
GList *logical_monitors;
GList *l;
- ClutterRect cursor_rect;
+ graphene_rect_t cursor_rect;
cursor_rect = meta_cursor_renderer_calculate_rect (renderer, cursor_sprite);
@@ -493,7 +493,7 @@ cursor_over_transformed_logical_monitor (MetaCursorRenderer *renderer,
{
MetaLogicalMonitor *logical_monitor = l->data;
MetaRectangle logical_monitor_layout;
- ClutterRect logical_monitor_rect;
+ graphene_rect_t logical_monitor_rect;
MetaMonitorTransform transform;
GList *monitors, *l_mon;
@@ -502,8 +502,8 @@ cursor_over_transformed_logical_monitor (MetaCursorRenderer *renderer,
logical_monitor_rect =
meta_rectangle_to_clutter_rect (&logical_monitor_layout);
- if (!clutter_rect_intersection (&cursor_rect, &logical_monitor_rect,
- NULL))
+ if (!graphene_rect_intersection (&cursor_rect, &logical_monitor_rect,
+ NULL))
continue;
monitors = meta_logical_monitor_get_monitors (logical_monitor);
@@ -539,7 +539,7 @@ can_draw_cursor_unscaled (MetaCursorRenderer *renderer,
MetaCursorRendererNativePrivate *priv =
meta_cursor_renderer_native_get_instance_private (cursor_renderer_native);
MetaMonitorManager *monitor_manager = priv->monitor_manager;
- ClutterRect cursor_rect;
+ graphene_rect_t cursor_rect;
GList *logical_monitors;
GList *l;
gboolean has_visible_crtc_sprite = FALSE;
@@ -558,12 +558,12 @@ can_draw_cursor_unscaled (MetaCursorRenderer *renderer,
for (l = logical_monitors; l; l = l->next)
{
MetaLogicalMonitor *logical_monitor = l->data;
- ClutterRect logical_monitor_rect =
+ graphene_rect_t logical_monitor_rect =
meta_rectangle_to_clutter_rect (&logical_monitor->rect);
- if (!clutter_rect_intersection (&cursor_rect,
- &logical_monitor_rect,
- NULL))
+ if (!graphene_rect_intersection (&cursor_rect,
+ &logical_monitor_rect,
+ NULL))
continue;
if (calculate_cursor_crtc_sprite_scale (cursor_sprite,
@@ -684,7 +684,7 @@ calculate_cursor_sprite_gpus (MetaCursorRenderer *renderer,
GList *gpus = NULL;
GList *logical_monitors;
GList *l;
- ClutterRect cursor_rect;
+ graphene_rect_t cursor_rect;
cursor_rect = meta_cursor_renderer_calculate_rect (renderer, cursor_sprite);
@@ -694,7 +694,7 @@ calculate_cursor_sprite_gpus (MetaCursorRenderer *renderer,
{
MetaLogicalMonitor *logical_monitor = l->data;
MetaRectangle logical_monitor_layout;
- ClutterRect logical_monitor_rect;
+ graphene_rect_t logical_monitor_rect;
GList *monitors, *l_mon;
logical_monitor_layout =
@@ -702,8 +702,8 @@ calculate_cursor_sprite_gpus (MetaCursorRenderer *renderer,
logical_monitor_rect =
meta_rectangle_to_clutter_rect (&logical_monitor_layout);
- if (!clutter_rect_intersection (&cursor_rect, &logical_monitor_rect,
- NULL))
+ if (!graphene_rect_intersection (&cursor_rect, &logical_monitor_rect,
+ NULL))
continue;
monitors = meta_logical_monitor_get_monitors (logical_monitor);
diff --git a/src/compositor/meta-shaped-texture-private.h b/src/compositor/meta-shaped-texture-private.h
index a86a2bff0..8fb8e3e6d 100644
--- a/src/compositor/meta-shaped-texture-private.h
+++ b/src/compositor/meta-shaped-texture-private.h
@@ -45,7 +45,7 @@ cairo_region_t * meta_shaped_texture_get_opaque_region (MetaShapedTexture *stex)
void meta_shaped_texture_set_transform (MetaShapedTexture *stex,
MetaMonitorTransform transform);
void meta_shaped_texture_set_viewport_src_rect (MetaShapedTexture *stex,
- ClutterRect *src_rect);
+ graphene_rect_t *src_rect);
void meta_shaped_texture_reset_viewport_src_rect (MetaShapedTexture *stex);
void meta_shaped_texture_set_viewport_dst_size (MetaShapedTexture *stex,
int dst_width,
diff --git a/src/compositor/meta-shaped-texture.c b/src/compositor/meta-shaped-texture.c
index f3dbf074f..76264a06c 100644
--- a/src/compositor/meta-shaped-texture.c
+++ b/src/compositor/meta-shaped-texture.c
@@ -108,7 +108,7 @@ struct _MetaShapedTexture
gboolean size_invalid;
MetaMonitorTransform transform;
gboolean has_viewport_src_rect;
- ClutterRect viewport_src_rect;
+ graphene_rect_t viewport_src_rect;
gboolean has_viewport_dst_size;
int viewport_dst_width;
int viewport_dst_height;
@@ -996,8 +996,8 @@ meta_shaped_texture_update_area (MetaShapedTexture *stex,
if (stex->has_viewport_src_rect || stex->has_viewport_dst_size)
{
- ClutterRect viewport;
- ClutterRect inverted_viewport;
+ graphene_rect_t viewport;
+ graphene_rect_t inverted_viewport;
double tex_scale;
float dst_width;
float dst_height;
@@ -1012,7 +1012,7 @@ meta_shaped_texture_update_area (MetaShapedTexture *stex,
}
else
{
- viewport = (ClutterRect) {
+ viewport = (graphene_rect_t) {
.origin.x = 0,
.origin.y = 0,
.size.width = stex->tex_width * tex_scale,
@@ -1031,7 +1031,7 @@ meta_shaped_texture_update_area (MetaShapedTexture *stex,
dst_height = (float) stex->tex_height * tex_scale;
}
- inverted_viewport = (ClutterRect) {
+ inverted_viewport = (graphene_rect_t) {
.origin.x = -((viewport.origin.x * (dst_width / viewport.size.width)) / tex_scale),
.origin.y = -((viewport.origin.y * (dst_height / viewport.size.height)) / tex_scale),
.size.width = dst_width,
@@ -1203,7 +1203,7 @@ meta_shaped_texture_set_transform (MetaShapedTexture *stex,
void
meta_shaped_texture_set_viewport_src_rect (MetaShapedTexture *stex,
- ClutterRect *src_rect)
+ graphene_rect_t *src_rect)
{
if (!stex->has_viewport_src_rect ||
stex->viewport_src_rect.origin.x != src_rect->origin.x ||
diff --git a/src/compositor/meta-surface-actor.c b/src/compositor/meta-surface-actor.c
index fb2776000..da15af778 100644
--- a/src/compositor/meta-surface-actor.c
+++ b/src/compositor/meta-surface-actor.c
@@ -421,8 +421,8 @@ meta_surface_actor_set_transform (MetaSurfaceActor *self,
}
void
-meta_surface_actor_set_viewport_src_rect (MetaSurfaceActor *self,
- ClutterRect *src_rect)
+meta_surface_actor_set_viewport_src_rect (MetaSurfaceActor *self,
+ graphene_rect_t *src_rect)
{
MetaSurfaceActorPrivate *priv =
meta_surface_actor_get_instance_private (self);
diff --git a/src/compositor/meta-surface-actor.h b/src/compositor/meta-surface-actor.h
index 1cffcf99c..08f7aea34 100644
--- a/src/compositor/meta-surface-actor.h
+++ b/src/compositor/meta-surface-actor.h
@@ -65,8 +65,8 @@ gboolean meta_surface_actor_is_unredirected (MetaSurfaceActor *actor);
void meta_surface_actor_set_transform (MetaSurfaceActor *self,
MetaMonitorTransform transform);
-void meta_surface_actor_set_viewport_src_rect (MetaSurfaceActor *self,
- ClutterRect *src_rect);
+void meta_surface_actor_set_viewport_src_rect (MetaSurfaceActor *self,
+ graphene_rect_t *src_rect);
void meta_surface_actor_reset_viewport_src_rect (MetaSurfaceActor *self);
void meta_surface_actor_set_viewport_dst_size (MetaSurfaceActor *self,
int dst_width,
diff --git a/src/compositor/region-utils.c b/src/compositor/region-utils.c
index 752af85c5..081f8a906 100644
--- a/src/compositor/region-utils.c
+++ b/src/compositor/region-utils.c
@@ -410,10 +410,10 @@ meta_region_transform (cairo_region_t *region,
}
cairo_region_t *
-meta_region_crop_and_scale (cairo_region_t *region,
- ClutterRect *src_rect,
- int dst_width,
- int dst_height)
+meta_region_crop_and_scale (cairo_region_t *region,
+ graphene_rect_t *src_rect,
+ int dst_width,
+ int dst_height)
{
int n_rects, i;
cairo_rectangle_int_t *rects;
diff --git a/src/compositor/region-utils.h b/src/compositor/region-utils.h
index 84e4d83bc..745021b5b 100644
--- a/src/compositor/region-utils.h
+++ b/src/compositor/region-utils.h
@@ -111,9 +111,9 @@ cairo_region_t * meta_region_transform (cairo_region_t *region,
int width,
int height);
-cairo_region_t * meta_region_crop_and_scale (cairo_region_t *region,
- ClutterRect *src_rect,
- int dst_width,
- int dst_height);
+cairo_region_t * meta_region_crop_and_scale (cairo_region_t *region,
+ graphene_rect_t *src_rect,
+ int dst_width,
+ int dst_height);
#endif /* __META_REGION_UTILS_H__ */
diff --git a/src/core/boxes-private.h b/src/core/boxes-private.h
index d80cdacd3..f9846ae63 100644
--- a/src/core/boxes-private.h
+++ b/src/core/boxes-private.h
@@ -252,10 +252,10 @@ void meta_rectangle_scale_double (const MetaRectangle *rect,
MetaRoundingStrategy rounding_strategy,
MetaRectangle *dest);
-static inline ClutterRect
+static inline graphene_rect_t
meta_rectangle_to_clutter_rect (MetaRectangle *rect)
{
- return (ClutterRect) {
+ return (graphene_rect_t) {
.origin = {
.x = rect->x,
.y = rect->y
@@ -275,7 +275,7 @@ void meta_rectangle_transform (const MetaRectangle *rect,
MetaRectangle *dest);
void meta_rectangle_crop_and_scale (const MetaRectangle *rect,
- ClutterRect *src_rect,
+ graphene_rect_t *src_rect,
int dst_width,
int dst_height,
MetaRectangle *dest);
diff --git a/src/core/boxes.c b/src/core/boxes.c
index 938ec51e9..eb9f9721c 100644
--- a/src/core/boxes.c
+++ b/src/core/boxes.c
@@ -2153,7 +2153,7 @@ meta_rectangle_transform (const MetaRectangle *rect,
void
meta_rectangle_crop_and_scale (const MetaRectangle *rect,
- ClutterRect *src_rect,
+ graphene_rect_t *src_rect,
int dst_width,
int dst_height,
MetaRectangle *dest)
diff --git a/src/core/display.c b/src/core/display.c
index 2329e706d..00f78efff 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -1448,7 +1448,7 @@ find_highest_logical_monitor_scale (MetaBackend *backend,
meta_backend_get_monitor_manager (backend);
MetaCursorRenderer *cursor_renderer =
meta_backend_get_cursor_renderer (backend);
- ClutterRect cursor_rect;
+ graphene_rect_t cursor_rect;
GList *logical_monitors;
GList *l;
float highest_scale = 0.0;
@@ -1461,12 +1461,12 @@ find_highest_logical_monitor_scale (MetaBackend *backend,
for (l = logical_monitors; l; l = l->next)
{
MetaLogicalMonitor *logical_monitor = l->data;
- ClutterRect logical_monitor_rect =
+ graphene_rect_t logical_monitor_rect =
meta_rectangle_to_clutter_rect (&logical_monitor->rect);
- if (!clutter_rect_intersection (&cursor_rect,
- &logical_monitor_rect,
- NULL))
+ if (!graphene_rect_intersection (&cursor_rect,
+ &logical_monitor_rect,
+ NULL))
continue;
highest_scale = MAX (highest_scale, logical_monitor->scale);
diff --git a/src/wayland/meta-wayland-cursor-surface.c b/src/wayland/meta-wayland-cursor-surface.c
index f1435f1ad..4ca2db695 100644
--- a/src/wayland/meta-wayland-cursor-surface.c
+++ b/src/wayland/meta-wayland-cursor-surface.c
@@ -186,14 +186,14 @@ meta_wayland_cursor_surface_is_on_logical_monitor (MetaWaylandSurfaceRole *role,
MetaWaylandCursorSurfacePrivate *priv =
meta_wayland_cursor_surface_get_instance_private (cursor_surface);
graphene_point_t point;
- ClutterRect logical_monitor_rect;
+ graphene_rect_t logical_monitor_rect;
logical_monitor_rect =
meta_rectangle_to_clutter_rect (&logical_monitor->rect);
point = meta_cursor_renderer_get_position (priv->cursor_renderer);
- return clutter_rect_contains_point (&logical_monitor_rect, &point);
+ return graphene_rect_contains_point (&logical_monitor_rect, &point);
}
static void
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index b50fb2096..e16bb9027 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -272,7 +272,7 @@ surface_process_damage (MetaWaylandSurface *surface,
cairo_region_t *scaled_region;
cairo_region_t *transformed_region;
cairo_region_t *viewport_region;
- ClutterRect src_rect;
+ graphene_rect_t src_rect;
MetaSurfaceActor *actor;
/* If the client destroyed the buffer it attached before committing, but
@@ -301,7 +301,7 @@ surface_process_damage (MetaWaylandSurface *surface,
scaled_region = meta_region_scale (surface_region, surface->scale);
if (surface->viewport.has_src_rect)
{
- src_rect = (ClutterRect) {
+ src_rect = (graphene_rect_t) {
.origin.x = surface->viewport.src_rect.origin.x * surface->scale,
.origin.y = surface->viewport.src_rect.origin.y * surface->scale,
.size.width = surface->viewport.src_rect.size.width * surface->scale,
@@ -310,7 +310,7 @@ surface_process_damage (MetaWaylandSurface *surface,
}
else
{
- src_rect = (ClutterRect) {
+ src_rect = (graphene_rect_t) {
.size.width = surface_rect.width * surface->scale,
.size.height = surface_rect.height * surface->scale,
};
diff --git a/src/wayland/meta-wayland-surface.h b/src/wayland/meta-wayland-surface.h
index e244a3fdf..277bb0e64 100644
--- a/src/wayland/meta-wayland-surface.h
+++ b/src/wayland/meta-wayland-surface.h
@@ -110,7 +110,7 @@ struct _MetaWaylandPendingState
gboolean has_new_buffer_transform;
MetaMonitorTransform buffer_transform;
gboolean has_new_viewport_src_rect;
- ClutterRect viewport_src_rect;
+ graphene_rect_t viewport_src_rect;
gboolean has_new_viewport_dst_size;
int viewport_dst_width;
int viewport_dst_height;
@@ -211,7 +211,7 @@ struct _MetaWaylandSurface
gulong destroy_handler_id;
gboolean has_src_rect;
- ClutterRect src_rect;
+ graphene_rect_t src_rect;
gboolean has_dst_size;
int dst_width;
diff --git a/src/wayland/meta-wayland-text-input-legacy.c b/src/wayland/meta-wayland-text-input-legacy.c
index ddd2cce80..a40294642 100644
--- a/src/wayland/meta-wayland-text-input-legacy.c
+++ b/src/wayland/meta-wayland-text-input-legacy.c
@@ -475,7 +475,7 @@ text_input_commit_state (struct wl_client *client,
if (text_input->pending_state & META_WAYLAND_PENDING_STATE_INPUT_RECT)
{
- ClutterRect cursor_rect;
+ graphene_rect_t cursor_rect;
float x1, y1, x2, y2;
cairo_rectangle_int_t rect;
@@ -487,7 +487,7 @@ text_input_commit_state (struct wl_client *client,
rect.y + rect.height,
&x2, &y2);
- clutter_rect_init (&cursor_rect, x1, y1, x2 - x1, y2 - y1);
+ graphene_rect_init (&cursor_rect, x1, y1, x2 - x1, y2 - y1);
clutter_input_focus_set_cursor_location (text_input->input_focus,
&cursor_rect);
}
diff --git a/src/wayland/meta-wayland-text-input.c b/src/wayland/meta-wayland-text-input.c
index c87f5a1e8..aec3184f2 100644
--- a/src/wayland/meta-wayland-text-input.c
+++ b/src/wayland/meta-wayland-text-input.c
@@ -529,7 +529,7 @@ text_input_commit_state (struct wl_client *client,
if (text_input->pending_state & META_WAYLAND_PENDING_STATE_INPUT_RECT)
{
- ClutterRect cursor_rect;
+ graphene_rect_t cursor_rect;
float x1, y1, x2, y2;
cairo_rectangle_int_t rect;
@@ -541,7 +541,7 @@ text_input_commit_state (struct wl_client *client,
rect.y + rect.height,
&x2, &y2);
- clutter_rect_init (&cursor_rect, x1, y1, x2 - x1, y2 - y1);
+ graphene_rect_init (&cursor_rect, x1, y1, x2 - x1, y2 - y1);
clutter_input_focus_set_cursor_location (text_input->input_focus,
&cursor_rect);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]