Rocket.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #pragma once
  2. /*
  3. This declares rocket in the global Lua namespace
  4. It is not exactly type, but it is a table, and does have some methods and attributes
  5. methods:
  6. rocket.CreateContext(string name, Vector2i dimensions)
  7. rocket.LoadFontFace(string font_path)
  8. getters:
  9. rocket.contexts returns a table of contexts, which are indexed by number AND string, so there are two copies of each context in the table
  10. */
  11. #include <Rocket/Core/Lua/LuaType.h>
  12. #include <Rocket/Core/Lua/lua.hpp>
  13. namespace Rocket {
  14. namespace Core {
  15. namespace Lua {
  16. #define ROCKETLUA_INPUTENUM(keyident,tbl) lua_pushinteger(L,Input::KI_##keyident); lua_setfield(L,(tbl),#keyident);
  17. //just need a class to take up a type name
  18. class rocket { int to_remove_warning; };
  19. template<> void LuaType<rocket>::extra_init(lua_State* L, int metatable_index);
  20. int rocketCreateContext(lua_State* L);
  21. int rocketLoadFontFace(lua_State* L);
  22. int rocketRegisterTag(lua_State* L);
  23. int rocketGetAttrcontexts(lua_State* L);
  24. void rocketEnumkey_identifier(lua_State* L);
  25. RegType<rocket> rocketMethods[];
  26. luaL_reg rocketGetters[];
  27. luaL_reg rocketSetters[];
  28. /*
  29. template<> const char* GetTClassName<rocket>();
  30. template<> RegType<rocket>* GetMethodTable<rocket>();
  31. template<> luaL_reg* GetAttrTable<rocket>();
  32. template<> luaL_reg* SetAttrTable<rocket>();
  33. */
  34. }
  35. }
  36. }