diff options
author | Bocklage, Jens <Jens_Bocklage@mentor.com> | 2016-11-07 13:40:36 +0100 |
---|---|---|
committer | Bocklage, Jens <Jens_Bocklage@mentor.com> | 2016-11-07 13:40:36 +0100 |
commit | ef35ccbf522a2aaaece7625e9886bd910e3bd8b8 (patch) | |
tree | 6e117022ab2f1351c54ef318480bb92c1fe0543e | |
parent | 5f64524d072abe75f4abb0730d37c0380f148fc1 (diff) |
New HomeScreen API calls getSurfaceStatus and getAllSurfacesOfProcess.
Signed-off-by: Bocklage, Jens <Jens_Bocklage@mentor.com>
-rw-r--r-- | HomeScreen/src/homescreencontrolinterface.cpp | 12 | ||||
-rw-r--r-- | HomeScreen/src/homescreencontrolinterface.h | 4 | ||||
-rw-r--r-- | HomeScreen/src/layouthandler.cpp | 27 | ||||
-rw-r--r-- | HomeScreen/src/layouthandler.h | 2 | ||||
-rw-r--r-- | HomeScreen/src/mainwindow.cpp | 2 | ||||
-rw-r--r-- | interfaces/homescreen.xml | 124 |
6 files changed, 121 insertions, 50 deletions
diff --git a/HomeScreen/src/homescreencontrolinterface.cpp b/HomeScreen/src/homescreencontrolinterface.cpp index bc66e53..fae19a2 100644 --- a/HomeScreen/src/homescreencontrolinterface.cpp +++ b/HomeScreen/src/homescreencontrolinterface.cpp @@ -24,12 +24,24 @@ HomeScreenControlInterface::~HomeScreenControlInterface() delete mp_homeScreenAdaptor; } +QList<int> HomeScreenControlInterface::getAllSurfacesOfProcess(int pid) +{ + qDebug("getAllSurfacesOfProcess %d", pid); + return newRequestGetAllSurfacesOfProcess(pid); +} + QRect HomeScreenControlInterface::getLayoutRenderAreaForSurfaceId(int surfaceId) { qDebug("getLayoutRenderAreaForSurfaceId %d", surfaceId); return newRequestGetLayoutRenderAreaForSurfaceId(surfaceId); } +int HomeScreenControlInterface::getSurfaceStatus(int surfaceId) +{ + qDebug("getSurfaceStatus %d", surfaceId); + return newRequestGetSurfaceStatus(surfaceId); +} + void HomeScreenControlInterface::hardKeyPressed(int key) { int pid = -1; diff --git a/HomeScreen/src/homescreencontrolinterface.h b/HomeScreen/src/homescreencontrolinterface.h index 3203088..fb772db 100644 --- a/HomeScreen/src/homescreencontrolinterface.h +++ b/HomeScreen/src/homescreencontrolinterface.h @@ -17,13 +17,17 @@ public: signals: void newRequestsToBeVisibleApp(int pid); + QList<int> newRequestGetAllSurfacesOfProcess(int pid); QRect newRequestGetLayoutRenderAreaForSurfaceId(int surfaceId); + int newRequestGetSurfaceStatus(int surfaceId); void newRequestRenderSurfaceToArea(int surfaceId, const QRect &renderArea); void newRequestSurfaceIdToFullScreen(int surfaceId); //from homescreen_adapter.h public Q_SLOTS: // METHODS + QList<int> getAllSurfacesOfProcess(int pid); QRect getLayoutRenderAreaForSurfaceId(int surfaceId); + int getSurfaceStatus(int surfaceId); void hardKeyPressed(int key); void renderSurfaceToArea(int surfaceId, const QRect &renderArea); void requestSurfaceIdToFullScreen(int surfaceId); diff --git a/HomeScreen/src/layouthandler.cpp b/HomeScreen/src/layouthandler.cpp index 5f52cd5..35304e6 100644 --- a/HomeScreen/src/layouthandler.cpp +++ b/HomeScreen/src/layouthandler.cpp @@ -175,6 +175,33 @@ void LayoutHandler::makeMeVisible(int pid) } } +QList<int> LayoutHandler::requestGetAllSurfacesOfProcess(int pid) +{ + qDebug("requestGetAllSurfacesOfProcess %d", pid); + + return mp_dBusWindowManagerProxy->getAllSurfacesOfProcess(pid); +} + +int LayoutHandler::requestGetSurfaceStatus(int surfaceId) +{ + int result = -1; + + if (-1 != m_visibleSurfaces.indexOf(surfaceId)) + { + result = 0; + } + if (-1 != m_invisibleSurfaces.indexOf(surfaceId)) + { + result = 1; + } + if (-1 != m_requestsToBeVisibleSurfaces.indexOf(surfaceId)) + { + result = 1; + } + + return result; +} + void LayoutHandler::requestRenderSurfaceToArea(int surfaceId, const QRect &renderArea) { qDebug("requestRenderSurfaceToArea %d %d,%d,%d,%d", surfaceId, renderArea.x(), renderArea.y(), renderArea.width(), renderArea.height()); diff --git a/HomeScreen/src/layouthandler.h b/HomeScreen/src/layouthandler.h index cc4b7ab..1ba270b 100644 --- a/HomeScreen/src/layouthandler.h +++ b/HomeScreen/src/layouthandler.h @@ -19,6 +19,8 @@ signals: public slots: void makeMeVisible(int pid); + QList<int> requestGetAllSurfacesOfProcess(int pid); + int requestGetSurfaceStatus(int surfaceId); void requestRenderSurfaceToArea(int surfaceId, const QRect &renderArea); void requestSurfaceIdToFullScreen(int surfaceId); void setLayoutByName(QString layoutName); diff --git a/HomeScreen/src/mainwindow.cpp b/HomeScreen/src/mainwindow.cpp index f8dfe89..f4891b3 100644 --- a/HomeScreen/src/mainwindow.cpp +++ b/HomeScreen/src/mainwindow.cpp @@ -100,6 +100,8 @@ MainWindow::MainWindow(QWidget *parent) : mp_layoutHandler->setUpLayouts(); mp_homeScreenControlInterface = new HomeScreenControlInterface(this); + QObject::connect(mp_homeScreenControlInterface, SIGNAL(newRequestGetAllSurfacesOfProcess(int)), mp_layoutHandler, SLOT(requestGetAllSurfacesOfProcess(int))); + QObject::connect(mp_homeScreenControlInterface, SIGNAL(newRequestGetSurfaceStatus(int)), mp_layoutHandler, SLOT(requestGetSurfaceStatus(int))); QObject::connect(mp_homeScreenControlInterface, SIGNAL(newRequestsToBeVisibleApp(int)), mp_layoutHandler, SLOT(makeMeVisible(int))); QObject::connect(mp_homeScreenControlInterface, SIGNAL(newRequestSurfaceIdToFullScreen(int)), mp_layoutHandler, SLOT(requestSurfaceIdToFullScreen(int))); QObject::connect(mp_homeScreenControlInterface, SIGNAL(newRequestRenderSurfaceToArea(int, QRect)), mp_layoutHandler, SLOT(requestRenderSurfaceToArea(int,QRect))); diff --git a/interfaces/homescreen.xml b/interfaces/homescreen.xml index b317306..1cd390a 100644 --- a/interfaces/homescreen.xml +++ b/interfaces/homescreen.xml @@ -19,59 +19,83 @@ This interface is a collection of methods from different functional areas to control the HomeScreen app. --> - <interface name="org.agl.homescreen"> - <!-- - hardKeyPressed: - @key: The key that was pressed using the inputevent.hpp InputEvent::HardKey type. + <interface name="org.agl.homescreen"> + <!-- + hardKeyPressed: + @key: The key that was pressed using the inputevent.hpp InputEvent::HardKey type. - This is used to inject hard keys into the HomeScreen app. - --> - <method name="hardKeyPressed"> - <arg name="key" type="i" direction="in"/> - </method> - <!-- - requestSurfaceIdToFullScreen: - @surfaceId: The surface that request to be shown fullscreen. + This is used to inject hard keys into the HomeScreen app. + --> + <method name="hardKeyPressed"> + <arg name="key" type="i" direction="in"/> + </method> + <!-- + getSurfaceStatus: + @surfaceId: The given surface. + @status: The status can be unknown (-1), visible (0), invisible (1) - This allows an application to set a surface to full screen. - --> - <method name="requestSurfaceIdToFullScreen"> - <arg name="surfaceId" type="i" direction="in"/> - </method> - <!-- - getLayoutRenderAreaForSurfaceId: - @surfaceId: The surface that is requested. - @renderArea: The layout render area in which the given surface is located. + A surface can have three states. It can be visible, then it is shown on the screen. + It can be invisible, then it is not shown on the screen. Or the state is unknown. + --> + <method name="getSurfaceStatus"> + <arg name="surfaceId" type="i" direction="in"/> + <arg name="status" type="i" direction="out"/> + </method> + <!-- + requestSurfaceIdToFullScreen: + @surfaceId: The surface that request to be shown fullscreen. - Before an application uses renderSurfaceToArea to render a surface into an area inside a layout area, - this method should be used to get the dimension of the layout area, in which the surface - currently is positioned. - --> - <method name="getLayoutRenderAreaForSurfaceId"> - <arg name="surfaceId" type="i" direction="in"/> - <arg name="renderArea" type="(iiii)" direction="out"/> - <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QRect"/> - </method> - <!-- - renderSurfaceToArea: - @surfaceId: The surface that is requested. - @renderArea: The render area inside the current layout area. + This allows an application to set a surface to full screen. + --> + <method name="requestSurfaceIdToFullScreen"> + <arg name="surfaceId" type="i" direction="in"/> + </method> + <!-- + getAllSurfacesOfProcess: + @pid: The PID of the process. + @surfaceIds: A list of surfaces that were created by the process. - This is a special case. In the normal use case, one layout area is always filled completely - with one surface. By using this function, an app can request to position a surface in the - layout area. - Example: - If the layout area is 500x500 pixel in size, the normal use case qould be, that a surface - is positioned at x=0, y=0 with a width and a size of 500. With this function, an application can position surfaces - free in this area. - E.g.: Position surface 101 at x=10, y=30, width=300, height=100 and - surface 104 at x=100, y=130, width=30, height=10 - --> - <method name="renderSurfaceToArea"> - <arg name="surfaceId" type="i" direction="in"/> - <arg name="renderArea" type="(iiii)" direction="in"/> - <annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QRect"/> - </method> - </interface> + The surface IDs can for example be used to assign them to a layout render area. + --> + <method name="getAllSurfacesOfProcess"> + <arg name="pid" type="i" direction="in"/> + <arg name="surfaceIds" type="ai" direction="out"/> + <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QList<int>"/> + </method> + <!-- + getLayoutRenderAreaForSurfaceId: + @surfaceId: The surface that is requested. + @renderArea: The layout render area in which the given surface is located. + + Before an application uses renderSurfaceToArea to render a surface into an area inside a layout area, + this method should be used to get the dimension of the layout area, in which the surface + currently is positioned. + --> + <method name="getLayoutRenderAreaForSurfaceId"> + <arg name="surfaceId" type="i" direction="in"/> + <arg name="renderArea" type="(iiii)" direction="out"/> + <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QRect"/> + </method> + <!-- + renderSurfaceToArea: + @surfaceId: The surface that is requested. + @renderArea: The render area inside the current layout area. + + This is a special case. In the normal use case, one layout area is always filled completely + with one surface. By using this function, an app can request to position a surface in the + layout area. + Example: + If the layout area is 500x500 pixel in size, the normal use case qould be, that a surface + is positioned at x=0, y=0 with a width and a size of 500. With this function, an application can position surfaces + free in this area. + E.g.: Position surface 101 at x=10, y=30, width=300, height=100 and + surface 104 at x=100, y=130, width=30, height=10 + --> + <method name="renderSurfaceToArea"> + <arg name="surfaceId" type="i" direction="in"/> + <arg name="renderArea" type="(iiii)" direction="in"/> + <annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QRect"/> + </method> + </interface> </node> |