From 2e6397c39132007e79f5f87743fe9378fd8d5387 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Sun, 13 Dec 2009 01:07:44 +0000 Subject: box-layout: Add knobs for controlling animations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ClutterLayoutManager does not have any state associated with it, and defers all the state to its sub-classes. The BoxLayout is thus in charge of controlling: • whether or not animations should be used • the duration of the animation • the easing mode of the animation By adding three new properties: • ClutterBoxLayout:use-animations • ClutterBoxLayout:easing-duration • ClutterBoxLayout:easing-mode And their relative accessors pairs we can make BoxLayout decide whether or not, and with which parameters, call the begin_animation() method of ClutterLayoutManager. The test-box-layout has been modified to reflect this new functionality, by checking the key-press event for the 'a' key symbol to toggle the use of animations. --- clutter/clutter-box-layout.h | 90 ++++++++++++++++++++++++-------------------- 1 file changed, 50 insertions(+), 40 deletions(-) (limited to 'clutter/clutter-box-layout.h') diff --git a/clutter/clutter-box-layout.h b/clutter/clutter-box-layout.h index be2be9130..035368ac2 100644 --- a/clutter/clutter-box-layout.h +++ b/clutter/clutter-box-layout.h @@ -97,46 +97,56 @@ struct _ClutterBoxLayoutClass GType clutter_box_layout_get_type (void) G_GNUC_CONST; -ClutterLayoutManager *clutter_box_layout_new (void); - -void clutter_box_layout_set_spacing (ClutterBoxLayout *layout, - guint spacing); -guint clutter_box_layout_get_spacing (ClutterBoxLayout *layout); -void clutter_box_layout_set_vertical (ClutterBoxLayout *layout, - gboolean vertical); -gboolean clutter_box_layout_get_vertical (ClutterBoxLayout *layout); -void clutter_box_layout_set_pack_start (ClutterBoxLayout *layout, - gboolean pack_start); -gboolean clutter_box_layout_get_pack_start (ClutterBoxLayout *layout); - -void clutter_box_layout_pack (ClutterBoxLayout *layout, - ClutterActor *actor, - gboolean expand, - gboolean x_fill, - gboolean y_fill, - ClutterBoxAlignment x_align, - ClutterBoxAlignment y_align); -void clutter_box_layout_set_alignment (ClutterBoxLayout *layout, - ClutterActor *actor, - ClutterBoxAlignment x_align, - ClutterBoxAlignment y_align); -void clutter_box_layout_get_alignment (ClutterBoxLayout *layout, - ClutterActor *actor, - ClutterBoxAlignment *x_align, - ClutterBoxAlignment *y_align); -void clutter_box_layout_set_fill (ClutterBoxLayout *layout, - ClutterActor *actor, - gboolean x_fill, - gboolean y_fill); -void clutter_box_layout_get_fill (ClutterBoxLayout *layout, - ClutterActor *actor, - gboolean *x_fill, - gboolean *y_fill); -void clutter_box_layout_set_expand (ClutterBoxLayout *layout, - ClutterActor *actor, - gboolean expand); -gboolean clutter_box_layout_get_expand (ClutterBoxLayout *layout, - ClutterActor *actor); +ClutterLayoutManager *clutter_box_layout_new (void); + +void clutter_box_layout_set_spacing (ClutterBoxLayout *layout, + guint spacing); +guint clutter_box_layout_get_spacing (ClutterBoxLayout *layout); +void clutter_box_layout_set_vertical (ClutterBoxLayout *layout, + gboolean vertical); +gboolean clutter_box_layout_get_vertical (ClutterBoxLayout *layout); +void clutter_box_layout_set_pack_start (ClutterBoxLayout *layout, + gboolean pack_start); +gboolean clutter_box_layout_get_pack_start (ClutterBoxLayout *layout); + +void clutter_box_layout_pack (ClutterBoxLayout *layout, + ClutterActor *actor, + gboolean expand, + gboolean x_fill, + gboolean y_fill, + ClutterBoxAlignment x_align, + ClutterBoxAlignment y_align); +void clutter_box_layout_set_alignment (ClutterBoxLayout *layout, + ClutterActor *actor, + ClutterBoxAlignment x_align, + ClutterBoxAlignment y_align); +void clutter_box_layout_get_alignment (ClutterBoxLayout *layout, + ClutterActor *actor, + ClutterBoxAlignment *x_align, + ClutterBoxAlignment *y_align); +void clutter_box_layout_set_fill (ClutterBoxLayout *layout, + ClutterActor *actor, + gboolean x_fill, + gboolean y_fill); +void clutter_box_layout_get_fill (ClutterBoxLayout *layout, + ClutterActor *actor, + gboolean *x_fill, + gboolean *y_fill); +void clutter_box_layout_set_expand (ClutterBoxLayout *layout, + ClutterActor *actor, + gboolean expand); +gboolean clutter_box_layout_get_expand (ClutterBoxLayout *layout, + ClutterActor *actor); + +void clutter_box_layout_set_use_animations (ClutterBoxLayout *layout, + gboolean animate); +gboolean clutter_box_layout_get_use_animations (ClutterBoxLayout *layout); +void clutter_box_layout_set_easing_mode (ClutterBoxLayout *layout, + gulong mode); +gulong clutter_box_layout_get_easing_mode (ClutterBoxLayout *layout); +void clutter_box_layout_set_easing_duration (ClutterBoxLayout *layout, + guint msecs); +guint clutter_box_layout_get_easing_duration (ClutterBoxLayout *layout); G_END_DECLS -- cgit v1.2.1