[ease] Updated Element documentation and subclass constructors.
- From: Nate Stedman <natesm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ease] Updated Element documentation and subclass constructors.
- Date: Thu, 10 Jun 2010 10:01:34 +0000 (UTC)
commit 1e9e21d5c9cb36e1bb267435ac9123b7d0e4ebb9
Author: Nate Stedman <natesm gmail com>
Date: Thu Jun 10 06:01:08 2010 -0400
Updated Element documentation and subclass constructors.
src/Element.vala | 47 +++++++++++++++++++++++++++++++++--------------
src/ImageElement.vala | 19 ++++++++++++++++++-
src/TextElement.vala | 18 +++++++++++++++++-
src/VideoElement.vala | 19 ++++++++++++++++++-
4 files changed, 86 insertions(+), 17 deletions(-)
---
diff --git a/src/Element.vala b/src/Element.vala
index 0dba3d6..595b3ce 100644
--- a/src/Element.vala
+++ b/src/Element.vala
@@ -18,11 +18,20 @@
/**
* An object on a { link Slide}.
*
+ * Elements form the content of { link Document}s. The Element class is
+ * abstract, so each type of element is represented by a subclass. The Element
+ * base class contains properties common to all types of element.
+ *
+ * To store data, Element uses a key/value store, { link ElementMap}. All
+ * properties of Element and its subclasses are simply wrappers around
+ * strings stored in ElementMap. This makes writing to and reading from JSON
+ * files very simple.
+ *
* Element is also used in { link Theme}s, which handle sizing differently.
*
* Ease uses a "base resolution" of 1024 by 768, a common projector resolution.
* Unlike { link Element}, which expresses positions in x, y, width, and height,
- * MasterElement expressed them in left, right, top, and bottom. As the total
+ * a master element expresses them in left, right, top, and bottom. As the total
* size of the presentation is known, the actual sizes can be easily calculated.
* Then, the Element's size can be increased or decreased by using the
* four directional bind_ properties and the expand_.
@@ -47,7 +56,14 @@
*/
public abstract class Ease.Element : GLib.Object
{
+ /**
+ * The default width of { link Theme} master slides.
+ */
private const float THEME_WIDTH = 800;
+
+ /**
+ * The default height of { link Theme} master slides.
+ */
private const float THEME_HEIGHT = 600;
/**
@@ -63,19 +79,6 @@ public abstract class Ease.Element : GLib.Object
protected ElementMap data;
/**
- * Create a new element, with an empty { link ElementMap}.
- */
- public Element()
- {
- data = new ElementMap();
- }
-
- /**
- * Creates a completely empty Element, without an { link ElementMap}.
- */
- public Element.empty() {}
-
- /**
* Creates and returns a copy of this Element.
*/
public abstract Element copy();
@@ -145,10 +148,26 @@ public abstract class Ease.Element : GLib.Object
exporter.add_progress(amount);
}
+ /**
+ * Creates the actual HTML markup for this Element.
+ *
+ * @param html The HTML string in its current state.
+ * @param exporter The { link HTMLExporter}, for its path.
+ */
protected abstract void write_html(ref string html, HTMLExporter exporter);
+ /**
+ * Renders this Element to a CairoContext.
+ *
+ * @param context The context to render to.
+ */
public abstract void cairo_render(Cairo.Context context) throws Error;
+ /**
+ * Returns a ClutterActor for use in presentations and the editor.
+ *
+ * @param c The context of the actor.
+ */
public abstract Actor actor(ActorContext c);
/**
diff --git a/src/ImageElement.vala b/src/ImageElement.vala
index abd5b86..51b83db 100644
--- a/src/ImageElement.vala
+++ b/src/ImageElement.vala
@@ -15,8 +15,25 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+/**
+ * A {MediaElement} subclass for displaying an image. Linked with
+ * {link ImageActor}.
+ */
public class Ease.ImageElement : MediaElement
-{
+{
+ /**
+ * Create a new element, with an empty { link ElementMap}.
+ */
+ public ImageElement()
+ {
+ data = new ElementMap();
+ }
+
+ /**
+ * Creates a completely empty ImageElement, without an { link ElementMap}.
+ */
+ public ImageElement.empty() {}
+
public override Element copy()
{
var element = new ImageElement.empty();
diff --git a/src/TextElement.vala b/src/TextElement.vala
index 851d451..95d8ca3 100644
--- a/src/TextElement.vala
+++ b/src/TextElement.vala
@@ -15,8 +15,24 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+/**
+ * An {Element} subclass for displaying text. Linked with { link TextActor}.
+ */
public class Ease.TextElement : Element
-{
+{
+ /**
+ * Create a new element, with an empty { link ElementMap}.
+ */
+ public TextElement()
+ {
+ data = new ElementMap();
+ }
+
+ /**
+ * Creates a completely empty TextElement, without an { link ElementMap}.
+ */
+ public TextElement.empty() {}
+
public override Element copy()
{
var element = new TextElement.empty();
diff --git a/src/VideoElement.vala b/src/VideoElement.vala
index 8862eef..656dc65 100644
--- a/src/VideoElement.vala
+++ b/src/VideoElement.vala
@@ -15,8 +15,25 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+/**
+ * A {MediaElement} subclass for playing a vide. Linked with
+ * {link VideoActor}.
+ */
public class Ease.VideoElement : MediaElement
-{
+{
+ /**
+ * Create a new element, with an empty { link ElementMap}.
+ */
+ public VideoElement()
+ {
+ data = new ElementMap();
+ }
+
+ /**
+ * Creates a completely empty VideoElement, without an { link ElementMap}.
+ */
+ public VideoElement.empty() {}
+
public override Element copy()
{
var element = new VideoElement.empty();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]