#pragma once
#include <map>
#include <tiny/tdf.h>

struct datagroup {
	std::map<std::string, tiny::TDF_Type> data;
	datagroup(std::map<std::string, tiny::TDF_Type> data):data(data){}
};

extern std::map<std::string,datagroup> cookie;
#define TWFELEMENT {"sub",tiny::TDF_CLASS},
#define TWFSTYLE TWFELEMENT {"path",tiny::TDF_STR},
#define TWFSTYLED {"style",tiny::TDF_CLASS},
#define TWFPOINT TWFELEMENT {"x",tiny::TDF_FLOAT},{"y",tiny::TDF_FLOAT},{"rel",tiny::TDF_BOOL},
#define TWFRECT TWFPOINT {"w",tiny::TDF_FLOAT},{"h",tiny::TDF_FLOAT},
#define TWFCOL TWFRECT {"r",tiny::TDF_FLOAT},{"g",tiny::TDF_FLOAT},{"b",tiny::TDF_FLOAT},{"a",tiny::TDF_FLOAT},
#define TWFTEXT TWFRECT TWFSTYLED {"txt",tiny::TDF_BLOCK},
#define TWFLINK TWFTEXT {"path",tiny::TDF_STR},
#define TWFBUTTON TWFLINK {"disabled",tiny::TDF_BOOL},
#define TWFIMG TWFRECT {"path",tiny::TDF_STR},

extern std::map<std::string,datagroup> tinywebformat;

extern std::map<std::string,datagroup> tinywebstyle;
