From 64fdb009695828b788fce074135b20a5e52c5fc4 Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Tue, 23 Sep 2003 00:21:28 +0000 Subject: imported version 0.37-0 svn path=/trunk/; revision=1016 --- pd/src/m_class.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'pd/src/m_class.c') diff --git a/pd/src/m_class.c b/pd/src/m_class.c index b13db89d..15610b23 100644 --- a/pd/src/m_class.c +++ b/pd/src/m_class.c @@ -86,6 +86,7 @@ static void pd_defaultsymbol(t_pd *x, t_symbol *s) } void obj_list(t_object *x, t_symbol *s, int argc, t_atom *argv); +static void class_nosavefn(t_gobj *z, t_binbuf *b); /* handle "list" messages to Pds without explicit list methods defined. */ static void pd_defaultlist(t_pd *x, t_symbol *s, int argc, t_atom *argv) @@ -141,6 +142,7 @@ static void pd_defaultlist(t_pd *x, t_symbol *s, int argc, t_atom *argv) how this is handled. */ extern t_widgetbehavior text_widgetbehavior; +extern void text_save(t_gobj *z, t_binbuf *b); t_class *class_new(t_symbol *s, t_newmethod newmethod, t_method freemethod, size_t size, int flags, t_atomtype type1, ...) @@ -205,6 +207,7 @@ t_class *class_new(t_symbol *s, t_newmethod newmethod, t_method freemethod, c->c_drawcommand = 0; c->c_floatsignalin = 0; c->c_externdir = class_extern_dir; + c->c_savefn = (typeflag == CLASS_PATCHABLE ? text_save : class_nosavefn); #if 0 post("class: %s", c->c_name->s_name); #endif @@ -417,6 +420,30 @@ char *class_gethelpdir(t_class *c) return (c->c_externdir->s_name); } +static void class_nosavefn(t_gobj *z, t_binbuf *b) +{ + bug("save function called but not defined"); +} + +void class_setsavefn(t_class *c, t_savefn f) +{ + c->c_savefn = f; +} + +t_savefn class_getsavefn(t_class *c) +{ + return (c->c_savefn); +} + +void class_setpropertiesfn(t_class *c, t_propertiesfn f) +{ + c->c_propertiesfn = f; +} + +t_propertiesfn class_getpropertiesfn(t_class *c) +{ + return (c->c_propertiesfn); +} /* ---------------- the symbol table ------------------------ */ -- cgit v1.2.1