diff --git a/demo/dali-table-view.cpp b/demo/dali-table-view.cpp index e72fba7..bbe7495 100644 --- a/demo/dali-table-view.cpp +++ b/demo/dali-table-view.cpp @@ -88,10 +88,10 @@ const float BUBBLE_MAX_Z = 0.0f; /** * Creates the background image */ -ImageActor CreateBackground( std::string imagePath ) +ImageView CreateBackground( std::string imagePath ) { Image image = ResourceImage::New( imagePath ); - ImageActor background = ImageActor::New( image ); + ImageView background = ImageView::New( image ); background.SetName( "BACKGROUND" ); background.SetAnchorPoint( AnchorPoint::CENTER ); background.SetParentOrigin( ParentOrigin::CENTER ); @@ -153,7 +153,6 @@ DaliTableView::DaliTableView( Application& application ) mBackgroundLayer(), mRootActor(), mRotateAnimation(), - mBackground(), mPressedAnimation(), mScrollViewLayer(), mScrollView(), @@ -209,7 +208,7 @@ void DaliTableView::Initialize( Application& application ) const Vector2 stageSize = Stage::GetCurrent().GetSize(); // Background - Actor background = CreateBackground( mBackgroundImagePath ); + ImageView background = CreateBackground( mBackgroundImagePath ); Stage::GetCurrent().Add( background ); // Render entire content as overlays, as is all on same 2D plane. @@ -230,7 +229,7 @@ void DaliTableView::Initialize( Application& application ) mRootActor.SetFitHeight( 0 ); // Add logo - Dali::ImageActor logo = CreateLogo( LOGO_PATH ); + ImageView logo = CreateLogo( LOGO_PATH ); logo.SetName( "LOGO_IMAGE" ); logo.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); 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 } } -ImageActor DaliTableView::CreateLogo( std::string imagePath ) +ImageView DaliTableView::CreateLogo( std::string imagePath ) { Image image = ResourceImage::New( imagePath ); - ImageActor logo = ImageActor::New( image ); + ImageView logo = ImageView::New( image ); logo.SetAnchorPoint( AnchorPoint::CENTER ); logo.SetParentOrigin( ParentOrigin::CENTER ); diff --git a/demo/dali-table-view.h b/demo/dali-table-view.h index c8fcf58..bbc4d52 100644 --- a/demo/dali-table-view.h +++ b/demo/dali-table-view.h @@ -318,7 +318,7 @@ private: // Application callbacks & implementation * * @return The created image actor */ - Dali::ImageActor CreateLogo( std::string imagePath ); + Dali::Toolkit::ImageView CreateLogo( std::string imagePath ); /** * Timer handler for ending background animation @@ -392,7 +392,6 @@ private: Dali::Layer mBackgroundLayer; ///< Background resides on a separate layer. Dali::Toolkit::TableView mRootActor; ///< All content (excluding background is anchored to this Actor) Dali::Animation mRotateAnimation; ///< Animation to rotate and resize mRootActor. - Dali::ImageActor mBackground; ///< Background's static image. Dali::Animation mPressedAnimation; ///< Button press scaling animation. Dali::Layer mScrollViewLayer; ///< ScrollView resides on a separate layer. Dali::Toolkit::ScrollView mScrollView; ///< ScrollView container (for all Examples) diff --git a/examples/atlas/atlas-example.cpp b/examples/atlas/atlas-example.cpp index a499242..425fd44 100644 --- a/examples/atlas/atlas-example.cpp +++ b/examples/atlas/atlas-example.cpp @@ -90,7 +90,7 @@ public: mAtlas.Upload( DALI_IMAGE_DIR "icon-item-view-layout-spiral.png", 250, 130 ); UploadBufferImages(); - ImageActor imageActor1 = ImageActor::New( mAtlas ); + Toolkit::ImageView imageActor1 = Toolkit::ImageView::New( mAtlas ); imageActor1.SetY(-170.f); imageActor1.SetParentOrigin(ParentOrigin::CENTER); mContentLayer.Add( imageActor1 ); @@ -109,19 +109,20 @@ public: atlas2.Upload( DALI_IMAGE_DIR "gallery-small-7.jpg", 268, 268 ); - ImageActor imageActor2 = ImageActor::New( atlas2 ); - imageActor2.SetY(200.f); - imageActor2.SetZ(-1.f); - imageActor2.SetParentOrigin(ParentOrigin::CENTER); - mContentLayer.Add( imageActor2 ); + Toolkit::ImageView imageView = Toolkit::ImageView::New( DALI_IMAGE_DIR "gallery-small-1.jpg" ); + + imageView.SetY(200.f); + imageView.SetZ(-1.f); + imageView.SetParentOrigin(ParentOrigin::CENTER); + mContentLayer.Add( imageView ); mPanGestureDetector = PanGestureDetector::New(); - mPanGestureDetector.DetectedSignal().Connect(this, &AtlasController::OnPanGesture); - mPanGestureDetector.Attach(imageActor1); - mPanGestureDetector.Attach(imageActor2); + mPanGestureDetector.DetectedSignal().Connect( this, &AtlasController::OnPanGesture ); + mPanGestureDetector.Attach( imageActor1 ); + mPanGestureDetector.Attach( imageView ); - stage.ContextLostSignal().Connect(this, &AtlasController::OnContextLost); - stage.ContextRegainedSignal().Connect(this, &AtlasController::OnContextRegained); + stage.ContextLostSignal().Connect( this, &AtlasController::OnContextLost ); + stage.ContextRegainedSignal().Connect( this, &AtlasController::OnContextRegained ); } void UploadBufferImages() diff --git a/examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp b/examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp index 49ba4ed..65068fc 100644 --- a/examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp +++ b/examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp @@ -171,7 +171,7 @@ public: // Background image: ResourceImage backgroundImage = ResourceImage::New( BACKGROUND_IMAGE, ImageDimensions( stage.GetSize().width, stage.GetSize().height ), FittingMode::SCALE_TO_FILL, SamplingMode::BOX_THEN_LINEAR ); - ImageActor background = ImageActor::New( backgroundImage ); + Toolkit::ImageView background = Toolkit::ImageView::New( backgroundImage ); background.SetZ( -2.0f ); background.SetAnchorPoint( AnchorPoint::TOP_LEFT ); background.SetSize( stage.GetSize() ); @@ -192,34 +192,34 @@ public: widthPixel[1] = 0x4f; widthPixel[2] = 0x4f; - mHeightBox = ImageActor::New( heightBackground ); + mHeightBox = Toolkit::ImageView::New( heightBackground ); mHeightBox.SetOpacity( 0.2f ); stage.Add( mHeightBox ); - mWidthBox = ImageActor::New( widthBackground ); + mWidthBox = Toolkit::ImageView::New( widthBackground ); mWidthBox.SetOpacity( 0.2f ); stage.Add( mWidthBox ); - mDesiredBox = ImageActor::New( desiredBackground ); + mDesiredBox = Toolkit::ImageView::New( desiredBackground ); stage.Add( mDesiredBox ); mDesiredBox.SetSize( stage.GetSize() * mImageStageScale ); mDesiredBox.SetParentOrigin( ParentOrigin::CENTER ); mDesiredBox.SetAnchorPoint( AnchorPoint::CENTER ); mDesiredBox.SetPosition( 0, 0, -1 ); - mDesiredBox.SetSortModifier(4.f); + //mDesiredBox.SetSortModifier(4.f); mHeightBox.SetSize( stage.GetSize().width, (stage.GetSize() * mImageStageScale).height ); mHeightBox.SetParentOrigin( ParentOrigin::CENTER ); mHeightBox.SetAnchorPoint( AnchorPoint::CENTER ); mHeightBox.SetPosition( 0, 0, -1 ); - mHeightBox.SetSortModifier(3.f); + //mHeightBox.SetSortModifier(3.f); mWidthBox.SetSize( (stage.GetSize() * mImageStageScale).width, stage.GetSize().height ); mWidthBox.SetParentOrigin( ParentOrigin::CENTER ); mWidthBox.SetAnchorPoint( AnchorPoint::CENTER ); mWidthBox.SetPosition( 0, 0, -1 ); - mWidthBox.SetSortModifier(2.f); + //mWidthBox.SetSortModifier(2.f); // Make a grab-handle for resizing the image: mGrabCorner = Toolkit::PushButton::New(); @@ -284,7 +284,7 @@ public: // Back and next image buttons in corners of stage: unsigned int playWidth = std::min( stage.GetSize().x * (1 / 5.0f), 58.0f ); Image playImage = ResourceImage::New( DALI_ICON_PLAY, ImageDimensions( playWidth, playWidth ), FittingMode::SHRINK_TO_FIT, SamplingMode::BOX_THEN_LINEAR ); - Actor imagePrevious = ImageActor::New( playImage ); + Toolkit::ImageView imagePrevious = Toolkit::ImageView::New( playImage ); // Last image button: imagePrevious.SetAnchorPoint( AnchorPoint::TOP_LEFT ); @@ -297,7 +297,7 @@ public: imagePrevious.TouchedSignal().Connect( this, &ImageScalingAndFilteringController::OnControlTouched ); // Next image button: - Actor imageNext = ImageActor::New( playImage ); + Toolkit::ImageView imageNext = Toolkit::ImageView::New( playImage ); imageNext.SetAnchorPoint( AnchorPoint::TOP_RIGHT ); imageNext.SetY( playWidth * 0.5f ); imageNext.SetX( stage.GetSize().x - playWidth * 0.5f ); @@ -697,9 +697,9 @@ private: private: Application& mApplication; - ImageActor mDesiredBox; //< Background rectangle to show requested image size. - ImageActor mHeightBox; //< Background horizontal stripe to show requested image height. - ImageActor mWidthBox; //< Background vertical stripe to show requested image width. + Toolkit::ImageView mDesiredBox; //< Background rectangle to show requested image size. + Toolkit::ImageView mHeightBox; //< Background horizontal stripe to show requested image height. + Toolkit::ImageView mWidthBox; //< Background vertical stripe to show requested image width. Toolkit::PushButton mFittingModeButton; Toolkit::PushButton mSamplingModeButton; Toolkit::Popup mPopup; diff --git a/examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp b/examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp index ffa597b..0caf323 100644 --- a/examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp +++ b/examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp @@ -24,7 +24,7 @@ * reduce the image to save memory, improve performance, and potentially display * a better small version of the image than if the default size were loaded. * - * The functions CreateImage and CreateImageActor below show how to build an + * The functions CreateImage and CreateImageView below show how to build an * image using a scaling mode to have %Dali resize it during loading. * * This demo defaults to the SCALE_TO_FILL mode of ImageAttributes which makes @@ -38,7 +38,7 @@ * grid using the button in the top-right of the toolbar. * A single image can be cycled by clicking the image directly. * - * @see CreateImage CreateImageActor + * @see CreateImage CreateImageView */ // EXTERNAL INCLUDES @@ -186,17 +186,17 @@ Image CreateImage(const std::string& filename, unsigned int width, unsigned int } /** - * Creates an ImageActor + * Creates an ImageView * * @param[in] filename The path of the image. * @param[in] width The width of the image in pixels. * @param[in] height The height of the image in pixels. * @param[in] fittingMode The mode to use when scaling the image to fit the desired dimensions. */ -ImageActor CreateImageActor(const std::string& filename, unsigned int width, unsigned int height, Dali::FittingMode::Type fittingMode ) +ImageView CreateImageView(const std::string& filename, unsigned int width, unsigned int height, Dali::FittingMode::Type fittingMode ) { Image img = CreateImage( filename, width, height, fittingMode ); - ImageActor actor = ImageActor::New( img ); + ImageView actor = ImageView::New( img ); actor.SetName( filename ); actor.SetParentOrigin(ParentOrigin::CENTER); actor.SetAnchorPoint(AnchorPoint::CENTER); @@ -460,7 +460,7 @@ public: const Vector2 imageRegionCorner = gridOrigin + cellSize * Vector2( imageSource.cellX, imageSource.cellY ); const Vector2 imagePosition = imageRegionCorner + Vector2( GRID_CELL_PADDING , GRID_CELL_PADDING ) + imageSize * 0.5f; - ImageActor image = CreateImageActor( imageSource.configuration.path, imageSize.x, imageSize.y, fittingMode ); + ImageView image = CreateImageView( imageSource.configuration.path, imageSize.x, imageSize.y, fittingMode ); image.SetPosition( Vector3( imagePosition.x, imagePosition.y, 0 ) ); image.SetSize( imageSize ); image.TouchedSignal().Connect( this, &ImageScalingIrregularGridController::OnTouchImage ); @@ -495,10 +495,10 @@ public: Dali::FittingMode::Type newMode = NextMode( mFittingModes[id] ); const Vector2 imageSize = mSizes[actor.GetId()]; - ImageActor imageActor = ImageActor::DownCast( actor ); - Image oldImage = imageActor.GetImage(); + ImageView imageView = ImageView::DownCast( actor ); + Image oldImage = imageView.GetImage(); Image newImage = CreateImage( ResourceImage::DownCast(oldImage).GetUrl(), imageSize.width + 0.5f, imageSize.height + 0.5f, newMode ); - imageActor.SetImage( newImage ); + imageView.SetImage( newImage ); mFittingModes[id] = newMode; } } @@ -532,17 +532,17 @@ public: for( unsigned i = 0; i < numChildren; ++i ) { - ImageActor gridImageActor = ImageActor::DownCast( mGridActor.GetChildAt( i ) ); - if( gridImageActor ) + ImageView gridImageView = ImageView::DownCast( mGridActor.GetChildAt( i ) ); + if( gridImageView ) { // Cycle the scaling mode options: - const Vector2 imageSize = mSizes[gridImageActor.GetId()]; - Dali::FittingMode::Type newMode = NextMode( mFittingModes[gridImageActor.GetId()] ); - Image oldImage = gridImageActor.GetImage(); + const Vector2 imageSize = mSizes[gridImageView.GetId()]; + Dali::FittingMode::Type newMode = NextMode( mFittingModes[gridImageView.GetId()] ); + Image oldImage = gridImageView.GetImage(); Image newImage = CreateImage(ResourceImage::DownCast(oldImage).GetUrl(), imageSize.width, imageSize.height, newMode ); - gridImageActor.SetImage( newImage ); + gridImageView.SetImage( newImage ); - mFittingModes[gridImageActor.GetId()] = newMode; + mFittingModes[gridImageView.GetId()] = newMode; 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" ) ); } diff --git a/examples/new-window/new-window-example.cpp b/examples/new-window/new-window-example.cpp index a8d6e0b..19c11ff 100644 --- a/examples/new-window/new-window-example.cpp +++ b/examples/new-window/new-window-example.cpp @@ -124,7 +124,7 @@ public: void AddBlendingImageActor(); void AddTextLabel(); - ImageActor CreateBlurredMirrorImage(const char* imageName); + ImageView CreateBlurredMirrorImage(const char* imageName); FrameBufferImage CreateFrameBufferForImage(const char* imageName, Image image, ShaderEffect shaderEffect); void SetUpBubbleEmission( const Vector2& emitPosition, const Vector2& direction ); Geometry CreateMeshGeometry(); @@ -211,16 +211,16 @@ void NewWindowController::Create( Application& app ) mContentLayer.Add(logoLayoutActor); Image image = ResourceImage::New(LOGO_IMAGE); - ImageActor imageActor = ImageActor::New(image); - imageActor.SetName("dali-logo"); - imageActor.SetParentOrigin(ParentOrigin::CENTER); - imageActor.SetAnchorPoint(AnchorPoint::BOTTOM_CENTER); - logoLayoutActor.Add(imageActor); + ImageView imageView = ImageView::New(image); + imageView.SetName("dali-logo"); + imageView.SetParentOrigin(ParentOrigin::CENTER); + imageView.SetAnchorPoint(AnchorPoint::BOTTOM_CENTER); + logoLayoutActor.Add(imageView); - ImageActor mirrorImageActor = CreateBlurredMirrorImage(LOGO_IMAGE); - mirrorImageActor.SetParentOrigin(ParentOrigin::CENTER); - mirrorImageActor.SetAnchorPoint(AnchorPoint::TOP_CENTER); - logoLayoutActor.Add(mirrorImageActor); + ImageView mirrorImageView = CreateBlurredMirrorImage(LOGO_IMAGE); + mirrorImageView.SetParentOrigin(ParentOrigin::CENTER); + mirrorImageView.SetAnchorPoint(AnchorPoint::TOP_CENTER); + logoLayoutActor.Add(mirrorImageView); AddBubbles(stage.GetSize()); AddMeshActor(); @@ -300,7 +300,7 @@ void NewWindowController::AddBlendingImageActor() Image effectImage = ResourceImage::New(EFFECT_IMAGE); FrameBufferImage fb2 = CreateFrameBufferForImage( EFFECT_IMAGE, effectImage, colorModifier ); - ImageActor tmpActor = ImageActor::New(fb2); + ImageView tmpActor = ImageView::New(fb2); mContentLayer.Add(tmpActor); tmpActor.SetParentOrigin(ParentOrigin::CENTER_RIGHT); tmpActor.SetAnchorPoint(AnchorPoint::TOP_RIGHT); @@ -331,7 +331,7 @@ void NewWindowController::AddTextLabel() mContentLayer.Add( mTextActor ); } -ImageActor NewWindowController::CreateBlurredMirrorImage(const char* imageName) +ImageView NewWindowController::CreateBlurredMirrorImage(const char* imageName) { Image image = ResourceImage::New(imageName); @@ -346,7 +346,7 @@ ImageActor NewWindowController::CreateBlurredMirrorImage(const char* imageName) Stage::GetCurrent().Add(gbv); gbv.ActivateOnce(); - ImageActor blurredActor = ImageActor::New(fbo); + ImageView blurredActor = ImageView::New(fbo); blurredActor.SetSize(FBOSize); blurredActor.SetScale(1.0f, -1.0f, 1.0f); return blurredActor; diff --git a/examples/radial-menu/radial-menu-example.cpp b/examples/radial-menu/radial-menu-example.cpp index 95f27e4..00c8cc6 100644 --- a/examples/radial-menu/radial-menu-example.cpp +++ b/examples/radial-menu/radial-menu-example.cpp @@ -104,7 +104,7 @@ private: // Member variables Application mApplication; ///< The application handle Toolkit::Control mView; ///< The toolbar view Layer mContents; ///< The toolbar contents pane - ImageActor mImageActor; ///< Image actor shown by stencil mask + ImageView mImageView; ///< Image view shown by stencil mask Animation mAnimation; AnimState mAnimationState; @@ -113,7 +113,7 @@ private: // Member variables Image mIconStop; Image mIconStopSelected; Toolkit::PushButton mPlayStopButton; - ImageActor mDialActor; + ImageView mDialView; RadialSweepView mRadialSweepView1; RadialSweepView mRadialSweepView2; RadialSweepView mRadialSweepView3; @@ -181,13 +181,13 @@ void RadialMenuExample::OnInit(Application& app) mRadialSweepView3.SetFinalActorAngle(Degree(0)); Image dial = ResourceImage::New( TEST_DIAL_FILENAME ); - mDialActor = ImageActor::New( dial ); - mDialActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); - mDialActor.SetPositionInheritanceMode(USE_PARENT_POSITION); - mDialActor.SetScale(scale); + mDialView = ImageView::New( dial ); + mDialView.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); + mDialView.SetPositionInheritanceMode(USE_PARENT_POSITION); + mDialView.SetScale(scale); Layer dialLayer = Layer::New(); - dialLayer.Add(mDialActor); + dialLayer.Add( mDialView ); dialLayer.SetPositionInheritanceMode(USE_PARENT_POSITION); dialLayer.SetSize(stage.GetSize()); mContents.Add(dialLayer); @@ -201,13 +201,13 @@ void RadialMenuExample::OnInit(Application& app) void RadialMenuExample::StartAnimation() { - mDialActor.SetOpacity(0.0f); + mDialView.SetOpacity(0.0f); mRadialSweepView1.SetOpacity(0.0f); mAnimation = Animation::New(6.0f); mRadialSweepView1.Activate(mAnimation, 0.0f, 3.0f); mRadialSweepView2.Activate(mAnimation, 1.5f, 3.0f); mRadialSweepView3.Activate(mAnimation, 3.0f, 3.0f); - mAnimation.AnimateTo( Property( mDialActor, Actor::Property::COLOR_ALPHA ), 1.0f, AlphaFunction::EASE_IN, TimePeriod( 0.0f, 0.8f ) ); + mAnimation.AnimateTo( Property( mDialView, Actor::Property::COLOR_ALPHA ), 1.0f, AlphaFunction::EASE_IN, TimePeriod( 0.0f, 0.8f ) ); mAnimation.AnimateTo( Property( mRadialSweepView1, Actor::Property::COLOR_ALPHA ), 1.0f, AlphaFunction::EASE_IN, TimePeriod( 0.0f, 0.5f ) ); mAnimation.FinishedSignal().Connect( this, &RadialMenuExample::OnAnimationFinished ); @@ -263,10 +263,10 @@ RadialSweepView RadialMenuExample::CreateSweepView( std::string imageName, { // Create the image Image image = ResourceImage::New(imageName); - mImageActor = ImageActor::New(image); - mImageActor.SetParentOrigin(ParentOrigin::CENTER); - mImageActor.SetAnchorPoint(AnchorPoint::CENTER); - mImageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); + mImageView = ImageView::New(image); + mImageView.SetParentOrigin(ParentOrigin::CENTER); + mImageView.SetAnchorPoint(AnchorPoint::CENTER); + mImageView.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); // Create the stencil const ImageDimensions imageSize = ResourceImage::GetImageSize(imageName); @@ -281,8 +281,8 @@ RadialSweepView RadialMenuExample::CreateSweepView( std::string imageName, radialSweepView.SetEasingFunction( Dali::AlphaFunction::EASE_IN_OUT ); radialSweepView.SetPositionInheritanceMode(USE_PARENT_POSITION); mContents.Add(radialSweepView); - radialSweepView.Add( mImageActor ); - mImageActor.SetPositionInheritanceMode(USE_PARENT_POSITION); + radialSweepView.Add( mImageView ); + mImageView.SetPositionInheritanceMode(USE_PARENT_POSITION); return radialSweepView; } diff --git a/examples/scroll-view/scroll-view-example.cpp b/examples/scroll-view/scroll-view-example.cpp index ce27bc4..f6d9f27 100644 --- a/examples/scroll-view/scroll-view-example.cpp +++ b/examples/scroll-view/scroll-view-example.cpp @@ -286,7 +286,7 @@ private: { for(int column = 0;column