Rocket.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef ROCKETCORELUAROCKET_H
  2. #define ROCKETCORELUAROCKET_H
  3. /*
  4. This declares rocket in the global Lua namespace
  5. It is not exactly type, but it is a table, and does have some methods and attributes
  6. methods:
  7. rocket.CreateContext(string name, Vector2i dimensions)
  8. rocket.LoadFontFace(string font_path)
  9. rocket.RegisterTag(string tag, class) --NYI
  10. getters:
  11. 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
  12. */
  13. #include <Rocket/Core/Lua/LuaType.h>
  14. #include <Rocket/Core/Lua/lua.hpp>
  15. namespace Rocket {
  16. namespace Core {
  17. namespace Lua {
  18. #define ROCKETLUA_INPUTENUM(keyident,tbl) lua_pushinteger(L,Input::KI_##keyident); lua_setfield(L,(tbl),#keyident);
  19. //just need a class to take up a type name
  20. class rocket { int to_remove_warning; };
  21. template<> void LuaType<rocket>::extra_init(lua_State* L, int metatable_index);
  22. int rocketCreateContext(lua_State* L);
  23. int rocketLoadFontFace(lua_State* L);
  24. int rocketRegisterTag(lua_State* L);
  25. int rocketGetAttrcontexts(lua_State* L);
  26. void rocketEnumkey_identifier(lua_State* L);
  27. RegType<rocket> rocketMethods[];
  28. luaL_reg rocketGetters[];
  29. luaL_reg rocketSetters[];
  30. /*
  31. template<> const char* GetTClassName<rocket>();
  32. template<> RegType<rocket>* GetMethodTable<rocket>();
  33. template<> luaL_reg* GetAttrTable<rocket>();
  34. template<> luaL_reg* SetAttrTable<rocket>();
  35. */
  36. }
  37. }
  38. }
  39. #endif