X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=examples%2Fgradients%2Fgradients-example.cpp;h=ccd7a6705c3e7b5687374db5555993249de53128;hb=refs%2Fchanges%2F70%2F80670%2F1;hp=6ea9b15749980d026afb085046e07db31c825573;hpb=f1102b629cb64e9d96ebeaed0f1bc070e539e311;p=platform%2Fcore%2Fuifw%2Fdali-demo.git diff --git a/examples/gradients/gradients-example.cpp b/examples/gradients/gradients-example.cpp index 6ea9b15..ccd7a67 100644 --- a/examples/gradients/gradients-example.cpp +++ b/examples/gradients/gradients-example.cpp @@ -27,9 +27,9 @@ namespace { const char * const APPLICATION_TITLE( "Color Gradients" ); -const char * const TOOLBAR_IMAGE( DALI_IMAGE_DIR "top-bar.png" ); -const char * const CHANGE_ICON( DALI_IMAGE_DIR "icon-change.png" ); -const char * const CHANGE_ICON_SELECTED( DALI_IMAGE_DIR "icon-change-selected.png" ); +const char * const TOOLBAR_IMAGE( DEMO_IMAGE_DIR "top-bar.png" ); +const char * const CHANGE_ICON( DEMO_IMAGE_DIR "icon-change.png" ); +const char * const CHANGE_ICON_SELECTED( DEMO_IMAGE_DIR "icon-change-selected.png" ); } // This example shows how to render color gradients @@ -79,21 +79,23 @@ public: // ---- Gradient for background - mGradientMap.Insert("renderer-type", "gradient-renderer"); + mGradientMap.Insert("rendererType", "GRADIENT"); + Property::Array stopOffsets; stopOffsets.PushBack( 0.0f ); stopOffsets.PushBack( 0.3f ); stopOffsets.PushBack( 0.6f ); stopOffsets.PushBack( 0.8f ); - stopOffsets.PushBack( 1.f ); - mGradientMap.Insert("gradient-stop-offset", stopOffsets); + stopOffsets.PushBack( 1.0f ); + mGradientMap.Insert("stopOffset", stopOffsets ); + Property::Array stopColors; stopColors.PushBack( Vector4( 129.f, 198.f, 193.f, 255.f )/255.f ); stopColors.PushBack( Vector4( 196.f, 198.f, 71.f, 122.f )/255.f ); stopColors.PushBack( Vector4( 214.f, 37.f, 139.f, 191.f )/255.f ); stopColors.PushBack( Vector4( 129.f, 198.f, 193.f, 150.f )/255.f ); stopColors.PushBack( Color::YELLOW ); - mGradientMap.Insert("gradient-stop-color", stopColors); + mGradientMap.Insert("stopColor", stopColors); OnChangeIconClicked( changeButton ); } @@ -106,30 +108,30 @@ public: { case 0: // linear gradient with units as objectBoundingBox { - gradientMap.Insert("gradient-start-position", Vector2( 0.5f, 0.5f )); - gradientMap.Insert("gradient-end-position", Vector2( -0.5f, -0.5f )); + gradientMap.Insert("startPosition", Vector2( 0.5f, 0.5f )); + gradientMap.Insert("endPosition", Vector2( -0.5f, -0.5f )); break; } case 1: // linear gradient with units as userSpaceOnUse { Vector2 halfStageSize = Stage::GetCurrent().GetSize()*0.5f; - gradientMap.Insert("gradient-start-position", halfStageSize); - gradientMap.Insert("gradient-end-position", -halfStageSize ); - gradientMap.Insert("gradient-units", "user-space"); + gradientMap.Insert("startPosition", halfStageSize); + gradientMap.Insert("endPosition", -halfStageSize ); + gradientMap.Insert("units", "USER_SPACE"); break; } case 2: // radial gradient with units as objectBoundingBox { - gradientMap.Insert("gradient-center", Vector2(0.5f, 0.5f)); - gradientMap.Insert("gradient-radius", 1.414f); + gradientMap.Insert("center", Vector2(0.5f, 0.5f)); + gradientMap.Insert("radius", 1.414f); break; } default: // radial gradient with units as userSpaceOnUse { Vector2 stageSize = Stage::GetCurrent().GetSize(); - gradientMap.Insert("gradient-center", stageSize*0.5f); - gradientMap.Insert("gradient-radius", stageSize.Length()); - gradientMap.Insert("gradient-units", "user-space"); + gradientMap.Insert("center", stageSize*0.5f); + gradientMap.Insert("radius", stageSize.Length()); + gradientMap.Insert("units", "USER_SPACE"); break; } } @@ -141,13 +143,6 @@ public: return true; } - bool OnTouch( Actor actor, const TouchEvent& touch ) - { - // quit the application - mApplication.Quit(); - return true; - } - void OnKeyEvent(const KeyEvent& event) { if(event.state == KeyEvent::Down) @@ -176,7 +171,7 @@ void RunTest( Application& application ) // Entry point for Linux & Tizen applications // -int main( int argc, char **argv ) +int DALI_EXPORT_API main( int argc, char **argv ) { Application application = Application::New( &argc, &argv );