X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=dali%2Finternal%2Fevent%2Fimages%2Fimage-impl.cpp;h=49d7f54350cca2c24bba6a78d1006d33339820f0;hb=65bb67c665fe465e388e8510eeb5fadda45cf202;hp=9a9ccb9f6eb1b1c49d0946680a52bb87ec65344f;hpb=3b40105fa98689b9356125ffa3da85c85d07bc71;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/images/image-impl.cpp b/dali/internal/event/images/image-impl.cpp index 9a9ccb9..49d7f54 100644 --- a/dali/internal/event/images/image-impl.cpp +++ b/dali/internal/event/images/image-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,14 +18,15 @@ // CLASS HEADER #include +// EXTERNAL INCLUDES +#include // for strcmp + // INTERNAL INCLUDES #include #include #include -#include #include -#include #include using namespace Dali::Integration; @@ -36,70 +37,6 @@ namespace Dali namespace Internal { -namespace -{ - -// Signals - -const char* const SIGNAL_IMAGE_UPLOADED = "uploaded"; - -TypeRegistration mType( typeid( Dali::Image ), typeid( Dali::BaseHandle ), NULL ); - -Dali::SignalConnectorType signalConnector1( mType, SIGNAL_IMAGE_UPLOADED, &Image::DoConnectSignal ); - -} - -bool Image::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ) -{ - bool connected( true ); - DALI_ASSERT_DEBUG( dynamic_cast( object ) && "Resource ticket not ImageTicket subclass for image resource.\n" ); - Image* image = static_cast(object); - - if( 0 == strcmp( signalName.c_str(), SIGNAL_IMAGE_UPLOADED ) ) - { - image->UploadedSignal().Connect( tracker, functor ); - } - else - { - // signalName does not match any signal - connected = false; - } - - return connected; -} - -ResourceId Image::GetResourceId() const -{ - ResourceId ret = mTicket ? mTicket->GetId() : 0; - - return ret; -} - -void Image::ResourceLoadingFailed(const ResourceTicket& ticket) -{ - // do nothing -} - -void Image::ResourceLoadingSucceeded(const ResourceTicket& ticket) -{ - // do nothing -} - -void Image::ResourceUploaded(const ResourceTicket& ticket) -{ - mUploaded.Emit( Dali::Image( this ) ); -} - -void Image::ResourceSavingSucceeded( const ResourceTicket& ticket ) -{ - // do nothing -} - -void Image::ResourceSavingFailed( const ResourceTicket& ticket ) -{ - // do nothing -} - unsigned int Image::GetWidth() const { return mWidth; @@ -112,25 +49,19 @@ unsigned int Image::GetHeight() const Vector2 Image::GetNaturalSize() const { - return Vector2( mWidth, mHeight ); + return Vector2( static_cast( mWidth ), static_cast( mHeight ) ); } -Image::Image( ReleasePolicy releasePol ) -: mWidth( 0 ), +Image::Image() +: mTexture(), + mWidth( 0 ), mHeight( 0 ), - mConnectionCount( 0 ), - mReleasePolicy( releasePol ) + mConnectionCount( 0 ) { } Image::~Image() { - if( mTicket ) - { - mTicket->RemoveObserver( *this ); - mTicket.Reset(); - } - if( Stage::IsInstalled() ) { UnregisterObject();