X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=HomeScreen%2Fsrc%2Flayouthandler.cpp;h=81bc1063809a3f9322b537764909df38a870e6f0;hb=d19555c038f6f1f89f08f12c88908d84b32b1bbf;hp=cb210186dff4a7f7fb950ece47170ff9dbda355d;hpb=4e34fd88f65f8c1cd094ed24bd62d2c7f5418080;p=staging%2FHomeScreen.git diff --git a/HomeScreen/src/layouthandler.cpp b/HomeScreen/src/layouthandler.cpp index cb21018..81bc106 100644 --- a/HomeScreen/src/layouthandler.cpp +++ b/HomeScreen/src/layouthandler.cpp @@ -36,6 +36,8 @@ void LayoutHandler::setUpLayouts() qDebug("setUpLayouts"); QList surfaceAreas; SimpleRect surfaceArea; + bool isFullScreen; + int associatedFullScreenLayout; const int SCREEN_WIDTH = 1080; const int SCREEN_HEIGHT = 1920; @@ -59,7 +61,10 @@ void LayoutHandler::setUpLayouts() surfaceAreas.append(surfaceArea); - mp_dBusWindowManagerProxy->addLayout(1, "one app", surfaceAreas); + isFullScreen = false; + associatedFullScreenLayout = 4; + + mp_dBusWindowManagerProxy->addLayout(1, "one app", isFullScreen, associatedFullScreenLayout, surfaceAreas); surfaceAreas.clear(); @@ -83,7 +88,10 @@ void LayoutHandler::setUpLayouts() surfaceAreas.append(surfaceArea); - mp_dBusWindowManagerProxy->addLayout(2, "top on bottom", surfaceAreas); + isFullScreen = false; + associatedFullScreenLayout = -1; + + mp_dBusWindowManagerProxy->addLayout(2, "top on bottom", isFullScreen, associatedFullScreenLayout, surfaceAreas); surfaceAreas.clear(); @@ -107,7 +115,30 @@ void LayoutHandler::setUpLayouts() surfaceAreas.append(surfaceArea); - mp_dBusWindowManagerProxy->addLayout(3, "side by side", surfaceAreas); + isFullScreen = false; + associatedFullScreenLayout = -1; + + mp_dBusWindowManagerProxy->addLayout(3, "side by side", isFullScreen, associatedFullScreenLayout, surfaceAreas); + + + surfaceAreas.clear(); + + // layout 4: + // one app surface full screen, no statusbar, no control bar + surfaceArea.x = 0; + surfaceArea.y = 0; + surfaceArea.width = SCREEN_WIDTH; + surfaceArea.height = SCREEN_HEIGHT; + + surfaceAreas.append(surfaceArea); + + isFullScreen = true; + associatedFullScreenLayout = 1; + + mp_dBusWindowManagerProxy->addLayout(4, "one app full screen", isFullScreen, associatedFullScreenLayout, surfaceAreas); + + + surfaceAreas.clear(); } @@ -136,7 +167,7 @@ void LayoutHandler::makeMeVisible(int pid) for (int i = 0; i < m_visibleApps.size(); ++i) { - mp_dBusWindowManagerProxy->setPidToLayoutArea(i, i); + mp_dBusWindowManagerProxy->setPidToLayoutArea(m_visibleApps.at(i), i); } } if (1 == availableLayouts.size()) @@ -149,7 +180,7 @@ void LayoutHandler::makeMeVisible(int pid) mp_dBusWindowManagerProxy->setLayoutById(availableLayouts.at(0)); for (int i = 0; i < m_visibleApps.size(); ++i) { - mp_dBusWindowManagerProxy->setPidToLayoutArea(i, i); + mp_dBusWindowManagerProxy->setPidToLayoutArea(m_visibleApps.at(i), i); } } if (1 < availableLayouts.size()) @@ -168,6 +199,25 @@ void LayoutHandler::makeMeVisible(int pid) } } +void LayoutHandler::toggleFullscreen() +{ + qDebug("toggleFullscreen"); + int currentLayout = mp_dBusWindowManagerProxy->getLayout(); + int associatedFullScreenLayout = mp_dBusWindowManagerProxy->getAssociatedFullScreenLayout(currentLayout); + if (-1 != associatedFullScreenLayout) + { + mp_dBusWindowManagerProxy->setLayoutById(associatedFullScreenLayout); + for (int i = 0; i < m_visibleApps.size(); ++i) + { + mp_dBusWindowManagerProxy->setPidToLayoutArea(m_visibleApps.at(i), i); + } + } + else + { + qDebug("no associatedFullScreenLayout. Cannot switch to full screen."); + } +} + void LayoutHandler::setLayoutByName(QString layoutName) { // switch to new layout