touchgfx::JSMOCHelper is only used within TouchGFX.
 
Symbols
loading...
Files
loading...

touchgfx::JSMOCHelper class

@class JSMOCHelper JSMOCHelper.hpp touchgfx/JSMOCHelper.hpp Helper class providing caching of certain information while the JSMOC algorithm runs during draw operations. Helper class providing caching of certain information while the JSMOC algorithm runs during draw operations. Not intented for application-level use.

Syntax

class JSMOCHelper { public:     JSMOCHelper()     {     }     void setWidget(Drawable* newWidget)     {         widget = newWidget;         cachedVisibleRect.x = CACHED_INDICATOR;         cachedAbsX = CACHED_INDICATOR;         cachedAbsY = CACHED_INDICATOR;     }     Drawable* getWidget()     {         return widget;     }     Rect& getCachedVisibleRect()     {         assert(widget != 0);         if (!hasCachedVisibleRect())         {             Rect visibleRect(0, 0, widget->getWidth(), widget->getHeight());             widget->getVisibleRect(visibleRect);             cachedVisibleRect = visibleRect;         }         return cachedVisibleRect;     }     int16_t getCachedAbsX()     {         if (!hasCachedAbsX())         {             Rect absRect = widget->getAbsoluteRect();             cachedAbsX = absRect.x;             cachedAbsY = absRect.y;         }         return cachedAbsX;     }     int16_t getCachedAbsY()     {         if (!hasCachedAbsY())         {             Rect absRect = widget->getAbsoluteRect();             cachedAbsX = absRect.x;             cachedAbsY = absRect.y;         }         return cachedAbsY;     }     int16_t getWidth()     {         return widget->getWidth();     }     int16_t getHeight()     {         return widget->getHeight();     }     void draw(const Rect& invalidatedArea)     {         widget->draw(invalidatedArea);     } private:     static const int16_t CACHED_INDICATOR = -1;     Drawable* widget;     Rect cachedVisibleRect;     bool hasCachedVisibleRect()     {         return cachedVisibleRect.x != CACHED_INDICATOR;     }     int16_t cachedAbsX;     int16_t cachedAbsY;     bool hasCachedAbsX()     {         return cachedAbsX != CACHED_INDICATOR;     }     bool hasCachedAbsY()     {         return cachedAbsY != CACHED_INDICATOR;     } };

Fields

CACHED_INDICATOR

No summary provided. Read more...

widget

No summary provided. Read more...

cachedVisibleRect

No summary provided. Read more...

cachedAbsX

No summary provided. Read more...

cachedAbsY

No summary provided. Read more...

Methods

setWidget()

@fn void JSMOCHelper::setWidget(Drawable* newWidget) Sets a widget. Sets a widget. Read more...

getWidget()

@fn Drawable* JSMOCHelper::getWidget() Gets the widget. Gets the widget. Read more...

getCachedVisibleRect()

@fn Rect& JSMOCHelper::getCachedVisibleRect() Gets the visible rect for the widget of this helper. Gets the visible rect for the widget of this helper. Read more...

getCachedAbsX()

@fn int16_t JSMOCHelper::getCachedAbsX() Gets the absolute x coordinate for the widget of this helper. Gets the absolute x coordinate for the widget of this helper. Read more...

getCachedAbsY()

@fn int16_t JSMOCHelper::getCachedAbsY() Gets the absolute y coordinate for the widget of this helper. Gets the absolute y coordinate for the widget of this helper. Read more...

getWidth()

@fn int16_t JSMOCHelper::getWidth() Gets the width of the widget of this helper. Gets the width of the widget of this helper. Read more...

getHeight()

@fn int16_t JSMOCHelper::getHeight() Gets the height of the widget of this helper. Gets the height of the widget of this helper. Read more...

draw()

@fn void JSMOCHelper::draw(const Rect& invalidatedArea) Draws the widget of this helper. Draws the widget of this helper. Read more...

hasCachedVisibleRect()

No summary provided. Read more...

hasCachedAbsX()

No summary provided. Read more...

hasCachedAbsY()

No summary provided. Read more...

References

LocationText
JSMOCHelper.hpp:32
class JSMOCHelper