#include "FUi_ControlImplManager.h"
#include "FUiCtrl_Popup.h"
#include "FUiCtrl_ContextMenu.h"
+#include "FUiAnim_DisplayContextImpl.h"
+#include "FUiAnimDisplayContext.h"
+#include "FUi_TouchManager.h"
using namespace Tizen::Base;
using namespace Tizen::Base::Runtime;
Ecore_X_Window targetWin = (Ecore_X_Window) ecore_evas_window_get(pEcoreEvas);
- SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x] OnWindowStateChanged is called.", targetWin);
+ SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] OnWindowStateChanged is called.", targetWin);
- int winCount = pControlManager->GetWindowCount();
+ int winCount = pControlManager->GetAllWindowCount();
for (int i = 0; i < winCount; i++)
{
- _Window* pWindow = pControlManager->GetWindow(i);
+ _Window* pWindow = pControlManager->GetAllWindow(i);
if (!pWindow)
{
continue;
if (pWindow->IsOrientationRoot() == true)
{
_Frame* pFrame = static_cast<_Frame*>(pWindow);
+ _DisplayContextImpl* pContext = _DisplayContextImpl::GetInstance(*pFrame->GetDisplayContext());
+ _EflLayer* pLayer = static_cast<_EflLayer*>(pContext->GetNativeLayer());
+
Ecore_X_Window_State_Hint state = ecore_x_icccm_state_get(targetWin);
switch (state)
{
case ECORE_X_WINDOW_STATE_HINT_WITHDRAWN:
+ pLayer->SetRenderNeeded(false);
// Frame was hidden.
break;
case ECORE_X_WINDOW_STATE_HINT_ICONIC:
+ pLayer->SetRenderNeeded(false);
pFrame->OnFrameMinimized();
break;
case ECORE_X_WINDOW_STATE_HINT_NORMAL:
+ pLayer->SetRenderNeeded(true);
pFrame->OnFrameRestored();
break;
default:
return EINA_FALSE;
}
+int frameX = 0;
+int frameY = 0;
+int frameW = 0;
+int frameH = 0;
+
+Eina_Bool
+OnWindowConfigured(void* pData, int type, void* pEvent)
+{
+ Ecore_X_Event_Window_Configure* pEv = (Ecore_X_Event_Window_Configure*)pEvent;
+ if (!pEv)
+ {
+ return ECORE_CALLBACK_PASS_ON;
+ }
+
+ if (pEv->from_wm == EINA_FALSE)
+ {
+ return ECORE_CALLBACK_PASS_ON;
+ }
+
+ Ecore_X_Window targetWin = pEv->win;
+ if (targetWin == 0)
+ {
+ return ECORE_CALLBACK_PASS_ON;
+ }
+
+ if ((frameX == pEv->x) && (frameY == pEv->y) && (frameW == pEv->w) && (frameH == pEv->h))
+ {
+ return ECORE_CALLBACK_PASS_ON;
+ }
+
+ frameX = pEv->x;
+ frameY = pEv->y;
+ frameW = pEv->w;
+ frameH = pEv->h;
+
+ _ControlManager* pControlManager = _ControlManager::GetInstance();
+ if (!pControlManager)
+ {
+ return ECORE_CALLBACK_PASS_ON;
+ }
+
+ _TouchManager* pTouchManager = _TouchManager::GetInstance();
+ if (!pTouchManager)
+ {
+ return ECORE_CALLBACK_PASS_ON;
+ }
+
+ if (pTouchManager->GetPointCount() > 0)
+ {
+ return ECORE_CALLBACK_PASS_ON;
+ }
+
+ _Window* pWindow = pControlManager->GetCurrentFrame();
+ if (!pWindow)
+ {
+ return ECORE_CALLBACK_PASS_ON;
+ }
+
+ if (pWindow->IsOrientationRoot() == false)
+ {
+ return ECORE_CALLBACK_PASS_ON;
+ }
+
+ _Frame* pFrame = static_cast<_Frame*>(pWindow);
+ if (pFrame->GetShowMode() == FRAME_SHOW_MODE_FULL_SCREEN)
+ {
+ return ECORE_CALLBACK_PASS_ON;
+ }
+
+ Ecore_X_Window win = (Ecore_X_Window)pFrame->GetNativeHandle();
+ if (win != targetWin)
+ {
+ return ECORE_CALLBACK_PASS_ON;
+ }
+
+ _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
+ if (!pEcoreEvas)
+ {
+ return ECORE_CALLBACK_PASS_ON;
+ }
+
+ Rectangle frameBounds = pFrame->GetBounds();
+ int rotation = pEcoreEvas->GetWindowRotation(*pFrame);
+
+ Dimension winSize = _CoordinateSystemUtils::InverseTransform(Dimension(pEv->w, pEv->h));
+ Dimension newSize(winSize.width, winSize.height);
+ if ((rotation == 270) || (rotation == 90))
+ {
+ newSize.width = winSize.height;
+ newSize.height = winSize.width;
+ }
+
+ if ((frameBounds.width != newSize.width) || (frameBounds.height != newSize.height))
+ {
+ return ECORE_CALLBACK_PASS_ON;
+ }
+
+ Dimension screenSize = pControlManager->GetScreenSize();
+ Point winPosition = _CoordinateSystemUtils::InverseTransform(Point(pEv->x, pEv->y));
+
+ Point newPosition(0, 0);
+ switch (rotation)
+ {
+ case 270:
+ newPosition.x = winPosition.y;
+ newPosition.y = screenSize.width - winPosition.x - frameBounds.height;
+ break;
+ case 180:
+ newPosition.x = screenSize.width - winPosition.x - frameBounds.width;
+ newPosition.y = screenSize.height - winPosition.y - frameBounds.height;
+ break;
+ case 90:
+ newPosition.x = screenSize.height - winPosition.y - frameBounds.width;
+ newPosition.y = winPosition.x;
+ break;
+ default:
+ newPosition.x = winPosition.x;
+ newPosition.y = winPosition.y;
+ break;
+ }
+
+ if ((frameBounds.x != newPosition.x) || (frameBounds.y != newPosition.y))
+ {
+ pFrame->SetChangingBoundsEnabled(false);
+ pFrame->SetPosition(newPosition);
+ pFrame->SetChangingBoundsEnabled(true);
+ }
+
+ return ECORE_CALLBACK_PASS_ON;
+}
+
Eina_Bool
OnWindowShown(void* pData, int type, void* pEvent)
{
_AccessibilityGesture::ProcessGesture(_ACCESSIBILITY_GESTURE_TYPE_TWO_FINGER_PANNING_FINISHED, x, y);
}
}
+ else if ((unsigned int)pClientEvent->data.l[1] == ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_SCROLL)
+ {
+ SysLog(NID_UI, "Accessibility action : scroll %d, %d, %d", pClientEvent->data.l[2], pClientEvent->data.l[3], pClientEvent->data.l[4]);
+ x = (Evas_Coord)pClientEvent->data.l[3];
+ y = (Evas_Coord)pClientEvent->data.l[4];
+ if (pClientEvent->data.l[2] == 0)
+ {
+ _AccessibilityGesture::ProcessGesture(_ACCESSIBILITY_GESTURE_TYPE_TWO_FINGER_PANNING_STARTED, x, y);
+ }
+ else if (pClientEvent->data.l[2] == 1)
+ {
+ _AccessibilityGesture::ProcessGesture(_ACCESSIBILITY_GESTURE_TYPE_TWO_FINGER_PANNING_CHANGED, x, y);
+ }
+ else if (pClientEvent->data.l[2] == 2)
+ {
+ _AccessibilityGesture::ProcessGesture(_ACCESSIBILITY_GESTURE_TYPE_TWO_FINGER_PANNING_FINISHED, x, y);
+ }
+ }
else if ((unsigned int)pClientEvent->data.l[1] == ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_DOWN)
{
SysLog(NID_UI, "Accessibility action : value decreased");
: __pWindowVisibilityChanged(null)
, __pWindowPropertyChanged(null)
, __pWindowShown(null)
+ , __pWindowConfigured(null)
, __pClientMessageReceived(null)
, __pClearClip(null)
, __pNotifyClip(null)
, __openClipboard(false)
{
int ret = appcore_unset_rotation_cb();
- SysLog(NID_UI, "[Window Manager Rotation] appcore_unset_rotation_cb = %d", ret);
+ SysLog(NID_UI, "[WM ROTATION] appcore_unset_rotation_cb = %d", ret);
__pWindowVisibilityChanged = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_VISIBILITY_CHANGE, OnWindowVisibilityChanged, (void*) this);
SysTryReturnVoidResult(NID_UI, __pWindowVisibilityChanged, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
__pWindowShown = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHOW, OnWindowShown, (void*) this);
SysTryCatch(NID_UI, __pWindowShown, , E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+ __pWindowConfigured = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_CONFIGURE, OnWindowConfigured, NULL);
+ SysTryCatch(NID_UI, __pWindowConfigured, , E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
__pWindowPropertyChanged = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY, OnWindowPropertyChanged, NULL);
SysTryCatch(NID_UI, __pWindowPropertyChanged, , E_SYSTEM, "[E_SYSTEM] A system error occurred.");
ecore_event_handler_del(__pWindowShown);
__pWindowShown = null;
}
+
+ if (__pWindowConfigured)
+ {
+ ecore_event_handler_del(__pWindowConfigured);
+ __pWindowConfigured = null;
+ }
}
_EcoreEvas::~_EcoreEvas(void)
__pWindowShown = null;
}
+ if (__pWindowConfigured)
+ {
+ ecore_event_handler_del(__pWindowConfigured);
+ __pWindowConfigured = null;
+ }
+
if (__pClientMessageReceived)
{
ecore_event_handler_del(__pClientMessageReceived);
rotatePartial = false;
}
- Evas_Object* pWinObj = pLayer->GetElmWin();
Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pEcoreEvas);
int rootW = 0;
if (rotateEvas == true)
{
ecore_evas_rotation_with_resize_set(pEcoreEvas, orientation);
- }
- evas_object_move(pWinObj, 0, 0);
- if ((orientation == 0) || (orientation == 180))
- {
- evas_object_resize(pWinObj, rootW, rootH);
- }
- else
- {
- evas_object_resize(pWinObj, rootH, rootW);
- }
+ if ((orientation == 0) || (orientation == 180))
+ {
+ pLayer->SetBounds(FloatRectangle(0, 0, rootW, rootH));
+ }
+ else
+ {
+ pLayer->SetBounds(FloatRectangle(0, 0, rootH, rootW));
+ }
- SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x, FULL SCREEN] Rotate bounds(rot = %d).", win, orientation);
+ SysLog(NID_UI, "[WM ROTATION][WIN 0x%x, FULL SCREEN] Rotate bounds(ROT %d).", win, orientation);
+ }
}
else
{
Rectangle winBounds = _CoordinateSystemUtils::Transform(window.GetBounds());
int rotate = ecore_evas_rotation_get(pEcoreEvas);
-
int winX = winBounds.x;
int winY = winBounds.y;
int h = 0;
Eina_Bool ret = ecore_x_e_window_rotation_geometry_get(win, rotate, &x, &y, &w, &h);
- evas_object_move(pWinObj, winX, winY);
if (ret == EINA_FALSE)
{
- evas_object_resize(pWinObj, winBounds.width, winBounds.height);
- SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x, PARTIAL SCREEN] Rotate bounds(rot = %d, %d, %d, %d, %d).", win, orientation, winX, winY, winBounds.width, winBounds.height);
+ pLayer->SetBounds(FloatRectangle(winX, winY, winBounds.width, winBounds.height));
+ SysLog(NID_UI, "[WM ROTATION][WIN 0x%x, PARTIAL SCREEN] Rotate bounds(ROT %d, %d, %d, %d, %d).", win, orientation, winX, winY, winBounds.width, winBounds.height);
}
else
{
- SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x, PARTIAL SCREEN] Rotate bounds(rot = %d, %d, %d) ONLY MOVE.", win, orientation, winX, winY);
+ pLayer->SetBounds(FloatRectangle(winX, winY, w, h));
+ SysLog(NID_UI, "[WM ROTATION][WIN 0x%x, PARTIAL SCREEN] Rotate bounds(ROT %d, %d, %d) ONLY MOVE.", win, orientation, winX, winY);
}
}
}
void
_EcoreEvas::SetOwner(NativeWindowHandle ownee, NativeWindowHandle owner)
{
- ecore_x_icccm_transient_for_unset(ownee);
- ecore_x_icccm_transient_for_set(ownee, owner);
-
- SysLog(NID_UI, "[Window Order Group][Window : 0x%x] transient_for_set -> 0x%x", ownee, owner);
+ Ecore_X_Window win = ecore_x_icccm_transient_for_get(ownee);
+ if (win != owner)
+ {
+ ecore_x_icccm_transient_for_unset(ownee);
+ ecore_x_icccm_transient_for_set(ownee, owner);
+ SysLog(NID_UI, "[WIN ORDER][WIN 0x%x] transient_for_set -> 0x%x", ownee, owner);
+ }
}
void
return __openClipboard;
}
+String
+_EcoreEvas::ConvertMarkupToUtf8(const String& string)
+{
+ char* pChar = _Clipboard::GetInstance()->EncodeToCharN(string);
+ if (!pChar)
+ {
+ return String(L"");
+ }
+
+ char* pTempChar = evas_textblock_text_markup_to_utf8(NULL, pChar);
+ SysLog(NID_UI, "[Clipboard] markup[%s] -> utf8[%s]", pChar, pTempChar);
+ free(pChar);
+
+ String str(pTempChar);
+ free(pTempChar);
+
+ return str;
+}
+
result
_EcoreEvas::SetEventPropagation(const _Control& control, bool enable)
{
Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pEcoreEvas);
ecore_x_icccm_transient_for_unset(win);
+ SysLog(NID_UI, "[WIN ORDER][WIN 0x%x] transient_for_unset", win);
if (level == _WINDOW_LEVEL_NORMAL)
{
ecore_x_netwm_window_type_set(win, ECORE_X_WINDOW_TYPE_NORMAL);
+ SysLog(NID_UI, "[WIN ORDER][WIN 0x%x] set : ECORE_X_WINDOW_TYPE_NORMAL", win);
}
else if (level == _WINDOW_LEVEL_NOTIFICATION_HIGH)
{
ecore_x_netwm_window_type_set(win, ECORE_X_WINDOW_TYPE_NOTIFICATION);
utilx_set_system_notification_level((Display*)ecore_x_display_get(), win, UTILX_NOTIFICATION_LEVEL_HIGH);
+ SysLog(NID_UI, "[WIN ORDER][WIN 0x%x] set : ECORE_X_WINDOW_TYPE_NOTIFICATION, UTILX_NOTIFICATION_LEVEL_HIGH", win);
}
else if (level == _WINDOW_LEVEL_NOTIFICATION_MIDDLE)
{
ecore_x_netwm_window_type_set(win, ECORE_X_WINDOW_TYPE_NOTIFICATION);
utilx_set_system_notification_level((Display*)ecore_x_display_get(), win, UTILX_NOTIFICATION_LEVEL_NORMAL);
+ SysLog(NID_UI, "[WIN ORDER][WIN 0x%x] set : ECORE_X_WINDOW_TYPE_NOTIFICATION, UTILX_NOTIFICATION_LEVEL_NORMAL", win);
}
SetLastResult(E_SUCCESS);
int rotate = ecore_evas_rotation_get(pEcoreEvas);
- _Window* pWindow = const_cast<_Window*>(&window);
-
- _ContextMenu* pContextMenu = dynamic_cast<_ContextMenu*>(pWindow);
- if (pContextMenu)
+// _Window* pWindow = const_cast<_Window*>(&window);
+// _ContextMenu* pContextMenu = dynamic_cast<_ContextMenu*>(pWindow);
+// if (pContextMenu)
+ if ((window.IsOrientationRoot() == false) && (window.IsRotationSynchronized() == false))
{
- // [Exception]
- // ContextMenu
- // Skip
-
_ControlManager* pControlManager = _ControlManager::GetInstance();
if (pControlManager)
{
int h = 0;
Eina_Bool ret = ecore_x_e_window_rotation_geometry_get(win, rotate, &x, &y, &w, &h);
- evas_object_move(pWinObject, winX, winY);
if (ret == EINA_FALSE)
{
- evas_object_resize(pWinObject, winBounds.width, winBounds.height);
- SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x] Set bounds(rot = %d, %d, %d, %d, %d).", win, rotate, winX, winY, winBounds.width, winBounds.height);
+ pLayer->SetBounds(FloatRectangle(winX, winY, winBounds.width, winBounds.height));
+ SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set bounds(ROT %d, %d, %d, %d, %d).", win, rotate, winX, winY, winBounds.width, winBounds.height);
}
else
{
- SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x] Set bounds(rot = %d, %d, %d) ONLY MOVE.", win, rotate, winX, winY);
+ pLayer->SetBounds(FloatRectangle(winX, winY, w, h));
+ SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set bounds(ROT %d, %d, %d, %d, %d) ONLY MOVE.", win, rotate, winX, winY, w, h);
}
SetLastResult(E_SUCCESS);
int rotate = ecore_evas_rotation_get(pEcoreEvas);
- _Window* pWindow = const_cast<_Window*>(&window);
-
- _ContextMenu* pContextMenu = dynamic_cast<_ContextMenu*>(pWindow);
- if (pContextMenu)
+// _Window* pWindow = const_cast<_Window*>(&window);
+// _ContextMenu* pContextMenu = dynamic_cast<_ContextMenu*>(pWindow);
+// if (pContextMenu)
+ if ((window.IsOrientationRoot() == false) && (window.IsRotationSynchronized() == false))
{
- // [Exception]
- // ContextMenu
- // Skip
-
_ControlManager* pControlManager = _ControlManager::GetInstance();
if (pControlManager)
{
int h = 0;
Eina_Bool ret = ecore_x_e_window_rotation_geometry_get(win, rotate, &x, &y, &w, &h);
- evas_object_move(pWinObject, winX, winY);
if (ret == EINA_FALSE)
{
- evas_object_resize(pWinObject, winBounds.width, winBounds.height);
- SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x] Set bounds(rot = %d, %d, %d, %d, %d).", win, rotate, winX, winY, winBounds.width, winBounds.height);
+ pLayer->SetBounds(FloatRectangle(winX, winY, winBounds.width, winBounds.height));
+ SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set bounds(ROT %d, %d, %d, %d, %d).", win, rotate, winX, winY, winBounds.width, winBounds.height);
}
else
{
- SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x] Set bounds(rot = %d, %d, %d) ONLY MOVE.", win, rotate, winX, winY);
+ pLayer->SetBounds(FloatRectangle(winX, winY, w, h));
+ SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set bounds(ROT %d, %d, %d, %d, %d) ONLY MOVE.", win, rotate, winX, winY, w, h);
}
SetLastResult(E_SUCCESS);
ecore_x_netwm_window_type_get(owneeWin, &type);
if ((type == ECORE_X_WINDOW_TYPE_NORMAL) || (type == ECORE_X_WINDOW_TYPE_UTILITY))
{
- ecore_x_icccm_transient_for_unset(owneeWin);
- ecore_x_icccm_transient_for_set(owneeWin, ownerWin);
- SysLog(NID_UI, "[Window Order Group][Window : 0x%x] transient_for_set -> 0x%x", owneeWin, ownerWin);
+ Ecore_X_Window win = ecore_x_icccm_transient_for_get(owneeWin);
+ if (win != ownerWin)
+ {
+ ecore_x_icccm_transient_for_unset(owneeWin);
+ ecore_x_icccm_transient_for_set(owneeWin, ownerWin);
+ SysLog(NID_UI, "[WIN ORDER][WIN 0x%x] transient_for_set -> 0x%x", owneeWin, ownerWin);
+ }
}
else
{
- SysLog(NID_UI, "[Window Order Group][Window : 0x%x] Skip to transient_for_set", owneeWin);
+ SysLog(NID_UI, "[WIN ORDER][WIN 0x%x] Skip to transient_for_set", owneeWin);
}
// Ownee window
bool preferredRoation = pOwnerWindow->GetPreferredRotation();
if (preferredRoation == true)
{
- int preferredRotation = ecore_evas_wm_rotation_preferred_rotation_get(pOwnerLayer->GetEcoreEvas());
+ //int preferredRotation = ecore_evas_wm_rotation_preferred_rotation_get(pOwnerLayer->GetEcoreEvas());
+ int preferredRotation = 0;
+ ecore_x_e_window_rotation_preferred_rotation_get(ownerWin, &preferredRotation);
SetWindowPreferredRotation(ownee, preferredRotation);
}
else
{
ecore_x_e_window_rotation_app_set(win, EINA_TRUE);
}
- SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x] Set window preferred rotation(%d).", win, rotation);
+ SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set window preferred rotation(%d).", win, rotation);
ecore_evas_wm_rotation_preferred_rotation_set(pLayer->GetEcoreEvas(), rotation);
_Window* pWindow = const_cast<_Window*>(&window);
ecore_x_e_window_rotation_app_set(win, EINA_TRUE);
}
- SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x] Set window available rotation(%d).", win, count);
+ SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set window available rotation(%d).", win, count);
ecore_evas_wm_rotation_available_rotations_set(pLayer->GetEcoreEvas(), rotations, count);
}
Rectangle winBounds = _CoordinateSystemUtils::Transform(bounds);
Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pLayer->GetEcoreEvas());
- SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x] Set rotation bounds(rot = %d, %d, %d, %d, %d).", win, rotation, winBounds.x, winBounds.y, winBounds.width, winBounds.height);
+ SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set rotation bounds(ROT %d, %d, %d, %d, %d).", win, rotation, winBounds.x, winBounds.y, winBounds.width, winBounds.height);
ecore_x_e_window_rotation_geometry_set(win, rotation, winBounds.x, winBounds.y, winBounds.width, winBounds.height);
}
Rectangle winBounds = _CoordinateSystemUtils::ConvertToInteger(winBoundsF);
Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pLayer->GetEcoreEvas());
- SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x] Set rotation bounds(rot = %d, %d, %d, %d, %d).", win, rotation, winBounds.x, winBounds.y, winBounds.width, winBounds.height);
+ SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set rotation bounds(ROT %d, %d, %d, %d, %d).", win, rotation, winBounds.x, winBounds.y, winBounds.width, winBounds.height);
ecore_x_e_window_rotation_geometry_set(win, rotation, winBounds.x, winBounds.y, winBounds.width, winBounds.height);
}