Revert "[Tizen] Revert "Remove TypeRegistration from deprecated Image classes""
[platform/core/uifw/dali-core.git] / dali / internal / event / images / image-impl.cpp
index e90ffeb..49d7f54 100644 (file)
@@ -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.
@@ -26,9 +26,7 @@
 #include <dali/public-api/object/type-registry.h>
 
 #include <dali/integration-api/debug.h>
-#include <dali/internal/event/resources/resource-ticket.h>
 #include <dali/internal/event/common/thread-local-storage.h>
-#include <dali/internal/event/resources/resource-client.h>
 #include <dali/internal/event/common/stage-impl.h>
 
 using namespace Dali::Integration;
@@ -39,60 +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<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 ) );
-}
-
 unsigned int Image::GetWidth() const
 {
   return mWidth;
@@ -105,11 +49,12 @@ unsigned int Image::GetHeight() const
 
 Vector2 Image::GetNaturalSize() const
 {
-  return Vector2( mWidth, mHeight );
+  return Vector2( static_cast<float>( mWidth ), static_cast<float>( mHeight ) );
 }
 
 Image::Image()
-: mWidth( 0 ),
+: mTexture(),
+  mWidth( 0 ),
   mHeight( 0 ),
   mConnectionCount( 0 )
 {
@@ -117,12 +62,6 @@ Image::Image()
 
 Image::~Image()
 {
-  if( mTicket )
-  {
-    mTicket->RemoveObserver( *this );
-    mTicket.Reset();
-  }
-
   if( Stage::IsInstalled() )
   {
     UnregisterObject();