From: Nick Holland Date: Thu, 12 Mar 2015 09:23:32 +0000 (+0000) Subject: [dali_1.0.33] Merge branch 'tizen' X-Git-Tag: dali_1.9.8~5^2~255 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=c32e712ddb572650fe0766d7f10a9707db5b5c6b;hp=59056922c2ee74a2aeaf5a2a15882c576a52856e [dali_1.0.33] Merge branch 'tizen' Change-Id: I121c6da3032c00827029d38d3c0a49d71d6c6d9d --- diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-PushButton.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-PushButton.cpp index 8636839..05ced5a 100644 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-PushButton.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-PushButton.cpp @@ -640,86 +640,86 @@ int UtcDaliPushButtonProperties(void) // 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; } diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.cpp index aa1b5b2..5ab4b7d 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.cpp @@ -370,6 +370,20 @@ bool TestPlatformAbstraction::LoadFile( const std::string& filename, std::vector } /** + * @copydoc PlatformAbstraction::LoadShaderBinFile() + */ +bool TestPlatformAbstraction::LoadShaderBinFile( const std::string& filename, std::vector< unsigned char >& buffer ) const +{ + mTrace.PushCall("LoadShaderBinFile", ""); + if( mLoadFileResult.loadResult ) + { + buffer = mLoadFileResult.buffer; + } + + return mLoadFileResult.loadResult; +} + +/** * @copydoc PlatformAbstraction::SaveFile() */ bool TestPlatformAbstraction::SaveFile(const std::string& filename, std::vector< unsigned char >& buffer) const @@ -498,6 +512,7 @@ bool TestPlatformAbstraction::WasCalled(TestFuncEnum func) case LoadResourceFunc: return mTrace.FindMethod("LoadResource"); case SaveResourceFunc: return mTrace.FindMethod("SaveResource"); case LoadFileFunc: return mTrace.FindMethod("LoadFile"); + case LoadShaderBinFileFunc: return mTrace.FindMethod("LoadShaderBinFile"); case SaveFileFunc: return mTrace.FindMethod("SaveFile"); case CancelLoadFunc: return mTrace.FindMethod("CancelLoad"); case GetResourcesFunc: return mTrace.FindMethod("GetResources"); diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.h index 2d4c38c..41b06cd 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.h @@ -208,6 +208,11 @@ public: virtual bool LoadFile( const std::string& filename, std::vector< unsigned char >& buffer ) const; /** + * @copydoc PlatformAbstraction::LoadShaderBinFile() + */ + virtual bool LoadShaderBinFile( const std::string& filename, std::vector< unsigned char >& buffer ) const; + + /** * @copydoc PlatformAbstraction::SaveFile() */ virtual bool SaveFile(const std::string& filename, std::vector< unsigned char >& buffer) const; @@ -251,6 +256,7 @@ public: // TEST FUNCTIONS SaveResourceFunc, SaveFileFunc, LoadFileFunc, + LoadShaderBinFileFunc, CancelLoadFunc, GetResourcesFunc, IsLoadingFunc, diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Control.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Control.cpp index f1edb7a..a424aa7 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Control.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Control.cpp @@ -407,34 +407,34 @@ int UtcDaliControlBackgroundProperties(void) 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; } @@ -449,15 +449,15 @@ int UtcDaliControlSizePolicyProperties(void) 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 ); @@ -471,18 +471,18 @@ int UtcDaliControlSizeProperties(void) 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 ); @@ -496,15 +496,15 @@ int UtcDaliControlKeyProperties(void) 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; diff --git a/automated-tests/src/dali-toolkit/utc-Dali-RadioButton.cpp b/automated-tests/src/dali-toolkit/utc-Dali-RadioButton.cpp index 9b3c9e5..d53084c 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-RadioButton.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-RadioButton.cpp @@ -154,19 +154,19 @@ int UtcDaliRadioButtonSelectedProperty(void) radioButton.SetPosition( 0.0f, 0.0f ); // Default selected - DALI_TEST_CHECK( radioButton.GetProperty( Button::PROPERTY_SELECTED ) == false ); + DALI_TEST_CHECK( radioButton.GetProperty( Button::Property::SELECTED ) == false ); // Setting false selected - radioButton.SetProperty( Button::PROPERTY_SELECTED, false ); - DALI_TEST_CHECK( radioButton.GetProperty( Button::PROPERTY_SELECTED ) == false ); + radioButton.SetProperty( Button::Property::SELECTED, false ); + DALI_TEST_CHECK( radioButton.GetProperty( Button::Property::SELECTED ) == false ); // Setting true selected - radioButton.SetProperty( Button::PROPERTY_SELECTED, true ); - DALI_TEST_CHECK( radioButton.GetProperty( Button::PROPERTY_SELECTED ) == true ); + radioButton.SetProperty( Button::Property::SELECTED, true ); + DALI_TEST_CHECK( radioButton.GetProperty( Button::Property::SELECTED ) == true ); // Setting false again - radioButton.SetProperty( Button::PROPERTY_SELECTED, false ); - DALI_TEST_CHECK( radioButton.GetProperty( Button::PROPERTY_SELECTED ) == false ); + radioButton.SetProperty( Button::Property::SELECTED, false ); + DALI_TEST_CHECK( radioButton.GetProperty( Button::Property::SELECTED ) == false ); // Test selecting radio buttons RadioButton radioButton2 = RadioButton::New( "label" ); @@ -193,8 +193,8 @@ int UtcDaliRadioButtonSelectedProperty(void) application.Render(); // Simulate touch events - DALI_TEST_CHECK( radioButton2.GetProperty( Button::PROPERTY_SELECTED ) == false ); - DALI_TEST_CHECK( radioButton3.GetProperty( Button::PROPERTY_SELECTED ) == false ); + DALI_TEST_CHECK( radioButton2.GetProperty( Button::Property::SELECTED ) == false ); + DALI_TEST_CHECK( radioButton3.GetProperty( Button::Property::SELECTED ) == false ); // Select first radio { @@ -213,8 +213,8 @@ int UtcDaliRadioButtonSelectedProperty(void) application.SendNotification(); application.Render(); - DALI_TEST_CHECK( radioButton2.GetProperty( Button::PROPERTY_SELECTED ) == true ); - DALI_TEST_CHECK( radioButton3.GetProperty( Button::PROPERTY_SELECTED ) == false ); + DALI_TEST_CHECK( radioButton2.GetProperty( Button::Property::SELECTED ) == true ); + DALI_TEST_CHECK( radioButton3.GetProperty( Button::Property::SELECTED ) == false ); } // Select an already selected radio @@ -234,8 +234,8 @@ int UtcDaliRadioButtonSelectedProperty(void) application.SendNotification(); application.Render(); - DALI_TEST_CHECK( radioButton2.GetProperty( Button::PROPERTY_SELECTED ) == true ); - DALI_TEST_CHECK( radioButton3.GetProperty( Button::PROPERTY_SELECTED ) == false ); + DALI_TEST_CHECK( radioButton2.GetProperty( Button::Property::SELECTED ) == true ); + DALI_TEST_CHECK( radioButton3.GetProperty( Button::Property::SELECTED ) == false ); } // Select second radio @@ -255,8 +255,8 @@ int UtcDaliRadioButtonSelectedProperty(void) application.SendNotification(); application.Render(); - DALI_TEST_CHECK( radioButton2.GetProperty( Button::PROPERTY_SELECTED ) == false ); - DALI_TEST_CHECK( radioButton3.GetProperty( Button::PROPERTY_SELECTED ) == true ); + DALI_TEST_CHECK( radioButton2.GetProperty( Button::Property::SELECTED ) == false ); + DALI_TEST_CHECK( radioButton3.GetProperty( Button::Property::SELECTED ) == true ); } // Select outside radio group @@ -276,8 +276,8 @@ int UtcDaliRadioButtonSelectedProperty(void) application.SendNotification(); application.Render(); - DALI_TEST_CHECK( radioButton2.GetProperty( Button::PROPERTY_SELECTED ) == false ); - DALI_TEST_CHECK( radioButton3.GetProperty( Button::PROPERTY_SELECTED ) == true ); + DALI_TEST_CHECK( radioButton2.GetProperty( Button::Property::SELECTED ) == false ); + DALI_TEST_CHECK( radioButton3.GetProperty( Button::Property::SELECTED ) == true ); } END_TEST; diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ScrollView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ScrollView.cpp index 43d186f..9b9cad1 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ScrollView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ScrollView.cpp @@ -818,7 +818,7 @@ int UtcDaliScrollViewConstraints(void) Wait(application); Property::Index scrollPositionProperty = scrollView.GetPropertyIndex(ScrollView::SCROLL_POSITION_PROPERTY_NAME); - Constraint constraint = Constraint::New( Actor::Property::Position, + Constraint constraint = Constraint::New( Actor::Property::POSITION, Source(scrollView, scrollPositionProperty), TestSumConstraint( TEST_CONSTRAINT_OFFSET ) ); constraint.SetRemoveAction(Constraint::Discard); @@ -867,7 +867,7 @@ int UtcDaliScrollViewBind(void) Property::Index scrollPositionProperty = scrollView.GetPropertyIndex(ScrollView::SCROLL_POSITION_PROPERTY_NAME); // apply this constraint to scrollview - Constraint constraint = Constraint::New( Actor::Property::Position, + Constraint constraint = Constraint::New( Actor::Property::POSITION, Source(scrollView, scrollPositionProperty), TestSumConstraint( TEST_CONSTRAINT_OFFSET ) ); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ScrollViewEffect.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ScrollViewEffect.cpp index e10107b..5cda497 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ScrollViewEffect.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ScrollViewEffect.cpp @@ -141,7 +141,7 @@ ScrollView SetupTestScrollView(int rows, int columns, Vector2 size) scrollView.SetSize(size); scrollView.SetAnchorPoint(AnchorPoint::CENTER); scrollView.SetParentOrigin(ParentOrigin::CENTER); - scrollView.ApplyConstraint( Constraint::New( Dali::Actor::Property::Size, Dali::ParentSource( Dali::Actor::Property::Size ), Dali::EqualToConstraint() ) ); + scrollView.ApplyConstraint( Constraint::New( Dali::Actor::Property::SIZE, Dali::ParentSource( Dali::Actor::Property::SIZE ), Dali::EqualToConstraint() ) ); scrollView.SetWrapMode(false); scrollView.ScrollStartedSignal().Connect( &OnScrollStart ); scrollView.ScrollUpdatedSignal().Connect( &OnScrollUpdate ); @@ -175,7 +175,7 @@ ScrollView SetupTestScrollView(int rows, int columns, Vector2 size) container.SetAnchorPoint(AnchorPoint::CENTER); container.SetSize( size ); scrollView.Add( container ); - container.ApplyConstraint( Constraint::New( Actor::Property::Size, ParentSource( Actor::Property::Size ), EqualToConstraint() ) ); + container.ApplyConstraint( Constraint::New( Actor::Property::SIZE, ParentSource( Actor::Property::SIZE ), EqualToConstraint() ) ); gPages.clear(); for(int row = 0;row( Actor::Property::Size, ParentSource( Actor::Property::Size ), EqualToConstraint() ) ); + page.ApplyConstraint( Constraint::New( Actor::Property::SIZE, ParentSource( Actor::Property::SIZE ), EqualToConstraint() ) ); page.SetParentOrigin( ParentOrigin::CENTER ); page.SetAnchorPoint( AnchorPoint::CENTER ); page.SetPosition( column * size.x, row * size.y ); @@ -322,7 +322,7 @@ int UtcDaliScrollViewSpiralEffectTest(void) { Actor page = *pageIter; page.RemoveConstraints(); - page.ApplyConstraint( Constraint::New( Actor::Property::Size, ParentSource( Actor::Property::Size ), EqualToConstraint() ) ); + page.ApplyConstraint( Constraint::New( Actor::Property::SIZE, ParentSource( Actor::Property::SIZE ), EqualToConstraint() ) ); effect.ApplyToPage(page, Vector2(Math::PI_2, 0.0f)); } Wait(application); @@ -431,7 +431,7 @@ int UtcDaliScrollViewPageCubeEffectTest(void) { Actor page = *pageIter; page.RemoveConstraints(); - page.ApplyConstraint( Constraint::New( Actor::Property::Size, ParentSource( Actor::Property::Size ), EqualToConstraint() ) ); + page.ApplyConstraint( Constraint::New( Actor::Property::SIZE, ParentSource( Actor::Property::SIZE ), EqualToConstraint() ) ); effect.ApplyToPage(page, Vector2(Math::PI_2, 0.0f)); } Wait(application); @@ -466,7 +466,7 @@ int UtcDaliScrollViewPageCarouselEffectTest(void) { Actor page = *pageIter; page.RemoveConstraints(); - page.ApplyConstraint( Constraint::New( Actor::Property::Size, ParentSource( Actor::Property::Size ), EqualToConstraint() ) ); + page.ApplyConstraint( Constraint::New( Actor::Property::SIZE, ParentSource( Actor::Property::SIZE ), EqualToConstraint() ) ); effect.ApplyToPage(page); } Wait(application); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Slider.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Slider.cpp index 0b0463f..8fd2fb6 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Slider.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Slider.cpp @@ -136,8 +136,8 @@ int UtcDaliSliderSignals(void) { marks.push_back( MIN_BOUND + ( static_cast(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 ); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TableView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TableView.cpp index 53bbae6..8773187 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TableView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TableView.cpp @@ -42,7 +42,6 @@ const char* const PROPERTY_NAME_CELL_PADDING = "cell-padding"; 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) @@ -50,7 +49,6 @@ static void TestCallback(BaseHandle handle) gObjectCreatedCallBackCalled = true; } - struct Constraint100 { Constraint100( ) @@ -90,7 +88,6 @@ static void SetupTableViewAndActors(TableView& tableView, Actor& actor1, Actor& } // namespace - int UtcDaliTableViewNew(void) { ToolkitTestApplication application; @@ -539,32 +536,32 @@ int UtcDaliTableViewSetGetProperty(void) // Create a 1x1 table-view TableView tableView = TableView::New(1,1); - tableView.ApplyConstraint( Constraint::New( Actor::Property::Size, Constraint100() ) ); + tableView.ApplyConstraint( Constraint::New( Actor::Property::SIZE, Constraint100() ) ); DALI_TEST_CHECK( tableView ); // Test "rows" property - DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_ROWS ) == TableView::PROPERTY_ROWS ); + DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_ROWS ) == TableView::Property::ROWS ); - tableView.SetProperty( TableView::PROPERTY_ROWS, 4u ); + tableView.SetProperty( TableView::Property::ROWS, 4u ); DALI_TEST_CHECK( tableView.GetRows() == 4u ); - DALI_TEST_CHECK( tableView.GetProperty(TableView::PROPERTY_ROWS).Get() == 4u ); + DALI_TEST_CHECK( tableView.GetProperty(TableView::Property::ROWS).Get() == 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() == 5u ); + DALI_TEST_CHECK( tableView.GetProperty(TableView::Property::COLUMNS).Get() == 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(6.f,8.f), TEST_LOCATION ); + DALI_TEST_EQUALS( tableView.GetProperty(TableView::Property::CELL_PADDING).Get(), Vector2(6.f,8.f), TEST_LOCATION ); //{ "policy": "fixed", "value": 30.0 }, Property::Map item1; @@ -576,7 +573,7 @@ int UtcDaliTableViewSetGetProperty(void) 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": @@ -588,12 +585,12 @@ int UtcDaliTableViewSetGetProperty(void) 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 layoutRowsGet = tableView.GetProperty(TableView::Property::LAYOUT_ROWS).Get(); DALI_TEST_CHECK( layoutRowsGet.GetKey(0).compare(layoutRows.GetKey(0)) == 0 ); DALI_TEST_CHECK( layoutRowsGet.GetValue(0).GetValue( "policy" ).Get().compare(layoutRows.GetValue(0).GetValue( "policy" ).Get()) == 0 ); DALI_TEST_EQUALS( layoutRowsGet.GetValue(0).GetValue( "value" ).Get(),layoutRows.GetValue(0).GetValue( "value" ).Get(), TEST_LOCATION ); @@ -602,7 +599,7 @@ int UtcDaliTableViewSetGetProperty(void) DALI_TEST_EQUALS( layoutRowsGet.GetValue(1).GetValue( "value" ).Get(),layoutRows.GetValue(1).GetValue( "value" ).Get(), 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": @@ -614,12 +611,12 @@ int UtcDaliTableViewSetGetProperty(void) 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 layoutColumnsGet = tableView.GetProperty(TableView::Property::LAYOUT_COLUMNS).Get(); DALI_TEST_CHECK( layoutColumnsGet.GetKey(0).compare(layoutColumns.GetKey(0)) == 0 ); DALI_TEST_CHECK( layoutColumnsGet.GetValue(0).GetValue( "policy" ).Get().compare(layoutColumns.GetValue(0).GetValue( "policy" ).Get()) == 0 ); DALI_TEST_EQUALS( layoutColumnsGet.GetValue(0).GetValue( "value" ).Get(),layoutColumns.GetValue(0).GetValue( "value" ).Get(), TEST_LOCATION ); @@ -637,7 +634,7 @@ int UtcDaliTableViewCustomProperties(void) // Create a 10x10 table-view TableView tableView = TableView::New(10,10); - tableView.ApplyConstraint( Constraint::New( Actor::Property::Size, Constraint100() ) ); + tableView.ApplyConstraint( Constraint::New( Actor::Property::SIZE, Constraint100() ) ); DALI_TEST_CHECK( tableView ); // Create a child actor with the custom properties diff --git a/build/tizen/docs/Makefile.am b/build/tizen/docs/Makefile.am index 8d70825..1314654 100644 --- a/build/tizen/docs/Makefile.am +++ b/build/tizen/docs/Makefile.am @@ -5,3 +5,6 @@ all-local: @cat doxygen-errors.txt @if [ -s doxygen-errors.txt ]; then exit 1 ; fi @rm doxygen-errors.txt +# Build JavaScript API documentation using yuidoc ( Yahoo JavaScript Documentation Tool ) +# We first test yuidoc exists, then change in to the dali-script-v8 docs directory and run yuidoc + @if [ ! `which yuidoc` = "" ]; then cd ../../../plugins/dali-script-v8/docs && yuidoc --config yuidoc.json -e ".cpp,.js,.md" -o generated .. ../../../docs/content/shared-javascript-and-cpp-documentation/ ; fi \ No newline at end of file diff --git a/dali-toolkit/internal/builder/builder-impl.cpp b/dali-toolkit/internal/builder/builder-impl.cpp index 1bd65a8..b550ac1 100644 --- a/dali-toolkit/internal/builder/builder-impl.cpp +++ b/dali-toolkit/internal/builder/builder-impl.cpp @@ -770,7 +770,7 @@ Path Builder::GetPath( const std::string& name ) if( SetPropertyFromNode( *pointsProperty, Property::ARRAY, points ) ) { ret = Path::New(); - ret.SetProperty( Path::Property::Points, points); + ret.SetProperty( Path::Property::POINTS, points); //control-points property if( OptionalChild pointsProperty = IsChild( *path, "control-points") ) @@ -778,7 +778,7 @@ Path Builder::GetPath( const std::string& name ) Dali::Property::Value points(Property::ARRAY); if( SetPropertyFromNode( *pointsProperty, Property::ARRAY, points ) ) { - ret.SetProperty( Path::Property::ControlPoints, points); + ret.SetProperty( Path::Property::CONTROL_POINTS, points); } } else diff --git a/dali-toolkit/internal/builder/builder-signals.cpp b/dali-toolkit/internal/builder/builder-signals.cpp index 40428e3..0efd85b 100644 --- a/dali-toolkit/internal/builder/builder-signals.cpp +++ b/dali-toolkit/internal/builder/builder-signals.cpp @@ -43,12 +43,12 @@ using namespace Dali; // Signal Actions // -// Action on child actor. The child is found by alias so can be 'previous' etc. +// Action on child actor. The child is found by name struct ChildActorAction { std::string actorName; std::string actionName; - std::string childAlias; + std::string childName; PropertyValueContainer parameters; void operator()(void) @@ -57,7 +57,7 @@ struct ChildActorAction if(actor) { - Actor child_actor = actor.FindChildByAlias(childAlias); + Actor child_actor = actor.FindChildByName(childName); if(child_actor) { @@ -65,7 +65,7 @@ struct ChildActorAction } else { - DALI_SCRIPT_WARNING("Could not find child by alias '%s'\n", childAlias.c_str()); + DALI_SCRIPT_WARNING("Could not find child by name '%s'\n", childName.c_str()); } } }; @@ -239,7 +239,7 @@ boost::function GetAction(const TreeNode &root, const TreeNode &chi { ChildActorAction action; action.actorName = *actorName; - action.childAlias = *childActorName; + action.childName = *childActorName; action.actionName = *actionName; GetParameters(child, action.parameters); callback = action; diff --git a/dali-toolkit/internal/controls/alignment/alignment-impl.cpp b/dali-toolkit/internal/controls/alignment/alignment-impl.cpp index 17dfff6..62f5e08 100644 --- a/dali-toolkit/internal/controls/alignment/alignment-impl.cpp +++ b/dali-toolkit/internal/controls/alignment/alignment-impl.cpp @@ -21,8 +21,7 @@ // EXTERNAL INCLUDES #include #include - -// INTERNAL INCLUDES +#include namespace Dali { @@ -42,7 +41,8 @@ BaseHandle Create() 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 { diff --git a/dali-toolkit/internal/controls/bloom-view/bloom-view-impl.cpp b/dali-toolkit/internal/controls/bloom-view/bloom-view-impl.cpp index dfbebc4..cc84448 100644 --- a/dali-toolkit/internal/controls/bloom-view/bloom-view-impl.cpp +++ b/dali-toolkit/internal/controls/bloom-view/bloom-view-impl.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include // INTERNAL INCLUDES @@ -52,7 +53,8 @@ BaseHandle Create() 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; @@ -72,14 +74,13 @@ const float BLOOM_GAUSSIAN_BLUR_VIEW_DEFAULT_DOWNSAMPLE_HEIGHT_SCALE = 0.5f; 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"; /////////////////////////////////////////////////////// // diff --git a/dali-toolkit/internal/controls/buttons/button-impl.cpp b/dali-toolkit/internal/controls/buttons/button-impl.cpp index 4f7dd86..acf3a5a 100644 --- a/dali-toolkit/internal/controls/buttons/button-impl.cpp +++ b/dali-toolkit/internal/controls/buttons/button-impl.cpp @@ -21,6 +21,7 @@ // EXTERNAL INCLUDES #include #include +#include #include #include @@ -33,62 +34,43 @@ namespace Dali 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 @@ -636,61 +618,61 @@ void Button::SetProperty( BaseObject* object, Property::Index index, const Prope { switch ( index ) { - case Toolkit::Button::PROPERTY_DISABLED: + case Toolkit::Button::Property::DISABLED: { GetImplementation( button ).SetDisabled( value.Get() ); 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; @@ -709,43 +691,43 @@ Property::Value Button::GetProperty( BaseObject* object, Property::Index propert { 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 ); @@ -753,7 +735,7 @@ Property::Value Button::GetProperty( BaseObject* object, Property::Index propert break; } - case Toolkit::Button::PROPERTY_SELECTED_STATE_ACTOR: + case Toolkit::Button::Property::SELECTED_STATE_ACTOR: { Property::Map map; Scripting::CreatePropertyMap( GetImplementation( button ).mSelectedContent, map ); @@ -761,7 +743,7 @@ Property::Value Button::GetProperty( BaseObject* object, Property::Index propert break; } - case Toolkit::Button::PROPERTY_DISABLED_STATE_ACTOR: + case Toolkit::Button::Property::DISABLED_STATE_ACTOR: { Property::Map map; Scripting::CreatePropertyMap( GetImplementation( button ).mDisabledContent, map ); @@ -769,7 +751,7 @@ Property::Value Button::GetProperty( BaseObject* object, Property::Index propert break; } - case Toolkit::Button::PROPERTY_LABEL_ACTOR: + case Toolkit::Button::Property::LABEL_ACTOR: { Property::Map map; Scripting::CreatePropertyMap( GetImplementation( button ).mLabel, map ); diff --git a/dali-toolkit/internal/controls/buttons/button-impl.h b/dali-toolkit/internal/controls/buttons/button-impl.h index 2c4c115..f9dee5a 100644 --- a/dali-toolkit/internal/controls/buttons/button-impl.h +++ b/dali-toolkit/internal/controls/buttons/button-impl.h @@ -41,14 +41,6 @@ namespace Internal */ 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: @@ -533,4 +525,3 @@ inline const Toolkit::Internal::Button& GetImplementation( const Toolkit::Button } // namespace Dali #endif // __DALI_TOOLKIT_INTERNAL_BUTTON_H__ - diff --git a/dali-toolkit/internal/controls/buttons/check-box-button-impl.cpp b/dali-toolkit/internal/controls/buttons/check-box-button-impl.cpp index b535498..754cf8f 100644 --- a/dali-toolkit/internal/controls/buttons/check-box-button-impl.cpp +++ b/dali-toolkit/internal/controls/buttons/check-box-button-impl.cpp @@ -454,7 +454,7 @@ void CheckBoxButton::StartCheckInAnimation( Actor& actor ) mCheckInAnimation.AnimateTo( Property( mTickUVEffect, mTickUVEffect.GetBottomRightPropertyName() ), Vector2( 1.0f, 1.0f ) ); // Actor size anim - mCheckInAnimation.AnimateTo( Property( actor, Actor::Property::ScaleX ), 1.0f ); + mCheckInAnimation.AnimateTo( Property( actor, Actor::Property::SCALE_X ), 1.0f ); mCheckInAnimation.FinishedSignal().Connect( this, &CheckBoxButton::CheckInAnimationFinished ); mCheckInAnimation.Play(); diff --git a/dali-toolkit/internal/controls/cluster/cluster-impl.cpp b/dali-toolkit/internal/controls/cluster/cluster-impl.cpp index 2aa8302..e17e9b5 100644 --- a/dali-toolkit/internal/controls/cluster/cluster-impl.cpp +++ b/dali-toolkit/internal/controls/cluster/cluster-impl.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include // INTERNAL INCLUDES @@ -30,13 +31,6 @@ using namespace Dali; -namespace // unnamed namespace -{ - -const float CLUSTER_STYLE_CONSTRAINT_DURATION = 1.0f; - -} - namespace Dali { @@ -49,23 +43,21 @@ namespace Internal 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; } @@ -351,9 +343,9 @@ void Cluster::TransformChild( unsigned int index, const Vector3& position, const child.RemoveConstraints(); Animation animation = Animation::New(period.delaySeconds + period.durationSeconds); - animation.AnimateTo( Property(child, Actor::Property::Position), position, AlphaFunctions::EaseOut, period); - animation.AnimateTo( Property(child, Actor::Property::Scale), scale, AlphaFunctions::EaseOut, period); - animation.AnimateTo( Property(child, Actor::Property::Rotation), rotation, AlphaFunctions::EaseOut, period); + animation.AnimateTo( Property(child, Actor::Property::POSITION), position, AlphaFunctions::EaseOut, period); + animation.AnimateTo( Property(child, Actor::Property::SCALE), scale, AlphaFunctions::EaseOut, period); + animation.AnimateTo( Property(child, Actor::Property::ROTATION), rotation, AlphaFunctions::EaseOut, period); animation.Play(); } } diff --git a/dali-toolkit/internal/controls/cluster/cluster-style-impl.cpp b/dali-toolkit/internal/controls/cluster/cluster-style-impl.cpp index 18a5e9d..5b9a1ea 100644 --- a/dali-toolkit/internal/controls/cluster/cluster-style-impl.cpp +++ b/dali-toolkit/internal/controls/cluster/cluster-style-impl.cpp @@ -470,7 +470,6 @@ void ClusterStyleRandom::ApplyStyle(Actor child, unsigned int index, AlphaFuncti Property::Index depthProperty = child.GetPropertyIndex(Toolkit::Cluster::CLUSTER_ACTOR_DEPTH); float depthPropertyValue = child.GetProperty( depthProperty ); - Apply( child, FirstOrderEquation( GetClusterSize(), Vector3(position.x, position.y, 0.0f), Vector3(0.0f, 0.0f, depthPropertyValue) ), FirstOrderEquation( GetClusterSize(), Vector3::ONE * size), diff --git a/dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp b/dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp index 9f26fd7..8304e0e 100644 --- a/dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp +++ b/dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include // INTERNAL INCLUDES @@ -48,21 +49,24 @@ Dali::BaseHandle Create() 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" @@ -267,8 +271,8 @@ void EffectsView::SetupProperties() mEffectStrengthPropertyIndex = self.RegisterProperty(EFFECT_STRENGTH_PROPERTY_NAME, EFFECT_STRENGTH_DEFAULT, Property::READ_WRITE); mEffectOffsetPropertyIndex = self.RegisterProperty(EFFECT_OFFSET_PROPERTY_NAME, EFFECT_OFFSET_DEFAULT); mEffectColorPropertyIndex = self.RegisterProperty(EFFECT_COLOR_PROPERTY_NAME, EFFECT_COLOR_DEFAULT); - mActorPostFilter.ApplyConstraint( Constraint::New( Actor::Property::Position, Source( self, mEffectOffsetPropertyIndex ), EqualToConstraint() ) ); - mActorPostFilter.ApplyConstraint( Constraint::New( Actor::Property::Color, Source( self, mEffectColorPropertyIndex ), EqualToConstraint() ) ); + mActorPostFilter.ApplyConstraint( Constraint::New( Actor::Property::POSITION, Source( self, mEffectOffsetPropertyIndex ), EqualToConstraint() ) ); + mActorPostFilter.ApplyConstraint( Constraint::New( Actor::Property::COLOR, Source( self, mEffectColorPropertyIndex ), EqualToConstraint() ) ); } void EffectsView::SetBackgroundColor( const Vector4& color ) diff --git a/dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp b/dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp index f1359c7..c1ce8b8 100644 --- a/dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp +++ b/dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -40,7 +41,6 @@ // Manager object - re-use render targets if there are multiple GaussianBlurViews created - ///////////////////////////////////////////////////////// // IMPLEMENTATION NOTES @@ -85,14 +85,14 @@ BaseHandle Create() 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; @@ -300,7 +300,7 @@ void GaussianBlurView::OnInitialize() mImageActorComposite.ScaleBy( Vector3(1.0f, -1.0f, 1.0f) ); // FIXME mImageActorComposite.SetOpacity(GAUSSIAN_BLUR_VIEW_DEFAULT_BLUR_STRENGTH); // ensure alpha is enabled for this object and set default value - Constraint blurStrengthConstraint = Constraint::New( Actor::Property::ColorAlpha, ParentSource(mBlurStrengthPropertyIndex), EqualToConstraintFloat()); + Constraint blurStrengthConstraint = Constraint::New( Actor::Property::COLOR_ALPHA, ParentSource(mBlurStrengthPropertyIndex), EqualToConstraintFloat()); mImageActorComposite.ApplyConstraint(blurStrengthConstraint); // Create an ImageActor for holding final result, i.e. the blurred image. This will get rendered to screen later, via default / user render task diff --git a/dali-toolkit/internal/controls/image-view/masked-image-view-impl.cpp b/dali-toolkit/internal/controls/image-view/masked-image-view-impl.cpp index 2dbe35c..c5d9ef8 100644 --- a/dali-toolkit/internal/controls/image-view/masked-image-view-impl.cpp +++ b/dali-toolkit/internal/controls/image-view/masked-image-view-impl.cpp @@ -545,7 +545,7 @@ void MaskedImageView::Initialize( unsigned int targetWidth, mRenderTask.SetInputEnabled( false ); mRenderTask.SetExclusive( true ); mRenderTask.SetClearEnabled( true ); - mRenderTask.ApplyConstraint( Constraint::New( RenderTask::Property::ClearColor, + mRenderTask.ApplyConstraint( Constraint::New( RenderTask::Property::CLEAR_COLOR, Source( self, mCustomProperties[ Dali::Toolkit::MaskedImageView::BACKGROUND_COLOR ] ), EqualToConstraint() ) ); mRenderTask.FinishedSignal().Connect( this, &MaskedImageView::OnRenderTaskFinished ); diff --git a/dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp b/dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp index b9749da..6f9ad18 100644 --- a/dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp +++ b/dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp @@ -192,7 +192,7 @@ void Magnifier::Initialize() mSourceActor = Actor::New(); Stage().GetCurrent().Add(mSourceActor); mSourceActor.SetParentOrigin(ParentOrigin::CENTER); - Constraint constraint = Constraint::New( Actor::Property::Position, + Constraint constraint = Constraint::New( Actor::Property::POSITION, Source( self, mPropertySourcePosition ), EqualToConstraint() ); mSourceActor.ApplyConstraint(constraint); @@ -224,23 +224,23 @@ void Magnifier::Initialize() // at the end of the update cycle i.e. after constraints have been applied.) //Property::Index propertySourcePositionDelayed = mCameraActor.RegisterProperty("delayed-source-position", Vector3::ZERO); - constraint = Constraint::New( Actor::Property::Position, - Source( mSourceActor, Actor::Property::WorldPosition ), + constraint = Constraint::New( Actor::Property::POSITION, + Source( mSourceActor, Actor::Property::WORLD_POSITION ), CameraActorPositionConstraint(stageSize, mDefaultCameraDistance) ); mCameraActor.ApplyConstraint(constraint); // Apply constraint to render-task viewport position - constraint = Constraint::New( RenderTask::Property::ViewportPosition, - Source( self, Actor::Property::WorldPosition ),//mPropertySourcePosition ), - Source( self, Actor::Property::Size ), - Source( self, Actor::Property::WorldScale ), + constraint = Constraint::New( RenderTask::Property::VIEWPORT_POSITION, + Source( self, Actor::Property::WORLD_POSITION ),//mPropertySourcePosition ), + Source( self, Actor::Property::SIZE ), + Source( self, Actor::Property::WORLD_SCALE ), RenderTaskViewportPositionConstraint(stageSize) ); mTask.ApplyConstraint(constraint); // Apply constraint to render-task viewport position - constraint = Constraint::New( RenderTask::Property::ViewportSize, - Source( self, Actor::Property::Size ), - Source( self, Actor::Property::WorldScale ), + constraint = Constraint::New( RenderTask::Property::VIEWPORT_SIZE, + Source( self, Actor::Property::SIZE ), + Source( self, Actor::Property::WORLD_SCALE ), RenderTaskViewportSizeConstraint() ); mTask.ApplyConstraint(constraint); } @@ -289,8 +289,8 @@ void Magnifier::SetFrameVisibility(bool visible) mFrame.SetPositionInheritanceMode(DONT_INHERIT_POSITION); mFrame.SetInheritScale(true); - Constraint constraint = Constraint::New( Actor::Property::Position, - ParentSource( Actor::Property::WorldPosition ), + Constraint constraint = Constraint::New( Actor::Property::POSITION, + ParentSource( Actor::Property::WORLD_POSITION ), EqualToConstraint() ); mFrame.ApplyConstraint( constraint ); diff --git a/dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.cpp b/dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.cpp index 3c7e78a..ac5244a 100644 --- a/dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.cpp +++ b/dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.cpp @@ -22,12 +22,13 @@ #include #include #include +#include // INTERNAL INCLUDES +#include #include #include #include -#include namespace Dali { @@ -41,20 +42,18 @@ namespace Internal 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() } diff --git a/dali-toolkit/internal/controls/navigation-frame/page-impl.cpp b/dali-toolkit/internal/controls/navigation-frame/page-impl.cpp index a484d64..7ca18c9 100644 --- a/dali-toolkit/internal/controls/navigation-frame/page-impl.cpp +++ b/dali-toolkit/internal/controls/navigation-frame/page-impl.cpp @@ -20,8 +20,7 @@ // EXTERNAL INCLUDES #include - -// INTERNAL INCLUDES +#include namespace Dali { @@ -40,7 +39,8 @@ BaseHandle Create() 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 diff --git a/dali-toolkit/internal/controls/page-turn-view/page-turn-landscape-view-impl.cpp b/dali-toolkit/internal/controls/page-turn-view/page-turn-landscape-view-impl.cpp index 64bac9a..8397530 100644 --- a/dali-toolkit/internal/controls/page-turn-view/page-turn-landscape-view-impl.cpp +++ b/dali-toolkit/internal/controls/page-turn-view/page-turn-landscape-view-impl.cpp @@ -20,6 +20,7 @@ // EXTERNAL INCLUDES #include +#include namespace Dali { @@ -33,7 +34,10 @@ namespace Internal 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 ) diff --git a/dali-toolkit/internal/controls/page-turn-view/page-turn-portrait-view-impl.cpp b/dali-toolkit/internal/controls/page-turn-view/page-turn-portrait-view-impl.cpp index 8b9d22f..d5f8b01 100644 --- a/dali-toolkit/internal/controls/page-turn-view/page-turn-portrait-view-impl.cpp +++ b/dali-toolkit/internal/controls/page-turn-view/page-turn-portrait-view-impl.cpp @@ -21,6 +21,7 @@ // EXTERNAL INCLUDES #include #include +#include namespace Dali { @@ -34,13 +35,16 @@ namespace Internal 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 ) @@ -150,7 +154,7 @@ void PageTurnPortraitView::OnPossibleOutwardsFlick( const Vector2& panPosition, animation.AnimateTo( Property( mTurnEffect[mIndex], mTurnEffect[mIndex].PageTurnEffect::GetCurrentCenterPropertyName() ), originalCenter, AlphaFunctions::EaseOut, PAGE_TURN_OVER_ANIMATION_DURATION*0.75f ); - animation.AnimateBy( Property( actor, Actor::Property::Rotation ), AngleAxis( Degree( 180.0f ), Vector3::YAXIS ) ,AlphaFunctions::EaseOut ); + animation.AnimateBy( Property( actor, Actor::Property::ROTATION ), AngleAxis( Degree( 180.0f ), Vector3::YAXIS ) ,AlphaFunctions::EaseOut ); animation.Play(); ImageActor::DownCast(actor).SetCullFace( CullBack ); animation.FinishedSignal().Connect( this, &PageTurnPortraitView::OnTurnedOver ); diff --git a/dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.cpp b/dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.cpp index f757f95..562b8d2 100644 --- a/dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.cpp +++ b/dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include // INTERNAL INCLUDES @@ -31,10 +32,12 @@ 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); @@ -311,7 +314,7 @@ void PageTurnView::OnInitialize() for( int i = 0; i < MAXIMUM_TURNING_NUM; i++ ) { mTurnEffect[i] = Toolkit::PageTurnEffect::New( false ); - mTurnEffect[i].SetProperty( ShaderEffect::Property::GridDensity, Property::Value( DEFAULT_GRID_DENSITY ) ); + mTurnEffect[i].SetProperty( ShaderEffect::Property::GRID_DENSITY, Property::Value( DEFAULT_GRID_DENSITY ) ); mTurnEffect[i].SetPageSize( mPageSize ); mTurnEffect[i].SetShadowWidth(0.f); mTurnEffect[i].SetSpineShadowParameter( mSpineShadowParameter ); @@ -889,7 +892,7 @@ void PageTurnView::PanContinuing( const Vector2& gesturePosition ) GetImpl( mTurnEffect[mIndex] ).ApplyInternalConstraint(); float distance = offset.Length(); - Constraint rotationConstraint = Constraint::New( Actor::Property::Rotation, + Constraint rotationConstraint = Constraint::New( Actor::Property::ROTATION, Source( self, mPropertyPanDisplacement[mIndex] ), RotationConstraint(distance, mPageSize.width, mIsTurnBack[mPanActor])); mPanActor.ApplyConstraint( rotationConstraint ); diff --git a/dali-toolkit/internal/controls/popup/popup-impl.cpp b/dali-toolkit/internal/controls/popup/popup-impl.cpp index b0aa312..ffd79e4 100755 --- a/dali-toolkit/internal/controls/popup/popup-impl.cpp +++ b/dali-toolkit/internal/controls/popup/popup-impl.cpp @@ -25,22 +25,50 @@ #include #include #include +#include #include +#include #include -#include // INTERNAL INCLUDES #include -#include #include +#include +#include #include #include -#include 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) @@ -53,16 +81,6 @@ const float POPUP_BUTTON_BG_HEIGHT = 96.f; ///< Height of But 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 @@ -99,32 +117,6 @@ Vector3 ButtonAreaSize( const Vector4& outBoarder, const Vector3& parentSize ) } // 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 /////////////////////////////////////////////////////////////////////////////////////////////////// @@ -509,13 +501,13 @@ void Popup::HandleStateChange( Toolkit::Popup::PopupState state, float duration if(mShowing) { - mAnimation.AnimateTo( Property(mBacking, Actor::Property::ColorAlpha), targetBackingAlpha, AlphaFunctions::EaseInOut, TimePeriod(0.0f, duration * 0.5f) ); - mAnimation.AnimateTo( Property(mPopupBg, Actor::Property::Scale), targetSize, AlphaFunctions::EaseInOut, TimePeriod(duration * 0.5f, duration * 0.5f) ); + mAnimation.AnimateTo( Property(mBacking, Actor::Property::COLOR_ALPHA), targetBackingAlpha, AlphaFunctions::EaseInOut, TimePeriod(0.0f, duration * 0.5f) ); + mAnimation.AnimateTo( Property(mPopupBg, Actor::Property::SCALE), targetSize, AlphaFunctions::EaseInOut, TimePeriod(duration * 0.5f, duration * 0.5f) ); } else { - mAnimation.AnimateTo( Property(mBacking, Actor::Property::ColorAlpha), targetBackingAlpha, AlphaFunctions::EaseInOut, TimePeriod(0.0f, duration * 0.5f) ); - mAnimation.AnimateTo( Property(mPopupBg, Actor::Property::Scale), targetSize, AlphaFunctions::EaseInOut, TimePeriod(0.0f, duration * 0.5f) ); + mAnimation.AnimateTo( Property(mBacking, Actor::Property::COLOR_ALPHA), targetBackingAlpha, AlphaFunctions::EaseInOut, TimePeriod(0.0f, duration * 0.5f) ); + mAnimation.AnimateTo( Property(mPopupBg, Actor::Property::SCALE), targetSize, AlphaFunctions::EaseInOut, TimePeriod(0.0f, duration * 0.5f) ); } mAnimation.Play(); mAnimation.FinishedSignal().Connect(this, &Popup::OnStateAnimationFinished); diff --git a/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp b/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp index a61f6f0..bae2b78 100755 --- a/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp +++ b/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include // INTERNAL INCLUDES @@ -102,11 +103,6 @@ namespace Dali 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 { @@ -115,21 +111,25 @@ namespace 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() @@ -220,9 +220,9 @@ void ScrollBar::ApplyConstraints() mIndicator.RemoveConstraint(mIndicatorPositionConstraint); } - constraint = Constraint::New( Actor::Property::Position, - LocalSource( Actor::Property::Size ), - ParentSource( Actor::Property::Size ), + constraint = Constraint::New( Actor::Property::POSITION, + LocalSource( Actor::Property::SIZE ), + ParentSource( Actor::Property::SIZE ), Source( mScrollPositionObject, Toolkit::ScrollConnector::SCROLL_POSITION ), IndicatorPositionConstraint( mScrollConnector.GetMinLimit(), mScrollConnector.GetMaxLimit() ) ); mIndicatorPositionConstraint = mIndicator.ApplyConstraint( constraint ); @@ -448,7 +448,7 @@ bool ScrollBar::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* 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 ); } @@ -470,22 +470,22 @@ void ScrollBar::SetProperty( BaseObject* object, Property::Index index, const Pr 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()); break; } - case Toolkit::ScrollBar::PROPERTY_INDICATOR_SHOW_DURATION: + case Toolkit::ScrollBar::Property::INDICATOR_SHOW_DURATION: { scrollBarImpl.SetIndicatorShowDuration(value.Get()); break; } - case Toolkit::ScrollBar::PROPERTY_INDICATOR_HIDE_DURATION: + case Toolkit::ScrollBar::Property::INDICATOR_HIDE_DURATION: { scrollBarImpl.SetIndicatorHideDuration(value.Get()); break; @@ -505,22 +505,22 @@ Property::Value ScrollBar::GetProperty( BaseObject* object, Property::Index inde 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; diff --git a/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.h b/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.h index 6979c52..6826c0e 100755 --- a/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.h +++ b/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.h @@ -52,13 +52,6 @@ class ScrollBar : public ScrollComponentImpl 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; diff --git a/dali-toolkit/internal/controls/scroll-component/scroll-bar-internal-impl.cpp b/dali-toolkit/internal/controls/scroll-component/scroll-bar-internal-impl.cpp index eb8d82a..e17f174 100755 --- a/dali-toolkit/internal/controls/scroll-component/scroll-bar-internal-impl.cpp +++ b/dali-toolkit/internal/controls/scroll-component/scroll-bar-internal-impl.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include // INTERNAL INCLUDES @@ -361,7 +362,8 @@ BaseHandle Create() return BaseHandle(); } -TypeRegistration mType( typeid(Toolkit::ScrollBarInternal), typeid(Toolkit::ScrollComponent), Create ); +DALI_TYPE_REGISTRATION_BEGIN( Toolkit::ScrollBarInternal, Toolkit::ScrollComponent, Create ) +DALI_TYPE_REGISTRATION_END() } @@ -390,45 +392,45 @@ ScrollBarInternal::ScrollBarInternal(Toolkit::Scrollable& container, bool vertic // target the container to observe for scrolling Actor target = mContainer.Self(); - Constraint constraint = Constraint::New( Actor::Property::Visible, + Constraint constraint = Constraint::New( Actor::Property::VISIBLE, Source( target, vertical ? target.GetPropertyIndex(Scrollable::SCROLLABLE_CAN_SCROLL_VERTICAL) : target.GetPropertyIndex(Scrollable::SCROLLABLE_CAN_SCROLL_HORIZONTAL)), ScrollBarInternalVisibilityConstraint ); mSlider.ApplyConstraint( constraint ); mSliderWrap.ApplyConstraint( constraint ); - constraint = Constraint::New( Actor::Property::Size, + constraint = Constraint::New( Actor::Property::SIZE, Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_POSITION_MIN_PROPERTY_NAME ) ), Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_POSITION_MAX_PROPERTY_NAME ) ), Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_DIRECTION_PROPERTY_NAME ) ), - Source( target, Actor::Property::Size ), + Source( target, Actor::Property::SIZE ), ScrollBarInternalSizeConstraint( vertical ) ); mSlider.ApplyConstraint( constraint ); mSliderWrap.ApplyConstraint( constraint ); - constraint = Constraint::New( Actor::Property::Rotation, + constraint = Constraint::New( Actor::Property::ROTATION, Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_DIRECTION_PROPERTY_NAME ) ), ScrollBarInternalRotationConstraint( vertical ) ); mSlider.ApplyConstraint( constraint ); mSliderWrap.ApplyConstraint( constraint ); - constraint = Constraint::New( Actor::Property::Position, - Source( mSlider, Actor::Property::Size), + constraint = Constraint::New( Actor::Property::POSITION, + Source( mSlider, Actor::Property::SIZE), Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_RELATIVE_POSITION_PROPERTY_NAME ) ), Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_POSITION_MIN_PROPERTY_NAME ) ), Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_POSITION_MAX_PROPERTY_NAME ) ), Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_DIRECTION_PROPERTY_NAME ) ), - Source( target, Actor::Property::Size ), + Source( target, Actor::Property::SIZE ), ScrollBarInternalPositionConstraint(vertical) ); mSlider.ApplyConstraint( constraint ); - constraint = Constraint::New( Actor::Property::Position, - Source( mSlider, Actor::Property::Size), + constraint = Constraint::New( Actor::Property::POSITION, + Source( mSlider, Actor::Property::SIZE), Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_RELATIVE_POSITION_PROPERTY_NAME ) ), Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_POSITION_MIN_PROPERTY_NAME ) ), Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_POSITION_MAX_PROPERTY_NAME ) ), Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_DIRECTION_PROPERTY_NAME ) ), - Source( target, Actor::Property::Size ), + Source( target, Actor::Property::SIZE ), ScrollBarInternalPositionConstraint(vertical, true) ); mSliderWrap.ApplyConstraint( constraint ); @@ -444,9 +446,9 @@ ScrollBarInternal::ScrollBarInternal(Toolkit::Scrollable& container, bool vertic mHitArea.SetPosition(0.0f, 0.0f, 0.2f); mContainer.AddOverlay( mHitArea ); - constraint = Constraint::New( Actor::Property::Size, + constraint = Constraint::New( Actor::Property::SIZE, Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_DIRECTION_PROPERTY_NAME ) ), - Source( target, Actor::Property::Size ), + Source( target, Actor::Property::SIZE ), ScrollBarInternalHitSizeConstraint(vertical, BAR_TAB_SIZE.width) ); mHitArea.ApplyConstraint( constraint ); diff --git a/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp b/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp index f9f2fbb..86ade19 100644 --- a/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp +++ b/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp @@ -107,10 +107,10 @@ Actor CreateBouncingEffectActor( Property::Index& bouncePropertyIndex ) for( size_t i=0;i( mesh.GetPropertyIndex(j+2, AnimatableVertex::Property::Position ), + mesh.ApplyConstraint( Constraint::New( mesh.GetPropertyIndex(j+2, AnimatableVertex::Property::POSITION ), Source(meshActor, bouncePropertyIndex), VertexPositionConstraint(-0.5f, LAYER_HEIGHTS[i]) ) ); - mesh.ApplyConstraint( Constraint::New( mesh.GetPropertyIndex(j+3, AnimatableVertex::Property::Position), + mesh.ApplyConstraint( Constraint::New( mesh.GetPropertyIndex(j+3, AnimatableVertex::Property::POSITION), Source(meshActor, bouncePropertyIndex), VertexPositionConstraint(-0.5f, LAYER_HEIGHTS[i]) ) ); } diff --git a/dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp b/dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp index ebe8f77..e41568b 100644 --- a/dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp +++ b/dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp @@ -28,21 +28,24 @@ #include #include #include +#include // INTERNAL INCLUDES #include -#include #include +#include 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; @@ -378,7 +381,7 @@ void ItemView::OnInitialize() LocalSource(mPropertyPosition), LocalSource(mPropertyPositionMin), LocalSource(mPropertyPositionMax), - LocalSource(Actor::Property::Size), + LocalSource(Actor::Property::SIZE), RelativePositionConstraint); self.ApplyConstraint(constraint); @@ -1569,28 +1572,28 @@ void ItemView::SetOvershootEnabled( bool enable ) mOvershootOverlay.SetDrawMode(DrawMode::OVERLAY); self.Add(mOvershootOverlay); - Constraint constraint = Constraint::New( Actor::Property::Size, + Constraint constraint = Constraint::New( Actor::Property::SIZE, ParentSource( mPropertyScrollDirection ), Source( mScrollPositionObject, ScrollConnector::OVERSHOOT ), - ParentSource( Actor::Property::Size ), + ParentSource( Actor::Property::SIZE ), OvershootOverlaySizeConstraint() ); mOvershootOverlay.ApplyConstraint(constraint); mOvershootOverlay.SetSize(OVERSHOOT_BOUNCE_ACTOR_DEFAULT_SIZE.width, OVERSHOOT_BOUNCE_ACTOR_DEFAULT_SIZE.height); - constraint = Constraint::New( Actor::Property::Rotation, + constraint = Constraint::New( Actor::Property::ROTATION, ParentSource( mPropertyScrollDirection ), Source( mScrollPositionObject, ScrollConnector::OVERSHOOT ), OvershootOverlayRotationConstraint() ); mOvershootOverlay.ApplyConstraint(constraint); - constraint = Constraint::New( Actor::Property::Position, - ParentSource( Actor::Property::Size ), + constraint = Constraint::New( Actor::Property::POSITION, + ParentSource( Actor::Property::SIZE ), ParentSource( mPropertyScrollDirection ), Source( mScrollPositionObject, ScrollConnector::OVERSHOOT ), OvershootOverlayPositionConstraint() ); mOvershootOverlay.ApplyConstraint(constraint); - constraint = Constraint::New( Actor::Property::Visible, + constraint = Constraint::New( Actor::Property::VISIBLE, ParentSource( mPropertyCanScrollVertical ), OvershootOverlayVisibilityConstraint() ); mOvershootOverlay.ApplyConstraint(constraint); diff --git a/dali-toolkit/internal/controls/scrollable/scroll-connector-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-connector-impl.cpp index 0ce8fda..613b0e8 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-connector-impl.cpp +++ b/dali-toolkit/internal/controls/scrollable/scroll-connector-impl.cpp @@ -21,6 +21,7 @@ // EXTERNAL INCLUDES #include #include +#include #include namespace Dali @@ -35,15 +36,13 @@ namespace Internal 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() } diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.cpp index 4d7049e..60cb127 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.cpp +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.cpp @@ -33,7 +33,7 @@ namespace Internal // 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(), diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.h b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.h index 5ded775..968e3ab 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.h +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.h @@ -182,7 +182,7 @@ public: protected: - static const std::string SCROLL_DOMAIN_OFFSET_PROPERTY_NAME; + static const char* const SCROLL_DOMAIN_OFFSET_PROPERTY_NAME; protected: diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-overshoot-indicator-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-overshoot-indicator-impl.cpp index 26c3af8..9cedb8c 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-overshoot-indicator-impl.cpp +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-overshoot-indicator-impl.cpp @@ -329,7 +329,7 @@ void ScrollOvershootEffectRipple::SetOvershoot(float amount, bool animate) UpdateVisibility(true); } - float overshootAnimationSpeed = mAttachedScrollView.Self().GetProperty(Toolkit::Scrollable::PROPERTY_OVERSHOOT_ANIMATION_SPEED); + float overshootAnimationSpeed = mAttachedScrollView.Self().GetProperty(Toolkit::Scrollable::Property::OVERSHOOT_ANIMATION_SPEED); if( animate && overshootAnimationSpeed > Math::MACHINE_EPSILON_0 ) { diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-carousel-effect-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-carousel-effect-impl.cpp index 8a1cdba..3758e07 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-carousel-effect-impl.cpp +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-carousel-effect-impl.cpp @@ -230,33 +230,33 @@ void ApplyScrollCarouselConstraints(Toolkit::ScrollView scrollView, // Apply constraints to this actor // Constraint constraint; - constraint = Constraint::New( Actor::Property::Visible, - LocalSource( Actor::Property::Position ), - LocalSource( Actor::Property::Scale ), - LocalSource( Actor::Property::Size ), + constraint = Constraint::New( Actor::Property::VISIBLE, + LocalSource( Actor::Property::POSITION ), + LocalSource( Actor::Property::SCALE ), + LocalSource( Actor::Property::SIZE ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ), - Source(scrollView, Actor::Property::Size ), + Source(scrollView, Actor::Property::SIZE ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollViewCarouselEffect::EFFECT_ACTIVATE ) ), boost::bind( &ScrollCarouselEffectInfo::VisibilityConstraint, info, _1, _2, _3, _4, _5, _6) ); constraint.SetRemoveAction( Constraint::Discard ); child.ApplyConstraint( constraint ); - constraint = Constraint::New( Actor::Property::Rotation, - LocalSource( Actor::Property::Position ), - LocalSource( Actor::Property::Scale ), - LocalSource( Actor::Property::Size ), + constraint = Constraint::New( Actor::Property::ROTATION, + LocalSource( Actor::Property::POSITION ), + LocalSource( Actor::Property::SCALE ), + LocalSource( Actor::Property::SIZE ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ), - Source(scrollView, Actor::Property::Size ), + Source(scrollView, Actor::Property::SIZE ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollViewCarouselEffect::EFFECT_ACTIVATE ) ), boost::bind( &ScrollCarouselEffectInfo::RotationConstraint, info, _1, _2, _3, _4, _5, _6, _7) ); constraint.SetRemoveAction( Constraint::Discard ); child.ApplyConstraint( constraint ); - constraint = Constraint::New( Actor::Property::Position, - LocalSource( Actor::Property::Scale ), - LocalSource( Actor::Property::Size ), + constraint = Constraint::New( Actor::Property::POSITION, + LocalSource( Actor::Property::SCALE ), + LocalSource( Actor::Property::SIZE ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ), - Source(scrollView, Actor::Property::Size ), + Source(scrollView, Actor::Property::SIZE ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollViewCarouselEffect::EFFECT_ACTIVATE ) ), boost::bind( &ScrollCarouselEffectInfo::PositionConstraint, info, _1, _2, _3, _4, _5, _6) ); diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-cube-effect-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-cube-effect-impl.cpp index d50ffb9..bed1846 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-cube-effect-impl.cpp +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-cube-effect-impl.cpp @@ -303,36 +303,36 @@ void ApplyScrollCubeConstraints(Toolkit::ScrollView scrollView, { // Apply constraints to this actor // Constraint constraint; - constraint = Constraint::New( Actor::Property::Rotation, - Source(parentPage, Actor::Property::Position), + constraint = Constraint::New( Actor::Property::ROTATION, + Source(parentPage, Actor::Property::POSITION), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ), - Source(scrollView, Actor::Property::Size ), + Source(scrollView, Actor::Property::SIZE ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ), boost::bind( &ScrollCubeEffectInfo::RotationConstraint, info, _1, _2, _3, _4, _5, _6, _7) ); constraint.SetRemoveAction( Constraint::Discard ); child.ApplyConstraint( constraint ); - constraint = Constraint::New( Actor::Property::Color, - Source(parentPage, Actor::Property::Position), + constraint = Constraint::New( Actor::Property::COLOR, + Source(parentPage, Actor::Property::POSITION), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ), - Source(scrollView, Actor::Property::Size ), + Source(scrollView, Actor::Property::SIZE ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ), boost::bind( &ScrollCubeEffectInfo::ColorConstraint, info, _1, _2, _3, _4, _5, _6, _7) ); constraint.SetRemoveAction( Constraint::Discard ); child.ApplyConstraint( constraint ); - constraint = Constraint::New( Actor::Property::Position, - Source(parentPage, Actor::Property::Position), + constraint = Constraint::New( Actor::Property::POSITION, + Source(parentPage, Actor::Property::POSITION), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ), - Source(scrollView, Actor::Property::Size ), + Source(scrollView, Actor::Property::SIZE ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ), boost::bind( &ScrollCubeEffectInfo::PositionConstraint, info, _1, _2, _3, _4, _5, _6, _7) ); diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-depth-effect-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-depth-effect-impl.cpp index 544b81c..8b6003f 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-depth-effect-impl.cpp +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-depth-effect-impl.cpp @@ -336,24 +336,24 @@ void ApplyScrollDepthConstraints(Toolkit::ScrollView scrollView, float scaleExtent) { // Scale Constraint - Constraint constraint = Constraint::New( Actor::Property::Scale, - LocalSource(Actor::Property::Position), - ParentSource(Actor::Property::Position), + Constraint constraint = Constraint::New( Actor::Property::SCALE, + LocalSource(Actor::Property::POSITION), + ParentSource(Actor::Property::POSITION), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ), - Source(scrollView, Actor::Property::Size ), + Source(scrollView, Actor::Property::SIZE ), ScrollDepthScaleConstraint( positionExtent, offsetExtent, positionScale, scaleExtent ) ); constraint.SetRemoveAction( Constraint::Discard ); child.ApplyConstraint( constraint ); // Position Constraint (apply last as other constraints use Actor::POSITION as a function input) - constraint = Constraint::New( Actor::Property::Position, - ParentSource(Actor::Property::Position), + constraint = Constraint::New( Actor::Property::POSITION, + ParentSource(Actor::Property::POSITION), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ), - Source(scrollView, Actor::Property::Size ), + Source(scrollView, Actor::Property::SIZE ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ), ScrollDepthPositionConstraint( positionExtent, offsetExtent, positionScale ) ); diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp index e110975..5111cec 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp @@ -24,13 +24,14 @@ #include #include #include +#include #include // INTERNAL INCLUDES -#include #include -#include +#include #include +#include //#define ENABLED_SCROLL_STATE_LOGGING @@ -52,10 +53,6 @@ using namespace Dali; 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 @@ -208,6 +205,18 @@ namespace Internal 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 * @@ -510,16 +519,6 @@ struct InternalFinalConstraint 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 ); - } @@ -591,7 +590,7 @@ void ScrollView::OnInitialize() mInternalActor = Actor::New(); mInternalActor.SetDrawMode(DrawMode::OVERLAY); self.Add(mInternalActor); - mInternalActor.ApplyConstraint( Constraint::New( Actor::Property::Size, ParentSource( Actor::Property::Size ), EqualToConstraint() ) ); + mInternalActor.ApplyConstraint( Constraint::New( Actor::Property::SIZE, ParentSource( Actor::Property::SIZE ), EqualToConstraint() ) ); mInternalActor.SetParentOrigin(ParentOrigin::CENTER); mInternalActor.SetAnchorPoint(AnchorPoint::CENTER); @@ -2613,8 +2612,8 @@ void ScrollView::UpdateMainInternalConstraint() if( mPanning ) { constraint = Constraint::New( mPropertyPrePosition, - Source( detector, PanGestureDetector::Property::LocalPosition ), - Source( self, Actor::Property::Size ), + Source( detector, PanGestureDetector::Property::LOCAL_POSITION ), + Source( self, Actor::Property::SIZE ), InternalPrePositionConstraint( mPanStartPosition, initialPanMask, mAxisAutoLock, mAxisAutoLockGradient, mLockAxis, mMaxOvershoot, mRulerX->GetDomain(), mRulerY->GetDomain() ) ); mScrollMainInternalPrePositionConstraint = self.ApplyConstraint( constraint ); } @@ -2624,7 +2623,7 @@ void ScrollView::UpdateMainInternalConstraint() LocalSource( mPropertyPrePosition ), LocalSource( mPropertyPositionMin ), LocalSource( mPropertyPositionMax ), - Source( self, Actor::Property::Size ), + Source( self, Actor::Property::SIZE ), InternalPositionConstraint( mRulerX->GetDomain(), mRulerY->GetDomain(), mWrapMode ) ); mScrollMainInternalPositionConstraint = self.ApplyConstraint( constraint ); @@ -2647,7 +2646,7 @@ void ScrollView::UpdateMainInternalConstraint() LocalSource( mPropertyPosition ), LocalSource( mPropertyPositionMin ), LocalSource( mPropertyPositionMax ), - LocalSource( Actor::Property::Size ), + LocalSource( Actor::Property::SIZE ), InternalRelativePositionConstraint ); mScrollMainInternalRelativeConstraint = self.ApplyConstraint( constraint ); @@ -2703,17 +2702,17 @@ void ScrollView::SetInternalConstraints() Constraint constraint; // MoveActor (scrolling) - constraint = Constraint::New( Actor::Property::Position, + constraint = Constraint::New( Actor::Property::POSITION, Source( self, mPropertyPosition ), MoveActorConstraint ); constraint.SetRemoveAction(Constraint::Discard); ApplyConstraintToBoundActors(constraint); // WrapActor (wrap functionality) - constraint = Constraint::New( Actor::Property::Position, - LocalSource( Actor::Property::Scale ), - LocalSource( Actor::Property::AnchorPoint ), - LocalSource( Actor::Property::Size ), + constraint = Constraint::New( Actor::Property::POSITION, + LocalSource( Actor::Property::SCALE ), + LocalSource( Actor::Property::ANCHOR_POINT ), + LocalSource( Actor::Property::SIZE ), Source( self, mPropertyPositionMin ), Source( self, mPropertyPositionMax ), Source( self, mPropertyWrap ), diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-carousel-effect-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-carousel-effect-impl.cpp index 216572e..fb4578e 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-carousel-effect-impl.cpp +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-carousel-effect-impl.cpp @@ -190,24 +190,24 @@ void ApplyScrollCubeConstraints(Toolkit::ScrollView scrollView, { // Apply constraints to this actor // Constraint constraint; - constraint = Constraint::New( Actor::Property::Color, - LocalSource(Actor::Property::Position), + constraint = Constraint::New( Actor::Property::COLOR, + LocalSource(Actor::Property::POSITION), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ), - Source(scrollView, Actor::Property::Size ), + Source(scrollView, Actor::Property::SIZE ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ), boost::bind( &ScrollPageCarouselEffectInfo::ColorConstraint, info, _1, _2, _3, _4, _5, _6, _7) ); constraint.SetRemoveAction( Constraint::Discard ); child.ApplyConstraint( constraint ); - constraint = Constraint::New( Actor::Property::Position, - LocalSource(Actor::Property::Position), + constraint = Constraint::New( Actor::Property::POSITION, + LocalSource(Actor::Property::POSITION), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ), - Source(scrollView, Actor::Property::Size ), + Source(scrollView, Actor::Property::SIZE ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ), boost::bind( &ScrollPageCarouselEffectInfo::PositionConstraint, info, _1, _2, _3, _4, _5, _6, _7) ); diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-cube-effect-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-cube-effect-impl.cpp index 66e485e..483e0bd 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-cube-effect-impl.cpp +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-cube-effect-impl.cpp @@ -259,36 +259,36 @@ void ApplyScrollCubeConstraints(Toolkit::ScrollView scrollView, { // Apply constraints to this actor // Constraint constraint; - constraint = Constraint::New( Actor::Property::Rotation, - LocalSource(Actor::Property::Position), + constraint = Constraint::New( Actor::Property::ROTATION, + LocalSource(Actor::Property::POSITION), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ), - Source(scrollView, Actor::Property::Size ), + Source(scrollView, Actor::Property::SIZE ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ), boost::bind( &ScrollPageCubeEffectInfo::RotationConstraint, info, _1, _2, _3, _4, _5, _6, _7) ); constraint.SetRemoveAction( Constraint::Discard ); child.ApplyConstraint( constraint ); - constraint = Constraint::New( Actor::Property::Color, - LocalSource(Actor::Property::Position), + constraint = Constraint::New( Actor::Property::COLOR, + LocalSource(Actor::Property::POSITION), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ), - Source(scrollView, Actor::Property::Size ), + Source(scrollView, Actor::Property::SIZE ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ), boost::bind( &ScrollPageCubeEffectInfo::ColorConstraint, info, _1, _2, _3, _4, _5, _6, _7) ); constraint.SetRemoveAction( Constraint::Discard ); child.ApplyConstraint( constraint ); - constraint = Constraint::New( Actor::Property::Position, - LocalSource(Actor::Property::Position), + constraint = Constraint::New( Actor::Property::POSITION, + LocalSource(Actor::Property::POSITION), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ), - Source(scrollView, Actor::Property::Size ), + Source(scrollView, Actor::Property::SIZE ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ), boost::bind( &ScrollPageCubeEffectInfo::PositionConstraint, info, _1, _2, _3, _4, _5, _6, _7) ); diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-spiral-effect-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-spiral-effect-impl.cpp index 35bd6ed..99a7ddf 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-spiral-effect-impl.cpp +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-spiral-effect-impl.cpp @@ -349,36 +349,36 @@ void ApplyScrollCubeConstraints(Toolkit::ScrollView scrollView, { // Apply constraints to this actor // Constraint constraint; - constraint = Constraint::New( Actor::Property::Rotation, - LocalSource(Actor::Property::Position), + constraint = Constraint::New( Actor::Property::ROTATION, + LocalSource(Actor::Property::POSITION), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ), - Source(scrollView, Actor::Property::Size ), + Source(scrollView, Actor::Property::SIZE ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_START_PAGE_POSITION_PROPERTY_NAME ) ), boost::bind( &ScrollPageSpiralEffectInfo::RotationConstraint, info, _1, _2, _3, _4, _5, _6, _7) ); constraint.SetRemoveAction( Constraint::Discard ); child.ApplyConstraint( constraint ); - constraint = Constraint::New( Actor::Property::Color, - LocalSource(Actor::Property::Position), + constraint = Constraint::New( Actor::Property::COLOR, + LocalSource(Actor::Property::POSITION), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ), - Source(scrollView, Actor::Property::Size ), + Source(scrollView, Actor::Property::SIZE ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_START_PAGE_POSITION_PROPERTY_NAME ) ), boost::bind( &ScrollPageSpiralEffectInfo::ColorConstraint, info, _1, _2, _3, _4, _5, _6, _7) ); constraint.SetRemoveAction( Constraint::Discard ); child.ApplyConstraint( constraint ); - constraint = Constraint::New( Actor::Property::Position, - LocalSource(Actor::Property::Position), + constraint = Constraint::New( Actor::Property::POSITION, + LocalSource(Actor::Property::POSITION), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ), - Source(scrollView, Actor::Property::Size ), + Source(scrollView, Actor::Property::SIZE ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_START_PAGE_POSITION_PROPERTY_NAME ) ), boost::bind( &ScrollPageSpiralEffectInfo::PositionConstraint, info, _1, _2, _3, _4, _5, _6, _7) ); diff --git a/dali-toolkit/internal/controls/scrollable/scrollable-impl.cpp b/dali-toolkit/internal/controls/scrollable/scrollable-impl.cpp index 87d31f8..0c73cd4 100644 --- a/dali-toolkit/internal/controls/scrollable/scrollable-impl.cpp +++ b/dali-toolkit/internal/controls/scrollable/scrollable-impl.cpp @@ -17,6 +17,7 @@ // EXTERNAL INCLUDES #include +#include // INTERNAL INCLUDES #include @@ -24,33 +25,17 @@ 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() { @@ -58,30 +43,25 @@ 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 @@ -246,12 +226,12 @@ void Scrollable::SetProperty( BaseObject* object, Property::Index index, const P Scrollable& scrollableImpl( GetImpl( scrollable ) ); switch( index ) { - case Toolkit::Scrollable::PROPERTY_OVERSHOOT_EFFECT_COLOR: + case Toolkit::Scrollable::Property::OVERSHOOT_EFFECT_COLOR: { scrollableImpl.SetOvershootEffectColor( value.Get() ); break; } - case Toolkit::Scrollable::PROPERTY_OVERSHOOT_ANIMATION_SPEED: + case Toolkit::Scrollable::Property::OVERSHOOT_ANIMATION_SPEED: { scrollableImpl.SetOvershootAnimationSpeed( value.Get() ); break; @@ -271,12 +251,12 @@ Property::Value Scrollable::GetProperty( BaseObject* object, Property::Index ind 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; diff --git a/dali-toolkit/internal/controls/scrollable/scrollable-impl.h b/dali-toolkit/internal/controls/scrollable/scrollable-impl.h index 1bceb81..799ed62 100644 --- a/dali-toolkit/internal/controls/scrollable/scrollable-impl.h +++ b/dali-toolkit/internal/controls/scrollable/scrollable-impl.h @@ -44,8 +44,8 @@ typedef IntrusivePtr ScrollablePtr; 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. diff --git a/dali-toolkit/internal/controls/shadow-view/shadow-view-impl.cpp b/dali-toolkit/internal/controls/shadow-view/shadow-view-impl.cpp index 88e8599..9bc67c7 100644 --- a/dali-toolkit/internal/controls/shadow-view/shadow-view-impl.cpp +++ b/dali-toolkit/internal/controls/shadow-view/shadow-view-impl.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -69,8 +70,8 @@ BaseHandle Create() 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; @@ -79,12 +80,11 @@ const float DEFAULT_FIELD_OF_VIEW_RADIANS = Math::PI / 4.0f; // 45 degrees 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" @@ -315,15 +315,15 @@ void ShadowView::ConstrainCamera() // is under control of application, can't use transform inheritance) Constraint cameraOrientationConstraint = - Constraint::New ( Actor::Property::Rotation, - Source( mShadowPlane, Actor::Property::WorldPosition ), - Source( mPointLight, Actor::Property::WorldPosition ), - Source( mShadowPlane, Actor::Property::WorldRotation ), + Constraint::New ( Actor::Property::ROTATION, + Source( mShadowPlane, Actor::Property::WORLD_POSITION ), + Source( mPointLight, Actor::Property::WORLD_POSITION ), + Source( mShadowPlane, Actor::Property::WORLD_ROTATION ), &LookAt ); mCameraActor.ApplyConstraint( cameraOrientationConstraint ); - Constraint pointLightPositionConstraint = Constraint::New( Actor::Property::Position, Source( mPointLight, Actor::Property::WorldPosition ), EqualToConstraint() ); + Constraint pointLightPositionConstraint = Constraint::New( Actor::Property::POSITION, Source( mPointLight, Actor::Property::WORLD_POSITION ), EqualToConstraint() ); mCameraActor.ApplyConstraint( pointLightPositionConstraint ); } @@ -371,8 +371,8 @@ void ShadowView::SetShaderConstants() Property::Index lightCameraProjectionMatrixPropertyIndex = mShadowRenderShader.GetPropertyIndex(SHADER_LIGHT_CAMERA_PROJECTION_MATRIX_PROPERTY_NAME); Property::Index lightCameraViewMatrixPropertyIndex = mShadowRenderShader.GetPropertyIndex(SHADER_LIGHT_CAMERA_VIEW_MATRIX_PROPERTY_NAME); - Constraint projectionMatrixConstraint = Constraint::New( lightCameraProjectionMatrixPropertyIndex, Source( mCameraActor, CameraActor::Property::ProjectionMatrix ), EqualToConstraintMatrix()); - Constraint viewMatrixConstraint = Constraint::New( lightCameraViewMatrixPropertyIndex, Source( mCameraActor, CameraActor::Property::ViewMatrix ), EqualToConstraintMatrix()); + Constraint projectionMatrixConstraint = Constraint::New( lightCameraProjectionMatrixPropertyIndex, Source( mCameraActor, CameraActor::Property::PROJECTION_MATRIX ), EqualToConstraintMatrix()); + Constraint viewMatrixConstraint = Constraint::New( lightCameraViewMatrixPropertyIndex, Source( mCameraActor, CameraActor::Property::VIEW_MATRIX ), EqualToConstraintMatrix()); mShadowRenderShader.ApplyConstraint(projectionMatrixConstraint); mShadowRenderShader.ApplyConstraint(viewMatrixConstraint); diff --git a/dali-toolkit/internal/controls/slider/slider-impl.cpp b/dali-toolkit/internal/controls/slider/slider-impl.cpp index ad1576d..56bbd33 100755 --- a/dali-toolkit/internal/controls/slider/slider-impl.cpp +++ b/dali-toolkit/internal/controls/slider/slider-impl.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include // INTERNAL INCLUDES @@ -35,40 +36,46 @@ namespace Dali 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; @@ -115,50 +122,7 @@ const bool DEFAULT_SHOW_VALUE = true; 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 @@ -832,16 +796,14 @@ bool Slider::MarkReached( float value, int& outIndex ) outIndex = current; return true; } + + if( value < mark ) + { + tail = current - 1; + } else { - if( value < mark ) - { - tail = current - 1; - } - else - { - head = current + 1; - } + head = current + 1; } } @@ -1088,121 +1050,121 @@ void Slider::SetProperty( BaseObject* object, Property::Index propertyIndex, con 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; @@ -1223,122 +1185,122 @@ Property::Value Slider::GetProperty( BaseObject* object, Property::Index propert 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; diff --git a/dali-toolkit/internal/controls/slider/slider-impl.h b/dali-toolkit/internal/controls/slider/slider-impl.h index d4ac718..8fee62e 100755 --- a/dali-toolkit/internal/controls/slider/slider-impl.h +++ b/dali-toolkit/internal/controls/slider/slider-impl.h @@ -49,13 +49,6 @@ class Slider : public Control { 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; /** diff --git a/dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp b/dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp index b469f83..1b15f2b 100644 --- a/dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp +++ b/dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp @@ -24,10 +24,11 @@ #include #include #include +#include #include #include -namespace //unnamed namespace +namespace //Unnamed namespace { using namespace Dali; @@ -81,13 +82,12 @@ 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() @@ -95,10 +95,12 @@ 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 @@ -150,7 +152,7 @@ void SuperBlurView::OnInitialize() for(unsigned int i=0; i < mBlurLevels; i++) { - mImageActors[i].ApplyConstraint( Constraint::New( Actor::Property::ColorAlpha, ParentSource( mBlurStrengthPropertyIndex ), ActorOpacityConstraint(mBlurLevels, i) ) ); + mImageActors[i].ApplyConstraint( Constraint::New( Actor::Property::COLOR_ALPHA, ParentSource( mBlurStrengthPropertyIndex ), ActorOpacityConstraint(mBlurLevels, i) ) ); } Self().SetSize(Stage::GetCurrent().GetSize()); @@ -277,24 +279,20 @@ void SuperBlurView::SetProperty( BaseObject* object, Property::Index propertyInd { 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" ); } } } @@ -306,22 +304,18 @@ Property::Value SuperBlurView::GetProperty( BaseObject* object, Property::Index 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 ); } } diff --git a/dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.h b/dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.h index db9c613..ebbe453 100644 --- a/dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.h +++ b/dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.h @@ -39,14 +39,6 @@ namespace Internal */ 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: diff --git a/dali-toolkit/internal/controls/table-view/table-view-impl.cpp b/dali-toolkit/internal/controls/table-view/table-view-impl.cpp index 30c66f3..e18fd6d 100644 --- a/dali-toolkit/internal/controls/table-view/table-view-impl.cpp +++ b/dali-toolkit/internal/controls/table-view/table-view-impl.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -110,41 +111,39 @@ namespace Dali 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 ) { @@ -717,7 +716,7 @@ void TableView::SetProperty( BaseObject* object, Property::Index index, const Pr TableView& tableViewImpl( GetImpl( tableView ) ); switch( index ) { - case Toolkit::TableView::PROPERTY_ROWS: + case Toolkit::TableView::Property::ROWS: { if( value.Get() != tableViewImpl.GetRows() ) { @@ -725,7 +724,7 @@ void TableView::SetProperty( BaseObject* object, Property::Index index, const Pr } break; } - case Toolkit::TableView::PROPERTY_COLUMNS: + case Toolkit::TableView::Property::COLUMNS: { if( value.Get() != tableViewImpl.GetColumns() ) { @@ -733,17 +732,17 @@ void TableView::SetProperty( BaseObject* object, Property::Index index, const Pr } break; } - case Toolkit::TableView::PROPERTY_CELL_PADDING: + case Toolkit::TableView::Property::CELL_PADDING: { tableViewImpl.SetCellPadding( value.Get() ); 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; @@ -763,27 +762,27 @@ Property::Value TableView::GetProperty( BaseObject* object, Property::Index inde 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; @@ -1210,6 +1209,7 @@ Actor TableView::GetNextKeyboardFocusableActor(Actor currentFocusedActor, Toolki break; } case Toolkit::Control::Down: + { if(++currentRow > numberOfRows - 1) { diff --git a/dali-toolkit/internal/controls/table-view/table-view-impl.h b/dali-toolkit/internal/controls/table-view/table-view-impl.h index 9939a05..154c341 100644 --- a/dali-toolkit/internal/controls/table-view/table-view-impl.h +++ b/dali-toolkit/internal/controls/table-view/table-view-impl.h @@ -40,13 +40,6 @@ class TableView : public Control { 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 */ diff --git a/dali-toolkit/internal/controls/text-input/text-input-decorator-impl.cpp b/dali-toolkit/internal/controls/text-input/text-input-decorator-impl.cpp index 9887238..d8c473c 100644 --- a/dali-toolkit/internal/controls/text-input/text-input-decorator-impl.cpp +++ b/dali-toolkit/internal/controls/text-input/text-input-decorator-impl.cpp @@ -670,37 +670,37 @@ void Decorator::SetUpHandlePropertyNotifications() Actor selectionHandleTwo = mTextInputHandles.GetSelectionHandleTwo(); // Exceeding horizontal boundary - PropertyNotification leftNotification = selectionHandleOne.AddPropertyNotification( Actor::Property::WorldPositionX, LessThanCondition( mBoundingRectangleWorldCoordinates.x + handlesize.x) ); + PropertyNotification leftNotification = selectionHandleOne.AddPropertyNotification( Actor::Property::WORLD_POSITION_X, LessThanCondition( mBoundingRectangleWorldCoordinates.x + handlesize.x) ); leftNotification.NotifySignal().Connect( this, &Decorator::OnLeftBoundaryExceeded ); - PropertyNotification rightNotification = selectionHandleTwo.AddPropertyNotification( Actor::Property::WorldPositionX, GreaterThanCondition( mBoundingRectangleWorldCoordinates.z - handlesize.x ) ); + PropertyNotification rightNotification = selectionHandleTwo.AddPropertyNotification( Actor::Property::WORLD_POSITION_X, GreaterThanCondition( mBoundingRectangleWorldCoordinates.z - handlesize.x ) ); rightNotification.NotifySignal().Connect( this, &Decorator::OnRightBoundaryExceeded ); // Within horizontal boundary - PropertyNotification leftLeaveNotification = selectionHandleOne.AddPropertyNotification( Actor::Property::WorldPositionX, GreaterThanCondition( mBoundingRectangleWorldCoordinates.x + 2*handlesize.x ) ); + PropertyNotification leftLeaveNotification = selectionHandleOne.AddPropertyNotification( Actor::Property::WORLD_POSITION_X, GreaterThanCondition( mBoundingRectangleWorldCoordinates.x + 2*handlesize.x ) ); leftLeaveNotification.NotifySignal().Connect( this, &Decorator::OnReturnToLeftBoundary ); - PropertyNotification rightLeaveNotification = selectionHandleTwo.AddPropertyNotification( Actor::Property::WorldPositionX, LessThanCondition( mBoundingRectangleWorldCoordinates.z - 2*handlesize.x ) ); + PropertyNotification rightLeaveNotification = selectionHandleTwo.AddPropertyNotification( Actor::Property::WORLD_POSITION_X, LessThanCondition( mBoundingRectangleWorldCoordinates.z - 2*handlesize.x ) ); rightLeaveNotification.NotifySignal().Connect( this, &Decorator::OnReturnToRightBoundary ); // Exceeding vertical boundary - PropertyNotification verticalExceedNotificationOne = selectionHandleOne.AddPropertyNotification( Actor::Property::WorldPositionY, + PropertyNotification verticalExceedNotificationOne = selectionHandleOne.AddPropertyNotification( Actor::Property::WORLD_POSITION_Y, OutsideCondition( mBoundingRectangleWorldCoordinates.y + handlesize.y, mBoundingRectangleWorldCoordinates.w - handlesize.y ) ); verticalExceedNotificationOne.NotifySignal().Connect( this, &Decorator::OnHandleOneLeavesBoundary ); - PropertyNotification verticalExceedNotificationTwo = selectionHandleTwo.AddPropertyNotification( Actor::Property::WorldPositionY, + PropertyNotification verticalExceedNotificationTwo = selectionHandleTwo.AddPropertyNotification( Actor::Property::WORLD_POSITION_Y, OutsideCondition( mBoundingRectangleWorldCoordinates.y + handlesize.y, mBoundingRectangleWorldCoordinates.w - handlesize.y ) ); verticalExceedNotificationTwo.NotifySignal().Connect( this, &Decorator::OnHandleTwoLeavesBoundary ); // Within vertical boundary - PropertyNotification verticalWithinNotificationOne = selectionHandleOne.AddPropertyNotification( Actor::Property::WorldPositionY, + PropertyNotification verticalWithinNotificationOne = selectionHandleOne.AddPropertyNotification( Actor::Property::WORLD_POSITION_Y, InsideCondition( mBoundingRectangleWorldCoordinates.y + handlesize.y, mBoundingRectangleWorldCoordinates.w - handlesize.y ) ); verticalWithinNotificationOne.NotifySignal().Connect( this, &Decorator::OnHandleOneWithinBoundary ); - PropertyNotification verticalWithinNotificationTwo = selectionHandleTwo.AddPropertyNotification( Actor::Property::WorldPositionY, + PropertyNotification verticalWithinNotificationTwo = selectionHandleTwo.AddPropertyNotification( Actor::Property::WORLD_POSITION_Y, InsideCondition( mBoundingRectangleWorldCoordinates.y + handlesize.y, mBoundingRectangleWorldCoordinates.w - handlesize.y ) ); verticalWithinNotificationTwo.NotifySignal().Connect( this, &Decorator::OnHandleTwoWithinBoundary ); @@ -863,7 +863,7 @@ void Decorator::SetUpPopUpPositionNotifications( ) // Note Property notifications ignore any set anchor point so conditions must allow for this. Default is Top Left. // Exceeding vertical boundary - PropertyNotification verticalExceedNotificationOne = mPopUpPanel.Self().AddPropertyNotification( Actor::Property::WorldPositionY, + PropertyNotification verticalExceedNotificationOne = mPopUpPanel.Self().AddPropertyNotification( Actor::Property::WORLD_POSITION_Y, OutsideCondition( mBoundingRectangleWorldCoordinates.y + mPopUpPanel.GetSize().y/2, mBoundingRectangleWorldCoordinates.w - mPopUpPanel.GetSize().y/2 ) ); verticalExceedNotificationOne.NotifySignal().Connect( this, &Decorator::PopUpLeavesVerticalBoundary ); diff --git a/dali-toolkit/internal/controls/text-input/text-input-impl.cpp b/dali-toolkit/internal/controls/text-input/text-input-impl.cpp index 6d9b9e4..c265bdc 100644 --- a/dali-toolkit/internal/controls/text-input/text-input-impl.cpp +++ b/dali-toolkit/internal/controls/text-input/text-input-impl.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -70,13 +71,13 @@ const float UI_Z_OFFSET( 0.2f ); ///< 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; @@ -173,73 +174,48 @@ namespace Dali 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] ///////////////////////////////////////////////// @@ -2132,8 +2108,7 @@ void TextInput::SetUpTouchEvents() if ( !mDoubleTapDetector ) { - mDoubleTapDetector = TapGestureDetector::New(); - mDoubleTapDetector.SetTapsRequired( 2 ); + mDoubleTapDetector = TapGestureDetector::New( 2 ); mDoubleTapDetector.DetectedSignal().Connect(this, &TextInput::OnDoubleTap); // Only attach and detach the actor to the double tap detector when we enter/leave edit mode @@ -3241,37 +3216,37 @@ void TextInput::SetUpHandlePropertyNotifications() Vector3 handlesize = GetSelectionHandleSize(); // Exceeding horizontal boundary - PropertyNotification leftNotification = mSelectionHandleOne.AddPropertyNotification( Actor::Property::WorldPositionX, LessThanCondition( mBoundingRectangleWorldCoordinates.x + handlesize.x) ); + PropertyNotification leftNotification = mSelectionHandleOne.AddPropertyNotification( Actor::Property::WORLD_POSITION_X, LessThanCondition( mBoundingRectangleWorldCoordinates.x + handlesize.x) ); leftNotification.NotifySignal().Connect( this, &TextInput::OnLeftBoundaryExceeded ); - PropertyNotification rightNotification = mSelectionHandleTwo.AddPropertyNotification( Actor::Property::WorldPositionX, GreaterThanCondition( mBoundingRectangleWorldCoordinates.z - handlesize.x ) ); + PropertyNotification rightNotification = mSelectionHandleTwo.AddPropertyNotification( Actor::Property::WORLD_POSITION_X, GreaterThanCondition( mBoundingRectangleWorldCoordinates.z - handlesize.x ) ); rightNotification.NotifySignal().Connect( this, &TextInput::OnRightBoundaryExceeded ); // Within horizontal boundary - PropertyNotification leftLeaveNotification = mSelectionHandleOne.AddPropertyNotification( Actor::Property::WorldPositionX, GreaterThanCondition( mBoundingRectangleWorldCoordinates.x + 2*handlesize.x ) ); + PropertyNotification leftLeaveNotification = mSelectionHandleOne.AddPropertyNotification( Actor::Property::WORLD_POSITION_X, GreaterThanCondition( mBoundingRectangleWorldCoordinates.x + 2*handlesize.x ) ); leftLeaveNotification.NotifySignal().Connect( this, &TextInput::OnReturnToLeftBoundary ); - PropertyNotification rightLeaveNotification = mSelectionHandleTwo.AddPropertyNotification( Actor::Property::WorldPositionX, LessThanCondition( mBoundingRectangleWorldCoordinates.z - 2*handlesize.x ) ); + PropertyNotification rightLeaveNotification = mSelectionHandleTwo.AddPropertyNotification( Actor::Property::WORLD_POSITION_X, LessThanCondition( mBoundingRectangleWorldCoordinates.z - 2*handlesize.x ) ); rightLeaveNotification.NotifySignal().Connect( this, &TextInput::OnReturnToRightBoundary ); // Exceeding vertical boundary - PropertyNotification verticalExceedNotificationOne = mSelectionHandleOne.AddPropertyNotification( Actor::Property::WorldPositionY, + PropertyNotification verticalExceedNotificationOne = mSelectionHandleOne.AddPropertyNotification( Actor::Property::WORLD_POSITION_Y, OutsideCondition( mBoundingRectangleWorldCoordinates.y + handlesize.y, mBoundingRectangleWorldCoordinates.w - handlesize.y ) ); verticalExceedNotificationOne.NotifySignal().Connect( this, &TextInput::OnHandleOneLeavesBoundary ); - PropertyNotification verticalExceedNotificationTwo = mSelectionHandleTwo.AddPropertyNotification( Actor::Property::WorldPositionY, + PropertyNotification verticalExceedNotificationTwo = mSelectionHandleTwo.AddPropertyNotification( Actor::Property::WORLD_POSITION_Y, OutsideCondition( mBoundingRectangleWorldCoordinates.y + handlesize.y, mBoundingRectangleWorldCoordinates.w - handlesize.y ) ); verticalExceedNotificationTwo.NotifySignal().Connect( this, &TextInput::OnHandleTwoLeavesBoundary ); // Within vertical boundary - PropertyNotification verticalWithinNotificationOne = mSelectionHandleOne.AddPropertyNotification( Actor::Property::WorldPositionY, + PropertyNotification verticalWithinNotificationOne = mSelectionHandleOne.AddPropertyNotification( Actor::Property::WORLD_POSITION_Y, InsideCondition( mBoundingRectangleWorldCoordinates.y + handlesize.y, mBoundingRectangleWorldCoordinates.w - handlesize.y ) ); verticalWithinNotificationOne.NotifySignal().Connect( this, &TextInput::OnHandleOneWithinBoundary ); - PropertyNotification verticalWithinNotificationTwo = mSelectionHandleTwo.AddPropertyNotification( Actor::Property::WorldPositionY, + PropertyNotification verticalWithinNotificationTwo = mSelectionHandleTwo.AddPropertyNotification( Actor::Property::WORLD_POSITION_Y, InsideCondition( mBoundingRectangleWorldCoordinates.y + handlesize.y, mBoundingRectangleWorldCoordinates.w - handlesize.y ) ); verticalWithinNotificationTwo.NotifySignal().Connect( this, &TextInput::OnHandleTwoWithinBoundary ); @@ -5340,84 +5315,85 @@ void TextInput::SetProperty( BaseObject* object, Property::Index propertyIndex, 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() ); break; } - case Toolkit::TextInput::COPY_BUTTON_POSITION_PRIORITY_PROPERTY: + case Toolkit::TextInput::Property::COPY_BUTTON_POSITION_PRIORITY: { textInputImpl.mPopupPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsCopy, value.Get() ); break; } - case Toolkit::TextInput::PASTE_BUTTON_POSITION_PRIORITY_PROPERTY: + case Toolkit::TextInput::Property::PASTE_BUTTON_POSITION_PRIORITY: { textInputImpl.mPopupPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsPaste, value.Get() ); break; } - case Toolkit::TextInput::SELECT_BUTTON_POSITION_PRIORITY_PROPERTY: + case Toolkit::TextInput::Property::SELECT_BUTTON_POSITION_PRIORITY: { textInputImpl.mPopupPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsSelect, value.Get() ); 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() ); break; } - case Toolkit::TextInput::CLIPBOARD_BUTTON_POSITION_PRIORITY_PROPERTY: + case Toolkit::TextInput::Property::CLIPBOARD_BUTTON_POSITION_PRIORITY: { textInputImpl.mPopupPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsClipboard, value.Get() ); 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; } } } @@ -5435,82 +5411,82 @@ Property::Value TextInput::GetProperty( BaseObject* object, Property::Index prop 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(); } diff --git a/dali-toolkit/internal/controls/text-input/text-input-impl.h b/dali-toolkit/internal/controls/text-input/text-input-impl.h index f913ead..8df0ac9 100644 --- a/dali-toolkit/internal/controls/text-input/text-input-impl.h +++ b/dali-toolkit/internal/controls/text-input/text-input-impl.h @@ -52,13 +52,6 @@ class TextInput : public Control { 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 diff --git a/dali-toolkit/internal/controls/text-input/text-input-popup-impl.cpp b/dali-toolkit/internal/controls/text-input/text-input-popup-impl.cpp index 4e369b1..21b39b8 100644 --- a/dali-toolkit/internal/controls/text-input/text-input-popup-impl.cpp +++ b/dali-toolkit/internal/controls/text-input/text-input-popup-impl.cpp @@ -40,23 +40,23 @@ const Vector2 DEFAULT_POPUP_INDICATOR_OFFSET(0.0f, 60.0f); /** * 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 @@ -549,8 +549,8 @@ void TextInputPopup::Hide(bool animate) if(animate) { mAnimation = Animation::New( HIDE_POPUP_ANIMATION_DURATION ); - mAnimation.AnimateTo( Property(mRoot, Actor::Property::Scale), Vector3::ZERO, AlphaFunctions::EaseOut ); - mAnimation.AnimateTo( Property(mRoot, Actor::Property::ColorAlpha), 0.0f, AlphaFunctions::EaseOut ); + mAnimation.AnimateTo( Property(mRoot, Actor::Property::SCALE), Vector3::ZERO, AlphaFunctions::EaseOut ); + mAnimation.AnimateTo( Property(mRoot, Actor::Property::COLOR_ALPHA), 0.0f, AlphaFunctions::EaseOut ); mAnimation.Play(); mAnimation.FinishedSignal().Connect( this, &TextInputPopup::OnHideFinished ); @@ -558,8 +558,8 @@ void TextInputPopup::Hide(bool animate) } else { - mRoot.SetProperty(Actor::Property::Scale, Vector3::ZERO); - mRoot.SetProperty(Actor::Property::ColorAlpha, 0.0f); + mRoot.SetProperty(Actor::Property::SCALE, Vector3::ZERO); + mRoot.SetProperty(Actor::Property::COLOR_ALPHA, 0.0f); mState = StateHidden; } } @@ -585,8 +585,8 @@ void TextInputPopup::Show( Actor target, bool animate ) if(animate) { mAnimation = Animation::New( SHOW_POPUP_ANIMATION_DURATION ); - mAnimation.AnimateTo( Property(mRoot, Actor::Property::Scale), Vector3::ONE, AlphaFunctions::EaseOut ); - mAnimation.AnimateTo( Property(mRoot, Actor::Property::ColorAlpha), 1.0f, AlphaFunctions::EaseOut ); + mAnimation.AnimateTo( Property(mRoot, Actor::Property::SCALE), Vector3::ONE, AlphaFunctions::EaseOut ); + mAnimation.AnimateTo( Property(mRoot, Actor::Property::COLOR_ALPHA), 1.0f, AlphaFunctions::EaseOut ); mAnimation.Play(); mAnimation.FinishedSignal().Connect( this, &TextInputPopup::OnShowFinished ); @@ -594,8 +594,8 @@ void TextInputPopup::Show( Actor target, bool animate ) } else { - mRoot.SetProperty(Actor::Property::Scale, Vector3::ONE); - mRoot.SetProperty(Actor::Property::ColorAlpha, 1.0f); + mRoot.SetProperty(Actor::Property::SCALE, Vector3::ONE); + mRoot.SetProperty(Actor::Property::COLOR_ALPHA, 1.0f); mState = StateShown; } } @@ -917,4 +917,3 @@ TextInputPopup::VisibilityChangeFinishedSignalType& TextInputPopup::ShowFinished } // namespace Toolkit } // namespace Dali - diff --git a/dali-toolkit/internal/controls/text-view/text-view-impl.cpp b/dali-toolkit/internal/controls/text-view/text-view-impl.cpp index 76d4539..241bcaa 100644 --- a/dali-toolkit/internal/controls/text-view/text-view-impl.cpp +++ b/dali-toolkit/internal/controls/text-view/text-view-impl.cpp @@ -21,6 +21,7 @@ // EXTERNAL INCLUDES #include #include +#include #include // INTERNAL INCLUDES @@ -38,27 +39,12 @@ namespace Dali 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"}; @@ -66,26 +52,29 @@ 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. @@ -2102,7 +2091,7 @@ void TextView::OnAlignmentPropertySet( Property::Index propertyIndex, Property:: { std::string value( propertyValue.Get() ); - if( propertyIndex == Toolkit::TextView::PROPERTY_HORIZONTAL_ALIGNMENT ) + if( propertyIndex == Toolkit::TextView::Property::HORIZONTAL_ALIGNMENT ) { if(value == "HorizontalLeft") { @@ -2121,7 +2110,7 @@ void TextView::OnAlignmentPropertySet( Property::Index propertyIndex, Property:: 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" ) { @@ -2202,49 +2191,49 @@ void TextView::SetProperty( BaseObject* object, Property::Index index, const Pro 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() ); 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() ); 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; @@ -2264,37 +2253,37 @@ Property::Value TextView::GetProperty( BaseObject* object, Property::Index index 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( boundary.mLeft.value ), @@ -2303,17 +2292,17 @@ Property::Value TextView::GetProperty( BaseObject* object, Property::Index index static_cast( 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; diff --git a/dali-toolkit/internal/controls/text-view/text-view-impl.h b/dali-toolkit/internal/controls/text-view/text-view-impl.h index 235fede..dfa7760 100644 --- a/dali-toolkit/internal/controls/text-view/text-view-impl.h +++ b/dali-toolkit/internal/controls/text-view/text-view-impl.h @@ -47,13 +47,6 @@ class TextView : public Control { 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. */ diff --git a/dali-toolkit/internal/controls/text-view/text-view-word-processor.cpp b/dali-toolkit/internal/controls/text-view/text-view-word-processor.cpp index 800a96b..eab8cf6 100644 --- a/dali-toolkit/internal/controls/text-view/text-view-word-processor.cpp +++ b/dali-toolkit/internal/controls/text-view/text-view-word-processor.cpp @@ -37,7 +37,7 @@ namespace TextViewProcessor namespace { -const std::string EMOJI_FONT_NAME( "SamsungEmoji" ); // Emoticons font family name. +const char* const EMOJI_FONT_NAME = "SamsungEmoji"; ///< Emoticons font family name. } // namespace diff --git a/dali-toolkit/internal/controls/tool-bar/tool-bar-impl.cpp b/dali-toolkit/internal/controls/tool-bar/tool-bar-impl.cpp index 207ffe6..e0dbd86 100644 --- a/dali-toolkit/internal/controls/tool-bar/tool-bar-impl.cpp +++ b/dali-toolkit/internal/controls/tool-bar/tool-bar-impl.cpp @@ -22,13 +22,12 @@ #include #include #include +#include // INTERNAL INCLUDES #include #include -// EXTERNAL INCLUDES - namespace Dali { @@ -40,12 +39,14 @@ namespace Internal 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 ); diff --git a/dali-toolkit/internal/controls/view/view-impl.cpp b/dali-toolkit/internal/controls/view/view-impl.cpp index 9e4eb86..9a486ed 100644 --- a/dali-toolkit/internal/controls/view/view-impl.cpp +++ b/dali-toolkit/internal/controls/view/view-impl.cpp @@ -22,8 +22,7 @@ #include #include #include - -// INTERNAL INCLUDES +#include namespace Dali { @@ -34,26 +33,19 @@ namespace Toolkit 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; diff --git a/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp b/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp index 4e26bc7..014e215 100644 --- a/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp +++ b/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -44,23 +45,16 @@ namespace Toolkit 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() @@ -81,12 +75,14 @@ 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 diff --git a/dali-toolkit/internal/styling/style-manager-impl.cpp b/dali-toolkit/internal/styling/style-manager-impl.cpp index 1ee0e9e..fa453dd 100644 --- a/dali-toolkit/internal/styling/style-manager-impl.cpp +++ b/dali-toolkit/internal/styling/style-manager-impl.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include // INTERNAL INCLUDES @@ -72,7 +73,9 @@ BaseHandle Create() 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 diff --git a/dali-toolkit/internal/transition-effects/cube-transition-effect-impl.cpp b/dali-toolkit/internal/transition-effects/cube-transition-effect-impl.cpp index 1c16683..14645f6 100644 --- a/dali-toolkit/internal/transition-effects/cube-transition-effect-impl.cpp +++ b/dali-toolkit/internal/transition-effects/cube-transition-effect-impl.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include namespace Dali @@ -36,13 +37,12 @@ namespace Internal 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() } diff --git a/dali-toolkit/public-api/controls/buttons/button.h b/dali-toolkit/public-api/controls/buttons/button.h index d67e38f..19e9fc6 100644 --- a/dali-toolkit/public-api/controls/buttons/button.h +++ b/dali-toolkit/public-api/controls/buttons/button.h @@ -59,17 +59,34 @@ class DALI_IMPORT_API Button : public Control { 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 bool + AUTO_REPEATING, ///< name "auto-repeating", @see SetAutoRepeating(), type bool + 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 bool + SELECTED, ///< name "selected", @see SetSelected(), type bool + 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: diff --git a/dali-toolkit/public-api/controls/cluster/cluster.h b/dali-toolkit/public-api/controls/cluster/cluster.h index aff0afb..d417e0f 100644 --- a/dali-toolkit/public-api/controls/cluster/cluster.h +++ b/dali-toolkit/public-api/controls/cluster/cluster.h @@ -54,7 +54,7 @@ public: // Custom properties - static const std::string CLUSTER_ACTOR_DEPTH; ///< Property, name "cluster-actor-depth", type FLOAT + static const std::string CLUSTER_ACTOR_DEPTH; ///< Property, name "cluster-actor-depth", type float public: diff --git a/dali-toolkit/public-api/controls/control-impl.cpp b/dali-toolkit/public-api/controls/control-impl.cpp index b88b3d7..b79badd 100644 --- a/dali-toolkit/public-api/controls/control-impl.cpp +++ b/dali-toolkit/public-api/controls/control-impl.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -45,29 +46,9 @@ namespace Dali 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 }, @@ -91,17 +72,20 @@ BaseHandle Create() 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 ); -// Property Registration after Internal::Control::Impl definition below +// Note: Properties are registered separately below, -TypeAction ACTION_TYPE_1( CONTROL_TYPE, ACTION_CONTROL_ACTIVATED, &Internal::Control::DoAction ); +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 ) -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_ACTION_REGISTRATION( Control, "control-activated", ACTION_CONTROL_ACTIVATED ) + +DALI_TYPE_REGISTRATION_END() /** * Structure which holds information about the background of a control @@ -231,7 +215,7 @@ void SetupBackgroundActor( Actor actor, Property::Index constrainingIndex, const actor.SetZ( BACKGROUND_ACTOR_Z_POSITION ); Constraint constraint = Constraint::New( constrainingIndex, - ParentSource( Actor::Property::Size ), + ParentSource( Actor::Property::SIZE ), EqualToConstraint() ); actor.ApplyConstraint( constraint ); } @@ -339,13 +323,13 @@ public: 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" ) ) { @@ -365,31 +349,31 @@ public: 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 >() ) { @@ -423,13 +407,13 @@ public: 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; @@ -450,31 +434,31 @@ public: 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; @@ -583,7 +567,7 @@ public: 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; @@ -593,13 +577,14 @@ public: 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() { @@ -788,7 +773,7 @@ void Control::SetBackgroundColor( const Vector4& color ) // Create Mesh Actor MeshActor meshActor = MeshActor::New( CreateMesh() ); - SetupBackgroundActor( meshActor, Actor::Property::Scale, color ); + SetupBackgroundActor( meshActor, Actor::Property::SCALE, color ); // Set the background actor before adding so that we do not inform deriving classes background.actor = meshActor; @@ -819,7 +804,7 @@ void Control::SetBackground( Image image ) } ImageActor imageActor = ImageActor::New( image ); - SetupBackgroundActor( imageActor, Actor::Property::Size, background.color ); + SetupBackgroundActor( imageActor, Actor::Property::SIZE, background.color ); // Set the background actor before adding so that we do not inform derived classes background.actor = imageActor; @@ -1323,11 +1308,6 @@ bool Control::OnMouseWheelEvent(const MouseWheelEvent& event) return false; // Do not consume } -Actor Control::GetChildByAlias(const std::string& actorAlias) -{ - return Actor(); -} - void Control::OnStageConnection() { RelayoutRequest(); diff --git a/dali-toolkit/public-api/controls/control-impl.h b/dali-toolkit/public-api/controls/control-impl.h index fcb1454..a441b07 100644 --- a/dali-toolkit/public-api/controls/control-impl.h +++ b/dali-toolkit/public-api/controls/control-impl.h @@ -62,13 +62,6 @@ class DALI_IMPORT_API Control : public CustomActorImpl, public ConnectionTracker { 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 /** @@ -653,11 +646,6 @@ private: */ virtual bool OnMouseWheelEvent(const MouseWheelEvent& event); - /** - * @copydoc Dali::CustomActorImpl::GetChildByAlias(const std::string& actorAlias) - */ - virtual Actor GetChildByAlias(const std::string& actorAlias); - // From CustomActorImpl, derived classes should NOT override these. /** diff --git a/dali-toolkit/public-api/controls/control.h b/dali-toolkit/public-api/controls/control.h index ada7c17..af840cd 100644 --- a/dali-toolkit/public-api/controls/control.h +++ b/dali-toolkit/public-api/controls/control.h @@ -65,16 +65,32 @@ class DALI_IMPORT_API Control : public CustomActor { 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 std::string + HEIGHT_POLICY, ///< name "height-policy", @see SetSizePolicy, type std::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 bool + }; + }; /** * @brief Describes how a control could be resized. diff --git a/dali-toolkit/public-api/controls/image-view/masked-image-view.h b/dali-toolkit/public-api/controls/image-view/masked-image-view.h index b474e76..0c604ec 100644 --- a/dali-toolkit/public-api/controls/image-view/masked-image-view.h +++ b/dali-toolkit/public-api/controls/image-view/masked-image-view.h @@ -59,11 +59,11 @@ public: */ enum CustomProperty { - BACKGROUND_COLOR, ///< Name "background-color", type VECTOR4 - SOURCE_SIZE, ///< Name "source-size", type VECTOR2 - SOURCE_OFFSET, ///< Name "source-offset", type VECTOR2 - MASK_SIZE, ///< Name "mask-size", type VECTOR2 - MASK_OFFSET, ///< Name "mask-offset", type VECTOR2 + BACKGROUND_COLOR, ///< Name "background-color", type Vector4 + SOURCE_SIZE, ///< Name "source-size", type Vector2 + SOURCE_OFFSET, ///< Name "source-offset", type Vector2 + MASK_SIZE, ///< Name "mask-size", type Vector2 + MASK_OFFSET, ///< Name "mask-offset", type Vector2 CUSTOM_PROPERTY_COUNT }; diff --git a/dali-toolkit/public-api/controls/magnifier/magnifier.h b/dali-toolkit/public-api/controls/magnifier/magnifier.h index 4538f81..ff6cee0 100644 --- a/dali-toolkit/public-api/controls/magnifier/magnifier.h +++ b/dali-toolkit/public-api/controls/magnifier/magnifier.h @@ -47,7 +47,7 @@ public: // Custom properties - static const std::string SOURCE_POSITION_PROPERTY_NAME; ///< Property, name "source-position", type VECTOR3 + static const std::string SOURCE_POSITION_PROPERTY_NAME; ///< Property, name "source-position", type Vector3 public: diff --git a/dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h b/dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h index c9b04d8..70fcb9d 100755 --- a/dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h +++ b/dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h @@ -53,15 +53,32 @@ class DALI_IMPORT_API ScrollBar : public ScrollComponent { 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 std::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: /** diff --git a/dali-toolkit/public-api/controls/scrollable/item-view/item-layout.cpp b/dali-toolkit/public-api/controls/scrollable/item-view/item-layout.cpp index 33acbc4..13f2612 100644 --- a/dali-toolkit/public-api/controls/scrollable/item-view/item-layout.cpp +++ b/dali-toolkit/public-api/controls/scrollable/item-view/item-layout.cpp @@ -200,10 +200,10 @@ void ItemLayout::ApplyConstraints( Actor& actor, const int itemId, const float d if (GetPositionConstraint(itemId, positionConstraint)) { WrappedVector3Constraint wrapped(positionConstraint, itemId); - Constraint constraint = Constraint::New( Actor::Property::Position, + Constraint constraint = Constraint::New( Actor::Property::POSITION, Source( scrollPositionObject, scrollPositionProperty ), ParentSource( scrollSpeedProperty ), - ParentSource( Actor::Property::Size ), + ParentSource( Actor::Property::SIZE ), wrapped ); constraint.SetApplyTime(durationSeconds); constraint.SetAlphaFunction(mAlphaFunction); @@ -215,10 +215,10 @@ void ItemLayout::ApplyConstraints( Actor& actor, const int itemId, const float d { WrappedQuaternionConstraint wrapped(rotationConstraint, itemId); - Constraint constraint = Constraint::New( Actor::Property::Rotation, + Constraint constraint = Constraint::New( Actor::Property::ROTATION, Source( scrollPositionObject, scrollPositionProperty ), ParentSource( scrollSpeedProperty ), - ParentSource( Actor::Property::Size ), + ParentSource( Actor::Property::SIZE ), wrapped ); constraint.SetApplyTime(durationSeconds); constraint.SetAlphaFunction(mAlphaFunction); @@ -231,10 +231,10 @@ void ItemLayout::ApplyConstraints( Actor& actor, const int itemId, const float d { WrappedVector3Constraint wrapped(scaleConstraint, itemId); - Constraint constraint = Constraint::New( Actor::Property::Scale, + Constraint constraint = Constraint::New( Actor::Property::SCALE, Source( scrollPositionObject, scrollPositionProperty ), ParentSource( scrollSpeedProperty ), - ParentSource( Actor::Property::Size ), + ParentSource( Actor::Property::SIZE ), wrapped ); constraint.SetApplyTime(durationSeconds); constraint.SetAlphaFunction(mAlphaFunction); @@ -247,10 +247,10 @@ void ItemLayout::ApplyConstraints( Actor& actor, const int itemId, const float d { WrappedVector4Constraint wrapped(colorConstraint, itemId); - Constraint constraint = Constraint::New( Actor::Property::Color, + Constraint constraint = Constraint::New( Actor::Property::COLOR, Source( scrollPositionObject, scrollPositionProperty ), ParentSource( scrollSpeedProperty ), - ParentSource( Actor::Property::Size ), + ParentSource( Actor::Property::SIZE ), wrapped ); constraint.SetApplyTime(durationSeconds); @@ -265,10 +265,10 @@ void ItemLayout::ApplyConstraints( Actor& actor, const int itemId, const float d { WrappedBoolConstraint wrapped(visibilityConstraint, itemId); - Constraint constraint = Constraint::New( Actor::Property::Visible, + Constraint constraint = Constraint::New( Actor::Property::VISIBLE, Source( scrollPositionObject, scrollPositionProperty ), ParentSource( scrollSpeedProperty ), - ParentSource( Actor::Property::Size ), + ParentSource( Actor::Property::SIZE ), wrapped ); constraint.SetApplyTime(durationSeconds); diff --git a/dali-toolkit/public-api/controls/scrollable/item-view/item-layout.h b/dali-toolkit/public-api/controls/scrollable/item-view/item-layout.h index c81fe2e..92659ed 100644 --- a/dali-toolkit/public-api/controls/scrollable/item-view/item-layout.h +++ b/dali-toolkit/public-api/controls/scrollable/item-view/item-layout.h @@ -128,7 +128,7 @@ struct ItemRange * An ItemLayout also describes the direction of input gestures, used to scroll through the layout. * Whilst scrolling, the layout provides a range of items that are within a layout-area (3D bounding volume). */ -class ItemLayout : public RefObject +class DALI_IMPORT_API ItemLayout : public RefObject { public: diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h index 818e4b4..6cf6331 100644 --- a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h +++ b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h @@ -411,17 +411,17 @@ public: // Custom properties - static const std::string SCROLL_TIME_PROPERTY_NAME; ///< Property, name "scroll-time", type FLOAT - static const std::string SCROLL_POSITION_PROPERTY_NAME; ///< Property, name "scroll-position", type VECTOR3 - static const std::string SCROLL_PRE_POSITION_PROPERTY_NAME; ///< Property, name "scroll-pre-position", type VECTOR3 - static const std::string SCROLL_OVERSHOOT_X_PROPERTY_NAME; ///< Property, name "scroll-overshoot-x", type float - static const std::string SCROLL_OVERSHOOT_Y_PROPERTY_NAME; ///< Property, name "scroll-overshoot-y", type float - static const std::string SCROLL_FINAL_PROPERTY_NAME; ///< Property, name "scroll-final", type VECTOR3 - static const std::string SCROLL_WRAP_PROPERTY_NAME; ///< Property, name "scroll-wrap", type BOOLEAN - static const std::string SCROLL_PANNING_PROPERTY_NAME; ///< Property, name "scroll-panning", type BOOLEAN - static const std::string SCROLL_SCROLLING_PROPERTY_NAME; ///< Property, name "scroll-scrolling", type BOOLEAN - static const std::string SCROLL_POSITION_DELTA_PROPERTY_NAME; ///< Property, name "scroll-position-delta" type VECTOR3 - static const std::string SCROLL_START_PAGE_POSITION_PROPERTY_NAME; ///< Property, name "scroll-start-page-position" type VECTOR3 + static const std::string SCROLL_TIME_PROPERTY_NAME; ///< Property, name "scroll-time", type float + static const std::string SCROLL_POSITION_PROPERTY_NAME; ///< Property, name "scroll-position", type Vector3 + static const std::string SCROLL_PRE_POSITION_PROPERTY_NAME; ///< Property, name "scroll-pre-position", type Vector3 + static const std::string SCROLL_OVERSHOOT_X_PROPERTY_NAME; ///< Property, name "scroll-overshoot-x", type float + static const std::string SCROLL_OVERSHOOT_Y_PROPERTY_NAME; ///< Property, name "scroll-overshoot-y", type float + static const std::string SCROLL_FINAL_PROPERTY_NAME; ///< Property, name "scroll-final", type Vector3 + static const std::string SCROLL_WRAP_PROPERTY_NAME; ///< Property, name "scroll-wrap", type bool + static const std::string SCROLL_PANNING_PROPERTY_NAME; ///< Property, name "scroll-panning", type bool + static const std::string SCROLL_SCROLLING_PROPERTY_NAME; ///< Property, name "scroll-scrolling", type bool + static const std::string SCROLL_POSITION_DELTA_PROPERTY_NAME; ///< Property, name "scroll-position-delta" type Vector3 + static const std::string SCROLL_START_PAGE_POSITION_PROPERTY_NAME; ///< Property, name "scroll-start-page-position" type Vector3 // Default settings diff --git a/dali-toolkit/public-api/controls/scrollable/scrollable.h b/dali-toolkit/public-api/controls/scrollable/scrollable.h index 3065a2c..0b315f3 100644 --- a/dali-toolkit/public-api/controls/scrollable/scrollable.h +++ b/dali-toolkit/public-api/controls/scrollable/scrollable.h @@ -61,16 +61,31 @@ public: // Custom properties - static const std::string SCROLL_RELATIVE_POSITION_PROPERTY_NAME; ///< Property, name "scroll-relative-position", type VECTOR3 - static const std::string SCROLL_POSITION_MIN_PROPERTY_NAME; ///< Property, name "scroll-position-min", type VECTOR3 - 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 - /** @} */ + static const std::string SCROLL_RELATIVE_POSITION_PROPERTY_NAME; ///< Property, name "scroll-relative-position", type Vector3 + static const std::string SCROLL_POSITION_MIN_PROPERTY_NAME; ///< Property, name "scroll-position-min", type Vector3 + 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 + + /** + * @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: diff --git a/dali-toolkit/public-api/controls/slider/slider.h b/dali-toolkit/public-api/controls/slider/slider.h index a9427c0..7b9ae6b 100644 --- a/dali-toolkit/public-api/controls/slider/slider.h +++ b/dali-toolkit/public-api/controls/slider/slider.h @@ -45,34 +45,44 @@ class DALI_IMPORT_API Slider : public Control { 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 - 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 std::string + HANDLE_IMAGE_NAME, ///< Property, name "handle-image-name", type std::string + PROGRESS_IMAGE_NAME, ///< Property, name "progress-image-name", type std::string + POPUP_IMAGE_NAME, ///< Property, name "popup-image-name", type std::string + POPUP_ARROW_IMAGE_NAME, ///< Property, name "popup-arrow-image-name", type std::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 int + SHOW_POPUP, ///< Property, name "show-popup", type bool + SHOW_VALUE, ///< Property, name "show-value", type bool + ENABLED, ///< Property, name "enabled", type bool + MARKS, ///< Property, name "marks", type Property::Array + SNAP_TO_MARKS, ///< Property, name "snap-to-marks", type bool + MARK_TOLERANCE, ///< Property, name "mark-tolerance", type float + }; + }; public: diff --git a/dali-toolkit/public-api/controls/super-blur-view/super-blur-view.h b/dali-toolkit/public-api/controls/super-blur-view/super-blur-view.h index 734ea8f..c02c09c 100644 --- a/dali-toolkit/public-api/controls/super-blur-view/super-blur-view.h +++ b/dali-toolkit/public-api/controls/super-blur-view/super-blur-view.h @@ -56,8 +56,25 @@ class DALI_IMPORT_API SuperBlurView : public Control { 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. diff --git a/dali-toolkit/public-api/controls/table-view/table-view.h b/dali-toolkit/public-api/controls/table-view/table-view.h index ffcf342..104a050 100644 --- a/dali-toolkit/public-api/controls/table-view/table-view.h +++ b/dali-toolkit/public-api/controls/table-view/table-view.h @@ -45,14 +45,19 @@ class DALI_IMPORT_API TableView : public Control { 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": @@ -61,11 +66,8 @@ public: "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": @@ -75,15 +77,22 @@ public: } * @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 int + COLUMNS, ///< name "columns", type unsigned int + 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) - + 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 is 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 is unable to differentiate integer and float from Json string) /** * @brief Describes how the size of a row / column been set diff --git a/dali-toolkit/public-api/controls/text-input/text-input.h b/dali-toolkit/public-api/controls/text-input/text-input.h index b0db235..0598988 100644 --- a/dali-toolkit/public-api/controls/text-input/text-input.h +++ b/dali-toolkit/public-api/controls/text-input/text-input.h @@ -42,25 +42,40 @@ class DALI_IMPORT_API TextInput : public Control 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 int + COPY_BUTTON_POSITION_PRIORITY, // Property, name "copy-button-position-priority", type unsigned int + PASTE_BUTTON_POSITION_PRIORITY, // Property, name "paste-button-position-priority", type unsigned int + SELECT_BUTTON_POSITION_PRIORITY, // Property, name "select-button-position-priority", type unsigned int + SELECT_ALL_BUTTON_POSITION_PRIORITY, // Property, name "select-all-button-position-priority", type unsigned int + CLIPBOARD_BUTTON_POSITION_PRIORITY, // Property, name "clipboard-button-position-priority", type unsigned int + POP_UP_OFFSET_FROM_TEXT, // Property, name "popup-offset-from-text", type Vector4 + CURSOR_COLOR, // Property, name "cursor-color", type Vector4 + }; + }; public: diff --git a/dali-toolkit/public-api/controls/text-view/text-view.h b/dali-toolkit/public-api/controls/text-view/text-view.h index f4cfa2e..0eb8024 100644 --- a/dali-toolkit/public-api/controls/text-view/text-view.h +++ b/dali-toolkit/public-api/controls/text-view/text-view.h @@ -52,17 +52,34 @@ class DALI_IMPORT_API TextView : public Control { 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 bool + TEXT, ///< name "text", @see SetText(), type std::string + MULTILINE_POLICY, ///< name "multiline-policy", @see SetMultilinePolicy(), type std::string + WIDTH_EXCEED_POLICY, ///< name "width-exceed-policy", @see SetWidthExceedPolicy(), type std::string + HEIGHT_EXCEED_POLICY, ///< name "height-exceed-policy", @see SetHeightExceedPolicy(), type std::string + LINE_JUSTIFICATION, ///< name "line-justification", @see SetLineJustification(), type std::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 std::string + VERTICAL_ALIGNMENT, ///< name "vertical-alignment", @see SetTextAlignment(), type std::string + }; + }; /** * @brief Structure used to retrieve Layout info per character. diff --git a/dali-toolkit/public-api/dali-toolkit-version.cpp b/dali-toolkit/public-api/dali-toolkit-version.cpp index ba2e1d8..78fc9df 100644 --- a/dali-toolkit/public-api/dali-toolkit-version.cpp +++ b/dali-toolkit/public-api/dali-toolkit-version.cpp @@ -31,7 +31,7 @@ namespace Toolkit const unsigned int TOOLKIT_MAJOR_VERSION = 1; const unsigned int TOOLKIT_MINOR_VERSION = 0; -const unsigned int TOOLKIT_MICRO_VERSION = 32; +const unsigned int TOOLKIT_MICRO_VERSION = 33; const char * const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__; #ifdef DEBUG_ENABLED diff --git a/dali-toolkit/public-api/shader-effects/displacement-effect.h b/dali-toolkit/public-api/shader-effects/displacement-effect.h index d285a32..e59c388 100644 --- a/dali-toolkit/public-api/shader-effects/displacement-effect.h +++ b/dali-toolkit/public-api/shader-effects/displacement-effect.h @@ -221,4 +221,3 @@ private: } #endif //#ifndef __DALI_TOOLKIT_SHADER_EFFECT_DISPLACEMENT_H__ - diff --git a/dali-toolkit/public-api/shader-effects/dissolve-effect.cpp b/dali-toolkit/public-api/shader-effects/dissolve-effect.cpp index 04d02f6..c6d68af 100644 --- a/dali-toolkit/public-api/shader-effects/dissolve-effect.cpp +++ b/dali-toolkit/public-api/shader-effects/dissolve-effect.cpp @@ -106,7 +106,7 @@ DissolveEffect DissolveEffect::New( bool useHighPrecision ) Dali::Toolkit::DissolveEffect handle( shaderEffectCustom ); handle.SetUniform( DISTORTION_PROPERTY_NAME, 0.0f ); - handle.SetProperty( ShaderEffect::Property::GridDensity, Dali::Property::Value(50.0f) ); + handle.SetProperty( ShaderEffect::Property::GRID_DENSITY, Dali::Property::Value(50.0f) ); handle.SetCentralLine( Vector2(1.0f,0.5f), Vector2(-1.0f, 0.0f) ); diff --git a/dali-toolkit/public-api/shader-effects/dissolve-local-effect.cpp b/dali-toolkit/public-api/shader-effects/dissolve-local-effect.cpp index 4a6fab3..bc20944 100644 --- a/dali-toolkit/public-api/shader-effects/dissolve-local-effect.cpp +++ b/dali-toolkit/public-api/shader-effects/dissolve-local-effect.cpp @@ -108,7 +108,7 @@ DissolveLocalEffect DissolveLocalEffect::New( unsigned int numberOfDimples ) handle.SetRadius(i, 0.f); handle.SetDistortion( i, 0.f ); } - handle.SetProperty( ShaderEffect::Property::GridDensity, Dali::Property::Value(5.f) ); + handle.SetProperty( ShaderEffect::Property::GRID_DENSITY, Dali::Property::Value(5.f) ); handle.SetTransparency( 0.5f ); return handle; diff --git a/dali-toolkit/public-api/shader-effects/mirror-effect.h b/dali-toolkit/public-api/shader-effects/mirror-effect.h index 574c906..155a6e2 100644 --- a/dali-toolkit/public-api/shader-effects/mirror-effect.h +++ b/dali-toolkit/public-api/shader-effects/mirror-effect.h @@ -88,4 +88,3 @@ private: // Not intended for application developers } // namespace Dali #endif // __DALI_TOOLKIT_MIRROR_EFFECT_H__ - diff --git a/dali-toolkit/public-api/shader-effects/motion-blur-effect.cpp b/dali-toolkit/public-api/shader-effects/motion-blur-effect.cpp index 837fe15..de80751 100644 --- a/dali-toolkit/public-api/shader-effects/motion-blur-effect.cpp +++ b/dali-toolkit/public-api/shader-effects/motion-blur-effect.cpp @@ -89,7 +89,7 @@ MotionBlurEffect MotionBlurEffect::Apply( RenderableActor renderable ) Dali::Property::Index uModelProperty = newEffect.GetPropertyIndex( MOTION_BLUR_MODEL_LASTFRAME ); Constraint constraint = Constraint::New( uModelProperty, - Source( renderable, Actor::Property::WorldMatrix ), + Source( renderable, Actor::Property::WORLD_MATRIX ), EqualToConstraint() ); // and set up constraint. diff --git a/dali-toolkit/public-api/shader-effects/motion-blur-effect.h b/dali-toolkit/public-api/shader-effects/motion-blur-effect.h index 1cd0880..e9da7f2 100644 --- a/dali-toolkit/public-api/shader-effects/motion-blur-effect.h +++ b/dali-toolkit/public-api/shader-effects/motion-blur-effect.h @@ -214,4 +214,3 @@ private: } #endif //#ifndef __DALI_TOOLKIT_SHADER_EFFECT_MOTION_BLUR_H__ - diff --git a/dali-toolkit/public-api/shader-effects/motion-stretch-effect.cpp b/dali-toolkit/public-api/shader-effects/motion-stretch-effect.cpp index de70fb5..22383f0 100644 --- a/dali-toolkit/public-api/shader-effects/motion-stretch-effect.cpp +++ b/dali-toolkit/public-api/shader-effects/motion-stretch-effect.cpp @@ -103,7 +103,7 @@ MotionStretchEffect MotionStretchEffect::Apply( RenderableActor renderable ) Dali::Property::Index uModelProperty = newEffect.GetPropertyIndex( MOTION_STRETCH_MODELVIEW_LASTFRAME ); Constraint constraint = Constraint::New( uModelProperty, - Source( renderable, Actor::Property::WorldMatrix ), + Source( renderable, Actor::Property::WORLD_MATRIX ), EqualToConstraint() ); // and set up constraint. diff --git a/dali-toolkit/public-api/shader-effects/motion-stretch-effect.h b/dali-toolkit/public-api/shader-effects/motion-stretch-effect.h index dddec68..15cfcbf 100644 --- a/dali-toolkit/public-api/shader-effects/motion-stretch-effect.h +++ b/dali-toolkit/public-api/shader-effects/motion-stretch-effect.h @@ -165,4 +165,3 @@ private: } #endif //#ifndef __DALI_TOOLKIT_SHADER_EFFECT_MOTION_STRETCH_H__ - diff --git a/dali-toolkit/public-api/shader-effects/nine-patch-mask-effect.cpp b/dali-toolkit/public-api/shader-effects/nine-patch-mask-effect.cpp index f717d5c..0aef67f 100644 --- a/dali-toolkit/public-api/shader-effects/nine-patch-mask-effect.cpp +++ b/dali-toolkit/public-api/shader-effects/nine-patch-mask-effect.cpp @@ -91,7 +91,7 @@ static void DoApply( ImageActor actor, const std::string& maskImage, const Vecto maskEffect.SetUniform( "uImageSize", Vector2(0,0) /*Constrained to actor size*/ ); maskEffect.ApplyConstraint( Constraint::New( maskEffect.GetPropertyIndex("uImageSize"), - Source(actor, Actor::Property::Size), + Source(actor, Actor::Property::SIZE), NinePatchMaskEffectSizeConstraint() ) ); maskEffect.SetUniform( "uMaskSize", maskSize ); diff --git a/dali-toolkit/public-api/shader-effects/soft-button-effect.cpp b/dali-toolkit/public-api/shader-effects/soft-button-effect.cpp index 14ff237..9789576 100644 --- a/dali-toolkit/public-api/shader-effects/soft-button-effect.cpp +++ b/dali-toolkit/public-api/shader-effects/soft-button-effect.cpp @@ -428,4 +428,3 @@ const std::string& SoftButtonEffect::GetRectangleSizeScalePropertyName() const } } - diff --git a/dali-toolkit/public-api/shader-effects/soft-button-effect.h b/dali-toolkit/public-api/shader-effects/soft-button-effect.h index 6b2f3ff..6013115 100644 --- a/dali-toolkit/public-api/shader-effects/soft-button-effect.h +++ b/dali-toolkit/public-api/shader-effects/soft-button-effect.h @@ -175,4 +175,3 @@ private: } #endif //#ifndef __DALI_TOOLKIT_SHADER_EFFECT_SOFT_BUTTON_H__ - diff --git a/docs/content/programming-guide/properties.h b/docs/content/programming-guide/properties.h index a8d452b..4c124cb 100644 --- a/docs/content/programming-guide/properties.h +++ b/docs/content/programming-guide/properties.h @@ -10,8 +10,8 @@ shows the index range of the different properties in place. Default Properties defined within DALi Core, e.g. Dali::Actor, Dali::ShaderEffect default properties etc. 0 to 9999999 Registered Properties registered using Dali::PropertyRegistration 10000000 to 19999999 Control Property range reserved by Dali::Toolkit::Control 10000000 to 10001000
- \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 + \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 Derived Control Property range for control deriving directly from Dali::Toolkit::Control 10001001 to 19999999 Custom Custom properties added to instance using Dali::Handle::RegisterProperty 50000000 onwards diff --git a/docs/content/programming-guide/type-registration.h b/docs/content/programming-guide/type-registration.h index 3f3663f..bef67d0 100644 --- a/docs/content/programming-guide/type-registration.h +++ b/docs/content/programming-guide/type-registration.h @@ -193,10 +193,10 @@ Dali::PROPERTY_REGISTRATION_MAX_INDEX. 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. diff --git a/packaging/dali-toolkit.spec b/packaging/dali-toolkit.spec index 4bd9dc0..d2a0dc4 100644 --- a/packaging/dali-toolkit.spec +++ b/packaging/dali-toolkit.spec @@ -1,6 +1,6 @@ Name: dali-toolkit Summary: The OpenGLES Canvas Core Library Toolkit -Version: 1.0.32 +Version: 1.0.33 Release: 1 Group: System/Libraries License: Apache-2.0 diff --git a/plugins/dali-script-v8/docs/content/constants.js b/plugins/dali-script-v8/docs/content/constants.js index a6b2e1e..d70d538 100644 --- a/plugins/dali-script-v8/docs/content/constants.js +++ b/plugins/dali-script-v8/docs/content/constants.js @@ -4,7 +4,7 @@ Constants accessible under the dali global object. - actor.parentOrigin = dali.BACK_TOP_LEFT; + actor.parentOrigin = dali.TOP_LEFT; actor.color = dali.COLOR_RED; actor.setBlendFunc( dali.BLEND_FACTOR_ONE_MINUS_SRC_COLOR, dali.BLEND_FACTOR_SRC_ALPHA_SATURATE ); @@ -12,15 +12,6 @@ Constants accessible under the dali global object. | Constant Name | value | |---------------|-------| | ** actor.parentOrigin and actor.anchorPoint ** | | -|BACK_TOP_LEFT | (0.0f, 0.0f, 0.0f) | -|BACK_TOP_CENTER | (0.5f, 0.0f, 0.0f) | -|BACK_TOP_RIGHT | (1.0f, 0.0f, 0.0f) | -|BACK_CENTER_LEFT | (0.0f, 0.5f, 0.0f) | -|BACK_CENTER | (0.5f, 0.5f, 0.0f) | -|BACK_CENTER_RIGHT | (1.0f, 0.5f, 0.0f) | -|BACK_BOTTOM_LEFT | (0.0f, 1.0f, 0.0f) | -|BACK_BOTTOM_CENTER | (0.5f, 1.0f, 0.0f) | -|BACK_BOTTOM_RIGHT | (1.0f, 1.0f, 0.0f) | |TOP_LEFT | (0.0f, 0.0f, 0.5f) | |TOP_CENTER | (0.5f, 0.0f, 0.5f) | |TOP_RIGHT | (1.0f, 0.0f, 0.5f) | @@ -31,16 +22,6 @@ Constants accessible under the dali global object. |BOTTOM_CENTER | (0.5f, 1.0f, 0.5f) | |BOTTOM_RIGHT | (1.0f, 1.0f, 0.5f) | -|FRONT_TOP_LEFT | (0.0f, 0.0f, 1.0f) | -|FRONT_TOP_CENTER | (0.5f, 0.0f, 1.0f) | -|FRONT_TOP_RIGHT | (1.0f, 0.0f, 1.0f) | -|FRONT_CENTER_LEFT | (0.0f, 0.5f, 1.0f) | -|FRONT_CENTER | (0.5f, 0.5f, 1.0f) | -|FRONT_CENTER_RIGHT | (1.0f, 0.5f, 1.0f) | -|FRONT_BOTTOM_LEFT | (0.0f, 1.0f, 1.0f) | -|FRONT_BOTTOM_CENTER | (0.5f, 1.0f, 1.0f) | -|FRONT_BOTTOM_RIGHT | (1.0f, 1.0f, 1.0f) | - |** Vector3 ** | | |VECTOR3_ONE | (1.0f, 1.0f, 1.0f) | diff --git a/plugins/dali-script-v8/docs/content/shader-effect.js b/plugins/dali-script-v8/docs/content/shader-effect.js index ea1eba8..eedfafa 100644 --- a/plugins/dali-script-v8/docs/content/shader-effect.js +++ b/plugins/dali-script-v8/docs/content/shader-effect.js @@ -168,7 +168,7 @@ var animOptions = { // if we go to 1.0 then it will go to a full box shaderAnim.animateTo( revealEffect, "uRadius", 0.5,animOptions); shaderAnim.play(); - +``` * * * ### Example of paper twisting in the wind with color (Vertex + Fragment Shader) @@ -185,7 +185,7 @@ vertices. To do this we can break the image into a grid using the gridX and grid - +``` createTwistEffect = function() { diff --git a/plugins/dali-script-v8/src/actors/actor-api.cpp b/plugins/dali-script-v8/src/actors/actor-api.cpp index ebc1fa7..89a3a67 100644 --- a/plugins/dali-script-v8/src/actors/actor-api.cpp +++ b/plugins/dali-script-v8/src/actors/actor-api.cpp @@ -335,39 +335,6 @@ void ActorApi::FindChildByName( const v8::FunctionCallbackInfo& args } /** - * Search through this actor's hierarchy for an actor with the given name or alias. - * - * Actors can customize this function to provide actors with preferred alias' - * For example 'previous' could return the last selected child. - * If no aliased actor is found then FindChildByName() is called. - * - * @for Actor - * @method findChildByAlias - * @param {String} actor alias - * @return {Object} actor on success, empty actor handle if not found - */ -void ActorApi::FindChildByAlias( const v8::FunctionCallbackInfo& args ) -{ - v8::Isolate* isolate = args.GetIsolate(); - v8::HandleScope handleScope( isolate ); - Actor parent = GetActor( isolate, args ); - bool found( false ); - std::string name = V8Utils::GetStringParameter( PARAMETER_0, found, isolate, args ); - if( !found ) - { - DALI_SCRIPT_EXCEPTION( isolate, "String parameter not found" ); - return; - } - Actor childActor = parent.FindChildByAlias( name ); - if( childActor ) - { - // wrap the child - v8::Local < v8::Object > wrappedLayer = ActorWrapper::WrapActor( isolate, childActor ); - args.GetReturnValue().Set( wrappedLayer ); - } -} - -/** * Search through this actor's hierarchy for an actor with the given unique ID. * The actor itself is also considered in the search * diff --git a/plugins/dali-script-v8/src/actors/actor-api.h b/plugins/dali-script-v8/src/actors/actor-api.h index 38bc95a..8b27961 100644 --- a/plugins/dali-script-v8/src/actors/actor-api.h +++ b/plugins/dali-script-v8/src/actors/actor-api.h @@ -58,7 +58,6 @@ namespace ActorApi void Unparent( const v8::FunctionCallbackInfo< v8::Value >& args); void GetChildAt( const v8::FunctionCallbackInfo< v8::Value >& args); void FindChildByName( const v8::FunctionCallbackInfo< v8::Value >& args); - void FindChildByAlias( const v8::FunctionCallbackInfo< v8::Value >& args); void FindChildById( const v8::FunctionCallbackInfo< v8::Value >& args); void GetParent( const v8::FunctionCallbackInfo< v8::Value >& args ); void GetChildCount( const v8::FunctionCallbackInfo< v8::Value >& args ); diff --git a/plugins/dali-script-v8/src/actors/actor-wrapper.cpp b/plugins/dali-script-v8/src/actors/actor-wrapper.cpp index 7d10f3a..dded413 100644 --- a/plugins/dali-script-v8/src/actors/actor-wrapper.cpp +++ b/plugins/dali-script-v8/src/actors/actor-wrapper.cpp @@ -199,7 +199,6 @@ const ActorFunctions ActorFunctionTable[]= { "GetChildCount", ActorApi::GetChildCount, ACTOR_API }, { "GetChildAt" , ActorApi::GetChildAt, ACTOR_API }, { "FindChildByName", ActorApi::FindChildByName, ACTOR_API }, - { "FindChildByAlias", ActorApi::FindChildByAlias, ACTOR_API }, { "FindChildById", ActorApi::FindChildById, ACTOR_API }, { "GetParent" , ActorApi::GetParent, ACTOR_API }, { "GetActorType" , ActorApi::GetActorType, ACTOR_API }, // custom for javascript diff --git a/plugins/dali-script-v8/src/constants/constants-wrapper.cpp b/plugins/dali-script-v8/src/constants/constants-wrapper.cpp index 1124956..e7c4c16 100644 --- a/plugins/dali-script-v8/src/constants/constants-wrapper.cpp +++ b/plugins/dali-script-v8/src/constants/constants-wrapper.cpp @@ -65,16 +65,6 @@ struct IntegerPair const Vector3Pair Vector3Table[] = { - { "BACK_TOP_LEFT" , ParentOrigin::BACK_TOP_LEFT }, - { "BACK_TOP_CENTER" , ParentOrigin::BACK_TOP_CENTER }, - { "BACK_TOP_RIGHT" , ParentOrigin::BACK_TOP_RIGHT }, - { "BACK_CENTER_LEFT" , ParentOrigin::BACK_CENTER_LEFT }, - { "BACK_CENTER" , ParentOrigin::BACK_CENTER }, - { "BACK_CENTER_RIGHT" , ParentOrigin::BACK_CENTER_RIGHT }, - { "BACK_BOTTOM_LEFT" , ParentOrigin::BACK_BOTTOM_LEFT }, - { "BACK_BOTTOM_CENTER" , ParentOrigin::BACK_BOTTOM_CENTER }, - { "BACK_BOTTOM_RIGHT" , ParentOrigin::BACK_BOTTOM_RIGHT }, - { "TOP_LEFT" , ParentOrigin::TOP_LEFT }, { "TOP_CENTER" , ParentOrigin::TOP_CENTER }, { "TOP_RIGHT" , ParentOrigin::TOP_RIGHT }, @@ -85,17 +75,6 @@ const Vector3Pair Vector3Table[] = { "BOTTOM_CENTER" , ParentOrigin::BOTTOM_CENTER }, { "BOTTOM_RIGHT" , ParentOrigin::BOTTOM_RIGHT }, - { "FRONT_TOP_LEFT" , ParentOrigin::FRONT_TOP_LEFT }, - { "FRONT_TOP_CENTER" , ParentOrigin::FRONT_TOP_CENTER }, - { "FRONT_TOP_RIGHT" , ParentOrigin::FRONT_TOP_RIGHT }, - { "FRONT_CENTER_LEFT" , ParentOrigin::FRONT_CENTER_LEFT }, - { "FRONT_CENTER" , ParentOrigin::FRONT_CENTER }, - { "FRONT_CENTER_RIGHT" , ParentOrigin::FRONT_CENTER_RIGHT }, - { "FRONT_BOTTOM_LEFT" , ParentOrigin::FRONT_BOTTOM_LEFT }, - { "FRONT_BOTTOM_CENTER" , ParentOrigin::FRONT_BOTTOM_CENTER}, - { "FRONT_BOTTOM_RIGHT" , ParentOrigin::FRONT_BOTTOM_RIGHT }, - - { "VECTOR3_ONE" , Vector3::ONE }, { "VECTOR3_XAXIS" , Vector3::XAXIS }, { "VECTOR3_YAXIS" , Vector3::YAXIS },