#include <Magnum/Platform/Screen.h>
template<class Application>
BasicScreen class
Base for application screens.
See BasicScreenedApplication for more information. If exactly one application header is included, this class is also aliased to Platform::Screen
.
Explicit template specializations
The following specialization are explicitly compiled into each particular *Application
library. For other specializations you have to use the ScreenedApplication.hpp implementation file to avoid linker errors. See Template headers and implementation files for more information.
Public types
- enum class PropagatedEvent: UnsignedByte { Draw = 1 << 0, Input = 1 << 1 }
- Event propagated to given screen.
-
using PropagatedEvents = Containers::
EnumSet<PropagatedEvent> - Events propagated to given screen.
- using ViewportEvent = BasicScreenedApplication<Application>::ViewportEvent
- Viewport event.
- using InputEvent = BasicScreenedApplication<Application>::InputEvent
- Input event.
- using Modifier = BasicScreenedApplication<Application>::Modifier new in Git master
- Keyboard modifier.
- using Modifiers = BasicScreenedApplication<Application>::Modifiers new in Git master
- Set of keyboard modifiers.
- using Key = BasicScreenedApplication<Application>::Key new in Git master
- Key.
- using KeyEvent = BasicScreenedApplication<Application>::KeyEvent
- Key event.
- using PointerEventSource = BasicScreenedApplication<Application>::PointerEventSource new in Git master
- Pointer event source.
- using Pointer = BasicScreenedApplication<Application>::Pointer new in Git master
- Pointer type.
- using Pointers = BasicScreenedApplication<Application>::Pointers new in Git master
- Set of pointer types.
- using PointerEvent = BasicScreenedApplication<Application>::PointerEvent new in Git master
- Pointer event.
- using PointerMoveEvent = BasicScreenedApplication<Application>::PointerMoveEvent new in Git master
- Pointer move event.
- using MouseEvent = BasicScreenedApplication<Application>::MouseEvent deprecated in Git master
- Mouse event.
- using MouseMoveEvent = BasicScreenedApplication<Application>::MouseMoveEvent deprecated in Git master
- Mouse move event.
- using ScrollEvent = BasicScreenedApplication<Application>::ScrollEvent new in Git master
- Scroll event.
- using MouseScrollEvent = BasicScreenedApplication<Application>::MouseScrollEvent deprecated in Git master
- Mouse scroll event.
- using TextInputEvent = BasicScreenedApplication<Application>::TextInputEvent new in 2019.10
- Text input event.
- using TextEditingEvent = BasicScreenedApplication<Application>::TextEditingEvent new in 2019.10
- Text editing event.
Constructors, destructors, conversion operators
- BasicScreen() explicit
- Construct a detached screen.
- BasicScreen(BasicScreenedApplication<Application>& application, PropagatedEvents events) explicit new in 2019.10
- Construct a screen and attach it to an application.
Public functions
- auto propagatedEvents() const -> PropagatedEvents
- Events propagated to this screen.
- void setPropagatedEvents(PropagatedEvents events)
- Set events propagated to this screen.
- auto hasApplication() -> bool
- Whether the screen is added to an application.
- auto application() -> BasicScreenedApplication<Application>&
- Application holding this screen.
- auto application() const -> const BasicScreenedApplication<Application>&
-
template<class T = BasicScreenedApplication<Application>>auto application() -> T&
-
template<class T = BasicScreenedApplication<Application>>auto application() const -> const T&
- auto nextNearerScreen() -> BasicScreen<Application>*
- Next nearer screen.
- auto nextNearerScreen() const -> const BasicScreen<Application>*
- auto nextFartherScreen() -> BasicScreen<Application>*
- Next farther screen.
- auto nextFartherScreen() const -> const BasicScreen<Application>*
Screen handling
- void redraw() protected virtual
- Request redraw.
- void focusEvent() private virtual
- Focus event.
- void blurEvent() private virtual
- Blur event.
- void viewportEvent(ViewportEvent& event) private virtual
- Viewport event.
- void drawEvent() private pure virtual
- Draw event.
Keyboard handling
- void keyPressEvent(KeyEvent& event) private virtual
- Key press event.
- void keyReleaseEvent(KeyEvent& event) private virtual
- Key release event.
Pointer handling
- void pointerPressEvent(PointerEvent& event) private virtual new in Git master
- Pointer press event.
- void mousePressEvent(MouseEvent& event) deprecated in Git master private virtual
- Mouse press event.
- void pointerReleaseEvent(PointerEvent& event) private virtual new in Git master
- Pointer release event.
- void mouseReleaseEvent(MouseEvent& event) deprecated in Git master private virtual
- Mouse release event.
- void pointerMoveEvent(PointerMoveEvent& event) private virtual
- Pointer move event.
- void mouseMoveEvent(MouseMoveEvent& event) deprecated in Git master private virtual
- Mouse move event.
- void scrollEvent(ScrollEvent& event) private virtual new in Git master
- Scroll event.
- void mouseScrollEvent(MouseScrollEvent& event) deprecated in Git master private virtual
- Mouse scroll event.
Text input handling
- void textInputEvent(TextInputEvent& event) private virtual new in 2019.10
- Text input event.
- void textEditingEvent(TextEditingEvent& event) private virtual new in 2019.10
- Text editing event.
Enum documentation
template<class Application>
enum class Magnum:: Platform:: BasicScreen<Application>:: PropagatedEvent: UnsignedByte
Event propagated to given screen.
Enumerators | |
---|---|
Draw |
Draw event. When enabled, drawEvent() is propagated to this screen. |
Input |
Input events. When enabled, keyPressEvent(), keyReleaseEvent(), pointerPressEvent(), pointerReleaseEvent(), pointerMoveEvent(), mouseScrollEvent(), textInputEvent() and textEditingEvent() are propagated to this screen. |
Typedef documentation
template<class Application>
typedef Containers:: EnumSet<PropagatedEvent> Magnum:: Platform:: BasicScreen<Application>:: PropagatedEvents
Events propagated to given screen.
template<class Application>
typedef BasicScreenedApplication<Application>::Modifier Magnum:: Platform:: BasicScreen<Application>:: Modifier new in Git master
Keyboard modifier.
Defined only if the application has a KeyEvent.
template<class Application>
typedef BasicScreenedApplication<Application>::Modifiers Magnum:: Platform:: BasicScreen<Application>:: Modifiers new in Git master
Set of keyboard modifiers.
Defined only if the application has a KeyEvent.
template<class Application>
typedef BasicScreenedApplication<Application>::Key Magnum:: Platform:: BasicScreen<Application>:: Key new in Git master
Key.
Defined only if the application has a KeyEvent.
template<class Application>
typedef BasicScreenedApplication<Application>::KeyEvent Magnum:: Platform:: BasicScreen<Application>:: KeyEvent
Key event.
Defined only if the application has a KeyEvent.
template<class Application>
typedef BasicScreenedApplication<Application>::MouseEvent Magnum:: Platform:: BasicScreen<Application>:: MouseEvent
Mouse event.
template<class Application>
typedef BasicScreenedApplication<Application>::MouseMoveEvent Magnum:: Platform:: BasicScreen<Application>:: MouseMoveEvent
Mouse move event.
template<class Application>
typedef BasicScreenedApplication<Application>::ScrollEvent Magnum:: Platform:: BasicScreen<Application>:: ScrollEvent new in Git master
Scroll event.
Defined only if the application has a ScrollEvent.
template<class Application>
typedef BasicScreenedApplication<Application>::MouseScrollEvent Magnum:: Platform:: BasicScreen<Application>:: MouseScrollEvent
Mouse scroll event.
Defined only if the application has a MouseScrollEvent.
template<class Application>
typedef BasicScreenedApplication<Application>::TextInputEvent Magnum:: Platform:: BasicScreen<Application>:: TextInputEvent new in 2019.10
Text input event.
Defined only if the application has a TextInputEvent.
template<class Application>
typedef BasicScreenedApplication<Application>::TextEditingEvent Magnum:: Platform:: BasicScreen<Application>:: TextEditingEvent new in 2019.10
Text editing event.
Defined only if the application has a TextEditingEvent.
Function documentation
template<class Application>
Magnum:: Platform:: BasicScreen<Application>:: BasicScreen() explicit
Construct a detached screen.
The screen is not attached to any application, use BasicScreenedApplication::
template<class Application>
Magnum:: Platform:: BasicScreen<Application>:: BasicScreen(BasicScreenedApplication<Application>& application,
PropagatedEvents events) explicit new in 2019.10
Construct a screen and attach it to an application.
Unlike with BasicScreen(), the screen is added to the application already during the construction, removing the need to call BasicScreenedApplication::
template<class Application>
void Magnum:: Platform:: BasicScreen<Application>:: setPropagatedEvents(PropagatedEvents events)
Set events propagated to this screen.
For non-propagated events related event functions are not called. No events are propagated by default, call this function in focusEvent() and blurEvent() to reflect focus changes.
template<class Application>
bool Magnum:: Platform:: BasicScreen<Application>:: hasApplication()
Whether the screen is added to an application.
If not, the application() accessor can't be used.
template<class Application>
BasicScreenedApplication<Application>& Magnum:: Platform:: BasicScreen<Application>:: application()
Application holding this screen.
Expects that the screen is added to an application.
template<class Application>
const BasicScreenedApplication<Application>& Magnum:: Platform:: BasicScreen<Application>:: application() const
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<class Application>
template<class T = BasicScreenedApplication<Application>>
T& Magnum:: Platform:: BasicScreen<Application>:: application()
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<class Application>
template<class T = BasicScreenedApplication<Application>>
const T& Magnum:: Platform:: BasicScreen<Application>:: application() const
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<class Application>
BasicScreen<Application>* Magnum:: Platform:: BasicScreen<Application>:: nextNearerScreen()
Next nearer screen.
Use application().screens().first()
to access the front screen and application().screens().last()
to access the back screen.
template<class Application>
const BasicScreen<Application>* Magnum:: Platform:: BasicScreen<Application>:: nextNearerScreen() const
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<class Application>
BasicScreen<Application>* Magnum:: Platform:: BasicScreen<Application>:: nextFartherScreen()
Next farther screen.
Use application().screens().first()
to access the front screen and application().screens().last()
to access the back screen.
template<class Application>
const BasicScreen<Application>* Magnum:: Platform:: BasicScreen<Application>:: nextFartherScreen() const
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<class Application>
void Magnum:: Platform:: BasicScreen<Application>:: redraw() virtual protected
Request redraw.
Expects that the screen is added to an application.
template<class Application>
void Magnum:: Platform:: BasicScreen<Application>:: focusEvent() virtual private
Focus event.
Called when screen is focused using BasicScreenedApplication::
template<class Application>
void Magnum:: Platform:: BasicScreen<Application>:: blurEvent() virtual private
Blur event.
Called when another screen is focused using BasicScreenedApplication::
template<class Application>
void Magnum:: Platform:: BasicScreen<Application>:: viewportEvent(ViewportEvent& event) virtual private
Viewport event.
Called from holder application when viewport size changes. See *Application::
template<class Application>
void Magnum:: Platform:: BasicScreen<Application>:: drawEvent() pure virtual private
Draw event.
Called when PropagatedEvent::
template<class Application>
void Magnum:: Platform:: BasicScreen<Application>:: keyPressEvent(KeyEvent& event) virtual private
Key press event.
Called when PropagatedEvent::
template<class Application>
void Magnum:: Platform:: BasicScreen<Application>:: keyReleaseEvent(KeyEvent& event) virtual private
Key release event.
Called when PropagatedEvent::
template<class Application>
void Magnum:: Platform:: BasicScreen<Application>:: pointerPressEvent(PointerEvent& event) virtual private new in Git master
Pointer press event.
Called when PropagatedEvent::
template<class Application>
void Magnum:: Platform:: BasicScreen<Application>:: mousePressEvent(MouseEvent& event) virtual private
Mouse press event.
Called when PropagatedEvent::
template<class Application>
void Magnum:: Platform:: BasicScreen<Application>:: pointerReleaseEvent(PointerEvent& event) virtual private new in Git master
Pointer release event.
Called when PropagatedEvent::
template<class Application>
void Magnum:: Platform:: BasicScreen<Application>:: mouseReleaseEvent(MouseEvent& event) virtual private
Mouse release event.
Called when PropagatedEvent::
template<class Application>
void Magnum:: Platform:: BasicScreen<Application>:: pointerMoveEvent(PointerMoveEvent& event) virtual private
Pointer move event.
Called when PropagatedEvent::
template<class Application>
void Magnum:: Platform:: BasicScreen<Application>:: mouseMoveEvent(MouseMoveEvent& event) virtual private
Mouse move event.
Called when PropagatedEvent::
template<class Application>
void Magnum:: Platform:: BasicScreen<Application>:: scrollEvent(ScrollEvent& event) virtual private new in Git master
Scroll event.
Called when PropagatedEvent::
template<class Application>
void Magnum:: Platform:: BasicScreen<Application>:: mouseScrollEvent(MouseScrollEvent& event) virtual private
Mouse scroll event.
Called when PropagatedEvent::
template<class Application>
void Magnum:: Platform:: BasicScreen<Application>:: textInputEvent(TextInputEvent& event) virtual private new in 2019.10
Text input event.
Called when PropagatedEvent::
template<class Application>
void Magnum:: Platform:: BasicScreen<Application>:: textEditingEvent(TextEditingEvent& event) virtual private new in 2019.10
Text editing event.
Called when PropagatedEvent::