[Gridflow-cvs] [svn] commit: r4192 - /trunk/gridflow.c

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Wed Jun 3 16:58:32 EDT 2009


Author: matju
Date: Wed Jun  3 16:58:32 2009
New Revision: 4192

Log:
for desiredata compat

Modified:
    trunk/gridflow.c

Modified: trunk/gridflow.c
==============================================================================
--- trunk/gridflow.c (original)
+++ trunk/gridflow.c Wed Jun  3 16:58:32 2009
@@ -39,6 +39,17 @@
 #ifdef HAVE_GEM
 #include "Base/GemPixDualObj.h"
 #endif
+
+#ifndef HAVE_DESIREDATA
+#include "bundled/g_canvas.h"
+#endif
+// from pd/src/g_canvas.c
+struct _canvasenvironment {
+    t_symbol *ce_dir;   /* directory patch lives in */
+    int ce_argc;        /* number of "$" arguments */
+    t_atom *ce_argv;    /* array of "$" arguments */
+    int ce_dollarzero;  /* value of "$0" */
+};
 
 /* for exception-handling in 0.9.0... Linux-only */
 #ifndef MACOSX
@@ -600,16 +611,6 @@
 }
 
 //****************************************************************
-
-// from pd/src/g_canvas.c
-struct _canvasenvironment {
-    t_symbol *ce_dir;   /* directory patch lives in */
-    int ce_argc;        /* number of "$" arguments */
-    t_atom *ce_argv;    /* array of "$" arguments */
-    int ce_dollarzero;  /* value of "$0" */
-};
-
-#include "bundled/g_canvas.h"
 
 static void BFObject_undrawio (BFObject *bself) {
 #ifndef HAVE_DESIREDATA
@@ -825,7 +826,7 @@
 	foreach(attr,fc->attrs) post("    %s %s;",attr->second->type.data(),attr->second->name.data());
 	post(")");
 	post("methods (");
-	for (int i=0; i<fc->methodsn; i++) post("    %s",fc->methods[i]);
+	for (int i=0; i<fc->methodsn; i++) post("    %s",fc->methods[i].selector);
 	post(")");
 }
 \classinfo {}
@@ -852,13 +853,18 @@
 static t_gobj *canvas_last (t_canvas *self) {
 #ifdef DESIRE
 	t_gobj *g = canvas_first(self);
-	while (g->g_next) g=gobj_next(g);
+	while (gobj_next(g)) g=gobj_next(g);
 #else
 	t_gobj *g = self->gl_list;
 	while (g->g_next) g=g->g_next;
 #endif
 	return g;
 }
+
+#ifdef DESIRE
+extern "C" void canvas_delete(t_canvas *, t_gobj *);
+#define glist_delete canvas_delete
+#endif
 
 static void canvas_else (t_canvas *self, t_symbol *s, int argc, t_atom *argv) {
 	t_gobj *g = canvas_last(self);
@@ -922,5 +928,6 @@
     signal(SIGABRT,SIG_DFL);
     signal(SIGBUS, SIG_DFL);
     atexit(gridflow_unsetup);
+    extern t_class *canvas_class;
     class_addmethod(canvas_class,(t_method)canvas_else,gensym("else"),A_GIMME,0);
 }



More information about the Gridflow-cvs mailing list