Commit 84891919 authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

stop using "x" for sending iemgui colors-- while it has a precision formatter,...

stop using "x" for sending iemgui colors-- while it has a precision formatter, it doesn't have a maximum size formatter (and it can't because 64-bit archs need the larger values)
parent ac78c300
Pipeline #528 failed with stage
in 268 minutes and 42 seconds
......@@ -2277,28 +2277,22 @@ function gui_bng_new(cid, tag, cx, cy, radius) {
g.appendChild(circle);
}
// change "x123456" to "#123456". Used as a convenience function for
// iemgui colors.
function x2h(x_val) {
return "#" + x_val.slice(1);
}
function gui_bng_button_color(cid, tag, x_color) {
function gui_bng_button_color(cid, tag, color) {
var button = get_item(cid, tag + "button");
configure_item(button, { fill: x2h(x_color) });
configure_item(button, { fill: color });
}
function gui_bng_configure(cid, tag, x_color, cx, cy, r) {
function gui_bng_configure(cid, tag, color, cx, cy, r) {
var b = get_item(cid, tag + "button");
configure_item(b, {
cx: cx,
cy: cy,
r: r,
fill: x2h(x_color)
fill: color
});
}
function gui_toggle_new(cid, tag, x_color, width, state, p1,p2,p3,p4,p5,p6,p7,p8,basex,basey) {
function gui_toggle_new(cid, tag, color, width, state, p1,p2,p3,p4,p5,p6,p7,p8,basex,basey) {
var g = get_gobj(cid, tag),
points_array,
cross1, cross2;
......@@ -2307,7 +2301,7 @@ function gui_toggle_new(cid, tag, x_color, width, state, p1,p2,p3,p4,p5,p6,p7,p8
];
cross1 = create_item(cid, "polyline", {
points: points_array.join(" "),
stroke: x2h(x_color),
stroke: color,
fill: "none",
id: tag + "cross1",
display: state ? "inline" : "none",
......@@ -2318,7 +2312,7 @@ function gui_toggle_new(cid, tag, x_color, width, state, p1,p2,p3,p4,p5,p6,p7,p8
];
cross2 = create_item(cid, "polyline", {
points: points_array.join(" "),
stroke: x2h(x_color),
stroke: color,
fill: "none",
id: tag + "cross2",
display: state ? "inline" : "none",
......@@ -2351,7 +2345,7 @@ function gui_toggle_resize_cross(cid,tag,w,p1,p2,p3,p4,p5,p6,p7,p8,basex,basey)
});
}
function gui_toggle_update(cid, tag, state, x_color) {
function gui_toggle_update(cid, tag, state, color) {
var cross1 = get_item(cid, tag + "cross1"),
cross2 = get_item(cid, tag + "cross2");
// We have to check for existence here.
......@@ -2363,11 +2357,11 @@ function gui_toggle_update(cid, tag, state, x_color) {
// non-existent tags don't throw an error.
if (cross1) {
if (!!state) {
configure_item(cross1, { display: "inline", stroke: x2h(x_color) });
configure_item(cross2, { display: "inline", stroke: x2h(x_color) });
configure_item(cross1, { display: "inline", stroke: color });
configure_item(cross2, { display: "inline", stroke: color });
} else {
configure_item(cross1, { display: "none", stroke: x2h(x_color) });
configure_item(cross2, { display: "none", stroke: x2h(x_color) });
configure_item(cross1, { display: "none", stroke: color });
configure_item(cross2, { display: "none", stroke: color });
}
}
}
......@@ -2386,7 +2380,7 @@ function numbox_data_string(w, h) {
}
// Todo: send fewer parameters from c
function gui_numbox_new(cid, tag, x_color, x, y, w, h, is_toplevel) {
function gui_numbox_new(cid, tag, color, x, y, w, h, is_toplevel) {
// numbox doesn't have a standard iemgui border,
// so we must create its gobj manually
var g = gui_gobj_new(cid, tag, "iemgui", x, y, is_toplevel),
......@@ -2395,7 +2389,7 @@ function gui_numbox_new(cid, tag, x_color, x, y, w, h, is_toplevel) {
data = numbox_data_string(w, h);
border = create_item(cid, "path", {
d: data,
fill: x2h(x_color),
fill: color,
stroke: "black",
"stroke-width": 1,
id: (tag + "border"),
......@@ -2411,7 +2405,7 @@ function gui_numbox_coords(cid, tag, w, h) {
});
}
function gui_numbox_draw_text(cid,tag,text,font_size,x_color,xpos,ypos,basex,basey) {
function gui_numbox_draw_text(cid,tag,text,font_size,color,xpos,ypos,basex,basey) {
// kludge alert -- I'm not sure why I need to add half to the ypos
// below. But it works for most font sizes.
var g = get_gobj(cid, tag),
......@@ -2420,7 +2414,7 @@ function gui_numbox_draw_text(cid,tag,text,font_size,x_color,xpos,ypos,basex,bas
(xpos - basex) + "," +
((ypos - basey + (ypos - basey) * 0.5)|0) + ")",
"font-size": font_size,
fill: x2h(x_color),
fill: color,
id: tag + "text"
}),
text_node = patchwin[cid].window.document.createTextNode(text);
......@@ -2428,12 +2422,12 @@ function gui_numbox_draw_text(cid,tag,text,font_size,x_color,xpos,ypos,basex,bas
g.appendChild(svg_text);
}
function gui_numbox_update(cid, tag, x_fcolor, x_bgcolor, font_name, font_size, font_weight) {
function gui_numbox_update(cid, tag, fcolor, bgcolor, font_name, font_size, font_weight) {
var b = get_item(cid, tag + "border"),
text = get_item(cid, tag + "text"),
label = get_item(cid, tag + "label");
configure_item(b, { fill: x2h(x_bgcolor) });
configure_item(text, { fill: x2h(x_fcolor), "font-size": font_size });
configure_item(b, { fill: bgcolor });
configure_item(text, { fill: fcolor, "font-size": font_size });
// Update the label if one exists
if (label) {
gui_iemgui_label_font(cid, tag, font_name, font_weight, font_size);
......@@ -2447,7 +2441,7 @@ function gui_numbox_update_text_position(cid, tag, x, y) {
});
}
function gui_slider_new(cid, tag, x_color, p1, p2, p3, p4, basex, basey) {
function gui_slider_new(cid, tag, color, p1, p2, p3, p4, basex, basey) {
var g = get_gobj(cid, tag),
indicator;
indicator = create_item(cid, "line", {
......@@ -2455,7 +2449,7 @@ function gui_slider_new(cid, tag, x_color, p1, p2, p3, p4, basex, basey) {
y1: p2 - basey,
x2: p3 - basex,
y2: p4 - basey,
stroke: x2h(x_color),
stroke: color,
"stroke-width": 3,
fill: "none",
id: tag + "indicator"
......@@ -2474,10 +2468,10 @@ function gui_slider_update(cid, tag, p1, p2, p3, p4, basex, basey) {
});
}
function gui_slider_indicator_color(cid, tag, x_color) {
function gui_slider_indicator_color(cid, tag, color) {
var i = get_item(cid, tag + "indicator");
configure_item(i, {
stroke: x2h(x_color)
stroke: color
});
}
......@@ -2498,7 +2492,7 @@ function gui_radio_new(cid, tag, p1, p2, p3, p4, i, basex, basey) {
g.appendChild(cell);
}
function gui_radio_create_buttons(cid,tag,x_color,p1,p2,p3,p4,basex,basey,i,state) {
function gui_radio_create_buttons(cid,tag,color,p1,p2,p3,p4,basex,basey,i,state) {
var g = get_gobj(cid, tag),
b;
b = create_item(cid, "rect", {
......@@ -2506,8 +2500,8 @@ function gui_radio_create_buttons(cid,tag,x_color,p1,p2,p3,p4,basex,basey,i,stat
y: p2 - basey,
width: p3 - p1,
height: p4 - p2,
stroke: x2h(x_color),
fill: x2h(x_color),
stroke: color,
fill: color,
id: tag + "button_" + i,
display: state ? "inline" : "none"
});
......@@ -2535,18 +2529,18 @@ function gui_radio_button_coords(cid, tag, x1, y1, xi, yi, i, s, d, orient) {
});
}
function gui_radio_update(cid, tag, x_fgcolor, prev, next) {
function gui_radio_update(cid, tag, fgcolor, prev, next) {
var prev = get_item(cid, tag + "button_" + prev),
next = get_item(cid, tag + "button_" + next);
configure_item(prev, { display: "none" });
configure_item(next, {
display: "inline",
fill: x2h(x_fgcolor),
stroke: x2h(x_fgcolor)
fill: fgcolor,
stroke: fgcolor
});
}
function gui_vumeter_draw_text(cid,tag,x_color,xpos,ypos,text,index,basex,basey, font_size, font_weight) {
function gui_vumeter_draw_text(cid,tag,color,xpos,ypos,text,index,basex,basey, font_size, font_weight) {
var g = get_gobj(cid, tag),
svg_text = create_item(cid, "text", {
x: xpos - basex,
......@@ -2570,12 +2564,12 @@ function gui_vumeter_draw_text(cid,tag,x_color,xpos,ypos,text,index,basex,basey,
// c) recreate all the missing labels
// To get on to other work we just parrot the insanity here,
// and silently ignore calls to update non-existent text.
function gui_vumeter_update_text(cid, tag, text, font, selected, x_color, i) {
function gui_vumeter_update_text(cid, tag, text, font, selected, color, i) {
var svg_text = get_item(cid, tag + "text_" + i);
if (!selected) {
// Hack...
if (svg_text !== null) {
configure_item(svg_text, { fill: x2h(x_color) });
configure_item(svg_text, { fill: color });
}
}
}
......@@ -2590,7 +2584,7 @@ function gui_vumeter_erase_text(cid, tag, i) {
t.parentNode.removeChild(t);
}
function gui_vumeter_create_steps(cid,tag,x_color,p1,p2,p3,p4,width,basex,basey,i) {
function gui_vumeter_create_steps(cid,tag,color,p1,p2,p3,p4,width,basex,basey,i) {
var g = get_gobj(cid, tag),
l;
l = create_item(cid, "line", {
......@@ -2598,7 +2592,7 @@ function gui_vumeter_create_steps(cid,tag,x_color,p1,p2,p3,p4,width,basex,basey,
y1: p2 - basey,
x2: p3 - basex,
y2: p4 - basey,
stroke: x2h(x_color),
stroke: color,
"stroke-width": width,
"id": tag + "led_" + i
});
......@@ -2620,7 +2614,7 @@ function gui_vumeter_update_step_coords(cid,tag,i,x1,y1,x2,y2,basex,basey) {
});
}
function gui_vumeter_draw_rect(cid,tag,x_color,p1,p2,p3,p4,basex,basey) {
function gui_vumeter_draw_rect(cid,tag,color,p1,p2,p3,p4,basex,basey) {
var g = get_gobj(cid, tag),
rect;
rect = create_item(cid, "rect", {
......@@ -2628,16 +2622,16 @@ function gui_vumeter_draw_rect(cid,tag,x_color,p1,p2,p3,p4,basex,basey) {
y: p2 - basey,
width: p3 - p1,
height: p4 + 1 - p2,
stroke: x2h(x_color),
fill: x2h(x_color),
stroke: color,
fill: color,
id: tag + "rect"
});
g.appendChild(rect);
}
function gui_vumeter_update_rect(cid, tag, x_color) {
function gui_vumeter_update_rect(cid, tag, color) {
var r = get_item(cid, tag + "rect");
configure_item(r, { fill: x2h(x_color), stroke: x2h(x_color) });
configure_item(r, { fill: color, stroke: color });
}
// Oh hack upon hack... why doesn't the iemgui base_config just take care
......@@ -2684,23 +2678,23 @@ function gui_vumeter_update_rms(cid, tag, p1, p2, p3, p4, basex, basey) {
});
}
function gui_vumeter_update_peak(cid,tag,x_color,p1,p2,p3,p4,basex,basey) {
function gui_vumeter_update_peak(cid,tag,color,p1,p2,p3,p4,basex,basey) {
var line = get_item(cid, tag + "peak");
configure_item(line, {
x1: p1 - basex,
y1: p2 - basey,
x2: p3 - basex,
y2: p4 - basey,
stroke: x2h(x_color)
stroke: color
});
}
function gui_iemgui_base_color(cid, tag, x_color) {
function gui_iemgui_base_color(cid, tag, color) {
var g = get_gobj(cid, tag),
b;
if (g) {
b = g.querySelector(".border");
configure_item(b, { fill: x2h(x_color) });
configure_item(b, { fill: color });
}
}
......@@ -2867,13 +2861,13 @@ function gui_iemgui_label_show_drag_handle(cid, tag, state, x, y, cnv_resize) {
}
}
function gui_mycanvas_new(cid,tag,x_color,x1,y1,x2_vis,y2_vis,x2,y2) {
function gui_mycanvas_new(cid,tag,color,x1,y1,x2_vis,y2_vis,x2,y2) {
var rect_vis, rect, g;
rect_vis = create_item(cid, "rect", {
width: x2_vis - x1,
height: y2_vis - y1,
fill: x2h(x_color),
stroke: x2h(x_color),
fill: color,
stroke: color,
id: tag + "rect"
}
);
......@@ -2884,7 +2878,7 @@ function gui_mycanvas_new(cid,tag,x_color,x1,y1,x2_vis,y2_vis,x2,y2) {
width: x2 - x1,
height: y2 - y1,
fill: "none",
stroke: x2h(x_color),
stroke: color,
id: tag + "drag_handle",
"class": "border mycanvas_border"
}
......@@ -2894,12 +2888,12 @@ function gui_mycanvas_new(cid,tag,x_color,x1,y1,x2_vis,y2_vis,x2,y2) {
g.appendChild(rect);
}
function gui_mycanvas_update(cid, tag, x_color, selected) {
function gui_mycanvas_update(cid, tag, color, selected) {
var r = get_item(cid, tag + "rect"),
h = get_item(cid, tag + "drag_handle");
configure_item(r, {
fill: x2h(x_color),
stroke: x2h(x_color)
fill: color,
stroke: color
});
}
......
......@@ -1190,8 +1190,9 @@ void iemgui_base_draw_new(t_iemgui *x) {
colorbuf,
0,
x1, y1, x2, y2);
gui_vmess("gui_iemgui_base_color", "xxx",
canvas, x, x->x_bcol);
sprintf(colorbuf, "#%6.6x", x->x_bcol);
gui_vmess("gui_iemgui_base_color", "xxs",
canvas, x, colorbuf);
}
void iemgui_base_draw_move(t_iemgui *x) {
......
......@@ -25,12 +25,14 @@ static t_class *bng_class;
void bng_draw_update(t_gobj *xgobj, t_glist *glist)
{
t_bng *x = (t_bng *)xgobj;
char cbuf[8];
sprintf(cbuf, "#%6.6x", x->x_flashed ? x->x_gui.x_fcol : x->x_gui.x_bcol);
if (x->x_gui.x_changed != x->x_flashed && glist_isvisible(glist))
{
gui_vmess("gui_bng_button_color", "xxx",
gui_vmess("gui_bng_button_color", "xxs",
glist_getcanvas(glist),
&x->x_gui,
x->x_flashed ? x->x_gui.x_fcol : x->x_gui.x_bcol);
cbuf);
}
x->x_gui.x_changed = x->x_flashed;
}
......@@ -63,6 +65,8 @@ void bng_draw_new(t_bng *x, t_glist *glist)
void bng_draw_move(t_bng *x, t_glist *glist)
{
t_canvas *canvas=glist_getcanvas(glist);
char cbuf[8];
sprintf(cbuf, "#%6.6x", x->x_flashed ? x->x_gui.x_fcol : x->x_gui.x_bcol);
if (!glist_isvisible(canvas)) return;
int x1=text_xpix(&x->x_gui.x_obj, glist);
int y1=text_ypix(&x->x_gui.x_obj, glist);
......@@ -71,10 +75,10 @@ void bng_draw_move(t_bng *x, t_glist *glist)
t_float cr = (x->x_gui.x_w-2)/2.0;
t_float cx = x1+cr+1;
t_float cy = y1+cr+1;
gui_vmess("gui_bng_configure", "xxxfff",
gui_vmess("gui_bng_configure", "xxsfff",
canvas,
x,
x->x_flashed ? x->x_gui.x_fcol : x->x_gui.x_bcol,
cbuf,
cx - x1,
cy - y1,
cr);
......
......@@ -24,11 +24,13 @@ void my_canvas_draw_new(t_my_canvas *x, t_glist *glist)
t_canvas *canvas=glist_getcanvas(glist);
int x1=text_xpix(&x->x_gui.x_obj, glist);
int y1=text_ypix(&x->x_gui.x_obj, glist);
char cbuf[8];
sprintf(cbuf, "#%6.6x", x->x_gui.x_bcol);
gui_vmess("gui_gobj_new", "xxsiii", canvas,
x, "iemgui", x1, y1, glist_istoplevel(canvas));
gui_vmess("gui_mycanvas_new", "xxxiiiiii", canvas,
x, x->x_gui.x_bcol, x1, y1, x1+x->x_vis_w, y1+x->x_vis_h,
gui_vmess("gui_mycanvas_new", "xxsiiiiii", canvas,
x, cbuf, x1, y1, x1+x->x_vis_w, y1+x->x_vis_h,
x1+x->x_gui.x_w, y1+x->x_gui.x_h);
}
......@@ -48,9 +50,11 @@ void my_canvas_draw_config(t_my_canvas* x, t_glist* glist)
{
t_canvas *canvas=glist_getcanvas(glist);
int isselected;
char cbuf[8];
isselected = x->x_gui.x_selected == canvas && x->x_gui.x_glist == canvas;
gui_vmess("gui_mycanvas_update", "xxxi",
canvas, x, x->x_gui.x_bcol, isselected);
sprintf(cbuf, "#%6.6x", x->x_gui.x_bcol);
gui_vmess("gui_mycanvas_update", "xxsi",
canvas, x, cbuf, isselected);
}
void my_canvas_draw_select(t_my_canvas* x, t_glist* glist)
......
......@@ -158,14 +158,16 @@ static void my_numbox_draw_update(t_gobj *client, t_glist *glist)
static void my_numbox_draw_new(t_my_numbox *x, t_glist *glist)
{
t_canvas *canvas=glist_getcanvas(glist);
char cbuf[8];
sprintf(cbuf, "#%6.6x", x->x_gui.x_bcol);
int half=x->x_gui.x_h/2, d=1+x->x_gui.x_h/34;
int x1=text_xpix(&x->x_gui.x_obj, glist), x2=x1+x->x_numwidth;
int y1=text_ypix(&x->x_gui.x_obj, glist), y2=y1+x->x_gui.x_h;
gui_vmess("gui_numbox_new", "xxxiiiii",
gui_vmess("gui_numbox_new", "xxsiiiii",
canvas,
x,
x->x_gui.x_bcol,
cbuf,
x1,
y1,
x2 - x1,
......@@ -181,12 +183,13 @@ static void my_numbox_draw_new(t_my_numbox *x, t_glist *glist)
// x->x_gui.x_fcol, x, x);
}
my_numbox_ftoa(x);
gui_vmess("gui_numbox_draw_text", "xxsixiiii",
sprintf(cbuf, "#%6.6x", x->x_gui.x_fcol);
gui_vmess("gui_numbox_draw_text", "xxsisiiii",
canvas,
x,
x->x_buf,
x->x_gui.x_fontsize,
x->x_gui.x_fcol,
cbuf,
x1+half+2, y1+half+d, x1, y1);
}
......@@ -225,13 +228,16 @@ static void my_numbox_draw_move(t_my_numbox *x, t_glist *glist)
static void my_numbox_draw_config(t_my_numbox* x,t_glist* glist)
{
t_canvas *canvas=glist_getcanvas(glist);
char fg[8], bg[8];
sprintf(fg, "#%6.6x", x->x_gui.x_fcol);
sprintf(bg, "#%6.6x", x->x_gui.x_bcol);
int issel = x->x_gui.x_selected == canvas && x->x_gui.x_glist == canvas;
gui_vmess("gui_numbox_update", "xxxxsii",
gui_vmess("gui_numbox_update", "xxsssii",
canvas,
x,
x->x_gui.x_fcol,
x->x_gui.x_bcol,
iemgui_typeface(x),
fg,
bg,
iemgui_typeface((t_iemgui *)x),
x->x_gui.x_fontsize,
sys_fontweight);
}
......
......@@ -40,6 +40,8 @@ void radio_draw_update(t_gobj *client, t_glist *glist)
void radio_draw_new(t_radio *x, t_glist *glist)
{
t_canvas *canvas=glist_getcanvas(glist);
char cbuf[8];
sprintf(cbuf, "#%6.6x", x->x_gui.x_fcol);
int n=x->x_number, i, d=x->x_gui.x_w, s=d/4;
int x1=text_xpix(&x->x_gui.x_obj, glist), xi=x1;
int y1=text_ypix(&x->x_gui.x_obj, glist), yi=y1;
......@@ -54,9 +56,9 @@ void radio_draw_new(t_radio *x, t_glist *glist)
gui_vmess("gui_radio_new", "xxiiiiiii",
canvas, x, x1, yi, x1+d, yi, i, x1, y1);
}
gui_vmess("gui_radio_create_buttons", "xxxiiiiiiii",
gui_vmess("gui_radio_create_buttons", "xxsiiiiiiii",
canvas, x,
x->x_gui.x_fcol,
cbuf,
x1+s, yi+s, x1+d-s, yi+d-s, x1, y1, i, x->x_on==i);
yi += d;
x->x_drawn = x->x_on;
......@@ -106,6 +108,8 @@ void radio_draw_config(t_radio *x, t_glist *glist)
{
t_canvas *canvas=glist_getcanvas(glist);
int n=x->x_number, i;
char cbuf[8];
sprintf(cbuf, "#%6.6x", x->x_gui.x_fcol);
iemgui_base_draw_config(&x->x_gui);
for (i=0; i<n; i++)
{
......@@ -114,8 +118,8 @@ void radio_draw_config(t_radio *x, t_glist *glist)
// (x->x_on==i) ? x->x_gui.x_fcol : x->x_gui.x_bcol,
// (x->x_on==i) ? x->x_gui.x_fcol : x->x_gui.x_bcol);
}
gui_vmess("gui_radio_update", "xxxii",
canvas, x, x->x_gui.x_fcol, 0, x->x_on);
gui_vmess("gui_radio_update", "xxsii",
canvas, x, cbuf, 0, x->x_on);
}
......
......@@ -55,6 +55,8 @@ static void slider_draw_update(t_gobj *client, t_glist *glist)
static void slider_draw_new(t_slider *x, t_glist *glist)
{
t_canvas *canvas=glist_getcanvas(glist);
char cbuf[8];
sprintf(cbuf, "#%6.6x", x->x_gui.x_fcol);
int x1=text_xpix(&x->x_gui.x_obj, glist), x2=x1+x->x_gui.x_w;
int y1=text_ypix(&x->x_gui.x_obj, glist), y2=y1+x->x_gui.x_h;
if (x->x_orient) y2+=5; else x2+=5;
......@@ -63,13 +65,13 @@ static void slider_draw_new(t_slider *x, t_glist *glist)
else r = x1+3 + (x->x_val + 50)/100;
iemgui_base_draw_new(&x->x_gui);
if (x->x_orient) {
gui_vmess("gui_slider_new", "xxxiiiiii",
gui_vmess("gui_slider_new", "xxsiiiiii",
canvas, x,
x->x_gui.x_fcol, x1+2, r, x2-2, r, x1, y1);
cbuf, x1+2, r, x2-2, r, x1, y1);
} else {
gui_vmess("gui_slider_new", "xxxiiiiii",
gui_vmess("gui_slider_new", "xxsiiiiii",
canvas, x,
x->x_gui.x_fcol, r, y1+2, r, y2-2, x1, y1);
cbuf, r, y1+2, r, y2-2, x1, y1);
}
}
......@@ -101,9 +103,11 @@ static void slider_draw_move(t_slider *x, t_glist *glist)
static void slider_draw_config(t_slider *x, t_glist *glist)
{
t_canvas *canvas=glist_getcanvas(glist);
char cbuf[8];
sprintf(cbuf, "#%6.6x", x->x_gui.x_fcol);
iemgui_base_draw_config(&x->x_gui);
gui_vmess("gui_slider_indicator_color", "xxx",
canvas, x, x->x_gui.x_fcol);
gui_vmess("gui_slider_indicator_color", "xxs",
canvas, x, cbuf);
}
void slider_check_minmax(t_slider *x, double min, double max);
......
......@@ -35,6 +35,8 @@ void toggle_draw_update(t_gobj *xgobj, t_glist *glist)
void toggle_draw_new(t_toggle *x, t_glist *glist)
{
t_canvas *canvas=glist_getcanvas(glist);
char cbuf[8];
sprintf(cbuf, "#%6.6x", x->x_gui.x_fcol);
int w=(x->x_gui.x_w+29)/30;
int x1=text_xpix(&x->x_gui.x_obj, glist);
int y1=text_ypix(&x->x_gui.x_obj, glist);
......@@ -42,8 +44,8 @@ void toggle_draw_new(t_toggle *x, t_glist *glist)
int col = (x->x_on!=0.0)?x->x_gui.x_fcol:x->x_gui.x_bcol;
iemgui_base_draw_new(&x->x_gui);
gui_vmess("gui_toggle_new", "xxxiiiiiiiiiiii", canvas,
x, x->x_gui.x_fcol, w,
gui_vmess("gui_toggle_new", "xxsiiiiiiiiiiii", canvas,
x, cbuf, w,
(x->x_on != 0.0),
x1+w+1, y1+w+1, x2-w-1, y2-w-1,
x1+w+1, y2-w-1, x2-w-1, y1+w+1, x1, y1);
......@@ -69,14 +71,16 @@ void toggle_draw_move(t_toggle *x, t_glist *glist)
void toggle_draw_config(t_toggle* x, t_glist* glist)
{
t_canvas *canvas=glist_getcanvas(glist);
char cbuf[8];
sprintf(cbuf, "#%6.6x", x->x_gui.x_fcol);
iemgui_base_draw_config(&x->x_gui);
if (glist_isvisible(glist_getcanvas(glist)))
{
gui_vmess("gui_toggle_update", "xxix",
gui_vmess("gui_toggle_update", "xxis",
canvas,
x,
x->x_on != 0.0,
x->x_gui.x_fcol);
cbuf);
}
}
......
......@@ -89,22 +89,24 @@ static void vu_update_peak(t_vu *x, t_glist *glist)
{
int x1 = text_xpix(&x->x_gui.x_obj, glist);
int y1 = text_ypix(&x->x_gui.x_obj, glist);
char cbuf[8];
if(x->x_peak)