aboutsummaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp27
1 files changed, 19 insertions, 8 deletions
diff --git a/main.cpp b/main.cpp
index 2f360f3..8bf8b51 100644
--- a/main.cpp
+++ b/main.cpp
@@ -12,21 +12,29 @@
using namespace std;
-QLibWindowmanager* qwm;
-LibHomeScreen* hs;
-QString graphic_role;
-MainApp *mainapp;
+static QLibWindowmanager* qwm;
+static LibHomeScreen* hs;
+static QString graphic_role;
+static MainApp *mainapp;
-void SyncDrawHandler(json_object *object)
+static void SyncDrawHandler(json_object *object)
{
qwm->endDraw(graphic_role);
}
-void TapShortcutHandler(json_object *object)
+static void ShowWindowHandler(json_object *object)
{
qwm->activateWindow(graphic_role);
}
+// Callback to drive raising navigation app
+static void NavWindowRaiseHandler(void)
+{
+ if (hs) {
+ hs->showWindow("navigation", nullptr);
+ }
+}
+
int main(int argc, char *argv[], char *env[])
{
int opt;
@@ -65,12 +73,15 @@ int main(int argc, char *argv[], char *env[])
hs->init(port, token.c_str());
- hs->set_event_handler(LibHomeScreen::Event_TapShortcut, TapShortcutHandler);
+ hs->set_event_handler(LibHomeScreen::Event_ShowWindow, ShowWindowHandler);
- //force setting
+ // force setting
mainapp->setInfoScreen(true);
mainapp->setKeyboard(true);
+ // hook up callback to start/raise navigation app
+ mainapp->setNavWindowRaiseCallback(NavWindowRaiseHandler);
+
/* then, authenticate connexion to POI service: */
if (mainapp->AuthenticatePOI(credentialsFile) < 0)
{