[Tablegen] Implement a basic table generator
This commit is contained in:
parent
133c3d1a01
commit
35ce1d8e19
6 changed files with 353 additions and 0 deletions
58
Libraries/Tablegen/Include/Tablegen/Settings.hpp
Normal file
58
Libraries/Tablegen/Include/Tablegen/Settings.hpp
Normal file
|
@ -0,0 +1,58 @@
|
|||
#ifndef TABLEGEN_SETTINGS_HPP
|
||||
#define TABLEGEN_SETTINGS_HPP
|
||||
|
||||
#include <Common/RGB.hpp>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace Tablegen
|
||||
{
|
||||
using Common::RGB;
|
||||
|
||||
enum class Flag {
|
||||
Enable, Disable,
|
||||
};
|
||||
|
||||
enum class FontSizeUnits {
|
||||
Px, Em,
|
||||
};
|
||||
std::string ToString(FontSizeUnits units);
|
||||
|
||||
struct CharacterInfo
|
||||
{
|
||||
std::string Label;
|
||||
std::string ImagePath;
|
||||
std::string AnimationPath;
|
||||
};
|
||||
|
||||
struct Settings
|
||||
{
|
||||
Flag FullDocument;
|
||||
|
||||
Flag OverrideIndentLevel;
|
||||
std::size_t IndentLevel;
|
||||
|
||||
double TableWidth;
|
||||
double TableMargin;
|
||||
|
||||
double TableItemWidth;
|
||||
double TableItemPadding;
|
||||
RGB TableItemColour;
|
||||
|
||||
double LabelFontSize;
|
||||
FontSizeUnits LabelFontUnits;
|
||||
RGB ButtonColour;
|
||||
RGB ButtonHoverColour;
|
||||
double ButtonAnimationLength;
|
||||
|
||||
std::size_t CharactersPerRow;
|
||||
std::string ImageFormat;
|
||||
std::string AnimationFormat;
|
||||
std::vector<CharacterInfo> Characters;
|
||||
|
||||
static Settings Default();
|
||||
};
|
||||
}
|
||||
|
||||
#endif // TABLEGEN_SETTINGS_HPP
|
23
Libraries/Tablegen/Include/Tablegen/Tablegen.hpp
Normal file
23
Libraries/Tablegen/Include/Tablegen/Tablegen.hpp
Normal file
|
@ -0,0 +1,23 @@
|
|||
#ifndef TABLEGEN_TABLEGEN_HPP
|
||||
#define TABLEGEN_TABLEGEN_HPP
|
||||
|
||||
#include "Settings.hpp"
|
||||
|
||||
#ifdef TABLEGEN_EXPOSE_XML
|
||||
#include <pugixml.hpp>
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace Tablegen
|
||||
{
|
||||
std::string GeneratePage(const Settings& settings = Settings::Default());
|
||||
|
||||
void GeneratePage(const std::string& path, const Settings& settings = Settings::Default());
|
||||
|
||||
# ifdef TABLEGEN_EXPOSE_XML
|
||||
pugi::xml_document GenerateDocument(const Settings& settings = Settings::Default());
|
||||
# endif
|
||||
}
|
||||
|
||||
#endif // TABLEGEN_TABLEGEN_HPP
|
Loading…
Add table
Add a link
Reference in a new issue