您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ CLUTTER_ACTOR_META函数代码示例

51自学网 2021-06-01 20:02:23
  C++
这篇教程C++ CLUTTER_ACTOR_META函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中CLUTTER_ACTOR_META函数的典型用法代码示例。如果您正苦于以下问题:C++ CLUTTER_ACTOR_META函数的具体用法?C++ CLUTTER_ACTOR_META怎么用?C++ CLUTTER_ACTOR_META使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了CLUTTER_ACTOR_META函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: _xfdashboard_drag_action_sort_targets_callback

/* Sort drop action targets */static gint _xfdashboard_drag_action_sort_targets_callback(gconstpointer inLeft, gconstpointer inRight){	ClutterActor		*actor1, *actor2;	gfloat				depth1, depth2;	gfloat				x1, y1, w1, h1;	gfloat				x2, y2, w2, h2;	ClutterActorBox		*box1, *box2;	gint				numberPoint1, numberPoint2;	g_return_val_if_fail(XFDASHBOARD_IS_DROP_ACTION(inLeft) && XFDASHBOARD_IS_DROP_ACTION(inRight), 0);	actor1=clutter_actor_meta_get_actor(CLUTTER_ACTOR_META(inLeft));	actor2=clutter_actor_meta_get_actor(CLUTTER_ACTOR_META(inRight));	/* Return -1 if actor in inLeft should be inserted before actor in inRight	 * and return 1 if otherwise. If both actors can be handled equal then	 * return 0. But how to decide?	 * The actor with higher z-depth should be inserted before. If both actors	 * have equal z-depth then the actor with the most edge points within the	 * other actor (overlap) should be inserted before. Edge points are:	 * [left,top], [right,top], [left,bottom] and [right, bottom].	*/	depth1=clutter_actor_get_z_position(actor1);	depth2=clutter_actor_get_z_position(actor2);	if(depth1>depth2) return(-1);		else if(depth1<depth2) return(1);	clutter_actor_get_transformed_position(actor1, &x1, &y1);	clutter_actor_get_transformed_size(actor1, &w1, &h1);	box1=clutter_actor_box_new(x1, y1, x1+w1, y1+h1);	clutter_actor_get_transformed_position(actor2, &x2, &y2);	clutter_actor_get_transformed_size(actor2, &w2, &h2);	box2=clutter_actor_box_new(x2, y2, x2+w2, y2+h2);	numberPoint1 =(clutter_actor_box_contains(box1, x2, y2) ? 1 : 0);	numberPoint1+=(clutter_actor_box_contains(box1, x2+w2, y2) ? 1 : 0);	numberPoint1+=(clutter_actor_box_contains(box1, x2, y2+h2) ? 1 : 0);	numberPoint1+=(clutter_actor_box_contains(box1, x2+w2, y2+h2) ? 1 : 0);	numberPoint2 =(clutter_actor_box_contains(box2, x1, y1) ? 1 : 0);	numberPoint2+=(clutter_actor_box_contains(box2, x1+w1, y1) ? 1 : 0);	numberPoint2+=(clutter_actor_box_contains(box2, x1, y1+h1) ? 1 : 0);	numberPoint2+=(clutter_actor_box_contains(box2, x1+w1, y1+h1) ? 1 : 0);	clutter_actor_box_free(box1);	clutter_actor_box_free(box2);	/* Return result */	if(numberPoint1>numberPoint2) return(1);		else if(numberPoint2>numberPoint1) return(-1);	return(0);}
开发者ID:AtheistSpacePirate,项目名称:xfdashboard,代码行数:54,


示例2: _xfdashboard_drag_action_find_drop_traget_at_coord

/* Find drop target at position */static XfdashboardDropAction* _xfdashboard_drag_action_find_drop_traget_at_coord(XfdashboardDragAction *self,																					gfloat inStageX,																					gfloat inStageY){	XfdashboardDragActionPrivate	*priv;	GSList							*list;	g_return_val_if_fail(XFDASHBOARD_IS_DRAG_ACTION(self), NULL);	priv=self->priv;	/* Iterate through list and return first drop target in list	 * where coordinates fit in	 */	for(list=priv->targets; list; list=g_slist_next(list))	{		ClutterActorMeta			*actorMeta=CLUTTER_ACTOR_META(list->data);		ClutterActor				*actor=clutter_actor_meta_get_actor(actorMeta);		gfloat						x, y, w, h;		/* Get position and size of actor in stage coordinates */		clutter_actor_get_transformed_position(actor, &x, &y);		clutter_actor_get_transformed_size(actor, &w, &h);		/* If given stage coordinates fit in actor we found it */		if(inStageX>=x && inStageX<(x+w) &&			inStageY>=y && inStageY<(y+h))		{			return(XFDASHBOARD_DROP_ACTION(actorMeta));		}	}	/* If we get here no drop target was found */	return(NULL);}
开发者ID:AtheistSpacePirate,项目名称:xfdashboard,代码行数:36,


示例3: _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);}
开发者ID:Pablohn26,项目名称:xfdashboard,代码行数:61,


示例4: mx_fade_effect_pre_paint

static gbooleanmx_fade_effect_pre_paint (ClutterEffect *effect){  MxFadeEffectPrivate *priv = MX_FADE_EFFECT (effect)->priv;  if (!priv->freeze_update)    {      return CLUTTER_EFFECT_CLASS (mx_fade_effect_parent_class)->        pre_paint (effect);    }  else    {      ClutterActorBox box;      ClutterActor *actor =        clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (effect));      /* Store the stage coordinates of the actor for when we post-paint */      clutter_actor_get_paint_box (actor, &box);      clutter_actor_box_get_origin (&box, &priv->x_offset, &priv->y_offset);      /* Connect to the paint signal so we can block it */      priv->blocked_id =        g_signal_connect (actor, "paint",                          G_CALLBACK (mx_fade_effect_paint_cb), effect);      return TRUE;    }}
开发者ID:3v1n0,项目名称:mx,代码行数:28,


示例5: _xfdashboard_click_action_emit_long_press

/* Emit "long-press" signal */static gboolean _xfdashboard_click_action_emit_long_press(gpointer inUserData){    XfdashboardClickAction			*self;    XfdashboardClickActionPrivate	*priv;    ClutterActor					*actor;    gboolean						result;    g_return_val_if_fail(XFDASHBOARD_IS_CLICK_ACTION(inUserData), FALSE);    self=XFDASHBOARD_CLICK_ACTION(inUserData);    priv=self->priv;    /* Reset variables */    priv->longPressID=0;    /* Emit signal */    actor=clutter_actor_meta_get_actor(CLUTTER_ACTOR_META(inUserData));    g_signal_emit(self, XfdashboardClickActionSignals[SIGNAL_LONG_PRESS], 0, actor, CLUTTER_LONG_PRESS_ACTIVATE, &result);    /* Disconnect signal handlers */    if(priv->captureID!=0)    {        g_signal_handler_disconnect(priv->stage, priv->captureID);        priv->captureID=0;    }    /* Reset state of this action */    _xfdashboard_click_action_set_pressed(self, FALSE);    _xfdashboard_click_action_set_held(self, FALSE);    /* Event handled */    return(FALSE);}
开发者ID:gmc-holle,项目名称:xfdashboard,代码行数:34,


示例6: _xfdashboard_click_action_set_pressed

/* Set press state */static void _xfdashboard_click_action_set_pressed(XfdashboardClickAction *self, gboolean isPressed){    XfdashboardClickActionPrivate	*priv;    ClutterActor					*actor;    g_return_if_fail(XFDASHBOARD_IS_CLICK_ACTION(self));    priv=self->priv;    /* Set value if changed */    isPressed=!!isPressed;    if(priv->isPressed!=isPressed)    {        /* Set value */        priv->isPressed=isPressed;        /* Style state */        actor=clutter_actor_meta_get_actor(CLUTTER_ACTOR_META(self));        if(XFDASHBOARD_IS_ACTOR(actor))        {            if(priv->isPressed) xfdashboard_stylable_add_pseudo_class(XFDASHBOARD_STYLABLE(actor), "pressed");            else xfdashboard_stylable_remove_pseudo_class(XFDASHBOARD_STYLABLE(actor), "pressed");        }        /* Notify about property change */        g_object_notify_by_pspec(G_OBJECT(self), XfdashboardClickActionProperties[PROP_PRESSED]);    }}
开发者ID:gmc-holle,项目名称:xfdashboard,代码行数:30,


示例7: mx_fade_effect_post_paint

static voidmx_fade_effect_post_paint (ClutterEffect *effect){  MxFadeEffectPrivate *priv = MX_FADE_EFFECT (effect)->priv;  if (!priv->freeze_update)    CLUTTER_EFFECT_CLASS (mx_fade_effect_parent_class)->post_paint (effect);  else    {      CoglMatrix modelview;      ClutterActor *actor, *stage;      actor = clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (effect));      stage = clutter_actor_get_stage (actor);      /* Set up the draw matrix so we draw the offscreen texture at the       * absolute coordinates of the actor-box. We need to do this to       * avoid transforming by the actor matrix twice, as when it's drawn       * into the offscreen surface, it'll already be transformed.       */      cogl_push_matrix ();      cogl_matrix_init_identity (&modelview);      CLUTTER_ACTOR_CLASS (G_OBJECT_GET_CLASS (stage))->        apply_transform (stage, &modelview);      cogl_matrix_translate (&modelview, priv->x_offset, priv->y_offset, 0.f);      cogl_set_modelview_matrix (&modelview);      clutter_offscreen_effect_paint_target (CLUTTER_OFFSCREEN_EFFECT (effect));      cogl_pop_matrix ();    }}
开发者ID:3v1n0,项目名称:mx,代码行数:33,


示例8: _xfdashboard_click_action_query_long_press

/* Query if long-press events should be handled and signals emitted */static void _xfdashboard_click_action_query_long_press(XfdashboardClickAction *self){    XfdashboardClickActionPrivate	*priv;    ClutterActor					*actor;    gboolean						result;    gint							timeout;    g_return_if_fail(XFDASHBOARD_IS_CLICK_ACTION(self));    priv=self->priv;    result=FALSE;    /* If no duration was set get default one from settings */    if(priv->longPressDuration<0)    {        ClutterSettings				*settings=clutter_settings_get_default();        g_object_get(settings, "long-press-duration", &timeout, NULL);    }    else timeout=priv->longPressDuration;    /* Emit signal to determine if long-press should be supported */    actor=clutter_actor_meta_get_actor(CLUTTER_ACTOR_META(self));    g_signal_emit(self, XfdashboardClickActionSignals[SIGNAL_LONG_PRESS], 0, actor, CLUTTER_LONG_PRESS_QUERY, &result);    if(result)    {        priv->longPressID=clutter_threads_add_timeout(timeout,                          _xfdashboard_click_action_emit_long_press,                          self);    }}
开发者ID:gmc-holle,项目名称:xfdashboard,代码行数:33,


示例9: clutter_actor_meta_get_property

static voidclutter_actor_meta_get_property (GObject    *gobject,                                 guint       prop_id,                                 GValue     *value,                                 GParamSpec *pspec){  ClutterActorMeta *meta = CLUTTER_ACTOR_META (gobject);  switch (prop_id)    {    case PROP_ACTOR:      g_value_set_object (value, meta->priv->actor);      break;    case PROP_NAME:      g_value_set_string (value, meta->priv->name);      break;    case PROP_ENABLED:      g_value_set_boolean (value, meta->priv->is_enabled);      break;    default:      G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);      break;    }}
开发者ID:nobled,项目名称:clutter,代码行数:27,


示例10: clutter_drag_action_dispose

static voidclutter_drag_action_dispose (GObject *gobject){  ClutterDragActionPrivate *priv = CLUTTER_DRAG_ACTION (gobject)->priv;  if (priv->capture_id != 0)    {      if (priv->stage != NULL)        g_signal_handler_disconnect (priv->stage, priv->capture_id);      priv->capture_id = 0;      priv->stage = NULL;    }  if (priv->button_press_id != 0)    {      ClutterActor *actor;      actor = clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (gobject));      g_signal_handler_disconnect (actor, priv->button_press_id);      priv->button_press_id = 0;    }  G_OBJECT_CLASS (clutter_drag_action_parent_class)->dispose (gobject);}
开发者ID:nobled,项目名称:clutter,代码行数:25,


示例11: click_action_query_long_press

static inline voidclick_action_query_long_press (ClutterClickAction *action){  ClutterClickActionPrivate *priv = action->priv;  ClutterActor *actor;  gboolean result = FALSE;  gint timeout;  if (priv->long_press_duration < 0)    {      ClutterSettings *settings = clutter_settings_get_default ();      g_object_get (settings,                    "long-press-duration", &timeout,                    NULL);    }  else    timeout = priv->long_press_duration;  actor = clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (action));  g_signal_emit (action, click_signals[LONG_PRESS], 0,                 actor,                 CLUTTER_LONG_PRESS_QUERY,                 &result);  if (result)    {      priv->long_press_id =        clutter_threads_add_timeout (timeout,                                     click_action_emit_long_press,                                     action);    }}
开发者ID:ebassi,项目名称:clutter,代码行数:34,


示例12: shader_paint

static voidshader_paint (ClutterEffect           *effect,              ClutterEffectPaintFlags  flags){  ClutterShaderEffect *shader = CLUTTER_SHADER_EFFECT (effect);  float tex_width;  ClutterActor *actor =    clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (effect));  if (g_test_verbose ())    g_debug ("shader_paint");  clutter_shader_effect_set_shader_source (shader,    "uniform sampler2D tex;/n"    "uniform float step;/n"    "void main (void)/n"    "{/n"    "  gl_FragColor = texture2D(tex, vec2 (gl_TexCoord[0].s + step,/n"    "                                      gl_TexCoord[0].t));/n"    "}/n");  tex_width = clutter_actor_get_width (actor);  clutter_shader_effect_set_uniform (shader, "tex", G_TYPE_INT, 1, 0);  clutter_shader_effect_set_uniform (shader, "step", G_TYPE_FLOAT, 1,                                     SHIFT_STEP / tex_width);  CLUTTER_EFFECT_CLASS (shift_effect_parent_class)->paint (effect, flags);}
开发者ID:spatulasnout,项目名称:clutter,代码行数:29,


示例13: empathy_rounded_effect_paint

static voidempathy_rounded_effect_paint (ClutterEffect *effect,    ClutterEffectPaintFlags flags){  EmpathyRoundedEffect *self = EMPATHY_ROUNDED_EFFECT (effect);  ClutterActor *actor;  ClutterActorBox allocation = { 0, };  gfloat width, height;  actor = clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (self));  clutter_actor_get_allocation_box (actor, &allocation);  clutter_actor_box_get_size (&allocation, &width, &height);  cogl_path_new ();  /* Create and store a path describing a rounded rectangle. The small   * size of the preview window makes the radius of the rounded corners   * very small too, so we can safely use a very coarse angle step   * without loosing rendering accuracy. It also significantly reduces   * the time spent in the underlying internal cogl path functions */  cogl_path_round_rectangle (0, 0, width, height, height / 16., 15);  cogl_clip_push_from_path ();  /* Flip */  cogl_push_matrix ();  cogl_translate (width, 0, 0);  cogl_scale (-1, 1, 1);  clutter_actor_continue_paint (actor);  cogl_pop_matrix ();  cogl_clip_pop ();}
开发者ID:GNOME,项目名称:empathy,代码行数:34,


示例14: clutter_click_action_dispose

static voidclutter_click_action_dispose (GObject *gobject){  ClutterClickActionPrivate *priv = CLUTTER_CLICK_ACTION (gobject)->priv;  if (priv->event_id)    {      g_signal_handler_disconnect (clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (gobject)),                                   priv->event_id);      priv->event_id = 0;    }  if (priv->capture_id)    {      g_signal_handler_disconnect (priv->stage, priv->capture_id);      priv->capture_id = 0;    }  if (priv->long_press_id)    {      g_source_remove (priv->long_press_id);      priv->long_press_id = 0;    }  G_OBJECT_CLASS (clutter_click_action_parent_class)->dispose (gobject);}
开发者ID:ebassi,项目名称:clutter,代码行数:26,


示例15: mx_label_fade_started_cb

static voidmx_label_fade_started_cb (ClutterTimeline *timeline,                          MxLabel         *label){  clutter_actor_meta_set_enabled (CLUTTER_ACTOR_META (label->priv->fade_effect),                                  TRUE);}
开发者ID:bhgv,项目名称:mx--clutter-based-GUI-framework--orange-pi-2-h3,代码行数:7,


示例16: actor_captured_event_cb

static gbooleanactor_captured_event_cb (ClutterActor *actor,                         ClutterEvent *event,                         ClutterGestureAction *action){  ClutterGestureActionPrivate *priv = action->priv;  GesturePoint *point G_GNUC_UNUSED;  if ((clutter_event_type (event) != CLUTTER_BUTTON_PRESS) &&      (clutter_event_type (event) != CLUTTER_TOUCH_BEGIN))    return CLUTTER_EVENT_PROPAGATE;  if (!clutter_actor_meta_get_enabled (CLUTTER_ACTOR_META (action)))    return CLUTTER_EVENT_PROPAGATE;  point = gesture_register_point (action, event);  if (priv->stage == NULL)    priv->stage = clutter_actor_get_stage (actor);  if (priv->stage_capture_id == 0)    priv->stage_capture_id =      g_signal_connect_after (priv->stage, "captured-event",                              G_CALLBACK (stage_captured_event_cb),                              action);  /* Start the gesture immediately if the gesture has no   * _TRIGGER_EDGE_AFTER drag threshold. */  if ((priv->points->len >= priv->requested_nb_points) &&      (priv->edge != CLUTTER_GESTURE_TRIGGER_EDGE_AFTER))    begin_gesture (action, actor);  return CLUTTER_EVENT_PROPAGATE;}
开发者ID:collinss,项目名称:muffin,代码行数:34,


示例17: shell_grid_desaturate_effect_paint_target

static voidshell_grid_desaturate_effect_paint_target (ClutterOffscreenEffect *effect){  ShellGridDesaturateEffect *self = SHELL_GRID_DESATURATE_EFFECT (effect);  ClutterActor *actor;  CoglHandle texture;  guint8 paint_opacity;  texture = clutter_offscreen_effect_get_texture (effect);  cogl_pipeline_set_layer_texture (self->pipeline, 0, texture);  actor = clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (effect));  paint_opacity = clutter_actor_get_paint_opacity (actor);  cogl_pipeline_set_color4ub (self->pipeline,                              paint_opacity,                              paint_opacity,                              paint_opacity,                              paint_opacity);  cogl_push_source (self->pipeline);  cogl_rectangle (0, 0,                  cogl_texture_get_width (texture),                  cogl_texture_get_height (texture));  cogl_pop_source ();}
开发者ID:xxl007,项目名称:eos-desktop,代码行数:27,


示例18: mex_tile_init

static voidmex_tile_init (MexTile *self){  MexTilePrivate *priv = self->priv = TILE_PRIVATE (self);  const ClutterColor opaque = { 0x00, 0x00, 0x00, 0x00 };  ClutterEffect *fade;  /* create a template material for the header background from which cheap   * copies can be made for each instance */  if (G_UNLIKELY (!template_material))    template_material = cogl_material_new ();  priv->material = cogl_material_copy (template_material);  /* layout for primary and secondary labels */  priv->box_layout = mx_box_layout_new ();  mx_box_layout_set_spacing (MX_BOX_LAYOUT (priv->box_layout), 12);  /* add fade effect to the box layout */  fade = (ClutterEffect*) mx_fade_effect_new ();  mx_fade_effect_set_border (MX_FADE_EFFECT (fade), 0, 50, 0, 0);  mx_fade_effect_set_color (MX_FADE_EFFECT (fade), &opaque);  clutter_actor_add_effect_with_name (priv->box_layout, "fade", fade);  clutter_actor_meta_set_enabled (CLUTTER_ACTOR_META (fade), TRUE);  clutter_actor_push_internal (CLUTTER_ACTOR (self));  clutter_actor_set_parent (priv->box_layout, CLUTTER_ACTOR (self));  clutter_actor_pop_internal (CLUTTER_ACTOR (self));  priv->label = clutter_text_new ();  priv->secondary_label = clutter_text_new ();  clutter_actor_set_opacity (priv->secondary_label, 128);  clutter_container_add (CLUTTER_CONTAINER (priv->box_layout), priv->label,                         priv->secondary_label, NULL);  priv->header_visible = TRUE;  priv->timeline = clutter_timeline_new (DURATION);  priv->important_alpha =    clutter_alpha_new_full (priv->timeline, CLUTTER_EASE_OUT_QUAD);  g_signal_connect_object (priv->timeline, "new-frame",                           G_CALLBACK (mex_tile_important_new_frame_cb), self,                           0);  g_signal_connect_object (priv->timeline, "completed",                           G_CALLBACK (mex_tile_timeline_completed_cb), self,                           0);  g_signal_connect (self, "style-changed",                    G_CALLBACK (mex_tile_style_changed_cb), NULL);  g_signal_connect (self, "actor-added",                    G_CALLBACK (mex_tile_actor_added), NULL);  g_signal_connect (self, "actor-removed",                    G_CALLBACK (mex_tile_actor_removed), NULL);}
开发者ID:frankopt,项目名称:media-explorer,代码行数:58,


示例19: clutter_align_constraint_set_source

/** * clutter_align_constraint_set_source: * @align: a #ClutterAlignConstraint * @source: (allow-none): a #ClutterActor, or %NULL to unset the source * * Sets the source of the alignment constraint * * Since: 1.4 */voidclutter_align_constraint_set_source (ClutterAlignConstraint *align,                                     ClutterActor           *source){  ClutterActor *old_source, *actor;  ClutterActorMeta *meta;  g_return_if_fail (CLUTTER_IS_ALIGN_CONSTRAINT (align));  g_return_if_fail (source == NULL || CLUTTER_IS_ACTOR (source));  if (align->source == source)    return;  meta = CLUTTER_ACTOR_META (align);  actor = clutter_actor_meta_get_actor (meta);  if (actor != NULL && source != NULL)    {      if (clutter_actor_contains (actor, source))        {          g_warning (G_STRLOC ": The source actor '%s' is contained "                     "by the actor '%s' associated to the constraint "                     "'%s'",                     _clutter_actor_get_debug_name (source),                     _clutter_actor_get_debug_name (actor),                     _clutter_actor_meta_get_debug_name (meta));          return;        }    }  old_source = align->source;  if (old_source != NULL)    {      g_signal_handlers_disconnect_by_func (old_source,                                            G_CALLBACK (source_destroyed),                                            align);      g_signal_handlers_disconnect_by_func (old_source,                                            G_CALLBACK (source_position_changed),                                            align);    }  align->source = source;  if (align->source != NULL)    {      g_signal_connect (align->source, "allocation-changed",                        G_CALLBACK (source_position_changed),                        align);      g_signal_connect (align->source, "destroy",                        G_CALLBACK (source_destroyed),                        align);      if (align->actor != NULL)        clutter_actor_queue_relayout (align->actor);    }  g_object_notify_by_pspec (G_OBJECT (align), obj_props[PROP_SOURCE]);}
开发者ID:ChrisCummins,项目名称:clutter,代码行数:65,


示例20: clutter_bind_constraint_set_source

/** * clutter_bind_constraint_set_source: * @constraint: a #ClutterBindConstraint * @source: (allow-none): a #ClutterActor, or %NULL to unset the source * * Sets the source #ClutterActor for the constraint * * Since: 1.4 */voidclutter_bind_constraint_set_source (ClutterBindConstraint *constraint,                                    ClutterActor          *source){  ClutterActor *old_source, *actor;  ClutterActorMeta *meta;  g_return_if_fail (CLUTTER_IS_BIND_CONSTRAINT (constraint));  g_return_if_fail (source == NULL || CLUTTER_IS_ACTOR (source));  if (constraint->source == source)    return;  meta = CLUTTER_ACTOR_META (constraint);  actor = clutter_actor_meta_get_actor (meta);  if (source != NULL && actor != NULL)    {      if (clutter_actor_contains (actor, source))        {          g_warning (G_STRLOC ": The source actor '%s' is contained "                     "by the actor '%s' associated to the constraint "                     "'%s'",                     _clutter_actor_get_debug_name (source),                     _clutter_actor_get_debug_name (actor),                     _clutter_actor_meta_get_debug_name (meta));          return;        }    }  old_source = constraint->source;  if (old_source != NULL)    {      g_signal_handlers_disconnect_by_func (old_source,                                            G_CALLBACK (source_destroyed),                                            constraint);      g_signal_handlers_disconnect_by_func (old_source,                                            G_CALLBACK (source_queue_relayout),                                            constraint);    }  constraint->source = source;  if (constraint->source != NULL)    {      g_signal_connect (constraint->source, "queue-relayout",                        G_CALLBACK (source_queue_relayout),                        constraint);      g_signal_connect (constraint->source, "destroy",                        G_CALLBACK (source_destroyed),                        constraint);      if (constraint->actor != NULL)        clutter_actor_queue_relayout (constraint->actor);    }  g_object_notify_by_pspec (G_OBJECT (constraint), obj_props[PROP_SOURCE]);}
开发者ID:Distrotech,项目名称:clutter,代码行数:65,


示例21: mx_label_fade_completed_cb

static voidmx_label_fade_completed_cb (ClutterTimeline *timeline,                            MxLabel         *label){  MxLabelPrivate *priv = label->priv;  if (!priv->label_should_fade)    clutter_actor_meta_set_enabled (CLUTTER_ACTOR_META (priv->fade_effect),                                    FALSE);}
开发者ID:bhgv,项目名称:mx--clutter-based-GUI-framework--orange-pi-2-h3,代码行数:10,


示例22: shell_grid_desaturate_effect_pre_paint

static gbooleanshell_grid_desaturate_effect_pre_paint (ClutterEffect *effect){  ShellGridDesaturateEffect *self = SHELL_GRID_DESATURATE_EFFECT (effect);  ClutterEffectClass *parent_class;  if (!clutter_actor_meta_get_enabled (CLUTTER_ACTOR_META (effect)))    return FALSE;  if (!clutter_feature_available (CLUTTER_FEATURE_SHADERS_GLSL))    {      /* if we don't have support for GLSL shaders then we       * forcibly disable the ActorMeta       */      g_warning ("Unable to use the ShaderEffect: the graphics hardware "                 "or the current GL driver does not implement support "                 "for the GLSL shading language.");      clutter_actor_meta_set_enabled (CLUTTER_ACTOR_META (effect), FALSE);      return FALSE;    }  parent_class = CLUTTER_EFFECT_CLASS (shell_grid_desaturate_effect_parent_class);  if (parent_class->pre_paint (effect))    {      ClutterOffscreenEffect *offscreen_effect =        CLUTTER_OFFSCREEN_EFFECT (effect);      CoglHandle texture;      texture = clutter_offscreen_effect_get_texture (offscreen_effect);      self->tex_width = cogl_texture_get_width (texture);      self->tex_height = cogl_texture_get_height (texture);      if (self->unshaded_uniform_dirty)        update_unshaded_uniform (self);      cogl_pipeline_set_layer_texture (self->pipeline, 0, texture);      return TRUE;    }  else    return FALSE;}
开发者ID:xxl007,项目名称:eos-desktop,代码行数:42,


示例23: shell_anamorphosis_effect_pre_paint

static gbooleanshell_anamorphosis_effect_pre_paint (ClutterEffect *effect){  ShellAnamorphosisEffect *self = SHELL_ANAMORPHOSIS_EFFECT (effect);  ShellAnamorphosisEffectPrivate *priv = shell_anamorphosis_effect_get_instance_private (self);  if (!clutter_actor_meta_get_enabled (CLUTTER_ACTOR_META (effect)))    return FALSE;  /* If we're not doing any bending, we're not needed. */  if (!clutter_feature_available (CLUTTER_FEATURE_SHADERS_GLSL))    {      /* if we don't have support for GLSL shaders then we       * forcibly disable the ActorMeta       */      g_warning ("Unable to use the ShellAnamorphosisEffect: the "                 "graphics hardware or the current GL driver does not "                 "implement support for the GLSL shading language. The "                 "effect will be disabled.");      clutter_actor_meta_set_enabled (CLUTTER_ACTOR_META (effect), FALSE);      return FALSE;    }  if (!CLUTTER_EFFECT_CLASS (shell_anamorphosis_effect_parent_class)->pre_paint (effect))    return FALSE;  ClutterOffscreenEffect *offscreen_effect = CLUTTER_OFFSCREEN_EFFECT (effect);  CoglObject *texture;  texture = clutter_offscreen_effect_get_texture (offscreen_effect);  cogl_pipeline_set_layer_texture (priv->pipeline, 0, texture);  priv->tex_width = cogl_texture_get_width (texture);  priv->tex_height = cogl_texture_get_height (texture);  cogl_pipeline_set_uniform_1i (priv->pipeline, priv->tex_width_uniform, priv->tex_width);  cogl_pipeline_set_uniform_1i (priv->pipeline, priv->tex_height_uniform, priv->tex_height);  return TRUE;}
开发者ID:ErwanDouaille,项目名称:Lille1-Master-Info,代码行数:41,


示例24: on_vadjustment_changed

static voidon_vadjustment_changed (StAdjustment *adjustment,                        ClutterEffect *effect){  gdouble value, lower, upper, page_size;  gboolean needs_fade;  st_adjustment_get_values (adjustment, &value, &lower, &upper, NULL, NULL, &page_size);  needs_fade = (value > lower + 0.1) || (value < upper - page_size - 0.1);  clutter_actor_meta_set_enabled (CLUTTER_ACTOR_META (effect), needs_fade);}
开发者ID:3dfxmadscientist,项目名称:Cinnamon,代码行数:12,


示例25: clutter_actor_meta_finalize

static voidclutter_actor_meta_finalize (GObject *gobject){  ClutterActorMetaPrivate *priv = CLUTTER_ACTOR_META (gobject)->priv;  if (priv->destroy_id != 0 && priv->actor != NULL)    g_signal_handler_disconnect (priv->actor, priv->destroy_id);  g_free (priv->name);  G_OBJECT_CLASS (clutter_actor_meta_parent_class)->finalize (gobject);}
开发者ID:nobled,项目名称:clutter,代码行数:12,


示例26: mx_fade_effect_paint_target

static voidmx_fade_effect_paint_target (ClutterOffscreenEffect *effect){  guint8 opacity;  CoglColor color;  ClutterActor *actor;  CoglMaterial *material = clutter_offscreen_effect_get_target (effect);  MxFadeEffect *self = MX_FADE_EFFECT (effect);  MxFadeEffectPrivate *priv = self->priv;  if (priv->update_vbo)    mx_fade_effect_update_vbo (self);  if (!priv->vbo || !priv->indices || !material)    return;  /* Set the blend string if the material has changed so we can blend with   * the paint opacity.   */  if (material != priv->old_material)    {      GError *error = NULL;      priv->old_material = material;      if (!cogl_material_set_layer_combine (material, 1,                                            "RGBA = MODULATE(PREVIOUS,CONSTANT)", &error))        {          g_warning (G_STRLOC ": Error setting layer combine blend string: %s",                     error->message);          g_error_free (error);        }    }  /* Set the layer-combine constant so the texture is blended with the paint   * opacity when painted.   */  actor = clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (effect));  opacity = clutter_actor_get_paint_opacity (actor);  cogl_color_init_from_4ub (&color, opacity, opacity, opacity, opacity);  cogl_material_set_layer_combine_constant (material, 1, &color);  /* Draw the texture */  cogl_set_source (material);  cogl_vertex_buffer_draw_elements (priv->vbo,                                    COGL_VERTICES_MODE_TRIANGLES,                                    priv->indices,                                    0,                                    (priv->n_quads * 4) - 1,                                    0,                                    priv->n_quads * 6);}
开发者ID:3v1n0,项目名称:mx,代码行数:52,


示例27: st_scroll_view_fade_pre_paint

static gbooleanst_scroll_view_fade_pre_paint (ClutterEffect *effect){  StScrollViewFade *self = ST_SCROLL_VIEW_FADE (effect);  ClutterEffectClass *parent_class;  if (self->shader == COGL_INVALID_HANDLE)    return FALSE;  if (!clutter_actor_meta_get_enabled (CLUTTER_ACTOR_META (effect)))    return FALSE;  if (self->actor == NULL)    return FALSE;  if (self->program == COGL_INVALID_HANDLE)    self->program = cogl_create_program ();  if (!self->is_attached)    {      g_assert (self->shader != COGL_INVALID_HANDLE);      g_assert (self->program != COGL_INVALID_HANDLE);      cogl_program_attach_shader (self->program, self->shader);      cogl_program_link (self->program);      cogl_handle_unref (self->shader);      self->is_attached = TRUE;      self->tex_uniform =        cogl_program_get_uniform_location (self->program, "tex");      self->height_uniform =        cogl_program_get_uniform_location (self->program, "height");      self->width_uniform =        cogl_program_get_uniform_location (self->program, "width");      self->scrollbar_width_uniform =        cogl_program_get_uniform_location (self->program, "scrollbar_width");      self->scrollbar_height_uniform =        cogl_program_get_uniform_location (self->program, "scrollbar_height");      self->rtl_uniform =        cogl_program_get_uniform_location (self->program, "rtl");      self->offset_top_uniform =        cogl_program_get_uniform_location (self->program, "offset_top");      self->offset_bottom_uniform =        cogl_program_get_uniform_location (self->program, "offset_bottom");    }  parent_class = CLUTTER_EFFECT_CLASS (st_scroll_view_fade_parent_class);  return parent_class->pre_paint (effect);}
开发者ID:nohemi,项目名称:GNOME-OnScreen-Keyboard,代码行数:51,


示例28: _accept_focus

static MxFocusable *_accept_focus (MxFocusable *focusable,               MxFocusHint  hint){  MexActionButtonPrivate *priv = MEX_ACTION_BUTTON (focusable)->priv;  MxFocusableIface *iface;  priv->has_focus = TRUE;  clutter_actor_meta_set_enabled (CLUTTER_ACTOR_META (priv->shadow), TRUE);  iface = g_type_interface_peek_parent (MX_FOCUSABLE_GET_INTERFACE (focusable));  return iface->accept_focus (focusable, hint);}
开发者ID:Cyrene,项目名称:media-explorer,代码行数:14,


示例29: on_deceleration_stopped

static voidon_deceleration_stopped (ClutterTimeline           *timeline,                         gboolean                   is_finished,                         ClutterPanAction *self){  ClutterPanActionPrivate *priv = self->priv;  ClutterActor *actor;  g_object_unref (timeline);  priv->deceleration_timeline = NULL;  actor = clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (self));  emit_pan_stopped (self, actor);}
开发者ID:UIKit0,项目名称:clutter,代码行数:14,


示例30: clutter_gesture_action_set_n_touch_points

/** * clutter_gesture_action_set_n_touch_points: * @action: a #ClutterGestureAction * @nb_points: a number of points * * Sets the number of points needed to trigger the gesture. * * Since: 1.12 */voidclutter_gesture_action_set_n_touch_points (ClutterGestureAction *action,                                           gint                  nb_points){  ClutterGestureActionPrivate *priv;  g_return_if_fail (CLUTTER_IS_GESTURE_ACTION (action));  g_return_if_fail (nb_points >= 1);  priv = action->priv;  if (priv->requested_nb_points == nb_points)    return;  priv->requested_nb_points = nb_points;  if (priv->in_gesture)    {      if (priv->points->len < priv->requested_nb_points)        cancel_gesture (action);    }  else if (priv->edge == CLUTTER_GESTURE_TRIGGER_EDGE_AFTER)    {      if (priv->points->len >= priv->requested_nb_points)        {          ClutterActor *actor =            clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (action));          gint i;          float threshold_x, threshold_y;          clutter_gesture_action_get_threshold_trigger_distance (action, &threshold_x, &threshold_y);          for (i = 0; i < priv->points->len; i++)            {              GesturePoint *point = &g_array_index (priv->points, GesturePoint, i);              if ((fabsf (point->press_y - point->last_motion_y) >= threshold_y) ||                  (fabsf (point->press_x - point->last_motion_x) >= threshold_x))                {                  begin_gesture (action, actor);                  break;                }            }        }    }  g_object_notify_by_pspec (G_OBJECT (action),                            gesture_props[PROP_N_TOUCH_POINTS]);}
开发者ID:collinss,项目名称:muffin,代码行数:58,



注:本文中的CLUTTER_ACTOR_META函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ CLUTTER_BACKEND_X11函数代码示例
C++ CLUTTER_ACTOR_IS_VISIBLE函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。