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

Merge branch 'aggraef/purr-data-revert-mr579' into master

parents 5eb67db0 baf6aebd
......@@ -528,7 +528,7 @@ static void knob_click(t_knob *x, t_floatarg xpos, t_floatarg ypos,
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
knob_bang(x);
glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g, (t_glistmotionfn)knob_motion,
0, 0, xpos, ypos, 0);
0, 0, xpos, ypos);
}
static int knob_newclick(t_gobj *z, struct _glist *glist,
......
......@@ -541,7 +541,7 @@ static int envgen_newclick(t_envgen *x, struct _glist *glist,
envgen_next_doodle(x, glist, xpos, ypos);
glist_grab(x->w.glist, &x->x_obj.te_g, (t_glistmotionfn) envgen_motion,
(t_glistkeyfn) envgen_key, 0, xpos, ypos, 0);
(t_glistkeyfn) envgen_key, 0, xpos, ypos);
x->resizing = 0;
if (x->resizeable && (xpos > wxpos + x->w.width) &&
......
......@@ -366,7 +366,7 @@ static void cube_sphere_click(t_cube_sphere *x, t_floatarg xpos, t_floatarg ypos
x->x_sel_index = sel;
x->x_pos_x = x->x_pix_src_x[sel];
x->x_pos_y = x->x_pix_src_y[sel];
glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g, (t_glistmotionfn)cube_sphere_motion, 0, 0, xpos, ypos, 0);
glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g, (t_glistmotionfn)cube_sphere_motion, 0, 0, xpos, ypos);
}
}
}
......
......@@ -232,7 +232,7 @@ static int iem_event_click(t_gobj *z, struct _glist *glist, int xpix, int ypix,
if(doit)
{
glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g,
(t_glistmotionfn)iem_event_motion, iem_event_key, 0, (t_float)xpix, (t_float)ypix, 0);
(t_glistmotionfn)iem_event_motion, iem_event_key, 0, (t_float)xpix, (t_float)ypix);
outlet_anything(x->x_gui.x_obj.ob_outlet, x->x_dragg_x_y, 2, x->x_at_out);
if(x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing)
......
......@@ -716,7 +716,7 @@ static void numberbox_matrix_click(t_numberbox_matrix *x, t_floatarg xpos, t_flo
t_floatarg shift, t_floatarg ctrl, t_floatarg alt)
{
glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g,
(t_glistmotionfn)numberbox_matrix_motion, numberbox_matrix_key, 0, xpos, ypos, 0);
(t_glistmotionfn)numberbox_matrix_motion, numberbox_matrix_key, 0, xpos, ypos);
}
static int numberbox_matrix_newclick(t_gobj *z, struct _glist *glist, int xpix, int ypix, int shift, int alt, int dbl, int doit)
......
......@@ -440,7 +440,7 @@ static void room_sim_2d_click(t_room_sim_2d *x, t_floatarg xpos, t_floatarg ypos
x->x_pos_x = x->x_pix_src_x[sel];
x->x_pos_y = x->x_pix_src_y[sel];
glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g,
(t_glistmotionfn)room_sim_2d_motion, 0, 0, xpos, ypos, 0);
(t_glistmotionfn)room_sim_2d_motion, 0, 0, xpos, ypos);
}
}
......
......@@ -532,7 +532,7 @@ static void room_sim_3d_click(t_room_sim_3d *x, t_floatarg xpos, t_floatarg ypos
x->x_pos_x = x->x_pix_src_x[sel];
x->x_pos_y = x->x_pix_src_y[sel];
x->x_pos_z = x->x_pix_src_z[sel];
glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g, (t_glistmotionfn)room_sim_3d_motion, 0, 0, xpos, ypos, 0);
glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g, (t_glistmotionfn)room_sim_3d_motion, 0, 0, xpos, ypos);
}
}
......
......@@ -195,7 +195,7 @@ static void comment_dograb(t_comment *x)
Here we use it just to prevent backspace from erasing entire text.
This has to be done also when we are already active, because
after being clicked at we have lost our previous grab. */
glist_grab(x->x_glist, (t_gobj *)x, 0, comment_grabbedkey, 0, 0, 0, 0);
glist_grab(x->x_glist, (t_gobj *)x, 0, comment_grabbedkey, 0, 0, 0);
}
static void comment__bboxhook(t_comment *x, t_symbol *bindsym,
......
......@@ -450,13 +450,13 @@ static void mknob_click(t_mknob *x, t_floatarg xpos, t_floatarg ypos,
if (x->x_gui.x_h<0)
glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g,
(t_glistmotionfn)mknob_motion_fullcircular, 0, 0, xpos, ypos, 0);
(t_glistmotionfn)mknob_motion_fullcircular, 0, 0, xpos, ypos);
else if (x->x_gui.x_h==0)
glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g,
(t_glistmotionfn)mknob_motion_circular, 0, 0, xpos, ypos, 0);
(t_glistmotionfn)mknob_motion_circular, 0, 0, xpos, ypos);
else
glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g,
(t_glistmotionfn)mknob_motion, 0, 0, xpos, ypos, 0);
(t_glistmotionfn)mknob_motion, 0, 0, xpos, ypos);
}
static int mknob_newclick(t_gobj *z, struct _glist *glist,
......
......@@ -1481,7 +1481,7 @@ static int pdp_colorgrid_click(t_gobj *z, struct _glist *glist,
pdp_colorgrid_output_current(x);
pdp_colorgrid_draw_update(x, glist);
glist_grab(glist, &x->x_obj.te_g, (t_glistmotionfn)pdp_colorgrid_motion,
0, 0, xpix, ypix, 0);
0, 0, xpix, ypix);
}
return (1);
}
......
......@@ -518,7 +518,7 @@ static int breakpoints_newclick(t_breakpoints *x, struct _glist *glist,
breakpoints_next_doodle(x,glist,xpos,ypos);
glist_grab(x->w.glist, &x->x_obj.te_g, (t_glistmotionfn) breakpoints_motion,
(t_glistkeyfn) breakpoints_key, 0, xpos, ypos, 0);
(t_glistkeyfn) breakpoints_key, 0, xpos, ypos);
x->w.shift = shift;
breakpoints_followpointer(x,glist);
......@@ -544,7 +544,7 @@ static int breakpoints_newclick(t_breakpoints *x, struct _glist *glist,
breakpoints_next_doodle(x,glist,xpos,ypos);
glist_grab(x->w.glist, &x->x_obj.te_g, (t_glistmotionfn) breakpoints_motion,
(t_glistkeyfn) breakpoints_key, 0, xpos, ypos, 0);
(t_glistkeyfn) breakpoints_key, 0, xpos, ypos);
x->resizing = 0;
if (x->resizeable && (xpos > wxpos + x->w.width) &&
......
......@@ -670,7 +670,7 @@ static int audience_click(t_gobj *z, struct _glist *glist,
}
audience_draw_update(x, glist);
glist_grab(glist, &x->x_obj.te_g, (t_glistmotionfn)audience_motion,
0, 0, xpix, ypix, 0);
0, 0, xpix, ypix);
}
return (1);
}
......
......@@ -880,7 +880,7 @@ static int cooled_click(t_gobj *z, struct _glist *glist,
x->x_alted = alt;
// activate motion callback
glist_grab( glist, &x->x_obj.te_g, (t_glistmotionfn)cooled_motion,
0, 0, xpix, ypix, 0 );
0, 0, xpix, ypix );
// draw insertion line
if ( glist_isvisible( x->x_glist ) )
......
......@@ -510,7 +510,7 @@ static int grid_click(t_gobj *z, struct _glist *glist,
grid_output_current(x);
grid_draw_update(x, glist);
glist_grab(glist, &x->x_obj.te_g, (t_glistmotionfn)grid_motion,
0, 0, xpix, ypix, 0);
0, 0, xpix, ypix);
}
return (1);
}
......
......@@ -640,7 +640,7 @@ static int playlist_click(t_gobj *z, struct _glist *glist,
}
x->x_glist = glist;
glist_grab( glist, &x->x_obj.te_g, (t_glistmotionfn)playlist_motion,
NULL, NULL, xpix, ypix, 0 );
NULL, NULL, xpix, ypix );
}
return (1);
}
......
......@@ -417,7 +417,7 @@ static int scratcher_click(t_gobj *z, struct _glist *glist,
{
// activate motion callback
glist_grab( glist, &x->x_obj.te_g, (t_glistmotionfn)scratcher_motion,
0, 0, xpix, ypix, 0 );
0, 0, xpix, ypix );
x->x_readspeed=0.;
x->x_motioned = 1;
if ( x->x_showspeed )
......
......@@ -426,7 +426,7 @@ static int scrolllist_click(t_gobj *z, struct _glist *glist,
}
x->x_glist = glist;
glist_grab( glist, &x->x_obj.te_g, (t_glistmotionfn)scrolllist_motion,
NULL, NULL, xpix, ypix, 0 );
NULL, NULL, xpix, ypix );
}
return (1);
}
......
......@@ -1116,7 +1116,7 @@ static int sonogram_click(t_gobj *z, struct _glist *glist,
x->x_alted = alt;
// activate motion callback
glist_grab( glist, &x->x_obj.te_g, (t_glistmotionfn)sonogram_motion,
0, 0, xpix, ypix, 0 );
0, 0, xpix, ypix );
if ( shift && alt && (x->x_xstartcapture != x->x_xendcapture ) )
{
......
......@@ -1859,7 +1859,7 @@ function canvas_sendkey(cid, state, evt, char_code, repeat) {
var shift = evt.shiftKey ? 1 : 0,
repeat_number = repeat ? 1 : 0;
//post("canvas_sendkey state=" + state + " evt=" + evt +
// " char_code=<" + char_code + "> repeat=" + repeat + " shift=" + shift);
// " char_code=<" + char_code + "> repeat=" + repeat);
pdsend(cid, "key", state, char_code, shift, 1, repeat_number);
}
......@@ -2995,10 +2995,13 @@ function gui_text_set (cid, tag, text) {
function gui_text_set_mynumbox (cid, tag, text, active) {
gui(cid).get_elem(tag + "text", function(e) {
//post("gui_text_set_mynumbox " + tag + " " + text + " " + active);
text = text.trim();
e.textContent = "";
text_to_tspans(cid, e, text);
if (active === 1) {
if (active === 2) {
e.classList.remove("activated");
} else if (active === 1) {
e.classList.add("activated");
} else {
e.classList.remove("activated");
......@@ -3354,24 +3357,17 @@ function gui_numbox_coords(cid, tag, w, h) {
});
}
function gui_numbox_draw_text(cid,tag,text,font_size,color,xpos,ypos,basex,basey,fontmargin) {
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.
gui(cid).get_gobj(tag)
.append(function(frag, w) {
var trans_y = 0;
// fine-tuning the translate y rule:
if (font_size === 18 && fontmargin === 2) {
trans_y = 16.5;
} else if (font_size === 17 && fontmargin === 2) {
trans_y = 15.5;
} else {
trans_y = (font_size - fontmargin/2);
}
//post("ypos=" + ypos + " int=" + Math.floor(ypos));
//ypos = Math.floor(ypos);
var svg_text = create_item(cid, "text", {
transform: "translate(" +
(xpos - basex) + "," + trans_y + ")",
//((ypos - basey + (ypos - basey) * 0.5)|0) + ")",
(xpos - basex) + "," +
((ypos - basey + (ypos - basey) * 0.5)|0) + ")",
"font-size": font_size,
fill: color,
id: tag + "text"
......@@ -3398,19 +3394,9 @@ function gui_numbox_update(cid, tag, fcolor, bgcolor, num_font_size, font_name,
});
}
function gui_numbox_update_text_position(cid, tag, x, y, font_size, fontmargin) {
var trans_y = 0;
// fine-tuning the translate y rule:
if (font_size === 18 && fontmargin === 2) {
trans_y = 16.5;
} else if (font_size === 17 && fontmargin === 2) {
trans_y = 15.5;
} else {
trans_y = (font_size - fontmargin/2);
}
function gui_numbox_update_text_position(cid, tag, x, y) {
gui(cid).get_elem(tag + "text", {
//transform: "translate(" + x + "," + ((y + y*0.5)|0) + ")"
transform: "translate(" + x + "," + trans_y + ")"
transform: "translate( " + x + "," + ((y + y*0.5)|0) + ")"
});
}
......
......@@ -86,9 +86,7 @@ typedef struct _iemgui
t_scalehandle *x_handle; //24
t_scalehandle *x_lhandle; //19
int x_vis; //bool //64 /* is the object drawn? */
int x_changed; //bool //30 /* has the value changed so that we need to do graphic update
/* in numbox we also use it to signify when the activated value
has been changed and clipped */
int x_changed; //bool //30 /* has the value changed so that we need to do graphic update */
// grep -w "$1" *.[ch]|wc -l
t_glist *x_selected; // 24 matches
......@@ -182,6 +180,7 @@ typedef struct _my_numbox
{
t_iemgui x_gui;
t_clock *x_clock_reset;
t_clock *x_clock_wait;
double x_val;
double x_min;
double x_max;
......@@ -196,19 +195,9 @@ typedef struct _my_numbox
int x_num_fontsize;/* font size for the number only that should
automatically adjust to the box size */
int x_focused; /* helps us determine when and how we are editing value
0 no focus, 1 mouse focus, 2 keyboard focus without
the trailing '>', and, 3 keyboard focus with the
trailing '>' */
0 no focus, 1 keyboard focus, 2 mouse focus */
int x_log_height;
int x_drawstyle; /* 0 default, 1 just frame, 2, just arrow, 3 number only */
int x_shiftclick; /* used to keep track how the number was originally focused
so that when it is shift-clicked, it is in append mode, and
when focused without the shift, it is operating in the old
mode */
int x_dragged; /* used to keep track if the number box was dragged, so that
even if we arrive back at the previous number, it does not
activate with exclusive keyboard focus. This is why old_val
comparison is not a good one */
int x_drawstyle; /* 0 default, 1 just frame, 2, just arrow, 3 number only */
} t_my_numbox;
extern int sys_noloadbang;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment