Got rid of AnimView, added Gui
This commit is contained in:
39
luprex/cpp/gui.hpp
Normal file
39
luprex/cpp/gui.hpp
Normal file
@@ -0,0 +1,39 @@
|
||||
#ifndef GUI_HPP
|
||||
#define GUI_HPP
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "luastack.hpp"
|
||||
|
||||
class GuiElt {
|
||||
friend class Gui;
|
||||
public:
|
||||
enum Type {
|
||||
TYPE_MENU_ITEM,
|
||||
};
|
||||
private:
|
||||
Type type_;
|
||||
std::string id_;
|
||||
std::string label_;
|
||||
|
||||
GuiElt() {}
|
||||
public:
|
||||
~GuiElt() {}
|
||||
Type type() const { return type_; }
|
||||
const std::string &id() const { return id_; }
|
||||
const std::string &label() const { return label_; }
|
||||
};
|
||||
|
||||
class Gui {
|
||||
public:
|
||||
using EltVec = std::vector<GuiElt>;
|
||||
private:
|
||||
EltVec elts_;
|
||||
public:
|
||||
const EltVec &elts() const { return elts_; }
|
||||
void clear() { elts_.clear(); }
|
||||
void add_menu_item(const std::string &id, const std::string &label);
|
||||
};
|
||||
|
||||
#endif // GUI_HPP
|
||||
|
||||
Reference in New Issue
Block a user