diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-09-08 17:07:22 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-09-08 17:07:22 +0200 |
commit | b145d957e3809fd6c2d814c34c58234ade983bb0 (patch) | |
tree | 3e8842c72afe0045645ad32a0b3a9ab708c575ee /include/Overlay.hpp | |
parent | 3d5e8baa5f66547f1250950b10bd4108e30af423 (diff) |
More
Diffstat (limited to 'include/Overlay.hpp')
-rw-r--r-- | include/Overlay.hpp | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/include/Overlay.hpp b/include/Overlay.hpp new file mode 100644 index 0000000..de5fa79 --- /dev/null +++ b/include/Overlay.hpp @@ -0,0 +1,56 @@ +#pragma once + +#include "gui/PageStack.hpp" +#include "gui/CustomRendererWidget.hpp" +#include "GsrInfo.hpp" +#include "Config.hpp" +#include "window_texture.h" + +#include <mglpp/window/Window.hpp> +#include <mglpp/graphics/Texture.hpp> +#include <mglpp/graphics/Sprite.hpp> +#include <mglpp/graphics/Rectangle.hpp> +#include <mglpp/graphics/Text.hpp> + +namespace gsr { + class Overlay { + public: + Overlay(mgl::Window &window, std::string resources_path, GsrInfo gsr_info, egl_functions egl_funcs, mgl::Color bg_color); + Overlay(const Overlay&) = delete; + Overlay& operator=(const Overlay&) = delete; + ~Overlay(); + + void on_event(mgl::Event &event, mgl::Window &window); + void draw(mgl::Window &window); + + void show(); + void hide(); + void toggle_show(); + bool is_open() const; + private: + bool update_compositor_texture(const mgl_monitor *monitor); + private: + mgl::Window &window; + std::string resources_path; + GsrInfo gsr_info; + egl_functions egl_funcs; + mgl::Color bg_color; + std::vector<gsr::AudioDevice> audio_devices; + mgl::Texture window_texture_texture; + mgl::Sprite window_texture_sprite; + mgl::Texture screenshot_texture; + mgl::Sprite screenshot_sprite; + mgl::Rectangle bg_screenshot_overlay; + WindowTexture window_texture; + gsr::PageStack page_stack; + mgl::Rectangle top_bar_background; + mgl::Text top_bar_text; + mgl::Sprite logo_sprite; + CustomRendererWidget close_button_widget; + bool close_button_pressed_inside = false; + bool visible = false; + uint64_t default_cursor = 0; + pid_t gpu_screen_recorder_process = -1; + std::optional<Config> config; + }; +}
\ No newline at end of file |