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