[ease] [api] Hide Element's "parent" to outsiders.
- From: Nate Stedman <natesm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ease] [api] Hide Element's "parent" to outsiders.
- Date: Tue, 27 Jul 2010 10:39:58 +0000 (UTC)
commit 2f7c9aba75114028d01e82f349810dd367fe8217
Author: Nate Stedman <natesm gmail com>
Date: Tue Jul 27 06:39:33 2010 -0400
[api] Hide Element's "parent" to outsiders.
ease-core/ease-element.vala | 12 ++++++++++--
src/ease-editor-embed.vala | 12 ++++++------
src/ease-editor-window.vala | 2 +-
3 files changed, 17 insertions(+), 9 deletions(-)
---
diff --git a/ease-core/ease-element.vala b/ease-core/ease-element.vala
index 153ca7f..006309f 100644
--- a/ease-core/ease-element.vala
+++ b/ease-core/ease-element.vala
@@ -37,12 +37,12 @@ public abstract class Ease.Element : GLib.Object, UndoSource
/**
* The { link Slide} that this Element is a part of.
*/
- public Slide parent { get; set; }
+ internal Slide parent { get; set; }
/**
* The { link Document} that this Element is part of. get-only.
*/
- public Document document { get { return parent.parent; } }
+ internal Document document { get { return parent.parent; } }
/**
* Creates an Element from a JsonObject
@@ -203,5 +203,13 @@ public abstract class Ease.Element : GLib.Object, UndoSource
* If the Element has been edited by the user in the past.
*/
public bool has_been_edited { get; set; }
+
+ /**
+ * Notifies of changes to the Element.
+ */
+ public void changed()
+ {
+ if (parent != null) parent.changed(parent);
+ }
}
diff --git a/src/ease-editor-embed.vala b/src/ease-editor-embed.vala
index 5c58a79..a954393 100644
--- a/src/ease-editor-embed.vala
+++ b/src/ease-editor-embed.vala
@@ -573,7 +573,7 @@ public class Ease.EditorEmbed : ScrollableEmbed, UndoSource
position_selection();
- selected.element.parent.changed(selected.element.parent);
+ selected.element.changed();
}
return true;
}
@@ -681,7 +681,7 @@ public class Ease.EditorEmbed : ScrollableEmbed, UndoSource
position_selection();
- selected.element.parent.changed(selected.element.parent);
+ selected.element.changed();
return true;
}
@@ -739,7 +739,7 @@ public class Ease.EditorEmbed : ScrollableEmbed, UndoSource
selected.translate(0, shift ?
-NUDGE_SHIFT_PIXELS : -NUDGE_PIXELS);
position_selection();
- selected.element.parent.changed(selected.element.parent);
+ selected.element.changed();
return true;
case Key.DOWN:
@@ -750,7 +750,7 @@ public class Ease.EditorEmbed : ScrollableEmbed, UndoSource
selected.translate(0, shift ?
NUDGE_SHIFT_PIXELS : NUDGE_PIXELS);
position_selection();
- selected.element.parent.changed(selected.element.parent);
+ selected.element.changed();
return true;
case Key.LEFT:
@@ -761,7 +761,7 @@ public class Ease.EditorEmbed : ScrollableEmbed, UndoSource
selected.translate(shift ?
-NUDGE_SHIFT_PIXELS : -NUDGE_PIXELS, 0);
position_selection();
- selected.element.parent.changed(selected.element.parent);
+ selected.element.changed();
return true;
case Key.RIGHT:
@@ -772,7 +772,7 @@ public class Ease.EditorEmbed : ScrollableEmbed, UndoSource
selected.translate(shift ?
NUDGE_SHIFT_PIXELS : NUDGE_PIXELS, 0);
position_selection();
- selected.element.parent.changed(selected.element.parent);
+ selected.element.changed();
return true;
case Key.BACKSPACE:
diff --git a/src/ease-editor-window.vala b/src/ease-editor-window.vala
index 9e8a2d7..246dbaa 100644
--- a/src/ease-editor-window.vala
+++ b/src/ease-editor-window.vala
@@ -618,7 +618,7 @@ public class Ease.EditorWindow : Gtk.Window
font_selection.get_font_name());
// emit the "changed" signal on the element's slide
- text.parent.changed(text.parent);
+ text.changed();
break;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]