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
YARAMALA SIVA SAI VARDHAN REDDY
purr-data
Commits
2d667c00
Commit
2d667c00
authored
11 years ago
by
Ivica Bukvic
Browse files
Options
Downloads
Patches
Plain Diff
reverted experimental bind/unbind optimization
parent
865360e1
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
pd/src/g_canvas.c
+14
-28
14 additions, 28 deletions
pd/src/g_canvas.c
with
14 additions
and
28 deletions
pd/src/g_canvas.c
+
14
−
28
View file @
2d667c00
...
@@ -54,9 +54,6 @@ void canvas_reflecttitle(t_canvas *x);
...
@@ -54,9 +54,6 @@ void canvas_reflecttitle(t_canvas *x);
static
void
canvas_addtolist
(
t_canvas
*
x
);
static
void
canvas_addtolist
(
t_canvas
*
x
);
static
void
canvas_takeofflist
(
t_canvas
*
x
);
static
void
canvas_takeofflist
(
t_canvas
*
x
);
static
void
canvas_pop
(
t_canvas
*
x
,
t_floatarg
fvis
);
static
void
canvas_pop
(
t_canvas
*
x
,
t_floatarg
fvis
);
static
int
canvas_should_bind
(
t_canvas
*
x
);
static
void
canvas_bind
(
t_canvas
*
x
);
static
void
canvas_unbind
(
t_canvas
*
x
);
/* --------- functions to handle the canvas environment ----------- */
/* --------- functions to handle the canvas environment ----------- */
...
@@ -235,9 +232,12 @@ void canvas_makefilename(t_canvas *x, char *file, char *result, int resultsize)
...
@@ -235,9 +232,12 @@ void canvas_makefilename(t_canvas *x, char *file, char *result, int resultsize)
void
canvas_rename
(
t_canvas
*
x
,
t_symbol
*
s
,
t_symbol
*
dir
)
void
canvas_rename
(
t_canvas
*
x
,
t_symbol
*
s
,
t_symbol
*
dir
)
{
{
canvas_unbind
(
x
);
if
(
strcmp
(
x
->
gl_name
->
s_name
,
"Pd"
))
pd_unbind
(
&
x
->
gl_pd
,
canvas_makebindsym
(
x
->
gl_name
));
x
->
gl_name
=
s
;
x
->
gl_name
=
s
;
canvas_bind
(
x
);
if
(
strcmp
(
x
->
gl_name
->
s_name
,
"Pd"
))
pd_bind
(
&
x
->
gl_pd
,
canvas_makebindsym
(
x
->
gl_name
));
if
(
glist_isvisible
(
x
))
if
(
x
->
gl_havewindow
)
//was glist_isvisible(x)
if
(
x
->
gl_havewindow
)
//was glist_isvisible(x)
canvas_reflecttitle
(
x
);
canvas_reflecttitle
(
x
);
if
(
dir
&&
dir
!=
&
s_
)
if
(
dir
&&
dir
!=
&
s_
)
...
@@ -408,7 +408,8 @@ t_canvas *canvas_new(void *dummy, t_symbol *sel, int argc, t_atom *argv)
...
@@ -408,7 +408,8 @@ t_canvas *canvas_new(void *dummy, t_symbol *sel, int argc, t_atom *argv)
x
->
gl_owner
=
owner
;
x
->
gl_owner
=
owner
;
x
->
gl_name
=
(
*
s
->
s_name
?
s
:
x
->
gl_name
=
(
*
s
->
s_name
?
s
:
(
canvas_newfilename
?
canvas_newfilename
:
gensym
(
"Pd"
)));
(
canvas_newfilename
?
canvas_newfilename
:
gensym
(
"Pd"
)));
canvas_bind
(
x
);
if
(
strcmp
(
x
->
gl_name
->
s_name
,
"Pd"
))
pd_bind
(
&
x
->
gl_pd
,
canvas_makebindsym
(
x
->
gl_name
));
x
->
gl_loading
=
1
;
x
->
gl_loading
=
1
;
//fprintf(stderr,"loading = 1 .x%lx owner=.x%lx\n", (t_int)x, (t_int)x->gl_owner);
//fprintf(stderr,"loading = 1 .x%lx owner=.x%lx\n", (t_int)x, (t_int)x->gl_owner);
x
->
gl_goprect
=
0
;
/* no GOP rectangle unless it's turned on later */
x
->
gl_goprect
=
0
;
/* no GOP rectangle unless it's turned on later */
...
@@ -548,8 +549,9 @@ t_glist *glist_addglist(t_glist *g, t_symbol *sym,
...
@@ -548,8 +549,9 @@ t_glist *glist_addglist(t_glist *g, t_symbol *sym,
x
->
gl_screenx1
=
x
->
gl_screeny1
=
0
;
x
->
gl_screenx1
=
x
->
gl_screeny1
=
0
;
x
->
gl_screenx2
=
450
;
x
->
gl_screenx2
=
450
;
x
->
gl_screeny2
=
300
;
x
->
gl_screeny2
=
300
;
if
(
strcmp
(
x
->
gl_name
->
s_name
,
"Pd"
))
pd_bind
(
&
x
->
gl_pd
,
canvas_makebindsym
(
x
->
gl_name
));
x
->
gl_owner
=
g
;
x
->
gl_owner
=
g
;
canvas_bind
(
x
);
x
->
gl_isgraph
=
1
;
x
->
gl_isgraph
=
1
;
x
->
gl_goprect
=
0
;
x
->
gl_goprect
=
0
;
x
->
gl_obj
.
te_binbuf
=
binbuf_new
();
x
->
gl_obj
.
te_binbuf
=
binbuf_new
();
...
@@ -900,7 +902,11 @@ void canvas_free(t_canvas *x)
...
@@ -900,7 +902,11 @@ void canvas_free(t_canvas *x)
if
(
x
->
gl_editor
)
if
(
x
->
gl_editor
)
canvas_destroy_editor
(
x
);
canvas_destroy_editor
(
x
);
canvas_unbind
(
x
);
if
(
strcmp
(
x
->
gl_name
->
s_name
,
"Pd"
))
{
//fprintf(stderr,"canvas_free calling pd_unbind\n");
pd_unbind
(
&
x
->
gl_pd
,
canvas_makebindsym
(
x
->
gl_name
));
}
if
(
x
->
gl_env
)
if
(
x
->
gl_env
)
{
{
freebytes
(
x
->
gl_env
->
ce_argv
,
x
->
gl_env
->
ce_argc
*
sizeof
(
t_atom
));
freebytes
(
x
->
gl_env
->
ce_argv
,
x
->
gl_env
->
ce_argc
*
sizeof
(
t_atom
));
...
@@ -1313,26 +1319,6 @@ int canvas_isabstraction(t_canvas *x)
...
@@ -1313,26 +1319,6 @@ int canvas_isabstraction(t_canvas *x)
return
(
x
->
gl_env
!=
0
);
return
(
x
->
gl_env
!=
0
);
}
}
/* return true if the "canvas" object should be bound to a name */
static
int
canvas_should_bind
(
t_canvas
*
x
)
{
/* FIXME should have a "backwards compatible" mode */
/* not named "Pd" && (is top level || is subpatch) */
return
strcmp
(
x
->
gl_name
->
s_name
,
"Pd"
)
&&
(
!
x
->
gl_owner
||
!
x
->
gl_env
);
}
static
void
canvas_bind
(
t_canvas
*
x
)
{
if
(
canvas_should_bind
(
x
))
pd_bind
(
&
x
->
gl_pd
,
canvas_makebindsym
(
x
->
gl_name
));
}
static
void
canvas_unbind
(
t_canvas
*
x
)
{
if
(
canvas_should_bind
(
x
))
pd_unbind
(
&
x
->
gl_pd
,
canvas_makebindsym
(
x
->
gl_name
));
}
/* return true if the "canvas" object is a "table". */
/* return true if the "canvas" object is a "table". */
int
canvas_istable
(
t_canvas
*
x
)
int
canvas_istable
(
t_canvas
*
x
)
{
{
...
...
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