1. GBS Builds
1.1. NON-SMACK Targets
1.2. SMACK enabled Targets
+ 1.3. DEBUG Builds
+ 1.4. MOBILE Profile
2. Building for Ubuntu desktop
2.1. Minimum Requirements
2.2. Building the Repository
gbs build -A [TARGET_ARCH] --define "%enable_dali_smack_rules 1"
-1.3. MOBILE Profile
--------------------
+1.3. DEBUG Builds
+-----------------
- gbs build -A [TARGET_ARCH] --spec dali-toolkit-mobile.spec
+ gbs build -A [TARGET_ARCH] --define "%enable_debug 1"
2. Building for Ubuntu desktop
==============================
LIST(APPEND TC_SOURCES
dali-toolkit-test-utils/toolkit-accessibility-adaptor.cpp
dali-toolkit-test-utils/toolkit-application.cpp
+ dali-toolkit-test-utils/toolkit-bitmap-loader.cpp
dali-toolkit-test-utils/toolkit-clipboard.cpp
dali-toolkit-test-utils/toolkit-clipboard-event-notifier.cpp
dali-toolkit-test-utils/toolkit-event-thread-callback.cpp
#include <dali/dali.h>
#include <dali-toolkit/dali-toolkit.h>
#include <test-button.h>
-#include <dali/devel-api/object/type-registry-helper.h>
using namespace Dali;
using namespace Dali::Toolkit;
* limitations under the License.
*/
+// CLASS HEADER
+#include "toolkit-bitmap-loader.h"
+
+// EXTERNAL INCLUDES
#include <dali/public-api/object/base-object.h>
-#include <dali/devel-api/adaptor-framework/bitmap-loader.h>
#include <cstring>
+#include <semaphore.h>
using namespace Dali;
namespace Dali
{
-class Adaptor;
+namespace
+{
+Dali::BitmapLoader gBitmapLoader;
+}
+
namespace Internal
{
mPixelData(),
mUrl(url)
{
+ sem_init( &mySemaphore, 0, 0 );
}
~BitmapLoader(){}
memset(buffer, 0, bufferSize);
mPixelData = PixelData::New( buffer, mSize.GetWidth(), mSize.GetHeight(), Pixel::RGBA8888, PixelData::FREE);
+
+ sem_post( &mySemaphore );
}
PixelDataPtr GetPixelData() const
return mPixelData ? true : false;
}
+ void WaitForLoading()
+ {
+ if( mPixelData )
+ {
+ return;
+ }
+ sem_wait( &mySemaphore );
+ }
+
ImageDimensions mSize;
PixelDataPtr mPixelData;
const std::string mUrl;
+ sem_t mySemaphore;
};
} // internal
Dali::BitmapLoader Dali::BitmapLoader::New(std::string const&url, Dali::Uint16Pair size, Dali::FittingMode::Type fittingMode, Dali::SamplingMode::Type samplingMode, bool orientationCorrection)
{
IntrusivePtr<Internal::BitmapLoader> internal = Internal::BitmapLoader::New(url, size, fittingMode, samplingMode, orientationCorrection);
- return BitmapLoader( internal.Get() );
+ gBitmapLoader = BitmapLoader(internal.Get());
+ return gBitmapLoader;
+}
+
+BitmapLoader::BitmapLoader()
+{
}
Dali::BitmapLoader::BitmapLoader(Dali::BitmapLoader const& handle)
Dali::BitmapLoader::~BitmapLoader()
{
}
+BitmapLoader& BitmapLoader::operator=(const BitmapLoader& rhs)
+{
+ BaseHandle::operator=(rhs);
+ return *this;
+}
void Dali::BitmapLoader::Load()
{
GetImplementation(*this).Load();
{
return GetImplementation(*this).IsLoaded();
}
+void Dali::BitmapLoader::WaitForLoading()
+{
+ GetImplementation(*this).WaitForLoading();
+}
+
+BitmapLoader Dali::BitmapLoader::GetLatestCreated()
+{
+ return gBitmapLoader;
+}
+
+void Dali::BitmapLoader::ResetLatestCreated()
+{
+ gBitmapLoader.Reset();
+}
} // Dali
--- /dev/null
+#ifndef __DALI_TOOLKIT_BITMAP_LOADER_H__
+#define __DALI_TOOLKIT_BITMAP_LOADER_H__
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define __DALI_BITMAP_LOADER_H__
+
+#include <string>
+#include <dali/public-api/common/dali-common.h>
+#include <dali/public-api/images/pixel.h>
+#include <dali/public-api/images/image-operations.h>
+#include <dali/public-api/object/base-handle.h>
+#include <dali/devel-api/images/pixel-data.h>
+
+namespace Dali
+{
+namespace Internal
+{
+class BitmapLoader;
+}
+
+class DALI_IMPORT_API BitmapLoader : public BaseHandle
+{
+public:
+
+ static BitmapLoader New( const std::string& url,
+ ImageDimensions size = ImageDimensions( 0, 0 ),
+ FittingMode::Type fittingMode = FittingMode::DEFAULT,
+ SamplingMode::Type samplingMode = SamplingMode::BOX_THEN_LINEAR,
+ bool orientationCorrection = true);
+ BitmapLoader();
+ ~BitmapLoader();
+ BitmapLoader(const BitmapLoader& handle);
+ BitmapLoader& operator=(const BitmapLoader& rhs);
+
+public:
+ void Load();
+ bool IsLoaded();
+ std::string GetUrl() const;
+ PixelDataPtr GetPixelData() const;
+
+ void WaitForLoading();
+ static BitmapLoader GetLatestCreated(); // return the latest created BitmapLoader
+ static void ResetLatestCreated();
+
+public: // Not intended for application developers
+
+ explicit DALI_INTERNAL BitmapLoader(Internal::BitmapLoader*);
+};
+
+} // Dali
+
+#endif /* __DALI_TOOLKIT_BITMAP_LOADER_H__ */
#include <dali-toolkit/devel-api/builder/builder.h>
#include <dali/integration-api/events/touch-event-integ.h>
#include <dali-toolkit/dali-toolkit.h>
-#include <dali/devel-api/object/type-registry-helper.h>
#include <test-button.h>
#include <test-animation-data.h>
propertyMap.Insert( "desiredHeight", 30 );
propertyMap.Insert( "fittingMode", "FIT_HEIGHT" );
propertyMap.Insert( "samplingMode", "BOX_THEN_NEAREST" );
+ propertyMap.Insert( "synchronousLoading", true );
ControlRenderer imageRenderer = factory.GetControlRenderer(propertyMap);
DALI_TEST_CHECK( imageRenderer );
DALI_TEST_CHECK( value );
DALI_TEST_CHECK( value->Get<int>() == 30 );
+ value = resultMap.Find( "synchronousLoading", Property::BOOLEAN );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK( value->Get<bool>() == true );
+
// Get an image renderer with an image handle, and test the default property values
Image image = ResourceImage::New(TEST_IMAGE_FILE_NAME, ImageDimensions(100, 200));
imageRenderer = factory.GetControlRenderer(image);
DALI_TEST_CHECK( value );
DALI_TEST_CHECK( value->Get<int>() == 200 );
+ value = resultMap.Find( "synchronousLoading", Property::BOOLEAN );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK( value->Get<bool>() == false );
+
END_TEST;
}
// Need to override adaptor classes for toolkit test harness, so include
// test harness headers before dali headers.
#include <dali-toolkit-test-suite-utils.h>
+#include <toolkit-bitmap-loader.h>
+#include <toolkit-event-thread-callback.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali/devel-api/scripting/scripting.h>
const char* TEST_IMAGE_FILE_NAME = "gallery_image_01.jpg";
const char* TEST_IMAGE_FILE_NAME2 = "gallery_image_02.jpg";
+// resolution: 34*34, pixel format: RGBA8888
+static const char* gImage_34_RGBA = TEST_RESOURCE_DIR "/icon-edit.png";
+// resolution: 600*600, pixel format: RGB888
+static const char* gImage_600_RGB = TEST_RESOURCE_DIR "/test-image-600.jpg";
+
void TestImage( ImageView imageView, BufferImage image )
{
Property::Value value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
END_TEST;
}
+int UtcDaliImageViewAsyncLoadingWithoutAltasing(void)
+{
+ ToolkitTestApplication application;
+
+ // Async loading, no atlasing for big size image
+ ImageView imageView = ImageView::New( gImage_600_RGB );
+
+ // By default, Aysnc loading is used
+ Stage::GetCurrent().Add( imageView );
+ application.SendNotification();
+ application.Render(16);
+ application.Render(16);
+ application.SendNotification();
+
+ // BitmapLoader is not used
+ BitmapLoader loader = BitmapLoader::GetLatestCreated();
+ DALI_TEST_CHECK( !loader );
+
+ END_TEST;
+}
+
+int UtcDaliImageViewAsyncLoadingWithAltasing(void)
+{
+ ToolkitTestApplication application;
+
+ //Async loading, automatic atlasing for small size image
+ TraceCallStack& callStack = application.GetGlAbstraction().GetTextureTrace();
+ callStack.Reset();
+ callStack.Enable(true);
+
+ ImageView imageView = ImageView::New( gImage_34_RGBA, ImageDimensions( 34, 34 ) );
+
+ // By default, Aysnc loading is used
+ // loading is not started if the actor is offStage
+ BitmapLoader loader = BitmapLoader::GetLatestCreated();
+ DALI_TEST_CHECK( !loader );
+
+ Stage::GetCurrent().Add( imageView );
+ application.SendNotification();
+ application.Render(16);
+ application.Render(16);
+ application.SendNotification();
+
+ // loading started
+ loader = BitmapLoader::GetLatestCreated();
+ DALI_TEST_CHECK( loader );
+
+ // worker thread is created
+ EventThreadCallback* eventTrigger = EventThreadCallback::Get();
+ DALI_TEST_CHECK( eventTrigger );
+
+ loader.WaitForLoading();// waiting until the image to be loaded
+ DALI_TEST_CHECK( loader.IsLoaded() );
+
+ CallbackBase* callback = eventTrigger->GetCallback();
+ CallbackBase::Execute( *callback );
+
+ application.SendNotification();
+ application.Render(16);
+
+ callStack.Enable(false);
+
+ DALI_TEST_CHECK( callStack.FindMethodAndParams("TexSubImage2D", "0, 0, 34, 34" ) );
+
+
+ END_TEST;
+}
+
+int UtcDaliImageViewSyncLoading(void)
+{
+ ToolkitTestApplication application;
+
+ Property::Map syncLoadingMap;
+ syncLoadingMap[ "synchronousLoading" ] = true;
+
+ // Sync loading, no atlasing for big size image
+ {
+ ImageView imageView = ImageView::New( gImage_600_RGB );
+
+ // Sync loading is used
+ imageView.SetProperty( ImageView::Property::IMAGE, syncLoadingMap );
+
+ // BitmapLoader is used, and the loading is started immediately even the actor is not on stage.
+ BitmapLoader loader = BitmapLoader::GetLatestCreated();
+ DALI_TEST_CHECK( loader );
+ }
+
+ // Sync loading, automatic atlasing for small size image
+ {
+ BitmapLoader::ResetLatestCreated();
+ TraceCallStack& callStack = application.GetGlAbstraction().GetTextureTrace();
+ callStack.Reset();
+ callStack.Enable(true);
+
+ ImageView imageView = ImageView::New( );
+ // Sync loading is used
+ syncLoadingMap[ "url" ] = gImage_34_RGBA;
+ syncLoadingMap[ "desiredHeight" ] = 34;
+ syncLoadingMap[ "desiredWidth" ] = 34;
+ imageView.SetProperty( ImageView::Property::IMAGE, syncLoadingMap );
+
+ // loading is started even if the actor is offStage
+ BitmapLoader loader = BitmapLoader::GetLatestCreated();
+ DALI_TEST_CHECK( loader );
+
+ loader.WaitForLoading();
+
+ DALI_TEST_CHECK( loader.IsLoaded() );
+
+ Stage::GetCurrent().Add( imageView );
+ application.SendNotification();
+ application.Render(16);
+ DALI_TEST_CHECK( callStack.FindMethodAndParams("TexSubImage2D", "0, 0, 34, 34" ) );
+ }
+
+ END_TEST;
+}
+
int UtcDaliImageViewSizeWithBackground(void)
{
ToolkitTestApplication application;
END_TEST;
}
-int UtcDaliTableViewCustomProperties(void)
+int UtcDaliTableViewChildProperties(void)
{
ToolkitTestApplication application;
- tet_infoline("UtcDaliTableViewCustomProperties");
+ tet_infoline("UtcDaliTableViewChildProperties");
// Create a 10x10 table-view
TableView tableView = TableView::New(10,10);
// Create a child actor with the custom properties
Actor child1 = Actor::New();
- child1.RegisterProperty( "cellIndex", Vector2( 3, 4 ), Property::READ_WRITE );
+ child1.SetProperty( TableView::ChildProperty::CELL_INDEX, Vector2( 3, 4 ) );
tableView.Add( child1 );
// Check for actors at actual positions.
DALI_TEST_CHECK( tableView.GetChildAt(TableView::CellPosition(3,4)) == child1);
Actor child2 = Actor::New();
float rowSpan = 3.f;
float columnSpan = 2.f;
- child2.RegisterProperty( "cellIndex", Vector2( 6, 1 ), Property::READ_WRITE );
- child2.RegisterProperty( "rowSpan", rowSpan, Property::READ_WRITE );
- child2.RegisterProperty( "columnSpan", columnSpan, Property::READ_WRITE );
+ child2.SetProperty( TableView::ChildProperty::CELL_INDEX, Vector2( 6, 1 ) );
+ child2.SetProperty( TableView::ChildProperty::ROW_SPAN, rowSpan );
+ child2.SetProperty( TableView::ChildProperty::COLUMN_SPAN, columnSpan );
tableView.Add( child2 );
// Check for actors at actual positions.
for( int i=0; i<rowSpan; i++ )
// Create a third child actor with the cell alignment properties
Actor child3 = Actor::New();
child3.SetSize( 5.f,5.f );
- child3.RegisterProperty( "cellHorizontalAlignment", "center", Property::READ_WRITE );
- child3.RegisterProperty( "cellVerticalAlignment", "bottom", Property::READ_WRITE );
+ child3.SetProperty( TableView::ChildProperty::CELL_HORIZONTAL_ALIGNMENT, "center" );
+ child3.SetProperty( TableView::ChildProperty::CELL_VERTICAL_ALIGNMENT, "bottom" );
tableView.Add( child3 );
// store the actor in the first available cell
// EXTERNAL INCLUDES
#include <dali/public-api/object/property-input.h>
#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/public-api/size-negotiation/relayout-container.h>
namespace Dali
#include <dali/public-api/common/stage.h>
#include <dali/public-api/object/property-map.h>
#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/public-api/render-tasks/render-task-list.h>
#include <dali/devel-api/rendering/renderer.h>
#include <dali/public-api/events/touch-event.h>
#include <dali/public-api/images/resource-image.h>
#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/devel-api/scripting/scripting.h>
// INTERNAL INCLUDES
// EXTERNAL INCLUDES
#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/public-api/images/resource-image.h>
#include <dali/devel-api/scripting/scripting.h>
#include <dali/public-api/common/stage.h>
#include <dali/public-api/object/property-map.h>
#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/public-api/render-tasks/render-task-list.h>
// INTERNAL INCLUDES
#include <sstream>
#include <dali/public-api/object/ref-object.h>
#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/devel-api/scripting/scripting.h>
#include <dali/public-api/size-negotiation/relayout-container.h>
#include <dali/integration-api/debug.h>
// These properties should be dynamically registered to the child which
// would be added to FlexContainer.
- childNode->style.flex = childActor.GetProperty( Toolkit::FlexContainer::ChildProperty::FLEX ).Get<float>();
-
- Toolkit::FlexContainer::Alignment alignSelf( Toolkit::FlexContainer::ALIGN_AUTO );
- Property::Value alignSelfPropertyValue = childActor.GetProperty( Toolkit::FlexContainer::ChildProperty::ALIGN_SELF );
- if( alignSelfPropertyValue.GetType() == Property::INTEGER )
+ if( childActor.GetPropertyType( Toolkit::FlexContainer::ChildProperty::FLEX ) != Property::NONE )
{
- alignSelf = static_cast<Toolkit::FlexContainer::Alignment>( alignSelfPropertyValue.Get< int >() );
+ childNode->style.flex = childActor.GetProperty( Toolkit::FlexContainer::ChildProperty::FLEX ).Get<float>();
}
- else if( alignSelfPropertyValue.GetType() == Property::STRING )
+
+ Toolkit::FlexContainer::Alignment alignSelf( Toolkit::FlexContainer::ALIGN_AUTO );
+ if( childActor.GetPropertyType( Toolkit::FlexContainer::FlexContainer::ChildProperty::ALIGN_SELF ) != Property::NONE )
{
- std::string value = alignSelfPropertyValue.Get<std::string>();
- Scripting::GetEnumeration< Toolkit::FlexContainer::Alignment >( value.c_str(),
- ALIGN_SELF_STRING_TABLE,
- ALIGN_SELF_STRING_TABLE_COUNT,
- alignSelf );
+ Property::Value alignSelfPropertyValue = childActor.GetProperty( Toolkit::FlexContainer::ChildProperty::ALIGN_SELF );
+ if( alignSelfPropertyValue.GetType() == Property::INTEGER )
+ {
+ alignSelf = static_cast<Toolkit::FlexContainer::Alignment>( alignSelfPropertyValue.Get< int >() );
+ }
+ else if( alignSelfPropertyValue.GetType() == Property::STRING )
+ {
+ std::string value = alignSelfPropertyValue.Get<std::string>();
+ Scripting::GetEnumeration< Toolkit::FlexContainer::Alignment >( value.c_str(),
+ ALIGN_SELF_STRING_TABLE,
+ ALIGN_SELF_STRING_TABLE_COUNT,
+ alignSelf );
+ }
}
childNode->style.align_self = static_cast<css_align_t>(alignSelf);
- Vector4 flexMargin = childActor.GetProperty( Toolkit::FlexContainer::ChildProperty::FLEX_MARGIN ).Get<Vector4>();
- childNode->style.margin[CSS_LEFT] = flexMargin.x;
- childNode->style.margin[CSS_TOP] = flexMargin.y;
- childNode->style.margin[CSS_RIGHT] = flexMargin.z;
- childNode->style.margin[CSS_BOTTOM] = flexMargin.w;
+ if( childActor.GetPropertyType( Toolkit::FlexContainer::ChildProperty::FLEX_MARGIN ) != Property::NONE )
+ {
+ Vector4 flexMargin = childActor.GetProperty( Toolkit::FlexContainer::ChildProperty::FLEX_MARGIN ).Get<Vector4>();
+ childNode->style.margin[CSS_LEFT] = flexMargin.x;
+ childNode->style.margin[CSS_TOP] = flexMargin.y;
+ childNode->style.margin[CSS_RIGHT] = flexMargin.z;
+ childNode->style.margin[CSS_BOTTOM] = flexMargin.w;
+ }
}
// Calculate the layout
#include <dali/public-api/common/stage.h>
#include <dali/public-api/object/property-map.h>
#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/public-api/render-tasks/render-task-list.h>
#include <dali/integration-api/debug.h>
// EXTERNAL INCLUDES
#include <dali/public-api/images/resource-image.h>
#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/devel-api/scripting/scripting.h>
// INTERNAL INCLUDES
using namespace Dali;
ImageView::ImageView()
-: Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ),
- mPremultipledAlphaEnabled( false )
+: Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) )
{
}
case Toolkit::ImageView::Property::PRE_MULTIPLIED_ALPHA:
{
- bool IsPre;
- if( value.Get( IsPre ) )
+ bool isPre;
+ if( value.Get( isPre ) )
{
- GetImpl(imageView).EnablePreMultipliedAlpha( IsPre );
+ GetImpl(imageView).EnablePreMultipliedAlpha( isPre );
}
break;
}
std::string mUrl; ///< the url for the image if the image came from a URL, empty otherwise
Image mImage; ///< the Image if the image came from a Image, null otherwise
Property::Map mPropertyMap; ///< the Property::Map if the image came from a Property::Map, empty otherwise
-
- bool mPremultipledAlphaEnabled; ///< Flag indicating whether the Pre-multiplied Alpha Blending is required
};
} // namespace Internal
#include <dali/public-api/render-tasks/render-task-list.h>
#include <dali/public-api/images/resource-image.h>
#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
// INTERNAL INCLUDES
#include <dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h>
#include <dali/public-api/animation/constraint.h>
#include <dali/public-api/animation/constraint-source.h>
#include <dali/public-api/animation/constraints.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali-toolkit/public-api/controls/model3d-view/model3d-view.h>
#include <dali/public-api/images/resource-image.h>
#include <dali/devel-api/adaptor-framework/file-loader.h>
// EXTERNAL INCLUDES
#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
namespace Dali
{
// EXTERNAL INCLUDES
#include <dali/public-api/animation/animation.h>
#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
//INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/page-turn-view/page-turn-effect.h>
#include <dali/public-api/animation/constraint.h>
#include <dali/public-api/images/resource-image.h>
#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
// EXTERNAL INCLUDES
#include <dali/public-api/images/resource-image.h>
#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <cstring>
namespace Dali
// EXTERNAL INCLUDES
#include <cstring> // for strcmp
#include <dali/devel-api/adaptor-framework/physical-keyboard.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/integration-api/debug.h>
#include <dali/public-api/adaptor-framework/key.h>
#include <dali/public-api/animation/constraints.h>
{
IS_ON_STAGE = 1,
IS_FROM_CACHE = 1 << 1,
- IS_PREMULTIPLIED_ALPHA = 1 << 2
+ IS_PREMULTIPLIED_ALPHA = 1 << 2,
+ IS_SYNCHRONOUS_RESOURCE_LOADING = 1 << 3
};
struct CustomShader
void ControlRenderer::EnablePreMultipliedAlpha( bool preMultipled )
{
- mImpl->mFlags |= Impl::IS_PREMULTIPLIED_ALPHA;
+ if(preMultipled)
+ {
+ mImpl->mFlags |= Impl::IS_PREMULTIPLIED_ALPHA;
+ }
+ else
+ {
+ mImpl->mFlags &= ~Impl::IS_PREMULTIPLIED_ALPHA;
+ }
+
if( mImpl->mRenderer )
{
mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA, preMultipled);
#include <cstring> // for strncasecmp
#include <dali/public-api/images/resource-image.h>
#include <dali/public-api/images/native-image.h>
+#include <dali/devel-api/images/atlas.h>
+#include <dali/devel-api/adaptor-framework/bitmap-loader.h>
#include <dali/integration-api/debug.h>
// INTERNAL HEADER
const char * const IMAGE_SAMPLING_MODE( "samplingMode" );
const char * const IMAGE_DESIRED_WIDTH( "desiredWidth" );
const char * const IMAGE_DESIRED_HEIGHT( "desiredHeight" );
+const char * const SYNCHRONOUS_LOADING( "synchronousLoading" );
// fitting modes
const char * const SHRINK_TO_FIT("SHRINK_TO_FIT");
}
mDesiredSize = ImageDimensions( desiredWidth, desiredHeight );
+
+ }
+
+ Property::Value* syncLoading = propertyMap.Find( SYNCHRONOUS_LOADING );
+ if( syncLoading )
+ {
+ bool sync;
+ syncLoading->Get( sync );
+ if( sync )
+ {
+ mImpl->mFlags |= Impl::IS_SYNCHRONOUS_RESOURCE_LOADING;
+ }
+ else
+ {
+ mImpl->mFlags &= ~Impl::IS_SYNCHRONOUS_RESOURCE_LOADING;
+ }
+ }
+
+ // if sync loading is required, the loading should start immediately when new image url is set or the actor is off stage
+ // ( for on-stage actor with image url unchanged, resource loading is already finished)
+ if( ( !mImpl->mRenderer || imageURLValue) && IsSynchronousResourceLoading() )
+ {
+ DoSynchronousResourceLoading();
}
// remove old renderer if exit
}
}
- TextureSet textureSet = TextureSet::New();
-
Renderer renderer = Renderer::New( geometry, shader );
- renderer.SetTextures( textureSet );
return renderer;
}
else
{
geometry = CreateGeometry( mFactoryCache, mImpl->mCustomShader->mGridSize );
- if( mImpl->mCustomShader->mVertexShader.empty() && mImpl->mCustomShader->mFragmentShader.empty() )
+ shader = Shader::New( mImpl->mCustomShader->mVertexShader.empty() ? VERTEX_SHADER : mImpl->mCustomShader->mVertexShader,
+ mNativeFragmentShaderCode,
+ mImpl->mCustomShader->mHints );
+ if( mImpl->mCustomShader->mVertexShader.empty() )
{
- shader = Shader::New( VERTEX_SHADER, mNativeFragmentShaderCode );
- }
- else
- {
- shader = Shader::New( mImpl->mCustomShader->mVertexShader.empty() ? VERTEX_SHADER : mImpl->mCustomShader->mVertexShader,
- mNativeFragmentShaderCode,
- mImpl->mCustomShader->mHints );
- if( mImpl->mCustomShader->mVertexShader.empty() )
- {
- shader.RegisterProperty( ATLAS_RECT_UNIFORM_NAME, FULL_TEXTURE_RECT );
- shader.RegisterProperty( PIXEL_AREA_UNIFORM_NAME, FULL_TEXTURE_RECT );
- }
+ shader.RegisterProperty( ATLAS_RECT_UNIFORM_NAME, FULL_TEXTURE_RECT );
+ shader.RegisterProperty( PIXEL_AREA_UNIFORM_NAME, FULL_TEXTURE_RECT );
}
}
return renderer;
}
+
+bool ImageRenderer::IsSynchronousResourceLoading() const
+{
+ return mImpl->mFlags & Impl::IS_SYNCHRONOUS_RESOURCE_LOADING;
+}
+
+void ImageRenderer::DoSynchronousResourceLoading()
+{
+ if( !mImageUrl.empty() )
+ {
+ BitmapLoader loader = BitmapLoader::New( mImageUrl, mDesiredSize, mFittingMode, mSamplingMode );
+ loader.Load();
+ mPixels = loader.GetPixelData();
+ }
+}
+
+Image ImageRenderer::LoadImage( const std::string& url, bool synchronousLoading )
+{
+ if( synchronousLoading )
+ {
+ if( !mPixels )
+ {
+ // use broken image
+ return RendererFactory::GetBrokenRendererImage();
+ }
+ Atlas image = Atlas::New( mPixels->GetWidth(), mPixels->GetHeight(), mPixels->GetPixelFormat() );
+ image.Upload( mPixels, 0, 0 );
+ return image;
+ }
+ else
+ {
+ ResourceImage resourceImage = Dali::ResourceImage::New( url, mDesiredSize, mFittingMode, mSamplingMode );
+ resourceImage.LoadingFinishedSignal().Connect( this, &ImageRenderer::OnImageLoaded );
+ return resourceImage;
+ }
+}
+
+TextureSet ImageRenderer::CreateTextureSet( Vector4& textureRect, const std::string& url, bool synchronousLoading )
+{
+ TextureSet textureSet;
+ textureRect = FULL_TEXTURE_RECT;
+ if( synchronousLoading )
+ {
+ if( !mPixels )
+ {
+ // use broken image
+ textureSet = TextureSet::New();
+ textureSet.SetImage( 0u, RendererFactory::GetBrokenRendererImage() );
+ }
+ else
+ {
+ textureSet = mAtlasManager.Add(textureRect, mPixels );
+ if( !textureSet ) // big image, no atlasing
+ {
+ Atlas image = Atlas::New( mPixels->GetWidth(), mPixels->GetHeight(), mPixels->GetPixelFormat() );
+ image.Upload( mPixels, 0, 0 );
+ textureSet = TextureSet::New();
+ textureSet.SetImage( 0u, image );
+ }
+ }
+ }
+ else
+ {
+ textureSet = mAtlasManager.Add(textureRect, url, mDesiredSize, mFittingMode, mSamplingMode );
+ if( !textureSet ) // big image, no atlasing
+ {
+ ResourceImage resourceImage = Dali::ResourceImage::New( url, mDesiredSize, mFittingMode, mSamplingMode );
+ resourceImage.LoadingFinishedSignal().Connect( this, &ImageRenderer::OnImageLoaded );
+ textureSet = TextureSet::New();
+ textureSet.SetImage( 0u, resourceImage );
+ }
+ }
+
+ return textureSet;
+}
+
void ImageRenderer::InitializeRenderer( const std::string& imageUrl )
{
if( imageUrl.empty() )
if( !mImpl->mRenderer )
{
Vector4 atlasRect;
- TextureSet textureSet = mAtlasManager.Add(atlasRect, imageUrl, mDesiredSize, mFittingMode, mSamplingMode );
- if( textureSet )
+ TextureSet textureSet = CreateTextureSet(atlasRect, imageUrl, IsSynchronousResourceLoading() );
+ Geometry geometry = CreateGeometry( mFactoryCache, ImageDimensions( 1, 1 ) );
+ Shader shader( GetImageShader(mFactoryCache) );
+ mImpl->mRenderer = Renderer::New( geometry, shader );
+ mImpl->mRenderer.SetTextures( textureSet );
+ if( atlasRect != FULL_TEXTURE_RECT )
{
- Geometry geometry = CreateGeometry( mFactoryCache, ImageDimensions( 1, 1 ) );
- Shader shader( GetImageShader(mFactoryCache) );
- mImpl->mRenderer = Renderer::New( geometry, shader );
- mImpl->mRenderer.SetTextures( textureSet );
mImpl->mRenderer.RegisterProperty( ATLAS_RECT_UNIFORM_NAME, atlasRect );
}
- else // big image, atlasing is not applied
- {
- mImpl->mRenderer = CreateRenderer();
-
- ResourceImage image = Dali::ResourceImage::New( imageUrl, mDesiredSize, mFittingMode, mSamplingMode );
- image.LoadingFinishedSignal().Connect( this, &ImageRenderer::OnImageLoaded );
- TextureSet textureSet = mImpl->mRenderer.GetTextures();
- textureSet.SetImage( 0u, image );
- }
-
mFactoryCache.SaveRenderer( imageUrl, mImpl->mRenderer );
}
mImpl->mFlags &= ~Impl::IS_FROM_CACHE;
mImpl->mRenderer = CreateRenderer();
- ResourceImage resourceImage = Dali::ResourceImage::New( imageUrl, mDesiredSize, mFittingMode, mSamplingMode );
- resourceImage.LoadingFinishedSignal().Connect( this, &ImageRenderer::OnImageLoaded );
- ApplyImageToSampler( resourceImage );
+ Image image = LoadImage( imageUrl, IsSynchronousResourceLoading() );
+ ApplyImageToSampler( image );
}
}
{
map.Clear();
map.Insert( RENDERER_TYPE, IMAGE_RENDERER );
+
+ bool sync = IsSynchronousResourceLoading();
+ map.Insert( SYNCHRONOUS_LOADING, sync );
if( !mImageUrl.empty() )
{
map.Insert( IMAGE_URL_NAME, mImageUrl );
mSamplingMode = samplingMode;
mImage.Reset();
+ if( IsSynchronousResourceLoading() )
+ {
+ DoSynchronousResourceLoading();
+ }
+
if( mImpl->mRenderer )
{
if( GetIsFromCache() ) // if renderer is from cache, remove the old one
}
else // if renderer is not from cache, reuse the same renderer and only change the texture
{
- ResourceImage image = Dali::ResourceImage::New( imageUrl, mDesiredSize, mFittingMode, mSamplingMode );
- image.LoadingFinishedSignal().Connect( this, &ImageRenderer::OnImageLoaded );
+ Image image = LoadImage( imageUrl, IsSynchronousResourceLoading() );
ApplyImageToSampler( image );
}
}
if( image )
{
TextureSet textureSet = mImpl->mRenderer.GetTextures();
- if( textureSet )
+ if( !textureSet )
{
- textureSet.SetImage( 0u, image );
+ textureSet = TextureSet::New();
+ mImpl->mRenderer.SetTextures( textureSet );
}
+ textureSet.SetImage( 0u, image );
}
}
{
mNativeFragmentShaderCode.replace( mNativeFragmentShaderCode.find( DEFAULT_SAMPLER_TYPENAME ), strlen( DEFAULT_SAMPLER_TYPENAME ), customSamplerTypename );
}
-
}
} // namespace Internal
*
* The following properties are optional
*
- * | %Property Name | Type |
- * |-------------------------|------------------|
+ * | %Property Name | Type |
+ * |--------------------|------------------|
* | url | STRING |
* | fittingMode | STRING |
* | samplingMode | STRING |
* | desiredWidth | INT |
* | desiredHeight | INT |
+ * | synchronousLoading | BOOLEAN |
*
* where imageFittingMode should be one of the following fitting modes:
* "SHRINK_TO_FIT"
* The renderer will load the Image asynchronously when the associated actor is put on stage, and destroy the image when it is off stage
*
* @param[in] actor The Actor the renderer is applied to if, empty if the renderer has not been applied to any Actor
- * @param[in] imageUrl The URL to to image resource to use
+ * @param[in] imageUrl The URL of the image resource to use
* @param[in] size The width and height to fit the loaded image to.
* @param[in] fittingMode The FittingMode of the resource to load
* @param[in] samplingMode The SamplingMode of the resource to load
Renderer CreateNativeImageRenderer() const;
/**
+ * @brief Query whether resources requires to be loaded synchronously.
+ * @return Returns true if synchronoud resource loading is required, false otherwise.
+ */
+ bool IsSynchronousResourceLoading() const;
+
+ /**
+ * @brief Do the synchronous resource loading
+ */
+ void DoSynchronousResourceLoading();
+
+ /**
+ * Load the image.
+ * @param[in] url The URL of the image resource to use.
+ * @param[in] synchronousLoading If true, the resource is loaded synchronously, otherwise asynchronously.
+ */
+ Image LoadImage( const std::string& url, bool synchronousLoading );
+
+ /**
+ * Load the image and create a texture set to hold the texture, with automatic atlasing applied.
+ * @param [out] textureRect The texture area of the resource image in the atlas.
+ * @param[in] url The URL of the image resource to use.
+ * @param[in] synchronousLoading If true, the resource is loaded synchronously, otherwise asynchronously.
+ */
+ TextureSet CreateTextureSet( Vector4& textureRect, const std::string& url, bool synchronousLoading );
+
+ /**
* Callback function of image resource loading succeed
* @param[in] image The Image content that we attempted to load from mImageUrl
*/
private:
Image mImage;
ImageAtlasManager& mAtlasManager;
+ PixelDataPtr mPixels;
std::string mImageUrl;
Dali::ImageDimensions mDesiredSize;
*/
// CLASS HEADER
-#include "renderer-factory-impl.h"
+#include <dali-toolkit/internal/controls/renderers/renderer-factory-impl.h>
// EXTERNAL INCLUDES
#include <dali/integration-api/debug.h>
#include <dali/public-api/images/image.h>
#include <dali/public-api/object/property-array.h>
#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
-// Internal HEADER
+// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/renderers/border/border-renderer.h>
#include <dali-toolkit/internal/controls/renderers/color/color-renderer.h>
#include <dali-toolkit/internal/controls/renderers/debug/debug-renderer.h>
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <dali/public-api/images/resource-image.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/object/property-array.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/integration-api/debug.h>
-
// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.h>
#include <dali-toolkit/public-api/controls/image-view/image-view.h>
{
const char* DEFAULT_INDICATOR_IMAGE_PATH = DALI_IMAGE_DIR "popup_scroll.9.png";
-const float MINIMUM_INDICATOR_HEIGHT(20.0f); // The minimum indicator height for the nine patch border
const float DEFAULT_SLIDER_DEPTH(1.0f);
const float DEFAULT_INDICATOR_SHOW_DURATION(0.5f);
const float DEFAULT_INDICATOR_HIDE_DURATION(0.5f);
const float DEFAULT_PAN_GESTURE_PROCESS_TIME(16.7f); // 16.7 milliseconds, i.e. one frame
const float DEFAULT_INDICATOR_FIXED_HEIGHT(80.0f);
+const float DEFAULT_INDICATOR_MINIMUM_HEIGHT(0.0f);
+const float DEFAULT_INDICATOR_START_PADDING(0.0f);
+const float DEFAULT_INDICATOR_END_PADDING(0.0f);
/**
* Indicator size constraint
*/
struct IndicatorSizeConstraint
{
- IndicatorSizeConstraint()
+ /**
+ * @param[in] minimumHeight The minimum height for the indicator
+ * @param[in] padding The sum of the padding at the start & end of the indicator
+ */
+ IndicatorSizeConstraint( float minimumHeight, float padding )
+ : mMinimumHeight( minimumHeight ),
+ mPadding( padding )
{
}
* @param[in] parentSizeProperty The parent size of scroll indicator.
* @return The new scroll indicator size.
*/
- void operator()(Vector3& current, const PropertyInputContainer& inputs )
+ void operator()( Vector3& current, const PropertyInputContainer& inputs )
{
const Vector3& parentSize = inputs[0]->GetVector3();
const float contentSize = inputs[1]->GetFloat();
- float height = contentSize > parentSize.height ?
- parentSize.height * ( parentSize.height / contentSize ) :
- parentSize.height * ( (parentSize.height - contentSize * 0.5f) / parentSize.height);
+ // Take into account padding that may exist at the beginning and end of the indicator.
+ const float parentHeightMinusPadding = parentSize.height - mPadding;
- current.y = std::max(MINIMUM_INDICATOR_HEIGHT, height);
+ float height = contentSize > parentHeightMinusPadding ?
+ parentHeightMinusPadding * ( parentHeightMinusPadding / contentSize ) :
+ parentHeightMinusPadding * ( ( parentHeightMinusPadding - contentSize * 0.5f ) / parentHeightMinusPadding );
+
+ current.y = std::max( mMinimumHeight, height );
}
+
+ float mMinimumHeight;
+ float mPadding;
};
/**
struct IndicatorPositionConstraint
{
/**
- * @param[in] minPosition The minimum limit of scroll position
- * @param[in] maxPosition the maximum limit of scroll position
+ * @param[in] startPadding The padding at the start of the indicator
+ * @param[in] endPadding The padding at the end of the indicator
*/
- IndicatorPositionConstraint()
+ IndicatorPositionConstraint( float startPadding, float endPadding )
+ : mStartPadding( startPadding ),
+ mEndPadding( endPadding )
{
}
const Vector3& indicatorSize = inputs[0]->GetVector3();
const Vector3& parentSize = inputs[1]->GetVector3();
const float scrollPosition = -inputs[2]->GetFloat();
- const float minScrollPosition = inputs[3]->GetFloat();
- const float maxScrollPosition = inputs[4]->GetFloat();
+ const float minimumScrollPosition = inputs[3]->GetFloat();
+ const float maximumScrollPosition = inputs[4]->GetFloat();
- float relativePosition = std::max( 0.0f, std::min( 1.0f, (scrollPosition - minScrollPosition) / (maxScrollPosition - minScrollPosition) ) );
- current.y = ( parentSize.height - indicatorSize.height ) * relativePosition;
+ // Take into account padding that may exist at the beginning and end of the indicator.
+ const float parentHeightMinusPadding = parentSize.height - ( mStartPadding + mEndPadding );
+
+ float relativePosition = std::max( 0.0f, std::min( 1.0f, ( scrollPosition - minimumScrollPosition ) / ( maximumScrollPosition - minimumScrollPosition ) ) );
+ current.y = mStartPadding + ( parentHeightMinusPadding - indicatorSize.height ) * relativePosition;
current.z = DEFAULT_SLIDER_DEPTH;
}
+
+ float mStartPadding;
+ float mEndPadding;
};
} // unnamed namespace
DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorShowDuration", FLOAT, INDICATOR_SHOW_DURATION )
DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorHideDuration", FLOAT, INDICATOR_HIDE_DURATION )
DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "scrollPositionIntervals", ARRAY, SCROLL_POSITION_INTERVALS )
+DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorMinimumHeight", FLOAT, INDICATOR_MINIMUM_HEIGHT )
+DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorStartPadding", FLOAT, INDICATOR_START_PADDING )
+DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorEndPadding", FLOAT, INDICATOR_END_PADDING )
DALI_SIGNAL_REGISTRATION( Toolkit, ScrollBar, "panFinished", PAN_FINISHED_SIGNAL )
DALI_SIGNAL_REGISTRATION( Toolkit, ScrollBar, "scrollPositionIntervalReached", SCROLL_POSITION_INTERVAL_REACHED_SIGNAL )
mCurrentScrollPosition(0.0f),
mIndicatorHeightPolicy(Toolkit::ScrollBar::Variable),
mIndicatorFixedHeight(DEFAULT_INDICATOR_FIXED_HEIGHT),
+ mIndicatorMinimumHeight(DEFAULT_INDICATOR_MINIMUM_HEIGHT),
+ mIndicatorStartPadding(DEFAULT_INDICATOR_START_PADDING),
+ mIndicatorEndPadding(DEFAULT_INDICATOR_END_PADDING),
mIsPanning(false),
mIndicatorFirstShow(true)
{
}
else
{
- mIndicatorSizeConstraint = Constraint::New<Vector3>( mIndicator, Actor::Property::SIZE, IndicatorSizeConstraint() );
+ mIndicatorSizeConstraint = Constraint::New<Vector3>( mIndicator, Actor::Property::SIZE,
+ IndicatorSizeConstraint( mIndicatorMinimumHeight, mIndicatorStartPadding + mIndicatorEndPadding ) );
mIndicatorSizeConstraint.AddSource( ParentSource( Actor::Property::SIZE ) );
mIndicatorSizeConstraint.AddSource( Source( scrollableHandle, mPropertyScrollContentSize ) );
mIndicatorSizeConstraint.Apply();
mIndicatorPositionConstraint.Remove();
}
- mIndicatorPositionConstraint = Constraint::New<Vector3>( mIndicator, Actor::Property::POSITION, IndicatorPositionConstraint() );
+ mIndicatorPositionConstraint = Constraint::New<Vector3>( mIndicator, Actor::Property::POSITION,
+ IndicatorPositionConstraint( mIndicatorStartPadding, mIndicatorEndPadding ) );
mIndicatorPositionConstraint.AddSource( LocalSource( Actor::Property::SIZE ) );
mIndicatorPositionConstraint.AddSource( ParentSource( Actor::Property::SIZE ) );
mIndicatorPositionConstraint.AddSource( Source( scrollableHandle, mPropertyScrollPosition ) );
}
case Gesture::Continuing:
{
- Vector3 delta(gesture.displacement.x, gesture.displacement.y, 0.0f);
- mGestureDisplacement+=delta;
+ mGestureDisplacement.x += gesture.displacement.x;
+ mGestureDisplacement.y += gesture.displacement.y;
- Vector3 span = Self().GetCurrentSize() - mIndicator.GetCurrentSize();
- float minScrollPosition = scrollableHandle.GetProperty<float>(mPropertyMinScrollPosition);
- float maxScrollPosition = scrollableHandle.GetProperty<float>(mPropertyMaxScrollPosition);
+ float minScrollPosition = scrollableHandle.GetProperty<float>( mPropertyMinScrollPosition );
+ float maxScrollPosition = scrollableHandle.GetProperty<float>( mPropertyMaxScrollPosition );
+
+ // The domain size is the internal range
float domainSize = maxScrollPosition - minScrollPosition;
+ float logicalSize = Self().GetCurrentSize().y - ( mIndicator.GetCurrentSize().y + mIndicatorStartPadding + mIndicatorEndPadding );
- mCurrentScrollPosition = mScrollStart - mGestureDisplacement.y * domainSize / span.y;
- mCurrentScrollPosition = 0.0f - std::min(maxScrollPosition, std::max(-mCurrentScrollPosition, minScrollPosition));
+ mCurrentScrollPosition = mScrollStart - ( ( mGestureDisplacement.y * domainSize ) / logicalSize );
+ mCurrentScrollPosition = -std::min( maxScrollPosition, std::max( -mCurrentScrollPosition, minScrollPosition ) );
break;
}
void ScrollBar::SetIndicatorHeightPolicy( Toolkit::ScrollBar::IndicatorHeightPolicy policy )
{
- mIndicatorHeightPolicy = policy;
- ApplyConstraints();
+ if( policy != mIndicatorHeightPolicy )
+ {
+ mIndicatorHeightPolicy = policy;
+ ApplyConstraints();
+ }
}
Toolkit::ScrollBar::IndicatorHeightPolicy ScrollBar::GetIndicatorHeightPolicy() const
}
break;
}
+ case Toolkit::ScrollBar::Property::INDICATOR_MINIMUM_HEIGHT:
+ {
+ scrollBarImpl.mIndicatorMinimumHeight = value.Get<float>();
+ scrollBarImpl.ApplyConstraints();
+ break;
+ }
+ case Toolkit::ScrollBar::Property::INDICATOR_START_PADDING:
+ {
+ scrollBarImpl.mIndicatorStartPadding = value.Get<float>();
+ scrollBarImpl.ApplyConstraints();
+ break;
+ }
+ case Toolkit::ScrollBar::Property::INDICATOR_END_PADDING:
+ {
+ scrollBarImpl.mIndicatorEndPadding = value.Get<float>();
+ scrollBarImpl.ApplyConstraints();
+ break;
+ }
}
}
}
}
break;
}
+ case Toolkit::ScrollBar::Property::INDICATOR_MINIMUM_HEIGHT:
+ {
+ value = scrollBarImpl.mIndicatorMinimumHeight;
+ break;
+ }
+ case Toolkit::ScrollBar::Property::INDICATOR_START_PADDING:
+ {
+ value = scrollBarImpl.mIndicatorStartPadding;
+ break;
+ }
+ case Toolkit::ScrollBar::Property::INDICATOR_END_PADDING:
+ {
+ value = scrollBarImpl.mIndicatorEndPadding;
+ break;
+ }
}
}
return value;
#define __DALI_TOOLKIT_INTERNAL_SCROLL_BAR_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Toolkit::ScrollBar::Direction mDirection; ///< The direction of scroll bar (vertical or horizontal)
- WeakHandleBase mScrollableObject; ///< Object to be scrolled
+ WeakHandleBase mScrollableObject; ///< Object to be scrolled
Property::Index mPropertyScrollPosition; ///< Index of scroll position property owned by the object to be scrolled
Property::Index mPropertyMinScrollPosition; ///< Index of minimum scroll position property owned by the object to be scrolled
Property::Index mPropertyMaxScrollPosition; ///< Index of maximum scroll position property owned by the object to be scrolled
Property::Index mPropertyScrollContentSize; ///< Index of scroll content size property owned by the object to be scrolled
- float mIndicatorShowDuration; ///< The duration of scroll indicator show animation
- float mIndicatorHideDuration; ///< The duration of scroll indicator hide animation
+ float mIndicatorShowDuration; ///< The duration of scroll indicator show animation
+ float mIndicatorHideDuration; ///< The duration of scroll indicator hide animation
float mScrollStart; ///< Scroll Start position (start of drag)
Vector3 mGestureDisplacement; ///< Gesture Displacement.
- float mCurrentScrollPosition; ///< The current scroll position updated by the pan gesture
+ float mCurrentScrollPosition; ///< The current scroll position updated by the pan gesture
Toolkit::ScrollBar::IndicatorHeightPolicy mIndicatorHeightPolicy; ///< The height policy of scroll indicator (variable or fixed)
- float mIndicatorFixedHeight; ///< The fixed height of scroll indicator
+ float mIndicatorFixedHeight; ///< The fixed height of scroll indicator
+ float mIndicatorMinimumHeight; ///< The minimum height for a variable size indicator
+ float mIndicatorStartPadding; ///< The padding at the start of the indicator
+ float mIndicatorEndPadding; ///< The padding at the end of the indicator
Timer mContractDelayTimer; ///< Timer guarantee contract delay time.
Timer mPanProcessTimer; ///< The timer to process the pan gesture after the gesture is started.
- Dali::Vector<float> mScrollPositionIntervals; ///< List of values to receive notification for when the current scroll position goes above or below them
+ Dali::Vector<float> mScrollPositionIntervals; ///< List of values to receive notification for when the current scroll position goes above or below them
PropertyNotification mPositionNotification; ///< Stores the property notification used for scroll position changes
PanFinishedSignalType mPanFinishedSignal;
Constraint mIndicatorSizeConstraint;
Constraint mScrollPositionInCurrentAxisConstraint;
- bool mIsPanning : 1; ///< Whether the scroll bar is being panned.
- bool mIndicatorFirstShow : 1; ///< True if the indicator has never been shown
+ bool mIsPanning : 1; ///< Whether the scroll bar is being panned.
+ bool mIndicatorFirstShow : 1; ///< True if the indicator has never been shown
};
} // namespace Internal
#include <dali/public-api/events/wheel-event.h>
#include <dali/public-api/events/touch-event.h>
#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h>
#include <dali/public-api/events/wheel-event.h>
#include <dali/public-api/events/touch-event.h>
#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
// EXTERNAL INCLUDES
#include <cstring> // for strcmp
#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/scrollable/scrollable-impl.h>
#include <dali/public-api/animation/constraint.h>
#include <dali/public-api/common/stage.h>
#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/public-api/render-tasks/render-task-list.h>
#include <dali/integration-api/debug.h>
#include <limits>
#include <dali/public-api/events/touch-event.h>
#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/public-api/images/resource-image.h>
// INTERNAL INCLUDES
#include <dali/public-api/common/stage.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/object/property-map.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/devel-api/rendering/renderer.h>
#include <dali/devel-api/scripting/scripting.h>
#include <dali/integration-api/debug.h>
#include <sstream>
#include <dali/public-api/object/ref-object.h>
#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/devel-api/scripting/scripting.h>
#include <dali/public-api/size-negotiation/relayout-container.h>
#include <dali/integration-api/debug.h>
namespace
{
-/*
- * Custom properties for where to put the actor.
- *
- * When an actor is add to the tableView through Actor::Add() instead of TableView::AddChild,
- * the following custom properties of the actor are checked to decide the actor position inside the table
- *
- * These non-animatable properties should be registered to the child which would be added to the table
- */
-const char * const CELL_INDEX_PROPERTY_NAME("cellIndex");
-const char * const ROW_SPAN_PROPERTY_NAME("rowSpan");
-const char * const COLUMN_SPAN_PROPERTY_NAME("columnSpan");
-const char * const CELL_HORIZONTAL_ALIGNMENT_PROPERTY_NAME("cellHorizontalAlignment");
-const char * const CELL_VERTICAL_ALIGNMENT_PROPERTY_NAME("cellVerticalAlignment");
-
/**
* @brief Should the tableview fit around the given actor
*
DALI_PROPERTY_REGISTRATION( Toolkit, TableView, "cellPadding", VECTOR2, CELL_PADDING )
DALI_PROPERTY_REGISTRATION( Toolkit, TableView, "layoutRows", MAP, LAYOUT_ROWS )
DALI_PROPERTY_REGISTRATION( Toolkit, TableView, "layoutColumns", MAP, LAYOUT_COLUMNS )
+DALI_CHILD_PROPERTY_REGISTRATION( Toolkit, TableView, "cellIndex", VECTOR2, CELL_INDEX )
+DALI_CHILD_PROPERTY_REGISTRATION( Toolkit, TableView, "rowSpan", FLOAT, ROW_SPAN )
+DALI_CHILD_PROPERTY_REGISTRATION( Toolkit, TableView, "columnSpan", FLOAT, COLUMN_SPAN )
+DALI_CHILD_PROPERTY_REGISTRATION( Toolkit, TableView, "cellHorizontalAlignment", STRING, CELL_HORIZONTAL_ALIGNMENT )
+DALI_CHILD_PROPERTY_REGISTRATION( Toolkit, TableView, "cellVerticalAlignment", STRING, CELL_VERTICAL_ALIGNMENT )
DALI_TYPE_REGISTRATION_END()
return;
}
- // Test properties on actor
+ // Check child properties on actor to decide its position inside the table
HorizontalAlignment::Type horizontalAlignment = HorizontalAlignment::LEFT;
VerticalAlignment::Type verticalAlignment = VerticalAlignment::TOP;
- if( child.GetPropertyIndex( CELL_HORIZONTAL_ALIGNMENT_PROPERTY_NAME ) != Property::INVALID_INDEX )
+
+ if( child.GetPropertyType( Toolkit::TableView::ChildProperty::CELL_HORIZONTAL_ALIGNMENT ) != Property::NONE )
{
- std::string value = child.GetProperty( child.GetPropertyIndex(CELL_HORIZONTAL_ALIGNMENT_PROPERTY_NAME) ).Get<std::string >();
+ std::string value = child.GetProperty( Toolkit::TableView::ChildProperty::CELL_HORIZONTAL_ALIGNMENT ).Get<std::string >();
Scripting::GetEnumeration< HorizontalAlignment::Type >( value.c_str(),
HORIZONTAL_ALIGNMENT_STRING_TABLE,
HORIZONTAL_ALIGNMENT_STRING_TABLE_COUNT,
horizontalAlignment );
}
- if( child.GetPropertyIndex( CELL_VERTICAL_ALIGNMENT_PROPERTY_NAME ) != Property::INVALID_INDEX )
+
+ if( child.GetPropertyType( Toolkit::TableView::ChildProperty::CELL_VERTICAL_ALIGNMENT ) != Property::NONE )
{
- std::string value = child.GetProperty( child.GetPropertyIndex(CELL_VERTICAL_ALIGNMENT_PROPERTY_NAME) ).Get<std::string >();
+ std::string value = child.GetProperty( Toolkit::TableView::ChildProperty::CELL_VERTICAL_ALIGNMENT ).Get<std::string >();
Scripting::GetEnumeration< VerticalAlignment::Type >( value.c_str(),
VERTICAL_ALIGNMENT_STRING_TABLE,
VERTICAL_ALIGNMENT_STRING_TABLE_COUNT,
verticalAlignment );
}
-
Toolkit::TableView::CellPosition cellPosition;
- if( child.GetPropertyIndex(ROW_SPAN_PROPERTY_NAME) != Property::INVALID_INDEX )
+ if( child.GetPropertyType( Toolkit::TableView::ChildProperty::ROW_SPAN ) != Property::NONE )
{
- cellPosition.rowSpan = static_cast<unsigned int>( child.GetProperty( child.GetPropertyIndex(ROW_SPAN_PROPERTY_NAME) ).Get<float>() );
+ cellPosition.rowSpan = static_cast<unsigned int>( child.GetProperty( Toolkit::TableView::ChildProperty::ROW_SPAN ).Get<float>() );
}
- if( child.GetPropertyIndex(COLUMN_SPAN_PROPERTY_NAME) != Property::INVALID_INDEX )
+ if( child.GetPropertyType( Toolkit::TableView::ChildProperty::COLUMN_SPAN ) != Property::NONE )
{
- cellPosition.columnSpan = static_cast<unsigned int>( child.GetProperty( child.GetPropertyIndex(COLUMN_SPAN_PROPERTY_NAME) ).Get<float>() );
+ cellPosition.columnSpan = static_cast<unsigned int>( child.GetProperty( Toolkit::TableView::ChildProperty::COLUMN_SPAN ).Get<float>() );
}
- if( child.GetPropertyIndex(CELL_INDEX_PROPERTY_NAME) != Property::INVALID_INDEX )
+ if( child.GetPropertyType( Toolkit::TableView::ChildProperty::CELL_INDEX ) != Property::NONE )
{
- Vector2 indices = child.GetProperty( child.GetPropertyIndex(CELL_INDEX_PROPERTY_NAME) ).Get<Vector2 >();
+ Vector2 indices = child.GetProperty( Toolkit::TableView::ChildProperty::CELL_INDEX ).Get<Vector2 >();
cellPosition.rowIndex = static_cast<unsigned int>( indices.x );
cellPosition.columnIndex = static_cast<unsigned int>( indices.y );
#include <dali/public-api/common/stage.h>
#include <dali/public-api/images/resource-image.h>
#include <dali/devel-api/adaptor-framework/virtual-keyboard.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
#include <dali/public-api/common/stage.h>
#include <dali/public-api/images/resource-image.h>
#include <dali/devel-api/adaptor-framework/virtual-keyboard.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/text-controls/text-label-impl.h>
// EXTERNAL INCLUDES
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
#include <dali/public-api/math/vector2.h>
#include <dali/public-api/math/vector4.h>
#include <dali/public-api/object/property-map.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
#include <dali/public-api/math/vector2.h>
#include <dali/public-api/math/vector4.h>
#include <dali/public-api/object/property-map.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/image-view/image-view.h>
// EXTERNAL INCLUDES
#include <dali/public-api/animation/constraints.h>
#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/alignment/alignment.h>
#include <dali/public-api/common/stage.h>
#include <dali/public-api/events/key-event.h>
#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/public-api/images/resource-image.h>
#include <dali/integration-api/debug.h>
// EXTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/singleton-service.h>
#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
// EXTERNAL INCLUDES
#include <cstring> // for strcmp
#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h>
#include <dali/integration-api/debug.h>
#include <dali/public-api/animation/constraints.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/size-negotiation/relayout-container.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/devel-api/rendering/renderer.h>
#include <dali/devel-api/scripting/scripting.h>
#include <dali/integration-api/debug.h>
*/
PRE_MULTIPLIED_ALPHA,
+
// Animatable properties
/**
* @brief name "pixelArea", type Vector4
* @details Pixel area is a relative value with the whole image area as [0.0, 0.0, 1.0, 1.0].
- * @SINCE_1_0.18
+ * @SINCE_1_1.18
*/
PIXEL_AREA = ANIMATABLE_PROPERTY_START_INDEX,
};
#define __DALI_TOOLKIT_SCROLL_BAR_H__
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
enum
{
- SCROLL_DIRECTION = PROPERTY_START_INDEX, ///< name "scrollDirection", @see SetScrollDirection(), type std::string @SINCE_1_0.0
- INDICATOR_HEIGHT_POLICY, ///< name "indicatorHeightPolicy", @see SetIndicatorHeightPolicy(), type std::string @SINCE_1_0.0
- INDICATOR_FIXED_HEIGHT, ///< name "indicatorFixedHeight", @see SetIndicatorFixedHeight(), type float @SINCE_1_0.0
- INDICATOR_SHOW_DURATION, ///< name "indicatorShowDuration", @see SetIndicatorShowDuration(), type float @SINCE_1_0.0
- INDICATOR_HIDE_DURATION, ///< name "indicatorHideDuration", @see SetIndicatorHideDuration(), type float @SINCE_1_0.0
- SCROLL_POSITION_INTERVALS ///< name "scrollPositionIntervals", @see SetScrollPositionIntervals() type Property::Array @SINCE_1_0.0
+ /**
+ * @brief name "scrollDirection", type std::string
+ * @see SetScrollDirection()
+ * @SINCE_1_0.0
+ */
+ SCROLL_DIRECTION = PROPERTY_START_INDEX,
+ /**
+ * @brief name "indicatorHeightPolicy", type std::string
+ * @see SetIndicatorHeightPolicy()
+ * @SINCE_1_0.0
+ */
+ INDICATOR_HEIGHT_POLICY,
+ /**
+ * @brief name "indicatorFixedHeight", type float
+ * @see SetIndicatorFixedHeight()
+ * @SINCE_1_0.0
+ */
+ INDICATOR_FIXED_HEIGHT,
+ /**
+ * @brief name "indicatorShowDuration", type float
+ * @see SetIndicatorShowDuration()
+ * @SINCE_1_0.0
+ */
+ INDICATOR_SHOW_DURATION,
+ /**
+ * @brief name "indicatorHideDuration", type float
+ * @see SetIndicatorHideDuration()
+ * @SINCE_1_0.0
+ */
+ INDICATOR_HIDE_DURATION,
+ /**
+ * @brief name "scrollPositionIntervals", type Property::Array
+ * @see SetScrollPositionIntervals()
+ * @SINCE_1_0.0
+ */
+ SCROLL_POSITION_INTERVALS,
+ /**
+ * @brief name "indicatorMinimumHeight", type float
+ * The minimum height for a variable size indicator.
+ * @SINCE_1_1.36
+ */
+ INDICATOR_MINIMUM_HEIGHT,
+ /**
+ * @brief name "indicatorStartPadding", type float
+ * The padding at the start of the indicator. For example, the top if scrollDirection is Vertical.
+ * @SINCE_1_1.36
+ */
+ INDICATOR_START_PADDING,
+ /**
+ * @brief name "indicatorEndPadding", type float
+ * The padding at the end of the indicator. For example, the bottom if scrollDirection is Vertical.
+ * @SINCE_1_1.36
+ */
+ INDICATOR_END_PADDING
};
};
enum PropertyRange
{
PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1, ///< @SINCE_1_0.0
- PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserve property indices @SINCE_1_0.0
+ PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000, ///< Reserve property indices @SINCE_1_0.0
+
+ CHILD_PROPERTY_START_INDEX = CHILD_PROPERTY_REGISTRATION_START_INDEX, ///< @SINCE_1_1.36
+ CHILD_PROPERTY_END_INDEX = CHILD_PROPERTY_REGISTRATION_START_INDEX + 1000 ///< Reserve child property indices @SINCE_1_1.36
};
/**
};
/**
+ * @brief An enumeration of child properties belonging to the TableView class.
+ * @SINCE_1_1.36
+ */
+ struct ChildProperty
+ {
+ enum
+ {
+ CELL_INDEX = CHILD_PROPERTY_START_INDEX, ///< name "cellIndex", The top-left cell this child occupies, if not set, the first available cell is used, type VECTOR2 @SINCE_1_1.36
+ ROW_SPAN, ///< name "rowSpan", The number of rows this child occupies, if not set, default value is 1, type FLOAT @SINCE_1_1.36
+ COLUMN_SPAN, ///< name "columnSpan", The number of columns this child occupies, if not set, default value is 1, type FLOAT @SINCE_1_1.36
+ CELL_HORIZONTAL_ALIGNMENT, ///< name "cellHorizontalAlignment", The horizontal alignment of this child inside the cells, if not set, default value is 'left', type STRING @SINCE_1_1.36
+ CELL_VERTICAL_ALIGNMENT ///< name "cellVerticalAlignment", The vertical alignment of this child inside the cells, if not set, default value is 'top', type STRING @SINCE_1_1.36
+ };
+ };
+
+ /**
* @brief Describes how the size of a row / column been set
* @SINCE_1_0.0
*/
const unsigned int TOOLKIT_MAJOR_VERSION = 1;
const unsigned int TOOLKIT_MINOR_VERSION = 1;
-const unsigned int TOOLKIT_MICRO_VERSION = 35;
+const unsigned int TOOLKIT_MICRO_VERSION = 36;
const char * const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
+ [Relative To Constraint](@ref constraints-relative-to)
+ [Multi-threading Notes](@ref animation-multi-threading-notes)
+ [Shader Animation](@ref animation-shader)
- + [Styling](@ref styling)
+ + [Styling](@ref styling)
### Resources
+ [Resource Image](@ref resource-image)
- The parameter to DALI_PROPERTY_TABLE_END should match the start index of the property enumeration.
<br>
-<h2 class="pg">How to implement a property within Dali-toolkit:</h2>
+<h2 class="pg">How to implement a property within Dali-toolkit controls and application-side custom controls:</h2>
Macros are used to define properties for the following reasons:
Source file: <b>image-view-impl.cpp</b>, within an unnamed namespace:
+@code
+#include <dali/public-api/object/type-registry-helper.h>
+@endcode
+
@clip{"image-view-impl.cpp",DALI_TYPE_REGISTRATION_BEGIN,DALI_TYPE_REGISTRATION_END}
<b>Notes:</b>
- Properties should be in the same order as in the enum.
- Signals and actions are registered likewise in that order.
- Properties type-registered using these macros will have their order checked at compile time. If you get an indexing compile error, check the order matches the enum order.
+ The error will look like this: " error: invalid application of 'sizeof' to incomplete type 'Dali::CompileTimeAssertBool<false>' "
+- If using the Pimpl design pattern when creating a custom control from within an application, the Handle (public) and Object (internal) classes should have the same name. They can be separated by different namespaces.
+ This requirement is actually due to how the type-registry in DALi looks up properties.
<br>
<hr>
|:----------------------|:--------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------:|:----------------------------------------------------------------------------------------------------------------------------------:|
| Default | Properties defined within DALi Core, e.g. Dali::Actor, Dali::ShaderEffect default properties etc. | \link Dali::DEFAULT_OBJECT_PROPERTY_START_INDEX DEFAULT_OBJECT_PROPERTY_START_INDEX\endlink | \link Dali::DEFAULT_PROPERTY_MAX_COUNT DEFAULT_PROPERTY_MAX_COUNT\endlink (9999999) |
| Registered | Properties registered using Dali::PropertyRegistration | \link Dali::PROPERTY_REGISTRATION_START_INDEX PROPERTY_REGISTRATION_START_INDEX\endlink (10000000) | \link Dali::PROPERTY_REGISTRATION_MAX_INDEX PROPERTY_REGISTRATION_MAX_INDEX\endlink (19999999) |
-| Registered Animatable | Animatable properties registered using Dali::PropertyRegistration | \link Dali::ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX\endlink (20000000) | \link Dali::ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX\endlink (29999999) |
+| Registered Animatable | Animatable properties registered using Dali::AnimatablePropertyRegistration | \link Dali::ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX\endlink (20000000) | \link Dali::ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX\endlink (29999999) |
+| Registered Child | Child properties (which parent supports in its children) registered using Dali::ChildPropertyRegistration | \link Dali::ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX\endlink (20000000) | \link Dali::CHILD_PROPERTY_REGISTRATION_MAX_INDEX CHILD_PROPERTY_REGISTRATION_MAX_INDEX\endlink (49999999) |
| Control | Property range reserved by Dali::Toolkit::Control | \link Dali::Toolkit::Control::CONTROL_PROPERTY_START_INDEX CONTROL_PROPERTY_START_INDEX\endlink (10000000) | \link Dali::Toolkit::Control::CONTROL_PROPERTY_END_INDEX CONTROL_PROPERTY_END_INDEX\endlink (10001000) |
| Derived Control | Property range for control deriving directly from Dali::Toolkit::Control | 10001001 | \link Dali::PROPERTY_REGISTRATION_MAX_INDEX PROPERTY_REGISTRATION_MAX_INDEX\endlink (19999999) |
| Custom | Custom properties added to instance using Dali::Handle::RegisterProperty | \link Dali::PROPERTY_CUSTOM_START_INDEX PROPERTY_CUSTOM_START_INDEX\endlink (50000000) | Onwards... |
// Create flex items and set the proportion
var item1 = new dali.Control();
-item1.registerCustomProperty("flex", 1.0, dali.PROPERTY_READ_WRITE);
+item1.flex = 1.0;
flexContainer.add(item1);
var item2 = new dali.Control();
-item2.registerCustomProperty("flex", 3.0, dali.PROPERTY_READ_WRITE);
+item2.flex = 3.0;
flexContainer.add(item2);
var item3 = new dali.Control();
-item3.registerCustomProperty("flex", 1.0, dali.PROPERTY_READ_WRITE);
+item3.flex = 1.0;
flexContainer.add(item3);
var item4 = new dali.Control();
-item4.registerCustomProperty("flex", 2.0, dali.PROPERTY_READ_WRITE);
+item4.flex = 2.0;
flexContainer.add(item4);
var item5 = new dali.Control();
-item5.registerCustomProperty("flex", 1.0, dali.PROPERTY_READ_WRITE);
+item5.flex = 1.0;
flexContainer.add(item5);
~~~
// Create flex items and add them to the flex container
var item1 = new dali.Control();
-item1.registerCustomProperty("alignSelf", "center", dali.PROPERTY_READ_WRITE); // Align item1 at the center of the container
+item1.alignSelf = "center"; // Align item1 at the center of the container
flexContainer.add(item1);
var item2 = new dali.Control();
flexContainer.add(item2); // item2 is aligned at the beginning of ther container
var item3 = new dali.Control();
-item1.registerCustomProperty("alignSelf", "flexEnd", dali.PROPERTY_READ_WRITE); // Align item3 at the bottom of the container
+item1.alignSelf = "flexEnd"; // Align item3 at the bottom of the container
flexContainer.add(item3);
var item4 = new dali.Control();
var item = new dali.Control();
// Add the margin around the item
-item.registerCustomProperty("flexMargin", [10.0, 10.0, 10.0, 10.0], dali.PROPERTY_READ_WRITE);
+item.flexMargin = [10.0, 10.0, 10.0, 10.0];
// Add the item to the container
flexContainer.add(item);
toolBar.flexDirection = "row"; // display toolbar items horizontally
toolBar.alignItems = "center"; // align toolbar items vertically center
-toolBar.registerCustomProperty("flex", 0.1, dali.PROPERTY_READ_WRITE); // 10 percent of available space in the cross axis
+toolBar.flex = 0.1; // 10 percent of available space in the cross axis
~~~
Then we create another flex container as the content area to display the image, and it will be displayed in the bottom of the main container.
content.flexDirection = "row";
content.alignItems = "center"; // align items vertically center
content.justifyContent = "center"; // align items horizontally center
-content.registerCustomProperty("flex", 0.9, dali.PROPERTY_READ_WRITE); // 90 percent of available space in the cross axis
+content.flex = 0.9; // 90 percent of available space in the cross axis
// Add it to the main container
flexContainer.add(content);
prevButton.anchorPoint = dali.TOP_LEFT;
prevButton.minimumSize = [100.0, 60.0]; // this is the minimum size the button should keep
prevButton.labelText = "Prev";
-prevButton.registerCustomProperty("flexMargin", [10, 10, 10, 10], dali.PROPERTY_READ_WRITE); // set 10 pixel margin around the button
+prevButton.flexMargin = [10, 10, 10, 10]; // set 10 pixel margin around the button
toolBar.add( prevButton );
title.horizontalAlignment = "CENTER";
title.verticalAlignment = "CENTER";
title.text = "Gallery";
-title.registerCustomProperty("flex", 1.0, dali.PROPERTY_READ_WRITE); // take all the available space left apart from the two buttons
-title.registerCustomProperty("flexMargin", [10, 10, 10, 10], dali.PROPERTY_READ_WRITE); // set 10 pixel margin around the title
+title.flex = 1.0; // take all the available space left apart from the two buttons
+title.flexMargin = [10, 10, 10, 10]; // set 10 pixel margin around the title
toolBar.add( title );
nextButton.anchorPoint = dali.TOP_LEFT;
nextButton.minimumSize = [100.0, 60.0]; // this is the minimum size the button should keep
nextButton.labelText = "Next";
-nextButton.registerCustomProperty("flexMargin", [10, 10, 10, 10], dali.PROPERTY_READ_WRITE); // set 10 pixel margin around the button
+nextButton.flexMargin = [10, 10, 10, 10]; // set 10 pixel margin around the button
toolBar.add( nextButton );
~~~
toolBar.backgroundColor = dali.COLOR_CYAN;
toolBar.flexDirection = "row"; // display toolbar items horizontally
toolBar.alignItems = "center"; // align toolbar items vertically center
- toolBar.registerCustomProperty("flex", 0.1, dali.PROPERTY_READ_WRITE); // 10 percent of available space in the cross axis
+ toolBar.flex = 0.1; // 10 percent of available space in the cross axis
flexContainer.add(toolBar);
content.flexDirection = "row";
content.alignItems = "center"; // align items vertically center
content.justifyContent = "center"; // align items horizontally center
- content.registerCustomProperty("flex", 0.9, dali.PROPERTY_READ_WRITE); // 90 percent of available space in the cross axis
+ content.flex = 0.9; // 90 percent of available space in the cross axis
flexContainer.add(content);
prevButton.anchorPoint = dali.TOP_LEFT;
prevButton.minimumSize = [100.0, 60.0]; // this is the minimum size the button should keep
prevButton.labelText = "Prev";
- prevButton.registerCustomProperty("flexMargin", [10, 10, 10, 10], dali.PROPERTY_READ_WRITE); // set 10 pixel margin around the button
+ prevButton.flexMargin = [10, 10, 10, 10]; // set 10 pixel margin around the button
toolBar.add( prevButton );
title.verticalAlignment = "CENTER";
title.text = "Gallery";
title.pointSize = 28;
- title.registerCustomProperty("flex", 1.0, dali.PROPERTY_READ_WRITE); // take all the available space left apart from the two buttons
- title.registerCustomProperty("flexMargin", [10, 10, 10, 10], dali.PROPERTY_READ_WRITE); // set 10 pixel margin around the title
+ title.flex = 1.0; // take all the available space left apart from the two buttons
+ title.flexMargin = [10, 10, 10, 10]; // set 10 pixel margin around the title
toolBar.add( title );
nextButton.anchorPoint = dali.TOP_LEFT;
nextButton.minimumSize = [100.0, 60.0]; // this is the minimum size the button should keep
nextButton.labelText = "Next";
- nextButton.registerCustomProperty("flexMargin", [10, 10, 10, 10], dali.PROPERTY_READ_WRITE); // set 10 pixel margin around the button
+ nextButton.flexMargin = [10, 10, 10, 10]; // set 10 pixel margin around the button
toolBar.add( nextButton );
Name: dali-toolkit
Summary: The OpenGLES Canvas Core Library Toolkit
-Version: 1.1.35
+Version: 1.1.36
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-2-Clause and MIT
autoreconf --install
DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
DALI_DATA_RO_DIR="%{dali_data_ro_dir}" ; export DALI_DATA_RO_DIR
-%configure --enable-profile=%{dali_toolkit_profile} --with-style=%{dali_style_folder} --enable-i18n=yes
+
+%configure --enable-profile=%{dali_toolkit_profile} \
+ --with-style=%{dali_style_folder} \
+%if 0%{?enable_debug}
+ --enable-debug \
+%endif
+ --enable-i18n=yes
+
make %{?jobs:-j%jobs}
##############################