aboutsummaryrefslogtreecommitdiffstats
path: root/HomeScreen
diff options
context:
space:
mode:
authorBocklage, Jens <Jens_Bocklage@mentor.com>2016-11-03 20:23:10 +0100
committerBocklage, Jens <Jens_Bocklage@mentor.com>2016-11-03 20:23:10 +0100
commitec688535558c31989e7da221b858328b2e0766c8 (patch)
tree4ca00a485bdb4ecd8aebe87398e324510400b4c0 /HomeScreen
parent6656309e1ddf27c3e62fe5d599bee2beeddcbff1 (diff)
New concept of dynamically placing surfaces in static defined layout areas.v0.4.0
This is useful if an application wants to render more than one surface. By default, one surface is placed in one layout render area. With the new homescreen.xml introspection, apps can place their surfaces as they wish (limited to the boundries of the assigned layou render area!). The functionality is not fully implemented, but the shared lib already provides the interface. Signed-off-by: Bocklage, Jens <Jens_Bocklage@mentor.com>
Diffstat (limited to 'HomeScreen')
-rw-r--r--HomeScreen/src/homescreencontrolinterface.cpp18
-rw-r--r--HomeScreen/src/homescreencontrolinterface.h11
-rw-r--r--HomeScreen/src/layouthandler.cpp9
-rw-r--r--HomeScreen/src/layouthandler.h4
-rw-r--r--HomeScreen/src/main.cpp2
-rw-r--r--HomeScreen/src/mainwindow.cpp5
6 files changed, 37 insertions, 12 deletions
diff --git a/HomeScreen/src/homescreencontrolinterface.cpp b/HomeScreen/src/homescreencontrolinterface.cpp
index 057e742..bc66e53 100644
--- a/HomeScreen/src/homescreencontrolinterface.cpp
+++ b/HomeScreen/src/homescreencontrolinterface.cpp
@@ -24,6 +24,12 @@ HomeScreenControlInterface::~HomeScreenControlInterface()
delete mp_homeScreenAdaptor;
}
+QRect HomeScreenControlInterface::getLayoutRenderAreaForSurfaceId(int surfaceId)
+{
+ qDebug("getLayoutRenderAreaForSurfaceId %d", surfaceId);
+ return newRequestGetLayoutRenderAreaForSurfaceId(surfaceId);
+}
+
void HomeScreenControlInterface::hardKeyPressed(int key)
{
int pid = -1;
@@ -42,8 +48,14 @@ void HomeScreenControlInterface::hardKeyPressed(int key)
}
}
-void HomeScreenControlInterface::toggleFullScreen()
+void HomeScreenControlInterface::renderSurfaceToArea(int surfaceId, const QRect &renderArea)
+{
+ qDebug("requestSurfaceIdToFullScreen %d", surfaceId);
+ newRequestRenderSurfaceToArea(surfaceId, renderArea);
+}
+
+void HomeScreenControlInterface::requestSurfaceIdToFullScreen(int surfaceId)
{
- qDebug("toggleFullScreen");
- newRequestsToggleFullscreen();
+ qDebug("requestSurfaceIdToFullScreen %d", surfaceId);
+ newRequestSurfaceIdToFullScreen(surfaceId);
}
diff --git a/HomeScreen/src/homescreencontrolinterface.h b/HomeScreen/src/homescreencontrolinterface.h
index e341758..3203088 100644
--- a/HomeScreen/src/homescreencontrolinterface.h
+++ b/HomeScreen/src/homescreencontrolinterface.h
@@ -15,15 +15,18 @@ public:
~HomeScreenControlInterface();
signals:
-
-signals:
void newRequestsToBeVisibleApp(int pid);
- void newRequestsToggleFullscreen();
+
+ QRect newRequestGetLayoutRenderAreaForSurfaceId(int surfaceId);
+ void newRequestRenderSurfaceToArea(int surfaceId, const QRect &renderArea);
+ void newRequestSurfaceIdToFullScreen(int surfaceId);
//from homescreen_adapter.h
public Q_SLOTS: // METHODS
+ QRect getLayoutRenderAreaForSurfaceId(int surfaceId);
void hardKeyPressed(int key);
- void toggleFullScreen();
+ void renderSurfaceToArea(int surfaceId, const QRect &renderArea);
+ void requestSurfaceIdToFullScreen(int surfaceId);
private:
HomescreenAdaptor *mp_homeScreenAdaptor;
diff --git a/HomeScreen/src/layouthandler.cpp b/HomeScreen/src/layouthandler.cpp
index 3bfe533..0dac24f 100644
--- a/HomeScreen/src/layouthandler.cpp
+++ b/HomeScreen/src/layouthandler.cpp
@@ -169,9 +169,14 @@ void LayoutHandler::makeMeVisible(int surfaceId)
}
}
-void LayoutHandler::toggleFullscreen()
+void LayoutHandler::requestRenderSurfaceToArea(int surfaceId, const QRect &renderArea)
{
- qDebug("toggleFullscreen");
+ qDebug("requestRenderSurfaceToArea %d %d,%d,%d,%d", surfaceId, renderArea.x(), renderArea.y(), renderArea.width(), renderArea.height());
+}
+
+void LayoutHandler::requestSurfaceIdToFullScreen(int surfaceId)
+{
+ qDebug("requestSurfaceIdToFullScreen %d", surfaceId);
}
void LayoutHandler::setLayoutByName(QString layoutName)
diff --git a/HomeScreen/src/layouthandler.h b/HomeScreen/src/layouthandler.h
index 5763d44..ee400b7 100644
--- a/HomeScreen/src/layouthandler.h
+++ b/HomeScreen/src/layouthandler.h
@@ -18,7 +18,9 @@ signals:
public slots:
void makeMeVisible(int surfaceId);
- void toggleFullscreen();
+
+ void requestRenderSurfaceToArea(int surfaceId, const QRect &renderArea);
+ void requestSurfaceIdToFullScreen(int surfaceId);
void setLayoutByName(QString layoutName);
private:
diff --git a/HomeScreen/src/main.cpp b/HomeScreen/src/main.cpp
index a623fff..f1f5a22 100644
--- a/HomeScreen/src/main.cpp
+++ b/HomeScreen/src/main.cpp
@@ -36,7 +36,7 @@ int main(int argc, char *argv[])
QCoreApplication::setOrganizationDomain("LinuxFoundation");
QCoreApplication::setOrganizationName("AutomotiveGradeLinux");
QCoreApplication::setApplicationName("HomeScreen");
- QCoreApplication::setApplicationVersion("0.3.4");
+ QCoreApplication::setApplicationVersion("0.4.0");
qDebug("%s, v%s", QCoreApplication::applicationName().toStdString().c_str(), QCoreApplication::applicationVersion().toStdString().c_str());
diff --git a/HomeScreen/src/mainwindow.cpp b/HomeScreen/src/mainwindow.cpp
index c15cca5..f8dfe89 100644
--- a/HomeScreen/src/mainwindow.cpp
+++ b/HomeScreen/src/mainwindow.cpp
@@ -89,6 +89,7 @@ MainWindow::MainWindow(QWidget *parent) :
QObject::connect(mp_applauncherwidget, SIGNAL(newRequestsToBeVisibleApp(int)), mp_layoutHandler, SLOT(makeMeVisible(int)));
+
// apply color scheme
updateColorScheme();
@@ -100,7 +101,9 @@ MainWindow::MainWindow(QWidget *parent) :
mp_homeScreenControlInterface = new HomeScreenControlInterface(this);
QObject::connect(mp_homeScreenControlInterface, SIGNAL(newRequestsToBeVisibleApp(int)), mp_layoutHandler, SLOT(makeMeVisible(int)));
- QObject::connect(mp_homeScreenControlInterface, SIGNAL(newRequestsToggleFullscreen()), mp_layoutHandler, SLOT(toggleFullscreen()));
+ 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(newRequestSurfaceIdToFullScreen(int)), mp_layoutHandler, SLOT(requestSurfaceIdToFullScreen(int)));
QObject::connect(mp_popupWidget, SIGNAL(comboBoxResult(QString)), mp_layoutHandler, SLOT(setLayoutByName(QString)));
}