Rocket.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. rocket.RegisterTag(string tag, class) --NYI
  9. getters:
  10. 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
  11. */
  12. #include <Rocket/Core/Lua/LuaType.h>
  13. #include <Rocket/Core/Lua/lua.hpp>
  14. namespace Rocket {
  15. namespace Core {
  16. namespace Lua {
  17. #define ROCKETLUA_INPUTENUM(keyident,tbl) lua_pushinteger(L,Input::KI_##keyident); lua_setfield(L,(tbl),#keyident);
  18. //just need a class to take up a type name
  19. class rocket { int to_remove_warning; };
  20. template<> void LuaType<rocket>::extra_init(lua_State* L, int metatable_index);
  21. int rocketCreateContext(lua_State* L);
  22. int rocketLoadFontFace(lua_State* L);
  23. int rocketRegisterTag(lua_State* L);
  24. int rocketGetAttrcontexts(lua_State* L);
  25. void rocketEnumkey_identifier(lua_State* L);
  26. RegType<rocket> rocketMethods[];
  27. luaL_reg rocketGetters[];
  28. luaL_reg rocketSetters[];
  29. /*
  30. template<> const char* GetTClassName<rocket>();
  31. template<> RegType<rocket>* GetMethodTable<rocket>();
  32. template<> luaL_reg* GetAttrTable<rocket>();
  33. template<> luaL_reg* SetAttrTable<rocket>();
  34. */
  35. }
  36. }
  37. }