Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4845
Modified Files:
Tag: impd_0_37
g_all_guis.c g_bang.c g_canvas.c g_hslider.c g_numbox.c
g_text.c g_vumeter.c u_main.tk u_object.tk
Log Message:
yet another gui update...
added proc populate_menu and stuff
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.4
retrieving revision 1.1.1.4.2.4.2.5
diff -C2 -d -r1.1.1.4.2.4.2.4 -r1.1.1.4.2.4.2.5
*** g_all_guis.c 10 Mar 2004 06:00:11 -0000 1.1.1.4.2.4.2.4
--- g_all_guis.c 14 Mar 2004 22:33:54 -0000 1.1.1.4.2.4.2.5
***************
*** 647,653 ****
for (i=0; i<argc; i++) {
switch (fmt[i]) {
! case 0: goto err; /* too many args */
case '*': goto break1; /* rest is any type */
! case 'F': case 'f': case 'i': if (!IS_A_FLOAT(argv,i)) goto err;
break;
case 'S': case 's': if (!IS_A_SYMBOL(argv,i)) goto err;
--- 647,653 ----
for (i=0; i<argc; i++) {
switch (fmt[i]) {
! case 0 : goto err; /* too many args */
case '*': goto break1; /* rest is any type */
! case 'F': case 'f': case 'd': case 'i': if (!IS_A_FLOAT(argv,i)) goto err;
break;
case 'S': case 's': if (!IS_A_SYMBOL(argv,i)) goto err;
***************
*** 658,662 ****
}
}
! if (fmt[i]!=0 && !optional) return 0; /* not enough args */
break1:
for (i=0; i<argc; i++) {
--- 658,662 ----
}
}
! if (fmt[i]!=0 && !optional) goto err; /* not enough args */
break1:
for (i=0; i<argc; i++) {
***************
*** 665,682 ****
case '*': case ';': goto break2;
case '?': case 'F': case 'S': break; /* skip */
case 'f': {
float *p = va_arg(val,float*);
- //fprintf(stderr," getting float*=0x%08x\n",p);
*p = atom_getfloatarg(i,argc,argv);
} break;
case 'i': {
int *p = va_arg(val, int*);
- //fprintf(stderr," getting int*=0x%08x\n",p);
*p = atom_getintarg(i,argc,argv);
} break;
case 's': {
t_symbol **p = va_arg(val,t_symbol**);
- //fprintf(stderr," getting t_symbol**=0x%08x\n",p);
*p = atom_getsymbolarg(i,argc,argv);
} break;
case 'a': {
--- 665,687 ----
case '*': case ';': goto break2;
case '?': case 'F': case 'S': break; /* skip */
+ case 'd': { /* sigh */
+ double *p = va_arg(val,double*);
+ *p = atom_getfloatarg(i,argc,argv);
+ //fprintf(stderr," getting double*=0x%08x, *=%f\n",p,*p);
+ } break;
case 'f': {
float *p = va_arg(val,float*);
*p = atom_getfloatarg(i,argc,argv);
+ //fprintf(stderr," getting float*=0x%08x, *=%f\n",p,*p);
} break;
case 'i': {
int *p = va_arg(val, int*);
*p = atom_getintarg(i,argc,argv);
+ //fprintf(stderr," getting int*=0x%08x, *=%d\n",p,*p);
} break;
case 's': {
t_symbol **p = va_arg(val,t_symbol**);
*p = atom_getsymbolarg(i,argc,argv);
+ //fprintf(stderr," getting t_symbol**=0x%08x, *=%s\n",p, (*p)->s_name);
} break;
case 'a': {
Index: g_bang.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_bang.c,v
retrieving revision 1.1.1.3.2.2.2.6
retrieving revision 1.1.1.3.2.2.2.7
diff -C2 -d -r1.1.1.3.2.2.2.6 -r1.1.1.3.2.2.2.7
*** g_bang.c 10 Mar 2004 06:00:11 -0000 1.1.1.3.2.2.2.6
--- g_bang.c 14 Mar 2004 22:33:54 -0000 1.1.1.3.2.2.2.7
***************
*** 228,244 ****
static void bng_color(t_bng *x, t_symbol *s, int ac, t_atom *av)
{iemgui_color((void *)x, &x->x_gui, s, ac, av);}
-
static void bng_send(t_bng *x, t_symbol *s)
{iemgui_send(x, &x->x_gui, s);}
-
static void bng_receive(t_bng *x, t_symbol *s)
{iemgui_receive(x, &x->x_gui, s);}
-
static void bng_label(t_bng *x, t_symbol *s)
{iemgui_label((void *)x, &x->x_gui, s);}
-
static void bng_label_pos(t_bng *x, t_symbol *s, int ac, t_atom *av)
{iemgui_label_pos((void *)x, &x->x_gui, s, ac, av);}
-
static void bng_label_font(t_bng *x, t_symbol *s, int ac, t_atom *av)
{iemgui_label_font((void *)x, &x->x_gui, s, ac, av);}
--- 228,239 ----
Index: g_canvas.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_canvas.c,v
retrieving revision 1.1.1.4.2.7.2.3
retrieving revision 1.1.1.4.2.7.2.4
diff -C2 -d -r1.1.1.4.2.7.2.3 -r1.1.1.4.2.7.2.4
*** g_canvas.c 8 Mar 2004 12:32:38 -0000 1.1.1.4.2.7.2.3
--- g_canvas.c 14 Mar 2004 22:33:54 -0000 1.1.1.4.2.7.2.4
***************
*** 131,134 ****
--- 131,143 ----
}
+ void glob_redraw (void) {
+ t_canvas *x = canvas_list;
+ while (x) {
+ fprintf(stderr,"canvas=%08x\n",x);
+ canvas_redraw(x);
+ x->gl_mapped=0; canvas_map(x,1);
+ x=x->gl_next;
+ }
+ }
void canvas_setargs(int argc, t_atom *argv)
Index: g_hslider.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_hslider.c,v
retrieving revision 1.1.1.3.2.2.2.6
retrieving revision 1.1.1.3.2.2.2.7
diff -C2 -d -r1.1.1.3.2.2.2.6 -r1.1.1.3.2.2.2.7
*** g_hslider.c 10 Mar 2004 06:00:11 -0000 1.1.1.3.2.2.2.6
--- g_hslider.c 14 Mar 2004 22:33:54 -0000 1.1.1.3.2.2.2.7
***************
*** 370,380 ****
if (isvert(x)) {
x->x_gui.x_w = iemgui_clip_size((int)atom_getintarg(0, ac, av));
! if(ac > 1)
! hslider_check_width(x, (int)atom_getintarg(1, ac, av));
iemgui_size((void *)x, &x->x_gui);
}else{
hslider_check_width(x, (int)atom_getintarg(0, ac, av));
! if(ac > 1)
! x->x_gui.x_h = iemgui_clip_size((int)atom_getintarg(1, ac, av));
iemgui_size((void *)x, &x->x_gui);
}}
--- 370,378 ----
if (isvert(x)) {
x->x_gui.x_w = iemgui_clip_size((int)atom_getintarg(0, ac, av));
! if(ac > 1) hslider_check_width(x, (int)atom_getintarg(1, ac, av));
iemgui_size((void *)x, &x->x_gui);
}else{
hslider_check_width(x, (int)atom_getintarg(0, ac, av));
! if(ac > 1) x->x_gui.x_h = iemgui_clip_size((int)atom_getintarg(1, ac, av));
iemgui_size((void *)x, &x->x_gui);
}}
***************
*** 487,513 ****
iem_inttofstyle(&x->x_gui.x_fsf, 0);
! if(pd_scanargs(argc,argv,"iiffiiaaaiiiiiiii?;?",
! &w,&h,&min,&max,&lilo,&isa,
&ldx,&ldy,&fstyle,&fs,&bflcol[0],&bflcol[1],&bflcol[2],&v))
{
iem_inttosymargs(&x->x_gui.x_isa, isa);
! iemgui_new_getnames2(&x->x_gui, 4, srl[0], srl[1], srl[2]);
iem_inttofstyle(&x->x_gui.x_fsf, fstyle);
}
! else iemgui_new_getnames(&x->x_gui, 6, 0);
! if((argc == 18)&&IS_A_FLOAT(argv,17))
! steady = (int)atom_getintarg(17, argc, argv);
x->x_gui.x_draw = (t_iemfunptr)hslider_draw;
x->x_gui.x_fsf.x_snd_able = 1;
x->x_gui.x_fsf.x_rcv_able = 1;
x->x_gui.x_glist = (t_glist *)canvas_getcurrent();
! if(x->x_gui.x_isa.x_loadinit)
! x->x_val = v;
! else
! x->x_val = 0;
x->x_pos = x->x_val;
if(lilo != 0) lilo = 1;
x->x_lin0_log1 = lilo;
- if(steady != 0) steady = 1;
x->x_steady = steady;
if (!strcmp(x->x_gui.x_snd->s_name, "empty")) x->x_gui.x_fsf.x_snd_able = 0;
--- 485,511 ----
iem_inttofstyle(&x->x_gui.x_fsf, 0);
! //post("vslider before min=%f max=%f &min=%08x &max=%08x",min,max,&min,&max);
! if(pd_scanargs(argc,argv,"iiddiiaaaiiiiiiii;?",
! &w,&h,&min,&max,&lilo,&isa,&srl[0],&srl[1],&srl[2],
&ldx,&ldy,&fstyle,&fs,&bflcol[0],&bflcol[1],&bflcol[2],&v))
{
+ //post("vslider after min=%f max=%f",min,max);
iem_inttosymargs(&x->x_gui.x_isa, isa);
! iemgui_new_getnames2(&x->x_gui, 6, srl[0], srl[1], srl[2]);
iem_inttofstyle(&x->x_gui.x_fsf, fstyle);
}
! else {
! post("HUH???");
! iemgui_new_getnames(&x->x_gui, 6, 0);
! }
! if((argc == 18)&&IS_A_FLOAT(argv,17)) steady=!!(int)atom_getintarg(17,argc,argv);
x->x_gui.x_draw = (t_iemfunptr)hslider_draw;
x->x_gui.x_fsf.x_snd_able = 1;
x->x_gui.x_fsf.x_rcv_able = 1;
x->x_gui.x_glist = (t_glist *)canvas_getcurrent();
! x->x_val = x->x_gui.x_isa.x_loadinit ? v : 0;
x->x_pos = x->x_val;
if(lilo != 0) lilo = 1;
x->x_lin0_log1 = lilo;
x->x_steady = steady;
if (!strcmp(x->x_gui.x_snd->s_name, "empty")) x->x_gui.x_fsf.x_snd_able = 0;
***************
*** 520,525 ****
x->x_gui.x_ldx = ldx;
x->x_gui.x_ldy = ldy;
! if(fs < 4)
! fs = 4;
x->x_gui.x_fontsize = fs;
if (isvert(x)) {
--- 518,522 ----
x->x_gui.x_ldx = ldx;
x->x_gui.x_ldy = ldy;
! if(fs < 4) fs = 4;
x->x_gui.x_fontsize = fs;
if (isvert(x)) {
Index: g_numbox.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_numbox.c,v
retrieving revision 1.1.1.4.2.2.2.4
retrieving revision 1.1.1.4.2.2.2.5
diff -C2 -d -r1.1.1.4.2.2.2.4 -r1.1.1.4.2.2.2.5
*** g_numbox.c 10 Mar 2004 06:00:11 -0000 1.1.1.4.2.2.2.4
--- g_numbox.c 14 Mar 2004 22:33:54 -0000 1.1.1.4.2.2.2.5
***************
*** 169,177 ****
xpos, ypos + x->x_gui.x_h,
x->x_gui.x_fcol, x);
- sys_vgui(".x%x.c create text %d %d -text {%s} -anchor w \
- -font {%s %d bold} -fill #%6.6x -tags %xLABEL\n",
- canvas, xpos+x->x_gui.x_ldx, ypos+x->x_gui.x_ldy,
- strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"",
- x->x_gui.x_font, x->x_gui.x_fontsize, x->x_gui.x_lcol, x);
my_numbox_ftoa(x);
sys_vgui(".x%x.c create text %d %d -text {%s} -anchor w \
--- 169,172 ----
***************
*** 193,198 ****
xpos + half, ypos + half,
xpos, ypos + x->x_gui.x_h);
- sys_vgui(".x%x.c coords %xLABEL %d %d\n",
- canvas, x, xpos+x->x_gui.x_ldx, ypos+x->x_gui.x_ldy);
sys_vgui(".x%x.c coords %xNUMBER %d %d\n",
canvas, x, xpos+half+2, ypos+half+d);
--- 188,191 ----
***************
*** 205,209 ****
sys_vgui("numbox_erase .x%x.c %xBASE\n", canvas, x);
sys_vgui(".x%x.c delete %xBASE2\n", canvas, x);
- sys_vgui(".x%x.c delete %xLABEL\n", canvas, x);
sys_vgui(".x%x.c delete %xNUMBER\n", canvas, x);
}
--- 198,201 ----
***************
*** 212,220 ****
{
t_canvas *canvas=glist_getcanvas(glist);
-
- sys_vgui(".x%x.c itemconfigure %xLABEL -font {%s %d bold} -fill #%6.6x -text {%s} \n",
- canvas, x, x->x_gui.x_font, x->x_gui.x_fontsize,
- x->x_gui.x_fsf.x_selected?IEM_GUI_COLOR_SELECTED:x->x_gui.x_lcol,
- strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"");
sys_vgui(".x%x.c itemconfigure %xNUMBER -font {%s %d bold} -fill #%6.6x \n",
canvas, x, x->x_gui.x_font, x->x_gui.x_fontsize,
--- 204,207 ----
***************
*** 662,666 ****
t_symbol *srl[3]={0,0,0};
! if(pd_scanargs(argc,argv,"iiffiiaaaiiiiiiif*",
&w,&h,&min,&max,&lilo,&isa,&srl[0],&srl[1],&srl[2],
&ldx,&ldy,&fstyle,&fs,&bflcol[0],&bflcol[1],&bflcol[2],&v))
--- 649,653 ----
t_symbol *srl[3]={0,0,0};
! if(pd_scanargs(argc,argv,"iiddiiaaaiiiiiiid*",
&w,&h,&min,&max,&lilo,&isa,&srl[0],&srl[1],&srl[2],
&ldx,&ldy,&fstyle,&fs,&bflcol[0],&bflcol[1],&bflcol[2],&v))
Index: g_text.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_text.c,v
retrieving revision 1.1.1.4.2.2.2.3
retrieving revision 1.1.1.4.2.2.2.4
diff -C2 -d -r1.1.1.4.2.2.2.3 -r1.1.1.4.2.2.2.4
*** g_text.c 8 Mar 2004 12:32:38 -0000 1.1.1.4.2.2.2.3
--- g_text.c 14 Mar 2004 22:33:54 -0000 1.1.1.4.2.2.2.4
***************
*** 232,265 ****
static void messresponder_bang(t_messresponder *x)
! {
! outlet_bang(x->mr_outlet);
! }
!
static void messresponder_float(t_messresponder *x, t_float f)
! {
! outlet_float(x->mr_outlet, f);
! }
!
static void messresponder_symbol(t_messresponder *x, t_symbol *s)
! {
! outlet_symbol(x->mr_outlet, s);
! }
!
static void messresponder_list(t_messresponder *x,
t_symbol *s, int argc, t_atom *argv)
! {
! outlet_list(x->mr_outlet, s, argc, argv);
! }
!
static void messresponder_anything(t_messresponder *x,
t_symbol *s, int argc, t_atom *argv)
! {
! outlet_anything(x->mr_outlet, s, argc, argv);
! }
!
static void message_bang(t_message *x)
! {
! binbuf_eval(x->m_text.te_binbuf, &x->m_messresponder.mr_pd, 0, 0);
! }
static void message_float(t_message *x, t_float f)
--- 232,248 ----
static void messresponder_bang(t_messresponder *x)
! {outlet_bang(x->mr_outlet);}
static void messresponder_float(t_messresponder *x, t_float f)
! {outlet_float(x->mr_outlet, f);}
static void messresponder_symbol(t_messresponder *x, t_symbol *s)
! {outlet_symbol(x->mr_outlet, s);}
static void messresponder_list(t_messresponder *x,
t_symbol *s, int argc, t_atom *argv)
! {outlet_list(x->mr_outlet, s, argc, argv);}
static void messresponder_anything(t_messresponder *x,
t_symbol *s, int argc, t_atom *argv)
! {outlet_anything(x->mr_outlet, s, argc, argv);}
static void message_bang(t_message *x)
! {binbuf_eval(x->m_text.te_binbuf, &x->m_messresponder.mr_pd, 0, 0);}
static void message_float(t_message *x, t_float f)
***************
*** 278,284 ****
static void message_list(t_message *x, t_symbol *s, int argc, t_atom *argv)
! {
! binbuf_eval(x->m_text.te_binbuf, &x->m_messresponder.mr_pd, argc, argv);
! }
static void message_set(t_message *x, t_symbol *s, int argc, t_atom *argv)
--- 261,265 ----
static void message_list(t_message *x, t_symbol *s, int argc, t_atom *argv)
! {binbuf_eval(x->m_text.te_binbuf, &x->m_messresponder.mr_pd, argc, argv);}
static void message_set(t_message *x, t_symbol *s, int argc, t_atom *argv)
***************
*** 310,314 ****
{
t_rtext *y = glist_findrtext(x->m_glist, &x->m_text);
! sys_vgui(".x%x.c itemconfigure %sR -width 5\n",
glist_getcanvas(x->m_glist), rtext_gettag(y));
clock_delay(x->m_clock, 120);
--- 291,295 ----
{
t_rtext *y = glist_findrtext(x->m_glist, &x->m_text);
! sys_vgui(".x%x.c itemconfigure %sBASE -width 5\n",
glist_getcanvas(x->m_glist), rtext_gettag(y));
clock_delay(x->m_clock, 120);
***************
*** 321,325 ****
{
t_rtext *y = glist_findrtext(x->m_glist, &x->m_text);
! sys_vgui(".x%x.c itemconfigure %sR -width 1\n",
glist_getcanvas(x->m_glist), rtext_gettag(y));
}
--- 302,306 ----
{
t_rtext *y = glist_findrtext(x->m_glist, &x->m_text);
! sys_vgui(".x%x.c itemconfigure %sBASE -width 1\n",
glist_getcanvas(x->m_glist), rtext_gettag(y));
}
***************
*** 691,701 ****
}
! static void gatom_displace(t_gobj *z, t_glist *glist,
! int dx, int dy)
{
t_gatom *x = (t_gatom*)z;
text_displace(z, glist, dx, dy);
! sys_vgui(".x%x.c move %x.l %d %d\n", glist_getcanvas(glist),
! x, dx, dy);
}
--- 672,680 ----
}
! static void gatom_displace(t_gobj *z, t_glist *glist, int dx, int dy)
{
t_gatom *x = (t_gatom*)z;
text_displace(z, glist, dx, dy);
! sys_vgui(".x%x.c move %x.l %d %d\n", glist_getcanvas(glist), x, dx, dy);
}
***************
*** 799,810 ****
void canvas_floatatom(t_glist *gl, t_symbol *s, int argc, t_atom *argv)
! {
! canvas_atom(gl, A_FLOAT, s, argc, argv);
! }
!
void canvas_symbolatom(t_glist *gl, t_symbol *s, int argc, t_atom *argv)
! {
! canvas_atom(gl, A_SYMBOL, s, argc, argv);
! }
static void gatom_free(t_gatom *x)
--- 778,784 ----
void canvas_floatatom(t_glist *gl, t_symbol *s, int argc, t_atom *argv)
! {canvas_atom(gl, A_FLOAT, s, argc, argv);}
void canvas_symbolatom(t_glist *gl, t_symbol *s, int argc, t_atom *argv)
! {canvas_atom(gl, A_SYMBOL, s, argc, argv);}
static void gatom_free(t_gatom *x)
***************
*** 913,917 ****
rtext_select(y, state);
if (glist_isvisible(glist) && text_shouldvis(x, glist)) {
! sys_vgui("%s_select .x%x.c %sR %d\n", text_classname(x), glist, rtext_gettag(y), state);
}
}
--- 887,891 ----
rtext_select(y, state);
if (glist_isvisible(glist) && text_shouldvis(x, glist)) {
! sys_vgui("%s_select .x%x.c %s %d\n", text_classname(x), glist, rtext_gettag(y), state);
}
}
***************
*** 1090,1094 ****
char *tag, int x1, int y1, int x2, int y2)
{
! sys_vgui("io_draw .x%x.cBASE %s %d %d %d %d %d %d\n",
glist_getcanvas(glist), tag, x1, y1, x2-x1, y2-x1,
obj_ninlets(ob), obj_noutlets(ob));
--- 1064,1068 ----
char *tag, int x1, int y1, int x2, int y2)
{
! sys_vgui("io_draw .x%x.c %s %d %d %d %d %d %d\n",
glist_getcanvas(glist), tag, x1, y1, x2-x1, y2-x1,
obj_ninlets(ob), obj_noutlets(ob));
***************
*** 1102,1106 ****
text_getrect(&x->te_g, glist, &x1, &y1, &x2, &y2);
ob = pd_checkobject(&x->te_pd);
! sys_vgui("%s_draw .x%x.c %sR %d %d %d %d %d %d\n",
text_classname(x),glist,tag,x1,y1,x2-x1,y2-y1,
ob?obj_ninlets(ob):0, ob?obj_noutlets(ob):0);
--- 1076,1080 ----
text_getrect(&x->te_g, glist, &x1, &y1, &x2, &y2);
ob = pd_checkobject(&x->te_pd);
! sys_vgui("%s_draw .x%x.c %s %d %d %d %d %d %d\n",
text_classname(x),glist,tag,x1,y1,x2-x1,y2-y1,
ob?obj_ninlets(ob):0, ob?obj_noutlets(ob):0);
***************
*** 1109,1119 ****
void glist_eraseiofor(t_glist *glist, t_object *ob, char *tag)
{
! sys_vgui("io_erase .x%x.c %sBASE\n",glist_getcanvas(glist),tag);
}
void text_eraseborder(t_text *x, t_glist *glist, char *tag)
{
! sys_vgui("%s_erase .x%x.c %sR\n", text_classname(x), glist_getcanvas(glist), tag);
! sys_vgui("io_erase .x%x.c %sBASE\n",glist_getcanvas(glist),tag);
}
--- 1083,1093 ----
void glist_eraseiofor(t_glist *glist, t_object *ob, char *tag)
{
! sys_vgui("io_erase .x%x.c %s\n",glist_getcanvas(glist),tag);
}
void text_eraseborder(t_text *x, t_glist *glist, char *tag)
{
! sys_vgui("%s_erase .x%x.c %s\n", text_classname(x), glist_getcanvas(glist), tag);
! sys_vgui("io_erase .x%x.c %s\n",glist_getcanvas(glist),tag);
}
Index: g_vumeter.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_vumeter.c,v
retrieving revision 1.1.1.3.2.2.2.3
retrieving revision 1.1.1.3.2.2.2.4
diff -C2 -d -r1.1.1.3.2.2.2.3 -r1.1.1.3.2.2.2.4
*** g_vumeter.c 8 Mar 2004 12:32:38 -0000 1.1.1.3.2.2.2.3
--- g_vumeter.c 14 Mar 2004 22:33:54 -0000 1.1.1.3.2.2.2.4
***************
*** 163,167 ****
ypos+x->x_gui.x_ldy);
sys_vgui("io_draw .x%x.c %x %d %d %d %d %d %d\n",
! canvas, x, xpos-1, ypos-2, xpos+x->x_gui.x_w+1, ypos+x->x_gui.x_h+2,
2*!x->x_gui.x_fsf.x_rcv_able, 2*!x->x_gui.x_fsf.x_snd_able);
}
--- 163,167 ----
ypos+x->x_gui.x_ldy);
sys_vgui("io_draw .x%x.c %x %d %d %d %d %d %d\n",
! canvas, x, xpos-1, ypos-2, x->x_gui.x_w+1, x->x_gui.x_h+2,
2*!x->x_gui.x_fsf.x_rcv_able, 2*!x->x_gui.x_fsf.x_snd_able);
}
Index: u_main.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/u_main.tk,v
retrieving revision 1.1.1.4.2.7.4.11
retrieving revision 1.1.1.4.2.7.4.12
diff -C2 -d -r1.1.1.4.2.7.4.11 -r1.1.1.4.2.7.4.12
*** u_main.tk 7 Mar 2004 05:31:35 -0000 1.1.1.4.2.7.4.11
--- u_main.tk 14 Mar 2004 22:33:54 -0000 1.1.1.4.2.7.4.12
***************
*** 451,554 ****
}
! proc menu_cut {name} {
! pd [concat $name cut \;]
! }
!
! proc menu_copy {name} {
! pd [concat $name copy \;]
! }
!
[...1138 lines suppressed...]
--- 3315,3333 ----
# theme:
! set look(objectfg) #000000
! set look(objectbg) #ffffff
! set look(objectframe1) #99cccc
! set look(objectframe2) #668888
! set look(objectframe3) #000000
! set look(objectframe4) #ffaa00
! set look(canvasbgrun) #ffffff
! set look(canvasbgedit) #dddddd
! set look(wirefg) #888888
! set look(sliderbg) #bbe4ff
! set look(inletfg) #ff0000
! set look(outletfg) #ff0000
raise .
+
+ global env
+ catch {source $env(HOME)/.pd.tk}
Index: u_object.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/u_object.tk,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -C2 -d -r1.1.2.7 -r1.1.2.8
*** u_object.tk 10 Mar 2004 06:00:11 -0000 1.1.2.7
--- u_object.tk 14 Mar 2004 22:33:55 -0000 1.1.2.8
***************
*** 2,9 ****
proc bluify {colour} {
! scan $colour #%02x%02x%02x r g b
! set r [expr ($r*0xbb)>>8]
! set g [expr ($g*0xe4)>>8]
! return [format #%02x%02x%02x $r $g $b]
}
--- 2,9 ----
proc bluify {colour} {
! global look
! scan $colour #%02x%02x%02x r g b
! scan $look(sliderbg) #%02x%02x%02x R G B
! return [format #%02x%02x%02x [expr ($r*$R)>>8] [expr ($g*$G)>>8] [expr ($g*$B)>>8]]
}
***************
*** 29,35 ****
regsub {;$} $c {} c
if {$c<0} {
! set r [expr 4*(((-$c)>> 0)&63)]
! set g [expr 4*(((-$c)>> 6)&63)]
! set b [expr 4*(((-$c)>>12)&63)]
return [format #%02x%02x%02x $r $g $b]
} {
--- 29,35 ----
regsub {;$} $c {} c
if {$c<0} {
! set r [expr 4*(((~$c)>> 0)&63)]
! set g [expr 4*(((~$c)>> 6)&63)]
! set b [expr 4*(((~$c)>>12)&63)]
return [format #%02x%02x%02x $r $g $b]
} {
***************
*** 52,55 ****
--- 52,58 ----
set fields(vsl) $fields(hsl)
set fields(vradio) $fields(hradio)
+ set fields(hdl) $fields(hradio)
+ set fields(vdl) $fields(hradio)
+ set fields(vu) [eval list $fields1 w h rcv lab ldx ldy fstyle fs col0 col2 scale isa]
proc update_object {x d} {
***************
*** 75,84 ****
global look
set xys [list $x1 $y1 $x2 $y2]
if {[llength [$canvas gettags $tag]] != 0} {
! eval "$canvas coords $tag $xys"
} {
! eval "$canvas create line $xys -tags $tag -width $thick \
! -arrow last -fill $look(wirefg) -smooth yes"
}
}
--- 78,98 ----
global look
set xys [list $x1 $y1 $x2 $y2]
+ # set length [expr sqrt(pow($x2-$x1,2)+pow($y2-$y1,2))]
+ # set step [expr 1/floor(1+$length/4)]
+ # for {set i 0} {$i<=1.001} {set i [expr $i+$step]} {
+ # set r [expr (rand()-0.5)*$i*(1-$i)*150]
+ # set r [expr sin($i/$step)*$i*(1-$i)*100]
+ # set q [expr sin(1+$i/$step)*$i*(1-$i)*100]
+ # #lappend xys [expr $x1+($x2-$x1)*$i+$r*[expr ($y1-$y2)/$length]]
+ # #lappend xys [expr $y1+($y2-$y1)*$i+$q*[expr ($x2-$x1)/$length]]
+ # lappend xys [expr $x1+($x2-$x1)*$i+(rand()-0.5)*150*$i*(1-$i)]
+ # lappend xys [expr $y1+($y2-$y1)*$i+(rand()-0.5)*150*$i*(1-$i)]
+ # }
if {[llength [$canvas gettags $tag]] != 0} {
! $canvas coords $tag $xys
} {
! $canvas create line $xys -tags $tag -width $thick \
! -arrow last -fill $look(wirefg) -smooth yes
}
}
***************
*** 114,120 ****
[expr $onset-$fx+$look(iowidth)] [expr $y1-$fy+$look(extrapix)]]
if {[llength [$canvas gettags ${tag}i$i]] != 0} {
! eval "$canvas coords ${tag}i$i $points"
} {
! eval "$canvas create rectangle $points -tags {${tag}i ${tag}i$i} -outline red"
}
}
--- 128,134 ----
[expr $onset-$fx+$look(iowidth)] [expr $y1-$fy+$look(extrapix)]]
if {[llength [$canvas gettags ${tag}i$i]] != 0} {
! $canvas coords ${tag}i$i $points
} {
! $canvas create rectangle $points -tags "${tag}i ${tag}i$i" -outline $look(inletfg)
}
}
***************
*** 125,131 ****
[expr $onset-$fx+$look(iowidth)] [expr $y2+$fy]]
if {[llength [$canvas gettags ${tag}o$i]] != 0} {
! eval "$canvas coords ${tag}o$i $points"
} {
! eval "$canvas create rectangle $points -tags {${tag}o ${tag}o$i} -outline red"
}
}
--- 139,145 ----
[expr $onset-$fx+$look(iowidth)] [expr $y2+$fy]]
if {[llength [$canvas gettags ${tag}o$i]] != 0} {
! $canvas coords ${tag}o$i $points
} {
! $canvas create rectangle $points -tags "${tag}o ${tag}o$i" -outline $look(outletfg)
}
}
***************
*** 145,156 ****
set xyc [list [expr $x2-1] [expr $y1+1] [expr $x2-1] [expr $y2-1] [expr $x1+1] [expr $y2-1]]
set xyd [list [expr $x1+4] [expr $y1+4] [expr $x2+4] [expr $y2+4]]
! if {[llength [$canvas gettags $tag]] != 0} {
! eval "$canvas coords ${tag} $xya"
! eval "$canvas coords ${tag}+ $xyb"
! eval "$canvas coords ${tag}++ $xyc"
} {
! eval "$canvas create rectangle $xya -tag ${tag} -fill ${look(objectbg)}"
! eval "$canvas create line $xyb -tag ${tag}+ -fill ${look(objectframe1)}"
! eval "$canvas create line $xyc -tag ${tag}++ -fill ${look(objectframe2)}"
}
io_draw $canvas $tag $x1 $y1 $xs $ys $ins $outs
--- 159,170 ----
set xyc [list [expr $x2-1] [expr $y1+1] [expr $x2-1] [expr $y2-1] [expr $x1+1] [expr $y2-1]]
set xyd [list [expr $x1+4] [expr $y1+4] [expr $x2+4] [expr $y2+4]]
! if {[llength [$canvas gettags ${tag}BASE]] != 0} {
! $canvas coords ${tag}BASE $xya
! $canvas coords ${tag}BASE2 $xyb
! $canvas coords ${tag}BASE3 $xyc
} {
! $canvas create rectangle $xya -tag ${tag}BASE -fill ${look(objectbg)}
! $canvas create line $xyb -tag ${tag}BASE2 -fill ${look(objectframe1)}
! $canvas create line $xyc -tag ${tag}BASE3 -fill ${look(objectframe2)}
}
io_draw $canvas $tag $x1 $y1 $xs $ys $ins $outs
***************
*** 160,168 ****
global look
if {$flag} {set colour $look(objectframe4)} {set colour $look(objectframe3)}
! $canvas itemconfigure $tag -outline $colour
}
proc objectbox_erase {canvas tag} {
! $canvas delete $tag $tag+ $tag++
io_erase $canvas $tag
}
--- 174,182 ----
global look
if {$flag} {set colour $look(objectframe4)} {set colour $look(objectframe3)}
! $canvas itemconfigure ${tag}BASE -outline $colour
}
proc objectbox_erase {canvas tag} {
! $canvas delete ${tag}BASE ${tag}BASE2 ${tag}BASE3
io_erase $canvas $tag
}
***************
*** 182,189 ****
set points [list $x1 $y1 [expr $x2+4] $y1 $x2 [expr $y1+4] $x2 [expr $y2-4] \
[expr $x2+4] $y2 $x1 $y2 $x2 $y2 $x1 $y2]
! if {[llength [$canvas gettags $tag]] != 0} {
! eval "$canvas coords ${tag} $points"
} {
! eval "$canvas create polygon $points -tag ${tag} -fill $look(objectbg) -outline $look(objectframe3)"
}
io_draw $canvas $tag $x1 $y1 $xs $ys $ins $outs
--- 196,203 ----
set points [list $x1 $y1 [expr $x2+4] $y1 $x2 [expr $y1+4] $x2 [expr $y2-4] \
[expr $x2+4] $y2 $x1 $y2 $x2 $y2 $x1 $y2]
! if {[llength [$canvas gettags ${tag}BASE]] != 0} {
! $canvas coords ${tag}BASE $points
} {
! $canvas create polygon $points -tag ${tag}BASE -fill $look(objectbg) -outline $look(objectframe3)
}
io_draw $canvas $tag $x1 $y1 $xs $ys $ins $outs
***************
*** 193,201 ****
global look
if {$flag} {set colour $look(objectframe4)} {set colour $look(objectframe3)}
! $canvas itemconfigure $tag -outline $colour
}
proc message_erase {canvas tag} {
! $canvas delete $tag
io_erase $canvas $tag
}
--- 207,215 ----
global look
if {$flag} {set colour $look(objectframe4)} {set colour $look(objectframe3)}
! $canvas itemconfigure ${tag}BASE -outline $colour
}
proc message_erase {canvas tag} {
! $canvas delete ${tag}BASE
io_erase $canvas $tag
}
***************
*** 209,216 ****
set y2 [expr $y1+$ys]
set points [list $x1 $y1 [expr $x2-4] $y1 $x2 [expr $y1+4] $x2 $y2 $x1 $y2]
! if {[llength [$canvas gettags $tag]] != 0} {
! eval "$canvas coords ${tag} $points"
} {
! eval "$canvas create polygon $points -tag ${tag} -fill $look(objectbg) -outline $look(objectframe3)"
}
io_draw $canvas $tag $x1 $y1 $xs $ys $ins $outs
--- 223,230 ----
set y2 [expr $y1+$ys]
set points [list $x1 $y1 [expr $x2-4] $y1 $x2 [expr $y1+4] $x2 $y2 $x1 $y2]
! if {[llength [$canvas gettags ${tag}BASE]] != 0} {
! $canvas coords ${tag}BASE $points
} {
! $canvas create polygon $points -tag ${tag}BASE -fill $look(objectbg) -outline $look(objectframe3)
}
io_draw $canvas $tag $x1 $y1 $xs $ys $ins $outs
***************
*** 220,228 ****
global look
if {$flag} {set colour $look(objectframe4)} {set colour $look(objectframe3)}
! $canvas itemconfigure $tag -outline $colour
}
proc atom_erase {canvas tag} {
! $canvas delete $tag
io_erase $canvas $tag
}
--- 234,242 ----
global look
if {$flag} {set colour $look(objectframe4)} {set colour $look(objectframe3)}
! $canvas itemconfigure ${tag}BASE -outline $colour
}
proc atom_erase {canvas tag} {
! $canvas delete ${tag}BASE
io_erase $canvas $tag
}
***************
*** 240,249 ****
set outs [expr [string compare $data($tag:snd) empty]==0]
set points [list $x1 $y1 [expr $x2-4] $y1 $x2 [expr $y1+4] $x2 $y2 $x1 $y2]
! if {[llength [$canvas gettags $tag]] != 0} {
! eval "$canvas coords ${tag} $points"
} {
! eval "$canvas create polygon $points -tag ${tag} -fill $look(objectbg) -outline $look(objectframe3)"
}
io_draw $canvas $tag $x1 $y1 $xs $ys $ins $outs
}
--- 254,264 ----
set outs [expr [string compare $data($tag:snd) empty]==0]
set points [list $x1 $y1 [expr $x2-4] $y1 $x2 [expr $y1+4] $x2 $y2 $x1 $y2]
! if {[llength [$canvas gettags ${tag}BASE]] != 0} {
! $canvas coords ${tag}BASE $points
} {
! $canvas create polygon $points -tag ${tag}BASE -fill $look(objectbg) -outline $look(objectframe3)
}
io_draw $canvas $tag $x1 $y1 $xs $ys $ins $outs
+ label_draw $tag $canvas
}
***************
*** 252,255 ****
--- 267,271 ----
if {$flag} {set colour $look(objectframe4)} {set colour $look(objectframe3)}
$canvas itemconfigure $tag -outline $colour
+ label_select $tag $canvas
}
***************
*** 257,260 ****
--- 273,277 ----
$canvas delete $tag
io_erase $canvas $tag
+ label_erase $tag $canvas
}
***************
*** 266,269 ****
--- 283,287 ----
proc bluebox_draw {canvas tag x1 y1 xs ys ins outs colour} {
+ global data
set x2 [expr $x1+$xs]
set y2 [expr $y1+$ys]
***************
*** 271,283 ****
set xyb [list [expr $x2-1] [expr $y1+1] [expr $x1+1] [expr $y1+1] [expr $x1+1] [expr $y2-1]]
set xyc [list [expr $x2-1] [expr $y1+1] [expr $x2-1] [expr $y2-1] [expr $x1+1] [expr $y2-1]]
! if {[llength [$canvas gettags $tag]] != 0} {
! eval "$canvas coords ${tag} $xya"
! eval "$canvas coords ${tag}+ $xyb"
! eval "$canvas coords ${tag}++ $xyc"
} {
! set color [bluify #ffffff]
! eval "$canvas create rectangle $xya -tag ${tag} -fill $color"
! eval "$canvas create line $xyb -tag ${tag}+ -fill #ffffff"
! eval "$canvas create line $xyc -tag ${tag}++ -fill [darker $color]"
}
io_draw $canvas $tag $x1 $y1 $xs $ys $ins $outs
--- 289,303 ----
set xyb [list [expr $x2-1] [expr $y1+1] [expr $x1+1] [expr $y1+1] [expr $x1+1] [expr $y2-1]]
set xyc [list [expr $x2-1] [expr $y1+1] [expr $x2-1] [expr $y2-1] [expr $x1+1] [expr $y2-1]]
! set isnew [expr [llength [$canvas gettags ${tag}BASE]] == 0]
! #puts "bluebox: [parse_color $data($tag:col0)] [parse_color $data($tag:col1)] [parse_color $data($tag:col2)]"
! set color [bluify [parse_color $data($tag:col0)]]
! if {$isnew} {
! $canvas create rectangle $xya -tag ${tag}BASE -fill $color
! $canvas create line $xyb -tag ${tag}BASE2 -fill #ffffff
! $canvas create line $xyc -tag ${tag}BASE3 -fill [darker $color]
} {
! $canvas coords ${tag}BASE $xya; $canvas itemconfigure ${tag}BASE -fill $color
! $canvas coords ${tag}BASE2 $xyb; $canvas itemconfigure ${tag}BASE2 -fill #ffffff
! $canvas coords ${tag}BASE3 $xyc; $canvas itemconfigure ${tag}BASE3 -fill [darker $color]
}
io_draw $canvas $tag $x1 $y1 $xs $ys $ins $outs
***************
*** 291,295 ****
proc bluebox_erase {canvas tag} {
! $canvas delete $tag $tag+ $tag++
io_erase $canvas $tag
}
--- 311,315 ----
proc bluebox_erase {canvas tag} {
! $canvas delete ${tag}BASE ${tag}BASE2 ${tag}BASE3
io_erase $canvas $tag
}
***************
*** 304,308 ****
global data
set isnew [expr [llength [$canvas gettags ${tag}BASE]] == 0]
! switch $data($tag:class) {hradio {set orient 0} vradio {set orient 1}}
set x1 $data($tag:x1)
set y1 $data($tag:y1)
--- 324,331 ----
global data
set isnew [expr [llength [$canvas gettags ${tag}BASE]] == 0]
! switch $data($tag:class) {
! hradio {set orient 0} hdl {set orient 0}
! vradio {set orient 1} vdl {set orient 1}
! }
set x1 $data($tag:x1)
set y1 $data($tag:y1)
***************
*** 315,319 ****
set outs [expr [string compare $data($tag:snd) empty]==0]
set colour [parse_color $data($tag:col0)]
! bluebox_draw $canvas ${tag}BASE $x1 $y1 $xs $ys $ins $outs $colour
if {$orient} {set size $ys} {set size $xs}
set size [expr $size/$n]
--- 338,342 ----
set outs [expr [string compare $data($tag:snd) empty]==0]
set colour [parse_color $data($tag:col0)]
! bluebox_draw $canvas ${tag} $x1 $y1 $xs $ys $ins $outs $colour
if {$orient} {set size $ys} {set size $xs}
set size [expr $size/$n]
***************
*** 340,344 ****
proc radio_erase {tag canvas} {
! bluebox_erase $canvas ${tag}BASE
$canvas delete ${tag}BUT
}
--- 363,367 ----
proc radio_erase {tag canvas} {
! bluebox_erase $canvas $tag
$canvas delete ${tag}BUT
}
***************
*** 347,351 ****
set isnew [expr [llength [$canvas gettags ${tag}BASE]] == 0]
global data
- set isnew [expr [llength [$canvas gettags ${tag}BASE]] == 0]
set x1 $data($tag:x1)
set y1 $data($tag:y1)
--- 370,373 ----
***************
*** 354,359 ****
set ins [expr [string compare $data($tag:snd) empty]==0]
set outs [expr [string compare $data($tag:snd) empty]==0]
set colour [parse_color $data($tag:col0)]
! bluebox_draw $canvas ${tag}BASE $x1 $y1 $xs $ys $ins $outs $colour
if {$isnew} {
set color [bluify #ffffff]
--- 376,382 ----
set ins [expr [string compare $data($tag:snd) empty]==0]
set outs [expr [string compare $data($tag:snd) empty]==0]
+ switch $data($tag:class) {hsl {set orient 0} vsl {set orient 1}}
set colour [parse_color $data($tag:col0)]
! bluebox_draw $canvas $tag $x1 $y1 $xs $ys $ins $outs $colour
if {$isnew} {
set color [bluify #ffffff]
***************
*** 391,395 ****
proc slider_erase {canvas tag} {
! bluebox_erase $canvas ${tag}BASE
$canvas delete ${tag}KNOB
}
--- 414,418 ----
proc slider_erase {canvas tag} {
! bluebox_erase $canvas $tag
$canvas delete ${tag}KNOB
}
***************
*** 417,420 ****
--- 440,446 ----
}
+ proc label_select {tag canvas} {}
+ proc label_erase {tag canvas} {}
+
proc bang_draw {tag canvas} {
global data
***************
*** 429,433 ****
set outs [expr [string compare $data($tag:snd) empty]==0]
set colour [parse_color $data($tag:col0)]
! bluebox_draw $canvas ${tag}BASE $x1 $y1 $xs $ys $ins $outs $colour
io_draw $canvas $tag $x1 $y1 $xs $ys $ins $outs
if {$isnew} {
--- 455,459 ----
set outs [expr [string compare $data($tag:snd) empty]==0]
set colour [parse_color $data($tag:col0)]
! bluebox_draw $canvas $tag $x1 $y1 $xs $ys $ins $outs $colour
io_draw $canvas $tag $x1 $y1 $xs $ys $ins $outs
if {$isnew} {
***************
*** 447,451 ****
proc bang_erase {canvas tag} {
! bluebox_erase $canvas ${tag}BASE
io_erase $canvas $tag
$canvas delete ${tag}BUT ${tag}LABEL
--- 473,477 ----
proc bang_erase {canvas tag} {
! bluebox_erase $canvas $tag
io_erase $canvas $tag
$canvas delete ${tag}BUT ${tag}LABEL
***************
*** 464,468 ****
set isnew [expr [llength [$canvas gettags ${tag}BASE]] == 0]
set colour [parse_color $data($tag:col0)]
! bluebox_draw $canvas ${tag}BASE $x1 $y1 $xs $ys $ins $outs $colour
io_draw $canvas $tag $x1 $y1 $xs $ys $ins $outs
set w 1
--- 490,494 ----
set isnew [expr [llength [$canvas gettags ${tag}BASE]] == 0]
set colour [parse_color $data($tag:col0)]
! bluebox_draw $canvas ${tag} $x1 $y1 $xs $ys $ins $outs $colour
io_draw $canvas $tag $x1 $y1 $xs $ys $ins $outs
set w 1
***************
*** 496,500 ****
proc toggle_erase {canvas tag} {
! bluebox_erase $canvas ${tag}BASE
io_erase $canvas $tag
$canvas delete ${tag}BUT ${tag}LABEL
--- 522,526 ----
proc toggle_erase {canvas tag} {
! bluebox_erase $canvas $tag
io_erase $canvas $tag
$canvas delete ${tag}BUT ${tag}LABEL
***************
*** 513,516 ****
set isnew [expr [llength [$canvas gettags ${tag}BASE]] == 0]
set colour [parse_color $data($tag:col0)]
! bluebox_draw $tag $canvas ${tag}BASE $x1 $y1 $xs $ys $ins $outs $colour
}
--- 539,542 ----
set isnew [expr [llength [$canvas gettags ${tag}BASE]] == 0]
set colour [parse_color $data($tag:col0)]
! bluebox_draw $tag $canvas ${tag} $x1 $y1 $xs $ys $ins $outs $colour
}