Commit f702006d authored by Thomas Grill's avatar Thomas Grill
Browse files

Changes related to template-based flext classes

parent 60f03b9b
This diff is collapsed.
......@@ -2,7 +2,7 @@
flext - C++ layer for Max/MSP and pd (pure data) externals
Copyright (c) 2001-2009 Thomas Grill (gr@grrrr.org)
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.
......@@ -15,13 +15,16 @@ $LastChangedBy$
\brief Definitions for handling the t_atom type and lists thereof.
*/
#include "flext.h"
#ifndef FLEXT_INLINE
# include "flext.h"
#endif
#include <cstring> // for memcpy
#include "flpushns.h"
#if FLEXT_SYS != FLEXT_SYS_JMAX
int flext::CmpAtom(const t_atom &a,const t_atom &b)
FLEXT_TEMPIMPL(int FLEXT_CLASSDEF(flext))::CmpAtom(const t_atom &a,const t_atom &b)
{
if(GetType(a) == GetType(b)) {
switch(GetType(a)) {
......@@ -46,14 +49,14 @@ int flext::CmpAtom(const t_atom &a,const t_atom &b)
#error Not implemented
#endif
t_atom *flext::CopyList(int argc,const t_atom *argv)
FLEXT_TEMPIMPL(t_atom *FLEXT_CLASSDEF(flext))::CopyList(int argc,const t_atom *argv)
{
t_atom *dst = new t_atom[argc];
memcpy(dst,argv,argc*sizeof(t_atom));
return dst;
}
void flext::CopyAtoms(int cnt,t_atom *dst,const t_atom *src)
FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext))::CopyAtoms(int cnt,t_atom *dst,const t_atom *src)
{
if(dst < src)
// forward
......@@ -63,7 +66,7 @@ void flext::CopyAtoms(int cnt,t_atom *dst,const t_atom *src)
while(cnt--) dst[cnt] = src[cnt];
}
void flext::AtomList::Alloc(int sz,int keepix,int keeplen,int keepto)
FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext))::AtomList::Alloc(int sz,int keepix,int keeplen,int keepto)
{
if(lst) {
if(cnt == sz) {
......@@ -100,9 +103,9 @@ void flext::AtomList::Alloc(int sz,int keepix,int keeplen,int keepto)
}
}
flext::AtomList::~AtomList() { Free(); }
FLEXT_TEMPIMPL(FLEXT_CLASSDEF(flext))::AtomList::~AtomList() { Free(); }
void flext::AtomList::Free()
FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext))::AtomList::Free()
{
if(lst) {
delete[] lst; lst = NULL;
......@@ -112,7 +115,7 @@ void flext::AtomList::Free()
FLEXT_ASSERT(cnt == 0);
}
flext::AtomList &flext::AtomList::Set(int argc,const t_atom *argv,int offs,bool resize)
FLEXT_TEMPIMPL(FLEXT_TEMPSUB(FLEXT_CLASSDEF(flext))::AtomList &FLEXT_CLASSDEF(flext))::AtomList::Set(int argc,const t_atom *argv,int offs,bool resize)
{
int ncnt = argc+offs;
if(resize) Alloc(ncnt);
......@@ -123,7 +126,7 @@ flext::AtomList &flext::AtomList::Set(int argc,const t_atom *argv,int offs,bool
return *this;
}
int flext::AtomList::Compare(const AtomList &a) const
FLEXT_TEMPIMPL(int FLEXT_CLASSDEF(flext))::AtomList::Compare(const AtomList &a) const
{
if(Count() == a.Count()) {
for(int i = 0; i < Count(); ++i) {
......@@ -136,37 +139,42 @@ int flext::AtomList::Compare(const AtomList &a) const
return Count() < a.Count()?-1:1;
}
flext::AtomListStaticBase::~AtomListStaticBase() { Free(); }
FLEXT_TEMPIMPL(FLEXT_CLASSDEF(flext))::AtomListStaticBase::~AtomListStaticBase() { Free(); }
void flext::AtomListStaticBase::Alloc(int sz,int keepix,int keeplen,int keepto)
FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext))::AtomListStaticBase::Alloc(int sz,int keepix,int keeplen,int keepto)
{
if(sz <= precnt) {
// small enough for pre-allocated space
if(lst != predata && lst) {
if(AtomList::lst != predata && AtomList::lst) {
// currently allocated memory is larger than what we need
if(keepix >= 0) {
// keep contents
int c = keeplen >= 0?keeplen:(cnt > sz?sz:cnt);
int c = keeplen >= 0?keeplen:(AtomList::cnt > sz?sz:AtomList::cnt);
FLEXT_ASSERT(c+keepto <= precnt);
FLEXT_ASSERT(c+keepix <= cnt);
CopyAtoms(c,predata+keepto,lst+keepix);
FLEXT_ASSERT(c+keepix <= AtomList::cnt);
CopyAtoms(c,predata+keepto,AtomList::lst+keepix);
}
// free allocated memory
AtomList::Free();
}
lst = predata,cnt = sz;
AtomList::lst = predata;
AtomList::cnt = sz;
}
else
AtomList::Alloc(sz,keepix,keeplen,keepto);
}
void flext::AtomListStaticBase::Free()
FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext))::AtomListStaticBase::Free()
{
if(lst != predata) AtomList::Free();
else lst = NULL,cnt = 0;
if(AtomList::lst != predata)
AtomList::Free();
else {
AtomList::lst = NULL;
AtomList::cnt = 0;
}
}
#include "flpopns.h"
......@@ -19,7 +19,7 @@ $LastChangedBy$
#include "flpushns.h"
int flext::AtomList::Get(t_atom *argv,int mxsz) const
FLEXT_TEMPIMPL(int FLEXT_CLASSDEF(flext))::AtomList::Get(t_atom *argv,int mxsz) const
{
int argc = Count();
if(mxsz >= 0 && argc > mxsz) argc = mxsz;
......@@ -30,7 +30,7 @@ int flext::AtomList::Get(t_atom *argv,int mxsz) const
}
void flext::AtomList::GetPart(int offs,int len,AtomList &ret) const
FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext))::AtomList::GetPart(int offs,int len,AtomList &ret) const
{
if(offs+len > Count()) {
len = Count()-offs;
......
......@@ -2,7 +2,7 @@
flext - C++ layer for Max/MSP and pd (pure data) externals
Copyright (c) 2001-2009 Thomas Grill (gr@grrrr.org)
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.
......@@ -14,8 +14,11 @@ $LastChangedBy$
/*! \file flatom_pr.cpp
\brief Definitions for printing and scanning the t_atom type.
*/
#include "flext.h"
#ifndef FLEXT_INLINE
# include "flext.h"
#endif
#include <cctype>
#include <cstdlib>
#include <cstring>
......@@ -27,7 +30,7 @@ $LastChangedBy$
#define snprintf _snprintf
#endif
bool flext::PrintAtom(const t_atom &a,char *buf,size_t bufsz)
FLEXT_TEMPIMPL(bool FLEXT_CLASSDEF(flext))::PrintAtom(const t_atom &a,char *buf,size_t bufsz)
{
bool ok = true;
if(IsFloat(a)) {
......@@ -72,7 +75,7 @@ bool flext::PrintAtom(const t_atom &a,char *buf,size_t bufsz)
return ok;
}
bool flext::PrintList(int argc,const t_atom *argv,char *buf,size_t bufsz)
FLEXT_TEMPIMPL(bool FLEXT_CLASSDEF(flext))::PrintList(int argc,const t_atom *argv,char *buf,size_t bufsz)
{
bool ok = true;
for(int i = 0; ok && i < argc && bufsz > 0; ++i) {
......@@ -90,7 +93,7 @@ bool flext::PrintList(int argc,const t_atom *argv,char *buf,size_t bufsz)
}
const char *flext::ScanAtom(t_atom &a,const char *c)
FLEXT_TEMPIMPL(const char *FLEXT_CLASSDEF(flext))::ScanAtom(t_atom &a,const char *c)
{
// skip leading whitespace
while(*c && isspace(*c)) ++c;
......@@ -122,7 +125,7 @@ const char *flext::ScanAtom(t_atom &a,const char *c)
return end;
}
int flext::ScanList(int argc,t_atom *argv,const char *buf)
FLEXT_TEMPIMPL(int FLEXT_CLASSDEF(flext))::ScanList(int argc,t_atom *argv,const char *buf)
{
int read;
for(read = 0; read < argc; ++read)
......
......@@ -2,7 +2,7 @@
flext - C++ layer for Max/MSP and pd (pure data) externals
Copyright (c) 2001-2009 Thomas Grill (gr@grrrr.org)
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.
......@@ -15,7 +15,10 @@ $LastChangedBy$
\brief Attribute handling for the flext base class
*/
#include "flext.h"
#ifndef FLEXT_INLINE
# include "flext.h"
#endif
#include <cstring>
#include <cctype>
#include <set>
......@@ -28,7 +31,7 @@ $LastChangedBy$
#define STD
#endif
flext_base::AttrItem::AttrItem(const t_symbol *t,metharg tp,methfun f,int fl):
FLEXT_TEMPIMPL(FLEXT_CLASSDEF(flext_base))::AttrItem::AttrItem(const t_symbol *t,metharg tp,methfun f,int fl):
Item(NULL),index(0),
flags(fl|afl_shown),
argtp(tp),fun(f),
......@@ -37,25 +40,25 @@ flext_base::AttrItem::AttrItem(const t_symbol *t,metharg tp,methfun f,int fl):
/*
flext_base::AttrDataCont::AttrDataCont() {}
FLEXT_CLASSDEF(flext_base)::AttrDataCont::AttrDataCont() {}
flext_base::AttrDataCont::~AttrDataCont()
FLEXT_CLASSDEF(flext_base)::AttrDataCont::~AttrDataCont()
{
for(iterator it = begin(); it != end(); ++it)
if(it.data()) delete it.data();
}
*/
flext_base::AttrDataCont::~AttrDataCont() { clear(); }
FLEXT_TEMPIMPL(FLEXT_CLASSDEF(flext_base))::AttrDataCont::~AttrDataCont() { clear(); }
void flext_base::AttrDataCont::clear()
FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext_base))::AttrDataCont::clear()
{
for(iterator it(*this); it; ++it) delete it.data();
for(typename AttrDataCont::iterator it(*this); it; ++it) delete it.data();
TablePtrMap<const t_symbol *,AttrData *,8>::clear();
}
//! Add get and set attributes
void flext_base::AddAttrib(ItemCont *aa,ItemCont *ma,const t_symbol *asym,metharg tp,methfun gfun,methfun sfun)
FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext_base))::AddAttrib(ItemCont *aa,ItemCont *ma,const t_symbol *asym,metharg tp,methfun gfun,methfun sfun)
{
AttrItem *a,*b;
......@@ -98,7 +101,7 @@ void flext_base::AddAttrib(ItemCont *aa,ItemCont *ma,const t_symbol *asym,methar
}
}
void flext_base::AddAttrib(const t_symbol *attr,metharg tp,methfun gfun,methfun sfun)
FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext_base))::AddAttrib(const t_symbol *attr,metharg tp,methfun gfun,methfun sfun)
{
if(HasAttributes())
AddAttrib(ThAttrs(),ThMeths(),attr,tp,gfun,sfun);
......@@ -106,12 +109,12 @@ void flext_base::AddAttrib(const t_symbol *attr,metharg tp,methfun gfun,methfun
error("%s - attribute procession is not enabled!",thisName());
}
void flext_base::AddAttrib(t_classid c,const t_symbol *attr,metharg tp,methfun gfun,methfun sfun)
FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext_base))::AddAttrib(t_classid c,const t_symbol *attr,metharg tp,methfun gfun,methfun sfun)
{
AddAttrib(ClAttrs(c),ClMeths(c),attr,tp,gfun,sfun);
}
void flext_base::ListAttrib(AtomList &la) const
FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext_base))::ListAttrib(AtomList &la) const
{
typedef TablePtrMap<int,const t_symbol *,32> AttrList;
AttrList list[2];
......@@ -122,7 +125,7 @@ void flext_base::ListAttrib(AtomList &la) const
ItemCont *a = i?attrhead:clattrhead;
if(a && a->Contained(0)) {
ItemSet &ai = a->GetInlet();
for(ItemSet::iterator as(ai); as; ++as) {
for(typename ItemSet::iterator as(ai); as; ++as) {
for(Item *al = as.data(); al; al = al->nxt) {
AttrItem *aa = (AttrItem *)al;
list[i].insert(aa->index,as.key());
......@@ -139,7 +142,7 @@ void flext_base::ListAttrib(AtomList &la) const
SetSymbol(la[ix++],it.data());
}
int flext_base::CheckAttrib(int argc,const t_atom *argv)
FLEXT_TEMPIMPL(int FLEXT_CLASSDEF(flext_base))::CheckAttrib(int argc,const t_atom *argv)
{
int offs = 0;
for(; offs < argc; ++offs)
......@@ -147,7 +150,7 @@ int flext_base::CheckAttrib(int argc,const t_atom *argv)
return offs;
}
bool flext_base::InitAttrib(int argc,const t_atom *argv)
FLEXT_TEMPIMPL(bool FLEXT_CLASSDEF(flext_base))::InitAttrib(int argc,const t_atom *argv)
{
int cur,nxt;
for(cur = 0; cur < argc; cur = nxt) {
......@@ -193,7 +196,7 @@ bool flext_base::InitAttrib(int argc,const t_atom *argv)
return true;
}
bool flext_base::ListAttrib() const
FLEXT_TEMPIMPL(bool FLEXT_CLASSDEF(flext_base))::ListAttrib() const
{
if(HasAttributes()) {
// defined in flsupport.cpp
......@@ -206,7 +209,7 @@ bool flext_base::ListAttrib() const
return false;
}
flext_base::AttrItem *flext_base::FindAttrib(const t_symbol *tag,bool get,bool msg) const
FLEXT_TEMPIMPL(FLEXT_TEMPSUB(FLEXT_CLASSDEF(flext_base))::AttrItem *FLEXT_CLASSDEF(flext_base))::FindAttrib(const t_symbol *tag,bool get,bool msg) const
{
ItemCont *clattrhead = ClAttrs(thisClassId());
......@@ -234,14 +237,14 @@ flext_base::AttrItem *flext_base::FindAttrib(const t_symbol *tag,bool get,bool m
return a;
}
bool flext_base::SetAttrib(const t_symbol *tag,int argc,const t_atom *argv)
FLEXT_TEMPIMPL(bool FLEXT_CLASSDEF(flext_base))::SetAttrib(const t_symbol *tag,int argc,const t_atom *argv)
{
// search for matching attribute
AttrItem *a = FindAttrib(tag,false,true);
return a && SetAttrib(tag,a,argc,argv);
}
bool flext_base::SetAttrib(const t_symbol *tag,AttrItem *a,int argc,const t_atom *argv)
FLEXT_TEMPIMPL(bool FLEXT_CLASSDEF(flext_base))::SetAttrib(const t_symbol *tag,AttrItem *a,int argc,const t_atom *argv)
{
if(a->fun) {
bool ok = true;
......@@ -303,7 +306,7 @@ bool flext_base::SetAttrib(const t_symbol *tag,AttrItem *a,int argc,const t_atom
}
bool flext_base::GetAttrib(const t_symbol *tag,AttrItem *a,AtomList &la) const
FLEXT_TEMPIMPL(bool FLEXT_CLASSDEF(flext_base))::GetAttrib(const t_symbol *tag,AttrItem *a,AtomList &la) const
{
bool ok = true;
// main attribute tag
......@@ -357,14 +360,14 @@ bool flext_base::GetAttrib(const t_symbol *tag,AttrItem *a,AtomList &la) const
return ok;
}
bool flext_base::GetAttrib(const t_symbol *s,AtomList &a) const
FLEXT_TEMPIMPL(bool FLEXT_CLASSDEF(flext_base))::GetAttrib(const t_symbol *s,AtomList &a) const
{
AttrItem *attr = FindAttrib(s,true);
return attr && GetAttrib(s,attr,a);
}
//! \param tag symbol "get[attribute]"
bool flext_base::DumpAttrib(const t_symbol *tag,AttrItem *a) const
FLEXT_TEMPIMPL(bool FLEXT_CLASSDEF(flext_base))::DumpAttrib(const t_symbol *tag,AttrItem *a) const
{
AtomListStatic<16> la;
bool ret = GetAttrib(tag,a,la);
......@@ -374,13 +377,13 @@ bool flext_base::DumpAttrib(const t_symbol *tag,AttrItem *a) const
return ret;
}
bool flext_base::DumpAttrib(const t_symbol *attr) const
FLEXT_TEMPIMPL(bool FLEXT_CLASSDEF(flext_base))::DumpAttrib(const t_symbol *attr) const
{
AttrItem *item = FindAttrib(attr,true);
return item && DumpAttrib(attr,item);
}
bool flext_base::BangAttrib(const t_symbol *attr,AttrItem *item)
FLEXT_TEMPIMPL(bool FLEXT_CLASSDEF(flext_base))::BangAttrib(const t_symbol *attr,AttrItem *item)
{
AtomListStatic<16> val;
AttrItem *item2;
......@@ -394,13 +397,13 @@ bool flext_base::BangAttrib(const t_symbol *attr,AttrItem *item)
return false;
}
bool flext_base::BangAttrib(const t_symbol *attr)
FLEXT_TEMPIMPL(bool FLEXT_CLASSDEF(flext_base))::BangAttrib(const t_symbol *attr)
{
AttrItem *item = FindAttrib(attr,true);
return item && BangAttrib(attr,item);
}
bool flext_base::BangAttribAll()
FLEXT_TEMPIMPL(bool FLEXT_CLASSDEF(flext_base))::BangAttribAll()
{
ItemCont *clattrhead = ClAttrs(thisClassId());
......@@ -416,7 +419,7 @@ bool flext_base::BangAttribAll()
}
}
*/
for(ItemSet::iterator as(ai); as; ++as) {
for(typename ItemSet::iterator as(ai); as; ++as) {
for(Item *al = as.data(); al; al = al->nxt) {
AttrItem *a = (AttrItem *)al;
if(a->IsGet() && a->BothExist()) BangAttrib(as.key(),a);
......@@ -427,7 +430,7 @@ bool flext_base::BangAttribAll()
return true;
}
bool flext_base::ShowAttrib(AttrItem *a,bool show) const
FLEXT_TEMPIMPL(bool FLEXT_CLASSDEF(flext_base))::ShowAttrib(AttrItem *a,bool show) const
{
if(show) a->flags |= AttrItem::afl_shown;
else a->flags &= ~AttrItem::afl_shown;
......@@ -441,7 +444,7 @@ bool flext_base::ShowAttrib(AttrItem *a,bool show) const
return true;
}
bool flext_base::ShowAttrib(const t_symbol *attr,bool show) const
FLEXT_TEMPIMPL(bool FLEXT_CLASSDEF(flext_base))::ShowAttrib(const t_symbol *attr,bool show) const
{
AttrItem *item = FindAttrib(attr,true);
return item && ShowAttrib(item,show);
......
......@@ -2,7 +2,7 @@
flext - C++ layer for Max/MSP and pd (pure data) externals
Copyright (c) 2001-2009 Thomas Grill (gr@grrrr.org)
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.
......@@ -73,7 +73,8 @@ static t_selectfn ori_select = NULL;
#ifndef FLEXT_NOATTREDIT
//! generate the script for the property dialog
static void tclscript()
template<typename=void>
void tclscript()
{
static bool havecode = false;
if(havecode) return;
......@@ -446,7 +447,7 @@ static void tclscript()
static t_widgetbehavior widgetbehavior;
#endif
void flext_base::SetGfx(t_classid c)
FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext_base))::SetGfx(t_classid c)
{
t_class *cl = getClass(c);
// widgetbehavior struct MUST be resident... (static is just ok here)
......@@ -510,7 +511,8 @@ void flext_base::SetGfx(t_classid c)
#ifndef FLEXT_NOATTREDIT
static size_t escapeit(char *dst,size_t maxlen,const char *src)
template<typename=void>
size_t escapeit(char *dst,size_t maxlen,const char *src)
{
char *d;
for(d = dst; *src && (d-dst) < (int)maxlen; ++src) {
......@@ -523,7 +525,7 @@ static size_t escapeit(char *dst,size_t maxlen,const char *src)
return d-dst;
}
void flext_base::cb_GfxProperties(flext_hdr *c, t_glist *)
FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext_base))::cb_GfxProperties(flext_hdr *c, t_glist *)
{
flext_base *th = thisObject(c);
char buf[1000];
......@@ -638,7 +640,7 @@ void flext_base::cb_GfxProperties(flext_hdr *c, t_glist *)
//! \todo delete proc in TCL space
}
bool flext_base::cb_AttrDialog(flext_base *th,int argc,const t_atom *argv)
FLEXT_TEMPIMPL(bool FLEXT_CLASSDEF(flext_base))::cb_AttrDialog(flext_base *th,int argc,const t_atom *argv)
{
for(int i = 0; i < argc; ) {
FLEXT_ASSERT(IsSymbol(argv[i]));
......@@ -705,7 +707,8 @@ bool flext_base::cb_AttrDialog(flext_base *th,int argc,const t_atom *argv)
#ifdef FLEXT_ATTRHIDE
static void BinbufAdd(t_binbuf *b,const t_atom &at,bool transdoll)
template<typename=void>
void BinbufAdd(t_binbuf *b,const t_atom &at,bool transdoll)
{
if(transdoll && at.a_type == A_DOLLAR) {
char tbuf[MAXPDSTRING];
......@@ -721,7 +724,7 @@ static void BinbufAdd(t_binbuf *b,const t_atom &at,bool transdoll)
binbuf_add(b,1,const_cast<t_atom *>(&at));
}
void flext_base::BinbufArgs(t_binbuf *b,t_binbuf *args,bool withname,bool transdoll)
FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext_base))::BinbufArgs(t_binbuf *b,t_binbuf *args,bool withname,bool transdoll)
{
int argc = binbuf_getnatom(args);
t_atom *argv = binbuf_getvec(args);
......@@ -730,7 +733,7 @@ void flext_base::BinbufArgs(t_binbuf *b,t_binbuf *args,bool withname,bool transd
for(i = withname?0:1; i < cnt; ++i) BinbufAdd(b,argv[i],transdoll);
}
void flext_base::BinbufAttr(t_binbuf *b,bool transdoll)
FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext_base))::BinbufAttr(t_binbuf *b,bool transdoll)
{
// process the attributes
AtomListStatic<32> la,lv;
......@@ -789,7 +792,7 @@ void flext_base::BinbufAttr(t_binbuf *b,bool transdoll)
}
//! Strip the attributes off the object command line
void flext_base::cb_GfxVis(flext_hdr *c, t_glist *gl, int vis)
FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext_base))::cb_GfxVis(flext_hdr *c, t_glist *gl, int vis)
{
if(!gl->gl_isgraph || gl->gl_havewindow) {
// show object if it's not inside a GOP
......@@ -819,7 +822,7 @@ void flext_base::cb_GfxVis(flext_hdr *c, t_glist *gl, int vis)
// else don't show
}
void flext_base::cb_GfxSelect(flext_hdr *c,t_glist *gl,int state)
FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext_base))::cb_GfxSelect(flext_hdr *c,t_glist *gl,int state)
{
t_text *x = (t_text *)c;
flext_base *th = thisObject(c);
......@@ -858,7 +861,7 @@ void flext_base::cb_GfxSelect(flext_hdr *c,t_glist *gl,int state)
}
}
void flext_base::cb_GfxSave(flext_hdr *c, t_binbuf *b)
FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext_base))::cb_GfxSave(flext_hdr *c, t_binbuf *b)
{
flext_base *th = thisObject(c);
t_text *t = (t_text *)c;
......
......@@ -16,8 +16,11 @@ $LastChangedBy$
\remark This is all derived from GEM by Mark Danks
*/
#include "flext.h"
#ifndef FLEXT_INLINE
# include "flext.h"
#endif
#include "flinternal.h"
#include <cstring>
#include <cctype>
......
......@@ -2,7 +2,7 @@
flext - C++ layer for Max/MSP and pd (pure data) externals
Copyright (c) 2001-2009 Thomas Grill (gr@grrrr.org)
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.
......
......@@ -2,7 +2,7 @@
flext - C++ layer for Max/MSP and pd (pure data) externals
Copyright (c) 2001-2009 Thomas Grill (gr@grrrr.org)
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.
......@@ -20,7 +20,7 @@ $LastChangedBy$
#include "flpushns.h"
t_class *flext_base::pxbnd_class = NULL;
FLEXT_TEMPIMPL(t_class *FLEXT_CLASSDEF(flext_base))::pxbnd_class = NULL;
#if FLEXT_SYS == FLEXT_SYS_MAX
t_object *px_freelist = NULL;
......@@ -29,7 +29,7 @@ t_messlist px_messlist[3];
/*! \brief Set up the proxy class for symbol-bound methods
*/
void flext_base::SetupBindProxy()
FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext_base))::SetupBindProxy()
{
// already initialized?
if(!pxbnd_class) {
......@@ -60,11 +60,11 @@ void flext_base::SetupBindProxy()
}
flext_base::BindItem::BindItem(bool (*f)(flext_base *,t_symbol *s,int,t_atom *,void *data),pxbnd_object *p):
FLEXT_TEMPIMPL(FLEXT_CLASSDEF(flext_base))::BindItem::BindItem(bool (*f)(flext_base *,t_symbol *s,int,t_atom *,void *data),pxbnd_object *p):
Item(NULL),fun(f),px(p)
{}
flext_base::BindItem::~BindItem()
FLEXT_TEMPIMPL(FLEXT_CLASSDEF(flext_base))::BindItem::~BindItem()
{
if(px) {
FLEXT_ASSERT(!fun); // check if already unbound
......@@ -72,7 +72,7 @@ flext_base::BindItem::~BindItem()
}
}
void flext_base::BindItem::Unbind(const t_symbol *tag)
FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext_base))::BindItem::Unbind(const t_symbol *tag)
{
if(px) {
FLEXT_ASSERT(fun);
......@@ -94,17 +94,17 @@ void flext_base::BindItem::Unbind(const t_symbol *tag)