[ease/encapsulate] Trying to break ease up into more logical chunks.
- From: Nate Stedman <natesm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ease/encapsulate] Trying to break ease up into more logical chunks.
- Date: Tue, 27 Jul 2010 07:07:29 +0000 (UTC)
commit 8b1e5fcc497cbf230fec30628026a003967d09ab
Author: Nate Stedman <natesm gmail com>
Date: Tue Jul 27 03:05:07 2010 -0400
Trying to break ease up into more logical chunks.
Makefile.am | 22 +++++++++++++++++++-
autogen.sh | 2 +-
ease-core/Makefile.am | 21 +------------------
ease-core/ease-actor.vala | 4 +-
ease-core/ease-dialogs.vala | 2 +-
ease-core/ease-document.vala | 10 ++++----
ease-core/ease-iterables.vala | 12 +++++-----
ease-core/ease-temp.vala | 17 +++++++++++---
ease-core/ease-text-actor.vala | 7 ++---
ease-core/ease-theme.vala | 10 ++++----
{ease-core => src}/ease-about-dialog.vala | 0
{ease-core => src}/ease-close-confirm-dialog.vala | 0
{ease-core => src}/ease-editor-embed.vala | 6 ++--
{ease-core => src}/ease-editor-window.vala | 0
{ease-core => src}/ease-handle.vala | 0
.../ease-inspector-element-pane.vala | 0
{ease-core => src}/ease-inspector-pane.vala | 0
{ease-core => src}/ease-inspector-slide-pane.vala | 0
.../ease-inspector-transition-pane.vala | 0
{ease-core => src}/ease-inspector-window.vala | 0
{ease-core => src}/ease-inspector.vala | 0
{ease-core => src}/ease-main.vala | 0
{ease-core => src}/ease-player.vala | 0
{ease-core => src}/ease-scrollable-embed.vala | 0
{ease-core => src}/ease-selection-rectangle.vala | 0
{ease-core => src}/ease-slide-actor.vala | 0
{ease-core => src}/ease-slide-button-panel.vala | 0
{ease-core => src}/ease-welcome-actor.vala | 0
{ease-core => src}/ease-welcome-window.vala | 0
src/main.vala | 21 -------------------
30 files changed, 61 insertions(+), 73 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index a7c97f7..bb13166 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,7 +5,26 @@ SUBDIRS = po data flutter ease-core
bin_PROGRAMS = ease
# source files
-ease_SOURCES = src/main.vala
+ease_SOURCES = \
+ src/ease-about-dialog.vala \
+ src/ease-close-confirm-dialog.vala \
+ src/ease-editor-embed.vala \
+ src/ease-editor-window.vala \
+ src/ease-handle.vala \
+ src/ease-inspector-element-pane.vala \
+ src/ease-inspector-pane.vala \
+ 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 \
+ src/ease-selection-rectangle.vala \
+ src/ease-slide-actor.vala \
+ src/ease-slide-button-panel.vala \
+ src/ease-welcome-actor.vala \
+ src/ease-welcome-window.vala
# compiler flags
ease_VALAFLAGS = \
@@ -17,6 +36,7 @@ ease_VALAFLAGS = \
ease_LDADD = \
./ease-core/libease-core-0.3.la \
./flutter/libflutter-0.3.la \
+ -lm \
$(EASE_LIBS) \
$(NULL)
diff --git a/autogen.sh b/autogen.sh
index 16236b7..bc15f53 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -7,7 +7,7 @@ test -z "$srcdir" && srcdir=.
PKG_NAME="ease"
REQUIRED_AUTOMAKE_VERSION=1.11
-(test -f $srcdir/src/main.vala) || {
+(test -f $srcdir/src/ease-main.vala) || {
echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
echo " top-level $PKG_NAME directory"
exit 1
diff --git a/ease-core/Makefile.am b/ease-core/Makefile.am
index 88cd63a..436478f 100644
--- a/ease-core/Makefile.am
+++ b/ease-core/Makefile.am
@@ -12,35 +12,19 @@ AM_CPPFLAGS = \
# source files
libease_core_0_3_la_SOURCES = \
- ease-about-dialog.vala \
ease-actor.vala \
ease-animated-zoom-slider.vala \
- ease-close-confirm-dialog.vala \
ease-color.vala \
ease-dialogs.vala \
ease-document.vala \
- ease-editor-embed.vala \
- ease-editor-window.vala \
ease-element.vala \
ease-enums.vala \
ease-gradient.vala \
- ease-handle.vala \
ease-html-exporter.vala \
ease-image-actor.vala \
ease-image-element.vala \
- ease-inspector-element-pane.vala \
- ease-inspector-pane.vala \
- ease-inspector-slide-pane.vala \
- ease-inspector-transition-pane.vala \
- ease-inspector-window.vala \
- ease-inspector.vala \
ease-iterables.vala \
ease-media-element.vala \
- ease-player.vala \
- ease-scrollable-embed.vala \
- ease-selection-rectangle.vala \
- ease-slide-actor.vala \
- ease-slide-button-panel.vala \
ease-slide.vala \
ease-temp.vala \
ease-text-actor.vala \
@@ -48,17 +32,14 @@ libease_core_0_3_la_SOURCES = \
ease-theme.vala \
ease-transformations.vala \
ease-transitions.vala \
- ease-undo-action.vala \
ease-undo-actions-element.vala \
ease-undo-actions-slide.vala \
+ ease-undo-action.vala \
ease-undo-controller.vala \
ease-undo-item.vala \
ease-undo-source.vala \
ease-utilities.vala \
- ease-welcome-actor.vala \
- ease-welcome-window.vala \
ease-zoom-slider.vala \
- ease-main.vala \
$(NULL)
# compiler flags
diff --git a/ease-core/ease-actor.vala b/ease-core/ease-actor.vala
index 671e143..1df5187 100644
--- a/ease-core/ease-actor.vala
+++ b/ease-core/ease-actor.vala
@@ -177,7 +177,7 @@ public abstract class Ease.Actor : Clutter.Group
*
* @param sender The { link EditorEmbed} this Actor is on.
*/
- public virtual void edit(EditorEmbed sender) {}
+ public virtual void edit() {}
/**
* Called when the actor end editing. Subclasses with editing that is not
@@ -185,6 +185,6 @@ public abstract class Ease.Actor : Clutter.Group
*
* @param sender The { link EditorEmbed} this Actor is on.
*/
- public virtual void end_edit(EditorEmbed sender) {}
+ public virtual void end_edit() {}
}
diff --git a/ease-core/ease-dialogs.vala b/ease-core/ease-dialogs.vala
index a327a11..eecc9e5 100644
--- a/ease-core/ease-dialogs.vala
+++ b/ease-core/ease-dialogs.vala
@@ -42,7 +42,7 @@ public class Ease.OpenDialog : GLib.Object
if (dialog.run() == Gtk.ResponseType.ACCEPT)
{
- Main.open_file(dialog.get_filename() + "/");
+ //Main.open_file(dialog.get_filename() + "/");
}
dialog.destroy();
}
diff --git a/ease-core/ease-document.vala b/ease-core/ease-document.vala
index 6f206c2..31dc92f 100644
--- a/ease-core/ease-document.vala
+++ b/ease-core/ease-document.vala
@@ -94,7 +94,7 @@ public class Ease.Document : GLib.Object, UndoSource
/**
* All { link Slide}s in this Document.
*/
- internal Iterable.ListStore slides = new Iterable.ListStore(
+ public IterableListStore slides = new IterableListStore(
{ typeof(Slide),
typeof(Gdk.Pixbuf) });
@@ -120,7 +120,7 @@ public class Ease.Document : GLib.Object, UndoSource
*/
public Document() { }
- internal Document.from_saved(string file_path) throws GLib.Error
+ public Document.from_saved(string file_path) throws GLib.Error
{
this();
@@ -166,8 +166,8 @@ public class Ease.Document : GLib.Object, UndoSource
* @param w The width of the new Document.
* @param h The height of the new Document.
*/
- internal Document.from_theme(Theme doc_theme,
- int w, int h) throws GLib.Error
+ public Document.from_theme(Theme doc_theme,
+ int w, int h) throws GLib.Error
{
assert(doc_theme != null);
@@ -190,7 +190,7 @@ public class Ease.Document : GLib.Object, UndoSource
append_slide(slide);
}
- internal void to_json() throws GLib.Error
+ public void to_json() throws GLib.Error
{
var root = new Json.Node(Json.NodeType.OBJECT);
var obj = new Json.Object();
diff --git a/ease-core/ease-iterables.vala b/ease-core/ease-iterables.vala
index c47a985..e93d86d 100644
--- a/ease-core/ease-iterables.vala
+++ b/ease-core/ease-iterables.vala
@@ -21,7 +21,7 @@
* The foreach loop returns a Gtk.TreeIter. The Gtk.TreePath provided by the
* built in TreeModel foreach function is not (immediately) available.
*/
-internal interface Ease.Iterable.TreeModel : Gtk.TreeModel
+public interface Ease.IterableTreeModel : Gtk.TreeModel
{
public Iterator iterator()
{
@@ -31,10 +31,10 @@ internal interface Ease.Iterable.TreeModel : Gtk.TreeModel
public class Iterator
{
private Gtk.TreeIter itr;
- private TreeModel model;
+ private IterableTreeModel model;
private bool more;
- public Iterator(TreeModel self)
+ public Iterator(IterableTreeModel self)
{
more = self.get_iter_first(out itr);
model = self;
@@ -55,14 +55,14 @@ internal interface Ease.Iterable.TreeModel : Gtk.TreeModel
}
/**
- * ListStore with the { link Iterable.TreeModel} mixin.
+ * ListStore with the { link IterableTreeModel} mixin.
*/
-internal class Ease.Iterable.ListStore : Gtk.ListStore, TreeModel
+public class Ease.IterableListStore : Gtk.ListStore, IterableTreeModel
{
/**
* Creates an iterable ListStore with the specified types.
*/
- public ListStore(Type[] types)
+ public IterableListStore(Type[] types)
{
set_column_types(types);
}
diff --git a/ease-core/ease-temp.vala b/ease-core/ease-temp.vala
index c164ac6..cc35ad5 100644
--- a/ease-core/ease-temp.vala
+++ b/ease-core/ease-temp.vala
@@ -94,21 +94,30 @@ public static class Ease.Temp : Object
* This function is useful for debugging and cleanliness purposes.
* However, be sure to use unique names. Do not use "integer" strings,
* as those could overlap with directories created through request().
- * For this reason, this function is not available to code outside
- * Ease.
+ *
+ * If the directory name is taken, "-0, "-1", etc. will be appended until
+ * an available directory is found.
*
* @param str The directory name to request.
*/
- internal static string request_str(string str) throws GLib.Error
+ public static string request_str(string str) throws GLib.Error
{
// build the path
string tmp = Path.build_filename(temp, str);
+ var file = File.new_for_path(tmp);
+ if (file.query_exists(null))
+ {
+ for (int i = 0; file.query_exists(null); i++)
+ {
+ tmp = Path.build_filename(temp, str + "-" + i.to_string());
+ file = File.new_for_path(tmp);
+ }
+ }
// track the directories used by this instance of the program
dirs.offer_head(tmp);
// make the directory
- var file = GLib.File.new_for_path(tmp);
file.make_directory_with_parents(null);
return tmp;
diff --git a/ease-core/ease-text-actor.vala b/ease-core/ease-text-actor.vala
index 6beb144..8b97efa 100644
--- a/ease-core/ease-text-actor.vala
+++ b/ease-core/ease-text-actor.vala
@@ -100,7 +100,7 @@ public class Ease.TextActor : Actor
/**
* { inheritDoc}
*/
- public override void edit(EditorEmbed sender)
+ public override void edit()
{
// set text to editable
var text = contents as Clutter.Text;
@@ -111,7 +111,6 @@ public class Ease.TextActor : Actor
text.activate.connect(text_activate);
// grab key focus
- sender.key_focus();
((Clutter.Stage)get_stage()).set_key_focus(text);
// set the selection color
@@ -135,14 +134,14 @@ public class Ease.TextActor : Actor
// if the text is being edited when the action is applied, stop editing
undo_action.pre_apply.connect((action) => {
- if (text.editable) end_edit(sender);
+ if (text.editable) end_edit();
});
}
/**
* { inheritDoc}
*/
- public override void end_edit(EditorEmbed sender)
+ public override void end_edit()
{
// release key focus
((Clutter.Stage)get_stage()).set_key_focus(null);
diff --git a/ease-core/ease-theme.vala b/ease-core/ease-theme.vala
index e679435..99dfc2f 100644
--- a/ease-core/ease-theme.vala
+++ b/ease-core/ease-theme.vala
@@ -68,11 +68,11 @@ public class Ease.Theme : GLib.Object
private const string BACKGROUND_TYPE_IMAGE = "background-type-image";
// text content types
- private const string TITLE_TEXT = "title-text";
- private const string AUTHOR_TEXT = "author-text";
- private const string CONTENT_TEXT = "content-text";
- private const string HEADER_TEXT = "header-text";
- private const string CUSTOM_TEXT = "custom-text";
+ public const string TITLE_TEXT = "title-text";
+ public const string AUTHOR_TEXT = "author-text";
+ public const string CONTENT_TEXT = "content-text";
+ public const string HEADER_TEXT = "header-text";
+ public const string CUSTOM_TEXT = "custom-text";
// text properties
public const string TEXT_FONT = "text-font";
diff --git a/ease-core/ease-about-dialog.vala b/src/ease-about-dialog.vala
similarity index 100%
rename from ease-core/ease-about-dialog.vala
rename to src/ease-about-dialog.vala
diff --git a/ease-core/ease-close-confirm-dialog.vala b/src/ease-close-confirm-dialog.vala
similarity index 100%
rename from ease-core/ease-close-confirm-dialog.vala
rename to src/ease-close-confirm-dialog.vala
diff --git a/ease-core/ease-editor-embed.vala b/src/ease-editor-embed.vala
similarity index 99%
rename from ease-core/ease-editor-embed.vala
rename to src/ease-editor-embed.vala
index 40405f1..86ab5d0 100644
--- a/ease-core/ease-editor-embed.vala
+++ b/src/ease-editor-embed.vala
@@ -255,7 +255,7 @@ public class Ease.EditorEmbed : ScrollableEmbed, UndoSource
if (is_editing)
{
- selected.end_edit(this);
+ selected.end_edit();
is_editing = false;
}
@@ -418,7 +418,7 @@ public class Ease.EditorEmbed : ScrollableEmbed, UndoSource
if (event.click_count == 2)
{
disconnect_keys();
- (sender as Actor).edit(this);
+ (sender as Actor).edit();
is_editing = true;
return true;
}
@@ -497,7 +497,7 @@ public class Ease.EditorEmbed : ScrollableEmbed, UndoSource
// if editing another Actor, finish that edit
if (selected != null && is_editing)
{
- selected.end_edit(this);
+ selected.end_edit();
is_editing = false;
element_deselected(selected.element);
}
diff --git a/ease-core/ease-editor-window.vala b/src/ease-editor-window.vala
similarity index 100%
rename from ease-core/ease-editor-window.vala
rename to src/ease-editor-window.vala
diff --git a/ease-core/ease-handle.vala b/src/ease-handle.vala
similarity index 100%
rename from ease-core/ease-handle.vala
rename to src/ease-handle.vala
diff --git a/ease-core/ease-inspector-element-pane.vala b/src/ease-inspector-element-pane.vala
similarity index 100%
rename from ease-core/ease-inspector-element-pane.vala
rename to src/ease-inspector-element-pane.vala
diff --git a/ease-core/ease-inspector-pane.vala b/src/ease-inspector-pane.vala
similarity index 100%
rename from ease-core/ease-inspector-pane.vala
rename to src/ease-inspector-pane.vala
diff --git a/ease-core/ease-inspector-slide-pane.vala b/src/ease-inspector-slide-pane.vala
similarity index 100%
rename from ease-core/ease-inspector-slide-pane.vala
rename to src/ease-inspector-slide-pane.vala
diff --git a/ease-core/ease-inspector-transition-pane.vala b/src/ease-inspector-transition-pane.vala
similarity index 100%
rename from ease-core/ease-inspector-transition-pane.vala
rename to src/ease-inspector-transition-pane.vala
diff --git a/ease-core/ease-inspector-window.vala b/src/ease-inspector-window.vala
similarity index 100%
rename from ease-core/ease-inspector-window.vala
rename to src/ease-inspector-window.vala
diff --git a/ease-core/ease-inspector.vala b/src/ease-inspector.vala
similarity index 100%
rename from ease-core/ease-inspector.vala
rename to src/ease-inspector.vala
diff --git a/ease-core/ease-main.vala b/src/ease-main.vala
similarity index 100%
rename from ease-core/ease-main.vala
rename to src/ease-main.vala
diff --git a/ease-core/ease-player.vala b/src/ease-player.vala
similarity index 100%
rename from ease-core/ease-player.vala
rename to src/ease-player.vala
diff --git a/ease-core/ease-scrollable-embed.vala b/src/ease-scrollable-embed.vala
similarity index 100%
rename from ease-core/ease-scrollable-embed.vala
rename to src/ease-scrollable-embed.vala
diff --git a/ease-core/ease-selection-rectangle.vala b/src/ease-selection-rectangle.vala
similarity index 100%
rename from ease-core/ease-selection-rectangle.vala
rename to src/ease-selection-rectangle.vala
diff --git a/ease-core/ease-slide-actor.vala b/src/ease-slide-actor.vala
similarity index 100%
rename from ease-core/ease-slide-actor.vala
rename to src/ease-slide-actor.vala
diff --git a/ease-core/ease-slide-button-panel.vala b/src/ease-slide-button-panel.vala
similarity index 100%
rename from ease-core/ease-slide-button-panel.vala
rename to src/ease-slide-button-panel.vala
diff --git a/ease-core/ease-welcome-actor.vala b/src/ease-welcome-actor.vala
similarity index 100%
rename from ease-core/ease-welcome-actor.vala
rename to src/ease-welcome-actor.vala
diff --git a/ease-core/ease-welcome-window.vala b/src/ease-welcome-window.vala
similarity index 100%
rename from ease-core/ease-welcome-window.vala
rename to src/ease-welcome-window.vala
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]