Commit a1ecdd9dc7348be0dccf85345ddb4c339f9bb93f
[dali_1.0.42] Merge branch 'tizen'
Change-Id: I6652169f0298f16e105618aa8a9ff9e6e36f3027
Showing
44 changed files
with
404 additions
and
850 deletions
builder/dali-builder.cpp
| ... | ... | @@ -28,8 +28,8 @@ |
| 28 | 28 | |
| 29 | 29 | #include <dali/dali.h> |
| 30 | 30 | #include <dali-toolkit/dali-toolkit.h> |
| 31 | -#include <dali-toolkit/public-api/builder/builder.h> | |
| 32 | -#include <dali-toolkit/public-api/builder/tree-node.h> | |
| 31 | +#include <dali-toolkit/devel-api/builder/builder.h> | |
| 32 | +#include <dali-toolkit/devel-api/builder/tree-node.h> | |
| 33 | 33 | #include <iostream> |
| 34 | 34 | #include <map> |
| 35 | 35 | #include <string> | ... | ... |
demo/dali-demo.cpp
| ... | ... | @@ -31,7 +31,7 @@ int main(int argc, char **argv) |
| 31 | 31 | textdomain(DALI_DEMO_DOMAIN_LOCAL); |
| 32 | 32 | setlocale(LC_ALL, DALI_LANG); |
| 33 | 33 | |
| 34 | - Application app = Application::New(&argc, &argv); | |
| 34 | + Application app = Application::New(&argc, &argv, DALI_DEMO_THEME_PATH); | |
| 35 | 35 | |
| 36 | 36 | // Create the demo launcher |
| 37 | 37 | DaliTableView demo(app); | ... | ... |
demo/dali-table-view.cpp
| ... | ... | @@ -22,6 +22,9 @@ |
| 22 | 22 | #include <algorithm> |
| 23 | 23 | #include <sstream> |
| 24 | 24 | #include <unistd.h> |
| 25 | +#include <dali/devel-api/images/distance-field.h> | |
| 26 | +#include <dali-toolkit/devel-api/shader-effects/alpha-discard-effect.h> | |
| 27 | +#include <dali-toolkit/devel-api/shader-effects/distance-field-effect.h> | |
| 25 | 28 | |
| 26 | 29 | // INTERNAL INCLUDES |
| 27 | 30 | #include "shared/view.h" |
| ... | ... | @@ -65,6 +68,8 @@ const float EFFECT_SNAP_DURATION = 0.66f; ///< Scroll Snap |
| 65 | 68 | const float EFFECT_FLICK_DURATION = 0.5f; ///< Scroll Flick Duration for Effects |
| 66 | 69 | const Vector3 ANGLE_CUBE_PAGE_ROTATE(Math::PI * 0.5f, Math::PI * 0.5f, 0.0f); |
| 67 | 70 | |
| 71 | + | |
| 72 | + | |
| 68 | 73 | const int NUM_BACKGROUND_IMAGES = 18; |
| 69 | 74 | const float BACKGROUND_SWIPE_SCALE = 0.025f; |
| 70 | 75 | const float BACKGROUND_SPREAD_SCALE = 1.5f; |
| ... | ... | @@ -80,19 +85,6 @@ const Vector4 BACKGROUND_COLOR( 1.0f, 1.0f, 1.0f, 1.0f ); |
| 80 | 85 | const float BUBBLE_MIN_Z = -1.0; |
| 81 | 86 | const float BUBBLE_MAX_Z = 0.0f; |
| 82 | 87 | |
| 83 | -// 3D Effect constants | |
| 84 | -const Vector2 ANGLE_SWING_3DEFFECT( Math::PI_2 * 0.75, Math::PI_2 * 0.75f ); ///< Angle Swing in radians | |
| 85 | -const Vector2 POSITION_SWING_3DEFFECT( 0.55f, 0.4f ); ///< Position Swing relative to stage size. | |
| 86 | -const Vector3 ANCHOR_3DEFFECT_STYLE0( -105.0f, 30.0f, -240.0f ); ///< Rotation Anchor position for 3D Effect (Style 0) | |
| 87 | -const Vector3 ANCHOR_3DEFFECT_STYLE1( 65.0f, -70.0f, -500.0f ); ///< Rotation Anchor position for 3D Effect (Style 1) | |
| 88 | - | |
| 89 | -Vector3 ScalePointSize(const Vector3& vec) | |
| 90 | -{ | |
| 91 | - return Vector3( DemoHelper::ScalePointSize( vec.x ), DemoHelper::ScalePointSize( vec.y ), DemoHelper::ScalePointSize( vec.z ) ); | |
| 92 | -} | |
| 93 | - | |
| 94 | -#define DP(x) DemoHelper::ScalePointSize(x) | |
| 95 | - | |
| 96 | 88 | /** |
| 97 | 89 | * Creates the background image |
| 98 | 90 | */ |
| ... | ... | @@ -140,7 +132,7 @@ public: |
| 140 | 132 | |
| 141 | 133 | // Bubbles X position moves parallax to horizontal |
| 142 | 134 | // panning by a scale factor unique to each bubble. |
| 143 | - position.x = mInitialX + ( inputs[0]->GetVector3().x * mScale ); | |
| 135 | + position.x = mInitialX + ( inputs[0]->GetVector2().x * mScale ); | |
| 144 | 136 | } |
| 145 | 137 | |
| 146 | 138 | private: |
| ... | ... | @@ -212,8 +204,6 @@ void DaliTableView::SortAlphabetically( bool sortAlphabetically ) |
| 212 | 204 | |
| 213 | 205 | void DaliTableView::Initialize( Application& application ) |
| 214 | 206 | { |
| 215 | - DemoHelper::RequestThemeChange(); | |
| 216 | - | |
| 217 | 207 | Stage::GetCurrent().KeyEventSignal().Connect( this, &DaliTableView::OnKeyEvent ); |
| 218 | 208 | |
| 219 | 209 | const Vector2 stageSize = Stage::GetCurrent().GetSize(); |
| ... | ... | @@ -318,7 +308,7 @@ void DaliTableView::Initialize( Application& application ) |
| 318 | 308 | Populate(); |
| 319 | 309 | |
| 320 | 310 | // Remove constraints for inner cube effect |
| 321 | - ApplyCubeEffectToActors(); | |
| 311 | + ApplyCubeEffectToPages(); | |
| 322 | 312 | |
| 323 | 313 | Dali::Window winHandle = application.GetWindow(); |
| 324 | 314 | winHandle.AddAvailableOrientation( Dali::Window::PORTRAIT ); |
| ... | ... | @@ -327,12 +317,10 @@ void DaliTableView::Initialize( Application& application ) |
| 327 | 317 | winHandle.RemoveAvailableOrientation( Dali::Window::LANDSCAPE_INVERSE ); |
| 328 | 318 | |
| 329 | 319 | // Set initial orientation |
| 330 | - Dali::Orientation orientation = winHandle.GetOrientation(); | |
| 331 | - | |
| 332 | - unsigned int degrees = winHandle.GetOrientation().GetDegrees(); | |
| 320 | + unsigned int degrees = 0; | |
| 333 | 321 | Rotate( degrees ); |
| 334 | 322 | |
| 335 | - orientation.ChangedSignal().Connect( this, &DaliTableView::OrientationChanged ); | |
| 323 | + //orientation.ChangedSignal().Connect( this, &DaliTableView::OrientationChanged ); | |
| 336 | 324 | |
| 337 | 325 | winHandle.ShowIndicator( Dali::Window::INVISIBLE ); |
| 338 | 326 | |
| ... | ... | @@ -346,21 +334,14 @@ void DaliTableView::Initialize( Application& application ) |
| 346 | 334 | KeyboardFocusManager::Get().FocusedActorActivatedSignal().Connect( this, &DaliTableView::OnFocusedActorActivated ); |
| 347 | 335 | } |
| 348 | 336 | |
| 349 | -void DaliTableView::ApplyCubeEffectToActors() | |
| 337 | +void DaliTableView::ApplyCubeEffectToPages() | |
| 350 | 338 | { |
| 351 | - for( ActorIter pageIter = mPages.begin(); pageIter != mPages.end(); ++pageIter ) | |
| 339 | + ScrollViewPagePathEffect effect = ScrollViewPagePathEffect::DownCast( mScrollViewEffect ); | |
| 340 | + unsigned int pageCount(0); | |
| 341 | + for( std::vector< Actor >::iterator pageIter = mPages.begin(); pageIter != mPages.end(); ++pageIter ) | |
| 352 | 342 | { |
| 353 | 343 | Actor page = *pageIter; |
| 354 | - | |
| 355 | - for( unsigned int i = 0, numChildren = page.GetChildCount(); i < numChildren; ++i) | |
| 356 | - { | |
| 357 | - // Remove old effect's manual constraints. | |
| 358 | - Actor child = page.GetChildAt(i); | |
| 359 | - if( child ) | |
| 360 | - { | |
| 361 | - ApplyCubeEffectToActor( child ); | |
| 362 | - } | |
| 363 | - } | |
| 344 | + effect.ApplyToPage( page, pageCount++ ); | |
| 364 | 345 | } |
| 365 | 346 | } |
| 366 | 347 | |
| ... | ... | @@ -446,9 +427,9 @@ void DaliTableView::Populate() |
| 446 | 427 | } |
| 447 | 428 | |
| 448 | 429 | // Update Ruler info. |
| 449 | - mScrollRulerX = new FixedRuler( stageSize.width * TABLE_RELATIVE_SIZE.x ); | |
| 430 | + mScrollRulerX = new FixedRuler( stageSize.width * TABLE_RELATIVE_SIZE.x * 0.5f ); | |
| 450 | 431 | mScrollRulerY = new DefaultRuler(); |
| 451 | - mScrollRulerX->SetDomain( RulerDomain( 0.0f, mTotalPages * stageSize.width * TABLE_RELATIVE_SIZE.x, true ) ); | |
| 432 | + mScrollRulerX->SetDomain( RulerDomain( 0.0f, (mTotalPages+1) * stageSize.width * TABLE_RELATIVE_SIZE.x * 0.5f, true ) ); | |
| 452 | 433 | mScrollRulerY->Disable(); |
| 453 | 434 | mScrollView.SetRulerX( mScrollRulerX ); |
| 454 | 435 | mScrollView.SetRulerY( mScrollRulerY ); |
| ... | ... | @@ -637,14 +618,14 @@ void DaliTableView::OnPressedAnimationFinished( Dali::Animation& source ) |
| 637 | 618 | } |
| 638 | 619 | } |
| 639 | 620 | |
| 640 | -void DaliTableView::OnScrollStart( const Dali::Vector3& position ) | |
| 621 | +void DaliTableView::OnScrollStart( const Dali::Vector2& position ) | |
| 641 | 622 | { |
| 642 | 623 | mScrolling = true; |
| 643 | 624 | |
| 644 | 625 | PlayAnimation(); |
| 645 | 626 | } |
| 646 | 627 | |
| 647 | -void DaliTableView::OnScrollComplete( const Dali::Vector3& position ) | |
| 628 | +void DaliTableView::OnScrollComplete( const Dali::Vector2& position ) | |
| 648 | 629 | { |
| 649 | 630 | mScrolling = false; |
| 650 | 631 | |
| ... | ... | @@ -681,21 +662,29 @@ void DaliTableView::ApplyScrollViewEffect() |
| 681 | 662 | |
| 682 | 663 | void DaliTableView::SetupInnerPageCubeEffect() |
| 683 | 664 | { |
| 684 | - mScrollViewEffect = ScrollViewCubeEffect::New(); | |
| 685 | - mScrollView.SetScrollSnapDuration( EFFECT_SNAP_DURATION ); | |
| 686 | - mScrollView.SetScrollFlickDuration( EFFECT_FLICK_DURATION ); | |
| 687 | - mScrollView.RemoveConstraintsFromChildren(); | |
| 688 | -} | |
| 689 | - | |
| 690 | -void DaliTableView::ApplyCubeEffectToActor( Actor actor ) | |
| 691 | -{ | |
| 692 | - actor.RemoveConstraints(); | |
| 665 | + const Vector2 stageSize = Stage::GetCurrent().GetSize(); | |
| 693 | 666 | |
| 694 | - ScrollViewCubeEffect cubeEffect = ScrollViewCubeEffect::DownCast(mScrollViewEffect); | |
| 695 | - cubeEffect.ApplyToActor( actor, | |
| 696 | - ScalePointSize( ( rand() & 1 ) ? ANCHOR_3DEFFECT_STYLE0 : ANCHOR_3DEFFECT_STYLE1 ), | |
| 697 | - ANGLE_SWING_3DEFFECT, | |
| 698 | - POSITION_SWING_3DEFFECT * Vector2(Stage::GetCurrent().GetSize())); | |
| 667 | + Dali::Path path = Dali::Path::New(); | |
| 668 | + Dali::Property::Array points; | |
| 669 | + points.Resize(3); | |
| 670 | + points[0] = Vector3( stageSize.x*0.5, 0.0f, stageSize.x*0.5f); | |
| 671 | + points[1] = Vector3( 0.0f, 0.0f, 0.0f ); | |
| 672 | + points[2] = Vector3( -stageSize.x*0.5f, 0.0f, stageSize.x*0.5f); | |
| 673 | + path.SetProperty( Path::Property::POINTS, points ); | |
| 674 | + | |
| 675 | + Dali::Property::Array controlPoints; | |
| 676 | + controlPoints.Resize(4); | |
| 677 | + controlPoints[0] = Vector3( stageSize.x*0.5f, 0.0f, stageSize.x*0.3f ); | |
| 678 | + controlPoints[1] = Vector3( stageSize.x*0.3f, 0.0f, 0.0f ); | |
| 679 | + controlPoints[2] = Vector3(-stageSize.x*0.3f, 0.0f, 0.0f ); | |
| 680 | + controlPoints[3] = Vector3(-stageSize.x*0.5f, 0.0f, stageSize.x*0.3f ); | |
| 681 | + path.SetProperty( Path::Property::CONTROL_POINTS, controlPoints ); | |
| 682 | + | |
| 683 | + | |
| 684 | + mScrollViewEffect = ScrollViewPagePathEffect::New(path, | |
| 685 | + Vector3(-1.0f,0.0f,0.0f), | |
| 686 | + Toolkit::ScrollView::Property::SCROLL_FINAL_X, | |
| 687 | + Vector3(stageSize.x*TABLE_RELATIVE_SIZE.x,stageSize.y*TABLE_RELATIVE_SIZE.y,0.0f),mTotalPages); | |
| 699 | 688 | } |
| 700 | 689 | |
| 701 | 690 | void DaliTableView::OnKeyEvent( const KeyEvent& event ) | ... | ... |
demo/dali-table-view.h
| ... | ... | @@ -22,6 +22,7 @@ |
| 22 | 22 | |
| 23 | 23 | #include <dali/dali.h> |
| 24 | 24 | #include <dali-toolkit/dali-toolkit.h> |
| 25 | +#include <dali-toolkit/devel-api/controls/popup/popup.h> | |
| 25 | 26 | |
| 26 | 27 | class Example; |
| 27 | 28 | |
| ... | ... | @@ -217,14 +218,14 @@ private: // Application callbacks & implementation |
| 217 | 218 | * |
| 218 | 219 | * @param[in] position The current position of the scroll contents. |
| 219 | 220 | */ |
| 220 | - void OnScrollStart(const Dali::Vector3& position); | |
| 221 | + void OnScrollStart(const Dali::Vector2& position); | |
| 221 | 222 | |
| 222 | 223 | /** |
| 223 | 224 | * Signal emitted when scrolling has completed. |
| 224 | 225 | * |
| 225 | 226 | * @param[in] position The current position of the scroll contents. |
| 226 | 227 | */ |
| 227 | - void OnScrollComplete(const Dali::Vector3& position); | |
| 228 | + void OnScrollComplete(const Dali::Vector2& position); | |
| 228 | 229 | |
| 229 | 230 | /** |
| 230 | 231 | * Signal emitted when any Sensitive Actor has been touched |
| ... | ... | @@ -245,7 +246,7 @@ private: // Application callbacks & implementation |
| 245 | 246 | /** |
| 246 | 247 | * Apply the cube effect to all the page actors |
| 247 | 248 | */ |
| 248 | - void ApplyCubeEffectToActors(); | |
| 249 | + void ApplyCubeEffectToPages(); | |
| 249 | 250 | |
| 250 | 251 | /** |
| 251 | 252 | * Setup the inner cube effect |
| ... | ... | @@ -253,11 +254,6 @@ private: // Application callbacks & implementation |
| 253 | 254 | void SetupInnerPageCubeEffect(); |
| 254 | 255 | |
| 255 | 256 | /** |
| 256 | - * Apply the cube effect to an actor | |
| 257 | - */ | |
| 258 | - void ApplyCubeEffectToActor( Dali::Actor actor ); | |
| 259 | - | |
| 260 | - /** | |
| 261 | 257 | * Apply a shader effect to a table tile |
| 262 | 258 | */ |
| 263 | 259 | void ApplyEffectToTile(Dali::Actor tile); |
| ... | ... | @@ -410,9 +406,9 @@ private: |
| 410 | 406 | Dali::Toolkit::Popup mVersionPopup; ///< Displays DALi library version information |
| 411 | 407 | Dali::Vector3 mButtonsPageRelativeSize; ///< Size of a buttons page relative to the stage size |
| 412 | 408 | |
| 413 | - Dali::ActorContainer mPages; ///< List of pages. | |
| 414 | - Dali::ActorContainer mTableViewImages; ///< Offscreen render of tableview | |
| 415 | - Dali::ActorContainer mBackgroundActors; ///< List of background actors used in the effect | |
| 409 | + std::vector< Dali::Actor > mPages; ///< List of pages. | |
| 410 | + std::vector< Dali::Actor > mTableViewImages; ///< Offscreen render of tableview | |
| 411 | + std::vector< Dali::Actor > mBackgroundActors; ///< List of background actors used in the effect | |
| 416 | 412 | AnimationList mBackgroundAnimations; ///< List of background bubble animations |
| 417 | 413 | ExampleList mExampleList; ///< List of examples. |
| 418 | 414 | ExampleMap mExampleMap; ///< Map LUT for examples. | ... | ... |
examples/animated-shapes/animated-shapes-example.cpp
| ... | ... | @@ -17,6 +17,9 @@ |
| 17 | 17 | |
| 18 | 18 | #include <dali/dali.h> |
| 19 | 19 | #include <dali-toolkit/dali-toolkit.h> |
| 20 | +#include <dali/devel-api/actors/mesh-actor.h> | |
| 21 | +#include <dali/devel-api/geometry/mesh.h> | |
| 22 | +#include <dali-toolkit/devel-api/shader-effects/quadratic-bezier.h> | |
| 20 | 23 | |
| 21 | 24 | #include "shared/view.h" |
| 22 | 25 | |
| ... | ... | @@ -49,8 +52,6 @@ public: |
| 49 | 52 | // The Init signal is received once (only) during the Application lifetime |
| 50 | 53 | void Create( Application& application ) |
| 51 | 54 | { |
| 52 | - DemoHelper::RequestThemeChange(); | |
| 53 | - | |
| 54 | 55 | // Get a handle to the stage |
| 55 | 56 | Stage stage = Stage::GetCurrent(); |
| 56 | 57 | |
| ... | ... | @@ -373,7 +374,7 @@ void RunTest( Application& application ) |
| 373 | 374 | |
| 374 | 375 | int main( int argc, char **argv ) |
| 375 | 376 | { |
| 376 | - Application application = Application::New( &argc, &argv ); | |
| 377 | + Application application = Application::New( &argc, &argv, DALI_DEMO_THEME_PATH ); | |
| 377 | 378 | RunTest( application ); |
| 378 | 379 | |
| 379 | 380 | return 0; | ... | ... |
examples/atlas/atlas-example.cpp
| ... | ... | @@ -16,6 +16,8 @@ |
| 16 | 16 | */ |
| 17 | 17 | |
| 18 | 18 | #include <dali/dali.h> |
| 19 | +#include <dali/devel-api/images/atlas.h> | |
| 20 | + | |
| 19 | 21 | #include "shared/view.h" |
| 20 | 22 | #include <iostream> |
| 21 | 23 | #include <cstdio> |
| ... | ... | @@ -224,7 +226,7 @@ void RunTest( Application& application ) |
| 224 | 226 | // |
| 225 | 227 | int main( int argc, char **argv ) |
| 226 | 228 | { |
| 227 | - gApplication = Application::New( &argc, &argv ); | |
| 229 | + gApplication = Application::New( &argc, &argv, DALI_DEMO_THEME_PATH ); | |
| 228 | 230 | |
| 229 | 231 | RunTest( gApplication ); |
| 230 | 232 | ... | ... |
examples/blocks/blocks-example.cpp
| ... | ... | @@ -226,8 +226,6 @@ public: |
| 226 | 226 | */ |
| 227 | 227 | void Create(Application& application) |
| 228 | 228 | { |
| 229 | - DemoHelper::RequestThemeChange(); | |
| 230 | - | |
| 231 | 229 | Stage::GetCurrent().KeyEventSignal().Connect(this, &ExampleController::OnKeyEvent); |
| 232 | 230 | |
| 233 | 231 | // Creates a default view with a default tool bar. |
| ... | ... | @@ -841,7 +839,7 @@ void RunTest(Application& app) |
| 841 | 839 | |
| 842 | 840 | int main(int argc, char **argv) |
| 843 | 841 | { |
| 844 | - Application app = Application::New(&argc, &argv); | |
| 842 | + Application app = Application::New(&argc, &argv, DALI_DEMO_THEME_PATH); | |
| 845 | 843 | |
| 846 | 844 | RunTest(app); |
| 847 | 845 | ... | ... |
examples/bubble-effect/bubble-effect-example.cpp
| ... | ... | @@ -17,6 +17,7 @@ |
| 17 | 17 | |
| 18 | 18 | #include <dali/dali.h> |
| 19 | 19 | #include <dali-toolkit/dali-toolkit.h> |
| 20 | +#include <dali-toolkit/devel-api/controls/bubble-effect/bubble-emitter.h> | |
| 20 | 21 | #include "shared/view.h" |
| 21 | 22 | |
| 22 | 23 | using namespace Dali; |
| ... | ... | @@ -91,8 +92,6 @@ private: |
| 91 | 92 | // The Init signal is received once (only) during the Application lifetime |
| 92 | 93 | void Create(Application& app) |
| 93 | 94 | { |
| 94 | - DemoHelper::RequestThemeChange(); | |
| 95 | - | |
| 96 | 95 | Stage stage = Stage::GetCurrent(); |
| 97 | 96 | Vector2 stageSize = stage.GetSize(); |
| 98 | 97 | |
| ... | ... | @@ -101,9 +100,8 @@ private: |
| 101 | 100 | // Creates a default view with a default tool bar. |
| 102 | 101 | // The view is added to the stage. |
| 103 | 102 | Toolkit::ToolBar toolBar; |
| 104 | - Toolkit::Control view; | |
| 105 | 103 | Layer content = DemoHelper::CreateView( app, |
| 106 | - view, | |
| 104 | + mBackground, | |
| 107 | 105 | toolBar, |
| 108 | 106 | "", |
| 109 | 107 | TOOLBAR_IMAGE, |
| ... | ... | @@ -141,15 +139,14 @@ private: |
| 141 | 139 | content.Add( bubbleRoot ); |
| 142 | 140 | |
| 143 | 141 | // Add the background image actor to stage |
| 144 | - view.SetBackgroundImage( mBackgroundImage ); | |
| 145 | - mBackgroundActor = ImageActor::DownCast( view.GetBackgroundActor() ); | |
| 142 | + mBackground.SetBackgroundImage( mBackgroundImage ); | |
| 146 | 143 | |
| 147 | 144 | // Set up the timer to emit bubble regularly when the finger is touched down but not moved |
| 148 | 145 | mTimerForBubbleEmission = Timer::New( mTimerInterval ); |
| 149 | 146 | mTimerForBubbleEmission.TickSignal().Connect(this, &BubbleEffectExample::OnTimerTick); |
| 150 | 147 | |
| 151 | 148 | // Connect the callback to the touch signal on the background |
| 152 | - mBackgroundActor.TouchedSignal().Connect( this, &BubbleEffectExample::OnTouch ); | |
| 149 | + mBackground.TouchedSignal().Connect( this, &BubbleEffectExample::OnTouch ); | |
| 153 | 150 | } |
| 154 | 151 | |
| 155 | 152 | |
| ... | ... | @@ -256,7 +253,7 @@ private: |
| 256 | 253 | |
| 257 | 254 | mBubbleEmitter.SetBackground( mBackgroundImage, mHSVDelta ); |
| 258 | 255 | |
| 259 | - mBackgroundActor.SetImage( mBackgroundImage ); | |
| 256 | + mBackground.SetBackgroundImage( mBackgroundImage ); | |
| 260 | 257 | } |
| 261 | 258 | else if( button == mChangeBubbleShapeButton ) |
| 262 | 259 | { |
| ... | ... | @@ -283,7 +280,7 @@ private: |
| 283 | 280 | |
| 284 | 281 | Application& mApp; |
| 285 | 282 | Image mBackgroundImage; |
| 286 | - ImageActor mBackgroundActor; | |
| 283 | + Dali::Toolkit::Control mBackground; | |
| 287 | 284 | |
| 288 | 285 | Toolkit::BubbleEmitter mBubbleEmitter; |
| 289 | 286 | Vector3 mHSVDelta; |
| ... | ... | @@ -319,7 +316,7 @@ RunTest(Application& app) |
| 319 | 316 | int |
| 320 | 317 | main(int argc, char **argv) |
| 321 | 318 | { |
| 322 | - Application app = Application::New(&argc, &argv); | |
| 319 | + Application app = Application::New(&argc, &argv, DALI_DEMO_THEME_PATH); | |
| 323 | 320 | |
| 324 | 321 | RunTest(app); |
| 325 | 322 | ... | ... |
examples/builder/examples.cpp
| ... | ... | @@ -20,11 +20,12 @@ |
| 20 | 20 | // |
| 21 | 21 | //------------------------------------------------------------------------------ |
| 22 | 22 | |
| 23 | -#include "dali.h" | |
| 23 | +#include <dali/dali.h> | |
| 24 | 24 | #include <dali-toolkit/dali-toolkit.h> |
| 25 | -#include <dali-toolkit/public-api/builder/builder.h> | |
| 26 | -#include <dali-toolkit/public-api/builder/tree-node.h> | |
| 27 | -#include <dali-toolkit/public-api/builder/json-parser.h> | |
| 25 | +#include <dali-toolkit/devel-api/builder/builder.h> | |
| 26 | +#include <dali-toolkit/devel-api/builder/tree-node.h> | |
| 27 | +#include <dali-toolkit/devel-api/builder/json-parser.h> | |
| 28 | +#include <dali-toolkit/devel-api/controls/popup/popup.h> | |
| 28 | 29 | #include <map> |
| 29 | 30 | #include <string> |
| 30 | 31 | #include <fstream> |
| ... | ... | @@ -36,6 +37,7 @@ |
| 36 | 37 | |
| 37 | 38 | #include "sys/stat.h" |
| 38 | 39 | #include <ctime> |
| 40 | +#include <cstring> | |
| 39 | 41 | |
| 40 | 42 | #include <dali/integration-api/debug.h> |
| 41 | 43 | #include "shared/view.h" |
| ... | ... | @@ -141,11 +143,6 @@ const std::string ShortName( const std::string& name ) |
| 141 | 143 | } |
| 142 | 144 | } |
| 143 | 145 | |
| 144 | -static Vector3 SetItemSize(unsigned int numberOfColumns, float layoutWidth, float sideMargin, float columnSpacing) | |
| 145 | -{ | |
| 146 | - return Vector3(layoutWidth, 50, 1); | |
| 147 | -} | |
| 148 | - | |
| 149 | 146 | //------------------------------------------------------------------------------ |
| 150 | 147 | // |
| 151 | 148 | // |
| ... | ... | @@ -291,17 +288,12 @@ public: |
| 291 | 288 | stage.Add( mItemView ); |
| 292 | 289 | mItemView.SetParentOrigin(ParentOrigin::CENTER); |
| 293 | 290 | mItemView.SetAnchorPoint(AnchorPoint::CENTER); |
| 294 | - mGridLayout = GridLayout::New(); | |
| 295 | - mGridLayout->SetNumberOfColumns(1); | |
| 291 | + mLayout = DefaultItemLayout::New( DefaultItemLayout::LIST ); | |
| 296 | 292 | |
| 297 | - mGridLayout->SetItemSizeFunction(SetItemSize); | |
| 293 | + mLayout->SetItemSize( Vector3( stage.GetSize().width, 50, 1 ) ); | |
| 298 | 294 | |
| 299 | - mGridLayout->SetTopMargin(DemoHelper::DEFAULT_VIEW_STYLE.mToolBarHeight); | |
| 295 | + mItemView.AddLayout( *mLayout ); | |
| 300 | 296 | |
| 301 | - mItemView.AddLayout(*mGridLayout); | |
| 302 | - | |
| 303 | - Vector3 size(stage.GetSize()); | |
| 304 | - mItemView.ActivateLayout(0, size, 0.0f/*immediate*/); | |
| 305 | 297 | mItemView.SetKeyboardFocusable( true ); |
| 306 | 298 | |
| 307 | 299 | mFiles.clear(); |
| ... | ... | @@ -369,9 +361,9 @@ public: |
| 369 | 361 | |
| 370 | 362 | SetTitle("Select"); |
| 371 | 363 | |
| 372 | - // Itemview renderes the previous items unless its scrolled. Not sure why at the moment so we force a scroll | |
| 373 | - mItemView.ScrollToItem(0, 0); | |
| 374 | - | |
| 364 | + // Activate the layout | |
| 365 | + Vector3 size(stage.GetSize()); | |
| 366 | + mItemView.ActivateLayout(0, size, 0.0f/*immediate*/); | |
| 375 | 367 | } |
| 376 | 368 | |
| 377 | 369 | void ExitSelection() |
| ... | ... | @@ -501,8 +493,6 @@ public: |
| 501 | 493 | |
| 502 | 494 | void Create(Application& app) |
| 503 | 495 | { |
| 504 | - DemoHelper::RequestThemeChange(); | |
| 505 | - | |
| 506 | 496 | Stage stage = Stage::GetCurrent(); |
| 507 | 497 | |
| 508 | 498 | Stage::GetCurrent().KeyEventSignal().Connect(this, &ExampleApp::OnKeyEvent); |
| ... | ... | @@ -585,7 +575,7 @@ public: |
| 585 | 575 | private: |
| 586 | 576 | Application& mApp; |
| 587 | 577 | |
| 588 | - GridLayoutPtr mGridLayout; | |
| 578 | + ItemLayoutPtr mLayout; | |
| 589 | 579 | ItemView mItemView; |
| 590 | 580 | |
| 591 | 581 | Toolkit::Control mView; |
| ... | ... | @@ -626,7 +616,7 @@ int main(int argc, char **argv) |
| 626 | 616 | } |
| 627 | 617 | } |
| 628 | 618 | |
| 629 | - Application app = Application::New(&argc, &argv); | |
| 619 | + Application app = Application::New(&argc, &argv, DALI_DEMO_THEME_PATH); | |
| 630 | 620 | |
| 631 | 621 | ExampleApp dali_app(app); |
| 632 | 622 | ... | ... |
examples/buttons/buttons-example.cpp
| ... | ... | @@ -96,8 +96,6 @@ class ButtonsController: public ConnectionTracker |
| 96 | 96 | { |
| 97 | 97 | // The Init signal is received once (only) during the Application lifetime |
| 98 | 98 | |
| 99 | - DemoHelper::RequestThemeChange(); | |
| 100 | - | |
| 101 | 99 | // Respond to key events |
| 102 | 100 | Stage::GetCurrent().KeyEventSignal().Connect(this, &ButtonsController::OnKeyEvent); |
| 103 | 101 | |
| ... | ... | @@ -527,7 +525,7 @@ void RunTest( Application& application ) |
| 527 | 525 | // |
| 528 | 526 | int main( int argc, char **argv ) |
| 529 | 527 | { |
| 530 | - Application application = Application::New( &argc, &argv ); | |
| 528 | + Application application = Application::New( &argc, &argv, DALI_DEMO_THEME_PATH ); | |
| 531 | 529 | |
| 532 | 530 | RunTest( application ); |
| 533 | 531 | ... | ... |
examples/cluster/cluster-example.cpp
| ... | ... | @@ -21,6 +21,9 @@ |
| 21 | 21 | #include "shared/view.h" |
| 22 | 22 | #include <dali/dali.h> |
| 23 | 23 | #include <dali-toolkit/dali-toolkit.h> |
| 24 | +#include <dali-toolkit/devel-api/shader-effects/motion-blur-effect.h> | |
| 25 | +#include <dali-toolkit/devel-api/controls/popup/popup.h> | |
| 26 | +#include <dali-toolkit/devel-api/shader-effects/carousel-effect.h> | |
| 24 | 27 | |
| 25 | 28 | #include "cluster.h" |
| 26 | 29 | #include "cluster-style.h" |
| ... | ... | @@ -38,7 +41,7 @@ const char * const BACKGROUND_IMAGE( DALI_IMAGE_DIR "background-default.png" ); |
| 38 | 41 | const char * const TOOLBAR_IMAGE( DALI_IMAGE_DIR "top-bar.png" ); |
| 39 | 42 | const char * const APPLICATION_TITLE( "Clusters" ); |
| 40 | 43 | const char * const LAYOUT_NONE_IMAGE( DALI_IMAGE_DIR "icon-cluster-none.png" ); |
| 41 | -const char * const LAYOUT_WOBBLE_IMAGE( DALI_IMAGE_DIR "icon-cluster-wobble.png" ); | |
| 44 | +const char * const LAYOUT_MOTION_BLUR_IMAGE( DALI_IMAGE_DIR "icon-cluster-wobble.png" ); | |
| 42 | 45 | const char * const LAYOUT_CAROUSEL_IMAGE( DALI_IMAGE_DIR "icon-cluster-carousel.png" ); |
| 43 | 46 | const char * const LAYOUT_SPHERE_IMAGE( DALI_IMAGE_DIR "icon-cluster-sphere.png" ); |
| 44 | 47 | |
| ... | ... | @@ -134,9 +137,6 @@ const float CLUSTER_GROUP_DELAY_BOTTOM = 0.0f; ///< Delay for botto |
| 134 | 137 | const float CLUSTER_COLUMN_INDENT = 0.1f; ///< Left Indentation in screen coordinates. |
| 135 | 138 | const float CLUSTER_ROW_INDENT = 0.13f; ///< Top Indentation in screen coordinates. |
| 136 | 139 | |
| 137 | -const Vector3 SHEAR_EFFECT_ANCHOR_POINT(0.5f, 1.0f, 0.5f); ///< Anchor Point used for the shear effect (extends outside of Cluster) | |
| 138 | -const float SHEAR_EFFECT_MAX_OVERSHOOT = 30.0f; ///< Max Overshoot for shear effect (in degrees). | |
| 139 | - | |
| 140 | 140 | const float UI_MARGIN = 10.0f; ///< Screen Margin for placement of UI buttons |
| 141 | 141 | |
| 142 | 142 | const float CAROUSEL_EFFECT_RADIUS = 500.0f; ///< In Carousel Effect mode: Radius of carousel (Z peak depth) |
| ... | ... | @@ -152,7 +152,7 @@ const float SPHERE_EFFECT_VERTICAL_DOMAIN = 0.15f; ///< In Sphere Effec |
| 152 | 152 | enum ExampleEffectType |
| 153 | 153 | { |
| 154 | 154 | NO_EFFECT, |
| 155 | - WOBBLE_EFFECT, | |
| 155 | + MOTION_BLUR_EFFECT, | |
| 156 | 156 | CAROUSEL_EFFECT, |
| 157 | 157 | SPHERE_EFFECT, |
| 158 | 158 | TOTAL_EFFECTS |
| ... | ... | @@ -161,10 +161,10 @@ enum ExampleEffectType |
| 161 | 161 | /** |
| 162 | 162 | * List of effect type names that appear on the Effect button. |
| 163 | 163 | */ |
| 164 | -const char* EXAMPLE_EFFECT_LABEL[] = { "NONE", | |
| 165 | - "WOBBLE", | |
| 166 | - "CAROUSEL", | |
| 167 | - "SPHERE", | |
| 164 | +const char* EXAMPLE_EFFECT_LABEL[] = { "None", | |
| 165 | + "Motion Blur", | |
| 166 | + "Carousel", | |
| 167 | + "Sphere", | |
| 168 | 168 | }; |
| 169 | 169 | |
| 170 | 170 | /** |
| ... | ... | @@ -205,96 +205,6 @@ struct CarouselEffectOrientationConstraint |
| 205 | 205 | }; |
| 206 | 206 | |
| 207 | 207 | /** |
| 208 | - * ShearEffectConstraint | |
| 209 | - * | |
| 210 | - * Constrains ShearEffect's tilt to be a function of scrollview's | |
| 211 | - * horizontal overshoot amount. | |
| 212 | - */ | |
| 213 | -struct ShearEffectConstraint | |
| 214 | -{ | |
| 215 | - /** | |
| 216 | - * @param[in] stageSize The stage size (not subject to orientation) | |
| 217 | - * @param[in] maxOvershoot Maximum amount overshoot can affect shear. | |
| 218 | - * @param[in] componentMask Whether constraint should take the X shear | |
| 219 | - * or the Y shear component. | |
| 220 | - */ | |
| 221 | - ShearEffectConstraint(Vector2 stageSize, float maxOvershoot, Vector2 componentMask) | |
| 222 | - : mStageSize(stageSize), | |
| 223 | - mMaxOvershoot(maxOvershoot), | |
| 224 | - mComponentMask(componentMask) | |
| 225 | - { | |
| 226 | - } | |
| 227 | - | |
| 228 | - /** | |
| 229 | - * @param[in,out] current The current shear effect Angle. | |
| 230 | - * @param[in] inputs Contains the overshoot property from ScrollView and the orientation of the view e.g. Portrait, Landscape. | |
| 231 | - * @return angle to provide ShearShaderEffect | |
| 232 | - */ | |
| 233 | - void operator()( float& current, const PropertyInputContainer& inputs ) | |
| 234 | - { | |
| 235 | - float f = inputs[0]->GetVector3().x; | |
| 236 | - | |
| 237 | - float mag = fabsf(f); | |
| 238 | - float halfWidth = mStageSize.x * 0.5f; | |
| 239 | - | |
| 240 | - // inverse exponential tail-off | |
| 241 | - float overshoot = 1.0f - halfWidth / (halfWidth + mag); | |
| 242 | - if (f > 0.0f) | |
| 243 | - { | |
| 244 | - overshoot = -overshoot; | |
| 245 | - } | |
| 246 | - | |
| 247 | - // Channel this shear value into either the X or Y axis depending on | |
| 248 | - // the component mask passed in. | |
| 249 | - Vector3 axis; | |
| 250 | - Radian angle; | |
| 251 | - inputs[1]->GetQuaternion().ToAxisAngle( axis, angle ); | |
| 252 | - Vector2 direction( cosf(angle), sinf(angle) ); | |
| 253 | - float yield = direction.x * mComponentMask.x + direction.y * mComponentMask.y; | |
| 254 | - | |
| 255 | - current = overshoot * mMaxOvershoot * yield; | |
| 256 | - } | |
| 257 | - | |
| 258 | - Vector2 mStageSize; | |
| 259 | - float mMaxOvershoot; | |
| 260 | - Vector2 mComponentMask; | |
| 261 | -}; | |
| 262 | - | |
| 263 | -/** | |
| 264 | - * ShearEffectCenterConstraint | |
| 265 | - * | |
| 266 | - * Sets ShearEffect's center to be a function of the | |
| 267 | - * screen orientation (portrait or landscape). | |
| 268 | - */ | |
| 269 | -struct ShearEffectCenterConstraint | |
| 270 | -{ | |
| 271 | - /** | |
| 272 | - * @param[in] stageSize The stage size (not subject to orientation) | |
| 273 | - * @param[in] center Shear Center position based on initial orientation. | |
| 274 | - */ | |
| 275 | - ShearEffectCenterConstraint(Vector2 stageSize, Vector2 center) | |
| 276 | - : mStageSize(stageSize), | |
| 277 | - mCenter(center) | |
| 278 | - { | |
| 279 | - } | |
| 280 | - | |
| 281 | - /** | |
| 282 | - * @param[in,out] current The current center | |
| 283 | - * @param[in] inputs Contains the current view size | |
| 284 | - * @return vector to provide ShearShaderEffect | |
| 285 | - */ | |
| 286 | - void operator()( Vector2& current, const PropertyInputContainer& inputs ) | |
| 287 | - { | |
| 288 | - float f = inputs[0]->GetVector3().width / mStageSize.width; | |
| 289 | - current.x = f * mCenter.x; | |
| 290 | - current.y = mCenter.y; | |
| 291 | - } | |
| 292 | - | |
| 293 | - Vector2 mStageSize; | |
| 294 | - Vector2 mCenter; | |
| 295 | -}; | |
| 296 | - | |
| 297 | -/** | |
| 298 | 208 | * SphereEffectOffsetConstraint |
| 299 | 209 | * |
| 300 | 210 | * Sets SphereEffect's center to be a function of the |
| ... | ... | @@ -450,8 +360,6 @@ public: |
| 450 | 360 | */ |
| 451 | 361 | void Create(Application& application) |
| 452 | 362 | { |
| 453 | - DemoHelper::RequestThemeChange(); | |
| 454 | - | |
| 455 | 363 | Stage::GetCurrent().KeyEventSignal().Connect(this, &ClusterController::OnKeyEvent); |
| 456 | 364 | |
| 457 | 365 | // The Init signal is received once (only) during the Application lifetime |
| ... | ... | @@ -470,7 +378,7 @@ public: |
| 470 | 378 | |
| 471 | 379 | // Create a effect toggle button. (right of toolbar) |
| 472 | 380 | mLayoutButtonImages[ NO_EFFECT ] = ResourceImage::New( LAYOUT_NONE_IMAGE ); |
| 473 | - mLayoutButtonImages[ WOBBLE_EFFECT ] = ResourceImage::New( LAYOUT_WOBBLE_IMAGE ); | |
| 381 | + mLayoutButtonImages[ MOTION_BLUR_EFFECT ] = ResourceImage::New( LAYOUT_MOTION_BLUR_IMAGE ); | |
| 474 | 382 | mLayoutButtonImages[ CAROUSEL_EFFECT ] = ResourceImage::New( LAYOUT_CAROUSEL_IMAGE ); |
| 475 | 383 | mLayoutButtonImages[ SPHERE_EFFECT ] = ResourceImage::New( LAYOUT_SPHERE_IMAGE ); |
| 476 | 384 | |
| ... | ... | @@ -482,10 +390,6 @@ public: |
| 482 | 390 | mScrollView = ScrollView::New(); |
| 483 | 391 | mScrollView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); |
| 484 | 392 | |
| 485 | - // attach Wobble Effect to ScrollView | |
| 486 | - mScrollViewEffect = ScrollViewWobbleEffect::New(); | |
| 487 | - mScrollView.ApplyEffect(mScrollViewEffect); | |
| 488 | - | |
| 489 | 393 | // anchor the scroll view from its center point to the middle of its parent |
| 490 | 394 | mScrollView.SetAnchorPoint(AnchorPoint::CENTER); |
| 491 | 395 | mScrollView.SetParentOrigin(ParentOrigin::CENTER); |
| ... | ... | @@ -506,7 +410,7 @@ public: |
| 506 | 410 | AddCluster( MUSIC, ClusterStyleStandard::New(ClusterStyleStandard::ClusterStyle2) ); |
| 507 | 411 | AddCluster( MAGAZINE, ClusterStyleStandard::New(ClusterStyleStandard::ClusterStyle3) ); |
| 508 | 412 | |
| 509 | - SetEffect(WOBBLE_EFFECT); | |
| 413 | + SetEffect(MOTION_BLUR_EFFECT); | |
| 510 | 414 | } |
| 511 | 415 | |
| 512 | 416 | /** |
| ... | ... | @@ -627,7 +531,7 @@ public: |
| 627 | 531 | pageView.SetPosition(Vector3(stageSize.width * column, 0.0f, 0.0f)); |
| 628 | 532 | pageView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); |
| 629 | 533 | |
| 630 | - // Create cluster actors, add them to scroll view, and set the shear effect with the given center point. | |
| 534 | + // Create cluster actors and add them to scroll view | |
| 631 | 535 | Vector3 clusterSize; |
| 632 | 536 | Cluster cluster = CreateClusterActor( clusterType, style, clusterSize ); |
| 633 | 537 | cluster.SetParentOrigin(ParentOrigin::TOP_LEFT); |
| ... | ... | @@ -642,6 +546,39 @@ public: |
| 642 | 546 | } |
| 643 | 547 | |
| 644 | 548 | /** |
| 549 | + * Sets motion blur effect to a cluster and all its children | |
| 550 | + * | |
| 551 | + * @param[in] actor Cluster control to which the effect will be applied | |
| 552 | + */ | |
| 553 | + void SetMotionBlurEffect( Actor actor ) | |
| 554 | + { | |
| 555 | + // only do something if the actor and effect are valid | |
| 556 | + if( actor ) | |
| 557 | + { | |
| 558 | + // first remove from this actor | |
| 559 | + RenderableActor renderable = RenderableActor::DownCast( actor ); | |
| 560 | + if( renderable ) | |
| 561 | + { | |
| 562 | + MotionBlurEffect shaderEffect = MotionBlurEffect::New(); | |
| 563 | + shaderEffect.SetSpeedScalingFactor(0.1f); | |
| 564 | + | |
| 565 | + Dali::Property::Index uModelProperty = shaderEffect.GetPropertyIndex( "uModelLastFrame" ); | |
| 566 | + Constraint constraint = Constraint::New<Matrix>( shaderEffect, uModelProperty, EqualToConstraint() ); | |
| 567 | + constraint.AddSource( Source( actor , Actor::Property::WORLD_MATRIX ) ); | |
| 568 | + constraint.Apply(); | |
| 569 | + renderable.SetShaderEffect( shaderEffect ); | |
| 570 | + } | |
| 571 | + // then all children recursively | |
| 572 | + const unsigned int count = actor.GetChildCount(); | |
| 573 | + for( unsigned int index = 0; index < count; ++index ) | |
| 574 | + { | |
| 575 | + Actor child( actor.GetChildAt( index ) ); | |
| 576 | + SetMotionBlurEffect( child ); | |
| 577 | + } | |
| 578 | + } | |
| 579 | + } | |
| 580 | + | |
| 581 | + /** | |
| 645 | 582 | * Resets ScrollView and Clusters settings |
| 646 | 583 | * to reflect the new ExampleEffectType |
| 647 | 584 | * |
| ... | ... | @@ -691,8 +628,8 @@ public: |
| 691 | 628 | |
| 692 | 629 | // Apply new shader-effects. |
| 693 | 630 | // Move Y to origin incase we came from an effect where user could free pan in y axis. |
| 694 | - const Vector3 currentScrollPosition(mScrollView.GetCurrentScrollPosition()); | |
| 695 | - mScrollView.ScrollTo(Vector3(currentScrollPosition.x, 0.0f, 0.0f)); | |
| 631 | + const Vector2 currentScrollPosition(mScrollView.GetCurrentScrollPosition()); | |
| 632 | + mScrollView.ScrollTo(Vector2(currentScrollPosition.x, 0.0f)); | |
| 696 | 633 | |
| 697 | 634 | switch(type) |
| 698 | 635 | { |
| ... | ... | @@ -701,42 +638,11 @@ public: |
| 701 | 638 | break; |
| 702 | 639 | } |
| 703 | 640 | |
| 704 | - case WOBBLE_EFFECT: | |
| 641 | + case MOTION_BLUR_EFFECT: | |
| 705 | 642 | { |
| 706 | 643 | for( std::vector<ClusterInfo>::iterator i = mClusterInfo.begin(); i != mClusterInfo.end(); ++i ) |
| 707 | 644 | { |
| 708 | - Cluster cluster = i->mCluster; | |
| 709 | - Vector3 position = i->mPosition; | |
| 710 | - Vector3 size = i->mSize; | |
| 711 | - | |
| 712 | - ShearEffect shaderEffect = ShearEffect::New(); | |
| 713 | - Vector3 shearAnchor = SHEAR_EFFECT_ANCHOR_POINT; | |
| 714 | - | |
| 715 | - Vector2 shearCenter( Vector2(position.x + size.width * shearAnchor.x, position.y + size.height * shearAnchor.y) ); | |
| 716 | - Property::Index centerProperty = shaderEffect.GetPropertyIndex(shaderEffect.GetCenterPropertyName()); | |
| 717 | - Constraint constraint = Constraint::New<Vector2>( shaderEffect, centerProperty, ShearEffectCenterConstraint(stageSize, shearCenter) ); | |
| 718 | - constraint.AddSource( Source(mView, Actor::Property::SIZE) ); | |
| 719 | - | |
| 720 | - constraint.Apply(); | |
| 721 | - | |
| 722 | - SetShaderEffectRecursively( cluster,shaderEffect ); | |
| 723 | - | |
| 724 | - // Apply Constraint to Shader Effect | |
| 725 | - Property::Index scrollOvershootProperty = /*targetGroup*/mScrollView.GetPropertyIndex(ScrollViewWobbleEffect::EFFECT_OVERSHOOT); | |
| 726 | - Property::Index angleXAxisProperty = shaderEffect.GetPropertyIndex(shaderEffect.GetAngleXAxisPropertyName()); | |
| 727 | - Property::Index angleYAxisProperty = shaderEffect.GetPropertyIndex(shaderEffect.GetAngleYAxisPropertyName()); | |
| 728 | - | |
| 729 | - constraint = Constraint::New<float>( shaderEffect, angleXAxisProperty, ShearEffectConstraint(stageSize, SHEAR_EFFECT_MAX_OVERSHOOT, Vector2::XAXIS) ); | |
| 730 | - constraint.AddSource( Source(mScrollView, scrollOvershootProperty) ); | |
| 731 | - constraint.AddSource( Source(mView, Actor::Property::ORIENTATION) ); | |
| 732 | - constraint.Apply(); | |
| 733 | - | |
| 734 | - constraint = Constraint::New<float>( shaderEffect, angleYAxisProperty, ShearEffectConstraint(stageSize, SHEAR_EFFECT_MAX_OVERSHOOT, Vector2::YAXIS ) ); | |
| 735 | - constraint.AddSource( Source(mScrollView, scrollOvershootProperty) ); | |
| 736 | - constraint.AddSource( Source(mView, Actor::Property::ORIENTATION) ); | |
| 737 | - constraint.Apply(); | |
| 738 | - | |
| 739 | - | |
| 645 | + SetMotionBlurEffect( i->mCluster ); | |
| 740 | 646 | } |
| 741 | 647 | break; |
| 742 | 648 | } |
| ... | ... | @@ -852,7 +758,6 @@ private: |
| 852 | 758 | Layer mContentLayer; ///< Content layer (scrolling cluster content) |
| 853 | 759 | |
| 854 | 760 | ScrollView mScrollView; ///< The ScrollView container for all clusters |
| 855 | - ScrollViewWobbleEffect mScrollViewEffect; ///< ScrollView Wobble effect | |
| 856 | 761 | Image mClusterBorderImage; ///< The border frame that appears on each image |
| 857 | 762 | |
| 858 | 763 | std::vector<ClusterInfo> mClusterInfo; ///< Keeps track of each cluster's information. |
| ... | ... | @@ -874,7 +779,7 @@ void RunTest(Application& app) |
| 874 | 779 | // |
| 875 | 780 | int main(int argc, char **argv) |
| 876 | 781 | { |
| 877 | - Application app = Application::New(&argc, &argv); | |
| 782 | + Application app = Application::New(&argc, &argv, DALI_DEMO_THEME_PATH); | |
| 878 | 783 | |
| 879 | 784 | RunTest(app); |
| 880 | 785 | ... | ... |
examples/cluster/cluster-impl.cpp
| ... | ... | @@ -23,7 +23,7 @@ |
| 23 | 23 | #include <cstring> // for strcmp |
| 24 | 24 | #include <dali/public-api/animation/animation.h> |
| 25 | 25 | #include <dali/public-api/object/type-registry.h> |
| 26 | -#include <dali/public-api/object/type-registry-helper.h> | |
| 26 | +#include <dali/devel-api/object/type-registry-helper.h> | |
| 27 | 27 | #include <dali/integration-api/debug.h> |
| 28 | 28 | |
| 29 | 29 | // INTERNAL INCLUDES |
| ... | ... | @@ -92,7 +92,7 @@ void Cluster::OnInitialize() |
| 92 | 92 | { |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | -void Cluster::OnControlSizeSet( const Vector3& targetSize ) | |
| 95 | +void Cluster::OnSizeSet( const Vector3& targetSize ) | |
| 96 | 96 | { |
| 97 | 97 | mClusterSize = targetSize; |
| 98 | 98 | GetImpl(mClusterStyle).SetClusterSize(targetSize); | ... | ... |
examples/cluster/cluster-impl.h
| ... | ... | @@ -253,15 +253,15 @@ public: |
| 253 | 253 | private: // From Control |
| 254 | 254 | |
| 255 | 255 | /** |
| 256 | - * @copydoc Demo::Control::OnInitialize() | |
| 256 | + * @copydoc Control::OnInitialize() | |
| 257 | 257 | */ |
| 258 | 258 | virtual void OnInitialize(); |
| 259 | 259 | |
| 260 | 260 | /** |
| 261 | 261 | * |
| 262 | - * @copydoc Demo::Control::OnControlSizeSet( const Vector3& targetSize ) | |
| 262 | + * @copydoc CustomActorImpl::OnSizeSet( const Vector3& targetSize ) | |
| 263 | 263 | */ |
| 264 | - virtual void OnControlSizeSet( const Vector3& targetSize ); | |
| 264 | + virtual void OnSizeSet( const Vector3& targetSize ); | |
| 265 | 265 | |
| 266 | 266 | protected: |
| 267 | 267 | ... | ... |
examples/cube-transition-effect/cube-transition-effect-example.cpp
| ... | ... | @@ -23,6 +23,11 @@ |
| 23 | 23 | |
| 24 | 24 | #include <dali/dali.h> |
| 25 | 25 | #include <dali-toolkit/dali-toolkit.h> |
| 26 | +#include <dali-toolkit/devel-api/transition-effects/cube-transition-effect.h> | |
| 27 | +#include <dali-toolkit/devel-api/transition-effects/cube-transition-cross-effect.h> | |
| 28 | +#include <dali-toolkit/devel-api/transition-effects/cube-transition-fold-effect.h> | |
| 29 | +#include <dali-toolkit/devel-api/transition-effects/cube-transition-wave-effect.h> | |
| 30 | + | |
| 26 | 31 | |
| 27 | 32 | using namespace Dali; |
| 28 | 33 | |
| ... | ... | @@ -219,8 +224,6 @@ CubeTransitionApp::~CubeTransitionApp() |
| 219 | 224 | |
| 220 | 225 | void CubeTransitionApp::OnInit( Application& application ) |
| 221 | 226 | { |
| 222 | - DemoHelper::RequestThemeChange(); | |
| 223 | - | |
| 224 | 227 | Stage::GetCurrent().KeyEventSignal().Connect(this, &CubeTransitionApp::OnKeyEvent); |
| 225 | 228 | |
| 226 | 229 | // Creates a default view with a default tool bar, the view is added to the stage. |
| ... | ... | @@ -430,7 +433,7 @@ void CubeTransitionApp::OnKeyEvent(const KeyEvent& event) |
| 430 | 433 | // Entry point for Linux & Tizen applications |
| 431 | 434 | int main( int argc, char **argv ) |
| 432 | 435 | { |
| 433 | - Application application = Application::New( &argc, &argv ); | |
| 436 | + Application application = Application::New( &argc, &argv, DALI_DEMO_THEME_PATH ); | |
| 434 | 437 | CubeTransitionApp test( application ); |
| 435 | 438 | application.MainLoop(); |
| 436 | 439 | ... | ... |
examples/dissolve-effect/dissolve-effect-example.cpp
| ... | ... | @@ -23,6 +23,7 @@ |
| 23 | 23 | |
| 24 | 24 | #include <dali/dali.h> |
| 25 | 25 | #include <dali-toolkit/dali-toolkit.h> |
| 26 | +#include <dali-toolkit/devel-api/shader-effects/dissolve-effect.h> | |
| 26 | 27 | |
| 27 | 28 | using namespace Dali; |
| 28 | 29 | |
| ... | ... | @@ -203,8 +204,6 @@ DissolveEffectApp::~DissolveEffectApp() |
| 203 | 204 | |
| 204 | 205 | void DissolveEffectApp::OnInit( Application& application ) |
| 205 | 206 | { |
| 206 | - DemoHelper::RequestThemeChange(); | |
| 207 | - | |
| 208 | 207 | Stage::GetCurrent().KeyEventSignal().Connect(this, &DissolveEffectApp::OnKeyEvent); |
| 209 | 208 | |
| 210 | 209 | // Creates a default view with a default tool bar, the view is added to the stage. |
| ... | ... | @@ -429,7 +428,7 @@ bool DissolveEffectApp::OnTimerTick() |
| 429 | 428 | // Entry point for Linux & Tizen applications |
| 430 | 429 | int main( int argc, char **argv ) |
| 431 | 430 | { |
| 432 | - Application application = Application::New( &argc, &argv ); | |
| 431 | + Application application = Application::New( &argc, &argv, DALI_DEMO_THEME_PATH ); | |
| 433 | 432 | DissolveEffectApp test( application ); |
| 434 | 433 | application.MainLoop(); |
| 435 | 434 | ... | ... |
examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp
| ... | ... | @@ -17,6 +17,7 @@ |
| 17 | 17 | |
| 18 | 18 | #include <dali/dali.h> |
| 19 | 19 | #include <dali-toolkit/dali-toolkit.h> |
| 20 | +#include <dali-toolkit/devel-api/controls/popup/popup.h> | |
| 20 | 21 | #include "shared/view.h" |
| 21 | 22 | #include <iostream> |
| 22 | 23 | |
| ... | ... | @@ -169,9 +170,6 @@ public: |
| 169 | 170 | // The Init signal is received once (only) during the Application lifetime |
| 170 | 171 | void Create( Application& application ) |
| 171 | 172 | { |
| 172 | - // Apply the default theme: | |
| 173 | - DemoHelper::RequestThemeChange(); | |
| 174 | - | |
| 175 | 173 | // Get a handle to the stage |
| 176 | 174 | Stage stage = Stage::GetCurrent(); |
| 177 | 175 | |
| ... | ... | @@ -730,7 +728,7 @@ void RunTest( Application& application ) |
| 730 | 728 | // Entry point for Linux & Tizen applications |
| 731 | 729 | int main( int argc, char **argv ) |
| 732 | 730 | { |
| 733 | - Application application = Application::New( &argc, &argv ); | |
| 731 | + Application application = Application::New( &argc, &argv, DALI_DEMO_THEME_PATH ); | |
| 734 | 732 | |
| 735 | 733 | RunTest( application ); |
| 736 | 734 | ... | ... |
examples/image-scaling-irregular-grid/grid-flags.h
examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp
| ... | ... | @@ -287,8 +287,6 @@ public: |
| 287 | 287 | { |
| 288 | 288 | std::cout << "ImageScalingIrregularGridController::Create" << std::endl; |
| 289 | 289 | |
| 290 | - DemoHelper::RequestThemeChange(); | |
| 291 | - | |
| 292 | 290 | // Get a handle to the stage: |
| 293 | 291 | Stage stage = Stage::GetCurrent(); |
| 294 | 292 | |
| ... | ... | @@ -335,13 +333,11 @@ public: |
| 335 | 333 | mScrollView.ScrollStartedSignal().Connect( this, &ImageScalingIrregularGridController::OnScrollStarted ); |
| 336 | 334 | mScrollView.ScrollCompletedSignal().Connect( this, &ImageScalingIrregularGridController::OnScrollCompleted ); |
| 337 | 335 | |
| 338 | - mScrollView.EnableScrollComponent( Scrollable::VerticalScrollBar ); | |
| 339 | - mScrollView.EnableScrollComponent( Scrollable::HorizontalScrollBar ); | |
| 340 | - | |
| 341 | 336 | mScrollView.SetAnchorPoint(AnchorPoint::CENTER); |
| 342 | 337 | mScrollView.SetParentOrigin(ParentOrigin::CENTER); |
| 343 | 338 | |
| 344 | - mScrollView.SetSize( stageSize );//Vector2( stageSize.width, fieldHeight ) );//stageSize ); | |
| 339 | + mScrollView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); | |
| 340 | + | |
| 345 | 341 | mScrollView.SetAxisAutoLock( true ); |
| 346 | 342 | mScrollView.SetAxisAutoLockGradient( 1.0f ); |
| 347 | 343 | |
| ... | ... | @@ -351,7 +347,7 @@ public: |
| 351 | 347 | rulerX->SetDomain( RulerDomain( stageSize.width * -0.125f, stageSize.width * 1.125f ) ); //< Scroll slightly left/right of image field. |
| 352 | 348 | mScrollView.SetRulerX ( rulerX ); |
| 353 | 349 | |
| 354 | - RulerPtr rulerY = new DefaultRuler(); //stageSize.height ); //< Snap in multiples of a screen / stage height | |
| 350 | + RulerPtr rulerY = new DefaultRuler(); //< Snap in multiples of a screen / stage height | |
| 355 | 351 | rulerY->SetDomain( RulerDomain( - fieldHeight * 0.5f + stageSize.height * 0.5f - GRID_CELL_PADDING, fieldHeight * 0.5f + stageSize.height * 0.5f + GRID_CELL_PADDING ) ); |
| 356 | 352 | mScrollView.SetRulerY ( rulerY ); |
| 357 | 353 | |
| ... | ... | @@ -359,8 +355,31 @@ public: |
| 359 | 355 | mScrollView.Add( imageField ); |
| 360 | 356 | mGridActor = imageField; |
| 361 | 357 | |
| 358 | + // Create the scroll bar | |
| 359 | + mScrollBarVertical = ScrollBar::New(Toolkit::ScrollBar::Vertical); | |
| 360 | + mScrollBarVertical.SetParentOrigin(ParentOrigin::TOP_RIGHT); | |
| 361 | + mScrollBarVertical.SetAnchorPoint(AnchorPoint::TOP_RIGHT); | |
| 362 | + mScrollBarVertical.SetResizePolicy(Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::HEIGHT); | |
| 363 | + mScrollBarVertical.SetResizePolicy(Dali::ResizePolicy::FIT_TO_CHILDREN, Dali::Dimension::WIDTH); | |
| 364 | + mScrollView.Add(mScrollBarVertical); | |
| 365 | + | |
| 366 | + mScrollBarHorizontal = ScrollBar::New(Toolkit::ScrollBar::Horizontal); | |
| 367 | + mScrollBarHorizontal.SetParentOrigin(ParentOrigin::BOTTOM_LEFT); | |
| 368 | + mScrollBarHorizontal.SetAnchorPoint(AnchorPoint::TOP_LEFT); | |
| 369 | + mScrollBarHorizontal.SetResizePolicy(Dali::ResizePolicy::FIT_TO_CHILDREN, Dali::Dimension::WIDTH); | |
| 370 | + mScrollBarHorizontal.SetOrientation(Quaternion(Radian( 1.5f * Math::PI ), Vector3::ZAXIS)); | |
| 371 | + mScrollView.Add(mScrollBarHorizontal); | |
| 372 | + | |
| 373 | + mScrollView.OnRelayoutSignal().Connect( this, &ImageScalingIrregularGridController::OnScrollViewRelayout ); | |
| 374 | + | |
| 362 | 375 | // Scroll to top of grid so first images loaded are on-screen: |
| 363 | - mScrollView.ScrollTo( Vector3( 0, -1000000, 0 ) ); | |
| 376 | + mScrollView.ScrollTo( Vector2( 0, -1000000 ) ); | |
| 377 | + } | |
| 378 | + | |
| 379 | + void OnScrollViewRelayout(Actor actor) | |
| 380 | + { | |
| 381 | + // Make the height of the horizontal scroll bar to be the same as the width of scroll view. | |
| 382 | + mScrollBarHorizontal.SetSize(Vector2(0.0f, mScrollView.GetRelayoutSize( Dimension::WIDTH) )); | |
| 364 | 383 | } |
| 365 | 384 | |
| 366 | 385 | /** |
| ... | ... | @@ -549,7 +568,7 @@ public: |
| 549 | 568 | * note this state (mScrolling = true) |
| 550 | 569 | * @param[in] position Current Scroll Position |
| 551 | 570 | */ |
| 552 | - void OnScrollStarted( const Vector3& position ) | |
| 571 | + void OnScrollStarted( const Vector2& position ) | |
| 553 | 572 | { |
| 554 | 573 | mScrolling = true; |
| 555 | 574 | } |
| ... | ... | @@ -559,7 +578,7 @@ public: |
| 559 | 578 | * note this state (mScrolling = false). |
| 560 | 579 | * @param[in] position Current Scroll Position |
| 561 | 580 | */ |
| 562 | - void OnScrollCompleted( const Vector3& position ) | |
| 581 | + void OnScrollCompleted( const Vector2& position ) | |
| 563 | 582 | { |
| 564 | 583 | mScrolling = false; |
| 565 | 584 | } |
| ... | ... | @@ -573,6 +592,8 @@ private: |
| 573 | 592 | TextLabel mTitleActor; ///< The Toolbar's Title. |
| 574 | 593 | Actor mGridActor; ///< The container for the grid of images |
| 575 | 594 | ScrollView mScrollView; ///< ScrollView UI Component |
| 595 | + ScrollBar mScrollBarVertical; | |
| 596 | + ScrollBar mScrollBarHorizontal; | |
| 576 | 597 | bool mScrolling; ///< ScrollView scrolling state (true = scrolling, false = stationary) |
| 577 | 598 | std::map<unsigned, Dali::FittingMode::Type> mFittingModes; ///< Stores the current scaling mode of each image, keyed by image actor id. |
| 578 | 599 | std::map<unsigned, Vector2> mSizes; ///< Stores the current size of each image, keyed by image actor id. |
| ... | ... | @@ -588,7 +609,7 @@ void RunTest( Application& application ) |
| 588 | 609 | /** Entry point for Linux & Tizen applications */ |
| 589 | 610 | int main( int argc, char **argv ) |
| 590 | 611 | { |
| 591 | - Application application = Application::New( &argc, &argv ); | |
| 612 | + Application application = Application::New( &argc, &argv, DALI_DEMO_THEME_PATH ); | |
| 592 | 613 | |
| 593 | 614 | RunTest( application ); |
| 594 | 615 | ... | ... |
examples/item-view/item-view-example.cpp
| ... | ... | @@ -25,6 +25,7 @@ |
| 25 | 25 | |
| 26 | 26 | #include <dali/dali.h> |
| 27 | 27 | #include <dali-toolkit/dali-toolkit.h> |
| 28 | +#include <dali/devel-api/images/atlas.h> | |
| 28 | 29 | |
| 29 | 30 | using namespace Dali; |
| 30 | 31 | using namespace Dali::Toolkit; |
| ... | ... | @@ -103,16 +104,6 @@ const unsigned int IMAGE_WIDTH = 256; |
| 103 | 104 | const unsigned int IMAGE_HEIGHT = 256; |
| 104 | 105 | const unsigned int NUM_IMAGE_PER_ROW_IN_ATLAS = 8; |
| 105 | 106 | |
| 106 | -AlphaFunction ALPHA_FUNCTIONS[] = { AlphaFunction(AlphaFunction::LINEAR), | |
| 107 | - AlphaFunction(AlphaFunction::EASE_IN), | |
| 108 | - AlphaFunction(AlphaFunction::EASE_OUT) }; | |
| 109 | - | |
| 110 | -const unsigned int NUM_ALPHA_FUNCTIONS = sizeof(ALPHA_FUNCTIONS) / sizeof(AlphaFunction); | |
| 111 | - | |
| 112 | -const char* ALPHA_FUNCTIONS_TEXT[] = { "Linear", | |
| 113 | - "EaseIn", | |
| 114 | - "EaseOut" }; | |
| 115 | - | |
| 116 | 107 | const char* BACKGROUND_IMAGE( "" ); |
| 117 | 108 | const char* TOOLBAR_IMAGE( DALI_IMAGE_DIR "top-bar.png" ); |
| 118 | 109 | const char* EDIT_IMAGE( DALI_IMAGE_DIR "icon-edit.png" ); |
| ... | ... | @@ -138,20 +129,10 @@ const float ITEM_IMAGE_BORDER_RIGHT = 13.0f; |
| 138 | 129 | const float ITEM_IMAGE_BORDER_TOP = 13.0f; |
| 139 | 130 | const float ITEM_IMAGE_BORDER_BOTTOM = 13.0f; |
| 140 | 131 | |
| 141 | -const unsigned int DEPTH_LAYOUT_ROWS_PORTRAIT = 26; | |
| 142 | -const unsigned int DEPTH_LAYOUT_ROWS_LANDSCAPE = 16; | |
| 143 | -const float DEPTH_LAYOUT_TILT_ANGLE_PORTRAIT = 25.0f; | |
| 144 | -const float DEPTH_LAYOUT_TILT_ANGLE_LANDSCAPE = 21.0f; | |
| 145 | -const float DEPTH_LAYOUT_ROW_SPACING_FACTOR = 0.1f; | |
| 146 | 132 | const float DEPTH_LAYOUT_ITEM_SIZE_FACTOR_PORTRAIT = 1.0f; |
| 147 | 133 | const float DEPTH_LAYOUT_ITEM_SIZE_FACTOR_LANDSCAPE = 0.8f; |
| 148 | -const float DEPTH_LAYOUT_BOTTOM_MARGIN_FACTOR_PORTRAIT = 0.2f; | |
| 149 | -const float DEPTH_LAYOUT_BOTTOM_MARGIN_FACTOR_LANDSCAPE = 0.1f; | |
| 134 | +const float DEPTH_LAYOUT_COLUMNS = 3.0f; | |
| 150 | 135 | |
| 151 | -const float SPIRAL_LAYOUT_REVOLUTION_NUMBER_PORTRAIT = 4.5f; | |
| 152 | -const float SPIRAL_LAYOUT_REVOLUTION_NUMBER_LANDSCAPE = 2.5f; | |
| 153 | - | |
| 154 | -const float DEPTH_LAYOUT_HEIGHT_SCALE = 20.0f; | |
| 155 | 136 | const float MIN_SWIPE_DISTANCE = 15.0f; |
| 156 | 137 | const float MIN_SWIPE_SPEED = 5.0f; |
| 157 | 138 | |
| ... | ... | @@ -162,33 +143,23 @@ const float LABEL_TEXT_SIZE_Y = 20.0f; |
| 162 | 143 | |
| 163 | 144 | const Vector3 INITIAL_OFFSCREEN_POSITION( 1000.0f, 0, -1000.0f ); |
| 164 | 145 | |
| 165 | -static Vector3 DepthLayoutItemSizeFunctionPortrait(unsigned int numberOfColumns, float layoutWidth) | |
| 146 | +static Vector3 DepthLayoutItemSizeFunctionPortrait( float layoutWidth ) | |
| 166 | 147 | { |
| 167 | - float width = (layoutWidth / static_cast<float>(numberOfColumns + 1)) * DEPTH_LAYOUT_ITEM_SIZE_FACTOR_PORTRAIT; | |
| 148 | + float width = ( layoutWidth / ( DEPTH_LAYOUT_COLUMNS + 1.0f ) ) * DEPTH_LAYOUT_ITEM_SIZE_FACTOR_PORTRAIT; | |
| 168 | 149 | |
| 169 | 150 | // 1x1 aspect ratio |
| 170 | 151 | return Vector3(width, width, width); |
| 171 | 152 | } |
| 172 | 153 | |
| 173 | -static Vector3 DepthLayoutItemSizeFunctionLandscape(unsigned int numberOfColumns, float layoutWidth) | |
| 154 | +static Vector3 DepthLayoutItemSizeFunctionLandscape( float layoutWidth ) | |
| 174 | 155 | { |
| 175 | - float width = (layoutWidth / static_cast<float>(numberOfColumns + 1)) * DEPTH_LAYOUT_ITEM_SIZE_FACTOR_LANDSCAPE; | |
| 156 | + float width = ( layoutWidth / ( DEPTH_LAYOUT_COLUMNS + 1.0f ) ) * DEPTH_LAYOUT_ITEM_SIZE_FACTOR_LANDSCAPE; | |
| 176 | 157 | |
| 177 | 158 | // 1x1 aspect ratio |
| 178 | 159 | return Vector3(width, width, width); |
| 179 | 160 | } |
| 180 | 161 | |
| 181 | -static float DepthLayoutBottomMarginFunctionPortrait(float layoutHeight) | |
| 182 | -{ | |
| 183 | - return layoutHeight * DEPTH_LAYOUT_BOTTOM_MARGIN_FACTOR_PORTRAIT; | |
| 184 | -} | |
| 185 | - | |
| 186 | -static float DepthLayoutBottomMarginFunctionLandscape(float layoutHeight) | |
| 187 | -{ | |
| 188 | - return layoutHeight * DEPTH_LAYOUT_BOTTOM_MARGIN_FACTOR_LANDSCAPE; | |
| 189 | -} | |
| 190 | - | |
| 191 | -} | |
| 162 | +} // unnamed namespace | |
| 192 | 163 | |
| 193 | 164 | /** |
| 194 | 165 | * This example shows how to use ItemView UI control. |
| ... | ... | @@ -219,11 +190,9 @@ public: |
| 219 | 190 | ItemViewExample( Application& application ) |
| 220 | 191 | : mApplication( application ), |
| 221 | 192 | mMode( MODE_NORMAL ), |
| 222 | - mMenuShown( false ), | |
| 223 | 193 | mOrientation( 0 ), |
| 224 | 194 | mCurrentLayout( SPIRAL_LAYOUT ), |
| 225 | - mDurationSeconds( 1.0f ), | |
| 226 | - mAlphaFuncIndex( 0u ) | |
| 195 | + mDurationSeconds( 0.25f ) | |
| 227 | 196 | { |
| 228 | 197 | // Connect to the Application's Init signal |
| 229 | 198 | mApplication.InitSignal().Connect(this, &ItemViewExample::OnInit); |
| ... | ... | @@ -234,8 +203,6 @@ public: |
| 234 | 203 | */ |
| 235 | 204 | void OnInit(Application& app) |
| 236 | 205 | { |
| 237 | - DemoHelper::RequestThemeChange(); | |
| 238 | - | |
| 239 | 206 | Stage stage = Dali::Stage::GetCurrent(); |
| 240 | 207 | stage.KeyEventSignal().Connect(this, &ItemViewExample::OnKeyEvent); |
| 241 | 208 | |
| ... | ... | @@ -253,7 +220,7 @@ public: |
| 253 | 220 | TOOLBAR_IMAGE, |
| 254 | 221 | "" ); |
| 255 | 222 | |
| 256 | - app.GetWindow().GetOrientation().ChangedSignal().Connect( this, &ItemViewExample::OnOrientationChanged ); | |
| 223 | + //app.GetWindow().GetOrientation().ChangedSignal().Connect( this, &ItemViewExample::OnOrientationChanged ); | |
| 257 | 224 | |
| 258 | 225 | // Create an edit mode button. (left of toolbar) |
| 259 | 226 | Toolkit::PushButton editButton = Toolkit::PushButton::New(); |
| ... | ... | @@ -321,9 +288,9 @@ public: |
| 321 | 288 | stage.Add( mItemView ); |
| 322 | 289 | |
| 323 | 290 | // Create the layouts |
| 324 | - mSpiralLayout = SpiralLayout::New(); | |
| 325 | - mDepthLayout = DepthLayout::New(); | |
| 326 | - mGridLayout = GridLayout::New(); | |
| 291 | + mSpiralLayout = DefaultItemLayout::New( DefaultItemLayout::SPIRAL ); | |
| 292 | + mDepthLayout = DefaultItemLayout::New( DefaultItemLayout::DEPTH ); | |
| 293 | + mGridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID ); | |
| 327 | 294 | |
| 328 | 295 | // Add the layouts to item view |
| 329 | 296 | mItemView.AddLayout(*mSpiralLayout); |
| ... | ... | @@ -334,7 +301,7 @@ public: |
| 334 | 301 | mItemView.SetMinimumSwipeSpeed(MIN_SWIPE_SPEED); |
| 335 | 302 | |
| 336 | 303 | // Activate the spiral layout |
| 337 | - UseLayout(mCurrentLayout, 0.0f); | |
| 304 | + SetLayout( mCurrentLayout ); | |
| 338 | 305 | mItemView.SetKeyboardFocusable( true ); |
| 339 | 306 | KeyboardFocusManager::Get().PreFocusChangeSignal().Connect( this, &ItemViewExample::OnKeyboardPreFocusChange ); |
| 340 | 307 | |
| ... | ... | @@ -357,49 +324,45 @@ public: |
| 357 | 324 | } |
| 358 | 325 | |
| 359 | 326 | /** |
| 327 | + * Animate to a different layout | |
| 328 | + */ | |
| 329 | + void ChangeLayout() | |
| 330 | + { | |
| 331 | + Animation animation = Animation::New( mDurationSeconds ); | |
| 332 | + animation.FinishedSignal().Connect( this, &ItemViewExample::AnimationFinished ); | |
| 333 | + animation.AnimateTo( Property( mItemView, Actor::Property::COLOR_ALPHA ), 0.0f ); | |
| 334 | + animation.Play(); | |
| 335 | + } | |
| 336 | + | |
| 337 | + void AnimationFinished( Animation& ) | |
| 338 | + { | |
| 339 | + SetLayout( mCurrentLayout ); | |
| 340 | + | |
| 341 | + Animation animation = Animation::New( mDurationSeconds ); | |
| 342 | + animation.AnimateTo( Property( mItemView, Actor::Property::COLOR_ALPHA ), 1.0f ); | |
| 343 | + animation.Play(); | |
| 344 | + } | |
| 345 | + | |
| 346 | + /** | |
| 360 | 347 | * Switch to a different item view layout |
| 361 | 348 | */ |
| 362 | - void UseLayout(int layoutId, float duration) | |
| 349 | + void SetLayout( int layoutId ) | |
| 363 | 350 | { |
| 364 | 351 | // Set the new orientation to the layout |
| 365 | 352 | mItemView.GetLayout(layoutId)->SetOrientation(static_cast<ControlOrientation::Type>(mOrientation / 90)); |
| 366 | 353 | |
| 367 | 354 | Vector2 stageSize = Stage::GetCurrent().GetSize(); |
| 368 | 355 | |
| 369 | - if(layoutId == SPIRAL_LAYOUT) | |
| 370 | - { | |
| 371 | - mSpiralLayout->SetRevolutionDistance(stageSize.height / Stage::GetCurrent().GetDpi().y * 45.0f); | |
| 372 | - } | |
| 373 | - | |
| 374 | - if(layoutId == GRID_LAYOUT) | |
| 375 | - { | |
| 376 | - // Set up the grid layout according to the new orientation | |
| 377 | - float layoutWidth = Toolkit::IsHorizontal(mGridLayout->GetOrientation()) ? stageSize.height : stageSize.width; | |
| 378 | - float gridItemSize = (layoutWidth / mGridLayout->GetNumberOfColumns()) * 0.5f; | |
| 379 | - mGridLayout->SetScrollSpeedFactor(mGridLayout->GetNumberOfColumns() / gridItemSize); | |
| 380 | - | |
| 381 | - float toolbarHeight = mToolBar.GetCurrentSize().y; | |
| 382 | - mGridLayout->SetTopMargin(toolbarHeight + mGridLayout->GetRowSpacing()); | |
| 383 | - } | |
| 384 | - | |
| 385 | 356 | if(layoutId == DEPTH_LAYOUT) |
| 386 | 357 | { |
| 387 | 358 | // Set up the depth layout according to the new orientation |
| 388 | 359 | if(Toolkit::IsVertical(mDepthLayout->GetOrientation())) |
| 389 | 360 | { |
| 390 | - mDepthLayout->SetRowSpacing(stageSize.height * DEPTH_LAYOUT_ROW_SPACING_FACTOR); | |
| 391 | - mDepthLayout->SetNumberOfRows(DEPTH_LAYOUT_ROWS_PORTRAIT); | |
| 392 | - mDepthLayout->SetTiltAngle( Degree( DEPTH_LAYOUT_TILT_ANGLE_PORTRAIT - mDepthLayout->GetNumberOfColumns() ) ); | |
| 393 | - mDepthLayout->SetItemSizeFunction(DepthLayoutItemSizeFunctionPortrait); | |
| 394 | - mDepthLayout->SetBottomMarginFunction(DepthLayoutBottomMarginFunctionPortrait); | |
| 361 | + mDepthLayout->SetItemSize( DepthLayoutItemSizeFunctionPortrait( stageSize.width ) ); | |
| 395 | 362 | } |
| 396 | 363 | else |
| 397 | 364 | { |
| 398 | - mDepthLayout->SetRowSpacing(stageSize.width * DEPTH_LAYOUT_ROW_SPACING_FACTOR); | |
| 399 | - mDepthLayout->SetNumberOfRows(DEPTH_LAYOUT_ROWS_LANDSCAPE); | |
| 400 | - mDepthLayout->SetTiltAngle( Degree( DEPTH_LAYOUT_TILT_ANGLE_LANDSCAPE - mDepthLayout->GetNumberOfColumns() ) ); | |
| 401 | - mDepthLayout->SetItemSizeFunction(DepthLayoutItemSizeFunctionLandscape); | |
| 402 | - mDepthLayout->SetBottomMarginFunction(DepthLayoutBottomMarginFunctionLandscape); | |
| 365 | + mDepthLayout->SetItemSize( DepthLayoutItemSizeFunctionLandscape( stageSize.height ) ); | |
| 403 | 366 | } |
| 404 | 367 | } |
| 405 | 368 | |
| ... | ... | @@ -407,7 +370,7 @@ public: |
| 407 | 370 | mItemView.SetAnchoring(layoutId == DEPTH_LAYOUT); |
| 408 | 371 | |
| 409 | 372 | // Activate the layout |
| 410 | - mItemView.ActivateLayout(layoutId, Vector3(stageSize.x, stageSize.y, stageSize.x), duration); | |
| 373 | + mItemView.ActivateLayout( layoutId, Vector3(stageSize.x, stageSize.y, stageSize.x), 0.0f ); | |
| 411 | 374 | } |
| 412 | 375 | |
| 413 | 376 | /** |
| ... | ... | @@ -424,7 +387,7 @@ public: |
| 424 | 387 | // Remember orientation |
| 425 | 388 | mOrientation = angle; |
| 426 | 389 | |
| 427 | - UseLayout(mCurrentLayout, mDurationSeconds); | |
| 390 | + SetLayout( mCurrentLayout ); | |
| 428 | 391 | } |
| 429 | 392 | } |
| 430 | 393 | |
| ... | ... | @@ -433,7 +396,7 @@ public: |
| 433 | 396 | // Switch to the next layout |
| 434 | 397 | mCurrentLayout = (mCurrentLayout + 1) % mItemView.GetLayoutCount(); |
| 435 | 398 | |
| 436 | - UseLayout(mCurrentLayout, mDurationSeconds); | |
| 399 | + ChangeLayout(); | |
| 437 | 400 | |
| 438 | 401 | SetLayoutTitle(); |
| 439 | 402 | SetLayoutImage(); |
| ... | ... | @@ -973,100 +936,6 @@ private: |
| 973 | 936 | mTitleActor.SetProperty( TextLabel::Property::TEXT, title ); |
| 974 | 937 | } |
| 975 | 938 | |
| 976 | - void ShowMenu() | |
| 977 | - { | |
| 978 | - Stage stage = Stage::GetCurrent(); | |
| 979 | - const float popupWidth = stage.GetSize().x * 0.75f; | |
| 980 | - | |
| 981 | - mMenu = Toolkit::Popup::New(); | |
| 982 | - mMenu.SetParentOrigin( ParentOrigin::BOTTOM_LEFT ); | |
| 983 | - mMenu.SetAnchorPoint( AnchorPoint::BOTTOM_LEFT ); | |
| 984 | - mMenu.SetSize( popupWidth, MENU_OPTION_HEIGHT * 2 ); | |
| 985 | - mMenu.OutsideTouchedSignal().Connect( this, &ItemViewExample::HideMenu ); | |
| 986 | - | |
| 987 | - TableView tableView = TableView::New( 0, 0 ); | |
| 988 | - tableView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); | |
| 989 | - mMenu.Add( tableView ); | |
| 990 | - | |
| 991 | - Slider slider = Slider::New(); | |
| 992 | - slider.SetProperty( Slider::Property::LOWER_BOUND, 0.0f ); | |
| 993 | - slider.SetProperty( Slider::Property::UPPER_BOUND, 3.0f ); | |
| 994 | - slider.SetProperty( Slider::Property::VALUE, mDurationSeconds ); | |
| 995 | - slider.SetProperty( Slider::Property::VALUE_PRECISION, 2 ); | |
| 996 | - slider.SetProperty( Slider::Property::SHOW_POPUP, true ); | |
| 997 | - slider.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); | |
| 998 | - slider.ValueChangedSignal().Connect( this, &ItemViewExample::SliderValueChange ); | |
| 999 | - tableView.AddChild( slider, TableView::CellPosition( 0, 0 ) ); | |
| 1000 | - | |
| 1001 | - TextLabel text = TextLabel::New( "Duration" ); | |
| 1002 | - text.SetAnchorPoint( ParentOrigin::TOP_LEFT ); | |
| 1003 | - text.SetParentOrigin( ParentOrigin::TOP_LEFT ); | |
| 1004 | - text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); | |
| 1005 | - text.SetResizePolicy( ResizePolicy::FIXED, Dimension::HEIGHT ); | |
| 1006 | - text.SetSize( Vector2( 0.0f, LABEL_TEXT_SIZE_Y ) ); | |
| 1007 | - slider.Add( text ); | |
| 1008 | - | |
| 1009 | - Actor textContainer = Actor::New(); | |
| 1010 | - textContainer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); | |
| 1011 | - mAlphaFunctionText = TextLabel::New( ALPHA_FUNCTIONS_TEXT[mAlphaFuncIndex] ); | |
| 1012 | - mAlphaFunctionText.SetAnchorPoint( ParentOrigin::CENTER ); | |
| 1013 | - mAlphaFunctionText.SetParentOrigin( ParentOrigin::CENTER ); | |
| 1014 | - textContainer.Add( mAlphaFunctionText ); | |
| 1015 | - tableView.AddChild( textContainer, TableView::CellPosition( 1, 0 ) ); | |
| 1016 | - | |
| 1017 | - mTapDetector = TapGestureDetector::New(); | |
| 1018 | - mTapDetector.Attach(mAlphaFunctionText); | |
| 1019 | - mTapDetector.DetectedSignal().Connect( this, &ItemViewExample::ChangeAlphaFunctionOnTap ); | |
| 1020 | - | |
| 1021 | - text = TextLabel::New( "Alpha Function" ); | |
| 1022 | - text.SetAnchorPoint( ParentOrigin::TOP_LEFT ); | |
| 1023 | - text.SetParentOrigin( ParentOrigin::TOP_LEFT ); | |
| 1024 | - text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); | |
| 1025 | - text.SetSize( 0.0f, LABEL_TEXT_SIZE_Y ); | |
| 1026 | - textContainer.Add( text ); | |
| 1027 | - | |
| 1028 | - mMenu.Show(); | |
| 1029 | - mMenuShown = true; | |
| 1030 | - } | |
| 1031 | - | |
| 1032 | - bool SliderValueChange( Toolkit::Slider slider, float value ) | |
| 1033 | - { | |
| 1034 | - mDurationSeconds = value; | |
| 1035 | - | |
| 1036 | - return true; | |
| 1037 | - } | |
| 1038 | - | |
| 1039 | - void ChangeAlphaFunctionOnTap( Actor actor, const TapGesture& tap ) | |
| 1040 | - { | |
| 1041 | - if( NUM_ALPHA_FUNCTIONS <= ++mAlphaFuncIndex ) | |
| 1042 | - { | |
| 1043 | - mAlphaFuncIndex = 0; | |
| 1044 | - } | |
| 1045 | - | |
| 1046 | - if( mAlphaFunctionText ) | |
| 1047 | - { | |
| 1048 | - mAlphaFunctionText.SetProperty( TextLabel::Property::TEXT, std::string(ALPHA_FUNCTIONS_TEXT[mAlphaFuncIndex]) ); | |
| 1049 | - } | |
| 1050 | - | |
| 1051 | - if( mItemView ) | |
| 1052 | - { | |
| 1053 | - mItemView.GetActiveLayout()->SetAlphaFunction( ALPHA_FUNCTIONS[mAlphaFuncIndex] ); | |
| 1054 | - } | |
| 1055 | - } | |
| 1056 | - | |
| 1057 | - void HideMenu() | |
| 1058 | - { | |
| 1059 | - mTapDetector.Reset(); | |
| 1060 | - | |
| 1061 | - if( mMenu ) | |
| 1062 | - { | |
| 1063 | - mMenu.Hide(); | |
| 1064 | - mMenu.Reset(); | |
| 1065 | - } | |
| 1066 | - | |
| 1067 | - mMenuShown = false; | |
| 1068 | - } | |
| 1069 | - | |
| 1070 | 939 | /** |
| 1071 | 940 | * Main key event handler |
| 1072 | 941 | */ |
| ... | ... | @@ -1074,27 +943,9 @@ private: |
| 1074 | 943 | { |
| 1075 | 944 | if(event.state == KeyEvent::Down) |
| 1076 | 945 | { |
| 1077 | - if( IsKey( event, DALI_KEY_MENU ) ) | |
| 946 | + if( IsKey( event, DALI_KEY_ESCAPE) || IsKey( event, DALI_KEY_BACK ) ) | |
| 1078 | 947 | { |
| 1079 | - if( mMenuShown ) | |
| 1080 | - { | |
| 1081 | - HideMenu(); | |
| 1082 | - } | |
| 1083 | - else | |
| 1084 | - { | |
| 1085 | - ShowMenu(); | |
| 1086 | - } | |
| 1087 | - } | |
| 1088 | - else if( IsKey( event, DALI_KEY_ESCAPE) || IsKey( event, DALI_KEY_BACK ) ) | |
| 1089 | - { | |
| 1090 | - if( mMenuShown ) | |
| 1091 | - { | |
| 1092 | - HideMenu(); | |
| 1093 | - } | |
| 1094 | - else | |
| 1095 | - { | |
| 1096 | - mApplication.Quit(); | |
| 1097 | - } | |
| 948 | + mApplication.Quit(); | |
| 1098 | 949 | } |
| 1099 | 950 | } |
| 1100 | 951 | } |
| ... | ... | @@ -1103,7 +954,6 @@ private: |
| 1103 | 954 | |
| 1104 | 955 | Application& mApplication; |
| 1105 | 956 | Mode mMode; |
| 1106 | - bool mMenuShown; | |
| 1107 | 957 | |
| 1108 | 958 | Toolkit::Control mView; |
| 1109 | 959 | unsigned int mOrientation; |
| ... | ... | @@ -1117,11 +967,9 @@ private: |
| 1117 | 967 | unsigned int mCurrentLayout; |
| 1118 | 968 | float mDurationSeconds; |
| 1119 | 969 | |
| 1120 | - SpiralLayoutPtr mSpiralLayout; | |
| 1121 | - DepthLayoutPtr mDepthLayout; | |
| 1122 | - GridLayoutPtr mGridLayout; | |
| 1123 | - | |
| 1124 | - Toolkit::Popup mMenu; | |
| 970 | + ItemLayoutPtr mSpiralLayout; | |
| 971 | + ItemLayoutPtr mDepthLayout; | |
| 972 | + ItemLayoutPtr mGridLayout; | |
| 1125 | 973 | |
| 1126 | 974 | TapGestureDetector mTapDetector; |
| 1127 | 975 | Toolkit::PushButton mLayoutButton; |
| ... | ... | @@ -1129,8 +977,6 @@ private: |
| 1129 | 977 | Toolkit::PushButton mInsertButton; |
| 1130 | 978 | Toolkit::PushButton mReplaceButton; |
| 1131 | 979 | |
| 1132 | - unsigned int mAlphaFuncIndex; | |
| 1133 | - TextLabel mAlphaFunctionText; | |
| 1134 | 980 | BufferImage mWhiteImage; |
| 1135 | 981 | }; |
| 1136 | 982 | |
| ... | ... | @@ -1143,7 +989,7 @@ void RunTest(Application& app) |
| 1143 | 989 | |
| 1144 | 990 | int main(int argc, char **argv) |
| 1145 | 991 | { |
| 1146 | - Application app = Application::New(&argc, &argv); | |
| 992 | + Application app = Application::New(&argc, &argv, DALI_DEMO_THEME_PATH); | |
| 1147 | 993 | |
| 1148 | 994 | RunTest(app); |
| 1149 | 995 | ... | ... |
examples/logging/logging-example.cpp
| ... | ... | @@ -18,7 +18,7 @@ |
| 18 | 18 | #include "shared/view.h" |
| 19 | 19 | #include <dali/dali.h> |
| 20 | 20 | #include <dali-toolkit/dali-toolkit.h> |
| 21 | - | |
| 21 | +#include <dali/devel-api/adaptor-framework/performance-logger.h> | |
| 22 | 22 | #include <sstream> |
| 23 | 23 | |
| 24 | 24 | using namespace Dali; |
| ... | ... | @@ -144,8 +144,6 @@ class LoggingController: public ConnectionTracker |
| 144 | 144 | { |
| 145 | 145 | // The Init signal is received once (only) during the Application lifetime |
| 146 | 146 | |
| 147 | - DemoHelper::RequestThemeChange(); | |
| 148 | - | |
| 149 | 147 | mCurrentLogger = 0; |
| 150 | 148 | mPerformanceLoggers.reserve( NUM_LOGGERS ); |
| 151 | 149 | mPerformanceLoggers.resize( NUM_LOGGERS ); |
| ... | ... | @@ -755,7 +753,7 @@ void RunTest( Application& application ) |
| 755 | 753 | // |
| 756 | 754 | int main( int argc, char **argv ) |
| 757 | 755 | { |
| 758 | - Application application = Application::New( &argc, &argv ); | |
| 756 | + Application application = Application::New( &argc, &argv, DALI_DEMO_THEME_PATH ); | |
| 759 | 757 | |
| 760 | 758 | RunTest( application ); |
| 761 | 759 | ... | ... |
examples/magnifier/magnifier-example.cpp
| ... | ... | @@ -21,7 +21,7 @@ |
| 21 | 21 | #include "shared/view.h" |
| 22 | 22 | |
| 23 | 23 | #include <dali-toolkit/dali-toolkit.h> |
| 24 | - | |
| 24 | +#include <dali-toolkit/devel-api/controls/magnifier/magnifier.h> | |
| 25 | 25 | using namespace Dali; |
| 26 | 26 | |
| 27 | 27 | namespace |
| ... | ... | @@ -193,8 +193,6 @@ public: |
| 193 | 193 | */ |
| 194 | 194 | void Create( Application& application ) |
| 195 | 195 | { |
| 196 | - DemoHelper::RequestThemeChange(); | |
| 197 | - | |
| 198 | 196 | Stage::GetCurrent().KeyEventSignal().Connect(this, &ExampleController::OnKeyEvent); |
| 199 | 197 | |
| 200 | 198 | mStageSize = Stage::GetCurrent().GetSize(); |
| ... | ... | @@ -415,7 +413,7 @@ void RunTest( Application& application ) |
| 415 | 413 | // |
| 416 | 414 | int main( int argc, char **argv ) |
| 417 | 415 | { |
| 418 | - Application application = Application::New( &argc, &argv ); | |
| 416 | + Application application = Application::New( &argc, &argv, DALI_DEMO_THEME_PATH ); | |
| 419 | 417 | |
| 420 | 418 | RunTest( application ); |
| 421 | 419 | ... | ... |
examples/motion-blur/motion-blur-example.cpp
| ... | ... | @@ -21,6 +21,8 @@ |
| 21 | 21 | #include "shared/view.h" |
| 22 | 22 | #include <dali/dali.h> |
| 23 | 23 | #include <dali-toolkit/dali-toolkit.h> |
| 24 | +#include <dali-toolkit/devel-api/shader-effects/motion-blur-effect.h> | |
| 25 | +#include <dali-toolkit/devel-api/controls/popup/popup.h> | |
| 24 | 26 | |
| 25 | 27 | using namespace Dali; |
| 26 | 28 | using namespace Dali::Toolkit; |
| ... | ... | @@ -189,8 +191,8 @@ public: |
| 189 | 191 | winHandle.AddAvailableOrientation( Dali::Window::LANDSCAPE_INVERSE ); |
| 190 | 192 | |
| 191 | 193 | // set initial orientation |
| 192 | - winHandle.GetOrientation().ChangedSignal().Connect( this, &MotionBlurExampleApp::OnOrientationChanged ); | |
| 193 | - unsigned int degrees = winHandle.GetOrientation().GetDegrees(); | |
| 194 | + // winHandle.GetOrientation().ChangedSignal().Connect( this, &MotionBlurExampleApp::OnOrientationChanged ); | |
| 195 | + unsigned int degrees = 0; | |
| 194 | 196 | Rotate( static_cast< DeviceOrientation >( degrees ) ); |
| 195 | 197 | |
| 196 | 198 | |
| ... | ... | @@ -559,7 +561,7 @@ void RunTest(Application& app) |
| 559 | 561 | // |
| 560 | 562 | int main(int argc, char **argv) |
| 561 | 563 | { |
| 562 | - Application app = Application::New(&argc, &argv); | |
| 564 | + Application app = Application::New(&argc, &argv, DALI_DEMO_THEME_PATH); | |
| 563 | 565 | |
| 564 | 566 | RunTest(app); |
| 565 | 567 | ... | ... |
examples/motion-stretch/motion-stretch-example.cpp
| ... | ... | @@ -21,6 +21,7 @@ |
| 21 | 21 | #include "shared/view.h" |
| 22 | 22 | #include <dali/dali.h> |
| 23 | 23 | #include <dali-toolkit/dali-toolkit.h> |
| 24 | +#include <dali-toolkit/devel-api/shader-effects/motion-stretch-effect.h> | |
| 24 | 25 | |
| 25 | 26 | using namespace Dali; |
| 26 | 27 | using namespace Dali::Toolkit; |
| ... | ... | @@ -124,8 +125,6 @@ public: |
| 124 | 125 | { |
| 125 | 126 | // The Init signal is received once (only) during the Application lifetime |
| 126 | 127 | |
| 127 | - DemoHelper::RequestThemeChange(); | |
| 128 | - | |
| 129 | 128 | Stage::GetCurrent().KeyEventSignal().Connect(this, &MotionStretchExampleApp::OnKeyEvent); |
| 130 | 129 | |
| 131 | 130 | // Creates a default view with a default tool bar. |
| ... | ... | @@ -166,8 +165,8 @@ public: |
| 166 | 165 | winHandle.AddAvailableOrientation( Dali::Window::PORTRAIT_INVERSE ); |
| 167 | 166 | winHandle.AddAvailableOrientation( Dali::Window::LANDSCAPE_INVERSE ); |
| 168 | 167 | |
| 169 | - winHandle.GetOrientation().ChangedSignal().Connect( this, &MotionStretchExampleApp::OnOrientationChanged ); | |
| 170 | - unsigned int degrees = winHandle.GetOrientation().GetDegrees(); | |
| 168 | + // winHandle.GetOrientation().ChangedSignal().Connect( this, &MotionStretchExampleApp::OnOrientationChanged ); | |
| 169 | + unsigned int degrees = 0; | |
| 171 | 170 | Rotate( static_cast< DeviceOrientation >( degrees ) ); |
| 172 | 171 | |
| 173 | 172 | |
| ... | ... | @@ -441,7 +440,7 @@ void RunTest(Application& app) |
| 441 | 440 | // |
| 442 | 441 | int main(int argc, char **argv) |
| 443 | 442 | { |
| 444 | - Application app = Application::New(&argc, &argv); | |
| 443 | + Application app = Application::New(&argc, &argv, DALI_DEMO_THEME_PATH); | |
| 445 | 444 | |
| 446 | 445 | RunTest(app); |
| 447 | 446 | ... | ... |
examples/new-window/new-window-example.cpp
| ... | ... | @@ -15,6 +15,13 @@ |
| 15 | 15 | */ |
| 16 | 16 | |
| 17 | 17 | #include <dali-toolkit/dali-toolkit.h> |
| 18 | +#include <dali/devel-api/actors/mesh-actor.h> | |
| 19 | +#include <dali/devel-api/modeling/material.h> | |
| 20 | +#include <dali/devel-api/geometry/mesh.h> | |
| 21 | +#include <dali-toolkit/devel-api/controls/bubble-effect/bubble-emitter.h> | |
| 22 | +#include <dali-toolkit/devel-api/shader-effects/bubble-effect/color-adjuster.h> | |
| 23 | + | |
| 24 | + | |
| 18 | 25 | #include "shared/view.h" |
| 19 | 26 | #include <cstdio> |
| 20 | 27 | #include <iostream> |
| ... | ... | @@ -116,8 +123,6 @@ NewWindowController::NewWindowController( Application& application ) |
| 116 | 123 | |
| 117 | 124 | void NewWindowController::Create( Application& app ) |
| 118 | 125 | { |
| 119 | - DemoHelper::RequestThemeChange(); | |
| 120 | - | |
| 121 | 126 | Stage stage = Stage::GetCurrent(); |
| 122 | 127 | stage.SetBackgroundColor(Color::YELLOW); |
| 123 | 128 | |
| ... | ... | @@ -457,7 +462,7 @@ void RunTest(Application& app) |
| 457 | 462 | |
| 458 | 463 | int main(int argc, char **argv) |
| 459 | 464 | { |
| 460 | - gApplication = Application::New(&argc, &argv); | |
| 465 | + gApplication = Application::New(&argc, &argv, DALI_DEMO_THEME_PATH); | |
| 461 | 466 | RunTest(gApplication); |
| 462 | 467 | |
| 463 | 468 | return 0; | ... | ... |
examples/page-turn-view/page-turn-view-example.cpp
| ... | ... | @@ -17,6 +17,12 @@ |
| 17 | 17 | |
| 18 | 18 | #include <dali/dali.h> |
| 19 | 19 | #include <dali-toolkit/dali-toolkit.h> |
| 20 | +#include <dali-toolkit/devel-api/shader-effects/page-turn-effect.h> | |
| 21 | +#include <dali-toolkit/devel-api/controls/page-turn-view/page-factory.h> | |
| 22 | +#include <dali-toolkit/devel-api/controls/page-turn-view/page-turn-landscape-view.h> | |
| 23 | +#include <dali-toolkit/devel-api/controls/page-turn-view/page-turn-portrait-view.h> | |
| 24 | +#include <dali-toolkit/devel-api/controls/page-turn-view/page-turn-view.h> | |
| 25 | + | |
| 20 | 26 | #include <assert.h> |
| 21 | 27 | #include <cstdlib> |
| 22 | 28 | #include <string.h> |
| ... | ... | @@ -221,8 +227,6 @@ void PageTurnController::OnInit( Application& app ) |
| 221 | 227 | { |
| 222 | 228 | // The Init signal is received once ( only ) during the Application lifetime |
| 223 | 229 | |
| 224 | - DemoHelper::RequestThemeChange(); | |
| 225 | - | |
| 226 | 230 | Stage::GetCurrent().KeyEventSignal().Connect(this, &PageTurnController::OnKeyEvent); |
| 227 | 231 | |
| 228 | 232 | Stage stage = Stage::GetCurrent(); |
| ... | ... | @@ -242,7 +246,7 @@ void PageTurnController::OnInit( Application& app ) |
| 242 | 246 | winHandle.AddAvailableOrientation( Dali::Window::LANDSCAPE_INVERSE ); |
| 243 | 247 | |
| 244 | 248 | // view will response to orientation change to display portrait or landscape views |
| 245 | - app.GetWindow().GetOrientation().ChangedSignal().Connect( this, &PageTurnController::OnOrientationAnimationStarted ); | |
| 249 | + //app.GetWindow().GetOrientation().ChangedSignal().Connect( this, &PageTurnController::OnOrientationAnimationStarted ); | |
| 246 | 250 | |
| 247 | 251 | mPageTurnPortraitView = PageTurnPortraitView::New( mPortraitPageFactory, stageSize ); |
| 248 | 252 | mPageTurnPortraitView.SetSpineShadowParameter( Vector2(70.f, 30.f) ); |
| ... | ... | @@ -342,7 +346,7 @@ void PageTurnController::OnPageFinishedPan( PageTurnView pageTurnView ) |
| 342 | 346 | // Entry point for applications |
| 343 | 347 | int main( int argc, char **argv ) |
| 344 | 348 | { |
| 345 | - Application app = Application::New(&argc, &argv); | |
| 349 | + Application app = Application::New(&argc, &argv, DALI_DEMO_THEME_PATH); | |
| 346 | 350 | PageTurnController test ( app ); |
| 347 | 351 | |
| 348 | 352 | app.MainLoop(); | ... | ... |
examples/path-animation/path-animation.cpp
| ... | ... | @@ -21,6 +21,12 @@ |
| 21 | 21 | |
| 22 | 22 | // EXTERNAL INCLUDES |
| 23 | 23 | #include <dali-toolkit/dali-toolkit.h> |
| 24 | +#include <dali/devel-api/actors/mesh-actor.h> | |
| 25 | +#include <dali/devel-api/geometry/mesh.h> | |
| 26 | +#include <dali/devel-api/geometry/mesh-factory.h> | |
| 27 | +#include <dali-toolkit/devel-api/controls/slider/slider.h> | |
| 28 | + | |
| 29 | + | |
| 24 | 30 | |
| 25 | 31 | // INTERNAL INCLUDES |
| 26 | 32 | #include "shared/view.h" |
| ... | ... | @@ -62,7 +68,7 @@ public: |
| 62 | 68 | * @param[in] size The size of the slider |
| 63 | 69 | * @param[in] callback Pointer to the callback function to be called when user moves the slider |
| 64 | 70 | */ |
| 65 | - Actor CreateVectorComponentControl( const std::string& label, const Vector3& size, bool(PathController::*callback)(Slider,float) ) | |
| 71 | + Actor CreateVectorComponentControl( const std::string& label, const Vector3& size, bool(PathController::*callback)(Dali::Toolkit::Slider,float) ) | |
| 66 | 72 | { |
| 67 | 73 | TextLabel text = TextLabel::New(label); |
| 68 | 74 | text.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::WIDTH ); |
| ... | ... | @@ -79,7 +85,7 @@ public: |
| 79 | 85 | float mark = -1.0f; |
| 80 | 86 | for(unsigned short i(0); i<21; ++i ) |
| 81 | 87 | { |
| 82 | - marks.push_back( mark ); | |
| 88 | + marks.PushBack( mark ); | |
| 83 | 89 | mark += 0.1f; |
| 84 | 90 | } |
| 85 | 91 | |
| ... | ... | @@ -435,8 +441,6 @@ public: |
| 435 | 441 | */ |
| 436 | 442 | void Create( Application& application ) |
| 437 | 443 | { |
| 438 | - DemoHelper::RequestThemeChange(); | |
| 439 | - | |
| 440 | 444 | // Get a handle to the stage: |
| 441 | 445 | Stage stage = Stage::GetCurrent(); |
| 442 | 446 | |
| ... | ... | @@ -506,7 +510,7 @@ void RunTest( Application& application ) |
| 506 | 510 | /** Entry point for Linux & Tizen applications */ |
| 507 | 511 | int main( int argc, char **argv ) |
| 508 | 512 | { |
| 509 | - Application application = Application::New( &argc, &argv ); | |
| 513 | + Application application = Application::New( &argc, &argv, DALI_DEMO_THEME_PATH ); | |
| 510 | 514 | |
| 511 | 515 | RunTest( application ); |
| 512 | 516 | ... | ... |
examples/radial-menu/radial-menu-example.cpp
| ... | ... | @@ -17,6 +17,7 @@ |
| 17 | 17 | |
| 18 | 18 | #include <dali/dali.h> |
| 19 | 19 | #include <dali-toolkit/dali-toolkit.h> |
| 20 | +#include <dali/devel-api/actors/mesh-actor.h> | |
| 20 | 21 | #include "shared/view.h" |
| 21 | 22 | #include "radial-sweep-view.h" |
| 22 | 23 | #include "radial-sweep-view-impl.h" |
| ... | ... | @@ -121,8 +122,6 @@ RadialMenuExample::~RadialMenuExample() |
| 121 | 122 | |
| 122 | 123 | void RadialMenuExample::OnInit(Application& app) |
| 123 | 124 | { |
| 124 | - DemoHelper::RequestThemeChange(); | |
| 125 | - | |
| 126 | 125 | Stage stage = Dali::Stage::GetCurrent(); |
| 127 | 126 | |
| 128 | 127 | // The Init signal is received once (only) during the Application lifetime |
| ... | ... | @@ -290,7 +289,7 @@ void RunTest(Application app) |
| 290 | 289 | // Entry point for Linux & Tizen applications |
| 291 | 290 | int main(int argc, char **argv) |
| 292 | 291 | { |
| 293 | - Application app = Application::New(&argc, &argv); | |
| 292 | + Application app = Application::New(&argc, &argv, DALI_DEMO_THEME_PATH); | |
| 294 | 293 | |
| 295 | 294 | RunTest(app); |
| 296 | 295 | ... | ... |
examples/radial-menu/radial-sweep-view-impl.h
| ... | ... | @@ -19,6 +19,10 @@ |
| 19 | 19 | */ |
| 20 | 20 | |
| 21 | 21 | #include <dali-toolkit/dali-toolkit.h> |
| 22 | +#include <dali/devel-api/actors/mesh-actor.h> | |
| 23 | +#include <dali/devel-api/modeling/material.h> | |
| 24 | +#include <dali/devel-api/geometry/animatable-mesh.h> | |
| 25 | + | |
| 22 | 26 | #include "radial-sweep-view.h" |
| 23 | 27 | |
| 24 | 28 | ... | ... |
examples/radial-menu/radial-sweep-view.cpp
examples/refraction-effect/refraction-effect-example.cpp
| ... | ... | @@ -17,10 +17,15 @@ |
| 17 | 17 | |
| 18 | 18 | #include <dali/dali.h> |
| 19 | 19 | #include <dali-toolkit/dali-toolkit.h> |
| 20 | +#include <dali/devel-api/actors/mesh-actor.h> | |
| 21 | +#include <dali/devel-api/modeling/material.h> | |
| 22 | +#include <dali/devel-api/geometry/mesh.h> | |
| 23 | + | |
| 20 | 24 | #include "shared/view.h" |
| 21 | 25 | |
| 22 | 26 | #include <fstream> |
| 23 | 27 | #include <sstream> |
| 28 | +#include <limits> | |
| 24 | 29 | |
| 25 | 30 | using namespace Dali; |
| 26 | 31 | |
| ... | ... | @@ -315,8 +320,6 @@ private: |
| 315 | 320 | // The Init signal is received once (only) during the Application lifetime |
| 316 | 321 | void Create(Application& application) |
| 317 | 322 | { |
| 318 | - DemoHelper::RequestThemeChange(); | |
| 319 | - | |
| 320 | 323 | Stage stage = Stage::GetCurrent(); |
| 321 | 324 | mStageHalfSize = stage.GetSize() * 0.5f; |
| 322 | 325 | |
| ... | ... | @@ -653,7 +656,7 @@ RunTest(Application& app) |
| 653 | 656 | int |
| 654 | 657 | main(int argc, char **argv) |
| 655 | 658 | { |
| 656 | - Application app = Application::New(&argc, &argv); | |
| 659 | + Application app = Application::New(&argc, &argv, DALI_DEMO_THEME_PATH); | |
| 657 | 660 | |
| 658 | 661 | RunTest(app); |
| 659 | 662 | ... | ... |
examples/scripting/launcher.cpp
| ... | ... | @@ -48,7 +48,6 @@ Launcher::Launcher( Dali::Application application, std::string layoutFileName, s |
| 48 | 48 | mJSONFileName(layoutFileName ), |
| 49 | 49 | mJavaScriptFileName( scriptFileName ) |
| 50 | 50 | { |
| 51 | - | |
| 52 | 51 | mApplication.InitSignal().Connect( this, &Launcher::Create ); |
| 53 | 52 | } |
| 54 | 53 | |
| ... | ... | @@ -58,8 +57,6 @@ Launcher::~Launcher() |
| 58 | 57 | |
| 59 | 58 | void Launcher::Create( Dali::Application& application ) |
| 60 | 59 | { |
| 61 | - DemoHelper::RequestThemeChange(); | |
| 62 | - | |
| 63 | 60 | TextLabel textActor = TextLabel::New( "JSON & JavaScript Launcher..." ); |
| 64 | 61 | |
| 65 | 62 | // Reposition the actor | ... | ... |
examples/scripting/launcher.h
| ... | ... | @@ -21,6 +21,8 @@ |
| 21 | 21 | // EXTERNAL INCLUDES |
| 22 | 22 | #include <dali/dali.h> |
| 23 | 23 | #include <dali-toolkit/dali-toolkit.h> |
| 24 | +#include <dali-toolkit/devel-api/scripting/script.h> | |
| 25 | +#include <dali-toolkit/devel-api/builder/builder.h> | |
| 24 | 26 | |
| 25 | 27 | /** |
| 26 | 28 | * Example app that can load both JSON and JavaScript files from command line | ... | ... |
examples/scripting/scripting-example.cpp
| ... | ... | @@ -88,7 +88,7 @@ int main( int argc, char* argv[] ) |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | |
| 91 | - Launcher daliApplication( Dali::Application::New( &argc, &argv ), jSONFileName, javaScriptFileName ); | |
| 91 | + Launcher daliApplication( Dali::Application::New( &argc, &argv, DALI_DEMO_THEME_PATH ), jSONFileName, javaScriptFileName ); | |
| 92 | 92 | |
| 93 | 93 | daliApplication.MainLoop(); |
| 94 | 94 | ... | ... |
examples/scroll-view/scroll-view-example.cpp
| 1 | 1 | /* |
| 2 | - * Copyright (c) 2014 Samsung Electronics Co., Ltd. | |
| 2 | + * Copyright (c) 2015 Samsung Electronics Co., Ltd. | |
| 3 | 3 | * |
| 4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | 5 | * you may not use this file except in compliance with the License. |
| ... | ... | @@ -31,18 +31,15 @@ namespace |
| 31 | 31 | const char * const BACKGROUND_IMAGE( DALI_IMAGE_DIR "background-default.png" ); |
| 32 | 32 | const char * const TOOLBAR_IMAGE( DALI_IMAGE_DIR "top-bar.png" ); |
| 33 | 33 | const char * const APPLICATION_TITLE( "ScrollView" ); |
| 34 | -const char * const EFFECT_DEPTH_IMAGE( DALI_IMAGE_DIR "icon-scroll-view-depth.png" ); | |
| 35 | -const char * const EFFECT_INNER_CUBE_IMAGE( DALI_IMAGE_DIR "icon-scroll-view-inner-cube.png" ); | |
| 36 | 34 | const char * const EFFECT_CAROUSEL_IMAGE( DALI_IMAGE_DIR "icon-scroll-view-carousel.png" ); |
| 37 | 35 | |
| 38 | 36 | const Vector3 ICON_SIZE(100.0f, 100.0f, 0.0f); |
| 39 | 37 | |
| 40 | 38 | const char* EFFECT_MODE_NAME[] = { |
| 41 | - "Depth", | |
| 42 | - "Cube", | |
| 43 | 39 | "PageCarousel", |
| 44 | 40 | "PageCube", |
| 45 | - "PageSpiral" | |
| 41 | + "PageSpiral", | |
| 42 | + "PageWave" | |
| 46 | 43 | }; |
| 47 | 44 | |
| 48 | 45 | const char * const IMAGE_PATHS[] = { |
| ... | ... | @@ -119,25 +116,6 @@ const int PAGE_COLUMNS = 10; ///< |
| 119 | 116 | const int PAGE_ROWS = 1; ///< Number of Pages going down (rows) |
| 120 | 117 | const int IMAGE_ROWS = 5; ///< Number of Images going down (rows) with a Page |
| 121 | 118 | |
| 122 | -// 3D Effect constants | |
| 123 | -const Vector3 ANGLE_CUBE_PAGE_ROTATE(Math::PI * 0.2f, Math::PI * 0.2f, 0.0f); ///< Cube page rotates as if it has ten sides with the camera positioned inside | |
| 124 | -const Vector2 ANGLE_CUSTOM_CUBE_SWING(-Math::PI * 0.45f, -Math::PI * 0.45f); ///< outer cube pages swing 90 degrees as they pan offscreen | |
| 125 | -const Vector2 ANGLE_SPIRAL_SWING_IN(Math::PI * 0.45f, Math::PI * 0.45f); | |
| 126 | -const Vector2 ANGLE_SPIRAL_SWING_OUT(Math::PI * 0.3f, Math::PI * 0.3f); | |
| 127 | - | |
| 128 | -// Depth Effect constants | |
| 129 | -const Vector2 POSITION_EXTENT_DEPTH_EFFECT(0.5f, 2.5f); ///< Extent of X & Y position to alter function exponent. | |
| 130 | -const Vector2 OFFSET_EXTENT_DEPTH_EFFECT(1.0f, 1.0f); ///< Function exponent offset constant. | |
| 131 | -const float POSITION_SCALE_DEPTH_EFFECT(1.5f); ///< Position scaling. | |
| 132 | -const float SCALE_EXTENT_DEPTH_EFFECT(0.5f); ///< Maximum scale factor when Actors scrolled one page away (50% size) | |
| 133 | - | |
| 134 | -// 3D Effect constants | |
| 135 | -const Vector2 ANGLE_SWING_3DEFFECT(Math::PI_2 * 0.75, Math::PI_2 * 0.75f); ///< Angle Swing in radians | |
| 136 | -const Vector2 POSITION_SWING_3DEFFECT(0.25f, 0.25f); ///< Position Swing relative to stage size. | |
| 137 | -const Vector3 ANCHOR_3DEFFECT_STYLE0(-105.0f, 30.0f, -240.0f); ///< Rotation Anchor position for 3D Effect (Style 0) | |
| 138 | -const Vector3 ANCHOR_3DEFFECT_STYLE1(65.0f, -70.0f, -300.0f); ///< Rotation Anchor position for 3D Effect (Style 1) | |
| 139 | - | |
| 140 | - | |
| 141 | 119 | const unsigned int IMAGE_THUMBNAIL_WIDTH = 256; ///< Width of Thumbnail Image in texels |
| 142 | 120 | const unsigned int IMAGE_THUMBNAIL_HEIGHT = 256; ///< Height of Thumbnail Image in texels |
| 143 | 121 | |
| ... | ... | @@ -163,7 +141,7 @@ public: |
| 163 | 141 | : mApplication( application ), |
| 164 | 142 | mView(), |
| 165 | 143 | mScrolling(false), |
| 166 | - mEffectMode(CubeEffect) | |
| 144 | + mEffectMode(PageCarouselEffect) | |
| 167 | 145 | { |
| 168 | 146 | // Connect to the Application's Init and orientation changed signal |
| 169 | 147 | mApplication.InitSignal().Connect(this, &ExampleController::OnInit); |
| ... | ... | @@ -179,8 +157,6 @@ public: |
| 179 | 157 | */ |
| 180 | 158 | void OnInit(Application& app) |
| 181 | 159 | { |
| 182 | - DemoHelper::RequestThemeChange(); | |
| 183 | - | |
| 184 | 160 | Stage stage = Dali::Stage::GetCurrent(); |
| 185 | 161 | stage.KeyEventSignal().Connect(this, &ExampleController::OnKeyEvent); |
| 186 | 162 | |
| ... | ... | @@ -196,11 +172,10 @@ public: |
| 196 | 172 | TOOLBAR_IMAGE, |
| 197 | 173 | "" ); |
| 198 | 174 | |
| 199 | - mEffectIcon[ DepthEffect ] = ResourceImage::New( EFFECT_DEPTH_IMAGE ); | |
| 200 | - mEffectIcon[ CubeEffect ] = ResourceImage::New( EFFECT_INNER_CUBE_IMAGE ); | |
| 201 | 175 | mEffectIcon[ PageCarouselEffect ] = ResourceImage::New( EFFECT_CAROUSEL_IMAGE ); |
| 202 | 176 | mEffectIcon[ PageCubeEffect ] = ResourceImage::New( EFFECT_CAROUSEL_IMAGE ); |
| 203 | 177 | mEffectIcon[ PageSpiralEffect ] = ResourceImage::New( EFFECT_CAROUSEL_IMAGE ); |
| 178 | + mEffectIcon[ PageWaveEffect ] = ResourceImage::New( EFFECT_CAROUSEL_IMAGE ); | |
| 204 | 179 | |
| 205 | 180 | // Create a effect change button. (right of toolbar) |
| 206 | 181 | mEffectChangeButton = Toolkit::PushButton::New(); |
| ... | ... | @@ -274,23 +249,11 @@ private: |
| 274 | 249 | |
| 275 | 250 | // apply new Effect to ScrollView |
| 276 | 251 | ApplyEffectToScrollView(); |
| 277 | - | |
| 278 | - for(ActorIter pageIter = mPages.begin(); pageIter != mPages.end(); ++pageIter) | |
| 252 | + unsigned int pageCount(0); | |
| 253 | + for( std::vector< Actor >::iterator pageIter = mPages.begin(); pageIter != mPages.end(); ++pageIter) | |
| 279 | 254 | { |
| 280 | 255 | Actor page = *pageIter; |
| 281 | - ApplyEffectToPage( page ); | |
| 282 | - | |
| 283 | - unsigned int numChildren = (*pageIter).GetChildCount(); | |
| 284 | - for(unsigned int i=0; i<numChildren; ++i) | |
| 285 | - { | |
| 286 | - Actor image = (*pageIter).GetChildAt(i); | |
| 287 | - | |
| 288 | - // Remove old effect's manual constraints. | |
| 289 | - image.RemoveConstraints(); | |
| 290 | - | |
| 291 | - // Apply new effect's manual constraints. | |
| 292 | - ApplyEffectToActor( image, page ); | |
| 293 | - } | |
| 256 | + ApplyEffectToPage( page, pageCount++ ); | |
| 294 | 257 | } |
| 295 | 258 | } |
| 296 | 259 | |
| ... | ... | @@ -346,83 +309,107 @@ private: |
| 346 | 309 | Stage stage = Stage::GetCurrent(); |
| 347 | 310 | Vector2 stageSize = stage.GetSize(); |
| 348 | 311 | |
| 349 | - switch( mEffectMode ) | |
| 312 | + RulerPtr rulerX = CreateRuler(snap ? stageSize.width : 0.0f); | |
| 313 | + RulerPtr rulerY = new DefaultRuler; | |
| 314 | + rulerX->SetDomain(RulerDomain(0.0f, stageSize.x * PAGE_COLUMNS, !wrap)); | |
| 315 | + rulerY->Disable(); | |
| 316 | + | |
| 317 | + Dali::Path path = Dali::Path::New(); | |
| 318 | + Dali::Property::Array points; | |
| 319 | + points.Resize(3); | |
| 320 | + Dali::Property::Array controlPoints; | |
| 321 | + controlPoints.Resize(4); | |
| 322 | + Vector3 forward; | |
| 323 | + if( mEffectMode == PageCarouselEffect) | |
| 350 | 324 | { |
| 351 | - case DepthEffect: | |
| 352 | - { | |
| 353 | - mScrollViewEffect = ScrollViewDepthEffect::New(); | |
| 354 | - mScrollView.SetScrollSnapDuration(EFFECT_SNAP_DURATION); | |
| 355 | - mScrollView.SetScrollFlickDuration(EFFECT_FLICK_DURATION); | |
| 356 | - mScrollView.SetScrollSnapAlphaFunction(AlphaFunction::EASE_OUT); | |
| 357 | - mScrollView.SetScrollFlickAlphaFunction(AlphaFunction::EASE_OUT); | |
| 358 | - mScrollView.RemoveConstraintsFromChildren(); | |
| 359 | - break; | |
| 360 | - } | |
| 361 | 325 | |
| 362 | - case CubeEffect: | |
| 363 | - { | |
| 364 | - mScrollViewEffect = ScrollViewCubeEffect::New(); | |
| 365 | - mScrollView.SetScrollSnapDuration(EFFECT_SNAP_DURATION); | |
| 366 | - mScrollView.SetScrollFlickDuration(EFFECT_FLICK_DURATION); | |
| 367 | - mScrollView.SetScrollSnapAlphaFunction(AlphaFunction::EASE_OUT_BACK); | |
| 368 | - mScrollView.SetScrollFlickAlphaFunction(AlphaFunction::EASE_OUT_BACK); | |
| 369 | - mScrollView.RemoveConstraintsFromChildren(); | |
| 370 | - break; | |
| 371 | - } | |
| 326 | + points[0] = Vector3( stageSize.x*0.75, 0.0f, -stageSize.x*0.75f); | |
| 327 | + points[1] = Vector3( 0.0f, 0.0f, 0.0f ); | |
| 328 | + points[2] = Vector3( -stageSize.x*0.75f, 0.0f, -stageSize.x*0.75f); | |
| 329 | + path.SetProperty( Path::Property::POINTS, points ); | |
| 372 | 330 | |
| 373 | - case PageCarouselEffect: | |
| 374 | - { | |
| 375 | - mScrollViewEffect = ScrollViewPageCarouselEffect::New(); | |
| 376 | - mScrollView.SetScrollSnapDuration(EFFECT_SNAP_DURATION); | |
| 377 | - mScrollView.SetScrollFlickDuration(EFFECT_FLICK_DURATION); | |
| 378 | - mScrollView.SetScrollSnapAlphaFunction(AlphaFunction::EASE_OUT); | |
| 379 | - mScrollView.SetScrollFlickAlphaFunction(AlphaFunction::EASE_OUT); | |
| 380 | - mScrollView.RemoveConstraintsFromChildren(); | |
| 381 | - break; | |
| 382 | - } | |
| 331 | + controlPoints[0] = Vector3( stageSize.x*0.5f, 0.0f, 0.0f ); | |
| 332 | + controlPoints[1] = Vector3( stageSize.x*0.5f, 0.0f, 0.0f ); | |
| 333 | + controlPoints[2] = Vector3(-stageSize.x*0.5f, 0.0f, 0.0f ); | |
| 334 | + controlPoints[3] = Vector3(-stageSize.x*0.5f, 0.0f, 0.0f ); | |
| 335 | + path.SetProperty( Path::Property::CONTROL_POINTS, controlPoints ); | |
| 383 | 336 | |
| 384 | - case PageCubeEffect: | |
| 385 | - { | |
| 386 | - mScrollViewEffect = ScrollViewPageCubeEffect::New(); | |
| 387 | - mScrollView.SetScrollSnapDuration(EFFECT_SNAP_DURATION); | |
| 388 | - mScrollView.SetScrollFlickDuration(EFFECT_FLICK_DURATION); | |
| 389 | - mScrollView.SetScrollSnapAlphaFunction(AlphaFunction::EASE_OUT); | |
| 390 | - mScrollView.SetScrollFlickAlphaFunction(AlphaFunction::EASE_OUT); | |
| 391 | - mScrollView.RemoveConstraintsFromChildren(); | |
| 392 | - break; | |
| 393 | - } | |
| 337 | + forward = Vector3::ZERO; | |
| 338 | + } | |
| 339 | + else if( mEffectMode == PageCubeEffect) | |
| 340 | + { | |
| 341 | + points[0] = Vector3( stageSize.x*0.5, 0.0f, stageSize.x*0.5f); | |
| 342 | + points[1] = Vector3( 0.0f, 0.0f, 0.0f ); | |
| 343 | + points[2] = Vector3( -stageSize.x*0.5f, 0.0f, stageSize.x*0.5f); | |
| 344 | + path.SetProperty( Path::Property::POINTS, points ); | |
| 345 | + | |
| 346 | + controlPoints[0] = Vector3( stageSize.x*0.5f, 0.0f, stageSize.x*0.3f ); | |
| 347 | + controlPoints[1] = Vector3( stageSize.x*0.3f, 0.0f, 0.0f ); | |
| 348 | + controlPoints[2] = Vector3(-stageSize.x*0.3f, 0.0f, 0.0f ); | |
| 349 | + controlPoints[3] = Vector3(-stageSize.x*0.5f, 0.0f, stageSize.x*0.3f ); | |
| 350 | + path.SetProperty( Path::Property::CONTROL_POINTS, controlPoints ); | |
| 351 | + | |
| 352 | + forward = Vector3(-1.0f,0.0f,0.0f); | |
| 353 | + } | |
| 354 | + else if( mEffectMode == PageSpiralEffect) | |
| 355 | + { | |
| 356 | + points[0] = Vector3( stageSize.x*0.5, 0.0f, -stageSize.x*0.5f); | |
| 357 | + points[1] = Vector3( 0.0f, 0.0f, 0.0f ); | |
| 358 | + points[2] = Vector3( -stageSize.x*0.5f, 0.0f, -stageSize.x*0.5f); | |
| 359 | + path.SetProperty( Path::Property::POINTS, points ); | |
| 360 | + | |
| 361 | + controlPoints[0] = Vector3( stageSize.x*0.5f, 0.0f, 0.0f ); | |
| 362 | + controlPoints[1] = Vector3( stageSize.x*0.5f, 0.0f, 0.0f ); | |
| 363 | + controlPoints[2] = Vector3(-stageSize.x*0.5f, 0.0f, 0.0f ); | |
| 364 | + controlPoints[3] = Vector3(-stageSize.x*0.5f, 0.0f, 0.0f ); | |
| 365 | + path.SetProperty( Path::Property::CONTROL_POINTS, controlPoints ); | |
| 366 | + | |
| 367 | + forward = Vector3(-1.0f,0.0f,0.0f); | |
| 368 | + } | |
| 369 | + else if( mEffectMode == PageWaveEffect) | |
| 370 | + { | |
| 371 | + points[0] = Vector3( stageSize.x, 0.0f, -stageSize.x); | |
| 372 | + points[1] = Vector3( 0.0f, 0.0f, 0.0f ); | |
| 373 | + points[2] = Vector3( -stageSize.x, 0.0f, -stageSize.x); | |
| 374 | + path.SetProperty( Path::Property::POINTS, points ); | |
| 375 | + | |
| 376 | + controlPoints[0] = Vector3( 0.0f, 0.0f, -stageSize.x ); | |
| 377 | + controlPoints[1] = Vector3( stageSize.x*0.5f, 0.0f, 0.0f ); | |
| 378 | + controlPoints[2] = Vector3( -stageSize.x*0.5f, 0.0f, 0.0f); | |
| 379 | + controlPoints[3] = Vector3(0.0f, 0.0f,-stageSize.x ); | |
| 380 | + path.SetProperty( Path::Property::CONTROL_POINTS, controlPoints ); | |
| 381 | + | |
| 382 | + forward = Vector3(-1.0f,0.0f,0.0f); | |
| 383 | + } | |
| 394 | 384 | |
| 395 | - case PageSpiralEffect: | |
| 396 | - { | |
| 397 | - mScrollViewEffect = ScrollViewPageSpiralEffect::New(); | |
| 398 | - mScrollView.SetScrollSnapDuration(EFFECT_SNAP_DURATION); | |
| 399 | - mScrollView.SetScrollFlickDuration(EFFECT_FLICK_DURATION); | |
| 400 | - mScrollView.SetScrollSnapAlphaFunction(AlphaFunction::EASE_OUT); | |
| 401 | - mScrollView.SetScrollFlickAlphaFunction(AlphaFunction::EASE_OUT); | |
| 402 | - mScrollView.RemoveConstraintsFromChildren(); | |
| 403 | - break; | |
| 404 | - } | |
| 385 | + mScrollViewEffect = ScrollViewPagePathEffect::New(path, forward,Toolkit::ScrollView::Property::SCROLL_FINAL_X, Vector3(stageSize.x,stageSize.y,0.0f),PAGE_COLUMNS); | |
| 386 | + mScrollView.SetScrollSnapDuration(EFFECT_SNAP_DURATION); | |
| 387 | + mScrollView.SetScrollFlickDuration(EFFECT_FLICK_DURATION); | |
| 388 | + mScrollView.SetScrollSnapAlphaFunction(AlphaFunction::EASE_OUT); | |
| 389 | + mScrollView.SetScrollFlickAlphaFunction(AlphaFunction::EASE_OUT); | |
| 390 | + mScrollView.RemoveConstraintsFromChildren(); | |
| 405 | 391 | |
| 406 | - default: | |
| 407 | - { | |
| 408 | - break; | |
| 409 | - } | |
| 392 | + rulerX = CreateRuler(snap ? stageSize.width * 0.5f : 0.0f); | |
| 393 | + if( wrap ) | |
| 394 | + { | |
| 395 | + rulerX->SetDomain(RulerDomain(0.0f, stageSize.x * 0.5f * PAGE_COLUMNS, !wrap)); | |
| 396 | + } | |
| 397 | + else | |
| 398 | + { | |
| 399 | + rulerX->SetDomain(RulerDomain(0.0f, stageSize.x*0.5f* (PAGE_COLUMNS+1), !wrap)); | |
| 410 | 400 | } |
| 411 | 401 | |
| 402 | + unsigned int currentPage = mScrollView.GetCurrentPage(); | |
| 412 | 403 | if( mScrollViewEffect ) |
| 413 | 404 | { |
| 414 | 405 | mScrollView.ApplyEffect(mScrollViewEffect); |
| 415 | 406 | } |
| 416 | 407 | |
| 417 | 408 | mScrollView.SetWrapMode(wrap); |
| 418 | - | |
| 419 | - RulerPtr rulerX = CreateRuler(snap ? stageSize.width : 0.0f); | |
| 420 | - RulerPtr rulerY = new DefaultRuler; | |
| 421 | - rulerX->SetDomain(RulerDomain(0.0f, stageSize.x * PAGE_COLUMNS, !wrap)); | |
| 422 | - rulerY->Disable(); | |
| 423 | - | |
| 424 | 409 | mScrollView.SetRulerX( rulerX ); |
| 425 | 410 | mScrollView.SetRulerY( rulerY ); |
| 411 | + | |
| 412 | + mScrollView.ScrollTo( currentPage, 0.0f ); | |
| 426 | 413 | } |
| 427 | 414 | |
| 428 | 415 | /** |
| ... | ... | @@ -449,110 +436,16 @@ private: |
| 449 | 436 | * |
| 450 | 437 | * @param[in] page The page Actor to apply effect to. |
| 451 | 438 | */ |
| 452 | - void ApplyEffectToPage(Actor page) | |
| 439 | + void ApplyEffectToPage(Actor page, unsigned int pageOrder ) | |
| 453 | 440 | { |
| 454 | 441 | page.RemoveConstraints(); |
| 455 | 442 | page.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); |
| 456 | 443 | |
| 457 | - switch( mEffectMode ) | |
| 458 | - { | |
| 459 | - case PageCarouselEffect: | |
| 460 | - { | |
| 461 | - ScrollViewPageCarouselEffect effect = ScrollViewPageCarouselEffect::DownCast( mScrollViewEffect ); | |
| 462 | - effect.ApplyToPage( page ); | |
| 463 | - break; | |
| 464 | - } | |
| 465 | - | |
| 466 | - case PageCubeEffect: | |
| 467 | - { | |
| 468 | - ScrollViewPageCubeEffect effect = ScrollViewPageCubeEffect::DownCast( mScrollViewEffect ); | |
| 469 | - effect.ApplyToPage( page, ANGLE_SWING_3DEFFECT ); | |
| 470 | - break; | |
| 471 | - } | |
| 472 | - | |
| 473 | - case PageSpiralEffect: | |
| 474 | - { | |
| 475 | - ScrollViewPageSpiralEffect effect = ScrollViewPageSpiralEffect::DownCast( mScrollViewEffect ); | |
| 476 | - effect.ApplyToPage( page, ANGLE_SWING_3DEFFECT ); | |
| 477 | - break; | |
| 478 | - } | |
| 479 | - | |
| 480 | - default: | |
| 481 | - { | |
| 482 | - break; | |
| 483 | - } | |
| 484 | - } | |
| 444 | + ScrollViewPagePathEffect effect = ScrollViewPagePathEffect::DownCast( mScrollViewEffect ); | |
| 445 | + effect.ApplyToPage( page, pageOrder ); | |
| 485 | 446 | } |
| 486 | 447 | |
| 487 | 448 | /** |
| 488 | - * [Actor] | |
| 489 | - * Applies effect to child which resides in page (which in turn resides in scrollview) | |
| 490 | - * | |
| 491 | - * @note Page is typically the Parent of child, although in | |
| 492 | - * some scenarios Page is simply a container which has a child as | |
| 493 | - * a descendent. | |
| 494 | - * | |
| 495 | - * @param[in] child The child actor to apply effect to | |
| 496 | - * @param[in] page The page which this child is inside | |
| 497 | - */ | |
| 498 | - void ApplyEffectToActor( Actor child, Actor page ) | |
| 499 | - { | |
| 500 | - switch( mEffectMode ) | |
| 501 | - { | |
| 502 | - case DepthEffect: | |
| 503 | - { | |
| 504 | - ApplyDepthEffectToActor( child ); | |
| 505 | - break; | |
| 506 | - } | |
| 507 | - | |
| 508 | - case CubeEffect: | |
| 509 | - { | |
| 510 | - ApplyCubeEffectToActor( child ); | |
| 511 | - break; | |
| 512 | - } | |
| 513 | - | |
| 514 | - default: | |
| 515 | - { | |
| 516 | - break; | |
| 517 | - } | |
| 518 | - } | |
| 519 | - } | |
| 520 | - | |
| 521 | - /** | |
| 522 | - * Applies depth effect to the child which resides in page (which in turn resides in scrollview) | |
| 523 | - * | |
| 524 | - * @param[in] child The child actor to apply depth effect to | |
| 525 | - */ | |
| 526 | - void ApplyDepthEffectToActor( Actor child ) | |
| 527 | - { | |
| 528 | - ScrollViewDepthEffect depthEffect = ScrollViewDepthEffect::DownCast(mScrollViewEffect); | |
| 529 | - depthEffect.ApplyToActor( child, | |
| 530 | - POSITION_EXTENT_DEPTH_EFFECT, | |
| 531 | - OFFSET_EXTENT_DEPTH_EFFECT, | |
| 532 | - POSITION_SCALE_DEPTH_EFFECT, | |
| 533 | - SCALE_EXTENT_DEPTH_EFFECT ); | |
| 534 | - } | |
| 535 | - | |
| 536 | - void ApplyCubeEffectToActor( Actor child ) | |
| 537 | - { | |
| 538 | - Vector3 anchor; | |
| 539 | - if(rand()&1) | |
| 540 | - { | |
| 541 | - anchor = ANCHOR_3DEFFECT_STYLE0; | |
| 542 | - } | |
| 543 | - else | |
| 544 | - { | |
| 545 | - anchor = ANCHOR_3DEFFECT_STYLE1; | |
| 546 | - } | |
| 547 | - | |
| 548 | - ScrollViewCubeEffect cubeEffect = ScrollViewCubeEffect::DownCast(mScrollViewEffect); | |
| 549 | - cubeEffect.ApplyToActor( child, | |
| 550 | - anchor, | |
| 551 | - ANGLE_SWING_3DEFFECT, | |
| 552 | - POSITION_SWING_3DEFFECT * Vector2(Stage::GetCurrent().GetSize())); | |
| 553 | - } | |
| 554 | - | |
| 555 | - /** | |
| 556 | 449 | * Creates an Image (Helper) |
| 557 | 450 | * |
| 558 | 451 | * @param[in] filename the path of the image. |
| ... | ... | @@ -577,7 +470,7 @@ private: |
| 577 | 470 | * note this state (mScrolling = true) |
| 578 | 471 | * @param[in] position Current Scroll Position |
| 579 | 472 | */ |
| 580 | - void OnScrollStarted( const Vector3& position ) | |
| 473 | + void OnScrollStarted( const Vector2& position ) | |
| 581 | 474 | { |
| 582 | 475 | mScrolling = true; |
| 583 | 476 | } |
| ... | ... | @@ -587,7 +480,7 @@ private: |
| 587 | 480 | * note this state (mScrolling = false) |
| 588 | 481 | * @param[in] position Current Scroll Position |
| 589 | 482 | */ |
| 590 | - void OnScrollCompleted( const Vector3& position ) | |
| 483 | + void OnScrollCompleted( const Vector2& position ) | |
| 591 | 484 | { |
| 592 | 485 | mScrolling = false; |
| 593 | 486 | } |
| ... | ... | @@ -666,18 +559,17 @@ private: |
| 666 | 559 | ScrollView mScrollView; ///< ScrollView UI Component |
| 667 | 560 | bool mScrolling; ///< ScrollView scrolling state (true = scrolling, false = stationary) |
| 668 | 561 | ScrollViewEffect mScrollViewEffect; ///< ScrollView Effect instance. |
| 669 | - ActorContainer mPages; ///< Keeps track of all the pages for applying effects. | |
| 562 | + std::vector< Actor > mPages; ///< Keeps track of all the pages for applying effects. | |
| 670 | 563 | |
| 671 | 564 | /** |
| 672 | 565 | * Enumeration of different effects this scrollview can operate under. |
| 673 | 566 | */ |
| 674 | 567 | enum EffectMode |
| 675 | 568 | { |
| 676 | - DepthEffect, ///< Depth Effect | |
| 677 | - CubeEffect, ///< Cube effect | |
| 678 | 569 | PageCarouselEffect, ///< Page carousel effect |
| 679 | 570 | PageCubeEffect, ///< Page cube effect |
| 680 | 571 | PageSpiralEffect, ///< Page spiral effect |
| 572 | + PageWaveEffect, ///< Page wave effect | |
| 681 | 573 | |
| 682 | 574 | Total |
| 683 | 575 | }; |
| ... | ... | @@ -690,7 +582,7 @@ private: |
| 690 | 582 | |
| 691 | 583 | int main(int argc, char **argv) |
| 692 | 584 | { |
| 693 | - Application app = Application::New(&argc, &argv); | |
| 585 | + Application app = Application::New(&argc, &argv, DALI_DEMO_THEME_PATH); | |
| 694 | 586 | ExampleController test(app); |
| 695 | 587 | app.MainLoop(); |
| 696 | 588 | return 0; | ... | ... |
examples/shadow-bone-lighting/shadow-bone-lighting-example.cpp
| ... | ... | @@ -20,6 +20,8 @@ |
| 20 | 20 | |
| 21 | 21 | #include <dali/dali.h> |
| 22 | 22 | #include <dali-toolkit/dali-toolkit.h> |
| 23 | +#include <dali-toolkit/devel-api/controls/shadow-view/shadow-view.h> | |
| 24 | + | |
| 23 | 25 | #include <iostream> |
| 24 | 26 | |
| 25 | 27 | using namespace Dali; |
| ... | ... | @@ -120,8 +122,6 @@ public: |
| 120 | 122 | */ |
| 121 | 123 | void Create(Application& app) |
| 122 | 124 | { |
| 123 | - DemoHelper::RequestThemeChange(); | |
| 124 | - | |
| 125 | 125 | srand(0); // Want repeatable path |
| 126 | 126 | |
| 127 | 127 | Stage::GetCurrent().KeyEventSignal().Connect(this, &TestApp::OnKeyEvent); |
| ... | ... | @@ -501,7 +501,7 @@ RunTest(Application& app) |
| 501 | 501 | int |
| 502 | 502 | main(int argc, char **argv) |
| 503 | 503 | { |
| 504 | - Application app = Application::New(&argc, &argv); | |
| 504 | + Application app = Application::New(&argc, &argv, DALI_DEMO_THEME_PATH); | |
| 505 | 505 | |
| 506 | 506 | RunTest(app); |
| 507 | 507 | ... | ... |
examples/size-negotiation/size-negotiation-example.cpp
| ... | ... | @@ -18,6 +18,7 @@ |
| 18 | 18 | #include "shared/view.h" |
| 19 | 19 | #include <dali/dali.h> |
| 20 | 20 | #include <dali-toolkit/dali-toolkit.h> |
| 21 | +#include <dali-toolkit/devel-api/controls/popup/popup.h> | |
| 21 | 22 | |
| 22 | 23 | using namespace Dali; |
| 23 | 24 | |
| ... | ... | @@ -157,8 +158,6 @@ public: |
| 157 | 158 | { |
| 158 | 159 | // The Init signal is received once (only) during the Application lifetime |
| 159 | 160 | |
| 160 | - DemoHelper::RequestThemeChange(); | |
| 161 | - | |
| 162 | 161 | Stage stage = Stage::GetCurrent(); |
| 163 | 162 | |
| 164 | 163 | // Respond to key events |
| ... | ... | @@ -193,17 +192,13 @@ public: |
| 193 | 192 | mItemView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); |
| 194 | 193 | |
| 195 | 194 | // Use a grid layout for tests |
| 196 | - Toolkit::GridLayoutPtr gridLayout = Toolkit::GridLayout::New(); | |
| 197 | - gridLayout->SetNumberOfColumns( 2 ); | |
| 198 | - gridLayout->SetTopMargin( DP(TOOLBAR_HEIGHT) + DP(20.0f) ); | |
| 199 | - gridLayout->SetBottomMargin( DP(100.0f) ); | |
| 200 | - gridLayout->SetRowSpacing( DP(20.0f) ); | |
| 201 | - mItemView.AddLayout( *gridLayout ); | |
| 202 | - | |
| 203 | 195 | Vector2 stageSize = stage.GetSize(); |
| 204 | - float layoutWidth = Toolkit::IsHorizontal( gridLayout->GetOrientation() ) ? stageSize.height : stageSize.width; | |
| 205 | - float gridItemSize = ( layoutWidth / gridLayout->GetNumberOfColumns() ) * 0.5f; | |
| 206 | - gridLayout->SetScrollSpeedFactor( gridLayout->GetNumberOfColumns() / gridItemSize * 0.5f ); | |
| 196 | + Toolkit::ItemLayoutPtr gridLayout = Toolkit::DefaultItemLayout::New( Toolkit::DefaultItemLayout::LIST ); | |
| 197 | + Vector3 itemSize; | |
| 198 | + gridLayout->GetItemSize( 0, Vector3( stageSize ), itemSize ); | |
| 199 | + itemSize.height = stageSize.y / 10; | |
| 200 | + gridLayout->SetItemSize( itemSize ); | |
| 201 | + mItemView.AddLayout( *gridLayout ); | |
| 207 | 202 | |
| 208 | 203 | mItemView.ActivateLayout( 0, Vector3(stageSize.x, stageSize.y, stageSize.x), 0.0f ); |
| 209 | 204 | |
| ... | ... | @@ -1302,7 +1297,7 @@ void RunTest( Application& application ) |
| 1302 | 1297 | // |
| 1303 | 1298 | int main( int argc, char **argv ) |
| 1304 | 1299 | { |
| 1305 | - Application application = Application::New( &argc, &argv ); | |
| 1300 | + Application application = Application::New( &argc, &argv, DALI_DEMO_THEME_PATH ); | |
| 1306 | 1301 | |
| 1307 | 1302 | RunTest( application ); |
| 1308 | 1303 | ... | ... |
examples/text-field/text-field-example.cpp
| ... | ... | @@ -22,7 +22,7 @@ |
| 22 | 22 | |
| 23 | 23 | // EXTERNAL INCLUDES |
| 24 | 24 | #include <dali-toolkit/dali-toolkit.h> |
| 25 | -#include <dali/public-api/text-abstraction/text-abstraction.h> | |
| 25 | +#include <iostream> | |
| 26 | 26 | |
| 27 | 27 | // INTERNAL INCLUDES |
| 28 | 28 | #include "shared/multi-language-strings.h" |
| ... | ... | @@ -96,8 +96,6 @@ public: |
| 96 | 96 | */ |
| 97 | 97 | void Create( Application& application ) |
| 98 | 98 | { |
| 99 | - DemoHelper::RequestThemeChange(); | |
| 100 | - | |
| 101 | 99 | Stage stage = Stage::GetCurrent(); |
| 102 | 100 | |
| 103 | 101 | mTapGestureDetector = TapGestureDetector::New(); |
| ... | ... | @@ -239,7 +237,7 @@ void RunTest( Application& application ) |
| 239 | 237 | /** Entry point for Linux & Tizen applications */ |
| 240 | 238 | int main( int argc, char **argv ) |
| 241 | 239 | { |
| 242 | - Application application = Application::New( &argc, &argv ); | |
| 240 | + Application application = Application::New( &argc, &argv, DALI_DEMO_THEME_PATH ); | |
| 243 | 241 | |
| 244 | 242 | RunTest( application ); |
| 245 | 243 | ... | ... |
examples/text-label-emojis/text-label-emojis.cpp
| ... | ... | @@ -17,7 +17,6 @@ |
| 17 | 17 | |
| 18 | 18 | // EXTERNAL INCLUDES |
| 19 | 19 | #include <dali-toolkit/dali-toolkit.h> |
| 20 | -#include <dali/public-api/text-abstraction/text-abstraction.h> | |
| 21 | 20 | #include <iostream> |
| 22 | 21 | |
| 23 | 22 | // INTERNAL INCLUDES |
| ... | ... | @@ -143,7 +142,7 @@ void RunTest( Application& application ) |
| 143 | 142 | // |
| 144 | 143 | int main( int argc, char **argv ) |
| 145 | 144 | { |
| 146 | - Application application = Application::New( &argc, &argv ); | |
| 145 | + Application application = Application::New( &argc, &argv, DALI_DEMO_THEME_PATH ); | |
| 147 | 146 | |
| 148 | 147 | RunTest( application ); |
| 149 | 148 | ... | ... |
examples/text-label-multi-language/text-label-multi-language-example.cpp
| ... | ... | @@ -22,7 +22,6 @@ |
| 22 | 22 | |
| 23 | 23 | // EXTERNAL INCLUDES |
| 24 | 24 | #include <dali-toolkit/dali-toolkit.h> |
| 25 | -#include <dali/public-api/text-abstraction/text-abstraction.h> | |
| 26 | 25 | |
| 27 | 26 | // INTERNAL INCLUDES |
| 28 | 27 | #include "shared/multi-language-strings.h" |
| ... | ... | @@ -57,8 +56,6 @@ public: |
| 57 | 56 | */ |
| 58 | 57 | void Create( Application& application ) |
| 59 | 58 | { |
| 60 | - DemoHelper::RequestThemeChange(); | |
| 61 | - | |
| 62 | 59 | Stage stage = Stage::GetCurrent(); |
| 63 | 60 | |
| 64 | 61 | stage.KeyEventSignal().Connect(this, &TextLabelMultiLanguageExample::OnKeyEvent); |
| ... | ... | @@ -147,7 +144,7 @@ void RunTest( Application& application ) |
| 147 | 144 | /** Entry point for Linux & Tizen applications */ |
| 148 | 145 | int main( int argc, char **argv ) |
| 149 | 146 | { |
| 150 | - Application application = Application::New( &argc, &argv ); | |
| 147 | + Application application = Application::New( &argc, &argv, DALI_DEMO_THEME_PATH ); | |
| 151 | 148 | |
| 152 | 149 | RunTest( application ); |
| 153 | 150 | ... | ... |
examples/text-label/text-label-example.cpp
| ... | ... | @@ -22,7 +22,7 @@ |
| 22 | 22 | |
| 23 | 23 | // EXTERNAL INCLUDES |
| 24 | 24 | #include <dali-toolkit/dali-toolkit.h> |
| 25 | -#include <dali/public-api/text-abstraction/text-abstraction.h> | |
| 25 | +#include <iostream> | |
| 26 | 26 | |
| 27 | 27 | // INTERNAL INCLUDES |
| 28 | 28 | #include "shared/multi-language-strings.h" |
| ... | ... | @@ -97,8 +97,6 @@ public: |
| 97 | 97 | */ |
| 98 | 98 | void Create( Application& application ) |
| 99 | 99 | { |
| 100 | - DemoHelper::RequestThemeChange(); | |
| 101 | - | |
| 102 | 100 | Stage stage = Stage::GetCurrent(); |
| 103 | 101 | |
| 104 | 102 | stage.KeyEventSignal().Connect(this, &TextLabelExample::OnKeyEvent); |
| ... | ... | @@ -285,7 +283,7 @@ void RunTest( Application& application ) |
| 285 | 283 | /** Entry point for Linux & Tizen applications */ |
| 286 | 284 | int main( int argc, char **argv ) |
| 287 | 285 | { |
| 288 | - Application application = Application::New( &argc, &argv ); | |
| 286 | + Application application = Application::New( &argc, &argv, DALI_DEMO_THEME_PATH ); | |
| 289 | 287 | |
| 290 | 288 | RunTest( application ); |
| 291 | 289 | ... | ... |
examples/text-message-field/text-message-field-example.cpp
| ... | ... | @@ -22,7 +22,6 @@ |
| 22 | 22 | |
| 23 | 23 | // EXTERNAL INCLUDES |
| 24 | 24 | #include <dali-toolkit/dali-toolkit.h> |
| 25 | -#include <dali/public-api/text-abstraction/text-abstraction.h> | |
| 26 | 25 | |
| 27 | 26 | using namespace Dali; |
| 28 | 27 | using namespace Dali::Toolkit; |
| ... | ... | @@ -159,7 +158,7 @@ void RunTest( Application& application ) |
| 159 | 158 | /** Entry point for Linux & Tizen applications */ |
| 160 | 159 | int main( int argc, char **argv ) |
| 161 | 160 | { |
| 162 | - Application application = Application::New( &argc, &argv ); | |
| 161 | + Application application = Application::New( &argc, &argv, DALI_DEMO_THEME_PATH ); | |
| 163 | 162 | |
| 164 | 163 | RunTest( application ); |
| 165 | 164 | ... | ... |
packaging/com.samsung.dali-demo.spec
resources/scripts/navigation.json deleted
| 1 | -/* | |
| 2 | - * Copyright (c) 2014 Samsung Electronics Co., Ltd. | |
| 3 | - * | |
| 4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 5 | - * you may not use this file except in compliance with the License. | |
| 6 | - * You may obtain a copy of the License at | |
| 7 | - * | |
| 8 | - * http://www.apache.org/licenses/LICENSE-2.0 | |
| 9 | - * | |
| 10 | - * Unless required by applicable law or agreed to in writing, software | |
| 11 | - * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 | - * See the License for the specific language governing permissions and | |
| 14 | - * limitations under the License. | |
| 15 | - * | |
| 16 | - */ | |
| 17 | -{ | |
| 18 | - "stage": [{ | |
| 19 | - "type": "NavigationControl", | |
| 20 | - "name": "navigation", | |
| 21 | - "parent-origin": "CENTER", | |
| 22 | - "signals": [{ | |
| 23 | - "name": "on-stage", | |
| 24 | - "actor": "navigation", | |
| 25 | - "action": "push", | |
| 26 | - "parameters": ["page1"] | |
| 27 | - }], | |
| 28 | - "actors": [{ | |
| 29 | - "type": "Page", | |
| 30 | - "name": "page1", | |
| 31 | - "title": "title", | |
| 32 | - "sub-title": "sub title", | |
| 33 | - "actors": [{ | |
| 34 | - "type": "TextLabel", // styles can be additive | |
| 35 | - "parent-origin": [0.5, 0.5, 0], | |
| 36 | - "anchor-point": [0.5, 0.5, 0], | |
| 37 | - "size": [200, 200, 1], | |
| 38 | - "text": "Touch to push new item!", | |
| 39 | - "signals": [{ | |
| 40 | - "name": "touched", | |
| 41 | - "actor": "navigation", | |
| 42 | - "action": "push", | |
| 43 | - "parameters": ["page2"] | |
| 44 | - }] | |
| 45 | - }] | |
| 46 | - }, { | |
| 47 | - "type": "Page", | |
| 48 | - "name": "page2", | |
| 49 | - "actors": [{ | |
| 50 | - "type": "TextLabel", // styles can be additive | |
| 51 | - "parent-origin": [0.5, 0.5, 0.5], | |
| 52 | - "anchor-point": [0.5, 0.5, 0.5], | |
| 53 | - "size": [200, 200, 1], | |
| 54 | - "text": "Hello World!" | |
| 55 | - }, { | |
| 56 | - "type": "TextLabel", // styles can be additive | |
| 57 | - "parent-origin": [0.0, 0.0, 0.5], | |
| 58 | - "anchor-point": [0.0, 0.0, 0.5], | |
| 59 | - "size": [200, 200, 1], | |
| 60 | - "text": "Back", | |
| 61 | - "signals": [{ | |
| 62 | - "name": "touched", | |
| 63 | - "actor": "navigation", | |
| 64 | - "action": "pop" | |
| 65 | - }] | |
| 66 | - }, { | |
| 67 | - "type": "TextLabel", // styles can be additive | |
| 68 | - "parent-origin": [1.0, 1.0, 0.5], | |
| 69 | - "anchor-point": [1.0, 1.0, 0.5], | |
| 70 | - "size": [200, 200, 1], | |
| 71 | - "text": "Quit", | |
| 72 | - "signals": [{ | |
| 73 | - "name": "touched", | |
| 74 | - "action": "quit" | |
| 75 | - }] | |
| 76 | - }] | |
| 77 | - }] | |
| 78 | - }] | |
| 79 | -} |
shared/view.h
| ... | ... | @@ -19,6 +19,9 @@ |
| 19 | 19 | */ |
| 20 | 20 | |
| 21 | 21 | #include <dali-toolkit/dali-toolkit.h> |
| 22 | +#include <dali-toolkit/devel-api/controls/tool-bar/tool-bar.h> | |
| 23 | +#include <dali-toolkit/devel-api/styling/style-manager.h> | |
| 24 | + | |
| 22 | 25 | |
| 23 | 26 | namespace DemoHelper |
| 24 | 27 | { |
| ... | ... | @@ -50,13 +53,6 @@ const float DEFAULT_TEXT_STYLE_POINT_SIZE( 8.0f ); |
| 50 | 53 | const Dali::Toolkit::Alignment::Padding DEFAULT_PLAY_PADDING(12.0f, 12.0f, 12.0f, 12.0f); |
| 51 | 54 | const Dali::Toolkit::Alignment::Padding DEFAULT_MODE_SWITCH_PADDING(8.0f, 8.0f, 8.0f, 8.0f); |
| 52 | 55 | |
| 53 | -void RequestThemeChange() | |
| 54 | -{ | |
| 55 | - // Provide the stylesheet | |
| 56 | - Dali::Toolkit::StyleManager styleManager = Dali::Toolkit::StyleManager::Get(); | |
| 57 | - styleManager.RequestThemeChange( DALI_DEMO_THEME_PATH ); | |
| 58 | -} | |
| 59 | - | |
| 60 | 56 | float ScalePointSize(int pointSize) |
| 61 | 57 | { |
| 62 | 58 | Dali::Vector2 dpi = Dali::Stage::GetCurrent().GetDpi(); |
| ... | ... | @@ -83,16 +79,12 @@ Dali::Layer CreateToolbar( Dali::Toolkit::ToolBar& toolBar, |
| 83 | 79 | |
| 84 | 80 | // Tool bar |
| 85 | 81 | Dali::Image image = Dali::ResourceImage::New( toolbarImagePath ); |
| 86 | - Dali::ImageActor toolBarBackground = Dali::ImageActor::New( image ); | |
| 87 | - toolBarBackground.SetName( "TOOLBAR_BACKGROUND" ); | |
| 88 | - toolBarBackground.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS ); | |
| 89 | 82 | toolBar = Dali::Toolkit::ToolBar::New(); |
| 90 | 83 | toolBar.SetName( "TOOLBAR" ); |
| 91 | - toolBar.SetBackground( toolBarBackground ); | |
| 84 | + toolBar.SetBackgroundImage( image ); | |
| 92 | 85 | toolBar.SetParentOrigin( Dali::ParentOrigin::TOP_CENTER ); |
| 93 | 86 | toolBar.SetAnchorPoint( Dali::AnchorPoint::TOP_CENTER ); |
| 94 | 87 | toolBar.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS ); |
| 95 | - toolBarBackground.SetSortModifier(1.0f); | |
| 96 | 88 | |
| 97 | 89 | // Add the tool bar to the too bar layer. |
| 98 | 90 | toolBarLayer.Add( toolBar ); | ... | ... |