aboutsummaryrefslogtreecommitdiff
path: root/src/getdollarzero.c
diff options
context:
space:
mode:
authorThomas O Fredericks <mrtof@users.sourceforge.net>2007-10-04 16:28:30 +0000
committerThomas O Fredericks <mrtof@users.sourceforge.net>2007-10-04 16:28:30 +0000
commit0cb89848b7d2be4b1d0021823d2707b855891ea0 (patch)
tree300260706cd678a41c3de9f6dd7a4088faab6dd7 /src/getdollarzero.c
parent31f625c4e5eaf443872eece61b9a7156121669d9 (diff)
Changing directory structure for externals/tof
svn path=/trunk/externals/tof/; revision=8783
Diffstat (limited to 'src/getdollarzero.c')
-rwxr-xr-xsrc/getdollarzero.c64
1 files changed, 64 insertions, 0 deletions
diff --git a/src/getdollarzero.c b/src/getdollarzero.c
new file mode 100755
index 0000000..8a19486
--- /dev/null
+++ b/src/getdollarzero.c
@@ -0,0 +1,64 @@
+/* (C) 2005 Guenter Geiger */
+
+#include "m_pd.h"
+#include "g_canvas.h"
+
+
+/* HACK
+
+struct _glist
+{
+ t_object gl_obj; // header in case we're a glist
+ t_gobj *gl_list; // the actual data
+ struct _gstub *gl_stub; // safe pointer handler
+ int gl_valid; // incremented when pointers might be stale
+ struct _glist *gl_owner; // parent glist, supercanvas, or 0 if none
+};
+
+END HACK
+
+*/
+
+typedef struct getdollarzero
+{
+ t_object x_ob;
+ t_canvas * x_canvas;
+ t_outlet* x_outlet;
+ int x_level;
+} t_getdollarzero;
+
+
+
+
+static void getdollarzero_bang(t_getdollarzero *x)
+{
+ int i = x->x_level;
+ t_canvas* last = x->x_canvas;
+
+ while (i>0) {
+ i--;
+ if (last->gl_owner) last = last->gl_owner;
+ }
+// x->s_parent_unique = canvas_realizedollar((t_canvas *)this_canvas->gl_owner, gensym("$0"));
+ //outlet_symbol(x->x_outlet,canvas_getdir(last));
+ outlet_symbol(x->x_outlet,canvas_realizedollar(last, gensym("$0")));
+}
+
+t_class *getdollarzero_class;
+
+static void *getdollarzero_new(t_floatarg level)
+{
+ t_getdollarzero *x = (t_getdollarzero *)pd_new(getdollarzero_class);
+ x->x_canvas = canvas_getcurrent();
+ x->x_outlet = outlet_new(&x->x_ob, &s_);
+ x->x_level = level;
+ return (void *)x;
+}
+
+void getdollarzero_setup(void)
+{
+ getdollarzero_class = class_new(gensym("getdollarzero"), (t_newmethod)getdollarzero_new, 0,
+ sizeof(t_getdollarzero), 0, A_DEFFLOAT,0);
+ class_addbang(getdollarzero_class, getdollarzero_bang);
+}
+