// Button::PROPERTY_AUTO_REPEATING
button.SetAutoRepeating( false );
- DALI_TEST_CHECK( ! button.GetProperty< bool >( Button::PROPERTY_AUTO_REPEATING ) );
- button.SetProperty( Button::PROPERTY_AUTO_REPEATING, true );
+ DALI_TEST_CHECK( ! button.GetProperty< bool >( Button::Property::AUTO_REPEATING ) );
+ button.SetProperty( Button::Property::AUTO_REPEATING, true );
DALI_TEST_CHECK( button.IsAutoRepeating() ) ;
- DALI_TEST_CHECK( button.GetProperty< bool >( Button::PROPERTY_AUTO_REPEATING ) );
+ DALI_TEST_CHECK( button.GetProperty< bool >( Button::Property::AUTO_REPEATING ) );
// Button::PROPERTY_INITIAL_AUTO_REPEATING_DELAY
button.SetInitialAutoRepeatingDelay( 10.0f );
- DALI_TEST_EQUALS( 10.0f, button.GetProperty< float >( Button::PROPERTY_INITIAL_AUTO_REPEATING_DELAY ), TEST_LOCATION );
- button.SetProperty( Button::PROPERTY_INITIAL_AUTO_REPEATING_DELAY, 25.0f );
+ DALI_TEST_EQUALS( 10.0f, button.GetProperty< float >( Button::Property::INITIAL_AUTO_REPEATING_DELAY ), TEST_LOCATION );
+ button.SetProperty( Button::Property::INITIAL_AUTO_REPEATING_DELAY, 25.0f );
DALI_TEST_EQUALS( 25.0f, button.GetInitialAutoRepeatingDelay(), TEST_LOCATION );
- DALI_TEST_EQUALS( 25.0f, button.GetProperty< float >( Button::PROPERTY_INITIAL_AUTO_REPEATING_DELAY ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 25.0f, button.GetProperty< float >( Button::Property::INITIAL_AUTO_REPEATING_DELAY ), TEST_LOCATION );
// Button::PROPERTY_NEXT_AUTO_REPEATING_DELAY
button.SetNextAutoRepeatingDelay( 3.0f );
- DALI_TEST_EQUALS( 3.0f, button.GetProperty< float >( Button::PROPERTY_NEXT_AUTO_REPEATING_DELAY ), TEST_LOCATION );
- button.SetProperty( Button::PROPERTY_NEXT_AUTO_REPEATING_DELAY, 4.0f );
+ DALI_TEST_EQUALS( 3.0f, button.GetProperty< float >( Button::Property::NEXT_AUTO_REPEATING_DELAY ), TEST_LOCATION );
+ button.SetProperty( Button::Property::NEXT_AUTO_REPEATING_DELAY, 4.0f );
DALI_TEST_EQUALS( 4.0f, button.GetNextAutoRepeatingDelay(), TEST_LOCATION );
- DALI_TEST_EQUALS( 4.0f, button.GetProperty< float >( Button::PROPERTY_NEXT_AUTO_REPEATING_DELAY ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 4.0f, button.GetProperty< float >( Button::Property::NEXT_AUTO_REPEATING_DELAY ), TEST_LOCATION );
// Button::PROPERTY_TOGGLABLE
button.SetTogglableButton( false );
- DALI_TEST_CHECK( ! button.GetProperty< bool >( Button::PROPERTY_TOGGLABLE ) );
- button.SetProperty( Button::PROPERTY_TOGGLABLE, true );
+ DALI_TEST_CHECK( ! button.GetProperty< bool >( Button::Property::TOGGLABLE ) );
+ button.SetProperty( Button::Property::TOGGLABLE, true );
DALI_TEST_CHECK( button.IsTogglableButton() ) ;
- DALI_TEST_CHECK( button.GetProperty< bool >( Button::PROPERTY_TOGGLABLE ) );
+ DALI_TEST_CHECK( button.GetProperty< bool >( Button::Property::TOGGLABLE ) );
// Button::PROPERTY_SELECTED
button.SetSelected( false );
- DALI_TEST_CHECK( ! button.GetProperty< bool >( Button::PROPERTY_SELECTED ) );
- button.SetProperty( Button::PROPERTY_SELECTED, true );
+ DALI_TEST_CHECK( ! button.GetProperty< bool >( Button::Property::SELECTED ) );
+ button.SetProperty( Button::Property::SELECTED, true );
DALI_TEST_CHECK( button.IsSelected() ) ;
- DALI_TEST_CHECK( button.GetProperty< bool >( Button::PROPERTY_SELECTED ) );
+ DALI_TEST_CHECK( button.GetProperty< bool >( Button::Property::SELECTED ) );
// Button::PROPERTY_NORMAL_STATE_ACTOR
{
button.SetButtonImage( ResourceImage::New( "IMAGE_PATH_1") );
- DALI_TEST_EQUALS( "IMAGE_PATH_1", button.GetProperty( Button::PROPERTY_NORMAL_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
+ DALI_TEST_EQUALS( "IMAGE_PATH_1", button.GetProperty( Button::Property::NORMAL_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
Property::Map map;
map[ "type" ] = "ImageActor";
- button.SetProperty( Button::PROPERTY_NORMAL_STATE_ACTOR, map );
- DALI_TEST_EQUALS( "ImageActor", button.GetProperty( Button::PROPERTY_NORMAL_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
+ button.SetProperty( Button::Property::NORMAL_STATE_ACTOR, map );
+ DALI_TEST_EQUALS( "ImageActor", button.GetProperty( Button::Property::NORMAL_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
}
// Button::PROPERTY_SELECTED_STATE_ACTOR
{
button.SetSelectedImage( ResourceImage::New( "IMAGE_PATH_2") );
- DALI_TEST_EQUALS( "IMAGE_PATH_2", button.GetProperty( Button::PROPERTY_SELECTED_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
+ DALI_TEST_EQUALS( "IMAGE_PATH_2", button.GetProperty( Button::Property::SELECTED_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
Property::Map map;
map[ "type" ] = "Actor";
- button.SetProperty( Button::PROPERTY_SELECTED_STATE_ACTOR, map );
- DALI_TEST_EQUALS( "Actor", button.GetProperty( Button::PROPERTY_SELECTED_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
- DALI_TEST_CHECK( "ImageActor" != button.GetProperty( Button::PROPERTY_SELECTED_STATE_ACTOR ).GetValue( "type" ).Get< std::string >() );
+ button.SetProperty( Button::Property::SELECTED_STATE_ACTOR, map );
+ DALI_TEST_EQUALS( "Actor", button.GetProperty( Button::Property::SELECTED_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
+ DALI_TEST_CHECK( "ImageActor" != button.GetProperty( Button::Property::SELECTED_STATE_ACTOR ).GetValue( "type" ).Get< std::string >() );
}
// Button::PROPERTY_DISABLED_STATE_ACTOR
{
button.SetDisabledImage( ResourceImage::New( "IMAGE_PATH_3") );
- DALI_TEST_EQUALS( "IMAGE_PATH_3", button.GetProperty( Button::PROPERTY_DISABLED_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
+ DALI_TEST_EQUALS( "IMAGE_PATH_3", button.GetProperty( Button::Property::DISABLED_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
Property::Map map;
map[ "type" ] = "Actor";
- button.SetProperty( Button::PROPERTY_DISABLED_STATE_ACTOR, map );
- DALI_TEST_EQUALS( "Actor", button.GetProperty( Button::PROPERTY_DISABLED_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
+ button.SetProperty( Button::Property::DISABLED_STATE_ACTOR, map );
+ DALI_TEST_EQUALS( "Actor", button.GetProperty( Button::Property::DISABLED_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
}
// Button::PROPERTY_LABEL_ACTOR
{
button.SetLabel( "LABEL_TEXT_CUSTOM" );
- DALI_TEST_EQUALS( "TextView", button.GetProperty( Button::PROPERTY_LABEL_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
+ DALI_TEST_EQUALS( "TextView", button.GetProperty( Button::Property::LABEL_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
Property::Map map;
map[ "type" ] = "Actor";
- button.SetProperty( Button::PROPERTY_LABEL_ACTOR, map );
- DALI_TEST_EQUALS( "Actor", button.GetProperty( Button::PROPERTY_LABEL_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
+ button.SetProperty( Button::Property::LABEL_ACTOR, map );
+ DALI_TEST_EQUALS( "Actor", button.GetProperty( Button::Property::LABEL_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
}
END_TEST;
}
}
/**
+ * @copydoc PlatformAbstraction::LoadShaderBinFile()
+ */
+bool TestPlatformAbstraction::LoadShaderBinFile( const std::string& filename, std::vector< unsigned char >& buffer ) const
+{
+ mTrace.PushCall("LoadShaderBinFile", "");
+ if( mLoadFileResult.loadResult )
+ {
+ buffer = mLoadFileResult.buffer;
+ }
+
+ return mLoadFileResult.loadResult;
+}
+
+/**
* @copydoc PlatformAbstraction::SaveFile()
*/
bool TestPlatformAbstraction::SaveFile(const std::string& filename, std::vector< unsigned char >& buffer) const
case LoadResourceFunc: return mTrace.FindMethod("LoadResource");
case SaveResourceFunc: return mTrace.FindMethod("SaveResource");
case LoadFileFunc: return mTrace.FindMethod("LoadFile");
+ case LoadShaderBinFileFunc: return mTrace.FindMethod("LoadShaderBinFile");
case SaveFileFunc: return mTrace.FindMethod("SaveFile");
case CancelLoadFunc: return mTrace.FindMethod("CancelLoad");
case GetResourcesFunc: return mTrace.FindMethod("GetResources");
virtual bool LoadFile( const std::string& filename, std::vector< unsigned char >& buffer ) const;
/**
+ * @copydoc PlatformAbstraction::LoadShaderBinFile()
+ */
+ virtual bool LoadShaderBinFile( const std::string& filename, std::vector< unsigned char >& buffer ) const;
+
+ /**
* @copydoc PlatformAbstraction::SaveFile()
*/
virtual bool SaveFile(const std::string& filename, std::vector< unsigned char >& buffer) const;
SaveResourceFunc,
SaveFileFunc,
LoadFileFunc,
+ LoadShaderBinFileFunc,
CancelLoadFunc,
GetResourcesFunc,
IsLoadingFunc,
DALI_TEST_CHECK( !control.GetBackgroundActor() );
DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::TRANSPARENT, TEST_LOCATION );
- DALI_TEST_EQUALS( control.GetProperty( Control::PROPERTY_BACKGROUND_COLOR ).Get< Vector4 >(), Color::TRANSPARENT, TEST_LOCATION );
- DALI_TEST_CHECK( control.GetProperty( Control::PROPERTY_BACKGROUND ).Get< Property::Map >().Empty() );
+ DALI_TEST_EQUALS( control.GetProperty( Control::Property::BACKGROUND_COLOR ).Get< Vector4 >(), Color::TRANSPARENT, TEST_LOCATION );
+ DALI_TEST_CHECK( control.GetProperty( Control::Property::BACKGROUND ).Get< Property::Map >().Empty() );
- control.SetProperty( Control::PROPERTY_BACKGROUND_COLOR, Color::RED );
+ control.SetProperty( Control::Property::BACKGROUND_COLOR, Color::RED );
DALI_TEST_CHECK( control.GetBackgroundActor() );
DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::RED, TEST_LOCATION );
- DALI_TEST_EQUALS( control.GetProperty( Control::PROPERTY_BACKGROUND_COLOR ).Get< Vector4 >(), Color::RED, TEST_LOCATION );
+ DALI_TEST_EQUALS( control.GetProperty( Control::Property::BACKGROUND_COLOR ).Get< Vector4 >(), Color::RED, TEST_LOCATION );
Property::Map imageMap;
imageMap[ "filename" ] = "TestImage";
Property::Map map;
map[ "image" ] = imageMap;
- control.SetProperty( Control::PROPERTY_BACKGROUND, map );
+ control.SetProperty( Control::Property::BACKGROUND, map );
DALI_TEST_CHECK( control.GetBackgroundActor() );
DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::RED, TEST_LOCATION );
- DALI_TEST_EQUALS( control.GetProperty( Control::PROPERTY_BACKGROUND_COLOR ).Get< Vector4 >(), Color::RED, TEST_LOCATION );
+ DALI_TEST_EQUALS( control.GetProperty( Control::Property::BACKGROUND_COLOR ).Get< Vector4 >(), Color::RED, TEST_LOCATION );
- Property::Value propValue = control.GetProperty( Control::PROPERTY_BACKGROUND );
+ Property::Value propValue = control.GetProperty( Control::Property::BACKGROUND );
DALI_TEST_CHECK( propValue.HasKey( "image" ) );
DALI_TEST_CHECK( propValue.GetValue( "image" ).HasKey( "filename" ) );
DALI_TEST_CHECK( propValue.GetValue( "image" ).GetValue( "filename" ).Get< std::string>() == "TestImage" );
Property::Map emptyMap;
- control.SetProperty( Control::PROPERTY_BACKGROUND, emptyMap );
+ control.SetProperty( Control::Property::BACKGROUND, emptyMap );
DALI_TEST_CHECK( !control.GetBackgroundActor() );
DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::TRANSPARENT, TEST_LOCATION );
- DALI_TEST_EQUALS( control.GetProperty( Control::PROPERTY_BACKGROUND_COLOR ).Get< Vector4 >(), Color::TRANSPARENT, TEST_LOCATION );
- DALI_TEST_CHECK( control.GetProperty( Control::PROPERTY_BACKGROUND ).Get< Property::Map >().Empty() );
+ DALI_TEST_EQUALS( control.GetProperty( Control::Property::BACKGROUND_COLOR ).Get< Vector4 >(), Color::TRANSPARENT, TEST_LOCATION );
+ DALI_TEST_CHECK( control.GetProperty( Control::Property::BACKGROUND ).Get< Property::Map >().Empty() );
END_TEST;
}
Control::SizePolicy heightPolicy( Control::Fixed );
control.GetSizePolicy( widthPolicy, heightPolicy );
- DALI_TEST_EQUALS( "FIXED", control.GetProperty( Control::PROPERTY_WIDTH_POLICY ).Get< std::string >(), TEST_LOCATION );
- DALI_TEST_EQUALS( "FIXED", control.GetProperty( Control::PROPERTY_HEIGHT_POLICY ).Get< std::string >(), TEST_LOCATION );
+ DALI_TEST_EQUALS( "FIXED", control.GetProperty( Control::Property::WIDTH_POLICY ).Get< std::string >(), TEST_LOCATION );
+ DALI_TEST_EQUALS( "FIXED", control.GetProperty( Control::Property::HEIGHT_POLICY ).Get< std::string >(), TEST_LOCATION );
control.SetSizePolicy( Control::Flexible, Control::Range );
- DALI_TEST_EQUALS( "FLEXIBLE", control.GetProperty( Control::PROPERTY_WIDTH_POLICY ).Get< std::string >(), TEST_LOCATION );
- DALI_TEST_EQUALS( "RANGE", control.GetProperty( Control::PROPERTY_HEIGHT_POLICY ).Get< std::string >(), TEST_LOCATION );
+ DALI_TEST_EQUALS( "FLEXIBLE", control.GetProperty( Control::Property::WIDTH_POLICY ).Get< std::string >(), TEST_LOCATION );
+ DALI_TEST_EQUALS( "RANGE", control.GetProperty( Control::Property::HEIGHT_POLICY ).Get< std::string >(), TEST_LOCATION );
- control.SetProperty( Control::PROPERTY_WIDTH_POLICY, "MAXIMUM" );
- control.SetProperty( Control::PROPERTY_HEIGHT_POLICY, "MINIMUM" );
+ control.SetProperty( Control::Property::WIDTH_POLICY, "MAXIMUM" );
+ control.SetProperty( Control::Property::HEIGHT_POLICY, "MINIMUM" );
control.GetSizePolicy( widthPolicy, heightPolicy );
DALI_TEST_EQUALS( Control::Maximum, widthPolicy, TEST_LOCATION );
DALI_TEST_EQUALS( Control::Minimum, heightPolicy, TEST_LOCATION );
Control control = Control::New();
- DALI_TEST_EQUALS( control.GetMinimumSize(), control.GetProperty( Control::PROPERTY_MINIMUM_SIZE ).Get< Vector3 >(), TEST_LOCATION );
- DALI_TEST_EQUALS( control.GetMaximumSize(), control.GetProperty( Control::PROPERTY_MAXIMUM_SIZE ).Get< Vector3 >(), TEST_LOCATION );
+ DALI_TEST_EQUALS( control.GetMinimumSize(), control.GetProperty( Control::Property::MINIMUM_SIZE ).Get< Vector3 >(), TEST_LOCATION );
+ DALI_TEST_EQUALS( control.GetMaximumSize(), control.GetProperty( Control::Property::MAXIMUM_SIZE ).Get< Vector3 >(), TEST_LOCATION );
control.SetMinimumSize( Vector3( 100.0f, 200.0f, 300.0f ) );
- DALI_TEST_EQUALS( Vector3( 100.0f, 200.0f, 300.0f ), control.GetProperty( Control::PROPERTY_MINIMUM_SIZE ).Get< Vector3 >(), TEST_LOCATION );
+ DALI_TEST_EQUALS( Vector3( 100.0f, 200.0f, 300.0f ), control.GetProperty( Control::Property::MINIMUM_SIZE ).Get< Vector3 >(), TEST_LOCATION );
control.SetMaximumSize( Vector3( 200.0f, 250.0f, 800.0f ) );
- DALI_TEST_EQUALS( Vector3( 200.0f, 250.0f, 800.0f ), control.GetProperty( Control::PROPERTY_MAXIMUM_SIZE ).Get< Vector3 >(), TEST_LOCATION );
+ DALI_TEST_EQUALS( Vector3( 200.0f, 250.0f, 800.0f ), control.GetProperty( Control::Property::MAXIMUM_SIZE ).Get< Vector3 >(), TEST_LOCATION );
- control.SetProperty( Control::PROPERTY_MINIMUM_SIZE, Vector3( 1.0f, 2.0f, 3.0f ) );
- control.SetProperty( Control::PROPERTY_MAXIMUM_SIZE, Vector3( 10.0f, 20.0f, 30.0f ) );
+ control.SetProperty( Control::Property::MINIMUM_SIZE, Vector3( 1.0f, 2.0f, 3.0f ) );
+ control.SetProperty( Control::Property::MAXIMUM_SIZE, Vector3( 10.0f, 20.0f, 30.0f ) );
DALI_TEST_EQUALS( control.GetMinimumSize(), Vector3( 1.0f, 2.0f, 3.0f ), TEST_LOCATION );
DALI_TEST_EQUALS( control.GetMaximumSize(), Vector3( 10.0f, 20.0f, 30.0f ), TEST_LOCATION );
Control control = Control::New();
Stage::GetCurrent().Add( control );
- DALI_TEST_EQUALS( control.HasKeyInputFocus(), control.GetProperty( Control::PROPERTY_KEY_INPUT_FOCUS ).Get< bool >(), TEST_LOCATION );
+ DALI_TEST_EQUALS( control.HasKeyInputFocus(), control.GetProperty( Control::Property::KEY_INPUT_FOCUS ).Get< bool >(), TEST_LOCATION );
control.SetKeyInputFocus();
- DALI_TEST_EQUALS( true, control.GetProperty( Control::PROPERTY_KEY_INPUT_FOCUS ).Get< bool >(), TEST_LOCATION );
+ DALI_TEST_EQUALS( true, control.GetProperty( Control::Property::KEY_INPUT_FOCUS ).Get< bool >(), TEST_LOCATION );
control.ClearKeyInputFocus();
- DALI_TEST_EQUALS( false, control.GetProperty( Control::PROPERTY_KEY_INPUT_FOCUS ).Get< bool >(), TEST_LOCATION );
+ DALI_TEST_EQUALS( false, control.GetProperty( Control::Property::KEY_INPUT_FOCUS ).Get< bool >(), TEST_LOCATION );
- control.SetProperty( Control::PROPERTY_KEY_INPUT_FOCUS, true );
+ control.SetProperty( Control::Property::KEY_INPUT_FOCUS, true );
DALI_TEST_EQUALS( true, control.HasKeyInputFocus(), TEST_LOCATION );
END_TEST;
radioButton.SetPosition( 0.0f, 0.0f );
// Default selected
- DALI_TEST_CHECK( radioButton.GetProperty<bool>( Button::PROPERTY_SELECTED ) == false );
+ DALI_TEST_CHECK( radioButton.GetProperty<bool>( Button::Property::SELECTED ) == false );
// Setting false selected
- radioButton.SetProperty( Button::PROPERTY_SELECTED, false );
- DALI_TEST_CHECK( radioButton.GetProperty<bool>( Button::PROPERTY_SELECTED ) == false );
+ radioButton.SetProperty( Button::Property::SELECTED, false );
+ DALI_TEST_CHECK( radioButton.GetProperty<bool>( Button::Property::SELECTED ) == false );
// Setting true selected
- radioButton.SetProperty( Button::PROPERTY_SELECTED, true );
- DALI_TEST_CHECK( radioButton.GetProperty<bool>( Button::PROPERTY_SELECTED ) == true );
+ radioButton.SetProperty( Button::Property::SELECTED, true );
+ DALI_TEST_CHECK( radioButton.GetProperty<bool>( Button::Property::SELECTED ) == true );
// Setting false again
- radioButton.SetProperty( Button::PROPERTY_SELECTED, false );
- DALI_TEST_CHECK( radioButton.GetProperty<bool>( Button::PROPERTY_SELECTED ) == false );
+ radioButton.SetProperty( Button::Property::SELECTED, false );
+ DALI_TEST_CHECK( radioButton.GetProperty<bool>( Button::Property::SELECTED ) == false );
// Test selecting radio buttons
RadioButton radioButton2 = RadioButton::New( "label" );
application.Render();
// Simulate touch events
- DALI_TEST_CHECK( radioButton2.GetProperty<bool>( Button::PROPERTY_SELECTED ) == false );
- DALI_TEST_CHECK( radioButton3.GetProperty<bool>( Button::PROPERTY_SELECTED ) == false );
+ DALI_TEST_CHECK( radioButton2.GetProperty<bool>( Button::Property::SELECTED ) == false );
+ DALI_TEST_CHECK( radioButton3.GetProperty<bool>( Button::Property::SELECTED ) == false );
// Select first radio
{
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( radioButton2.GetProperty<bool>( Button::PROPERTY_SELECTED ) == true );
- DALI_TEST_CHECK( radioButton3.GetProperty<bool>( Button::PROPERTY_SELECTED ) == false );
+ DALI_TEST_CHECK( radioButton2.GetProperty<bool>( Button::Property::SELECTED ) == true );
+ DALI_TEST_CHECK( radioButton3.GetProperty<bool>( Button::Property::SELECTED ) == false );
}
// Select an already selected radio
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( radioButton2.GetProperty<bool>( Button::PROPERTY_SELECTED ) == true );
- DALI_TEST_CHECK( radioButton3.GetProperty<bool>( Button::PROPERTY_SELECTED ) == false );
+ DALI_TEST_CHECK( radioButton2.GetProperty<bool>( Button::Property::SELECTED ) == true );
+ DALI_TEST_CHECK( radioButton3.GetProperty<bool>( Button::Property::SELECTED ) == false );
}
// Select second radio
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( radioButton2.GetProperty<bool>( Button::PROPERTY_SELECTED ) == false );
- DALI_TEST_CHECK( radioButton3.GetProperty<bool>( Button::PROPERTY_SELECTED ) == true );
+ DALI_TEST_CHECK( radioButton2.GetProperty<bool>( Button::Property::SELECTED ) == false );
+ DALI_TEST_CHECK( radioButton3.GetProperty<bool>( Button::Property::SELECTED ) == true );
}
// Select outside radio group
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( radioButton2.GetProperty<bool>( Button::PROPERTY_SELECTED ) == false );
- DALI_TEST_CHECK( radioButton3.GetProperty<bool>( Button::PROPERTY_SELECTED ) == true );
+ DALI_TEST_CHECK( radioButton2.GetProperty<bool>( Button::Property::SELECTED ) == false );
+ DALI_TEST_CHECK( radioButton3.GetProperty<bool>( Button::Property::SELECTED ) == true );
}
END_TEST;
Wait(application);
Property::Index scrollPositionProperty = scrollView.GetPropertyIndex(ScrollView::SCROLL_POSITION_PROPERTY_NAME);
- Constraint constraint = Constraint::New<Vector3>( Actor::Property::Position,
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
Source(scrollView, scrollPositionProperty),
TestSumConstraint( TEST_CONSTRAINT_OFFSET ) );
constraint.SetRemoveAction(Constraint::Discard);
Property::Index scrollPositionProperty = scrollView.GetPropertyIndex(ScrollView::SCROLL_POSITION_PROPERTY_NAME);
// apply this constraint to scrollview
- Constraint constraint = Constraint::New<Vector3>( Actor::Property::Position,
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
Source(scrollView, scrollPositionProperty),
TestSumConstraint( TEST_CONSTRAINT_OFFSET ) );
scrollView.SetSize(size);
scrollView.SetAnchorPoint(AnchorPoint::CENTER);
scrollView.SetParentOrigin(ParentOrigin::CENTER);
- scrollView.ApplyConstraint( Constraint::New<Dali::Vector3>( Dali::Actor::Property::Size, Dali::ParentSource( Dali::Actor::Property::Size ), Dali::EqualToConstraint() ) );
+ scrollView.ApplyConstraint( Constraint::New<Dali::Vector3>( Dali::Actor::Property::SIZE, Dali::ParentSource( Dali::Actor::Property::SIZE ), Dali::EqualToConstraint() ) );
scrollView.SetWrapMode(false);
scrollView.ScrollStartedSignal().Connect( &OnScrollStart );
scrollView.ScrollUpdatedSignal().Connect( &OnScrollUpdate );
container.SetAnchorPoint(AnchorPoint::CENTER);
container.SetSize( size );
scrollView.Add( container );
- container.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::Size, ParentSource( Actor::Property::Size ), EqualToConstraint() ) );
+ container.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::SIZE, ParentSource( Actor::Property::SIZE ), EqualToConstraint() ) );
gPages.clear();
for(int row = 0;row<rows;row++)
for(int column = 0;column<columns;column++)
{
Actor page = Actor::New();
- page.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::Size, ParentSource( Actor::Property::Size ), EqualToConstraint() ) );
+ page.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::SIZE, ParentSource( Actor::Property::SIZE ), EqualToConstraint() ) );
page.SetParentOrigin( ParentOrigin::CENTER );
page.SetAnchorPoint( AnchorPoint::CENTER );
page.SetPosition( column * size.x, row * size.y );
{
Actor page = *pageIter;
page.RemoveConstraints();
- page.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::Size, ParentSource( Actor::Property::Size ), EqualToConstraint() ) );
+ page.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::SIZE, ParentSource( Actor::Property::SIZE ), EqualToConstraint() ) );
effect.ApplyToPage(page, Vector2(Math::PI_2, 0.0f));
}
Wait(application);
{
Actor page = *pageIter;
page.RemoveConstraints();
- page.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::Size, ParentSource( Actor::Property::Size ), EqualToConstraint() ) );
+ page.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::SIZE, ParentSource( Actor::Property::SIZE ), EqualToConstraint() ) );
effect.ApplyToPage(page, Vector2(Math::PI_2, 0.0f));
}
Wait(application);
{
Actor page = *pageIter;
page.RemoveConstraints();
- page.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::Size, ParentSource( Actor::Property::Size ), EqualToConstraint() ) );
+ page.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::SIZE, ParentSource( Actor::Property::SIZE ), EqualToConstraint() ) );
effect.ApplyToPage(page);
}
Wait(application);
{
marks.push_back( MIN_BOUND + ( static_cast<float>(i) / ( NUM_MARKS - 1) ) * ( MAX_BOUND - MIN_BOUND ) );
}
- slider.SetProperty( Slider::MARKS_PROPERTY, marks );
- slider.SetProperty( Slider::MARK_TOLERANCE_PROPERTY, 0.1f );
+ slider.SetProperty( Slider::Property::MARKS, marks );
+ slider.SetProperty( Slider::Property::MARK_TOLERANCE, 0.1f );
slider.ValueChangedSignal().Connect( &OnSliderValueChanged );
slider.MarkSignal().Connect( &OnSliderMark );
const char* const PROPERTY_NAME_LAYOUT_ROWS = "layout-rows";
const char* const PROPERTY_NAME_LAYOUT_COLUMNS = "layout-columns";
-
static bool gObjectCreatedCallBackCalled;
static void TestCallback(BaseHandle handle)
gObjectCreatedCallBackCalled = true;
}
-
struct Constraint100
{
Constraint100( )
} // namespace
-
int UtcDaliTableViewNew(void)
{
ToolkitTestApplication application;
// Create a 1x1 table-view
TableView tableView = TableView::New(1,1);
- tableView.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::Size, Constraint100() ) );
+ tableView.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::SIZE, Constraint100() ) );
DALI_TEST_CHECK( tableView );
// Test "rows" property
- DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_ROWS ) == TableView::PROPERTY_ROWS );
+ DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_ROWS ) == TableView::Property::ROWS );
- tableView.SetProperty( TableView::PROPERTY_ROWS, 4u );
+ tableView.SetProperty( TableView::Property::ROWS, 4u );
DALI_TEST_CHECK( tableView.GetRows() == 4u );
- DALI_TEST_CHECK( tableView.GetProperty(TableView::PROPERTY_ROWS).Get<unsigned int>() == 4u );
+ DALI_TEST_CHECK( tableView.GetProperty(TableView::Property::ROWS).Get<unsigned int>() == 4u );
// Test "columns" property
- DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_COLUMNS ) == TableView::PROPERTY_COLUMNS );
+ DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_COLUMNS ) == TableView::Property::COLUMNS );
- tableView.SetProperty( TableView::PROPERTY_COLUMNS, 5u );
+ tableView.SetProperty( TableView::Property::COLUMNS, 5u );
DALI_TEST_CHECK( tableView.GetColumns() == 5u );
- DALI_TEST_CHECK( tableView.GetProperty(TableView::PROPERTY_COLUMNS).Get<unsigned int>() == 5u );
+ DALI_TEST_CHECK( tableView.GetProperty(TableView::Property::COLUMNS).Get<unsigned int>() == 5u );
// Test "cell-padding" property
- DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_CELL_PADDING ) == TableView::PROPERTY_CELL_PADDING );
+ DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_CELL_PADDING ) == TableView::Property::CELL_PADDING );
- tableView.SetProperty( TableView::PROPERTY_CELL_PADDING, Size( 6.f, 8.f ) );
+ tableView.SetProperty( TableView::Property::CELL_PADDING, Size( 6.f, 8.f ) );
DALI_TEST_EQUALS( tableView.GetCellPadding(), Size(6.f, 8.f), TEST_LOCATION );
- DALI_TEST_EQUALS( tableView.GetProperty(TableView::PROPERTY_CELL_PADDING).Get<Vector2>(), Vector2(6.f,8.f), TEST_LOCATION );
+ DALI_TEST_EQUALS( tableView.GetProperty(TableView::Property::CELL_PADDING).Get<Vector2>(), Vector2(6.f,8.f), TEST_LOCATION );
//{ "policy": "fixed", "value": 30.0 },
Property::Map item1;
item2[ "value" ] = 0.2f;
// Test "layout-rows" property
- DALI_TEST_CHECK( tableView.GetPropertyIndex(PROPERTY_NAME_LAYOUT_ROWS) == TableView::PROPERTY_LAYOUT_ROWS );
+ DALI_TEST_CHECK( tableView.GetPropertyIndex(PROPERTY_NAME_LAYOUT_ROWS) == TableView::Property::LAYOUT_ROWS );
/*
* "layout-rows":
Property::Map layoutRows;
layoutRows[ "1" ] = item1;
layoutRows[ "3" ] = item2;
- tableView.SetProperty( TableView::PROPERTY_LAYOUT_ROWS, layoutRows );
+ tableView.SetProperty( TableView::Property::LAYOUT_ROWS, layoutRows );
DALI_TEST_EQUALS( tableView.GetFixedHeight( 1u ), 30.f, TEST_LOCATION );
DALI_TEST_EQUALS( tableView.GetRelativeHeight( 3u ), 0.2f, TEST_LOCATION );
- Property::Map layoutRowsGet = tableView.GetProperty(TableView::PROPERTY_LAYOUT_ROWS).Get<Property::Map>();
+ Property::Map layoutRowsGet = tableView.GetProperty(TableView::Property::LAYOUT_ROWS).Get<Property::Map>();
DALI_TEST_CHECK( layoutRowsGet.GetKey(0).compare(layoutRows.GetKey(0)) == 0 );
DALI_TEST_CHECK( layoutRowsGet.GetValue(0).GetValue( "policy" ).Get<std::string>().compare(layoutRows.GetValue(0).GetValue( "policy" ).Get<std::string>()) == 0 );
DALI_TEST_EQUALS( layoutRowsGet.GetValue(0).GetValue( "value" ).Get<float>(),layoutRows.GetValue(0).GetValue( "value" ).Get<float>(), TEST_LOCATION );
DALI_TEST_EQUALS( layoutRowsGet.GetValue(1).GetValue( "value" ).Get<float>(),layoutRows.GetValue(1).GetValue( "value" ).Get<float>(), TEST_LOCATION );
// Test "layout-columns" property
- DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_LAYOUT_COLUMNS ) == TableView::PROPERTY_LAYOUT_COLUMNS );
+ DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_LAYOUT_COLUMNS ) == TableView::Property::LAYOUT_COLUMNS );
/*
* "layout-columns":
Property::Map layoutColumns;
layoutColumns[ "2" ] = item2;
layoutColumns[ "3" ] = item1;
- tableView.SetProperty( TableView::PROPERTY_LAYOUT_COLUMNS, layoutColumns );
+ tableView.SetProperty( TableView::Property::LAYOUT_COLUMNS, layoutColumns );
DALI_TEST_EQUALS( tableView.GetRelativeWidth( 2u ), 0.2f, TEST_LOCATION );
DALI_TEST_EQUALS( tableView.GetFixedWidth( 3u ), 30.f, TEST_LOCATION );
- Property::Map layoutColumnsGet = tableView.GetProperty(TableView::PROPERTY_LAYOUT_COLUMNS).Get<Property::Map>();
+ Property::Map layoutColumnsGet = tableView.GetProperty(TableView::Property::LAYOUT_COLUMNS).Get<Property::Map>();
DALI_TEST_CHECK( layoutColumnsGet.GetKey(0).compare(layoutColumns.GetKey(0)) == 0 );
DALI_TEST_CHECK( layoutColumnsGet.GetValue(0).GetValue( "policy" ).Get<std::string>().compare(layoutColumns.GetValue(0).GetValue( "policy" ).Get<std::string>()) == 0 );
DALI_TEST_EQUALS( layoutColumnsGet.GetValue(0).GetValue( "value" ).Get<float>(),layoutColumns.GetValue(0).GetValue( "value" ).Get<float>(), TEST_LOCATION );
// Create a 10x10 table-view
TableView tableView = TableView::New(10,10);
- tableView.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::Size, Constraint100() ) );
+ tableView.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::SIZE, Constraint100() ) );
DALI_TEST_CHECK( tableView );
// Create a child actor with the custom properties
@cat doxygen-errors.txt
@if [ -s doxygen-errors.txt ]; then exit 1 ; fi
@rm doxygen-errors.txt
+# Build JavaScript API documentation using yuidoc ( Yahoo JavaScript Documentation Tool )
+# We first test yuidoc exists, then change in to the dali-script-v8 docs directory and run yuidoc
+ @if [ ! `which yuidoc` = "" ]; then cd ../../../plugins/dali-script-v8/docs && yuidoc --config yuidoc.json -e ".cpp,.js,.md" -o generated .. ../../../docs/content/shared-javascript-and-cpp-documentation/ ; fi
\ No newline at end of file
if( SetPropertyFromNode( *pointsProperty, Property::ARRAY, points ) )
{
ret = Path::New();
- ret.SetProperty( Path::Property::Points, points);
+ ret.SetProperty( Path::Property::POINTS, points);
//control-points property
if( OptionalChild pointsProperty = IsChild( *path, "control-points") )
Dali::Property::Value points(Property::ARRAY);
if( SetPropertyFromNode( *pointsProperty, Property::ARRAY, points ) )
{
- ret.SetProperty( Path::Property::ControlPoints, points);
+ ret.SetProperty( Path::Property::CONTROL_POINTS, points);
}
}
else
// EXTERNAL INCLUDES
#include <dali/public-api/object/property-input.h>
#include <dali/public-api/object/type-registry.h>
-
-// INTERNAL INCLUDES
+#include <dali/public-api/object/type-registry-helper.h>
namespace Dali
{
return Toolkit::Alignment::New();
}
-TypeRegistration mType( typeid(Toolkit::Alignment), typeid(Toolkit::Control), Create );
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::Alignment, Toolkit::Control, Create )
+DALI_TYPE_REGISTRATION_END()
struct ScaleToFillConstraint
{
#include <dali/public-api/animation/constraints.h>
#include <dali/public-api/common/stage.h>
#include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/public-api/render-tasks/render-task-list.h>
// INTERNAL INCLUDES
return Toolkit::BloomView::New();
}
-TypeRegistration mType( typeid(Toolkit::BloomView), typeid(Toolkit::Control), Create );
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::BloomView, Toolkit::Control, Create )
+DALI_TYPE_REGISTRATION_END()
// default parameters
const float BLOOM_THRESHOLD_DEFAULT = 0.25f;
const float ARBITRARY_FIELD_OF_VIEW = Math::PI / 4.0f;
-const std::string BLOOM_BLUR_STRENGTH_PROPERTY_NAME( "BlurStrengthProperty" );
-
-const std::string BLOOM_THRESHOLD_PROPERTY_NAME( "uBloomThreshold" );
-const std::string RECIP_ONE_MINUS_BLOOM_THRESHOLD_PROPERTY_NAME( "uRecipOneMinusBloomThreshold" );
-const std::string BLOOM_INTENSITY_PROPERTY_NAME( "uBloomIntensity" );
-const std::string BLOOM_SATURATION_PROPERTY_NAME( "uBloomSaturation" );
-const std::string IMAGE_INTENSITY_PROPERTY_NAME( "uImageIntensity" );
-const std::string IMAGE_SATURATION_PROPERTY_NAME( "uImageSaturation" );
+const char* const BLOOM_BLUR_STRENGTH_PROPERTY_NAME = "BlurStrengthProperty";
+const char* const BLOOM_THRESHOLD_PROPERTY_NAME = "uBloomThreshold";
+const char* const RECIP_ONE_MINUS_BLOOM_THRESHOLD_PROPERTY_NAME = "uRecipOneMinusBloomThreshold";
+const char* const BLOOM_INTENSITY_PROPERTY_NAME = "uBloomIntensity";
+const char* const BLOOM_SATURATION_PROPERTY_NAME = "uBloomSaturation";
+const char* const IMAGE_INTENSITY_PROPERTY_NAME = "uImageIntensity";
+const char* const IMAGE_SATURATION_PROPERTY_NAME = "uImageSaturation";
///////////////////////////////////////////////////////
//
// EXTERNAL INCLUDES
#include <dali/public-api/events/touch-event.h>
#include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/public-api/actors/image-actor.h>
#include <dali/public-api/scripting/scripting.h>
namespace Toolkit
{
-const Property::Index Button::PROPERTY_DISABLED = Internal::Button::BUTTON_PROPERTY_START_INDEX;
-const Property::Index Button::PROPERTY_AUTO_REPEATING = Internal::Button::BUTTON_PROPERTY_START_INDEX + 1;
-const Property::Index Button::PROPERTY_INITIAL_AUTO_REPEATING_DELAY = Internal::Button::BUTTON_PROPERTY_START_INDEX + 2;
-const Property::Index Button::PROPERTY_NEXT_AUTO_REPEATING_DELAY = Internal::Button::BUTTON_PROPERTY_START_INDEX + 3;
-const Property::Index Button::PROPERTY_TOGGLABLE = Internal::Button::BUTTON_PROPERTY_START_INDEX + 4;
-const Property::Index Button::PROPERTY_SELECTED = Internal::Button::BUTTON_PROPERTY_START_INDEX + 5;
-const Property::Index Button::PROPERTY_NORMAL_STATE_ACTOR = Internal::Button::BUTTON_PROPERTY_START_INDEX + 6;
-const Property::Index Button::PROPERTY_SELECTED_STATE_ACTOR = Internal::Button::BUTTON_PROPERTY_START_INDEX + 7;
-const Property::Index Button::PROPERTY_DISABLED_STATE_ACTOR = Internal::Button::BUTTON_PROPERTY_START_INDEX + 8;
-const Property::Index Button::PROPERTY_LABEL_ACTOR = Internal::Button::BUTTON_PROPERTY_START_INDEX + 9;
-
namespace Internal
{
namespace
{
-const unsigned int INITIAL_AUTOREPEATING_DELAY( 0.15f );
-const unsigned int NEXT_AUTOREPEATING_DELAY( 0.05f );
-
-// Signals
-
-const char* const SIGNAL_PRESSED = "pressed";
-const char* const SIGNAL_RELEASED = "released";
-const char* const SIGNAL_CLICKED = "clicked";
-const char* const SIGNAL_STATE_CHANGED = "state-changed";
-
-// Actions
-
-const char* const ACTION_BUTTON_CLICK = "button-click";
-
BaseHandle Create()
{
// empty handle as we cannot create button (but type registered for clicked signal)
return BaseHandle();
}
-TypeRegistration typeRegistration( typeid( Toolkit::Button ), typeid( Toolkit::Control ), Create );
+// Setup properties, signals and actions using the type-registry.
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::Button, Toolkit::Control, Create );
+
+DALI_PROPERTY_REGISTRATION( Button, "disabled", BOOLEAN, DISABLED )
+DALI_PROPERTY_REGISTRATION( Button, "auto-repeating", BOOLEAN, AUTO_REPEATING )
+DALI_PROPERTY_REGISTRATION( Button, "initial-auto-repeating-delay", FLOAT, INITIAL_AUTO_REPEATING_DELAY )
+DALI_PROPERTY_REGISTRATION( Button, "next-auto-repeating-delay", FLOAT, NEXT_AUTO_REPEATING_DELAY )
+DALI_PROPERTY_REGISTRATION( Button, "togglable", BOOLEAN, TOGGLABLE )
+DALI_PROPERTY_REGISTRATION( Button, "selected", BOOLEAN, SELECTED )
+DALI_PROPERTY_REGISTRATION( Button, "normal-state-actor", MAP, NORMAL_STATE_ACTOR )
+DALI_PROPERTY_REGISTRATION( Button, "selected-state-actor", MAP, SELECTED_STATE_ACTOR )
+DALI_PROPERTY_REGISTRATION( Button, "disabled-state-actor", MAP, DISABLED_STATE_ACTOR )
+DALI_PROPERTY_REGISTRATION( Button, "label-actor", MAP, LABEL_ACTOR )
-SignalConnectorType signalConnector1( typeRegistration, SIGNAL_PRESSED , &Button::DoConnectSignal );
-SignalConnectorType signalConnector2( typeRegistration, SIGNAL_RELEASED, &Button::DoConnectSignal );
-SignalConnectorType signalConnector3( typeRegistration, SIGNAL_CLICKED, &Button::DoConnectSignal );
-SignalConnectorType signalConnector4( typeRegistration, SIGNAL_STATE_CHANGED, &Button::DoConnectSignal );
+DALI_SIGNAL_REGISTRATION( Button, "pressed", SIGNAL_PRESSED )
+DALI_SIGNAL_REGISTRATION( Button, "released", SIGNAL_RELEASED )
+DALI_SIGNAL_REGISTRATION( Button, "clicked", SIGNAL_CLICKED )
+DALI_SIGNAL_REGISTRATION( Button, "state-changed", SIGNAL_STATE_CHANGED )
-TypeAction action1( typeRegistration, ACTION_BUTTON_CLICK, &Button::DoAction );
+DALI_ACTION_REGISTRATION( Button, "button-click", ACTION_BUTTON_CLICK )
-PropertyRegistration property1( typeRegistration, "disabled", Toolkit::Button::PROPERTY_DISABLED, Property::BOOLEAN, &Button::SetProperty, &Button::GetProperty );
-PropertyRegistration property2( typeRegistration, "auto-repeating", Toolkit::Button::PROPERTY_AUTO_REPEATING, Property::BOOLEAN, &Button::SetProperty, &Button::GetProperty );
-PropertyRegistration property3( typeRegistration, "initial-auto-repeating-delay", Toolkit::Button::PROPERTY_INITIAL_AUTO_REPEATING_DELAY, Property::FLOAT, &Button::SetProperty, &Button::GetProperty );
-PropertyRegistration property4( typeRegistration, "next-auto-repeating-delay", Toolkit::Button::PROPERTY_NEXT_AUTO_REPEATING_DELAY, Property::FLOAT, &Button::SetProperty, &Button::GetProperty );
-PropertyRegistration property5( typeRegistration, "togglable", Toolkit::Button::PROPERTY_TOGGLABLE, Property::BOOLEAN, &Button::SetProperty, &Button::GetProperty );
-PropertyRegistration property6( typeRegistration, "selected", Toolkit::Button::PROPERTY_SELECTED, Property::BOOLEAN, &Button::SetProperty, &Button::GetProperty );
-PropertyRegistration property7( typeRegistration, "normal-state-actor", Toolkit::Button::PROPERTY_NORMAL_STATE_ACTOR, Property::MAP, &Button::SetProperty, &Button::GetProperty );
-PropertyRegistration property8( typeRegistration, "selected-state-actor", Toolkit::Button::PROPERTY_SELECTED_STATE_ACTOR, Property::MAP, &Button::SetProperty, &Button::GetProperty );
-PropertyRegistration property9( typeRegistration, "disabled-state-actor", Toolkit::Button::PROPERTY_DISABLED_STATE_ACTOR, Property::MAP, &Button::SetProperty, &Button::GetProperty );
-PropertyRegistration property10( typeRegistration, "label-actor", Toolkit::Button::PROPERTY_LABEL_ACTOR, Property::MAP, &Button::SetProperty, &Button::GetProperty );
+DALI_TYPE_REGISTRATION_END()
+
+const unsigned int INITIAL_AUTOREPEATING_DELAY( 0.15f );
+const unsigned int NEXT_AUTOREPEATING_DELAY( 0.05f );
} // unnamed namespace
{
switch ( index )
{
- case Toolkit::Button::PROPERTY_DISABLED:
+ case Toolkit::Button::Property::DISABLED:
{
GetImplementation( button ).SetDisabled( value.Get<bool>() );
break;
}
- case Toolkit::Button::PROPERTY_AUTO_REPEATING:
+ case Toolkit::Button::Property::AUTO_REPEATING:
{
GetImplementation( button ).SetAutoRepeating( value.Get< bool >() );
break;
}
- case Toolkit::Button::PROPERTY_INITIAL_AUTO_REPEATING_DELAY:
+ case Toolkit::Button::Property::INITIAL_AUTO_REPEATING_DELAY:
{
GetImplementation( button ).SetInitialAutoRepeatingDelay( value.Get< float >() );
break;
}
- case Toolkit::Button::PROPERTY_NEXT_AUTO_REPEATING_DELAY:
+ case Toolkit::Button::Property::NEXT_AUTO_REPEATING_DELAY:
{
GetImplementation( button ).SetNextAutoRepeatingDelay( value.Get< float >() );
break;
}
- case Toolkit::Button::PROPERTY_TOGGLABLE:
+ case Toolkit::Button::Property::TOGGLABLE:
{
GetImplementation( button ).SetTogglableButton( value.Get< bool >() );
break;
}
- case Toolkit::Button::PROPERTY_SELECTED:
+ case Toolkit::Button::Property::SELECTED:
{
GetImplementation( button ).SetSelected( value.Get< bool >() );
break;
}
- case Toolkit::Button::PROPERTY_NORMAL_STATE_ACTOR:
+ case Toolkit::Button::Property::NORMAL_STATE_ACTOR:
{
GetImplementation( button ).SetButtonImage( Scripting::NewActor( value.Get< Property::Map >() ) );
break;
}
- case Toolkit::Button::PROPERTY_SELECTED_STATE_ACTOR:
+ case Toolkit::Button::Property::SELECTED_STATE_ACTOR:
{
GetImplementation( button ).SetSelectedImage( Scripting::NewActor( value.Get< Property::Map >() ) );
break;
}
- case Toolkit::Button::PROPERTY_DISABLED_STATE_ACTOR:
+ case Toolkit::Button::Property::DISABLED_STATE_ACTOR:
{
GetImplementation( button ).SetDisabledImage( Scripting::NewActor( value.Get< Property::Map >() ) );
break;
}
- case Toolkit::Button::PROPERTY_LABEL_ACTOR:
+ case Toolkit::Button::Property::LABEL_ACTOR:
{
GetImplementation( button ).SetLabel( Scripting::NewActor( value.Get< Property::Map >() ) );
break;
{
switch ( propertyIndex )
{
- case Toolkit::Button::PROPERTY_DISABLED:
+ case Toolkit::Button::Property::DISABLED:
{
value = GetImplementation( button ).mDisabled;
break;
}
- case Toolkit::Button::PROPERTY_AUTO_REPEATING:
+ case Toolkit::Button::Property::AUTO_REPEATING:
{
value = GetImplementation( button ).mAutoRepeating;
break;
}
- case Toolkit::Button::PROPERTY_INITIAL_AUTO_REPEATING_DELAY:
+ case Toolkit::Button::Property::INITIAL_AUTO_REPEATING_DELAY:
{
value = GetImplementation( button ).mInitialAutoRepeatingDelay;
break;
}
- case Toolkit::Button::PROPERTY_NEXT_AUTO_REPEATING_DELAY:
+ case Toolkit::Button::Property::NEXT_AUTO_REPEATING_DELAY:
{
value = GetImplementation( button ).mNextAutoRepeatingDelay;
break;
}
- case Toolkit::Button::PROPERTY_TOGGLABLE:
+ case Toolkit::Button::Property::TOGGLABLE:
{
value = GetImplementation( button ).mTogglableButton;
break;
}
- case Toolkit::Button::PROPERTY_SELECTED:
+ case Toolkit::Button::Property::SELECTED:
{
value = GetImplementation( button ).mSelected;
break;
}
- case Toolkit::Button::PROPERTY_NORMAL_STATE_ACTOR:
+ case Toolkit::Button::Property::NORMAL_STATE_ACTOR:
{
Property::Map map;
Scripting::CreatePropertyMap( GetImplementation( button ).mButtonContent, map );
break;
}
- case Toolkit::Button::PROPERTY_SELECTED_STATE_ACTOR:
+ case Toolkit::Button::Property::SELECTED_STATE_ACTOR:
{
Property::Map map;
Scripting::CreatePropertyMap( GetImplementation( button ).mSelectedContent, map );
break;
}
- case Toolkit::Button::PROPERTY_DISABLED_STATE_ACTOR:
+ case Toolkit::Button::Property::DISABLED_STATE_ACTOR:
{
Property::Map map;
Scripting::CreatePropertyMap( GetImplementation( button ).mDisabledContent, map );
break;
}
- case Toolkit::Button::PROPERTY_LABEL_ACTOR:
+ case Toolkit::Button::Property::LABEL_ACTOR:
{
Property::Map map;
Scripting::CreatePropertyMap( GetImplementation( button ).mLabel, map );
*/
class Button : public Control
{
-public:
-
- // Properties
- enum
- {
- BUTTON_PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
- BUTTON_PROPERTY_END_INDEX = BUTTON_PROPERTY_START_INDEX + 1000 ///< Reserving 1000 property indices
- };
protected:
} // namespace Dali
#endif // __DALI_TOOLKIT_INTERNAL_BUTTON_H__
-
mCheckInAnimation.AnimateTo( Property( mTickUVEffect, mTickUVEffect.GetBottomRightPropertyName() ), Vector2( 1.0f, 1.0f ) );
// Actor size anim
- mCheckInAnimation.AnimateTo( Property( actor, Actor::Property::ScaleX ), 1.0f );
+ mCheckInAnimation.AnimateTo( Property( actor, Actor::Property::SCALE_X ), 1.0f );
mCheckInAnimation.FinishedSignal().Connect( this, &CheckBoxButton::CheckInAnimationFinished );
mCheckInAnimation.Play();
#include <algorithm>
#include <dali/public-api/animation/animation.h>
#include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
using namespace Dali;
-namespace // unnamed namespace
-{
-
-const float CLUSTER_STYLE_CONSTRAINT_DURATION = 1.0f;
-
-}
-
namespace Dali
{
namespace
{
-// Actions
-
-const char* const ACTION_EXPAND = "expand";
-const char* const ACTION_COLLAPSE = "collapse";
-const char* const ACTION_TRANSFORM = "transform";
-
BaseHandle Create()
{
Toolkit::ClusterStyleStandard s = Toolkit::ClusterStyleStandard::New( Toolkit::ClusterStyleStandard::ClusterStyle1 );
return Toolkit::Cluster::New( s );
}
-TypeRegistration mType( typeid( Toolkit::Cluster ), typeid( Toolkit::Control ), Create );
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::Cluster, Toolkit::Control, Create )
+
+DALI_ACTION_REGISTRATION( Cluster, "expand", ACTION_EXPAND )
+DALI_ACTION_REGISTRATION( Cluster, "collapse", ACTION_COLLAPSE )
+DALI_ACTION_REGISTRATION( Cluster, "transform", ACTION_TRANSFORM )
-TypeAction a1( mType, ACTION_EXPAND, &Cluster::DoAction );
-TypeAction a2( mType, ACTION_COLLAPSE, &Cluster::DoAction );
-TypeAction a3( mType, ACTION_TRANSFORM, &Cluster::DoAction );
+DALI_TYPE_REGISTRATION_END()
+
+const float CLUSTER_STYLE_CONSTRAINT_DURATION = 1.0f;
}
child.RemoveConstraints();
Animation animation = Animation::New(period.delaySeconds + period.durationSeconds);
- animation.AnimateTo( Property(child, Actor::Property::Position), position, AlphaFunctions::EaseOut, period);
- animation.AnimateTo( Property(child, Actor::Property::Scale), scale, AlphaFunctions::EaseOut, period);
- animation.AnimateTo( Property(child, Actor::Property::Rotation), rotation, AlphaFunctions::EaseOut, period);
+ animation.AnimateTo( Property(child, Actor::Property::POSITION), position, AlphaFunctions::EaseOut, period);
+ animation.AnimateTo( Property(child, Actor::Property::SCALE), scale, AlphaFunctions::EaseOut, period);
+ animation.AnimateTo( Property(child, Actor::Property::ROTATION), rotation, AlphaFunctions::EaseOut, period);
animation.Play();
}
}
Property::Index depthProperty = child.GetPropertyIndex(Toolkit::Cluster::CLUSTER_ACTOR_DEPTH);
float depthPropertyValue = child.GetProperty<float>( depthProperty );
-
Apply( child,
FirstOrderEquation( GetClusterSize(), Vector3(position.x, position.y, 0.0f), Vector3(0.0f, 0.0f, depthPropertyValue) ),
FirstOrderEquation( GetClusterSize(), Vector3::ONE * size),
#include <dali/public-api/animation/constraints.h>
#include <dali/public-api/common/stage.h>
#include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/public-api/render-tasks/render-task-list.h>
// INTERNAL INCLUDES
return Toolkit::EffectsView::New();
}
-Dali::TypeRegistration mType( typeid(Dali::Toolkit::EffectsView), typeid(Dali::Toolkit::Control), Create );
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::EffectsView, Toolkit::Control, Create )
+DALI_TYPE_REGISTRATION_END()
const Pixel::Format EFFECTS_VIEW_DEFAULT_PIXEL_FORMAT = Pixel::RGBA8888;
const float ARBITRARY_FIELD_OF_VIEW = Math::PI / 4.0f;
const Vector4 EFFECTS_VIEW_DEFAULT_BACKGROUND_COLOR( 1.0f, 1.0f, 1.0f, 0.0 );
const bool EFFECTS_VIEW_REFRESH_ON_DEMAND(false);
-// custom properties
+
+// Custom properties
+const char* const EFFECT_SIZE_PROPERTY_NAME = "EffectSize";
+const char* const EFFECT_STRENGTH_PROPERTY_NAME = "EffectStrength";
+const char* const EFFECT_OFFSET_PROPERTY_NAME = "EffectOffset";
+const char* const EFFECT_COLOR_PROPERTY_NAME = "EffectColor";
+
const float EFFECT_SIZE_DEFAULT( 1.0f );
-const std::string EFFECT_SIZE_PROPERTY_NAME( "EffectSize" );
const float EFFECT_STRENGTH_DEFAULT( 0.5f );
-const std::string EFFECT_STRENGTH_PROPERTY_NAME( "EffectStrength" );
const Vector3 EFFECT_OFFSET_DEFAULT( 0.0f, 0.0f, 0.0f );
-const std::string EFFECT_OFFSET_PROPERTY_NAME( "EffectOffset" );
const Vector4 EFFECT_COLOR_DEFAULT( Color::WHITE );
-const std::string EFFECT_COLOR_PROPERTY_NAME( "EffectColor" );
const char* const EFFECTS_VIEW_FRAGMENT_SOURCE =
"void main()\n"
mEffectStrengthPropertyIndex = self.RegisterProperty(EFFECT_STRENGTH_PROPERTY_NAME, EFFECT_STRENGTH_DEFAULT, Property::READ_WRITE);
mEffectOffsetPropertyIndex = self.RegisterProperty(EFFECT_OFFSET_PROPERTY_NAME, EFFECT_OFFSET_DEFAULT);
mEffectColorPropertyIndex = self.RegisterProperty(EFFECT_COLOR_PROPERTY_NAME, EFFECT_COLOR_DEFAULT);
- mActorPostFilter.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::Position, Source( self, mEffectOffsetPropertyIndex ), EqualToConstraint() ) );
- mActorPostFilter.ApplyConstraint( Constraint::New<Vector4>( Actor::Property::Color, Source( self, mEffectColorPropertyIndex ), EqualToConstraint() ) );
+ mActorPostFilter.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::POSITION, Source( self, mEffectOffsetPropertyIndex ), EqualToConstraint() ) );
+ mActorPostFilter.ApplyConstraint( Constraint::New<Vector4>( Actor::Property::COLOR, Source( self, mEffectColorPropertyIndex ), EqualToConstraint() ) );
}
void EffectsView::SetBackgroundColor( const Vector4& color )
#include <dali/public-api/animation/constraints.h>
#include <dali/public-api/common/stage.h>
#include <dali/public-api/object/type-registry.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>
// Manager object - re-use render targets if there are multiple GaussianBlurViews created
-
/////////////////////////////////////////////////////////
// IMPLEMENTATION NOTES
return Toolkit::GaussianBlurView::New();
}
-TypeRegistration mType( typeid(Toolkit::GaussianBlurView), typeid(Toolkit::Control), Create );
-
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::GaussianBlurView, Toolkit::Control, Create )
+DALI_TYPE_REGISTRATION_END()
const unsigned int GAUSSIAN_BLUR_VIEW_DEFAULT_NUM_SAMPLES = 5;
const float GAUSSIAN_BLUR_VIEW_DEFAULT_BLUR_BELL_CURVE_WIDTH = 1.5f;
const Pixel::Format GAUSSIAN_BLUR_VIEW_DEFAULT_RENDER_TARGET_PIXEL_FORMAT = Pixel::RGBA8888;
const float GAUSSIAN_BLUR_VIEW_DEFAULT_BLUR_STRENGTH = 1.0f; // default, fully blurred
-const std::string GAUSSIAN_BLUR_VIEW_STRENGTH_PROPERTY_NAME("GaussianBlurStrengthPropertyName");
+const char* const GAUSSIAN_BLUR_VIEW_STRENGTH_PROPERTY_NAME = "GaussianBlurStrengthPropertyName";
const float GAUSSIAN_BLUR_VIEW_DEFAULT_DOWNSAMPLE_WIDTH_SCALE = 0.5f;
const float GAUSSIAN_BLUR_VIEW_DEFAULT_DOWNSAMPLE_HEIGHT_SCALE = 0.5f;
mImageActorComposite.ScaleBy( Vector3(1.0f, -1.0f, 1.0f) ); // FIXME
mImageActorComposite.SetOpacity(GAUSSIAN_BLUR_VIEW_DEFAULT_BLUR_STRENGTH); // ensure alpha is enabled for this object and set default value
- Constraint blurStrengthConstraint = Constraint::New<float>( Actor::Property::ColorAlpha, ParentSource(mBlurStrengthPropertyIndex), EqualToConstraintFloat());
+ Constraint blurStrengthConstraint = Constraint::New<float>( Actor::Property::COLOR_ALPHA, ParentSource(mBlurStrengthPropertyIndex), EqualToConstraintFloat());
mImageActorComposite.ApplyConstraint(blurStrengthConstraint);
// Create an ImageActor for holding final result, i.e. the blurred image. This will get rendered to screen later, via default / user render task
mRenderTask.SetInputEnabled( false );
mRenderTask.SetExclusive( true );
mRenderTask.SetClearEnabled( true );
- mRenderTask.ApplyConstraint( Constraint::New<Vector4>( RenderTask::Property::ClearColor,
+ mRenderTask.ApplyConstraint( Constraint::New<Vector4>( RenderTask::Property::CLEAR_COLOR,
Source( self, mCustomProperties[ Dali::Toolkit::MaskedImageView::BACKGROUND_COLOR ] ),
EqualToConstraint() ) );
mRenderTask.FinishedSignal().Connect( this, &MaskedImageView::OnRenderTaskFinished );
mSourceActor = Actor::New();
Stage().GetCurrent().Add(mSourceActor);
mSourceActor.SetParentOrigin(ParentOrigin::CENTER);
- Constraint constraint = Constraint::New<Vector3>( Actor::Property::Position,
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
Source( self, mPropertySourcePosition ),
EqualToConstraint() );
mSourceActor.ApplyConstraint(constraint);
// at the end of the update cycle i.e. after constraints have been applied.)
//Property::Index propertySourcePositionDelayed = mCameraActor.RegisterProperty("delayed-source-position", Vector3::ZERO);
- constraint = Constraint::New<Vector3>( Actor::Property::Position,
- Source( mSourceActor, Actor::Property::WorldPosition ),
+ constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
+ Source( mSourceActor, Actor::Property::WORLD_POSITION ),
CameraActorPositionConstraint(stageSize, mDefaultCameraDistance) );
mCameraActor.ApplyConstraint(constraint);
// Apply constraint to render-task viewport position
- constraint = Constraint::New<Vector2>( RenderTask::Property::ViewportPosition,
- Source( self, Actor::Property::WorldPosition ),//mPropertySourcePosition ),
- Source( self, Actor::Property::Size ),
- Source( self, Actor::Property::WorldScale ),
+ constraint = Constraint::New<Vector2>( RenderTask::Property::VIEWPORT_POSITION,
+ Source( self, Actor::Property::WORLD_POSITION ),//mPropertySourcePosition ),
+ Source( self, Actor::Property::SIZE ),
+ Source( self, Actor::Property::WORLD_SCALE ),
RenderTaskViewportPositionConstraint(stageSize) );
mTask.ApplyConstraint(constraint);
// Apply constraint to render-task viewport position
- constraint = Constraint::New<Vector2>( RenderTask::Property::ViewportSize,
- Source( self, Actor::Property::Size ),
- Source( self, Actor::Property::WorldScale ),
+ constraint = Constraint::New<Vector2>( RenderTask::Property::VIEWPORT_SIZE,
+ Source( self, Actor::Property::SIZE ),
+ Source( self, Actor::Property::WORLD_SCALE ),
RenderTaskViewportSizeConstraint() );
mTask.ApplyConstraint(constraint);
}
mFrame.SetPositionInheritanceMode(DONT_INHERIT_POSITION);
mFrame.SetInheritScale(true);
- Constraint constraint = Constraint::New<Vector3>( Actor::Property::Position,
- ParentSource( Actor::Property::WorldPosition ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
+ ParentSource( Actor::Property::WORLD_POSITION ),
EqualToConstraint() );
mFrame.ApplyConstraint( constraint );
#include <dali/public-api/animation/animation.h>
#include <dali/public-api/events/key-event.h>
#include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/focus-manager/focus-manager.h>
#include <dali-toolkit/internal/controls/navigation-frame/navigation-tool-bar.h>
#include <dali-toolkit/internal/controls/navigation-frame/navigation-title-bar.h>
#include <dali-toolkit/internal/controls/relayout-controller.h>
-#include <dali-toolkit/public-api/focus-manager/focus-manager.h>
namespace Dali
{
namespace // to register type
{
-// Actions
-
-const char* const ACTION_PUSH = "push";
-const char* const ACTION_POP = "pop";
-
BaseHandle Create()
{
return Toolkit::NavigationControl::New();
}
-TypeRegistration mType( typeid( Toolkit::NavigationControl ), typeid( Toolkit::Control ), Create );
+// Setup properties, signals and actions using the type-registry.
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::NavigationControl, Toolkit::Control, Create )
+
+DALI_ACTION_REGISTRATION( NavigationControl, "push", ACTION_PUSH )
+DALI_ACTION_REGISTRATION( NavigationControl, "pop", ACTION_POP )
-TypeAction a1( mType, ACTION_PUSH, &NavigationControl::DoAction );
-TypeAction a2( mType, ACTION_POP, &NavigationControl::DoAction );
+DALI_TYPE_REGISTRATION_END()
}
// EXTERNAL INCLUDES
#include <dali/public-api/object/type-registry.h>
-
-// INTERNAL INCLUDES
+#include <dali/public-api/object/type-registry-helper.h>
namespace Dali
{
return Toolkit::Page::New();
}
-TypeRegistration mType( typeid(Toolkit::Page), typeid(CustomActor), Create );
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::Page, Toolkit::Control, Create )
+DALI_TYPE_REGISTRATION_END()
} // unnamed namespace
// EXTERNAL INCLUDES
#include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
namespace Dali
{
namespace
{
using namespace Dali;
-TypeRegistration mType( typeid(Toolkit::PageTurnLandscapeView), typeid(Toolkit::PageTurnView), NULL );
+
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::PageTurnLandscapeView, Toolkit::PageTurnView, NULL )
+DALI_TYPE_REGISTRATION_END()
+
}
PageTurnLandscapeView::PageTurnLandscapeView( PageFactory& pageFactory, const Vector2& pageSize )
// EXTERNAL INCLUDES
#include <dali/public-api/animation/animation.h>
#include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
namespace Dali
{
namespace
{
using namespace Dali;
-TypeRegistration mType( typeid(Toolkit::PageTurnPortraitView), typeid(Toolkit::PageTurnView), NULL );
+
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::PageTurnPortraitView, Toolkit::PageTurnView, NULL )
+DALI_TYPE_REGISTRATION_END()
// the panning speed threshold, no matter how far is the pan displacement, pan fast to left/right quickly (speed > 0.3) will turn over/back the page
const float GESTURE_SPEED_THRESHOLD(0.3f);
// the animation duration of turning the previous page back when an outwards flick is detected
const float PAGE_TURN_OVER_ANIMATION_DURATION(0.5f);
+
}
PageTurnPortraitView::PageTurnPortraitView( PageFactory& pageFactory, const Vector2& pageSize )
animation.AnimateTo( Property( mTurnEffect[mIndex], mTurnEffect[mIndex].PageTurnEffect::GetCurrentCenterPropertyName() ),
originalCenter,
AlphaFunctions::EaseOut, PAGE_TURN_OVER_ANIMATION_DURATION*0.75f );
- animation.AnimateBy( Property( actor, Actor::Property::Rotation ), AngleAxis( Degree( 180.0f ), Vector3::YAXIS ) ,AlphaFunctions::EaseOut );
+ animation.AnimateBy( Property( actor, Actor::Property::ROTATION ), AngleAxis( Degree( 180.0f ), Vector3::YAXIS ) ,AlphaFunctions::EaseOut );
animation.Play();
ImageActor::DownCast(actor).SetCullFace( CullBack );
animation.FinishedSignal().Connect( this, &PageTurnPortraitView::OnTurnedOver );
#include <dali/public-api/animation/constraint.h>
#include <dali/public-api/events/hit-test-algorithm.h>
#include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/public-api/render-tasks/render-task-list.h>
// INTERNAL INCLUDES
using namespace Dali;
-namespace //unnamed namespace
+namespace //Unnamed namespace
{
// To register type
-TypeRegistration mType( typeid(Toolkit::PageTurnView), typeid(Toolkit::Control), NULL );
+
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::PageTurnView, Toolkit::Control, NULL )
+DALI_TYPE_REGISTRATION_END()
// default grid density for page turn effect, 10 pixels by 10 pixels
const float DEFAULT_GRID_DENSITY(10.0f);
for( int i = 0; i < MAXIMUM_TURNING_NUM; i++ )
{
mTurnEffect[i] = Toolkit::PageTurnEffect::New( false );
- mTurnEffect[i].SetProperty( ShaderEffect::Property::GridDensity, Property::Value( DEFAULT_GRID_DENSITY ) );
+ mTurnEffect[i].SetProperty( ShaderEffect::Property::GRID_DENSITY, Property::Value( DEFAULT_GRID_DENSITY ) );
mTurnEffect[i].SetPageSize( mPageSize );
mTurnEffect[i].SetShadowWidth(0.f);
mTurnEffect[i].SetSpineShadowParameter( mSpineShadowParameter );
GetImpl( mTurnEffect[mIndex] ).ApplyInternalConstraint();
float distance = offset.Length();
- Constraint rotationConstraint = Constraint::New<Quaternion>( Actor::Property::Rotation,
+ Constraint rotationConstraint = Constraint::New<Quaternion>( Actor::Property::ROTATION,
Source( self, mPropertyPanDisplacement[mIndex] ),
RotationConstraint(distance, mPageSize.width, mIsTurnBack[mPanActor]));
mPanActor.ApplyConstraint( rotationConstraint );
#include <dali/public-api/common/stage.h>
#include <dali/public-api/events/key-event.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/public-api/object/type-registry-helper.h>
#include <dali/integration-api/debug.h>
-#include <dali/public-api/images/resource-image.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/buttons/button.h>
-#include <dali-toolkit/public-api/controls/default-controls/solid-color-actor.h>
#include <dali-toolkit/public-api/controls/control-impl.h>
+#include <dali-toolkit/public-api/controls/default-controls/solid-color-actor.h>
+#include <dali-toolkit/public-api/focus-manager/focus-manager.h>
#include <dali-toolkit/internal/controls/relayout-helper.h>
#include <dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.h>
-#include <dali-toolkit/public-api/focus-manager/focus-manager.h>
using namespace Dali;
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace Internal
+{
+
namespace
{
+
+BaseHandle Create()
+{
+ return Toolkit::Popup::New();
+}
+
+// Setup properties, signals and actions using the type-registry.
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::Popup, Toolkit::Control, Create )
+
+DALI_SIGNAL_REGISTRATION( Popup, "touched-outside", SIGNAL_TOUCHED_OUTSIDE )
+DALI_SIGNAL_REGISTRATION( Popup, "hidden", SIGNAL_HIDDEN )
+
+DALI_TYPE_REGISTRATION_END()
+
+// Properties
+const char* const PROPERTY_TITLE = "title";
+const char* const PROPERTY_STATE = "state";
+
const float CONTENT_DEPTH = 1.0f; ///< 3D Effect of buttons/title etc. appearing off the popup.
const float POPUP_ANIMATION_DURATION = 0.5f; ///< Duration of hide/show animations
const float BACKING_DEPTH = -1.0f; ///< Depth of backing (positioned just behind dialog, so dialog catches hit events first)
const Vector3 DEFAULT_DIALOG_SIZE = Vector3(POPUP_TITLE_WIDTH/POPUP_WIDTH, 0.5f, 0.0f);
const Vector3 DEFAULT_BOTTOM_SIZE = Vector3(1.0f, 0.2f, 0.0f);
-// Signals
-
-const char* const SIGNAL_TOUCHED_OUTSIDE = "touched-outside";
-const char* const SIGNAL_HIDDEN = "hidden";
-
-// Properties
-
-const char* const PROPERTY_TITLE = "title";
-const char* const PROPERTY_STATE = "state";
-
/**
* The background size should be at least as big as the Dialog.
* In some cases a background may have graphics which are visible
} // unnamed namespace
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-namespace
-{
-
-BaseHandle Create()
-{
- return Toolkit::Popup::New();
-}
-
-TypeRegistration typeRegistration( typeid( Toolkit::Popup ), typeid( Toolkit::Control ), Create );
-
-SignalConnectorType signalConnector1( typeRegistration, SIGNAL_TOUCHED_OUTSIDE, &Popup::DoConnectSignal );
-SignalConnectorType signalConnector2( typeRegistration, SIGNAL_HIDDEN, &Popup::DoConnectSignal );
-
-
-}
-
-
///////////////////////////////////////////////////////////////////////////////////////////////////
// Popup
///////////////////////////////////////////////////////////////////////////////////////////////////
if(mShowing)
{
- mAnimation.AnimateTo( Property(mBacking, Actor::Property::ColorAlpha), targetBackingAlpha, AlphaFunctions::EaseInOut, TimePeriod(0.0f, duration * 0.5f) );
- mAnimation.AnimateTo( Property(mPopupBg, Actor::Property::Scale), targetSize, AlphaFunctions::EaseInOut, TimePeriod(duration * 0.5f, duration * 0.5f) );
+ mAnimation.AnimateTo( Property(mBacking, Actor::Property::COLOR_ALPHA), targetBackingAlpha, AlphaFunctions::EaseInOut, TimePeriod(0.0f, duration * 0.5f) );
+ mAnimation.AnimateTo( Property(mPopupBg, Actor::Property::SCALE), targetSize, AlphaFunctions::EaseInOut, TimePeriod(duration * 0.5f, duration * 0.5f) );
}
else
{
- mAnimation.AnimateTo( Property(mBacking, Actor::Property::ColorAlpha), targetBackingAlpha, AlphaFunctions::EaseInOut, TimePeriod(0.0f, duration * 0.5f) );
- mAnimation.AnimateTo( Property(mPopupBg, Actor::Property::Scale), targetSize, AlphaFunctions::EaseInOut, TimePeriod(0.0f, duration * 0.5f) );
+ mAnimation.AnimateTo( Property(mBacking, Actor::Property::COLOR_ALPHA), targetBackingAlpha, AlphaFunctions::EaseInOut, TimePeriod(0.0f, duration * 0.5f) );
+ mAnimation.AnimateTo( Property(mPopupBg, Actor::Property::SCALE), targetSize, AlphaFunctions::EaseInOut, TimePeriod(0.0f, duration * 0.5f) );
}
mAnimation.Play();
mAnimation.FinishedSignal().Connect(this, &Popup::OnStateAnimationFinished);
#include <dali/public-api/animation/constraint.h>
#include <dali/public-api/animation/constraints.h>
#include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/public-api/images/resource-image.h>
// INTERNAL INCLUDES
namespace Toolkit
{
-const Property::Index ScrollBar::PROPERTY_INDICATOR_HEIGHT_POLICY( Internal::ScrollBar::SCROLLBAR_PROPERTY_START_INDEX );
-const Property::Index ScrollBar::PROPERTY_INDICATOR_FIXED_HEIGHT( Internal::ScrollBar::SCROLLBAR_PROPERTY_START_INDEX + 1 );
-const Property::Index ScrollBar::PROPERTY_INDICATOR_SHOW_DURATION( Internal::ScrollBar::SCROLLBAR_PROPERTY_START_INDEX + 2 );
-const Property::Index ScrollBar::PROPERTY_INDICATOR_HIDE_DURATION( Internal::ScrollBar::SCROLLBAR_PROPERTY_START_INDEX + 3 );
-
namespace Internal
{
using namespace Dali;
-const char* INDICATOR_HEIGHT_POLICY_NAME[] = {"Variable", "Fixed"};
-
BaseHandle Create()
{
return Toolkit::ScrollBar::New();
}
-TypeRegistration typeRegistration( typeid( Toolkit::ScrollBar ), typeid( Toolkit::ScrollComponent ), Create );
+// Setup properties, signals and actions using the type-registry.
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::ScrollBar, Toolkit::ScrollComponent, Create );
+
+DALI_PROPERTY_REGISTRATION( ScrollBar, "indicator-height-policy", STRING, INDICATOR_HEIGHT_POLICY )
+DALI_PROPERTY_REGISTRATION( ScrollBar, "indicator-fixed-height", FLOAT, INDICATOR_FIXED_HEIGHT )
+DALI_PROPERTY_REGISTRATION( ScrollBar, "indicator-show-duration", FLOAT, INDICATOR_SHOW_DURATION )
+DALI_PROPERTY_REGISTRATION( ScrollBar, "indicator-hide-duration", FLOAT, INDICATOR_HIDE_DURATION )
-const char* const SCROLL_POSITION_NOTIFIED_SIGNAL_NAME = "scroll-position-notified";
+DALI_SIGNAL_REGISTRATION( ScrollBar, "scroll-position-notified", SCROLL_POSITION_NOTIFIED_SIGNAL )
+
+DALI_TYPE_REGISTRATION_END()
+
+const char* INDICATOR_HEIGHT_POLICY_NAME[] = {"Variable", "Fixed"};
-PropertyRegistration property1( typeRegistration, "indicator-height-policy", Toolkit::ScrollBar::PROPERTY_INDICATOR_HEIGHT_POLICY, Property::STRING, &ScrollBar::SetProperty, &ScrollBar::GetProperty );
-PropertyRegistration property2( typeRegistration, "indicator-fixed-height", Toolkit::ScrollBar::PROPERTY_INDICATOR_FIXED_HEIGHT, Property::FLOAT, &ScrollBar::SetProperty, &ScrollBar::GetProperty );
-PropertyRegistration property3( typeRegistration, "indicator-show-duration", Toolkit::ScrollBar::PROPERTY_INDICATOR_SHOW_DURATION, Property::FLOAT, &ScrollBar::SetProperty, &ScrollBar::GetProperty );
-PropertyRegistration property4( typeRegistration, "indicator-hide-duration", Toolkit::ScrollBar::PROPERTY_INDICATOR_HIDE_DURATION, Property::FLOAT, &ScrollBar::SetProperty, &ScrollBar::GetProperty );
}
ScrollBar::ScrollBar()
mIndicator.RemoveConstraint(mIndicatorPositionConstraint);
}
- constraint = Constraint::New<Vector3>( Actor::Property::Position,
- LocalSource( Actor::Property::Size ),
- ParentSource( Actor::Property::Size ),
+ constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
+ LocalSource( Actor::Property::SIZE ),
+ ParentSource( Actor::Property::SIZE ),
Source( mScrollPositionObject, Toolkit::ScrollConnector::SCROLL_POSITION ),
IndicatorPositionConstraint( mScrollConnector.GetMinLimit(), mScrollConnector.GetMaxLimit() ) );
mIndicatorPositionConstraint = mIndicator.ApplyConstraint( constraint );
bool connected( true );
Toolkit::ScrollBar scrollBar = Toolkit::ScrollBar::DownCast( handle );
- if( 0 == strcmp( signalName.c_str(), SCROLL_POSITION_NOTIFIED_SIGNAL_NAME ) )
+ if( 0 == strcmp( signalName.c_str(), SCROLL_POSITION_NOTIFIED_SIGNAL ) )
{
scrollBar.ScrollPositionNotifiedSignal().Connect( tracker, functor );
}
ScrollBar& scrollBarImpl( GetImpl( scrollBar ) );
switch( index )
{
- case Toolkit::ScrollBar::PROPERTY_INDICATOR_HEIGHT_POLICY:
+ case Toolkit::ScrollBar::Property::INDICATOR_HEIGHT_POLICY:
{
scrollBarImpl.OnIndicatorHeightPolicyPropertySet( value );
break;
}
- case Toolkit::ScrollBar::PROPERTY_INDICATOR_FIXED_HEIGHT:
+ case Toolkit::ScrollBar::Property::INDICATOR_FIXED_HEIGHT:
{
scrollBarImpl.SetIndicatorFixedHeight(value.Get<float>());
break;
}
- case Toolkit::ScrollBar::PROPERTY_INDICATOR_SHOW_DURATION:
+ case Toolkit::ScrollBar::Property::INDICATOR_SHOW_DURATION:
{
scrollBarImpl.SetIndicatorShowDuration(value.Get<float>());
break;
}
- case Toolkit::ScrollBar::PROPERTY_INDICATOR_HIDE_DURATION:
+ case Toolkit::ScrollBar::Property::INDICATOR_HIDE_DURATION:
{
scrollBarImpl.SetIndicatorHideDuration(value.Get<float>());
break;
ScrollBar& scrollBarImpl( GetImpl( scrollBar ) );
switch( index )
{
- case Toolkit::ScrollBar::PROPERTY_INDICATOR_HEIGHT_POLICY:
+ case Toolkit::ScrollBar::Property::INDICATOR_HEIGHT_POLICY:
{
value = INDICATOR_HEIGHT_POLICY_NAME[ scrollBarImpl.GetIndicatorHeightPolicy() ];
break;
}
- case Toolkit::ScrollBar::PROPERTY_INDICATOR_FIXED_HEIGHT:
+ case Toolkit::ScrollBar::Property::INDICATOR_FIXED_HEIGHT:
{
value = scrollBarImpl.GetIndicatorFixedHeight();
break;
}
- case Toolkit::ScrollBar::PROPERTY_INDICATOR_SHOW_DURATION:
+ case Toolkit::ScrollBar::Property::INDICATOR_SHOW_DURATION:
{
value = scrollBarImpl.GetIndicatorShowDuration();
break;
}
- case Toolkit::ScrollBar::PROPERTY_INDICATOR_HIDE_DURATION:
+ case Toolkit::ScrollBar::Property::INDICATOR_HIDE_DURATION:
{
value = scrollBarImpl.GetIndicatorHideDuration();
break;
public:
- // Properties
- enum
- {
- SCROLLBAR_PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
- SCROLLBAR_PROPERTY_END_INDEX = SCROLLBAR_PROPERTY_START_INDEX + 1000 ///< Reserving 1000 property indices
- };
-
// Signals
typedef Toolkit::ScrollBar::ScrollPositionNotifiedSignalType ScrollPositionNotifiedSignalType;
#include <dali/public-api/animation/constraint.h>
#include <dali/public-api/object/property-input.h>
#include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/public-api/images/resource-image.h>
// INTERNAL INCLUDES
return BaseHandle();
}
-TypeRegistration mType( typeid(Toolkit::ScrollBarInternal), typeid(Toolkit::ScrollComponent), Create );
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::ScrollBarInternal, Toolkit::ScrollComponent, Create )
+DALI_TYPE_REGISTRATION_END()
}
// target the container to observe for scrolling
Actor target = mContainer.Self();
- Constraint constraint = Constraint::New<bool>( Actor::Property::Visible,
+ Constraint constraint = Constraint::New<bool>( Actor::Property::VISIBLE,
Source( target, vertical ? target.GetPropertyIndex(Scrollable::SCROLLABLE_CAN_SCROLL_VERTICAL) : target.GetPropertyIndex(Scrollable::SCROLLABLE_CAN_SCROLL_HORIZONTAL)),
ScrollBarInternalVisibilityConstraint );
mSlider.ApplyConstraint( constraint );
mSliderWrap.ApplyConstraint( constraint );
- constraint = Constraint::New<Vector3>( Actor::Property::Size,
+ constraint = Constraint::New<Vector3>( Actor::Property::SIZE,
Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_DIRECTION_PROPERTY_NAME ) ),
- Source( target, Actor::Property::Size ),
+ Source( target, Actor::Property::SIZE ),
ScrollBarInternalSizeConstraint( vertical ) );
mSlider.ApplyConstraint( constraint );
mSliderWrap.ApplyConstraint( constraint );
- constraint = Constraint::New<Quaternion>( Actor::Property::Rotation,
+ constraint = Constraint::New<Quaternion>( Actor::Property::ROTATION,
Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_DIRECTION_PROPERTY_NAME ) ),
ScrollBarInternalRotationConstraint( vertical ) );
mSlider.ApplyConstraint( constraint );
mSliderWrap.ApplyConstraint( constraint );
- constraint = Constraint::New<Vector3>( Actor::Property::Position,
- Source( mSlider, Actor::Property::Size),
+ constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
+ Source( mSlider, Actor::Property::SIZE),
Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_RELATIVE_POSITION_PROPERTY_NAME ) ),
Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_DIRECTION_PROPERTY_NAME ) ),
- Source( target, Actor::Property::Size ),
+ Source( target, Actor::Property::SIZE ),
ScrollBarInternalPositionConstraint(vertical) );
mSlider.ApplyConstraint( constraint );
- constraint = Constraint::New<Vector3>( Actor::Property::Position,
- Source( mSlider, Actor::Property::Size),
+ constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
+ Source( mSlider, Actor::Property::SIZE),
Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_RELATIVE_POSITION_PROPERTY_NAME ) ),
Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_DIRECTION_PROPERTY_NAME ) ),
- Source( target, Actor::Property::Size ),
+ Source( target, Actor::Property::SIZE ),
ScrollBarInternalPositionConstraint(vertical, true) );
mSliderWrap.ApplyConstraint( constraint );
mHitArea.SetPosition(0.0f, 0.0f, 0.2f);
mContainer.AddOverlay( mHitArea );
- constraint = Constraint::New<Vector3>( Actor::Property::Size,
+ constraint = Constraint::New<Vector3>( Actor::Property::SIZE,
Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_DIRECTION_PROPERTY_NAME ) ),
- Source( target, Actor::Property::Size ),
+ Source( target, Actor::Property::SIZE ),
ScrollBarInternalHitSizeConstraint(vertical, BAR_TAB_SIZE.width) );
mHitArea.ApplyConstraint( constraint );
for( size_t i=0;i<NUM_LAYERS;i++ )
{
size_t j=i*4;
- mesh.ApplyConstraint( Constraint::New<Vector3>( mesh.GetPropertyIndex(j+2, AnimatableVertex::Property::Position ),
+ mesh.ApplyConstraint( Constraint::New<Vector3>( mesh.GetPropertyIndex(j+2, AnimatableVertex::Property::POSITION ),
Source(meshActor, bouncePropertyIndex),
VertexPositionConstraint(-0.5f, LAYER_HEIGHTS[i]) ) );
- mesh.ApplyConstraint( Constraint::New<Vector3>( mesh.GetPropertyIndex(j+3, AnimatableVertex::Property::Position),
+ mesh.ApplyConstraint( Constraint::New<Vector3>( mesh.GetPropertyIndex(j+3, AnimatableVertex::Property::POSITION),
Source(meshActor, bouncePropertyIndex),
VertexPositionConstraint(-0.5f, LAYER_HEIGHTS[i]) ) );
}
#include <dali/public-api/events/mouse-wheel-event.h>
#include <dali/public-api/events/touch-event.h>
#include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/scrollable/item-view/item-factory.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-connector-impl.h>
#include <dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.h>
+#include <dali-toolkit/internal/controls/scrollable/scroll-connector-impl.h>
using std::string;
using std::set;
using namespace Dali;
-namespace // unnamed namespace
+namespace // Unnamed namespace
{
//Type registration
-TypeRegistration mType( typeid(Toolkit::ItemView), typeid(Toolkit::Scrollable), NULL );
+
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::ItemView, Toolkit::Scrollable, NULL )
+DALI_TYPE_REGISTRATION_END()
const float DEFAULT_MINIMUM_SWIPE_SPEED = 1.0f;
const float DEFAULT_MINIMUM_SWIPE_DISTANCE = 3.0f;
LocalSource(mPropertyPosition),
LocalSource(mPropertyPositionMin),
LocalSource(mPropertyPositionMax),
- LocalSource(Actor::Property::Size),
+ LocalSource(Actor::Property::SIZE),
RelativePositionConstraint);
self.ApplyConstraint(constraint);
mOvershootOverlay.SetDrawMode(DrawMode::OVERLAY);
self.Add(mOvershootOverlay);
- Constraint constraint = Constraint::New<Vector3>( Actor::Property::Size,
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::SIZE,
ParentSource( mPropertyScrollDirection ),
Source( mScrollPositionObject, ScrollConnector::OVERSHOOT ),
- ParentSource( Actor::Property::Size ),
+ ParentSource( Actor::Property::SIZE ),
OvershootOverlaySizeConstraint() );
mOvershootOverlay.ApplyConstraint(constraint);
mOvershootOverlay.SetSize(OVERSHOOT_BOUNCE_ACTOR_DEFAULT_SIZE.width, OVERSHOOT_BOUNCE_ACTOR_DEFAULT_SIZE.height);
- constraint = Constraint::New<Quaternion>( Actor::Property::Rotation,
+ constraint = Constraint::New<Quaternion>( Actor::Property::ROTATION,
ParentSource( mPropertyScrollDirection ),
Source( mScrollPositionObject, ScrollConnector::OVERSHOOT ),
OvershootOverlayRotationConstraint() );
mOvershootOverlay.ApplyConstraint(constraint);
- constraint = Constraint::New<Vector3>( Actor::Property::Position,
- ParentSource( Actor::Property::Size ),
+ constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
+ ParentSource( Actor::Property::SIZE ),
ParentSource( mPropertyScrollDirection ),
Source( mScrollPositionObject, ScrollConnector::OVERSHOOT ),
OvershootOverlayPositionConstraint() );
mOvershootOverlay.ApplyConstraint(constraint);
- constraint = Constraint::New<bool>( Actor::Property::Visible,
+ constraint = Constraint::New<bool>( Actor::Property::VISIBLE,
ParentSource( mPropertyCanScrollVertical ),
OvershootOverlayVisibilityConstraint() );
mOvershootOverlay.ApplyConstraint(constraint);
// EXTERNAL INCLUDES
#include <dali/public-api/object/property-index-ranges.h>
#include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/integration-api/debug.h>
namespace Dali
namespace
{
-// Signals
+// Setup properties, signals and actions using the type-registry.
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::ScrollConnector, Dali::BaseHandle, NULL )
-const char* const DOMAIN_CHANGED_SIGNAL_NAME = "domain-changed";
-const char* const SCROLL_POSITION_CHANGED_SIGNAL_NAME = "scroll-position-changed";
+DALI_SIGNAL_REGISTRATION( ScrollConnector, "domain-changed", DOMAIN_CHANGED_SIGNAL_NAME )
+DALI_SIGNAL_REGISTRATION( ScrollConnector, "scroll-position-changed", SCROLL_POSITION_CHANGED_SIGNAL_NAME )
-TypeRegistration typeRegistration( typeid( Toolkit::ScrollConnector ), typeid( Dali::BaseHandle ), NULL );
-
-SignalConnectorType signalConnector1( typeRegistration, DOMAIN_CHANGED_SIGNAL_NAME , &ScrollConnector::DoConnectSignal );
-SignalConnectorType signalConnector2( typeRegistration, SCROLL_POSITION_CHANGED_SIGNAL_NAME , &ScrollConnector::DoConnectSignal );
+DALI_TYPE_REGISTRATION_END()
}
// ScrollBase
///////////////////////////////////////////////////////////////////////////////////////////////////
-const std::string ScrollBase::SCROLL_DOMAIN_OFFSET_PROPERTY_NAME( "domain-offset" );
+const char* const ScrollBase::SCROLL_DOMAIN_OFFSET_PROPERTY_NAME = "domain-offset";
ScrollBase::ScrollBase()
: Scrollable(),
protected:
- static const std::string SCROLL_DOMAIN_OFFSET_PROPERTY_NAME;
+ static const char* const SCROLL_DOMAIN_OFFSET_PROPERTY_NAME;
protected:
UpdateVisibility(true);
}
- float overshootAnimationSpeed = mAttachedScrollView.Self().GetProperty<float>(Toolkit::Scrollable::PROPERTY_OVERSHOOT_ANIMATION_SPEED);
+ float overshootAnimationSpeed = mAttachedScrollView.Self().GetProperty<float>(Toolkit::Scrollable::Property::OVERSHOOT_ANIMATION_SPEED);
if( animate && overshootAnimationSpeed > Math::MACHINE_EPSILON_0 )
{
// Apply constraints to this actor //
Constraint constraint;
- constraint = Constraint::New<bool>( Actor::Property::Visible,
- LocalSource( Actor::Property::Position ),
- LocalSource( Actor::Property::Scale ),
- LocalSource( Actor::Property::Size ),
+ constraint = Constraint::New<bool>( Actor::Property::VISIBLE,
+ LocalSource( Actor::Property::POSITION ),
+ LocalSource( Actor::Property::SCALE ),
+ LocalSource( Actor::Property::SIZE ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ),
- Source(scrollView, Actor::Property::Size ),
+ Source(scrollView, Actor::Property::SIZE ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollViewCarouselEffect::EFFECT_ACTIVATE ) ),
boost::bind( &ScrollCarouselEffectInfo::VisibilityConstraint, info, _1, _2, _3, _4, _5, _6) );
constraint.SetRemoveAction( Constraint::Discard );
child.ApplyConstraint( constraint );
- constraint = Constraint::New<Quaternion>( Actor::Property::Rotation,
- LocalSource( Actor::Property::Position ),
- LocalSource( Actor::Property::Scale ),
- LocalSource( Actor::Property::Size ),
+ constraint = Constraint::New<Quaternion>( Actor::Property::ROTATION,
+ LocalSource( Actor::Property::POSITION ),
+ LocalSource( Actor::Property::SCALE ),
+ LocalSource( Actor::Property::SIZE ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ),
- Source(scrollView, Actor::Property::Size ),
+ Source(scrollView, Actor::Property::SIZE ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollViewCarouselEffect::EFFECT_ACTIVATE ) ),
boost::bind( &ScrollCarouselEffectInfo::RotationConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
constraint.SetRemoveAction( Constraint::Discard );
child.ApplyConstraint( constraint );
- constraint = Constraint::New<Vector3>( Actor::Property::Position,
- LocalSource( Actor::Property::Scale ),
- LocalSource( Actor::Property::Size ),
+ constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
+ LocalSource( Actor::Property::SCALE ),
+ LocalSource( Actor::Property::SIZE ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ),
- Source(scrollView, Actor::Property::Size ),
+ Source(scrollView, Actor::Property::SIZE ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollViewCarouselEffect::EFFECT_ACTIVATE ) ),
boost::bind( &ScrollCarouselEffectInfo::PositionConstraint, info, _1, _2, _3, _4, _5, _6) );
{
// Apply constraints to this actor //
Constraint constraint;
- constraint = Constraint::New<Quaternion>( Actor::Property::Rotation,
- Source(parentPage, Actor::Property::Position),
+ constraint = Constraint::New<Quaternion>( Actor::Property::ROTATION,
+ Source(parentPage, Actor::Property::POSITION),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
- Source(scrollView, Actor::Property::Size ),
+ Source(scrollView, Actor::Property::SIZE ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
boost::bind( &ScrollCubeEffectInfo::RotationConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
constraint.SetRemoveAction( Constraint::Discard );
child.ApplyConstraint( constraint );
- constraint = Constraint::New<Vector4>( Actor::Property::Color,
- Source(parentPage, Actor::Property::Position),
+ constraint = Constraint::New<Vector4>( Actor::Property::COLOR,
+ Source(parentPage, Actor::Property::POSITION),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
- Source(scrollView, Actor::Property::Size ),
+ Source(scrollView, Actor::Property::SIZE ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
boost::bind( &ScrollCubeEffectInfo::ColorConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
constraint.SetRemoveAction( Constraint::Discard );
child.ApplyConstraint( constraint );
- constraint = Constraint::New<Vector3>( Actor::Property::Position,
- Source(parentPage, Actor::Property::Position),
+ constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
+ Source(parentPage, Actor::Property::POSITION),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
- Source(scrollView, Actor::Property::Size ),
+ Source(scrollView, Actor::Property::SIZE ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
boost::bind( &ScrollCubeEffectInfo::PositionConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
float scaleExtent)
{
// Scale Constraint
- Constraint constraint = Constraint::New<Vector3>( Actor::Property::Scale,
- LocalSource(Actor::Property::Position),
- ParentSource(Actor::Property::Position),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::SCALE,
+ LocalSource(Actor::Property::POSITION),
+ ParentSource(Actor::Property::POSITION),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
- Source(scrollView, Actor::Property::Size ),
+ Source(scrollView, Actor::Property::SIZE ),
ScrollDepthScaleConstraint( positionExtent, offsetExtent, positionScale, scaleExtent ) );
constraint.SetRemoveAction( Constraint::Discard );
child.ApplyConstraint( constraint );
// Position Constraint (apply last as other constraints use Actor::POSITION as a function input)
- constraint = Constraint::New<Vector3>( Actor::Property::Position,
- ParentSource(Actor::Property::Position),
+ constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
+ ParentSource(Actor::Property::POSITION),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
- Source(scrollView, Actor::Property::Size ),
+ Source(scrollView, Actor::Property::SIZE ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
ScrollDepthPositionConstraint( positionExtent, offsetExtent, positionScale ) );
#include <dali/public-api/events/mouse-wheel-event.h>
#include <dali/public-api/events/touch-event.h>
#include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-constraints.h>
#include <dali-toolkit/public-api/controls/scrollable/scroll-component-impl.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
+#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-constraints.h>
#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-overshoot-indicator-impl.h>
+#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
//#define ENABLED_SCROLL_STATE_LOGGING
namespace
{
-// Signals
-
-const char* const SIGNAL_SNAP_STARTED = "snap-started";
-
const Vector2 DEFAULT_MIN_FLICK_DISTANCE(30.0f, 30.0f); ///< minimum distance for pan before flick allowed
const float DEFAULT_MIN_FLICK_SPEED_THRESHOLD(500.0f); ///< Minimum pan speed required for flick in pixels/s
const float FREE_FLICK_SPEED_THRESHOLD = 200.0f; ///< Free-Flick threshold in pixels/ms
namespace
{
+BaseHandle Create()
+{
+ return Toolkit::ScrollView::New();
+}
+
+// Setup properties, signals and actions using the type-registry.
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::ScrollView, Toolkit::Scrollable, Create )
+
+DALI_SIGNAL_REGISTRATION( ScrollView, "value-changed", SIGNAL_SNAP_STARTED )
+
+DALI_TYPE_REGISTRATION_END()
+
/**
* Returns whether to lock scrolling to a particular axis
*
AlphaFunction mFunctionY;
};
-
-BaseHandle Create()
-{
- return Toolkit::ScrollView::New();
-}
-
-TypeRegistration typeRegistration( typeid( Toolkit::ScrollView ), typeid( Toolkit::Scrollable ), Create );
-
-SignalConnectorType signalConnector1( typeRegistration, SIGNAL_SNAP_STARTED, &ScrollView::DoConnectSignal );
-
}
mInternalActor = Actor::New();
mInternalActor.SetDrawMode(DrawMode::OVERLAY);
self.Add(mInternalActor);
- mInternalActor.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::Size, ParentSource( Actor::Property::Size ), EqualToConstraint() ) );
+ mInternalActor.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::SIZE, ParentSource( Actor::Property::SIZE ), EqualToConstraint() ) );
mInternalActor.SetParentOrigin(ParentOrigin::CENTER);
mInternalActor.SetAnchorPoint(AnchorPoint::CENTER);
if( mPanning )
{
constraint = Constraint::New<Vector3>( mPropertyPrePosition,
- Source( detector, PanGestureDetector::Property::LocalPosition ),
- Source( self, Actor::Property::Size ),
+ Source( detector, PanGestureDetector::Property::LOCAL_POSITION ),
+ Source( self, Actor::Property::SIZE ),
InternalPrePositionConstraint( mPanStartPosition, initialPanMask, mAxisAutoLock, mAxisAutoLockGradient, mLockAxis, mMaxOvershoot, mRulerX->GetDomain(), mRulerY->GetDomain() ) );
mScrollMainInternalPrePositionConstraint = self.ApplyConstraint( constraint );
}
LocalSource( mPropertyPrePosition ),
LocalSource( mPropertyPositionMin ),
LocalSource( mPropertyPositionMax ),
- Source( self, Actor::Property::Size ),
+ Source( self, Actor::Property::SIZE ),
InternalPositionConstraint( mRulerX->GetDomain(),
mRulerY->GetDomain(), mWrapMode ) );
mScrollMainInternalPositionConstraint = self.ApplyConstraint( constraint );
LocalSource( mPropertyPosition ),
LocalSource( mPropertyPositionMin ),
LocalSource( mPropertyPositionMax ),
- LocalSource( Actor::Property::Size ),
+ LocalSource( Actor::Property::SIZE ),
InternalRelativePositionConstraint );
mScrollMainInternalRelativeConstraint = self.ApplyConstraint( constraint );
Constraint constraint;
// MoveActor (scrolling)
- constraint = Constraint::New<Vector3>( Actor::Property::Position,
+ constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
Source( self, mPropertyPosition ),
MoveActorConstraint );
constraint.SetRemoveAction(Constraint::Discard);
ApplyConstraintToBoundActors(constraint);
// WrapActor (wrap functionality)
- constraint = Constraint::New<Vector3>( Actor::Property::Position,
- LocalSource( Actor::Property::Scale ),
- LocalSource( Actor::Property::AnchorPoint ),
- LocalSource( Actor::Property::Size ),
+ constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
+ LocalSource( Actor::Property::SCALE ),
+ LocalSource( Actor::Property::ANCHOR_POINT ),
+ LocalSource( Actor::Property::SIZE ),
Source( self, mPropertyPositionMin ),
Source( self, mPropertyPositionMax ),
Source( self, mPropertyWrap ),
{
// Apply constraints to this actor //
Constraint constraint;
- constraint = Constraint::New<Vector4>( Actor::Property::Color,
- LocalSource(Actor::Property::Position),
+ constraint = Constraint::New<Vector4>( Actor::Property::COLOR,
+ LocalSource(Actor::Property::POSITION),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
- Source(scrollView, Actor::Property::Size ),
+ Source(scrollView, Actor::Property::SIZE ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
boost::bind( &ScrollPageCarouselEffectInfo::ColorConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
constraint.SetRemoveAction( Constraint::Discard );
child.ApplyConstraint( constraint );
- constraint = Constraint::New<Vector3>( Actor::Property::Position,
- LocalSource(Actor::Property::Position),
+ constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
+ LocalSource(Actor::Property::POSITION),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
- Source(scrollView, Actor::Property::Size ),
+ Source(scrollView, Actor::Property::SIZE ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
boost::bind( &ScrollPageCarouselEffectInfo::PositionConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
{
// Apply constraints to this actor //
Constraint constraint;
- constraint = Constraint::New<Quaternion>( Actor::Property::Rotation,
- LocalSource(Actor::Property::Position),
+ constraint = Constraint::New<Quaternion>( Actor::Property::ROTATION,
+ LocalSource(Actor::Property::POSITION),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
- Source(scrollView, Actor::Property::Size ),
+ Source(scrollView, Actor::Property::SIZE ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
boost::bind( &ScrollPageCubeEffectInfo::RotationConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
constraint.SetRemoveAction( Constraint::Discard );
child.ApplyConstraint( constraint );
- constraint = Constraint::New<Vector4>( Actor::Property::Color,
- LocalSource(Actor::Property::Position),
+ constraint = Constraint::New<Vector4>( Actor::Property::COLOR,
+ LocalSource(Actor::Property::POSITION),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
- Source(scrollView, Actor::Property::Size ),
+ Source(scrollView, Actor::Property::SIZE ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
boost::bind( &ScrollPageCubeEffectInfo::ColorConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
constraint.SetRemoveAction( Constraint::Discard );
child.ApplyConstraint( constraint );
- constraint = Constraint::New<Vector3>( Actor::Property::Position,
- LocalSource(Actor::Property::Position),
+ constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
+ LocalSource(Actor::Property::POSITION),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
- Source(scrollView, Actor::Property::Size ),
+ Source(scrollView, Actor::Property::SIZE ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
boost::bind( &ScrollPageCubeEffectInfo::PositionConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
{
// Apply constraints to this actor //
Constraint constraint;
- constraint = Constraint::New<Quaternion>( Actor::Property::Rotation,
- LocalSource(Actor::Property::Position),
+ constraint = Constraint::New<Quaternion>( Actor::Property::ROTATION,
+ LocalSource(Actor::Property::POSITION),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
- Source(scrollView, Actor::Property::Size ),
+ Source(scrollView, Actor::Property::SIZE ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_START_PAGE_POSITION_PROPERTY_NAME ) ),
boost::bind( &ScrollPageSpiralEffectInfo::RotationConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
constraint.SetRemoveAction( Constraint::Discard );
child.ApplyConstraint( constraint );
- constraint = Constraint::New<Vector4>( Actor::Property::Color,
- LocalSource(Actor::Property::Position),
+ constraint = Constraint::New<Vector4>( Actor::Property::COLOR,
+ LocalSource(Actor::Property::POSITION),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
- Source(scrollView, Actor::Property::Size ),
+ Source(scrollView, Actor::Property::SIZE ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_START_PAGE_POSITION_PROPERTY_NAME ) ),
boost::bind( &ScrollPageSpiralEffectInfo::ColorConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
constraint.SetRemoveAction( Constraint::Discard );
child.ApplyConstraint( constraint );
- constraint = Constraint::New<Vector3>( Actor::Property::Position,
- LocalSource(Actor::Property::Position),
+ constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
+ LocalSource(Actor::Property::POSITION),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
- Source(scrollView, Actor::Property::Size ),
+ Source(scrollView, Actor::Property::SIZE ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_START_PAGE_POSITION_PROPERTY_NAME ) ),
boost::bind( &ScrollPageSpiralEffectInfo::PositionConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
// EXTERNAL INCLUDES
#include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/scrollable/scrollable-impl.h>
using namespace Dali;
-namespace
-{
-
-} // unnamed namespace
-
namespace Dali
{
namespace Toolkit
{
-const Property::Index Scrollable::PROPERTY_OVERSHOOT_EFFECT_COLOR( Toolkit::Internal::Control::CONTROL_PROPERTY_END_INDEX + 1 );
-const Property::Index Scrollable::PROPERTY_OVERSHOOT_ANIMATION_SPEED( Toolkit::Internal::Control::CONTROL_PROPERTY_END_INDEX + 2 );
-
namespace Internal
{
namespace
{
-const Vector4 DEFAULT_OVERSHOOT_COLOUR(0.0f, 0.64f, 0.85f, 0.25f);
-const float DEFAULT_OVERSHOOT_ANIMATION_SPEED(120.0f); // 120 pixels per second
-
-// Signals
-
-const char* const SIGNAL_SCROLL_STARTED = "scroll-started";
-const char* const SIGNAL_SCROLL_COMPLETED = "scroll-completed";
-const char* const SIGNAL_SCROLL_UPDATED = "scroll-updated";
BaseHandle Create()
{
return BaseHandle();
}
-TypeRegistration mType( typeid( Toolkit::Scrollable ), typeid( Toolkit::Control ), Create );
+// Setup properties, signals and actions using the type-registry.
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::Scrollable, Toolkit::Control, Create );
-SignalConnectorType s1( mType, SIGNAL_SCROLL_STARTED, &Scrollable::DoConnectSignal );
-SignalConnectorType s2( mType, SIGNAL_SCROLL_COMPLETED, &Scrollable::DoConnectSignal );
-SignalConnectorType s3( mType, SIGNAL_SCROLL_UPDATED, &Scrollable::DoConnectSignal );
+DALI_PROPERTY_REGISTRATION( Scrollable, "overshoot-effect-color", VECTOR4, OVERSHOOT_EFFECT_COLOR )
+DALI_PROPERTY_REGISTRATION( Scrollable, "overshoot-animation-speed", FLOAT, OVERSHOOT_ANIMATION_SPEED )
-PropertyRegistration property1( mType,
- "overshoot-effect-color",
- Toolkit::Scrollable::PROPERTY_OVERSHOOT_EFFECT_COLOR,
- Property::VECTOR4,
- &Scrollable::SetProperty,
- &Scrollable::GetProperty );
+DALI_SIGNAL_REGISTRATION( Scrollable, "scroll-started", SIGNAL_SCROLL_STARTED )
+DALI_SIGNAL_REGISTRATION( Scrollable, "scroll-completed", SIGNAL_SCROLL_COMPLETED )
+DALI_SIGNAL_REGISTRATION( Scrollable, "scroll-updated", SIGNAL_SCROLL_UPDATED )
-PropertyRegistration property2( mType,
- "overshoot-animation-speed",
- Toolkit::Scrollable::PROPERTY_OVERSHOOT_ANIMATION_SPEED,
- Property::FLOAT,
- &Scrollable::SetProperty,
- &Scrollable::GetProperty );
+DALI_TYPE_REGISTRATION_END()
+
+const Vector4 DEFAULT_OVERSHOOT_COLOUR(0.0f, 0.64f, 0.85f, 0.25f);
+const float DEFAULT_OVERSHOOT_ANIMATION_SPEED(120.0f); // 120 pixels per second
}
-const std::string Scrollable::SCROLLABLE_CAN_SCROLL_VERTICAL( "scrollable-can-scroll-vertical" );
-const std::string Scrollable::SCROLLABLE_CAN_SCROLL_HORIZONTAL( "scrollable-can-scroll-horizontal" );
+const char* const Scrollable::SCROLLABLE_CAN_SCROLL_VERTICAL = "scrollable-can-scroll-vertical";
+const char* const Scrollable::SCROLLABLE_CAN_SCROLL_HORIZONTAL = "scrollable-can-scroll-horizontal";
///////////////////////////////////////////////////////////////////////////////////////////////////
// Scrollable
Scrollable& scrollableImpl( GetImpl( scrollable ) );
switch( index )
{
- case Toolkit::Scrollable::PROPERTY_OVERSHOOT_EFFECT_COLOR:
+ case Toolkit::Scrollable::Property::OVERSHOOT_EFFECT_COLOR:
{
scrollableImpl.SetOvershootEffectColor( value.Get<Vector4>() );
break;
}
- case Toolkit::Scrollable::PROPERTY_OVERSHOOT_ANIMATION_SPEED:
+ case Toolkit::Scrollable::Property::OVERSHOOT_ANIMATION_SPEED:
{
scrollableImpl.SetOvershootAnimationSpeed( value.Get<float>() );
break;
Scrollable& scrollableImpl( GetImpl( scrollable ) );
switch( index )
{
- case Toolkit::Scrollable::PROPERTY_OVERSHOOT_EFFECT_COLOR:
+ case Toolkit::Scrollable::Property::OVERSHOOT_EFFECT_COLOR:
{
value = scrollableImpl.GetOvershootEffectColor();
break;
}
- case Toolkit::Scrollable::PROPERTY_OVERSHOOT_ANIMATION_SPEED:
+ case Toolkit::Scrollable::Property::OVERSHOOT_ANIMATION_SPEED:
{
value = scrollableImpl.GetOvershootAnimationSpeed();
break;
class Scrollable : public Control
{
public:
- static const std::string SCROLLABLE_CAN_SCROLL_VERTICAL;
- static const std::string SCROLLABLE_CAN_SCROLL_HORIZONTAL;
+ static const char* const SCROLLABLE_CAN_SCROLL_VERTICAL;
+ static const char* const SCROLLABLE_CAN_SCROLL_HORIZONTAL;
/**
* Create a new Scrollable.
#include <dali/public-api/animation/constraint.h>
#include <dali/public-api/common/stage.h>
#include <dali/public-api/object/type-registry.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>
return Toolkit::ShadowView::New();
}
-TypeRegistration mType( typeid(Toolkit::ShadowView), typeid(Toolkit::Control), Create );
-
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::ShadowView, Toolkit::Control, Create )
+DALI_TYPE_REGISTRATION_END()
const float BLUR_STRENGTH_DEFAULT = 1.0f;
const Vector4 DEFAULT_SHADOW_COLOR = Vector4(0.2f, 0.2f, 0.2f, 0.8f);
-const std::string SHADER_LIGHT_CAMERA_PROJECTION_MATRIX_PROPERTY_NAME( "uLightCameraProjectionMatrix" );
-const std::string SHADER_LIGHT_CAMERA_VIEW_MATRIX_PROPERTY_NAME( "uLightCameraViewMatrix" );
-const std::string SHADER_SHADOW_COLOR_PROPERTY_NAME( "uShadowColor" );
-
-const std::string BLUR_STRENGTH_PROPERTY_NAME( "BlurStrengthProperty" );
-const std::string SHADOW_COLOR_PROPERTY_NAME( "ShadowColorProperty" );
+const char* const SHADER_LIGHT_CAMERA_PROJECTION_MATRIX_PROPERTY_NAME = "uLightCameraProjectionMatrix";
+const char* const SHADER_LIGHT_CAMERA_VIEW_MATRIX_PROPERTY_NAME = "uLightCameraViewMatrix";
+const char* const SHADER_SHADOW_COLOR_PROPERTY_NAME = "uShadowColor";
+const char* const BLUR_STRENGTH_PROPERTY_NAME = "BlurStrengthProperty";
+const char* const SHADOW_COLOR_PROPERTY_NAME = "ShadowColorProperty";
const char* const RENDER_SHADOW_VERTEX_SOURCE =
" uniform mediump mat4 uLightCameraProjectionMatrix;\n"
// is under control of application, can't use transform inheritance)
Constraint cameraOrientationConstraint =
- Constraint::New<Quaternion> ( Actor::Property::Rotation,
- Source( mShadowPlane, Actor::Property::WorldPosition ),
- Source( mPointLight, Actor::Property::WorldPosition ),
- Source( mShadowPlane, Actor::Property::WorldRotation ),
+ Constraint::New<Quaternion> ( Actor::Property::ROTATION,
+ Source( mShadowPlane, Actor::Property::WORLD_POSITION ),
+ Source( mPointLight, Actor::Property::WORLD_POSITION ),
+ Source( mShadowPlane, Actor::Property::WORLD_ROTATION ),
&LookAt );
mCameraActor.ApplyConstraint( cameraOrientationConstraint );
- Constraint pointLightPositionConstraint = Constraint::New<Vector3>( Actor::Property::Position, Source( mPointLight, Actor::Property::WorldPosition ), EqualToConstraint() );
+ Constraint pointLightPositionConstraint = Constraint::New<Vector3>( Actor::Property::POSITION, Source( mPointLight, Actor::Property::WORLD_POSITION ), EqualToConstraint() );
mCameraActor.ApplyConstraint( pointLightPositionConstraint );
}
Property::Index lightCameraProjectionMatrixPropertyIndex = mShadowRenderShader.GetPropertyIndex(SHADER_LIGHT_CAMERA_PROJECTION_MATRIX_PROPERTY_NAME);
Property::Index lightCameraViewMatrixPropertyIndex = mShadowRenderShader.GetPropertyIndex(SHADER_LIGHT_CAMERA_VIEW_MATRIX_PROPERTY_NAME);
- Constraint projectionMatrixConstraint = Constraint::New<Dali::Matrix>( lightCameraProjectionMatrixPropertyIndex, Source( mCameraActor, CameraActor::Property::ProjectionMatrix ), EqualToConstraintMatrix());
- Constraint viewMatrixConstraint = Constraint::New<Dali::Matrix>( lightCameraViewMatrixPropertyIndex, Source( mCameraActor, CameraActor::Property::ViewMatrix ), EqualToConstraintMatrix());
+ Constraint projectionMatrixConstraint = Constraint::New<Dali::Matrix>( lightCameraProjectionMatrixPropertyIndex, Source( mCameraActor, CameraActor::Property::PROJECTION_MATRIX ), EqualToConstraintMatrix());
+ Constraint viewMatrixConstraint = Constraint::New<Dali::Matrix>( lightCameraViewMatrixPropertyIndex, Source( mCameraActor, CameraActor::Property::VIEW_MATRIX ), EqualToConstraintMatrix());
mShadowRenderShader.ApplyConstraint(projectionMatrixConstraint);
mShadowRenderShader.ApplyConstraint(viewMatrixConstraint);
#include <sstream>
#include <dali/public-api/events/touch-event.h>
#include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/public-api/images/resource-image.h>
// INTERNAL INCLUDES
namespace Toolkit
{
-// Properties
-const Property::Index Slider::LOWER_BOUND_PROPERTY = Internal::Slider::SLIDER_PROPERTY_START_INDEX;
-const Property::Index Slider::UPPER_BOUND_PROPERTY = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 1;
-
-const Property::Index Slider::VALUE_PROPERTY = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 2;
-const Property::Index Slider::HIT_REGION_PROPERTY = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 3;
-const Property::Index Slider::BACKING_REGION_PROPERTY = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 4;
-const Property::Index Slider::HANDLE_REGION_PROPERTY = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 5;
-
-const Property::Index Slider::BACKING_IMAGE_NAME_PROPERTY = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 6;
-const Property::Index Slider::HANDLE_IMAGE_NAME_PROPERTY = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 7;
-const Property::Index Slider::PROGRESS_IMAGE_NAME_PROPERTY = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 8;
-const Property::Index Slider::POPUP_IMAGE_NAME_PROPERTY = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 9;
-const Property::Index Slider::POPUP_ARROW_IMAGE_NAME_PROPERTY = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 10;
-
-const Property::Index Slider::DISABLE_COLOR_PROPERTY = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 11;
-const Property::Index Slider::POPUP_TEXT_COLOR_PROPERTY = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 12;
-
-const Property::Index Slider::VALUE_PRECISION_PROPERTY = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 13;
-
-const Property::Index Slider::SHOW_POPUP_PROPERTY = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 14;
-const Property::Index Slider::SHOW_VALUE_PROPERTY = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 15;
-
-const Property::Index Slider::ENABLED_PROPERTY = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 16;
-
-const Property::Index Slider::MARKS_PROPERTY = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 17;
-const Property::Index Slider::SNAP_TO_MARKS_PROPERTY = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 18;
-const Property::Index Slider::MARK_TOLERANCE_PROPERTY = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 19;
-
namespace Internal
{
-namespace
+namespace // Unnamed namespace
+{
+
+BaseHandle Create()
{
+ return Dali::Toolkit::Slider::New();
+}
+
+// Setup properties, signals and actions using the type-registry.
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::Slider, Toolkit::Control, Create )
+
+DALI_PROPERTY_REGISTRATION( Slider, "lower-bound", FLOAT, LOWER_BOUND )
+DALI_PROPERTY_REGISTRATION( Slider, "upper-bound", FLOAT, UPPER_BOUND )
+DALI_PROPERTY_REGISTRATION( Slider, "value", FLOAT, VALUE )
+DALI_PROPERTY_REGISTRATION( Slider, "hit-region", VECTOR2, HIT_REGION )
+DALI_PROPERTY_REGISTRATION( Slider, "backing-region", VECTOR2, BACKING_REGION )
+DALI_PROPERTY_REGISTRATION( Slider, "handle-region", VECTOR2, HANDLE_REGION )
+DALI_PROPERTY_REGISTRATION( Slider, "backing-image-name", STRING, BACKING_IMAGE_NAME )
+DALI_PROPERTY_REGISTRATION( Slider, "handle-image-name", STRING, HANDLE_IMAGE_NAME )
+DALI_PROPERTY_REGISTRATION( Slider, "progress-image-name", STRING, PROGRESS_IMAGE_NAME )
+DALI_PROPERTY_REGISTRATION( Slider, "popup-image-name", STRING, POPUP_IMAGE_NAME )
+DALI_PROPERTY_REGISTRATION( Slider, "popup-arrow-image-name", STRING, POPUP_ARROW_IMAGE_NAME )
+DALI_PROPERTY_REGISTRATION( Slider, "disable-color", VECTOR4, DISABLE_COLOR )
+DALI_PROPERTY_REGISTRATION( Slider, "popup-text-color", VECTOR4, POPUP_TEXT_COLOR )
+DALI_PROPERTY_REGISTRATION( Slider, "value-precision", INTEGER, VALUE_PRECISION )
+DALI_PROPERTY_REGISTRATION( Slider, "show-popup", BOOLEAN, SHOW_POPUP )
+DALI_PROPERTY_REGISTRATION( Slider, "show-value", BOOLEAN, SHOW_VALUE )
+DALI_PROPERTY_REGISTRATION( Slider, "enabled", BOOLEAN, ENABLED )
+DALI_PROPERTY_REGISTRATION( Slider, "marks", ARRAY, MARKS )
+DALI_PROPERTY_REGISTRATION( Slider, "snap-to-marks", BOOLEAN, SNAP_TO_MARKS )
+DALI_PROPERTY_REGISTRATION( Slider, "mark-tolerance", FLOAT, MARK_TOLERANCE )
+
+DALI_SIGNAL_REGISTRATION( Slider, "value-changed", SIGNAL_VALUE_CHANGED )
+DALI_SIGNAL_REGISTRATION( Slider, "mark", SIGNAL_MARK )
+
+DALI_TYPE_REGISTRATION_END()
+
const float BACKING_Z = -0.1f;
const float PROGRESS_Z = 0.1f;
const float HANDLE_Z = 1.0f;
const bool DEFAULT_ENABLED = true;
const bool DEFAULT_SNAP_TO_MARKS = false;
-// Signals
-
-const char* const SIGNAL_VALUE_CHANGED = "value-changed";
-const char* const SIGNAL_MARK = "mark";
-
-BaseHandle Create()
-{
- return Dali::Toolkit::Slider::New();
-}
-
-TypeRegistration typeRegistration( typeid( Dali::Toolkit::Slider ), typeid( Dali::Toolkit::Control ), Create );
-
-SignalConnectorType signalConnector1( typeRegistration, SIGNAL_VALUE_CHANGED, &Toolkit::Internal::Slider::DoConnectSignal );
-SignalConnectorType signalConnector2( typeRegistration, SIGNAL_MARK, &Toolkit::Internal::Slider::DoConnectSignal );
-
-PropertyRegistration property1( typeRegistration, "lower-bound", Toolkit::Slider::LOWER_BOUND_PROPERTY, Property::FLOAT, &Slider::SetProperty, &Slider::GetProperty );
-PropertyRegistration property2( typeRegistration, "upper-bound", Toolkit::Slider::UPPER_BOUND_PROPERTY, Property::FLOAT, &Slider::SetProperty, &Slider::GetProperty );
-PropertyRegistration property3( typeRegistration, "value", Toolkit::Slider::VALUE_PROPERTY, Property::FLOAT, &Slider::SetProperty, &Slider::GetProperty );
-
-PropertyRegistration property4( typeRegistration, "hit-region", Toolkit::Slider::HIT_REGION_PROPERTY, Property::VECTOR2, &Slider::SetProperty, &Slider::GetProperty );
-PropertyRegistration property5( typeRegistration, "backing-region", Toolkit::Slider::BACKING_REGION_PROPERTY, Property::VECTOR2, &Slider::SetProperty, &Slider::GetProperty );
-PropertyRegistration property6( typeRegistration, "handle-region", Toolkit::Slider::HANDLE_REGION_PROPERTY, Property::VECTOR2, &Slider::SetProperty, &Slider::GetProperty );
-
-PropertyRegistration property7( typeRegistration, "backing-image-name", Toolkit::Slider::BACKING_IMAGE_NAME_PROPERTY, Property::STRING, &Slider::SetProperty, &Slider::GetProperty );
-PropertyRegistration property8( typeRegistration, "handle-image-name", Toolkit::Slider::HANDLE_IMAGE_NAME_PROPERTY, Property::STRING, &Slider::SetProperty, &Slider::GetProperty );
-PropertyRegistration property9( typeRegistration, "progress-image-name", Toolkit::Slider::PROGRESS_IMAGE_NAME_PROPERTY, Property::STRING, &Slider::SetProperty, &Slider::GetProperty );
-PropertyRegistration property10( typeRegistration, "popup-image-name", Toolkit::Slider::POPUP_IMAGE_NAME_PROPERTY, Property::STRING, &Slider::SetProperty, &Slider::GetProperty );
-PropertyRegistration property11( typeRegistration, "popup-arrow-image-name", Toolkit::Slider::POPUP_ARROW_IMAGE_NAME_PROPERTY, Property::STRING, &Slider::SetProperty, &Slider::GetProperty );
-
-PropertyRegistration property12( typeRegistration, "disable-color", Toolkit::Slider::DISABLE_COLOR_PROPERTY, Property::VECTOR4, &Slider::SetProperty, &Slider::GetProperty );
-PropertyRegistration property13( typeRegistration, "popup-text-color", Toolkit::Slider::POPUP_TEXT_COLOR_PROPERTY, Property::VECTOR4, &Slider::SetProperty, &Slider::GetProperty );
-
-PropertyRegistration property14( typeRegistration, "value-precision", Toolkit::Slider::VALUE_PRECISION_PROPERTY, Property::INTEGER, &Slider::SetProperty, &Slider::GetProperty );
-
-PropertyRegistration property15( typeRegistration, "show-popup", Toolkit::Slider::SHOW_POPUP_PROPERTY, Property::BOOLEAN, &Slider::SetProperty, &Slider::GetProperty );
-PropertyRegistration property16( typeRegistration, "show-value", Toolkit::Slider::SHOW_VALUE_PROPERTY, Property::BOOLEAN, &Slider::SetProperty, &Slider::GetProperty );
-
-PropertyRegistration property17( typeRegistration, "enabled", Toolkit::Slider::ENABLED_PROPERTY, Property::BOOLEAN, &Slider::SetProperty, &Slider::GetProperty );
-
-PropertyRegistration property18( typeRegistration, "marks", Toolkit::Slider::MARKS_PROPERTY, Property::ARRAY, &Slider::SetProperty, &Slider::GetProperty );
-PropertyRegistration property19( typeRegistration, "snap-to-marks", Toolkit::Slider::SNAP_TO_MARKS_PROPERTY, Property::BOOLEAN, &Slider::SetProperty, &Slider::GetProperty );
-PropertyRegistration property20( typeRegistration, "mark-tolerance", Toolkit::Slider::MARK_TOLERANCE_PROPERTY, Property::FLOAT, &Slider::SetProperty, &Slider::GetProperty );
-
-} // namespace
+} // Unnamed namespace
///////////////////////////////////////////////////////////////////////////////////////////////////
// Slider
outIndex = current;
return true;
}
+
+ if( value < mark )
+ {
+ tail = current - 1;
+ }
else
{
- if( value < mark )
- {
- tail = current - 1;
- }
- else
- {
- head = current + 1;
- }
+ head = current + 1;
}
}
switch ( propertyIndex )
{
- case Toolkit::Slider::LOWER_BOUND_PROPERTY:
+ case Toolkit::Slider::Property::LOWER_BOUND:
{
sliderImpl.SetLowerBound( value.Get< float >() );
break;
}
- case Toolkit::Slider::UPPER_BOUND_PROPERTY:
+ case Toolkit::Slider::Property::UPPER_BOUND:
{
sliderImpl.SetUpperBound( value.Get< float >() );
break;
}
- case Toolkit::Slider::VALUE_PROPERTY:
+ case Toolkit::Slider::Property::VALUE:
{
sliderImpl.SetValue( value.Get< float >() );
break;
}
- case Toolkit::Slider::HIT_REGION_PROPERTY:
+ case Toolkit::Slider::Property::HIT_REGION:
{
sliderImpl.SetHitRegion( value.Get< Vector2 >() );
break;
}
- case Toolkit::Slider::BACKING_REGION_PROPERTY:
+ case Toolkit::Slider::Property::BACKING_REGION:
{
sliderImpl.SetBackingRegion( value.Get< Vector2 >() );
break;
}
- case Toolkit::Slider::HANDLE_REGION_PROPERTY:
+ case Toolkit::Slider::Property::HANDLE_REGION:
{
sliderImpl.SetHandleRegion( value.Get< Vector2 >() );
break;
}
- case Toolkit::Slider::BACKING_IMAGE_NAME_PROPERTY:
+ case Toolkit::Slider::Property::BACKING_IMAGE_NAME:
{
sliderImpl.SetBackingImageName( value.Get< std::string >() );
break;
}
- case Toolkit::Slider::HANDLE_IMAGE_NAME_PROPERTY:
+ case Toolkit::Slider::Property::HANDLE_IMAGE_NAME:
{
sliderImpl.SetHandleImageName( value.Get< std::string >() );
break;
}
- case Toolkit::Slider::PROGRESS_IMAGE_NAME_PROPERTY:
+ case Toolkit::Slider::Property::PROGRESS_IMAGE_NAME:
{
sliderImpl.SetProgressImageName( value.Get< std::string >() );
break;
}
- case Toolkit::Slider::POPUP_IMAGE_NAME_PROPERTY:
+ case Toolkit::Slider::Property::POPUP_IMAGE_NAME:
{
sliderImpl.SetPopupImageName( value.Get< std::string >() );
break;
}
- case Toolkit::Slider::POPUP_ARROW_IMAGE_NAME_PROPERTY:
+ case Toolkit::Slider::Property::POPUP_ARROW_IMAGE_NAME:
{
sliderImpl.SetPopupArrowImageName( value.Get< std::string >() );
break;
}
- case Toolkit::Slider::DISABLE_COLOR_PROPERTY:
+ case Toolkit::Slider::Property::DISABLE_COLOR:
{
sliderImpl.SetDisableColor( value.Get< Vector4 >() );
break;
}
- case Toolkit::Slider::POPUP_TEXT_COLOR_PROPERTY:
+ case Toolkit::Slider::Property::POPUP_TEXT_COLOR:
{
sliderImpl.SetPopupTextColor( value.Get< Vector4 >() );
break;
}
- case Toolkit::Slider::VALUE_PRECISION_PROPERTY:
+ case Toolkit::Slider::Property::VALUE_PRECISION:
{
sliderImpl.SetValuePrecision( value.Get< int >() );
break;
}
- case Toolkit::Slider::SHOW_POPUP_PROPERTY:
+ case Toolkit::Slider::Property::SHOW_POPUP:
{
sliderImpl.SetShowPopup( value.Get< bool >() );
break;
}
- case Toolkit::Slider::SHOW_VALUE_PROPERTY:
+ case Toolkit::Slider::Property::SHOW_VALUE:
{
sliderImpl.SetShowValue( value.Get< bool >() );
break;
}
- case Toolkit::Slider::ENABLED_PROPERTY:
+ case Toolkit::Slider::Property::ENABLED:
{
sliderImpl.SetEnabled( value.Get< bool >() );
break;
}
- case Toolkit::Slider::MARKS_PROPERTY:
+ case Toolkit::Slider::Property::MARKS:
{
sliderImpl.SetMarks( value.Get< Property::Array >() );
break;
}
- case Toolkit::Slider::SNAP_TO_MARKS_PROPERTY:
+ case Toolkit::Slider::Property::SNAP_TO_MARKS:
{
sliderImpl.SetSnapToMarks( value.Get< bool >() );
break;
}
- case Toolkit::Slider::MARK_TOLERANCE_PROPERTY:
+ case Toolkit::Slider::Property::MARK_TOLERANCE:
{
sliderImpl.SetMarkTolerance( value.Get< float >() );
break;
switch ( propertyIndex )
{
- case Toolkit::Slider::LOWER_BOUND_PROPERTY:
+ case Toolkit::Slider::Property::LOWER_BOUND:
{
value = sliderImpl.GetLowerBound();
break;
}
- case Toolkit::Slider::UPPER_BOUND_PROPERTY:
+ case Toolkit::Slider::Property::UPPER_BOUND:
{
value = sliderImpl.GetUpperBound();
break;
}
- case Toolkit::Slider::VALUE_PROPERTY:
+ case Toolkit::Slider::Property::VALUE:
{
value = sliderImpl.GetValue();
break;
}
- case Toolkit::Slider::HIT_REGION_PROPERTY:
+ case Toolkit::Slider::Property::HIT_REGION:
{
value = sliderImpl.GetHitRegion();
break;
}
- case Toolkit::Slider::BACKING_REGION_PROPERTY:
+ case Toolkit::Slider::Property::BACKING_REGION:
{
value = sliderImpl.GetBackingRegion();
break;
}
- case Toolkit::Slider::HANDLE_REGION_PROPERTY:
+ case Toolkit::Slider::Property::HANDLE_REGION:
{
value = sliderImpl.GetHandleRegion();
break;
}
- case Toolkit::Slider::BACKING_IMAGE_NAME_PROPERTY:
+ case Toolkit::Slider::Property::BACKING_IMAGE_NAME:
{
value = sliderImpl.GetBackingImageName();
break;
}
- case Toolkit::Slider::HANDLE_IMAGE_NAME_PROPERTY:
+ case Toolkit::Slider::Property::HANDLE_IMAGE_NAME:
{
value = sliderImpl.GetHandleImageName();
break;
}
- case Toolkit::Slider::PROGRESS_IMAGE_NAME_PROPERTY:
+ case Toolkit::Slider::Property::PROGRESS_IMAGE_NAME:
{
value = sliderImpl.GetProgressImageName();
break;
}
- case Toolkit::Slider::POPUP_IMAGE_NAME_PROPERTY:
+ case Toolkit::Slider::Property::POPUP_IMAGE_NAME:
{
value = sliderImpl.GetPopupImageName();
break;
}
- case Toolkit::Slider::POPUP_ARROW_IMAGE_NAME_PROPERTY:
+ case Toolkit::Slider::Property::POPUP_ARROW_IMAGE_NAME:
{
value = sliderImpl.GetPopupArrowImageName();
break;
}
- case Toolkit::Slider::DISABLE_COLOR_PROPERTY:
+ case Toolkit::Slider::Property::DISABLE_COLOR:
{
value = sliderImpl.GetDisableColor();
break;
}
- case Toolkit::Slider::POPUP_TEXT_COLOR_PROPERTY:
+ case Toolkit::Slider::Property::POPUP_TEXT_COLOR:
{
value = sliderImpl.GetPopupTextColor();
break;
}
- case Toolkit::Slider::VALUE_PRECISION_PROPERTY:
+ case Toolkit::Slider::Property::VALUE_PRECISION:
{
value = sliderImpl.GetValuePrecision();
break;
}
- case Toolkit::Slider::SHOW_POPUP_PROPERTY:
+ case Toolkit::Slider::Property::SHOW_POPUP:
{
value = sliderImpl.GetShowPopup();
break;
}
- case Toolkit::Slider::SHOW_VALUE_PROPERTY:
+ case Toolkit::Slider::Property::SHOW_VALUE:
{
value = sliderImpl.GetShowValue();
break;
}
- case Toolkit::Slider::ENABLED_PROPERTY:
+ case Toolkit::Slider::Property::ENABLED:
{
value = sliderImpl.IsEnabled();
break;
}
- case Toolkit::Slider::MARKS_PROPERTY:
+ case Toolkit::Slider::Property::MARKS:
{
// TODO: Need to be able to return a PropertyArray
// value = sliderImpl.GetMarks();
break;
}
- case Toolkit::Slider::SNAP_TO_MARKS_PROPERTY:
+ case Toolkit::Slider::Property::SNAP_TO_MARKS:
{
value = sliderImpl.GetSnapToMarks();
break;
}
- case Toolkit::Slider::MARK_TOLERANCE_PROPERTY:
+ case Toolkit::Slider::Property::MARK_TOLERANCE:
{
value = sliderImpl.GetMarkTolerance();
break;
{
public:
- // Properties
- enum
- {
- SLIDER_PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
- SLIDER_PROPERTY_END_INDEX = SLIDER_PROPERTY_START_INDEX + 1000 ///< Reserving 1000 property indices
- };
-
typedef Property::Array MarkList;
/**
#include <dali/public-api/animation/constraint.h>
#include <dali/public-api/common/stage.h>
#include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/public-api/scripting/scripting.h>
#include <dali/integration-api/debug.h>
-namespace //unnamed namespace
+namespace //Unnamed namespace
{
using namespace Dali;
namespace Toolkit
{
-const Property::Index SuperBlurView::PROPERTY_IMAGE( Internal::SuperBlurView::SUPER_BLUR_VIEW_PROPERTY_START_INDEX );
-
namespace Internal
{
namespace
{
+
const unsigned int DEFAULT_BLUR_LEVEL(5u); ///< The default blur level when creating SuperBlurView from the type registry
BaseHandle Create()
return Toolkit::SuperBlurView::New( DEFAULT_BLUR_LEVEL );
}
-// Type registration
-TypeRegistration typeRegistration( typeid(Toolkit::SuperBlurView), typeid(Toolkit::Control), Create );
+// Setup properties, signals and actions using the type-registry.
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::SuperBlurView, Toolkit::Control, Create )
+
+DALI_PROPERTY_REGISTRATION( SuperBlurView, "image", MAP, IMAGE )
-PropertyRegistration property1( typeRegistration, "image", Toolkit::SuperBlurView::PROPERTY_IMAGE, Property::MAP, &SuperBlurView::SetProperty, &SuperBlurView::GetProperty );
+DALI_TYPE_REGISTRATION_END()
} // unnamed namespace
for(unsigned int i=0; i < mBlurLevels; i++)
{
- mImageActors[i].ApplyConstraint( Constraint::New<float>( Actor::Property::ColorAlpha, ParentSource( mBlurStrengthPropertyIndex ), ActorOpacityConstraint(mBlurLevels, i) ) );
+ mImageActors[i].ApplyConstraint( Constraint::New<float>( Actor::Property::COLOR_ALPHA, ParentSource( mBlurStrengthPropertyIndex ), ActorOpacityConstraint(mBlurLevels, i) ) );
}
Self().SetSize(Stage::GetCurrent().GetSize());
{
Toolkit::SuperBlurView superBlurView = Toolkit::SuperBlurView::DownCast( Dali::BaseHandle( object ) );
- if ( superBlurView )
+ if( superBlurView )
{
SuperBlurView& superBlurViewImpl( GetImpl( superBlurView ) );
- switch ( propertyIndex )
+ if( propertyIndex == Toolkit::SuperBlurView::Property::IMAGE )
{
- case Toolkit::SuperBlurView::PROPERTY_IMAGE:
+ Dali::Image image = Scripting::NewImage( value );
+ if ( image )
+ {
+ superBlurViewImpl.SetImage( image );
+ }
+ else
{
- Dali::Image image = Scripting::NewImage( value );
- if ( image )
- {
- superBlurViewImpl.SetImage( image );
- }
- else
- {
- DALI_LOG_ERROR( "Cannot create image from property value\n" );
- }
- break;
+ DALI_LOG_ERROR( "Cannot create image from property value\n" );
}
}
}
Toolkit::SuperBlurView pushButton = Toolkit::SuperBlurView::DownCast( Dali::BaseHandle( object ) );
- if ( pushButton )
+ if( pushButton )
{
SuperBlurView& superBlurViewImpl( GetImpl( pushButton ) );
- switch ( propertyIndex )
+ if( propertyIndex == Toolkit::SuperBlurView::Property::IMAGE )
{
- case Toolkit::SuperBlurView::PROPERTY_IMAGE:
+ Property::Map map;
+ if( !superBlurViewImpl.mImageActors.empty() && superBlurViewImpl.mImageActors[0] )
{
- Property::Map map;
- if ( !superBlurViewImpl.mImageActors.empty() && superBlurViewImpl.mImageActors[0] )
- {
- Scripting::CreatePropertyMap( superBlurViewImpl.mImageActors[0], map );
- }
- value = Property::Value( map );
- break;
+ Scripting::CreatePropertyMap( superBlurViewImpl.mImageActors[0], map );
}
+ value = Property::Value( map );
}
}
*/
class SuperBlurView : public Control
{
-public:
-
- // Properties
- enum
- {
- SUPER_BLUR_VIEW_PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
- SUPER_BLUR_VIEW_PROPERTY_END_INDEX = SUPER_BLUR_VIEW_PROPERTY_START_INDEX + 1000 ///< Reserving 1000 property indices
- };
public:
#include <sstream>
#include <dali/public-api/object/ref-object.h>
#include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/public-api/scripting/scripting.h>
#include <dali/integration-api/debug.h>
namespace Toolkit
{
-const Property::Index TableView::PROPERTY_ROWS( Internal::TableView::TABLEVIEW_PROPERTY_START_INDEX );
-const Property::Index TableView::PROPERTY_COLUMNS( Internal::TableView::TABLEVIEW_PROPERTY_START_INDEX + 1 );
-const Property::Index TableView::PROPERTY_CELL_PADDING( Internal::TableView::TABLEVIEW_PROPERTY_START_INDEX + 2 );
-const Property::Index TableView::PROPERTY_LAYOUT_ROWS( Internal::TableView::TABLEVIEW_PROPERTY_START_INDEX + 3 );
-const Property::Index TableView::PROPERTY_LAYOUT_COLUMNS( Internal::TableView::TABLEVIEW_PROPERTY_START_INDEX + 4 );
-
namespace Internal
{
namespace
{
+// Type registration
+BaseHandle Create()
+{
+ return Toolkit::TableView::New( 0, 0 );
+}
+
+// Setup properties, signals and actions using the type-registry.
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::TableView, Toolkit::Control, Create );
+
+DALI_PROPERTY_REGISTRATION( TableView, "rows", UNSIGNED_INTEGER, ROWS )
+DALI_PROPERTY_REGISTRATION( TableView, "columns", UNSIGNED_INTEGER, COLUMNS )
+DALI_PROPERTY_REGISTRATION( TableView, "cell-padding", VECTOR2, CELL_PADDING )
+DALI_PROPERTY_REGISTRATION( TableView, "layout-rows", MAP, LAYOUT_ROWS )
+DALI_PROPERTY_REGISTRATION( TableView, "layout-columns", MAP, LAYOUT_COLUMNS )
+
+DALI_TYPE_REGISTRATION_END()
+
const Scripting::StringEnum< Toolkit::TableView::LayoutPolicy > LAYOUT_POLICY_STRING_TABLE[] =
{
{ "fixed", Toolkit::TableView::Fixed },
{ "relative", Toolkit::TableView::Relative },
- { "fill", Toolkit::TableView::Fill }
+ { "fill", Toolkit::TableView::Fill }
};
const unsigned int LAYOUT_POLICY_STRING_TABLE_COUNT = sizeof(LAYOUT_POLICY_STRING_TABLE) / sizeof( LAYOUT_POLICY_STRING_TABLE[0] );
-// Type registration
-BaseHandle Create()
-{
- return Toolkit::TableView::New(0, 0);
-}
-TypeRegistration mType( typeid(Toolkit::TableView), typeid(Toolkit::Control), Create );
-
-PropertyRegistration property1( mType, "rows", Toolkit::TableView::PROPERTY_ROWS, Property::UNSIGNED_INTEGER, &TableView::SetProperty, &TableView::GetProperty );
-PropertyRegistration property2( mType, "columns", Toolkit::TableView::PROPERTY_COLUMNS, Property::UNSIGNED_INTEGER, &TableView::SetProperty, &TableView::GetProperty );
-PropertyRegistration property3( mType, "cell-padding", Toolkit::TableView::PROPERTY_CELL_PADDING, Property::VECTOR2, &TableView::SetProperty, &TableView::GetProperty );
-PropertyRegistration property4( mType, "layout-rows", Toolkit::TableView::PROPERTY_LAYOUT_ROWS, Property::MAP, &TableView::SetProperty, &TableView::GetProperty );
-PropertyRegistration property5( mType, "layout-columns", Toolkit::TableView::PROPERTY_LAYOUT_COLUMNS, Property::MAP, &TableView::SetProperty, &TableView::GetProperty );
-
-} // namespace
+} // Unnamed namespace
Toolkit::TableView TableView::New( unsigned int initialRows, unsigned int initialColumns )
{
TableView& tableViewImpl( GetImpl( tableView ) );
switch( index )
{
- case Toolkit::TableView::PROPERTY_ROWS:
+ case Toolkit::TableView::Property::ROWS:
{
if( value.Get<unsigned int>() != tableViewImpl.GetRows() )
{
}
break;
}
- case Toolkit::TableView::PROPERTY_COLUMNS:
+ case Toolkit::TableView::Property::COLUMNS:
{
if( value.Get<unsigned int>() != tableViewImpl.GetColumns() )
{
}
break;
}
- case Toolkit::TableView::PROPERTY_CELL_PADDING:
+ case Toolkit::TableView::Property::CELL_PADDING:
{
tableViewImpl.SetCellPadding( value.Get<Vector2>() );
break;
}
- case Toolkit::TableView::PROPERTY_LAYOUT_ROWS:
+ case Toolkit::TableView::Property::LAYOUT_ROWS:
{
SetHeightOrWidthProperty( tableViewImpl, &TableView::SetFixedHeight, &TableView::SetRelativeHeight, value );
break;
}
- case Toolkit::TableView::PROPERTY_LAYOUT_COLUMNS:
+ case Toolkit::TableView::Property::LAYOUT_COLUMNS:
{
SetHeightOrWidthProperty( tableViewImpl, &TableView::SetFixedWidth, &TableView::SetRelativeWidth, value );
break;
TableView& tableViewImpl( GetImpl( tableView ) );
switch( index )
{
- case Toolkit::TableView::PROPERTY_ROWS:
+ case Toolkit::TableView::Property::ROWS:
{
value = tableViewImpl.GetRows();
break;
}
- case Toolkit::TableView::PROPERTY_COLUMNS:
+ case Toolkit::TableView::Property::COLUMNS:
{
value = tableViewImpl.GetColumns();
break;
}
- case Toolkit::TableView::PROPERTY_CELL_PADDING:
+ case Toolkit::TableView::Property::CELL_PADDING:
{
value = tableViewImpl.GetCellPadding();
break;
}
- case Toolkit::TableView::PROPERTY_LAYOUT_ROWS:
+ case Toolkit::TableView::Property::LAYOUT_ROWS:
{
value = tableViewImpl.GetRowHeightsPropertyValue();
break;
}
- case Toolkit::TableView::PROPERTY_LAYOUT_COLUMNS:
+ case Toolkit::TableView::Property::LAYOUT_COLUMNS:
{
value = tableViewImpl.GetColumnWidthsPropertyValue();
break;
break;
}
case Toolkit::Control::Down:
+
{
if(++currentRow > numberOfRows - 1)
{
{
public:
- // Properties
- enum
- {
- TABLEVIEW_PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
- TABLEVIEW_PROPERTY_END_INDEX = TABLEVIEW_PROPERTY_START_INDEX + 1000 ///< Reserving 1000 property indices
- };
-
/**
* Structure for the layout data
*/
// EXTERNAL INCLUDES
#include <dali/public-api/images/resource-image.h>
#include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/public-api/common/stage.h>
#include <dali/integration-api/debug.h>
return Toolkit::TextField::New();
}
-TypeRegistration mType( typeid(Toolkit::TextField), typeid(Toolkit::Control), Create );
-
// Setup properties, signals and actions using the type-registry.
DALI_TYPE_REGISTRATION_BEGIN( Toolkit::TextField, Toolkit::Control, Create );
-DALI_PROPERTY_REGISTRATION( TextField, "rendering-backend", INT, RENDERING_BACKEND )
+DALI_PROPERTY_REGISTRATION( TextField, "rendering-backend", INTEGER, RENDERING_BACKEND )
DALI_PROPERTY_REGISTRATION( TextField, "placeholder-text", STRING, PLACEHOLDER_TEXT )
DALI_PROPERTY_REGISTRATION( TextField, "text", STRING, TEXT )
DALI_PROPERTY_REGISTRATION( TextField, "font-family", STRING, FONT_FAMILY )
switch( index )
{
- case Toolkit::TextField::PROPERTY_RENDERING_BACKEND:
+ case Toolkit::TextField::Property::RENDERING_BACKEND:
{
unsigned int backend = value.Get< unsigned int >();
}
break;
}
- case Toolkit::TextField::PROPERTY_PLACEHOLDER_TEXT:
+ case Toolkit::TextField::Property::PLACEHOLDER_TEXT:
{
if( impl.mController )
{
}
break;
}
- case Toolkit::TextField::PROPERTY_TEXT:
+ case Toolkit::TextField::Property::TEXT:
{
if( impl.mController )
{
}
break;
}
- case Toolkit::TextField::PROPERTY_CURSOR_IMAGE:
+ case Toolkit::TextField::Property::CURSOR_IMAGE:
{
ResourceImage image = ResourceImage::New( value.Get< std::string >() );
}
break;
}
- case Toolkit::TextField::PROPERTY_PRIMARY_CURSOR_COLOR:
+ case Toolkit::TextField::Property::PRIMARY_CURSOR_COLOR:
{
if( impl.mDecorator )
{
}
break;
}
- case Toolkit::TextField::PROPERTY_SECONDARY_CURSOR_COLOR:
+ case Toolkit::TextField::Property::SECONDARY_CURSOR_COLOR:
{
if( impl.mDecorator )
{
}
break;
}
- case Toolkit::TextField::PROPERTY_ENABLE_CURSOR_BLINK:
+ case Toolkit::TextField::Property::ENABLE_CURSOR_BLINK:
{
if( impl.mController )
{
}
break;
}
- case Toolkit::TextField::PROPERTY_CURSOR_BLINK_INTERVAL:
+ case Toolkit::TextField::Property::CURSOR_BLINK_INTERVAL:
{
if( impl.mDecorator )
{
}
break;
}
- case Toolkit::TextField::PROPERTY_CURSOR_BLINK_DURATION:
+ case Toolkit::TextField::Property::CURSOR_BLINK_DURATION:
{
if( impl.mDecorator )
{
}
break;
}
- case Toolkit::TextField::PROPERTY_GRAB_HANDLE_IMAGE:
+ case Toolkit::TextField::Property::GRAB_HANDLE_IMAGE:
{
ResourceImage image = ResourceImage::New( value.Get< std::string >() );
}
break;
}
- case Toolkit::TextField::PROPERTY_DECORATION_BOUNDING_BOX:
+ case Toolkit::TextField::Property::DECORATION_BOUNDING_BOX:
{
if( impl.mDecorator )
{
switch( index )
{
- case Toolkit::TextField::PROPERTY_RENDERING_BACKEND:
+ case Toolkit::TextField::Property::RENDERING_BACKEND:
{
value = impl.mRenderingBackend;
break;
}
- case Toolkit::TextField::PROPERTY_PLACEHOLDER_TEXT:
+ case Toolkit::TextField::Property::PLACEHOLDER_TEXT:
{
DALI_LOG_WARNING( "UTF-8 text representation was discarded\n" );
break;
}
- case Toolkit::TextField::PROPERTY_TEXT:
+ case Toolkit::TextField::Property::TEXT:
{
DALI_LOG_WARNING( "UTF-8 text representation was discarded\n" );
break;
}
- case Toolkit::TextField::PROPERTY_CURSOR_IMAGE:
+ case Toolkit::TextField::Property::CURSOR_IMAGE:
{
if( impl.mDecorator )
{
}
break;
}
- case Toolkit::TextField::PROPERTY_PRIMARY_CURSOR_COLOR:
+ case Toolkit::TextField::Property::PRIMARY_CURSOR_COLOR:
{
if( impl.mDecorator )
{
}
break;
}
- case Toolkit::TextField::PROPERTY_SECONDARY_CURSOR_COLOR:
+ case Toolkit::TextField::Property::SECONDARY_CURSOR_COLOR:
{
if( impl.mDecorator )
{
}
break;
}
- case Toolkit::TextField::PROPERTY_ENABLE_CURSOR_BLINK:
+ case Toolkit::TextField::Property::ENABLE_CURSOR_BLINK:
{
//value = impl.mController->GetEnableCursorBlink(); TODO
break;
}
- case Toolkit::TextField::PROPERTY_CURSOR_BLINK_INTERVAL:
+ case Toolkit::TextField::Property::CURSOR_BLINK_INTERVAL:
{
if( impl.mDecorator )
{
}
break;
}
- case Toolkit::TextField::PROPERTY_CURSOR_BLINK_DURATION:
+ case Toolkit::TextField::Property::CURSOR_BLINK_DURATION:
{
if( impl.mDecorator )
{
}
break;
}
- case Toolkit::TextField::PROPERTY_GRAB_HANDLE_IMAGE:
+ case Toolkit::TextField::Property::GRAB_HANDLE_IMAGE:
{
if( impl.mDecorator )
{
}
break;
}
- case Toolkit::TextField::PROPERTY_DECORATION_BOUNDING_BOX:
+ case Toolkit::TextField::Property::DECORATION_BOUNDING_BOX:
{
if( impl.mDecorator )
{
{
public:
- // Properties
- enum
- {
- TEXTFIELD_PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
- TEXTFIELD_PROPERTY_END_INDEX = TEXTFIELD_PROPERTY_START_INDEX + 1000 ///< Reserving 1000 property indices
- };
-
/**
* @copydoc Dali::Toollkit::TextField::New()
*/
// EXTERNAL INCLUDES
#include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
// Setup properties, signals and actions using the type-registry.
DALI_TYPE_REGISTRATION_BEGIN( Toolkit::TextLabel, Toolkit::Control, Create );
-DALI_PROPERTY_REGISTRATION( TextLabel, "rendering-backend", INT, RENDERING_BACKEND )
+DALI_PROPERTY_REGISTRATION( TextLabel, "rendering-backend", INTEGER, RENDERING_BACKEND )
DALI_PROPERTY_REGISTRATION( TextLabel, "text", STRING, TEXT )
DALI_PROPERTY_REGISTRATION( TextLabel, "font-family", STRING, FONT_FAMILY )
DALI_PROPERTY_REGISTRATION( TextLabel, "font-style", STRING, FONT_STYLE )
TextLabel& impl( GetImpl( label ) );
switch( index )
{
- case Toolkit::TextLabel::PROPERTY_RENDERING_BACKEND:
+ case Toolkit::TextLabel::Property::RENDERING_BACKEND:
{
unsigned int backend = value.Get< int >();
}
break;
}
- case Toolkit::TextLabel::PROPERTY_TEXT:
+ case Toolkit::TextLabel::Property::TEXT:
{
if( impl.mController )
{
}
break;
}
- case Toolkit::TextLabel::PROPERTY_FONT_FAMILY:
+ case Toolkit::TextLabel::Property::FONT_FAMILY:
{
if( impl.mController )
{
}
break;
}
- case Toolkit::TextLabel::PROPERTY_FONT_STYLE:
+ case Toolkit::TextLabel::Property::FONT_STYLE:
{
if( impl.mController )
{
}
break;
}
- case Toolkit::TextLabel::PROPERTY_POINT_SIZE:
+ case Toolkit::TextLabel::Property::POINT_SIZE:
{
if( impl.mController )
{
}
break;
}
- case Toolkit::TextLabel::PROPERTY_MULTI_LINE:
+ case Toolkit::TextLabel::Property::MULTI_LINE:
{
if( impl.mController )
{
TextLabel& impl( GetImpl( label ) );
switch( index )
{
- case Toolkit::TextLabel::PROPERTY_RENDERING_BACKEND:
+ case Toolkit::TextLabel::Property::RENDERING_BACKEND:
{
value = impl.mRenderingBackend;
break;
}
- case Toolkit::TextLabel::PROPERTY_TEXT:
+ case Toolkit::TextLabel::Property::TEXT:
{
if( impl.mController )
{
DALI_LOG_WARNING( "UTF-8 text representation was discarded\n" );
break;
}
- case Toolkit::TextLabel::PROPERTY_MULTI_LINE:
+ case Toolkit::TextLabel::Property::MULTI_LINE:
{
if( impl.mController )
{
{
public:
- // Properties
- enum
- {
- TEXTLABEL_PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
- TEXTLABEL_PROPERTY_END_INDEX = TEXTLABEL_PROPERTY_START_INDEX + 1000 ///< Reserving 1000 property indices
- };
-
/**
* @copydoc Dali::Toollkit::TextLabel::New()
*/
#include <dali/public-api/actors/renderable-actor.h>
#include <dali/public-api/animation/constraints.h>
#include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/alignment/alignment.h>
#include <dali-toolkit/public-api/controls/table-view/table-view.h>
-// EXTERNAL INCLUDES
-
namespace Dali
{
namespace
{
+
BaseHandle Create()
{
return Toolkit::ToolBar::New();
}
-TypeRegistration mType( typeid(Toolkit::ToolBar), typeid(Toolkit::Control), Create );
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::ToolBar, Toolkit::Control, Create )
+DALI_TYPE_REGISTRATION_END()
const float DEFAULT_RELATIVE_SIZE( 0.1f );
const Toolkit::Alignment::Type DEFAULT_ALIGNMENT( Toolkit::Alignment::HorizontalLeft );
#include <dali/public-api/animation/constraints.h>
#include <dali/public-api/common/stage.h>
#include <dali/public-api/object/type-registry.h>
-
-// INTERNAL INCLUDES
+#include <dali/public-api/object/type-registry-helper.h>
namespace Dali
{
namespace Internal
{
-namespace // to register type
+namespace
{
-// Signals
-
-const char* const SIGNAL_ORIENTATION_ANIMATION_START = "orientation-animation-start";
-
BaseHandle Create()
{
return Toolkit::View::New();
}
-TypeRegistration typeRegistration( typeid( Toolkit::View ), typeid( Toolkit::Control ), Create );
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::View, Toolkit::Control, Create )
-SignalConnectorType signalConnector1( typeRegistration, SIGNAL_ORIENTATION_ANIMATION_START , &View::DoConnectSignal );
+DALI_SIGNAL_REGISTRATION( View, "orientation-animation-start", SIGNAL_ORIENTATION_ANIMATION_START )
-}
-
-namespace
-{
+DALI_TYPE_REGISTRATION_END()
const float ROTATION_ANIMATION_DURATION = 0.5f;
#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/public-api/object/type-registry-helper.h>
#include <dali/public-api/images/resource-image.h>
#include <dali/integration-api/debug.h>
namespace Internal
{
-namespace // unnamed namespace
+namespace // Unnamed namespace
{
-// Signals
-
-const char* const SIGNAL_PRE_FOCUS_CHANGE = "keyboard-pre-focus-change";
-const char* const SIGNAL_FOCUS_CHANGED = "keyboard-focus-changed";
-const char* const SIGNAL_FOCUS_GROUP_CHANGED = "keyboard-focus-group-changed";
-const char* const SIGNAL_FOCUSED_ACTOR_ACTIVATED = "keyboard-focused-actor-activated";
-
#if defined(DEBUG_ENABLED)
Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_KEYBOARD_FOCUS_MANAGER");
#endif
-const std::string IS_FOCUS_GROUP_PROPERTY_NAME("is-keyboard-focus-group"); // This property will be replaced by a flag in Control.
+const char* const IS_FOCUS_GROUP_PROPERTY_NAME = "is-keyboard-focus-group"; // This property will be replaced by a flag in Control.
-const char* FOCUS_BORDER_IMAGE_PATH = DALI_IMAGE_DIR "keyboard_focus.png";
+const char* const FOCUS_BORDER_IMAGE_PATH = DALI_IMAGE_DIR "keyboard_focus.png";
const Vector4 FOCUS_BORDER_IMAGE_BORDER = Vector4(7.0f, 7.0f, 7.0f, 7.0f);
BaseHandle Create()
return handle;
}
-TypeRegistration KEYBOARD_FOCUS_MANAGER_TYPE( typeid(Dali::Toolkit::KeyboardFocusManager), typeid(Dali::BaseHandle), Create, true /* Create instance at startup */ );
+DALI_TYPE_REGISTRATION_BEGIN_CREATE( Toolkit::KeyboardFocusManager, Dali::BaseHandle, Create, true )
+
+DALI_SIGNAL_REGISTRATION( KeyboardFocusManager, "keyboard-pre-focus-change", SIGNAL_PRE_FOCUS_CHANGE )
+DALI_SIGNAL_REGISTRATION( KeyboardFocusManager, "keyboard-focus-changed", SIGNAL_FOCUS_CHANGED )
+DALI_SIGNAL_REGISTRATION( KeyboardFocusManager, "keyboard-focus-group-changed", SIGNAL_FOCUS_GROUP_CHANGED )
+DALI_SIGNAL_REGISTRATION( KeyboardFocusManager, "keyboard-focused-actor-activated", SIGNAL_FOCUSED_ACTOR_ACTIVATED )
-SignalConnectorType signalConnector1( KEYBOARD_FOCUS_MANAGER_TYPE, SIGNAL_PRE_FOCUS_CHANGE , &KeyboardFocusManager::DoConnectSignal );
-SignalConnectorType signalConnector2( KEYBOARD_FOCUS_MANAGER_TYPE, SIGNAL_FOCUS_CHANGED , &KeyboardFocusManager::DoConnectSignal );
-SignalConnectorType signalConnector3( KEYBOARD_FOCUS_MANAGER_TYPE, SIGNAL_FOCUS_GROUP_CHANGED , &KeyboardFocusManager::DoConnectSignal );
-SignalConnectorType signalConnector4( KEYBOARD_FOCUS_MANAGER_TYPE, SIGNAL_FOCUSED_ACTOR_ACTIVATED , &KeyboardFocusManager::DoConnectSignal );
+DALI_TYPE_REGISTRATION_END()
} // unnamed namespace
#include <sstream>
#include <dali/public-api/adaptor-framework/singleton-service.h>
#include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
return handle;
}
-TypeRegistration STYLE_MANAGER_TYPE( typeid(Dali::Toolkit::StyleManager), typeid(Dali::BaseHandle), Create, true /* Create instance at startup */ );
+
+DALI_TYPE_REGISTRATION_BEGIN_CREATE( Toolkit::StyleManager, Dali::BaseHandle, Create, true )
+DALI_TYPE_REGISTRATION_END()
} // namespace
#include <dali/public-api/common/stage.h>
#include <dali/public-api/images/buffer-image.h>
#include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/public-api/render-tasks/render-task-list.h>
namespace Dali
namespace
{
-// Signals
+// Setup properties, signals and actions using the type-registry.
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::CubeTransitionEffect, Dali::BaseHandle, NULL );
-const char* const SIGNAL_TRANSITION_COMPLETED = "transition-completed";
+DALI_SIGNAL_REGISTRATION( CubeTransitionEffect, "transition-completed", SIGNAL_TRANSITION_COMPLETED )
-TypeRegistration typeRegistration( typeid( Toolkit::CubeTransitionEffect ), typeid( Dali::BaseHandle ), NULL );
-
-SignalConnectorType signalConnector1( typeRegistration, SIGNAL_TRANSITION_COMPLETED , &CubeTransitionEffect::DoConnectSignal );
+DALI_TYPE_REGISTRATION_END()
}
{
public:
- // Properties
- static const Dali::Property::Index PROPERTY_DISABLED; ///< name "disabled", @see SetDisabled(), type BOOLEAN
- static const Dali::Property::Index PROPERTY_AUTO_REPEATING; ///< name "auto-repeating", @see SetAutoRepeating(), type BOOLEAN
- static const Dali::Property::Index PROPERTY_INITIAL_AUTO_REPEATING_DELAY; ///< name "initial-auto-repeating-delay", @see SetInitialAutoRepeatingDelay(), type FLOAT
- static const Dali::Property::Index PROPERTY_NEXT_AUTO_REPEATING_DELAY; ///< name "next-auto-repeating-delay", @see SetNextAutoRepeatingDelay(), type FLOAT
- static const Dali::Property::Index PROPERTY_TOGGLABLE; ///< name "togglable", @see SetTogglableButton(), type BOOLEAN
- static const Dali::Property::Index PROPERTY_SELECTED; ///< name "selected", @see SetSelected(), type BOOLEAN
- static const Dali::Property::Index PROPERTY_NORMAL_STATE_ACTOR; ///< name "normal-state-actor", @see SetButtonImage(), type MAP
- static const Dali::Property::Index PROPERTY_SELECTED_STATE_ACTOR; ///< name "selected-state-actor", @see SetSelectedImage(), type MAP
- static const Dali::Property::Index PROPERTY_DISABLED_STATE_ACTOR; ///< name "disabled-state-actor", @see SetDisabledImage(), type MAP
- static const Dali::Property::Index PROPERTY_LABEL_ACTOR; ///< name "label-actor", @see SetLabel(), type MAP
+ /**
+ * @brief The start and end property ranges for this control.
+ */
+ enum PropertyRange
+ {
+ PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
+ PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserve property indices
+ };
+
+ /**
+ * @brief An enumeration of properties belonging to the Button class.
+ */
+ struct Property
+ {
+ enum
+ {
+ DISABLED = PROPERTY_START_INDEX, ///< name "disabled", @see SetDisabled(), type BOOLEAN
+ AUTO_REPEATING, ///< name "auto-repeating", @see SetAutoRepeating(), type BOOLEAN
+ INITIAL_AUTO_REPEATING_DELAY, ///< name "initial-auto-repeating-delay", @see SetInitialAutoRepeatingDelay(), type FLOAT
+ NEXT_AUTO_REPEATING_DELAY, ///< name "next-auto-repeating-delay", @see SetNextAutoRepeatingDelay(), type FLOAT
+ TOGGLABLE, ///< name "togglable", @see SetTogglableButton(), type BOOLEAN
+ SELECTED, ///< name "selected", @see SetSelected(), type BOOLEAN
+ NORMAL_STATE_ACTOR, ///< name "normal-state-actor", @see SetButtonImage(), type MAP
+ SELECTED_STATE_ACTOR, ///< name "selected-state-actor", @see SetSelectedImage(), type MAP
+ DISABLED_STATE_ACTOR, ///< name "disabled-state-actor", @see SetDisabledImage(), type MAP
+ LABEL_ACTOR, ///< name "label-actor", @see SetLabel(), type MAP
+ };
+ };
public:
#include <dali/public-api/animation/constraints.h>
#include <dali/public-api/geometry/mesh.h>
#include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/public-api/scripting/scripting.h>
#include <dali/integration-api/debug.h>
namespace Toolkit
{
-const Property::Index Control::PROPERTY_BACKGROUND_COLOR = Internal::Control::CONTROL_PROPERTY_START_INDEX;
-const Property::Index Control::PROPERTY_BACKGROUND = Internal::Control::CONTROL_PROPERTY_START_INDEX + 1;
-const Property::Index Control::PROPERTY_WIDTH_POLICY = Internal::Control::CONTROL_PROPERTY_START_INDEX + 2;
-const Property::Index Control::PROPERTY_HEIGHT_POLICY = Internal::Control::CONTROL_PROPERTY_START_INDEX + 3;
-const Property::Index Control::PROPERTY_MINIMUM_SIZE = Internal::Control::CONTROL_PROPERTY_START_INDEX + 4;
-const Property::Index Control::PROPERTY_MAXIMUM_SIZE = Internal::Control::CONTROL_PROPERTY_START_INDEX + 5;
-const Property::Index Control::PROPERTY_KEY_INPUT_FOCUS = Internal::Control::CONTROL_PROPERTY_START_INDEX + 6;
-
namespace
{
-// Signals
-
-const char* const SIGNAL_KEY_EVENT = "key-event";
-const char* const SIGNAL_TAPPED = "tapped";
-const char* const SIGNAL_PANNED = "panned";
-const char* const SIGNAL_PINCHED = "pinched";
-const char* const SIGNAL_LONG_PRESSED = "long-pressed";
-
-// Actions
-
-const char* const ACTION_CONTROL_ACTIVATED = "control-activated";
-
const Scripting::StringEnum< Control::SizePolicy > SIZE_POLICY_STRING_TABLE[] =
{
{ "FIXED", Control::Fixed },
return Internal::Control::New();
}
-TypeRegistration CONTROL_TYPE( typeid(Control), typeid(CustomActor), Create );
+// Setup signals and actions using the type-registry.
+DALI_TYPE_REGISTRATION_BEGIN( Control, CustomActor, Create );
+
+// Note: Properties are registered separately below,
-// Property Registration after Internal::Control::Impl definition below
+DALI_SIGNAL_REGISTRATION( Control, "key-event", SIGNAL_KEY_EVENT )
+DALI_SIGNAL_REGISTRATION( Control, "tapped", SIGNAL_TAPPED )
+DALI_SIGNAL_REGISTRATION( Control, "panned", SIGNAL_PANNED )
+DALI_SIGNAL_REGISTRATION( Control, "pinched", SIGNAL_PINCHED )
+DALI_SIGNAL_REGISTRATION( Control, "long-pressed", SIGNAL_LONG_PRESSED )
-TypeAction ACTION_TYPE_1( CONTROL_TYPE, ACTION_CONTROL_ACTIVATED, &Internal::Control::DoAction );
+DALI_ACTION_REGISTRATION( Control, "control-activated", ACTION_CONTROL_ACTIVATED )
-SignalConnectorType SIGNAL_CONNECTOR_1( CONTROL_TYPE, SIGNAL_KEY_EVENT, &Internal::Control::DoConnectSignal );
-SignalConnectorType SIGNAL_CONNECTOR_2( CONTROL_TYPE, SIGNAL_TAPPED, &Internal::Control::DoConnectSignal );
-SignalConnectorType SIGNAL_CONNECTOR_3( CONTROL_TYPE, SIGNAL_PANNED, &Internal::Control::DoConnectSignal );
-SignalConnectorType SIGNAL_CONNECTOR_4( CONTROL_TYPE, SIGNAL_PINCHED, &Internal::Control::DoConnectSignal );
-SignalConnectorType SIGNAL_CONNECTOR_5( CONTROL_TYPE, SIGNAL_LONG_PRESSED, &Internal::Control::DoConnectSignal );
+DALI_TYPE_REGISTRATION_END()
/**
* Structure which holds information about the background of a control
actor.SetZ( BACKGROUND_ACTOR_Z_POSITION );
Constraint constraint = Constraint::New<Vector3>( constrainingIndex,
- ParentSource( Actor::Property::Size ),
+ ParentSource( Actor::Property::SIZE ),
EqualToConstraint() );
actor.ApplyConstraint( constraint );
}
switch ( index )
{
- case Toolkit::Control::PROPERTY_BACKGROUND_COLOR:
+ case Toolkit::Control::Property::BACKGROUND_COLOR:
{
controlImpl.SetBackgroundColor( value.Get< Vector4 >() );
break;
}
- case Toolkit::Control::PROPERTY_BACKGROUND:
+ case Toolkit::Control::Property::BACKGROUND:
{
if ( value.HasKey( "image" ) )
{
break;
}
- case Toolkit::Control::PROPERTY_WIDTH_POLICY:
+ case Toolkit::Control::Property::WIDTH_POLICY:
{
controlImpl.mImpl->mWidthPolicy = Scripting::GetEnumeration< Toolkit::Control::SizePolicy >( value.Get< std::string >().c_str(), SIZE_POLICY_STRING_TABLE, SIZE_POLICY_STRING_TABLE_COUNT );
break;
}
- case Toolkit::Control::PROPERTY_HEIGHT_POLICY:
+ case Toolkit::Control::Property::HEIGHT_POLICY:
{
controlImpl.mImpl->mHeightPolicy = Scripting::GetEnumeration< Toolkit::Control::SizePolicy >( value.Get< std::string >().c_str(), SIZE_POLICY_STRING_TABLE, SIZE_POLICY_STRING_TABLE_COUNT );
break;
}
- case Toolkit::Control::PROPERTY_MINIMUM_SIZE:
+ case Toolkit::Control::Property::MINIMUM_SIZE:
{
controlImpl.SetMinimumSize( value.Get< Vector3 >() );
break;
}
- case Toolkit::Control::PROPERTY_MAXIMUM_SIZE:
+ case Toolkit::Control::Property::MAXIMUM_SIZE:
{
controlImpl.SetMaximumSize( value.Get< Vector3 >() );
break;
}
- case Toolkit::Control::PROPERTY_KEY_INPUT_FOCUS:
+ case Toolkit::Control::Property::KEY_INPUT_FOCUS:
{
if ( value.Get< bool >() )
{
switch ( index )
{
- case Toolkit::Control::PROPERTY_BACKGROUND_COLOR:
+ case Toolkit::Control::Property::BACKGROUND_COLOR:
{
value = controlImpl.GetBackgroundColor();
break;
}
- case Toolkit::Control::PROPERTY_BACKGROUND:
+ case Toolkit::Control::Property::BACKGROUND:
{
Property::Map map;
break;
}
- case Toolkit::Control::PROPERTY_WIDTH_POLICY:
+ case Toolkit::Control::Property::WIDTH_POLICY:
{
value = std::string( Scripting::GetEnumerationName< Toolkit::Control::SizePolicy >( controlImpl.mImpl->mWidthPolicy, SIZE_POLICY_STRING_TABLE, SIZE_POLICY_STRING_TABLE_COUNT ) );
break;
}
- case Toolkit::Control::PROPERTY_HEIGHT_POLICY:
+ case Toolkit::Control::Property::HEIGHT_POLICY:
{
value = std::string( Scripting::GetEnumerationName< Toolkit::Control::SizePolicy >( controlImpl.mImpl->mHeightPolicy, SIZE_POLICY_STRING_TABLE, SIZE_POLICY_STRING_TABLE_COUNT ) );
break;
}
- case Toolkit::Control::PROPERTY_MINIMUM_SIZE:
+ case Toolkit::Control::Property::MINIMUM_SIZE:
{
value = controlImpl.mImpl->GetMinimumSize();
break;
}
- case Toolkit::Control::PROPERTY_MAXIMUM_SIZE:
+ case Toolkit::Control::Property::MAXIMUM_SIZE:
{
value = controlImpl.mImpl->GetMaximumSize();
break;
}
- case Toolkit::Control::PROPERTY_KEY_INPUT_FOCUS:
+ case Toolkit::Control::Property::KEY_INPUT_FOCUS:
{
value = controlImpl.HasKeyInputFocus();
break;
bool mIsKeyboardFocusGroup:1; ///< Stores whether the control is a focus group.
bool mInitialized:1;
- // Properties - these need to be members of Internal::Control::Impl as they need to functions within this class.
+ // Properties - these need to be members of Internal::Control::Impl as they need to function within this class.
static PropertyRegistration PROPERTY_1;
static PropertyRegistration PROPERTY_2;
static PropertyRegistration PROPERTY_3;
static PropertyRegistration PROPERTY_7;
};
-PropertyRegistration Control::Impl::PROPERTY_1( CONTROL_TYPE, "background-color", Toolkit::Control::PROPERTY_BACKGROUND_COLOR, Property::VECTOR4, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
-PropertyRegistration Control::Impl::PROPERTY_2( CONTROL_TYPE, "background", Toolkit::Control::PROPERTY_BACKGROUND, Property::MAP, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
-PropertyRegistration Control::Impl::PROPERTY_3( CONTROL_TYPE, "width-policy", Toolkit::Control::PROPERTY_WIDTH_POLICY, Property::STRING, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
-PropertyRegistration Control::Impl::PROPERTY_4( CONTROL_TYPE, "height-policy", Toolkit::Control::PROPERTY_HEIGHT_POLICY, Property::STRING, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
-PropertyRegistration Control::Impl::PROPERTY_5( CONTROL_TYPE, "minimum-size", Toolkit::Control::PROPERTY_MINIMUM_SIZE, Property::VECTOR3, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
-PropertyRegistration Control::Impl::PROPERTY_6( CONTROL_TYPE, "maximum-size", Toolkit::Control::PROPERTY_MAXIMUM_SIZE, Property::VECTOR3, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
-PropertyRegistration Control::Impl::PROPERTY_7( CONTROL_TYPE, "key-input-focus", Toolkit::Control::PROPERTY_KEY_INPUT_FOCUS, Property::BOOLEAN, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
+// Properties registered without macro to use specific member variables.
+PropertyRegistration Control::Impl::PROPERTY_1( typeRegistration, "background-color", Toolkit::Control::Property::BACKGROUND_COLOR, Property::VECTOR4, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
+PropertyRegistration Control::Impl::PROPERTY_2( typeRegistration, "background", Toolkit::Control::Property::BACKGROUND, Property::MAP, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
+PropertyRegistration Control::Impl::PROPERTY_3( typeRegistration, "width-policy", Toolkit::Control::Property::WIDTH_POLICY, Property::STRING, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
+PropertyRegistration Control::Impl::PROPERTY_4( typeRegistration, "height-policy", Toolkit::Control::Property::HEIGHT_POLICY, Property::STRING, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
+PropertyRegistration Control::Impl::PROPERTY_5( typeRegistration, "minimum-size", Toolkit::Control::Property::MINIMUM_SIZE, Property::VECTOR3, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
+PropertyRegistration Control::Impl::PROPERTY_6( typeRegistration, "maximum-size", Toolkit::Control::Property::MAXIMUM_SIZE, Property::VECTOR3, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
+PropertyRegistration Control::Impl::PROPERTY_7( typeRegistration, "key-input-focus", Toolkit::Control::Property::KEY_INPUT_FOCUS, Property::BOOLEAN, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
Toolkit::Control Control::New()
{
// Create Mesh Actor
MeshActor meshActor = MeshActor::New( CreateMesh() );
- SetupBackgroundActor( meshActor, Actor::Property::Scale, color );
+ SetupBackgroundActor( meshActor, Actor::Property::SCALE, color );
// Set the background actor before adding so that we do not inform deriving classes
background.actor = meshActor;
}
ImageActor imageActor = ImageActor::New( image );
- SetupBackgroundActor( imageActor, Actor::Property::Size, background.color );
+ SetupBackgroundActor( imageActor, Actor::Property::SIZE, background.color );
// Set the background actor before adding so that we do not inform derived classes
background.actor = imageActor;
{
public:
- // Properties
- enum
- {
- CONTROL_PROPERTY_START_INDEX = PROPERTY_REGISTRATION_START_INDEX,
- CONTROL_PROPERTY_END_INDEX = CONTROL_PROPERTY_START_INDEX + 1000 ///< Reserving 1000 property indices
- };
-
// Creation & Destruction
/**
{
public:
- /// @name Properties
- /** @{ */
- static const Dali::Property::Index PROPERTY_BACKGROUND_COLOR; ///< name "background-color", @see SetBackgroundColor, type VECTOR4
- static const Dali::Property::Index PROPERTY_BACKGROUND; ///< name "background", @see SetBackground, type MAP
- static const Dali::Property::Index PROPERTY_WIDTH_POLICY; ///< name "width-policy", @see SetSizePolicy, type STRING
- static const Dali::Property::Index PROPERTY_HEIGHT_POLICY; ///< name "height-policy", @see SetSizePolicy, type STRING
- static const Dali::Property::Index PROPERTY_MINIMUM_SIZE; ///< name "minimum-size", @see SetMinimumSize, type VECTOR3
- static const Dali::Property::Index PROPERTY_MAXIMUM_SIZE; ///< name "maximum-size", @see SetMaximumSize, type VECTOR3
- static const Dali::Property::Index PROPERTY_KEY_INPUT_FOCUS; ///< name "key-input-focus", @see SetKeyInputFocus, type BOOLEAN
- /** @} */
+ /**
+ * @brief The start and end property ranges for control.
+ */
+ enum PropertyRange
+ {
+ PROPERTY_START_INDEX = PROPERTY_REGISTRATION_START_INDEX, ///< Start index is used by the property registration macro.
+ CONTROL_PROPERTY_START_INDEX = PROPERTY_START_INDEX, ///< Start index of Control properties.
+ CONTROL_PROPERTY_END_INDEX = CONTROL_PROPERTY_START_INDEX + 1000 ///< Reserving 1000 property indices.
+ };
+
+ /**
+ * @brief An enumeration of properties belonging to the Control class.
+ */
+ struct Property
+ {
+ enum
+ {
+ BACKGROUND_COLOR = PROPERTY_START_INDEX, ///< name "background-color", @see SetBackgroundColor, type VECTOR4
+ BACKGROUND, ///< name "background", @see SetBackground, type MAP
+ WIDTH_POLICY, ///< name "width-policy", @see SetSizePolicy, type STRING
+ HEIGHT_POLICY, ///< name "height-policy", @see SetSizePolicy, type STRING
+ MINIMUM_SIZE, ///< name "minimum-size", @see SetMinimumSize, type VECTOR3
+ MAXIMUM_SIZE, ///< name "maximum-size", @see SetMaximumSize, type VECTOR3
+ KEY_INPUT_FOCUS, ///< name "key-input-focus", @see SetKeyInputFocus, type BOOLEAN
+ };
+ };
/**
* @brief Describes how a control could be resized.
{
public:
+ /**
+ * @brief The start and end property ranges for this control.
+ */
+ enum PropertyRange
+ {
+ PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
+ PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserve property indices
+ };
+
+ /**
+ * @brief An enumeration of properties belonging to the ScrollBar class.
+ */
+ struct Property
+ {
+ enum
+ {
+ INDICATOR_HEIGHT_POLICY = PROPERTY_START_INDEX, ///< name "indicator-height-policy", @see SetIndicatorHeightPolicy(), type STRING
+ INDICATOR_FIXED_HEIGHT, ///< name "indicator-fixed-height", @see SetIndicatorFixedHeight(), type FLOAT
+ INDICATOR_SHOW_DURATION, ///< name "indicator-show-duration", @see SetIndicatorShowDuration(), type FLOAT
+ INDICATOR_HIDE_DURATION, ///< name "indicator-hide-duration", @see SetIndicatorHideDuration(), type FLOAT
+ };
+ };
+
// Signals
typedef Signal< void ( float ) > ScrollPositionNotifiedSignalType;
- // Properties
- static const Dali::Property::Index PROPERTY_INDICATOR_HEIGHT_POLICY; ///< name "indicator-height-policy", @see SetIndicatorHeightPolicy(), type STRING
- static const Dali::Property::Index PROPERTY_INDICATOR_FIXED_HEIGHT; ///< name "indicator-fixed-height", @see SetIndicatorFixedHeight(), type FLOAT
- static const Dali::Property::Index PROPERTY_INDICATOR_SHOW_DURATION; ///< name "indicator-show-duration", @see SetIndicatorShowDuration(), type FLOAT
- static const Dali::Property::Index PROPERTY_INDICATOR_HIDE_DURATION; ///< name "indicator-hide-duration", @see SetIndicatorHideDuration(), type FLOAT
-
public:
/**
if (GetPositionConstraint(itemId, positionConstraint))
{
WrappedVector3Constraint wrapped(positionConstraint, itemId);
- Constraint constraint = Constraint::New<Vector3>( Actor::Property::Position,
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
Source( scrollPositionObject, scrollPositionProperty ),
ParentSource( scrollSpeedProperty ),
- ParentSource( Actor::Property::Size ),
+ ParentSource( Actor::Property::SIZE ),
wrapped );
constraint.SetApplyTime(durationSeconds);
constraint.SetAlphaFunction(mAlphaFunction);
{
WrappedQuaternionConstraint wrapped(rotationConstraint, itemId);
- Constraint constraint = Constraint::New<Quaternion>( Actor::Property::Rotation,
+ Constraint constraint = Constraint::New<Quaternion>( Actor::Property::ROTATION,
Source( scrollPositionObject, scrollPositionProperty ),
ParentSource( scrollSpeedProperty ),
- ParentSource( Actor::Property::Size ),
+ ParentSource( Actor::Property::SIZE ),
wrapped );
constraint.SetApplyTime(durationSeconds);
constraint.SetAlphaFunction(mAlphaFunction);
{
WrappedVector3Constraint wrapped(scaleConstraint, itemId);
- Constraint constraint = Constraint::New<Vector3>( Actor::Property::Scale,
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::SCALE,
Source( scrollPositionObject, scrollPositionProperty ),
ParentSource( scrollSpeedProperty ),
- ParentSource( Actor::Property::Size ),
+ ParentSource( Actor::Property::SIZE ),
wrapped );
constraint.SetApplyTime(durationSeconds);
constraint.SetAlphaFunction(mAlphaFunction);
{
WrappedVector4Constraint wrapped(colorConstraint, itemId);
- Constraint constraint = Constraint::New<Vector4>( Actor::Property::Color,
+ Constraint constraint = Constraint::New<Vector4>( Actor::Property::COLOR,
Source( scrollPositionObject, scrollPositionProperty ),
ParentSource( scrollSpeedProperty ),
- ParentSource( Actor::Property::Size ),
+ ParentSource( Actor::Property::SIZE ),
wrapped );
constraint.SetApplyTime(durationSeconds);
{
WrappedBoolConstraint wrapped(visibilityConstraint, itemId);
- Constraint constraint = Constraint::New<bool>( Actor::Property::Visible,
+ Constraint constraint = Constraint::New<bool>( Actor::Property::VISIBLE,
Source( scrollPositionObject, scrollPositionProperty ),
ParentSource( scrollSpeedProperty ),
- ParentSource( Actor::Property::Size ),
+ ParentSource( Actor::Property::SIZE ),
wrapped );
constraint.SetApplyTime(durationSeconds);
* An ItemLayout also describes the direction of input gestures, used to scroll through the layout.
* Whilst scrolling, the layout provides a range of items that are within a layout-area (3D bounding volume).
*/
-class ItemLayout : public RefObject
+class DALI_IMPORT_API ItemLayout : public RefObject
{
public:
static const std::string SCROLL_POSITION_MAX_PROPERTY_NAME; ///< Property, name "scroll-position-max", type VECTOR3
static const std::string SCROLL_DIRECTION_PROPERTY_NAME; ///< Property, name "scroll-direction", type VECTOR2
- /// @name Properties
- /** @{ */
- static const Dali::Property::Index PROPERTY_OVERSHOOT_EFFECT_COLOR; ///< Property, name "overshoot-effect-color", @see SetOvershootEffectColor(), type VECTOR4
- static const Dali::Property::Index PROPERTY_OVERSHOOT_ANIMATION_SPEED; ///< Property, name "overshoot-animation-speed", @see SetOvershootAnimationSpeed(), type FLOAT
- /** @} */
+ /**
+ * @brief The start and end property ranges for this control.
+ */
+ enum PropertyRange
+ {
+ PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
+ PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserve property indices
+ };
+
+ /**
+ * @brief An enumeration of properties belonging to the Scrollable class.
+ */
+ struct Property
+ {
+ enum
+ {
+ OVERSHOOT_EFFECT_COLOR = PROPERTY_START_INDEX, ///< Property, name "overshoot-effect-color", @see SetOvershootEffectColor(), type VECTOR4
+ OVERSHOOT_ANIMATION_SPEED, ///< Property, name "overshoot-animation-speed", @see SetOvershootAnimationSpeed(), type FLOAT
+ };
+ };
public:
{
public:
- // Properties
- static const Dali::Property::Index LOWER_BOUND_PROPERTY; ///< Property, name "lower-bound", type FLOAT
- static const Dali::Property::Index UPPER_BOUND_PROPERTY; ///< Property, name "upper-bound", type FLOAT
- static const Dali::Property::Index VALUE_PROPERTY; ///< Property, name "value", type FLOAT
-
- static const Dali::Property::Index HIT_REGION_PROPERTY; ///< Property, name "hit-region", type VECTOR2
- static const Dali::Property::Index BACKING_REGION_PROPERTY; ///< Property, name "backing-region", type VECTOR2
- static const Dali::Property::Index HANDLE_REGION_PROPERTY; ///< Property, name "handle-region", type VECTOR2
-
- static const Dali::Property::Index BACKING_IMAGE_NAME_PROPERTY; ///< Property, name "backing-image-name", type STRING
- static const Dali::Property::Index HANDLE_IMAGE_NAME_PROPERTY; ///< Property, name "handle-image-name", type STRING
- static const Dali::Property::Index PROGRESS_IMAGE_NAME_PROPERTY; ///< Property, name "progress-image-name", type STRING
- static const Dali::Property::Index POPUP_IMAGE_NAME_PROPERTY; ///< Property, name "popup-image-name", type STRING
- static const Dali::Property::Index POPUP_ARROW_IMAGE_NAME_PROPERTY; ///< Property, name "popup-arrow-image-name", type STRING
-
- static const Dali::Property::Index DISABLE_COLOR_PROPERTY; ///< Property, name "disable-color", type VECTOR4
- static const Dali::Property::Index POPUP_TEXT_COLOR_PROPERTY; ///< Property, name "popup-text-color", type VECTOR4
-
- static const Dali::Property::Index VALUE_PRECISION_PROPERTY; ///< Property, name "value-precision", type INT
-
- static const Dali::Property::Index SHOW_POPUP_PROPERTY; ///< Property, name "show-popup", type BOOLEAN
- static const Dali::Property::Index SHOW_VALUE_PROPERTY; ///< Property, name "show-value", type BOOLEAN
-
- static const Dali::Property::Index ENABLED_PROPERTY; ///< Property, name "enabled", type BOOLEAN
+ /**
+ * @brief The start and end property ranges for this control.
+ */
+ enum PropertyRange
+ {
+ PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
+ PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserving 1000 property indices
+ };
- static const Dali::Property::Index MARKS_PROPERTY; ///< Property, name "marks", type Property::Array<float>
- static const Dali::Property::Index SNAP_TO_MARKS_PROPERTY; ///< Property, name "snap-to-marks", type BOOLEAN
- static const Dali::Property::Index MARK_TOLERANCE_PROPERTY; ///< Property, name "mark-tolerance", type FLOAT
+ /**
+ * @brief An enumeration of properties belonging to the Slider class.
+ */
+ struct Property
+ {
+ enum
+ {
+ LOWER_BOUND = PROPERTY_START_INDEX, ///< Property, name "lower-bound", type FLOAT
+ UPPER_BOUND, ///< Property, name "upper-bound", type FLOAT
+ VALUE, ///< Property, name "value", type FLOAT
+ HIT_REGION, ///< Property, name "hit-region", type VECTOR2
+ BACKING_REGION, ///< Property, name "backing-region", type VECTOR2
+ HANDLE_REGION, ///< Property, name "handle-region", type VECTOR2
+ BACKING_IMAGE_NAME, ///< Property, name "backing-image-name", type STRING
+ HANDLE_IMAGE_NAME, ///< Property, name "handle-image-name", type STRING
+ PROGRESS_IMAGE_NAME, ///< Property, name "progress-image-name", type STRING
+ POPUP_IMAGE_NAME, ///< Property, name "popup-image-name", type STRING
+ POPUP_ARROW_IMAGE_NAME, ///< Property, name "popup-arrow-image-name", type STRING
+ DISABLE_COLOR, ///< Property, name "disable-color", type VECTOR4
+ POPUP_TEXT_COLOR, ///< Property, name "popup-text-color", type VECTOR4
+ VALUE_PRECISION, ///< Property, name "value-precision", type INTEGER
+ SHOW_POPUP, ///< Property, name "show-popup", type BOOLEAN
+ SHOW_VALUE, ///< Property, name "show-value", type BOOLEAN
+ ENABLED, ///< Property, name "enabled", type BOOLEAN
+ MARKS, ///< Property, name "marks", type Property::Array<FLOAT>
+ SNAP_TO_MARKS, ///< Property, name "snap-to-marks", type BOOLEAN
+ MARK_TOLERANCE, ///< Property, name "mark-tolerance", type FLOAT
+ };
+ };
public:
{
public:
- // Properties
- static const Dali::Property::Index PROPERTY_IMAGE; ///< name "image", @see SetImage, type MAP
+ /**
+ * @brief The start and end property ranges for this control.
+ */
+ enum PropertyRange
+ {
+ PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
+ PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserve property indices
+ };
+
+ /**
+ * @brief An enumeration of properties belonging to the SuperBlurView class.
+ */
+ struct Property
+ {
+ enum
+ {
+ IMAGE = PROPERTY_START_INDEX, ///< name "image", @see SetImage, type MAP
+ };
+ };
/**
* @brief Signal type for notifications.
{
public:
- /// @name Properties
- /** @{ */
- static const Dali::Property::Index PROPERTY_ROWS; ///< name "rows", type UNSIGNED_INTEGER
- static const Dali::Property::Index PROPERTY_COLUMNS; ///< name "columns", type UNSIGNED_INTEGER
- static const Dali::Property::Index PROPERTY_CELL_PADDING; ///< name "cell-padding", type VECTOR2
-
- /*
- * PROPERTY_LAYOUT_ROWS set the height of the rows
+ /**
+ * @brief The start and end property ranges for this control.
+ */
+ enum PropertyRange
+ {
+ PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
+ PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserve property indices
+ };
+
+ /**
+ * @brief An enumeration of properties belonging to the TableView class.
+ *
+ * LayoutRows: set the height of the rows.
* It has the format as follows in script:
* @code
* "layout-rows":
"2": { "policy": "relative", "value": 0.33 } //@see SetRelativeHeight
}
* @endcode
- */
- static const Dali::Property::Index PROPERTY_LAYOUT_ROWS; ///< name "layout-rows", type MAP
-
- /*
- * PROPERTY_LAYOUT_COLUMNS set the height of the rows
+ *
+ * LayoutColumns: set the height of the rows.
* It has the format as follows in script:
* @code
* "layout-columns":
}
* @endcode
*/
- static const Dali::Property::Index PROPERTY_LAYOUT_COLUMNS; ///< name "layout-columns", type MAP
- /** @} */
-
+ struct Property
+ {
+ enum
+ {
+ ROWS = PROPERTY_START_INDEX, ///< name "rows", type UNSIGNED_INTEGER
+ COLUMNS, ///< name "columns", type UNSIGNED_INTEGER
+ CELL_PADDING, ///< name "cell-padding", type VECTOR2
+ LAYOUT_ROWS, ///< name "layout-rows", type MAP
+ LAYOUT_COLUMNS, ///< name "layout-columns", type MAP
+ };
+ };
// Custom properties for where to put the actor, these properties should be registered to the child which would be added to the table
static const std::string CELL_INDICES_PROPERTY_NAME; ///< Property, name "cell-indices", type VECTOR2
static const std::string ROW_SPAN_PROPERTY_NAME; ///< Property, name "row-span", type FLOAT (Currently builder unable to differentiate integer and float from Json string)
static const std::string COLUMN_SPAN_PROPERTY_NAME; ///< Property, name "column-span", type FLOAT (Currently builder unable to differentiate integer and float from Json string)
-
/**
* @brief Describes how the size of a row / column been set
*/
{
enum
{
- PROPERTY_RENDERING_BACKEND = PROPERTY_START_INDEX, ///< name "rendering-backend", The type or rendering e.g. bitmap-based, type INT
- PROPERTY_PLACEHOLDER_TEXT, ///< name "placeholder-text", The text to display when the TextField is empty, type STRING
- PROPERTY_TEXT, ///< name "text", The text to display in UTF-8 format, type STRING
- PROPERTY_FONT_FAMILY, ///< name "font-family", The requested font family, type STRING
- PROPERTY_FONT_STYLE, ///< name "font-style", The requested font style e.g. Regular/Italic, type STRING
- PROPERTY_POINT_SIZE, ///< name "point-size", The size of font in points, type FLOAT
- PROPERTY_CURSOR_IMAGE, ///< name "cursor-image", The image to display for cursors, type STRING
- PROPERTY_PRIMARY_CURSOR_COLOR, ///< name "primary-cursor-color", The color to apply to the primary cursor, type VECTOR4
- PROPERTY_SECONDARY_CURSOR_COLOR, ///< name "secondary-cursor-color", The color to apply to the secondary cursor, type VECTOR4
- PROPERTY_ENABLE_CURSOR_BLINK, ///< name "enable-cursor-blink", Whether the cursor should blink or not, type BOOLEAN
- PROPERTY_CURSOR_BLINK_INTERVAL, ///< name "cursor-blink-interval", The time interval between cursor on/off states, type FLOAT
- PROPERTY_CURSOR_BLINK_DURATION, ///< name "cursor-blink-duration", The cursor will stop blinking after this duration (if non-zero), type FLOAT
- PROPERTY_GRAB_HANDLE_IMAGE, ///< name "grab-handle-image", The image to display for grab handle, type STRING
- PROPERTY_DECORATION_BOUNDING_BOX ///< name "decoration-bounding-box", The decorations (handles etc) will positioned within this area on-screen, type RECTANGLE
+ RENDERING_BACKEND = PROPERTY_START_INDEX, ///< name "rendering-backend", The type or rendering e.g. bitmap-based, type INT
+ PLACEHOLDER_TEXT, ///< name "placeholder-text", The text to display when the TextField is empty, type STRING
+ TEXT, ///< name "text", The text to display in UTF-8 format, type STRING
+ FONT_FAMILY, ///< name "font-family", The requested font family, type STRING
+ FONT_STYLE, ///< name "font-style", The requested font style e.g. Regular/Italic, type STRING
+ POINT_SIZE, ///< name "point-size", The size of font in points, type FLOAT
+ CURSOR_IMAGE, ///< name "cursor-image", The image to display for cursors, type STRING
+ PRIMARY_CURSOR_COLOR, ///< name "primary-cursor-color", The color to apply to the primary cursor, type VECTOR4
+ SECONDARY_CURSOR_COLOR, ///< name "secondary-cursor-color", The color to apply to the secondary cursor, type VECTOR4
+ ENABLE_CURSOR_BLINK, ///< name "enable-cursor-blink", Whether the cursor should blink or not, type BOOLEAN
+ CURSOR_BLINK_INTERVAL, ///< name "cursor-blink-interval", The time interval between cursor on/off states, type FLOAT
+ CURSOR_BLINK_DURATION, ///< name "cursor-blink-duration", The cursor will stop blinking after this duration (if non-zero), type FLOAT
+ GRAB_HANDLE_IMAGE, ///< name "grab-handle-image", The image to display for grab handle, type STRING
+ DECORATION_BOUNDING_BOX ///< name "decoration-bounding-box", The decorations (handles etc) will positioned within this area on-screen, type RECTANGLE
};
};
{
enum
{
- PROPERTY_RENDERING_BACKEND = PROPERTY_START_INDEX, ///< name "rendering-backend", The type or rendering e.g. bitmap-based, type INT
- PROPERTY_TEXT, ///< name "text", The text to display in UTF-8 format, type STRING
- PROPERTY_FONT_FAMILY, ///< name "font-family", The requested font family, type STRING
- PROPERTY_FONT_STYLE, ///< name "font-style", The requested font style e.g. Regular/Italic, type STRING
- PROPERTY_POINT_SIZE, ///< name "point-size", The size of font in points, type FLOAT
- PROPERTY_MULTI_LINE, ///< name "multi-line", The single-line or multi-line layout option, type BOOLEAN
+ RENDERING_BACKEND = PROPERTY_START_INDEX, ///< name "rendering-backend", The type or rendering e.g. bitmap-based, type INT
+ TEXT, ///< name "text", The text to display in UTF-8 format, type STRING
+ FONT_FAMILY, ///< name "font-family", The requested font family, type STRING
+ FONT_STYLE, ///< name "font-style", The requested font style e.g. Regular/Italic, type STRING
+ POINT_SIZE, ///< name "point-size", The size of font in points, type FLOAT
+ MULTI_LINE, ///< name "multi-line", The single-line or multi-line layout option, type BOOLEAN
};
};
}
#endif //#ifndef __DALI_TOOLKIT_SHADER_EFFECT_DISPLACEMENT_H__
-
Dali::Toolkit::DissolveEffect handle( shaderEffectCustom );
handle.SetUniform( DISTORTION_PROPERTY_NAME, 0.0f );
- handle.SetProperty( ShaderEffect::Property::GridDensity, Dali::Property::Value(50.0f) );
+ handle.SetProperty( ShaderEffect::Property::GRID_DENSITY, Dali::Property::Value(50.0f) );
handle.SetCentralLine( Vector2(1.0f,0.5f), Vector2(-1.0f, 0.0f) );
handle.SetRadius(i, 0.f);
handle.SetDistortion( i, 0.f );
}
- handle.SetProperty( ShaderEffect::Property::GridDensity, Dali::Property::Value(5.f) );
+ handle.SetProperty( ShaderEffect::Property::GRID_DENSITY, Dali::Property::Value(5.f) );
handle.SetTransparency( 0.5f );
return handle;
} // namespace Dali
#endif // __DALI_TOOLKIT_MIRROR_EFFECT_H__
-
Dali::Property::Index uModelProperty = newEffect.GetPropertyIndex( MOTION_BLUR_MODEL_LASTFRAME );
Constraint constraint = Constraint::New<Matrix>( uModelProperty,
- Source( renderable, Actor::Property::WorldMatrix ),
+ Source( renderable, Actor::Property::WORLD_MATRIX ),
EqualToConstraint() );
// and set up constraint.
}
#endif //#ifndef __DALI_TOOLKIT_SHADER_EFFECT_MOTION_BLUR_H__
-
Dali::Property::Index uModelProperty = newEffect.GetPropertyIndex( MOTION_STRETCH_MODELVIEW_LASTFRAME );
Constraint constraint = Constraint::New<Matrix>( uModelProperty,
- Source( renderable, Actor::Property::WorldMatrix ),
+ Source( renderable, Actor::Property::WORLD_MATRIX ),
EqualToConstraint() );
// and set up constraint.
}
#endif //#ifndef __DALI_TOOLKIT_SHADER_EFFECT_MOTION_STRETCH_H__
-
maskEffect.SetUniform( "uImageSize", Vector2(0,0) /*Constrained to actor size*/ );
maskEffect.ApplyConstraint( Constraint::New<Vector2>( maskEffect.GetPropertyIndex("uImageSize"),
- Source(actor, Actor::Property::Size),
+ Source(actor, Actor::Property::SIZE),
NinePatchMaskEffectSizeConstraint() ) );
maskEffect.SetUniform( "uMaskSize", maskSize );
}
#endif //#ifndef __DALI_TOOLKIT_SHADER_EFFECT_SOFT_BUTTON_H__
-
<tr> <td>Default</td> <td>Properties defined within DALi Core, e.g. Dali::Actor, Dali::ShaderEffect default properties etc.</td> <td style="text-align:center;">0 to 9999999</td> </tr>
<tr> <td>Registered</td> <td>Properties registered using Dali::PropertyRegistration</td> <td style="text-align:center;">10000000 to 19999999</td> </tr>
<tr> <td>Control</td> <td>Property range reserved by Dali::Toolkit::Control</td> <td style="text-align:center;">10000000 to 10001000<br>
- \link Dali::Toolkit::Internal::Control::CONTROL_PROPERTY_START_INDEX CONTROL_PROPERTY_START_INDEX\endlink
- to \link Dali::Toolkit::Internal::Control::CONTROL_PROPERTY_END_INDEX CONTROL_PROPERTY_END_INDEX\endlink</td> </tr>
+ \link Dali::Toolkit::Control::CONTROL_PROPERTY_START_INDEX CONTROL_PROPERTY_START_INDEX\endlink
+ to \link Dali::Toolkit::Control::CONTROL_PROPERTY_END_INDEX CONTROL_PROPERTY_END_INDEX\endlink</td> </tr>
<tr> <td>Derived Control</td> <td>Property range for control deriving directly from Dali::Toolkit::Control</td> <td style="text-align:center;">10001001 to 19999999</td> </tr>
<tr> <td>Custom</td> <td>Custom properties added to instance using Dali::Handle::RegisterProperty</td> <td style="text-align:center;">50000000 onwards</td> </tr>
</table>
Furthermore, if deriving from \link Dali::Toolkit::Control Control\endlink, the control writer
needs to be aware of their parent class's property range. Control reserves a property range between
-\link Dali::Toolkit::Internal::Control::CONTROL_PROPERTY_START_INDEX ControlImpl::CONTROL_PROPERTY_START_INDEX\endlink
-and \link Dali::Toolkit::Internal::Control::CONTROL_PROPERTY_END_INDEX Internal::Control::CONTROL_PROPERTY_END_INDEX\endlink.
+\link Dali::Toolkit::Control::CONTROL_PROPERTY_START_INDEX ControlImpl::CONTROL_PROPERTY_START_INDEX\endlink
+and \link Dali::Toolkit::Control::CONTROL_PROPERTY_END_INDEX Control::CONTROL_PROPERTY_END_INDEX\endlink.
Any deriving control should start their property indices from
-\link Dali::Toolkit::Internal::Control::CONTROL_PROPERTY_END_INDEX Internal::Control::CONTROL_PROPERTY_END_INDEX\endlink + 1.
+\link Dali::Toolkit::Control::CONTROL_PROPERTY_END_INDEX Control::CONTROL_PROPERTY_END_INDEX\endlink + 1.
Please have a look at \ref property-indices for more information.
Constants accessible under the dali global object.
- actor.parentOrigin = dali.BACK_TOP_LEFT;
+ actor.parentOrigin = dali.TOP_LEFT;
actor.color = dali.COLOR_RED;
actor.setBlendFunc( dali.BLEND_FACTOR_ONE_MINUS_SRC_COLOR, dali.BLEND_FACTOR_SRC_ALPHA_SATURATE );
| Constant Name | value |
|---------------|-------|
| ** actor.parentOrigin and actor.anchorPoint ** | |
-|BACK_TOP_LEFT | (0.0f, 0.0f, 0.0f) |
-|BACK_TOP_CENTER | (0.5f, 0.0f, 0.0f) |
-|BACK_TOP_RIGHT | (1.0f, 0.0f, 0.0f) |
-|BACK_CENTER_LEFT | (0.0f, 0.5f, 0.0f) |
-|BACK_CENTER | (0.5f, 0.5f, 0.0f) |
-|BACK_CENTER_RIGHT | (1.0f, 0.5f, 0.0f) |
-|BACK_BOTTOM_LEFT | (0.0f, 1.0f, 0.0f) |
-|BACK_BOTTOM_CENTER | (0.5f, 1.0f, 0.0f) |
-|BACK_BOTTOM_RIGHT | (1.0f, 1.0f, 0.0f) |
|TOP_LEFT | (0.0f, 0.0f, 0.5f) |
|TOP_CENTER | (0.5f, 0.0f, 0.5f) |
|TOP_RIGHT | (1.0f, 0.0f, 0.5f) |
|BOTTOM_CENTER | (0.5f, 1.0f, 0.5f) |
|BOTTOM_RIGHT | (1.0f, 1.0f, 0.5f) |
-|FRONT_TOP_LEFT | (0.0f, 0.0f, 1.0f) |
-|FRONT_TOP_CENTER | (0.5f, 0.0f, 1.0f) |
-|FRONT_TOP_RIGHT | (1.0f, 0.0f, 1.0f) |
-|FRONT_CENTER_LEFT | (0.0f, 0.5f, 1.0f) |
-|FRONT_CENTER | (0.5f, 0.5f, 1.0f) |
-|FRONT_CENTER_RIGHT | (1.0f, 0.5f, 1.0f) |
-|FRONT_BOTTOM_LEFT | (0.0f, 1.0f, 1.0f) |
-|FRONT_BOTTOM_CENTER | (0.5f, 1.0f, 1.0f) |
-|FRONT_BOTTOM_RIGHT | (1.0f, 1.0f, 1.0f) |
-
|** Vector3 ** | |
|VECTOR3_ONE | (1.0f, 1.0f, 1.0f) |
// if we go to 1.0 then it will go to a full box
shaderAnim.animateTo( revealEffect, "uRadius", 0.5,animOptions);
shaderAnim.play();
-
+```
* * *
### Example of paper twisting in the wind with color (Vertex + Fragment Shader)
<img src="../assets/img/shader-grid-hint.png">
-
+```
createTwistEffect = function()
{
const Vector3Pair Vector3Table[] =
{
- { "BACK_TOP_LEFT" , ParentOrigin::BACK_TOP_LEFT },
- { "BACK_TOP_CENTER" , ParentOrigin::BACK_TOP_CENTER },
- { "BACK_TOP_RIGHT" , ParentOrigin::BACK_TOP_RIGHT },
- { "BACK_CENTER_LEFT" , ParentOrigin::BACK_CENTER_LEFT },
- { "BACK_CENTER" , ParentOrigin::BACK_CENTER },
- { "BACK_CENTER_RIGHT" , ParentOrigin::BACK_CENTER_RIGHT },
- { "BACK_BOTTOM_LEFT" , ParentOrigin::BACK_BOTTOM_LEFT },
- { "BACK_BOTTOM_CENTER" , ParentOrigin::BACK_BOTTOM_CENTER },
- { "BACK_BOTTOM_RIGHT" , ParentOrigin::BACK_BOTTOM_RIGHT },
-
{ "TOP_LEFT" , ParentOrigin::TOP_LEFT },
{ "TOP_CENTER" , ParentOrigin::TOP_CENTER },
{ "TOP_RIGHT" , ParentOrigin::TOP_RIGHT },
{ "BOTTOM_CENTER" , ParentOrigin::BOTTOM_CENTER },
{ "BOTTOM_RIGHT" , ParentOrigin::BOTTOM_RIGHT },
- { "FRONT_TOP_LEFT" , ParentOrigin::FRONT_TOP_LEFT },
- { "FRONT_TOP_CENTER" , ParentOrigin::FRONT_TOP_CENTER },
- { "FRONT_TOP_RIGHT" , ParentOrigin::FRONT_TOP_RIGHT },
- { "FRONT_CENTER_LEFT" , ParentOrigin::FRONT_CENTER_LEFT },
- { "FRONT_CENTER" , ParentOrigin::FRONT_CENTER },
- { "FRONT_CENTER_RIGHT" , ParentOrigin::FRONT_CENTER_RIGHT },
- { "FRONT_BOTTOM_LEFT" , ParentOrigin::FRONT_BOTTOM_LEFT },
- { "FRONT_BOTTOM_CENTER" , ParentOrigin::FRONT_BOTTOM_CENTER},
- { "FRONT_BOTTOM_RIGHT" , ParentOrigin::FRONT_BOTTOM_RIGHT },
-
-
{ "VECTOR3_ONE" , Vector3::ONE },
{ "VECTOR3_XAXIS" , Vector3::XAXIS },
{ "VECTOR3_YAXIS" , Vector3::YAXIS },