Add new signal surfaceVisibilityChanged to homescreen and windowmanager API.
Signed-off-by: Bocklage, Jens <Jens_Bocklage@mentor.com>
"/Popup",
QDBusConnection::sessionBus(),
0);
+
+ QDBusConnection::sessionBus().connect("org.agl.windowmanager",
+ "/windowmanager",
+ "org.agl.windowmanager",
+ "surfaceVisibilityChanged",
+ this,
+ SLOT(surfaceVisibilityChanged(int,bool)));
}
LayoutHandler::~LayoutHandler()
void LayoutHandler::showAppLayer()
{
- mp_dBusWindowManagerProxy->showLayer(1); //1==app layer
+ // POPUP=0, HOMESCREEN_OVERLAY=1, APPS=2, HOMESCREEN=3
+ mp_dBusWindowManagerProxy->showLayer(2); // TODO: enum
}
void LayoutHandler::hideAppLayer()
{
- mp_dBusWindowManagerProxy->hideLayer(1); //1==app layer
+ // POPUP=0, HOMESCREEN_OVERLAY=1, APPS=2, HOMESCREEN=3
+ mp_dBusWindowManagerProxy->hideLayer(2); // TODO: enum
}
void LayoutHandler::makeMeVisible(int pid)
}
}
+void LayoutHandler::requestSurfaceVisibilityChanged(int surfaceId, bool visible)
+{
+ qDebug("requestSurfaceVisibilityChanged %d %s", surfaceId, visible ? "true" : "false");
+ surfaceVisibilityChanged(surfaceId, visible);
+}
+
void LayoutHandler::timerEvent(QTimerEvent *e)
{
if (e->timerId() == m_secondsTimerId)
void requestSurfaceIdToFullScreen(int surfaceId);
void setLayoutByName(QString layoutName);
+ // this will receive the surfaceVisibilityChanged signal of the windowmanager
+ void requestSurfaceVisibilityChanged(int surfaceId, bool visible);
+
+Q_SIGNALS: // SIGNALS
+ void surfaceVisibilityChanged(int surfaceId, bool visible);
+
protected:
void timerEvent(QTimerEvent *e);
private:
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
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;
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);
if (ILM_NOTIFICATION_VISIBILITY & mask)
{
qDebug("ILM_NOTIFICATION_VISIBILITY");
+ surfaceVisibilityChanged(surface, surfaceProperties.visibility);
}
if (ILM_NOTIFICATION_OPACITY & mask)
{
}
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);
}
}
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);
}
int setLayoutByName(const QString &layoutName);
int setSurfaceToLayoutArea(int surfaceId, int layoutAreaId);
void showLayer(int layer);
+
+Q_SIGNALS: // SIGNALS
+ void surfaceVisibilityChanged(int surfaceId, bool visible);
};
<arg name="surfaceId" type="i" direction="in"/>
<arg name="layoutArea" type="i" direction="in"/>
</method>
+ <!--
+ surfaceVisibilityChanged:
+ @surfaceId: The surface that changed.
+ @visible: True, if the surface is visible.
+
+ This is emitted when the visible property of the surfaces changes.
+ -->
+ <signal name="surfaceVisibilityChanged">
+ <arg name="surfaceId" type="i"/>
+ <arg name="visible" type="b"/>
+ </signal>
</interface>
</node>
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QList<int>"/>
</method>
+ <!--
+ surfaceVisibilityChanged:
+ @surfaceId: The surface that changed.
+ @visible: True, if the surface is visible.
+
+ This is emitted when the visible property of the surfaces changes.
+ -->
+ <signal name="surfaceVisibilityChanged">
+ <arg name="surfaceId" type="i"/>
+ <arg name="visible" type="b"/>
+ </signal>
+
<!--
showLayer:
- @layer: The ID of the layer to show. POPUP=0, APPS=1, HOMESCREEN=2
+ @layer: The ID of the layer to show. POPUP=0, HOMESCREEN_OVERLAY=1, APPS=2, HOMESCREEN=3
Show complete layers.
By default, all layers are shown.
</method>
<!--
hideLayer:
- @layer: The ID of the layer to hide. POPUP=0, APPS=1, HOMESCREEN=2
+ @layer: The ID of the layer to hide. POPUP=0, HOMESCREEN_OVERLAY=1, APPS=2, HOMESCREEN=3
Hide complete layers.
By default, all layers are shown.