#include <dali/public-api/object/object-registry.h>
#include <dali/public-api/object/type-info.h>
#include <dali/public-api/object/type-registry-helper.h>
+#include <dali/public-api/object/weak-handle.h>
// INTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/accessibility-impl.h>
{
class NonControlAccessible : public virtual Accessible, public virtual Collection, public virtual Component
{
-public:
- Dali::Actor actor;
+protected:
+ Dali::WeakHandle<Dali::Actor> 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<Vector2>();
Vector3 size = actor.GetCurrentProperty<Vector3>(Actor::Property::SIZE) * actor.GetCurrentProperty<Vector3>(Actor::Property::WORLD_SCALE);
bool positionUsesAnchorPoint = actor.GetProperty(Actor::Property::POSITION_USES_ANCHOR_POINT).Get<bool>();
}
std::string GetName() override
{
- return actor.GetProperty<std::string>(Dali::Actor::Property::NAME);
+ return Self().GetProperty<std::string>(Dali::Actor::Property::NAME);
}
std::string GetDescription() override
{
auto b = GetBridgeData();
return b->bridge->GetApplication();
}
- return Get(actor.GetParent());
+ return Get(Self().GetParent());
}
size_t GetChildCount() override
{
- return static_cast<size_t>(actor.GetChildCount());
+ return static_cast<size_t>(Self().GetChildCount());
}
Accessible* GetChildAtIndex(size_t index) override
{
- auto s = static_cast<size_t>(actor.GetChildCount());
+ auto s = static_cast<size_t>(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<unsigned int>(index)));
+ return Get(Self().GetChildAt(static_cast<unsigned int>(index)));
}
size_t GetIndexInParent() override
{
- auto parent = actor.GetParent();
+ auto parent = Self().GetParent();
if(!parent)
{
return 0;
auto size = static_cast<size_t>(parent.GetChildCount());
for(auto i = 0u; i < size; ++i)
{
- if(parent.GetChildAt(i) == actor)
+ if(parent.GetChildAt(i) == Self())
{
return i;
}
Attributes GetAttributes() override
{
Dali::TypeInfo type;
- actor.GetTypeInfo(type);
+ Self().GetTypeInfo(type);
return {
{"t", type.GetName()},
};
--- /dev/null
+#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 <string>
+
+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
--- /dev/null
+#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 <string>
+
+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
--- /dev/null
+#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 <string>
+
+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
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;
using WebEngineConsoleMessageSignalType = Signal<void(std::shared_ptr<Dali::WebEngineConsoleMessage>)>;
/**
+ * @brief WebView signal type related with certificate changed.
+ */
+ using WebEngineCertificateSignalType = Signal<void(std::shared_ptr<Dali::WebEngineCertificate>)>;
+
+ /**
+ * @brief WebView signal type related with http authentication.
+ */
+ using WebEngineHttpAuthHandlerSignalType = Signal<void(std::shared_ptr<Dali::WebEngineHttpAuthHandler>)>;
+
+ /**
* @brief Alert callback when JavaScript alert is called with a message.
* It returns true if a pop-up is created successfully, false otherwise.
*/
using WebEngineFrameRenderedSignalType = Signal<void(void)>;
/**
+ * @brief WebView signal type related with policy would be decided.
+ */
+ using WebEnginePolicyDecisionSignalType = Signal<void(std::shared_ptr<Dali::WebEnginePolicyDecision>)>;
+
+ /**
* @brief Enumeration for the scroll edge.
*/
enum class ScrollEdge
* @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
--- /dev/null
+#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 <string>
+
+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
// INTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/web-engine-back-forward-list.h>
+#include <dali/devel-api/adaptor-framework/web-engine-certificate.h>
#include <dali/devel-api/adaptor-framework/web-engine-console-message.h>
#include <dali/devel-api/adaptor-framework/web-engine-context.h>
#include <dali/devel-api/adaptor-framework/web-engine-cookie-manager.h>
-#include <dali/devel-api/adaptor-framework/web-engine-request-interceptor.h>
+#include <dali/devel-api/adaptor-framework/web-engine-http-auth-handler.h>
#include <dali/devel-api/adaptor-framework/web-engine-load-error.h>
+#include <dali/devel-api/adaptor-framework/web-engine-policy-decision.h>
+#include <dali/devel-api/adaptor-framework/web-engine-request-interceptor.h>
#include <dali/devel-api/adaptor-framework/web-engine-settings.h>
#include <dali/internal/web-engine/common/web-engine-impl.h>
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
*/
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
${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
CanvasRendererTizen::CanvasRendererTizen(const Vector2& viewBox)
: mPixelBuffer(nullptr),
+#ifdef THORVG_SUPPORT
mTvgCanvas(nullptr),
mTvgRoot(nullptr),
+#endif
mSize(0, 0),
mViewBox(0, 0),
mChanged(false)
CanvasRendererTizen::~CanvasRendererTizen()
{
+#ifdef THORVG_SUPPORT
for(DrawableVectorIterator it = mDrawables.begin(),
endIt = mDrawables.end();
it != endIt;
}
//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");
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(),
return false;
}
return true;
+#else
+ return false;
+#endif
}
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();
mChanged = true;
return true;
+#else
+ return false;
+#endif
}
bool CanvasRendererTizen::SetSize(const Vector2& size)
void CanvasRendererTizen::MakeTargetBuffer(const Vector2& size)
{
+#ifdef THORVG_SUPPORT
mPixelBuffer = Devel::PixelBuffer::New(size.width, size.height, Dali::Pixel::RGBA8888);
unsigned char* pBuffer;
mTvgCanvas->sync();
mTvgCanvas->target(reinterpret_cast<uint32_t*>(pBuffer), size.width, size.width, size.height, tvg::SwCanvas::ABGR8888);
+#endif
}
} // namespace Adaptor
*/
// EXTERNAL INCLUDES
-#include <dali/public-api/object/weak-handle.h>
+#ifdef THORVG_SUPPORT
#include <thorvg.h>
+#endif
+#include <dali/public-api/object/weak-handle.h>
// INTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/canvas-renderer-drawable.h>
private:
Devel::PixelBuffer mPixelBuffer;
- std::unique_ptr<tvg::SwCanvas> mTvgCanvas;
- tvg::Scene* mTvgRoot;
+#ifdef THORVG_SUPPORT
+ std::unique_ptr<tvg::SwCanvas> mTvgCanvas;
+ tvg::Scene* mTvgRoot;
+#endif
typedef std::vector<WeakHandle<Dali::CanvasRenderer::Drawable> > DrawableVector;
typedef DrawableVector::iterator DrawableVectorIterator;
DrawableVector mDrawables;
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);
}
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");
}
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");
}
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");
}
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");
}
SetChanged(true);
return true;
+#else
+ return false;
+#endif
}
void DrawableTizen::SetDrawableAdded(bool added)
void* DrawableTizen::GetObject() const
{
+#ifdef THORVG_SUPPORT
return static_cast<void*>(mTvgPaint);
+#else
+ return nullptr;
+#endif
}
void DrawableTizen::SetObject(const void* object)
{
+#ifdef THORVG_SUPPORT
if(object)
{
mTvgPaint = static_cast<tvg::Paint*>((void*)object);
delete mTvgPaint;
}
}
+#endif
}
void DrawableTizen::SetChanged(bool changed)
*/
// EXTERNAL INCLUDES
-#include <dali/public-api/object/base-object.h>
+#ifdef THORVG_SUPPORT
#include <thorvg.h>
+#endif
+#include <dali/public-api/object/base-object.h>
// INTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/canvas-renderer-drawable.h>
bool mAdded;
bool mChanged;
+#ifdef THORVG_SUPPORT
tvg::Paint* mTvgPaint;
+#endif
};
} // namespace Adaptor
}
ShapeTizen::ShapeTizen()
+#ifdef THORVG_SUPPORT
: mTvgShape(nullptr)
+#endif
{
Initialize();
}
void ShapeTizen::Initialize()
{
+#ifdef THORVG_SUPPORT
mTvgShape = tvg::Shape::gen().release();
if(!mTvgShape)
{
Drawable::Create();
Drawable::SetObject(static_cast<void*>(mTvgShape));
+#endif
}
bool ShapeTizen::AddRect(Rect<float> rect, Vector2 roundedCorner)
{
+#ifdef THORVG_SUPPORT
if(!mTvgShape)
{
DALI_LOG_ERROR("Shape is null [%p]\n", this);
}
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);
}
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");
}
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");
}
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");
}
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");
}
Drawable::SetChanged(true);
return true;
+#else
+ return false;
+#endif
}
bool ShapeTizen::Close()
{
+#ifdef THORVG_SUPPORT
if(!mTvgShape)
{
DALI_LOG_ERROR("Shape is null\n");
}
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);
}
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);
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");
}
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");
tvg::FillRule rule = static_cast<tvg::Shape*>(mTvgShape)->fillRule();
return static_cast<Dali::CanvasRenderer::Shape::FillRule>(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");
}
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<tvg::Shape*>(mTvgShape)->strokeWidth();
+#else
+ return false;
+#endif
}
bool ShapeTizen::SetStrokeColor(Vector4 color)
{
+#ifdef THORVG_SUPPORT
if(!mTvgShape)
{
DALI_LOG_ERROR("Shape is null\n");
}
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");
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<float> dashPattern)
{
+#ifdef THORVG_SUPPORT
if(!mTvgShape)
{
DALI_LOG_ERROR("Shape is null\n");
}
Drawable::SetChanged(true);
return true;
+#else
+ return false;
+#endif
}
Dali::Vector<float> ShapeTizen::GetStrokeDash() const
{
+#ifdef THORVG_SUPPORT
if(!mTvgShape)
{
DALI_LOG_ERROR("Shape is null\n");
dashPattern.PushBack(tvgDashPattern[i]);
}
return dashPattern;
+#else
+ return Vector<float>();
+#endif
}
bool ShapeTizen::SetStrokeCap(Dali::CanvasRenderer::Shape::StrokeCap cap)
{
+#ifdef THORVG_SUPPORT
if(!mTvgShape)
{
DALI_LOG_ERROR("Shape is null\n");
}
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");
tvg::StrokeCap cap = static_cast<tvg::Shape*>(mTvgShape)->strokeCap();
return static_cast<Dali::CanvasRenderer::Shape::StrokeCap>(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");
}
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");
tvg::StrokeJoin join = static_cast<tvg::Shape*>(mTvgShape)->strokeJoin();
return static_cast<Dali::CanvasRenderer::Shape::StrokeJoin>(join);
+#endif
+ return Dali::CanvasRenderer::Shape::StrokeJoin::BEVEL;
}
} // namespace Adaptor
*/
// EXTERNAL INCLUDES
+#ifdef THORVG_SUPPORT
+#include <thorvg.h>
+#endif
#include <dali/public-api/object/base-object.h>
#include <dali/public-api/signals/connection-tracker.h>
-#include <thorvg.h>
// INTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/canvas-renderer-shape.h>
private:
void Initialize();
+#ifdef THORVG_SUPPORT
private:
tvg::Shape* mTvgShape;
+#endif
};
} // namespace Adaptor
{
changed = true;
drawableImpl.SetChanged(false);
+ break;
}
}
Drawable::Create();
Drawable::SetObject(static_cast<void*>(mTvgShape));
-
#endif
}
}
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
}
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;
}
// INTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/environment-variable.h>
#include <dali/devel-api/adaptor-framework/web-engine-back-forward-list.h>
+#include <dali/devel-api/adaptor-framework/web-engine-certificate.h>
#include <dali/devel-api/adaptor-framework/web-engine-console-message.h>
#include <dali/devel-api/adaptor-framework/web-engine-context.h>
#include <dali/devel-api/adaptor-framework/web-engine-cookie-manager.h>
-#include <dali/devel-api/adaptor-framework/web-engine-request-interceptor.h>
+#include <dali/devel-api/adaptor-framework/web-engine-http-auth-handler.h>
#include <dali/devel-api/adaptor-framework/web-engine-load-error.h>
+#include <dali/devel-api/adaptor-framework/web-engine-policy-decision.h>
+#include <dali/devel-api/adaptor-framework/web-engine-request-interceptor.h>
#include <dali/devel-api/adaptor-framework/web-engine-settings.h>
#include <dali/internal/system/common/environment-variables.h>
#include <dali/public-api/adaptor-framework/native-image-source.h>
void WebEngine::RegisterJavaScriptConfirmCallback(Dali::WebEnginePlugin::JavaScriptConfirmCallback callback)
{
- mPlugin->RegisterJavaScriptAlertCallback(callback);
+ mPlugin->RegisterJavaScriptConfirmCallback(callback);
}
void WebEngine::JavaScriptConfirmReply(bool confirmed)
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
*/
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.