[ease] [api] internal-ize Slide.



commit 048837e231638fe8093a288191bede17394cee55
Author: Nate Stedman <natesm gmail com>
Date:   Tue Jul 27 05:58:27 2010 -0400

    [api] internal-ize Slide.
    
    Much of the Slide API has been hidden from external
    callers.

 Makefile.am                             |   16 +++-
 ease-core/ease-actor.vala               |    6 +-
 ease-core/ease-element.vala             |    2 +-
 ease-core/ease-slide.vala               |   58 +++++++++++-
 ease-core/ease-theme.vala               |    1 +
 ease-core/ease-undo-controller.vala     |    2 +-
 ease-core/ease-undo-source.vala         |    2 +-
 src/ease-editor-embed.vala              |   12 ++--
 src/ease-editor-window.vala             |   16 ++--
 src/ease-inspector-element-pane.vala    |    4 +-
 src/ease-inspector-pane.vala            |    4 +-
 src/ease-inspector-slide-pane.vala      |    8 +-
 src/ease-inspector-transition-pane.vala |   20 ++--
 src/ease-inspector-window.vala          |   74 ----------------
 src/ease-inspector.vala                 |    8 +-
 src/ease-slide-actor.vala               |  146 +++++++++++++++---------------
 src/ease-slide-button-panel.vala        |    8 +-
 src/ease-welcome-actor.vala             |    3 +-
 18 files changed, 190 insertions(+), 200 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index bb13166..6999cd8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -16,7 +16,6 @@ ease_SOURCES = \
 	src/ease-inspector-slide-pane.vala \
 	src/ease-inspector-transition-pane.vala \
 	src/ease-inspector.vala \
-	src/ease-inspector-window.vala \
 	src/ease-main.vala \
 	src/ease-player.vala \
 	src/ease-scrollable-embed.vala \
@@ -31,7 +30,9 @@ ease_VALAFLAGS = \
 	--pkg ease-core-0.3 \
 	--pkg flutter-0.3 \
 	$(EASE_PACKAGES) \
-	--vapidir vapi
+	--vapidir vapi \
+	--thread \
+	-g
 
 ease_LDADD = \
 	./ease-core/libease-core-0.3.la \
@@ -52,7 +53,7 @@ AM_CPPFLAGS = \
 	-O0 \
 	$(NULL)
 
-CLEANFILES = src/main.c
+CLEANFILES = $(subst .vala,.c,$(ease_SOURCES))
 
 # distribution
 EXTRA_DIST = data/ease.desktop.in.in  \
@@ -70,6 +71,15 @@ doc: ease-core/*.vala
 	rm -rf doc
 	
 	valadoc \
+		$(EASE_PACKAGES) \
+		--directory=./doc --basedir=src ./ease-core/*.vala
+	
+	gnome-open doc/doc/Ease.html
+
+doc-internal:
+	rm -rf doc
+	
+	valadoc \
 		--internal \
 		$(EASE_PACKAGES) \
 		--directory=./doc --basedir=src ./ease-core/*.vala
diff --git a/ease-core/ease-actor.vala b/ease-core/ease-actor.vala
index 7a318ee..7b9a068 100644
--- a/ease-core/ease-actor.vala
+++ b/ease-core/ease-actor.vala
@@ -21,7 +21,7 @@
  *
  * The Actor class should never be instantiated - instead,
  * subclasses such as { link TextActor} and { link ImageActor}
- * are placed on a { link SlideActor} to form Ease presentations.
+ * are placed on a SlideActor to form Ease presentations.
  */
 public abstract class Ease.Actor : Clutter.Group
 {
@@ -175,7 +175,7 @@ public abstract class Ease.Actor : Clutter.Group
 	/**
 	 * Called when the actor should be edited. Subclasses should override this.
 	 *
-	 * @param sender The { link EditorEmbed} this Actor is on.
+	 * @param sender The widget this Actor is on.
 	 */
 	public virtual void edit(Gtk.Widget sender) {}
 	
@@ -183,7 +183,7 @@ public abstract class Ease.Actor : Clutter.Group
 	 * Called when the actor end editing. Subclasses with editing that is not
 	 * instant (popping up a dialog box) should override this.
 	 *
-	 * @param sender The { link EditorEmbed} this Actor is on.
+	 * @param sender The widget this Actor is on.
 	 */
 	public virtual void end_edit(Gtk.Widget sender) {}
 }
diff --git a/ease-core/ease-element.vala b/ease-core/ease-element.vala
index 29edac6..153ca7f 100644
--- a/ease-core/ease-element.vala
+++ b/ease-core/ease-element.vala
@@ -131,7 +131,7 @@ public abstract class Ease.Element : GLib.Object, UndoSource
 	public abstract Actor actor(ActorContext c);
 	
 	/**
-	 * Returns an { link Inspector} widget for editing this Element.
+	 * Returns an Inspector widget for editing this Element.
 	 */
 	public abstract Gtk.Widget inspector_widget();
 	
diff --git a/ease-core/ease-slide.vala b/ease-core/ease-slide.vala
index 87916a5..d227d0f 100644
--- a/ease-core/ease-slide.vala
+++ b/ease-core/ease-slide.vala
@@ -20,7 +20,7 @@
  *
  * A Slide is owned by a { link Document} and has { link Element}
  * children. The currently selected Slide is often acted upon by an
- * { link EditorWindow}.
+ * EditorWindow (from main Ease, not core).
  */
 public class Ease.Slide : GLib.Object, UndoSource
 {
@@ -29,7 +29,7 @@ public class Ease.Slide : GLib.Object, UndoSource
 	/**
 	 * The { link Element}s contained by this Slide
 	 */
-	public Gee.ArrayList<Element> elements = new Gee.ArrayList<Element>();
+	internal Gee.ArrayList<Element> elements = new Gee.ArrayList<Element>();
 	
 	/**
 	 * The Slide's transition
@@ -149,12 +149,27 @@ public class Ease.Slide : GLib.Object, UndoSource
 	/**
 	 * The { link Document} that this Slide is part of
 	 */
-	public Document parent { get; set; }
+	internal Document parent { get; set; }
+	
+	/**
+	 * The width of the Slide's parent { link Document}.
+	 */
+	public int width { get { return parent.width; } }
+	
+	/**
+	 * The height of the Slide's parent { link Document}.
+	 */
+	public int height { get { return parent.height; } }
+	
+	/**
+	 * The aspect ratio of the Slide's parent { link Document}.
+	 */
+	public float aspect { get { return parent.aspect; } }
 	
 	/**
 	 * The { link Theme} that this Slide is based on.
 	 */
-	public Theme theme { get; set; }
+	internal Theme theme { get; set; }
 	
 	/**
 	 * The number of { link Element}s on this Slide
@@ -538,6 +553,41 @@ public class Ease.Slide : GLib.Object, UndoSource
 	{
 		background_changed(this);
 	}
+	
+	// foreach iteration
+	
+	/**
+	 * Returns an iterator that can be used with foreach.
+	 */
+	public Iterator iterator()
+	{
+		return new Iterator(this);
+	}
+	
+	/**
+	 * Iterates over this Slide's elements.
+	 */
+	public class Iterator
+	{
+		private int i = 0;
+		private Slide self;
+		
+		public Iterator(Slide slide)
+		{
+			self = slide;
+		}
+		
+		public bool next()
+		{
+			return i < self.elements.size;
+		}
+		
+		public Element get()
+		{
+			i++;
+			return self.elements.get(i - 1);
+		}
+	}
 }
 
 public enum Ease.BackgroundType
diff --git a/ease-core/ease-theme.vala b/ease-core/ease-theme.vala
index 99dfc2f..90be618 100644
--- a/ease-core/ease-theme.vala
+++ b/ease-core/ease-theme.vala
@@ -319,6 +319,7 @@ public class Ease.Theme : GLib.Object
 	public Slide? create_slide(string master, int width, int height)
 	{
 		Slide slide = new Slide();
+		slide.theme = this;
 		
 		// set the slide background property
 		switch (master_get(master, BACKGROUND_TYPE))
diff --git a/ease-core/ease-undo-controller.vala b/ease-core/ease-undo-controller.vala
index 1894007..45492bf 100644
--- a/ease-core/ease-undo-controller.vala
+++ b/ease-core/ease-undo-controller.vala
@@ -18,7 +18,7 @@
 /**
  * Controls undo and redo actions.
  *
- * Each { link EditorWindow} has an UndoController that manages undo actions.
+ * Each EditorWindow has an UndoController that manages undo actions.
  */
 public class Ease.UndoController : Object
 {
diff --git a/ease-core/ease-undo-source.vala b/ease-core/ease-undo-source.vala
index 4cffb98..56dafeb 100644
--- a/ease-core/ease-undo-source.vala
+++ b/ease-core/ease-undo-source.vala
@@ -22,7 +22,7 @@ public interface Ease.UndoSource : GLib.Object
 {
 	/**
 	 * Classes that implement the UndoSource interface should use this signal
-	 * to notify a parent controller (typically { link EditorWindow}) of a new
+	 * to notify a parent controller (typically an EditorWindow) of a new
 	 * UndoAction.
 	 */
 	public signal void undo(UndoItem action);
diff --git a/src/ease-editor-embed.vala b/src/ease-editor-embed.vala
index 40405f1..5c58a79 100644
--- a/src/ease-editor-embed.vala
+++ b/src/ease-editor-embed.vala
@@ -341,18 +341,18 @@ public class Ease.EditorEmbed : ScrollableEmbed, UndoSource
 			return;
 		}
 		
-		var w = zoom * document.width;
-		var h = zoom * document.height;
+		var w = zoom * slide_actor.slide.width;
+		var h = zoom * slide_actor.slide.height;
 		
 		slide_actor.set_scale_full(zoom, zoom, 0, 0);
 
 		slide_actor.x = roundd(w < width
-		                            ? width / 2 - w / 2
-	                                : 0);
+		                       ? width / 2 - w / 2
+	                           : 0);
 		        
 		slide_actor.y = roundd(h < height
-		                            ? height / 2 - h / 2
-		                            : 0);
+		                       ? height / 2 - h / 2
+		                       : 0);
 		              
 		if (selection_rectangle != null && selected != null)
 		{
diff --git a/src/ease-editor-window.vala b/src/ease-editor-window.vala
index 959468b..9e8a2d7 100644
--- a/src/ease-editor-window.vala
+++ b/src/ease-editor-window.vala
@@ -156,7 +156,7 @@ public class Ease.EditorWindow : Gtk.Window
 		embed.undo.connect(add_undo_action);
 		
 		// the inspector
-		inspector = new Inspector();
+		inspector = new Inspector(document);
 		(builder.get_object("Inspector Align") as Gtk.Alignment).add(inspector);
 		inspector.undo.connect(add_undo_action);
 		embed.element_selected.connect(
@@ -283,8 +283,8 @@ public class Ease.EditorWindow : Gtk.Window
 	public void new_slide_handler(Gtk.Widget? sender)
 	{
 		var s = document.theme.create_slide(document.DEFAULT_SLIDE,
-		                                    document.width,
-		                                    document.height);
+		                                    slide.width,
+		                                    slide.height);
 		
 		var index = document.index_of(slide) + 1;
 		
@@ -299,7 +299,7 @@ public class Ease.EditorWindow : Gtk.Window
 		var item = sender as Gtk.MenuItem;
 		var s = document.theme.create_slide(
 			Theme.master_from_description(item.get_label()),
-			document.width, document.height);
+			slide.width, slide.height);
 		
 		var index = document.index_of(slide) + 1;
 		
@@ -360,8 +360,8 @@ public class Ease.EditorWindow : Gtk.Window
 	public void insert_text(Gtk.Widget sender)
 	{
 		var text = document.theme.create_custom_text();
-		text.x = document.width / 2 - text.width / 2;
-		text.y = document.height / 2 - text.height / 2;
+		text.x = slide.width / 2 - text.width / 2;
+		text.y = slide.height / 2 - text.height / 2;
 		slide.add(text);
 		add_undo_action(new ElementAddUndoAction(text));
 		embed.select_element(text);
@@ -391,8 +391,8 @@ public class Ease.EditorWindow : Gtk.Window
 				
 				e.width = width;
 				e.height = height;
-				e.x = document.width / 2 - width / 2;
-				e.y = document.height / 2 - width / 2;
+				e.x = slide.width / 2 - width / 2;
+				e.y = slide.height / 2 - width / 2;
 				
 				e.element_type = Slide.IMAGE_TYPE;
 				e.identifier = Theme.CUSTOM_MEDIA;
diff --git a/src/ease-inspector-element-pane.vala b/src/ease-inspector-element-pane.vala
index 2e3f7dc..85a493f 100644
--- a/src/ease-inspector-element-pane.vala
+++ b/src/ease-inspector-element-pane.vala
@@ -21,8 +21,10 @@ internal class Ease.InspectorElementPane : InspectorPane
 	private Gtk.Widget current;
 	private const string UI_FILE_PATH = "inspector-element-none.ui";
 	
-	internal InspectorElementPane()
+	internal InspectorElementPane(Document d)
 	{
+		base(d);
+		
 		// build the "nothing selected" widget
 		var builder = new Gtk.Builder();
 		try
diff --git a/src/ease-inspector-pane.vala b/src/ease-inspector-pane.vala
index b9a2c9d..587a880 100644
--- a/src/ease-inspector-pane.vala
+++ b/src/ease-inspector-pane.vala
@@ -21,9 +21,11 @@
 public abstract class Ease.InspectorPane : Gtk.VBox, UndoSource
 {
 	public Slide slide { get; set; }
+	public Document document { get; set; }
 
-	public InspectorPane()
+	public InspectorPane(Document d)
 	{
+		document = d;
 		homogeneous = false;
 		spacing = 0;
 		
diff --git a/src/ease-inspector-slide-pane.vala b/src/ease-inspector-slide-pane.vala
index abb333b..d73f564 100644
--- a/src/ease-inspector-slide-pane.vala
+++ b/src/ease-inspector-slide-pane.vala
@@ -39,9 +39,9 @@ public class Ease.InspectorSlidePane : InspectorPane
 	
 	private bool silence_undo;
 
-	public InspectorSlidePane()
+	public InspectorSlidePane(Document d)
 	{	
-		base();
+		base(d);
 		
 		// load the GtkBuilder file
 		var builder = new Gtk.Builder();
@@ -134,7 +134,7 @@ public class Ease.InspectorSlidePane : InspectorPane
 					{
 						var fname = dialog.get_filename();
 						slide.background_image_source = fname;
-						var i = slide.parent.add_media_file(fname);
+						var i = document.add_media_file(fname);
 						slide.background_image = i;
 					}
 					catch (GLib.Error e)
@@ -238,7 +238,7 @@ public class Ease.InspectorSlidePane : InspectorPane
 		try
 		{
 			slide.background_image_source = sender.get_filename();
-			var i = slide.parent.add_media_file(sender.get_filename());
+			var i = document.add_media_file(sender.get_filename());
 			slide.background_image = i;
 		}
 		catch (GLib.Error e)
diff --git a/src/ease-inspector-transition-pane.vala b/src/ease-inspector-transition-pane.vala
index acf9274..fdb9791 100644
--- a/src/ease-inspector-transition-pane.vala
+++ b/src/ease-inspector-transition-pane.vala
@@ -46,9 +46,9 @@ public class Ease.InspectorTransitionPane : InspectorPane
 	// silence undo if needed
 	private bool silence_undo;
 	
-	public InspectorTransitionPane()
+	public InspectorTransitionPane(Document d)
 	{
-		base();
+		base(d);
 		
 		// preview
 		preview = new GtkClutter.Embed();
@@ -230,8 +230,8 @@ public class Ease.InspectorTransitionPane : InspectorPane
 		
 		// automatically scale the preview to fit in the embed
 		preview.get_stage().allocation_changed.connect((box, flags) => {
-			preview_group.scale_x = (box.x2 - box.x1) / slide.parent.width;
-			preview_group.scale_y = (box.y2 - box.y1) / slide.parent.height;
+			preview_group.scale_x = (box.x2 - box.x1) / slide.width;
+			preview_group.scale_y = (box.y2 - box.y1) / slide.height;
 		});
 		
 		// automatically set the correct aspect ratio for the preview
@@ -239,7 +239,7 @@ public class Ease.InspectorTransitionPane : InspectorPane
 			if (slide == null) return;
 			
 			preview_align.height_request =
-				(int)(allocation.width / slide.parent.aspect);
+				(int)(allocation.width / document.aspect);
 		});
 	}
 	
@@ -412,19 +412,19 @@ public class Ease.InspectorTransitionPane : InspectorPane
 		// size the preview box
 		Gtk.Allocation alloc = Gtk.Allocation();
 		preview_align.get_allocation(out alloc);
-		preview_align.height_request = (int)(alloc.width / slide.parent.aspect);
+		preview_align.height_request = (int)(alloc.width / document.aspect);
 		
 		// remove the old preview slide actors
 		preview_group.remove_all();
 		
 		// add new slide previews
-		current_slide = new SlideActor.from_slide(slide.parent, slide, true,
+		current_slide = new SlideActor.from_slide(document, slide, true,
 		                                          ActorContext.PRESENTATION);
 		
-		new_slide = slide.parent.has_next_slide(slide) ?
-		            new SlideActor.from_slide(slide.parent, slide.next, true,
+		new_slide = document.has_next_slide(slide) ?
+		            new SlideActor.from_slide(document, slide.next, true,
 		                                      ActorContext.PRESENTATION) :
-		            new SlideActor.blank(slide.parent, { 0, 0, 0, 255 });
+		            new SlideActor.blank(document, { 0, 0, 0, 255 });
 		
 		preview_group.add_actor(current_slide);
 		preview_group.add_actor(new_slide);
diff --git a/src/ease-inspector.vala b/src/ease-inspector.vala
index fa5048c..13dcbc4 100644
--- a/src/ease-inspector.vala
+++ b/src/ease-inspector.vala
@@ -43,13 +43,13 @@ public class Ease.Inspector : Gtk.Notebook, UndoSource
 		}
 	}
 	
-	public Inspector()
+	public Inspector(Document document)
 	{
 		set_size_request(REQUEST_WIDTH, REQUEST_HEIGHT);
 	
-		transition_pane = new InspectorTransitionPane();
-		element_pane = new InspectorElementPane();
-		slide_pane = new InspectorSlidePane();
+		transition_pane = new InspectorTransitionPane(document);
+		element_pane = new InspectorElementPane(document);
+		slide_pane = new InspectorSlidePane(document);
 		
 		// add pages
 		append(slide_pane, "gtk-page-setup");
diff --git a/src/ease-slide-actor.vala b/src/ease-slide-actor.vala
index 92a5f92..28f4dd9 100644
--- a/src/ease-slide-actor.vala
+++ b/src/ease-slide-actor.vala
@@ -186,7 +186,7 @@ public class Ease.SlideActor : Clutter.Group
 
 		contents = new Flutter.Group();
 
-		foreach (var e in slide.elements)
+		foreach (var e in slide)
 		{
 			contents.add_actor(e.actor(context));
 		}
@@ -556,25 +556,25 @@ public class Ease.SlideActor : Clutter.Group
 		switch (slide.variant)
 		{
 			case TransitionVariant.UP:
-				new_slide.y = slide.parent.height;
+				new_slide.y = slide.height;
 				new_slide.animate(EASE_SLIDE, length, "y", 0);
 				animate(EASE_SLIDE, length, "y", -new_slide.y);
 				break;
 			
 			case TransitionVariant.DOWN:
-				new_slide.y = -slide.parent.height;
+				new_slide.y = -slide.height;
 				new_slide.animate(EASE_SLIDE, length, "y", 0);
 				animate(EASE_SLIDE, length, "y", -new_slide.y);
 				break;
 			
 			case TransitionVariant.LEFT:
-				new_slide.x = slide.parent.width;
+				new_slide.x = slide.width;
 				new_slide.animate(EASE_SLIDE, length, "x", 0);
 				animate(EASE_SLIDE, length, "x", -new_slide.x);
 				break;
 			
 			case TransitionVariant.RIGHT:
-				new_slide.x = -slide.parent.width;
+				new_slide.x = -slide.width;
 				new_slide.animate(EASE_SLIDE, length, "x", 0);
 				animate(EASE_SLIDE, length, "x", -new_slide.x);
 				break;
@@ -591,7 +591,7 @@ public class Ease.SlideActor : Clutter.Group
 	private void drop_transition(SlideActor new_slide,
 	                             Clutter.Group container, uint length)
 	{
-		new_slide.y = -slide.parent.height;
+		new_slide.y = -slide.height;
 		new_slide.animate(EASE_DROP, length, "y", 0);
 	}
 
@@ -609,16 +609,16 @@ public class Ease.SlideActor : Clutter.Group
 		switch (slide.variant)
 		{
 			case TransitionVariant.TOP_RIGHT:
-				xpos = slide.parent.width;
+				xpos = slide.width;
 				angle = -90;
 				break;
 			case TransitionVariant.BOTTOM_LEFT:
-				ypos = slide.parent.height;
+				ypos = slide.height;
 				angle = -90;
 				break;
 			case TransitionVariant.BOTTOM_RIGHT:
-				xpos = slide.parent.width;
-				ypos = slide.parent.height;
+				xpos = slide.width;
+				ypos = slide.height;
 				break;
 		}
 		
@@ -671,7 +671,7 @@ public class Ease.SlideActor : Clutter.Group
 			case TransitionVariant.BOTTOM_TO_TOP:
 				axis = Clutter.RotateAxis.X_AXIS;
 				positive = 1;
-				y_point = slide.parent.height / 2;
+				y_point = slide.height / 2;
 				break;
 
 			case TransitionVariant.TOP_TO_BOTTOM:
@@ -682,13 +682,13 @@ public class Ease.SlideActor : Clutter.Group
 			case TransitionVariant.LEFT_TO_RIGHT:
 				axis = Clutter.RotateAxis.Y_AXIS;
 				positive = 1;
-				x_point = slide.parent.width / 2;
+				x_point = slide.width / 2;
 				break;
 
 			default: // RIGHT_TO_LEFT
 				axis = Clutter.RotateAxis.Y_AXIS;
 				positive = -1;
-				x_point = slide.parent.width / 2;
+				x_point = slide.width / 2;
 				break;
 		}
 		
@@ -765,7 +765,7 @@ public class Ease.SlideActor : Clutter.Group
 			case TransitionVariant.RIGHT:
 				axis = Clutter.RotateAxis.Y_AXIS;
 				positive = -1;
-				x_point = slide.parent.width;
+				x_point = slide.width;
 				break;
 			
 			case TransitionVariant.TOP:
@@ -776,7 +776,7 @@ public class Ease.SlideActor : Clutter.Group
 			default: // BOTTOM
 				axis = Clutter.RotateAxis.X_AXIS;
 				positive = 1;
-				y_point = slide.parent.height;
+				y_point = slide.height;
 				break;
 		}
 		
@@ -812,22 +812,22 @@ public class Ease.SlideActor : Clutter.Group
 		switch (slide.variant)
 		{
 			case TransitionVariant.TOP:
-				new_slide.y = slide.parent.height;
+				new_slide.y = slide.height;
 				animate(EASE_SLIDE, length, "y", -new_slide.y);
 				new_slide.y = 0;
 				break;
 			case TransitionVariant.BOTTOM:
-				new_slide.y = -slide.parent.height;
+				new_slide.y = -slide.height;
 				animate(EASE_SLIDE, length, "y", -new_slide.y);
 				new_slide.y = 0;
 				break;
 			case TransitionVariant.LEFT:
-				new_slide.x = slide.parent.width;
+				new_slide.x = slide.width;
 				this.animate(EASE_SLIDE, length, "x", -new_slide.x);
 				new_slide.x = 0;
 				break;
 			case TransitionVariant.RIGHT:
-				new_slide.x = -slide.parent.width;
+				new_slide.x = -slide.width;
 				animate(EASE_SLIDE, length, "x", -new_slide.x);
 				new_slide.x = 0;
 				break;
@@ -851,7 +851,7 @@ public class Ease.SlideActor : Clutter.Group
 		animation_time.new_frame.connect((m) => {
 			set_rotation(Clutter.RotateAxis.X_AXIS,
 			             -90 * animation_alpha.alpha,
-			             0, slide.parent.height, 0);
+			             0, slide.height, 0);
 		});
 	}
 
@@ -871,8 +871,8 @@ public class Ease.SlideActor : Clutter.Group
 		// hide the real SlideActors
 		reparent(container);
 		new_slide.reparent(container);
-		x = slide.parent.width;
-		new_slide.x = slide.parent.width;
+		x = slide.width;
+		new_slide.x = slide.width;
 
 		// make arrays for the slats
 		var this_slats = new Clutter.Clone[SLAT_COUNT];
@@ -880,7 +880,7 @@ public class Ease.SlideActor : Clutter.Group
 		var groups = new Clutter.Group[SLAT_COUNT];
 
 		// calculate the width of each slat
-		float width = (float)slide.parent.width / SLAT_COUNT;
+		float width = (float)slide.width / SLAT_COUNT;
 
 		// make the slats
 		for (int i = 0; i < SLAT_COUNT; i++)
@@ -897,9 +897,9 @@ public class Ease.SlideActor : Clutter.Group
 
 			// clip clones
 			this_slats[i].set_clip(width * i, 0,
-			                       width, slide.parent.height);
+			                       width, slide.height);
 			new_slats[i].set_clip(width * i, 0,
-			                      width, slide.parent.height);
+			                      width, slide.height);
 
 			// flip the back slats
 			new_slats[i].set_rotation(Clutter.RotateAxis.Y_AXIS,
@@ -954,7 +954,7 @@ public class Ease.SlideActor : Clutter.Group
 		var reflection = new Clutter.Clone(new_slide);
 		reflection.rotation_angle_z = 180;
 		reflection.rotation_angle_y = 180;
-		reflection.y = 2 * slide.parent.height;
+		reflection.y = 2 * slide.height;
 		reflection.opacity = REFLECTION_OPACITY;
 		
 		// zoom the new slide in
@@ -969,15 +969,15 @@ public class Ease.SlideActor : Clutter.Group
 
 		animate(Clutter.AnimationMode.LINEAR, length, "opacity", 0);
 		reparent(container);
-		x = slide.parent.width;
+		x = slide.width;
 
 		// create left and right half clone actors
-		float width = slide.parent.width / 2f;
+		float width = slide.width / 2f;
 		Clutter.Clone left = new Clutter.Clone(this),
 		              right = new Clutter.Clone(this);
 
-		left.set_clip(0, 0, width, slide.parent.height);
-		right.set_clip(width, 0, width, slide.parent.height);
+		left.set_clip(0, 0, width, slide.height);
+		right.set_clip(width, 0, width, slide.height);
 		
 		// create left and right half reflections
 		Clutter.Clone left_ref = new Clutter.Clone(left),
@@ -985,12 +985,12 @@ public class Ease.SlideActor : Clutter.Group
 		
 		left_ref.rotation_angle_z = 180;
 		left_ref.rotation_angle_y = 180;
-		left_ref.y = 2 * slide.parent.height;
+		left_ref.y = 2 * slide.height;
 		left_ref.opacity = REFLECTION_OPACITY;
 		
 		right_ref.rotation_angle_z = 180;
 		right_ref.rotation_angle_y = 180;
-		right_ref.y = 2 * slide.parent.height;
+		right_ref.y = 2 * slide.height;
 		right_ref.opacity = REFLECTION_OPACITY;
 		
 		// create left and right groups
@@ -1054,22 +1054,22 @@ public class Ease.SlideActor : Clutter.Group
 		{
 			case TransitionVariant.CENTER:
 				new_slide.set_scale_full(0, 0,
-				                         slide.parent.width / 2,
-				                         slide.parent.height / 2);
+				                         slide.width / 2,
+				                         slide.height / 2);
 				break;
 			case TransitionVariant.TOP_LEFT:
 				new_slide.set_scale_full(0, 0, 0, 0);
 				break;
 			case TransitionVariant.TOP_RIGHT:
-				new_slide.set_scale_full(0, 0, slide.parent.width, 0);
+				new_slide.set_scale_full(0, 0, slide.width, 0);
 				break;
 			case TransitionVariant.BOTTOM_LEFT:
-				new_slide.set_scale_full(0, 0, 0, slide.parent.height);
+				new_slide.set_scale_full(0, 0, 0, slide.height);
 				break;
 			case TransitionVariant.BOTTOM_RIGHT:
 				new_slide.set_scale_full(0, 0,
-				                         slide.parent.width,
-				                         slide.parent.height);
+				                         slide.width,
+				                         slide.height);
 				break;
 		}
 		animation_alpha = new Clutter.Alpha.full(animation_time,
@@ -1096,19 +1096,19 @@ public class Ease.SlideActor : Clutter.Group
 		switch (slide.variant)
 		{
 			case TransitionVariant.UP:
-				pos = slide.parent.height;
+				pos = slide.height;
 				property = "y";
 				break;
 			case TransitionVariant.DOWN:
-				pos = -slide.parent.height;
+				pos = -slide.height;
 				property = "y";
 				break;
 			case TransitionVariant.LEFT:
-				pos = slide.parent.width;
+				pos = slide.width;
 				property = "x";
 				break;
 			default:
-				pos = -slide.parent.width;
+				pos = -slide.width;
 				property = "x";
 				break;
 		}
@@ -1116,8 +1116,8 @@ public class Ease.SlideActor : Clutter.Group
 		time1 = new Clutter.Timeline(length / 4);
 		time2 = new Clutter.Timeline(3 * length / 4);
 		new_slide.set_scale_full(PANEL_SCALE, PANEL_SCALE,
-		                         slide.parent.width / 2,
-		                         slide.parent.height / 2);
+		                         slide.width / 2,
+		                         slide.height / 2);
 
 		new_slide.set_property(property, pos);
 		alpha1 = new Clutter.Alpha.full(time1,
@@ -1128,7 +1128,7 @@ public class Ease.SlideActor : Clutter.Group
 			                                (1 - alpha1.alpha),
 			               PANEL_SCALE + (1 - PANEL_SCALE) *
 			                                (1 - alpha1.alpha),
-				           slide.parent.width / 2, slide.parent.height / 2);
+				           slide.width / 2, slide.height / 2);
 		});
 		time1.completed.connect(() => {
 			animate(Clutter.AnimationMode.EASE_IN_OUT_SINE, length / 2,
@@ -1143,8 +1143,8 @@ public class Ease.SlideActor : Clutter.Group
 				                          (1 - PANEL_SCALE) * alpha1.alpha,
 				                         PANEL_SCALE +
 				                          (1 - PANEL_SCALE) * alpha1.alpha,
-					                     slide.parent.width / 2,
-					                     slide.parent.height / 2);
+					                     slide.width / 2,
+					                     slide.height / 2);
 			});
 			time1.start();
 		});
@@ -1185,13 +1185,13 @@ public class Ease.SlideActor : Clutter.Group
 		time1.new_frame.connect((m) => {
 			contents.set_rotation(Clutter.RotateAxis.Y_AXIS,
 			                      angle * alpha1.alpha,
-			                      slide.parent.width / 2, 0, 0);
+			                      slide.width / 2, 0, 0);
 		});
 		time2.new_frame.connect((m) => {
 			new_slide.contents.opacity = 255;
 			new_slide.contents.set_rotation(Clutter.RotateAxis.Y_AXIS,
 			                                -angle * (1 - alpha2.alpha),
-			                                 slide.parent.width / 2, 0, 0);
+			                                 slide.width / 2, 0, 0);
 		});
 		time1.start();
 	}
@@ -1262,28 +1262,28 @@ public class Ease.SlideActor : Clutter.Group
 		switch (slide.variant)
 		{
 			case TransitionVariant.RIGHT:
-				new_slide.contents.x = -slide.parent.width;
+				new_slide.contents.x = -slide.width;
 				new_slide.contents.animate(EASE_SLIDE, length, "x", 0);
 
 				contents.animate(EASE_SLIDE,
 				                 length, "x", -new_slide.contents.x);
 				break;
 			case TransitionVariant.LEFT:
-				new_slide.contents.x = slide.parent.width;
+				new_slide.contents.x = slide.width;
 				new_slide.contents.animate(EASE_SLIDE, length, "x", 0);
 
 				contents.animate(EASE_SLIDE,
 				                 length, "x", -new_slide.contents.x);
 				break;
 			case TransitionVariant.UP:
-				new_slide.contents.y = slide.parent.height;
+				new_slide.contents.y = slide.height;
 				new_slide.contents.animate(EASE_SLIDE, length, "y", 0);
 
 				contents.animate(EASE_SLIDE,
 				                 length, "y", -new_slide.contents.y);
 				break;
 			case TransitionVariant.DOWN:
-				new_slide.contents.y = -slide.parent.height;
+				new_slide.contents.y = -slide.height;
 				new_slide.contents.animate(EASE_SLIDE, length, "y", 0);
 
 				contents.animate(EASE_SLIDE,
@@ -1312,18 +1312,18 @@ public class Ease.SlideActor : Clutter.Group
 		switch (slide.variant)
 		{
 			case TransitionVariant.UP:
-				new_slide.contents.y = slide.parent.height * 1.2f;
+				new_slide.contents.y = slide.height * 1.2f;
 				new_slide.contents.animate(Clutter.AnimationMode.EASE_IN_OUT_ELASTIC,
 				                           length, "y", 0);
 				contents.animate(Clutter.AnimationMode.EASE_IN_OUT_ELASTIC,
-				                 length, "y", -slide.parent.height * 1.2);
+				                 length, "y", -slide.height * 1.2);
 				break;
 			case TransitionVariant.DOWN:
-				new_slide.contents.y = -slide.parent.height * 1.2f;
+				new_slide.contents.y = -slide.height * 1.2f;
 				new_slide.contents.animate(Clutter.AnimationMode.EASE_IN_OUT_ELASTIC,
 				                           length, "y", 0);
 				contents.animate(Clutter.AnimationMode.EASE_IN_OUT_ELASTIC,
-				                 length, "y", slide.parent.height * 1.2);
+				                 length, "y", slide.height * 1.2);
 				break;
 		}
 	}
@@ -1351,12 +1351,12 @@ public class Ease.SlideActor : Clutter.Group
 		{
 			case TransitionVariant.IN:
 				new_slide.contents.set_scale_full(0, 0,
-				                                  slide.parent.width / 2,
-				                                  slide.parent.height / 2);
+				                                  slide.width / 2,
+				                                  slide.height / 2);
 
 				contents.set_scale_full(1, 1,
-				                        slide.parent.width / 2,
-				                        slide.parent.height / 2);
+				                        slide.width / 2,
+				                        slide.height / 2);
 
 				contents.animate(Clutter.AnimationMode.LINEAR, length / 2, "opacity", 0);
 				animation_time.new_frame.connect((m) => {
@@ -1369,12 +1369,12 @@ public class Ease.SlideActor : Clutter.Group
 				break;
 			case TransitionVariant.OUT:
 				new_slide.contents.set_scale_full(0, 0,
-				                                  slide.parent.width / 2,
-				                                  slide.parent.height / 2);
+				                                  slide.width / 2,
+				                                  slide.height / 2);
 
 				contents.set_scale_full(1, 1,
-				                        slide.parent.width / 2,
-				                        slide.parent.height / 2);
+				                        slide.width / 2,
+				                        slide.height / 2);
 
 				new_slide.contents.opacity = 0;
 				new_slide.contents.animate(Clutter.AnimationMode.EASE_IN_SINE,
@@ -1403,17 +1403,17 @@ public class Ease.SlideActor : Clutter.Group
 		// hide the real SlideActor
 		reparent(container);
 		new_slide.reparent(container);
-		x = slide.parent.width;
+		x = slide.width;
 
 		// make an array for the particles
-		var v_count = (int)Math.ceil(1 / slide.parent.aspect * EXPLODE_PARTICLES);
+		var v_count = (int)Math.ceil(1 / slide.aspect * EXPLODE_PARTICLES);
 		var count = EXPLODE_PARTICLES * v_count;
 		var particles = new Clutter.Clone[count];
 		
 		// calculate the size of each particle
-		var size = (float)slide.parent.width / EXPLODE_PARTICLES;
-		float center_x = slide.parent.width / 2;
-		float center_y = slide.parent.height / 2;
+		var size = (float)slide.width / EXPLODE_PARTICLES;
+		float center_x = slide.width / 2;
+		float center_y = slide.height / 2;
 
 		// create the particles
 		int i;
@@ -1466,15 +1466,15 @@ public class Ease.SlideActor : Clutter.Group
 	{
 		// hide the real new SlideActor
 		new_slide.reparent(container);
-		new_slide.x = slide.parent.width;
+		new_slide.x = slide.width;
 
 		// make an array for the particles
-		var v_count = (int)Math.ceil(1 / slide.parent.aspect * ASSEMBLE_TILES);
+		var v_count = (int)Math.ceil(1 / slide.aspect * ASSEMBLE_TILES);
 		var count = ASSEMBLE_TILES * v_count;
 		var particles = new Clutter.Clone[count];
 		
 		// calculate the size of each particle
-		var size = (float)slide.parent.width / ASSEMBLE_TILES;
+		var size = (float)slide.width / ASSEMBLE_TILES;
 
 		// create the particles
 		int i;
diff --git a/src/ease-slide-button-panel.vala b/src/ease-slide-button-panel.vala
index 1a50e69..e5ee8f1 100644
--- a/src/ease-slide-button-panel.vala
+++ b/src/ease-slide-button-panel.vala
@@ -174,14 +174,14 @@ public class Ease.SlideButtonPanel : Gtk.ScrolledWindow
 	 */
 	private static Gdk.Pixbuf? pixbuf(Slide slide, int width)
 	{
-		var height = (int)((float)width * slide.parent.height /
-		                                  slide.parent.width);
+		var height = (int)((float)width * slide.height /
+		                                  slide.width);
 		var surface = new Cairo.ImageSurface(Cairo.Format.RGB24, width, height);
 		
 		var context = new Cairo.Context(surface);
 		context.save();
-		context.scale((float)width / slide.parent.width,
-		              (float)height / slide.parent.height);
+		context.scale((float)width / slide.width,
+		              (float)height / slide.height);
 		
 		try
 		{
diff --git a/src/ease-welcome-actor.vala b/src/ease-welcome-actor.vala
index 02a6cfa..a2ccfef 100644
--- a/src/ease-welcome-actor.vala
+++ b/src/ease-welcome-actor.vala
@@ -156,7 +156,6 @@ public class Ease.WelcomeActor : Clutter.Group
 		try
 		{
 			var slide = create_slide(w, h);
-			slide.theme = theme;
 			slide.cairo_render_sized(slide_actor.create(), w, h);
 		}
 		catch (GLib.Error e)
@@ -226,7 +225,7 @@ public class Ease.WelcomeActor : Clutter.Group
 	{
 		var slide = theme.create_slide(PREVIEW_SLIDE, w, h);
 		
-		foreach (var element in slide.elements)
+		foreach (var element in slide)
 		{
 			switch (element.identifier)
 			{



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]