1 // Aseprite 2 // Copyright (C) 2001-2015 David Capello 3 // 4 // This program is distributed under the terms of 5 // the End-User License Agreement for Aseprite. 6 7 #ifndef APP_GUI_XML_INCLUDED 8 #define APP_GUI_XML_INCLUDED 9 #pragma once 10 11 #include "app/xml_document.h" 12 13 #include <string> 14 15 namespace app { 16 17 // Singleton class to load and access "gui.xml" file. 18 class GuiXml { 19 public: 20 // Returns the GuiXml singleton. If it was not created yet, the 21 // gui.xml file will be loaded by the first time, which could 22 // generated an exception if there are errors in the XML file. 23 static GuiXml* instance(); 24 25 // Returns the tinyxml document instance. doc()26 XmlDocumentRef doc() { 27 return m_doc; 28 } 29 30 // Returns the name of the gui.xml file. filename()31 const char* filename() { 32 return m_doc->Value(); 33 } 34 35 std::string version(); 36 37 private: 38 GuiXml(); 39 40 XmlDocumentRef m_doc; 41 }; 42 43 } // namespace app 44 45 #endif 46