From a431a46da7eefba0c9bc45842a4cd63769eab900 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Mon, 15 Sep 2003 04:43:47 +0000 Subject: updated #ifdef code to make savefn and propertiesfn work under 0.37 svn path=/trunk/externals/unauthorized/; revision=965 --- sonogram~/sonogram~-joge.c | 13 +++++++++---- sonogram~/sonogram~-yves.c | 13 +++++++++---- sonogram~/sonogram~.c | 13 +++++++++---- 3 files changed, 27 insertions(+), 12 deletions(-) (limited to 'sonogram~') diff --git a/sonogram~/sonogram~-joge.c b/sonogram~/sonogram~-joge.c index b6e6c97..e9c8927 100644 --- a/sonogram~/sonogram~-joge.c +++ b/sonogram~/sonogram~-joge.c @@ -1992,13 +1992,18 @@ void sonogram_tilde_setup(void) sonogram_widgetbehavior.w_deletefn = sonogram_delete; sonogram_widgetbehavior.w_visfn = sonogram_vis; sonogram_widgetbehavior.w_clickfn = sonogram_click; - /* As of 0.37, the last two elements of t_widgetbehavoir */ - /* have been removed. */ -#if PD_MAJOR_VERSION == 0 + /* + * : As of 0.37, pd does not have these last + * two elements in t_widgetbehavoir anymore. + * see pd/src/notes.txt: + * savefunction and dialog into class structure + */ #if PD_MINOR_VERSION < 37 || !defined(PD_MINOR_VERSION) sonogram_widgetbehavior.w_propertiesfn = NULL; sonogram_widgetbehavior.w_savefn = sonogram_save; -#endif +#else + class_setpropertiesfn(sonogram_class, NULL); + class_setsavefn(sonogram_class, &sonogram_save); #endif CLASS_MAINSIGNALIN( sonogram_class, t_sonogram, x_f ); diff --git a/sonogram~/sonogram~-yves.c b/sonogram~/sonogram~-yves.c index 6d647ac..4886284 100644 --- a/sonogram~/sonogram~-yves.c +++ b/sonogram~/sonogram~-yves.c @@ -1963,13 +1963,18 @@ void sonogram_tilde_setup(void) sonogram_widgetbehavior.w_deletefn = sonogram_delete; sonogram_widgetbehavior.w_visfn = sonogram_vis; sonogram_widgetbehavior.w_clickfn = sonogram_click; - /* As of 0.37, the last two elements of t_widgetbehavoir */ - /* have been removed. */ -#if PD_MAJOR_VERSION == 0 + /* + * : As of 0.37, pd does not have these last + * two elements in t_widgetbehavoir anymore. + * see pd/src/notes.txt: + * savefunction and dialog into class structure + */ #if PD_MINOR_VERSION < 37 || !defined(PD_MINOR_VERSION) sonogram_widgetbehavior.w_propertiesfn = NULL; sonogram_widgetbehavior.w_savefn = sonogram_save; -#endif +#else + class_setpropertiesfn(sonogram_class, NULL); + class_setsavefn(sonogram_class, &sonogram_save); #endif CLASS_MAINSIGNALIN( sonogram_class, t_sonogram, x_f ); diff --git a/sonogram~/sonogram~.c b/sonogram~/sonogram~.c index 4d9dfb1..61d12d9 100644 --- a/sonogram~/sonogram~.c +++ b/sonogram~/sonogram~.c @@ -2028,13 +2028,18 @@ void sonogram_tilde_setup(void) sonogram_widgetbehavior.w_deletefn = sonogram_delete; sonogram_widgetbehavior.w_visfn = sonogram_vis; sonogram_widgetbehavior.w_clickfn = sonogram_click; - /* As of 0.37, the last two elements of t_widgetbehavoir */ - /* have been removed. */ -#if PD_MAJOR_VERSION == 0 + /* + * : As of 0.37, pd does not have these last + * two elements in t_widgetbehavoir anymore. + * see pd/src/notes.txt: + * savefunction and dialog into class structure + */ #if PD_MINOR_VERSION < 37 || !defined(PD_MINOR_VERSION) sonogram_widgetbehavior.w_propertiesfn = NULL; sonogram_widgetbehavior.w_savefn = sonogram_save; -#endif +#else + class_setpropertiesfn(sonogram_class, NULL); + class_setsavefn(sonogram_class, &sonogram_save); #endif CLASS_MAINSIGNALIN( sonogram_class, t_sonogram, x_f ); -- cgit v1.2.1