Merge branch 'devel/master' into tizen 76/111276/1 accepted/tizen/common/20170123.182559 accepted/tizen/ivi/20170120.082242 accepted/tizen/mobile/20170120.082003 accepted/tizen/tv/20170120.082105 accepted/tizen/wearable/20170120.082150 submit/tizen/20170120.063242 submit/tizen_common/20170123.022625
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Fri, 20 Jan 2017 05:19:10 +0000 (14:19 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Fri, 20 Jan 2017 05:19:19 +0000 (14:19 +0900)
Change-Id: Idf27811f3dc3921c9627f1a4eab395e2681be6d7

97 files changed:
build/tizen/.gitignore
build/tizen/CMakeLists.txt
build/tizen/builder/CMakeLists.txt
build/tizen/demo/CMakeLists.txt
build/tizen/examples/CMakeLists.txt
build/tizen/resources-location.in
com.samsung.dali-demo.xml
demo/dali-demo.cpp
demo/dali-table-view.cpp
demo/dali-table-view.h
examples/animated-images/animated-images-example.cpp
examples/atlas/atlas-example.cpp
examples/bubble-effect/bubble-effect-example.cpp
examples/builder/examples.cpp
examples/buttons/buttons-example.cpp
examples/clipping/clipping-example.cpp [new file with mode: 0644]
examples/clipping/clipping-item-factory.cpp [new file with mode: 0644]
examples/clipping/clipping-item-factory.h [new file with mode: 0644]
examples/cube-transition-effect/cube-transition-effect-example.cpp
examples/dissolve-effect/dissolve-effect-example.cpp
examples/effects-view/effects-view-example.cpp
examples/flex-container/flex-container-example.cpp
examples/fpp-game/fpp-game-tutorial-controller.cpp
examples/gradients/gradients-example.cpp
examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp
examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp
examples/image-view-pixel-area/image-view-pixel-area-example.cpp
examples/image-view-svg/image-view-svg-example.cpp
examples/image-view/image-view-example.cpp
examples/item-view/item-view-example.cpp
examples/line-mesh/line-mesh-example.cpp
examples/logging/logging-example.cpp
examples/mesh-visual/mesh-visual-example.cpp
examples/model3d-view/model3d-view-example.cpp
examples/motion-blur/motion-blur-example.cpp
examples/motion-stretch/motion-stretch-example.cpp
examples/native-image-source/native-image-source-example.cpp
examples/new-window/new-window-example.cpp
examples/page-turn-view/page-turn-view-example.cpp
examples/popup/popup-example.cpp
examples/primitive-shapes/primitive-shapes-example.cpp
examples/progress-bar/progress-bar-example.cpp
examples/refraction-effect/refraction-effect-example.cpp
examples/scroll-view/scroll-view-example.cpp
examples/shadows-and-lights/shadows-and-lights-example.cpp
examples/size-negotiation/size-negotiation-example.cpp
examples/styling/image-channel-control-impl.cpp
examples/styling/styling-application.cpp
examples/super-blur-bloom/super-blur-bloom-example.cpp
examples/text-editor/text-editor-example.cpp
examples/text-field/text-field-example.cpp
examples/transitions/beat-control-impl.cpp [deleted file]
examples/transitions/beat-control-impl.h [deleted file]
examples/transitions/beat-control.cpp [deleted file]
examples/transitions/beat-control.h [deleted file]
examples/transitions/shadow-button-impl.cpp [new file with mode: 0644]
examples/transitions/shadow-button-impl.h [new file with mode: 0644]
examples/transitions/shadow-button.cpp [new file with mode: 0644]
examples/transitions/shadow-button.h [new file with mode: 0644]
examples/transitions/transition-application.cpp
examples/transitions/transition-application.h
examples/transitions/transition-example.cpp
examples/video-view/video-view-example.cpp
packaging/com.samsung.dali-demo.spec
resources/images/preMultAlpha.png [new file with mode: 0644]
resources/images/progress-bar-2.9.png [new file with mode: 0644]
resources/images/progress-bar-progress-2.9.png [new file with mode: 0644]
resources/images/progress-bar-progress.9.png [new file with mode: 0644]
resources/images/progress-bar.9.png [new file with mode: 0644]
resources/images/shape-bubble.png [new file with mode: 0644]
resources/images/shape-circle.png [new file with mode: 0644]
resources/po/as.po
resources/po/de.po
resources/po/en_GB.po
resources/po/en_US.po
resources/po/es.po
resources/po/fi.po
resources/po/ko.po
resources/po/ml.po
resources/po/ur.po
resources/po/zn_CH.po
resources/style/.gitignore
resources/style/images/CheckBg.png [new file with mode: 0644]
resources/style/images/Tick.png [new file with mode: 0644]
resources/style/images/shadowButtonBg.9.png [new file with mode: 0644]
resources/style/mobile/images/CheckBg.png [new file with mode: 0644]
resources/style/mobile/images/Tick.png [new file with mode: 0644]
resources/style/mobile/images/shadowButtonBg.9.png [new file with mode: 0644]
resources/style/mobile/progress-bar-example-theme.json.in [new file with mode: 0644]
resources/style/mobile/style-example-theme-one.json.in
resources/style/mobile/style-example-theme-three.json.in
resources/style/mobile/style-example-theme-two.json.in
resources/style/progress-bar-example-theme.json.in [new file with mode: 0644]
resources/style/style-example-theme-one.json.in
resources/style/style-example-theme-three.json.in
resources/style/style-example-theme-two.json.in
shared/dali-demo-strings.h

index 9425618..d9f6684 100644 (file)
@@ -11,3 +11,4 @@ install_manifest.txt
 /builder/dali-builder
 /examples/*.demo
 /mo
+compile_commands.json
index 309f3e0..66b1dc3 100644 (file)
@@ -102,6 +102,7 @@ CONFIGURE_FILE( resources-location.in ${DEMO_SHARED}/resources-location.cpp )
 #Replace @DEMO_STYLE_IMAGE_DIR@ in following files
 CONFIGURE_FILE( ${LOCAL_STYLE_DIR}/demo-theme.json.in ${LOCAL_STYLE_DIR}/demo-theme.json )
 CONFIGURE_FILE( ${LOCAL_STYLE_DIR}/contact-cards-example-theme.json.in ${LOCAL_STYLE_DIR}/contact-cards-example-theme.json )
+CONFIGURE_FILE( ${LOCAL_STYLE_DIR}/progress-bar-example-theme.json.in ${LOCAL_STYLE_DIR}/progress-bar-example-theme.json )
 CONFIGURE_FILE( ${LOCAL_STYLE_DIR}/style-example-theme-one.json.in ${LOCAL_STYLE_DIR}/style-example-theme-one.json )
 CONFIGURE_FILE( ${LOCAL_STYLE_DIR}/style-example-theme-two.json.in ${LOCAL_STYLE_DIR}/style-example-theme-two.json )
 CONFIGURE_FILE( ${LOCAL_STYLE_DIR}/style-example-theme-three.json.in ${LOCAL_STYLE_DIR}/style-example-theme-three.json )
@@ -168,7 +169,7 @@ ENDIF(INTERNATIONALIZATION)
 ###########################################################################
 
 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${REQUIRED_CFLAGS} ${DALI_DEMO_CFLAGS} -Werror -Wall -fPIE")
-SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}")
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C_FLAGS}")
 
 INCLUDE_DIRECTORIES(${ROOT_SRC_DIR})
 #INCLUDE_DIRECTORIES(${DEMO_SRC_DIR})
index d7d72e9..5cbdfa6 100644 (file)
@@ -1,6 +1,7 @@
 SET(BUILDER_SRC_DIR ${ROOT_SRC_DIR}/builder)
 
 SET(DALI_BUILDER_SRCS ${BUILDER_SRC_DIR}/dali-builder.cpp)
+SET(DALI_BUILDER_SRCS ${DALI_BUILDER_SRCS} "${ROOT_SRC_DIR}/shared/resources-location.cpp")
 ADD_EXECUTABLE(dali-builder ${DALI_BUILDER_SRCS})
 TARGET_LINK_LIBRARIES(dali-builder ${REQUIRED_PKGS_LDFLAGS})
 INSTALL(TARGETS dali-builder DESTINATION ${BINDIR})
index 6aaf032..205f3a1 100644 (file)
@@ -2,11 +2,7 @@ SET(DEMO_SRC_DIR ${ROOT_SRC_DIR}/demo)
 
 AUX_SOURCE_DIRECTORY(${DEMO_SRC_DIR} DEMO_SRCS)
 
-
-IF(NOT DEFINED DALI_APP_RES_DIR)
-  message([STATUS] "Setting application resource path from resource-location file")
-  SET( DEMO_SRCS ${DEMO_SRCS} "${ROOT_SRC_DIR}/shared/resources-location.cpp")
-ENDIF()
+SET(DEMO_SRCS ${DEMO_SRCS} "${ROOT_SRC_DIR}/shared/resources-location.cpp")
 
 ADD_EXECUTABLE(${PROJECT_NAME} ${DEMO_SRCS})
 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${REQUIRED_PKGS_LDFLAGS} -pie)
index d83f427..ee0d04f 100644 (file)
@@ -15,10 +15,7 @@ SUBDIRLIST(SUBDIRS ${EXAMPLES_SRC_DIR})
 
 FOREACH(EXAMPLE ${SUBDIRS})
   FILE(GLOB SRCS "${EXAMPLES_SRC_DIR}/${EXAMPLE}/*.cpp")
-  IF(NOT DEFINED DALI_APP_RES_DIR)
-    SET( SRCS ${SRCS} "${ROOT_SRC_DIR}/shared/resources-location.cpp")
-
-  ENDIF()
+  SET(SRCS ${SRCS} "${ROOT_SRC_DIR}/shared/resources-location.cpp")
   ADD_EXECUTABLE(${EXAMPLE}.example ${SRCS})
   TARGET_LINK_LIBRARIES(${EXAMPLE}.example ${REQUIRED_PKGS_LDFLAGS} -pie)
   INSTALL(TARGETS ${EXAMPLE}.example DESTINATION ${BINDIR})
index 89b0b87..6474abb 100644 (file)
@@ -1,6 +1,6 @@
 /**
- * This file defines the location dali-demo resources
  It is used exclusively for Ubuntu builds where an application resource directory is explicity defined.
+ * This file defines the location dali-demo resources.
* It is used for builds where an application resource directory is NOT explicity defined.
  */
 
 #include <cstdlib>
index 046061d..4b3c4d0 100644 (file)
        <ui-application appid="tooltip.example" exec="/usr/apps/com.samsung.dali-demo/bin/tooltip.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
                <label>Tooltip</label>
        </ui-application>
+       <ui-application appid="clipping.example" exec="/usr/apps/com.samsung.dali-demo/bin/clipping.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
+               <label>Clipping</label>
+       </ui-application>
 </manifest>
index 904e3be..60c8501 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -89,6 +89,7 @@ int DALI_EXPORT_API main(int argc, char **argv)
   demo.AddExample(Example("flex-container.example", DALI_DEMO_STR_TITLE_FLEXBOX_PLAYGROUND));
   demo.AddExample(Example("fpp-game.example", DALI_DEMO_STR_TITLE_FPP_GAME));
   demo.AddExample(Example("tooltip.example", DALI_DEMO_STR_TITLE_TOOLTIP));
+  demo.AddExample(Example("clipping.example", DALI_DEMO_STR_TITLE_CLIPPING));
 
   demo.SortAlphabetically( true );
 
index 09a0343..799304e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -82,6 +82,13 @@ const Vector4 BUBBLE_COLOR[] =
 };
 const int NUMBER_OF_BUBBLE_COLOR( sizeof(BUBBLE_COLOR) / sizeof(BUBBLE_COLOR[0]) );
 
+const char * const SHAPE_IMAGE_TABLE[] =
+{
+  DEMO_IMAGE_DIR "shape-circle.png",
+  DEMO_IMAGE_DIR "shape-bubble.png"
+};
+const int NUMBER_OF_SHAPE_IMAGES( sizeof( SHAPE_IMAGE_TABLE ) / sizeof( SHAPE_IMAGE_TABLE[0] ) );
+
 const int NUM_BACKGROUND_IMAGES = 18;
 const float BACKGROUND_SWIPE_SCALE = 0.025f;
 const float BACKGROUND_SPREAD_SCALE = 1.5f;
@@ -732,16 +739,9 @@ void DaliTableView::OnKeyEvent( const KeyEvent& event )
 
 void DaliTableView::SetupBackground( Actor bubbleContainer )
 {
-  // Create distance field shapes.
-  BufferImage distanceFields[2];
-  Size imageSize( 512, 512 );
-
-  CreateShapeImage( CIRCLE, imageSize, distanceFields[0] );
-  CreateShapeImage( BUBBLE, imageSize, distanceFields[1] );
-
   // Add bubbles to the bubbleContainer.
   // Note: The bubbleContainer is parented externally to this function.
-  AddBackgroundActors( bubbleContainer, NUM_BACKGROUND_IMAGES, distanceFields );
+  AddBackgroundActors( bubbleContainer, NUM_BACKGROUND_IMAGES );
 }
 
 void DaliTableView::InitialiseBackgroundActors( Actor actor )
@@ -780,13 +780,13 @@ void DaliTableView::InitialiseBackgroundActors( Actor actor )
   }
 }
 
-void DaliTableView::AddBackgroundActors( Actor layer, int count, BufferImage* distanceField )
+void DaliTableView::AddBackgroundActors( Actor layer, int count )
 {
   for( int i = 0; i < count; ++i )
   {
     float randSize = Random::Range( 10.0f, 400.0f );
-    int distanceFieldType = static_cast<int>( Random::Range( 0.0f, 1.0f ) + 0.5f );
-    ImageView dfActor = ImageView::New( distanceField[ distanceFieldType ] );
+    int shapeType = static_cast<int>( Random::Range( 0.0f, NUMBER_OF_SHAPE_IMAGES - 1 ) + 0.5f );
+    ImageView dfActor = ImageView::New( SHAPE_IMAGE_TABLE[ shapeType ] );
     dfActor.SetSize( Vector2( randSize, randSize ) );
     dfActor.SetParentOrigin( ParentOrigin::CENTER );
 
@@ -801,57 +801,6 @@ void DaliTableView::AddBackgroundActors( Actor layer, int count, BufferImage* di
   layer.OnRelayoutSignal().Connect( this, &DaliTableView::InitialiseBackgroundActors );
 }
 
-void DaliTableView::CreateShapeImage( ShapeType shapeType, const Size& size, BufferImage& distanceFieldOut )
-{
-  // this bitmap will hold the alpha map for the distance field shader
-  distanceFieldOut = BufferImage::New( size.width, size.height, Pixel::A8 );
-
-  // Generate bit pattern
-  std::vector< unsigned char > imageDataA8;
-  imageDataA8.reserve( size.width * size.height ); // A8
-
-  switch( shapeType )
-  {
-    case CIRCLE:
-      GenerateCircle( size, imageDataA8 );
-      break;
-    case BUBBLE:
-      GenerateCircle( size, imageDataA8, true );
-      break;
-    default:
-      break;
-  }
-
-  PixelBuffer* buffer = distanceFieldOut.GetBuffer();
-  if( buffer )
-  {
-    GenerateDistanceFieldMap( &imageDataA8[ 0 ], size, buffer, size, 8.0f, size );
-    distanceFieldOut.Update();
-  }
-}
-
-void DaliTableView::GenerateCircle( const Size& size, std::vector< unsigned char >& distanceFieldOut, bool hollow )
-{
-  const float radius = size.width * 0.5f * size.width * 0.5f;
-  Vector2 center( size.width / 2, size.height / 2 );
-
-  for( int h = 0; h < size.height; ++h )
-  {
-    for( int w = 0; w < size.width; ++w )
-    {
-      Vector2 pos( w, h );
-      Vector2 dist = pos - center;
-
-      float distance = ( dist.x * dist.x ) + ( dist.y * dist.y );
-
-      // If hollow, check the distance against a min & max value, otherwise just use the max value.
-      unsigned char fillByte = ( hollow ? ( ( distance <= radius ) && ( distance > ( radius * 0.7f ) ) ) : ( distance <= radius ) ) ? 0xFF : 0x00;
-
-      distanceFieldOut.push_back( fillByte );
-    }
-  }
-}
-
 ImageView DaliTableView::CreateLogo( std::string imagePath )
 {
   ImageView logo = ImageView::New( imagePath );
index c91f2fc..c7cf0ab 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_DEMO_H
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -262,37 +262,8 @@ private: // Application callbacks & implementation
    *
    * @param[in] layer The layer to add the actors to
    * @param[in] count The number of actors to generate
-   * @param[in] distanceField A array (pointer) to 2 distance field types to use
    */
-  void AddBackgroundActors( Dali::Actor layer, int count, Dali::BufferImage* distanceField );
-
-  /**
-   * Create a bitmap with the specified shape and also output a distance field
-   *
-   * @param[in] shapeType The shape to generate
-   * @param[in] size The size of the bitmap to create
-   * @param[out] distanceFieldOut The return depth field alpha map
-   */
-  void CreateShapeImage( ShapeType shapeType, const Dali::Size& size, Dali::BufferImage& distanceFieldOut );
-
-  /**
-   * Generate a square bit pattern and depth field
-   *
-   * @param[in] size The size of the bitmap to create
-   * @param[out] imageOut The return bitmap
-   * @param[out] distanceFieldOut The return depth field alpha map
-   */
-  void GenerateSquare( const Dali::Size& size, std::vector<unsigned char>& distanceFieldOut );
-
-  /**
-   * Generate a circle bit pattern and depth field
-   *
-   * @param[in] size The size of the bitmap to create
-   * @param[out] imageOut The return bitmap
-   * @param[out] distanceFieldOut The return depth field alpha map
-   * @param[in] hollow Optional - Set to true for a thick circle outline without fill
-   */
-  void GenerateCircle( const Dali::Size& size, std::vector<unsigned char>& distanceFieldOut, bool hollow = false );
+  void AddBackgroundActors( Dali::Actor layer, int count );
 
   /**
    * Creates the logo.
index b9ec308..5587ab9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@
  */
 
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
 
 #include "shared/utility.h"
 
@@ -87,8 +88,8 @@ public:
 
     // Create a push button, and add it as child of the image view
     Toolkit::PushButton animateButton = Toolkit::PushButton::New();
-    animateButton.SetUnselectedImage( PLAY_ICON );
-    animateButton.SetSelectedImage( PLAY_ICON_SELECTED );
+    animateButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, PLAY_ICON );
+    animateButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, PLAY_ICON_SELECTED );
     animateButton.SetParentOrigin( ParentOrigin::CENTER );
     animateButton.SetAnchorPoint( AnchorPoint::CENTER );
     animateButton.ClickedSignal().Connect( this, &AnimatedImageController::OnPlayButtonClicked );
index 503d577..05483dc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -17,6 +17,7 @@
 
 #include <dali/dali.h>
 #include <dali/devel-api/images/atlas.h>
+#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
 
 #include "shared/view.h"
 #include <iostream>
@@ -72,8 +73,8 @@ public:
         "Atlas" );
 
     mLoseContextButton = Toolkit::PushButton::New();
-    mLoseContextButton.SetUnselectedImage( LOSE_CONTEXT_IMAGE );
-    mLoseContextButton.SetSelectedImage( LOSE_CONTEXT_IMAGE_SELECTED );
+    mLoseContextButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, LOSE_CONTEXT_IMAGE );
+    mLoseContextButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, LOSE_CONTEXT_IMAGE_SELECTED );
     mLoseContextButton.ClickedSignal().Connect( this, &AtlasController::OnLoseContextButtonClicked );
     mToolBar.AddControl( mLoseContextButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
 
index 878e933..66c02b8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
 #include <dali/dali.h>
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali-toolkit/devel-api/controls/bubble-effect/bubble-emitter.h>
+#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
 #include "shared/view.h"
 #include "shared/utility.h"
 
@@ -108,8 +109,8 @@ private:
 
     // Add a button to change background. (right of toolbar)
     mChangeBackgroundButton = Toolkit::PushButton::New();
-    mChangeBackgroundButton.SetUnselectedImage( CHANGE_BACKGROUND_ICON );
-    mChangeBackgroundButton.SetSelectedImage( CHANGE_BACKGROUND_ICON_SELECTED );
+    mChangeBackgroundButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, CHANGE_BACKGROUND_ICON );
+    mChangeBackgroundButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, CHANGE_BACKGROUND_ICON_SELECTED );
     mChangeBackgroundButton.ClickedSignal().Connect( this, &BubbleEffectExample::OnChangeIconClicked );
     toolBar.AddControl( mChangeBackgroundButton,
                         DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage,
@@ -117,8 +118,8 @@ private:
                         DemoHelper::DEFAULT_MODE_SWITCH_PADDING  );
     // Add a button to change bubble shape. ( left of bar )
     mChangeBubbleShapeButton = Toolkit::PushButton::New();
-    mChangeBubbleShapeButton.SetUnselectedImage( CHANGE_BUBBLE_SHAPE_ICON );
-    mChangeBubbleShapeButton.SetSelectedImage( CHANGE_BUBBLE_SHAPE_ICON_SELECTED );
+    mChangeBubbleShapeButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, CHANGE_BUBBLE_SHAPE_ICON );
+    mChangeBubbleShapeButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, CHANGE_BUBBLE_SHAPE_ICON_SELECTED );
     mChangeBubbleShapeButton.ClickedSignal().Connect( this, &BubbleEffectExample::OnChangeIconClicked );
     toolBar.AddControl( mChangeBubbleShapeButton,
                         DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage,
index 2895d82..ba47e28 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@
 #include <dali-toolkit/devel-api/builder/builder.h>
 #include <dali-toolkit/devel-api/builder/tree-node.h>
 #include <dali-toolkit/devel-api/builder/json-parser.h>
+#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
 #include <dali-toolkit/devel-api/controls/popup/popup.h>
 #include <dali-toolkit/devel-api/controls/navigation-view/navigation-view.h>
 
@@ -472,8 +473,8 @@ public:
 
     // Create an edit mode button. (left of toolbar)
     Toolkit::PushButton backButton = Toolkit::PushButton::New();
-    backButton.SetUnselectedImage( EDIT_IMAGE );
-    backButton.SetSelectedImage( EDIT_IMAGE_SELECTED );
+    backButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EDIT_IMAGE );
+    backButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EDIT_IMAGE_SELECTED );
     backButton.ClickedSignal().Connect( this, &ExampleApp::OnBackButtonPressed);
     backButton.SetLeaveRequired( true );
     mToolBar.AddControl( backButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING  );
index eddb106..a21e2f2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -164,7 +164,7 @@ class ButtonsController: public ConnectionTracker
       mRadioButtonImage1.SetParentOrigin( ParentOrigin::TOP_LEFT );
       mRadioButtonImage1.SetAnchorPoint( AnchorPoint::TOP_LEFT );
       mRadioButtonImage1.SetPosition( 0, DP(radioY) );
-      mRadioButtonImage1.SetSelected( true );
+      mRadioButtonImage1.SetProperty( Toolkit::Button::Property::SELECTED, true );
 
       imageSelectTableView.AddChild( mRadioButtonImage1, Toolkit::TableView::CellPosition( 0, 0 ) );
       imageSelectTableView.AddChild( image, Toolkit::TableView::CellPosition( 0, 1 ) );
@@ -204,7 +204,7 @@ class ButtonsController: public ConnectionTracker
 
     // Create select button
     mUpdateButton = Toolkit::PushButton::New();
-    mUpdateButton.SetLabelText( "Select" );
+    mUpdateButton.SetProperty( Toolkit::Button::Property::LABEL, "Select" );
     mUpdateButton.SetName( "selectButton" );
     mUpdateButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
 
@@ -267,7 +267,7 @@ class ButtonsController: public ConnectionTracker
       radioButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
       radioButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
       radioButton.SetPosition( 0, 0 );
-      radioButton.SetSelected( true );
+      radioButton.SetProperty( Toolkit::Button::Property::SELECTED, true );
 
       radioButton.StateChangedSignal().Connect( this, &ButtonsController::EnableSelectButton );
 
@@ -304,7 +304,7 @@ class ButtonsController: public ConnectionTracker
     {
       mCheckboxButton1 = Toolkit::CheckBoxButton::New();
       mCheckboxButton1.SetName( "checkbox1" );
-      mCheckboxButton1.SetLabelText( "CheckBox1 is unselected" );
+      mCheckboxButton1.SetProperty( Toolkit::Button::Property::LABEL, "CheckBox1 is unselected" );
       mCheckboxButton1.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesSelected );
       mCheckboxButton1.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
 
@@ -314,8 +314,8 @@ class ButtonsController: public ConnectionTracker
     {
       mCheckboxButton2 = Toolkit::CheckBoxButton::New();
       mCheckboxButton2.SetName( "checkbox2" );
-      mCheckboxButton2.SetLabelText( "CheckBox2 is selected" );
-      mCheckboxButton2.SetSelected( true );
+      mCheckboxButton2.SetProperty( Toolkit::Button::Property::LABEL, "CheckBox2 is selected" );
+      mCheckboxButton2.SetProperty( Toolkit::Button::Property::SELECTED, true );
       mCheckboxButton2.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesSelected );
       mCheckboxButton2.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
 
@@ -325,7 +325,7 @@ class ButtonsController: public ConnectionTracker
     {
       mCheckboxButton3 = Toolkit::CheckBoxButton::New();
       mCheckboxButton3.SetName( "checkbox3" );
-      mCheckboxButton3.SetLabelText( "CheckBox3 is unselected" );
+      mCheckboxButton3.SetProperty( Toolkit::Button::Property::LABEL, "CheckBox3 is unselected" );
       mCheckboxButton3.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesSelected );
       mCheckboxButton3.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
 
@@ -347,8 +347,8 @@ class ButtonsController: public ConnectionTracker
     contentTable.Add( toggleBackground );
 
     mToggleButton = Toolkit::PushButton::New();
-    mToggleButton.SetTogglableButton( true );
-    mToggleButton.SetLabelText( "Unselected" );
+    mToggleButton.SetProperty( Toolkit::Button::Property::TOGGLABLE, true );
+    mToggleButton.SetProperty( Toolkit::Button::Property::LABEL, "Unselected" );
     mToggleButton.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
     mToggleButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
     mToggleButton.StateChangedSignal().Connect( this, &ButtonsController::OnButtonSelected );
@@ -373,13 +373,14 @@ class ButtonsController: public ConnectionTracker
     Toolkit::PushButton pushButton = Toolkit::PushButton::DownCast( button );
     if( pushButton )
     {
-      if( button.IsSelected() )
+      bool isSelected = button.GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>();
+      if( isSelected )
       {
-        pushButton.SetLabelText( "Selected" );
+        pushButton.SetProperty( Toolkit::Button::Property::LABEL, "Selected" );
       }
       else
       {
-        pushButton.SetLabelText( "Unselected" );
+        pushButton.SetProperty( Toolkit::Button::Property::LABEL, "Unselected" );
       }
     }
 
@@ -388,33 +389,39 @@ class ButtonsController: public ConnectionTracker
 
   bool EnableSelectButton( Toolkit::Button button )
   {
-    if( button.GetName() == "radioSelectEnable" && button.IsSelected() == true )
+    bool isSelected = button.GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>();
+    if( !isSelected )
     {
-      mUpdateButton.SetDisabled( false );
+      return true;
+    }
+
+    if( button.GetName() == "radioSelectEnable" )
+    {
+      mUpdateButton.SetProperty( Toolkit::Button::Property::DISABLED, false );
 
-      mRadioButtonImage1.SetDisabled( false );
-      mRadioButtonImage2.SetDisabled( false );
-      mRadioButtonImage3.SetDisabled( false );
+      mRadioButtonImage1.SetProperty( Toolkit::Button::Property::DISABLED, false );
+      mRadioButtonImage2.SetProperty( Toolkit::Button::Property::DISABLED, false );
+      mRadioButtonImage3.SetProperty( Toolkit::Button::Property::DISABLED, false );
 
-      mCheckboxButton1.SetDisabled( false );
-      mCheckboxButton2.SetDisabled( false );
-      mCheckboxButton3.SetDisabled( false );
+      mCheckboxButton1.SetProperty( Toolkit::Button::Property::DISABLED, false );
+      mCheckboxButton2.SetProperty( Toolkit::Button::Property::DISABLED, false );
+      mCheckboxButton3.SetProperty( Toolkit::Button::Property::DISABLED, false );
 
-      mToggleButton.SetDisabled( false );
+      mToggleButton.SetProperty( Toolkit::Button::Property::DISABLED, false );
     }
-    else if( button.GetName() == "radioSelectDisable" && button.IsSelected() == true )
+    else if( button.GetName() == "radioSelectDisable" )
     {
-      mUpdateButton.SetDisabled( true );
+      mUpdateButton.SetProperty( Toolkit::Button::Property::DISABLED, true );
 
-      mRadioButtonImage1.SetDisabled( true );
-      mRadioButtonImage2.SetDisabled( true );
-      mRadioButtonImage3.SetDisabled( true );
+      mRadioButtonImage1.SetProperty( Toolkit::Button::Property::DISABLED, true );
+      mRadioButtonImage2.SetProperty( Toolkit::Button::Property::DISABLED, true );
+      mRadioButtonImage3.SetProperty( Toolkit::Button::Property::DISABLED, true );
 
-      mCheckboxButton1.SetDisabled( true );
-      mCheckboxButton2.SetDisabled( true );
-      mCheckboxButton3.SetDisabled( true );
+      mCheckboxButton1.SetProperty( Toolkit::Button::Property::DISABLED, true );
+      mCheckboxButton2.SetProperty( Toolkit::Button::Property::DISABLED, true );
+      mCheckboxButton3.SetProperty( Toolkit::Button::Property::DISABLED, true );
 
-      mToggleButton.SetDisabled( true );
+      mToggleButton.SetProperty( Toolkit::Button::Property::DISABLED, true );
     }
 
     return true;
@@ -422,15 +429,15 @@ class ButtonsController: public ConnectionTracker
 
   bool OnButtonClicked(Toolkit::Button button)
   {
-    if( mRadioButtonImage1.IsSelected() )
+    if( mRadioButtonImage1.GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>() )
     {
       mImage.SetImage( BIG_IMAGE_1 );
     }
-    else if( mRadioButtonImage2.IsSelected() )
+    else if( mRadioButtonImage2.GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>() )
     {
       mImage.SetImage( BIG_IMAGE_2 );
     }
-    else if( mRadioButtonImage3.IsSelected() )
+    else if( mRadioButtonImage3.GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>() )
     {
       mImage.SetImage( BIG_IMAGE_3 );
     }
@@ -439,39 +446,40 @@ class ButtonsController: public ConnectionTracker
 
   bool OnCheckBoxesSelected( Toolkit::Button button )
   {
+    bool isSelected = button.GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>();
     if( button.GetName() == "checkbox1" )
     {
-      if( button.IsSelected() )
+      if( isSelected )
       {
-        button.SetLabelText("CheckBox1 is selected");
+        button.SetProperty( Toolkit::Button::Property::LABEL, "CheckBox1 is selected");
       }
       else
       {
-        button.SetLabelText("CheckBox1 is unselected");
+        button.SetProperty( Toolkit::Button::Property::LABEL, "CheckBox1 is unselected");
       }
     }
 
     if( button.GetName() == "checkbox2" )
     {
-      if( button.IsSelected() )
+      if( isSelected )
       {
-        button.SetLabelText("CheckBox2 is selected");
+        button.SetProperty( Toolkit::Button::Property::LABEL, "CheckBox2 is selected");
       }
       else
       {
-        button.SetLabelText("CheckBox2 is unselected");
+        button.SetProperty( Toolkit::Button::Property::LABEL, "CheckBox2 is unselected");
       }
     }
 
     if( button.GetName() == "checkbox3" )
     {
-      if( button.IsSelected() )
+      if( isSelected )
       {
-        button.SetLabelText("CheckBox3 is selected");
+        button.SetProperty( Toolkit::Button::Property::LABEL, "CheckBox3 is selected");
       }
       else
       {
-        button.SetLabelText("CheckBox3 is unselected");
+        button.SetProperty( Toolkit::Button::Property::LABEL, "CheckBox3 is unselected");
       }
     }
 
diff --git a/examples/clipping/clipping-example.cpp b/examples/clipping/clipping-example.cpp
new file mode 100644 (file)
index 0000000..4db5147
--- /dev/null
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/dali.h>
+#include <dali-toolkit/dali-toolkit.h>
+#include <dali/devel-api/actors/actor-devel.h>
+#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
+#include <dali-toolkit/devel-api/visuals/text-visual-properties.h>
+
+// INTERNAL INCLUDES
+#include "clipping-item-factory.h"
+
+using namespace Dali;
+using namespace Dali::Toolkit;
+
+namespace
+{
+const char * const APPLICATION_TITLE( "Clipping Controls" );
+const Vector3 APPLICATION_TITLE_PARENT_ORIGIN( 0.5f, 0.03f, 0.5f ); // Set the parent origin to a small percentage below the top (so the demo will scale for different resolutions).
+const Vector3 ITEM_VIEW_LAYOUT_SIZE_SCALE( 0.75f, 0.5f, 0.75f );
+const float ITEM_VIEW_BORDER_SIZE = 2.0f;
+const char * const BUTTON_LABEL( "Toggle Clipping Mode" );
+} // unnamed namespace
+
+/**
+ * @brief Demonstrates the control clipping of a UI Control.
+ *
+ * When an Actor is set to clip its children, the renderers have to be added manually in order to specify what its children
+ * need to clip to. UI Controls automate the creation of the renderers/visuals when they are set to clip their children.
+ *
+ * This example displays an item-view whose clipping mode is toggled without the need for adding any renderers to it.
+ */
+class ClippingExample : public ConnectionTracker
+{
+public:
+
+  /**
+   * @brief Constructor.
+   * @param[in] application A reference to the Application class.
+   */
+  ClippingExample( Application& application )
+  : mApplication( application )
+  {
+    // Connect to the Application's Init signal
+    mApplication.InitSignal().Connect( this, &ClippingExample::Create );
+  }
+
+private:
+
+  /**
+   * @brief Called to initialise the application content.
+   * @param[in] application A reference to the Application class.
+   */
+  void Create( Application& application )
+  {
+    // Hide the indicator bar
+    application.GetWindow().ShowIndicator( Dali::Window::INVISIBLE );
+
+    // Connect to the stage's key signal to allow Back and Escape to exit.
+    Stage stage = Dali::Stage::GetCurrent();
+    stage.KeyEventSignal().Connect( this, &ClippingExample::OnKeyEvent );
+
+    // Create a TextLabel for the application title.
+    Toolkit::TextLabel label = Toolkit::TextLabel::New( APPLICATION_TITLE );
+    label.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+    label.SetParentOrigin( APPLICATION_TITLE_PARENT_ORIGIN );
+    label.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
+    label.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
+    label.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
+    stage.Add( label );
+
+    // Create an item-view which clips its children.
+    mItemView = ItemView::New( mClippingItemFactory );
+    mItemView.SetParentOrigin( ParentOrigin::CENTER );
+    mItemView.SetAnchorPoint( AnchorPoint::CENTER );
+    mItemView.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN ); // Enable clipping. No need to create any renderers.
+    stage.Add( mItemView );
+
+    // Create a Spiral Layout and add it to the Item View.
+    mItemView.AddLayout( * DefaultItemLayout::New( DefaultItemLayout::SPIRAL ) );
+    stage.GetRootLayer().SetBehavior( Layer::LAYER_3D ); // The item-view spiral layout requires Layer 3D behaviour.
+
+    // Calculate the size we would like our item-view layout to be, and then activate the layout.
+    const Vector2 stageSize = stage.GetSize();
+    const Vector3 itemViewLayoutSize( ITEM_VIEW_LAYOUT_SIZE_SCALE.x * stageSize.x, ITEM_VIEW_LAYOUT_SIZE_SCALE.y * stageSize.y, ITEM_VIEW_LAYOUT_SIZE_SCALE.z * stageSize.x );
+    mItemView.ActivateLayout( 0, itemViewLayoutSize, 0.0f );
+
+    // Create a border around item-view (as item-view is clipping its children, we should NOT add this as a child of item-view).
+    Control border = Control::New();
+    border.SetParentOrigin( ParentOrigin::CENTER );
+    border.SetAnchorPoint( AnchorPoint::CENTER );
+    border.SetProperty( Control::Property::BACKGROUND,
+                        Property::Map().Add( Visual::Property::TYPE, Visual::BORDER )
+                                       .Add( BorderVisual::Property::COLOR, Color::WHITE )
+                                       .Add( BorderVisual::Property::SIZE, 2.0f ) );
+    border.SetSize( Vector3( itemViewLayoutSize.x + ITEM_VIEW_BORDER_SIZE * 2.0f, itemViewLayoutSize.y + ITEM_VIEW_BORDER_SIZE * 2.0f, itemViewLayoutSize.z + ITEM_VIEW_BORDER_SIZE * 2.0f ) );
+    stage.Add( border );
+
+    // Create a button to toggle the clipping mode
+    PushButton button = Toolkit::PushButton::New();
+    button.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
+    button.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+    button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+    button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
+    button.SetProperty( Actor::Property::DRAW_MODE, DrawMode::OVERLAY_2D );
+    button.SetProperty( Button::Property::LABEL,
+                        Property::Map().Add( Toolkit::Visual::Property::TYPE, Toolkit::DevelVisual::TEXT )
+                                       .Add( Toolkit::TextVisual::Property::TEXT, BUTTON_LABEL ) );
+    button.ClickedSignal().Connect( this, &ClippingExample::OnButtonClicked );
+    stage.Add( button );
+  }
+
+  /**
+   * @brief Called when any key event is received
+   *
+   * Will use this to quit the application if Back or the Escape key is received
+   * @param[in] event The key event information
+   */
+  void OnKeyEvent( const KeyEvent& event )
+  {
+    if( event.state == KeyEvent::Down )
+    {
+      if( IsKey( event, DALI_KEY_ESCAPE) || IsKey( event, DALI_KEY_BACK ) )
+      {
+        mApplication.Quit();
+      }
+    }
+  }
+
+  /**
+   * @brief Called when the button is clicked.
+   *
+   * Will use this to toggle between the clipping modes.
+   * @param[in] button The button that has been clicked.
+   */
+  bool OnButtonClicked( Toolkit::Button button )
+  {
+    if( mItemView )
+    {
+      ClippingMode::Type currentMode = static_cast< ClippingMode::Type >( mItemView.GetProperty( Actor::Property::CLIPPING_MODE ).Get< int >() );
+      mItemView.SetProperty( Actor::Property::CLIPPING_MODE, ( currentMode == ClippingMode::CLIP_CHILDREN ) ? ClippingMode::DISABLED : ClippingMode::CLIP_CHILDREN );
+    }
+    return true;
+  }
+
+  // Data
+
+  Application& mApplication; ///< Reference to the application class.
+  ItemView mItemView; ///< The item view which whose children we would like to clip.
+  ClippingItemFactory mClippingItemFactory; ///< The ItemFactory used to create our items.
+};
+
+int DALI_EXPORT_API main( int argc, char **argv )
+{
+  Application app = Application::New(&argc, &argv, DEMO_THEME_PATH);
+  ClippingExample test(app);
+  app.MainLoop();
+  return 0;
+}
diff --git a/examples/clipping/clipping-item-factory.cpp b/examples/clipping/clipping-item-factory.cpp
new file mode 100644 (file)
index 0000000..50ec810
--- /dev/null
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include "clipping-item-factory.h"
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/object/property-map.h>
+#include <dali-toolkit/public-api/controls/image-view/image-view.h>
+#include <dali-toolkit/public-api/visuals/border-visual-properties.h>
+#include <dali-toolkit/public-api/visuals/visual-properties.h>
+
+using namespace Dali;
+using namespace Dali::Toolkit;
+
+namespace
+{
+const char * IMAGE_PATHS[] = {
+  DEMO_IMAGE_DIR "gallery-medium-1.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-2.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-3.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-4.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-5.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-6.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-7.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-8.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-9.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-10.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-11.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-12.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-13.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-14.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-15.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-16.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-17.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-18.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-19.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-20.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-21.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-22.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-23.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-24.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-25.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-26.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-27.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-28.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-29.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-30.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-31.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-32.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-33.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-34.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-35.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-36.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-37.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-38.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-39.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-40.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-41.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-42.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-43.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-44.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-45.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-46.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-47.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-48.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-49.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-50.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-51.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-52.jpg",
+  DEMO_IMAGE_DIR "gallery-medium-53.jpg",
+};
+const unsigned int NUM_IMAGES = sizeof( IMAGE_PATHS ) / sizeof( char * );
+const unsigned int NUM_IMAGES_MULTIPLIER = 10;
+
+const float ITEM_BORDER_SIZE = 2.0f;
+} // unnamed namespace
+
+ClippingItemFactory::ClippingItemFactory()
+{
+}
+
+unsigned int ClippingItemFactory::GetNumberOfItems()
+{
+  return NUM_IMAGES * NUM_IMAGES_MULTIPLIER;
+}
+
+Actor ClippingItemFactory::NewItem( unsigned int itemId )
+{
+  // Create an image view for this item
+  ImageView actor = ImageView::New( IMAGE_PATHS[ itemId % NUM_IMAGES ] );
+
+  // Add a border image child actor
+  ImageView borderActor = ImageView::New();
+  borderActor.SetParentOrigin( ParentOrigin::CENTER );
+  borderActor.SetAnchorPoint( AnchorPoint::CENTER );
+  borderActor.SetResizePolicy( ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT, Dimension::ALL_DIMENSIONS );
+  borderActor.SetSizeModeFactor( Vector3( 2.0f * ITEM_BORDER_SIZE, 2.0f * ITEM_BORDER_SIZE, 0.0f ) );
+  borderActor.SetColorMode( USE_PARENT_COLOR );
+  borderActor.SetProperty( ImageView::Property::IMAGE,
+                           Property::Map().Add( Visual::Property::TYPE, Visual::BORDER )
+                                          .Add( BorderVisual::Property::COLOR, Color::WHITE )
+                                          .Add( BorderVisual::Property::SIZE, ITEM_BORDER_SIZE )
+                                          .Add( BorderVisual::Property::ANTI_ALIASING, true ) );
+  actor.Add(borderActor);
+
+  return actor;
+}
diff --git a/examples/clipping/clipping-item-factory.h b/examples/clipping/clipping-item-factory.h
new file mode 100644 (file)
index 0000000..344afea
--- /dev/null
@@ -0,0 +1,56 @@
+#ifndef CLIPPING_ITEM_FACTORY_H
+#define CLIPPING_ITEM_FACTORY_H
+
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <dali-toolkit/public-api/controls/scrollable/item-view/item-factory.h>
+
+/**
+ * @brief Factory used to create the items required in the item-view used by this example.
+ */
+class ClippingItemFactory : public Dali::Toolkit::ItemFactory
+{
+public:
+
+  /**
+   * @brief Constructor
+   */
+  ClippingItemFactory();
+
+private: // From ItemFactory
+
+  /**
+   * Query the number of items available from the factory.
+   * The maximum available item has an ID of GetNumberOfItems() - 1.
+   */
+  virtual unsigned int GetNumberOfItems();
+
+  /**
+   * Create an Actor to represent a visible item.
+   * @param itemId
+   * @return the created actor.
+   */
+  virtual Dali::Actor NewItem( unsigned int itemId );
+
+private:
+
+  ClippingItemFactory( const ClippingItemFactory& ); ///< Undefined
+  ClippingItemFactory& operator=( const ClippingItemFactory& ); ///< Undefined
+};
+
+#endif // CLIPPING_ITEM_FACTORY_H
index b50c3b0..9cc96a2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@
 
 #include <dali/dali.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
 #include <dali-toolkit/devel-api/transition-effects/cube-transition-effect.h>
 #include <dali-toolkit/devel-api/transition-effects/cube-transition-cross-effect.h>
 #include <dali-toolkit/devel-api/transition-effects/cube-transition-fold-effect.h>
@@ -219,8 +220,8 @@ void CubeTransitionApp::OnInit( Application& application )
 
   // Add an effect-changing button on the right of the tool bar.
   mEffectChangeButton = Toolkit::PushButton::New();
-  mEffectChangeButton.SetUnselectedImage( EFFECT_WAVE_IMAGE );
-  mEffectChangeButton.SetSelectedImage( EFFECT_WAVE_IMAGE_SELECTED );
+  mEffectChangeButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EFFECT_WAVE_IMAGE );
+  mEffectChangeButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EFFECT_WAVE_IMAGE_SELECTED );
   mEffectChangeButton.ClickedSignal().Connect( this, &CubeTransitionApp::OnEffectButtonClicked );
   mToolBar.AddControl( mEffectChangeButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
 
@@ -230,8 +231,8 @@ void CubeTransitionApp::OnInit( Application& application )
 
   //Add an slideshow icon on the right of the title
   mSlideshowButton = Toolkit::PushButton::New();
-  mSlideshowButton.SetUnselectedImage( SLIDE_SHOW_START_ICON );
-  mSlideshowButton.SetSelectedImage( SLIDE_SHOW_START_ICON_SELECTED );
+  mSlideshowButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, SLIDE_SHOW_START_ICON );
+  mSlideshowButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, SLIDE_SHOW_START_ICON_SELECTED );
   mSlideshowButton.ClickedSignal().Connect( this, &CubeTransitionApp::OnSildeshowButtonClicked );
   mToolBar.AddControl( mSlideshowButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalCenter, DemoHelper::DEFAULT_PLAY_PADDING );
 
@@ -324,23 +325,23 @@ bool CubeTransitionApp::OnEffectButtonClicked( Toolkit::Button button )
   {
     mCurrentEffect = mCubeCrossEffect;
     mTitle.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_CROSS) );
-    mEffectChangeButton.SetUnselectedImage( EFFECT_CROSS_IMAGE );
-    mEffectChangeButton.SetSelectedImage( EFFECT_CROSS_IMAGE_SELECTED );
+    mEffectChangeButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EFFECT_CROSS_IMAGE );
+    mEffectChangeButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EFFECT_CROSS_IMAGE_SELECTED );
 
   }
   else if(mCurrentEffect == mCubeCrossEffect)
   {
     mCurrentEffect = mCubeFoldEffect;
     mTitle.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_FOLD) );
-    mEffectChangeButton.SetUnselectedImage( EFFECT_FOLD_IMAGE );
-    mEffectChangeButton.SetSelectedImage( EFFECT_FOLD_IMAGE_SELECTED );
+    mEffectChangeButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EFFECT_FOLD_IMAGE );
+    mEffectChangeButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EFFECT_FOLD_IMAGE_SELECTED );
   }
   else
   {
     mCurrentEffect = mCubeWaveEffect;
     mTitle.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_WAVE) );
-    mEffectChangeButton.SetUnselectedImage( EFFECT_WAVE_IMAGE );
-    mEffectChangeButton.SetSelectedImage( EFFECT_WAVE_IMAGE_SELECTED );
+    mEffectChangeButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EFFECT_WAVE_IMAGE );
+    mEffectChangeButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EFFECT_WAVE_IMAGE_SELECTED );
   }
   mContent.Add( mCurrentEffect );
 
@@ -356,8 +357,8 @@ bool CubeTransitionApp::OnSildeshowButtonClicked( Toolkit::Button button )
   if( mSlideshow )
   {
     mPanGestureDetector.Detach( mContent );
-    mSlideshowButton.SetUnselectedImage( SLIDE_SHOW_STOP_ICON );
-    mSlideshowButton.SetSelectedImage( SLIDE_SHOW_STOP_ICON_SELECTED );
+    mSlideshowButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, SLIDE_SHOW_STOP_ICON );
+    mSlideshowButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, SLIDE_SHOW_STOP_ICON_SELECTED );
     mPanPosition = Vector2( mViewSize.width, mViewSize.height*0.5f );
     mPanDisplacement = Vector2( -10.f, 0.f );
     mViewTimer.Start();
@@ -365,8 +366,8 @@ bool CubeTransitionApp::OnSildeshowButtonClicked( Toolkit::Button button )
   else
   {
     mPanGestureDetector.Attach( mContent );
-    mSlideshowButton.SetUnselectedImage( SLIDE_SHOW_START_ICON );
-    mSlideshowButton.SetSelectedImage( SLIDE_SHOW_START_ICON_SELECTED );
+    mSlideshowButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, SLIDE_SHOW_START_ICON );
+    mSlideshowButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, SLIDE_SHOW_START_ICON_SELECTED );
     mViewTimer.Stop();
   }
   return true;
index 20f477f..ed47bd5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@
 
 #include <dali/dali.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
 #include <dali-toolkit/devel-api/shader-effects/dissolve-effect.h>
 
 using namespace Dali;
@@ -221,8 +222,8 @@ void DissolveEffectApp::OnInit( Application& application )
 
   // Add an effect-changing button on the right of the tool bar.
   mEffectChangeButton = Toolkit::PushButton::New();
-  mEffectChangeButton.SetProperty( Toolkit::Button::Property::UNSELECTED_STATE_IMAGE, EFFECT_HIGHP_IMAGE );
-  mEffectChangeButton.SetProperty( Toolkit::Button::Property::SELECTED_STATE_IMAGE, EFFECT_HIGHP_IMAGE_SELECTED );
+  mEffectChangeButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EFFECT_HIGHP_IMAGE );
+  mEffectChangeButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EFFECT_HIGHP_IMAGE_SELECTED );
   mEffectChangeButton.ClickedSignal().Connect( this, &DissolveEffectApp::OnEffectButtonClicked );
   mToolBar.AddControl( mEffectChangeButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
 
@@ -232,8 +233,8 @@ void DissolveEffectApp::OnInit( Application& application )
 
   // Add an slide-show button on the right of the title
   mPlayStopButton = Toolkit::PushButton::New();
-  mPlayStopButton.SetProperty( Toolkit::Button::Property::UNSELECTED_STATE_IMAGE, PLAY_ICON );
-  mPlayStopButton.SetProperty( Toolkit::Button::Property::SELECTED_STATE_IMAGE, PLAY_ICON_SELECTED );
+  mPlayStopButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, PLAY_ICON );
+  mPlayStopButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, PLAY_ICON_SELECTED );
   mPlayStopButton.ClickedSignal().Connect( this, &DissolveEffectApp::OnSildeshowButtonClicked );
   mToolBar.AddControl( mPlayStopButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalCenter, DemoHelper::DEFAULT_PLAY_PADDING );
 
@@ -341,14 +342,14 @@ bool DissolveEffectApp::OnEffectButtonClicked( Toolkit::Button button )
   if(mUseHighPrecision)
   {
     mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_HIGHP) );
-    mEffectChangeButton.SetProperty( Toolkit::Button::Property::UNSELECTED_STATE_IMAGE, EFFECT_HIGHP_IMAGE );
-    mEffectChangeButton.SetProperty( Toolkit::Button::Property::SELECTED_STATE_IMAGE, EFFECT_HIGHP_IMAGE_SELECTED );
+    mEffectChangeButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EFFECT_HIGHP_IMAGE );
+    mEffectChangeButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EFFECT_HIGHP_IMAGE_SELECTED );
   }
   else
   {
     mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_MEDIUMP) );
-    mEffectChangeButton.SetProperty( Toolkit::Button::Property::UNSELECTED_STATE_IMAGE, EFFECT_MEDIUMP_IMAGE );
-    mEffectChangeButton.SetProperty( Toolkit::Button::Property::SELECTED_STATE_IMAGE, EFFECT_MEDIUMP_IMAGE_SELECTED );
+    mEffectChangeButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EFFECT_MEDIUMP_IMAGE );
+    mEffectChangeButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EFFECT_MEDIUMP_IMAGE_SELECTED );
   }
 
   return true;
@@ -359,16 +360,16 @@ bool DissolveEffectApp::OnSildeshowButtonClicked( Toolkit::Button button )
   mSlideshow = !mSlideshow;
   if( mSlideshow )
   {
-    mPlayStopButton.SetProperty( Toolkit::Button::Property::UNSELECTED_STATE_IMAGE, STOP_ICON );
-    mPlayStopButton.SetProperty( Toolkit::Button::Property::SELECTED_STATE_IMAGE, STOP_ICON_SELECTED );
+    mPlayStopButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, STOP_ICON );
+    mPlayStopButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, STOP_ICON_SELECTED );
     mPanGestureDetector.Detach( mParent );
     mViewTimer.Start();
     mTimerReady = false;
   }
   else
   {
-    mPlayStopButton.SetProperty( Toolkit::Button::Property::UNSELECTED_STATE_IMAGE, PLAY_ICON );
-    mPlayStopButton.SetProperty( Toolkit::Button::Property::SELECTED_STATE_IMAGE, PLAY_ICON_SELECTED );
+    mPlayStopButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, PLAY_ICON );
+    mPlayStopButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, PLAY_ICON_SELECTED );
     mTimerReady = true;
     mPanGestureDetector.Attach( mParent );
   }
index ab78ec0..e4c0373 100644 (file)
@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2016 Samsung Electronics Co., Ltd.
+// Copyright (c) 2017 Samsung Electronics Co., Ltd.
 //
 // Licensed under the Flora License, Version 1.0 (the License);
 // you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@
 
 #include <dali/dali.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
 #include <dali-toolkit/devel-api/controls/effects-view/effects-view.h>
 #include <sstream>
 
@@ -131,8 +132,8 @@ void EffectsViewApp::OnAppInitialize( Application& application )
 
   // Creates view change button.
   Toolkit::PushButton viewButton = Toolkit::PushButton::New();
-  viewButton.SetUnselectedImage( VIEW_SWAP_IMAGE );
-  viewButton.SetSelectedImage( VIEW_SWAP_SELECTED_IMAGE );
+  viewButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, VIEW_SWAP_IMAGE );
+  viewButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, VIEW_SWAP_SELECTED_IMAGE );
   // Connects the view change button clicked signal to the OnView method.
   viewButton.ClickedSignal().Connect( this, &EffectsViewApp::ChangeEffectSize );
   mToolBar.AddControl( viewButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING  );
index 835176e..4178991 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
 
 #include <dali/dali.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
 
 using namespace Dali;
 using namespace Dali::Toolkit;
@@ -137,8 +138,8 @@ public:
     // Create a flex direction toggle button. (left of toolbar)
     mFlexDirectionButton = Toolkit::PushButton::New();
     mFlexDirectionButton.SetName("mFlexDirectionButton");
-    mFlexDirectionButton.SetUnselectedImage( DEMO_IMAGE_DIR "icon-change.png" );
-    mFlexDirectionButton.SetSelectedImage( DEMO_IMAGE_DIR "icon-change-selected.png" );
+    mFlexDirectionButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-change.png" );
+    mFlexDirectionButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-change-selected.png" );
     mFlexDirectionButton.ClickedSignal().Connect( this, &FlexContainerExample::OnFlexDirectionButtonClicked);
     mFlexDirectionButton.SetLeaveRequired( true );
     mToolBar.AddControl( mFlexDirectionButton, VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
@@ -146,8 +147,8 @@ public:
     // Create a flex wrap toggle button. (left of toolbar)
     mFlexWrapButton = Toolkit::PushButton::New();
     mFlexWrapButton.SetName("mFlexWrapButton");
-    mFlexWrapButton.SetUnselectedImage( DEMO_IMAGE_DIR "icon-edit.png" );
-    mFlexWrapButton.SetSelectedImage( DEMO_IMAGE_DIR "icon-edit-selected.png" );
+    mFlexWrapButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-edit.png" );
+    mFlexWrapButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-edit-selected.png" );
     mFlexWrapButton.ClickedSignal().Connect( this, &FlexContainerExample::OnFlexWrapButtonClicked);
     mFlexWrapButton.SetLeaveRequired( true );
     mToolBar.AddControl( mFlexWrapButton, VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
@@ -155,8 +156,8 @@ public:
     // Create a content direction toggle button. (left of toolbar)
     mContentDirectionButton = Toolkit::PushButton::New();
     mContentDirectionButton.SetName("mContentDirectionButton");
-    mContentDirectionButton.SetUnselectedImage( DEMO_IMAGE_DIR "icon-replace.png" );
-    mContentDirectionButton.SetSelectedImage( DEMO_IMAGE_DIR "icon-replace-selected.png" );
+    mContentDirectionButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-replace.png" );
+    mContentDirectionButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-replace-selected.png" );
     mContentDirectionButton.ClickedSignal().Connect( this, &FlexContainerExample::OnContentDirectionButtonClicked);
     mContentDirectionButton.SetLeaveRequired( true );
     mToolBar.AddControl( mContentDirectionButton, VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
@@ -164,8 +165,8 @@ public:
     // Create a justify content toggle button. (right of toolbar)
     mJustifyContentButton = Toolkit::PushButton::New();
     mJustifyContentButton.SetName("mJustifyContentButton");
-    mJustifyContentButton.SetUnselectedImage( DEMO_IMAGE_DIR "icon-reset.png" );
-    mJustifyContentButton.SetSelectedImage( DEMO_IMAGE_DIR "icon-reset-selected.png" );
+    mJustifyContentButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-reset.png" );
+    mJustifyContentButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-reset-selected.png" );
     mJustifyContentButton.ClickedSignal().Connect( this, &FlexContainerExample::OnJustifyContentButtonClicked);
     mJustifyContentButton.SetLeaveRequired( true );
     mToolBar.AddControl( mJustifyContentButton, VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
@@ -173,8 +174,8 @@ public:
     // Create a align items toggle button. (right of toolbar)
     mAlignItemsButton = Toolkit::PushButton::New();
     mAlignItemsButton.SetName("mAlignItemsButton");
-    mAlignItemsButton.SetUnselectedImage( DEMO_IMAGE_DIR "icon-highp.png" );
-    mAlignItemsButton.SetSelectedImage( DEMO_IMAGE_DIR "icon-highp-selected.png" );
+    mAlignItemsButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-highp.png" );
+    mAlignItemsButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-highp-selected.png" );
     mAlignItemsButton.ClickedSignal().Connect( this, &FlexContainerExample::OnAlignItemsButtonClicked);
     mAlignItemsButton.SetLeaveRequired( true );
     mToolBar.AddControl( mAlignItemsButton, VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
@@ -182,8 +183,8 @@ public:
     // Create a align content toggle button. (right of toolbar)
     mAlignContentButton = Toolkit::PushButton::New();
     mAlignContentButton.SetName("mAlignContentButton");
-    mAlignContentButton.SetUnselectedImage( DEMO_IMAGE_DIR "icon-effect-cross.png" );
-    mAlignContentButton.SetSelectedImage( DEMO_IMAGE_DIR "icon-effect-cross-selected.png" );
+    mAlignContentButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-effect-cross.png" );
+    mAlignContentButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-effect-cross-selected.png" );
     mAlignContentButton.ClickedSignal().Connect( this, &FlexContainerExample::OnAlignContentButtonClicked);
     mAlignContentButton.SetLeaveRequired( true );
     mToolBar.AddControl( mAlignContentButton, VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
@@ -224,13 +225,13 @@ public:
 
       // Set different background colour to help to identify different items
       flexItem.SetBackgroundColor(Vector4(static_cast<float>(i) / NUM_FLEX_ITEMS, static_cast<float>(NUM_FLEX_ITEMS - i) / NUM_FLEX_ITEMS, 1.0f, 1.0f));
-      flexItem.SetUnselectedImage("");
-      flexItem.SetSelectedImage("");
+      flexItem.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, "" );
+      flexItem.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, "" );
 
       // Add a label to the button so that we can identify each item more easily
       std::ostringstream index;
       index << i + 1;
-      flexItem.SetLabelText(index.str());
+      flexItem.SetProperty( Toolkit::Button::Property::LABEL, index.str() );
       flexItem.SetName("FlexItem " + index.str());
 
       // Set a fixed size to the items so that we can wrap the line and test these
index ec97bb8..61af0c1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <dali/public-api/events/touch-data.h>
 #include <dali/public-api/animation/animation.h>
 #include <dali/public-api/actors/camera-actor.h>
+#include <dali/public-api/object/property-map.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
+#include <dali-toolkit/public-api/visuals/visual-properties.h>
+#include <dali-toolkit/public-api/visuals/color-visual-properties.h>
 
 using namespace Dali;
 using namespace Dali::Toolkit;
@@ -111,7 +114,9 @@ void FppGameTutorialController::DisplayTutorial()
   mLeftLabel.SetAnchorPoint( AnchorPoint::CENTER );
   mLeftLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
   mLeftLabel.SetSize( Vector3( stageSize.x*0.5, stageSize.y, 1.0f ) );
-  mLeftLabel.SetProperty( Toolkit::Control::Property::BACKGROUND_COLOR, Vector4( 0.0, 0.0, 0.7, 0.2 ));
+  mLeftLabel.SetProperty( Toolkit::Control::Property::BACKGROUND,
+                          Property::Map().Add( Visual::Property::TYPE, Visual::COLOR )
+                                         .Add( ColorVisual::Property::MIX_COLOR, Vector4( 0.0, 0.0, 0.7, 0.2 ) ) );
   mLeftLabel.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) ); // White.
   mLeftLabel.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
   mLeftLabel.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
@@ -122,7 +127,9 @@ void FppGameTutorialController::DisplayTutorial()
   mRightLabel.SetAnchorPoint( AnchorPoint::CENTER );
   mRightLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
   mRightLabel.SetSize( Vector3( stageSize.x*0.5, stageSize.y, 1.0f ) );
-  mRightLabel.SetProperty( Toolkit::Control::Property::BACKGROUND_COLOR, Vector4( 0.5, 0.0, 0.0, 0.2 ));
+  mRightLabel.SetProperty( Toolkit::Control::Property::BACKGROUND,
+                           Property::Map().Add( Visual::Property::TYPE, Visual::COLOR )
+                                          .Add( ColorVisual::Property::MIX_COLOR, Vector4( 0.5, 0.0, 0.0, 0.2 ) ) );
   mRightLabel.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) ); // White.
   mRightLabel.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
   mRightLabel.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
index 5d1ab63..9a92d2e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@
  */
 
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
 #include "shared/view.h"
 
 using namespace Dali;
@@ -67,8 +68,8 @@ public:
                                             APPLICATION_TITLE );
 
     PushButton changeButton = Toolkit::PushButton::New();
-    changeButton.SetUnselectedImage( CHANGE_ICON );
-    changeButton.SetSelectedImage( CHANGE_ICON_SELECTED );
+    changeButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, CHANGE_ICON );
+    changeButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, CHANGE_ICON_SELECTED );
     changeButton.ClickedSignal().Connect( this, &GradientController::OnChangeIconClicked );
     toolBar.AddControl( changeButton,
                         DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage,
index f5d17c6..1c4563c 100644 (file)
@@ -373,7 +373,7 @@ public:
     Toolkit::PushButton button = Toolkit::PushButton::New();
     button.SetStyleName( STYLE_BUTTON_TEXT );
     button.SetName( id );
-    button.SetLabelText( label );
+    button.SetProperty( Toolkit::Button::Property::LABEL, label );
     button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
     button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
     button.ClickedSignal().Connect( this, &ImageScalingAndFilteringController::OnButtonClicked );
@@ -400,7 +400,7 @@ public:
   {
     Toolkit::PushButton button = Toolkit::PushButton::New();
     button.SetName( id );
-    button.SetLabelText( id );
+    button.SetProperty( Toolkit::Button::Property::LABEL, id );
 
     button.SetAnchorPoint( AnchorPoint::TOP_LEFT );
     button.SetParentOrigin( ParentOrigin::BOTTOM_LEFT );
@@ -489,7 +489,7 @@ public:
     if( button.GetName() == modeName )
     {
       mFittingMode = mode;
-      mFittingModeButton.SetLabelText( modeName );
+      mFittingModeButton.SetProperty( Toolkit::Button::Property::LABEL, modeName );
       ResizeImage();
       mPopup.SetDisplayState( Toolkit::Popup::HIDDEN );
       mPopup.Reset();
@@ -504,7 +504,7 @@ public:
     if( button.GetName() == modeName )
     {
       mSamplingMode = mode;
-      mSamplingModeButton.SetLabelText( modeName );
+      mSamplingModeButton.SetProperty( Toolkit::Button::Property::LABEL, modeName );
       ResizeImage();
       mPopup.SetDisplayState( Toolkit::Popup::HIDDEN );
       mPopup.Reset();
@@ -661,13 +661,13 @@ public:
       else if ( event.keyPressedName == "f" )
       {
         mSamplingMode = NextFilterMode( mSamplingMode );
-        mSamplingModeButton.SetLabelText( StringFromFilterMode( mSamplingMode ) );
+        mSamplingModeButton.SetProperty( Toolkit::Button::Property::LABEL, StringFromFilterMode( mSamplingMode ) );
       }
       // Cycle filter and scaling modes:
       else if ( event.keyPressedName == "s" )
       {
         mFittingMode = NextScalingMode( mFittingMode );
-        mFittingModeButton.SetLabelText( StringFromScalingMode( mFittingMode ) );
+        mFittingModeButton.SetProperty( Toolkit::Button::Property::LABEL, StringFromScalingMode( mFittingMode ) );
       }
       else
       {
index 302686c..fdae2c4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -45,6 +45,7 @@
 #include <algorithm>
 #include <map>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
 #include <iostream>
 
 // INTERNAL INCLUDES
@@ -307,8 +308,8 @@ public:
 
     // Create an image scaling toggle button. (right of toolbar)
     Toolkit::PushButton toggleScalingButton = Toolkit::PushButton::New();
-    toggleScalingButton.SetUnselectedImage( TOGGLE_SCALING_IMAGE );
-    toggleScalingButton.SetSelectedImage( TOGGLE_SCALING_IMAGE_SELECTED );
+    toggleScalingButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, TOGGLE_SCALING_IMAGE );
+    toggleScalingButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, TOGGLE_SCALING_IMAGE_SELECTED );
     toggleScalingButton.ClickedSignal().Connect( this, &ImageScalingIrregularGridController::OnToggleScalingTouched );
     mToolBar.AddControl( toggleScalingButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING  );
 
index b00ccf5..362ced1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,6 +16,8 @@
  */
 
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
+
 #include "shared/view.h"
 
 using namespace Dali;
@@ -69,8 +71,8 @@ private:
 
     // Add a button to switch the scene. (right of toolbar)
     Toolkit::PushButton switchButton = Toolkit::PushButton::New();
-    switchButton.SetUnselectedImage( BUTTON_ICON );
-    switchButton.SetSelectedImage( BUTTON_ICON_SELECTED );
+    switchButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, BUTTON_ICON );
+    switchButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, BUTTON_ICON_SELECTED );
     switchButton.ClickedSignal().Connect( this, &ImageViewPixelAreaApp::OnButtonClicked );
     toolBar.AddControl( switchButton,
                         DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage,
index 5617a73..613ecb7 100644 (file)
@@ -82,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 );
@@ -91,7 +91,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 );
index 15d37e8..bc41577 100644 (file)
@@ -107,7 +107,7 @@ class ImageViewController: public ConnectionTracker
     buttonsTable.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
 
     Toolkit::PushButton button = Toolkit::PushButton::New();
-    button.SetLabelText( "Toggle on/off stage" );
+    button.SetProperty( Toolkit::Button::Property::LABEL, "Toggle on/off stage" );
     button.SetParentOrigin( ParentOrigin::CENTER );
     button.SetAnchorPoint( AnchorPoint::CENTER );
     button.ClickedSignal().Connect( this, &ImageViewController::ToggleImageOnStage );
@@ -115,7 +115,7 @@ class ImageViewController: public ConnectionTracker
     buttonsTable.AddChild( button, Toolkit::TableView::CellPosition( 0, 0 ) );
 
     Toolkit::PushButton button2 = Toolkit::PushButton::New();
-    button2.SetLabelText( "Change Image" );
+    button2.SetProperty( Toolkit::Button::Property::LABEL, "Change Image" );
     button2.SetParentOrigin( ParentOrigin::CENTER );
     button2.SetAnchorPoint( AnchorPoint::CENTER );
     button2.ClickedSignal().Connect( this, &ImageViewController::ChangeImageClicked );
index f93aaec..9b13be3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
 
 #include <dali/dali.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
 
 using namespace Dali;
 using namespace Dali::Toolkit;
@@ -213,16 +214,16 @@ public:
 
     // Create an edit mode button. (left of toolbar)
     Toolkit::PushButton editButton = Toolkit::PushButton::New();
-    editButton.SetUnselectedImage( EDIT_IMAGE );
-    editButton.SetSelectedImage( EDIT_IMAGE_SELECTED );
+    editButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EDIT_IMAGE );
+    editButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EDIT_IMAGE_SELECTED );
     editButton.ClickedSignal().Connect( this, &ItemViewExample::OnModeButtonClicked);
     editButton.SetLeaveRequired( true );
     mToolBar.AddControl( editButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING  );
 
     // Create a layout toggle button. (right of toolbar)
     mLayoutButton = Toolkit::PushButton::New();
-    mLayoutButton.SetUnselectedImage( SPIRAL_LAYOUT_IMAGE );
-    mLayoutButton.SetSelectedImage(SPIRAL_LAYOUT_IMAGE_SELECTED );
+    mLayoutButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, SPIRAL_LAYOUT_IMAGE );
+    mLayoutButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, SPIRAL_LAYOUT_IMAGE_SELECTED );
     mLayoutButton.ClickedSignal().Connect( this, &ItemViewExample::OnLayoutButtonClicked);
     mLayoutButton.SetLeaveRequired( true );
     mToolBar.AddControl( mLayoutButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING  );
@@ -233,9 +234,9 @@ public:
     mDeleteButton.SetAnchorPoint(AnchorPoint::BOTTOM_RIGHT);
     mDeleteButton.SetPosition( BUTTON_BORDER, BUTTON_BORDER );
     mDeleteButton.SetDrawMode( DrawMode::OVERLAY_2D );
-    mDeleteButton.SetUnselectedImage( DELETE_IMAGE );
-    mDeleteButton.SetSelectedImage( DELETE_IMAGE_SELECTED );
-    mDeleteButton.SetBackgroundImage( TOOLBAR_IMAGE );
+    mDeleteButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, DELETE_IMAGE );
+    mDeleteButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, DELETE_IMAGE_SELECTED );
+    mDeleteButton.SetProperty( Toolkit::Control::Property::BACKGROUND, TOOLBAR_IMAGE );
     mDeleteButton.SetSize( Vector2( stageSize.width * 0.15f, stageSize.width * 0.15f ) );
     mDeleteButton.ClickedSignal().Connect( this, &ItemViewExample::OnDeleteButtonClicked);
     mDeleteButton.SetLeaveRequired( true );
@@ -248,9 +249,9 @@ public:
     mInsertButton.SetAnchorPoint(AnchorPoint::BOTTOM_RIGHT);
     mInsertButton.SetPosition( BUTTON_BORDER, BUTTON_BORDER );
     mInsertButton.SetDrawMode( DrawMode::OVERLAY_2D );
-    mInsertButton.SetUnselectedImage( INSERT_IMAGE );
-    mInsertButton.SetSelectedImage( INSERT_IMAGE_SELECTED );
-    mInsertButton.SetBackgroundImage( TOOLBAR_IMAGE );
+    mInsertButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, INSERT_IMAGE );
+    mInsertButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, INSERT_IMAGE_SELECTED );
+    mInsertButton.SetProperty( Toolkit::Control::Property::BACKGROUND, TOOLBAR_IMAGE );
     mInsertButton.SetSize( stageSize.width * 0.15f, stageSize.width * 0.15f );
     mInsertButton.ClickedSignal().Connect( this, &ItemViewExample::OnInsertButtonClicked);
     mInsertButton.SetLeaveRequired( true );
@@ -263,9 +264,9 @@ public:
     mReplaceButton.SetAnchorPoint(AnchorPoint::BOTTOM_RIGHT);
     mReplaceButton.SetPosition( BUTTON_BORDER, BUTTON_BORDER );
     mReplaceButton.SetDrawMode( DrawMode::OVERLAY_2D );
-    mReplaceButton.SetUnselectedImage( REPLACE_IMAGE );
-    mReplaceButton.SetSelectedImage( REPLACE_IMAGE_SELECTED );
-    mReplaceButton.SetBackgroundImage( TOOLBAR_IMAGE );
+    mReplaceButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, REPLACE_IMAGE );
+    mReplaceButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, REPLACE_IMAGE_SELECTED );
+    mReplaceButton.SetProperty( Toolkit::Control::Property::BACKGROUND, TOOLBAR_IMAGE );
     mReplaceButton.SetSize( stageSize.width * 0.15f, stageSize.width * 0.15f );
     mReplaceButton.ClickedSignal().Connect( this, &ItemViewExample::OnReplaceButtonClicked);
     mReplaceButton.SetLeaveRequired( true );
@@ -821,22 +822,22 @@ public:
       {
         case SPIRAL_LAYOUT:
         {
-          mLayoutButton.SetUnselectedImage( SPIRAL_LAYOUT_IMAGE );
-          mLayoutButton.SetSelectedImage( SPIRAL_LAYOUT_IMAGE_SELECTED );
+          mLayoutButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, SPIRAL_LAYOUT_IMAGE );
+          mLayoutButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, SPIRAL_LAYOUT_IMAGE_SELECTED );
           break;
         }
 
         case GRID_LAYOUT:
         {
-          mLayoutButton.SetUnselectedImage( GRID_LAYOUT_IMAGE );
-          mLayoutButton.SetSelectedImage( GRID_LAYOUT_IMAGE_SELECTED );
+          mLayoutButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, GRID_LAYOUT_IMAGE );
+          mLayoutButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, GRID_LAYOUT_IMAGE_SELECTED );
           break;
         }
 
         case DEPTH_LAYOUT:
         {
-          mLayoutButton.SetUnselectedImage( DEPTH_LAYOUT_IMAGE );
-          mLayoutButton.SetSelectedImage( DEPTH_LAYOUT_IMAGE_SELECTED );
+          mLayoutButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, DEPTH_LAYOUT_IMAGE );
+          mLayoutButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, DEPTH_LAYOUT_IMAGE_SELECTED );
           break;
         }
 
index 5127284..922da41 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -253,7 +253,7 @@ public:
 
       radio.SetParentOrigin( ParentOrigin::TOP_LEFT );
       radio.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-      radio.SetSelected( i == 0 );
+      radio.SetProperty( Toolkit::Button::Property::SELECTED, i == 0 );
       radio.PressedSignal().Connect( this, &ExampleController::OnButtonPressed );
       mButtons[i] = radio;
       modeSelectTableView.AddChild( radio, Toolkit::TableView::CellPosition( i,  0 ) );
@@ -268,12 +268,12 @@ public:
     elementCountTableView.SetFitWidth( 1 );
     elementCountTableView.SetFitWidth( 2 );
     mMinusButton = Toolkit::PushButton::New();
-    mMinusButton.SetLabelText( "<<" );
+    mMinusButton.SetProperty( Toolkit::Button::Property::LABEL, "<<" );
     mMinusButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
     mMinusButton.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
 
     Toolkit::PushButton mPlusButton = Toolkit::PushButton::New();
-    mPlusButton.SetLabelText( ">>" );
+    mPlusButton.SetProperty( Toolkit::Button::Property::LABEL, ">>" );
     mPlusButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
     mPlusButton.SetAnchorPoint( AnchorPoint::CENTER_RIGHT );
 
index db6d4a6..21e1ef5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -241,7 +241,7 @@ class LoggingController: public ConnectionTracker
       radioButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
       radioButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
       radioButton.SetPosition( DP(radioX), DP(radioY) );
-      radioButton.SetSelected( true );
+      radioButton.SetProperty( Toolkit::Button::Property::SELECTED, true );
 
       radioButton.StateChangedSignal().Connect( this, &LoggingController::LoggingRadioSelect );
 
@@ -294,7 +294,7 @@ class LoggingController: public ConnectionTracker
     {
       Toolkit::PushButton button = Toolkit::PushButton::New();
       button.SetName( CREATE_BUTTON_ID );
-      button.SetLabelText( CREATE_BUTTON_TEXT );
+      button.SetProperty( Toolkit::Button::Property::LABEL, CREATE_BUTTON_TEXT);
       button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
       button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
       button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked );
@@ -305,7 +305,7 @@ class LoggingController: public ConnectionTracker
     {
       Toolkit::PushButton button = Toolkit::PushButton::New();
       button.SetName( DELETE_BUTTON_ID );
-      button.SetLabelText( DELETE_BUTTON_TEXT );
+      button.SetProperty( Toolkit::Button::Property::LABEL, DELETE_BUTTON_TEXT);
       button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
       button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
       button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked );
@@ -327,7 +327,7 @@ class LoggingController: public ConnectionTracker
     {
       Toolkit::PushButton button = Toolkit::PushButton::New();
       button.SetName( START_BUTTON_ID );
-      button.SetLabelText( START_BUTTON_TEXT );
+      button.SetProperty( Toolkit::Button::Property::LABEL, START_BUTTON_TEXT);
       button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
       button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
       button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked );
@@ -338,7 +338,7 @@ class LoggingController: public ConnectionTracker
     {
       Toolkit::PushButton button = Toolkit::PushButton::New();
       button.SetName( STOP_BUTTON_ID );
-      button.SetLabelText( STOP_BUTTON_TEXT );
+      button.SetProperty( Toolkit::Button::Property::LABEL, STOP_BUTTON_TEXT);
       button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
       button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
       button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked );
@@ -359,7 +359,7 @@ class LoggingController: public ConnectionTracker
     {
       Toolkit::PushButton button = Toolkit::PushButton::New();
       button.SetName( ENABLE_BUTTON_ID );
-      button.SetLabelText( ENABLE_BUTTON_TEXT );
+      button.SetProperty( Toolkit::Button::Property::LABEL, ENABLE_BUTTON_TEXT);
       button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
       button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
       button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked );
@@ -370,7 +370,7 @@ class LoggingController: public ConnectionTracker
     {
       Toolkit::PushButton button = Toolkit::PushButton::New();
       button.SetName( DISABLE_BUTTON_ID );
-      button.SetLabelText( DISABLE_BUTTON_TEXT );
+      button.SetProperty( Toolkit::Button::Property::LABEL, DISABLE_BUTTON_TEXT);
       button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
       button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
       button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked );
@@ -421,7 +421,7 @@ class LoggingController: public ConnectionTracker
       Toolkit::RadioButton radioButton = Toolkit::RadioButton::New( FREQUENCY_2_RADIO_TEXT );
       radioButton.SetName( FREQUENCY_2_RADIO_ID );
 
-      radioButton.SetSelected( true );
+      radioButton.SetProperty( Toolkit::Button::Property::SELECTED, true );
 
       radioButton.StateChangedSignal().Connect( this, &LoggingController::FrequencyRadioSelect );
 
@@ -453,7 +453,7 @@ class LoggingController: public ConnectionTracker
     {
       Toolkit::PushButton button = Toolkit::PushButton::New();
       button.SetName( VSYNC_BUTTON_ID );
-      button.SetLabelText( VSYNC_BUTTON_TEXT );
+      button.SetProperty( Toolkit::Button::Property::LABEL, VSYNC_BUTTON_TEXT);
       button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
       button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
       button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked );
@@ -473,21 +473,27 @@ class LoggingController: public ConnectionTracker
          << ", " << ((mLoggerStates[i].isTiming) ? "Started" : "Stopped")
          << ", " << ((mLoggerStates[i].isEnabled) ? "Enabled" : "Disabled");
 
-      mLogRadioButtons[i].SetLabelText( ss.str() );
+      mLogRadioButtons[i].SetProperty( Toolkit::Button::Property::LABEL, ss.str() );
     }
   }
 
   bool LoggingRadioSelect( Toolkit::Button button )
   {
-    if( button.GetName() == LOGGER_1_RADIO_ID && button.IsSelected() == true )
+    bool isSelected = button.GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>();
+    if( !isSelected )
+    {
+      return true;
+    }
+
+    if( button.GetName() == LOGGER_1_RADIO_ID )
     {
       mCurrentLogger = 0;
     }
-    else if( button.GetName() == LOGGER_2_RADIO_ID && button.IsSelected() == true )
+    else if( button.GetName() == LOGGER_2_RADIO_ID )
     {
       mCurrentLogger = 1;
     }
-    else if( button.GetName() == LOGGER_3_RADIO_ID && button.IsSelected() == true )
+    else if( button.GetName() == LOGGER_3_RADIO_ID )
     {
       mCurrentLogger = 2;
     }
@@ -503,21 +509,27 @@ class LoggingController: public ConnectionTracker
     const unsigned int frequency = mLoggerStates[mCurrentLogger].frequency;
     if( frequency == HIGH_FREQUENCY )
     {
-      mFrequencyRadioButtons[0].SetSelected( true );
+      mFrequencyRadioButtons[0].SetProperty( Toolkit::Button::Property::SELECTED, true );
     }
     else if( frequency == MEDIUM_FREQUENCY )
     {
-      mFrequencyRadioButtons[1].SetSelected( true );
+      mFrequencyRadioButtons[1].SetProperty( Toolkit::Button::Property::SELECTED, true );
     }
     else if( frequency == LOW_FREQUENCY )
     {
-      mFrequencyRadioButtons[2].SetSelected( true );
+      mFrequencyRadioButtons[2].SetProperty( Toolkit::Button::Property::SELECTED, true );
     }
   }
 
   bool FrequencyRadioSelect( Toolkit::Button button )
   {
-    if( button.GetName() == FREQUENCY_1_RADIO_ID && button.IsSelected() == true )
+    bool isSelected = button.GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>();
+    if( !isSelected )
+    {
+      return true;
+    }
+
+    if( button.GetName() == FREQUENCY_1_RADIO_ID )
     {
       if( mPerformanceLoggers[mCurrentLogger] )
       {
@@ -528,7 +540,7 @@ class LoggingController: public ConnectionTracker
         mLoggerStates[mCurrentLogger].frequency = HIGH_FREQUENCY;
       }
     }
-    else if( button.GetName() == FREQUENCY_2_RADIO_ID && button.IsSelected() == true )
+    else if( button.GetName() == FREQUENCY_2_RADIO_ID )
     {
       if( mPerformanceLoggers[mCurrentLogger] )
       {
@@ -539,7 +551,7 @@ class LoggingController: public ConnectionTracker
         mLoggerStates[mCurrentLogger].frequency = MEDIUM_FREQUENCY;
       }
     }
-    else if( button.GetName() == FREQUENCY_3_RADIO_ID && button.IsSelected() == true )
+    else if( button.GetName() == FREQUENCY_3_RADIO_ID )
     {
       if( mPerformanceLoggers[mCurrentLogger] )
       {
index e8674c9..24901bd 100644 (file)
@@ -183,7 +183,7 @@ public:
     modelButton.ClickedSignal().Connect( this, &MeshVisualController::OnChangeModelClicked );
     modelButton.SetParentOrigin( ParentOrigin::TOP_CENTER );
     modelButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
-    modelButton.SetLabelText( "Model" );
+    modelButton.SetProperty( Toolkit::Button::Property::LABEL, "Model" );
     positionActorModel.Add( modelButton );
 
     //Create button for shading mode changing.
@@ -192,7 +192,7 @@ public:
     shadingModeButton.ClickedSignal().Connect( this, &MeshVisualController::OnChangeShadingModeClicked );
     shadingModeButton.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
     shadingModeButton.SetAnchorPoint( AnchorPoint::TOP_CENTER );
-    shadingModeButton.SetLabelText( "Shading Mode" );
+    shadingModeButton.SetProperty( Toolkit::Button::Property::LABEL, "Shading Mode" );
     positionActorModel.Add( shadingModeButton );
 
     //Text label title for changing model or shading mode.
@@ -209,7 +209,7 @@ public:
     pauseButton.ClickedSignal().Connect( this, &MeshVisualController::OnPauseClicked );
     pauseButton.SetParentOrigin( Vector3( 0.5, 1.0 - BUTTONS_OFFSET_BOTTOM, 0.5 ) );
     pauseButton.SetAnchorPoint( AnchorPoint::CENTER );
-    pauseButton.SetLabelText( PAUSE );
+    pauseButton.SetProperty( Toolkit::Button::Property::LABEL, PAUSE );
     layer.Add( pauseButton );
 
     //Actor for positioning light position buttons.
@@ -224,7 +224,7 @@ public:
     lightModeButton.ClickedSignal().Connect( this, &MeshVisualController::OnChangeLightModeClicked );
     lightModeButton.SetParentOrigin( ParentOrigin::TOP_CENTER );
     lightModeButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
-    lightModeButton.SetLabelText( FIXED );
+    lightModeButton.SetProperty( Toolkit::Button::Property::LABEL, FIXED );
     positionActorLight.Add( lightModeButton );
 
     //Create button for switching between front and back light position.
@@ -233,7 +233,7 @@ public:
     lightSideButton.ClickedSignal().Connect( this, &MeshVisualController::OnChangeLightSideClicked );
     lightSideButton.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
     lightSideButton.SetAnchorPoint( AnchorPoint::TOP_CENTER );
-    lightSideButton.SetLabelText( FRONT );
+    lightSideButton.SetProperty( Toolkit::Button::Property::LABEL, FRONT );
     positionActorLight.Add( lightSideButton );
 
     //Text label title for light position mode.
@@ -504,7 +504,7 @@ public:
         mModels[i].rotationAnimation.Pause();
       }
 
-      button.SetLabelText( PLAY );
+      button.SetProperty( Toolkit::Button::Property::LABEL, PLAY );
     }
     else //Unpause all animations again.
     {
@@ -513,7 +513,7 @@ public:
         mModels[i].rotationAnimation.Play();
       }
 
-      button.SetLabelText( PAUSE );
+      button.SetProperty( Toolkit::Button::Property::LABEL, PAUSE );
     }
 
     return true;
@@ -528,11 +528,11 @@ public:
 
     if( mLightFixed )
     {
-      button.SetLabelText( FIXED );
+      button.SetProperty( Toolkit::Button::Property::LABEL, FIXED );
     }
     else
     {
-      button.SetLabelText( MANUAL );
+      button.SetProperty( Toolkit::Button::Property::LABEL, MANUAL );
     }
 
     SetLightMode();
@@ -548,11 +548,11 @@ public:
 
     if( mLightFront )
     {
-      button.SetLabelText( FRONT );
+      button.SetProperty( Toolkit::Button::Property::LABEL, FRONT );
     }
     else
     {
-      button.SetLabelText( BACK );
+      button.SetProperty( Toolkit::Button::Property::LABEL, BACK );
     }
 
     //Change light image.
index 21e7553..08cb8fa 100644 (file)
@@ -117,7 +117,7 @@ public:
     editButton.ClickedSignal().Connect( this, &Model3dViewController::OnChangeModelClicked);
     editButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
     editButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-    editButton.SetLabelText( "Change Model" );
+    editButton.SetProperty( Toolkit::Button::Property::LABEL, "Change Model" );
     mButtonLayer.Add( editButton  );
 
     // Create button for shader changing
@@ -126,7 +126,7 @@ public:
     editButton.ClickedSignal().Connect( this, &Model3dViewController::OnChangeLightingClicked);
     editButton.SetParentOrigin( ParentOrigin::TOP_RIGHT );
     editButton.SetAnchorPoint( AnchorPoint::TOP_RIGHT );
-    editButton.SetLabelText( "Change Shader" );
+    editButton.SetProperty( Toolkit::Button::Property::LABEL, "Change Shader" );
     mButtonLayer.Add( editButton  );
 
     // Create button for pause/resume animation
@@ -135,7 +135,7 @@ public:
     editButton.ClickedSignal().Connect( this, &Model3dViewController::OnPauseAnimationsClicked);
     editButton.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
     editButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
-    editButton.SetLabelText( "Pause Animations" );
+    editButton.SetProperty( Toolkit::Button::Property::LABEL, "Pause Animations" );
     mButtonLayer.Add( editButton  );
 
     //Create animations
index 55605ba..e002e73 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,8 +21,8 @@
 #include "shared/view.h"
 #include <dali/dali.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
 #include <dali-toolkit/devel-api/shader-effects/motion-blur-effect.h>
-#include <dali-toolkit/devel-api/controls/popup/popup.h>
 
 using namespace Dali;
 using namespace Dali::Toolkit;
@@ -176,16 +176,16 @@ public:
 
     //Add an effects icon on the right of the title
     mActorEffectsButton = Toolkit::PushButton::New();
-    mActorEffectsButton.SetUnselectedImage( EFFECTS_OFF_ICON );
-    mActorEffectsButton.SetSelectedImage( EFFECTS_OFF_ICON_SELECTED );
+    mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EFFECTS_OFF_ICON );
+    mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EFFECTS_OFF_ICON_SELECTED );
     mActorEffectsButton.ClickedSignal().Connect( this, &MotionBlurExampleApp::OnEffectButtonClicked );
     mToolBar.AddControl( mActorEffectsButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalCenter, DemoHelper::DEFAULT_PLAY_PADDING );
 
     // Creates a mode button.
     // Create a effect toggle button. (right of toolbar)
     Toolkit::PushButton layoutButton = Toolkit::PushButton::New();
-    layoutButton.SetUnselectedImage( LAYOUT_IMAGE );
-    layoutButton.SetSelectedImage( LAYOUT_IMAGE_SELECTED );
+    layoutButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, LAYOUT_IMAGE );
+    layoutButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, LAYOUT_IMAGE_SELECTED );
     layoutButton.ClickedSignal().Connect( this, &MotionBlurExampleApp::OnLayoutButtonClicked);
     layoutButton.SetLeaveRequired( true );
     mToolBar.AddControl( layoutButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
@@ -435,14 +435,14 @@ public:
     if(!mActorEffectsEnabled)
     {
       mActorEffectsEnabled = true;
-      mActorEffectsButton.SetUnselectedImage( EFFECTS_ON_ICON );
-      mActorEffectsButton.SetSelectedImage( EFFECTS_ON_ICON_SELECTED );
+      mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EFFECTS_ON_ICON );
+      mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EFFECTS_ON_ICON_SELECTED );
     }
     else
     {
       mActorEffectsEnabled = false;
-      mActorEffectsButton.SetUnselectedImage( EFFECTS_OFF_ICON );
-      mActorEffectsButton.SetSelectedImage( EFFECTS_OFF_ICON_SELECTED );
+      mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EFFECTS_OFF_ICON );
+      mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EFFECTS_OFF_ICON_SELECTED );
     }
   }
 
@@ -539,8 +539,6 @@ private:
 
   DeviceOrientation mOrientation;               ///< Current Device orientation
   Animation mRotateAnimation;                   ///< Animation for rotating between landscape and portrait.
-
-  Popup mInstructionsPopup;                     ///< Info Popup
 };
 
 void RunTest(Application& app)
index 4389907..b0105de 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@
 #include "shared/view.h"
 #include <dali/dali.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
 #include <dali-toolkit/devel-api/shader-effects/motion-stretch-effect.h>
 
 using namespace Dali;
@@ -142,16 +143,16 @@ public:
 
     //Add an slideshow icon on the right of the title
     mActorEffectsButton = Toolkit::PushButton::New();
-    mActorEffectsButton.SetUnselectedImage( EFFECTS_OFF_ICON );
-    mActorEffectsButton.SetSelectedImage( EFFECTS_OFF_ICON_SELECTED );
+    mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EFFECTS_OFF_ICON );
+    mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EFFECTS_OFF_ICON_SELECTED );
     mActorEffectsButton.ClickedSignal().Connect( this, &MotionStretchExampleApp::OnEffectButtonClicked );
     mToolBar.AddControl( mActorEffectsButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalCenter, DemoHelper::DEFAULT_PLAY_PADDING );
 
     // Creates a mode button.
     // Create a effect toggle button. (right of toolbar)
     Toolkit::PushButton layoutButton = Toolkit::PushButton::New();
-    layoutButton.SetUnselectedImage( LAYOUT_IMAGE );
-    layoutButton.SetSelectedImage( LAYOUT_IMAGE_SELECTED );
+    layoutButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, LAYOUT_IMAGE );
+    layoutButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, LAYOUT_IMAGE_SELECTED );
     layoutButton.ClickedSignal().Connect( this, &MotionStretchExampleApp::OnLayoutButtonClicked);
     layoutButton.SetLeaveRequired( true );
     mToolBar.AddControl( layoutButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
@@ -333,14 +334,14 @@ public:
     if(!mActorEffectsEnabled)
     {
       mActorEffectsEnabled = true;
-      mActorEffectsButton.SetUnselectedImage( EFFECTS_ON_ICON );
-      mActorEffectsButton.SetSelectedImage( EFFECTS_ON_ICON_SELECTED );
+      mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EFFECTS_ON_ICON );
+      mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EFFECTS_ON_ICON_SELECTED );
     }
     else
     {
       mActorEffectsEnabled = false;
-      mActorEffectsButton.SetUnselectedImage( EFFECTS_OFF_ICON );
-      mActorEffectsButton.SetSelectedImage( EFFECTS_OFF_ICON_SELECTED );
+      mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EFFECTS_OFF_ICON );
+      mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EFFECTS_OFF_ICON_SELECTED );
     }
   }
 
index cf9304b..f9f7a54 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -153,16 +153,16 @@ public:
     stage.KeyEventSignal().Connect(this, &NativeImageSourceController::OnKeyEvent);
 
     mButtonRefreshAlways = PushButton::New();
-    mButtonRefreshAlways.SetTogglableButton( true );
-    mButtonRefreshAlways.SetSelected( true );
-    mButtonRefreshAlways.SetLabelText( "Refresh ALWAYS" );
+    mButtonRefreshAlways.SetProperty( Button::Property::TOGGLABLE, true );
+    mButtonRefreshAlways.SetProperty( Button::Property::SELECTED, true );
+    mButtonRefreshAlways.SetProperty( Toolkit::Button::Property::LABEL, "Refresh ALWAYS" );
     mButtonRefreshAlways.SetParentOrigin( ParentOrigin::TOP_LEFT );
     mButtonRefreshAlways.SetAnchorPoint( AnchorPoint::TOP_LEFT );
     mButtonRefreshAlways.StateChangedSignal().Connect( this, &NativeImageSourceController::OnButtonSelected );
     stage.Add( mButtonRefreshAlways );
 
     mButtonRefreshOnce = PushButton::New();
-    mButtonRefreshOnce.SetLabelText( "Refresh ONCE" );
+    mButtonRefreshOnce.SetProperty( Toolkit::Button::Property::LABEL, "Refresh ONCE" );
     mButtonRefreshOnce.SetParentOrigin( ParentOrigin::TOP_RIGHT );
     mButtonRefreshOnce.SetAnchorPoint( AnchorPoint::TOP_RIGHT );
     mButtonRefreshOnce.ClickedSignal().Connect( this, &NativeImageSourceController::OnButtonSelected );
@@ -246,10 +246,12 @@ public:
 
   bool OnButtonSelected( Toolkit::Button button )
   {
+    bool isSelected = mButtonRefreshAlways.GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>();
+
     Toolkit::PushButton pushButton = Toolkit::PushButton::DownCast( button );
     if( pushButton == mButtonRefreshAlways )
     {
-      if( mButtonRefreshAlways.IsSelected() )
+      if( isSelected )
       {
         mOffscreenRenderTask.SetRefreshRate( RenderTask::REFRESH_ALWAYS );
       }
@@ -260,9 +262,9 @@ public:
     }
     else if( pushButton == mButtonRefreshOnce )
     {
-      if( mButtonRefreshAlways.IsSelected() )
+      if( isSelected )
       {
-        mButtonRefreshAlways.SetSelected( false );
+        mButtonRefreshAlways.SetProperty( Button::Property::SELECTED, false );
       }
       mOffscreenRenderTask.SetRefreshRate( RenderTask::REFRESH_ONCE );
     }
index 7e6c625..545f8ad 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@
 #include <dali/public-api/rendering/renderer.h>
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali-toolkit/devel-api/controls/bubble-effect/bubble-emitter.h>
+#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
 #include <dali-toolkit/devel-api/controls/gaussian-blur-view/gaussian-blur-view.h>
 
 #include <cstdio>
@@ -204,8 +205,8 @@ void NewWindowController::Create( Application& app )
   }
 
   mLoseContextButton = Toolkit::PushButton::New();
-  mLoseContextButton.SetUnselectedImage( LOSE_CONTEXT_IMAGE );
-  mLoseContextButton.SetSelectedImage( LOSE_CONTEXT_IMAGE_SELECTED );
+  mLoseContextButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, LOSE_CONTEXT_IMAGE );
+  mLoseContextButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, LOSE_CONTEXT_IMAGE_SELECTED );
   mLoseContextButton.ClickedSignal().Connect( this, &NewWindowController::OnLoseContextButtonClicked );
   mToolBar.AddControl( mLoseContextButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
 
index 7c40ef4..3eb9c32 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -17,6 +17,7 @@
 
 #include <dali/dali.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
 #include <dali-toolkit/devel-api/controls/page-turn-view/page-factory.h>
 #include <dali-toolkit/devel-api/controls/page-turn-view/page-turn-landscape-view.h>
 #include <dali-toolkit/devel-api/controls/page-turn-view/page-turn-portrait-view.h>
@@ -256,8 +257,8 @@ void PageTurnController::OnInit( Application& app )
   Toolkit::PushButton button = Toolkit::PushButton::New();
   button.SetAnchorPoint( AnchorPoint::TOP_RIGHT );
   button.SetParentOrigin( ParentOrigin::TOP_RIGHT );
-  button.SetUnselectedImage( CHANGE_IMAGE_ICON  );
-  button.SetSelectedImage( CHANGE_IMAGE_ICON_SELECTED );
+  button.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, CHANGE_IMAGE_ICON );
+  button.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, CHANGE_IMAGE_ICON_SELECTED );
   button.SetLeaveRequired( true );
   button.SetScale(1.5f);
   button.PressedSignal().Connect( this, &PageTurnController::OnButtonClicked );
index 1caa94e..a2427ea 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
 #include "shared/view.h"
 #include <dali/dali.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
 #include <dali-toolkit/devel-api/controls/popup/popup.h>
 #include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
 
@@ -140,17 +141,17 @@ public:
 
     // Create animation button.
     mAnimationButton = Toolkit::PushButton::New();
-    mAnimationButton.SetUnselectedImage( ANIMATION_FADE_ICON_IMAGE );
-    mAnimationButton.SetSelectedImage( ANIMATION_ZOOM_ICON_IMAGE );
-    mAnimationButton.SetTogglableButton( true );
+    mAnimationButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, ANIMATION_FADE_ICON_IMAGE );
+    mAnimationButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, ANIMATION_ZOOM_ICON_IMAGE );
+    mAnimationButton.SetProperty( Toolkit::Button::Property::TOGGLABLE, true );
     mAnimationButton.ClickedSignal().Connect( this, &PopupExample::OnAnimationClicked );
     mToolBar.AddControl( mAnimationButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING  );
 
     // Create context button.
     mContextButton = Toolkit::PushButton::New();
-    mContextButton.SetUnselectedImage( CONTEXT_DISABLED_ICON_IMAGE );
-    mContextButton.SetSelectedImage( CONTEXT_ENABLED_ICON_IMAGE );
-    mContextButton.SetTogglableButton( true );
+    mContextButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, CONTEXT_DISABLED_ICON_IMAGE );
+    mContextButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, CONTEXT_ENABLED_ICON_IMAGE );
+    mContextButton.SetProperty( Toolkit::Button::Property::TOGGLABLE, true );
     mContextButton.ClickedSignal().Connect( this, &PopupExample::OnContextClicked );
     mToolBar.AddControl( mContextButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING  );
 
@@ -176,13 +177,13 @@ public:
 
   bool OnContextClicked( Toolkit::Button button )
   {
-    mContextual = button.IsSelected();
+    mContextual = button.GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>();
     return true;
   }
 
   bool OnAnimationClicked( Toolkit::Button button )
   {
-    mAnimationFade = !button.IsSelected();
+    mAnimationFade = ! ( button.GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>() );
     return true;
   }
 
@@ -427,7 +428,7 @@ public:
   {
     Toolkit::PushButton okayButton = Toolkit::PushButton::New();
     okayButton.SetName( POPUP_CONTROL_OK_NAME );
-    okayButton.SetLabelText( "OK!" );
+    okayButton.SetProperty( Toolkit::Button::Property::LABEL, "OK!" );
 
     okayButton.ClickedSignal().Connect( this, &PopupExample::OnPopupButtonClicked );
 
@@ -438,7 +439,7 @@ public:
   {
     Toolkit::PushButton cancelButton = Toolkit::PushButton::New();
     cancelButton.SetName( POPUP_CONTROL_CANCEL_NAME );
-    cancelButton.SetLabelText( "Cancel" );
+    cancelButton.SetProperty( Toolkit::Button::Property::LABEL, "Cancel" );
 
     cancelButton.ClickedSignal().Connect( this, &PopupExample::OnPopupButtonClicked );
 
@@ -707,7 +708,7 @@ public: // From ItemFactory
   {
     Toolkit::PushButton popupButton = Toolkit::PushButton::New();
     popupButton.SetName( POPUP_BUTTON_ITEMS[ itemId ].name );
-    popupButton.SetLabelText( POPUP_BUTTON_ITEMS[ itemId ].text );
+    popupButton.SetProperty( Toolkit::Button::Property::LABEL, POPUP_BUTTON_ITEMS[ itemId ].text );
     popupButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
 
     popupButton.ClickedSignal().Connect( this, &PopupExample::OnButtonClicked );
index 06e794a..cc762be 100644 (file)
@@ -1,5 +1,23 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali/public-api/object/property-map.h>
+#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
 #include <dali-toolkit/public-api/controls/slider/slider.h>
 
 using namespace Dali;
@@ -170,8 +188,8 @@ public:
       button.SetAnchorPoint( AnchorPoint::CENTER );
       button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
       button.SetPadding( Padding( elementPadding, elementPadding, elementPadding, elementPadding ) );
-      button.SetProperty( Button::Property::UNSELECTED_STATE_IMAGE, Property::Value( BUTTON_IMAGE_URL[modelNumber] ) );
-      button.SetProperty( Button::Property::SELECTED_STATE_IMAGE, Property::Value( BUTTON_IMAGE_URL[modelNumber] ) );
+      button.SetProperty( DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, BUTTON_IMAGE_URL[modelNumber] );
+      button.SetProperty( DevelButton::Property::SELECTED_BACKGROUND_VISUAL,  BUTTON_IMAGE_URL[modelNumber] );
       button.RegisterProperty( "modelNumber", Property::Value( modelNumber ) );
       button.ClickedSignal().Connect( this, &PrimitiveShapesController::OnChangeShapeClicked );
 
index 593e297..aca1a53 100644 (file)
@@ -25,7 +25,7 @@ using Dali::Toolkit::ProgressBar;
 
 namespace
 {
-
+const char * const THEME_PATH( DEMO_STYLE_DIR "progress-bar-example-theme.json" ); ///< The theme used for this example
 const char* const BACKGROUND_IMAGE = DEMO_IMAGE_DIR "background-gradient.jpg";
 const char* const TOOLBAR_IMAGE = DEMO_IMAGE_DIR "top-bar.png";
 const char* const TOOLBAR_TITLE = "Progress Bar";
@@ -36,11 +36,14 @@ const Vector4 BACKGROUND_COLOUR( 1.0f, 1.0f, 1.0f, 0.15f );
 const int MARGIN_SIZE = 10;
 const int TOP_MARGIN = 85;
 
+const unsigned int TIMER_TIMEOUT_TIME = 50;
+const float PROGRESS_INCREMENT_VALUE = 0.01f;
+
 }  // namespace
 
-/** This example shows how to create and use PROGRESS BAR.
+/**
+ * @brief Shows how to create a default progress bar and custom styled progress bars.
  */
-
 class ProgressBarExample: public ConnectionTracker
 {
 public:
@@ -53,10 +56,7 @@ public:
     mApplication.InitSignal().Connect( this, &ProgressBarExample::Create );
   }
 
-  ~ProgressBarExample()
-  {
-    // Nothing to do here
-  }
+private:
 
   void Create( Application& application )
   {
@@ -75,11 +75,25 @@ public:
                                             TOOLBAR_IMAGE,
                                             TOOLBAR_TITLE );
 
-    mProgressBar = ProgressBar::New();
-    mProgressBar.SetParentOrigin(ParentOrigin::TOP_CENTER);
-    mProgressBar.SetAnchorPoint(AnchorPoint::TOP_CENTER);
-    mProgressBar.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
-    mProgressBar.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT);
+    mProgressBarDefault = ProgressBar::New();
+    mProgressBarDefault.SetParentOrigin(ParentOrigin::TOP_CENTER);
+    mProgressBarDefault.SetAnchorPoint(AnchorPoint::TOP_CENTER);
+    mProgressBarDefault.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
+    mProgressBarDefault.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT);
+
+    mProgressBarCustomStyle1 = ProgressBar::New();
+    mProgressBarCustomStyle1.SetStyleName( "ProgressBarCustomStyle1" );
+    mProgressBarCustomStyle1.SetParentOrigin(ParentOrigin::TOP_CENTER);
+    mProgressBarCustomStyle1.SetAnchorPoint(AnchorPoint::TOP_CENTER);
+    mProgressBarCustomStyle1.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
+    mProgressBarCustomStyle1.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT);
+
+    mProgressBarCustomStyle2 = ProgressBar::New();
+    mProgressBarCustomStyle2.SetStyleName( "ProgressBarCustomStyle2" );
+    mProgressBarCustomStyle2.SetParentOrigin(ParentOrigin::TOP_CENTER);
+    mProgressBarCustomStyle2.SetAnchorPoint(AnchorPoint::TOP_CENTER);
+    mProgressBarCustomStyle2.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
+    mProgressBarCustomStyle2.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT);
 
     Toolkit::TableView contentTable = Toolkit::TableView::New(2, 1);
     contentTable.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
@@ -97,18 +111,25 @@ public:
     mContentLayer.Add( contentTable );
 
     // Image selector for progress bar
-    Toolkit::TableView progressBackground = Toolkit::TableView::New( 1, 1 );
+    Toolkit::TableView progressBackground = Toolkit::TableView::New( 3, 1 );
     progressBackground.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
     progressBackground.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
     progressBackground.SetBackgroundColor( BACKGROUND_COLOUR );
     progressBackground.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE ) );
     progressBackground.SetRelativeWidth( 0, 1.0f );
-    progressBackground.SetFitHeight( 0 );
+
+    for( unsigned int i = 0; i < progressBackground.GetRows(); ++i )
+    {
+      progressBackground.SetFitHeight( i );
+    }
+
     contentTable.Add( progressBackground );
-    progressBackground.Add( mProgressBar );
+    progressBackground.Add( mProgressBarDefault );
+    progressBackground.Add( mProgressBarCustomStyle1 );
+    progressBackground.Add( mProgressBarCustomStyle2 );
 
     // Create buttons
-    Toolkit::TableView buttonBackground = Toolkit::TableView::New( 2, 1 );
+    Toolkit::TableView buttonBackground = Toolkit::TableView::New( 1, 1 );
     buttonBackground.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
     buttonBackground.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
     buttonBackground.SetBackgroundColor( BACKGROUND_COLOUR );
@@ -121,73 +142,70 @@ public:
 
     contentTable.Add( buttonBackground );
 
-    mSetProgressButton = Toolkit::PushButton::New();
-    mSetProgressButton.SetLabelText( "Set Progress" );
-    mSetProgressButton.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
-    mSetProgressButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
-    mSetProgressButton.ClickedSignal().Connect( this, &ProgressBarExample::OnSetProgressButtonSelected );
-
-    buttonBackground.Add( mSetProgressButton );
-
     mResetProgressButton = Toolkit::PushButton::New();
-    mResetProgressButton.SetLabelText( "Reset Progress" );
+    mResetProgressButton.SetProperty( Toolkit::Button::Property::LABEL, "Reset" );
     mResetProgressButton.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
     mResetProgressButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
     mResetProgressButton.ClickedSignal().Connect( this, &ProgressBarExample::OnResetProgressButtonSelected );
 
     buttonBackground.Add( mResetProgressButton );
- }
-
- bool OnResetProgressButtonSelected( Toolkit::Button button )
- {
-   mProgressValue = 0.0f;
-   mProgressBar.SetProperty(ProgressBar::Property::PROGRESS_VALUE, 0.0f);
-   return true;
- }
-
- bool OnSetProgressButtonSelected( Toolkit::Button button )
- {
-   mProgressValue += 0.1f;
-   mProgressBar.SetProperty(ProgressBar::Property::PROGRESS_VALUE, mProgressValue);
-   return true;
- }
-
- void OnKeyEvent( const KeyEvent& event )
- {
-   if( event.state == KeyEvent::Down )
-   {
-     if( IsKey( event, Dali::DALI_KEY_ESCAPE ) || IsKey( event, Dali::DALI_KEY_BACK ) )
-     {
-       // Exit application when click back or escape.
-       mApplication.Quit();
-     }
-   }
- }
 
-private:
+    // Create a timer to update the progress of all progress bars
+    mTimer = Timer::New( TIMER_TIMEOUT_TIME );
+    mTimer.TickSignal().Connect( this, &ProgressBarExample::OnTimerTick );
+    mTimer.Start();
+  }
+
+  bool OnTimerTick()
+  {
+    mProgressValue += PROGRESS_INCREMENT_VALUE;
+    mProgressBarDefault.SetProperty(ProgressBar::Property::PROGRESS_VALUE, mProgressValue);
+    mProgressBarCustomStyle1.SetProperty(ProgressBar::Property::PROGRESS_VALUE, mProgressValue);
+    mProgressBarCustomStyle2.SetProperty(ProgressBar::Property::PROGRESS_VALUE, mProgressValue);
+
+    return ( mProgressValue < 1.0f ); // Only call again if progress has NOT got to the end
+  }
+
+  bool OnResetProgressButtonSelected( Toolkit::Button button )
+  {
+    mProgressValue = 0.0f;
+    mProgressBarDefault.SetProperty(ProgressBar::Property::PROGRESS_VALUE, 0.0f);
+    mProgressBarCustomStyle1.SetProperty(ProgressBar::Property::PROGRESS_VALUE, 0.0f);
+    mProgressBarCustomStyle2.SetProperty(ProgressBar::Property::PROGRESS_VALUE, 0.0f);
+    mTimer.Start();
+    return true;
+  }
+
+  void OnKeyEvent( const KeyEvent& event )
+  {
+    if( event.state == KeyEvent::Down )
+    {
+      if( IsKey( event, Dali::DALI_KEY_ESCAPE ) || IsKey( event, Dali::DALI_KEY_BACK ) )
+      {
+        // Exit application when click back or escape.
+        mApplication.Quit();
+      }
+    }
+  }
+
+  // Data
 
   Application&      mApplication;
+  Timer             mTimer;
   Toolkit::Control  mView;                              ///< The View instance.
   Toolkit::ToolBar  mToolBar;                           ///< The View's Toolbar.
   Layer             mContentLayer;                      ///< Content layer.
-  ProgressBar       mProgressBar;
-  Toolkit::PushButton mSetProgressButton;
+  ProgressBar       mProgressBarDefault;
+  ProgressBar       mProgressBarCustomStyle1;
+  ProgressBar       mProgressBarCustomStyle2;
   Toolkit::PushButton mResetProgressButton;
   float mProgressValue;
 };
 
-void RunTest( Application& application )
+int DALI_EXPORT_API main( int argc, char **argv )
 {
+  Application application = Application::New( &argc, &argv, THEME_PATH );
   ProgressBarExample test( application );
   application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-int DALI_EXPORT_API main( int argc, char **argv )
-{
-  Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
-
-  RunTest( application );
-
   return 0;
 }
index 4d67a27..4150ac8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@
 #include <dali/dali.h>
 #include <dali/public-api/rendering/renderer.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
 
 #include <fstream>
 #include <sstream>
@@ -260,8 +261,8 @@ private:
 
     // Add a button to change background. (right of toolbar)
     mChangeTextureButton = Toolkit::PushButton::New();
-    mChangeTextureButton.SetUnselectedImage( CHANGE_TEXTURE_ICON );
-    mChangeTextureButton.SetSelectedImage( CHANGE_TEXTURE_ICON_SELECTED );
+    mChangeTextureButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, CHANGE_TEXTURE_ICON );
+    mChangeTextureButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, CHANGE_TEXTURE_ICON_SELECTED );
     mChangeTextureButton.ClickedSignal().Connect( this, &RefractionEffectExample::OnChangeTexture );
     toolBar.AddControl( mChangeTextureButton,
                         DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage,
@@ -269,8 +270,8 @@ private:
                         DemoHelper::DEFAULT_MODE_SWITCH_PADDING  );
     // Add a button to change mesh pattern. ( left of bar )
     mChangeMeshButton = Toolkit::PushButton::New();
-    mChangeMeshButton.SetUnselectedImage( CHANGE_MESH_ICON );
-    mChangeMeshButton.SetSelectedImage( CHANGE_MESH_ICON_SELECTED );
+    mChangeMeshButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, CHANGE_MESH_ICON );
+    mChangeMeshButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, CHANGE_MESH_ICON_SELECTED );
     mChangeMeshButton.ClickedSignal().Connect( this, &RefractionEffectExample::OnChangeMesh );
     toolBar.AddControl( mChangeMeshButton,
                         DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage,
index d45f1c9..b7bc735 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@
 #include "shared/view.h"
 #include <dali/dali.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
 
 using namespace Dali;
 using namespace Dali::Toolkit;
@@ -33,6 +34,12 @@ const char * const TOOLBAR_IMAGE( DEMO_IMAGE_DIR "top-bar.png" );
 const char * const APPLICATION_TITLE( "ScrollView" );
 const char * const EFFECT_CAROUSEL_IMAGE( DEMO_IMAGE_DIR "icon-scroll-view-carousel.png" );
 const char * const EFFECT_CAROUSEL_IMAGE_SELECTED( DEMO_IMAGE_DIR "icon-scroll-view-carousel-selected.png" );
+const char * const EFFECT_CUBE_IMAGE( DEMO_IMAGE_DIR "icon-scroll-view-inner-cube.png" );
+const char * const EFFECT_CUBE_IMAGE_SELECTED( DEMO_IMAGE_DIR "icon-scroll-view-inner-cube-selected.png" );
+const char * const EFFECT_SPIRAL_IMAGE( DEMO_IMAGE_DIR "icon-scroll-view-spiral.png" );
+const char * const EFFECT_SPIRAL_IMAGE_SELECTED( DEMO_IMAGE_DIR "icon-scroll-view-spiral-selected.png" );
+const char * const EFFECT_WAVE_IMAGE( DEMO_IMAGE_DIR "icon-effect-wave.png" );
+const char * const EFFECT_WAVE_IMAGE_SELECTED( DEMO_IMAGE_DIR "icon-effect-wave-selected.png" );
 
 const Vector3 ICON_SIZE(100.0f, 100.0f, 0.0f);
 
@@ -175,12 +182,12 @@ public:
 
     mEffectIcon[ PageCarouselEffect ] = EFFECT_CAROUSEL_IMAGE;
     mEffectIconSelected[ PageCarouselEffect ] = EFFECT_CAROUSEL_IMAGE_SELECTED;
-    mEffectIcon[ PageCubeEffect ]     = EFFECT_CAROUSEL_IMAGE;
-    mEffectIconSelected[ PageCubeEffect ]     = EFFECT_CAROUSEL_IMAGE_SELECTED;
-    mEffectIcon[ PageSpiralEffect ]   = EFFECT_CAROUSEL_IMAGE;
-    mEffectIconSelected[ PageSpiralEffect ]   = EFFECT_CAROUSEL_IMAGE_SELECTED;
-    mEffectIcon[ PageWaveEffect ]     = EFFECT_CAROUSEL_IMAGE;
-    mEffectIconSelected[ PageWaveEffect ]     = EFFECT_CAROUSEL_IMAGE_SELECTED;
+    mEffectIcon[ PageCubeEffect ]     = EFFECT_CUBE_IMAGE;
+    mEffectIconSelected[ PageCubeEffect ]     = EFFECT_CUBE_IMAGE_SELECTED;
+    mEffectIcon[ PageSpiralEffect ]   = EFFECT_SPIRAL_IMAGE;
+    mEffectIconSelected[ PageSpiralEffect ]   = EFFECT_SPIRAL_IMAGE_SELECTED;
+    mEffectIcon[ PageWaveEffect ]     = EFFECT_WAVE_IMAGE;
+    mEffectIconSelected[ PageWaveEffect ]     = EFFECT_WAVE_IMAGE_SELECTED;
 
     // Create a effect change button. (right of toolbar)
     mEffectChangeButton = Toolkit::PushButton::New();
@@ -244,8 +251,8 @@ private:
     ss << APPLICATION_TITLE << ": " << EFFECT_MODE_NAME[mEffectMode];
     SetTitle(ss.str());
 
-    mEffectChangeButton.SetUnselectedImage( mEffectIcon[ mEffectMode ] );
-    mEffectChangeButton.SetSelectedImage( mEffectIconSelected[ mEffectMode ] );
+    mEffectChangeButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, mEffectIcon[ mEffectMode ] );
+    mEffectChangeButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, mEffectIconSelected[ mEffectMode ] );
 
     // remove old Effect if exists.
     if(mScrollViewEffect)
index 7a8714b..6dac9fa 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
 
 #include <dali/dali.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
 #include <dali-toolkit/devel-api/controls/shadow-view/shadow-view.h>
 
 #include <iostream>
@@ -166,8 +167,8 @@ public:
 
     // Add an effect-changing button on the right of the tool bar.
     Toolkit::PushButton effectChangeButton = Toolkit::PushButton::New();
-    effectChangeButton.SetUnselectedImage( CHANGE_EFFECT_IMAGE );
-    effectChangeButton.SetSelectedImage( CHANGE_EFFECT_IMAGE_SELECTED );
+    effectChangeButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, CHANGE_EFFECT_IMAGE );
+    effectChangeButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, CHANGE_EFFECT_IMAGE_SELECTED );
     effectChangeButton.ClickedSignal().Connect( this, &TestApp::OnEffectButtonClicked );
     toolBar.AddControl( effectChangeButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
 
@@ -180,8 +181,8 @@ public:
 
     //Add a reset button
     Toolkit::PushButton resetButton = Toolkit::PushButton::New();
-    resetButton.SetUnselectedImage( RESET_ICON );
-    resetButton.SetSelectedImage( RESET_ICON_SELECTED );
+    resetButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, RESET_ICON );
+    resetButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, RESET_ICON_SELECTED );
     resetButton.ClickedSignal().Connect( this, &TestApp::OnResetPressed );
     toolBar.AddControl( resetButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalCenter, DemoHelper::DEFAULT_PLAY_PADDING );
 
index 5e03efa..7d2962a 100644 (file)
@@ -800,7 +800,7 @@ public: // From ItemFactory
   {
     Toolkit::PushButton popupButton = Toolkit::PushButton::New();
     popupButton.SetName( TABLEVIEW_BUTTON_ITEMS[ itemId ].name );
-    popupButton.SetLabelText( TABLEVIEW_BUTTON_ITEMS[ itemId ].text );
+    popupButton.SetProperty( Toolkit::Button::Property::LABEL, TABLEVIEW_BUTTON_ITEMS[ itemId ].text );
     popupButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
 
     popupButton.ClickedSignal().Connect( this, &SizeNegotiationController::OnButtonClicked );
index a6b41c7..c805e39 100644 (file)
@@ -37,11 +37,12 @@ const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
   varying mediump vec2 vTexCoord;\n
   uniform sampler2D sTexture;\n
   uniform mediump vec4 uColor;\n
+  uniform mediump vec4 mixColor;\n
   uniform mediump vec3 uChannels;\n
   \n
   void main()\n
   {\n
-    gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor * vec4(uChannels, 1.0) ;\n
+    gl_FragColor = texture2D( sTexture, vTexCoord ) * mixColor * uColor * vec4(uChannels, 1.0) ;\n
   }\n
 );
 
index ffd0aaa..b5b876e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,8 +24,9 @@
 
 // External includes
 #include <dali-toolkit/dali-toolkit.h>
-//#include <dali-toolkit/devel-api/controls/slider/slider.h>
 #include <dali-toolkit/devel-api/controls/popup/popup.h>
+#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
+#include <dali-toolkit/devel-api/visuals/text-visual-properties.h>
 #include "image-channel-control.h"
 #include <cstdio>
 #include <sstream>
@@ -188,7 +189,7 @@ void StylingApplication::Create( Application& application )
     mRadioButtons[i].SetName( radioButtonStyleName.str() );
     mRadioButtons[i].SetParentOrigin( ParentOrigin::TOP_LEFT );
     mRadioButtons[i].SetAnchorPoint( AnchorPoint::TOP_LEFT );
-    mRadioButtons[i].SetSelected( false );
+    mRadioButtons[i].SetProperty( Button::Property::SELECTED, false );
     mRadioButtons[i].StateChangedSignal().Connect( this, &StylingApplication::OnButtonStateChange );
 
     radioButtonsLayout.AddChild( mRadioButtons[i], TableView::CellPosition( i, 0 ) );
@@ -197,7 +198,7 @@ void StylingApplication::Create( Application& application )
     radioButtonsLayout.SetCellAlignment( TableView::CellPosition( i, 1 ), HorizontalAlignment::CENTER, VerticalAlignment::CENTER );
   }
 
-  mRadioButtons[0].SetSelected( true );
+  mRadioButtons[0].SetProperty( Button::Property::SELECTED, true );
 
   mImagePlacement = Actor::New();
   mImagePlacement.SetParentOrigin( ParentOrigin::CENTER );
@@ -212,7 +213,7 @@ void StylingApplication::Create( Application& application )
   mIcc1.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
   mIcc1.SetParentOrigin( ParentOrigin::CENTER );
   mIcc1.SetVisibility( true );
-  
+
   mImagePlacement.Add( mIcc1 );
 
   mIcc2 = ImageChannelControl::New( BIG_IMAGE_2 );
@@ -265,7 +266,7 @@ void StylingApplication::Create( Application& application )
     mCheckButtons[i].SetName( checkBoxStyleName.str() );
     mCheckButtons[i].SetParentOrigin( ParentOrigin::CENTER );
     mCheckButtons[i].SetAnchorPoint( AnchorPoint::CENTER );
-    mCheckButtons[i].SetSelected( true );
+    mCheckButtons[i].SetProperty( Button::Property::SELECTED, true );
 
     mCheckButtons[i].StateChangedSignal().Connect( this, &StylingApplication::OnCheckButtonChange );
     mCheckButtons[i].RegisterProperty( "channel", i, Property::READ_WRITE );
@@ -309,7 +310,7 @@ void StylingApplication::Create( Application& application )
   }
 
   mResetButton = PushButton::New();
-  mResetButton.SetLabelText( "Reset" );
+  mResetButton.SetProperty( Toolkit::Button::Property::LABEL, "Reset" );
   mResetButton.SetName("ResetButton");
   mResetButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
   mResetButton.ClickedSignal().Connect( this, &StylingApplication::OnResetClicked );
@@ -349,9 +350,9 @@ void StylingApplication::Create( Application& application )
     mThemeButtons[i].ClickedSignal().Connect( this, &StylingApplication::OnThemeButtonClicked );
     themeButtonLayout.AddChild( mThemeButtons[i], TableView::CellPosition( 0, 1+i ) );
   }
-  mThemeButtons[0].SetLabelText( "Lite" ); // Lightweight changes on top of Dali
-  mThemeButtons[1].SetLabelText( "App1" ); // Different application style
-  mThemeButtons[2].SetLabelText( "App2" );
+  mThemeButtons[0].SetProperty( Toolkit::Button::Property::LABEL, "Lite" ); // Lightweight changes on top of Dali
+  mThemeButtons[1].SetProperty( Toolkit::Button::Property::LABEL, "App1" ); // Different application style
+  mThemeButtons[2].SetProperty( Toolkit::Button::Property::LABEL, "App2" );
 
   contentLayout.Add( themeButtonLayout );
 }
@@ -438,7 +439,7 @@ Popup StylingApplication::CreateResetPopup()
   PushButton okayButton = PushButton::New();
   okayButton.SetName( POPUP_CONTROL_OK_NAME );
   okayButton.SetStyleName( POPUP_CONTROL_OK_NAME );
-  okayButton.SetLabelText( "Ok!" );
+  okayButton.SetProperty( Toolkit::Button::Property::LABEL, "Ok!" );
   okayButton.ClickedSignal().Connect( this, &StylingApplication::OnReset );
   okayButton.SetParentOrigin( ParentOrigin::CENTER );
   okayButton.SetAnchorPoint( AnchorPoint::CENTER );
@@ -448,7 +449,7 @@ Popup StylingApplication::CreateResetPopup()
   PushButton cancelButton = PushButton::New();
   cancelButton.SetName( POPUP_CONTROL_CANCEL_NAME );
   cancelButton.SetStyleName( POPUP_CONTROL_CANCEL_NAME );
-  cancelButton.SetLabelText( "Cancel" );
+  cancelButton.SetProperty( Toolkit::Button::Property::LABEL, "Cancel" );
   cancelButton.ClickedSignal().Connect( this, &StylingApplication::OnResetCancelled );
   cancelButton.SetParentOrigin( ParentOrigin::CENTER );
   cancelButton.SetAnchorPoint( AnchorPoint::CENTER );
@@ -484,20 +485,20 @@ bool StylingApplication::OnButtonStateChange( Button button )
 
 // Todo: save / restore slider states per image
 
-  if( button.IsSelected() )
+  if( button.GetProperty<bool>(Button::Property::SELECTED) )
   {
 
     ImageChannelControl prevIcc = mImageChannelControl;
 
-    if( mRadioButtons[0].IsSelected() )
+    if( mRadioButtons[0].GetProperty<bool>(Button::Property::SELECTED) )
     {
       mImageChannelControl = mIcc1;
     }
-    else if( mRadioButtons[1].IsSelected() )
+    else if( mRadioButtons[1].GetProperty<bool>(Button::Property::SELECTED) )
     {
       mImageChannelControl = mIcc2;
     }
-    else if( mRadioButtons[2].IsSelected() )
+    else if( mRadioButtons[2].GetProperty<bool>(Button::Property::SELECTED) )
     {
       mImageChannelControl = mIcc3;
     }
@@ -523,7 +524,7 @@ bool StylingApplication::OnCheckButtonChange( Button button )
   {
     int channel = button.GetProperty<int>( index );
     float value = mChannelSliders[channel].GetProperty<float>( Slider::Property::VALUE );
-    if( !button.IsSelected() )
+    if( !button.GetProperty<bool>(Button::Property::SELECTED) )
     {
       // "Turn off" the channel's contribution
       value = 0.0f;
@@ -600,7 +601,7 @@ bool StylingApplication::OnSliderChanged( Slider slider, float value )
   if( index != Property::INVALID_INDEX )
   {
     int channel = slider.GetProperty<int>( index );
-    if( mCheckButtons[channel].IsSelected() )
+    if( mCheckButtons[channel].GetProperty<bool>(Button::Property::SELECTED) )
     {
       Property::Index channelIndex = GetChannelProperty( channel );
       mImageChannelControl.SetProperty(channelIndex, value/100.0f);
index 088692a..d466e9f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,8 +16,9 @@
  */
 #include <dali/dali.h>
 #include <dali-toolkit/dali-toolkit.h>
-#include <dali-toolkit/devel-api/controls/super-blur-view/super-blur-view.h>
 #include <dali-toolkit/devel-api/controls/bloom-view/bloom-view.h>
+#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
+#include <dali-toolkit/devel-api/controls/super-blur-view/super-blur-view.h>
 #include "shared/view.h"
 #include "shared/utility.h"
 
@@ -81,8 +82,9 @@ private:
 
     // Add a button to change background. (right of toolbar)
     Toolkit::PushButton changeBackgroundButton = Toolkit::PushButton::New();
-    changeBackgroundButton.SetUnselectedImage( CHANGE_BACKGROUND_ICON );
-    changeBackgroundButton.SetSelectedImage( CHANGE_BACKGROUND_ICON_SELECTED );
+    changeBackgroundButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, CHANGE_BACKGROUND_ICON );
+    changeBackgroundButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, CHANGE_BACKGROUND_ICON_SELECTED );
+
     changeBackgroundButton.ClickedSignal().Connect( this, &BlurExample::OnChangeBackgroundIconClicked );
     mToolBar.AddControl( changeBackgroundButton,
         DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage,
@@ -91,8 +93,9 @@ private:
 
     // Add a button to change the blur view. (left of toolbar)
     Toolkit::PushButton changeBlurButton = Toolkit::PushButton::New();
-    changeBlurButton.SetUnselectedImage( CHANGE_BLUR_ICON );
-    changeBlurButton.SetSelectedImage( CHANGE_BLUR_ICON_SELECTED );
+    changeBlurButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, CHANGE_BLUR_ICON );
+    changeBlurButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, CHANGE_BLUR_ICON_SELECTED );
+
     changeBlurButton.ClickedSignal().Connect( this, &BlurExample::OnChangeBlurIconClicked );
     mToolBar.AddControl( changeBlurButton,
         DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage,
index 209c280..23d9dbb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali-toolkit/dali-toolkit.h>
-#include <iostream>
+#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
 #include <sstream>
 
 // INTERNAL INCLUDES
@@ -140,8 +140,7 @@ public:
     mColorButtonOption.SetParentOrigin( ParentOrigin::CENTER );
     mColorButtonOption.SetAnchorPoint( AnchorPoint::CENTER );
 
-    mColorButtonOption.SetProperty( Button::Property::UNSELECTED_COLOR, Color::BLACK );
-    mColorButtonOption.SetProperty( Button::Property::SELECTED_COLOR, Color::BLACK );
+    SetButtonColor( mColorButtonOption, Color::BLACK );
 
     mColorButtonOption.ClickedSignal().Connect( this, &TextEditorExample::OnChangeColorButtonClicked );
     mColorContainer.Add( mColorButtonOption );
@@ -208,8 +207,7 @@ public:
       s << "color" << index;
       button.SetName( s.str() );
 
-      button.SetProperty( Button::Property::UNSELECTED_COLOR, COLORS[index] );
-      button.SetProperty( Button::Property::SELECTED_COLOR, COLORS[index] );
+      SetButtonColor( button, COLORS[index] );
 
       button.ClickedSignal().Connect( this, &TextEditorExample::OnColorButtonClicked );
 
@@ -253,8 +251,7 @@ public:
       mEditor.SetProperty( TextEditor::Property::INPUT_COLOR, color );
     }
 
-    mColorButtonOption.SetProperty( Button::Property::UNSELECTED_COLOR, color );
-    mColorButtonOption.SetProperty( Button::Property::SELECTED_COLOR, color );
+    SetButtonColor( mColorButtonOption, color  );
 
     mButtonContainer.SetVisible( false );
     mButtonContainer.SetSensitive( false );
@@ -267,14 +264,22 @@ public:
     if( TextEditor::InputStyle::NONE != static_cast<TextEditor::InputStyle::Mask>( mask & TextEditor::InputStyle::COLOR ) )
     {
       const Vector4 color = editor.GetProperty( TextEditor::Property::INPUT_COLOR ).Get<Vector4>();
-
-      mColorButtonOption.SetProperty( Button::Property::UNSELECTED_COLOR, color );
-      mColorButtonOption.SetProperty( Button::Property::SELECTED_COLOR, color );
+      SetButtonColor( mColorButtonOption, color  );
     }
 
     editor.Reset();
   }
 
+  void SetButtonColor( Button& button, const Vector4& color )
+  {
+    Property::Map colorVisualMap;
+    colorVisualMap.Add( Visual::Property::TYPE, Visual::COLOR )
+                  .Add( ColorVisual::Property::MIX_COLOR, color );
+
+    button.SetProperty( DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, colorVisualMap );
+    button.SetProperty( DevelButton::Property::SELECTED_BACKGROUND_VISUAL, colorVisualMap );
+  }
+
 private:
 
   Application& mApplication;
index 1b21b48..5e025b1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
 #include <dali-toolkit/devel-api/controls/popup/popup.h>
 #include <iostream>
 #include <dali/public-api/events/touch-point.h>
@@ -86,8 +87,8 @@ public:
   PushButton CreateFolderButton()
   {
     PushButton button = PushButton::New();
-    button.SetUnselectedImage( FOLDER_ICON_IMAGE );
-    button.SetSelectedImage( FOLDER_OPEN_ICON_IMAGE );
+    button.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, FOLDER_ICON_IMAGE );
+    button.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, FOLDER_OPEN_ICON_IMAGE );
     button.SetAnchorPoint( AnchorPoint::TOP_LEFT );
     button.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
     ImageDimensions imageSize = ResourceImage::GetImageSize( FOLDER_ICON_IMAGE );
@@ -151,7 +152,7 @@ public:
     {
       Property::Value text = mField.GetProperty( TextField::Property::TEXT );
       mButtonLabel = text.Get< std::string >();
-      mButton.SetLabelText( mButtonLabel );
+      mButton.SetProperty( Toolkit::Button::Property::LABEL, mButtonLabel );
     }
 
     // Hide & discard the pop-up
@@ -176,7 +177,7 @@ public:
           {
             Property::Value text = mField.GetProperty( TextField::Property::TEXT );
             mButtonLabel = text.Get< std::string >();
-            mButton.SetLabelText( mButtonLabel );
+            mButton.SetProperty( Toolkit::Button::Property::LABEL, mButtonLabel );
             mField.ClearKeyInputFocus();
           }
           break;
diff --git a/examples/transitions/beat-control-impl.cpp b/examples/transitions/beat-control-impl.cpp
deleted file mode 100644 (file)
index 6b0f3e6..0000000
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "beat-control-impl.h"
-#include <dali-toolkit/dali-toolkit.h>
-#include <dali/public-api/object/type-registry-helper.h>
-#include <dali-toolkit/devel-api/align-enums.h>
-#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
-#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
-
-#include <cstdio>
-
-using namespace Dali; // Needed for macros
-using namespace Dali::Toolkit;
-
-namespace Demo
-{
-namespace Internal
-{
-
-namespace
-{
-
-
-Dali::BaseHandle Create()
-{
-  return Demo::BeatControl::New();
-}
-
-DALI_TYPE_REGISTRATION_BEGIN( BeatControl, Dali::Toolkit::Control, Create );
-
-DALI_PROPERTY_REGISTRATION( Demo, BeatControl, "bounceTransition", STRING, BOUNCE_TRANSITION );
-DALI_PROPERTY_REGISTRATION( Demo, BeatControl, "leftTransition", STRING, LEFT_TRANSITION );
-DALI_PROPERTY_REGISTRATION( Demo, BeatControl, "upTransition", STRING, UP_TRANSITION );
-DALI_PROPERTY_REGISTRATION( Demo, BeatControl, "beatVisual", MAP, BEAT_VISUAL );
-DALI_TYPE_REGISTRATION_END();
-
-
-Toolkit::TransitionData ConvertPropertyToTransition( const Property::Value& value )
-{
-  Toolkit::TransitionData transitionData;
-
-  if( value.GetType() == Property::ARRAY )
-  {
-    transitionData = Toolkit::TransitionData::New( *value.GetArray());
-  }
-  else if( value.GetType() == Property::MAP )
-  {
-    transitionData = Toolkit::TransitionData::New( *value.GetMap() );
-  }
-  return transitionData;
-}
-
-} // anonymous namespace
-
-
-Internal::BeatControl::BeatControl()
-: Control( ControlBehaviour( REQUIRES_STYLE_CHANGE_SIGNALS ) )
-{
-}
-
-Internal::BeatControl::~BeatControl()
-{
-}
-
-Demo::BeatControl Internal::BeatControl::New()
-{
-  IntrusivePtr<Internal::BeatControl> impl = new Internal::BeatControl();
-  Demo::BeatControl handle = Demo::BeatControl( *impl );
-  impl->Initialize();
-  return handle;
-}
-
-
-void BeatControl::StartBounceAnimation()
-{
-  if( mAnimation )
-  {
-    mAnimation.Stop();
-    mAnimation.FinishedSignal().Disconnect( this, &BeatControl::OnBounceAnimationFinished );
-    OnBounceAnimationFinished(mAnimation);
-  }
-
-  mAnimation = CreateTransition( mBounceTransition );
-  mAnimation.FinishedSignal().Connect( this, &BeatControl::OnBounceAnimationFinished );
-  mAnimation.Play();
-}
-
-
-void BeatControl::StartXAnimation()
-{
-  if( mXAnimation )
-  {
-    mXAnimation.Stop();
-    mXAnimation.FinishedSignal().Disconnect( this, &BeatControl::OnXAnimationFinished );
-    OnXAnimationFinished(mXAnimation);
-  }
-
-  mXAnimation = CreateTransition( mLeftTransition );
-  mXAnimation.FinishedSignal().Connect( this, &BeatControl::OnXAnimationFinished );
-  mXAnimation.Play();
-}
-
-void BeatControl::StartYAnimation()
-{
-  if( mYAnimation )
-  {
-    mYAnimation.Stop();
-    mYAnimation.FinishedSignal().Disconnect( this, &BeatControl::OnYAnimationFinished );
-    OnYAnimationFinished(mYAnimation);
-  }
-
-  mYAnimation = CreateTransition( mUpTransition );
-  mYAnimation.FinishedSignal().Connect( this, &BeatControl::OnYAnimationFinished );
-  mYAnimation.Play();
-}
-
-
-void BeatControl::OnBounceAnimationFinished( Animation& src )
-{
-  // Do stuff
-}
-void BeatControl::OnXAnimationFinished( Animation& src )
-{
-  // Do stuff
-}
-void BeatControl::OnYAnimationFinished( Animation& src )
-{
-  // Do stuff
-}
-
-void BeatControl::OnInitialize()
-{
-  Actor self = Self();
-}
-
-void BeatControl::OnStageConnection( int depth )
-{
-  Control::OnStageConnection( depth );
-}
-
-void BeatControl::OnStageDisconnection()
-{
-  Control::OnStageDisconnection();
-}
-
-void BeatControl::OnSizeSet( const Vector3& targetSize )
-{
-  Control::OnSizeSet( targetSize );
-  RelayoutVisuals( Vector2( targetSize ) );
-}
-
-void BeatControl::OnRelayout( const Vector2& targetSize, RelayoutContainer& container )
-{
-  RelayoutVisuals( targetSize );
-}
-
-void BeatControl::RelayoutVisuals( const Vector2& targetSize )
-{
-  if( mVisual )
-  {
-    Vector2 size( targetSize );
-    Property::Map transformMap;
-    // Make the visual half the size of the control, but leave
-    // origin and anchor point at center, position is relative, but Zer0
-    transformMap[ DevelVisual::Transform::Property::SIZE ] = Vector2(0.5, 0.5);
-    mVisual.SetTransformAndSize( transformMap, size );
-
-    // @todo We must stop this clashing with a transform animation
-  }
-}
-
-Vector3 BeatControl::GetNaturalSize()
-{
-  if( mVisual )
-  {
-    Vector2 naturalSize;
-    mVisual.GetNaturalSize(naturalSize);
-    return Vector3(naturalSize);
-  }
-  return Vector3::ZERO;
-}
-
-void BeatControl::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change )
-{
-  // Chain up.
-  Control::OnStyleChange( styleManager, change );
-}
-
-
-///////////////////////////////////////////////////////////
-//
-// Properties
-//
-
-void BeatControl::SetProperty( BaseObject* object, Property::Index index, const Property::Value& value )
-{
-  Demo::BeatControl beatControl = Demo::BeatControl::DownCast( Dali::BaseHandle( object ) );
-
-  if( beatControl )
-  {
-    BeatControl& impl = GetImpl( beatControl );
-    Actor self = impl.Self();
-    switch ( index )
-    {
-      case Demo::BeatControl::Property::BEAT_VISUAL:
-      {
-        Property::Map* map = value.GetMap();
-        if( map )
-        {
-          impl.mVisual = Toolkit::VisualFactory::Get().CreateVisual( *map );
-          impl.RegisterVisual( Demo::BeatControl::Property::BEAT_VISUAL, impl.mVisual );
-        }
-        break;
-      }
-      case Demo::BeatControl::Property::BOUNCE_TRANSITION:
-      {
-        impl.mBounceTransition = ConvertPropertyToTransition( value );
-        break;
-      }
-      case Demo::BeatControl::Property::LEFT_TRANSITION:
-      {
-        impl.mLeftTransition = ConvertPropertyToTransition( value );
-        break;
-      }
-      case Demo::BeatControl::Property::UP_TRANSITION:
-      {
-        impl.mUpTransition = ConvertPropertyToTransition( value );
-        break;
-      }
-    }
-  }
-}
-
-Property::Value BeatControl::GetProperty( BaseObject* object, Property::Index propertyIndex )
-{
-  Property::Value value;
-
-  Demo::BeatControl beatControl = Demo::BeatControl::DownCast( Dali::BaseHandle( object ) );
-
-  if ( beatControl )
-  {
-    BeatControl& impl = GetImpl( beatControl );
-    switch ( propertyIndex )
-    {
-      case Demo::BeatControl::Property::BEAT_VISUAL:
-      {
-        if( impl.mVisual )
-        {
-          Property::Map map;
-          impl.mVisual.CreatePropertyMap(map);
-          value = map;
-        }
-        break;
-      }
-      case Demo::BeatControl::Property::BOUNCE_TRANSITION:
-      default:
-        break;
-    }
-  }
-
-  return value;
-}
-
-
-} // Internal
-} // Demo
diff --git a/examples/transitions/beat-control-impl.h b/examples/transitions/beat-control-impl.h
deleted file mode 100644 (file)
index e4f9a99..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-#ifndef DALI_DEMO_INTERNAL_BEAT_CONTROL_IMPL_H
-#define DALI_DEMO_INTERNAL_BEAT_CONTROL_IMPL_H
-
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "beat-control.h"
-#include <dali/public-api/animation/animation.h>
-#include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali-toolkit/devel-api/visual-factory/visual-base.h>
-#include <dali-toolkit/devel-api/visual-factory/transition-data.h>
-
-namespace Demo
-{
-
-namespace Internal // To use TypeRegistry, handle and body classes need the same name
-{
-
-class BeatControl : public Dali::Toolkit::Internal::Control
-{
-public:
-  /**
-   * Instantiate a new BeatControl object
-   */
-  static Demo::BeatControl New();
-  BeatControl();
-  ~BeatControl();
-
-public: // API
-  void StartBounceAnimation();
-
-  void StartXAnimation();
-
-  void StartYAnimation();
-
-public:  // Properties
-  /**
-   * Called when a property of an object of this type is set.
-   * @param[in] object The object whose property is set.
-   * @param[in] index The property index.
-   * @param[in] value The new property value.
-   */
-  static void SetProperty( Dali::BaseObject* object, Dali::Property::Index index, const Dali::Property::Value& value );
-
-  /**
-   * Called to retrieve a property of an object of this type.
-   * @param[in] object The object whose property is to be retrieved.
-   * @param[in] index The property index.
-   * @return The current value of the property.
-   */
-  static Dali::Property::Value GetProperty( Dali::BaseObject* object, Dali::Property::Index propertyIndex );
-
-private: // From Control
-  /**
-   * @copydoc Toolkit::Control::OnInitialize()
-   */
-  virtual void OnInitialize();
-
-  /**
-   * @copydoc Toolkit::Control::OnStageConnect()
-   */
-  virtual void OnStageConnection( int depth );
-
-  /**
-   * @copydoc Toolkit::Control::OnStageDisconnection()
-   */
-  virtual void OnStageDisconnection();
-
-  /**
-   * @copydoc Toolkit::Control::OnSizeSet()
-   */
-  virtual void OnSizeSet( const Dali::Vector3& targetSize );
-
-  /**
-   * @copydoc Toolkit::Control::OnRelayout()
-   */
-  virtual void OnRelayout( const Dali::Vector2& targetSize, Dali::RelayoutContainer& container );
-  /**
-   * @copydoc Toolkit::Control::GetNaturalSize
-   */
-  virtual Dali::Vector3 GetNaturalSize();
-
-  /**
-   * @copydoc Toolkit::Control::OnStyleChange
-   */
-  virtual void OnStyleChange( Dali::Toolkit::StyleManager styleManager, Dali::StyleChange::Type change );
-
-private:
-  void OnBounceAnimationFinished( Dali::Animation& handle );
-  void OnXAnimationFinished( Dali::Animation& src );
-  void OnYAnimationFinished( Dali::Animation& src );
-
-  /**
-   * Relayout the visuals as a result of size negotiation
-   */
-  void RelayoutVisuals( const Dali::Vector2& targetSize );
-
-private:
-  //undefined
-  BeatControl( const BeatControl& );
-  BeatControl& operator=( const BeatControl& );
-
-private:
-  // Implementation details
-  Dali::Toolkit::Visual::Base mVisual;
-  Dali::Toolkit::TransitionData mBounceTransition;
-  Dali::Toolkit::TransitionData mLeftTransition;
-  Dali::Toolkit::TransitionData mUpTransition;
-  Dali::Animation mAnimation;
-  Dali::Animation mXAnimation;
-  Dali::Animation mYAnimation;
-};
-
-} // Internal
-
-inline Internal::BeatControl& GetImpl( Demo::BeatControl& handle )
-{
-  DALI_ASSERT_ALWAYS( handle );
-  Dali::RefObject& object = handle.GetImplementation();
-  return static_cast<Internal::BeatControl&>(object);
-}
-
-inline const Internal::BeatControl& GetImpl( const Demo::BeatControl& handle )
-{
-  DALI_ASSERT_ALWAYS( handle );
-  const Dali::RefObject& object = handle.GetImplementation();
-  return static_cast<const Internal::BeatControl&>(object);
-}
-
-} // Demo
-
-#endif //  DALI_DEMO_BEAT_CONTROL_IMPL_H
diff --git a/examples/transitions/beat-control.cpp b/examples/transitions/beat-control.cpp
deleted file mode 100644 (file)
index c145b5e..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "beat-control.h"
-#include "beat-control-impl.h"
-
-namespace Demo
-{
-
-BeatControl::BeatControl()
-{
-}
-
-BeatControl::BeatControl( const BeatControl& beatControl )
-: Control( beatControl )
-{
-}
-
-BeatControl& BeatControl::operator= ( const BeatControl& rhs )
-{
-  if( &rhs != this )
-  {
-    Control::operator=( rhs );
-  }
-  return *this;
-}
-
-BeatControl::~BeatControl()
-{
-}
-
-BeatControl BeatControl::New()
-{
-  BeatControl beatControl = Internal::BeatControl::New();
-  return beatControl;
-}
-
-BeatControl BeatControl::New( const std::string& url )
-{
-  BeatControl beatControl = Internal::BeatControl::New();
-  return beatControl;
-}
-
-BeatControl BeatControl::DownCast( BaseHandle handle )
-{
-  return Control::DownCast< BeatControl, Internal::BeatControl > ( handle );
-}
-
-void BeatControl::StartBounceAnimation()
-{
-  GetImpl(*this).StartBounceAnimation();
-}
-
-void BeatControl::StartXAnimation()
-{
-  GetImpl(*this).StartXAnimation();
-}
-void BeatControl::StartYAnimation()
-{
-  GetImpl(*this).StartYAnimation();
-}
-
-
-BeatControl::BeatControl( Internal::BeatControl& implementation )
-: Control( implementation )
-{
-}
-
-BeatControl::BeatControl( Dali::Internal::CustomActor* internal )
-: Control( internal )
-{
-  VerifyCustomActorPointer< Internal::BeatControl >( internal ) ;
-}
-
-
-} //namespace Demo
diff --git a/examples/transitions/beat-control.h b/examples/transitions/beat-control.h
deleted file mode 100644 (file)
index c424d89..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-#ifndef DALI_DEMO_BEAT_CONTROL_H
-#define DALI_DEMO_BEAT_CONTROL_H
-
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <dali-toolkit/dali-toolkit.h>
-#include <string>
-
-namespace Demo
-{
-
-namespace Internal
-{
-// All type registered types need to have the same name for the body and the handle
-class BeatControl;
-}
-
-/**
- * Control that allows the RGB channels of an image to be altered.
- */
-class BeatControl : public Dali::Toolkit::Control
-{
-public:
-  /**
-   * The start and end property ranges for this control
-   */
-  enum PropertyRange
-  {
-    PROPERTY_START_INDEX = Dali::Toolkit::Control::CONTROL_PROPERTY_END_INDEX + 1,
-    PROPERTY_END_INDEX   = PROPERTY_START_INDEX + 1000,
-    ANIMATABLE_PROPERTY_START_INDEX = Dali::ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX,
-    ANIMATABLE_PROPERTY_END_INDEX = ANIMATABLE_PROPERTY_START_INDEX+1000
-  };
-
-  struct Property
-  {
-    enum
-    {
-      BOUNCE_TRANSITION = PROPERTY_START_INDEX,
-      LEFT_TRANSITION,
-      UP_TRANSITION,
-      BEAT_VISUAL
-    };
-  };
-
-public: // Construction / destruction
-
-  /**
-   * Create an uninitialized handle
-   */
-  BeatControl();
-
-  /**
-   * Create a new image channel control without an image. Use
-   * SetImage to give this control an image
-   */
-  static BeatControl New();
-
-  /**
-   * Create a new image channel control from a given URL
-   */
-  static BeatControl New( const std::string& url );
-
-  /**
-   * Destructor. This is non-virtual since derived Handle types must not
-   * contain data or virtual methods
-   */
-  ~BeatControl();
-
-  /**
-   * Copy Constructor
-   */
-  BeatControl( const BeatControl& beatControl );
-
-  /**
-   * Assignment Operator
-   */
-  BeatControl& operator=( const BeatControl& beatControl );
-
-  /**
-   * Downcast
-   */
-  static BeatControl DownCast( BaseHandle handle );
-
-public: // API
-
-  void StartBounceAnimation();
-
-  void StartXAnimation();
-
-  void StartYAnimation();
-
-public: // Not for public use
-  /**
-   * Create a handle from an implementation
-   */
-  BeatControl( Internal::BeatControl& implementation );
-
-  /**
-   * Allow the creation of an BeatControl handle from an internal CustomActor pointer
-   */
-  BeatControl( Dali::Internal::CustomActor* internal );
-};
-
-} // namespace Demo
-
-#endif // DALI_DEMO_BEAT_CONTROL_H
diff --git a/examples/transitions/shadow-button-impl.cpp b/examples/transitions/shadow-button-impl.cpp
new file mode 100644 (file)
index 0000000..8a6ea56
--- /dev/null
@@ -0,0 +1,569 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "shadow-button-impl.h"
+#include <dali-toolkit/dali-toolkit.h>
+#include <dali/public-api/object/type-registry-helper.h>
+#include <dali/devel-api/scripting/enum-helper.h>
+#include <dali-toolkit/devel-api/align-enums.h>
+#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
+#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
+
+#include <cstdio>
+
+using namespace Dali; // Needed for macros
+using namespace Dali::Toolkit;
+
+namespace Demo
+{
+namespace Internal
+{
+
+namespace
+{
+
+
+Dali::BaseHandle Create()
+{
+  return Demo::ShadowButton::New();
+}
+
+DALI_TYPE_REGISTRATION_BEGIN( ShadowButton, Dali::Toolkit::Button, Create );
+
+DALI_PROPERTY_REGISTRATION( Demo, ShadowButton, "activeTransition", ARRAY, ACTIVE_TRANSITION );
+DALI_PROPERTY_REGISTRATION( Demo, ShadowButton, "inactiveTransition", ARRAY, INACTIVE_TRANSITION );
+DALI_PROPERTY_REGISTRATION( Demo, ShadowButton, "checkTransition", ARRAY, CHECK_TRANSITION );
+DALI_PROPERTY_REGISTRATION( Demo, ShadowButton, "uncheckTransition", ARRAY, UNCHECK_TRANSITION );
+DALI_PROPERTY_REGISTRATION( Demo, ShadowButton, "backgroundVisual", MAP, BACKGROUND_VISUAL );
+DALI_PROPERTY_REGISTRATION( Demo, ShadowButton, "checkboxBgVisual", MAP, CHECKBOX_BG_VISUAL );
+DALI_PROPERTY_REGISTRATION( Demo, ShadowButton, "checkboxFgVisual", MAP, CHECKBOX_FG_VISUAL );
+DALI_PROPERTY_REGISTRATION( Demo, ShadowButton, "labelVisual", MAP, LABEL_VISUAL );
+DALI_PROPERTY_REGISTRATION( Demo, ShadowButton, "checkState", BOOLEAN, ACTIVE_STATE );
+DALI_PROPERTY_REGISTRATION( Demo, ShadowButton, "checkState", BOOLEAN, CHECK_STATE );
+
+DALI_TYPE_REGISTRATION_END();
+
+DALI_ENUM_TO_STRING_TABLE_BEGIN( VISUAL_PROPERTIES )
+{ "backgroundVisual", Demo::ShadowButton::Property::BACKGROUND_VISUAL },
+{ "checkboxBgVisual", Demo::ShadowButton::Property::CHECKBOX_BG_VISUAL},
+{ "checkboxFgVisual", Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL},
+{ "labelVisual",      Demo::ShadowButton::Property::LABEL_VISUAL}
+DALI_ENUM_TO_STRING_TABLE_END( VISUAL_PROPERTIES )
+
+Toolkit::TransitionData ConvertPropertyToTransition( const Property::Value& value )
+{
+  Toolkit::TransitionData transitionData;
+
+  if( value.GetType() == Property::ARRAY )
+  {
+    transitionData = Toolkit::TransitionData::New( *value.GetArray());
+  }
+  else if( value.GetType() == Property::MAP )
+  {
+    transitionData = Toolkit::TransitionData::New( *value.GetMap() );
+  }
+  return transitionData;
+}
+
+} // anonymous namespace
+
+
+Internal::ShadowButton::ShadowButton()
+: Control( ControlBehaviour( REQUIRES_STYLE_CHANGE_SIGNALS ) ),
+  mCheckState(false),
+  mActiveState(false)
+{
+}
+
+Internal::ShadowButton::~ShadowButton()
+{
+}
+
+Demo::ShadowButton Internal::ShadowButton::New()
+{
+  IntrusivePtr<Internal::ShadowButton> impl = new Internal::ShadowButton();
+  Demo::ShadowButton handle = Demo::ShadowButton( *impl );
+  impl->Initialize();
+  return handle;
+}
+
+void ShadowButton::SetActiveState( bool active )
+{
+  if( active != mActiveState )
+  {
+    mActiveState = active;
+    if( active )
+    {
+      StartTransition( Demo::ShadowButton::Property::ACTIVE_TRANSITION );
+    }
+    else
+    {
+      StartTransition( Demo::ShadowButton::Property::INACTIVE_TRANSITION );
+    }
+  }
+}
+
+bool ShadowButton::GetActiveState()
+{
+  return mActiveState;
+}
+
+void ShadowButton::SetCheckState( bool checkState )
+{
+  mCheckState = checkState;
+  EnableVisual( Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL, true );
+  if( Self().OnStage() )
+  {
+    if( checkState )
+    {
+      StartTransition( Demo::ShadowButton::Property::CHECK_TRANSITION );
+    }
+    else
+    {
+      StartTransition( Demo::ShadowButton::Property::UNCHECK_TRANSITION );
+    }
+  }
+  RelayoutRequest();
+}
+
+bool ShadowButton::GetCheckState()
+{
+  return mCheckState;
+}
+
+void ShadowButton::StartTransition( Property::Index transitionId )
+{
+  Transitions::iterator iter = FindTransition( transitionId );
+  if( iter != mTransitions.end() )
+  {
+    if( iter->mAnimation )
+    {
+      iter->mAnimation.Stop();
+      iter->mPlaying = false;
+
+      iter->mAnimation.FinishedSignal().Disconnect( this, &ShadowButton::OnTransitionFinished );
+    }
+
+    iter->mAnimation = CreateTransition( iter->mTransitionData );
+    StoreTargetLayouts( iter->mTransitionData );
+
+    iter->mAnimation.FinishedSignal().Connect( this, &ShadowButton::OnTransitionFinished );
+    iter->mAnimation.Play();
+    iter->mPlaying = true;
+  }
+}
+
+void ShadowButton::OnTransitionFinished( Animation& src )
+{
+  ShadowButton::Transitions::iterator iter = mTransitions.begin();
+  for( ; iter != mTransitions.end(); ++iter )
+  {
+    if( iter->mAnimation == src )
+    {
+      iter->mPlaying = false;
+      iter->mAnimation.Reset(); // Remove the animation when it's finished.
+      switch( iter->mTransitionId )
+      {
+        case Demo::ShadowButton::Property::ACTIVE_TRANSITION:
+        {
+          // Consider relayouting the text.
+          break;
+        }
+        case Demo::ShadowButton::Property::INACTIVE_TRANSITION:
+        {
+          // Consider relayouting the text.
+          break;
+        }
+        case Demo::ShadowButton::Property::UNCHECK_TRANSITION:
+        {
+          EnableVisual( Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL, false );
+          break;
+        }
+      }
+      break;
+    }
+  }
+}
+
+void ShadowButton::OnInitialize()
+{
+  Actor self = Self();
+}
+
+void ShadowButton::OnStageConnection( int depth )
+{
+  Control::OnStageConnection( depth );
+}
+
+void ShadowButton::OnStageDisconnection()
+{
+  Control::OnStageDisconnection();
+}
+
+void ShadowButton::OnSizeSet( const Vector3& targetSize )
+{
+  Control::OnSizeSet( targetSize );
+  RelayoutVisuals( Vector2( targetSize ) );
+}
+
+void ShadowButton::OnRelayout( const Vector2& targetSize, RelayoutContainer& container )
+{
+  RelayoutVisuals( targetSize );
+}
+
+void ShadowButton::RelayoutVisuals( const Vector2& targetSize )
+{
+  bool transitioning = false;
+  ShadowButton::Transitions::iterator iter = mTransitions.begin();
+  for( ; iter != mTransitions.end(); ++iter )
+  {
+    if( iter->mPlaying == true )
+    {
+      transitioning = true;
+      break;
+    }
+  }
+
+  if( ! transitioning )
+  {
+    for( ShadowButton::Transforms::iterator iter = mTransforms.begin();
+         iter != mTransforms.end(); ++iter )
+    {
+      switch( iter->mTransformId )
+      {
+        case Demo::ShadowButton::Property::BACKGROUND_VISUAL:
+        {
+          mBackgroundVisual.SetTransformAndSize( iter->mTransform, targetSize );
+          break;
+        }
+        case Demo::ShadowButton::Property::CHECKBOX_BG_VISUAL:
+        {
+          mCheckboxBgVisual.SetTransformAndSize( iter->mTransform, targetSize );
+          break;
+        }
+        case Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL:
+        {
+          mCheckboxFgVisual.SetTransformAndSize( iter->mTransform, targetSize );
+          break;
+        }
+        case Demo::ShadowButton::Property::LABEL_VISUAL:
+        {
+          mLabelVisual.SetTransformAndSize( iter->mTransform, targetSize );
+          break;
+        }
+      }
+    }
+  }
+}
+
+Vector3 ShadowButton::GetNaturalSize()
+{
+  int width;
+  int height;
+
+  Vector2 checkboxBgSize;
+  Vector2 checkboxFgSize;
+  Vector2 labelSize;
+  mCheckboxBgVisual.GetNaturalSize( checkboxBgSize );
+  mCheckboxFgVisual.GetNaturalSize( checkboxFgSize );
+  mLabelVisual.GetNaturalSize( labelSize );
+
+  width = std::max( checkboxBgSize.x, checkboxFgSize.x ) + labelSize.x;
+  height = std::max( std::max( checkboxFgSize.y, checkboxBgSize.y ), labelSize.y );
+
+  return Vector3( width, height, height );
+}
+
+void ShadowButton::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change )
+{
+  // Chain up.
+  Control::OnStyleChange( styleManager, change );
+}
+
+ShadowButton::Transitions::iterator ShadowButton::FindTransition( Property::Index index )
+{
+  bool found = false;
+  ShadowButton::Transitions::iterator iter = mTransitions.begin();
+  for( ; iter != mTransitions.end(); ++iter )
+  {
+    if( iter->mTransitionId == index )
+    {
+      found = true;
+      break;
+    }
+  }
+  if( ! found )
+  {
+    iter = mTransitions.end();
+  }
+  return iter;
+}
+
+ShadowButton::Transforms::iterator ShadowButton::FindTransform( Property::Index index )
+{
+  bool found = false;
+  ShadowButton::Transforms::iterator iter = mTransforms.begin();
+  for( ; iter != mTransforms.end(); ++iter )
+  {
+    if( iter->mTransformId == index )
+    {
+      found = true;
+      break;
+    }
+  }
+  if( ! found )
+  {
+    iter = mTransforms.end();
+  }
+  return iter;
+}
+
+void ShadowButton::ResetVisual(
+  Property::Index        index,
+  Visual::Base&          visual,
+  const Property::Value& value )
+{
+  if( visual )
+  {
+    // we are replacing an existing visual, so force relayout
+    RelayoutRequest();
+  }
+  Property::Map* map = value.GetMap();
+  if( map )
+  {
+    visual = Toolkit::VisualFactory::Get().CreateVisual( *map );
+
+    // Set the appropriate depth index.
+    // @todo Should be able to set this from the style sheet
+    switch( index )
+    {
+      case Demo::ShadowButton::Property::BACKGROUND_VISUAL:
+      {
+        RegisterVisual( index, visual );
+        visual.SetDepthIndex(0.0f);
+        break;
+      }
+      case Demo::ShadowButton::Property::CHECKBOX_BG_VISUAL:
+      {
+        RegisterVisual( index, visual );
+        visual.SetDepthIndex(1.0f);
+        break;
+      }
+      case Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL:
+      {
+        RegisterVisual( index, visual, mCheckState );
+        visual.SetDepthIndex(2.0f);
+        break;
+      }
+      case Demo::ShadowButton::Property::LABEL_VISUAL:
+      {
+        RegisterVisual( index, visual );
+        visual.SetDepthIndex(1.0f);
+        break;
+      }
+    }
+
+    // Extract transform maps out of the visual definition and store them
+    Property::Value* value = map->Find( DevelVisual::Property::TRANSFORM, "transform");
+    if( value )
+    {
+      Property::Map* transformMap = value->GetMap();
+      if( transformMap )
+      {
+        ShadowButton::Transforms::iterator iter = FindTransform( index );
+        if( iter != mTransforms.end() )
+        {
+          iter->mTransform = *transformMap;
+        }
+        else
+        {
+          mTransforms.push_back( Transform( index, *transformMap ) );
+        }
+      }
+    }
+  }
+}
+
+bool IsTransformProperty( const std::string& property )
+{
+  const char* transformProperties[]= { "size", "offset", "origin", "anchorPoint", "offsetSizeMode" };
+  const int NUM_TRANSFORM_PROPERTIES = sizeof( transformProperties ) / sizeof( const char * );
+
+  bool found=false;
+  for( int i=0; i<NUM_TRANSFORM_PROPERTIES; ++i )
+  {
+    if( property == transformProperties[i] )
+    {
+      found = true;
+      break;
+    }
+  }
+  return found;
+}
+
+void ShadowButton::StoreTargetLayouts( TransitionData transitionData )
+{
+  // Pseudo code
+  // foreach animator in transitionData
+  //   if animator{"property"} in [ "size", "offset", "origin", "anchorPoint", "offsetSizeMode" ]
+  //     transforms{ animator{"target"} }->{animator{"property"}} = animator{"targetValue"}
+
+
+  for( unsigned int i=0; i < transitionData.Count(); ++i )
+  {
+    Property::Map animator = transitionData.GetAnimatorAt(i);
+    Property::Value* target = animator.Find( "target" );
+    if( target )
+    {
+      // Convert to index
+      Property::Index index;
+      if( Scripting::GetEnumerationProperty( *target, VISUAL_PROPERTIES_TABLE, VISUAL_PROPERTIES_TABLE_COUNT, index ) )
+      {
+        ShadowButton::Transforms::iterator iter = FindTransform( index );
+        if( iter != mTransforms.end() )
+        {
+          Property::Value* property = animator.Find( "property" );
+          if( property )
+          {
+            std::string propertyString;
+            property->Get(propertyString);
+            if( IsTransformProperty( propertyString ) )
+            {
+              Property::Value* targetValue = animator.Find( "targetValue" );
+              if( targetValue )
+              {
+                iter->mTransform[ propertyString ] = *targetValue;
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+}
+
+void ShadowButton::ResetTransition(
+  Property::Index        index,
+  const Property::Value& value)
+{
+  ShadowButton::Transitions::iterator iter = FindTransition( index );
+  if( iter != mTransitions.end() )
+  {
+    // Already exists
+    iter->mTransitionData = ConvertPropertyToTransition( value );
+    iter->mAnimation.Stop();
+    iter->mAnimation.Clear();
+  }
+  else
+  {
+    mTransitions.push_back( Transition( index, ConvertPropertyToTransition( value ) ) );
+  }
+}
+
+
+void ShadowButton::SetProperty( BaseObject* object, Property::Index index, const Property::Value& value )
+{
+  Demo::ShadowButton shadowButton = Demo::ShadowButton::DownCast( Dali::BaseHandle( object ) );
+
+  if( shadowButton )
+  {
+    ShadowButton& impl = GetImpl( shadowButton );
+    switch ( index )
+    {
+      case Demo::ShadowButton::Property::BACKGROUND_VISUAL:
+      {
+        impl.ResetVisual( index, impl.mBackgroundVisual, value );
+        break;
+      }
+      case Demo::ShadowButton::Property::CHECKBOX_BG_VISUAL:
+      {
+        impl.ResetVisual( index, impl.mCheckboxBgVisual, value );
+        break;
+      }
+      case Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL:
+      {
+        impl.ResetVisual( index, impl.mCheckboxFgVisual, value );
+        impl.EnableVisual( Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL, impl.mCheckState );
+        break;
+      }
+      case Demo::ShadowButton::Property::LABEL_VISUAL:
+      {
+        impl.ResetVisual( index, impl.mLabelVisual, value );
+        break;
+      }
+      case Demo::ShadowButton::Property::ACTIVE_TRANSITION:
+      case Demo::ShadowButton::Property::INACTIVE_TRANSITION:
+      case Demo::ShadowButton::Property::CHECK_TRANSITION:
+      case Demo::ShadowButton::Property::UNCHECK_TRANSITION:
+      {
+        impl.ResetTransition( index, value );
+        break;
+      }
+    }
+  }
+}
+
+Property::Value ShadowButton::GetProperty( BaseObject* object, Property::Index propertyIndex )
+{
+  Property::Value value;
+
+  Demo::ShadowButton shadowButton = Demo::ShadowButton::DownCast( Dali::BaseHandle( object ) );
+
+  if ( shadowButton )
+  {
+    ShadowButton& impl = GetImpl( shadowButton );
+    switch ( propertyIndex )
+    {
+      case Demo::ShadowButton::Property::BACKGROUND_VISUAL:
+      {
+        Property::Map map;
+        impl.mBackgroundVisual.CreatePropertyMap(map);
+        value = map;
+        break;
+      }
+      case Demo::ShadowButton::Property::CHECKBOX_BG_VISUAL:
+      {
+        Property::Map map;
+        impl.mCheckboxBgVisual.CreatePropertyMap(map);
+        value = map;
+        break;
+      }
+      case Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL:
+      {
+        Property::Map map;
+        impl.mCheckboxFgVisual.CreatePropertyMap(map);
+        value = map;
+        break;
+      }
+      case Demo::ShadowButton::Property::LABEL_VISUAL:
+      {
+        Property::Map map;
+        impl.mLabelVisual.CreatePropertyMap(map);
+        value = map;
+        break;
+      }
+
+      default:
+        break;
+    }
+  }
+
+  return value;
+}
+
+
+} // Internal
+} // Demo
diff --git a/examples/transitions/shadow-button-impl.h b/examples/transitions/shadow-button-impl.h
new file mode 100644 (file)
index 0000000..cbf146e
--- /dev/null
@@ -0,0 +1,220 @@
+#ifndef DALI_DEMO_INTERNAL_SHADOW_BUTTON_IMPL_H
+#define DALI_DEMO_INTERNAL_SHADOW_BUTTON_IMPL_H
+
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "shadow-button.h"
+#include <dali/public-api/animation/animation.h>
+#include <dali-toolkit/public-api/controls/control-impl.h>
+#include <dali-toolkit/devel-api/visual-factory/visual-base.h>
+#include <dali-toolkit/devel-api/visual-factory/transition-data.h>
+
+namespace Demo
+{
+
+namespace Internal // To use TypeRegistry, handle and body classes need the same name
+{
+
+class ShadowButton : public Dali::Toolkit::Internal::Control
+{
+public:
+  /**
+   * Instantiate a new ShadowButton object
+   */
+  static Demo::ShadowButton New();
+  ShadowButton();
+  ~ShadowButton();
+
+public: // API
+  /**
+   * @brief Set the button to be active or inactive.
+   *
+   * The button will perform a transition if there is a state change.
+   * @param[in] active The active state
+   */
+  void SetActiveState( bool active );
+
+  /**
+   * Get the active state
+   * @return the active state
+   */
+  bool GetActiveState();
+
+  /**
+   * Set the check state
+   * @param[in] checkState The state of the checkbox
+   */
+  void SetCheckState( bool checkState );
+
+  /**
+   * Get the check state
+   * @return the check state
+   */
+  bool GetCheckState();
+
+public:  // Properties
+  /**
+   * Called when a property of an object of this type is set.
+   * @param[in] object The object whose property is set.
+   * @param[in] index The property index.
+   * @param[in] value The new property value.
+   */
+  static void SetProperty( Dali::BaseObject* object, Dali::Property::Index index, const Dali::Property::Value& value );
+
+  /**
+   * Called to retrieve a property of an object of this type.
+   * @param[in] object The object whose property is to be retrieved.
+   * @param[in] index The property index.
+   * @return The current value of the property.
+   */
+  static Dali::Property::Value GetProperty( Dali::BaseObject* object, Dali::Property::Index propertyIndex );
+
+private: // From Control
+  /**
+   * @copydoc Toolkit::Button::OnInitialize()
+   */
+  virtual void OnInitialize();
+
+  /**
+   * @copydoc Toolkit::Button::OnStageConnect()
+   */
+  virtual void OnStageConnection( int depth );
+
+  /**
+   * @copydoc Toolkit::Button::OnStageDisconnection()
+   */
+  virtual void OnStageDisconnection();
+
+  /**
+   * @copydoc Toolkit::Button::OnSizeSet()
+   */
+  virtual void OnSizeSet( const Dali::Vector3& targetSize );
+
+  /**
+   * @copydoc Toolkit::Button::OnRelayout()
+   */
+  virtual void OnRelayout( const Dali::Vector2& targetSize, Dali::RelayoutContainer& container );
+  /**
+   * @copydoc Toolkit::Button::GetNaturalSize
+   */
+  virtual Dali::Vector3 GetNaturalSize();
+
+  /**
+   * @copydoc Toolkit::Button::OnStyleChange
+   */
+  virtual void OnStyleChange( Dali::Toolkit::StyleManager styleManager, Dali::StyleChange::Type change );
+
+private:
+  struct Transition
+  {
+    Dali::Property::Index mTransitionId;
+    Dali::Toolkit::TransitionData mTransitionData;
+    Dali::Animation mAnimation;
+    bool mPlaying;
+
+    Transition( Dali::Property::Index index, Dali::Toolkit::TransitionData transitionData )
+    : mTransitionId( index ),
+      mTransitionData( transitionData ),
+      mPlaying(false)
+    {
+    }
+  private:
+    Transition();
+  };
+
+  typedef std::vector<Transition> Transitions;
+
+  struct Transform
+  {
+    Dali::Property::Index mTransformId;
+    Dali::Property::Map   mTransform;
+
+    Transform( Dali::Property::Index index, Dali::Property::Map& map )
+    : mTransformId(index),
+      mTransform( map )
+    {
+    }
+  };
+  typedef std::vector<Transform> Transforms;
+
+private:
+  void StartTransition( Dali::Property::Index transitionId );
+
+  void OnTransitionFinished( Dali::Animation& handle );
+
+  Transitions::iterator FindTransition( Dali::Property::Index index );
+
+  Transforms::iterator FindTransform( Dali::Property::Index index );
+
+  /**
+   * Relayout the visuals as a result of size negotiation using
+   * the transforms provided in the stylesheet
+   */
+  void RelayoutVisuals( const Dali::Vector2& targetSize );
+
+  /**
+   * Relayout the visuals as a result of size negotiation using
+   * programmatically generated transforms
+   */
+  void RelayoutVisualsManually( const Dali::Vector2& targetSize );
+
+  void ResetVisual( Dali::Property::Index        index,
+                    Dali::Toolkit::Visual::Base& visual,
+                    const Dali::Property::Value& value );
+
+  void ResetTransition( Dali::Property::Index        index,
+                        const Dali::Property::Value& value );
+
+  void StoreTargetLayouts( Dali::Toolkit::TransitionData transitionData );
+
+private:
+  // undefined
+  ShadowButton( const ShadowButton& );
+  ShadowButton& operator=( const ShadowButton& );
+
+private:
+  // Data
+  Dali::Toolkit::Visual::Base mBackgroundVisual;
+  Dali::Toolkit::Visual::Base mCheckboxBgVisual;
+  Dali::Toolkit::Visual::Base mCheckboxFgVisual;
+  Dali::Toolkit::Visual::Base mLabelVisual;
+
+  Transitions mTransitions;
+  Transforms  mTransforms;
+  bool        mCheckState;
+  bool        mActiveState;
+};
+
+} // Internal
+
+inline Internal::ShadowButton& GetImpl( Demo::ShadowButton& handle )
+{
+  DALI_ASSERT_ALWAYS( handle );
+  Dali::RefObject& object = handle.GetImplementation();
+  return static_cast<Internal::ShadowButton&>(object);
+}
+
+inline const Internal::ShadowButton& GetImpl( const Demo::ShadowButton& handle )
+{
+  DALI_ASSERT_ALWAYS( handle );
+  const Dali::RefObject& object = handle.GetImplementation();
+  return static_cast<const Internal::ShadowButton&>(object);
+}
+
+} // Demo
+
+#endif //  DALI_DEMO_SHADOW_BUTTON_IMPL_H
diff --git a/examples/transitions/shadow-button.cpp b/examples/transitions/shadow-button.cpp
new file mode 100644 (file)
index 0000000..13de599
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "shadow-button.h"
+#include "shadow-button-impl.h"
+
+namespace Demo
+{
+
+ShadowButton::ShadowButton()
+{
+}
+
+ShadowButton::ShadowButton( const ShadowButton& control )
+: Control( control )
+{
+}
+
+ShadowButton& ShadowButton::operator= ( const ShadowButton& rhs )
+{
+  if( &rhs != this )
+  {
+    Control::operator=( rhs );
+  }
+  return *this;
+}
+
+ShadowButton::~ShadowButton()
+{
+}
+
+ShadowButton ShadowButton::New()
+{
+  ShadowButton control = Internal::ShadowButton::New();
+  return control;
+}
+
+ShadowButton ShadowButton::New( const std::string& url )
+{
+  ShadowButton control = Internal::ShadowButton::New();
+  return control;
+}
+
+ShadowButton ShadowButton::DownCast( BaseHandle handle )
+{
+  return Control::DownCast< ShadowButton, Internal::ShadowButton > ( handle );
+}
+
+void ShadowButton::SetActiveState( bool active )
+{
+  GetImpl(*this).SetActiveState( active );
+}
+
+bool ShadowButton::GetActiveState()
+{
+  return GetImpl(*this).GetActiveState();
+}
+
+void ShadowButton::SetCheckState( bool checkState )
+{
+  GetImpl(*this).SetCheckState( checkState );
+}
+
+bool ShadowButton::GetCheckState()
+{
+  return GetImpl(*this).GetCheckState();
+}
+
+ShadowButton::ShadowButton( Internal::ShadowButton& implementation )
+: Control( implementation )
+{
+}
+
+ShadowButton::ShadowButton( Dali::Internal::CustomActor* internal )
+: Control( internal )
+{
+  VerifyCustomActorPointer< Internal::ShadowButton >( internal ) ;
+}
+
+
+} //namespace Demo
diff --git a/examples/transitions/shadow-button.h b/examples/transitions/shadow-button.h
new file mode 100644 (file)
index 0000000..e06b3db
--- /dev/null
@@ -0,0 +1,149 @@
+#ifndef DALI_DEMO_SHADOW_BUTTON_H
+#define DALI_DEMO_SHADOW_BUTTON_H
+
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <dali-toolkit/dali-toolkit.h>
+#include <string>
+
+namespace Demo
+{
+
+// All type registered controls need to have the same name for the body
+// and the handle
+namespace Internal
+{
+class ShadowButton;
+}
+
+/**
+ * Button that allows the RGB channels of an image to be altered.
+ */
+class ShadowButton : public Dali::Toolkit::Control
+{
+public:
+  /**
+   * The start and end property ranges for this Control
+   */
+  enum PropertyRange
+  {
+    PROPERTY_START_INDEX = Dali::Toolkit::Control::CONTROL_PROPERTY_END_INDEX + 1,
+    PROPERTY_END_INDEX   = PROPERTY_START_INDEX + 1000,
+    ANIMATABLE_PROPERTY_START_INDEX = Dali::ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX,
+    ANIMATABLE_PROPERTY_END_INDEX = ANIMATABLE_PROPERTY_START_INDEX+1000
+  };
+
+  struct Property
+  {
+    enum
+    {
+      ACTIVE_TRANSITION = PROPERTY_START_INDEX,
+      INACTIVE_TRANSITION,
+      CHECK_TRANSITION,
+      UNCHECK_TRANSITION,
+      BACKGROUND_VISUAL,
+      CHECKBOX_BG_VISUAL,
+      CHECKBOX_FG_VISUAL,
+      LABEL_VISUAL,
+      ACTIVE_STATE,
+      CHECK_STATE,
+    };
+  };
+
+public: // Construction / destruction
+
+  /**
+   * Create an uninitialized handle
+   */
+  ShadowButton();
+
+  /**
+   * Create a new image channel button without an image. Use
+   * SetImage to give this button an image
+   */
+  static ShadowButton New();
+
+  /**
+   * Create a new image channel button from a given URL
+   */
+  static ShadowButton New( const std::string& url );
+
+  /**
+   * Destructor. This is non-virtual since derived Handle types must not
+   * contain data or virtual methods
+   */
+  ~ShadowButton();
+
+  /**
+   * Copy Constructor
+   */
+  ShadowButton( const ShadowButton& shadowButton );
+
+  /**
+   * Assignment Operator
+   */
+  ShadowButton& operator=( const ShadowButton& shadowButton );
+
+  /**
+   * Downcast
+   */
+  static ShadowButton DownCast( BaseHandle handle );
+
+public: // API
+
+  /**
+   * @brief Set the button to be active or inactive.
+   *
+   * The button will perform a transition if there is a state change.
+   * @param[in] active The active state
+   */
+  void SetActiveState( bool active );
+
+  /**
+   * @brief Get the button's active state
+   *
+   * @return The active state
+   */
+  bool GetActiveState();
+
+  /**
+   * Set the check state
+   * @param[in] checkState The state of the checkbox
+   */
+  void SetCheckState( bool checkState );
+
+  /**
+   * Get the check state
+   * @return the check state
+   */
+  bool GetCheckState();
+
+public: // Not for public use
+  /**
+   * Create a handle from an implementation
+   */
+  ShadowButton( Internal::ShadowButton& implementation );
+
+  /**
+   * Allow the creation of an ShadowButton handle from an internal CustomActor pointer
+   */
+  ShadowButton( Dali::Internal::CustomActor* internal );
+};
+
+} // namespace Demo
+
+#endif // DALI_DEMO_SHADOW_BUTTON_H
index ab0daf0..2e90252 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,7 +24,9 @@
 
 // External includes
 #include <dali-toolkit/dali-toolkit.h>
-#include "beat-control.h"
+#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
+#include <dali-toolkit/devel-api/visuals/text-visual-properties.h>
+#include "shadow-button.h"
 #include <cstdio>
 #include <sstream>
 
 using namespace Dali;
 using namespace Dali::Toolkit;
 
+namespace
+{
+
+void SetLabelText( Button button, const char* label )
+{
+  button.SetProperty( Toolkit::Button::Property::LABEL, label );
+}
+
+}
+
 namespace Demo
 {
 
 const char* TransitionApplication::DEMO_THEME_ONE_PATH( DEMO_STYLE_DIR "style-example-theme-one.json" );
+const char* TransitionApplication::DEMO_THEME_TWO_PATH( DEMO_STYLE_DIR "style-example-theme-two.json" );
 
 
 TransitionApplication::TransitionApplication( Application& application )
 : mApplication( application ),
   mTitle(),
-  mBeatControl(),
+  mShadowButton(),
   mActionButtons(),
   mActionIndex( Property::INVALID_INDEX )
 {
@@ -68,8 +81,8 @@ void TransitionApplication::Create( Application& application )
   contentLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
   contentLayout.SetAnchorPoint( AnchorPoint::TOP_LEFT );
   contentLayout.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  contentLayout.SetCellPadding( Size( 10, 10 ) );
-
+  contentLayout.SetCellPadding( Vector2( 0.0f, 5.0f ) );
+  contentLayout.SetBackgroundColor( Vector4(0.949, 0.949, 0.949, 1.0) );
   // Assign all rows the size negotiation property of fitting to children
 
   stage.Add( contentLayout );
@@ -77,63 +90,58 @@ void TransitionApplication::Create( Application& application )
   mTitle = TextLabel::New( "Custom Control Transition Example" );
   mTitle.SetName( "Title" );
   mTitle.SetStyleName("Title");
-  mTitle.SetAnchorPoint( AnchorPoint::TOP_CENTER );
-  mTitle.SetParentOrigin( ParentOrigin::TOP_CENTER );
   mTitle.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
   mTitle.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
   mTitle.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
   contentLayout.Add( mTitle );
-  contentLayout.SetFitHeight(0);
-
-  mBeatControl = BeatControl::New();
-  mBeatControl.SetName("BeatControl");
-  mBeatControl.SetAnchorPoint( AnchorPoint::CENTER );
-  mBeatControl.SetParentOrigin( ParentOrigin::CENTER );
-  mBeatControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
-  contentLayout.Add( mBeatControl );
-  // beat control should fill the tableview cell, so no change to default parameters
-
-  TableView actionButtonLayout = TableView::New( 1, 4 );
+  contentLayout.SetFitHeight(0); // Fill width
+
+  // Provide some padding around the center cell
+  TableView buttonLayout = TableView::New( 3, 3 );
+  buttonLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+  buttonLayout.SetFixedHeight(1, 100 );
+  buttonLayout.SetFixedWidth(1, 350 );
+  contentLayout.Add( buttonLayout );
+
+  mShadowButton = ShadowButton::New();
+  mShadowButton.SetName("ShadowButton");
+  mShadowButton.SetActiveState( false );
+  mShadowButton.SetAnchorPoint( AnchorPoint::CENTER );
+  mShadowButton.SetParentOrigin( ParentOrigin::CENTER );
+  mShadowButton.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+  buttonLayout.AddChild( mShadowButton, TableView::CellPosition(1, 1) );
+
+  TableView actionButtonLayout = TableView::New( 1, NUMBER_OF_ACTION_BUTTONS+1 );
   actionButtonLayout.SetName("ThemeButtonsLayout");
-  actionButtonLayout.SetCellPadding( Vector2( 6.0f, 0.0f ) );
-
-  actionButtonLayout.SetAnchorPoint( AnchorPoint::CENTER );
-  actionButtonLayout.SetParentOrigin( ParentOrigin::CENTER );
   actionButtonLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
   actionButtonLayout.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT );
-  actionButtonLayout.SetCellPadding( Size( 10, 10 ) );
   actionButtonLayout.SetFitHeight( 0 );
 
   TextLabel label = TextLabel::New( "Action: ");
   label.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
   label.SetStyleName("ActionLabel");
-  label.SetAnchorPoint( AnchorPoint::TOP_CENTER );
-  label.SetParentOrigin( ParentOrigin::TOP_CENTER );
   actionButtonLayout.AddChild( label, TableView::CellPosition( 0, 0 ) );
   actionButtonLayout.SetCellAlignment( TableView::CellPosition( 0, 0 ), HorizontalAlignment::LEFT, VerticalAlignment::CENTER );
 
-  for( int i=0; i<3; ++i )
+  for( int i=0; i<NUMBER_OF_ACTION_BUTTONS; ++i )
   {
     mActionButtons[i] = PushButton::New();
     mActionButtons[i].SetName("ActionButton");
     mActionButtons[i].SetStyleName("ActionButton");
-    mActionButtons[i].SetParentOrigin( ParentOrigin::CENTER );
-    mActionButtons[i].SetAnchorPoint( ParentOrigin::CENTER );
     mActionButtons[i].SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
     mActionButtons[i].SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
     mActionIndex = mActionButtons[i].RegisterProperty( "actionId", i, Property::READ_WRITE );
     mActionButtons[i].ClickedSignal().Connect( this, &TransitionApplication::OnActionButtonClicked );
     actionButtonLayout.AddChild( mActionButtons[i], TableView::CellPosition( 0, 1+i ) );
   }
-  mActionButtons[0].SetLabelText( "Bounce" );
-  mActionButtons[1].SetLabelText( "X" );
-  mActionButtons[2].SetLabelText( "Y" );
+  SetLabelText( mActionButtons[0], "Activate" );
+  SetLabelText( mActionButtons[1], "Check" );
+  mActionButtons[1].SetProperty( Button::Property::DISABLED, true );
 
   contentLayout.Add( actionButtonLayout );
   contentLayout.SetFitHeight(2);
 }
 
-
 bool TransitionApplication::OnActionButtonClicked( Button button )
 {
   int action = button.GetProperty<int>( mActionIndex );
@@ -141,17 +149,39 @@ bool TransitionApplication::OnActionButtonClicked( Button button )
   {
     case 0:
     {
-      mBeatControl.StartBounceAnimation();
+      bool activeState = mShadowButton.GetActiveState();
+      mShadowButton.SetActiveState( ! activeState );
+      if( activeState )
+      {
+        SetLabelText( button, "Activate" );
+      }
+      else
+      {
+        SetLabelText( button, "Deactivate" );
+      }
+      mActionButtons[1].SetProperty( Button::Property::DISABLED, activeState );
       break;
     }
     case 1:
     {
-      mBeatControl.StartXAnimation();
+      bool checkState = mShadowButton.GetCheckState();
+      mShadowButton.SetCheckState( ! checkState );
+      if( checkState )
+      {
+        SetLabelText( button, "Check" );
+      }
+      else
+      {
+        SetLabelText( button, "Uncheck" );
+      }
       break;
     }
     case 2:
     {
-      mBeatControl.StartYAnimation();
+      break;
+    }
+    case 3:
+    {
       break;
     }
   }
index 9d692db..f694c8d 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_DEMO_TRANSITION_APPLICATION_H
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,9 +19,7 @@
 
 // External includes
 #include <dali-toolkit/dali-toolkit.h>
-//#include <dali-toolkit/devel-api/controls/slider/slider.h>
-#include <dali-toolkit/devel-api/controls/popup/popup.h>
-#include "beat-control.h"
+#include "shadow-button.h"
 #include <cstdio>
 #include <sstream>
 
@@ -36,6 +34,9 @@ namespace Demo
 class TransitionApplication : public ConnectionTracker
 {
 public:
+  static const int NUMBER_OF_ACTION_BUTTONS=2;
+
+public:
   // Constructor
   TransitionApplication( Application& application );
 
@@ -52,15 +53,24 @@ public:
   // Key event handler
   void OnKeyEvent( const KeyEvent& event );
 
-  bool OnActionButtonClicked(Button button);
+  bool OnActionButtonClicked( Button button );
 
   static const char* DEMO_THEME_ONE_PATH;
+  static const char* DEMO_THEME_TWO_PATH;
 
 private:
+
+  /** Create a visual map
+   *
+   * @param[in] index The index of the visual to create
+   * @param[out] map The map to generate
+   */
+
   Application& mApplication;
   TextLabel mTitle;
-  BeatControl mBeatControl;
-  PushButton mActionButtons[3];
+  ShadowButton mShadowButton;
+  PushButton mActionButtons[NUMBER_OF_ACTION_BUTTONS];
+  Property::Index mVisualIndex;
   Property::Index mActionIndex;
 };
 
index adc4563..9bf3cd2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
index cb29b8d..371c7a5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -17,6 +17,7 @@
 
 #include <dali/dali.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
 
 using namespace Dali;
 using namespace Toolkit;
@@ -150,20 +151,20 @@ class VideoViewController: public ConnectionTracker
     mResetButton.SetVisible( false );
     mResetButton.SetDisabled( true );
 
-    mPlayButton.SetUnselectedImage( PLAY_IMAGE );
-    mPlayButton.SetSelectedImage( PLAY_IMAGE );
-    mPauseButton.SetUnselectedImage( PAUSE_IMAGE );
-    mPauseButton.SetSelectedImage( PAUSE_IMAGE );
+    mPlayButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, PLAY_IMAGE );
+    mPlayButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, PLAY_IMAGE );
+    mPauseButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, PAUSE_IMAGE );
+    mPauseButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, PAUSE_IMAGE );
 
-    mStopButton.SetUnselectedImage( STOP_IMAGE );
-    mStopButton.SetSelectedImage( STOP_IMAGE );
-    mResetButton.SetUnselectedImage( RESET_IMAGE );
-    mResetButton.SetSelectedImage( RESET_IMAGE );
+    mStopButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, STOP_IMAGE );
+    mStopButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, STOP_IMAGE );
+    mResetButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, RESET_IMAGE );
+    mResetButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, RESET_IMAGE );
 
-    mBackwardButton.SetUnselectedImage( BACKWARD_IMAGE );
-    mBackwardButton.SetSelectedImage( BACKWARD_IMAGE );
-    mForwardButton.SetUnselectedImage( FORWARD_IMAGE );
-    mForwardButton.SetSelectedImage( FORWARD_IMAGE );
+    mBackwardButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, BACKWARD_IMAGE );
+    mBackwardButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, BACKWARD_IMAGE );
+    mForwardButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, FORWARD_IMAGE );
+    mForwardButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, FORWARD_IMAGE );
 
     mPanGestureDetector = PanGestureDetector::New();
     mPanGestureDetector.Attach( mVideoView );
index 4a94295..5d81885 100755 (executable)
@@ -2,7 +2,7 @@
 
 Name:       com.samsung.dali-demo
 Summary:    The OpenGLES Canvas Core Demo
-Version:    1.2.20
+Version:    1.2.22
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0
diff --git a/resources/images/preMultAlpha.png b/resources/images/preMultAlpha.png
new file mode 100644 (file)
index 0000000..3cf8ab1
Binary files /dev/null and b/resources/images/preMultAlpha.png differ
diff --git a/resources/images/progress-bar-2.9.png b/resources/images/progress-bar-2.9.png
new file mode 100644 (file)
index 0000000..1ff4a7d
Binary files /dev/null and b/resources/images/progress-bar-2.9.png differ
diff --git a/resources/images/progress-bar-progress-2.9.png b/resources/images/progress-bar-progress-2.9.png
new file mode 100644 (file)
index 0000000..2d10990
Binary files /dev/null and b/resources/images/progress-bar-progress-2.9.png differ
diff --git a/resources/images/progress-bar-progress.9.png b/resources/images/progress-bar-progress.9.png
new file mode 100644 (file)
index 0000000..aa5aa77
Binary files /dev/null and b/resources/images/progress-bar-progress.9.png differ
diff --git a/resources/images/progress-bar.9.png b/resources/images/progress-bar.9.png
new file mode 100644 (file)
index 0000000..ec0bc90
Binary files /dev/null and b/resources/images/progress-bar.9.png differ
diff --git a/resources/images/shape-bubble.png b/resources/images/shape-bubble.png
new file mode 100644 (file)
index 0000000..f100b8e
Binary files /dev/null and b/resources/images/shape-bubble.png differ
diff --git a/resources/images/shape-circle.png b/resources/images/shape-circle.png
new file mode 100644 (file)
index 0000000..7b72827
Binary files /dev/null and b/resources/images/shape-circle.png differ
index 5d9f329..a384ac3 100755 (executable)
@@ -13,6 +13,9 @@ msgstr "বেলুন"
 msgid "DALI_DEMO_STR_TITLE_BUTTONS"
 msgstr "ক্লিক্"
 
+msgid "DALI_DEMO_STR_TITLE_CLIPPING"
+msgstr "Clipping"
+
 msgid "DALI_DEMO_STR_TITLE_COLOR_GRADIENT"
 msgstr "ঝুৰ্"
 
index b76a0f5..ed6593d 100755 (executable)
@@ -13,6 +13,9 @@ msgstr "Schaumbildung"
 msgid "DALI_DEMO_STR_TITLE_BUTTONS"
 msgstr "Tasten"
 
+msgid "DALI_DEMO_STR_TITLE_CLIPPING"
+msgstr "Clipping"
+
 msgid "DALI_DEMO_STR_TITLE_COLOR_GRADIENT"
 msgstr "Farbverlauf"
 
index 2bc0e21..933be8b 100755 (executable)
@@ -13,6 +13,9 @@ msgstr "Bubbles"
 msgid "DALI_DEMO_STR_TITLE_BUTTONS"
 msgstr "Buttons"
 
+msgid "DALI_DEMO_STR_TITLE_CLIPPING"
+msgstr "Clipping"
+
 msgid "DALI_DEMO_STR_TITLE_COLOR_GRADIENT"
 msgstr "Colour Gradient"
 
index 501c311..c5a288d 100755 (executable)
@@ -13,6 +13,9 @@ msgstr "Bubbles"
 msgid "DALI_DEMO_STR_TITLE_BUTTONS"
 msgstr "Buttons"
 
+msgid "DALI_DEMO_STR_TITLE_CLIPPING"
+msgstr "Clipping"
+
 msgid "DALI_DEMO_STR_TITLE_COLOR_GRADIENT"
 msgstr "Color Gradient"
 
index 49a7683..2ea1dee 100755 (executable)
@@ -13,6 +13,9 @@ msgstr "Burbujas"
 msgid "DALI_DEMO_STR_TITLE_BUTTONS"
 msgstr "Botones"
 
+msgid "DALI_DEMO_STR_TITLE_CLIPPING"
+msgstr "Recorte"
+
 msgid "DALI_DEMO_STR_TITLE_COLOR_GRADIENT"
 msgstr "Gradiente de color"
 
index 7cd5658..476f975 100755 (executable)
@@ -13,6 +13,9 @@ msgstr "Kuplat"
 msgid "DALI_DEMO_STR_TITLE_BUTTONS"
 msgstr "Painikkeet"
 
+msgid "DALI_DEMO_STR_TITLE_CLIPPING"
+msgstr "Leikkaaminen"
+
 msgid "DALI_DEMO_STR_TITLE_COLOR_GRADIENT"
 msgstr "Liukuväri"
 
index e8d35a8..659b301 100755 (executable)
@@ -1,7 +1,6 @@
 msgid "DALI_DEMO_STR_TITLE_ANIMATED_IMAGES"
 msgstr "애니메이션 이미지"
 
-
 msgid "DALI_DEMO_STR_TITLE_ANIMATED_SHAPES"
 msgstr "애니메이션 모양"
 
@@ -14,6 +13,9 @@ msgstr "방울"
 msgid "DALI_DEMO_STR_TITLE_BUTTONS"
 msgstr "버튼"
 
+msgid "DALI_DEMO_STR_TITLE_CLIPPING"
+msgstr "깎는"
+
 msgid "DALI_DEMO_STR_TITLE_COLOR_GRADIENT"
 msgstr "색상 그라디언트"
 
index 525722e..7d37255 100755 (executable)
@@ -13,6 +13,9 @@ msgstr "കുമിള"
 msgid "DALI_DEMO_STR_TITLE_BUTTONS"
 msgstr "ബട്ടണുകൾ"
 
+msgid "DALI_DEMO_STR_TITLE_CLIPPING"
+msgstr "ക്ലിപ്പിംഗ്"
+
 msgid "DALI_DEMO_STR_TITLE_COLOR_GRADIENT"
 msgstr "വർണ്ണ ഗ്രേഡിയന്റ്"
 
index 4dbbf49..cb07dd1 100755 (executable)
@@ -13,6 +13,9 @@ msgstr "بلبلے"
 msgid "DALI_DEMO_STR_TITLE_BUTTONS"
 msgstr "بٹنوں"
 
+msgid "DALI_DEMO_STR_TITLE_CLIPPING"
+msgstr "کاٹنا"
+
 msgid "DALI_DEMO_STR_TITLE_COLOR_GRADIENT"
 msgstr "رنگ میلان"
 
index 035b724..68087e2 100755 (executable)
@@ -13,6 +13,9 @@ msgstr "气泡"
 msgid "DALI_DEMO_STR_TITLE_BUTTONS"
 msgstr "按钮"
 
+msgid "DALI_DEMO_STR_TITLE_CLIPPING"
+msgstr "剪裁"
+
 msgid "DALI_DEMO_STR_TITLE_COLOR_GRADIENT"
 msgstr "颜色梯度"
 
index 1fd715e..0e59dee 100644 (file)
@@ -1,5 +1,6 @@
 demo-theme.json
 contact-cards-example-theme.json
+progress-bar-example-theme.json
 style-example-theme-three.json
 style-example-theme-two.json
 style-example-theme-one.json
diff --git a/resources/style/images/CheckBg.png b/resources/style/images/CheckBg.png
new file mode 100644 (file)
index 0000000..960f947
Binary files /dev/null and b/resources/style/images/CheckBg.png differ
diff --git a/resources/style/images/Tick.png b/resources/style/images/Tick.png
new file mode 100644 (file)
index 0000000..72bf93e
Binary files /dev/null and b/resources/style/images/Tick.png differ
diff --git a/resources/style/images/shadowButtonBg.9.png b/resources/style/images/shadowButtonBg.9.png
new file mode 100644 (file)
index 0000000..996f965
Binary files /dev/null and b/resources/style/images/shadowButtonBg.9.png differ
diff --git a/resources/style/mobile/images/CheckBg.png b/resources/style/mobile/images/CheckBg.png
new file mode 100644 (file)
index 0000000..960f947
Binary files /dev/null and b/resources/style/mobile/images/CheckBg.png differ
diff --git a/resources/style/mobile/images/Tick.png b/resources/style/mobile/images/Tick.png
new file mode 100644 (file)
index 0000000..72bf93e
Binary files /dev/null and b/resources/style/mobile/images/Tick.png differ
diff --git a/resources/style/mobile/images/shadowButtonBg.9.png b/resources/style/mobile/images/shadowButtonBg.9.png
new file mode 100644 (file)
index 0000000..996f965
Binary files /dev/null and b/resources/style/mobile/images/shadowButtonBg.9.png differ
diff --git a/resources/style/mobile/progress-bar-example-theme.json.in b/resources/style/mobile/progress-bar-example-theme.json.in
new file mode 100644 (file)
index 0000000..670937f
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+{
+  "styles":
+  {
+    "ProgressBarCustomStyle1":
+    {
+      "progressValue": 0,
+      "trackVisual":{
+        "url":"{APPLICATION_RESOURCE_PATH}/images/progress-bar.9.png",
+        "size":[5,24]
+      },
+      "progressVisual":{
+        "url":"{APPLICATION_RESOURCE_PATH}/images/progress-bar-progress.9.png",
+        "size":[5,24]
+      }
+    },
+
+    "ProgressBarCustomStyle2":
+    {
+      "progressValue": 0,
+      "trackVisual":{
+        "url":"{APPLICATION_RESOURCE_PATH}/images/progress-bar-2.9.png",
+        "size":[5,7]
+      },
+      "progressVisual":{
+        "url":"{APPLICATION_RESOURCE_PATH}/images/progress-bar-progress-2.9.png",
+        "size":[5,7]
+      }
+    }
+  }
+}
index 20ef793..6d6c7d8 100644 (file)
@@ -1,4 +1,8 @@
 {
+  "constants":
+  {
+    "STYLE_DIR":"{APPLICATION_RESOURCE_PATH}/style"
+  },
   "styles":
   {
     "Title":{
@@ -69,9 +73,9 @@
       [
         {
           "target":"imageVisual",
-          "property":"colorAlpha",
-          "initialValue":0,
-          "targetValue":1,
+          "property":"mixColor",
+          "initialValue":[1,1,1,0],
+          "targetValue":[1,1,1,1],
           "animator":
           {
             "alphaFunction":"EASE_IN_OUT",
         },
         {
           "target":"imageVisual",
-          "property":"scale",
-          "targetValue":[1,1,1]
+          "property":"size",
+          "targetValue":[1,1]
         }
       ],
       "disableVisibilityTransition":
       [
         {
           "target":"imageVisual",
-          "property":"colorAlpha",
-          "targetValue":0,
+          "property":"mixColor",
+          "targetValue":[1,1,1,0],
           "animator":
           {
             "alphaFunction":"EASE_IN_OUT",
         },
         {
           "target":"imageVisual",
-          "property":"scale",
+          "property":"size",
           "targetValue":[1,1,1]
         }
       ]
     },
-    "BeatControl":
+    "ShadowButton":
     {
-      "beatVisual":{
+      "backgroundVisual":{
         "visualType":"IMAGE",
-        "url":"{APPLICATION_RESOURCE_PATH}/images/Logo-for-demo.png"
+        "url":"{STYLE_DIR}/images/shadowButtonBg.9.png",
+        "mixColor":[1,1,1,0]
       },
-
-      "bounceTransition":
+      "checkboxBgVisual":{
+        "visualType":"IMAGE",
+        "url":"{STYLE_DIR}/images/CheckBg.png",
+        "transform":{
+          "size":[0.09, 0.28],
+          "offset":[30,0],
+          "offsetSizeMode":[1,1,0,0],
+          "origin":"CENTER_BEGIN",
+          "anchorPoint":"CENTER_BEGIN"
+        }
+      },
+      "checkboxFgVisual":{
+        "visualType":"IMAGE",
+        "url":"{STYLE_DIR}/images/Tick.png",
+        "transform":{
+          "size":[0.09, 0.28],
+          "offset":[30,0],
+          "offsetSizeMode":[1,1,0,0],
+          "origin":"CENTER_BEGIN",
+          "anchorPoint":"CENTER_BEGIN"
+        }
+      },
+      "labelVisual":{
+        "visualType":"TEXT",
+        "text":"Don't show again",
+        "pointSize":8,
+        "horizontalAlignment":"END",
+        "verticalAlignment":"CENTER",
+        "textColor":[1,1,1,1],
+        "mixColor":[0.3, 0.3, 0.3, 1],
+        "transform":{
+          "size":[0.9, 0.9],
+          "offset":[-30,0],
+          "offsetSizeMode":[1,1,0,0],
+          "origin":"CENTER_END",
+          "anchorPoint":"CENTER_END"
+        }
+      },
+      "activeTransition":
+      [
+        {
+          "target":"checkboxBgVisual",
+          "property":"size",
+          "initialValue":[0.09, 0.28],
+          "targetValue":[0.12, 0.37],
+          "animator":
+          {
+            "alphaFunction":"EASE_OUT_BACK",
+            "timePeriod":
+            {
+              "duration":0.8,
+              "delay":0
+            }
+          }
+        },
+        {
+          "target":"backgroundVisual",
+          "property":"mixColor",
+          "initialValue":[1,1,1,0],
+          "targetValue":[1,1,1,1],
+          "animator":
+          {
+            "alphaFunction":"EASE_OUT_BACK",
+            "timePeriod":
+            {
+              "duration":0.8,
+              "delay":0
+            }
+          }
+        },
+        {
+          "target":"backgroundVisual",
+          "property":"size",
+          "initialValue":[0.9, 0.9],
+          "targetValue":[1, 1],
+          "animator":
+          {
+            "alphaFunction":"EASE_OUT_BACK",
+            "timePeriod":
+            {
+              "duration":0.8,
+              "delay":0
+            }
+          }
+        },
+        {
+          "target":"checkboxFgVisual",
+          "property":"size",
+          "initialValue":[0.09, 0.28],
+          "targetValue":[0.12, 0.37],
+          "animator":
+          {
+            "alphaFunction":"EASE_OUT_BACK",
+            "timePeriod":
+            {
+              "duration":0.8,
+              "delay":0
+            }
+          }
+        },
+        {
+          "target":"labelVisual",
+          "property":"mixColor",
+          "initialValue":[0.2, 0.2, 0.2, 1.0],
+          "targetValue":[0, 0, 0, 1],
+          "animator":
+          {
+            "alphaFunction":"EASE_OUT_BACK",
+            "timePeriod":
+            {
+              "duration":0.8,
+              "delay":0
+            }
+          }
+        }
+      ],
+      "inactiveTransition":
       [
         {
-          "target":"beatVisual",
+          "target":"checkboxBgVisual",
+          "property":"size",
+          "initialValue":[0.12, 0.37],
+          "targetValue":[0.09, 0.28],
+          "animator":
+          {
+            "alphaFunction":"EASE_OUT_BACK",
+            "timePeriod":
+            {
+              "duration":0.8,
+              "delay":0
+            }
+          }
+        },
+        {
+          "target":"backgroundVisual",
+          "property":"mixColor",
+          "targetValue":[1,1,1,0],
+          "animator":
+          {
+            "alphaFunction":"EASE_OUT_BACK",
+            "timePeriod":
+            {
+              "duration":0.8,
+              "delay":0
+            }
+          }
+        },
+        {
+          "target":"checkboxFgVisual",
+          "property":"size",
+          "initialValue":[0.12, 0.37],
+          "targetValue":[0.09, 0.28],
+          "animator":
+          {
+            "alphaFunction":"EASE_OUT_BACK",
+            "timePeriod":
+            {
+              "duration":0.8,
+              "delay":0
+            }
+          }
+        },
+        {
+          "target":"labelVisual",
+          "property":"mixColor",
+          "targetValue":[0.4, 0.4, 0.4, 1.0],
+          "animator":
+          {
+            "alphaFunction":"EASE_OUT_BACK",
+            "timePeriod":
+            {
+              "duration":0.8,
+              "delay":0
+            }
+          }
+        },
+        {
+          "target":"backgroundVisual",
           "property":"size",
-          "initialValue":[0.5, 0.5],
-          "targetValue":[0.75, 0.75],
+          "targetValue":[0.9, 0.9],
           "animator":
           {
-            "alphaFunction":"BOUNCE",
+            "alphaFunction":"EASE_OUT_BACK",
             "timePeriod":
             {
-              "duration":0.5,
+              "duration":0.8,
               "delay":0
             }
           }
         }
       ],
-
-      "leftTransition":
+      "checkTransition":
       [
         {
-          "target":"beatVisual",
-          "property":"offset",
-          "initialValue":[0, 0],
-          "targetValue":[0.25, 0],
+          "target":"checkboxFgVisual",
+          "property":"pixelArea",
+          "initialValue":[0.0, 0.0, 0.0, 1.0],
+          "targetValue":[0.0, 0.0, 1.0, 1.0],
+          "animator":
+          {
+            "alphaFunction":"EASE_IN",
+            "timePeriod":
+            {
+              "duration":0.4,
+              "delay":0
+            }
+          }
+        },
+        {
+          "target":"checkboxFgVisual",
+          "property":"size",
+          "initialValue":[0.0, 0.37],
+          "targetValue":[0.12, 0.37],
           "animator":
           {
-            "alphaFunction":"BOUNCE",
+            "alphaFunction":"EASE_IN",
             "timePeriod":
             {
-              "duration":0.5,
+              "duration":0.4,
               "delay":0
             }
           }
         }
       ],
-
-      "upTransition":
+      "uncheckTransition":
       [
         {
-          "target":"beatVisual",
-          "property":"offset",
-          "initialValue":[0, 0],
-          "targetValue":[0, 0.25],
+          "target":"checkboxFgVisual",
+          "property":"pixelArea",
+          "initialValue":[0.0, 0.0, 1.0, 1.0],
+          "targetValue":[0.0, 0.0, 0.0, 1.0],
+          "animator":
+          {
+            "alphaFunction":"EASE_OUT",
+            "timePeriod":
+            {
+              "duration":0.4,
+              "delay":0
+            }
+          }
+        },
+        {
+          "target":"checkboxFgVisual",
+          "property":"size",
+          "targetValue":[0.0, 0.37],
           "animator":
           {
-            "alphaFunction":"BOUNCE",
+            "alphaFunction":"EASE_OUT",
             "timePeriod":
             {
-              "duration":0.5,
+              "duration":0.4,
               "delay":0
             }
           }
index 88aad44..f77d957 100644 (file)
@@ -53,9 +53,9 @@
       [
         {
           "target":"imageVisual",
-          "property":"scale",
-          "initialValue":[0.1,0.1,0.1],
-          "targetValue":[1,1,1],
+          "property":"size",
+          "initialValue":[0.1,0.1],
+          "targetValue":[1,1],
           "animator":
           {
             "alphaFunction":"EASE_IN",
         },
         {
           "target":"imageVisual",
-          "property":"colorAlpha",
-          "targetValue":1
+          "property":"mixColor",
+          "targetValue":[1,1,1,1]
         }
       ],
       "disableVisibilityTransition":
       [
         {
           "target":"imageVisual",
-          "property":"scale",
-          "initialValue":[1,1,1],
-          "targetValue":[0.1,0.1,0.1],
+          "property":"size",
+          "initialValue":[1,1],
+          "targetValue":[0.1,0.1],
           "animator":
           {
             "alphaFunction":"EASE_OUT",
@@ -91,8 +91,8 @@
         },
         {
           "target":"imageVisual",
-          "property":"colorAlpha",
-          "targetValue":0,
+          "property":"mixColor",
+          "targetValue":[1,1,1,0],
           "animator":
           {
             "alphaFunction":"EASE_OUT",
index 9a99988..54857ba 100644 (file)
 
     // Change an icon size, see if it gets properly re-sized
     "RadioButton":{
-      "unselectedStateImage":"{STYLE_DIR}/images/radio-button-unselected.png",
-      "selectedStateImage":"{STYLE_DIR}/images/radio-button-selected.png",
-      "disabledStateImage":"{STYLE_DIR}/images/radio-button-unselected-disabled.png",
-      "imageLabelGap":10,
+     "unselectedVisual":
+      {
+        "visualType": "IMAGE",
+        "url": "{STYLE_DIR}/images/radio-button-unselected.png"
+      },
+      "selectedVisual":
+      {
+        "visualType": "IMAGE",
+        "url": "{STYLE_DIR}/images/radio-button-selected.png"
+      },
       "label":{
         "textColor": [0.1,1,1,1]
       }
       [
         {
           "target":"imageVisual",
-          "property":"colorAlpha",
-          "initialValue":0,
-          "targetValue":1,
+          "property":"mixColor",
+          "initialValue":[1,1,1,0],
+          "targetValue":[1,1,1,1],
           "animator":
           {
             "alphaFunction":"EASE_IN_OUT",
               "delay":0
             }
           }
+        },
+        {
+          "target":"imageVisual",
+          "property":"size",
+          "targetValue":[1,1]
         }
       ],
       "disableVisibilityTransition":
       [
         {
           "target":"imageVisual",
-          "property":"colorAlpha",
-          "targetValue":0,
+          "property":"mixColor",
+          "targetValue":[1,1,1,0],
           "animator":
           {
             "alphaFunction":"EASE_IN_OUT",
         },
         {
           "target":"imageVisual",
-          "property":"scale",
-          "targetValue":[1,1,1]
+          "property":"size",
+          "targetValue":[1,1]
+        }
+      ]
+    },
+    "ShadowButton":
+    {
+      "backgroundVisual":{
+        "visualType":"IMAGE",
+        "url":"{STYLE_DIR}/images/shadowButtonBg.9.png"
+      },
+      "checkboxBgVisual":{
+        "visualType":"IMAGE",
+        "url":"{STYLE_DIR}/images/CheckBg.png",
+        "transform":{
+          "size":[0.09, 0.28],
+          "offset":[30,0],
+          "offsetSizeMode":[1,1,0,0],
+          "origin":"CENTER_BEGIN",
+          "anchorPoint":"CENTER_BEGIN"
+        }
+      },
+      "checkboxFgVisual":{
+        "visualType":"IMAGE",
+        "url":"{STYLE_DIR}/images/Tick.png",
+        "transform":{
+          "size":[0.09, 0.28],
+          "offset":[30,0],
+          "offsetSizeMode":[1,1,0,0],
+          "origin":"CENTER_BEGIN",
+          "anchorPoint":"CENTER_BEGIN"
+        }
+      },
+      "labelVisual":{
+        "visualType":"TEXT",
+        "text":"Don't show again",
+        "pointSize":8,
+        "horizontalAlignment":"END",
+        "verticalAlignment":"CENTER",
+        "textColor":[1,1,1,1],
+        "mixColor":[0.3, 0.3, 0.3, 1],
+        "transform":{
+          "size":[0.9, 0.9],
+          "offset":[-30,0],
+          "offsetSizeMode":[1,1,0,0],
+          "origin":"CENTER_END",
+          "anchorPoint":"CENTER_END"
+        }
+      },
+      "activeTransition":
+      [
+        {
+          "target":"checkboxBgVisual",
+          "property":"size",
+          "initialValue":[0.09, 0.28],
+          "targetValue":[0.12, 0.37],
+          "animator":
+          {
+            "alphaFunction":"EASE_OUT_BACK",
+            "timePeriod":
+            {
+              "duration":0.8,
+              "delay":0
+            }
+          }
+        }
+      ],
+      "inactiveTransition":
+      [
+        {
+          "target":"checkboxBgVisual",
+          "property":"size",
+          "initialValue":[0.12, 0.37],
+          "targetValue":[0.09, 0.28],
+          "animator":
+          {
+            "alphaFunction":"EASE_OUT_BACK",
+            "timePeriod":
+            {
+              "duration":0.8,
+              "delay":0
+            }
+          }
         }
       ]
     }
diff --git a/resources/style/progress-bar-example-theme.json.in b/resources/style/progress-bar-example-theme.json.in
new file mode 100644 (file)
index 0000000..670937f
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+{
+  "styles":
+  {
+    "ProgressBarCustomStyle1":
+    {
+      "progressValue": 0,
+      "trackVisual":{
+        "url":"{APPLICATION_RESOURCE_PATH}/images/progress-bar.9.png",
+        "size":[5,24]
+      },
+      "progressVisual":{
+        "url":"{APPLICATION_RESOURCE_PATH}/images/progress-bar-progress.9.png",
+        "size":[5,24]
+      }
+    },
+
+    "ProgressBarCustomStyle2":
+    {
+      "progressValue": 0,
+      "trackVisual":{
+        "url":"{APPLICATION_RESOURCE_PATH}/images/progress-bar-2.9.png",
+        "size":[5,7]
+      },
+      "progressVisual":{
+        "url":"{APPLICATION_RESOURCE_PATH}/images/progress-bar-progress-2.9.png",
+        "size":[5,7]
+      }
+    }
+  }
+}
index 20ef793..a28f842 100644 (file)
@@ -1,4 +1,8 @@
 {
+  "constants":
+  {
+    "STYLE_DIR":"{APPLICATION_RESOURCE_PATH}/style"
+  },
   "styles":
   {
     "Title":{
@@ -69,9 +73,9 @@
       [
         {
           "target":"imageVisual",
-          "property":"colorAlpha",
-          "initialValue":0,
-          "targetValue":1,
+          "property":"mixColor",
+          "initialValue":[1,1,1,0],
+          "targetValue":[1,1,1,1],
           "animator":
           {
             "alphaFunction":"EASE_IN_OUT",
         },
         {
           "target":"imageVisual",
-          "property":"scale",
-          "targetValue":[1,1,1]
+          "property":"size",
+          "targetValue":[1,1]
         }
       ],
       "disableVisibilityTransition":
       [
         {
           "target":"imageVisual",
-          "property":"colorAlpha",
-          "targetValue":0,
+          "property":"mixColor",
+          "targetValue":[1,1,1,0],
           "animator":
           {
             "alphaFunction":"EASE_IN_OUT",
         },
         {
           "target":"imageVisual",
-          "property":"scale",
+          "property":"size",
           "targetValue":[1,1,1]
         }
       ]
     },
-    "BeatControl":
+    "ShadowButton":
     {
-      "beatVisual":{
+      "backgroundVisual":{
         "visualType":"IMAGE",
-        "url":"{APPLICATION_RESOURCE_PATH}/images/Logo-for-demo.png"
+        "url":"{STYLE_DIR}/images/shadowButtonBg.9.png",
+        "mixColor":[1,1,1,0]
       },
-
-      "bounceTransition":
+      "checkboxBgVisual":{
+        "visualType":"IMAGE",
+        "url":"{STYLE_DIR}/images/CheckBg.png",
+        "transform":{
+          "size":[0.09, 0.28],
+          "offset":[30,0],
+          "offsetSizeMode":[1,1,0,0],
+          "origin":"CENTER_BEGIN",
+          "anchorPoint":"CENTER_BEGIN"
+        }
+      },
+      "checkboxFgVisual":{
+        "visualType":"IMAGE",
+        "url":"{STYLE_DIR}/images/Tick.png",
+        "transform":{
+          "size":[0.09, 0.28],
+          "offset":[30,0],
+          "offsetSizeMode":[1,1,0,0],
+          "origin":"CENTER_BEGIN",
+          "anchorPoint":"CENTER_BEGIN"
+        }
+      },
+      "labelVisual":{
+        "visualType":"TEXT",
+        "text":"Don't show again",
+        "pointSize":20,
+        "horizontalAlignment":"END",
+        "verticalAlignment":"CENTER",
+        "textColor":[1,1,1,1],
+        "mixColor":[0.3, 0.3, 0.3, 1],
+        "transform":{
+          "size":[0.9, 0.9],
+          "offset":[-30,0],
+          "offsetSizeMode":[1,1,0,0],
+          "origin":"CENTER_END",
+          "anchorPoint":"CENTER_END"
+        }
+      },
+      "activeTransition":
+      [
+        {
+          "target":"checkboxBgVisual",
+          "property":"size",
+          "initialValue":[0.09, 0.28],
+          "targetValue":[0.12, 0.37],
+          "animator":
+          {
+            "alphaFunction":"EASE_OUT_BACK",
+            "timePeriod":
+            {
+              "duration":0.8,
+              "delay":0
+            }
+          }
+        },
+        {
+          "target":"backgroundVisual",
+          "property":"mixColor",
+          "initialValue":[1,1,1,0],
+          "targetValue":[1,1,1,1],
+          "animator":
+          {
+            "alphaFunction":"EASE_OUT_BACK",
+            "timePeriod":
+            {
+              "duration":0.8,
+              "delay":0
+            }
+          }
+        },
+        {
+          "target":"backgroundVisual",
+          "property":"size",
+          "initialValue":[0.9, 0.9],
+          "targetValue":[1, 1],
+          "animator":
+          {
+            "alphaFunction":"EASE_OUT_BACK",
+            "timePeriod":
+            {
+              "duration":0.8,
+              "delay":0
+            }
+          }
+        },
+        {
+          "target":"checkboxFgVisual",
+          "property":"size",
+          "initialValue":[0.09, 0.28],
+          "targetValue":[0.12, 0.37],
+          "animator":
+          {
+            "alphaFunction":"EASE_OUT_BACK",
+            "timePeriod":
+            {
+              "duration":0.8,
+              "delay":0
+            }
+          }
+        },
+        {
+          "target":"labelVisual",
+          "property":"mixColor",
+          "initialValue":[0.2, 0.2, 0.2, 1.0],
+          "targetValue":[0, 0, 0, 1],
+          "animator":
+          {
+            "alphaFunction":"EASE_OUT_BACK",
+            "timePeriod":
+            {
+              "duration":0.8,
+              "delay":0
+            }
+          }
+        }
+      ],
+      "inactiveTransition":
       [
         {
-          "target":"beatVisual",
+          "target":"checkboxBgVisual",
+          "property":"size",
+          "initialValue":[0.12, 0.37],
+          "targetValue":[0.09, 0.28],
+          "animator":
+          {
+            "alphaFunction":"EASE_OUT_BACK",
+            "timePeriod":
+            {
+              "duration":0.8,
+              "delay":0
+            }
+          }
+        },
+        {
+          "target":"backgroundVisual",
+          "property":"mixColor",
+          "targetValue":[1,1,1,0],
+          "animator":
+          {
+            "alphaFunction":"EASE_OUT_BACK",
+            "timePeriod":
+            {
+              "duration":0.8,
+              "delay":0
+            }
+          }
+        },
+        {
+          "target":"checkboxFgVisual",
+          "property":"size",
+          "initialValue":[0.12, 0.37],
+          "targetValue":[0.09, 0.28],
+          "animator":
+          {
+            "alphaFunction":"EASE_OUT_BACK",
+            "timePeriod":
+            {
+              "duration":0.8,
+              "delay":0
+            }
+          }
+        },
+        {
+          "target":"labelVisual",
+          "property":"mixColor",
+          "targetValue":[0.4, 0.4, 0.4, 1.0],
+          "animator":
+          {
+            "alphaFunction":"EASE_OUT_BACK",
+            "timePeriod":
+            {
+              "duration":0.8,
+              "delay":0
+            }
+          }
+        },
+        {
+          "target":"backgroundVisual",
           "property":"size",
-          "initialValue":[0.5, 0.5],
-          "targetValue":[0.75, 0.75],
+          "targetValue":[0.9, 0.9],
           "animator":
           {
-            "alphaFunction":"BOUNCE",
+            "alphaFunction":"EASE_OUT_BACK",
             "timePeriod":
             {
-              "duration":0.5,
+              "duration":0.8,
               "delay":0
             }
           }
         }
       ],
-
-      "leftTransition":
+      "checkTransition":
       [
         {
-          "target":"beatVisual",
-          "property":"offset",
-          "initialValue":[0, 0],
-          "targetValue":[0.25, 0],
+          "target":"checkboxFgVisual",
+          "property":"pixelArea",
+          "initialValue":[0.0, 0.0, 0.0, 1.0],
+          "targetValue":[0.0, 0.0, 1.0, 1.0],
+          "animator":
+          {
+            "alphaFunction":"EASE_IN",
+            "timePeriod":
+            {
+              "duration":0.4,
+              "delay":0
+            }
+          }
+        },
+        {
+          "target":"checkboxFgVisual",
+          "property":"size",
+          "initialValue":[0.0, 0.37],
+          "targetValue":[0.12, 0.37],
           "animator":
           {
-            "alphaFunction":"BOUNCE",
+            "alphaFunction":"EASE_IN",
             "timePeriod":
             {
-              "duration":0.5,
+              "duration":0.4,
               "delay":0
             }
           }
         }
       ],
-
-      "upTransition":
+      "uncheckTransition":
       [
         {
-          "target":"beatVisual",
-          "property":"offset",
-          "initialValue":[0, 0],
-          "targetValue":[0, 0.25],
+          "target":"checkboxFgVisual",
+          "property":"pixelArea",
+          "initialValue":[0.0, 0.0, 1.0, 1.0],
+          "targetValue":[0.0, 0.0, 0.0, 1.0],
+          "animator":
+          {
+            "alphaFunction":"EASE_OUT",
+            "timePeriod":
+            {
+              "duration":0.4,
+              "delay":0
+            }
+          }
+        },
+        {
+          "target":"checkboxFgVisual",
+          "property":"size",
+          "targetValue":[0.0, 0.37],
           "animator":
           {
-            "alphaFunction":"BOUNCE",
+            "alphaFunction":"EASE_OUT",
             "timePeriod":
             {
-              "duration":0.5,
+              "duration":0.4,
               "delay":0
             }
           }
index 88aad44..f77d957 100644 (file)
@@ -53,9 +53,9 @@
       [
         {
           "target":"imageVisual",
-          "property":"scale",
-          "initialValue":[0.1,0.1,0.1],
-          "targetValue":[1,1,1],
+          "property":"size",
+          "initialValue":[0.1,0.1],
+          "targetValue":[1,1],
           "animator":
           {
             "alphaFunction":"EASE_IN",
         },
         {
           "target":"imageVisual",
-          "property":"colorAlpha",
-          "targetValue":1
+          "property":"mixColor",
+          "targetValue":[1,1,1,1]
         }
       ],
       "disableVisibilityTransition":
       [
         {
           "target":"imageVisual",
-          "property":"scale",
-          "initialValue":[1,1,1],
-          "targetValue":[0.1,0.1,0.1],
+          "property":"size",
+          "initialValue":[1,1],
+          "targetValue":[0.1,0.1],
           "animator":
           {
             "alphaFunction":"EASE_OUT",
@@ -91,8 +91,8 @@
         },
         {
           "target":"imageVisual",
-          "property":"colorAlpha",
-          "targetValue":0,
+          "property":"mixColor",
+          "targetValue":[1,1,1,0],
           "animator":
           {
             "alphaFunction":"EASE_OUT",
index d6e257b..791a79e 100644 (file)
       [
         {
           "target":"imageVisual",
-          "property":"colorAlpha",
-          "initialValue":0,
-          "targetValue":1,
+          "property":"mixColor",
+          "initialValue":[1,1,1,0],
+          "targetValue":[1,1,1,1],
           "animator":
           {
             "alphaFunction":"EASE_IN_OUT",
         },
         {
           "target":"imageVisual",
-          "property":"scale",
-          "targetValue":[1,1,1]
+          "property":"size",
+          "targetValue":[1,1]
         }
       ],
       "disableVisibilityTransition":
       [
         {
           "target":"imageVisual",
-          "property":"colorAlpha",
-          "targetValue":0,
+          "property":"mixColor",
+          "targetValue":[1,1,1,0],
           "animator":
           {
             "alphaFunction":"EASE_IN_OUT",
         },
         {
           "target":"imageVisual",
-          "property":"scale",
-          "targetValue":[1,1,1]
+          "property":"size",
+          "targetValue":[1,1]
+        }
+      ]
+    },
+    "ShadowButton":
+    {
+      "backgroundVisual":{
+        "visualType":"IMAGE",
+        "url":"{STYLE_DIR}/images/shadowButtonBg.9.png"
+      },
+      "checkboxBgVisual":{
+        "visualType":"IMAGE",
+        "url":"{STYLE_DIR}/images/CheckBg.png",
+        "transform":{
+          "size":[0.09, 0.28],
+          "offset":[30,0],
+          "offsetSizeMode":[1,1,0,0],
+          "origin":"CENTER_BEGIN",
+          "anchorPoint":"CENTER_BEGIN"
+        }
+      },
+      "checkboxFgVisual":{
+        "visualType":"IMAGE",
+        "url":"{STYLE_DIR}/images/Tick.png",
+        "transform":{
+          "size":[0.09, 0.28],
+          "offset":[30,0],
+          "offsetSizeMode":[1,1,0,0],
+          "origin":"CENTER_BEGIN",
+          "anchorPoint":"CENTER_BEGIN"
+        }
+      },
+      "labelVisual":{
+        "visualType":"TEXT",
+        "text":"Don't show again",
+        "pointSize":20,
+        "horizontalAlignment":"END",
+        "verticalAlignment":"CENTER",
+        "textColor":[1,1,1,1],
+        "mixColor":[0.3, 0.3, 0.3, 1],
+        "transform":{
+          "size":[0.9, 0.9],
+          "offset":[-30,0],
+          "offsetSizeMode":[1,1,0,0],
+          "origin":"CENTER_END",
+          "anchorPoint":"CENTER_END"
+        }
+      },
+      "activeTransition":
+      [
+        {
+          "target":"checkboxBgVisual",
+          "property":"size",
+          "initialValue":[0.09, 0.28],
+          "targetValue":[0.12, 0.37],
+          "animator":
+          {
+            "alphaFunction":"EASE_OUT_BACK",
+            "timePeriod":
+            {
+              "duration":0.8,
+              "delay":0
+            }
+          }
+        }
+      ],
+      "inactiveTransition":
+      [
+        {
+          "target":"checkboxBgVisual",
+          "property":"size",
+          "initialValue":[0.12, 0.37],
+          "targetValue":[0.09, 0.28],
+          "animator":
+          {
+            "alphaFunction":"EASE_OUT_BACK",
+            "timePeriod":
+            {
+              "duration":0.8,
+              "delay":0
+            }
+          }
         }
       ]
     }
index c8b3283..47f8f4f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -37,6 +37,7 @@ extern "C"
 #define DALI_DEMO_STR_TITLE_BLOCKS                      dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_BLOCKS")
 #define DALI_DEMO_STR_TITLE_BUBBLES                     dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_BUBBLES")
 #define DALI_DEMO_STR_TITLE_BUTTONS                     dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_BUTTONS")
+#define DALI_DEMO_STR_TITLE_CLIPPING                    dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_CLIPPING")
 #define DALI_DEMO_STR_TITLE_COLOR_GRADIENT              dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_COLOR_GRADIENT")
 #define DALI_DEMO_STR_TITLE_CONTACT_CARDS               dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_CONTACT_CARDS")
 #define DALI_DEMO_STR_TITLE_CUBE_TRANSITION             dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_CUBE_TRANSITION")
@@ -93,6 +94,7 @@ extern "C"
 #define DALI_DEMO_STR_TITLE_BLOCKS                      "Blocks"
 #define DALI_DEMO_STR_TITLE_BUBBLES                     "Bubbles"
 #define DALI_DEMO_STR_TITLE_BUTTONS                     "Buttons"
+#define DALI_DEMO_STR_TITLE_CLIPPING                    "Clipping"
 #define DALI_DEMO_STR_TITLE_COLOR_GRADIENT              "Color Gradient"
 #define DALI_DEMO_STR_TITLE_CONTACT_CARDS               "Contact Cards"
 #define DALI_DEMO_STR_TITLE_CUBE_TRANSITION             "Cube Effect"