[Gridflow-cvs] [svn] commit: r6096 - in /trunk/src: classes1.cxx classes2.cxx classes_gui.cxx gridflow.cxx gridflow.hxx

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Sat Aug 14 19:44:41 EDT 2010


Author: matju
Date: Sat Aug 14 19:44:41 2010
New Revision: 6096

Log:
remove desiredata

Modified:
    trunk/src/classes1.cxx
    trunk/src/classes2.cxx
    trunk/src/classes_gui.cxx
    trunk/src/gridflow.cxx
    trunk/src/gridflow.hxx

Modified: trunk/src/classes1.cxx
==============================================================================
--- trunk/src/classes1.cxx (original)
+++ trunk/src/classes1.cxx Sat Aug 14 19:44:41 2010
@@ -27,17 +27,7 @@
 #include <iomanip>
 #include <errno.h>
 #include "gridflow.hxx.fcs"
-//#ifdef DESIRE
-//#include "desire.h"
-//#else
-//extern "C" {
-//#include "bundled/g_canvas.h"
-//};
-//extern "C" t_canvas *canvas_getrootfor(t_canvas *x);
-//#endif
-
 //using namespace std; // can't
-
 //#undef GRID_INPUT
 //#define GRID_INPUT(I,V) GRID_INLET(I) {in.buf=V=new Grid(in.dim,NumberTypeE_type_of(data));} GRID_FINISH
 

Modified: trunk/src/classes2.cxx
==============================================================================
--- trunk/src/classes2.cxx (original)
+++ trunk/src/classes2.cxx Sat Aug 14 19:44:41 2010
@@ -20,17 +20,11 @@
 */
 
 #include "gridflow.hxx.fcs"
-#ifdef DESIRE
-//#warning Bleuet
-#include "desire.h"
-#else
-//#warning Vanille
 extern "C" {
 #include "bundled/g_canvas.h"
 #include "bundled/m_imp.h"
 extern t_class *text_class;
 };
-#endif
 #include <algorithm>
 #include <errno.h>
 #include <sys/time.h>
@@ -39,7 +33,6 @@
 
 typedef int (*comparator_t)(const void *, const void *);
 
-#ifndef HAVE_DESIREDATA
 struct _outconnect {
     struct _outconnect *next;
     t_pd *to;
@@ -50,7 +43,6 @@
     t_outconnect *connections;
     t_symbol *sym;
 };
-#endif
 
 #define foreach(ITER,COLL) for(typeof(COLL.begin()) ITER = COLL.begin(); ITER != (COLL).end(); ITER++)
 
@@ -61,10 +53,6 @@
 }
 
 /* get the owner of the result of canvas_getenv */
-#ifdef HAVE_DESIREDATA
-#define gl_env env
-#define gl_owner owner
-#endif
 static t_canvas *canvas_getabstop(t_canvas *x) {
     while (!x->gl_env) if (!(x = x->gl_owner)) bug("t_canvasenvironment %p", x);
     return x;
@@ -772,13 +760,9 @@
 		((t_text *)m)->te_ypix = argv[1];
 		t_canvas *granny = m->gl_owner;
 		if (!granny) RAISE("chosen canvas is not in any canvas");
-	    #ifdef DESIRE
-		gobj_changed(m);
-	    #else
 		gobj_vis((t_gobj *)m,granny,0);
 		gobj_vis((t_gobj *)m,granny,1);
 		canvas_fixlinesfor(glist_getcanvas(granny), (t_text *)m);
-	    #endif
 	}
 };
 \end class {install("gf/canvas_setpos",1,0);}
@@ -889,79 +873,48 @@
 };
 \end class {install("gf/canvas_loadbang",1,0);};
 
-\class GFLOL : FObject {
-	int n;
-	\constructor (int n) {this->n=n;}
-	\decl 0 wire_dotted  (int r, int g, int b);
-	\decl 0 wire_bracket (int r, int g, int b);
-	\decl 0 wire_hide ();
-	\decl 0  box_dotted (int r, int g, int b);
-	\decl 0  box_align (t_symbol *s, int x_start, int y_start, int incr);
-};
 #define BEGIN \
 	t_outlet *ouch = ((t_object *)mom)->te_outlet; \
 	t_canvas *can = mom->gl_owner; \
 	if (!can) RAISE("no such canvas"); \
 	for (int i=0; i<n; i++) {ouch = ouch->next; if (!ouch) {RAISE("no such outlet");}}
+
 #define wire_each(wire,ouchlet) for (t_outconnect *wire = ouchlet->connections; wire; wire=wire->next)
-\def 0 wire_dotted (int r, int g, int b) {
-#ifndef DESIRE
-	BEGIN
-	wire_each(wire,ouch) {
-		sys_vgui(".x%lx.c itemconfigure l%lx -fill #%02x%02x%02x -dash {3 3 3 3}\n",long(can),long(wire),r,g,b);
-	}
-#else
-	post("doesn't work with DesireData");
-#endif
-}
-\def 0 wire_bracket (int r, int g, int b) {
-#ifndef DESIRE
-	BEGIN
-/*	wire_each(wire,ouch) {
-		t_linetraverser lt; linetraverser_start(&lt,can);
-		lt.tr_ob = (t_object *)mom;
-		lt.tr_nextoc = wire;
-		linetraverser_next(&lt);
-		int x1=lt.tr_lx1, y1=lt.tr_ly1, x2=lt.tr_lx2, y2=lt.tr_ly2;
-		sys_vgui(".x%lx.c itemconfigure l%lx -fill #%02x%02x%02x -dash {}\n",long(can),long(wire),r,g,b);
-		sys_vgui(".x%lx.c coords l%lx %d %d %d %d %d %d\n",long(can),long(wire),x1,y1,x1,y2,x2,y2);
-	}*/
-	t_linetraverser lt; linetraverser_start(&lt,can);
-	t_outconnect *wire;
-	while ((wire = linetraverser_next(&lt))) if (lt.tr_outlet==ouch) {
-		int x1=lt.tr_lx1, y1=lt.tr_ly1, x2=lt.tr_lx2, y2=lt.tr_ly2;
-		sys_vgui(".x%lx.c itemconfigure l%lx -fill #%02x%02x%02x -dash {}\n; "
-			 ".x%lx.c coords l%lx %d %d %d %d %d %d %d %d %d %d\n",
-			long(can),long(wire),r,g,b,
-			long(can),long(wire), x1,y1, x1,y1+3, x1+7,y1+3, x1+7,y2+8, x2-2,y2+8);
-	}
-#else
-	post("doesn't work with DesireData");
-#endif
-}
-\def 0 wire_hide () {
-#ifndef DESIRE
-	BEGIN
-	wire_each(wire,ouch) sys_vgui(".x%lx.c delete l%lx\n",long(can),long(wire));
-#else
-	post("doesn't work with DesireData");
-#endif
-}
-\def 0 box_dotted (int r, int g, int b) {
-#ifndef DESIRE
-	BEGIN
-	wire_each(wire,ouch) {
-		t_object *t = (t_object *)wire->to;
-		int x1,y1,x2,y2;
-		gobj_getrect((t_gobj *)wire->to,can,&x1,&y1,&x2,&y2);
-		// was #00aa66 {3 5 3 5}
-		sys_vgui(".x%lx.c delete %lxRECT; .x%lx.c create rectangle %d %d %d %d "DASHRECT" -tags %lxRECT\n",
-			long(can),long(t),long(can),x1,y1,x2,y2,long(t));
-		}
-#else
-	post("doesn't work with DesireData");
-#endif
-}
+
+\class GFLOL : FObject {
+	int n;
+	\constructor (int n) {this->n=n;}
+	\decl 0 wire_dotted  (int r, int g, int b) {BEGIN
+		wire_each(wire,ouch) {
+			sys_vgui(".x%lx.c itemconfigure l%lx -fill #%02x%02x%02x -dash {3 3 3 3}\n",long(can),long(wire),r,g,b);
+		}
+	}
+	\decl 0 wire_bracket (int r, int g, int b) {BEGIN
+		t_outconnect *wire; t_linetraverser lt; linetraverser_start(&lt,can);
+		// lt.tr_ob = (t_object *)mom; lt.tr_nextoc = wire; // would like this shortcut but can't use it
+		while ((wire = linetraverser_next(&lt))) if (lt.tr_outlet==ouch) {
+			int x1=lt.tr_lx1, y1=lt.tr_ly1, x2=lt.tr_lx2, y2=lt.tr_ly2;
+			sys_vgui(".x%lx.c itemconfigure l%lx -fill #%02x%02x%02x -dash {}\n; "
+				".x%lx.c coords l%lx %d %d %d %d %d %d %d %d %d %d\n",
+				long(can),long(wire),r,g,b,
+				long(can),long(wire), x1,y1, x1,y1+3, x1+7,y1+3, x1+7,y2+8, x2-2,y2+8);
+		}
+	}
+	\decl 0 wire_hide () {BEGIN
+		wire_each(wire,ouch) sys_vgui(".x%lx.c delete l%lx\n",long(can),long(wire));
+	}
+	\decl 0  box_dotted (int r, int g, int b) {BEGIN
+		wire_each(wire,ouch) {
+			t_object *t = (t_object *)wire->to;
+			int x1,y1,x2,y2;
+			gobj_getrect((t_gobj *)wire->to,can,&x1,&y1,&x2,&y2);
+			// was #00aa66 {3 5 3 5}
+			sys_vgui(".x%lx.c delete %lxRECT; .x%lx.c create rectangle %d %d %d %d "DASHRECT" -tags %lxRECT\n",
+				long(can),long(t),long(can),x1,y1,x2,y2,long(t));
+			}
+	}
+	\decl 0  box_align (t_symbol *s, int x_start, int y_start, int incr);
+};
 bool comment_sort_y_lt(t_object * const &a, t_object * const &b) /* is a StrictWeakOrdering */ {
 	return a->te_ypix < b->te_ypix;
 }
@@ -983,7 +936,6 @@
 	bool horiz;
 	if (dir==&s_x) horiz=false; else
 	if (dir==&s_y) horiz=true;  else RAISE("$1 must be x or y");
-#ifndef DESIRE
 	vector<t_object *> v;
 	BEGIN
 	wire_each(wire,ouch) {
@@ -1008,12 +960,8 @@
 	}
 	if (horiz) out[0](x-x_start);
 	else       out[0](y-y_start);
-#else
-	post("doesn't work with DesireData");
-#endif
-}
-
-#ifndef DESIRE
+}
+
 extern t_widgetbehavior text_widgetbehavior;
 t_widgetbehavior text_widgetbehavi0r;
 
@@ -1032,14 +980,12 @@
 	t_rtext *y = glist_findrtext(can,(t_text *)o);
 	if (text_chou_de_vis((t_text *)o,can)) glist_eraseiofor(can,(t_object *)o,rtext_gettag(y));
 }
-#endif
 
 size_t properties_offset;
 
 //int propertiesfn_offset;
 \end class {
 	install("gf/lol",1,1);
-#ifndef DESIRE
 	class_setpropertiesfn(text_class,(t_propertiesfn)0xDECAFFED);
 	unsigned long *lol = (unsigned long *)text_class;
 	int i=0;
@@ -1056,7 +1002,6 @@
 	memcpy(&text_widgetbehavi0r,&text_widgetbehavior,sizeof(t_widgetbehavior));
 	text_widgetbehavi0r.w_visfn = text_visfn_hax0r;
 	class_setwidget(text_class,&text_widgetbehavi0r);
-#endif
 }
 
 bool canvas_contains (t_canvas *x, t_gobj *y) {for (t_gobj *g=x->gl_list; g; g=g->g_next) if (g==y) return true; return false;}

Modified: trunk/src/classes_gui.cxx
==============================================================================
--- trunk/src/classes_gui.cxx (original)
+++ trunk/src/classes_gui.cxx Sat Aug 14 19:44:41 2010
@@ -20,17 +20,12 @@
 */
 
 #include "gridflow.hxx.fcs"
-#ifdef DESIRE
-//#warning Bleuet
-#include "desire.h"
-#else
-//#warning Vanille
 extern "C" {
 #include "bundled/g_canvas.h"
 #include "bundled/m_imp.h"
 extern t_class *text_class;
-};
-#endif
+int sys_hostfontsize(int fontsize);
+};
 #include <algorithm>
 #include <errno.h>
 #include <sys/time.h>
@@ -39,7 +34,6 @@
 
 typedef int (*comparator_t)(const void *, const void *);
 
-#ifndef HAVE_DESIREDATA
 struct _outconnect {
     struct _outconnect *next;
     t_pd *to;
@@ -50,7 +44,6 @@
     t_outconnect *connections;
     t_symbol *sym;
 };
-#endif
 
 #define foreach(ITER,COLL) for(typeof(COLL.begin()) ITER = COLL.begin(); ITER != (COLL).end(); ITER++)
 
@@ -135,14 +128,6 @@
 
 //****************************************************************
 
-#ifdef DESIRE
-t_glist *glist_getcanvas(t_glist *foo) {return foo;}//dummy
-void canvas_fixlinesfor(t_glist *foo,t_text *) {}//dummy
-#else
-extern "C" int sys_hostfontsize(int fontsize);
-#endif
-
-//#ifdef DESIRE
 \class Display : GUI_FObject {
 	int y,x;
 	ostringstream text;
@@ -216,9 +201,6 @@
 	}
 };
 \end class {
-#ifdef DESIRE
-	install("gf/display",1,0);
-#else
 	install("display",1,0);
 	class_setwidget(fclass->bfclass,Display::newwb());
 	sys_gui("proc display_update {self c x y fg bg outline font text} { \n"
@@ -234,9 +216,7 @@
 		"$c lower ${self}R ${self}TEXT\n"
 		"pd \"$self set_size $sy $sx;\" \n"
 	"}\n");
-#endif
 }
-//#endif // ndef DESIRE
 
 //****************************************************************
 

Modified: trunk/src/gridflow.cxx
==============================================================================
--- trunk/src/gridflow.cxx (original)
+++ trunk/src/gridflow.cxx Sat Aug 14 19:44:41 2010
@@ -39,21 +39,11 @@
 #include <fcntl.h>
 #include <limits.h>
 
-#ifdef HAVE_DESIREDATA
-//#warning Bleuet
-#include "desire.h"
-#else
-//#warning Vanille
 extern "C" {
 #include "bundled/g_canvas.h"
 #include "bundled/m_imp.h"
 extern t_class *text_class;
 };
-#endif
-
-//#ifndef HAVE_DESIREDATA
-//#include "bundled/g_canvas.h"
-//#endif
 
 /* for exception-handling in 0.9.x and 9.x... Linux-only */
 #if !defined(MACOSX) && !defined(__WIN32__)
@@ -690,17 +680,14 @@
 //****************************************************************
 
 static void BFObject_undrawio (BFObject *bself) {
-#ifndef HAVE_DESIREDATA
 	t_canvas *mom = bself->self->mom;
 	if (!mom || !glist_isvisible(mom)) return;
 	t_rtext *rt = glist_findrtext(mom,bself);
 	if (!rt) return;
 	glist_eraseiofor(mom,bself,rtext_gettag(rt));
-#endif
 }
 
 static void BFObject_redraw (BFObject *bself) {
-#ifndef HAVE_DESIREDATA
 	t_canvas *mom = bself->self->mom;
 	if (!mom || !glist_isvisible(mom)) return;
 	t_rtext *rt = glist_findrtext(mom,bself);
@@ -708,7 +695,6 @@
 	gobj_vis((t_gobj *)bself,mom,0);
 	gobj_vis((t_gobj *)bself,mom,1);
 	canvas_fixlinesfor(mom,(t_text *)bself);
-#endif
 }
 
 /* warning: deleting inlets that are connected will cause pd to crash */
@@ -770,10 +756,6 @@
 	class_addcreator((t_newmethod)BFObject_new,gensym((char *)name),A_GIMME,0);
 }
 
-#ifdef DESIRE
-#define c_nmethod nmethod
-#define c_methods methods
-#endif
 void add_creator3(FClass *fclass, const char *name) {
 	fclasses[string(name)] = fclass;
 	t_class *c = pd_objectmaker;
@@ -795,11 +777,9 @@
 
 //****************************************************************
 
-#ifndef DESIRE
 struct t_namelist;
 extern t_namelist *sys_searchpath, *sys_helppath;
 extern "C" t_namelist *namelist_append_files(t_namelist *, char *);
-#endif
 static void add_to_path(char *dir) {
 	static bool debug = false;
 	char bof[1024];
@@ -975,20 +955,10 @@
 #endif
 
 static t_gobj *canvas_last (t_canvas *self) {
-#ifdef DESIRE
-	t_gobj *g = canvas_first(self);
-	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_atom2 *argv) {
 	t_gobj *g = canvas_last(self); if (!g) {pd_error(self,"canvas else: there is no last object"); return;}

Modified: trunk/src/gridflow.hxx
==============================================================================
--- trunk/src/gridflow.hxx (original)
+++ trunk/src/gridflow.hxx Sat Aug 14 19:44:41 2010
@@ -68,9 +68,7 @@
 #endif
 #define DEF_OUT
 
-#ifndef DESIREDATA
 #define A_LIST    t_atomtype(13) /* (t_binbuf *) */
-#endif
 #define A_GRID    t_atomtype(14) /* (Grid *)    */
 #define A_GRIDOUT t_atomtype(15) /* (GridOut *) */
 // the use of w_gpointer here is fake, just because there's no suitable member in the union
@@ -930,8 +928,7 @@
 }
 #endif
 
-/* both oprintf are copied from desiredata */
-
+/* all those three printf are copied from desiredata */
 static inline int voprintf(ostream &buf, const char *s, va_list args) {
     char *b;
     int n = vasprintf(&b,s,args);
@@ -946,9 +943,6 @@
     va_end(args);
     return n;
 }
-
-/* this function was copied from desiredata */
-#ifndef DESIRE
 inline t_symbol *symprintf(const char *s, ...) {
     char *buf;
     va_list args;
@@ -959,21 +953,15 @@
     free(buf);
     return r;
 }
-#endif
 
 ostream &operator << (ostream &self, const t_atom &a);
 
 // from pd/src/g_canvas.c
-#ifdef DESIRE
-#define ce_argc argc
-#define ce_argv argv
-#else
 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" */
 };
-#endif
-
-#endif // __GF_GRID_H
+
+#endif // __GF_GRIDFLOW_H



More information about the Gridflow-cvs mailing list