diff options
author | musil <tmusil@users.sourceforge.net> | 2005-07-08 02:13:24 +0000 |
---|---|---|
committer | musil <tmusil@users.sourceforge.net> | 2005-07-08 02:13:24 +0000 |
commit | 486e5ff7ebf4ed0fe1089ac73643c8dbca9b838a (patch) | |
tree | 0337836172df6f3f7e4fc0df82a6c189ceaa84b9 /src/iemlib2/parentdollarzero.c | |
parent | db5d53888df18ef8ab2f6109ddcfb2b7c7a0e611 (diff) |
dos-return
svn path=/trunk/externals/iemlib/; revision=3301
Diffstat (limited to 'src/iemlib2/parentdollarzero.c')
-rw-r--r-- | src/iemlib2/parentdollarzero.c | 120 |
1 files changed, 60 insertions, 60 deletions
diff --git a/src/iemlib2/parentdollarzero.c b/src/iemlib2/parentdollarzero.c index 947d87e..477c2c5 100644 --- a/src/iemlib2/parentdollarzero.c +++ b/src/iemlib2/parentdollarzero.c @@ -1,60 +1,60 @@ -/* For information on usage and redistribution, and for a DISCLAIMER OF ALL
-* WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-
-iemlib2 written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2005 */
-
-#ifdef NT
-#pragma warning( disable : 4244 )
-#pragma warning( disable : 4305 )
-#endif
-
-#include "m_pd.h"
-#include "g_canvas.h"
-#include "iemlib.h"
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <math.h>
-
-/* -------------- parentdollarzero --------------- */
-/* -- receives the $0 value of the parent canvas --*/
-
-static t_class *parentdollarzero_class;
-
-typedef struct _parentdollarzero
-{
- t_object x_obj;
- t_symbol *s_parent_unique;
- unsigned int x_is_there_a_parent;
-} t_parentdollarzero;
-
-static void parentdollarzero_bang(t_parentdollarzero *x)
-{
- if(x->x_is_there_a_parent)
- outlet_symbol(x->x_obj.ob_outlet, x->s_parent_unique);
-}
-
-static void *parentdollarzero_new(void)
-{
- t_parentdollarzero *x = (t_parentdollarzero *)pd_new(parentdollarzero_class);
- t_glist *glist = (t_glist *)canvas_getcurrent();
- t_canvas *this_canvas = glist_getcanvas(glist);
-
- x->x_is_there_a_parent = (unsigned int)this_canvas->gl_owner;
-
- if(x->x_is_there_a_parent)
- x->s_parent_unique = canvas_realizedollar((t_canvas *)this_canvas->gl_owner, gensym("$0"));
- else
- x->s_parent_unique = gensym("");
- outlet_new(&x->x_obj, &s_symbol);
- return (x);
-}
-
-void parentdollarzero_setup(void)
-{
- parentdollarzero_class = class_new(gensym("parentdollarzero"), (t_newmethod)parentdollarzero_new,
- 0, sizeof(t_parentdollarzero), 0, 0);
- class_addcreator((t_newmethod)parentdollarzero_new, gensym("parent$0"), 0);
- class_addbang(parentdollarzero_class, (t_method)parentdollarzero_bang);
- class_sethelpsymbol(parentdollarzero_class, gensym("iemhelp/help-parentdollarzero"));
-}
+/* For information on usage and redistribution, and for a DISCLAIMER OF ALL +* WARRANTIES, see the file, "LICENSE.txt," in this distribution. + +iemlib2 written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2005 */ + +#ifdef NT +#pragma warning( disable : 4244 ) +#pragma warning( disable : 4305 ) +#endif + +#include "m_pd.h" +#include "g_canvas.h" +#include "iemlib.h" +#include <stdlib.h> +#include <string.h> +#include <stdio.h> +#include <math.h> + +/* -------------- parentdollarzero --------------- */ +/* -- receives the $0 value of the parent canvas --*/ + +static t_class *parentdollarzero_class; + +typedef struct _parentdollarzero +{ + t_object x_obj; + t_symbol *s_parent_unique; + unsigned int x_is_there_a_parent; +} t_parentdollarzero; + +static void parentdollarzero_bang(t_parentdollarzero *x) +{ + if(x->x_is_there_a_parent) + outlet_symbol(x->x_obj.ob_outlet, x->s_parent_unique); +} + +static void *parentdollarzero_new(void) +{ + t_parentdollarzero *x = (t_parentdollarzero *)pd_new(parentdollarzero_class); + t_glist *glist = (t_glist *)canvas_getcurrent(); + t_canvas *this_canvas = glist_getcanvas(glist); + + x->x_is_there_a_parent = (unsigned int)this_canvas->gl_owner; + + if(x->x_is_there_a_parent) + x->s_parent_unique = canvas_realizedollar((t_canvas *)this_canvas->gl_owner, gensym("$0")); + else + x->s_parent_unique = gensym(""); + outlet_new(&x->x_obj, &s_symbol); + return (x); +} + +void parentdollarzero_setup(void) +{ + parentdollarzero_class = class_new(gensym("parentdollarzero"), (t_newmethod)parentdollarzero_new, + 0, sizeof(t_parentdollarzero), 0, 0); + class_addcreator((t_newmethod)parentdollarzero_new, gensym("parent$0"), 0); + class_addbang(parentdollarzero_class, (t_method)parentdollarzero_bang); + class_sethelpsymbol(parentdollarzero_class, gensym("iemhelp/help-parentdollarzero")); +} |