[Tizen] Add a WebView API for notifying orientation change. 14/305514/5 accepted/tizen/8.0/unified/20240208.163215
authorhuayong.xu <huayong.xu@samsung.com>
Fri, 2 Feb 2024 06:58:37 +0000 (14:58 +0800)
committerhuayong.xu <huayong.xu@samsung.com>
Sun, 4 Feb 2024 01:16:01 +0000 (09:16 +0800)
Change-Id: I361f129c414a9b9d64c532baf8394aff440a3688
Signed-off-by: huayong.xu <huayong.xu@samsung.com>
dali-extension/web-engine-chromium/tizen-web-engine-chromium.cpp
dali-extension/web-engine-chromium/tizen-web-engine-chromium.h
dali-extension/web-engine-lwe/tizen-web-engine-lwe.cpp
dali-extension/web-engine-lwe/tizen-web-engine-lwe.h

index f6c821a..20b7597 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -226,6 +226,12 @@ NativeImageSourcePtr TizenWebEngineChromium::GetNativeImageSource()
   return mDaliImageSrc;
 }
 
+void TizenWebEngineChromium::ChangeOrientation(int orientation)
+{
+  DALI_LOG_RELEASE_INFO("#ChangeOrientation : %d\n", orientation);
+  ewk_view_orientation_send(mWebView, orientation);
+}
+
 std::string TizenWebEngineChromium::GetUrl() const
 {
   const char* url = ewk_view_url_get(mWebView);
index b2afb00..230c3a7 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TIZEN_WEB_ENGINE_CHROMIUM_H
 
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -93,6 +93,11 @@ public:
   NativeImageSourcePtr GetNativeImageSource() override;
 
   /**
+   * @copydoc Dali::WebEnginePlugin::ChangeOrientation()
+   */
+  void ChangeOrientation(int orientation) override;
+
+  /**
    * @copydoc Dali::WebEnginePlugin::GetTitle()
    */
   std::string GetTitle() const override;
index b957cda..1f71ff6 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -750,6 +750,11 @@ Dali::NativeImageSourcePtr TizenWebEngineLWE::GetNativeImageSource()
   return mNativeImageSourcePtr;
 }
 
+void TizenWebEngineLWE::ChangeOrientation(int orientation)
+{
+  // NOT IMPLEMENTED
+}
+
 void TizenWebEngineLWE::LoadUrl(const std::string& url)
 {
   DALI_ASSERT_ALWAYS(mWebContainer);
index a4adc7e..1707e84 100755 (executable)
@@ -2,7 +2,7 @@
 #define DALI_TIZEN_WEB_ENGINE_LWE_H
 
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -94,6 +94,11 @@ public:
   Dali::NativeImageSourcePtr GetNativeImageSource() override;
 
   /**
+   * @copydoc Dali::WebEnginePlugin::ChangeOrientation()
+   */
+  void ChangeOrientation(int orientation) override;
+
+  /**
    * @copydoc Dali::WebEnginePlugin::LoadUrl()
    */
   void LoadUrl(const std::string& url) override;