projects
/
platform
/
core
/
uifw
/
dali-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove dali-any from Property::Value - reimplement multivalue using more efficient...
[platform/core/uifw/dali-core.git]
/
dali
/
internal
/
event
/
images
/
resource-image-impl.cpp
diff --git
a/dali/internal/event/images/resource-image-impl.cpp
b/dali/internal/event/images/resource-image-impl.cpp
index
b2a937d
..
7463eac
100644
(file)
--- a/
dali/internal/event/images/resource-image-impl.cpp
+++ b/
dali/internal/event/images/resource-image-impl.cpp
@@
-18,6
+18,9
@@
// CLASS HEADER
#include <dali/internal/event/images/resource-image-impl.h>
// CLASS HEADER
#include <dali/internal/event/images/resource-image-impl.h>
+// EXTERNAL INCLUDES
+#include <cstring> // for strcmp
+
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
#include <dali/public-api/object/type-registry.h>
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
#include <dali/public-api/object/type-registry.h>
@@
-38,15
+41,19
@@
namespace Internal
namespace
{
namespace
{
+// Signals
+
+const char* const SIGNAL_IMAGE_LOADING_FINISHED = "image-loading-finished";
+
BaseHandle CreateImage()
{
ImagePtr image = ResourceImage::New();
return Dali::Image(image.Get());
}
BaseHandle CreateImage()
{
ImagePtr image = ResourceImage::New();
return Dali::Image(image.Get());
}
-TypeRegistration mType( typeid(
Dali::ResourceImage), typeid(Dali::Image
), CreateImage );
+TypeRegistration mType( typeid(
Dali::ResourceImage ), typeid( Dali::Image
), CreateImage );
-Dali::SignalConnectorType signalConnector1(
mType, Dali::ResourceImage::SIGNAL_IMAGE_LOADING_FINISHED, &ResourceImage::DoConnectSignal
);
+Dali::SignalConnectorType signalConnector1(
mType, SIGNAL_IMAGE_LOADING_FINISHED, &ResourceImage::DoConnectSignal
);
}
}
@@
-64,7
+71,7
@@
ResourceImagePtr ResourceImage::New()
return image;
}
return image;
}
-ResourceImagePtr ResourceImage::New( const std::string& url, const
Dali::
ImageAttributes& attributes, LoadPolicy loadPol, ReleasePolicy releasePol )
+ResourceImagePtr ResourceImage::New( const std::string& url, const ImageAttributes& attributes, LoadPolicy loadPol, ReleasePolicy releasePol )
{
ResourceImagePtr image;
if( IsNinePatch( url ) )
{
ResourceImagePtr image;
if( IsNinePatch( url ) )
@@
-112,14
+119,10
@@
bool ResourceImage::DoConnectSignal( BaseObject* object, ConnectionTrackerInterf
DALI_ASSERT_DEBUG( dynamic_cast<ResourceImage*>( object ) && "Resource ticket not ImageTicket subclass for image resource.\n" );
ResourceImage* image = static_cast<ResourceImage*>(object);
DALI_ASSERT_DEBUG( dynamic_cast<ResourceImage*>( object ) && "Resource ticket not ImageTicket subclass for image resource.\n" );
ResourceImage* image = static_cast<ResourceImage*>(object);
- if(
Dali::ResourceImage::SIGNAL_IMAGE_LOADING_FINISHED == signalName
)
+ if(
0 == strcmp( signalName.c_str(), SIGNAL_IMAGE_LOADING_FINISHED )
)
{
image->LoadingFinishedSignal().Connect( tracker, functor );
}
{
image->LoadingFinishedSignal().Connect( tracker, functor );
}
- else if(Dali::ResourceImage::SIGNAL_IMAGE_UPLOADED == signalName)
- {
- image->UploadedSignal().Connect( tracker, functor );
- }
else
{
// signalName does not match any signal
else
{
// signalName does not match any signal
@@
-129,7
+132,7
@@
bool ResourceImage::DoConnectSignal( BaseObject* object, ConnectionTrackerInterf
return connected;
}
return connected;
}
-const
Dali::
ImageAttributes& ResourceImage::GetAttributes() const
+const ImageAttributes& ResourceImage::GetAttributes() const
{
if( mTicket )
{
{
if( mTicket )
{
@@
-163,8
+166,6
@@
unsigned int ResourceImage::GetWidth() const
Size size;
mImageFactory.GetImageSize( mRequest, mTicket, size );
mWidth = size.width;
Size size;
mImageFactory.GetImageSize( mRequest, mTicket, size );
mWidth = size.width;
- // The app will probably ask for the height immediately, so don't waste the synchronous file IO that ImageFactory may have just done:
- DALI_ASSERT_DEBUG( 0 == mHeight || unsigned(size.height) == mHeight );
if( 0 == mHeight )
{
mHeight = size.height;
if( 0 == mHeight )
{
mHeight = size.height;
@@
-180,7
+181,6
@@
unsigned int ResourceImage::GetHeight() const
Size size;
mImageFactory.GetImageSize( mRequest, mTicket, size );
mHeight = size.height;
Size size;
mImageFactory.GetImageSize( mRequest, mTicket, size );
mHeight = size.height;
- DALI_ASSERT_DEBUG( 0 == mWidth || unsigned(size.width) == mWidth );
if( 0 == mWidth )
{
mWidth = size.width;
if( 0 == mWidth )
{
mWidth = size.width;