diff options
-rw-r--r-- | HomeScreen/src/homescreencontrolinterface.cpp | 6 | ||||
-rw-r--r-- | HomeScreen/src/homescreencontrolinterface.h | 2 | ||||
-rw-r--r-- | SampleHomeScreenInterfaceApp/src/sampleclass.cpp | 4 | ||||
-rw-r--r-- | SampleHomeScreenInterfaceApp/src/sampleclass.hpp | 2 | ||||
-rw-r--r-- | interfaces/homescreen.xml | 19 | ||||
-rw-r--r-- | libhomescreen/include/libhomescreen.hpp | 2 | ||||
-rw-r--r-- | libhomescreen/src/libhomescreen.cpp | 8 |
7 files changed, 22 insertions, 21 deletions
diff --git a/HomeScreen/src/homescreencontrolinterface.cpp b/HomeScreen/src/homescreencontrolinterface.cpp index 0c35b1c..1977957 100644 --- a/HomeScreen/src/homescreencontrolinterface.cpp +++ b/HomeScreen/src/homescreencontrolinterface.cpp @@ -66,10 +66,10 @@ void HomeScreenControlInterface::renderSurfaceToArea(int surfaceId, int layoutAr newRequestRenderSurfaceToArea(surfaceId, layoutArea); } -bool HomeScreenControlInterface::renderSurfaceToAreaAllowed(int surfaceId, int layoutArea) +bool HomeScreenControlInterface::renderAppToAreaAllowed(int appCategory, int layoutArea) { - qDebug("renderSurfaceToAreaAllowed %d %d", surfaceId, layoutArea); - return renderSurfaceToAreaAllowed(surfaceId, layoutArea); + qDebug("renderAppToAreaAllowed %d %d", appCategory, layoutArea); + return true; //TODO: ask policy manager } void HomeScreenControlInterface::requestSurfaceIdToFullScreen(int surfaceId) diff --git a/HomeScreen/src/homescreencontrolinterface.h b/HomeScreen/src/homescreencontrolinterface.h index b202dc9..04e47cb 100644 --- a/HomeScreen/src/homescreencontrolinterface.h +++ b/HomeScreen/src/homescreencontrolinterface.h @@ -29,7 +29,7 @@ public Q_SLOTS: // METHODS int getSurfaceStatus(int surfaceId); void hardKeyPressed(int key); void renderSurfaceToArea(int surfaceId, int layoutArea); - bool renderSurfaceToAreaAllowed(int surfaceId, int layoutArea); + bool renderAppToAreaAllowed(int appCategory, int layoutArea); void requestSurfaceIdToFullScreen(int surfaceId); private: HomescreenAdaptor *mp_homeScreenAdaptor; diff --git a/SampleHomeScreenInterfaceApp/src/sampleclass.cpp b/SampleHomeScreenInterfaceApp/src/sampleclass.cpp index 86b5943..b2a6f7b 100644 --- a/SampleHomeScreenInterfaceApp/src/sampleclass.cpp +++ b/SampleHomeScreenInterfaceApp/src/sampleclass.cpp @@ -31,9 +31,9 @@ void SampleClass::renderSurfaceToArea(int surfaceId, int layoutArea) mp_libHomeScreen->renderSurfaceToArea(surfaceId, layoutArea); } -bool SampleClass::renderSurfaceToAreaAllowed(int surfaceId, int layoutArea) +bool SampleClass::renderAppToAreaAllowed(int appCategory, int layoutArea) { - return mp_libHomeScreen->renderSurfaceToAreaAllowed(surfaceId, layoutArea); + return mp_libHomeScreen->renderAppToAreaAllowed(appCategory, layoutArea); } void SampleClass::requestSurfaceIdToFullScreen(int surfaceId) diff --git a/SampleHomeScreenInterfaceApp/src/sampleclass.hpp b/SampleHomeScreenInterfaceApp/src/sampleclass.hpp index 3e80117..44a88a2 100644 --- a/SampleHomeScreenInterfaceApp/src/sampleclass.hpp +++ b/SampleHomeScreenInterfaceApp/src/sampleclass.hpp @@ -14,7 +14,7 @@ public: int getSurfaceStatus(int surfaceId); void hardKeyPressed(int key); void renderSurfaceToArea(int surfaceId, int layoutArea); - bool renderSurfaceToAreaAllowed(int surfaceId, int layoutArea); + bool renderAppToAreaAllowed(int appCategory, int layoutArea); void requestSurfaceIdToFullScreen(int surfaceId); private: diff --git a/interfaces/homescreen.xml b/interfaces/homescreen.xml index fe0ea30..e9cad83 100644 --- a/interfaces/homescreen.xml +++ b/interfaces/homescreen.xml @@ -63,23 +63,24 @@ <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QList<int>"/> </method> <!-- - renderSurfaceToAreaAllowed: - @surfaceId: The surface that is requested. - @layoutArea: The layout area where the surface shall be rendered. - @allowed: Returns true, if the surface is allowed to be rendered in the area + renderAppToAreaAllowed: + @appCategory: The application category that is requested. Use enum AppCategory for this! + @layoutArea: The layout area where the application shall be rendered. Find the layoutArea ids in the layout definition! + @allowed: Returns true, if the application is allowed to be rendered in the area - This function can be used to request, if it is allowed to render a surface in a layout area in preparation - of the real renderSurfaceToArea command. This call will not change anything, it is only a request. + This function can be used to request, if it is allowed to render an application of a specific category + in a layout area. The idea is to decide from an application point of view to allocate recources or not. + Example: an application will decide to render video based on this call. This call will not change anything, it is only a request. --> - <method name="renderSurfaceToAreaAllowed"> - <arg name="surfaceId" type="i" direction="in"/> + <method name="renderAppToAreaAllowed"> + <arg name="appCategory" type="i" direction="in"/> <arg name="layoutArea" type="i" direction="in"/> <arg name="allowed" type="b" direction="out"/> </method> <!-- renderSurfaceToArea: @surfaceId: The surface that is requested. - @layoutArea: The layout area where the surface shall be rendered. + @layoutArea: The layout area where the surface shall be rendered. Find the layoutArea ids in the layout definition! This is a special case. In the normal use case, one layout area is always filled completely with the first surface, that the process creates (more precise: the surface with the lowest id). diff --git a/libhomescreen/include/libhomescreen.hpp b/libhomescreen/include/libhomescreen.hpp index 6ec843f..841196b 100644 --- a/libhomescreen/include/libhomescreen.hpp +++ b/libhomescreen/include/libhomescreen.hpp @@ -26,7 +26,7 @@ public: int getSurfaceStatus(int surfaceId); void hardKeyPressed(int key); void renderSurfaceToArea(int surfaceId, int layoutArea); - bool renderSurfaceToAreaAllowed(int surfaceId, int layoutArea); + bool renderAppToAreaAllowed(int appCategory, int layoutArea); void requestSurfaceIdToFullScreen(int surfaceId); private: LibHomeScreenHomescreen *mp_libHomeScreenHomescreen_Proxy; diff --git a/libhomescreen/src/libhomescreen.cpp b/libhomescreen/src/libhomescreen.cpp index 03c4baf..5cdabc9 100644 --- a/libhomescreen/src/libhomescreen.cpp +++ b/libhomescreen/src/libhomescreen.cpp @@ -122,14 +122,14 @@ void LibHomeScreen::renderSurfaceToArea(int surfaceId, int layoutArea) } } -bool LibHomeScreen::renderSurfaceToAreaAllowed(int surfaceId, int layoutArea) +bool LibHomeScreen::renderAppToAreaAllowed(int appCategory, int layoutArea) { gboolean result = true; GError *err = NULL; - lib_home_screen_homescreen_call_render_surface_to_area_allowed_sync( + lib_home_screen_homescreen_call_render_app_to_area_allowed_sync( mp_libHomeScreenHomescreen_Proxy, - surfaceId, + appCategory, layoutArea, &result, NULL, @@ -137,7 +137,7 @@ bool LibHomeScreen::renderSurfaceToAreaAllowed(int surfaceId, int layoutArea) if (NULL != err) { - fprintf(stderr, "Unable to call renderSurfaceToArea: %s\n", err->message); + fprintf(stderr, "Unable to call renderAppToAreaAllowed: %s\n", err->message); } return result; |