Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1596
Modified Files: Tag: devel_0_39 desire.c Log Message: .
Index: desire.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v retrieving revision 1.1.2.17 retrieving revision 1.1.2.18 diff -C2 -d -r1.1.2.17 -r1.1.2.18 *** desire.c 16 Sep 2005 20:53:50 -0000 1.1.2.17 --- desire.c 17 Sep 2005 21:12:47 -0000 1.1.2.18 *************** *** 11,18 ****
#include "m_pd.h" - //#include "g_canvas.h" #include "desire.h" #include "m_imp.h" - //#include "t_tk.h" #include "s_stuff.h" #include <ctype.h> --- 11,16 ---- *************** *** 22,28 **** #include <stdlib.h> #include <string.h>
! /* ! #define L fprintf(stdout,"%s:%d in %s",__FILE__,__LINE__,__PRETTY_FUNCTION__); #define sys_vgui(args...) do { \ fprintf(stderr,"\e[0;1;31m"); \ --- 20,26 ---- #include <stdlib.h> #include <string.h> + #include "m_simd.h"
! #define L fprintf(stderr,"%s:%d in %s\n",__FILE__,__LINE__,__PRETTY_FUNCTION__); #define sys_vgui(args...) do { \ fprintf(stderr,"\e[0;1;31m"); \ *************** *** 30,34 **** fprintf(stderr,"\e[0m"); \ sys_vgui(args); } while(0) - */
//-------------------------------------------------------------------------- --- 28,31 ---- *************** *** 55,67 **** */
- #include <stdlib.h> - #include <stdio.h> - #include "m_pd.h" - #include "m_imp.h" - #include "s_stuff.h" - #include "g_canvas.h" - #include <string.h> - #include "g_all_guis.h" - /* LATER consider adding font size to this struct (see glist_getfont()) */ struct _canvasenvironment --- 52,55 ---- *************** *** 1483,1620 **** }
- /* ------------------------------- setup routine ------------------------ */ - - void glist_text(t_glist *x, t_symbol *s, int argc, t_atom *argv); - void canvas_obj(t_glist *gl, t_symbol *s, int argc, t_atom *argv); - void canvas_bng(t_glist *gl, t_symbol *s, int argc, t_atom *argv); - void canvas_toggle(t_glist *gl, t_symbol *s, int argc, t_atom *argv); - void canvas_vslider(t_glist *gl, t_symbol *s, int argc, t_atom *argv); - void canvas_hslider(t_glist *gl, t_symbol *s, int argc, t_atom *argv); - void canvas_vdial(t_glist *gl, t_symbol *s, int argc, t_atom *argv); - void canvas_hdial(t_glist *gl, t_symbol *s, int argc, t_atom *argv); - void canvas_hdial(t_glist *gl, t_symbol *s, int argc, t_atom *argv); - void canvas_hradio(t_glist *gl, t_symbol *s, int argc, t_atom *argv); - void canvas_vradio(t_glist *gl, t_symbol *s, int argc, t_atom *argv); - void canvas_vumeter(t_glist *gl, t_symbol *s, int argc, t_atom *argv); - void canvas_mycnv(t_glist *gl, t_symbol *s, int argc, t_atom *argv); - void canvas_numbox(t_glist *gl, t_symbol *s, int argc, t_atom *argv); - void canvas_msg(t_glist *gl, t_symbol *s, int argc, t_atom *argv); - void canvas_floatatom(t_glist *gl, t_symbol *s, int argc, t_atom *argv); - void canvas_symbolatom(t_glist *gl, t_symbol *s, int argc, t_atom *argv); - void glist_scalar(t_glist *canvas, t_symbol *s, t_int argc, t_atom *argv); - - void g_graph_setup(void); - void g_editor_setup(void); - void g_readwrite_setup(void); - void canvas_properties(t_glist *z); - - void g_canvas_setup(void) - { - /* we prevent the user from typing "canvas" in an object box - by sending 0 for a creator function. */ - canvas_class = class_new(gensym("canvas"), 0, - (t_method)canvas_free, sizeof(t_canvas), CLASS_NOINLET, 0); - /* here is the real creator function, invoked in patch files - by sending the "canvas" message to #N, which is bound - to pd_camvasmaker. */ - class_addmethod(pd_canvasmaker, (t_method)canvas_new, gensym("canvas"), - A_GIMME, 0); - class_addmethod(canvas_class, (t_method)canvas_restore, - gensym("restore"), A_GIMME, 0); - class_addmethod(canvas_class, (t_method)canvas_coords, - gensym("coords"), A_GIMME, 0); - - /* -------------------------- objects ----------------------------- */ - class_addmethod(canvas_class, (t_method)canvas_obj, - gensym("obj"), A_GIMME, A_NULL); - class_addmethod(canvas_class, (t_method)canvas_msg, - gensym("msg"), A_GIMME, A_NULL); - class_addmethod(canvas_class, (t_method)canvas_floatatom, - gensym("floatatom"), A_GIMME, A_NULL); - class_addmethod(canvas_class, (t_method)canvas_symbolatom, - gensym("symbolatom"), A_GIMME, A_NULL); - class_addmethod(canvas_class, (t_method)glist_text, - gensym("text"), A_GIMME, A_NULL); - class_addmethod(canvas_class, (t_method)glist_glist, gensym("graph"), - A_GIMME, A_NULL); - class_addmethod(canvas_class, (t_method)glist_scalar, - gensym("scalar"), A_GIMME, A_NULL); - - /* -------------- Thomas Musil's GUI objects ------------ */ - class_addmethod(canvas_class, (t_method)canvas_bng, gensym("bng"), A_GIMME, A_NULL); - class_addmethod(canvas_class, (t_method)canvas_toggle, gensym("toggle"), A_GIMME, A_NULL); - class_addmethod(canvas_class, (t_method)canvas_vslider, gensym("vslider"), A_GIMME, A_NULL); - class_addmethod(canvas_class, (t_method)canvas_hslider, gensym("hslider"), A_GIMME, A_NULL); - class_addmethod(canvas_class, (t_method)canvas_hdial, gensym("hdial"), A_GIMME, A_NULL); - class_addmethod(canvas_class, (t_method)canvas_vdial, gensym("vdial"), A_GIMME, A_NULL); - class_addmethod(canvas_class, (t_method)canvas_hradio, gensym("hradio"), A_GIMME, A_NULL); - class_addmethod(canvas_class, (t_method)canvas_vradio, gensym("vradio"), A_GIMME, A_NULL); - class_addmethod(canvas_class, (t_method)canvas_vumeter, gensym("vumeter"), A_GIMME, A_NULL); - class_addmethod(canvas_class, (t_method)canvas_mycnv, gensym("mycnv"), A_GIMME, A_NULL); - class_addmethod(canvas_class, (t_method)canvas_numbox, gensym("numbox"), A_GIMME, A_NULL); - - /* ------------------------ gui stuff --------------------------- */ - class_addmethod(canvas_class, (t_method)canvas_pop, gensym("pop"), - A_DEFFLOAT, A_NULL); - class_addmethod(canvas_class, (t_method)canvas_loadbang, - gensym("loadbang"), A_NULL); - class_addmethod(canvas_class, (t_method)canvas_relocate, - gensym("relocate"), A_SYMBOL, A_SYMBOL, A_NULL); - class_addmethod(canvas_class, (t_method)canvas_vis, - gensym("vis"), A_FLOAT, A_NULL); - class_addmethod(canvas_class, (t_method)glist_menu_open, - gensym("menu-open"), A_NULL); - class_addmethod(canvas_class, (t_method)canvas_map, - gensym("map"), A_FLOAT, A_NULL); - class_setpropertiesfn(canvas_class, (t_propertiesfn)canvas_properties); - - /* ---------------------- list handling ------------------------ */ - class_addmethod(canvas_class, (t_method)glist_clear, gensym("clear"), - A_NULL); - - /* ----- subcanvases, which you get by typing "pd" in a box ---- */ - class_addcreator((t_newmethod)subcanvas_new, gensym("pd"), A_DEFSYMBOL, 0); - class_addcreator((t_newmethod)subcanvas_new, gensym("page"), A_DEFSYMBOL, 0); - - class_addmethod(canvas_class, (t_method)canvas_click, - gensym("click"), A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0); - class_addmethod(canvas_class, (t_method)canvas_dsp, gensym("dsp"), 0); - class_addmethod(canvas_class, (t_method)canvas_rename_method, - gensym("rename"), A_GIMME, 0); - - /*---------------------------- tables -- GG ------------------- */ - - class_addcreator((t_newmethod)table_new, gensym("table"), - A_DEFSYM, A_DEFFLOAT, 0); - - /* -------------- setups from other files for canvas_class ---------------- */ - g_graph_setup(); - g_editor_setup(); - g_readwrite_setup(); - } - //-------------------------------------------------------------------------- // from g_editor.c
- /* Copyright (c) 1997-2001 Miller Puckette and others. - * For information on usage and redistribution, and for a DISCLAIMER OF ALL - * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ - - #include <stdlib.h> - #include <stdio.h> - #include "m_pd.h" - #include "m_imp.h" - #include "s_stuff.h" - #include "g_canvas.h" - #include <string.h> - - void glist_readfrombinbuf(t_glist *x, t_binbuf *b, char *filename, - int selectem); - - void open_via_helppath(const char *name, const char *dir); - char *class_gethelpdir(t_class *c); - char* inlet_tip(t_inlet* i,int num); - - /* ------------------ forward declarations --------------- */ static void canvas_doclear(t_canvas *x); static void glist_setlastxy(t_glist *gl, int xval, int yval); --- 1471,1477 ---- *************** *** 1630,1667 **** /* ---------------- generic widget behavior ------------------------- */
! void gobj_getrect(t_gobj *x, t_glist *glist, int *x1, int *y1, ! int *x2, int *y2) ! { ! if (x->g_pd->c_wb && x->g_pd->c_wb->w_getrectfn) ! (*x->g_pd->c_wb->w_getrectfn)(x, glist, x1, y1, x2, y2); }
! void gobj_displace(t_gobj *x, t_glist *glist, int dx, int dy) ! { ! if (x->g_pd->c_wb && x->g_pd->c_wb->w_displacefn) ! (*x->g_pd->c_wb->w_displacefn)(x, glist, dx, dy); }
! void gobj_select(t_gobj *x, t_glist *glist, int state) ! { ! if (x->g_pd->c_wb && x->g_pd->c_wb->w_selectfn) ! (*x->g_pd->c_wb->w_selectfn)(x, glist, state); }
! void gobj_activate(t_gobj *x, t_glist *glist, int state) ! { ! if (x->g_pd->c_wb && x->g_pd->c_wb->w_activatefn) ! (*x->g_pd->c_wb->w_activatefn)(x, glist, state); }
! void gobj_delete(t_gobj *x, t_glist *glist) ! { ! if (x->g_pd->c_wb && x->g_pd->c_wb->w_deletefn) ! (*x->g_pd->c_wb->w_deletefn)(x, glist); }
void gobj_vis(t_gobj *x, struct _glist *glist, int flag) { ! if (x->g_pd->c_wb && x->g_pd->c_wb->w_visfn) { if (!glist->gl_havewindow && glist->gl_isgraph && glist->gl_goprect && --- 1487,1519 ---- /* ---------------- generic widget behavior ------------------------- */
! void gobj_getrect(t_gobj *x, t_glist *glist, int *x1, int *y1, int *x2, int *y2) { ! t_widgetbehavior *w = x->g_pd->c_wb; ! if (w && w->w_getrectfn) (*w->w_getrectfn)(x, glist, x1, y1, x2, y2); }
! void gobj_displace(t_gobj *x, t_glist *glist, int dx, int dy) { ! t_widgetbehavior *w = x->g_pd->c_wb; ! if (w && w->w_displacefn) (*w->w_displacefn)(x, glist, dx, dy); }
! void gobj_select(t_gobj *x, t_glist *glist, int state) { ! t_widgetbehavior *w = x->g_pd->c_wb; ! if (w && w->w_selectfn) (*w->w_selectfn)(x, glist, state); }
! void gobj_activate(t_gobj *x, t_glist *glist, int state) { ! t_widgetbehavior *w = x->g_pd->c_wb; ! if (w && w->w_activatefn) (*w->w_activatefn)(x, glist, state); }
! void gobj_delete(t_gobj *x, t_glist *glist) { ! t_widgetbehavior *w = x->g_pd->c_wb; ! if (w && w->w_deletefn) (*w->w_deletefn)(x, glist); }
void gobj_vis(t_gobj *x, struct _glist *glist, int flag) { ! t_widgetbehavior *w = x->g_pd->c_wb; ! if (w && w->w_visfn) { if (!glist->gl_havewindow && glist->gl_isgraph && glist->gl_goprect && *************** *** 1672,1679 **** int x1, y1, x2, y2, gx1, gy1, gx2, gy2, m; gobj_getrect(&glist->gl_gobj, glist->gl_owner, &x1, &y1, &x2, &y2); ! if (x1 > x2) ! m = x1, x1 = x2, x2 = m; ! if (y1 > y2) ! m = y1, y1 = y2, x2 = m; gobj_getrect(x, glist, &gx1, &gy1, &gx2, &gy2); if (gx1 < x1 || gx1 > x2 || gx2 < x1 || gx2 > x2 || --- 1524,1529 ---- int x1, y1, x2, y2, gx1, gy1, gx2, gy2, m; gobj_getrect(&glist->gl_gobj, glist->gl_owner, &x1, &y1, &x2, &y2); ! if (x1 > x2) m = x1, x1 = x2, x2 = m; ! if (y1 > y2) m = y1, y1 = y2, x2 = m; gobj_getrect(x, glist, &gx1, &gy1, &gx2, &gy2); if (gx1 < x1 || gx1 > x2 || gx2 < x1 || gx2 > x2 || *************** *** 1681,1685 **** return; } ! (*x->g_pd->c_wb->w_visfn)(x, glist, flag); } } --- 1531,1535 ---- return; } ! (*w->w_visfn)(x, glist, flag); } } *************** *** 1688,1695 **** int xpix, int ypix, int shift, int alt, int dbl, int doit) { ! if (x->g_pd->c_wb && x->g_pd->c_wb->w_clickfn) ! return ((*x->g_pd->c_wb->w_clickfn)(x, ! glist, xpix, ypix, shift, alt, dbl, doit)); ! else return (0); }
--- 1538,1545 ---- int xpix, int ypix, int shift, int alt, int dbl, int doit) { ! t_widgetbehavior *w = x->g_pd->c_wb; ! if (w && w->w_clickfn) ! return ((*w->w_clickfn)(x, glist, xpix, ypix, shift, alt, dbl, doit)); ! else return 0; }
*************** *** 4070,4164 ****
- void g_editor_setup(void) - { - /* ------------------------ events ---------------------------------- */ - class_addmethod(canvas_class, (t_method)canvas_mousedown, gensym("mouse"), - A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_NULL); - class_addmethod(canvas_class, (t_method)canvas_mouseup, gensym("mouseup"), - A_FLOAT, A_FLOAT, A_FLOAT, A_NULL); - class_addmethod(canvas_class, (t_method)canvas_key, gensym("key"), - A_GIMME, A_NULL); - class_addmethod(canvas_class, (t_method)canvas_motion, gensym("motion"), - A_FLOAT, A_FLOAT, A_FLOAT, A_NULL); - - /* ------------------------ menu actions ---------------------------- */ - class_addmethod(canvas_class, (t_method)canvas_menuclose, - gensym("menuclose"), A_DEFFLOAT, 0); - class_addmethod(canvas_class, (t_method)canvas_cut, - gensym("cut"), A_NULL); - class_addmethod(canvas_class, (t_method)canvas_copy, - gensym("copy"), A_NULL); - class_addmethod(canvas_class, (t_method)canvas_paste, - gensym("paste"), A_NULL); - class_addmethod(canvas_class, (t_method)canvas_duplicate, - gensym("duplicate"), A_NULL); - class_addmethod(canvas_class, (t_method)canvas_selectall, - gensym("selectall"), A_NULL); - class_addmethod(canvas_class, (t_method)canvas_undo, - gensym("undo"), A_NULL); - class_addmethod(canvas_class, (t_method)canvas_redo, - gensym("redo"), A_NULL); - class_addmethod(canvas_class, (t_method)canvas_tidy, - gensym("tidy"), A_NULL); - class_addmethod(canvas_class, (t_method)canvas_texteditor, - gensym("texteditor"), A_NULL); - class_addmethod(canvas_class, (t_method)canvas_editmode, - gensym("editmode"), A_DEFFLOAT, A_NULL); - class_addmethod(canvas_class, (t_method)canvas_print, - gensym("print"), A_SYMBOL, A_NULL); - class_addmethod(canvas_class, (t_method)canvas_menufont, - gensym("menufont"), A_NULL); - class_addmethod(canvas_class, (t_method)canvas_font, - gensym("font"), A_FLOAT, A_FLOAT, A_FLOAT, A_NULL); - class_addmethod(canvas_class, (t_method)canvas_find, - gensym("find"), A_GIMME, A_NULL); - class_addmethod(canvas_class, (t_method)canvas_find_again, - gensym("findagain"), A_NULL); - class_addmethod(canvas_class, (t_method)canvas_find_parent, - gensym("findparent"), A_NULL); - class_addmethod(canvas_class, (t_method)canvas_done_popup, - gensym("done-popup"), A_FLOAT, A_FLOAT, A_FLOAT, A_NULL); - class_addmethod(canvas_class, (t_method)canvas_donecanvasdialog, - gensym("donecanvasdialog"), A_GIMME, A_NULL); - class_addmethod(canvas_class, (t_method)glist_arraydialog, - gensym("arraydialog"), A_SYMBOL, A_FLOAT, A_FLOAT, A_FLOAT, A_NULL); - - /* -------------- connect method used in reading files ------------------ */ - class_addmethod(canvas_class, (t_method)canvas_connect, - gensym("connect"), A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_NULL); - - class_addmethod(canvas_class, (t_method)canvas_disconnect, - gensym("disconnect"), A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_NULL); - /* -------------- copy buffer ------------------ */ - copy_binbuf = binbuf_new(); - } -
//-------------------------------------------------------------------------- // from g_array.c
- /* Copyright (c) 1997-1999 Miller Puckette. - * For information on usage and redistribution, and for a DISCLAIMER OF ALL - * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ - - #include <stdlib.h> - #include <string.h> - #include <stdio.h> /* for read/write to files */ - #include "m_pd.h" - #include "g_canvas.h" - #include <math.h> - - /* jsarlo { */ #define ARRAYPAGESIZE 1000 /* this should match the page size in u_main.tk */ - /* } jsarlo */ - - /* see also the "plot" object in g_scalar.c which deals with graphing - arrays which are fields in scalars. Someday we should unify the - two, but how? */ - /* aux routine to bash leading '#' to '$' for dialogs in u_main.tk which can't send symbols starting with '$' (because the Pd message interpreter would change them!) */ - static t_symbol *sharptodollar(t_symbol *s) { --- 3920,3931 ---- *************** *** 4201,4208 **** }
- /* jsarlo { */ void garray_arrayviewlist_close(t_garray *x); - /* } jsarlo */ - void array_resize(t_array *x, int n) { --- 3968,3972 ---- *************** *** 5649,5670 **** // from g_graph.c
- /* Copyright (c) 1997-2001 Miller Puckette and others. - * For information on usage and redistribution, and for a DISCLAIMER OF ALL - * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ - - /* This file deals with the behavior of glists as either "text objects" or - "graphs" inside another glist. LATER move the inlet/outlet code of g_canvas.c - to this file... */ - - #include <stdlib.h> - #include "m_pd.h" - #include "t_tk.h" - #include "g_canvas.h" - #include "s_stuff.h" /* for sys_hostfontsize */ - #include <stdio.h> - #include <string.h> - - /* ---------------------- forward definitions ----------------- */ - static void graph_vis(t_gobj *gr, t_glist *unused_glist, int vis); static void graph_graphrect(t_gobj *z, t_glist *glist, --- 5413,5416 ---- *************** *** 5673,5678 **** int *xp1, int *yp1, int *xp2, int *yp2);
- /* -------------------- maintaining the list -------------------- */ - void canvas_drawredrect(t_canvas *x, int doit);
--- 5419,5422 ---- *************** *** 6738,6778 **** extern void canvas_menuarray(t_glist *canvas);
- void g_graph_setup(void) - { - class_setwidget(canvas_class, &graph_widgetbehavior); - class_addmethod(canvas_class, (t_method)graph_bounds, gensym("bounds"), - A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0); - class_addmethod(canvas_class, (t_method)graph_xticks, gensym("xticks"), - A_FLOAT, A_FLOAT, A_FLOAT, 0); - class_addmethod(canvas_class, (t_method)graph_xlabel, gensym("xlabel"), - A_GIMME, 0); - class_addmethod(canvas_class, (t_method)graph_yticks, gensym("yticks"), - A_FLOAT, A_FLOAT, A_FLOAT, 0); - class_addmethod(canvas_class, (t_method)graph_ylabel, gensym("ylabel"), - A_GIMME, 0); - class_addmethod(canvas_class, (t_method)graph_array, gensym("array"), - A_SYMBOL, A_FLOAT, A_SYMBOL, A_DEFFLOAT, A_NULL); - class_addmethod(canvas_class, (t_method)canvas_menuarray, - gensym("menuarray"), A_NULL); - class_addmethod(canvas_class, (t_method)glist_arraydialog, - gensym("arraydialog"), A_SYMBOL, A_FLOAT, A_FLOAT, A_FLOAT, A_NULL); - class_addmethod(canvas_class, (t_method)glist_sort, - gensym("sort"), A_NULL); - } - //-------------------------------------------------------------------------- // from g_guiconnect.c
- /* Copyright (c) 1997-2000 Miller Puckette. - * For information on usage and redistribution, and for a DISCLAIMER OF ALL - * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ - /* a thing to forward messages from the GUI, dealing with race conditions in which the "target" gets deleted while the GUI is sending it something. */
- #include "m_pd.h" - #include "g_canvas.h" - struct _guiconnect { --- 6482,6492 ---- *************** *** 6862,6869 **** // from g_readwrite.c
- /* Copyright (c) 1997-2002 Miller Puckette and others. - * For information on usage and redistribution, and for a DISCLAIMER OF ALL - * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ - /* this file reads and writes the "data" portions of a canvas to a file. See also canvas_saveto(), etc., in g_editor.c. The data portion is a --- 6576,6579 ---- *************** *** 6872,6882 **** */
! #include <stdlib.h> ! #include <stdio.h> ! #include "m_pd.h" ! #include "g_canvas.h" ! #include <string.h> ! ! /* the following routines read "scalars" from a file into a canvas. */
static int canvas_scanbinbuf(int natoms, t_atom *vec, int *p_indexout, --- 6582,6586 ---- */
! /* the following routines read "scalars" from a file into a canvas. */
static int canvas_scanbinbuf(int natoms, t_atom *vec, int *p_indexout, *************** *** 7585,7613 ****
- void g_readwrite_setup(void) - { - class_addmethod(canvas_class, (t_method)glist_write, - gensym("write"), A_SYMBOL, A_DEFSYM, A_NULL); - class_addmethod(canvas_class, (t_method)glist_read, - gensym("read"), A_SYMBOL, A_DEFSYM, A_NULL); - class_addmethod(canvas_class, (t_method)glist_mergefile, - gensym("mergefile"), A_SYMBOL, A_DEFSYM, A_NULL); - class_addmethod(canvas_class, (t_method)canvas_savetofile, - gensym("savetofile"), A_SYMBOL, A_SYMBOL, 0); - class_addmethod(canvas_class, (t_method)canvas_saveto, - gensym("saveto"), A_CANT, 0); - /* ------------------ from the menu ------------------------- */ - class_addmethod(canvas_class, (t_method)canvas_menusave, - gensym("menusave"), 0); - class_addmethod(canvas_class, (t_method)canvas_menusaveas, - gensym("menusaveas"), 0); - } /////////////////////////////////////////////////////////////////////////// // from g_io.c
- /* Copyright (c) 1997-1999 Miller Puckette. - * For information on usage and redistribution, and for a DISCLAIMER OF ALL - * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ - /* graphical inlets and outlets, both for control and signals. */
--- 7289,7295 ---- *************** *** 7630,7637 **** */
- #include "m_pd.h" - #include "m_simd.h" - #include "g_canvas.h" - #include <string.h> void signal_setborrowed(t_signal *sig, t_signal *sig2); void signal_makereusable(t_signal *sig); --- 7312,7315 ---- *************** *** 7671,7702 ****
static void vinlet_bang(t_vinlet *x) ! { ! outlet_bang(x->x_obj.ob_outlet); ! } ! static void vinlet_pointer(t_vinlet *x, t_gpointer *gp) ! { ! outlet_pointer(x->x_obj.ob_outlet, gp); ! } ! static void vinlet_float(t_vinlet *x, t_float f) ! { ! outlet_float(x->x_obj.ob_outlet, f); ! } ! static void vinlet_symbol(t_vinlet *x, t_symbol *s) ! { ! outlet_symbol(x->x_obj.ob_outlet, s); ! } ! static void vinlet_list(t_vinlet *x, t_symbol *s, int argc, t_atom *argv) ! { ! outlet_list(x->x_obj.ob_outlet, s, argc, argv); ! } ! static void vinlet_anything(t_vinlet *x, t_symbol *s, int argc, t_atom *argv) ! { ! outlet_anything(x->x_obj.ob_outlet, s, argc, argv); ! }
static void vinlet_free(t_vinlet *x) --- 7349,7363 ----
static void vinlet_bang(t_vinlet *x) ! {outlet_bang(x->x_obj.ob_outlet);} static void vinlet_pointer(t_vinlet *x, t_gpointer *gp) ! {outlet_pointer(x->x_obj.ob_outlet, gp);} static void vinlet_float(t_vinlet *x, t_float f) ! {outlet_float(x->x_obj.ob_outlet, f);} static void vinlet_symbol(t_vinlet *x, t_symbol *s) ! {outlet_symbol(x->x_obj.ob_outlet, s);} static void vinlet_list(t_vinlet *x, t_symbol *s, int argc, t_atom *argv) ! {outlet_list(x->x_obj.ob_outlet, s, argc, argv);} static void vinlet_anything(t_vinlet *x, t_symbol *s, int argc, t_atom *argv) ! {outlet_anything(x->x_obj.ob_outlet, s, argc, argv);}
static void vinlet_free(t_vinlet *x) *************** *** 7983,8014 ****
static void voutlet_bang(t_voutlet *x) ! { ! outlet_bang(x->x_parentoutlet); ! } ! static void voutlet_pointer(t_voutlet *x, t_gpointer *gp) ! { ! outlet_pointer(x->x_parentoutlet, gp); ! } ! static void voutlet_float(t_voutlet *x, t_float f) ! { ! outlet_float(x->x_parentoutlet, f); ! } ! static void voutlet_symbol(t_voutlet *x, t_symbol *s) ! { ! outlet_symbol(x->x_parentoutlet, s); ! } ! static void voutlet_list(t_voutlet *x, t_symbol *s, int argc, t_atom *argv) ! { ! outlet_list(x->x_parentoutlet, s, argc, argv); ! } ! static void voutlet_anything(t_voutlet *x, t_symbol *s, int argc, t_atom *argv) ! { ! outlet_anything(x->x_parentoutlet, s, argc, argv); ! }
static void voutlet_free(t_voutlet *x) --- 7644,7658 ----
static void voutlet_bang(t_voutlet *x) ! {outlet_bang(x->x_parentoutlet);} static void voutlet_pointer(t_voutlet *x, t_gpointer *gp) ! {outlet_pointer(x->x_parentoutlet, gp);} static void voutlet_float(t_voutlet *x, t_float f) ! {outlet_float(x->x_parentoutlet, f);} static void voutlet_symbol(t_voutlet *x, t_symbol *s) ! {outlet_symbol(x->x_parentoutlet, s);} static void voutlet_list(t_voutlet *x, t_symbol *s, int argc, t_atom *argv) ! {outlet_list(x->x_parentoutlet, s, argc, argv);} static void voutlet_anything(t_voutlet *x, t_symbol *s, int argc, t_atom *argv) ! {outlet_anything(x->x_parentoutlet, s, argc, argv);}
static void voutlet_free(t_voutlet *x) *************** *** 8275,8282 **** // from g_scalar.c
- /* Copyright (c) 1997-1999 Miller Puckette. - * For information on usage and redistribution, and for a DISCLAIMER OF ALL - * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ - /* This file defines the "scalar" object, which is not a text object, just a "gobj". Scalars have templates which describe their structures, which --- 7919,7922 ---- *************** *** 8293,8302 **** */
- #include <stdlib.h> - #include <string.h> - #include <stdio.h> /* for read/write to files */ - #include "m_pd.h" - #include "g_canvas.h" - t_class *scalar_class;
--- 7933,7936 ---- *************** *** 8709,8724 **** // from g_template.c
- /* Copyright (c) 1997-1999 Miller Puckette. - * For information on usage and redistribution, and for a DISCLAIMER OF ALL - * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ - - #include <stdlib.h> - #include <string.h> - #include <stdio.h> - - #include "m_pd.h" - #include "s_stuff.h" /* for sys_hostfontsize */ - #include "g_canvas.h" - void array_redraw(t_array *a, t_glist *glist);
--- 8343,8346 ---- *************** *** 10904,10914 **** // from g_traversal.c
- /* Copyright (c) 1997-1999 Miller Puckette. - * For information on usage and redistribution, and for a DISCLAIMER OF ALL - * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ - /* This file defines Text objects which traverse data contained in scalars and arrays: - pointer - point to an object belonging to a template get - get numeric fields --- 10526,10531 ---- *************** *** 10919,10931 **** append - add an element to a list sublist - get a pointer into a list which is an element of another scalar - */
- #include <stdlib.h> - #include <string.h> - #include <stdio.h> /* for read/write to files */ - #include "m_pd.h" - #include "g_canvas.h" - /* ------------- gstubs and gpointers - safe pointing --------------- */
--- 10536,10541 ---- *************** *** 14076,14077 **** --- 13686,13784 ---- }
+ //----------- + // blah + + void g_canvas_setup(void) + { + /* we prevent the user from typing "canvas" in an object box + by sending 0 for a creator function. */ + t_class *c = canvas_class = class_new(gensym("canvas"), 0, + (t_method)canvas_free, sizeof(t_canvas), CLASS_NOINLET, 0); + /* here is the real creator function, invoked in patch files + by sending the "canvas" message to #N, which is bound + to pd_camvasmaker. */ + class_addmethod(pd_canvasmaker, (t_method)canvas_new, gensym("canvas"), A_GIMME, 0); + class_addmethod(c, (t_method)canvas_restore, gensym("restore"), A_GIMME, 0); + class_addmethod(c, (t_method)canvas_coords, gensym("coords"), A_GIMME, 0); + class_addmethod(c, (t_method)canvas_obj, gensym("obj"), A_GIMME, A_NULL); + class_addmethod(c, (t_method)canvas_msg, gensym("msg"), A_GIMME, A_NULL); + class_addmethod(c, (t_method)canvas_floatatom, gensym("floatatom"), A_GIMME, A_NULL); + class_addmethod(c, (t_method)canvas_symbolatom, gensym("symbolatom"), A_GIMME, A_NULL); + class_addmethod(c, (t_method)glist_text, gensym("text"), A_GIMME, A_NULL); + class_addmethod(c, (t_method)glist_glist, gensym("graph"), A_GIMME, A_NULL); + class_addmethod(c, (t_method)glist_scalar, gensym("scalar"), A_GIMME, A_NULL); + class_addmethod(c, (t_method)canvas_bng, gensym("bng"), A_GIMME, A_NULL); + class_addmethod(c, (t_method)canvas_toggle, gensym("toggle"), A_GIMME, A_NULL); + class_addmethod(c, (t_method)canvas_vslider, gensym("vslider"), A_GIMME, A_NULL); + class_addmethod(c, (t_method)canvas_hslider, gensym("hslider"), A_GIMME, A_NULL); + class_addmethod(c, (t_method)canvas_hdial, gensym("hdial"), A_GIMME, A_NULL); + class_addmethod(c, (t_method)canvas_vdial, gensym("vdial"), A_GIMME, A_NULL); + class_addmethod(c, (t_method)canvas_hradio, gensym("hradio"), A_GIMME, A_NULL); + class_addmethod(c, (t_method)canvas_vradio, gensym("vradio"), A_GIMME, A_NULL); + class_addmethod(c, (t_method)canvas_vumeter, gensym("vumeter"), A_GIMME, A_NULL); + class_addmethod(c, (t_method)canvas_mycnv, gensym("mycnv"), A_GIMME, A_NULL); + class_addmethod(c, (t_method)canvas_numbox, gensym("numbox"), A_GIMME, A_NULL); + + class_addmethod(c, (t_method)canvas_pop, gensym("pop"), A_DEFFLOAT, A_NULL); + class_addmethod(c, (t_method)canvas_loadbang, gensym("loadbang"), A_NULL); + class_addmethod(c, (t_method)canvas_relocate, gensym("relocate"), A_SYMBOL, A_SYMBOL, A_NULL); + class_addmethod(c, (t_method)canvas_vis, gensym("vis"), A_FLOAT, A_NULL); + class_addmethod(c, (t_method)glist_menu_open, gensym("menu-open"), A_NULL); + class_addmethod(c, (t_method)canvas_map, gensym("map"), A_FLOAT, A_NULL); + class_setpropertiesfn(c, (t_propertiesfn)canvas_properties); + + class_addmethod(c, (t_method)glist_clear, gensym("clear"), A_NULL); + class_addcreator((t_newmethod)subcanvas_new, gensym("pd"), A_DEFSYMBOL, 0); + class_addcreator((t_newmethod)subcanvas_new, gensym("page"), A_DEFSYMBOL, 0); + // class_addmethod(c, (t_method)canvas_click, gensym("click"), A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0); + class_addmethod(c, (t_method)canvas_dsp, gensym("dsp"), 0); + class_addmethod(c, (t_method)canvas_rename_method, gensym("rename"), A_GIMME, 0); + class_addcreator((t_newmethod)table_new, gensym("table"), A_DEFSYM, A_DEFFLOAT, 0); + + class_addmethod(c, (t_method)canvas_mousedown, gensym("mouse"), A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_NULL); + class_addmethod(c, (t_method)canvas_mouseup, gensym("mouseup"), A_FLOAT, A_FLOAT, A_FLOAT, A_NULL); + class_addmethod(c, (t_method)canvas_key, gensym("key"), A_GIMME, A_NULL); + class_addmethod(c, (t_method)canvas_motion, gensym("motion"), A_FLOAT, A_FLOAT, A_FLOAT, A_NULL); + class_addmethod(c, (t_method)canvas_menuclose, gensym("menuclose"), A_DEFFLOAT, 0); + class_addmethod(c, (t_method)canvas_cut, gensym("cut"), A_NULL); + class_addmethod(c, (t_method)canvas_copy, gensym("copy"), A_NULL); + class_addmethod(c, (t_method)canvas_paste, gensym("paste"), A_NULL); + class_addmethod(c, (t_method)canvas_duplicate, gensym("duplicate"), A_NULL); + class_addmethod(c, (t_method)canvas_selectall, gensym("selectall"), A_NULL); + class_addmethod(c, (t_method)canvas_undo, gensym("undo"), A_NULL); + class_addmethod(c, (t_method)canvas_redo, gensym("redo"), A_NULL); + class_addmethod(c, (t_method)canvas_tidy, gensym("tidy"), A_NULL); + class_addmethod(c, (t_method)canvas_texteditor,gensym("texteditor"), A_NULL); + class_addmethod(c, (t_method)canvas_editmode, gensym("editmode"), A_DEFFLOAT, A_NULL); + class_addmethod(c, (t_method)canvas_print, gensym("print"), A_SYMBOL, A_NULL); + class_addmethod(c, (t_method)canvas_menufont, gensym("menufont"), A_NULL); + class_addmethod(c, (t_method)canvas_font, gensym("font"), A_FLOAT, A_FLOAT, A_FLOAT, A_NULL); + class_addmethod(c, (t_method)canvas_find, gensym("find"), A_GIMME, A_NULL); + class_addmethod(c, (t_method)canvas_find_again, gensym("findagain"), A_NULL); + class_addmethod(c, (t_method)canvas_find_parent, gensym("findparent"), A_NULL); + class_addmethod(c, (t_method)canvas_done_popup, gensym("done-popup"), A_FLOAT, A_FLOAT, A_FLOAT, A_NULL); + class_addmethod(c, (t_method)canvas_donecanvasdialog, gensym("donecanvasdialog"), A_GIMME, A_NULL); + class_addmethod(c, (t_method)glist_arraydialog, gensym("arraydialog"), A_SYMBOL, A_FLOAT, A_FLOAT, A_FLOAT, A_NULL); + class_addmethod(c, (t_method)canvas_connect, gensym("connect"), A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_NULL); + class_addmethod(c, (t_method)canvas_disconnect, gensym("disconnect"), A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_NULL); + copy_binbuf = binbuf_new(); + + class_addmethod(c, (t_method)glist_write, gensym("write"), A_SYMBOL, A_DEFSYM, A_NULL); + class_addmethod(c, (t_method)glist_read, gensym("read"), A_SYMBOL, A_DEFSYM, A_NULL); + class_addmethod(c, (t_method)glist_mergefile, gensym("mergefile"), A_SYMBOL, A_DEFSYM, A_NULL); + class_addmethod(c, (t_method)canvas_savetofile, gensym("savetofile"), A_SYMBOL, A_SYMBOL, 0); + class_addmethod(c, (t_method)canvas_saveto, gensym("saveto"), A_CANT, 0); + class_addmethod(c, (t_method)canvas_menusave, gensym("menusave"), 0); + class_addmethod(c, (t_method)canvas_menusaveas, gensym("menusaveas"), 0); + + class_setwidget(c, &graph_widgetbehavior); + class_addmethod(c, (t_method)graph_bounds, gensym("bounds"), A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0); + class_addmethod(c, (t_method)graph_xticks, gensym("xticks"), A_FLOAT, A_FLOAT, A_FLOAT, 0); + class_addmethod(c, (t_method)graph_xlabel, gensym("xlabel"), A_GIMME, 0); + class_addmethod(c, (t_method)graph_yticks, gensym("yticks"), A_FLOAT, A_FLOAT, A_FLOAT, 0); + class_addmethod(c, (t_method)graph_ylabel, gensym("ylabel"), A_GIMME, 0); + class_addmethod(c, (t_method)graph_array, gensym("array"), A_SYMBOL, A_FLOAT, A_SYMBOL, A_DEFFLOAT, A_NULL); + class_addmethod(c, (t_method)canvas_menuarray, gensym("menuarray"), A_NULL); + class_addmethod(c, (t_method)glist_arraydialog, gensym("arraydialog"), A_SYMBOL, A_FLOAT, A_FLOAT, A_FLOAT, A_NULL); + class_addmethod(c, (t_method)glist_sort, gensym("sort"), A_NULL); + }