TouchGFX + 0/4 examples
CodeScope will show references to touchgfx::Drawable from the following samples and libraries:
Examples
STM32469I-Discovery
Demonstrations
STM32469I_EVAL
Demonstrations
STM324x9I_EVAL
Demonstrations
STM32F429I-Discovery
Demonstrations
 
Symbols
loading...
Files
loading...

touchgfx::Drawable class

@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

Syntax

class Drawable;
Implemented in Drawable.hpp:49

Fields

rect

No summary provided. Read more...

cachedVisibleRect

No summary provided. Read more...

parent

No summary provided. Read more...

nextSibling

No summary provided. Read more...

nextDrawChainElement

No summary provided. Read more...

cachedAbsX

No summary provided. Read more...

cachedAbsY

No summary provided. Read more...

touchable

No summary provided. Read more...

visible

No summary provided. Read more...

UNCACHED_INDICATOR

No summary provided. Read more...

Methods

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...

Examples

touchgfx::Drawable is referenced by 4 libraries and example projects.

References

LocationReferrerScopeText
Drawable.hpp:49
class Drawable
Application.hpp:28
class Drawable;
Screen.hpp:29
class Drawable;
Application.hpp:230touchgfx::Application::registerTimerWidget()::wtouchgfx::Application::registerTimerWidget()
void registerTimerWidget(Drawable* w);
Application.hpp:254touchgfx::Application::unregisterTimerWidget()::wtouchgfx::Application::unregisterTimerWidget()
void unregisterTimerWidget(const Drawable* w);
Application.hpp:280touchgfx::Application::getTimerWidgetCountForDrawable() const::wtouchgfx::Application::getTimerWidgetCountForDrawable() const
uint16_t getTimerWidgetCountForDrawable(Drawable* w) const;
Application.hpp:307
Vector<Drawable*, MAX_TIMER_WIDGETS> timerWidgets; ///< List of widgets that receive timer ticks.
Container.hpp:41touchgfx::Containertouchgfx
class Container : public Drawable
Container.hpp:52touchgfx::Container::Container()
Container() : Drawable(),
Container.hpp:77touchgfx::Container::add()::dtouchgfx::Container::add()
virtual void add(Drawable& d);
Container.hpp:90touchgfx::Container::remove()::dtouchgfx::Container::remove()
virtual void remove(Drawable& d);
Container.hpp:123touchgfx::Container::contains()::dtouchgfx::Container::contains()
virtual bool contains(const Drawable& d);
Container.hpp:138touchgfx::Container::insert()::previoustouchgfx::Container::insert()
virtual void insert(Drawable* previous, Drawable& d);
Container.hpp:154touchgfx::Container::getLastChild()::lasttouchgfx::Container::getLastChild()
virtual void getLastChild(int16_t x, int16_t y, Drawable** last);
Container.hpp:217touchgfx::Container::getFirstChild()touchgfx::Container
Drawable* getFirstChild()
Container.hpp:247touchgfx::Container::firstChildtouchgfx::Container
Drawable* firstChild; ///< Pointer to the first child of this container. Subsequent children can be found through firstChild->nextSibling.
Container.hpp:250touchgfx::Container::setupDrawChain()::nextPreviousElementtouchgfx::Container::setupDrawChain()
virtual void setupDrawChain(const Rect& invalidatedArea, Drawable** nextPreviousElement);
Drawable.hpp:145touchgfx::Drawable::getNextSibling()touchgfx::Drawable
Drawable* getNextSibling()
Drawable.hpp:179touchgfx::Drawable::getLastChild()::lasttouchgfx::Drawable::getLastChild()
virtual void getLastChild(int16_t x, int16_t y, Drawable** last) = 0;
Drawable.hpp:530touchgfx::Drawable::getParent()touchgfx::Drawable
Drawable* getParent()
Drawable.hpp:632touchgfx::Drawable::parenttouchgfx::Drawable
Drawable* parent; ///< Pointer to this drawable's parent.
Drawable.hpp:633touchgfx::Drawable::nextSiblingtouchgfx::Drawable
Drawable* nextSibling; ///< Pointer to the next drawable. Maintained by containers.
Drawable.hpp:634touchgfx::Drawable::nextDrawChainElementtouchgfx::Drawable
Drawable* nextDrawChainElement; ///< Next in draw chain. For TouchGFX internal use.
Drawable.hpp:737touchgfx::Drawable::setupDrawChain()
virtual void setupDrawChain(const Rect& invalidatedArea, Drawable** nextPreviousElement)
JSMOCHelper.hpp:55touchgfx::JSMOCHelper::setWidget()
void setWidget(Drawable* newWidget)
JSMOCHelper.hpp:74touchgfx::JSMOCHelper::getWidget()touchgfx::JSMOCHelper
Drawable* getWidget()
JSMOCHelper.hpp:186touchgfx::JSMOCHelper::widgettouchgfx::JSMOCHelper
Drawable* widget;
ListLayout.hpp:107touchgfx::ListLayout::add()::dtouchgfx::ListLayout::add()
virtual void add(Drawable& d);
ListLayout.hpp:118touchgfx::ListLayout::remove()::dtouchgfx::ListLayout::remove()
virtual void remove(Drawable& d);
ListLayout.hpp:130touchgfx::ListLayout::insert()::previousElementtouchgfx::ListLayout::insert()
virtual void insert(Drawable* previousElement, Drawable& d);
ListLayout.hpp:157touchgfx::ListLayout::internalAddElementAt()::dtouchgfx::ListLayout::internalAddElementAt()
void internalAddElementAt(Drawable& d, int16_t coord);
ListLayout.hpp:158touchgfx::ListLayout::internalAddElement()::dtouchgfx::ListLayout::internalAddElement()
void internalAddElement(Drawable& d);
ListLayout.hpp:159touchgfx::ListLayout::internalRemoveElement()::dtouchgfx::ListLayout::internalRemoveElement()
void internalRemoveElement(Drawable& d, int16_t coord);
Screen.hpp:100touchgfx::Screen::JSMOC()::widgetToDrawtouchgfx::Screen::JSMOC()
void JSMOC(const Rect& invalidatedArea, Drawable* widgetToDraw);
Screen.hpp:280touchgfx::Screen::add()
void add(Drawable& d)
Screen.hpp:295touchgfx::Screen::remove()
void remove(Drawable& d)
Screen.hpp:303touchgfx::Screen::focustouchgfx::Screen
Drawable* focus; ///< The drawable currently in focus (set when DOWN_PRESSED is received).
ScrollableContainer.hpp:149touchgfx::ScrollableContainer::add()::dtouchgfx::ScrollableContainer::add()
virtual void add(Drawable& d);
ScrollableContainer.hpp:166touchgfx::ScrollableContainer::getLastChild()
virtual void getLastChild(int16_t x, int16_t y, Drawable** last)
ScrollableContainer.hpp:481touchgfx::ScrollableContainer::pressedDrawabletouchgfx::ScrollableContainer
Drawable* pressedDrawable; ///< The drawable child of this container which received the last ClickEvent::PRESSED notification. When scrolling, send this drawable a CANCEL event if the new x/y coords no longer matches this drawable.
ScrollableContainer.hpp:482touchgfx::ScrollableContainer::lastDraggableChildtouchgfx::ScrollableContainer
Drawable* lastDraggableChild; ///< The drawable child of this container which should receive drag events. Note that only drag events in directions which cannot be scrolled by this ScrollableContainer will be forwarded to children.
SlideTransition.hpp:222touchgfx::SlideTransition::initMoveDrawable()::dtouchgfx::SlideTransition::initMoveDrawable()
virtual void initMoveDrawable(Drawable& d)
SlideTransition.hpp:253touchgfx::SlideTransition::tickMoveDrawable()::dtouchgfx::SlideTransition::tickMoveDrawable()
virtual void tickMoveDrawable(Drawable& d)
Widget.hpp:34touchgfx::Widgettouchgfx
class Widget : public Drawable
Widget.hpp:44touchgfx::Widget::Widget()
Widget() : Drawable() { }
Widget.hpp:74touchgfx::Widget::getLastChild()
virtual void getLastChild(int16_t x, int16_t y, Drawable** last)

Class Tree

Parent classes
touchgfx::Drawable
Variables of touchgfx::Drawable type
all items filtered out
touchgfx::Drawable