static void completed (ClutterState *state, gpointer data) { g_print ("Completed transitioning to state: %s\n", clutter_state_get_state (state)); if (g_str_equal (clutter_state_get_state (state), "right")) { /* skip straight to left state when reaching right */ clutter_state_warp_to_state (state, "left"); } }
static void _set_next_state (ClutterState *transitions, gpointer user_data) { const gchar *current = clutter_state_get_state (transitions); gchar *next_state = "start"; if (g_strcmp0 (current, "start") == 0) next_state = "x-cw"; else if (g_strcmp0 (current, "x-cw") == 0) next_state = "x-ccw"; else if (g_strcmp0 (current, "x-ccw") == 0) next_state = "x-after"; else if (g_strcmp0 (current, "x-after") == 0) next_state = "y-cw"; else if (g_strcmp0 (current, "y-cw") == 0) next_state = "y-ccw"; else if (g_strcmp0 (current, "y-ccw") == 0) next_state = "y-after"; else if (g_strcmp0 (current, "y-after") == 0) next_state = "z-cw"; else if (g_strcmp0 (current, "z-cw") == 0) next_state = "z-ccw"; clutter_state_set_state (transitions, next_state); }
static void completed (ClutterState *state, gpointer data) { if (g_str_equal (clutter_state_get_state (state), "right")) { /* skip straight to left state when reaching right */ clutter_state_warp_to_state (state, "left"); } else if (g_str_equal (clutter_state_get_state (state), "active")) clutter_state_set_state (state, "right"); else { clutter_state_set_state (state, "active"); } times --; if (times <=0) clutter_main_quit (); }
static void next_state (ClutterState *transitions, gpointer user_data) { const gchar *state = clutter_state_get_state (transitions); if (g_strcmp0 (state, "right") == 0) clutter_state_set_state (transitions, "left"); else clutter_state_set_state (transitions, "right"); }
static gboolean button_pressed_cb (ClutterActor *actor, ClutterEvent *event, gpointer user_data) { ClutterState *transitions = CLUTTER_STATE (user_data); if (g_strcmp0 (clutter_state_get_state (transitions), "folded") == 0) clutter_state_set_state (transitions, "unfolded"); else clutter_state_set_state (transitions, "folded"); return TRUE; }