Update of /cvsroot/pure-data/externals/ggee/gui In directory sc8-pr-cvs1:/tmp/cvs-serv18160
Modified Files: button.c envgen.c fatom.h gcanvas.c image.c slider.c sliderh.c ticker.c w_envgen.h Log Message: setsavefn fixes for 0.37
Index: button.c =================================================================== RCS file: /cvsroot/pure-data/externals/ggee/gui/button.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** button.c 15 Sep 2003 17:23:25 -0000 1.11 --- button.c 27 Oct 2003 18:23:10 -0000 1.12 *************** *** 11,19 **** #endif
! #if PD_VERSION_MINOR < 37 #define t_rtext t_text #endif
#define IOWIDTH 4
typedef struct _button --- 11,21 ---- #endif
! #if PD_MINOR_VERSION < 37 #define t_rtext t_text #endif
+ #ifndef IOWIDTH #define IOWIDTH 4 + #endif
typedef struct _button *************** *** 265,271 **** --- 267,277 ---- w_deletefn: button_delete, w_visfn: button_vis, + #if PD_MINOR_VERSION < 37 w_savefn: button_save, + #endif w_clickfn: NULL, + #if PD_MINOR_VERSION < 37 w_propertiesfn: NULL, + #endif };
*************** *** 312,316 ****
- static void *button_new(t_symbol* text) { --- 318,321 ---- *************** *** 343,347 ****
void button_setup(void) { - post("button setup"); button_class = class_new(gensym("button"), (t_newmethod)button_new, 0, sizeof(t_button),0,A_DEFSYM,0); --- 348,351 ---- *************** *** 351,355 ****
class_setwidget(button_class,&button_widgetbehavior); ! }
--- 355,361 ----
class_setwidget(button_class,&button_widgetbehavior); ! #if PD_MINOR_VERSION >= 37 ! class_setsavefn(button_class,&button_save); ! #endif }
Index: envgen.c =================================================================== RCS file: /cvsroot/pure-data/externals/ggee/gui/envgen.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** envgen.c 16 Sep 2003 09:06:37 -0000 1.6 --- envgen.c 27 Oct 2003 18:23:10 -0000 1.7 *************** *** 297,300 **** --- 297,314 ---- void envgen_key(t_envgen *x, t_floatarg f);
+ t_widgetbehavior envgen_widgetbehavior = { + w_getrectfn: envgen_getrect, + w_displacefn: envgen_displace, + w_selectfn: envgen_select, + w_activatefn: envgen_activate, + w_deletefn: envgen_delete, + w_visfn: envgen_vis, + w_clickfn: envgen_newclick, + #if PD_MINOR_VERSION < 37 + w_propertiesfn: NULL, + w_savefn: envgen_save + #endif + }; +
void envgen_setup(void) *************** *** 321,326 **** class_addmethod(envgen_class,(t_method)envgen_setresize,gensym("resize"),A_FLOAT,A_NULL);
- envgen_setwidget(); class_setwidget(envgen_class,&envgen_widgetbehavior); class_addmethod(envgen_class,(t_method)envgen_dump,gensym("dump"),A_NULL); } --- 335,342 ---- class_addmethod(envgen_class,(t_method)envgen_setresize,gensym("resize"),A_FLOAT,A_NULL);
class_setwidget(envgen_class,&envgen_widgetbehavior); + #if PD_MINOR_VERSION >= 37 + class_setsavefn(envgen_class,&envgen_save); + #endif class_addmethod(envgen_class,(t_method)envgen_dump,gensym("dump"),A_NULL); }
Index: fatom.h =================================================================== RCS file: /cvsroot/pure-data/externals/ggee/gui/fatom.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** fatom.h 15 Sep 2003 17:23:25 -0000 1.9 --- fatom.h 27 Oct 2003 18:23:10 -0000 1.10 *************** *** 4,7 **** --- 4,9 ---- #define DEBUG(x)
+ #include <string.h> + #include <stdio.h>
typedef struct _fatom *************** *** 318,324 **** w_deletefn: fatom_delete, w_visfn: fatom_vis, w_savefn: fatom_save, - w_clickfn: NULL, w_propertiesfn: NULL, };
--- 320,328 ---- w_deletefn: fatom_delete, w_visfn: fatom_vis, + #if PD_MINOR_VERSION < 37 w_savefn: fatom_save, w_propertiesfn: NULL, + #endif + w_clickfn: NULL, };
*************** *** 364,367 **** --- 368,376 ----
+ static void fatom_properties(t_gobj *z, t_glist *owner) + { + post("N/I"); + } +
static void fatom_save(t_gobj *z, t_binbuf *b) *************** *** 429,432 **** */ class_setwidget(class,&fatom_widgetbehavior); ! } --- 438,443 ---- */ class_setwidget(class,&fatom_widgetbehavior); ! #if PD_MINOR_VERSION >= 37 ! class_setsavefn(class,&fatom_save); ! #endif }
Index: gcanvas.c =================================================================== RCS file: /cvsroot/pure-data/externals/ggee/gui/gcanvas.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gcanvas.c 15 Sep 2003 16:54:29 -0000 1.2 --- gcanvas.c 27 Oct 2003 18:23:10 -0000 1.3 *************** *** 1,3 **** ! /* (C) Guenter Geiger geiger@epy.co.at */
--- 1,3 ---- ! /* (C) Guenter Geiger geiger@xdv.org */
*************** *** 6,14 ****
/* ------------------------ gcanvas ----------------------------- */ - /* an area with gcanvas information */
#define BACKGROUNDCOLOR "grey" - #define DEFAULTCOLOR "grey"
#define DEFAULTSIZE 80 --- 6,12 ---- *************** *** 20,27 **** t_object x_obj; t_glist * x_glist; ! t_outlet* out2; int x_width; int x_height; - t_symbol* x_color; int x; int y; --- 18,24 ---- t_object x_obj; t_glist * x_glist; ! t_outlet* out2; int x_width; int x_height; int x; int y; *************** *** 38,42 **** x->x_obj.te_xpix, x->x_obj.te_ypix, x->x_obj.te_xpix + x->x_width, x->x_obj.te_ypix + x->x_height, ! x,x->x_color); } else { --- 35,39 ---- x->x_obj.te_xpix, x->x_obj.te_ypix, x->x_obj.te_xpix + x->x_width, x->x_obj.te_ypix + x->x_height, ! x,BACKGROUNDCOLOR); } else { *************** *** 48,54 **** }
- { ! int n = 1; int nplus, i; nplus = (n == 1 ? 1 : n-1); --- 45,51 ---- }
{ ! /* outlets */ ! int n = 2; int nplus, i; nplus = (n == 1 ? 1 : n-1); *************** *** 68,72 **** onset + IOWIDTH, x->x_obj.te_ypix + x->x_height); } ! n = 1; nplus = (n == 1 ? 1 : n-1); for (i = 0; i < n; i++) --- 65,70 ---- onset + IOWIDTH, x->x_obj.te_ypix + x->x_height); } ! /* inlets */ ! n = 0; nplus = (n == 1 ? 1 : n-1); for (i = 0; i < n; i++) *************** *** 98,104 **** sys_vgui(".x%x.c delete %xS\n", glist_getcanvas(glist), x); ! n = 1; while (n--) { - sys_vgui(".x%x.c delete %xi%d\n",glist_getcanvas(glist),x,n); sys_vgui(".x%x.c delete %xo%d\n",glist_getcanvas(glist),x,n); } --- 96,101 ---- sys_vgui(".x%x.c delete %xS\n", glist_getcanvas(glist), x); ! n = 2; while (n--) { sys_vgui(".x%x.c delete %xo%d\n",glist_getcanvas(glist),x,n); } *************** *** 171,177 **** { t_gcanvas *x = (t_gcanvas *)z; ! binbuf_addv(b, "ssiissii", gensym("#X"),gensym("obj"), (t_int)x->x_obj.te_xpix, (t_int)x->x_obj.te_ypix, ! gensym("gcanvas"),x->x_color,x->x_width,x->x_height); binbuf_addv(b, ";"); } --- 168,174 ---- { t_gcanvas *x = (t_gcanvas *)z; ! binbuf_addv(b, "ssiisii", gensym("#X"),gensym("obj"), (t_int)x->x_obj.te_xpix, (t_int)x->x_obj.te_ypix, ! gensym("gcanvas"),x->x_width,x->x_height); binbuf_addv(b, ";"); } *************** *** 184,189 **** x->x += dx; x->y += dy; - outlet_float(x->x_obj.ob_outlet,x->x); outlet_float(x->out2,x->y); }
--- 181,186 ---- x->x += dx; x->y += dy; outlet_float(x->out2,x->y); + outlet_float(x->x_obj.ob_outlet,x->x); }
*************** *** 198,208 **** t_floatarg alt) { ! glist_grab(x->x_glist, &x->x_obj.te_g, (t_glistmotionfn) gcanvas_motion, (t_glistkeyfn) NULL, xpos, ypos);
x->x = xpos - x->x_obj.te_xpix; x->y = ypos - x->x_obj.te_ypix; - outlet_float(x->x_obj.ob_outlet,x->x); outlet_float(x->out2,x->y); }
--- 195,205 ---- t_floatarg alt) { ! glist_grab(x->x_glist, &x->x_obj.te_g, (t_glistmotionfn) gcanvas_motion, (t_glistkeyfn) NULL, xpos, ypos);
x->x = xpos - x->x_obj.te_xpix; x->y = ypos - x->x_obj.te_ypix; outlet_float(x->out2,x->y); + outlet_float(x->x_obj.ob_outlet,x->x); }
*************** *** 222,233 **** }
- void gcanvas_color(t_gcanvas* x,t_symbol* col) - { - x->x_color = col; - /* outlet_bang(x->x_obj.ob_outlet); only bang if there was a bang .. - so color black does the same as bang, but doesn't forward the bang - */ - } - static void gcanvas_setwidget(void) { --- 219,222 ---- *************** *** 239,248 **** gcanvas_widgetbehavior.w_visfn = gcanvas_vis; gcanvas_widgetbehavior.w_clickfn = gcanvas_newclick; gcanvas_widgetbehavior.w_propertiesfn = NULL; gcanvas_widgetbehavior.w_savefn = gcanvas_save; }
! static void *gcanvas_new(t_symbol* col,t_floatarg h,t_floatarg o) { t_gcanvas *x = (t_gcanvas *)pd_new(gcanvas_class); --- 228,239 ---- gcanvas_widgetbehavior.w_visfn = gcanvas_vis; gcanvas_widgetbehavior.w_clickfn = gcanvas_newclick; + #if PD_MINOR_VERSION < 37 gcanvas_widgetbehavior.w_propertiesfn = NULL; gcanvas_widgetbehavior.w_savefn = gcanvas_save; + #endif }
! static void *gcanvas_new(t_floatarg h,t_floatarg o) { t_gcanvas *x = (t_gcanvas *)pd_new(gcanvas_class); *************** *** 257,265 **** x->x_height = DEFAULTSIZE;
- if (col != &s_) - x->x_color = col; - else - x->x_color = gensym(DEFAULTCOLOR); - outlet_new(&x->x_obj, &s_float); x->out2 = outlet_new(&x->x_obj, &s_float); --- 248,251 ---- *************** *** 270,274 **** { gcanvas_class = class_new(gensym("gcanvas"), (t_newmethod)gcanvas_new, 0, ! sizeof(t_gcanvas),0, A_DEFSYM,A_DEFFLOAT,A_DEFFLOAT,0);
class_addcreator((t_newmethod)gcanvas_new,gensym("bng"),A_DEFSYM,A_DEFFLOAT,A_DEFFLOAT,A_GIMME,0); --- 256,260 ---- { gcanvas_class = class_new(gensym("gcanvas"), (t_newmethod)gcanvas_new, 0, ! sizeof(t_gcanvas),0, A_DEFFLOAT,A_DEFFLOAT,0);
class_addcreator((t_newmethod)gcanvas_new,gensym("bng"),A_DEFSYM,A_DEFFLOAT,A_DEFFLOAT,A_GIMME,0); *************** *** 279,287 **** A_FLOAT, A_FLOAT, 0);
- class_addmethod(gcanvas_class, (t_method)gcanvas_color, gensym("color"), - A_SYMBOL, 0); - gcanvas_setwidget(); class_setwidget(gcanvas_class,&gcanvas_widgetbehavior); }
--- 265,273 ---- A_FLOAT, A_FLOAT, 0);
gcanvas_setwidget(); class_setwidget(gcanvas_class,&gcanvas_widgetbehavior); + #if PD_MINOR_VERSION >= 37 + class_setsavefn(gcanvas_class,&gcanvas_save); + #endif }
Index: image.c =================================================================== RCS file: /cvsroot/pure-data/externals/ggee/gui/image.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** image.c 26 Nov 2002 12:35:23 -0000 1.6 --- image.c 27 Oct 2003 18:23:10 -0000 1.7 *************** *** 172,176 **** --- 172,178 ---- image_widgetbehavior.w_propertiesfn = NULL; #endif + #if PD_MINOR_VERSION < 37 image_widgetbehavior.w_savefn = image_save; + #endif }
*************** *** 208,211 **** --- 210,216 ---- image_setwidget(); class_setwidget(image_class,&image_widgetbehavior); + #if PD_MINOR_VERSION >= 37 + class_setsavefn(image_class,&image_widgetbehavior); + #endif }
Index: slider.c =================================================================== RCS file: /cvsroot/pure-data/externals/ggee/gui/slider.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** slider.c 15 Sep 2003 16:54:29 -0000 1.5 --- slider.c 27 Oct 2003 18:23:10 -0000 1.6 *************** *** 41,50 **** w_deletefn: fatom_delete, w_visfn: fatom_vis, w_savefn: slider_save, - w_clickfn: NULL, w_propertiesfn: NULL, };
- void slider_setup() { slider_class = class_new(gensym("slider"), (t_newmethod)slider_new, 0, --- 41,51 ---- w_deletefn: fatom_delete, w_visfn: fatom_vis, + #if PD_MINOR_VERSION < 37 w_savefn: slider_save, w_propertiesfn: NULL, + #endif + w_clickfn: NULL, };
void slider_setup() { slider_class = class_new(gensym("slider"), (t_newmethod)slider_new, 0, *************** *** 53,55 **** --- 54,60 ---- fatom_setup_common(slider_class); class_setwidget(slider_class,&slider_widgetbehavior); + #if PD_MINOR_VERSION >= 37 + class_setsavefn(slider_class,&slider_save); + #endif + class_setpropertiesfn(slider_class,&fatom_properties); }
Index: sliderh.c =================================================================== RCS file: /cvsroot/pure-data/externals/ggee/gui/sliderh.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sliderh.c 15 Sep 2003 11:53:40 -0000 1.2 --- sliderh.c 27 Oct 2003 18:23:10 -0000 1.3 *************** *** 41,47 **** w_deletefn: fatom_delete, w_visfn: fatom_vis, w_savefn: sliderh_save, - w_clickfn: NULL, w_propertiesfn: NULL, };
--- 41,49 ---- w_deletefn: fatom_delete, w_visfn: fatom_vis, + #if PD_MINOR_VERSION < 37 w_savefn: sliderh_save, w_propertiesfn: NULL, + #endif + w_clickfn: NULL, };
*************** *** 53,55 **** --- 55,60 ---- fatom_setup_common(sliderh_class); class_setwidget(sliderh_class,&sliderh_widgetbehavior); + #if PD_MINOR_VERSION >= 37 + class_setsavefn(sliderh_class,&sliderh_save); + #endif }
Index: ticker.c =================================================================== RCS file: /cvsroot/pure-data/externals/ggee/gui/ticker.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ticker.c 15 Sep 2003 11:53:40 -0000 1.5 --- ticker.c 27 Oct 2003 18:23:10 -0000 1.6 *************** *** 46,52 **** w_deletefn: fatom_delete, w_visfn: fatom_vis, w_savefn: ticker_save, - w_clickfn: NULL, w_propertiesfn: NULL, };
--- 46,54 ---- w_deletefn: fatom_delete, w_visfn: fatom_vis, + #if PD_MINOR_VERSION < 37 w_savefn: ticker_save, w_propertiesfn: NULL, + #endif + w_clickfn: NULL, };
*************** *** 59,61 **** --- 61,67 ---- class_addbang(ticker_class, (t_method)ticker_bang); class_setwidget(ticker_class,&ticker_widgetbehavior); + #if PD_MINOR_VERSION >= 37 + class_setsavefn(ticker_class,&ticker_save); + #endif } +
Index: w_envgen.h =================================================================== RCS file: /cvsroot/pure-data/externals/ggee/gui/w_envgen.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** w_envgen.h 16 Sep 2003 09:06:38 -0000 1.9 --- w_envgen.h 27 Oct 2003 18:23:10 -0000 1.10 *************** *** 479,500 **** #endif
- - - t_widgetbehavior envgen_widgetbehavior; - - void envgen_setwidget(void) - { - envgen_widgetbehavior.w_getrectfn = envgen_getrect; - envgen_widgetbehavior.w_displacefn = envgen_displace; - envgen_widgetbehavior.w_selectfn = envgen_select; - envgen_widgetbehavior.w_activatefn = envgen_activate; - envgen_widgetbehavior.w_deletefn = envgen_delete; - envgen_widgetbehavior.w_visfn = envgen_vis; - #if (PD_VERSION_MINOR > 31) - envgen_widgetbehavior.w_clickfn = envgen_newclick; - envgen_widgetbehavior.w_propertiesfn = NULL; - #endif - envgen_widgetbehavior.w_savefn = envgen_save; - - } - --- 479,480 ----