Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18025
Modified Files: Tag: devel_0_39 desire.c Log Message: stuff.
Index: desire.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v retrieving revision 1.1.2.40 retrieving revision 1.1.2.41 diff -C2 -d -r1.1.2.40 -r1.1.2.41 *** desire.c 28 Oct 2005 23:34:11 -0000 1.1.2.40 --- desire.c 29 Oct 2005 10:30:18 -0000 1.1.2.41 *************** *** 33,36 **** --- 33,38 ---- #define template templaet
+ #define glist_each(CHILD,GLIST) for(CHILD=(GLIST)->gl_list; CHILD; CHILD=CHILD->g_next) + //-------------------------------------------------------------------------- // t_appendix: an extension to t_gobj made by matju so that *************** *** 47,51 **** }
! /* subscribing N spies takes N*N time, but I don't care in this case */ void gobj_subscribe (t_gobj *self, t_gobj *observer) { t_appendix *d = self->g_adix; --- 49,53 ---- }
! /* subscribing N spies takes N*N time, but it's not important for now */ void gobj_subscribe (t_gobj *self, t_gobj *observer) { t_appendix *d = self->g_adix; *************** *** 84,87 **** --- 86,90 ---- t_gobj *self = (t_gobj *)self_; t_appendix *d = self->g_adix; + if (!d) {post("no appendix in owner"); return;} int i; for (i=0; i<d->nobs; i++) { *************** *** 90,94 **** if (ice) ice(obs,origin,argc,argv); else post("null func ptr for class %s",self->g_pd->c_name->s_name); - } } --- 93,96 ---- *************** *** 151,155 **** if (!a->dirtyc) queue_put(self->q,origin); a->dirtyc = 1; ! SETFLOAT(a->dirtyv,-1); /* in the future this will contain real data */ }
--- 153,157 ---- if (!a->dirtyc) queue_put(self->q,origin); a->dirtyc = 1; ! SETFLOAT(a->dirtyv,-1); /* in the future this may contain real data instead */ }
*************** *** 221,230 **** } } ! for (g = gl->gl_list; g; g = g->g_next) { if (pd_class(&g->g_pd) == canvas_class) glist_doupdatewindowlist((t_glist *)g, sbuf); } - return; }
--- 223,232 ---- } } ! glist_each(g,gl) ! //for (g = gl->gl_list; g; g = g->g_next) { if (pd_class(&g->g_pd) == canvas_class) glist_doupdatewindowlist((t_glist *)g, sbuf); } }
*************** *** 688,736 **** "unmapped" (either miniaturized or just plain gone.) This should be called from the GUI after the fact to "notify" us that we're mapped. */ ! void canvas_map(t_canvas *x, t_floatarg f) ! { ! int flag = (f != 0); ! t_gobj *y; ! if (flag) ! { ! if (!glist_isvisible(x)) ! { t_selection *sel; ! if (!x->gl_havewindow) ! { ! bug("canvas_map"); ! canvas_vis(x, 1); ! } ! for (y = x->gl_list; y; y = y->g_next) ! gobj_vis(y, x, 1); for (sel = x->gl_editor->e_selection; sel; sel = sel->sel_next) gobj_select(sel->sel_what, x, 1); x->gl_mapped = 1; canvas_drawlines(x); ! if (x->gl_isgraph && x->gl_goprect) ! canvas_drawredrect(x, 1); sys_mgui(x,"canvas_getscroll",""); } ! } ! else ! { ! if (glist_isvisible(x)) ! { ! /* just clear out the whole canvas... */ ! sys_mgui(x,"erase",""); ! #if 0 ! /* alternatively, we could have erased them one by one... ! for (y = x->gl_list; y; y = y->g_next) ! gobj_vis(y, x, 0); ! ... but we should go through and erase the lines as well ! if we do it that way. */ ! #endif ! x->gl_mapped = 0; ! } } }
void canvas_redraw(t_canvas *x) { ! if (glist_isvisible(x)) {canvas_map(x,0); canvas_map(x, 1);} }
--- 690,718 ---- "unmapped" (either miniaturized or just plain gone.) This should be called from the GUI after the fact to "notify" us that we're mapped. */ ! void canvas_map(t_canvas *x, t_floatarg f) { ! if (f!=0) { ! if (!glist_isvisible(x)) { t_selection *sel; ! t_gobj *y; ! if (!x->gl_havewindow) {bug("canvas_map"); canvas_vis(x,1);} ! for (y = x->gl_list; y; y = y->g_next) gobj_vis(y, x, 1); for (sel = x->gl_editor->e_selection; sel; sel = sel->sel_next) gobj_select(sel->sel_what, x, 1); x->gl_mapped = 1; + canvas_redraw(x); canvas_drawlines(x); ! if (x->gl_isgraph && x->gl_goprect) canvas_drawredrect(x, 1); sys_mgui(x,"canvas_getscroll",""); } ! } else { ! if (glist_isvisible(x)) {sys_mgui(x,"erase",""); x->gl_mapped=0;} } }
void canvas_redraw(t_canvas *x) { ! if (!glist_isvisible(x)) return; ! t_gobj *y; ! // glist_each(y,x) {} ! if (glist_isvisible(x)) {canvas_map(x,0); canvas_map(x, 1);} }
*************** *** 1073,1077 **** you gave it to open it; perhaps there's a 1-pixel border all around it or something. Anyway, we just add the 2 pixels back here; seems we ! have to do this for linux but not MSW; not sure about MacOS. */
#ifdef MSW --- 1055,1059 ---- you gave it to open it; perhaps there's a 1-pixel border all around it or something. Anyway, we just add the 2 pixels back here; seems we ! have to do this for linux but not MSW; not sure about MacOS. */
#ifdef MSW *************** *** 13408,13415 **** t_canvas *self = (t_canvas *)x; post("canvas_notice(%p,%p,%d,...)",x,origin,argc); ! if (self->gl_havewindow) { manager_notice(manager,origin,argc,argv); } else { ! } } --- 13390,13397 ---- t_canvas *self = (t_canvas *)x; post("canvas_notice(%p,%p,%d,...)",x,origin,argc); ! if (self->gl_havewindow && self->gl_mapped) { manager_notice(manager,origin,argc,argv); } else { ! gobj_changed3(self,origin,argc,argv); } }