diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2003-04-15 23:39:17 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2003-04-15 23:39:17 +0000 |
commit | 53cc9384d554e1e8a988471c1ee887c48fbb701f (patch) | |
tree | 1725a3c1777c59bc6361a37e0f2e15f53419a7ca /externals/grill/flext/source/flclass.h | |
parent | e4991ce586558b0ff3a06b7c0c4022d2083c4d01 (diff) |
""
svn path=/trunk/; revision=563
Diffstat (limited to 'externals/grill/flext/source/flclass.h')
-rw-r--r-- | externals/grill/flext/source/flclass.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/externals/grill/flext/source/flclass.h b/externals/grill/flext/source/flclass.h index 67926266..216c35fc 100644 --- a/externals/grill/flext/source/flclass.h +++ b/externals/grill/flext/source/flclass.h @@ -83,12 +83,10 @@ public: /*! \brief Called for every incoming message. All method handling is done in there \return True if a handler was found and called - \todo Once, there should be a const modifier for argv */ virtual bool m_methodmain(int inlet,const t_symbol *s,int argc,const t_atom *argv); /*! \brief Called for every unhandled message (by m_methodmain) - \todo Once, there should be a const modifier for argv */ virtual bool m_method_(int inlet,const t_symbol *s,int argc,const t_atom *argv); @@ -411,9 +409,16 @@ public: bool Unbind(const char *c) { return Unbind(MakeSymbol(c)); } #endif - bool BindMethod(const t_symbol *s,bool (*m)(flext_base *,t_symbol *s,int,t_atom *)); + //! Bind a method to a symbol + bool BindMethod(const t_symbol *s,bool (*m)(flext_base *,t_symbol *s,int argc,t_atom *argv,void *data),void *data = NULL); + //! Unbind a method from a symbol bool UnbindMethod(const t_symbol *s); + //! Bind a method to a symbol (as string) + bool BindMethod(const char *c,bool (*m)(flext_base *,t_symbol *s,int argc,t_atom *argv,void *data),void *data = NULL) { return BindMethod(MakeSymbol(c),m,data); } + //! Unbind a method from a symbol (as string) + bool UnbindMethod(const char *c) { return UnbindMethod(MakeSymbol(c)); } + //! @} FLEXT_C_BIND // --- thread stuff ----------------------------------------------- @@ -607,10 +612,10 @@ public: class binditem: public item { public: - binditem(int inlet,const t_symbol *sym,bool (*f)(flext_base *,t_symbol *s,int,t_atom *),pxbnd_object *px); + binditem(int inlet,const t_symbol *sym,bool (*f)(flext_base *,t_symbol *s,int,t_atom *,void *),pxbnd_object *px); ~binditem(); - bool (*fun)(flext_base *,t_symbol *s,int,t_atom *); + bool (*fun)(flext_base *,t_symbol *s,int,t_atom *,void *); pxbnd_object *px; }; @@ -763,8 +768,9 @@ private: t_object obj; // MUST reside at memory offset 0 flext_base *base; binditem *item; + void *data; - void init(flext_base *b,binditem *it) { base = b; item = it; } + void init(flext_base *b,binditem *it,void *d) { base = b; item = it; data = d; } static void px_method(pxbnd_object *c,const t_symbol *s,int argc,t_atom *argv); }; |