Abstract screen rectangle component.
More...
#include <Q/q.h>
Inheritance diagram for Q::Layer:
List of all members.
Detailed Description
Abstract screen rectangle component.
Different types of layer are tiled onto a screen to form the user interface. A layer is a 2-dimensional rectangular area on a given screen.
The shape and location of this rectangle depends on several parameters. The 'center' of the layer determines the location of the rectangle in the screen's virtual coordinate system. The 'alignment' of the layer determines the location of the origin of the layer's local coordinate system. An alignment of (0,0) places the origin at the bottom left of the layer and an alignment of (1,1) places it at the top right. The 'extent' of the layer gives its width and height in the screen's virtual coordinate system and the 'angle' can be used to rotate it.
Each layer has a position within a stack of layers in the screen. The stack of layers is rendered in order from bottom to top with layers higher in the stack obscuring lower layers. The position can either be set explicitly with methods of Screen (e.g. Screen::moveToTop) or implicitly by setting its 'depth' parameter.
The Layer class is a base class for the actual functional layers. It provides common functionality but it is not possible to construct an object of type Layer.
Constructor & Destructor Documentation
| Q::Layer::Layer |
( |
|
) |
[inline] |
|
|
|
Create a null layer reference. |
Member Function Documentation
|
|
Add a listener which will receive mouse events when this layer has the mouse focus. |
|
|
Add a listener which will receive keyboard events when this layer has the keyboard focus. |
|
|
Return the alignment of the layer. |
| bool Q::Layer::alwaysTop |
( |
|
) |
const |
|
|
|
Return true if the layer is intended to always be on top of the screen's layer stack. |
| float Q::Layer::angle |
( |
|
) |
const |
|
|
|
Return the angle of the layer measured in radians counter-clockwise. An angle of zero leaves the layer's coordinate system aligned with the screen's virtual coordinate system. |
|
|
Return the center of the layer. |
| unsigned int Q::Layer::depth |
( |
|
) |
const |
|
|
|
Return the depth of the layer. A Layer with a larger depth value than another one will be in front of it. |
|
|
Destroy the layer, removing it from the screen first. |
|
|
Return the extent of the layer. |
|
|
Transform a coordinate in the layer's coordinate system to the equivalent coordinate in the screen's virtual coordinate system. |
|
|
Transform a coordinate in the layer's coordinate system to the equivalent coordinate in the window's physical coordinate system. |
| bool Q::Layer::rejectFocus |
( |
|
) |
const |
|
|
|
Return true if the object should not receive input events. |
|
|
Remove a mouse event listener. |
|
|
Remove a keyboard event listener. |
| Screen Q::Layer::screen |
( |
|
) |
const |
|
|
|
Return the screen that owns this layer. |
|
|
Transform a coordinate in the screen's virtual coordinate system to the equivalent coordinate in the layer's coordinate system. |
|
|
Set the alignment of the layer. |
|
|
Set the angle of the layer. |
|
|
Set the center of the layer. |
|
|
Set the depth of the layer. A Layer with a depth of 0 will be rendered first and hence at the back of the screen. |
|
|
Set the extent of the layer. |
|
|
If r is true, then this layer will not receive input events, otherwise it will participate in the screen's focus arbitration policy. |
|
|
Set the visibility of the layer to v. Layers which are not visible are not rendered, allowing an application to efficiently toggle parts of its user-interface on and off. |
| bool Q::Layer::visible |
( |
|
) |
const |
|
|
|
Return true if the layer is visible. |
|
|
Transform a coordinate in the window's physical coordinate system to the equivalent coordinate in the layer's coordinate system. |