libAlgAudio  v1.99-440-g08538e5-dirty
The development library for AlgAudio framework.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AlgAudio::Window Class Reference

#include <Window.hpp>

Inheritance diagram for AlgAudio::Window:
AlgAudio::SubscriptionsManager AlgAudio::IAlertable AlgAudio::Console AlgAudio::LaunchConfigWindow AlgAudio::MainWindow

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< UIWidgetGetRoot () const
 
Size2D GetSize () const
 
SDL_Window * GetWindow () const
 
void Insert (std::shared_ptr< UIWidget > child)
 
Windowoperator= (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< WindowCreate (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)
 

Detailed Description

This class represents a drawable on-screen window.

Constructor & Destructor Documentation

AlgAudio::Window::~Window ( )
AlgAudio::Window::Window ( const Window )
delete

Explicitly forbids copying windows.

AlgAudio::Window::Window ( std::string  title,
int  w,
int  h,
bool  centered = true,
bool  resizable = true 
)
protected

Member Function Documentation

static std::shared_ptr<Window> AlgAudio::Window::Create ( std::string  title = "AlgAudio",
int  w = 350,
int  h = 300,
bool  centered = true,
bool  resizable = true 
)
static

Creates a new native window.

Parameters
titleThe window title to use.
wInitial window width.
hInitial window height.
centeredIf true, window will be placed on the center of the screen.
resizableIf false, the user will not be able to manually change the dimentions of the window. Otherwise, the initial window position is undefined.
template<class W , typename... Args>
std::shared_ptr<W> AlgAudio::Window::Create ( Args...  args)
inline
unsigned int AlgAudio::Window::GetID ( ) const
inline

Returns a unique window identifier, as defined by SDL.

SDL_Renderer* AlgAudio::Window::GetRenderer ( ) const
inline

Returns a pointer the the SDL_Renderer associated with this window.

std::shared_ptr<UIWidget> AlgAudio::Window::GetRoot ( ) const
inline

Returns the widget that is in the root of this window's widget hierarchy.

Size2D AlgAudio::Window::GetSize ( ) const

Returns current window size.

SDL_Window* AlgAudio::Window::GetWindow ( ) const
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.

Window& AlgAudio::Window::operator= ( const Window )
delete
virtual void AlgAudio::Window::ProcessCloseEvent ( )
virtual

Reimplemented in AlgAudio::MainWindow.

void AlgAudio::Window::ProcessEnterEvent ( )
virtual void AlgAudio::Window::ProcessKeyboardEvent ( KeyData  data)
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/

virtual LateReturn AlgAudio::Window::ShowErrorAlert ( std::string  ,
std::string   
)
inlinevirtual

Implements AlgAudio::IAlertable.

Reimplemented in AlgAudio::MainWindow.

virtual LateReturn<int> AlgAudio::Window::ShowSimpleAlert ( std::string  message,
std::string  button1_text,
std::string  button2_text,
AlertType  type,
Color  button1_color,
Color  button2_color 
)
inlinevirtual

Returns 0 if the first button was clicked, 1, if the second.

Implements AlgAudio::IAlertable.

Reimplemented in AlgAudio::MainWindow.

Member Data Documentation

Signal AlgAudio::Window::on_close

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