[gegl-gtk] Examples: Add basic Vala example that at least builds



commit 838b54e11684ca9e5799a9bccc22f0e325f6d8b3
Author: Jon Nordby <jononor gmail com>
Date:   Tue Sep 20 19:57:19 2011 +0200

    Examples: Add basic Vala example that at least builds
    
    Does currently not work. Could be due to gegl_init not
    being called correctly.

 configure.ac                      |    1 +
 examples/Makefile.am              |    2 +-
 examples/vala/Makefile.am         |   19 +++++++++++++++++++
 examples/vala/gegl-gtk-basic.vala |   28 ++++++++++++++++++++++++++++
 4 files changed, 49 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 33dc20d..aaf4bfe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -347,6 +347,7 @@ gegl-gtk/Makefile
 operations/Makefile
 examples/Makefile
 examples/c/Makefile
+examples/vala/Makefile
 tests/Makefile
 docs/reference/Makefile
 docs/reference/gegl-gtk-docs.xml
diff --git a/examples/Makefile.am b/examples/Makefile.am
index d080bd3..586114a 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -1,2 +1,2 @@
 
-SUBDIRS = c
+SUBDIRS = c vala
diff --git a/examples/vala/Makefile.am b/examples/vala/Makefile.am
new file mode 100644
index 0000000..1392955
--- /dev/null
+++ b/examples/vala/Makefile.am
@@ -0,0 +1,19 @@
+
+if HAVE_VALA
+
+VALA_FILES = $(wildcard $(srcdir)/*.vala)
+EXTRA_DIST = $(VALA_FILES)
+bins   = $(subst $(srcdir)/,,$(VALA_FILES:.vala=))
+
+vapi_dir = ../../gegl-gtk
+vala_pkg = gegl-gtk GEGL_GTK_GTK_VERSION@- GEGL_GTK_API_VERSION@
+
+all-local: $(bins)
+
+gegl-gtk-basic: gegl-gtk-basic.vala $(vapi_dir)/$(vala_pkg).vapi
+	valac --pkg $(vala_pkg) --vapidir= VAPIDIR@ --vapidir=$(vapi_dir) -o $@ $< 
+
+clean-local:
+	rm -f $(bins)
+
+endif # HAVE_VALA
diff --git a/examples/vala/gegl-gtk-basic.vala b/examples/vala/gegl-gtk-basic.vala
new file mode 100644
index 0000000..1a9882f
--- /dev/null
+++ b/examples/vala/gegl-gtk-basic.vala
@@ -0,0 +1,28 @@
+
+class Examples.Basic : GLib.Object {
+
+    public static int main(string[] args) {
+        Gtk.init(ref args);
+        Gegl.init(0, "");
+
+        var graph = new Gegl.Node();
+        var node = graph.create_child("gegl:load");
+        node.set_property("path", args[1]);
+
+        var window = new Gtk.Window();
+        window.title = "GEGL GTK Basic Vala example";
+        window.set_default_size(300, 300);
+        window.destroy.connect(Gtk.main_quit);
+
+        var node_view = new GeglGtk.View();
+        node_view.set_node(node);
+
+        window.add(node_view);
+        window.show_all();
+
+        Gtk.main();
+        Gegl.exit();
+        return 0;
+    }
+}
+



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