seed r223 - in trunk: . examples gir



Author: racarr
Date: Sun Nov  9 17:07:41 2008
New Revision: 223
URL: http://svn.gnome.org/viewvc/seed?rev=223&view=rev

Log:
Add cairo gir, and short example. Not really intended to actually be used, just for testing right now.


Added:
   trunk/examples/cairo.js   (contents, props changed)
   trunk/gir/
   trunk/gir/Makefile.am
Modified:
   trunk/Makefile.am
   trunk/configure.ac
   trunk/examples/Makefile.am

Modified: trunk/Makefile.am
==============================================================================
--- trunk/Makefile.am	(original)
+++ trunk/Makefile.am	Sun Nov  9 17:07:41 2008
@@ -5,6 +5,7 @@
 	libseed\
 	src\
 	extensions\
+	gir \
 	doc\
 	examples\
 	tests

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Sun Nov  9 17:07:41 2008
@@ -83,4 +83,5 @@
 examples/ide/Makefile
 examples/lightsoff/Makefile
 examples/clutter-shader/Makefile
+gir/Makefile
 ])

Modified: trunk/examples/Makefile.am
==============================================================================
--- trunk/examples/Makefile.am	(original)
+++ trunk/examples/Makefile.am	Sun Nov  9 17:07:41 2008
@@ -22,6 +22,7 @@
 	repl.js \
 	soup.js \
 	vte-test.js \
+	cairo.js \
 	HACKING
 EXTRA_DIST = \
 	actions.js \
@@ -42,6 +43,7 @@
 	repl.js \
 	soup.js \
 	vte-test.js \
+	cairo.js \
 	HACKING
 
 ## File created by the gnome-build tools

Added: trunk/examples/cairo.js
==============================================================================
--- (empty file)
+++ trunk/examples/cairo.js	Sun Nov  9 17:07:41 2008
@@ -0,0 +1,40 @@
+#!/usr/local/bin/seed
+Seed.import_namespace("Cairo");
+Seed.import_namespace("Gdk");
+Seed.import_namespace("Gtk");
+
+Gtk.init(null, null);
+
+w = new Gtk.Window();
+w.signal.hide.connect(Gtk.main_quit);
+w.app_paintable = true;
+
+w.signal.expose_event.connect(
+      function(widget, event)
+      {
+	  
+	  cairo = Gdk.cairo_create(widget.window);
+	  pattern = Cairo.pattern_create_linear(0, 0, 0, 256);
+	  
+	  Cairo.pattern_add_color_stop_rgba(pattern, 1, 0, 0, 0, 1);
+	  Cairo.pattern_add_color_stop_rgba(pattern, 0, 1, 1, 1, 1);
+	  Cairo.rectangle(cairo, 0, 0, 256, 256);
+	  Cairo.set_source(cairo, pattern);
+	  Cairo.fill(cairo);
+	  
+	  Cairo.pattern_destroy(pattern);
+	  
+	  pattern = Cairo.pattern_create_radial(115.2, 102.4, 25.6,
+						 102.4, 102.4, 128.0);
+	  Cairo.pattern_add_color_stop_rgba(pattern, 0, 1, 1, 1, 1);
+	  Cairo.pattern_add_color_stop_rgba(pattern, 1, 0, 0, 0, 1);
+	  Cairo.set_source(cairo, pattern);
+	  Cairo.arc(cairo, 128, 128, 76.8, 0, 2*Math.PI);
+	  Cairo.fill(cairo);
+	  Cairo.pattern_destroy(pattern);
+	  
+      });
+
+w.show_all();
+w.resize(256, 256);
+Gtk.main();
\ No newline at end of file

Added: trunk/gir/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/gir/Makefile.am	Sun Nov  9 17:07:41 2008
@@ -0,0 +1,28 @@
+CAIRO_INCLUDEDIR=`pkg-config --variable=includedir cairo`
+
+Cairo-1.0.gir: 
+	g-ir-scanner -v --namespace Cairo --nsversion=1.0 \
+	--strip-prefix=Cairo --add-include-path=/usr/local/share/gir \
+	--include=fontconfig-2.0 \
+	--include=freetype2-2.0 \
+	--library=cairo \
+	--output Cairo-1.0.gir \
+	--pkg freetype2 \
+	-I`pkg-config --variable=includedir cairo` \
+	$(CAIRO_INCLUDEDIR)/cairo/cairo.h \
+	$(CAIRO_INCLUDEDIR)/cairo/cairo-ft.h \
+	$(CAIRO_INCLUDEDIR)/cairo/cairo-pdf.h \
+	$(CAIRO_INCLUDEDIR)/cairo/cairo-ps.h \
+	$(CAIRO_INCLUDEDIR)/cairo/cairo-svg.h
+
+Cairo-1.0.typelib: Cairo-1.0.gir
+	g-ir-compiler --includedir=$(datadir)/dir Cairo-1.0.gir -o Cairo-1.0.typelib
+
+girdir = $(datadir)/gir
+gir_DATA = Cairo-1.0.gir
+
+typelibsdir = $(libdir)/girepository
+typelibs_DATA = Cairo-1.0.typelib
+
+
+	



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