aboutsummaryrefslogtreecommitdiff
path: root/include/gui/WidgetContainer.hpp
blob: e40ffb9ec551b57946329534c522373827b90e0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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;
    };
}