libAlgAudio
v1.99-440-g08538e5-dirty
The development library for AlgAudio framework.
|
#include <Window.hpp>
Public Member Functions | |
template<class W , typename... Args> | |
std::shared_ptr< W > | Create (Args...args) |
unsigned int | GetID () const |
SDL_Renderer * | GetRenderer () const |
std::shared_ptr< UIWidget > | GetRoot () const |
Size2D | GetSize () const |
SDL_Window * | GetWindow () const |
void | Insert (std::shared_ptr< UIWidget > child) |
Window & | operator= (const Window &)=delete |
virtual void | ProcessCloseEvent () |
void | ProcessEnterEvent () |
virtual void | ProcessKeyboardEvent (KeyData data) |
void | ProcessLeaveEvent () |
void | ProcessMotionEvent (Point2D) |
void | ProcessMouseButtonEvent (bool down, MouseButton button, Point2D) |
void | ProcessResizeEvent () |
void | ProcessWheelEvent (MouseButton button) |
void | Render () |
void | SetNeedsRedrawing () |
virtual LateReturn | ShowErrorAlert (std::string, std::string) |
virtual LateReturn< int > | ShowSimpleAlert (std::string, std::string, std::string, AlertType, Color, Color) |
Window (const Window &)=delete | |
~Window () | |
Static Public Member Functions | |
static std::shared_ptr< Window > | Create (std::string title="AlgAudio", int w=350, int h=300, bool centered=true, bool resizable=true) |
Public Attributes | |
Signal | on_close |
Public Attributes inherited from AlgAudio::SubscriptionsManager | |
SubscriptionList | subscriptions |
Protected Member Functions | |
Window (std::string title, int w, int h, bool centered=true, bool resizable=true) | |
This class represents a drawable on-screen window.
AlgAudio::Window::~Window | ( | ) |
|
delete |
Explicitly forbids copying windows.
|
protected |
|
static |
Creates a new native window.
title | The window title to use. |
w | Initial window width. |
h | Initial window height. |
centered | If true, window will be placed on the center of the screen. |
resizable | If false, the user will not be able to manually change the dimentions of the window. Otherwise, the initial window position is undefined. |
|
inline |
|
inline |
Returns a unique window identifier, as defined by SDL.
|
inline |
Returns a pointer the the SDL_Renderer associated with this window.
|
inline |
Returns the widget that is in the root of this window's widget hierarchy.
Size2D AlgAudio::Window::GetSize | ( | ) | const |
Returns current window size.
|
inline |
Returns a pointer to the underlying SDL_Window.
void AlgAudio::Window::Insert | ( | std::shared_ptr< UIWidget > | child | ) |
Places a child widget onto the window. This should be the topmost widget in a hierarchy.
|
virtual |
Reimplemented in AlgAudio::MainWindow.
void AlgAudio::Window::ProcessEnterEvent | ( | ) |
|
virtual |
Reimplemented in AlgAudio::MainWindow.
void AlgAudio::Window::ProcessLeaveEvent | ( | ) |
void AlgAudio::Window::ProcessMotionEvent | ( | Point2D | ) |
void AlgAudio::Window::ProcessMouseButtonEvent | ( | bool | down, |
MouseButton | button, | ||
Point2D | |||
) |
void AlgAudio::Window::ProcessResizeEvent | ( | ) |
void AlgAudio::Window::ProcessWheelEvent | ( | MouseButton | button | ) |
void AlgAudio::Window::Render | ( | ) |
Starts the render chain of this window, by asking the child widget to render itself on this window.
void AlgAudio::Window::SetNeedsRedrawing | ( | ) |
Marks the window as dirty. It will be redrawn when it has a chance/
|
inlinevirtual |
Implements AlgAudio::IAlertable.
Reimplemented in AlgAudio::MainWindow.
|
inlinevirtual |
Returns 0 if the first button was clicked, 1, if the second.
Implements AlgAudio::IAlertable.
Reimplemented in AlgAudio::MainWindow.
Signal AlgAudio::Window::on_close |