@class Drawable Drawable.hpp touchgfx/Drawable.hpp The Drawable class is an abstract definition of something that can be drawn. The Drawable class is an abstract definition of something that can be drawn. In the composite design pattern, the Drawable is the component interface. Drawables can be added to a screen as a tree structure through the leaf node class Widget and the Container class. A Drawable contains a pointer to its next sibling and a pointer to its parent node. These are maintained by the Container to which the Drawable is added. The Drawable interface contains two pure virtual functions which must be implemented by widgets, namely draw() and getSolidRect(). In addition it contains general functionality for receiving events and navigating the tree structure. The coordinates of a Drawable are always relative to its parent node. @see Widget @see Container
getType() const
@fn virtual uint16_t Drawable::getType() const For GUI testing only. For GUI testing only. Call this virtual function to determine the class type of this Drawable object. Can be used in automated GUI testing. Otherwise this function is unused.
Read more...
resetDrawChainCache()
@fn void Drawable::resetDrawChainCache() For TouchGFX internal use only. Reset cached coordinate data.
Read more...
getCachedVisibleRect()
@fn Rect& Drawable::getCachedVisibleRect() For TouchGFX internal use only. Obtain cached version of visible rect.
Read more...
getCachedAbsX()
@fn int16_t Drawable::getCachedAbsX() For TouchGFX internal use only. Obtain cached version of absolute X-coord.
Read more...
getLastChild()
@fn virtual void Drawable::getLastChild(int16_t x, int16_t y, Drawable** last) = 0; Function for obtaining the the last child of this drawable that intersects with the specified point. Function for obtaining the the last child of this drawable that intersects with the specified point. Used in input event handling for obtaining the appropriate drawable that should receive the event. Note that input events must be delegated to the last drawable of the tree (meaning highest z-order / front-most drawable).
Read more...
getVisibleRect() const
@fn virtual void Drawable::getVisibleRect(Rect& rect) const; JSMOC Function for obtaining the visible part of this drawable. JSMOC Function for obtaining the visible part of this drawable. If the parent node has a smaller area than this Drawable, the parent will act as a viewport, cutting off the parts of this Drawable that are outside the region. Traverses the tree and yields a result expressed in absolute coordinates.
Read more...
getRect() const
@fn const Rect& Drawable::getRect() const Gets the rectangle this Drawable covers. Gets the rectangle this Drawable covers, in coordinates relative to its parent.
Read more...
getAbsoluteRect() const
@fn Rect Drawable::getAbsoluteRect() const; Helper function for obtaining the rectangle this Drawable covers. Helper function for obtaining the rectangle this Drawable covers, expressed in absolute coordinates.
Read more...
translateRectToAbsolute() const
@fn virtual void Drawable::translateRectToAbsolute(Rect& r) const; Helper function for converting a specified subregion of this Drawable to absolute coordinates. Helper function for converting a specified subregion of this Drawable to absolute coordinates.
Read more...
setPosition()
@fn virtual void Drawable::setPosition(int16_t x, int16_t y, int16_t width, int16_t height) Sets the size and position of this Drawable. Sets the size and position of this Drawable, relative to its parent.
Read more...
getX() const
@fn int16_t Drawable::getX() const Gets the x coordinate of this drawable. Gets the x coordinate of this drawable.
Read more...
getY() const
@fn int16_t Drawable::getY() const Gets the y coordinate of this drawable. Gets the y coordinate of this drawable.
Read more...
getWidth() const
@fn int16_t Drawable::getWidth() const Gets the width of this drawable. Gets the width of this drawable.
Read more...
getHeight() const
@fn int16_t Drawable::getHeight() const Gets the height of this drawable. Gets the height of this drawable.
Read more...
setX()
@fn virtual void Drawable::setX(int16_t x) Sets the x coordinate of this drawable. Sets the x coordinate of this drawable.
Read more...
setY()
@fn virtual void Drawable::setY(int16_t y) Sets the y coordinate of this drawable. Sets the y coordinate of this drawable.
Read more...
setXY()
@fn virtual void Drawable::setXY(int16_t x, int16_t y) Sets the x and y coordinates of this drawable. Sets the x and y coordinates of this drawable.
Read more...
setWidth()
@fn virtual void Drawable::setWidth(int16_t width) Sets the width of this drawable. Sets the width of this drawable.
Read more...
setHeight()
@fn virtual void Drawable::setHeight(int16_t height) Sets the height of this drawable. Sets the height of this drawable.
Read more...
childGeometryChanged()
@fn virtual void Drawable::childGeometryChanged() This function can be called on parent nodes to signal that the size of one or more of its children has changed. This function can be called on parent nodes to signal that the size of one or more of its children has changed. Currently only used in ScrollableContainer to redraw scrollbars when the size of the scrolling contents changes.
Read more...
handleClickEvent()
@fn virtual void Drawable::handleClickEvent(const ClickEvent& evt) Defines the event handler interface for ClickEvents. Defines the event handler interface for ClickEvents. The default implementation ignores the event. The event is only received if the drawable is touchable.
Read more...
handleGestureEvent()
@fn virtual void Drawable::handleGestureEvent(const GestureEvent& evt) Defines the event handler interface for GestureEvents. Defines the event handler interface for GestureEvents. The default implementation ignores the event. The event is only received if the drawable is touchable.
Read more...
handleDragEvent()
@fn virtual void Drawable::handleDragEvent(const DragEvent& evt) Defines the event handler interface for DragEvents. Defines the event handler interface for DragEvents. The event is only received if the drawable is touchable.
Read more...
handleTickEvent()
@fn virtual void Drawable::handleTickEvent() Called periodically by the framework if the Drawable instance has subscribed to timer ticks. Called periodically by the framework if the Drawable instance has subscribed to timer ticks. @see Application::registerTimerWidget.
Read more...
setVisible()
@fn void Drawable::setVisible(bool vis) Controls whether this Drawable should be visible. Controls whether this Drawable should be visible. Only visible Drawables will have their draw function called. Additionally, invisible drawables will not receive input events.
Read more...
draw() const
@fn virtual void Drawable::draw(const Rect& invalidatedArea) const = 0; Pure virtual function for drawing this drawable. Pure virtual function for drawing this drawable. It is a requirement that the draw implementation does not draw outside the region specified by invalidatedArea.
Read more...
getSolidRect() const
@fn virtual Rect Drawable::getSolidRect() const = 0; Pure virtual function for obtaining the largest possible rectangle that is guaranteed to be solid (non-transparent). Pure virtual function for obtaining the largest possible rectangle that is guaranteed to be solid (non-transparent). Used by JSMOC to prune the draw graph.
Read more...
invalidateRect() const
@fn virtual void Drawable::invalidateRect(Rect& invalidatedArea) const; Request that a subregion of this drawable is redrawn. Request that a subregion of this drawable is redrawn. Will recursively traverse the tree towards the root, and once reached, issue a draw operation. When this function returns, the specified invalidated area has been redrawn for all appropriate Drawables covering the region.
Read more...
invalidate() const
@fn virtual void Drawable::invalidate() const; Tell the framework that this entire drawable needs to be redrawn. Tell the framework that this entire drawable needs to be redrawn. @see invalidateRect.
Read more...
getNextSibling()
@fn Drawable* Drawable::getNextSibling() Gets the next sibling. Returns the next sibling node. This will be the next Drawable that has been added to the same Container as this Drawable.
Read more...
getSolidRectAbsolute()
@fn virtual Rect Drawable::getSolidRectAbsolute(); Helper function for obtaining the largest solid rect. Helper function for obtaining the largest solid rect (as implemented by getSolidRect()) expressed in absolute coordinates. Will recursively traverse to the root of the tree.
Read more...
getCachedAbsY()
@fn int16_t Drawable::getCachedAbsY() For TouchGFX internal use only. Obtain cached version of absolute Y-coord.
Read more...
setupDrawChain()
@fn virtual void Drawable::setupDrawChain(const Rect& invalidatedArea, Drawable** nextPreviousElement) For TouchGFX internal use only. Configure linked list for draw chain.
Read more...
setTouchable()
@fn void Drawable::setTouchable(bool touch) Controls whether this Drawable receives touch events or not. Controls whether this Drawable receives touch events or not.
Read more...
isVisible() const
@fn bool Drawable::isVisible() const Gets whether this Drawable is visible. Gets whether this Drawable is visible. @see setVisible.
Read more...
isTouchable() const
@fn bool Drawable::isTouchable() const Gets whether this Drawable receives touch events or not. Gets whether this Drawable receives touch events or not. @see setTouchable.
Read more...
getParent()
@fn Drawable* Drawable::getParent() Returns the parent node. Returns the parent node. For the root container, the return value is 0.
Read more...
moveRelative()
@fn virtual void Drawable::moveRelative(int16_t x, int16_t y); Moves the drawable. Moves the drawable.
Read more...
moveTo()
@fn virtual void Drawable::moveTo(int16_t x, int16_t y) Moves the drawable. Moves the drawable.
Read more...