-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 );
-
-}
-
-ImagePtr Image::New( NativeImage& nativeImg )
-{
- ImagePtr image = new Image;
- image->Initialize();
-
- ResourceClient &resourceClient = ThreadLocalStorage::Get().GetResourceClient();
-
- image->mWidth = nativeImg.GetWidth();
- image->mHeight = nativeImg.GetHeight();
-
- const ResourceTicketPtr& ticket = resourceClient.AddNativeImage( nativeImg );
- DALI_ASSERT_DEBUG( dynamic_cast<ImageTicket*>( ticket.Get() ) && "Resource ticket not ImageTicket subclass for image resource.\n" );
- image->mTicket = static_cast<ImageTicket*>(ticket.Get());
- image->mTicket->AddObserver( *image );
-
- return image;
-}
-
-bool Image::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
-{
- bool connected( true );
- DALI_ASSERT_DEBUG( dynamic_cast<Image*>( object ) && "Resource ticket not ImageTicket subclass for image resource.\n" );
- Image* image = static_cast<Image*>(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
-}
-