Element.h 4.1 KB

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