uicore::DisplayWindow Class Referenceabstract

Top-level window class. More...

#include <display_window.h>

Public Member Functions

virtual void bring_to_front ()=0
 Raises the window on top of other windows. More...
 
virtual void capture_mouse (bool capture)=0
 Capture/Release the mouse. More...
 
virtual Pointf client_to_screen (const Pointf &client)=0
 Convert from window client coordinates to screen coordinates. More...
 
virtual PixelBufferPtr clipboard_image () const =0
 Returns an image stored in the clipboard. Returns a null pixelbuffer if no image is available. More...
 
virtual std::string clipboard_text () const =0
 Returns the text stored in the clipboard. More...
 
virtual void enable_alpha_channel (const Rectf &blur_rect)=0
 Enable alpha channel for this window. More...
 
virtual void extend_frame_into_client_area (float left, float top, float right, float bottom)=0
 Exend the window frame into the client area. More...
 
virtual void flip (int interval=-1)=0
 Flip back buffer to front, making changes visible on screen. More...
 
virtual std::function< bool()> & func_minimize_clicked ()=0
 Callback called when a window is asked to minimize itself. More...
 
virtual std::function< void(Rectf &)> & func_window_resize ()=0
 Callback called when a window is being resized. More...
 
virtual const std::vector< InputDevicePtr > & game_controllers () const =0
 Returns the game controller input device. More...
 
virtual const GraphicContextPtrgc () const =0
 Return the graphic context for the window. More...
 
virtual Rectf geometry () const =0
 Returns the position and size of the window frame. More...
 
virtual DisplayWindowHandle handle () const =0
 Returns an platform-specific internal display window handle object. More...
 
virtual bool has_focus () const =0
 Returns true if window has focus. More...
 
virtual void hide ()=0
 Hides the window. More...
 
virtual void hide_cursor ()=0
 Hides the mouse cursor. More...
 
const InputDevicePtrinput_device (const std::string &device_name) const
 Returns the input device with the given device name. More...
 
virtual bool is_clipboard_image_available () const =0
 Returns true if an image is available in the clipboard. More...
 
virtual bool is_clipboard_text_available () const =0
 Returns true if text is available in the clipboard. More...
 
virtual bool is_fullscreen () const =0
 Returns true if window is currently running fullscreen. More...
 
virtual bool is_maximized () const =0
 Returns true if the window is maximized. More...
 
virtual bool is_minimized () const =0
 Returns true if the window is minimized. More...
 
virtual bool is_visible () const =0
 returns true if this display window is visible More...
 
virtual const InputDevicePtrkeyboard () const =0
 Returns the keyboard input device. More...
 
virtual void maximize ()=0
 Maximizes the window. More...
 
virtual Sizef maximum_size (bool client_area=false)=0
 Returns the maximum size the window can be resized to by the application user. More...
 
virtual void minimize ()=0
 Minimizes the window. More...
 
virtual Sizef minimum_size (bool client_area=false)=0
 Returns the minimum size the window can be resized to by the application user. More...
 
virtual const InputDevicePtrmouse () const =0
 Returns the mouse input device. More...
 
virtual void request_repaint ()=0
 Invalidates the screen, causing a repaint. More...
 
virtual void restore ()=0
 Restores the window. More...
 
virtual Pointf screen_to_client (const Pointf &screen)=0
 Convert from screen coordinates to client coordinates. More...
 
virtual void set_clipboard_image (const PixelBufferPtr &buf)=0
 Stores an image in the clipboard. More...
 
virtual void set_clipboard_text (const std::string &text)=0
 Stores text in the clipboard. More...
 
virtual void set_cursor (const CursorPtr &cursor)=0
 Sets the current cursor icon. More...
 
virtual void set_cursor (StandardCursor type)=0
 Set cursor. More...
 
virtual void set_enabled (bool enable)=0
 Set enabled. More...
 
virtual void set_large_icon (const PixelBufferPtr &image)=0
 Sets the large icon used for this window. More...
 
virtual void set_maximum_size (float width, float height, bool client_area)=0
 Maximum size a window can be resized to by the application user. More...
 
virtual void set_minimum_size (float width, float height, bool client_area)=0
 Minimum size a window can be resized to by the application user. More...
 
virtual void set_position (const Rectf &pos, bool client_area)=0
 Set window position and size. More...
 
virtual void set_position (float x, float y)=0
 Set window position. More...
 
virtual void set_size (float width, float height, bool client_area)=0
 Resize window. More...
 
virtual void set_small_icon (const PixelBufferPtr &image)=0
 Sets the small icon used for this window. More...
 
virtual void set_title (const std::string &title)=0
 Change window title. More...
 
void set_visible (bool visible, bool activate)
 Set visible. More...
 
virtual void show (bool activate=true)=0
 Displays the window in its current size and position. More...
 
virtual void show_cursor ()=0
 Shows the mouse cursor. More...
 
virtual Signal< void()> & sig_got_focus ()=0
 Signal emitted when window gain focus. More...
 
virtual Signal< void()> & sig_lost_focus ()=0
 Signal emitted when window lost focus. More...
 
virtual Signal< void()> & sig_paint ()=0
 Signal emitted when the window is invalidated. More...
 
virtual Signal< void(float, float)> & sig_resize ()=0
 Signal emitted when window is resized. More...
 
virtual Signal< void()> & sig_window_close ()=0
 Signal emitted when window is closed. More...
 
virtual Signal< void()> & sig_window_destroy ()=0
 Signal emitted when window is destroyed. More...
 
virtual Signal< void()> & sig_window_flip ()=0
 Signal emitted when window flip() was called. More...
 
virtual Signal< void()> & sig_window_maximized ()=0
 Signal emitted when window is maximized. More...
 
virtual Signal< void()> & sig_window_minimized ()=0
 Signal emitted when window is minimized. More...
 
virtual Signal< void()> & sig_window_moved ()=0
 Signal emitted after a window has been moved. More...
 
virtual Signal< void()> & sig_window_restored ()=0
 Signal emitted when window is restored. More...
 
virtual std::string title () const =0
 Returns the window title. More...
 
virtual void toggle_fullscreen ()=0
 
virtual Rectf viewport () const =0
 Returns the drawable area of the window (excluding window frame). More...
 

Static Public Member Functions

static std::shared_ptr< DisplayWindowcreate (const std::string &title, float width, float height, bool start_fullscreen=false, bool allow_resize=true, int flipping_buffers=2)
 Constructs a window. More...
 
static std::shared_ptr< DisplayWindowcreate (const DisplayWindowDescription &description)
 

Detailed Description

Top-level window class.

Member Function Documentation

virtual void uicore::DisplayWindow::bring_to_front ( )
pure virtual

Raises the window on top of other windows.

virtual void uicore::DisplayWindow::capture_mouse ( bool  capture)
pure virtual

Capture/Release the mouse.

virtual Pointf uicore::DisplayWindow::client_to_screen ( const Pointf client)
pure virtual

Convert from window client coordinates to screen coordinates.

virtual PixelBufferPtr uicore::DisplayWindow::clipboard_image ( ) const
pure virtual

Returns an image stored in the clipboard. Returns a null pixelbuffer if no image is available.

virtual std::string uicore::DisplayWindow::clipboard_text ( ) const
pure virtual

Returns the text stored in the clipboard.

static std::shared_ptr<DisplayWindow> uicore::DisplayWindow::create ( const std::string title,
float  width,
float  height,
bool  start_fullscreen = false,
bool  allow_resize = true,
int  flipping_buffers = 2 
)
static

Constructs a window.

Parameters
title= Titlebar text.
width= Width in pixels of window.
height= Height in pixels of window.
start_fullscreen= If true, window will go fullscreen.
allow_resize= If true, window will have resize grabbers and can be resized.
flipping_buffers= Number of flipping buffers in system. Default is that there is a front buffer and a back buffer.
description= Structure that describes how to create the display window.
static std::shared_ptr<DisplayWindow> uicore::DisplayWindow::create ( const DisplayWindowDescription description)
static
virtual void uicore::DisplayWindow::enable_alpha_channel ( const Rectf blur_rect)
pure virtual

Enable alpha channel for this window.

This is only supported on Windows Vista and above (Else use Layered windows instead)

Parameters
blur_rect= Blur rectangle. If size = 0, then the entire window is used
virtual void uicore::DisplayWindow::extend_frame_into_client_area ( float  left,
float  top,
float  right,
float  bottom 
)
pure virtual

Exend the window frame into the client area.

Only implemented on win32

virtual void uicore::DisplayWindow::flip ( int  interval = -1)
pure virtual

Flip back buffer to front, making changes visible on screen.

The parameter interval specifies the minimum number of video frames that are displayed before a buffer swap will occur.

If interval is set to a value of 0, buffer swaps are not synchronized to a video frame.

If interval is set to a value of -1 (the default), then it will use the buffer swap used for previous flip. If its the first flip, it will use the system default.

Parameters
interval= See note
virtual std::function<bool()>& uicore::DisplayWindow::func_minimize_clicked ( )
pure virtual

Callback called when a window is asked to minimize itself.

virtual std::function<void(Rectf &)>& uicore::DisplayWindow::func_window_resize ( )
pure virtual

Callback called when a window is being resized.

virtual const std::vector<InputDevicePtr>& uicore::DisplayWindow::game_controllers ( ) const
pure virtual

Returns the game controller input device.

virtual const GraphicContextPtr& uicore::DisplayWindow::gc ( ) const
pure virtual

Return the graphic context for the window.

virtual Rectf uicore::DisplayWindow::geometry ( ) const
pure virtual

Returns the position and size of the window frame.

virtual DisplayWindowHandle uicore::DisplayWindow::handle ( ) const
pure virtual

Returns an platform-specific internal display window handle object.

virtual bool uicore::DisplayWindow::has_focus ( ) const
pure virtual

Returns true if window has focus.

virtual void uicore::DisplayWindow::hide ( )
pure virtual

Hides the window.

virtual void uicore::DisplayWindow::hide_cursor ( )
pure virtual

Hides the mouse cursor.

const InputDevicePtr& uicore::DisplayWindow::input_device ( const std::string device_name) const

Returns the input device with the given device name.

virtual bool uicore::DisplayWindow::is_clipboard_image_available ( ) const
pure virtual

Returns true if an image is available in the clipboard.

virtual bool uicore::DisplayWindow::is_clipboard_text_available ( ) const
pure virtual

Returns true if text is available in the clipboard.

virtual bool uicore::DisplayWindow::is_fullscreen ( ) const
pure virtual

Returns true if window is currently running fullscreen.

virtual bool uicore::DisplayWindow::is_maximized ( ) const
pure virtual

Returns true if the window is maximized.

virtual bool uicore::DisplayWindow::is_minimized ( ) const
pure virtual

Returns true if the window is minimized.

virtual bool uicore::DisplayWindow::is_visible ( ) const
pure virtual

returns true if this display window is visible

virtual const InputDevicePtr& uicore::DisplayWindow::keyboard ( ) const
pure virtual

Returns the keyboard input device.

virtual void uicore::DisplayWindow::maximize ( )
pure virtual

Maximizes the window.

virtual Sizef uicore::DisplayWindow::maximum_size ( bool  client_area = false)
pure virtual

Returns the maximum size the window can be resized to by the application user.

virtual void uicore::DisplayWindow::minimize ( )
pure virtual

Minimizes the window.

virtual Sizef uicore::DisplayWindow::minimum_size ( bool  client_area = false)
pure virtual

Returns the minimum size the window can be resized to by the application user.

virtual const InputDevicePtr& uicore::DisplayWindow::mouse ( ) const
pure virtual

Returns the mouse input device.

virtual void uicore::DisplayWindow::request_repaint ( )
pure virtual

Invalidates the screen, causing a repaint.

virtual void uicore::DisplayWindow::restore ( )
pure virtual

Restores the window.

virtual Pointf uicore::DisplayWindow::screen_to_client ( const Pointf screen)
pure virtual

Convert from screen coordinates to client coordinates.

virtual void uicore::DisplayWindow::set_clipboard_image ( const PixelBufferPtr buf)
pure virtual

Stores an image in the clipboard.

virtual void uicore::DisplayWindow::set_clipboard_text ( const std::string text)
pure virtual

Stores text in the clipboard.

virtual void uicore::DisplayWindow::set_cursor ( const CursorPtr cursor)
pure virtual

Sets the current cursor icon.

virtual void uicore::DisplayWindow::set_cursor ( StandardCursor  type)
pure virtual

Set cursor.

Parameters
type= Standard Cursor
virtual void uicore::DisplayWindow::set_enabled ( bool  enable)
pure virtual

Set enabled.

virtual void uicore::DisplayWindow::set_large_icon ( const PixelBufferPtr image)
pure virtual

Sets the large icon used for this window.

virtual void uicore::DisplayWindow::set_maximum_size ( float  width,
float  height,
bool  client_area 
)
pure virtual

Maximum size a window can be resized to by the application user.

virtual void uicore::DisplayWindow::set_minimum_size ( float  width,
float  height,
bool  client_area 
)
pure virtual

Minimum size a window can be resized to by the application user.

virtual void uicore::DisplayWindow::set_position ( const Rectf pos,
bool  client_area 
)
pure virtual

Set window position and size.

Parameters
pos= Window position and size.
client_area= true - Position relative to window client area
virtual void uicore::DisplayWindow::set_position ( float  x,
float  y 
)
pure virtual

Set window position.

Parameters
xWindow x position on desktop.
yWindow y position on desktop.
virtual void uicore::DisplayWindow::set_size ( float  width,
float  height,
bool  client_area 
)
pure virtual

Resize window.

Parameters
width= New width of window in pixels.
height= New height of window in pixels.
client_area= true - relative to the window client area
virtual void uicore::DisplayWindow::set_small_icon ( const PixelBufferPtr image)
pure virtual

Sets the small icon used for this window.

virtual void uicore::DisplayWindow::set_title ( const std::string title)
pure virtual

Change window title.

void uicore::DisplayWindow::set_visible ( bool  visible,
bool  activate 
)

Set visible.

virtual void uicore::DisplayWindow::show ( bool  activate = true)
pure virtual

Displays the window in its current size and position.

virtual void uicore::DisplayWindow::show_cursor ( )
pure virtual

Shows the mouse cursor.

virtual Signal<void()>& uicore::DisplayWindow::sig_got_focus ( )
pure virtual

Signal emitted when window gain focus.

virtual Signal<void()>& uicore::DisplayWindow::sig_lost_focus ( )
pure virtual

Signal emitted when window lost focus.

virtual Signal<void()>& uicore::DisplayWindow::sig_paint ( )
pure virtual

Signal emitted when the window is invalidated.

virtual Signal<void(float, float)>& uicore::DisplayWindow::sig_resize ( )
pure virtual

Signal emitted when window is resized.

virtual Signal<void()>& uicore::DisplayWindow::sig_window_close ( )
pure virtual

Signal emitted when window is closed.

virtual Signal<void()>& uicore::DisplayWindow::sig_window_destroy ( )
pure virtual

Signal emitted when window is destroyed.

virtual Signal<void()>& uicore::DisplayWindow::sig_window_flip ( )
pure virtual

Signal emitted when window flip() was called.

virtual Signal<void()>& uicore::DisplayWindow::sig_window_maximized ( )
pure virtual

Signal emitted when window is maximized.

virtual Signal<void()>& uicore::DisplayWindow::sig_window_minimized ( )
pure virtual

Signal emitted when window is minimized.

virtual Signal<void()>& uicore::DisplayWindow::sig_window_moved ( )
pure virtual

Signal emitted after a window has been moved.

virtual Signal<void()>& uicore::DisplayWindow::sig_window_restored ( )
pure virtual

Signal emitted when window is restored.

virtual std::string uicore::DisplayWindow::title ( ) const
pure virtual

Returns the window title.

virtual void uicore::DisplayWindow::toggle_fullscreen ( )
pure virtual

Toggle fullscreen Only Win32 implementation for now

virtual Rectf uicore::DisplayWindow::viewport ( ) const
pure virtual

Returns the drawable area of the window (excluding window frame).


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