diff options
author | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2009-11-10 21:08:48 +0000 |
---|---|---|
committer | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2009-11-10 21:08:48 +0000 |
commit | 49180536552f487ca12e2173a93aae6a17ccfcca (patch) | |
tree | 93c9729987034227e1283c16380397bc1f957a49 /externals/vanilla/keyup.c | |
parent | 33b135d7fc381a22965586e0567ede4da11eade3 (diff) |
split out the objects in x_gui.c into standalone files and put the gfxstub stuff into e_gfxstub.c
svn path=/trunk/; revision=12749
Diffstat (limited to 'externals/vanilla/keyup.c')
-rw-r--r-- | externals/vanilla/keyup.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/externals/vanilla/keyup.c b/externals/vanilla/keyup.c new file mode 100644 index 00000000..5034b75a --- /dev/null +++ b/externals/vanilla/keyup.c @@ -0,0 +1,43 @@ +/* Copyright (c) 1997-2000 Miller Puckette. +* For information on usage and redistribution, and for a DISCLAIMER OF ALL +* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ + +#include "m_pd.h" +#include <stdio.h> +#include <string.h> + +static t_symbol *keyup_sym; +static t_class *keyup_class; + +typedef struct _keyup +{ + t_object x_obj; +} t_keyup; + +static void *keyup_new( void) +{ + t_keyup *x = (t_keyup *)pd_new(keyup_class); + outlet_new(&x->x_obj, &s_float); + pd_bind(&x->x_obj.ob_pd, keyup_sym); + return (x); +} + +static void keyup_float(t_keyup *x, t_floatarg f) +{ + outlet_float(x->x_obj.ob_outlet, f); +} + +static void keyup_free(t_keyup *x) +{ + pd_unbind(&x->x_obj.ob_pd, keyup_sym); +} + +void keyup_setup(void) +{ + keyup_class = class_new(gensym("keyup"), + (t_newmethod)keyup_new, (t_method)keyup_free, + sizeof(t_keyup), CLASS_NOINLET, 0); + class_addfloat(keyup_class, keyup_float); + keyup_sym = gensym("#keyup"); + class_sethelpsymbol(keyup_class, gensym("key")); +} |