Fix Rotation for ownee windows
[platform/framework/native/uifw.git] / src / ui / FUi_Window.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://floralicense.org/license/
10 //
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.
16 //
17
18 /**
19  * @file                FUi_Window.cpp
20  * @brief               This is the implementation file for the _Window class.
21  */
22
23 #include <FBaseSysLog.h>
24 #include <FUiAnimDisplayContext.h>
25 #include <FUiWindow.h>
26 #include <FBase_Log.h>
27 #include <FBaseColArrayListT.h>
28 #include "FUi_Window.h"
29 #include "FUi_ControlManager.h"
30 #include "FUi_TouchManager.h"
31 #include "FUiAnim_DisplayContextImpl.h"
32 #include "FUiAnim_RootVisualElement.h"
33 #include "FUiAnim_VisualElement.h"
34 #include "FUi_EcoreEvasMgr.h"
35 #include "FUi_EcoreEvas.h"
36 #include "FUiAnim_DisplayManager.h"
37 #include "FUiAnim_EflLayer.h"
38 #include "FUiCtrl_Form.h"
39 #include "FUiCtrl_FormImpl.h"
40 #include "FUiCtrl_FrameImpl.h"
41
42 using namespace Tizen::Base;
43 using namespace Tizen::Base::Collection;
44 using namespace Tizen::Graphics;
45 using namespace Tizen::Ui::Animations;
46 using namespace Tizen::Ui::Controls;
47
48 namespace Tizen { namespace Ui
49 {
50
51 _Window*
52 _Window::CreateWindowN(void)
53 {
54         _Window* pWindow = new (std::nothrow) _Window;
55         SysTryReturn(NID_UI, pWindow, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
56
57         result r = E_SUCCESS;
58
59         if (IsFailed(GetLastResult()))
60         {
61                 goto CATCH;
62         }
63
64         r = pWindow->CreateRootVisualElement();
65         SysTryCatch(NID_UI, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
66
67         pWindow->AcquireHandle();
68
69         return pWindow;
70
71 CATCH:
72         delete pWindow;
73         return null;
74 }
75
76 _Window::~_Window(void)
77 {
78         __destroying = true;
79         Close();
80         SetOwner(null);
81
82         if (__pDisplayContext)
83         {
84                 _DisplayContextImpl::DestroyPublicInstance(*__pDisplayContext);
85                 __pDisplayContext = null;
86         }
87
88         if(__pLayer)
89         {
90                 //_EflLayer* pLayer = static_cast<_EflLayer*>(__pLayer);
91                 //Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pLayer->GetEcoreEvas());
92                 //SysLog(NID_UI, "[Multi_Window] destroy x window(0x%x)", win);
93
94                 if(__pRootVisualElement)
95                 {
96                         __pRootVisualElement->DetachChild(*GetVisualElement());
97                 }
98                 delete __pLayer;
99                 __pLayer = NULL;
100         }
101 \r
102         delete __pDimmingLayer;
103         __pDimmingLayer = null;
104
105         __pRootVisualElement =NULL;
106 }
107
108 _IWindowDelegate&
109 _Window::GetWindowDelegate(void) const
110 {
111         if (__destroying)
112         {
113                 return const_cast<_Window&>(*this);
114         }
115
116         SysAssert(__pWindowDelegate);
117         return *__pWindowDelegate;
118 }
119
120 String
121 _Window::GetDescription(void) const
122 {
123         String description = _Control::GetDescription();
124         String descriptionTemp(L"");
125
126         descriptionTemp.Format(LOG_LEN_MAX, L"_Window: xid(0x%x) owner(0x%x) delegate(0x%x) activated(%d) destroying(%d) displayContext(0x%x)",
127                 GetNativeHandle(), __pOwner, __pWindowDelegate, __activated, __destroying, __pDisplayContext);
128
129         description.Append(descriptionTemp);
130
131         return description;
132 }
133
134 void
135 _Window::SetRootVisualElement(const Tizen::Ui::Animations::_RootVisualElement& rootVisualElement)
136 {
137         _RootVisualElement* pRootVE = const_cast<_RootVisualElement*>(&rootVisualElement);
138
139         __pRootVisualElement = pRootVE;
140 }
141
142 void
143 _Window::SetLayer(const Tizen::Ui::Animations::_NativeLayer& layer)
144 {
145         _NativeLayer* pLayer = const_cast<_NativeLayer*>(&layer);
146
147         __pLayer = pLayer;
148 }
149
150 bool
151 _Window::IsActivatedOnOpen(void) const
152 {
153         return true;
154 }
155
156 bool
157 _Window::IsActivated(void) const
158 {
159         return __activated;
160 }
161
162 void
163 _Window::SetWindowDelegate(_IWindowDelegate& delegate)
164 {
165         ClearLastResult();
166         __pWindowDelegate = &delegate;
167 }
168
169 void
170 _Window::ResetWindowDelegate(void)
171 {
172         ClearLastResult();
173         __pWindowDelegate = this;
174 }
175
176 bool
177 _Window::IsAttached(void) const
178 {
179         return _ControlManager::GetInstance()->IsWindowAttached(*this);
180 }
181
182 result
183 _Window::Open(bool drawAndShow)
184 {
185         bool visibleState = GetVisibleState();
186         if (!__isOpened && visibleState)
187         {
188                 _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
189                 SysTryReturn(NID_UI, pEcoreEvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
190                 pEcoreEvas->SetWindowVisibleState(*GetRootWindow(), visibleState);
191                 __isOpened = true;
192                 __isInitialized = true;
193                 return _ControlManager::GetInstance()->OpenWindow(*this, drawAndShow);
194         }
195
196         return E_SUCCESS;
197 }
198
199 void
200 _Window::Close(void)
201 {
202         if (__isOpened)
203         {
204                 bool visibleState = GetVisibleState();
205                 _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
206                 SysTryReturnVoidResult(NID_UI, pEcoreEvas, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
207                 pEcoreEvas->SetWindowVisibleState(*GetRootWindow(), visibleState);
208
209                 _ControlManager::GetInstance()->CloseWindow(*this);
210                 __isOpened = false;
211         }
212 }
213
214 _Control*
215 _Window::GetOwner(void) const
216 {
217         ClearLastResult();
218         return __pOwner;
219 }
220
221 void
222 _Window::SetOwner(_Control* pOwner)
223 {
224         ClearLastResult();
225
226         if (pOwner)
227         {
228                 _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
229                 if (pEcoreEvas)
230                 {
231                         if (__transient == true)
232                         {
233                                 pEcoreEvas->SetOwner(*this, *pOwner);
234                         }
235
236                         __transient = true;
237                 }
238         }
239
240         if (pOwner == __pOwner)
241         {
242                 return;
243         }
244
245         if (__pOwner)
246         {
247                 __pOwner->DetachOwnee(*this);
248         }
249
250         if (pOwner)
251         {
252                 pOwner->AttachOwnee(*this);
253         }
254         GetWindowDelegate().OnOwnerChanged(__pOwner);
255         __pOwner = pOwner;
256 }
257
258 result
259 _Window::CreateRootVisualElement(void)
260 {
261         result r = CreateLayer();
262         SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
263
264         _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
265         SysAssert(pEcoreEvas);
266 #if !defined(WINDOW_BASE_ROTATE)
267         pEcoreEvas->SetWindowOrientationEnabled(*this, false);
268 #else
269         __rotation = pEcoreEvas->GetWindowRotation(*this);
270         pEcoreEvas->RegisterWindowStateCallback(*this);
271 #endif
272
273         // Get visual element.
274         _VisualElement* pVisualElement = GetVisualElement();
275         SysAssert(pVisualElement);
276
277         pVisualElement->SetName(L"Window");
278         pVisualElement->SetClipChildrenEnabled(false);
279         pVisualElement->SetRenderOperation(_VisualElement::RENDER_OPERATION_COPY);
280
281         // Attach visual element to root visual element.
282         __pRootVisualElement->AttachChild(*GetVisualElement());
283
284 #if defined(WINDOW_BASE_ROTATE)
285         SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x] Create.", GetNativeHandle());
286 #endif
287
288         return E_SUCCESS;
289 }
290
291 result
292 _Window::CreateLayer(void)
293 {
294         _DisplayManager* pDisplayManager = _DisplayManager::GetInstance();
295         SysAssert(pDisplayManager);
296
297         __pLayer = _NativeLayer::CreateInstanceN();
298         SysAssert(__pLayer);
299         __pRootVisualElement = __pLayer->GetRootVisualElement();
300
301         _EflLayer* pLayer = static_cast<_EflLayer*>(__pLayer);
302         SysAssert(pLayer);
303
304         int rootWindowW = 0;
305         int rootWindowH = 0;
306         ecore_x_window_size_get(ecore_x_window_root_get((Ecore_X_Window)ecore_evas_window_get(pLayer->GetEcoreEvas())), &rootWindowW, &rootWindowH);
307
308         pLayer->SetBounds(FloatRectangle(0.0f, 0.0f, (float)rootWindowW, (float)rootWindowH));
309         pLayer->SetOpacity(0);
310
311         __pRootVisualElement->SetName(L"Root");
312
313         return E_SUCCESS;
314 }
315
316 bool
317 _Window::IsFocusableDescendant(const _Control* pFocus) const
318 {
319         return true;
320 }
321
322 void
323 _Window::SetActivationEnabled(bool enable)
324 {
325         _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
326         SysTryReturnVoidResult(NID_UI, pEcoreEvas, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
327
328         pEcoreEvas->SetWindowActivationEnabled(*GetRootWindow(), enable);
329
330         SetLastResult(E_SUCCESS);
331 }
332
333 bool
334 _Window::IsActivationEnabled(void)
335 {
336         _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
337         SysTryReturn(NID_UI, pEcoreEvas, true, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
338
339         bool enable = pEcoreEvas->IsWindowActivationEnabled(*GetRootWindow());
340
341         SetLastResult(E_SUCCESS);
342
343         return enable;
344 }
345
346 #if !defined(WINDOW_BASE_ROTATE)
347 void
348 _Window::SetOrientationEnabled(bool enable)
349 {
350         __orientationEnabled = enable;
351 }
352
353 bool
354 _Window::IsOrientationEnabled(void)
355 {
356         return __orientationEnabled;
357 }
358 #endif
359
360 _RootVisualElement*
361 _Window::GetRootVisualElement(void) const
362 {
363         return __pRootVisualElement;
364 }
365
366 NativeWindowHandle
367 _Window::GetNativeHandle(void) const
368 {
369         _RootVisualElement* pRootVE = GetRootVisualElement();
370         SysAssert(pRootVE);
371
372         _EflLayer* pLayer = static_cast<_EflLayer*>(pRootVE->GetNativeLayer());
373         SysAssert(pLayer);
374
375         Ecore_Evas* pEcoreEvas = pLayer->GetEcoreEvas();
376         Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pEcoreEvas);
377
378         return win;
379 }
380
381 void
382 _Window::OnActivated(void)
383 {
384         bool isFrameActivated = _ControlManager::GetInstance()->IsFrameActivated();
385         SysLog(NID_UI, "frameActivated(%d)", isFrameActivated);
386
387         _Control* focusedControl = GetFocusedControl();
388
389         if (focusedControl)
390         {
391                 focusedControl->SetFocused();
392         }
393
394         if (!isFrameActivated)
395         {
396                 return;
397         }
398
399         _Control* pFocus = GetFocused();
400         if (pFocus)
401         {
402                 pFocus->SetFocused();
403         }
404         else
405         {
406                 SetFocused();
407         }
408
409         _TouchManager* pTouchMgr = _TouchManager::GetInstance();
410         if (pTouchMgr)
411         {
412                 pTouchMgr->SetTouchCanceled(true);
413         }
414 }
415
416 void
417 _Window::OnNativeWindowActivated(void)
418 {
419
420 }
421
422 bool
423 _Window::OnNotifiedN(const _Control& source, IList* pArgs)
424 {
425         SysTryReturn(NID_UI_CTRL, pArgs, false, E_SYSTEM, "[E_SYSTEM] pArgs is null.")
426
427         String* pType = dynamic_cast <String*>(pArgs->GetAt(0));
428         SysTryReturn(NID_UI_CTRL, pType, false, E_SYSTEM, "[E_SYSTEM] pType is null.")
429
430         if (*pType == L"VisibilityEvent")
431         {
432                 int obscured = 0;
433
434                 Integer* pObscured = dynamic_cast<Integer*>(pArgs->GetAt(1));
435                 if (pObscured == null)
436                 {
437                         pArgs->RemoveAll(true);
438                         delete pArgs;
439
440                         return true;
441                 }
442
443                 obscured = pObscured->ToInt();
444                 if (obscured == 0)
445                 {
446                         GetWindowDelegate().OnNativeWindowActivated();
447                 }
448
449                 pArgs->RemoveAll(true);
450                 delete pArgs;
451
452                 return true;
453         }
454
455         return false;
456 }
457
458 void
459 _Window::OnDeactivated(void)
460 {
461         bool isFrameActivated = _ControlManager::GetInstance()->IsFrameActivated();
462         SysLog(NID_UI, "frameActivated(%d)", isFrameActivated);
463 }
464
465 void
466 _Window::OnOwnerChanged(_Control* pOldOwner)
467 {
468
469 }
470
471 result
472 _Window::OnBoundsChanging(const FloatRectangle& bounds)
473 {
474         _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
475         SysTryReturn(NID_UI, pEcoreEvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
476
477         pEcoreEvas->SetWindowBounds(*GetRootWindow(), bounds);
478         result r = GetLastResult();
479         SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
480
481         return r;
482 }
483
484 void
485 _Window::OnVisibleStateChanged(void)
486 {
487         ClearLastResult();
488
489         bool visibleState = GetVisibleState();
490         if (visibleState == false)
491         {
492                 Close();
493         }
494
495         result r = GetLastResult();
496         SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
497
498         SetLastResult(E_SUCCESS);
499 }
500
501 result
502 _Window::OnAttachingToMainTree(const _Control* pParent)
503 {
504         _EflLayer* pLayer = static_cast<_EflLayer*>(__pRootVisualElement->GetNativeLayer());
505         SysAssert(pLayer);
506         SetVisibleState(true);
507         pLayer->SetShowState(true);
508
509         return E_SUCCESS;
510 }
511
512 result
513 _Window::OnDetachingFromMainTree(void)
514 {
515         _EflLayer* pLayer = static_cast<_EflLayer*>(__pRootVisualElement->GetNativeLayer());
516         SysAssert(pLayer);
517         pLayer->SetShowState(false);
518
519         return E_SUCCESS;
520 }
521
522 #if defined(WINDOW_BASE_ROTATE)
523 void
524 _Window::OnWindowStateChanged(void)
525 {
526         // <0>
527         // Update rotation
528         // <1>
529         // Find current form
530         // Call UpdateOrientation
531         // <2>
532         // Find current frame
533         // Call UpdateOrientation
534         // <3>
535         // Find window
536         // Change layout
537         // Rotate window
538
539         _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
540         if (!pEcoreEvas)
541         {
542                 return;
543         }
544
545         int rotation = pEcoreEvas->GetWindowRotation(*this);
546
547         Rectangle winBounds = GetBounds();
548         SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x, %d, %d, %d, %d] OnWindowStateChanged : prev rot = %d, cur rot = %d", GetNativeHandle(), winBounds.x, winBounds.y, winBounds.width, winBounds.height, __rotation, rotation);
549
550         if (rotation == __rotation)
551         {
552                 return;
553         }
554
555         __rotation = rotation;
556
557         // <1>
558         int childCount = GetChildCount();
559         for (int i = childCount; i > 0; i--)
560         {
561                 _Control* pChild = GetChild(i - 1);
562                 
563                 _Form* pForm = dynamic_cast<_Form*>(pChild);
564                 if (pForm)
565                 {
566                         if (pForm->IsVisible())
567                         {
568                                 // Current Form
569                                 _FormImpl* pFormImpl = static_cast<_FormImpl*>(pForm->GetUserData());
570                                 if (pFormImpl)
571                                 {
572                                         pFormImpl->UpdateOrientation();
573                                 }
574
575                                 return;
576                         }
577                 }
578         }
579
580         // <2>
581         if (IsOrientationRoot())
582         {
583                 _FrameImpl* pFrameImpl = static_cast<_FrameImpl*>(GetUserData());
584                 if (pFrameImpl)
585                 {
586                         pFrameImpl->UpdateOrientation();
587                 }
588
589                 return;
590         }
591
592         // <3>
593         SysLog(NID_UI, "[Window Manager Rotation] ---------- Update Ownee Window : START ----------");
594
595         _ControlOrientation controlOrientation = (rotation == 0 || rotation == 180) ? _CONTROL_ORIENTATION_PORTRAIT : _CONTROL_ORIENTATION_LANDSCAPE;
596         ChangeLayout(controlOrientation);
597
598         pEcoreEvas->RotateWindow(*this, __rotation);
599
600         Invalidate(true);
601
602         SysLog(NID_UI, "[Window Manager Rotation] ---------- Update Ownee Window : END ----------");
603 }
604
605 void
606 _Window::SetPreferredRotation(bool enable)
607 {
608         __preferredRotation = enable;
609 }
610
611 bool
612 _Window::GetPreferredRotation(void) const
613 {
614         return __preferredRotation;
615 }
616
617 #if defined(WINDOW_OWNEE_PREFERRED)
618 bool
619 _Window::IsRotationSynchronized(void) const
620 {
621         return false;
622 }
623 #endif
624 #endif
625
626 bool
627 _Window::IsLayoutChangable(void) const
628 {
629         return false;
630 }
631
632 #if defined(WINDOW_BASE_ROTATE)
633 void
634 _Window::SetRotation(int rotation)
635 {
636         __rotation = rotation;
637 }
638 #endif
639
640 void
641 _Window::OnChangeLayout(_ControlOrientation orientation)
642 {
643         _DimmingLayer *pLayer = GetDimmingLayer();
644         if (pLayer)
645         {
646                 result r = GetDimmingLayer()->Rearrange();
647                 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
648         }
649
650         // if window, change its size specially for full-screen(Form, Frame, etc.).
651         _Control::OnChangeLayout(orientation); // if called, layout will be changed.
652 }
653
654 WindowState
655 _Window::GetWindowState(void) const
656 {
657         ClearLastResult();
658         return __windowState;
659 }
660
661 void
662 _Window::SetWindowState(WindowState windowState)
663 {
664         __windowState = windowState;
665 }
666
667 DisplayContext*
668 _Window::GetDisplayContext(void) const
669 {
670         if (!__pDisplayContext)
671         {
672                 SysTryReturn(NID_UI, __pLayer, null, E_SYSTEM, "[E_SYSTEM] Cannot gain the DisplayContext. This window is not completed.");
673
674                 __pDisplayContext = _DisplayContextImpl::CreatePublicInstance(*__pLayer);
675         }
676
677         result r = GetLastResult();
678         SysTryReturn(NID_UI, __pDisplayContext, null, r, "[%s] Propagating.", GetErrorMessage(r));
679
680         return __pDisplayContext;
681 }
682
683 result
684 _Window::SetZOrderGroup(int windowZOrderGroup)
685 {
686         __transient = false;
687
688         _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
689         bool visible = pEcoreEvas->IsWindowVisible(*this);
690         bool activationEnabled = pEcoreEvas->IsWindowActivationEnabled(*this);
691
692         if ((visible == true) && (activationEnabled == true))
693         {
694                 pEcoreEvas->ActivateWindow(*this);
695         }
696
697         return E_SUCCESS;
698 }
699
700 _Window::_Window()
701         : __windowState(WINDOW_STATE_INITIALIZED)
702         , __pOwner(null)
703         , __pWindowDelegate(null)
704         , __activated(false)
705         , __destroying(false)
706         , __pRootVisualElement(null)
707         , __pLayer(null)
708         , __pDimmingLayer(null)
709         , __pDisplayContext(null)
710         , __systemWindow(false)
711         , __isOpened(false)
712         , __isInitialized(false)
713         , __pFocusedControl(null)
714         , __transient(true)
715         , __dimmingEnabled(false)
716 #if !defined(WINDOW_BASE_ROTATE)
717         , __orientationEnabled(false)
718 #else
719 #if !defined(WINDOW_OWNEE_PREFERRED)
720         , __rotation(0)
721 #else
722         , __rotation(-1)
723 #endif
724         , __preferredRotation(false)
725 #endif
726 {
727         SetControlDelegate(*this);
728         SetWindowDelegate(*this);
729         SetClipToParent(false); // [ToDo] exception check.
730 }
731
732 void
733 _Window::Activate(void)
734 {
735         if (__activated)
736         {
737                 return;
738         }
739
740         __activated = true;
741         GetWindowDelegate().OnActivated();
742 }
743
744 void
745 _Window::Deactivate(void)
746 {
747         __activated = false;
748
749         if (__destroying == false)
750         {
751                 GetWindowDelegate().OnDeactivated();
752         }
753 }
754
755 void
756 _Window::SetSystemWindow(bool systemWindow)
757 {
758         __systemWindow = systemWindow;
759 }
760
761 bool
762 _Window::IsSystemWindow(void) const
763 {
764         return __systemWindow;
765 }
766
767 void
768 _Window::SetFocusedControl(const _Control* pControl)
769 {
770         __pFocusedControl = const_cast<_Control*>(pControl);
771 }
772
773 _Control*
774 _Window::GetFocusedControl(void) const
775 {
776         return __pFocusedControl;
777 }
778
779 IListT<_Control*>*
780 _Window::GetFocusList(void) const
781 {
782         if(!__pFocusControlList)
783         {
784                 __pFocusControlList.reset(GetFocusListN());
785                 __pFocusControlList->InsertAt(const_cast<_Window*>(this), 0);
786         }
787         return __pFocusControlList.get();
788 }
789
790 void 
791 _Window::ResetFocusList(void)
792 {
793         if(__pFocusControlList)
794         {
795                 __pFocusControlList.reset();
796         }
797 }
798
799 result
800 _Window::SetDimmingEnabled(bool enabled)
801 {
802         __dimmingEnabled = enabled;
803
804         return E_SUCCESS;
805 }
806
807 bool
808 _Window::IsDimmingEnabled(void) const
809 {
810         return __dimmingEnabled;        
811 }
812
813 void 
814 _Window::SetDimmingLayer(_DimmingLayer* pLayer)
815 {
816         __pDimmingLayer = pLayer;
817 }
818
819 _DimmingLayer* 
820 _Window::GetDimmingLayer(void)
821 {
822         return __pDimmingLayer;
823 }
824
825 }} // Tizen::Ui