From: GiWoong Kim Date: Mon, 22 Jun 2015 08:39:29 +0000 (+0900) Subject: display: notify angle to sensor device on Qt GUI X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.2~353 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a4c3638958f7956b5eb0323a452845e3a6a85c8e;p=sdk%2Femulator%2Fqemu.git display: notify angle to sensor device on Qt GUI Change-Id: Ieeeb2f894937f8a25a7f6d37b4d5df98e55d595b Signed-off-by: GiWoong Kim --- 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();