Integration::ResourcePointer resourcePtr(bitmap);
platform.SetSynchronouslyLoadedResource( resourcePtr );
- Image image = ResourceImage::New( "blah.#.png" );
+ std::string url( "blah.#.png" );
+ Image image = ResourceImage::New( url );
tet_infoline("Assign image to image rendering actor");
Actor actor = CreateRenderableActor( image );
tet_infoline("Downcast Image to a nine-patch image\n");
NinePatchImage ninePatchImage = NinePatchImage::DownCast( image );
+ DALI_TEST_EQUALS( url, ninePatchImage.GetUrl(), TEST_LOCATION );
+
return ninePatchImage;
}
DALI_TEST_CHECK( !image );
// initialise handle
- image = NinePatchImage::New( "blah.#.png" );
+ std::string url("blah.#.png");
+ image = NinePatchImage::New( url );
DALI_TEST_CHECK( image );
+
+ DALI_TEST_EQUALS( url, image.GetUrl(), TEST_LOCATION );
+
END_TEST;
}
: ResourceImage(),
mParsedBorder(false)
{
+ mUrl = filename;
ThreadLocalStorage& tls = ThreadLocalStorage::Get();
mResourceClient = &tls.GetResourceClient();
return cropped;
}
+const std::string& NinePatchImage::GetUrl() const
+{
+ return mUrl;
+}
+
void NinePatchImage::Connect()
{
if( !mTicket )
*/
static bool IsNinePatchUrl( const std::string& url );
+private: // from ResourceImage
+
+ /**
+ * @copydoc ResourceImage::GetUrl()
+ */
+ virtual const std::string& GetUrl() const;
protected: // From Resource
/**
private:
ResourceClient* mResourceClient;
Integration::BitmapPtr mBitmap;
+ std::string mUrl;
StretchRanges mStretchPixelsX; //< The horizontal stretchable pixels in the cropped image space
StretchRanges mStretchPixelsY; //< The vertical stretchable pixels in the cropped image space
Rect<int> mChildRectangle;
/**
* @copydoc Dali::ResourceImage::GetUrl()
+ * virtual so deriving class can override it
*/
- const std::string& GetUrl() const;
+ virtual const std::string& GetUrl() const;
/**
* @copydoc Dali::ResourceImage::Reload()