[dali_1.1.45] Merge branch 'devel/master'
[platform/core/uifw/dali-demo.git] / examples / motion-blur / motion-blur-example.cpp
1 /*
2  * Copyright (c) 2014 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 #include <sstream>
19 #include <iomanip>
20
21 #include "shared/view.h"
22 #include <dali/dali.h>
23 #include <dali-toolkit/dali-toolkit.h>
24 #include <dali-toolkit/devel-api/shader-effects/motion-blur-effect.h>
25 #include <dali-toolkit/devel-api/controls/popup/popup.h>
26
27 using namespace Dali;
28 using namespace Dali::Toolkit;
29
30
31
32 namespace // unnamed namespace
33 {
34
35 ////////////////////////////////////////////////////
36 //
37 // Demo setup parameters
38 //
39
40 //#define MULTIPLE_MOTION_BLURRED_ACTORS
41 #ifndef MULTIPLE_MOTION_BLURRED_ACTORS
42
43 const float MOTION_BLUR_ACTOR_WIDTH = 256;                                          // actor size on screen
44 const float MOTION_BLUR_ACTOR_HEIGHT = 256;                                         // ""
45
46 #else //#ifndef MULTIPLE_MOTION_BLURRED_ACTORS
47
48 const float MOTION_BLUR_ACTOR_WIDTH = 150;                                          // actor size on screen
49 const float MOTION_BLUR_ACTOR_HEIGHT = 112;                                         // ""
50
51 #endif //#ifndef MULTIPLE_MOTION_BLURRED_ACTORS
52
53
54 const unsigned int MOTION_BLUR_NUM_SAMPLES = 8;
55
56 const int MOTION_BLUR_NUM_ACTOR_IMAGES = 5;
57 const char* MOTION_BLUR_ACTOR_IMAGE1( DEMO_IMAGE_DIR "image-with-border-1.jpg" );
58 const char* MOTION_BLUR_ACTOR_IMAGE2( DEMO_IMAGE_DIR "image-with-border-2.jpg" );
59 const char* MOTION_BLUR_ACTOR_IMAGE3( DEMO_IMAGE_DIR "image-with-border-3.jpg" );
60 const char* MOTION_BLUR_ACTOR_IMAGE4( DEMO_IMAGE_DIR "image-with-border-4.jpg" );
61 const char* MOTION_BLUR_ACTOR_IMAGE5( DEMO_IMAGE_DIR "image-with-border-1.jpg" );
62
63 const char* MOTION_BLUR_ACTOR_IMAGES[] = {
64   MOTION_BLUR_ACTOR_IMAGE1,
65   MOTION_BLUR_ACTOR_IMAGE2,
66   MOTION_BLUR_ACTOR_IMAGE3,
67   MOTION_BLUR_ACTOR_IMAGE4,
68   MOTION_BLUR_ACTOR_IMAGE5,
69 };
70
71 const int NUM_ACTOR_ANIMATIONS = 4;
72 const int NUM_CAMERA_ANIMATIONS = 2;
73
74
75 const char* BACKGROUND_IMAGE_PATH = DEMO_IMAGE_DIR "background-default.png";
76
77 const char* TOOLBAR_IMAGE( DEMO_IMAGE_DIR "top-bar.png" );
78 const char* LAYOUT_IMAGE( DEMO_IMAGE_DIR "icon-change.png" );
79 const char* LAYOUT_IMAGE_SELECTED( DEMO_IMAGE_DIR "icon-change-selected.png" );
80 const char* APPLICATION_TITLE( "Motion Blur" );
81 const char* EFFECTS_OFF_ICON( DEMO_IMAGE_DIR "icon-effects-off.png" );
82 const char* EFFECTS_OFF_ICON_SELECTED( DEMO_IMAGE_DIR "icon-effects-off-selected.png" );
83 const char* EFFECTS_ON_ICON( DEMO_IMAGE_DIR "icon-effects-on.png" );
84 const char* EFFECTS_ON_ICON_SELECTED( DEMO_IMAGE_DIR "icon-effects-on-selected.png" );
85
86 const float UI_MARGIN = 4.0f;                              ///< Screen Margin for placement of UI buttons
87
88 const Vector3 BUTTON_SIZE_CONSTRAINT( 0.24f, 0.09f, 1.0f );
89 const Vector3 BUTTON_TITLE_LABEL_TAP_HERE_SIZE_CONSTRAINT( 0.55f, 0.06f, 1.0f );
90 const Vector3 BUTTON_TITLE_LABEL_INSTRUCTIONS_POPUP_SIZE_CONSTRAINT( 1.0f, 1.0f, 1.0f );
91
92 // move this button down a bit so it is visible on target and not covered up by toolbar
93 const float BUTTON_TITLE_LABEL_Y_OFFSET = 0.05f;
94
95 const float ORIENTATION_DURATION = 0.5f;                  ///< Time to rotate to new orientation.
96
97 /**
98  * @brief Set an image to image view, scaled-down to no more than the dimensions passed in.
99  *
100  * Uses SHRINK_TO_FIT which ensures the resulting image is
101  * smaller than or equal to the specified dimensions while preserving its original aspect ratio.
102  */
103 void SetImageFittedInBox( ImageView& imageView, Property::Map& shaderEffect, const char * const imagePath, int maxWidth, int maxHeight )
104 {
105   Property::Map map;
106   map[Visual::Property::TYPE] = Visual::IMAGE;
107   map[ImageVisual::Property::URL] = imagePath;
108   // Load the image nicely scaled-down to fit within the specified max width and height:
109   map[ImageVisual::Property::DESIRED_WIDTH] = maxWidth;
110   map[ImageVisual::Property::DESIRED_HEIGHT] = maxHeight;
111   map[ImageVisual::Property::FITTING_MODE] = FittingMode::SHRINK_TO_FIT;
112   map[ImageVisual::Property::SAMPLING_MODE] = SamplingMode::BOX_THEN_LINEAR;
113   map.Merge( shaderEffect );
114
115   imageView.SetProperty( ImageView::Property::IMAGE, map );
116 }
117
118 } // unnamed namespace
119
120
121 //
122 class MotionBlurExampleApp : public ConnectionTracker
123 {
124 public:
125
126   /**
127      * DeviceOrientation describes the four different
128      * orientations the device can be in based on accelerometer reports.
129      */
130   enum DeviceOrientation
131   {
132     PORTRAIT = 0,
133     LANDSCAPE = 90,
134     PORTRAIT_INVERSE = 180,
135     LANDSCAPE_INVERSE = 270
136   };
137
138   /**
139    * Constructor
140    * @param application class, stored as reference
141    */
142   MotionBlurExampleApp(Application &app)
143   : mApplication(app),
144     mActorEffectsEnabled(false),
145     mCurrentActorAnimation(0),
146     mCurrentImage(0)
147   {
148     // Connect to the Application's Init signal
149     app.InitSignal().Connect(this, &MotionBlurExampleApp::OnInit);
150   }
151
152   ~MotionBlurExampleApp()
153   {
154     // Nothing to do here; everything gets deleted automatically
155   }
156
157   /**
158    * This method gets called once the main loop of application is up and running
159    */
160   void OnInit(Application& app)
161   {
162     // The Init signal is received once (only) during the Application lifetime
163
164     Stage::GetCurrent().KeyEventSignal().Connect(this, &MotionBlurExampleApp::OnKeyEvent);
165
166
167     // Creates a default view with a default tool bar.
168     // The view is added to the stage.
169     mContentLayer = DemoHelper::CreateView( mApplication,
170                                             mView,
171                                             mToolBar,
172                                             BACKGROUND_IMAGE_PATH,
173                                             TOOLBAR_IMAGE,
174                                             APPLICATION_TITLE );
175
176     //Add an effects icon on the right of the title
177     mActorEffectsButton = Toolkit::PushButton::New();
178     mActorEffectsButton.SetUnselectedImage( EFFECTS_OFF_ICON );
179     mActorEffectsButton.SetSelectedImage( EFFECTS_OFF_ICON_SELECTED );
180     mActorEffectsButton.ClickedSignal().Connect( this, &MotionBlurExampleApp::OnEffectButtonClicked );
181     mToolBar.AddControl( mActorEffectsButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalCenter, DemoHelper::DEFAULT_PLAY_PADDING );
182
183     // Creates a mode button.
184     // Create a effect toggle button. (right of toolbar)
185     Toolkit::PushButton layoutButton = Toolkit::PushButton::New();
186     layoutButton.SetUnselectedImage( LAYOUT_IMAGE );
187     layoutButton.SetSelectedImage( LAYOUT_IMAGE_SELECTED );
188     layoutButton.ClickedSignal().Connect( this, &MotionBlurExampleApp::OnLayoutButtonClicked);
189     layoutButton.SetLeaveRequired( true );
190     mToolBar.AddControl( layoutButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
191
192     // Input
193     mTapGestureDetector = TapGestureDetector::New();
194     mTapGestureDetector.Attach( mContentLayer );
195     mTapGestureDetector.DetectedSignal().Connect( this, &MotionBlurExampleApp::OnTap );
196
197     Dali::Window winHandle = app.GetWindow();
198     winHandle.AddAvailableOrientation( Dali::Window::PORTRAIT );
199     winHandle.AddAvailableOrientation( Dali::Window::LANDSCAPE );
200     winHandle.AddAvailableOrientation( Dali::Window::PORTRAIT_INVERSE  );
201     winHandle.AddAvailableOrientation( Dali::Window::LANDSCAPE_INVERSE );
202
203     // set initial orientation
204     unsigned int degrees = 0;
205     Rotate( static_cast< DeviceOrientation >( degrees ) );
206
207
208     ///////////////////////////////////////////////////////
209     //
210     // Motion blurred actor
211     //
212
213     // Scale down actor to fit on very low resolution screens with space to interact:
214     Size stageSize = Stage::GetCurrent().GetSize();
215     mMotionBlurActorSize = Size( std::min( stageSize.x * 0.3f, MOTION_BLUR_ACTOR_WIDTH ), std::min( stageSize.y * 0.3f, MOTION_BLUR_ACTOR_HEIGHT ) );
216     mMotionBlurActorSize = Size( std::min( mMotionBlurActorSize.x, mMotionBlurActorSize.y ), std::min( mMotionBlurActorSize.x, mMotionBlurActorSize.y ) );
217
218     mMotionBlurEffect = CreateMotionBlurEffect();
219     mMotionBlurImageView = ImageView::New();
220     SetImageFittedInBox( mMotionBlurImageView, mMotionBlurEffect, MOTION_BLUR_ACTOR_IMAGE1, mMotionBlurActorSize.x, mMotionBlurActorSize.y );
221     mMotionBlurImageView.SetParentOrigin( ParentOrigin::CENTER );
222     mMotionBlurImageView.SetSize(mMotionBlurActorSize.x, mMotionBlurActorSize.y);
223
224     mContentLayer.Add( mMotionBlurImageView );
225
226     // Create shader used for doing motion blur
227     mMotionBlurEffect = CreateMotionBlurEffect();
228
229     // set actor shader to the blur one
230     Toolkit::SetMotionBlurProperties( mMotionBlurImageView, MOTION_BLUR_NUM_SAMPLES );
231
232
233 #ifdef MULTIPLE_MOTION_BLURRED_ACTORS
234
235     ///////////////////////////////////////////////////////
236     //
237     // Motion blurred actor 2
238     //
239
240     mMotionBlurImageView2 = ImageView::New(image);
241     mMotionBlurImageView2.SetParentOrigin( ParentOrigin::CENTER );
242     mMotionBlurImageView2.SetSize(mMotionBlurActorSize.x, mMotionBlurActorSize.y);
243     mMotionBlurImageView2.SetPosition(mMotionBlurActorSize.x * 1.1f, 0.0f);
244     mMotionBlurImageView.Add( mMotionBlurImageView2 );
245
246     // set actor shader to the blur one
247     Toolkit::SetMotionBlurProperties( mMotionBlurImageView2, MOTION_BLUR_NUM_SAMPLES );
248     mMotionBlurImageView2.SetProperty( Toolkit::ImageView::Property::IMAGE, mMotionBlurEffect );
249
250
251     ///////////////////////////////////////////////////////
252     //
253     // Motion blurred actor 3
254     //
255
256     mMotionBlurImageView3 = ImageView::New(image);
257     mMotionBlurImageView3.SetParentOrigin( ParentOrigin::CENTER );
258     mMotionBlurImageView3.SetSize(mMotionBlurActorSize.x, mMotionBlurActorSize.y);
259     mMotionBlurImageView3.SetPosition(-mMotionBlurActorSize.x * 1.1f, 0.0f);
260     mMotionBlurImageView.Add( mMotionBlurImageView3 );
261
262     // set actor shader to the blur one
263     Toolkit::SetMotionBlurProperties( mMotionBlurImageView3, MOTION_BLUR_NUM_SAMPLES );
264     mMotionBlurImageView3.SetProperty( Toolkit::ImageView::Property::IMAGE, mMotionBlurEffect );
265
266
267     ///////////////////////////////////////////////////////
268     //
269     // Motion blurred actor 4
270     //
271
272     mMotionBlurImageView4 = ImageView::New(image);
273     mMotionBlurImageView4.SetParentOrigin( ParentOrigin::CENTER );
274     mMotionBlurImageView4.SetSize(mMotionBlurActorSize.x, mMotionBlurActorSize.y);
275     mMotionBlurImageView4.SetPosition(0.0f, mMotionBlurActorSize.y * 1.1f);
276     mMotionBlurImageView.Add( mMotionBlurImageView4 );
277
278     // set actor shader to the blur one
279     Toolkit::SetMotionBlurProperties( mMotionBlurImageView4, MOTION_BLUR_NUM_SAMPLES );
280     mMotionBlurImageView4.SetProperty( Toolkit::ImageView::Property::IMAGE, mMotionBlurEffect );
281
282     ///////////////////////////////////////////////////////
283     //
284     // Motion blurred actor 5
285     //
286
287     mMotionBlurImageView5 = ImageView::New(image);
288     mMotionBlurImageView5.SetParentOrigin( ParentOrigin::CENTER );
289     mMotionBlurImageView5.SetSize(mMotionBlurActorSize.x, mMotionBlurActorSize.y);
290     mMotionBlurImageView5.SetPosition(0.0f, -mMotionBlurActorSize.y * 1.1f);
291     mMotionBlurImageView.Add( mMotionBlurImageView5 );
292
293     // set actor shader to the blur one
294     Toolkit::SetMotionBlurProperties( mMotionBlurImageView5, MOTION_BLUR_NUM_SAMPLES );
295     mMotionBlurImageView5.SetProperty( Toolkit::ImageView::Property::IMAGE, mMotionBlurEffect );
296 #endif //#ifdef MULTIPLE_MOTION_BLURRED_ACTORS
297   }
298
299   void Rotate( DeviceOrientation orientation )
300   {
301     // Resize the root actor
302     Vector2 stageSize = Stage::GetCurrent().GetSize();
303     Vector2 targetSize = stageSize;
304     if( orientation == LANDSCAPE ||
305         orientation == LANDSCAPE_INVERSE )
306     {
307       targetSize = Vector2( stageSize.y, stageSize.x );
308     }
309
310     if( mOrientation != orientation )
311     {
312       mOrientation = orientation;
313
314       // check if actor is on stage
315       if( mView.GetParent() )
316       {
317         // has parent so we expect it to be on stage, start animation
318         mRotateAnimation = Animation::New( ORIENTATION_DURATION );
319         mRotateAnimation.AnimateTo( Property( mView, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree( -orientation ) ), Vector3::ZAXIS ), AlphaFunction::EASE_OUT );
320         mRotateAnimation.AnimateTo( Property( mView, Actor::Property::SIZE_WIDTH ), targetSize.width );
321         mRotateAnimation.AnimateTo( Property( mView, Actor::Property::SIZE_HEIGHT ), targetSize.height );
322         mRotateAnimation.Play();
323       }
324       else
325       {
326         // set the rotation to match the orientation
327         mView.SetOrientation( Degree( -orientation ), Vector3::ZAXIS );
328         mView.SetSize( targetSize );
329       }
330     }
331     else
332     {
333       // for first time just set size
334       mView.SetSize( targetSize );
335     }
336   }
337
338
339   //////////////////////////////////////////////////////////////
340   //
341   // Actor Animation
342   //
343   //
344
345   // move to point on screen that was tapped
346   void OnTap( Actor actor, const TapGesture& tapGesture )
347   {
348     Vector3 destPos;
349     float originOffsetX, originOffsetY;
350
351     // rotate offset (from top left origin to centre) into actor space
352     Vector2 stageSize = Dali::Stage::GetCurrent().GetSize();
353     actor.ScreenToLocal(originOffsetX, originOffsetY, stageSize.width * 0.5f, stageSize.height * 0.5f);
354
355     // get dest point in local actor space
356     destPos.x = tapGesture.localPoint.x - originOffsetX;
357     destPos.y = tapGesture.localPoint.y - originOffsetY;
358     destPos.z = 0.0f;
359
360     float animDuration = 0.5f;
361     mActorTapMovementAnimation = Animation::New( animDuration );
362     if ( mMotionBlurImageView )
363     {
364       mActorTapMovementAnimation.AnimateTo( Property(mMotionBlurImageView, Actor::Property::POSITION), destPos, AlphaFunction::EASE_IN_OUT_SINE, TimePeriod(animDuration) );
365     }
366     mActorTapMovementAnimation.SetEndAction( Animation::Bake );
367     mActorTapMovementAnimation.Play();
368
369
370     // perform some spinning etc
371     if(mActorEffectsEnabled)
372     {
373       switch(mCurrentActorAnimation)
374       {
375         // spin around y
376         case 0:
377         {
378           float animDuration = 1.0f;
379           mActorAnimation = Animation::New(animDuration);
380           mActorAnimation.AnimateBy( Property( mMotionBlurImageView, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::YAXIS ), AlphaFunction::EASE_IN_OUT );
381           mActorAnimation.SetEndAction( Animation::Bake );
382           mActorAnimation.Play();
383         }
384         break;
385
386         // spin around z
387         case 1:
388         {
389           float animDuration = 1.0f;
390           mActorAnimation = Animation::New(animDuration);
391           mActorAnimation.AnimateBy( Property( mMotionBlurImageView, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::ZAXIS ), AlphaFunction::EASE_IN_OUT );
392           mActorAnimation.SetEndAction( Animation::Bake );
393           mActorAnimation.Play();
394         }
395         break;
396
397         // spin around y and z
398         case 2:
399         {
400           float animDuration = 1.0f;
401           mActorAnimation = Animation::New(animDuration);
402           mActorAnimation.AnimateBy( Property( mMotionBlurImageView, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::YAXIS ), AlphaFunction::EASE_IN_OUT );
403           mActorAnimation.AnimateBy( Property( mMotionBlurImageView, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::ZAXIS ), AlphaFunction::EASE_IN_OUT );
404           mActorAnimation.SetEndAction( Animation::Bake );
405           mActorAnimation.Play();
406         }
407         break;
408
409         // scale
410         case 3:
411         {
412           float animDuration = 1.0f;
413           mActorAnimation = Animation::New(animDuration);
414           mActorAnimation.AnimateBy( Property( mMotionBlurImageView, Actor::Property::SCALE ), Vector3(2.0f, 2.0f, 2.0f), AlphaFunction::BOUNCE, TimePeriod( 0.0f, 1.0f ) );
415           mActorAnimation.SetEndAction( Animation::Bake );
416           mActorAnimation.Play();
417         }
418         break;
419
420         default:
421           break;
422       }
423
424       mCurrentActorAnimation++;
425       if(NUM_ACTOR_ANIMATIONS == mCurrentActorAnimation)
426       {
427         mCurrentActorAnimation = 0;
428       }
429     }
430   }
431
432   void ToggleActorEffects()
433   {
434     if(!mActorEffectsEnabled)
435     {
436       mActorEffectsEnabled = true;
437       mActorEffectsButton.SetUnselectedImage( EFFECTS_ON_ICON );
438       mActorEffectsButton.SetSelectedImage( EFFECTS_ON_ICON_SELECTED );
439     }
440     else
441     {
442       mActorEffectsEnabled = false;
443       mActorEffectsButton.SetUnselectedImage( EFFECTS_OFF_ICON );
444       mActorEffectsButton.SetSelectedImage( EFFECTS_OFF_ICON_SELECTED );
445     }
446   }
447
448   //////////////////////////////////////////////////////////////
449   //
450   // Input handlers
451   //
452   //
453
454   bool OnLayoutButtonClicked( Toolkit::Button button )
455   {
456     ChangeImage();
457     return true;
458   }
459
460   bool OnEffectButtonClicked( Toolkit::Button button )
461   {
462     ToggleActorEffects();
463     return true;
464   }
465
466   /**
467    * Main key event handler
468    */
469   void OnKeyEvent(const KeyEvent& event)
470   {
471     if(event.state == KeyEvent::Down)
472     {
473       if( IsKey( event, Dali::DALI_KEY_ESCAPE) || IsKey( event, Dali::DALI_KEY_BACK) )
474       {
475         mApplication.Quit();
476       }
477     }
478   }
479
480   //////////////////////////////////////////////////////////////
481   //
482   // Misc
483   //
484   //
485
486
487   void ChangeImage()
488   {
489     mCurrentImage++;
490     if(MOTION_BLUR_NUM_ACTOR_IMAGES == mCurrentImage)
491     {
492       mCurrentImage = 0;
493     }
494     SetImageFittedInBox( mMotionBlurImageView, mMotionBlurEffect, MOTION_BLUR_ACTOR_IMAGES[mCurrentImage], mMotionBlurActorSize.x, mMotionBlurActorSize.y );
495
496 #ifdef MULTIPLE_MOTION_BLURRED_ACTORS
497     mMotionBlurImageView2.SetImage(blurImage);
498     mMotionBlurImageView3.SetImage(blurImage);
499     mMotionBlurImageView4.SetImage(blurImage);
500     mMotionBlurImageView5.SetImage(blurImage);
501 #endif
502   }
503
504
505 private:
506   Application&               mApplication;            ///< Application instance
507   Toolkit::Control           mView;
508   Toolkit::ToolBar           mToolBar;
509
510   Layer                      mContentLayer;           ///< Content layer (contains actor for this blur demo)
511
512   PushButton                 mActorEffectsButton;     ///< The actor effects toggling Button.
513
514   // Motion blur
515   Property::Map mMotionBlurEffect;
516   ImageView mMotionBlurImageView;
517   Size mMotionBlurActorSize;
518
519 #ifdef MULTIPLE_MOTION_BLURRED_ACTORS
520   ImageView mMotionBlurImageView2;
521   ImageView mMotionBlurImageView3;
522   ImageView mMotionBlurImageView4;
523   ImageView mMotionBlurImageView5;
524 #endif //#ifdef MULTIPLE_MOTION_BLURRED_ACTORS
525
526   // animate actor to position where user taps screen
527   Animation mActorTapMovementAnimation;
528
529   // show different animations to demonstrate blur effect working on an object only movement basis
530   bool mActorEffectsEnabled;
531   Animation mActorAnimation;
532   int mCurrentActorAnimation;
533
534   // offer a selection of images that user can cycle between
535   int mCurrentImage;
536
537   TapGestureDetector mTapGestureDetector;
538
539   DeviceOrientation mOrientation;               ///< Current Device orientation
540   Animation mRotateAnimation;                   ///< Animation for rotating between landscape and portrait.
541
542   Popup mInstructionsPopup;                     ///< Info Popup
543 };
544
545 void RunTest(Application& app)
546 {
547   MotionBlurExampleApp test(app);
548
549   app.MainLoop();
550 }
551
552 // Entry point for Linux & Tizen applications
553 //
554 int DALI_EXPORT_API main(int argc, char **argv)
555 {
556   Application app = Application::New(&argc, &argv, DEMO_THEME_PATH);
557
558   RunTest(app);
559
560   return 0;
561 }