Commit ecb92e6d authored by Jonathan Wilkes's avatar Jonathan Wilkes

add hex symbol color syntax for iemgui colors

We're not yet saving the hex colors as that will break in older patches.
But we do print out warning messages in this interim period and will
save the hex colors at a later date. Once that change is made, all the
interim versions will be able to read the new format
parent 2485ed36
Pipeline #2348 passed with stage
in 373 minutes and 55 seconds
......@@ -133,6 +133,45 @@ static void iemgui_init_sym2dollararg(t_iemgui *x, t_symbol **symp,
}
}
int color_format_warned;
static t_symbol *color2symbol(int col)
{
const int compat = (pd_compatibilitylevel < 48) ? 1 : 0;
char colname[MAXPDSTRING];
colname[0] = colname[MAXPDSTRING-1] = 0;
if (compat)
{
/* compatibility with Pd<=0.47: saves colors as numbers with limited
resolution */
int col2 = -1 - (((0xfc0000 & col) >> 6)
| ((0xfc00 & col) >> 4)
| ((0xfc & col) >> 2));
snprintf(colname, MAXPDSTRING-1, "%d", col2);
}
else
{
if (!color_format_warned)
{
post("warning: saving iemgui colors as hex symbol. These colors "
"are readable in Pd Vanilla since 0.47, but they are not "
"readable in Purr Data version 2.12.0 or earlier. "
"If you need to remain compatible with older versions of Purr "
"Data please run in compatibility mode with Vanilla version "
"0.47 like this:");
post("");
post("[compatibility 0.47(");
post("|");
post("[send pd]");
post("");
color_format_warned = 1;
}
snprintf(colname, MAXPDSTRING-1, "#%06x", col);
}
return gensym(colname);
}
/* get the unexpanded versions of the symbols; initialize them if necessary. */
void iemgui_all_sym2dollararg(t_iemgui *x, t_symbol **srlsym)
{
......@@ -144,16 +183,107 @@ void iemgui_all_sym2dollararg(t_iemgui *x, t_symbol **srlsym)
srlsym[2] = x->x_lab_unexpanded;
}
static int col2save(int col) {
return -1-(((0xfc0000 & col) >> 6)|((0xfc00 & col) >> 4)|((0xfc & col) >> 2));
void iemgui_all_col2save(t_iemgui *x, t_symbol **bflcol)
{
bflcol[0] = color2symbol(x->x_bcol);
bflcol[1] = color2symbol(x->x_fcol);
bflcol[2] = color2symbol(x->x_lcol);
}
void iemgui_all_col2save(t_iemgui *x, int *bflcol)
static void expand_shorthex(char *source, char *doubled)
{
bflcol[0] = col2save(x->x_bcol);
bflcol[1] = col2save(x->x_fcol);
bflcol[2] = col2save(x->x_lcol);
while(*source)
{
*doubled++ = *source;
*doubled++ = *source++;
}
}
static int iemgui_getcolorarg(t_iemgui *x, int index, int argc, t_atom *argv)
{
char *classname;
if (index < 0 || index >= argc || !argc)
return 0;
if (IS_A_FLOAT(argv, index))
return atom_getfloatarg(index, argc, argv);
classname = class_getname(pd_class(&x->x_obj.te_pd));
if (IS_A_SYMBOL(argv, index))
{
t_symbol *s = atom_getsymbolarg(index, argc, argv);
if ('#' == s->s_name[0])
{
char *start = s->s_name + 1, *end;
char expanded[6];
int len = strlen(start);
if (len == 3)
{
expand_shorthex(start, expanded);
start = expanded;
len = 6;
}
if (len == 6)
{
int col = (int)strtol(start, &end, 16);
if (end != start)
return col;
}
}
if (s == &s_)
pd_error(x, "%s: empty symbol detected in hex color argument. "
"Falling back to black. (Hit the sack.:)",
classname);
else
pd_error(x, "%s: expected '#fff' or '#ffffff' hex color format "
"but got '%s'. Falling back to black.",
classname, s->s_name);
return 0;
}
pd_error(x, "%s: color method only accepts symbol or float arguments. "
"Falling back to black.",
classname);
return 0;
}
static int colfromatomload(t_iemgui *x, t_atom *colatom)
{
int color;
/* old-fashioned color argument, either a number or symbol
evaluating to an integer */
if (colatom->a_type == A_FLOAT)
color = atom_getfloat(colatom);
else if (colatom->a_type == A_SYMBOL &&
(isdigit(colatom->a_w.w_symbol->s_name[0]) ||
colatom->a_w.w_symbol->s_name[0] == '-'))
color = atoi(colatom->a_w.w_symbol->s_name);
/* symbolic color */
else return (iemgui_getcolorarg(x, 0, 1, colatom));
if (color < 0)
{
color = -1 - color;
color = ((color & 0x3f000) << 6)|((color & 0xfc0) << 4)|
((color & 0x3f) << 2);
}
else
{
color = iemgui_modulo_color(color);
color = iemgui_color_hex[color];
}
return (color);
}
void iemgui_all_loadcolors(t_iemgui *x, t_atom *bcol, t_atom *fcol,
t_atom *lcol)
{
if (bcol) x->x_bcol = colfromatomload(x, bcol);
if (fcol) x->x_fcol = colfromatomload(x, fcol);
if (lcol) x->x_lcol = colfromatomload(x, lcol);
}
static int colfromload(int col) {
if(col)
{
......@@ -170,13 +300,26 @@ void iemgui_all_colfromload(t_iemgui *x, int *bflcol)
x->x_lcol = colfromload(bflcol[2]);
}
static int iemgui_compatible_col(int i)
int iemgui_compatible_colorarg(t_iemgui *x, int index, int argc, t_atom* argv)
{
if(i >= 0)
return(iemgui_color_hex[(iemgui_modulo_color(i))]);
return((-1-i)&0xffffff);
if (index < 0 || index >= argc || !argc)
return 0;
/* old style, lossy int values */
if (IS_A_FLOAT(argv, index))
{
int col = atom_getfloatarg(index, argc, argv);
if (col >= 0)
{
int idx = iemgui_modulo_color(col);
return(iemgui_color_hex[(idx)]);
}
else
return((-1 - col) & 0xffffff);
}
return iemgui_getcolorarg(x, index, argc, argv);
}
void iemgui_all_raute2dollar(t_symbol **srlsym)
{
srlsym[0] = iemgui_raute2dollar(srlsym[0]);
......@@ -478,20 +621,51 @@ void iemgui_pos(t_iemgui *x, t_symbol *s, int ac, t_atom *av)
iemgui_shouldvis(x, IEM_GUI_DRAW_MODE_MOVE);
}
void iemgui_color(t_iemgui *x, t_symbol *s, int ac, t_atom *av)
int iemgui_old_color_args(int argc, t_atom *argv)
{
x->x_bcol = iemgui_compatible_col(atom_getintarg(0, ac, av));
if(ac > 2)
int gotsym = 0, gotfloat = 0;
gotsym += atom_getsymbolarg(0, argc, argv) != &s_;
gotsym += atom_getsymbolarg(1, argc, argv) != &s_;
gotsym += atom_getsymbolarg(2, argc, argv) != &s_;
gotfloat += argc >=1 && argv[0].a_type == A_FLOAT;
gotfloat += argc >=2 && argv[1].a_type == A_FLOAT;
gotfloat += argc >=2 && argv[2].a_type == A_FLOAT;
if (gotfloat && gotsym)
{
x->x_fcol = iemgui_compatible_col(atom_getintarg(1, ac, av));
x->x_lcol = iemgui_compatible_col(atom_getintarg(2, ac, av));
post("warning: unexpected mixing of symbol args with deprecated "
"float color syntax.");
return 1;
}
else
x->x_lcol = iemgui_compatible_col(atom_getintarg(1, ac, av));
if (glist_isvisible(x->x_glist))
else if (gotfloat) return 1;
else return 0;
}
void iemgui_color(t_iemgui *x, t_symbol *s, int ac, t_atom *av)
{
if (ac)
{
x->x_draw(x, x->x_glist, IEM_GUI_DRAW_MODE_CONFIG);
iemgui_label_draw_config(x);
if (ac >= 1)
x->x_bcol = iemgui_compatible_colorarg(x, 0, ac, av);
if (ac >= 2)
{
/* if there are only two args, the old style was to make
the 2nd argument the label color. So here we check for the
old-style float args and use that format if they are
present. */
if (ac == 2 && iemgui_old_color_args(ac, av))
x->x_lcol = iemgui_compatible_colorarg(x, 1, ac, av);
else
x->x_fcol = iemgui_compatible_colorarg(x, 1, ac, av);
}
if (ac >= 3)
x->x_lcol = iemgui_compatible_colorarg(x, 2, ac, av);
if (glist_isvisible(x->x_glist))
{
x->x_draw(x, x->x_glist, IEM_GUI_DRAW_MODE_CONFIG);
iemgui_label_draw_config(x);
}
}
}
......@@ -561,7 +735,7 @@ void iemgui_vis(t_gobj *z, t_glist *glist, int vis)
}
}
void iemgui_save(t_iemgui *x, t_symbol **srl, int *bflcol)
void iemgui_save(t_iemgui *x, t_symbol **srl, t_symbol **bflcol)
{
if (srl) {
srl[0] = x->x_snd;
......
......@@ -204,7 +204,11 @@ EXTERN void iemgui_verify_snd_ne_rcv(t_iemgui *iemgui);
EXTERN t_symbol *iemgui_getfloatsym(t_atom *a);
EXTERN t_symbol *iemgui_getfloatsymarg(int i, int argc, t_atom *argv);
EXTERN void iemgui_new_getnames(t_iemgui *iemgui, int indx, t_atom *argv);
/* old interface, in case we have old externals calling it */
EXTERN void iemgui_all_colfromload(t_iemgui *iemgui, int *bflcol);
/* new interface for handling colors */
EXTERN void iemgui_all_loadcolors(t_iemgui *x, t_atom *bcol, t_atom *fcol,
t_atom*lcol);
EXTERN void iemgui_send(t_iemgui *x, t_symbol *s);
EXTERN void iemgui_receive(t_iemgui *x, t_symbol *s);
EXTERN void iemgui_label(t_iemgui *x, t_symbol *s);
......@@ -221,7 +225,7 @@ EXTERN void iemgui_displace_withtag(t_gobj *z, t_glist *glist, int dx, int dy);
EXTERN void iemgui_select(t_gobj *z, t_glist *glist, int selected);
EXTERN void iemgui_delete(t_gobj *z, t_glist *glist);
EXTERN void iemgui_vis(t_gobj *z, t_glist *glist, int vis);
EXTERN void iemgui_save(t_iemgui *x, t_symbol **srl, int *bflcol);
EXTERN void iemgui_save(t_iemgui *x, t_symbol **srl, t_symbol **bflcol);
EXTERN void iemgui_properties(t_iemgui *x, t_symbol **srl);
EXTERN int iemgui_dialog(t_iemgui *x, int argc, t_atom *argv);
......
......@@ -196,11 +196,11 @@ static void bng_getrect(t_gobj *z, t_glist *glist, int *xp1, int *yp1,
static void bng_save(t_gobj *z, t_binbuf *b)
{
t_bng *x = (t_bng *)z;
int bflcol[3];
t_symbol *bflcol[3];
t_symbol *srl[3];
iemgui_save(&x->x_gui, srl, bflcol);
binbuf_addv(b, "ssiisiiiisssiiiiiii;", gensym("#X"),gensym("obj"),
binbuf_addv(b, "ssiisiiiisssiiiisss;", gensym("#X"),gensym("obj"),
(int)x->x_gui.x_obj.te_xpix, (int)x->x_gui.x_obj.te_ypix,
gensym("bng"), x->x_gui.x_w,
x->x_flashtime_hold, x->x_flashtime_break,
......@@ -430,7 +430,6 @@ static void bng_tick_lck(t_bng *x)
static void *bng_new(t_symbol *s, int argc, t_atom *argv)
{
t_bng *x = (t_bng *)pd_new(bng_class);
int bflcol[]={-262144, -1, -1};
int a=IEM_GUI_DEFAULTSIZE;
int ldx=17, ldy=7;
int fs=10;
......@@ -440,6 +439,10 @@ static void *bng_new(t_symbol *s, int argc, t_atom *argv)
iem_inttosymargs(&x->x_gui, 0);
iem_inttofstyle(&x->x_gui, 0);
x->x_gui.x_bcol = 0xFCFCFC;
x->x_gui.x_fcol = 0x00;
x->x_gui.x_lcol = 0x00;
if((argc == 14)&&IS_A_FLOAT(argv,0)
&&IS_A_FLOAT(argv,1)&&IS_A_FLOAT(argv,2)
&&IS_A_FLOAT(argv,3)
......@@ -447,10 +450,8 @@ static void *bng_new(t_symbol *s, int argc, t_atom *argv)
&&(IS_A_SYMBOL(argv,5)||IS_A_FLOAT(argv,5))
&&(IS_A_SYMBOL(argv,6)||IS_A_FLOAT(argv,6))
&&IS_A_FLOAT(argv,7)&&IS_A_FLOAT(argv,8)
&&IS_A_FLOAT(argv,9)&&IS_A_FLOAT(argv,10)&&IS_A_FLOAT(argv,11)
&&IS_A_FLOAT(argv,12)&&IS_A_FLOAT(argv,13))
&&IS_A_FLOAT(argv,9)&&IS_A_FLOAT(argv,10))
{
a = atom_getintarg(0, argc, argv);
fthold = atom_getintarg(1, argc, argv);
ftbreak = atom_getintarg(2, argc, argv);
......@@ -460,9 +461,7 @@ static void *bng_new(t_symbol *s, int argc, t_atom *argv)
ldy = atom_getintarg(8, argc, argv);
iem_inttofstyle(&x->x_gui, atom_getintarg(9, argc, argv));
fs = maxi(atom_getintarg(10, argc, argv),4);
bflcol[0] = atom_getintarg(11, argc, argv);
bflcol[1] = atom_getintarg(12, argc, argv);
bflcol[2] = atom_getintarg(13, argc, argv);
iemgui_all_loadcolors(&x->x_gui, argv+11, argv+12, argv+13);
}
else iemgui_new_getnames(&x->x_gui, 4, 0);
......@@ -479,7 +478,6 @@ static void *bng_new(t_symbol *s, int argc, t_atom *argv)
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);
x->x_gui.x_locked = 0;
iemgui_verify_snd_ne_rcv(&x->x_gui);
x->x_clock_hld = clock_new(x, (t_method)bng_tick_hld);
......
......@@ -151,10 +151,10 @@ static void my_canvas_getrect(t_gobj *z, t_glist *glist,
static void my_canvas_save(t_gobj *z, t_binbuf *b)
{
t_my_canvas *x = (t_my_canvas *)z;
int bflcol[3];
t_symbol *bflcol[3];
t_symbol *srl[3];
iemgui_save(&x->x_gui, srl, bflcol);
binbuf_addv(b, "ssiisiiisssiiiiiii;", gensym("#X"),gensym("obj"),
binbuf_addv(b, "ssiisiiisssiiiissi;", gensym("#X"),gensym("obj"),
(int)x->x_gui.x_obj.te_xpix, (int)x->x_gui.x_obj.te_ypix,
gensym("cnv"), x->x_gui.x_w, x->x_vis_w, x->x_vis_h,
srl[0], srl[1], srl[2], x->x_gui.x_ldx, x->x_gui.x_ldy,
......@@ -277,7 +277,6 @@ static void my_canvas_vis_size(t_my_canvas *x, t_symbol *s, int ac, t_atom *av)
static void *my_canvas_new(t_symbol *s, int argc, t_atom *argv)
{
t_my_canvas *x = (t_my_canvas *)pd_new(my_canvas_class);
int bflcol[]={-233017, -1, -66577};
int a=IEM_GUI_DEFAULTSIZE, w=100, h=60;
int ldx=20, ldy=12, i=0;
int fs=14;
......@@ -285,6 +284,10 @@ static void *my_canvas_new(t_symbol *s, int argc, t_atom *argv)
iem_inttosymargs(&x->x_gui, 0);
iem_inttofstyle(&x->x_gui, 0);
x->x_gui.x_bcol = 0xE0E0E0;
x->x_gui.x_fcol = 0x00;
x->x_gui.x_lcol = 0x404040;
if(((argc >= 10)&&(argc <= 13))
&&IS_A_FLOAT(argv,0)&&IS_A_FLOAT(argv,1)&&IS_A_FLOAT(argv,2))
{
......@@ -308,8 +311,7 @@ static void *my_canvas_new(t_symbol *s, int argc, t_atom *argv)
if(((argc >= 10)&&(argc <= 13))
&&(IS_A_SYMBOL(argv,i+3)||IS_A_FLOAT(argv,i+3))&&IS_A_FLOAT(argv,i+4)
&&IS_A_FLOAT(argv,i+5)&&IS_A_FLOAT(argv,i+6)
&&IS_A_FLOAT(argv,i+7)&&IS_A_FLOAT(argv,i+8)
&&IS_A_FLOAT(argv,i+9))
&&IS_A_FLOAT(argv,i+7))
{
/* disastrously, the "label" sits in a different part of the
message. So we have to track its location separately (in
......@@ -320,8 +322,7 @@ static void *my_canvas_new(t_symbol *s, int argc, t_atom *argv)
ldy = atom_getintarg(i+5, argc, argv);
iem_inttofstyle(&x->x_gui, atom_getintarg(i+6, argc, argv));
fs = atom_getintarg(i+7, argc, argv);
bflcol[0] = atom_getintarg(i+8, argc, argv);
bflcol[2] = atom_getintarg(i+9, argc, argv);
iemgui_all_loadcolors(&x->x_gui, argv+i+8, 0, argv+i+9);
}
if((argc == 13)&&IS_A_FLOAT(argv,i+10))
{
......@@ -340,7 +341,6 @@ static void *my_canvas_new(t_symbol *s, int argc, t_atom *argv)
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;
x->x_at[1].a_type = A_FLOAT;
iemgui_verify_snd_ne_rcv(&x->x_gui);
......
......@@ -387,7 +387,7 @@ static void my_numbox_getrect(t_gobj *z, t_glist *glist,
static void my_numbox_save(t_gobj *z, t_binbuf *b)
{
t_my_numbox *x = (t_my_numbox *)z;
int bflcol[3];
t_symbol *bflcol[3];
t_symbol *srl[3];
iemgui_save(&x->x_gui, srl, bflcol);
......@@ -398,7 +398,7 @@ static void my_numbox_save(t_gobj *z, t_binbuf *b)
x->x_gui.x_changed = 1;
sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update);
}
binbuf_addv(b, "ssiisiiffiisssiiiiiiifii;", gensym("#X"),gensym("obj"),
binbuf_addv(b, "ssiisiiffiisssiiiisssfii;", gensym("#X"),gensym("obj"),
(int)x->x_gui.x_obj.te_xpix, (int)x->x_gui.x_obj.te_ypix,
gensym("nbx"), x->x_gui.x_w, x->x_gui.x_h,
(t_float)x->x_min, (t_float)x->x_max,
......@@ -759,13 +759,16 @@ static void my_numbox_list(t_my_numbox *x, t_symbol *s, int ac, t_atom *av)
static void *my_numbox_new(t_symbol *s, int argc, t_atom *argv)
{
t_my_numbox *x = (t_my_numbox *)pd_new(my_numbox_class);
int bflcol[]={-262144, -1, -1};
int w=5, h=14;
int lilo=0, ldx=0, ldy=-8;
int fs=10;
int log_height=256;
double min=-1.0e+37, max=1.0e+37,v=0.0;
x->x_gui.x_bcol = 0xFCFCFC;
x->x_gui.x_fcol = 0x00;
x->x_gui.x_lcol = 0x00;
if((argc >= 17)&&IS_A_FLOAT(argv,0)&&IS_A_FLOAT(argv,1)
&&IS_A_FLOAT(argv,2)&&IS_A_FLOAT(argv,3)
&&IS_A_FLOAT(argv,4)&&IS_A_FLOAT(argv,5)
......@@ -773,8 +776,7 @@ static void *my_numbox_new(t_symbol *s, int argc, t_atom *argv)
&&(IS_A_SYMBOL(argv,7)||IS_A_FLOAT(argv,7))
&&(IS_A_SYMBOL(argv,8)||IS_A_FLOAT(argv,8))
&&IS_A_FLOAT(argv,9)&&IS_A_FLOAT(argv,10)
&&IS_A_FLOAT(argv,11)&&IS_A_FLOAT(argv,12)&&IS_A_FLOAT(argv,13)
&&IS_A_FLOAT(argv,14)&&IS_A_FLOAT(argv,15)&&IS_A_FLOAT(argv,16))
&&IS_A_FLOAT(argv,11)&&IS_A_FLOAT(argv,12)&&IS_A_FLOAT(argv,16))
{
w = maxi(atom_getintarg(0, argc, argv),1);
h = maxi(atom_getintarg(1, argc, argv),8);
......@@ -787,9 +789,7 @@ static void *my_numbox_new(t_symbol *s, int argc, t_atom *argv)
ldy = atom_getintarg(10, argc, argv);
iem_inttofstyle(&x->x_gui, atom_getintarg(11, argc, argv));
fs = maxi(atom_getintarg(12, argc, argv),4);
bflcol[0] = atom_getintarg(13, argc, argv);
bflcol[1] = atom_getintarg(14, argc, argv);
bflcol[2] = atom_getintarg(15, argc, argv);
iemgui_all_loadcolors(&x->x_gui, argv+13, argv+14, argv+15);
v = atom_getfloatarg(16, argc, argv);
}
else iemgui_new_getnames(&x->x_gui, 6, 0);
......@@ -814,7 +814,6 @@ static void *my_numbox_new(t_symbol *s, int argc, t_atom *argv)
x->x_buf[0] = 0;
x->x_numwidth = my_numbox_calc_fontwidth(x);
my_numbox_check_minmax(x, min, max);
iemgui_all_colfromload(&x->x_gui, bflcol);
iemgui_verify_snd_ne_rcv(&x->x_gui);
x->x_clock_reset = clock_new(x, (t_method)my_numbox_tick_reset);
x->x_clock_wait = clock_new(x, (t_method)my_numbox_tick_wait);
......
......@@ -203,7 +203,7 @@ static void radio_getrect(t_gobj *z, t_glist *glist, int *xp1, int *yp1,
static void radio_save(t_gobj *z, t_binbuf *b)
{
t_radio *x = (t_radio *)z;
int bflcol[3];
t_symbol *bflcol[3];
t_symbol *srl[3];
t_class *c = pd_class((t_pd *)x);
t_symbol *cname =
......@@ -212,7 +212,7 @@ static void radio_save(t_gobj *z, t_binbuf *b)
x->x_orient ? gensym("vradio") : gensym("hradio");
iemgui_save(&x->x_gui, srl, bflcol);
binbuf_addv(b, "ssiisiiiisssiiiiiiii", gensym("#X"),gensym("obj"),
binbuf_addv(b, "ssiisiiiisssiiiisssi", gensym("#X"),gensym("obj"),
(int)x->x_gui.x_obj.te_xpix, (int)x->x_gui.x_obj.te_ypix,
cname, x->x_gui.x_w,
x->x_change, iem_symargstoint(&x->x_gui), x->x_number,
......@@ -458,19 +458,21 @@ static void *radio_new(t_symbol *s, int argc, t_atom *argv)
s==gensym("vdl") ? vradio_old_class :
s==gensym("vradio") ? vradio_class : hradio_class);
x->x_orient = s==gensym("vdl") || s==gensym("vradio");
int bflcol[]={-262144, -1, -1};
int a=IEM_GUI_DEFAULTSIZE, on=0, ldx=0, ldy=-8, chg=1, num=8, fs=10;
iem_inttosymargs(&x->x_gui, 0);
iem_inttofstyle(&x->x_gui, 0);
x->x_gui.x_bcol = 0xFCFCFC;
x->x_gui.x_fcol = 0x00;
x->x_gui.x_lcol = 0x00;
if((argc == 15)&&IS_A_FLOAT(argv,0)&&IS_A_FLOAT(argv,1)&&IS_A_FLOAT(argv,2)
&&IS_A_FLOAT(argv,3)
&&(IS_A_SYMBOL(argv,4)||IS_A_FLOAT(argv,4))
&&(IS_A_SYMBOL(argv,5)||IS_A_FLOAT(argv,5))
&&(IS_A_SYMBOL(argv,6)||IS_A_FLOAT(argv,6))
&&IS_A_FLOAT(argv,7)&&IS_A_FLOAT(argv,8)
&&IS_A_FLOAT(argv,9)&&IS_A_FLOAT(argv,10)&&IS_A_FLOAT(argv,11)
&&IS_A_FLOAT(argv,12)&&IS_A_FLOAT(argv,13)&&IS_A_FLOAT(argv,14))
&&IS_A_FLOAT(argv,9)&&IS_A_FLOAT(argv,10)&&IS_A_FLOAT(argv,14))
{
a = atom_getintarg(0, argc, argv);
chg = atom_getintarg(1, argc, argv);
......@@ -481,9 +483,7 @@ static void *radio_new(t_symbol *s, int argc, t_atom *argv)
ldy = atom_getintarg(8, argc, argv);
iem_inttofstyle(&x->x_gui, atom_getintarg(9, argc, argv));
fs = maxi(atom_getintarg(10, argc, argv),4);
bflcol[0] = atom_getintarg(11, argc, argv);
bflcol[1] = atom_getintarg(12, argc, argv);
bflcol[2] = atom_getintarg(13, argc, argv);
iemgui_all_loadcolors(&x->x_gui, argv+11, argv+12, argv+13);
on = mini(maxi(atom_getintarg(14, argc, argv),0),num-1);
}
else iemgui_new_getnames(&x->x_gui, 4, 0);
......@@ -502,7 +502,6 @@ static void *radio_new(t_symbol *s, int argc, t_atom *argv)
x->x_gui.x_w = iemgui_clip_size(a);
x->x_gui.x_h = x->x_gui.x_w;
iemgui_verify_snd_ne_rcv(&x->x_gui);
iemgui_all_colfromload(&x->x_gui, bflcol);
outlet_new(&x->x_gui.x_obj, &s_list);
x->x_gui.x_handle = scalehandle_new((t_object *)x,x->x_gui.x_glist,1,radio__clickhook,radio__motionhook);
......
......@@ -189,10 +189,10 @@ static void slider_getrect(t_gobj *z, t_glist *glist,
static void slider_save(t_gobj *z, t_binbuf *b)
{
t_slider *x = (t_slider *)z;
int bflcol[3];
t_symbol *bflcol[3];
t_symbol *srl[3];
iemgui_save(&x->x_gui, srl, bflcol);
binbuf_addv(b, "ssiisiiffiisssiiiiiiiii", gensym("#X"),gensym("obj"),
binbuf_addv(b, "ssiisiiffiisssiiiisssii", gensym("#X"),gensym("obj"),
(int)x->x_gui.x_obj.te_xpix, (int)x->x_gui.x_obj.te_ypix,
gensym(x->x_orient ? "vsl" : "hsl"), x->x_gui.x_w, x->x_gui.x_h,
(t_float)x->x_min, (t_float)x->x_max,
......@@ -489,7 +489,7 @@ static void *slider_new(t_symbol *s, int argc, t_atom *argv)
int orient = s==gensym("vsl") || s==gensym("vslider");
t_slider *x = (t_slider *)pd_new(orient ? vslider_class : hslider_class);
x->x_orient = orient;
int bflcol[]={-262144, -1, -1};
// int bflcol[]={-262144, -1, -1};
int lilo=0;
int w,h,ldx,ldy,fs=10, v=0, steady=1;
if (orient) {
......@@ -502,6 +502,11 @@ static void *slider_new(t_symbol *s, int argc, t_atom *argv)
iem_inttosymargs(&x->x_gui, 0);
iem_inttofstyle(&x->x_gui, 0);
x->x_gui.x_bcol = 0xFCFCFC;
x->x_gui.x_fcol = 0x00;
x->x_gui.x_lcol = 0x00;
if(((argc == 17)||(argc == 18))&&IS_A_FLOAT(argv,0)&&IS_A_FLOAT(argv,1)
&&IS_A_FLOAT(argv,2)&&IS_A_FLOAT(argv,3)
&&IS_A_FLOAT(argv,4)&&IS_A_FLOAT(argv,5)
......@@ -509,8 +514,7 @@ static void *slider_new(t_symbol *s, int argc, t_atom *argv)
&&(IS_A_SYMBOL(argv,7)||IS_A_FLOAT(argv,7))
&&(IS_A_SYMBOL(argv,8)||IS_A_FLOAT(argv,8))
&&IS_A_FLOAT(argv,9)&&IS_A_FLOAT(argv,10)
&&IS_A_FLOAT(argv,11)&&IS_A_FLOAT(argv,12)&&IS_A_FLOAT(argv,13)
&&IS_A_FLOAT(argv,14)&&IS_A_FLOAT(argv,15)&&IS_A_FLOAT(argv,16))
&&IS_A_FLOAT(argv,11)&&IS_A_FLOAT(argv,12)&&IS_A_FLOAT(argv,16))
{
w = atom_getintarg(0, argc, argv);
h = atom_getintarg(1, argc, argv);
......@@ -523,9 +527,10 @@ static void *slider_new(t_symbol *s, int argc, t_atom *argv)
ldy = atom_getintarg(10, argc, argv);
iem_inttofstyle(&x->x_gui, atom_getintarg(11, argc, argv));
fs = maxi(atom_getintarg(12, argc, argv),4);
bflcol[0] = (int)atom_getintarg(13, argc, argv);
bflcol[1] = (int)atom_getintarg(14, argc, argv);
bflcol[2] = (int)atom_getintarg(15, argc, argv);
// bflcol[0] = (int)atom_getintarg(13, argc, argv);
// bflcol[1] = (int)atom_getintarg(14, argc, argv);
// bflcol[2] = (int)atom_getintarg(15, argc, argv);
iemgui_all_loadcolors(&x->x_gui, argv+13, argv+14, argv+15);
v = atom_getintarg(16, argc, argv);
}
else iemgui_new_getnames(&x->x_gui, 6, 0);
......@@ -554,7 +559,7 @@ static void *slider_new(t_symbol *s, int argc, t_atom *argv)
slider_check_length(x, w);
}
slider_check_minmax(x, min, max);
iemgui_all_colfromload(&x->x_gui, bflcol);
// iemgui_all_colfromload(&x->x_gui, bflcol);
x->x_thick = 0;
iemgui_verify_snd_ne_rcv(&x->x_gui);
outlet_new(&x->x_gui.x_obj, &s_float);
......@@ -573,7 +578,6 @@ static void *slider_new(t_symbol *s, int argc, t_atom *argv)
x->x_gui.legacy_y = 1;