Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20594
Modified Files: Tag: impd_0_37 g_readwrite.c g_all_guis.c Log Message: pd_upload() sends only the header of the #N canvas, not all contents!
Index: g_readwrite.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_readwrite.c,v retrieving revision 1.1.1.3.2.1.2.1 retrieving revision 1.1.1.3.2.1.2.2 diff -C2 -d -r1.1.1.3.2.1.2.1 -r1.1.1.3.2.1.2.2 *** g_readwrite.c 2 Apr 2004 00:16:43 -0000 1.1.1.3.2.1.2.1 --- g_readwrite.c 8 Apr 2004 01:59:51 -0000 1.1.1.3.2.1.2.2 *************** *** 549,558 **** /* save to a binbuf, called recursively; cf. canvas_savetofile() which saves the document, and is only called on root canvases. */ ! static void canvas_saveto(t_canvas *x, t_binbuf *b) { ! t_gobj *y; ! t_linetraverser t; ! t_outconnect *oc; ! /* subpatch */ if (x->gl_owner && !x->gl_env) { --- 549,556 ---- /* save to a binbuf, called recursively; cf. canvas_savetofile() which saves the document, and is only called on root canvases. */ ! ! void canvas_savecontainerto(t_canvas *x, t_binbuf *b) { ! /* subpatch */ if (x->gl_owner && !x->gl_env) { *************** *** 565,569 **** x->gl_mapped); } ! /* root or abstraction */ else binbuf_addv(b, "ssiiiii;", gensym("#N"), gensym("canvas"), (t_int)(x->gl_screenx1), --- 563,567 ---- x->gl_mapped); } ! /* root or abstraction */ else binbuf_addv(b, "ssiiiii;", gensym("#N"), gensym("canvas"), (t_int)(x->gl_screenx1), *************** *** 572,576 **** --- 570,582 ---- (t_int)(x->gl_screeny2 - x->gl_screeny1), x->gl_font); + } +
+ static void canvas_saveto(t_canvas *x, t_binbuf *b) + { + t_gobj *y; + t_linetraverser t; + t_outconnect *oc; + canvas_savecontainerto(x,b); for (y = x->gl_list; y; y = y->g_next) gobj_save(y, b);
Index: g_all_guis.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_all_guis.c,v retrieving revision 1.1.1.4.2.4.2.16 retrieving revision 1.1.1.4.2.4.2.17 diff -C2 -d -r1.1.1.4.2.4.2.16 -r1.1.1.4.2.4.2.17 *** g_all_guis.c 7 Apr 2004 03:17:36 -0000 1.1.1.4.2.4.2.16 --- g_all_guis.c 8 Apr 2004 01:59:51 -0000 1.1.1.4.2.4.2.17 *************** *** 86,94 **** int iemgui_modulo_color(int col) { ! while(col >= IEM_GUI_MAX_COLOR) ! col -= IEM_GUI_MAX_COLOR; ! while(col < 0) ! col += IEM_GUI_MAX_COLOR; ! return(col); }
--- 86,92 ---- int iemgui_modulo_color(int col) { ! if (col<0) col+=(1+col/IEM_GUI_MAX_COLOR)*IEM_GUI_MAX_COLOR; ! col %= IEM_GUI_MAX_COLOR; ! return col; }
*************** *** 650,653 **** --- 648,653 ---- }
+ EXTERN void canvas_savecontainerto(t_canvas *x, t_binbuf *b); + void pd_upload(t_gobj *self) { t_binbuf *buf = binbuf_new(); *************** *** 655,659 **** int n; char *s; ! c->c_savefn(self,buf); binbuf_gettext(buf,&s,&n); if (s[n-1]=='\n') n--; --- 655,665 ---- int n; char *s; ! fprintf(stderr,"upload class=%s\n",c->c_name->s_name); ! if (strcmp(c->c_name->s_name,"canvas")!=0) { ! c->c_savefn(self,buf); ! } else { ! /* just the "#N canvas" line, not the contents */ ! canvas_savecontainerto((t_canvas *)c,buf); ! } binbuf_gettext(buf,&s,&n); if (s[n-1]=='\n') n--;