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.
17 #include <FBaseErrors.h>
18 #include <FBaseSysLog.h>
19 #include <FGrpFloatMatrix4.h>
20 #include <FGrpCanvas.h>
21 #include <FUiVariant.h>
22 #include <FUiEffects.h>
23 #include <FUiAnimVisualElementAnimation.h>
24 #include <FUiCtrlGallery.h>
25 #include <FGrp_BitmapImpl.h>
26 #include <FGrp_CanvasImpl.h>
27 #include <FGrp_TextTextObject.h>
28 #include <FGrp_TextTextSimple.h>
29 #include "FUi_Control.h"
30 #include "FUi_CoordinateSystemUtils.h"
31 #include "FUi_ResourceManager.h"
32 #include "FUiAnim_MatrixUtil.h"
33 #include "FUiAnim_VisualElement.h"
34 #include "FUiCtrl_GalleryImpl.h"
35 #include "FUiCtrl_GalleryRenderer.h"
36 #include "FUiCtrl_GalleryBitmap.h"
37 #include "FUiCtrl_GalleryCanvasManager.h"
38 #include "FUiCtrl_GalleryCanvas.h"
39 #include "FUiCtrl_GalleryRendererNotifier.h"
40 #include "FUiCtrl_GalleryRendererNotification.h"
41 #include "FUiCtrl_IGalleryRendererNotiListener.h"
44 using namespace Tizen::Base;
45 using namespace Tizen::Base::Runtime;
46 using namespace Tizen::Base::Collection;
47 using namespace Tizen::Graphics;
48 using namespace Tizen::Ui;
49 using namespace Tizen::Ui::Animations;
50 using namespace Tizen::Ui::Effects;
51 using namespace Tizen::Graphics::_Text;
53 namespace Tizen { namespace Ui { namespace Controls {
58 const int GALLERY_CANVAS_INITIAL_MAX_COUNT = 5;
59 const int GALLERY_ZOOM_TRANSITION_ZOOM_FACTOR = 10;
61 } // unnamed namespace
64 _GalleryRenderer::CreateGalleryRendererN(_Control& control)
68 _GalleryRenderer* pRenderer = new (std::nothrow) _GalleryRenderer();
69 SysTryCatch(NID_UI_CTRL, pRenderer != null, , E_OUT_OF_MEMORY,
70 "[E_OUT_OF_MEMORY] Failed to allocate the memory for the _GalleryRenderer.");
72 r = pRenderer->Construct(control);
73 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
75 SetLastResult(E_SUCCESS);
86 _GalleryRenderer::AddNotiListener(const _IGalleryRendererNotiListener& notiListener)
88 return GetRendererNotifier().AddListener((const IEventListener&)notiListener);
92 _GalleryRenderer::RemoveNotiListener(const _IGalleryRendererNotiListener& notiListener)
94 return GetRendererNotifier().RemoveListener((const IEventListener&)notiListener);
98 _GalleryRenderer::SetCanvasMaxCount(int maxCount)
100 result r = E_SUCCESS;
101 _GalleryCanvasManager& canvasManager = GetCanvasManager();
102 FloatRectangle viewRect = GetViewRect();
104 r = canvasManager.ResetCanvasManager(maxCount + 1, viewRect);
105 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
107 SetEmptyCanvasIndex(maxCount);
113 _GalleryRenderer::GetCanvasMaxCount(void) const
115 return GetCanvasManager().GetCanvasCount();
119 _GalleryRenderer::SetCanvasVisibility(int canvasIndex, bool visibility)
121 _GalleryCanvas* pCanvas = GetCanvasManager().GetCanvas(canvasIndex);
122 result r = GetLastResult();
123 SysTryReturn(NID_UI_CTRL, pCanvas != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
125 pCanvas->GetFrameVisualElement().SetImplicitAnimationEnabled(false);
127 if (visibility == true)
129 r = pCanvas->GetFrameVisualElement().SetZOrderGroup(1000);
130 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
132 pCanvas->GetFrameVisualElement().SetOpacity(1.0);
136 r = pCanvas->GetFrameVisualElement().SetZOrderGroup(0);
137 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
140 return pCanvas->SetVisibility(visibility);
143 _GalleryRenderer::SetCanvasShowState(int canvasIndex, bool showState)
145 _GalleryCanvas* pCanvas = GetCanvasManager().GetCanvas(canvasIndex);
146 result r = GetLastResult();
147 SysTryReturn(NID_UI_CTRL, pCanvas != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
149 return pCanvas->SetVisibility(showState);
153 _GalleryRenderer::IsCanvasVisibility(int canvasIndex) const
155 _GalleryCanvas* pCanvas = GetCanvasManager().GetCanvas(canvasIndex);
156 SysTryReturn(NID_UI_CTRL, pCanvas != null, false, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
158 return pCanvas->IsVisibility();
162 _GalleryRenderer::GetViewRect(void) const
164 FloatRectangle rect = GetCanvasManager().GetRootCanvas().GetBounds();
171 _GalleryRenderer::SetEmptyImage(const _GalleryBitmap* pImage)
173 _GalleryCanvas* pCanvas = GetCanvasManager().GetCanvas(GetEmptyCanvasIndex());
174 result r = GetLastResult();
175 SysTryReturn(NID_UI_CTRL, pCanvas != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
177 r = pCanvas->SetImage(pImage, GetViewRect(), GALLERY_FITTING_TYPE_NONE);
178 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
186 _GalleryRenderer::SetEmptyText(const String& pText)
188 __emptyString = pText;
194 _GalleryRenderer::EnableEmptyView(void)
196 __showEmptyImage = true;
197 __needDrawEmptyCanvas = true;
203 _GalleryRenderer::DisableEmptyView(void)
205 result r = SetCanvasVisibility(GetEmptyCanvasIndex(), false);
206 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
208 __showEmptyImage = false;
209 __needDrawEmptyCanvas = false;
215 _GalleryRenderer::SetCanvasImage(int canvasIndex, const _GalleryBitmap* pImage
216 , _GalleryVerticalAlignment imageVerticalAlignment, _GalleryHorizontalAlignment imageHorizontalAlignment
217 , _GalleryFittingType fittingType)
219 _GalleryCanvas* pCanvas = GetCanvasManager().GetCanvas(canvasIndex);
220 result r = GetLastResult();
221 SysTryReturn(NID_UI_CTRL, pCanvas != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
223 pCanvas->SetImageAlignment(imageVerticalAlignment, imageHorizontalAlignment);
224 r = pCanvas->SetImage(pImage, GetViewRect(), fittingType);
225 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
231 _GalleryRenderer::SetCanvasBounds(int canvasIndex, const FloatRectangle& bounds,
232 const _GalleryAnimationTiming* pAnimation)
234 _GalleryCanvas* pCanvas = GetCanvasManager().GetCanvas(canvasIndex);
235 result r = GetLastResult();
236 SysTryReturn(NID_UI_CTRL, pCanvas != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
238 _VisualElement& visualElement = pCanvas->GetImageVisualElement();
239 _VisualElement& frameVisualElement = pCanvas->GetFrameVisualElement();
240 frameVisualElement.SetImplicitAnimationEnabled(false);
242 FloatMatrix4 endMatrix;
243 endMatrix.SetAsIdentity();
245 float translateX = bounds.x;
246 float translateY = bounds.y;
248 FloatRectangle viewRect = GetViewRect();
249 FloatRectangle imageBounds = pCanvas->GetOriginalImageBounds();
250 if (bounds.width != viewRect.width)
252 float factor = (float)bounds.width / (float)(viewRect.width);
253 translateX = translateX - (imageBounds.width / 2 + imageBounds.x) + ((imageBounds.width / 2 + imageBounds.x) * factor);
254 translateY = translateY - (imageBounds.height / 2 + imageBounds.y) + ((imageBounds.height / 2 + imageBounds.y) * factor);
255 endMatrix.SetAsIdentity();
256 _MatrixUtilTranslate(endMatrix, translateX, translateY, 0);
257 _MatrixUtilScale(endMatrix, factor, factor, 1);
258 pCanvas->SetCanvasFactor(factor);
259 pCanvas->SetClippingOfFrameVisualElement(false);
263 //_MatrixUtilTranslate(endMatrix, translateX, translateY, 0);
264 pCanvas->SetCanvasFactor(1.0f);
265 pCanvas->SetClippingOfFrameVisualElement(true);
268 r = SetCanvasImageBounds(canvasIndex, bounds);
269 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
271 if (pAnimation != null)
273 visualElement.SetImplicitAnimationEnabled(true);
274 frameVisualElement.SetImplicitAnimationEnabled(true);
277 GetAnimationDelegator().SetGalleryAnimationTiming(*pAnimation);
279 r = visualElement.SetTransformMatrix(endMatrix);
280 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
281 __animationRunning = true;
283 pCanvas->SetBounds(bounds);
285 visualElement.SetImplicitAnimationEnabled(false);
286 frameVisualElement.SetImplicitAnimationEnabled(false);
290 visualElement.RemoveAllAnimations();
292 if (GetAnimationCount() != 0)
294 ResetAnimationCount();
298 visualElement.SetImplicitAnimationEnabled(false);
300 r = visualElement.SetTransformMatrix(endMatrix);
301 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
303 pCanvas->SetBounds(bounds);
307 imageBounds = pCanvas->GetImageBounds();
308 anchor.x = (-bounds.x + (GetViewRect().width / 2)) / bounds.width;
309 anchor.y = (-bounds.y + (GetViewRect().height / 2)) / bounds.height;
310 pCanvas->SetImageAnchor(anchor);
316 _GalleryRenderer::GetCanvasBounds(int canvasIndex) const
318 _GalleryCanvas* pCanvas = GetCanvasManager().GetCanvas(canvasIndex);
319 SysTryReturn(NID_UI_CTRL, pCanvas != null, FloatRectangle(-1, -1, -1, -1), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
321 SetLastResult(E_SUCCESS);
323 return pCanvas->GetBounds();
327 _GalleryRenderer::GetCanvasAlignBoundary(int canvasIndex) const
329 _GalleryCanvas* pCanvas = GetCanvasManager().GetCanvas(canvasIndex);
330 SysTryReturn(NID_UI_CTRL, pCanvas != null, FloatRectangle(-1, -1, -1, -1), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
332 SetLastResult(E_SUCCESS);
334 FloatRectangle alignBoundary = pCanvas->GetAlignBoundary();
335 if (alignBoundary.width == -1 || alignBoundary.width < GetViewRect().width)
337 alignBoundary = GetViewRect();
340 return alignBoundary;
344 _GalleryRenderer::SetCanvasImageBounds(int canvasIndex, const FloatRectangle& bounds)
346 _GalleryCanvas* pCanvas = GetCanvasManager().GetCanvas(canvasIndex);
347 result r = GetLastResult();
348 SysTryReturn(NID_UI_CTRL, pCanvas != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
349 pCanvas->SetImageBounds(bounds);
355 _GalleryRenderer::GetCanvasImageBounds(int canvasIndex) const
357 _GalleryCanvas* pCanvas = GetCanvasManager().GetCanvas(canvasIndex);
358 SysTryReturn(NID_UI_CTRL, pCanvas != null, FloatRectangle(-1, -1, -1, -1), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
360 SetLastResult(E_SUCCESS);
362 return pCanvas->GetImageBounds();
366 _GalleryRenderer::RunCanvasTransition(int startCanvasIndex, int endCanvasIndex, _GalleryTransitionType transition,
367 const _GalleryAnimationTiming* pAnimation)
369 result r = E_SUCCESS;
370 ResetAnimationCount();
372 _GalleryCanvas* pCanvas = null;
373 for (int i = 0; i < GetCanvasManager().GetCanvasCount(); i++)
375 pCanvas = GetCanvasManager().GetCanvas(i);
377 SysTryReturn(NID_UI_CTRL, pCanvas != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
378 pCanvas->SetVisibility(false);
381 pCanvas = GetCanvasManager().GetCanvas(startCanvasIndex);
383 SysTryReturn(NID_UI_CTRL, pCanvas != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
385 r = pCanvas->SetVisibility(true);
386 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
388 pCanvas = GetCanvasManager().GetCanvas(endCanvasIndex);
390 SysTryReturn(NID_UI_CTRL, pCanvas != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
392 r = pCanvas->SetVisibility(true);
393 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
397 case GALLERY_TRANSITION_DISSOLVE:
398 r = RunDissolveTransition(startCanvasIndex, endCanvasIndex, pAnimation);
399 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
401 case GALLERY_TRANSITION_ZOOM:
402 r = RunZoomTransition(startCanvasIndex, endCanvasIndex, pAnimation);
403 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
405 case GALLERY_TRANSITION_PAGE:
406 r = RunPageTransition(startCanvasIndex, endCanvasIndex, pAnimation);
407 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
417 _GalleryRenderer::StopAllCanvasAnimation(void)
421 SetLastResult(E_SUCCESS);
426 _GalleryRenderer::IsRunningCanvasTransition(void) const
428 bool returnValue = (GetSlideShowPlayType() == GALLERY_SLIDESHOW_NONE && __animationRunning == false);
434 _GalleryRenderer::IsRunningCanvasAnimation(void) const
436 return __animationRunning;
440 _GalleryRenderer::IsExposed(void) const
446 _GalleryRenderer::RefreshView(void)
448 return GetCanvasManager().GetRootCanvas().RefreshCanvas();
452 _GalleryRenderer::ReleaseAllCanvasResource(void)
454 return GetCanvasManager().ReleaseAllCanvasResource();
458 _GalleryRenderer::ResetAllCanvas(void)
460 FloatRectangle viewRect = GetViewRect();
461 result r = GetCanvasManager().ResetAllCanvas(viewRect);
462 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
468 _GalleryRenderer::InitializeCanvasBounds(void)
470 int canvasCount = GetCanvasManager().GetCanvasCount();
471 _GalleryCanvas* pCanvas = null;
472 FloatRectangle bounds = GetViewRect();
473 result r = E_SUCCESS;
474 for (int canvasIndex = 0; canvasIndex < canvasCount; canvasIndex++)
476 pCanvas = GetCanvasManager().GetCanvas(canvasIndex);
478 SysTryReturn(NID_UI_CTRL, pCanvas != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
480 r = pCanvas->SetBounds(bounds);
481 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
483 r = pCanvas->SetVisibility(false);
484 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
492 _GalleryRenderer::Draw(void)
494 result r = E_SUCCESS;
495 if (__showEmptyImage == true)
497 r = ShowEmptyImageAndText();
498 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
499 SysLog(NID_UI_CTRL, "There is no image in gallery.");
503 r = GetCanvasManager().LoadAllCanvasImage();
504 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
511 _GalleryRenderer::GalleryBoundsChanged(int currentCanvasIndex)
513 _GalleryCanvas* pCanvas = null;
514 result r = E_SUCCESS;
516 pCanvas = GetCanvasManager().GetCanvas(currentCanvasIndex);
517 SysTryReturnVoidResult(NID_UI_CTRL, pCanvas != null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
519 float factor = pCanvas->GetCanvasFactor();
520 FloatRectangle bounds = pCanvas->GetBounds();
521 bounds.width *= factor;
522 bounds.height *= factor;
524 if (bounds.width != GetViewRect().width)
526 bounds.x = -(pCanvas->GetImageAnchor().x * bounds.width - GetViewRect().width / 2);
527 bounds.y = -(pCanvas->GetImageAnchor().y * bounds.height - GetViewRect().height / 2);
529 r = pCanvas->GetFrameVisualElement().SetBounds(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height));
530 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
531 pCanvas->SetImageBounds(bounds);
533 r = pCanvas->SetBounds(bounds);
534 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
537 SetLastResult(E_SUCCESS);
542 _GalleryRenderer::OnVisualElementAnimationStarted(const VisualElementAnimation& animation, const String& keyName, VisualElement& target)
544 _GalleryRendererNotification* pRendererNotifier = new (std::nothrow)_GalleryRendererNotification(GALLERY_RENDERER_NOTI_CANVAS_ANIMATION_STARTED);
545 SysTryReturnVoidResult(NID_UI_CTRL, pRendererNotifier != null, E_OUT_OF_MEMORY,
546 "[E_OUT_OF_MEMORY] Failed to allocate the memory for the _GalleryRendererNotification.");
547 GetRendererNotifier().Fire(*pRendererNotifier);
551 _GalleryRenderer::OnVisualElementAnimationRepeated(const VisualElementAnimation& animation, const String& keyName, VisualElement& target, long currentRepeatCount)
557 _GalleryRenderer::OnVisualElementAnimationFinished(const VisualElementAnimation& animation,
558 const String& keyName,
559 VisualElement& target,
560 bool completedNormally)
562 _GalleryRendererNotification* pRendererNotifier = null;
564 if (completedNormally == true)
566 ReleaseAnimationCount();
567 if (GetSlideShowPlayType() == GALLERY_SLIDESHOW_NONE)
569 if (GetAnimationCount() == 0)
571 pRendererNotifier = new (std::nothrow)_GalleryRendererNotification(GALLERY_RENDERER_NOTI_CANVAS_ANIMATION_COMPLETED);
572 SysTryReturnVoidResult(NID_UI_CTRL, pRendererNotifier != null, E_OUT_OF_MEMORY,
573 "[E_OUT_OF_MEMORY] Failed to allocate the memory for the _GalleryRendererNotification.");
574 GetRendererNotifier().Fire(*pRendererNotifier);
575 __animationRunning = false;
580 if (GetAnimationCount() == 0)
582 SetSlideShowPlayType(GALLERY_SLIDESHOW_NONE);
583 pRendererNotifier = new (std::nothrow)_GalleryRendererNotification(GALLERY_RENDERER_NOTI_TRANSITION_COMPLETED);
584 SysTryReturnVoidResult(NID_UI_CTRL, pRendererNotifier != null, E_OUT_OF_MEMORY,
585 "[E_OUT_OF_MEMORY] Failed to allocate the memory for the _GalleryRendererNotification.");
587 GetRendererNotifier().Fire(*pRendererNotifier);
593 if (GetSlideShowPlayType() != GALLERY_SLIDESHOW_NONE)
595 SetSlideShowPlayType(GALLERY_SLIDESHOW_NONE);
596 pRendererNotifier = new (std::nothrow)_GalleryRendererNotification(GALLERY_RENDERER_NOTI_TRANSITION_CANCEL);
597 SysTryReturnVoidResult(NID_UI_CTRL, pRendererNotifier != null, E_OUT_OF_MEMORY,
598 "[E_OUT_OF_MEMORY] Failed to allocate the memory for the _GalleryRendererNotification.");
600 GetRendererNotifier().Fire(*pRendererNotifier);
604 SetLastResult(E_SUCCESS);
608 _GalleryRenderer::_GalleryRenderer(void)
610 , __pCanvasManager(null)
611 , __pRendererNotifyer(null)
612 , __pGalleryAnimationDelegator(null)
614 , __emptyCanvasIndex(-1)
615 , __slideShowAnimationCount(0)
616 , __slideShowPlayType(GALLERY_SLIDESHOW_NONE)
617 , __showEmptyImage(true)
618 , __animationRunning(false)
619 , __needDrawEmptyCanvas(true)
620 , __startCanvasOfPageCurling(-1)
621 , __endCanvasOfPageCurling(-1)
623 , __pTransparentBitmap(null)
624 , __pPageCurlingBitmap(null)
626 GET_COLOR_CONFIG(GALLERY::EMPTY_TEXT_NORMAL, __emptyTextColor);
629 _GalleryRenderer::~_GalleryRenderer(void)
633 if (GetEffect() != null)
635 EffectManager::GetInstance()->DestroyEffect(*__pEffect);
636 EffectManager::DestroyInstance();
640 delete __pCanvasManager;
641 delete __pGalleryAnimationDelegator;
642 delete __pRendererNotifyer;
643 delete __pTransparentBitmap;
644 delete __pPageCurlingBitmap;
648 _GalleryRenderer::Construct(_Control& control)
650 result r = E_SUCCESS;
651 _GalleryRendererNotifier* pRendererNotifier = null;
652 _GalleryCanvasManager* pCanvasManager = null;
653 _GalleryAnimationProvider* pVEDelegator = null;
654 FloatRectangle initialCanvasBounds = control.GetBoundsF();
656 pRendererNotifier = new (std::nothrow) _GalleryRendererNotifier();
657 SysTryCatch(NID_UI_CTRL, pRendererNotifier != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
659 r = pRendererNotifier->Construct();
660 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
662 pVEDelegator = new (std::nothrow) _GalleryAnimationProvider();
663 SysTryCatch(NID_UI_CTRL, pRendererNotifier != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
665 pCanvasManager = _GalleryCanvasManager::CreateCanvasManagerN(control, GALLERY_CANVAS_INITIAL_MAX_COUNT, initialCanvasBounds, pVEDelegator);
666 SysTryCatch(NID_UI_CTRL, pCanvasManager != null, , GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
669 SetRendererNotifier(*pRendererNotifier);
670 SetCanvasManager(*pCanvasManager);
671 SetAnimationDelegator(*pVEDelegator);
673 GetAnimationDelegator().SetAnimationDelegator(this);
678 delete pRendererNotifier;
685 _GalleryRenderer::ShowEmptyImageAndText(void)
687 Canvas* pEmptyCanvas = null;
688 FloatDimension textDimension(0, 0);
690 TextObject* pTextObject = null;
691 result r = E_SUCCESS;
693 if (__needDrawEmptyCanvas == true)
695 _GalleryCanvas* pEmptyGalleryCanvas = GetCanvasManager().GetCanvas(GetEmptyCanvasIndex());
697 SysTryReturn(NID_UI_CTRL, pEmptyGalleryCanvas != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
699 r = pEmptyGalleryCanvas->SetBounds(GetViewRect());
700 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
703 if (__emptyString.GetLength() != 0)
705 pFont = GetControl().GetFallbackFont();
706 SysTryCatch(NID_UI_CTRL, pFont != null, , GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
708 pFont->GetTextExtent(__emptyString, __emptyString.GetLength(), textDimension);
710 pTextObject = new (std::nothrow) TextObject;
711 SysTryCatch(NID_UI_CTRL, pTextObject != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
713 pTextObject->Construct();//(const_cast<wchar_t*>(__emptyString.GetPointer())), __emptyString.GetLength(), TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL);
714 TextSimple* pSimpleText = new (std::nothrow)TextSimple((const_cast<wchar_t*>(__emptyString.GetPointer())), __emptyString.GetLength(), TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL);
715 pTextObject->AppendElement(*pSimpleText);
717 pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV);
718 pTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_NONE);
719 pTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_CENTER | TEXT_OBJECT_ALIGNMENT_MIDDLE);
720 pTextObject->SetFont(pFont, 0, pTextObject->GetTextLength());
721 textDimension = pTextObject->GetTextExtentF(0, pTextObject->GetTextLength());
723 if (textDimension.width > GetViewRect().width)
725 textDimension.width = GetViewRect().width;
727 pTextObject->SetForegroundColor(__emptyTextColor, 0, pTextObject->GetTextLength());
730 FloatPoint imagePosition(0, 0);
731 FloatPoint textPosition(0, 0);
732 FloatDimension imageSize(0, 0);
733 FloatRectangle visualElementBounds(0, 0, 0, 0);
734 _GalleryBitmap* pImage = pEmptyGalleryCanvas->GetImage();
737 imageSize = pImage->GetSize();
740 if (imageSize.width >= textDimension.width)
742 visualElementBounds.x = GetViewRect().width - imageSize.width;
743 visualElementBounds.width = imageSize.width;
744 if (imageSize.width != textDimension.width)
746 textPosition.x = (imageSize.width - textDimension.width) / 2;
751 visualElementBounds.x = GetViewRect().width - textDimension.width;
752 visualElementBounds.width = textDimension.width;
753 imagePosition.x = (textDimension.width - imageSize.width) / 2;
755 visualElementBounds.height = imageSize.height + textDimension.height;
756 visualElementBounds.y = GetViewRect().height - visualElementBounds.height;
758 visualElementBounds.x = visualElementBounds.x / 2;
759 visualElementBounds.y = visualElementBounds.y / 2;
761 pEmptyGalleryCanvas->SetVisualElementBounds(visualElementBounds);
763 FloatRectangle imageBounds(imagePosition.x, imagePosition.y, imageSize.width, imageSize.height);
764 pEmptyGalleryCanvas->SetImageBounds(imageBounds);
766 if (pImage != null || __emptyString.GetLength() != 0)
768 pEmptyCanvas = pEmptyGalleryCanvas->GetImageVisualElement().GetCanvasN();
770 SysTryCatch(NID_UI_CTRL, pEmptyCanvas != null, , r, "[%s] Propagating.", GetErrorMessage(r));
772 Color color(0, 0, 0, 0);
773 pEmptyCanvas->SetBackgroundColor(color);
775 r = pEmptyCanvas->Clear();
776 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
780 if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*(pImage->GetInternalBitmap())))
782 FloatDimension size = pImage->GetSize();
783 FloatRectangle rect(imagePosition.x, imagePosition.y, size.width, size.height);
784 r = pEmptyCanvas->DrawNinePatchedBitmap(rect, *pImage->GetInternalBitmap());
785 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
789 r = pEmptyCanvas->DrawBitmap(imagePosition, *pImage->GetInternalBitmap());
790 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
794 textPosition.y = imageBounds.y + imageBounds.height;
795 if (pTextObject != null)
797 pTextObject->SetBounds(FloatRectangle(textPosition.x, textPosition.y, textDimension.width, textDimension.height));
798 pTextObject->Draw(*_CanvasImpl::GetInstance(*pEmptyCanvas));
805 r = pEmptyGalleryCanvas->GetImageVisualElement().SetFlushNeeded();
806 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
810 r = pEmptyGalleryCanvas->SetVisibility(true);
811 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
813 __needDrawEmptyCanvas = false;
826 _GalleryRenderer::RunDissolveTransition(int startCanvasIndex, int endCanvasIndex, const _GalleryAnimationTiming* pAnimation)
828 SysTryReturn(NID_UI_CTRL, pAnimation != null, E_INVALID_ARG, E_INVALID_ARG,
829 "[E_INVALID_ARG] The gallery animation timing is null");
831 FloatRectangle viewBounds = GetViewRect();
832 result r = SetCanvasBounds(endCanvasIndex, viewBounds);
833 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
835 _GalleryCanvas* pStartCanvas = GetCanvasManager().GetCanvas(startCanvasIndex);
837 SysTryReturn(NID_UI_CTRL, pStartCanvas != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
839 _GalleryCanvas* pEndCanvas = GetCanvasManager().GetCanvas(endCanvasIndex);
841 SysTryReturn(NID_UI_CTRL, pEndCanvas != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
843 _VisualElement& startVisualElement = pStartCanvas->GetFrameVisualElement();
844 r = startVisualElement.SetZOrder(&pEndCanvas->GetFrameVisualElement(), true);
845 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
847 startVisualElement.SetImplicitAnimationEnabled(true);
849 GetAnimationDelegator().SetGalleryAnimationTiming(*pAnimation);
850 startVisualElement.SetOpacity(0.0f);
853 startVisualElement.SetImplicitAnimationEnabled(false);
855 pEndCanvas->GetFrameVisualElement().SetOpacity(0.0f);
857 pEndCanvas->GetFrameVisualElement().SetImplicitAnimationEnabled(true);
859 pEndCanvas->GetFrameVisualElement().SetOpacity(1.0f);
860 //AddAnimationCount();
862 pEndCanvas->GetFrameVisualElement().SetImplicitAnimationEnabled(false);
864 SetSlideShowPlayType(GALLERY_SLIDESHOW_DISSOLVE);
870 _GalleryRenderer::RunZoomTransition(int startCanvasIndex, int endCanvasIndex, const _GalleryAnimationTiming* pAnimation)
872 result r = RunDissolveTransition(startCanvasIndex, endCanvasIndex, pAnimation);
873 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
875 FloatRectangle viewRect = GetViewRect();
876 FloatRectangle zoomBounds = viewRect;
877 zoomBounds.width *= GALLERY_ZOOM_TRANSITION_ZOOM_FACTOR;
878 zoomBounds.height *= GALLERY_ZOOM_TRANSITION_ZOOM_FACTOR;
879 zoomBounds.x = -(viewRect.width / 2 * (GALLERY_ZOOM_TRANSITION_ZOOM_FACTOR - 1));
880 zoomBounds.y = -(viewRect.height / 2 * (GALLERY_ZOOM_TRANSITION_ZOOM_FACTOR - 1));
882 r = SetCanvasBounds(startCanvasIndex, zoomBounds, pAnimation);
883 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
885 //AddAnimationCount();
887 SetSlideShowPlayType(GALLERY_SLIDESHOW_ZOOM);
893 _GalleryRenderer::RunPageTransition(int startCanvasIndex, int endCanvasIndex, const _GalleryAnimationTiming* pAnimation)
895 SysTryReturn(NID_UI_CTRL, pAnimation != null, E_INVALID_ARG, E_INVALID_ARG,
896 "[E_INVALID_ARG] The gallery animation timing is null");
898 result r = E_SUCCESS;
899 Effect* pEffect = null;
900 if (GetEffect() == null)
902 pEffect = EffectManager::GetInstance()->CreateEffect(L"/usr/share/osp/effects/gallery_page_curling.eff");
904 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
906 _GalleryImpl* pImpl = static_cast<_GalleryImpl*>(__pControl->GetUserData());
907 Gallery& pPublic = pImpl->GetPublic();
908 r = pEffect->SetRenderTarget(&pPublic);
909 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
913 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
918 SetStartCanvasOfPageCurling(startCanvasIndex);
919 SetEndCanvasOfPageCurling(endCanvasIndex);
921 r = SetCanvasBounds(startCanvasIndex, GetViewRect());
922 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
924 r = SetCanvasVisibility(startCanvasIndex, false);
925 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
927 r = SetCanvasVisibility(endCanvasIndex, false);
928 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
930 r = __pEffect->Start();
931 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
933 SetSlideShowPlayType(GALLERY_SLIDESHOW_PAGE);
940 EffectManager::GetInstance()->DestroyEffect(*pEffect);
943 if (__pEffect != null)
945 EffectManager::GetInstance()->DestroyEffect(*__pEffect);
948 EffectManager::DestroyInstance();
954 _GalleryRenderer::OnAnimationCancel(void)
956 _GalleryRendererNotification* pRendererNoti = new (std::nothrow)_GalleryRendererNotification(GALLERY_RENDERER_NOTI_CANVAS_ANIMATION_CANCEL);
957 SysTryReturnVoidResult(NID_UI_CTRL, pRendererNoti != null, E_OUT_OF_MEMORY,
958 "[E_OUT_OF_MEMORY] Failed to allocate the memory for the _GalleryRendererNotification.");
960 GetRendererNotifier().Fire(*pRendererNoti);
962 SetLastResult(E_SUCCESS);
967 _GalleryRenderer::SetControl(_Control& control)
969 __pControl = &control;
974 _GalleryRenderer::GetControl(void) const
980 _GalleryRenderer::SetCanvasManager(_GalleryCanvasManager& canvasManager)
982 __pCanvasManager = &canvasManager;
986 _GalleryCanvasManager&
987 _GalleryRenderer::GetCanvasManager(void) const
989 return (_GalleryCanvasManager&)*__pCanvasManager;
993 _GalleryRenderer::SetRendererNotifier(_GalleryRendererNotifier& rendererNotifier)
995 __pRendererNotifyer = &rendererNotifier;
999 _GalleryRendererNotifier&
1000 _GalleryRenderer::GetRendererNotifier(void) const
1002 return (_GalleryRendererNotifier&)*__pRendererNotifyer;
1006 _GalleryRenderer::SetAnimationDelegator(_GalleryAnimationProvider& galleryVEDelegator)
1008 __pGalleryAnimationDelegator = &galleryVEDelegator;
1012 _GalleryAnimationProvider&
1013 _GalleryRenderer::GetAnimationDelegator(void) const
1015 return *__pGalleryAnimationDelegator;
1019 _GalleryRenderer::SetEmptyCanvasIndex(int emptyCanvasIndex)
1021 __emptyCanvasIndex = emptyCanvasIndex;
1026 _GalleryRenderer::GetEmptyCanvasIndex(void) const
1028 return __emptyCanvasIndex;
1032 _GalleryRenderer::SetSlideShowPlayType(_GallerySlideShowType slideShowType)
1034 __slideShowPlayType = slideShowType;
1038 _GallerySlideShowType
1039 _GalleryRenderer::GetSlideShowPlayType(void) const
1041 return __slideShowPlayType;
1045 _GalleryRenderer::AddAnimationCount(void)
1047 __slideShowAnimationCount++;
1052 _GalleryRenderer::ReleaseAnimationCount(void)
1054 __slideShowAnimationCount--;
1059 _GalleryRenderer::ResetAnimationCount(void)
1061 __slideShowAnimationCount = 0;
1066 _GalleryRenderer::GetAnimationCount(void) const
1068 return __slideShowAnimationCount;
1072 _GalleryRenderer::StopAllAnimation(void)
1074 _GalleryCanvas* pCanvas = null;
1075 int canvasCount = GetCanvasManager().GetCanvasCount();
1076 result r = E_SUCCESS;
1077 for (int i = 0; i < canvasCount; i++)
1079 pCanvas = GetCanvasManager().GetCanvas(i);
1080 r = GetLastResult();
1081 SysTryReturnVoidResult(NID_UI_CTRL, pCanvas != null, r, "[%s] Propagating.", GetErrorMessage(r));
1083 pCanvas->GetImageVisualElement().RemoveAllAnimations();
1084 pCanvas->GetFrameVisualElement().RemoveAllAnimations();
1087 Canvas* pRootCanvas = null;
1088 Effect* pEffect = __pEffect;
1089 if (__pEffect != null)
1092 if (pEffect->IsRunning() == true)
1094 r = pEffect->Stop();
1095 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1098 EffectManager::GetInstance()->DestroyEffect(*pEffect);
1099 EffectManager::DestroyInstance();
1102 pRootCanvas = GetCanvasManager().GetRootCanvas().GetImageVisualElement()->GetCanvasN();
1103 r = GetLastResult();
1104 SysTryReturnVoidResult(NID_UI_CTRL, pRootCanvas != null, r, "[%s] Propagating.", GetErrorMessage(r));
1106 pRootCanvas->SetBackgroundColor(GetCanvasManager().GetRootCanvas().GetBackgroundColor());
1107 r = pRootCanvas->Clear();
1108 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1113 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1115 ResetAnimationCount();
1117 SetLastResult(E_SUCCESS);
1121 if (pEffect != null)
1123 EffectManager::GetInstance()->DestroyEffect(*pEffect);
1124 EffectManager::DestroyInstance();
1131 // 3d effect listener
1133 _GalleryRenderer::OnEffectStarted(Effect& effect)
1138 _GalleryRenderer::OnEffectFinished(Effect& effect, EffectResult effectResult, const IList& lastShownBitmapIds)
1140 FloatRectangle viewBounds = GetViewRect();
1141 int endCanvasIndex = GetEndCanvasOfPageCurling();
1142 result r = SetCanvasBounds(endCanvasIndex, viewBounds);
1143 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
1145 int startCanvasIndex = GetStartCanvasOfPageCurling();
1146 r = SetCanvasVisibility(startCanvasIndex, false);
1147 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
1149 delete __pTransparentBitmap;
1150 __pTransparentBitmap = null;
1152 delete __pPageCurlingBitmap;
1153 __pPageCurlingBitmap = null;
1155 _GalleryRendererNotification* pRendererNotifier = null;
1156 if (effectResult == EFFECT_RESULT_FINISHED)
1158 pRendererNotifier = new (std::nothrow)_GalleryRendererNotification(GALLERY_RENDERER_NOTI_TRANSITION_COMPLETED);
1159 SysTryReturnVoidResult(NID_UI_CTRL, pRendererNotifier != null, E_OUT_OF_MEMORY,
1160 "[E_OUT_OF_MEMORY] Failed to allocate the memory for the _GalleryRendererNotification.");
1161 GetRendererNotifier().FireAsync(*pRendererNotifier);
1165 pRendererNotifier = new (std::nothrow)_GalleryRendererNotification(GALLERY_RENDERER_NOTI_TRANSITION_CANCEL);
1166 SysTryReturnVoidResult(NID_UI_CTRL, pRendererNotifier != null, E_OUT_OF_MEMORY,
1167 "[E_OUT_OF_MEMORY] Failed to allocate the memory for the _GalleryRendererNotification.");
1168 GetRendererNotifier().Fire(*pRendererNotifier);
1171 SetSlideShowPlayType(GALLERY_SLIDESHOW_NONE);
1172 ResetAnimationCount();
1175 // 3d effect provider
1177 _GalleryRenderer::SetBitmap(Effect& effect, long bitmapId)
1179 int startCanvasIndex = GetStartCanvasOfPageCurling();
1180 int endCanvasIndex = GetEndCanvasOfPageCurling();
1182 _GalleryCanvas* pStartCanvas = GetCanvasManager().GetCanvas(startCanvasIndex);
1183 result r = GetLastResult();
1184 SysTryReturn(NID_UI_CTRL, pStartCanvas != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
1186 _GalleryCanvas* pEndCanvas = GetCanvasManager().GetCanvas(endCanvasIndex);
1187 r = GetLastResult();
1188 SysTryReturn(NID_UI_CTRL, pEndCanvas != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
1192 Canvas pageCurlingCanvas;
1193 r = pageCurlingCanvas.Construct(GetViewRect());
1194 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1196 pageCurlingCanvas.SetBackgroundColor(__pControl->GetBackgroundColor());
1197 r = GetLastResult();
1198 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1200 r = pageCurlingCanvas.Clear();
1201 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1203 FloatRectangle imageBounds = pStartCanvas->GetImageBounds();
1204 r = pageCurlingCanvas.DrawBitmap(imageBounds, *pStartCanvas->GetImage()->GetInternalBitmap());
1205 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1207 __pPageCurlingBitmap = new (std::nothrow) Bitmap();
1208 SysTryReturn(NID_UI_CTRL, __pPageCurlingBitmap != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
1210 r = __pPageCurlingBitmap->Construct(pageCurlingCanvas, GetViewRect());
1211 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1213 effect.SetBitmap(bitmapId, *__pPageCurlingBitmap);
1215 else if (bitmapId == 1)
1217 Canvas transparentCanvas;
1218 r = transparentCanvas.Construct(GetViewRect());
1219 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1221 transparentCanvas.SetBackgroundColor(__pControl->GetBackgroundColor());
1222 r = GetLastResult();
1223 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1225 r = transparentCanvas.Clear();
1226 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1228 FloatRectangle imageBounds = pEndCanvas->GetImageBounds();
1229 r = transparentCanvas.DrawBitmap(imageBounds, *pEndCanvas->GetImage()->GetInternalBitmap());
1230 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1232 __pTransparentBitmap = new (std::nothrow) Bitmap();
1233 SysTryReturn(NID_UI_CTRL, __pTransparentBitmap != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
1235 r = __pTransparentBitmap->Construct(transparentCanvas, GetViewRect());
1237 //r = __pTransparentBitmap->Construct(viewBounds);
1238 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1240 effect.SetBitmap(bitmapId, *__pTransparentBitmap);
1247 _GalleryRenderer::SetStartCanvasOfPageCurling(int startCanvasIndex)
1249 __startCanvasOfPageCurling = startCanvasIndex;
1253 _GalleryRenderer::GetStartCanvasOfPageCurling(void)
1255 return __startCanvasOfPageCurling;
1259 _GalleryRenderer::SetEndCanvasOfPageCurling(int endCanvasIndex)
1261 __endCanvasOfPageCurling = endCanvasIndex;
1265 _GalleryRenderer::GetEndCanvasOfPageCurling(void)
1267 return __endCanvasOfPageCurling;
1271 _GalleryRenderer::SetEffect(Effect* pEffect)
1273 SysTryReturnVoidResult(NID_UI_CTRL, pEffect != null, E_INVALID_ARG, "[E_INVALID_ARG] The effect object is null.");
1275 pEffect->SetEffectEventListener(this);
1276 result r = GetLastResult();
1277 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
1279 pEffect->SetResourceProvider(this);
1280 r = GetLastResult();
1281 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
1283 __pEffect = pEffect;
1285 SetLastResult(E_SUCCESS);
1288 Tizen::Ui::Effects::Effect*
1289 _GalleryRenderer::GetEffect(void)
1294 }}} // Tizen::Ui::Controls