Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[opt] Upgrade to Clutter 0.9

Uses of ClutterLabel have been replaced with ClutterText.

Instead of setting the alpha function be CLUTTER_ALPHA_RAMP_DEC when
removing the menu, the timeline is now played in reverse.
  • Loading branch information...
commit 5233cc78fbf6ea8f9ffdc1332cb823f6423ee175 1 parent 71797a9
@bpeel bpeel authored
View
2  opt/configure.ac
@@ -9,7 +9,7 @@ AC_ISC_POSIX
AC_PROG_CC
AC_STDC_HEADERS
-PKG_CHECK_MODULES(DEPS, gdk-pixbuf-2.0 clutter-0.8)
+PKG_CHECK_MODULES(DEPS, gdk-pixbuf-2.0 clutter-0.9)
AC_SUBST(DEPS_CFLAGS)
AC_SUBST(DEPS_LIBS)
View
27 opt/opt-menu.c
@@ -222,8 +222,7 @@ opt_menu_new (OptShow * show)
G_CALLBACK (opt_menu_hide_cb), menu);
menu->priv->alpha = clutter_alpha_new_full (menu->priv->timeline,
- CLUTTER_ALPHA_RAMP_INC,
- NULL, NULL);
+ CLUTTER_LINEAR);
menu->priv->behaviour_s =
clutter_behaviour_scale_new (menu->priv->alpha,
@@ -302,13 +301,13 @@ opt_menu_select_item (OptMenu * menu, gint slide_no)
clutter_group_get_nth_child (CLUTTER_GROUP (menu),
menu->priv->active_item + 2);
- clutter_label_set_color (CLUTTER_LABEL (active),
- &menu->priv->color_normal);
+ clutter_text_set_color (CLUTTER_TEXT (active),
+ &menu->priv->color_normal);
active = clutter_group_get_nth_child (CLUTTER_GROUP (menu),
slide_no + 2);
- clutter_label_set_color (CLUTTER_LABEL (active), &menu->priv->color_sel);
+ clutter_text_set_color (CLUTTER_TEXT (active), &menu->priv->color_sel);
clutter_actor_set_position (CLUTTER_ACTOR (menu->priv->selection),
MENU_BORDER, slide_no * ITEM_HEIGHT);
@@ -395,19 +394,19 @@ opt_menu_add_slide (OptMenu * menu, OptSlide * slide)
gchar * text = NULL;
const gchar * font = DEFAULT_FONT;
- const ClutterLabel * title = CLUTTER_LABEL (opt_slide_get_title (slide));
+ const ClutterText * title = CLUTTER_TEXT (opt_slide_get_title (slide));
ClutterActor * label;
if (title)
text = g_strdup_printf ("Slide %d: %s", menu->priv->item_count + 1,
- clutter_label_get_text ((ClutterLabel*)title));
+ clutter_text_get_text ((ClutterText*)title));
else
text = g_strdup_printf ("Slide %d", menu->priv->item_count + 1);
if (!menu->priv->item_count)
- label = clutter_label_new_full (font, text, &menu->priv->color_sel);
+ label = clutter_text_new_full (font, text, &menu->priv->color_sel);
else
- label = clutter_label_new_full (font, text, &menu->priv->color_normal);
+ label = clutter_text_new_full (font, text, &menu->priv->color_normal);
g_free (text);
@@ -436,8 +435,8 @@ opt_menu_pop (OptMenu * menu)
clutter_actor_get_size (CLUTTER_ACTOR (menu), &width, &height);
clutter_actor_set_scale (CLUTTER_ACTOR (menu), 0.0, 0.0);
- clutter_alpha_set_func (menu->priv->alpha, CLUTTER_ALPHA_RAMP_INC,
- NULL, NULL);
+ clutter_timeline_set_direction (menu->priv->timeline,
+ CLUTTER_TIMELINE_FORWARD);
clutter_group_add (CLUTTER_GROUP(stage), CLUTTER_ACTOR(menu));
@@ -456,6 +455,7 @@ opt_menu_pop (OptMenu * menu)
menu->priv->timeout_id = g_timeout_add (5000, opt_menu_timeout_cb, menu);
menu->priv->hiding = FALSE;
+ clutter_timeline_rewind (menu->priv->timeline);
clutter_timeline_start (menu->priv->timeline);
}
}
@@ -485,10 +485,11 @@ opt_menu_popdown (OptMenu * menu)
}
clutter_actor_set_scale (CLUTTER_ACTOR (menu), 1.0, 1.0);
- clutter_alpha_set_func (menu->priv->alpha, CLUTTER_ALPHA_RAMP_DEC,
- NULL, NULL);
+ clutter_timeline_set_direction (menu->priv->timeline,
+ CLUTTER_TIMELINE_BACKWARD);
menu->priv->hiding = TRUE;
+ clutter_timeline_rewind (menu->priv->timeline);
clutter_timeline_start (menu->priv->timeline);
}
}
View
18 opt/opt-show.c
@@ -269,8 +269,8 @@ opt_show_new (void)
show = g_object_new (OPT_TYPE_SHOW, NULL);
show->priv->bullet_texture
- = clutter_label_new_with_text (show->priv->bullet_font, "");
- clutter_label_set_color (CLUTTER_LABEL(show->priv->bullet_texture), &col);
+ = clutter_text_new_with_text (show->priv->bullet_font, "");
+ clutter_text_set_color (CLUTTER_TEXT(show->priv->bullet_texture), &col);
show->priv->bg = g_object_new (CLUTTER_TYPE_TEXTURE, NULL);
@@ -284,13 +284,13 @@ opt_show_new (void)
ClutterActor*
opt_show_bullet_clone (OptShow *show)
{
- return clutter_label_new_with_text (show->priv->bullet_font, "");
+ return clutter_text_new_with_text (show->priv->bullet_font, "");
}
void
opt_show_set_bullet_color (OptShow *show, ClutterColor *col)
{
- clutter_label_set_color (CLUTTER_LABEL(show->priv->bullet_texture), col);
+ clutter_text_set_color (CLUTTER_TEXT(show->priv->bullet_texture), col);
}
void
@@ -306,7 +306,7 @@ opt_show_add_slide (OptShow *self, OptSlide *slide)
bg = CLUTTER_ACTOR(opt_slide_get_background_texture (slide));
if (bg == NULL)
- bg = clutter_clone_texture_new(CLUTTER_TEXTURE(self->priv->bg));
+ bg = clutter_clone_new(self->priv->bg);
clutter_actor_set_size (bg,
clutter_actor_get_width (stage),
@@ -360,7 +360,7 @@ opt_show_update_position_label (OptShow *show)
priv->current_slide_num + 1,
priv->num_slides);
- clutter_label_set_text (CLUTTER_LABEL (priv->position_label), pos);
+ clutter_text_set_text (CLUTTER_TEXT (priv->position_label), pos);
clutter_texture_get_base_size (CLUTTER_TEXTURE (priv->position_label),
&label_width,
&label_height);
@@ -654,9 +654,9 @@ opt_show_toggle_position (OptShow *show)
clutter_actor_set_geometry (rect, &rect_geom);
- label = clutter_label_new_with_text ("Sans Bold 20", "0/0");
- clutter_label_set_color (CLUTTER_LABEL (label),
- &label_color);
+ label = clutter_text_new_with_text ("Sans Bold 20", "0/0");
+ clutter_text_set_color (CLUTTER_TEXT (label),
+ &label_color);
clutter_actor_set_position (label, rect_geom.x + 10, rect_geom.y + 10);
clutter_group_add_many (CLUTTER_GROUP (stage),
View
14 opt/opt-slide.c
@@ -108,11 +108,11 @@ opt_slide_set_title (OptSlide *slide,
{
gchar *default_font = NULL;
g_object_get (priv->show, "title-font", &default_font, NULL);
- priv->title = clutter_label_new_with_text (default_font, title);
+ priv->title = clutter_text_new_with_text (default_font, title);
g_free (default_font);
}
else
- priv->title = clutter_label_new_with_text (font, title);
+ priv->title = clutter_text_new_with_text (font, title);
clutter_group_add (CLUTTER_GROUP(slide), priv->title);
@@ -128,7 +128,7 @@ opt_slide_set_title (OptSlide *slide,
clutter_actor_set_size (CLUTTER_ACTOR(priv->title), avail_w, -1);
- clutter_label_set_color (CLUTTER_LABEL(priv->title), col);
+ clutter_text_set_color (CLUTTER_TEXT(priv->title), col);
clutter_actor_set_position (priv->title, border, border);
@@ -194,14 +194,14 @@ opt_slide_add_bullet_text_item (OptSlide *slide,
gchar *default_font = NULL;
g_object_get (priv->show, "bullet-font", &default_font, NULL);
- bullet = clutter_label_new_with_text (default_font, title);
+ bullet = clutter_text_new_with_text (default_font, title);
g_free (default_font);
}
else
- bullet = clutter_label_new_with_text (font, title);
+ bullet = clutter_text_new_with_text (font, title);
- clutter_label_set_color (CLUTTER_LABEL(bullet), col);
- clutter_label_set_line_wrap (CLUTTER_LABEL (bullet), TRUE);
+ clutter_text_set_color (CLUTTER_TEXT(bullet), col);
+ clutter_text_set_line_wrap (CLUTTER_TEXT (bullet), TRUE);
get_next_bullet_offsets (slide, &x, &y, &width);
Please sign in to comment.
Something went wrong with that request. Please try again.