Document.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 ROCKETCORELUADOCUMENT_H
  28. #define ROCKETCORELUADOCUMENT_H
  29. /*
  30. This defines the Document type in the Lua global namespace
  31. It inherits from Element, so check the documentation for Element.h to
  32. see what other functions you can call from a Document object. Document
  33. specific things are below
  34. //methods
  35. noreturn Document:PullToFront()
  36. noreturn Document:PushToBack()
  37. noreturn Document:Show(int flag)
  38. noreturn Document:Hide()
  39. noreturn Document:Close()
  40. Element Document:CreateElement(string tag)
  41. ElementText Document:CreateTextNode(string text)
  42. //getters
  43. string Document.title
  44. Context Document.context
  45. //setter
  46. Document.title = string
  47. */
  48. #include <Rocket/Core/Lua/lua.hpp>
  49. #include <Rocket/Core/Lua/LuaType.h>
  50. #include <Rocket/Core/ElementDocument.h>
  51. namespace Rocket {
  52. namespace Core {
  53. namespace Lua {
  54. typedef ElementDocument Document;
  55. template<> void ExtraInit<Document>(lua_State* L, int metatable_index);
  56. //methods
  57. int DocumentPullToFront(lua_State* L, Document* obj);
  58. int DocumentPushToBack(lua_State* L, Document* obj);
  59. int DocumentShow(lua_State* L, Document* obj);
  60. int DocumentHide(lua_State* L, Document* obj);
  61. int DocumentClose(lua_State* L, Document* obj);
  62. int DocumentCreateElement(lua_State* L, Document* obj);
  63. int DocumentCreateTextNode(lua_State* L, Document* obj);
  64. //getters
  65. int DocumentGetAttrtitle(lua_State* L);
  66. int DocumentGetAttrcontext(lua_State* L);
  67. //setters
  68. int DocumentSetAttrtitle(lua_State* L);
  69. RegType<Document> DocumentMethods[];
  70. luaL_reg DocumentGetters[];
  71. luaL_reg DocumentSetters[];
  72. LUATYPEDECLARE(Document)
  73. }
  74. }
  75. }
  76. #endif