Rose
|
The properties common to all visual objects on the screen. More...
#include <Visual.h>
Public Types | |
using | ValueMap = std::map< int, int > |
The std::map type for each hint class. | |
Public Member Functions | |
void | setScreenRectangle (const Position< int > &containerPosition) |
Compute the screen rectangle from the Container screen Position. More... | |
Rectangle | getScreenRectangle (const Position< int > &containerPosition) const |
Get the rectangle occupied by the Visual. More... | |
virtual void | draw (gm::Context &context, const Position< int > &containerPosition)=0 |
Draw the visual. | |
virtual Rectangle | layout (rose::gm::Context &context, const Rectangle &screenRect)=0 |
Layout the visual. | |
Position< int > | drawPadding (const Position< int > &containerPosition) |
Pad the drawing location. | |
Rectangle | layoutPadding (const Rectangle &screenRect) |
Pad the layout. | |
void | setSize (const Size &size) |
Set preferred Size. | |
Size | getSize () const |
Get the preferred size. | |
void | setPosition (const Position< int > &position) |
Set preferred Position. | |
Position< int > | getPosition () const |
Get the preferred Position. | |
void | setPadding (const Padding &padding) |
Set Padding. | |
void | setScreenRectangle (const Rectangle &screenRect) |
Set Screen Rectangle. | |
constexpr bool | isVisible () const noexcept |
Check visibility. | |
void | setVisible (bool visible) noexcept |
Set visibility. | |
void | setLayoutHint (const LayoutHint &hint) |
Add a LayoutHint. | |
std::optional< int > | getAttachmentHint (LayoutHint::Attachment attachment) |
Get an AttachmentHint value given a LayoutHint::Attachment. More... | |
std::optional< int > | getGridHint (LayoutHint::GridLayoutHint gridLayoutHint) |
Get a GridLayoutHint value given a LayoutHint::GridLayoutHint. More... | |
template<size_t HintClass> | |
std::optional< const ValueMap > | getHintMap () const |
SemanticGesture | supportedSemanticGestures () const |
Get supported SemanticGestures. | |
Public Attributes | |
std::map< size_t, ValueMap > | mHintsMap {} |
The std::map of hint class to ValueMap. | |
Protected Attributes | |
SemanticGesture | mSemanticGesture {} |
Position< int > | mPos {} |
Position relative to the container, arrived at by layout. | |
Size | mSize {} |
The size on screen, arrived at by layout. | |
Position< int > | mPreferredPos {} |
The preferred position. | |
Size | mPreferredSize {} |
The preferred size. | |
Rectangle | mScreenRect {} |
The screen Rectangle computed at drawing time. | |
Padding | mPadding {} |
Immediately around the Visual, used for separation and alignment. | |
State | mState {} |
The object state Id string. | |
bool | mVisible {true} |
If true the object is visible. | |
Friends | |
class | LayoutManager |
The properties common to all visual objects on the screen.
Preferred values may be set by the user application or specific widgets prior to layout. They may or may not be honoured.
|
inline |
Get an AttachmentHint value given a LayoutHint::Attachment.
attachment | A value from LayoutHint::Attachment. |
|
inline |
Get a GridLayoutHint value given a LayoutHint::GridLayoutHint.
attachment | A value from LayoutHint::GridLayoutHint. |
|
inline |