#ifndef ROCKETCORELUACOLOURB_H #define ROCKETCORELUACOLOURB_H /* Declares Colourb in the Lua global namespace. It implements the below (examples using Lua syntax) : Colourb.new(int red,int green,int blue,int alpha) creates a new Colourf (values must be bounded between 0 and 255 inclusive), and gets deleted when Lua garbage collects everything after this will assume that you have a local variable named 'col', declared something similar to local col = Colourb.new(0,15,3,255) operators (the types that it can operate on are on the right): col == Colourb col + Colourb col * float no methods get and set attributes: col.red col.green col.blue col.alpha get attributes: local red,green,blue,alpha = col.rgba */ #include #include #include using Rocket::Core::Colourb; namespace Rocket { namespace Core { namespace Lua { template<> void LuaType::extra_init(lua_State* L, int metatable_index); int Colourbnew(lua_State* L); int Colourb__eq(lua_State* L); int Colourb__add(lua_State* L); int Colourb__mul(lua_State* L); //getters int ColourbGetAttrred(lua_State* L); int ColourbGetAttrgreen(lua_State* L); int ColourbGetAttrblue(lua_State* L); int ColourbGetAttralpha(lua_State* L); int ColourbGetAttrrgba(lua_State* L); //setters int ColourbSetAttrred(lua_State* L); int ColourbSetAttrgreen(lua_State* L); int ColourbSetAttrblue(lua_State* L); int ColourbSetAttralpha(lua_State* L); RegType ColourbMethods[]; luaL_reg ColourbGetters[]; luaL_reg ColourbSetters[]; /* template<> const char* GetTClassName() { return "Colourb"; } template<> RegType* GetMethodTable() { return ColourbMethods; } template<> luaL_reg* GetAttrTable() { return ColourbGetters; } template<> luaL_reg* SetAttrTable() { return ColourbSetters; } */ } } } #endif