diff options
author | dec05eba <dec05eba@protonmail.com> | 2022-09-25 17:29:17 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2022-09-25 17:29:17 +0200 |
commit | 497217a3e09b577f650aaf503356588515067ca8 (patch) | |
tree | 2fd43b747957510c55d66caf81df30732c39c398 /include/gui/WidgetContainer.hpp | |
parent | 663a36df4aaea583e7cd56ad35b26d05f6151746 (diff) |
widgets
Diffstat (limited to 'include/gui/WidgetContainer.hpp')
-rw-r--r-- | include/gui/WidgetContainer.hpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/include/gui/WidgetContainer.hpp b/include/gui/WidgetContainer.hpp new file mode 100644 index 0000000..e40ffb9 --- /dev/null +++ b/include/gui/WidgetContainer.hpp @@ -0,0 +1,30 @@ +#pragma once + +#include <vector> +#include <memory> + +namespace mgl { + class Event; + class Window; +} + +namespace gsr { + class Widget; + + class WidgetContainer { + public: + static WidgetContainer& get_instance(); + + void add_widget(Widget *widget); + void remove_widget(Widget *widget); + + void on_event(mgl::Event &event, mgl::Window &window); + void draw(mgl::Window &window); + private: + WidgetContainer() = default; + WidgetContainer& operator=(const WidgetContainer&) = delete; + WidgetContainer(const WidgetContainer&) = delete; + private: + std::vector<Widget*> widgets; + }; +}
\ No newline at end of file |