From: Adeel Kazmi Date: Fri, 28 Feb 2014 18:26:27 +0000 (+0000) Subject: Controls no longer have property names. X-Git-Tag: dali-2014-wk16-release~36 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=bf2155ead4441b35df9e85eb10743c5bedba777e Controls no longer have property names. [Issue#] N/A [Problem] May change these so should be removed from CAPI for now. [Cause] N/A [Solution] N/A Change-Id: I9a54fc5e509595a3b18258d0da0bf4117eb93b68 --- diff --git a/automated-tests/dali-test-suite/buttons/utc-Dali-Button.cpp b/automated-tests/dali-test-suite/buttons/utc-Dali-Button.cpp index 41fe94a..53a0e53 100644 --- a/automated-tests/dali-test-suite/buttons/utc-Dali-Button.cpp +++ b/automated-tests/dali-test-suite/buttons/utc-Dali-Button.cpp @@ -171,14 +171,14 @@ static void UtcDaliButtonSetProperty() PushButton pushButton = PushButton::New(); //Test various properties - checkBoxButton.SetProperty(checkBoxButton.GetPropertyIndex(Button::PROPERTY_DIMMED), false); + checkBoxButton.SetProperty(checkBoxButton.GetPropertyIndex("dimmed"), false); DALI_TEST_CHECK( false == checkBoxButton.IsDimmed() ); - checkBoxButton.SetProperty(checkBoxButton.GetPropertyIndex(Button::PROPERTY_DIMMED), true); + checkBoxButton.SetProperty(checkBoxButton.GetPropertyIndex("dimmed"), true); DALI_TEST_CHECK( true == checkBoxButton.IsDimmed() ); - pushButton.SetProperty(pushButton.GetPropertyIndex(Button::PROPERTY_DIMMED), false); + pushButton.SetProperty(pushButton.GetPropertyIndex("dimmed"), false); DALI_TEST_CHECK( false == pushButton.IsDimmed() ); - pushButton.SetProperty(pushButton.GetPropertyIndex(Button::PROPERTY_DIMMED), true); + pushButton.SetProperty(pushButton.GetPropertyIndex("dimmed"), true); DALI_TEST_CHECK( true == pushButton.IsDimmed() ); } diff --git a/automated-tests/dali-test-suite/focus-manager/utc-Dali-FocusManager.cpp b/automated-tests/dali-test-suite/focus-manager/utc-Dali-FocusManager.cpp index c614f53..5bd16e7 100644 --- a/automated-tests/dali-test-suite/focus-manager/utc-Dali-FocusManager.cpp +++ b/automated-tests/dali-test-suite/focus-manager/utc-Dali-FocusManager.cpp @@ -394,7 +394,7 @@ static void UtcDaliFocusManagerSetAndGetCurrentFocusActor() application.Render(); // Make the third actor not focusable - Property::Index propertyActorFocusable = third.GetPropertyIndex(Toolkit::FocusManager::ACTOR_FOCUSABLE); + Property::Index propertyActorFocusable = third.GetPropertyIndex("is-focus-group"); third.SetProperty(propertyActorFocusable, false); // flush the queue and render once application.SendNotification(); @@ -622,7 +622,7 @@ static void UtcDaliFocusManagerMoveFocusForward() DALI_TEST_CHECK(manager.GetAccessibilityAttribute(manager.GetCurrentFocusActor(), FocusManager::ACCESSIBILITY_LABEL) == "first"); // Make the second actor not focusable - Property::Index propertyActorFocusable = second.GetPropertyIndex(Toolkit::FocusManager::ACTOR_FOCUSABLE); + Property::Index propertyActorFocusable = second.GetPropertyIndex("focusable"); second.SetProperty(propertyActorFocusable, false); // flush the queue and render once application.SendNotification(); @@ -734,7 +734,7 @@ static void UtcDaliFocusManagerMoveFocusBackward() DALI_TEST_CHECK(manager.GetAccessibilityAttribute(manager.GetCurrentFocusActor(), FocusManager::ACCESSIBILITY_LABEL) == "third"); // Make the second actor not focusable - Property::Index propertyActorFocusable = second.GetPropertyIndex(Toolkit::FocusManager::ACTOR_FOCUSABLE); + Property::Index propertyActorFocusable = second.GetPropertyIndex("focusable"); second.SetProperty(propertyActorFocusable, false); // flush the queue and render once application.SendNotification(); diff --git a/automated-tests/dali-test-suite/popup/utc-Dali-Popup.cpp b/automated-tests/dali-test-suite/popup/utc-Dali-Popup.cpp index e5fa8af..acaefa6 100644 --- a/automated-tests/dali-test-suite/popup/utc-Dali-Popup.cpp +++ b/automated-tests/dali-test-suite/popup/utc-Dali-Popup.cpp @@ -185,7 +185,7 @@ static void UtcDaliPopoupSetProperty() //Test properties std::string testString = "Hello World"; - popup.SetProperty(popup.GetPropertyIndex(Popup::PROPERTY_TITLE), testString); + popup.SetProperty(popup.GetPropertyIndex("title"), testString); DALI_TEST_EQUALS( testString, popup.GetTitle().GetText(), TEST_LOCATION ); } diff --git a/automated-tests/dali-test-suite/text-view/utc-Dali-TextView.cpp b/automated-tests/dali-test-suite/text-view/utc-Dali-TextView.cpp index f0fd63d..49b6e85 100644 --- a/automated-tests/dali-test-suite/text-view/utc-Dali-TextView.cpp +++ b/automated-tests/dali-test-suite/text-view/utc-Dali-TextView.cpp @@ -32,6 +32,19 @@ using namespace Toolkit; namespace { +const char* const PROPERTY_TEXT = "text"; +const char* const PROPERTY_MULTILINE_POLICY = "multiline-policy"; +const char* const PROPERTY_WIDTH_EXCEED_POLICY = "width-exceed-policy"; +const char* const PROPERTY_HEIGHT_EXCEED_POLICY = "height-exceed-policy"; +const char* const PROPERTY_LINE_JUSTIFICATION = "line-justification"; +const char* const PROPERTY_FADE_BOUNDARY_LEFT = "fade-boundary-left"; +const char* const PROPERTY_FADE_BOUNDARY_RIGHT = "fade-boundary-right"; +const char* const PROPERTY_FADE_BOUNDARY_TOP = "fade-boundary-top"; +const char* const PROPERTY_FADE_BOUNDARY_BOTTOM = "fade-boundary-bottom"; +const char* const PROPERTY_LINE_HEIGHT_OFFSET = "line-height-offset"; +const char* const PROPERTY_HORIZONTAL_ALIGNMENT = "horizontal-alignment"; +const char* const PROPERTY_VERTICAL_ALIGNMENT = "vertical-alignment"; + bool TestEqual( float x, float y ) { return !( fabsf( x - y ) > Math::MACHINE_EPSILON_1000 ); @@ -716,73 +729,73 @@ static void UtcDaliTextViewSetProperty() Stage::GetCurrent().Add( view ); //Test multiline policy property - view.SetProperty(view.GetPropertyIndex(TextView::PROPERTY_MULTILINE_POLICY), "SplitByNewLineChar"); + view.SetProperty(view.GetPropertyIndex(PROPERTY_MULTILINE_POLICY), "SplitByNewLineChar"); DALI_TEST_CHECK( Toolkit::TextView::SplitByNewLineChar == view.GetMultilinePolicy() ); - view.SetProperty(view.GetPropertyIndex(TextView::PROPERTY_MULTILINE_POLICY), "SplitByWord"); + view.SetProperty(view.GetPropertyIndex(PROPERTY_MULTILINE_POLICY), "SplitByWord"); DALI_TEST_CHECK( Toolkit::TextView::SplitByWord == view.GetMultilinePolicy() ); - view.SetProperty(view.GetPropertyIndex(TextView::PROPERTY_MULTILINE_POLICY), "SplitByChar"); + view.SetProperty(view.GetPropertyIndex(PROPERTY_MULTILINE_POLICY), "SplitByChar"); DALI_TEST_CHECK( Toolkit::TextView::SplitByChar == view.GetMultilinePolicy() ); //Test width exceed policy property - view.SetProperty(view.GetPropertyIndex(TextView::PROPERTY_WIDTH_EXCEED_POLICY), "Original"); - view.SetProperty(view.GetPropertyIndex(TextView::PROPERTY_HEIGHT_EXCEED_POLICY), "Original"); + view.SetProperty(view.GetPropertyIndex(PROPERTY_WIDTH_EXCEED_POLICY), "Original"); + view.SetProperty(view.GetPropertyIndex(PROPERTY_HEIGHT_EXCEED_POLICY), "Original"); DALI_TEST_CHECK( Toolkit::TextView::Original == view.GetWidthExceedPolicy() ); DALI_TEST_CHECK( Toolkit::TextView::Original == view.GetHeightExceedPolicy() ); - view.SetProperty(view.GetPropertyIndex(TextView::PROPERTY_WIDTH_EXCEED_POLICY), "Fade"); - view.SetProperty(view.GetPropertyIndex(TextView::PROPERTY_HEIGHT_EXCEED_POLICY), "Fade"); + view.SetProperty(view.GetPropertyIndex(PROPERTY_WIDTH_EXCEED_POLICY), "Fade"); + view.SetProperty(view.GetPropertyIndex(PROPERTY_HEIGHT_EXCEED_POLICY), "Fade"); DALI_TEST_CHECK( Toolkit::TextView::Fade == view.GetWidthExceedPolicy() ); DALI_TEST_CHECK( Toolkit::TextView::Fade == view.GetHeightExceedPolicy() ); - view.SetProperty(view.GetPropertyIndex(TextView::PROPERTY_WIDTH_EXCEED_POLICY), "ShrinkToFit"); - view.SetProperty(view.GetPropertyIndex(TextView::PROPERTY_HEIGHT_EXCEED_POLICY), "ShrinkToFit"); + view.SetProperty(view.GetPropertyIndex(PROPERTY_WIDTH_EXCEED_POLICY), "ShrinkToFit"); + view.SetProperty(view.GetPropertyIndex(PROPERTY_HEIGHT_EXCEED_POLICY), "ShrinkToFit"); DALI_TEST_CHECK( Toolkit::TextView::ShrinkToFit == view.GetWidthExceedPolicy() ); DALI_TEST_CHECK( Toolkit::TextView::ShrinkToFit == view.GetHeightExceedPolicy() ); //Test line justification property - view.SetProperty(view.GetPropertyIndex(TextView::PROPERTY_LINE_JUSTIFICATION), "Left"); + view.SetProperty(view.GetPropertyIndex(PROPERTY_LINE_JUSTIFICATION), "Left"); DALI_TEST_CHECK( Toolkit::TextView::Left == view.GetLineJustification() ); - view.SetProperty(view.GetPropertyIndex(TextView::PROPERTY_LINE_JUSTIFICATION), "Center"); + view.SetProperty(view.GetPropertyIndex(PROPERTY_LINE_JUSTIFICATION), "Center"); DALI_TEST_CHECK( Toolkit::TextView::Center == view.GetLineJustification() ); - view.SetProperty(view.GetPropertyIndex(TextView::PROPERTY_LINE_JUSTIFICATION), "Right"); + view.SetProperty(view.GetPropertyIndex(PROPERTY_LINE_JUSTIFICATION), "Right"); DALI_TEST_CHECK( Toolkit::TextView::Right == view.GetLineJustification() ); - view.SetProperty(view.GetPropertyIndex(TextView::PROPERTY_LINE_JUSTIFICATION), "Justified"); + view.SetProperty(view.GetPropertyIndex(PROPERTY_LINE_JUSTIFICATION), "Justified"); DALI_TEST_CHECK( Toolkit::TextView::Justified == view.GetLineJustification() ); //Test fade boundary property unsigned int testValue = 23; PixelSize leftFadeBoundary(testValue); - view.SetProperty(view.GetPropertyIndex(TextView::PROPERTY_FADE_BOUNDARY_LEFT), testValue); + view.SetProperty(view.GetPropertyIndex(PROPERTY_FADE_BOUNDARY_LEFT), testValue); DALI_TEST_CHECK( leftFadeBoundary == view.GetFadeBoundary().mLeft ); testValue = 26; PixelSize rightFadeBoundary(testValue); - view.SetProperty(view.GetPropertyIndex(TextView::PROPERTY_FADE_BOUNDARY_RIGHT), testValue); + view.SetProperty(view.GetPropertyIndex(PROPERTY_FADE_BOUNDARY_RIGHT), testValue); DALI_TEST_CHECK( rightFadeBoundary == view.GetFadeBoundary().mRight ); testValue = 2; PixelSize topFadeBoundary(testValue); - view.SetProperty(view.GetPropertyIndex(TextView::PROPERTY_FADE_BOUNDARY_TOP), testValue); + view.SetProperty(view.GetPropertyIndex(PROPERTY_FADE_BOUNDARY_TOP), testValue); DALI_TEST_CHECK( topFadeBoundary == view.GetFadeBoundary().mTop ); testValue = 11; PixelSize bottomFadeBoundary(testValue); - view.SetProperty(view.GetPropertyIndex(TextView::PROPERTY_FADE_BOUNDARY_BOTTOM), testValue); + view.SetProperty(view.GetPropertyIndex(PROPERTY_FADE_BOUNDARY_BOTTOM), testValue); DALI_TEST_CHECK( bottomFadeBoundary == view.GetFadeBoundary().mBottom ); //Test Line height offset property float testOffsetValue = 14.04f; - view.SetProperty(view.GetPropertyIndex(TextView::PROPERTY_LINE_HEIGHT_OFFSET), testOffsetValue); + view.SetProperty(view.GetPropertyIndex(PROPERTY_LINE_HEIGHT_OFFSET), testOffsetValue); DALI_TEST_CHECK( PointSize(testOffsetValue) == view.GetLineHeightOffset() ); //Test alignment property - view.SetProperty(view.GetPropertyIndex(TextView::PROPERTY_HORIZONTAL_ALIGNMENT), "HorizontalLeft"); - view.SetProperty(view.GetPropertyIndex(TextView::PROPERTY_VERTICAL_ALIGNMENT), "VerticalTop"); + view.SetProperty(view.GetPropertyIndex(PROPERTY_HORIZONTAL_ALIGNMENT), "HorizontalLeft"); + view.SetProperty(view.GetPropertyIndex(PROPERTY_VERTICAL_ALIGNMENT), "VerticalTop"); DALI_TEST_CHECK( (Toolkit::Alignment::HorizontalLeft | Toolkit::Alignment::VerticalTop) == view.GetTextAlignment() ); } diff --git a/capi/dali-toolkit/public-api/controls/buttons/button.h b/capi/dali-toolkit/public-api/controls/buttons/button.h index 6cdb696..f52106e 100644 --- a/capi/dali-toolkit/public-api/controls/buttons/button.h +++ b/capi/dali-toolkit/public-api/controls/buttons/button.h @@ -53,14 +53,9 @@ class Button; class Button : public Control { public: - //Signal Names - static const char* const SIGNAL_CLICKED; - /** - * The names of custom properties installed by this control. - */ - // Property Names - static const char* const PROPERTY_DIMMED; ///< name "dimmed", type bool. + // Signal Names + static const char* const SIGNAL_CLICKED; public: diff --git a/capi/dali-toolkit/public-api/controls/popup/popup.h b/capi/dali-toolkit/public-api/controls/popup/popup.h index 968acb9..3b847c3 100644 --- a/capi/dali-toolkit/public-api/controls/popup/popup.h +++ b/capi/dali-toolkit/public-api/controls/popup/popup.h @@ -80,13 +80,6 @@ public: static const char* const SIGNAL_HIDDEN; /** - * The names of custom properties installed by this control. - */ - // Property Names - static const char* const PROPERTY_TITLE; ///< name "title", type string. - static const char* const PROPERTY_STATE; ///< name "state", type string. - - /** * Current popup state */ enum PopupState diff --git a/capi/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-custom-effect.h b/capi/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-custom-effect.h index 9201fa7..8c4be1b 100644 --- a/capi/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-custom-effect.h +++ b/capi/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-custom-effect.h @@ -60,9 +60,6 @@ class ScrollViewCustomEffect; */ class ScrollViewCustomEffect : public ScrollViewEffect { - static const std::string ANCHOR_POINT_PROPERTY_NAME; - static const std::string SCROLL_AMOUNT_PROPERTY_NAME; ///< Property, name "scroll-amount", type VECTOR3 - public: enum EFlag { diff --git a/capi/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-twist-effect.h b/capi/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-twist-effect.h index 0767a16..26f7070 100644 --- a/capi/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-twist-effect.h +++ b/capi/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-twist-effect.h @@ -48,10 +48,6 @@ class ScrollViewTwistEffect : public ScrollViewEffect public: - static const std::string EFFECT_TIME; - static const std::string EFFECT_REFERENCE; - static const std::string EFFECT_DEPTH; - static const std::string EFFECT_ACTIVATE; static const float DEFAULT_MINIMUM_DISTANCE_FOR_SHRINK; public: diff --git a/capi/dali-toolkit/public-api/controls/text-view/text-view.h b/capi/dali-toolkit/public-api/controls/text-view/text-view.h index 8d9a156..1e866dd 100644 --- a/capi/dali-toolkit/public-api/controls/text-view/text-view.h +++ b/capi/dali-toolkit/public-api/controls/text-view/text-view.h @@ -99,25 +99,9 @@ class TextView; class TextView : public Control { public: - //Signal Names - static const char* const SIGNAL_TEXT_SCROLLED; ///< Signal emitted when the scroll position changes. @see SignalScrolled() - /** - * The names of custom properties installed by this control. - */ - // Property Names - static const char* const PROPERTY_TEXT; ///< name "text", type std::string - static const char* const PROPERTY_MULTILINE_POLICY; ///< name "multiline-policy", type std::string - static const char* const PROPERTY_WIDTH_EXCEED_POLICY; ///< name "width-exceed-policy", type std::string - static const char* const PROPERTY_HEIGHT_EXCEED_POLICY; ///< name "height-exceed-policy", type std::string - static const char* const PROPERTY_LINE_JUSTIFICATION; ///< name "line-justification", type std::string - static const char* const PROPERTY_FADE_BOUNDARY_LEFT; ///< name "fade-boundary-left", type int - static const char* const PROPERTY_FADE_BOUNDARY_RIGHT; ///< name "fade-boundary-right", type int - static const char* const PROPERTY_FADE_BOUNDARY_TOP; ///< name "fade-boundary-top", type int - static const char* const PROPERTY_FADE_BOUNDARY_BOTTOM; ///< name "fade-boundary-bottom", type int - static const char* const PROPERTY_LINE_HEIGHT_OFFSET; ///< name "line-height-offset", type float - static const char* const PROPERTY_HORIZONTAL_ALIGNMENT; ///< name "horizontal-alignment", type std::string - static const char* const PROPERTY_VERTICAL_ALIGNMENT; ///< name "vertical-alignment", type std::string + // Signal Names + static const char* const SIGNAL_TEXT_SCROLLED; ///< Signal emitted when the scroll position changes. @see SignalScrolled() /** * Structure used to retrieve Layout info per character. diff --git a/capi/dali-toolkit/public-api/focus-manager/focus-manager.h b/capi/dali-toolkit/public-api/focus-manager/focus-manager.h index d43dde7..970eb9a 100644 --- a/capi/dali-toolkit/public-api/focus-manager/focus-manager.h +++ b/capi/dali-toolkit/public-api/focus-manager/focus-manager.h @@ -47,15 +47,11 @@ class FocusManager; class FocusManager : public BaseHandle { public: - //Signal Names + // Signal Names static const char* const SIGNAL_FOCUS_CHANGED; static const char* const SIGNAL_FOCUS_OVERSHOT; static const char* const SIGNAL_FOCUSED_ACTOR_ACTIVATED; - // Property Names - static const std::string ACTOR_FOCUSABLE; ///< name "focusable", type bool - static const std::string IS_FOCUS_GROUP; ///< name "is-focus-group", type bool - /** * Accessibility needs four information which will be read by screen-reader. * Reading order : Label -> Trait -> Optional (Value and Hint) diff --git a/dali-toolkit/internal/controls/buttons/button-impl.cpp b/dali-toolkit/internal/controls/buttons/button-impl.cpp index 86a3f4f..bd74b57 100644 --- a/dali-toolkit/internal/controls/buttons/button-impl.cpp +++ b/dali-toolkit/internal/controls/buttons/button-impl.cpp @@ -18,6 +18,11 @@ #include "button-impl.h" +namespace +{ +const char* const PROPERTY_DIMMED = "dimmed"; +} // unnamed namespace + namespace Dali { @@ -198,7 +203,7 @@ void Button::OnInitialize() OnButtonInitialize(); Actor self = Self(); - mPropertyDimmed = self.RegisterProperty( Dali::Toolkit::Button::PROPERTY_DIMMED, false, Property::READ_WRITE ); + mPropertyDimmed = self.RegisterProperty( PROPERTY_DIMMED, false, Property::READ_WRITE ); self.SetKeyboardFocusable( true ); } diff --git a/dali-toolkit/internal/controls/popup/popup-impl.cpp b/dali-toolkit/internal/controls/popup/popup-impl.cpp index db01ab0..8f1c9ef 100755 --- a/dali-toolkit/internal/controls/popup/popup-impl.cpp +++ b/dali-toolkit/internal/controls/popup/popup-impl.cpp @@ -43,6 +43,9 @@ 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); +const char* const PROPERTY_TITLE = "title"; +const char* const PROPERTY_STATE = "state"; + // Constraints /////////////////////////////////////////////////////////////////////////// /** @@ -210,8 +213,8 @@ void Popup::OnInitialize() // Hide content by default. SetState( Toolkit::Popup::POPUP_HIDE, 0.0f ); - mPropertyTitle = self.RegisterProperty( Dali::Toolkit::Popup::PROPERTY_TITLE, "", Property::READ_WRITE ); - mPropertyState = self.RegisterProperty( Dali::Toolkit::Popup::PROPERTY_STATE, "POPUP_HIDE", Property::READ_WRITE ); + mPropertyTitle = self.RegisterProperty( PROPERTY_TITLE, "", Property::READ_WRITE ); + mPropertyState = self.RegisterProperty( PROPERTY_STATE, "POPUP_HIDE", Property::READ_WRITE ); // Make self as keyboard focusable and focus group self.SetKeyboardFocusable(true); diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-twist-effect-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-twist-effect-impl.cpp index 8d78c44..681afe6 100755 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-twist-effect-impl.cpp +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-twist-effect-impl.cpp @@ -23,6 +23,11 @@ using namespace Dali; namespace // unnamed namespace { +const char * const EFFECT_TIME( "ScrollViewTwistEffect::EFFECT_TIME" ); +const char * const EFFECT_REFERENCE( "ScrollViewTwistEffect::EFFECT_REFERENCE" ); +const char * const EFFECT_DEPTH( "ScrollViewTwistEffect::EFFECT_DEPTH"); +const char * const EFFECT_ACTIVATE( "ScrollViewTwistEffect::EFFECT_ACTIVATE"); + const float TWISTEFFECT_ANIMATION_MAX_TIME = 60.0f; ///< Animation time (every time finishes, checks if it needs to go again) const float TWISTEFFECT_DEFAULT_DROPOFF = 0.7f; ///< Default drop off amount const float TWISTEFFECT_DEFAULT_DROPOFF_DISTANCE_X = 720.0f; ///< Default drop off distance @@ -509,7 +514,7 @@ void ScrollViewTwistEffect::Apply(Actor child) if( mFlags & FlagScale ) { constraint = Constraint::New( Actor::SCALE, - Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollViewTwistEffect::EFFECT_DEPTH ) ), + Source(scrollView, scrollView.GetPropertyIndex( EFFECT_DEPTH ) ), ScrollTwistScaleConstraint(mScaleFactor) ); constraint.SetRemoveAction( Constraint::Discard ); child.ApplyConstraint( constraint ); @@ -518,10 +523,10 @@ void ScrollViewTwistEffect::Apply(Actor child) constraint = Constraint::New( Actor::POSITION, ParentSource(Actor::POSITION), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ), - Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollViewTwistEffect::EFFECT_REFERENCE ) ), - Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollViewTwistEffect::EFFECT_TIME ) ), + Source(scrollView, scrollView.GetPropertyIndex( EFFECT_REFERENCE ) ), + Source(scrollView, scrollView.GetPropertyIndex( EFFECT_TIME ) ), Source(scrollView, Actor::SIZE), - Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollViewTwistEffect::EFFECT_ACTIVATE) ), + Source(scrollView, scrollView.GetPropertyIndex( EFFECT_ACTIVATE) ), ScrollTwistPositionConstraint(mDelayMin, mDelayMax) ); constraint.SetRemoveAction( Constraint::Discard ); child.ApplyConstraint( constraint ); @@ -537,7 +542,7 @@ void ScrollViewTwistEffect::Apply(Actor child) Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_OVERSHOOT_X_PROPERTY_NAME ) ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_OVERSHOOT_Y_PROPERTY_NAME ) ), Source(scrollView, Actor::SIZE ), - Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollViewTwistEffect::EFFECT_ACTIVATE) ), + Source(scrollView, scrollView.GetPropertyIndex( EFFECT_ACTIVATE) ), ScrollDropoffTwistRotationConstraint(mMaxSwingAngle, mDropOff, mDropOffDistance, mDropOffFunction) ); } else @@ -545,7 +550,7 @@ void ScrollViewTwistEffect::Apply(Actor child) constraint = Constraint::New( Actor::ROTATION, Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_OVERSHOOT_X_PROPERTY_NAME ) ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_OVERSHOOT_Y_PROPERTY_NAME ) ), - Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollViewTwistEffect::EFFECT_ACTIVATE) ), + Source(scrollView, scrollView.GetPropertyIndex( EFFECT_ACTIVATE) ), ScrollTwistRotationConstraint(mMaxSwingAngle) ); } constraint.SetRemoveAction( Constraint::Discard ); @@ -575,10 +580,10 @@ void ScrollViewTwistEffect::OnAttach(Toolkit::ScrollView& scrollView) // Create effect-time property if not already created. if(mPropertyTime == Property::INVALID_INDEX) { - mPropertyTime = SafeRegisterProperty( scrollView, Toolkit::ScrollViewTwistEffect::EFFECT_TIME, 0.0f ); - mPropertyReference = SafeRegisterProperty( scrollView, Toolkit::ScrollViewTwistEffect::EFFECT_REFERENCE, Vector3::ZERO ); - mPropertyDepth = SafeRegisterProperty( scrollView, Toolkit::ScrollViewTwistEffect::EFFECT_DEPTH, 0.0f); - mPropertyActivate = SafeRegisterProperty(scrollView,Toolkit::ScrollViewTwistEffect::EFFECT_ACTIVATE,1.0f); + mPropertyTime = SafeRegisterProperty( scrollView, EFFECT_TIME, 0.0f ); + mPropertyReference = SafeRegisterProperty( scrollView, EFFECT_REFERENCE, Vector3::ZERO ); + mPropertyDepth = SafeRegisterProperty( scrollView, EFFECT_DEPTH, 0.0f); + mPropertyActivate = SafeRegisterProperty(scrollView, EFFECT_ACTIVATE, 1.0f); } // Connect to the scroll view signals 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 add65d2..aa30efd 100644 --- a/dali-toolkit/internal/controls/text-view/text-view-impl.cpp +++ b/dali-toolkit/internal/controls/text-view/text-view-impl.cpp @@ -38,6 +38,19 @@ namespace Internal namespace { +const char* const PROPERTY_TEXT = "text"; +const char* const PROPERTY_MULTILINE_POLICY = "multiline-policy"; +const char* const PROPERTY_WIDTH_EXCEED_POLICY = "width-exceed-policy"; +const char* const PROPERTY_HEIGHT_EXCEED_POLICY = "height-exceed-policy"; +const char* const PROPERTY_LINE_JUSTIFICATION = "line-justification"; +const char* const PROPERTY_FADE_BOUNDARY_LEFT = "fade-boundary-left"; +const char* const PROPERTY_FADE_BOUNDARY_RIGHT = "fade-boundary-right"; +const char* const PROPERTY_FADE_BOUNDARY_TOP = "fade-boundary-top"; +const char* const PROPERTY_FADE_BOUNDARY_BOTTOM = "fade-boundary-bottom"; +const char* const PROPERTY_LINE_HEIGHT_OFFSET = "line-height-offset"; +const char* const PROPERTY_HORIZONTAL_ALIGNMENT = "horizontal-alignment"; +const char* const PROPERTY_VERTICAL_ALIGNMENT = "vertical-alignment"; + // 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; @@ -1144,29 +1157,29 @@ void TextView::OnInitialize() { Actor self = Self(); - mPropertyText = self.RegisterProperty( Dali::Toolkit::TextView::PROPERTY_TEXT, "", Property::READ_WRITE ); + mPropertyText = self.RegisterProperty( PROPERTY_TEXT, "", Property::READ_WRITE ); - mPropertyMultilinePolicy = self.RegisterProperty( Dali::Toolkit::TextView::PROPERTY_MULTILINE_POLICY, "SplitByNewLineChar", Property::READ_WRITE ); + mPropertyMultilinePolicy = self.RegisterProperty( PROPERTY_MULTILINE_POLICY, "SplitByNewLineChar", Property::READ_WRITE ); - mPropertyWidthExceedPolicy = self.RegisterProperty( Dali::Toolkit::TextView::PROPERTY_WIDTH_EXCEED_POLICY, "Original", Property::READ_WRITE ); + mPropertyWidthExceedPolicy = self.RegisterProperty( PROPERTY_WIDTH_EXCEED_POLICY, "Original", Property::READ_WRITE ); - mPropertyHeightExceedPolicy = self.RegisterProperty( Dali::Toolkit::TextView::PROPERTY_HEIGHT_EXCEED_POLICY, "Original", Property::READ_WRITE ); + mPropertyHeightExceedPolicy = self.RegisterProperty( PROPERTY_HEIGHT_EXCEED_POLICY, "Original", Property::READ_WRITE ); - mPropertyLineJustification = self.RegisterProperty( Dali::Toolkit::TextView::PROPERTY_LINE_JUSTIFICATION, "Left", Property::READ_WRITE ); + mPropertyLineJustification = self.RegisterProperty( PROPERTY_LINE_JUSTIFICATION, "Left", Property::READ_WRITE ); - mPropertyFadeBoundaryLeft = self.RegisterProperty( Dali::Toolkit::TextView::PROPERTY_FADE_BOUNDARY_LEFT, static_cast< int >( 0 ), Property::READ_WRITE ); + mPropertyFadeBoundaryLeft = self.RegisterProperty( PROPERTY_FADE_BOUNDARY_LEFT, static_cast< int >( 0 ), Property::READ_WRITE ); - mPropertyFadeBoundaryRight = self.RegisterProperty( Dali::Toolkit::TextView::PROPERTY_FADE_BOUNDARY_RIGHT, static_cast< int >( 0 ), Property::READ_WRITE ); + mPropertyFadeBoundaryRight = self.RegisterProperty( PROPERTY_FADE_BOUNDARY_RIGHT, static_cast< int >( 0 ), Property::READ_WRITE ); - mPropertyFadeBoundaryTop = self.RegisterProperty( Dali::Toolkit::TextView::PROPERTY_FADE_BOUNDARY_TOP, static_cast< int >( 0 ), Property::READ_WRITE ); + mPropertyFadeBoundaryTop = self.RegisterProperty( PROPERTY_FADE_BOUNDARY_TOP, static_cast< int >( 0 ), Property::READ_WRITE ); - mPropertyFadeBoundaryBottom = self.RegisterProperty( Dali::Toolkit::TextView::PROPERTY_FADE_BOUNDARY_BOTTOM, static_cast< int >( 0 ), Property::READ_WRITE ); + mPropertyFadeBoundaryBottom = self.RegisterProperty( PROPERTY_FADE_BOUNDARY_BOTTOM, static_cast< int >( 0 ), Property::READ_WRITE ); - mPropertyLineHeightOffset = self.RegisterProperty( Dali::Toolkit::TextView::PROPERTY_LINE_HEIGHT_OFFSET, 0.0f, Property::READ_WRITE ); + mPropertyLineHeightOffset = self.RegisterProperty( PROPERTY_LINE_HEIGHT_OFFSET, 0.0f, Property::READ_WRITE ); - mPropertyHorizontalAlignment = self.RegisterProperty( Dali::Toolkit::TextView::PROPERTY_HORIZONTAL_ALIGNMENT, "HorizontalCenter", Property::READ_WRITE ); + mPropertyHorizontalAlignment = self.RegisterProperty( PROPERTY_HORIZONTAL_ALIGNMENT, "HorizontalCenter", Property::READ_WRITE ); - mPropertyVerticalAlignment = self.RegisterProperty( Dali::Toolkit::TextView::PROPERTY_VERTICAL_ALIGNMENT, "VerticalCenter", Property::READ_WRITE ); + mPropertyVerticalAlignment = self.RegisterProperty( PROPERTY_VERTICAL_ALIGNMENT, "VerticalCenter", Property::READ_WRITE ); } diff --git a/dali-toolkit/internal/focus-manager/focus-manager-impl.cpp b/dali-toolkit/internal/focus-manager/focus-manager-impl.cpp index ad3a8e8..80e5c2d 100644 --- a/dali-toolkit/internal/focus-manager/focus-manager-impl.cpp +++ b/dali-toolkit/internal/focus-manager/focus-manager-impl.cpp @@ -38,6 +38,9 @@ namespace // unnamed namespace Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_FOCUS_MANAGER"); #endif +const char * const ACTOR_FOCUSABLE("focusable"); +const char * const IS_FOCUS_GROUP("is-focus-group"); + const char* FOCUS_BORDER_IMAGE_PATH = DALI_IMAGE_DIR "B16-8_TTS_focus.png"; const Vector4 FOCUS_BORDER_IMAGE_BORDER = Vector4(7.0f, 7.0f, 7.0f, 7.0f); @@ -57,7 +60,7 @@ bool IsActorFocusableFunction(Actor actor, Dali::HitTestAlgorithm::TraverseType && actor.GetCurrentWorldColor().a > 0.01f) // not FULLY_TRANSPARENT { // Check whether the actor is focusable - Property::Index propertyActorFocusable = actor.GetPropertyIndex(Toolkit::FocusManager::ACTOR_FOCUSABLE); + Property::Index propertyActorFocusable = actor.GetPropertyIndex(ACTOR_FOCUSABLE); if(propertyActorFocusable != Property::INVALID_INDEX) { hittable = actor.GetProperty(propertyActorFocusable); @@ -162,10 +165,10 @@ void FocusManager::SetFocusOrder(Actor actor, const unsigned int order) mFocusIDContainer.erase(GetFocusOrder(actor)); // Create actor focusable property if not already created. - Property::Index propertyActorFocusable = actor.GetPropertyIndex(Toolkit::FocusManager::ACTOR_FOCUSABLE); + Property::Index propertyActorFocusable = actor.GetPropertyIndex(ACTOR_FOCUSABLE); if(propertyActorFocusable == Property::INVALID_INDEX) { - propertyActorFocusable = actor.RegisterProperty(Toolkit::FocusManager::ACTOR_FOCUSABLE, true); + propertyActorFocusable = actor.RegisterProperty(ACTOR_FOCUSABLE, true); } if(order == 0) @@ -293,7 +296,7 @@ bool FocusManager::DoSetCurrentFocusActor(const unsigned int actorID) { // Check whether the actor is focusable bool actorFocusable = false; - Property::Index propertyActorFocusable = actor.GetPropertyIndex(Toolkit::FocusManager::ACTOR_FOCUSABLE); + Property::Index propertyActorFocusable = actor.GetPropertyIndex(ACTOR_FOCUSABLE); if(propertyActorFocusable != Property::INVALID_INDEX) { actorFocusable = actor.GetProperty(propertyActorFocusable); @@ -477,10 +480,10 @@ void FocusManager::SetFocusGroup(Actor actor, bool isFocusGroup) if(actor) { // Create focus group property if not already created. - Property::Index propertyIsFocusGroup = actor.GetPropertyIndex(Toolkit::FocusManager::IS_FOCUS_GROUP); + Property::Index propertyIsFocusGroup = actor.GetPropertyIndex(IS_FOCUS_GROUP); if(propertyIsFocusGroup == Property::INVALID_INDEX) { - propertyIsFocusGroup = actor.RegisterProperty(Toolkit::FocusManager::IS_FOCUS_GROUP, isFocusGroup); + propertyIsFocusGroup = actor.RegisterProperty(IS_FOCUS_GROUP, isFocusGroup); } else { @@ -496,7 +499,7 @@ bool FocusManager::IsFocusGroup(Actor actor) const if(actor) { - Property::Index propertyIsFocusGroup = actor.GetPropertyIndex(Toolkit::FocusManager::IS_FOCUS_GROUP); + Property::Index propertyIsFocusGroup = actor.GetPropertyIndex(IS_FOCUS_GROUP); if(propertyIsFocusGroup != Property::INVALID_INDEX) { isFocusGroup = actor.GetProperty(propertyIsFocusGroup); @@ -603,10 +606,10 @@ void FocusManager::SetFocusable(Actor actor, bool focusable) if(actor) { // Create actor focusable property if not already created. - Property::Index propertyActorFocusable = actor.GetPropertyIndex(Toolkit::FocusManager::ACTOR_FOCUSABLE); + Property::Index propertyActorFocusable = actor.GetPropertyIndex(ACTOR_FOCUSABLE); if(propertyActorFocusable == Property::INVALID_INDEX) { - propertyActorFocusable = actor.RegisterProperty(Toolkit::FocusManager::ACTOR_FOCUSABLE, focusable); + propertyActorFocusable = actor.RegisterProperty(ACTOR_FOCUSABLE, focusable); } else { diff --git a/dali-toolkit/public-api/controls/buttons/button.cpp b/dali-toolkit/public-api/controls/buttons/button.cpp index aa03116..1fbe69e 100644 --- a/dali-toolkit/public-api/controls/buttons/button.cpp +++ b/dali-toolkit/public-api/controls/buttons/button.cpp @@ -29,7 +29,6 @@ namespace Toolkit { const char* const Button::SIGNAL_CLICKED = "clicked"; -const char* const Button::PROPERTY_DIMMED = "dimmed"; Button::Button() {} diff --git a/dali-toolkit/public-api/controls/popup/popup.cpp b/dali-toolkit/public-api/controls/popup/popup.cpp index 735e64f..d36c1e5 100644 --- a/dali-toolkit/public-api/controls/popup/popup.cpp +++ b/dali-toolkit/public-api/controls/popup/popup.cpp @@ -32,8 +32,6 @@ namespace Toolkit const char* const Popup::SIGNAL_TOUCHED_OUTSIDE = "touched-outside"; const char* const Popup::SIGNAL_HIDDEN = "hidden"; -const char* const Popup::PROPERTY_TITLE = "title"; -const char* const Popup::PROPERTY_STATE = "state"; Popup::Popup() { diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-twist-effect.cpp b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-twist-effect.cpp index d3236ca..8d13a27 100644 --- a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-twist-effect.cpp +++ b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-twist-effect.cpp @@ -27,11 +27,6 @@ namespace Dali namespace Toolkit { -const std::string ScrollViewTwistEffect::EFFECT_TIME( "ScrollViewTwistEffect::EFFECT_TIME" ); -const std::string ScrollViewTwistEffect::EFFECT_REFERENCE( "ScrollViewTwistEffect::EFFECT_REFERENCE" ); -const std::string ScrollViewTwistEffect::EFFECT_DEPTH( "ScrollViewTwistEffect::EFFECT_DEPTH"); -const std::string ScrollViewTwistEffect::EFFECT_ACTIVATE( "ScrollViewTwistEffect::EFFECT_ACTIVATE"); - const float ScrollViewTwistEffect::DEFAULT_MINIMUM_DISTANCE_FOR_SHRINK( 0.0f ); ScrollViewTwistEffect ScrollViewTwistEffect::New() diff --git a/dali-toolkit/public-api/controls/text-view/text-view.cpp b/dali-toolkit/public-api/controls/text-view/text-view.cpp index 7ea334e..f03d94a 100644 --- a/dali-toolkit/public-api/controls/text-view/text-view.cpp +++ b/dali-toolkit/public-api/controls/text-view/text-view.cpp @@ -30,18 +30,6 @@ namespace Toolkit const char* const TextView::SIGNAL_TEXT_SCROLLED = "scrolled"; -const char* const TextView::PROPERTY_TEXT = "text"; -const char* const TextView::PROPERTY_MULTILINE_POLICY = "multiline-policy"; -const char* const TextView::PROPERTY_WIDTH_EXCEED_POLICY = "width-exceed-policy"; -const char* const TextView::PROPERTY_HEIGHT_EXCEED_POLICY = "height-exceed-policy"; -const char* const TextView::PROPERTY_LINE_JUSTIFICATION = "line-justification"; -const char* const TextView::PROPERTY_FADE_BOUNDARY_LEFT = "fade-boundary-left"; -const char* const TextView::PROPERTY_FADE_BOUNDARY_RIGHT = "fade-boundary-right"; -const char* const TextView::PROPERTY_FADE_BOUNDARY_TOP = "fade-boundary-top"; -const char* const TextView::PROPERTY_FADE_BOUNDARY_BOTTOM = "fade-boundary-bottom"; -const char* const TextView::PROPERTY_LINE_HEIGHT_OFFSET = "line-height-offset"; -const char* const TextView::PROPERTY_HORIZONTAL_ALIGNMENT = "horizontal-alignment"; -const char* const TextView::PROPERTY_VERTICAL_ALIGNMENT = "vertical-alignment"; TextView::CharacterLayoutInfo::CharacterLayoutInfo() : mSize(), diff --git a/dali-toolkit/public-api/focus-manager/focus-manager.cpp b/dali-toolkit/public-api/focus-manager/focus-manager.cpp index 8364ae2..d172135 100644 --- a/dali-toolkit/public-api/focus-manager/focus-manager.cpp +++ b/dali-toolkit/public-api/focus-manager/focus-manager.cpp @@ -33,8 +33,6 @@ namespace Toolkit const char* const FocusManager::SIGNAL_FOCUS_CHANGED = "focus-changed"; const char* const FocusManager::SIGNAL_FOCUS_OVERSHOT = "focus-overshot"; const char* const FocusManager::SIGNAL_FOCUSED_ACTOR_ACTIVATED = "focused-actor-activated"; -const std::string FocusManager::ACTOR_FOCUSABLE("focusable"); -const std::string FocusManager::IS_FOCUS_GROUP("is-focus-group"); FocusManager::FocusManager() {