Select one of the symbols to view example projects that use it.
 
Outline
#include <new>
#include <gui/common/FrontendApplication.hpp>
#include <mvp/View.hpp>
#include <touchgfx/lcd/LCD.hpp>
#include <touchgfx/hal/HAL.hpp>
#include <touchgfx/transitions/NoTransition.hpp>
#include <gui/common/FrontendHeap.hpp>
#include <gui/main_menu_screen/MainMenuAnimatingButtonsView.hpp>
#include <gui/main_menu_screen/MainMenuPresenter.hpp>
#include <gui/product_presenter_screen/ProductPresenterView.hpp>
#include <gui/product_presenter_screen/ProductPresenterPresenter.hpp>
#include <gui/game2D_screen/Game2DView.hpp>
#include <gui/game2D_screen/Game2DPresenter.hpp>
#include <gui/custom_controls_screen/CustomControlsView.hpp>
#include <gui/custom_controls_screen/CustomControlsPresenter.hpp>
#include <gui/graph_screen/GraphView.hpp>
#include <gui/graph_screen/GraphPresenter.hpp>
#include <stdlib.h>
FrontendApplication::FrontendApplication(Model &, FrontendHeap &)
FrontendApplication::handleTickEvent()
FrontendApplication::handleClickEvent(const ClickEvent &)
FrontendApplication::handleDragEvent(const DragEvent &)
FrontendApplication::resetScreenSaver()
FrontendApplication::gotoMainMenuAnimatingButtonsScreen()
FrontendApplication::gotoMainMenuAnimatingButtonsScreenImpl()
FrontendApplication::gotoProductPresenterScreen()
FrontendApplication::gotoProductPresenterScreenImpl()
FrontendApplication::gotoGame2DScreen()
FrontendApplication::gotoGame2DScreenImpl()
FrontendApplication::gotoCustomControlsScreen()
FrontendApplication::gotoCustomControlsScreenImpl()
FrontendApplication::gotoGraphScreen()
FrontendApplication::gotoGraphScreenImpl()
Files
loading...
CodeScopeSTM32 Libraries and SamplesTouchGFXGui/gui/src/common/FrontendApplication.cpp
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/** ****************************************************************************** * This file is part of the TouchGFX 4.10.0 distribution. * * @attention * * Copyright (c) 2018 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** *//* ... */ #include <new> #include <gui/common/FrontendApplication.hpp> #include <mvp/View.hpp> #include <touchgfx/lcd/LCD.hpp> #include <touchgfx/hal/HAL.hpp> #include <touchgfx/transitions/NoTransition.hpp> #include <gui/common/FrontendHeap.hpp> #include <gui/main_menu_screen/MainMenuAnimatingButtonsView.hpp> #include <gui/main_menu_screen/MainMenuPresenter.hpp> #include <gui/product_presenter_screen/ProductPresenterView.hpp> #include <gui/product_presenter_screen/ProductPresenterPresenter.hpp> #include <gui/game2D_screen/Game2DView.hpp> #include <gui/game2D_screen/Game2DPresenter.hpp> #include <gui/custom_controls_screen/CustomControlsView.hpp> #include <gui/custom_controls_screen/CustomControlsPresenter.hpp> #include <gui/graph_screen/GraphView.hpp> #include <gui/graph_screen/GraphPresenter.hpp> #include <stdlib.h> 18 includes FrontendApplication::FrontendApplication(Model& m, FrontendHeap& heap) : MVPApplication(), transitionCallback(), frontendHeap(heap), model(m), tickCounter(0), screenSaverTick(0), lastClickTime(0) { }{ ... } void FrontendApplication::handleTickEvent() { model.tick(); MVPApplication::handleTickEvent(); tickCounter++; // Screen saver functionality: if (lastClickTime.hasValue() && (model.getCurrentTime() - lastClickTime) >= SCREEN_SAVER_TIMEOUT) { screenSaverTick++; if (screenSaverTick % MINOR_TICK_FREQ == 0) { model.screenSaverMinorTick(); }if (screenSaverTick % MINOR_TICK_FREQ == 0) { ... } else if (screenSaverTick % MAJOR_TICK_FREQ == 0) { model.screenSaverMajorTick(); }else if (screenSaverTick % MAJOR_TICK_FREQ == 0) { ... } }if (lastClickTime.hasValue() && (model.getCurrentTime() - lastClickTime) >= SCREEN_SAVER_TIMEOUT) { ... } }{ ... } void FrontendApplication::handleClickEvent(const ClickEvent& evt) { MVPApplication::handleClickEvent(evt); // A click event has been registered so reset last click time resetScreenSaver(); }{ ... } void FrontendApplication::handleDragEvent(const DragEvent& evt) { MVPApplication::handleDragEvent(evt); // A drag event has been registered so reset last click time resetScreenSaver(); }{ ... } void FrontendApplication::resetScreenSaver() { lastClickTime = model.getCurrentTime(); screenSaverTick = 0; }{ ... } void FrontendApplication::gotoMainMenuAnimatingButtonsScreen() { transitionCallback = Callback< FrontendApplication >(this, &FrontendApplication::gotoMainMenuAnimatingButtonsScreenImpl); pendingScreenTransitionCallback = &transitionCallback; }{ ... } void FrontendApplication::gotoMainMenuAnimatingButtonsScreenImpl() { makeTransition< MainMenuAnimatingButtonsView, MainMenuPresenter, NoTransition, Model >(&currentScreen, &currentPresenter, frontendHeap, &currentTransition, &model); }{ ... } void FrontendApplication::gotoProductPresenterScreen() { transitionCallback = Callback< FrontendApplication >(this, &FrontendApplication::gotoProductPresenterScreenImpl); pendingScreenTransitionCallback = &transitionCallback; }{ ... } void FrontendApplication::gotoProductPresenterScreenImpl() { makeTransition< ProductPresenterView, ProductPresenterPresenter, NoTransition, Model >(&currentScreen, &currentPresenter, frontendHeap, &currentTransition, &model); }{ ... } void FrontendApplication::gotoGame2DScreen() { transitionCallback = Callback< FrontendApplication >(this, &FrontendApplication::gotoGame2DScreenImpl); pendingScreenTransitionCallback = &transitionCallback; }{ ... } void FrontendApplication::gotoGame2DScreenImpl() { makeTransition< Game2DView, Game2DPresenter, NoTransition, Model >(&currentScreen, &currentPresenter, frontendHeap, &currentTransition, &model); }{ ... } void FrontendApplication::gotoCustomControlsScreen() { transitionCallback = Callback< FrontendApplication >(this, &FrontendApplication::gotoCustomControlsScreenImpl); pendingScreenTransitionCallback = &transitionCallback; }{ ... } void FrontendApplication::gotoCustomControlsScreenImpl() { makeTransition< CustomControlsView, CustomControlsPresenter, NoTransition, Model >(&currentScreen, &currentPresenter, frontendHeap, &currentTransition, &model); }{ ... } void FrontendApplication::gotoGraphScreen() { transitionCallback = Callback< FrontendApplication >(this, &FrontendApplication::gotoGraphScreenImpl); pendingScreenTransitionCallback = &transitionCallback; }{ ... } void FrontendApplication::gotoGraphScreenImpl() { makeTransition< GraphView, GraphPresenter, NoTransition, Model >(&currentScreen, &currentPresenter, frontendHeap, &currentTransition, &model); }{ ... }