本文整理汇总了C++中clutter_timeline_start函数的典型用法代码示例。如果您正苦于以下问题:C++ clutter_timeline_start函数的具体用法?C++ clutter_timeline_start怎么用?C++ clutter_timeline_start使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了clutter_timeline_start函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: im_spinning_around
static gboolean
im_spinning_around (ClutterTimeline *time)
{
if (!clutter_timeline_is_playing (timeline))
clutter_timeline_start (timeline);
return TRUE;
}
示例2: foreach_running_timeline
static void
foreach_running_timeline (gpointer key,
gpointer value,
gpointer user_data)
{
ClutterScoreEntry *entry = value;
gint action = GPOINTER_TO_INT (user_data);
switch (action)
{
case ACTION_START:
clutter_timeline_start (entry->timeline);
break;
case ACTION_PAUSE:
clutter_timeline_pause (entry->timeline);
break;
case ACTION_STOP:
if (entry->complete_id)
{
g_signal_handler_disconnect (entry->timeline, entry->complete_id);
entry->complete_id = 0;
}
clutter_timeline_stop (entry->timeline);
break;
}
}
示例3: main
int
main (int argc, char *argv[])
{
ClutterActor *stage;
ClutterActor *coglbox;
ClutterTimeline *tl;
clutter_init(&argc, &argv);
tl = clutter_timeline_new (G_N_ELEMENTS (paint_func) * 1000);
clutter_timeline_set_loop (tl, TRUE);
clutter_timeline_start (tl);
stage = clutter_stage_get_default ();
clutter_actor_set_size (stage, 400, 400);
clutter_stage_set_title (CLUTTER_STAGE (stage), "Cogl Test");
coglbox = clutter_group_new ();
clutter_container_add_actor (CLUTTER_CONTAINER (stage), coglbox);
g_signal_connect (coglbox, "paint", G_CALLBACK (paint_cb), tl);
/* Redraw every frame of the timeline */
g_signal_connect_swapped (tl, "new-frame",
G_CALLBACK (clutter_actor_queue_redraw), coglbox);
clutter_actor_set_rotation (coglbox, CLUTTER_Y_AXIS, -30, 200, 0, 0);
clutter_actor_set_position (coglbox, 0, 100);
clutter_actor_show (stage);
clutter_main ();
g_object_unref (tl);
return 0;
}
示例4: gb_player_show_controls
gboolean
gb_player_show_controls (GbPlayer *self)
{
ClutterEffectTemplate *effect_template;
gint x, y;
ClutterKnot t_knot[2];
ClutterKnot b_knot[2];
ClutterKnot c_knot[2];
if ((!self->priv->playing) || (clutter_timeline_is_playing (self->priv->show_hide_timeline)))
return FALSE;
clutter_timeline_start(self->priv->show_hide_timeline);
effect_template = clutter_effect_template_new (self->priv->show_hide_timeline, &on_alpha);
clutter_actor_get_position (self->priv->title_group, &x, &y);
t_knot[0].x = x;
t_knot[0].y = y;
t_knot[1].x= -20;
t_knot[1].y= 20;
clutter_actor_get_position (self->priv->window_buttons_group, &x, &y);
b_knot[0].x = x;
b_knot[0].y = y;
b_knot[1].x= 640 - 200;
b_knot[1].y= 20;
clutter_actor_get_position (self->priv->window_buttons_group, &x, &y);
c_knot[0].x = x;
c_knot[0].y = y;
c_knot[1].x= ((640 / 2) - (400 / 2));
c_knot[1].y= 480 - 70 - 30;
clutter_effect_fade (effect_template, self->priv->title_group, 0xff, NULL, NULL);
clutter_effect_fade (effect_template, self->priv->window_buttons_group, 0xff, NULL, NULL);
clutter_effect_fade (effect_template, self->priv->controls_group, 0xff, NULL, NULL);
g_object_unref (effect_template);
return FALSE;
}
示例5: on_key_press_event
static void
on_key_press_event (ClutterStage *stage,
ClutterKeyEvent *event,
gpointer user_data)
{
TestThreadData *data;
switch (clutter_key_event_symbol (event))
{
case CLUTTER_s:
clutter_label_set_text (CLUTTER_LABEL (help_label), "Press 'q' to quit");
clutter_timeline_start (timeline);
data = test_thread_data_new ();
data->stage = g_object_ref (stage);
data->label = g_object_ref (count_label);
data->progress = g_object_ref (progress_rect);
data->timeline = g_object_ref (timeline);
g_thread_create (test_thread_func, data, FALSE, NULL);
break;
case CLUTTER_q:
clutter_main_quit ();
break;
}
}
示例6: st_theme_node_transition_new
StThemeNodeTransition *
st_theme_node_transition_new (StThemeNode *from_node,
StThemeNode *to_node,
guint duration)
{
StThemeNodeTransition *transition;
g_return_val_if_fail (ST_IS_THEME_NODE (from_node), NULL);
g_return_val_if_fail (ST_IS_THEME_NODE (to_node), NULL);
duration = st_theme_node_get_transition_duration (to_node);
transition = g_object_new (ST_TYPE_THEME_NODE_TRANSITION,
NULL);
transition->priv->old_theme_node = g_object_ref (from_node);
transition->priv->new_theme_node = g_object_ref (to_node);
transition->priv->timeline = clutter_timeline_new (duration);
transition->priv->timeline_completed_id =
g_signal_connect (transition->priv->timeline, "completed",
G_CALLBACK (on_timeline_completed), transition);
transition->priv->timeline_new_frame_id =
g_signal_connect (transition->priv->timeline, "new-frame",
G_CALLBACK (on_timeline_new_frame), transition);
clutter_timeline_set_progress_mode (transition->priv->timeline, CLUTTER_EASE_IN_OUT_QUAD);
clutter_timeline_start (transition->priv->timeline);
return transition;
}
示例7: mx_expander_update
static void
mx_expander_update (MxExpander *expander)
{
MxExpanderPrivate *priv = expander->priv;
if (priv->expanded)
{
clutter_actor_set_name (priv->arrow, "mx-expander-arrow-open");
mx_stylable_set_style_class (MX_STYLABLE (expander), "open-expander");
}
/* closed state is set when animation is finished */
if (!priv->child)
return;
/* setup and start the expansion animation */
if (!priv->expanded)
{
clutter_actor_hide (priv->child);
clutter_timeline_set_direction (priv->timeline,
CLUTTER_TIMELINE_BACKWARD);
}
else
{
clutter_timeline_set_direction (priv->timeline,
CLUTTER_TIMELINE_FORWARD);
}
if (!clutter_timeline_is_playing (priv->timeline))
clutter_timeline_rewind (priv->timeline);
clutter_timeline_start (priv->timeline);
}
示例8: main
int
main(int argc, char **argv)
{
TestState state;
clutter_init(&argc, &argv);
state.timeline =
clutter_timeline_new (TEST_TIMELINE_FRAME_COUNT,
TEST_TIMELINE_FPS);
clutter_timeline_set_loop (state.timeline, TRUE);
g_signal_connect (G_OBJECT(state.timeline),
"new-frame",
G_CALLBACK(new_frame_cb),
&state);
g_signal_connect (G_OBJECT(state.timeline),
"completed",
G_CALLBACK(completed_cb),
&state);
state.prev_frame = -1;
state.completion_count = 0;
state.passed = TRUE;
clutter_timeline_start (state.timeline);
clutter_main();
return EXIT_FAILURE;
}
示例9: stepper_move_on
static void
stepper_move_on (StScrollBarPrivate *priv,
gint mode)
{
ClutterAnimation *a;
ClutterTimeline *t;
GValue v = { 0, };
double value, inc;
a = g_object_new (CLUTTER_TYPE_ANIMATION,
"object", priv->adjustment,
"duration", (guint)(PAGING_SUBSEQUENT_REPEAT_TIMEOUT * st_slow_down_factor),
"mode", mode,
NULL);
g_signal_connect (a, "completed", G_CALLBACK (stepper_animation_completed_cb),
NULL);
g_object_get (priv->adjustment,
"step-increment", &inc,
"value", &value,
NULL);
if (priv->stepper_forward)
value = value + inc;
else
value = value - inc;
g_value_init (&v, G_TYPE_DOUBLE);
g_value_set_double (&v, value);
clutter_animation_bind (a, "value", &v);
t = clutter_animation_get_timeline (a);
clutter_timeline_start (t);
}
示例10: start_entry
static void
start_entry (ClutterScoreEntry *entry)
{
ClutterScorePrivate *priv = entry->score->priv;
/* timelines attached to a marker might already be playing when we
* end up here from the ::completed handler, so we need to perform
* this check to avoid restarting those timelines
*/
if (clutter_timeline_is_playing (entry->timeline))
return;
entry->complete_id = g_signal_connect (entry->timeline,
"completed",
G_CALLBACK (on_timeline_completed),
entry);
CLUTTER_NOTE (SCHEDULER, "timeline [%p] ('%lu') started",
entry->timeline,
entry->id);
if (G_UNLIKELY (priv->running_timelines == NULL))
priv->running_timelines = g_hash_table_new (NULL, NULL);
g_hash_table_insert (priv->running_timelines,
GUINT_TO_POINTER (entry->id),
entry);
clutter_timeline_start (entry->timeline);
g_signal_emit (entry->score, score_signals[TIMELINE_STARTED], 0,
entry->timeline);
}
示例11: show_helper_text_title
static void
show_helper_text_title (CalibArea *area)
{
ClutterTransition *transition;
gfloat height = clutter_actor_get_height (area->helper_text_title);
clutter_actor_set_y (area->helper_text_title,
- clutter_actor_get_height (area->helper_text_title));
clutter_actor_show (area->helper_text_title);
transition = clutter_property_transition_new ("y");
clutter_timeline_set_progress_mode (CLUTTER_TIMELINE (transition),
CLUTTER_EASE_OUT);
clutter_timeline_set_duration (CLUTTER_TIMELINE (transition),
HELP_TEXT_ANIMATION_DURATION);
clutter_transition_set_animatable (transition,
CLUTTER_ANIMATABLE (area->helper_text_title));
clutter_transition_set_from (transition, G_TYPE_FLOAT, -height);
clutter_transition_set_to (transition, G_TYPE_FLOAT, 0.0);
g_signal_connect (CLUTTER_TIMELINE (transition),
"completed",
G_CALLBACK (on_helper_text_title_shown),
area);
clutter_timeline_start (CLUTTER_TIMELINE (transition));
g_clear_object (&area->helper_msg_timeline);
area->helper_msg_timeline = transition;
}
示例12: test_timeline_interpolate
void
test_timeline_interpolate (TestConformSimpleFixture *fixture,
gconstpointer data)
{
TestState state;
state.timeline =
clutter_timeline_new (TEST_TIMELINE_DURATION);
clutter_timeline_set_loop (state.timeline, TRUE);
g_signal_connect (G_OBJECT(state.timeline),
"new-frame",
G_CALLBACK(new_frame_cb),
&state);
g_signal_connect (G_OBJECT(state.timeline),
"completed",
G_CALLBACK(completed_cb),
&state);
state.completion_count = 0;
state.new_frame_counter = 0;
state.passed = TRUE;
state.expected_frame = 0;
g_get_current_time (&state.start_time);
clutter_timeline_start (state.timeline);
clutter_main();
g_object_unref (state.timeline);
}
示例13: mex_content_box_toggle_open
static void
mex_content_box_toggle_open (MexContentBox *box)
{
MexContentBoxPrivate *priv = box->priv;
gboolean close_notified, next_is_open;
const gchar *mimetype;
/* search history items should not appear in the "open" state */
mimetype = mex_content_get_metadata (priv->content,
MEX_CONTENT_METADATA_MIMETYPE);
if (!g_strcmp0 (mimetype, "x-mex/search"))
return;
/* if the close animation was cancelled then no notify for the closed state
* will have been sent, therefore notify for the opened state does not need
* to be emitted */
close_notified = (!priv->is_open
&& !clutter_timeline_is_playing (priv->timeline));
next_is_open = !priv->is_open;
if (next_is_open)
{
/* opening */
clutter_timeline_set_direction (priv->timeline,
CLUTTER_TIMELINE_FORWARD);
mx_stylable_set_style_class (MX_STYLABLE (box), "open");
/* refresh the action list */
mex_content_view_set_content (MEX_CONTENT_VIEW (priv->action_list),
priv->content);
priv->extras_visible = TRUE;
if (close_notified)
g_object_notify_by_pspec (G_OBJECT (box), properties[PROP_OPEN]);
mex_push_focus (MX_FOCUSABLE (priv->action_list));
}
else
{
priv->is_closing = TRUE;
/* closing */
mex_push_focus (MX_FOCUSABLE (priv->tile));
clutter_timeline_set_direction (priv->timeline,
CLUTTER_TIMELINE_BACKWARD);
priv->is_closing = FALSE;
priv->extras_visible = TRUE;
}
if (!clutter_timeline_is_playing (priv->timeline))
clutter_timeline_rewind (priv->timeline);
clutter_timeline_start (priv->timeline);
priv->is_open = next_is_open;
}
示例14: test_texture_quality_main
G_MODULE_EXPORT gint
test_texture_quality_main (int argc, char *argv[])
{
ClutterTimeline *timeline;
ClutterAlpha *alpha;
ClutterBehaviour *depth_behavior;
ClutterActor *stage;
ClutterActor *image;
ClutterColor stage_color = { 0x12, 0x34, 0x56, 0xff };
ClutterFog stage_fog = { 10.0, -50.0 };
GError *error;
clutter_init (&argc, &argv);
stage = clutter_stage_get_default ();
clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);
clutter_stage_set_use_fog (CLUTTER_STAGE (stage), TRUE);
clutter_stage_set_fog (CLUTTER_STAGE (stage), &stage_fog);
g_signal_connect (stage,
"button-press-event", G_CALLBACK (clutter_main_quit),
NULL);
error = NULL;
image = clutter_texture_new_from_file (argv[1]?argv[1]:"redhand.png", &error);
if (error)
g_error ("Unable to load image: %s", error->message);
if (!argv[1])
g_print ("Hint: the redhand.png isn't a good test image for this test.\n"
"This test can take any clutter loadable image as an argument\n");
/* center the image */
clutter_actor_set_position (image,
(clutter_actor_get_width (stage) - clutter_actor_get_width (image))/2,
(clutter_actor_get_height (stage) - clutter_actor_get_height (image))/2);
clutter_container_add (CLUTTER_CONTAINER (stage), image, NULL);
timeline = clutter_timeline_new (5000);
g_signal_connect (timeline,
"completed", G_CALLBACK (timeline_completed),
NULL);
alpha = clutter_alpha_new_full (timeline, CLUTTER_LINEAR);
depth_behavior = clutter_behaviour_depth_new (alpha, -2500, 400);
clutter_behaviour_apply (depth_behavior, image);
clutter_actor_show (stage);
clutter_timeline_start (timeline);
g_timeout_add (10000, change_filter, image);
clutter_main ();
g_object_unref (depth_behavior);
g_object_unref (timeline);
return EXIT_SUCCESS;
}
示例15: test_viewport_main
G_MODULE_EXPORT int
test_viewport_main (int argc, char *argv[])
{
ClutterTimeline *timeline;
ClutterAlpha *alpha;
ClutterBehaviour *r_behave;
ClutterActor *stage;
ClutterActor *hand;
ClutterColor stage_color = { 0xcc, 0xcc, 0xcc, 0xff };
gchar *file;
clutter_init (&argc, &argv);
stage = clutter_stage_get_default ();
clutter_stage_set_color (CLUTTER_STAGE (stage),
&stage_color);
/* Make a hand */
file = g_build_filename (TESTS_DATADIR, "redhand.png", NULL);
hand = clutter_texture_new_from_file (file, NULL);
if (!hand)
g_error("Unable to load image '%s'", file);
g_free (file);
clutter_actor_set_position (hand, 300, 200);
clutter_actor_set_clip (hand, 20, 21, 132, 170);
clutter_actor_set_anchor_point (hand, 86, 125);
clutter_actor_show (hand);
clutter_container_add_actor (CLUTTER_CONTAINER (stage), hand);
/* Make a timeline */
timeline = clutter_timeline_new (7692);
clutter_timeline_set_loop (timeline, TRUE);
/* Set an alpha func to power behaviour */
alpha = clutter_alpha_new_full (timeline, CLUTTER_LINEAR);
/* Create a behaviour for that alpha */
r_behave = clutter_behaviour_rotate_new (alpha,
CLUTTER_Z_AXIS,
CLUTTER_ROTATE_CW,
0.0, 360.0);
/* Apply it to our actor */
clutter_behaviour_apply (r_behave, hand);
/* start the timeline and thus the animations */
clutter_timeline_start (timeline);
clutter_actor_show_all (stage);
clutter_main();
g_object_unref (r_behave);
return 0;
}