Merge branch 'devel/master' into tizen
[platform/core/uifw/dali-demo.git] / examples / image-view-svg / image-view-svg-example.cpp
index da06f87..a264ca5 100644 (file)
@@ -16,8 +16,7 @@
  */
 
 #include <dali-toolkit/dali-toolkit.h>
-#include <dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h>
-#include <dali-toolkit/devel-api/controls/renderer-factory/control-renderer.h>
+#include <dali/devel-api/actors/actor-devel.h>
 #include <string.h>
 
 using namespace Dali;
@@ -49,6 +48,7 @@ public:
   ImageSvgController( Application& application )
   : mApplication( application ),
     mScale( 1.f ),
+    mScaleAtPinchStart( 1.0f ),
     mIndex( 0 )
   {
     // Connect to the Application's Init signal
@@ -68,6 +68,9 @@ public:
     Vector2 stageSize = stage.GetSize();
     mActorSize = stageSize/2.f;
 
+    // Hide the indicator bar
+    application.GetWindow().ShowIndicator( Dali::Window::INVISIBLE );
+
     stage.KeyEventSignal().Connect(this, &ImageSvgController::OnKeyEvent);
 
     // Background, for receiving gestures
@@ -79,7 +82,7 @@ public:
 
     // Push button,  for changing the image set for displaying
     Toolkit::PushButton changeButton = Toolkit::PushButton::New();
-    changeButton.SetLabelText( "Next" );
+    changeButton.SetProperty( Toolkit::Button::Property::LABEL, "Next" );
     changeButton.SetAnchorPoint( AnchorPoint::TOP_RIGHT );
     changeButton.SetParentOrigin( ParentOrigin::TOP_RIGHT );
     stage.Add( changeButton );
@@ -87,7 +90,7 @@ public:
 
     // Push button, for resetting the actor size and position
     Toolkit::PushButton resetButton = Toolkit::PushButton::New();
-    resetButton.SetLabelText( "Reset" );
+    resetButton.SetProperty( Toolkit::Button::Property::LABEL, "Reset" );
     resetButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
     resetButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
     stage.Add( resetButton );
@@ -98,6 +101,7 @@ public:
     {
       mSvgActor[i] = Toolkit::ImageView::New(SVG_IMAGES[mIndex+i]);
       mSvgActor[i].SetSize( mActorSize );
+      mSvgActor[i].TranslateBy( Vector3( 0.0, stageSize.height * 0.05, 0.0f ) );
       stage.Add( mSvgActor[i] );
     }
     mSvgActor[0].SetParentOrigin( ParentOrigin::CENTER );
@@ -118,6 +122,9 @@ public:
     mPinchGestureDetector = PinchGestureDetector::New();
     mPinchGestureDetector.Attach( mStageBackground);
     mPinchGestureDetector.DetectedSignal().Connect(this, &ImageSvgController::OnPinch);
+
+    DevelActor::RaiseToTop(changeButton);
+    DevelActor::RaiseToTop(resetButton);
   }
 
   // Callback of push button, for changing image set
@@ -234,7 +241,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 );