utc-Dali-PinchGestureDetector.cpp
utc-Dali-Pixel.cpp
utc-Dali-PixelData.cpp
+ utc-Dali-Processors.cpp
utc-Dali-PropertyArray.cpp
utc-Dali-PropertyBuffer.cpp
utc-Dali-PropertyMap.cpp
Dali::Integration::Log::LogFunction logFunction(&TestApplication::LogMessage);
Dali::Integration::Log::InstallLogFunction(logFunction);
+ Dali::Integration::Trace::LogContextFunction logContextFunction(&TestApplication::LogContext);
+ Dali::Integration::Trace::InstallLogContextFunction( logContextFunction );
+
+ Dali::Integration::Trace::LogContext( true, "Test" );
+
mCore->SceneCreated();
}
delete mCore;
}
+void TestApplication::LogContext( bool start, const char* tag )
+{
+ if( start )
+ {
+ fprintf(stderr, "INFO: Trace Start: %s", tag);
+ }
+ else
+ {
+ fprintf(stderr, "INFO: Trace End: %s", tag);
+ }
+}
+
void TestApplication::LogMessage(Dali::Integration::Log::DebugPriority level, std::string& message)
{
switch(level)
#include "test-render-controller.h"
#include <dali/public-api/common/dali-common.h>
#include <dali/integration-api/resource-policies.h>
+#include <dali/integration-api/trace.h>
namespace Dali
{
void Initialize();
virtual ~TestApplication();
static void LogMessage( Dali::Integration::Log::DebugPriority level, std::string& message );
+ static void LogContext( bool start, const char* tag );
Dali::Integration::Core& GetCore();
TestPlatformAbstraction& GetPlatform();
TestRenderController& GetRenderController();
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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/devel-api/actors/actor-devel.h>
#include <dali/devel-api/object/handle-devel.h>
#include "dali-test-suite-utils/dali-test-suite-utils.h"
+#include "dali-test-suite-utils/test-custom-actor.h"
+
#include <mesh-builder.h>
using namespace Dali;
END_TEST;
}
+
+int UtcDaliHandleDoesCustomPropertyExistP1(void)
+{
+ TestApplication application; // Needs type registry
+
+ tet_infoline( "Test if a registered custom property exists on object" );
+
+ Actor actor = Actor::New();
+ auto propertyIndex = actor.RegisterProperty("customProperty1", 1.0f);
+
+ DALI_TEST_EQUALS( DevelHandle::DoesCustomPropertyExist( actor, propertyIndex ), true, TEST_LOCATION );
+ END_TEST;
+}
+
+int UtcDaliHandleDoesCustomPropertyExistN1(void)
+{
+ TestApplication application; // Needs type registry
+
+ tet_infoline( "Test if a registered custom property does not exist on object" );
+
+ Actor actor = Actor::New();
+ auto propertyIndex = actor.RegisterProperty("customProperty1", 1.0f);
+
+ DALI_TEST_EQUALS( DevelHandle::DoesCustomPropertyExist( actor, propertyIndex+1 ), false, TEST_LOCATION );
+ END_TEST;
+}
+
+int UtcDaliHandleDoesCustomPropertyExistN2(void)
+{
+ TestApplication application; // Needs type registry
+
+ tet_infoline( "Test that a default property does not show as a custom property on object" );
+
+ Actor actor = Actor::New();
+ DALI_TEST_EQUALS( DevelHandle::DoesCustomPropertyExist( actor, Actor::Property::POSITION ), false, TEST_LOCATION );
+ END_TEST;
+}
+
+int UtcDaliHandleDoesCustomPropertyExistN3(void)
+{
+ TestApplication application; // Needs type registry
+
+ tet_infoline( "Test that a child property does not exist on actor after parenting to container" );
+ TypeRegistry typeRegistry = TypeRegistry::Get();
+
+ auto customActorTypeInfo = typeRegistry.GetTypeInfo( typeid(Test::TestCustomActor) );
+
+ const Property::Index CHILD_PROPERTY( CHILD_PROPERTY_REGISTRATION_START_INDEX );
+ const char* CHILD_PROPERTY_NAME( "childProperty" );
+
+ ChildPropertyRegistration( customActorTypeInfo.GetName(), CHILD_PROPERTY_NAME, CHILD_PROPERTY, Property::INTEGER );
+
+ auto container = Test::TestCustomActor::New();
+ Stage::GetCurrent().Add( container );
+ auto child = Actor::New();
+ container.Add( child ); // Resolve child properties (if any)
+
+ DALI_TEST_EQUALS( DevelHandle::DoesCustomPropertyExist( child, CHILD_PROPERTY ), false, TEST_LOCATION );
+ END_TEST;
+}
+
+int UtcDaliHandleDoesCustomPropertyExistP2(void)
+{
+ TestApplication application; // Needs type registry
+
+ tet_infoline( "Test that a child property exists after being set" );
+ TypeRegistry typeRegistry = TypeRegistry::Get();
+
+ auto customActorTypeInfo = typeRegistry.GetTypeInfo( typeid(Test::TestCustomActor) );
+
+ const Property::Index CHILD_PROPERTY( CHILD_PROPERTY_REGISTRATION_START_INDEX );
+ const char* CHILD_PROPERTY_NAME( "childProperty" );
+
+ ChildPropertyRegistration( customActorTypeInfo.GetName(), CHILD_PROPERTY_NAME, CHILD_PROPERTY, Property::INTEGER );
+
+ auto container = Test::TestCustomActor::New();
+ Stage::GetCurrent().Add( container );
+ auto child = Actor::New();
+ container.Add( child ); // Resolve child properties (if any)
+ child.SetProperty( CHILD_PROPERTY, 2 );
+
+ DALI_TEST_EQUALS( DevelHandle::DoesCustomPropertyExist( child, CHILD_PROPERTY ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS( child.GetProperty<int>( CHILD_PROPERTY ), 2, TEST_LOCATION );
+ END_TEST;
+}
+
+int UtcDaliHandleDoesCustomPropertyExistP3(void)
+{
+ TestApplication application; // Needs type registry
+
+ tet_infoline( "Test that a child property is re-indexed after registration, and that it exists" );
+ TypeRegistry typeRegistry = TypeRegistry::Get();
+
+ auto customActorTypeInfo = typeRegistry.GetTypeInfo( typeid(Test::TestCustomActor) );
+
+ const Property::Index CHILD_PROPERTY( CHILD_PROPERTY_REGISTRATION_START_INDEX );
+ const char* CHILD_PROPERTY_NAME( "childProperty" );
+
+ ChildPropertyRegistration( customActorTypeInfo.GetName(), CHILD_PROPERTY_NAME, CHILD_PROPERTY, Property::INTEGER );
+
+ auto container = Test::TestCustomActor::New();
+ Stage::GetCurrent().Add( container );
+ auto child = Actor::New();
+ child.RegisterProperty( CHILD_PROPERTY_NAME, Property::Value(3) );
+ container.Add( child ); // Resolve child properties (if any)
+
+ DALI_TEST_EQUALS( DevelHandle::DoesCustomPropertyExist( child, CHILD_PROPERTY ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS( child.GetProperty<int>( CHILD_PROPERTY ), 3, TEST_LOCATION );
+ END_TEST;
+}
+
+namespace
+{
+
+struct PropertySetSignalCheck
+{
+ PropertySetSignalCheck(bool& signalReceived, Property::Value& value)
+ : mSignalReceived(signalReceived),
+ mValue(value)
+ {
+ }
+
+ void operator()(Handle& handle, Property::Index index, Property::Value value)
+ {
+ mSignalReceived = true;
+ mValue = value;
+ }
+
+ void Reset()
+ {
+ mSignalReceived = false;
+ }
+
+ void CheckSignalReceived()
+ {
+ if (!mSignalReceived)
+ {
+ tet_printf("Expected Property Set signal was not received\n");
+ tet_result(TET_FAIL);
+ }
+ else
+ {
+ tet_result(TET_PASS);
+ }
+ }
+
+ bool& mSignalReceived; // owned by individual tests
+ Property::Value& mValue;
+};
+
+} // anon namespace
+
+int UtcDaliHandlePropertySetSignal01(void)
+{
+ TestApplication app;
+
+ bool signalReceived(false);
+ Property::Value value;
+ PropertySetSignalCheck propertySetCheck(signalReceived, value);
+
+ tet_infoline( "Test that setting a default property triggers a signal" );
+
+ auto actor = Actor::New();
+ DevelHandle::PropertySetSignal(actor).Connect(&app, propertySetCheck);
+
+ actor.SetProperty( Actor::Property::POSITION, Vector3::XAXIS );
+ propertySetCheck.CheckSignalReceived();
+
+ END_TEST;
+}
+
+
+int UtcDaliHandlePropertySetSignal02(void)
+{
+ TestApplication app;
+
+ bool signalReceived(false);
+ Property::Value value;
+ PropertySetSignalCheck propertySetCheck(signalReceived, value);
+
+ tet_infoline( "Test that setting a custom property triggers a signal" );
+
+ auto actor = Actor::New();
+ DevelHandle::PropertySetSignal(actor).Connect(&app, propertySetCheck);
+
+ auto propertyIndex = actor.RegisterProperty("propName", 3.0f);
+ actor.SetProperty( propertyIndex, 5.0f );
+ propertySetCheck.CheckSignalReceived();
+ DALI_TEST_EQUALS( propertySetCheck.mValue, Property::Value( 5.0f ), 0.001f, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliHandlePropertySetSignal03(void)
+{
+ TestApplication app;
+ TypeRegistry typeRegistry = TypeRegistry::Get();
+
+ bool signalReceived(false);
+ Property::Value value;
+ PropertySetSignalCheck propertySetCheck(signalReceived, value);
+
+ tet_infoline( "Test that setting a child property triggers a signal" );
+
+ auto customActorTypeInfo = typeRegistry.GetTypeInfo( typeid(Test::TestCustomActor) );
+
+ const Property::Index CHILD_PROPERTY( CHILD_PROPERTY_REGISTRATION_START_INDEX );
+ const char* CHILD_PROPERTY_NAME( "childProperty" );
+
+ ChildPropertyRegistration( customActorTypeInfo.GetName(), CHILD_PROPERTY_NAME, CHILD_PROPERTY, Property::INTEGER );
+
+ auto container = Test::TestCustomActor::New();
+ Stage::GetCurrent().Add( container );
+ auto child = Actor::New();
+ child.RegisterProperty( CHILD_PROPERTY_NAME, Property::Value(3) );
+ DevelHandle::PropertySetSignal(child).Connect(&app, propertySetCheck);
+ container.Add( child ); // Resolve child properties (if any)
+
+ DALI_TEST_EQUALS( DevelHandle::DoesCustomPropertyExist( child, CHILD_PROPERTY ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS( child.GetProperty<int>( CHILD_PROPERTY ), 3, TEST_LOCATION );
+
+ child.SetProperty( CHILD_PROPERTY, 29 );
+ propertySetCheck.CheckSignalReceived();
+ DALI_TEST_EQUALS( propertySetCheck.mValue, Property::Value( 29 ), TEST_LOCATION );
+ END_TEST;
+}
--- /dev/null
+/*
+ * Copyright (c) 2018 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 <stdlib.h>
+#include <dali/public-api/dali-core.h>
+#include <dali/integration-api/core.h>
+#include <dali-test-suite-utils.h>
+
+using namespace Dali;
+
+
+class TestProcessor : public Integration::Processor
+{
+public:
+ TestProcessor()
+ : processRun(false)
+ {
+ }
+
+ virtual void Process()
+ {
+ processRun = true;
+ }
+
+ bool processRun;
+};
+
+
+int UtcDaliCoreProcessorP(void)
+{
+ TestApplication application;
+
+ TestProcessor testProcessor;
+ Integration::Core& core = application.GetCore();
+ core.RegisterProcessor( testProcessor );
+
+ tet_infoline("Test that the processor has not been executed yet:");
+ DALI_TEST_CHECK( testProcessor.processRun == false );
+
+ application.SendNotification();
+
+ tet_infoline("Test that the processor has been executed:");
+ DALI_TEST_CHECK( testProcessor.processRun );
+
+ // Clear down for next part of test
+ testProcessor.processRun = false;
+
+ core.UnregisterProcessor( testProcessor );
+ application.SendNotification();
+ tet_infoline("Test that the processor has not been executed again:");
+ DALI_TEST_CHECK( testProcessor.processRun == false );
+
+ END_TEST;
+}
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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 UtcDaliTypeInfoRegisterChildProperties01(void)
+{
+ TestApplication application;
+ TypeRegistry typeRegistry = TypeRegistry::Get();
+
+ tet_infoline( "Register child properties on a type via name" );
+
+ auto customActorTypeInfo = typeRegistry.GetTypeInfo( typeid(CustomActor) );
+ auto myCustomTypeInfo = typeRegistry.GetTypeInfo( typeid(MyTestCustomActor) );
+ DALI_TEST_CHECK( customActorTypeInfo );
+ DALI_TEST_CHECK( myCustomTypeInfo );
+
+ const Property::Index WIDTH_SPECIFICATION( CHILD_PROPERTY_REGISTRATION_START_INDEX );
+ const Property::Index HEIGHT_SPECIFICATION( CHILD_PROPERTY_REGISTRATION_START_INDEX + 1);
+ const Property::Index MARGIN_SPECIFICATION( CHILD_PROPERTY_REGISTRATION_START_INDEX + 100);
+
+ ChildPropertyRegistration( customActorTypeInfo.GetName(), "widthSpecification", WIDTH_SPECIFICATION, Property::INTEGER );
+ ChildPropertyRegistration( customActorTypeInfo.GetName(), "heightSpecification", HEIGHT_SPECIFICATION, Property::INTEGER );
+ ChildPropertyRegistration( myCustomTypeInfo.GetName(), "marginSpecification", MARGIN_SPECIFICATION, Property::EXTENTS );
+
+ auto customActor = MyTestCustomActor::New();
+ Stage::GetCurrent().Add( customActor );
+ auto child = Actor::New();
+ customActor.Add( child );
+
+ child.SetProperty( WIDTH_SPECIFICATION, 33 );
+
+ auto value = child.GetProperty( WIDTH_SPECIFICATION );
+ DALI_TEST_EQUALS( value, Property::Value(33), TEST_LOCATION );
+
+ child.SetProperty( HEIGHT_SPECIFICATION, 44 );
+ value = child.GetProperty( HEIGHT_SPECIFICATION );
+ DALI_TEST_EQUALS( value, Property::Value(44), TEST_LOCATION );
+
+ child.SetProperty( MARGIN_SPECIFICATION, Extents(10, 10, 10, 10) );
+ value = child.GetProperty( MARGIN_SPECIFICATION );
+ DALI_TEST_EQUALS( value, Property::Value(Extents(10,10,10,10)), TEST_LOCATION );
+
+ END_TEST;
+}
+
+
+int UtcDaliTypeInfoRegisterChildProperties02(void)
+{
+ TestApplication application;
+ TypeRegistry typeRegistry = TypeRegistry::Get();
+
+ tet_infoline( "Register child properties on a type via name" );
+
+ auto customActorTypeInfo = typeRegistry.GetTypeInfo( typeid(CustomActor) );
+ auto myCustomTypeInfo = typeRegistry.GetTypeInfo( typeid(MyTestCustomActor) );
+ DALI_TEST_CHECK( customActorTypeInfo );
+ DALI_TEST_CHECK( myCustomTypeInfo );
+
+ const Property::Index WIDTH_SPECIFICATION( CHILD_PROPERTY_REGISTRATION_START_INDEX );
+ const Property::Index HEIGHT_SPECIFICATION( CHILD_PROPERTY_REGISTRATION_START_INDEX + 1);
+ const Property::Index MARGIN_SPECIFICATION( CHILD_PROPERTY_REGISTRATION_START_INDEX + 100);
+
+ ChildPropertyRegistration( customActorTypeInfo.GetName(), "widthSpecification", WIDTH_SPECIFICATION, Property::INTEGER );
+ ChildPropertyRegistration( customActorTypeInfo.GetName(), "heightSpecification", HEIGHT_SPECIFICATION, Property::INTEGER );
+ ChildPropertyRegistration( myCustomTypeInfo.GetName(), "marginSpecification", MARGIN_SPECIFICATION, Property::EXTENTS );
+
+
+ auto index = customActorTypeInfo.GetChildPropertyIndex( "widthSpecification" );
+ DALI_TEST_EQUALS( index, WIDTH_SPECIFICATION, TEST_LOCATION );
+
+ index = customActorTypeInfo.GetChildPropertyIndex( "heightSpecification" );
+ DALI_TEST_EQUALS( index, HEIGHT_SPECIFICATION, TEST_LOCATION );
+
+ index = customActorTypeInfo.GetChildPropertyIndex( "marginSpecification" );
+ DALI_TEST_EQUALS( index, Property::INVALID_INDEX, TEST_LOCATION );
+
+ index = myCustomTypeInfo.GetChildPropertyIndex( "marginSpecification" );
+ DALI_TEST_EQUALS( index, MARGIN_SPECIFICATION, TEST_LOCATION );
+
+
+ auto name = customActorTypeInfo.GetChildPropertyName( WIDTH_SPECIFICATION );
+ DALI_TEST_EQUALS( name, "widthSpecification", TEST_LOCATION );
+
+ name = customActorTypeInfo.GetChildPropertyName( HEIGHT_SPECIFICATION );
+ DALI_TEST_EQUALS( name, "heightSpecification", TEST_LOCATION );
+
+ name = myCustomTypeInfo.GetChildPropertyName( MARGIN_SPECIFICATION );
+ DALI_TEST_EQUALS( name, "marginSpecification", TEST_LOCATION );
+
+
+ auto type = customActorTypeInfo.GetChildPropertyType( WIDTH_SPECIFICATION );
+ DALI_TEST_EQUALS( type, Property::INTEGER, TEST_LOCATION );
+
+ type = customActorTypeInfo.GetChildPropertyType( HEIGHT_SPECIFICATION );
+ DALI_TEST_EQUALS( type, Property::INTEGER, TEST_LOCATION );
+
+ type = myCustomTypeInfo.GetChildPropertyType( MARGIN_SPECIFICATION );
+ DALI_TEST_EQUALS( type, Property::EXTENTS, TEST_LOCATION );
+
+
+ END_TEST;
+}
+
+
+int UtcDaliTypeInfoRegisterChildProperties03(void)
+{
+ TestApplication application;
+ TypeRegistry typeRegistry = TypeRegistry::Get();
+
+ tet_infoline( "Check registered child properties can be retrieved" );
+
+ auto customActorTypeInfo = typeRegistry.GetTypeInfo( typeid(CustomActor) );
+ auto myCustomTypeInfo = typeRegistry.GetTypeInfo( typeid(MyTestCustomActor) );
+ DALI_TEST_CHECK( customActorTypeInfo );
+ DALI_TEST_CHECK( myCustomTypeInfo );
+
+ const Property::Index WIDTH_SPECIFICATION( CHILD_PROPERTY_REGISTRATION_START_INDEX );
+ const Property::Index HEIGHT_SPECIFICATION( CHILD_PROPERTY_REGISTRATION_START_INDEX + 1);
+ const Property::Index MARGIN_SPECIFICATION( CHILD_PROPERTY_REGISTRATION_START_INDEX + 100);
+
+ ChildPropertyRegistration( customActorTypeInfo.GetName(), "widthSpecification", WIDTH_SPECIFICATION, Property::INTEGER );
+ ChildPropertyRegistration( customActorTypeInfo.GetName(), "heightSpecification", HEIGHT_SPECIFICATION, Property::INTEGER );
+ ChildPropertyRegistration( myCustomTypeInfo.GetName(), "marginSpecification", MARGIN_SPECIFICATION, Property::EXTENTS );
+
+ Property::IndexContainer indices;
+ myCustomTypeInfo.GetChildPropertyIndices( indices );
+
+ auto result = std::find( indices.Begin(), indices.End(), WIDTH_SPECIFICATION );
+ DALI_TEST_EQUALS( result != indices.End(), true, TEST_LOCATION );
+
+ result = std::find( indices.Begin(), indices.End(), HEIGHT_SPECIFICATION );
+ DALI_TEST_EQUALS( result != indices.End(), true, TEST_LOCATION );
+
+ result = std::find( indices.Begin(), indices.End(), MARGIN_SPECIFICATION );
+ DALI_TEST_EQUALS( result != indices.End(), true, TEST_LOCATION );
+
+ END_TEST;
+}
-# Copyright (c) 2017 Samsung Electronics Co., Ltd.
+# Copyright (c) 2018 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.
DALI_CFLAGS="$DALI_CFLAGS -DDEBUG_ENABLED"
fi
+if test "x$enable_trace" = "xyes"; then
+ DALI_CFLAGS="$DALI_CFLAGS -DTRACE_ENABLED"
+fi
+
if test "x$enable_debug" = "xno" -a "x$enable_exportall" = "xno"; then
DALI_CFLAGS="$DALI_CFLAGS -fvisibility=hidden -DHIDE_DALI_INTERNALS"
fi
-------------
Prefix: $prefix
Debug Build: $enable_debug
+ Trace Build: $enable_trace
Data Dir (Read/Write): $dataReadWriteDir
Data Dir (Read Only): $dataReadOnlyDir
Backtrace: $enable_backtrace
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
GetImplementation( handle ).SetTypeInfo( &GetImplementation( typeInfo ) );
}
+bool DoesCustomPropertyExist( Handle& handle, Property::Index index )
+{
+ return GetImplementation( handle ).DoesCustomPropertyExist( index );
+}
+
+PropertySetSignalType& PropertySetSignal( Handle handle )
+{
+ return GetImplementation( handle ).PropertySetSignal();
+}
+
} // namespace DevelHandle
} // namespace Dali
#define DALI_HANDLE_DEVEL_H
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
*/
DALI_IMPORT_API void SetTypeInfo( Handle& handle, const TypeInfo& typeInfo );
+
+/**
+ * @brief Determine if the custom property index exists on this object without throwing a Dali::Exception.
+ *
+ * @note This does not check default properties.
+ * @param[in] handle The handle to check
+ * @param[in] index The index of the property to test for
+ */
+DALI_IMPORT_API bool DoesCustomPropertyExist( Handle& handle, Property::Index index );
+
+/**
+ * @brief PropertySetSignal function prototype for signal handler. Called when a property is set on this object.
+ */
+using PropertySetSignalType = Signal< void( Handle& handle, Property::Index index, Property::Value value ) >;
+
+/**
+ * @brief Get a signal when a property is set on this object through the API (i.e. not when animating)
+ *
+ * @param[in] handle The handle of the object to listen to.
+ * @return The signal to attach a connection to.
+ */
+DALI_IMPORT_API PropertySetSignalType& PropertySetSignal( Handle handle );
+
+
} // namespace DevelHandle
} // namespace Dali
return mImpl->GetStereoBase();
}
+void Core::RegisterProcessor( Processor& processor )
+{
+ mImpl->RegisterProcessor( processor );
+}
+
+void Core::UnregisterProcessor( Processor& processor )
+{
+ mImpl->UnregisterProcessor( processor );
+}
+
Core::Core()
: mImpl( NULL )
{
#define DALI_INTEGRATION_CORE_H
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
};
/**
+ * Interface to enable classes to be processed after the event loop. Classes are processed
+ * in the order they are registered.
+ */
+class DALI_IMPORT_API Processor
+{
+public:
+ /**
+ * @brief Run the processor
+ */
+ virtual void Process() = 0;
+
+protected:
+ virtual ~Processor() { }
+};
+
+
+/**
* Integration::Core is used for integration with the native windowing system.
* The following integration tasks must be completed:
*
*/
float GetStereoBase() const;
+ /**
+ * @brief Register a processor
+ *
+ * Note, Core does not take ownership of this processor.
+ * @param[in] processor The process to register
+ */
+ void RegisterProcessor( Processor& processor );
+
+ /**
+ * @brief Unregister a processor
+ * @param[in] processor The process to unregister
+ */
+ void UnregisterProcessor( Processor& processor );
+
private:
/**
$(platform_abstraction_src_dir)/bitmap.cpp \
$(platform_abstraction_src_dir)/core.cpp \
$(platform_abstraction_src_dir)/debug.cpp \
+ $(platform_abstraction_src_dir)/trace.cpp \
$(platform_abstraction_src_dir)/profiling.cpp \
$(platform_abstraction_src_dir)/input-options.cpp \
$(platform_abstraction_src_dir)/system-overlay.cpp \
$(platform_abstraction_src_dir)/core-enumerations.h \
$(platform_abstraction_src_dir)/context-notifier.h \
$(platform_abstraction_src_dir)/debug.h \
+ $(platform_abstraction_src_dir)/trace.h \
$(platform_abstraction_src_dir)/profiling.h \
$(platform_abstraction_src_dir)/input-options.h \
$(platform_abstraction_src_dir)/bitmap.h \
--- /dev/null
+/*
+ * Copyright (c) 2018 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/integration-api/trace.h>
+
+// EXTERNAL INCLUDES
+#include <list>
+#include <cstdarg>
+
+namespace Dali
+{
+
+namespace Integration
+{
+
+namespace Trace
+{
+
+thread_local LogContextFunction gThreadLocalLogContextFunction = nullptr;
+
+void InstallLogContextFunction( const LogContextFunction& logContextFunction )
+{
+ gThreadLocalLogContextFunction = logContextFunction;
+}
+
+void LogContext( bool start, const char* tag )
+{
+ if ( !gThreadLocalLogContextFunction )
+ {
+ return;
+ }
+ gThreadLocalLogContextFunction( start, tag );
+}
+
+#ifdef TRACE_ENABLED
+
+typedef std::list<Filter*> FilterList;
+typedef std::list<Filter*>::iterator FilterIter;
+
+namespace
+{
+ static FilterList* GetActiveFilters()
+ {
+ static FilterList* activeFilters = new FilterList;
+ return activeFilters;
+ }
+}
+
+Filter* Filter::New( bool trace, const char * environmentVariableName )
+{
+ char * environmentVariableValue = getenv( environmentVariableName );
+ if ( environmentVariableValue )
+ {
+ char envTraceString( 0 );
+ sscanf( environmentVariableValue, "%c", &envTraceString );
+
+ // Just use 'f' and 't' as it's faster than doing full string comparisons
+ if ( envTraceString == 't' )
+ {
+ trace = true;
+ }
+ else if ( envTraceString == 'f' )
+ {
+ trace = false;
+ }
+ }
+
+ Filter* filter = new Filter( trace );
+ GetActiveFilters()->push_back( filter );
+ return filter;
+}
+
+/**
+ * Enable trace on all filters.
+ */
+void Filter::EnableGlobalTrace()
+{
+ for( FilterIter iter = GetActiveFilters()->begin(); iter != GetActiveFilters()->end(); iter++ )
+ {
+ (*iter)->EnableTrace();
+ }
+}
+
+/**
+ * Disable trace on all filters.
+ */
+void Filter::DisableGlobalTrace()
+{
+ for( FilterIter iter = GetActiveFilters()->begin(); iter != GetActiveFilters()->end(); iter++ )
+ {
+ (*iter)->DisableTrace();
+ }
+}
+
+/**
+ * Begin Trace
+ */
+void Filter::BeginTrace( const char* tagName )
+{
+ Dali::Integration::Trace::LogContext( true, tagName );
+}
+
+/**
+ * End Trace
+ */
+void Filter::EndTrace( const char* tagName )
+{
+ Dali::Integration::Trace::LogContext( false, tagName );
+}
+
+/**
+ * Tracer Constructor
+ */
+Tracer::Tracer( Filter* filter, const char* tag )
+: mTag( tag ),
+ mFilter( filter )
+{
+ if( mFilter && mFilter->IsTraceEnabled() )
+ {
+ mFilter->BeginTrace( mTag );
+ }
+}
+
+/**
+ * Tracer Destructor
+ */
+Tracer::~Tracer()
+{
+ if( mFilter && mFilter->IsTraceEnabled() )
+ {
+ mFilter->EndTrace( mTag );
+ }
+}
+
+#endif //TRACE_ENABLED
+
+} // Trace
+
+} // Integration
+
+} // Dali
--- /dev/null
+#ifndef DALI_INTEGRATION_TRACE_H
+#define DALI_INTEGRATION_TRACE_H
+
+/*
+ * Copyright (c) 2018 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 <string>
+
+// INTERNAL INCLUDES
+#include <dali/public-api/common/dali-common.h>
+
+namespace Dali
+{
+
+namespace Integration
+{
+
+namespace Trace
+{
+
+/**
+ * Used by tracing macros to log a context message
+ * @param start a bool to indicate start (true) or end (false) of the tracing / logging
+ * @param tag a unique event tag name
+ */
+DALI_IMPORT_API void LogContext( bool start, const char* tag );
+
+/**
+ * typedef for the LogContextFunction function.
+ */
+typedef void ( *LogContextFunction )( bool start, const char* tag );
+
+/**
+ * A LogContextFunction function has to be installed for every thread that wants to use tracing.
+ * This should be done by the adaptor.
+ * The LogContextFunction function can be different for each thread.
+ * @param LogContextFunction the Log Context function to install
+ */
+DALI_IMPORT_API void InstallLogContextFunction( const LogContextFunction& logContextFunction );
+
+/********************************************************************************
+ * Filter *
+ ********************************************************************************/
+
+#ifdef TRACE_ENABLED
+
+/**
+ * The Filter object is used by the DALI_TRACE_BEGIN macro and others to determine if the tracing
+ * should take place, and routes the tracing via the platform abstraction's LogMessage.
+ *
+ * It provides the ability to turn tracing on or off.
+ *
+ */
+class DALI_IMPORT_API Filter
+{
+public:
+
+ /**
+ * Test if trace is enabled for this filter.
+ * @return true if trace is enabled;
+ */
+ inline bool IsTraceEnabled() { return mTraceEnabled; }
+
+ /**
+ * Enable tracing on this filter.
+ */
+ inline void EnableTrace() { mTraceEnabled = true; }
+
+ /**
+ * Disable tracing on this filter.
+ */
+ inline void DisableTrace() { mTraceEnabled = false; }
+
+ /**
+ * Create a new filter whose trace can be modified through the use of an environment variable.
+ *
+ * @param[in] trace The default trace level. If true, function tracing is on.
+ * @param[in] environmentVariableName The environment variable name used in order to change the trace.
+ *
+ * @info To modify trace at runtime, you should define your filter as shown below:
+ *
+ * @code
+ * Trace::Filter* filter = Trace::Filter::New( false, "TRACE_ENV" );
+ * @endcode
+ *
+ * And to use it when running an executable:
+ * @code
+ * TRACE_ENV=1 dali-demo // Trace ON
+ * TRACE_ENV=0 dali-demo // Trace OFF
+ * @endcode
+ */
+ static Filter* New( bool trace, const char * environmentVariableName );
+
+ /**
+ * Begin trace.
+ * @param[in] tagName - a unique event tag name.
+ */
+ void BeginTrace( const char* tagName );
+
+ /**
+ * End trace.
+ * @param[in] tagName - a unique event tag name.
+ */
+ void EndTrace( const char* tagName );
+
+ /**
+ * Enable trace on all filters.
+ */
+ static void EnableGlobalTrace();
+
+ /**
+ * Disable trace on all filters.
+ */
+ static void DisableGlobalTrace();
+
+private:
+
+ /**
+ * Constructor.
+ * @param[in] trace - whether this filter allows tracing.
+ */
+ Filter( bool trace ) : mTraceEnabled( trace ) {}
+
+private:
+ bool mTraceEnabled;
+};
+
+/********************************************************************************
+ * Trace Macros *
+ ********************************************************************************/
+
+/*
+ * These macros allow the instrumentation of methods.
+ */
+
+/**
+ * The Tracer object is used by the DALI_TRACE_SCOPE and DALI_TRACE_FUNCTION macros
+ * and uses filter object which in tun routes the tracing via the platform abstraction's LogMessage.
+ *
+ */
+class DALI_IMPORT_API Tracer final
+{
+public:
+ Tracer( Filter* filter, const char* tag );
+ ~Tracer();
+
+public:
+ const char* mTag;
+ Filter* mFilter;
+};
+
+/**
+ * For initialization of trace filter, please use DALI_INIT_TRACE_FILTER macro i.e. DALI_INIT_TRACE_FILTER( gFilter, "TRACE_COMBINED", true );
+ * To start tracing, please use DALI_TRACE_BEGIN macro i.e. DALI_TRACE_BEGIN( gFilter, "RENDERING" );
+ * To end tracing, please use DALI_TRACE_END macro i.e. DALI_TRACE_END( gFilter, "RENDERING" );
+ * For scoped tracing, please use DALI_TRACE_SCOPE macro i.e. DALI_TRACE_SCOPE( gFilter, "RENDERING" );
+ * For function tracing, please use DALI_TRACE_FUNCTION macro i.e. DALI_TRACE_FUNCTION( gFilter );
+ */
+
+/**
+ * Initialization of trace filter
+ * @ref Filter::New
+ */
+#define DALI_INIT_TRACE_FILTER( name, environmentVariableName, enable ) \
+namespace \
+{ \
+ Dali::Integration::Trace::Filter* name = Dali::Integration::Trace::Filter::New( enable, #environmentVariableName ); \
+}
+
+/**
+ * Start of tracing
+ */
+#define DALI_TRACE_BEGIN( filter, tag ) \
+ if( filter && filter->IsTraceEnabled() ) { filter->BeginTrace( tag ); }
+
+/**
+ * End of tracing
+ */
+#define DALI_TRACE_END( filter, tag ) \
+ if( filter && filter->IsTraceEnabled() ) { filter->EndTrace( tag ); }
+
+/**
+ * Used for function tracing. It logs tracing of the fuction from start to end.
+ */
+#define DALI_TRACE_FUNCTION( filter ) \
+ Dali::Integration::Trace::Tracer logTraceFunction( filter, __PRETTY_FUNCTION__ );
+
+/**
+ * Used for scope tracing. It logs tracing around a scope.
+ */
+#define DALI_TRACE_SCOPE( filter, tag ) \
+ Dali::Integration::Trace::Tracer logTracerScope( filter, tag );
+
+#else // TRACE_ENABLED
+
+#define DALI_INIT_TRACE_FILTER( name, tag, enable )
+#define DALI_TRACE_BEGIN( filter, tag )
+#define DALI_TRACE_END( filter, tag )
+#define DALI_TRACE_FUNCTION( filter )
+#define DALI_TRACE_SCOPE( filter, tag )
+
+#endif
+
+} // Trace
+
+} // Integration
+
+} // Dali
+
+#endif // DALI_INTEGRATION_TRACE_H
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
// Run the size negotiation after event processing finished signal
mRelayoutController->Relayout();
+ // Run any registered processors
+ RunProcessors();
+
// Rebuild depth tree after event processing has finished
mStage->RebuildDepthTree();
mStage->SetStereoBase( stereoBase );
}
+void Core::RegisterProcessor( Integration::Processor& processor )
+{
+ mProcessors.PushBack(&processor);
+}
+
+void Core::UnregisterProcessor( Integration::Processor& processor )
+{
+ auto iter = std::find( mProcessors.Begin(), mProcessors.End(), &processor );
+ if( iter != mProcessors.End() )
+ {
+ mProcessors.Erase( iter );
+ }
+}
+
+void Core::RunProcessors()
+{
+ // Copy processor pointers to prevent changes to vector affecting loop iterator.
+ Dali::Vector<Integration::Processor*> processors( mProcessors );
+
+ for( auto processor : processors )
+ {
+ if( processor )
+ {
+ processor->Process();
+ }
+ }
+}
+
float Core::GetStereoBase() const
{
return mStage->GetStereoBase();
#define DALI_INTERNAL_CORE_H
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
*/
// INTERNAL INCLUDES
+#include <dali/public-api/common/dali-vector.h>
#include <dali/public-api/object/ref-object.h>
#include <dali/integration-api/context-notifier.h>
#include <dali/integration-api/core-enumerations.h>
namespace Integration
{
+class Processor;
class RenderController;
class PlatformAbstraction;
class GestureManager;
*/
float GetStereoBase() const;
-private: // for use by ThreadLocalStorage
+
+ /**
+ * @copydoc Dali::Integration::Core::RegisterProcessor
+ */
+ void RegisterProcessor( Dali::Integration::Processor& processor );
+
+ /**
+ * @copydoc Dali::Integration::Core::UnregisterProcessor
+ */
+ void UnregisterProcessor( Dali::Integration::Processor& processor );
+
+private:
+ /**
+ * Run each registered processor
+ */
+ void RunProcessors();
+
+ // for use by ThreadLocalStorage
/**
* Returns the current stage.
OwnerPointer<NotificationManager> mNotificationManager; ///< Notification manager
OwnerPointer<GestureEventProcessor> mGestureEventProcessor; ///< The gesture event processor
OwnerPointer<EventProcessor> mEventProcessor; ///< The event processor
+ Dali::Vector<Integration::Processor*> mProcessors; ///< Registered processors (not owned)
friend class ThreadLocalStorage;
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
// INTERNAL INCLUDES
#include <dali/integration-api/debug.h>
+#include <dali/devel-api/object/handle-devel.h>
#include <dali/internal/update/animation/scene-graph-constraint-base.h>
#include <dali/internal/update/common/animatable-property.h>
#include <dali/internal/update/common/property-owner-messages.h>
return Property::NONE;
}
+DevelHandle::PropertySetSignalType& Object::PropertySetSignal()
+{
+ return mPropertySetSignal;
+}
+
void Object::SetProperty( Property::Index index, const Property::Value& propertyValue )
{
DALI_ASSERT_ALWAYS(index > Property::INVALID_INDEX && "Property index is out of bounds" );
// TODO: We should not call this for read-only properties, SetDefaultProperty() && TypeInfo::SetProperty() should return a bool, which would be true if the property is set
if ( propertySet )
{
- OnPropertySet(index, propertyValue);
+ OnPropertySet( index, propertyValue );
+ Dali::Handle handle( this );
+ mPropertySetSignal.Emit( handle, index, propertyValue );
}
}
}
}
+bool Object::DoesCustomPropertyExist( Property::Index index )
+{
+ auto metadata = FindCustomProperty( index );
+ return metadata != nullptr;
+}
+
Property::Index Object::RegisterSceneGraphProperty(const std::string& name, Property::Index key, Property::Index index, const Property::Value& propertyValue) const
{
// Create a new property
#define __DALI_INTERNAL_OBJECT_H__
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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/public-api/object/property-input.h>
#include <dali/public-api/object/property-notification.h>
#include <dali/devel-api/common/owner-container.h>
+#include <dali/devel-api/object/handle-devel.h>
#include <dali/internal/event/animation/animation-impl.h>
#include <dali/internal/event/common/event-thread-services.h>
#include <dali/internal/event/common/property-input-impl.h>
{
class ConstraintBase;
class EventThreadServices;
-class Handle;
class PropertyCondition;
class PropertyInputImpl;
class Stage;
virtual Property::Index RegisterProperty( const std::string& name, Property::Index key, const Property::Value& propertyValue, Property::AccessMode accessMode );
/**
+ * @brief returns true if the custom property exists on this object.
+ *
+ * @note The property may be defined for a type within the type registry, but it isn't explicity
+ * defined in every consequent instantiation. It can be automatically added, e.g. parenting an actor
+ * automatically registers it's parent container's child properties.
+ *
+ * @param[in] handle The handle of the object to test
+ * @param[in] index The property index to look for.
+ * @return true if the property exists on the object, false otherwise.
+ */
+ bool DoesCustomPropertyExist( Property::Index index );
+
+ /**
* @copydoc Dali::Handle::AddPropertyNotification()
*/
virtual Dali::PropertyNotification AddPropertyNotification( Property::Index index,
*/
virtual int GetPropertyComponentIndex( Property::Index index ) const;
+ /**
+ * @copydoc Dali::Handle::PropertySetSignal()
+ */
+ DevelHandle::PropertySetSignalType& PropertySetSignal();
+
protected:
/**
typedef PropertyNotificationContainer::iterator PropertyNotificationContainerIter;
typedef PropertyNotificationContainer::const_iterator PropertyNotificationContainerConstIter;
PropertyNotificationContainer* mPropertyNotifications; ///< Container of owned property notifications.
+ DevelHandle::PropertySetSignalType mPropertySetSignal;
};
} // namespace Internal
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
baseImpl.GetPropertyIndices( indices );
}
- if ( ! mRegisteredProperties.empty() )
+ AppendProperties( indices, mRegisteredProperties );
+}
+
+void TypeInfo::GetChildPropertyIndices( Property::IndexContainer& indices ) const
+{
+ Dali::TypeInfo base = TypeRegistry::Get()->GetTypeInfo( mBaseTypeName );
+ if ( base )
+ {
+ const TypeInfo& baseImpl( GetImplementation( base ) );
+ baseImpl.GetChildPropertyIndices( indices );
+ }
+
+ AppendProperties( indices, mRegisteredChildProperties );
+}
+
+/**
+ * Append the indices in RegisteredProperties to the given index container.
+ */
+void TypeInfo::AppendProperties( Dali::Property::IndexContainer& indices,
+ const TypeInfo::RegisteredPropertyContainer& registeredProperties ) const
+{
+ if ( ! registeredProperties.empty() )
{
- indices.Reserve( indices.Size() + mRegisteredProperties.size() );
+ indices.Reserve( indices.Size() + registeredProperties.size() );
- const RegisteredPropertyContainer::const_iterator endIter = mRegisteredProperties.end();
- for ( RegisteredPropertyContainer::const_iterator iter = mRegisteredProperties.begin(); iter != endIter; ++iter )
+ for( auto&& elem : registeredProperties )
{
- indices.PushBack( iter->first );
+ indices.PushBack( elem.first );
}
}
}
#define __DALI_INTERNAL_TYPE_INFO_H__
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
Property::Type GetChildPropertyType( Property::Index index ) const;
/**
+ * Retrive the child indices into the given container.
+ * @param[in,out] indices The container to put the child indices into
+ */
+ void GetChildPropertyIndices( Property::IndexContainer& indices ) const;
+
+ /**
* Retrieve the default value of the property at the given index.
* @param[in] index The property index.
* @return The default property value at that index.
typedef std::vector< RegisteredPropertyPair > RegisteredPropertyContainer;
typedef std::vector< PropertyDefaultValuePair > PropertyDefaultValueContainer;
+
+ /**
+ * Append properties from registeredProperties onto indices.
+ * @param[in,out] indices The vector to append indices onto
+ * @param[in] registeredProperties The container to retrive indices from
+ */
+ void AppendProperties( Dali::Property::IndexContainer& indices,
+ const TypeInfo::RegisteredPropertyContainer& registeredProperties ) const;
+
+private:
+
std::string mTypeName;
std::string mBaseTypeName;
bool mCSharpType:1; ///< Whether this type info is for a CSharp control (instead of C++)
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
return false;
}
-bool TypeRegistry::RegisterChildProperty( TypeRegistration& typeRegistration, const std::string& name, Property::Index index, Property::Type type )
+bool TypeRegistry::RegisterChildProperty( const std::string& registeredType, const std::string& name, Property::Index index, Property::Type type )
{
for( auto&& iter : mRegistryLut )
{
auto&& impl = GetImplementation( iter );
- if( impl.GetName() == typeRegistration.RegisteredName() )
+ if( impl.GetName() == registeredType )
{
impl.AddChildProperty( name, index, type );
return true;
return false;
}
+bool TypeRegistry::RegisterChildProperty( TypeRegistration& typeRegistration, const std::string& name, Property::Index index, Property::Type type )
+{
+ return RegisterChildProperty( typeRegistration.RegisteredName(), name, index, type );
+}
+
bool TypeRegistry::DoActionTo( BaseObject * const object, const std::string& actionName, const Property::Map& properties )
{
bool done = false;
#define __DALI_INTERNAL_TYPE_REGISTRY_H__
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
/**
* Register a event-thread only property with a type and a default value
+ * @param [in] registeredType Name of a registered type on which to register the child property.
+ * @param [in] name Property name
+ * @param [in] index Property index
+ * @param [in] type Property type
+ * @return true if registered
+ */
+ bool RegisterChildProperty( const std::string& registeredType, const std::string& name, Property::Index index, Property::Type type );
+
+ /**
+ * Register a event-thread only property with a type and a default value
* @param [in] registered TypeRegistration object used to register the type
* @param [in] name Property name
* @param [in] index Property index
mShader = shader;
mShader->AddConnectionObserver( *this );
mRegenerateUniformMap = REGENERATE_UNIFORM_MAP;
+ mResendFlag |= RESEND_GEOMETRY;
if( mRenderDataProvider )
{
namespace WrapMode
{
-
+/**
+ * @brief Enumeration for Wrap mode.
+ * @SINCE_1_0.0
+ */
enum Type
{
DEFAULT = 0, ///< Clamp to edge @SINCE_1_0.0
- CLAMP_TO_EDGE,
- REPEAT,
- MIRRORED_REPEAT
+ CLAMP_TO_EDGE, ///< Clamp to edge @SINCE_1_0.0
+ REPEAT, ///< Repeat @SINCE_1_0.0
+ MIRRORED_REPEAT ///< Mirrored repeat @SINCE_1_0.0
};
} //namespace WrapMode
typedef const T* ConstIterator; ///< Const iterator @SINCE_1_0.0
typedef T ItemType; ///< Item type @SINCE_1_0.0
+ /**
+ * @brief Enumeration for BaseType.
+ * @SINCE_1_0.0
+ */
enum
{
- BaseType = IsTrivialType
+ BaseType = IsTrivialType ///< @SINCE_1_0.0
};
/**
const unsigned int CORE_MAJOR_VERSION = 1;
const unsigned int CORE_MINOR_VERSION = 3;
-const unsigned int CORE_MICRO_VERSION = 17;
+const unsigned int CORE_MICRO_VERSION = 19;
const char * const CORE_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
#define __DALI_HANDLE_H__
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
* @pre The Object has been initialized.
*/
void RemoveConstraints( unsigned int tag );
-
};
/**
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
return GetImplementation(*this).GetPropertyName( index );
}
+Property::Index TypeInfo::GetChildPropertyIndex( const std::string& name ) const
+{
+ return GetImplementation(*this).GetChildPropertyIndex( name );
+}
+
+const std::string& TypeInfo::GetChildPropertyName( Property::Index index ) const
+{
+ return GetImplementation(*this).GetChildPropertyName( index );
+}
+
+Property::Type TypeInfo::GetChildPropertyType( Property::Index index ) const
+{
+ return GetImplementation(*this).GetChildPropertyType( index );
+}
+
+void TypeInfo::GetChildPropertyIndices( Property::IndexContainer& indices ) const
+{
+ indices.Clear(); // We do not want to clear the container if called internally, so only clear here
+ GetImplementation(*this).GetChildPropertyIndices( indices );
+}
+
TypeInfo::TypeInfo(Internal::TypeInfo* internal)
: BaseHandle(internal)
{
}
} // namespace Dali
-
#define __DALI_TYPE_INFO_H__
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
void GetPropertyIndices( Property::IndexContainer& indices ) const;
/**
+ * @brief Retrieves all the child property indices for this type.
+ *
+ * @SINCE_1_3.20
+ * @param[out] indices Container of property indices
+ * @note The container will be cleared
+ */
+ void GetChildPropertyIndices( Property::IndexContainer& indices ) const;
+
+ /**
* @brief Given a property index, retrieve the property name associated with it.
*
* @SINCE_1_0.0
*/
const std::string& GetPropertyName( Property::Index index ) const;
+
+ /**
+ * @brief Given a child property name, retrieve the property index associated with it,
+ *
+ * @SINCE_1_3.20
+ * @param[in] name The name of the property at the given index,
+ * @return The property index or Property::INVALID_INDEX
+ */
+ Property::Index GetChildPropertyIndex( const std::string& name ) const;
+
+ /**
+ * @brief Given a child property index, retrieve the property name associated with it.
+ *
+ * @SINCE_1_3.20
+ * @param[in] index The property index
+ * @return The name of the property at the given index, or empty string if it does not exist
+ */
+ const std::string& GetChildPropertyName( Property::Index index ) const;
+
+ /**
+ * @brief Given a child property index, retrieve the property name associated with it.
+ *
+ * @SINCE_1_3.20
+ * @param[in] index The property index
+ * @return The name of the property at the given index, or empty string if it does not exist
+ */
+ Property::Type GetChildPropertyType( Property::Index index ) const;
+
+
+
public: // Not intended for application developers
/// @cond internal
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
Internal::TypeRegistry::Get()->RegisterChildProperty( registered, name, index, type );
}
+ChildPropertyRegistration::ChildPropertyRegistration( const std::string& registered, const std::string& name, Property::Index index, Property::Type type )
+{
+ DALI_ASSERT_ALWAYS( ( index >= CHILD_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= CHILD_PROPERTY_REGISTRATION_MAX_INDEX ) );
+
+ Internal::TypeRegistry::Get()->RegisterChildProperty( registered, name, index, type );
+}
+
+
} // namespace Dali
#define __DALI_TYPE_REGISTRY_H__
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
* @pre "registered" must be registered with the TypeRegistry.
*/
ChildPropertyRegistration( TypeRegistration& registered, const std::string& name, Property::Index index, Property::Type type );
+
+ /**
+ * @brief This constructor registers an event-thread only child property (i.e. a property
+ * that the parent supports in its children) with the registered type.
+ *
+ * @SINCE_1_3.20
+ * @param[in] registered The name of the registered type
+ * @param[in] name The name of the property
+ * @param[in] index The property index. Must be a value between CHILD_PROPERTY_REGISTRATION_START_INDEX and CHILD_PROPERTY_REGISTRATION_MAX_INDEX inclusive
+ * @param[in] type The property value type
+ * @pre "registered" must be registered with the TypeRegistry.
+ */
+ ChildPropertyRegistration( const std::string& registered, const std::string& name, Property::Index index, Property::Type type );
};
Name: dali
Summary: DALi 3D Engine
-Version: 1.3.17
+Version: 1.3.19
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-3-Clause and MIT
%if 0%{?enable_debug}
--enable-debug \
%endif
+%if 0%{?enable_trace}
+ --enable-trace \
+%endif
--infodir=%{_infodir} \
--enable-rename-so=no
%if 0%{?enable_debug}
--enable-debug \
%endif
+%if 0%{?enable_trace}
+ --enable-trace \
+%endif
--infodir=%{_infodir} \
--enable-rename-so=no