diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-08-01 20:46:13 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-08-01 20:46:13 +0200 |
commit | 27255cdb64b87c048fad70ca893f684cf61819a4 (patch) | |
tree | d89ea70475d1e8e9508d652eef836c49c0d162a8 /include/gui/Page.hpp | |
parent | 6624db873c91087bc1805b9d018c92c455b85190 (diff) |
Change global widget container to page
Diffstat (limited to 'include/gui/Page.hpp')
-rw-r--r-- | include/gui/Page.hpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/gui/Page.hpp b/include/gui/Page.hpp new file mode 100644 index 0000000..1435e68 --- /dev/null +++ b/include/gui/Page.hpp @@ -0,0 +1,27 @@ +#pragma once + +#include <vector> +#include <memory> + +namespace mgl { + class Event; + class Window; +} + +namespace gsr { + class Widget; + + class Page { + public: + Page() = default; + Page(const Page&) = delete; + Page& operator=(const Page&) = delete; + + void add_widget(std::unique_ptr<Widget> widget); + + void on_event(mgl::Event &event, mgl::Window &window); + void draw(mgl::Window &window); + private: + std::vector<std::unique_ptr<Widget>> widgets; + }; +}
\ No newline at end of file |