Element.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /*
  2. * This source file is part of RmlUi, the HTML/CSS Interface Middleware
  3. *
  4. * For the latest information, see http://github.com/mikke89/RmlUi
  5. *
  6. * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd
  7. * Copyright (c) 2019 The RmlUi Team, and contributors
  8. *
  9. * Permission is hereby granted, free of charge, to any person obtaining a copy
  10. * of this software and associated documentation files (the "Software"), to deal
  11. * in the Software without restriction, including without limitation the rights
  12. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13. * copies of the Software, and to permit persons to whom the Software is
  14. * furnished to do so, subject to the following conditions:
  15. *
  16. * The above copyright notice and this permission notice shall be included in
  17. * all copies or substantial portions of the Software.
  18. *
  19. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  23. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  24. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  25. * THE SOFTWARE.
  26. *
  27. */
  28. #ifndef RMLUICORELUAELEMENT_H
  29. #define RMLUICORELUAELEMENT_H
  30. #include <RmlUi/Core/Lua/LuaType.h>
  31. #include <RmlUi/Core/Lua/lua.hpp>
  32. #include <RmlUi/Core/Element.h>
  33. namespace Rml {
  34. namespace Core {
  35. namespace Lua {
  36. template<> RMLUILUA_API void ExtraInit<Element>(lua_State* L, int metatable_index);
  37. int Elementnew(lua_State* L);
  38. //methods
  39. int ElementAddEventListener(lua_State* L, Element* obj);
  40. int ElementAppendChild(lua_State* L, Element* obj);
  41. int ElementBlur(lua_State* L, Element* obj);
  42. int ElementClick(lua_State* L, Element* obj);
  43. int ElementDispatchEvent(lua_State* L, Element* obj);
  44. int ElementFocus(lua_State* L, Element* obj);
  45. int ElementGetAttribute(lua_State* L, Element* obj);
  46. int ElementGetElementById(lua_State* L, Element* obj);
  47. int ElementGetElementsByTagName(lua_State* L, Element* obj);
  48. int ElementHasAttribute(lua_State* L, Element* obj);
  49. int ElementHasChildNodes(lua_State* L, Element* obj);
  50. int ElementInsertBefore(lua_State* L, Element* obj);
  51. int ElementIsClassSet(lua_State* L, Element* obj);
  52. int ElementRemoveAttribute(lua_State* L, Element* obj);
  53. int ElementRemoveChild(lua_State* L, Element* obj);
  54. int ElementReplaceChild(lua_State* L, Element* obj);
  55. int ElementScrollIntoView(lua_State* L, Element* obj);
  56. int ElementSetAttribute(lua_State* L, Element* obj);
  57. int ElementSetClass(lua_State* L, Element* obj);
  58. //getters
  59. int ElementGetAttrattributes(lua_State* L);
  60. int ElementGetAttrchild_nodes(lua_State* L);
  61. int ElementGetAttrclass_name(lua_State* L);
  62. int ElementGetAttrclient_left(lua_State* L);
  63. int ElementGetAttrclient_height(lua_State* L);
  64. int ElementGetAttrclient_top(lua_State* L);
  65. int ElementGetAttrclient_width(lua_State* L);
  66. int ElementGetAttrfirst_child(lua_State* L);
  67. int ElementGetAttrid(lua_State* L);
  68. int ElementGetAttrinner_rml(lua_State* L);
  69. int ElementGetAttrlast_child(lua_State* L);
  70. int ElementGetAttrnext_sibling(lua_State* L);
  71. int ElementGetAttroffset_height(lua_State* L);
  72. int ElementGetAttroffset_left(lua_State* L);
  73. int ElementGetAttroffset_parent(lua_State* L);
  74. int ElementGetAttroffset_top(lua_State* L);
  75. int ElementGetAttroffset_width(lua_State* L);
  76. int ElementGetAttrowner_document(lua_State* L);
  77. int ElementGetAttrparent_node(lua_State* L);
  78. int ElementGetAttrprevious_sibling(lua_State* L);
  79. int ElementGetAttrscroll_height(lua_State* L);
  80. int ElementGetAttrscroll_left(lua_State* L);
  81. int ElementGetAttrscroll_top(lua_State* L);
  82. int ElementGetAttrscroll_width(lua_State* L);
  83. int ElementGetAttrstyle(lua_State* L);
  84. int ElementGetAttrtag_name(lua_State* L);
  85. //setters
  86. int ElementSetAttrclass_name(lua_State* L);
  87. int ElementSetAttrid(lua_State* L);
  88. int ElementSetAttrinner_rml(lua_State* L);
  89. int ElementSetAttrscroll_left(lua_State* L);
  90. int ElementSetAttrscroll_top(lua_State* L);
  91. extern RegType<Element> ElementMethods[];
  92. extern luaL_Reg ElementGetters[];
  93. extern luaL_Reg ElementSetters[];
  94. LUACORETYPEDECLARE(Element)
  95. template<> void ExtraInit<ElementPtr>(lua_State* L, int metatable_index);
  96. int LogMessage(lua_State* L);
  97. extern RegType<ElementPtr> ElementPtrMethods[];
  98. extern luaL_Reg ElementPtrGetters[];
  99. extern luaL_Reg ElementPtrSetters[];
  100. LUACORETYPEDECLARE(ElementPtr)
  101. }
  102. }
  103. }
  104. #endif