[ease: 4/9] Loading and saving to files again.
- From: Nate Stedman <natesm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ease: 4/9] Loading and saving to files again.
- Date: Sun, 30 May 2010 23:28:22 +0000 (UTC)
commit cadc37d8214b7476b17c2d549907a2db784d05b0
Author: Nate Stedman <natesm gmail com>
Date: Sun May 30 16:23:05 2010 -0400
Loading and saving to files again.
Examples/Example.ease/Document.json | 40 +++++++++++-----------
src/JSONParser.vala | 6 ++-
src/Transitions.vala | 62 +++++++++++++++++-----------------
3 files changed, 55 insertions(+), 53 deletions(-)
---
diff --git a/Examples/Example.ease/Document.json b/Examples/Example.ease/Document.json
index 52d4135..3437b26 100644
--- a/Examples/Example.ease/Document.json
+++ b/Examples/Example.ease/Document.json
@@ -2,20 +2,16 @@
"height" : "480",
"slides" : [
{
- "background_image" : "Media/Themes/Pink/Background.svg",
- "variant" : "Left",
- "transition" : "Spin Contents",
- "transition_time" : "1",
"elements" : [
{
"font_variant" : "Normal",
"y" : "26",
"x" : "41",
- "element_type" : "text",
- "font_style" : "Normal",
"height" : "188",
+ "font_style" : "Normal",
"text" : "See Ease.
See Ease Run.",
+ "element_type" : "text",
"green" : "255",
"align" : "left",
"width" : "556",
@@ -26,15 +22,13 @@ See Ease Run.",
"font_name" : "Myriad Pro",
"font_size" : "72"
}
- ]
+ ],
+ "background_image" : "Media/Themes/Pink/Background.svg",
+ "variant" : "0",
+ "transition" : "10",
+ "transition_time" : "1"
},
{
- "blue" : "0",
- "green" : "0",
- "variant" : "Up",
- "red" : "0",
- "transition" : "Panel",
- "transition_time" : "1",
"elements" : [
{
"element_type" : "image",
@@ -48,13 +42,15 @@ See Ease Run.",
"filename" : "Media/psyduck.jpg",
"ease_name" : "psyduck"
}
- ]
+ ],
+ "blue" : "0",
+ "green" : "0",
+ "variant" : "0",
+ "red" : "0",
+ "transition" : "10",
+ "transition_time" : "1"
},
{
- "background_image" : "Media/Themes/Pink/Background.svg",
- "variant" : "",
- "transition" : "Drop",
- "transition_time" : "1",
"elements" : [
{
"element_type" : "image",
@@ -104,8 +100,12 @@ See Ease Run.",
"filename" : "Media/psyduck.jpg",
"ease_name" : "psyduck"
}
- ]
+ ],
+ "background_image" : "Media/Themes/Pink/Background.svg",
+ "variant" : "0",
+ "transition" : "0",
+ "transition_time" : "1"
}
],
"width" : "640"
-}
+}
\ No newline at end of file
diff --git a/src/JSONParser.vala b/src/JSONParser.vala
index de08aa1..fb5f808 100644
--- a/src/JSONParser.vala
+++ b/src/JSONParser.vala
@@ -152,8 +152,10 @@ public static class Ease.JSONParser
var obj = new Json.Object();
// write the slide's transition properties
- obj.set_string_member("transition", slide.transition.to_string());
- obj.set_string_member("variant", slide.variant.to_string());
+ obj.set_string_member("transition",
+ ((int)slide.transition).to_string());
+ obj.set_string_member("variant",
+ ((int)slide.variant).to_string());
obj.set_string_member("transition_time",
slide.transition_time.to_string());
diff --git a/src/Transitions.vala b/src/Transitions.vala
index 1577c17..b5dce50 100644
--- a/src/Transitions.vala
+++ b/src/Transitions.vala
@@ -23,50 +23,50 @@
*/
public static class Ease.Transitions : GLib.Object
{
- private static TransitionVariant[] directions = { TransitionVariant.UP,
- TransitionVariant.DOWN,
- TransitionVariant.LEFT,
- TransitionVariant.RIGHT };
+ private const TransitionVariant[] directions = { TransitionVariant.UP,
+ TransitionVariant.DOWN,
+ TransitionVariant.LEFT,
+ TransitionVariant.RIGHT };
- private static Transition[] transitions = {
- Transition() { type = TransitionType.NONE, variants = {} },
- Transition() { type = TransitionType.FADE, variants = {} },
- Transition() { type = TransitionType.SLIDE, variants = directions },
- Transition() { type = TransitionType.DROP, variants = {} },
- Transition() { type = TransitionType.PIVOT,
- variants = { TransitionVariant.TOP_LEFT,
+ 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 } },
- Transition() { type = TransitionType.FLIP,
- variants = { TransitionVariant.TOP_TO_BOTTOM,
+ { TransitionType.FLIP,
+ { TransitionVariant.TOP_TO_BOTTOM,
TransitionVariant.BOTTOM_TO_TOP,
TransitionVariant.LEFT_TO_RIGHT,
TransitionVariant.RIGHT_TO_LEFT } },
- Transition() { type = TransitionType.REVOLVING_DOOR,
- variants = directions },
- Transition() { type = TransitionType.REVEAL, variants = directions },
- Transition() { type = TransitionType.FALL, variants = {} },
- Transition() { type = TransitionType.SLATS, variants = {} },
- Transition() { type = TransitionType.OPEN_DOOR, variants = {} },
- Transition() { type = TransitionType.ZOOM,
- variants = { TransitionVariant.CENTER,
+ { 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 } },
- Transition() { type = TransitionType.PANEL, variants = directions },
- Transition() { type = TransitionType.SPIN_CONTENTS,
- variants = { TransitionVariant.LEFT,
+ { TransitionType.PANEL, directions },
+ { TransitionType.SPIN_CONTENTS,
+ { TransitionVariant.LEFT,
TransitionVariant.RIGHT } },
- Transition() { type = TransitionType.SWING_CONTENTS, variants = {} },
- Transition() { type = TransitionType.SLIDE_CONTENTS,
- variants = directions },
- Transition() { type = TransitionType.SPRING_CONTENTS,
- variants = { TransitionVariant.UP,
+ { TransitionType.SWING_CONTENTS },
+ { TransitionType.SLIDE_CONTENTS,
+ directions },
+ { TransitionType.SPRING_CONTENTS,
+ { TransitionVariant.UP,
TransitionVariant.DOWN } },
- Transition() { type = TransitionType.ZOOM_CONTENTS,
- variants = { TransitionVariant.IN,
+ { TransitionType.ZOOM_CONTENTS,
+ { TransitionVariant.IN,
TransitionVariant.OUT } }
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]