Rose
Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
rose::Window Class Reference

A Window is a visual abstraction of a number of related user interface objects. More...

#include <Visual.h>

Inheritance diagram for rose::Window:
Inheritance graph
[legend]
Collaboration diagram for rose::Window:
Collaboration graph
[legend]

Public Member Functions

std::string_view nodeId () const noexcept override
 
bool isModal () const
 
void add (const std::shared_ptr< Node > &node) override
 Add a Manager to the Window. More...
 
void draw (gm::Context &context, const Position< int > &containerPosition) override
 Draw the contents of the Window.
 
bool baseTextureNeeded (const Position< int > &containerPosition)
 
void generateBaseTexture (gm::Context &context, const Position< int > &containerPosition)
 Create a Texture for the Window that can be drawn over by animations. More...
 
void drawBaseTexture (gm::Context &context, const Position< int > &containerPosition)
 Draw the base texture for the window. More...
 
Rectangle layout (gm::Context &context, const Rectangle &screenRect) override
 Layout the contents of the Window.
 
std::shared_ptr< WidgetpointerWidget (const Position< int > &position)
 The the Widget which contains the Position.
 
std::shared_ptr< ScreengetScreen ()
 Get the Screen which supports the Window.
 
std::shared_ptr< ScreengetScreen () const
 Get the Screen which support the const Window.
 
- Public Member Functions inherited from rose::Visual
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...
 
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 ValueMapgetHintMap () const
 
SemanticGesture supportedSemanticGestures () const
 Get supported SemanticGestures.
 
- Public Member Functions inherited from rose::Container
void remove (const std::shared_ptr< Node > &node)
 
- Public Member Functions inherited from rose::Node
 Node (const std::shared_ptr< Container > &container)
 Create a node and add it to a Container. More...
 
void setId (const Id &nodeId) noexcept
 Set Id.
 
std::string_view getId () const
 Get Id.
 
IdPath getIdPath () const
 Get the Id Path.
 
virtual void addedToContainer ()
 Called when a Node is added to a Container. More...
 
std::shared_ptr< Containercontainer ()
 
std::shared_ptr< Containercontainer () const
 
template<typename C >
std::shared_ptr< C > containerAs ()
 
template<typename C >
std::shared_ptr< C > containerAs () const
 
std::shared_ptr< const NodegetNode () const
 Get a const std::shared_ptr to this node. More...
 
std::shared_ptr< NodegetNode ()
 Get a std::shared_ptr to this node. More...
 
template<typename NodeType >
std::shared_ptr< const NodegetNode () const
 Get a std::shared_ptr<const NodeType> to this node. More...
 
template<typename NodeType >
std::shared_ptr< NodeType > getNode ()
 Get a std::shared_ptr<NodeType> to this node. More...
 
std::shared_ptr< Noderemove ()
 

Static Public Attributes

static constexpr std::string_view id = "Window"
 
- Static Public Attributes inherited from rose::Container
static constexpr std::string_view id = "Container"
 
- Static Public Attributes inherited from rose::Node
static constexpr std::string_view id = "Node"
 

Protected Attributes

bool mModalWindow {}
 
gm::Texture mBaseTexture {}
 The base texture which animations draw over.
 
- Protected Attributes inherited from rose::Visual
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.
 
- Protected Attributes inherited from rose::Node
std::weak_ptr< ContainermContainer {}
 The Container that holds the Node. More...
 
Id mId {}
 

Additional Inherited Members

- Public Types inherited from rose::Visual
using ValueMap = std::map< int, int >
 The std::map type for each hint class.
 
- Public Types inherited from rose::Node
using NodePtr = std::shared_ptr< Node >
 
- Static Public Member Functions inherited from rose::Node
template<typename NodeType >
static std::shared_ptr< NodeType > create ()
 Create a Node with no arguments. More...
 
template<typename NodeType , typename ... Args>
static std::shared_ptr< NodeType > create (Args ... args)
 Create a Node with arguments. More...
 
template<typename NodeType , typename ContainerType , typename ... Args>
static std::shared_ptr< NodeType > add (ContainerType container, Args ... args)
 Create a Node with arguments and add to a Container. More...
 
- Public Attributes inherited from rose::Visual
std::map< size_t, ValueMapmHintsMap {}
 The std::map of hint class to ValueMap.
 

Detailed Description

A Window is a visual abstraction of a number of related user interface objects.

Member Function Documentation

◆ add()

void rose::Window::add ( const std::shared_ptr< Node > &  node)
inlineoverridevirtual

Add a Manager to the Window.

Normally only one manager is required for a window, but more than one could be used.

Parameters
nodeThe manager.

Reimplemented from rose::Container.

◆ drawBaseTexture()

void rose::Window::drawBaseTexture ( gm::Context context,
const Position< int > &  containerPosition 
)

Draw the base texture for the window.

Parameters
contextThe gm::Context to use.
containerPositionThe container position.

◆ generateBaseTexture()

void rose::Window::generateBaseTexture ( gm::Context context,
const Position< int > &  containerPosition 
)

Create a Texture for the Window that can be drawn over by animations.

Parameters
contextThe gm::Context to use.
containerPositionThe container position.

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