fldefs_attrcb.h
Go to the documentation of this file.
/*
flext - C++ layer for Max and Pure Data externals
Copyright (c) 2001-2015 Thomas Grill (gr@grrrr.org)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.
*/
#ifndef __FLEXT_DEFS_ATTRCB_H
#define __FLEXT_DEFS_ATTRCB_H
#define FLEXT_CALLSET_(FUN,TP) \
static bool FLEXT_SET_PRE(FUN)(flext_base *c,TP &arg) \
{ FLEXT_CAST<thisType *>(c)->FUN(arg); return true; }
#define FLEXT_CALLGET_(FUN,TP) \
static bool FLEXT_GET_PRE(FUN)(flext_base *c,TP &arg) \
{ FLEXT_CAST<thisType *>(c)->FUN(arg); return true; }
#define FLEXT_CALLSET_F(SFUN) \
\
FLEXT_CALLSET_(SFUN,float)
#define FLEXT_CALLSET_I(SFUN) \
\
FLEXT_CALLSET_(SFUN,int)
#define FLEXT_CALLSET_B(SFUN) \
\
FLEXT_CALLSET_(SFUN,bool)
/*
static bool FLEXT_SET_PRE(FUN)(flext_base *c,int &arg) \
{ bool b = arg != 0; FLEXT_CAST<thisType *>(c)->FUN(b); return true; }
*/
#define FLEXT_CALLSET_E(SFUN,TP) \
\
FLEXT_CALLSET_(SFUN,TP)
#define FLEXT_CALLSET_S(FUN) \
static bool FLEXT_SET_PRE(FUN)(flext_base *c,const t_symbol *&arg) \
{ FLEXT_CAST<thisType *>(c)->FUN(arg); return true; }
#define FLEXT_CALLSET_V(FUN) \
static bool FLEXT_SET_PRE(FUN)(flext_base *c,flext::AtomList *&arg) \
{ FLEXT_CAST<thisType *>(c)->FUN(*arg); return true; }
#define FLEXT_CALLGET_F(GFUN) \
\
FLEXT_CALLGET_(GFUN,float)
#define FLEXT_CALLGET_I(GFUN) \
\
FLEXT_CALLGET_(GFUN,int)
#define FLEXT_CALLGET_B(GFUN) \
\
FLEXT_CALLGET_(GFUN,bool)
/*
static bool FLEXT_GET_PRE(FUN)(flext_base *c,int &arg) \
{ bool b; FLEXT_CAST<thisType *>(c)->FUN(b); arg = b?1:0; return true; }
*/
#define FLEXT_CALLGET_E(GFUN,TP) \
\
FLEXT_CALLGET_(GFUN,TP)
#define FLEXT_CALLGET_S(FUN) \
static bool FLEXT_GET_PRE(FUN)(flext_base *c,const t_symbol *&arg) \
{ FLEXT_CAST<thisType *>(c)->FUN(arg); return true; }
#define FLEXT_CALLGET_V(FUN) \
static bool FLEXT_GET_PRE(FUN)(flext_base *c,flext::AtomList *&arg) \
{ FLEXT_CAST<thisType *>(c)->FUN(*arg); return true; }
#define FLEXT_CALLVAR_F(GFUN,SFUN) \
\
FLEXT_CALLGET_F(GFUN) FLEXT_CALLSET_F(SFUN)
#define FLEXT_CALLVAR_I(GFUN,SFUN) \
\
FLEXT_CALLGET_I(GFUN) FLEXT_CALLSET_I(SFUN)
#define FLEXT_CALLVAR_S(GFUN,SFUN) \
\
FLEXT_CALLGET_S(GFUN) FLEXT_CALLSET_S(SFUN)
#define FLEXT_CALLVAR_B(GFUN,SFUN) \
\
FLEXT_CALLGET_B(GFUN) FLEXT_CALLSET_B(SFUN)
#define FLEXT_CALLVAR_E(GFUN,SFUN,TP) \
\
FLEXT_CALLGET_E(GFUN,TP) FLEXT_CALLSET_E(SFUN,TP)
#define FLEXT_CALLVAR_V(GFUN,SFUN) \
\
FLEXT_CALLGET_V(GFUN) FLEXT_CALLSET_V(SFUN)
#endif