From: Tasuku Suzuki Date: Mon, 21 Nov 2016 05:40:40 +0000 (+0900) Subject: check ivi-layermanagement-api availability X-Git-Tag: v0.6.3~5 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?p=staging%2FHomeScreen.git;a=commitdiff_plain;h=83cfbb9fe4bcc17f6b00c8a25aa3eb8c2c850ac0 check ivi-layermanagement-api availability replace #ifdef __arm__ with a definition that comes from availability test Change-Id: Id9fa4baefcc9f38acd3e98d40054040fc69029c6 Signed-off-by: Tasuku Suzuki --- diff --git a/HomeScreen.pro b/HomeScreen.pro index 2812840..9badcb7 100644 --- a/HomeScreen.pro +++ b/HomeScreen.pro @@ -14,6 +14,9 @@ TEMPLATE = subdirs +load(configure) +qtCompileTest(ivi_layermanagement_api) + SUBDIRS = interfaces \ libhomescreen \ HomeScreen \ diff --git a/HomeScreen/HomeScreen.pro b/HomeScreen/HomeScreen.pro index a9e950e..9951a0f 100644 --- a/HomeScreen/HomeScreen.pro +++ b/HomeScreen/HomeScreen.pro @@ -17,6 +17,7 @@ TARGET = HomeScreen QT = widgets dbus include(../interfaces/interfaces.pri) +include(../ivi_layermanagement_api.pri) SOURCES += \ src/main.cpp \ diff --git a/HomeScreen/src/main.cpp b/HomeScreen/src/main.cpp index 434cf6c..a896c2e 100644 --- a/HomeScreen/src/main.cpp +++ b/HomeScreen/src/main.cpp @@ -45,14 +45,12 @@ int main(int argc, char *argv[]) MainWindow w; w.show(); -#ifdef __arm__ +#ifdef HAVE_IVI_LAYERMANAGEMENT_API // the WindowManager positions the surface correctly -#endif -#ifdef __i386__ +#else w.move(0, 0); #endif - #ifdef __arm__ qDebug("Running on ARM architecture"); #endif diff --git a/HomeScreenAppFrameworkBinderAGL/HomeScreenAppFrameworkBinderAGL.pro b/HomeScreenAppFrameworkBinderAGL/HomeScreenAppFrameworkBinderAGL.pro index f194609..7cc7927 100644 --- a/HomeScreenAppFrameworkBinderAGL/HomeScreenAppFrameworkBinderAGL.pro +++ b/HomeScreenAppFrameworkBinderAGL/HomeScreenAppFrameworkBinderAGL.pro @@ -17,6 +17,7 @@ TARGET = HomeScreenAppFrameworkBinderAGL QT = core dbus include(../interfaces/interfaces.pri) +include(../ivi_layermanagement_api.pri) SOURCES += src/main.cpp \ src/homescreenappframeworkbinderagl.cpp diff --git a/HomeScreenAppFrameworkBinderAGL/src/homescreenappframeworkbinderagl.cpp b/HomeScreenAppFrameworkBinderAGL/src/homescreenappframeworkbinderagl.cpp index 91df6f7..593a882 100644 --- a/HomeScreenAppFrameworkBinderAGL/src/homescreenappframeworkbinderagl.cpp +++ b/HomeScreenAppFrameworkBinderAGL/src/homescreenappframeworkbinderagl.cpp @@ -39,7 +39,7 @@ HomeScreenAppFrameworkBinderAgl::HomeScreenAppFrameworkBinderAgl(QObject *parent QDBusConnection::sessionBus(), 0); -#ifdef __arm__ +#ifdef HAVE_IVI_LAYERMANAGEMENT_API QString runnables = mp_dBusAfmUserProxy->runnables("{\"dummy\": \"entry\"}"); qDebug("runnables: %s", runnables.toStdString().c_str()); @@ -55,8 +55,7 @@ HomeScreenAppFrameworkBinderAgl::HomeScreenAppFrameworkBinderAgl(QObject *parent m_apps.append(appInfo); } -#endif -#ifdef __i386__ +#else // for the simulation /*AppInfo ai; ai.setName("org.test.app1"); @@ -82,7 +81,7 @@ QList HomeScreenAppFrameworkBinderAgl::getAvailableApps() int HomeScreenAppFrameworkBinderAgl::launchApp(const QString &name) { int pid = -1; -#ifdef __arm__ +#ifdef HAVE_IVI_LAYERMANAGEMENT_API qDebug("launchApp name: %s", name.toStdString().c_str()); QString jsonLaunch = "{\"id\":\"" + name + "\", \"mode\":\"local\"}"; qDebug("jsonLaunch %s", jsonLaunch.toStdString().c_str()); @@ -110,8 +109,7 @@ int HomeScreenAppFrameworkBinderAgl::launchApp(const QString &name) } qDebug("launchApp pid: %d", pid); -#endif -#ifdef __i386__ +#else qDebug("launchApp name: %s", name.toStdString().c_str()); pid = qrand(); #endif diff --git a/WindowManager/WindowManager.pro b/WindowManager/WindowManager.pro index 51fc972..6f33e13 100644 --- a/WindowManager/WindowManager.pro +++ b/WindowManager/WindowManager.pro @@ -17,6 +17,7 @@ TARGET = WindowManager QT = core dbus include(../interfaces/interfaces.pri) +include(../ivi_layermanagement_api.pri) SOURCES += src/main.cpp \ src/windowmanager.cpp @@ -24,7 +25,7 @@ SOURCES += src/main.cpp \ HEADERS += \ src/windowmanager.hpp -contains(QT_ARCH, arm.*) { +config_ivi_layermanagement_api { LIBS += -lilmControl -lilmCommon } diff --git a/WindowManager/src/windowmanager.cpp b/WindowManager/src/windowmanager.cpp index 054c43c..047734f 100644 --- a/WindowManager/src/windowmanager.cpp +++ b/WindowManager/src/windowmanager.cpp @@ -60,7 +60,7 @@ void WindowManager::start() { qDebug("-=[start]=-"); mp_layoutAreaToSurfaceIdAssignment = new QMap; -#ifdef __arm__ +#ifdef HAVE_IVI_LAYERMANAGEMENT_API ilmErrorTypes err; err = ilm_init(); @@ -80,7 +80,7 @@ WindowManager::~WindowManager() { qDebug("-=[~WindowManager]=-"); delete mp_windowManagerAdaptor; -#ifdef __arm__ +#ifdef HAVE_IVI_LAYERMANAGEMENT_API ilm_destroy(); #endif delete mp_layoutAreaToSurfaceIdAssignment; @@ -110,7 +110,7 @@ void WindowManager::dumpScene() } } -#ifdef __arm__ +#ifdef HAVE_IVI_LAYERMANAGEMENT_API void WindowManager::createNewLayer(int layerId) { @@ -220,7 +220,7 @@ void WindowManager::updateScreen() { qDebug("-=[updateScreen]=-"); -#ifdef __arm__ +#ifdef HAVE_IVI_LAYERMANAGEMENT_API if (-1 != m_currentLayout) { @@ -283,7 +283,7 @@ void WindowManager::updateScreen() #endif } -#ifdef __arm__ +#ifdef HAVE_IVI_LAYERMANAGEMENT_API void WindowManager::notificationFunc_non_static(ilmObjectType object, t_ilm_uint id, t_ilm_bool created) @@ -483,7 +483,7 @@ QList WindowManager::getAllLayouts() QList WindowManager::getAllSurfacesOfProcess(int pid) { QList result; -#ifdef __arm__ +#ifdef HAVE_IVI_LAYERMANAGEMENT_API struct ilmSurfaceProperties surfaceProperties; for (int i = 0; i < m_surfaces.size(); ++i) @@ -548,7 +548,7 @@ void WindowManager::hideLayer(int layer) qDebug("-=[hideLayer]=-"); qDebug("layer %d", layer); -#ifdef __arm__ +#ifdef HAVE_IVI_LAYERMANAGEMENT_API if (0 == layer) { ilm_layerSetVisibility(WINDOWMANAGER_LAYER_POPUP, ILM_FALSE); @@ -627,7 +627,7 @@ void WindowManager::showLayer(int layer) qDebug("-=[showLayer]=-"); qDebug("layer %d", layer); -#ifdef __arm__ +#ifdef HAVE_IVI_LAYERMANAGEMENT_API if (0 == layer) { ilm_layerSetVisibility(WINDOWMANAGER_LAYER_POPUP, ILM_TRUE); diff --git a/WindowManager/src/windowmanager.hpp b/WindowManager/src/windowmanager.hpp index a4d9d4f..30affd6 100644 --- a/WindowManager/src/windowmanager.hpp +++ b/WindowManager/src/windowmanager.hpp @@ -24,9 +24,9 @@ #include "windowmanager_adapter.h" -#ifdef __arm__ +#ifdef HAVE_IVI_LAYERMANAGEMENT_API extern "C" { -#include "ilm/ilm_control.h" +#include } #endif @@ -49,7 +49,7 @@ private: void dumpScene(); -#ifdef __arm__ +#ifdef HAVE_IVI_LAYERMANAGEMENT_API void createNewLayer(int layerId); void addSurfaceToLayer(int surfaceId, int layerId); #endif @@ -59,7 +59,7 @@ private: public: static void* myThis; -#ifdef __arm__ +#ifdef HAVE_IVI_LAYERMANAGEMENT_API // for general notifications void notificationFunc_non_static(ilmObjectType object, t_ilm_uint id, diff --git a/config.tests/ivi_layermanagement_api/ivi_layermanagement_api.cpp b/config.tests/ivi_layermanagement_api/ivi_layermanagement_api.cpp new file mode 100644 index 0000000..579abdd --- /dev/null +++ b/config.tests/ivi_layermanagement_api/ivi_layermanagement_api.cpp @@ -0,0 +1,7 @@ +#include + +int main(int argc,char **argv) +{ + return 0; +} + diff --git a/config.tests/ivi_layermanagement_api/ivi_layermanagement_api.pro b/config.tests/ivi_layermanagement_api/ivi_layermanagement_api.pro new file mode 100644 index 0000000..d230384 --- /dev/null +++ b/config.tests/ivi_layermanagement_api/ivi_layermanagement_api.pro @@ -0,0 +1,5 @@ +SOURCES = ivi_layermanagement_api.cpp + +CONFIG -= qt dylib + +LIBS += -lilmControl -lilmCommon diff --git a/ivi_layermanagement_api.pri b/ivi_layermanagement_api.pri new file mode 100644 index 0000000..ac03c1f --- /dev/null +++ b/ivi_layermanagement_api.pri @@ -0,0 +1,5 @@ +config_ivi_layermanagement_api { + DEFINES += HAVE_IVI_LAYERMANAGEMENT_API +} else { + message(HAVE_IVI_LAYERMANAGEMENT_API not available) +}