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
Prateek Mishra
purr-data
Commits
a90ba604
Commit
a90ba604
authored
11 years ago
by
Ivica Bukvic
Browse files
Options
Downloads
Patches
Plain Diff
Added Jonathan Wilkes' patch for improved classinfo, canvasinfo, and pdinfo objects.
parent
fa3a645f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pd/src/m_pd.h
+4
-1
4 additions, 1 deletion
pd/src/m_pd.h
pd/src/x_interface.c
+19
-14
19 additions, 14 deletions
pd/src/x_interface.c
with
23 additions
and
15 deletions
pd/src/m_pd.h
+
4
−
1
View file @
a90ba604
...
@@ -11,7 +11,7 @@ extern "C" {
...
@@ -11,7 +11,7 @@ extern "C" {
#define PD_MAJOR_VERSION 0
#define PD_MAJOR_VERSION 0
#define PD_MINOR_VERSION 42
#define PD_MINOR_VERSION 42
#define PD_BUGFIX_VERSION 7
#define PD_BUGFIX_VERSION 7
#define PD_TEST_VERSION "2013
0906
"
#define PD_TEST_VERSION "2013
1117
"
#define PDL2ORK
#define PDL2ORK
/* old name for "MSW" flag -- we have to take it for the sake of many old
/* old name for "MSW" flag -- we have to take it for the sake of many old
...
@@ -448,6 +448,9 @@ EXTERN void class_set_extern_dir(t_symbol *s);
...
@@ -448,6 +448,9 @@ EXTERN void class_set_extern_dir(t_symbol *s);
#define CLASS_MAINSIGNALIN(c, type, field) \
#define CLASS_MAINSIGNALIN(c, type, field) \
class_domainsignalin(c, (char *)(&((type *)0)->field) - (char *)0)
class_domainsignalin(c, (char *)(&((type *)0)->field) - (char *)0)
/* classtable functions */
EXTERN
t_class
*
classtable_findbyname
(
t_symbol
*
s
);
/* prototype for functions to save Pd's to a binbuf */
/* prototype for functions to save Pd's to a binbuf */
typedef
void
(
*
t_savefn
)(
t_gobj
*
x
,
t_binbuf
*
b
);
typedef
void
(
*
t_savefn
)(
t_gobj
*
x
,
t_binbuf
*
b
);
EXTERN
void
class_setsavefn
(
t_class
*
c
,
t_savefn
f
);
EXTERN
void
class_setsavefn
(
t_class
*
c
,
t_savefn
f
);
...
...
This diff is collapsed.
Click to expand it.
pd/src/x_interface.c
+
19
−
14
View file @
a90ba604
...
@@ -17,8 +17,6 @@
...
@@ -17,8 +17,6 @@
#define MAXNDEV 20
#define MAXNDEV 20
#define DEVDESCSIZE 80
#define DEVDESCSIZE 80
extern
t_class
*
classtable_findbyname
(
t_symbol
*
s
);
/* -------------------------- print ------------------------------ */
/* -------------------------- print ------------------------------ */
t_class
*
print_class
;
t_class
*
print_class
;
...
@@ -268,18 +266,22 @@ void canvasinfo_filename(t_canvasinfo *x, t_symbol *s, int argc, t_atom *argv)
...
@@ -268,18 +266,22 @@ void canvasinfo_filename(t_canvasinfo *x, t_symbol *s, int argc, t_atom *argv)
void
canvasinfo_hitbox
(
t_canvasinfo
*
x
,
t_floatarg
xpos
,
t_floatarg
ypos
)
void
canvasinfo_hitbox
(
t_canvasinfo
*
x
,
t_floatarg
xpos
,
t_floatarg
ypos
)
{
{
t_canvas
*
c
=
canvasinfo_dig
(
x
);
t_canvas
*
c
=
canvasinfo_dig
(
x
);
int
x1
,
y1
,
x2
,
y2
;
int
x1
,
y1
,
x2
,
y2
,
indexno
;
t_gobj
*
ob
=
canvas_findhitbox
(
c
,
xpos
,
ypos
,
&
x1
,
&
y1
,
&
x2
,
&
y2
);
t_gobj
*
ob
=
canvas_findhitbox
(
c
,
xpos
,
ypos
,
&
x1
,
&
y1
,
&
x2
,
&
y2
);
if
(
ob
)
if
(
ob
)
{
{
t_atom
at
[
5
];
t_gobj
*
y
;
for
(
indexno
=
0
,
y
=
c
->
gl_list
;
y
&&
y
!=
ob
;
y
=
y
->
g_next
)
indexno
++
;
t_atom
at
[
6
];
char
*
classname
=
class_getname
(
ob
->
g_pd
);
char
*
classname
=
class_getname
(
ob
->
g_pd
);
SETSYMBOL
(
at
,
gensym
(
classname
));
SETSYMBOL
(
at
,
gensym
(
classname
));
SETFLOAT
(
at
+
1
,
(
t_float
)
x1
);
SETFLOAT
(
at
+
1
,
(
t_float
)
indexno
);
SETFLOAT
(
at
+
2
,
(
t_float
)
y1
);
SETFLOAT
(
at
+
2
,
(
t_float
)
x1
);
SETFLOAT
(
at
+
3
,
(
t_float
)
x2
);
SETFLOAT
(
at
+
3
,
(
t_float
)
y1
);
SETFLOAT
(
at
+
4
,
(
t_float
)
y2
);
SETFLOAT
(
at
+
4
,
(
t_float
)
x2
);
info_out
((
t_text
*
)
x
,
gensym
(
"hitbox"
),
5
,
at
);
SETFLOAT
(
at
+
5
,
(
t_float
)
y2
);
info_out
((
t_text
*
)
x
,
gensym
(
"hitbox"
),
6
,
at
);
}
}
else
else
info_out
((
t_text
*
)
x
,
gensym
(
"hitbox"
),
0
,
0
);
info_out
((
t_text
*
)
x
,
gensym
(
"hitbox"
),
0
,
0
);
...
@@ -953,13 +955,16 @@ void classinfo_setup(void)
...
@@ -953,13 +955,16 @@ void classinfo_setup(void)
post
(
"classinfo: v.0.1"
);
post
(
"classinfo: v.0.1"
);
post
(
"stable classinfo methods: size"
);
post
(
"stable classinfo methods: size"
);
/* todo: add "instance" method to return instances of a class on a canvas */
/*
todo: make an objectinfo class to get the kind of info that canvasinfo "hitbox"
currently gives
*/
}
}
void
x_interface_setup
(
void
)
void
x_interface_setup
(
void
)
{
{
print_setup
();
print_setup
();
canvasinfo_setup
();
canvasinfo_setup
();
pdinfo_setup
();
pdinfo_setup
();
classinfo_setup
();
classinfo_setup
();
}
}
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