[PD-cvs] pd/src desire.c, 1.1.2.160, 1.1.2.161 desire.h, 1.1.2.29, 1.1.2.30
Mathieu Bouchard
matju at users.sourceforge.net
Thu Sep 7 03:54:55 CEST 2006
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13420
Modified Files:
Tag: devel_0_39
desire.c desire.h
Log Message:
t_editor is dead
Index: desire.h
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.h,v
retrieving revision 1.1.2.29
retrieving revision 1.1.2.30
diff -C2 -d -r1.1.2.29 -r1.1.2.30
*** desire.h 7 Sep 2006 01:39:34 -0000 1.1.2.29
--- desire.h 7 Sep 2006 01:54:53 -0000 1.1.2.30
***************
*** 66,76 ****
#define t_fielddesc struct _fielddesc
- /* this structure is instantiated whenever a glist becomes visible. */
- typedef struct _editor {
- t_binbuf *connectbuf; /* connections to deleted objects */
- t_guiconnect *guiconnect; /* GUI connection for filtering messages */
- struct _glist *glist; /* glist which owns this */
- } t_editor;
-
/* the t_tick structure describes where to draw x and y "ticks" for a glist */
typedef struct _tick { /* where to put ticks on x or y axes */
--- 66,69 ----
***************
*** 98,102 ****
t_tick xtick; int nxlabels; t_symbol **xlabel; float xlabely;
t_tick ytick; int nylabels; t_symbol **ylabel; float ylabelx;
- t_editor *editor; /* editor structure when visible */
t_symbol *name; /* symbol bound here */
int font; /* nominal font size in points, e.g., 10 */
--- 91,94 ----
***************
*** 109,113 ****
--- 101,108 ----
unsigned int goprect:1; /* draw rectangle for graph-on-parent */
unsigned int isgraph:1; /* show as graph on parent */
+ unsigned int editor:1; /* have an editor */
long next_add; /* insertion point for next call to glist_add (for future use!?) */
+ t_binbuf *connectbuf; /* connections to deleted objects */
+ t_guiconnect *guiconnect; /* GUI connection for filtering messages */
};
Index: desire.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v
retrieving revision 1.1.2.160
retrieving revision 1.1.2.161
diff -C2 -d -r1.1.2.160 -r1.1.2.161
*** desire.c 7 Sep 2006 01:39:33 -0000 1.1.2.160
--- desire.c 7 Sep 2006 01:54:52 -0000 1.1.2.161
***************
*** 653,674 ****
t_guiconnect *guiconnect_new(t_pd *who, t_symbol *sym);
- static t_editor *editor_new(t_glist *owner) {
- char buf[40];
- t_editor *x = (t_editor *)getbytes(sizeof(*x));
- x->connectbuf = binbuf_new();
- x->glist = owner;
- sprintf(buf, ".x%lx", (long)owner);
- x->guiconnect = guiconnect_new((t_pd *)owner, gensym(buf));
- return x;
- }
-
static void guiconnect_notarget(t_guiconnect *x, double timedelay);
- static void editor_free(t_editor *x, t_glist *y) {
- guiconnect_notarget(x->guiconnect, 1000);
- binbuf_free(x->connectbuf);
- freebytes((void *)x, sizeof(*x));
- }
-
/* recursively create or destroy all editors of a glist and its
sub-glists, as long as they aren't toplevels. */
--- 653,658 ----
***************
*** 678,687 ****
if (createit) {
if (x->editor) bug("canvas_create_editor");
! else x->editor = editor_new(x);
} else {
if (!x->editor) bug("canvas_create_editor");
else {
- editor_free(x->editor, x);
x->editor = 0;
}
}
--- 662,678 ----
if (createit) {
if (x->editor) bug("canvas_create_editor");
! else {
! char buf[40];
! x->editor = 1;
! x->connectbuf = binbuf_new();
! sprintf(buf, ".x%lx", (long)x);
! x->guiconnect = guiconnect_new((t_pd *)x, gensym(buf));
! }
} else {
if (!x->editor) bug("canvas_create_editor");
else {
x->editor = 0;
+ guiconnect_notarget(x->guiconnect, 1000);
+ binbuf_free(x->connectbuf);
}
}
***************
*** 1433,1437 ****
t_binbuf *b;
if (!x->editor) {error("canvas_stowconnections without editor"); return;}
! b = x->editor->connectbuf;
/* split list to "selected" and "unselected" parts */
--- 1424,1428 ----
t_binbuf *b;
if (!x->editor) {error("canvas_stowconnections without editor"); return;}
! b = x->connectbuf;
/* split list to "selected" and "unselected" parts */
***************
*** 1461,1472 ****
glist_getindex(x, &t.to->ob_g), t.inlet);
}
! post("<canvas_stowconnections>");
! binbuf_print(x->editor->connectbuf);
! post("</canvas_stowconnections>");
}
static void canvas_restoreconnections(t_canvas *x) {
pd_bind((t_pd *)x, gensym("#X"));
! binbuf_eval(x->editor->connectbuf, 0, 0, 0);
pd_unbind((t_pd *)x, gensym("#X"));
}
--- 1452,1461 ----
glist_getindex(x, &t.to->ob_g), t.inlet);
}
! //binbuf_print(x->connectbuf);
}
static void canvas_restoreconnections(t_canvas *x) {
pd_bind((t_pd *)x, gensym("#X"));
! binbuf_eval(x->connectbuf, 0, 0, 0);
pd_unbind((t_pd *)x, gensym("#X"));
}
More information about the Pd-cvs
mailing list