本文整理汇总了C++中CLUTTER_IS_ACTOR函数的典型用法代码示例。如果您正苦于以下问题:C++ CLUTTER_IS_ACTOR函数的具体用法?C++ CLUTTER_IS_ACTOR怎么用?C++ CLUTTER_IS_ACTOR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CLUTTER_IS_ACTOR函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: clarity_cover_destroy
/* composite actors should implement destroy(), and inside their
* implementation destroy any actors they are composed from;
* in this case, we just destroy the child ClutterBox
*/
void clarity_cover_destroy(ClutterActor *self) {
ClarityCoverPrivate *priv = CLARITY_COVER_GET_PRIVATE(self);
if (priv) {
if (CLUTTER_IS_ACTOR(priv->texture)) {
clutter_actor_destroy(priv->texture);
priv->texture = NULL;
}
if (CLUTTER_IS_ACTOR(priv->reflection)) {
clutter_actor_destroy(priv->reflection);
priv->reflection = NULL;
}
if (G_IS_OBJECT(priv->rotateBehaviour))
priv->rotateBehaviour = NULL;
}
/* chain up to destroy() on the parent ClutterActorClass;
* note that we check the parent class has a destroy() implementation
* before calling it
*/
if (CLUTTER_ACTOR_CLASS(clarity_cover_parent_class)->destroy)
CLUTTER_ACTOR_CLASS(clarity_cover_parent_class)->destroy(self);
}
示例2: clutter_box2d_add_weld_joint
ClutterBox2DJoint *
clutter_box2d_add_weld_joint (ClutterBox2D *box2d,
ClutterActor *actor1,
ClutterActor *actor2,
const ClutterVertex *anchor1,
const ClutterVertex *anchor2)
{
ClutterBox2DPrivate *priv;
b2WeldJointDef jd;
g_return_val_if_fail (CLUTTER_IS_BOX2D (box2d), NULL);
g_return_val_if_fail (CLUTTER_IS_ACTOR (actor1), NULL);
g_return_val_if_fail (CLUTTER_IS_ACTOR (actor2), NULL);
g_return_val_if_fail (anchor1 != NULL, NULL);
g_return_val_if_fail (anchor2 != NULL, NULL);
priv = box2d->priv;
clutter_box2d_joint_ensure_bodies (box2d, actor1, actor2);
jd.collideConnected = false;
jd.bodyA = clutter_box2d_get_child (box2d, actor1)->priv->body;
jd.bodyB = clutter_box2d_get_child (box2d, actor2)->priv->body;
if (!jd.bodyA || !jd.bodyB)
return NULL;
jd.localAnchorA = b2Vec2 (anchor1->x * priv->scale_factor,
anchor1->y * priv->scale_factor);
jd.localAnchorB = b2Vec2 (anchor2->x * priv->scale_factor,
anchor2->y * priv->scale_factor);
jd.referenceAngle = jd.bodyB->GetAngle() - jd.bodyA->GetAngle();
return joint_new (box2d, priv->world->CreateJoint (&jd), CLUTTER_BOX2D_JOINT_WELD);
}
示例3: clutter_box2d_add_weld_joint2
ClutterBox2DJoint *
clutter_box2d_add_weld_joint2 (ClutterBox2D *box2d,
ClutterActor *actor1,
ClutterActor *actor2,
const ClutterVertex *anchor)
{
ClutterBox2DPrivate *priv;
b2Body *bodyA, *bodyB;
b2WeldJointDef jd;
g_return_val_if_fail (CLUTTER_IS_BOX2D (box2d), NULL);
g_return_val_if_fail (CLUTTER_IS_ACTOR (actor1), NULL);
g_return_val_if_fail (CLUTTER_IS_ACTOR (actor2), NULL);
g_return_val_if_fail (anchor != NULL, NULL);
priv = box2d->priv;
clutter_box2d_joint_ensure_bodies (box2d, actor1, actor2);
jd.collideConnected = false;
bodyA = clutter_box2d_get_child (box2d, actor1)->priv->body;
bodyB = clutter_box2d_get_child (box2d, actor2)->priv->body;
if (!bodyA || !bodyB)
return NULL;
jd.Initialize (bodyA, bodyB,
b2Vec2 (anchor->x * priv->scale_factor,
anchor->y * priv->scale_factor));
return joint_new (box2d, priv->world->CreateJoint (&jd), CLUTTER_BOX2D_JOINT_WELD);
}
示例4: clutter_box2d_add_pulley_joint
ClutterBox2DJoint *
clutter_box2d_add_pulley_joint (ClutterBox2D *box2d,
ClutterActor *actor1,
ClutterActor *actor2,
const ClutterVertex *anchor1,
const ClutterVertex *anchor2,
const ClutterVertex *ground_anchor1,
const ClutterVertex *ground_anchor2,
gdouble length1,
gdouble length2,
gdouble max_length1,
gdouble max_length2,
gdouble ratio)
{
ClutterBox2DPrivate *priv;
b2PulleyJointDef jd;
g_return_val_if_fail (CLUTTER_IS_BOX2D (box2d), NULL);
g_return_val_if_fail (CLUTTER_IS_ACTOR (actor1), NULL);
g_return_val_if_fail (CLUTTER_IS_ACTOR (actor2), NULL);
g_return_val_if_fail (anchor1 != NULL, NULL);
g_return_val_if_fail (anchor2 != NULL, NULL);
g_return_val_if_fail (ground_anchor1 != NULL, NULL);
g_return_val_if_fail (ground_anchor2 != NULL, NULL);
priv = box2d->priv;
clutter_box2d_joint_ensure_bodies (box2d, actor1, actor2);
jd.collideConnected = false;
jd.bodyA = clutter_box2d_get_child (box2d, actor1)->priv->body;
jd.bodyB = clutter_box2d_get_child (box2d, actor2)->priv->body;
if (!jd.bodyA || !jd.bodyB)
return NULL;
jd.groundAnchorA = b2Vec2 (ground_anchor1->x * priv->scale_factor,
ground_anchor1->y * priv->scale_factor);
jd.groundAnchorB = b2Vec2 (ground_anchor2->x * priv->scale_factor,
ground_anchor2->y * priv->scale_factor);
jd.localAnchorA = b2Vec2 (anchor1->x * priv->scale_factor,
anchor1->y * priv->scale_factor);
jd.localAnchorB = b2Vec2 (anchor2->x * priv->scale_factor,
anchor2->y * priv->scale_factor);
jd.ratio = ratio;
jd.lengthA = length1 * priv->scale_factor;
jd.lengthB = length2 * priv->scale_factor;
jd.maxLengthA = max_length1 * priv->scale_factor;
jd.maxLengthB = max_length2 * priv->scale_factor;
return joint_new (box2d, priv->world->CreateJoint (&jd), CLUTTER_BOX2D_JOINT_PULLEY);
}
示例5: clutter_container_lower_child
/**
* clutter_container_lower_child: (virtual lower)
* @container: a #ClutterContainer
* @actor: the actor to raise
* @sibling: (allow-none): the sibling to lower to, or %NULL to lower
* to the bottom
*
* Lowers @actor to @sibling level, in the depth ordering.
*
* This function calls the #ClutterContainerIface.lower() virtual function,
* which has been deprecated. The default implementation will call
* clutter_actor_set_child_below_sibling().
*
* Since: 0.6
*
* Deprecated: 1.10: Use clutter_actor_set_child_below_sibling() instead.
*/
void
clutter_container_lower_child (ClutterContainer *container,
ClutterActor *actor,
ClutterActor *sibling)
{
ClutterContainerIface *iface;
ClutterActor *self;
g_return_if_fail (CLUTTER_IS_CONTAINER (container));
g_return_if_fail (CLUTTER_IS_ACTOR (actor));
g_return_if_fail (sibling == NULL || CLUTTER_IS_ACTOR (sibling));
if (actor == sibling)
return;
self = CLUTTER_ACTOR (container);
if (clutter_actor_get_parent (actor) != self)
{
g_warning ("Actor of type '%s' is not a child of the container "
"of type '%s'",
g_type_name (G_OBJECT_TYPE (actor)),
g_type_name (G_OBJECT_TYPE (container)));
return;
}
if (sibling != NULL&&
clutter_actor_get_parent (sibling) != self)
{
g_warning ("Actor of type '%s' is not a child of the container "
"of type '%s'",
g_type_name (G_OBJECT_TYPE (sibling)),
g_type_name (G_OBJECT_TYPE (container)));
return;
}
iface = CLUTTER_CONTAINER_GET_IFACE (container);
#ifdef CLUTTER_ENABLE_DEBUG
if (G_UNLIKELY (_clutter_diagnostic_enabled ()))
{
if (iface->lower != container_real_lower)
_clutter_diagnostic_message ("The ClutterContainer::lower() "
"virtual function has been deprecated "
"and it should not be overridden by "
"newly written code");
}
#endif /* CLUTTER_ENABLE_DEBUG */
iface->lower (container, actor, sibling);
}
示例6: clutter_box2d_add_pulley_joint2
ClutterBox2DJoint *
clutter_box2d_add_pulley_joint2 (ClutterBox2D *box2d,
ClutterActor *actor1,
ClutterActor *actor2,
const ClutterVertex *anchor1,
const ClutterVertex *anchor2,
const ClutterVertex *ground_anchor1,
const ClutterVertex *ground_anchor2,
gdouble max_length1,
gdouble max_length2,
gdouble ratio)
{
ClutterBox2DPrivate *priv;
b2Body *bodyA, *bodyB;
b2PulleyJointDef jd;
g_return_val_if_fail (CLUTTER_IS_BOX2D (box2d), NULL);
g_return_val_if_fail (CLUTTER_IS_ACTOR (actor1), NULL);
g_return_val_if_fail (CLUTTER_IS_ACTOR (actor2), NULL);
g_return_val_if_fail (anchor1 != NULL, NULL);
g_return_val_if_fail (anchor2 != NULL, NULL);
g_return_val_if_fail (ground_anchor1 != NULL, NULL);
g_return_val_if_fail (ground_anchor2 != NULL, NULL);
priv = box2d->priv;
clutter_box2d_joint_ensure_bodies (box2d, actor1, actor2);
jd.collideConnected = false;
bodyA = clutter_box2d_get_child (box2d, actor1)->priv->body;
bodyB = clutter_box2d_get_child (box2d, actor2)->priv->body;
if (!bodyA || !bodyB)
return NULL;
jd.Initialize (bodyA, bodyB,
b2Vec2 (ground_anchor1->x * priv->scale_factor,
ground_anchor1->y * priv->scale_factor),
b2Vec2 (ground_anchor2->x * priv->scale_factor,
ground_anchor2->y * priv->scale_factor),
b2Vec2 (anchor1->x * priv->scale_factor,
anchor1->y * priv->scale_factor),
b2Vec2 (anchor2->x * priv->scale_factor,
anchor2->y * priv->scale_factor),
ratio);
return joint_new (box2d, priv->world->CreateJoint (&jd), CLUTTER_BOX2D_JOINT_PULLEY);
}
示例7: _xfdashboard_tooltip_action_on_leave_event
/* Pointer left actor with tooltip */
static gboolean _xfdashboard_tooltip_action_on_leave_event(XfdashboardTooltipAction *self,
ClutterEvent *inEvent,
gpointer inUserData)
{
XfdashboardTooltipActionPrivate *priv;
ClutterActor *actor;
ClutterActor *stage;
ClutterActor *actorMeta;
g_return_val_if_fail(XFDASHBOARD_IS_TOOLTIP_ACTION(self), CLUTTER_EVENT_PROPAGATE);
g_return_val_if_fail(CLUTTER_IS_ACTOR(inUserData), CLUTTER_EVENT_PROPAGATE);
priv=self->priv;
actor=CLUTTER_ACTOR(inUserData);
/* Get current actor this action belongs to */
actorMeta=clutter_actor_meta_get_actor(CLUTTER_ACTOR_META(self));
/* Release all sources and signal handler (except for enter event) */
if(priv->motionSignalID!=0)
{
if(actorMeta) g_signal_handler_disconnect(actorMeta, priv->motionSignalID);
priv->motionSignalID=0;
}
if(priv->leaveSignalID!=0)
{
if(actorMeta) g_signal_handler_disconnect(actorMeta, priv->leaveSignalID);
priv->leaveSignalID=0;
}
if(priv->captureSignalID)
{
if(priv->captureSignalActor) g_signal_handler_disconnect(priv->captureSignalActor, priv->captureSignalID);
priv->captureSignalActor=NULL;
priv->captureSignalID=0;
}
if(priv->timeoutSourceID!=0)
{
g_source_remove(priv->timeoutSourceID);
priv->timeoutSourceID=0;
}
/* Clear last actor we remembered if it is pointing to this actor */
if(_xfdashboard_tooltip_last_event_actor==actor)
{
_xfdashboard_tooltip_last_event_actor=NULL;
}
/* Hide tooltip now */
stage=clutter_actor_get_stage(actor);
if(stage && XFDASHBOARD_IS_STAGE(stage))
{
g_signal_emit_by_name(stage, "hide-tooltip", self, NULL);
priv->isVisible=FALSE;
}
return(CLUTTER_EVENT_PROPAGATE);
}
示例8: _xfdashboard_tooltip_action_on_enter_event
/* Pointer entered an actor with tooltip */
static gboolean _xfdashboard_tooltip_action_on_enter_event(XfdashboardTooltipAction *self,
ClutterEvent *inEvent,
gpointer inUserData)
{
XfdashboardTooltipActionPrivate *priv;
ClutterActor *actor;
g_return_val_if_fail(XFDASHBOARD_IS_TOOLTIP_ACTION(self), CLUTTER_EVENT_PROPAGATE);
g_return_val_if_fail(CLUTTER_IS_ACTOR(inUserData), CLUTTER_EVENT_PROPAGATE);
priv=self->priv;
actor=CLUTTER_ACTOR(inUserData);
/* Remove any timeout source we have added for this actor */
if(priv->timeoutSourceID!=0)
{
g_source_remove(priv->timeoutSourceID);
priv->timeoutSourceID=0;
}
/* Connect signals */
g_warn_if_fail(priv->motionSignalID==0);
priv->motionSignalID=g_signal_connect_swapped(actor,
"motion-event",
G_CALLBACK(_xfdashboard_tooltip_action_on_motion_event),
self);
g_warn_if_fail(priv->leaveSignalID==0);
priv->leaveSignalID=g_signal_connect_swapped(actor,
"leave-event",
G_CALLBACK(_xfdashboard_tooltip_action_on_leave_event),
self);
return(CLUTTER_EVENT_PROPAGATE);
}
示例9: clutter_bin_layout_add
/**
* clutter_bin_layout_add:
* @self: a #ClutterBinLayout
* @child: a #ClutterActor
* @x_align: horizontal alignment policy for @child
* @y_align: vertical alignment policy for @child
*
* Adds a #ClutterActor to the container using @self and
* sets the alignment policies for it
*
* This function is equivalent to clutter_container_add_actor()
* and clutter_layout_manager_child_set_property() but it does not
* require a pointer to the #ClutterContainer associated to the
* #ClutterBinLayout
*
* Since: 1.2
*/
void
clutter_bin_layout_add (ClutterBinLayout *self,
ClutterActor *child,
ClutterBinAlignment x_align,
ClutterBinAlignment y_align)
{
ClutterBinLayoutPrivate *priv;
ClutterLayoutManager *manager;
ClutterLayoutMeta *meta;
g_return_if_fail (CLUTTER_IS_BIN_LAYOUT (self));
g_return_if_fail (CLUTTER_IS_ACTOR (child));
priv = self->priv;
if (priv->container == NULL)
{
g_warning ("The layout of type '%s' must be associated to "
"a ClutterContainer before adding children",
G_OBJECT_TYPE_NAME (self));
return;
}
clutter_container_add_actor (priv->container, child);
manager = CLUTTER_LAYOUT_MANAGER (self);
meta = clutter_layout_manager_get_child_meta (manager,
priv->container,
child);
g_assert (CLUTTER_IS_BIN_LAYER (meta));
set_layer_x_align (CLUTTER_BIN_LAYER (meta), x_align);
set_layer_y_align (CLUTTER_BIN_LAYER (meta), y_align);
}
示例10: meta_switcher_dispose
static void meta_switcher_dispose(GObject *object)
{
MetaSwitcher *switcher = META_SWITCHER(object);
MetaSwitcherPrivate* priv = switcher->priv;
if (priv->disposed) return;
priv->disposed = TRUE;
MetaScreen* screen = meta_plugin_get_screen(priv->plugin);
ClutterActor* stage = meta_get_stage_for_screen(screen);
clutter_actor_remove_child(stage, priv->top);
if (priv->modaled) {
meta_plugin_end_modal(priv->plugin, clutter_get_current_event_time());
meta_enable_unredirect_for_screen(screen);
if (priv->selected_id < 0 && priv->previous_focused)
clutter_stage_set_key_focus(CLUTTER_STAGE(stage), priv->previous_focused);
}
if (CLUTTER_IS_ACTOR(priv->top)) {
g_clear_pointer(&priv->top, clutter_actor_destroy);
} else priv->top = NULL;
if (priv->autoclose_id) {
g_source_remove(priv->autoclose_id);
priv->autoclose_id = 0;
}
GList* ws_list = meta_screen_get_workspaces(screen);
g_list_foreach(ws_list, (GFunc)unhook_ws_event, switcher);
G_OBJECT_CLASS(meta_switcher_parent_class)->dispose(object);
}
示例11: clutter_behaviour_remove
/**
* clutter_behaviour_remove:
* @behave: a #ClutterBehaviour
* @actor: a #ClutterActor
*
* Removes @actor from the list of #ClutterActor<!-- -->s to which
* @behave applies. This function removes a reference on the actor.
*
* Since: 0.2
*/
void
clutter_behaviour_remove (ClutterBehaviour *behave,
ClutterActor *actor)
{
ClutterBehaviourPrivate *priv;
g_return_if_fail (CLUTTER_IS_BEHAVIOUR (behave));
g_return_if_fail (CLUTTER_IS_ACTOR (actor));
priv = behave->priv;
if (!g_slist_find (priv->actors, actor))
{
g_warning ("The behaviour of type %s is not applied "
"to the actor of type %s",
g_type_name (G_OBJECT_TYPE (behave)),
g_type_name (G_OBJECT_TYPE (actor)));
return;
}
g_signal_handlers_disconnect_by_func (actor,
G_CALLBACK (remove_actor_on_destroy),
behave);
priv->actors = g_slist_remove (priv->actors, actor);
g_signal_emit (behave, behave_signals[REMOVED], 0, actor);
g_object_unref (actor);
}
示例12: pkg_graph_place_child
static void
pkg_graph_place_child (PkgGraph *graph,
ClutterActor *child)
{
PkgGraphPrivate *priv;
gfloat w, h, x = 0, y = 0;
g_return_if_fail(PKG_IS_GRAPH(graph));
g_return_if_fail(CLUTTER_IS_ACTOR(child));
priv = graph->priv;
clutter_actor_get_size(CLUTTER_ACTOR(graph), &w, &h);
if (priv->xpad) {
x = priv->xpad;
}
if (priv->ypad) {
y = priv->ypad;
}
w -= 2 * priv->xpad;
h -= 2 * priv->ypad;
clutter_actor_set_size(child, w, h);
clutter_actor_set_position(child, x, y);
clutter_actor_queue_redraw(child);
}
示例13: get_window
static AstroWindow *
get_window (AstroApplication *app)
{
AstroExamplePrivate *priv;
ClutterColor color = { 0xff, 0xff, 0x22, 0x22 };
ClutterActor *window = NULL, *rect;
g_return_val_if_fail (ASTRO_IS_EXAMPLE (app), NULL);
priv = ASTRO_EXAMPLE (app)->priv;
if (CLUTTER_IS_ACTOR (priv->window))
window = priv->window;
else
{
window = astro_window_new ();
rect = clutter_rectangle_new_with_color (&color);
clutter_container_add_actor (CLUTTER_CONTAINER (window), rect);
clutter_actor_set_size (rect, CSW (), CSH()-ASTRO_PANEL_HEIGHT());
clutter_actor_show (rect);
}
ASTRO_EXAMPLE (app)->priv->window = window;
return ASTRO_WINDOW (window);
}
示例14: xfdashboard_traverse_actor
/**
* xfdashboard_traverse_actor:
* @inRootActor: The root #ClutterActor where to begin traversing
* @inSelector: A #XfdashboardCssSelector to filter actors while traversing or
* %NULL to disable filterting
* @inCallback: Function to call on matching children
* @inUserData: Data to pass to callback function
*
* Iterates through all children of @inRootActor recursively beginning at
* @inRootActor and for each child matching the selector @inSelector it calls the
* callback function @inCallback with the matching child and the user-data at
* @inUserData.
*
* If @inRootActor is %NULL it begins at the global stage.
*
* If the selector @inSelector is %NULL all children will match and the callback
* function @inCallback is called for all children.
*/
void xfdashboard_traverse_actor(ClutterActor *inRootActor,
XfdashboardCssSelector *inSelector,
XfdashboardTraversalCallback inCallback,
gpointer inUserData)
{
g_return_if_fail(!inRootActor || CLUTTER_IS_ACTOR(inRootActor));
g_return_if_fail(!inSelector || XFDASHBOARD_IS_CSS_SELECTOR(inSelector));
g_return_if_fail(inCallback);
/* If root actor where begin traversal is NULL then begin at stage */
if(!inRootActor)
{
inRootActor=CLUTTER_ACTOR(xfdashboard_application_get_stage(NULL));
}
/* If no selector is provider create a seletor matching all actors.
* Otherwise take an extra ref on provided selector to prevent
* destruction when we unref it later.
*/
if(!inSelector) inSelector=xfdashboard_css_selector_new_from_string("*");
else g_object_ref(inSelector);
/* Do traversal */
_xfdashboard_traverse_actor_internal(inRootActor, inSelector, inCallback, inUserData);
/* Release reference on selector */
g_object_unref(inSelector);
}
示例15: clutter_container_add_actor
/**
* clutter_container_add_actor:
* @container: a #ClutterContainer
* @actor: the first #ClutterActor to add
*
* Adds a #ClutterActor to @container. This function will emit the
* "actor-added" signal. The actor should be parented to
* @container. You cannot add a #ClutterActor to more than one
* #ClutterContainer.
*
* Since: 0.4
*/
void
clutter_container_add_actor (ClutterContainer *container,
ClutterActor *actor)
{
ClutterContainerIface *iface;
ClutterActor *parent;
g_return_if_fail (CLUTTER_IS_CONTAINER (container));
g_return_if_fail (CLUTTER_IS_ACTOR (actor));
iface = CLUTTER_CONTAINER_GET_IFACE (container);
if (!iface->add)
{
CLUTTER_CONTAINER_WARN_NOT_IMPLEMENTED (container, "add");
return;
}
parent = clutter_actor_get_parent (actor);
if (parent)
{
g_warning ("Attempting to add actor of type '%s' to a "
"container of type '%s', but the actor has "
"already a parent of type '%s'.",
g_type_name (G_OBJECT_TYPE (actor)),
g_type_name (G_OBJECT_TYPE (container)),
g_type_name (G_OBJECT_TYPE (parent)));
return;
}
clutter_container_create_child_meta (container, actor);
iface->add (container, actor);
}