Commit e1b9c4861ebfe553da7bba67348fc102be8648dd
1 parent
c78f2372
Changes required after Visual related Control APIs moved to Devel API
Change-Id: Ie1172a02636929b88e11a8c2683f6ef5092cb55a
Showing
4 changed files
with
25 additions
and
20 deletions
examples/simple-visuals-control/my-control-impl.cpp
| @@ -26,6 +26,7 @@ | @@ -26,6 +26,7 @@ | ||
| 26 | #include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h> | 26 | #include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h> |
| 27 | #include <dali-toolkit/devel-api/visual-factory/visual-factory.h> | 27 | #include <dali-toolkit/devel-api/visual-factory/visual-factory.h> |
| 28 | #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h> | 28 | #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h> |
| 29 | +#include <dali-toolkit/devel-api/controls/control-devel.h> | ||
| 29 | 30 | ||
| 30 | using namespace Dali; | 31 | using namespace Dali; |
| 31 | using namespace Dali::Toolkit; | 32 | using namespace Dali::Toolkit; |
| @@ -102,7 +103,7 @@ void MyControl::SetProperty( BaseObject* object, Property::Index index, const Pr | @@ -102,7 +103,7 @@ void MyControl::SetProperty( BaseObject* object, Property::Index index, const Pr | ||
| 102 | 103 | ||
| 103 | if ( iconVisual ) | 104 | if ( iconVisual ) |
| 104 | { | 105 | { |
| 105 | - impl.RegisterVisual( index, iconVisual ); | 106 | + DevelControl::RegisterVisual( impl, index, iconVisual ); |
| 106 | } | 107 | } |
| 107 | break; | 108 | break; |
| 108 | } | 109 | } |
| @@ -123,7 +124,8 @@ Property::Value MyControl::GetProperty( BaseObject* object, Property::Index prop | @@ -123,7 +124,8 @@ Property::Value MyControl::GetProperty( BaseObject* object, Property::Index prop | ||
| 123 | case Demo::MyControl::Property::ICON_VISUAL: | 124 | case Demo::MyControl::Property::ICON_VISUAL: |
| 124 | { | 125 | { |
| 125 | Property::Map map; | 126 | Property::Map map; |
| 126 | - Toolkit::Visual::Base visual = GetImpl( myControl ).GetVisual( propertyIndex ); | 127 | + MyControl& impl = GetImpl( myControl ); |
| 128 | + Toolkit::Visual::Base visual = DevelControl::GetVisual( impl, propertyIndex ); | ||
| 127 | if ( visual ) | 129 | if ( visual ) |
| 128 | { | 130 | { |
| 129 | visual.CreatePropertyMap( map ); // Creates a Property map containing the Visual that ICON_VISUAL currently is. Can change if state changes. | 131 | visual.CreatePropertyMap( map ); // Creates a Property map containing the Visual that ICON_VISUAL currently is. Can change if state changes. |
examples/styling/image-channel-control-impl.cpp
| @@ -18,6 +18,7 @@ | @@ -18,6 +18,7 @@ | ||
| 18 | #include <dali-toolkit/dali-toolkit.h> | 18 | #include <dali-toolkit/dali-toolkit.h> |
| 19 | #include <dali/public-api/object/type-registry-helper.h> | 19 | #include <dali/public-api/object/type-registry-helper.h> |
| 20 | #include <dali-toolkit/devel-api/align-enums.h> | 20 | #include <dali-toolkit/devel-api/align-enums.h> |
| 21 | +#include <dali-toolkit/devel-api/controls/control-devel.h> | ||
| 21 | #include <dali-toolkit/devel-api/visual-factory/visual-factory.h> | 22 | #include <dali-toolkit/devel-api/visual-factory/visual-factory.h> |
| 22 | #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h> | 23 | #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h> |
| 23 | 24 | ||
| @@ -104,7 +105,7 @@ void ImageChannelControl::SetImage( const std::string& url ) | @@ -104,7 +105,7 @@ void ImageChannelControl::SetImage( const std::string& url ) | ||
| 104 | properties[Dali::Toolkit::ImageVisual::Property::URL] = url; | 105 | properties[Dali::Toolkit::ImageVisual::Property::URL] = url; |
| 105 | 106 | ||
| 106 | mVisual = Toolkit::VisualFactory::Get().CreateVisual( properties ); | 107 | mVisual = Toolkit::VisualFactory::Get().CreateVisual( properties ); |
| 107 | - RegisterVisual( Demo::ImageChannelControl::Property::IMAGE_VISUAL, mVisual ); | 108 | + Toolkit::DevelControl::RegisterVisual( *this, Demo::ImageChannelControl::Property::IMAGE_VISUAL, mVisual ); |
| 108 | mVisual.SetName("imageVisual"); | 109 | mVisual.SetName("imageVisual"); |
| 109 | 110 | ||
| 110 | RelayoutRequest(); | 111 | RelayoutRequest(); |
| @@ -127,14 +128,14 @@ void ImageChannelControl::SetVisibility( bool visibility ) | @@ -127,14 +128,14 @@ void ImageChannelControl::SetVisibility( bool visibility ) | ||
| 127 | { | 128 | { |
| 128 | if( mDisableVisibilityTransition.Count() > 0 ) | 129 | if( mDisableVisibilityTransition.Count() > 0 ) |
| 129 | { | 130 | { |
| 130 | - mAnimation = CreateTransition( mDisableVisibilityTransition ); | 131 | + mAnimation = Toolkit::DevelControl::CreateTransition( *this, mDisableVisibilityTransition ); |
| 131 | } | 132 | } |
| 132 | } | 133 | } |
| 133 | else | 134 | else |
| 134 | { | 135 | { |
| 135 | if( mEnableVisibilityTransition.Count() > 0 ) | 136 | if( mEnableVisibilityTransition.Count() > 0 ) |
| 136 | { | 137 | { |
| 137 | - mAnimation = CreateTransition( mEnableVisibilityTransition ); | 138 | + mAnimation = Toolkit::DevelControl::CreateTransition( *this, mEnableVisibilityTransition ); |
| 138 | } | 139 | } |
| 139 | } | 140 | } |
| 140 | } | 141 | } |
| @@ -236,7 +237,7 @@ void ImageChannelControl::SetProperty( BaseObject* object, Property::Index index | @@ -236,7 +237,7 @@ void ImageChannelControl::SetProperty( BaseObject* object, Property::Index index | ||
| 236 | if( map ) | 237 | if( map ) |
| 237 | { | 238 | { |
| 238 | impl.mVisual = Toolkit::VisualFactory::Get().CreateVisual( *map ); | 239 | impl.mVisual = Toolkit::VisualFactory::Get().CreateVisual( *map ); |
| 239 | - impl.RegisterVisual( Demo::ImageChannelControl::Property::IMAGE_VISUAL, impl.mVisual ); | 240 | + Toolkit::DevelControl::RegisterVisual( impl, Demo::ImageChannelControl::Property::IMAGE_VISUAL, impl.mVisual ); |
| 240 | } | 241 | } |
| 241 | break; | 242 | break; |
| 242 | } | 243 | } |
examples/transitions/shadow-button-impl.cpp
| @@ -21,6 +21,7 @@ | @@ -21,6 +21,7 @@ | ||
| 21 | #include <dali-toolkit/devel-api/align-enums.h> | 21 | #include <dali-toolkit/devel-api/align-enums.h> |
| 22 | #include <dali-toolkit/devel-api/visual-factory/visual-factory.h> | 22 | #include <dali-toolkit/devel-api/visual-factory/visual-factory.h> |
| 23 | #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h> | 23 | #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h> |
| 24 | +#include <dali-toolkit/devel-api/controls/control-devel.h> | ||
| 24 | 25 | ||
| 25 | #include <cstdio> | 26 | #include <cstdio> |
| 26 | 27 | ||
| @@ -124,7 +125,7 @@ bool ShadowButton::GetActiveState() | @@ -124,7 +125,7 @@ bool ShadowButton::GetActiveState() | ||
| 124 | void ShadowButton::SetCheckState( bool checkState ) | 125 | void ShadowButton::SetCheckState( bool checkState ) |
| 125 | { | 126 | { |
| 126 | mCheckState = checkState; | 127 | mCheckState = checkState; |
| 127 | - EnableVisual( Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL, true ); | 128 | + DevelControl::EnableVisual( *this, Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL, true ); |
| 128 | if( Self().OnStage() ) | 129 | if( Self().OnStage() ) |
| 129 | { | 130 | { |
| 130 | if( checkState ) | 131 | if( checkState ) |
| @@ -157,7 +158,7 @@ void ShadowButton::StartTransition( Property::Index transitionId ) | @@ -157,7 +158,7 @@ void ShadowButton::StartTransition( Property::Index transitionId ) | ||
| 157 | iter->mAnimation.FinishedSignal().Disconnect( this, &ShadowButton::OnTransitionFinished ); | 158 | iter->mAnimation.FinishedSignal().Disconnect( this, &ShadowButton::OnTransitionFinished ); |
| 158 | } | 159 | } |
| 159 | 160 | ||
| 160 | - iter->mAnimation = CreateTransition( iter->mTransitionData ); | 161 | + iter->mAnimation = DevelControl::CreateTransition( *this, iter->mTransitionData ); |
| 161 | StoreTargetLayouts( iter->mTransitionData ); | 162 | StoreTargetLayouts( iter->mTransitionData ); |
| 162 | 163 | ||
| 163 | iter->mAnimation.FinishedSignal().Connect( this, &ShadowButton::OnTransitionFinished ); | 164 | iter->mAnimation.FinishedSignal().Connect( this, &ShadowButton::OnTransitionFinished ); |
| @@ -189,7 +190,7 @@ void ShadowButton::OnTransitionFinished( Animation& src ) | @@ -189,7 +190,7 @@ void ShadowButton::OnTransitionFinished( Animation& src ) | ||
| 189 | } | 190 | } |
| 190 | case Demo::ShadowButton::Property::UNCHECK_TRANSITION: | 191 | case Demo::ShadowButton::Property::UNCHECK_TRANSITION: |
| 191 | { | 192 | { |
| 192 | - EnableVisual( Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL, false ); | 193 | + DevelControl::EnableVisual( *this, Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL, false ); |
| 193 | break; | 194 | break; |
| 194 | } | 195 | } |
| 195 | } | 196 | } |
| @@ -352,25 +353,25 @@ void ShadowButton::ResetVisual( | @@ -352,25 +353,25 @@ void ShadowButton::ResetVisual( | ||
| 352 | { | 353 | { |
| 353 | case Demo::ShadowButton::Property::BACKGROUND_VISUAL: | 354 | case Demo::ShadowButton::Property::BACKGROUND_VISUAL: |
| 354 | { | 355 | { |
| 355 | - RegisterVisual( index, visual ); | 356 | + DevelControl::RegisterVisual( *this, index, visual ); |
| 356 | visual.SetDepthIndex(0.0f); | 357 | visual.SetDepthIndex(0.0f); |
| 357 | break; | 358 | break; |
| 358 | } | 359 | } |
| 359 | case Demo::ShadowButton::Property::CHECKBOX_BG_VISUAL: | 360 | case Demo::ShadowButton::Property::CHECKBOX_BG_VISUAL: |
| 360 | { | 361 | { |
| 361 | - RegisterVisual( index, visual ); | 362 | + DevelControl::RegisterVisual( *this, index, visual ); |
| 362 | visual.SetDepthIndex(1.0f); | 363 | visual.SetDepthIndex(1.0f); |
| 363 | break; | 364 | break; |
| 364 | } | 365 | } |
| 365 | case Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL: | 366 | case Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL: |
| 366 | { | 367 | { |
| 367 | - RegisterVisual( index, visual, mCheckState ); | 368 | + DevelControl::RegisterVisual( *this, index, visual, mCheckState ); |
| 368 | visual.SetDepthIndex(2.0f); | 369 | visual.SetDepthIndex(2.0f); |
| 369 | break; | 370 | break; |
| 370 | } | 371 | } |
| 371 | case Demo::ShadowButton::Property::LABEL_VISUAL: | 372 | case Demo::ShadowButton::Property::LABEL_VISUAL: |
| 372 | { | 373 | { |
| 373 | - RegisterVisual( index, visual ); | 374 | + DevelControl::RegisterVisual( *this, index, visual ); |
| 374 | visual.SetDepthIndex(1.0f); | 375 | visual.SetDepthIndex(1.0f); |
| 375 | break; | 376 | break; |
| 376 | } | 377 | } |
| @@ -496,7 +497,7 @@ void ShadowButton::SetProperty( BaseObject* object, Property::Index index, const | @@ -496,7 +497,7 @@ void ShadowButton::SetProperty( BaseObject* object, Property::Index index, const | ||
| 496 | case Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL: | 497 | case Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL: |
| 497 | { | 498 | { |
| 498 | impl.ResetVisual( index, impl.mCheckboxFgVisual, value ); | 499 | impl.ResetVisual( index, impl.mCheckboxFgVisual, value ); |
| 499 | - impl.EnableVisual( Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL, impl.mCheckState ); | 500 | + DevelControl::EnableVisual( impl, Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL, impl.mCheckState ); |
| 500 | break; | 501 | break; |
| 501 | } | 502 | } |
| 502 | case Demo::ShadowButton::Property::LABEL_VISUAL: | 503 | case Demo::ShadowButton::Property::LABEL_VISUAL: |
examples/visual-transitions/beat-control-impl.cpp
| 1 | /* | 1 | /* |
| 2 | - * Copyright (c) 2016 Samsung Electronics Co., Ltd. | 2 | + * Copyright (c) 2017 Samsung Electronics Co., Ltd. |
| 3 | * | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. | 5 | * you may not use this file except in compliance with the License. |
| @@ -18,6 +18,7 @@ | @@ -18,6 +18,7 @@ | ||
| 18 | #include <dali-toolkit/dali-toolkit.h> | 18 | #include <dali-toolkit/dali-toolkit.h> |
| 19 | #include <dali/public-api/object/type-registry-helper.h> | 19 | #include <dali/public-api/object/type-registry-helper.h> |
| 20 | #include <dali-toolkit/devel-api/align-enums.h> | 20 | #include <dali-toolkit/devel-api/align-enums.h> |
| 21 | +#include <dali-toolkit/devel-api/controls/control-devel.h> | ||
| 21 | #include <dali-toolkit/devel-api/visual-factory/visual-factory.h> | 22 | #include <dali-toolkit/devel-api/visual-factory/visual-factory.h> |
| 22 | #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h> | 23 | #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h> |
| 23 | 24 | ||
| @@ -102,7 +103,7 @@ void BeatControl::StartBounceAnimation() | @@ -102,7 +103,7 @@ void BeatControl::StartBounceAnimation() | ||
| 102 | OnBounceAnimationFinished(mAnimation); | 103 | OnBounceAnimationFinished(mAnimation); |
| 103 | } | 104 | } |
| 104 | 105 | ||
| 105 | - mAnimation = CreateTransition( mBounceTransition ); | 106 | + mAnimation = DevelControl::CreateTransition( *this, mBounceTransition ); |
| 106 | mAnimation.FinishedSignal().Connect( this, &BeatControl::OnBounceAnimationFinished ); | 107 | mAnimation.FinishedSignal().Connect( this, &BeatControl::OnBounceAnimationFinished ); |
| 107 | mAnimation.Play(); | 108 | mAnimation.Play(); |
| 108 | mAnimationPlaying |= BOUNCE_ANIMATION_RUNNING; | 109 | mAnimationPlaying |= BOUNCE_ANIMATION_RUNNING; |
| @@ -118,7 +119,7 @@ void BeatControl::StartXAnimation() | @@ -118,7 +119,7 @@ void BeatControl::StartXAnimation() | ||
| 118 | OnXAnimationFinished(mXAnimation); | 119 | OnXAnimationFinished(mXAnimation); |
| 119 | } | 120 | } |
| 120 | 121 | ||
| 121 | - mXAnimation = CreateTransition( mLeftTransition ); | 122 | + mXAnimation = DevelControl::CreateTransition( *this, mLeftTransition ); |
| 122 | mXAnimation.FinishedSignal().Connect( this, &BeatControl::OnXAnimationFinished ); | 123 | mXAnimation.FinishedSignal().Connect( this, &BeatControl::OnXAnimationFinished ); |
| 123 | mXAnimation.Play(); | 124 | mXAnimation.Play(); |
| 124 | mAnimationPlaying |= X_ANIMATION_RUNNING; | 125 | mAnimationPlaying |= X_ANIMATION_RUNNING; |
| @@ -133,7 +134,7 @@ void BeatControl::StartYAnimation() | @@ -133,7 +134,7 @@ void BeatControl::StartYAnimation() | ||
| 133 | OnYAnimationFinished(mYAnimation); | 134 | OnYAnimationFinished(mYAnimation); |
| 134 | } | 135 | } |
| 135 | 136 | ||
| 136 | - mYAnimation = CreateTransition( mUpTransition ); | 137 | + mYAnimation = DevelControl::CreateTransition( *this, mUpTransition ); |
| 137 | mYAnimation.FinishedSignal().Connect( this, &BeatControl::OnYAnimationFinished ); | 138 | mYAnimation.FinishedSignal().Connect( this, &BeatControl::OnYAnimationFinished ); |
| 138 | mYAnimation.Play(); | 139 | mYAnimation.Play(); |
| 139 | mAnimationPlaying |= Y_ANIMATION_RUNNING; | 140 | mAnimationPlaying |= Y_ANIMATION_RUNNING; |
| @@ -148,7 +149,7 @@ void BeatControl::StartFadeAnimation() | @@ -148,7 +149,7 @@ void BeatControl::StartFadeAnimation() | ||
| 148 | OnFadeAnimationFinished(mFadeAnimation); | 149 | OnFadeAnimationFinished(mFadeAnimation); |
| 149 | } | 150 | } |
| 150 | 151 | ||
| 151 | - mFadeAnimation = CreateTransition( mFadeTransition ); | 152 | + mFadeAnimation = DevelControl::CreateTransition( *this, mFadeTransition ); |
| 152 | mFadeAnimation.FinishedSignal().Connect( this, &BeatControl::OnFadeAnimationFinished ); | 153 | mFadeAnimation.FinishedSignal().Connect( this, &BeatControl::OnFadeAnimationFinished ); |
| 153 | mFadeAnimation.Play(); | 154 | mFadeAnimation.Play(); |
| 154 | mAnimationPlaying |= FADE_ANIMATION_RUNNING; | 155 | mAnimationPlaying |= FADE_ANIMATION_RUNNING; |
| @@ -276,7 +277,7 @@ void BeatControl::SetProperty( BaseObject* object, Property::Index index, const | @@ -276,7 +277,7 @@ void BeatControl::SetProperty( BaseObject* object, Property::Index index, const | ||
| 276 | { | 277 | { |
| 277 | // Only register a visual if there is more than just a size setting | 278 | // Only register a visual if there is more than just a size setting |
| 278 | impl.mVisual = Toolkit::VisualFactory::Get().CreateVisual( *map ); | 279 | impl.mVisual = Toolkit::VisualFactory::Get().CreateVisual( *map ); |
| 279 | - impl.RegisterVisual( Demo::BeatControl::Property::BEAT_VISUAL, impl.mVisual ); | 280 | + DevelControl::RegisterVisual( impl, Demo::BeatControl::Property::BEAT_VISUAL, impl.mVisual ); |
| 280 | 281 | ||
| 281 | // We have registered a new visual: must trigger size negotiation | 282 | // We have registered a new visual: must trigger size negotiation |
| 282 | // in order to call SetTransformAndSize on the visual with the right size: | 283 | // in order to call SetTransformAndSize on the visual with the right size: |