text: // xg - XML Graphics Device
  // Copyright (c) Jim Tan
  //
  // Free use of the XML Graphics Engine is
  // permitted under the guidelines and in accordance with the most
  // current version of the MIT License.
  // http://www.opensource.org/licenses/MIT
  
  #include "xg/parser/parser_internal.h"
  
  #include <memory>
  
  #include "tinyxml2.h"
  #include "xg/layout.h"
  #include "xg/types.h"
  
  namespace xg {
  namespace parser {
  
  template <>
  bool ParserSingleton<ParserDevice>::ParseElement(
      const tinyxml2::XMLElement* element, ParserStatus* status) {
    auto node = std::make_shared<LayoutDevice>();
    if (!node) return false;
  
    assert(status->parent->layout_type == LayoutType::kRenderer);
    node->lrenderer = std::static_pointer_cast<LayoutRenderer>(status->parent);
  
    status->node = node;
    status->child_element = element->FirstChildElement();
  
    return ParserBase::Get().ParseElement(element, status);
  }
  
  }  // namespace parser
  }  // namespace xg
  