ASAPCabinetFE
 
Loading...
Searching...
No Matches
ScreenshotWindow Class Reference

Manages the SDL window for screenshot capture UI. More...

#include <screenshot_window.h>

+ Collaboration diagram for ScreenshotWindow:

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ScreenshotWindow()

ScreenshotWindow::ScreenshotWindow ( IConfigService configManager,
IKeybindProvider keybindProvider 
)

Constructs a ScreenshotWindow instance.

Initializes the window with configuration and keybind dependencies.

Parameters
configManagerThe configuration service for settings.
keybindProviderThe keybind provider for input handling.

◆ ~ScreenshotWindow()

ScreenshotWindow::~ScreenshotWindow ( )

Destroys the ScreenshotWindow instance.

Cleans up SDL resources (window, renderer, font, texture).

Member Function Documentation

◆ cleanup()

void ScreenshotWindow::cleanup ( )

Cleans up SDL resources.

Destroys the window, renderer, font, and texture, releasing resources.

+ Here is the caller graph for this function:

◆ getWindow()

SDL_Window * ScreenshotWindow::getWindow ( ) const
inline

Gets the SDL window.

Returns
Pointer to the SDL window.
+ Here is the caller graph for this function:

◆ initialize()

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.

Parameters
widthThe window width.
heightThe window height.
Returns
True if initialization succeeds, false otherwise.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ raiseAndFocus()

void ScreenshotWindow::raiseAndFocus ( )

Raises and focuses the window.

Brings the window to the foreground and sets input focus.

+ Here is the caller graph for this function:

◆ render()

void ScreenshotWindow::render ( )

Renders the screenshot UI.

Draws the UI elements (e.g., capture button) using the SDL renderer.

+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: