Update of /cvsroot/pure-data/externals/ggee/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25134
Modified Files: image-help.pd image.c Log Message: added [open( and [size( messages and updated help patch
Index: image-help.pd =================================================================== RCS file: /cvsroot/pure-data/externals/ggee/gui/image-help.pd,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** image-help.pd 25 Jul 2004 15:04:40 -0000 1.1 --- image-help.pd 15 Aug 2007 22:57:56 -0000 1.2 *************** *** 1,4 **** ! #N canvas 0 0 450 300 10; ! #X obj 90 167 image logo100.gif; ! #X text 20 36 Incorporate images. This is instantiated with; ! #X text 20 52 [image logo100.gif]; --- 1,26 ---- ! #N canvas 140 178 568 628 10; ! #X obj 246 361 image logo100.gif; ! #X text 19 18 Incorporate images. This is instantiated with; ! #X text 19 34 [image logo100.gif]; ! #X text 17 57 [image] works with .gif , .ppm , and .pgm image formats ! only.; ! #X msg 86 132 open $1; ! #X obj 86 88 bng 15 250 50 0 empty empty empty 0 -6 0 10 -4034 -1 -1 ! ; ! #X obj 86 109 openpanel; ! #X obj 238 567 bng 15 250 50 0 empty empty empty 0 -6 0 10 -262144 ! -1 -1; ! #X msg 265 152 size $1 $2; ! #X obj 265 129 pack 0 0; ! #X obj 313 106 hsl 128 15 0 127 0 0 empty empty y 7 7 0 10 -203904 ! -1 -1 11800 1; ! #X obj 263 88 hsl 128 15 0 127 0 0 empty empty x 7 7 0 10 -204800 -1 ! -1 12700 1; ! #X connect 0 0 7 0; ! #X connect 4 0 0 0; ! #X connect 5 0 6 0; ! #X connect 6 0 4 0; ! #X connect 8 0 0 0; ! #X connect 9 0 8 0; ! #X connect 10 0 9 1; ! #X connect 11 0 9 0;
Index: image.c =================================================================== RCS file: /cvsroot/pure-data/externals/ggee/gui/image.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** image.c 9 Aug 2007 19:57:50 -0000 1.10 --- image.c 15 Aug 2007 22:57:56 -0000 1.11 *************** *** 24,35 **** void image_drawme(t_image *x, t_glist *glist, int firsttime) { ! if (firsttime) { ! char fname[MAXPDSTRING]; ! canvas_makefilename(glist_getcanvas(x->x_glist), x->x_fname->s_name, ! fname, MAXPDSTRING);
! sys_vgui("image create photo img%x -file "%s"\n",x,fname); sys_vgui(".x%x.c create image %d %d -image img%x -tags %xS\n", ! glist_getcanvas(glist),text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist),x,x);
/* TODO callback from gui --- 24,36 ---- void image_drawme(t_image *x, t_glist *glist, int firsttime) { ! if (firsttime) { ! char fname[MAXPDSTRING]; ! canvas_makefilename(glist_getcanvas(x->x_glist), x->x_fname->s_name, ! fname, MAXPDSTRING);
! sys_vgui("image create photo img%x -file {%s}\n",x,fname); sys_vgui(".x%x.c create image %d %d -image img%x -tags %xS\n", ! glist_getcanvas(glist),text_xpix(&x->x_obj, glist), ! text_ypix(&x->x_obj, glist),x,x);
/* TODO callback from gui *************** *** 38,47 **** } else { ! sys_vgui(".x%x.c coords %xS \ ! %d %d\n", ! glist_getcanvas(glist), x, ! text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist)); } ! }
--- 39,47 ---- } else { ! sys_vgui(".x%x.c coords %xS %d %d\n", ! glist_getcanvas(glist), x, ! text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist)); } ! }
*************** *** 160,163 **** --- 160,170 ---- }
+ void image_open(t_image* x, t_symbol* fname) + { + x->x_fname = fname; + image_erase(x, x->x_glist); + image_drawme(x, x->x_glist, 1); + } + static void image_setwidget(void) { *************** *** 187,191 **** x->x_height = 15;
! x->x_fname = fname; outlet_new(&x->x_obj, &s_float); return (x); --- 194,198 ---- x->x_height = 15;
! x->x_fname = fname; outlet_new(&x->x_obj, &s_float); return (x); *************** *** 197,211 **** sizeof(t_image),0, A_DEFSYM,0);
- /* class_addmethod(image_class, (t_method)image_size, gensym("size"), A_FLOAT, A_FLOAT, 0);
class_addmethod(image_class, (t_method)image_color, gensym("color"), A_SYMBOL, 0); */ ! /* class_addmethod(image_class, (t_method)image_open, gensym("open"), A_SYMBOL, 0); ! */ image_setwidget(); class_setwidget(image_class,&image_widgetbehavior); --- 204,218 ---- sizeof(t_image),0, A_DEFSYM,0);
class_addmethod(image_class, (t_method)image_size, gensym("size"), A_FLOAT, A_FLOAT, 0);
+ /* class_addmethod(image_class, (t_method)image_color, gensym("color"), A_SYMBOL, 0); */ ! class_addmethod(image_class, (t_method)image_open, gensym("open"), A_SYMBOL, 0); ! image_setwidget(); class_setwidget(image_class,&image_widgetbehavior);