示例#1
0
static gboolean
st_container_get_paint_volume (ClutterActor *actor,
                               ClutterPaintVolume *volume)
{
  StContainerPrivate *priv = ST_CONTAINER (actor)->priv;
  GList *l;

  if (!CLUTTER_ACTOR_CLASS (st_container_parent_class)->get_paint_volume (actor, volume))
    return FALSE;

  if (!clutter_actor_get_clip_to_allocation (actor))
    {
      /* Based on ClutterGroup/ClutterBox; include the children's
       * paint volumes, since they may paint outside our allocation.
       */
      for (l = priv->children; l != NULL; l = l->next)
        {
          ClutterActor *child = l->data;
          const ClutterPaintVolume *child_volume;

          child_volume = clutter_actor_get_transformed_paint_volume (child, actor);
          if (!child_volume)
            return FALSE;

          clutter_paint_volume_union (volume, child_volume);
        }
    }

  return TRUE;
}
示例#2
0
static gboolean
clutter_group_real_get_paint_volume (ClutterActor       *actor,
                                     ClutterPaintVolume *volume)
{
  ClutterGroupPrivate *priv = CLUTTER_GROUP (actor)->priv;
  GList *l;

  if (priv->children == NULL)
    return TRUE;

  for (l = priv->children; l != NULL; l = l->next)
    {
      ClutterActor *child = l->data;
      const ClutterPaintVolume *child_volume;

      /* This gets the paint volume of the child transformed into the
       * group's coordinate space... */
      child_volume = clutter_actor_get_transformed_paint_volume (child, actor);
      if (!child_volume)
        return FALSE;

      clutter_paint_volume_union (volume, child_volume);
    }

  return TRUE;
}
static gboolean
shell_generic_container_get_paint_volume (ClutterActor *self,
                                          ClutterPaintVolume *volume)
{
  ClutterActorBox paint_box, alloc_box;
  StThemeNode *theme_node;
  ClutterVertex origin;

  /* Setting the paint volume does not make sense when we don't have any allocation */
  if (!clutter_actor_has_allocation (self))
    return FALSE;

  theme_node = st_widget_get_theme_node (ST_WIDGET (self));
  clutter_actor_get_allocation_box (self, &alloc_box);

  st_theme_node_get_paint_box (theme_node, &alloc_box, &paint_box);

  origin.x = paint_box.x1 - alloc_box.x1;
  origin.y = paint_box.y1 - alloc_box.y1;
  origin.z = 0.0f;

  clutter_paint_volume_set_origin (volume, &origin);
  clutter_paint_volume_set_width (volume, paint_box.x2 - paint_box.x1);
  clutter_paint_volume_set_height (volume, paint_box.y2 - paint_box.y1);

  if (!clutter_actor_get_clip_to_allocation (self))
    {
      ClutterActor *child;
      /* Based on ClutterGroup/ClutterBox; include the children's
       * paint volumes, since they may paint outside our allocation.
       */
      for (child = clutter_actor_get_first_child (self);
           child != NULL;
           child = clutter_actor_get_next_sibling (child))
        {
          const ClutterPaintVolume *child_volume;

          if (!CLUTTER_ACTOR_IS_VISIBLE (child))
            continue;

          if (shell_generic_container_get_skip_paint (SHELL_GENERIC_CONTAINER  (self), child))
            continue;

          child_volume = clutter_actor_get_transformed_paint_volume (child, self);
          if (!child_volume)
            return FALSE;

          clutter_paint_volume_union (volume, child_volume);
        }
    }

  return TRUE;
}
示例#4
0
/**
 * clutter_paint_volume_union_box:
 * @pv: a #ClutterPaintVolume
 * @box: a #ClutterActorBox to union to @pv
 *
 * Unions the 2D region represented by @box to a #ClutterPaintVolume.
 *
 * This function is similar to clutter_paint_volume_union(), but it is
 * specific for 2D regions.
 *
 * Since: 1.10
 */
void
clutter_paint_volume_union_box (ClutterPaintVolume    *pv,
                                const ClutterActorBox *box)
{
  ClutterPaintVolume volume;
  ClutterVertex origin;

  g_return_if_fail (pv != NULL);
  g_return_if_fail (box != NULL);

  _clutter_paint_volume_init_static (&volume, pv->actor);

  origin.x = box->x1;
  origin.y = box->y1;
  origin.z = 0.f;
  clutter_paint_volume_set_origin (&volume, &origin);
  clutter_paint_volume_set_width (&volume, box->x2 - box->x1);
  clutter_paint_volume_set_height (&volume, box->y2 - box->y1);

  clutter_paint_volume_union (pv, &volume);

  clutter_paint_volume_free (&volume);
}
示例#5
0
/* Adapted from clutter_actor_update_default_paint_volume() */
static gboolean
meta_window_group_get_paint_volume (ClutterActor       *self,
                                    ClutterPaintVolume *volume)
{
  ClutterActorIter iter;
  ClutterActor *child;

  clutter_actor_iter_init (&iter, self);
  while (clutter_actor_iter_next (&iter, &child))
    {
      const ClutterPaintVolume *child_volume;

      if (!CLUTTER_ACTOR_IS_MAPPED (child))
        continue;

      child_volume = clutter_actor_get_transformed_paint_volume (child, self);
      if (child_volume == NULL)
        return FALSE;

      clutter_paint_volume_union (volume, child_volume);
    }

  return TRUE;
}