From: Seoyeon Kim Date: Thu, 8 Apr 2021 04:50:16 +0000 (+0000) Subject: Merge "atspi: remove undefined method" into devel/master X-Git-Tag: dali_2.0.21~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=93f89efc39d006b4e6c6480e85a7c11057c5ef64;hp=af393bf8a62bbe38993da9ab11c8e4b8e9bcc7dd;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git Merge "atspi: remove undefined method" into devel/master --- diff --git a/dali/devel-api/adaptor-framework/accessibility-impl.cpp b/dali/devel-api/adaptor-framework/accessibility-impl.cpp index 00f0615..3db97a8 100644 --- a/dali/devel-api/adaptor-framework/accessibility-impl.cpp +++ b/dali/devel-api/adaptor-framework/accessibility-impl.cpp @@ -24,6 +24,7 @@ #include #include #include +#include // INTERNAL INCLUDES #include @@ -593,18 +594,31 @@ namespace { class NonControlAccessible : public virtual Accessible, public virtual Collection, public virtual Component { -public: - Dali::Actor actor; +protected: + Dali::WeakHandle self; bool root = false; + Dali::Actor Self() + { + auto handle = self.GetHandle(); + + // NonControlAccessible is deleted on ObjectDestroyedSignal + // for the respective actor (see `nonControlAccessibles`). + DALI_ASSERT_ALWAYS(handle); + + return handle; + } + +public: NonControlAccessible(Dali::Actor actor, bool root) - : actor(actor), + : self(actor), root(root) { } Dali::Rect<> GetExtents(Dali::Accessibility::CoordType ctype) override { + Dali::Actor actor = Self(); Vector2 screenPosition = actor.GetProperty(Actor::Property::SCREEN_POSITION).Get(); Vector3 size = actor.GetCurrentProperty(Actor::Property::SIZE) * actor.GetCurrentProperty(Actor::Property::WORLD_SCALE); bool positionUsesAnchorPoint = actor.GetProperty(Actor::Property::POSITION_USES_ANCHOR_POINT).Get(); @@ -643,7 +657,7 @@ public: } std::string GetName() override { - return actor.GetProperty(Dali::Actor::Property::NAME); + return Self().GetProperty(Dali::Actor::Property::NAME); } std::string GetDescription() override { @@ -656,24 +670,24 @@ public: auto b = GetBridgeData(); return b->bridge->GetApplication(); } - return Get(actor.GetParent()); + return Get(Self().GetParent()); } size_t GetChildCount() override { - return static_cast(actor.GetChildCount()); + return static_cast(Self().GetChildCount()); } Accessible* GetChildAtIndex(size_t index) override { - auto s = static_cast(actor.GetChildCount()); + auto s = static_cast(Self().GetChildCount()); if(index >= s) { throw std::domain_error{"invalid index " + std::to_string(index) + " for object with " + std::to_string(s) + " children"}; } - return Get(actor.GetChildAt(static_cast(index))); + return Get(Self().GetChildAt(static_cast(index))); } size_t GetIndexInParent() override { - auto parent = actor.GetParent(); + auto parent = Self().GetParent(); if(!parent) { return 0; @@ -681,7 +695,7 @@ public: auto size = static_cast(parent.GetChildCount()); for(auto i = 0u; i < size; ++i) { - if(parent.GetChildAt(i) == actor) + if(parent.GetChildAt(i) == Self()) { return i; } @@ -714,7 +728,7 @@ public: Attributes GetAttributes() override { Dali::TypeInfo type; - actor.GetTypeInfo(type); + Self().GetTypeInfo(type); return { {"t", type.GetName()}, }; diff --git a/dali/devel-api/adaptor-framework/web-engine-certificate.h b/dali/devel-api/adaptor-framework/web-engine-certificate.h new file mode 100755 index 0000000..cd0b055 --- /dev/null +++ b/dali/devel-api/adaptor-framework/web-engine-certificate.h @@ -0,0 +1,73 @@ +#ifndef DALI_WEB_ENGINE_CERTIFICATE_H +#define DALI_WEB_ENGINE_CERTIFICATE_H + +/* + * Copyright (c) 2021 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 + +namespace Dali +{ +/** + * @brief A class WebEngineCertificate for certificate of web engine. + */ +class WebEngineCertificate +{ +public: + /** + * @brief Constructor. + */ + WebEngineCertificate() = default; + + /** + * @brief Destructor. + */ + virtual ~WebEngineCertificate() = default; + + /** + * @brief Allow the site access about certificate error. + * + * @param[in] allowed A value to decide policy + */ + virtual void Allow(bool allowed) = 0; + + /** + * @brief Returns information whether the certificate comes from main frame. + * + * @return true if the certificate comes from main frame, false otherwise + */ + virtual bool IsFromMainFrame() const = 0; + + /** + * @brief Query certificate's PEM data. + * + * @return A certificate itself in the PEM format. + */ + virtual std::string GetPem() const = 0; + + /** + * @brief Query if the context loaded with a given certificate is secure. + * + * @return true if the context is secure, false otherwise + */ + virtual bool IsContextSecure() const = 0; +}; + +} // namespace Dali + +#endif // DALI_WEB_ENGINE_CERTIFICATE_H diff --git a/dali/devel-api/adaptor-framework/web-engine-frame.h b/dali/devel-api/adaptor-framework/web-engine-frame.h new file mode 100755 index 0000000..51beba9 --- /dev/null +++ b/dali/devel-api/adaptor-framework/web-engine-frame.h @@ -0,0 +1,51 @@ +#ifndef DALI_WEB_ENGINE_FRAME_H +#define DALI_WEB_ENGINE_FRAME_H + +/* + * Copyright (c) 2021 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 + +namespace Dali +{ +/** + * @brief A class WebEngineFrame for frame of web engine. + */ +class WebEngineFrame +{ +public: + /** + * @brief Constructor. + */ + WebEngineFrame() = default; + + /** + * @brief Destructor. + */ + virtual ~WebEngineFrame() = default; + + /** + * @brief Check whether the frame is main frame. + * @return true if the frame is main frame, false otherwise + */ + virtual bool IsMainFrame() const = 0; +}; + +} // namespace Dali + +#endif // DALI_WEB_ENGINE_FRAME_H diff --git a/dali/devel-api/adaptor-framework/web-engine-http-auth-handler.h b/dali/devel-api/adaptor-framework/web-engine-http-auth-handler.h new file mode 100755 index 0000000..6fcc132 --- /dev/null +++ b/dali/devel-api/adaptor-framework/web-engine-http-auth-handler.h @@ -0,0 +1,70 @@ +#ifndef DALI_WEB_ENGINE_HTTP_AUTH_HANDLER_H +#define DALI_WEB_ENGINE_HTTP_AUTH_HANDLER_H + +/* + * Copyright (c) 2021 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 + +namespace Dali +{ +/** + * @brief A class WebEngineHttpAuthHandler for HTTP authentication handler of web engine. + */ +class WebEngineHttpAuthHandler +{ +public: + /** + * @brief Constructor. + */ + WebEngineHttpAuthHandler() = default; + + /** + * @brief Destructor. + */ + virtual ~WebEngineHttpAuthHandler() = default; + + /** + * @brief Gets the realm string of authentication challenge received. + * + * @return the realm of authentication challenge + */ + virtual std::string GetRealm() const = 0; + + /** + * @brief Suspend the operation for authentication challenge. + */ + virtual void Suspend() = 0; + + /** + * @brief Send credential for authentication challenge. + * + * @param[in] user user id from user input. + * @param[in] password user password from user input. + */ + virtual void UseCredential(const std::string& user, const std::string& password) = 0; + + /** + * @brief Send cancellation notification for authentication challenge. + */ + virtual void CancelCredential() = 0; +}; + +} // namespace Dali + +#endif // DALI_WEB_ENGINE_HTTP_AUTH_HANDLER_H diff --git a/dali/devel-api/adaptor-framework/web-engine-plugin.h b/dali/devel-api/adaptor-framework/web-engine-plugin.h index 3530b1b..c87fbe4 100644 --- a/dali/devel-api/adaptor-framework/web-engine-plugin.h +++ b/dali/devel-api/adaptor-framework/web-engine-plugin.h @@ -32,12 +32,15 @@ class KeyEvent; class PixelData; class TouchEvent; class WebEngineBackForwardList; +class WebEngineCertificate; class WebEngineConsoleMessage; class WebEngineContext; class WebEngineCookieManager; class WebEngineFormRepostDecision; -class WebEngineRequestInterceptor; +class WebEngineHttpAuthHandler; class WebEngineLoadError; +class WebEnginePolicyDecision; +class WebEngineRequestInterceptor; class WebEngineSettings; class HoverEvent; class WheelEvent; @@ -101,6 +104,16 @@ public: using WebEngineConsoleMessageSignalType = Signal)>; /** + * @brief WebView signal type related with certificate changed. + */ + using WebEngineCertificateSignalType = Signal)>; + + /** + * @brief WebView signal type related with http authentication. + */ + using WebEngineHttpAuthHandlerSignalType = Signal)>; + + /** * @brief Alert callback when JavaScript alert is called with a message. * It returns true if a pop-up is created successfully, false otherwise. */ @@ -130,6 +143,11 @@ public: using WebEngineFrameRenderedSignalType = Signal; /** + * @brief WebView signal type related with policy would be decided. + */ + using WebEnginePolicyDecisionSignalType = Signal)>; + + /** * @brief Enumeration for the scroll edge. */ enum class ScrollEdge @@ -755,6 +773,34 @@ public: * @return A signal object to connect with. */ virtual WebEngineConsoleMessageSignalType& ConsoleMessageSignal() = 0; + + /** + * @brief Connects to this signal to be notified when new policy would be decided. + * + * @return A signal object to connect with. + */ + virtual WebEnginePolicyDecisionSignalType& PolicyDecisionSignal() = 0; + + /** + * @brief Connects to this signal to be notified when certificate need be confirmed. + * + * @return A signal object to connect with. + */ + virtual WebEngineCertificateSignalType& CertificateConfirmSignal() = 0; + + /** + * @brief Connects to this signal to be notified when ssl certificate is changed. + * + * @return A signal object to connect with. + */ + virtual WebEngineCertificateSignalType& SslCertificateChangedSignal() = 0; + + /** + * @brief Connects to this signal to be notified when http authentication need be confirmed. + * + * @return A signal object to connect with. + */ + virtual WebEngineHttpAuthHandlerSignalType& HttpAuthHandlerSignal() = 0; }; // specialization has to be done in the same namespace diff --git a/dali/devel-api/adaptor-framework/web-engine-policy-decision.h b/dali/devel-api/adaptor-framework/web-engine-policy-decision.h new file mode 100755 index 0000000..a9fda10 --- /dev/null +++ b/dali/devel-api/adaptor-framework/web-engine-policy-decision.h @@ -0,0 +1,136 @@ +#ifndef DALI_WEB_ENGINE_POLICY_DECISION_H +#define DALI_WEB_ENGINE_POLICY_DECISION_H + +/* + * Copyright (c) 2021 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 + +namespace Dali +{ +class WebEngineFrame; + +/** + * @brief A class WebBackForwardList for back forward list of web engine. + */ +class WebEnginePolicyDecision +{ +public: + /** + * @brief Enumeration that provides an option to policy decision types. + */ + enum class DecisionType + { + USE, ///< Use. + DOWNLOAD, ///< Download. + IGNORE, ///< Ignore. + }; + + /** + * @brief Enumeration that provides an option to policy navigation types. + */ + enum class NavigationType + { + LINK_CLICKED, ///< Link clicked. + FORM_SUBMITTED, ///< Form submitted. + BACK_FORWARD, ///< Back forward. + RELOAD, ///< Reload. + FORM_RESUBMITTED, ///< Form resubmitted. + OTHER, ///< Other. + }; + + /** + * @brief Constructor. + */ + WebEnginePolicyDecision() = default; + + /** + * @brief Destructor. + */ + virtual ~WebEnginePolicyDecision() = default; + + /** + * @brief Returns the url that request policy decision. + * @return The url that request policy decision + */ + virtual std::string GetUrl() const = 0; + + /** + * @brief Returns a cookie that web page has. + * @return The cookie string if successfully + */ + virtual std::string GetCookie() const = 0; + + /** + * @brief Returns a decision type. + * @return The decision type + */ + virtual DecisionType GetDecisionType() const = 0; + + /** + * @brief Returns a MIME type for response data. + * @return The MIME type string + */ + virtual std::string GetResponseMime() const = 0; + + /** + * @brief Returns an HTTP status code. + * @return The HTTP status code number + */ + virtual int32_t GetResponseStatusCode() const = 0; + + /** + * @brief Returns a navigation type. + * @return The navigation type + */ + virtual NavigationType GetNavigationType() const = 0; + + /** + * @brief Gets frame. + * @return The frame of policy decision + */ + virtual WebEngineFrame& GetFrame() const = 0; + + /** + * @brief Gets a scheme from the Policy Decision. + * @return The scheme if succeeded, empty otherwise + */ + virtual std::string GetScheme() const = 0; + + /** + * @brief Accepts the action which triggers this decision. + * @return True if successfully, false otherwise + */ + virtual bool Use() = 0; + + /** + * @brief Ignores the action which triggers this decision. + * @return True if successfully, false otherwise + */ + virtual bool Ignore() = 0; + + /** + * @brief Suspend the operation for policy decision. + * @return True if successfully, false otherwise + */ + virtual bool Suspend() = 0; +}; + +} // namespace Dali + +#endif // DALI_WEB_ENGINE_POLICY_DECISION_H diff --git a/dali/devel-api/adaptor-framework/web-engine.cpp b/dali/devel-api/adaptor-framework/web-engine.cpp index d186a61..c7edd4c 100755 --- a/dali/devel-api/adaptor-framework/web-engine.cpp +++ b/dali/devel-api/adaptor-framework/web-engine.cpp @@ -20,11 +20,14 @@ // INTERNAL INCLUDES #include +#include #include #include #include -#include +#include #include +#include +#include #include #include @@ -512,4 +515,24 @@ Dali::WebEnginePlugin::WebEngineConsoleMessageSignalType& WebEngine::ConsoleMess return GetImplementation(*this).ConsoleMessageSignal(); } +Dali::WebEnginePlugin::WebEnginePolicyDecisionSignalType& WebEngine::PolicyDecisionSignal() +{ + return GetImplementation(*this).PolicyDecisionSignal(); +} + +Dali::WebEnginePlugin::WebEngineCertificateSignalType& WebEngine::CertificateConfirmSignal() +{ + return GetImplementation(*this).CertificateConfirmSignal(); +} + +Dali::WebEnginePlugin::WebEngineCertificateSignalType& WebEngine::SslCertificateChangedSignal() +{ + return GetImplementation(*this).SslCertificateChangedSignal(); +} + +Dali::WebEnginePlugin::WebEngineHttpAuthHandlerSignalType& WebEngine::HttpAuthHandlerSignal() +{ + return GetImplementation(*this).HttpAuthHandlerSignal(); +} + } // namespace Dali diff --git a/dali/devel-api/adaptor-framework/web-engine.h b/dali/devel-api/adaptor-framework/web-engine.h index 1c6e97a..ca3ea6f 100755 --- a/dali/devel-api/adaptor-framework/web-engine.h +++ b/dali/devel-api/adaptor-framework/web-engine.h @@ -678,6 +678,34 @@ public: */ Dali::WebEnginePlugin::WebEngineConsoleMessageSignalType& ConsoleMessageSignal(); + /** + * @brief Connects to this signal to be notified when new policy would be decided. + * + * @return A signal object to connect with. + */ + Dali::WebEnginePlugin::WebEnginePolicyDecisionSignalType& PolicyDecisionSignal(); + + /** + * @brief Connects to this signal to be notified when certificate need be confirmed. + * + * @return A signal object to connect with. + */ + Dali::WebEnginePlugin::WebEngineCertificateSignalType& CertificateConfirmSignal(); + + /** + * @brief Connects to this signal to be notified when ssl certificate is changed. + * + * @return A signal object to connect with. + */ + Dali::WebEnginePlugin::WebEngineCertificateSignalType& SslCertificateChangedSignal(); + + /** + * @brief Connects to this signal to be notified when http authentication need be confirmed. + * + * @return A signal object to connect with. + */ + Dali::WebEnginePlugin::WebEngineHttpAuthHandlerSignalType& HttpAuthHandlerSignal(); + private: // Not intended for application developers /** * @brief Internal constructor diff --git a/dali/devel-api/file.list b/dali/devel-api/file.list index b1aca21..8e3ed5f 100755 --- a/dali/devel-api/file.list +++ b/dali/devel-api/file.list @@ -91,12 +91,16 @@ SET( devel_api_adaptor_framework_header_files ${adaptor_devel_api_dir}/adaptor-framework/web-engine.h ${adaptor_devel_api_dir}/adaptor-framework/web-engine-back-forward-list-item.h ${adaptor_devel_api_dir}/adaptor-framework/web-engine-back-forward-list.h + ${adaptor_devel_api_dir}/adaptor-framework/web-engine-certificate.h ${adaptor_devel_api_dir}/adaptor-framework/web-engine-console-message.h ${adaptor_devel_api_dir}/adaptor-framework/web-engine-context.h ${adaptor_devel_api_dir}/adaptor-framework/web-engine-cookie-manager.h ${adaptor_devel_api_dir}/adaptor-framework/web-engine-form-repost-decision.h + ${adaptor_devel_api_dir}/adaptor-framework/web-engine-frame.h + ${adaptor_devel_api_dir}/adaptor-framework/web-engine-http-auth-handler.h ${adaptor_devel_api_dir}/adaptor-framework/web-engine-load-error.h ${adaptor_devel_api_dir}/adaptor-framework/web-engine-plugin.h + ${adaptor_devel_api_dir}/adaptor-framework/web-engine-policy-decision.h ${adaptor_devel_api_dir}/adaptor-framework/web-engine-request-interceptor.h ${adaptor_devel_api_dir}/adaptor-framework/web-engine-settings.h ${adaptor_devel_api_dir}/adaptor-framework/key-extension-plugin.h diff --git a/dali/internal/canvas-renderer/tizen/canvas-renderer-impl-tizen.cpp b/dali/internal/canvas-renderer/tizen/canvas-renderer-impl-tizen.cpp index 95135bf..b1b043c 100644 --- a/dali/internal/canvas-renderer/tizen/canvas-renderer-impl-tizen.cpp +++ b/dali/internal/canvas-renderer/tizen/canvas-renderer-impl-tizen.cpp @@ -52,8 +52,10 @@ CanvasRendererTizen* CanvasRendererTizen::New(const Vector2& viewBox) CanvasRendererTizen::CanvasRendererTizen(const Vector2& viewBox) : mPixelBuffer(nullptr), +#ifdef THORVG_SUPPORT mTvgCanvas(nullptr), mTvgRoot(nullptr), +#endif mSize(0, 0), mViewBox(0, 0), mChanged(false) @@ -63,6 +65,7 @@ CanvasRendererTizen::CanvasRendererTizen(const Vector2& viewBox) CanvasRendererTizen::~CanvasRendererTizen() { +#ifdef THORVG_SUPPORT for(DrawableVectorIterator it = mDrawables.begin(), endIt = mDrawables.end(); it != endIt; @@ -78,10 +81,12 @@ CanvasRendererTizen::~CanvasRendererTizen() } //Terminate ThorVG Engine tvg::Initializer::term(tvg::CanvasEngine::Sw); +#endif } void CanvasRendererTizen::Initialize(const Vector2& viewBox) { +#ifdef THORVG_SUPPORT if(tvg::Initializer::init(tvg::CanvasEngine::Sw, 0 /*threads*/) != tvg::Result::Success) { DALI_LOG_ERROR("ThorVG engine initialize failed\n"); @@ -99,10 +104,12 @@ void CanvasRendererTizen::Initialize(const Vector2& viewBox) auto scene = tvg::Scene::gen(); mTvgRoot = scene.get(); mTvgCanvas->push(move(scene)); +#endif } bool CanvasRendererTizen::Commit() { +#ifdef THORVG_SUPPORT bool changed = false; for(DrawableVectorIterator it = mDrawables.begin(), @@ -157,6 +164,9 @@ bool CanvasRendererTizen::Commit() return false; } return true; +#else + return false; +#endif } Devel::PixelBuffer CanvasRendererTizen::GetPixelBuffer() @@ -166,6 +176,7 @@ Devel::PixelBuffer CanvasRendererTizen::GetPixelBuffer() bool CanvasRendererTizen::AddDrawable(Dali::CanvasRenderer::Drawable& drawable) { +#ifdef THORVG_SUPPORT bool exist = false; for(DrawableVectorIterator it = mDrawables.begin(), endIt = mDrawables.end(); @@ -208,6 +219,9 @@ bool CanvasRendererTizen::AddDrawable(Dali::CanvasRenderer::Drawable& drawable) mChanged = true; return true; +#else + return false; +#endif } bool CanvasRendererTizen::SetSize(const Vector2& size) @@ -235,6 +249,7 @@ const Vector2& CanvasRendererTizen::GetSize() void CanvasRendererTizen::MakeTargetBuffer(const Vector2& size) { +#ifdef THORVG_SUPPORT mPixelBuffer = Devel::PixelBuffer::New(size.width, size.height, Dali::Pixel::RGBA8888); unsigned char* pBuffer; @@ -249,6 +264,7 @@ void CanvasRendererTizen::MakeTargetBuffer(const Vector2& size) mTvgCanvas->sync(); mTvgCanvas->target(reinterpret_cast(pBuffer), size.width, size.width, size.height, tvg::SwCanvas::ABGR8888); +#endif } } // namespace Adaptor diff --git a/dali/internal/canvas-renderer/tizen/canvas-renderer-impl-tizen.h b/dali/internal/canvas-renderer/tizen/canvas-renderer-impl-tizen.h index 7e15533..eea66be 100644 --- a/dali/internal/canvas-renderer/tizen/canvas-renderer-impl-tizen.h +++ b/dali/internal/canvas-renderer/tizen/canvas-renderer-impl-tizen.h @@ -19,8 +19,10 @@ */ // EXTERNAL INCLUDES -#include +#ifdef THORVG_SUPPORT #include +#endif +#include // INTERNAL INCLUDES #include @@ -104,8 +106,10 @@ private: private: Devel::PixelBuffer mPixelBuffer; - std::unique_ptr mTvgCanvas; - tvg::Scene* mTvgRoot; +#ifdef THORVG_SUPPORT + std::unique_ptr mTvgCanvas; + tvg::Scene* mTvgRoot; +#endif typedef std::vector > DrawableVector; typedef DrawableVector::iterator DrawableVectorIterator; DrawableVector mDrawables; diff --git a/dali/internal/canvas-renderer/tizen/drawable-impl-tizen.cpp b/dali/internal/canvas-renderer/tizen/drawable-impl-tizen.cpp index 464d535..a3b453e 100644 --- a/dali/internal/canvas-renderer/tizen/drawable-impl-tizen.cpp +++ b/dali/internal/canvas-renderer/tizen/drawable-impl-tizen.cpp @@ -48,21 +48,27 @@ DrawableTizen* DrawableTizen::New() DrawableTizen::DrawableTizen() : mAdded(false), - mChanged(false), + mChanged(false) +#ifdef THORVG_SUPPORT + , mTvgPaint(nullptr) +#endif { } DrawableTizen::~DrawableTizen() { +#ifdef THORVG_SUPPORT if(mTvgPaint && !mAdded) { delete mTvgPaint; } +#endif } bool DrawableTizen::SetOpacity(float opacity) { +#ifdef THORVG_SUPPORT if(!mTvgPaint) { DALI_LOG_ERROR("Drawable is null [%p]\n", this); @@ -75,20 +81,28 @@ bool DrawableTizen::SetOpacity(float opacity) } SetChanged(true); return true; +#else + return false; +#endif } float DrawableTizen::GetOpacity() const { +#ifdef THORVG_SUPPORT if(!mTvgPaint) { DALI_LOG_ERROR("Drawable is null [%p]\n", this); return 0; } return (float)mTvgPaint->opacity() / 255.f; +#else + return 0; +#endif } bool DrawableTizen::Rotate(Degree degree) { +#ifdef THORVG_SUPPORT if(!mTvgPaint) { DALI_LOG_ERROR("Drawable is null\n"); @@ -102,10 +116,14 @@ bool DrawableTizen::Rotate(Degree degree) } SetChanged(true); return true; +#else + return false; +#endif } bool DrawableTizen::Scale(float factor) { +#ifdef THORVG_SUPPORT if(!mTvgPaint) { DALI_LOG_ERROR("Drawable is null\n"); @@ -119,10 +137,14 @@ bool DrawableTizen::Scale(float factor) } SetChanged(true); return true; +#else + return false; +#endif } bool DrawableTizen::Translate(Vector2 translate) { +#ifdef THORVG_SUPPORT if(!mTvgPaint) { DALI_LOG_ERROR("Drawable is null\n"); @@ -136,10 +158,14 @@ bool DrawableTizen::Translate(Vector2 translate) } SetChanged(true); return true; +#else + return false; +#endif } bool DrawableTizen::Transform(const Dali::Matrix3& matrix) { +#ifdef THORVG_SUPPORT if(!mTvgPaint) { DALI_LOG_ERROR("Drawable is null\n"); @@ -155,6 +181,9 @@ bool DrawableTizen::Transform(const Dali::Matrix3& matrix) } SetChanged(true); return true; +#else + return false; +#endif } void DrawableTizen::SetDrawableAdded(bool added) @@ -164,11 +193,16 @@ void DrawableTizen::SetDrawableAdded(bool added) void* DrawableTizen::GetObject() const { +#ifdef THORVG_SUPPORT return static_cast(mTvgPaint); +#else + return nullptr; +#endif } void DrawableTizen::SetObject(const void* object) { +#ifdef THORVG_SUPPORT if(object) { mTvgPaint = static_cast((void*)object); @@ -184,6 +218,7 @@ void DrawableTizen::SetObject(const void* object) delete mTvgPaint; } } +#endif } void DrawableTizen::SetChanged(bool changed) diff --git a/dali/internal/canvas-renderer/tizen/drawable-impl-tizen.h b/dali/internal/canvas-renderer/tizen/drawable-impl-tizen.h index e73ec78..836dd57 100644 --- a/dali/internal/canvas-renderer/tizen/drawable-impl-tizen.h +++ b/dali/internal/canvas-renderer/tizen/drawable-impl-tizen.h @@ -19,8 +19,10 @@ */ // EXTERNAL INCLUDES -#include +#ifdef THORVG_SUPPORT #include +#endif +#include // INTERNAL INCLUDES #include @@ -121,7 +123,9 @@ private: bool mAdded; bool mChanged; +#ifdef THORVG_SUPPORT tvg::Paint* mTvgPaint; +#endif }; } // namespace Adaptor diff --git a/dali/internal/canvas-renderer/tizen/shape-impl-tizen.cpp b/dali/internal/canvas-renderer/tizen/shape-impl-tizen.cpp index 5e66c54..04db5c4 100644 --- a/dali/internal/canvas-renderer/tizen/shape-impl-tizen.cpp +++ b/dali/internal/canvas-renderer/tizen/shape-impl-tizen.cpp @@ -46,7 +46,9 @@ ShapeTizen* ShapeTizen::New() } ShapeTizen::ShapeTizen() +#ifdef THORVG_SUPPORT : mTvgShape(nullptr) +#endif { Initialize(); } @@ -57,6 +59,7 @@ ShapeTizen::~ShapeTizen() void ShapeTizen::Initialize() { +#ifdef THORVG_SUPPORT mTvgShape = tvg::Shape::gen().release(); if(!mTvgShape) { @@ -65,10 +68,12 @@ void ShapeTizen::Initialize() Drawable::Create(); Drawable::SetObject(static_cast(mTvgShape)); +#endif } bool ShapeTizen::AddRect(Rect rect, Vector2 roundedCorner) { +#ifdef THORVG_SUPPORT if(!mTvgShape) { DALI_LOG_ERROR("Shape is null [%p]\n", this); @@ -81,10 +86,14 @@ bool ShapeTizen::AddRect(Rect rect, Vector2 roundedCorner) } Drawable::SetChanged(true); return true; +#else + return false; +#endif } bool ShapeTizen::AddCircle(Vector2 center, Vector2 radius) { +#ifdef THORVG_SUPPORT if(!mTvgShape) { DALI_LOG_ERROR("Shape is null [%p]\n", this); @@ -97,10 +106,14 @@ bool ShapeTizen::AddCircle(Vector2 center, Vector2 radius) } Drawable::SetChanged(true); return true; +#else + return false; +#endif } bool ShapeTizen::AddArc(Vector2 center, float radius, float startAngle, float sweep, bool pie) { +#ifdef THORVG_SUPPORT if(!mTvgShape) { DALI_LOG_ERROR("Shape is null\n"); @@ -114,10 +127,14 @@ bool ShapeTizen::AddArc(Vector2 center, float radius, float startAngle, float sw } Drawable::SetChanged(true); return true; +#else + return false; +#endif } bool ShapeTizen::AddMoveTo(Vector2 point) { +#ifdef THORVG_SUPPORT if(!mTvgShape) { DALI_LOG_ERROR("Shape is null\n"); @@ -131,10 +148,14 @@ bool ShapeTizen::AddMoveTo(Vector2 point) } Drawable::SetChanged(true); return true; +#else + return false; +#endif } bool ShapeTizen::AddLineTo(Vector2 line) { +#ifdef THORVG_SUPPORT if(!mTvgShape) { DALI_LOG_ERROR("Shape is null\n"); @@ -148,10 +169,14 @@ bool ShapeTizen::AddLineTo(Vector2 line) } Drawable::SetChanged(true); return true; +#else + return false; +#endif } bool ShapeTizen::AddCubicTo(Vector2 controlPoint1, Vector2 controlPoint2, Vector2 endPoint) { +#ifdef THORVG_SUPPORT if(!mTvgShape) { DALI_LOG_ERROR("Shape is null\n"); @@ -165,10 +190,14 @@ bool ShapeTizen::AddCubicTo(Vector2 controlPoint1, Vector2 controlPoint2, Vector } Drawable::SetChanged(true); return true; +#else + return false; +#endif } bool ShapeTizen::Close() { +#ifdef THORVG_SUPPORT if(!mTvgShape) { DALI_LOG_ERROR("Shape is null\n"); @@ -182,10 +211,14 @@ bool ShapeTizen::Close() } Drawable::SetChanged(true); return true; +#else + return false; +#endif } bool ShapeTizen::SetFillColor(Vector4 color) { +#ifdef THORVG_SUPPORT if(!mTvgShape) { DALI_LOG_ERROR("Shape is null [%p]\n", this); @@ -199,10 +232,14 @@ bool ShapeTizen::SetFillColor(Vector4 color) } Drawable::SetChanged(true); return true; +#else + return false; +#endif } Vector4 ShapeTizen::GetFillColor() const { +#ifdef THORVG_SUPPORT if(!mTvgShape) { DALI_LOG_ERROR("Shape is null [%p]\n", this); @@ -216,10 +253,14 @@ Vector4 ShapeTizen::GetFillColor() const return Vector4(0, 0, 0, 0); } return Vector4(r / 255.f, g / 255.f, b / 255.f, a / 255.f); +#else + return Vector4::ZERO; +#endif } bool ShapeTizen::SetFillRule(Dali::CanvasRenderer::Shape::FillRule rule) { +#ifdef THORVG_SUPPORT if(!mTvgShape) { DALI_LOG_ERROR("Shape is null\n"); @@ -232,10 +273,14 @@ bool ShapeTizen::SetFillRule(Dali::CanvasRenderer::Shape::FillRule rule) } Drawable::SetChanged(true); return true; +#else + return false; +#endif } Dali::CanvasRenderer::Shape::FillRule ShapeTizen::GetFillRule() const { +#ifdef THORVG_SUPPORT if(!mTvgShape) { DALI_LOG_ERROR("Shape is null\n"); @@ -245,10 +290,13 @@ Dali::CanvasRenderer::Shape::FillRule ShapeTizen::GetFillRule() const tvg::FillRule rule = static_cast(mTvgShape)->fillRule(); return static_cast(rule); +#endif + return Dali::CanvasRenderer::Shape::FillRule::WINDING; } bool ShapeTizen::SetStrokeWidth(float width) { +#ifdef THORVG_SUPPORT if(!mTvgShape) { DALI_LOG_ERROR("Shape is null\n"); @@ -262,20 +310,28 @@ bool ShapeTizen::SetStrokeWidth(float width) } Drawable::SetChanged(true); return true; +#else + return false; +#endif } float ShapeTizen::GetStrokeWidth() const { +#ifdef THORVG_SUPPORT if(!mTvgShape) { DALI_LOG_ERROR("Shape is null\n"); return false; } return static_cast(mTvgShape)->strokeWidth(); +#else + return false; +#endif } bool ShapeTizen::SetStrokeColor(Vector4 color) { +#ifdef THORVG_SUPPORT if(!mTvgShape) { DALI_LOG_ERROR("Shape is null\n"); @@ -289,10 +345,14 @@ bool ShapeTizen::SetStrokeColor(Vector4 color) } Drawable::SetChanged(true); return true; +#else + return false; +#endif } Vector4 ShapeTizen::GetStrokeColor() const { +#ifdef THORVG_SUPPORT if(!mTvgShape) { DALI_LOG_ERROR("Shape is null\n"); @@ -307,10 +367,14 @@ Vector4 ShapeTizen::GetStrokeColor() const return Vector4(0, 0, 0, 0); } return Vector4(r / 255.f, g / 255.f, b / 255.f, a / 255.f); +#else + return Vector4(0, 0, 0, 0); +#endif } bool ShapeTizen::SetStrokeDash(const Dali::Vector dashPattern) { +#ifdef THORVG_SUPPORT if(!mTvgShape) { DALI_LOG_ERROR("Shape is null\n"); @@ -331,10 +395,14 @@ bool ShapeTizen::SetStrokeDash(const Dali::Vector dashPattern) } Drawable::SetChanged(true); return true; +#else + return false; +#endif } Dali::Vector ShapeTizen::GetStrokeDash() const { +#ifdef THORVG_SUPPORT if(!mTvgShape) { DALI_LOG_ERROR("Shape is null\n"); @@ -359,10 +427,14 @@ Dali::Vector ShapeTizen::GetStrokeDash() const dashPattern.PushBack(tvgDashPattern[i]); } return dashPattern; +#else + return Vector(); +#endif } bool ShapeTizen::SetStrokeCap(Dali::CanvasRenderer::Shape::StrokeCap cap) { +#ifdef THORVG_SUPPORT if(!mTvgShape) { DALI_LOG_ERROR("Shape is null\n"); @@ -376,10 +448,14 @@ bool ShapeTizen::SetStrokeCap(Dali::CanvasRenderer::Shape::StrokeCap cap) } Drawable::SetChanged(true); return true; +#else + return false; +#endif } Dali::CanvasRenderer::Shape::StrokeCap ShapeTizen::GetStrokeCap() const { +#ifdef THORVG_SUPPORT if(!mTvgShape) { DALI_LOG_ERROR("Shape is null\n"); @@ -389,10 +465,13 @@ Dali::CanvasRenderer::Shape::StrokeCap ShapeTizen::GetStrokeCap() const tvg::StrokeCap cap = static_cast(mTvgShape)->strokeCap(); return static_cast(cap); +#endif + return Dali::CanvasRenderer::Shape::StrokeCap::SQUARE; } bool ShapeTizen::SetStrokeJoin(Dali::CanvasRenderer::Shape::StrokeJoin join) { +#ifdef THORVG_SUPPORT if(!mTvgShape) { DALI_LOG_ERROR("Shape is null\n"); @@ -406,10 +485,14 @@ bool ShapeTizen::SetStrokeJoin(Dali::CanvasRenderer::Shape::StrokeJoin join) } Drawable::SetChanged(true); return true; +#else + return false; +#endif } Dali::CanvasRenderer::Shape::StrokeJoin ShapeTizen::GetStrokeJoin() const { +#ifdef THORVG_SUPPORT if(!mTvgShape) { DALI_LOG_ERROR("Shape is null\n"); @@ -419,6 +502,8 @@ Dali::CanvasRenderer::Shape::StrokeJoin ShapeTizen::GetStrokeJoin() const tvg::StrokeJoin join = static_cast(mTvgShape)->strokeJoin(); return static_cast(join); +#endif + return Dali::CanvasRenderer::Shape::StrokeJoin::BEVEL; } } // namespace Adaptor diff --git a/dali/internal/canvas-renderer/tizen/shape-impl-tizen.h b/dali/internal/canvas-renderer/tizen/shape-impl-tizen.h index 578a135..0e93113 100644 --- a/dali/internal/canvas-renderer/tizen/shape-impl-tizen.h +++ b/dali/internal/canvas-renderer/tizen/shape-impl-tizen.h @@ -19,9 +19,11 @@ */ // EXTERNAL INCLUDES +#ifdef THORVG_SUPPORT +#include +#endif #include #include -#include // INTERNAL INCLUDES #include @@ -169,8 +171,10 @@ private: private: void Initialize(); +#ifdef THORVG_SUPPORT private: tvg::Shape* mTvgShape; +#endif }; } // namespace Adaptor diff --git a/dali/internal/canvas-renderer/ubuntu/canvas-renderer-impl-ubuntu.cpp b/dali/internal/canvas-renderer/ubuntu/canvas-renderer-impl-ubuntu.cpp index 1be78b9..34dba31 100644 --- a/dali/internal/canvas-renderer/ubuntu/canvas-renderer-impl-ubuntu.cpp +++ b/dali/internal/canvas-renderer/ubuntu/canvas-renderer-impl-ubuntu.cpp @@ -127,6 +127,7 @@ bool CanvasRendererUbuntu::Commit() { changed = true; drawableImpl.SetChanged(false); + break; } } diff --git a/dali/internal/canvas-renderer/ubuntu/shape-impl-ubuntu.cpp b/dali/internal/canvas-renderer/ubuntu/shape-impl-ubuntu.cpp index 79a4871..6eae2d4 100644 --- a/dali/internal/canvas-renderer/ubuntu/shape-impl-ubuntu.cpp +++ b/dali/internal/canvas-renderer/ubuntu/shape-impl-ubuntu.cpp @@ -68,7 +68,6 @@ void ShapeUbuntu::Initialize() Drawable::Create(); Drawable::SetObject(static_cast(mTvgShape)); - #endif } @@ -255,7 +254,7 @@ Vector4 ShapeUbuntu::GetFillColor() const } return Vector4(r / 255.f, g / 255.f, b / 255.f, a / 255.f); #else - return Vector4(0, 0, 0, 0); + return Vector4::ZERO; #endif } diff --git a/dali/internal/system/common/capture-impl.cpp b/dali/internal/system/common/capture-impl.cpp index 8273d09..dfd48e2 100644 --- a/dali/internal/system/common/capture-impl.cpp +++ b/dali/internal/system/common/capture-impl.cpp @@ -87,13 +87,11 @@ void Capture::Start(Dali::Actor source, const Dali::Vector2& position, const Dal void Capture::Start(Dali::Actor source, const Dali::Vector2& position, const Dali::Vector2& size, const std::string& path, const Dali::Vector4& clearColor) { - DALI_ASSERT_ALWAYS(path.size() > 4 && "Path is invalid."); - // Increase the reference count focely to avoid application mistake. Reference(); mPath = path; - if(mPath.size() > 0) + if(!mPath.empty()) { mFileSave = true; } diff --git a/dali/internal/web-engine/common/web-engine-impl.cpp b/dali/internal/web-engine/common/web-engine-impl.cpp index bd2f0e2..be477de 100755 --- a/dali/internal/web-engine/common/web-engine-impl.cpp +++ b/dali/internal/web-engine/common/web-engine-impl.cpp @@ -27,11 +27,14 @@ // INTERNAL INCLUDES #include #include +#include #include #include #include -#include +#include #include +#include +#include #include #include #include @@ -349,7 +352,7 @@ void WebEngine::JavaScriptAlertReply() void WebEngine::RegisterJavaScriptConfirmCallback(Dali::WebEnginePlugin::JavaScriptConfirmCallback callback) { - mPlugin->RegisterJavaScriptAlertCallback(callback); + mPlugin->RegisterJavaScriptConfirmCallback(callback); } void WebEngine::JavaScriptConfirmReply(bool confirmed) @@ -607,6 +610,26 @@ Dali::WebEnginePlugin::WebEngineConsoleMessageSignalType& WebEngine::ConsoleMess return mPlugin->ConsoleMessageSignal(); } +Dali::WebEnginePlugin::WebEnginePolicyDecisionSignalType& WebEngine::PolicyDecisionSignal() +{ + return mPlugin->PolicyDecisionSignal(); +} + +Dali::WebEnginePlugin::WebEngineCertificateSignalType& WebEngine::CertificateConfirmSignal() +{ + return mPlugin->CertificateConfirmSignal(); +} + +Dali::WebEnginePlugin::WebEngineCertificateSignalType& WebEngine::SslCertificateChangedSignal() +{ + return mPlugin->SslCertificateChangedSignal(); +} + +Dali::WebEnginePlugin::WebEngineHttpAuthHandlerSignalType& WebEngine::HttpAuthHandlerSignal() +{ + return mPlugin->HttpAuthHandlerSignal(); +} + } // namespace Adaptor } // namespace Internal } // namespace Dali diff --git a/dali/internal/web-engine/common/web-engine-impl.h b/dali/internal/web-engine/common/web-engine-impl.h index bfac881..b572c76 100755 --- a/dali/internal/web-engine/common/web-engine-impl.h +++ b/dali/internal/web-engine/common/web-engine-impl.h @@ -494,6 +494,26 @@ public: */ Dali::WebEnginePlugin::WebEngineConsoleMessageSignalType& ConsoleMessageSignal(); + /** + @copydoc Dali::WebEngine::PolicyDecisionSignal() + */ + Dali::WebEnginePlugin::WebEnginePolicyDecisionSignalType& PolicyDecisionSignal(); + + /** + * @copydoc Dali::WebEngine::CertificateConfirmSignal() + */ + Dali::WebEnginePlugin::WebEngineCertificateSignalType& CertificateConfirmSignal(); + + /** + * @copydoc Dali::WebEngine::SslCertificateChangedSignal() + */ + Dali::WebEnginePlugin::WebEngineCertificateSignalType& SslCertificateChangedSignal(); + + /** + * @copydoc Dali::WebEngine::HttpAuthHandlerSignal() + */ + Dali::WebEnginePlugin::WebEngineHttpAuthHandlerSignalType& HttpAuthHandlerSignal(); + private: /** * @brief Constructor.