X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=WindowManager%2Fsrc%2Fwindowmanager.cpp;h=047734f57befa87c016120012b9d2b225b81ebfe;hb=83cfbb9fe4bcc17f6b00c8a25aa3eb8c2c850ac0;hp=1c0ddea49aa146cbfda9b69c4c29f7c7ef8ce3e4;hpb=557bdea00ff9a398f0646fdcae653791c9cb640c;p=staging%2FHomeScreen.git diff --git a/WindowManager/src/windowmanager.cpp b/WindowManager/src/windowmanager.cpp index 1c0ddea..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(); @@ -70,6 +70,7 @@ void WindowManager::start() err = ilm_registerNotification(WindowManager::notificationFunc_static, this); createNewLayer(WINDOWMANAGER_LAYER_POPUP); + createNewLayer(WINDOWMANAGER_LAYER_HOMESCREEN_OVERLAY); createNewLayer(WINDOWMANAGER_LAYER_APPLICATIONS); createNewLayer(WINDOWMANAGER_LAYER_HOMESCREEN); #endif @@ -79,7 +80,7 @@ WindowManager::~WindowManager() { qDebug("-=[~WindowManager]=-"); delete mp_windowManagerAdaptor; -#ifdef __arm__ +#ifdef HAVE_IVI_LAYERMANAGEMENT_API ilm_destroy(); #endif delete mp_layoutAreaToSurfaceIdAssignment; @@ -109,7 +110,7 @@ void WindowManager::dumpScene() } } -#ifdef __arm__ +#ifdef HAVE_IVI_LAYERMANAGEMENT_API void WindowManager::createNewLayer(int layerId) { @@ -184,6 +185,19 @@ void WindowManager::addSurfaceToLayer(int surfaceId, int layerId) ilm_layerAddSurface(layerId, surfaceId); } + if (layerId == WINDOWMANAGER_LAYER_HOMESCREEN_OVERLAY) + { + struct ilmSurfaceProperties surfaceProperties; + ilm_getPropertiesOfSurface(surfaceId, &surfaceProperties); + + ilm_surfaceSetDestinationRectangle(surfaceId, 0, 0, surfaceProperties.origSourceWidth, surfaceProperties.origSourceHeight); + ilm_surfaceSetSourceRectangle(surfaceId, 0, 0, surfaceProperties.origSourceWidth, surfaceProperties.origSourceHeight); + ilm_surfaceSetOpacity(surfaceId, 0.5); + ilm_surfaceSetVisibility(surfaceId, ILM_TRUE); + + ilm_layerAddSurface(layerId, surfaceId); + } + if (layerId == WINDOWMANAGER_LAYER_POPUP) { struct ilmSurfaceProperties surfaceProperties; @@ -206,7 +220,7 @@ void WindowManager::updateScreen() { qDebug("-=[updateScreen]=-"); -#ifdef __arm__ +#ifdef HAVE_IVI_LAYERMANAGEMENT_API if (-1 != m_currentLayout) { @@ -259,7 +273,8 @@ void WindowManager::updateScreen() t_ilm_layer renderOrder[WINDOWMANAGER_LAYER_NUM]; renderOrder[0] = WINDOWMANAGER_LAYER_HOMESCREEN; renderOrder[1] = WINDOWMANAGER_LAYER_APPLICATIONS; - renderOrder[2] = WINDOWMANAGER_LAYER_POPUP; + renderOrder[2] = WINDOWMANAGER_LAYER_HOMESCREEN_OVERLAY; + renderOrder[3] = WINDOWMANAGER_LAYER_POPUP; ilm_displaySetRenderOrder(0, renderOrder, WINDOWMANAGER_LAYER_NUM); @@ -268,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) @@ -334,6 +349,7 @@ void WindowManager::surfaceCallbackFunction_non_static(t_ilm_surface surface, if (ILM_NOTIFICATION_VISIBILITY & mask) { qDebug("ILM_NOTIFICATION_VISIBILITY"); + surfaceVisibilityChanged(surface, surfaceProperties->visibility); } if (ILM_NOTIFICATION_OPACITY & mask) { @@ -363,6 +379,17 @@ void WindowManager::surfaceCallbackFunction_non_static(t_ilm_surface surface, if (ILM_NOTIFICATION_CONFIGURED & mask) { qDebug("ILM_NOTIFICATION_CONFIGURED"); + qDebug(" surfaceProperties %d", surface); + qDebug(" surfaceProperties.origSourceWidth: %d", surfaceProperties->origSourceWidth); + qDebug(" surfaceProperties.origSourceHeight: %d", surfaceProperties->origSourceHeight); + + ilm_surfaceSetSourceRectangle(surface, + 0, + 0, + surfaceProperties->origSourceWidth, + surfaceProperties->origSourceHeight); + + ilm_commitChanges(); updateScreen(); } } @@ -456,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) @@ -521,16 +548,20 @@ 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); } if (1 == layer) { - ilm_layerSetVisibility(WINDOWMANAGER_LAYER_APPLICATIONS, ILM_FALSE); + ilm_layerSetVisibility(WINDOWMANAGER_LAYER_HOMESCREEN_OVERLAY, ILM_FALSE); } if (2 == layer) + { + ilm_layerSetVisibility(WINDOWMANAGER_LAYER_APPLICATIONS, ILM_FALSE); + } + if (3 == layer) { ilm_layerSetVisibility(WINDOWMANAGER_LAYER_HOMESCREEN, ILM_FALSE); } @@ -596,16 +627,20 @@ 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); } if (1 == layer) { - ilm_layerSetVisibility(WINDOWMANAGER_LAYER_APPLICATIONS, ILM_TRUE); + ilm_layerSetVisibility(WINDOWMANAGER_LAYER_HOMESCREEN_OVERLAY, ILM_TRUE); } if (2 == layer) + { + ilm_layerSetVisibility(WINDOWMANAGER_LAYER_APPLICATIONS, ILM_TRUE); + } + if (3 == layer) { ilm_layerSetVisibility(WINDOWMANAGER_LAYER_HOMESCREEN, ILM_TRUE); }