Commit 3729b1df authored by user's avatar user
Browse files

replaced canvas_tag and obj_tag with more generic 'x' specifier in gui_vmess

parent 07ff4ebe
...@@ -146,6 +146,10 @@ Everything else: (A [*] means we've fixed it) ...@@ -146,6 +146,10 @@ Everything else: (A [*] means we've fixed it)
[ ] change x_x1..y2 to simple x_bbox[4], and change current x_bbox to [ ] change x_x1..y2 to simple x_bbox[4], and change current x_bbox to
x_cachebbox (or something like that) x_cachebbox (or something like that)
[ ] figure out why gatom_retext sends a fill color to GUI [ ] figure out why gatom_retext sends a fill color to GUI
[ ] look into changing 'x' format specifier from \"x%.6lx\" to more generic
\"%.6lx\". (Not exactly sure what good the "x" does there.) It's only
specified in s_inter and in editor_new, so it should be easy to amend
if need be.
Crashers Crashers
-------- --------
...@@ -233,9 +233,9 @@ void iemgui_label(t_iemgui *x, t_symbol *s) ...@@ -233,9 +233,9 @@ void iemgui_label(t_iemgui *x, t_symbol *s)
sys_vgui(".x%lx.c itemconfigure %lxLABEL -text {%s} \n", sys_vgui(".x%lx.c itemconfigure %lxLABEL -text {%s} \n",
glist_getcanvas(x->x_glist), x, glist_getcanvas(x->x_glist), x,
s!=s_empty?x->x_lab->s_name:""); s!=s_empty?x->x_lab->s_name:"");
gui_vmess("gui_iemgui_label_set", "sss", gui_vmess("gui_iemgui_label_set", "xxs",
canvas_tag(glist_getcanvas(x->x_glist)), glist_getcanvas(x->x_glist),
gobj_tag(x), x,
s != s_empty ? x->x_lab->s_name : ""); s != s_empty ? x->x_lab->s_name : "");
iemgui_shouldvis(x, IEM_GUI_DRAW_MODE_CONFIG); iemgui_shouldvis(x, IEM_GUI_DRAW_MODE_CONFIG);
} }
...@@ -251,9 +251,9 @@ void iemgui_label_pos(t_iemgui *x, t_symbol *s, int ac, t_atom *av) ...@@ -251,9 +251,9 @@ void iemgui_label_pos(t_iemgui *x, t_symbol *s, int ac, t_atom *av)
// glist_getcanvas(x->x_glist), x, // glist_getcanvas(x->x_glist), x,
// text_xpix((t_object *)x,x->x_glist)+x->x_ldx, // text_xpix((t_object *)x,x->x_glist)+x->x_ldx,
// text_ypix((t_object *)x,x->x_glist)+x->x_ldy); // text_ypix((t_object *)x,x->x_glist)+x->x_ldy);
gui_vmess("gui_iemgui_label_coords", "ssii", gui_vmess("gui_iemgui_label_coords", "xxii",
canvas_tag(glist_getcanvas(x->x_glist)), glist_getcanvas(x->x_glist),
gobj_tag(x), x,
x->x_ldx, x->x_ldx,
x->x_ldy); x->x_ldy);
iemgui_shouldvis(x, IEM_GUI_DRAW_MODE_CONFIG); iemgui_shouldvis(x, IEM_GUI_DRAW_MODE_CONFIG);
...@@ -270,9 +270,9 @@ void iemgui_label_font(t_iemgui *x, t_symbol *s, int ac, t_atom *av) ...@@ -270,9 +270,9 @@ void iemgui_label_font(t_iemgui *x, t_symbol *s, int ac, t_atom *av)
{ {
//sys_vgui(".x%lx.c itemconfigure %lxLABEL -font %s\n", //sys_vgui(".x%lx.c itemconfigure %lxLABEL -font %s\n",
// glist_getcanvas(x->x_glist), x, iemgui_font(x)); // glist_getcanvas(x->x_glist), x, iemgui_font(x));
gui_vmess("gui_iemgui_label_font", "sss", gui_vmess("gui_iemgui_label_font", "xxs",
canvas_tag(glist_getcanvas(x->x_glist)), glist_getcanvas(x->x_glist),
gobj_tag(x), x,
iemgui_font(x)); iemgui_font(x));
iemgui_shouldvis(x, IEM_GUI_DRAW_MODE_CONFIG); iemgui_shouldvis(x, IEM_GUI_DRAW_MODE_CONFIG);
} }
...@@ -517,7 +517,7 @@ void iemgui_select(t_gobj *z, t_glist *glist, int selected) ...@@ -517,7 +517,7 @@ void iemgui_select(t_gobj *z, t_glist *glist, int selected)
x->x_selected = NULL; x->x_selected = NULL;
//sys_vgui(".x%lx.c itemconfigure {x%lx&&border} -stroke %s\n", canvas, x, //sys_vgui(".x%lx.c itemconfigure {x%lx&&border} -stroke %s\n", canvas, x,
// x->x_selected && x->x_glist == canvas ? selection_color : border_color); // x->x_selected && x->x_glist == canvas ? selection_color : border_color);
gui_vmess("gui_text_select_color", "ss", canvas_tag(canvas), gobj_tag(x)); gui_vmess("gui_text_select_color", "xx", canvas, x);
x->x_draw((void *)z, glist, IEM_GUI_DRAW_MODE_SELECT); x->x_draw((void *)z, glist, IEM_GUI_DRAW_MODE_SELECT);
if (selected < 2) if (selected < 2)
{ {
...@@ -959,12 +959,12 @@ void iemgui_tag_selected(t_iemgui *x) { ...@@ -959,12 +959,12 @@ void iemgui_tag_selected(t_iemgui *x) {
if(x->x_selected) if(x->x_selected)
{ {
//sys_vgui(".x%lx.c addtag selected withtag x%lx\n", canvas, x); //sys_vgui(".x%lx.c addtag selected withtag x%lx\n", canvas, x);
gui_vmess("gui_text_select", "ss", canvas_tag(canvas), gobj_tag(x)); gui_vmess("gui_text_select", "xx", canvas, x);
} }
else else
{ {
//sys_vgui(".x%lx.c dtag x%lx selected\n", canvas, x); //sys_vgui(".x%lx.c dtag x%lx selected\n", canvas, x);
gui_vmess("gui_text_deselect", "ss", canvas_tag(canvas), gobj_tag(x)); gui_vmess("gui_text_deselect", "xx", canvas, x);
} }
} }
...@@ -979,9 +979,9 @@ void iemgui_label_draw_new(t_iemgui *x) { ...@@ -979,9 +979,9 @@ void iemgui_label_draw_new(t_iemgui *x) {
// x->x_lab!=s_empty?x->x_lab->s_name:"", // x->x_lab!=s_empty?x->x_lab->s_name:"",
// iemgui_font(x), x->x_lcol, x, x); // iemgui_font(x), x->x_lcol, x, x);
sprintf(col, "#%6.6x", x->x_lcol); sprintf(col, "#%6.6x", x->x_lcol);
gui_vmess("gui_iemgui_label_new", "ssiisss", gui_vmess("gui_iemgui_label_new", "xxiisss",
canvas_tag(canvas), canvas,
gobj_tag(x), x,
x->x_ldx, x->x_ldx,
x->x_ldy, x->x_ldy,
col, col,
...@@ -995,9 +995,9 @@ void iemgui_label_draw_move(t_iemgui *x) { ...@@ -995,9 +995,9 @@ void iemgui_label_draw_move(t_iemgui *x) {
int y1=text_ypix(&x->x_obj, x->x_glist); int y1=text_ypix(&x->x_obj, x->x_glist);
//sys_vgui(".x%lx.c coords %lxLABEL %d %d\n", //sys_vgui(".x%lx.c coords %lxLABEL %d %d\n",
// canvas, x, x1+x->x_ldx, y1+x->x_ldy); // canvas, x, x1+x->x_ldx, y1+x->x_ldy);
gui_vmess("gui_iemgui_label_coords", "ssii", gui_vmess("gui_iemgui_label_coords", "xxii",
canvas_tag(glist_getcanvas(x->x_glist)), glist_getcanvas(x->x_glist),
gobj_tag(x), x,
x->x_ldx, x->x_ldx,
x->x_ldy); x->x_ldy);
} }
...@@ -1011,18 +1011,18 @@ void iemgui_label_draw_config(t_iemgui *x) { ...@@ -1011,18 +1011,18 @@ void iemgui_label_draw_config(t_iemgui *x) {
// "-fill $pd_colors(selection) -text {%s} \n", // "-fill $pd_colors(selection) -text {%s} \n",
// canvas, x, iemgui_font(x), // canvas, x, iemgui_font(x),
// x->x_lab!=s_empty?x->x_lab->s_name:""); // x->x_lab!=s_empty?x->x_lab->s_name:"");
gui_vmess("gui_iemgui_label_font", "sss", gui_vmess("gui_iemgui_label_font", "xxs",
canvas_tag(glist_getcanvas(x->x_glist)), glist_getcanvas(x->x_glist),
gobj_tag(x), x,
iemgui_font(x)); iemgui_font(x));
gui_vmess("gui_iemgui_label_set", "sss", gui_vmess("gui_iemgui_label_set", "xxs",
canvas_tag(glist_getcanvas(x->x_glist)), glist_getcanvas(x->x_glist),
gobj_tag(x), x,
x->x_lab != s_empty ? x->x_lab->s_name: ""); x->x_lab != s_empty ? x->x_lab->s_name: "");
sprintf(col, "#%6.6x", x->x_lcol); sprintf(col, "#%6.6x", x->x_lcol);
gui_vmess("gui_iemgui_label_color", "sss", gui_vmess("gui_iemgui_label_color", "xxs",
canvas_tag(canvas), canvas,
gobj_tag(x), x,
col); col);
} }
else else
...@@ -1031,18 +1031,18 @@ void iemgui_label_draw_config(t_iemgui *x) { ...@@ -1031,18 +1031,18 @@ void iemgui_label_draw_config(t_iemgui *x) {
// "-fill #%6.6x -text {%s} \n", // "-fill #%6.6x -text {%s} \n",
// canvas, x, iemgui_font(x), // canvas, x, iemgui_font(x),
// x->x_lcol, x->x_lab!=s_empty?x->x_lab->s_name:""); // x->x_lcol, x->x_lab!=s_empty?x->x_lab->s_name:"");
gui_vmess("gui_iemgui_label_font", "sss", gui_vmess("gui_iemgui_label_font", "xxs",
canvas_tag(glist_getcanvas(x->x_glist)), glist_getcanvas(x->x_glist),
gobj_tag(x), x,
iemgui_font(x)); iemgui_font(x));
gui_vmess("gui_iemgui_label_set", "sss", gui_vmess("gui_iemgui_label_set", "xxs",
canvas_tag(glist_getcanvas(x->x_glist)), glist_getcanvas(x->x_glist),
gobj_tag(x), x,
x->x_lab != s_empty ? x->x_lab->s_name: ""); x->x_lab != s_empty ? x->x_lab->s_name: "");
sprintf(col, "#%6.6x", x->x_lcol); sprintf(col, "#%6.6x", x->x_lcol);
gui_vmess("gui_iemgui_label_color", "sss", gui_vmess("gui_iemgui_label_color", "xxs",
canvas_tag(canvas), canvas,
gobj_tag(x), x,
col); col);
} }
if (x->x_selected == canvas && x->x_glist == canvas) if (x->x_selected == canvas && x->x_glist == canvas)
...@@ -1061,18 +1061,18 @@ void iemgui_label_draw_select(t_iemgui *x) { ...@@ -1061,18 +1061,18 @@ void iemgui_label_draw_select(t_iemgui *x) {
{ {
//sys_vgui(".x%lx.c itemconfigure %lxLABEL " //sys_vgui(".x%lx.c itemconfigure %lxLABEL "
// "-fill $pd_colors(selection)\n", canvas, x); // "-fill $pd_colors(selection)\n", canvas, x);
gui_vmess("gui_iemgui_label_select", "ssi", gui_vmess("gui_iemgui_label_select", "xxi",
canvas_tag(canvas), canvas,
gobj_tag(x), x,
1); 1);
} }
else else
{ {
//sys_vgui(".x%lx.c itemconfigure %lxLABEL -fill #%6.6x\n", //sys_vgui(".x%lx.c itemconfigure %lxLABEL -fill #%6.6x\n",
// canvas, x, x->x_lcol); // canvas, x, x->x_lcol);
gui_vmess("gui_iemgui_label_select", "ssi", gui_vmess("gui_iemgui_label_select", "xxi",
canvas_tag(canvas), canvas,
gobj_tag(x), x,
0); 0);
} }
} }
...@@ -1113,8 +1113,8 @@ void iemgui_draw_io(t_iemgui *x, int old_sr_flags) ...@@ -1113,8 +1113,8 @@ void iemgui_draw_io(t_iemgui *x, int old_sr_flags)
// iem_get_tag(canvas, x), i, x, // iem_get_tag(canvas, x), i, x,
// x->x_selected == x->x_glist ? "iemgui selected" : "iemgui"); // x->x_selected == x->x_glist ? "iemgui selected" : "iemgui");
sprintf(tagbuf, "%so%d", iem_get_tag(canvas, x), i); sprintf(tagbuf, "%so%d", iem_get_tag(canvas, x), i);
gui_vmess("gui_canvas_drawio", "sssiiiiiisiii", canvas_tag(canvas), gui_vmess("gui_canvas_drawio", "xxsiiiiiisiii", canvas,
gobj_tag(x), tagbuf, x, tagbuf,
x1+i*k, y2-1, x1+i*k + IOWIDTH, y2, x1, y1, "o", i, x1+i*k, y2-1, x1+i*k + IOWIDTH, y2, x1, y1, "o", i,
0, 1); 0, 1);
} }
...@@ -1124,8 +1124,8 @@ void iemgui_draw_io(t_iemgui *x, int old_sr_flags) ...@@ -1124,8 +1124,8 @@ void iemgui_draw_io(t_iemgui *x, int old_sr_flags)
//sys_vgui(".x%lx.c delete %so%d\n", //sys_vgui(".x%lx.c delete %so%d\n",
// canvas, iem_get_tag(canvas, x), i); // canvas, iem_get_tag(canvas, x), i);
sprintf(tagbuf, "%so%d", iem_get_tag(canvas, x), i); sprintf(tagbuf, "%so%d", iem_get_tag(canvas, x), i);
gui_vmess("gui_eraseio", "ss", gui_vmess("gui_eraseio", "xs",
canvas_tag(canvas), tagbuf); canvas, tagbuf);
} }
a = old_sr_flags & IEM_GUI_OLD_RCV_FLAG; a = old_sr_flags & IEM_GUI_OLD_RCV_FLAG;
...@@ -1142,8 +1142,8 @@ void iemgui_draw_io(t_iemgui *x, int old_sr_flags) ...@@ -1142,8 +1142,8 @@ void iemgui_draw_io(t_iemgui *x, int old_sr_flags)
// iem_get_tag(canvas, x), i, x, // iem_get_tag(canvas, x), i, x,
// x->x_selected == x->x_glist ? "iemgui selected" : "iemgui"); // x->x_selected == x->x_glist ? "iemgui selected" : "iemgui");
sprintf(tagbuf, "%si%d", iem_get_tag(canvas, x), i); sprintf(tagbuf, "%si%d", iem_get_tag(canvas, x), i);
gui_vmess("gui_canvas_drawio", "sssiiiiiisiii", canvas_tag(canvas), gui_vmess("gui_canvas_drawio", "xxsiiiiiisiii", canvas,
gobj_tag(x), tagbuf, x, tagbuf,
x1+i*k, y1, x1+i*k + IOWIDTH, y1+1, x1, y1, "i", i, x1+i*k, y1, x1+i*k + IOWIDTH, y1+1, x1, y1, "i", i,
0, 1); 0, 1);
} }
...@@ -1153,8 +1153,8 @@ void iemgui_draw_io(t_iemgui *x, int old_sr_flags) ...@@ -1153,8 +1153,8 @@ void iemgui_draw_io(t_iemgui *x, int old_sr_flags)
//sys_vgui(".x%lx.c delete %si%d\n", //sys_vgui(".x%lx.c delete %si%d\n",
// canvas, iem_get_tag(canvas, x), i); // canvas, iem_get_tag(canvas, x), i);
sprintf(tagbuf, "%si%d", iem_get_tag(canvas, x), i); sprintf(tagbuf, "%si%d", iem_get_tag(canvas, x), i);
gui_vmess("gui_eraseio", "ss", gui_vmess("gui_eraseio", "xs",
canvas_tag(canvas), tagbuf); canvas, tagbuf);
} }
} }
...@@ -1173,8 +1173,8 @@ void iemgui_io_draw_move(t_iemgui *x) { ...@@ -1173,8 +1173,8 @@ void iemgui_io_draw_move(t_iemgui *x) {
//sys_vgui(".x%lx.c coords %so%d %d %d %d %d\n", //sys_vgui(".x%lx.c coords %so%d %d %d %d %d\n",
// canvas, iem_get_tag(canvas, x), i, x1+i*k, y2-1, x1+i*k+IOWIDTH, y2); // canvas, iem_get_tag(canvas, x), i, x1+i*k, y2-1, x1+i*k+IOWIDTH, y2);
sprintf(tagbuf, "%so%d", iem_get_tag(canvas, x), i); sprintf(tagbuf, "%so%d", iem_get_tag(canvas, x), i);
gui_start_vmess("gui_configure_item", "ss", gui_start_vmess("gui_configure_item", "xs",
canvas_tag(canvas), tagbuf); canvas, tagbuf);
gui_start_array(); gui_start_array();
gui_s("x"); gui_s("x");
gui_i(i*k); gui_i(i*k);
...@@ -1188,8 +1188,8 @@ void iemgui_io_draw_move(t_iemgui *x) { ...@@ -1188,8 +1188,8 @@ void iemgui_io_draw_move(t_iemgui *x) {
//sys_vgui(".x%lx.c coords %si%d %d %d %d %d\n", //sys_vgui(".x%lx.c coords %si%d %d %d %d %d\n",
// canvas, iem_get_tag(canvas, x), i, x1+i*k, y1, x1+i*k+IOWIDTH, y1+1); // canvas, iem_get_tag(canvas, x), i, x1+i*k, y1, x1+i*k+IOWIDTH, y1+1);
sprintf(tagbuf, "%si%d", iem_get_tag(canvas, x), i); sprintf(tagbuf, "%si%d", iem_get_tag(canvas, x), i);
gui_start_vmess("gui_configure_item", "ss", gui_start_vmess("gui_configure_item", "xs",
canvas_tag(canvas), tagbuf); canvas, tagbuf);
gui_start_array(); gui_start_array();
gui_s("x"); gui_s("x");
gui_i(i*k); gui_i(i*k);
...@@ -1209,13 +1209,13 @@ void iemgui_base_draw_new(t_iemgui *x) { ...@@ -1209,13 +1209,13 @@ void iemgui_base_draw_new(t_iemgui *x) {
// "-stroke $pd_colors(iemgui_border) -fill #%6.6x " // "-stroke $pd_colors(iemgui_border) -fill #%6.6x "
// "-tags {%lxBASE x%lx text iemgui border}\n", // "-tags {%lxBASE x%lx text iemgui border}\n",
// canvas, x1,y1,x2,y2, x->x_bcol, x, x); // canvas, x1,y1,x2,y2, x->x_bcol, x, x);
gui_vmess("gui_text_create_gobj", "sssiii", canvas_tag(canvas), gobj_tag(x), gui_vmess("gui_text_create_gobj", "xxsiii", canvas, x,
"iemgui", x1, y1, glist_istoplevel(x->x_glist)); "iemgui", x1, y1, glist_istoplevel(x->x_glist));
char colorbuf[MAXPDSTRING]; char colorbuf[MAXPDSTRING];
sprintf(colorbuf, "#%6.6x", x->x_bcol); sprintf(colorbuf, "#%6.6x", x->x_bcol);
gui_vmess("gui_text_drawborder", "sssiiiii", gui_vmess("gui_text_drawborder", "xxsiiiii",
canvas_tag(canvas), canvas,
gobj_tag(x), x,
colorbuf, colorbuf,
0, 0,
x1, y1, x2, y2); x1, y1, x2, y2);
...@@ -1228,8 +1228,8 @@ void iemgui_base_draw_move(t_iemgui *x) { ...@@ -1228,8 +1228,8 @@ void iemgui_base_draw_move(t_iemgui *x) {
c->c_wb->w_getrectfn((t_gobj *)x,x->x_glist,&x1,&y1,&x2,&y2); c->c_wb->w_getrectfn((t_gobj *)x,x->x_glist,&x1,&y1,&x2,&y2);
gop_redraw=gr; gop_redraw=gr;
//sys_vgui(".x%lx.c coords %lxBASE %d %d %d %d\n", canvas, x, x1, y1, x2, y2); //sys_vgui(".x%lx.c coords %lxBASE %d %d %d %d\n", canvas, x, x1, y1, x2, y2);
gui_vmess("gui_iemgui_redraw_border", "ssiiii", gui_vmess("gui_iemgui_redraw_border", "xxiiii",
canvas_tag(canvas), gobj_tag(x), x1, y1, x2, y2); canvas, x, x1, y1, x2, y2);
} }
void iemgui_base_draw_config(t_iemgui *x) { void iemgui_base_draw_config(t_iemgui *x) {
...@@ -1239,8 +1239,8 @@ void iemgui_base_draw_config(t_iemgui *x) { ...@@ -1239,8 +1239,8 @@ void iemgui_base_draw_config(t_iemgui *x) {
char tagbuf[MAXPDSTRING]; char tagbuf[MAXPDSTRING];
char bcol[8]; sprintf(bcol, "#%6.6x", x->x_bcol); char bcol[8]; sprintf(bcol, "#%6.6x", x->x_bcol);
sprintf(tagbuf, "x%lxborder", (long unsigned int)x); sprintf(tagbuf, "x%lxborder", (long unsigned int)x);
gui_start_vmess("gui_configure_item", "ss", gui_start_vmess("gui_configure_item", "xs",
canvas_tag(canvas), tagbuf); canvas, tagbuf);
gui_start_array(); gui_start_array();
gui_s("fill"); gui_s("fill");
gui_s(bcol); gui_s(bcol);
...@@ -1275,7 +1275,7 @@ void iemgui_draw_move(t_iemgui *x) { ...@@ -1275,7 +1275,7 @@ void iemgui_draw_move(t_iemgui *x) {
void iemgui_draw_erase(t_iemgui *x) { void iemgui_draw_erase(t_iemgui *x) {
t_canvas *canvas=glist_getcanvas(x->x_glist); t_canvas *canvas=glist_getcanvas(x->x_glist);
//sys_vgui(".x%lx.c delete x%lx\n", canvas, x); //sys_vgui(".x%lx.c delete x%lx\n", canvas, x);
gui_vmess("gui_gobj_erase", "ss", canvas_tag(canvas), gobj_tag(x)); gui_vmess("gui_gobj_erase", "xx", canvas, x);
scalehandle_draw_erase2(x); scalehandle_draw_erase2(x);
} }
......
...@@ -1566,8 +1566,8 @@ static void garray_doredraw(t_gobj *client, t_glist *glist) ...@@ -1566,8 +1566,8 @@ static void garray_doredraw(t_gobj *client, t_glist *glist)
t_scalar *sc = x->x_scalar; t_scalar *sc = x->x_scalar;
char tagbuf[MAXPDSTRING]; char tagbuf[MAXPDSTRING];
sprintf(tagbuf, "scalar%lx", (long unsigned int)sc->sc_vec); sprintf(tagbuf, "scalar%lx", (long unsigned int)sc->sc_vec);
gui_vmess("gui_text_select", "ss", gui_vmess("gui_text_select", "xs",
canvas_tag(glist_getcanvas(glist)), tagbuf); glist_getcanvas(glist), tagbuf);
} }
} }
} }
......
...@@ -35,8 +35,8 @@ void bng_draw_update(t_gobj *xgobj, t_glist *glist) ...@@ -35,8 +35,8 @@ void bng_draw_update(t_gobj *xgobj, t_glist *glist)
// x->x_flashed?x->x_gui.x_fcol:x->x_gui.x_bcol); // x->x_flashed?x->x_gui.x_fcol:x->x_gui.x_bcol);
sprintf(flashcol, "#%6.6x", sprintf(flashcol, "#%6.6x",
x->x_flashed ? x->x_gui.x_fcol : x->x_gui.x_bcol); x->x_flashed ? x->x_gui.x_fcol : x->x_gui.x_bcol);
gui_vmess("gui_bng_flash", "sss", gui_vmess("gui_bng_flash", "xss",
canvas_tag(glist_getcanvas(glist)), tagbuf, flashcol); glist_getcanvas(glist), tagbuf, flashcol);
} }
x->x_gui.x_changed = x->x_flashed; x->x_gui.x_changed = x->x_flashed;
} }
...@@ -58,7 +58,7 @@ void bng_draw_new(t_bng *x, t_glist *glist) ...@@ -58,7 +58,7 @@ void bng_draw_new(t_bng *x, t_glist *glist)
// "-tags {%lxBUT x%lx text iemgui border}\n", // "-tags {%lxBUT x%lx text iemgui border}\n",
// canvas, cx, cy, cr, x->x_flashed?x->x_gui.x_fcol:x->x_gui.x_bcol, // canvas, cx, cy, cr, x->x_flashed?x->x_gui.x_fcol:x->x_gui.x_bcol,
// x, x); // x, x);
gui_vmess("gui_create_bng", "ssfff", canvas_tag(canvas), tagbuf, gui_vmess("gui_create_bng", "xsfff", canvas, tagbuf,
cx - x1 - 0.5, cy - y1 - 0.5, cr); cx - x1 - 0.5, cy - y1 - 0.5, cr);
} }
...@@ -80,8 +80,8 @@ void bng_draw_move(t_bng *x, t_glist *glist) ...@@ -80,8 +80,8 @@ void bng_draw_move(t_bng *x, t_glist *glist)
sprintf(tagbuf, "x%lxbutton", (long unsigned int)x); sprintf(tagbuf, "x%lxbutton", (long unsigned int)x);
char col[8]; char col[8];
sprintf(col, "#%6.6x", x->x_flashed ? x->x_gui.x_fcol : x->x_gui.x_bcol); sprintf(col, "#%6.6x", x->x_flashed ? x->x_gui.x_fcol : x->x_gui.x_bcol);
gui_start_vmess("gui_configure_item", "ss", gui_start_vmess("gui_configure_item", "xs",
canvas_tag(canvas), tagbuf); canvas, tagbuf);
gui_start_array(); gui_start_array();
gui_s("cx"); gui_s("cx");
gui_f(cx - x1 - 0.5); // 0.5 is fudge factor... might be better gui_f(cx - x1 - 0.5); // 0.5 is fudge factor... might be better
...@@ -105,8 +105,8 @@ void bng_draw_config(t_bng* x, t_glist* glist) ...@@ -105,8 +105,8 @@ void bng_draw_config(t_bng* x, t_glist* glist)
sprintf(tagbuf, "x%lxbutton", (long unsigned int)x); sprintf(tagbuf, "x%lxbutton", (long unsigned int)x);
char fcol[8]; char fcol[8];
sprintf(fcol, "#%6.6x", x->x_flashed ? x->x_gui.x_fcol : x->x_gui.x_bcol); sprintf(fcol, "#%6.6x", x->x_flashed ? x->x_gui.x_fcol : x->x_gui.x_bcol);
gui_start_vmess("gui_configure_item", "ss", gui_start_vmess("gui_configure_item", "xs",
canvas_tag(canvas), tagbuf); canvas, tagbuf);
gui_start_array(); gui_start_array();
gui_s("fill"); gui_s("fill");
gui_s(fcol); gui_s(fcol);
......
...@@ -248,27 +248,6 @@ void canvas_makefilename(t_canvas *x, char *file, char *result, int resultsize) ...@@ -248,27 +248,6 @@ void canvas_makefilename(t_canvas *x, char *file, char *result, int resultsize)
//fprintf(stderr,"resulting file = <%s>\n", result); //fprintf(stderr,"resulting file = <%s>\n", result);
} }
// Generic tag format to use for the gui
// Try removing the leading dot, since
// we don't need it anymore
// Both this and gobj_tag are static which
// means you shouldn't send twice in the same
// gui_vmess (and there shouldn't be a reason
// for doing that anyway)
char *canvas_tag(t_canvas *x)
{
static char s[MAXPDSTRING];
sprintf(s, ".x%lx", (long unsigned int)x);
return s;
}
char *gobj_tag(void *x)
{
static char s[MAXPDSTRING];
sprintf(s, "x%lx", (long unsigned int)x);
return s;
}
void canvas_rename(t_canvas *x, t_symbol *s, t_symbol *dir) void canvas_rename(t_canvas *x, t_symbol *s, t_symbol *dir)
{ {
canvas_unbind(x); canvas_unbind(x);
...@@ -729,8 +708,8 @@ void canvas_reflecttitle(t_canvas *x) ...@@ -729,8 +708,8 @@ void canvas_reflecttitle(t_canvas *x)
//sys_vgui("wm title .x%lx {%s%c%s - %s}\n", //sys_vgui("wm title .x%lx {%s%c%s - %s}\n",
// x, x->gl_name->s_name, (x->gl_dirty? '*' : ' '), namebuf, // x, x->gl_name->s_name, (x->gl_dirty? '*' : ' '), namebuf,
// canvas_getdir(x)->s_name); // canvas_getdir(x)->s_name);
gui_vmess("gui_canvas_set_title", "ssssi", gui_vmess("gui_canvas_set_title", "xsssi",
canvas_tag(x), x->gl_name->s_name, x, x->gl_name->s_name,
namebuf, canvas_getdir(x)->s_name, x->gl_dirty); namebuf, canvas_getdir(x)->s_name, x->gl_dirty);
//} //}
#endif #endif
...@@ -804,8 +783,8 @@ void canvas_drawredrect(t_canvas *x, int doit) ...@@ -804,8 +783,8 @@ void canvas_drawredrect(t_canvas *x, int doit)
//sys_vgui(".x%lx.c create line " //sys_vgui(".x%lx.c create line "
// "%d %d %d %d %d %d %d %d %d %d -fill #ff8080 -tags GOP\n", // "%d %d %d %d %d %d %d %d %d %d -fill #ff8080 -tags GOP\n",
// glist_getcanvas(x), x1, y1, x2, y1, x2, y2, x1, y2, x1, y1); // glist_getcanvas(x), x1, y1, x2, y1, x2, y2, x1, y2, x1, y1);
gui_vmess("gui_canvas_drawredrect", "siiii", gui_vmess("gui_canvas_drawredrect", "xiiii",
canvas_tag(glist_getcanvas(x)), glist_getcanvas(x),
x1, y1, x2, y2); x1, y1, x2, y2);
//dpsaha@vt.edu for drawing the GOP_blobs //dpsaha@vt.edu for drawing the GOP_blobs
if (x->gl_goprect && x->gl_edit) if (x->gl_goprect && x->gl_edit)
...@@ -814,8 +793,8 @@ void canvas_drawredrect(t_canvas *x, int doit) ...@@ -814,8 +793,8 @@ void canvas_drawredrect(t_canvas *x, int doit)
else else
{ {
//sys_vgui(".x%lx.c delete GOP\n", glist_getcanvas(x)); //sys_vgui(".x%lx.c delete GOP\n", glist_getcanvas(x));
gui_vmess("gui_canvas_deleteredrect", "s", gui_vmess("gui_canvas_deleteredrect", "x",
canvas_tag(glist_getcanvas(x))); glist_getcanvas(x));
} }
} }
...@@ -862,8 +841,8 @@ void canvas_map(t_canvas *x, t_floatarg f) ...@@ -862,8 +841,8 @@ void canvas_map(t_canvas *x, t_floatarg f)
//sys_vgui(".x%lx.c dtag all selected\n", x); //sys_vgui(".x%lx.c dtag all selected\n", x);
//sys_vgui("foreach item [.x%lx.c find withtag {(!root)}] " //sys_vgui("foreach item [.x%lx.c find withtag {(!root)}] "
// "{ .x%lx.c delete $item }\n", x, x); // "{ .x%lx.c delete $item }\n", x, x);
gui_vmess("gui_canvas_erase_all_gobjs", "s", gui_vmess("gui_canvas_erase_all_gobjs", "x",
canvas_tag(x)); x);
x->gl_mapped = 0; x->gl_mapped = 0;
} }
} }
...@@ -1072,8 +1051,8 @@ void canvas_eraselinesfor(t_canvas *x, t_text *text) ...@@ -1072,8 +1051,8 @@ void canvas_eraselinesfor(t_canvas *x, t_text *text)
// glist_getcanvas(x), oc); // glist_getcanvas(x), oc);
char tagbuf[MAXPDSTRING]; char tagbuf[MAXPDSTRING];
sprintf(tagbuf, "l%lx", (long unsigned int)oc); sprintf(tagbuf, "l%lx", (long unsigned int)oc);
gui_vmess("gui_canvas_delete_line", "ss", gui_vmess("gui_canvas_delete_line", "xs",
canvas_tag(glist_getcanvas(x)), tagbuf); glist_getcanvas(x), tagbuf);
} }
} }
} }
......
...@@ -562,8 +562,6 @@ EXTERN t_gobj *canvas_findhitbox(t_canvas *x, int xpos, int ypos, ...@@ -562,8 +562,6 @@ EXTERN t_gobj *canvas_findhitbox(t_canvas *x, int xpos, int ypos,
int *x1p, int *y1p, int *x2p, int *y2p); int *x1p, int *y1p, int *x2p, int *y2p);
EXTERN int canvas_setdeleting(t_canvas *x, int flag); EXTERN int canvas_setdeleting(t_canvas *x, int flag);
EXTERN int canvas_hasarray(t_canvas *x); EXTERN int canvas_hasarray(t_canvas *x);
EXTERN char *canvas_tag(t_canvas *x); /* canvas as string to send to gui */
EXTERN char *gobj_tag(void *x); /* gobj as string to send to gui */
/* ---- for parsing @pd_extra and other sys paths in filenames --------------------- */ /* ---- for parsing @pd_extra and other sys paths in filenames --------------------- */
......
...@@ -152,8 +152,8 @@ static void canvas_nlet_conf (t_canvas *x, int type) { ...@@ -152,8 +152,8 @@ static void canvas_nlet_conf (t_canvas *x, int type) {
/* this is rather confusing, but the canvas_cnct_[xlet]_tag already /* this is rather confusing, but the canvas_cnct_[xlet]_tag already
includes the type and index concatenated to the end. */ includes the type and index concatenated to the end. */
gui_vmess("gui_configure_io", "ssiii", gui_vmess("gui_configure_io", "xsiii",
canvas_tag(x), type == 'o' ? x->gl_editor->canvas_cnct_outlet_tag : x, type == 'o' ? x->gl_editor->canvas_cnct_outlet_tag :
x->gl_editor->canvas_cnct_inlet_tag, x->gl_editor->canvas_cnct_inlet_tag,