Manages the SDL window for screenshot capture UI. More...
#include <screenshot_window.h>
Public Member Functions | |
ScreenshotWindow (IConfigService *configManager, IKeybindProvider *keybindProvider) | |
Constructs a ScreenshotWindow instance. | |
~ScreenshotWindow () | |
Destroys the ScreenshotWindow instance. | |
bool | initialize (int width, int height) |
Initializes the SDL window and renderer. | |
void | render () |
Renders the screenshot UI. | |
void | raiseAndFocus () |
Raises and focuses the window. | |
void | cleanup () |
Cleans up SDL resources. | |
SDL_Window * | getWindow () const |
Gets the SDL window. | |
Manages the SDL window for screenshot capture UI.
This class creates an SDL window and renderer for displaying the screenshot capture UI, including a button for triggering captures. It uses IConfigService to access configuration settings (e.g., font, window size) and IKeybindProvider to handle keybind inputs for actions like capturing or exiting.
ScreenshotWindow::ScreenshotWindow | ( | IConfigService * | configManager, |
IKeybindProvider * | keybindProvider | ||
) |
Constructs a ScreenshotWindow instance.
Initializes the window with configuration and keybind dependencies.
configManager | The configuration service for settings. |
keybindProvider | The keybind provider for input handling. |
ScreenshotWindow::~ScreenshotWindow | ( | ) |
Destroys the ScreenshotWindow instance.
Cleans up SDL resources (window, renderer, font, texture).
void ScreenshotWindow::cleanup | ( | ) |
Cleans up SDL resources.
Destroys the window, renderer, font, and texture, releasing resources.
|
inline |
Gets the SDL window.
bool ScreenshotWindow::initialize | ( | int | width, |
int | height | ||
) |
Initializes the SDL window and renderer.
Sets up the window, renderer, font, and button texture with the specified size.
width | The window width. |
height | The window height. |
void ScreenshotWindow::raiseAndFocus | ( | ) |
Raises and focuses the window.
Brings the window to the foreground and sets input focus.
void ScreenshotWindow::render | ( | ) |
Renders the screenshot UI.
Draws the UI elements (e.g., capture button) using the SDL renderer.