[Tizen] Make indicator always INVISIBLE until updating indicator code
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / common / window-impl.cpp
1 /*
2  * Copyright (c) 2018 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali/internal/window-system/common/window-impl.h>
20
21 // EXTERNAL HEADERS
22 #include <dali/integration-api/core.h>
23 #include <dali/integration-api/system-overlay.h>
24 #include <dali/public-api/render-tasks/render-task.h>
25 #include <dali/public-api/render-tasks/render-task-list.h>
26 #include <dali/devel-api/adaptor-framework/orientation.h>
27
28 // INTERNAL HEADERS
29 #include <dali/internal/input/common/drag-and-drop-detector-impl.h>
30 #include <dali/internal/window-system/common/window-visibility-observer.h>
31 #include <dali/internal/window-system/common/orientation-impl.h>
32 #include <dali/internal/window-system/common/render-surface-factory.h>
33 #include <dali/internal/window-system/common/window-factory.h>
34 #include <dali/internal/window-system/common/window-base.h>
35 #include <dali/internal/window-system/common/window-render-surface.h>
36
37 namespace Dali
38 {
39 namespace Internal
40 {
41 namespace Adaptor
42 {
43
44 namespace
45 {
46
47 #if defined(DEBUG_ENABLED)
48 Debug::Filter* gWindowLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_WINDOW" );
49 #endif
50
51 } // unnamed namespace
52
53 Window* Window::New( const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent )
54 {
55   Window* window = new Window();
56   window->mIsTransparent = isTransparent;
57   window->Initialize( positionSize, name, className );
58   return window;
59 }
60
61 Window::Window()
62 : mSurface( NULL ),
63   mWindowBase(),
64   mIndicatorVisible( Dali::Window::INVISIBLE ),
65   mIndicatorIsShown( false ),
66   mShowRotatedIndicatorOnClose( false ),
67   mStarted( false ),
68   mIsTransparent( false ),
69   mIsFocusAcceptable( true ),
70   mVisible( true ),
71   mIconified( false ),
72   mOpaqueState( false ),
73   mResizeEnabled( false ),
74   mIndicator(),
75   mIndicatorOrientation( Dali::Window::PORTRAIT ),
76   mNextIndicatorOrientation( Dali::Window::PORTRAIT ),
77   mIndicatorOpacityMode( Dali::Window::OPAQUE ),
78   mOverlay( NULL ),
79   mAdaptor( NULL ),
80   mType( Dali::Window::NORMAL ),
81   mPreferredOrientation( Dali::Window::PORTRAIT ),
82   mIndicatorVisibilityChangedSignal(),
83   mFocusChangedSignal(),
84   mResizedSignal(),
85   mDeleteRequestSignal()
86 {
87 }
88
89 Window::~Window()
90 {
91   if( mIndicator )
92   {
93     mOverlay->Remove( mIndicator->GetActor() );
94     Dali::RenderTaskList taskList = mOverlay->GetOverlayRenderTasks();
95     Dali::RenderTask indicatorTask = taskList.GetTask(0);
96     mOverlay->GetOverlayRenderTasks().RemoveTask(indicatorTask);
97     mIndicator->Close();
98   }
99
100   if ( mAdaptor )
101   {
102     mAdaptor->RemoveObserver( *this );
103     mAdaptor->SetDragAndDropDetector( NULL );
104     mAdaptor = NULL;
105   }
106
107   delete mSurface;
108 }
109
110 void Window::Initialize(const PositionSize& positionSize, const std::string& name, const std::string& className)
111 {
112   // create a window render surface
113   Any surface;
114   auto renderSurfaceFactory = Dali::Internal::Adaptor::GetRenderSurfaceFactory();
115   auto windowRenderSurface = renderSurfaceFactory->CreateWindowRenderSurface( positionSize, surface, name, className, mIsTransparent );
116   mSurface = windowRenderSurface.release();
117
118   // create a window base
119   auto windowFactory = Dali::Internal::Adaptor::GetWindowFactory();
120   mWindowBase = windowFactory->CreateWindowBase( this, mSurface );
121
122   mWindowBase->Initialize();
123
124   if( !positionSize.IsEmpty() )
125   {
126     AddAuxiliaryHint( "wm.policy.win.user.geometry", "1" );
127     mResizeEnabled = true;
128   }
129
130   SetClass( name, className );
131
132   mSurface->Map();
133
134   mOrientation = Orientation::New( this );
135 }
136
137 void Window::SetAdaptor(Dali::Adaptor& adaptor)
138 {
139   DALI_ASSERT_ALWAYS( !mStarted && "Adaptor already started" );
140   mStarted = true;
141
142   // Only create one overlay per window
143   Internal::Adaptor::Adaptor& adaptorImpl = Internal::Adaptor::Adaptor::GetImplementation(adaptor);
144   Integration::Core& core = adaptorImpl.GetCore();
145   mOverlay = &core.GetSystemOverlay();
146
147   Dali::RenderTaskList taskList = mOverlay->GetOverlayRenderTasks();
148   taskList.CreateTask();
149
150   mAdaptor = &adaptorImpl;
151   mAdaptor->AddObserver( *this );
152
153   // Can only create the detector when we know the Core has been instantiated.
154   mDragAndDropDetector = DragAndDropDetector::New();
155   mAdaptor->SetDragAndDropDetector( &GetImplementation( mDragAndDropDetector ) );
156
157   if( mOrientation )
158   {
159     mOrientation->SetAdaptor(adaptor);
160   }
161
162   if( mIndicator != NULL )
163   {
164     mIndicator->SetAdaptor(mAdaptor);
165   }
166 }
167
168 WindowRenderSurface* Window::GetSurface()
169 {
170   return mSurface;
171 }
172
173 void Window::ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode )
174 {
175   //Make always INVISIBLE until updating indicator code.
176   mIndicatorVisible = Dali::Window::INVISIBLE;
177
178   mWindowBase->ShowIndicator( mIndicatorVisible, mIndicatorOpacityMode );
179
180   DoShowIndicator( mIndicatorOrientation );
181 }
182
183 void Window::SetIndicatorBgOpacity( Dali::Window::IndicatorBgOpacity opacityMode )
184 {
185   mIndicatorOpacityMode = opacityMode;
186
187   if( mIndicator != NULL )
188   {
189     mIndicator->SetOpacityMode( opacityMode );
190   }
191 }
192
193 void Window::SetIndicatorVisibleMode( Dali::Window::IndicatorVisibleMode mode )
194 {
195   //Make always INVISIBLE until updating indicator code.
196   mIndicatorVisible = Dali::Window::INVISIBLE;
197 }
198
199 void Window::RotateIndicator( Dali::Window::WindowOrientation orientation )
200 {
201   DALI_LOG_TRACE_METHOD_FMT( gWindowLogFilter, "Orientation: %d\n", orientation );
202
203   DoRotateIndicator( orientation );
204 }
205
206 void Window::SetClass( std::string name, std::string className )
207 {
208   mWindowBase->SetClass( name, className );
209 }
210
211 void Window::Raise()
212 {
213   mWindowBase->Raise();
214 }
215
216 void Window::Lower()
217 {
218   mWindowBase->Lower();
219 }
220
221 void Window::Activate()
222 {
223   mWindowBase->Activate();
224 }
225
226 void Window::AddAvailableOrientation( Dali::Window::WindowOrientation orientation )
227 {
228   bool found = false;
229
230   if( orientation <= Dali::Window::LANDSCAPE_INVERSE )
231   {
232     for( std::size_t i = 0; i < mAvailableOrientations.size(); i++ )
233     {
234       if( mAvailableOrientations[i] == orientation )
235       {
236         found = true;
237         break;
238       }
239     }
240
241     if( !found )
242     {
243       mAvailableOrientations.push_back( orientation );
244       SetAvailableOrientations( mAvailableOrientations );
245     }
246   }
247 }
248
249 void Window::RemoveAvailableOrientation( Dali::Window::WindowOrientation orientation )
250 {
251   for( std::vector<Dali::Window::WindowOrientation>::iterator iter = mAvailableOrientations.begin();
252        iter != mAvailableOrientations.end(); ++iter )
253   {
254     if( *iter == orientation )
255     {
256       mAvailableOrientations.erase( iter );
257       break;
258     }
259   }
260   SetAvailableOrientations( mAvailableOrientations );
261 }
262
263 void Window::SetAvailableOrientations( const std::vector< Dali::Window::WindowOrientation >& orientations )
264 {
265   if( orientations.size() > 4 )
266   {
267     DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetAvailableOrientations: Invalid vector size! [%d]\n", orientations.size() );
268     return;
269   }
270
271   mAvailableOrientations = orientations;
272
273   mWindowBase->SetAvailableOrientations( mAvailableOrientations );
274 }
275
276 const std::vector< Dali::Window::WindowOrientation >& Window::GetAvailableOrientations()
277 {
278   return mAvailableOrientations;
279 }
280
281 void Window::SetPreferredOrientation( Dali::Window::WindowOrientation orientation )
282 {
283   mPreferredOrientation = orientation;
284
285   mWindowBase->SetPreferredOrientation( mPreferredOrientation );
286 }
287
288 Dali::Window::WindowOrientation Window::GetPreferredOrientation()
289 {
290   return mPreferredOrientation;
291 }
292
293 Dali::DragAndDropDetector Window::GetDragAndDropDetector() const
294 {
295   return mDragAndDropDetector;
296 }
297
298 Dali::Any Window::GetNativeHandle() const
299 {
300   return mSurface->GetWindow();
301 }
302
303 void Window::SetAcceptFocus( bool accept )
304 {
305   mIsFocusAcceptable = accept;
306
307   mWindowBase->SetAcceptFocus( accept );
308 }
309
310 bool Window::IsFocusAcceptable() const
311 {
312   return mIsFocusAcceptable;
313 }
314
315 void Window::Show()
316 {
317   mVisible = true;
318
319   mWindowBase->Show();
320
321   if( !mIconified )
322   {
323     WindowVisibilityObserver* observer( mAdaptor );
324     observer->OnWindowShown();
325     DALI_LOG_RELEASE_INFO( "Window (%p) ::Show()\n", this );
326   }
327 }
328
329 void Window::Hide()
330 {
331   mVisible = false;
332
333   mWindowBase->Hide();
334
335   if( !mIconified )
336   {
337     WindowVisibilityObserver* observer( mAdaptor );
338     observer->OnWindowHidden();
339     DALI_LOG_RELEASE_INFO( "Window (%p) ::Hide() \n", this );
340   }
341 }
342
343 bool Window::IsVisible() const
344 {
345   return mVisible;
346 }
347
348 unsigned int Window::GetSupportedAuxiliaryHintCount() const
349 {
350   return mWindowBase->GetSupportedAuxiliaryHintCount();
351 }
352
353 std::string Window::GetSupportedAuxiliaryHint( unsigned int index ) const
354 {
355   return mWindowBase->GetSupportedAuxiliaryHint( index );
356 }
357
358 unsigned int Window::AddAuxiliaryHint( const std::string& hint, const std::string& value )
359 {
360   return mWindowBase->AddAuxiliaryHint( hint, value );
361 }
362
363 bool Window::RemoveAuxiliaryHint( unsigned int id )
364 {
365   return mWindowBase->RemoveAuxiliaryHint( id );
366 }
367
368 bool Window::SetAuxiliaryHintValue( unsigned int id, const std::string& value )
369 {
370   return mWindowBase->SetAuxiliaryHintValue( id, value );
371 }
372
373 std::string Window::GetAuxiliaryHintValue( unsigned int id ) const
374 {
375   return mWindowBase->GetAuxiliaryHintValue( id );
376 }
377
378 unsigned int Window::GetAuxiliaryHintId( const std::string& hint ) const
379 {
380   return mWindowBase->GetAuxiliaryHintId( hint );
381 }
382
383 void Window::SetInputRegion( const Rect< int >& inputRegion )
384 {
385   mWindowBase->SetInputRegion( inputRegion );
386
387   DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetInputRegion: x = %d, y = %d, w = %d, h = %d\n", inputRegion.x, inputRegion.y, inputRegion.width, inputRegion.height );
388 }
389
390 void Window::SetType( Dali::Window::Type type )
391 {
392   if( type != mType )
393   {
394     mWindowBase->SetType( type );
395
396     mType = type;
397   }
398 }
399
400 Dali::Window::Type Window::GetType() const
401 {
402   return mType;
403 }
404
405 bool Window::SetNotificationLevel( Dali::Window::NotificationLevel::Type level )
406 {
407   if( mType != Dali::Window::NOTIFICATION )
408   {
409     DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetNotificationLevel: Not supported window type [%d]\n", mType );
410     return false;
411   }
412
413   return mWindowBase->SetNotificationLevel( level );
414 }
415
416 Dali::Window::NotificationLevel::Type Window::GetNotificationLevel() const
417 {
418   if( mType != Dali::Window::NOTIFICATION )
419   {
420     DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetNotificationLevel: Not supported window type [%d]\n", mType );
421     return Dali::Window::NotificationLevel::NONE;
422   }
423
424   return mWindowBase->GetNotificationLevel();
425 }
426
427 void Window::SetOpaqueState( bool opaque )
428 {
429   mOpaqueState = opaque;
430
431   mWindowBase->SetOpaqueState( opaque );
432
433   DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetOpaqueState: opaque = %d\n", opaque );
434 }
435
436 bool Window::IsOpaqueState() const
437 {
438   return mOpaqueState;
439 }
440
441 bool Window::SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode)
442 {
443   return mWindowBase->SetScreenOffMode( screenOffMode );
444 }
445
446 Dali::Window::ScreenOffMode::Type Window::GetScreenOffMode() const
447 {
448   return mWindowBase->GetScreenOffMode();
449 }
450
451 bool Window::SetBrightness( int brightness )
452 {
453   if( brightness < 0 || brightness > 100 )
454   {
455     DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetBrightness: Invalid brightness value [%d]\n", brightness );
456     return false;
457   }
458
459   return mWindowBase->SetBrightness( brightness );
460 }
461
462 int Window::GetBrightness() const
463 {
464   return mWindowBase->GetBrightness();
465 }
466
467 void Window::SetSize( Dali::Window::WindowSize size )
468 {
469   if( !mResizeEnabled )
470   {
471     AddAuxiliaryHint( "wm.policy.win.user.geometry", "1" );
472     mResizeEnabled = true;
473   }
474
475   PositionSize positionSize = mSurface->GetPositionSize();
476
477   if( positionSize.width != size.GetWidth() || positionSize.height != size.GetHeight() )
478   {
479     positionSize.width = size.GetWidth();
480     positionSize.height = size.GetHeight();
481
482     mSurface->MoveResize( positionSize );
483
484     mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
485
486     // Emit signal
487     mResizedSignal.Emit( Dali::Window::WindowSize( positionSize.width, positionSize.height ) );
488
489     mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
490   }
491 }
492
493 Dali::Window::WindowSize Window::GetSize() const
494 {
495   PositionSize positionSize = mSurface->GetPositionSize();
496
497   return Dali::Window::WindowSize( positionSize.width, positionSize.height );
498 }
499
500 void Window::SetPosition( Dali::Window::WindowPosition position )
501 {
502   if( !mResizeEnabled )
503   {
504     AddAuxiliaryHint( "wm.policy.win.user.geometry", "1" );
505     mResizeEnabled = true;
506   }
507
508   PositionSize positionSize = mSurface->GetPositionSize();
509
510   if( positionSize.x != position.GetX() || positionSize.y != position.GetY() )
511   {
512     positionSize.x = position.GetX();
513     positionSize.y = position.GetY();
514
515     mSurface->MoveResize( positionSize );
516   }
517 }
518
519 Dali::Window::WindowPosition Window::GetPosition() const
520 {
521   PositionSize positionSize = mSurface->GetPositionSize();
522
523   return Dali::Window::WindowPosition( positionSize.x, positionSize.y );
524 }
525
526 void Window::SetTransparency( bool transparent )
527 {
528   mSurface->SetTransparency( transparent );
529 }
530
531 bool Window::GrabKey( Dali::KEY key, KeyGrab::KeyGrabMode grabMode )
532 {
533   return mWindowBase->GrabKey( key, grabMode );
534 }
535
536 bool Window::UngrabKey( Dali::KEY key )
537 {
538   return mWindowBase->UngrabKey( key );
539 }
540
541 bool Window::GrabKeyList( const Dali::Vector< Dali::KEY >& key, const Dali::Vector< KeyGrab::KeyGrabMode >& grabMode, Dali::Vector< bool >& result )
542 {
543   return mWindowBase->GrabKeyList( key, grabMode, result );
544 }
545
546 bool Window::UngrabKeyList( const Dali::Vector< Dali::KEY >& key, Dali::Vector< bool >& result )
547 {
548   return mWindowBase->UngrabKeyList( key, result );
549 }
550
551 void Window::RotationDone( int orientation, int width, int height )
552 {
553   mSurface->RequestRotation( orientation, width, height );
554
555   mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( width, height ) );
556
557   // Emit signal
558   mResizedSignal.Emit( Dali::Window::WindowSize( width, height ) );
559
560   mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( width, height ) );
561 }
562
563 void Window::OnIconifyChanged( bool iconified )
564 {
565   if( iconified )
566   {
567     mIconified = true;
568
569     if( mVisible )
570     {
571       WindowVisibilityObserver* observer( mAdaptor );
572       observer->OnWindowHidden();
573       DALI_LOG_RELEASE_INFO( "Window (%p) Iconified\n", this );
574     }
575   }
576   else
577   {
578     mIconified = false;
579
580     if( mVisible )
581     {
582       WindowVisibilityObserver* observer( mAdaptor );
583       observer->OnWindowShown();
584       DALI_LOG_RELEASE_INFO( "Window (%p) Deiconified\n", this );
585     }
586   }
587 }
588
589 void Window::OnFocusChanged( bool focusIn )
590 {
591   mFocusChangedSignal.Emit( focusIn );
592 }
593
594 void Window::OnOutputTransformed()
595 {
596   PositionSize positionSize = mSurface->GetPositionSize();
597   mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
598   mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
599 }
600
601 void Window::OnDeleteRequest()
602 {
603   mDeleteRequestSignal.Emit();
604 }
605
606 void Window::DoShowIndicator( Dali::Window::WindowOrientation lastOrientation )
607 {
608   if( mIndicator == NULL )
609   {
610     if( mIndicatorVisible != Dali::Window::INVISIBLE )
611     {
612       auto windowFactory = Dali::Internal::Adaptor::GetWindowFactory();
613       mIndicator = windowFactory->CreateIndicator( mAdaptor, mIndicatorOrientation, this );
614       if( mIndicator )
615       {
616         mIndicator->SetOpacityMode( mIndicatorOpacityMode );
617         Dali::Actor actor = mIndicator->GetActor();
618         SetIndicatorActorRotation();
619         mOverlay->Add(actor);
620       }
621     }
622     // else don't create a hidden indicator
623   }
624   else // Already have indicator
625   {
626     if( mIndicatorVisible == Dali::Window::VISIBLE )
627     {
628       // If we are resuming, and rotation has changed,
629       if( mIndicatorIsShown == false && mIndicatorOrientation != mNextIndicatorOrientation )
630       {
631         // then close current indicator and open new one
632         mShowRotatedIndicatorOnClose = true;
633         mIndicator->Close(); // May synchronously call IndicatorClosed() callback & 1 level of recursion
634         // Don't show actor - will contain indicator for old orientation.
635       }
636     }
637   }
638
639   // set indicator visible mode
640   if( mIndicator != NULL )
641   {
642     mIndicator->SetVisible( mIndicatorVisible );
643   }
644
645   bool show = (mIndicatorVisible != Dali::Window::INVISIBLE );
646   SetIndicatorProperties( show, lastOrientation );
647   mIndicatorIsShown = show;
648 }
649
650 void Window::DoRotateIndicator( Dali::Window::WindowOrientation orientation )
651 {
652   if( mIndicatorIsShown )
653   {
654     mShowRotatedIndicatorOnClose = true;
655     mNextIndicatorOrientation = orientation;
656     if( mIndicator )
657     {
658       mIndicator->Close(); // May synchronously call IndicatorClosed() callback
659     }
660   }
661   else
662   {
663     // Save orientation for when the indicator is next shown
664     mShowRotatedIndicatorOnClose = false;
665     mNextIndicatorOrientation = orientation;
666   }
667 }
668
669 void Window::SetIndicatorActorRotation()
670 {
671   DALI_LOG_TRACE_METHOD( gWindowLogFilter );
672   if( mIndicator )
673   {
674     Dali::Actor actor = mIndicator->GetActor();
675     switch( mIndicatorOrientation )
676     {
677       case Dali::Window::PORTRAIT:
678         actor.SetParentOrigin( ParentOrigin::TOP_CENTER );
679         actor.SetAnchorPoint(  AnchorPoint::TOP_CENTER );
680         actor.SetOrientation( Degree(0), Vector3::ZAXIS );
681         break;
682       case Dali::Window::PORTRAIT_INVERSE:
683         actor.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
684         actor.SetAnchorPoint(  AnchorPoint::TOP_CENTER );
685         actor.SetOrientation( Degree(180), Vector3::ZAXIS );
686         break;
687       case Dali::Window::LANDSCAPE:
688         actor.SetParentOrigin( ParentOrigin::CENTER_LEFT );
689         actor.SetAnchorPoint(  AnchorPoint::TOP_CENTER );
690         actor.SetOrientation( Degree(270), Vector3::ZAXIS );
691         break;
692       case Dali::Window::LANDSCAPE_INVERSE:
693         actor.SetParentOrigin( ParentOrigin::CENTER_RIGHT );
694         actor.SetAnchorPoint(  AnchorPoint::TOP_CENTER );
695         actor.SetOrientation( Degree(90), Vector3::ZAXIS );
696         break;
697     }
698   }
699 }
700
701 void Window::SetIndicatorProperties( bool isShow, Dali::Window::WindowOrientation lastOrientation )
702 {
703   mWindowBase->SetIndicatorProperties( isShow, lastOrientation );
704 }
705
706 void Window::IndicatorTypeChanged( IndicatorInterface::Type type )
707 {
708   mWindowBase->IndicatorTypeChanged( type );
709 }
710
711 void Window::IndicatorClosed( IndicatorInterface* indicator )
712 {
713   DALI_LOG_TRACE_METHOD( gWindowLogFilter );
714
715   if( mShowRotatedIndicatorOnClose )
716   {
717     Dali::Window::WindowOrientation currentOrientation = mIndicatorOrientation;
718     if( mIndicator )
719     {
720       mIndicator->Open( mNextIndicatorOrientation );
721     }
722     mIndicatorOrientation = mNextIndicatorOrientation;
723     SetIndicatorActorRotation();
724     DoShowIndicator( currentOrientation );
725   }
726 }
727
728 void Window::IndicatorVisibilityChanged( bool isVisible )
729 {
730   mIndicatorVisibilityChangedSignal.Emit( isVisible );
731 }
732
733 void Window::OnStart()
734 {
735   DoShowIndicator( mIndicatorOrientation );
736 }
737
738 void Window::OnPause()
739 {
740 }
741
742 void Window::OnResume()
743 {
744   // resume indicator status
745   if( mIndicator != NULL )
746   {
747     // Restore own indicator opacity
748     // Send opacity mode to indicator service when app resumed
749     mIndicator->SetOpacityMode( mIndicatorOpacityMode );
750   }
751 }
752
753 void Window::OnStop()
754 {
755   if( mIndicator )
756   {
757     mIndicator->Close();
758   }
759
760   mIndicator.release();
761 }
762
763 void Window::OnDestroy()
764 {
765   mAdaptor = NULL;
766 }
767
768 } // Adaptor
769
770 } // Internal
771
772 } // Dali