[luabind] Deriving in lua, more then 10 parameters for a method
Brought to you by:
arvidn,
daniel_wallin
From: Roman K. <kub...@gm...> - 2014-09-04 14:12:41
|
Helo. I'm using a third party library for my application (JUCE), this library has a large class called LookAndFeel, i want to expose that class to lua via luabind. I started to do the work following the documentation, and using the luabind::wrap_base approach, i got a few methods bound and it's all working fine, until i hit a problem. Some of the methods in the original LookAndFeel class have more then 10 parameters, and i can't bind those methods using this approach. One of the solutions i found would be to change the parameters and wrap them in a structure, and that would be a good idea but i can't change the original LookAndFeel class, and changing the class that derives from luabind::wrap_base - that i'm implementing - so that it's methods take a structure as a parameter instead of the actual parameters, makes those methods unusable (luabind never calls them, since the parameter count and type does not match the original LookAndFeel class). Is there a way to solve this somehow, can i increase the limit of 10 parameters in luabind (trying to extend the ARITY macro over 10 causes loades of compile errors). Any help is welcome. My class looks like: class LLookAndFeel : public LookAndFeel_V3, public luabind::wrap_base { virtual void drawButtonBackground (Graphics &g, Button &b, const Colour &c, bool over, bool down) override { call<void>("drawButtonBackground", boost::ref (g), boost::ref(b), c, over, down); } static void def_drawButtonBackground (LookAndFeel_V3 *ptr, Graphics &g, Button &b, const Colour &c, bool over, bool down) { return (ptr->LookAndFeel_V3::drawButtonBackground (g,b,c,over,down)); } /* More methods are needed that have more then 10 parameters */ } Best regards. Roman Kubiak http://ctrlr.org ==================================================================== _ _ _ _ _ _ __ _____| | |_ __ _ __ _ ___ __ ___ _ _| |_ _ _ ___| | |___ __| | \ V / _ \ | _/ _` / _` / -_) / _/ _ \ ' \ _| '_/ _ \ | / -_) _` | \_/\___/_|\__\__,_\__, \___| \__\___/_||_\__|_| \___/_|_\___\__,_| |___/ ==================================================================== |