mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-23 18:39:55 +00:00
Minor changes in gen/ui_class.cpp/h files
This commit is contained in:
parent
9e3a6f8fe2
commit
01a6fe6dbc
@ -80,7 +80,9 @@ static std::string convert_type(const std::string& name)
|
||||
throw base::Exception("unknown widget name: " + name);
|
||||
}
|
||||
|
||||
void gen_ui_class(TiXmlDocument* doc, const std::string& inputFn, const std::string& widgetId)
|
||||
void gen_ui_class(TiXmlDocument* doc,
|
||||
const std::string& inputFn,
|
||||
const std::string& widgetId)
|
||||
{
|
||||
std::cout
|
||||
<< "// Don't modify, generated file from " << inputFn << "\n"
|
||||
@ -133,9 +135,8 @@ void gen_ui_class(TiXmlDocument* doc, const std::string& inputFn, const std::str
|
||||
<< " app::load_widget(\"" << base::get_file_name(inputFn) << "\", \"" << widgetId << "\", this);\n"
|
||||
<< " app::finder(this)\n";
|
||||
|
||||
for (XmlElements::iterator it=widgets.begin(), end=widgets.end();
|
||||
it != end; ++it) {
|
||||
const char* id = (*it)->Attribute("id");
|
||||
for (TiXmlElement* elem : widgets) {
|
||||
const char* id = elem->Attribute("id");
|
||||
std::string cppid = convert_xmlid_to_cppid(id, false);
|
||||
std::cout
|
||||
<< " >> \"" << id << "\" >> m_" << cppid << "\n";
|
||||
@ -146,10 +147,9 @@ void gen_ui_class(TiXmlDocument* doc, const std::string& inputFn, const std::str
|
||||
<< " }\n"
|
||||
<< "\n";
|
||||
|
||||
for (XmlElements::iterator it=widgets.begin(), end=widgets.end();
|
||||
it != end; ++it) {
|
||||
std::string childType = convert_type((*it)->Value());
|
||||
const char* id = (*it)->Attribute("id");
|
||||
for (TiXmlElement* elem : widgets) {
|
||||
std::string childType = convert_type(elem->Value());
|
||||
const char* id = elem->Attribute("id");
|
||||
std::string cppid = convert_xmlid_to_cppid(id, false);
|
||||
std::cout
|
||||
<< " " << childType << "* " << cppid << "() const { return m_" << cppid << "; }\n";
|
||||
@ -159,10 +159,9 @@ void gen_ui_class(TiXmlDocument* doc, const std::string& inputFn, const std::str
|
||||
<< "\n"
|
||||
<< " private:\n";
|
||||
|
||||
for (XmlElements::iterator it=widgets.begin(), end=widgets.end();
|
||||
it != end; ++it) {
|
||||
std::string childType = convert_type((*it)->Value());
|
||||
const char* id = (*it)->Attribute("id");
|
||||
for (TiXmlElement* elem : widgets) {
|
||||
std::string childType = convert_type(elem->Value());
|
||||
const char* id = elem->Attribute("id");
|
||||
std::string cppid = convert_xmlid_to_cppid(id, false);
|
||||
std::cout
|
||||
<< " " << childType << "* m_" << cppid << ";\n";
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite Code Generator
|
||||
// Copyright (c) 2014 David Capello
|
||||
// Copyright (c) 2014-2016 David Capello
|
||||
//
|
||||
// This file is released under the terms of the MIT license.
|
||||
// Read LICENSE.txt for more information.
|
||||
@ -11,6 +11,8 @@
|
||||
#include <string>
|
||||
#include "tinyxml.h"
|
||||
|
||||
void gen_ui_class(TiXmlDocument* doc, const std::string& inputFn, const std::string& widgetId);
|
||||
void gen_ui_class(TiXmlDocument* doc,
|
||||
const std::string& inputFn,
|
||||
const std::string& widgetId);
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user