From: Paul Wisbey Date: Thu, 16 Jun 2016 16:46:43 +0000 (-0700) Subject: Merge "Fixed bug in model3d-view control" into devel/master X-Git-Tag: dali_1.1.39~3 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=f4f74e774495b9c798c86e5697fe84db6decc327;hp=5817a82647a2da08b91058659b70238fc7dbf2dd Merge "Fixed bug in model3d-view control" into devel/master --- diff --git a/automated-tests/src/dali-toolkit-styling/CMakeLists.txt b/automated-tests/src/dali-toolkit-styling/CMakeLists.txt index 92653f1..d8d55f8 100644 --- a/automated-tests/src/dali-toolkit-styling/CMakeLists.txt +++ b/automated-tests/src/dali-toolkit-styling/CMakeLists.txt @@ -13,6 +13,7 @@ SET(TC_SOURCES # Append list of test harness files (Won't get parsed for test cases) LIST(APPEND TC_SOURCES ../dali-toolkit/dali-toolkit-test-utils/test-harness.cpp + ../dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor.cpp ../dali-toolkit/dali-toolkit-test-utils/toolkit-accessibility-adaptor.cpp ../dali-toolkit/dali-toolkit-test-utils/toolkit-application.cpp ../dali-toolkit/dali-toolkit-test-utils/toolkit-bitmap-loader.cpp @@ -23,6 +24,7 @@ LIST(APPEND TC_SOURCES ../dali-toolkit/dali-toolkit-test-utils/toolkit-feedback-player.cpp ../dali-toolkit/dali-toolkit-test-utils/toolkit-file-loader.cpp ../dali-toolkit/dali-toolkit-test-utils/toolkit-imf-manager.cpp + ../dali-toolkit/dali-toolkit-test-utils/toolkit-native-image-source.cpp ../dali-toolkit/dali-toolkit-test-utils/toolkit-orientation.cpp ../dali-toolkit/dali-toolkit-test-utils/toolkit-physical-keyboard.cpp ../dali-toolkit/dali-toolkit-test-utils/toolkit-style-monitor.cpp @@ -32,6 +34,7 @@ LIST(APPEND TC_SOURCES ../dali-toolkit/dali-toolkit-test-utils/toolkit-timer.cpp ../dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard-event-notifier.cpp ../dali-toolkit/dali-toolkit-test-utils/toolkit-tts-player.cpp + ../dali-toolkit/dali-toolkit-test-utils/toolkit-video-player.cpp ../dali-toolkit/dali-toolkit-test-utils/toolkit-virtual-keyboard.cpp ../dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp ../dali-toolkit/dali-toolkit-test-utils/dali-test-suite-utils.cpp diff --git a/automated-tests/src/dali-toolkit/CMakeLists.txt b/automated-tests/src/dali-toolkit/CMakeLists.txt index 8a6003f..77b2c96 100644 --- a/automated-tests/src/dali-toolkit/CMakeLists.txt +++ b/automated-tests/src/dali-toolkit/CMakeLists.txt @@ -7,51 +7,52 @@ SET(CAPI_LIB "dali-toolkit") # List of test case sources (Only these get parsed for test cases) SET(TC_SOURCES - utc-Dali-Alignment.cpp - utc-Dali-BloomView.cpp - utc-Dali-BubbleEmitter.cpp - utc-Dali-Builder.cpp - utc-Dali-CheckBoxButton.cpp - utc-Dali-ConfirmationPopup.cpp - utc-Dali-CubeTransitionEffect.cpp - utc-Dali-EffectsView.cpp - utc-Dali-FlexContainer.cpp - utc-Dali-GaussianBlurView.cpp - utc-Dali-ImageView.cpp - utc-Dali-JsonParser.cpp - utc-Dali-KeyInputFocusManager.cpp - utc-Dali-PageTurnView.cpp - utc-Dali-Script.cpp - utc-Dali-ScrollBar.cpp - utc-Dali-ScrollView.cpp - utc-Dali-ShaderEffects.cpp - utc-Dali-ShadowView.cpp - utc-Dali-Slider.cpp - utc-Dali-TableView.cpp - utc-Dali-TextEditor.cpp - utc-Dali-TextField.cpp - utc-Dali-TextLabel.cpp - utc-Dali-TextSelectionPopup.cpp - utc-Dali-ToolBar.cpp - utc-Dali-Button.cpp - utc-Dali-Control.cpp - utc-Dali-ControlImpl.cpp - utc-Dali-AccessibilityManager.cpp - utc-Dali-ItemLayout.cpp - utc-Dali-ItemView.cpp - utc-Dali-KeyboardFocusManager.cpp - utc-Dali-Magnifier.cpp - utc-Dali-Popup.cpp - utc-Dali-PushButton.cpp - utc-Dali-RadioButton.cpp - utc-Dali-ScrollViewEffect.cpp - utc-Dali-SuperBlurView.cpp - utc-Dali-Toolkit.cpp - utc-Dali-Model3dView.cpp - utc-Dali-ControlRenderer.cpp - utc-Dali-RendererFactory.cpp - utc-Dali-DebugRenderer.cpp - utc-Dali-ImageAtlas.cpp +# utc-Dali-Alignment.cpp +# utc-Dali-BloomView.cpp +# utc-Dali-BubbleEmitter.cpp +# utc-Dali-Builder.cpp +# utc-Dali-CheckBoxButton.cpp +# utc-Dali-ConfirmationPopup.cpp +# utc-Dali-CubeTransitionEffect.cpp +# utc-Dali-EffectsView.cpp +# utc-Dali-FlexContainer.cpp +# utc-Dali-GaussianBlurView.cpp +# utc-Dali-ImageView.cpp +# utc-Dali-JsonParser.cpp +# utc-Dali-KeyInputFocusManager.cpp +# utc-Dali-PageTurnView.cpp +# utc-Dali-Script.cpp +# utc-Dali-ScrollBar.cpp +# utc-Dali-ScrollView.cpp +# utc-Dali-ShaderEffects.cpp +# utc-Dali-ShadowView.cpp +# utc-Dali-Slider.cpp +# utc-Dali-TableView.cpp +# utc-Dali-TextEditor.cpp +# utc-Dali-TextField.cpp +# utc-Dali-TextLabel.cpp +# utc-Dali-TextSelectionPopup.cpp +# utc-Dali-ToolBar.cpp +# utc-Dali-Button.cpp +# utc-Dali-Control.cpp +# utc-Dali-ControlImpl.cpp +# utc-Dali-AccessibilityManager.cpp +# utc-Dali-ItemLayout.cpp +# utc-Dali-ItemView.cpp +# utc-Dali-KeyboardFocusManager.cpp +# utc-Dali-Magnifier.cpp +# utc-Dali-Popup.cpp +# utc-Dali-PushButton.cpp +# utc-Dali-RadioButton.cpp +# utc-Dali-ScrollViewEffect.cpp +# utc-Dali-SuperBlurView.cpp +# utc-Dali-Toolkit.cpp +# utc-Dali-Model3dView.cpp +# utc-Dali-ControlRenderer.cpp +# utc-Dali-RendererFactory.cpp +# utc-Dali-DebugRenderer.cpp +# utc-Dali-ImageAtlas.cpp + utc-Dali-VideoView.cpp ) # Append list of test harness files (Won't get parsed for test cases) @@ -70,6 +71,8 @@ LIST(APPEND TC_SOURCES dali-toolkit-test-utils/toolkit-singleton-service.cpp dali-toolkit-test-utils/toolkit-timer.cpp dali-toolkit-test-utils/toolkit-tts-player.cpp + dali-toolkit-test-utils/toolkit-native-image-source.cpp + dali-toolkit-test-utils/toolkit-video-player.cpp dali-toolkit-test-utils/dali-test-suite-utils.cpp dali-toolkit-test-utils/dummy-control.cpp dali-toolkit-test-utils/mesh-builder.cpp diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor.cpp new file mode 100644 index 0000000..ebab526 --- /dev/null +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor.cpp @@ -0,0 +1,244 @@ +/* + * Copyright (c) 2014 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. + * + */ + +// CLASS HEADER +#include + +#include +#include + +namespace Dali +{ + +class EglInterface; +class DisplayConnection; +class ThreadSynchronizationInterface; + +namespace Integration +{ + +class GlAbstraction; + +} // namespace Integration + +class TestRenderSurface : public RenderSurface +{ +public: + virtual PositionSize GetPositionSize() const { PositionSize size; return size; } + + virtual void InitializeEgl( EglInterface& egl ) {} + + virtual void CreateEglSurface( EglInterface& egl ) {} + + virtual void DestroyEglSurface( EglInterface& egl ) {} + + virtual bool ReplaceEGLSurface( EglInterface& egl ) { return false; } + + virtual void MoveResize( Dali::PositionSize positionSize ) {} + + virtual void SetViewMode( ViewMode viewMode ) {} + + virtual void StartRender() {} + + virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction ) { return false; } + + virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface ) {} + + virtual void StopRender() {} + + virtual void ReleaseLock() {} + + virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization ) {} + +}; + +namespace Internal +{ +namespace Adaptor +{ + +class Adaptor: public BaseObject +{ +public: + static Dali::Adaptor& Get(); + Adaptor(); + ~Adaptor(); + +public: + static Dali::RenderSurface& GetSurface(); + static Dali::Adaptor::AdaptorSignalType& AdaptorSignal(); +}; + +Dali::Adaptor& Adaptor::Get() +{ + Dali::Adaptor* adaptor = new Dali::Adaptor; + return *adaptor; +} + +Dali::RenderSurface& Adaptor::GetSurface() +{ + Dali::RenderSurface *renderSurface = new Dali::TestRenderSurface; + return *renderSurface; +} + +Dali::Adaptor::AdaptorSignalType& Adaptor::AdaptorSignal() +{ + Dali::Adaptor::AdaptorSignalType* signal = new Dali::Adaptor::AdaptorSignalType; + return *signal; +} + +} +} +} + +namespace Dali +{ + +Adaptor& Adaptor::New( Window window ) +{ + return Internal::Adaptor::Adaptor::Get(); +} + +Adaptor& Adaptor::New( Window window, Configuration::ContextLoss configuration ) +{ + return Internal::Adaptor::Adaptor::Get(); +} + +Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface ) +{ + return Internal::Adaptor::Adaptor::Get(); +} + +Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface, Configuration::ContextLoss configuration ) +{ + return Internal::Adaptor::Adaptor::Get(); +} + +Adaptor::~Adaptor() +{ +} + +void Adaptor::Start() +{ +} + +void Adaptor::Pause() +{ +} + +void Adaptor::Resume() +{ +} + +void Adaptor::Stop() +{ +} + +bool Adaptor::AddIdle( CallbackBase* callback ) +{ + return false; +} + +void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurface& surface ) +{ +} + +Adaptor::AdaptorSignalType& Adaptor::ResizedSignal() +{ + return Internal::Adaptor::Adaptor::AdaptorSignal(); +} + +Adaptor::AdaptorSignalType& Adaptor::LanguageChangedSignal() +{ + return Internal::Adaptor::Adaptor::AdaptorSignal(); +} + +RenderSurface& Adaptor::GetSurface() +{ + return Internal::Adaptor::Adaptor::GetSurface(); +} + +Any Adaptor::GetNativeWindowHandle() +{ + Any window; + return window; +} + +void Adaptor::ReleaseSurfaceLock() +{ +} + +void Adaptor::SetRenderRefreshRate( unsigned int numberOfVSyncsPerRender ) +{ +} + +void Adaptor::SetUseHardwareVSync(bool useHardware) +{ +} + +Adaptor& Adaptor::Get() +{ + return Internal::Adaptor::Adaptor::Get(); +} + +bool Adaptor::IsAvailable() +{ + return false; +} + +void Adaptor::NotifySceneCreated() +{ +} + +void Adaptor::NotifyLanguageChanged() +{ +} + +void Adaptor::SetMinimumPinchDistance(float distance) +{ +} + +void Adaptor::FeedTouchPoint( TouchPoint& point, int timeStamp ) +{ +} + +void Adaptor::FeedWheelEvent( WheelEvent& wheelEvent ) +{ +} + +void Adaptor::FeedKeyEvent( KeyEvent& keyEvent ) +{ +} + +void Adaptor::SceneCreated() +{ +} + +void Adaptor::SetViewMode( ViewMode mode ) +{ +} + +void Adaptor::SetStereoBase( float stereoBase ) +{ +} + +Adaptor::Adaptor() +: mImpl( NULL ) +{ +} + +} // namespace Dali diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-native-image-source.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-native-image-source.cpp new file mode 100755 index 0000000..2277014 --- /dev/null +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-native-image-source.cpp @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2015 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. + * + */ + +// CLASS HEADER +#include + +// EXTERNAL INCLUDES +#include + +namespace Dali +{ + +NativeImageSourcePtr NativeImageSource::New( unsigned int width, unsigned int height, ColorDepth depth ) +{ + Any empty; + NativeImageSourcePtr image = new NativeImageSource( width, height, depth, empty ); + return image; +} + +Any NativeImageSource::GetNativeImageSource() +{ + Any source; + return source; +} + +NativeImageSourcePtr NativeImageSource::New( Any nativeImageSource ) +{ + NativeImageSourcePtr image = new NativeImageSource(0, 0, COLOR_DEPTH_DEFAULT, nativeImageSource); + return image; +} + +bool NativeImageSource::GetPixels( std::vector &pixbuf, unsigned int &width, unsigned int &height, Pixel::Format& pixelFormat ) const +{ + return false; +} + +bool NativeImageSource::EncodeToFile(const std::string& filename) const +{ + return false; +} + +void NativeImageSource::SetSource( Any source ) +{ +} + +bool NativeImageSource::IsColorDepthSupported( ColorDepth colorDepth ) +{ + return false; +} + +bool NativeImageSource::GlExtensionCreate() +{ + return false; +} + +void NativeImageSource::GlExtensionDestroy() +{ +} + +unsigned int NativeImageSource::TargetTexture() +{ + return 0; +} + +void NativeImageSource::PrepareTexture() +{ +} + +unsigned int NativeImageSource::GetWidth() const +{ + return 0; +} + +unsigned int NativeImageSource::GetHeight() const +{ + return 0; +} + +bool NativeImageSource::RequiresBlending() const +{ + return false; +} + +NativeImageInterface::Extension* NativeImageSource::GetExtension() +{ + return NULL; +} + +NativeImageSource::NativeImageSource( unsigned int width, unsigned int height, ColorDepth depth, Any nativeImageSource ) +{ +} + +NativeImageSource::~NativeImageSource() +{ +} + +} // namespace Dali diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-tts-player.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-tts-player.cpp index abd5f1c..6da3d47 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-tts-player.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-tts-player.cpp @@ -80,5 +80,4 @@ TtsPlayer::StateChangedSignalType& TtsPlayer::StateChangedSignal() return mStateChangedSignal; // GetImplementation(*this).StateChangedSignal(); } - } // namespace Dali diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-video-player.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-video-player.cpp new file mode 100644 index 0000000..05e66d8 --- /dev/null +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-video-player.cpp @@ -0,0 +1,218 @@ +/* + * Copyright (c) 2016 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. + * + */ + +// CLASS HEADER +#include "toolkit-video-player.h" + +// EXTERNAL INCLUDES +#include + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + +class VideoPlayer: public Dali::BaseObject +{ +public: + + VideoPlayer() + { + mMuted = false; + mLooping = false; + } + + void SetMuted( bool muted ) + { + mMuted = muted; + } + + bool IsMuted() + { + return mMuted; + } + + void SetLooping( bool looping ) + { + mLooping = looping; + } + + bool IsLooping() + { + return mLooping; + } + +public: + + std::string mUrl; + float mVolumeLeft; + float mVolumeRight; + Dali::VideoPlayerPlugin::VideoPlayerSignalType mFinishedSignal; + +private: + + bool mMuted; + bool mLooping; +}; + +inline VideoPlayer& GetImplementation( Dali::VideoPlayer& player ) +{ + DALI_ASSERT_ALWAYS(player && "VideoPlayer handle is empty"); + BaseObject& handle = player.GetBaseObject(); + return static_cast< Internal::Adaptor::VideoPlayer& >( handle ); +} + +inline const VideoPlayer& GetImplementation( const Dali::VideoPlayer& player ) +{ + DALI_ASSERT_ALWAYS(player && "VideoPlayer handle is empty"); + const BaseObject& handle = player.GetBaseObject(); + return static_cast< const Internal::Adaptor::VideoPlayer& >( handle ); +} + +} // namespace Adaptor + +} // namespace Internal + + +/********************************************************************************/ +/********************************* PUBLIC CLASS *******************************/ +/********************************************************************************/ + +VideoPlayer::VideoPlayer() +{ +} + +VideoPlayer::VideoPlayer( Internal::Adaptor::VideoPlayer* internal ) +: BaseHandle( internal ) +{ +} + +VideoPlayer::~VideoPlayer() +{ +} + +VideoPlayer VideoPlayer::New() +{ + Internal::Adaptor::VideoPlayer* player = new Internal::Adaptor::VideoPlayer(); + + return VideoPlayer( player ); +} + +VideoPlayer::VideoPlayer( const VideoPlayer& player ) +: BaseHandle( player ) +{ +} + +VideoPlayer& VideoPlayer::operator=( const VideoPlayer& player ) +{ + BaseHandle::operator=( player ); + return *this; +} + +VideoPlayer VideoPlayer::DownCast( BaseHandle handle ) +{ + VideoPlayer videoPlayer; + return videoPlayer; +} + +void VideoPlayer::SetUrl( const std::string& url ) +{ + Internal::Adaptor::GetImplementation( *this ).mUrl = url; +} + +std::string VideoPlayer::GetUrl() +{ + return Internal::Adaptor::GetImplementation( *this ).mUrl; +} + +void VideoPlayer::SetLooping(bool looping) +{ + Internal::Adaptor::GetImplementation( *this ).SetLooping( looping ); +} + +bool VideoPlayer::IsLooping() +{ + return Internal::Adaptor::GetImplementation( *this ).IsLooping(); +} + +void VideoPlayer::Play() +{ +} + +void VideoPlayer::Pause() +{ +} + +void VideoPlayer::Stop() +{ +} + +void VideoPlayer::SetMute( bool mute ) +{ + Internal::Adaptor::GetImplementation( *this ).SetMuted( mute ); +} + +bool VideoPlayer::IsMuted() +{ + return Internal::Adaptor::GetImplementation( *this ).IsMuted(); +} + +void VideoPlayer::SetVolume( float left, float right ) +{ + Internal::Adaptor::GetImplementation( *this ).mVolumeLeft = left; + Internal::Adaptor::GetImplementation( *this ).mVolumeRight = right; +} + +void VideoPlayer::GetVolume( float& left, float& right ) +{ + left = Internal::Adaptor::GetImplementation( *this ).mVolumeLeft; + right = Internal::Adaptor::GetImplementation( *this ).mVolumeRight; +} + +void VideoPlayer::SetRenderingTarget( Any target ) +{ +} + +void VideoPlayer::SetPlayPosition( int millisecond ) +{ +} + +int VideoPlayer::GetPlayPosition() +{ + return 0; +} + +void VideoPlayer::SetDisplayRotation( Dali::VideoPlayerPlugin::DisplayRotation rotation ) +{ +} + +Dali::VideoPlayerPlugin::DisplayRotation VideoPlayer::GetDisplayRotation() +{ + return Dali::VideoPlayerPlugin::ROTATION_NONE; +} + +Dali::VideoPlayerPlugin::VideoPlayerSignalType& VideoPlayer::FinishedSignal() +{ + return Internal::Adaptor::GetImplementation( *this ).mFinishedSignal; +} + +} // namespace Dali; + diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-video-player.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-video-player.h new file mode 100644 index 0000000..f33a68c --- /dev/null +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-video-player.h @@ -0,0 +1,105 @@ +#ifndef __DALI_TOOLKIT_VIDEO_PLAYER_H__ +#define __DALI_TOOLKIT_VIDEO_PLAYER_H__ + +/* + * Copyright (c) 2016 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 +#include + +#include + +namespace Dali +{ + +class Any; + +namespace Internal +{ +namespace Adaptor +{ + +class VideoPlayer; + +} +} + +/** + * @brief VideoPlayer class is used for video playback. + * @SINCE_1_1.38 + */ +class VideoPlayer: public BaseHandle +{ +public: + + VideoPlayer(); + + virtual ~VideoPlayer(); + + static VideoPlayer New(); + + VideoPlayer( const VideoPlayer& player ); + + VideoPlayer& operator=( const VideoPlayer& player ); + + static VideoPlayer DownCast( BaseHandle handle ); + + void SetUrl( const std::string& url ); + + std::string GetUrl(); + + void SetLooping(bool looping); + + bool IsLooping(); + + void Play(); + + void Pause(); + + void Stop(); + + void SetMute( bool mute ); + + bool IsMuted(); + + void SetVolume( float left, float right ); + + void GetVolume( float& left, float& right ); + + void SetRenderingTarget( Any target ); + + void SetPlayPosition( int millisecond ); + + int GetPlayPosition(); + + void SetDisplayRotation( Dali::VideoPlayerPlugin::DisplayRotation rotation ); + + Dali::VideoPlayerPlugin::DisplayRotation GetDisplayRotation(); + + Dali::VideoPlayerPlugin::VideoPlayerSignalType& FinishedSignal(); + +private: + + VideoPlayer( Internal::Adaptor::VideoPlayer* internal ); + +}; + +} // namespace Dali; + +#endif + diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Slider.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Slider.cpp index 4025514..15079e2 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Slider.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Slider.cpp @@ -20,7 +20,6 @@ #include #include #include -#include using namespace Dali; using namespace Dali::Toolkit; @@ -140,7 +139,7 @@ int UtcDaliSliderSignals(void) slider.SetProperty( Slider::Property::MARK_TOLERANCE, 0.1f ); slider.ValueChangedSignal().Connect( &OnSliderValueChanged ); - slider.MarkSignal().Connect( &OnSliderMark ); + slider.MarkReachedSignal().Connect( &OnSliderMark ); application.SendNotification(); application.Render(); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-VideoView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-VideoView.cpp new file mode 100644 index 0000000..b64b500 --- /dev/null +++ b/automated-tests/src/dali-toolkit/utc-Dali-VideoView.cpp @@ -0,0 +1,223 @@ +/* + * Copyright (c) 2015 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 +#include +#include +#include +#include + +using namespace Dali; +using namespace Dali::Toolkit; + +namespace +{ +const char* const TEST_FILE( "test.mp4" ); +const char* const VOLUME_LEFT( "volumeLeft" ); +const char* const VOLUME_RIGHT( "volumeRight" ); + +} + +void video_view_startup(void) +{ + test_return_value = TET_UNDEF; +} + +void video_view_cleanup(void) +{ + test_return_value = TET_PASS; +} + +// Negative test case for a method +int UtcDaliVideoViewUninitialized(void) +{ + ToolkitTestApplication application; + tet_infoline(" UtcDaliVideoViewUninitialized"); + + Toolkit::VideoView view; + + try + { + // New() must be called to create a VideoView or it wont be valid. + Actor a = Actor::New(); + view.Add( a ); + DALI_TEST_CHECK( false ); + } + catch (Dali::DaliException& e) + { + // Tests that a negative test of an assertion succeeds + DALI_TEST_PRINT_ASSERT( e ); + DALI_TEST_CHECK(!view); + } + END_TEST; +} + +// Positive test case for a method +int UtcDaliVideoViewNew(void) +{ + ToolkitTestApplication application; + tet_infoline(" UtcDaliVideoViewNew"); + + Toolkit::VideoView view = Toolkit::VideoView::New(); + DALI_TEST_CHECK( view ); + + Toolkit::VideoView view2 = Toolkit::VideoView::New( "" ); + DALI_TEST_CHECK( view2 ); + END_TEST; +} + +// Positive test case for a method +int UtcDaliVideoViewDownCast(void) +{ + ToolkitTestApplication application; + tet_infoline(" UtcDaliVideoViewDownCast"); + + Toolkit::VideoView view = Toolkit::VideoView::New(); + BaseHandle handle(view); + + Toolkit::VideoView view2 = Toolkit::VideoView::DownCast( handle ); + DALI_TEST_CHECK( view ); + DALI_TEST_CHECK( view2 ); + DALI_TEST_CHECK( view == view2 ); + END_TEST; +} + +// Positive test case for a method +int UtcDaliVideoViewProperty1(void) +{ + ToolkitTestApplication application; + tet_infoline(" UtcDaliVideoViewProperty1"); + + Toolkit::VideoView view = Toolkit::VideoView::New(); + DALI_TEST_CHECK( view ); + + std::string file; + view.SetProperty( VideoView::Property::VIDEO, TEST_FILE ); + Property::Value val = view.GetProperty( VideoView::Property::VIDEO ); + DALI_TEST_CHECK( val.Get( file ) ); + DALI_TEST_CHECK( file == TEST_FILE ); + END_TEST; +} + +int UtcDaliVideoViewProperty2(void) +{ + ToolkitTestApplication application; + tet_infoline(" UtcDaliVideoViewProperty2"); + + Toolkit::VideoView view = Toolkit::VideoView::New(); + DALI_TEST_CHECK( view ); + + bool looping; + Property::Value val = view.GetProperty( VideoView::Property::LOOPING ); + DALI_TEST_CHECK( val.Get( looping ) ); + DALI_TEST_CHECK( !looping ); + + view.SetProperty( VideoView::Property::LOOPING, true ); + val = view.GetProperty( VideoView::Property::LOOPING ); + DALI_TEST_CHECK( val.Get( looping ) ); + DALI_TEST_CHECK( looping ); + END_TEST; +} + +int UtcDaliVideoViewProperty3(void) +{ + ToolkitTestApplication application; + tet_infoline(" UtcDaliVideoViewProperty3"); + + Toolkit::VideoView view = Toolkit::VideoView::New(); + DALI_TEST_CHECK( view ); + + bool muted; + Property::Value val = view.GetProperty( VideoView::Property::MUTED ); + DALI_TEST_CHECK( val.Get( muted ) ); + DALI_TEST_CHECK( !muted ); + + view.SetProperty( VideoView::Property::MUTED, true ); + val = view.GetProperty( VideoView::Property::MUTED ); + DALI_TEST_CHECK( val.Get( muted ) ); + DALI_TEST_CHECK( muted ); + END_TEST; +} + +int UtcDaliVideoViewProperty4(void) +{ + ToolkitTestApplication application; + tet_infoline(" UtcDaliVideoViewProperty4"); + + Toolkit::VideoView view = Toolkit::VideoView::New(); + DALI_TEST_CHECK( view ); + + float left, right; + left = right = 0.f; + + Property::Map map; + map.Insert( VOLUME_LEFT, 1.0f ); + map.Insert( VOLUME_RIGHT, 0.5f ); + + Property::Map map2; + view.SetProperty( VideoView::Property::VOLUME, map ); + Property::Value val4 = view.GetProperty( VideoView::Property::VOLUME ); + DALI_TEST_CHECK( val4.Get( map2 ) ); + + Property::Value* volumeLeft = map.Find( VOLUME_LEFT ); + Property::Value* volumeRight = map.Find( VOLUME_RIGHT ); + + DALI_TEST_CHECK( volumeLeft && volumeLeft->Get( left ) ); + DALI_TEST_CHECK( volumeRight && volumeRight->Get( right ) ); + DALI_TEST_CHECK( left == 1.0f ); + DALI_TEST_CHECK( right == 0.5f ); + + END_TEST; +} + +int UtcDaliVideoViewCopyAndAssignment(void) +{ + ToolkitTestApplication application; + + VideoView view = Toolkit::VideoView::New(); + DALI_TEST_CHECK( view ); + + VideoView copy( view ); + DALI_TEST_CHECK( view == copy ); + + VideoView assign; + DALI_TEST_CHECK( !assign ); + + assign = copy; + DALI_TEST_CHECK( assign == view ); + + END_TEST; +} + +int UtcDaliVideoViewTypeRegistry(void) +{ + ToolkitTestApplication application; + + TypeRegistry typeRegistry = TypeRegistry::Get(); + DALI_TEST_CHECK( typeRegistry ); + + TypeInfo typeInfo = typeRegistry.GetTypeInfo( "VideoView" ); + DALI_TEST_CHECK( typeInfo ); + + BaseHandle handle = typeInfo.CreateInstance(); + DALI_TEST_CHECK( handle ); + + VideoView view = VideoView::DownCast( handle ); + DALI_TEST_CHECK( view ); + + END_TEST; +} diff --git a/build/tizen/dali-toolkit/Makefile.am b/build/tizen/dali-toolkit/Makefile.am index 75aa867..2cc6de7 100644 --- a/build/tizen/dali-toolkit/Makefile.am +++ b/build/tizen/dali-toolkit/Makefile.am @@ -101,7 +101,6 @@ develapieffectsviewdir = $(develapicontrolsdir)/effects-view develapimagnifierdir = $(develapicontrolsdir)/magnifier develapirendererfactorydir = $(develapicontrolsdir)/renderer-factory develapipopupdir = $(develapicontrolsdir)/popup -develapisliderdir = $(develapicontrolsdir)/slider develapishadowviewdir = $(develapicontrolsdir)/shadow-view develapisuperblurviewdir = $(develapicontrolsdir)/super-blur-view develapifocusmanagerdir = $(develapidir)/focus-manager @@ -126,7 +125,6 @@ develapirendererfactory_HEADERS = $(devel_api_renderer_factory_header_files) develapiscripting_HEADERS = $(devel_api_scripting_header_files) develapishadowview_HEADERS = $(devel_api_shadow_view_header_files) develapishadereffects_HEADERS = $(devel_api_shader_effects_header_files) -develapislider_HEADERS = $(devel_api_slider_header_files) develapisuperblurview_HEADERS = $(devel_api_super_blur_view_header_files) develapitoolbar_HEADERS = $(devel_api_tool_bar_header_files) develapitransitioneffects_HEADERS = $(devel_api_transition_effects_header_files) @@ -142,6 +140,7 @@ publicapidefaultcontrolsdir = $(publicapicontrolsdir)/default-controls publicapiflexcontainerdir = $(publicapicontrolsdir)/flex-container publicapigaussianblurviewdir = $(publicapicontrolsdir)/gaussian-blur-view publicapiimageviewdir = $(publicapicontrolsdir)/image-view +publicapivideoviewdir = $(publicapicontrolsdir)/video-view publicapimodel3dviewdir = $(publicapicontrolsdir)/model3d-view publicapipageturnviewdir = $(publicapicontrolsdir)/page-turn-view publicapiscrollbardir = $(publicapicontrolsdir)/scroll-bar @@ -153,6 +152,7 @@ publicapitableviewdir = $(publicapicontrolsdir)/table-view publicapitextcontrolsdir = $(publicapicontrolsdir)/text-controls publicapifocusmanagerdir = $(publicapidir)/focus-manager publicapirenderingbackenddir = $(publicapidir)/text +publicapisliderdir = $(publicapicontrolsdir)/slider # public api headers publicapi_HEADERS = $(public_api_header_files) @@ -164,6 +164,7 @@ publicapidefaultcontrols_HEADERS = $(public_api_default_controls_header_fil publicapiflexcontainer_HEADERS = $(public_api_flex_container_header_files) publicapigaussianblurview_HEADERS = $(public_api_gaussian_blur_view_header_files) publicapiimageview_HEADERS = $(public_api_image_view_header_files) +publicapivideoview_HEADERS = $(public_api_video_view_header_files) publicapiitemview_HEADERS = $(public_api_item_view_header_files) publicapimodel3dview_HEADERS = $(public_api_model3d_view_header_files) publicapipageturnview_HEADERS = $(public_api_page_turn_view_header_files) @@ -175,6 +176,7 @@ publicapitableview_HEADERS = $(public_api_table_view_header_files) publicapitextcontrols_HEADERS = $(public_api_text_controls_header_files) publicapifocusmanager_HEADERS = $(public_api_focus_manager_header_files) publicapirenderingbackend_HEADERS = $(public_api_rendering_backend_header_files) +publicapislider_HEADERS = $(public_api_slider_header_files) # package doxygen file (contains doxygen grouping information) packagedoxydir = $(topleveldir)/doc diff --git a/dali-toolkit/dali-toolkit.h b/dali-toolkit/dali-toolkit.h index 1883e2f..1dc6861 100644 --- a/dali-toolkit/dali-toolkit.h +++ b/dali-toolkit/dali-toolkit.h @@ -47,10 +47,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include #include diff --git a/dali-toolkit/devel-api/controls/slider/slider.h b/dali-toolkit/devel-api/controls/slider/slider.h deleted file mode 100644 index 2773be4..0000000 --- a/dali-toolkit/devel-api/controls/slider/slider.h +++ /dev/null @@ -1,167 +0,0 @@ -#ifndef __DALI_TOOLKIT_SLIDER_H__ -#define __DALI_TOOLKIT_SLIDER_H__ - -/* - * Copyright (c) 2015 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. - * - */ - -// INTERNAL INCLUDES -#include - -namespace Dali -{ - -namespace Toolkit -{ - -namespace Internal DALI_INTERNAL -{ -class Slider; -} - -/** - * @brief Slider is a control to enable sliding an indicator between two values - * - * Signals - * | %Signal Name | Method | - * |-------------------|-----------------------------| - * | valueChanged | @ref ValueChangedSignal() | - * | mark | @ref MarkSignal() | - */ -class DALI_IMPORT_API Slider : public Control -{ -public: - - /** - * @brief The start and end property ranges for this control. - */ - enum PropertyRange - { - PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1, - PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserving 1000 property indices - }; - - /** - * @brief An enumeration of properties belonging to the Slider class. - */ - struct Property - { - enum - { - LOWER_BOUND = PROPERTY_START_INDEX, ///< Property, name "lowerBound", type float - UPPER_BOUND, ///< Property, name "upperBound", type float - VALUE, ///< Property, name "value", type float - HIT_REGION, ///< Property, name "hitRegion", type Vector2 - BACKING_REGION, ///< Property, name "backingRegion", type Vector2 - HANDLE_REGION, ///< Property, name "handleRegion", type Vector2 - BACKING_IMAGE_NAME, ///< Property, name "backingImageName", type std::string - HANDLE_IMAGE_NAME, ///< Property, name "handleImageName", type std::string - PROGRESS_IMAGE_NAME, ///< Property, name "progressImageName", type std::string - POPUP_IMAGE_NAME, ///< Property, name "popupImageName", type std::string - POPUP_ARROW_IMAGE_NAME, ///< Property, name "popupArrowImageName", type std::string - DISABLE_COLOR, ///< Property, name "disableColor", type Vector4 - POPUP_TEXT_COLOR, ///< Property, name "popupTextColor", type Vector4 - VALUE_PRECISION, ///< Property, name "valuePrecision", type int - SHOW_POPUP, ///< Property, name "showPopup", type bool - SHOW_VALUE, ///< Property, name "showValue", type bool - ENABLED, ///< Property, name "enabled", type bool - MARKS, ///< Property, name "marks", type Property::Array - SNAP_TO_MARKS, ///< Property, name "snapToMarks", type bool - MARK_TOLERANCE, ///< Property, name "markTolerance", type float - }; - }; - -public: - - /** - * Create the Slider control - * @return A handle to the Slider control. - */ - static Slider New(); - - /** - * Creates an empty Slider handle - */ - Slider(); - - /** - * Copy constructor. Creates another handle that points to the same real object - */ - Slider( const Slider& handle ); - - /** - * Assignment operator. Changes this handle to point to another real object - */ - Slider& operator=( const Slider& handle ); - - /** - * @brief Destructor - * - * This is non-virtual since derived Handle types must not contain data or virtual methods. - */ - ~Slider(); - - /** - * Downcast an Object handle to Slider. If handle points to a Slider the - * downcast produces valid handle. If not the returned handle is left uninitialized. - * @param[in] handle Handle to an object - * @return handle to a Slider or an uninitialized handle - */ - static Slider DownCast( BaseHandle handle ); - -public: - - // Signals - - // Value changed - typedef Signal< bool ( Slider, float ) > ValueChangedSignalType; - typedef Signal< bool ( Slider, int ) > MarkSignalType; - - /** - * Signal emitted when the slider value changes - */ - ValueChangedSignalType& ValueChangedSignal(); - - /** - * Signal emitted when the sliding is finished - */ - ValueChangedSignalType& SlidingFinishedSignal(); - - /** - * Signal emitted when the slider handle reaches a mark - */ - MarkSignalType& MarkSignal(); - -public: // Not intended for application developers - - /** - * Creates a handle using the Toolkit::Internal implementation. - * @param[in] implementation The Control implementation. - */ - DALI_INTERNAL Slider(Internal::Slider& implementation); - - /** - * Allows the creation of this Control from an Internal::CustomActor pointer. - * @param[in] internal A pointer to the internal CustomActor. - */ - explicit DALI_INTERNAL Slider( Dali::Internal::CustomActor* internal ); -}; - -} // namespace Toolkit - -} // namespace Dali - -#endif // __DALI_TOOLKIT_SLIDER_H__ diff --git a/dali-toolkit/devel-api/file.list b/dali-toolkit/devel-api/file.list index e6d9397..cc879a8 100755 --- a/dali-toolkit/devel-api/file.list +++ b/dali-toolkit/devel-api/file.list @@ -13,7 +13,6 @@ devel_api_src_files = \ $(devel_api_src_dir)/controls/renderer-factory/renderer-factory.cpp \ $(devel_api_src_dir)/controls/renderer-factory/control-renderer.cpp \ $(devel_api_src_dir)/controls/shadow-view/shadow-view.cpp \ - $(devel_api_src_dir)/controls/slider/slider.cpp \ $(devel_api_src_dir)/controls/super-blur-view/super-blur-view.cpp \ $(devel_api_src_dir)/controls/text-controls/text-selection-popup.cpp \ $(devel_api_src_dir)/controls/text-controls/text-selection-toolbar.cpp \ @@ -59,9 +58,6 @@ devel_api_renderer_factory_header_files = \ devel_api_shadow_view_header_files = \ $(devel_api_src_dir)/controls/shadow-view/shadow-view.h -devel_api_slider_header_files = \ - $(devel_api_src_dir)/controls/slider/slider.h - devel_api_focus_manager_header_files = \ $(devel_api_src_dir)/focus-manager/keyinput-focus-manager.h diff --git a/dali-toolkit/internal/controls/slider/slider-impl.cpp b/dali-toolkit/internal/controls/slider/slider-impl.cpp index 5cc9b23..9c9965c 100755 --- a/dali-toolkit/internal/controls/slider/slider-impl.cpp +++ b/dali-toolkit/internal/controls/slider/slider-impl.cpp @@ -56,20 +56,15 @@ DALI_TYPE_REGISTRATION_BEGIN( Toolkit::Slider, Toolkit::Control, Create ) DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "lowerBound", FLOAT, LOWER_BOUND ) DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "upperBound", FLOAT, UPPER_BOUND ) DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "value", FLOAT, VALUE ) -DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "hitRegion", VECTOR2, HIT_REGION ) -DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "backingRegion", VECTOR2, BACKING_REGION ) -DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "handleRegion", VECTOR2, HANDLE_REGION ) -DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "backingImageName", STRING, BACKING_IMAGE_NAME ) -DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "handleImageName", STRING, HANDLE_IMAGE_NAME ) -DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "progressImageName", STRING, PROGRESS_IMAGE_NAME ) -DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "popupImageName", STRING, POPUP_IMAGE_NAME ) -DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "popupArrowImageName", STRING, POPUP_ARROW_IMAGE_NAME ) -DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "disableColor", VECTOR4, DISABLE_COLOR ) -DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "popupTextColor", VECTOR4, POPUP_TEXT_COLOR ) +DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "trackVisual", MAP, TRACK_VISUAL ) +DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "handleVisual", MAP, HANDLE_VISUAL ) +DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "progressVisual", MAP, PROGRESS_VISUAL ) +DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "popupVisual", MAP, POPUP_VISUAL ) +DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "popupArrowVisual", MAP, POPUP_ARROW_VISUAL ) +DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "disabledColor", VECTOR4, DISABLED_COLOR ) DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "valuePrecision", INTEGER, VALUE_PRECISION ) DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "showPopup", BOOLEAN, SHOW_POPUP ) DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "showValue", BOOLEAN, SHOW_VALUE ) -DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "enabled", BOOLEAN, ENABLED ) DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "marks", ARRAY, MARKS ) DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "snapToMarks", BOOLEAN, SNAP_TO_MARKS ) DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "markTolerance", FLOAT, MARK_TOLERANCE ) @@ -92,18 +87,17 @@ const float DEFAULT_HIT_HEIGHT = 72.0f; const float DEFAULT_HANDLE_HEIGHT = DEFAULT_HIT_HEIGHT; const float POPUP_TEXT_PADDING = 10.0f; -const char* SKINNED_BACKING_IMAGE_NAME = DALI_IMAGE_DIR "slider-skin.9.png"; -const char* SKINNED_HANDLE_IMAGE_NAME = DALI_IMAGE_DIR "slider-skin-handle.png";; -const char* SKINNED_PROGRESS_IMAGE_NAME = DALI_IMAGE_DIR "slider-skin-progress.9.png"; -const char* SKINNED_POPUP_IMAGE_NAME = DALI_IMAGE_DIR "slider-popup.9.png"; -const char* SKINNED_POPUP_ARROW_IMAGE_NAME = DALI_IMAGE_DIR "slider-popup-arrow.png"; +const char* SKINNED_TRACK_VISUAL = DALI_IMAGE_DIR "slider-skin.9.png"; +const char* SKINNED_HANDLE_VISUAL = DALI_IMAGE_DIR "slider-skin-handle.png"; +const char* SKINNED_PROGRESS_VISUAL = DALI_IMAGE_DIR "slider-skin-progress.9.png"; +const char* SKINNED_POPUP_VISUAL = DALI_IMAGE_DIR "slider-popup.9.png"; +const char* SKINNED_POPUP_ARROW_VISUAL = DALI_IMAGE_DIR "slider-popup-arrow.png"; const Vector2 DEFAULT_HIT_REGION( DEFAULT_WIDTH, DEFAULT_HIT_HEIGHT ); -const Vector2 DEFAULT_BACKING_REGION( DEFAULT_WIDTH, DEFAULT_HEIGHT ); -const Vector2 DEFAULT_HANDLE_REGION( DEFAULT_HANDLE_HEIGHT, DEFAULT_HANDLE_HEIGHT ); +const Vector2 DEFAULT_TRACK_REGION( DEFAULT_WIDTH, DEFAULT_HEIGHT ); +const Vector2 DEFAULT_HANDLE_SIZE( DEFAULT_HANDLE_HEIGHT, DEFAULT_HANDLE_HEIGHT ); -const Vector4 DEFAULT_DISABLE_COLOR( 0.5f, 0.5f, 0.5f, 1.0f ); -const Vector4 DEFAULT_POPUP_TEXT_COLOR( 0.5f, 0.5f, 0.5f, 1.0f ); +const Vector4 DEFAULT_DISABLED_COLOR( 0.5f, 0.5f, 0.5f, 1.0f ); const float VALUE_POPUP_MARGIN = 10.0f; const float VALUE_POPUP_HEIGHT = 81.0f; @@ -143,16 +137,19 @@ Dali::Toolkit::Slider Slider::New() Slider::Slider() : Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS ) ), mState( NORMAL ), - mPopupImageName(""), - mPopupArrowImageName(""), - mBackingImageName(""), - mHandleImageName(""), - mProgressImageName(""), - mDisableColor( 0.0f, 0.0f, 0.0f, 0.0f ), - mPopupTextColor( 0.0f, 0.0f, 0.0f, 0.0f ), + mPopupVisual(""), + mPopupArrowVisual(""), + mTrackVisual(""), + mHandleVisual(""), + mProgressVisual(""), + mPopupMap(), + mTrackMap(), + mHandleMap(), + mPopupArrowMap(), + mDisabledColor( 0.0f, 0.0f, 0.0f, 0.0f ), mHitRegion( 0.0f, 0.0f ), - mBackingRegion( 0.0f, 0.0f ), - mHandleRegionSize( 0.0f, 0.0f ), + mTrackRegion( 0.0f, 0.0f ), + mHandleSize( 0.0f, 0.0f ), mLowerBound( 0.0f ), mUpperBound( 0.0f ), mValue( 0.0f ), @@ -177,22 +174,20 @@ void Slider::OnInitialize() Actor self = Self(); SetHitRegion( DEFAULT_HIT_REGION ); - SetBackingRegion( DEFAULT_BACKING_REGION ); - SetHandleRegion( DEFAULT_HANDLE_REGION ); + SetTrackRegion( DEFAULT_TRACK_REGION ); + SetHandleSize( DEFAULT_HANDLE_SIZE ); - SetBackingImageName( SKINNED_BACKING_IMAGE_NAME ); - SetHandleImageName( SKINNED_HANDLE_IMAGE_NAME ); - SetProgressImageName( SKINNED_PROGRESS_IMAGE_NAME ); - SetPopupImageName( SKINNED_POPUP_IMAGE_NAME ); - SetPopupArrowImageName( SKINNED_POPUP_ARROW_IMAGE_NAME ); - - SetPopupTextColor( DEFAULT_POPUP_TEXT_COLOR ); + SetTrackVisual( SKINNED_TRACK_VISUAL ); + SetHandleVisual( SKINNED_HANDLE_VISUAL ); + SetProgressVisual( SKINNED_PROGRESS_VISUAL ); + SetPopupVisual( SKINNED_POPUP_VISUAL ); + SetPopupArrowVisual( SKINNED_POPUP_ARROW_VISUAL ); SetShowPopup( DEFAULT_SHOW_POPUP ); SetShowValue( DEFAULT_SHOW_VALUE ); SetEnabled( DEFAULT_ENABLED ); - SetDisableColor( DEFAULT_DISABLE_COLOR ); + SetDisabledColor( DEFAULT_DISABLED_COLOR ); SetSnapToMarks( DEFAULT_SNAP_TO_MARKS ); SetMarkTolerance( MARK_SNAP_TOLERANCE ); @@ -210,9 +205,9 @@ void Slider::OnInitialize() void Slider::OnSizeSet( const Vector3& size ) { - // Factor in handle overshoot into size of backing + // Factor in handle overshoot into size of track SetHitRegion( Vector2( size.x, GetHitRegion().y ) ); - SetBackingRegion( Vector2( size.x - GetHandleRegion().x, GetBackingRegion().y ) ); + SetTrackRegion( Vector2( size.x - GetHandleSize().x, GetTrackRegion().y ) ); } bool Slider::OnTouchEvent(Actor actor, const TouchEvent& event) @@ -326,7 +321,7 @@ void Slider::DisplayValue( float value, bool raiseSignals ) // Progress bar if( mProgress ) { - mProgress.SetSize( x, GetBackingRegion().y ); + mProgress.SetSize( x, GetTrackRegion().y ); } // Signals @@ -338,7 +333,7 @@ void Slider::DisplayValue( float value, bool raiseSignals ) int markIndex; if( MarkReached( percent, markIndex ) ) { - mMarkSignal.Emit( self, markIndex ); + mMarkReachedSignal.Emit( self, markIndex ); } } @@ -382,27 +377,66 @@ Actor Slider::CreateHitRegion() return hitRegion; } -Toolkit::ImageView Slider::CreateBacking() +Toolkit::ImageView Slider::CreateTrack() { - Toolkit::ImageView backing = Toolkit::ImageView::New(); - backing.SetParentOrigin( ParentOrigin::CENTER ); - backing.SetAnchorPoint( AnchorPoint::CENTER ); + Toolkit::ImageView track = Toolkit::ImageView::New(); + track.SetParentOrigin( ParentOrigin::CENTER ); + track.SetAnchorPoint( AnchorPoint::CENTER ); - return backing; + return track; } -void Slider::SetBackingImageName( const std::string& imageName ) +void Slider::SetTrackVisual( const std::string& filename ) { - if( mBacking && ( imageName.size() > 0 ) ) + if( mHandle && ( filename.size() > 0 ) ) { - mBacking.SetImage( imageName ); - mBackingImageName = imageName; + mTrack.SetImage( filename ); + mTrackVisual = filename; } } -std::string Slider::GetBackingImageName() +void Slider::SetTrackVisual( Property::Map map ) { - return mBackingImageName; + Property::Value* imageValue = map.Find( "url" ); + if( imageValue ) + { + mTrackVisual.clear(); + std::string filename; + if( imageValue->Get( filename ) ) + { + if( mTrack && ( filename.size() > 0 ) ) + { + mTrack.SetImage( filename ); + mTrackMap = map; + } + } + } + + Property::Value* sizeValue = map.Find( "size" ); + if( sizeValue ) + { + Vector2 size; + if( sizeValue->Get( size ) ) + { + mTrackRegion = size; + if( mTrack ) + { + mTrack.SetSize( mTrackRegion ); + } + + ResizeProgressRegion( Vector2( 0.0f, mTrackRegion.y ) ); + + mDomain = CalcDomain( mTrackRegion ); + + // Set the progress bar to correct width + DisplayValue( GetValue(), false ); + } + } +} + +std::string Slider::GetTrackVisual() +{ + return mTrackVisual; } Toolkit::ImageView Slider::CreateProgress() @@ -414,54 +448,108 @@ Toolkit::ImageView Slider::CreateProgress() return progress; } -void Slider::SetProgressImageName( const std::string& imageName ) +void Slider::SetProgressVisual( const std::string& filename ) { - if( mProgress && ( imageName.size() > 0 ) ) + if( mProgress && ( filename.size() > 0 ) ) { - mProgress.SetImage( imageName ); - mProgressImageName = imageName; + mProgress.SetImage( filename ); + mProgressVisual = filename; } } -std::string Slider::GetProgressImageName() +void Slider::SetProgressVisual( Property::Map map ) { - return mProgressImageName; + Property::Value* imageValue = map.Find( "url" ); + if( imageValue ) + { + mProgressVisual.clear(); + std::string filename; + if( imageValue->Get( filename ) ) + { + if( mProgress && ( filename.size() > 0 ) ) + { + mProgress.SetImage( filename ); + mProgressMap = map; + } + } + } } -void Slider::SetPopupImageName( const std::string& imageName ) +std::string Slider::GetProgressVisual() { - mPopupImageName = imageName; + return mProgressVisual; } -std::string Slider::GetPopupImageName() +void Slider::SetPopupVisual( const std::string& filename ) { - return mPopupImageName; + mPopupVisual = filename; } -void Slider::CreatePopupImage( const std::string& imageName ) +void Slider::SetPopupVisual( Property::Map map ) { - if( mPopup && ( imageName.size() > 0 ) ) + Property::Value* imageValue = map.Find( "url" ); + if( imageValue ) { - Image image = ResourceImage::New( imageName ); + mPopupVisual.clear(); + std::string filename; + if( imageValue->Get( filename ) ) + { + if( mPopup && ( filename.size() > 0 ) ) + { + mPopup.SetImage( filename ); + mPopupMap = map; + } + } + } +} + +std::string Slider::GetPopupVisual() +{ + return mPopupVisual; +} + +void Slider::CreatePopupImage( const std::string& filename ) +{ + if( mPopup && ( filename.size() > 0 ) ) + { + Image image = ResourceImage::New( filename ); mPopup.SetImage( image ); } } -void Slider::SetPopupArrowImageName( const std::string& imageName ) +void Slider::SetPopupArrowVisual( const std::string& filename ) { - mPopupArrowImageName = imageName; + mPopupArrowVisual = filename; } -std::string Slider::GetPopupArrowImageName() +void Slider::SetPopupArrowVisual( Property::Map map ) { - return mPopupArrowImageName; + Property::Value* imageValue = map.Find( "url" ); + if( imageValue ) + { + mPopupArrowVisual.clear(); + std::string filename; + if( imageValue->Get( filename ) ) + { + if( mPopupArrow && ( filename.size() > 0 ) ) + { + mPopupArrow.SetImage( filename ); + mPopupArrowMap = map; + } + } + } } -void Slider::CreatePopupArrowImage( const std::string& imageName ) +std::string Slider::GetPopupArrowVisual() { - if( mPopupArrow && ( imageName.size() > 0 ) ) + return mPopupArrowVisual; +} + +void Slider::CreatePopupArrowImage( const std::string& filename ) +{ + if( mPopupArrow && ( filename.size() > 0 ) ) { - Image image = ResourceImage::New( imageName ); + Image image = ResourceImage::New( filename ); mPopupArrow.SetImage( image ); } } @@ -500,7 +588,6 @@ Toolkit::TextLabel Slider::CreatePopupText() textLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); textLabel.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); textLabel.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); - textLabel.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, DEFAULT_POPUP_TEXT_COLOR ); textLabel.SetPadding( Padding( POPUP_TEXT_PADDING, POPUP_TEXT_PADDING, 0.0f, 0.0f ) ); return textLabel; } @@ -518,25 +605,58 @@ Toolkit::ImageView Slider::CreatePopup() return popup; } -void Slider::SetHandleImageName( const std::string& imageName ) +void Slider::SetHandleVisual( const std::string& filename ) +{ + if( mHandle && ( filename.size() > 0 ) ) + { + mHandle.SetImage( filename ); + mHandleVisual = filename; + } +} + +void Slider::SetHandleVisual( Property::Map map ) { - if( mHandle && ( imageName.size() > 0 ) ) + Property::Value* imageValue = map.Find( "url" ); + if( imageValue ) { - mHandle.SetImage( imageName ); - mHandleImageName = imageName; + mHandleVisual.clear(); + std::string filename; + if( imageValue->Get( filename ) ) + { + if( mHandle && ( filename.size() > 0 ) ) + { + mHandle.SetImage( filename ); + mHandleMap = map; + } + } + } + + Property::Value* sizeValue = map.Find( "size" ); + if( sizeValue ) + { + Vector2 size; + if( sizeValue->Get( size ) ) + { + mHandleSize = size; + ResizeHandleSize( mHandleSize ); + + Vector2 hitRegion = GetHitRegion(); + hitRegion.x += mHandleSize.x; + SetHitRegion( hitRegion ); + } } } -std::string Slider::GetHandleImageName() +std::string Slider::GetHandleVisual() { - return mHandleImageName; + return mHandleVisual; } -void Slider::ResizeHandleRegion( const Vector2& region ) +void Slider::ResizeHandleSize( const Vector2& size ) { if( mHandle ) { - mHandle.SetSize( region ); + mHandle.SetSize( size ); } } @@ -558,11 +678,6 @@ void Slider::DestroyHandleValueDisplay() UnparentAndReset(mHandleValueTextLabel); } -void Slider::SetPopupTextColor( const Vector4& color ) -{ - mPopupTextColor = color; -} - Actor Slider::CreateValueDisplay() { Actor popup = Actor::New(); @@ -589,9 +704,9 @@ Toolkit::Slider::ValueChangedSignalType& Slider::SlidingFinishedSignal() return mSlidingFinishedSignal; } -Toolkit::Slider::MarkSignalType& Slider::MarkSignal() +Toolkit::Slider::MarkReachedSignalType& Slider::MarkReachedSignal() { - return mMarkSignal; + return mMarkReachedSignal; } void Slider::UpdateSkin() @@ -600,17 +715,17 @@ void Slider::UpdateSkin() { case NORMAL: { - mBacking.SetColor( Color::WHITE ); + mTrack.SetColor( Color::WHITE ); mHandle.SetColor( Color::WHITE ); mProgress.SetColor( Color::WHITE ); break; } case DISABLED: { - Vector4 disableColor = GetDisableColor(); - mBacking.SetColor( disableColor ); - mHandle.SetColor( disableColor ); - mProgress.SetColor( disableColor ); + Vector4 disabledColor = GetDisabledColor(); + mTrack.SetColor( disabledColor ); + mHandle.SetColor( disabledColor ); + mProgress.SetColor( disabledColor ); break; } case PRESSED: @@ -635,13 +750,13 @@ void Slider::CreateChildren() mPanDetector.DetectedSignal().Connect( this, &Slider::OnPan ); self.Add( mHitArea ); - // Background - mBacking = CreateBacking(); - self.Add( mBacking ); + // Track + mTrack = CreateTrack(); + self.Add( mTrack ); // Progress bar mProgress = CreateProgress(); - mBacking.Add( mProgress ); + mTrack.Add( mProgress ); // Handle mHandle = CreateHandle(); @@ -671,8 +786,8 @@ void Slider::AddPopup() mValueDisplay.SetVisible( false ); mHandle.Add( mValueDisplay ); - CreatePopupImage( GetPopupImageName() ); - CreatePopupArrowImage( GetPopupArrowImageName() ); + CreatePopupImage( GetPopupVisual() ); + CreatePopupArrowImage( GetPopupArrowVisual() ); mValueTimer = Timer::New( VALUE_VIEW_SHOW_DURATION ); mValueTimer.TickSignal().Connect( this, &Slider::HideValueView ); @@ -822,58 +937,53 @@ float Slider::GetValue() const return mValue; } -void Slider::SetBackingRegion( const Vector2& region ) +void Slider::SetTrackRegion( const Vector2& region ) { - mBackingRegion = region; + mTrackRegion = region; - if( mBacking ) + if( mTrack ) { - mBacking.SetSize( mBackingRegion ); + mTrack.SetSize( mTrackRegion ); } - ResizeProgressRegion( Vector2( 0.0f, mBackingRegion.y ) ); + ResizeProgressRegion( Vector2( 0.0f, mTrackRegion.y ) ); - mDomain = CalcDomain( mBackingRegion ); + mDomain = CalcDomain( mTrackRegion ); DisplayValue( GetValue(), false ); // Set the progress bar to correct width } -const Vector2& Slider::GetBackingRegion() const +const Vector2& Slider::GetTrackRegion() const { - return mBackingRegion; + return mTrackRegion; } -void Slider::SetHandleRegion( const Vector2& region ) +void Slider::SetHandleSize( const Vector2& size ) { - mHandleRegionSize = region; + mHandleSize = size; - ResizeHandleRegion( mHandleRegionSize ); + ResizeHandleSize( mHandleSize ); Vector2 hitRegion = GetHitRegion(); - hitRegion.x += mHandleRegionSize.x; + hitRegion.x += mHandleSize.x; SetHitRegion( hitRegion ); } -const Vector2& Slider::GetHandleRegion() const +const Vector2& Slider::GetHandleSize() const { - return mHandleRegionSize; + return mHandleSize; } -void Slider::SetDisableColor( const Vector4& color ) +void Slider::SetDisabledColor( const Vector4& color ) { - mDisableColor = color; + mDisabledColor = color; UpdateSkin(); } -Vector4 Slider::GetDisableColor() const +Vector4 Slider::GetDisabledColor() const { - return mDisableColor; -} - -Vector4 Slider::GetPopupTextColor() const -{ - return mPopupTextColor; + return mDisabledColor; } void Slider::SetValuePrecision( int precision ) @@ -968,7 +1078,7 @@ bool Slider::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tr } else if( 0 == strcmp( signalName.c_str(), SIGNAL_MARK ) ) { - slider.MarkSignal().Connect( tracker, functor ); + slider.MarkReachedSignal().Connect( tracker, functor ); } else { @@ -1026,63 +1136,67 @@ void Slider::SetProperty( BaseObject* object, Property::Index propertyIndex, con break; } - case Toolkit::Slider::Property::HIT_REGION: - { - sliderImpl.SetHitRegion( value.Get< Vector2 >() ); - break; - } - - case Toolkit::Slider::Property::BACKING_REGION: + case Toolkit::Slider::Property::TRACK_VISUAL: { - sliderImpl.SetBackingRegion( value.Get< Vector2 >() ); - break; - } - - case Toolkit::Slider::Property::HANDLE_REGION: - { - sliderImpl.SetHandleRegion( value.Get< Vector2 >() ); + Property::Map map; + if( value.Get( map ) ) + { + sliderImpl.SetTrackVisual( map ); + } break; } - case Toolkit::Slider::Property::BACKING_IMAGE_NAME: + case Toolkit::Slider::Property::HANDLE_VISUAL: { - sliderImpl.SetBackingImageName( value.Get< std::string >() ); + Property::Map map; + if( value.Get( map ) ) + { + sliderImpl.SetHandleVisual( map ); + } break; } - case Toolkit::Slider::Property::HANDLE_IMAGE_NAME: + case Toolkit::Slider::Property::PROGRESS_VISUAL: { - sliderImpl.SetHandleImageName( value.Get< std::string >() ); + Property::Map map; + if( value.Get( map ) ) + { + sliderImpl.SetProgressVisual( map ); + } break; } - case Toolkit::Slider::Property::PROGRESS_IMAGE_NAME: + case Toolkit::Slider::Property::POPUP_VISUAL: { - sliderImpl.SetProgressImageName( value.Get< std::string >() ); - break; - } + std::string imageUrl; + if( value.Get( imageUrl ) ) + { + sliderImpl.SetPopupVisual( imageUrl ); + } - case Toolkit::Slider::Property::POPUP_IMAGE_NAME: - { - sliderImpl.SetPopupImageName( value.Get< std::string >() ); - break; - } + // If it is not a string, then get a Property::Map from the property if possible. + Property::Map map; + if( value.Get( map ) ) + { + sliderImpl.SetPopupVisual( map ); + } - case Toolkit::Slider::Property::POPUP_ARROW_IMAGE_NAME: - { - sliderImpl.SetPopupArrowImageName( value.Get< std::string >() ); break; } - case Toolkit::Slider::Property::DISABLE_COLOR: + case Toolkit::Slider::Property::POPUP_ARROW_VISUAL: { - sliderImpl.SetDisableColor( value.Get< Vector4 >() ); + Property::Map map; + if( value.Get( map ) ) + { + sliderImpl.SetPopupArrowVisual( map ); + } break; } - case Toolkit::Slider::Property::POPUP_TEXT_COLOR: + case Toolkit::Slider::Property::DISABLED_COLOR: { - sliderImpl.SetPopupTextColor( value.Get< Vector4 >() ); + sliderImpl.SetDisabledColor( value.Get< Vector4 >() ); break; } @@ -1104,12 +1218,6 @@ void Slider::SetProperty( BaseObject* object, Property::Index propertyIndex, con break; } - case Toolkit::Slider::Property::ENABLED: - { - sliderImpl.SetEnabled( value.Get< bool >() ); - break; - } - case Toolkit::Slider::Property::MARKS: { sliderImpl.SetMarks( value.Get< Property::Array >() ); @@ -1161,63 +1269,74 @@ Property::Value Slider::GetProperty( BaseObject* object, Property::Index propert break; } - case Toolkit::Slider::Property::HIT_REGION: - { - value = sliderImpl.GetHitRegion(); - break; - } - - case Toolkit::Slider::Property::BACKING_REGION: + case Toolkit::Slider::Property::TRACK_VISUAL: { - value = sliderImpl.GetBackingRegion(); - break; - } - - case Toolkit::Slider::Property::HANDLE_REGION: - { - value = sliderImpl.GetHandleRegion(); - break; - } - - case Toolkit::Slider::Property::BACKING_IMAGE_NAME: - { - value = sliderImpl.GetBackingImageName(); - break; - } - - case Toolkit::Slider::Property::HANDLE_IMAGE_NAME: - { - value = sliderImpl.GetHandleImageName(); + if( !sliderImpl.mTrackVisual.empty() ) + { + value = sliderImpl.GetTrackVisual(); + } + else if( !sliderImpl.mTrackMap.Empty() ) + { + value = sliderImpl.mTrackMap; + } break; } - case Toolkit::Slider::Property::PROGRESS_IMAGE_NAME: + case Toolkit::Slider::Property::HANDLE_VISUAL: { - value = sliderImpl.GetProgressImageName(); + if( !sliderImpl.mHandleVisual.empty() ) + { + value = sliderImpl.GetHandleVisual(); + } + else if( !sliderImpl.mHandleMap.Empty() ) + { + value = sliderImpl.mHandleMap; + } break; } - case Toolkit::Slider::Property::POPUP_IMAGE_NAME: + case Toolkit::Slider::Property::PROGRESS_VISUAL: { - value = sliderImpl.GetPopupImageName(); + if( !sliderImpl.mProgressVisual.empty() ) + { + value = sliderImpl.GetProgressVisual(); + } + else if( !sliderImpl.mProgressMap.Empty() ) + { + value = sliderImpl.mProgressMap; + } break; } - case Toolkit::Slider::Property::POPUP_ARROW_IMAGE_NAME: + case Toolkit::Slider::Property::POPUP_VISUAL: { - value = sliderImpl.GetPopupArrowImageName(); + if( !sliderImpl.mPopupVisual.empty() ) + { + value = sliderImpl.GetPopupVisual(); + } + else if( !sliderImpl.mPopupMap.Empty() ) + { + value = sliderImpl.mPopupMap; + } break; } - case Toolkit::Slider::Property::DISABLE_COLOR: + case Toolkit::Slider::Property::POPUP_ARROW_VISUAL: { - value = sliderImpl.GetDisableColor(); + if( !sliderImpl.mPopupArrowVisual.empty() ) + { + value = sliderImpl.GetPopupArrowVisual(); + } + else if( !sliderImpl.mPopupArrowMap.Empty() ) + { + value = sliderImpl.mPopupArrowMap; + } break; } - case Toolkit::Slider::Property::POPUP_TEXT_COLOR: + case Toolkit::Slider::Property::DISABLED_COLOR: { - value = sliderImpl.GetPopupTextColor(); + value = sliderImpl.GetDisabledColor(); break; } @@ -1239,12 +1358,6 @@ Property::Value Slider::GetProperty( BaseObject* object, Property::Index propert break; } - case Toolkit::Slider::Property::ENABLED: - { - value = sliderImpl.IsEnabled(); - break; - } - case Toolkit::Slider::Property::MARKS: { // TODO: Need to be able to return a PropertyArray diff --git a/dali-toolkit/internal/controls/slider/slider-impl.h b/dali-toolkit/internal/controls/slider/slider-impl.h index c9fdc60..acc7494 100755 --- a/dali-toolkit/internal/controls/slider/slider-impl.h +++ b/dali-toolkit/internal/controls/slider/slider-impl.h @@ -21,10 +21,11 @@ // EXTERNAL INCLUDES #include #include +#include // INTERNAL INCLUDES #include -#include +#include #include #include @@ -120,39 +121,32 @@ public: const Vector2& GetHitRegion() const; /** - * Set backing region + * Set the track region * - * @param[in] region The backing region + * @param[in] region The track region */ - void SetBackingRegion( const Vector2& region ); + void SetTrackRegion( const Vector2& region ); /** - * Get backing region + * Get the track region * - * @return The backing region + * @return The track region */ - const Vector2& GetBackingRegion() const; + const Vector2& GetTrackRegion() const; /** - * @brief Set the disable color. + * @brief Set the disabled color. * - * @param[in] color The disable color. + * @param[in] color The disabled color. */ - void SetDisableColor( const Vector4& color ); + void SetDisabledColor( const Vector4& color ); /** - * @brief Get disable color + * @brief Get disabled color * - * @return The disable color + * @return The disabled color */ - Vector4 GetDisableColor() const; - - /** - * Get popup text color - * - * @return The popup text color - */ - Vector4 GetPopupTextColor() const; + Vector4 GetDisabledColor() const; /** * Set the value precision to be used for numbers in the slider @@ -241,9 +235,9 @@ public: Toolkit::Slider::ValueChangedSignalType& SlidingFinishedSignal(); /** - * @copydoc Toolkit::Slider::MarkSignal() + * @copydoc Toolkit::Slider::MarkReachedSignal() */ - Toolkit::Slider::MarkSignalType& MarkSignal(); + Toolkit::Slider::MarkReachedSignalType& MarkReachedSignal(); /** * Connects a callback function with the object's signals. @@ -396,16 +390,16 @@ private: Actor CreateHitRegion(); /** - * Create the backing for the slider + * Create the track for the slider * - * @return The backing actor + * @return The track actor */ - Toolkit::ImageView CreateBacking(); + Toolkit::ImageView CreateTrack(); /** - * Create the progress backing for the slider + * Create the progress track for the slider * - * @return The backing actor + * @return The track actor */ Toolkit::ImageView CreateProgress(); @@ -512,74 +506,102 @@ private: void DisplayValue( float value, bool raiseSignals ); /** - * Create the image for the backing + * Create the image for the track + * + * @param[in] filename The track image + */ + void SetTrackVisual( const std::string& filename ); + + /** + * @brief Set the track visual from an Dali::Property::Map * - * @param[in] imageName The name of the image to load and set + * @param[in] map The Dali::Property::Map to use for to display */ - void SetBackingImageName( const std::string& imageName ); + void SetTrackVisual( Dali::Property::Map map ); /** - * @brief Return the backing image file name. + * @brief Return the track image. * - * @return The backing image file name. + * @return The track image. */ - std::string GetBackingImageName(); + std::string GetTrackVisual(); /** * Create the image for the progress bar * - * @param[in] imageName The name of the image to load and set + * @param[in] filename The progress bar image */ - void SetProgressImageName( const std::string& imageName ); + void SetProgressVisual( const std::string& filename ); /** - * @brief Return the progress image name. + * @brief Set the progress visual from an Dali::Property::Map * - * @return The progress image name if it exists. + * @param[in] map The Dali::Property::Map to use for to display */ - std::string GetProgressImageName(); + void SetProgressVisual( Dali::Property::Map map ); + + /** + * @brief Return the progress bar image. + * + * @return The progress bar image if it exists. + */ + std::string GetProgressVisual(); /** * @brief Create the image for the popup * - * @param[in] imageName The name of the image to load and set + * @param[in] filename The popup image + */ + void CreatePopupImage( const std::string& filename ); + + /** + * @brief Set the popup image + * + * @param[in] filename The popup image to set + */ + void SetPopupVisual( const std::string& filename ); + + /** + * @brief Set the popup from an Dali::Property::Map + * + * @param[in] map The Dali::Property::Map to use for to display */ - void CreatePopupImage( const std::string& imageName ); + void SetPopupVisual( Dali::Property::Map map ); /** - * @brief Set the popup name + * @brief Return the popup image. * - * @param[in] imageName The name of the image to set + * @return The popup image if it exists. */ - void SetPopupImageName( const std::string& imageName ); + std::string GetPopupVisual(); /** - * @brief Return the popup image name. + * @brief Set the popup arrow image * - * @return The name of the popup image if it exists. + * @param[in] filename The popup arrow image to set */ - std::string GetPopupImageName(); + void SetPopupArrowVisual( const std::string& filename ); /** - * @brief Set the popup arrow image name + * @brief Set the popup arrow from an Dali::Property::Map * - * @param[in] imageName The name of the image to set + * @param[in] map The Dali::Property::Map to use for to display */ - void SetPopupArrowImageName( const std::string& imageName ); + void SetPopupArrowVisual( Dali::Property::Map map ); /** - * @brief Return the popup arrow image name. + * @brief Return the popup arrow image. * - * @return The name of the popup image if it exists. + * @return The popup arrow image if it exists. */ - std::string GetPopupArrowImageName(); + std::string GetPopupArrowVisual(); /** * Create the image for the popup arrow * - * @param[in] imageName The name of the image to load and set + * @param[in] filename The popup arrow image to load and set */ - void CreatePopupArrowImage( const std::string& imageName ); + void CreatePopupArrowImage( const std::string& filename ); /** * Set the size of the progress bar region @@ -591,23 +613,30 @@ private: /** * Create the image for the handle * - * @param[in] imageName The name of the image to load and set + * @param[in] filename The handle image */ - void SetHandleImageName( const std::string& imageName ); + void SetHandleVisual( const std::string& filename ); /** - * @brief Return the handle image name. + * @brief Set the handle visual from an Dali::Property::Map * - * @return The name of the image handle if it exists. + * @param[in] map The Dali::Property::Map to use for to display */ - std::string GetHandleImageName(); + void SetHandleVisual( Property::Map map ); /** - * Set the size of the handle region + * @brief Return the handle image. * - * @param[in] region The size of the region to set + * @return The handle image if it exists. */ - void ResizeHandleRegion( const Vector2& region ); + std::string GetHandleVisual(); + + /** + * Reset the size of the handle + * + * @param[in] size The size of the handle to set + */ + void ResizeHandleSize( const Vector2& size ); /** * Create and display the value on the handle @@ -620,25 +649,18 @@ private: void DestroyHandleValueDisplay(); /** - * Update the color of the popup text + * Set the size of the handle * - * @param[in] color The new color + * @param[in] size The handle size */ - void SetPopupTextColor( const Vector4& color ); + void SetHandleSize( const Vector2& size ); /** - * Set handle region + * Get the size of the handle * - * @param[in] region The handle region + * @return The handle size */ - void SetHandleRegion( const Vector2& region ); - - /** - * Get handle region - * - * @return The handle region - */ - const Vector2& GetHandleRegion() const; + const Vector2& GetHandleSize() const; /** * Set the lower bound of the slider's value @@ -682,9 +704,9 @@ private: Actor mHitArea; ///< The input handler Actor mValueDisplay; ///< Display of the value - Toolkit::ImageView mBacking; ///< Backing image + Toolkit::ImageView mTrack; ///< Track image Toolkit::ImageView mHandle; ///< Slider handle - Toolkit::ImageView mProgress; ///< Progress backing + Toolkit::ImageView mProgress; ///< Progress bar Toolkit::ImageView mPopup; ///< Popup backing Toolkit::ImageView mPopupArrow; ///< Popup arrow backing @@ -693,9 +715,9 @@ private: Vector2 mHandleLastTouchPoint; ///< The last touch point for the handle Timer mValueTimer; ///< Timer used to hide value view - Toolkit::Slider::ValueChangedSignalType mValueChangedSignal; ///< Signal emitted when the value is changed + Toolkit::Slider::ValueChangedSignalType mValueChangedSignal; ///< Signal emitted when the value is changed Toolkit::Slider::ValueChangedSignalType mSlidingFinishedSignal; ///< Signal emitted when a sliding is finished - Toolkit::Slider::MarkSignalType mMarkSignal; ///< Signal emitted when a mark is reached + Toolkit::Slider::MarkReachedSignalType mMarkReachedSignal; ///< Signal emitted when a mark is reached SliderState mState; ///< The state of the slider @@ -703,18 +725,23 @@ private: MarkList mMarks; ///< List of discreet marks - std::string mPopupImageName; ///< Image name for popup image - std::string mPopupArrowImageName; ///< Image name for popup arrow - std::string mBackingImageName; ///< Image name for backing image - std::string mHandleImageName; ///< Image name for handle image - std::string mProgressImageName; ///< Image name for progress image + std::string mPopupVisual; ///< Image for popup image + std::string mPopupArrowVisual; ///< Image for popup arrow image + std::string mTrackVisual; ///< Image for track image + std::string mHandleVisual; ///< Image for handle image + std::string mProgressVisual; ///< Image for progress bar image + + Property::Map mPopupMap; ///< the Property::Map if the image came from a Property::Map, empty otherwise + Property::Map mTrackMap; ///< the Property::Map if the image came from a Property::Map, empty otherwise + Property::Map mHandleMap; ///< the Property::Map if the image came from a Property::Map, empty otherwise + Property::Map mProgressMap; ///< the Property::Map if the image came from a Property::Map, empty otherwise + Property::Map mPopupArrowMap; ///< the Property::Map if the image came from a Property::Map, empty otherwise - Vector4 mDisableColor; ///< The color to tint the slider when disabled - Vector4 mPopupTextColor; ///< The color of the popup text + Vector4 mDisabledColor; ///< The color to tint the slider when disabled Vector2 mHitRegion; ///< Size of hit region - Vector2 mBackingRegion; ///< Size of backing region - Vector2 mHandleRegionSize; ///< Size of the handle region + Vector2 mTrackRegion; ///< Size of track region + Vector2 mHandleSize; ///< Size of the handle float mLowerBound; ///< Lower bound on value float mUpperBound; ///< Upper bound on value diff --git a/dali-toolkit/internal/controls/video-view/video-view-impl.cpp b/dali-toolkit/internal/controls/video-view/video-view-impl.cpp new file mode 100644 index 0000000..28cb38a --- /dev/null +++ b/dali-toolkit/internal/controls/video-view/video-view-impl.cpp @@ -0,0 +1,560 @@ +/* + * Copyright (c) 2016 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. + * + */ + +// CLASS HEADER +#include "video-view-impl.h" + +// EXTERNAL INCLUDES +#include +#include +#include +#include +#include +#include +#include + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +namespace Toolkit +{ + +namespace Internal +{ + +namespace +{ + +BaseHandle Create() +{ + return Toolkit::VideoView::New(); +} + +DALI_TYPE_REGISTRATION_BEGIN( Toolkit::VideoView, Toolkit::Control, Create ); + +DALI_PROPERTY_REGISTRATION( Toolkit, VideoView, "video", MAP, VIDEO ) +DALI_PROPERTY_REGISTRATION( Toolkit, VideoView, "looping", BOOLEAN, LOOPING ) +DALI_PROPERTY_REGISTRATION( Toolkit, VideoView, "muted", BOOLEAN, MUTED ) +DALI_PROPERTY_REGISTRATION( Toolkit, VideoView, "volume", MAP, VOLUME ) + +DALI_SIGNAL_REGISTRATION( Toolkit, VideoView, "finished", FINISHED_SIGNAL ) + +DALI_ACTION_REGISTRATION( Toolkit, VideoView, "play", ACTION_VIDEOVIEW_PLAY ) +DALI_ACTION_REGISTRATION( Toolkit, VideoView, "pause", ACTION_VIDEOVIEW_PAUSE ) +DALI_ACTION_REGISTRATION( Toolkit, VideoView, "stop", ACTION_VIDEOVIEW_STOP ) +DALI_ACTION_REGISTRATION( Toolkit, VideoView, "forward", ACTION_VIDEOVIEW_FORWARD ) +DALI_ACTION_REGISTRATION( Toolkit, VideoView, "backward", ACTION_VIDEOVIEW_BACKWARD ) + +DALI_TYPE_REGISTRATION_END() + +const char* const VOLUME_LEFT( "volumeLeft" ); +const char* const VOLUME_RIGHT( "volumeRight" ); +const char* const RENDERING_TARGET( "RENDERING_TARGET" ); +const char* const WINDOW_SURFACE_TARGET( "windowSurfaceTarget" ); +const char* const NATIVE_IMAGE_TARGET( "nativeImageTarget" ); + +} // anonymous namepsace + +VideoView::VideoView() +: Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ), + mCurrentVideoPlayPosition( 0 ), + mSetRenderingTarget( false ), + mIsPlay( false ), + mIsPause( false ) +{ + mVideoPlayer = Dali::VideoPlayer::New(); +} + +VideoView::~VideoView() +{ +} + +Toolkit::VideoView VideoView::New() +{ + VideoView* impl = new VideoView(); + Toolkit::VideoView handle = Toolkit::VideoView( *impl ); + + impl->Initialize(); + + return handle; +} + +void VideoView::SetUrl( const std::string& url ) +{ + if( mUrl != url || !mPropertyMap.Empty() ) + { + mPropertyMap.Clear(); + + mUrl = url; + } + + if( mSetRenderingTarget ) + { + mVideoPlayer.SetUrl( mUrl ); + } + else + { + SetNativeImageTarget(); + } +} + +void VideoView::SetPropertyMap( Property::Map map ) +{ + mPropertyMap = map; + + Actor self = Self(); + Toolkit::RendererFactory::Get().ResetRenderer( mRenderer, self, mPropertyMap ); + + Property::Value* widthValue = mPropertyMap.Find( "width" ); + if( widthValue ) + { + int width; + if( widthValue->Get( width ) ) + { + mVideoSize = ImageDimensions( width, mVideoSize.GetHeight() ); + } + } + + Property::Value* heightValue = mPropertyMap.Find( "height" ); + if( heightValue ) + { + int height; + if( heightValue->Get( height ) ) + { + mVideoSize = ImageDimensions( mVideoSize.GetWidth(), height ); + } + } + + RelayoutRequest(); +} + +std::string VideoView::GetUrl() +{ + return mUrl; +} + +void VideoView::SetLooping(bool looping) +{ + mVideoPlayer.SetLooping( looping ); +} + +bool VideoView::IsLooping() +{ + return mVideoPlayer.IsLooping(); +} + +void VideoView::Play() +{ + mVideoPlayer.Play(); + mIsPlay = true; + mIsPause = false; +} + +void VideoView::Pause() +{ + mVideoPlayer.Pause(); + mIsPlay = false; + mIsPause = true; +} + +void VideoView::Stop() +{ + mVideoPlayer.Stop(); + mIsPlay = false; + mIsPause = false; +} + +void VideoView::Forward( int millisecond ) +{ + int curPos = mVideoPlayer.GetPlayPosition(); + + int nextPos = curPos + millisecond; + + mVideoPlayer.SetPlayPosition( nextPos ); +} + +void VideoView::Backward( int millisecond ) +{ + int curPos = mVideoPlayer.GetPlayPosition(); + + int nextPos = curPos - millisecond; + nextPos = ( nextPos < 0 )? 0: nextPos; + + mVideoPlayer.SetPlayPosition( nextPos ); +} + +void VideoView::SetMute( bool mute ) +{ + mVideoPlayer.SetMute( mute ); +} + +bool VideoView::IsMuted() +{ + return mVideoPlayer.IsMuted(); +} + +void VideoView::SetVolume( float left, float right ) +{ + mVideoPlayer.SetVolume( left, right ); +} + +void VideoView::GetVolume( float& left, float& right ) +{ + mVideoPlayer.GetVolume( left, right ); +} + +Dali::Toolkit::VideoView::VideoViewSignalType& VideoView::FinishedSignal() +{ + return mFinishedSignal; +} + +void VideoView::EmitSignalFinish() +{ + if ( !mFinishedSignal.Empty() ) + { + Dali::Toolkit::VideoView handle( GetOwner() ); + mFinishedSignal.Emit( handle ); + } +} + +bool VideoView::DoAction( BaseObject* object, const std::string& actionName, const Property::Map& attributes ) +{ + bool ret = false; + + Dali::BaseHandle handle( object ); + Toolkit::VideoView videoView = Toolkit::VideoView::DownCast( handle ); + + if( !videoView ) + { + return ret; + } + + VideoView& impl = GetImpl( videoView ); + + if( strcmp( actionName.c_str(), ACTION_VIDEOVIEW_PLAY ) == 0 ) + { + impl.Play(); + ret = true; + } + else if( strcmp( actionName.c_str(), ACTION_VIDEOVIEW_PAUSE ) == 0 ) + { + impl.Pause(); + ret = true; + } + else if( strcmp( actionName.c_str(), ACTION_VIDEOVIEW_STOP ) == 0 ) + { + impl.Stop(); + ret = true; + } + else if( strcmp( actionName.c_str(), ACTION_VIDEOVIEW_FORWARD ) == 0 ) + { + int millisecond = 0; + if( attributes["videoForward"].Get( millisecond ) ) + { + impl.Forward( millisecond ); + ret = true; + } + } + else if( strcmp( actionName.c_str(), ACTION_VIDEOVIEW_BACKWARD ) == 0 ) + { + int millisecond = 0; + if( attributes["videoBackward"].Get( millisecond ) ) + { + impl.Backward( millisecond ); + ret = true; + } + } + + return ret; +} + +bool VideoView::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ) +{ + Dali::BaseHandle handle( object ); + + bool connected( true ); + Toolkit::VideoView videoView = Toolkit::VideoView::DownCast( handle ); + + if( 0 == strcmp( signalName.c_str(), FINISHED_SIGNAL ) ) + { + videoView.FinishedSignal().Connect( tracker, functor ); + } + else + { + // signalName does not match any signal + connected = false; + } + + return connected; +} + +void VideoView::SetProperty( BaseObject* object, Property::Index index, const Property::Value& value ) +{ + Toolkit::VideoView videoView = Toolkit::VideoView::DownCast( Dali::BaseHandle( object ) ); + + if( videoView ) + { + VideoView& impl = GetImpl( videoView ); + + switch( index ) + { + case Toolkit::VideoView::Property::VIDEO: + { + std::string videoUrl; + if( value.Get( videoUrl ) ) + { + impl.SetUrl( videoUrl ); + } + + Property::Map map; + if( value.Get( map ) ) + { + impl.SetPropertyMap( map ); + + Property::Value* target = map.Find( RENDERING_TARGET ); + std::string targetType; + if( target && target->Get( targetType ) && targetType == WINDOW_SURFACE_TARGET ) + { + impl.SetWindowSurfaceTarget(); + } + else if( target && target->Get( targetType ) && targetType == NATIVE_IMAGE_TARGET ) + { + impl.SetNativeImageTarget(); + } + } + break; + } + case Toolkit::VideoView::Property::LOOPING: + { + bool looping; + if( value.Get( looping ) ) + { + impl.SetLooping( looping ); + } + break; + } + case Toolkit::VideoView::Property::MUTED: + { + bool mute; + if( value.Get( mute ) ) + { + impl.SetMute( mute ); + } + break; + } + case Toolkit::VideoView::Property::VOLUME: + { + Property::Map map; + float left, right; + if( value.Get( map ) ) + { + Property::Value* volumeLeft = map.Find( VOLUME_LEFT ); + Property::Value* volumeRight = map.Find( VOLUME_RIGHT ); + if( volumeLeft && volumeLeft->Get( left ) && volumeRight && volumeRight->Get( right ) ) + { + impl.SetVolume( left, right ); + } + } + break; + } + } + } +} + +Property::Value VideoView::GetProperty( BaseObject* object, Property::Index propertyIndex ) +{ + Property::Value value; + Toolkit::VideoView videoView = Toolkit::VideoView::DownCast( Dali::BaseHandle( object ) ); + + if( videoView ) + { + VideoView& impl = GetImpl( videoView ); + + switch( propertyIndex ) + { + case Toolkit::VideoView::Property::VIDEO: + { + if( !impl.mUrl.empty() ) + { + value = impl.mUrl; + } + else if( !impl.mPropertyMap.Empty() ) + { + value = impl.mPropertyMap; + } + break; + } + case Toolkit::VideoView::Property::LOOPING: + { + value = impl.IsLooping(); + break; + } + case Toolkit::VideoView::Property::MUTED: + { + value = impl.IsMuted(); + break; + } + case Toolkit::VideoView::Property::VOLUME: + { + Property::Map map; + float left, right; + + impl.GetVolume( left, right ); + map.Insert( VOLUME_LEFT, left ); + map.Insert( VOLUME_RIGHT, right ); + value = map; + break; + } + } + } + + return value; +} + +void VideoView::SetDepthIndex( int depthIndex ) +{ + if( mRenderer ) + { + mRenderer.SetDepthIndex( depthIndex ); + } +} + +void VideoView::OnStageConnection( int depth ) +{ + Control::OnStageConnection( depth ); + + if( mRenderer ) + { + CustomActor self = Self(); + mRenderer.SetOnStage( self ); + } +} + +void VideoView::OnStageDisconnection() +{ + if( mRenderer ) + { + CustomActor self = Self(); + mRenderer.SetOffStage( self ); + } + + Control::OnStageDisconnection(); +} + +Vector3 VideoView::GetNaturalSize() +{ + Vector3 size; + size.x = mVideoSize.GetWidth(); + size.y = mVideoSize.GetHeight(); + + if( size.x > 0 && size.y > 0 ) + { + size.z = std::min( size.x, size.y ); + return size; + } + else + { + return Control::GetNaturalSize(); + } +} + +float VideoView::GetHeightForWidth( float width ) +{ + if( mVideoSize.GetWidth() > 0 && mVideoSize.GetHeight() > 0 ) + { + return GetHeightForWidthBase( width ); + } + else + { + return Control::GetHeightForWidthBase( width ); + } +} + +float VideoView::GetWidthForHeight( float height ) +{ + if( mVideoSize.GetWidth() > 0 && mVideoSize.GetHeight() > 0 ) + { + return GetWidthForHeightBase( height ); + } + else + { + return Control::GetWidthForHeightBase( height ); + } +} + +void VideoView::SetWindowSurfaceTarget() +{ + Actor self = Self(); + int curPos = mVideoPlayer.GetPlayPosition(); + + mSetRenderingTarget = true; + mRenderer.RemoveAndReset( self ); + + mVideoPlayer.SetRenderingTarget( Dali::Adaptor::Get().GetNativeWindowHandle() ); + mVideoPlayer.SetUrl( mUrl ); + mVideoPlayer.FinishedSignal().Connect( this, &VideoView::EmitSignalFinish ); + + if( mIsPlay ) + { + mVideoPlayer.Play(); + } + if( mIsPause ) + { + mVideoPlayer.Play(); + mVideoPlayer.Pause(); + } + mVideoPlayer.SetPlayPosition( curPos ); +} + +void VideoView::SetNativeImageTarget() +{ + Actor self = Self(); + int curPos = mVideoPlayer.GetPlayPosition(); + + mSetRenderingTarget = true; + + Any source; + Dali::NativeImageSourcePtr nativeImageSourcePtr = Dali::NativeImageSource::New( source ); + mNativeImage = Dali::NativeImage::New( *nativeImageSourcePtr ); + + mVideoPlayer.SetRenderingTarget( nativeImageSourcePtr ); + mVideoPlayer.SetUrl( mUrl ); + mVideoPlayer.FinishedSignal().Connect( this, &VideoView::EmitSignalFinish ); + + Toolkit::RendererFactory::Get().ResetRenderer( mRenderer, self, mNativeImage ); + + if( mIsPlay ) + { + mVideoPlayer.Play(); + } + + if( mIsPause ) + { + mVideoPlayer.Play(); + mVideoPlayer.Pause(); + } + mVideoPlayer.SetPlayPosition( curPos ); +} + +} // namespace Internal + +} // namespace Toolkit + +} // namespace Dali diff --git a/dali-toolkit/internal/controls/video-view/video-view-impl.h b/dali-toolkit/internal/controls/video-view/video-view-impl.h new file mode 100644 index 0000000..309a237 --- /dev/null +++ b/dali-toolkit/internal/controls/video-view/video-view-impl.h @@ -0,0 +1,274 @@ +#ifndef __DALI_TOOLKIT_INTERNAL_VIDEO_VIEW_H__ +#define __DALI_TOOLKIT_INTERNAL_VIDEO_VIEW_H__ + +/* + * Copyright (c) 2016 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 +#include +#include + +// INTERNAL INCLUDES +#include +#include +#include + +namespace Dali +{ + +namespace Toolkit +{ + +class VideoView; + +namespace Internal +{ + +class VideoView: public Control +{ +protected: + + VideoView(); + + virtual ~VideoView(); + +public: + + /** + * @copydoc Toolkit::VideoView::New() + */ + static Toolkit::VideoView New(); + + /** + * @brief Sets a video url to play. + * + * @SINCE_1_1.38 + * @param [in] url The url of the video resource to play + */ + void SetUrl( const std::string& url ); + + /** + * @brief Returns a video url. + * @SINCE_1_1.38 + * @return Url of string type + */ + std::string GetUrl(); + + /** + * @brief Sets the player looping status. + * + * @SINCE_1_1.38 + * @param [in] looping The new looping status: true or false + */ + void SetLooping(bool looping); + + /** + * @brief Returns the player looping status. + * + * @SINCE_1_1.38 + * @return True if player is looping, false otherwise. + */ + bool IsLooping(); + + /** + * @copydoc Toolkit::VideoView::Play() + */ + void Play(); + + /** + * @copydoc Toolkit::VideoView::Pause() + */ + void Pause(); + + /** + * @copydoc Toolkit::VideoView::Stop() + */ + void Stop(); + + /** + * @copydoc Toolkit::VideoView::Forward() + */ + void Forward( int millisecond ); + + /** + * @copydoc Toolkit::VideoView::Backward() + */ + void Backward( int millisecond ); + + /** + * @brief Sets the player mute status. + * @SINCE_1_1.38 + * @param[i] mute The new mute status, true is mute. + */ + void SetMute( bool mute ); + + /** + * @brief Returns the player mute status. + * @SINCE_1_1.38 + * @return True if player is mute. + */ + bool IsMuted(); + + /** + * @brief Sets the player volume. + * @SINCE_1_1.38 + * @param[in] left The left volume scalar + * @param[in] right The right volume scalar + */ + void SetVolume( float left, float right ); + + /** + * @brief Returns current volume factor. + * @SINCE_1_1.38 + * @param[out] left The current left volume scalar + * @param[out] right The current right volume scalar + */ + void GetVolume( float& left, float& right ); + + /** + * @copydoc Dali::Toolkit::VideoView::FinishedSignal() + */ + Dali::Toolkit::VideoView::VideoViewSignalType& FinishedSignal(); + + /** + * @brief Emit the finished signal + */ + void EmitSignalFinish(); + + /** + * @brief Set property map + * @SINCE_1_1.38 + * @param[in] map The Dali::Property::Map to use for to display. + */ + void SetPropertyMap( Property::Map map ); + + // Properties + /** + * @brief Called when a property of an object of this type is set. + * @SINCE_1_1.38 + * @param[in] object The object whose property is set. + * @param[in] index The property index. + * @param[in] value The new property value. + */ + static void SetProperty( BaseObject* object, Property::Index index, const Property::Value& value ); + + /** + * @brief Called to retrieve a property of an object of this type. + * @SINCE_1_1.38 + * @param[in] object The object whose property is to be retrieved. + * @param[in] index The property index. + * @return The current value of the property. + */ + static Property::Value GetProperty( BaseObject* object, Property::Index propertyIndex ); + + /** + * @brief Set the depth index of this image renderer + * + * Renderer with higher depth indices are rendered in front of other renderers with smaller values + * @SINCE_1_1.38 + * @param[in] depthIndex The depth index of this renderer + */ + void SetDepthIndex( int depthIndex ); + + + /** + * @brief Performs actions as requested using the action name. + * @SINCE_1_1.38 + * @param[in] object The object on which to perform the action. + * @param[in] actionName The action to perform. + * @param[in] attributes The attributes with which to perfrom this action. + * @return True if action has been accepted by this control + */ + static bool DoAction( BaseObject* object, const std::string& actionName, const Property::Map& attributes ); + + static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ); + +private: // From Control + + /** + * @copydoc Toolkit::Control::OnStageConnect() + */ + virtual void OnStageConnection( int depth ); + + /** + * @copydoc Toolkit::Control::OnStageDisconnection() + */ + virtual void OnStageDisconnection(); + + /** + * @copydoc Toolkit::Control::GetNaturalSize + */ + virtual Vector3 GetNaturalSize(); + + /** + * @copydoc Toolkit::Control::GetHeightForWidth() + */ + virtual float GetHeightForWidth( float width ); + + /** + * @copydoc Toolkit::Control::GetWidthForHeight() + */ + virtual float GetWidthForHeight( float height ); + +private: + + // Undefined + VideoView( const VideoView& videoView ); + + VideoView& operator=( const VideoView& videoView ); + + void SetWindowSurfaceTarget(); + + void SetNativeImageTarget(); + +private: + + Dali::VideoPlayer mVideoPlayer; + Dali::ImageDimensions mVideoSize; + Toolkit::ControlRenderer mRenderer; + Dali::Property::Map mPropertyMap; + Dali::NativeImage mNativeImage; ///< Native image handle for video rendering by texture streaming + Dali::Toolkit::VideoView::VideoViewSignalType mFinishedSignal; + std::string mUrl; + int mCurrentVideoPlayPosition; + bool mSetRenderingTarget; + bool mIsPlay; + bool mIsPause; +}; + +} // namespace Internal + +inline Toolkit::Internal::VideoView& GetImpl( Toolkit::VideoView& handle ) +{ + DALI_ASSERT_ALWAYS( handle ); + Dali::RefObject& impl = handle.GetImplementation(); + return static_cast< Toolkit::Internal::VideoView& >( impl ); +} + +inline const Toolkit::Internal::VideoView& GetImpl( const Toolkit::VideoView& handle ) +{ + DALI_ASSERT_ALWAYS( handle ); + const Dali::RefObject& impl = handle.GetImplementation(); + return static_cast< const Toolkit::Internal::VideoView& >( impl ); +} + +} // namespace Toolkit + +} // namespace Dali + +#endif // __DALI_TOOLKIT_VIDEO_VIEW_H__ diff --git a/dali-toolkit/internal/file.list b/dali-toolkit/internal/file.list index fd19920..f9edbdd 100644 --- a/dali-toolkit/internal/file.list +++ b/dali-toolkit/internal/file.list @@ -73,6 +73,7 @@ toolkit_src_files = \ $(toolkit_src_dir)/controls/text-controls/text-selection-popup-impl.cpp \ $(toolkit_src_dir)/controls/text-controls/text-selection-toolbar-impl.cpp \ $(toolkit_src_dir)/controls/tool-bar/tool-bar-impl.cpp \ + $(toolkit_src_dir)/controls/video-view/video-view-impl.cpp \ $(toolkit_src_dir)/accessibility-manager/accessibility-manager-impl.cpp \ \ $(toolkit_src_dir)/feedback/feedback-style.cpp \ diff --git a/dali-toolkit/devel-api/controls/slider/slider.cpp b/dali-toolkit/public-api/controls/slider/slider.cpp similarity index 79% rename from dali-toolkit/devel-api/controls/slider/slider.cpp rename to dali-toolkit/public-api/controls/slider/slider.cpp index a220dee..8aa47d0 100644 --- a/dali-toolkit/devel-api/controls/slider/slider.cpp +++ b/dali-toolkit/public-api/controls/slider/slider.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 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. @@ -15,7 +15,10 @@ * */ -#include +// CLASS HEADER +#include + +// INTERNAL INCLUDES #include using namespace Dali; @@ -26,10 +29,6 @@ namespace Dali namespace Toolkit { -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Slider -/////////////////////////////////////////////////////////////////////////////////////////////////// - Slider::Slider() { } @@ -78,9 +77,9 @@ Slider::ValueChangedSignalType& Slider::SlidingFinishedSignal() return GetImpl( *this ).SlidingFinishedSignal(); } -Slider::MarkSignalType& Slider::MarkSignal() +Slider::MarkReachedSignalType& Slider::MarkReachedSignal() { - return GetImpl( *this ).MarkSignal(); + return GetImpl( *this ).MarkReachedSignal(); } Slider Slider::DownCast( BaseHandle handle ) diff --git a/dali-toolkit/public-api/controls/slider/slider.h b/dali-toolkit/public-api/controls/slider/slider.h new file mode 100644 index 0000000..8ba6139 --- /dev/null +++ b/dali-toolkit/public-api/controls/slider/slider.h @@ -0,0 +1,291 @@ +#ifndef __DALI_TOOLKIT_SLIDER_H__ +#define __DALI_TOOLKIT_SLIDER_H__ + +/* + * Copyright (c) 2016 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. + * + */ + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +namespace Toolkit +{ + +namespace Internal DALI_INTERNAL +{ +class Slider; +} +/** + * @addtogroup dali_toolkit_controls_slider + * @{ + */ + +/** + * @brief Slider is a control to enable sliding an indicator between two values + * + * Signals + * | %Signal Name | Method | + * |-------------------|-------------------------------| + * | valueChanged | @ref ValueChangedSignal() | + * | markReached | @ref MarkReachedSignal() | + * | slidingFinished | @ref SlidingFinishedSignal() | + * @SINCE_1_1.39 + */ +class DALI_IMPORT_API Slider : public Control +{ +public: + + // Properties + + /** + * @brief The start and end property ranges for this control. + * @SINCE_1_1.39 + */ + enum PropertyRange + { + PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1, ///< @SINCE_1_1.39 + PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserve property indices @SINCE_1_1.39 + }; + + /** + * @brief An enumeration of properties belonging to the Slider class. + * @SINCE_1_1.39 + */ + struct Property + { + enum + { + + /** + * @brief name "lowerBound", type float + * @SINCE_1_1.39 + */ + LOWER_BOUND = PROPERTY_START_INDEX, + + /** + * @brief name "upperBound", type float + * @SINCE_1_1.39 + */ + UPPER_BOUND, + + /** + * @brief name "value", type float + * @SINCE_1_1.39 + */ + VALUE, + + /** + * @brief name "trackVisual", type string if it is a url, map otherwise + * @SINCE_1_1.39 + */ + TRACK_VISUAL, + + /** + * @brief name "handleVisual", type string if it is a url, map otherwise + * @SINCE_1_1.39 + */ + HANDLE_VISUAL, + + /** + * @brief name "progressVisual", type string if it is a url, map otherwise + * @SINCE_1_1.39 + */ + PROGRESS_VISUAL, + + /** + * @brief name "popupVisual", type string if it is a url, map otherwise + * @SINCE_1_1.39 + */ + POPUP_VISUAL, + + /** + * @brief name "popupArrowVisual", type string if it is a url, map otherwise + * @SINCE_1_1.39 + */ + POPUP_ARROW_VISUAL, + + /** + * @brief name "disabledColor", type Vector4 + * @SINCE_1_1.39 + */ + DISABLED_COLOR, + + /** + * @brief name "valuePrecision", type int + * @SINCE_1_1.39 + */ + VALUE_PRECISION, + + /** + * @brief name "showPopup", type bool + * @SINCE_1_1.39 + */ + SHOW_POPUP, + + /** + * @brief name "showValue", type bool + * @SINCE_1_1.39 + */ + SHOW_VALUE, + + /** + * @brief name "marks", type Property::Array + * @SINCE_1_1.39 + */ + MARKS, + + /** + * @brief name "snapToMarks", type bool + * @SINCE_1_1.39 + */ + SNAP_TO_MARKS, + + /** + * @brief name "markTolerance", type float + * @SINCE_1_1.39 + */ + MARK_TOLERANCE, + }; + }; + +public: + + /** + * @brief Creates the Slider control. + * @SINCE_1_1.39 + * @return A handle to the Slider control + */ + static Slider New(); + + /** + * @brief Creates an empty Slider handle. + * @SINCE_1_1.39 + */ + Slider(); + + /** + * @brief Copy constructor. + * + * Creates another handle that points to the same real object. + * @SINCE_1_1.39 + */ + Slider( const Slider& handle ); + + /** + * @brief Assignment operator. + * + * Changes this handle to point to another real object. + * @SINCE_1_1.39 + */ + Slider& operator=( const Slider& handle ); + + /** + * @brief Destructor. + * + * This is non-virtual since derived Handle types must not contain data or virtual methods. + * @SINCE_1_1.39 + */ + ~Slider(); + + /** + * @brief Downcast an Object handle to Slider. + * + * If handle points to a Slider the + * downcast produces valid handle. If not the returned handle is left uninitialized. + * @SINCE_1_1.39 + * @param[in] handle Handle to an object + * @return handle to a Slider or an uninitialized handle + */ + static Slider DownCast( BaseHandle handle ); + +public: // Signals + + /** + * @brief Value changed signal type. + * @SINCE_1_1.39 + */ + typedef Signal< bool ( Slider, float ) > ValueChangedSignalType; + + /** + * @brief Mark reached signal type. + * @SINCE_1_1.39 + */ + typedef Signal< bool ( Slider, int ) > MarkReachedSignalType; + + /** + * @brief Signal emitted when the slider value changes. + * + * A callback of the following type may be connected: + * @code + * bool YourCallbackName( Slider slider, float value ); + * @endcode + * @SINCE_1_1.39 + * @return The signal to connect to + */ + ValueChangedSignalType& ValueChangedSignal(); + + /** + * @brief Signal emitted when the sliding is finished. + * + * A callback of the following type may be connected: + * @code + * bool YourCallbackName( Slider slider, float value ); + * @endcode + * @SINCE_1_1.39 + * @return The signal to connect to + */ + ValueChangedSignalType& SlidingFinishedSignal(); + + /** + * @brief Signal emitted when the slider handle reaches a mark. + * + * A callback of the following type may be connected: + * @code + * bool YourCallbackName( Slider slider, int value ); + * @endcode + * @SINCE_1_1.39 + * @return The signal to connect to + */ + MarkReachedSignalType& MarkReachedSignal(); + +public: // Not intended for application developers + + /** + * @brief Creates a handle using the Toolkit::Internal implementation. + * @SINCE_1_1.39 + * @param[in] implementation The Control implementation + */ + DALI_INTERNAL Slider(Internal::Slider& implementation); + + /** + * @brief Allows the creation of this Control from an Internal::CustomActor pointer. + * @SINCE_1_1.39 + * @param[in] internal A pointer to the internal CustomActor + */ + explicit DALI_INTERNAL Slider( Dali::Internal::CustomActor* internal ); +}; + +/** + * @} + */ +} // namespace Toolkit + +} // namespace Dali + +#endif // __DALI_TOOLKIT_SLIDER_H__ diff --git a/dali-toolkit/public-api/controls/video-view/video-view.cpp b/dali-toolkit/public-api/controls/video-view/video-view.cpp new file mode 100644 index 0000000..7a0aa1d --- /dev/null +++ b/dali-toolkit/public-api/controls/video-view/video-view.cpp @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2016 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. + * + */ + +// CLASS HEADER +#include + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +namespace Toolkit +{ + +VideoView::VideoView() +{ +} + +VideoView::VideoView( const VideoView& videoView ) +: Control( videoView ) +{ +} + +VideoView& VideoView::operator=( const VideoView& videoView ) +{ + if( &videoView != this ) + { + Control::operator=( videoView ); + } + + return *this; +} + +VideoView::~VideoView() +{ +} + +VideoView VideoView::New() +{ + return Internal::VideoView::New(); +} + +VideoView VideoView::New( const std::string& url ) +{ + VideoView videoView = Internal::VideoView::New(); + Dali::Toolkit::GetImpl( videoView ).SetUrl( url ); + return videoView; +} + +VideoView VideoView::DownCast( BaseHandle handle ) +{ + return Control::DownCast< VideoView, Internal::VideoView >( handle ); +} + +void VideoView::Play() +{ + Dali::Toolkit::GetImpl( *this ).Play(); +} + +void VideoView::Pause() +{ + Dali::Toolkit::GetImpl( *this ).Pause(); +} + +void VideoView::Stop() +{ + Dali::Toolkit::GetImpl( *this ).Stop(); +} + +void VideoView::Forward( int millisecond ) +{ + Dali::Toolkit::GetImpl( *this ).Forward( millisecond ); +} + +void VideoView::Backward( int millisecond ) +{ + Dali::Toolkit::GetImpl( *this ).Backward( millisecond ); +} + +VideoView::VideoViewSignalType& VideoView::FinishedSignal() +{ + return Dali::Toolkit::GetImpl( *this ).FinishedSignal(); +} + +VideoView::VideoView( Internal::VideoView& implementation ) +: Control( implementation ) +{ +} + +VideoView::VideoView( Dali::Internal::CustomActor* internal ) +: Control( internal ) +{ + VerifyCustomActorPointer< Internal::VideoView >( internal ); +} + +} // namespace Toolkit + +} // namespace Dali diff --git a/dali-toolkit/public-api/controls/video-view/video-view.h b/dali-toolkit/public-api/controls/video-view/video-view.h new file mode 100644 index 0000000..e519db1 --- /dev/null +++ b/dali-toolkit/public-api/controls/video-view/video-view.h @@ -0,0 +1,238 @@ +#ifndef __DALI_TOOLKIT_VIDEO_VIEW_H__ +#define __DALI_TOOLKIT_VIDEO_VIEW_H__ + +/* + * Copyright (c) 2016 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. + * + */ + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +namespace Toolkit +{ + +namespace Internal DALI_INTERNAL +{ + class VideoView; +} // namespace Internal + +/** + * @addtogroup dali_toolkit_controls_video_view + * @{ + */ + +/** + * @brief VideoView is a control for video playback and display. + * + * For working VideoView, a video plugin for a platform should be provided. + * + * Signals + * | %Signal Name | Method | + * |---------------|-------------------------| + * | finished | @ref FinishedSignal() | + * @SINCE_1_1.38 + * + * Actions + * | %Action Name | Attributes | Description | + * |-----------------|----------------------------------------------------|---------------------------------------------------------| + * | videoPlay | Doesn't have attributes | Plays video. See @ref DoAction() | + * | videoPause | Doesn't have attributes | Pauses video. See @ref DoAction() | + * | videoStop | Doesn't have attributes | Stops video. See @ref DoAction() | + * | videoForward | The position ( millisecond ) for forward playback | Sets forward position for playback. See @ref DoAction() | + * | videoBackward | The position ( millisecond ) for backward playback | Sets backward position for playback. See @ref DoAction()| + * @SINCE_1_1.38 + * + */ +class DALI_IMPORT_API VideoView: public Control +{ +public: + + // Signal + typedef Signal< void (VideoView&) > VideoViewSignalType; ///< Video playback finished signal type @ SINCE_1_1.38 + + enum PropertyRange + { + PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1, ///< @SINCE_1_0.0 + }; + + struct Property + { + enum + { + /** + * @brief name "video", video file url as string type or Property::Map + * @SINCE_1_1.38 + */ + VIDEO = PROPERTY_START_INDEX, + + /** + * @brief name "looping", looping status, true or false + * @SINCE_1_1.38 + */ + LOOPING, + + /** + * @brief name "muted", mute status, true or false + * @SINCE_1_1.38 + */ + MUTED, + + /** + * @brief name "volume", left and right volume scalar as float type, Property::Map with two values ( "left" and "right" ) + * @SINCE_1_1.38 + */ + VOLUME + }; + }; + +public: + + /** + * @brief Creates an initialized VideoView. + * @SINCE_1_1.38 + * @return A handle to a newly allocated Dali ImageView + * + * @note VideoView will not display anything + */ + static VideoView New(); + + /** + * @brief Creates an initialized VideoView. + * If the string is empty, VideoView will not display anything + * + * @SINCE_1_1.38 + * @param[in] url The url of the video resource to display + * @return A handle to a newly allocated Dali VideoView + */ + static VideoView New( const std::string& url ); + + /** + * @brief Create an uninitialized VideoView + * @SINCE_1_1.38 + */ + VideoView(); + + /** + * @brief Destructor + * + * This is non-virtual since derived Handel types must not contain data or virtual methods + * @SINCE_1_1.38 + */ + ~VideoView(); + + /* + * @brief Copy constructor + * + * @SINCE_1_1.38 + * @param[in] videoView VideoView to copy. The copied VideoView will point at the same implementation + */ + VideoView( const VideoView& videoView ); + + /** + * @brief Assignment operator. + * + * @SINCE_1_1.38 + * @param[in] videoView The VideoView to assign from. + * @return The updated VideoView. + */ + VideoView& operator=( const VideoView& videoView ); + + /** + * @brief Downcast a handle to VideoView handle. + * + * If handle points to a VideoView the downcast produces valid + * handle. If not the returned handle is left uninitialized. + * + * @SINCE_1_1.38 + * @param[in] handle Handle to an object + * @return handle to a VideoView or an uninitialized handle + */ + static VideoView DownCast( BaseHandle handle ); + + /** + * @brief Starts the video playback. + * @SINCE_1_1.38 + */ + void Play(); + + /** + * @brief Pauses the video playback. + * @SINCE_1_1.38 + */ + void Pause(); + + /** + * @brief Stops the video playback. + * @SINCE_1_1.38 + */ + void Stop(); + + /** + * @brief Seeks forward by the specified number of milliseconds. + * + * @SINCE_1_1.38 + * @param[in] millisecond The position for forward playback + */ + void Forward( int millisecond ); + + /** + * @brief Seeks backward by the specified number of milliseconds. + * + * @SINCE_1_1.38 + * @param[in] millisecond The position for backward playback + */ + void Backward( int millisecond ); + + /** + * @brief Connect to this signal to be notified when a video playback have finished. + * + * @SINCE_1_1.38 + * @return A signal object to connect with. + */ + VideoViewSignalType& FinishedSignal(); + +public: // Not intended for application developers + + /** + * @brief Creates a handle using the Toolkit::Internal implementation. + * + * @SINCE_1_1.38 + * @param[in] implementation The VideoView implementation. + */ + DALI_INTERNAL VideoView( Internal::VideoView& implementation ); + + /** + * @brief Allows the creation of this VideoView from an Internal::CustomActor pointer. + * + * @SINCE_1_1.38 + * @param[in] internal A pointer to the internal CustomActor. + */ + DALI_INTERNAL VideoView( Dali::Internal::CustomActor* internal ); + +}; + +/** + * @} + */ + +} // namespace Toolkit + +} // namespace Dali + +#endif // __DALI_TOOLKIT_VIDEO_VIEW_H__ diff --git a/dali-toolkit/public-api/file.list b/dali-toolkit/public-api/file.list index d7e7034..f036d13 100755 --- a/dali-toolkit/public-api/file.list +++ b/dali-toolkit/public-api/file.list @@ -24,6 +24,7 @@ public_api_src_files = \ $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-page-path-effect.cpp \ $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view.cpp \ $(public_api_src_dir)/controls/scrollable/scrollable.cpp \ + $(public_api_src_dir)/controls/slider/slider.cpp \ $(public_api_src_dir)/controls/table-view/table-view.cpp \ $(public_api_src_dir)/controls/text-controls/text-editor.cpp \ $(public_api_src_dir)/controls/text-controls/text-label.cpp \ @@ -32,6 +33,7 @@ public_api_src_files = \ $(public_api_src_dir)/styling/style-manager.cpp \ $(public_api_src_dir)/accessibility-manager/accessibility-manager.cpp \ $(public_api_src_dir)/focus-manager/keyboard-focus-manager.cpp \ + $(public_api_src_dir)/controls/video-view/video-view.cpp \ $(public_api_src_dir)/dali-toolkit-version.cpp \ $(public_api_src_dir)/enums.cpp @@ -94,6 +96,9 @@ public_api_scroll_view_header_files = \ $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-page-path-effect.h \ $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view.h +public_api_slider_header_files = \ + $(public_api_src_dir)/controls/slider/slider.h + public_api_styling_header_files = \ $(public_api_src_dir)/styling/style-manager.h @@ -113,3 +118,6 @@ public_api_focus_manager_header_files = \ public_api_rendering_backend_header_files = \ $(public_api_src_dir)/text/rendering-backend.h + +public_api_video_view_header_files = \ + $(public_api_src_dir)/controls/video-view/video-view.h diff --git a/doc/dali-toolkit-doc.h b/doc/dali-toolkit-doc.h index d390f9a..eef34ab 100644 --- a/doc/dali-toolkit-doc.h +++ b/doc/dali-toolkit-doc.h @@ -159,6 +159,9 @@ * @defgroup dali_toolkit_controls_flex_container Flex Container * @brief FlexContainer is a container for Flexbox layout. + * @defgroup dali_toolkit_controls_video_view Video View + * @brief VideoView is a control for video playback and display. + * @} * @defgroup dali_toolkit_managers Managers