Improve code related to scroll API in web engine. 26/252026/3
authorhuayong.xu <huayong.xu@samsung.com>
Fri, 22 Jan 2021 01:46:44 +0000 (09:46 +0800)
committerhuayong.xu <huayong.xu@samsung.com>
Wed, 27 Jan 2021 01:47:48 +0000 (09:47 +0800)
This improvement is suggested by Mr Richard Huang.

Change-Id: Ia9e06ca7a12bf6e7e8d845f443afe89c34970b46

dali/devel-api/adaptor-framework/web-engine-plugin.h
dali/devel-api/adaptor-framework/web-engine.cpp
dali/devel-api/adaptor-framework/web-engine.h
dali/internal/web-engine/common/web-engine-impl.cpp
dali/internal/web-engine/common/web-engine-impl.h

index eb4a5fe..118446d 100755 (executable)
@@ -43,12 +43,12 @@ public:
   /**
    * @brief WebEngine signal type related with page loading.
    */
-  typedef Signal<void(const std::string&)> WebEnginePageLoadSignalType;
+  using WebEnginePageLoadSignalType = Signal< void( const std::string& ) >;
 
   /**
    * @brief WebView signal type related with page loading error.
    */
-  typedef Signal<void(const std::string&, int)> WebEnginePageLoadErrorSignalType;
+  using WebEnginePageLoadErrorSignalType = Signal< void( const std::string&, int ) >;
 
   // forward declaration.
   enum class ScrollEdge;
@@ -56,7 +56,7 @@ public:
   /**
    * @brief WebView signal type related with scroll edge reached.
    */
-  typedef Signal< void( const ScrollEdge )> WebEngineScrollEdgeReachedSignalType;
+  using WebEngineScrollEdgeReachedSignalType = Signal< void( const ScrollEdge ) >;
 
   /**
    * @brief Enumeration for the scroll edge.
@@ -197,17 +197,17 @@ public:
   /**
    * @brief Gets the current scroll position of the given view.
    */
-  virtual void GetScrollPosition( int& x, int& y ) const = 0;
+  virtual Dali::Vector2 GetScrollPosition() const = 0;
 
   /**
    * @brief Gets the possible scroll size of the given view.
    */
-  virtual void GetScrollSize( int& width, int& height ) const = 0;
+  virtual Dali::Vector2 GetScrollSize() const = 0;
 
   /**
    * @brief Gets the last known content's size.
    */
-  virtual void GetContentSize( int& width, int& height ) const = 0;
+  virtual Dali::Vector2 GetContentSize() const = 0;
 
   /**
    * @brief Returns whether forward is possible.
index 76dfec0..e454f0d 100755 (executable)
@@ -164,19 +164,19 @@ void WebEngine::SetScrollPosition( int x, int y )
   GetImplementation( *this ).SetScrollPosition( x, y );
 }
 
-void WebEngine::GetScrollPosition( int& x, int& y ) const
+Dali::Vector2 WebEngine::GetScrollPosition() const
 {
-  GetImplementation( *this ).GetScrollPosition( x, y );
+  return GetImplementation( *this ).GetScrollPosition();
 }
 
-void WebEngine::GetScrollSize( int& width, int& height ) const
+Dali::Vector2 WebEngine::GetScrollSize() const
 {
-  GetImplementation( *this ).GetScrollSize( width, height );
+  return GetImplementation( *this ).GetScrollSize();
 }
 
-void WebEngine::GetContentSize( int& width, int& height ) const
+Dali::Vector2 WebEngine::GetContentSize() const
 {
-  GetImplementation( *this ).GetContentSize( width, height );
+  return GetImplementation( *this ).GetContentSize();
 }
 
 bool WebEngine::CanGoForward()
index b733353..040a521 100755 (executable)
@@ -202,17 +202,17 @@ public:
   /**
    * @brief Gets the current scroll position of the given view.
    */
-  void GetScrollPosition( int& x, int& y ) const;
+  Dali::Vector2 GetScrollPosition() const;
 
   /**
    * @brief Gets the possible scroll size of the given view.
    */
-  void GetScrollSize( int& width, int& height ) const;
+  Dali::Vector2 GetScrollSize() const;
 
   /**
    * @brief Gets the last known content's size.
    */
-  void GetContentSize( int& width, int& height ) const;
+  Dali::Vector2 GetContentSize() const;
 
   /**
    * @brief Returns whether forward is possible.
index 0943387..0a6ecf0 100755 (executable)
@@ -273,19 +273,19 @@ void WebEngine::SetScrollPosition( int x, int y )
   mPlugin->SetScrollPosition( x, y );
 }
 
-void WebEngine::GetScrollPosition( int& x, int& y ) const
+Dali::Vector2 WebEngine::GetScrollPosition() const
 {
-  mPlugin->GetScrollPosition( x, y );
+  return mPlugin->GetScrollPosition();
 }
 
-void WebEngine::GetScrollSize( int& width, int& height ) const
+Dali::Vector2 WebEngine::GetScrollSize() const
 {
-  mPlugin->GetScrollSize( width, height );
+  return mPlugin->GetScrollSize();
 }
 
-void WebEngine::GetContentSize( int& width, int& height ) const
+Dali::Vector2 WebEngine::GetContentSize() const
 {
-  mPlugin->GetContentSize( width, height );
+  return mPlugin->GetContentSize();
 }
 
 bool WebEngine::CanGoForward()
index a2a6571..dea65ba 100755 (executable)
@@ -166,17 +166,17 @@ public:
   /**
    * @copydoc Dali::WebEngine::GetScrollPosition()
    */
-  void GetScrollPosition( int& x, int& y ) const;
+  Dali::Vector2 GetScrollPosition() const;
 
   /**
    * @copydoc Dali::WebEngine::GetScrollSize()
    */
-  void GetScrollSize( int& width, int& height ) const;
+  Dali::Vector2 GetScrollSize() const;
 
   /**
    * @copydoc Dali::WebEngine::GetContentSize()
    */
-  void GetContentSize( int& width, int& height ) const;
+  Dali::Vector2 GetContentSize() const;
 
   /**
    * @copydoc Dali::WebEngine::CanGoForward()