Commit 2e5d11245064ffb93356a1cb714a15102a4b369f

Authored by Kimmo Hoikka
Committed by Gerrit Code Review
2 parents 2cc32862 7c667d7c

Merge "Changed some demo examples to use ImageView." into devel/master

demo/dali-table-view.cpp
@@ -88,10 +88,10 @@ const float BUBBLE_MAX_Z = 0.0f; @@ -88,10 +88,10 @@ const float BUBBLE_MAX_Z = 0.0f;
88 /** 88 /**
89 * Creates the background image 89 * Creates the background image
90 */ 90 */
91 -ImageActor CreateBackground( std::string imagePath ) 91 +ImageView CreateBackground( std::string imagePath )
92 { 92 {
93 Image image = ResourceImage::New( imagePath ); 93 Image image = ResourceImage::New( imagePath );
94 - ImageActor background = ImageActor::New( image ); 94 + ImageView background = ImageView::New( image );
95 background.SetName( "BACKGROUND" ); 95 background.SetName( "BACKGROUND" );
96 background.SetAnchorPoint( AnchorPoint::CENTER ); 96 background.SetAnchorPoint( AnchorPoint::CENTER );
97 background.SetParentOrigin( ParentOrigin::CENTER ); 97 background.SetParentOrigin( ParentOrigin::CENTER );
@@ -153,7 +153,6 @@ DaliTableView::DaliTableView( Application& application ) @@ -153,7 +153,6 @@ DaliTableView::DaliTableView( Application& application )
153 mBackgroundLayer(), 153 mBackgroundLayer(),
154 mRootActor(), 154 mRootActor(),
155 mRotateAnimation(), 155 mRotateAnimation(),
156 - mBackground(),  
157 mPressedAnimation(), 156 mPressedAnimation(),
158 mScrollViewLayer(), 157 mScrollViewLayer(),
159 mScrollView(), 158 mScrollView(),
@@ -209,7 +208,7 @@ void DaliTableView::Initialize( Application& application ) @@ -209,7 +208,7 @@ void DaliTableView::Initialize( Application& application )
209 const Vector2 stageSize = Stage::GetCurrent().GetSize(); 208 const Vector2 stageSize = Stage::GetCurrent().GetSize();
210 209
211 // Background 210 // Background
212 - Actor background = CreateBackground( mBackgroundImagePath ); 211 + ImageView background = CreateBackground( mBackgroundImagePath );
213 Stage::GetCurrent().Add( background ); 212 Stage::GetCurrent().Add( background );
214 213
215 // Render entire content as overlays, as is all on same 2D plane. 214 // Render entire content as overlays, as is all on same 2D plane.
@@ -230,7 +229,7 @@ void DaliTableView::Initialize( Application& application ) @@ -230,7 +229,7 @@ void DaliTableView::Initialize( Application& application )
230 mRootActor.SetFitHeight( 0 ); 229 mRootActor.SetFitHeight( 0 );
231 230
232 // Add logo 231 // Add logo
233 - Dali::ImageActor logo = CreateLogo( LOGO_PATH ); 232 + ImageView logo = CreateLogo( LOGO_PATH );
234 logo.SetName( "LOGO_IMAGE" ); 233 logo.SetName( "LOGO_IMAGE" );
235 logo.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); 234 logo.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
236 const float paddingHeight = ( ( 1.f-TABLE_RELATIVE_SIZE.y ) * stageSize.y ); 235 const float paddingHeight = ( ( 1.f-TABLE_RELATIVE_SIZE.y ) * stageSize.y );
@@ -848,10 +847,10 @@ void DaliTableView::GenerateCircle( const Size& size, std::vector< unsigned char @@ -848,10 +847,10 @@ void DaliTableView::GenerateCircle( const Size& size, std::vector< unsigned char
848 } 847 }
849 } 848 }
850 849
851 -ImageActor DaliTableView::CreateLogo( std::string imagePath ) 850 +ImageView DaliTableView::CreateLogo( std::string imagePath )
852 { 851 {
853 Image image = ResourceImage::New( imagePath ); 852 Image image = ResourceImage::New( imagePath );
854 - ImageActor logo = ImageActor::New( image ); 853 + ImageView logo = ImageView::New( image );
855 854
856 logo.SetAnchorPoint( AnchorPoint::CENTER ); 855 logo.SetAnchorPoint( AnchorPoint::CENTER );
857 logo.SetParentOrigin( ParentOrigin::CENTER ); 856 logo.SetParentOrigin( ParentOrigin::CENTER );
demo/dali-table-view.h
@@ -318,7 +318,7 @@ private: // Application callbacks & implementation @@ -318,7 +318,7 @@ private: // Application callbacks & implementation
318 * 318 *
319 * @return The created image actor 319 * @return The created image actor
320 */ 320 */
321 - Dali::ImageActor CreateLogo( std::string imagePath ); 321 + Dali::Toolkit::ImageView CreateLogo( std::string imagePath );
322 322
323 /** 323 /**
324 * Timer handler for ending background animation 324 * Timer handler for ending background animation
@@ -392,7 +392,6 @@ private: @@ -392,7 +392,6 @@ private:
392 Dali::Layer mBackgroundLayer; ///< Background resides on a separate layer. 392 Dali::Layer mBackgroundLayer; ///< Background resides on a separate layer.
393 Dali::Toolkit::TableView mRootActor; ///< All content (excluding background is anchored to this Actor) 393 Dali::Toolkit::TableView mRootActor; ///< All content (excluding background is anchored to this Actor)
394 Dali::Animation mRotateAnimation; ///< Animation to rotate and resize mRootActor. 394 Dali::Animation mRotateAnimation; ///< Animation to rotate and resize mRootActor.
395 - Dali::ImageActor mBackground; ///< Background's static image.  
396 Dali::Animation mPressedAnimation; ///< Button press scaling animation. 395 Dali::Animation mPressedAnimation; ///< Button press scaling animation.
397 Dali::Layer mScrollViewLayer; ///< ScrollView resides on a separate layer. 396 Dali::Layer mScrollViewLayer; ///< ScrollView resides on a separate layer.
398 Dali::Toolkit::ScrollView mScrollView; ///< ScrollView container (for all Examples) 397 Dali::Toolkit::ScrollView mScrollView; ///< ScrollView container (for all Examples)
examples/atlas/atlas-example.cpp
@@ -90,7 +90,7 @@ public: @@ -90,7 +90,7 @@ public:
90 mAtlas.Upload( DALI_IMAGE_DIR "icon-item-view-layout-spiral.png", 250, 130 ); 90 mAtlas.Upload( DALI_IMAGE_DIR "icon-item-view-layout-spiral.png", 250, 130 );
91 UploadBufferImages(); 91 UploadBufferImages();
92 92
93 - ImageActor imageActor1 = ImageActor::New( mAtlas ); 93 + Toolkit::ImageView imageActor1 = Toolkit::ImageView::New( mAtlas );
94 imageActor1.SetY(-170.f); 94 imageActor1.SetY(-170.f);
95 imageActor1.SetParentOrigin(ParentOrigin::CENTER); 95 imageActor1.SetParentOrigin(ParentOrigin::CENTER);
96 mContentLayer.Add( imageActor1 ); 96 mContentLayer.Add( imageActor1 );
@@ -109,19 +109,20 @@ public: @@ -109,19 +109,20 @@ public:
109 atlas2.Upload( DALI_IMAGE_DIR "gallery-small-7.jpg", 268, 268 ); 109 atlas2.Upload( DALI_IMAGE_DIR "gallery-small-7.jpg", 268, 268 );
110 110
111 111
112 - ImageActor imageActor2 = ImageActor::New( atlas2 );  
113 - imageActor2.SetY(200.f);  
114 - imageActor2.SetZ(-1.f);  
115 - imageActor2.SetParentOrigin(ParentOrigin::CENTER);  
116 - mContentLayer.Add( imageActor2 ); 112 + Toolkit::ImageView imageView = Toolkit::ImageView::New( DALI_IMAGE_DIR "gallery-small-1.jpg" );
  113 +
  114 + imageView.SetY(200.f);
  115 + imageView.SetZ(-1.f);
  116 + imageView.SetParentOrigin(ParentOrigin::CENTER);
  117 + mContentLayer.Add( imageView );
117 118
118 mPanGestureDetector = PanGestureDetector::New(); 119 mPanGestureDetector = PanGestureDetector::New();
119 - mPanGestureDetector.DetectedSignal().Connect(this, &AtlasController::OnPanGesture);  
120 - mPanGestureDetector.Attach(imageActor1);  
121 - mPanGestureDetector.Attach(imageActor2); 120 + mPanGestureDetector.DetectedSignal().Connect( this, &AtlasController::OnPanGesture );
  121 + mPanGestureDetector.Attach( imageActor1 );
  122 + mPanGestureDetector.Attach( imageView );
122 123
123 - stage.ContextLostSignal().Connect(this, &AtlasController::OnContextLost);  
124 - stage.ContextRegainedSignal().Connect(this, &AtlasController::OnContextRegained); 124 + stage.ContextLostSignal().Connect( this, &AtlasController::OnContextLost );
  125 + stage.ContextRegainedSignal().Connect( this, &AtlasController::OnContextRegained );
125 } 126 }
126 127
127 void UploadBufferImages() 128 void UploadBufferImages()
examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp
@@ -171,7 +171,7 @@ public: @@ -171,7 +171,7 @@ public:
171 171
172 // Background image: 172 // Background image:
173 ResourceImage backgroundImage = ResourceImage::New( BACKGROUND_IMAGE, ImageDimensions( stage.GetSize().width, stage.GetSize().height ), FittingMode::SCALE_TO_FILL, SamplingMode::BOX_THEN_LINEAR ); 173 ResourceImage backgroundImage = ResourceImage::New( BACKGROUND_IMAGE, ImageDimensions( stage.GetSize().width, stage.GetSize().height ), FittingMode::SCALE_TO_FILL, SamplingMode::BOX_THEN_LINEAR );
174 - ImageActor background = ImageActor::New( backgroundImage ); 174 + Toolkit::ImageView background = Toolkit::ImageView::New( backgroundImage );
175 background.SetZ( -2.0f ); 175 background.SetZ( -2.0f );
176 background.SetAnchorPoint( AnchorPoint::TOP_LEFT ); 176 background.SetAnchorPoint( AnchorPoint::TOP_LEFT );
177 background.SetSize( stage.GetSize() ); 177 background.SetSize( stage.GetSize() );
@@ -192,34 +192,34 @@ public: @@ -192,34 +192,34 @@ public:
192 widthPixel[1] = 0x4f; 192 widthPixel[1] = 0x4f;
193 widthPixel[2] = 0x4f; 193 widthPixel[2] = 0x4f;
194 194
195 - mHeightBox = ImageActor::New( heightBackground ); 195 + mHeightBox = Toolkit::ImageView::New( heightBackground );
196 mHeightBox.SetOpacity( 0.2f ); 196 mHeightBox.SetOpacity( 0.2f );
197 stage.Add( mHeightBox ); 197 stage.Add( mHeightBox );
198 198
199 - mWidthBox = ImageActor::New( widthBackground ); 199 + mWidthBox = Toolkit::ImageView::New( widthBackground );
200 mWidthBox.SetOpacity( 0.2f ); 200 mWidthBox.SetOpacity( 0.2f );
201 stage.Add( mWidthBox ); 201 stage.Add( mWidthBox );
202 202
203 - mDesiredBox = ImageActor::New( desiredBackground ); 203 + mDesiredBox = Toolkit::ImageView::New( desiredBackground );
204 stage.Add( mDesiredBox ); 204 stage.Add( mDesiredBox );
205 205
206 mDesiredBox.SetSize( stage.GetSize() * mImageStageScale ); 206 mDesiredBox.SetSize( stage.GetSize() * mImageStageScale );
207 mDesiredBox.SetParentOrigin( ParentOrigin::CENTER ); 207 mDesiredBox.SetParentOrigin( ParentOrigin::CENTER );
208 mDesiredBox.SetAnchorPoint( AnchorPoint::CENTER ); 208 mDesiredBox.SetAnchorPoint( AnchorPoint::CENTER );
209 mDesiredBox.SetPosition( 0, 0, -1 ); 209 mDesiredBox.SetPosition( 0, 0, -1 );
210 - mDesiredBox.SetSortModifier(4.f); 210 + //mDesiredBox.SetSortModifier(4.f);
211 211
212 mHeightBox.SetSize( stage.GetSize().width, (stage.GetSize() * mImageStageScale).height ); 212 mHeightBox.SetSize( stage.GetSize().width, (stage.GetSize() * mImageStageScale).height );
213 mHeightBox.SetParentOrigin( ParentOrigin::CENTER ); 213 mHeightBox.SetParentOrigin( ParentOrigin::CENTER );
214 mHeightBox.SetAnchorPoint( AnchorPoint::CENTER ); 214 mHeightBox.SetAnchorPoint( AnchorPoint::CENTER );
215 mHeightBox.SetPosition( 0, 0, -1 ); 215 mHeightBox.SetPosition( 0, 0, -1 );
216 - mHeightBox.SetSortModifier(3.f); 216 + //mHeightBox.SetSortModifier(3.f);
217 217
218 mWidthBox.SetSize( (stage.GetSize() * mImageStageScale).width, stage.GetSize().height ); 218 mWidthBox.SetSize( (stage.GetSize() * mImageStageScale).width, stage.GetSize().height );
219 mWidthBox.SetParentOrigin( ParentOrigin::CENTER ); 219 mWidthBox.SetParentOrigin( ParentOrigin::CENTER );
220 mWidthBox.SetAnchorPoint( AnchorPoint::CENTER ); 220 mWidthBox.SetAnchorPoint( AnchorPoint::CENTER );
221 mWidthBox.SetPosition( 0, 0, -1 ); 221 mWidthBox.SetPosition( 0, 0, -1 );
222 - mWidthBox.SetSortModifier(2.f); 222 + //mWidthBox.SetSortModifier(2.f);
223 223
224 // Make a grab-handle for resizing the image: 224 // Make a grab-handle for resizing the image:
225 mGrabCorner = Toolkit::PushButton::New(); 225 mGrabCorner = Toolkit::PushButton::New();
@@ -284,7 +284,7 @@ public: @@ -284,7 +284,7 @@ public:
284 // Back and next image buttons in corners of stage: 284 // Back and next image buttons in corners of stage:
285 unsigned int playWidth = std::min( stage.GetSize().x * (1 / 5.0f), 58.0f ); 285 unsigned int playWidth = std::min( stage.GetSize().x * (1 / 5.0f), 58.0f );
286 Image playImage = ResourceImage::New( DALI_ICON_PLAY, ImageDimensions( playWidth, playWidth ), FittingMode::SHRINK_TO_FIT, SamplingMode::BOX_THEN_LINEAR ); 286 Image playImage = ResourceImage::New( DALI_ICON_PLAY, ImageDimensions( playWidth, playWidth ), FittingMode::SHRINK_TO_FIT, SamplingMode::BOX_THEN_LINEAR );
287 - Actor imagePrevious = ImageActor::New( playImage ); 287 + Toolkit::ImageView imagePrevious = Toolkit::ImageView::New( playImage );
288 288
289 // Last image button: 289 // Last image button:
290 imagePrevious.SetAnchorPoint( AnchorPoint::TOP_LEFT ); 290 imagePrevious.SetAnchorPoint( AnchorPoint::TOP_LEFT );
@@ -297,7 +297,7 @@ public: @@ -297,7 +297,7 @@ public:
297 imagePrevious.TouchedSignal().Connect( this, &ImageScalingAndFilteringController::OnControlTouched ); 297 imagePrevious.TouchedSignal().Connect( this, &ImageScalingAndFilteringController::OnControlTouched );
298 298
299 // Next image button: 299 // Next image button:
300 - Actor imageNext = ImageActor::New( playImage ); 300 + Toolkit::ImageView imageNext = Toolkit::ImageView::New( playImage );
301 imageNext.SetAnchorPoint( AnchorPoint::TOP_RIGHT ); 301 imageNext.SetAnchorPoint( AnchorPoint::TOP_RIGHT );
302 imageNext.SetY( playWidth * 0.5f ); 302 imageNext.SetY( playWidth * 0.5f );
303 imageNext.SetX( stage.GetSize().x - playWidth * 0.5f ); 303 imageNext.SetX( stage.GetSize().x - playWidth * 0.5f );
@@ -697,9 +697,9 @@ private: @@ -697,9 +697,9 @@ private:
697 697
698 private: 698 private:
699 Application& mApplication; 699 Application& mApplication;
700 - ImageActor mDesiredBox; //< Background rectangle to show requested image size.  
701 - ImageActor mHeightBox; //< Background horizontal stripe to show requested image height.  
702 - ImageActor mWidthBox; //< Background vertical stripe to show requested image width. 700 + Toolkit::ImageView mDesiredBox; //< Background rectangle to show requested image size.
  701 + Toolkit::ImageView mHeightBox; //< Background horizontal stripe to show requested image height.
  702 + Toolkit::ImageView mWidthBox; //< Background vertical stripe to show requested image width.
703 Toolkit::PushButton mFittingModeButton; 703 Toolkit::PushButton mFittingModeButton;
704 Toolkit::PushButton mSamplingModeButton; 704 Toolkit::PushButton mSamplingModeButton;
705 Toolkit::Popup mPopup; 705 Toolkit::Popup mPopup;
examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp
@@ -24,7 +24,7 @@ @@ -24,7 +24,7 @@
24 * reduce the image to save memory, improve performance, and potentially display 24 * reduce the image to save memory, improve performance, and potentially display
25 * a better small version of the image than if the default size were loaded. 25 * a better small version of the image than if the default size were loaded.
26 * 26 *
27 - * The functions CreateImage and CreateImageActor below show how to build an 27 + * The functions CreateImage and CreateImageView below show how to build an
28 * image using a scaling mode to have %Dali resize it during loading. 28 * image using a scaling mode to have %Dali resize it during loading.
29 * 29 *
30 * This demo defaults to the SCALE_TO_FILL mode of ImageAttributes which makes 30 * This demo defaults to the SCALE_TO_FILL mode of ImageAttributes which makes
@@ -38,7 +38,7 @@ @@ -38,7 +38,7 @@
38 * grid using the button in the top-right of the toolbar. 38 * grid using the button in the top-right of the toolbar.
39 * A single image can be cycled by clicking the image directly. 39 * A single image can be cycled by clicking the image directly.
40 * 40 *
41 - * @see CreateImage CreateImageActor 41 + * @see CreateImage CreateImageView
42 */ 42 */
43 43
44 // EXTERNAL INCLUDES 44 // EXTERNAL INCLUDES
@@ -186,17 +186,17 @@ Image CreateImage(const std::string&amp; filename, unsigned int width, unsigned int @@ -186,17 +186,17 @@ Image CreateImage(const std::string&amp; filename, unsigned int width, unsigned int
186 } 186 }
187 187
188 /** 188 /**
189 - * Creates an ImageActor 189 + * Creates an ImageView
190 * 190 *
191 * @param[in] filename The path of the image. 191 * @param[in] filename The path of the image.
192 * @param[in] width The width of the image in pixels. 192 * @param[in] width The width of the image in pixels.
193 * @param[in] height The height of the image in pixels. 193 * @param[in] height The height of the image in pixels.
194 * @param[in] fittingMode The mode to use when scaling the image to fit the desired dimensions. 194 * @param[in] fittingMode The mode to use when scaling the image to fit the desired dimensions.
195 */ 195 */
196 -ImageActor CreateImageActor(const std::string& filename, unsigned int width, unsigned int height, Dali::FittingMode::Type fittingMode ) 196 +ImageView CreateImageView(const std::string& filename, unsigned int width, unsigned int height, Dali::FittingMode::Type fittingMode )
197 { 197 {
198 Image img = CreateImage( filename, width, height, fittingMode ); 198 Image img = CreateImage( filename, width, height, fittingMode );
199 - ImageActor actor = ImageActor::New( img ); 199 + ImageView actor = ImageView::New( img );
200 actor.SetName( filename ); 200 actor.SetName( filename );
201 actor.SetParentOrigin(ParentOrigin::CENTER); 201 actor.SetParentOrigin(ParentOrigin::CENTER);
202 actor.SetAnchorPoint(AnchorPoint::CENTER); 202 actor.SetAnchorPoint(AnchorPoint::CENTER);
@@ -460,7 +460,7 @@ public: @@ -460,7 +460,7 @@ public:
460 const Vector2 imageRegionCorner = gridOrigin + cellSize * Vector2( imageSource.cellX, imageSource.cellY ); 460 const Vector2 imageRegionCorner = gridOrigin + cellSize * Vector2( imageSource.cellX, imageSource.cellY );
461 const Vector2 imagePosition = imageRegionCorner + Vector2( GRID_CELL_PADDING , GRID_CELL_PADDING ) + imageSize * 0.5f; 461 const Vector2 imagePosition = imageRegionCorner + Vector2( GRID_CELL_PADDING , GRID_CELL_PADDING ) + imageSize * 0.5f;
462 462
463 - ImageActor image = CreateImageActor( imageSource.configuration.path, imageSize.x, imageSize.y, fittingMode ); 463 + ImageView image = CreateImageView( imageSource.configuration.path, imageSize.x, imageSize.y, fittingMode );
464 image.SetPosition( Vector3( imagePosition.x, imagePosition.y, 0 ) ); 464 image.SetPosition( Vector3( imagePosition.x, imagePosition.y, 0 ) );
465 image.SetSize( imageSize ); 465 image.SetSize( imageSize );
466 image.TouchedSignal().Connect( this, &ImageScalingIrregularGridController::OnTouchImage ); 466 image.TouchedSignal().Connect( this, &ImageScalingIrregularGridController::OnTouchImage );
@@ -495,10 +495,10 @@ public: @@ -495,10 +495,10 @@ public:
495 Dali::FittingMode::Type newMode = NextMode( mFittingModes[id] ); 495 Dali::FittingMode::Type newMode = NextMode( mFittingModes[id] );
496 const Vector2 imageSize = mSizes[actor.GetId()]; 496 const Vector2 imageSize = mSizes[actor.GetId()];
497 497
498 - ImageActor imageActor = ImageActor::DownCast( actor );  
499 - Image oldImage = imageActor.GetImage(); 498 + ImageView imageView = ImageView::DownCast( actor );
  499 + Image oldImage = imageView.GetImage();
500 Image newImage = CreateImage( ResourceImage::DownCast(oldImage).GetUrl(), imageSize.width + 0.5f, imageSize.height + 0.5f, newMode ); 500 Image newImage = CreateImage( ResourceImage::DownCast(oldImage).GetUrl(), imageSize.width + 0.5f, imageSize.height + 0.5f, newMode );
501 - imageActor.SetImage( newImage ); 501 + imageView.SetImage( newImage );
502 mFittingModes[id] = newMode; 502 mFittingModes[id] = newMode;
503 } 503 }
504 } 504 }
@@ -532,17 +532,17 @@ public: @@ -532,17 +532,17 @@ public:
532 532
533 for( unsigned i = 0; i < numChildren; ++i ) 533 for( unsigned i = 0; i < numChildren; ++i )
534 { 534 {
535 - ImageActor gridImageActor = ImageActor::DownCast( mGridActor.GetChildAt( i ) );  
536 - if( gridImageActor ) 535 + ImageView gridImageView = ImageView::DownCast( mGridActor.GetChildAt( i ) );
  536 + if( gridImageView )
537 { 537 {
538 // Cycle the scaling mode options: 538 // Cycle the scaling mode options:
539 - const Vector2 imageSize = mSizes[gridImageActor.GetId()];  
540 - Dali::FittingMode::Type newMode = NextMode( mFittingModes[gridImageActor.GetId()] );  
541 - Image oldImage = gridImageActor.GetImage(); 539 + const Vector2 imageSize = mSizes[gridImageView.GetId()];
  540 + Dali::FittingMode::Type newMode = NextMode( mFittingModes[gridImageView.GetId()] );
  541 + Image oldImage = gridImageView.GetImage();
542 Image newImage = CreateImage(ResourceImage::DownCast(oldImage).GetUrl(), imageSize.width, imageSize.height, newMode ); 542 Image newImage = CreateImage(ResourceImage::DownCast(oldImage).GetUrl(), imageSize.width, imageSize.height, newMode );
543 - gridImageActor.SetImage( newImage ); 543 + gridImageView.SetImage( newImage );
544 544
545 - mFittingModes[gridImageActor.GetId()] = newMode; 545 + mFittingModes[gridImageView.GetId()] = newMode;
546 546
547 SetTitle( std::string( newMode == FittingMode::SHRINK_TO_FIT ? "SHRINK_TO_FIT" : newMode == FittingMode::SCALE_TO_FILL ? "SCALE_TO_FILL" : newMode == FittingMode::FIT_WIDTH ? "FIT_WIDTH" : "FIT_HEIGHT" ) ); 547 SetTitle( std::string( newMode == FittingMode::SHRINK_TO_FIT ? "SHRINK_TO_FIT" : newMode == FittingMode::SCALE_TO_FILL ? "SCALE_TO_FILL" : newMode == FittingMode::FIT_WIDTH ? "FIT_WIDTH" : "FIT_HEIGHT" ) );
548 } 548 }
examples/new-window/new-window-example.cpp
@@ -124,7 +124,7 @@ public: @@ -124,7 +124,7 @@ public:
124 void AddBlendingImageActor(); 124 void AddBlendingImageActor();
125 void AddTextLabel(); 125 void AddTextLabel();
126 126
127 - ImageActor CreateBlurredMirrorImage(const char* imageName); 127 + ImageView CreateBlurredMirrorImage(const char* imageName);
128 FrameBufferImage CreateFrameBufferForImage(const char* imageName, Image image, ShaderEffect shaderEffect); 128 FrameBufferImage CreateFrameBufferForImage(const char* imageName, Image image, ShaderEffect shaderEffect);
129 void SetUpBubbleEmission( const Vector2& emitPosition, const Vector2& direction ); 129 void SetUpBubbleEmission( const Vector2& emitPosition, const Vector2& direction );
130 Geometry CreateMeshGeometry(); 130 Geometry CreateMeshGeometry();
@@ -211,16 +211,16 @@ void NewWindowController::Create( Application&amp; app ) @@ -211,16 +211,16 @@ void NewWindowController::Create( Application&amp; app )
211 mContentLayer.Add(logoLayoutActor); 211 mContentLayer.Add(logoLayoutActor);
212 212
213 Image image = ResourceImage::New(LOGO_IMAGE); 213 Image image = ResourceImage::New(LOGO_IMAGE);
214 - ImageActor imageActor = ImageActor::New(image);  
215 - imageActor.SetName("dali-logo");  
216 - imageActor.SetParentOrigin(ParentOrigin::CENTER);  
217 - imageActor.SetAnchorPoint(AnchorPoint::BOTTOM_CENTER);  
218 - logoLayoutActor.Add(imageActor); 214 + ImageView imageView = ImageView::New(image);
  215 + imageView.SetName("dali-logo");
  216 + imageView.SetParentOrigin(ParentOrigin::CENTER);
  217 + imageView.SetAnchorPoint(AnchorPoint::BOTTOM_CENTER);
  218 + logoLayoutActor.Add(imageView);
219 219
220 - ImageActor mirrorImageActor = CreateBlurredMirrorImage(LOGO_IMAGE);  
221 - mirrorImageActor.SetParentOrigin(ParentOrigin::CENTER);  
222 - mirrorImageActor.SetAnchorPoint(AnchorPoint::TOP_CENTER);  
223 - logoLayoutActor.Add(mirrorImageActor); 220 + ImageView mirrorImageView = CreateBlurredMirrorImage(LOGO_IMAGE);
  221 + mirrorImageView.SetParentOrigin(ParentOrigin::CENTER);
  222 + mirrorImageView.SetAnchorPoint(AnchorPoint::TOP_CENTER);
  223 + logoLayoutActor.Add(mirrorImageView);
224 224
225 AddBubbles(stage.GetSize()); 225 AddBubbles(stage.GetSize());
226 AddMeshActor(); 226 AddMeshActor();
@@ -300,7 +300,7 @@ void NewWindowController::AddBlendingImageActor() @@ -300,7 +300,7 @@ void NewWindowController::AddBlendingImageActor()
300 Image effectImage = ResourceImage::New(EFFECT_IMAGE); 300 Image effectImage = ResourceImage::New(EFFECT_IMAGE);
301 FrameBufferImage fb2 = CreateFrameBufferForImage( EFFECT_IMAGE, effectImage, colorModifier ); 301 FrameBufferImage fb2 = CreateFrameBufferForImage( EFFECT_IMAGE, effectImage, colorModifier );
302 302
303 - ImageActor tmpActor = ImageActor::New(fb2); 303 + ImageView tmpActor = ImageView::New(fb2);
304 mContentLayer.Add(tmpActor); 304 mContentLayer.Add(tmpActor);
305 tmpActor.SetParentOrigin(ParentOrigin::CENTER_RIGHT); 305 tmpActor.SetParentOrigin(ParentOrigin::CENTER_RIGHT);
306 tmpActor.SetAnchorPoint(AnchorPoint::TOP_RIGHT); 306 tmpActor.SetAnchorPoint(AnchorPoint::TOP_RIGHT);
@@ -331,7 +331,7 @@ void NewWindowController::AddTextLabel() @@ -331,7 +331,7 @@ void NewWindowController::AddTextLabel()
331 mContentLayer.Add( mTextActor ); 331 mContentLayer.Add( mTextActor );
332 } 332 }
333 333
334 -ImageActor NewWindowController::CreateBlurredMirrorImage(const char* imageName) 334 +ImageView NewWindowController::CreateBlurredMirrorImage(const char* imageName)
335 { 335 {
336 Image image = ResourceImage::New(imageName); 336 Image image = ResourceImage::New(imageName);
337 337
@@ -346,7 +346,7 @@ ImageActor NewWindowController::CreateBlurredMirrorImage(const char* imageName) @@ -346,7 +346,7 @@ ImageActor NewWindowController::CreateBlurredMirrorImage(const char* imageName)
346 Stage::GetCurrent().Add(gbv); 346 Stage::GetCurrent().Add(gbv);
347 gbv.ActivateOnce(); 347 gbv.ActivateOnce();
348 348
349 - ImageActor blurredActor = ImageActor::New(fbo); 349 + ImageView blurredActor = ImageView::New(fbo);
350 blurredActor.SetSize(FBOSize); 350 blurredActor.SetSize(FBOSize);
351 blurredActor.SetScale(1.0f, -1.0f, 1.0f); 351 blurredActor.SetScale(1.0f, -1.0f, 1.0f);
352 return blurredActor; 352 return blurredActor;
examples/radial-menu/radial-menu-example.cpp
@@ -104,7 +104,7 @@ private: // Member variables @@ -104,7 +104,7 @@ private: // Member variables
104 Application mApplication; ///< The application handle 104 Application mApplication; ///< The application handle
105 Toolkit::Control mView; ///< The toolbar view 105 Toolkit::Control mView; ///< The toolbar view
106 Layer mContents; ///< The toolbar contents pane 106 Layer mContents; ///< The toolbar contents pane
107 - ImageActor mImageActor; ///< Image actor shown by stencil mask 107 + ImageView mImageView; ///< Image view shown by stencil mask
108 Animation mAnimation; 108 Animation mAnimation;
109 AnimState mAnimationState; 109 AnimState mAnimationState;
110 110
@@ -113,7 +113,7 @@ private: // Member variables @@ -113,7 +113,7 @@ private: // Member variables
113 Image mIconStop; 113 Image mIconStop;
114 Image mIconStopSelected; 114 Image mIconStopSelected;
115 Toolkit::PushButton mPlayStopButton; 115 Toolkit::PushButton mPlayStopButton;
116 - ImageActor mDialActor; 116 + ImageView mDialView;
117 RadialSweepView mRadialSweepView1; 117 RadialSweepView mRadialSweepView1;
118 RadialSweepView mRadialSweepView2; 118 RadialSweepView mRadialSweepView2;
119 RadialSweepView mRadialSweepView3; 119 RadialSweepView mRadialSweepView3;
@@ -181,13 +181,13 @@ void RadialMenuExample::OnInit(Application&amp; app) @@ -181,13 +181,13 @@ void RadialMenuExample::OnInit(Application&amp; app)
181 mRadialSweepView3.SetFinalActorAngle(Degree(0)); 181 mRadialSweepView3.SetFinalActorAngle(Degree(0));
182 182
183 Image dial = ResourceImage::New( TEST_DIAL_FILENAME ); 183 Image dial = ResourceImage::New( TEST_DIAL_FILENAME );
184 - mDialActor = ImageActor::New( dial );  
185 - mDialActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );  
186 - mDialActor.SetPositionInheritanceMode(USE_PARENT_POSITION);  
187 - mDialActor.SetScale(scale); 184 + mDialView = ImageView::New( dial );
  185 + mDialView.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
  186 + mDialView.SetPositionInheritanceMode(USE_PARENT_POSITION);
  187 + mDialView.SetScale(scale);
188 Layer dialLayer = Layer::New(); 188 Layer dialLayer = Layer::New();
189 189
190 - dialLayer.Add(mDialActor); 190 + dialLayer.Add( mDialView );
191 dialLayer.SetPositionInheritanceMode(USE_PARENT_POSITION); 191 dialLayer.SetPositionInheritanceMode(USE_PARENT_POSITION);
192 dialLayer.SetSize(stage.GetSize()); 192 dialLayer.SetSize(stage.GetSize());
193 mContents.Add(dialLayer); 193 mContents.Add(dialLayer);
@@ -201,13 +201,13 @@ void RadialMenuExample::OnInit(Application&amp; app) @@ -201,13 +201,13 @@ void RadialMenuExample::OnInit(Application&amp; app)
201 201
202 void RadialMenuExample::StartAnimation() 202 void RadialMenuExample::StartAnimation()
203 { 203 {
204 - mDialActor.SetOpacity(0.0f); 204 + mDialView.SetOpacity(0.0f);
205 mRadialSweepView1.SetOpacity(0.0f); 205 mRadialSweepView1.SetOpacity(0.0f);
206 mAnimation = Animation::New(6.0f); 206 mAnimation = Animation::New(6.0f);
207 mRadialSweepView1.Activate(mAnimation, 0.0f, 3.0f); 207 mRadialSweepView1.Activate(mAnimation, 0.0f, 3.0f);
208 mRadialSweepView2.Activate(mAnimation, 1.5f, 3.0f); 208 mRadialSweepView2.Activate(mAnimation, 1.5f, 3.0f);
209 mRadialSweepView3.Activate(mAnimation, 3.0f, 3.0f); 209 mRadialSweepView3.Activate(mAnimation, 3.0f, 3.0f);
210 - mAnimation.AnimateTo( Property( mDialActor, Actor::Property::COLOR_ALPHA ), 1.0f, AlphaFunction::EASE_IN, TimePeriod( 0.0f, 0.8f ) ); 210 + mAnimation.AnimateTo( Property( mDialView, Actor::Property::COLOR_ALPHA ), 1.0f, AlphaFunction::EASE_IN, TimePeriod( 0.0f, 0.8f ) );
211 mAnimation.AnimateTo( Property( mRadialSweepView1, Actor::Property::COLOR_ALPHA ), 1.0f, AlphaFunction::EASE_IN, TimePeriod( 0.0f, 0.5f ) ); 211 mAnimation.AnimateTo( Property( mRadialSweepView1, Actor::Property::COLOR_ALPHA ), 1.0f, AlphaFunction::EASE_IN, TimePeriod( 0.0f, 0.5f ) );
212 mAnimation.FinishedSignal().Connect( this, &RadialMenuExample::OnAnimationFinished ); 212 mAnimation.FinishedSignal().Connect( this, &RadialMenuExample::OnAnimationFinished );
213 213
@@ -263,10 +263,10 @@ RadialSweepView RadialMenuExample::CreateSweepView( std::string imageName, @@ -263,10 +263,10 @@ RadialSweepView RadialMenuExample::CreateSweepView( std::string imageName,
263 { 263 {
264 // Create the image 264 // Create the image
265 Image image = ResourceImage::New(imageName); 265 Image image = ResourceImage::New(imageName);
266 - mImageActor = ImageActor::New(image);  
267 - mImageActor.SetParentOrigin(ParentOrigin::CENTER);  
268 - mImageActor.SetAnchorPoint(AnchorPoint::CENTER);  
269 - mImageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); 266 + mImageView = ImageView::New(image);
  267 + mImageView.SetParentOrigin(ParentOrigin::CENTER);
  268 + mImageView.SetAnchorPoint(AnchorPoint::CENTER);
  269 + mImageView.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
270 270
271 // Create the stencil 271 // Create the stencil
272 const ImageDimensions imageSize = ResourceImage::GetImageSize(imageName); 272 const ImageDimensions imageSize = ResourceImage::GetImageSize(imageName);
@@ -281,8 +281,8 @@ RadialSweepView RadialMenuExample::CreateSweepView( std::string imageName, @@ -281,8 +281,8 @@ RadialSweepView RadialMenuExample::CreateSweepView( std::string imageName,
281 radialSweepView.SetEasingFunction( Dali::AlphaFunction::EASE_IN_OUT ); 281 radialSweepView.SetEasingFunction( Dali::AlphaFunction::EASE_IN_OUT );
282 radialSweepView.SetPositionInheritanceMode(USE_PARENT_POSITION); 282 radialSweepView.SetPositionInheritanceMode(USE_PARENT_POSITION);
283 mContents.Add(radialSweepView); 283 mContents.Add(radialSweepView);
284 - radialSweepView.Add( mImageActor );  
285 - mImageActor.SetPositionInheritanceMode(USE_PARENT_POSITION); 284 + radialSweepView.Add( mImageView );
  285 + mImageView.SetPositionInheritanceMode(USE_PARENT_POSITION);
286 286
287 return radialSweepView; 287 return radialSweepView;
288 } 288 }
examples/scroll-view/scroll-view-example.cpp
@@ -286,7 +286,7 @@ private: @@ -286,7 +286,7 @@ private:
286 { 286 {
287 for(int column = 0;column<imageColumns;column++) 287 for(int column = 0;column<imageColumns;column++)
288 { 288 {
289 - ImageActor image = CreateImage( GetNextImagePath(), imageSize.x, imageSize.y ); 289 + ImageView image = CreateImage( GetNextImagePath(), imageSize.x, imageSize.y );
290 290
291 image.SetParentOrigin( ParentOrigin::CENTER ); 291 image.SetParentOrigin( ParentOrigin::CENTER );
292 image.SetAnchorPoint( AnchorPoint::CENTER ); 292 image.SetAnchorPoint( AnchorPoint::CENTER );
@@ -458,11 +458,11 @@ private: @@ -458,11 +458,11 @@ private:
458 * @param[in] width the width of the image in texels 458 * @param[in] width the width of the image in texels
459 * @param[in] height the height of the image in texels. 459 * @param[in] height the height of the image in texels.
460 */ 460 */
461 - ImageActor CreateImage( const std::string& filename, unsigned int width = IMAGE_THUMBNAIL_WIDTH, unsigned int height = IMAGE_THUMBNAIL_HEIGHT ) 461 + ImageView CreateImage( const std::string& filename, unsigned int width = IMAGE_THUMBNAIL_WIDTH, unsigned int height = IMAGE_THUMBNAIL_HEIGHT )
462 { 462 {
463 Image img = ResourceImage::New(filename, ImageDimensions( width, height ), Dali::FittingMode::SCALE_TO_FILL, Dali::SamplingMode::BOX_THEN_LINEAR ); 463 Image img = ResourceImage::New(filename, ImageDimensions( width, height ), Dali::FittingMode::SCALE_TO_FILL, Dali::SamplingMode::BOX_THEN_LINEAR );
464 464
465 - ImageActor actor = ImageActor::New(img); 465 + ImageView actor = ImageView::New(img);
466 actor.SetName( filename ); 466 actor.SetName( filename );
467 actor.SetParentOrigin(ParentOrigin::CENTER); 467 actor.SetParentOrigin(ParentOrigin::CENTER);
468 actor.SetAnchorPoint(AnchorPoint::CENTER); 468 actor.SetAnchorPoint(AnchorPoint::CENTER);
examples/size-negotiation/size-negotiation-example.cpp
@@ -428,7 +428,7 @@ public: @@ -428,7 +428,7 @@ public:
428 { 428 {
429 mPopup = CreatePopup(); 429 mPopup = CreatePopup();
430 430
431 - ImageActor image = ImageActor::New( ResourceImage::New( IMAGE2 ) ); 431 + Toolkit::ImageView image = Toolkit::ImageView::New( IMAGE2 );
432 image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); 432 image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
433 image.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT ); 433 image.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
434 image.SetPadding( Padding( 20.0f, 20.0f, 20.0f, 20.0f ) ); 434 image.SetPadding( Padding( 20.0f, 20.0f, 20.0f, 20.0f ) );
@@ -444,7 +444,7 @@ public: @@ -444,7 +444,7 @@ public:
444 mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); 444 mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
445 mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) ); 445 mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
446 446
447 - ImageActor image = ImageActor::New( ResourceImage::New( IMAGE2 ) ); 447 + Toolkit::ImageView image = Toolkit::ImageView::New( IMAGE2 );
448 image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); 448 image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
449 449
450 mPopup.Add( image ); 450 mPopup.Add( image );
@@ -458,7 +458,7 @@ public: @@ -458,7 +458,7 @@ public:
458 mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); 458 mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
459 mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) ); 459 mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
460 460
461 - ImageActor image = ImageActor::New( ResourceImage::New( IMAGE2 ) ); 461 + Toolkit::ImageView image = Toolkit::ImageView::New( IMAGE2 );
462 image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); 462 image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
463 image.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO ); 463 image.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
464 464
@@ -473,7 +473,7 @@ public: @@ -473,7 +473,7 @@ public:
473 mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); 473 mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
474 mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) ); 474 mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
475 475
476 - ImageActor image = ImageActor::New( ResourceImage::New( IMAGE2 ) ); 476 + Toolkit::ImageView image = Toolkit::ImageView::New( IMAGE2 );
477 image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); 477 image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
478 image.SetSizeScalePolicy( SizeScalePolicy::FILL_WITH_ASPECT_RATIO ); 478 image.SetSizeScalePolicy( SizeScalePolicy::FILL_WITH_ASPECT_RATIO );
479 479
@@ -555,7 +555,7 @@ public: @@ -555,7 +555,7 @@ public:
555 555
556 // Image 556 // Image
557 { 557 {
558 - ImageActor image = ImageActor::New( ResourceImage::New( IMAGE1 ) ); 558 + Toolkit::ImageView image = Toolkit::ImageView::New( IMAGE1 );
559 image.SetName( "COMPLEX_IMAGE" ); 559 image.SetName( "COMPLEX_IMAGE" );
560 image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); 560 image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
561 image.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT ); 561 image.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
examples/text-message-field/text-message-field-example.cpp
@@ -77,8 +77,7 @@ public: @@ -77,8 +77,7 @@ public:
77 const Size mTargetActorSize( mStageSize.width, DESKTOP_SIZE.height ); 77 const Size mTargetActorSize( mStageSize.width, DESKTOP_SIZE.height );
78 78
79 // Create Desktop 79 // Create Desktop
80 - ResourceImage backgroundImage = ResourceImage::New( DESKTOP_IMAGE );  
81 - ImageActor desktop = ImageActor::New( backgroundImage ); 80 + ImageView desktop = ImageView::New( DESKTOP_IMAGE );
82 desktop.SetName("desktopActor"); 81 desktop.SetName("desktopActor");
83 desktop.SetAnchorPoint( AnchorPoint::TOP_LEFT ); 82 desktop.SetAnchorPoint( AnchorPoint::TOP_LEFT );
84 desktop.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS ); 83 desktop.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );