Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
purr-data
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Srashti Mittal
purr-data
Commits
50d89820
Commit
50d89820
authored
4 years ago
by
Jonathan Wilkes
Browse files
Options
Downloads
Plain Diff
Merge branch '20200906-pddplink'
parents
2b4d0aa8
cf5cf549
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
externals/pddp/pddplink.c
+39
-33
39 additions, 33 deletions
externals/pddp/pddplink.c
with
39 additions
and
33 deletions
externals/pddp/pddplink.c
+
39
−
33
View file @
50d89820
...
@@ -110,39 +110,6 @@ static void pddplink_select(t_gobj *z, t_glist *glist, int state)
...
@@ -110,39 +110,6 @@ static void pddplink_select(t_gobj *z, t_glist *glist, int state)
}
}
}
}
static
void
pddplink_activate
(
t_gobj
*
z
,
t_glist
*
glist
,
int
state
)
{
t_pddplink
*
x
=
(
t_pddplink
*
)
z
;
t_rtext
*
y
=
glist_findrtext
(
glist
,
(
t_text
*
)
x
);
rtext_activate
(
y
,
state
);
x
->
x_rtextactive
=
state
;
if
(
!
state
)
{
/* Big workaround for pddplink without the -box option...
After this call, Pd calls text_setto to see if it needs to
instantiate the object. For nearly all t_text objects, the
object doesn't get rebuilt if the text inside the box remains
the same. Instead, it just calls rtext_senditup which (eventually)
sends a message to the GUI to simply supply new text for the
current object. (It shouldn't do this if the text hasn't actually
changed, but that's another story...).
Anyway, since pddplink has this weird widget behavior, the text
displayed is different than the text we typed in the box-- hence
the x->x_vistext member here. So if we happened to edit the box
without changing the text, rtext_senditup would update the link
to be "pddplink foo" instead of just "foo".
To prevent this, we just zero out the object's te_binbuf to ensure
that text_setto re-instantiates. That ensures the correct text is
printed for the link */
t_binbuf
*
b
=
binbuf_new
();
t_binbuf
*
old
=
x
->
x_ob
.
te_binbuf
;
x
->
x_ob
.
te_binbuf
=
b
;
binbuf_free
(
old
);
}
}
static
void
pddplink_vis
(
t_gobj
*
z
,
t_glist
*
glist
,
int
vis
)
static
void
pddplink_vis
(
t_gobj
*
z
,
t_glist
*
glist
,
int
vis
)
{
{
t_pddplink
*
x
=
(
t_pddplink
*
)
z
;
t_pddplink
*
x
=
(
t_pddplink
*
)
z
;
...
@@ -188,6 +155,45 @@ static void pddplink_vis(t_gobj *z, t_glist *glist, int vis)
...
@@ -188,6 +155,45 @@ static void pddplink_vis(t_gobj *z, t_glist *glist, int vis)
}
}
}
}
static
void
pddplink_activate
(
t_gobj
*
z
,
t_glist
*
glist
,
int
state
)
{
t_pddplink
*
x
=
(
t_pddplink
*
)
z
;
t_rtext
*
y
=
glist_findrtext
(
glist
,
(
t_text
*
)
x
);
rtext_activate
(
y
,
state
);
x
->
x_rtextactive
=
state
;
if
(
!
state
)
{
/* Big workaround for pddplink without the -box option...
After this call, Pd calls text_setto to see if it needs to
instantiate the object. For nearly all t_text objects, the
object doesn't get rebuilt if the text inside the box remains
the same. Instead, it just calls rtext_senditup which (eventually)
sends a message to the GUI to simply supply new text for the
current object. (It shouldn't do this if the text hasn't actually
changed, but that's another story...).
Anyway, since pddplink has this weird widget behavior, the text
displayed is different than the text we typed in the box-- hence
the x->x_vistext member here. So if we happened to edit the box
without changing the text, rtext_senditup would update the link
to be "pddplink foo" instead of just "foo".
To prevent this, we just zero out the object's te_binbuf to ensure
that text_setto re-instantiates. That ensures the correct text is
printed for the link */
t_binbuf
*
b
=
binbuf_new
();
t_binbuf
*
old
=
x
->
x_ob
.
te_binbuf
;
x
->
x_ob
.
te_binbuf
=
b
;
binbuf_free
(
old
);
/* ico@vt.edu 20200906: this is ugly but necessary because otherwise
the object only activates correctly (reverts to its active link)
every other time when being deselected
*/
pddplink_vis
(
z
,
glist
,
0
);
pddplink_vis
(
z
,
glist
,
1
);
}
}
static
int
pddplink_wbclick
(
t_gobj
*
z
,
t_glist
*
glist
,
int
xpix
,
int
ypix
,
static
int
pddplink_wbclick
(
t_gobj
*
z
,
t_glist
*
glist
,
int
xpix
,
int
ypix
,
int
shift
,
int
alt
,
int
dbl
,
int
doit
);
int
shift
,
int
alt
,
int
dbl
,
int
doit
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment