Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2365
Modified Files:
Tag: devel_0_39
desire.c
Log Message:
messagebox: added support for addcomma, addsemi, adddollar, adddollarsym.
messagebox: update gui when content is changed by messages.
Index: desire.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v
retrieving revision 1.1.2.102
retrieving revision 1.1.2.103
diff -C2 -d -r1.1.2.102 -r1.1.2.103
*** desire.c 13 Aug 2006 05:00:34 -0000 1.1.2.102
--- desire.c 16 Aug 2006 17:28:43 -0000 1.1.2.103
***************
*** 140,148 ****
t_appendix *d = self->g_adix;
int i;
if (!d) {post("gobj_changed3: no appendix in %p",self); return;}
for (i=0; i<d->nobs; i++) {
t_gobj *obs = d->obs[i];
t_notice ice = obs->g_pd->c_notice;
- //printf("obs=%lx\n",(long)obs);
if (ice) ice(obs,origin,argc,argv);
else post("null func ptr for class %s",self->g_pd->c_name->s_name);
--- 140,148 ----
t_appendix *d = self->g_adix;
int i;
+ //printf("gobj_changed3 self=%lx origin=%lx\n",(long)self,(long)origin);
if (!d) {post("gobj_changed3: no appendix in %p",self); return;}
for (i=0; i<d->nobs; i++) {
t_gobj *obs = d->obs[i];
t_notice ice = obs->g_pd->c_notice;
if (ice) ice(obs,origin,argc,argv);
else post("null func ptr for class %s",self->g_pd->c_name->s_name);
***************
*** 298,302 ****
canvas_list = x;
if (x->gl_havewindow || x->gl_willvis) {
- post("subscribe %lx",(long)x);
gobj_subscribe((t_gobj *)x,(t_gobj *)manager);
gobj_changed(x,0);
--- 298,301 ----
***************
*** 855,859 ****
canvas_reflecttitle(x);
x->gl_havewindow = 1;
- post("******subscribe %lx",(long)x);
gobj_subscribe((t_gobj *)x,(t_gobj *)manager);
gobj_changed(x,0);
--- 854,857 ----
***************
*** 862,867 ****
int i;
t_canvas *x2;
! post("subscribe %lx",(long)x);
! gobj_subscribe((t_gobj *)x,(t_gobj *)manager);
if (!x->gl_havewindow) {
/* bug workaround -- a graph in a visible patch gets "invised"
--- 860,864 ----
int i;
t_canvas *x2;
! gobj_subscribe((t_gobj *)x,(t_gobj *)manager); /* why this, if it's supposed to be invisible? */
if (!x->gl_havewindow) {
/* bug workaround -- a graph in a visible patch gets "invised"
***************
*** 877,883 ****
if (glist_isvisible(x)) canvas_map(x, 0);
canvas_create_editor(x, 0);
- sys_vgui("destroy .x%lx\n", (long)x); // huh?
i=1; for (x2=x; x2; x2=x2->gl_next) i++;
- sys_vgui(".mbar.find delete %d\n", i); // huh???
/* if we're a graph on our parent, and if the parent exists
and is visible, show ourselves on parent. */
--- 874,878 ----
***************
*** 5083,5086 ****
--- 5078,5082 ----
if (rt)
rtext_retext(rt);
+ gobj_changed(y,0);
}
}
***************
*** 10829,10832 ****
--- 10825,10860 ----
}
+ static void message_addcomma(t_message *x)
+ {
+ t_atom a;
+ SETCOMMA(&a);
+ binbuf_add(x->m_text.te_binbuf, 1, &a);
+ glist_retext(x->m_glist, &x->m_text);
+ }
+
+ static void message_addsemi(t_message *x)
+ {
+ message_add(x, 0, 0, 0);
+ }
+
+ static void message_adddollar(t_message *x, t_floatarg f)
+ {
+ t_atom a;
+ int n = f;
+ if (n < 0)
+ n = 0;
+ SETDOLLAR(&a, n);
+ binbuf_add(x->m_text.te_binbuf, 1, &a);
+ glist_retext(x->m_glist, &x->m_text);
+ }
+
+ static void message_adddollsym(t_message *x, t_symbol *s)
+ {
+ t_atom a;
+ SETDOLLSYM(&a, s);
+ binbuf_add(x->m_text.te_binbuf, 1, &a);
+ glist_retext(x->m_glist, &x->m_text);
+ }
+
void canvas_msg(t_glist *gl, t_symbol *s, int argc, t_atom *argv)
{
***************
*** 11275,11278 ****
--- 11303,11307 ----
str[argc-1]=0;
text_setto(o,x,str,argc-1);
+ gobj_changed(x,0);
}
***************
*** 11327,11330 ****
--- 11356,11363 ----
class_addmethod3(c, message_add, "add","*");
class_addmethod3(c, message_add2,"add2","*");
+ class_addmethod3(c, message_addcomma, "addcomma", "");
+ class_addmethod3(c, message_addsemi, "addsemi", "");
+ class_addmethod3(c, message_adddollar, "adddollar", "f");
+ class_addmethod3(c, message_adddollsym, "adddollsym","s");
c = gatom_class = class_new(gensym("gatom"), 0, (t_method)gatom_free,