From ea0a2cbf2152cee68faf51efca99be976e94ab6a Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Fri, 15 May 2020 18:52:41 +0300 Subject: Remove windowmanager depends Bug-AGL: SPEC-3447 Signed-off-by: Marius Vlad Change-Id: Ic4091cfb662125522dd9ff373cc57fbff5fa676a --- CMakeLists.txt | 3 +-- config.xml.in | 1 - main.cpp | 43 +++++++++++-------------------------------- 3 files changed, 12 insertions(+), 35 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b8ff97..7b6a2fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,6 @@ pkg_check_modules(JSON REQUIRED json-c) pkg_check_modules(QT5_WIDGETS REQUIRED Qt5Widgets) pkg_check_modules(QT5_NETWORK REQUIRED Qt5Network) pkg_check_modules(LIBQTAPPFW REQUIRED qtappfw-navigation) -pkg_check_modules(QLIBWIN REQUIRED qlibwindowmanager) pkg_check_modules(LIBHS REQUIRED libhomescreen) @@ -38,7 +37,7 @@ qt5_wrap_cpp(yelp_client_SRC MainApp.h InfoPanelLabel.h ClickableLabel.h Keyboar QT5_ADD_RESOURCES(yelp_client_QRC yelp-client.qrc) add_executable( yelp-client main.cpp MainApp.cpp InfoPanel.cpp InfoPanelLabel.cpp Keyboard.cpp yelp-client.qrc ${yelp_client_SRC} ${yelp_client_QRC}) #target_link_libraries( yelp-client binderclient ) -target_link_libraries( yelp-client ${LIBQTAPPFW_LIBRARIES} ${JSON_LIBRARIES} ${QLIBWIN_LIBRARIES} ${LIBHS_LIBRARIES} ) +target_link_libraries( yelp-client ${LIBQTAPPFW_LIBRARIES} ${JSON_LIBRARIES} ${LIBHS_LIBRARIES} ) qt5_use_modules(yelp-client Core Widgets Network) install (TARGETS yelp-client DESTINATION bin) diff --git a/config.xml.in b/config.xml.in index a20cdef..f849970 100644 --- a/config.xml.in +++ b/config.xml.in @@ -7,7 +7,6 @@ AISIN AW - diff --git a/main.cpp b/main.cpp index 8bf8b51..a82198a 100644 --- a/main.cpp +++ b/main.cpp @@ -4,28 +4,15 @@ #include #include -#include - #include #define DEFAULT_CREDENTIALS_FILE "/etc/poikey" using namespace std; -static QLibWindowmanager* qwm; -static LibHomeScreen* hs; static QString graphic_role; static MainApp *mainapp; - -static void SyncDrawHandler(json_object *object) -{ - qwm->endDraw(graphic_role); -} - -static void ShowWindowHandler(json_object *object) -{ - qwm->activateWindow(graphic_role); -} +static LibHomeScreen* hs; // Callback to drive raising navigation app static void NavWindowRaiseHandler(void) @@ -35,14 +22,20 @@ static void NavWindowRaiseHandler(void) } } +static void ShowWindowHandler(json_object *object) +{ + +} + int main(int argc, char *argv[], char *env[]) { int opt; QApplication a(argc, argv); QString credentialsFile(DEFAULT_CREDENTIALS_FILE); - qwm = new QLibWindowmanager(); + hs = new LibHomeScreen(); graphic_role = QString("poi"); + a.setDesktopFileName(graphic_role); QString pt = QString(argv[1]); int port = pt.toInt(); @@ -58,23 +51,8 @@ int main(int argc, char *argv[], char *env[]) query.addQueryItem(QStringLiteral("token"), secret); bindingAddress.setQuery(query); - if (qwm->init(port, secret) != 0) { - exit(EXIT_FAILURE); - } - - if (qwm->requestSurface(graphic_role) != 0) { - cerr << "Error: wm check failed" << endl; - exit(EXIT_FAILURE); - } - - qwm->set_event_handler(QLibWindowmanager::Event_SyncDraw, SyncDrawHandler); - mainapp = new MainApp(new Navigation(bindingAddress)); - hs->init(port, token.c_str()); - - hs->set_event_handler(LibHomeScreen::Event_ShowWindow, ShowWindowHandler); - // force setting mainapp->setInfoScreen(true); mainapp->setKeyboard(true); @@ -82,6 +60,9 @@ int main(int argc, char *argv[], char *env[]) // hook up callback to start/raise navigation app mainapp->setNavWindowRaiseCallback(NavWindowRaiseHandler); + hs->init(port, token.c_str()); + hs->set_event_handler(LibHomeScreen::Event_ShowWindow, ShowWindowHandler); + /* then, authenticate connexion to POI service: */ if (mainapp->AuthenticatePOI(credentialsFile) < 0) { @@ -95,8 +76,6 @@ int main(int argc, char *argv[], char *env[]) if (mainapp->StartMonitoringUserInput() < 0) return -1; - qwm->activateWindow(graphic_role); - /* main loop: */ return a.exec(); } -- cgit 1.2.3-korg