2
0

Element.h 4.6 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-2023 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 RMLUI_LUA_ELEMENT_H
  29. #define RMLUI_LUA_ELEMENT_H
  30. #include <RmlUi/Core/Element.h>
  31. #include <RmlUi/Lua/IncludeLua.h>
  32. #include <RmlUi/Lua/LuaType.h>
  33. namespace Rml {
  34. namespace Lua {
  35. template <>
  36. 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 ElementQuerySelector(lua_State* L, Element* obj);
  49. int ElementQuerySelectorAll(lua_State* L, Element* obj);
  50. int ElementMatches(lua_State* L, Element* obj);
  51. int ElementHasAttribute(lua_State* L, Element* obj);
  52. int ElementHasChildNodes(lua_State* L, Element* obj);
  53. int ElementInsertBefore(lua_State* L, Element* obj);
  54. int ElementIsClassSet(lua_State* L, Element* obj);
  55. int ElementRemoveAttribute(lua_State* L, Element* obj);
  56. int ElementRemoveChild(lua_State* L, Element* obj);
  57. int ElementReplaceChild(lua_State* L, Element* obj);
  58. int ElementScrollIntoView(lua_State* L, Element* obj);
  59. int ElementSetAttribute(lua_State* L, Element* obj);
  60. int ElementSetClass(lua_State* L, Element* obj);
  61. // getters
  62. int ElementGetAttrattributes(lua_State* L);
  63. int ElementGetAttrchild_nodes(lua_State* L);
  64. int ElementGetAttrclass_name(lua_State* L);
  65. int ElementGetAttrclient_left(lua_State* L);
  66. int ElementGetAttrclient_height(lua_State* L);
  67. int ElementGetAttrclient_top(lua_State* L);
  68. int ElementGetAttrclient_width(lua_State* L);
  69. int ElementGetAttrfirst_child(lua_State* L);
  70. int ElementGetAttrid(lua_State* L);
  71. int ElementGetAttrinner_rml(lua_State* L);
  72. int ElementGetAttrlast_child(lua_State* L);
  73. int ElementGetAttrnext_sibling(lua_State* L);
  74. int ElementGetAttroffset_height(lua_State* L);
  75. int ElementGetAttroffset_left(lua_State* L);
  76. int ElementGetAttroffset_parent(lua_State* L);
  77. int ElementGetAttroffset_top(lua_State* L);
  78. int ElementGetAttroffset_width(lua_State* L);
  79. int ElementGetAttrowner_document(lua_State* L);
  80. int ElementGetAttrparent_node(lua_State* L);
  81. int ElementGetAttrprevious_sibling(lua_State* L);
  82. int ElementGetAttrscroll_height(lua_State* L);
  83. int ElementGetAttrscroll_left(lua_State* L);
  84. int ElementGetAttrscroll_top(lua_State* L);
  85. int ElementGetAttrscroll_width(lua_State* L);
  86. int ElementGetAttrstyle(lua_State* L);
  87. int ElementGetAttrtag_name(lua_State* L);
  88. // setters
  89. int ElementSetAttrclass_name(lua_State* L);
  90. int ElementSetAttrid(lua_State* L);
  91. int ElementSetAttrinner_rml(lua_State* L);
  92. int ElementSetAttrscroll_left(lua_State* L);
  93. int ElementSetAttrscroll_top(lua_State* L);
  94. extern RegType<Element> ElementMethods[];
  95. extern luaL_Reg ElementGetters[];
  96. extern luaL_Reg ElementSetters[];
  97. RMLUI_LUATYPE_DECLARE(Element)
  98. template <>
  99. void ExtraInit<ElementPtr>(lua_State* L, int metatable_index);
  100. int LogMessage(lua_State* L);
  101. extern RegType<ElementPtr> ElementPtrMethods[];
  102. extern luaL_Reg ElementPtrGetters[];
  103. extern luaL_Reg ElementPtrSetters[];
  104. RMLUI_LUATYPE_DECLARE(ElementPtr)
  105. } // namespace Lua
  106. } // namespace Rml
  107. #endif