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 "video-view-impl.h"
22 #include <dali/devel-api/actors/actor-devel.h>
23 #include <dali/devel-api/adaptor-framework/window-devel.h>
24 #include <dali/devel-api/scripting/scripting.h>
25 #include <dali/integration-api/debug.h>
26 #include <dali/public-api/adaptor-framework/native-image-source.h>
27 #include <dali/public-api/animation/constraint.h>
28 #include <dali/public-api/object/type-registry-helper.h>
29 #include <dali/public-api/object/type-registry.h>
33 #include <dali-toolkit/devel-api/controls/control-devel.h>
34 #include <dali-toolkit/internal/graphics/builtin-shader-extern-gen.h>
35 #include <dali-toolkit/internal/visuals/visual-factory-cache.h>
36 #include <dali-toolkit/public-api/controls/video-view/video-view.h>
37 #include <dali/integration-api/adaptor-framework/adaptor.h>
49 return Toolkit::VideoView::New();
52 DALI_TYPE_REGISTRATION_BEGIN(Toolkit::VideoView, Toolkit::Control, Create);
54 DALI_PROPERTY_REGISTRATION(Toolkit, VideoView, "video", MAP, VIDEO)
55 DALI_PROPERTY_REGISTRATION(Toolkit, VideoView, "looping", BOOLEAN, LOOPING)
56 DALI_PROPERTY_REGISTRATION(Toolkit, VideoView, "muted", BOOLEAN, MUTED)
57 DALI_PROPERTY_REGISTRATION(Toolkit, VideoView, "volume", MAP, VOLUME)
58 DALI_PROPERTY_REGISTRATION(Toolkit, VideoView, "underlay", BOOLEAN, UNDERLAY)
59 DALI_PROPERTY_REGISTRATION(Toolkit, VideoView, "playPosition", INTEGER, PLAY_POSITION)
60 DALI_PROPERTY_REGISTRATION(Toolkit, VideoView, "displayMode", INTEGER, DISPLAY_MODE)
62 DALI_SIGNAL_REGISTRATION(Toolkit, VideoView, "finished", FINISHED_SIGNAL)
64 DALI_ACTION_REGISTRATION(Toolkit, VideoView, "play", ACTION_VIDEOVIEW_PLAY)
65 DALI_ACTION_REGISTRATION(Toolkit, VideoView, "pause", ACTION_VIDEOVIEW_PAUSE)
66 DALI_ACTION_REGISTRATION(Toolkit, VideoView, "stop", ACTION_VIDEOVIEW_STOP)
67 DALI_ACTION_REGISTRATION(Toolkit, VideoView, "forward", ACTION_VIDEOVIEW_FORWARD)
68 DALI_ACTION_REGISTRATION(Toolkit, VideoView, "backward", ACTION_VIDEOVIEW_BACKWARD)
70 DALI_TYPE_REGISTRATION_END()
72 const char* const VOLUME_LEFT("volumeLeft");
73 const char* const VOLUME_RIGHT("volumeRight");
75 // 3.0 TC uses RENDERING_TARGET. It should be removed in next release
76 const char* const RENDERING_TARGET("renderingTarget");
77 const char* const WINDOW_SURFACE_TARGET("windowSurfaceTarget");
78 const char* const NATIVE_IMAGE_TARGET("nativeImageTarget");
80 const char* const CUSTOM_SHADER("shader");
81 const char* const CUSTOM_VERTEX_SHADER("vertexShader");
82 const char* const CUSTOM_FRAGMENT_SHADER("fragmentShader");
83 const char* const DEFAULT_SAMPLER_TYPE_NAME("sampler2D");
84 const char* const CUSTOM_SAMPLER_TYPE_NAME("samplerExternalOES");
86 const char* const IS_VIDEO_VIEW_PROPERTY_NAME = "isVideoView";
90 VideoView::VideoView(Dali::VideoSyncMode syncMode)
91 : Control(ControlBehaviour(ACTOR_BEHAVIOUR_DEFAULT | DISABLE_STYLE_CHANGE_SIGNALS)),
92 mCurrentVideoPlayPosition(0),
101 VideoView::~VideoView()
105 Toolkit::VideoView VideoView::New(VideoSyncMode syncMode)
107 VideoView* impl = new VideoView(syncMode);
108 Toolkit::VideoView handle = Toolkit::VideoView(*impl);
110 impl->mVideoPlayer = Dali::VideoPlayer::New(impl->Self(), syncMode);
115 void VideoView::OnInitialize()
118 mVideoPlayer.FinishedSignal().Connect(this, &VideoView::EmitSignalFinish);
120 DevelControl::SetAccessibilityConstructor(self, [](Dali::Actor actor) {
121 return std::unique_ptr<Dali::Accessibility::Accessible>(
122 new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::VIDEO));
125 //update self property
126 self.RegisterProperty(IS_VIDEO_VIEW_PROPERTY_NAME, true, Property::READ_WRITE);
129 void VideoView::SetUrl(const std::string& url)
132 mPropertyMap.Clear();
134 mVideoPlayer.SetUrl(mUrl);
137 void VideoView::SetPropertyMap(Property::Map map)
141 Property::Value* target = map.Find(RENDERING_TARGET);
142 std::string targetType;
144 if(target && target->Get(targetType) && targetType == WINDOW_SURFACE_TARGET)
147 SetWindowSurfaceTarget();
149 else if(target && target->Get(targetType) && targetType == NATIVE_IMAGE_TARGET)
152 SetNativeImageTarget();
156 Property::Value* shaderValue;
159 shaderValue = map.Find(CUSTOM_SHADER);
163 Property::Map* shaderMap = shaderValue->GetMap();
166 mEffectPropertyMap = *shaderMap;
171 if(mTextureRenderer && !mEffectPropertyMap.Empty())
173 Dali::Shader shader = CreateShader();
174 mTextureRenderer.SetShader(shader);
180 std::string VideoView::GetUrl()
185 void VideoView::SetLooping(bool looping)
187 mVideoPlayer.SetLooping(looping);
190 bool VideoView::IsLooping()
192 return mVideoPlayer.IsLooping();
195 void VideoView::Play()
201 void VideoView::Pause()
203 mVideoPlayer.Pause();
207 void VideoView::Stop()
213 void VideoView::Forward(int millisecond)
215 int curPos = mVideoPlayer.GetPlayPosition();
217 int nextPos = curPos + millisecond;
219 mVideoPlayer.SetPlayPosition(nextPos);
222 void VideoView::Backward(int millisecond)
224 int curPos = mVideoPlayer.GetPlayPosition();
226 int nextPos = curPos - millisecond;
227 nextPos = (nextPos < 0) ? 0 : nextPos;
229 mVideoPlayer.SetPlayPosition(nextPos);
232 void VideoView::SetMute(bool mute)
234 mVideoPlayer.SetMute(mute);
237 bool VideoView::IsMuted()
239 return mVideoPlayer.IsMuted();
242 void VideoView::SetVolume(float left, float right)
244 mVideoPlayer.SetVolume(left, right);
247 void VideoView::GetVolume(float& left, float& right)
249 mVideoPlayer.GetVolume(left, right);
252 Dali::Toolkit::VideoView::VideoViewSignalType& VideoView::FinishedSignal()
254 return mFinishedSignal;
257 void VideoView::EmitSignalFinish()
259 if(!mFinishedSignal.Empty())
261 Dali::Toolkit::VideoView handle(GetOwner());
262 mFinishedSignal.Emit(handle);
266 bool VideoView::DoAction(BaseObject* object, const std::string& actionName, const Property::Map& attributes)
270 Dali::BaseHandle handle(object);
271 Toolkit::VideoView videoView = Toolkit::VideoView::DownCast(handle);
278 VideoView& impl = GetImpl(videoView);
280 if(strcmp(actionName.c_str(), ACTION_VIDEOVIEW_PLAY) == 0)
285 else if(strcmp(actionName.c_str(), ACTION_VIDEOVIEW_PAUSE) == 0)
290 else if(strcmp(actionName.c_str(), ACTION_VIDEOVIEW_STOP) == 0)
295 else if(strcmp(actionName.c_str(), ACTION_VIDEOVIEW_FORWARD) == 0)
298 if(attributes["videoForward"].Get(millisecond))
300 impl.Forward(millisecond);
304 else if(strcmp(actionName.c_str(), ACTION_VIDEOVIEW_BACKWARD) == 0)
307 if(attributes["videoBackward"].Get(millisecond))
309 impl.Backward(millisecond);
317 bool VideoView::DoConnectSignal(BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor)
319 Dali::BaseHandle handle(object);
321 bool connected(true);
322 Toolkit::VideoView videoView = Toolkit::VideoView::DownCast(handle);
324 if(0 == strcmp(signalName.c_str(), FINISHED_SIGNAL))
326 videoView.FinishedSignal().Connect(tracker, functor);
330 // signalName does not match any signal
337 void VideoView::SetPropertyInternal(Property::Index index, const Property::Value& value)
341 case Toolkit::VideoView::Property::VIDEO:
343 std::string videoUrl;
346 if(value.Get(videoUrl))
350 else if(value.Get(map))
356 case Toolkit::VideoView::Property::LOOPING:
359 if(value.Get(looping))
365 case Toolkit::VideoView::Property::MUTED:
374 case Toolkit::VideoView::Property::VOLUME:
380 Property::Value* volumeLeft = map.Find(VOLUME_LEFT);
381 Property::Value* volumeRight = map.Find(VOLUME_RIGHT);
382 if(volumeLeft && volumeLeft->Get(left) && volumeRight && volumeRight->Get(right))
384 SetVolume(left, right);
389 case Toolkit::VideoView::Property::UNDERLAY:
392 if(value.Get(underlay))
394 SetUnderlay(underlay);
398 case Toolkit::VideoView::Property::PLAY_POSITION:
403 SetPlayPosition(pos);
407 case Toolkit::VideoView::Property::DISPLAY_MODE:
412 SetDisplayMode(mode);
419 void VideoView::SetProperty(BaseObject* object, Property::Index index, const Property::Value& value)
421 Toolkit::VideoView videoView = Toolkit::VideoView::DownCast(Dali::BaseHandle(object));
425 VideoView& impl = GetImpl(videoView);
427 impl.SetPropertyInternal(index, value);
429 if(index != Toolkit::VideoView::Property::UNDERLAY)
432 // These values will be used when underlay mode is changed.
433 impl.mPropertyBackup[index] = value;
438 Property::Value VideoView::GetProperty(BaseObject* object, Property::Index propertyIndex)
440 Property::Value value;
441 Toolkit::VideoView videoView = Toolkit::VideoView::DownCast(Dali::BaseHandle(object));
445 VideoView& impl = GetImpl(videoView);
447 switch(propertyIndex)
449 case Toolkit::VideoView::Property::VIDEO:
451 if(!impl.mUrl.empty())
455 else if(!impl.mPropertyMap.Empty())
457 value = impl.mPropertyMap;
461 case Toolkit::VideoView::Property::LOOPING:
463 value = impl.IsLooping();
466 case Toolkit::VideoView::Property::MUTED:
468 value = impl.IsMuted();
471 case Toolkit::VideoView::Property::VOLUME:
476 impl.GetVolume(left, right);
477 map.Insert(VOLUME_LEFT, left);
478 map.Insert(VOLUME_RIGHT, right);
482 case Toolkit::VideoView::Property::UNDERLAY:
484 value = impl.IsUnderlay();
487 case Toolkit::VideoView::Property::PLAY_POSITION:
489 value = impl.GetPlayPosition();
492 case Toolkit::VideoView::Property::DISPLAY_MODE:
494 value = impl.GetDisplayMode();
503 void VideoView::SetDepthIndex(int depthIndex)
507 mTextureRenderer.SetProperty(Renderer::Property::DEPTH_INDEX, depthIndex);
511 void VideoView::OnSceneConnection(int depth)
516 mSiblingOrder = self.GetProperty<int>(Dali::DevelActor::Property::SIBLING_ORDER);
517 DevelActor::ChildOrderChangedSignal(self.GetParent()).Connect(this, &VideoView::OnChildOrderChanged);
518 SetWindowSurfaceTarget();
521 Control::OnSceneConnection(depth);
524 void VideoView::OnSceneDisconnection()
526 Control::OnSceneDisconnection();
529 void VideoView::OnSizeSet(const Vector3& targetSize)
531 if(mIsUnderlay && mSyncMode == Dali::VideoSyncMode::ENABLED)
533 SetFrameRenderCallback();
534 mVideoPlayer.StartSynchronization();
536 Control::OnSizeSet(targetSize);
539 void VideoView::OnChildOrderChanged(Actor actor)
542 int currentSiblingOrder = self.GetProperty<int>(Dali::DevelActor::Property::SIBLING_ORDER);
543 if(currentSiblingOrder != mSiblingOrder)
545 Actor parent = self.GetParent();
550 int numChildren = static_cast<int>(parent.GetChildCount());
551 for(int i = 0; i < numChildren; i++)
553 child = parent.GetChildAt(i);
554 if(!IsVideoView(child))
564 if(i < currentSiblingOrder)
568 else if(i > currentSiblingOrder)
577 Toolkit::VideoView lowerView = Toolkit::VideoView::DownCast(lower);
578 mVideoPlayer.RaiseAbove(GetImpl(lowerView).GetVideoPlayer());
583 Toolkit::VideoView upperView = Toolkit::VideoView::DownCast(upper);
584 mVideoPlayer.LowerBelow(GetImpl(upperView).GetVideoPlayer());
586 mSiblingOrder = currentSiblingOrder;
590 Vector3 VideoView::GetNaturalSize()
593 size.x = mVideoSize.GetWidth();
594 size.y = mVideoSize.GetHeight();
596 if(size.x > 0 && size.y > 0)
598 size.z = std::min(size.x, size.y);
603 return Control::GetNaturalSize();
607 float VideoView::GetHeightForWidth(float width)
609 if(mVideoSize.GetWidth() > 0 && mVideoSize.GetHeight() > 0)
611 return GetHeightForWidthBase(width);
615 return Control::GetHeightForWidthBase(width);
619 float VideoView::GetWidthForHeight(float height)
621 if(mVideoSize.GetWidth() > 0 && mVideoSize.GetHeight() > 0)
623 return GetWidthForHeightBase(height);
627 return Control::GetWidthForHeightBase(height);
631 void VideoView::SetWindowSurfaceTarget()
635 if(!self.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE))
637 // When the control is off the stage, it does not have Window.
641 Dali::Window window = DevelWindow::Get(self);
642 window.ResizeSignal().Connect(this, &VideoView::OnWindowResized);
644 int curPos = mVideoPlayer.GetPlayPosition();
648 mVideoPlayer.Pause();
651 mPositionUpdateNotification = self.AddPropertyNotification(Actor::Property::WORLD_POSITION, StepCondition(1.0f, 1.0f));
652 mSizeUpdateNotification = self.AddPropertyNotification(Actor::Property::SIZE, StepCondition(1.0f, 1.0f));
653 mScaleUpdateNotification = self.AddPropertyNotification(Actor::Property::WORLD_SCALE, StepCondition(0.1f, 1.0f));
654 mPositionUpdateNotification.NotifySignal().Connect(this, &VideoView::UpdateDisplayArea);
655 mSizeUpdateNotification.NotifySignal().Connect(this, &VideoView::UpdateDisplayArea);
656 mScaleUpdateNotification.NotifySignal().Connect(this, &VideoView::UpdateDisplayArea);
660 self.RemoveRenderer(mTextureRenderer);
663 // Note VideoPlayer::SetRenderingTarget resets all the options. (e.g. url, mute, looping)
664 mVideoPlayer.SetRenderingTarget(Dali::Adaptor::Get().GetNativeWindowHandle(self));
666 ApplyBackupProperties();
668 if(!mOverlayRenderer)
670 // For underlay rendering mode, video display area have to be transparent.
671 Geometry geometry = VisualFactoryCache::CreateQuadGeometry();
672 Shader shader = Shader::New(SHADER_VIDEO_VIEW_VERT, SHADER_VIDEO_VIEW_FRAG);
673 mOverlayRenderer = Renderer::New(geometry, shader);
674 mOverlayRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::OFF);
676 Self().AddRenderer(mOverlayRenderer);
685 mVideoPlayer.SetPlayPosition(curPos);
689 void VideoView::SetNativeImageTarget()
691 if(mVideoPlayer.IsVideoTextureSupported() == false)
693 DALI_LOG_ERROR("Platform doesn't support decoded video frame images\n");
700 mVideoPlayer.Pause();
707 self.RemoveRenderer(mOverlayRenderer);
709 mOverlayRenderer.Reset();
712 self.RemovePropertyNotification(mPositionUpdateNotification);
713 self.RemovePropertyNotification(mSizeUpdateNotification);
714 self.RemovePropertyNotification(mScaleUpdateNotification);
716 int curPos = mVideoPlayer.GetPlayPosition();
719 Dali::NativeImageSourcePtr nativeImageSourcePtr = Dali::NativeImageSource::New(source);
720 mNativeTexture = Dali::Texture::New(*nativeImageSourcePtr);
722 if(!mTextureRenderer)
724 Dali::Geometry geometry = VisualFactoryCache::CreateQuadGeometry();
725 Dali::Shader shader = CreateShader();
726 Dali::TextureSet textureSet = Dali::TextureSet::New();
727 textureSet.SetTexture(0u, mNativeTexture);
729 mTextureRenderer = Renderer::New(geometry, shader);
730 mTextureRenderer.SetTextures(textureSet);
734 Dali::TextureSet textureSet = mTextureRenderer.GetTextures();
735 textureSet.SetTexture(0u, mNativeTexture);
737 Self().AddRenderer(mTextureRenderer);
739 // Note VideoPlayer::SetRenderingTarget resets all the options. (e.g. url, mute, looping)
740 mVideoPlayer.SetRenderingTarget(nativeImageSourcePtr);
742 ApplyBackupProperties();
751 mVideoPlayer.SetPlayPosition(curPos);
755 void VideoView::UpdateDisplayArea(Dali::PropertyNotification& source)
757 // If mSyncMode is enabled, Video player's size and poistion is updated in Video player's constraint.
758 // Because video view and player should be work syncronization.
759 if(!mIsUnderlay || mSyncMode == Dali::VideoSyncMode::ENABLED)
766 bool positionUsesAnchorPoint = self.GetProperty(Actor::Property::POSITION_USES_ANCHOR_POINT).Get<bool>();
767 Vector3 actorSize = self.GetCurrentProperty<Vector3>(Actor::Property::SIZE) * self.GetCurrentProperty<Vector3>(Actor::Property::SCALE);
768 Vector3 anchorPointOffSet = actorSize * (positionUsesAnchorPoint ? self.GetCurrentProperty<Vector3>(Actor::Property::ANCHOR_POINT) : AnchorPoint::TOP_LEFT);
770 Vector2 screenPosition = self.GetProperty(Actor::Property::SCREEN_POSITION).Get<Vector2>();
772 mDisplayArea.x = screenPosition.x - anchorPointOffSet.x;
773 mDisplayArea.y = screenPosition.y - anchorPointOffSet.y;
774 mDisplayArea.width = actorSize.x;
775 mDisplayArea.height = actorSize.y;
777 mVideoPlayer.SetDisplayArea(mDisplayArea);
780 void VideoView::SetUnderlay(bool set)
782 if(set != mIsUnderlay)
788 SetWindowSurfaceTarget();
792 SetNativeImageTarget();
799 bool VideoView::IsUnderlay()
804 void VideoView::SetSWCodec(bool on)
806 // If setting SW or HW type is failed , video-view shows video by default codec type.
807 // The default codec type is selected by platform.
810 mVideoPlayer.SetCodecType(Dali::VideoPlayerPlugin::CodecType::SW);
814 mVideoPlayer.SetCodecType(Dali::VideoPlayerPlugin::CodecType::HW);
818 int VideoView::GetPlayPosition()
820 return mVideoPlayer.GetPlayPosition();
823 void VideoView::SetPlayPosition(int pos)
825 mVideoPlayer.SetPlayPosition(pos);
828 void VideoView::SetDisplayMode(int mode)
830 mVideoPlayer.SetDisplayMode(static_cast<Dali::VideoPlayerPlugin::DisplayMode::Type>(mode));
833 int VideoView::GetDisplayMode() const
835 return static_cast<int>(mVideoPlayer.GetDisplayMode());
838 Any VideoView::GetMediaPlayer()
840 return mVideoPlayer.GetMediaPlayer();
843 void VideoView::OnAnimationFinished(Animation& animation)
846 SetFrameRenderCallback();
849 void VideoView::OnWindowResized(Dali::Window winHandle, Dali::Window::WindowSize size)
851 Dali::VideoPlayerPlugin::DisplayRotation videoAngle = mVideoPlayer.GetDisplayRotation();
852 int windowAngle = (DevelWindow::GetPhysicalOrientation(winHandle) / 90);
854 if(windowAngle != videoAngle)
856 mVideoPlayer.SetDisplayRotation(static_cast<Dali::VideoPlayerPlugin::DisplayRotation>(windowAngle));
860 void VideoView::PlayAnimation(Dali::Animation animation)
862 if(mIsUnderlay && mSyncMode == Dali::VideoSyncMode::ENABLED)
864 mVideoPlayer.StartSynchronization();
865 animation.FinishedSignal().Connect(this, &VideoView::OnAnimationFinished);
870 Dali::Shader VideoView::CreateShader()
872 std::string fragmentShader = "#extension GL_OES_EGL_image_external:require\n";
873 std::string vertexShader;
874 std::string customFragmentShader;
875 bool checkShader = false;
877 if(!mEffectPropertyMap.Empty())
879 Property::Value* vertexShaderValue = mEffectPropertyMap.Find(CUSTOM_VERTEX_SHADER);
880 if(vertexShaderValue)
882 checkShader = GetStringFromProperty(*vertexShaderValue, vertexShader);
885 if(!vertexShaderValue || !checkShader)
887 vertexShader = SHADER_VIDEO_VIEW_TEXTURE_VERT.data();
890 Property::Value* fragmentShaderValue = mEffectPropertyMap.Find(CUSTOM_FRAGMENT_SHADER);
891 if(fragmentShaderValue)
893 checkShader = GetStringFromProperty(*fragmentShaderValue, customFragmentShader);
897 fragmentShader = customFragmentShader;
901 if(!fragmentShaderValue || !checkShader)
903 fragmentShader += SHADER_VIDEO_VIEW_TEXTURE_FRAG.data();
908 vertexShader = SHADER_VIDEO_VIEW_TEXTURE_VERT.data();
909 fragmentShader += SHADER_VIDEO_VIEW_TEXTURE_FRAG.data();
912 return Dali::Shader::New(vertexShader, fragmentShader);
915 bool VideoView::GetStringFromProperty(const Dali::Property::Value& value, std::string& output)
917 bool extracted = false;
918 if(value.Get(output))
926 void VideoView::ApplyBackupProperties()
928 Property::Map::SizeType pos = 0;
929 Property::Map::SizeType count = mPropertyBackup.Count();
931 for(; pos < count; pos++)
933 KeyValuePair property = mPropertyBackup.GetKeyValue(pos);
935 SetPropertyInternal(property.first.indexKey, property.second);
939 void VideoView::FrameRenderCallback(int frameID)
942 if(frameID == mFrameID)
944 mVideoPlayer.FinishSynchronization();
949 void VideoView::SetFrameRenderCallback()
952 DevelWindow::AddFrameRenderedCallback(DevelWindow::Get(Self()),
953 std::unique_ptr<CallbackBase>(MakeCallback(this, &VideoView::FrameRenderCallback)),
957 bool VideoView::IsVideoView(Actor actor) const
959 // Check whether the actor is a VideoView
960 bool isVideoView = false;
964 Property::Index propertyIsVideoView = actor.GetPropertyIndex(IS_VIDEO_VIEW_PROPERTY_NAME);
965 if(propertyIsVideoView != Property::INVALID_INDEX)
967 isVideoView = actor.GetProperty<bool>(propertyIsVideoView);
974 VideoPlayer VideoView::GetVideoPlayer()
979 } // namespace Internal
981 } // namespace Toolkit