[ease/text] Fix building.
- From: Nate Stedman <natesm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ease/text] Fix building.
- Date: Sun, 6 Feb 2011 20:37:30 +0000 (UTC)
commit 505fb69d0778889064d20adc6dafd82a00f9e12d
Author: Nate Stedman <natesm gmail com>
Date: Sun Feb 6 15:36:07 2011 -0500
Fix building.
* Vala 0.12 generates invalid C, drop back to 0.10
* Already ported to the 0.12 vapis, so pack in those again
* Enum automatic to_string() appears to be gone, so manually
write those where needed.
ease-core/ease-icon-view.vala | 4 +-
ease-core/ease-shape-element.vala | 17 +++++++
ease-core/ease-text.vala | 11 ++++-
ease-core/ease-transitions.vala | 96 +++++++++++++++++++++++++++++++++++++
vapi/clutter-1.0.deps | 3 +
vapi/clutter-gst-1.0.deps | 3 +
vapi/clutter-gtk-0.10.deps | 8 +++
vapi/gdk-2.0.deps | 5 ++
vapi/gdk-pixbuf-2.0.deps | 1 +
vapi/gtk+-2.0.deps | 6 ++
vapi/json-glib-1.0.deps | 1 +
vapi/libarchive.deps | 1 +
vapi/pangocairo.deps | 2 +
vapi/poppler-glib.deps | 5 ++
vapi/rest-0.6.deps | 3 +
vapi/rest-extras-0.6.deps | 1 +
vapi/unique-1.0.deps | 8 +++
17 files changed, 173 insertions(+), 2 deletions(-)
---
diff --git a/ease-core/ease-icon-view.vala b/ease-core/ease-icon-view.vala
index 40c651e..f48e947 100644
--- a/ease-core/ease-icon-view.vala
+++ b/ease-core/ease-icon-view.vala
@@ -205,7 +205,9 @@ public class Ease.IconView : Clutter.Group
row_spacing = 6;
column_spacing = 6;
item_width = 100;
- text_color = { 0, 0, 0, 255 };
+ Clutter.Color color;
+ color.from_string("black");
+ text_color = color;
// size the box appropriately
notify["width"].connect(() => size_box());
diff --git a/ease-core/ease-shape-element.vala b/ease-core/ease-shape-element.vala
index 597df97..f0eca0a 100644
--- a/ease-core/ease-shape-element.vala
+++ b/ease-core/ease-shape-element.vala
@@ -205,6 +205,23 @@ public enum Ease.ShapeType
OVAL = 1;
/**
+ * Converts a ShapeType to a string representation.
+ */
+ internal string to_string()
+ {
+ switch (this)
+ {
+ case RECTANGLE:
+ return "EASE_SHAPE_TYPE_RECTANGLE";
+ case OVAL:
+ return "EASE_SHAPE_TYPE_OVAL";
+ default:
+ critical("Invalid shape type: %i", this);
+ return "EASE_SHAPE_TYPE_RECTANGLE";
+ }
+ }
+
+ /**
* Parses a ShapeType from a string representation.
*/
internal static ShapeType from_string(string str)
diff --git a/ease-core/ease-text.vala b/ease-core/ease-text.vala
index b8426c7..33664b2 100644
--- a/ease-core/ease-text.vala
+++ b/ease-core/ease-text.vala
@@ -182,8 +182,16 @@ public class Ease.Text : GLib.Object
public void insert(string text, int index, int layout_index)
{
var layout = layouts.get(layout_index);
-
string result, current = layout.text;
+
+ // string bounds checking
+ if (layout_index > current.length || layout_index < 0)
+ {
+ critical("Tried to insert %s at index %l to layout with length %i",
+ text, index, current.length);
+ }
+
+ // figure out where to insert the text, the start and end are simple
if (index == 0)
{
result = text + current;
@@ -198,6 +206,7 @@ public class Ease.Text : GLib.Object
current.substring(index, current.length - index);
}
+ // set the new text back into the layout
layout.text = result;
}
diff --git a/ease-core/ease-transitions.vala b/ease-core/ease-transitions.vala
index f845671..4282dea 100644
--- a/ease-core/ease-transitions.vala
+++ b/ease-core/ease-transitions.vala
@@ -92,6 +92,58 @@ public enum Ease.Transition
return store;
}
+ public string to_string()
+ {
+ switch (this)
+ {
+ case NONE:
+ return "EASE_TRANSITION_NONE";
+ case FADE:
+ return "EASE_TRANSITION_FADE";
+ case SLIDE:
+ return "EASE_TRANSITION_SLIDE";
+ case DROP:
+ return "EASE_TRANSITION_DROP";
+ case PIVOT:
+ return "EASE_TRANSITION_PIVOT";
+ case FLIP:
+ return "EASE_TRANSITION_FLIP";
+ case REVOLVING_DOOR:
+ return "EASE_TRANSITION_REVOLVING_DOOR";
+ case REVEAL:
+ return "EASE_TRANSITION_REVEAL";
+ case FALL:
+ return "EASE_TRANSITION_FALL";
+ case SLATS:
+ return "EASE_TRANSITION_SLATS";
+ case OPEN_DOOR:
+ return "EASE_TRANSITION_OPEN_DOOR";
+ case EXPLODE:
+ return "EASE_TRANSITION_EXPLODE";
+ case ASSEMBLE:
+ return "EASE_TRANSITION_ASSEMBLE";
+ case ZOOM:
+ return "EASE_TRANSITION_ZOOM";
+ case PANEL:
+ return "EASE_TRANSITION_PANEL";
+ case INTERSPERSE_CONTENTS:
+ return "EASE_TRANSITION_INTERSPERSE_CONTENTS";
+ case SPIN_CONTENTS:
+ return "EASE_TRANSITION_SPIN_CONTENTS";
+ case SPRING_CONTENTS:
+ return "EASE_TRANSITION_SPRING_CONTENTS";
+ case SWING_CONTENTS:
+ return "EASE_TRANSITION_SWING_CONTENTS";
+ case SLIDE_CONTENTS:
+ return "EASE_TRANSITION_SLIDE_CONTENTS";
+ case ZOOM_CONTENTS:
+ return "EASE_TRANSITION_ZOOM_CONTENTS";
+ default:
+ critical("Invalid transition: %i", this);
+ return "EASE_TRANSITION_NONE";
+ }
+ }
+
public static Transition from_string(string str)
{
switch (str)
@@ -288,6 +340,50 @@ public enum Ease.TransitionVariant
IN,
OUT;
+ public string to_string()
+ {
+ switch (this)
+ {
+ case UP:
+ return "EASE_TRANSITION_VARIANT_UP";
+ case DOWN:
+ return "EASE_TRANSITION_VARIANT_DOWN";
+ case LEFT:
+ return "EASE_TRANSITION_VARIANT_LEFT";
+ case RIGHT:
+ return "EASE_TRANSITION_VARIANT_RIGHT";
+ case BOTTOM:
+ return "EASE_TRANSITION_VARIANT_BOTTOM";
+ case TOP:
+ return "EASE_TRANSITION_VARIANT_TOP";
+ case CENTER:
+ return "EASE_TRANSITION_VARIANT_CENTER";
+ case TOP_LEFT:
+ return "EASE_TRANSITION_VARIANT_TOP_LEFT";
+ case TOP_RIGHT:
+ return "EASE_TRANSITION_VARIANT_TOP_RIGHT";
+ case BOTTOM_LEFT:
+ return "EASE_TRANSITION_VARIANT_BOTTOM_LEFT";
+ case BOTTOM_RIGHT:
+ return "EASE_TRANSITION_VARIANT_BOTTOM_RIGHT";
+ case TOP_TO_BOTTOM:
+ return "EASE_TRANSITION_VARIANT_TOP_TO_BOTTOM";
+ case BOTTOM_TO_TOP:
+ return "EASE_TRANSITION_VARIANT_BOTTOM_TO_TOP";
+ case RIGHT_TO_LEFT:
+ return "EASE_TRANSITION_VARIANT_RIGHT_TO_LEFT";
+ case LEFT_TO_RIGHT:
+ return "EASE_TRANSITION_VARIANT_LEFT_TO_RIGHT";
+ case IN:
+ return "EASE_TRANSITION_VARIANT_IN";
+ case OUT:
+ return "EASE_TRANSITION_VARIANT_OUT";
+ default:
+ critical("Invalid transition variant: %i", this);
+ return "EASE_TRANSITION_VARIANT_UP";
+ }
+ }
+
public static TransitionVariant from_string(string str)
{
switch (str)
diff --git a/vapi/clutter-1.0.deps b/vapi/clutter-1.0.deps
new file mode 100644
index 0000000..97e37b1
--- /dev/null
+++ b/vapi/clutter-1.0.deps
@@ -0,0 +1,3 @@
+cairo
+pango
+cogl-1.0
diff --git a/vapi/clutter-gst-1.0.deps b/vapi/clutter-gst-1.0.deps
new file mode 100644
index 0000000..266e1b2
--- /dev/null
+++ b/vapi/clutter-gst-1.0.deps
@@ -0,0 +1,3 @@
+clutter-1.0
+gstreamer-0.10
+gstreamer-base-0.10
diff --git a/vapi/clutter-gtk-0.10.deps b/vapi/clutter-gtk-0.10.deps
new file mode 100644
index 0000000..9d0de2a
--- /dev/null
+++ b/vapi/clutter-gtk-0.10.deps
@@ -0,0 +1,8 @@
+gio-2.0
+atk
+gdk-pixbuf-2.0
+pango
+cairo
+gdk-2.0
+clutter-1.0
+gtk+-2.0
diff --git a/vapi/gdk-2.0.deps b/vapi/gdk-2.0.deps
new file mode 100644
index 0000000..31f76ac
--- /dev/null
+++ b/vapi/gdk-2.0.deps
@@ -0,0 +1,5 @@
+gio-2.0
+gdk-pixbuf-2.0
+cairo
+pango
+pangocairo
diff --git a/vapi/gdk-pixbuf-2.0.deps b/vapi/gdk-pixbuf-2.0.deps
new file mode 100644
index 0000000..cd10dfd
--- /dev/null
+++ b/vapi/gdk-pixbuf-2.0.deps
@@ -0,0 +1 @@
+gio-2.0
diff --git a/vapi/gtk+-2.0.deps b/vapi/gtk+-2.0.deps
new file mode 100644
index 0000000..b347e8d
--- /dev/null
+++ b/vapi/gtk+-2.0.deps
@@ -0,0 +1,6 @@
+gio-2.0
+atk
+cairo
+gdk-pixbuf-2.0
+gdk-2.0
+pango
diff --git a/vapi/json-glib-1.0.deps b/vapi/json-glib-1.0.deps
new file mode 100644
index 0000000..cd10dfd
--- /dev/null
+++ b/vapi/json-glib-1.0.deps
@@ -0,0 +1 @@
+gio-2.0
diff --git a/vapi/libarchive.deps b/vapi/libarchive.deps
new file mode 100644
index 0000000..b3188f7
--- /dev/null
+++ b/vapi/libarchive.deps
@@ -0,0 +1 @@
+posix
diff --git a/vapi/pangocairo.deps b/vapi/pangocairo.deps
new file mode 100644
index 0000000..909838c
--- /dev/null
+++ b/vapi/pangocairo.deps
@@ -0,0 +1,2 @@
+cairo
+pango
diff --git a/vapi/poppler-glib.deps b/vapi/poppler-glib.deps
new file mode 100644
index 0000000..70df1ea
--- /dev/null
+++ b/vapi/poppler-glib.deps
@@ -0,0 +1,5 @@
+gio-2.0
+pango
+gdk-pixbuf-2.0
+gdk-2.0
+cairo
diff --git a/vapi/rest-0.6.deps b/vapi/rest-0.6.deps
new file mode 100644
index 0000000..3f9f152
--- /dev/null
+++ b/vapi/rest-0.6.deps
@@ -0,0 +1,3 @@
+libsoup-2.4
+libxml-2.0
+glib-2.0
diff --git a/vapi/rest-extras-0.6.deps b/vapi/rest-extras-0.6.deps
new file mode 100644
index 0000000..9835603
--- /dev/null
+++ b/vapi/rest-extras-0.6.deps
@@ -0,0 +1 @@
+rest-0.6
diff --git a/vapi/unique-1.0.deps b/vapi/unique-1.0.deps
new file mode 100644
index 0000000..b7ba843
--- /dev/null
+++ b/vapi/unique-1.0.deps
@@ -0,0 +1,8 @@
+gio-2.0
+cairo
+atk
+pango
+gdk-2.0
+gdk-pixbuf-2.0
+gtk+-2.0
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]