Commit 9879c76252b384906ea35422547840350a72019c

Authored by greynaga
2 parents 8b8df4bd ec2a7635

[dali_1.2.61] Merge branch 'devel/master'

Change-Id: I160a9cde85c40723834dea23fdf0288a672c629c
Showing 86 changed files with 190 additions and 1815 deletions
builder/dali-builder.cpp
1 /* 1 /*
2 - * Copyright (c) 2014 Samsung Electronics Co., Ltd. 2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
@@ -295,7 +295,7 @@ private: @@ -295,7 +295,7 @@ private:
295 // 295 //
296 // 296 //
297 //------------------------------------------------------------------------------ 297 //------------------------------------------------------------------------------
298 -int main(int argc, char **argv) 298 +int DALI_EXPORT_API main(int argc, char **argv)
299 { 299 {
300 300
301 Application dali_app = Application::New(&argc, &argv, DEMO_THEME_PATH); 301 Application dali_app = Application::New(&argc, &argv, DEMO_THEME_PATH);
com.samsung.dali-demo.xml
@@ -109,9 +109,6 @@ @@ -109,9 +109,6 @@
109 <ui-application appid="text-scrolling.example" exec="/usr/apps/com.samsung.dali-demo/bin/text-scrolling.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true"> 109 <ui-application appid="text-scrolling.example" exec="/usr/apps/com.samsung.dali-demo/bin/text-scrolling.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
110 <label>Text Scrolling</label> 110 <label>Text Scrolling</label>
111 </ui-application> 111 </ui-application>
112 - <ui-application appid="logging.example" exec="/usr/apps/com.samsung.dali-demo/bin/logging.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">  
113 - <label>Logging</label>  
114 - </ui-application>  
115 <ui-application appid="animated-shapes.example" exec="/usr/apps/com.samsung.dali-demo/bin/animated-shapes.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true"> 112 <ui-application appid="animated-shapes.example" exec="/usr/apps/com.samsung.dali-demo/bin/animated-shapes.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
116 <label>Animated shapes</label> 113 <label>Animated shapes</label>
117 </ui-application> 114 </ui-application>
examples-reel/dali-examples-reel.cpp
@@ -56,10 +56,8 @@ int DALI_EXPORT_API main(int argc, char **argv) @@ -56,10 +56,8 @@ int DALI_EXPORT_API main(int argc, char **argv)
56 demo.AddExample(Example("image-view-svg.example", DALI_DEMO_STR_TITLE_IMAGE_VIEW_SVG)); 56 demo.AddExample(Example("image-view-svg.example", DALI_DEMO_STR_TITLE_IMAGE_VIEW_SVG));
57 demo.AddExample(Example("image-view-url.example", DALI_DEMO_STR_TITLE_IMAGE_VIEW_URL)); 57 demo.AddExample(Example("image-view-url.example", DALI_DEMO_STR_TITLE_IMAGE_VIEW_URL));
58 demo.AddExample(Example("line-mesh.example", DALI_DEMO_STR_TITLE_LINE_MESH)); 58 demo.AddExample(Example("line-mesh.example", DALI_DEMO_STR_TITLE_LINE_MESH));
59 - demo.AddExample(Example("logging.example", DALI_DEMO_STR_TITLE_LOGGING));  
60 demo.AddExample(Example("magnifier.example", DALI_DEMO_STR_TITLE_MAGNIFIER)); 59 demo.AddExample(Example("magnifier.example", DALI_DEMO_STR_TITLE_MAGNIFIER));
61 demo.AddExample(Example("mesh-morph.example", DALI_DEMO_STR_TITLE_MESH_MORPH)); 60 demo.AddExample(Example("mesh-morph.example", DALI_DEMO_STR_TITLE_MESH_MORPH));
62 - demo.AddExample(Example("mesh-sorting.example", DALI_DEMO_STR_TITLE_MESH_SORTING));  
63 demo.AddExample(Example("motion-stretch.example", DALI_DEMO_STR_TITLE_MOTION_STRETCH)); 61 demo.AddExample(Example("motion-stretch.example", DALI_DEMO_STR_TITLE_MOTION_STRETCH));
64 demo.AddExample(Example("native-image-source.example", DALI_DEMO_STR_TITLE_NATIVE_IMAGE_SOURCE)); 62 demo.AddExample(Example("native-image-source.example", DALI_DEMO_STR_TITLE_NATIVE_IMAGE_SOURCE));
65 demo.AddExample(Example("popup.example", DALI_DEMO_STR_TITLE_POPUP)); 63 demo.AddExample(Example("popup.example", DALI_DEMO_STR_TITLE_POPUP));
examples/alpha-blending-cpu/alpha-blending-cpu-example.cpp
@@ -150,20 +150,10 @@ private: @@ -150,20 +150,10 @@ private:
150 int mImageCombinationIndex; 150 int mImageCombinationIndex;
151 }; 151 };
152 152
153 -void RunTest( Application& application )  
154 -{  
155 - ImageViewAlphaBlendApp test( application );  
156 -  
157 - application.MainLoop();  
158 -}  
159 -  
160 -// Entry point for Linux & Tizen applications  
161 -//  
162 int DALI_EXPORT_API main( int argc, char **argv ) 153 int DALI_EXPORT_API main( int argc, char **argv )
163 { 154 {
164 Application application = Application::New( &argc, &argv ); 155 Application application = Application::New( &argc, &argv );
165 -  
166 - RunTest( application );  
167 - 156 + ImageViewAlphaBlendApp test( application );
  157 + application.MainLoop();
168 return 0; 158 return 0;
169 } 159 }
examples/animated-images/animated-images-example.cpp
@@ -376,7 +376,6 @@ private: @@ -376,7 +376,6 @@ private:
376 ImageType mImageType; 376 ImageType mImageType;
377 }; 377 };
378 378
379 -// Entry point for Linux & Tizen applications  
380 // 379 //
381 int DALI_EXPORT_API main( int argc, char **argv ) 380 int DALI_EXPORT_API main( int argc, char **argv )
382 { 381 {
examples/animated-shapes/animated-shapes-example.cpp
1 /* 1 /*
2 - * Copyright (c) 2016 Samsung Electronics Co., Ltd. 2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
@@ -460,16 +460,10 @@ private: @@ -460,16 +460,10 @@ private:
460 460
461 }; 461 };
462 462
463 -void RunTest( Application& application ) 463 +int DALI_EXPORT_API main( int argc, char **argv )
464 { 464 {
  465 + Application application = Application::New( &argc, &argv );
465 AnimatedShapesExample test( application ); 466 AnimatedShapesExample test( application );
466 application.MainLoop(); 467 application.MainLoop();
467 -}  
468 -  
469 -int main( int argc, char **argv )  
470 -{  
471 - Application application = Application::New( &argc, &argv );  
472 - RunTest( application );  
473 -  
474 return 0; 468 return 0;
475 } 469 }
examples/benchmark/benchmark.cpp
@@ -464,15 +464,6 @@ private: @@ -464,15 +464,6 @@ private:
464 Animation mHide; 464 Animation mHide;
465 }; 465 };
466 466
467 -void RunTest( Application& application )  
468 -{  
469 - Benchmark test( application );  
470 -  
471 - application.MainLoop();  
472 -}  
473 -  
474 -// Entry point for Linux & Tizen applications  
475 -//  
476 int DALI_EXPORT_API main( int argc, char **argv ) 467 int DALI_EXPORT_API main( int argc, char **argv )
477 { 468 {
478 Application application = Application::New( &argc, &argv ); 469 Application application = Application::New( &argc, &argv );
@@ -502,7 +493,8 @@ int DALI_EXPORT_API main( int argc, char **argv ) @@ -502,7 +493,8 @@ int DALI_EXPORT_API main( int argc, char **argv )
502 } 493 }
503 } 494 }
504 495
505 - RunTest( application ); 496 + Benchmark test( application );
  497 + application.MainLoop();
506 498
507 return 0; 499 return 0;
508 } 500 }
examples/blocks/blocks-example.cpp
@@ -862,18 +862,10 @@ private: @@ -862,18 +862,10 @@ private:
862 int mBrickCount; ///< Total bricks on screen. 862 int mBrickCount; ///< Total bricks on screen.
863 }; 863 };
864 864
865 -void RunTest(Application& app)  
866 -{  
867 - ExampleController test(app);  
868 -  
869 - app.MainLoop();  
870 -}  
871 -  
872 int DALI_EXPORT_API main(int argc, char **argv) 865 int DALI_EXPORT_API main(int argc, char **argv)
873 { 866 {
874 Application app = Application::New(&argc, &argv, DEMO_THEME_PATH); 867 Application app = Application::New(&argc, &argv, DEMO_THEME_PATH);
875 -  
876 - RunTest(app);  
877 - 868 + ExampleController test(app);
  869 + app.MainLoop();
878 return 0; 870 return 0;
879 } 871 }
examples/bubble-effect/bubble-effect-example.cpp
@@ -306,20 +306,10 @@ private: @@ -306,20 +306,10 @@ private:
306 306
307 /*****************************************************************************/ 307 /*****************************************************************************/
308 308
309 -static void  
310 -RunTest(Application& app)  
311 -{  
312 - BubbleEffectExample theApp(app);  
313 - app.MainLoop();  
314 -}  
315 -  
316 -/*****************************************************************************/  
317 -  
318 int DALI_EXPORT_API main(int argc, char **argv) 309 int DALI_EXPORT_API main(int argc, char **argv)
319 { 310 {
320 Application app = Application::New(&argc, &argv, DEMO_THEME_PATH); 311 Application app = Application::New(&argc, &argv, DEMO_THEME_PATH);
321 -  
322 - RunTest(app);  
323 - 312 + BubbleEffectExample theApp(app);
  313 + app.MainLoop();
324 return 0; 314 return 0;
325 } 315 }
examples/buttons/buttons-example.cpp
@@ -509,20 +509,10 @@ private: @@ -509,20 +509,10 @@ private:
509 Toolkit::ImageView mImage; 509 Toolkit::ImageView mImage;
510 }; 510 };
511 511
512 -void RunTest( Application& application )  
513 -{  
514 - ButtonsController test( application );  
515 -  
516 - application.MainLoop();  
517 -}  
518 -  
519 -// Entry point for Linux & Tizen applications  
520 -//  
521 int DALI_EXPORT_API main( int argc, char **argv ) 512 int DALI_EXPORT_API main( int argc, char **argv )
522 { 513 {
523 Application application = Application::New( &argc, &argv, DEMO_THEME_PATH ); 514 Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
524 -  
525 - RunTest( application );  
526 - 515 + ButtonsController test( application );
  516 + application.MainLoop();
527 return 0; 517 return 0;
528 } 518 }
examples/clipping-draw-order/clipping-draw-order.cpp
@@ -52,6 +52,9 @@ public: @@ -52,6 +52,9 @@ public:
52 Stage stage = Stage::GetCurrent(); 52 Stage stage = Stage::GetCurrent();
53 stage.SetBackgroundColor( Color::WHITE ); 53 stage.SetBackgroundColor( Color::WHITE );
54 54
  55 + // Connect to the stage's key signal to allow Back and Escape to exit.
  56 + stage.KeyEventSignal().Connect( this, &ClippingDrawOrderVerification::OnKeyEvent );
  57 +
55 // Create the title label. 58 // Create the title label.
56 TextLabel title = TextLabel::New( "Clipping draw order verification" ); 59 TextLabel title = TextLabel::New( "Clipping draw order verification" );
57 title.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); 60 title.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
@@ -204,23 +207,31 @@ public: @@ -204,23 +207,31 @@ public:
204 return true; 207 return true;
205 } 208 }
206 209
  210 + /**
  211 + * @brief Called when any key event is received
  212 + *
  213 + * Will use this to quit the application if Back or the Escape key is received
  214 + * @param[in] event The key event information
  215 + */
  216 + void OnKeyEvent( const KeyEvent& event )
  217 + {
  218 + if( event.state == KeyEvent::Down )
  219 + {
  220 + if( IsKey( event, DALI_KEY_ESCAPE) || IsKey( event, DALI_KEY_BACK ) )
  221 + {
  222 + mApplication.Quit();
  223 + }
  224 + }
  225 + }
  226 +
207 private: 227 private:
208 Application& mApplication; 228 Application& mApplication;
209 }; 229 };
210 230
211 -void RunVerification( Application& application )  
212 -{  
213 - ClippingDrawOrderVerification verification( application );  
214 -  
215 - application.MainLoop();  
216 -}  
217 -  
218 -// Entry point for Linux & Tizen applications.  
219 int DALI_EXPORT_API main( int argc, char **argv ) 231 int DALI_EXPORT_API main( int argc, char **argv )
220 { 232 {
221 Application application = Application::New( &argc, &argv ); 233 Application application = Application::New( &argc, &argv );
222 -  
223 - RunVerification( application );  
224 - 234 + ClippingDrawOrderVerification verification( application );
  235 + application.MainLoop();
225 return 0; 236 return 0;
226 } 237 }
examples/compressed-texture-formats/compressed-texture-formats-example.cpp
@@ -202,20 +202,10 @@ private: @@ -202,20 +202,10 @@ private:
202 Application& mApplication; 202 Application& mApplication;
203 }; 203 };
204 204
205 -void RunTest( Application& application )  
206 -{  
207 - CompressedTextureFormatsController test( application );  
208 -  
209 - application.MainLoop();  
210 -}  
211 -  
212 -// Entry point for Linux & Tizen applications  
213 -//  
214 int DALI_EXPORT_API main( int argc, char **argv ) 205 int DALI_EXPORT_API main( int argc, char **argv )
215 { 206 {
216 Application application = Application::New( &argc, &argv ); 207 Application application = Application::New( &argc, &argv );
217 -  
218 - RunTest( application );  
219 - 208 + CompressedTextureFormatsController test( application );
  209 + application.MainLoop();
220 return 0; 210 return 0;
221 } 211 }
examples/cube-transition-effect/cube-transition-effect-example.cpp
@@ -413,7 +413,6 @@ void CubeTransitionApp::OnKeyEvent(const KeyEvent&amp; event) @@ -413,7 +413,6 @@ void CubeTransitionApp::OnKeyEvent(const KeyEvent&amp; event)
413 } 413 }
414 } 414 }
415 415
416 -// Entry point for Linux & Tizen applications  
417 int DALI_EXPORT_API main( int argc, char **argv ) 416 int DALI_EXPORT_API main( int argc, char **argv )
418 { 417 {
419 Application application = Application::New( &argc, &argv, DEMO_THEME_PATH ); 418 Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
examples/dissolve-effect/dissolve-effect-example.cpp
@@ -436,7 +436,6 @@ bool DissolveEffectApp::OnTimerTick() @@ -436,7 +436,6 @@ bool DissolveEffectApp::OnTimerTick()
436 return false; //return false to stop the timer 436 return false; //return false to stop the timer
437 } 437 }
438 438
439 -// Entry point for Linux & Tizen applications  
440 int DALI_EXPORT_API main( int argc, char **argv ) 439 int DALI_EXPORT_API main( int argc, char **argv )
441 { 440 {
442 Application application = Application::New( &argc, &argv, DEMO_THEME_PATH ); 441 Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
examples/effects-view/effects-view-example.cpp
@@ -245,20 +245,10 @@ void EffectsViewApp::OnKeyEvent(const KeyEvent&amp; event) @@ -245,20 +245,10 @@ void EffectsViewApp::OnKeyEvent(const KeyEvent&amp; event)
245 245
246 /*****************************************************************************/ 246 /*****************************************************************************/
247 247
248 -static void RunTest( Application& application )  
249 -{  
250 - EffectsViewApp test( application );  
251 -  
252 - application.MainLoop();  
253 -}  
254 -  
255 -/*****************************************************************************/  
256 -  
257 int DALI_EXPORT_API main(int argc, char **argv) 248 int DALI_EXPORT_API main(int argc, char **argv)
258 { 249 {
259 Application application = Application::New(&argc, &argv, DEMO_THEME_PATH); 250 Application application = Application::New(&argc, &argv, DEMO_THEME_PATH);
260 -  
261 - RunTest(application);  
262 - 251 + EffectsViewApp test( application );
  252 + application.MainLoop();
263 return 0; 253 return 0;
264 } 254 }
examples/flex-container/flex-container-example.cpp
@@ -367,18 +367,10 @@ private: @@ -367,18 +367,10 @@ private:
367 Toolkit::PushButton mAlignContentButton; 367 Toolkit::PushButton mAlignContentButton;
368 }; 368 };
369 369
370 -void RunTest(Application& app)  
371 -{  
372 - FlexContainerExample test(app);  
373 -  
374 - app.MainLoop();  
375 -}  
376 -  
377 int DALI_EXPORT_API main(int argc, char **argv) 370 int DALI_EXPORT_API main(int argc, char **argv)
378 { 371 {
379 Application app = Application::New(&argc, &argv, DEMO_THEME_PATH); 372 Application app = Application::New(&argc, &argv, DEMO_THEME_PATH);
380 -  
381 - RunTest(app);  
382 - 373 + FlexContainerExample test(app);
  374 + app.MainLoop();
383 return 0; 375 return 0;
384 } 376 }
examples/focus-integration/focus-integration.cpp
@@ -193,7 +193,6 @@ private: @@ -193,7 +193,6 @@ private:
193 Layer mContentLayer; ///< Content layer. 193 Layer mContentLayer; ///< Content layer.
194 }; 194 };
195 195
196 -// Entry point for Linux & Tizen applications  
197 // 196 //
198 int DALI_EXPORT_API main( int argc, char **argv ) 197 int DALI_EXPORT_API main( int argc, char **argv )
199 { 198 {
examples/fpp-game/fpp-game-example.cpp
1 /* 1 /*
2 - * Copyright (c) 2016 Samsung Electronics Co., Ltd. 2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
@@ -135,20 +135,10 @@ private: @@ -135,20 +135,10 @@ private:
135 FppGameTutorialController mTutorialController; 135 FppGameTutorialController mTutorialController;
136 }; 136 };
137 137
138 -void RunTest( Application& application )  
139 -{  
140 - GameController test( application );  
141 -  
142 - application.MainLoop();  
143 -}  
144 -  
145 -// Entry point for Linux & Tizen applications  
146 -//  
147 int DALI_EXPORT_API main( int argc, char **argv ) 138 int DALI_EXPORT_API main( int argc, char **argv )
148 { 139 {
149 Application application = Application::New( &argc, &argv ); 140 Application application = Application::New( &argc, &argv );
150 -  
151 - RunTest( application );  
152 - 141 + GameController test( application );
  142 + application.MainLoop();
153 return 0; 143 return 0;
154 } 144 }
examples/gradients/gradients-example.cpp
@@ -161,20 +161,10 @@ private: @@ -161,20 +161,10 @@ private:
161 unsigned mIndex; 161 unsigned mIndex;
162 }; 162 };
163 163
164 -void RunTest( Application& application )  
165 -{  
166 - GradientController test( application );  
167 -  
168 - application.MainLoop();  
169 -}  
170 -  
171 -// Entry point for Linux & Tizen applications  
172 -//  
173 int DALI_EXPORT_API main( int argc, char **argv ) 164 int DALI_EXPORT_API main( int argc, char **argv )
174 { 165 {
175 Application application = Application::New( &argc, &argv ); 166 Application application = Application::New( &argc, &argv );
176 -  
177 - RunTest( application );  
178 - 167 + GradientController test( application );
  168 + application.MainLoop();
179 return 0; 169 return 0;
180 } 170 }
examples/hello-world/hello-world-example.cpp
1 /* 1 /*
2 - * Copyright (c) 2014 Samsung Electronics Co., Ltd. 2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
@@ -65,20 +65,10 @@ private: @@ -65,20 +65,10 @@ private:
65 Application& mApplication; 65 Application& mApplication;
66 }; 66 };
67 67
68 -void RunTest( Application& application )  
69 -{  
70 - HelloWorldController test( application );  
71 -  
72 - application.MainLoop();  
73 -}  
74 -  
75 -// Entry point for Linux & Tizen applications  
76 -//  
77 int DALI_EXPORT_API main( int argc, char **argv ) 68 int DALI_EXPORT_API main( int argc, char **argv )
78 { 69 {
79 Application application = Application::New( &argc, &argv ); 70 Application application = Application::New( &argc, &argv );
80 -  
81 - RunTest( application );  
82 - 71 + HelloWorldController test( application );
  72 + application.MainLoop();
83 return 0; 73 return 0;
84 } 74 }
examples/homescreen-benchmark/homescreen-benchmark.cpp
@@ -454,26 +454,6 @@ private: @@ -454,26 +454,6 @@ private:
454 int mCurrentPage; 454 int mCurrentPage;
455 }; 455 };
456 456
457 -void RunTest( Application& application, const HomescreenBenchmark::Config& config, bool printHelpAndExit )  
458 -{  
459 - HomescreenBenchmark test( application, config );  
460 -  
461 - if( printHelpAndExit )  
462 - {  
463 - PrintHelp( "c<num>", " Number of columns" );  
464 - PrintHelp( "r<num>", " Number of rows" );  
465 - PrintHelp( "p<num>", " Number of pages ( must be greater than 1 )" );  
466 - PrintHelp( "-disable-tableview", " Disables the use of TableView for layouting" );  
467 - PrintHelp( "-disable-icon-labels", " Disables labels for each icon" );  
468 - PrintHelp( "-use-checkbox", " Uses checkboxes for icons" );  
469 - PrintHelp( "-use-text-label", " Uses TextLabel instead of a TextVisual" );  
470 - return;  
471 - }  
472 -  
473 - application.MainLoop();  
474 -}  
475 -  
476 -// Entry point for Linux & Tizen applications.  
477 int DALI_EXPORT_API main( int argc, char **argv ) 457 int DALI_EXPORT_API main( int argc, char **argv )
478 { 458 {
479 // Default settings. 459 // Default settings.
@@ -519,8 +499,21 @@ int DALI_EXPORT_API main( int argc, char **argv ) @@ -519,8 +499,21 @@ int DALI_EXPORT_API main( int argc, char **argv )
519 } 499 }
520 500
521 Application application = Application::New( &argc, &argv ); 501 Application application = Application::New( &argc, &argv );
  502 + HomescreenBenchmark test( application, config );
522 503
523 - RunTest( application, config, printHelpAndExit ); 504 + if( printHelpAndExit )
  505 + {
  506 + PrintHelp( "c<num>", " Number of columns" );
  507 + PrintHelp( "r<num>", " Number of rows" );
  508 + PrintHelp( "p<num>", " Number of pages ( must be greater than 1 )" );
  509 + PrintHelp( "-disable-tableview", " Disables the use of TableView for layouting" );
  510 + PrintHelp( "-disable-icon-labels", " Disables labels for each icon" );
  511 + PrintHelp( "-use-checkbox", " Uses checkboxes for icons" );
  512 + PrintHelp( "-use-text-label", " Uses TextLabel instead of a TextVisual" );
  513 + return 0;
  514 + }
  515 +
  516 + application.MainLoop();
524 517
525 return 0; 518 return 0;
526 } 519 }
examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp
@@ -723,19 +723,10 @@ private: @@ -723,19 +723,10 @@ private:
723 723
724 }; 724 };
725 725
726 -void RunTest( Application& application )  
727 -{  
728 - ImageScalingAndFilteringController test( application );  
729 -  
730 - application.MainLoop();  
731 -}  
732 -  
733 -// Entry point for Linux & Tizen applications  
734 int DALI_EXPORT_API main( int argc, char **argv ) 726 int DALI_EXPORT_API main( int argc, char **argv )
735 { 727 {
736 Application application = Application::New( &argc, &argv, DEMO_THEME_PATH ); 728 Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
737 -  
738 - RunTest( application );  
739 - 729 + ImageScalingAndFilteringController test( application );
  730 + application.MainLoop();
740 return 0; 731 return 0;
741 } 732 }
examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp
@@ -644,19 +644,10 @@ private: @@ -644,19 +644,10 @@ private:
644 unsigned int mImagesLoaded; ///< How many images have been loaded 644 unsigned int mImagesLoaded; ///< How many images have been loaded
645 }; 645 };
646 646
647 -void RunTest( Application& application )  
648 -{  
649 - ImageScalingIrregularGridController test( application );  
650 -  
651 - application.MainLoop();  
652 -}  
653 -  
654 -/** Entry point for Linux & Tizen applications */  
655 int DALI_EXPORT_API main( int argc, char **argv ) 647 int DALI_EXPORT_API main( int argc, char **argv )
656 { 648 {
657 Application application = Application::New( &argc, &argv, DEMO_THEME_PATH ); 649 Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
658 -  
659 - RunTest( application );  
660 - 650 + ImageScalingIrregularGridController test( application );
  651 + application.MainLoop();
661 return 0; 652 return 0;
662 } 653 }
examples/image-view-alpha-blending/image-view-alpha-blending-example.cpp
1 /* 1 /*
2 - * Copyright (c) 2015 Samsung Electronics Co., Ltd. 2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
@@ -117,20 +117,10 @@ private: @@ -117,20 +117,10 @@ private:
117 unsigned int mIndex; 117 unsigned int mIndex;
118 }; 118 };
119 119
120 -void RunTest( Application& application )  
121 -{  
122 - ImageViewAlphaBlendApp test( application );  
123 -  
124 - application.MainLoop();  
125 -}  
126 -  
127 -// Entry point for Linux & Tizen applications  
128 -//  
129 int DALI_EXPORT_API main( int argc, char **argv ) 120 int DALI_EXPORT_API main( int argc, char **argv )
130 { 121 {
131 Application application = Application::New( &argc, &argv ); 122 Application application = Application::New( &argc, &argv );
132 -  
133 - RunTest( application );  
134 - 123 + ImageViewAlphaBlendApp test( application );
  124 + application.MainLoop();
135 return 0; 125 return 0;
136 } 126 }
examples/image-view-pixel-area/image-view-pixel-area-example.cpp
@@ -234,20 +234,10 @@ private: @@ -234,20 +234,10 @@ private:
234 unsigned int mIndex; 234 unsigned int mIndex;
235 }; 235 };
236 236
237 -void RunTest( Application& application )  
238 -{  
239 - ImageViewPixelAreaApp test( application );  
240 -  
241 - application.MainLoop();  
242 -}  
243 -  
244 -// Entry point for Linux & Tizen applications  
245 -//  
246 int DALI_EXPORT_API main( int argc, char **argv ) 237 int DALI_EXPORT_API main( int argc, char **argv )
247 { 238 {
248 Application application = Application::New( &argc, &argv ); 239 Application application = Application::New( &argc, &argv );
249 -  
250 - RunTest( application );  
251 - 240 + ImageViewPixelAreaApp test( application );
  241 + application.MainLoop();
252 return 0; 242 return 0;
253 } 243 }
examples/image-view-svg/image-view-svg-example.cpp
@@ -232,20 +232,10 @@ private: @@ -232,20 +232,10 @@ private:
232 unsigned int mIndex; 232 unsigned int mIndex;
233 }; 233 };
234 234
235 -void RunTest( Application& application )  
236 -{  
237 - ImageSvgController test( application );  
238 -  
239 - application.MainLoop();  
240 -}  
241 -  
242 -// Entry point for Linux & Tizen applications  
243 -//  
244 int DALI_EXPORT_API main( int argc, char **argv ) 235 int DALI_EXPORT_API main( int argc, char **argv )
245 { 236 {
246 Application application = Application::New( &argc, &argv ); 237 Application application = Application::New( &argc, &argv );
247 -  
248 - RunTest( application );  
249 - 238 + ImageSvgController test( application );
  239 + application.MainLoop();
250 return 0; 240 return 0;
251 } 241 }
examples/image-view-url/image-view-url-example.cpp
@@ -198,20 +198,10 @@ private: @@ -198,20 +198,10 @@ private:
198 Texture mOutputTexture; 198 Texture mOutputTexture;
199 }; 199 };
200 200
201 -void RunTest( Application& application )  
202 -{  
203 - ImageViewUrlApp test( application );  
204 -  
205 - application.MainLoop();  
206 -}  
207 -  
208 -// Entry point for Linux & Tizen applications  
209 -//  
210 int DALI_EXPORT_API main( int argc, char **argv ) 201 int DALI_EXPORT_API main( int argc, char **argv )
211 { 202 {
212 Application application = Application::New( &argc, &argv ); 203 Application application = Application::New( &argc, &argv );
213 -  
214 - RunTest( application );  
215 - 204 + ImageViewUrlApp test( application );
  205 + application.MainLoop();
216 return 0; 206 return 0;
217 } 207 }
examples/image-view/image-view-example.cpp
@@ -226,20 +226,10 @@ private: @@ -226,20 +226,10 @@ private:
226 226
227 }; 227 };
228 228
229 -void RunTest( Application& application )  
230 -{  
231 - ImageViewController test( application );  
232 -  
233 - application.MainLoop();  
234 -}  
235 -  
236 -// Entry point for Linux & Tizen applications  
237 -//  
238 int DALI_EXPORT_API main( int argc, char **argv ) 229 int DALI_EXPORT_API main( int argc, char **argv )
239 { 230 {
240 Application application = Application::New( &argc, &argv, DEMO_THEME_PATH ); 231 Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
241 -  
242 - RunTest( application );  
243 - 232 + ImageViewController test( application );
  233 + application.MainLoop();
244 return 0; 234 return 0;
245 } 235 }
examples/item-view/item-view-example.cpp
@@ -994,18 +994,10 @@ private: @@ -994,18 +994,10 @@ private:
994 LongPressGestureDetector mLongPressDetector; 994 LongPressGestureDetector mLongPressDetector;
995 }; 995 };
996 996
997 -void RunTest(Application& app)  
998 -{  
999 - ItemViewExample test(app);  
1000 -  
1001 - app.MainLoop();  
1002 -}  
1003 -  
1004 int DALI_EXPORT_API main(int argc, char **argv) 997 int DALI_EXPORT_API main(int argc, char **argv)
1005 { 998 {
1006 Application app = Application::New(&argc, &argv, DEMO_THEME_PATH); 999 Application app = Application::New(&argc, &argv, DEMO_THEME_PATH);
1007 -  
1008 - RunTest(app);  
1009 - 1000 + ItemViewExample test(app);
  1001 + app.MainLoop();
1010 return 0; 1002 return 0;
1011 } 1003 }
examples/line-mesh/line-mesh-example.cpp
@@ -391,20 +391,10 @@ private: @@ -391,20 +391,10 @@ private:
391 int mMaxIndexCount; 391 int mMaxIndexCount;
392 }; 392 };
393 393
394 -void RunTest( Application& application )  
395 -{  
396 - ExampleController test( application );  
397 -  
398 - application.MainLoop();  
399 -}  
400 -  
401 -// Entry point for Linux & SLP applications  
402 -//  
403 int DALI_EXPORT_API main( int argc, char **argv ) 394 int DALI_EXPORT_API main( int argc, char **argv )
404 { 395 {
405 Application application = Application::New( &argc, &argv ); 396 Application application = Application::New( &argc, &argv );
406 -  
407 - RunTest( application );  
408 - 397 + ExampleController test( application );
  398 + application.MainLoop();
409 return 0; 399 return 0;
410 } 400 }
examples/logging/logging-example.cpp deleted
1 -/*  
2 - * Copyright (c) 2017 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 "shared/view.h"  
19 -#include <dali/dali.h>  
20 -#include <dali-toolkit/dali-toolkit.h>  
21 -#include <dali/devel-api/adaptor-framework/performance-logger.h>  
22 -#include <sstream>  
23 -  
24 -using namespace Dali;  
25 -  
26 -// Define this so that it is interchangeable  
27 -// "DP" stands for Device independent Pixels  
28 -#define DP(x) x  
29 -  
30 -//enum ButtonType  
31 -//{  
32 -// PUSH_BUTTON,  
33 -// TOGGLE_BUTTON  
34 -//};  
35 -//  
36 -//struct ButtonItem  
37 -//{  
38 -// ButtonType type;  
39 -// const char* name;  
40 -// const char* text;  
41 -// const char* altText;  
42 -//};  
43 -  
44 -namespace  
45 -{  
46 -  
47 -const char* const BACKGROUND_IMAGE = DEMO_IMAGE_DIR "background-gradient.jpg";  
48 -const char* const TOOLBAR_IMAGE = DEMO_IMAGE_DIR "top-bar.png";  
49 -  
50 -const char* const TOOLBAR_TITLE = "Logging";  
51 -//const int TOOLBAR_HEIGHT = 62;  
52 -  
53 -const int MARGIN_SIZE = 10;  
54 -const int TOP_MARGIN = 85;  
55 -  
56 -const int LOGGER_GROUP_HEIGHT = 84;  
57 -const int LOGGER_RADIO_GROUP_HEIGHT = 200;  
58 -  
59 -const int LOGGER_RADIO_SPACING = 48;  
60 -  
61 -const int CONSOLE_HEIGHT = 84;  
62 -  
63 -const int BUTTON_WIDTH = 200;  
64 -const int BUTTON_HEIGHT = LOGGER_GROUP_HEIGHT - MARGIN_SIZE * 2;  
65 -  
66 -const Vector4 BACKGROUND_COLOUR( 1.0f, 1.0f, 1.0f, 0.15f );  
67 -  
68 -// Button IDs  
69 -const char* const LOGGER_1_RADIO_ID = "LOGGER_1_RADIO";  
70 -const char* const LOGGER_2_RADIO_ID = "LOGGER_2_RADIO";  
71 -const char* const LOGGER_3_RADIO_ID = "LOGGER_3_RADIO";  
72 -  
73 -const char* const FREQUENCY_1_RADIO_ID = "FREQUENCY_1_RADIO";  
74 -const char* const FREQUENCY_2_RADIO_ID = "FREQUENCY_2_RADIO";  
75 -const char* const FREQUENCY_3_RADIO_ID = "FREQUENCY_3_RADIO";  
76 -  
77 -const char* const CREATE_BUTTON_ID = "CREATE_BUTTON";  
78 -const char* const DELETE_BUTTON_ID = "DELETE_BUTTON";  
79 -const char* const START_BUTTON_ID = "START_BUTTON";  
80 -const char* const STOP_BUTTON_ID = "STOP_BUTTON";  
81 -const char* const HIGH_FREQ_BUTTON_ID = "INC_FREQ_BUTTON";  
82 -const char* const LOW_FREQ_BUTTON_ID = "DEC_FREQ_BUTTON";  
83 -const char* const ENABLE_BUTTON_ID = "ENABLE_BUTTON";  
84 -const char* const DISABLE_BUTTON_ID = "DISABLE_BUTTON";  
85 -const char* const VSYNC_BUTTON_ID = "VSYNC_BUTTON";  
86 -  
87 -const char* const CREATE_BUTTON_TEXT = "Create";  
88 -const char* const DELETE_BUTTON_TEXT = "Delete";  
89 -const char* const START_BUTTON_TEXT = "Start";  
90 -const char* const STOP_BUTTON_TEXT = "Stop";  
91 -const char* const ENABLE_BUTTON_TEXT = "Enable";  
92 -const char* const DISABLE_BUTTON_TEXT = "Disable";  
93 -const char* const VSYNC_BUTTON_TEXT = "Vsync";  
94 -  
95 -const char* const FREQUENCY_1_RADIO_TEXT = "1";  
96 -const char* const FREQUENCY_2_RADIO_TEXT = "2";  
97 -const char* const FREQUENCY_3_RADIO_TEXT = "10";  
98 -  
99 -const char* const LOGGER_TEXT = "Logger:";  
100 -const char* const FREQUENCY_TEXT = "Frequency (sec):";  
101 -  
102 -const unsigned int NUM_LOGGERS = 3;  
103 -  
104 -const unsigned int HIGH_FREQUENCY = 1; // Seconds  
105 -const unsigned int MEDIUM_FREQUENCY = 2; // Seconds  
106 -const unsigned int LOW_FREQUENCY = 10; // Seconds  
107 -const unsigned int NUM_FREQUENCIES = 3;  
108 -  
109 -} // namespace  
110 -  
111 -/**  
112 - * This example is a test harness for performance loggers.  
113 - *  
114 - * Press one of the create buttons to create a logger. This will output on vsync at the default frequency (2 seconds).  
115 - * In case nothing appears in the log, force a vsync by touching anywhere on the screen. Loggers can be deleted  
116 - * with the delete buttons. They can be enabled or disabled in which case logging will appear or disappear in the console  
117 - * respectively. To record information in a logger press the start and then stop button in succession quickly in between  
118 - * the time period when it would print to the console. This is necessary as the logger is cleared of information when  
119 - * it prints. The output will contain the smallest and largest times between start and stop recorded (minimum and maximum),  
120 - * the total time recorded by the logger as well as the average and standard deviation of all the times recorded. The  
121 - * frequency of log output can be set to high frequency (every 1 second) or low frequency (every 10 seconds).  
122 - */  
123 -class LoggingController: public ConnectionTracker  
124 -{  
125 - public:  
126 -  
127 - LoggingController( Application& application )  
128 - : mApplication( application ),  
129 - mView(),  
130 - mToolBar(),  
131 - mContentLayer(),  
132 - mAnimation(),  
133 - mPerformanceLoggerNames(),  
134 - mPerformanceLoggers(),  
135 - mCurrentLogger( 0 ),  
136 - mLoggerStates(),  
137 - mLogRadioButtons(),  
138 - mFrequencyRadioButtons()  
139 - {  
140 - // Connect to the Application's Init signal  
141 - mApplication.InitSignal().Connect( this, &LoggingController::Create );  
142 - }  
143 -  
144 - ~LoggingController()  
145 - {  
146 - // Nothing to do here  
147 - }  
148 -  
149 - void Create( Application& application )  
150 - {  
151 - // The Init signal is received once (only) during the Application lifetime  
152 -  
153 - mCurrentLogger = 0;  
154 - mPerformanceLoggers.reserve( NUM_LOGGERS );  
155 - mPerformanceLoggers.resize( NUM_LOGGERS );  
156 -  
157 - mPerformanceLoggerNames.reserve( NUM_LOGGERS );  
158 - mPerformanceLoggerNames.resize( NUM_LOGGERS );  
159 -  
160 - mLoggerStates.reserve( NUM_LOGGERS );  
161 - mLoggerStates.resize( NUM_LOGGERS );  
162 -  
163 - mLogRadioButtons.reserve( NUM_LOGGERS );  
164 - mLogRadioButtons.resize( NUM_LOGGERS );  
165 -  
166 - mFrequencyRadioButtons.reserve( NUM_FREQUENCIES );  
167 - mFrequencyRadioButtons.resize( NUM_FREQUENCIES );  
168 -  
169 - // Respond to key events  
170 - Stage::GetCurrent().KeyEventSignal().Connect(this, &LoggingController::OnKeyEvent);  
171 -  
172 - // Creates a default view with a default tool bar.  
173 - // The view is added to the stage.  
174 - mContentLayer = DemoHelper::CreateView( application,  
175 - mView,  
176 - mToolBar,  
177 - BACKGROUND_IMAGE,  
178 - TOOLBAR_IMAGE,  
179 - TOOLBAR_TITLE );  
180 -  
181 - Toolkit::TableView contentTable = Toolkit::TableView::New( 6, 1 );  
182 - contentTable.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );  
183 - contentTable.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );  
184 - contentTable.SetAnchorPoint( AnchorPoint::TOP_LEFT );  
185 - contentTable.SetParentOrigin( ParentOrigin::TOP_LEFT );  
186 - contentTable.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE * 0.5f ) );  
187 -  
188 - for( unsigned int i = 0; i < contentTable.GetRows(); ++i )  
189 - {  
190 - contentTable.SetFitHeight( i );  
191 - }  
192 -  
193 - contentTable.SetPosition( 0.0f, TOP_MARGIN );  
194 -  
195 - mContentLayer.Add( contentTable );  
196 -  
197 -  
198 - // Logger selector radio group  
199 - Toolkit::TableView radioGroupBackground = Toolkit::TableView::New( 2, 1 );  
200 - radioGroupBackground.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );  
201 - radioGroupBackground.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );  
202 - radioGroupBackground.SetBackgroundColor( BACKGROUND_COLOUR );  
203 - radioGroupBackground.SetParentOrigin( ParentOrigin::TOP_LEFT );  
204 - radioGroupBackground.SetAnchorPoint( AnchorPoint::TOP_LEFT );  
205 - radioGroupBackground.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE * 0.5f ) );  
206 -  
207 - contentTable.Add( radioGroupBackground );  
208 -  
209 - // Label  
210 - {  
211 - Toolkit::TextLabel label = Toolkit::TextLabel::New( LOGGER_TEXT );  
212 - label.SetParentOrigin( ParentOrigin::TOP_LEFT );  
213 - label.SetAnchorPoint( AnchorPoint::TOP_LEFT );  
214 - label.SetPosition( DP(MARGIN_SIZE), DP(MARGIN_SIZE) );  
215 - label.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );  
216 -  
217 - radioGroupBackground.Add( label );  
218 - radioGroupBackground.SetFitHeight( 0 );  
219 - }  
220 -  
221 - // Radio group  
222 - Toolkit::TableView radioButtonsGroup = Toolkit::TableView::New( 3, 1 );  
223 - radioButtonsGroup.SetCellPadding( Size( 0.0f, MARGIN_SIZE * 0.5f ) );  
224 - radioButtonsGroup.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );  
225 - for( unsigned int i = 0; i < radioButtonsGroup.GetRows(); ++i )  
226 - {  
227 - radioButtonsGroup.SetFitHeight( i );  
228 - }  
229 - radioButtonsGroup.SetFitWidth( 0 );  
230 -  
231 - radioGroupBackground.Add( radioButtonsGroup );  
232 - radioGroupBackground.SetFitHeight( 1 );  
233 -  
234 - int radioX = 0;  
235 - int radioY = 0;  
236 -  
237 - // Radio 1  
238 - {  
239 - Toolkit::RadioButton radioButton = Toolkit::RadioButton::New();  
240 - radioButton.SetName( LOGGER_1_RADIO_ID );  
241 - radioButton.SetParentOrigin( ParentOrigin::TOP_LEFT );  
242 - radioButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );  
243 - radioButton.SetPosition( DP(radioX), DP(radioY) );  
244 - radioButton.SetProperty( Toolkit::Button::Property::SELECTED, true );  
245 -  
246 - radioButton.StateChangedSignal().Connect( this, &LoggingController::LoggingRadioSelect );  
247 -  
248 - radioButtonsGroup.Add( radioButton );  
249 - mLogRadioButtons[0] = radioButton;  
250 - }  
251 -  
252 - // Radio 2  
253 - {  
254 - radioY += LOGGER_RADIO_SPACING;  
255 -  
256 - Toolkit::RadioButton radioButton = Toolkit::RadioButton::New();  
257 - radioButton.SetName( LOGGER_2_RADIO_ID );  
258 - radioButton.SetParentOrigin( ParentOrigin::TOP_LEFT );  
259 - radioButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );  
260 - radioButton.SetPosition( DP(radioX), DP(radioY) );  
261 -  
262 - radioButton.StateChangedSignal().Connect( this, &LoggingController::LoggingRadioSelect );  
263 -  
264 - radioButtonsGroup.Add( radioButton );  
265 - mLogRadioButtons[1] = radioButton;  
266 - }  
267 -  
268 - // Radio 3  
269 - {  
270 - radioY += LOGGER_RADIO_SPACING;  
271 -  
272 - Toolkit::RadioButton radioButton = Toolkit::RadioButton::New();  
273 - radioButton.SetName( LOGGER_3_RADIO_ID );  
274 - radioButton.SetParentOrigin( ParentOrigin::TOP_LEFT );  
275 - radioButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );  
276 - radioButton.SetPosition( DP(radioX), DP(radioY) );  
277 -  
278 - radioButton.StateChangedSignal().Connect( this, &LoggingController::LoggingRadioSelect );  
279 -  
280 - radioButtonsGroup.Add( radioButton );  
281 - mLogRadioButtons[2] = radioButton;  
282 - }  
283 -  
284 - // Create/delete/disable group  
285 - Toolkit::TableView createGroupBackground = Toolkit::TableView::New( 1, 2 );  
286 - createGroupBackground.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );  
287 - createGroupBackground.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );  
288 - createGroupBackground.SetBackgroundColor( BACKGROUND_COLOUR );  
289 - createGroupBackground.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE ) );  
290 - createGroupBackground.SetFitHeight( 0 );  
291 -  
292 - contentTable.Add( createGroupBackground );  
293 -  
294 - {  
295 - Toolkit::PushButton button = Toolkit::PushButton::New();  
296 - button.SetName( CREATE_BUTTON_ID );  
297 - button.SetProperty( Toolkit::Button::Property::LABEL, CREATE_BUTTON_TEXT);  
298 - button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );  
299 - button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );  
300 - button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked );  
301 -  
302 - createGroupBackground.Add( button );  
303 - }  
304 -  
305 - {  
306 - Toolkit::PushButton button = Toolkit::PushButton::New();  
307 - button.SetName( DELETE_BUTTON_ID );  
308 - button.SetProperty( Toolkit::Button::Property::LABEL, DELETE_BUTTON_TEXT);  
309 - button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );  
310 - button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );  
311 - button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked );  
312 -  
313 - createGroupBackground.Add( button );  
314 - }  
315 -  
316 - // Start/stop group  
317 -  
318 - Toolkit::TableView timingGroupBackground = Toolkit::TableView::New( 1, 2 );  
319 - timingGroupBackground.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );  
320 - timingGroupBackground.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );  
321 - timingGroupBackground.SetBackgroundColor( BACKGROUND_COLOUR );  
322 - timingGroupBackground.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE ) );  
323 - timingGroupBackground.SetFitHeight( 0 );  
324 -  
325 - contentTable.Add( timingGroupBackground );  
326 -  
327 - {  
328 - Toolkit::PushButton button = Toolkit::PushButton::New();  
329 - button.SetName( START_BUTTON_ID );  
330 - button.SetProperty( Toolkit::Button::Property::LABEL, START_BUTTON_TEXT);  
331 - button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );  
332 - button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );  
333 - button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked );  
334 -  
335 - timingGroupBackground.Add( button );  
336 - }  
337 -  
338 - {  
339 - Toolkit::PushButton button = Toolkit::PushButton::New();  
340 - button.SetName( STOP_BUTTON_ID );  
341 - button.SetProperty( Toolkit::Button::Property::LABEL, STOP_BUTTON_TEXT);  
342 - button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );  
343 - button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );  
344 - button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked );  
345 -  
346 - timingGroupBackground.Add( button );  
347 - }  
348 -  
349 - // Enable/disable group  
350 - Toolkit::TableView enableGroupBackground = Toolkit::TableView::New( 1, 2 );  
351 - enableGroupBackground.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );  
352 - enableGroupBackground.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );  
353 - enableGroupBackground.SetBackgroundColor( BACKGROUND_COLOUR );  
354 - enableGroupBackground.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE ) );  
355 - enableGroupBackground.SetFitHeight( 0 );  
356 -  
357 - contentTable.Add( enableGroupBackground );  
358 -  
359 - {  
360 - Toolkit::PushButton button = Toolkit::PushButton::New();  
361 - button.SetName( ENABLE_BUTTON_ID );  
362 - button.SetProperty( Toolkit::Button::Property::LABEL, ENABLE_BUTTON_TEXT);  
363 - button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );  
364 - button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );  
365 - button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked );  
366 -  
367 - enableGroupBackground.Add( button );  
368 - }  
369 -  
370 - {  
371 - Toolkit::PushButton button = Toolkit::PushButton::New();  
372 - button.SetName( DISABLE_BUTTON_ID );  
373 - button.SetProperty( Toolkit::Button::Property::LABEL, DISABLE_BUTTON_TEXT);  
374 - button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );  
375 - button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );  
376 - button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked );  
377 -  
378 - enableGroupBackground.Add( button );  
379 - }  
380 -  
381 - // Logger selector radio group  
382 - Toolkit::TableView frequencyRadioGroupBackground = Toolkit::TableView::New( 2, 1 );  
383 - frequencyRadioGroupBackground.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );  
384 - frequencyRadioGroupBackground.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );  
385 - frequencyRadioGroupBackground.SetBackgroundColor( BACKGROUND_COLOUR );  
386 - frequencyRadioGroupBackground.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE * 0.5f ) );  
387 - frequencyRadioGroupBackground.SetFitHeight( 0 );  
388 - frequencyRadioGroupBackground.SetFitHeight( 1 );  
389 -  
390 - contentTable.Add( frequencyRadioGroupBackground );  
391 -  
392 - // Label  
393 - {  
394 - Toolkit::TextLabel label = Toolkit::TextLabel::New( FREQUENCY_TEXT );  
395 -  
396 - frequencyRadioGroupBackground.Add( label );  
397 - }  
398 -  
399 - // Radio group  
400 - Toolkit::TableView frequencyRadioButtonsGroup = Toolkit::TableView::New( 1, 3 );  
401 - frequencyRadioButtonsGroup.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );  
402 - frequencyRadioButtonsGroup.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );  
403 - frequencyRadioButtonsGroup.SetFitHeight( 0 );  
404 - frequencyRadioButtonsGroup.SetPadding( Padding( 0.0f, 0.0f, MARGIN_SIZE, 0.0f ) );  
405 -  
406 - frequencyRadioGroupBackground.Add( frequencyRadioButtonsGroup );  
407 -  
408 - // Radio 1  
409 - {  
410 - Toolkit::RadioButton radioButton = Toolkit::RadioButton::New( FREQUENCY_1_RADIO_TEXT );  
411 - radioButton.SetName( FREQUENCY_1_RADIO_ID );  
412 -  
413 - radioButton.StateChangedSignal().Connect( this, &LoggingController::FrequencyRadioSelect );  
414 -  
415 - frequencyRadioButtonsGroup.Add( radioButton );  
416 - mFrequencyRadioButtons[0] = radioButton;  
417 - }  
418 -  
419 - // Radio 2  
420 - {  
421 - Toolkit::RadioButton radioButton = Toolkit::RadioButton::New( FREQUENCY_2_RADIO_TEXT );  
422 - radioButton.SetName( FREQUENCY_2_RADIO_ID );  
423 -  
424 - radioButton.SetProperty( Toolkit::Button::Property::SELECTED, true );  
425 -  
426 - radioButton.StateChangedSignal().Connect( this, &LoggingController::FrequencyRadioSelect );  
427 -  
428 - frequencyRadioButtonsGroup.Add( radioButton );  
429 - mFrequencyRadioButtons[1] = radioButton;  
430 - }  
431 -  
432 - // Radio 3  
433 - {  
434 - Toolkit::RadioButton radioButton = Toolkit::RadioButton::New( FREQUENCY_3_RADIO_TEXT );  
435 - radioButton.SetName( FREQUENCY_3_RADIO_ID );  
436 -  
437 - radioButton.StateChangedSignal().Connect( this, &LoggingController::FrequencyRadioSelect );  
438 -  
439 - frequencyRadioButtonsGroup.Add( radioButton );  
440 - mFrequencyRadioButtons[2] = radioButton;  
441 - }  
442 -  
443 - // Vsync group  
444 - Toolkit::TableView vsyncGroupBackground = Toolkit::TableView::New( 1, 1 );  
445 - vsyncGroupBackground.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );  
446 - vsyncGroupBackground.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );  
447 - vsyncGroupBackground.SetBackgroundColor( BACKGROUND_COLOUR );  
448 - vsyncGroupBackground.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE ) );  
449 - vsyncGroupBackground.SetFitHeight( 0 );  
450 -  
451 - contentTable.Add( vsyncGroupBackground );  
452 -  
453 - {  
454 - Toolkit::PushButton button = Toolkit::PushButton::New();  
455 - button.SetName( VSYNC_BUTTON_ID );  
456 - button.SetProperty( Toolkit::Button::Property::LABEL, VSYNC_BUTTON_TEXT);  
457 - button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );  
458 - button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );  
459 - button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked );  
460 -  
461 - vsyncGroupBackground.Add( button );  
462 - }  
463 -  
464 - WriteConsole();  
465 - }  
466 -  
467 - void WriteConsole()  
468 - {  
469 - for( unsigned int i = 0; i < NUM_LOGGERS; ++i)  
470 - {  
471 - std::stringstream ss;  
472 - ss << (i + 1) << ") " << ((mPerformanceLoggers[i]) ? "Created" : "Deleted")  
473 - << ", " << ((mLoggerStates[i].isTiming) ? "Started" : "Stopped")  
474 - << ", " << ((mLoggerStates[i].isEnabled) ? "Enabled" : "Disabled");  
475 -  
476 - mLogRadioButtons[i].SetProperty( Toolkit::Button::Property::LABEL, ss.str() );  
477 - }  
478 - }  
479 -  
480 - bool LoggingRadioSelect( Toolkit::Button button )  
481 - {  
482 - bool isSelected = button.GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>();  
483 - if( !isSelected )  
484 - {  
485 - return true;  
486 - }  
487 -  
488 - if( button.GetName() == LOGGER_1_RADIO_ID )  
489 - {  
490 - mCurrentLogger = 0;  
491 - }  
492 - else if( button.GetName() == LOGGER_2_RADIO_ID )  
493 - {  
494 - mCurrentLogger = 1;  
495 - }  
496 - else if( button.GetName() == LOGGER_3_RADIO_ID )  
497 - {  
498 - mCurrentLogger = 2;  
499 - }  
500 -  
501 - UpdateState();  
502 -  
503 - return true;  
504 - }  
505 -  
506 - void UpdateState()  
507 - {  
508 - DALI_ASSERT_DEBUG( mCurrentLogger < mLoggerStates.size() );  
509 - const unsigned int frequency = mLoggerStates[mCurrentLogger].frequency;  
510 - if( frequency == HIGH_FREQUENCY )  
511 - {  
512 - mFrequencyRadioButtons[0].SetProperty( Toolkit::Button::Property::SELECTED, true );  
513 - }  
514 - else if( frequency == MEDIUM_FREQUENCY )  
515 - {  
516 - mFrequencyRadioButtons[1].SetProperty( Toolkit::Button::Property::SELECTED, true );  
517 - }  
518 - else if( frequency == LOW_FREQUENCY )  
519 - {  
520 - mFrequencyRadioButtons[2].SetProperty( Toolkit::Button::Property::SELECTED, true );  
521 - }  
522 - }  
523 -  
524 - bool FrequencyRadioSelect( Toolkit::Button button )  
525 - {  
526 - bool isSelected = button.GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>();  
527 - if( !isSelected )  
528 - {  
529 - return true;  
530 - }  
531 -  
532 - if( button.GetName() == FREQUENCY_1_RADIO_ID )  
533 - {  
534 - if( mPerformanceLoggers[mCurrentLogger] )  
535 - {  
536 - DALI_ASSERT_DEBUG( mCurrentLogger < mPerformanceLoggers.size() );  
537 - mPerformanceLoggers[mCurrentLogger].SetLoggingFrequency( HIGH_FREQUENCY );  
538 -  
539 - DALI_ASSERT_DEBUG( mCurrentLogger < mLoggerStates.size() );  
540 - mLoggerStates[mCurrentLogger].frequency = HIGH_FREQUENCY;  
541 - }  
542 - }  
543 - else if( button.GetName() == FREQUENCY_2_RADIO_ID )  
544 - {  
545 - if( mPerformanceLoggers[mCurrentLogger] )  
546 - {  
547 - DALI_ASSERT_DEBUG( mCurrentLogger < mPerformanceLoggers.size() );  
548 - mPerformanceLoggers[mCurrentLogger].SetLoggingFrequency( MEDIUM_FREQUENCY );  
549 -  
550 - DALI_ASSERT_DEBUG( mCurrentLogger < mLoggerStates.size() );  
551 - mLoggerStates[mCurrentLogger].frequency = MEDIUM_FREQUENCY;  
552 - }  
553 - }  
554 - else if( button.GetName() == FREQUENCY_3_RADIO_ID )  
555 - {  
556 - if( mPerformanceLoggers[mCurrentLogger] )  
557 - {  
558 - DALI_ASSERT_DEBUG( mCurrentLogger < mPerformanceLoggers.size() );  
559 - mPerformanceLoggers[mCurrentLogger].SetLoggingFrequency( LOW_FREQUENCY );  
560 -  
561 - DALI_ASSERT_DEBUG( mCurrentLogger < mLoggerStates.size() );  
562 - mLoggerStates[mCurrentLogger].frequency = LOW_FREQUENCY;  
563 - }  
564 - }  
565 -  
566 - return true;  
567 - }  
568 -  
569 - void OnKeyEvent( const KeyEvent& event )  
570 - {  
571 - if( event.state == KeyEvent::Down )  
572 - {  
573 - if( IsKey( event, Dali::DALI_KEY_ESCAPE ) || IsKey( event, Dali::DALI_KEY_BACK ) )  
574 - {  
575 - // Exit application when click back or escape.  
576 - mApplication.Quit();  
577 - }  
578 - }  
579 - }  
580 -  
581 - bool OnButtonClicked(Toolkit::Button button)  
582 - {  
583 - if( button.GetName() == CREATE_BUTTON_ID )  
584 - {  
585 - std::stringstream ss;  
586 - ss << "Test logger " << (mCurrentLogger + 1);  
587 -  
588 - DALI_ASSERT_DEBUG( mCurrentLogger < mPerformanceLoggerNames.size() );  
589 - mPerformanceLoggerNames[mCurrentLogger] = ss.str();  
590 -  
591 - DALI_ASSERT_DEBUG( mCurrentLogger < mPerformanceLoggers.size() );  
592 - mPerformanceLoggers[mCurrentLogger] = Dali::PerformanceLogger::New( mPerformanceLoggerNames[mCurrentLogger].c_str() );  
593 -  
594 - DALI_ASSERT_DEBUG( mCurrentLogger < mLoggerStates.size() );  
595 - mLoggerStates[mCurrentLogger].isTiming = false;  
596 - mLoggerStates[mCurrentLogger].isEnabled = true;  
597 - mLoggerStates[mCurrentLogger].frequency = MEDIUM_FREQUENCY;  
598 -  
599 - UpdateState();  
600 - }  
601 - else if ( button.GetName() == DELETE_BUTTON_ID )  
602 - {  
603 - DALI_ASSERT_DEBUG( mCurrentLogger < mPerformanceLoggers.size() );  
604 - mPerformanceLoggers[mCurrentLogger].Reset();  
605 -  
606 - DALI_ASSERT_DEBUG( mCurrentLogger < mLoggerStates.size() );  
607 - mLoggerStates[mCurrentLogger].isTiming = false;  
608 - mLoggerStates[mCurrentLogger].isEnabled = true;  
609 - mLoggerStates[mCurrentLogger].frequency = MEDIUM_FREQUENCY;  
610 -  
611 - UpdateState();  
612 - }  
613 - else if ( button.GetName() == START_BUTTON_ID )  
614 - {  
615 - if( mPerformanceLoggers[mCurrentLogger] )  
616 - {  
617 - DALI_ASSERT_DEBUG( mCurrentLogger < mPerformanceLoggers.size() );  
618 - mPerformanceLoggers[mCurrentLogger].AddMarker( Dali::PerformanceLogger::START_EVENT );  
619 -  
620 - DALI_ASSERT_DEBUG( mCurrentLogger < mLoggerStates.size() );  
621 - mLoggerStates[mCurrentLogger].isTiming = true;  
622 - }  
623 - }  
624 - else if ( button.GetName() == STOP_BUTTON_ID )  
625 - {  
626 - if( mPerformanceLoggers[mCurrentLogger] )  
627 - {  
628 - DALI_ASSERT_DEBUG( mCurrentLogger < mPerformanceLoggers.size() );  
629 - mPerformanceLoggers[mCurrentLogger].AddMarker( Dali::PerformanceLogger::END_EVENT );  
630 -  
631 - DALI_ASSERT_DEBUG( mCurrentLogger < mLoggerStates.size() );  
632 - mLoggerStates[mCurrentLogger].isTiming = false;  
633 - }  
634 - }  
635 - else if ( button.GetName() == ENABLE_BUTTON_ID )  
636 - {  
637 - if( mPerformanceLoggers[mCurrentLogger] )  
638 - {  
639 - DALI_ASSERT_DEBUG( mCurrentLogger < mPerformanceLoggers.size() );  
640 - mPerformanceLoggers[mCurrentLogger].EnableLogging( true );  
641 -  
642 - DALI_ASSERT_DEBUG( mCurrentLogger < mLoggerStates.size() );  
643 - mLoggerStates[mCurrentLogger].isEnabled = true;  
644 - }  
645 - }  
646 - else if ( button.GetName() == DISABLE_BUTTON_ID )  
647 - {  
648 - if( mPerformanceLoggers[mCurrentLogger] )  
649 - {  
650 - DALI_ASSERT_DEBUG( mCurrentLogger < mPerformanceLoggers.size() );  
651 - mPerformanceLoggers[mCurrentLogger].EnableLogging( false );  
652 -  
653 - DALI_ASSERT_DEBUG( mCurrentLogger < mLoggerStates.size() );  
654 - mLoggerStates[mCurrentLogger].isEnabled = false;  
655 - }  
656 - }  
657 -  
658 - WriteConsole();  
659 -  
660 - return true;  
661 - }  
662 -  
663 -private:  
664 -  
665 - struct LoggerState  
666 - {  
667 - LoggerState() : frequency( 0 ), isTiming( false ), isEnabled( true ) {}  
668 -  
669 - unsigned int frequency;  
670 - bool isTiming;  
671 - bool isEnabled;  
672 - };  
673 -  
674 - Application& mApplication;  
675 - Toolkit::Control mView; ///< The View instance.  
676 - Toolkit::ToolBar mToolBar; ///< The View's Toolbar.  
677 - Layer mContentLayer; ///< Content layer  
678 -  
679 - Animation mAnimation;  
680 -  
681 - typedef std::vector< std::string > Strings;  
682 - Strings mPerformanceLoggerNames;  
683 -  
684 - typedef std::vector< Dali::PerformanceLogger > PerformanceLoggers;  
685 - PerformanceLoggers mPerformanceLoggers;  
686 - unsigned int mCurrentLogger;  
687 -  
688 - typedef std::vector< LoggerState > LoggerStates;  
689 - LoggerStates mLoggerStates;  
690 -  
691 - typedef std::vector< Toolkit::RadioButton > RadioButtons;  
692 - RadioButtons mLogRadioButtons;  
693 - RadioButtons mFrequencyRadioButtons;  
694 -};  
695 -  
696 -void RunTest( Application& application )  
697 -{  
698 - LoggingController test( application );  
699 -  
700 - application.MainLoop();  
701 -}  
702 -  
703 -// Entry point for Linux & Tizen applications  
704 -//  
705 -int DALI_EXPORT_API main( int argc, char **argv )  
706 -{  
707 - Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );  
708 -  
709 - RunTest( application );  
710 -  
711 - return 0;  
712 -}  
examples/magnifier/magnifier-example.cpp
1 /* 1 /*
2 - * Copyright (c) 2016 Samsung Electronics Co., Ltd. 2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
@@ -402,20 +402,10 @@ private: @@ -402,20 +402,10 @@ private:
402 402
403 }; 403 };
404 404
405 -void RunTest( Application& application )  
406 -{  
407 - ExampleController test( application );  
408 -  
409 - application.MainLoop();  
410 -}  
411 -  
412 -// Entry point for Linux & Tizen applications  
413 -//  
414 int DALI_EXPORT_API main( int argc, char **argv ) 405 int DALI_EXPORT_API main( int argc, char **argv )
415 { 406 {
416 Application application = Application::New( &argc, &argv, DEMO_THEME_PATH ); 407 Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
417 -  
418 - RunTest( application );  
419 - 408 + ExampleController test( application );
  409 + application.MainLoop();
420 return 0; 410 return 0;
421 } 411 }
examples/mesh-morph/mesh-morph-example.cpp
@@ -348,20 +348,10 @@ private: @@ -348,20 +348,10 @@ private:
348 Timer mMorphTimer; 348 Timer mMorphTimer;
349 }; 349 };
350 350
351 -void RunTest( Application& application )  
352 -{  
353 - ExampleController test( application );  
354 -  
355 - application.MainLoop();  
356 -}  
357 -  
358 -// Entry point for Linux & SLP applications  
359 -//  
360 int DALI_EXPORT_API main( int argc, char **argv ) 351 int DALI_EXPORT_API main( int argc, char **argv )
361 { 352 {
362 Application application = Application::New( &argc, &argv ); 353 Application application = Application::New( &argc, &argv );
363 -  
364 - RunTest( application );  
365 - 354 + ExampleController test( application );
  355 + application.MainLoop();
366 return 0; 356 return 0;
367 } 357 }
examples/mesh-sorting/mesh-sorting-example.cpp deleted
1 -/*  
2 - * Copyright (c) 2017 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 -// EXTERNAL INCLUDES  
19 -#include <dali-toolkit/dali-toolkit.h>  
20 -#include <stdio.h>  
21 -#include <sstream>  
22 -#include <cstring>  
23 -  
24 -// INTERNAL INCLUDES  
25 -#include "shared/view.h"  
26 -#include "shared/utility.h"  
27 -  
28 -using namespace Dali;  
29 -  
30 -namespace  
31 -{  
32 -  
33 -const char* IMAGES[] =  
34 -{  
35 - DEMO_IMAGE_DIR "people-medium-1.jpg",  
36 - DEMO_IMAGE_DIR "people-medium-4.jpg",  
37 - DEMO_IMAGE_DIR "people-medium-11.jpg",  
38 - DEMO_IMAGE_DIR "people-small-16.jpg",  
39 - DEMO_IMAGE_DIR "people-medium-15.jpg",  
40 - DEMO_IMAGE_DIR "people-medium-6.jpg",  
41 -};  
42 -const unsigned int NUMBER_OF_SAMPLES(sizeof(IMAGES)/sizeof(const char*));  
43 -  
44 -  
45 -#define MAKE_SHADER(A)#A  
46 -  
47 -const char* VERTEX_SHADER = MAKE_SHADER(  
48 -uniform highp float uHue;  
49 -attribute mediump vec2 aPosition;  
50 -attribute highp vec2 aTexCoord;  
51 -varying mediump vec2 vTexCoord;  
52 -uniform mediump mat4 uMvpMatrix;  
53 -uniform mediump vec3 uSize;  
54 -varying mediump vec3 vGlobColor;  
55 -  
56 -vec3 hsv2rgb(vec3 c)  
57 -{  
58 - vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);  
59 - vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);  
60 - return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);  
61 -}  
62 -  
63 -void main()  
64 -{  
65 - mediump vec4 vertexPosition = vec4(aPosition, 0.0, 1.0);  
66 - vertexPosition.xyz *= uSize;  
67 - vertexPosition = uMvpMatrix * vertexPosition;  
68 - vGlobColor = hsv2rgb( vec3( clamp(uHue, 0.0, 1.0), 1.0, 1.0 ) );  
69 -  
70 - vTexCoord = aTexCoord;  
71 - gl_Position = vertexPosition;  
72 -}  
73 -);  
74 -  
75 -const char* FRAGMENT_SHADER = MAKE_SHADER(  
76 -varying mediump vec2 vTexCoord;  
77 -varying mediump vec3 vGlobColor;  
78 -uniform lowp vec4 uColor;  
79 -uniform sampler2D sTexture;  
80 -  
81 -void main()  
82 -{  
83 - gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor * vec4(vGlobColor, 1.0) ;  
84 -}  
85 -);  
86 -  
87 -} // anonymous namespace  
88 -  
89 -// This example shows how to use a simple mesh  
90 -//  
91 -class ExampleController : public ConnectionTracker  
92 -{  
93 -public:  
94 -  
95 - /**  
96 - * The example controller constructor.  
97 - * @param[in] application The application instance  
98 - */  
99 - ExampleController( Application& application )  
100 - : mApplication( application ),  
101 - mZMode(0)  
102 - {  
103 - // Connect to the Application's Init signal  
104 - mApplication.InitSignal().Connect( this, &ExampleController::Create );  
105 - memset(mDepthIndices, 0, sizeof(mDepthIndices));  
106 - }  
107 -  
108 - /**  
109 - * The example controller destructor  
110 - */  
111 - ~ExampleController()  
112 - {  
113 - // Nothing to do here;  
114 - }  
115 -  
116 - /**  
117 - * Invoked upon creation of application  
118 - * @param[in] application The application instance  
119 - */  
120 - void Create( Application& application )  
121 - {  
122 - Stage stage = Stage::GetCurrent();  
123 - stage.KeyEventSignal().Connect(this, &ExampleController::OnKeyEvent);  
124 -  
125 - mStageSize = stage.GetSize();  
126 -  
127 - // The Init signal is received once (only) during the Application lifetime  
128 -  
129 - // Hide the indicator bar  
130 - application.GetWindow().ShowIndicator( Dali::Window::INVISIBLE );  
131 -  
132 - mShader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );  
133 - mGeometry = DemoHelper::CreateTexturedQuad();  
134 -  
135 - TextureSet firstTextureSet;  
136 -  
137 - for( unsigned i=0; i<NUMBER_OF_SAMPLES; ++i)  
138 - {  
139 - Texture texture = DemoHelper::LoadTexture( IMAGES[i] );  
140 - TextureSet textureSet = TextureSet::New();  
141 - textureSet.SetTexture( 0u, texture );  
142 - if( i==0 ) { firstTextureSet = textureSet; }  
143 -  
144 - Renderer renderer = Renderer::New( mGeometry, mShader );  
145 - renderer.SetTextures( textureSet );  
146 - Actor meshActor = Actor::New();  
147 - mActors[i] = meshActor;  
148 - meshActor.AddRenderer( renderer );  
149 - meshActor.SetSize(175, 175);  
150 - meshActor.RegisterProperty("index", (int)i);  
151 -  
152 - renderer.SetProperty( Renderer::Property::DEPTH_INDEX, 0 );  
153 - // Test with actor alpha  
154 - meshActor.SetParentOrigin( ParentOrigin::CENTER );  
155 - meshActor.SetAnchorPoint( AnchorPoint::CENTER );  
156 - meshActor.SetPosition( 40.0f*(i-(NUMBER_OF_SAMPLES*0.5f)), 40.0f*(i-(NUMBER_OF_SAMPLES*0.5f)), i*10 );  
157 -  
158 - meshActor.SetOpacity( i%2?0.7f:1.0f );  
159 -  
160 - meshActor.RegisterProperty("uHue", i/(float)NUMBER_OF_SAMPLES);  
161 -  
162 - meshActor.TouchSignal().Connect(this, &ExampleController::OnTouched);  
163 - std::ostringstream oss;  
164 - oss << "Mesh Actor " << i;  
165 - meshActor.SetName(oss.str());  
166 - stage.Add( meshActor );  
167 - }  
168 -  
169 - mActors[NUMBER_OF_SAMPLES-2].GetRendererAt(0).SetTextures( firstTextureSet );  
170 -  
171 - stage.GetRootLayer().TouchSignal().Connect(this, &ExampleController::OnStageTouched);  
172 - }  
173 -  
174 - void PrintDepths()  
175 - {  
176 - switch( mZMode )  
177 - {  
178 - case 0:  
179 - {  
180 - printf("Children Z ordered back to front\n");  
181 - break;  
182 - }  
183 - case 1:  
184 - {  
185 - printf("All children set to same Z=0\n");  
186 - break;  
187 - }  
188 - case 2:  
189 - {  
190 - printf("Children Z ordered front to back\n");  
191 - break;  
192 - }  
193 - }  
194 -  
195 - for( unsigned i=0; i<NUMBER_OF_SAMPLES; ++i)  
196 - {  
197 - printf("DepthIndex[%d]=%d\n", i, mDepthIndices[i]);  
198 - }  
199 - printf("\n");  
200 - }  
201 -  
202 - bool OnTouched( Actor actor, const TouchData& event )  
203 - {  
204 - if( event.GetState( 0 ) == PointState::UP )  
205 - {  
206 - int index = actor.GetProperty<int>(actor.GetPropertyIndex("index"));  
207 -  
208 - int newDepthIndex = (mDepthIndices[index] + 10) % 30;  
209 - mDepthIndices[index] = newDepthIndex;  
210 -  
211 - Renderer renderer = actor.GetRendererAt(0);  
212 - renderer.SetProperty( Renderer::Property::DEPTH_INDEX, newDepthIndex);  
213 -  
214 - PrintDepths();  
215 - }  
216 - return true;  
217 - }  
218 -  
219 - bool OnStageTouched( Actor rootLayer, const TouchData& event )  
220 - {  
221 - if( event.GetState( 0 ) == PointState::UP )  
222 - {  
223 - switch( mZMode )  
224 - {  
225 - case 0:  
226 - {  
227 - mZMode = 1;  
228 - for(unsigned int i=1; i < rootLayer.GetChildCount(); ++i)  
229 - {  
230 - Actor child = rootLayer.GetChildAt(i);  
231 - child.SetZ( 0.0f );  
232 - }  
233 - PrintDepths();  
234 - break;  
235 - }  
236 - case 1:  
237 - {  
238 - mZMode = 2;  
239 - for(unsigned int i=1; i < rootLayer.GetChildCount(); ++i)  
240 - {  
241 - Actor child = rootLayer.GetChildAt(i);  
242 - child.SetZ( 100-i*10 );  
243 - }  
244 - PrintDepths();  
245 - break;  
246 - }  
247 - case 2:  
248 - {  
249 - mZMode = 0;  
250 - for(unsigned int i=1; i < rootLayer.GetChildCount(); ++i)  
251 - {  
252 - Actor child = rootLayer.GetChildAt(i);  
253 - child.SetZ( i*10 );  
254 - }  
255 - PrintDepths();  
256 - break;  
257 - }  
258 - }  
259 - }  
260 - return true;  
261 - }  
262 -  
263 - /**  
264 - * Invoked whenever the quit button is clicked  
265 - * @param[in] button the quit button  
266 - */  
267 - bool OnQuitButtonClicked( Toolkit::Button button )  
268 - {  
269 - // quit the application  
270 - mApplication.Quit();  
271 - return true;  
272 - }  
273 -  
274 - void OnKeyEvent(const KeyEvent& event)  
275 - {  
276 - if(event.state == KeyEvent::Down)  
277 - {  
278 - if( IsKey( event, Dali::DALI_KEY_ESCAPE) || IsKey( event, Dali::DALI_KEY_BACK) )  
279 - {  
280 - mApplication.Quit();  
281 - }  
282 - }  
283 - }  
284 -  
285 -private:  
286 -  
287 - Application& mApplication; ///< Application instance  
288 - Vector3 mStageSize; ///< The size of the stage  
289 -  
290 - Shader mShader;  
291 - Geometry mGeometry;  
292 -  
293 - int mDepthIndices[NUMBER_OF_SAMPLES];  
294 - Actor mActors[NUMBER_OF_SAMPLES];  
295 - int mZMode;  
296 -};  
297 -  
298 -void RunTest( Application& application )  
299 -{  
300 - ExampleController test( application );  
301 -  
302 - application.MainLoop();  
303 -}  
304 -  
305 -// Entry point for Linux & SLP applications  
306 -//  
307 -int DALI_EXPORT_API main( int argc, char **argv )  
308 -{  
309 - Application application = Application::New( &argc, &argv );  
310 -  
311 - RunTest( application );  
312 -  
313 - return 0;  
314 -}  
examples/mesh-visual/mesh-visual-example.cpp
@@ -603,9 +603,7 @@ private: @@ -603,9 +603,7 @@ private:
603 bool mLightFront; //Bool for light being in front or behind the models. 603 bool mLightFront; //Bool for light being in front or behind the models.
604 }; 604 };
605 605
606 -// Entry point for Linux & Tizen applications  
607 -//  
608 -int main( int argc, char **argv ) 606 +int DALI_EXPORT_API main( int argc, char **argv )
609 { 607 {
610 Application application = Application::New( &argc, &argv ); 608 Application application = Application::New( &argc, &argv );
611 MeshVisualController test( application ); 609 MeshVisualController test( application );
examples/model3d-view/model3d-view-example.cpp
1 /* 1 /*
2 - * Copyright (c) 2016 Samsung Electronics Co., Ltd. 2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
@@ -294,20 +294,10 @@ private: @@ -294,20 +294,10 @@ private:
294 bool mScaled; 294 bool mScaled;
295 }; 295 };
296 296
297 -void RunTest( Application& application )  
298 -{  
299 - Model3dViewController test( application );  
300 -  
301 - application.MainLoop();  
302 -}  
303 -  
304 -// Entry point for Linux & Tizen applications  
305 -//  
306 int DALI_EXPORT_API main( int argc, char **argv ) 297 int DALI_EXPORT_API main( int argc, char **argv )
307 { 298 {
308 Application application = Application::New( &argc, &argv ); 299 Application application = Application::New( &argc, &argv );
309 -  
310 - RunTest( application );  
311 - 300 + Model3dViewController test( application );
  301 + application.MainLoop();
312 return 0; 302 return 0;
313 } 303 }
examples/motion-blur/motion-blur-example.cpp
@@ -451,20 +451,10 @@ private: @@ -451,20 +451,10 @@ private:
451 Animation mRotateAnimation; ///< Animation for rotating between landscape and portrait. 451 Animation mRotateAnimation; ///< Animation for rotating between landscape and portrait.
452 }; 452 };
453 453
454 -void RunTest(Application& app)  
455 -{  
456 - MotionBlurExampleApp test(app);  
457 -  
458 - app.MainLoop();  
459 -}  
460 -  
461 -// Entry point for Linux & Tizen applications  
462 -//  
463 int DALI_EXPORT_API main(int argc, char **argv) 454 int DALI_EXPORT_API main(int argc, char **argv)
464 { 455 {
465 Application app = Application::New(&argc, &argv, DEMO_THEME_PATH); 456 Application app = Application::New(&argc, &argv, DEMO_THEME_PATH);
466 -  
467 - RunTest(app);  
468 - 457 + MotionBlurExampleApp test(app);
  458 + app.MainLoop();
469 return 0; 459 return 0;
470 } 460 }
examples/motion-stretch/motion-stretch-example.cpp
@@ -427,20 +427,10 @@ private: @@ -427,20 +427,10 @@ private:
427 427
428 }; 428 };
429 429
430 -void RunTest(Application& app)  
431 -{  
432 - MotionStretchExampleApp test(app);  
433 -  
434 - app.MainLoop();  
435 -}  
436 -  
437 -// Entry point for Linux & Tizen applications  
438 -//  
439 int DALI_EXPORT_API main(int argc, char **argv) 430 int DALI_EXPORT_API main(int argc, char **argv)
440 { 431 {
441 Application app = Application::New(&argc, &argv, DEMO_THEME_PATH); 432 Application app = Application::New(&argc, &argv, DEMO_THEME_PATH);
442 -  
443 - RunTest(app);  
444 - 433 + MotionStretchExampleApp test(app);
  434 + app.MainLoop();
445 return 0; 435 return 0;
446 } 436 }
examples/native-image-source/native-image-source-example.cpp
@@ -432,20 +432,10 @@ private: @@ -432,20 +432,10 @@ private:
432 bool mRefreshAlways; 432 bool mRefreshAlways;
433 }; 433 };
434 434
435 -void RunTest( Application& application )  
436 -{  
437 - NativeImageSourceController test( application );  
438 -  
439 - application.MainLoop();  
440 -}  
441 -  
442 -// Entry point for Linux & Tizen applications  
443 -//  
444 int DALI_EXPORT_API main( int argc, char **argv ) 435 int DALI_EXPORT_API main( int argc, char **argv )
445 { 436 {
446 Application application = Application::New( &argc, &argv ); 437 Application application = Application::New( &argc, &argv );
447 -  
448 - RunTest( application );  
449 - 438 + NativeImageSourceController test( application );
  439 + application.MainLoop();
450 return 0; 440 return 0;
451 } 441 }
examples/perf-scroll/perf-scroll.cpp
@@ -451,15 +451,6 @@ private: @@ -451,15 +451,6 @@ private:
451 Animation mHide; 451 Animation mHide;
452 }; 452 };
453 453
454 -void RunTest( Application& application )  
455 -{  
456 - PerfScroll test( application );  
457 -  
458 - application.MainLoop();  
459 -}  
460 -  
461 -// Entry point for Linux & Tizen applications  
462 -//  
463 int DALI_EXPORT_API main( int argc, char **argv ) 454 int DALI_EXPORT_API main( int argc, char **argv )
464 { 455 {
465 Application application = Application::New( &argc, &argv ); 456 Application application = Application::New( &argc, &argv );
@@ -481,7 +472,8 @@ int DALI_EXPORT_API main( int argc, char **argv ) @@ -481,7 +472,8 @@ int DALI_EXPORT_API main( int argc, char **argv )
481 } 472 }
482 } 473 }
483 474
484 - RunTest( application ); 475 + PerfScroll test( application );
  476 + application.MainLoop();
485 477
486 return 0; 478 return 0;
487 } 479 }
examples/point-mesh/point-mesh-example.cpp
@@ -227,20 +227,10 @@ private: @@ -227,20 +227,10 @@ private:
227 Timer mChangeImageTimer; 227 Timer mChangeImageTimer;
228 }; 228 };
229 229
230 -void RunTest( Application& application )  
231 -{  
232 - ExampleController test( application );  
233 -  
234 - application.MainLoop();  
235 -}  
236 -  
237 -// Entry point for Linux & SLP applications  
238 -//  
239 int DALI_EXPORT_API main( int argc, char **argv ) 230 int DALI_EXPORT_API main( int argc, char **argv )
240 { 231 {
241 Application application = Application::New( &argc, &argv ); 232 Application application = Application::New( &argc, &argv );
242 -  
243 - RunTest( application );  
244 - 233 + ExampleController test( application );
  234 + application.MainLoop();
245 return 0; 235 return 0;
246 } 236 }
examples/popup/popup-example.cpp
@@ -732,19 +732,10 @@ private: @@ -732,19 +732,10 @@ private:
732 732
733 }; 733 };
734 734
735 -void RunTest( Application& application )  
736 -{  
737 - PopupExample test( application );  
738 -  
739 - application.MainLoop();  
740 -}  
741 -  
742 -// Entry point for Linux & SLP applications  
743 int DALI_EXPORT_API main( int argc, char **argv ) 735 int DALI_EXPORT_API main( int argc, char **argv )
744 { 736 {
745 Application application = Application::New( &argc, &argv, DEMO_THEME_PATH ); 737 Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
746 -  
747 - RunTest( application );  
748 - 738 + PopupExample test( application );
  739 + application.MainLoop();
749 return 0; 740 return 0;
750 } 741 }
examples/primitive-shapes/primitive-shapes-example.cpp
@@ -706,20 +706,10 @@ private: @@ -706,20 +706,10 @@ private:
706 Vector2 mRotation; ///< Keeps track of model rotation. 706 Vector2 mRotation; ///< Keeps track of model rotation.
707 }; 707 };
708 708
709 -void RunTest( Application& application ) 709 +int DALI_EXPORT_API main( int argc, char **argv )
710 { 710 {
  711 + Application application = Application::New( &argc, &argv );
711 PrimitiveShapesController test( application ); 712 PrimitiveShapesController test( application );
712 -  
713 application.MainLoop(); 713 application.MainLoop();
714 -}  
715 -  
716 -// Entry point for Linux & Tizen applications  
717 -//  
718 -int main( int argc, char **argv )  
719 -{  
720 - Application application = Application::New( &argc, &argv );  
721 -  
722 - RunTest( application );  
723 -  
724 return 0; 714 return 0;
725 } 715 }
examples/ray-marching/ray-marching-example.cpp
@@ -211,20 +211,10 @@ private: @@ -211,20 +211,10 @@ private:
211 ToolBar mToolBar; 211 ToolBar mToolBar;
212 }; 212 };
213 213
214 -void RunTest( Application& application )  
215 -{  
216 - RayMarchingExample test( application );  
217 -  
218 - application.MainLoop();  
219 -}  
220 -  
221 -// Entry point for Linux & Tizen applications  
222 -//  
223 int DALI_EXPORT_API main( int argc, char **argv ) 214 int DALI_EXPORT_API main( int argc, char **argv )
224 { 215 {
225 Application application = Application::New( &argc, &argv ); 216 Application application = Application::New( &argc, &argv );
226 -  
227 - RunTest( application );  
228 - 217 + RayMarchingExample test( application );
  218 + application.MainLoop();
229 return 0; 219 return 0;
230 } 220 }
examples/refraction-effect/refraction-effect-example.cpp
@@ -588,20 +588,10 @@ private: @@ -588,20 +588,10 @@ private:
588 588
589 /*****************************************************************************/ 589 /*****************************************************************************/
590 590
591 -static void  
592 -RunTest(Application& app)  
593 -{  
594 - RefractionEffectExample theApp(app);  
595 - app.MainLoop();  
596 -}  
597 -  
598 -/*****************************************************************************/  
599 -  
600 int DALI_EXPORT_API main(int argc, char **argv) 591 int DALI_EXPORT_API main(int argc, char **argv)
601 { 592 {
602 Application app = Application::New(&argc, &argv, DEMO_THEME_PATH); 593 Application app = Application::New(&argc, &argv, DEMO_THEME_PATH);
603 -  
604 - RunTest(app);  
605 - 594 + RefractionEffectExample theApp(app);
  595 + app.MainLoop();
606 return 0; 596 return 0;
607 } 597 }
examples/remote-image-loading/remote-image-loading-example.cpp
1 /* 1 /*
2 - * Copyright (c) 2016 Samsung Electronics Co., Ltd. 2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
@@ -208,18 +208,10 @@ private: @@ -208,18 +208,10 @@ private:
208 208
209 }; 209 };
210 210
211 -void RunTest(Application &application)  
212 -{  
213 - MyTester test(application);  
214 - application.MainLoop();  
215 -}  
216 -  
217 -// Entry point for Linux & Tizen applications  
218 int DALI_EXPORT_API main(int argc, char **argv) 211 int DALI_EXPORT_API main(int argc, char **argv)
219 { 212 {
220 -  
221 Application application = Application::New(&argc, &argv, ""); 213 Application application = Application::New(&argc, &argv, "");
222 - RunTest(application);  
223 - 214 + MyTester test(application);
  215 + application.MainLoop();
224 return 0; 216 return 0;
225 } 217 }
examples/renderer-stencil/renderer-stencil-example.cpp
1 /* 1 /*
2 - * Copyright (c) 2016 Samsung Electronics Co., Ltd. 2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
@@ -753,29 +753,10 @@ private: @@ -753,29 +753,10 @@ private:
753 Actor mCubes[2]; ///< The cube object containers 753 Actor mCubes[2]; ///< The cube object containers
754 }; 754 };
755 755
756 -  
757 -/**  
758 - * @brief Creates an instance of the example object and runs it.  
759 - * @param[in] application The DALi application object  
760 - */  
761 -void RunExample( Application& application )  
762 -{  
763 - RendererStencilExample example( application );  
764 -  
765 - application.MainLoop();  
766 -}  
767 -  
768 -/**  
769 - * @brief Entry point for Linux & Tizen applications  
770 - * @param[in] argc The executables argument count  
771 - * @param[in] argv The executables argument vector  
772 - * @return The executables exit code (0)  
773 - */  
774 int DALI_EXPORT_API main( int argc, char **argv ) 756 int DALI_EXPORT_API main( int argc, char **argv )
775 { 757 {
776 Application application = Application::New( &argc, &argv ); 758 Application application = Application::New( &argc, &argv );
777 -  
778 - RunExample( application );  
779 - 759 + RendererStencilExample example( application );
  760 + application.MainLoop();
780 return 0; 761 return 0;
781 } 762 }
examples/rendering-basic-light/rendering-basic-light-example.cpp
@@ -409,20 +409,10 @@ private: @@ -409,20 +409,10 @@ private:
409 Animation mAnimation; 409 Animation mAnimation;
410 }; 410 };
411 411
412 -void RunTest( Application& application )  
413 -{  
414 - BasicLightController test( application );  
415 -  
416 - application.MainLoop();  
417 -}  
418 -  
419 -// Entry point for Linux & Tizen applications  
420 -//  
421 int DALI_EXPORT_API main( int argc, char **argv ) 412 int DALI_EXPORT_API main( int argc, char **argv )
422 { 413 {
423 Application application = Application::New( &argc, &argv, BASIC_LIGHT_THEME); 414 Application application = Application::New( &argc, &argv, BASIC_LIGHT_THEME);
424 -  
425 - RunTest( application );  
426 - 415 + BasicLightController test( application );
  416 + application.MainLoop();
427 return 0; 417 return 0;
428 } 418 }
examples/rendering-basic-pbr/rendering-basic-pbr-example.cpp
@@ -451,20 +451,10 @@ private: @@ -451,20 +451,10 @@ private:
451 451
452 }; 452 };
453 453
454 -void RunTest( Application& application )  
455 -{  
456 - BasicPbrController test( application );  
457 -  
458 - application.MainLoop();  
459 -}  
460 -  
461 -// Entry point for Linux & Tizen applications  
462 -//  
463 int DALI_EXPORT_API main( int argc, char **argv ) 454 int DALI_EXPORT_API main( int argc, char **argv )
464 { 455 {
465 Application application = Application::New( &argc, &argv); 456 Application application = Application::New( &argc, &argv);
466 -  
467 - RunTest( application );  
468 - 457 + BasicPbrController test( application );
  458 + application.MainLoop();
469 return 0; 459 return 0;
470 } 460 }
examples/rendering-cube/rendering-cube.cpp
@@ -278,20 +278,10 @@ private: @@ -278,20 +278,10 @@ private:
278 Animation mAnimation; 278 Animation mAnimation;
279 }; 279 };
280 280
281 -void RunTest( Application& application )  
282 -{  
283 - DrawCubeController test( application );  
284 -  
285 - application.MainLoop();  
286 -}  
287 -  
288 -// Entry point for Linux & Tizen applications  
289 -//  
290 int DALI_EXPORT_API main( int argc, char **argv ) 281 int DALI_EXPORT_API main( int argc, char **argv )
291 { 282 {
292 Application application = Application::New( &argc, &argv ); 283 Application application = Application::New( &argc, &argv );
293 -  
294 - RunTest( application );  
295 - 284 + DrawCubeController test( application );
  285 + application.MainLoop();
296 return 0; 286 return 0;
297 } 287 }
examples/rendering-line/rendering-line.cpp
@@ -186,20 +186,10 @@ private: @@ -186,20 +186,10 @@ private:
186 Actor mActor; 186 Actor mActor;
187 }; 187 };
188 188
189 -void RunTest( Application& application )  
190 -{  
191 - DrawLineController test( application );  
192 -  
193 - application.MainLoop();  
194 -}  
195 -  
196 -// Entry point for Linux & Tizen applications  
197 -//  
198 int DALI_EXPORT_API main( int argc, char **argv ) 189 int DALI_EXPORT_API main( int argc, char **argv )
199 { 190 {
200 Application application = Application::New( &argc, &argv ); 191 Application application = Application::New( &argc, &argv );
201 -  
202 - RunTest( application );  
203 - 192 + DrawLineController test( application );
  193 + application.MainLoop();
204 return 0; 194 return 0;
205 } 195 }
examples/rendering-radial-progress/radial-progress.cpp
@@ -127,6 +127,9 @@ public: @@ -127,6 +127,9 @@ public:
127 Stage stage = Stage::GetCurrent(); 127 Stage stage = Stage::GetCurrent();
128 stage.SetBackgroundColor( Color::BLACK ); 128 stage.SetBackgroundColor( Color::BLACK );
129 129
  130 + // Connect to the stage's key signal to allow Back and Escape to exit.
  131 + stage.KeyEventSignal().Connect( this, &RadialProgressController::OnKeyEvent );
  132 +
130 // 1. Create actor to show the effect 133 // 1. Create actor to show the effect
131 mActor = Actor::New(); 134 mActor = Actor::New();
132 mActor.SetAnchorPoint( AnchorPoint::CENTER ); 135 mActor.SetAnchorPoint( AnchorPoint::CENTER );
@@ -283,6 +286,23 @@ public: @@ -283,6 +286,23 @@ public:
283 return renderer; 286 return renderer;
284 } 287 }
285 288
  289 + /**
  290 + * @brief Called when any key event is received
  291 + *
  292 + * Will use this to quit the application if Back or the Escape key is received
  293 + * @param[in] event The key event information
  294 + */
  295 + void OnKeyEvent( const KeyEvent& event )
  296 + {
  297 + if( event.state == KeyEvent::Down )
  298 + {
  299 + if( IsKey( event, DALI_KEY_ESCAPE) || IsKey( event, DALI_KEY_BACK ) )
  300 + {
  301 + mApplication.Quit();
  302 + }
  303 + }
  304 + }
  305 +
286 private: 306 private:
287 307
288 Application& mApplication; 308 Application& mApplication;
@@ -290,20 +310,10 @@ private: @@ -290,20 +310,10 @@ private:
290 Actor mActor; 310 Actor mActor;
291 }; 311 };
292 312
293 -void RunTest( Application& application )  
294 -{  
295 - RadialProgressController test( application );  
296 -  
297 - application.MainLoop();  
298 -}  
299 -  
300 -// Entry point for Linux & Tizen applications  
301 -//  
302 int DALI_EXPORT_API main( int argc, char **argv ) 313 int DALI_EXPORT_API main( int argc, char **argv )
303 { 314 {
304 Application application = Application::New( &argc, &argv ); 315 Application application = Application::New( &argc, &argv );
305 -  
306 - RunTest( application );  
307 - 316 + RadialProgressController test( application );
  317 + application.MainLoop();
308 return 0; 318 return 0;
309 } 319 }
examples/rendering-skybox/rendering-skybox.cpp
@@ -484,20 +484,10 @@ private: @@ -484,20 +484,10 @@ private:
484 Actor mSkyboxActor; 484 Actor mSkyboxActor;
485 }; 485 };
486 486
487 -void RunTest( Application& application )  
488 -{  
489 - TexturedCubeController test( application );  
490 -  
491 - application.MainLoop();  
492 -}  
493 -  
494 -// Entry point for Linux & Tizen applications  
495 -//  
496 int DALI_EXPORT_API main( int argc, char **argv ) 487 int DALI_EXPORT_API main( int argc, char **argv )
497 { 488 {
498 Application application = Application::New( &argc, &argv ); 489 Application application = Application::New( &argc, &argv );
499 -  
500 - RunTest( application );  
501 - 490 + TexturedCubeController test( application );
  491 + application.MainLoop();
502 return 0; 492 return 0;
503 } 493 }
examples/rendering-textured-cube/rendering-textured-cube.cpp
@@ -297,20 +297,10 @@ private: @@ -297,20 +297,10 @@ private:
297 Animation mAnimation; 297 Animation mAnimation;
298 }; 298 };
299 299
300 -void RunTest( Application& application )  
301 -{  
302 - TexturedCubeController test( application );  
303 -  
304 - application.MainLoop();  
305 -}  
306 -  
307 -// Entry point for Linux & Tizen applications  
308 -//  
309 int DALI_EXPORT_API main( int argc, char **argv ) 300 int DALI_EXPORT_API main( int argc, char **argv )
310 { 301 {
311 Application application = Application::New( &argc, &argv ); 302 Application application = Application::New( &argc, &argv );
312 -  
313 - RunTest( application );  
314 - 303 + TexturedCubeController test( application );
  304 + application.MainLoop();
315 return 0; 305 return 0;
316 } 306 }
examples/rendering-triangle/rendering-triangle.cpp
@@ -187,20 +187,10 @@ private: @@ -187,20 +187,10 @@ private:
187 Actor mActor; 187 Actor mActor;
188 }; 188 };
189 189
190 -void RunTest( Application& application )  
191 -{  
192 - DrawTriangleController test( application );  
193 -  
194 - application.MainLoop();  
195 -}  
196 -  
197 -// Entry point for Linux & Tizen applications  
198 -//  
199 int DALI_EXPORT_API main( int argc, char **argv ) 190 int DALI_EXPORT_API main( int argc, char **argv )
200 { 191 {
201 Application application = Application::New( &argc, &argv ); 192 Application application = Application::New( &argc, &argv );
202 -  
203 - RunTest( application );  
204 - 193 + DrawTriangleController test( application );
  194 + application.MainLoop();
205 return 0; 195 return 0;
206 } 196 }
examples/shadows-and-lights/shadows-and-lights-example.cpp
@@ -511,20 +511,10 @@ private: @@ -511,20 +511,10 @@ private:
511 511
512 /*****************************************************************************/ 512 /*****************************************************************************/
513 513
514 -static void  
515 -RunTest(Application& app)  
516 -{  
517 - TestApp theApp(app);  
518 - app.MainLoop();  
519 -}  
520 -  
521 -/*****************************************************************************/  
522 -  
523 int DALI_EXPORT_API main(int argc, char **argv) 514 int DALI_EXPORT_API main(int argc, char **argv)
524 { 515 {
525 Application app = Application::New(&argc, &argv, DEMO_THEME_PATH); 516 Application app = Application::New(&argc, &argv, DEMO_THEME_PATH);
526 -  
527 - RunTest(app);  
528 - 517 + TestApp theApp(app);
  518 + app.MainLoop();
529 return 0; 519 return 0;
530 } 520 }
examples/simple-visuals-control/simple-visuals-example.cpp
@@ -31,7 +31,6 @@ namespace @@ -31,7 +31,6 @@ namespace
31 const char* SIMPLE_DEMO_THEME( DEMO_STYLE_DIR "simple-example-theme.json" ); 31 const char* SIMPLE_DEMO_THEME( DEMO_STYLE_DIR "simple-example-theme.json" );
32 } 32 }
33 33
34 -/// Entry point for applications  
35 int DALI_EXPORT_API main( int argc, char** argv ) 34 int DALI_EXPORT_API main( int argc, char** argv )
36 { 35 {
37 Application application = Application::New( &argc, &argv, SIMPLE_DEMO_THEME ); // Use the above defined style sheet for this application. 36 Application application = Application::New( &argc, &argv, SIMPLE_DEMO_THEME ); // Use the above defined style sheet for this application.
examples/size-negotiation/size-negotiation-example.cpp
1 /* 1 /*
2 - * Copyright (c) 2016 Samsung Electronics Co., Ltd. 2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
@@ -819,19 +819,10 @@ private: @@ -819,19 +819,10 @@ private:
819 819
820 }; 820 };
821 821
822 -void RunTest( Application& application )  
823 -{  
824 - SizeNegotiationController test( application );  
825 -  
826 - application.MainLoop();  
827 -}  
828 -  
829 -// Entry point for Linux & SLP applications  
830 int DALI_EXPORT_API main( int argc, char **argv ) 822 int DALI_EXPORT_API main( int argc, char **argv )
831 { 823 {
832 Application application = Application::New( &argc, &argv, DEMO_THEME_PATH ); 824 Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
833 -  
834 - RunTest( application );  
835 - 825 + SizeNegotiationController test( application );
  826 + application.MainLoop();
836 return 0; 827 return 0;
837 } 828 }
examples/sparkle/sparkle-effect-example.cpp
1 /* 1 /*
2 - * Copyright (c) 2016 Samsung Electronics Co., Ltd. 2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
@@ -548,21 +548,11 @@ private: @@ -548,21 +548,11 @@ private:
548 std::map< Animation, int > mTapAnimationIndexPair; 548 std::map< Animation, int > mTapAnimationIndexPair;
549 }; 549 };
550 550
551 -void RunTest( Application& application )  
552 -{  
553 - SparkleEffectExample theApp( application );  
554 -  
555 - application.MainLoop();  
556 -}  
557 -  
558 -// Entry point for Linux & Tizen applications  
559 -//  
560 int DALI_EXPORT_API main( int argc, char **argv ) 551 int DALI_EXPORT_API main( int argc, char **argv )
561 { 552 {
562 Application application = Application::New( &argc, &argv ); 553 Application application = Application::New( &argc, &argv );
563 -  
564 - RunTest( application );  
565 - 554 + SparkleEffectExample theApp( application );
  555 + application.MainLoop();
566 return 0; 556 return 0;
567 } 557 }
568 558
examples/styling/style-example.cpp
1 /* 1 /*
2 - * Copyright (c) 2016 Samsung Electronics Co., Ltd. 2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
@@ -26,7 +26,6 @@ @@ -26,7 +26,6 @@
26 #include "styling-application.h" 26 #include "styling-application.h"
27 27
28 28
29 -/// Entry point for applications  
30 int DALI_EXPORT_API main( int argc, char** argv ) 29 int DALI_EXPORT_API main( int argc, char** argv )
31 { 30 {
32 const char* themeName = Demo::StylingApplication::DEMO_THEME_ONE_PATH; 31 const char* themeName = Demo::StylingApplication::DEMO_THEME_ONE_PATH;
examples/text-editor/text-editor-example.cpp
@@ -295,20 +295,11 @@ private: @@ -295,20 +295,11 @@ private:
295 Toolkit::TableView mButtonContainer; 295 Toolkit::TableView mButtonContainer;
296 }; 296 };
297 297
298 -void RunTest( Application& application )  
299 -{  
300 - TextEditorExample test( application );  
301 -  
302 - application.MainLoop();  
303 -}  
304 -  
305 -/** Entry point for Linux & Tizen applications */  
306 -int main( int argc, char **argv ) 298 +int DALI_EXPORT_API main( int argc, char **argv )
307 { 299 {
308 // DALI_DEMO_THEME_PATH not passed to Application so TextEditor example uses default Toolkit style sheet. 300 // DALI_DEMO_THEME_PATH not passed to Application so TextEditor example uses default Toolkit style sheet.
309 Application application = Application::New( &argc, &argv ); 301 Application application = Application::New( &argc, &argv );
310 -  
311 - RunTest( application );  
312 - 302 + TextEditorExample test( application );
  303 + application.MainLoop();
313 return 0; 304 return 0;
314 } 305 }
examples/text-field/text-field-example.cpp
@@ -211,20 +211,11 @@ private: @@ -211,20 +211,11 @@ private:
211 Popup mPopup; 211 Popup mPopup;
212 }; 212 };
213 213
214 -void RunTest( Application& application )  
215 -{  
216 - TextFieldExample test( application );  
217 -  
218 - application.MainLoop();  
219 -}  
220 -  
221 -/** Entry point for Linux & Tizen applications */  
222 int DALI_EXPORT_API main( int argc, char **argv ) 214 int DALI_EXPORT_API main( int argc, char **argv )
223 { 215 {
224 // DALI_DEMO_THEME_PATH not passed to Application so TextField example uses default Toolkit style sheet. 216 // DALI_DEMO_THEME_PATH not passed to Application so TextField example uses default Toolkit style sheet.
225 Application application = Application::New( &argc, &argv ); 217 Application application = Application::New( &argc, &argv );
226 -  
227 - RunTest( application );  
228 - 218 + TextFieldExample test( application );
  219 + application.MainLoop();
229 return 0; 220 return 0;
230 } 221 }
examples/text-fonts/text-fonts-example.cpp
1 /* 1 /*
2 - * Copyright (c) 2015 Samsung Electronics Co., Ltd. 2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
@@ -245,19 +245,10 @@ private: @@ -245,19 +245,10 @@ private:
245 bool mToggle; 245 bool mToggle;
246 }; 246 };
247 247
248 -void RunTest( Application& application )  
249 -{  
250 - TextFontsExample test( application );  
251 -  
252 - application.MainLoop();  
253 -}  
254 -  
255 -/** Entry point for Linux & Tizen applications */  
256 int DALI_EXPORT_API main( int argc, char **argv ) 248 int DALI_EXPORT_API main( int argc, char **argv )
257 { 249 {
258 Application application = Application::New( &argc, &argv, DEMO_THEME_PATH ); 250 Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
259 -  
260 - RunTest( application );  
261 - 251 + TextFontsExample test( application );
  252 + application.MainLoop();
262 return 0; 253 return 0;
263 } 254 }
examples/text-label-emojis/text-label-emojis.cpp
1 /* 1 /*
2 - * Copyright (c) 2016 Samsung Electronics Co., Ltd. 2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
@@ -132,20 +132,10 @@ private: @@ -132,20 +132,10 @@ private:
132 float mLastPoint; 132 float mLastPoint;
133 }; 133 };
134 134
135 -void RunTest( Application& application )  
136 -{  
137 - EmojiExample test( application );  
138 -  
139 - application.MainLoop();  
140 -}  
141 -  
142 -// Entry point for Linux & SLP applications  
143 -//  
144 int DALI_EXPORT_API main( int argc, char **argv ) 135 int DALI_EXPORT_API main( int argc, char **argv )
145 { 136 {
146 Application application = Application::New( &argc, &argv, DEMO_THEME_PATH ); 137 Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
147 -  
148 - RunTest( application );  
149 - 138 + EmojiExample test( application );
  139 + application.MainLoop();
150 return 0; 140 return 0;
151 } 141 }
examples/text-label-multi-language/text-label-multi-language-example.cpp
1 /* 1 /*
2 - * Copyright (c) 2015 Samsung Electronics Co., Ltd. 2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
@@ -134,19 +134,10 @@ private: @@ -134,19 +134,10 @@ private:
134 float mLastPoint; 134 float mLastPoint;
135 }; 135 };
136 136
137 -void RunTest( Application& application )  
138 -{  
139 - TextLabelMultiLanguageExample test( application );  
140 -  
141 - application.MainLoop();  
142 -}  
143 -  
144 -/** Entry point for Linux & Tizen applications */  
145 int DALI_EXPORT_API main( int argc, char **argv ) 137 int DALI_EXPORT_API main( int argc, char **argv )
146 { 138 {
147 Application application = Application::New( &argc, &argv, DEMO_THEME_PATH ); 139 Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
148 -  
149 - RunTest( application );  
150 - 140 + TextLabelMultiLanguageExample test( application );
  141 + application.MainLoop();
151 return 0; 142 return 0;
152 } 143 }
examples/text-label/text-label-example.cpp
@@ -582,19 +582,10 @@ private: @@ -582,19 +582,10 @@ private:
582 Property::Index mOverrideMixColorIndex; 582 Property::Index mOverrideMixColorIndex;
583 }; 583 };
584 584
585 -void RunTest( Application& application )  
586 -{  
587 - TextLabelExample test( application );  
588 -  
589 - application.MainLoop();  
590 -}  
591 -  
592 -/** Entry point for Linux & Tizen applications */  
593 int DALI_EXPORT_API main( int argc, char **argv ) 585 int DALI_EXPORT_API main( int argc, char **argv )
594 { 586 {
595 Application application = Application::New( &argc, &argv, DEMO_THEME_PATH ); 587 Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
596 -  
597 - RunTest( application );  
598 - 588 + TextLabelExample test( application );
  589 + application.MainLoop();
599 return 0; 590 return 0;
600 } 591 }
examples/text-memory-profiling/text-memory-profiling-example.cpp
@@ -419,18 +419,10 @@ private: @@ -419,18 +419,10 @@ private:
419 unsigned int mCurrentTextStyle; 419 unsigned int mCurrentTextStyle;
420 }; 420 };
421 421
422 -void RunTest( Application& application )  
423 -{  
424 - TextMemoryProfilingExample test( application );  
425 -  
426 - application.MainLoop();  
427 -}  
428 -  
429 -/** Entry point for Linux & Tizen applications */  
430 int DALI_EXPORT_API main( int argc, char **argv ) 422 int DALI_EXPORT_API main( int argc, char **argv )
431 { 423 {
432 Application application = Application::New( &argc, &argv, DEMO_THEME_PATH ); 424 Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
433 - RunTest( application );  
434 - 425 + TextMemoryProfilingExample test( application );
  426 + application.MainLoop();
435 return 0; 427 return 0;
436 } 428 }
examples/text-overlap/text-overlap-example.cpp
@@ -137,8 +137,7 @@ void TextOverlapController::OnKeyEvent( const KeyEvent&amp; keyEvent ) @@ -137,8 +137,7 @@ void TextOverlapController::OnKeyEvent( const KeyEvent&amp; keyEvent )
137 137
138 } // namespace Demo 138 } // namespace Demo
139 139
140 -  
141 -int main( int argc, char** argv ) 140 +int DALI_EXPORT_API main( int argc, char** argv )
142 { 141 {
143 { 142 {
144 Application app = Application::New( &argc, &argv ); 143 Application app = Application::New( &argc, &argv );
examples/text-scrolling/text-scrolling-example.cpp
@@ -404,19 +404,10 @@ private: @@ -404,19 +404,10 @@ private:
404 bool mToggleColor; 404 bool mToggleColor;
405 }; 405 };
406 406
407 -void RunTest( Application& application )  
408 -{  
409 - TextScrollingExample test( application );  
410 -  
411 - application.MainLoop();  
412 -}  
413 -  
414 -/** Entry point for Linux & Tizen applications */  
415 int DALI_EXPORT_API main( int argc, char **argv ) 407 int DALI_EXPORT_API main( int argc, char **argv )
416 { 408 {
417 Application application = Application::New( &argc, &argv, DEMO_THEME_PATH ); 409 Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
418 -  
419 - RunTest( application );  
420 - 410 + TextScrollingExample test( application );
  411 + application.MainLoop();
421 return 0; 412 return 0;
422 } 413 }
examples/textured-mesh/textured-mesh-example.cpp
@@ -241,20 +241,10 @@ private: @@ -241,20 +241,10 @@ private:
241 Timer mChangeImageTimer; 241 Timer mChangeImageTimer;
242 }; 242 };
243 243
244 -void RunTest( Application& application )  
245 -{  
246 - ExampleController test( application );  
247 -  
248 - application.MainLoop();  
249 -}  
250 -  
251 -// Entry point for Linux & SLP applications  
252 -//  
253 int DALI_EXPORT_API main( int argc, char **argv ) 244 int DALI_EXPORT_API main( int argc, char **argv )
254 { 245 {
255 Application application = Application::New( &argc, &argv ); 246 Application application = Application::New( &argc, &argv );
256 -  
257 - RunTest( application );  
258 - 247 + ExampleController test( application );
  248 + application.MainLoop();
259 return 0; 249 return 0;
260 } 250 }
examples/tilt/tilt-example.cpp
1 /* 1 /*
2 - * Copyright (c) 2016 Samsung Electronics Co., Ltd. 2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
@@ -112,8 +112,6 @@ private: @@ -112,8 +112,6 @@ private:
112 TextLabel mTextLabel; 112 TextLabel mTextLabel;
113 }; 113 };
114 114
115 -// Entry point for Linux & Tizen applications  
116 -//  
117 int DALI_EXPORT_API main( int argc, char **argv ) 115 int DALI_EXPORT_API main( int argc, char **argv )
118 { 116 {
119 Application application = Application::New( &argc, &argv ); 117 Application application = Application::New( &argc, &argv );
examples/transitions/transition-example.cpp
@@ -26,7 +26,6 @@ @@ -26,7 +26,6 @@
26 #include "transition-application.h" 26 #include "transition-application.h"
27 27
28 28
29 -/// Entry point for applications  
30 int DALI_EXPORT_API main( int argc, char** argv ) 29 int DALI_EXPORT_API main( int argc, char** argv )
31 { 30 {
32 const char* themeName = Demo::TransitionApplication::DEMO_THEME_ONE_PATH; 31 const char* themeName = Demo::TransitionApplication::DEMO_THEME_ONE_PATH;
examples/video-view/video-view-example.cpp
@@ -352,20 +352,10 @@ private: @@ -352,20 +352,10 @@ private:
352 Property::Map mNativeImageTarget; 352 Property::Map mNativeImageTarget;
353 }; 353 };
354 354
355 -void RunTest( Application& application )  
356 -{  
357 - VideoViewController test( application );  
358 -  
359 - application.MainLoop();  
360 -}  
361 -  
362 -// Entry point for Linux & Tizen applications  
363 -//  
364 int DALI_EXPORT_API main( int argc, char **argv ) 355 int DALI_EXPORT_API main( int argc, char **argv )
365 { 356 {
366 Application application = Application::New( &argc, &argv, DEMO_THEME_PATH ); 357 Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
367 -  
368 - RunTest( application );  
369 - 358 + VideoViewController test( application );
  359 + application.MainLoop();
370 return 0; 360 return 0;
371 } 361 }
examples/visual-transitions/transition-example.cpp
1 /* 1 /*
2 - * Copyright (c) 2016 Samsung Electronics Co., Ltd. 2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
@@ -26,7 +26,6 @@ @@ -26,7 +26,6 @@
26 #include "transition-application.h" 26 #include "transition-application.h"
27 27
28 28
29 -/// Entry point for applications  
30 int DALI_EXPORT_API main( int argc, char** argv ) 29 int DALI_EXPORT_API main( int argc, char** argv )
31 { 30 {
32 const char* themeName = Demo::TransitionApplication::DEMO_THEME_ONE_PATH; 31 const char* themeName = Demo::TransitionApplication::DEMO_THEME_ONE_PATH;
packaging/com.samsung.dali-demo.spec
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 2
3 Name: com.samsung.dali-demo 3 Name: com.samsung.dali-demo
4 Summary: The OpenGLES Canvas Core Demo 4 Summary: The OpenGLES Canvas Core Demo
5 -Version: 1.2.60 5 +Version: 1.2.61
6 Release: 1 6 Release: 1
7 Group: System/Libraries 7 Group: System/Libraries
8 License: Apache-2.0 8 License: Apache-2.0
resources/po/as.po
@@ -67,18 +67,12 @@ msgstr &quot;ছাঁয়া&quot; @@ -67,18 +67,12 @@ msgstr &quot;ছাঁয়া&quot;
67 msgid "DALI_DEMO_STR_TITLE_LINE_MESH" 67 msgid "DALI_DEMO_STR_TITLE_LINE_MESH"
68 msgstr "অঁকোৱা-পকোৱা" 68 msgstr "অঁকোৱা-পকোৱা"
69 69
70 -msgid "DALI_DEMO_STR_TITLE_LOGGING"  
71 -msgstr "Logging"  
72 -  
73 msgid "DALI_DEMO_STR_TITLE_MAGNIFIER" 70 msgid "DALI_DEMO_STR_TITLE_MAGNIFIER"
74 msgstr "পৰিবৰ্দ্ধক" 71 msgstr "পৰিবৰ্দ্ধক"
75 72
76 msgid "DALI_DEMO_STR_TITLE_MESH_MORPH" 73 msgid "DALI_DEMO_STR_TITLE_MESH_MORPH"
77 msgstr "মেশ অঙ্কুৰিত" 74 msgstr "মেশ অঙ্কুৰিত"
78 75
79 -msgid "DALI_DEMO_STR_TITLE_MESH_SORTING"  
80 -msgstr "মেশ অসংযোগ"  
81 -  
82 msgid "DALI_DEMO_STR_TITLE_MESH_VISUAL" 76 msgid "DALI_DEMO_STR_TITLE_MESH_VISUAL"
83 msgstr "3D অনুগামী" 77 msgstr "3D অনুগামী"
84 78
resources/po/de.po
@@ -67,18 +67,12 @@ msgstr &quot;Licht und Schatten&quot; @@ -67,18 +67,12 @@ msgstr &quot;Licht und Schatten&quot;
67 msgid "DALI_DEMO_STR_TITLE_LINE_MESH" 67 msgid "DALI_DEMO_STR_TITLE_LINE_MESH"
68 msgstr "Linien" 68 msgstr "Linien"
69 69
70 -msgid "DALI_DEMO_STR_TITLE_LOGGING"  
71 -msgstr "Logging"  
72 -  
73 msgid "DALI_DEMO_STR_TITLE_MAGNIFIER" 70 msgid "DALI_DEMO_STR_TITLE_MAGNIFIER"
74 msgstr "Bildschirmlupe" 71 msgstr "Bildschirmlupe"
75 72
76 msgid "DALI_DEMO_STR_TITLE_MESH_MORPH" 73 msgid "DALI_DEMO_STR_TITLE_MESH_MORPH"
77 msgstr "Mesh Veränderung" 74 msgstr "Mesh Veränderung"
78 75
79 -msgid "DALI_DEMO_STR_TITLE_MESH_SORTING"  
80 -msgstr "Mesh Sortierung"  
81 -  
82 msgid "DALI_DEMO_STR_TITLE_MESH_VISUAL" 76 msgid "DALI_DEMO_STR_TITLE_MESH_VISUAL"
83 msgstr "3D-Modelle" 77 msgstr "3D-Modelle"
84 78
resources/po/en_GB.po
@@ -73,18 +73,12 @@ msgstr &quot;Lights and Shadows&quot; @@ -73,18 +73,12 @@ msgstr &quot;Lights and Shadows&quot;
73 msgid "DALI_DEMO_STR_TITLE_LINE_MESH" 73 msgid "DALI_DEMO_STR_TITLE_LINE_MESH"
74 msgstr "Mesh Line" 74 msgstr "Mesh Line"
75 75
76 -msgid "DALI_DEMO_STR_TITLE_LOGGING"  
77 -msgstr "Logging"  
78 -  
79 msgid "DALI_DEMO_STR_TITLE_MAGNIFIER" 76 msgid "DALI_DEMO_STR_TITLE_MAGNIFIER"
80 msgstr "Magnifier" 77 msgstr "Magnifier"
81 78
82 msgid "DALI_DEMO_STR_TITLE_MESH_MORPH" 79 msgid "DALI_DEMO_STR_TITLE_MESH_MORPH"
83 msgstr "Mesh Morph" 80 msgstr "Mesh Morph"
84 81
85 -msgid "DALI_DEMO_STR_TITLE_MESH_SORTING"  
86 -msgstr "Mesh Sorting"  
87 -  
88 msgid "DALI_DEMO_STR_TITLE_MESH_VISUAL" 82 msgid "DALI_DEMO_STR_TITLE_MESH_VISUAL"
89 msgstr "Mesh Visual" 83 msgstr "Mesh Visual"
90 84
resources/po/en_US.po
@@ -76,18 +76,12 @@ msgstr &quot;Lights and Shadows&quot; @@ -76,18 +76,12 @@ msgstr &quot;Lights and Shadows&quot;
76 msgid "DALI_DEMO_STR_TITLE_LINE_MESH" 76 msgid "DALI_DEMO_STR_TITLE_LINE_MESH"
77 msgstr "Mesh Line" 77 msgstr "Mesh Line"
78 78
79 -msgid "DALI_DEMO_STR_TITLE_LOGGING"  
80 -msgstr "Logging"  
81 -  
82 msgid "DALI_DEMO_STR_TITLE_MAGNIFIER" 79 msgid "DALI_DEMO_STR_TITLE_MAGNIFIER"
83 msgstr "Magnifier" 80 msgstr "Magnifier"
84 81
85 msgid "DALI_DEMO_STR_TITLE_MESH_MORPH" 82 msgid "DALI_DEMO_STR_TITLE_MESH_MORPH"
86 msgstr "Mesh Morph" 83 msgstr "Mesh Morph"
87 84
88 -msgid "DALI_DEMO_STR_TITLE_MESH_SORTING"  
89 -msgstr "Mesh Sorting"  
90 -  
91 msgid "DALI_DEMO_STR_TITLE_MESH_VISUAL" 85 msgid "DALI_DEMO_STR_TITLE_MESH_VISUAL"
92 msgstr "Mesh Visual" 86 msgstr "Mesh Visual"
93 87
resources/po/es.po
@@ -67,18 +67,12 @@ msgstr &quot;Luces y sombras&quot; @@ -67,18 +67,12 @@ msgstr &quot;Luces y sombras&quot;
67 msgid "DALI_DEMO_STR_TITLE_LINE_MESH" 67 msgid "DALI_DEMO_STR_TITLE_LINE_MESH"
68 msgstr "Lineas" 68 msgstr "Lineas"
69 69
70 -msgid "DALI_DEMO_STR_TITLE_LOGGING"  
71 -msgstr "Control de entrada"  
72 -  
73 msgid "DALI_DEMO_STR_TITLE_MAGNIFIER" 70 msgid "DALI_DEMO_STR_TITLE_MAGNIFIER"
74 msgstr "Lupa" 71 msgstr "Lupa"
75 72
76 msgid "DALI_DEMO_STR_TITLE_MESH_MORPH" 73 msgid "DALI_DEMO_STR_TITLE_MESH_MORPH"
77 msgstr "Transformacion de geometrias" 74 msgstr "Transformacion de geometrias"
78 75
79 -msgid "DALI_DEMO_STR_TITLE_MESH_SORTING"  
80 -msgstr "Ordenacion de geometrias"  
81 -  
82 msgid "DALI_DEMO_STR_TITLE_MESH_VISUAL" 76 msgid "DALI_DEMO_STR_TITLE_MESH_VISUAL"
83 msgstr "Gemeotria 3D" 77 msgstr "Gemeotria 3D"
84 78
resources/po/fi.po
@@ -67,18 +67,12 @@ msgstr &quot;Valot ja Varjot&quot; @@ -67,18 +67,12 @@ msgstr &quot;Valot ja Varjot&quot;
67 msgid "DALI_DEMO_STR_TITLE_LINE_MESH" 67 msgid "DALI_DEMO_STR_TITLE_LINE_MESH"
68 msgstr "Viivapolygoniverkko" 68 msgstr "Viivapolygoniverkko"
69 69
70 -msgid "DALI_DEMO_STR_TITLE_LOGGING"  
71 -msgstr "Loggaus"  
72 -  
73 msgid "DALI_DEMO_STR_TITLE_MAGNIFIER" 70 msgid "DALI_DEMO_STR_TITLE_MAGNIFIER"
74 msgstr "Suurennuslasi" 71 msgstr "Suurennuslasi"
75 72
76 msgid "DALI_DEMO_STR_TITLE_MESH_MORPH" 73 msgid "DALI_DEMO_STR_TITLE_MESH_MORPH"
77 msgstr "Polygoniverkon Muodonmuutos" 74 msgstr "Polygoniverkon Muodonmuutos"
78 75
79 -msgid "DALI_DEMO_STR_TITLE_MESH_SORTING"  
80 -msgstr "Polygoniverkon Lajittelu"  
81 -  
82 msgid "DALI_DEMO_STR_TITLE_MESH_VISUAL" 76 msgid "DALI_DEMO_STR_TITLE_MESH_VISUAL"
83 msgstr "Polygoniverkkovisuaali" 77 msgstr "Polygoniverkkovisuaali"
84 78
resources/po/ko.po
@@ -70,18 +70,12 @@ msgstr &quot;빛과 그림자&quot; @@ -70,18 +70,12 @@ msgstr &quot;빛과 그림자&quot;
70 msgid "DALI_DEMO_STR_TITLE_LINE_MESH" 70 msgid "DALI_DEMO_STR_TITLE_LINE_MESH"
71 msgstr "라인 메쉬" 71 msgstr "라인 메쉬"
72 72
73 -msgid "DALI_DEMO_STR_TITLE_LOGGING"  
74 -msgstr "로깅"  
75 -  
76 msgid "DALI_DEMO_STR_TITLE_MAGNIFIER" 73 msgid "DALI_DEMO_STR_TITLE_MAGNIFIER"
77 msgstr "돋보기" 74 msgstr "돋보기"
78 75
79 msgid "DALI_DEMO_STR_TITLE_MESH_MORPH" 76 msgid "DALI_DEMO_STR_TITLE_MESH_MORPH"
80 msgstr "메쉬 형태" 77 msgstr "메쉬 형태"
81 78
82 -msgid "DALI_DEMO_STR_TITLE_MESH_SORTING"  
83 -msgstr "메쉬 분류"  
84 -  
85 msgid "DALI_DEMO_STR_TITLE_MESH_VISUAL" 79 msgid "DALI_DEMO_STR_TITLE_MESH_VISUAL"
86 msgstr "메쉬 비주얼" 80 msgstr "메쉬 비주얼"
87 81
resources/po/ml.po
@@ -67,18 +67,12 @@ msgstr &quot;നിഴല്&quot; @@ -67,18 +67,12 @@ msgstr &quot;നിഴല്&quot;
67 msgid "DALI_DEMO_STR_TITLE_LINE_MESH" 67 msgid "DALI_DEMO_STR_TITLE_LINE_MESH"
68 msgstr "വര" 68 msgstr "വര"
69 69
70 -msgid "DALI_DEMO_STR_TITLE_LOGGING"  
71 -msgstr "ലോഗിംഗ്"  
72 -  
73 msgid "DALI_DEMO_STR_TITLE_MAGNIFIER" 70 msgid "DALI_DEMO_STR_TITLE_MAGNIFIER"
74 msgstr "ഭൂതക്കണ്ണാടി" 71 msgstr "ഭൂതക്കണ്ണാടി"
75 72
76 msgid "DALI_DEMO_STR_TITLE_MESH_MORPH" 73 msgid "DALI_DEMO_STR_TITLE_MESH_MORPH"
77 msgstr "മോർഫ് mesh" 74 msgstr "മോർഫ് mesh"
78 75
79 -msgid "DALI_DEMO_STR_TITLE_MESH_SORTING"  
80 -msgstr "തരംതിരിക്കലിനായി mesh"  
81 -  
82 msgid "DALI_DEMO_STR_TITLE_MESH_VISUAL" 76 msgid "DALI_DEMO_STR_TITLE_MESH_VISUAL"
83 msgstr "3D മോഡലിങ്" 77 msgstr "3D മോഡലിങ്"
84 78
resources/po/ur.po
@@ -67,18 +67,12 @@ msgstr &quot;روشنی اور سائے&quot; @@ -67,18 +67,12 @@ msgstr &quot;روشنی اور سائے&quot;
67 msgid "DALI_DEMO_STR_TITLE_LINE_MESH" 67 msgid "DALI_DEMO_STR_TITLE_LINE_MESH"
68 msgstr "لکیریں" 68 msgstr "لکیریں"
69 69
70 -msgid "DALI_DEMO_STR_TITLE_LOGGING"  
71 -msgstr "لاگنگ"  
72 -  
73 msgid "DALI_DEMO_STR_TITLE_MAGNIFIER" 70 msgid "DALI_DEMO_STR_TITLE_MAGNIFIER"
74 msgstr "مکبر" 71 msgstr "مکبر"
75 72
76 msgid "DALI_DEMO_STR_TITLE_MESH_MORPH" 73 msgid "DALI_DEMO_STR_TITLE_MESH_MORPH"
77 msgstr "میش کی تبدیلی" 74 msgstr "میش کی تبدیلی"
78 75
79 -msgid "DALI_DEMO_STR_TITLE_MESH_SORTING"  
80 -msgstr "میش کی چھنٹائی"  
81 -  
82 msgid "DALI_DEMO_STR_TITLE_MESH_VISUAL" 76 msgid "DALI_DEMO_STR_TITLE_MESH_VISUAL"
83 msgstr "3D میش" 77 msgstr "3D میش"
84 78
resources/po/zn_CH.po
@@ -67,18 +67,12 @@ msgstr &quot;阴影&quot; @@ -67,18 +67,12 @@ msgstr &quot;阴影&quot;
67 msgid "DALI_DEMO_STR_TITLE_LINE_MESH" 67 msgid "DALI_DEMO_STR_TITLE_LINE_MESH"
68 msgstr "线条" 68 msgstr "线条"
69 69
70 -msgid "DALI_DEMO_STR_TITLE_LOGGING"  
71 -msgstr "记录"  
72 -  
73 msgid "DALI_DEMO_STR_TITLE_MAGNIFIER" 70 msgid "DALI_DEMO_STR_TITLE_MAGNIFIER"
74 msgstr "放大鏡" 71 msgstr "放大鏡"
75 72
76 msgid "DALI_DEMO_STR_TITLE_MESH_MORPH" 73 msgid "DALI_DEMO_STR_TITLE_MESH_MORPH"
77 msgstr "网格变形" 74 msgstr "网格变形"
78 75
79 -msgid "DALI_DEMO_STR_TITLE_MESH_SORTING"  
80 -msgstr "网格排序"  
81 -  
82 msgid "DALI_DEMO_STR_TITLE_MESH_VISUAL" 76 msgid "DALI_DEMO_STR_TITLE_MESH_VISUAL"
83 msgstr "3D模型" 77 msgstr "3D模型"
84 78
shared/dali-demo-strings.h
@@ -60,10 +60,8 @@ extern &quot;C&quot; @@ -60,10 +60,8 @@ extern &quot;C&quot;
60 #define DALI_DEMO_STR_TITLE_ITEM_VIEW dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_ITEM_VIEW") 60 #define DALI_DEMO_STR_TITLE_ITEM_VIEW dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_ITEM_VIEW")
61 #define DALI_DEMO_STR_TITLE_LIGHTS_AND_SHADOWS dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_LIGHTS_AND_SHADOWS") 61 #define DALI_DEMO_STR_TITLE_LIGHTS_AND_SHADOWS dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_LIGHTS_AND_SHADOWS")
62 #define DALI_DEMO_STR_TITLE_LINE_MESH dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_LINE_MESH") 62 #define DALI_DEMO_STR_TITLE_LINE_MESH dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_LINE_MESH")
63 -#define DALI_DEMO_STR_TITLE_LOGGING dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_LOGGING")  
64 #define DALI_DEMO_STR_TITLE_MAGNIFIER dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_MAGNIFIER") 63 #define DALI_DEMO_STR_TITLE_MAGNIFIER dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_MAGNIFIER")
65 #define DALI_DEMO_STR_TITLE_MESH_MORPH dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_MESH_MORPH") 64 #define DALI_DEMO_STR_TITLE_MESH_MORPH dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_MESH_MORPH")
66 -#define DALI_DEMO_STR_TITLE_MESH_SORTING dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_MESH_SORTING")  
67 #define DALI_DEMO_STR_TITLE_MESH_VISUAL dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_MESH_VISUAL") 65 #define DALI_DEMO_STR_TITLE_MESH_VISUAL dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_MESH_VISUAL")
68 #define DALI_DEMO_STR_TITLE_MOTION_BLUR dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_MOTION_BLUR") 66 #define DALI_DEMO_STR_TITLE_MOTION_BLUR dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_MOTION_BLUR")
69 #define DALI_DEMO_STR_TITLE_MOTION_STRETCH dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_MOTION_STRETCH") 67 #define DALI_DEMO_STR_TITLE_MOTION_STRETCH dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_MOTION_STRETCH")
@@ -132,10 +130,8 @@ extern &quot;C&quot; @@ -132,10 +130,8 @@ extern &quot;C&quot;
132 #define DALI_DEMO_STR_TITLE_ITEM_VIEW "Item View" 130 #define DALI_DEMO_STR_TITLE_ITEM_VIEW "Item View"
133 #define DALI_DEMO_STR_TITLE_LIGHTS_AND_SHADOWS "Lights and shadows" 131 #define DALI_DEMO_STR_TITLE_LIGHTS_AND_SHADOWS "Lights and shadows"
134 #define DALI_DEMO_STR_TITLE_LINE_MESH "Mesh Line" 132 #define DALI_DEMO_STR_TITLE_LINE_MESH "Mesh Line"
135 -#define DALI_DEMO_STR_TITLE_LOGGING "Logging"  
136 #define DALI_DEMO_STR_TITLE_MAGNIFIER "Magnifier" 133 #define DALI_DEMO_STR_TITLE_MAGNIFIER "Magnifier"
137 #define DALI_DEMO_STR_TITLE_MESH_MORPH "Mesh Morph" 134 #define DALI_DEMO_STR_TITLE_MESH_MORPH "Mesh Morph"
138 -#define DALI_DEMO_STR_TITLE_MESH_SORTING "Mesh Sorting"  
139 #define DALI_DEMO_STR_TITLE_MESH_VISUAL "Mesh Visual" 135 #define DALI_DEMO_STR_TITLE_MESH_VISUAL "Mesh Visual"
140 #define DALI_DEMO_STR_TITLE_MOTION_BLUR "Motion Blur" 136 #define DALI_DEMO_STR_TITLE_MOTION_BLUR "Motion Blur"
141 #define DALI_DEMO_STR_TITLE_MOTION_STRETCH "Motion Stretch" 137 #define DALI_DEMO_STR_TITLE_MOTION_STRETCH "Motion Stretch"