Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17158
Modified Files: Tag: impd_0_37 g_all_guis.h g_all_guis.c g_text.c u_main.tk u_object.tk Log Message: removing t_iemgui's x_selected
Index: g_text.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_text.c,v retrieving revision 1.1.1.4.2.2.2.15 retrieving revision 1.1.1.4.2.2.2.16 diff -C2 -d -r1.1.1.4.2.2.2.15 -r1.1.1.4.2.2.2.16 *** g_text.c 3 May 2004 02:57:27 -0000 1.1.1.4.2.2.2.15 --- g_text.c 12 May 2004 09:58:11 -0000 1.1.1.4.2.2.2.16 *************** *** 232,244 **** 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,242 ---- 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) { *************** *** 359,396 **** } t_gatom;
! /* prepend "-" as necessary to avoid empty strings, so we can ! use them in Pd messages. A more complete solution would be ! to introduce some quoting mechanism; but then we'd be much more ! complicated. */ static t_symbol *gatom_escapit(t_symbol *s) { ! if (!*s->s_name) ! return (gensym("-")); ! else if (*s->s_name == '-') ! { ! char shmo[100]; ! shmo[0] = '-'; ! strncpy(shmo+1, s->s_name, 99); ! shmo[99] = 0; ! return (gensym(shmo)); } ! else return (iemgui_dollar2raute(s)); }
! /* undo previous operation: strip leading "-" if found. */ static t_symbol *gatom_unescapit(t_symbol *s) ! { ! if (*s->s_name == '-') ! return (gensym(s->s_name+1)); ! else return (iemgui_raute2dollar(s)); ! } ! ! #if 0 /* ??? */ ! /* expand leading $0, $1, etc. in the symbol */ ! static t_symbol *gatom_realizedollar(t_gatom *x, t_symbol *s) ! { ! return (canvas_realizedollar(x->a_glist, s)); ! } ! #endif
static void gatom_set(t_gatom *x, t_symbol *s, int argc, t_atom *argv) --- 357,379 ---- } t_gatom;
! /* prepend "-" as necessary to avoid empty strings, so we can ! use them in Pd messages. A more complete solution would be ! to introduce some quoting mechanism; but then we'd be much more ! complicated. */ static t_symbol *gatom_escapit(t_symbol *s) { ! if (!*s->s_name) return gensym("-"); ! else if (*s->s_name == '-') { ! char b[100]; ! snprintf(b,100,"-%s",s->s_name); ! b[99] = 0; ! return gensym(b); } ! else return s; }
! /* undo previous operation: strip leading "-" if found. */ static t_symbol *gatom_unescapit(t_symbol *s) ! {return *s->s_name=='-' ? gensym(s->s_name+1) : s;}
static void gatom_set(t_gatom *x, t_symbol *s, int argc, t_atom *argv) *************** *** 474,489 **** if (x->a_atom.a_type == A_FLOAT) { if (x->a_shift) - { - double nval = x->a_atom.a_w.w_float - 0.01 * dy; - double trunc = 0.01 * (floor(100. * nval + 0.5)); - if (trunc < nval + 0.0001 && trunc > nval - 0.0001) nval = trunc; gatom_clipfloat(x, nval); - } else { - double nval = x->a_atom.a_w.w_float - dy; - double trunc = 0.01 * (floor(100. * nval + 0.5)); - if (trunc < nval + 0.0001 && trunc > nval - 0.0001) nval = trunc; trunc = floor(nval + 0.5); if (trunc < nval + 0.001 && trunc > nval - 0.001) nval = trunc; --- 457,467 ---- if (x->a_atom.a_type == A_FLOAT) { + double nval = x->a_atom.a_w.w_float - (x->a_shift?0.01:1.0) * dy; + double trunc = 0.01*floor(100.*nval+0.5); + if (trunc < nval + 0.0001 && trunc > nval - 0.0001) nval = trunc; if (x->a_shift) gatom_clipfloat(x, nval); else { trunc = floor(nval + 0.5); if (trunc < nval + 0.001 && trunc > nval - 0.001) nval = trunc; *************** *** 605,630 **** outlet_free(x->a_text.te_outlet); } ! if (draglo >= draghi) ! draglo = draghi = 0; x->a_draglo = draglo; x->a_draghi = draghi; ! if (width < 0) ! width = 4; ! else if (width > 80) ! width = 80; x->a_text.te_width = width; x->a_wherelabel = ((int)wherelabel & 3); x->a_label = label; if (*x->a_symfrom->s_name) ! pd_unbind(&x->a_text.te_pd, ! canvas_realizedollar(x->a_glist, x->a_symfrom)); x->a_symfrom = symfrom; if (*x->a_symfrom->s_name) ! pd_bind(&x->a_text.te_pd, ! canvas_realizedollar(x->a_glist, x->a_symfrom)); x->a_symto = symto; x->a_expanded_to = canvas_realizedollar(x->a_glist, x->a_symto); gobj_vis(&x->a_text.te_g, x->a_glist, 1); - /* glist_retext(x->a_glist, &x->a_text); */ } --- 583,602 ---- outlet_free(x->a_text.te_outlet); } ! if (draglo >= draghi) draglo = draghi = 0; x->a_draglo = draglo; x->a_draghi = draghi; ! if (width < 0) width = 4; ! else if (width > 80) width = 80; x->a_text.te_width = width; x->a_wherelabel = ((int)wherelabel & 3); x->a_label = label; if (*x->a_symfrom->s_name) ! pd_unbind(&x->a_text.te_pd, canvas_realizedollar(x->a_glist, x->a_symfrom)); x->a_symfrom = symfrom; if (*x->a_symfrom->s_name) ! pd_bind(&x->a_text.te_pd, canvas_realizedollar(x->a_glist, x->a_symfrom)); x->a_symto = symto; x->a_expanded_to = canvas_realizedollar(x->a_glist, x->a_symto); gobj_vis(&x->a_text.te_g, x->a_glist, 1); /* glist_retext(x->a_glist, &x->a_text); */ } *************** *** 771,776 **** { if (*x->a_symfrom->s_name) ! pd_unbind(&x->a_text.te_pd, ! canvas_realizedollar(x->a_glist, x->a_symfrom)); gfxstub_deleteforkey(x); } --- 743,747 ---- { if (*x->a_symfrom->s_name) ! pd_unbind(&x->a_text.te_pd, canvas_realizedollar(x->a_glist, x->a_symfrom)); gfxstub_deleteforkey(x); } *************** *** 866,873 **** t_rtext *y = glist_findrtext(glist, x); rtext_select(y, state); ! if (glist_isvisible(glist) && text_shouldvis(x, glist)) { ! sys_vgui("%s_select %x .x%x.c %d\n", text_classname(x), x, ! glist_getcanvas(glist), state); ! } }
--- 837,842 ---- t_rtext *y = glist_findrtext(glist, x); rtext_select(y, state); ! if (glist_isvisible(glist) && text_shouldvis(x, glist)) ! sys_vgui("canvas_select_object .x%x.c %x %d\n", glist_getcanvas(glist), x, state); }
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.33 retrieving revision 1.1.1.4.2.4.2.34 diff -C2 -d -r1.1.1.4.2.4.2.33 -r1.1.1.4.2.4.2.34 *** g_all_guis.c 12 May 2004 09:20:25 -0000 1.1.1.4.2.4.2.33 --- g_all_guis.c 12 May 2004 09:58:11 -0000 1.1.1.4.2.4.2.34 *************** *** 171,175 ****
void iemgui_select(t_gobj *z, t_glist *glist, int selected) ! {t_iemgui *x = (t_iemgui *)z; x->x_selected = selected; x->x_draw(z, glist, IEM_GUI_DRAW_MODE_SELECT);}
void iemgui_delete(t_gobj *z, t_glist *glist) --- 171,175 ----
void iemgui_select(t_gobj *z, t_glist *glist, int selected) ! {t_iemgui *x = (t_iemgui *)z; sys_vgui("canvas_select_object .x%x %x %d; ",glist,z,selected); x->x_draw(z,glist,0);}
void iemgui_delete(t_gobj *z, t_glist *glist) *************** *** 351,355 **** x->x_fontsize = 8; x->x_put_in2out = 1; ! x->x_selected = x->x_lin0_log1 = 0; x->x_snd = 0; x->x_rcv = 0; --- 351,355 ---- x->x_fontsize = 8; x->x_put_in2out = 1; ! x->x_lin0_log1 = 0; x->x_snd = 0; x->x_rcv = 0; *************** *** 366,371 **** if (mode==IEM_GUI_DRAW_MODE_ERASE) sys_mgui(x,"erase",""); - else if (mode==IEM_GUI_DRAW_MODE_SELECT) - sys_mgui(x,"select","i",x->x_selected); else { pd_upload((t_gobj *)x,glist); --- 366,369 ----
Index: g_all_guis.h =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_all_guis.h,v retrieving revision 1.1.1.4.2.2.2.28 retrieving revision 1.1.1.4.2.2.2.29 diff -C2 -d -r1.1.1.4.2.2.2.28 -r1.1.1.4.2.2.2.29 *** g_all_guis.h 12 May 2004 09:20:26 -0000 1.1.1.4.2.2.2.28 --- g_all_guis.h 12 May 2004 09:58:11 -0000 1.1.1.4.2.2.2.29 *************** *** 22,26 **** int x_ldx, x_ldy; int x_isa; /* bit 0: loadinit; bit 20: scale */ ! unsigned x_selected:1,x_put_in2out:1,x_lin0_log1:1; int x_font_style, x_fontsize; int x_fcol, x_bcol, x_lcol; /* foreground, background, label colors */ --- 22,26 ---- int x_ldx, x_ldy; int x_isa; /* bit 0: loadinit; bit 20: scale */ ! unsigned x_put_in2out:1,x_lin0_log1:1; int x_font_style, x_fontsize; int x_fcol, x_bcol, x_lcol; /* foreground, background, label colors */
Index: u_object.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/u_object.tk,v retrieving revision 1.1.2.41 retrieving revision 1.1.2.42 diff -C2 -d -r1.1.2.41 -r1.1.2.42 *** u_object.tk 10 May 2004 12:14:46 -0000 1.1.2.41 --- u_object.tk 12 May 2004 09:58:12 -0000 1.1.2.42 *************** *** 265,275 **** set _($self:clickeditevent) objectbox_clickedit set _($self:clickevent) objectbox_click ! } ! ! proc objectbox_select {self canvas flag} { ! global look ! if {$flag} {set colour $look(objectframe4)} {set colour $look(objectframe3)} ! $canvas itemconfigure ${self}BASE -outline $colour ! canvas_select_object $canvas $self $flag }
--- 265,270 ---- set _($self:clickeditevent) objectbox_clickedit set _($self:clickevent) objectbox_click ! if {[canvas_isselected $canvas $self]} {set frcol $look(objectframe4)} {set frcol $look(objectframe3)} ! $canvas itemconfigure ${self}BASE -outline $frcol }
*************** *** 292,304 **** }
- #proc brokenbox_select {self canvas flag} { - # global look - # if {$flag} {set colour #ff0000} {set colour $look(objectframe3)} - # $canvas itemconfigure ${self}BASE -outline $colour - # canvas_select_object $canvas $self $flag - #} - - proc brokenbox_select {self canvas flag} {objectbox_select $self $canvas $flag} - proc brokenbox_erase {self canvas} {objectbox_erase $self $canvas}
--- 287,290 ---- *************** *** 317,327 **** } io_draw $self $canvas $x1 $y1 $xs $ys $ins $outs ! } ! ! proc message_select {self canvas flag} { ! global look ! if {$flag} {set colour $look(objectframe4)} {set colour $look(objectframe3)} ! $canvas itemconfigure ${self}BASE -outline $colour ! canvas_select_object $canvas $self $flag }
--- 303,308 ---- } io_draw $self $canvas $x1 $y1 $xs $ys $ins $outs ! if {[canvas_isselected $canvas $self]} {set frcol $look(objectframe4)} {set frcol $look(objectframe3)} ! $canvas itemconfigure ${self}BASE -outline $frcol }
*************** *** 361,371 **** } io_draw $self $canvas $x1 $y1 $xs $ys $ins $outs ! } ! ! proc atom_select {self canvas flag} { ! global look ! if {$flag} {set colour $look(objectframe4)} {set colour $look(objectframe3)} ! $canvas itemconfigure ${self}BASE -outline $colour ! canvas_select_object $canvas $self $flag }
--- 342,347 ---- } io_draw $self $canvas $x1 $y1 $xs $ys $ins $outs ! if {[canvas_isselected $canvas $self]} {set frcol $look(objectframe4)} {set frcol $look(objectframe3)} ! $canvas itemconfigure ${self}BASE -outline $frcol }
*************** *** 421,432 **** set _($self:motionevent) numbox_motion set _($self:unclickevent) numbox_unclick ! } ! ! proc numbox_select {self canvas flag} { ! global look ! if {$flag==1} {set colour $look(objectframe4)} {set colour $look(objectframe3)} ! $canvas itemconfigure ${self}BASE -outline $colour ! label_select $self $canvas ! canvas_select_object $canvas $self $flag }
--- 397,402 ---- set _($self:motionevent) numbox_motion set _($self:unclickevent) numbox_unclick ! if {[canvas_isselected $canvas $self]} {set frcol $look(objectframe4)} {set frcol $look(objectframe3)} ! $canvas itemconfigure ${self}BASE -outline $frcol }
*************** *** 547,551 ****
proc bluebox_draw {self canvas x1 y1 xs ys ins outs} { ! global _ set x2 [expr $x1+$xs] set y2 [expr $y1+$ys] --- 517,521 ----
proc bluebox_draw {self canvas x1 y1 xs ys ins outs} { ! global _ look set x2 [expr $x1+$xs] set y2 [expr $y1+$ys] *************** *** 566,576 **** } io_draw $self $canvas $x1 $y1 $xs $ys $ins $outs ! } ! ! proc bluebox_select {self canvas flag} { ! global look ! if {$flag} {set colour $look(objectframe4)} {set colour $look(objectframe3)} ! $canvas itemconfigure ${self}BASE -outline $colour ! canvas_select_object $canvas $self $flag }
--- 536,541 ---- } io_draw $self $canvas $x1 $y1 $xs $ys $ins $outs ! if {[canvas_isselected $canvas $self]} {set frcol $look(objectframe4)} {set frcol $look(objectframe3)} ! $canvas itemconfigure ${self}BASE -outline $frcol }
Index: u_main.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/u_main.tk,v retrieving revision 1.1.1.4.2.7.4.69 retrieving revision 1.1.1.4.2.7.4.70 diff -C2 -d -r1.1.1.4.2.7.4.69 -r1.1.1.4.2.7.4.70 *** u_main.tk 11 May 2004 23:04:47 -0000 1.1.1.4.2.7.4.69 --- u_main.tk 12 May 2004 09:58:11 -0000 1.1.1.4.2.7.4.70 *************** *** 576,579 **** --- 576,586 ---- }
+ proc canvas_isselected {canvas member} { + global _ + set self [canvastosym $canvas] + set i [lsearch $_($self:selection) $member] + return [expr $i>=0] + } + #########
*************** *** 839,843 **** #the name of the canvas object in Pd. proc canvastosym {name} { ! string range $name 0 [expr [string length $name] - 3] }
--- 846,851 ---- #the name of the canvas object in Pd. proc canvastosym {name} { ! regsub {.c$} $name "" name ! return $name }