static void ntf_overlay_allocate (ClutterActor *actor, const ClutterActorBox *box, ClutterAllocationFlags flags) { NtfOverlayPrivate *priv = NTF_OVERLAY (actor)->priv; ClutterActorClass *klass; gfloat my_width, my_height; ClutterActor *tna = CLUTTER_ACTOR (priv->tray_normal); ClutterActor *tua = CLUTTER_ACTOR (priv->tray_urgent); ClutterActor *lowlight = priv->lowlight; klass = CLUTTER_ACTOR_CLASS (ntf_overlay_parent_class); klass->allocate (actor, box, flags); my_width = box->x2 - box->x1; my_height = box->y2 - box->y1; { ClutterActorBox tray_box; gfloat p_width, p_height, m_width, m_height; clutter_actor_get_preferred_width (tna, -1.0, &m_width, &p_width); clutter_actor_get_preferred_height (tna, p_width, &m_height, &p_height); tray_box.x1 = my_width - p_width; tray_box.y1 = my_height - p_height; tray_box.x2 = tray_box.x1 + p_width; tray_box.y2 = tray_box.y1 + p_height; clutter_actor_allocate (tna, &tray_box, flags); } { ClutterActorBox tray_box; gfloat p_width, p_height, m_width, m_height; clutter_actor_get_preferred_width (tua, -1.0, &m_width, &p_width); clutter_actor_get_preferred_height (tua, p_width, &m_height, &p_height); tray_box.x1 = (gint)((my_width - p_width) / 2.0); tray_box.y1 = (gint)((my_height - p_height) / 2.0); tray_box.x2 = tray_box.x1 + p_width; tray_box.y2 = tray_box.y1 + p_height; clutter_actor_allocate (tua, &tray_box, flags); } { ClutterActorBox lowlight_box; lowlight_box.x1 = 0.0; lowlight_box.y1 = 0.0; lowlight_box.x2 = my_width; lowlight_box.y2 = my_height; clutter_actor_allocate (lowlight, &lowlight_box, flags); } }
static void st_widget_allocate (ClutterActor *actor, const ClutterActorBox *box, ClutterAllocationFlags flags) { StWidget *self = ST_WIDGET (actor); StWidgetPrivate *priv = self->priv; StThemeNode *theme_node; ClutterActorClass *klass; ClutterGeometry area; ClutterVertex in_v, out_v; theme_node = st_widget_get_theme_node (self); klass = CLUTTER_ACTOR_CLASS (st_widget_parent_class); klass->allocate (actor, box, flags); /* update tooltip position */ if (priv->tooltip) { in_v.x = in_v.y = in_v.z = 0; clutter_actor_apply_transform_to_point (actor, &in_v, &out_v); area.x = out_v.x; area.y = out_v.y; in_v.x = box->x2 - box->x1; in_v.y = box->y2 - box->y1; clutter_actor_apply_transform_to_point (actor, &in_v, &out_v); area.width = out_v.x - area.x; area.height = out_v.y - area.y; st_tooltip_set_tip_area (priv->tooltip, &area); } }
static void ntf_tray_allocate (ClutterActor *actor, const ClutterActorBox *box, ClutterAllocationFlags flags) { NtfTrayPrivate *priv = NTF_TRAY (actor)->priv; ClutterActorClass *klass; gfloat m_height = 0.0, p_height = 0.0; gfloat control_height = 0.0; klass = CLUTTER_ACTOR_CLASS (ntf_tray_parent_class); klass->allocate (actor, box, flags); if (priv->control && CLUTTER_ACTOR_IS_MAPPED (priv->control)) { clutter_actor_get_preferred_height (CLUTTER_ACTOR (priv->control), box->x2 - box->x1, NULL, &control_height); } if (priv->notifiers) { ClutterActorBox notifier_box = { 0, }; clutter_actor_get_preferred_height (CLUTTER_ACTOR (priv->notifiers), box->x2 - box->x1, &m_height, &p_height); notifier_box.x2 = box->x2 - box->x1; notifier_box.y2 = p_height; clutter_actor_allocate (CLUTTER_ACTOR (priv->notifiers), ¬ifier_box, flags); } if (priv->control && CLUTTER_ACTOR_IS_MAPPED (priv->control)) { ClutterActorBox control_box; control_box.x1 = 0.0; control_box.y1 = p_height - 30; clutter_actor_get_preferred_height (CLUTTER_ACTOR (priv->control), box->x2 - box->x1, &m_height, &p_height); control_box.x2 = box->x2 - box->x1; control_box.y2 = control_box.y1 + p_height; clutter_actor_allocate (CLUTTER_ACTOR (priv->control), &control_box, flags); } }
static void clutter_box_real_allocate (ClutterActor *actor, const ClutterActorBox *allocation, ClutterAllocationFlags flags) { ClutterBoxPrivate *priv = CLUTTER_BOX (actor)->priv; ClutterActorClass *klass; klass = CLUTTER_ACTOR_CLASS (clutter_box_parent_class); klass->allocate (actor, allocation, flags); clutter_layout_manager_allocate (priv->manager, CLUTTER_CONTAINER (actor), allocation, flags); }
static void champlain_group_real_allocate (ClutterActor *actor, const ClutterActorBox *allocation, ClutterAllocationFlags flags) { ChamplainGroupPrivate *priv = CHAMPLAIN_GROUP (actor)->priv; ClutterActorClass *klass; klass = CLUTTER_ACTOR_CLASS (champlain_group_parent_class); klass->allocate (actor, allocation, flags); if (priv->children == NULL) return; clutter_layout_manager_allocate (priv->layout, CLUTTER_CONTAINER (actor), allocation, flags); }