![]() |
Gorgon Game Engine
|
This class represents a window. More...
Classes | |
struct | FullscreenTag |
Fullscreen tag. | |
Public Member Functions | |
Window () | |
Empty constructor creates a non-initialized window. More... | |
Window (const FullscreenTag &, const WindowManager::Monitor &monitor, const std::string &name, const std::string &title="") | |
Creates a fullscreen window. More... | |
Window (const FullscreenTag &tag, const std::string &name, const std::string &title="") | |
Creates a fullscreen window. More... | |
Window (const Geometry::Size &size, const char *name, bool allowresize=false, bool visible=true) | |
Creates a new window at the center of the screen. More... | |
Window (const Geometry::Size &size, const char *name, const char *title, bool allowresize=false, bool visible=true) | |
Creates a new window at the center of the screen. More... | |
Window (const Geometry::Size &size, const std::string &name, bool allowresize=false, bool visible=true) | |
Creates a new window at the center of the screen. More... | |
Window (const Geometry::Size &size, const std::string &name, const std::string &title, bool allowresize=false, bool visible=true) | |
Creates a new window at the center of the screen. More... | |
Window (const Window &)=delete | |
Copy constructor is not allowed. More... | |
Window (const WindowManager::Monitor &monitor, const Geometry::Size &size, const char *name, bool allowresize=false, bool visible=true) | |
Creates a new window at the center of the screen. More... | |
Window (const WindowManager::Monitor &monitor, const Geometry::Size &size, const std::string &name, bool allowresize=false, bool visible=true) | |
Creates a new window at the center of the screen. More... | |
Window (Geometry::Rectangle rect, const char *name, bool allowresize=false, bool visible=true) | |
Creates a new window. More... | |
Window (Geometry::Rectangle rect, const std::string &name, bool allowresize=false, bool visible=true) | |
Creates a new window. More... | |
Window (Window &&other) | |
Move constructor. More... | |
~Window () | |
Destroys this window. More... | |
void | activatecontext () |
Activates the GL context of the window. More... | |
void | AllowResize () |
Allows window to be resized by the user. More... | |
void | Center () |
Centers the window to the default monitor. More... | |
void | Center (const WindowManager::Monitor &monitor) |
Centers the window to the given monitor. More... | |
void | Close () |
Closes the window. After this function, any use of this object might fail. More... | |
void | Destroy () |
Destroys this window. More... | |
void | Focus () |
Focuses this window. More... | |
Geometry::Bounds | GetExteriorBounds () const |
Returns the exterior bounding box of the window. More... | |
const WindowManager::Monitor & | GetMonitor () const |
Returns the monitor that the window is currently on. More... | |
Geometry::Point | GetMouseLocation () const |
Returns the mouse location on the window. More... | |
std::string | GetName () const |
Returns the name of the window that is set at creation time. More... | |
Geometry::Point | GetPosition () const |
Returns the current position of the window. More... | |
std::string | GetTitle () const |
Returns the current title of the window. More... | |
virtual void | Hide () override |
Hides this window, may generate Deactivated event. More... | |
void | HidePointer () |
Hides the pointer. More... | |
bool | IsClosed () const |
Whether the window is currently closed and cannot be acted on. More... | |
bool | IsFocused () const |
Returns if this window has the focus. More... | |
bool | IsLeftButtonPressed () const |
Query whether the left mouse button is pressed. More... | |
bool | IsLocalPointer () const |
Returns whether the current pointer is a local pointer. More... | |
bool | IsMaximized () const |
Returns if the window is maximized. More... | |
bool | IsMiddleButtonPressed () const |
Query whether the middle mouse button is pressed. More... | |
bool | IsMinimized () const |
Returns if the window is minimized. More... | |
bool | IsPointerVisible () const |
Returns whether the pointer is visible. More... | |
bool | IsRightButtonPressed () const |
Query whether the right mouse button is pressed. More... | |
virtual bool | IsVisible () const override |
Returns whether this layer is effectively visible. More... | |
bool | IsX1ButtonPressed () const |
Query whether the X1 mouse button is pressed. More... | |
bool | IsX2ButtonPressed () const |
Query whether the X2 mouse button is pressed. More... | |
void | Maximize () |
Maximizes the window to cover the usable area of the screen. More... | |
void | Minimize () |
Minimizes the window. More... | |
void | mouse_down (Geometry::Point location, Input::Mouse::Button button) |
These functions are used internally. More... | |
void | mouse_event (Input::Mouse::EventType event, Geometry::Point location, Input::Mouse::Button button, float amount) |
These functions are used internally. More... | |
void | mouse_location () |
These functions are used internally. More... | |
void | mouse_up (Geometry::Point location, Input::Mouse::Button button) |
These functions are used internally. More... | |
virtual void | Move (const Geometry::Point &position) override |
Moves the window to the given position. More... | |
virtual void | Move (int x, int y) override |
Moves the window to the given position. More... | |
Window & | operator= (Window &&other) |
Moves another window into this one. More... | |
Input::Mouse::Button | PressedButtons () const |
Returns currently pressed buttons. More... | |
void | PreventResize () |
Prevents window to be resized by the user. More... | |
void | processmessages () |
This method is automatically called by the system.Unless its necessary, do not use it. More... | |
virtual void | Render () override |
Renders the contents of the window. More... | |
virtual void | Resize (const Geometry::Size &size) override |
Resizes the window to the given size. More... | |
virtual void | Resize (int width, int height) override |
Resizes the window to the given size. More... | |
void | Restore () |
Restores a minimized or maximized window. More... | |
void | SetIcon (const WindowManager::Icon &icon) |
Changes the icon of the window. More... | |
void | SetTitle (const std::string &title) |
Changes the title of the window to the specified string. More... | |
virtual void | Show () override |
Displays this window, may generate Activated event. More... | |
void | ShowPointer () |
Displays the pointer. More... | |
void | Swap (Window &other) |
Used for move semantics. More... | |
void | SwitchToLocalPointers () |
Removes the operating system pointer and starts using Locally defined pointers. More... | |
void | SwitchToWMPointers () |
Stops showing local pointers and makes window manager pointer visible. More... | |
![]() | |
Layer () | |
Constructor that sets the layer to cover entire parent, no matter how big it is. More... | |
Layer (const Geometry::Bounds &bounds) | |
Initializing constructor. More... | |
Layer (const Geometry::Point &location) | |
Constructor that places the layer to the given location. More... | |
Layer (const Layer &)=delete | |
Copy constructor is disabled. More... | |
Layer (Layer &&other) | |
Move constructor. More... | |
virtual | ~Layer () |
Destructor. More... | |
Layer & | operator= (const Layer &)=delete |
Copy assignment is deleted. More... | |
Layer & | operator= (Layer &&other) |
Move assignment. More... | |
virtual bool | propagate_mouseevent (Input::Mouse::EventType evet, Geometry::Point location, Input::Mouse::Button button, float amount, MouseHandler &handlers) |
Propagates a mouse event. More... | |
void | Swap (Layer &other) |
Swaps two layers, mostly used for move semantics. More... | |
void | Add (Layer &layer) |
Adds the given layer as a child. More... | |
void | Add (Layer *layer) |
Adds the given layer as a child. More... | |
void | setname (std::string value) |
For debugging. More... | |
void | Insert (Layer &layer, long under) |
Inserts the given layer before the given index. More... | |
void | Insert (Layer *layer, long under) |
Inserts the given layer before the given index. More... | |
void | Remove (Layer &layer) |
Removes the given layer. More... | |
void | Remove (Layer *layer) |
Removes the given layer. More... | |
bool | HasParent () const |
Returns whether this layer has a parent. More... | |
virtual Layer & | GetParent () const |
Returns the parent of this layer. More... | |
Layer & | GetTopLevel () const |
Returns the top level layer that contains this layer. More... | |
virtual Geometry::Point | TranslateToTopLevel (Geometry::Point location={0, 0}) const |
Translates the given location to the top level. More... | |
Layer & | GetTopLevel () |
Containers::Collection< Layer >::ConstIterator | begin () const |
An iterator pointing to the start of the children. More... | |
Containers::Collection< Layer >::ConstIterator | end () const |
An iterator pointing to the end of the children. More... | |
Containers::Collection< Layer >::ConstIterator | First () const |
An iterator pointing to the start of the children. More... | |
Containers::Collection< Layer >::ConstIterator | Last () const |
An iterator pointing to the last item of the children. More... | |
void | PlaceBefore (int before) |
Places this layer before the given index. More... | |
void | PlaceToTop () |
Places this layer to the top of the layer stack its in. More... | |
void | PlaceToBottom () |
Places this layer to the bottom of the layer stack. More... | |
int | GetOrder () const |
Gets the current order of the stack. More... | |
void | SetWidth (int width) |
Resizes the layer to the given size. More... | |
void | SetHeight (int height) |
Resizes the layer to the given size. More... | |
void | SetBounds (const Geometry::Bounds &bounds) |
Sets the boundaries of this layer. More... | |
Geometry::Size | GetSize () const |
Returns the size of the layer. More... | |
Geometry::Size | GetCalculatedSize () const |
Returns the size of the layer. More... | |
int | GetWidth () const |
Returns the width of the layer. More... | |
int | GetHeight () const |
Returns the height of the layer. More... | |
Geometry::Point | GetLocation () const |
Returns the current location of the layer. More... | |
int | GetLeft () const |
Returns the current location of the layer. More... | |
int | GetTop () const |
Returns the current location of the layer. More... | |
Geometry::Bounds | GetBounds () const |
Returns the boundaries of the layer. More... | |
Geometry::Bounds | GetEffectiveBounds () const |
Returns the effective boundaries of the layer. More... | |
Static Public Member Functions | |
static Geometry::Size | GetMinimumRequiredSize () |
Returns the minimum size required to fit any window inside. More... | |
Public Attributes | |
Graphics::PointerStack | Pointers |
Pointer system to be used within the window. More... | |
![]() | |
const Containers::Collection< Layer > & | Children |
Sub-layers that this layer holds, all the sub-layers are considered to be above current layer. More... | |
Static Public Attributes | |
static const struct Gorgon::Window::FullscreenTag | Fullscreen |
static const Containers::Collection< Window > & | Windows |
List of currently created windows. More... | |
![]() | |
static const Geometry::Bounds | EntireRegion |
When used as layer bounds, represents the entire region its placed in. More... | |
Protected Member Functions | |
Window (const WindowManager::Monitor &monitor, Geometry::Rectangle rect, const std::string &name, const std::string &title, bool allowresize, bool visible) | |
virtual void | added (Layer &layer) override |
Will be called when a layer is added. More... | |
void | deleting (Layer *layer) |
virtual void | located (Layer *) override |
A window cannot be placed in another layer. This function always fails. More... | |
![]() | |
void | dotransformandclip (bool inverse=false) |
Performs transformation and clipping. Use inverse for reverse mapping for mouse events. More... | |
virtual void | removed (Layer &layer) |
Will be called when a layer is removed. More... | |
void | reverttransformandclip () |
Reverts previously done transformation. More... | |
Events | |
Event< Window > | FocusedEvent |
Called when this window is focused. More... | |
Event< Window > | LostFocusEvent |
Called when this window is deactivated. More... | |
Event< Window > | DestroyedEvent |
Called when this window is destroyed. More... | |
Event< Window, bool & > | ClosingEvent |
Called when user tries to close the window. More... | |
Event< Window > | MovedEvent |
Called after the window is moved, either by the user or programmatically. More... | |
Event< Window > | ResizedEvent |
Called after the window is resized, either by the user or programmatically. More... | |
Event< Window > | MinimizedEvent |
Called after the window is minimized, either by the user or programmatically. More... | |
Event< Window > | RestoredEvent |
Called after the window is restored from minimized state, either by the user or programmatically. More... | |
ConsumableEvent< Window, Input::Key, float > | KeyEvent |
Called when a key is pressed or released. More... | |
ConsumableEvent< Window, Input::Keyboard::Char > | CharacterEvent |
Called when a character is received. More... | |
Additional Inherited Members | |
![]() | |
Geometry::Bounds | bounds |
Bounds of this layer. More... | |
Containers::Collection< Layer > | children |
Child layers that this layer holds, all child layers are considered to be above current layer. More... | |
bool | isvisible |
Whether this layer is visible, invisible layers will not be drawn or receive any events. More... | |
std::string | name |
For debugging. More... | |
Layer * | parent |
Parent layer, could be nullptr. More... | |
This class represents a window.
Window | ( | ) |
Window | ( | Geometry::Rectangle | rect, |
const std::string & | name, | ||
bool | allowresize = false , |
||
bool | visible = true |
||
) |
Creates a new window.
rect | the position and the interior size of the window unless use outer metrics is set to true |
name | of the window |
visible | after creation, window will be visible or invisible depending on this value. |
Window | ( | Geometry::Rectangle | rect, |
const char * | name, | ||
bool | allowresize = false , |
||
bool | visible = true |
||
) |
Creates a new window.
rect | the position and the interior size of the window unless use outer metrics is set to true |
name | of the window |
visible | after creation, window will be visible or invisible depending on this value. |
Window | ( | const Geometry::Size & | size, |
const std::string & | name, | ||
const std::string & | title, | ||
bool | allowresize = false , |
||
bool | visible = true |
||
) |
Creates a new window at the center of the screen.
size | of the window |
name | of the window |
title | of the window |
visible | after creation, window will be visible or invisible depending on this value. |
Window | ( | const Geometry::Size & | size, |
const char * | name, | ||
const char * | title, | ||
bool | allowresize = false , |
||
bool | visible = true |
||
) |
Creates a new window at the center of the screen.
size | of the window |
name | of the window |
title | of the window |
visible | after creation, window will be visible or invisible depending on this value. |
Window | ( | const Geometry::Size & | size, |
const std::string & | name, | ||
bool | allowresize = false , |
||
bool | visible = true |
||
) |
Creates a new window at the center of the screen.
size | of the window |
name | of the window |
visible | after creation, window will be visible or invisible depending on this value. |
Window | ( | const Geometry::Size & | size, |
const char * | name, | ||
bool | allowresize = false , |
||
bool | visible = true |
||
) |
Creates a new window at the center of the screen.
size | of the window |
name | of the window |
visible | after creation, window will be visible or invisible depending on this value. |
Window | ( | const WindowManager::Monitor & | monitor, |
const Geometry::Size & | size, | ||
const std::string & | name, | ||
bool | allowresize = false , |
||
bool | visible = true |
||
) |
Creates a new window at the center of the screen.
monitor | that the window will be centered on |
size | of the window |
name | of the window |
visible | after creation, window will be visible or invisible depending on this value. |
Window | ( | const WindowManager::Monitor & | monitor, |
const Geometry::Size & | size, | ||
const char * | name, | ||
bool | allowresize = false , |
||
bool | visible = true |
||
) |
Creates a new window at the center of the screen.
monitor | that the window will be centered on |
size | of the window |
name | of the window |
visible | after creation, window will be visible or invisible depending on this value. |
Window | ( | const FullscreenTag & | , |
const WindowManager::Monitor & | monitor, | ||
const std::string & | name, | ||
const std::string & | title = "" |
||
) |
Creates a fullscreen window.
Fullscreen windows do not have chrome and covers entire screen, including any panels it contains.
References Layer::Add(), ASSERT, Monitor::GetLocation(), Monitor::GetSize(), windowdata::handle, basic_Size< T_ >::Height, windowdata::ismapped, windowdata::ppoint, Layer::Resize(), basic_Size< T_ >::Width, Gorgon::WindowManager::WM_DELETE_WINDOW, basic_Point< T_ >::X, Gorgon::WindowManager::XA_ATOM, Gorgon::WindowManager::XA_NET_WM_STATE, Gorgon::WindowManager::XA_NET_WM_STATE_FULLSCREEN, and basic_Point< T_ >::Y.
Window | ( | const FullscreenTag & | tag, |
const std::string & | name, | ||
const std::string & | title = "" |
||
) |
Creates a fullscreen window.
Fullscreen windows do not have chrome and covers entire screen, including any panels it contains.
~Window | ( | ) |
Destroys this window.
References Window::Destroy().
|
protected |
void activatecontext | ( | ) |
Activates the GL context of the window.
This function is used internally and should not be called unless necessary.
|
overrideprotectedvirtual |
Will be called when a layer is added.
This function will even be called when the given layer was already in the children.
Reimplemented from Layer.
Reimplemented in Window.
References Layer::children.
void AllowResize | ( | ) |
Allows window to be resized by the user.
References windowdata::handle.
void Center | ( | ) |
Centers the window to the default monitor.
References Monitor::Primary().
void Center | ( | const WindowManager::Monitor & | monitor | ) |
Centers the window to the given monitor.
References Window::Center(), Window::GetExteriorBounds(), Layer::GetSize(), Monitor::GetUsable(), and Window::Move().
void Close | ( | ) |
Closes the window. After this function, any use of this object might fail.
References Window::DestroyedEvent, and windowdata::handle.
|
protected |
void Destroy | ( | ) |
Destroys this window.
References Window::Close().
void Focus | ( | ) |
Focuses this window.
References windowdata::handle, and Gorgon::WindowManager::XA_NET_ACTIVE_WINDOW.
Geometry::Bounds GetExteriorBounds | ( | ) | const |
Returns the exterior bounding box of the window.
May throw or return invalid values if the window is not visible
References windowdata::handle, Gorgon::swap(), and Gorgon::WindowManager::XA_NET_FRAME_EXTENTS.
|
static |
Returns the minimum size required to fit any window inside.
References basic_Size< T_ >::Height, basic_Size< T_ >::Width, and Window::Windows.
const WindowManager::Monitor & GetMonitor | ( | ) | const |
Returns the monitor that the window is currently on.
May throw if the window is not visible, will throw if the window is not on any currently known monitors. If this case occurs consider refreshing monitor list.
References basic_Bounds< T_ >::Center(), Window::GetExteriorBounds(), Gorgon::Geometry::IsInside(), and Monitor::Monitors().
Geometry::Point GetMouseLocation | ( | ) | const |
Returns the mouse location on the window.
If the cursor is outside the window and its position cannot be determined (-1, -1) is returned. This function can return coordinates outside the bounds of the window.
std::string GetName | ( | ) | const |
Returns the name of the window that is set at creation time.
Geometry::Point GetPosition | ( | ) | const |
Returns the current position of the window.
This value is measured from the (0,0) of the virtual screen to the top-left of the window chrome.
References Window::GetExteriorBounds(), and basic_Bounds< T_ >::TopLeft().
std::string GetTitle | ( | ) | const |
Returns the current title of the window.
|
overridevirtual |
Hides this window, may generate Deactivated event.
Reimplemented from Layer.
References windowdata::handle, Layer::Hide(), and windowdata::ismapped.
void HidePointer | ( | ) |
Hides the pointer.
If local pointers are activated, this function will hide local pointer, otherwise it will hide window manager pointer. In both cases, after calling to this function, there will be no visible pointer on the screen.
References Layer::Clear(), windowdata::handle, Layer::Hide(), and windowdata::pointerdisplayed.
bool IsClosed | ( | ) | const |
Whether the window is currently closed and cannot be acted on.
References windowdata::handle.
bool IsFocused | ( | ) | const |
Returns if this window has the focus.
References windowdata::handle.
bool IsLeftButtonPressed | ( | ) | const |
Query whether the left mouse button is pressed.
References Gorgon::Input::Keyboard::Keycodes::Left.
bool IsLocalPointer | ( | ) | const |
Returns whether the current pointer is a local pointer.
bool IsMaximized | ( | ) | const |
Returns if the window is maximized.
bool IsMiddleButtonPressed | ( | ) | const |
Query whether the middle mouse button is pressed.
References Gorgon::Input::Mouse::Middle.
bool IsMinimized | ( | ) | const |
Returns if the window is minimized.
bool IsPointerVisible | ( | ) | const |
Returns whether the pointer is visible.
bool IsRightButtonPressed | ( | ) | const |
Query whether the right mouse button is pressed.
References Gorgon::Input::Keyboard::Keycodes::Right.
|
overridevirtual |
Returns whether this layer is effectively visible.
Reimplemented from Layer.
Reimplemented in Window.
References Layer::isvisible.
bool IsX1ButtonPressed | ( | ) | const |
Query whether the X1 mouse button is pressed.
References Gorgon::Input::Mouse::X1.
bool IsX2ButtonPressed | ( | ) | const |
Query whether the X2 mouse button is pressed.
References Gorgon::Input::Mouse::X2.
|
overrideprotectedvirtual |
A window cannot be placed in another layer. This function always fails.
Reimplemented from Layer.
References Gorgon::Utils::ASSERT_FALSE().
void Maximize | ( | ) |
Maximizes the window to cover the usable area of the screen.
Use Restore function to return the window to its previous size and position. Maximize might take time.
References windowdata::handle, Gorgon::WindowManager::XA_NET_WM_STATE, Gorgon::WindowManager::XA_NET_WM_STATE_ADD, Gorgon::WindowManager::XA_NET_WM_STATE_MAXIMIZED_HORZ, and Gorgon::WindowManager::XA_NET_WM_STATE_MAXIMIZED_VERT.
void Minimize | ( | ) |
Minimizes the window.
Use Restore function to return it to its previous state.
References windowdata::handle.
void mouse_down | ( | Geometry::Point | location, |
Input::Mouse::Button | button | ||
) |
These functions are used internally.
References Layer::bounds, Gorgon::Clip, Gorgon::Input::Keyboard::Keycodes::Down, Gorgon::Input::Mouse::DownPressed, Gorgon::Input::IsDragging(), Layer::propagate_mouseevent(), and Gorgon::Transform.
void mouse_event | ( | Input::Mouse::EventType | event, |
Geometry::Point | location, | ||
Input::Mouse::Button | button, | ||
float | amount | ||
) |
These functions are used internally.
References Layer::bounds, Gorgon::Clip, Layer::propagate_mouseevent(), and Gorgon::Transform.
void mouse_location | ( | ) |
These functions are used internally.
References ASSERT, Layer::bounds, MouseHandler::Clear(), Layer::Clear(), Gorgon::Clip, PointerStack::Current(), Drawable::Draw(), Gorgon::Input::Mouse::HitCheck, Gorgon::Input::IsDragging(), PointerStack::IsValid(), Layer::IsVisible(), MouseHandler::layers, Gorgon::Input::Mouse::Move, Gorgon::Input::Mouse::MovePressed, Gorgon::Input::Mouse::None, Gorgon::Input::Mouse::Out, Gorgon::Input::Mouse::Over, Window::Pointers, Layer::propagate_mouseevent(), and Gorgon::Transform.
void mouse_up | ( | Geometry::Point | location, |
Input::Mouse::Button | button | ||
) |
These functions are used internally.
References Layer::bounds, Gorgon::Input::CancelDrag(), MouseHandler::Clear(), Gorgon::Input::Mouse::Click, Gorgon::WindowManager::ClickThreshold, Gorgon::Clip, basic_Point< T_ >::Distance(), Gorgon::Input::GetDragOperation(), DragInfo::GetTarget(), Gorgon::Input::IsDragging(), Gorgon::Input::Mouse::None, DropTarget::propagate_mouseevent(), Layer::propagate_mouseevent(), Gorgon::Transform, and Gorgon::Input::Keyboard::Keycodes::Up.
|
overridevirtual |
Moves the window to the given position.
Reimplemented from Layer.
References windowdata::handle, windowdata::ismapped, windowdata::move, windowdata::moveto, Gorgon::swap(), basic_Point< T_ >::X, Gorgon::WindowManager::XA_NET_FRAME_EXTENTS, and basic_Point< T_ >::Y.
|
overridevirtual |
Moves another window into this one.
References Window::Swap().
Input::Mouse::Button PressedButtons | ( | ) | const |
Returns currently pressed buttons.
void PreventResize | ( | ) |
Prevents window to be resized by the user.
References Layer::GetSize(), and windowdata::handle.
void processmessages | ( | ) |
This method is automatically called by the system.Unless its necessary, do not use it.
References Window::activatecontext(), Gorgon::WindowManager::assertkeys(), Window::Close(), Window::ClosingEvent, windowdata::focused, Window::FocusedEvent, Gorgon::WindowManager::GetMousePosition(), Layer::GetSize(), windowdata::handle, Gorgon::WindowManager::handledndevent(), Gorgon::WindowManager::handleinputevent(), Window::IsMinimized(), Window::LostFocusEvent, windowdata::min, Window::MinimizedEvent, Window::mouse_location(), Window::MovedEvent, windowdata::ppoint, Gorgon::GL::Resize(), Layer::Resize(), Window::ResizedEvent, Window::RestoredEvent, Gorgon::WindowManager::WM_DELETE_WINDOW, basic_Point< T_ >::X, Gorgon::WindowManager::XA_NET_WM_STATE, Gorgon::WindowManager::XA_PROTOCOLS, Gorgon::WindowManager::XdndDrop, Gorgon::WindowManager::XdndEnter, Gorgon::WindowManager::XdndLeave, Gorgon::WindowManager::XdndPosition, and basic_Point< T_ >::Y.
|
overridevirtual |
Renders the contents of the window.
Reimplemented from Layer.
References Window::activatecontext(), Layer::bounds, Gorgon::GL::Clear(), Gorgon::Clip, basic_Bounds< T_ >::GetSize(), Layer::GetSize(), Gorgon::LayerColor, Gorgon::Offset, Layer::Render(), Gorgon::ResetTransform(), Gorgon::ScreenSize, and FrameBuffer::UpdateSizes().
|
overridevirtual |
Resizes the window to the given size.
The given size is considered as the interior region of the window. The restrictions for the smallest sized window might change depending on the window manager or theme. Largest window size can be obtained using UsableScreenRegion however, this size does not exclude window chrome. This function resizes all window sized layers.
Reimplemented from Layer.
References windowdata::handle, basic_Size< T_ >::Height, and basic_Size< T_ >::Width.
|
overridevirtual |
Resizes the window to the given size.
The given size is considered as the interior region of the window. The restrictions for the smallest sized window might change depending on the window manager or theme. Largest window size can be obtained using UsableScreenRegion however, this size does not exclude window chrome. This function resizes all window sized layers.
Reimplemented from Layer.
References Window::Resize().
void Restore | ( | ) |
Restores a minimized or maximized window.
void SetIcon | ( | const WindowManager::Icon & | icon | ) |
Changes the icon of the window.
References windowdata::handle, Gorgon::WindowManager::XA_CARDINAL, and Gorgon::WindowManager::XA_NET_WM_ICON.
void SetTitle | ( | const std::string & | title | ) |
Changes the title of the window to the specified string.
References windowdata::handle.
|
overridevirtual |
Displays this window, may generate Activated event.
Reimplemented from Layer.
References windowdata::handle, windowdata::ismapped, windowdata::move, windowdata::moveto, Layer::Show(), basic_Point< T_ >::X, and basic_Point< T_ >::Y.
void ShowPointer | ( | ) |
Displays the pointer.
If local pointers are activated, this function will show local pointer, otherwise it will show window manager pointer
References windowdata::handle, windowdata::pointerdisplayed, and Layer::Show().
void Swap | ( | Window & | other | ) |
Used for move semantics.
References Window::CharacterEvent, Window::ClosingEvent, Window::DestroyedEvent, Window::FocusedEvent, Window::KeyEvent, Window::LostFocusEvent, Window::MinimizedEvent, Window::MovedEvent, Window::Pointers, Window::ResizedEvent, Window::RestoredEvent, Gorgon::swap(), Layer::Swap(), MouseHandler::Swap(), and PointerStack::Swap().
void SwitchToLocalPointers | ( | ) |
Removes the operating system pointer and starts using Locally defined pointers.
If there are no pointers added to the Pointers object, this function will throw. After switching, ShowPointer and HidePointer will show and hide local pointers not OS pointers. Calling this function will show the local pointer.
References Window::HidePointer(), and Window::ShowPointer().
void SwitchToWMPointers | ( | ) |
Stops showing local pointers and makes window manager pointer visible.
References Window::HidePointer(), and Window::ShowPointer().
ConsumableEvent<Window, Input::Keyboard::Char> CharacterEvent |
Called when a character is received.
This event is raised for regular characters that can be printed. If a key is handled in keypress event, this event will not be fired. This event will be called multiple times when the key repeats.
Called when this window is destroyed.
Note that at this point, any reference to this object may fail.
|
static |
ConsumableEvent<Window, Input::Key, float> KeyEvent |
Called when a key is pressed or released.
This key could be a keyboard key or any other controller key including mouse. In case of mouse, this method will be triggered if mouse call is not handled by layers.
If the input device is keyboard, key down event (amount=1) is repeated if the first event is handled. The repeats will only be sent to the handler of the event. Additionally, Key up event (amount=0) is sent only to handler, if key down is handled otherwise it will be sent to all listeners.
Key (Input::Key)
: The key that is pressed or released Amount (float)
: Depending on the device this can be a boolean 0 and 1, number of successive key strokes or amount of pressure (0 to 1) in analog controllers
Called after the window is minimized, either by the user or programmatically.
Graphics::PointerStack Pointers |
Pointer system to be used within the window.
Called after the window is resized, either by the user or programmatically.
Called after the window is restored from minimized state, either by the user or programmatically.
|
static |
List of currently created windows.