[PD-cvs] pd/src g_canvas.c,1.4.4.1,1.4.4.1.2.1
Tim Blechmann
timblech at users.sourceforge.net
Sun May 22 14:41:01 CEST 2005
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8804
Modified Files:
Tag: devel_0_39
g_canvas.c
Log Message:
upgrading to 0.39-test2
Index: g_canvas.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_canvas.c,v
retrieving revision 1.4.4.1
retrieving revision 1.4.4.1.2.1
diff -C2 -d -r1.4.4.1 -r1.4.4.1.2.1
*** g_canvas.c 5 Nov 2004 14:27:45 -0000 1.4.4.1
--- g_canvas.c 22 May 2005 12:40:59 -0000 1.4.4.1.2.1
***************
*** 85,89 ****
char tbuf[1024];
sprintf(tbuf, "{%s .x%lx} ", gl->gl_name->s_name,
! (t_int)canvas);
strcat(sbuf, tbuf);
}
--- 85,89 ----
char tbuf[1024];
sprintf(tbuf, "{%s .x%lx} ", gl->gl_name->s_name,
! (t_int)canvas);
strcat(sbuf, tbuf);
}
***************
*** 533,537 ****
{
int heightwas = y2 - y1;
! int heightchange = y2 - y1 - (x->gl_screeny2 - x->gl_screeny1);
if (x->gl_screenx1 == x1 && x->gl_screeny1 == y1 &&
x->gl_screenx2 == x2 && x->gl_screeny2 == y2)
--- 533,537 ----
{
int heightwas = y2 - y1;
! int heightchange = y2 - y1 - (x->gl_screeny2 - x->gl_screeny1);
if (x->gl_screenx1 == x1 && x->gl_screeny1 == y1 &&
x->gl_screenx2 == x2 && x->gl_screeny2 == y2)
***************
*** 541,545 ****
x->gl_screenx2 = x2;
x->gl_screeny2 = y2;
- /* post("set bounds %d %d %d %d", x1, y1, x2, y2); */
if (!glist_isgraph(x) && (x->gl_y2 < x->gl_y1))
{
--- 541,544 ----
***************
*** 724,730 ****
if (flag)
{
! /* post("havewindow %d, isgraph %d, isvisible %d editor %d",
! x->gl_havewindow, x->gl_isgraph, glist_isvisible(x),
! (x->gl_editor != 0)); */
/* test if we're already visible and toplevel */
if (x->gl_editor)
--- 723,729 ----
if (flag)
{
! /* post("havewindow %d, isgraph %d, isvisible %d editor %d",
! x->gl_havewindow, x->gl_isgraph, glist_isvisible(x),
! (x->gl_editor != 0)); */
/* test if we're already visible and toplevel */
if (x->gl_editor)
***************
*** 739,743 ****
#endif
}
! else
{
canvas_create_editor(x, 1);
--- 738,742 ----
#endif
}
! else
{
canvas_create_editor(x, 1);
***************
*** 767,770 ****
--- 766,770 ----
return;
}
+ sys_vgui("pdtk_canvas_getscroll .x%lx.c\n", x);
glist_noselect(x);
if (glist_isvisible(x))
***************
*** 1121,1128 ****
{
t_canvasenvironment *e = canvas_getenv(x);
! canvas_setcurrent(x);
canvas_rename(x, binbuf_realizedollsym(av->a_w.w_symbol,
e->ce_argc, e->ce_argv, 1), 0);
! canvas_unsetcurrent(x);
}
else canvas_rename(x, gensym("Pd"), 0);
--- 1121,1128 ----
{
t_canvasenvironment *e = canvas_getenv(x);
! canvas_setcurrent(x);
canvas_rename(x, binbuf_realizedollsym(av->a_w.w_symbol,
e->ce_argc, e->ce_argv, 1), 0);
! canvas_unsetcurrent(x);
}
else canvas_rename(x, gensym("Pd"), 0);
***************
*** 1340,1345 ****
/* redraw all "scalars" (do this if a drawing command is changed.)
LATER we'll use the "template" information to select which ones we
! redraw. */
! static void glist_redrawall(t_glist *gl)
{
t_gobj *g;
--- 1340,1345 ----
/* redraw all "scalars" (do this if a drawing command is changed.)
LATER we'll use the "template" information to select which ones we
! redraw. Action = 0 for redraw, 1 for draw only, 2 for erase. */
! static void glist_redrawall(t_glist *gl, int action)
{
t_gobj *g;
***************
*** 1349,1365 ****
t_class *cl;
if (vis && g->g_pd == scalar_class)
! glist_redrawitem(gl, g);
else if (g->g_pd == canvas_class)
! glist_redrawall((t_glist *)g);
}
}
! /* public interface for above */
! void canvas_redrawallfortemplate(t_canvas *templatecanvas)
{
t_canvas *x;
/* find all root canvases */
for (x = canvas_list; x; x = x->gl_next)
! glist_redrawall(x);
}
--- 1349,1401 ----
t_class *cl;
if (vis && g->g_pd == scalar_class)
! {
! if (action == 1)
! {
! if (glist_isvisible(gl))
! gobj_vis(g, gl, 1);
! }
! else if (action == 2)
! {
! if (glist_isvisible(gl))
! gobj_vis(g, gl, 0);
! }
! else glist_redrawitem(gl, g);
! }
else if (g->g_pd == canvas_class)
! glist_redrawall((t_glist *)g, action);
}
}
! /* public interface for above. */
! void canvas_redrawallfortemplate(t_template *template, int action)
{
t_canvas *x;
/* find all root canvases */
for (x = canvas_list; x; x = x->gl_next)
! glist_redrawall(x, action);
! }
!
! /* find the template defined by a canvas, and redraw all elements
! for that */
! void canvas_redrawallfortemplatecanvas(t_canvas *x, int action)
! {
! t_gobj *g;
! t_template *tmpl;
! t_symbol *s1 = gensym("struct");
! for (g = x->gl_list; g; g = g->g_next)
! {
! t_object *ob = pd_checkobject(&g->g_pd);
! t_atom *argv;
! if (!ob || ob->te_type != T_OBJECT ||
! binbuf_getnatom(ob->te_binbuf) < 2)
! continue;
! argv = binbuf_getvec(ob->te_binbuf);
! if (argv[0].a_type != A_SYMBOL || argv[1].a_type != A_SYMBOL
! || argv[0].a_w.w_symbol != s1)
! continue;
! tmpl = template_findbyname(argv[1].a_w.w_symbol);
! canvas_redrawallfortemplate(tmpl, action);
! }
! canvas_redrawallfortemplate(0, action);
}
More information about the Pd-cvs
mailing list