utc-Dali-Tooltip.cpp
utc-Dali-TransitionData.cpp
utc-Dali-Button.cpp
+ utc-Dali-CameraView.cpp
utc-Dali-Control.cpp
utc-Dali-ControlImpl.cpp
utc-Dali-ItemLayout.cpp
}
+ void RaiseAbove(Dali::VideoPlayer target)
+ {
+
+ }
+
+ void LowerBelow(Dali::VideoPlayer target)
+ {
+
+ }
+
+ void RaiseToTop()
+ {
+
+ }
+
+ void LowerToBottom()
+ {
+
+ }
+
public:
std::string mUrl;
Internal::Adaptor::GetImplementation( *this ).FinishSynchronization();
}
+void VideoPlayer::RaiseAbove(Dali::VideoPlayer target)
+{
+ Internal::Adaptor::GetImplementation( *this ).RaiseAbove(target);
+}
+
+void VideoPlayer::LowerBelow(Dali::VideoPlayer target)
+{
+ Internal::Adaptor::GetImplementation( *this ).LowerBelow(target);
+}
+
+void VideoPlayer::RaiseToTop()
+{
+ Internal::Adaptor::GetImplementation( *this ).RaiseToTop();
+}
+
+void VideoPlayer::LowerToBottom()
+{
+ Internal::Adaptor::GetImplementation( *this ).LowerToBottom();
+}
+
} // namespace Dali;
virtual ~Window() = default;
static Window* New(const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent);
FocusChangeSignalType mFocusChangeSignal;
+ ResizeSignalType mResizeSignal;
+ int mRotationAngle;
DevelWindow::VisibilityChangedSignalType mVisibilityChangedSignal;
};
Window::Window( const PositionSize& positionSize )
: SceneHolder( positionSize ),
mFocusChangeSignal(),
+ mResizeSignal(),
+ mRotationAngle(90), // dummy angle for test coverage
mVisibilityChangedSignal()
{
}
return GetImplementation( *this ).mFocusChangeSignal;
}
+ResizeSignalType& Window::ResizeSignal()
+{
+ return GetImplementation( *this ).mResizeSignal;
+}
+
Window::KeyEventSignalType& Window::KeyEventSignal()
{
return GetImplementation( *this ).KeyEventSignal();
return Dali::Window( windowImpl );
}
+void SetPositionSize(Window window, PositionSize positionSize)
+{
+ Uint16Pair newSize(positionSize.width, positionSize.height);
+ GetImplementation( window ).mResizeSignal.Emit(window,newSize);
+}
+
+int GetPhysicalOrientation(Window window)
+{
+ return GetImplementation( window ).mRotationAngle;
+}
+
void AddFrameRenderedCallback( Window window, std::unique_ptr< CallbackBase > callback, int32_t frameId )
{
CallbackBase::Execute( *callback, frameId );
class Window;
typedef Signal< void (Window,bool) > FocusChangeSignalType;
+typedef Signal< void (Window,Uint16Pair) > ResizeSignalType;
class Window : public BaseHandle
{
public:
+ using WindowSize = Uint16Pair;
+
using KeyEventSignalType = Signal< void (const KeyEvent&) >;
using TouchEventSignalType = Signal< void (const TouchEvent&) >;
+ using ResizeSignalType = Signal<void(Window, WindowSize)>;
static Window New(PositionSize windowPosition, const std::string& name, bool isTransparent = false);
static Window New(PositionSize windowPosition, const std::string& name, const std::string& className, bool isTransparent = false);
FocusChangeSignalType& FocusChangeSignal();
KeyEventSignalType& KeyEventSignal();
TouchEventSignalType& TouchedSignal();
+ ResizeSignalType& ResizeSignal();
public:
explicit Window( Internal::Adaptor::Window* window );
Dali::Window Get( Actor actor );
Dali::Window DownCast( BaseHandle handle );
+void SetPositionSize(Window window, PositionSize positionSize);
+int GetPhysicalOrientation(Window window);
void AddFrameRenderedCallback( Window window, std::unique_ptr< CallbackBase > callback, int32_t frameId );
void AddFramePresentedCallback( Window window, std::unique_ptr< CallbackBase > callback, int32_t frameId );
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
END_TEST;
}
+int UtcDaliAnimatedImageVisualImageLoadingFail01(void)
+{
+ ToolkitTestApplication application;
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+
+ {
+ Property::Map propertyMap;
+ propertyMap.Insert( Visual::Property::TYPE, Visual::ANIMATED_IMAGE );
+ propertyMap.Insert( ImageVisual::Property::URL, "dummy.gif" );
+ propertyMap.Insert( ImageVisual::Property::BATCH_SIZE, 2 );
+ propertyMap.Insert( ImageVisual::Property::CACHE_SIZE, 2 );
+ propertyMap.Insert( ImageVisual::Property::FRAME_DELAY, 20 );
+ propertyMap.Insert( ImageVisual::Property::SYNCHRONOUS_LOADING, true );
+ propertyMap.Insert( DevelVisual::Property::CORNER_RADIUS, 0.23f );
+ propertyMap.Insert( DevelVisual::Property::CORNER_RADIUS_POLICY, Visual::Transform::Policy::ABSOLUTE );
+
+ VisualFactory factory = VisualFactory::Get();
+ Visual::Base visual = factory.CreateVisual( propertyMap );
+
+ DummyControl dummyControl = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+ dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+
+ dummyControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ application.GetScene().Add( dummyControl );
+
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
+ textureTrace.Enable(true);
+
+ application.SendNotification();
+ application.Render(20);
+
+ DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 1, TEST_LOCATION );
+
+ DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedImageVisual::Action::JUMP_TO, 6 );
+
+ application.SendNotification();
+ application.Render(20);
+
+ DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 1, TEST_LOCATION );
+
+ dummyControl.Unparent();
+ }
+
+ END_TEST;
+}
int UtcDaliAnimatedImageVisualSynchronousLoading(void)
{
--- /dev/null
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <iostream>
+#include <stdlib.h>
+#include <dali-toolkit-test-suite-utils.h>
+#include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/public-api/controls/camera-view/camera-view.h>
+
+using namespace Dali;
+using namespace Dali::Toolkit;
+
+// Negative test case for a method
+int UtcDaliCameraViewUninitialized(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliCameraViewUninitialized");
+
+ Toolkit::CameraView view;
+
+ try
+ {
+ // New() must be called to create a CameraView 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 UtcDaliCameraViewNew(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliCameraViewNew");
+ Any dummy( 0 );
+ Toolkit::CameraView view = Toolkit::CameraView::New(dummy);
+ DALI_TEST_CHECK( view );
+ END_TEST;
+}
+
+// Positive test case for a method
+int UtcDaliCameraViewDownCast(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliCameraViewDownCast");
+
+ Any dummy( 0 );
+ Toolkit::CameraView view = Toolkit::CameraView::New(dummy);
+ BaseHandle handle(view);
+
+ Toolkit::CameraView view2 = Toolkit::CameraView::DownCast( handle );
+ DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK( view2 );
+ DALI_TEST_CHECK( view == view2 );
+ END_TEST;
+}
+
+int UtcDaliCameraViewCopyAndAssignment(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliCameraViewCopyAndAssignment");
+
+ Any dummy( 0 );
+ CameraView view = Toolkit::CameraView::New(dummy);
+ DALI_TEST_CHECK( view );
+
+ CameraView copy( view );
+ DALI_TEST_CHECK( view == copy );
+
+ CameraView assign;
+ DALI_TEST_CHECK( !assign );
+
+ assign = copy;
+ DALI_TEST_CHECK( assign == view );
+
+ END_TEST;
+}
+
+int UtcDaliCameraViewMoveAssignment(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliCameraViewMoveAssignment");
+
+ Any dummy( 0 );
+ CameraView view = Toolkit::CameraView::New(dummy);
+ DALI_TEST_EQUALS( 1, view.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+ CameraView moved;
+ moved = std::move( view );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( !view );
+
+ END_TEST;
+}
+
+int UtcDaliCameraViewTypeRegistry(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliCameraViewTypeRegistry");
+
+ TypeRegistry typeRegistry = TypeRegistry::Get();
+ DALI_TEST_CHECK( typeRegistry );
+
+ TypeInfo typeInfo = typeRegistry.GetTypeInfo( "CameraView" );
+ DALI_TEST_CHECK( typeInfo );
+
+ BaseHandle handle = typeInfo.CreateInstance();
+ DALI_TEST_CHECK( handle );
+
+ CameraView view = CameraView::DownCast( handle );
+ DALI_TEST_CHECK( view );
+
+ END_TEST;
+}
+
+int UtcDaliCameraViewWindowDisplayType(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliCameraViewWindowDisplayType");
+
+ Any dummy( 0 );
+ CameraView cameraView = CameraView::New(dummy, Dali::Toolkit::CameraView::DisplayType::WINDOW);
+ DALI_TEST_CHECK( cameraView );
+
+ application.GetScene().Add( cameraView );
+
+ try
+ {
+ cameraView.Update();
+ application.SendNotification();
+ application.Render();
+ DALI_TEST_CHECK( true );
+ }
+ catch (Dali::DaliException& e)
+ {
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_CHECK(false);
+ }
+
+ END_TEST;
+}
+
+int UtcDaliCameraViewImageDisplayType(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliCameraViewImageDisplayType");
+
+ Any dummy( 0 );
+ CameraView cameraView = CameraView::New(dummy, Dali::Toolkit::CameraView::DisplayType::IMAGE);
+ DALI_TEST_CHECK( cameraView );
+
+ application.GetScene().Add( cameraView );
+
+ try
+ {
+ cameraView.Update();
+ application.SendNotification();
+ application.Render();
+ DALI_TEST_CHECK( true );
+ }
+ catch (Dali::DaliException& e)
+ {
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_CHECK(false);
+ }
+
+ END_TEST;
+}
+
+int UtcDaliCameraViewCoverUpdateDisplayArea1(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliCameraViewUpdateDisplayArea1");
+
+ Any dummy( 0 );
+ CameraView view = CameraView::New(dummy, Dali::Toolkit::CameraView::DisplayType::WINDOW);
+ DALI_TEST_CHECK( view );
+
+ application.GetScene().Add( view );
+
+ application.SendNotification();
+ application.Render();
+
+ Vector3 vector(100.0f, 100.0f, 0.0f);
+ view.SetProperty( Actor::Property::SIZE, vector );
+
+ application.SendNotification();
+ application.Render();
+
+ // Check the size in the new frame
+ DALI_TEST_CHECK(vector == view.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ));
+
+ application.GetScene().Remove(view);
+
+ END_TEST;
+}
+
+int UtcDaliCameraViewCoverUpdateDisplayArea2(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliCameraViewUpdateDisplayArea2");
+
+ Any dummy( 0 );
+ CameraView view = CameraView::New(dummy, Dali::Toolkit::CameraView::DisplayType::WINDOW);
+ DALI_TEST_CHECK( view );
+
+ application.GetScene().Add( view );
+
+ application.SendNotification();
+ application.Render();
+
+ Vector3 vector(100.0f, 100.0f, 0.0f);
+ view.SetProperty( Actor::Property::SIZE, vector );
+
+ application.SendNotification();
+ application.Render();
+
+ // Check the size in the new frame
+ DALI_TEST_CHECK(vector == view.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ));
+
+ application.GetScene().Remove(view);
+
+ END_TEST;
+}
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
const char* const PROPERTY_NAME_MATCH_SYSTEM_LANGUAGE_DIRECTION = "matchSystemLanguageDirection";
const char* const PROPERTY_NAME_MAX_LENGTH = "maxLength";
const char* const PROPERTY_NAME_FONT_SIZE_SCALE = "fontSizeScale";
+const char* const PROPERTY_NAME_GRAB_HANDLE_COLOR = "grabHandleColor";
const Vector4 PLACEHOLDER_TEXT_COLOR( 0.8f, 0.8f, 0.8f, 0.8f );
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_ENABLE_GRAB_HANDLE ) == DevelTextEditor::Property::ENABLE_GRAB_HANDLE );
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_MATCH_SYSTEM_LANGUAGE_DIRECTION ) == DevelTextEditor::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION );
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_MAX_LENGTH ) == DevelTextEditor::Property::MAX_LENGTH );
+ DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_GRAB_HANDLE_COLOR ) == DevelTextEditor::Property::GRAB_HANDLE_COLOR );
END_TEST;
editor.SetProperty( Actor::Property::LAYOUT_DIRECTION, LayoutDirection::RIGHT_TO_LEFT );
DALI_TEST_EQUALS( editor.GetProperty<int>( Actor::Property::LAYOUT_DIRECTION ), static_cast<int>( LayoutDirection::RIGHT_TO_LEFT ), TEST_LOCATION );
+ // Check handle color
+ editor.SetProperty( DevelTextEditor::Property::GRAB_HANDLE_COLOR, Color::GREEN );
+ DALI_TEST_EQUALS( editor.GetProperty<Vector4>( DevelTextEditor::Property::GRAB_HANDLE_COLOR ), Color::GREEN, TEST_LOCATION );
+
application.SendNotification();
application.Render();
gTextChangedCallBackCalled = false;
editor.SetProperty( TextEditor::Property::TEXT, "ABC" );
+ application.SendNotification();
+ application.Render();
DALI_TEST_CHECK( gTextChangedCallBackCalled );
DALI_TEST_CHECK( textChangedSignal );
- application.SendNotification();
-
editor.SetKeyInputFocus();
gTextChangedCallBackCalled = false;
application.ProcessEvent( GenerateKey( "D", "", "D", KEY_D_CODE, 0, 0, Integration::KeyEvent::DOWN, "D", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.SendNotification();
+ application.Render();
DALI_TEST_CHECK( gTextChangedCallBackCalled );
// Remove all text
editor.SetProperty( TextField::Property::TEXT, "" );
+ application.SendNotification();
+ application.Render();
// Pressing backspace key: TextChangedCallback should not be called when there is no text in texteditor.
gTextChangedCallBackCalled = false;
application.ProcessEvent( GenerateKey( "", "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.SendNotification();
+ application.Render();
DALI_TEST_CHECK( !gTextChangedCallBackCalled );
// Pressing delete key: TextChangedCallback should not be called when there is no text in texteditor.
gTextChangedCallBackCalled = false;
application.ProcessEvent( GenerateKey( "", "", "", Dali::DevelKey::DALI_KEY_DELETE, 0, 0, Integration::KeyEvent::DOWN, "Delete", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.SendNotification();
+ application.Render();
+ DALI_TEST_CHECK( !gTextChangedCallBackCalled );
+
+ END_TEST;
+}
+
+int utcDaliTextEditorTextChangedWithInputMethodContext(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" utcDaliTextEditorTextChangedWithInputMethodContext");
+ TextEditor editor = TextEditor::New();
+ DALI_TEST_CHECK( editor );
+
+
+ application.GetScene().Add( editor );
+
+ // connect to the text changed signal.
+ ConnectionTracker* testTracker = new ConnectionTracker();
+ editor.TextChangedSignal().Connect(&TestTextChangedCallback);
+ bool textChangedSignal = false;
+ editor.ConnectSignal( testTracker, "textChanged", CallbackFunctor(&textChangedSignal) );
+
+
+ // get InputMethodContext
+ std::string text;
+ InputMethodContext::EventData imfEvent;
+ InputMethodContext inputMethodContext = DevelTextEditor::GetInputMethodContext( editor );
+
+ editor.SetKeyInputFocus();
+ editor.SetProperty( DevelTextEditor::Property::ENABLE_EDITING, true );
+
+ // input text
+ gTextChangedCallBackCalled = false;
+ imfEvent = InputMethodContext::EventData( InputMethodContext::PRE_EDIT, "ㅎ", 0, 1 );
+ inputMethodContext.EventReceivedSignal().Emit(inputMethodContext, imfEvent);
+ application.SendNotification();
+ application.Render();
+ DALI_TEST_CHECK( gTextChangedCallBackCalled );
+ DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::TEXT ), std::string("ㅎ"), TEST_LOCATION );
+
+ gTextChangedCallBackCalled = false;
+ imfEvent = InputMethodContext::EventData( InputMethodContext::PRE_EDIT, "호", 0, 1 );
+ inputMethodContext.EventReceivedSignal().Emit(inputMethodContext, imfEvent);
+ application.SendNotification();
+ application.Render();
+ DALI_TEST_CHECK( gTextChangedCallBackCalled );
+ DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::TEXT ), std::string("호"), TEST_LOCATION );
+
+ gTextChangedCallBackCalled = false;
+ imfEvent = InputMethodContext::EventData( InputMethodContext::PRE_EDIT, "혿", 0, 1 );
+ inputMethodContext.EventReceivedSignal().Emit(inputMethodContext, imfEvent);
+ application.SendNotification();
+ application.Render();
+ DALI_TEST_CHECK( gTextChangedCallBackCalled );
+ DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::TEXT ), std::string("혿"), TEST_LOCATION );
+
+ gTextChangedCallBackCalled = false;
+ imfEvent = InputMethodContext::EventData( InputMethodContext::PRE_EDIT, "", 0, 1 );
+ inputMethodContext.EventReceivedSignal().Emit(inputMethodContext, imfEvent);
+ DALI_TEST_CHECK( !gTextChangedCallBackCalled );
+
+ imfEvent = InputMethodContext::EventData( InputMethodContext::COMMIT, "호", 0, 1 );
+ inputMethodContext.EventReceivedSignal().Emit(inputMethodContext, imfEvent);
DALI_TEST_CHECK( !gTextChangedCallBackCalled );
+ imfEvent = InputMethodContext::EventData( InputMethodContext::PRE_EDIT, "두", 1, 2 );
+ inputMethodContext.EventReceivedSignal().Emit(inputMethodContext, imfEvent);
+ DALI_TEST_CHECK( !gTextChangedCallBackCalled );
+
+ application.SendNotification();
+ application.Render();
+ DALI_TEST_CHECK( gTextChangedCallBackCalled );
+ DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::TEXT ), std::string("호두"), TEST_LOCATION );
+
END_TEST;
}
+
int utcDaliTextEditorInputStyleChanged01(void)
{
// The text-editor emits signals when the input style changes. These changes of style are
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
const char* const PROPERTY_NAME_ENABLE_GRAB_HANDLE_POPUP = "enableGrabHandlePopup";
const char* const PROPERTY_NAME_BACKGROUND = "textBackground";
const char* const PROPERTY_NAME_FONT_SIZE_SCALE = "fontSizeScale";
+const char* const PROPERTY_NAME_GRAB_HANDLE_COLOR = "grabHandleColor";
const Vector4 PLACEHOLDER_TEXT_COLOR( 0.8f, 0.8f, 0.8f, 0.8f );
const Dali::Vector4 LIGHT_BLUE( 0.75f, 0.96f, 1.f, 1.f ); // The text highlight color.
DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_MATCH_SYSTEM_LANGUAGE_DIRECTION ) == DevelTextField::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION );
DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_ENABLE_GRAB_HANDLE_POPUP ) == DevelTextField::Property::ENABLE_GRAB_HANDLE_POPUP );
DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_BACKGROUND ) == DevelTextField::Property::BACKGROUND );
+ DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_GRAB_HANDLE_COLOR ) == DevelTextField::Property::GRAB_HANDLE_COLOR );
END_TEST;
}
field.SetProperty( DevelTextField::Property::BACKGROUND, Color::RED );
DALI_TEST_EQUALS( field.GetProperty<Vector4>( DevelTextField::Property::BACKGROUND ), Color::RED, TEST_LOCATION );
+ //Check handle color
+ field.SetProperty( DevelTextField::Property::GRAB_HANDLE_COLOR, Color::GREEN );
+ DALI_TEST_EQUALS( field.GetProperty<Vector4>( DevelTextField::Property::GRAB_HANDLE_COLOR ), Color::GREEN, TEST_LOCATION );
+
application.SendNotification();
application.Render();
gTextChangedCallBackCalled = false;
field.SetProperty( TextField::Property::TEXT, "ABC" );
+ application.SendNotification();
+ application.Render();
DALI_TEST_CHECK( gTextChangedCallBackCalled );
DALI_TEST_CHECK( textChangedSignal );
- application.SendNotification();
-
field.SetKeyInputFocus();
gTextChangedCallBackCalled = false;
application.ProcessEvent( GenerateKey( "D", "", "D", KEY_D_CODE, 0, 0, Integration::KeyEvent::DOWN, "D", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.SendNotification();
+ application.Render();
DALI_TEST_CHECK( gTextChangedCallBackCalled );
// Remove all text
field.SetProperty( TextField::Property::TEXT, "" );
+ application.SendNotification();
+ application.Render();
// Pressing backspace key: TextChangedCallback should not be called when there is no text in textfield.
gTextChangedCallBackCalled = false;
application.ProcessEvent( GenerateKey( "", "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.SendNotification();
+ application.Render();
DALI_TEST_CHECK( !gTextChangedCallBackCalled );
// Pressing delete key: TextChangedCallback should not be called when there is no text in textfield.
gTextChangedCallBackCalled = false;
application.ProcessEvent( GenerateKey( "", "", "", Dali::DevelKey::DALI_KEY_DELETE, 0, 0, Integration::KeyEvent::DOWN, "Delete", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.SendNotification();
+ application.Render();
DALI_TEST_CHECK( !gTextChangedCallBackCalled );
END_TEST;
}
+int utcDaliTextFieldTextChangedWithInputMethodContext(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" utcDaliTextFieldTextChangedWithInputMethodContext");
+ TextField field = TextField::New();
+ DALI_TEST_CHECK( field );
+
+
+ application.GetScene().Add( field );
+
+ // connect to the text changed signal.
+ ConnectionTracker* testTracker = new ConnectionTracker();
+ field.TextChangedSignal().Connect(&TestTextChangedCallback);
+ bool textChangedSignal = false;
+ field.ConnectSignal( testTracker, "textChanged", CallbackFunctor(&textChangedSignal) );
+
+
+ // get InputMethodContext
+ std::string text;
+ InputMethodContext::EventData imfEvent;
+ InputMethodContext inputMethodContext = DevelTextField::GetInputMethodContext( field );
+
+ field.SetKeyInputFocus();
+ field.SetProperty( DevelTextField::Property::ENABLE_EDITING, true );
+
+ // input text
+ gTextChangedCallBackCalled = false;
+ imfEvent = InputMethodContext::EventData( InputMethodContext::PRE_EDIT, "ㅎ", 0, 1 );
+ inputMethodContext.EventReceivedSignal().Emit(inputMethodContext, imfEvent);
+ application.SendNotification();
+ application.Render();
+ DALI_TEST_CHECK( gTextChangedCallBackCalled );
+ DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::TEXT ), std::string("ㅎ"), TEST_LOCATION );
+
+ gTextChangedCallBackCalled = false;
+ imfEvent = InputMethodContext::EventData( InputMethodContext::PRE_EDIT, "호", 0, 1 );
+ inputMethodContext.EventReceivedSignal().Emit(inputMethodContext, imfEvent);
+ application.SendNotification();
+ application.Render();
+ DALI_TEST_CHECK( gTextChangedCallBackCalled );
+ DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::TEXT ), std::string("호"), TEST_LOCATION );
+
+ gTextChangedCallBackCalled = false;
+ imfEvent = InputMethodContext::EventData( InputMethodContext::PRE_EDIT, "혿", 0, 1 );
+ inputMethodContext.EventReceivedSignal().Emit(inputMethodContext, imfEvent);
+ application.SendNotification();
+ application.Render();
+ DALI_TEST_CHECK( gTextChangedCallBackCalled );
+ DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::TEXT ), std::string("혿"), TEST_LOCATION );
+
+ gTextChangedCallBackCalled = false;
+ imfEvent = InputMethodContext::EventData( InputMethodContext::PRE_EDIT, "", 0, 1 );
+ inputMethodContext.EventReceivedSignal().Emit(inputMethodContext, imfEvent);
+ DALI_TEST_CHECK( !gTextChangedCallBackCalled );
+
+ imfEvent = InputMethodContext::EventData( InputMethodContext::COMMIT, "호", 0, 1 );
+ inputMethodContext.EventReceivedSignal().Emit(inputMethodContext, imfEvent);
+ DALI_TEST_CHECK( !gTextChangedCallBackCalled );
+
+ imfEvent = InputMethodContext::EventData( InputMethodContext::PRE_EDIT, "두", 1, 2 );
+ inputMethodContext.EventReceivedSignal().Emit(inputMethodContext, imfEvent);
+ DALI_TEST_CHECK( !gTextChangedCallBackCalled );
+
+ application.SendNotification();
+ application.Render();
+ DALI_TEST_CHECK( gTextChangedCallBackCalled );
+ DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::TEXT ), std::string("호두"), TEST_LOCATION );
+
+ END_TEST;
+}
+
+
// Negative test for the textChanged signal.
int utcDaliTextFieldTextChangedN(void)
{
gTextChangedCallBackCalled = false;
field.SetProperty( TextField::Property::PLACEHOLDER_TEXT, "ABC" ); // Setting placeholder, not TEXT
+ application.SendNotification();
+ application.Render();
DALI_TEST_CHECK( !gTextChangedCallBackCalled );
DALI_TEST_CHECK( !textChangedSignal );
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/public-api/controls/video-view/video-view.h>
#include <dali-toolkit/devel-api/controls/video-view/video-view-devel.h>
+#include <dali/devel-api/adaptor-framework/window-devel.h>
#include <dali/devel-api/adaptor-framework/video-sync-mode.h>
using namespace Dali;
END_TEST;
}
+int UtcDaliVideoViewRaiseAboveLowerBelow(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliVideoViewRaiseAboveLowerBelow");
+
+ VideoView view = VideoView::New( true );
+ DALI_TEST_CHECK( view );
+
+ application.GetScene().Add( view );
+ view.Play();
+
+ application.SendNotification();
+ application.Render();
+
+ VideoView view2 = VideoView::New( "", false );
+ DALI_TEST_CHECK( view2 );
+
+ application.GetScene().Add( view2 );
+ view2.Play();
+
+ application.SendNotification();
+ application.Render();
+
+ view.RaiseAbove(view2);
+ view.LowerBelow(view2);
+
+ END_TEST;
+}
+
+int UtcDaliVideoViewRaiseTopLowerBottom(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliVideoViewRaiseTopLowerBottom");
+
+ VideoView view = VideoView::New( true );
+ DALI_TEST_CHECK( view );
+
+ application.GetScene().Add( view );
+ view.Play();
+
+ application.SendNotification();
+ application.Render();
+
+ VideoView view2 = VideoView::New( "", false );
+ DALI_TEST_CHECK( view2 );
+
+ application.GetScene().Add( view2 );
+ view2.Play();
+
+ application.SendNotification();
+ application.Render();
+
+ view.RaiseToTop();
+ view.LowerToBottom();
+
+ END_TEST;
+}
+
+
int UtcDaliVideoViewPropertyDisplayMode(void)
{
ToolkitTestApplication application;
END_TEST;
}
+
+// For coverage.
+int UtcDaliVideoViewSynchronizationForWindowRotation(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliVideoViewSynchronizationForWindowRotation");
+
+ Window window = Window::New(PositionSize(0,0,100,100) ,"", false);
+ DALI_TEST_CHECK( window );
+
+ VideoView view = VideoView::New( true );
+ DALI_TEST_CHECK( view );
+
+ window.Add( view );
+
+ view.Play();
+
+ DevelWindow::SetPositionSize(window,PositionSize(0,0,480, 240));
+
+ application.SendNotification();
+ application.Render();
+
+ END_TEST;
+}
#define DALI_TOOLKIT_H
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <dali-toolkit/public-api/controls/buttons/check-box-button.h>
#include <dali-toolkit/public-api/controls/buttons/push-button.h>
#include <dali-toolkit/public-api/controls/buttons/radio-button.h>
+#include <dali-toolkit/public-api/controls/camera-view/camera-view.h>
#include <dali-toolkit/public-api/controls/control-impl.h>
#include <dali-toolkit/public-api/controls/control.h>
#include <dali-toolkit/public-api/controls/flex-container/flex-container.h>
highlight.SetProperty(Actor::Property::POSITION_Z, 1.0f);
highlight.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 0.0f));
+ // Remember the highlight actor, so that when the default is changed with
+ // SetHighlightActor(), the currently displayed highlight can still be cleared.
+ currentHighlightActor = highlight;
EnsureSelfVisible();
self.Add(highlight);
SetCurrentlyHighlightedActor(self);
return false;
if(GetCurrentlyHighlightedActor() == self)
{
- self.Remove(GetHighlightActor());
+ self.Remove(currentHighlightActor.GetHandle());
+ currentHighlightActor = {};
SetCurrentlyHighlightedActor({});
EmitHighlighted(false);
return true;
// EXTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/accessibility-impl.h>
#include <dali/devel-api/adaptor-framework/accessibility.h>
+#include <dali/public-api/object/weak-handle.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/dali-toolkit-common.h>
public virtual Dali::Accessibility::Action
{
Dali::Actor self;
+ Dali::WeakHandle<Dali::Actor> currentHighlightActor;
bool modal = false, root = false;
AccessibleImpl(Dali::Actor self, Dali::Accessibility::Role role, bool modal = false);
#define DALI_TOOLKIT_TEXT_EDITOR_DEVEL_H
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* @details Name "primaryCursorPosition", type Property::INTEGER.
*/
PRIMARY_CURSOR_POSITION,
+
+ /**
+ * @brief The color of the grab color.
+ * @details Name "grabHandleColor", type Property::VECTOR4.
+ */
+ GRAB_HANDLE_COLOR,
};
} // namespace Property
#define DALI_TOOLKIT_TEXT_FIELD_DEVEL_H
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
PRIMARY_CURSOR_POSITION,
+ /**
+ * @brief The color of the grab color.
+ * @details Name "grabHandleColor", type Property::VECTOR4.
+ */
+ GRAB_HANDLE_COLOR,
};
+
} // namespace Property
/**
bool AccessibilityManager::SetCurrentFocusActor(Actor actor)
{
- Dali::Accessibility::Accessible::SetCurrentlyHighlightedActor(actor);
-
- return true;
+ return Toolkit::DevelControl::GrabAccessibilityHighlight(actor);
}
Actor AccessibilityManager::GetCurrentFocusActor()
void CheckBoxButton::OnStateChange(State newState)
{
// TODO: replace it with OnPropertySet hook once Button::Property::SELECTED will be consistently used
- if(Dali::Accessibility::IsUp() && (newState == SELECTED_STATE || newState == UNSELECTED_STATE))
+ if(Dali::Accessibility::IsUp() && (Dali::Accessibility::Accessible::GetCurrentlyHighlightedActor() == Self())
+ && (newState == SELECTED_STATE || newState == UNSELECTED_STATE))
{
Dali::Accessibility::Accessible::Get(Self())->EmitStateChanged(
Dali::Accessibility::State::CHECKED, newState == SELECTED_STATE ? 1 : 0, 0);
void PushButton::OnStateChange(State newState)
{
// TODO: replace it with OnPropertySet hook once Button::Property::SELECTED will be consistently used
- if(Dali::Accessibility::IsUp() && (newState == SELECTED_STATE || newState == UNSELECTED_STATE))
+ if(Dali::Accessibility::IsUp() && (Dali::Accessibility::Accessible::GetCurrentlyHighlightedActor() == Self())
+ && (newState == SELECTED_STATE || newState == UNSELECTED_STATE))
{
Dali::Accessibility::Accessible::Get(Self())->EmitStateChanged(
Dali::Accessibility::State::PRESSED, newState == SELECTED_STATE ? 1 : 0, 0);
}
}
// TODO: replace it with OnPropertySet hook once Button::Property::SELECTED will be consistently used
- if(Dali::Accessibility::IsUp() && (newState == SELECTED_STATE || newState == UNSELECTED_STATE))
+ if(Dali::Accessibility::IsUp() && (Dali::Accessibility::Accessible::GetCurrentlyHighlightedActor() == Self())
+ && (newState == SELECTED_STATE || newState == UNSELECTED_STATE))
{
Dali::Accessibility::Accessible::Get(Self())->EmitStateChanged(
Dali::Accessibility::State::CHECKED, newState == SELECTED_STATE ? 1 : 0, 0);
void ToggleButton::OnStateChange(State newState)
{
// TODO: replace it with OnPropertySet hook once Button::Property::SELECTED will be consistently used
- if(Dali::Accessibility::IsUp() && (newState == SELECTED_STATE || newState == UNSELECTED_STATE))
+ if(Dali::Accessibility::IsUp() && (Self() == Dali::Accessibility::Accessible::GetCurrentlyHighlightedActor())
+ && (newState == SELECTED_STATE || newState == UNSELECTED_STATE))
{
Dali::Accessibility::Accessible::Get(Self())->EmitStateChanged(
Dali::Accessibility::State::CHECKED, mCurrentToggleIndex ? 1 : 0, 0);
-
- if(Self() == Dali::Accessibility::Accessible::GetCurrentlyHighlightedActor())
- {
Dali::Accessibility::Accessible::Get(Self())->Emit(Dali::Accessibility::ObjectPropertyChangeEvent::DESCRIPTION);
- }
}
}
--- /dev/null
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include "camera-view-impl.h"
+
+// EXTERNAL INCLUDES
+#include <dali/devel-api/actors/actor-devel.h>
+#include <dali/devel-api/adaptor-framework/window-devel.h>
+#include <dali/integration-api/debug.h>
+#include <dali/public-api/adaptor-framework/native-image-source.h>
+#include <dali/public-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry.h>
+#include <cstring>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/controls/control/control-data-impl.h>
+#include <dali-toolkit/internal/graphics/builtin-shader-extern-gen.h>
+#include <dali-toolkit/internal/visuals/visual-factory-cache.h>
+#include <dali-toolkit/public-api/controls/camera-view/camera-view.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace Internal
+{
+namespace
+{
+BaseHandle Create()
+{
+ return Toolkit::CameraView::New(NULL);
+}
+
+DALI_TYPE_REGISTRATION_BEGIN(Toolkit::CameraView, Toolkit::Control, Create)
+DALI_TYPE_REGISTRATION_END()
+} // namespace
+
+CameraView::CameraView(Dali::Toolkit::CameraView::DisplayType displayType)
+: Control(ControlBehaviour(ACTOR_BEHAVIOUR_DEFAULT | DISABLE_STYLE_CHANGE_SIGNALS)),
+ mDisplayType(displayType)
+{
+}
+
+CameraView::~CameraView()
+{
+}
+
+Toolkit::CameraView CameraView::New(Any cameraHandle, Dali::Toolkit::CameraView::DisplayType type)
+{
+ CameraView* impl = new CameraView(type);
+ Toolkit::CameraView handle = Toolkit::CameraView(*impl);
+ impl->mCameraPlayer = Dali::CameraPlayer::New();
+ impl->Initialize();
+ if(impl->mCameraPlayer)
+ {
+ impl->mCameraPlayer.SetCameraPlayer(cameraHandle);
+ }
+ return handle;
+}
+
+void CameraView::Update()
+{
+ UpdateDisplayArea(mSizeUpdateNotification);
+}
+
+void CameraView::OnSceneConnection(int depth)
+{
+ Control::OnSceneConnection(depth);
+ if(mDisplayType == Dali::Toolkit::CameraView::DisplayType::WINDOW)
+ {
+ SetWindowSurfaceTarget();
+ }
+ else if(mDisplayType == Dali::Toolkit::CameraView::DisplayType::IMAGE)
+ {
+ SetNativeImageTarget();
+ }
+ RelayoutRequest();
+}
+
+void CameraView::OnSceneDisconnection()
+{
+ Control::OnSceneDisconnection();
+ Actor self = Self();
+ if(mTextureRenderer)
+ {
+ self.RemoveRenderer(mTextureRenderer);
+ mTextureRenderer.Reset();
+ }
+
+ if(mOverlayRenderer)
+ {
+ self.RemoveRenderer(mOverlayRenderer);
+ mOverlayRenderer.Reset();
+ }
+}
+
+void CameraView::SetWindowSurfaceTarget()
+{
+ Actor self = Self();
+
+ mPositionUpdateNotification = self.AddPropertyNotification(Actor::Property::WORLD_POSITION, StepCondition(1.0f, 1.0f));
+ mSizeUpdateNotification = self.AddPropertyNotification(Actor::Property::SIZE, StepCondition(1.0f, 1.0f));
+ mScaleUpdateNotification = self.AddPropertyNotification(Actor::Property::WORLD_SCALE, StepCondition(0.1f, 1.0f));
+ mPositionUpdateNotification.NotifySignal().Connect(this, &CameraView::UpdateDisplayArea);
+ mSizeUpdateNotification.NotifySignal().Connect(this, &CameraView::UpdateDisplayArea);
+ mScaleUpdateNotification.NotifySignal().Connect(this, &CameraView::UpdateDisplayArea);
+
+ // For underlay rendering mode, camera display area have to be transparent.
+ Geometry geometry = VisualFactoryCache::CreateQuadGeometry();
+ Shader shader = Shader::New(SHADER_VIDEO_VIEW_VERT, SHADER_VIDEO_VIEW_FRAG);
+ mOverlayRenderer = Renderer::New(geometry, shader);
+ mOverlayRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::OFF);
+
+ Self().AddRenderer(mOverlayRenderer);
+
+ // Note CameraPlayer::SetWindowRenderingTarget
+ mCameraPlayer.SetWindowRenderingTarget(DevelWindow::Get(self));
+}
+
+void CameraView::SetNativeImageTarget()
+{
+ Actor self(Self());
+
+ self.RemovePropertyNotification(mPositionUpdateNotification);
+ self.RemovePropertyNotification(mSizeUpdateNotification);
+ self.RemovePropertyNotification(mScaleUpdateNotification);
+
+ Any source;
+ Dali::NativeImageSourcePtr nativeImageSourcePtr = Dali::NativeImageSource::New(source);
+ mNativeTexture = Dali::Texture::New(*nativeImageSourcePtr);
+
+ Dali::Geometry geometry = VisualFactoryCache::CreateQuadGeometry();
+ Dali::Shader shader = CreateShader(nativeImageSourcePtr->GetCustomFragmentPrefix());
+ Dali::TextureSet textureSet = Dali::TextureSet::New();
+ textureSet.SetTexture(0u, mNativeTexture);
+
+ mTextureRenderer = Renderer::New(geometry, shader);
+ mTextureRenderer.SetTextures(textureSet);
+
+ Self().AddRenderer(mTextureRenderer);
+
+ // Note CameraPlayer::SetNativeImageRenderingTarget.
+ mCameraPlayer.SetNativeImageRenderingTarget(nativeImageSourcePtr);
+}
+
+void CameraView::UpdateDisplayArea(Dali::PropertyNotification& source)
+{
+ if(mDisplayType != Dali::Toolkit::CameraView::DisplayType::WINDOW)
+ {
+ return;
+ }
+
+ Actor self(Self());
+
+ bool positionUsesAnchorPoint = self.GetProperty(Actor::Property::POSITION_USES_ANCHOR_POINT).Get<bool>();
+ Vector3 actorSize = self.GetCurrentProperty<Vector3>(Actor::Property::SIZE) * self.GetCurrentProperty<Vector3>(Actor::Property::WORLD_SCALE);
+ Vector3 anchorPointOffSet = actorSize * (positionUsesAnchorPoint ? self.GetCurrentProperty<Vector3>(Actor::Property::ANCHOR_POINT) : AnchorPoint::TOP_LEFT);
+
+ Vector2 screenPosition = self.GetProperty(Actor::Property::SCREEN_POSITION).Get<Vector2>();
+
+ mDisplayArea.x = screenPosition.x - anchorPointOffSet.x;
+ mDisplayArea.y = screenPosition.y - anchorPointOffSet.y;
+ mDisplayArea.width = actorSize.x;
+ mDisplayArea.height = actorSize.y;
+
+ mCameraPlayer.SetDisplayArea(mDisplayArea);
+}
+
+Dali::Shader CameraView::CreateShader(const char* fragmentPrefix)
+{
+ std::string fragmentShader = fragmentPrefix;
+ std::string vertexShader;
+
+ vertexShader = SHADER_VIDEO_VIEW_TEXTURE_VERT.data();
+ fragmentShader += SHADER_VIDEO_VIEW_TEXTURE_FRAG.data();
+
+ return Dali::Shader::New(vertexShader, fragmentShader);
+}
+
+} // namespace Internal
+
+} // namespace Toolkit
+
+} // namespace Dali
\ No newline at end of file
--- /dev/null
+#ifndef DALI_TOOLKIT_INTERNAL_CAMERA_VIEW_H
+#define DALI_TOOLKIT_INTERNAL_CAMERA_VIEW_H
+
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/camera-player.h>
+#include <dali/public-api/object/property-notification.h>
+#include <dali/public-api/rendering/renderer.h>
+#include <dali/public-api/rendering/texture.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/controls/camera-view/camera-view.h>
+#include <dali-toolkit/public-api/controls/control-impl.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+class CameraView;
+
+namespace Internal
+{
+class CameraView : public Control
+{
+protected:
+ /**
+ * @brief Constructor.
+ * @param[in] type Where it is an overlay type or a native image type
+ */
+ CameraView(Dali::Toolkit::CameraView::DisplayType type);
+
+ /**
+ * @brief Destructor
+ */
+ virtual ~CameraView();
+
+public:
+ /**
+ * @brief Creates an initialized CameraView.
+ * @param[in] handle Multimedia camera player handle
+ * @param[in] type Where it is an overlay type or a native image type
+ */
+ static Toolkit::CameraView New(Any handle, Dali::Toolkit::CameraView::DisplayType type);
+
+ /**
+ * @brief Update camera player.
+ */
+ void Update();
+
+private: // From Control
+ /**
+ * @copydoc Toolkit::Control::OnSceneConnection()
+ */
+ void OnSceneConnection(int depth) override;
+
+ /**
+ * @copydoc Toolkit::Control::OnSceneDisconnection()
+ */
+ void OnSceneDisconnection() override;
+
+private:
+ /**
+ * @brief Construct a new CameraView.
+ */
+ CameraView(const CameraView& cameraView);
+
+ // Undefined assignment operator.
+ CameraView& operator=(const CameraView& cameraView);
+
+ /**
+ * @brief Updates camera display area for window rendering target
+ * @param[in] source PropertyNotification
+ */
+ void UpdateDisplayArea(Dali::PropertyNotification& source);
+
+ /**
+ * @brief SetWindowSurfaceTarget for underlay camera preview.
+ */
+ void SetWindowSurfaceTarget();
+
+ /**
+ * @brief SetNativeImageTarget for native image camera preview.
+ */
+ void SetNativeImageTarget();
+
+ /**
+ * @brief CreateShader for native image target
+ * @param[in] fragmentPrefix prefix of fragment
+ * @return Returns the shader for NativeImage.
+ */
+ Dali::Shader CreateShader(const char* fragmentPrefix);
+
+private:
+ Dali::CameraPlayer mCameraPlayer;
+ Dali::Texture mNativeTexture;
+
+ Dali::DisplayArea mDisplayArea;
+ Dali::Renderer mOverlayRenderer;
+ Dali::Renderer mTextureRenderer;
+
+ Dali::PropertyNotification mPositionUpdateNotification;
+ Dali::PropertyNotification mSizeUpdateNotification;
+ Dali::PropertyNotification mScaleUpdateNotification;
+
+ Dali::Toolkit::CameraView::DisplayType mDisplayType;
+};
+
+} // namespace Internal
+
+inline Toolkit::Internal::CameraView& GetImpl(Toolkit::CameraView& handle)
+{
+ DALI_ASSERT_ALWAYS(handle);
+ Dali::RefObject& impl = handle.GetImplementation();
+ return static_cast<Toolkit::Internal::CameraView&>(impl);
+}
+
+inline const Toolkit::Internal::CameraView& GetImpl(const Toolkit::CameraView& handle)
+{
+ DALI_ASSERT_ALWAYS(handle);
+ const Dali::RefObject& impl = handle.GetImplementation();
+ return static_cast<const Toolkit::Internal::CameraView&>(impl);
+}
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_INTERNAL_CAMERA_VIEW_H
\ No newline at end of file
DALI_DEVEL_PROPERTY_REGISTRATION_READ_ONLY(Toolkit, TextEditor, "selectedText", STRING, SELECTED_TEXT )
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextEditor, "fontSizeScale", FLOAT, FONT_SIZE_SCALE )
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextEditor, "primaryCursorPosition", INTEGER, PRIMARY_CURSOR_POSITION )
+DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextEditor, "grabHandleColor", VECTOR4, GRAB_HANDLE_COLOR )
DALI_SIGNAL_REGISTRATION(Toolkit, TextEditor, "textChanged", SIGNAL_TEXT_CHANGED )
DALI_SIGNAL_REGISTRATION(Toolkit, TextEditor, "inputStyleChanged", SIGNAL_INPUT_STYLE_CHANGED)
}
break;
}
+ case Toolkit::DevelTextEditor::Property::GRAB_HANDLE_COLOR:
+ {
+ const Vector4 color = value.Get<Vector4>();
+ DALI_LOG_INFO(gLogFilter, Debug::General, "TextEditor %p GRAB_HANDLE_COLOR %f,%f,%f,%f\n", impl.mController.Get(), color.r, color.g, color.b, color.a);
+
+ impl.mDecorator->SetHandleColor(color);
+ impl.RequestTextRelayout();
+ break;
+ }
} // switch
} // texteditor
}
value = static_cast<int>(impl.mController->GetPrimaryCursorPosition());
break;
}
+ case Toolkit::DevelTextEditor::Property::GRAB_HANDLE_COLOR:
+ {
+ value = impl.mDecorator->GetHandleColor();
+ break;
+ }
} //switch
}
void TextEditor::ResizeActor(Actor& actor, const Vector2& size)
{
- if (actor.GetProperty<Vector3>(Dali::Actor::Property::SIZE).GetVectorXY() != size)
+ if(actor.GetProperty<Vector3>(Dali::Actor::Property::SIZE).GetVectorXY() != size)
{
actor.SetProperty(Actor::Property::SIZE, size);
}
}
RenderText(updateTextType);
+
+ // If there is text changed, callback is called.
+ if(mTextChanged)
+ {
+ Dali::Toolkit::TextEditor handle(GetOwner());
+ mTextChangedSignal.Emit(handle);
+ mTextChanged = false;
+ }
}
// The text-editor emits signals when the input style changes. These changes of style are
void TextEditor::TextChanged()
{
- Dali::Toolkit::TextEditor handle(GetOwner());
- mTextChangedSignal.Emit(handle);
+ mTextChanged = true;
}
void TextEditor::MaxLengthReached()
mHasBeenStaged(false),
mScrollAnimationEnabled(false),
mScrollBarEnabled(false),
- mScrollStarted(false)
+ mScrollStarted(false),
+ mTextChanged(false)
{
}
* @param[in] actor The actor to be resized.
* @param[in] size Size to change.
*/
- void ResizeActor( Actor& actor, const Vector2& size );
+ void ResizeActor(Actor& actor, const Vector2& size);
/**
* @brief Render view, create and attach actor(s) to this text editor.
bool mScrollAnimationEnabled : 1;
bool mScrollBarEnabled : 1;
bool mScrollStarted : 1;
+ bool mTextChanged : 1;
struct AccessibleImpl : public DevelControl::AccessibleImpl,
public virtual Dali::Accessibility::Text,
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "enableEditing", BOOLEAN, ENABLE_EDITING )
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "fontSizeScale", FLOAT, FONT_SIZE_SCALE )
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "primaryCursorPosition", INTEGER, PRIMARY_CURSOR_POSITION )
+DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "grabHandleColor", VECTOR4, GRAB_HANDLE_COLOR )
DALI_SIGNAL_REGISTRATION(Toolkit, TextField, "textChanged", SIGNAL_TEXT_CHANGED )
DALI_SIGNAL_REGISTRATION(Toolkit, TextField, "maxLengthReached", SIGNAL_MAX_LENGTH_REACHED )
}
break;
}
+ case Toolkit::DevelTextField::Property::GRAB_HANDLE_COLOR:
+ {
+ const Vector4 color = value.Get<Vector4>();
+ DALI_LOG_INFO(gLogFilter, Debug::General, "TextField %p GRAB_HANDLE_COLOR %f,%f,%f,%f\n", impl.mController.Get(), color.r, color.g, color.b, color.a);
+
+ impl.mDecorator->SetHandleColor(color);
+ impl.RequestTextRelayout();
+ break;
+ }
} // switch
} // textfield
}
value = static_cast<int>(impl.mController->GetPrimaryCursorPosition());
break;
}
+ case Toolkit::DevelTextField::Property::GRAB_HANDLE_COLOR:
+ {
+ value = impl.mDecorator->GetHandleColor();
+ break;
+ }
} //switch
}
void TextField::ResizeActor(Actor& actor, const Vector2& size)
{
- if (actor.GetProperty<Vector3>(Dali::Actor::Property::SIZE).GetVectorXY() != size)
+ if(actor.GetProperty<Vector3>(Dali::Actor::Property::SIZE).GetVectorXY() != size)
{
actor.SetProperty(Actor::Property::SIZE, size);
}
}
RenderText(updateTextType);
+
+ // If there is text changed, callback is called.
+ if(mTextChanged)
+ {
+ Dali::Toolkit::TextField handle(GetOwner());
+ mTextChangedSignal.Emit(handle);
+ mTextChanged = false;
+ }
}
// The text-field emits signals when the input style changes. These changes of style are
void TextField::TextChanged()
{
- Dali::Toolkit::TextField handle(GetOwner());
- mTextChangedSignal.Emit(handle);
+ mTextChanged = true;
}
void TextField::MaxLengthReached()
mAlignmentOffset(0.f),
mRenderingBackend(DEFAULT_RENDERING_BACKEND),
mExceedPolicy(Dali::Toolkit::TextField::EXCEED_POLICY_CLIP),
- mHasBeenStaged(false)
+ mHasBeenStaged(false),
+ mTextChanged(false)
{
}
* @param[in] actor The actor to be resized.
* @param[in] size Size to change.
*/
- void ResizeActor( Actor& actor, const Vector2& size );
+ void ResizeActor(Actor& actor, const Vector2& size);
/**
* @brief Render view, create and attach actor(s) to this Text Field.
int mRenderingBackend;
int mExceedPolicy;
bool mHasBeenStaged : 1;
+ bool mTextChanged : 1;
protected:
struct AccessibleImpl : public DevelControl::AccessibleImpl,
const char* const DEFAULT_SAMPLER_TYPE_NAME("sampler2D");
const char* const CUSTOM_SAMPLER_TYPE_NAME("samplerExternalOES");
+const char* const IS_VIDEO_VIEW_PROPERTY_NAME = "isVideoView";
+
} // namespace
VideoView::VideoView(Dali::VideoSyncMode syncMode)
mFrameID(0),
mIsPlay(false),
mIsUnderlay(true),
- mSyncMode(syncMode)
+ mSyncMode(syncMode),
+ mSiblingOrder(0)
{
}
void VideoView::OnInitialize()
{
+ Actor self = Self();
mVideoPlayer.FinishedSignal().Connect(this, &VideoView::EmitSignalFinish);
- DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
+ DevelControl::SetAccessibilityConstructor(self, [](Dali::Actor actor) {
return std::unique_ptr<Dali::Accessibility::Accessible>(
new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::VIDEO));
});
+
+ //update self property
+ self.RegisterProperty(IS_VIDEO_VIEW_PROPERTY_NAME, true, Property::READ_WRITE);
}
void VideoView::SetUrl(const std::string& url)
void VideoView::OnSceneConnection(int depth)
{
- Control::OnSceneConnection(depth);
-
+ Actor self = Self();
if(mIsUnderlay)
{
+ mSiblingOrder = self.GetProperty<int>(Dali::DevelActor::Property::SIBLING_ORDER);
+ DevelActor::ChildOrderChangedSignal(self.GetParent()).Connect(this, &VideoView::OnChildOrderChanged);
SetWindowSurfaceTarget();
}
+
+ Control::OnSceneConnection(depth);
}
void VideoView::OnSceneDisconnection()
Control::OnSizeSet(targetSize);
}
+void VideoView::OnChildOrderChanged(Actor actor)
+{
+ Actor self = Self();
+ int currentSiblingOrder = self.GetProperty<int>(Dali::DevelActor::Property::SIBLING_ORDER);
+ if(currentSiblingOrder != mSiblingOrder)
+ {
+ Actor parent = self.GetParent();
+ Actor child;
+ Actor upper;
+ Actor lower;
+
+ int numChildren = static_cast<int>(parent.GetChildCount());
+ for(int i = 0; i < numChildren; i++)
+ {
+ child = parent.GetChildAt(i);
+ if(!IsVideoView(child))
+ {
+ continue;
+ }
+
+ if(child == self)
+ {
+ continue;
+ }
+
+ if(i < currentSiblingOrder)
+ {
+ lower = child;
+ }
+ else if(i > currentSiblingOrder)
+ {
+ upper = child;
+ break;
+ }
+ }
+
+ if(lower)
+ {
+ Toolkit::VideoView lowerView = Toolkit::VideoView::DownCast(lower);
+ mVideoPlayer.RaiseAbove(GetImpl(lowerView).GetVideoPlayer());
+ }
+
+ if(upper)
+ {
+ Toolkit::VideoView upperView = Toolkit::VideoView::DownCast(upper);
+ mVideoPlayer.LowerBelow(GetImpl(upperView).GetVideoPlayer());
+ }
+ mSiblingOrder = currentSiblingOrder;
+ }
+}
+
Vector3 VideoView::GetNaturalSize()
{
Vector3 size;
return;
}
+ Dali::Window window = DevelWindow::Get(self);
+ window.ResizeSignal().Connect(this, &VideoView::OnWindowResized);
+
int curPos = mVideoPlayer.GetPlayPosition();
if(mIsPlay)
SetFrameRenderCallback();
}
+void VideoView::OnWindowResized(Dali::Window winHandle, Dali::Window::WindowSize size)
+{
+ Dali::VideoPlayerPlugin::DisplayRotation videoAngle = mVideoPlayer.GetDisplayRotation();
+ int windowAngle = (DevelWindow::GetPhysicalOrientation(winHandle) / 90);
+
+ if(windowAngle != videoAngle)
+ {
+ mVideoPlayer.SetDisplayRotation(static_cast<Dali::VideoPlayerPlugin::DisplayRotation>(windowAngle));
+ }
+}
+
void VideoView::PlayAnimation(Dali::Animation animation)
{
if(mIsUnderlay && mSyncMode == Dali::VideoSyncMode::ENABLED)
mFrameID);
}
+bool VideoView::IsVideoView(Actor actor) const
+{
+ // Check whether the actor is a VideoView
+ bool isVideoView = false;
+
+ if(actor)
+ {
+ Property::Index propertyIsVideoView = actor.GetPropertyIndex(IS_VIDEO_VIEW_PROPERTY_NAME);
+ if(propertyIsVideoView != Property::INVALID_INDEX)
+ {
+ isVideoView = actor.GetProperty<bool>(propertyIsVideoView);
+ }
+ }
+
+ return isVideoView;
+}
+
+VideoPlayer VideoView::GetVideoPlayer()
+{
+ return mVideoPlayer;
+}
+
} // namespace Internal
} // namespace Toolkit
#include <dali/devel-api/adaptor-framework/video-player.h>
#include <dali/devel-api/adaptor-framework/video-sync-mode.h>
#include <dali/integration-api/adaptor-framework/trigger-event-factory.h>
+#include <dali/public-api/adaptor-framework/window.h>
#include <dali/public-api/images/image-operations.h>
#include <dali/public-api/object/property-conditions.h>
#include <dali/public-api/object/property-map.h>
*/
void PlayAnimation(Dali::Animation animation);
+ /**
+ * @brief Checks whether the actor is set as a video view or not.
+ *
+ * @param[in] actor The actor to be checked
+ * @return True if actor is video view.
+ */
+ bool IsVideoView(Actor actor) const;
+
+ /**
+ * @brief Gets the Video Player.
+ *
+ * @return The return of video player.
+ */
+ VideoPlayer GetVideoPlayer();
+
private: // From Control
/**
* @copydoc Toolkit::Control::OnInitialize()
*/
void OnAnimationFinished(Dali::Animation& animation);
+ /*
+ * @brief window's resize callback function
+ * This function is called when window is resized.
+ *
+ * @param[in] winHandle The resized window's handle.
+ * @param[in] size The window's new size.
+ */
+ void OnWindowResized(Dali::Window winHandle, Dali::Window::WindowSize size);
+
+ /**
+ * @brief This signal is emitted when an actor's children change their sibling order
+ *
+ * @param[in] actor parent actor.
+ */
+ void OnChildOrderChanged(Actor actor);
+
private:
Dali::VideoPlayer mVideoPlayer;
Dali::ImageDimensions mVideoSize;
bool mIsUnderlay;
Dali::VideoSyncMode mSyncMode;
+ int mSiblingOrder;
};
} // namespace Internal
${toolkit_src_dir}/controls/tooltip/tooltip.cpp
${toolkit_src_dir}/controls/video-view/video-view-impl.cpp
${toolkit_src_dir}/controls/web-view/web-view-impl.cpp
+ ${toolkit_src_dir}/controls/camera-view/camera-view-impl.cpp
${toolkit_src_dir}/accessibility-manager/accessibility-manager-impl.cpp
${toolkit_src_dir}/feedback/feedback-style.cpp
// The SetGrabHandleImage() method will change the orientation.
const float yLocalPosition = grabHandle.verticallyFlipped ? grabHandle.position.y : grabHandle.position.y + grabHandle.lineHeight;
- if(grabHandle.actor)
- {
- grabHandle.actor.SetProperty(Actor::Property::POSITION, Vector2(grabHandle.position.x + floor(0.5f * mCursorWidth) + (mSmoothHandlePanEnabled ? grabHandle.grabDisplacementX : 0.f), yLocalPosition + (mSmoothHandlePanEnabled ? grabHandle.grabDisplacementY : 0.f)));
- }
+ ApplyDisplacement(grabHandle, yLocalPosition);
}
void SetSelectionHandlePosition(HandleType type)
// The SetHandleImage() method will change the orientation.
const float yLocalPosition = handle.verticallyFlipped ? handle.position.y : handle.position.y + handle.lineHeight;
- if(handle.actor)
+ ApplyDisplacement(handle, yLocalPosition);
+ }
+
+ void ApplyDisplacement(HandleImpl& handle, float yLocalPosition)
+ {
+ if( handle.actor )
+ {
+ float adjustedDisplacementX = 0.0f;
+ float adjustedDisplacementY = 0.0f;
+ if (mSmoothHandlePanEnabled)
+ {
+ adjustedDisplacementX = CalculateAdjustedDisplacement(handle.position.x, handle.grabDisplacementX, mControlSize.x);
+ adjustedDisplacementY = CalculateAdjustedDisplacement(handle.position.y, handle.grabDisplacementY, (mControlSize.y - handle.lineHeight));
+ }
+ handle.actor.SetProperty(Actor::Property::POSITION,
+ Vector2(handle.position.x + floor(0.5f * mCursorWidth) + adjustedDisplacementX,
+ yLocalPosition + adjustedDisplacementY));
+ }
+ }
+
+ float CalculateAdjustedDisplacement(float position, float displacement, float edge)
+ {
+ //Apply the displacement (on the X-axis & the Y-axis)
+ //as long as it does not exceed the control's edge.
+ float adjustedDisplacement = 0.0f;
+ if(position + displacement < 0.0f)
+ {
+ // -position to cancel it out and relocate to 0.
+ adjustedDisplacement = -position;
+ }
+ else if(position + displacement > edge)
+ {
+ // move in a displacement which is sufficient to reach the edge.
+ adjustedDisplacement = edge - position;
+ }
+ else
{
- handle.actor.SetProperty(Actor::Property::POSITION, Vector2(handle.position.x + (mSmoothHandlePanEnabled ? handle.grabDisplacementX : 0.f), yLocalPosition + (mSmoothHandlePanEnabled ? handle.grabDisplacementY : 0.f)));
+ // move normally in the displacement.
+ adjustedDisplacement = displacement;
}
+ return adjustedDisplacement;
}
void SetHandleImage(HandleType type)
void AnimatedImageVisual::OnDoAction(const Dali::Property::Index actionId, const Dali::Property::Value& attributes)
{
- // Check if action is valid for this visual type and perform action if possible
+ // Make not set any action when the resource status is already failed.
+ if(mImpl->mResourceStatus == Toolkit::Visual::ResourceStatus::FAILED)
+ {
+ return;
+ }
+ // Check if action is valid for this visual type and perform action if possible
switch(actionId)
{
case DevelAnimatedImageVisual::Action::PAUSE:
void AnimatedImageVisual::DoSetProperties(const Property::Map& propertyMap)
{
// url[s] already passed in from constructor
-
for(Property::Map::SizeType iter = 0; iter < propertyMap.Count(); ++iter)
{
KeyValuePair keyValue = propertyMap.GetKeyValue(iter);
mPlacementActor = actor;
TextureSet textureSet = PrepareTextureSet();
+ // Loading animated image file is failed.
+ if(!mImageCache ||
+ (mAnimatedImageLoading && !mAnimatedImageLoading.HasLoadingSucceeded()))
+ {
+ textureSet = SetLoadingFailed();
+ }
+
if(textureSet) // if the image loading is successful
{
StartFirstFrame(textureSet);
mFrameDelayTimer.TickSignal().Connect(this, &AnimatedImageVisual::DisplayNextFrame);
mFrameDelayTimer.Start();
}
- DALI_LOG_INFO(gAnimImgLogFilter, Debug::Concise, "ResourceReady(ResourceStatus::READY)\n");
- ResourceReady(Toolkit::Visual::ResourceStatus::READY);
+
+ if(mImpl->mResourceStatus != Toolkit::Visual::ResourceStatus::FAILED)
+ {
+ DALI_LOG_INFO(gAnimImgLogFilter, Debug::Concise, "ResourceReady(ResourceStatus::READY)\n");
+ ResourceReady(Toolkit::Visual::ResourceStatus::READY);
+ }
}
TextureSet AnimatedImageVisual::PrepareTextureSet()
void AnimatedImageVisual::FrameReady(TextureSet textureSet)
{
- if(textureSet)
+ // When image visual requested to load new frame to mImageCache and it is failed.
+ if(!textureSet)
{
- SetImageSize(textureSet);
+ textureSet = SetLoadingFailed();
+ }
- if(mStartFirstFrame)
- {
- StartFirstFrame(textureSet);
- }
- else
- {
- if(mImpl->mRenderer)
- {
- mImpl->mRenderer.SetTextures(textureSet);
- }
- }
+ SetImageSize(textureSet);
+
+ if(mStartFirstFrame)
+ {
+ StartFirstFrame(textureSet);
}
else
{
- DALI_LOG_INFO(gAnimImgLogFilter, Debug::Concise, "ResourceReady(ResourceStatus::FAILED)\n");
- ResourceReady(Toolkit::Visual::ResourceStatus::FAILED);
+ if(mImpl->mRenderer)
+ {
+ mImpl->mRenderer.SetTextures(textureSet);
+ }
}
}
bool AnimatedImageVisual::DisplayNextFrame()
{
- bool continueTimer = false;
+ TextureSet textureSet;
+ bool continueTimer = false;
if(mImageCache)
{
DALI_LOG_INFO(gAnimImgLogFilter, Debug::Concise, "AnimatedImageVisual::DisplayNextFrame(this:%p) CurrentFrameIndex:%d\n", this, frameIndex);
- TextureSet textureSet;
if(nextFrame)
{
textureSet = mImageCache->NextFrame();
textureSet = mImageCache->Frame(frameIndex);
}
- if(textureSet)
+ continueTimer = (mActionStatus == DevelAnimatedImageVisual::Action::PLAY) ? true : false;
+ }
+
+ if(textureSet)
+ {
+ SetImageSize(textureSet);
+ if(mImpl->mRenderer)
{
- SetImageSize(textureSet);
- if(mImpl->mRenderer)
- {
- mImpl->mRenderer.SetTextures(textureSet);
- }
+ mImpl->mRenderer.SetTextures(textureSet);
}
-
- continueTimer = (mActionStatus == DevelAnimatedImageVisual::Action::PLAY) ? true : false;
}
return continueTimer;
}
+TextureSet AnimatedImageVisual::SetLoadingFailed()
+{
+ DALI_LOG_INFO(gAnimImgLogFilter, Debug::Concise, "ResourceReady(ResourceStatus::FAILED)\n");
+ ResourceReady(Toolkit::Visual::ResourceStatus::FAILED);
+
+ TextureSet textureSet = TextureSet::New();
+ Texture brokenImage = mFactoryCache.GetBrokenVisualImage();
+ textureSet.SetTexture(0u, brokenImage);
+
+ if(mFrameDelayTimer)
+ {
+ mFrameDelayTimer.Stop();
+ mFrameDelayTimer.Reset();
+ }
+
+ SetImageSize(textureSet);
+
+ return textureSet;
+}
+
} // namespace Internal
} // namespace Toolkit
*/
void InitializeAnimatedImage(const VisualUrl& imageUrl);
+ /**
+ * Set the state of loading fail of an image or a frame.
+ * Returns TextureSet of broken image.
+ */
+ TextureSet SetLoadingFailed();
+
// Undefined
AnimatedImageVisual(const AnimatedImageVisual& animatedImageVisual);
#include <dali/devel-api/adaptor-framework/image-loading.h>
#include <dali/devel-api/rendering/renderer-devel.h>
#include <dali/integration-api/debug.h>
+#include <dali/devel-api/common/stage.h>
// INTERNAL INCLUDES
#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
NPatchVisual::~NPatchVisual()
{
- if((mId != NPatchData::INVALID_NPATCH_DATA_ID) && (mReleasePolicy != Toolkit::ImageVisual::ReleasePolicy::NEVER))
+ if(Stage::IsInstalled() && (mId != NPatchData::INVALID_NPATCH_DATA_ID) && (mReleasePolicy != Toolkit::ImageVisual::ReleasePolicy::NEVER))
{
mLoader.Remove(mId, this);
mId = NPatchData::INVALID_NPATCH_DATA_ID;
--- /dev/null
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali-toolkit/public-api/controls/camera-view/camera-view.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/controls/camera-view/camera-view-impl.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+CameraView::CameraView()
+{
+}
+
+CameraView::CameraView(const CameraView& cameraView) = default;
+
+CameraView::CameraView(CameraView&& rhs) = default;
+
+CameraView& CameraView::operator=(const CameraView& cameraView) = default;
+
+CameraView& CameraView::operator=(CameraView&& rhs) = default;
+
+CameraView::~CameraView()
+{
+}
+
+CameraView CameraView::New(Any handle, DisplayType type)
+{
+ return Internal::CameraView::New(handle, type);
+}
+
+CameraView CameraView::DownCast(BaseHandle handle)
+{
+ return Control::DownCast<CameraView, Internal::CameraView>(handle);
+}
+
+void CameraView::Update()
+{
+ Dali::Toolkit::GetImpl(*this).Update();
+}
+
+CameraView::CameraView(Internal::CameraView& implementation)
+: Control(implementation)
+{
+}
+
+CameraView::CameraView(Dali::Internal::CustomActor* internal)
+: Control(internal)
+{
+ VerifyCustomActorPointer<Internal::CameraView>(internal);
+}
+
+} // namespace Toolkit
+
+} // namespace Dali
\ No newline at end of file
--- /dev/null
+#ifndef DALI_TOOLKIT_CAMERA_VIEW_H
+#define DALI_TOOLKIT_CAMERA_VIEW_H
+
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/controls/control.h>
+
+namespace Dali
+{
+class Any;
+
+namespace Toolkit
+{
+namespace Internal DALI_INTERNAL
+{
+class CameraView;
+} // namespace DALI_INTERNAL
+
+/**
+ * @addtogroup dali_toolkit_controls_camera_view
+ * @{
+ */
+
+/**
+ * @brief CameraView is a control for camera display.
+ *
+ * For working CameraView, a camera plugin for a platform should be provided.
+ */
+class DALI_TOOLKIT_API CameraView : public Control
+{
+public:
+ /**
+ * @brief Camera display type
+ */
+ enum class DisplayType
+ {
+ WINDOW = 0, // Overlay type
+ IMAGE // Native Image type
+ };
+
+ /**
+ * @brief Creates an initialized CameraView.
+ * @param[in] handle Multimedia camera player handle
+ * @param[in] type Where it is an overlay type or a native image type
+ * @return A handle to a newly allocated Dali ImageView
+ */
+ static CameraView New(Any handle, DisplayType type = DisplayType::WINDOW);
+
+ /**
+ * @brief Creates an uninitialized CameraView.
+ */
+ CameraView();
+
+ /**
+ * @brief Destructor.
+ *
+ * This is non-virtual since derived Handel types must not contain data or virtual methods.
+ */
+ ~CameraView();
+
+ /**
+ * @brief Copy constructor.
+ *
+ * @param[in] CameraView CameraView to copy. The copied CameraView will point at the same implementation
+ */
+ CameraView(const CameraView& CameraView);
+
+ /**
+ * @brief Move constructor
+ *
+ * @param[in] rhs A reference to the moved handle
+ */
+ CameraView(CameraView&& rhs);
+
+ /**
+ * @brief Update camera view
+ *
+ * Multimedia camera operation is work outside the view.
+ * So, This must be called when the view needs to be updated after camera operation.
+ */
+ void Update();
+
+ /**
+ * @brief Assignment operator.
+ *
+ * @param[in] CameraView The CameraView to assign from
+ * @return The updated CameraView
+ */
+ CameraView& operator=(const CameraView& CameraView);
+
+ /**
+ * @brief Move assignment
+ *
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this
+ */
+ CameraView& operator=(CameraView&& rhs);
+
+ /**
+ * @brief Downcasts a handle to CameraView handle.
+ *
+ * If handle points to a CameraView, the downcast produces valid handle.
+ * If not, the returned handle is left uninitialized.
+ *
+ * @param[in] handle Handle to an object
+ * @return Handle to a CameraView or an uninitialized handle
+ */
+ static CameraView DownCast(BaseHandle handle);
+
+public: // Not intended for application developers
+ /// @cond internal
+ /**
+ * @brief Creates a handle using the Toolkit::Internal implementation.
+ *
+ * @param[in] implementation The CameraView implementation
+ */
+ DALI_INTERNAL CameraView(Internal::CameraView& implementation);
+
+ /**
+ * @brief Allows the creation of this CameraView from an Internal::CustomActor pointer.
+ *
+ * @param[in] internal A pointer to the internal CustomActor
+ */
+ DALI_INTERNAL CameraView(Dali::Internal::CustomActor* internal);
+ /// @endcond
+};
+
+/**
+ * @}
+ */
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_CAMERA_VIEW_H
{
const unsigned int TOOLKIT_MAJOR_VERSION = 2;
const unsigned int TOOLKIT_MINOR_VERSION = 0;
-const unsigned int TOOLKIT_MICRO_VERSION = 17;
+const unsigned int TOOLKIT_MICRO_VERSION = 18;
const char* const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
${public_api_src_dir}/controls/text-controls/text-label.cpp
${public_api_src_dir}/controls/text-controls/text-field.cpp
${public_api_src_dir}/controls/video-view/video-view.cpp
+ ${public_api_src_dir}/controls/camera-view/camera-view.cpp
${public_api_src_dir}/image-loader/image.cpp
${public_api_src_dir}/image-loader/async-image-loader.cpp
${public_api_src_dir}/image-loader/sync-image-loader.cpp
${public_api_src_dir}/controls/video-view/video-view.h
)
+SET( public_api_camera_view_header_files
+ ${public_api_src_dir}/controls/camera-view/camera-view.h
+)
+
SET( public_api_visuals_header_files
${public_api_src_dir}/visuals/border-visual-properties.h
${public_api_src_dir}/visuals/color-visual-properties.h
${public_api_text_header_files}
${public_api_video_view_header_files}
${public_api_visuals_header_files}
+ ${public_api_camera_view_header_files}
)
Name: dali2-toolkit
Summary: Dali 3D engine Toolkit
-Version: 2.0.17
+Version: 2.0.18
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-3-Clause and MIT
Summary: DLI scene loading library
Group: System/Libraries
License: Apache-2.0
-
-BuildRequires: pkgconfig(dali2-toolkit)
+Requires: dali2-toolkit
%description -n %{dali2_scene_loader}
Provides functionality for loading and displaying DLI format scenes. See README.md for more details.