- Add APIs for setting IME position, cursor theme name.
- Fix engine destory problem when WebView.Dispose method is called by csharp
- Add SetVideoHole() for EFL window
- Add WebView DeviceListGet,SetDefaultAudio
- Add WebView FeedMouseWheel as hidden api
- Fix mouse cursor auto theme defect
- Fix for UserMediaPermissionRequest object to be maintained by user
Change-Id: Ib0c4a0d943e3108ef275ab6ef9f3f97dba07ec97
$(extension_src_dir)/web-engine-chromium/tizen-web-engine-request-interceptor.cpp \
$(extension_src_dir)/web-engine-chromium/tizen-web-engine-security-origin.cpp \
$(extension_src_dir)/web-engine-chromium/tizen-web-engine-settings.cpp \
- $(extension_src_dir)/web-engine-chromium/tizen-web-engine-user-media-permission-request.cpp
+ $(extension_src_dir)/web-engine-chromium/tizen-web-engine-user-media-permission-request.cpp \
+ $(extension_src_dir)/web-engine-chromium/tizen-web-engine-device-list-get.cpp
#include "tizen-web-engine-policy-decision.h"
#include "tizen-web-engine-settings.h"
#include "tizen-web-engine-user-media-permission-request.h"
+#include "tizen-web-engine-device-list-get.h"
#include <Ecore_Evas.h>
#include <Ecore_Input_Evas.h>
}
}
+template<typename Callback, typename Arg, typename... Args>
+void ExecuteCallback2(Callback callback, Arg*& arg, Args... args)
+{
+ if(callback)
+ {
+ callback(arg, args...);
+ }
+}
+
template<typename Ret, typename Callback, typename... Args>
Ret ExecuteCallbackReturn(Callback callback, Args... args)
{
: mDaliImageSrc(NativeImageSource::New(0, 0, NativeImageSource::COLOR_DEPTH_DEFAULT)),
mWebView(nullptr),
mWidth(0),
- mHeight(0)
+ mHeight(0),
+ mWebUserMediaPermissionRequest(nullptr),
+ mDeviceListGet(nullptr)
{
}
evas_object_smart_callback_add(mWebView, "text,found", &TizenWebEngineChromium::OnTextFound, this);
evas_object_smart_callback_add(mWebView, "webauth,display,qr", &TizenWebEngineChromium::OnWebAuthDisplayQR, this);
evas_object_smart_callback_add(mWebView, "webauth,response", &TizenWebEngineChromium::OnWebAuthResponse, this);
+
+ ewk_view_media_device_list_get(mWebView, TizenWebEngineChromium::OnDeviceListGet, this);
+ evas_object_smart_callback_add(mWebView, "device,connection,changed", &TizenWebEngineChromium::OnDeviceConnectionChanged, this);
evas_object_resize(mWebView, mWidth, mHeight);
evas_object_show(mWebView);
bool TizenWebEngineChromium::SendHoverEvent(const Dali::HoverEvent& event)
{
+ switch(event.GetState(0))
+ {
+ case PointState::MOTION:
+ {
+ float x = event.GetScreenPosition(0).x;
+ float y = event.GetScreenPosition(0).y;
+ ewk_view_feed_mouse_move(mWebView, x, y);
+ break;
+ }
+ default:
+ {
+ break;
+ }
+ }
return false;
}
ewk_view_focus_set(mWebView, focused);
}
+bool TizenWebEngineChromium::SetImePositionAndAlignment(Dali::Vector2 position, int alignment)
+{
+ return ewk_view_ime_position_align_set(mWebView, position.x, position.y, (Ewk_Ime_Position_Align)alignment);
+}
+
+void TizenWebEngineChromium::SetCursorThemeName(const std::string themeName)
+{
+ Ecore_Wl2_Display* display = ecore_wl2_connected_display_get(nullptr);
+ Ecore_Wl2_Input* input = ecore_wl2_input_default_input_get(display);
+ ecore_wl2_input_cursor_theme_name_set(input, themeName.c_str());
+}
+
void TizenWebEngineChromium::EnableMouseEvents(bool enabled)
{
ewk_view_mouse_events_enabled_set(mWebView, enabled);
ewk_view_atk_deactivation_by_app(mWebView, activated);
}
+void TizenWebEngineChromium::FeedMouseWheel(bool yDirection, int step, int x, int y)
+{
+ ewk_view_feed_mouse_wheel(mWebView, (Eina_Bool)yDirection, step, x, y);
+}
+
+void TizenWebEngineChromium::SetVideoHole(bool enabled, bool isWaylandWindow)
+{
+ Ecore_Wl2_Window* win = AnyCast<Ecore_Wl2_Window*>(Adaptor::Get().GetNativeWindowHandle());
+ ewk_view_set_support_video_hole(mWebView, win, enabled, isWaylandWindow? EINA_TRUE: EINA_FALSE);
+}
+
Accessibility::Address TizenWebEngineChromium::GetAccessibilityAddress()
{
static const char plugIdKey[] = "__PlugID";
mWebAuthResponseCallback = callback;
}
+void TizenWebEngineChromium::RegisterDeviceConnectionChangedCallback(WebEngineDeviceConnectionChangedCallback callback)
+{
+ mDeviceConnectionChangedCallback = callback;
+}
+
+void TizenWebEngineChromium::RegisterDeviceListGetCallback(WebEngineDeviceListGetCallback callback)
+{
+ mDeviceListGetCallback = callback;
+ ewk_view_media_device_list_get(mWebView, TizenWebEngineChromium::OnDeviceListGet, this);
+}
+
+
+
Dali::PixelData TizenWebEngineChromium::ConvertImageColorSpace(Evas_Object* image)
{
// color-space is argb8888.
ExecuteCallback(pThis->mConsoleMessageReceivedCallback, std::move(webConsoleMessage));
}
+void TizenWebEngineChromium::OnDeviceConnectionChanged(void* data, Evas_Object* obj, void* info)
+{
+ auto pThis = static_cast<TizenWebEngineChromium*>(data);
+ int* device_type = (int*)info;
+
+ DALI_LOG_RELEASE_INFO("#DeviceConnectionChanged : device_type=%d\n", *device_type);
+ ExecuteCallback(pThis->mDeviceConnectionChangedCallback, *device_type);
+}
+
+void TizenWebEngineChromium::OnDeviceListGet(EwkMediaDeviceInfo* device_list, int size, void* user_data)
+{
+ auto pThis = static_cast<TizenWebEngineChromium*>(user_data);
+
+ pThis->mDeviceListGet = new TizenWebEngineDeviceListGet(device_list, size);
+ ExecuteCallback(pThis->mDeviceListGetCallback, pThis->mDeviceListGet, (int32_t)size);
+}
+
+
void TizenWebEngineChromium::OnEdgeLeft(void* data, Evas_Object*, void*)
{
DALI_LOG_RELEASE_INFO("#ScrollEdgeReached : LEFT\n");
Eina_Bool TizenWebEngineChromium::OnUserMediaPermissonRequest(Evas_Object*, Ewk_User_Media_Permission_Request* request, void* data)
{
- auto pThis = static_cast<TizenWebEngineChromium*>(data);
- std::unique_ptr<Dali::WebEngineUserMediaPermissionRequest> webUserMediaPermissionRequest(new TizenWebEngineUserMediaPermissionRequest(request));
- DALI_LOG_RELEASE_INFO("#UserMediaPermissonRequest: pThis:%p, permission:%p\n", pThis, request);
- std::string msg = ewk_user_media_permission_request_message_get(request);
+ auto pThis = static_cast<TizenWebEngineChromium*>(data);
+ pThis->mWebUserMediaPermissionRequest = new TizenWebEngineUserMediaPermissionRequest(request);
+
+ DALI_LOG_RELEASE_INFO("#UserMediaPermissonRequest: pThis:%p, request:%p\n", pThis, request);
- ExecuteCallback(pThis->mUserMediaPermissionRequestCallback, std::move(webUserMediaPermissionRequest), msg);
+ std::string msg = ewk_user_media_permission_request_message_get(request);
+ ExecuteCallback2(pThis->mUserMediaPermissionRequestCallback, pThis->mWebUserMediaPermissionRequest, msg);
return msg.empty() ? false : true;
}
*/
void SetFocus(bool focused) override;
+ /**
+ * @copydoc Dali::WebEnginePlugin::SetImePositionAndAlignment()
+ */
+ bool SetImePositionAndAlignment(Dali::Vector2 position, int alignment) override;
+
+ /**
+ * @copydoc Dali::WebEnginePlugin::SetCursorThemeName()
+ */
+ void SetCursorThemeName(const std::string themeName) override;
+
/**
* @copydoc Dali::WebEnginePlugin::EnableMouseEvents()
*/
*/
void RegisterUserMediaPermissionRequestCallback(WebEngineUserMediaPermissionRequestCallback callback) override;
+ /**
+ * @copydoc Dali::WebEnginePlugin::RegisterDeviceConnectionChangedCallback()
+ */
+ void RegisterDeviceConnectionChangedCallback(WebEngineDeviceConnectionChangedCallback callback) override;
+
+ /**
+ * @copydoc Dali::WebEnginePlugin::RegisterDeviceListGetCallback()
+ */
+ void RegisterDeviceListGetCallback(WebEngineDeviceListGetCallback callback) override;
+
+ /**
+ * @copydoc Dali::WebEnginePlugin::FeedMouseWheel()
+ */
+ void FeedMouseWheel(bool yDirection, int step, int x, int y) override;
+
+ /**
+ * @copydoc Dali::WebEnginePlugin::SetVideoHole()
+ */
+ void SetVideoHole(bool enabled, bool isWaylandWindow) override;
+
private:
static Dali::PixelData ConvertImageColorSpace(Evas_Object* image);
static void OnLoadError(void* data, Evas_Object*, void* rawError);
static void OnUrlChanged(void* data, Evas_Object*, void* newUrl);
static void OnConsoleMessageReceived(void* data, Evas_Object*, void* eventInfo);
+ static void OnDeviceConnectionChanged(void* data, Evas_Object* obj, void* info);
+ static void OnDeviceListGet(EwkMediaDeviceInfo* device_list, int size, void* user_data);
static void OnEdgeLeft(void* data, Evas_Object*, void*);
static void OnEdgeRight(void* data, Evas_Object*, void*);
static void OnEdgeTop(void* data, Evas_Object*, void*);
std::unique_ptr<WebEngineBackForwardList> mWebEngineBackForwardList;
std::unique_ptr<WebEngineSettings> mWebEngineSettings;
std::unordered_map<std::string, JavaScriptMessageHandlerCallback> mJavaScriptInjectedCallbacks;
+ Dali::WebEngineUserMediaPermissionRequest* mWebUserMediaPermissionRequest;
+ Dali::WebEngineDeviceListGet* mDeviceListGet;
// callback.
WebEnginePageLoadCallback mLoadStartedCallback;
WebEngineWebAuthDisplayQRCallback mWebAuthDisplayQRCallback;
WebEngineWebAuthResponseCallback mWebAuthResponseCallback;
WebEngineUserMediaPermissionRequestCallback mUserMediaPermissionRequestCallback;
+ WebEngineDeviceConnectionChangedCallback mDeviceConnectionChangedCallback;
+ WebEngineDeviceListGetCallback mDeviceListGetCallback;
};
} // namespace Plugin
} // namespace Dali
--- /dev/null
+/*
+ * 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.
+ * 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.
+ *
+ */
+
+#include "tizen-web-engine-device-list-get.h"
+#include <dali/integration-api/debug.h>
+
+namespace Dali
+{
+namespace Plugin
+{
+
+TizenWebEngineDeviceListGet::TizenWebEngineDeviceListGet(EwkMediaDeviceInfo* device_list, int size)
+{
+ for(int i=0; i < size; i++)
+ {
+ EwkMediaDeviceInfo device = device_list[i];
+
+ std::string strId = device.device_id;
+ std::string strLabel = device.label;
+
+ DeviceItem item = {strId, strLabel, device.type, device.connected};
+
+ vc.push_back(item);
+ }
+}
+
+TizenWebEngineDeviceListGet::~TizenWebEngineDeviceListGet()
+{
+}
+
+int TizenWebEngineDeviceListGet::GetSize()
+{
+ return vc.size();
+}
+
+void TizenWebEngineDeviceListGet::Reset()
+{
+ vc.clear();
+}
+
+void TizenWebEngineDeviceListGet::GetTypeAndConnect(int32_t* type, bool* connect, int index)
+{
+ size_t idx = index;
+
+ if(idx >= vc.size())
+ {
+ *type = -1;
+ *connect = false;
+ return;
+ }
+
+ *type = vc[idx].device_type;
+ *connect = vc[idx].connected;
+}
+
+std::string TizenWebEngineDeviceListGet::GetDeviceId(int index)
+{
+ size_t idx = index;
+
+ if(idx >= vc.size())
+ {
+ return "error";
+ }
+
+ std::string deviceId = vc[idx].device_id;
+ return deviceId;
+}
+
+std::string TizenWebEngineDeviceListGet::GetDeviceLabel(int index)
+{
+ size_t idx = index;
+
+ if(idx >= vc.size())
+ {
+ return "error";
+ }
+
+ std::string deviceLabel = vc[idx].label;
+ return deviceLabel;
+}
+
+} // namespace Plugin
+} // namespace Dali
--- /dev/null
+#ifndef DALI_PLUGIN_TIZEN_WEB_ENGINE_DEVICE_LIST_GET_H
+#define DALI_PLUGIN_TIZEN_WEB_ENGINE_DEVICE_LIST_GET_H
+
+/*
+ * 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.
+ * 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 <dali/devel-api/adaptor-framework/web-engine/web-engine-device-list-get.h>
+#include <ewk_main_internal.h>
+#include <ewk_settings_product.h>
+#include <ewk_view_product.h>
+
+#include <string>
+#include <vector>
+
+namespace Dali
+{
+namespace Plugin
+{
+/**
+ * @brief A class TizenWebEngineDeviceListGet for getting device list.
+ */
+class TizenWebEngineDeviceListGet : public Dali::WebEngineDeviceListGet
+{
+public:
+ /**
+ * @brief Constructor.
+ */
+ TizenWebEngineDeviceListGet(EwkMediaDeviceInfo* device_list, int size);
+
+ /**
+ * @brief Destructor.
+ */
+ ~TizenWebEngineDeviceListGet();
+
+ //static TizenWebEngineDeviceListGet New();
+
+ /**
+ * @copydoc Dali::WebEngineDeviceListGet::GetSize()
+ */
+ int GetSize() override;
+
+ /**
+ * @copydoc Dali::WebEngineDeviceListGet::Reset()
+ */
+ void Reset() override;
+
+ /**
+ * @copydoc Dali::WebEngineDeviceListGet::GetTypeAndConnect()
+ */
+ void GetTypeAndConnect(int32_t* type, bool* connect, int index) override;
+
+ /**
+ * @copydoc Dali::WebEngineDeviceListGet::GetDeviceId()
+ */
+ std::string GetDeviceId(int idx) override;
+
+ /**
+ * @copydoc Dali::WebEngineDeviceListGet::GetDeviceLabel()
+ */
+ std::string GetDeviceLabel(int idx) override;
+
+private:
+ std::vector<DeviceItem> vc;
+};
+
+} // namespace Plugin
+} // namespace Dali
+#endif // DALI_PLUGIN_TIZEN_WEB_ENGINE_DEVICE_LIST_GET_H
/*
- * Copyright (c) 2020 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.
return ewk_settings_extra_feature_get(ewkSettings, feature.c_str());
}
+void TizenWebEngineSettings::SetImeStyle(int style)
+{
+ ewk_settings_ime_style_set(ewkSettings, (Ewk_Ime_Style)style);
+}
+
+int TizenWebEngineSettings::GetImeStyle() const
+{
+ return (int)ewk_settings_ime_style_get(ewkSettings);
+}
+
+void TizenWebEngineSettings::SetDefaultAudioInputDevice(const std::string& deviceId) const
+{
+ ewk_settings_default_audio_input_device_set(ewkSettings, deviceId.c_str());
+}
+
} // namespace Plugin
} // namespace Dali
#define DALI_PLUGIN_WEB_ENGINE_SETTINGS_H
/*
- * Copyright (c) 2022 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.
*/
bool IsExtraFeatureEnabled(const std::string& feature) const override;
+ /**
+ * @brief Sets the style of IME.
+ *
+ * @param[in] style @c IME_STYLE_FULL full IME style
+ * @c IME_STYLE_FLOATING floating IME style
+ * @c IME_STYLE_DYNAMIC dynamic IME style
+ *
+ */
+ void SetImeStyle(int style) override;
+
+ /**
+ * @brief Gets the style of IME.
+ *
+ * @return @c IME_STYLE_FULL full IME style
+ * @c IME_STYLE_FLOATING floating IME style
+ * @c IME_STYLE_DYNAMIC dynamic IME style
+ */
+ int GetImeStyle() const override;
+
+ /**
+ * @brief Sets default audio input device
+ *
+ * @param[in] deviceId default device ID
+ */
+ void SetDefaultAudioInputDevice(const std::string& deviceId) const override;
+
private:
Ewk_Settings* ewkSettings;
};
mTbmSurface(nullptr),
mUpdateBufferTrigger(MakeCallback(this, &TizenWebEngineLWE::LegacyUpdateBuffer)),
#endif
+ mInDestroyingLWEInstance(false),
mWebContainer(NULL),
mDaliImageSrc(NativeImageSource::New(0, 0, NativeImageSource::COLOR_DEPTH_DEFAULT)),
mNativeDisplay(NULL),
#ifndef OVER_TIZEN_VERSION_9
pthread_mutex_destroy(&mOutputBufferMutex);
#endif
+ Destroy();
}
static std::string Langset()
mOnReceivedError = [](LWE::WebContainer* container, LWE::ResourceError error) {
};
- mOnPageStartedHandler = [this](LWE::WebContainer* container, const std::string& url) {
+ mOnPageStartedHandler = [this](LWE::WebContainer* container, const std::string& url)
+ {
DALI_LOG_RELEASE_INFO("#LoadStarted : %s\n", url.c_str());
ExecuteCallback(mLoadStartedCallback, url);
};
- mOnPageFinishedHandler = [this](LWE::WebContainer* container, const std::string& url) {
+ mOnPageFinishedHandler = [this](LWE::WebContainer* container, const std::string& url)
+ {
DALI_LOG_RELEASE_INFO("#LoadFinished : %s\n", url.c_str());
ExecuteCallback(mLoadFinishedCallback, url);
};
};
LWE::WebContainer::RendererGLConfiguration config;
- config.onMakeCurrent = [&](LWE::WebContainer*) {
+ config.onMakeCurrent = [&](LWE::WebContainer*)
+ {
if(!eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface, mEglContext))
{
DALI_LOG_ERROR("TizenWebEngineLWE: eglMakeCurrent error %d", (int)eglGetError());
}
};
- config.onSwapBuffers = [this](LWE::WebContainer*, bool mayNeedsSync) {
+ config.onSwapBuffers = [this](LWE::WebContainer*, bool mayNeedsSync)
+ {
if(!eglSwapBuffers(mEglDisplay, mEglSurface))
{
DALI_LOG_ERROR("TizenWebEngineLWE: eglSwapBuffers error %d", (int)eglGetError());
TryUpdateImage(mayNeedsSync);
};
- config.onCreateSharedContext = [this](LWE::WebContainer*) -> uintptr_t {
+ config.onCreateSharedContext = [this](LWE::WebContainer*) -> uintptr_t
+ {
EGLint attributes[] = {EGL_CONTEXT_MAJOR_VERSION, 3, EGL_NONE};
EGLContext sharedContext = eglCreateContext(mEglDisplay, mEglConfig, mEglContext, attributes);
return reinterpret_cast<uintptr_t>(sharedContext);
};
- config.onDestroyContext = [this](LWE::WebContainer*, uintptr_t context) -> bool {
+ config.onDestroyContext = [this](LWE::WebContainer*, uintptr_t context) -> bool
+ {
return eglDestroyContext(mEglDisplay, reinterpret_cast<EGLContext>(context));
};
- config.onClearCurrentContext = [this](LWE::WebContainer*) -> bool {
+ config.onClearCurrentContext = [this](LWE::WebContainer*) -> bool
+ {
return eglMakeCurrent(mEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
};
- config.onMakeCurrentWithContext = [this](LWE::WebContainer*, uintptr_t context) -> bool {
+ config.onMakeCurrentWithContext = [this](LWE::WebContainer*, uintptr_t context) -> bool
+ {
return eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface, reinterpret_cast<EGLContext>(context));
};
- config.onGetProcAddress = [this](LWE::WebContainer*, const char* name) -> void* {
+ config.onGetProcAddress = [this](LWE::WebContainer*, const char* name) -> void*
+ {
return reinterpret_cast<void*>(eglGetProcAddress(name));
};
- config.onIsSupportedExtension = [this](LWE::WebContainer*, const char* name) -> bool {
+ config.onIsSupportedExtension = [this](LWE::WebContainer*, const char* name) -> bool
+ {
const char* extensions = eglQueryString(eglGetCurrentDisplay(), EGL_EXTENSIONS);
return (extensions != nullptr) ? (strstr(extensions, name) != nullptr) : false;
};
#endif
mWebContainer->RegisterOnReceivedErrorHandler(
- [this](LWE::WebContainer* container, LWE::ResourceError error) {
+ [this](LWE::WebContainer* container, LWE::ResourceError error)
+ {
mCanGoBack = container->CanGoBack();
mCanGoForward = container->CanGoForward();
mOnReceivedError(container, error);
});
mWebContainer->RegisterOnPageStartedHandler(
- [this](LWE::WebContainer* container, const std::string& url) {
+ [this](LWE::WebContainer* container, const std::string& url)
+ {
mUrl = url;
mCanGoBack = container->CanGoBack();
mCanGoForward = container->CanGoForward();
mOnPageStartedHandler(container, url);
});
mWebContainer->RegisterOnPageLoadedHandler(
- [this](LWE::WebContainer* container, const std::string& url) {
+ [this](LWE::WebContainer* container, const std::string& url)
+ {
mUrl = url;
mCanGoBack = container->CanGoBack();
mCanGoForward = container->CanGoForward();
mOnPageFinishedHandler(container, url);
});
mWebContainer->RegisterOnLoadResourceHandler(
- [this](LWE::WebContainer* container, const std::string& url) {
+ [this](LWE::WebContainer* container, const std::string& url)
+ {
mUrl = url;
mCanGoBack = container->CanGoBack();
mCanGoForward = container->CanGoForward();
void TizenWebEngineLWE::TryRendering()
{
+ if(mInDestroyingLWEInstance)
+ {
+ return;
+ }
+
if(mTbmQueue)
{
if((size_t)tbm_surface_queue_get_width(mTbmQueue) != mWebContainer->Width() ||
}
else
{
- mWebContainer->AddIdleCallback([](void* data) {
+ mWebContainer->AddIdleCallback([](void* data)
+ {
TizenWebEngineLWE* lv = (TizenWebEngineLWE*)data;
- lv->TryRendering();
- },
+ lv->TryRendering(); },
this);
}
}
void TizenWebEngineLWE::TryUpdateImage(bool needsSync)
{
+ if(mInDestroyingLWEInstance)
+ {
+ return;
+ }
+
mInImageUpdateState = true;
if(!eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface, mEglContext))
{
{
eglMakeCurrent(mEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
// Still busy
- mWebContainer->AddIdleCallback([](void* data) {
+ mWebContainer->AddIdleCallback([](void* data)
+ {
TizenWebEngineLWE* lv = (TizenWebEngineLWE*)data;
- lv->TryUpdateImage(false);
- },
+ lv->TryUpdateImage(false); },
this);
return;
}
else
{
DALI_LOG_DEBUG_INFO("TizenWebEngineLWE: tbm_surface_queue_can_acquire == false, retry!");
- mWebContainer->AddIdleCallback([](void* data) {
+ mWebContainer->AddIdleCallback([](void* data)
+ {
TizenWebEngineLWE* lv = (TizenWebEngineLWE*)data;
- lv->TryUpdateImage(false);
- },
+ lv->TryUpdateImage(false); },
this);
}
}
{
if(mInImageUpdateState)
{
- mWebContainer->AddIdleCallback([](void* data) {
+ mWebContainer->AddIdleCallback([](void* data)
+ {
TizenWebEngineLWE* lv = (TizenWebEngineLWE*)data;
- lv->PrepareLWERendering();
- },
+ lv->PrepareLWERendering(); },
this);
return;
}
- mWebContainer->AddIdleCallback([](void* data) {
+ mWebContainer->AddIdleCallback([](void* data)
+ {
TizenWebEngineLWE* lv = (TizenWebEngineLWE*)data;
- lv->TryRendering();
- },
+ lv->TryRendering(); },
this);
}
#endif
DestroyInstance();
- mWebContainer = NULL;
}
void TizenWebEngineLWE::InitRenderingContext()
{
return false;
}
+ void SetImeStyle(int style) override
+ {
+ }
+ int GetImeStyle() const override
+ {
+ return 0;
+ }
+ void SetDefaultAudioInputDevice(const std::string& deviceId) const override
+ {
+ // NOT IMPLEMENTED
+ }
};
Dali::WebEngineSettings& TizenWebEngineLWE::GetSettings() const
void TizenWebEngineLWE::DestroyInstance()
{
- DALI_ASSERT_ALWAYS(mWebContainer);
+ if(!mWebContainer)
+ {
+ return;
+ }
+ mInDestroyingLWEInstance = true;
mWebContainer->Destroy();
+ mInDestroyingLWEInstance = false;
+ mWebContainer = NULL;
}
Dali::NativeImageSourcePtr TizenWebEngineLWE::GetNativeImageSource()
{
handler = [](const std::string&) {};
}
- mWebContainer->AddJavaScriptInterface(exposedObjectName, "postMessage", [handler](const std::string& data) -> std::string {
+ mWebContainer->AddJavaScriptInterface(exposedObjectName, "postMessage", [handler](const std::string& data) -> std::string
+ {
handler(data);
- return "";
- });
+ return ""; });
}
void TizenWebEngineLWE::AddJavaScriptEntireMessageHandler(const std::string& exposedObjectName, Dali::WebEnginePlugin::JavaScriptEntireMessageHandlerCallback handler)
SetSize(displayArea.width, displayArea.height);
}
+bool TizenWebEngineLWE::SetImePositionAndAlignment(Dali::Vector2 position, int alignment)
+{
+ // NOT IMPLEMENTED
+ return false;
+}
+
+void TizenWebEngineLWE::SetCursorThemeName(const std::string themeName)
+{
+ // NOT IMPLEMENTED
+}
+
void TizenWebEngineLWE::SetPageZoomFactor(float zoomFactor)
{
// NOT IMPLEMENTED
// NOT IMPLEMENTED
}
+void TizenWebEngineLWE::RegisterDeviceConnectionChangedCallback(WebEngineDeviceConnectionChangedCallback callback)
+{
+ // NOT IMPLEMENTED
+}
+
+void TizenWebEngineLWE::RegisterDeviceListGetCallback(WebEngineDeviceListGetCallback callback)
+{
+ // NOT IMPLEMENTED
+}
+
+void TizenWebEngineLWE::FeedMouseWheel(bool yDirection, int step, int x, int y)
+{
+ // NOT IMPLEMENTED
+}
+
+void TizenWebEngineLWE::SetVideoHole(bool enabled, bool isWaylandWindow)
+{
+ // NOT IMPLEMENTED
+}
+
} // namespace Plugin
} // namespace Dali
*/
void SetFocus(bool focused) override;
+ /**
+ * @copydoc Dali::WebEnginePlugin::SetImePositionAndAlignment()
+ */
+ bool SetImePositionAndAlignment(Dali::Vector2 position, int alignment) override;
+
+ /**
+ * @copydoc Dali::WebEnginePlugin::SetCursorThemeName()
+ */
+ void SetCursorThemeName(const std::string themeName) override;
+
/**
* @copydoc Dali::WebEnginePlugin::EnableMouseEvents()
*/
*/
void RegisterUserMediaPermissionRequestCallback(WebEngineUserMediaPermissionRequestCallback callback) override;
+ /**
+ * @copydoc Dali::WebEnginePlugin::RegisterDeviceConnectionChangedCallback()
+ */
+ void RegisterDeviceConnectionChangedCallback(WebEngineDeviceConnectionChangedCallback callback) override;
+
+ /**
+ * @copydoc Dali::WebEnginePlugin::RegisterDeviceListGetCallback()
+ */
+ void RegisterDeviceListGetCallback(WebEngineDeviceListGetCallback callback) override;
+
+ /**
+ * @copydoc Dali::WebEnginePlugin::FeedMouseWheel()
+ */
+ void FeedMouseWheel(bool yDirection, int step, int x, int y) override;
+
+ /**
+ * @copydoc Dali::WebEnginePlugin::SetVideoHole()
+ */
+ void SetVideoHole(bool enabled, bool isWaylandWindow) override;
+
private:
#ifndef OVER_TIZEN_VERSION_9
void LegacyUpdateBuffer();
bool mIsMouseLbuttonDown;
bool mCanGoBack;
bool mCanGoForward;
+ bool mInDestroyingLWEInstance;
#ifndef OVER_TIZEN_VERSION_9
size_t mOutputWidth;