2 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include "web-view-impl.h"
22 #include <dali/devel-api/adaptor-framework/web-engine-back-forward-list.h>
23 #include <dali/devel-api/adaptor-framework/web-engine-context.h>
24 #include <dali/devel-api/adaptor-framework/web-engine-cookie-manager.h>
25 #include <dali/devel-api/adaptor-framework/web-engine-settings.h>
26 #include <dali/devel-api/common/stage.h>
27 #include <dali/devel-api/scripting/enum-helper.h>
28 #include <dali/devel-api/scripting/scripting.h>
29 #include <dali/public-api/adaptor-framework/native-image-source.h>
30 #include <dali/public-api/object/type-registry-helper.h>
31 #include <dali/public-api/object/type-registry.h>
35 #include <dali-toolkit/devel-api/controls/control-devel.h>
36 #include <dali-toolkit/devel-api/controls/web-view/web-back-forward-list.h>
37 #include <dali-toolkit/devel-api/controls/web-view/web-context.h>
38 #include <dali-toolkit/devel-api/controls/web-view/web-cookie-manager.h>
39 #include <dali-toolkit/devel-api/controls/web-view/web-settings.h>
40 #include <dali-toolkit/devel-api/image-loader/texture-manager.h>
41 #include <dali-toolkit/internal/visuals/visual-factory-impl.h>
42 #include <dali-toolkit/public-api/image-loader/image.h>
43 #include <dali-toolkit/public-api/visuals/image-visual-properties.h>
55 return Toolkit::WebView::New();
59 DALI_TYPE_REGISTRATION_BEGIN(Toolkit::WebView, Toolkit::Control, Create)
61 DALI_PROPERTY_REGISTRATION(Toolkit, WebView, "url", STRING, URL )
62 DALI_PROPERTY_REGISTRATION(Toolkit, WebView, "userAgent", STRING, USER_AGENT )
63 DALI_PROPERTY_REGISTRATION(Toolkit, WebView, "scrollPosition", VECTOR2, SCROLL_POSITION )
64 DALI_PROPERTY_REGISTRATION(Toolkit, WebView, "scrollSize", VECTOR2, SCROLL_SIZE )
65 DALI_PROPERTY_REGISTRATION(Toolkit, WebView, "contentSize", VECTOR2, CONTENT_SIZE )
66 DALI_PROPERTY_REGISTRATION(Toolkit, WebView, "title", STRING, TITLE )
67 DALI_PROPERTY_REGISTRATION(Toolkit, WebView, "videoHoleEnabled", BOOLEAN, VIDEO_HOLE_ENABLED )
68 DALI_PROPERTY_REGISTRATION(Toolkit, WebView, "mouseEventsEnabled", BOOLEAN, MOUSE_EVENTS_ENABLED)
69 DALI_PROPERTY_REGISTRATION(Toolkit, WebView, "keyEventsEnabled", BOOLEAN, KEY_EVENTS_ENABLED )
71 DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "pageLoadStarted", PAGE_LOAD_STARTED_SIGNAL )
72 DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "pageLoadInProgress", PAGE_LOAD_IN_PROGRESS_SIGNAL)
73 DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "pageLoadFinished", PAGE_LOAD_FINISHED_SIGNAL )
74 DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "pageLoadError", PAGE_LOAD_ERROR_SIGNAL )
75 DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "scrollEdgeReached", SCROLL_EDGE_REACHED_SIGNAL )
76 DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "urlChanged", URL_CHANGED_SIGNAL )
78 DALI_TYPE_REGISTRATION_END()
81 const std::string kEmptyString;
85 #define GET_ENUM_STRING(structName, inputExp) \
86 Scripting::GetLinearEnumerationName<Toolkit::WebView::structName::Type>(static_cast<Toolkit::WebView::structName::Type>(inputExp), structName##_TABLE, structName##_TABLE_COUNT)
88 #define GET_ENUM_VALUE(structName, inputExp, outputExp) \
89 Scripting::GetEnumerationProperty<Toolkit::WebView::structName::Type>(inputExp, structName##_TABLE, structName##_TABLE_COUNT, outputExp)
91 WebView::WebView(const std::string& locale, const std::string& timezoneId)
92 : Control(ControlBehaviour(ACTOR_BEHAVIOUR_DEFAULT | DISABLE_STYLE_CHANGE_SIGNALS)),
95 mWebViewSize(Stage::GetCurrent().GetSize()),
97 mPageLoadStartedSignal(),
98 mPageLoadFinishedSignal(),
99 mPageLoadErrorSignal(),
100 mVideoHoleEnabled(true),
101 mWebViewArea(0, 0, mWebViewSize.width, mWebViewSize.height),
103 mMouseEventsEnabled(true),
104 mKeyEventsEnabled(true)
106 mWebEngine = Dali::WebEngine::New();
108 // WebEngine is empty when it is not properly initialized.
111 mWebEngine.Create(mWebViewSize.width, mWebViewSize.height, locale, timezoneId);
115 WebView::WebView(int argc, char** argv)
116 : Control(ControlBehaviour(ACTOR_BEHAVIOUR_DEFAULT | DISABLE_STYLE_CHANGE_SIGNALS)),
119 mWebViewSize(Stage::GetCurrent().GetSize()),
121 mPageLoadStartedSignal(),
122 mPageLoadFinishedSignal(),
123 mPageLoadErrorSignal(),
124 mVideoHoleEnabled(true),
125 mWebViewArea(0, 0, mWebViewSize.width, mWebViewSize.height),
127 mMouseEventsEnabled(true),
128 mKeyEventsEnabled(true)
130 mWebEngine = Dali::WebEngine::New();
132 // WebEngine is empty when it is not properly initialized.
135 mWebEngine.Create(mWebViewSize.width, mWebViewSize.height, argc, argv);
148 mWebEngine.Destroy();
152 Toolkit::WebView WebView::New()
154 WebView* impl = new WebView();
155 Toolkit::WebView handle = Toolkit::WebView(*impl);
161 Toolkit::WebView WebView::New(const std::string& locale, const std::string& timezoneId)
163 WebView* impl = new WebView(locale, timezoneId);
164 Toolkit::WebView handle = Toolkit::WebView(*impl);
170 Toolkit::WebView WebView::New(int argc, char** argv)
172 WebView* impl = new WebView(argc, argv);
173 Toolkit::WebView handle = Toolkit::WebView(*impl);
179 void WebView::OnInitialize()
183 self.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
184 self.TouchedSignal().Connect(this, &WebView::OnTouchEvent);
185 self.HoveredSignal().Connect(this, &WebView::OnHoverEvent);
186 self.WheelEventSignal().Connect(this, &WebView::OnWheelEvent);
188 mPositionUpdateNotification = self.AddPropertyNotification(Actor::Property::WORLD_POSITION, StepCondition(1.0f, 1.0f));
189 mSizeUpdateNotification = self.AddPropertyNotification(Actor::Property::SIZE, StepCondition(1.0f, 1.0f));
190 mScaleUpdateNotification = self.AddPropertyNotification(Actor::Property::WORLD_SCALE, StepCondition(0.1f, 1.0f));
191 mPositionUpdateNotification.NotifySignal().Connect(this, &WebView::UpdateDisplayArea);
192 mSizeUpdateNotification.NotifySignal().Connect(this, &WebView::UpdateDisplayArea);
193 mScaleUpdateNotification.NotifySignal().Connect(this, &WebView::UpdateDisplayArea);
197 mWebEngine.PageLoadStartedSignal().Connect(this, &WebView::OnPageLoadStarted);
198 mWebEngine.PageLoadInProgressSignal().Connect(this, &WebView::OnPageLoadInProgress);
199 mWebEngine.PageLoadFinishedSignal().Connect(this, &WebView::OnPageLoadFinished);
200 mWebEngine.PageLoadErrorSignal().Connect(this, &WebView::OnPageLoadError);
201 mWebEngine.ScrollEdgeReachedSignal().Connect(this, &WebView::OnScrollEdgeReached);
202 mWebEngine.UrlChangedSignal().Connect(this, &WebView::OnUrlChanged);
204 mWebContext = std::unique_ptr<Dali::Toolkit::WebContext>(new WebContext(mWebEngine.GetContext()));
205 mWebCookieManager = std::unique_ptr<Dali::Toolkit::WebCookieManager>(new WebCookieManager(mWebEngine.GetCookieManager()));
206 mWebSettings = std::unique_ptr<Dali::Toolkit::WebSettings>(new WebSettings(mWebEngine.GetSettings()));
207 mWebBackForwardList = std::unique_ptr<Dali::Toolkit::WebBackForwardList>(new WebBackForwardList(mWebEngine.GetBackForwardList()));
211 Dali::Toolkit::WebSettings* WebView::GetSettings() const
213 return mWebSettings.get();
216 Dali::Toolkit::WebContext* WebView::GetContext() const
218 return mWebContext.get();
221 Dali::Toolkit::WebCookieManager* WebView::GetCookieManager() const
223 return mWebCookieManager.get();
226 Dali::Toolkit::WebBackForwardList* WebView::GetBackForwardList() const
228 return mWebBackForwardList.get();
231 Dali::Toolkit::ImageView& WebView::GetFavicon()
235 Dali::PixelData pixelData = mWebEngine.GetFavicon();
236 std::string url = Dali::Toolkit::Image::GenerateUrl(pixelData);
237 mFaviconView = Dali::Toolkit::ImageView::New(url);
238 mFaviconView.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS);
239 mFaviconView.SetProperty(Dali::Actor::Property::SIZE, Vector2(pixelData.GetWidth(), pixelData.GetHeight()));
244 void WebView::LoadUrl(const std::string& url)
249 Texture texture = Dali::Texture::New(*mWebEngine.GetNativeImageSource());
250 const std::string nativeImageUrl = Dali::Toolkit::TextureManager::AddTexture(texture);
251 mVisual = Toolkit::VisualFactory::Get().CreateVisual(
252 {{Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE},
253 {Toolkit::ImageVisual::Property::URL, nativeImageUrl}});
257 // Clean up previously registered visual and add new one.
258 DevelControl::RegisterVisual(*this, Toolkit::WebView::Property::URL, mVisual);
259 mWebEngine.LoadUrl(url);
262 if(mVideoHoleEnabled)
264 EnableBlendMode(false);
269 void WebView::LoadHtmlString(const std::string& htmlString)
273 Texture texture = Dali::Texture::New(*mWebEngine.GetNativeImageSource());
274 const std::string nativeImageUrl = Dali::Toolkit::TextureManager::AddTexture(texture);
275 mVisual = Toolkit::VisualFactory::Get().CreateVisual(
276 {{Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE},
277 {Toolkit::ImageVisual::Property::URL, nativeImageUrl}});
281 DevelControl::RegisterVisual(*this, Toolkit::WebView::Property::URL, mVisual);
282 mWebEngine.LoadHtmlString(htmlString);
285 if(mVideoHoleEnabled)
287 EnableBlendMode(false);
292 void WebView::Reload()
300 void WebView::StopLoading()
304 mWebEngine.StopLoading();
308 void WebView::Suspend()
312 mWebEngine.Suspend();
316 void WebView::Resume()
324 void WebView::ScrollBy(int deltaX, int deltaY)
328 mWebEngine.ScrollBy(deltaX, deltaY);
332 bool WebView::CanGoForward()
334 return mWebEngine ? mWebEngine.CanGoForward() : false;
337 void WebView::GoForward()
341 mWebEngine.GoForward();
345 bool WebView::CanGoBack()
347 return mWebEngine ? mWebEngine.CanGoBack() : false;
350 void WebView::GoBack()
358 void WebView::EvaluateJavaScript(const std::string& script, std::function<void(const std::string&)> resultHandler)
362 mWebEngine.EvaluateJavaScript(script, resultHandler);
366 void WebView::AddJavaScriptMessageHandler(const std::string& exposedObjectName, std::function<void(const std::string&)> handler)
370 mWebEngine.AddJavaScriptMessageHandler(exposedObjectName, handler);
374 void WebView::RegisterJavaScriptAlertCallback(Dali::WebEnginePlugin::JavaScriptAlertCallback callback)
378 mWebEngine.RegisterJavaScriptAlertCallback(callback);
382 void WebView::JavaScriptAlertReply()
386 mWebEngine.JavaScriptAlertReply();
390 void WebView::RegisterJavaScriptConfirmCallback(Dali::WebEnginePlugin::JavaScriptConfirmCallback callback)
394 mWebEngine.RegisterJavaScriptConfirmCallback(callback);
398 void WebView::JavaScriptConfirmReply(bool confirmed)
402 mWebEngine.JavaScriptConfirmReply(confirmed);
406 void WebView::RegisterJavaScriptPromptCallback(Dali::WebEnginePlugin::JavaScriptPromptCallback callback)
410 mWebEngine.RegisterJavaScriptPromptCallback(callback);
414 void WebView::JavaScriptPromptReply(const std::string& result)
418 mWebEngine.JavaScriptPromptReply(result);
422 void WebView::ClearHistory()
426 mWebEngine.ClearHistory();
430 void WebView::UpdateDisplayArea(Dali::PropertyNotification& /*source*/)
437 bool positionUsesAnchorPoint = self.GetProperty<bool>(Actor::Property::POSITION_USES_ANCHOR_POINT);
438 Vector3 actorSize = self.GetCurrentProperty<Vector3>(Actor::Property::SIZE) * self.GetCurrentProperty<Vector3>(Actor::Property::SCALE);
439 Vector3 anchorPointOffSet = actorSize * (positionUsesAnchorPoint ? self.GetCurrentProperty<Vector3>(Actor::Property::ANCHOR_POINT) : AnchorPoint::TOP_LEFT);
440 Vector2 screenPosition = self.GetProperty<Vector2>(Actor::Property::SCREEN_POSITION);
442 Dali::Rect<int> displayArea;
443 displayArea.x = screenPosition.x - anchorPointOffSet.x;
444 displayArea.y = screenPosition.y - anchorPointOffSet.y;
445 displayArea.width = actorSize.x;
446 displayArea.height = actorSize.y;
448 Size displaySize = Size(displayArea.width, displayArea.height);
449 if(mWebViewSize != displaySize)
451 mWebViewSize = displaySize;
454 if(mWebViewArea != displayArea)
456 mWebViewArea = displayArea;
457 mWebEngine.UpdateDisplayArea(mWebViewArea);
461 void WebView::EnableVideoHole(bool enabled)
463 mVideoHoleEnabled = enabled;
465 EnableBlendMode(!mVideoHoleEnabled);
469 mWebEngine.EnableVideoHole(mVideoHoleEnabled);
473 void WebView::EnableBlendMode(bool blendEnabled)
476 for(uint32_t i = 0; i < self.GetRendererCount(); i++)
478 Dali::Renderer render = self.GetRendererAt(i);
479 render.SetProperty(Renderer::Property::BLEND_MODE, blendEnabled ? BlendMode::ON : BlendMode::OFF);
483 void WebView::ClearAllTilesResources()
487 mWebEngine.ClearAllTilesResources();
491 Dali::Toolkit::WebView::WebViewPageLoadSignalType& WebView::PageLoadStartedSignal()
493 return mPageLoadStartedSignal;
496 Dali::Toolkit::WebView::WebViewPageLoadSignalType& WebView::PageLoadInProgressSignal()
498 return mPageLoadInProgressSignal;
501 Dali::Toolkit::WebView::WebViewPageLoadSignalType& WebView::PageLoadFinishedSignal()
503 return mPageLoadFinishedSignal;
506 Dali::Toolkit::WebView::WebViewPageLoadErrorSignalType& WebView::PageLoadErrorSignal()
508 return mPageLoadErrorSignal;
511 Dali::Toolkit::WebView::WebViewScrollEdgeReachedSignalType& WebView::ScrollEdgeReachedSignal()
513 return mScrollEdgeReachedSignal;
516 Dali::Toolkit::WebView::WebViewUrlChangedSignalType& WebView::UrlChangedSignal()
518 return mUrlChangedSignal;
521 void WebView::OnPageLoadStarted(const std::string& url)
523 if(!mPageLoadStartedSignal.Empty())
525 Dali::Toolkit::WebView handle(GetOwner());
526 mPageLoadStartedSignal.Emit(handle, url);
530 void WebView::OnPageLoadInProgress(const std::string& url)
532 if(!mPageLoadInProgressSignal.Empty())
534 Dali::Toolkit::WebView handle(GetOwner());
535 mPageLoadInProgressSignal.Emit(handle, url);
539 void WebView::OnPageLoadFinished(const std::string& url)
541 if(!mPageLoadFinishedSignal.Empty())
543 Dali::Toolkit::WebView handle(GetOwner());
544 mPageLoadFinishedSignal.Emit(handle, url);
548 void WebView::OnPageLoadError(const std::string& url, int errorCode)
550 if(!mPageLoadErrorSignal.Empty())
552 Dali::Toolkit::WebView handle(GetOwner());
553 mPageLoadErrorSignal.Emit(handle, url, static_cast<Toolkit::WebView::LoadErrorCode>(errorCode));
557 void WebView::OnScrollEdgeReached(Dali::WebEnginePlugin::ScrollEdge edge)
559 if(!mScrollEdgeReachedSignal.Empty())
561 Dali::Toolkit::WebView handle(GetOwner());
562 mScrollEdgeReachedSignal.Emit(handle, edge);
566 void WebView::OnUrlChanged(const std::string& url)
568 if(!mUrlChangedSignal.Empty())
570 Dali::Toolkit::WebView handle(GetOwner());
571 mUrlChangedSignal.Emit(handle, url);
575 bool WebView::DoConnectSignal(BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor)
577 Dali::BaseHandle handle(object);
579 bool connected = false;
580 Toolkit::WebView webView = Toolkit::WebView::DownCast(handle);
582 if(0 == strcmp(signalName.c_str(), PAGE_LOAD_STARTED_SIGNAL))
584 webView.PageLoadStartedSignal().Connect(tracker, functor);
587 else if(0 == strcmp(signalName.c_str(), PAGE_LOAD_IN_PROGRESS_SIGNAL))
589 webView.PageLoadInProgressSignal().Connect(tracker, functor);
592 else if(0 == strcmp(signalName.c_str(), PAGE_LOAD_FINISHED_SIGNAL))
594 webView.PageLoadFinishedSignal().Connect(tracker, functor);
597 else if(0 == strcmp(signalName.c_str(), PAGE_LOAD_ERROR_SIGNAL))
599 webView.PageLoadErrorSignal().Connect(tracker, functor);
602 else if(0 == strcmp(signalName.c_str(), SCROLL_EDGE_REACHED_SIGNAL))
604 webView.ScrollEdgeReachedSignal().Connect(tracker, functor);
607 else if(0 == strcmp(signalName.c_str(), URL_CHANGED_SIGNAL))
609 webView.UrlChangedSignal().Connect(tracker, functor);
616 Vector3 WebView::GetNaturalSize()
620 Vector2 rendererNaturalSize;
621 mVisual.GetNaturalSize(rendererNaturalSize);
622 return Vector3(rendererNaturalSize);
625 return Vector3(mWebViewSize);
628 void WebView::OnSceneConnection(int depth)
630 Control::OnSceneConnection(depth);
632 EnableBlendMode(!mVideoHoleEnabled);
635 void WebView::SetProperty(BaseObject* object, Property::Index index, const Property::Value& value)
637 Toolkit::WebView webView = Toolkit::WebView::DownCast(Dali::BaseHandle(object));
641 WebView& impl = GetImpl(webView);
644 case Toolkit::WebView::Property::URL:
653 case Toolkit::WebView::Property::USER_AGENT:
658 impl.SetUserAgent(input);
662 case Toolkit::WebView::Property::SCROLL_POSITION:
667 impl.SetScrollPosition(input.x, input.y);
671 case Toolkit::WebView::Property::VIDEO_HOLE_ENABLED:
676 impl.EnableVideoHole(input);
680 case Toolkit::WebView::Property::MOUSE_EVENTS_ENABLED:
685 impl.EnableMouseEvents(input);
689 case Toolkit::WebView::Property::KEY_EVENTS_ENABLED:
694 impl.EnableKeyEvents(input);
702 Property::Value WebView::GetProperty(BaseObject* object, Property::Index propertyIndex)
704 Property::Value value;
706 Toolkit::WebView webView = Toolkit::WebView::DownCast(Dali::BaseHandle(object));
710 WebView& impl = GetImpl(webView);
711 switch(propertyIndex)
713 case Toolkit::WebView::Property::URL:
718 case Toolkit::WebView::Property::USER_AGENT:
720 value = impl.GetUserAgent();
723 case Toolkit::WebView::Property::SCROLL_POSITION:
725 value = impl.GetScrollPosition();
728 case Toolkit::WebView::Property::SCROLL_SIZE:
730 value = impl.GetScrollSize();
733 case Toolkit::WebView::Property::CONTENT_SIZE:
735 value = impl.GetContentSize();
738 case Toolkit::WebView::Property::TITLE:
740 value = impl.GetTitle();
743 case Toolkit::WebView::Property::VIDEO_HOLE_ENABLED:
745 value = impl.mVideoHoleEnabled;
748 case Toolkit::WebView::Property::MOUSE_EVENTS_ENABLED:
750 value = impl.mMouseEventsEnabled;
753 case Toolkit::WebView::Property::KEY_EVENTS_ENABLED:
755 value = impl.mKeyEventsEnabled;
766 bool WebView::OnTouchEvent(Actor actor, const Dali::TouchEvent& touch)
772 result = mWebEngine.SendTouchEvent(touch);
777 bool WebView::OnKeyEvent(const Dali::KeyEvent& event)
783 result = mWebEngine.SendKeyEvent(event);
788 bool WebView::OnHoverEvent(Actor actor, const Dali::HoverEvent& hover)
793 result = mWebEngine.SendHoverEvent(hover);
798 bool WebView::OnWheelEvent(Actor actor, const Dali::WheelEvent& wheel)
803 result = mWebEngine.SendWheelEvent(wheel);
808 void WebView::OnKeyInputFocusGained()
812 mWebEngine.SetFocus(true);
815 EmitKeyInputFocusSignal(true); // Calls back into the Control hence done last.
818 void WebView::OnKeyInputFocusLost()
822 mWebEngine.SetFocus(false);
825 EmitKeyInputFocusSignal(false); // Calls back into the Control hence done last.
828 void WebView::SetScrollPosition(int x, int y)
832 mWebEngine.SetScrollPosition(x, y);
836 Dali::Vector2 WebView::GetScrollPosition() const
838 return mWebEngine ? mWebEngine.GetScrollPosition() : Dali::Vector2::ZERO;
841 Dali::Vector2 WebView::GetScrollSize() const
843 return mWebEngine ? mWebEngine.GetScrollSize() : Dali::Vector2::ZERO;
846 Dali::Vector2 WebView::GetContentSize() const
848 return mWebEngine ? mWebEngine.GetContentSize() : Dali::Vector2::ZERO;
851 std::string WebView::GetTitle() const
853 return mWebEngine ? mWebEngine.GetTitle() : kEmptyString;
856 const std::string& WebView::GetUserAgent() const
858 return mWebEngine ? mWebEngine.GetUserAgent() : kEmptyString;
861 void WebView::SetUserAgent(const std::string& userAgent)
865 mWebEngine.SetUserAgent(userAgent);
869 void WebView::EnableMouseEvents(bool enabled)
873 mMouseEventsEnabled = enabled;
874 mWebEngine.EnableMouseEvents(enabled);
878 void WebView::EnableKeyEvents(bool enabled)
882 mKeyEventsEnabled = enabled;
883 mWebEngine.EnableKeyEvents(enabled);
887 #undef GET_ENUM_STRING
888 #undef GET_ENUM_VALUE
890 } // namespace Internal
892 } // namespace Toolkit