From a4c3638958f7956b5eb0323a452845e3a6a85c8e Mon Sep 17 00:00:00 2001 From: GiWoong Kim Date: Mon, 22 Jun 2015 17:39:29 +0900 Subject: [PATCH] display: notify angle to sensor device on Qt GUI Change-Id: Ieeeb2f894937f8a25a7f6d37b4d5df98e55d595b Signed-off-by: GiWoong Kim --- tizen/src/ui/displaybase.cpp | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/tizen/src/ui/displaybase.cpp b/tizen/src/ui/displaybase.cpp index 3772ae7675..3bd885a772 100644 --- a/tizen/src/ui/displaybase.cpp +++ b/tizen/src/ui/displaybase.cpp @@ -31,6 +31,11 @@ #include "displaybase.h" #include "mainwindow.h" +extern "C" { +#include "emul_state.h" +#include "skin/maruskin_operation.h" +} + #define BLANK_GUIDE_IMAGE_PATH "../images/" #define BLANK_GUIDE_IMAGE_NAME "blank-guide.png" @@ -117,9 +122,30 @@ void DisplayBase::switchForm(DisplayType *displayForm) { qDebug() << "display switch angle :" << displayForm->getAngle(); + qt5_window_angle = rotateAngle = displayForm->getAngle(); + rect = displayForm->getRect(); maskImage = displayForm->getMask(); - qt5_window_angle = rotateAngle = displayForm->getAngle(); + + /* update sensor */ + // TODO: use degree + switch(rotateAngle) { + case 0: + do_rotation_event(ROTATION_PORTRAIT); + break; + case 90: + do_rotation_event(ROTATION_REVERSE_LANDSCAPE); + break; + case 180: + do_rotation_event(ROTATION_REVERSE_PORTRAIT); + break; + case 270: + do_rotation_event(ROTATION_LANDSCAPE); + break; + default: + qWarning() << "invalid angle :" << rotateAngle; + break; + } updateGeometry(); update(); -- 2.34.1