diff -r e5618cc85d74 -r 6c158198356e javauis/eswt_akn/eswtdirectcontent/native/src/swtdccontrol.cpp --- a/javauis/eswt_akn/eswtdirectcontent/native/src/swtdccontrol.cpp Thu Jul 15 18:31:06 2010 +0300 +++ b/javauis/eswt_akn/eswtdirectcontent/native/src/swtdccontrol.cpp Thu Aug 19 09:48:13 2010 +0300 @@ -39,7 +39,9 @@ { ERedraw, ESetFullScreen, - EUpdateFullScreen + EUpdateFullScreen, + EFixUIOrientation, + EUnFixUIOrientation }; /////////////////////////////////////////////////////////////////////////////// @@ -53,6 +55,7 @@ , iDsaWasStartedAlready(EFalse) #endif , iDcObserver(NULL) + , iFixedOrientationSet(EFalse) { SetFocusing(EFalse); } @@ -85,6 +88,12 @@ iDcObserver = NULL; } + if (iFixedOrientationSet) + { + iDisplay.UiUtils().UnRegisterFixScreenOrientation(); + iFixedOrientationSet = EFalse; + } + DEBUG("CSwtDCControl::~CSwtDCControl()-"); } @@ -543,6 +552,18 @@ return GetShell().Control()->GetBounds(); } +void CSwtDCControl::MdcFixUIOrientation(TBool aEnableFix) +{ + if (aEnableFix) + { + iDcObserver->InvokeDcEvent(*this, EFixUIOrientation); + } + else + { + iDcObserver->InvokeDcEvent(*this, EUnFixUIOrientation); + } +} + #ifdef SWTDCCONTROL_DSA_ENABLED void CSwtDCControl::Restart(RDirectScreenAccess::TTerminationReasons /*aReason*/) { @@ -801,6 +822,24 @@ return iContent && iContent->MdcFrameBuffer() != 0; } +void CSwtDCControl::FixUIOrientation() +{ + if (!iFixedOrientationSet) + { + iDisplay.UiUtils().RegisterFixScreenOrientation(); + iFixedOrientationSet = ETrue; + } +} + +void CSwtDCControl::UnFixUIOrientation() +{ + if (iFixedOrientationSet) + { + iDisplay.UiUtils().UnRegisterFixScreenOrientation(); + iFixedOrientationSet = EFalse; + } +} + /** * Receives asynchronous events from iDcObserver */ @@ -817,6 +856,12 @@ case EUpdateFullScreen: UpdateFullScreenState(); break; + case EFixUIOrientation: + FixUIOrientation(); + break; + case EUnFixUIOrientation: + UnFixUIOrientation(); + break; } }