Пример #1
0
static void
st_scroll_bar_notify_reactive (StScrollBar *self)
{
    StScrollBarPrivate *priv = self->priv;

    gboolean reactive = CLUTTER_ACTOR_IS_REACTIVE (self);

    clutter_actor_set_reactive (CLUTTER_ACTOR (priv->trough), reactive);
    clutter_actor_set_reactive (CLUTTER_ACTOR (priv->handle), reactive);
}
Пример #2
0
/* Default signal handler for "begin" */
static gboolean _xfdashboard_drop_action_class_real_begin(XfdashboardDropAction *self,
															XfdashboardDragAction *inDragAction)
{
	XfdashboardDropActionPrivate		*priv;
	ClutterActorMeta					*actorMeta;

	g_return_val_if_fail(XFDASHBOARD_IS_DROP_ACTION(self), FALSE);
	g_return_val_if_fail(self->priv->actor, FALSE);

	priv=self->priv;
	actorMeta=CLUTTER_ACTOR_META(self);

	/* Return TRUE means we can handle dragged actor on this drop target. This is only
	 * possible if drop target is active, visible and reactive. Otherwise we have to
	 * return FALSE to indicate that we cannot handle dragged actor.
	 */
	return(clutter_actor_meta_get_enabled(actorMeta) &&
			CLUTTER_ACTOR_IS_VISIBLE(priv->actor) &&
			CLUTTER_ACTOR_IS_REACTIVE(priv->actor));
}
Пример #3
0
/* Check if actor can get focus */
static gboolean _xfdashboard_actor_focusable_can_focus(XfdashboardFocusable *inFocusable)
{
	XfdashboardActor			*self;
	XfdashboardActorPrivate		*priv;

	g_return_val_if_fail(XFDASHBOARD_IS_FOCUSABLE(inFocusable), FALSE);
	g_return_val_if_fail(XFDASHBOARD_IS_ACTOR(inFocusable), FALSE);

	self=XFDASHBOARD_ACTOR(inFocusable);
	priv=self->priv;

	/* This actor can only be focused if it is mapped, visibl	e and reactive */
	if(priv->canFocus &&
		CLUTTER_ACTOR_IS_MAPPED(self) &&
		CLUTTER_ACTOR_IS_VISIBLE(self) &&
		CLUTTER_ACTOR_IS_REACTIVE(self))
	{
		return(TRUE);
	}

	/* If we get here this actor does not fulfill the requirements to get focus */
	return(FALSE);
}
Пример #4
0
gboolean actor_is_reactive(ClutterActor* actor)
{
    return CLUTTER_ACTOR_IS_REACTIVE(actor);
}
Пример #5
0
IO_METHOD(IoClutterActor, isReactive) {
  return IOBOOL(self, CLUTTER_ACTOR_IS_REACTIVE(IOCACTOR(self)));
}
Пример #6
0
static void
tidy_scroll_view_request_coords (ClutterActor *actor, ClutterActorBox *box)
{
  TidyPadding padding;
  ClutterActorBox child_box;
  guint xthickness, ythickness;
  ClutterUnit xthicknessu, ythicknessu;
  
  TidyScrollViewPrivate *priv = TIDY_SCROLL_VIEW (actor)->priv;
  
  /* Store box */
  priv->box = *box;

  tidy_actor_get_padding (TIDY_ACTOR (actor), &padding);
  
  tidy_stylable_get (TIDY_STYLABLE (actor),
                     "xthickness", &xthickness,
                     "ythickness", &ythickness,
                     NULL);
  xthicknessu = CLUTTER_ACTOR_IS_VISIBLE (priv->vscroll) ?
    CLUTTER_UNITS_FROM_INT (xthickness) : 0;
  ythicknessu = CLUTTER_ACTOR_IS_VISIBLE (priv->hscroll) ?
    CLUTTER_UNITS_FROM_INT (ythickness) : 0;

  /* Vertical scrollbar */
  child_box.x1 = box->x2 - box->x1 - padding.top;
  child_box.x2 = MAX(0, (box->y2 - box->y1 - ythicknessu)) +
                     child_box.x1 - padding.top - padding.bottom;
  child_box.y1 = padding.right;
  child_box.y2 = MIN(xthicknessu, box->x2 - box->x1) + padding.right;
  
  clutter_actor_request_coords (priv->vscroll, &child_box);

  /* Horizontal scrollbar */
  child_box.x1 = padding.left;
  child_box.x2 = MAX(0, box->x2 - box->x1 - xthicknessu - padding.right);
  child_box.y1 = MAX(0, box->y2 - box->y1 - ythicknessu) - padding.bottom;
  child_box.y2 = box->y2 - box->y1 - padding.bottom;

  clutter_actor_request_coords (priv->hscroll, &child_box);
  
  /* Child */
  child_box.x1 = 0;
  child_box.x2 = box->x2 - box->x1;
  if (CLUTTER_ACTOR_IS_REACTIVE (priv->vscroll))
    child_box.x2 -= xthicknessu;
  child_box.y1 = 0;
  child_box.y2 = box->y2 - box->y1;
  if (CLUTTER_ACTOR_IS_REACTIVE (priv->hscroll))
    child_box.y2 -= ythicknessu;
  
  child_box.x1 += padding.left;
  child_box.x2 -= padding.left + padding.right;
  child_box.y1 += padding.top;
  child_box.y2 -= padding.top + padding.bottom;
  
  /* Store child box */
  priv->child_box = child_box;
  
  if (priv->child)
    {
      clutter_actor_request_coords (priv->child, &child_box);
      clutter_actor_set_clipu (priv->child,
                               priv->child_box.x1,
                               priv->child_box.y1,
                               priv->child_box.x2 - priv->child_box.x1,
                               priv->child_box.y2 - priv->child_box.y1);
    }
  
  CLUTTER_ACTOR_CLASS (tidy_scroll_view_parent_class)->
    request_coords (actor, box);
}