[Gridflow-cvs] [svn] commit: r4258 - /trunk/base/flow_objects2.c

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Sun Oct 18 18:06:31 EDT 2009


Author: matju
Date: Sun Oct 18 18:06:31 2009
New Revision: 4258

Log:
adding [gf/canvasfilename]

Modified:
    trunk/base/flow_objects2.c

Modified: trunk/base/flow_objects2.c
==============================================================================
--- trunk/base/flow_objects2.c (original)
+++ trunk/base/flow_objects2.c Sun Oct 18 18:06:31 2009
@@ -22,6 +22,13 @@
 */
 
 #include "../gridflow.h.fcs"
+#ifdef DESIRE
+#include "desire.h"
+#else
+extern "C" {
+#include "bundled/g_canvas.h"
+};
+#endif
 #define OP(x) op_dict[string(#x)]
 
 static void expect_min_one_dim (P<Dim> d) {
@@ -86,6 +93,21 @@
 
 \end class {install("#cluster_avg",3,2);}
 
+\class GFCanvasFileName : FObject {
+	int n;
+	\constructor (int n) {this->n=n;}
+	\decl 0 bang ();
+};
+\def 0 bang () {
+	t_canvas *mom = bself->mom;
+	for (int i=0; i<n; i++) {
+		mom = mom->gl_owner;
+		if (!mom) RAISE("no such canvas");
+	}
+	outlet_symbol(bself->outlets[0],mom->gl_name ? mom->gl_name : gensym("empty"));
+}
+\end class {install("gf/canvasfilename",1,1);}
+
 void startup_flow_objects2 () {
 	\startall
 }



More information about the Gridflow-cvs mailing list