Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19254
Modified Files:
Tag: impd_0_37
g_all_guis.c g_bang.c g_editor.c g_hdial.c g_hslider.c
g_mycanvas.c g_numbox.c g_text.c g_toggle.c g_vumeter.c
u_main.tk u_object.tk
Log Message:
more gui changes (more gop fixes)
Index: g_toggle.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_toggle.c,v
retrieving revision 1.1.1.3.2.2.2.9
retrieving revision 1.1.1.3.2.2.2.10
diff -C2 -d -r1.1.1.3.2.2.2.9 -r1.1.1.3.2.2.2.10
*** g_toggle.c 3 Apr 2004 23:10:26 -0000 1.1.1.3.2.2.2.9
--- g_toggle.c 7 Apr 2004 03:17:40 -0000 1.1.1.3.2.2.2.10
***************
*** 198,205 ****
x->x_gui.x_ldx = ldx;
x->x_gui.x_ldy = ldy;
! if(fs < 4) fs = 4;
x->x_gui.x_fontsize = fs;
! x->x_gui.x_w = iemgui_clip_size(a);
! x->x_gui.x_h = x->x_gui.x_w;
iemgui_all_colfromload(&x->x_gui, bflcol);
iemgui_verify_snd_ne_rcv(&x->x_gui);
--- 198,204 ----
x->x_gui.x_ldx = ldx;
x->x_gui.x_ldy = ldy;
! x->x_gui.x_fontsize = MAX(fs,4);
x->x_gui.x_fontsize = fs;
! x->x_gui.x_h = x->x_gui.x_w = iemgui_clip_size(a);
iemgui_all_colfromload(&x->x_gui, bflcol);
iemgui_verify_snd_ne_rcv(&x->x_gui);
Index: g_text.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_text.c,v
retrieving revision 1.1.1.4.2.2.2.9
retrieving revision 1.1.1.4.2.2.2.10
diff -C2 -d -r1.1.1.4.2.2.2.9 -r1.1.1.4.2.2.2.10
*** g_text.c 3 Apr 2004 23:10:26 -0000 1.1.1.4.2.2.2.9
--- g_text.c 7 Apr 2004 03:17:40 -0000 1.1.1.4.2.2.2.10
***************
*** 16,19 ****
--- 16,20 ----
#include <string.h>
#include <math.h>
+ #include "g_all_guis.h"
static t_class *text_class, *message_class, *gatom_class;
***************
*** 105,113 ****
}
else x = 0;
! if (!x)
! {
! /* LATER make the color reflect this */
! x = (t_text *)pd_new(text_class);
! }
x->te_binbuf = b;
x->te_xpix = xpix;
--- 106,110 ----
}
else x = 0;
! if (!x) x = (t_text *)pd_new(text_class);
x->te_binbuf = b;
x->te_xpix = xpix;
***************
*** 118,122 ****
if (selected)
{
! /* this is called if we've been created from the menu. */
glist_select(gl, &x->te_g);
gobj_activate(&x->te_g, gl, 1);
--- 115,119 ----
if (selected)
{
! /* this is called if we've been created from the menu. */
glist_select(gl, &x->te_g);
gobj_activate(&x->te_g, gl, 1);
***************
*** 287,293 ****
if (glist_isvisible(x->m_glist))
{
- 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);
}
--- 284,289 ----
if (glist_isvisible(x->m_glist))
{
sys_vgui(".x%x.c itemconfigure %sBASE -width 5\n",
! glist_getcanvas(x->m_glist), x);
clock_delay(x->m_clock, 120);
}
***************
*** 298,304 ****
if (glist_isvisible(x->m_glist))
{
- 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));
}
}
--- 294,299 ----
if (glist_isvisible(x->m_glist))
{
sys_vgui(".x%x.c itemconfigure %sBASE -width 1\n",
! glist_getcanvas(x->m_glist), x);
}
}
***************
*** 673,677 ****
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);
}
--- 668,671 ----
***************
*** 808,817 ****
case T_OBJECT:
/* if (x->te_g.g_pd==text_class && glist_findrtext(glist, x)->x_active) { */
! if (x->te_g.g_pd==text_class) {
! return "brokenbox";
! } else {
! return "objectbox";
! }
! /* case T_OBJECT: return "objectbox"; */
case T_MESSAGE: return "message";
case T_ATOM: return "atom";
--- 802,806 ----
case T_OBJECT:
/* if (x->te_g.g_pd==text_class && glist_findrtext(glist, x)->x_active) { */
! return x->te_g.g_pd==text_class ? "brokenbox" : "objectbox";
case T_MESSAGE: return "message";
case T_ATOM: return "atom";
***************
*** 863,868 ****
}
! static void text_displace(t_gobj *z, t_glist *glist,
! int dx, int dy)
{
t_text *x = (t_text *)z;
--- 852,856 ----
}
! static void text_displace(t_gobj *z, t_glist *glist, int dx, int dy)
{
t_text *x = (t_text *)z;
***************
*** 885,889 ****
rtext_select(y, state);
if (glist_isvisible(glist) && text_shouldvis(x, glist)) {
! sys_vgui("%s_select %s .x%x.c %d\n", text_classname(x), rtext_gettag(y),
glist_getcanvas(glist), state);
}
--- 873,877 ----
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);
}
***************
*** 922,926 ****
if (x->te_type == T_ATOM)
glist_retext(glist, x);
! text_drawborder(x, glist_getcanvas(glist), rtext_gettag(y),
rtext_width(y), rtext_height(y), 1);
rtext_draw(y);
--- 910,914 ----
if (x->te_type == T_ATOM)
glist_retext(glist, x);
! text_drawborder(x, glist, rtext_gettag(y),
rtext_width(y), rtext_height(y), 1);
rtext_draw(y);
***************
*** 1010,1016 ****
t==A_FLOAT ? gensym("floatatom") :
gensym("BOOM");
- t_symbol *label = gatom_escapit(((t_gatom *)x)->a_label);
- t_symbol *symfrom = gatom_escapit(((t_gatom *)x)->a_symfrom);
- t_symbol *symto = gatom_escapit(((t_gatom *)x)->a_symto);
binbuf_addv(b, "ssiiifffsss", gensym("#X"), sel,
(t_int)x->te_xpix, (t_int)x->te_ypix, (t_int)x->te_width,
--- 998,1001 ----
***************
*** 1018,1022 ****
(double)((t_gatom *)x)->a_draghi,
(double)((t_gatom *)x)->a_wherelabel,
! label, symfrom, symto);
binbuf_addv(b, ";");
}
--- 1003,1009 ----
(double)((t_gatom *)x)->a_draghi,
(double)((t_gatom *)x)->a_wherelabel,
! gatom_escapit(((t_gatom *)x)->a_label),
! gatom_escapit(((t_gatom *)x)->a_symfrom),
! gatom_escapit(((t_gatom *)x)->a_symto));
binbuf_addv(b, ";");
}
***************
*** 1055,1070 ****
/* -------------------- the "text" class ------------ */
- #ifdef MACOSX
- #define EXTRAPIX 2
- #else
- #define EXTRAPIX 1
- #endif
-
/* draw inlets and outlets for a text object or for a graph. */
void glist_drawiofor(t_glist *glist, t_object *ob, int firsttime,
char *tag, int x1, int y1, int x2, int y2)
{
! sys_vgui("io_draw %s .x%x.c %d %d %d %d %d %d\n",
! tag, glist_getcanvas(glist), x1, y1, x2-x1, y2-x1,
obj_ninlets(ob), obj_noutlets(ob));
}
--- 1042,1051 ----
/* -------------------- the "text" class ------------ */
/* draw inlets and outlets for a text object or for a graph. */
void glist_drawiofor(t_glist *glist, t_object *ob, int firsttime,
char *tag, int x1, int y1, int x2, int y2)
{
! sys_vgui("io_draw %x .x%x.c %d %d %d %d %d %d\n",
! ob, glist_getcanvas(glist), x1, y1, x2-x1, y2-x1,
obj_ninlets(ob), obj_noutlets(ob));
}
***************
*** 1124,1127 ****
--- 1105,1109 ----
int xwas = x->te_xpix, ywas = x->te_ypix;
glist_delete(glist, &x->te_g);
+ text_eraseborder(x, glist, 0);
canvas_objtext(glist, xwas, ywas, 0, b);
/* if it's an abstraction loadbang it here */
***************
*** 1154,1163 ****
class_addmethod(message_class, (t_method)message_click, gensym("click"),
A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0);
! class_addmethod(message_class, (t_method)message_set, gensym("set"),
! A_GIMME, 0);
! class_addmethod(message_class, (t_method)message_add, gensym("add"),
! A_GIMME, 0);
! class_addmethod(message_class, (t_method)message_add2, gensym("add2"),
! A_GIMME, 0);
messresponder_class = class_new(gensym("messresponder"), 0, 0,
--- 1136,1142 ----
class_addmethod(message_class, (t_method)message_click, gensym("click"),
A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0);
! class_addmethod(message_class, (t_method)message_set, gensym("set"), A_GIMME, 0);
! class_addmethod(message_class, (t_method)message_add, gensym("add"), A_GIMME, 0);
! class_addmethod(message_class, (t_method)message_add2, gensym("add2"),A_GIMME, 0);
messresponder_class = class_new(gensym("messresponder"), 0, 0,
***************
*** 1174,1183 ****
class_addfloat(gatom_class, gatom_float);
class_addsymbol(gatom_class, gatom_symbol);
! class_addmethod(gatom_class, (t_method)gatom_set, gensym("set"),
! A_GIMME, 0);
class_addmethod(gatom_class, (t_method)gatom_click, gensym("click"),
A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0);
! class_addmethod(gatom_class, (t_method)gatom_param, gensym("param"),
! A_GIMME, 0);
class_setwidget(gatom_class, &gatom_widgetbehavior);
class_setpropertiesfn(gatom_class, gatom_properties);
--- 1153,1160 ----
class_addfloat(gatom_class, gatom_float);
class_addsymbol(gatom_class, gatom_symbol);
! class_addmethod(gatom_class, (t_method)gatom_set, gensym("set"), A_GIMME, 0);
class_addmethod(gatom_class, (t_method)gatom_click, gensym("click"),
A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0);
! class_addmethod(gatom_class, (t_method)gatom_param, gensym("param"), A_GIMME, 0);
class_setwidget(gatom_class, &gatom_widgetbehavior);
class_setpropertiesfn(gatom_class, gatom_properties);
Index: g_hdial.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_hdial.c,v
retrieving revision 1.1.1.4.2.2.2.9
retrieving revision 1.1.1.4.2.2.2.10
diff -C2 -d -r1.1.1.4.2.2.2.9 -r1.1.1.4.2.2.2.10
*** g_hdial.c 30 Mar 2004 01:35:09 -0000 1.1.1.4.2.2.2.9
--- g_hdial.c 7 Apr 2004 03:17:40 -0000 1.1.1.4.2.2.2.10
***************
*** 42,45 ****
--- 42,46 ----
} else {
pd_upload((t_gobj *)x);
+ pd_upload2((t_gobj *)x,glist);
sys_mgui((t_iemgui *)x,"radio","draw","");
sys_mgui((t_iemgui *)x,"radio","set","i",x->x_on);
***************
*** 67,72 ****
iemgui_save(&x->x_gui, srl, bflcol);
binbuf_addv(b, "ssiisiiiisssiiiiiiii", gensym("#X"),gensym("obj"),
! (t_int)text_xpix(&x->x_gui.x_obj, x->x_gui.x_glist),
! (t_int)text_ypix(&x->x_gui.x_obj, x->x_gui.x_glist),
isvert(x) ?
(pd_class(&x->x_gui.x_obj.ob_pd) == hradio_old_class ?
--- 68,72 ----
iemgui_save(&x->x_gui, srl, bflcol);
binbuf_addv(b, "ssiisiiiisssiiiiiiii", gensym("#X"),gensym("obj"),
! (t_int)x->x_gui.x_obj.te_xpix, (t_int)x->x_gui.x_obj.te_ypix,
isvert(x) ?
(pd_class(&x->x_gui.x_obj.ob_pd) == hradio_old_class ?
***************
*** 350,360 ****
x->x_on = x->x_gui.x_isa.x_loadinit ? on : 0;
x->x_on_old = x->x_on;
! x->x_change = (chg==0)?0:1;
if (x->x_gui.x_fsf.x_rcv_able)
pd_bind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv);
x->x_gui.x_ldx = ldx;
x->x_gui.x_ldy = ldy;
! if(fs < 4) fs = 4;
! x->x_gui.x_fontsize = fs;
x->x_gui.x_w = iemgui_clip_size(a);
x->x_gui.x_h = x->x_gui.x_w;
--- 350,359 ----
x->x_on = x->x_gui.x_isa.x_loadinit ? on : 0;
x->x_on_old = x->x_on;
! x->x_change = !! chg;
if (x->x_gui.x_fsf.x_rcv_able)
pd_bind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv);
x->x_gui.x_ldx = ldx;
x->x_gui.x_ldy = ldy;
! x->x_gui.x_fontsize = MAX(fs,4);
x->x_gui.x_w = iemgui_clip_size(a);
x->x_gui.x_h = x->x_gui.x_w;
Index: u_main.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/u_main.tk,v
retrieving revision 1.1.1.4.2.7.4.34
retrieving revision 1.1.1.4.2.7.4.35
diff -C2 -d -r1.1.1.4.2.7.4.34 -r1.1.1.4.2.7.4.35
*** u_main.tk 3 Apr 2004 23:10:26 -0000 1.1.1.4.2.7.4.34
--- u_main.tk 7 Apr 2004 03:17:40 -0000 1.1.1.4.2.7.4.35
***************
*** 625,636 ****
$name.m.edit entryconfigure "Edit mode" -indicatoron false }
- populate_menu $name.m.edit $name {
- {Redraw {pd "%W map 0 ; %W map 1 ;"} {}}
- }
-
menu $name.m.view -tearoff $pd_tearoff
$name.m add cascade -label View -menu $name.m.view
populate_menu $name.m.view $name {
! {hello {} ""}
}
# {Crosshair {global crosshair; set crosshair [expr !!$crosshair]} "" toggle}
--- 625,632 ----
$name.m.edit entryconfigure "Edit mode" -indicatoron false }
menu $name.m.view -tearoff $pd_tearoff
$name.m add cascade -label View -menu $name.m.view
populate_menu $name.m.view $name {
! {Redraw {pd "%W map 0 ; %W map 1 ;"} {}}
}
# {Crosshair {global crosshair; set crosshair [expr !!$crosshair]} "" toggle}
***************
*** 755,760 ****
bind $name.c <Button-5> "$name.c yview scroll +1 units"
}}
! #catch {image create photo mybackground -file "test2.gif"}
! #catch {$name.c create image -6 -39 -anchor nw -image mybackground -tag bg}
#scale $name.bbar.bg -orient horizontal -showvalue false -from 0 -to 255 -command {}
#pack $name.bbar.bg -side right
--- 751,756 ----
bind $name.c <Button-5> "$name.c yview scroll +1 units"
}}
! catch {image create photo mybackground -file "test2.gif"}
! catch {$name.c create image -6 -39 -anchor nw -image mybackground -tag bg}
#scale $name.bbar.bg -orient horizontal -showvalue false -from 0 -to 255 -command {}
#pack $name.bbar.bg -side right
***************
*** 792,796 ****
set tags [$canvas gettags [lindex $stack end]]
puts stderr "(click) $canvas $cx $cy $b $f : $tags "
! if {[regexp {^(?:\.x)?([a-f0-9]{7})} $tags tag]} {
global _
if {[info exists _($tag:class)]} {set class $_($tag:class)} {set class unknown}
--- 788,793 ----
set tags [$canvas gettags [lindex $stack end]]
puts stderr "(click) $canvas $cx $cy $b $f : $tags "
! if {[regexp {^([a-f0-9]{7})} $tags tag] ||
! [regexp {^\.x[a-f0-9]+\.t([a-f0-9]{7})} $tags tag]} {
global _
if {[info exists _($tag:class)]} {set class $_($tag:class)} {set class unknown}
***************
*** 825,829 ****
# x->gl_editor->e_xwas = xpos
# x->gl_editor->e_ywas = ypos
! # wire_draw x .x%x.c %d %d %d %d %d\n", x, (issignal ? 2 : 1), xpos, ypos, xpos, ypos
# } {canvas_setcursor(x, CURSOR_EDITMODE_CONNECT)}
# } {if (doit) goto nooutletafterall}
--- 822,826 ----
# x->gl_editor->e_xwas = xpos
# x->gl_editor->e_ywas = ypos
! # wire_draw x .x%x.c %d %d %d %d %d\n", x, issignal?2:1, xpos, ypos, xpos, ypos
# } {canvas_setcursor(x, CURSOR_EDITMODE_CONNECT)}
# } {if (doit) goto nooutletafterall}
***************
*** 2443,2446 ****
--- 2440,2444 ----
############ tooltips
+ # woops, self is for future use
proc show_canvas_tooltip {self canvas x y text} {
set border 4
***************
*** 2505,2509 ****
set look(objectframe2) #668888
set look(objectframe3) #000000
! set look(objectframe4) #ffaa00
set look(canvasbgrun) #ffffff
set look(canvasbgedit) #dddddd
--- 2503,2507 ----
set look(objectframe2) #668888
set look(objectframe3) #000000
! set look(objectframe4) #00ffff
set look(canvasbgrun) #ffffff
set look(canvasbgedit) #dddddd
Index: g_mycanvas.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_mycanvas.c,v
retrieving revision 1.1.1.3.2.2.2.4
retrieving revision 1.1.1.3.2.2.2.5
diff -C2 -d -r1.1.1.3.2.2.2.4 -r1.1.1.3.2.2.2.5
*** g_mycanvas.c 2 Apr 2004 00:16:43 -0000 1.1.1.3.2.2.2.4
--- g_mycanvas.c 7 Apr 2004 03:17:40 -0000 1.1.1.3.2.2.2.5
***************
*** 304,314 ****
x->x_gui.x_fsf.x_snd_able = strcmp(x->x_gui.x_snd->s_name, "empty")!=0;
x->x_gui.x_fsf.x_rcv_able = strcmp(x->x_gui.x_rcv->s_name, "empty")!=0;
! if(a < 1) a = 1;
! x->x_gui.x_w = a;
! x->x_gui.x_h = x->x_gui.x_w;
! if(w < 1) w = 1;
! x->x_vis_w = w;
! if(h < 1) h = 1;
! x->x_vis_h = h;
iemgui_set_font_style((t_iemgui *)x, x->x_gui.x_fsf.x_font_style);
if (x->x_gui.x_fsf.x_rcv_able)
--- 304,310 ----
x->x_gui.x_fsf.x_snd_able = strcmp(x->x_gui.x_snd->s_name, "empty")!=0;
x->x_gui.x_fsf.x_rcv_able = strcmp(x->x_gui.x_rcv->s_name, "empty")!=0;
! x->x_gui.x_h = x->x_gui.x_w = MAX(a,1);
! x->x_vis_w = MAX(w,1);
! x->x_vis_h = MAX(h,1);
iemgui_set_font_style((t_iemgui *)x, x->x_gui.x_fsf.x_font_style);
if (x->x_gui.x_fsf.x_rcv_able)
***************
*** 316,321 ****
x->x_gui.x_ldx = ldx;
x->x_gui.x_ldy = ldy;
! if(fs < 4) fs = 4;
! x->x_gui.x_fontsize = fs;
iemgui_all_colfromload(&x->x_gui, bflcol);
x->x_at[0].a_type = A_FLOAT;
--- 312,316 ----
x->x_gui.x_ldx = ldx;
x->x_gui.x_ldy = ldy;
! x->x_gui.x_fontsize = MAX(fs,4);
iemgui_all_colfromload(&x->x_gui, bflcol);
x->x_at[0].a_type = A_FLOAT;
***************
*** 334,352 ****
void g_mycanvas_setup(void)
{
! my_canvas_class = class_new(gensym("cnv"), (t_newmethod)my_canvas_new,
(t_method)my_canvas_ff, sizeof(t_my_canvas), CLASS_NOINLET, A_GIMME, 0);
class_addcreator((t_newmethod)my_canvas_new, gensym("my_canvas"), A_GIMME, 0);
! class_addmethod(my_canvas_class, (t_method)my_canvas_dialog, gensym("dialog"), A_GIMME, 0);
! class_addmethod(my_canvas_class, (t_method)my_canvas_size, gensym("size"), A_GIMME, 0);
! class_addmethod(my_canvas_class, (t_method)my_canvas_delta, gensym("delta"), A_GIMME, 0);
! class_addmethod(my_canvas_class, (t_method)my_canvas_pos, gensym("pos"), A_GIMME, 0);
! class_addmethod(my_canvas_class, (t_method)my_canvas_vis_size, gensym("vis_size"), A_GIMME, 0);
! class_addmethod(my_canvas_class, (t_method)my_canvas_color, gensym("color"), A_GIMME, 0);
! class_addmethod(my_canvas_class, (t_method)my_canvas_send, gensym("send"), A_DEFSYM, 0);
! class_addmethod(my_canvas_class, (t_method)my_canvas_receive, gensym("receive"), A_DEFSYM, 0);
! class_addmethod(my_canvas_class, (t_method)my_canvas_label, gensym("label"), A_DEFSYM, 0);
! class_addmethod(my_canvas_class, (t_method)my_canvas_label_pos, gensym("label_pos"), A_GIMME, 0);
! class_addmethod(my_canvas_class, (t_method)my_canvas_label_font, gensym("label_font"), A_GIMME, 0);
! class_addmethod(my_canvas_class, (t_method)my_canvas_get_pos, gensym("get_pos"), 0);
my_canvas_widgetbehavior.w_getrectfn = my_canvas_getrect;
--- 329,347 ----
void g_mycanvas_setup(void)
{
! t_class *c = my_canvas_class = class_new(gensym("cnv"), (t_newmethod)my_canvas_new,
(t_method)my_canvas_ff, sizeof(t_my_canvas), CLASS_NOINLET, A_GIMME, 0);
class_addcreator((t_newmethod)my_canvas_new, gensym("my_canvas"), A_GIMME, 0);
! class_addmethod(c, (t_method)my_canvas_dialog, gensym("dialog"), A_GIMME, 0);
! class_addmethod(c, (t_method)my_canvas_size, gensym("size"), A_GIMME, 0);
! class_addmethod(c, (t_method)my_canvas_delta, gensym("delta"), A_GIMME, 0);
! class_addmethod(c, (t_method)my_canvas_pos, gensym("pos"), A_GIMME, 0);
! class_addmethod(c, (t_method)my_canvas_vis_size, gensym("vis_size"), A_GIMME, 0);
! class_addmethod(c, (t_method)my_canvas_color, gensym("color"), A_GIMME, 0);
! class_addmethod(c, (t_method)my_canvas_send, gensym("send"), A_DEFSYM, 0);
! class_addmethod(c, (t_method)my_canvas_receive, gensym("receive"), A_DEFSYM, 0);
! class_addmethod(c, (t_method)my_canvas_label, gensym("label"), A_DEFSYM, 0);
! class_addmethod(c, (t_method)my_canvas_label_pos, gensym("label_pos"), A_GIMME, 0);
! class_addmethod(c, (t_method)my_canvas_label_font, gensym("label_font"), A_GIMME, 0);
! class_addmethod(c, (t_method)my_canvas_get_pos, gensym("get_pos"), 0);
my_canvas_widgetbehavior.w_getrectfn = my_canvas_getrect;
***************
*** 357,363 ****
my_canvas_widgetbehavior.w_visfn = iemgui_vis;
my_canvas_widgetbehavior.w_clickfn = NULL;
! class_setwidget(my_canvas_class, &my_canvas_widgetbehavior);
! class_sethelpsymbol(my_canvas_class, gensym("my_canvas"));
! class_setsavefn(my_canvas_class, my_canvas_save);
! class_setpropertiesfn(my_canvas_class, my_canvas_properties);
}
--- 352,358 ----
my_canvas_widgetbehavior.w_visfn = iemgui_vis;
my_canvas_widgetbehavior.w_clickfn = NULL;
! class_setwidget(c, &my_canvas_widgetbehavior);
! class_sethelpsymbol(c, gensym("my_canvas"));
! class_setsavefn(c, my_canvas_save);
! class_setpropertiesfn(c, my_canvas_properties);
}
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.15
retrieving revision 1.1.1.4.2.4.2.16
diff -C2 -d -r1.1.1.4.2.4.2.15 -r1.1.1.4.2.4.2.16
*** g_all_guis.c 3 Apr 2004 23:10:25 -0000 1.1.1.4.2.4.2.15
--- g_all_guis.c 7 Apr 2004 03:17:36 -0000 1.1.1.4.2.4.2.16
***************
*** 657,661 ****
c->c_savefn(self,buf);
binbuf_gettext(buf,&s,&n);
! sys_vgui("update_object %x {%s}\n",(unsigned)self,s);
binbuf_free(buf);
free(s);
--- 657,662 ----
c->c_savefn(self,buf);
binbuf_gettext(buf,&s,&n);
! if (s[n-1]=='\n') n--;
! sys_vgui("update_object %x {%.*s}\n",(unsigned)self,n,s);
binbuf_free(buf);
free(s);
***************
*** 675,679 ****
va_list val;
va_start(val,fmt);
! i+=snprintf(buf+i,n-i,"%s_%s %x .x%x.c", qlass?qlass:cname, sel, (unsigned)self, (unsigned)canvas);
if (i>=n) goto over;
while (*fmt) {
--- 676,681 ----
va_list val;
va_start(val,fmt);
! i+=snprintf(buf+i,n-i,"%s_%s %x .x%x.c",
! qlass?qlass:cname, sel, (unsigned)self, (unsigned)canvas);
if (i>=n) goto over;
while (*fmt) {
***************
*** 690,697 ****
--- 692,701 ----
i+=snprintf(buf+i,n-i,"\n");
if (i>=n) goto over;
+ //fprintf(stderr,"%s",buf);
sys_gui(buf);
return;
over:
post("sys_mgui: can't send: buffer overflow");
+ abort();
}
Index: u_object.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/u_object.tk,v
retrieving revision 1.1.2.15
retrieving revision 1.1.2.16
diff -C2 -d -r1.1.2.15 -r1.1.2.16
*** u_object.tk 3 Apr 2004 23:10:27 -0000 1.1.2.15
--- u_object.tk 7 Apr 2004 03:17:40 -0000 1.1.2.16
***************
*** 57,61 ****
global _
global fields
! set d [string trimright $d ";\n"]
set class [lindex $d 4]
if {![info exists fields($class)]} {set class obj}
--- 57,62 ----
global _
global fields
! set d [string trimright $d "\n"]
! set d [string trimright $d ";"]
set class [lindex $d 4]
if {![info exists fields($class)]} {set class obj}
***************
*** 174,177 ****
--- 175,179 ----
$canvas coords ${self}BASE3 $xyc
} {
+ #$canvas create rectangle $xya -tag ${self}SHAD -fill [darker ${look(objectbg)}] -width 0
$canvas create rectangle $xya -tag ${self}BASE -fill ${look(objectbg)}
$canvas create line $xyb -tag ${self}BASE2 -fill ${look(objectframe1)}
***************
*** 192,198 ****
}
! proc brokenbox_draw {self canvas x1 y1 xs ys ins outs} {
! objectbox_draw $self $canvas $x1 $y1 $xs $ys $ins $outs
! $canvas itemconfigure ${self}.l -fill #ffcccc
}
--- 194,200 ----
}
! proc brokenbox_draw {self canvas xs ys ins outs} {
! objectbox_draw $self $canvas $xs $ys $ins $outs
! $canvas itemconfigure ${self}BASE -outline #ff0000
}
***************
*** 305,309 ****
puts "numbox_select $self $canvas $flag"
if {$flag==1} {set colour $look(objectframe4)} {set colour $look(objectframe3)}
! $canvas itemconfigure $self -outline $colour
if {$flag==2} {set colour #00ff00} {set colour $look(objectbg)}
$canvas itemconfigure ${self}BASE4 -fill $colour
--- 307,311 ----
puts "numbox_select $self $canvas $flag"
if {$flag==1} {set colour $look(objectframe4)} {set colour $look(objectframe3)}
! $canvas itemconfigure ${self}BASE -outline $colour
if {$flag==2} {set colour #00ff00} {set colour $look(objectbg)}
$canvas itemconfigure ${self}BASE4 -fill $colour
***************
*** 393,402 ****
}
- proc slider_select {self canvas flag} {
- global look
- if {$flag} {set colour $look(objectframe4)} {set colour $look(objectframe3)}
- $canvas itemconfigure $self -outline $colour
- }
-
proc radio_draw {self canvas} {
global _
--- 395,398 ----
***************
*** 651,663 ****
set x4 [expr $x1+$xs-$xs/4]
global vu_col
if {$isnew} {
! for {set i 0} {$i<=40} {incr i} {
! set y [expr $y1 + ($led_size+1)*(41-$i) - ($led_size+1)/2]
! $canvas create rectangle $x3 $y $x4 [expr $y+$led_size] \
! -fill [parse_color [lindex $vu_col $i]] -tags ${self}RMS -width 0
! }
}
- $canvas create rectangle $x3 $y1 $x4 $y1 -tags ${self}MASK \
- -width 0 -fill $colour
if {!$_($self:scale)} {return}
--- 647,664 ----
set x4 [expr $x1+$xs-$xs/4]
global vu_col
+
+ $canvas delete ${self}RMS
+ for {set i 0} {$i<=40} {incr i} {
+ set y [expr $y1 + ($led_size+1)*(41-$i) - ($led_size+1)/2]
+ $canvas create rectangle $x3 $y $x4 [expr $y+$led_size] \
+ -fill [parse_color [lindex $vu_col $i]] -tags ${self}RMS -width 0
+ }
+
if {$isnew} {
! $canvas create rectangle $x3 $y1 $x4 $y1 -tags ${self}MASK \
! -width 0 -fill $colour
! } {
! $canvas coords ${self}MASK $x3 $y1 $x4 $y1
}
if {!$_($self:scale)} {return}
***************
*** 675,679 ****
set k4 [expr $y1-$k3]
set yyy [expr $k4 + $k1*($k2-4*$i)]
! $canvas create text [expr $x2+4] [expr $yyy+$k3] -text $level -anchor w \
-font $lfont -fill $lcolor -tags ${self}SCALE
incr i
--- 676,680 ----
set k4 [expr $y1-$k3]
set yyy [expr $k4 + $k1*($k2-4*$i)]
! $canvas create text [expr $x2+4] [expr $yyy+$k3-3] -text $level -anchor w \
-font $lfont -fill $lcolor -tags ${self}SCALE
incr i
Index: g_vumeter.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_vumeter.c,v
retrieving revision 1.1.1.3.2.2.2.7
retrieving revision 1.1.1.3.2.2.2.8
diff -C2 -d -r1.1.1.3.2.2.2.7 -r1.1.1.3.2.2.2.8
*** g_vumeter.c 30 Mar 2004 01:35:09 -0000 1.1.1.3.2.2.2.7
--- g_vumeter.c 7 Apr 2004 03:17:40 -0000 1.1.1.3.2.2.2.8
***************
*** 67,70 ****
--- 67,71 ----
} else {
pd_upload((t_gobj *)x);
+ pd_upload2((t_gobj *)x,glist);
sys_mgui((t_iemgui *)x,"vu","draw","");
sys_mgui((t_iemgui *)x,"vu","set","i",x->x_rms);
***************
*** 233,238 ****
x->x_gui.x_ldy = ldy;
! if(fs < 4) fs = 4;
! x->x_gui.x_fontsize = fs;
x->x_gui.x_w = iemgui_clip_size(w);
vu_check_height(x, h);
--- 234,238 ----
x->x_gui.x_ldy = ldy;
! x->x_gui.x_fontsize = MAX(fs,4);
x->x_gui.x_w = iemgui_clip_size(w);
vu_check_height(x, h);
***************
*** 259,264 ****
void g_vumeter_setup(void)
{
! t_class *c = vu_class = class_new(gensym("vu"), (t_newmethod)vu_new, (t_method)vu_free,
! sizeof(t_vu), 0, A_GIMME, 0);
class_addbang(c,vu_bang);
class_addfloat(c,vu_float);
--- 259,264 ----
void g_vumeter_setup(void)
{
! t_class *c = vu_class = class_new(gensym("vu"),
! (t_newmethod)vu_new, (t_method)vu_free, sizeof(t_vu), 0, A_GIMME, 0);
class_addbang(c,vu_bang);
class_addfloat(c,vu_float);
Index: g_editor.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_editor.c,v
retrieving revision 1.1.1.4.2.3.2.10
retrieving revision 1.1.1.4.2.3.2.11
diff -C2 -d -r1.1.1.4.2.3.2.10 -r1.1.1.4.2.3.2.11
*** g_editor.c 3 Apr 2004 23:10:25 -0000 1.1.1.4.2.3.2.10
--- g_editor.c 7 Apr 2004 03:17:39 -0000 1.1.1.4.2.3.2.11
***************
*** 684,689 ****
if (ob->ob_pd->c_firstin) closest--;
text = closest < 0 ? ob->ob_pd->c_firsttip->s_name : inlet_tip(ob->te_inlet,closest);
! sys_vgui(".x%x.c create text %d %d -anchor sw -text \"%d: %s\" -tags y\n",
! x, xpos, ypos-4,inlet,text);
}
--- 684,689 ----
if (ob->ob_pd->c_firstin) closest--;
text = closest < 0 ? ob->ob_pd->c_firsttip->s_name : inlet_tip(ob->te_inlet,closest);
! sys_vgui("show_canvas_tooltip %x .x%x.c %d %d \"%d: %s\"\n",
! ob, x, xpos, ypos-20,inlet,text);
}
***************
*** 1021,1025 ****
if (ob && (noutlet = obj_noutlets(ob)) && ypos >= y2-4)
{
! /* int width = x2-x1;
int nout1 = noutlet>1 ? noutlet-1 : 1;
int closest = ((xpos-x1) * nout1 + width/2)/width;
--- 1021,1025 ----
if (ob && (noutlet = obj_noutlets(ob)) && ypos >= y2-4)
{
! int width = x2-x1;
int nout1 = noutlet>1 ? noutlet-1 : 1;
int closest = ((xpos-x1) * nout1 + width/2)/width;
***************
*** 1039,1043 ****
}
else if (doit) goto nooutletafterall;
- */
}
/* look for an inlet */
--- 1039,1042 ----
***************
*** 1056,1060 ****
t_rtext *rt;
/* check if the box is being text edited */
! /* nooutletafterall:*/
if (ob && (rt = x->gl_editor->e_textedfor) &&
rt == glist_findrtext(x, ob))
--- 1055,1059 ----
t_rtext *rt;
/* check if the box is being text edited */
! nooutletafterall:
if (ob && (rt = x->gl_editor->e_textedfor) &&
rt == glist_findrtext(x, ob))
***************
*** 1385,1390 ****
int mod = fmod;
if (!x->gl_editor) {bug("editor"); return;}
- sys_vgui(".x%x.c delete y\n",x);
-
glist_setlastxy(x, xpos, ypos);
if (x->gl_editor->e_onmotion == MA_MOVE)
--- 1384,1387 ----
Index: g_hslider.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_hslider.c,v
retrieving revision 1.1.1.3.2.2.2.12
retrieving revision 1.1.1.3.2.2.2.13
diff -C2 -d -r1.1.1.3.2.2.2.12 -r1.1.1.3.2.2.2.13
*** g_hslider.c 3 Apr 2004 23:10:26 -0000 1.1.1.3.2.2.2.12
--- g_hslider.c 7 Apr 2004 03:17:40 -0000 1.1.1.3.2.2.2.13
***************
*** 396,401 ****
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;
x->x_gui.x_fsf.x_snd_able = strcmp(x->x_gui.x_snd->s_name, "empty")!=0;
--- 396,400 ----
x->x_val = x->x_gui.x_isa.x_loadinit ? v : 0;
x->x_pos = x->x_val;
! x->x_lin0_log1 = !!lilo;
x->x_steady = steady;
x->x_gui.x_fsf.x_snd_able = strcmp(x->x_gui.x_snd->s_name, "empty")!=0;
***************
*** 405,410 ****
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)) {
x->x_gui.x_w = iemgui_clip_size(w);
--- 404,408 ----
x->x_gui.x_ldx = ldx;
x->x_gui.x_ldy = ldy;
! x->x_gui.x_fontsize = MAX(fs,4);
if (isvert(x)) {
x->x_gui.x_w = iemgui_clip_size(w);
Index: g_bang.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_bang.c,v
retrieving revision 1.1.1.3.2.2.2.12
retrieving revision 1.1.1.3.2.2.2.13
diff -C2 -d -r1.1.1.3.2.2.2.12 -r1.1.1.3.2.2.2.13
*** g_bang.c 3 Apr 2004 23:10:25 -0000 1.1.1.3.2.2.2.12
--- g_bang.c 7 Apr 2004 03:17:39 -0000 1.1.1.3.2.2.2.13
***************
*** 217,224 ****
if (x->x_gui.x_fsf.x_rcv_able)
pd_bind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv);
! if(fs < 4) fs = 4;
! x->x_gui.x_fontsize = fs;
! x->x_gui.x_w = iemgui_clip_size(a);
! x->x_gui.x_h = x->x_gui.x_w;
bng_check_minmax(x, ftbreak, fthold);
iemgui_all_colfromload(&x->x_gui, bflcol);
--- 217,222 ----
if (x->x_gui.x_fsf.x_rcv_able)
pd_bind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv);
! x->x_gui.x_fontsize = MAX(fs,4);
! x->x_gui.x_h = x->x_gui.x_w = iemgui_clip_size(a);
bng_check_minmax(x, ftbreak, fthold);
iemgui_all_colfromload(&x->x_gui, bflcol);
Index: g_numbox.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_numbox.c,v
retrieving revision 1.1.1.4.2.2.2.8
retrieving revision 1.1.1.4.2.2.2.9
diff -C2 -d -r1.1.1.4.2.2.2.8 -r1.1.1.4.2.2.2.9
*** g_numbox.c 30 Mar 2004 01:35:09 -0000 1.1.1.4.2.2.2.8
--- g_numbox.c 7 Apr 2004 03:17:40 -0000 1.1.1.4.2.2.2.9
***************
*** 119,123 ****
sys_mgui((t_iemgui *)x,"numbox","select","i",
(int)x->x_gui.x_fsf.x_selected + 2*(int)x->x_gui.x_fsf.x_change);
! else {pd_upload((t_gobj *)x);
my_numbox_ftoa(x);
sys_mgui((t_iemgui *)x,"numbox","draw","");
--- 119,125 ----
sys_mgui((t_iemgui *)x,"numbox","select","i",
(int)x->x_gui.x_fsf.x_selected + 2*(int)x->x_gui.x_fsf.x_change);
! else {
! pd_upload((t_gobj *)x);
! pd_upload2((t_gobj *)x,glist);
my_numbox_ftoa(x);
sys_mgui((t_iemgui *)x,"numbox","draw","");
***************
*** 474,481 ****
x->x_gui.x_glist = (t_glist *)canvas_getcurrent();
x->x_val = x->x_gui.x_isa.x_loadinit ? v : 0.0;
! if(lilo != 0) lilo = 1;
! x->x_lin0_log1 = lilo;
! if(log_height < 10) log_height = 10;
! x->x_log_height = log_height;
x->x_gui.x_fsf.x_snd_able = strcmp(x->x_gui.x_snd->s_name, "empty")!=0;
x->x_gui.x_fsf.x_rcv_able = strcmp(x->x_gui.x_rcv->s_name, "empty")!=0;
--- 476,481 ----
x->x_gui.x_glist = (t_glist *)canvas_getcurrent();
x->x_val = x->x_gui.x_isa.x_loadinit ? v : 0.0;
! x->x_lin0_log1 = !!lilo;
! x->x_log_height = MAX(log_height,10);
x->x_gui.x_fsf.x_snd_able = strcmp(x->x_gui.x_snd->s_name, "empty")!=0;
x->x_gui.x_fsf.x_rcv_able = strcmp(x->x_gui.x_rcv->s_name, "empty")!=0;
***************
*** 485,494 ****
x->x_gui.x_ldx = ldx;
x->x_gui.x_ldy = ldy;
! if(fs < 4) fs = 4;
! x->x_gui.x_fontsize = fs;
! if(w < 1) w = 1;
! x->x_gui.x_w = w;
! if(h < 8) h = 8;
! x->x_gui.x_h = h;
x->x_buf[0] = 0;
my_numbox_calc_fontwidth(x);
--- 485,491 ----
x->x_gui.x_ldx = ldx;
x->x_gui.x_ldy = ldy;
! x->x_gui.x_fontsize = MAX(fs,4);
! x->x_gui.x_w = MAX(w,1);
! x->x_gui.x_h = MAX(h,8);
x->x_buf[0] = 0;
my_numbox_calc_fontwidth(x);