On Dec 28, 2007 9:35 PM, Jaap A. Haitsma <[EMAIL PROTECTED]> wrote:
> On Dec 27, 2007 11:23 PM, Emmanuele Bassi <[EMAIL PROTECTED]> wrote:
> >
> >
> > On Wed, 2007-12-26 at 23:09 +0100, Jaap A. Haitsma wrote:
> > > Hi,
> > >
> > > I'm trying to make the clutter-toy woohaa work with clutter 0.5.
> > >
> > > I think I changed the functions in the right way, but the resulting
> > > program does not behave the same.
> > >
> > > Can anybody look at the attached patch and tell me what I'm doing wrong?
> >
> > the patch looks fine to me, but what kind of regressions do you see?
>
> 1) The startup effect has the desktop dissapearing in the center of
> the screen in 0.4. In 0.5 it's the top left
> 2) I don't see thumbnails of the video anymore in 0.5
> 3) The menu doesn't contain text anymore in 0.5
> 4) If I press a couple of buttons (remember I don't see the
> thumbnails) a video plays but after the video has played the menu
> (again without text) has moved in the top left direction and is only
> partially visible
>
> I attached an updated patch which makes woohaa compile against
> clutter SVN of today.
>
I think I figured out what's causing most of these problems.
clutter_actor_scale behaves differently in 0.5. If you look at the
test test-scale you see that in 0.4 all the scaling is being done from
the top-right corner while in 0.5 it's done from the top left corner.
I guess this probably has to do with anchor_point API addition to 0.5.
I've attached a patch for foofone of clutter-toys. If you press a
button the button moves when it gets scaled.
Any idea what needs to be done to get the 0.4 applications that use
scaling to work again correctly under 0.5?
Jaap
Index: foofone.c
===================================================================
--- foofone.c (revision 1793)
+++ foofone.c (working copy)
@@ -43,7 +43,7 @@
{
App *app = (App*)user_data;
/* reset the now hidden dialing screen */
- clutter_actor_rotate_y (app->screen_dial, 0, CSW/2, 0);
+ clutter_actor_set_rotation (app->screen_dial, CLUTTER_Y_AXIS, 0, CSW/2, 0, 0);
g_object_unref (timeline);
}
@@ -60,7 +60,7 @@
/* switch visibility half way through rotation. shouldn't
* really keep calling this though.
*/
- clutter_actor_rotate_y (app->screen_dial, 0.0, CSW/2, 0);
+ clutter_actor_set_rotation (app->screen_dial, CLUTTER_Y_AXIS, 0.0, CSW/2, 0, 0);
clutter_actor_hide_all (app->screen_dial);
clutter_actor_show_all (app->screen_dialpad);
@@ -68,15 +68,17 @@
clutter_actor_show (app->buttons[i]->actor);
}
- clutter_actor_rotate_y (CLUTTER_ACTOR(app->screen_dial),
- - (float)frame_num * 6, /* 180/30 = 6 */
- CSW/2,
- 0);
+ clutter_actor_set_rotation (CLUTTER_ACTOR(app->screen_dial), CLUTTER_Y_AXIS,
+ - (float)frame_num * 6, /* 180/30 = 6 */
+ CSW/2,
+ 0,
+ 0);
- clutter_actor_rotate_y (CLUTTER_ACTOR(app->screen_dialpad),
- 180 - (frame_num * 6),
- CSW/2,
- 0);
+ clutter_actor_set_rotation (CLUTTER_ACTOR(app->screen_dialpad), CLUTTER_Y_AXIS,
+ 180 - (frame_num * 6),
+ CSW/2,
+ 0,
+ 0);
}
void
@@ -156,24 +158,24 @@
ClutterKnot knots[2];
/* Doh effect should set initial values */
- clutter_actor_set_scale_with_gravity (app->screen_dial,
- 0.1,
- 0.1,
- CLUTTER_GRAVITY_CENTER);
+
+ clutter_actor_set_anchor_point_from_gravity (app->screen_dial, CLUTTER_GRAVITY_CENTER);
+
+ clutter_actor_set_scale (app->screen_dial, 0.1, 0.1);
clutter_actor_set_opacity (app->screen_dial, 0);
clutter_actor_show_all (app->screen_dial);
/* zoom in the dialing window */
+ clutter_actor_set_opacity (app->screen_dial, 0x66);
clutter_effect_fade (app->call_effect_tmpl,
app->screen_dial,
- 0x66,
0xff,
NULL,
NULL);
-
+ clutter_actor_set_anchor_point_from_gravity (app->screen_dial, CLUTTER_GRAVITY_CENTER);
+ clutter_actor_set_scale (app->screen_dial, 0.1, 0.1);
clutter_effect_scale (app->call_effect_tmpl,
app->screen_dial,
- 0.1,
1.0,
CLUTTER_GRAVITY_CENTER,
NULL,
@@ -204,16 +206,16 @@
break;
}
- clutter_effect_move (app->call_effect_tmpl,
+ clutter_effect_path (app->call_effect_tmpl,
app->buttons[i]->actor,
knots,
2,
NULL,
NULL);
+ clutter_actor_set_opacity (app->screen_dial, 0xff);
clutter_effect_fade (app->call_effect_tmpl,
app->buttons[i]->actor,
- 0xff,
0x0,
NULL,
NULL);
@@ -227,7 +229,7 @@
/* HACK: Note, here we kind of assume this timeline will complete
* last but that is not guarenteed because of dropped frames etc.
*/
- clutter_effect_move (app->call_effect_tmpl,
+ clutter_effect_path (app->call_effect_tmpl,
app->dpy,
knots,
2,
@@ -243,8 +245,8 @@
/* reset after effect */
clutter_actor_set_opacity (b->actor, 0xff);
- clutter_actor_set_scale_with_gravity (b->actor, 1.0, 1.0,
- CLUTTER_GRAVITY_CENTER);
+ clutter_actor_set_anchor_point_from_gravity (b->actor, CLUTTER_GRAVITY_CENTER);
+ clutter_actor_set_scale (b->actor, 1.0, 1.0);
b->pressed_fadeout = NULL;
}
@@ -256,16 +258,17 @@
if (b->pressed_fadeout)
return;
+ clutter_actor_set_opacity (b->actor, 0xff);
b->pressed_fadeout = clutter_effect_fade (app->button_effect_tmpl,
b->actor,
- 0xff,
0,
NULL,
NULL);
+ clutter_actor_set_anchor_point_from_gravity (b->actor, CLUTTER_GRAVITY_CENTER);
+ clutter_actor_set_scale (b->actor, 1.0, 1.0);
b->pressed_scale = clutter_effect_scale (app->button_effect_tmpl,
b->actor,
- 1.0,
2.0,
CLUTTER_GRAVITY_CENTER,
on_button_effect_complete,