LuaDocumentElementInstancer.cpp 842 B

12345678910111213141516171819202122232425262728293031
  1. #include "precompiled.h"
  2. #include "LuaDocumentElementInstancer.h"
  3. #include "LuaDocument.h"
  4. namespace Rocket {
  5. namespace Core {
  6. namespace Lua {
  7. /// Instances an element given the tag name and attributes.
  8. /// @param[in] parent The element the new element is destined to be parented to.
  9. /// @param[in] tag The tag of the element to instance.
  10. /// @param[in] attributes Dictionary of attributes.
  11. Element* LuaDocumentElementInstancer::InstanceElement(Element* parent, const String& tag, const XMLAttributes& attributes)
  12. {
  13. return new LuaDocument(tag);
  14. }
  15. /// Releases an element instanced by this instancer.
  16. /// @param[in] element The element to release.
  17. void LuaDocumentElementInstancer::ReleaseElement(Element* element)
  18. {
  19. delete element;
  20. }
  21. /// Release the instancer.
  22. void LuaDocumentElementInstancer::Release()
  23. {
  24. delete this;
  25. }
  26. }
  27. }
  28. }