--- a/startupservices/SplashScreen/src/SplashScreen.cpp Thu Aug 19 10:05:08 2010 +0300
+++ b/startupservices/SplashScreen/src/SplashScreen.cpp Tue Aug 31 15:24:25 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -18,11 +18,13 @@
// SYSTEM INCLUDES
#include <w32std.h>
+#include <eikenv.h>
#include <coedef.h>
#include <data_caging_path_literals.hrh>
-#include <splashscreen.mbg>
-#include <AknIconSrvClient.h>
#include <startupdomainpskeys.h>
+#include <SVGEngineInterfaceImpl.h>
+#include <gdi.h>
+#include <coemain.h>
// USER INCLUDES
#include "SplashScreen.h"
@@ -243,7 +245,6 @@
// construct redrawer
iRedrawer=new (ELeave) CWsRedrawer;
iRedrawer->ConstructL(this);
- User::LeaveIfError( RAknIconSrvClient::Connect() );
// construct main window
ConstructMainWindowL();
@@ -261,7 +262,6 @@
CWsClient::~CWsClient()
{
TRACES("CWsClient::~CWsClient(): Start");
- RAknIconSrvClient::Disconnect();
// neutralize us as an active object
Deque(); // cancels and removes from scheduler
// get rid of scheduler and all attached objects
@@ -301,11 +301,6 @@
TRACES("CWsClient::DoCancel(): End");
}
-void CWsClient::ConstructMainWindowL()
- {
- TRACES("CWsClient::ConstructMainWindowL()");
- }
-
//////////////////////////////////////////////////////////////////////////////
@@ -336,6 +331,57 @@
TRACES("CMainWindow::~CMainWindow(): End");
}
+CFbsBitmap* CMainWindow::ReadSVGL (TFileName aFileName)
+ {
+ TRACES("CMainWindow::ReadSVGL(): Start");
+ TFontSpec fontspec;
+ TDisplayMode mode = EColor16MA;
+ TSize size(SIZE_X, SIZE_Y);
+
+ //if ( mode >= (TDisplayMode)13 ) { mode = EColor16MA; }
+
+ CFbsBitmap* frameBuffer = new ( ELeave ) CFbsBitmap;
+ CleanupStack::PushL( frameBuffer );
+ frameBuffer->Create( size, mode );
+
+ CSvgEngineInterfaceImpl* svgEngine = NULL;
+ svgEngine = CSvgEngineInterfaceImpl::NewL(frameBuffer, NULL, fontspec );
+
+ if (svgEngine == NULL)
+ {
+ TRACES("CMainWindow::ReadSVGL(): Splashscreen SVG engine creation failed");
+ }
+
+ CleanupStack::PushL( svgEngine );
+ TInt domHandle = 0;
+ svgEngine->PrepareDom( aFileName, domHandle ) ;
+ if (domHandle == 0)
+ {
+ TRACES("CMainWindow::ReadSVGL(): Splashscreen DOM handle creation failed");
+ }
+
+ CFbsBitmap* bitmap = new(ELeave) CFbsBitmap;
+ CleanupStack::PushL( bitmap );
+ User::LeaveIfError( bitmap->Create( size, EColor64K ) );
+
+ svgEngine->UseDom( domHandle, bitmap, NULL ) ;
+
+ MSvgError* err;
+ svgEngine->Start( err );
+ if (err->HasError())
+ {
+ TRACES("CMainWindow::ReadSVGL(): Splashscreen SVG Engine Start failed");
+ }
+
+ svgEngine->DeleteDom( domHandle );
+ CleanupStack::Pop( bitmap );
+ CleanupStack::PopAndDestroy( svgEngine );
+ CleanupStack::PopAndDestroy( frameBuffer );
+
+ TRACES("CMainWindow::ReadSVGL(): End");
+ return bitmap;
+ }
+
void CMainWindow::ConstructL (const TRect& aRect, CWindow* aParent)
{
TRACES("CMainWindow::ConstructL(): Start");
@@ -361,9 +407,7 @@
if ( !err )
{
TRACES("CMainWindow::ConstructL(): Image found");
- iBitmap = AknIconUtils::CreateIconL( fp->FullName(), EMbmSplashscreenQgn_startup_screen );
- AknIconUtils::ExcludeFromCache(iBitmap);
- AknIconUtils::SetSize( iBitmap, iRect.Size(), EAspectRatioPreservedAndUnusedSpaceRemoved );
+ iBitmap = ReadSVGL(fp->FullName());
}
else
{
@@ -428,8 +472,7 @@
void CMainWindow::HandlePointerEvent (TPointerEvent& /*aPointerEvent*/)
{
TRACES("CMainWindow::HandlePointerEvent(): Start");
-// TPoint point = aPointerEvent.iPosition;
-// (void)point;
+
TRACES("CMainWindow::HandlePointerEvent(): End");
}