Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6021
Modified Files: Tag: devel_0_39 desire.c desire.h Log Message: .
Index: desire.h =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.h,v retrieving revision 1.1.2.20 retrieving revision 1.1.2.21 diff -C2 -d -r1.1.2.20 -r1.1.2.21 *** desire.h 3 Sep 2006 05:40:39 -0000 1.1.2.20 --- desire.h 3 Sep 2006 06:01:01 -0000 1.1.2.21 *************** *** 109,113 **** unsigned int gl_havewindow:1; /* true if we own a window */ unsigned int gl_mapped:1; /* true if, moreover, it's "mapped" */ - unsigned int gl_dirty:1; /* (root canvas only:) patch has changed */ unsigned int gl_loading:1; /* am now loading from file */ unsigned int gl_willvis:1; /* make me visible after loading */ --- 109,112 ---- *************** *** 117,120 **** --- 116,127 ---- };
+ /* LATER consider adding font size to this struct (see glist_getfont()) */ + 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" */ + }; + /* a data structure to describe a field in a pure datum */ #define DT_FLOAT 0 *************** *** 194,205 **** };
- /* cursor definitions; used as return value for t_parentclickfn */ - #define CURSOR_RUNMODE_CLICKME 1 - #define CURSOR_RUNMODE_THICKEN 2 - #define CURSOR_RUNMODE_ADDPOINT 3 - #define CURSOR_EDITMODE_DISCONNECT 6 extern t_canvas *canvas_list; /* list of all root canvases */ extern t_class *vinlet_class, *voutlet_class, *canvas_class; extern int glist_valid; /* incremented when pointers might be stale */
#define PLOTSTYLE_POINTS 0 /* plotting styles for arrays */ --- 201,209 ---- };
extern t_canvas *canvas_list; /* list of all root canvases */ extern t_class *vinlet_class, *voutlet_class, *canvas_class; extern int glist_valid; /* incremented when pointers might be stale */ + EXTERN int sys_noloadbang; + EXTERN t_symbol *s_empty;
#define PLOTSTYLE_POINTS 0 /* plotting styles for arrays */ *************** *** 211,214 **** --- 215,223 ----
/* from desire.c */ + EXTERN int pd_scanargs(int argc, t_atom *argv, char *fmt, ...); + EXTERN int pd_saveargs(t_binbuf *b, char *fmt, ...); + EXTERN void pd_upload(t_gobj *self); + EXTERN void sys_mgui(void *self, const char *sel, const char *fmt, ...); + EXTERN t_glist *glist_new(void); EXTERN void glist_init(t_glist *x); *************** *** 228,231 **** --- 237,241 ---- EXTERN int canvas_getindex(t_canvas *x, t_gobj *y); EXTERN t_canvasenvironment *canvas_getenv(t_canvas *x); + EXTERN int canvas_getdollarzero(void);
EXTERN void linetraverser_start(t_linetraverser *t, t_canvas *x); *************** *** 236,255 ****
/* -------------------- TO BE SORTED OUT --------------------- */ - EXTERN void canvas_vistext(t_canvas *x, t_text *y); EXTERN void canvas_redrawallfortemplate(t_template *tmpl, int action); EXTERN void canvas_redrawallfortemplatecanvas(t_canvas *x, int action); - EXTERN void canvas_dirty(t_canvas *x, t_int n); - EXTERN int canvas_showtext(t_canvas *x); - EXTERN void canvas_vis(t_canvas *x, t_floatarg f); - EXTERN void canvas_rename(t_canvas *x, t_symbol *s, t_symbol *dir); - EXTERN void canvas_fattenforscalars(t_canvas *x, int *x1, int *y1, int *x2, int *y2); - EXTERN void canvas_visforscalars(t_canvas *x, t_glist *glist, int vis); - EXTERN int canvas_clicksub(t_canvas *x, int xpix, int ypix, int shift, int alt, int dbl, int doit); - EXTERN t_glist *canvas_getglistonsuper(void); - EXTERN t_template *garray_template(t_garray *x); - EXTERN t_garray *graph_array(t_glist *gl, t_symbol *s, t_symbol *tmpl, t_floatarg f, t_floatarg saveit); EXTERN t_array *array_new(t_symbol *templatesym, t_gpointer *parent); EXTERN void array_resize(t_array *x, int n); - EXTERN void array_free(t_array *x); EXTERN t_gstub *gstub_new(t_glist *gl, t_array *a); EXTERN void gstub_cutoff(t_gstub *gs); --- 246,253 ---- *************** *** 259,280 **** EXTERN t_scalar *scalar_new(t_glist *owner, t_symbol *templatesym); EXTERN void word_free(t_word *wp, t_template *tmpl); - EXTERN void scalar_getbasexy(t_scalar *x, float *basex, float *basey); EXTERN void scalar_redraw(t_scalar *x, t_glist *glist); - EXTERN int array_doclick(t_array *array, t_glist *glist, t_scalar *sc, t_array *ap, t_symbol *elemtemplatesym, float linewidth, float xloc, float xinc, float yloc, float scalarvis, t_fielddesc *xfield, t_fielddesc *yfield, t_fielddesc *wfield, int xpix, int ypix, int shift, int alt, int dbl, int doit); ! EXTERN void array_getcoordinate(t_glist *glist, ! char *elem, int xonset, int yonset, int wonset, int indx, float basex, float basey, float xinc, t_fielddesc *xfielddesc, t_fielddesc *yfielddesc, t_fielddesc *wfielddesc, float *xp, float *yp, float *wp); ! EXTERN int array_getfields(t_symbol *elemtemplatesym, ! t_canvas **elemtemplatecanvasp, t_template **elemtemplatep, int *elemsizep, t_fielddesc *xfielddesc, t_fielddesc *yfielddesc, t_fielddesc *wfielddesc, int *xonsetp, int *yonsetp, int *wonsetp); - EXTERN t_template *template_new(t_symbol *sym, int argc, t_atom *argv); EXTERN void template_free(t_template *x); --- 257,273 ---- EXTERN t_scalar *scalar_new(t_glist *owner, t_symbol *templatesym); EXTERN void word_free(t_word *wp, t_template *tmpl); EXTERN void scalar_redraw(t_scalar *x, t_glist *glist); EXTERN int array_doclick(t_array *array, t_glist *glist, t_scalar *sc, t_array *ap, t_symbol *elemtemplatesym, float linewidth, float xloc, float xinc, float yloc, float scalarvis, t_fielddesc *xfield, t_fielddesc *yfield, t_fielddesc *wfield, int xpix, int ypix, int shift, int alt, int dbl, int doit); ! EXTERN void array_getcoordinate(t_glist *glist, char *elem, int xonset, int yonset, int wonset, int indx, float basex, float basey, float xinc, t_fielddesc *xfielddesc, t_fielddesc *yfielddesc, t_fielddesc *wfielddesc, float *xp, float *yp, float *wp); ! EXTERN int array_getfields(t_symbol *elemtemplatesym, t_canvas **elemtemplatecanvasp, t_template **elemtemplatep, int *elemsizep, t_fielddesc *xfielddesc, t_fielddesc *yfielddesc, t_fielddesc *wfielddesc, int *xonsetp, int *yonsetp, int *wonsetp); EXTERN t_template *template_new(t_symbol *sym, int argc, t_atom *argv); EXTERN void template_free(t_template *x); *************** *** 290,294 **** EXTERN t_canvas *template_findcanvas(t_template *tmpl); EXTERN void template_notify(t_template *, t_symbol *s, int argc, t_atom *argv); - EXTERN t_float template_getfloat( t_template *x, t_symbol *fieldname, t_word *wp, int loud); EXTERN void template_setfloat( t_template *x, t_symbol *fieldname, t_word *wp, t_float f, int loud); --- 283,286 ---- *************** *** 299,329 **** EXTERN t_float fielddesc_cvttocoord(t_fielddesc *f, float val); EXTERN float fielddesc_cvtfromcoord(t_fielddesc *f, float coord); ! ! EXTERN t_guiconnect *guiconnect_new(t_pd *who, t_symbol *sym); ! EXTERN void guiconnect_notarget(t_guiconnect *x, double timedelay); ! ! EXTERN t_symbol *iemgui_raute2dollar(t_symbol *s); ! EXTERN t_symbol *iemgui_dollar2raute(t_symbol *s); ! ! #define IS_A_FLOAT(atom,index) ((atom+index)->a_type == A_FLOAT) ! #define IS_A_SYMBOL(atom,index) ((atom+index)->a_type == A_SYMBOL) ! typedef void (*t_iemfunptr)(void *x, t_glist *glist, int mode); ! ! EXTERN int sys_noloadbang; ! EXTERN int canvas_getdollarzero(void); ! EXTERN void canvas_getargs(int *argcp, t_atom **argvp); ! EXTERN int pd_scanargs(int argc, t_atom *argv, char *fmt, ...); ! EXTERN int pd_saveargs(t_binbuf *b, char *fmt, ...); ! EXTERN void pd_upload(t_gobj *self); ! EXTERN void sys_mgui(void *self, const char *sel, const char *fmt, ...); ! EXTERN t_symbol *s_empty; ! EXTERN int convert_color2(int x); ! //EXTERN void binbuf_update(t_iemgui *x, t_symbol *qlass, int argc, t_atom *argv); ! //EXTERN int pd_savehead(t_binbuf *b, t_iemgui *x, char *name); ! EXTERN void iemgui_getrect(t_gobj *z, t_glist *glist, int *xp1, int *yp1, int *xp2, int *yp2);
#if defined(_LANGUAGE_C_PLUS_PLUS) || defined(__cplusplus) } #endif - #endif /* __DESIRE_H */ --- 291,298 ---- EXTERN t_float fielddesc_cvttocoord(t_fielddesc *f, float val); EXTERN float fielddesc_cvtfromcoord(t_fielddesc *f, float coord); ! //EXTERN int pd_pickle(t_foo *foo, char *fmt, ...);
#if defined(_LANGUAGE_C_PLUS_PLUS) || defined(__cplusplus) } #endif #endif /* __DESIRE_H */
Index: desire.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v retrieving revision 1.1.2.145 retrieving revision 1.1.2.146 diff -C2 -d -r1.1.2.145 -r1.1.2.146 *** desire.c 3 Sep 2006 05:40:38 -0000 1.1.2.145 --- desire.c 3 Sep 2006 06:01:00 -0000 1.1.2.146 *************** *** 288,299 **** */
- /* LATER consider adding font size to this struct (see glist_getfont()) */ - 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" */ - }; - #define GLIST_DEFCANVASWIDTH 450 #define GLIST_DEFCANVASHEIGHT 300 --- 288,291 ---- *************** *** 367,376 **** }
- void canvas_getargs(int *argcp, t_atom **argvp) { - t_canvasenvironment *e = canvas_getenv(canvas_getcurrent()); - *argcp = e->ce_argc; - *argvp = e->ce_argv; - } - t_symbol *canvas_realizedollar(t_canvas *x, t_symbol *s) { t_symbol *ret; --- 359,362 ---- *************** *** 406,410 **** }
! void canvas_rename(t_canvas *x, t_symbol *s, t_symbol *dir) { if (strcmp(x->gl_name->s_name, "Pd")) pd_unbind((t_pd *)x, canvas_makebindsym(x->gl_name)); x->gl_name = s; --- 392,396 ---- }
! static void canvas_rename(t_canvas *x, t_symbol *s, t_symbol *dir) { if (strcmp(x->gl_name->s_name, "Pd")) pd_unbind((t_pd *)x, canvas_makebindsym(x->gl_name)); x->gl_name = s; *************** *** 643,654 **** }
- void canvas_dirty(t_canvas *x, t_int n) { - t_canvas *x2 = canvas_getrootfor(x); - if ((unsigned)n != x2->gl_dirty) { - x2->gl_dirty = n; - sys_mgui(x,"modified?=","i",n); - } - } - void canvas_drawredrect(t_canvas *x, int doit) { if (doit) sys_mgui(glist_getcanvas(x),"gop_rectangle","iiii", --- 629,632 ---- *************** *** 657,660 **** --- 635,640 ---- }
+ static void canvas_vis(t_canvas *x, t_floatarg f); + /* the window becomes "mapped" (visible and not miniaturized) or "unmapped" (either miniaturized or just plain gone.) This should be *************** *** 687,690 **** --- 667,672 ---- static void canvas_redraw(t_canvas *x) {if (glist_isvisible(x)) {canvas_map(x,0); canvas_map(x, 1);}}
+ t_guiconnect *guiconnect_new(t_pd *who, t_symbol *sym); + static t_editor *editor_new(t_glist *owner) { char buf[40]; *************** *** 697,700 **** --- 679,684 ---- }
+ static void guiconnect_notarget(t_guiconnect *x, double timedelay); + static void editor_free(t_editor *x, t_glist *y) { guiconnect_notarget(x->e_guiconnect, 1000); *************** *** 724,731 **** }
! /* we call this when we want the window to become visible, mapped, and ! in front of all windows; or with "f" zero, when we want to get rid of ! the window. */ ! void canvas_vis(t_canvas *x, t_floatarg f) { if (!!f) { if (x->gl_editor) { /* already visible, so just raise window */ --- 708,714 ---- }
! /* we call this when we want the window to become visible, mapped, and ! in front of all windows; or with "f" zero, when we want to get rid of the window. */ ! static void canvas_vis(t_canvas *x, t_floatarg f) { if (!!f) { if (x->gl_editor) { /* already visible, so just raise window */ *************** *** 983,986 **** --- 966,971 ---- /* ------------------ table ---------------------------*/
+ static t_garray *graph_array(t_glist *gl, t_symbol *s, t_symbol *tmpl, t_floatarg f, t_floatarg saveit); + static int tabcount = 0;
*************** *** 1024,1028 **** /* return true if the "canvas" object should be treated as a text object. This is true for abstractions but also for "table"s... */ ! int canvas_showtext(t_canvas *x) { t_atom *argv = x->gl_obj.te_binbuf? binbuf_getvec( x->gl_obj.te_binbuf) : 0; int argc = x->gl_obj.te_binbuf? binbuf_getnatom(x->gl_obj.te_binbuf) : 0; --- 1009,1013 ---- /* return true if the "canvas" object should be treated as a text object. This is true for abstractions but also for "table"s... */ ! static int canvas_showtext(t_canvas *x) { t_atom *argv = x->gl_obj.te_binbuf? binbuf_getvec( x->gl_obj.te_binbuf) : 0; int argc = x->gl_obj.te_binbuf? binbuf_getnatom(x->gl_obj.te_binbuf) : 0; *************** *** 1399,1415 **** }
- /* find a dirty sub-glist, if any, of this one (including itself) */ - static t_glist *glist_finddirty(t_glist *x) { - t_gobj *g; - t_glist *g2; - if (x->gl_env && x->gl_dirty) - return x; - for (g = x->gl_list; g; g = g->g_next) - if (pd_class(&g->g_pd) == canvas_class && - (g2 = glist_finddirty((t_glist *)g))) - return g2; - return 0; - } - void canvas_close(t_canvas *x) { if (x->gl_owner) canvas_vis(x, 0); else pd_free((t_pd *)x); --- 1384,1387 ---- *************** *** 1685,1689 **** void word_free(t_word *wp, t_template *template);
! void array_free(t_array *x) { int i; t_template *scalartemplate = template_findbyname(x->a_templatesym); --- 1657,1661 ---- void word_free(t_word *wp, t_template *template);
! static void array_free(t_array *x) { int i; t_template *scalartemplate = template_findbyname(x->a_templatesym); *************** *** 2121,2124 **** --- 2093,2102 ---- }
+ /* cursor definitions; used as return value for t_parentclickfn */ + #define CURSOR_RUNMODE_CLICKME 1 + #define CURSOR_RUNMODE_THICKEN 2 + #define CURSOR_RUNMODE_ADDPOINT 3 + #define CURSOR_EDITMODE_DISCONNECT 6 + /* LATER move this and others back into plot parentwidget code, so they can be static (look in g_canvas.h for candidates). */ *************** *** 2310,2323 **** }
- /* This functiopn gets the template of an array; if we can't figure - out what template an array's elements belong to we're in grave trouble - when it's time to free or resize it. */ - t_template *garray_template(t_garray *x) { - t_array *array = garray_getarray(x); - t_template *template = array ? template_findbyname(array->a_templatesym) : 0; - if (!template) bug("garray_template"); - return template; - } - /* get the length */ int garray_npoints(t_garray *x) {return garray_getarray(x)->a_n;} --- 2288,2291 ---- *************** *** 2692,2695 **** --- 2660,2665 ---- }
+ static void scalar_getbasexy(t_scalar *x, float *basex, float *basey); + static float gobj_getxforsort(t_gobj *g) { if (pd_class(&g->g_pd) == scalar_class) { *************** *** 3176,3180 **** we're ready to delete the object; otherwise we wait either for signoff or for a timeout. */ ! void guiconnect_notarget(t_guiconnect *x, double timedelay) { if (!x->x_sym) pd_free((t_pd *)x); else { --- 3146,3150 ---- we're ready to delete the object; otherwise we wait either for signoff or for a timeout. */ ! static void guiconnect_notarget(t_guiconnect *x, double timedelay) { if (!x->x_sym) pd_free((t_pd *)x); else { *************** *** 3732,3736 **** if (!x->gl_owner) canvas_rename(x, filename, dir); post("saved to: %s/%s", dir->s_name, filename->s_name); - canvas_dirty(x, 0); canvas_reload(filename, dir, (t_gobj *)x); } --- 3702,3705 ---- *************** *** 4360,4365 **** }
! /* -------------------- widget behavior for scalar ------------ */ ! void scalar_getbasexy(t_scalar *x, float *basex, float *basey) { t_template *template = template_findbyname(x->sc_template); *basex = template_getfloat(template, gensym("x"), x->sc_vec, 0); --- 4329,4333 ---- }
! static void scalar_getbasexy(t_scalar *x, float *basex, float *basey) { t_template *template = template_findbyname(x->sc_template); *basex = template_getfloat(template, gensym("x"), x->sc_vec, 0); *************** *** 6860,6864 ****
/*EXTERN*/ void canvas_savecontainerto(t_canvas *x, t_binbuf *b); - //typedef void (*t_iemfunptr)(void *x, t_glist *glist, int mode);
#define IEMGUI_FIELDS \ --- 6828,6831 ---- *************** *** 6940,6949 ****
t_symbol *s_empty; - int convert_color2(int x); - void binbuf_update(t_iemgui *x, t_symbol *qlass, int argc, t_atom *argv);
typedef struct t_foo { int argc; t_atom *argv; t_binbuf *b; } t_foo; ! int pd_pickle(t_foo *foo, char *fmt, ...); ! int pd_savehead(t_binbuf *b, void /*t_iemgui*/ *x, char *name);
#ifdef MSW --- 6907,6914 ----
t_symbol *s_empty;
typedef struct t_foo { int argc; t_atom *argv; t_binbuf *b; } t_foo; ! static int pd_pickle(t_foo *foo, char *fmt, ...); ! static int pd_savehead(t_binbuf *b, void /*t_iemgui*/ *x, char *name);
#ifdef MSW *************** *** 6993,6996 **** --- 6958,6967 ---- }
+ void canvas_getargs(int *argcp, t_atom **argvp) { + t_canvasenvironment *e = canvas_getenv(canvas_getcurrent()); + *argcp = e->ce_argc; + *argvp = e->ce_argv; + } + static void canvas_objtext(t_glist *gl, int xpix, int ypix, int selected, t_binbuf *b) { t_text *x=0; *************** *** 7199,7203 **** return gensym(shmo); } - /* else return iemgui_dollar2raute(s);*/ else return s; } --- 7170,7173 ---- *************** *** 7206,7210 **** static t_symbol *gatom_unescapit(t_symbol *s) { if (*s->s_name == '-') return gensym(s->s_name+1); - /* return iemgui_raute2dollar(s);*/ return s; } --- 7176,7179 ---- *************** *** 7733,7737 **** }
! int pd_savehead(t_binbuf *b, void /*t_text*/ *x_, char *name) { t_text *x = (t_text *)x_; binbuf_addv(b, "ssiis", gensym("#X"),gensym("obj"), --- 7702,7706 ---- }
! static int pd_savehead(t_binbuf *b, void /*t_text*/ *x_, char *name) { t_text *x = (t_text *)x_; binbuf_addv(b, "ssiis", gensym("#X"),gensym("obj"),