{
+ "config":
+ {
+ "alwaysShowFocus":false
+ },
"constants":
{
"CONFIG_SCRIPT_LOG_LEVEL":"NoLogging"
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/toolkit-trigger-event-factory.cpp
dali-toolkit-test-utils/dali-test-suite-utils.cpp
dali-toolkit-test-utils/dummy-control.cpp
dali-toolkit-test-utils/mesh-builder.cpp
--- /dev/null
+
+#include <dali/integration-api/adaptors/trigger-event-interface.h>
+#include <dali/integration-api/adaptors/trigger-event-factory.h>
+#include <dali/public-api/signals/callback.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Toolkit
+{
+
+class TriggerEvent: public Dali::TriggerEventInterface
+{
+public:
+
+ TriggerEvent( Dali::CallbackBase* callback, Dali::TriggerEventInterface::Options Options );
+ ~TriggerEvent(){}
+
+ void Trigger();
+
+private:
+ Dali::CallbackBase* mCallback;
+
+};
+
+TriggerEvent::TriggerEvent( Dali::CallbackBase* callback, Dali::TriggerEventInterface::Options Options )
+ : mCallback( callback )
+{
+}
+
+void TriggerEvent::Trigger()
+{
+ Dali::CallbackBase::Execute( *mCallback );
+}
+
+} // namespace Toolkit
+
+} // namespace Internal
+
+} // namespace Dali
+
+Dali::TriggerEventInterface* Dali::TriggerEventFactory::CreateTriggerEvent( Dali::CallbackBase* callback, Dali::TriggerEventInterface::Options options )
+{
+ return new Dali::Internal::Toolkit::TriggerEvent( callback, options );
+}
+
+void Dali::TriggerEventFactory::DestroyTriggerEvent( Dali::TriggerEventInterface* triggerEventInterface )
+{
+ Dali::Internal::Toolkit::TriggerEvent* triggerEvent( static_cast< Dali::Internal::Toolkit::TriggerEvent *>(triggerEventInterface) );
+ delete triggerEvent;
+}
return 0;
}
+void VideoPlayer::SetDisplayArea( DisplayArea area )
+{
+}
+
void VideoPlayer::SetDisplayRotation( Dali::VideoPlayerPlugin::DisplayRotation rotation )
{
}
return Internal::Adaptor::GetImplementation( *this ).mFinishedSignal;
}
+void VideoPlayer::Forward( int millisecond )
+{
+}
+
+void VideoPlayer::Backward( int millisecond )
+{
+}
+
} // namespace Dali;
int GetPlayPosition();
+ void SetDisplayArea( DisplayArea area );
+
void SetDisplayRotation( Dali::VideoPlayerPlugin::DisplayRotation rotation );
Dali::VideoPlayerPlugin::DisplayRotation GetDisplayRotation();
Dali::VideoPlayerPlugin::VideoPlayerSignalType& FinishedSignal();
+ void Forward( int millisecond );
+
+ void Backward( int millisecond );
+
private:
VideoPlayer( Internal::Adaptor::VideoPlayer* internal );
END_TEST;
}
+
+int UtcDaliBuilderConfigurationP(void)
+{
+ ToolkitTestApplication application;
+
+ // JSON with a quit event when the actor is touched
+ std::string json(
+ "{\n"
+ " \"config\":\n"
+ " {\n"
+ " \"alwaysShowFocus\":true\n"
+ " }\n"
+ "}\n"
+ );
+
+ Builder builder = Builder::New();
+ builder.LoadFromString( json );
+
+ Property::Map map = builder.GetConfigurations();
+
+ Dali::Property::Value* pValue = map.Find( "alwaysShowFocus" );
+
+ DALI_TEST_CHECK( pValue );
+
+ bool value = pValue->Get<bool>();
+
+ DALI_TEST_CHECK( value );
+
+ END_TEST;
+}
const char* TEST_IMAGE_FILE_NAME = "gallery_image_01.jpg";
const char* TEST_IMAGE_FILE_NAME2 = "gallery_image_02.jpg";
+const char* TEST_IMAGE_1 = TEST_RESOURCE_DIR "/TB-gloss.png";
+const char* TEST_IMAGE_2 = TEST_RESOURCE_DIR "/tb-norm.png";
+
// resolution: 34*34, pixel format: RGBA8888
static const char* gImage_34_RGBA = TEST_RESOURCE_DIR "/icon-edit.png";
// resolution: 600*600, pixel format: RGB888
END_TEST;
}
+
+
+int UtcDaliImageViewReplaceImage(void)
+{
+ ToolkitTestApplication application;
+
+ gResourceReadySignalFired = false;
+
+ int width = 100;
+ int height = 200;
+ Image image = CreateBufferImage( width, height, Vector4(1.f, 1.f, 1.f, 1.f) );
+
+ // Check ImageView with background and main image, to ensure both visuals are marked as loaded
+ ImageView imageView = ImageView::New( TEST_IMAGE_1 );
+
+ DALI_TEST_EQUALS( Toolkit::DevelControl::IsResourceReady( imageView ), false, TEST_LOCATION );
+
+ Toolkit::DevelControl::ResourceReadySignal( imageView ).Connect( &ResourceReadySignal);
+
+ Stage::GetCurrent().Add( imageView );
+
+ application.SendNotification();
+ application.Render(16);
+
+ // loading started, this waits for the loader thread for max 30 seconds
+ DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+
+ DALI_TEST_EQUALS( imageView.GetRendererCount(), 1u, TEST_LOCATION );
+
+ DALI_TEST_EQUALS( gResourceReadySignalFired, true, TEST_LOCATION );
+
+ gResourceReadySignalFired = false;
+
+ imageView.SetImage(TEST_IMAGE_2);
+
+ application.SendNotification();
+ application.Render(16);
+
+ // loading started, this waits for the loader thread for max 30 seconds
+ DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+
+ DALI_TEST_EQUALS( imageView.GetRendererCount(), 1u, TEST_LOCATION );
+
+ DALI_TEST_EQUALS( Toolkit::DevelControl::IsResourceReady( imageView ), true, TEST_LOCATION );
+
+ DALI_TEST_EQUALS( gResourceReadySignalFired, true, TEST_LOCATION );
+
+ END_TEST;
+}
END_TEST;
}
+int UtcDaliImageVisualTextureCancelAsyncLoad(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline( "Load image asynchronosly, cancel loading, then load again" );
+
+ VisualFactory factory = VisualFactory::Get();
+ DALI_TEST_CHECK( factory );
+
+ Property::Map propertyMap;
+ propertyMap.Insert( Visual::Property::TYPE, Visual::IMAGE );
+ propertyMap.Insert( ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME );
+
+ Visual::Base visual = factory.CreateVisual( propertyMap );
+ DALI_TEST_CHECK( visual );
+
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
+ textureTrace.Enable( true );
+ TraceCallStack& drawTrace = gl.GetDrawTrace();
+ drawTrace.Enable( true );
+
+ DummyControl actor = DummyControl::New();
+ DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
+ dummyImpl.RegisterVisual( Control::Property::BACKGROUND, visual );
+
+ Stage::GetCurrent().Add( actor );
+
+ // Cancel loading
+ Stage::GetCurrent().Remove( actor );
+
+ Stage::GetCurrent().Add( actor );
+
+ // Create another visual with the same image
+ visual = factory.CreateVisual( propertyMap );
+ DALI_TEST_CHECK( visual );
+
+ dummyImpl.RegisterVisual( Control::Property::BACKGROUND, visual );
+
+ application.SendNotification();
+ DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION );
+ DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION );
+ DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
+ DALI_TEST_EQUALS( drawTrace.FindMethod("DrawArrays"), true, TEST_LOCATION );
+
+ END_TEST;
+}
+
int UtcDaliImageVisualSetInvalidAsyncImage(void)
{
ToolkitTestApplication application;
const char* const PROPERTY_NAME_PLACEHOLDER_TEXT = "placeholderText";
const char* const PROPERTY_NAME_PLACEHOLDER_TEXT_COLOR = "placeholderTextColor";
const char* const PROPERTY_NAME_ENABLE_SELECTION = "enableSelection";
+const char* const PROPERTY_NAME_PLACEHOLDER = "placeholder";
const int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::Text::DEFAULT_RENDERING_BACKEND;
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_PLACEHOLDER_TEXT ) == DevelTextEditor::Property::PLACEHOLDER_TEXT );
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_PLACEHOLDER_TEXT_COLOR ) == DevelTextEditor::Property::PLACEHOLDER_TEXT_COLOR );
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_ENABLE_SELECTION ) == DevelTextEditor::Property::ENABLE_SELECTION );
+ DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_PLACEHOLDER ) == DevelTextEditor::Property::PLACEHOLDER );
END_TEST;
}
editor.SetProperty( DevelTextEditor::Property::PLACEHOLDER_TEXT_COLOR, Color::RED );
DALI_TEST_EQUALS( editor.GetProperty<Vector4>( DevelTextEditor::Property::PLACEHOLDER_TEXT_COLOR ), Color::RED, TEST_LOCATION );
+ // Check the enable selection property
editor.SetProperty( DevelTextEditor::Property::ENABLE_SELECTION, false );
DALI_TEST_EQUALS( editor.GetProperty<bool>( DevelTextEditor::Property::ENABLE_SELECTION ), false, TEST_LOCATION );
+ // Check the placeholder property with pixel size
+ Property::Map placeholderPixelSizeMapSet;
+ Property::Map placeholderPixelSizeMapGet;
+ Property::Map placeholderFontstyleMap;
+ placeholderPixelSizeMapSet["placeholderText"] = "Setting Placeholder Text";
+ placeholderPixelSizeMapSet["placeholderColor"] = Color::BLUE;
+ placeholderPixelSizeMapSet["placeholderFontFamily"] = "Arial";
+ placeholderPixelSizeMapSet["placeholderPixelSize"] = 15.0f;
+
+ placeholderFontstyleMap.Insert( "weight", "bold" );
+ placeholderPixelSizeMapSet["placeholderFontStyle"] = placeholderFontstyleMap;
+ editor.SetProperty( DevelTextEditor::Property::PLACEHOLDER, placeholderPixelSizeMapSet );
+
+ placeholderPixelSizeMapGet = editor.GetProperty<Property::Map>( DevelTextEditor::Property::PLACEHOLDER );
+ DALI_TEST_EQUALS( placeholderPixelSizeMapGet.Count(), placeholderPixelSizeMapSet.Count(), TEST_LOCATION );
+ DALI_TEST_EQUALS( DaliTestCheckMaps( placeholderPixelSizeMapGet, placeholderPixelSizeMapSet ), true, TEST_LOCATION );
+
+ // Check the placeholder property with point size
+ Property::Map placeholderMapSet;
+ Property::Map placeholderMapGet;
+ placeholderMapSet["placeholderText"] = "Setting Placeholder Text";
+ placeholderMapSet["placeholderColor"] = Color::RED;
+ placeholderMapSet["placeholderFontFamily"] = "Arial";
+ placeholderMapSet["placeholderPointSize"] = 12.0f;
+
+ // Check the placeholder font style property
+ placeholderFontstyleMap.Clear();
+
+ placeholderFontstyleMap.Insert( "weight", "bold" );
+ placeholderFontstyleMap.Insert( "width", "condensed" );
+ placeholderFontstyleMap.Insert( "slant", "italic" );
+ placeholderMapSet["placeholderFontStyle"] = placeholderFontstyleMap;
+ editor.SetProperty( DevelTextEditor::Property::PLACEHOLDER, placeholderMapSet );
+
+ placeholderMapGet = editor.GetProperty<Property::Map>( DevelTextEditor::Property::PLACEHOLDER );
+ DALI_TEST_EQUALS( placeholderMapGet.Count(), placeholderMapSet.Count(), TEST_LOCATION );
+ DALI_TEST_EQUALS( DaliTestCheckMaps( placeholderMapGet, placeholderMapSet ), true, TEST_LOCATION );
+
+ // Reset font style.
+ placeholderFontstyleMap.Clear();
+ placeholderFontstyleMap.Insert( "weight", "normal" );
+ placeholderFontstyleMap.Insert( "slant", "oblique" );
+ placeholderMapSet["placeholderFontStyle"] = placeholderFontstyleMap;
+ editor.SetProperty( DevelTextEditor::Property::PLACEHOLDER, placeholderMapSet );
+
+ placeholderMapGet = editor.GetProperty<Property::Map>( DevelTextEditor::Property::PLACEHOLDER );
+ DALI_TEST_EQUALS( placeholderMapGet.Count(), placeholderMapSet.Count(), TEST_LOCATION );
+ DALI_TEST_EQUALS( DaliTestCheckMaps( placeholderMapGet, placeholderMapSet ), true, TEST_LOCATION );
+
+ placeholderFontstyleMap.Clear();
+ placeholderFontstyleMap.Insert( "slant", "roman" );
+ placeholderMapSet["placeholderFontStyle"] = placeholderFontstyleMap;
+ editor.SetProperty( DevelTextEditor::Property::PLACEHOLDER, placeholderMapSet );
+
+ placeholderMapGet = editor.GetProperty<Property::Map>( DevelTextEditor::Property::PLACEHOLDER );
+
+ placeholderFontstyleMap.Clear();
+ placeholderMapSet["placeholderFontStyle"] = placeholderFontstyleMap;
+
+ editor.SetProperty( DevelTextEditor::Property::PLACEHOLDER, placeholderMapSet );
+ placeholderMapGet = editor.GetProperty<Property::Map>( DevelTextEditor::Property::PLACEHOLDER );
+ DALI_TEST_EQUALS( placeholderMapGet.Count(), placeholderMapSet.Count(), TEST_LOCATION );
+ DALI_TEST_EQUALS( DaliTestCheckMaps( placeholderMapGet, placeholderMapSet ), true, TEST_LOCATION );
+
END_TEST;
}
const char* const PROPERTY_NAME_HIDDEN_INPUT_SETTINGS = "hiddenInputSettings";
const char* const PROPERTY_NAME_PIXEL_SIZE = "pixelSize";
const char* const PROPERTY_NAME_ENABLE_SELECTION = "enableSelection";
+const char* const PROPERTY_NAME_PLACEHOLDER = "placeholder";
const int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::Text::DEFAULT_RENDERING_BACKEND;
DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_HIDDEN_INPUT_SETTINGS ) == DevelTextField::Property::HIDDEN_INPUT_SETTINGS );
DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_PIXEL_SIZE ) == DevelTextField::Property::PIXEL_SIZE );
DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_ENABLE_SELECTION ) == DevelTextField::Property::ENABLE_SELECTION );
+ DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_PLACEHOLDER ) == DevelTextField::Property::PLACEHOLDER );
END_TEST;
}
field.SetProperty( DevelTextField::Property::PIXEL_SIZE, 20.f );
DALI_TEST_EQUALS( field.GetProperty<float>( DevelTextField::Property::PIXEL_SIZE ), 20.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+ // Check the enable selection property
field.SetProperty( DevelTextField::Property::ENABLE_SELECTION, false );
DALI_TEST_EQUALS( field.GetProperty<bool>( DevelTextField::Property::ENABLE_SELECTION ), false, TEST_LOCATION );
+ // Check the placeholder property with pixel size
+ Property::Map placeholderPixelSizeMapSet;
+ Property::Map placeholderPixelSizeMapGet;
+ Property::Map placeholderFontstyleMap;
+ placeholderPixelSizeMapSet["placeholderText"] = "Setting Placeholder Text";
+ placeholderPixelSizeMapSet["placeholderColor"] = Color::BLUE;
+ placeholderPixelSizeMapSet["placeholderFontFamily"] = "Arial";
+ placeholderPixelSizeMapSet["placeholderPixelSize"] = 15.0f;
+
+ placeholderFontstyleMap.Insert( "weight", "bold" );
+ placeholderPixelSizeMapSet["placeholderFontStyle"] = placeholderFontstyleMap;
+ field.SetProperty( DevelTextField::Property::PLACEHOLDER, placeholderPixelSizeMapSet );
+
+ placeholderPixelSizeMapGet = field.GetProperty<Property::Map>( DevelTextField::Property::PLACEHOLDER );
+ DALI_TEST_EQUALS( placeholderPixelSizeMapGet.Count(), placeholderPixelSizeMapSet.Count(), TEST_LOCATION );
+ DALI_TEST_EQUALS( DaliTestCheckMaps( placeholderPixelSizeMapGet, placeholderPixelSizeMapSet ), true, TEST_LOCATION );
+
+ // Check the placeholder property with point size
+ Property::Map placeholderMapSet;
+ Property::Map placeholderMapGet;
+ placeholderMapSet["placeholderText"] = "Setting Placeholder Text";
+ placeholderMapSet["placeholderColor"] = Color::RED;
+ placeholderMapSet["placeholderFontFamily"] = "Arial";
+ placeholderMapSet["placeholderPointSize"] = 12.0f;
+
+ // Check the placeholder font style property
+ placeholderFontstyleMap.Clear();
+
+ placeholderFontstyleMap.Insert( "weight", "bold" );
+ placeholderFontstyleMap.Insert( "width", "condensed" );
+ placeholderFontstyleMap.Insert( "slant", "italic" );
+ placeholderMapSet["placeholderFontStyle"] = placeholderFontstyleMap;
+ field.SetProperty( DevelTextField::Property::PLACEHOLDER, placeholderMapSet );
+
+ placeholderMapGet = field.GetProperty<Property::Map>( DevelTextField::Property::PLACEHOLDER );
+ DALI_TEST_EQUALS( placeholderMapGet.Count(), placeholderMapSet.Count(), TEST_LOCATION );
+ DALI_TEST_EQUALS( DaliTestCheckMaps( placeholderMapGet, placeholderMapSet ), true, TEST_LOCATION );
+
+ // Reset font style.
+ placeholderFontstyleMap.Clear();
+ placeholderFontstyleMap.Insert( "weight", "normal" );
+ placeholderFontstyleMap.Insert( "slant", "oblique" );
+ placeholderMapSet["placeholderFontStyle"] = placeholderFontstyleMap;
+ field.SetProperty( DevelTextField::Property::PLACEHOLDER, placeholderMapSet );
+
+ placeholderMapGet = field.GetProperty<Property::Map>( DevelTextField::Property::PLACEHOLDER );
+ DALI_TEST_EQUALS( placeholderMapGet.Count(), placeholderMapSet.Count(), TEST_LOCATION );
+ DALI_TEST_EQUALS( DaliTestCheckMaps( placeholderMapGet, placeholderMapSet ), true, TEST_LOCATION );
+
+ placeholderFontstyleMap.Clear();
+ placeholderFontstyleMap.Insert( "slant", "roman" );
+ placeholderMapSet["placeholderFontStyle"] = placeholderFontstyleMap;
+ field.SetProperty( DevelTextField::Property::PLACEHOLDER, placeholderMapSet );
+
+ placeholderMapGet = field.GetProperty<Property::Map>( DevelTextField::Property::PLACEHOLDER );
+
+ placeholderFontstyleMap.Clear();
+ placeholderMapSet["placeholderFontStyle"] = placeholderFontstyleMap;
+
+ field.SetProperty( DevelTextField::Property::PLACEHOLDER, placeholderMapSet );
+ placeholderMapGet = field.GetProperty<Property::Map>( DevelTextField::Property::PLACEHOLDER );
+ DALI_TEST_EQUALS( placeholderMapGet.Count(), placeholderMapSet.Count(), TEST_LOCATION );
+ DALI_TEST_EQUALS( DaliTestCheckMaps( placeholderMapGet, placeholderMapSet ), true, TEST_LOCATION );
+
END_TEST;
}
const char* const VOLUME_RIGHT( "volumeRight" );
const char* const RENDERING_TYPE( "renderingTarget" );
+const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
+ attribute mediump vec2 aPosition;\n
+ varying mediump vec2 vTexCoord;\n
+ uniform mediump mat4 uMvpMatrix;\n
+ uniform mediump vec3 uSize;\n
+ \n
+ void main()\n
+ {\n
+ mediump vec4 vertexPosition = vec4(aPosition, 0.0, 1.0);\n
+ vertexPosition.xyz *= uSize;\n
+ vertexPosition = uMvpMatrix * vertexPosition;\n
+ \n
+ vTexCoord = aPosition + vec2(0.5);\n
+ gl_Position = vertexPosition;\n
+ }\n
+);
+
+const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
+ varying mediump vec2 vTexCoord;\n
+ uniform sampler2D sTexture;\n
+ uniform lowp vec4 uColor;\n
+ \n
+ void main()\n
+ {\n
+ gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor;\n
+ }\n
+);
+
}
void video_view_startup(void)
END_TEST;
}
+
+int UtcDaliVideoViewCustomShaderForCoverage(void)
+{
+ ToolkitTestApplication application;
+ VideoView videoView = VideoView::New();
+ DALI_TEST_CHECK( videoView );
+
+ Stage::GetCurrent().Add( videoView );
+ videoView.SetProperty( VideoView::Property::VIDEO, "testvideo" );
+
+ Property::Map customShader;
+ customShader.Insert( "vertexShader", VERTEX_SHADER );
+ customShader.Insert( "fragmentShader", FRAGMENT_SHADER );
+
+ Property::Map map;
+ map.Insert( "shader", customShader );
+
+ videoView.SetProperty( VideoView::Property::VIDEO, map );
+
+ Property::Map map2;
+ Property::Value value = videoView.GetProperty( VideoView::Property::VIDEO );
+
+ DALI_TEST_CHECK( !value.Get( map2 ) );
+ END_TEST;
+}
+
+int UtcDaliVideoViewMethodsForCoverage2(void)
+{
+ ToolkitTestApplication application;
+ VideoView videoView = VideoView::New();
+ DALI_TEST_CHECK( videoView );
+
+ Property::Map windowSurfaceTarget;
+
+ windowSurfaceTarget.Insert( RENDERING_TYPE, "windowSurfaceTarget" );
+
+ Stage::GetCurrent().Add( videoView );
+
+ application.SendNotification();
+ application.Render();
+
+ Property::Map map;
+ Property::Value value;
+ videoView.SetProperty( VideoView::Property::VIDEO, windowSurfaceTarget );
+
+ value = videoView.GetProperty( VideoView::Property::VIDEO );
+ DALI_TEST_CHECK( value.Get( map ) );
+
+ Property::Value* type = map.Find( RENDERING_TYPE );
+ DALI_TEST_CHECK( type );
+ DALI_TEST_EQUALS( "windowSurfaceTarget", type->Get<std::string>(), TEST_LOCATION );
+
+ Vector3 vector(100.0f, 100.0f, 0.0f);
+
+ DALI_TEST_CHECK(vector != videoView.GetCurrentSize());
+ videoView.SetSize( vector );
+
+ application.SendNotification();
+ application.Render();
+
+ // Check the size in the new frame
+ DALI_TEST_CHECK(vector == videoView.GetCurrentSize());
+
+ END_TEST;
+}
develapiimageloaderdir = $(develapidir)/image-loader
develapiscriptingdir = $(develapidir)/scripting
develapishadereffectsdir = $(develapidir)/shader-effects
+develapistylingdir = $(develapidir)/styling
develapitransitioneffectsdir = $(develapidir)/transition-effects
develapitoolbardir = $(develapicontrolsdir)/tool-bar
develapitooltipdir = $(develapicontrolsdir)/tooltip
develapiscripting_HEADERS = $(devel_api_scripting_header_files)
develapishadowview_HEADERS = $(devel_api_shadow_view_header_files)
develapishadereffects_HEADERS = $(devel_api_shader_effects_header_files)
+develapistyling_HEADERS = $(devel_api_styling_header_files)
develapisuperblurview_HEADERS = $(devel_api_super_blur_view_header_files)
develapitoolbar_HEADERS = $(devel_api_tool_bar_header_files)
develapitooltip_HEADERS = $(devel_api_tooltip_header_files)
GetImpl(*this).AddConstant( key, value );
}
+const Property::Map& Builder::GetConfigurations() const
+{
+ return GetImpl(*this).GetConfigurations();
+}
+
const Property::Map& Builder::GetConstants() const
{
return GetImpl(*this).GetConstants();
void AddConstant( const std::string& key, const Property::Value& value );
/**
+ * @brief Gets all currently defined configurations.
+ *
+ * @pre The Builder has been initialized.
+ * @return A reference to the currently defined configurations.
+ */
+ const Property::Map& GetConfigurations() const;
+
+ /**
* @brief Gets all currently defined constants.
*
* e.g.
bool IsResourceReady( const Control& control )
{
const Internal::Control& internalControl = Toolkit::Internal::GetImplementation(control);
- const Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( internalControl );
+ const Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( internalControl );
- return controlImpl.IsResourceReady();
+ return controlDataImpl.IsResourceReady();
}
void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual )
{
- Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
- controlImpl.RegisterVisual( index, visual );
+ Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( control );
+ controlDataImpl.RegisterVisual( index, visual );
}
void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, int depthIndex )
{
- Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
- controlImpl.RegisterVisual( index, visual, depthIndex );
+ Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( control );
+ controlDataImpl.RegisterVisual( index, visual, depthIndex );
}
void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, bool enabled )
{
- Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
- controlImpl.RegisterVisual( index, visual, enabled );
+ Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( control );
+ controlDataImpl.RegisterVisual( index, visual, enabled );
}
void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, bool enabled, int depthIndex )
{
- Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
- controlImpl.RegisterVisual( index, visual, enabled, depthIndex );
+ Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( control );
+ controlDataImpl.RegisterVisual( index, visual, enabled, depthIndex );
}
void UnregisterVisual( Internal::Control& control, Dali::Property::Index index )
{
- Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
- controlImpl.UnregisterVisual( index );
+ Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( control );
+ controlDataImpl.UnregisterVisual( index );
}
Toolkit::Visual::Base GetVisual( const Internal::Control& control, Dali::Property::Index index )
{
- const Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
- return controlImpl.GetVisual( index );
+ const Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( control );
+ return controlDataImpl.GetVisual( index );
}
void EnableVisual( Internal::Control& control, Dali::Property::Index index, bool enable )
{
- Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
- controlImpl.EnableVisual( index, enable );
+ Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( control );
+ controlDataImpl.EnableVisual( index, enable );
}
bool IsVisualEnabled( const Internal::Control& control, Dali::Property::Index index )
{
- const Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
- return controlImpl.IsVisualEnabled( index );
+ const Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( control );
+ return controlDataImpl.IsVisualEnabled( index );
}
Dali::Animation CreateTransition( Internal::Control& control, const Toolkit::TransitionData& handle )
{
- Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
- return controlImpl.CreateTransition( handle );
+ Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( control );
+ return controlDataImpl.CreateTransition( handle );
}
* @brief Enables Text selection, such as the cursor, handle, clipboard, and highlight color.
* @details name "enableSelection", type bool
*/
- ENABLE_SELECTION
+ ENABLE_SELECTION,
+
+ /**
+ * @brief Sets the placeholder : text, color, font family, font style, point size, and pixel size.
+ *
+ * @code
+ * Property::Map propertyMap;
+ * propertyMap["placeholderText"] = "Setting Placeholder Text";
+ * propertyMap["placeholderColor"] = Color::RED;
+ * propertyMap["placeholderFontFamily"] = "Arial";
+ * propertyMap["placeholderPointSize"] = 12.0f;
+ *
+ * Property::Map fontStyleMap;
+ * fontstyleMap.Insert( "weight", "bold" );
+ * fontstyleMap.Insert( "width", "condensed" );
+ * fontstyleMap.Insert( "slant", "italic" );
+ * propertyMap["placeholderFontStyle"] = fontStyleMap;
+ *
+ * editor.SetProperty( DevelTextEditor::Property::PLACEHOLDER, propertyMap );
+ * @endcode
+ *
+ * @details name "placeholder", type MAP
+ */
+ PLACEHOLDER
};
} // namespace Property
* @brief Enables Text selection, such as the cursor, handle, clipboard, and highlight color.
* @details name "enableSelection", type bool
*/
- ENABLE_SELECTION = INPUT_OUTLINE + 3
+ ENABLE_SELECTION = INPUT_OUTLINE + 3,
+
+ /**
+ * @brief Sets the placeholder : text, color, font family, font style, point size, and pixel size.
+ *
+ * @code
+ * Property::Map propertyMap;
+ * propertyMap["placeholderText"] = "Setting Placeholder Text";
+ * propertyMap["placeholderColor"] = Color::RED;
+ * propertyMap["placeholderFontFamily"] = "Arial";
+ * propertyMap["placeholderPointSize"] = 12.0f;
+ *
+ * Property::Map fontStyleMap;
+ * fontstyleMap.Insert( "weight", "bold" );
+ * fontstyleMap.Insert( "width", "condensed" );
+ * fontstyleMap.Insert( "slant", "italic" );
+ * propertyMap["placeholderFontStyle"] = fontStyleMap;
+ *
+ * field.SetProperty( DevelTextField::Property::PLACEHOLDER, propertyMap );
+ * @endcode
+ *
+ * @details name "placeholder", type MAP
+ */
+ PLACEHOLDER = INPUT_OUTLINE + 4
};
} // namespace Property
$(devel_api_src_dir)/image-loader/atlas-upload-observer.cpp \
$(devel_api_src_dir)/image-loader/image-atlas.cpp \
$(devel_api_src_dir)/scripting/script.cpp \
+ $(devel_api_src_dir)/styling/style-manager-devel.cpp \
$(devel_api_src_dir)/transition-effects/cube-transition-cross-effect.cpp \
$(devel_api_src_dir)/transition-effects/cube-transition-effect.cpp \
$(devel_api_src_dir)/transition-effects/cube-transition-fold-effect.cpp \
$(devel_api_src_dir)/shader-effects/motion-blur-effect.h \
$(devel_api_src_dir)/shader-effects/motion-stretch-effect.h
+devel_api_styling_header_files= \
+ $(devel_api_src_dir)/styling/style-manager-devel.h
+
devel_api_super_blur_view_header_files = \
$(devel_api_src_dir)/controls/super-blur-view/super-blur-view.h
--- /dev/null
+/*
+ * Copyright (c) 2017 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/devel-api/styling/style-manager-devel.h>
+#include <dali-toolkit/internal/styling/style-manager-impl.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace DevelStyleManager
+{
+
+const Property::Map GetConfigurations( StyleManager styleManager )
+{
+ return GetImpl(styleManager).GetConfigurations();
+}
+
+} // namespace DevelStyleManager
+
+} // namespace Toolkit
+
+} // namespace Dali
--- /dev/null
+#ifndef DALI_TOOLKIT_STYLE_MANAGER_DEVEL_H
+#define DALI_TOOLKIT_STYLE_MANAGER_DEVEL_H
+
+/*
+ * Copyright (c) 2017 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/styling/style-manager.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace DevelStyleManager
+{
+
+
+/**
+ * @brief Gets all currently defined configurations.
+ *
+ * @pre The Builder has been initialized.
+ * @param[in] styleManager The instance of StyleManager
+ * @return A property map to the currently defined configurations
+**/
+DALI_IMPORT_API const Property::Map GetConfigurations( StyleManager styleManager );
+
+} // namespace DevelStyleManager
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_STYLE_MANAGER_DEVEL_H
}
else
{
+ // load configuration map
+ LoadConfiguration( *parser.GetRoot(), mConfigurationMap );
// load constant map (allows the user to override the constants in the json after loading)
LoadConstants( *parser.GetRoot(), mReplacementMap );
-
// merge includes
if( OptionalChild includes = IsChild(*parser.GetRoot(), KEYNAME_INCLUDES) )
{
mReplacementMap[key] = value;
}
+const Property::Map& Builder::GetConfigurations() const
+{
+ return mConfigurationMap;
+}
+
const Property::Map& Builder::GetConstants() const
{
return mReplacementMap;
{
}
+void Builder::LoadConfiguration( const TreeNode& root, Property::Map& intoMap )
+{
+ Replacement replacer(intoMap);
+
+ if( OptionalChild constants = IsChild(root, "config") )
+ {
+ for(TreeNode::ConstIterator iter = (*constants).CBegin();
+ iter != (*constants).CEnd(); ++iter)
+ {
+ Dali::Property::Value property;
+ if( (*iter).second.GetName() )
+ {
+ DeterminePropertyFromNode( (*iter).second, property, replacer );
+ intoMap[ (*iter).second.GetName() ] = property;
+ }
+ }
+ }
+}
+
void Builder::LoadConstants( const TreeNode& root, Property::Map& intoMap )
{
Replacement replacer(intoMap);
void AddConstant( const std::string& key, const Property::Value& value );
/**
+ * @copydoc Toolkit::Builder::GetConfigurations
+ */
+ const Property::Map& GetConfigurations() const;
+
+ /**
* @copydoc Toolkit::Builder::GetConstants
*/
const Property::Map& GetConstants() const;
void LoadConstants( const TreeNode& root, Property::Map& intoMap );
+ void LoadConfiguration( const TreeNode& root, Property::Map& intoMap );
+
Animation CreateAnimation( const std::string& animationName,
const Replacement& replacement,
Dali::Actor sourceActor );
LinearConstrainerLut mLinearConstrainerLut;
SlotDelegate<Builder> mSlotDelegate;
Property::Map mReplacementMap;
+ Property::Map mConfigurationMap;
MappingsLut mCompleteMappings;
Dictionary<StylePtr> mStyles; // State based styles
Toolkit::Builder::BuilderSignalType mQuitSignal;
}
/**
+ * Move visual from source to destination container
+ */
+void MoveVisual( RegisteredVisualContainer::Iterator sourceIter, RegisteredVisualContainer& source, RegisteredVisualContainer& destination )
+{
+ Toolkit::Visual::Base visual = (*sourceIter)->visual;
+ if( visual )
+ {
+ RegisteredVisual* rv = source.Release( sourceIter );
+ destination.PushBack( rv );
+ }
+}
+
+/**
* Performs actions as requested using the action name.
* @param[in] object The object on which to perform the action.
* @param[in] actionName The action to perform.
// Called by a Visual when it's resource is ready
void Control::Impl::ResourceReady( Visual::Base& object)
{
+ DALI_LOG_INFO( gLogFilter, Debug::Verbose, "ResourceReady \n");
+
+ // A resource is ready, check if is in the replacement visual container
+ // Iterate through all visuals in replacement container and store indexes of ready visuals
+ Dali::Vector <Property::Index> readyVisuals;
+ Actor self = mControlImpl.Self();
+
+ for( auto replacementVisualIter = mReplacementVisuals.Begin();
+ replacementVisualIter < mReplacementVisuals.End(); ++replacementVisualIter )
+ {
+ const Toolkit::Visual::Base replacementVisual = (*replacementVisualIter)->visual;
+ const Internal::Visual::Base& replacementVisualImpl = Toolkit::GetImplementation( replacementVisual );
+
+ if( replacementVisualImpl.IsResourceReady() )
+ {
+ // Check if new replacement visual (index) is already queued for replacement and swap old for new.
+ RegisteredVisualContainer::Iterator registeredVisualsIter;
+ if( FindVisual( (*replacementVisualIter)->index, mVisuals, registeredVisualsIter ) )
+ {
+ Property::Index readyVisualIndex = (*replacementVisualIter)->index;
+ DALI_LOG_INFO( gLogFilter, Debug::Verbose, "ResourceReady: %d Ready to replace\n", readyVisualIndex );
+ readyVisuals.PushBack( readyVisualIndex );
+ // Remove current shown visual from stage and from registered visuals container
+ Toolkit::GetImplementation((*registeredVisualsIter)->visual).SetOffStage( self );
+ mVisuals.Erase( registeredVisualsIter );
+ }
+ }
+ }
+
+ for( auto readyVisualsIter = readyVisuals.Begin(); readyVisualsIter != readyVisuals.End(); readyVisualsIter++ )
+ {
+ DALI_LOG_INFO( gLogFilter, Debug::Verbose, "ResourceReady: %d Matched\n", (*readyVisualsIter) );
+ // Move new visual to be shown from replacement container into the control's registered visuals container
+ // Replacement visual has already been set on stage when it was added to replacement container
+ RegisteredVisualContainer::Iterator readyReplacementVisual;
+ if( FindVisual( (*readyVisualsIter) , mReplacementVisuals, readyReplacementVisual ) )
+ {
+ MoveVisual( readyReplacementVisual, mReplacementVisuals, mVisuals ); // Erases visual from replacement queue
+ }
+ // A visual has been replaced so control will most likely need relayouting
+ mControlImpl.RelayoutRequest();
+ }
// go through and check if all the visuals are ready, if they are emit a signal
- for ( RegisteredVisualContainer::ConstIterator visualIter = mVisuals.Begin();
+ for( auto visualIter = mVisuals.Begin();
visualIter != mVisuals.End(); ++visualIter )
{
const Toolkit::Visual::Base visual = (*visualIter)->visual;
// all the visuals are ready
Dali::Toolkit::Control handle( mControlImpl.GetOwner() );
mResourceReadySignal.Emit( handle );
-
}
bool Control::Impl::IsResourceReady() const
void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, VisualState::Type enabled, DepthIndexValue::Type depthIndexValueSet, int depthIndex )
{
+ DALI_LOG_INFO( gLogFilter, Debug::Concise, "RegisterVisual:%d \n", index );
+
bool visualReplaced ( false );
Actor self = mControlImpl.Self();
if( !mVisuals.Empty() )
{
- RegisteredVisualContainer::Iterator iter;
+ RegisteredVisualContainer::Iterator registeredVisualsiter;
// Check if visual (index) is already registered. Replace if so.
- if ( FindVisual( index, mVisuals, iter ) )
+ if( FindVisual( index, mVisuals, registeredVisualsiter ) )
{
- if( (*iter)->visual && self.OnStage() )
+ if( (*registeredVisualsiter)->visual )
{
- Toolkit::GetImplementation((*iter)->visual).SetOffStage( self );
- }
+ // Store current visual depth index as may need to set the replacement visual to same depth
+ const int currentDepthIndex = (*registeredVisualsiter)->visual.GetDepthIndex();
- // If we've not set the depth-index value and the new visual does not have a depth index applied to it, then use the previously set depth-index for this index
- if( ( depthIndexValueSet == DepthIndexValue::NOT_SET ) &&
- ( visual.GetDepthIndex() == 0 ) )
- {
- const int currentDepthIndex = (*iter)->visual.GetDepthIndex();
- visual.SetDepthIndex( currentDepthIndex );
- }
+ // Monitor when the visuals resources are ready
+ StopObservingVisual( (*registeredVisualsiter)->visual );
+ StartObservingVisual( visual );
+
+ if( self.OnStage() )
+ {
+ DALI_LOG_INFO( gLogFilter, Debug::Verbose, "RegisterVisual Adding visual to replacement Queue: %d \n", index );
+ // Check if visual is currently in the process of being replaced
+ RegisteredVisualContainer::Iterator queuedReplacementVisual;
+ if ( FindVisual( index, mReplacementVisuals, queuedReplacementVisual ) )
+ {
+ // If visual on replacement queue is going to be replaced before it's ready then will be removed from queue (and stage)
+ // Only the the last requested visual will be queued and then displayed.
+ Toolkit::GetImplementation( (*queuedReplacementVisual)->visual ).SetOffStage( self );
+ mReplacementVisuals.Erase(queuedReplacementVisual);
+ }
+ // Add to replacement list
+ mReplacementVisuals.PushBack( new RegisteredVisual( index, visual, ( enabled == VisualState::ENABLED ? true : false ) ) );
+ }
+ else
+ {
+ // Not staged so can just replace registered visual
+ (*registeredVisualsiter)->visual = visual;
+ (*registeredVisualsiter)->enabled = ( enabled == VisualState::ENABLED ) ? true : false;
+ }
- StopObservingVisual( (*iter)->visual );
- StartObservingVisual( visual );
+ // If we've not set the depth-index value and the new visual does not have a depth index applied to it, then use the previously set depth-index for this index
+ if( ( depthIndexValueSet == DepthIndexValue::NOT_SET ) &&
+ ( visual.GetDepthIndex() == 0 ) )
+ {
+ visual.SetDepthIndex( currentDepthIndex );
+ }
+ }
- (*iter)->visual = visual;
- (*iter)->enabled = ( enabled == VisualState::ENABLED ) ? true : false;
visualReplaced = true;
}
}
if( !visualReplaced ) // New registration entry
{
+ DALI_LOG_INFO( gLogFilter, Debug::Concise, "New Visual registration %d\n", index);
mVisuals.PushBack( new RegisteredVisual( index, visual, ( enabled == VisualState::ENABLED ? true : false ) ) );
// monitor when the visuals resources are ready
// Put on stage if enabled and the control is already on the stage
if( ( enabled == VisualState::ENABLED ) && self.OnStage() )
{
+ // Visual must be set on stage for the renderer to be created and the ResourceReady triggered.
Toolkit::GetImplementation(visual).SetOnStage( self );
}
}
void Control::Impl::EnableVisual( Property::Index index, bool enable )
{
+ DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Control::EnableVisual Visual (%d)\n", index);
+
RegisteredVisualContainer::Iterator iter;
if ( FindVisual( index, mVisuals, iter ) )
{
/**
* @brief Adds the visual to the list of registered visuals.
* @param[in] index The Property index of the visual, used to reference visual
- * @param[in] visual The visual to register
+ * @param[in,out] visual The visual to register, which can be altered in this function
* @param[in] enabled false if derived class wants to control when visual is set on stage
* @param[in] depthIndexValueSet Set to true if the depthIndex has actually been set manually
* @param[in] depthIndex The visual's depth-index is set to this
+ *
+ * @note Registering a visual with an index that already has a registered visual will replace it. The replacement will
+ * occur once the replacement visual is ready (loaded).
*/
void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, VisualState::Type enabled, DepthIndexValue::Type depthIndexValueSet, int depthIndex = 0 );
bool mIsKeyboardNavigationSupported :1; ///< Stores whether keyboard navigation is supported by the control.
bool mIsKeyboardFocusGroup :1; ///< Stores whether the control is a focus group.
+ RegisteredVisualContainer mReplacementVisuals; ///< List of visuals that will be used for replacing current visuals.
+
// Properties - these need to be members of Internal::Control::Impl as they access private methods/data of Internal::Control and Internal::Control::Impl.
static const PropertyRegistration PROPERTY_1;
static const PropertyRegistration PROPERTY_2;
/////////////////////////////////////////////////////////////
+void ImageView::OnInitialize()
+{
+ // ImageView can relayout in the OnImageReady, alternative to a signal would be to have a upcall from the Control to ImageView
+ Dali::Toolkit::Control handle( GetOwner() );
+ Toolkit::DevelControl::ResourceReadySignal( handle ).Connect( this, &ImageView::OnResourceReady );
+}
+
void ImageView::SetImage( Image image )
{
// Don't bother comparing if we had a visual previously, just drop old visual and create new one
mUrl.clear();
mPropertyMap.Clear();
- mVisual = Toolkit::VisualFactory::Get().CreateVisual( image );
- DevelControl::RegisterVisual( *this, Toolkit::ImageView::Property::IMAGE, mVisual );
+ Toolkit::Visual::Base visual = Toolkit::VisualFactory::Get().CreateVisual( image );
+ if (!mVisual)
+ {
+ mVisual = visual;
+ }
- RelayoutRequest();
+ DevelControl::RegisterVisual( *this, Toolkit::ImageView::Property::IMAGE, visual );
}
void ImageView::SetImage( const Property::Map& map )
mPropertyMap = map;
mUrl.clear();
mImage.Reset();
+ Toolkit::Visual::Base visual = Toolkit::VisualFactory::Get().CreateVisual( mPropertyMap );
+ // Don't set mVisual until it is ready and shown. Getters will still use current visual.
+ if (!mVisual)
+ {
+ mVisual = visual;
+ }
- mVisual = Toolkit::VisualFactory::Get().CreateVisual( mPropertyMap );
- DevelControl::RegisterVisual( *this, Toolkit::ImageView::Property::IMAGE, mVisual );
-
- RelayoutRequest();
+ DevelControl::RegisterVisual( *this, Toolkit::ImageView::Property::IMAGE, visual );
}
void ImageView::SetImage( const std::string& url, ImageDimensions size )
mImage.Reset();
mPropertyMap.Clear();
- mVisual = Toolkit::VisualFactory::Get().CreateVisual( url, size );
- DevelControl::RegisterVisual( *this, Toolkit::ImageView::Property::IMAGE, mVisual );
+ // Don't set mVisual until it is ready and shown. Getters will still use current visual.
+ Toolkit::Visual::Base visual = Toolkit::VisualFactory::Get().CreateVisual( url, size );
+ if (!mVisual)
+ {
+ mVisual = visual;
+ }
- RelayoutRequest();
+ DevelControl::RegisterVisual( *this, Toolkit::ImageView::Property::IMAGE, visual );
}
Image ImageView::GetImage() const
}
}
+void ImageView::OnResourceReady( Toolkit::Control control )
+{
+ mVisual = DevelControl::GetVisual( *this, Toolkit::ImageView::Property::IMAGE );
+}
+
///////////////////////////////////////////////////////////
//
// Properties
private: // From Control
/**
+ * @copydoc Toolkit::Control::OnInitialize
+ */
+ void OnInitialize();
+
+ /**
* @copydoc Toolkit::Control::GetNaturalSize
*/
virtual Vector3 GetNaturalSize();
virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
private:
+
+ /**
+ * @brief Callback for ResourceReadySignal
+ * param[in] control signal prototype
+ */
+ void OnResourceReady( Toolkit::Control control );
+
+private:
// Undefined
ImageView( const ImageView& );
ImageView& operator=( const ImageView& );
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
std::string strMatActual;
- std::string input = objBuffer;
+ std::string input( objBuffer, fileSize );
std::istringstream ss(input);
ss.imbue( std::locale( "C" ) );
}
int numIndices = 0;
- while( isline >> vet[numIndices] && numIndices < MAX_POINT_INDICES )
+ while( ( numIndices < MAX_POINT_INDICES ) && ( isline >> vet[numIndices] ) )
{
numIndices++;
}
std::string info;
- std::string input = objBuffer;
+ std::string input( objBuffer, fileSize );
std::istringstream ss(input);
ss.imbue(std::locale("C"));
// Must always be positioned top-left of stage, regardless of parent.
backing.SetInheritPosition(false);
- backing.SetAnchorPoint( AnchorPoint::TOP_LEFT );
// Always the full size of the stage.
backing.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "placeholderText", STRING, PLACEHOLDER_TEXT )
DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "placeholderTextColor", VECTOR4, PLACEHOLDER_TEXT_COLOR )
DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "enableSelection", BOOLEAN, ENABLE_SELECTION )
+DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "placeholder", MAP, PLACEHOLDER )
DALI_SIGNAL_REGISTRATION( Toolkit, TextEditor, "textChanged", SIGNAL_TEXT_CHANGED )
DALI_SIGNAL_REGISTRATION( Toolkit, TextEditor, "inputStyleChanged", SIGNAL_INPUT_STYLE_CHANGED )
}
break;
}
+ case Toolkit::DevelTextEditor::Property::PLACEHOLDER:
+ {
+ const Property::Map* map = value.GetMap();
+ if( map )
+ {
+ impl.mController->SetPlaceholderProperty( *map );
+ }
+ break;
+ }
} // switch
} // texteditor
}
}
break;
}
+ case Toolkit::DevelTextEditor::Property::PLACEHOLDER:
+ {
+ Property::Map map;
+ impl.mController->GetPlaceholderProperty( map );
+ value = map;
+ break;
+ }
} //switch
}
DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextField, "hiddenInputSettings", MAP, HIDDEN_INPUT_SETTINGS )
DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextField, "pixelSize", FLOAT, PIXEL_SIZE )
DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextField, "enableSelection", BOOLEAN, ENABLE_SELECTION )
+DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextField, "placeholder", MAP, PLACEHOLDER )
DALI_SIGNAL_REGISTRATION( Toolkit, TextField, "textChanged", SIGNAL_TEXT_CHANGED )
DALI_SIGNAL_REGISTRATION( Toolkit, TextField, "maxLengthReached", SIGNAL_MAX_LENGTH_REACHED )
}
break;
}
+ case Toolkit::DevelTextField::Property::PLACEHOLDER:
+ {
+ const Property::Map* map = value.GetMap();
+ if( map )
+ {
+ impl.mController->SetPlaceholderProperty( *map );
+ }
+ break;
+ }
} // switch
} // textfield
}
}
break;
}
+ case Toolkit::DevelTextField::Property::PLACEHOLDER:
+ {
+ Property::Map map;
+ impl.mController->GetPlaceholderProperty( map );
+ value = map;
+ break;
+ }
} //switch
}
#include <dali/devel-api/scripting/scripting.h>
#include <dali/public-api/adaptor-framework/native-image-source.h>
#include <dali/integration-api/adaptors/adaptor.h>
+#include <dali/integration-api/debug.h>
+#include <dali/public-api/animation/constraint.h>
+#include <dali/devel-api/actors/actor-devel.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/video-view/video-view.h>
+#include <dali-toolkit/public-api/visuals/visual-properties.h>
+#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
+#include <dali-toolkit/internal/visuals/visual-string-constants.h>
+#include <dali-toolkit/internal/visuals/visual-base-impl.h>
#include <dali-toolkit/internal/visuals/visual-factory-impl.h>
+#include <dali-toolkit/internal/visuals/visual-factory-cache.h>
namespace Dali
{
const char* const WINDOW_SURFACE_TARGET( "windowSurfaceTarget" );
const char* const NATIVE_IMAGE_TARGET( "nativeImageTarget" );
+const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
+ attribute mediump vec2 aPosition;\n
+ uniform mediump mat4 uMvpMatrix;\n
+ uniform mediump vec3 uSize;\n
+ \n
+ void main()\n
+ {\n
+ mediump vec4 vertexPosition = vec4(aPosition, 0.0, 1.0);\n
+ vertexPosition.xyz *= uSize;\n
+ gl_Position = uMvpMatrix * vertexPosition;\n
+ }\n
+);
+
+const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
+ uniform lowp vec4 uColor;\n
+ uniform lowp vec3 mixColor;\n
+ uniform lowp float opacity;\n
+ \n
+ void main()\n
+ {\n
+ gl_FragColor = vec4(mixColor, opacity)*uColor;\n
+ }\n
+);
+
+struct TriggerFunctor
+{
+ TriggerFunctor( TriggerEventInterface* notification )
+ : mNotification( notification )
+ {
+ }
+
+ void operator()( bool& current, const PropertyInputContainer& inputs )
+ {
+ if( mNotification != NULL )
+ {
+ mNotification->Trigger();
+ }
+ }
+
+ TriggerEventInterface* mNotification;
+};
+
} // anonymous namepsace
VideoView::VideoView()
: Control( ControlBehaviour( ACTOR_BEHAVIOUR_DEFAULT | DISABLE_STYLE_CHANGE_SIGNALS ) ),
+ mUpdateTriggerPropertyIndex( Property::INVALID_INDEX),
+ mNotification( NULL ),
mCurrentVideoPlayPosition( 0 ),
mIsNativeImageTarget( true ),
mIsPlay( false ),
mIsPause( false )
{
mVideoPlayer = Dali::VideoPlayer::New();
+
+ TriggerEventFactory triggerEventFactory;
+ mNotification = triggerEventFactory.CreateTriggerEvent( MakeCallback(this, &VideoView::UpdateDisplayArea ),
+ TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER);
}
VideoView::~VideoView()
{
+ if( mNotification != NULL )
+ {
+ delete mNotification;
+ }
}
Toolkit::VideoView VideoView::New()
mVideoPlayer.SetRenderingTarget( nativeImageSourcePtr );
mVideoPlayer.FinishedSignal().Connect( this, &VideoView::EmitSignalFinish );
+
+ mUpdateTriggerPropertyIndex = Self().RegisterProperty( "updateTrigger", true );
}
void VideoView::SetUrl( const std::string& url )
}
}
+ Property::Value* target = map.Find( RENDERING_TARGET );
+ std::string targetType;
+
+ if( target && target->Get( targetType ) && targetType == WINDOW_SURFACE_TARGET )
+ {
+ this->SetWindowSurfaceTarget();
+ }
+ else if( target && target->Get( targetType ) && targetType == NATIVE_IMAGE_TARGET )
+ {
+ this->SetNativeImageTarget();
+ }
+
RelayoutRequest();
}
case Toolkit::VideoView::Property::VIDEO:
{
std::string videoUrl;
+ Property::Map map;
+
if( value.Get( videoUrl ) )
{
impl.SetUrl( videoUrl );
}
-
- Property::Map map;
- if( value.Get( map ) )
+ else if( value.Get( map ) )
{
- impl.SetPropertyMap( map );
+ Property::Value* shaderValue = map.Find( Toolkit::Visual::Property::SHADER, CUSTOM_SHADER );
- Property::Value* target = map.Find( RENDERING_TARGET );
- std::string targetType;
- if( target && target->Get( targetType ) && targetType == WINDOW_SURFACE_TARGET )
+ if( map.Count() > 1u || !shaderValue )
{
- impl.SetWindowSurfaceTarget();
+ impl.SetPropertyMap( map );
}
- else if( target && target->Get( targetType ) && targetType == NATIVE_IMAGE_TARGET )
+ else if( impl.mVisual && map.Count() == 1u && shaderValue )
{
- impl.SetNativeImageTarget();
+ Property::Map shaderMap;
+ if( shaderValue->Get( shaderMap ) )
+ {
+ Internal::Visual::Base& visual = Toolkit::GetImplementation( impl.mVisual );
+ visual.SetCustomShader( shaderMap );
+ if( videoView.OnStage() )
+ {
+ visual.SetOffStage( videoView );
+ visual.SetOnStage( videoView );
+ }
+ }
}
}
break;
mVisual.Reset();
}
+ Constraint constraint = Constraint::New<bool>( self, mUpdateTriggerPropertyIndex, TriggerFunctor( mNotification ) );
+ constraint.AddSource( Source( self, Actor::Property::POSITION ) );
+ constraint.AddSource( Source( self, Actor::Property::SIZE ) );
+ constraint.Apply();
+
mVideoPlayer.SetRenderingTarget( Dali::Adaptor::Get().GetNativeWindowHandle() );
mVideoPlayer.SetUrl( mUrl );
mVideoPlayer.Pause();
}
mVideoPlayer.SetPlayPosition( curPos );
+
+ // For underlay rendering mode, video display area have to be transparent.
+ Geometry geometry = VisualFactoryCache::CreateQuadGeometry();
+ Shader shader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
+ Renderer renderer = Renderer::New( geometry, shader );
+
+ renderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
+ renderer.SetProperty( Renderer::Property::BLEND_FACTOR_SRC_RGB, BlendFactor::ONE );
+ renderer.SetProperty( Renderer::Property::BLEND_FACTOR_DEST_RGB, BlendFactor::ZERO );
+ renderer.SetProperty( Renderer::Property::BLEND_FACTOR_SRC_ALPHA, BlendFactor::ONE );
+ renderer.SetProperty( Renderer::Property::BLEND_FACTOR_DEST_ALPHA, BlendFactor::ZERO );
+ self.AddRenderer( renderer );
}
void VideoView::SetNativeImageTarget()
mVideoPlayer.SetPlayPosition( curPos );
}
+void VideoView::UpdateDisplayArea()
+{
+ Actor self( Self() );
+
+ bool positionUsesAnchorPoint = self.GetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT ).Get< bool >();
+ Vector3 actorSize = self.GetCurrentSize() * self.GetCurrentScale();
+ Vector3 anchorPointOffSet = actorSize * ( positionUsesAnchorPoint ? self.GetCurrentAnchorPoint() : AnchorPoint::TOP_LEFT );
+
+ Vector2 screenPosition = self.GetProperty( DevelActor::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;
+
+ mVideoPlayer.SetDisplayArea( mDisplayArea );
+}
+
} // namespace Internal
-} // namespace Toolkit
+} // namespace toolkit
} // namespace Dali
#include <dali/public-api/object/property-map.h>
#include <dali/public-api/images/native-image.h>
#include <dali/devel-api/adaptor-framework/video-player.h>
+#include <dali/integration-api/adaptors/trigger-event-factory.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/visuals/image/image-visual.h>
*/
static bool DoAction( BaseObject* object, const std::string& actionName, const Property::Map& attributes );
+ /**
+ * Connects a callback function with the object's signals.
+ * @param[in] object The object providing the signal.
+ * @param[in] tracker Used to disconnect the signal.
+ * @param[in] signalName The signal to connect to.
+ * @param[in] functor A newly allocated FunctorDelegate.
+ * @return True if the signal was connected.
+ * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the c
+ */
static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
+ /*
+ * @brief Updates video display area for window rendering target
+ */
+ void UpdateDisplayArea();
+
private: // From Control
/**
Dali::NativeImage mNativeImage; ///< Native image handle for video rendering by texture streaming
Dali::Toolkit::VideoView::VideoViewSignalType mFinishedSignal;
std::string mUrl;
+ Dali::DisplayArea mDisplayArea;
+
+ Property::Index mUpdateTriggerPropertyIndex;
+ TriggerEventInterface* mNotification;
+
int mCurrentVideoPlayPosition;
bool mIsNativeImageTarget;
bool mIsPlay;
#include <dali/public-api/events/touch-data.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/object/type-registry-helper.h>
+#include <dali/public-api/object/property-map.h>
#include <dali/public-api/images/resource-image.h>
#include <dali/integration-api/debug.h>
#include <dali-toolkit/public-api/controls/image-view/image-view.h>
#include <dali-toolkit/public-api/accessibility-manager/accessibility-manager.h>
#include <dali-toolkit/devel-api/controls/control-devel.h>
+#include <dali-toolkit/public-api/styling/style-manager.h>
+#include <dali-toolkit/devel-api/styling/style-manager-devel.h>
namespace Dali
{
mFocusedActorEnterKeySignal(),
mCurrentFocusActor(),
mFocusIndicatorActor(),
+ mIsFocusIndicatorEnabled( -1 ),
mFocusGroupLoopEnabled( false ),
- mIsFocusIndicatorEnabled( false ),
mIsWaitingKeyboardFocusChangeCommit( false ),
mFocusHistory(),
mSlotDelegate( this ),
{
}
+void KeyboardFocusManager::GetConfigurationFromStyleManger()
+{
+ Toolkit::StyleManager styleManager = Toolkit::StyleManager::Get();
+ if( styleManager )
+ {
+ Property::Map config = Toolkit::DevelStyleManager::GetConfigurations( styleManager );
+ mIsFocusIndicatorEnabled = static_cast<int>(config["alwaysShowFocus"].Get<bool>());
+ }
+}
+
bool KeyboardFocusManager::SetCurrentFocusActor( Actor actor )
{
DALI_ASSERT_DEBUG( !mIsWaitingKeyboardFocusChangeCommit && "Calling this function in the PreFocusChangeSignal callback?" );
+ if( mIsFocusIndicatorEnabled == -1 )
+ {
+ GetConfigurationFromStyleManger();
+ }
+
return DoSetCurrentFocusActor( actor );
}
}
mCurrentFocusActor.Reset();
- mIsFocusIndicatorEnabled = false;
+ mIsFocusIndicatorEnabled = 0;
}
void KeyboardFocusManager::SetFocusGroupLoop(bool enabled)
std::string keyName = event.keyPressedName;
+ if( mIsFocusIndicatorEnabled == -1 )
+ {
+ GetConfigurationFromStyleManger();
+ }
+
bool isFocusStartableKey = false;
if(event.state == KeyEvent::Down)
if(!mIsFocusIndicatorEnabled)
{
// Show focus indicator
- mIsFocusIndicatorEnabled = true;
+ mIsFocusIndicatorEnabled = 1;
}
else
{
if(!mIsFocusIndicatorEnabled)
{
// Show focus indicator
- mIsFocusIndicatorEnabled = true;
+ mIsFocusIndicatorEnabled = 1;
}
else
{
if(!mIsFocusIndicatorEnabled)
{
// Show focus indicator
- mIsFocusIndicatorEnabled = true;
+ mIsFocusIndicatorEnabled = 1;
}
else
{
if(!mIsFocusIndicatorEnabled)
{
// Show focus indicator
- mIsFocusIndicatorEnabled = true;
+ mIsFocusIndicatorEnabled = 1;
}
else
{
if(!mIsFocusIndicatorEnabled)
{
// Show focus indicator
- mIsFocusIndicatorEnabled = true;
+ mIsFocusIndicatorEnabled = 1;
}
else
{
if(!mIsFocusIndicatorEnabled)
{
// Show focus indicator
- mIsFocusIndicatorEnabled = true;
+ mIsFocusIndicatorEnabled = 1;
}
else
{
if(!mIsFocusIndicatorEnabled)
{
// Show focus indicator
- mIsFocusIndicatorEnabled = true;
+ mIsFocusIndicatorEnabled = 1;
}
else
{
if(!mIsFocusIndicatorEnabled)
{
// Show focus indicator
- mIsFocusIndicatorEnabled = true;
+ mIsFocusIndicatorEnabled = 1;
}
isFocusStartableKey = true;
if(!mIsFocusIndicatorEnabled)
{
// Show focus indicator
- mIsFocusIndicatorEnabled = true;
+ mIsFocusIndicatorEnabled = 1;
}
isFocusStartableKey = true;
if(!mIsFocusIndicatorEnabled && !isAccessibilityEnabled)
{
// Show focus indicator
- mIsFocusIndicatorEnabled = true;
+ mIsFocusIndicatorEnabled = 1;
}
else
{
typedef FocusStack::Iterator FocusStackIterator; ///< Define FocusStack::Iterator as FocusStackIterator to navigate FocusStack
/**
+ * Get configuration from StyleManager.
+ */
+ void GetConfigurationFromStyleManger();
+
+ /**
* Get the focus group of current focused actor.
* @pre The FocusManager has been initialized.
* @return A handle to the parent of the current focused actor which is a focus group,
Actor mFocusIndicatorActor; ///< The focus indicator actor shared by all the keyboard focusable actors for highlight
- bool mFocusGroupLoopEnabled:1; ///< Whether the focus movement is looped within the same focus group
+ int mIsFocusIndicatorEnabled; ///< Whether indicator should be shown / hidden when getting focus. It could be enabled when keyboard focus feature is enabled and navigation keys or 'Tab' key are pressed.
- bool mIsFocusIndicatorEnabled:1; ///< Whether indicator should be shown / hidden. It could be enabled when keyboard focus feature enabled and navigation keys or 'Tab' key pressed.
+ bool mFocusGroupLoopEnabled:1; ///< Whether the focus movement is looped within the same focus group
bool mIsWaitingKeyboardFocusChangeCommit:1; /// A flag to indicate PreFocusChangeSignal emitted but the proposed focus actor is not commited by the application yet.
{
bool themeLoaded = false;
- mThemeBuilder = CreateBuilder( mThemeBuilderConstants );
-
- // Always load the default theme first, then merge in the custom theme if present
- themeLoaded = LoadJSON( mThemeBuilder, DEFAULT_THEME );
- mThemeFile = themeFile;
+ if( mThemeFile.compare(DEFAULT_THEME) == 0 && mThemeBuilder )
+ {
+ // We have already loaded the default theme into mThemeBuilder
+ }
+ else
+ {
+ // Reload the default theme
+ mThemeBuilder = CreateBuilder( mThemeBuilderConstants );
+ themeLoaded = LoadJSON( mThemeBuilder, DEFAULT_THEME );
+ }
if( themeFile.compare(DEFAULT_THEME) != 0 )
{
- themeLoaded = LoadJSON( mThemeBuilder, mThemeFile );
+ // The theme is different to the default: Merge it
+ themeLoaded = LoadJSON( mThemeBuilder, themeFile );
+ mThemeFile = themeFile;
}
if( themeLoaded )
}
}
+const Property::Map StyleManager::GetConfigurations()
+{
+ Property::Map result;
+ if( mThemeBuilder )
+ {
+ result = mThemeBuilder.GetConfigurations();
+ }
+ else
+ {
+ bool themeLoaded = false;
+
+ mThemeBuilder = CreateBuilder( mThemeBuilderConstants );
+
+ // Load default theme because this is first try to load stylesheet.
+ themeLoaded = LoadJSON( mThemeBuilder, DEFAULT_THEME );
+ mThemeFile = DEFAULT_THEME;
+
+ if( themeLoaded )
+ {
+ result = mThemeBuilder.GetConfigurations();
+ }
+ }
+
+ return result;
+}
+
bool StyleManager::LoadFile( const std::string& filename, std::string& stringOut )
{
DALI_ASSERT_DEBUG( 0 != filename.length());
bool GetStyleConstant( const std::string& key, Property::Value& valueOut );
/**
+ * @copydoc Toolkit::StyleManager::GetConfigurations
+ */
+ const Property::Map GetConfigurations();
+
+ /**
* @brief Apply the theme style to a control.
*
* @param[in] control The control to apply style.
EventData::EventData( DecoratorPtr decorator )
: mDecorator( decorator ),
mImfManager(),
+ mPlaceholderFont( NULL ),
mPlaceholderText(),
mPlaceholderTextActive(),
mPlaceholderTextInactive(),
mScrollAfterDelete( false ),
mAllTextSelected( false ),
mUpdateInputStyle( false ),
- mPasswordInput( false )
+ mPasswordInput( false ),
+ mIsPlaceholderPixelSize( false )
{
mImfManager = ImfManager::Get();
}
// Get the default font's description.
TextAbstraction::FontDescription defaultFontDescription;
TextAbstraction::PointSize26Dot6 defaultPointSize = TextAbstraction::FontClient::DEFAULT_POINT_SIZE;
- if( NULL != mFontDefaults )
+
+ if( IsShowingPlaceholderText() && ( NULL != mEventData->mPlaceholderFont ) )
+ {
+ // If the placeholder font is set specifically, only placeholder font is changed.
+ defaultFontDescription = mEventData->mPlaceholderFont->mFontDescription;
+ if( mEventData->mPlaceholderFont->sizeDefined )
+ {
+ defaultPointSize = mEventData->mPlaceholderFont->mDefaultPointSize * 64u;
+ }
+ }
+ else if( NULL != mFontDefaults )
{
+ // Set the normal font and the placeholder font.
defaultFontDescription = mFontDefaults->mFontDescription;
defaultPointSize = mFontDefaults->mDefaultPointSize * 64u;
}
//Forward declarations
struct CursorInfo;
+struct FontDefaults;
struct Event
{
DecoratorPtr mDecorator; ///< Pointer to the decorator.
ImfManager mImfManager; ///< The Input Method Framework Manager.
+ FontDefaults* mPlaceholderFont; ///< The placeholder default font.
std::string mPlaceholderText; ///< The text to display when the TextField is empty.
std::string mPlaceholderTextActive; ///< The text to display when the TextField is empty with key-input focus.
std::string mPlaceholderTextInactive; ///< The text to display when the TextField is empty and inactive.
bool mUpdateInputStyle : 1; ///< Whether to update the input style after moving the cursor.
bool mPasswordInput : 1; ///< True if password input is enabled.
bool mCheckScrollAmount : 1; ///< Whether to check scrolled amount after updating the position
+ bool mIsPlaceholderPixelSize : 1; ///< True if the placeholder font size is set as pixel size.
};
struct ModifyEvent
#include <dali-toolkit/internal/text/character-set-conversion.h>
#include <dali-toolkit/internal/text/layouts/layout-parameters.h>
#include <dali-toolkit/internal/text/markup-processor.h>
+#include <dali-toolkit/internal/text/multi-language-support.h>
#include <dali-toolkit/internal/text/text-controller-impl.h>
#include <dali-toolkit/internal/text/text-editable-control-interface.h>
+#include <dali-toolkit/internal/text/text-font-style.h>
namespace
{
const std::string EMPTY_STRING("");
+const char * const PLACEHOLDER_TEXT = "placeholderText";
+const char * const PLACEHOLDER_COLOR = "placeholderColor";
+const char * const PLACEHOLDER_FONT_FAMILY = "placeholderFontFamily";
+const char * const PLACEHOLDER_FONT_STYLE = "placeholderFontStyle";
+const char * const PLACEHOLDER_POINT_SIZE = "placeholderPointSize";
+const char * const PLACEHOLDER_PIXEL_SIZE = "placeholderPixelSize";
+
float ConvertToEven( float value )
{
int intValue(static_cast<int>( value ));
return EMPTY_STRING;
}
+void Controller::SetPlaceholderFontFamily( const std::string& placeholderTextFontFamily )
+{
+ if( NULL != mImpl->mEventData )
+ {
+ if( NULL == mImpl->mEventData->mPlaceholderFont )
+ {
+ mImpl->mEventData->mPlaceholderFont = new FontDefaults();
+ }
+
+ mImpl->mEventData->mPlaceholderFont->mFontDescription.family = placeholderTextFontFamily;
+ DALI_LOG_INFO( gLogFilter, Debug::General, "Controller::SetPlaceholderFontFamily %s\n", placeholderTextFontFamily.c_str());
+ mImpl->mEventData->mPlaceholderFont->familyDefined = !placeholderTextFontFamily.empty();
+
+ mImpl->RequestRelayout();
+ }
+}
+
+const std::string& Controller::GetPlaceholderFontFamily() const
+{
+ if( ( NULL != mImpl->mEventData ) && ( NULL != mImpl->mEventData->mPlaceholderFont ) )
+ {
+ return mImpl->mEventData->mPlaceholderFont->mFontDescription.family;
+ }
+
+ return EMPTY_STRING;
+}
+
void Controller::SetDefaultFontWeight( FontWeight weight )
{
if( NULL == mImpl->mFontDefaults )
return TextAbstraction::FontWeight::NORMAL;
}
+void Controller::SetPlaceholderTextFontWeight( FontWeight weight )
+{
+ if( NULL != mImpl->mEventData )
+ {
+ if( NULL == mImpl->mEventData->mPlaceholderFont )
+ {
+ mImpl->mEventData->mPlaceholderFont = new FontDefaults();
+ }
+
+ mImpl->mEventData->mPlaceholderFont->mFontDescription.weight = weight;
+ mImpl->mEventData->mPlaceholderFont->weightDefined = true;
+
+ mImpl->RequestRelayout();
+ }
+}
+
+bool Controller::IsPlaceholderTextFontWeightDefined() const
+{
+ if( ( NULL != mImpl->mEventData ) && ( NULL != mImpl->mEventData->mPlaceholderFont ) )
+ {
+ return mImpl->mEventData->mPlaceholderFont->weightDefined;
+ }
+ return false;
+}
+
+FontWeight Controller::GetPlaceholderTextFontWeight() const
+{
+ if( ( NULL != mImpl->mEventData ) && ( NULL != mImpl->mEventData->mPlaceholderFont ) )
+ {
+ return mImpl->mEventData->mPlaceholderFont->mFontDescription.weight;
+ }
+
+ return TextAbstraction::FontWeight::NORMAL;
+}
+
void Controller::SetDefaultFontWidth( FontWidth width )
{
if( NULL == mImpl->mFontDefaults )
return TextAbstraction::FontWidth::NORMAL;
}
+void Controller::SetPlaceholderTextFontWidth( FontWidth width )
+{
+ if( NULL != mImpl->mEventData )
+ {
+ if( NULL == mImpl->mEventData->mPlaceholderFont )
+ {
+ mImpl->mEventData->mPlaceholderFont = new FontDefaults();
+ }
+
+ mImpl->mEventData->mPlaceholderFont->mFontDescription.width = width;
+ mImpl->mEventData->mPlaceholderFont->widthDefined = true;
+
+ mImpl->RequestRelayout();
+ }
+}
+
+bool Controller::IsPlaceholderTextFontWidthDefined() const
+{
+ if( ( NULL != mImpl->mEventData ) && ( NULL != mImpl->mEventData->mPlaceholderFont ) )
+ {
+ return mImpl->mEventData->mPlaceholderFont->widthDefined;
+ }
+ return false;
+}
+
+FontWidth Controller::GetPlaceholderTextFontWidth() const
+{
+ if( ( NULL != mImpl->mEventData ) && ( NULL != mImpl->mEventData->mPlaceholderFont ) )
+ {
+ return mImpl->mEventData->mPlaceholderFont->mFontDescription.width;
+ }
+
+ return TextAbstraction::FontWidth::NORMAL;
+}
+
void Controller::SetDefaultFontSlant( FontSlant slant )
{
if( NULL == mImpl->mFontDefaults )
return TextAbstraction::FontSlant::NORMAL;
}
+void Controller::SetPlaceholderTextFontSlant( FontSlant slant )
+{
+ if( NULL != mImpl->mEventData )
+ {
+ if( NULL == mImpl->mEventData->mPlaceholderFont )
+ {
+ mImpl->mEventData->mPlaceholderFont = new FontDefaults();
+ }
+
+ mImpl->mEventData->mPlaceholderFont->mFontDescription.slant = slant;
+ mImpl->mEventData->mPlaceholderFont->slantDefined = true;
+
+ mImpl->RequestRelayout();
+ }
+}
+
+bool Controller::IsPlaceholderTextFontSlantDefined() const
+{
+ if( ( NULL != mImpl->mEventData ) && ( NULL != mImpl->mEventData->mPlaceholderFont ) )
+ {
+ return mImpl->mEventData->mPlaceholderFont->slantDefined;
+ }
+ return false;
+}
+
+FontSlant Controller::GetPlaceholderTextFontSlant() const
+{
+ if( ( NULL != mImpl->mEventData ) && ( NULL != mImpl->mEventData->mPlaceholderFont ) )
+ {
+ return mImpl->mEventData->mPlaceholderFont->mFontDescription.slant;
+ }
+
+ return TextAbstraction::FontSlant::NORMAL;
+}
+
void Controller::SetDefaultFontSize( float fontSize, FontSizeType type )
{
if( NULL == mImpl->mFontDefaults )
}
case PIXEL_SIZE:
{
- // Point size = Pixel size * 72 / DPI
+ // Point size = Pixel size * 72.f / DPI
unsigned int horizontalDpi = 0u;
unsigned int verticalDpi = 0u;
TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
fontClient.GetDpi( horizontalDpi, verticalDpi );
- mImpl->mFontDefaults->mDefaultPointSize = ( fontSize * 72 ) / horizontalDpi;
+ mImpl->mFontDefaults->mDefaultPointSize = ( fontSize * 72.f ) / static_cast< float >( horizontalDpi );
mImpl->mFontDefaults->sizeDefined = true;
break;
}
- default:
- {
- DALI_ASSERT_ALWAYS( false );
- }
}
// Clear the font-specific data
}
case PIXEL_SIZE:
{
- // Pixel size = Point size * DPI / 72
+ // Pixel size = Point size * DPI / 72.f
+ unsigned int horizontalDpi = 0u;
+ unsigned int verticalDpi = 0u;
+ TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
+ fontClient.GetDpi( horizontalDpi, verticalDpi );
+
+ value = mImpl->mFontDefaults->mDefaultPointSize * static_cast< float >( horizontalDpi ) / 72.f;
+ break;
+ }
+ }
+ return value;
+ }
+
+ return value;
+}
+
+void Controller::SetPlaceholderTextFontSize( float fontSize, FontSizeType type )
+{
+ if( NULL != mImpl->mEventData )
+ {
+ if( NULL == mImpl->mEventData->mPlaceholderFont )
+ {
+ mImpl->mEventData->mPlaceholderFont = new FontDefaults();
+ }
+
+ switch( type )
+ {
+ case POINT_SIZE:
+ {
+ mImpl->mEventData->mPlaceholderFont->mDefaultPointSize = fontSize;
+ mImpl->mEventData->mPlaceholderFont->sizeDefined = true;
+ mImpl->mEventData->mIsPlaceholderPixelSize = false; // Font size flag
+ break;
+ }
+ case PIXEL_SIZE:
+ {
+ // Point size = Pixel size * 72.f / DPI
unsigned int horizontalDpi = 0u;
unsigned int verticalDpi = 0u;
TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
fontClient.GetDpi( horizontalDpi, verticalDpi );
- value = mImpl->mFontDefaults->mDefaultPointSize * horizontalDpi / 72;
+ mImpl->mEventData->mPlaceholderFont->mDefaultPointSize = ( fontSize * 72.f ) / static_cast< float >( horizontalDpi );
+ mImpl->mEventData->mPlaceholderFont->sizeDefined = true;
+ mImpl->mEventData->mIsPlaceholderPixelSize = true; // Font size flag
+ break;
+ }
+ }
+
+ mImpl->RequestRelayout();
+ }
+}
+
+float Controller::GetPlaceholderTextFontSize( FontSizeType type ) const
+{
+ float value = 0.0f;
+ if( NULL != mImpl->mEventData )
+ {
+ switch( type )
+ {
+ case POINT_SIZE:
+ {
+ if( NULL != mImpl->mEventData->mPlaceholderFont )
+ {
+ value = mImpl->mEventData->mPlaceholderFont->mDefaultPointSize;
+ }
+ else
+ {
+ // If the placeholder text font size is not set, then return the default font size.
+ value = GetDefaultFontSize( POINT_SIZE );
+ }
break;
}
- default:
+ case PIXEL_SIZE:
{
- DALI_ASSERT_ALWAYS( false );
+ if( NULL != mImpl->mEventData->mPlaceholderFont )
+ {
+ // Pixel size = Point size * DPI / 72.f
+ unsigned int horizontalDpi = 0u;
+ unsigned int verticalDpi = 0u;
+ TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
+ fontClient.GetDpi( horizontalDpi, verticalDpi );
+
+ value = mImpl->mEventData->mPlaceholderFont->mDefaultPointSize * static_cast< float >( horizontalDpi ) / 72.f;
+ }
+ else
+ {
+ // If the placeholder text font size is not set, then return the default font size.
+ value = GetDefaultFontSize( PIXEL_SIZE );
+ }
+ break;
}
}
return value;
}
}
+void Controller::SetPlaceholderProperty( const Property::Map& map )
+{
+ const Property::Map::SizeType count = map.Count();
+
+ for( Property::Map::SizeType position = 0; position < count; ++position )
+ {
+ KeyValuePair keyValue = map.GetKeyValue( position );
+ Property::Key& key = keyValue.first;
+ Property::Value& value = keyValue.second;
+
+ if( key == PLACEHOLDER_TEXT )
+ {
+ std::string text = "";
+ value.Get( text );
+ SetPlaceholderText( text );
+ }
+ else if( key == PLACEHOLDER_COLOR )
+ {
+ Vector4 textColor;
+ value.Get( textColor );
+ if( GetPlaceholderTextColor() != textColor )
+ {
+ SetPlaceholderTextColor( textColor );
+ }
+ }
+ else if( key == PLACEHOLDER_FONT_FAMILY )
+ {
+ std::string fontFamily = "";
+ value.Get( fontFamily );
+ SetPlaceholderFontFamily( fontFamily );
+ }
+ else if( key == PLACEHOLDER_FONT_STYLE )
+ {
+ SetFontStyleProperty( this, value, Text::FontStyle::PLACEHOLDER );
+ }
+ else if( key == PLACEHOLDER_POINT_SIZE )
+ {
+ float pointSize;
+ value.Get( pointSize );
+ if( !Equals( GetPlaceholderTextFontSize( Text::Controller::POINT_SIZE ), pointSize ) )
+ {
+ SetPlaceholderTextFontSize( pointSize, Text::Controller::POINT_SIZE );
+ }
+ }
+ else if( key == PLACEHOLDER_PIXEL_SIZE )
+ {
+ float pixelSize;
+ value.Get( pixelSize );
+ if( !Equals( GetPlaceholderTextFontSize( Text::Controller::PIXEL_SIZE ), pixelSize ) )
+ {
+ SetPlaceholderTextFontSize( pixelSize, Text::Controller::PIXEL_SIZE );
+ }
+ }
+ }
+}
+
+void Controller::GetPlaceholderProperty( Property::Map& map )
+{
+ if( NULL != mImpl->mEventData )
+ {
+ map[ PLACEHOLDER_TEXT ] = mImpl->mEventData->mPlaceholderText;
+ map[ PLACEHOLDER_COLOR ] = mImpl->mEventData->mPlaceholderTextColor;
+ map[ PLACEHOLDER_FONT_FAMILY ] = GetPlaceholderFontFamily();
+
+ Property::Value fontStyleMapGet;
+ GetFontStyleProperty( this, fontStyleMapGet, Text::FontStyle::PLACEHOLDER );
+ map[ PLACEHOLDER_FONT_STYLE ] = fontStyleMapGet;
+
+ // Choose font size : POINT_SIZE or PIXEL_SIZE
+ if( !mImpl->mEventData->mIsPlaceholderPixelSize )
+ {
+ map[ PLACEHOLDER_POINT_SIZE ] = GetPlaceholderTextFontSize( Text::Controller::POINT_SIZE );
+ }
+ else
+ {
+ map[ PLACEHOLDER_PIXEL_SIZE ] = GetPlaceholderTextFontSize( Text::Controller::PIXEL_SIZE );
+ }
+ }
+}
+
// public : Relayout.
Controller::UpdateTextType Controller::Relayout( const Size& size )
const std::string& GetDefaultFontFamily() const;
/**
+ * @brief Sets the placeholder text font family.
+ * @param[in] placeholderTextFontFamily The placeholder text font family.
+ */
+ void SetPlaceholderFontFamily( const std::string& placeholderTextFontFamily );
+
+ /**
+ * @brief Retrieves the placeholder text font family.
+ *
+ * @return The placeholder text font family
+ */
+ const std::string& GetPlaceholderFontFamily() const;
+
+ /**
* @brief Sets the default font weight.
*
* @param[in] weight The font weight.
FontWeight GetDefaultFontWeight() const;
/**
+ * @brief Sets the placeholder text font weight.
+ *
+ * @param[in] weight The font weight
+ */
+ void SetPlaceholderTextFontWeight( FontWeight weight );
+
+ /**
+ * @brief Whether the font's weight has been defined.
+ *
+ * @return True if the placeholder text font weight is defined
+ */
+ bool IsPlaceholderTextFontWeightDefined() const;
+
+ /**
+ * @brief Retrieves the placeholder text font weight.
+ *
+ * @return The placeholder text font weight
+ */
+ FontWeight GetPlaceholderTextFontWeight() const;
+
+ /**
* @brief Sets the default font width.
*
* @param[in] width The font width.
FontWidth GetDefaultFontWidth() const;
/**
+ * @brief Sets the placeholder text font width.
+ *
+ * @param[in] width The font width
+ */
+ void SetPlaceholderTextFontWidth( FontWidth width );
+
+ /**
+ * @brief Whether the font's width has been defined.
+ *
+ * @return True if the placeholder text font width is defined
+ */
+ bool IsPlaceholderTextFontWidthDefined() const;
+
+ /**
+ * @brief Retrieves the placeholder text font width.
+ *
+ * @return The placeholder text font width
+ */
+ FontWidth GetPlaceholderTextFontWidth() const;
+
+ /**
* @brief Sets the default font slant.
*
* @param[in] slant The font slant.
FontSlant GetDefaultFontSlant() const;
/**
+ * @brief Sets the placeholder text font slant.
+ *
+ * @param[in] slant The font slant
+ */
+ void SetPlaceholderTextFontSlant( FontSlant slant );
+
+ /**
+ * @brief Whether the font's slant has been defined.
+ *
+ * @return True if the placeholder text font slant is defined
+ */
+ bool IsPlaceholderTextFontSlantDefined() const;
+
+ /**
+ * @brief Retrieves the placeholder text font slant.
+ *
+ * @return The placeholder text font slant
+ */
+ FontSlant GetPlaceholderTextFontSlant() const;
+
+ /**
* @brief Set the default font size.
*
- * @param[in] size The default font size.
+ * @param[in] fontSize The default font size
* @param[in] type The font size type is point size or pixel size
*/
void SetDefaultFontSize( float fontSize, FontSizeType type );
float GetDefaultFontSize( FontSizeType type ) const;
/**
+ * @brief Sets the Placeholder text font size.
+ * @param[in] fontSize The placeholder text font size
+ * @param[in] type The font size type is point size or pixel size
+ */
+ void SetPlaceholderTextFontSize( float fontSize, FontSizeType type );
+
+ /**
+ * @brief Retrieves the Placeholder text font size.
+ * @param[in] type The font size type
+ * @return The placeholder font size
+ */
+ float GetPlaceholderTextFontSize( FontSizeType type ) const;
+
+ /**
* @brief Sets the text's default color.
*
* @param color The default color.
*/
void GetHiddenInputOption( Property::Map& options );
+ /**
+ * @brief Sets the Placeholder Properties.
+ *
+ * @param[in] map The placeholder property map
+ */
+ void SetPlaceholderProperty( const Property::Map& map );
+
+ /**
+ * @brief Retrieves the Placeholder Property map.
+ *
+ * @param[out] map The property map
+ */
+ void GetPlaceholderProperty( Property::Map& map );
+
public: // Relayout.
/**
}
break;
}
+ case FontStyle::PLACEHOLDER:
+ {
+ // Sets the placeholder text font's style values.
+ if( !weightDefined ||
+ ( weightDefined && ( controller->GetPlaceholderTextFontWeight() != weight ) ) )
+ {
+ controller->SetPlaceholderTextFontWeight( weight );
+ }
+
+ if( !widthDefined ||
+ ( widthDefined && ( controller->GetPlaceholderTextFontWidth() != width ) ) )
+ {
+ controller->SetPlaceholderTextFontWidth( width );
+ }
+
+ if( !slantDefined ||
+ ( slantDefined && ( controller->GetPlaceholderTextFontSlant() != slant ) ) )
+ {
+ controller->SetPlaceholderTextFontSlant( slant );
+ }
+ break;
+ }
} // switch
} // map not empty
else
controller->SetInputFontSlant( TextAbstraction::FontSlant::NONE );
break;
}
+ case FontStyle::PLACEHOLDER:
+ {
+ controller->SetPlaceholderTextFontWeight( TextAbstraction::FontWeight::NONE );
+ controller->SetPlaceholderTextFontWidth( TextAbstraction::FontWidth::NONE );
+ controller->SetPlaceholderTextFontSlant( TextAbstraction::FontSlant::NONE );
+ break;
+ }
} // switch
} // map.Empty()
} // controller
{
if( controller )
{
- const bool isDefaultStyle = FontStyle::DEFAULT == type;
const bool isSetbyString = controller->IsFontStyleSetByString();
bool weightDefined = false;
FontWidth width = TextAbstraction::FontWidth::NONE;
FontSlant slant = TextAbstraction::FontSlant::NONE;
- if( isDefaultStyle )
+ switch( type )
{
- weightDefined = controller->IsDefaultFontWeightDefined();
- widthDefined = controller->IsDefaultFontWidthDefined();
- slantDefined = controller->IsDefaultFontSlantDefined();
-
- if( weightDefined )
+ case FontStyle::DEFAULT:
{
- weight = controller->GetDefaultFontWeight();
- }
+ weightDefined = controller->IsDefaultFontWeightDefined();
+ widthDefined = controller->IsDefaultFontWidthDefined();
+ slantDefined = controller->IsDefaultFontSlantDefined();
- if( widthDefined )
- {
- width = controller->GetDefaultFontWidth();
- }
+ if( weightDefined )
+ {
+ weight = controller->GetDefaultFontWeight();
+ }
- if( slantDefined )
- {
- slant = controller->GetDefaultFontSlant();
- }
- }
- else
- {
- weightDefined = controller->IsInputFontWeightDefined();
- widthDefined = controller->IsInputFontWidthDefined();
- slantDefined = controller->IsInputFontSlantDefined();
+ if( widthDefined )
+ {
+ width = controller->GetDefaultFontWidth();
+ }
- if( weightDefined )
- {
- weight = controller->GetInputFontWeight();
+ if( slantDefined )
+ {
+ slant = controller->GetDefaultFontSlant();
+ }
+ break;
}
-
- if( widthDefined )
+ case FontStyle::INPUT:
{
- width = controller->GetInputFontWidth();
- }
+ weightDefined = controller->IsInputFontWeightDefined();
+ widthDefined = controller->IsInputFontWidthDefined();
+ slantDefined = controller->IsInputFontSlantDefined();
- if( slantDefined )
+ if( weightDefined )
+ {
+ weight = controller->GetInputFontWeight();
+ }
+
+ if( widthDefined )
+ {
+ width = controller->GetInputFontWidth();
+ }
+
+ if( slantDefined )
+ {
+ slant = controller->GetInputFontSlant();
+ }
+ break;
+ }
+ case FontStyle::PLACEHOLDER:
{
- slant = controller->GetInputFontSlant();
+ // The type is FontStyle::PLACEHOLDER
+ weightDefined = controller->IsPlaceholderTextFontWeightDefined();
+ widthDefined = controller->IsPlaceholderTextFontWidthDefined();
+ slantDefined = controller->IsPlaceholderTextFontSlantDefined();
+
+ if( weightDefined )
+ {
+ weight = controller->GetPlaceholderTextFontWeight();
+ }
+
+ if( widthDefined )
+ {
+ width = controller->GetPlaceholderTextFontWidth();
+ }
+
+ if( slantDefined )
+ {
+ slant = controller->GetPlaceholderTextFontSlant();
+ }
+ break;
}
}
{
enum Type
{
- DEFAULT, ///< The default font's style.
- INPUT ///< The input font's style.
+ DEFAULT, ///< The default font's style.
+ INPUT, ///< The input font's style.
+ PLACEHOLDER ///< The placeholder text font's style.
};
};
*
* @param[in] controller The text's controller.
* @param[in] value The value of the font's style.
- * @param[in] type Whether the property is for the default font's style or the input font's style.
+ * @param[in] type Whether the property is for the default font's style, the input font's style or the placeholder font's style.
*
*/
void SetFontStyleProperty( ControllerPtr controller, const Property::Value& value, FontStyle::Type type );
*
* @param[in] controller The text's controller.
* @param[out] value The value of the font's style.
- * @param[in] type Whether the property is for the default font's style or the input font's style.
+ * @param[in] type Whether the property is for the default font's style, the input font's style or the placeholder font's style.
*/
void GetFontStyleProperty( ControllerPtr controller, Property::Value& value, FontStyle::Type type );
// Hold the weak handle of the placement actor and delay the adding of renderer until the svg rasterization is finished.
mPlacementActor = actor;
+
+ // SVG visual needs it's size set before it can be rasterized hence set ResourceReady once on stage
+ ResourceReady();
}
void SvgVisual::DoSetOffStage( Actor& actor )
}
// Nothing else to do if the relayout size is zero.
+ ResourceReady();
return;
}
for( unsigned int i = 0; i < count; ++i )
{
TextureInfo& textureInfo( mTextureInfoContainer[i] );
- for( TextureInfo::ObserverListType::Iterator j = textureInfo.observerList.Begin(); j != textureInfo.observerList.End(); ++j )
+ for( TextureInfo::ObserverListType::Iterator j = textureInfo.observerList.Begin(); j != textureInfo.observerList.End(); )
{
if( *j == observer )
{
- textureInfo.observerList.Erase( j );
- break;
+ j = textureInfo.observerList.Erase( j );
+ }
+ else
+ {
+ ++j;
}
}
}
float Button::GetInitialAutoRepeatingDelay() const
{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetPositionInheritanceMode() is deprecated and will be removed from next release. Use GetProperty INITIAL_AUTO_REPEATING_DELAY or Styling file instead.\n" );
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetInitialAutoRepeatingDelay() is deprecated and will be removed from next release. Use GetProperty INITIAL_AUTO_REPEATING_DELAY or Styling file instead.\n" );
return Dali::Toolkit::GetImplementation( *this ).GetInitialAutoRepeatingDelay();
}
const unsigned int TOOLKIT_MAJOR_VERSION = 1;
const unsigned int TOOLKIT_MINOR_VERSION = 2;
-const unsigned int TOOLKIT_MICRO_VERSION = 46;
+const unsigned int TOOLKIT_MICRO_VERSION = 47;
const char * const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
//******************************************************************************
{
+ "config":
+ {
+ "alwaysShowFocus":false
+ },
"styles":
{
"Tooltip":
//******************************************************************************
{
+ "config":
+ {
+ "alwaysShowFocus":false
+ },
"styles":
{
"Tooltip":
//******************************************************************************
{
+ "config":
+ {
+ "alwaysShowFocus":false
+ },
"styles":
{
"TextLabel":
Name: dali-toolkit
Summary: The OpenGLES Canvas Core Library Toolkit
-Version: 1.2.46
+Version: 1.2.47
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-3-Clause and MIT