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.
Signed-off-by: Bocklage, Jens <Jens_Bocklage@mentor.com>
}
}
-void HomeScreenControlInterface::renderSurfaceToArea(int surfaceId, const QRect &renderArea)
+void HomeScreenControlInterface::renderSurfaceToArea(int surfaceId, int layoutArea)
{
- qDebug("requestSurfaceIdToFullScreen %d", surfaceId);
- newRequestRenderSurfaceToArea(surfaceId, renderArea);
+ qDebug("renderSurfaceToArea %d %d", surfaceId, layoutArea);
+ newRequestRenderSurfaceToArea(surfaceId, layoutArea);
+}
+
+bool HomeScreenControlInterface::renderSurfaceToAreaAllowed(int surfaceId, int layoutArea)
+{
+ qDebug("renderSurfaceToAreaAllowed %d %d", surfaceId, layoutArea);
+ return renderSurfaceToAreaAllowed(surfaceId, layoutArea);
}
void HomeScreenControlInterface::requestSurfaceIdToFullScreen(int surfaceId)
QList<int> newRequestGetAllSurfacesOfProcess(int pid);
int newRequestGetSurfaceStatus(int surfaceId);
- void newRequestRenderSurfaceToArea(int surfaceId, const QRect &renderArea);
+ void newRequestRenderSurfaceToArea(int surfaceId, int layoutArea);
+ bool newRequestRenderSurfaceToAreaAllowed(int surfaceId, int layoutArea);
void newRequestSurfaceIdToFullScreen(int surfaceId);
//from homescreen_adapter.h
QList<int> getAllSurfacesOfProcess(int pid);
int getSurfaceStatus(int surfaceId);
void hardKeyPressed(int key);
- void renderSurfaceToArea(int surfaceId, const QRect &renderArea);
+ void renderSurfaceToArea(int surfaceId, int layoutArea);
+ bool renderSurfaceToAreaAllowed(int surfaceId, int layoutArea);
void requestSurfaceIdToFullScreen(int surfaceId);
-
private:
HomescreenAdaptor *mp_homeScreenAdaptor;
org::agl::appframework *mp_dBusAppFrameworkProxy;
return result;
}
-void LayoutHandler::requestRenderSurfaceToArea(int surfaceId, const QRect &renderArea)
+void LayoutHandler::requestRenderSurfaceToArea(int surfaceId, int layoutArea)
{
- qDebug("requestRenderSurfaceToArea %d %d,%d,%d,%d", surfaceId, renderArea.x(), renderArea.y(), renderArea.width(), renderArea.height());
+ qDebug("requestRenderSurfaceToArea %d %d", surfaceId, layoutArea);
+}
+
+bool LayoutHandler::requestRenderSurfaceToAreaAllowed(int surfaceId, int layoutArea)
+{
+ qDebug("requestRenderSurfaceToAreaAllowed %d %d", surfaceId, layoutArea);
+ bool result = true;
+ return result;
}
void LayoutHandler::requestSurfaceIdToFullScreen(int surfaceId)
public slots:
QList<int> requestGetAllSurfacesOfProcess(int pid);
int requestGetSurfaceStatus(int surfaceId);
- void requestRenderSurfaceToArea(int surfaceId, const QRect &renderArea);
+ void requestRenderSurfaceToArea(int surfaceId, int layoutArea);
+ bool requestRenderSurfaceToAreaAllowed(int surfaceId, int layoutArea);
void requestSurfaceIdToFullScreen(int surfaceId);
void setLayoutByName(QString layoutName);
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)));
+ QObject::connect(mp_homeScreenControlInterface, SIGNAL(newRequestRenderSurfaceToArea(int, int)), mp_layoutHandler, SLOT(requestRenderSurfaceToArea(int,int)));
+ QObject::connect(mp_homeScreenControlInterface, SIGNAL(newRequestRenderSurfaceToAreaAllowed(int, int)), mp_layoutHandler, SLOT(requestRenderSurfaceToAreaAllowed(int,int)));
QObject::connect(mp_homeScreenControlInterface, SIGNAL(newRequestSurfaceIdToFullScreen(int)), mp_layoutHandler, SLOT(requestSurfaceIdToFullScreen(int)));
QObject::connect(mp_popupWidget, SIGNAL(comboBoxResult(QString)), mp_layoutHandler, SLOT(setLayoutByName(QString)));
mp_libHomeScreen->renderSurfaceToArea(surfaceId, layoutArea);
}
+bool SampleClass::renderSurfaceToAreaAllowed(int surfaceId, int layoutArea)
+{
+ return mp_libHomeScreen->renderSurfaceToAreaAllowed(surfaceId, layoutArea);
+}
+
void SampleClass::requestSurfaceIdToFullScreen(int surfaceId)
{
mp_libHomeScreen->requestSurfaceIdToFullScreen(surfaceId);
int getSurfaceStatus(int surfaceId);
void hardKeyPressed(int key);
void renderSurfaceToArea(int surfaceId, int layoutArea);
+ bool renderSurfaceToAreaAllowed(int surfaceId, int layoutArea);
void requestSurfaceIdToFullScreen(int surfaceId);
private:
<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
+
+ 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.
+ -->
+ <method name="renderSurfaceToAreaAllowed">
+ <arg name="surfaceId" 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.
int getSurfaceStatus(int surfaceId);
void hardKeyPressed(int key);
void renderSurfaceToArea(int surfaceId, int layoutArea);
+ bool renderSurfaceToAreaAllowed(int surfaceId, int layoutArea);
void requestSurfaceIdToFullScreen(int surfaceId);
-
private:
LibHomeScreenHomescreen *mp_libHomeScreenHomescreen_Proxy;
};
#endif // LIBHOMESCREEN_HPP
+
}
}
+bool LibHomeScreen::renderSurfaceToAreaAllowed(int surfaceId, int layoutArea)
+{
+ gboolean result = true;
+ GError *err = NULL;
+
+ lib_home_screen_homescreen_call_render_surface_to_area_allowed_sync(
+ mp_libHomeScreenHomescreen_Proxy,
+ surfaceId,
+ layoutArea,
+ &result,
+ NULL,
+ &err);
+
+ if (NULL != err)
+ {
+ fprintf(stderr, "Unable to call renderSurfaceToArea: %s\n", err->message);
+ }
+
+ return result;
+}
+
void LibHomeScreen::requestSurfaceIdToFullScreen(int surfaceId)
{
GError *err = NULL;