2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FUiCtrl_SplitPanelPresenter.cpp
20 * @brief This is the header file for the _SplitPanelPresenter class.
22 * This header file contains the declarations of the %_SplitPanelPresenter class.
25 #include <FBaseErrorDefine.h>
26 #include <FGrpCanvas.h>
27 #include <FUiCtrlSplitPanelTypes.h>
28 #include <FBaseSysLog.h>
29 #include <FGrp_BitmapImpl.h>
30 #include "FUi_ResourceManager.h"
31 #include "FUi_UiTouchEvent.h"
32 #include "FUiCtrl_SplitPanelPresenter.h"
33 #include "FUiCtrl_SplitPanel.h"
34 #include "FUiCtrl_SplitPanelImpl.h"
35 #include "FGrp_CoordinateSystemUtils.h"
37 using namespace Tizen::Ui;
38 using namespace Tizen::Graphics;
39 using namespace Tizen::Ui::Animations;
41 namespace Tizen { namespace Ui { namespace Controls
44 _SplitPanelPresenter::_SplitPanelPresenter(void)
46 , __pSplitPanelModel(null)
47 , __dividerMaximumPosition(0.0f)
48 , __dividerMinimumPosition(0.0f)
49 , __splitPanelDividerPressed(false)
50 , __setFirstDividerPositionChangeEvent(true)
51 , __dividerRectangle(0.0f, 0.0f ,0.0f, 0.0f)
52 , __dividerThumbRectangle(0.0f, 0.0f, 0.0f, 0.0f)
53 , __pDividerPressedBackgroundBitmap(null)
54 , __pDividerBackgroundBitmap(null)
55 , __pDividerBackgroundEffectBitmap(null)
56 , __pDividerThumbBitmap(null)
57 , __transactionIdMaximize(0)
58 , __transactionIdRestore(0)
59 , __controlAnimatorAnimationInterpolator(ANIMATION_INTERPOLATOR_LINEAR)
60 , __visualElementAnimationInterpolator(L"Linear")
62 GET_COLOR_CONFIG(SPLITPANEL::DIVIDER_BG_NORMAL, __dividerBackgroundColor);
63 GET_COLOR_CONFIG(SPLITPANEL::DIVIDER_BG_PRESSED, __dividerPressedBackgroundColor);
66 _SplitPanelPresenter::~_SplitPanelPresenter(void)
68 delete __pSplitPanelModel;
69 __pSplitPanelModel = null;
71 delete __pDividerPressedBackgroundBitmap;
72 __pDividerPressedBackgroundBitmap = null;
74 delete __pDividerBackgroundBitmap;
75 __pDividerBackgroundBitmap = null;
77 delete __pDividerThumbBitmap;
78 __pDividerThumbBitmap = null;
80 delete __pDividerBackgroundEffectBitmap;
81 __pDividerBackgroundEffectBitmap = null;
85 _SplitPanelPresenter::Construct(const _SplitPanel& splitPanel, SplitPanelDividerStyle splitPanelDividerStyle, SplitPanelDividerDirection splitPanelDividerDirection)
88 _SplitPanelModel* pModel = null;
90 pModel = new (std::nothrow) _SplitPanelModel;
91 SysTryReturnResult(NID_UI_CTRL, pModel, E_OUT_OF_MEMORY, "Memory allocation failed.");
93 r = SetModel(*pModel);
94 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to set the model.");
96 r = pModel->Construct();
97 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to construct _SplitPanelModel instance.");
99 __pSplitPanel = const_cast <_SplitPanel*>(&splitPanel);
100 SysTryCatch(NID_UI_CTRL, __pSplitPanel != null, , E_SYSTEM, "[E_SYSTEM] A system error has occurred. _SplitPanel instance is null.");
102 __pSplitPanelModel->SetDividerStyle(splitPanelDividerStyle);
104 r = LoadBitmap(splitPanelDividerDirection);
105 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to load bitmap.", GetErrorMessage(r));
107 AdjustDividerRectangle();
109 __controlAnimatorAnimationInterpolator = ANIMATION_INTERPOLATOR_EASE_IN;
110 __visualElementAnimationInterpolator = L"EaseIn";
122 _SplitPanelPresenter::CheckDividerTouchRegion(float positionX, float positionY)
124 float dividerPosition = 0.0f;
125 Bitmap* pThumbBitmap = null;
127 dividerPosition = __pSplitPanel->GetDividerPosition();
129 if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
131 pThumbBitmap = __pDividerThumbBitmap;
132 if ((positionX >= dividerPosition)
133 && (positionX <= dividerPosition + pThumbBitmap->GetWidthF()))
140 pThumbBitmap = __pDividerThumbBitmap;
141 if ((positionY >= dividerPosition)
142 && (positionY <= dividerPosition + pThumbBitmap->GetHeightF()))
152 _SplitPanelPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
154 FloatPoint point(0.0f, 0.0f);
156 point = touchinfo.GetCurrentPosition();
158 if (CheckDividerTouchRegion(point.x, point.y) == true)
160 __splitPanelDividerPressed = true;
169 _SplitPanelPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
171 if (__splitPanelDividerPressed == true)
173 PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP);
174 __splitPanelDividerPressed = false;
182 _SplitPanelPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
184 FloatPoint point(0.0f, 0.0f);
185 Bitmap* pThumbBitmap = null;
187 if (__pSplitPanel != &source || __splitPanelDividerPressed == false )
192 if (__pSplitPanelModel->GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_FIXED)
197 point = touchinfo.GetCurrentPosition();
199 if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
201 // Min, Max Position Check.
202 if ((__pSplitPanel->GetMinimumDividerPosition() > point.x)
203 || (__pSplitPanel->GetMaximumDividerPosition() < point.x))
208 pThumbBitmap = __pDividerThumbBitmap;
210 if (point.x <= __pSplitPanel->GetBoundsF().width - pThumbBitmap->GetWidthF())
212 __pSplitPanel->SetDividerPosition(point.x);
217 // Min, Max Position Check.
218 if ((__pSplitPanel->GetMinimumDividerPosition() > point.y)
219 || (__pSplitPanel->GetMaximumDividerPosition() < point.y))
224 pThumbBitmap = __pDividerThumbBitmap;
226 if (point.y <= __pSplitPanel->GetBoundsF().height - pThumbBitmap->GetHeightF())
228 __pSplitPanel->SetDividerPosition(point.y);
232 __pSplitPanel->SendSplitPanelEvent(_SPLIT_PANEL_EVENT_DIVIDER_POSITION_CHANGE);
240 _SplitPanelPresenter::OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo)
242 if (__splitPanelDividerPressed == true)
244 __splitPanelDividerPressed = false;
252 _SplitPanelPresenter::OnTapGestureDetected(_TouchTapGestureDetector& gesture)
254 if (__pSplitPanelModel->GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_FIXED)
259 __pSplitPanel->SendSplitPanelEvent(_SPLIT_PANEL_EVENT_DIVIDER_DOUBLE_PRESSED);
265 _SplitPanelPresenter::OnTapGestureCanceled(_TouchTapGestureDetector& gesture)
271 _SplitPanelPresenter::SetDividerStyle(SplitPanelDividerStyle splitPanelDividerStyle)
273 __pSplitPanelModel->SetDividerStyle(splitPanelDividerStyle);
278 SplitPanelDividerStyle
279 _SplitPanelPresenter::GetDividerStyle(void) const
281 return __pSplitPanelModel->GetDividerStyle();
285 _SplitPanelPresenter::GetDividerRectangle(void) const
287 return __dividerRectangle;
291 _SplitPanelPresenter::MaximizePane(SplitPanelPaneOrder paneOrder)
293 result r = E_SUCCESS;
295 if (IsPaneMaximized(paneOrder))
299 else if (GetAnimationStatus() == ANIMATOR_STATUS_PLAYING)
301 AnimationTransaction::Stop(__transactionIdMaximize);
302 AnimationTransaction::Stop(__transactionIdRestore);
307 ChangePaneOrder(paneOrder);
309 AnimationTransaction::Begin(__transactionIdMaximize);
311 if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
313 if (paneOrder == SPLIT_PANEL_PANE_ORDER_FIRST)
315 r = AnimateDivider(_SPLIT_PANEL_ANIMATION_RIGHT);
316 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
318 r = AnimatePane(_SPLIT_PANEL_ANIMATION_RIGHT);
319 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
323 r = AnimateDivider(_SPLIT_PANEL_ANIMATION_LEFT);
324 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
326 r = AnimatePane(_SPLIT_PANEL_ANIMATION_LEFT);
327 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
332 if (paneOrder == SPLIT_PANEL_PANE_ORDER_FIRST)
334 r = AnimateDivider(_SPLIT_PANEL_ANIMATION_BOTTOM);
335 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
337 r = AnimatePane(_SPLIT_PANEL_ANIMATION_BOTTOM);
338 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
342 r = AnimateDivider(_SPLIT_PANEL_ANIMATION_TOP);
343 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
345 r = AnimatePane(_SPLIT_PANEL_ANIMATION_TOP);
346 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
350 AnimationTransaction::Commit();
352 __pSplitPanelModel->SetPaneMaximumState(true);
353 __pSplitPanelModel->SetMaximizedPaneOrder(paneOrder);
358 AnimationTransaction::Discard();
364 _SplitPanelPresenter::IsPaneMaximized(SplitPanelPaneOrder paneOrder) const
366 if ((__pSplitPanelModel->GetPaneMaximumState() == true)
367 && (__pSplitPanelModel->GetMaximizedPaneOrder() == paneOrder))
376 _SplitPanelPresenter::RestorePane(void)
378 result r = E_SUCCESS;
380 if (__pSplitPanelModel->GetPaneMaximumState() == false)
384 else if (GetAnimationStatus() == ANIMATOR_STATUS_PLAYING)
386 AnimationTransaction::Stop(__transactionIdMaximize);
387 AnimationTransaction::Stop(__transactionIdRestore);
392 AnimationTransaction::Begin(__transactionIdRestore);
394 if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
396 r = AnimateDivider(_SPLIT_PANEL_ANIMATION_RESTORE_VERTICAL);
397 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
399 r = AnimatePane(_SPLIT_PANEL_ANIMATION_RESTORE_VERTICAL);
400 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
404 r = AnimateDivider(_SPLIT_PANEL_ANIMATION_RESTORE_HORIZONTAL);
405 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
407 r = AnimatePane(_SPLIT_PANEL_ANIMATION_RESTORE_HORIZONTAL);
408 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
411 AnimationTransaction::Commit();
413 __pSplitPanelModel->SetPaneMaximumState(false);
418 AnimationTransaction::Discard();
424 _SplitPanelPresenter::Draw(void)
426 if (__pSplitPanelModel->GetPaneMaximumState() == false && GetAnimationStatus() == ANIMATOR_STATUS_STOPPED)
428 FloatRectangle dividerBounds(0.0f, 0.0f, 0.0f, 0.0f);
429 FloatRectangle dividerThumbBounds(0.0f, 0.0f, 0.0f, 0.0f);
431 //adjust divider rectangle
432 AdjustDividerRectangle();
434 Canvas* pCanvas = __pSplitPanel->GetDividerVisualElement()->GetCanvasN();
435 SysTryReturnResult(NID_UI_CTRL, pCanvas != null, GetLastResult(), "Propagating.");
442 dividerBounds = __dividerRectangle;
443 dividerBounds.x = 0.0f;
444 dividerBounds.y = 0.0f;
446 if (__splitPanelDividerPressed == true)
448 pCanvas->DrawNinePatchedBitmap(dividerBounds, *__pDividerPressedBackgroundBitmap);
452 pCanvas->DrawNinePatchedBitmap(dividerBounds, *__pDividerBackgroundBitmap);
456 pCanvas->DrawNinePatchedBitmap(dividerBounds, *__pDividerBackgroundEffectBitmap);
459 if (__pSplitPanelModel->GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
461 dividerThumbBounds = __dividerThumbRectangle;
462 if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
464 dividerThumbBounds.x = 0.0f;
468 dividerThumbBounds.y = 0.0f;
471 pCanvas->DrawBitmap(dividerThumbBounds, *__pDividerThumbBitmap);
481 _SplitPanelPresenter::LoadBitmap(SplitPanelDividerDirection splitPanelDividerDirection)
483 result r = E_SUCCESS;
484 Bitmap *pDividerBackgroundBitmap = null;
486 // Modified - Changeable Color / Resource ( Fixed Style )
487 r = GET_BITMAP_CONFIG_N(SPLITPANEL::DIVIDER_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pDividerBackgroundBitmap);
488 SysTryReturnResult(NID_UI_CTRL, (r == E_SUCCESS), r, "Failed to load bitmap.");
490 if (splitPanelDividerDirection == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
492 r = GET_BITMAP_CONFIG_N(SPLITPANEL::VERTICAL_DIVIDER_BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pDividerBackgroundEffectBitmap);
493 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Failed to load bitmap.", GetErrorMessage(r));
494 r = GET_BITMAP_CONFIG_N(SPLITPANEL::VERTICAL_DIVIDER_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDividerThumbBitmap);
495 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Failed to load bitmap.", GetErrorMessage(r));
499 r = GET_BITMAP_CONFIG_N(SPLITPANEL::HORIZONTAL_DIVIDER_BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pDividerBackgroundEffectBitmap);
500 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Failed to load bitmap.", GetErrorMessage(r));
501 r = GET_BITMAP_CONFIG_N(SPLITPANEL::HORIZONTAL_DIVIDER_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDividerThumbBitmap);
502 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Failed to load bitmap.", GetErrorMessage(r));
505 __pDividerPressedBackgroundBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDividerBackgroundBitmap, Color::GetColor(COLOR_ID_MAGENTA), __dividerPressedBackgroundColor);
507 SysTryCatch(NID_UI_CTRL, (__pDividerPressedBackgroundBitmap != null), , r, "[%s] Failed to get replacement color bitmap.", GetErrorMessage(r));
509 __pDividerBackgroundBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDividerBackgroundBitmap, Color::GetColor(COLOR_ID_MAGENTA), __dividerBackgroundColor);
511 SysTryCatch(NID_UI_CTRL, (__pDividerBackgroundBitmap != null), , r, "[%s] Failed to get replacement color bitmap.", GetErrorMessage(r));
513 delete pDividerBackgroundBitmap;
518 delete pDividerBackgroundBitmap;
519 delete __pDividerBackgroundEffectBitmap;
520 delete __pDividerPressedBackgroundBitmap;
521 delete __pDividerThumbBitmap;
527 _SplitPanelPresenter::RecalcSplitPanel(void)
529 //adjust divider rectangle
530 AdjustDividerRectangle();
539 _SplitPanelPresenter::OnChangeLayout(_ControlOrientation orientation)
541 AnimationTransaction::Stop(__transactionIdMaximize);
542 AnimationTransaction::Stop(__transactionIdRestore);
548 _SplitPanelPresenter::OnBoundsChanged(void)
555 _SplitPanelPresenter::SetModel(const _SplitPanelModel& splitPanelModel)
557 __pSplitPanelModel = const_cast<_SplitPanelModel*>(&splitPanelModel);
563 _SplitPanelPresenter::SetPaneBounds(void)
565 result r = E_SUCCESS;
566 FloatRectangle clientBounds(0.0f, 0.0f, 0.0f, 0.0f);
567 FloatRectangle firstPaneBounds(0.0f, 0.0f, 0.0f, 0.0f);
568 FloatRectangle secondPaneBounds(0.0f, 0.0f, 0.0f, 0.0f);
569 FloatPoint panePostion(0.0f, 0.0f);
570 _Control* pFirstPane = null;
571 _Control* pSecondPane = null;
573 clientBounds = __pSplitPanel->GetBoundsF();
575 pFirstPane = __pSplitPanel->GetPane(SPLIT_PANEL_PANE_ORDER_FIRST);
577 pSecondPane = __pSplitPanel->GetPane(SPLIT_PANEL_PANE_ORDER_SECOND);
579 clientBounds.x = clientBounds.y = 0.0f;
581 if (IsPaneMaximized(SPLIT_PANEL_PANE_ORDER_FIRST))
583 firstPaneBounds = clientBounds;
585 if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
587 secondPaneBounds = FloatRectangle(clientBounds.width + __dividerRectangle.width, 0.0f, clientBounds.width - __dividerRectangle.x - __dividerRectangle.width, clientBounds.height);
591 secondPaneBounds = FloatRectangle(0.0f, clientBounds.height + __dividerRectangle.height, clientBounds.width, clientBounds.height - __dividerRectangle.y - __dividerRectangle.height);
594 else if (IsPaneMaximized(SPLIT_PANEL_PANE_ORDER_SECOND))
596 secondPaneBounds = clientBounds;
598 if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
600 firstPaneBounds = FloatRectangle(clientBounds.x -__dividerRectangle.x - __dividerRectangle.width, 0.0f, __dividerRectangle.x, clientBounds.height);
604 firstPaneBounds = FloatRectangle(0.0f, clientBounds.y -__dividerRectangle.y - __dividerRectangle.height, clientBounds.width, __dividerRectangle.y);
609 if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
611 firstPaneBounds = FloatRectangle(0.0f, 0.0f, __dividerRectangle.x, clientBounds.height);
612 secondPaneBounds = FloatRectangle(__dividerRectangle.x + __dividerRectangle.width, 0.0f, clientBounds.width - __dividerRectangle.x - __dividerRectangle.width,clientBounds.height);
616 firstPaneBounds = FloatRectangle(0.0f, 0.0f, clientBounds.width, __dividerRectangle.y);
617 secondPaneBounds = FloatRectangle(0.0f, __dividerRectangle.y + __dividerRectangle.height, clientBounds.width, clientBounds.height - __dividerRectangle.y - __dividerRectangle.height);
622 if (pFirstPane != null)
624 r = pFirstPane->SetBounds(firstPaneBounds);
628 panePostion.x = firstPaneBounds.x;
629 panePostion.y = firstPaneBounds.y;
631 r = pFirstPane->SetPosition(panePostion);
634 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
637 if (pSecondPane != null)
639 r = pSecondPane->SetBounds(secondPaneBounds);
643 panePostion.x = secondPaneBounds.x;
644 panePostion.y = secondPaneBounds.y;
646 r = pSecondPane->SetPosition(panePostion);
649 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
652 if ((pFirstPane != null) && (pSecondPane != null))
654 if (__setFirstDividerPositionChangeEvent == true)
656 __setFirstDividerPositionChangeEvent = false;
657 __pSplitPanel->SendSplitPanelEvent(_SPLIT_PANEL_EVENT_DIVIDER_POSITION_CHANGE);
659 pFirstPane->Invalidate(true);
660 pSecondPane->Invalidate(true);
667 _SplitPanelPresenter::AdjustDividerRectangle(void)
669 float dividerPosition = 0.0f;
672 FloatRectangle clientBounds(0.0f, 0.0f, 0.0f, 0.0f);
673 _ControlOrientation orientation = _CONTROL_ORIENTATION_PORTRAIT;
674 Bitmap* pThumbBitmap = null;
676 orientation = _ControlManager::GetInstance()->GetOrientation();
678 dividerPosition = __pSplitPanel->GetDividerPosition();
679 clientBounds = __pSplitPanel->GetBoundsF();
681 if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
683 pThumbBitmap = __pDividerThumbBitmap;
685 if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
687 GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, width);
691 GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, width);
694 height = clientBounds.height;
698 __dividerRectangle = FloatRectangle(dividerPosition, 0.0f, width, height);
699 __dividerThumbRectangle = FloatRectangle(dividerPosition, ((height - pThumbBitmap->GetHeightF()) / 2.0f), pThumbBitmap->GetWidthF(), pThumbBitmap->GetHeightF());
704 pThumbBitmap = __pDividerThumbBitmap;
706 if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
708 GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, height);
712 GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, height);
715 width = clientBounds.width;
719 __dividerRectangle = FloatRectangle(0.0f, dividerPosition, width, height);
720 __dividerThumbRectangle = FloatRectangle(((width - pThumbBitmap->GetWidth()) / 2.0f), dividerPosition, pThumbBitmap->GetWidthF(), pThumbBitmap->GetHeightF());
724 __pSplitPanel->SetDividerVisualElementBounds(__dividerRectangle);
728 _SplitPanelPresenter::ChangePaneOrder(SplitPanelPaneOrder paneOrder)
730 result r = E_SUCCESS;
731 _Control* pFirstPane = null;
732 _Control* pSecondPane = null;
734 if (paneOrder == SPLIT_PANEL_PANE_ORDER_FIRST)
736 pFirstPane = __pSplitPanel->GetPane(SPLIT_PANEL_PANE_ORDER_FIRST);
737 SysTryReturnVoidResult(NID_UI_CTRL, pFirstPane != null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r));
739 r = __pSplitPanel->DetachChild(*pFirstPane);
740 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
742 r = __pSplitPanel->AttachChild(*pFirstPane);
743 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
747 pSecondPane = __pSplitPanel->GetPane(SPLIT_PANEL_PANE_ORDER_SECOND);
748 SysTryReturnVoidResult(NID_UI_CTRL, pSecondPane != null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r));
750 r = __pSplitPanel->DetachChild(*pSecondPane);
751 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
753 r = __pSplitPanel->AttachChild(*pSecondPane);
754 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
761 _SplitPanelPresenter::AnimateDivider(int destination)
763 result r = E_SUCCESS;
764 FloatRectangle dividerBoundsStart(0.0f, 0.0f, 0.0f, 0.0f);
765 FloatRectangle dividerBoundsEnd(0.0f, 0.0f, 0.0f, 0.0f);
766 FloatRectangle dividerBounds(0, 0, 0, 0);
767 FloatRectangle clientBounds(0, 0, 0, 0);
768 FloatRectangle firstPaneBounds(0, 0, 0, 0);
769 Control* pFirstPanelControl = null;
770 VisualElement* pVisualElementDivider = null;
771 VisualElementPropertyAnimation* pAnimationDivider = null;
773 const IVisualElementAnimationTimingFunction* pTimingFunction = VisualElementAnimation::GetTimingFunctionByName(__visualElementAnimationInterpolator);
775 SysTryReturnResult(NID_UI_CTRL, pTimingFunction != null, r, "Propagating.");
777 pFirstPanelControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_FIRST);
779 SysTryReturnResult(NID_UI_CTRL, pFirstPanelControl != null, r, "Propagating.");
781 pVisualElementDivider = __pSplitPanel->GetDividerVisualElement();
783 SysTryReturnResult(NID_UI_CTRL, pVisualElementDivider != null, r, "Propagating.");
785 pVisualElementDivider->RemoveAllAnimations();
787 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
789 pAnimationDivider = new (std::nothrow) VisualElementPropertyAnimation();
790 SysTryReturnResult(NID_UI_CTRL, pAnimationDivider != null, E_OUT_OF_MEMORY, " Memory allocation failed.")
792 r = pAnimationDivider->SetPropertyName(L"bounds");
793 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
795 r = pAnimationDivider->SetDuration(ANIMATION_DURATION);
796 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
798 pAnimationDivider->SetTimingFunction(pTimingFunction);
800 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
802 dividerBounds = pVisualElementDivider->GetBounds();
803 clientBounds = __pSplitPanel->GetBoundsF();
804 firstPaneBounds = pFirstPanelControl->GetBoundsF();
805 dividerBoundsStart = dividerBounds;
807 clientBounds.x = clientBounds.y = 0.0f;
811 case _SPLIT_PANEL_ANIMATION_RIGHT:
813 dividerBoundsStart.x = firstPaneBounds.x + firstPaneBounds.width;
815 dividerBoundsEnd = dividerBounds;
816 dividerBoundsEnd.x = clientBounds.width;
819 case _SPLIT_PANEL_ANIMATION_LEFT:
821 dividerBoundsStart.x = firstPaneBounds.x + firstPaneBounds.width;
823 dividerBoundsEnd = dividerBounds;
824 dividerBoundsEnd.x = clientBounds.x - dividerBounds.width;
827 case _SPLIT_PANEL_ANIMATION_TOP:
829 dividerBoundsStart.y = firstPaneBounds.y + firstPaneBounds.height;
831 dividerBoundsEnd = dividerBounds;
832 dividerBoundsEnd.y = clientBounds.y - dividerBounds.height;
835 case _SPLIT_PANEL_ANIMATION_BOTTOM:
837 dividerBoundsStart.y = firstPaneBounds.y + firstPaneBounds.height;
839 dividerBoundsEnd = dividerBounds;
840 dividerBoundsEnd.y = clientBounds.height;
843 case _SPLIT_PANEL_ANIMATION_RESTORE_HORIZONTAL:
845 dividerBounds = __dividerRectangle;
847 dividerBoundsStart = dividerBounds;
848 dividerBoundsEnd = dividerBounds;
850 if (__pSplitPanelModel->GetMaximizedPaneOrder() == SPLIT_PANEL_PANE_ORDER_FIRST)
852 dividerBoundsStart.y = clientBounds.height;
856 dividerBoundsStart.y = clientBounds.y - dividerBounds.height;
860 case _SPLIT_PANEL_ANIMATION_RESTORE_VERTICAL:
862 dividerBounds = __dividerRectangle;
864 dividerBoundsStart = dividerBoundsEnd = dividerBounds;
866 if (__pSplitPanelModel->GetMaximizedPaneOrder() == SPLIT_PANEL_PANE_ORDER_FIRST)
868 dividerBoundsStart.x = clientBounds.width;
872 dividerBoundsStart.x = clientBounds.x - dividerBounds.width;
878 r = pAnimationDivider->SetStartValue(dividerBoundsStart);
879 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
881 r = pAnimationDivider->SetEndValue(dividerBoundsEnd);
882 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
884 pVisualElementDivider->AddAnimation(L"Bounds", *pAnimationDivider);
886 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
890 delete pAnimationDivider;
896 _SplitPanelPresenter::AnimatePane(int destination)
898 result r = E_SUCCESS;
899 Rectangle clientBounds(0, 0, 0, 0);
900 Rectangle firstPaneBounds(0, 0, 0, 0);
901 Rectangle secondPaneBounds(0, 0, 0, 0);
902 Rectangle dividerRectangle(0, 0, 0, 0);
903 Control* pFirstPanelControl = null;
904 Control* pSecondPanelControl = null;
905 ControlAnimator* pControlAnimatorFirstPane = null;
906 ControlAnimator* pControlAnimatorSecondPane = null;
908 FloatAnimation animationHidePane = FloatAnimation(ANIMATION_ALPHA_SHOW, ANIMATION_ALPHA_HIDE, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
909 FloatAnimation animationShowPane = FloatAnimation(ANIMATION_ALPHA_HIDE, ANIMATION_ALPHA_SHOW, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
911 pFirstPanelControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_FIRST);
913 SysTryReturnResult(NID_UI_CTRL, pFirstPanelControl != null, r, "Propagating.");
915 pSecondPanelControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_SECOND);
917 SysTryReturnResult(NID_UI_CTRL, pSecondPanelControl != null, r, "Propagating.");
919 pControlAnimatorFirstPane = pFirstPanelControl->GetControlAnimator();
921 SysTryReturnResult(NID_UI_CTRL, pControlAnimatorFirstPane != null, r, "Propagating.");
923 pControlAnimatorSecondPane = pSecondPanelControl->GetControlAnimator();
925 SysTryReturnResult(NID_UI_CTRL, pControlAnimatorSecondPane != null, r, "Propagating.");
927 clientBounds = __pSplitPanel->GetBounds();
928 firstPaneBounds = pFirstPanelControl->GetBounds();
929 secondPaneBounds = pSecondPanelControl->GetBounds();
931 clientBounds.x = clientBounds.y = 0;
933 dividerRectangle = _CoordinateSystemUtils::ConvertToInteger(__dividerRectangle);
937 case _SPLIT_PANEL_ANIMATION_RIGHT:
939 Rectangle secondPaneEndBounds = secondPaneBounds;
940 secondPaneEndBounds.x = clientBounds.x + clientBounds.width + dividerRectangle.width;
942 RectangleAnimation animationMaximizeFirstPane = RectangleAnimation(firstPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
943 RectangleAnimation animationMinimizeSecondPane = RectangleAnimation(secondPaneBounds, secondPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
945 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMaximizeFirstPane);
946 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
948 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationMaximizeFirstPane);
949 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
951 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMinimizeSecondPane);
952 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
954 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationHidePane);
955 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
957 if (pFirstPanelControl->GetShowState() == false)
959 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
960 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
964 case _SPLIT_PANEL_ANIMATION_LEFT:
966 Rectangle firstPaneEndBounds = firstPaneBounds;
967 firstPaneEndBounds.x = clientBounds.x - firstPaneBounds.width - dividerRectangle.width;
969 RectangleAnimation animationMaximizeSecondPane = RectangleAnimation(secondPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
970 RectangleAnimation animationMinimizeFirstPane = RectangleAnimation(firstPaneBounds, firstPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
972 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMaximizeSecondPane);
973 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
975 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationMaximizeSecondPane);
976 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
978 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMinimizeFirstPane);
979 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
981 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationHidePane);
982 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
984 if (pSecondPanelControl->GetShowState() == false)
986 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
987 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
991 case _SPLIT_PANEL_ANIMATION_TOP:
993 Rectangle firstPaneEndBounds = firstPaneBounds;
994 firstPaneEndBounds.y = clientBounds.y - firstPaneBounds.height - dividerRectangle.height;
996 RectangleAnimation animationMaximizeSecondPane = RectangleAnimation(secondPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
997 RectangleAnimation animationMinimizeFirstPane = RectangleAnimation(firstPaneBounds, firstPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
999 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMaximizeSecondPane);
1000 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1002 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationMaximizeSecondPane);
1003 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1005 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMinimizeFirstPane);
1006 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1008 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationHidePane);
1009 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1011 if (pSecondPanelControl->GetShowState() == false)
1013 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
1014 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1018 case _SPLIT_PANEL_ANIMATION_BOTTOM:
1020 Rectangle secondPaneEndBounds = secondPaneBounds;
1021 secondPaneEndBounds.y = clientBounds.y + clientBounds.height + dividerRectangle.height;
1023 RectangleAnimation animationMaximizeFirstPane = RectangleAnimation(firstPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
1024 RectangleAnimation animationMinimizeSecondPane = RectangleAnimation(secondPaneBounds, secondPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
1026 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMaximizeFirstPane);
1027 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1029 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationMaximizeFirstPane);
1030 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1032 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMinimizeSecondPane);
1033 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1035 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationHidePane);
1036 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1038 if (pFirstPanelControl->GetShowState() == false)
1040 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
1041 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1045 case _SPLIT_PANEL_ANIMATION_RESTORE_HORIZONTAL:
1047 Rectangle firstPaneEndBounds = _CoordinateSystemUtils::ConvertToInteger(GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_FIRST));
1048 Rectangle secondPaneEndBounds = _CoordinateSystemUtils::ConvertToInteger(GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_SECOND));
1050 RectangleAnimation animationRestoreFirstPane = RectangleAnimation(firstPaneBounds, firstPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
1051 RectangleAnimation animationRestoreSecondPane = RectangleAnimation(secondPaneBounds, secondPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
1054 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationRestoreFirstPane);
1055 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1057 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationRestoreFirstPane);
1058 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1061 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationRestoreSecondPane);
1062 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1064 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationRestoreSecondPane);
1065 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1067 if (__pSplitPanelModel->GetMaximizedPaneOrder() == SPLIT_PANEL_PANE_ORDER_FIRST)
1069 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
1070 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1074 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
1075 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1079 case _SPLIT_PANEL_ANIMATION_RESTORE_VERTICAL:
1081 Rectangle firstPaneEndBounds = _CoordinateSystemUtils::ConvertToInteger(GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_FIRST));
1082 Rectangle secondPaneEndBounds = _CoordinateSystemUtils::ConvertToInteger(GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_SECOND));
1084 RectangleAnimation animationRestoreFirstPane = RectangleAnimation(firstPaneBounds, firstPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
1085 RectangleAnimation animationRestoreSecondPane = RectangleAnimation(secondPaneBounds, secondPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
1088 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationRestoreFirstPane);
1089 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1091 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationRestoreFirstPane);
1092 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1095 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationRestoreSecondPane);
1096 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1098 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationRestoreSecondPane);
1099 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1101 if (__pSplitPanelModel->GetMaximizedPaneOrder() == SPLIT_PANEL_PANE_ORDER_FIRST)
1103 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
1104 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1108 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
1109 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1119 _SplitPanelPresenter::GetPaneControl(SplitPanelPaneOrder paneOrder)
1121 _ControlImpl* pControlImpl = null;
1122 _SplitPanelImpl* pSplitPanelImpl = null;
1123 Control* pControl = null;
1125 pControlImpl = static_cast<_ControlImpl*>(__pSplitPanel->GetUserData());
1126 SysTryReturn(NID_UI_CTRL, pControlImpl != null, null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. _ControlImpl is null.");
1128 pSplitPanelImpl = dynamic_cast<_SplitPanelImpl*>(pControlImpl);
1129 SysTryReturn(NID_UI_CTRL, pSplitPanelImpl != null, null, E_SYSTEM, "[E_SYSTEM]A system error has occurred. _SplitPanelImpl is null.");
1131 SplitPanel& splitPanelPublic = pSplitPanelImpl->GetPublic();
1133 pControl = splitPanelPublic.GetPane(paneOrder);
1134 SysTryReturn(NID_UI_CTRL, pControl != null, null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(GetLastResult()));
1140 _SplitPanelPresenter::GetAnimationStatus(void)
1142 result r = E_SUCCESS;
1144 Control* pFirstPanelControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_FIRST);
1145 r = GetLastResult();
1146 SysTryReturn(NID_UI_CTRL, pFirstPanelControl != null, ANIMATOR_STATUS_STOPPED, r, "[%s] Propagating.", GetErrorMessage(r));
1148 Control* pSecondPanelControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_SECOND);
1149 r = GetLastResult();
1150 SysTryReturn(NID_UI_CTRL, pSecondPanelControl != null, ANIMATOR_STATUS_STOPPED, r, "[%s] Propagating.", GetErrorMessage(r));
1152 ControlAnimator* pControlAnimatorFirstPane = pFirstPanelControl->GetControlAnimator();
1153 r = GetLastResult();
1154 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, ANIMATOR_STATUS_STOPPED, r, "[%s] Propagating.", GetErrorMessage(r));
1156 ControlAnimator* pControlAnimatorSecondPane = pSecondPanelControl->GetControlAnimator();
1157 r = GetLastResult();
1158 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, ANIMATOR_STATUS_STOPPED, r, "[%s] Propagating.", GetErrorMessage(r));
1160 if (pControlAnimatorFirstPane->GetStatus() == ANIMATOR_STATUS_STOPPED && pControlAnimatorSecondPane->GetStatus() == ANIMATOR_STATUS_STOPPED)
1162 return ANIMATOR_STATUS_STOPPED;
1165 return ANIMATOR_STATUS_PLAYING;
1169 _SplitPanelPresenter::GetRestorePaneBounds(SplitPanelPaneOrder paneOrder)
1172 float height = 0.0f;
1174 FloatRectangle firstPaneBounds(0.0f, 0.0f, 0.0f, 0.0f);
1175 FloatRectangle secondPaneBounds(0.0f, 0.0f, 0.0f, 0.0f);
1177 float dividerPosition = __pSplitPanel->GetDividerPosition();
1179 FloatRectangle clientBounds = __pSplitPanel->GetBoundsF();
1181 _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
1183 if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
1185 if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
1187 GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, width);
1191 GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, width);
1194 height = clientBounds.height;
1198 __dividerRectangle = FloatRectangle(dividerPosition, 0.0f, width, height);
1203 if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
1205 GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, height);
1209 GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, height);
1212 width = clientBounds.width;
1216 __dividerRectangle = FloatRectangle(0.0f, dividerPosition, width, height);
1220 if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
1222 firstPaneBounds = FloatRectangle(0.0f, 0.0f, __dividerRectangle.x, clientBounds.height);
1223 secondPaneBounds = FloatRectangle(__dividerRectangle.x + __dividerRectangle.width, 0.0f, clientBounds.width - __dividerRectangle.x - __dividerRectangle.width, clientBounds.height);
1227 firstPaneBounds = FloatRectangle(0.0f, 0.0f, clientBounds.width, __dividerRectangle.y);
1228 secondPaneBounds = FloatRectangle(0.0f, __dividerRectangle.y + __dividerRectangle.height, clientBounds.width, clientBounds.height - __dividerRectangle.y - __dividerRectangle.height);
1231 if (paneOrder == SPLIT_PANEL_PANE_ORDER_FIRST)
1233 return firstPaneBounds;
1236 return secondPaneBounds;
1239 }}} // Tizen::Ui::Controls