// 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;
}
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;
{
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;
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 );
// 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__
-
#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;
}
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"
#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;
#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 )
#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);
#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
///////////////////////////////////////////////////////////////////////////////////////////////////
#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()
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()
}
#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;
// 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 )
{
#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 );
-
}
// 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"
#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
{
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
*/
#include <dali/public-api/events/key-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/public-api/object/property-notification.h>
#include <dali/integration-api/debug.h>
#include <dali/public-api/images/resource-image.h>
const Vector3 UI_OFFSET(0.0f, 0.0f, UI_Z_OFFSET); ///< Text Selection Handles/Cursor offset.
const Vector3 DEFAULT_HANDLE_ONE_OFFSET(0.0f, -5.0f, 0.0f); ///< Handle One's Offset
const Vector3 DEFAULT_HANDLE_TWO_OFFSET(0.0f, -5.0f, 0.0f); ///< Handle Two's Offset
-const float TOP_HANDLE_TOP_OFFSET( 34.0f); ///< Offset between top handle and cutCopyPaste pop-up
-const float BOTTOM_HANDLE_BOTTOM_OFFSET(34.0f); ///< Offset between bottom handle and cutCopyPaste pop-up
+const float TOP_HANDLE_TOP_OFFSET( 34.0f); ///< Offset between top handle and cutCopyPaste pop-up
+const float BOTTOM_HANDLE_BOTTOM_OFFSET(34.0f); ///< Offset between bottom handle and cutCopyPaste pop-up
const float CURSOR_THICKNESS(4.0f);
const Degree CURSOR_ANGLE_OFFSET(2.0f); ///< Offset from the angle of italic angle.
const Vector4 DEFAULT_CURSOR_COLOR(1.0f, 1.0f, 1.0f, 1.0f);
-const std::string NEWLINE( "\n" );
+const char* const NEWLINE = "\n";
const TextStyle DEFAULT_TEXT_STYLE;
namespace Toolkit
{
-// Properties
-const Property::Index TextInput::HIGHLIGHT_COLOR_PROPERTY = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX;
-const Property::Index TextInput::CUT_AND_PASTE_COLOR_PROPERTY = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+1;
-const Property::Index TextInput::CUT_AND_PASTE_PRESSED_COLOR_PROPERTY = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+2;
-const Property::Index TextInput::CUT_AND_PASTE_BORDER_COLOR_PROPERTY = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+3;
-const Property::Index TextInput::CUT_AND_PASTE_ICON_COLOR_PROPERTY = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+4;
-const Property::Index TextInput::CUT_AND_PASTE_ICON_PRESSED_COLOR_PROPERTY = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+5;
-const Property::Index TextInput::CUT_AND_PASTE_TEXT_COLOR_PROPERTY = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+6;
-const Property::Index TextInput::CUT_AND_PASTE_TEXT_PRESSED_COLOR_PROPERTY = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+7;
-const Property::Index TextInput::CUT_BUTTON_POSITION_PRIORITY_PROPERTY = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+8;
-const Property::Index TextInput::COPY_BUTTON_POSITION_PRIORITY_PROPERTY = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+9;
-const Property::Index TextInput::PASTE_BUTTON_POSITION_PRIORITY_PROPERTY = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+10;
-const Property::Index TextInput::SELECT_BUTTON_POSITION_PRIORITY_PROPERTY = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+11;
-const Property::Index TextInput::SELECT_ALL_BUTTON_POSITION_PRIORITY_PROPERTY = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+12;
-const Property::Index TextInput::CLIPBOARD_BUTTON_POSITION_PRIORITY_PROPERTY = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+13;
-const Property::Index TextInput::POP_UP_OFFSET_FROM_TEXT_PROPERTY = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+14;
-const Property::Index TextInput::CURSOR_COLOR_PROPERTY = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+15;
-
namespace Internal
{
-namespace
+namespace // Unnamed namespace
{
-// Signals
-
-const char* const SIGNAL_START_INPUT = "start-input";
-const char* const SIGNAL_END_INPUT = "end-input";
-const char* const SIGNAL_STYLE_CHANGED = "style-changed";
-const char* const SIGNAL_MAX_INPUT_CHARACTERS_REACHED = "max-input-characters-reached";
-const char* const SIGNAL_TOOLBAR_DISPLAYED = "toolbar-displayed";
-const char* const SIGNAL_TEXT_EXCEED_BOUNDARIES = "text-exceed-boundaries";
-
BaseHandle Create()
{
return Toolkit::TextInput::New();
}
-TypeRegistration typeRegistration( typeid( Toolkit::TextInput ), typeid( Toolkit::Control ), Create );
+// Setup properties, signals and actions using the type-registry.
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::TextInput, Toolkit::Control, Create )
-SignalConnectorType signalConnector1( typeRegistration, SIGNAL_START_INPUT, &TextInput::DoConnectSignal );
-SignalConnectorType signalConnector2( typeRegistration, SIGNAL_END_INPUT, &TextInput::DoConnectSignal );
-SignalConnectorType signalConnector3( typeRegistration, SIGNAL_STYLE_CHANGED, &TextInput::DoConnectSignal );
-SignalConnectorType signalConnector4( typeRegistration, SIGNAL_MAX_INPUT_CHARACTERS_REACHED, &TextInput::DoConnectSignal );
-SignalConnectorType signalConnector5( typeRegistration, SIGNAL_TOOLBAR_DISPLAYED, &TextInput::DoConnectSignal );
-SignalConnectorType signalConnector6( typeRegistration, SIGNAL_TEXT_EXCEED_BOUNDARIES, &TextInput::DoConnectSignal );
+DALI_PROPERTY_REGISTRATION( TextInput, "highlight-color", VECTOR4, HIGHLIGHT_COLOR )
+DALI_PROPERTY_REGISTRATION( TextInput, "cut-and-paste-bg-color", VECTOR4, CUT_AND_PASTE_COLOR )
+DALI_PROPERTY_REGISTRATION( TextInput, "cut-and-paste-pressed-color", VECTOR4, CUT_AND_PASTE_PRESSED_COLOR )
+DALI_PROPERTY_REGISTRATION( TextInput, "cut-and-paste-border-color", VECTOR4, CUT_AND_PASTE_BORDER_COLOR )
+DALI_PROPERTY_REGISTRATION( TextInput, "cut-and-paste-icon-color", VECTOR4, CUT_AND_PASTE_ICON_COLOR )
+DALI_PROPERTY_REGISTRATION( TextInput, "cut-and-paste-icon-pressed-color", VECTOR4, CUT_AND_PASTE_ICON_PRESSED_COLOR )
+DALI_PROPERTY_REGISTRATION( TextInput, "cut-and-paste-text-color", VECTOR4, CUT_AND_PASTE_TEXT_COLOR )
+DALI_PROPERTY_REGISTRATION( TextInput, "cut-and-paste-text-pressed-color", VECTOR4, CUT_AND_PASTE_TEXT_PRESSED_COLOR )
+DALI_PROPERTY_REGISTRATION( TextInput, "cut-button-position-priority", UNSIGNED_INTEGER, CUT_BUTTON_POSITION_PRIORITY )
+DALI_PROPERTY_REGISTRATION( TextInput, "copy-button-position-priority", UNSIGNED_INTEGER, COPY_BUTTON_POSITION_PRIORITY )
+DALI_PROPERTY_REGISTRATION( TextInput, "paste-button-position-priority", UNSIGNED_INTEGER, PASTE_BUTTON_POSITION_PRIORITY )
+DALI_PROPERTY_REGISTRATION( TextInput, "select-button-position-priority", UNSIGNED_INTEGER, SELECT_BUTTON_POSITION_PRIORITY )
+DALI_PROPERTY_REGISTRATION( TextInput, "select-all-button-position-priority", UNSIGNED_INTEGER, SELECT_ALL_BUTTON_POSITION_PRIORITY )
+DALI_PROPERTY_REGISTRATION( TextInput, "clipboard-button-position-priority", UNSIGNED_INTEGER, CLIPBOARD_BUTTON_POSITION_PRIORITY )
+DALI_PROPERTY_REGISTRATION( TextInput, "popup-offset-from-text", VECTOR4, POP_UP_OFFSET_FROM_TEXT )
+DALI_PROPERTY_REGISTRATION( TextInput, "cursor-color", VECTOR4, CURSOR_COLOR )
-}
+DALI_SIGNAL_REGISTRATION( TextInput, "start-input", SIGNAL_START_INPUT )
+DALI_SIGNAL_REGISTRATION( TextInput, "end-input", SIGNAL_END_INPUT )
+DALI_SIGNAL_REGISTRATION( TextInput, "style-changed", SIGNAL_STYLE_CHANGED )
+DALI_SIGNAL_REGISTRATION( TextInput, "max-input-characters-reached", SIGNAL_MAX_INPUT_CHARACTERS_REACHED )
+DALI_SIGNAL_REGISTRATION( TextInput, "toolbar-displayed", SIGNAL_TOOLBAR_DISPLAYED )
+DALI_SIGNAL_REGISTRATION( TextInput, "text-exceed-boundaries", SIGNAL_TEXT_EXCEED_BOUNDARIES )
-PropertyRegistration property1( typeRegistration, "highlight-color", Toolkit::TextInput::HIGHLIGHT_COLOR_PROPERTY, Property::VECTOR4, &TextInput::SetProperty, &TextInput::GetProperty );
-PropertyRegistration property2( typeRegistration, "cut-and-paste-bg-color", Toolkit::TextInput::CUT_AND_PASTE_COLOR_PROPERTY, Property::VECTOR4, &TextInput::SetProperty, &TextInput::GetProperty );
-PropertyRegistration property3( typeRegistration, "cut-and-paste-pressed-color", Toolkit::TextInput::CUT_AND_PASTE_PRESSED_COLOR_PROPERTY, Property::VECTOR4, &TextInput::SetProperty, &TextInput::GetProperty );
-PropertyRegistration property4( typeRegistration, "cut-and-paste-icon-color", Toolkit::TextInput::CUT_AND_PASTE_ICON_COLOR_PROPERTY, Property::VECTOR4, &TextInput::SetProperty, &TextInput::GetProperty );
-PropertyRegistration property5( typeRegistration, "cut-and-paste-icon-pressed-color", Toolkit::TextInput::CUT_AND_PASTE_ICON_PRESSED_COLOR_PROPERTY, Property::VECTOR4, &TextInput::SetProperty, &TextInput::GetProperty );
-PropertyRegistration property6( typeRegistration, "cut-and-paste-text-color", Toolkit::TextInput::CUT_AND_PASTE_TEXT_COLOR_PROPERTY, Property::VECTOR4, &TextInput::SetProperty, &TextInput::GetProperty );
-PropertyRegistration property7( typeRegistration, "cut-and-paste-text-pressed-color", Toolkit::TextInput::CUT_AND_PASTE_TEXT_PRESSED_COLOR_PROPERTY, Property::VECTOR4, &TextInput::SetProperty, &TextInput::GetProperty );
-PropertyRegistration property8( typeRegistration, "cut-and-paste-border-color", Toolkit::TextInput::CUT_AND_PASTE_BORDER_COLOR_PROPERTY, Property::VECTOR4, &TextInput::SetProperty, &TextInput::GetProperty );
-PropertyRegistration property9( typeRegistration, "cut-button-position-priority", Toolkit::TextInput::CUT_BUTTON_POSITION_PRIORITY_PROPERTY, Property::UNSIGNED_INTEGER, &TextInput::SetProperty, &TextInput::GetProperty );
-PropertyRegistration property10( typeRegistration, "copy-button-position-priority", Toolkit::TextInput::COPY_BUTTON_POSITION_PRIORITY_PROPERTY, Property::UNSIGNED_INTEGER, &TextInput::SetProperty, &TextInput::GetProperty );
-PropertyRegistration property11( typeRegistration, "paste-button-position-priority", Toolkit::TextInput::PASTE_BUTTON_POSITION_PRIORITY_PROPERTY, Property::UNSIGNED_INTEGER, &TextInput::SetProperty, &TextInput::GetProperty );
-PropertyRegistration property12( typeRegistration, "select-button-position-priority", Toolkit::TextInput::SELECT_BUTTON_POSITION_PRIORITY_PROPERTY, Property::UNSIGNED_INTEGER, &TextInput::SetProperty, &TextInput::GetProperty );
-PropertyRegistration property13( typeRegistration, "select-all-button-position-priority", Toolkit::TextInput::SELECT_ALL_BUTTON_POSITION_PRIORITY_PROPERTY, Property::UNSIGNED_INTEGER, &TextInput::SetProperty, &TextInput::GetProperty );
-PropertyRegistration property14( typeRegistration, "clipboard-button-position-priority", Toolkit::TextInput::CLIPBOARD_BUTTON_POSITION_PRIORITY_PROPERTY, Property::UNSIGNED_INTEGER, &TextInput::SetProperty, &TextInput::GetProperty );
-PropertyRegistration property15( typeRegistration, "popup-offset-from-text", Toolkit::TextInput::POP_UP_OFFSET_FROM_TEXT_PROPERTY, Property::VECTOR4, &TextInput::SetProperty, &TextInput::GetProperty );
-PropertyRegistration property16( typeRegistration, "cursor-color", Toolkit::TextInput::CURSOR_COLOR_PROPERTY, Property::VECTOR4, &TextInput::SetProperty, &TextInput::GetProperty );
+DALI_TYPE_REGISTRATION_END()
+}
// [TextInput::HighlightInfo] /////////////////////////////////////////////////
switch ( propertyIndex )
{
- case Toolkit::TextInput::HIGHLIGHT_COLOR_PROPERTY:
+ case Toolkit::TextInput::Property::HIGHLIGHT_COLOR:
{
textInputImpl.SetMaterialDiffuseColor( value.Get< Vector4 >() );
break;
}
- case Toolkit::TextInput::CUT_AND_PASTE_COLOR_PROPERTY:
+ case Toolkit::TextInput::Property::CUT_AND_PASTE_COLOR:
{
textInputImpl.mPopupPanel.SetCutPastePopupColor( value.Get< Vector4 >() );
break;
}
- case Toolkit::TextInput::CUT_AND_PASTE_PRESSED_COLOR_PROPERTY:
+ case Toolkit::TextInput::Property::CUT_AND_PASTE_PRESSED_COLOR:
{
textInputImpl.mPopupPanel.SetCutPastePopupPressedColor( value.Get< Vector4 >() );
break;
}
- case Toolkit::TextInput::CUT_AND_PASTE_BORDER_COLOR_PROPERTY:
+ case Toolkit::TextInput::Property::CUT_AND_PASTE_BORDER_COLOR:
{
textInputImpl.mPopupPanel.SetCutPastePopupBorderColor( value.Get< Vector4 >() );
break;
}
- case Toolkit::TextInput::CUT_AND_PASTE_ICON_COLOR_PROPERTY:
+ case Toolkit::TextInput::Property::CUT_AND_PASTE_ICON_COLOR:
{
textInputImpl.mPopupPanel.SetCutPastePopupIconColor( value.Get< Vector4 >() );
break;
}
- case Toolkit::TextInput::CUT_AND_PASTE_ICON_PRESSED_COLOR_PROPERTY:
+ case Toolkit::TextInput::Property::CUT_AND_PASTE_ICON_PRESSED_COLOR:
{
textInputImpl.mPopupPanel.SetCutPastePopupIconPressedColor( value.Get< Vector4 >() );
break;
}
- case Toolkit::TextInput::CUT_AND_PASTE_TEXT_COLOR_PROPERTY:
+ case Toolkit::TextInput::Property::CUT_AND_PASTE_TEXT_COLOR:
{
textInputImpl.mPopupPanel.SetCutPastePopupTextColor( value.Get< Vector4 >() );
break;
}
- case Toolkit::TextInput::CUT_AND_PASTE_TEXT_PRESSED_COLOR_PROPERTY:
+ case Toolkit::TextInput::Property::CUT_AND_PASTE_TEXT_PRESSED_COLOR:
{
textInputImpl.mPopupPanel.SetCutPastePopupTextPressedColor( value.Get< Vector4 >() );
break;
}
- case Toolkit::TextInput::CUT_BUTTON_POSITION_PRIORITY_PROPERTY:
+ case Toolkit::TextInput::Property::CUT_BUTTON_POSITION_PRIORITY:
{
textInputImpl.mPopupPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsCut, value.Get<unsigned int>() );
break;
}
- case Toolkit::TextInput::COPY_BUTTON_POSITION_PRIORITY_PROPERTY:
+ case Toolkit::TextInput::Property::COPY_BUTTON_POSITION_PRIORITY:
{
textInputImpl.mPopupPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsCopy, value.Get<unsigned int>() );
break;
}
- case Toolkit::TextInput::PASTE_BUTTON_POSITION_PRIORITY_PROPERTY:
+ case Toolkit::TextInput::Property::PASTE_BUTTON_POSITION_PRIORITY:
{
textInputImpl.mPopupPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsPaste, value.Get<unsigned int>() );
break;
}
- case Toolkit::TextInput::SELECT_BUTTON_POSITION_PRIORITY_PROPERTY:
+ case Toolkit::TextInput::Property::SELECT_BUTTON_POSITION_PRIORITY:
{
textInputImpl.mPopupPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsSelect, value.Get<unsigned int>() );
break;
}
- case Toolkit::TextInput::SELECT_ALL_BUTTON_POSITION_PRIORITY_PROPERTY:
+ case Toolkit::TextInput::Property::SELECT_ALL_BUTTON_POSITION_PRIORITY:
{
textInputImpl.mPopupPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsSelectAll, value.Get<unsigned int>() );
break;
}
- case Toolkit::TextInput::CLIPBOARD_BUTTON_POSITION_PRIORITY_PROPERTY:
+ case Toolkit::TextInput::Property::CLIPBOARD_BUTTON_POSITION_PRIORITY:
{
textInputImpl.mPopupPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsClipboard, value.Get<unsigned int>() );
break;
}
- case Toolkit::TextInput::POP_UP_OFFSET_FROM_TEXT_PROPERTY:
+ case Toolkit::TextInput::Property::POP_UP_OFFSET_FROM_TEXT:
{
textInputImpl.SetOffsetFromText( value.Get< Vector4 >() );
break;
}
- case Toolkit::TextInput::CURSOR_COLOR_PROPERTY:
+ case Toolkit::TextInput::Property::CURSOR_COLOR:
{
textInputImpl.mCursor.SetColor( value.Get< Vector4 >() );
+ break;
}
}
}
switch ( propertyIndex )
{
- case Toolkit::TextInput::HIGHLIGHT_COLOR_PROPERTY:
+ case Toolkit::TextInput::Property::HIGHLIGHT_COLOR:
{
value = textInputImpl.GetMaterialDiffuseColor();
break;
}
- case Toolkit::TextInput::CUT_AND_PASTE_COLOR_PROPERTY:
+ case Toolkit::TextInput::Property::CUT_AND_PASTE_COLOR:
{
value = textInputImpl.mPopupPanel.GetCutPastePopupColor();
break;
}
- case Toolkit::TextInput::CUT_AND_PASTE_PRESSED_COLOR_PROPERTY:
+ case Toolkit::TextInput::Property::CUT_AND_PASTE_PRESSED_COLOR:
{
value = textInputImpl.mPopupPanel.GetCutPastePopupPressedColor();
break;
}
- case Toolkit::TextInput::CUT_AND_PASTE_BORDER_COLOR_PROPERTY :
+ case Toolkit::TextInput::Property::CUT_AND_PASTE_BORDER_COLOR :
{
value = textInputImpl.mPopupPanel.GetCutPastePopupBorderColor();
break;
}
- case Toolkit::TextInput::CUT_AND_PASTE_ICON_COLOR_PROPERTY:
+ case Toolkit::TextInput::Property::CUT_AND_PASTE_ICON_COLOR:
{
value = textInputImpl.mPopupPanel.GetCutPastePopupIconColor();
break;
}
- case Toolkit::TextInput::CUT_AND_PASTE_ICON_PRESSED_COLOR_PROPERTY:
+ case Toolkit::TextInput::Property::CUT_AND_PASTE_ICON_PRESSED_COLOR:
{
value = textInputImpl.mPopupPanel.GetCutPastePopupIconPressedColor();
break;
}
- case Toolkit::TextInput::CUT_AND_PASTE_TEXT_COLOR_PROPERTY:
+ case Toolkit::TextInput::Property::CUT_AND_PASTE_TEXT_COLOR:
{
value = textInputImpl.mPopupPanel.GetCutPastePopupTextColor();
break;
}
- case Toolkit::TextInput::CUT_AND_PASTE_TEXT_PRESSED_COLOR_PROPERTY:
+ case Toolkit::TextInput::Property::CUT_AND_PASTE_TEXT_PRESSED_COLOR:
{
value = textInputImpl.mPopupPanel.GetCutPastePopupTextPressedColor();
break;
}
- case Toolkit::TextInput::CUT_BUTTON_POSITION_PRIORITY_PROPERTY:
+ case Toolkit::TextInput::Property::CUT_BUTTON_POSITION_PRIORITY:
{
value = textInputImpl.mPopupPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsCut );
break;
}
- case Toolkit::TextInput::COPY_BUTTON_POSITION_PRIORITY_PROPERTY:
+ case Toolkit::TextInput::Property::COPY_BUTTON_POSITION_PRIORITY:
{
value = textInputImpl.mPopupPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsCopy );
break;
}
- case Toolkit::TextInput::PASTE_BUTTON_POSITION_PRIORITY_PROPERTY:
+ case Toolkit::TextInput::Property::PASTE_BUTTON_POSITION_PRIORITY:
{
value = textInputImpl.mPopupPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsPaste );
break;
}
- case Toolkit::TextInput::SELECT_BUTTON_POSITION_PRIORITY_PROPERTY:
+ case Toolkit::TextInput::Property::SELECT_BUTTON_POSITION_PRIORITY:
{
value = textInputImpl.mPopupPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsSelect );
break;
}
- case Toolkit::TextInput::SELECT_ALL_BUTTON_POSITION_PRIORITY_PROPERTY:
+ case Toolkit::TextInput::Property::SELECT_ALL_BUTTON_POSITION_PRIORITY:
{
value = textInputImpl.mPopupPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsSelectAll );
break;
}
- case Toolkit::TextInput::CLIPBOARD_BUTTON_POSITION_PRIORITY_PROPERTY:
+ case Toolkit::TextInput::Property::CLIPBOARD_BUTTON_POSITION_PRIORITY:
{
value = textInputImpl.mPopupPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsClipboard );
break;
}
- case Toolkit::TextInput::POP_UP_OFFSET_FROM_TEXT_PROPERTY:
+ case Toolkit::TextInput::Property::POP_UP_OFFSET_FROM_TEXT:
{
value = textInputImpl.GetOffsetFromText();
break;
}
- case Toolkit::TextInput::CURSOR_COLOR_PROPERTY:
+ case Toolkit::TextInput::Property::CURSOR_COLOR:
{
value = textInputImpl.mCursor.GetCurrentColor();
}
{
public:
- // Properties
- enum
- {
- TEXTINPUT_PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
- TEXTINPUT_PROPERTY_END_INDEX = TEXTINPUT_PROPERTY_START_INDEX + 512 ///< Reserving property indices
- };
-
/**
* Create a new TextInput
* @return instrusive ptr to a TextInput
/**
* Image resource paths
*/
-const std::string POPUP_BACKGROUND( DALI_IMAGE_DIR "popup_bubble_bg.#.png" );
-const std::string POPUP_BACKGROUND_EFFECT( DALI_IMAGE_DIR "popup_bubble_bg_ef.#.png" );
-const std::string POPUP_BACKGROUND_LINE( DALI_IMAGE_DIR "popup_bubble_bg_line.#.png" );
-
-const std::string POPUP_TAIL_BOTTOM( DALI_IMAGE_DIR "popup_bubble_tail_bottom.png" );
-const std::string POPUP_TAIL_BOTTOM_EFFECT( DALI_IMAGE_DIR "popup_bubble_tail_bottom_ef.png" );
-const std::string POPUP_TAIL_BOTTOM_LINE( DALI_IMAGE_DIR "popup_bubble_tail_bottom_line.png" );
-const std::string POPUP_TAIL_TOP( DALI_IMAGE_DIR "popup_bubble_tail_top.png" );
-const std::string POPUP_TAIL_TOP_EFFECT( DALI_IMAGE_DIR "popup_bubble_tail_top_ef.png" );
-const std::string POPUP_TAIL_TOP_LINE( DALI_IMAGE_DIR "popup_bubble_tail_top_line.png" );
-
-const std::string OPTION_ICON_CLIPBOARD( DALI_IMAGE_DIR "copy_paste_icon_clipboard.png" );
-const std::string OPTION_ICON_COPY( DALI_IMAGE_DIR "copy_paste_icon_copy.png" );
-const std::string OPTION_ICON_CUT( DALI_IMAGE_DIR "copy_paste_icon_cut.png" );
-const std::string OPTION_ICON_PASTE( DALI_IMAGE_DIR "copy_paste_icon_paste.png" );
-const std::string OPTION_ICON_SELECT( DALI_IMAGE_DIR "copy_paste_icon_select.png" );
-const std::string OPTION_ICON_SELECT_ALL( DALI_IMAGE_DIR "copy_paste_icon_select_all.png" );
+const char* const POPUP_BACKGROUND = DALI_IMAGE_DIR "popup_bubble_bg.#.png";
+const char* const POPUP_BACKGROUND_EFFECT = DALI_IMAGE_DIR "popup_bubble_bg_ef.#.png";
+const char* const POPUP_BACKGROUND_LINE = DALI_IMAGE_DIR "popup_bubble_bg_line.#.png";
+
+const char* const POPUP_TAIL_BOTTOM = DALI_IMAGE_DIR "popup_bubble_tail_bottom.png";
+const char* const POPUP_TAIL_BOTTOM_EFFECT = DALI_IMAGE_DIR "popup_bubble_tail_bottom_ef.png";
+const char* const POPUP_TAIL_BOTTOM_LINE = DALI_IMAGE_DIR "popup_bubble_tail_bottom_line.png";
+const char* const POPUP_TAIL_TOP = DALI_IMAGE_DIR "popup_bubble_tail_top.png";
+const char* const POPUP_TAIL_TOP_EFFECT = DALI_IMAGE_DIR "popup_bubble_tail_top_ef.png";
+const char* const POPUP_TAIL_TOP_LINE = DALI_IMAGE_DIR "popup_bubble_tail_top_line.png";
+
+const char* const OPTION_ICON_CLIPBOARD = DALI_IMAGE_DIR "copy_paste_icon_clipboard.png";
+const char* const OPTION_ICON_COPY = DALI_IMAGE_DIR "copy_paste_icon_copy.png";
+const char* const OPTION_ICON_CUT = DALI_IMAGE_DIR "copy_paste_icon_cut.png";
+const char* const OPTION_ICON_PASTE = DALI_IMAGE_DIR "copy_paste_icon_paste.png";
+const char* const OPTION_ICON_SELECT = DALI_IMAGE_DIR "copy_paste_icon_select.png";
+const char* const OPTION_ICON_SELECT_ALL = DALI_IMAGE_DIR "copy_paste_icon_select_all.png";
/**
* Constant values for building the GUI
// EXTERNAL INCLUDES
#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
namespace Toolkit
{
-const Property::Index TextView::PROPERTY_MARKUP_ENABLED( Internal::TextView::TEXTVIEW_PROPERTY_START_INDEX );
-const Property::Index TextView::PROPERTY_TEXT( Internal::TextView::TEXTVIEW_PROPERTY_START_INDEX + 1 );
-const Property::Index TextView::PROPERTY_MULTILINE_POLICY( Internal::TextView::TEXTVIEW_PROPERTY_START_INDEX + 2 );
-const Property::Index TextView::PROPERTY_WIDTH_EXCEED_POLICY( Internal::TextView::TEXTVIEW_PROPERTY_START_INDEX + 3 );
-const Property::Index TextView::PROPERTY_HEIGHT_EXCEED_POLICY( Internal::TextView::TEXTVIEW_PROPERTY_START_INDEX + 4 );
-const Property::Index TextView::PROPERTY_LINE_JUSTIFICATION( Internal::TextView::TEXTVIEW_PROPERTY_START_INDEX + 5 );
-const Property::Index TextView::PROPERTY_FADE_BOUNDARY( Internal::TextView::TEXTVIEW_PROPERTY_START_INDEX + 6 );
-const Property::Index TextView::PROPERTY_LINE_HEIGHT_OFFSET( Internal::TextView::TEXTVIEW_PROPERTY_START_INDEX + 7 );
-const Property::Index TextView::PROPERTY_HORIZONTAL_ALIGNMENT( Internal::TextView::TEXTVIEW_PROPERTY_START_INDEX + 8 );
-const Property::Index TextView::PROPERTY_VERTICAL_ALIGNMENT( Internal::TextView::TEXTVIEW_PROPERTY_START_INDEX + 9 );
-
namespace Internal
{
namespace
{
-// Signals
-
-const char* const SIGNAL_TEXT_SCROLLED = "scrolled";
-
const char* MULTILINE_POLICY_NAME[] = {"SplitByNewLineChar", "SplitByWord", "SplitByChar"};
const char* EXCEED_POLICY_NAME[] = {"Original", "Truncate", "Fade", "Split","ShrinkToFit","EllipsizeEnd"};
const char* LINE_JUSTIFICATION_NAME[] = {"Left","Center","Right","Justified"};
// Currently on desktop machines 2k x 2k is the maximum frame buffer size, on target is 4k x 4k.
const float MAX_OFFSCREEN_RENDERING_SIZE = 2048.f;
-//Type Registration
+// Type Registration
BaseHandle Create()
{
return Toolkit::TextView::New();
}
-TypeRegistration typeRegistration( typeid( Toolkit::TextView ), typeid( Toolkit::Control ), Create );
+// Setup properties, signals and actions using the type-registry.
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::TextView, Toolkit::Control, Create );
+
+DALI_PROPERTY_REGISTRATION( TextView, "markup-enabled", BOOLEAN, MARKUP_ENABLED )
+DALI_PROPERTY_REGISTRATION( TextView, "text", STRING, TEXT )
+DALI_PROPERTY_REGISTRATION( TextView, "multiline-policy", STRING, MULTILINE_POLICY )
+DALI_PROPERTY_REGISTRATION( TextView, "width-exceed-policy", STRING, WIDTH_EXCEED_POLICY )
+DALI_PROPERTY_REGISTRATION( TextView, "height-exceed-policy", STRING, HEIGHT_EXCEED_POLICY )
+DALI_PROPERTY_REGISTRATION( TextView, "line-justification", STRING, LINE_JUSTIFICATION )
+DALI_PROPERTY_REGISTRATION( TextView, "fade-boundary", VECTOR4, FADE_BOUNDARY )
+DALI_PROPERTY_REGISTRATION( TextView, "line-height-offset", FLOAT, LINE_HEIGHT_OFFSET )
+DALI_PROPERTY_REGISTRATION( TextView, "horizontal-alignment", STRING, HORIZONTAL_ALIGNMENT )
+DALI_PROPERTY_REGISTRATION( TextView, "vertical-alignment", STRING, VERTICAL_ALIGNMENT )
-SignalConnectorType signalConnector1( typeRegistration, SIGNAL_TEXT_SCROLLED , &TextView::DoConnectSignal );
+DALI_SIGNAL_REGISTRATION( TextView, "scrolled", SIGNAL_TEXT_SCROLLED )
-PropertyRegistration property1( typeRegistration, "markup-enabled", Toolkit::TextView::PROPERTY_MARKUP_ENABLED, Property::BOOLEAN, &TextView::SetProperty, &TextView::GetProperty );
-PropertyRegistration property2( typeRegistration, "text", Toolkit::TextView::PROPERTY_TEXT, Property::STRING, &TextView::SetProperty, &TextView::GetProperty );
-PropertyRegistration property3( typeRegistration, "multiline-policy", Toolkit::TextView::PROPERTY_MULTILINE_POLICY, Property::STRING, &TextView::SetProperty, &TextView::GetProperty );
-PropertyRegistration property4( typeRegistration, "width-exceed-policy", Toolkit::TextView::PROPERTY_WIDTH_EXCEED_POLICY, Property::STRING, &TextView::SetProperty, &TextView::GetProperty );
-PropertyRegistration property5( typeRegistration, "height-exceed-policy", Toolkit::TextView::PROPERTY_HEIGHT_EXCEED_POLICY, Property::STRING, &TextView::SetProperty, &TextView::GetProperty );
-PropertyRegistration property6( typeRegistration, "line-justification", Toolkit::TextView::PROPERTY_LINE_JUSTIFICATION, Property::STRING, &TextView::SetProperty, &TextView::GetProperty );
-PropertyRegistration property7( typeRegistration, "fade-boundary", Toolkit::TextView::PROPERTY_FADE_BOUNDARY, Property::VECTOR4, &TextView::SetProperty, &TextView::GetProperty );
-PropertyRegistration property8( typeRegistration, "line-height-offset", Toolkit::TextView::PROPERTY_LINE_HEIGHT_OFFSET, Property::FLOAT, &TextView::SetProperty, &TextView::GetProperty );
-PropertyRegistration property9( typeRegistration, "horizontal-alignment", Toolkit::TextView::PROPERTY_HORIZONTAL_ALIGNMENT, Property::STRING, &TextView::SetProperty, &TextView::GetProperty );
-PropertyRegistration property10( typeRegistration, "vertical-alignment", Toolkit::TextView::PROPERTY_VERTICAL_ALIGNMENT, Property::STRING, &TextView::SetProperty, &TextView::GetProperty );
+DALI_TYPE_REGISTRATION_END()
/**
* Whether the text-view-processor operation sets, inserts, replaces, removes text.
{
std::string value( propertyValue.Get<std::string>() );
- if( propertyIndex == Toolkit::TextView::PROPERTY_HORIZONTAL_ALIGNMENT )
+ if( propertyIndex == Toolkit::TextView::Property::HORIZONTAL_ALIGNMENT )
{
if(value == "HorizontalLeft")
{
DALI_ASSERT_ALWAYS( !"TextView::OnAlignmentPropertySet(). Invalid Property value." );
}
}
- else if( propertyIndex == Toolkit::TextView::PROPERTY_VERTICAL_ALIGNMENT )
+ else if( propertyIndex == Toolkit::TextView::Property::VERTICAL_ALIGNMENT )
{
if( value == "VerticalTop" )
{
TextView& textViewImpl( GetImpl( textView ) );
switch( index )
{
- case Toolkit::TextView::PROPERTY_MARKUP_ENABLED:
+ case Toolkit::TextView::Property::MARKUP_ENABLED:
{
textViewImpl.OnMarkupEnabledPeopertySet( value );
break;
}
- case Toolkit::TextView::PROPERTY_TEXT:
+ case Toolkit::TextView::Property::TEXT:
{
textViewImpl.SetText( value.Get<std::string>() );
break;
}
- case Toolkit::TextView::PROPERTY_MULTILINE_POLICY:
+ case Toolkit::TextView::Property::MULTILINE_POLICY:
{
textViewImpl.OnMultilinePolicyPropertySet( value );
break;
}
- case Toolkit::TextView::PROPERTY_WIDTH_EXCEED_POLICY:
+ case Toolkit::TextView::Property::WIDTH_EXCEED_POLICY:
{
textViewImpl.OnWidthExceedPolicyPropertySet( value );
break;
}
- case Toolkit::TextView::PROPERTY_HEIGHT_EXCEED_POLICY:
+ case Toolkit::TextView::Property::HEIGHT_EXCEED_POLICY:
{
textViewImpl.OnHeightExceedPolicyPropertySet( value );
break;
}
- case Toolkit::TextView::PROPERTY_LINE_JUSTIFICATION:
+ case Toolkit::TextView::Property::LINE_JUSTIFICATION:
{
textViewImpl.OnLineJustificationPropertySet( value );
break;
}
- case Toolkit::TextView::PROPERTY_FADE_BOUNDARY:
+ case Toolkit::TextView::Property::FADE_BOUNDARY:
{
textViewImpl.OnFadeBoundaryPropertySet( value );
break;
}
- case Toolkit::TextView::PROPERTY_LINE_HEIGHT_OFFSET:
+ case Toolkit::TextView::Property::LINE_HEIGHT_OFFSET:
{
Dali::PointSize pointSize( value.Get<float>() );
textViewImpl.SetLineHeightOffset(pointSize);
break;
}
- case Toolkit::TextView::PROPERTY_HORIZONTAL_ALIGNMENT:
- case Toolkit::TextView::PROPERTY_VERTICAL_ALIGNMENT:
+ case Toolkit::TextView::Property::HORIZONTAL_ALIGNMENT:
+ case Toolkit::TextView::Property::VERTICAL_ALIGNMENT:
{
textViewImpl.OnAlignmentPropertySet( index, value );
break;
TextView& textViewImpl( GetImpl( textView ) );
switch( index )
{
- case Toolkit::TextView::PROPERTY_MARKUP_ENABLED:
+ case Toolkit::TextView::Property::MARKUP_ENABLED:
{
value = textViewImpl.IsMarkupProcessingEnabled();
break;
}
- case Toolkit::TextView::PROPERTY_TEXT:
+ case Toolkit::TextView::Property::TEXT:
{
value = textViewImpl.GetText();
break;
}
- case Toolkit::TextView::PROPERTY_MULTILINE_POLICY:
+ case Toolkit::TextView::Property::MULTILINE_POLICY:
{
value = MULTILINE_POLICY_NAME[ textViewImpl.GetMultilinePolicy() ];
break;
}
- case Toolkit::TextView::PROPERTY_WIDTH_EXCEED_POLICY:
+ case Toolkit::TextView::Property::WIDTH_EXCEED_POLICY:
{
value = EXCEED_POLICY_NAME[ textViewImpl.GetWidthExceedPolicy() ];
break;
}
- case Toolkit::TextView::PROPERTY_HEIGHT_EXCEED_POLICY:
+ case Toolkit::TextView::Property::HEIGHT_EXCEED_POLICY:
{
value = EXCEED_POLICY_NAME[ textViewImpl.GetHeightExceedPolicy() ];
break;
}
- case Toolkit::TextView::PROPERTY_LINE_JUSTIFICATION:
+ case Toolkit::TextView::Property::LINE_JUSTIFICATION:
{
value = LINE_JUSTIFICATION_NAME[ textViewImpl.GetLineJustification() ];
break;
}
- case Toolkit::TextView::PROPERTY_FADE_BOUNDARY:
+ case Toolkit::TextView::Property::FADE_BOUNDARY:
{
Toolkit::TextView::FadeBoundary boundary = textViewImpl.GetFadeBoundary();
value = Vector4( static_cast<float>( boundary.mLeft.value ),
static_cast<float>( boundary.mBottom.value ) );
break;
}
- case Toolkit::TextView::PROPERTY_LINE_HEIGHT_OFFSET:
+ case Toolkit::TextView::Property::LINE_HEIGHT_OFFSET:
{
value = textViewImpl.GetLineHeightOffset().value;
break;
}
- case Toolkit::TextView::PROPERTY_HORIZONTAL_ALIGNMENT:
+ case Toolkit::TextView::Property::HORIZONTAL_ALIGNMENT:
{
value = textViewImpl.OnHorizontalAlignmentPropertyGet();
break;
}
- case Toolkit::TextView::PROPERTY_VERTICAL_ALIGNMENT:
+ case Toolkit::TextView::Property::VERTICAL_ALIGNMENT:
{
value = textViewImpl.OnVerticalAlignmentPropertyGet();
break;
{
public:
- // Properties
- enum
- {
- TEXTVIEW_PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
- TEXTVIEW_PROPERTY_END_INDEX = TEXTVIEW_PROPERTY_START_INDEX + 1000 ///< Reserving 1000 property indices
- };
-
/**
* Internal exceed policy with the valid combinations.
*/
namespace
{
-const std::string EMOJI_FONT_NAME( "SamsungEmoji" ); // Emoticons font family name.
+const char* const EMOJI_FONT_NAME = "SamsungEmoji"; ///< Emoticons font family name.
} // namespace
#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
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()
{
{
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:
/**
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
*/
public:
- /// @name Properties
- /** @{ */
- static const Dali::Property::Index HIGHLIGHT_COLOR_PROPERTY; // Property, name "highlight-color", type VECTOR4
- static const Dali::Property::Index CUT_AND_PASTE_COLOR_PROPERTY; // Property, name "cut-and-paste-bg-color", type VECTOR4
- static const Dali::Property::Index CUT_AND_PASTE_PRESSED_COLOR_PROPERTY; // Property, name "cut-and-paste-pressed-color", type VECTOR4
- static const Dali::Property::Index CUT_AND_PASTE_BORDER_COLOR_PROPERTY; // Property, name "cut-and-paste-border-color", type VECTOR4
- static const Dali::Property::Index CUT_AND_PASTE_ICON_COLOR_PROPERTY; // Property, name "cut-and-paste-icon-color", type VECTOR4
- static const Dali::Property::Index CUT_AND_PASTE_ICON_PRESSED_COLOR_PROPERTY; // Property, name "cut-and-paste-icon-pressed-color", type VECTOR4
- static const Dali::Property::Index CUT_AND_PASTE_TEXT_COLOR_PROPERTY; // Property, name "cut-and-paste-text-color", type VECTOR4
- static const Dali::Property::Index CUT_AND_PASTE_TEXT_PRESSED_COLOR_PROPERTY; // Property, name "cut-and-paste-text-pressed-color", type VECTOR4
- static const Dali::Property::Index CUT_BUTTON_POSITION_PRIORITY_PROPERTY; // Property, name "cut-button-position-priority", type unsigned int
- static const Dali::Property::Index COPY_BUTTON_POSITION_PRIORITY_PROPERTY; // Property, name "copy-button-position-priority", type unsigned int
- static const Dali::Property::Index PASTE_BUTTON_POSITION_PRIORITY_PROPERTY; // Property, name "paste-button-position-priority", type unsigned int
- static const Dali::Property::Index SELECT_BUTTON_POSITION_PRIORITY_PROPERTY; // Property, name "select-button-position-priority", type unsigned int
- static const Dali::Property::Index SELECT_ALL_BUTTON_POSITION_PRIORITY_PROPERTY; // Property, name "select-all-button-position-priority", type unsigned int
- static const Dali::Property::Index CLIPBOARD_BUTTON_POSITION_PRIORITY_PROPERTY; // Property, name "clipboard-button-position-priority", type unsigned int
- static const Dali::Property::Index POP_UP_OFFSET_FROM_TEXT_PROPERTY; // Property, name "popup-offset-from-text", type VECTOR4
- static const Dali::Property::Index CURSOR_COLOR_PROPERTY; // Property, name "cursor-color", type VECTOR4
- /** @} */
+ /**
+ * @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 + 512 ///< Reserve property indices
+ };
+
+ /**
+ * @brief An enumeration of properties belonging to the TextInput class.
+ */
+ struct Property
+ {
+ enum
+ {
+ HIGHLIGHT_COLOR = PROPERTY_START_INDEX, // Property, name "highlight-color", type VECTOR4
+ CUT_AND_PASTE_COLOR, // Property, name "cut-and-paste-bg-color", type VECTOR4
+ CUT_AND_PASTE_PRESSED_COLOR, // Property, name "cut-and-paste-pressed-color", type VECTOR4
+ CUT_AND_PASTE_BORDER_COLOR, // Property, name "cut-and-paste-border-color", type VECTOR4
+ CUT_AND_PASTE_ICON_COLOR, // Property, name "cut-and-paste-icon-color", type VECTOR4
+ CUT_AND_PASTE_ICON_PRESSED_COLOR, // Property, name "cut-and-paste-icon-pressed-color", type VECTOR4
+ CUT_AND_PASTE_TEXT_COLOR, // Property, name "cut-and-paste-text-color", type VECTOR4
+ CUT_AND_PASTE_TEXT_PRESSED_COLOR, // Property, name "cut-and-paste-text-pressed-color", type VECTOR4
+ CUT_BUTTON_POSITION_PRIORITY, // Property, name "cut-button-position-priority", type UNSIGNED_INTEGER
+ COPY_BUTTON_POSITION_PRIORITY, // Property, name "copy-button-position-priority", type UNSIGNED_INTEGER
+ PASTE_BUTTON_POSITION_PRIORITY, // Property, name "paste-button-position-priority", type UNSIGNED_INTEGER
+ SELECT_BUTTON_POSITION_PRIORITY, // Property, name "select-button-position-priority", type UNSIGNED_INTEGER
+ SELECT_ALL_BUTTON_POSITION_PRIORITY, // Property, name "select-all-button-position-priority", type UNSIGNED_INTEGER
+ CLIPBOARD_BUTTON_POSITION_PRIORITY, // Property, name "clipboard-button-position-priority", type UNSIGNED_INTEGER
+ POP_UP_OFFSET_FROM_TEXT, // Property, name "popup-offset-from-text", type VECTOR4
+ CURSOR_COLOR, // Property, name "cursor-color", type VECTOR4
+ };
+ };
public:
{
public:
- // Properties
- static const Dali::Property::Index PROPERTY_MARKUP_ENABLED; ///< name "markup-enabled", @see SetMarkupProcessingEnabled(), type BOOLEAN
- static const Dali::Property::Index PROPERTY_TEXT; ///< name "text", @see SetText(), type STRING
- static const Dali::Property::Index PROPERTY_MULTILINE_POLICY; ///< name "multiline-policy", @see SetMultilinePolicy(), type STRING
- static const Dali::Property::Index PROPERTY_WIDTH_EXCEED_POLICY; ///< name "width-exceed-policy", @see SetWidthExceedPolicy(), type STRING
- static const Dali::Property::Index PROPERTY_HEIGHT_EXCEED_POLICY; ///< name "height-exceed-policy", @see SetHeightExceedPolicy(), type STRING
- static const Dali::Property::Index PROPERTY_LINE_JUSTIFICATION; ///< name "line-justification", @see SetLineJustification(), type STRING
- static const Dali::Property::Index PROPERTY_FADE_BOUNDARY; ///< name "fade-boundary", @see SetFadeBoundary(), type VECTOR4
- static const Dali::Property::Index PROPERTY_LINE_HEIGHT_OFFSET; ///< name "line-height-offset", @see SetLineHeightOffset(), type FLOAT
- static const Dali::Property::Index PROPERTY_HORIZONTAL_ALIGNMENT; ///< name "horizontal-alignment", @see SetTextAlignment(), type STRING
- static const Dali::Property::Index PROPERTY_VERTICAL_ALIGNMENT; ///< name "vertical-alignment", @see SetTextAlignment(), type STRING
+ /**
+ * @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 TextView class.
+ */
+ struct Property
+ {
+ enum
+ {
+ MARKUP_ENABLED = PROPERTY_START_INDEX, ///< name "markup-enabled", @see SetMarkupProcessingEnabled(), type BOOLEAN
+ TEXT, ///< name "text", @see SetText(), type STRING
+ MULTILINE_POLICY, ///< name "multiline-policy", @see SetMultilinePolicy(), type STRING
+ WIDTH_EXCEED_POLICY, ///< name "width-exceed-policy", @see SetWidthExceedPolicy(), type STRING
+ HEIGHT_EXCEED_POLICY, ///< name "height-exceed-policy", @see SetHeightExceedPolicy(), type STRING
+ LINE_JUSTIFICATION, ///< name "line-justification", @see SetLineJustification(), type STRING
+ FADE_BOUNDARY, ///< name "fade-boundary", @see SetFadeBoundary(), type VECTOR4
+ LINE_HEIGHT_OFFSET, ///< name "line-height-offset", @see SetLineHeightOffset(), type FLOAT
+ HORIZONTAL_ALIGNMENT, ///< name "horizontal-alignment", @see SetTextAlignment(), type STRING
+ VERTICAL_ALIGNMENT, ///< name "vertical-alignment", @see SetTextAlignment(), type STRING
+ };
+ };
/**
* @brief Structure used to retrieve Layout info per character.
}
#endif //#ifndef __DALI_TOOLKIT_SHADER_EFFECT_DISPLACEMENT_H__
-
} // namespace Dali
#endif // __DALI_TOOLKIT_MIRROR_EFFECT_H__
-
}
#endif //#ifndef __DALI_TOOLKIT_SHADER_EFFECT_MOTION_BLUR_H__
-
}
#endif //#ifndef __DALI_TOOLKIT_SHADER_EFFECT_MOTION_STRETCH_H__
-
}
#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.