MVPApplication
A specialization of the TouchGFX Application class that provides the necessary glue for transitioning between presenter/view pairs. It maintains a callback for transitioning and evaluates this at each tick.
See: Application
Inherits from: Application, UIEventListener
Public Functions
| virtual void | handlePendingScreenTransition() |
| Handles the pending screen transition. | |
| MVPApplication() | |
| Initializes a new instance of the MVPApplication class. | |
Protected Functions
| void | evaluatePendingScreenTransition() |
| Evaluates the pending Callback instances. | |
Protected Attributes
| Presenter * | currentPresenter |
| Pointer to the currently active presenter. | |
| GenericCallback * | pendingScreenTransitionCallback |
| Callback for screen transitions. Will be set to something valid when a transition request is made. | |
Additional inherited members
Protected Types inherited from Application
| typedef Vector< Rect, 8 > | RectVector_t |
| Type to ensure the same number of rects are in the Vector. | |
Public Functions inherited from Application
| Screen * | getCurrentScreen() |
| Gets the current screen. | |
| DebugPrinter * | getDebugPrinter() |
| Returns the DebugPrinter object associated with the application. | |
| Application * | getInstance() |
| Gets the single instance application. | |
| void | invalidateDebugRegion() |
| Sets the debug string to be displayed onscreen on top of the framebuffer. | |
| void | setDebugPrinter(DebugPrinter * printer) |
| Sets the DebugPrinter object to be used by the application to print debug messages. | |
| void | setDebugString(const char * string) |
| Sets the debug string to be displayed onscreen on top of the framebuffer. | |
| virtual void | appSwitchScreen(uint8_t screenId) |
| An application specific function for switching screen. | |
| virtual void | changeToStartScreen() |
| This function can be called to send your application back to the start screen. | |
| void | clearAllTimerWidgets() |
| Clears all currently registered timer widgets. | |
| virtual void | clearCachedAreas() |
| Clears the cached areas so coming calls to invalidate are collected for future drawing. | |
| void | copyInvalidatedAreasFromTFTToClientBuffer() |
| This function copies the parts that were updated in the previous frame (in the TFT buffer) to the active framebuffer (client buffer). | |
| virtual void | drawCachedAreas() |
| Draws all cached, invalidated areas on the screen. | |
| uint16_t | getNumberOfRegisteredTimerWidgets() const |
| gets the number of timer widgets that has been registered. | |
| uint16_t | getTimerWidgetCountForDrawable(const Drawable * w) const |
| Gets the number of timer events registered to a widget, i.e. | |
| virtual void | handleClickEvent(const ClickEvent & event) |
| Handle a click event. | |
| virtual void | handleDragEvent(const DragEvent & event) |
| Handle drag events. | |
| virtual void | handleGestureEvent(const GestureEvent & event) |
| Handle gestures. | |
| virtual void | handleKeyEvent(uint8_t c) |
| Handle an incoming character received by the HAL layer. | |
| virtual void | handleTickEvent() |
| Handle tick. | |
| void | invalidate() |
| Invalidates the entire screen. | |
| void | invalidateArea(Rect area) |
| Invalidates the given area. | |
| void | registerTimerWidget(Drawable * w) |
| Adds a widget to the list of widgets receiving ticks every frame (typically 16.67ms) | |
| virtual void | requestRedraw() |
| An application specific function for requesting redraw of entire screen. | |
| virtual void | requestRedraw(Rect & rect) |
| An application specific function for requesting redraw of given Rect. | |
| virtual void | switchScreen(Screen * newScreen) |
| Switch to another Screen. | |
| void | unregisterTimerWidget(const Drawable * w) |
| Removes a widget from the list of widgets receiving ticks every frame (typically 16.67ms) milliseconds. | |
Protected Functions inherited from Application
| Application() | |
| Protected constructor. | |
| virtual void | draw() |
| Initiate a draw operation of the entire screen. | |
| virtual void | draw(Rect & rect) |
| Initiate a draw operation of the specified region of the screen. | |
Public Attributes inherited from Application
| const uint8_t | MAX_TIMER_WIDGETS |
| Maximum number of widgets receiving ticks. | |
| const uint16_t | TICK_INTERVAL_MS |
| Deprecated, do not use this constant. Tick interval depends on VSYNC of your target platform. | |
Protected Attributes inherited from Application
| RectVector_t | cachedDirtyAreas |
| When draw caching is enabled, these rects keeps track of the dirty screen area. | |
| RectVector_t | lastRects |
| The dirty areas from last frame that needs to be redrawn because we have swapped frame buffers. | |
| Rect | redraw |
| Rect describing application requested invalidate area. | |
| uint8_t | timerWidgetCounter |
| A counter for each potentially registered timer widget. Increase when registering for timer events, decrease when unregistering. | |
| Vector< Drawable *, MAX_TIMER_WIDGETS > | timerWidgets |
| List of widgets that receive timer ticks. | |
| bool | transitionHandled |
| True if the transition is done and Screen::afterTransition has been called. | |
| Screen * | currentScreen |
| Pointer to currently displayed Screen. | |
| Transition * | currentTransition |
| Pointer to current transition. | |
| DebugPrinter * | debugPrinter |
| Pointer to the DebugPrinter instance. | |
| Rect | debugRegionInvalidRect |
| Invalidated Debug Region. | |
| Application * | instance |
| Pointer to the instance of the Application-derived subclass. | |
Public Functions inherited from UIEventListener
| virtual void | handleClickEvent(const ClickEvent & event) |
| This handler is invoked when a mouse click or display touch event has been detected by the system. | |
| virtual void | handleDragEvent(const DragEvent & event) |
| This handler is invoked when a drag event has been detected by the system. | |
| virtual void | handleGestureEvent(const GestureEvent & event) |
| This handler is invoked when a gesture event has been detected by the system. | |
| virtual void | handleKeyEvent(uint8_t c) |
| This handler is invoked when a key (or button) event has been detected by the system. | |
| virtual void | handleTickEvent() |
| This handler is invoked when a system tick event has been generated. | |
| virtual | ~UIEventListener() |
| Finalizes an instance of the UIEventListener class. | |
Public Functions Documentation
handlePendingScreenTransition
| virtual void handlePendingScreenTransition | ( | ) |
Handles the pending screen transition.
Delegates the work to evaluatePendingScreenTransition()
Reimplements: touchgfx::Application::handlePendingScreenTransition
MVPApplication
Initializes a new instance of the MVPApplication class.
Protected Functions Documentation
evaluatePendingScreenTransition
Protected Attributes Documentation
currentPresenter
Presenter * currentPresenter
Pointer to the currently active presenter.
pendingScreenTransitionCallback
GenericCallback * pendingScreenTransitionCallback
Callback for screen transitions. Will be set to something valid when a transition request is made.