[Tizen] Change type of the Scene size and remove unused code 14/226714/1 accepted/tizen/5.5/unified/20200311.131110 submit/tizen_5.5/20200310.033529
authorJiyun Yang <ji.yang@samsung.com>
Fri, 21 Feb 2020 11:03:07 +0000 (20:03 +0900)
committerJiyun Yang <ji.yang@samsung.com>
Thu, 5 Mar 2020 04:42:32 +0000 (13:42 +0900)
* Size type : Vector2->Uint16Pair

Change-Id: I1af34c5bf378d32407c93bf8aeabb952596687bc
Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
dali-extension/devel-api/evas-plugin/evas-plugin.cpp
dali-extension/devel-api/evas-plugin/evas-plugin.h
dali-extension/devel-api/evas-plugin/scene.cpp
dali-extension/devel-api/evas-plugin/scene.h
dali-extension/internal/evas-plugin/evas-plugin-impl.cpp
dali-extension/internal/evas-plugin/evas-plugin-impl.h
dali-extension/internal/evas-plugin/evas-wrapper.cpp
dali-extension/internal/evas-plugin/evas-wrapper.h
dali-extension/internal/evas-plugin/scene-impl.cpp
dali-extension/internal/evas-plugin/scene-impl.h

index 59dc322..18d4414 100755 (executable)
@@ -27,7 +27,7 @@ namespace Dali
 namespace Extension
 {
 
-EvasPlugin EvasPlugin::New( Evas_Object* parentEvasObject, int width, int height, bool isTranslucent )
+EvasPlugin EvasPlugin::New( Evas_Object* parentEvasObject, uint16_t width, uint16_t height, bool isTranslucent )
 {
   IntrusivePtr< Internal::EvasPlugin > impl = Internal::EvasPlugin::New( parentEvasObject, width, height, isTranslucent );
 
index d07f5df..177f479 100644 (file)
@@ -70,8 +70,8 @@ class EvasPlugin;
  * namespace
  * {
  * const char* const APPLICATION_TITLE = "EvasPluginExample";
- * const int EVAS_PLUGIN_WIDTH = 360;
- * const int EVAS_PLUGIN_HEIGHT = 360;
+ * const uint16_t EVAS_PLUGIN_WIDTH = 360;
+ * const uint16_t EVAS_PLUGIN_HEIGHT = 360;
  * }
  *
  * class EvasPluginExample : public ConnectionTracker
@@ -211,7 +211,7 @@ public:
    * @param[in] height The initial height of the default scene
    * @param[in] isTranslucent Whether the Evas object is translucent or not
    */
-  static EvasPlugin New( Evas_Object* parentEvasObject, int width, int height, bool isTranslucent );
+  static EvasPlugin New( Evas_Object* parentEvasObject, uint16_t width, uint16_t height, bool isTranslucent );
 
   /**
    * @brief Constructs an empty handle
index ba64246..364a49d 100644 (file)
@@ -31,7 +31,7 @@ namespace Dali
 namespace Extension
 {
 
-Scene Scene::New( EvasPlugin evasPlugin, Evas_Object* parentEvasObject, int width, int height, bool isTranslucent )
+Scene Scene::New( EvasPlugin evasPlugin, Evas_Object* parentEvasObject, uint16_t width, uint16_t height, bool isTranslucent )
 {
   IntrusivePtr< Internal::Scene > impl = Internal::Scene::New( parentEvasObject, width, height, isTranslucent );
 
@@ -99,7 +99,7 @@ Layer Scene::GetLayer( uint32_t depth ) const
   return Internal::GetImplementation( *this ).GetLayer( depth );
 }
 
-Size Scene::GetSize() const
+Scene::SceneSize Scene::GetSize() const
 {
   return Internal::GetImplementation( *this ).GetSize();
 }
index fd02dc6..fb57d1b 100644 (file)
@@ -27,6 +27,7 @@
 #include <Evas.h>
 
 #include <dali/public-api/actors/actor.h>
+#include <dali/public-api/math/uint-16-pair.h>
 #include <dali/public-api/signals/dali-signal.h>
 
 // INTERNAL INCLUDES
@@ -64,11 +65,13 @@ class DALI_IMPORT_API Scene : public Dali::BaseHandle
 {
 public:
 
+  typedef Uint16Pair SceneSize;
+
   typedef Signal<void (Scene, bool)> VisibilityChangedSignalType;
 
   typedef Signal<void (Scene, bool)> FocusChangedSignalType;
 
-  typedef Signal<void (Scene, int width, int height)> ResizedSignalType;
+  typedef Signal<void (Scene, uint16_t, uint16_t)> ResizedSignalType;
 
 public:
 
@@ -82,7 +85,7 @@ public:
    * @param[in] height The initial height of the scene
    * @param[in] isTranslucent Whether the Evas object is translucent or not
    */
-  static Scene New( EvasPlugin evasPlugin, Evas_Object* parentEvasObject, int width, int height, bool isTranslucent );
+  static Scene New( EvasPlugin evasPlugin, Evas_Object* parentEvasObject, uint16_t width, uint16_t height, bool isTranslucent );
 
   /**
    * @brief Constructs an empty handle
@@ -174,7 +177,7 @@ public:
    *
    * @return The size of the Scene as a Vector
    */
-  Size GetSize() const;
+  SceneSize GetSize() const;
 
   /**
    * @brief This returns the Evas_Object* for accessibility which is created internally
index c176430..11c1937 100755 (executable)
@@ -34,13 +34,13 @@ namespace Extension
 namespace Internal
 {
 
-IntrusivePtr< EvasPlugin > EvasPlugin::New( Evas_Object* parentEvasObject, int width, int height, bool isTranslucent )
+IntrusivePtr< EvasPlugin > EvasPlugin::New( Evas_Object* parentEvasObject, uint16_t width, uint16_t height, bool isTranslucent )
 {
   IntrusivePtr< EvasPlugin > evasPlugin = new EvasPlugin( parentEvasObject, width, height, isTranslucent );
   return evasPlugin;
 }
 
-EvasPlugin::EvasPlugin( Evas_Object* parentEvasObject, int width, int height, bool isTranslucent )
+EvasPlugin::EvasPlugin( Evas_Object* parentEvasObject, uint16_t width, uint16_t height, bool isTranslucent )
 : mSingletonService( SingletonService::New() ),
   mState( READY )
 {
@@ -146,7 +146,7 @@ Evas_Object* EvasPlugin::GetDaliEvasObject()
   return mDefaultScene.GetDaliEvasObject();
 }
 
-void EvasPlugin::OnDefaultSceneResized( Extension::Scene defaultScene, int width, int height )
+void EvasPlugin::OnDefaultSceneResized( Extension::Scene defaultScene, uint16_t width, uint16_t height )
 {
   mResizeSignal.Emit();
 }
index 1fdff54..325afa3 100755 (executable)
@@ -58,7 +58,7 @@ public:
    * @param[in] height The height of Dali view port
    * @param[in] isTranslucent Whether the evas object is translucent or not
    */
-  static IntrusivePtr<EvasPlugin> New( Evas_Object* parentEvasObject, int width, int height, bool isTranslucent );
+  static IntrusivePtr<EvasPlugin> New( Evas_Object* parentEvasObject, uint16_t width, uint16_t height, bool isTranslucent );
 
 public:
 
@@ -197,7 +197,7 @@ private:
    * @param[in] height The height of Dali view port
    * @param[in] isTranslucent Whether the evas object is translucent or not
    */
-  EvasPlugin( Evas_Object* parentEvasObject, int width, int height, bool isTranslucent );
+  EvasPlugin( Evas_Object* parentEvasObject, uint16_t width, uint16_t height, bool isTranslucent );
 
   /**
    * Destructor
@@ -211,7 +211,7 @@ private:
   /**
    * This callback is for supporting legacy API EvasPlugin::ResizeSignal
    */
-  void OnDefaultSceneResized( Extension::Scene defaultScene, int width, int height );
+  void OnDefaultSceneResized( Extension::Scene defaultScene, uint16_t width, uint16_t height );
 
   /**
    * This callback is for supporting legacy API EvasPlugin::FocusedSignal, EvasPlugin::UnFocusedSignal
index ef216ce..7ab1d94 100644 (file)
@@ -41,21 +41,23 @@ const char* ELM_OBJECT_CONTAINER_PART_NAME = "elm.swallow.content";
 
 } // unnamed namespace
 
-EvasWrapper::EvasWrapper( Evas_Object* pluginParent, int width, int height, bool transparent )
+EvasWrapper::EvasWrapper( Evas_Object* pluginParent, uint16_t width, uint16_t height, bool transparent )
 : mEcoreEvas( nullptr ),
   mImageEvasObject( nullptr ),
   mAccessibilityEvasObject( nullptr ),
   mFocusEvasObject( nullptr )
 {
+  int intWidth = static_cast<int>( width );
+  int intHeight = static_cast<int>( height );
+
   Evas* evas = evas_object_evas_get( pluginParent );
   mEcoreEvas = ecore_evas_ecore_evas_get( evas );
 
   // Create the image evas object
   mImageEvasObject = evas_object_image_filled_add( evas );
   evas_object_name_set( mImageEvasObject, IMAGE_EVAS_OBJECT_NAME );
-  evas_object_image_content_hint_set( mImageEvasObject, EVAS_IMAGE_CONTENT_HINT_DYNAMIC );
   evas_object_image_alpha_set( mImageEvasObject, transparent ? EINA_TRUE : EINA_FALSE );
-  evas_object_image_size_set( mImageEvasObject, width, height );
+  evas_object_image_size_set( mImageEvasObject, intWidth, intHeight );
   evas_object_size_hint_weight_set( mImageEvasObject, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND );
   evas_object_size_hint_align_set( mImageEvasObject, EVAS_HINT_FILL, EVAS_HINT_FILL );
 
@@ -77,7 +79,7 @@ EvasWrapper::EvasWrapper( Evas_Object* pluginParent, int width, int height, bool
   evas_object_size_hint_align_set( mFocusEvasObject, EVAS_HINT_FILL, EVAS_HINT_FILL );
 
   evas_object_move( mFocusEvasObject, 0, 0 );
-  evas_object_resize( mFocusEvasObject, width, height );
+  evas_object_resize( mFocusEvasObject, intWidth, intHeight );
   evas_object_show( mFocusEvasObject );
 }
 
index 4258c9f..a853772 100644 (file)
@@ -56,7 +56,7 @@ public:
    * @param[in] height The initial height of the Dali view port
    * @param[in] transparent Whether the Evas object is transparent or not
    */
-  EvasWrapper( Evas_Object* pluginParent, int width, int height, bool transparent );
+  EvasWrapper( Evas_Object* pluginParent, uint16_t width, uint16_t height, bool transparent );
 
   /**
    * @brief Destructor
index 8f84457..a33434a 100644 (file)
@@ -44,13 +44,13 @@ namespace Extension
 namespace Internal
 {
 
-IntrusivePtr< Scene > Scene::New( Evas_Object* parentEvasObject, int width, int height, bool isTranslucent )
+IntrusivePtr< Scene > Scene::New( Evas_Object* parentEvasObject, uint16_t width, uint16_t height, bool isTranslucent )
 {
   IntrusivePtr< Scene > scene = new Scene( parentEvasObject, width, height, isTranslucent );
   return scene;
 }
 
-Scene::Scene( Evas_Object* parentEvasObject, int width, int height, bool isTranslucent )
+Scene::Scene( Evas_Object* parentEvasObject, uint16_t width, uint16_t height, bool isTranslucent )
 : mAdaptor( nullptr ),
   mEvasWrapper( new EvasWrapper( parentEvasObject, width, height, isTranslucent ) ),
   mEvasEventHandler(),
@@ -61,7 +61,7 @@ Scene::Scene( Evas_Object* parentEvasObject, int width, int height, bool isTrans
   DALI_ASSERT_ALWAYS( parentEvasObject && "No parent object for the scene" );
 
   // Create surface
-  mSurface = std::unique_ptr< RenderSurfaceInterface >( CreateNativeSurface( PositionSize( 0, 0, width, height ), isTranslucent ) );
+  mSurface = std::unique_ptr< RenderSurfaceInterface >( CreateNativeSurface( PositionSize( 0, 0, static_cast<int>( width ), static_cast<int>( height ) ), isTranslucent ) );
 }
 
 void Scene::Initialize( EvasPlugin* evasPlugin, bool isDefaultScene )
@@ -130,9 +130,11 @@ Layer Scene::GetLayer( uint32_t depth ) const
   return mScene.GetLayer( depth );
 }
 
-Size Scene::GetSize() const
+Scene::SceneSize Scene::GetSize() const
 {
-  return mScene.GetSize();
+  Size size = mScene.GetSize();
+
+  return Scene::SceneSize( static_cast<uint16_t>( size.width ), static_cast<uint16_t>( size.height ) );
 }
 
 Dali::Any Scene::GetNativeHandle() const
@@ -155,20 +157,23 @@ Evas_Object* Scene::GetDaliEvasObject()
   return mEvasWrapper->GetFocusTarget();
 }
 
-void Scene::ResizeSurface( int width, int height )
+void Scene::ResizeSurface( uint16_t width, uint16_t height )
 {
   if( !mSurface || !mAdaptor || width <= 1 || height <= 1 )
   {
     return;
   }
 
+  int intWidth = static_cast<int>( width );
+  int intHeight = static_cast<int>( height );
+
   PositionSize currentSize = mSurface->GetPositionSize();
-  if( currentSize.width == width && currentSize.height == height )
+  if( currentSize.width == intWidth && currentSize.height == intHeight )
   {
     return;
   }
 
-  mSurface->MoveResize( PositionSize( 0, 0, width, height ) );
+  mSurface->MoveResize( PositionSize( 0, 0, intWidth, intHeight ) );
 
   SurfaceResized( true );
 
@@ -229,7 +234,7 @@ void Scene::OnEvasObjectMove( const Rect<int>& geometry )
 
 void Scene::OnEvasObjectResize( const Rect<int>& geometry )
 {
-  ResizeSurface( geometry.width, geometry.height );
+  ResizeSurface( static_cast<uint16_t>( geometry.width ), static_cast<uint16_t>( geometry.height ) );
 }
 
 void Scene::OnEvasObjectVisiblityChanged( bool visible )
index 2da040f..4a5660d 100644 (file)
@@ -54,6 +54,7 @@ class Scene : public Dali::Internal::Adaptor::SceneHolder,
               public Extension::Internal::EvasEventInterface
 {
 public:
+  typedef Dali::Extension::Scene::SceneSize SceneSize;
 
   typedef Dali::Extension::Scene::VisibilityChangedSignalType VisibilityChangedSignalType;
 
@@ -69,7 +70,7 @@ public:
    * @param[in] height The initial height of the scene
    * @param[in] isTranslucent Whether the Evas object is translucent or not
    */
-  static IntrusivePtr<Scene> New( Evas_Object* parentEvasObject, int width, int height, bool isTranslucent );
+  static IntrusivePtr<Scene> New( Evas_Object* parentEvasObject, uint16_t width, uint16_t height, bool isTranslucent );
 
 public:
 
@@ -86,7 +87,7 @@ public:
   /**
    * @copydoc Dali::Extension::Scene::GetSize
    */
-  Size GetSize() const;
+  SceneSize GetSize() const;
 
   /**
    * @brief Gets the native handle.
@@ -143,7 +144,7 @@ private:
    * @param[in] width The width value
    * @param[in] height The height value
    */
-  void ResizeSurface( int width, int height );
+  void ResizeSurface( uint16_t width, uint16_t height );
 
   /**
    * This function is called after drawing by dali.
@@ -234,7 +235,7 @@ private:
    * @param[in] height The initial height of the scene
    * @param[in] isTranslucent Whether the Evas object is translucent or not
    */
-  Scene( Evas_Object* parentEvasObject, int width, int height, bool isTranslucent );
+  Scene( Evas_Object* parentEvasObject, uint16_t width, uint16_t height, bool isTranslucent );
 
   /**
    * Destructor