Commit 98bc8bd8 authored by Ivica Bukvic's avatar Ivica Bukvic Committed by Hans-Christoph Steiner
Browse files

Pd-0.42.5-extended-l2ork-dev-20110326.tar.bz2

parent 570221da
......@@ -351,6 +351,11 @@ void linetraverser_skipobject(t_linetraverser *t)
/* -------------------- the canvas object -------------------------- */
int glist_valid = 10000;
//static void canvas_manual_pd_free(t_canvas *x) {
// sys_flushtogui();
// pd_free(&x->gl_pd);
//}
void glist_init(t_glist *x)
{
/* zero out everyone except "pd" field */
......@@ -377,6 +382,12 @@ t_canvas *canvas_new(void *dummy, t_symbol *sel, int argc, t_atom *argv)
// jsarlo
x->gl_magic_glass = magicGlass_new((int)x);
// end jsarlo
//if we are root canvas set the clock for script based destructor of the window
//if (!owner) {
// x->gl_destroy = clock_new(x, (t_method)canvas_manual_pd_free);
//}
x->gl_obj.te_type = T_OBJECT;
if (!owner)
canvas_addtolist(x);
......@@ -808,6 +819,10 @@ void canvas_free(t_canvas *x)
if (x->gl_magic_glass)
magicGlass_free(x->gl_magic_glass);
// end jsarlo
//delete clock for gl_destroy
//if (x->gl_destroy) clock_free(x->gl_destroy);
canvas_noundo(x);
if (canvas_editing == x)
canvas_editing = 0;
......
......@@ -193,6 +193,7 @@ struct _glist
// jsarlo
t_magicGlass *gl_magic_glass; /* magic glass object */
// end jsarlo
//t_clock *gl_destroy; /* for script-based closing of the patch */
};
#define gl_gobj gl_obj.te_g
......
......@@ -2735,17 +2735,13 @@ void glob_verifyquit(void *dummy, t_floatarg f)
else glob_quit(0);
}
void canvas_dofree(t_gobj *dummy, t_glist *x)
{
pd_free(&x->gl_pd);
}
/* close a window (or possibly quit Pd), checking for dirty flags.
The "force" parameter is interpreted as follows:
FOR INTERNAL USE (using it explicitly via pd messages induces
a crash because pd_free is called before the previous function
has run its course and thus you end up with hard-to-trace crash)
-1 - request from GUI to close, no verification
(after it returns back from tcl/tk side of things to avoid
freeing before the last method has run its course)
OFFICIAL USE
0 - request from GUI to close, verifying whether clean or dirty
1 - request from GUI to close, no verification
2 - verified - mark this one clean, then continue as in 1
......@@ -2755,9 +2751,7 @@ void canvas_menuclose(t_canvas *x, t_floatarg fforce)
{
int force = fforce;
t_glist *g;
if (force == -1)
pd_free(&x->gl_pd);
else if (x->gl_owner && (force == 0 || force == 1))
if (x->gl_owner && (force == 0 || force == 1))
canvas_vis(x, 0); /* if subpatch, just invis it */
else if (force == 0)
{
......@@ -2790,12 +2784,17 @@ void canvas_menuclose(t_canvas *x, t_floatarg fforce)
canvas_getrootfor(x), canvas_getrootfor(x)->gl_name->s_name, x);
}
*/
else //pd_free(&x->gl_pd);
sys_vgui("pd {.x%lx menuclose -1;}\n", x);
else pd_free(&x->gl_pd);
//sys_queuegui(x, x, canvas_dofree);
//clock_delay(x->gl_destroy, 0);
}
else if (force == 1)
else if (force == 1) {
//pd_free(&x->gl_pd);
sys_vgui("pd {.x%lx menuclose -1;}\n", x);
//sys_vgui("pd {.x%lx menuclose -1;}\n", x);
//sys_vgui("menu_close .x%lx\n", x);
sys_queuegui(x, x, canvas_dofree);
//clock_delay(x->gl_destroy, 0);
}
else if (force == 2)
{
canvas_dirty(x, 0);
......@@ -2817,8 +2816,10 @@ void canvas_menuclose(t_canvas *x, t_floatarg fforce)
// canvas_getrootfor(x), g);
return;
}
else //pd_free(&x->gl_pd);
sys_vgui("pd {.x%lx menuclose -1;}\n", x);
else pd_free(&x->gl_pd);
//sys_vgui("pd {.x%lx menuclose -1;}\n", x);
//sys_queuegui(x, x, canvas_dofree);
//clock_delay(x->gl_destroy, 0);
}
else if (force == 3)
{
......
......@@ -669,6 +669,8 @@ void pd_typedmess(t_pd *x, t_symbol *s, int argc, t_atom *argv)
int narg = 0;
t_pd *bonzo;
//fprinf(stderr,"\nstart %s %d\n", s->s_name, c->c_nmethod);
/* check for messages that are handled by fixed slots in the class
structure. We don't catch "pointer" though so that sending "pointer"
to pd_objectmaker doesn't require that we supply a pointer value. */
......@@ -709,6 +711,7 @@ void pd_typedmess(t_pd *x, t_symbol *s, int argc, t_atom *argv)
if (m->me_name == s)
//if (m && m->me_name == s)
{
//fprintf(stderr,"me_name %s\n", m->me_name);
wp = m->me_arg;
if (*wp == A_GIMME)
{
......
......@@ -11,7 +11,7 @@ extern "C" {
#define PD_MAJOR_VERSION 0
#define PD_MINOR_VERSION 42
#define PD_BUGFIX_VERSION 5
#define PD_TEST_VERSION "extended-l2ork-20110324"
#define PD_TEST_VERSION "extended-l2ork-20110326"
/* old name for "MSW" flag -- we have to take it for the sake of many old
"nmakefiles" for externs, which will define NT and not MSW */
......
......@@ -851,7 +851,7 @@ proc pdtk_check {canvas x message default} {
if {! [string compare $answer yes]} {
pd $message
if {$canvas eq "."} {
focus $canvassegfault due to the way iemgui's implementation of universal color
focus $canvas
} else {
menu_close $canvas
}
......@@ -1545,6 +1545,7 @@ proc menu_print {name} {
}
proc menu_close {name} {
#puts stderr menu_close
if {$name == ".texteditor.text"} {
set topname [string trimright $name .text]
texteditor_send $name
......@@ -1989,7 +1990,7 @@ proc pdtk_canvas_new {name width height geometry editable} {
-xscrollcommand "$name.scrollhort set" \
-scrollregion [concat 0 0 $width $height]
pdtk_standardkeybindings $name.c
#pdtk_standardkeybindings $name.c
if {[info tclversion] >= 8.5 && $pd_nt == 0} {
if {$::menu($name) == 1} {
......
......@@ -716,7 +716,7 @@ void sys_gui(char *s)
sys_vgui("%s", s);
}
static int sys_flushtogui( void)
int sys_flushtogui( void)
{
int writesize = sys_guibufhead - sys_guibuftail, nwrote = 0;
if (writesize > 0)
......
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