Modified the setter function, Modified the process of keyboard event
authorJongwooLee <jongwoo718.lee@samsung.com>
Fri, 14 Jun 2013 07:31:29 +0000 (16:31 +0900)
committerJongwooLee <jongwoo718.lee@samsung.com>
Fri, 14 Jun 2013 08:13:51 +0000 (17:13 +0900)
Change-Id: Id22bd88475fea71e6595a5ab9bbeb0d6eef68674
Signed-off-by: JongwooLee <jongwoo718.lee@samsung.com>
src/ui/controls/FUiCtrl_Gallery.cpp
src/ui/controls/FUiCtrl_GalleryCanvas.cpp
src/ui/controls/FUiCtrl_GalleryPresenter.cpp
src/ui/controls/FUiCtrl_GalleryRenderer.cpp

index 3add95d..7d1b538 100644 (file)
@@ -711,7 +711,7 @@ _Gallery::OnSettingChanged(Tizen::Base::String& key)
 bool
 _Gallery::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
 {
-       bool r = false;
+       bool returnValue = false;
        bool keyPressed = false;
 
        if (keyInfo.GetKeyCode() == _KEY_ENTER
@@ -722,14 +722,15 @@ _Gallery::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
        {
                if (__keyEventProcessing == true)
                {
+                       Invalidate();
                        return true;
                }
 
                keyPressed = true;
                _GalleryViewEventInfo viewEventInfo;
                _GalleryViewEvent pressedEvent(GALLERY_VIEW_EVENT_TOUCH_PRESSED, &viewEventInfo);
-               r = GetPresenter().PostEvent(pressedEvent);
-               SysTryReturn(NID_UI_CTRL, r == true, false, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+               returnValue = GetPresenter().PostEvent(pressedEvent);
+               SysTryReturn(NID_UI_CTRL, returnValue == true, false, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
 
                __keyEventProcessing = true;
        }
@@ -744,8 +745,11 @@ _Gallery::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
                viewEventInfo.SetFlicked(true);
                viewEventInfo.SetFlickTime(1);
                _GalleryViewEvent viewEvent(GALLERY_VIEW_EVENT_TOUCH_FLICK, &viewEventInfo);
-               r = GetPresenter().PostEvent(viewEvent);
-               SysTryReturn(NID_UI_CTRL, r == true, false, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+               returnValue = GetPresenter().PostEvent(viewEvent);
+               if (returnValue == false)
+               {
+                       __keyEventProcessing = false;
+               }
 
                break;
        }
@@ -758,8 +762,11 @@ _Gallery::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
                viewEventInfo.SetFlicked(true);
                viewEventInfo.SetFlickTime(1);
                _GalleryViewEvent viewEvent(GALLERY_VIEW_EVENT_TOUCH_FLICK, &viewEventInfo);
-               r = GetPresenter().PostEvent(viewEvent);
-               SysTryReturn(NID_UI_CTRL, r == true, false, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+               returnValue = GetPresenter().PostEvent(viewEvent);
+               if (returnValue == false)
+               {
+                       __keyEventProcessing = false;
+               }
 
                break;
        }
@@ -772,8 +779,11 @@ _Gallery::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
                viewEventInfo.SetFlicked(true);
                viewEventInfo.SetFlickTime(1);
                _GalleryViewEvent viewEvent(GALLERY_VIEW_EVENT_TOUCH_FLICK, &viewEventInfo);
-               r = GetPresenter().PostEvent(viewEvent);
-               SysTryReturn(NID_UI_CTRL, r == true, false, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+               returnValue = GetPresenter().PostEvent(viewEvent);
+               if (returnValue == false)
+               {
+                       __keyEventProcessing = false;
+               }
 
                break;
        }
@@ -786,8 +796,11 @@ _Gallery::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
                viewEventInfo.SetFlicked(true);
                viewEventInfo.SetFlickTime(1);
                _GalleryViewEvent viewEvent(GALLERY_VIEW_EVENT_TOUCH_FLICK, &viewEventInfo);
-               r = GetPresenter().PostEvent(viewEvent);
-               SysTryReturn(NID_UI_CTRL, r == true, false, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+               returnValue = GetPresenter().PostEvent(viewEvent);
+               if (returnValue == false)
+               {
+                       __keyEventProcessing = false;
+               }
 
                break;
        }
@@ -800,11 +813,11 @@ _Gallery::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
        {
                _GalleryViewEventInfo viewEventInfo;
                _GalleryViewEvent releaseEvent(GALLERY_VIEW_EVENT_TOUCH_RELEASED, &viewEventInfo);
-               r = GetPresenter().PostEvent(releaseEvent);
-               SysTryReturn(NID_UI_CTRL, r == true, false, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+               bool releaseReturnValue = GetPresenter().PostEvent(releaseEvent);
+               SysTryReturn(NID_UI_CTRL, releaseReturnValue == true, false, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
        }
 
-       return r;
+       return returnValue;
 }
 
 bool
index e9e6393..bc28487 100644 (file)
@@ -204,6 +204,7 @@ _GalleryCanvas::SetBounds(const FloatRectangle& bounds)
 {
        SysTryReturnResult(NID_UI_CTRL, bounds.width >= 0.0 && bounds.height >= 0.0, E_INVALID_ARG,
                        "The bounds width or height is negative value.");
+
        __bounds = bounds;
        if (GetFrameVisualElement().IsClipChildrenEnabled() == true)
        {
@@ -221,6 +222,11 @@ _GalleryCanvas::GetBounds(void) const
 result
 _GalleryCanvas::SetVisibility(bool visibility)
 {
+       if (IsVisibility() == visibility)
+       {
+               return E_SUCCESS;
+       }
+
        GetImageVisualElement().SetImplicitAnimationEnabled(false);
        GetImageVisualElement().SetShowState(visibility);
        GetFrameVisualElement().SetImplicitAnimationEnabled(false);
@@ -447,6 +453,11 @@ _GalleryCanvas::GetCanvasFactor(void) const
 result
 _GalleryCanvas::SetVisualElementBounds(const FloatRectangle& bounds)
 {
+       if (GetImageVisualElementBounds() == bounds)
+       {
+               return E_SUCCESS;
+       }
+
        __visualElementBoundsChanged = true;
        return GetImageVisualElement().SetBounds(bounds);
 }
@@ -503,6 +514,12 @@ _GalleryCanvas::GetImageBounds(void) const
 result
 _GalleryCanvas::SetAnimationDelegator(_GalleryAnimationProvider* pVEDelegator)
 {
+       if (GetImageVisualElement().GetAnimationProvider() == pVEDelegator
+               && GetFrameVisualElement().GetAnimationProvider() == pVEDelegator)
+       {
+               return E_SUCCESS;
+       }
+
        result r = GetImageVisualElement().SetAnimationProvider(pVEDelegator);
        SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
@@ -657,6 +674,11 @@ _GalleryRootCanvas::GetBackgroundColor(void) const
 result
 _GalleryRootCanvas::SetBounds(const FloatRectangle& bounds)
 {
+       if (GetBounds() == bounds)
+       {
+               return E_SUCCESS;
+       }
+
        return GetControl().SetBounds(bounds);
 }
 
@@ -675,6 +697,11 @@ _GalleryRootCanvas::GetControlSize(void) const
 result
 _GalleryRootCanvas::SetVisibility(bool visibility)
 {
+       if (IsVisibility() == visibility)
+       {
+               return E_SUCCESS;
+       }
+
        GetControl().SetVisibleState(visibility);
 
        return E_SUCCESS;
index ff8ed59..5b7c42b 100644 (file)
@@ -395,6 +395,11 @@ _GalleryPresenter::GetTextOfEmptyGallery(void) const
 result
 _GalleryPresenter::SetTextOfEmptyGallery(const String& text)
 {
+       String oldText = GetTextOfEmptyGallery();
+       if (oldText == text)
+       {
+               return E_SUCCESS;
+       }
        __userSetEmptyText = true;
        result r = __galleryRenderer.SetEmptyText(text);
        SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
index d0226e4..2717255 100644 (file)
@@ -97,6 +97,11 @@ _GalleryRenderer::RemoveNotiListener(const _IGalleryRendererNotiListener& notiLi
 result
 _GalleryRenderer::SetCanvasMaxCount(int maxCount)
 {
+       if (GetCanvasMaxCount() == maxCount)
+       {
+               return E_SUCCESS;
+       }
+
        result r = E_SUCCESS;
        _GalleryCanvasManager& canvasManager = GetCanvasManager();
        FloatRectangle viewRect = GetViewRect();
@@ -119,6 +124,11 @@ result
 _GalleryRenderer::SetCanvasVisibility(int canvasIndex, bool visibility)
 {
        _GalleryCanvas* pCanvas = GetCanvasManager().GetCanvas(canvasIndex);
+       if (pCanvas->IsVisibility() == visibility)
+       {
+               return E_SUCCESS;
+       }
+
        result r = GetLastResult();
        SysTryReturn(NID_UI_CTRL, pCanvas != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
@@ -143,6 +153,11 @@ result
 _GalleryRenderer::SetCanvasShowState(int canvasIndex, bool showState)
 {
        _GalleryCanvas* pCanvas = GetCanvasManager().GetCanvas(canvasIndex);
+       if (pCanvas->IsVisibility() == showState)
+       {
+               return E_SUCCESS;
+       }
+
        result r = GetLastResult();
        SysTryReturn(NID_UI_CTRL, pCanvas != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
@@ -232,6 +247,7 @@ _GalleryRenderer::SetCanvasBounds(int canvasIndex, const FloatRectangle& bounds,
                                                                const _GalleryAnimationTiming* pAnimation)
 {
        _GalleryCanvas* pCanvas = GetCanvasManager().GetCanvas(canvasIndex);
+
        result r = GetLastResult();
        SysTryReturn(NID_UI_CTRL, pCanvas != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
@@ -1271,6 +1287,12 @@ void
 _GalleryRenderer::SetEffect(Effect* pEffect)
 {
        SysTryReturnVoidResult(NID_UI_CTRL, pEffect != null, E_INVALID_ARG, "[E_INVALID_ARG] The effect object is null.");
+       SetLastResult(E_SUCCESS);
+
+       if (pEffect == __pEffect)
+       {
+               return;
+       }
 
        pEffect->SetEffectEventListener(this);
        result r = GetLastResult();
@@ -1281,8 +1303,6 @@ _GalleryRenderer::SetEffect(Effect* pEffect)
        SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
 
        __pEffect = pEffect;
-
-       SetLastResult(E_SUCCESS);
 }
 
 Tizen::Ui::Effects::Effect*