clutter/actor: Remove "allocation-changed" signal

Since we now no have ClutterAllocationFlags, there's no reason anymore
for keeping the "allocation-changed" signal, so remove it.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1245
This commit is contained in:
Jonas Dreßler 2020-05-09 21:44:13 +02:00 committed by verdre
parent 787d9a5a15
commit e50e14af82

View File

@ -1013,7 +1013,6 @@ enum
MOTION_EVENT, MOTION_EVENT,
ENTER_EVENT, ENTER_EVENT,
LEAVE_EVENT, LEAVE_EVENT,
ALLOCATION_CHANGED,
TRANSITIONS_COMPLETED, TRANSITIONS_COMPLETED,
TOUCH_EVENT, TOUCH_EVENT,
TRANSITION_STOPPED, TRANSITION_STOPPED,
@ -2577,14 +2576,13 @@ clutter_actor_notify_if_geometry_changed (ClutterActor *self,
* Return value: %TRUE if the allocation of the #ClutterActor has been * Return value: %TRUE if the allocation of the #ClutterActor has been
* changed, and %FALSE otherwise * changed, and %FALSE otherwise
*/ */
static inline gboolean static inline void
clutter_actor_set_allocation_internal (ClutterActor *self, clutter_actor_set_allocation_internal (ClutterActor *self,
const ClutterActorBox *box) const ClutterActorBox *box)
{ {
ClutterActorPrivate *priv = self->priv; ClutterActorPrivate *priv = self->priv;
GObject *obj; GObject *obj;
gboolean x1_changed, y1_changed, x2_changed, y2_changed; gboolean x1_changed, y1_changed, x2_changed, y2_changed;
gboolean retval;
ClutterActorBox old_alloc = { 0, }; ClutterActorBox old_alloc = { 0, };
obj = G_OBJECT (self); obj = G_OBJECT (self);
@ -2623,17 +2621,11 @@ clutter_actor_set_allocation_internal (ClutterActor *self,
priv->content_box_valid = FALSE; priv->content_box_valid = FALSE;
g_object_notify_by_pspec (obj, obj_props[PROP_CONTENT_BOX]); g_object_notify_by_pspec (obj, obj_props[PROP_CONTENT_BOX]);
} }
retval = TRUE;
} }
else
retval = FALSE;
clutter_actor_notify_if_geometry_changed (self, &old_alloc); clutter_actor_notify_if_geometry_changed (self, &old_alloc);
g_object_thaw_notify (obj); g_object_thaw_notify (obj);
return retval;
} }
static void static void
@ -2641,11 +2633,10 @@ clutter_actor_real_allocate (ClutterActor *self,
const ClutterActorBox *box) const ClutterActorBox *box)
{ {
ClutterActorPrivate *priv = self->priv; ClutterActorPrivate *priv = self->priv;
gboolean changed;
g_object_freeze_notify (G_OBJECT (self)); g_object_freeze_notify (G_OBJECT (self));
changed = clutter_actor_set_allocation_internal (self, box); clutter_actor_set_allocation_internal (self, box);
/* we allocate our children before we notify changes in our geometry, /* we allocate our children before we notify changes in our geometry,
* so that people connecting to properties will be able to get valid * so that people connecting to properties will be able to get valid
@ -2679,14 +2670,6 @@ clutter_actor_real_allocate (ClutterActor *self,
&children_box); &children_box);
} }
if (changed)
{
ClutterActorBox signal_box = priv->allocation;
g_signal_emit (self, actor_signals[ALLOCATION_CHANGED], 0,
&signal_box);
}
g_object_thaw_notify (G_OBJECT (self)); g_object_thaw_notify (G_OBJECT (self));
} }
@ -8536,33 +8519,6 @@ clutter_actor_class_init (ClutterActorClass *klass)
G_TYPE_NONE, 1, G_TYPE_NONE, 1,
CLUTTER_TYPE_PICK_CONTEXT); CLUTTER_TYPE_PICK_CONTEXT);
/**
* ClutterActor::allocation-changed:
* @actor: the #ClutterActor that emitted the signal
* @box: a #ClutterActorBox with the new allocation
*
* The ::allocation-changed signal is emitted when the
* #ClutterActor:allocation property changes. Usually, application
* code should just use the notifications for the :allocation property
* but if you want to track the allocation flags as well, for instance
* to know whether the absolute origin of @actor changed, then you might
* want use this signal instead.
*
* Since: 1.0
*/
actor_signals[ALLOCATION_CHANGED] =
g_signal_new (I_("allocation-changed"),
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL,
_clutter_marshal_VOID__BOXED_FLAGS,
G_TYPE_NONE, 1,
CLUTTER_TYPE_ACTOR_BOX | G_SIGNAL_TYPE_STATIC_SCOPE);
g_signal_set_va_marshaller (actor_signals[ALLOCATION_CHANGED],
G_TYPE_FROM_CLASS (object_class),
_clutter_marshal_VOID__BOXED_FLAGSv);
/** /**
* ClutterActor::transitions-completed: * ClutterActor::transitions-completed:
* @actor: a #ClutterActor * @actor: a #ClutterActor
@ -10271,9 +10227,6 @@ void
clutter_actor_set_allocation (ClutterActor *self, clutter_actor_set_allocation (ClutterActor *self,
const ClutterActorBox *box) const ClutterActorBox *box)
{ {
ClutterActorPrivate *priv;
gboolean changed;
g_return_if_fail (CLUTTER_IS_ACTOR (self)); g_return_if_fail (CLUTTER_IS_ACTOR (self));
g_return_if_fail (box != NULL); g_return_if_fail (box != NULL);
@ -10285,19 +10238,9 @@ clutter_actor_set_allocation (ClutterActor *self,
return; return;
} }
priv = self->priv;
g_object_freeze_notify (G_OBJECT (self)); g_object_freeze_notify (G_OBJECT (self));
changed = clutter_actor_set_allocation_internal (self, box); clutter_actor_set_allocation_internal (self, box);
if (changed)
{
ClutterActorBox signal_box = priv->allocation;
g_signal_emit (self, actor_signals[ALLOCATION_CHANGED], 0,
&signal_box);
}
g_object_thaw_notify (G_OBJECT (self)); g_object_thaw_notify (G_OBJECT (self));
} }