mirror of
https://repo.dec05eba.com/gpu-screen-recorder-ui
synced 2026-05-05 06:20:44 +09:00
widgets
This commit is contained in:
30
include/gui/WidgetContainer.hpp
Normal file
30
include/gui/WidgetContainer.hpp
Normal file
@@ -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;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user