ElementFormControlSelect.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #ifndef ROCKETCORELUAELEMENTFORMCONTROLSELECT_H
  2. #define ROCKETCORELUAELEMENTFORMCONTROLSELECT_H
  3. /*
  4. This defines the ElementFormControlSelect type in the Lua global namespace, for this documentation will be
  5. named EFCSelect
  6. It has one extra method than the Python api, which is GetOption
  7. //methods
  8. int EFCSelect:Add(string rml, string value, [int before]) --where 'before' is optional, and is an index
  9. noreturn EFCSelect:Remove(int index)
  10. {"element"=Element,"value"=string} EFCSelect:GetOption(int index) --this is a more efficient way to get an option if you know the index beforehand
  11. //getters
  12. {[int index]={"element"=Element,"value"=string}} EFCSelect.options --used to access options as a Lua table. Comparatively expensive operation, use GetOption when
  13. --you only need one option and you know the index
  14. int EFCSelect.selection
  15. //setter
  16. EFCSelect.selection = int
  17. */
  18. #include <Rocket/Core/Lua/lua.hpp>
  19. #include <Rocket/Core/Lua/LuaType.h>
  20. #include <Rocket/Controls/ElementFormControlSelect.h>
  21. using Rocket::Controls::ElementFormControlSelect;
  22. namespace Rocket {
  23. namespace Core {
  24. namespace Lua {
  25. //inherits from ElementFormControl which inherits from Element
  26. template<> void LuaType<ElementFormControlSelect>::extra_init(lua_State* L, int metatable_index);
  27. template<> bool LuaType<ElementFormControlSelect>::is_reference_counted();
  28. //methods
  29. int ElementFormControlSelectAdd(lua_State* L, ElementFormControlSelect* obj);
  30. int ElementFormControlSelectRemove(lua_State* L, ElementFormControlSelect* obj);
  31. int ElementFormControlSelectGetOption(lua_State* L, ElementFormControlSelect* obj);
  32. //getters
  33. int ElementFormControlSelectGetAttroptions(lua_State* L);
  34. int ElementFormControlSelectGetAttrselection(lua_State* L);
  35. //setter
  36. int ElementFormControlSelectSetAttrselection(lua_State* L);
  37. RegType<ElementFormControlSelect> ElementFormControlSelectMethods[];
  38. luaL_reg ElementFormControlSelectGetters[];
  39. luaL_reg ElementFormControlSelectSetters[];
  40. /*
  41. template<> const char* GetTClassName<ElementFormControlSelect>();
  42. template<> RegType<ElementFormControlSelect>* GetMethodTable<ElementFormControlSelect>();
  43. template<> luaL_reg* GetAttrTable<ElementFormControlSelect>();
  44. template<> luaL_reg* SetAttrTable<ElementFormControlSelect>();
  45. */
  46. }
  47. }
  48. }
  49. #endif