Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jonathan Wilkes
purr-data
Commits
5eb67db0
Commit
5eb67db0
authored
Oct 06, 2020
by
Jonathan Wilkes
Browse files
Merge branch 'glist_grab_exclusive_focus_and_shift'
parents
b363df22
3cc64e6a
Pipeline
#2968
failed with stage
in 142 minutes and 56 seconds
Changes
28
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
externals/footils/knob/knob.c
View file @
5eb67db0
...
...
@@ -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
,
xpos
,
ypos
,
0
);
}
static
int
knob_newclick
(
t_gobj
*
z
,
struct
_glist
*
glist
,
...
...
externals/ggee/gui/w_envgen.h
View file @
5eb67db0
...
...
@@ -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
);
(
t_glistkeyfn
)
envgen_key
,
0
,
xpos
,
ypos
,
0
);
x
->
resizing
=
0
;
if
(
x
->
resizeable
&&
(
xpos
>
wxpos
+
x
->
w
.
width
)
&&
...
...
externals/iem/iemgui/src/cube_sphere.c
View file @
5eb67db0
...
...
@@ -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
);
glist_grab
(
x
->
x_gui
.
x_glist
,
&
x
->
x_gui
.
x_obj
.
te_g
,
(
t_glistmotionfn
)
cube_sphere_motion
,
0
,
0
,
xpos
,
ypos
,
0
);
}
}
}
...
...
externals/iem/iemgui/src/iem_event.c
View file @
5eb67db0
...
...
@@ -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
);
(
t_glistmotionfn
)
iem_event_motion
,
iem_event_key
,
0
,
(
t_float
)
xpix
,
(
t_float
)
ypix
,
0
);
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
)
...
...
externals/iem/iemgui/src/numberbox_matrix.c
View file @
5eb67db0
...
...
@@ -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
);
(
t_glistmotionfn
)
numberbox_matrix_motion
,
numberbox_matrix_key
,
0
,
xpos
,
ypos
,
0
);
}
static
int
numberbox_matrix_newclick
(
t_gobj
*
z
,
struct
_glist
*
glist
,
int
xpix
,
int
ypix
,
int
shift
,
int
alt
,
int
dbl
,
int
doit
)
...
...
externals/iem/iemgui/src/room_sim_2d.c
View file @
5eb67db0
...
...
@@ -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
);
(
t_glistmotionfn
)
room_sim_2d_motion
,
0
,
0
,
xpos
,
ypos
,
0
);
}
}
...
...
externals/iem/iemgui/src/room_sim_3d.c
View file @
5eb67db0
...
...
@@ -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
);
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
);
}
}
...
...
externals/miXed/cyclone/hammer/comment.c
View file @
5eb67db0
...
...
@@ -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
);
glist_grab
(
x
->
x_glist
,
(
t_gobj
*
)
x
,
0
,
comment_grabbedkey
,
0
,
0
,
0
,
0
);
}
static
void
comment__bboxhook
(
t_comment
*
x
,
t_symbol
*
bindsym
,
...
...
externals/moonlib/mknob.c
View file @
5eb67db0
...
...
@@ -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
);
(
t_glistmotionfn
)
mknob_motion_fullcircular
,
0
,
0
,
xpos
,
ypos
,
0
);
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
);
(
t_glistmotionfn
)
mknob_motion_circular
,
0
,
0
,
xpos
,
ypos
,
0
);
else
glist_grab
(
x
->
x_gui
.
x_glist
,
&
x
->
x_gui
.
x_obj
.
te_g
,
(
t_glistmotionfn
)
mknob_motion
,
0
,
0
,
xpos
,
ypos
);
(
t_glistmotionfn
)
mknob_motion
,
0
,
0
,
xpos
,
ypos
,
0
);
}
static
int
mknob_newclick
(
t_gobj
*
z
,
struct
_glist
*
glist
,
...
...
externals/pidip/modules/pdp_colorgrid.c
View file @
5eb67db0
...
...
@@ -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
,
xpix
,
ypix
,
0
);
}
return
(
1
);
}
...
...
externals/tof/src/w_breakpoints.h
View file @
5eb67db0
...
...
@@ -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
);
(
t_glistkeyfn
)
breakpoints_key
,
0
,
xpos
,
ypos
,
0
);
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);
(t_glistkeyfn) breakpoints_key, 0, xpos, ypos
, 0
);
x->resizing = 0;
if (x->resizeable && (xpos > wxpos + x->w.width) &&
...
...
externals/unauthorized/audience~.c
View file @
5eb67db0
...
...
@@ -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
,
xpix
,
ypix
,
0
);
}
return
(
1
);
}
...
...
externals/unauthorized/cooled~.c
View file @
5eb67db0
...
...
@@ -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
,
xpix
,
ypix
,
0
);
// draw insertion line
if
(
glist_isvisible
(
x
->
x_glist
)
)
...
...
externals/unauthorized/grid.c
View file @
5eb67db0
...
...
@@ -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
,
xpix
,
ypix
,
0
);
}
return
(
1
);
}
...
...
externals/unauthorized/playlist.c
View file @
5eb67db0
...
...
@@ -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
);
NULL
,
NULL
,
xpix
,
ypix
,
0
);
}
return
(
1
);
}
...
...
externals/unauthorized/scratcher~.c
View file @
5eb67db0
...
...
@@ -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
,
xpix
,
ypix
,
0
);
x
->
x_readspeed
=
0
.;
x
->
x_motioned
=
1
;
if
(
x
->
x_showspeed
)
...
...
externals/unauthorized/scrolllist.c
View file @
5eb67db0
...
...
@@ -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
);
NULL
,
NULL
,
xpix
,
ypix
,
0
);
}
return
(
1
);
}
...
...
externals/unauthorized/sonogram~.c
View file @
5eb67db0
...
...
@@ -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
,
xpix
,
ypix
,
0
);
if
(
shift
&&
alt
&&
(
x
->
x_xstartcapture
!=
x
->
x_xendcapture
)
)
{
...
...
pd/nw/pdgui.js
View file @
5eb67db0
...
...
@@ -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);
// " char_code=<" + char_code + "> repeat=" + repeat
+ " shift=" + shift
);
pdsend
(
cid
,
"
key
"
,
state
,
char_code
,
shift
,
1
,
repeat_number
);
}
...
...
@@ -2995,13 +2995,10 @@ 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
===
2
)
{
e
.
classList
.
remove
(
"
activated
"
);
}
else
if
(
active
===
1
)
{
if
(
active
===
1
)
{
e
.
classList
.
add
(
"
activated
"
);
}
else
{
e
.
classList
.
remove
(
"
activated
"
);
...
...
@@ -3357,17 +3354,24 @@ function gui_numbox_coords(cid, tag, w, h) {
});
}
function
gui_numbox_draw_text
(
cid
,
tag
,
text
,
font_size
,
color
,
xpos
,
ypos
,
basex
,
basey
)
{
function
gui_numbox_draw_text
(
cid
,
tag
,
text
,
font_size
,
color
,
xpos
,
ypos
,
basex
,
basey
,
fontmargin
)
{
// 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
)
{
//post("ypos=" + ypos + " int=" + Math.floor(ypos));
//ypos = Math.floor(ypos);
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
);
}
var
svg_text
=
create_item
(
cid
,
"
text
"
,
{
transform
:
"
translate(
"
+
(
xpos
-
basex
)
+
"
,
"
+
((
ypos
-
basey
+
(
ypos
-
basey
)
*
0.5
)
|
0
)
+
"
)
"
,
(
xpos
-
basex
)
+
"
,
"
+
trans_y
+
"
)
"
,
//
((ypos - basey + (ypos - basey) * 0.5)|0) + ")",
"
font-size
"
:
font_size
,
fill
:
color
,
id
:
tag
+
"
text
"
...
...
@@ -3394,9 +3398,19 @@ function gui_numbox_update(cid, tag, fcolor, bgcolor, num_font_size, font_name,
});
}
function
gui_numbox_update_text_position
(
cid
,
tag
,
x
,
y
)
{
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
);
}
gui
(
cid
).
get_elem
(
tag
+
"
text
"
,
{
transform
:
"
translate(
"
+
x
+
"
,
"
+
((
y
+
y
*
0.5
)
|
0
)
+
"
)
"
//transform: "translate(" + x + "," + ((y + y*0.5)|0) + ")"
transform
:
"
translate(
"
+
x
+
"
,
"
+
trans_y
+
"
)
"
});
}
...
...
pd/src/g_all_guis.h
View file @
5eb67db0
...
...
@@ -86,7 +86,9 @@ 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 */
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 */
// grep -w "$1" *.[ch]|wc -l
t_glist
*
x_selected
;
// 24 matches
...
...
@@ -180,7 +182,6 @@ 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
;
...
...
@@ -195,9 +196,19 @@ 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 keyboard focus, 2 mouse focus */
0 no focus, 1 mouse focus, 2 keyboard focus without
the trailing '>', and, 3 keyboard focus with the
trailing '>' */
int
x_log_height
;
int
x_drawstyle
;
/* 0 default, 1 just frame, 2, just arrow, 3 number only */
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 */
}
t_my_numbox
;
extern
int
sys_noloadbang
;
...
...
Prev
1
2
Next
Albert Gräf
@aggraef
mentioned in commit
baf6aebd
·
Nov 02, 2020
mentioned in commit
baf6aebd
mentioned in commit baf6aebd799f7cbe6d061a35e125be393126e95b
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment