[Gridflow-cvs] [svn] commit: r6269 - in /trunk/src: classes2.cxx classes_gui.cxx hack.hxx

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Tue Sep 14 18:24:00 EDT 2010


Author: mescalinum
Date: Tue Sep 14 18:23:59 2010
New Revision: 6269

Log:
Undo changes %lx -> %p in order to not break communication with Pd

Modified:
    trunk/src/classes2.cxx
    trunk/src/classes_gui.cxx
    trunk/src/hack.hxx

Modified: trunk/src/classes2.cxx
==============================================================================
--- trunk/src/classes2.cxx (original)
+++ trunk/src/classes2.cxx Tue Sep 14 18:23:59 2010
@@ -725,7 +725,7 @@
 		pd_bind((t_pd *)bself,name);
 	}
 	~GFCanvasXID () {pd_unbind((t_pd *)bself,name);}
-	\decl 0 bang () {MOM; sys_vgui("pd %s xid [winfo id .x%p.c] [winfo id .x%p]\\;\n",name->s_name,m,m);}
+	\decl 0 bang () {MOM; sys_vgui("pd %s xid [winfo id .x%lx.c] [winfo id .x%lx]\\;\n",name->s_name,(long)(intptr_t)m,(long)(intptr_t)m);}
 	\decl 0 xid (t_symbol *t, t_symbol *u) {MOM
 		out[2](symprintf(".x%lx",m));
 		out[1](u);
@@ -744,7 +744,7 @@
 		if (m->gl_screeny2-m->gl_screeny1 < int(y)) m->gl_screeny2 = m->gl_screeny1+int(y);
 		int  sx = int(m->gl_screenx2-m->gl_screenx1); // new size x
 		int  sy = int(m->gl_screeny2-m->gl_screeny1); // new size y
-		if (osx!=sx || osy!=sy) sys_vgui("wm geometry .x%p %dx%d\n",m,sx,sy);
+		if (osx!=sx || osy!=sy) sys_vgui("wm geometry .x%lx %dx%d\n",(long)(intptr_t)m,sx,sy);
 	}
 };
 \end class {install("gf/canvas_hehehe",1,1);}
@@ -756,11 +756,11 @@
 	t_canvas *last;
 	\constructor (int n) {this->n=n; last=0;}
 	~GFCanvasHoHoHo () {_0_hide();}
-	\decl 0 hide () {if (last) sys_vgui(".x%p.c delete %pRECT\n",last,bself);}
+	\decl 0 hide () {if (last) sys_vgui(".x%lx.c delete %lxRECT\n",(long)(intptr_t)last,(long)(intptr_t)bself);}
 	\decl 0 list (int x1, int y1, int x2, int y2) {MOM;
 		_0_hide();
 		last = m;
-		sys_vgui(".x%p.c create rectangle %d %d %d %d "DASHRECT" -tags %pRECT\n",m,x1,y1,x2,y2,bself);
+		sys_vgui(".x%lx.c create rectangle %d %d %d %d "DASHRECT" -tags %lxRECT\n",(long)(intptr_t)m,x1,y1,x2,y2,(long)(intptr_t)bself);
 	}
 };
 \end class {install("gf/canvas_hohoho",1,0);}
@@ -812,7 +812,7 @@
 	\constructor (int n) {this->n=n;}
 	\decl 0 wire_dotted  (int r, int g, int b) {BEGIN
 		wire_each(wire,ouch) {
-			sys_vgui(".x%p.c itemconfigure l%p -fill #%02x%02x%02x -dash {3 3 3 3}\n",can,wire,r,g,b);
+			sys_vgui(".x%lx.c itemconfigure l%lx -fill #%02x%02x%02x -dash {3 3 3 3}\n",(long)(intptr_t)can,(long)(intptr_t)wire,r,g,b);
 		}
 	}
 	\decl 0 wire_bracket (int r, int g, int b) {BEGIN
@@ -820,14 +820,14 @@
 		// 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%p.c itemconfigure l%p -fill #%02x%02x%02x -dash {}\n; "
-				".x%p.c coords l%p %d %d %d %d %d %d %d %d %d %d\n",
-				can,wire,r,g,b,
-				can,wire, x1,y1, x1,y1+3, x1+7,y1+3, x1+7,y2+8, x2-2,y2+8);
+			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)(intptr_t)can,(long)(intptr_t)wire,r,g,b,
+				(long)(intptr_t)can,(long)(intptr_t)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%p.c delete l%p\n",can,wire);
+		wire_each(wire,ouch) sys_vgui(".x%lx.c delete l%lx\n",(long)(intptr_t)can,(long)(intptr_t)wire);
 	}
 	\decl 0  box_dotted (int r, int g, int b) {BEGIN
 		wire_each(wire,ouch) {
@@ -835,8 +835,8 @@
 			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%p.c delete %pRECT; .x%p.c create rectangle %d %d %d %d "DASHRECT" -tags %pRECT\n",
-				can,t,can,x1,y1,x2,y2,t);
+			sys_vgui(".x%lx.c delete %lxRECT; .x%lx.c create rectangle %d %d %d %d "DASHRECT" -tags %lxRECT\n",
+				(long)(intptr_t)can,(long)(intptr_t)t,(long)(intptr_t)can,x1,y1,x2,y2,(long)(intptr_t)t);
 			}
 	}
 	\decl 0  box_align (t_symbol *s, int x_start, int y_start, int incr);

Modified: trunk/src/classes_gui.cxx
==============================================================================
--- trunk/src/classes_gui.cxx (original)
+++ trunk/src/classes_gui.cxx Tue Sep 14 18:23:59 2010
@@ -82,7 +82,7 @@
 		self->vis = !!flag;
 		if (flag) self->changed();
 		else { // can't call deletefn directly
-			sys_vgui(".x%p.c delete %s\n",c,self->rsym->s_name);
+			sys_vgui(".x%lx.c delete %s\n",(long)(intptr_t)c,self->rsym->s_name);
 			sys_unqueuegui(x);
 		}
 	}
@@ -92,16 +92,16 @@
 	}
 	static void displacefn(BLAH, int dx, int dy) {INIT L
 		bself->te_xpix+=dx; bself->te_ypix+=dy;
-		sys_vgui(".x%p.c move %s %d %d\n",glist_getcanvas(glist),self->rsym->s_name,dx,dy);
+		sys_vgui(".x%lx.c move %s %d %d\n",(long)(intptr_t)glist_getcanvas(glist),self->rsym->s_name,dx,dy);
 		canvas_fixlinesfor(glist, (t_text *)x);
 	}
 	static void selectfn(BLAH, int state) {INIT L
 		self->selected=!!state;
-		sys_vgui(".x%p.c itemconfigure {%sR || %sTEXT} -outline %s\n",c,
+		sys_vgui(".x%lx.c itemconfigure {%sR || %sTEXT} -outline %s\n",(long)(intptr_t)c,
 			self->rsym->s_name,self->rsym->s_name,self->selected?"#0000ff":self->outline.data());
 	}
 	static void deletefn(BLAH) {INIT L
-		/* if (self->vis) */ sys_vgui(".x%p.c delete %s\n",c,self->rsym->s_name);
+		/* if (self->vis) */ sys_vgui(".x%lx.c delete %s\n",(long)(intptr_t)c,self->rsym->s_name);
 		canvas_deletelinesfor(glist,(t_object *)bself); // hein ?
 		sys_unqueuegui(x);
 	}
@@ -167,20 +167,20 @@
 			else quoted << (char)s[i];
 		}
 		// used to have {Courier -12} but this changed to use pdtk_canvas_new
-		if (vis) sys_vgui("display_update %s .x%p.c %d %d #000000 #ffffc8 %s %d \"%s\"\n",
-			rsym->s_name,glist_getcanvas(mom),text_xpix(bself,mom),text_ypix(bself,mom),
+		if (vis) sys_vgui("display_update %s .x%lx.c %d %d #000000 #ffffc8 %s %d \"%s\"\n",
+			rsym->s_name,(long)(intptr_t)glist_getcanvas(mom),text_xpix(bself,mom),text_ypix(bself,mom),
 			selected?"#0000ff":"#aaaaaa", sys_hostfontsize(glist_getfont(mom)),quoted.str().data());
 		else {
 			t_canvas *c = glist_getcanvas(mom);
-			sys_vgui(".x%p.c delete %s\n",c,rsym->s_name);
+			sys_vgui(".x%lx.c delete %s\n",(long)(intptr_t)c,rsym->s_name);
 		}
 	}
 	NEWWB
 	static void redraw(BLAH) {INIT1 self->show();}
 	static void selectfn(BLAH, int state) {INIT L
 		self->selected=!!state;
-		sys_vgui(".x%p.c itemconfigure %sR -outline %s\n",c,self->rsym->s_name,self->selected?"#0000ff":"#aaaaaa");
-		sys_vgui(".x%p.c itemconfigure %sTEXT -fill %s\n",c,self->rsym->s_name,self->selected?"#0000ff":"#000000");
+		sys_vgui(".x%lx.c itemconfigure %sR -outline %s\n",(long)(intptr_t)c,self->rsym->s_name,self->selected?"#0000ff":"#aaaaaa");
+		sys_vgui(".x%lx.c itemconfigure %sTEXT -fill %s\n",(long)(intptr_t)c,self->rsym->s_name,self->selected?"#0000ff":"#000000");
 	}
 	\decl void anything (...) {
 		t_symbol *sel = argv[1];
@@ -409,7 +409,7 @@
 		if (buf) sendbuf();
 		t_glist *c = glist_getcanvas(mom);
 		if (osx!=sx || osy!=sy) canvas_fixlinesfor(c,(t_object *)bself);
-		sys_vgui("gridsee_update %s .x%p.c %d %d %d %d %d %d %d %d #cccccc %s\n",rsym->s_name,c,
+		sys_vgui("gridsee_update %s .x%lx.c %d %d %d %d %d %d %d %d #cccccc %s\n",rsym->s_name,(long)(intptr_t)c,
 			text_xpix(bself,mom),text_ypix(bself,mom),sx,sy,mx1,my1,mx2,my2,selected?"#0000ff":"#aaaaaa");
 		out[0](gensym("shown"),0,0);
 	}
@@ -480,13 +480,13 @@
 	void show () {
 		//if (osx!=sx || osy!=sy) canvas_fixlinesfor(c,(t_object *)bself);
 		t_glist *c = glist_getcanvas(mom);
-		sys_vgui("gf/tk_button.update %s .x%p.c %d %d %d %d #ffffff %s\n",rsym->s_name,c,
+		sys_vgui("gf/tk_button.update %s .x%lx.c %d %d %d %d #ffffff %s\n",rsym->s_name,(long)(intptr_t)c,
 			text_xpix(bself,mom),text_ypix(bself,mom),sx,sy,selected?"#0000ff":outline.data());
 	}
 	static void visfn(BLAH, int flag) {INIT
-		if (flag && !self->vis) sys_vgui("gf/tk_button.create %s .x%p.c %d %d {%s}\n",self->rsym->s_name,c,
+		if (flag && !self->vis) sys_vgui("gf/tk_button.create %s .x%lx.c %d %d {%s}\n",self->rsym->s_name,(long)(intptr_t)c,
 			text_xpix(bself,self->mom),text_ypix(bself,self->mom),self->text->s_name);
-		if (!flag && self->vis) sys_vgui("gf/tk_button.destroy %s .x%p.c\n",self->rsym->s_name,c);
+		if (!flag && self->vis) sys_vgui("gf/tk_button.destroy %s .x%lx.c\n",self->rsym->s_name,(long)(intptr_t)c);
 		GUI_FObject::visfn(x,glist,flag);//super
 	}
 	NEWWB

Modified: trunk/src/hack.hxx
==============================================================================
--- trunk/src/hack.hxx (original)
+++ trunk/src/hack.hxx Tue Sep 14 18:23:59 2010
@@ -19,8 +19,8 @@
         strcat(namebuf, ")");
     }
     else namebuf[0] = 0;
-    sys_vgui("wm title .x%p {%s%c%s - %s}\n",
-        x, x->gl_name->s_name, (x->gl_dirty? '*' : ' '), namebuf,
+    sys_vgui("wm title .x%lx {%s%c%s - %s}\n",
+        (long)(intptr_t)x, x->gl_name->s_name, (x->gl_dirty? '*' : ' '), namebuf,
             canvas_getdir(x)->s_name);
 }
 #else



More information about the Gridflow-cvs mailing list