mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 11:32:04 +00:00
2008-06-23 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-actor.c: * clutter/clutter-actor.h: * clutter/clutter-group.c: Remove uneeded (at least for now) paint_area method (#970)
This commit is contained in:
parent
62cc9ec3c9
commit
920687a470
@ -1,3 +1,10 @@
|
||||
2008-06-23 Matthew Allum <mallum@openedhand.com>
|
||||
|
||||
* clutter/clutter-actor.c:
|
||||
* clutter/clutter-actor.h:
|
||||
* clutter/clutter-group.c:
|
||||
Remove uneeded (at least for now) paint_area method (#970)
|
||||
|
||||
2008-06-19 Emmanuele Bassi <ebassi@openedhand.com>
|
||||
|
||||
* clutter/clutter-script.c: Be more explicit about the fact that
|
||||
|
@ -774,20 +774,6 @@ clutter_actor_real_allocate (ClutterActor *self,
|
||||
g_object_thaw_notify (G_OBJECT (self));
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_actor_real_get_paint_area (ClutterActor *self,
|
||||
ClutterActorBox *box)
|
||||
{
|
||||
/* Default implementation is to just return allocation,
|
||||
* i.e. assume the actor draws inside its allocation.
|
||||
*
|
||||
* Note that the virtual get_paint_area method does not
|
||||
* apply the transform; that is done in the wrapper
|
||||
* function.
|
||||
*/
|
||||
*box = self->priv->allocation;
|
||||
}
|
||||
|
||||
/*
|
||||
* Utility functions for manipulating transformation matrix
|
||||
*
|
||||
@ -2924,7 +2910,6 @@ clutter_actor_class_init (ClutterActorClass *klass)
|
||||
klass->get_preferred_width = clutter_actor_real_get_preferred_width;
|
||||
klass->get_preferred_height = clutter_actor_real_get_preferred_height;
|
||||
klass->allocate = clutter_actor_real_allocate;
|
||||
klass->get_paint_area = clutter_actor_real_get_paint_area;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -3388,68 +3373,6 @@ clutter_actor_get_allocation_geometry (ClutterActor *self,
|
||||
geom->height = y2 - geom->y;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_actor_get_paint_area:
|
||||
* @self: A #ClutterActor
|
||||
* @box: the function fills this in with the actor's paint area
|
||||
*
|
||||
* Gets where an actor will be painted, which is generally the union
|
||||
* of the paint boxes of the actor's children, plus anything the actor
|
||||
* draws itself, transformed by the scale factor and anchor point. The
|
||||
* result is a "paint area", i.e. where the actor will actually be
|
||||
* painted.
|
||||
*
|
||||
* The returned #ClutterActorBox is in the coordinates of the actor's
|
||||
* parent, just as an allocation is.
|
||||
*
|
||||
* <note>This function is only valid if the allocation is valid,
|
||||
* which means for the most part only inside a paint() method.</note>
|
||||
*
|
||||
* Since: 0.8
|
||||
*/
|
||||
void
|
||||
clutter_actor_get_paint_area (ClutterActor *self,
|
||||
ClutterActorBox *box)
|
||||
{
|
||||
ClutterActorClass *klass;
|
||||
ClutterActorBox transformed = { 0, };
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
||||
|
||||
klass = CLUTTER_ACTOR_GET_CLASS (self);
|
||||
|
||||
klass->get_paint_area (self, &transformed);
|
||||
|
||||
/* FIXME also do scale and rotation; without these, get_stage_area()
|
||||
* behaviour is the same as query_coords() called in ClutterGroup
|
||||
* in Clutter 0.6.
|
||||
*/
|
||||
#if 0
|
||||
if (clutter_actor_is_scaled (child) ||
|
||||
clutter_actor_is_rotated (child))
|
||||
{
|
||||
ClutterVertex vtx[4];
|
||||
|
||||
clutter_actor_get_allocation_vertices (child, self, vtx);
|
||||
clutter_actor_box_get_from_vertices (vtx, &transformed);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
ClutterUnit anchor_x;
|
||||
ClutterUnit anchor_y;
|
||||
|
||||
clutter_actor_get_anchor_pointu (self, &anchor_x, &anchor_y);
|
||||
|
||||
transformed.x1 -= anchor_x;
|
||||
transformed.x2 -= anchor_x;
|
||||
transformed.y1 -= anchor_y;
|
||||
transformed.y2 -= anchor_y;
|
||||
}
|
||||
|
||||
*box = transformed;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_actor_allocate:
|
||||
* @self: A #ClutterActor
|
||||
|
@ -182,8 +182,6 @@ struct _ClutterActor
|
||||
* clutter_actor_get_preferred_height()
|
||||
* @allocate: virtual function, used when settings the coordinates of an
|
||||
* actor; it is used by clutter_actor_allocate()
|
||||
* @get_paint_area: virtual function, used when querying the untrasformed
|
||||
* bounding box of an actor; it's used by clutter_actor_get_paint_area()
|
||||
* @parent_set: signal class handler for the #ClutterActor::parent-set
|
||||
* @destroy: signal class handler for #ClutterActor::destroy
|
||||
* @pick: virtual function, used to draw an outline of the actor with
|
||||
@ -237,9 +235,6 @@ struct _ClutterActorClass
|
||||
void (* allocate) (ClutterActor *actor,
|
||||
const ClutterActorBox *box,
|
||||
gboolean absolute_origin_changed);
|
||||
void (* get_paint_area) (ClutterActor *actor,
|
||||
ClutterActorBox *box);
|
||||
|
||||
/* event signals */
|
||||
gboolean (* event) (ClutterActor *actor,
|
||||
ClutterEvent *event);
|
||||
@ -315,8 +310,6 @@ void clutter_actor_get_allocation_geometry (ClutterActor
|
||||
void clutter_actor_get_allocation_vertices (ClutterActor *self,
|
||||
ClutterActor *ancestor,
|
||||
ClutterVertex verts[4]);
|
||||
void clutter_actor_get_paint_area (ClutterActor *self,
|
||||
ClutterActorBox *box);
|
||||
|
||||
void clutter_actor_set_geometry (ClutterActor *self,
|
||||
const ClutterGeometry *geometry);
|
||||
|
@ -349,57 +349,6 @@ clutter_group_allocate (ClutterActor *self,
|
||||
clutter_fixed_layout_allocate (priv->children, origin_changed);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_group_get_paint_area (ClutterActor *self,
|
||||
ClutterActorBox *box)
|
||||
{
|
||||
ClutterGroupPrivate *priv = CLUTTER_GROUP (self)->priv;
|
||||
|
||||
/* Our area is the union of all child boxes. */
|
||||
if (!priv->children)
|
||||
{
|
||||
/* Only get our allocation if no children;
|
||||
* if we do have children, we don't want this
|
||||
* because the allocation is based on the children's
|
||||
* untransformed layout, and we want the union of
|
||||
* their transformed boxes (their paint boxes).
|
||||
*/
|
||||
clutter_actor_get_allocation_box (self, box);
|
||||
}
|
||||
else
|
||||
{
|
||||
ClutterActorBox all_box = { 0, }; /* initialize to silence gcc */
|
||||
GList *l;
|
||||
|
||||
for (l = priv->children; l != NULL; l = l->next)
|
||||
{
|
||||
ClutterActor *child = l->data;
|
||||
ClutterActorBox child_box = { 0, };
|
||||
|
||||
clutter_actor_get_paint_area (child, &child_box);
|
||||
|
||||
if (l == priv->children)
|
||||
all_box = child_box;
|
||||
else
|
||||
{
|
||||
if (child_box.x1 < all_box.x1)
|
||||
all_box.x1 = child_box.x1;
|
||||
|
||||
if (child_box.y1 < all_box.y1)
|
||||
all_box.y1 = child_box.y1;
|
||||
|
||||
if (child_box.x2 > all_box.x2)
|
||||
all_box.x2 = child_box.x2;
|
||||
|
||||
if (child_box.y2 > all_box.y2)
|
||||
all_box.y2 = child_box.y2;
|
||||
}
|
||||
}
|
||||
|
||||
*box = all_box;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_group_dispose (GObject *object)
|
||||
{
|
||||
@ -652,7 +601,6 @@ clutter_group_class_init (ClutterGroupClass *klass)
|
||||
actor_class->get_preferred_width = clutter_group_get_preferred_width;
|
||||
actor_class->get_preferred_height = clutter_group_get_preferred_height;
|
||||
actor_class->allocate = clutter_group_allocate;
|
||||
actor_class->get_paint_area = clutter_group_get_paint_area;
|
||||
|
||||
/**
|
||||
* ClutterGroup::add:
|
||||
|
Loading…
Reference in New Issue
Block a user