X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Fimages%2Fimage-impl.h;h=de6df5078790e81d689d14299734df28c7a8d8d9;hb=95354af5ef0a4f8e55cb2503c06dd15a86e02b8f;hp=0d5a9dadc73c4314c1b671796a0f52acff7c335d;hpb=3b40105fa98689b9356125ffa3da85c85d07bc71;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/images/image-impl.h b/dali/internal/event/images/image-impl.h index 0d5a9da..de6df50 100644 --- a/dali/internal/event/images/image-impl.h +++ b/dali/internal/event/images/image-impl.h @@ -24,8 +24,7 @@ // INTERNAL INCLUDES #include #include -#include -#include +#include namespace Dali { @@ -33,57 +32,29 @@ namespace Dali namespace Internal { -typedef Dali::Image::ReleasePolicy ReleasePolicy; - class Image; class ImageFactory; typedef IntrusivePtr ImagePtr; -const ReleasePolicy IMAGE_RELEASE_POLICY_DEFAULT = Dali::Image::NEVER; - /** * Image represents an image resource that can be added to actors etc. * When the Image object is created, resource loading will be attempted. * Provided this is successful, the resource will exist until the Image is destroyed. */ -class Image : public BaseObject, public ResourceTicketObserver +class Image : public BaseObject { public: /** - * @copydoc Dali::Image::GetReleasePolicy() - */ - ReleasePolicy GetReleasePolicy () const { return mReleasePolicy; } - - /** * @copydoc Dali::Image::UploadedSignal() */ Dali::Image::ImageSignalType& UploadedSignal() { return mUploaded; } /** - * Connects a callback function with the object's signals. - * @param[in] object The object providing the signal. - * @param[in] tracker Used to disconnect the signal. - * @param[in] signalName The signal to connect to. - * @param[in] functor A newly allocated FunctorDelegate. - * @return True if the signal was connected. - * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor. - */ - static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ); - - /** - * returns the Id used for lookups - * @note if LoadPolicy::OnDemand is used and Image is off Stage, this will return 0. - * @return the unique ID of the image data resource. This is actually also the same as Dali Texture id. - */ - ResourceId GetResourceId() const; - - /** * Get the width of the image. * Only to be used after the image has finished loading. * (Ticket's LoadingSucceeded callback was called) * The returned value will reflect the true image dimensions once the asynchronous loading has finished. - * Connect to SignalLoadingFinished or use GetLoadingState to make sure this value is actual. * @pre image should be loaded */ virtual unsigned int GetWidth() const; @@ -93,7 +64,6 @@ public: * Only to be used after the image has finished loading. * (Ticket's LoadingSucceeded callback was called) * The returned value will reflect the true image dimensions once the asynchronous loading has finished. - * Connect to SignalLoadingFinished or use GetLoadingState to make sure this value is actual. * @pre image should be loaded */ virtual unsigned int GetHeight() const; @@ -104,32 +74,13 @@ public: */ virtual Vector2 GetNaturalSize() const; -public: // From ResourceTicketObserver - /** - * @copydoc Dali::Internal::ResourceTicketObserver::ResourceLoadingFailed() + * Returns a pointer to the internal texture used by the image */ - virtual void ResourceLoadingFailed(const ResourceTicket& ticket); - - /** - * @copydoc Dali::Internal::ResourceTicketObserver::ResourceLoadingSucceeded() - */ - virtual void ResourceLoadingSucceeded(const ResourceTicket& ticket); - - /** - * @copydoc Dali::Internal::ResourceTicketObserver::ResourceUploaded() - */ - virtual void ResourceUploaded(const ResourceTicket& ticket); - - /** - * @copydoc Dali::Internal::ResourceTicketObserver::ResourceSavingSucceeded() - */ - virtual void ResourceSavingSucceeded( const ResourceTicket& ticket ); - - /** - * @copydoc Dali::Internal::ResourceTicketObserver::ResourceSavingFailed() - */ - virtual void ResourceSavingFailed( const ResourceTicket& ticket ); + Texture* GetTexture() const + { + return mTexture.Get(); + } public: @@ -153,7 +104,7 @@ protected: /** * Constructor, with default parameters */ - Image( ReleasePolicy releasePol = IMAGE_RELEASE_POLICY_DEFAULT ); + Image(); /** * Second stage initialization @@ -162,15 +113,13 @@ protected: protected: - ResourceTicketPtr mTicket; ///< smart pointer to the ticket object that gets completed when load finishes + TexturePtr mTexture; ///< smart pointer to the texture used by the image - mutable unsigned int mWidth; ///< natural width of the image, needs to be mutable for lazy resolving and as the API for GetWidth is const - mutable unsigned int mHeight; ///< natural height of the image, needs to be mutable for lazy resolving and as the API for GetHeight is const + unsigned int mWidth; ///< natural width of the image + unsigned int mHeight; ///< natural height of the image unsigned int mConnectionCount; ///< number of on-stage objects using this image - ReleasePolicy mReleasePolicy : 2; ///< 2 bits is enough space - private: Dali::Image::ImageSignalType mUploaded;