// Open Service Platform
// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
//
-// Licensed under the Flora License, Version 1.0 (the License);
+// Licensed under the Apache License, Version 2.0 (the License);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
-// http://floralicense.org/license/
+// http://www.apache.org/licenses/LICENSE-2.0/
//
// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
+// distributed under the License is distributed on an ”AS IS” BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
SysLog(NID_UI, "The initial value of device orientation is %d.", degree);
__pInstance->__screenRotation = ::Convert(degree);
-
- elm_init(0, null);
}
void
delete __pInstance;
__pInstance = null;
-
- elm_shutdown();
}
_ControlManager*
, __gestureMaxDuration(0)
, __touchedWindow(0)
, __isDefaultFontChanged(false)
+ , __isSystemFontChanged(false)
, __defaultFontName(L"")
, __screenDpi(0)
+ , __pClipboardOwner(null)
{
result r = GetAppCoordinateSystem(__isCoordinateSystemLogical, __logicalCoordinateSystem, __logicalBaseScreenSize);
SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] System error occurred.");
pEcoreEvas->RotateWindow(window, ::Convert(__orientationStatus));
}
#else
+ // Rotate partial window without Window State Changed Callback.
+
_EcoreEvas* pEcoreEvas = ::GetEcoreEvasMgr()->GetEcoreEvas();
if (pEcoreEvas)
{
+#if !defined(WINDOW_OWNEE_PREFERRED)
+ window.ChangeLayout(GetOrientation());
+ pEcoreEvas->RotateWindow(window, ::Convert(__orientationStatus));
+// window.SetRotation(::Convert(__orientationStatus));
+// window.Invalidate(true);
+
pEcoreEvas->SetWindowPreferredRotation(window, ::Convert(__orientationStatus));
+#else
+ pEcoreEvas->SetWindowPreferredRotation(window, ::Convert(__orientationStatus));
+#endif
}
#endif
}
r = CallOnAttachedToMainTree(window);
SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ if (window.IsDimmingEnabled())
+ {
+ r = _DimmingManager::GetInstance()->ShowDimmingLayer(&window);
+ SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ }
+
return E_SUCCESS;
}
_TouchManager* pTouchManager = _TouchManager::GetInstance();
if (pTouchManager)
{
- pTouchManager->SetTouchCanceled(true);
+ pTouchManager->SetTouchCanceled(null);
}
}
}
return __pFocusedControl;
}
+void
+_ControlManager::SetClipboardOwner(_Window* pOwner)
+{
+ __pClipboardOwner = pOwner;
+}
+
+_Window*
+_ControlManager::GetClipboardOwner(void) const
+{
+ if (__pClipboardOwner)
+ {
+ return __pClipboardOwner;
+ }
+
+ return GetCurrentFrame();
+}
+
_Control*
_ControlManager::GetTopmostTouchedControl(const Point& point)
{
_Control* pControl = null;
_Window* pTopWindow = null;
+ _TouchManager* pTouchManager = _TouchManager::GetInstance();
+ SysTryReturn(NID_UI, pTouchManager, null, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
+ _Control* pCapturedControl = pTouchManager->GetCapturedControl();
+
+ if (pCapturedControl)
+ {
+ if (pTouchManager->IsCaptureAllowedOwnerBounds())
+ {
+ if (pTouchManager->IsCaptureAllowedOutOfBounds())
+ {
+ pControl = pCapturedControl;
+ }
+
+ _Window * pWindow = dynamic_cast<_Window*>(pCapturedControl);
+ if (pWindow)
+ {
+ _Control* pOwner = pWindow->GetOwner();
+ if (pOwner)
+ {
+ Tizen::Graphics::Rectangle ownerRc(pOwner->GetAbsoluteBounds());
+ if ((point.x >= ownerRc.x) && (point.x <= (ownerRc.x + ownerRc.width)) && (point.y >= ownerRc.y) && (point.y <= (ownerRc.y + ownerRc.height)))
+ {
+ pControl = pOwner;
+ }
+ }
+ }
+
+ Tizen::Graphics::Rectangle rc(pCapturedControl->GetAbsoluteBounds());
+ if ((point.x >= rc.x) && (point.x <= (rc.x + rc.width)) && (point.y >= rc.y) && (point.y <= (rc.y + rc.height)))
+ {
+ pControl = pCapturedControl;
+ }
+ }
+ else
+ {
+ if (pTouchManager->IsCaptureAllowedOutOfBounds())
+ {
+ pControl = pCapturedControl;
+ }
+ else
+ {
+ Tizen::Graphics::Rectangle rc(pCapturedControl->GetAbsoluteBounds());
+
+ if ((point.x < rc.x) || (point.x > (rc.x + rc.width)) || (point.y < rc.y) || (point.y > (rc.y + rc.height)))
+ {
+ pControl = pCapturedControl;
+ }
+ }
+ }
+
+ if (pControl != null)
+ {
+ return pControl;
+ }
+ }
+
int count = GetWindowCount();
if (count != 0)
{
return __defaultFontFileName;
}
bool
-_ControlManager::IsDefaultFontChanged(void)
+_ControlManager::IsDefaultFontChanged(void) const
{
return __isDefaultFontChanged;
}
+bool
+_ControlManager::IsSystemFontChanged(void) const
+{
+ return __isSystemFontChanged;
+}
+
void
_ControlManager::SetDefaultFontChangeState(bool isDefaultFontChanged)
{
if (key == FONT_TYPE || key == LOCALE_COUNTRY || key == LOCALE_LANGUAGE)
{
_FontImpl::UpdateDefaultFont(key);
+ __isSystemFontChanged = true;
+ struct _Visitor
+ : public _Control::Visitor
+ {
+ virtual _Control::VisitType Visit(_Control& control)
+ {
+ control.GetFallbackFont();
+ _IControlDelegate& delegate = control.GetControlDelegate();
+ delegate.OnFontChanged(control.__pFont);
+ return _Control::VISIT_DOWNWARD;
+ }
+ };
+
+ _Visitor visitor;
int count = GetWindowCount();
+ for (int j = 0; j < count; j++)
+ {
+ _Window* pWindow = GetWindow((count-1) - j);
+ pWindow->Accept(visitor);
+ }
+ __isSystemFontChanged = false;
for(int index = 0; index < count ; index++)
{
_Window* pWindow = GetWindow(index);