idlehomescreen/xmluirendering/renderingplugins/xnbitmapfactory/src/xnbitmapadapter.cpp
--- a/idlehomescreen/xmluirendering/renderingplugins/xnbitmapfactory/src/xnbitmapadapter.cpp Tue May 25 12:29:32 2010 +0300
+++ b/idlehomescreen/xmluirendering/renderingplugins/xnbitmapfactory/src/xnbitmapadapter.cpp Wed Jun 09 09:29:04 2010 +0300
@@ -20,7 +20,7 @@
#include "xndomproperty.h"
#include "xnproperty.h"
#include "xncontroladapter.h"
-
+#include "xnimagedecoder.h"
#include "xnbitmapadapter.h"
_LIT(KSkin, "skin(");
@@ -55,6 +55,8 @@
iAreBitmapsLoaded = EFalse;
iFallbackPathChange = ETrue;
+
+ iDecoder = CXnImageDecoder::NewL( *this, iCoeEnv->FsSession() );
}
// -----------------------------------------------------------------------------
@@ -73,6 +75,7 @@
//
CXnBitmapAdapter::~CXnBitmapAdapter()
{
+ delete iDecoder;
delete iPath;
delete iFallbackPath;
}
@@ -82,7 +85,9 @@
// -----------------------------------------------------------------------------
//
void CXnBitmapAdapter::SetContentBitmaps(CFbsBitmap* aBitmap, CFbsBitmap* aMask)
- {
+ {
+ iDecoder->Cancel();
+
CXnControlAdapter::SetContentBitmaps( aBitmap, aMask );
iAreBitmapsSet = ETrue;
@@ -91,6 +96,20 @@
}
// -----------------------------------------------------------------------------
+// CXnBitmapAdapter::SetContentBitmaps
+// -----------------------------------------------------------------------------
+//
+void CXnBitmapAdapter::SetContentBitmaps( TFileName& aFilename )
+ {
+ TRAPD( err, iDecoder->DecodeL( aFilename ) );
+
+ if ( err )
+ {
+ SetContentBitmaps( NULL, NULL );
+ }
+ }
+
+// -----------------------------------------------------------------------------
// CXnBitmapAdapter::ContentBitmaps
// -----------------------------------------------------------------------------
//
@@ -100,15 +119,6 @@
}
// -----------------------------------------------------------------------------
-// CXnBitmapAdapter::Draw
-// -----------------------------------------------------------------------------
-//
-void CXnBitmapAdapter::Draw(const TRect& aRect) const
- {
- CXnControlAdapter::Draw( aRect );
- }
-
-// -----------------------------------------------------------------------------
// CXnBitmapAdapter::SizeChanged
// -----------------------------------------------------------------------------
//
@@ -190,25 +200,6 @@
}
// -----------------------------------------------------------------------------
-// CXnTextAdapter::HandleResourceChange
-// -----------------------------------------------------------------------------
-//
-void CXnBitmapAdapter::HandleScreenDeviceChangedL( )
- {
- CXnControlAdapter::HandleScreenDeviceChangedL();
- }
-
-// -----------------------------------------------------------------------------
-// CXnBitmapAdapter::HandlePointerEventL
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-void CXnBitmapAdapter::HandlePointerEventL( const TPointerEvent& aPointerEvent )
- {
- CXnControlAdapter::HandlePointerEventL( aPointerEvent );
- }
-
-// -----------------------------------------------------------------------------
// CXnBitmapAdapter::SkinChanged
// -----------------------------------------------------------------------------
//