Changes to org.agl.homescreen interface
authorBocklage, Jens <Jens_Bocklage@mentor.com>
Wed, 9 Nov 2016 17:31:50 +0000 (18:31 +0100)
committerBocklage, Jens <Jens_Bocklage@mentor.com>
Wed, 9 Nov 2016 17:33:05 +0000 (18:33 +0100)
Change parameter for renderSurfaceToArea.
Remove getLayoutRenderAreaForSurfaceId.

Signed-off-by: Bocklage, Jens <Jens_Bocklage@mentor.com>
HomeScreen/src/homescreencontrolinterface.cpp
HomeScreen/src/homescreencontrolinterface.h
SampleHomeScreenInterfaceApp/src/sampleclass.cpp
SampleHomeScreenInterfaceApp/src/sampleclass.hpp
interfaces/homescreen.xml
libhomescreen/include/libhomescreen.hpp
libhomescreen/src/libhomescreen.cpp

index fae19a2..71e4a2c 100644 (file)
@@ -30,12 +30,6 @@ QList<int> HomeScreenControlInterface::getAllSurfacesOfProcess(int 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);
index fb772db..27cf4e8 100644 (file)
@@ -18,7 +18,6 @@ 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);
@@ -26,7 +25,6 @@ signals:
 //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);
index f4c1c83..bc39af9 100644 (file)
@@ -16,11 +16,6 @@ std::list<int> SampleClass::getAllSurfacesOfProcess(int pid)
     return mp_libHomeScreen->getAllSurfacesOfProcess(pid);
 }
 
-sRectangle SampleClass::getLayoutRenderAreaForSurfaceId(int surfaceId)
-{
-    return mp_libHomeScreen->getLayoutRenderAreaForSurfaceId(surfaceId);
-}
-
 void SampleClass::hardKeyPressed(int key)
 {
     mp_libHomeScreen->hardKeyPressed(key);
@@ -31,9 +26,9 @@ int SampleClass::getSurfaceStatus(int surfaceId)
     return mp_libHomeScreen->getSurfaceStatus(surfaceId);
 }
 
-void SampleClass::renderSurfaceToArea(int surfaceId, const sRectangle &renderArea)
+void SampleClass::renderSurfaceToArea(int surfaceId, int layoutArea)
 {
-    mp_libHomeScreen->renderSurfaceToArea(surfaceId, renderArea);
+    mp_libHomeScreen->renderSurfaceToArea(surfaceId, layoutArea);
 }
 
 void SampleClass::requestSurfaceIdToFullScreen(int surfaceId)
index f5a5d13..9293843 100644 (file)
@@ -11,10 +11,9 @@ public:
     ~SampleClass();
 
     std::list<int> getAllSurfacesOfProcess(int pid);
-    sRectangle getLayoutRenderAreaForSurfaceId(int surfaceId);
     int getSurfaceStatus(int surfaceId);
     void hardKeyPressed(int key);
-    void renderSurfaceToArea(int surfaceId, const sRectangle &renderArea);
+    void renderSurfaceToArea(int surfaceId, int layoutArea);
     void requestSurfaceIdToFullScreen(int surfaceId);
 
 private:
index 1cd390a..999b0e9 100644 (file)
                        <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QList&lt;int&gt;"/>
                </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.
+               @layoutArea: The layout area where the surface shall be rendered.
 
                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
+               with the first surface, that the process creates (more precise: the surface with the lowest id).
+               By using this function, an app can request to position a different surface in the layout area.
                -->
                <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"/>
+                       <arg name="layoutArea" type="i" direction="in"/>
                </method>
        </interface>
 </node>
index c028617..f88b35f 100644 (file)
@@ -23,10 +23,9 @@ public:
 
     // these are representing the D-Bus methods:
     std::list<int> getAllSurfacesOfProcess(int pid);
-    sRectangle getLayoutRenderAreaForSurfaceId(int surfaceId);
     int getSurfaceStatus(int surfaceId);
     void hardKeyPressed(int key);
-    void renderSurfaceToArea(int surfaceId, const sRectangle &renderArea);
+    void renderSurfaceToArea(int surfaceId, int layoutArea);
     void requestSurfaceIdToFullScreen(int surfaceId);
 
 private:
index 03e95d6..374cfe8 100644 (file)
@@ -67,30 +67,6 @@ std::list<int> LibHomeScreen::getAllSurfacesOfProcess(int pid)
     return result;
 }
 
-sRectangle LibHomeScreen::getLayoutRenderAreaForSurfaceId(int surfaceId)
-{
-    sRectangle result;
-    GError *err = NULL;
-
-    GVariant *out_renderArea;
-
-    lib_home_screen_homescreen_call_get_layout_render_area_for_surface_id_sync(
-                mp_libHomeScreenHomescreen_Proxy,
-                surfaceId,
-                &out_renderArea,
-                NULL,
-                &err);
-
-    if (NULL != err)
-    {
-        fprintf(stderr, "Unable to call getLayoutRenderAreaForSurfaceId: %s\n", err->message);
-    }
-
-    g_variant_get(out_renderArea, "(iiii)", result.x, result.y, result.width, result.height);
-
-    return result;
-}
-
 int LibHomeScreen::getSurfaceStatus(int surfaceId)
 {
     int result;
@@ -129,21 +105,14 @@ void LibHomeScreen::hardKeyPressed(int key)
     }
 }
 
-void LibHomeScreen::renderSurfaceToArea(int surfaceId, const sRectangle &renderArea)
+void LibHomeScreen::renderSurfaceToArea(int surfaceId, int layoutArea)
 {
     GError *err = NULL;
 
-    GVariant *variant;
-    GVariantBuilder *builder;
-    builder = g_variant_builder_new(G_VARIANT_TYPE("(iiii)"));
-    g_variant_builder_add(builder, "(iiii)", renderArea.x, renderArea.y, renderArea.width, renderArea.height);
-    variant = g_variant_new("(iiii)", builder);
-    g_variant_builder_unref(builder);
-
     lib_home_screen_homescreen_call_render_surface_to_area_sync(
                 mp_libHomeScreenHomescreen_Proxy,
                 surfaceId,
-                variant,
+                layoutArea,
                 NULL,
                 &err);