Introduce new visual transform property : EXTRA_SIZE
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / visuals / animated-image / animated-image-visual.h
old mode 100644 (file)
new mode 100755 (executable)
index 5c9b31c..0d21f97
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_ANIMATED_IMAGE_VISUAL_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -30,6 +30,7 @@
 #include <dali-toolkit/internal/visuals/visual-base-impl.h>
 #include <dali-toolkit/internal/visuals/visual-url.h>
 #include <dali-toolkit/internal/visuals/animated-image/image-cache.h>
+#include <dali-toolkit/devel-api/visuals/animated-image-visual-actions-devel.h>
 
 namespace Dali
 {
@@ -40,6 +41,7 @@ namespace Toolkit
 namespace Internal
 {
 
+class ImageVisualShaderFactory;
 class AnimatedImageVisual;
 typedef IntrusivePtr< AnimatedImageVisual > AnimatedImageVisualPtr;
 
@@ -89,46 +91,54 @@ public:
    * @brief Create the animated image Visual using the image URL.
    *
    * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
+   * @param[in] shaderFactory The ImageVisualShaderFactory object
    * @param[in] imageUrl The URL to gif resource to use
    * @param[in] properties A Property::Map containing settings for this visual
    * @return A smart-pointer to the newly allocated visual.
    */
-  static AnimatedImageVisualPtr New( VisualFactoryCache& factoryCache, const VisualUrl& imageUrl, const Property::Map& properties );
+  static AnimatedImageVisualPtr New( VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const VisualUrl& imageUrl, const Property::Map& properties );
 
   /**
    * @brief Create the animated image Visual using image URLs.
    *
    * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
+   * @param[in] shaderFactory The ImageVisualShaderFactory object
    * @param[in] imageUrls A Property::Array containing the URLs to the image resources
    * @param[in] properties A Property::Map containing settings for this visual
    * @return A smart-pointer to the newly allocated visual.
    */
-  static AnimatedImageVisualPtr New( VisualFactoryCache& factoryCache, const Property::Array& imageUrls, const Property::Map& properties );
+  static AnimatedImageVisualPtr New( VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const Property::Array& imageUrls, const Property::Map& properties );
 
   /**
    * @brief Create the animated image visual using the image URL.
    *
    * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
+   * @param[in] shaderFactory The ImageVisualShaderFactory object
    * @param[in] imageUrl The URL to animated image resource to use
    */
-  static AnimatedImageVisualPtr New( VisualFactoryCache& factoryCache, const VisualUrl& imageUrl );
+  static AnimatedImageVisualPtr New( VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const VisualUrl& imageUrl );
 
 public:  // from Visual
 
   /**
    * @copydoc Visual::Base::GetNaturalSize
    */
-  virtual void GetNaturalSize( Vector2& naturalSize );
+  void GetNaturalSize( Vector2& naturalSize ) override;
 
   /**
    * @copydoc Visual::Base::CreatePropertyMap
    */
-  virtual void DoCreatePropertyMap( Property::Map& map ) const;
+  void DoCreatePropertyMap( Property::Map& map ) const override;
 
   /**
    * @copydoc Visual::Base::CreateInstancePropertyMap
    */
-  virtual void DoCreateInstancePropertyMap( Property::Map& map ) const;
+  void DoCreateInstancePropertyMap( Property::Map& map ) const override;
+
+  /**
+   * @copydoc Visual::Base::OnDoAction
+   */
+  void OnDoAction( const Dali::Property::Index actionName, const Dali::Property::Value& attributes ) override;
 
 protected:
 
@@ -136,8 +146,9 @@ protected:
    * @brief Constructor.
    *
    * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
+   * @param[in] shaderFactory The ImageVisualShaderFactory object
    */
-  AnimatedImageVisual( VisualFactoryCache& factoryCache );
+  AnimatedImageVisual( VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory );
 
   /**
    * @brief A reference counted object may only be deleted by calling Unreference().
@@ -147,7 +158,7 @@ protected:
   /**
    * @copydoc Visual::Base::DoSetProperties
    */
-  virtual void DoSetProperties( const Property::Map& propertyMap );
+  void DoSetProperties( const Property::Map& propertyMap ) override;
 
   /**
    * Helper method to set individual values by index key.
@@ -159,17 +170,17 @@ protected:
   /**
    * @copydoc Visual::Base::DoSetOnStage
    */
-  virtual void DoSetOnStage( Actor& actor );
+  void DoSetOnStage( Actor& actor ) override;
 
   /**
    * @copydoc Visual::Base::DoSetOffStage
    */
-  virtual void DoSetOffStage( Actor& actor );
+  void DoSetOffStage( Actor& actor ) override;
 
   /**
    * @copydoc Visual::Base::OnSetTransform
    */
-  virtual void OnSetTransform();
+  void OnSetTransform() override;
 
 private:
   /**
@@ -228,6 +239,7 @@ private:
 
   Timer mFrameDelayTimer;
   WeakHandle<Actor> mPlacementActor;
+  ImageVisualShaderFactory& mImageVisualShaderFactory;
 
   // Variables for GIF player
   Dali::Vector<uint32_t> mFrameDelayContainer;
@@ -242,6 +254,8 @@ private:
   uint16_t mCacheSize;
   uint16_t mBatchSize;
   uint16_t mFrameDelay;
+  int16_t mLoopCount;
+  int16_t mCurrentLoopIndex;
   uint16_t mUrlIndex;
 
   // Shared variables
@@ -250,7 +264,10 @@ private:
 
   Dali::WrapMode::Type mWrapModeU:3;
   Dali::WrapMode::Type mWrapModeV:3;
+  DevelAnimatedImageVisual::Action::Type mActionStatus:3;
+  DevelImageVisual::StopBehavior::Type   mStopBehavior:2;
   bool mStartFirstFrame:1;
+  bool mIsJumpTo:1;
 };
 
 } // namespace Internal