2006-07-06 Emmanuele Bassi <ebassi@openedhand.com>
+ * clutter/clutter-actor.h:
+ * clutter/clutter-actor.c:
+
+ (clutter_actor_class_init), (clutter_actor_set_property),
+ (clutter_actor_get_property): Add the "clip" and "has-clip"
+ properties.
+
+ (clutter_actor_set_clip), (clutter_actor_remove_clip): Emit
+ the notification for the changed properties.
+
+ (clutter_actor_has_clip): Simple accessor to the "has-clip"
+ property.
+
+2006-07-06 Emmanuele Bassi <ebassi@openedhand.com>
+
Big rework of the actor management semantics: now ClutterActor
objects behave like GtkObjects - that is they have an initial
"floating" reference that gets "sunk" when they are added to
else
clutter_actor_hide (actor);
break;
+ case PROP_CLIP:
+ {
+ ClutterGeometry *geom = g_value_get_boxed (value);
+
+ clutter_actor_set_clip (actor,
+ geom->x, geom->y,
+ geom->width, geom->height);
+ }
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
g_value_set_boolean (value,
(CLUTTER_ACTOR_IS_VISIBLE (actor) != FALSE));
break;
+ case PROP_HAS_CLIP:
+ g_value_set_boolean (value, priv->has_clip);
+ break;
+ case PROP_CLIP:
+ g_value_set_boxed (value, &(priv->clip));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
"Visible",
"Whether the actor is visible or not",
FALSE,
- G_PARAM_READABLE));
-
+ G_PARAM_READWRITE));
+ g_object_class_install_property (object_class, PROP_HAS_CLIP,
+ g_param_spec_boolean ("has-clip",
+ "Has Clip",
+ "Whether the actor has a clip set or not",
+ FALSE,
+ G_PARAM_READABLE));
+ g_object_class_install_property (object_class, PROP_CLIP,
+ g_param_spec_boxed ("clip",
+ "Clip",
+ "The clip region for the actor",
+ CLUTTER_TYPE_GEOMETRY,
+ G_PARAM_READWRITE));
+
actor_signals[DESTROY] =
g_signal_new ("destroy",
G_TYPE_FROM_CLASS (object_class),
*/
void
clutter_actor_set_clip (ClutterActor *self,
- gint xoff,
- gint yoff,
- gint width,
- gint height)
+ gint xoff,
+ gint yoff,
+ gint width,
+ gint height)
{
ClutterGeometry *clip;
clip->height = height;
self->priv->has_clip = TRUE;
+
+ g_object_notify (G_OBJECT (self), "has-clip");
+ g_object_notify (G_OBJECT (self), "clip");
}
/**
g_return_if_fail (CLUTTER_IS_ACTOR (self));
self->priv->has_clip = FALSE;
+
+ g_object_notify (G_OBJECT (self), "has-clip");
}
/**
+ * clutter_actor_has_clip:
+ * @self: a #ClutterActor
+ *
+ * Gets whether the actor has a clip set or not.
+ *
+ * Return value: %TRUE if the actor has a clip set.
+ */
+gboolean
+clutter_actor_has_clip (ClutterActor *self)
+{
+ g_return_val_if_fail (CLUTTER_IS_ACTOR (self), FALSE);
+
+ return self->priv->has_clip;
+}
+
+/**
* clutter_actor_set_parent:
* @self: A #ClutterActor
* @parent: A new #ClutterActor parent