本文整理汇总了C++中CLUTTER_ACTOR_IS_VISIBLE函数的典型用法代码示例。如果您正苦于以下问题:C++ CLUTTER_ACTOR_IS_VISIBLE函数的具体用法?C++ CLUTTER_ACTOR_IS_VISIBLE怎么用?C++ CLUTTER_ACTOR_IS_VISIBLE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CLUTTER_ACTOR_IS_VISIBLE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: actor_realize_not_recursive
static void
actor_realize_not_recursive (void)
{
ClutterActor *actor, *group;
ClutterActor *stage;
stage = clutter_test_get_stage ();
clutter_actor_show (stage);
group = clutter_actor_new ();
actor = clutter_actor_new ();
clutter_actor_hide (group); /* don't show, so won't map */
clutter_actor_hide (actor); /* don't show, so won't map */
g_assert (!(CLUTTER_ACTOR_IS_REALIZED (group)));
g_assert (!(CLUTTER_ACTOR_IS_REALIZED (actor)));
clutter_actor_add_child (stage, group);
clutter_actor_add_child (group, actor);
clutter_actor_realize (group);
g_assert (CLUTTER_ACTOR_IS_REALIZED (group));
g_assert (!(CLUTTER_ACTOR_IS_MAPPED (group)));
g_assert (!(CLUTTER_ACTOR_IS_VISIBLE (group)));
/* realizing group did not realize the child */
g_assert (!CLUTTER_ACTOR_IS_REALIZED (actor));
g_assert (!(CLUTTER_ACTOR_IS_MAPPED (actor)));
g_assert (!(CLUTTER_ACTOR_IS_VISIBLE (actor)));
}
示例2: mx_scroll_view_allocate
static void
mx_scroll_view_allocate (ClutterActor *actor,
const ClutterActorBox *box,
ClutterAllocationFlags flags)
{
MxPadding padding;
ClutterActorBox child_box;
gfloat avail_width, avail_height, sb_width, sb_height;
MxScrollViewPrivate *priv = MX_SCROLL_VIEW (actor)->priv;
CLUTTER_ACTOR_CLASS (mx_scroll_view_parent_class)->
allocate (actor, box, flags);
mx_widget_get_padding (MX_WIDGET (actor), &padding);
avail_width = (box->x2 - box->x1) - padding.left - padding.right;
avail_height = (box->y2 - box->y1) - padding.top - padding.bottom;
sb_width = priv->scrollbar_width;
sb_height = priv->scrollbar_height;
if (!CLUTTER_ACTOR_IS_VISIBLE (priv->vscroll))
sb_width = 0;
if (!CLUTTER_ACTOR_IS_VISIBLE (priv->hscroll))
sb_height = 0;
/* Vertical scrollbar */
if (CLUTTER_ACTOR_IS_VISIBLE (priv->vscroll))
{
child_box.x1 = avail_width - sb_width;
child_box.y1 = padding.top;
child_box.x2 = avail_width;
child_box.y2 = child_box.y1 + avail_height - sb_height;
clutter_actor_allocate (priv->vscroll, &child_box, flags);
}
/* Horizontal scrollbar */
if (CLUTTER_ACTOR_IS_VISIBLE (priv->hscroll))
{
child_box.x1 = padding.left;
child_box.x2 = child_box.x1 + avail_width - sb_width;
child_box.y1 = avail_height - sb_height;
child_box.y2 = avail_height;
clutter_actor_allocate (priv->hscroll, &child_box, flags);
}
/* Child */
child_box.x1 = padding.left;
child_box.x2 = avail_width - sb_width;
child_box.y1 = padding.top;
child_box.y2 = avail_height - sb_height;
if (priv->child)
clutter_actor_allocate (priv->child, &child_box, flags);
}
示例3: mex_info_bar_dialog_visible
gboolean mex_info_bar_dialog_visible (MexInfoBar *self)
{
MexInfoBarPrivate *priv = self->priv;
return (CLUTTER_ACTOR_IS_VISIBLE (priv->power_dialog)
|| CLUTTER_ACTOR_IS_VISIBLE (priv->settings_dialog));
}
示例4: tidy_scroll_view_paint
static void
tidy_scroll_view_paint (ClutterActor *actor)
{
TidyScrollViewPrivate *priv = TIDY_SCROLL_VIEW (actor)->priv;
if (priv->child && CLUTTER_ACTOR_IS_VISIBLE (priv->child))
clutter_actor_paint (priv->child);
if (CLUTTER_ACTOR_IS_VISIBLE (priv->hscroll))
clutter_actor_paint (priv->hscroll);
if (CLUTTER_ACTOR_IS_VISIBLE (priv->vscroll))
clutter_actor_paint (priv->vscroll);
}
示例5: st_scroll_view_paint
static void
st_scroll_view_paint (ClutterActor *actor)
{
StScrollViewPrivate *priv = ST_SCROLL_VIEW (actor)->priv;
/* StBin will paint the child */
CLUTTER_ACTOR_CLASS (st_scroll_view_parent_class)->paint (actor);
/* paint our custom children */
if (priv->hscrollbar_visible && CLUTTER_ACTOR_IS_VISIBLE (priv->hscroll))
clutter_actor_paint (priv->hscroll);
if (priv->vscrollbar_visible && CLUTTER_ACTOR_IS_VISIBLE (priv->vscroll))
clutter_actor_paint (priv->vscroll);
}
示例6: _close_dialog_cb
static gboolean
_close_dialog_cb (gpointer unused, MexInfoBar *self)
{
MexInfoBarPrivate *priv = self->priv;
if (CLUTTER_ACTOR_IS_VISIBLE (priv->power_dialog))
clutter_actor_hide (priv->power_dialog);
if (CLUTTER_ACTOR_IS_VISIBLE (priv->settings_dialog))
clutter_actor_hide (priv->settings_dialog);
mex_push_focus (MX_FOCUSABLE (self));
return FALSE;
}
示例7: mx_scroll_view_pick
static void
mx_scroll_view_pick (ClutterActor *actor,
const ClutterColor *color)
{
MxScrollViewPrivate *priv = MX_SCROLL_VIEW (actor)->priv;
/* Chain up so we get a bounding box pained (if we are reactive) */
CLUTTER_ACTOR_CLASS (mx_scroll_view_parent_class)->pick (actor, color);
/* paint our custom children */
if (CLUTTER_ACTOR_IS_VISIBLE (priv->hscroll))
clutter_actor_paint (priv->hscroll);
if (CLUTTER_ACTOR_IS_VISIBLE (priv->vscroll))
clutter_actor_paint (priv->vscroll);
}
示例8: show_tile_preview
void
show_tile_preview (MetaPlugin *plugin,
MetaWindow *window,
MetaRectangle *tile_rect,
int tile_monitor_number)
{
MetaScreen *screen = meta_plugin_get_screen (plugin);
ScreenTilePreview *preview = get_screen_tile_preview (screen);
ClutterActor *window_actor;
if (CLUTTER_ACTOR_IS_VISIBLE (preview->actor)
&& preview->tile_rect.x == tile_rect->x
&& preview->tile_rect.y == tile_rect->y
&& preview->tile_rect.width == tile_rect->width
&& preview->tile_rect.height == tile_rect->height)
return; /* nothing to do */
clutter_actor_set_position (preview->actor, tile_rect->x, tile_rect->y);
clutter_actor_set_size (preview->actor, tile_rect->width, tile_rect->height);
clutter_actor_show (preview->actor);
window_actor = CLUTTER_ACTOR (meta_window_get_compositor_private (window));
clutter_actor_lower (preview->actor, window_actor);
preview->tile_rect = *tile_rect;
}
示例9: mx_notebook_allocate
static void
mx_notebook_allocate (ClutterActor *actor,
const ClutterActorBox *box,
ClutterAllocationFlags flags)
{
MxNotebookPrivate *priv = MX_NOTEBOOK (actor)->priv;
GList *l;
MxPadding padding;
ClutterActorBox childbox;
CLUTTER_ACTOR_CLASS (mx_notebook_parent_class)->allocate (actor, box, flags);
mx_widget_get_padding (MX_WIDGET (actor), &padding);
childbox.x1 = 0 + padding.left;
childbox.x2 = box->x2 - box->x1 - padding.right;
childbox.y1 = 0 + padding.top;
childbox.y2 = box->y2 - box->y1 - padding.bottom;
for (l = priv->children; l; l = l->next)
{
ClutterActor *child;
child = CLUTTER_ACTOR (l->data);
if (CLUTTER_ACTOR_IS_VISIBLE (l->data))
clutter_actor_allocate (child, &childbox, flags);
}
}
示例10: test_realized
void
test_realized (TestConformSimpleFixture *fixture,
gconstpointer data)
{
ClutterActor *actor;
ClutterActor *stage;
stage = clutter_stage_get_default ();
actor = clutter_rectangle_new ();
g_assert (!(CLUTTER_ACTOR_IS_REALIZED (actor)));
clutter_actor_hide (actor); /* don't show, so won't map */
clutter_container_add_actor (CLUTTER_CONTAINER (stage),
actor);
clutter_actor_realize (actor);
g_assert (CLUTTER_ACTOR_IS_REALIZED (actor));
g_assert (!(CLUTTER_ACTOR_IS_MAPPED (actor)));
g_assert (!(CLUTTER_ACTOR_IS_VISIBLE (actor)));
clutter_actor_destroy (actor);
}
示例11: st_container_remove
static void
st_container_remove (ClutterContainer *container,
ClutterActor *actor)
{
StContainerPrivate *priv = ST_CONTAINER (container)->priv;
g_object_ref (actor);
priv->children = g_list_remove (priv->children, actor);
clutter_actor_unparent (actor);
/* queue a relayout, to get the correct positioning inside
* the ::actor-removed signal handlers
*/
clutter_actor_queue_relayout (CLUTTER_ACTOR (container));
/* at this point, the actor passed to the "actor-removed" signal
* handlers is not parented anymore to the container but since we
* are holding a reference on it, it's still valid
*/
g_signal_emit_by_name (container, "actor-removed", actor);
st_container_update_pseudo_classes (ST_CONTAINER (container));
if (CLUTTER_ACTOR_IS_VISIBLE (container))
clutter_actor_queue_redraw (CLUTTER_ACTOR (container));
g_object_unref (actor);
}
示例12: mx_menu_event
static gboolean
mx_menu_event (ClutterActor *actor,
ClutterEvent *event)
{
/* We swallow mouse events so that they don't fall through to whatever's
* beneath us.
*/
switch (event->type)
{
case CLUTTER_MOTION:
case CLUTTER_BUTTON_PRESS:
case CLUTTER_BUTTON_RELEASE:
case CLUTTER_SCROLL:
return TRUE;
case CLUTTER_KEY_PRESS:
case CLUTTER_KEY_RELEASE:
/* hide the menu if the escape key was pressed */
if (((ClutterKeyEvent*) event)->keyval == CLUTTER_KEY_Escape
&& CLUTTER_ACTOR_IS_VISIBLE (actor))
{
mx_menu_close (actor);
}
default:
return FALSE;
}
}
示例13: mx_stack_paint_children
static void
mx_stack_paint_children (ClutterActor *actor)
{
MxStackPrivate *priv = MX_STACK (actor)->priv;
GList *c;
for (c = priv->children; c; c = c->next)
{
ClutterActor *child = c->data;
gboolean crop;
if (!CLUTTER_ACTOR_IS_VISIBLE (child))
continue;
clutter_container_child_get (CLUTTER_CONTAINER (actor),
child,
"crop", &crop,
NULL);
if (crop)
{
/* clip */
cogl_clip_push_rectangle (priv->allocation.x1,
priv->allocation.y1,
priv->allocation.x2,
priv->allocation.y2);
clutter_actor_paint (c->data);
cogl_clip_pop ();
}
else
clutter_actor_paint (c->data);
}
}
示例14: _xfdashboard_viewpad_update_scrollbars
/* Allocation of a view changed */
static void _xfdashboard_viewpad_update_scrollbars(XfdashboardViewpad *self)
{
XfdashboardViewpadPrivate *priv;
gfloat w, h;
g_return_if_fail(XFDASHBOARD_IS_VIEWPAD(self));
priv=self->priv;
/* Set range of scroll bar to width and height of active view
* But we need to check for nan-values here - I do not get rid of it :(
*/
if(priv->activeView) clutter_actor_get_size(CLUTTER_ACTOR(priv->activeView), &w, &h);
else w=h=1.0f;
xfdashboard_scrollbar_set_range(XFDASHBOARD_SCROLLBAR(priv->hScrollbar), isnan(w)==0 ? w : 0.0f);
xfdashboard_scrollbar_set_range(XFDASHBOARD_SCROLLBAR(priv->vScrollbar), isnan(h)==0 ? h : 0.0f);
/* If any scroll bar policy is automatic then reallocate the
* same allocation again in an unkindly way to force a recalculation
* if scroll bars needed to shown (or hidden what is unlikely)
*/
if(CLUTTER_ACTOR_IS_VISIBLE(self) &&
(priv->hScrollbarPolicy==XFDASHBOARD_POLICY_AUTOMATIC ||
priv->vScrollbarPolicy==XFDASHBOARD_POLICY_AUTOMATIC))
{
ClutterActorBox box;
clutter_actor_get_allocation_box(CLUTTER_ACTOR(self), &box);
_xfdashboard_viewpad_allocate(CLUTTER_ACTOR(self), &box, CLUTTER_DELEGATE_LAYOUT);
}
}
示例15: glide_slide_button_drawing_area_expose
static gboolean
glide_slide_button_drawing_area_expose (GtkWidget *drawing_area,
GdkEventExpose *event,
gpointer user_data)
{
GlideSlideButton *b = (GlideSlideButton *)user_data;
cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (drawing_area));
gfloat width, height;
clutter_actor_get_size (CLUTTER_ACTOR (b->priv->slide), &width, &height);
cairo_save (cr);
cairo_scale (cr, 80.0/width, 60.0/height);
glide_actor_print (GLIDE_ACTOR (b->priv->slide), cr);
cairo_restore (cr);
if (CLUTTER_ACTOR_IS_VISIBLE (b->priv->slide))
{
glide_cairo_set_fg_color (cr, drawing_area, GTK_STATE_NORMAL);
cairo_set_line_width (cr, 3);
cairo_rectangle (cr, 0, 0, 80, 60);
cairo_stroke (cr);
}
cairo_destroy (cr);
return FALSE;
}