[ease: 7/9] Transitions working again.
- From: Nate Stedman <natesm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ease: 7/9] Transitions working again.
- Date: Sun, 30 May 2010 23:28:37 +0000 (UTC)
commit d69c4cff0b5cea83a516c4bf6adf96ca6483fe34
Author: Nate Stedman <natesm gmail com>
Date: Sun May 30 19:21:39 2010 -0400
Transitions working again.
src/Main.vala | 3 +-
src/Transitions.vala | 115 +++++++++++++++++++++++++++++---------------------
2 files changed, 68 insertions(+), 50 deletions(-)
---
diff --git a/src/Main.vala b/src/Main.vala
index 2d3dd6e..0093c37 100644
--- a/src/Main.vala
+++ b/src/Main.vala
@@ -53,8 +53,6 @@ public static class Ease.Main : GLib.Object
*/
public static int main(string[] args)
{
- Transitions.test();
-
// parse command line options
var context = new OptionContext(_(" - a presentation editor"));
@@ -81,6 +79,7 @@ public static class Ease.Main : GLib.Object
ClutterGst.init(ref args);
// initalize static classes
+ Transitions.init();
OpenDialog.init();
windows = new Gee.ArrayList<EditorWindow>();
diff --git a/src/Transitions.vala b/src/Transitions.vala
index e989e5f..16f417f 100644
--- a/src/Transitions.vala
+++ b/src/Transitions.vala
@@ -22,56 +22,75 @@
* information about each transition and each transition's variants.
*/
public static class Ease.Transitions : GLib.Object
-{
- private const TransitionVariant[] directions = { TransitionVariant.UP,
- TransitionVariant.DOWN,
- TransitionVariant.LEFT,
- TransitionVariant.RIGHT };
-
- private const Transition[] transitions = {
- { TransitionType.NONE },
- { TransitionType.FADE },
- { TransitionType.SLIDE, directions },
- { TransitionType.DROP },
- { TransitionType.PIVOT,
- { TransitionVariant.TOP_LEFT,
- TransitionVariant.TOP_RIGHT,
- TransitionVariant.BOTTOM_LEFT,
- TransitionVariant.BOTTOM_RIGHT } },
- { TransitionType.FLIP,
- { TransitionVariant.TOP_TO_BOTTOM,
- TransitionVariant.BOTTOM_TO_TOP,
- TransitionVariant.LEFT_TO_RIGHT,
- TransitionVariant.RIGHT_TO_LEFT } },
- { TransitionType.REVOLVING_DOOR,
- directions },
- { TransitionType.REVEAL, directions },
- { TransitionType.FALL },
- { TransitionType.SLATS },
- { TransitionType.OPEN_DOOR },
- { TransitionType.ZOOM,
- { TransitionVariant.CENTER,
- TransitionVariant.TOP_LEFT,
- TransitionVariant.TOP_RIGHT,
- TransitionVariant.BOTTOM_LEFT,
- TransitionVariant.BOTTOM_RIGHT } },
- { TransitionType.PANEL, directions },
- { TransitionType.SPIN_CONTENTS,
- { TransitionVariant.LEFT,
- TransitionVariant.RIGHT } },
- { TransitionType.SWING_CONTENTS },
- { TransitionType.SLIDE_CONTENTS,
- directions },
- { TransitionType.SPRING_CONTENTS,
- { TransitionVariant.UP,
- TransitionVariant.DOWN } },
- { TransitionType.ZOOM_CONTENTS,
- { TransitionVariant.IN,
- TransitionVariant.OUT } }
- };
+{
+ private static Transition[] transitions;
public static int size { get { return transitions.length; } }
+ public static void init()
+ {
+ transitions = {
+ Transition() { type = TransitionType.NONE, variants = {} },
+ Transition() { type = TransitionType.FADE, variants = {} },
+ Transition() { type = TransitionType.SLIDE,
+ variants = { TransitionVariant.UP,
+ TransitionVariant.DOWN,
+ TransitionVariant.LEFT,
+ TransitionVariant.RIGHT } },
+ Transition() { type = TransitionType.DROP, variants = {} },
+ Transition() { type = TransitionType.PIVOT,
+ variants = { TransitionVariant.TOP_LEFT,
+ TransitionVariant.TOP_RIGHT,
+ TransitionVariant.BOTTOM_LEFT,
+ TransitionVariant.BOTTOM_RIGHT } },
+ Transition() { type = TransitionType.FLIP,
+ variants = { TransitionVariant.TOP_TO_BOTTOM,
+ TransitionVariant.BOTTOM_TO_TOP,
+ TransitionVariant.LEFT_TO_RIGHT,
+ TransitionVariant.RIGHT_TO_LEFT } },
+ Transition() { type = TransitionType.REVOLVING_DOOR,
+ variants = { TransitionVariant.UP,
+ TransitionVariant.DOWN,
+ TransitionVariant.LEFT,
+ TransitionVariant.RIGHT } },
+ Transition() { type = TransitionType.REVEAL,
+ variants = { TransitionVariant.UP,
+ TransitionVariant.DOWN,
+ TransitionVariant.LEFT,
+ TransitionVariant.RIGHT } },
+ Transition() { type = TransitionType.FALL, variants = {} },
+ Transition() { type = TransitionType.SLATS, variants = {} },
+ Transition() { type = TransitionType.OPEN_DOOR, variants = {} },
+ Transition() { type = TransitionType.ZOOM,
+ variants = { TransitionVariant.CENTER,
+ TransitionVariant.TOP_LEFT,
+ TransitionVariant.TOP_RIGHT,
+ TransitionVariant.BOTTOM_LEFT,
+ TransitionVariant.BOTTOM_RIGHT } },
+ Transition() { type = TransitionType.PANEL,
+ variants = { TransitionVariant.UP,
+ TransitionVariant.DOWN,
+ TransitionVariant.LEFT,
+ TransitionVariant.RIGHT } },
+ Transition() { type = TransitionType.SPIN_CONTENTS,
+ variants = { TransitionVariant.LEFT,
+ TransitionVariant.RIGHT } },
+ Transition() { type = TransitionType.SWING_CONTENTS,
+ variants = {} },
+ Transition() { type = TransitionType.SLIDE_CONTENTS,
+ variants = { TransitionVariant.UP,
+ TransitionVariant.DOWN,
+ TransitionVariant.LEFT,
+ TransitionVariant.RIGHT } },
+ Transition() { type = TransitionType.SPRING_CONTENTS,
+ variants = { TransitionVariant.UP,
+ TransitionVariant.DOWN } },
+ Transition() { type = TransitionType.ZOOM_CONTENTS,
+ variants = { TransitionVariant.IN,
+ TransitionVariant.OUT } }
+ };
+ }
+
/**
* Returns the string name of a transition.
*
@@ -274,7 +293,7 @@ public static class Ease.Transitions : GLib.Object
get_name(transitions[i].type),
transitions[i].variants.length);
- for (int j = 0; j < transitions[i].variants.length; i++)
+ for (int j = 0; j < transitions[i].variants.length; j++)
{
stdout.printf("\t\t%s\n",
get_variant_name(transitions[i].variants[j]));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]