--- a/group/bld.inf Tue May 11 17:02:26 2010 +0300
+++ b/group/bld.inf Tue Aug 31 16:06:58 2010 +0300
@@ -24,7 +24,6 @@
*/
#include "../svgtopt/group/bld.inf"
-#include "../svgtopt/SVGTPlugin/group/bld.inf"
PRJ_PLATFORMS
DEFAULT
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/package_definition.xml Tue Aug 31 16:06:58 2010 +0300
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<SystemDefinition schema="3.0.0">
+ <package id="svgt" name="SVG Tiny" levels="util ui">
+ <collection id="svgt_plat" name="SVG Tiny Platform Interfaces" level="ui">
+ <component id="svgt_api" name="SVGT API" introduced="9.2" class="api" filter="s60">
+ <meta rel="Api" href="svgt_plat/svgt_api/svgt_api.metaxml"/>
+ <unit bldFile="svgt_plat/svgt_api/group"/>
+ </component>
+ <component id="nvg_api" name="NVG API" introduced="9.2" class="api" filter="s60">
+ <meta rel="Api" href="svgt_plat/nvg_api/nvg_api.metaxml"/>
+ <unit bldFile="svgt_plat/nvg_api/group"/>
+ </component>
+ </collection>
+ <collection id="svgtopt" name="SVG-T Engine" level="util">
+ <component id="svgtopt_build" filter="s60" name="SVG Engine" introduced="9.2">
+ <!-- component is at collection level. Needs to be moved down a directory -->
+ <unit bldFile="svgtopt/group"/>
+ </component>
+ </collection>
+ </package>
+</SystemDefinition>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/package_map.xml Tue Aug 31 16:06:58 2010 +0300
@@ -0,0 +1,1 @@
+<PackageMap root="sf" layer="mw"/>
--- a/svgt_plat/svgt_api/group/bld.inf Tue May 11 17:02:26 2010 +0300
+++ b/svgt_plat/svgt_api/group/bld.inf Tue Aug 31 16:06:58 2010 +0300
@@ -33,3 +33,7 @@
../inc/SVGAnimationListener.h MW_LAYER_PLATFORM_EXPORT_PATH(SVGAnimationListener.h)
../inc/SVGRequestObserver.h MW_LAYER_PLATFORM_EXPORT_PATH(SVGRequestObserver.h)
../inc/SVGRendererId.h MW_LAYER_PLATFORM_EXPORT_PATH(SVGRendererId.h)
+
+../inc/svgtbitmap.h MW_LAYER_PLATFORM_EXPORT_PATH(svgtbitmap.h)
+../inc/svgtbitmap.inl MW_LAYER_PLATFORM_EXPORT_PATH(svgtbitmap.inl)
+
--- a/svgt_plat/svgt_api/inc/SVGEngineInterfaceImpl.h Tue May 11 17:02:26 2010 +0300
+++ b/svgt_plat/svgt_api/inc/SVGEngineInterfaceImpl.h Tue Aug 31 16:06:58 2010 +0300
@@ -105,6 +105,9 @@
class CSvgTextElementImpl;
class CSvgBitmapFontProvider;
+
+class CSvgtBitmap;
+
class MRect
{
public:
@@ -647,6 +650,8 @@
*/
IMPORT_C void GenerateMask( CFbsBitmap* aMask, TInt aEngine = NULL );
+ IMPORT_C void GenerateMask( CSvgtBitmap* aMask, TInt aEngine = NULL );
+
/**
* Set the color for clearing background.
*
@@ -871,6 +876,7 @@
*/
IMPORT_C void SetGdiContextL( CSvgEngineImpl* aEngine, CFbsBitmap* aFrameBuffer );
+ IMPORT_C void SetGdiContextL( CSvgEngineImpl* aEngine, CSvgtBitmap* aFrameBuffer );
/**
* Associate the given document with the given engine.
*
--- a/svgt_plat/svgt_api/inc/SvgJavaInterfaceImpl.h Tue May 11 17:02:26 2010 +0300
+++ b/svgt_plat/svgt_api/inc/SvgJavaInterfaceImpl.h Tue Aug 31 16:06:58 2010 +0300
@@ -33,6 +33,8 @@
typedef int SvgPathHandle;
typedef short SvgAttrType;
+typedef unsigned int SvgtBitmapHandle;
+
class CSvgEngineImpl;
class CSvgDocumentImpl;
class CFbsBitmap;
@@ -1488,7 +1490,12 @@
SvgEngineHandle aEngineHandle, SvgDocumentHandle aDocumentHandle,
TInt aSurfaceHandle, TInt aSurfaceMaskHandle = NULL, TReal32 aCurrentTime = 0.0f ) __SOFTFP;
- IMPORT_C void SvgEngineRenderDocumentL(
+ IMPORT_C void SvgEngineRenderDocument(
+ SvgEngineHandle aEngineHandle, SvgDocumentHandle aDocumentHandle,
+ SvgtBitmapHandle aSurfaceHandle, SvgtBitmapHandle aSurfaceMaskHandle = NULL,
+ TReal32 aCurrentTime = 0.0f ) __SOFTFP;
+
+ IMPORT_C void SvgEngineRenderDocumentL(
SvgEngineHandle aEngineHandle, SvgDocumentHandle aDocumentHandle,
TInt aSurfaceHandle, const TPoint& aAnchor, const TRect& aRenderArea, TReal32 aCurrentTime, TReal32 aAlpha ) __SOFTFP;
--- a/svgt_plat/svgt_api/inc/SvgListener.h Tue May 11 17:02:26 2010 +0300
+++ b/svgt_plat/svgt_api/inc/SvgListener.h Tue Aug 31 16:06:58 2010 +0300
@@ -23,7 +23,7 @@
#include <e32base.h>
#endif
-#include "MXMLAttributes.h"
+#include "xml/mxmlattributes.h"
class CSvgElementImpl;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svgt_plat/svgt_api/inc/svgtbitmap.h Tue Aug 31 16:06:58 2010 +0300
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2003 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"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: SVGTbitmap header file
+ *
+*/
+
+#ifndef SVGTBITMAP_H_
+#define SVGTBITMAP_H_
+
+#include <e32base.h>
+#include <displaymode.h>
+
+class CSvgtBitmap : public CBase
+ {
+public: // constructors
+ inline CSvgtBitmap( TInt8* aBitmapBuffer, TSize aBitmapSize,
+ TDisplayMode aDisplayMode, TInt aStride);
+
+public: //class methods
+ /*
+ * returns target image buffer
+ */
+ inline TInt8* BitmapBuffer() const;
+
+ /*
+ * returns target image size in pixels
+ */
+ inline TSize SizeInPixels() const;
+
+ /*
+ * returns target image display mode
+ */
+ inline TDisplayMode DisplayMode() const;
+
+ /*
+ * returns target image bytes per scanline
+ */
+ inline TInt Stride() const;
+
+private:
+ TInt8* iBitmapBuffer;
+ TSize iBitmapSize;
+ TDisplayMode iDisplayMode;
+ TInt iStride;
+ };
+
+#include <svgtbitmap.inl>
+
+#endif /* SVGTBITMAP_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svgt_plat/svgt_api/inc/svgtbitmap.inl Tue Aug 31 16:06:58 2010 +0300
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2003 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+ * Description: SVGTbitmap header file
+ *
+*/
+
+inline CSvgtBitmap::CSvgtBitmap( TInt8* aBitmapBuffer, TSize aBitmapSize,
+ TDisplayMode aDisplayMode, TInt aStride):iBitmapBuffer(aBitmapBuffer),
+ iBitmapSize(aBitmapSize),
+ iDisplayMode(aDisplayMode),
+ iStride(aStride)
+ {
+ }
+
+inline TInt8* CSvgtBitmap::BitmapBuffer() const
+ {
+ return iBitmapBuffer;
+ }
+
+inline TSize CSvgtBitmap::SizeInPixels() const
+ {
+ return iBitmapSize;
+ }
+
+inline TDisplayMode CSvgtBitmap::DisplayMode() const
+ {
+ return iDisplayMode;
+ }
+
+inline TInt CSvgtBitmap::Stride() const
+ {
+ return iStride;
+ }
--- a/svgtopt/SVG/SVGEngine/BWINSCW/SVGENGINE-OpenVGU.def Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/SVG/SVGEngine/BWINSCW/SVGENGINE-OpenVGU.def Tue Aug 31 16:06:58 2010 +0300
@@ -191,4 +191,6 @@
?ResetContext@CSvgEngineInterfaceImpl@@QAEXH@Z @ 190 NONAME ; void CSvgEngineInterfaceImpl::ResetContext(int)
?ConstructL@CSvgEngineInterfaceImpl@@IAEXAAVTFontSpec@@@Z @ 191 NONAME ; void CSvgEngineInterfaceImpl::ConstructL(class TFontSpec &)
?TLVEncodedData@CSvgEngineInterfaceImpl@@QBE?BVTPtrC8@@XZ @ 192 NONAME ; class TPtrC8 const CSvgEngineInterfaceImpl::TLVEncodedData(void) const
+ ?GenerateMask@CSvgEngineInterfaceImpl@@QAEXPAVCSvgtBitmap@@H@Z @ 193 NONAME ; void CSvgEngineInterfaceImpl::GenerateMask(class CSvgtBitmap *, int)
+ ?SetGdiContextL@CSvgEngineInterfaceImpl@@QAEXPAVCSvgEngineImpl@@PAVCSvgtBitmap@@@Z @ 194 NONAME ; void CSvgEngineInterfaceImpl::SetGdiContextL(class CSvgEngineImpl *, class CSvgtBitmap *)
--- a/svgtopt/SVG/SVGEngine/eabi/SVGENGINE-OpenVGU.def Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/SVG/SVGEngine/eabi/SVGENGINE-OpenVGU.def Tue Aug 31 16:06:58 2010 +0300
@@ -388,4 +388,6 @@
_ZN23CSvgEngineInterfaceImpl5StartERP9MSvgErrorPK6TDesC8P14CSvgEngineImpl @ 387 NONAME
_ZN23CSvgEngineInterfaceImpl6UseDomEiP10CFbsBitmapS1_5TSize12TDisplayModeS3_i @ 388 NONAME
_ZNK23CSvgEngineInterfaceImpl14TLVEncodedDataEv @ 389 NONAME
+ _ZN23CSvgEngineInterfaceImpl12GenerateMaskEP11CSvgtBitmapi @ 390 NONAME
+ _ZN23CSvgEngineInterfaceImpl14SetGdiContextLEP14CSvgEngineImplP11CSvgtBitmap @ 391 NONAME
--- a/svgtopt/SVG/SVGEngine/group/SVGEngine.mmp Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/SVG/SVGEngine/group/SVGEngine.mmp Tue Aug 31 16:06:58 2010 +0300
@@ -19,7 +19,12 @@
#include <platform_paths.hrh>
ALWAYS_BUILD_AS_ARM
-OPTION_REPLACE ARMCC --cpu 5T -O3 -Otime
+/* Srini: Raptor automatically adds --cpu 5te when building for rvct4.0
+ and adds --cpu 5t when building with rvct 2.2.
+ basically the option is redundant. please don't add the option.
+
+ */
+OPTION_REPLACE ARMCC -O3 -Otime
TARGET SVGEngine.dll
TARGETTYPE dll
@@ -57,6 +62,7 @@
SOURCE Svgdecoder.cpp
SOURCE SVGFourPointRect.cpp
+
SOURCEPATH ../../SVGImpl/src
SOURCE SVGElementImpl.cpp
--- a/svgtopt/SVG/SVGEngine/inc/SVGContentHandler.h Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/SVG/SVGEngine/inc/SVGContentHandler.h Tue Aug 31 16:06:58 2010 +0300
@@ -28,8 +28,8 @@
#include "SVGAttributeVerifier.h"
#include "SVGErrorImpl.h"
-#include "mxmlattributes.h"
-#include "mxmlcontenthandler.h"
+#include "xml/mxmlattributes.h"
+#include "xml/mxmlcontenthandler.h"
#include "SVGSchemaData.h"
#include "SVGDocumentImpl.h"
--- a/svgtopt/SVG/SVGEngine/inc/SVGEngineImpl.h Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/SVG/SVGEngine/inc/SVGEngineImpl.h Tue Aug 31 16:06:58 2010 +0300
@@ -68,6 +68,7 @@
class CSvgTimer;
// temporary for debugging
+class CSvgtBitmap;
//This includes the main rendering loop.
/**
@@ -327,6 +328,8 @@
*/
void GenerateMask( CFbsBitmap* aMask );
+ void GenerateMask(CSvgtBitmap* aMask);
+
/**
* Set background color
*
@@ -365,6 +368,9 @@
void SetGdiContextL(CFbsBitmap* aCurrentBitmap, CFbsBitmap* aMask = NULL);
void SetGdiContextL(CFbsBitmap* aCurrentBitmap, CFbsBitmap* aMask,TSize aCurrentBitmapSize,TDisplayMode aRenderDspMode,TDisplayMode aMaskDspMode);
+
+ void SetGdiContextL(CSvgtBitmap* aCurrentBitmap, CSvgtBitmap* aMask = NULL);
+
/**
* Start the Engine so that the first frame is drawn when the call is finished.
*
@@ -611,6 +617,10 @@
TBool IsSVGEnginePaused();
void SetBitmapHeader(const TDesC* aHeaderData);
+
+ void EnableTargetRendering(TBool aTargetRendering );
+ TBool IsTargetRenderingEnabled() const;
+
public: // Functions from base classes
// From CSvgElementImpl
/**
@@ -916,7 +926,7 @@
CFbsBitmap* iFrameBuffer;
CFbsBitmap* iMask;
-
+
TSize iFrameBufferSize; //NGA
TDisplayMode iRenderDspMode;
TDisplayMode iMaskDspMode;
@@ -931,6 +941,10 @@
TPtrC iLinkShow;
TBool iShowDebugInfo;
+ //M2G: target bitmap buffer and mask buffer
+ CSvgtBitmap* iTargetBitmapBuffer;
+ CSvgtBitmap* iTargetMaskBuffer;
+
TGfxRectangle2D iClipRect;
TSvgEngineState iSvgEngineState;
TAnimStatus iAnimationState;
@@ -960,6 +974,7 @@
//Stores Font Type information as passed by CSvgEngineInterfaceImpl
CSvgBitmapFontProvider *iSvgBitmapFontProvider;
+ TBool iIsTargetRenderingEnabled;
public:
TBool iCustomOption;
TBool iFrameBufferOverridesViewport;
--- a/svgtopt/SVG/SVGEngine/src/SVGContentHandler.cpp Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/SVG/SVGEngine/src/SVGContentHandler.cpp Tue Aug 31 16:06:58 2010 +0300
@@ -26,7 +26,7 @@
#include "SVGUseElementImpl.h"
#include "SVGAnimationElementImpl.h"
-#include "rxmlreader.h"
+#include <xml/rxmlreader.h>
#include "SVGPaintCssValueImpl.h"
#include "SVGPathElementImpl.h"
@@ -1434,9 +1434,14 @@
CleanupStack::PopAndDestroy( 1 ); // tBufC2
}
- iCurrentElement->SetTransform(KTransform,tPf);
-
- CleanupStack::PopAndDestroy( 2 ); // tBufC & TFinal
+ TBool rVal = iCurrentElement->SetTransform(KTransform,tPf);
+ CleanupStack::PopAndDestroy( 2 ); // tBufC & TFinal
+
+ if (!rVal)
+ {
+ return EFalse;
+ }
+
return ETrue;
}
--- a/svgtopt/SVG/SVGEngine/src/SVGEngineImpl.cpp Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/SVG/SVGEngine/src/SVGEngineImpl.cpp Tue Aug 31 16:06:58 2010 +0300
@@ -59,6 +59,7 @@
#include "SVGTimeContainer.h"
#include "SVGMediaAnimationElementImpl.h"
+#include <svgtbitmap.h>
// Constants
// length of </text>
const TInt KClosingTextTagLength = 7;
@@ -748,9 +749,24 @@
// Get the redering result onto CFbsBitmap.
if(iFrameBufferSize.iWidth > 0)
- iGfxContext->UpdateFramebufferL( iFrameBuffer, iMask,iFrameBufferSize,iRenderDspMode,iMaskDspMode );
+ {
+ if(iIsTargetRenderingEnabled)
+ { // M2G
+ iGfxContext->UpdateFramebufferL( iTargetBitmapBuffer, iTargetMaskBuffer,iFrameBufferSize,
+ iTargetBitmapBuffer->DisplayMode(),iTargetMaskBuffer->DisplayMode());
+ }
+ else
+ iGfxContext->UpdateFramebufferL( iFrameBuffer, iMask,iFrameBufferSize,iRenderDspMode,
+ iMaskDspMode );
+ }
else
- iGfxContext->UpdateFramebufferL( iFrameBuffer, iMask );
+ {
+ if(iIsTargetRenderingEnabled) //M2G
+ iGfxContext->UpdateFramebufferL( iTargetBitmapBuffer, iTargetMaskBuffer );
+ else
+ iGfxContext->UpdateFramebufferL( iFrameBuffer, iMask );
+
+ }
if ( !iIgnoreUpdateScreen && iRequestObserver != NULL )
{
@@ -1259,6 +1275,13 @@
}
}
+void CSvgEngineImpl::GenerateMask(CSvgtBitmap* aMask)
+ {
+ if ( iGfxContext )
+ {
+ iGfxContext->GenerateMask( aMask );
+ }
+ }
//
// ---------------------------------------------------------------------------
// set background color
@@ -1372,7 +1395,38 @@
iGfxContext->ChangeBufferSizeL( TSize( 0,0 ) );
}
}
-
+//----------------------------------------------------------------------------------------------
+//M2G: SetGdiContextL() is overloaded to accept CSvgtBitmap to enable rendering on target buffer.
+//-----------------------------------------------------------------------------------------------
+void CSvgEngineImpl::SetGdiContextL(CSvgtBitmap* aCurrentBitmap, CSvgtBitmap* aMask)
+ {
+
+ // Handle for both Non-NULL and NULL parameter
+ iTargetBitmapBuffer = aCurrentBitmap;
+ iTargetMaskBuffer = aMask;
+
+ if ( aCurrentBitmap )
+ {
+ if ( !iGfxContext )
+ {
+ iGfxContext = CGfx2dGcOpenVG::NewL( iTargetBitmapBuffer->SizeInPixels(), iBitmapFontSpec, iSvgBitmapFontProvider, EFalse );
+
+ // The API is called Only in case of JSR226. Incase if the midlet developer
+ // has changed the RedenderQuality of the midlet.ByDefualt the value of
+ // iRenderQuality is 2 i.e. VG_RENDERING_QUALITY_BETTER.
+ iGfxContext->SetAntialiasingMode( iRenderQuality );
+ }
+ else
+ {
+ iGfxContext->ChangeBufferSizeL( iTargetBitmapBuffer->SizeInPixels() );
+ }
+ }
+ else if ( iGfxContext )
+ {
+ iGfxContext->ChangeBufferSizeL( TSize( 0,0 ) );
+ }
+
+ }
// ---------------------------------------------------------------------------
// void CSvgEngineImpl::StartEngine(CSvgErrorImpl* aError)
// ---------------------------------------------------------------------------
@@ -1460,12 +1514,24 @@
// ---------------------------------------------------------------------------
void CSvgEngineImpl::RenderFrame( TUint aCurrentTime )
{
- if ( !iFrameBuffer || !iSvgDocument ||
- iFrameBuffer->SizeInPixels().iWidth == 0 || iFrameBuffer->SizeInPixels().iHeight == 0 )
+ if(iIsTargetRenderingEnabled) //M2G: If target rendering is enabled
{
- return;
+ if ( !iTargetBitmapBuffer || !iSvgDocument ||
+ iTargetBitmapBuffer->SizeInPixels().iWidth == 0 ||
+ iTargetBitmapBuffer->SizeInPixels().iHeight == 0 )
+ {
+ return;
+ }
}
-
+ else
+ {
+ if (!iFrameBuffer || !iSvgDocument
+ || iFrameBuffer->SizeInPixels().iWidth == 0
+ || iFrameBuffer->SizeInPixels().iHeight == 0)
+ {
+ return;
+ }
+ }
if ( aCurrentTime == 0 )
{
SeekEngine( 0 );
@@ -3153,6 +3219,21 @@
((CGfx2dGcOpenVG *)iGfxContext)->SetBitmapHeader(aHeaderData);
}
}
+//---------------------------------------------------------------
+// M2G: Enable rendering on target buffer.
+//----------------------------------------------------------------
+void CSvgEngineImpl::EnableTargetRendering(TBool aTargetRendering )
+ {
+ iIsTargetRenderingEnabled = aTargetRendering;
+ }
+
+//---------------------------------------------------------------
+// M2G: TBool CSvgEngineImpl::IsTargetRenderingEnabled() const
+//----------------------------------------------------------------
+TBool CSvgEngineImpl::IsTargetRenderingEnabled() const
+ {
+ return iIsTargetRenderingEnabled;
+ }
//NGA
// ---------------------------------------------------------------------------
// SetGdiContext File
--- a/svgtopt/SVG/SVGEngine/src/SVGEngineInterfaceImpl.cpp Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/SVG/SVGEngine/src/SVGEngineInterfaceImpl.cpp Tue Aug 31 16:06:58 2010 +0300
@@ -1055,67 +1055,36 @@
TInt aX,aY;
// Check in Left direction
aX = 1; aY = 0;
- if ( xmax <= clipWidth && aX < 0 )
- aX = 0;
- if ( bound.iX >= zero && aX > 0 )
+ //Coverity fixes
+ if ( bound.iX >= zero )
aX = 0;
- if ( ymax <= clipHeight && aY < 0 )
- aY = 0;
- if ( bound.iY >= zero && aY > 0 )
- aY = 0;
+
// Do panning
- if ( ( aY == 0 ) && ( aX == 0 ) )
- left = EFalse;
- else
- left = ETrue;
+ left = ((aY)||(aX));
// Check in Right direction
aX = -1; aY = 0;
- if ( xmax <= clipWidth && aX < 0 )
- aX = 0;
- if ( bound.iX >= zero && aX > 0 )
+ if ( xmax <= clipWidth )
aX = 0;
- if ( ymax <= clipHeight && aY < 0 )
- aY = 0;
- if ( bound.iY >= zero && aY > 0 )
- aY = 0;
+
// Do panning
- if ( ( aY == 0 ) && ( aX == 0 ) )
- right = EFalse;
- else
- right = ETrue;
+ right = ((aY)||(aX));
// Check in Up direction
aX = 0; aY = 1;
- if ( xmax <= clipWidth && aX < 0 )
- aX = 0;
- if ( bound.iX >= zero && aX > 0 )
- aX = 0;
- if ( ymax <= clipHeight && aY < 0 )
+ if ( bound.iY >= zero )
aY = 0;
- if ( bound.iY >= zero && aY > 0 )
- aY = 0;
+
// Do panning
- if ( ( aY == 0 ) && ( aX == 0 ) )
- up = EFalse;
- else
- up = ETrue;
+ up = ((aY)||(aX));
// Check in down direction
aX = 0; aY = -1;
- if ( xmax <= clipWidth && aX < 0 )
- aX = 0;
- if ( bound.iX >= zero && aX > 0 )
- aX = 0;
- if ( ymax <= clipHeight && aY < 0 )
+ if ( ymax <= clipHeight )
aY = 0;
- if ( bound.iY >= zero && aY > 0 )
- aY = 0;
+
// Do panning
- if ( ( aY == 0 ) && ( aX == 0 ) )
- down = EFalse;
- else
- down = ETrue;
+ down = ((aY)||(aX));
}
// --------------------------------------------------------------------------
@@ -1219,19 +1188,11 @@
{
bbSize.iWidth = ((TReal32)bbSize.iWidth) * percentWidth / 100.0;
}
- else
- {
- bbSize.iWidth = bbSize.iWidth;
- }
if( svgElement->iHeightInPercentage )
{
bbSize.iHeight = ((TReal32)bbSize.iHeight) * percentHeight / 100.0;
}
- else
- {
- bbSize.iHeight = bbSize.iHeight;
- }
return bbSize;
}
}
@@ -1538,6 +1499,13 @@
}
}
+EXPORT_C void CSvgEngineInterfaceImpl::GenerateMask(CSvgtBitmap* aMask, TInt aEngine )
+ {
+ if ( ChooseEngine( aEngine ) )
+ {
+ iSvgEngine->GenerateMask(aMask);
+ }
+ }
// --------------------------------------------------------------------------
// EXPORT_C void CSvgEngineInterfaceImpl::SetBackgroundColor(TUint32 aRGBA8888Color, CSvgEngineImpl* aEngine)
@@ -2504,6 +2472,19 @@
aEngine->SetGdiContextL( aFrameBuffer );
}
}
+
+// --------------------------------------------------------------------------
+// M2G: Overloaded SetGdiContextL() for CSvgtBitmap to enable rendering on target buffer.
+// ---------------------------------------------------------------------------
+EXPORT_C void CSvgEngineInterfaceImpl::SetGdiContextL( CSvgEngineImpl* aEngine, CSvgtBitmap* aFrameBuffer )
+ {
+ if( aEngine )
+ {
+ aEngine->EnableTargetRendering(ETrue);
+ aEngine->SetGdiContextL( aFrameBuffer );
+ }
+ }
+
// --------------------------------------------------------------------------
// EXPORT_C void CSvgEngineInterfaceImpl::SetDocument( CSvgEngineImpl* aEngine, CSvgDocumentImpl* aDocument )
// ---------------------------------------------------------------------------
@@ -3102,10 +3083,9 @@
TSvgFourPointRect fourPointRect;
//updates CTM from root
- aTextElementHandle->UpdateCTM();
-
if (aTextElementHandle)
{
+ aTextElementHandle->UpdateCTM();
aTextElementHandle->GetFourPointBBox(fourPointRect);
}
--- a/svgtopt/SVG/SVGEngine/src/Svgdecoder.cpp Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/SVG/SVGEngine/src/Svgdecoder.cpp Tue Aug 31 16:06:58 2010 +0300
@@ -2511,30 +2511,20 @@
// ---------------------------------------------------------------------------
TBool CSvgDecoder::DecodeIdAndXmlAttributeL(const TUint16 aName)
{
-
+ TBool rVal = EFalse;
if (aName== KAtrId)
{
- iCurrentElement->SetIdandXmlbaseL( _L("id"), DecodeTDesCLC());
- CleanupStack::PopAndDestroy( 1 );
- return ETrue;
+ rVal = iCurrentElement->SetIdandXmlbaseL( _L("id"), DecodeTDesCLC());
+ CleanupStack::PopAndDestroy( 1 );
}
-
- if (aName== KAtrXmlBase)
+ else if (aName== KAtrXmlBase)
{
- iCurrentElement->SetIdandXmlbaseL( _L("xml:base"), DecodeTDesCLC());
- CleanupStack::PopAndDestroy( 1 );
- return ETrue;
+ rVal = iCurrentElement->SetIdandXmlbaseL( _L("xml:base"), DecodeTDesCLC());
+ CleanupStack::PopAndDestroy( 1 );
}
-
- else
- {
- return EFalse;
- }
+ return rVal;
}
-
-
-
// --------------------------------------------------------------------------
// TBool CSvgDecoder::DecodeUriRefAttributeL(const TUint16 aName)
// ---------------------------------------------------------------------------
--- a/svgtopt/SVG/SVGImpl/src/SVGAnimationBase.cpp Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/SVG/SVGImpl/src/SVGAnimationBase.cpp Tue Aug 31 16:06:58 2010 +0300
@@ -679,11 +679,13 @@
iAnimTime->SaveBeginTime();
}
- if ( ( ((CSvgDocumentImpl*)iOwnerDocument)->Engine() && iAnimTime && ((CSvgDocumentImpl*)iOwnerDocument)->Engine()->CurrentTIme() >= iAnimTime->BeginTime() )
- || ( iAnimTime && ((CSvgDocumentImpl*)iOwnerDocument)->iTimeForJSR226 >= iAnimTime->BeginTime() ) )
+ if ( ( ((CSvgDocumentImpl*)iOwnerDocument)->Engine() && ((CSvgDocumentImpl*)iOwnerDocument)->Engine()->CurrentTIme() >= iAnimTime->BeginTime() )
+ || ( ((CSvgDocumentImpl*)iOwnerDocument)->iTimeForJSR226 >= iAnimTime->BeginTime() ) )
{
- iTargetElement->SetIsAnimating( ETrue );
- SetIsAnimating( ETrue );
+ if (iTargetElement)
+ iTargetElement->SetIsAnimating( ETrue );
+
+ SetIsAnimating( ETrue );
}
}
--- a/svgtopt/SVG/SVGImpl/src/SVGAnimationElementImpl.cpp Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/SVG/SVGImpl/src/SVGAnimationElementImpl.cpp Tue Aug 31 16:06:58 2010 +0300
@@ -473,6 +473,9 @@
//
void CSvgAnimationElementImpl::RemoveEventListener()
{
+ if ( !iMyAnimationElementList )
+ return;
+
FindAllAnimationElements( (CSvgElementImpl* )this, iMyAnimationElementList );
// Remove event listening for every animation elements that are child of
--- a/svgtopt/SVG/SVGImpl/src/SVGDocumentImpl.cpp Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/SVG/SVGImpl/src/SVGDocumentImpl.cpp Tue Aug 31 16:06:58 2010 +0300
@@ -77,7 +77,7 @@
#include "SVGTimeContainer.h"
#include <ezgzip.h>
-#include <caf/caf.h>
+//#include <caf/caf.h>
#include <bautils.h>
// ==========================================================================
@@ -374,11 +374,7 @@
// ellipse
return ( MXmlElement * ) CSvgEllipseElementImpl::NewL( (TUint8) position, this );
- case KSvgDefsElement:
- // defs
- return ( MXmlElement * ) CSvgDefsElementImpl::NewL((TUint8) position, this);
-
- case KSvgForeignObjectElement:
+ case KSvgForeignObjectElement:
// foreignObject
return ( MXmlElement * ) CSvgForeignObjectElementImpl::NewL((TUint8) position, this);
--- a/svgtopt/SVG/SVGImpl/src/SVGElementImpl.cpp Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/SVG/SVGImpl/src/SVGElementImpl.cpp Tue Aug 31 16:06:58 2010 +0300
@@ -101,8 +101,6 @@
CSvgElementImpl* lParentElement = (CSvgElementImpl*)aElement->ParentNode ();
while(lParentElement && (lParentElement->iSvgStyleProperties != NULL))
{
- if(!lParentElement)
- return EFalse;
if (aElement->iSvgStyleProperties->operator[](aAttrIndex) ==
lParentElement->iSvgStyleProperties->operator[](aAttrIndex))
{
@@ -673,7 +671,8 @@
{
((CSvgFontFaceElementImpl *)this)->SetFontFamilyL(aValue);
}
-
+ break;
+
case KCSS_ATTR_STROKE_LINECAP:
case KCSS_ATTR_STROKE_LINEJOIN:
case KCSS_ATTR_FILLRULE:
@@ -2313,7 +2312,7 @@
//tParentValue = (CIntCssValueImpl *)(lParentElement->iSvgStyleProperties->operator[](aNameId));
//(*iSvgStyleProperties)[aNameId]= tParentValue;
if(tParentValue)
- tValue->SetValueL(tParentValue->Value());
+ tValue->SetValueL(tParentValue->Value());
}
else
{
--- a/svgtopt/SVG/SVGImpl/src/SVGFontFaceElementImpl.cpp Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/SVG/SVGImpl/src/SVGFontFaceElementImpl.cpp Tue Aug 31 16:06:58 2010 +0300
@@ -117,28 +117,31 @@
{
//AJD this whole thing needs to be replaced with some sort of external resource registry area....
//for images, fonts, other svg files
- if ( ((CSvgDocumentImpl*)iOwnerDocument)->Engine() && ((CSvgDocumentImpl*)iOwnerDocument)->Engine()->iFontHashMap)
- {
- TRAPD(err, ((CSvgDocumentImpl*)iOwnerDocument)->Engine()->iFontHashMap->RemoveReferenceFromFontL(iFontFamily->Des()));
- if (err)
+ CSvgDocumentImpl * ownerDoc = (CSvgDocumentImpl*)iOwnerDocument;
+ if ( ownerDoc )
{
- #ifdef _DEBUG
- RDebug::Printf("CSvgFontFaceElementImpl::~CSvgFontFaceElementImpl: Error trapped=%d", err);
- #endif
+ if ( ownerDoc->Engine() && ownerDoc->Engine()->iFontHashMap)
+ {
+ TRAPD(err, ownerDoc->Engine()->iFontHashMap->RemoveReferenceFromFontL(iFontFamily->Des()));
+ if (err)
+ {
+ #ifdef _DEBUG
+ RDebug::Printf("CSvgFontFaceElementImpl::~CSvgFontFaceElementImpl: Error trapped=%d", err);
+ #endif
+ }
+ }
+
+ if ( ownerDoc->iFontHashMap)
+ {
+ TRAPD(err, ownerDoc->iFontHashMap->RemoveReferenceFromFontL(iFontFamily->Des()));
+ if (err)
+ {
+ #ifdef _DEBUG
+ RDebug::Printf("CSvgFontFaceElementImpl::~CSvgFontFaceElementImpl: Error trapped=%d", err);
+ #endif
+ }
+ }
}
- }
-
- if ( (CSvgDocumentImpl*)iOwnerDocument && ((CSvgDocumentImpl*)iOwnerDocument)->iFontHashMap)
- {
- TRAPD(err, ((CSvgDocumentImpl*)iOwnerDocument)->iFontHashMap->RemoveReferenceFromFontL(iFontFamily->Des()));
- if (err)
- {
- #ifdef _DEBUG
- RDebug::Printf("CSvgFontFaceElementImpl::~CSvgFontFaceElementImpl: Error trapped=%d", err);
- #endif
- }
- }
-
if ( iFontFamily )
{
delete iFontFamily;
--- a/svgtopt/SVG/SVGImpl/src/SVGImageElementImpl.cpp Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/SVG/SVGImpl/src/SVGImageElementImpl.cpp Tue Aug 31 16:06:58 2010 +0300
@@ -29,7 +29,7 @@
#include <imcvcodc.h>
-#include <caf/caf.h>
+//#include <caf/caf.h>
const TInt KErrNoAttributeSet = -1;
#define KSVGWAITFORIMAGEDOWNLOAD 1
--- a/svgtopt/SVG/SVGImpl/src/SVGSetElementImpl.cpp Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/SVG/SVGImpl/src/SVGSetElementImpl.cpp Tue Aug 31 16:06:58 2010 +0300
@@ -151,16 +151,9 @@
case KSvgTypeTransform:
break;
case KSvgTypeColor:
- iEndInt = iToInt;
- iTargetElement->SetAttributeIntL( iAttrId, iToInt );
- break;
case KSvgTypeTextAnchor:
case KSvgTypeInteger:
- iEndInt = iToInt;
- iTargetElement->SetAttributeIntL( iAttrId, iToInt );
case KSvgTypeVisibility:
- iEndInt = iToInt;
- iTargetElement->SetAttributeIntL( iAttrId, iToInt );
case KSvgTypeDisplay:
iEndInt = iToInt;
iTargetElement->SetAttributeIntL( iAttrId, iToInt );
--- a/svgtopt/SVG/SVGImpl/src/SVGTextElementImpl.cpp Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/SVG/SVGImpl/src/SVGTextElementImpl.cpp Tue Aug 31 16:06:58 2010 +0300
@@ -2885,12 +2885,7 @@
//SetFontFamilyL(_L("NokiaSansWide"));
if(!aReturn)
{
- if(lNewFontDoc)
- {
- delete lNewFontDoc;
- lNewFontDoc = NULL;
- }
-
+ delete lNewFontDoc;
}
return ETrue;
}
@@ -2904,7 +2899,6 @@
}
delete lNewFontDoc;
- lNewFontDoc = NULL;
return EFalse;
}
--- a/svgtopt/SVG/SVGImpl/src/SVGTokenizer.cpp Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/SVG/SVGImpl/src/SVGTokenizer.cpp Tue Aug 31 16:06:58 2010 +0300
@@ -305,11 +305,12 @@
TLex lex( decimalString );
// Specify the decimal seperator, instead of using
// locale specific seperator.
- lex.Val( aValue, '.' );
-
- tokenizer.SkipWhiteSpace();
- aRemainder.Set( tokenizer.Remainder() );
- return ETrue;
- }
+ if(lex.Val( aValue, '.' )== KErrNone)
+ {
+ tokenizer.SkipWhiteSpace();
+ aRemainder.Set( tokenizer.Remainder() );
+ return ETrue;
+ }
+ }
return EFalse;
}
--- a/svgtopt/SVGEngineJI/BWINSCW/SVGEngineJIU.def Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/SVGEngineJI/BWINSCW/SVGEngineJIU.def Tue Aug 31 16:06:58 2010 +0300
@@ -87,4 +87,5 @@
?SvgRenderingSurfaceGetHeight@CSvgJavaInterfaceImpl@@QAEHH@Z @ 86 NONAME ; int CSvgJavaInterfaceImpl::SvgRenderingSurfaceGetHeight(int)
?SvgRenderingSurfaceGetWidth@CSvgJavaInterfaceImpl@@QAEHH@Z @ 87 NONAME ; int CSvgJavaInterfaceImpl::SvgRenderingSurfaceGetWidth(int)
?NewL@CSvgJavaInterfaceImpl@@SAPAV1@AAVTFontSpec@@@Z @ 88 NONAME ; class CSvgJavaInterfaceImpl * CSvgJavaInterfaceImpl::NewL(class TFontSpec &)
+ ?SvgEngineRenderDocument@CSvgJavaInterfaceImpl@@QAEXHHIIM@Z @ 89 NONAME ; void CSvgJavaInterfaceImpl::SvgEngineRenderDocument(int, int, unsigned int, unsigned int, float)
--- a/svgtopt/SVGEngineJI/eabi/SVGEngineJIU.def Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/SVGEngineJI/eabi/SVGEngineJIU.def Tue Aug 31 16:06:58 2010 +0300
@@ -94,4 +94,5 @@
_ZTV10CJavaError @ 93 NONAME ; #<VT>#
_ZTV21CSvgJavaInterfaceImpl @ 94 NONAME ; #<VT>#
_ZN21CSvgJavaInterfaceImpl4NewLER9TFontSpec @ 95 NONAME
+ _ZN21CSvgJavaInterfaceImpl23SvgEngineRenderDocumentEiijjf @ 96 NONAME
--- a/svgtopt/SVGEngineJI/src/SvgJavaInterfaceImpl.cpp Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/SVGEngineJI/src/SvgJavaInterfaceImpl.cpp Tue Aug 31 16:06:58 2010 +0300
@@ -241,6 +241,34 @@
*/
}
+/*
+ * M2G: SvgEngineRenderDocument() overloaded to pass the CSvgtBitmap object to SvgEngine
+ */
+EXPORT_C void CSvgJavaInterfaceImpl::SvgEngineRenderDocument(
+ SvgEngineHandle aEngineHandle, SvgDocumentHandle aDocumentHandle,
+ SvgtBitmapHandle aSurfaceHandle, SvgtBitmapHandle aSurfaceMaskHandle,
+ TReal32 aCurrentTime )
+ {
+ CSvgEngineInterfaceImpl::iFileIsLoaded = ETrue;
+
+ SetDocument( (CSvgEngineImpl*)aEngineHandle, (CSvgDocumentImpl*)aDocumentHandle );
+
+ // GfxContext creation
+ TRAPD(error, SetGdiContextL( (CSvgEngineImpl*)aEngineHandle, (CSvgtBitmap*)aSurfaceHandle ) );
+ if ( error != KErrNone )
+ {
+ // ignore trap error
+ }
+
+ //this udpates things like Viewport with whatever preserveAspectRatio and widths are set
+ //InitializeEngine((CSvgEngineImpl*)aEngineHandle);
+
+ if ( ((CSvgtBitmap*)aSurfaceMaskHandle) != NULL)
+ GenerateMask((CSvgtBitmap*)aSurfaceMaskHandle);
+
+ RenderFrame( (CSvgEngineImpl*)aEngineHandle, (TUint)(aCurrentTime * 1000) );
+ }
+
/**
*
*/
@@ -1327,13 +1355,13 @@
{
if(lSvgAttrId == KCSS_ATTR_FONTSIZE)
{
- if(lValue != KErrNotFound)
- {
+ // if(lValue != KErrNotFound)
+ // {
// font is internally considered to be a float.
TReal32 lValue = GetElementFloatAttribute((CSvgElementImpl*)aElementHandle,lSvgAttrId);
return short (lValue) ;
- }
- return KInvalidEnumAttribute;
+ // }
+ //return KInvalidEnumAttribute;
}
TInt lResult = GetEnumAttribute((CSvgElementImpl*)aElementHandle, lSvgAttrId , lValue);
if(lResult == KErrNotFound)
@@ -2653,37 +2681,43 @@
*/
TInt CSvgJavaInterfaceImpl::SvgStringtoEnumerationMappingSVGtoJSR(const TInt aAttributeId , TPtrC16 aValue)
{
+ TInt attribVal = KErrNotFound;
+
switch(aAttributeId)
{
case KCSS_ATTR_FILLRULE:
{
if(aValue == _L("evenodd"))
- return FILL_RULE_EVENODD;
- if(aValue == _L("nonzero"))
- return FILL_RULE_NONZERO;
+ attribVal = FILL_RULE_EVENODD;
+ else if(aValue == _L("nonzero"))
+ attribVal = FILL_RULE_NONZERO;
}
+ break;
case KCSS_ATTR_STROKE_LINECAP:
{
if(aValue == _L("butt"))
- return STROKE_LINECAP_BUTT;
- if(aValue == _L("round"))
- return STROKE_LINECAP_ROUND;
- if(aValue == _L("square"))
- return STROKE_LINECAP_SQUARE;
+ attribVal = STROKE_LINECAP_BUTT;
+ else if(aValue == _L("round"))
+ attribVal = STROKE_LINECAP_ROUND;
+ else if(aValue == _L("square"))
+ attribVal = STROKE_LINECAP_SQUARE;
}
-
- case KCSS_ATTR_STROKE_LINEJOIN:
-
+ break;
+ case KCSS_ATTR_STROKE_LINEJOIN:
{
if(aValue == _L("miter"))
- return STROKE_LINEJOIN_MITER;
- if(aValue == _L("round"))
- return STROKE_LINEJOIN_ROUND;
- if(aValue == _L("bevel"))
- return STROKE_LINEJOIN_BEVEL;
+ attribVal = STROKE_LINEJOIN_MITER;
+ else if(aValue == _L("round"))
+ attribVal = STROKE_LINEJOIN_ROUND;
+ else if(aValue == _L("bevel"))
+ attribVal = STROKE_LINEJOIN_BEVEL;
}
- default: return KErrNotFound;
+ break;
+ default:
+ attribVal = KErrNotFound;
+
}
+ return attribVal;
}
/**
* This maps the Enumeration from SVG to JSR.
--- a/svgtopt/SVGTPlugin/BWINSCW/NPSVGTPLUGINU.DEF Tue May 11 17:02:26 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-EXPORTS
- ?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z @ 1 NONAME ; struct TImplementationProxy const * ImplementationGroupProxy(int &)
- ?InitializeFuncs@@YAFPAU_NPPluginFuncs@@@Z @ 2 NONAME ; short InitializeFuncs(struct _NPPluginFuncs *)
- ?NPP_Shutdown@@YAXXZ @ 3 NONAME ; void NPP_Shutdown(void)
-
--- a/svgtopt/SVGTPlugin/eabi/npSvgtPluginU.DEF Tue May 11 17:02:26 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-EXPORTS
- _Z24ImplementationGroupProxyRi @ 1 NONAME
- _Z12NPP_Shutdownv @ 2 NONAME
- _Z15InitializeFuncsP14_NPPluginFuncs @ 3 NONAME
- _ZTI11CSvgtPlugin @ 4 NONAME ; #<TI>#
- _ZTI18CSvgtPluginControl @ 5 NONAME ; #<TI>#
- _ZTI19CSvgtPluginEcomMain @ 6 NONAME ; #<TI>#
- _ZTV11CSvgtPlugin @ 7 NONAME ; #<VT>#
- _ZTV18CSvgtPluginControl @ 8 NONAME ; #<VT>#
- _ZTV19CSvgtPluginEcomMain @ 9 NONAME ; #<VT>#
-
--- a/svgtopt/SVGTPlugin/group/SVGTPluginS60.pkg Tue May 11 17:02:26 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-;
-; Copyright (c) 2009 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"
-; which accompanies this distribution, and is available
-; at the URL "http://www.eclipse.org/legal/epl-v10.html".
-;
-; Initial Contributors:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description:
-;
-;
-; Installation file for MFP application
-;
-;Languages
-&EN
-;
-; UID is the app's UID
-;
-#{"SVGTPlugin"},(0x101F86DF),1,0,0,TYPE=SISOPTION
-;
-;Supports Series 60 v 1.1
-;This line indicates that this installation is for the Series 60 platform v0.9
-;This line must appear _exactly_ as shown below in the sis file
-;If this line is missing or incorrect, the sis file will not be able
-;to be installed on Series 60 v0.9 platforms
-(0x101F6F88), 0, 0, 0, {"Series60ProductID"}
-;
-; Two files to install
-;
-"\epoc32\release\thumb\urel\npSvgtPlugin.dll" -"!:\apps\plugin\npSvgtPlugin.dll"
-
-"\Epoc32\release\thumb\urel\gfx2d.dll" -"!:\system\libs\gfx2d.dll"
-
-"\Epoc32\release\thumb\urel\svgengine.dll" -"!:\system\libs\svgengine.dll"
-
-"\Epoc32\release\thumb\urel\SVGRECOG.MDL" -"!:\system\recogs\SVGRECOG.MDL"
-
-
-
-
-
-
-
--- a/svgtopt/SVGTPlugin/group/SVGTPluginS60Ecom.mmp Tue May 11 17:02:26 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/*
-* Copyright (c) 2003 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: This is the .mmp for building Ecom style SVGT Plugin for
- * the Series60 Platform.
- *
-*/
-
-
-#include <platform_paths.hrh>
-
-TARGET npsvgtplugin.dll
-
-TARGETTYPE PLUGIN
-
-UID 0x10009D8D 0x101F86DF
-
-CAPABILITY CAP_ECOM_PLUGIN
-VENDORID VID_DEFAULT
-
-// Defined for audio support
-
-//deffile generation
-#if defined( ARMCC )
-deffile ../eabi/npSvgtPlugin.DEF
-#else
-deffile ../BWINSCW/NPSVGTPLUGIN.DEF
-#endif
-
-SOURCEPATH ../src
-SOURCE Svgtpluginmain.cpp
-SOURCE Svgtplugin.cpp
-SOURCE Svgtplugindllapi.cpp
-SOURCE SvgtPluginControl.cpp
-
-SOURCE VolumeKeyListener.cpp
-SOURCE RepositoryVolumeListener.cpp
-
-USERINCLUDE ../inc
-
-// This is a SYSTEMINCLUDE macro containing the middleware
-// layer specific include directories
-APP_LAYER_SYSTEMINCLUDE
-
-SYSTEMINCLUDE /epoc32/include/libc
-SYSTEMINCLUDE /epoc32/include/ecom
-SYSTEMINCLUDE /epoc32/include/http
-
-SOURCEPATH ../resource/s60
-
-START RESOURCE 101F86DF.rss
-TARGET npsvgtplugin.rsc
-END
-
-LIBRARY euser.lib efsrv.lib cone.lib
-LIBRARY eikcore.lib fbscli.lib gdi.lib
-LIBRARY svgengine.lib
-LIBRARY HWRMLightClient.lib
-//LIBRARY pluginadapterutil.lib
-LIBRARY ecom.lib
-
-LIBRARY centralrepository.lib
-LIBRARY remconcoreapi.lib
-LIBRARY remconinterfacebase.lib
-LIBRARY FeatMgr.lib
--- a/svgtopt/SVGTPlugin/group/bld.inf Tue May 11 17:02:26 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
-* Copyright (c) 2002 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: This is a build file that builds SVGTPlugin alone
-*
-*/
-
-
-//Platforms listed are not built by SVGTPlugin
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-
-PRJ_MMPFILES
-#ifdef __SERIES60_NATIVE_BROWSER
-SVGTPluginS60Ecom.mmp
-#endif // __SERIES60_NATIVE_BROWSER
-
--- a/svgtopt/SVGTPlugin/inc/MRepositoryVolumeObserver.h Tue May 11 17:02:26 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-/*
-* Copyright (c) 2006 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Definition of the interface MRepositoryVolumeObserver used to
-* observer events from CRepositoryVolumeListener
-*
-*/
-
-
-//
-// JRT 22_09_04
-// Version 1.0 release.
-
-#ifndef REPOSITORYVOLUMEOBSERVER_H
-#define REPOSITORYVOLUMEOBSERVER_H
-
-class MRepositoryVolumeObserver
-{
- public:
- virtual void VolumeChanged(TInt aNewValue) = 0;
-};
-
-#endif //REPOSITORYVOLUMEOBSERVER_H
-
--- a/svgtopt/SVGTPlugin/inc/RepositoryVolumeListener.h Tue May 11 17:02:26 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
-* Copyright (c) 2006 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: AO that completes on a change in the volume property. Used for
-* the new Central Repository Server. Used in EKA2 builds only
-*
-*/
-
-
-//
-#ifndef REPOSITORYVOLUMELISTENER_H
-#define REPOSITORYVOLUMELISTENER_H
-
-#include <e32std.h>
-#include <e32base.h>
-#include <e32property.h>
-
-//
-// for emulator max volume = 65535
-#define WINS_DEFAULT_VOLUME 43690
-
-//
-// For HW max volume = 9
-#define HW_DEFAULT_VOLUME 6
-
-#include <centralrepository.h>
-
-class MRepositoryVolumeObserver;
-
-NONSHARABLE_CLASS( CRepositoryVolumeListener ) : public CActive
- {
-public:
- enum TPropertyWatchState
- {
- EConnected = 1,
- EUnableToConnect
- };
-
- static CRepositoryVolumeListener* NewL(MRepositoryVolumeObserver* aObserver);
- virtual ~CRepositoryVolumeListener();
- TInt GetCurrentVolume();
-
-private:
- CRepositoryVolumeListener();
- void ConstructL(MRepositoryVolumeObserver* aObserver);
- TInt GetDefaultVolume();
-
- //From CActive
- void RunL();
- void DoCancel();
-
-
- CRepository* iCenRepos;
-
- TPropertyWatchState iState;
-
- MRepositoryVolumeObserver* iObserver;
- };
-
-#endif //REPOSITORYVOLUMELISTENER_H
--- a/svgtopt/SVGTPlugin/inc/SvgtPlugin.hrh Tue May 11 17:02:26 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
-* Copyright (c) 2003 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: SVGT Plugin Implementation source file
- *
-*/
-
-#ifndef SVGTPLUGIN_HRH
-#define SVGTPLUGIN_HRH
-
-enum TSVGTPluginCommandIds
- {
- ESVGTPluginPause = 1,
- ESVGTPluginResume,
- ESVGTPluginReset,
- ESVGTPluginReplay,
- ESVGTPluginZoomSubMenu,
- ESVGTPluginRotateSubMenu,
- ESVGTPluginZoomIn,
- ESVGTPluginZoomOut,
- ESVGTPluginRotate90,
- ESVGTPluginRotate180,
- ESVGTPluginRotate270
- };
-
-
-
-
-#endif // SVGTPLUGIN_HRH
--- a/svgtopt/SVGTPlugin/inc/Svgtplugin.h Tue May 11 17:02:26 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,333 +0,0 @@
-/*
-* Copyright (c) 2003 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: SVGT Plugin Implementation header file
- *
-*/
-
-
-#ifndef __SVGTPLUGIN_H
-#define __SVGTPLUGIN_H
-
-#include <e32std.h>
-#include <coecntrl.h>
-#include <coemain.h>
-#include <fbs.h>
-#include <barsread.h>
-
-#include <hwrmlight.h>
-//SVGT Engine interface
-#include <SVGRequestObserver.h>
-#include <SVGEngineInterfaceImpl.h>
-#include <SVGHyperlinkListener.h>
-#include "SVGListener.h"
-
-#include <npupp.h>
-#include <pluginadapterinterface.h>
-
-#include <cecombrowserplugininterface.h>
-
-#include "MRepositoryVolumeObserver.h"
-
-class CSvgtPlugin;
-class CSvgEngineInterfaceImpl;
-class CFbsBitmap;
-
-class CVolumeKeyListener;
-class CRepositoryVolumeListener;
-/******************************************
-This class is specific to ECom Style Plugin.
-This is used for passing plugin specific initialization information to and from
-browser.
-*******************************************/
-
-IMPORT_C NPError InitializeFuncs(NPPluginFuncs* aPpf);
-
-const TInt KSvgtPluginImplementationValue = 0x101F8823; //implementation id Svgt Ecom Plugin
-
-class CSvgtPluginEcomMain : public CEcomBrowserPluginInterface
- {
- public: // Functions from base classes
- static CSvgtPluginEcomMain* NewL(TAny* aInitParam);
- ~CSvgtPluginEcomMain();
- NPNetscapeFuncs* Funcs() {return iNpf;}
- private:
- CSvgtPluginEcomMain(NPNetscapeFuncs* aNpf);
- void ConstructL(NPPluginFuncs* aPluginFuncs);
- NPNetscapeFuncs* iNpf;
- };
-
-/****************************************
-Class CSvgtPluginControl
-Class to Handle UI related actions
-****************************************/
-
-class CSvgtPluginControl : public CCoeControl, public MCoeControlObserver,
- public MPluginNotifier, public MHWRMLightObserver
-
- {
-public:
- ~CSvgtPluginControl();
- void ConstructL(CSvgtPlugin *aPlugin, const CCoeControl *aParentControl);
- TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
- void FocusChanged(TDrawNow aDrawNow);
-private: // new - possible notifications
-#ifndef ER5
- TCoeInputCapabilities InputCapabilities() const;
-#endif
- void ApplicationFocusChanged(TBool aInFocus);
- void SystemNotification();
- void Draw(const TRect& aRect) const;
- TInt CountComponentControls() const;
- CCoeControl* ComponentControl(TInt aIndex) const;
- void HandlePointerEventL(const TPointerEvent& aPointerEvent);
- void SizeChanged();
- void HandleControlEventL(CCoeControl* aControl, TCoeEvent aEventType);
-private: // in MPluginNottify in S60
- TInt NotifyL(TNotificationType aCallType, void* aParam);
-public: //From MEikMenuObserver
-
-
-public:
- void LightStatusChanged(TInt aTarget, CHWRMLight::TLightStatus aStatus);
- CHWRMLight* iLightObserver;
- void AsFile(const TDesC& fname,NPStream* stream);
- TBool IsAsFileCalled();
- TDesC& GetFilename();
-
-private:
- void UpdatePointer(TInt aShiftX =0 , TInt aShiftY=0);
-
-public:
- TSize iContentDimension;
-private:
- CSvgtPlugin *iPlugin;
- TInt iPointerDx, iPointerDy;// increment decrement
- TInt iPointerX, iPointerY;//actual Pointer position with respect to Document.
- TBool iAsFileCalled;
- TBuf<256> iFilename;
- TBool iShowCursor;
- TInt iXPosAtMouseDown;
- TInt iYPosAtMouseDown;
- TKeyEvent iPreviousScanCode; //Introduced to differentiate long keypress and short key press
-
- };
-
-
-/*******************************************************
-Class CSvgtPlugin
-********************************************************/
-
-class CSvgtPlugin : public CBase,
- public MSvgRequestObserver,
- public MSvgHyperlinkListener,
- public MSvgViewPortListener
- ,
- public MRepositoryVolumeObserver
- {
- struct ImageInfo
- {
- TBuf<256> iImageRefUri;
- TBool iImagePendingOps;
- };
-
-public:
- static CSvgtPlugin* NewL(NPP anInstance);
- ~CSvgtPlugin();
- void ConstructL(NPP anInstance);
- void PrepareToExitL();
- CSvgtPluginControl* Control();
- void GetSizeOfRenderBuffer(TSize& aSize);
- NPP Instance();
- void SetWindowL(const NPWindow *aWindow,const TRect& aRect);
- /**
- * ResizeWindow This function set width & height to the browser
- * and tell brower to resize.
- *
- * @since S60 3.1
- * @param TInt width that needed to be used.
- * @param TInt height that needed to be used.
- * @return void
- */
- void ResizeWindow(TInt width, TInt height);
-
- /**
- * AdjustDimention
- *
- * @since S60 3.1
- * @return ETrue if dimention needs to be changed. EFalse if dimention
- * remains the same.
- */
- TBool AdjustDimention( TBool aWidthInPercentage,
- TBool aHeightInPercentage );
-
- /**
- * This function retrieves attributes from HTML that is
- * passed in by browser engine.
- *
- * @since S60 3.1
- * @param NPMIMEType
- * @param NPP
- * @param uint16
- * @param DesC16Array* attribute names
- * @param CDesC16Array* attribute values
- * @param NPSavedData*
- * @return NPError
- */
- NPError SvgPluginNew(NPMIMEType pluginType, NPP instance, uint16 mode,
- CDesC16Array* argn, CDesC16Array* argv, NPSavedData* saved);
-
-public: // implements MSvgRequestObserver
-
- void UpdateScreen();
-
- TBool ScriptCall( const TDesC& aScript,
- CSvgElementImpl* aCallerElement );
-
- TInt FetchImage( const TDesC& aUri, RFs& aSession, RFile& aFileHandle );
-
- TInt FetchFont( const TDesC& aUri, RFs& aSession, RFile& aFileHandle );
-
- void GetSmilFitValue(TDes& aSmilValue);
-
- void UpdatePresentation(const TInt32& aNoOfAnimation);
- // MHyperlinkListener interface methods
- TBool LinkEntered( const TDesC& aUri );
- TBool LinkExited( const TDesC& aUri );
- TBool LinkActivated( const TDesC& aUri );
- TBool LinkActivatedWithShow(const TDesC& aUri,const TDesC& aShow);
- //MSvgViewPortListener method
- void GetViewPort(TInt getWidth, TInt getHeight,TBool isWidthInPer, TBool isHeightInPer, TInt &setWidth, TInt &setHeight);
-
- // From MRepositoryVolumeObserver
- void VolumeChanged(TInt aNewValue);
-
- TBool LoadSvgFile( const TDesC& aFilename );
-
-private:
-
- void FetchImageL(const TDesC& aUri);
-public:
- CFbsBitmap * iRenderBuffer;
- TSize iControlSize;
- TBool iSetWindowCalled;
- TBool iStartCalled;
- CSvgEngineInterfaceImpl * iSvgModule;
- TInt iRenderWidth;
- TInt iRenderHeight;
- TInt iObjectWidth;
- TInt iObjectHeight;
- NPWindow iCurrentWindow;
-
- TBool iTotalNumerOfAnimation, iStaticContent;
-
- /*Image Rendering*/
- RPointerArray<HBufC> iImageUrlInfoList;
-
- TInt iViewPortWidth;
- TInt iViewPortHeight;
-private:
-
- CVolumeKeyListener* iKeyListener;
- CRepositoryVolumeListener* iRepositoryListener;
-
- MPluginAdapter* iPluginAdapter;
-
- //Control of UI for SVGT Engine
- CCoeControl * iParentControl;
- CSvgtPluginControl * iControl;
- NPP iInstance;
- TBool iIsRenderBufferDefined;
- TInt iResourceFileIndex;
- TBool iExpectedDefaultSize;
- TBool iAdjusted;
- // Flag indicates whether object height is specified
- // as percentage value
- TBool iObjHeightInPercentage;
- // Flag indicates whether object width is specified
- // as percentage value
- TBool iObjWidthInPercentage;
-
- //While parsing are object width height are specified or not
- TBool iObjectWidthSpecified;
- TBool iObjectHeightSpecified;
- };
-
-
-/*********************************************************************************
-
- Plugin API methods
-
-*/
-
-/**
- * Create a plugin.
- */
-NPError SvgtPluginNewp(NPMIMEType pluginType, NPP instance, uint16 mode, CDesCArray* argn, CDesCArray* argv, NPSavedData* saved);
-
-/**
- * Destroy a plugin.
- */
-NPError SvgtPluginDestroy(NPP instance, NPSavedData** save);
-
-/**
- * This is the parent window of a plugin.
- */
-NPError SvgtPluginSetWindow(NPP instance, NPWindow* window);
-
-/**
- * A new data stream has been created for sending data to the plugin.
- */
-NPError SvgtPluginNewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype);
-
-/**
- * A data stream has been terminated.
- */
-NPError SvgtPluginDestroyStream(NPP instance, NPStream* stream, NPReason reason);
-
-/**
- * A data stream has been fully saved to a file.
- */
-void SvgtPluginAsFile(NPP instance, NPStream* stream, const TDesC& fname);
-
-/**
- * Return the maximum number of bytes this plugin can accept from the stream.
- */
-int32 SvgtPluginWriteReady(NPP instance, NPStream* stream);
-
-/**
- * Receive more data - return number of bytes processed.
- */
-int32 SvgtPluginWrite(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer);
-
-/**
- * Generic hook to set values/attributes within the plugin.
- */
-NPError SvgtPluginSetValue(NPP instance, NPNVariable variable, void *ret_value);
-
-/**
- * Generic hook to get values/attributes from the plugin.
- */
-NPError SvgtPluginGetValue(NPP instance, NPNVariable variable, void* *ret_value);
-
-/**
- * Event
- */
-int16 SvgtPluginEvent(NPP instance, void* event);
-
-
-void SvgtPluginURLNotify(NPP instance, const TDesC& url, NPReason reason, void* notifyData);
-
-void SvgtPluginPrint(NPP instance, NPPrint* platformPrint);
-
-#endif // __PLGPLUGIN_H
\ No newline at end of file
--- a/svgtopt/SVGTPlugin/inc/VolumeKeyListener.h Tue May 11 17:02:26 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-/*
-* Copyright (c) 2006 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: It completes on a change in the volume property. Used for
-* the new Central Repository Server. Used in EKA2 builds only
-*
-*/
-
-
-#ifndef VOLUMEKEYLISTENER_H
-#define VOLUMEKEYLISTENER_H
-
-#include <e32std.h>
-#include <e32base.h>
-#include <e32property.h>
-
-#include <centralrepository.h>
-#include<remconcoreapitargetobserver.h> //for MRemConCoreApiTargetObserver
-#include<remconinterfaceselector.h> //for CRemConInterfaceSelector
-#include<remconcoreapitarget.h> //for CRemConCoreApiTarget
-
-//
-// for emulator max volume = 65535
-#define WINS_DEFAULT_VOLUME 43690
-
-//
-// For HW max volume = 9
-#define HW_DEFAULT_VOLUME 6
-
-class MRepositoryVolumeObserver;
-
-// DATA TYPES
-// Used for volume up/down events
-enum TVolumeControlCommands
- {
- EVolumeControlCmdVolumeUpByOne,
- EVolumeControlCmdVolumeDownByOne
- };
-
-NONSHARABLE_CLASS( CVolumeKeyListener ) : public CBase,
- public MRemConCoreApiTargetObserver
- {
-public:
-
- static CVolumeKeyListener* NewL( MRepositoryVolumeObserver* aObserver );
- virtual ~CVolumeKeyListener();
- TInt GetCurrentVolume();
- /**
- * Function to add an observer
- */
- void SetObserver( MRepositoryVolumeObserver* aObserver );
-
-private:
- CVolumeKeyListener( MRepositoryVolumeObserver* aObserver );
- void ConstructL();
-
- //From MRemConCoreApiTargetObserver (remconcoreapitargetobserver.h)
- void MrccatoCommand( TRemConCoreApiOperationId aOperationId,
- TRemConCoreApiButtonAction aButtonAct );
-
- /**
- * Handle repeat event
- */
- void HandleRepeatEvent();
-
- /**
- * Send play command to app UI or view.
- * @since 3.1
- */
- void FilterAndSendCommand(TInt aCommandId);
- /**
- * Callback for timer
- */
- static TInt TimerCallback(TAny* aPtr);
-
-private:
- CRemConCoreApiTarget* iInterfaceSelector;
- CRemConInterfaceSelector* iSelector;
- CRepository* iCenRepos;
- CPeriodic* iTimer; // owned
- TInt iCommandId;
- // Stores the observers.
- MRepositoryVolumeObserver* iObserver;
- };
-
-#endif //VOLUMEKEYLISTENER_H
-
-// End of File
--- a/svgtopt/SVGTPlugin/loc/npSVGTPlugin.loc Tue May 11 17:02:26 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,145 +0,0 @@
-/*
-* Copyright (c) 2003 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-
-// r: GSM/CDMA
-// v:
-// i: LOCALISATION_TARGET = S90
-
-
-//b: n/a
-//e: n/a
-//f: n/a
-//s: SVG-MEN001
-//w: S90MenuHdr
-//d: This is the menu command in the Svg Browser plugin. The Menu appears
-//d: when the user taps and holds the stylus for predefined time on the
-//d: svg display area in the browser window. "Pause" is used to pause
-//d: current svg animation
-#define SVGT_ME_MEN001_PAUSE "Pause"
-
-
-//b: n/a
-//e: n/a
-//f: n/a
-//s: SVG-MEN001
-//w: S90MenuHdr
-//d: This is the menu command in the Svg Browser plugin. The Menu appears
-//d: when the user taps and holds the stylus for predefined time on the
-//d: svg display area in the browser window. "Resume" is used to resume playing of
-//d: paused svg animation
-#define SVGT_ME_MEN001_RESUME "Resume"
-
-
-//b: n/a
-//e: n/a
-//f: n/a
-//s: SVG-MEN001
-//w: S90MenuHdr
-//d: This is the menu command in the Svg Browser plugin. The Menu appears
-//d: when the user taps and holds the stylus for predefined time on the
-//d: svg display area in the browser window. "Reset" is used to reset current
-//d: svg animation
-#define SVGT_ME_MEN001_RESET "Reset"
-
-//b: n/a
-//e: n/a
-//f: n/a
-//s: SVG-MEN001
-//w: S90MenuHdr
-//d: This is the menu command in the Svg Browser plugin. The Menu appears
-//d: when the user taps and holds the stylus for predefined time on the
-//d: svg display area in the browser window. "Replay" is used to play the
-//d: current svg animation from the start.
-#define SVGT_ME_MEN001_REPLAY "Replay"
-
-//b: n/a
-//e: n/a
-//f: n/a
-//s: SVG-MEN001
-//w: S90MenuHdr
-//d: This is the menu command in the Svg Browser plugin. The Menu appears
-//d: when the user taps and holds the stylus for predefined time on the
-//d: svg display area in the browser window. "Zoom" is used to pop out a
-//d: cascade menu for "Zoom In" and "Zoom Out" options
-#define SVGT_ME_MEN001_ZOOM "Zoom"
-
-//b: n/a
-//e: n/a
-//f: n/a
-//s: SVG-MEN001
-//w: S90MenuHdr
-//d: This is the menu command in the Svg Browser plugin. The Menu appears
-//d: when the user taps and holds the stylus for predefined time on the
-//d: svg display area in the browser window. "Rotate" is used to pop out a
-//d: cascade menu for "Rotate by 90°", "Rotate by 180°" and "Rotate by 270°" options
-#define SVGT_ME_MEN001_ROTATE "Rotate"
-
-//b: n/a
-//e: n/a
-//f: n/a
-//s: SVG-MEN001
-//w: S90MenuCmd
-//d: This is the menu command in the Svg Browser plugin. The Menu appears
-//d: when the user taps and holds the stylus for predefined time on the
-//d: svg display area in the browser window. "In" is used to Zoom In to the
-//d: current svg content
-#define SVGT_ME_MEN001_ZOOM_IN "In"
-
-//b: n/a
-//e: n/a
-//f: n/a
-//s: SVG-MEN001
-//w: S90MenuCmd
-//d: This is the menu command in the Svg Browser plugin. The Menu appears
-//d: when the user taps and holds the stylus for predefined time on the
-//d: svg display area in the browser window. "Out" is used to Zoom Out of the
-//d: current svg content
-#define SVGT_ME_MEN001_ZOOM_OUT "Out"
-
-//b: n/a
-//e: n/a
-//f: n/a
-//s: SVG-MEN001
-//w: S90MenuCmd
-//d: This is the menu command in the Svg Browser plugin. The Menu appears
-//d: when the user taps and holds the stylus for predefined time on the
-//d: svg display area in the browser window. "90°" is used to display current
-//d: svg content by rotating it by 90 degrees
-#define SVGT_ME_MEN001_ROTATE_90 "90°"
-
-//b: n/a
-//e: n/a
-//f: n/a
-//s: SVG-MEN001
-//w: S90MenuCmd
-//d: This is the menu command in the Svg Browser plugin. The Menu appears
-//d: when the user taps and holds the stylus for predefined time on the
-//d: svg display area in the browser window. "180°" is used to display current
-//d: svg content by rotating it by 180 degrees
-#define SVGT_ME_MEN001_ROTATE_180 "180°"
-
-//b: n/a
-//e: n/a
-//f: n/a
-//s: SVG-MEN001
-//w: S90MenuCmd
-//d: This is the menu command in the Svg Browser plugin. The Menu appears
-//d: when the user taps and holds the stylus for predefined time on the
-//d: svg display area in the browser window. "270°" is used to display current
-//d: svg content by rotating it by 270 degrees
-#define SVGT_ME_MEN001_ROTATE_270 "270°"
\ No newline at end of file
--- a/svgtopt/SVGTPlugin/resource/s60/101F86DF.rss Tue May 11 17:02:26 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
-* Copyright (c) 2003 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Registry file for Ecom style SVGT Plugin.
-*
-*/
-
-
-
-
-
-#include "registryinfo.rh"
-
-// RESOURCE DEFINITIONS
-// -----------------------------------------------------------------------------
-//
-// Registry info
-// The UIDs for the filters implemented in this DLL
-//
-// -----------------------------------------------------------------------------
-//
-
-RESOURCE REGISTRY_INFO theInfo
- {
- dll_uid = 0x101F86DF; // should match the name of the file.
- // 3-d Uid of associeted plugin dll (declared in the dll mmp file)
-
- interfaces=
- {
- INTERFACE_INFO
- {
- interface_uid = 0x101F8810; // identifies plugin type (used by ECom)
- implementations =
- {
- IMPLEMENTATION_INFO
- {
- implementation_uid = 0x101F8823; // specify specific implementation (must
- // match an implementation entry in the dll
- version_no = 1;
- display_name = "npsvgtplugin.dll;SVGT Plugin";// file name; plugin's name
- default_data = "image/svg+xml;svg,svgb,svgz,dcf;SVG Content";
- // suppored mime types
- // mime Extensions
- // and mime descriptions
- opaque_data = "Scalable Vector Graphics Tiny Model Plugin"; // plugin's description
- }
- };
- }
- };
- }
-
--- a/svgtopt/SVGTPlugin/resource/s90/npSvgtplugin.rss Tue May 11 17:02:26 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/*
-* Copyright (c) 2003 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: This file contains all the resources for the SVGT Plugin.
-*
-*/
-
-
-// RESOURCE IDENTIFIER
-NAME SVGT
-
-// INCLUDES
-#include <eikon.rh>
-#include "SvgtPlugin.hrh"
-#include <npSvgtPlugin.loc>
-
-RESOURCE RSS_SIGNATURE { }
-
-RESOURCE TBUF { buf=""; }
-
-RESOURCE EIK_APP_INFO
-{
-}
-
-RESOURCE MNBUT r_svgtplugin_menu_button
-{
- popout = r_svgtplugin_menu_pane;
-}
-
-RESOURCE MENU_PANE r_svgtplugin_menu_pane
- {
- items=
- {
- MENU_ITEM { command=ESVGTPluginPause; txt=SVGT_ME_MEN001_PAUSE; },
- MENU_ITEM { command=ESVGTPluginResume; txt=SVGT_ME_MEN001_RESUME; },
- MENU_ITEM { command=ESVGTPluginReset; txt=SVGT_ME_MEN001_RESET; },
- MENU_ITEM { command=ESVGTPluginReplay; txt=SVGT_ME_MEN001_REPLAY; },
- MENU_ITEM { command=ESVGTPluginZoomSubMenu; txt=SVGT_ME_MEN001_ZOOM; cascade=r_svgtplugin_zoom_cascaded_menu; },
- MENU_ITEM { command=ESVGTPluginRotateSubMenu; txt=SVGT_ME_MEN001_ROTATE; cascade=r_svgtplugin_rotate_cascaded_menu;}
- };
- }
-
-RESOURCE MENU_PANE r_svgtplugin_zoom_cascaded_menu
- {
- items =
- {
- MENU_ITEM { command = ESVGTPluginZoomIn; txt = SVGT_ME_MEN001_ZOOM_IN; },
- MENU_ITEM { command = ESVGTPluginZoomOut; txt = SVGT_ME_MEN001_ZOOM_OUT; }
- };
- }
-
-RESOURCE MENU_PANE r_svgtplugin_rotate_cascaded_menu
- {
- items =
- {
- MENU_ITEM { command = ESVGTPluginRotate90; txt = SVGT_ME_MEN001_ROTATE_90;},
- MENU_ITEM { command = ESVGTPluginRotate180; txt = SVGT_ME_MEN001_ROTATE_180; },
- MENU_ITEM { command = ESVGTPluginRotate270; txt = SVGT_ME_MEN001_ROTATE_270; }
- };
- }
-
-
-// End of File
-
--- a/svgtopt/SVGTPlugin/src/RepositoryVolumeListener.cpp Tue May 11 17:02:26 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,150 +0,0 @@
-/*
-* Copyright (c) 2006 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: AO that completes on a change in the volume property. Used for
-* the new Central Repository Server. Used in EKA2 builds only
-*
-*/
-
-
-//#include <SharedDataClient.h>
-
-
-#include "RepositoryVolumeListener.h"
-//#include <SharedDataKeys.h> //include this file when KSDUidMediaVolumeControl and KMediaVolume will be needed
-//#include "epocdebug.h"
-#include <browseruisdkcrkeys.h>
-#include "MRepositoryVolumeObserver.h"
-
-CRepositoryVolumeListener* CRepositoryVolumeListener::NewL(MRepositoryVolumeObserver* aObserver)
- {
- CRepositoryVolumeListener* self = new(ELeave) CRepositoryVolumeListener;
- CleanupStack::PushL(self);
- self->ConstructL(aObserver);
- CleanupStack::Pop(self);
- return self;
- }
-
-CRepositoryVolumeListener::CRepositoryVolumeListener() : CActive(CActive::EPriorityStandard)
- {
- iState = EUnableToConnect;
- CActiveScheduler::Add(this) ; // add to active scheduler
- }
-
-void CRepositoryVolumeListener::ConstructL(MRepositoryVolumeObserver* aObserver)
- {
- //
- // Open a connection to the Central Repository...
- iCenRepos = CRepository::NewL(KCRUidBrowser);
-
- if ( iCenRepos->NotifyRequest(KBrowserMediaVolumeControl, iStatus) == KErrNone )
- {
- iState = EConnected;
- SetActive();
- }
- else
- {
- iState = EUnableToConnect;
- }
-
- iObserver = aObserver;
- }
-
-CRepositoryVolumeListener::~CRepositoryVolumeListener()
- {
- Cancel();
- delete iCenRepos; // close the client session
- }
-
-//
-// Get the current volume
-TInt CRepositoryVolumeListener::GetCurrentVolume()
- {
- TInt currentVolume = 0;
-
- if ( iState == EUnableToConnect )
- {
- //
- // Connection to CenRepos not available so return the default volume
- currentVolume = GetDefaultVolume();
- }
- else
- {
- //
- // Get the current volume
- if ( iCenRepos->Get(KBrowserMediaVolumeControl, currentVolume) != KErrNone )
- {
- // Error retrieving value... return default value
- //PLAYEROUTPUT("*ERROR* CRepositoryVolumeListener::GetCurrentVolume() - Unable to retreive volume value");
- currentVolume = GetDefaultVolume();
- }
- }
-
- return currentVolume;
- }
-
-//
-// Return the default volume in this case 2/3 of the max support by the system
-TInt CRepositoryVolumeListener::GetDefaultVolume()
- {
- TInt defaultVol = 0;
-
- #if defined(__WINS__)
- defaultVol = WINS_DEFAULT_VOLUME;
- #else
- defaultVol = HW_DEFAULT_VOLUME;
- #endif
-
- return defaultVol;
- }
-
-void CRepositoryVolumeListener::DoCancel()
- {
- iCenRepos->NotifyCancel(KBrowserMediaVolumeControl);
- }
-
-//
-// Activated when the watched value updates.
-void CRepositoryVolumeListener::RunL()
- {
- TInt currentVolume = 0;
-
- if (EUnableToConnect == iState)
- {
- return;
- }
-
- //
- // Get the current volume
- if ( iCenRepos->Get(KBrowserMediaVolumeControl, currentVolume) == KErrNone )
- {
- //
- // Inform the observer
- iObserver->VolumeChanged(currentVolume);
- if ( iCenRepos->NotifyRequest(KBrowserMediaVolumeControl, iStatus) == KErrNone )
- {
- SetActive();
- }
- else
- {
- iState = EUnableToConnect;
- }
- }
- else
- {
- //
- // error
- iState = EUnableToConnect;
- }
-
- }
--- a/svgtopt/SVGTPlugin/src/SvgtPluginControl.cpp Tue May 11 17:02:26 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,589 +0,0 @@
-/*
-* Copyright (c) 2003 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: SVGT Plugin Implementation source file
- *
-*/
-
-#include <featmgr.h>
-#include <eikenv.h>
-#include <w32std.h>
-#include <e32base.h>
-#include <barsread.h>
-#include <SVGEngineInterfaceImpl.h>
-//#include <Svgengineinterface.h>
-#include <f32file.h>
-
-#include "Svgtplugin.h"
-
-#define SVGT_PLUGIN_DEVICE_KEY_0 48
-#define SVGT_PLUGIN_DEVICE_KEY_1 49
-#define SVGT_PLUGIN_DEVICE_KEY_2 50
-#define SVGT_PLUGIN_DEVICE_KEY_3 51
-#define SVGT_PLUGIN_DEVICE_KEY_4 52
-#define SVGT_PLUGIN_DEVICE_KEY_5 53
-#define SVGT_PLUGIN_DEVICE_KEY_6 54
-#define SVGT_PLUGIN_DEVICE_KEY_7 55
-#define SVGT_PLUGIN_DEVICE_KEY_8 56
-#define SVGT_PLUGIN_DEVICE_KEY_9 57
-#define SVGT_PLUGIN_DEVICE_KEY_ASTERIX 42
-
-
-void CSvgtPluginControl::ConstructL(CSvgtPlugin* aPlugin, const CCoeControl* aParentControl)
- {
- iAsFileCalled = EFalse;
- iShowCursor = EFalse;
- iPointerX = 5;
- iPointerY = 5;
- iPlugin=aPlugin;
- this->CreateWindowL(aParentControl);
- ActivateL();
- EnableDragEvents();
- iLightObserver = CHWRMLight::NewL(this);
- }
-
-CSvgtPluginControl::~CSvgtPluginControl()
- {
- delete iLightObserver;
- }
-
-void CSvgtPluginControl::Draw(const TRect& aRect) const
- {
- CWindowGc &gc = SystemGc();
- if (iPlugin && iPlugin->iRenderBuffer !=NULL)
- {
-
- // Fix for the iframe scrolling.
- TRect lCliprect;
-
- lCliprect.iTl.iY = iPlugin->iCurrentWindow.clipRect.top;
- lCliprect.iTl.iX = iPlugin->iCurrentWindow.clipRect.left;
- lCliprect.iBr.iY = iPlugin->iCurrentWindow.clipRect.bottom;
- lCliprect.iBr.iX = iPlugin->iCurrentWindow.clipRect.right;
-
- TSize lWindowSize(iPlugin->iCurrentWindow.width,iPlugin->iCurrentWindow.height);
-
- if(lWindowSize!=(lCliprect.Size()))
- {
- // Get the Abs(x,y) of the window and render with the size of the cliprect
- TPoint lpt(Abs(iPlugin->iCurrentWindow.x),Abs(iPlugin->iCurrentWindow.y ));
- TRect lrect(lpt,lCliprect.Size());
- gc.BitBlt( aRect.iTl, (iPlugin->iRenderBuffer), lrect );
- }
- else
- {
- gc.BitBlt( aRect.iTl, (iPlugin->iRenderBuffer), aRect );
- }
-
-
- if ( iShowCursor )
- {
- TInt lX = iPointerX + aRect.iTl.iX;
- TInt lY = iPointerY + aRect.iTl.iY;
- TRect csrh ( lX - 2,
- lY - 5,
- lX + 2,
- lY + 5 );
- TRect csrv ( lX - 5,
- lY - 2,
- lX + 5,
- lY + 2 );
- gc.SetPenSize( TSize( 1, 1 ) );
- gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
- gc.SetBrushColor( TRgb( 0, 0, 0 ) );
- gc.SetPenColor( TRgb( 0, 0, 0 ) );
- gc.DrawRect( csrh );
- gc.DrawRect( csrv );
- csrh.Shrink( 1, 1 );
- csrv.Shrink( 1, 1 );
- gc.SetBrushColor( TRgb( 255, 225, 225 ) );
- gc.SetPenColor( TRgb( 255, 225, 225 ) );
- gc.DrawRect( csrh );
- gc.DrawRect( csrv );
- }
- }
- }
-
-TInt CSvgtPluginControl::CountComponentControls() const
- {
- return 0;
- }
-
-CCoeControl* CSvgtPluginControl::ComponentControl(TInt /*aIndex*/) const
- {
- return NULL;
- }
-
-void CSvgtPluginControl::SizeChanged()
- {
- }
-
-#ifndef ER5
-TCoeInputCapabilities CSvgtPluginControl::InputCapabilities() const
- {
- return TCoeInputCapabilities(TCoeInputCapabilities::ENavigation);
- }
-#endif
-
-void CSvgtPluginControl::HandleControlEventL(CCoeControl* /*aControl*/, TCoeEvent /*aEventType*/)
- {
- }
-
-void CSvgtPluginControl::FocusChanged(TDrawNow /*aDrawNow*/)
- {
- }
-
-TKeyResponse CSvgtPluginControl::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
- {
- TKeyResponse retVal = EKeyWasNotConsumed;
- if( iPlugin->iSvgModule && iPlugin->iSvgModule->SvgDocument() )
- {
- if ( aType == EEventKeyUp )
- {
- iPointerDx = 0;
- iPointerDy = 0;
- if ( aKeyEvent.iScanCode == EStdKeyDevice3 ) // Center button of rocker key
- {
- iPlugin->iSvgModule->MouseUp( iPointerX, iPointerY );
- retVal = EKeyWasConsumed;
- }
- if(iPreviousScanCode.iScanCode == SVGT_PLUGIN_DEVICE_KEY_0)
- {
- if(!iPreviousScanCode.iRepeats) /*Short Key Press of 'Zero' Do Zoom Out*/
- {
- iPlugin->iSvgModule->Zoom(0.5f);
- iPlugin->iSvgModule->Redraw();
- }
- else /*Long Key Press of 'Zero' Reset to Original View*/
- {
- iPlugin->iSvgModule->OriginalView();
- iPlugin->iSvgModule->Redraw();
- }
- retVal = EKeyWasConsumed;
-
- }
- iPreviousScanCode.iRepeats = 0;
- iPreviousScanCode.iCode = 0;
- iPreviousScanCode.iScanCode = 0;
- }
- else if ( aType == EEventKey )
- {
- retVal = EKeyWasConsumed;
- // aKeyEvent.iScanCode does not recognize EStdKeyNkpAsterisk
- switch ( aKeyEvent.iScanCode )
- {
- case EStdKeyLeftArrow:
- iPointerDx -= 5;
- iPointerDy = 0;
- break;
- case EStdKeyRightArrow:
- iPointerDx += 5;
- iPointerDy = 0;
- break;
- case EStdKeyUpArrow:
- iPointerDx = 0;
- iPointerDy -= 5;
- break;
- case EStdKeyDownArrow:
- iPointerDx = 0;
- iPointerDy += 5;
- break;
- case EStdKeyDevice3:
- // Center button of rocker key
- iPlugin->iSvgModule->MouseDown( iPointerX, iPointerY );
- break;
- case EStdKeyHash: // Pause/Resume
- if(iPlugin->iSvgModule->CurrentState() == 0)
- iPlugin->iSvgModule->Stop();
- else if(iPlugin->iSvgModule->CurrentState() == 1)
- iPlugin->iSvgModule->Resume();
- break;
-
- case SVGT_PLUGIN_DEVICE_KEY_5: //Zoom In
- iPlugin->iSvgModule->Zoom(2.0f);
- iPlugin->iSvgModule->Redraw();
- break;
-
- case SVGT_PLUGIN_DEVICE_KEY_1: //Rotate ClockWise 90
- iPlugin->iSvgModule->Rotate( (float) (3.1415926/2), iContentDimension.iWidth/2, iContentDimension.iHeight/2);
- iPlugin->iSvgModule->Redraw();
- break;
-
- case SVGT_PLUGIN_DEVICE_KEY_3: //Rotate Counter ClockWise 90
- iPlugin->iSvgModule->Rotate( (float) (-3.1415926/2), iContentDimension.iWidth/2, iContentDimension.iHeight/2);
- iPlugin->iSvgModule->Redraw();
- break;
- case SVGT_PLUGIN_DEVICE_KEY_7: //Rotate ClockWise 45
- iPlugin->iSvgModule->Rotate( (float) (3.1415926/4), iContentDimension.iWidth/2, iContentDimension.iHeight/2);
- iPlugin->iSvgModule->Redraw();
- break;
- case SVGT_PLUGIN_DEVICE_KEY_9: //Rotate Counter ClockWise 45
- iPlugin->iSvgModule->Rotate( (float) (-3.1415926/4), iContentDimension.iWidth/2, iContentDimension.iHeight/2);
- iPlugin->iSvgModule->Redraw();
- break;
- case SVGT_PLUGIN_DEVICE_KEY_0:
- iPreviousScanCode = aKeyEvent;
- break;
- default:
- retVal = EKeyWasNotConsumed;
- }
- }
-
- else if ( aType == EEventKeyDown)
- {
- // Send the mousedown event for triggering any animation
- // Since the EEventKey is not recieved when MSK is pressed,
- // the mousedown doesn't occur on engine. Hence EEventKey
- // handled here
- if ( aKeyEvent.iScanCode == EStdKeyDevice3 ) // Center button of rocker key
- {
- iPlugin->iSvgModule->MouseDown( iPointerX, iPointerY );
- retVal=EKeyWasConsumed;
- }
- }
-
- if ( (iPointerDx != 0) || (iPointerDy != 0) )
- {
- UpdatePointer(iPointerDx,iPointerDy);
- }
- }
- return retVal;
- }
-
-
-void CSvgtPluginControl::AsFile(const TDesC& fname,NPStream* stream)
- {
- // -----------------------------------
- // Check for image was requested
- // -----------------------------------
- if( iPlugin && iFilename.Length() > 0 )
- {
- TInt lFileSize = 0;
- RFile lSvgFile;
- CEikonEnv* iEikEnv = CEikonEnv::Static();
-
- // Attempt to open the file in read mode
- User::LeaveIfError( lSvgFile.Open(iEikEnv->FsSession(),fname,EFileRead ) );
-
- // Save on cleanup stack
- CleanupClosePushL( lSvgFile );
-
- // Get the size of the data to create read buffer
- User::LeaveIfError( lSvgFile.Size(lFileSize) );
-
- // Create buffer that will contain the file data
- HBufC8* lFileData = HBufC8::NewLC(lFileSize);
- TPtr8 lFileDataPtr(lFileData->Des());
-
- // Read from the file
- User::LeaveIfError( lSvgFile.Read(lFileDataPtr) );
-
- TInt index = reinterpret_cast<TInt>((stream->notifyData));
-
- iPlugin->iSvgModule->AssignImageData(*(iPlugin->iImageUrlInfoList[index]), lFileData );
- iPlugin->iSvgModule->Redraw();
-
- // The ownership of lFileData is with the respective Image Element.
- CleanupStack::Pop(1);
- CleanupStack::PopAndDestroy(&lSvgFile); // lSvgFile.Close()
-
- return;
- }
-
- // Svg file
- iFilename.Zero();
- iFilename.Copy(fname);
-
- if ( ( iPlugin && iPlugin->iSvgModule ) )
- {
- iPlugin->iSvgModule->Stop();
- iPlugin->LoadSvgFile( iFilename );
- // After loading the content, the width & height will be visible to plugin.
- // It is time to adjust the size if needed.
- TBool widthInPercentage = EFalse;
- TBool heightInPercentage = EFalse;
- iContentDimension = iPlugin->iSvgModule->ContentDimensionsInPercentage();
-
- if(iContentDimension.iWidth == -1)
- {
- widthInPercentage = EFalse;
- if(iPlugin->iSvgModule->SvgDocument())
- {
- iContentDimension.iWidth = iPlugin->iSvgModule->GetViewportWidth(iPlugin->iSvgModule->SvgDocument());
- }
- else
- {
- return;
- }
- }
- else
- {
- widthInPercentage = ETrue;
- }
-
- if(iContentDimension.iHeight == -1)
- {
- heightInPercentage = EFalse;
- if(iPlugin->iSvgModule->SvgDocument())
- {
- iContentDimension.iHeight = iPlugin->iSvgModule->GetViewportHeight(iPlugin->iSvgModule->SvgDocument());
- }
- else
- {
- return;
- }
-
- }
- else
- {
- heightInPercentage = ETrue;
- }
- if(iPlugin->AdjustDimention(widthInPercentage, heightInPercentage))
- {
- // dimention change is needed so return and notify Browser.
- iAsFileCalled = ETrue;
- return;
- }
-
- iPlugin->iSvgModule->Start();
- }
- iAsFileCalled = ETrue;
- }
-
-
-TBool CSvgtPluginControl::IsAsFileCalled()
- {
- return iAsFileCalled;
- }
-
-TDesC& CSvgtPluginControl::GetFilename()
- {
- return iFilename;
- }
-
-
-void CSvgtPluginControl::LightStatusChanged(TInt aTarget, CHWRMLight::TLightStatus aStatus)
-{
- //TInt lState = iPlugin->iSvgModule->CurrentState();
- if((aTarget == CHWRMLight::EPrimaryDisplay) || (aTarget == CHWRMLight::EPrimaryDisplayAndKeyboard))
- {
- if(aStatus == CHWRMLight::ELightOff)
- {
-
- if (iPlugin && iPlugin->iSvgModule)
- {
- #ifdef _DEBUG
- RDebug::Printf("Backlight Off");
- #endif //_DEBUG
-
- iPlugin->iSvgModule->Pause();
- }
-
- }
- else if(aStatus == CHWRMLight::ELightOn)
- {
-
- if (iPlugin && iPlugin->iSvgModule)
- {
- #ifdef _DEBUG
- RDebug::Printf("Backlight On");
- #endif //_DEBUG
-
- iPlugin->iSvgModule->Resume();
- }
- }
- }
-
-}
-/**
-* MOperaPluginNotifier methods
-* - Handle notifications browser
-*/
-TInt CSvgtPluginControl::NotifyL(TNotificationType aCallType, void* aParam)
- {
- if ( (iPlugin == NULL ) || ( iPlugin->iSvgModule == NULL ) )
- {
- return KErrNone;
- }
-
- if(aCallType == EApplicationFocusChanged)
- {
- TInt lState = iPlugin->iSvgModule->CurrentState();
- TBool lInFocus = (TBool) aParam;
-
- if ( lInFocus )
- {
- // iShowCursor = ETrue;
- if ( lState == 1 )
- {
- iPlugin->iSvgModule->Resume();
- }
- DrawNow();
- }
- else if ( !lInFocus )
- {
- //ShowCursor = EFalse;
- if ( lState == 0 )
- {
- iPlugin->iSvgModule->Pause();
- }
- DrawNow();
- }
- }
- else if(aCallType == EPluginActivated)
- {
- iShowCursor = ETrue;
- DrawNow();
- }
- else if(aCallType == EPluginDeactivated)
- {
- iShowCursor = EFalse;
- DrawNow();
- }
- else if(aCallType == EPluginInvisible )
- {
- }
- return KErrNone;
- }
-
-
-void CSvgtPluginControl::ApplicationFocusChanged(TBool /*aInFocus*/)
- {
- }
-
-void CSvgtPluginControl::SystemNotification()
- {
- }
-
-void CSvgtPluginControl::HandlePointerEventL(const TPointerEvent& aPointerEvent)
- {
-
-
- if ( iPlugin->iSvgModule && iPlugin->iSvgModule->SvgDocument() )
- {
- iPointerDx = 0;
- iPointerDy = 0;
-
- if(aPointerEvent.iType == TPointerEvent::EButton1Down)
- {
- if(aPointerEvent.iPosition.iX <=iPlugin->iRenderWidth && aPointerEvent.iPosition.iY <=iPlugin->iRenderHeight)
- {
- iPointerX = aPointerEvent.iPosition.iX;
- iPointerY = aPointerEvent.iPosition.iY;
-
- iXPosAtMouseDown = iPointerX;
- iYPosAtMouseDown = iPointerY;
-
- iPlugin->iSvgModule->MouseDown( iPointerX, iPointerY );
- UpdatePointer();
- }
- }
- else if(aPointerEvent.iType == TPointerEvent::EButton1Up)
- {
- iPlugin->iSvgModule->MouseUp( iPointerX, iPointerY );
- DrawDeferred();
- }
- else if (aPointerEvent.iType == TPointerEvent::EDrag)
- {
- if((iPointerX != aPointerEvent.iPosition.iX || iPointerY != aPointerEvent.iPosition.iY) &&
- (aPointerEvent.iPosition.iX <=iPlugin->iRenderWidth && aPointerEvent.iPosition.iY <=iPlugin->iRenderHeight))
- {
- iPointerX = aPointerEvent.iPosition.iX;
- iPointerY = aPointerEvent.iPosition.iY;
-
- iPlugin->iSvgModule->MouseMove( iPointerX, iPointerY );
-
- UpdatePointer((iXPosAtMouseDown-iPointerX),(iYPosAtMouseDown-iPointerY));
- }
- }
- }
- }
-
-void CSvgtPluginControl::UpdatePointer(
-#ifdef __PEN_SUPPORT
- TInt aShiftX , TInt aShiftY
-#else
- TInt , TInt
-#endif
- )
- {
- #ifdef __PEN_SUPPORT
- if(FeatureManager::FeatureSupported(KFeatureIdPenSupport))
- {
- if(aShiftX != 0 || aShiftY != 0 )
- {
- iPlugin->iSvgModule->Pan(-aShiftX,-aShiftY);
- iPlugin->iSvgModule->Redraw();
- iXPosAtMouseDown = iPointerX;
- iYPosAtMouseDown = iPointerY;
- iPlugin->iSvgModule->MouseMove( iPointerX, iPointerY );
- User::After(10);
- DrawNow();
- }
- }
- #else//_PEN_SUPPORT
- {
- if (iPlugin->iRenderBuffer !=NULL)
- {
- // Due to the iframe scrolling the pointer will run out
- // of the iframe window when tried to pan inside the plugin.
- // So the control rect for the pointer is now the cliprect.
-
- // TRect lControlRect(TSize(iPlugin->iViewPortWidth, iPlugin->iViewPortHeight));
- TRect lControlRect;
-
- lControlRect.iTl.iY = iPlugin->iCurrentWindow.clipRect.top;
- lControlRect.iTl.iX = iPlugin->iCurrentWindow.clipRect.left;
- lControlRect.iBr.iY = iPlugin->iCurrentWindow.clipRect.bottom;
- lControlRect.iBr.iX = iPlugin->iCurrentWindow.clipRect.right;
-
- //X value
- iPointerX += iPointerDx;
- if ( iPointerX < 5 )
- {
- iPointerX = 5;
- iPlugin->iSvgModule->Pan( 30, 0 );
- //iPlugin->iSvgModule->Pan( -30, 0 );
- iPlugin->iSvgModule->Redraw();
- }
- else if ( lControlRect.Width() - 5 < iPointerX )
- {
- iPointerX = lControlRect.Width() - 5;
- iPlugin->iSvgModule->Pan( -30, 0 );
- //iPlugin->iSvgModule->Pan( 30, 0 );
- iPlugin->iSvgModule->Redraw();
- }
- //Y value
- iPointerY += iPointerDy;
- if ( iPointerY < 5 )
- {
- iPointerY = 5;
- iPlugin->iSvgModule->Pan( 0, 30 );
- //iPlugin->iSvgModule->Pan( 0, -30 );
- iPlugin->iSvgModule->Redraw();
- }
- else if ( lControlRect.Height() - 5 < iPointerY )
- {
- iPointerY = lControlRect.Height() - 5;
- iPlugin->iSvgModule->Pan( 0,-30 );
- //iPlugin->iSvgModule->Pan( 0,30 );
- iPlugin->iSvgModule->Redraw();
- }
- iPlugin->iSvgModule->MouseMove( iPointerX, iPointerY );
- DrawNow();
- }
- }
- #endif //_PEN_SUPPORT
-
- }
-
--- a/svgtopt/SVGTPlugin/src/Svgtplugin.cpp Tue May 11 17:02:26 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,740 +0,0 @@
-/*
-* Copyright (c) 2003 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: SVGT Plugin Implementation source file
- *
-*/
-
-
-
-#include <e32std.h>
-#include <eikenv.h>
-#include <barsread.h>
-#include <fbs.h>
-#include <gdi.h>
-#include <f32file.h>
-
-#include <featmgr.h>
-
-#include <eikappui.h>
-
-#include <SVGEngineInterfaceImpl.h>
-
-#include "Svgtplugin.h"
-
-#include "VolumeKeyListener.h"
-#include "RepositoryVolumeListener.h"
-
-_LIT(KWidth, "width");
-_LIT(KHeight, "height");
-
-CSvgtPlugin* CSvgtPlugin::NewL(NPP anInstance)
- {
- CSvgtPlugin *self = new (ELeave) CSvgtPlugin;
- CleanupStack::PushL( self );
- self->ConstructL(anInstance);
-
- CleanupStack::Pop();
- return self;
- }
-
-
-CSvgtPlugin::~CSvgtPlugin()
- {
- if ( iControl )
- {
- delete iControl;
- iControl=NULL;
- }
-
- if ( iSvgModule )
- {
- iSvgModule->Stop();
- delete iSvgModule;
- iSvgModule = NULL;
- }
-
- if ( iRenderBuffer )
- {
- delete iRenderBuffer;
- iRenderBuffer = NULL;
- }
-
- iImageUrlInfoList.ResetAndDestroy();
- iImageUrlInfoList.Close();
-
- if(iKeyListener)
- {
- delete iKeyListener;
- iKeyListener = NULL;
- }
-
- if(iRepositoryListener)
- {
- delete iRepositoryListener;
- iRepositoryListener = NULL;
- }
- }
-
-void CSvgtPlugin::PrepareToExitL()
- {
- if (iPluginAdapter)
- iPluginAdapter->PluginFinishedL();
- }
-
-void CSvgtPlugin::ConstructL(NPP anInstance)
- {
- iInstance=anInstance;
- iRenderBuffer = new ( ELeave ) CFbsBitmap();
-
- iObjectWidth = 0;
- iObjectHeight = 0;
- // By default obj height is not in percentage
- iObjHeightInPercentage = EFalse;
- // By default obj width is not in percentage
- iObjWidthInPercentage = EFalse;
- iExpectedDefaultSize = EFalse;
-
- //While parsing are object width height are specified or not
- iObjectWidthSpecified = EFalse;
- iObjectHeightSpecified = EFalse;
- TFontSpec lFontSpec;
- iSvgModule = CSvgEngineInterfaceImpl::NewL( iRenderBuffer, this, lFontSpec );
-
- // Clear background white
- iSvgModule->SetBackgroundColor(0xffffffff);
- iSvgModule->AddHyperlinkListener( this );
- iAdjusted = EFalse;
-
- if (FeatureManager::FeatureSupported(KFeatureIdSideVolumeKeys))
- {
- User::InfoPrint(_L("Volume Key supported"));
- iKeyListener = CVolumeKeyListener::NewL(this);
- }
- else
- {
- User::InfoPrint(_L("Key not supported"));
- iRepositoryListener = CRepositoryVolumeListener::NewL(this);
- }
- }
-
-void CSvgtPlugin::SetWindowL(const NPWindow *aWindow,const TRect& aRect)
- {
- iCurrentWindow.x = aWindow->x;
- iCurrentWindow.y = aWindow->y;
- iCurrentWindow.window = aWindow->window;
- iCurrentWindow.clipRect = aWindow->clipRect;
- iCurrentWindow.type = aWindow->type;
- iCurrentWindow.width = aWindow->width;
- iCurrentWindow.height = aWindow->height;
-
- iPluginAdapter = static_cast<MPluginAdapter*>(aWindow->window);
- iParentControl = iPluginAdapter->GetParentControl();
- if (iControl == NULL)
- {
- iControl = new (ELeave) CSvgtPluginControl;
- iControl->ConstructL(this,iParentControl);
- iPluginAdapter->PluginConstructedL(iControl);
- iPluginAdapter->SetPluginNotifier(iControl);
- }
-
- if ( !iControl || !iSvgModule || aRect.Width() <= 0 || aRect.Height() <= 0 )
- {
- return;
- }
- iSetWindowCalled = ETrue;
-
- iControl->SetRect(aRect);
-
- if ( iRenderWidth != aRect.Width() ||
- iRenderHeight != aRect.Height() )
- {
- iRenderWidth = aRect.Width();
- iRenderHeight = aRect.Height();
-
- // Browser initially sends width/height as zero
- // if width/height are not specified
- // Later if svg is available to us we call resize after adjustDimention
- // But if we dont do adjustDimention quick enough
- // Browser sends default width/Height as 300x150
-
- // To Ensure that we are setting the object width/height and
- // browser is not setting default width/height ahead of us doing resize
-
- // In adjustDimention if width/height are specified at the browser level
- // iAdjusted is set to false, the second condition is to ensure that
- // if the browser does a resize at a later point it should be allowed
- if(iAdjusted || (iObjectWidthSpecified && iObjectHeightSpecified))
- {
- iObjectWidth = iRenderWidth;
- iObjectHeight = iRenderHeight;
- }
- iSvgModule->Pause(); //fix for CGSR-7CN7T7
-
- User::LeaveIfError( iRenderBuffer->Create(
- TSize( iRenderWidth, iRenderHeight ), EColor64K ) );
- iSvgModule->SetFrameBuffer( iRenderBuffer );
- iSvgModule->Resume(); // fix for CGSR-7CN7T7
- }
-
-
- if ( iExpectedDefaultSize )
- {
- iExpectedDefaultSize = EFalse;
- AdjustDimention(ETrue,ETrue);
- }
-
- if(iControlSize != aRect.Size())
- {
- iRenderWidth = aRect.Width();
- iRenderHeight = aRect.Height();
- CFbsBitmap * lTempRenderBuffer = new (ELeave) CFbsBitmap();
- CleanupStack::PushL(lTempRenderBuffer);
- User::LeaveIfError( lTempRenderBuffer->Create( TSize(iRenderWidth,iRenderHeight), EColor64K ));
- iSvgModule->SetFrameBuffer(lTempRenderBuffer);
-
- delete iRenderBuffer;
- iRenderBuffer = lTempRenderBuffer;
- CleanupStack::Pop(lTempRenderBuffer);
- lTempRenderBuffer = NULL;
- iControlSize = aRect.Size();
- iControl->iContentDimension = iSvgModule->ContentDimensions();
- }
- // For autoloading feature.
- if ( iControl->IsAsFileCalled() && iControl->GetFilename().Length() > 0 &&
- !iStartCalled )
- {
-
- TBool widthInPercentage;
- TBool heightInPercentage;
-
- iControl->iContentDimension = iSvgModule->ContentDimensionsInPercentage();
- if(iControl->iContentDimension.iWidth == -1 )
- {
- widthInPercentage = EFalse;
- if(iSvgModule->SvgDocument())
- {
- iControl->iContentDimension.iWidth = iSvgModule->GetViewportWidth(iSvgModule->SvgDocument());
- }
- else
- {
- return;
- }
-
- }
- else
- {
- widthInPercentage = ETrue;
- }
-
- if(iControl->iContentDimension.iHeight == -1)
- {
- heightInPercentage = EFalse;
- if(iSvgModule->SvgDocument())
- {
- iControl->iContentDimension.iHeight = iSvgModule->GetViewportHeight(iSvgModule->SvgDocument());
- }
- else
- {
- return;
- }
- }
- else
- {
- heightInPercentage = ETrue;
- }
- // After loading the content, the width & height will be visible to plugin.
- // It is time to adjust the size if needed.
- if ( AdjustDimention(widthInPercentage,heightInPercentage) )
- {
- // dimention change is needed so return and notify Browser.
- return;
- }
- iSvgModule->Start();
- iStartCalled = ETrue;
- }
-
- }
-
-
-CSvgtPluginControl* CSvgtPlugin::Control()
- {
- return iControl;
- }
-
-NPP CSvgtPlugin::Instance()
- {
- return iInstance;
- }
-
-void CSvgtPlugin::GetSizeOfRenderBuffer(TSize& aSize)
- {
- if ( iRenderBuffer )
- {
- aSize = iRenderBuffer->SizeInPixels();
- }
- else
- {
- aSize = TSize ( 0, 0 );
- }
- }
-
-
-
-/**********************************************************************/
-// implements MSvgRequestObserver
-/**********************************************************************/
-
-void CSvgtPlugin::UpdateScreen()
- {
- iControl->DrawNow();
- }
-
-
-TBool CSvgtPlugin::ScriptCall( const TDesC& /*aScript*/,
- CSvgElementImpl* /*aCallerElement*/ )
- {
- return EFalse;
- }
-
-TBool CSvgtPlugin::LinkEntered( const TDesC& /* aUri */ )
-{
- // update mouse pointer here
- return ETrue;
-}
-
-TBool CSvgtPlugin::LinkExited( const TDesC& /* aUri */ )
-{
- // update mouse pointer here
- return ETrue;
-}
-TBool CSvgtPlugin::LinkActivated( const TDesC& aUrl )
- {
- CSvgtPluginEcomMain* lSvgtPluginEcomMain = (CSvgtPluginEcomMain*) Dll :: Tls ();
- NPNetscapeFuncs* lNetscapeFuncs = lSvgtPluginEcomMain->Funcs();
- if(lNetscapeFuncs)
- {
- TPtrC lTarget('\0',0);
- lTarget.Set(_L("_parent"));
- lNetscapeFuncs->geturl(iInstance,aUrl,&lTarget);
- }
- return ETrue;
- }
-
-void CSvgtPlugin::VolumeChanged(TInt aNewValue)
- {
- RDebug::Print(_L("Volume level: %d"), aNewValue);
- aNewValue *= 10; //to make the volume in percentage
- iSvgModule->SetAudioVolume( aNewValue );
- }
-
-TInt CSvgtPlugin::FetchImage(const TDesC& aUri, RFs& /*aSession*/, RFile& /*aFileHandle*/ )
-{
- TRAPD(err,FetchImageL(aUri));
-
- return err;
-
-}
-
-void CSvgtPlugin::FetchImageL(const TDesC& aUri)
- {
- TInt lCount = iImageUrlInfoList.Count();
- HBufC* lListItem = NULL;
- HBufC* lUrl = NULL;
-
- //checks whether the request is already made for same Uri.
- for(TInt i = 0; i < lCount; i++)
- {
- lListItem = HBufC::NewLC(iImageUrlInfoList[i]->Length());
- lUrl = aUri.AllocLC();
-
- *lListItem = *iImageUrlInfoList[i];
-
- // Convert the List Item to Lower case
- TPtr lListItemPtr = lListItem->Des();
- lListItemPtr.LowerCase();
-
- // Convert the Url to Lower case
- TPtr lUrlPtr = lUrl->Des();
- lUrlPtr.LowerCase();
-
- if( lListItemPtr.Compare(lUrlPtr) == 0 )
- {
- CleanupStack::PopAndDestroy(2);
-
- lListItem = NULL;
- lUrl = NULL;
- // Same Url is already requested in the past, no need to continue.
- User::Leave(KErrAlreadyExists); // Indicates the download is pending
- }
-
- CleanupStack::PopAndDestroy(2);
-
- lListItem = NULL;
- lUrl = NULL;
- }
-
-
- // --------------------------------------
- // Request file from browser
- // --------------------------------------
- CSvgtPluginEcomMain* lSvgtPluginEcomMain = (CSvgtPluginEcomMain*) Dll :: Tls ();
- NPNetscapeFuncs* lNetscapeFuncs = lSvgtPluginEcomMain->Funcs();
- if(lNetscapeFuncs)
- {
- TPtrC lTarget('\0',0);
-
- lUrl = aUri.AllocL();
-
- // Current count is used as a context data.
- void* contextptr = (void*)(lCount);
- NPError error = lNetscapeFuncs->geturlnotify(iInstance,aUri,NULL,contextptr);
-
- // Add the Url and RequestID to the List
- iImageUrlInfoList.Append(lUrl);
-
- if ( error != 0 )
- {
- #ifdef _DEBUG
- lNetscapeFuncs->status(iInstance,_L("Image failed"));
- #endif
-
- User::LeaveIfError(error);
- }
- #ifdef _DEBUG
- lNetscapeFuncs->status(iInstance,_L("Downloading Image"));
- #endif
- }
-
-
-
- User::Leave(KRequestPending); // Indicate the download is pending
- }
-
-TInt CSvgtPlugin::FetchFont( const TDesC& /* aUri */, RFs& /* aSession */, RFile& /* aFileHandle */)
- {
- // Fix for ANAE-775B7E. There is a limitaiton. For rendering text with
- // external font synchronous fetching of the file is needed. But the
- // external font file is fetched asynchronously by browser when we say
- // geturlnotify(). There is no API to pass the font data after fetching
- // asynchronously. Hence the code here is removed by returning an error.
- return KErrNotFound;
- }
-
-
-TBool CSvgtPlugin::LinkActivatedWithShow(const TDesC& aUri,const TDesC& /*aShow*/)
- {
- CSvgtPluginEcomMain* lSvgtPluginEcomMain = (CSvgtPluginEcomMain*) Dll :: Tls ();
- NPNetscapeFuncs* lNetscapeFuncs = lSvgtPluginEcomMain->Funcs();
- if(lNetscapeFuncs)
- {
- TPtrC lTarget('\0',0);
- lTarget.Set(_L("_parent"));
- lNetscapeFuncs->geturl(iInstance,aUri,&lTarget);
- }
- return ETrue;
- }
-
-void CSvgtPlugin::GetSmilFitValue(TDes16 &aSmilValue)
- {
- aSmilValue.Copy(_L("meet"));
- }
-
-void CSvgtPlugin::UpdatePresentation(const TInt32& aNoOfAnimation)
- {
- if (iTotalNumerOfAnimation < 0)
- {
- if (aNoOfAnimation != 0)
- {
- iStaticContent = EFalse;
- iTotalNumerOfAnimation = aNoOfAnimation;
- }
- else
- {
- iStaticContent = ETrue;
- }
- }
- else
- {
- iTotalNumerOfAnimation--;
- }
- }
-
-void CSvgtPlugin::GetViewPort(TInt /*getWidth*/, TInt /*getHeight*/, TBool /*isWidthInPer*/, TBool /*isHeightInPer*/, TInt &setWidth, TInt &setHeight)
-{
-
- setWidth = iRenderWidth;
- setHeight = iRenderHeight;
-
- iViewPortWidth = setWidth;
- iViewPortHeight = setHeight;
-}
-// ---------------------------------------------------------------------------
-// This function extracts attributes from the list that is passed from Browser.
-// Use to check if width & height are defined in XHTML tag
-// ---------------------------------------------------------------------------
-//
-NPError CSvgtPlugin::SvgPluginNew(NPMIMEType /*pluginType*/, NPP instance,
- uint16 /*mode*/, CDesC16Array* argn, CDesC16Array* argv, NPSavedData* )
- {
- if (instance->pdata != this)
- {
- return NPERR_INVALID_INSTANCE_ERROR;
- }
-
- for (TInt i = 0; i < argn->Count(); i++)
- {
- TPtrC16 namePtr((*argn)[i]);
- TPtrC16 valPtr((*argv)[i]);
-
- if (KWidth().FindF(namePtr) == 0)
- {
- TLex lString( valPtr );
- lString.SkipSpace();
- TInt result = lString.Val(iRenderWidth);
- // Check if object width was specified as
- // percentage value.
- if ( valPtr.Locate( '%' ) != KErrNotFound )
- {
- // Do not store the value, browser takes
- // care of computing the width
- iObjWidthInPercentage = ETrue;
- }
- if (( result != KErrNone) || (iRenderWidth < 0))
- {
- iObjectWidth = 0;
- }
- else
- {
- iObjectWidth = iRenderWidth;
- }
- iObjectWidthSpecified = ETrue;
- }
- else if (KHeight().FindF(namePtr) == 0)
- {
- TLex lString( valPtr );
- lString.SkipSpace();
- TInt result = lString.Val(iRenderHeight);
- // Check if object height was specified as a
- // percentage value.
- if ( valPtr.Locate( '%' ) != KErrNotFound )
- {
- // Do not store the value, browser takes
- // care of computing the height
- iObjHeightInPercentage = ETrue;
- }
- if (( result != KErrNone) || ( iRenderHeight < 0 ))
- {
- iObjectHeight = 0;
- }
- else
- {
- iObjectHeight = iRenderHeight;
- }
- iObjectHeightSpecified = ETrue ;
- }
- }
-
- return NPERR_NO_ERROR;
- }
-
-
-// ---------------------------------------------------------------------------
-// ResizeWindow() This function is to notify that a new set of dimention value
-// should be taken into consideration. The new w&h is determined from
-// AdjustDimention().
-//
-// ---------------------------------------------------------------------------
-//
-void CSvgtPlugin::ResizeWindow(TInt aWidth, TInt aHeight)
- {
- NPPVariable variable;
- CSvgtPluginEcomMain* lSvgtPluginEcomMain = (CSvgtPluginEcomMain*) Dll::Tls();
- NPNetscapeFuncs* lNetscapeFuncs = lSvgtPluginEcomMain->Funcs();
- NPWindow newWindow;
- variable = NPPVpluginWindowSize;
- newWindow.x = iCurrentWindow.x;
- newWindow.y = iCurrentWindow.y;
- newWindow.window = iCurrentWindow.window;
- newWindow.clipRect = iCurrentWindow.clipRect;
- newWindow.type = iCurrentWindow.type;
- newWindow.width = aWidth;
- newWindow.height = aHeight;
- TInt err = lNetscapeFuncs->setvalue(iInstance, variable, (void*)&newWindow);
- }
-
-
-// ---------------------------------------------------------------------------
-// AdjustDimention() This function does the logic to check if width & height
-// is needed to be adjusted
-// ---------------------------------------------------------------------------
-//
-TBool CSvgtPlugin::AdjustDimention( TBool aWidthInPercentage, TBool aHeightInPercentage)
- {
- iSvgModule->AddListener( static_cast < MSvgViewPortListener*>(this), ESvgViewPortListener );
- if ( iAdjusted )
- return EFalse;
-
- // we set the width height in all cases except when width/height has been
- // explicitly specified in the browser hence its set here for all cases
- iAdjusted = ETrue;
- // html provides absolute width, no height
- // svg provides absolute width and absolute height
- if (
- ( iObjectWidthSpecified && !iObjWidthInPercentage && !iObjectHeightSpecified )
- && ( !aWidthInPercentage && !aHeightInPercentage)
- )
- {
- // only iObjectWidth is valid
- // Adjust missing object value as per aspect ratio of
- // svg's viewport
- if(iControl->iContentDimension.iWidth)
- {
- TReal newHeight = (TInt)((TReal32)iObjectWidth *
- ( (TReal32)iControl->iContentDimension.iHeight /
- (TReal32)iControl->iContentDimension.iWidth));
-
- ResizeWindow(iObjectWidth, newHeight);
-
- }
- return ETrue;
- }
-
- // html provides no width and absolute height
- // svg provides absolute width and absolute height
- else if (
- ( !iObjectWidthSpecified && iObjectHeightSpecified && !iObjHeightInPercentage )
- && ( !aWidthInPercentage && !aHeightInPercentage)
- )
- {
- // only iObjectHeight is valid
- // Adjust missing object value as per aspect ratio of
- // svg's viewport
- if(iControl->iContentDimension.iHeight)
- {
- TInt newWidth = (TInt)((TReal32)iObjectHeight *
- ( (TReal32)iControl->iContentDimension.iWidth /
- (TReal32)iControl->iContentDimension.iHeight));
- ResizeWindow(newWidth, iObjectHeight);
-
- }
- return ETrue;
- }
- // html provides no width and no height
- // svg provides absolute width and absolute height
- else if(
- (!iObjectWidthSpecified && !iObjectHeightSpecified)
- && ( !aWidthInPercentage && !aHeightInPercentage)
- )
- {
- ResizeWindow(iControl->iContentDimension.iWidth, iControl->iContentDimension.iHeight);
- return ETrue;
- }
- // html provides width and height be it percentages or absolute values
- else if(iObjectWidthSpecified && iObjectHeightSpecified)
- {
- iAdjusted = EFalse;
- return EFalse;
- }
- else
- {
- TReal newWidth = 0.0f;
- TReal newHeight = 0.0f;
- CEikonEnv* lEnv = STATIC_CAST( CEikonEnv*, iControl->ControlEnv() );
-
- TRect lClientRect = TRect( TPoint( 0,0 ), lEnv->EikAppUi()->ClientRect().Size());
-
- // if the browser has specified a valid absolute value width
- if ( !iObjWidthInPercentage && iObjectWidthSpecified)
- {
- newWidth = iObjectWidth;
- }
- // if the browser has specified a valid percentage value width
- else if (iObjWidthInPercentage && iObjectWidthSpecified )
- {
- // Compute the new dimension by scaling clientRect dimension
- newWidth = lClientRect.Width() * iObjectWidth / 100;
- }
- // if the browser has specified a valid absolute value height
- if ( !iObjHeightInPercentage && iObjectHeightSpecified)
- {
- newHeight = iObjectHeight;
- }
- // if the browser has specified a valid percentage value Height
- else if(iObjHeightInPercentage && iObjectHeightSpecified)
- {
- // Compute the new dimension by scaling clientRect dimension
- newHeight = lClientRect.Height() * iObjectHeight / 100;
- }
-
- // if the browser has not specified the width
- if(!iObjectWidthSpecified)
- {
- if(aWidthInPercentage)
- {
- newWidth = lClientRect.Width() * iControl->iContentDimension.iWidth / 100;
- }
- else
- {
- newWidth = iControl->iContentDimension.iWidth;
- }
- }
- // if the browser has not specified the height
- if(!iObjectHeightSpecified)
- {
- if(aHeightInPercentage)
- {
- newHeight = lClientRect.Height() * iControl->iContentDimension.iHeight / 100;
- }
- else
- {
- newHeight = iControl->iContentDimension.iHeight;
- }
- }
- ResizeWindow(newWidth, newHeight);
- return ETrue;
- }
- }
-
-TBool CSvgtPlugin::LoadSvgFile( const TDesC& aFilename )
- {
- if ( !iSvgModule )
- {
- return EFalse;
- }
- MSvgError* error = iSvgModule->Load( aFilename );
- if ( !error )
- {
- return EFalse;
- }
-
- // Loading error
- if ( error->HasError() && !error->IsWarning() )
- {
- return EFalse;
- }
- TInt currentVolume;
- if (FeatureManager::FeatureSupported(KFeatureIdSideVolumeKeys))
- {
- currentVolume = iKeyListener->GetCurrentVolume();
- }
- else
- {
- currentVolume = iRepositoryListener->GetCurrentVolume();
- }
-
- VolumeChanged(currentVolume );
- iTotalNumerOfAnimation = -1;
- return ETrue;
- }
-
--- a/svgtopt/SVGTPlugin/src/Svgtplugindllapi.cpp Tue May 11 17:02:26 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,186 +0,0 @@
-/*
-* Copyright (c) 2003 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: SVGT Plugin Implementation source file
- *
-*/
-
-
-/*
-************************************************************************************
-* Contents: Example plugin implementation
-* Implementation of the API used by Opera to control the plugin
-************************************************************************************
-*/
-
-
-#include "Svgtplugin.h"
-
-/**
- * Create a new instance of a SVG plugin.
-**/
-
-NPError SvgtPluginNewp(NPMIMEType pluginType, NPP instance, uint16 mode,
- CDesCArray* argn, CDesCArray* argv, NPSavedData* saved)
- {
- CSvgtPlugin* lSvgtPlugin = NULL;
- TRAPD(err,lSvgtPlugin = CSvgtPlugin::NewL(instance));
-
- if (err == KErrNoMemory)
- return NPERR_OUT_OF_MEMORY_ERROR;
- if (err != KErrNone)
- return NPERR_MODULE_LOAD_FAILED_ERROR;
-
- instance->pdata = (void *) lSvgtPlugin;
- NPError nerr = lSvgtPlugin->SvgPluginNew(pluginType, instance,
- mode, argn, argv, saved);
- return nerr;
- }
-
-/**
- * Destroy a plugin.
-**/
-NPError SvgtPluginDestroy(NPP instance, NPSavedData** /*save*/)
- {
- CSvgtPlugin* lSvgtPlugin = (CSvgtPlugin *)instance->pdata;
- if ( lSvgtPlugin )
- {
- TRAPD(err,lSvgtPlugin->PrepareToExitL());
- if (err != KErrNone)
- {
- #ifdef _DEBUG
- RDebug::Printf("SvgtPluginDestroy Error when printing Warning.");
- #endif //_DEBUG
- }
- /**Ignoring the error*/
- delete lSvgtPlugin;
- lSvgtPlugin = NULL;
- }
- return NPERR_NO_ERROR;
- }
-
-/**
- * This is the parent window of a plugin.
- */
-NPError SvgtPluginSetWindow(NPP instance, NPWindow *window)
- {
- CSvgtPlugin* lSvgtPlugin = (CSvgtPlugin *) instance->pdata;
- TUint lWidth = window->width;
- TUint lHeight = window->height;
-
- TRAPD(err,lSvgtPlugin->SetWindowL(window,TRect(TSize(lWidth,lHeight))));
-
- if (err == KErrNoMemory)
- return NPERR_OUT_OF_MEMORY_ERROR;
- if (err != KErrNone)
- return NPERR_GENERIC_ERROR;
- return NPERR_NO_ERROR;
- }
-
-/**
- * A new data stream has been created for sending data to the plugin.
- * @param stream - A pointer to plugin specific data can be placed in stream->pdata
- *
- */
-
-NPError SvgtPluginNewStream(NPP /*instance*/, NPMIMEType /*type*/, NPStream* /*stream*/, NPBool /*seekable*/, uint16* stype)
- {
- *stype = NP_ASFILEONLY;
- return NPERR_NO_ERROR;
- }
-
-/**
- * A data stream has been terminated.
- */
-NPError SvgtPluginDestroyStream(NPP /*instance*/, NPStream* /*stream*/, NPReason /*reason*/)
- {
- return NPERR_NO_ERROR;
- }
-
-/**
- * A data stream has been fully saved to a file.
- */
-void SvgtPluginAsFile(NPP instance, NPStream* stream, const TDesC& fname)
- {
- CSvgtPlugin* lSvgtPlugin = (CSvgtPlugin*)instance->pdata;
-
- if (lSvgtPlugin && lSvgtPlugin->Control())
- {
- lSvgtPlugin->Control()->AsFile(fname, stream );
- }
- }
-
-/**
- * Return the maximum number of bytes this plugin can accept from the stream.
- */
-int32 SvgtPluginWriteReady(NPP /*instance*/, NPStream* /*stream*/)
- {
- return 65536;
- }
-
-/**
- * Receive more data
- * @param buffer - contains the data.
- * @param len - the number of bytes in buffer.
- * @param offset - the number of bytes already sent/processed.
- * @return TInt number of bytes processed.
- */
-int32 SvgtPluginWrite(NPP /*instance*/, NPStream* /*stream*/, int32 /*offset*/, int32 len, void* /*buffer*/)
- {
- return len;
- }
-
-/**
- * Event
- */
-int16 SvgtPluginEvent(NPP /*instance*/, void* /*event*/)
- {
- return 0;
- }
-
-
-/**
- * Generic hook to set values/attributes within the plugin.
- */
-NPError SvgtPluginSetValue(NPP /*instance*/, NPNVariable /*variable*/, void* /*ret_value*/)
- {
- return NPERR_NO_ERROR;
- }
-
-/**
- * Generic hook to get values/attributes from the plugin.
- */
-NPError SvgtPluginGetValue(NPP instance, NPNVariable variable, void*
-*ret_value)
- {
- CSvgtPlugin* lSvgtPlugin = (CSvgtPlugin *)instance->pdata;
- if(lSvgtPlugin)
- {
- // A response of false when enum passed is NPPVpluginInteractiveBool
- // must be interpreted as "Plugin is interactive"
- // Since operations such as panning, zooming can be performed
- // on all svg contents plugin can be considered always interactive
- if(variable==NPPVpluginInteractiveBool)
- {
- *(TBool*) ret_value=EFalse;
- }
- }
- return NPERR_NO_ERROR;
- }
-void SvgtPluginURLNotify(NPP /*instance*/, const TDesC& /*url*/, NPReason /*reason*/, void* /*notifyData*/)
- {
- }
-
-void SvgtPluginPrint(NPP /*instance*/, NPPrint* /*platformPrint*/)
- {
- }
--- a/svgtopt/SVGTPlugin/src/Svgtpluginmain.cpp Tue May 11 17:02:26 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +0,0 @@
-/*
-* Copyright (c) 2003 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: SVGT Plugin Implementation source file
- *
-*/
-
-
-#include "Svgtplugin.h"
-
-
-#include <implementationproxy.h>
-#include <cecombrowserplugininterface.h>
-/***************************************************/
-/**********ECOM STYLE SVGT PLUGIN ENTRY POINTS******/
-/***************************************************/
-CSvgtPluginEcomMain* CSvgtPluginEcomMain::NewL(TAny* aInitParam)
-{
- TFuncs* funcs = REINTERPRET_CAST( TFuncs*, aInitParam);
- CSvgtPluginEcomMain* self = new(ELeave)CSvgtPluginEcomMain(funcs->iNetscapeFuncs);
- CleanupStack::PushL(self);
- self->ConstructL(funcs->iPluginFuncs);
- CleanupStack::Pop();
-
- Dll :: SetTls ( (void*) self );
-
- return self;
-}
-
-void CSvgtPluginEcomMain::ConstructL(NPPluginFuncs* aPluginFuncs)
-{
- InitializeFuncs(aPluginFuncs);
-}
-
-CSvgtPluginEcomMain::CSvgtPluginEcomMain(NPNetscapeFuncs* aNpf) : CEcomBrowserPluginInterface(),iNpf(aNpf)
-{
-}
-
-CSvgtPluginEcomMain::~CSvgtPluginEcomMain()
-{
-
-}
-const TImplementationProxy KImplementationTable[] =
- {
- {{KSvgtPluginImplementationValue}, (TProxyNewLPtr) CSvgtPluginEcomMain::NewL}
- };
-
-// -----------------------------------------------------------------------------
-// ImplementationGroupProxy
-// Returns the filters implemented in this DLL
-// Returns: The filters implemented in this DLL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
-{
- aTableCount = sizeof(KImplementationTable) / sizeof(TImplementationProxy);
- return KImplementationTable;
-}
-
-
-
-/**
- * The E32Dll() entry point function.
-**/
-
-
-EXPORT_C NPError InitializeFuncs(NPPluginFuncs* aPpf)
-{
- aPpf->size = sizeof(NPPluginFuncs);
- aPpf->version = 1;
- aPpf->newp = NewNPP_NewProc(SvgtPluginNewp);
- aPpf->destroy = NewNPP_DestroyProc(SvgtPluginDestroy);
- aPpf->setwindow = NewNPP_SetWindowProc(SvgtPluginSetWindow);
- aPpf->newstream = NewNPP_NewStreamProc(SvgtPluginNewStream);
- aPpf->destroystream = NewNPP_DestroyStreamProc(SvgtPluginDestroyStream);
- aPpf->asfile = NewNPP_StreamAsFileProc(SvgtPluginAsFile);
- aPpf->writeready = NewNPP_WriteReadyProc(SvgtPluginWriteReady);
- aPpf->write = NewNPP_WriteProc(SvgtPluginWrite);
- aPpf->print = NewNPP_PrintProc(SvgtPluginPrint);
- aPpf->event = NewNPP_HandleEventProc(SvgtPluginEvent);
- aPpf->urlnotify = NewNPP_URLNotifyProc(SvgtPluginURLNotify);
- aPpf->javaClass = NULL;
- aPpf->getvalue = NewNPP_GetValueProc(SvgtPluginGetValue);
- aPpf->setvalue = NewNPP_SetValueProc(SvgtPluginSetValue);
-
- return NPERR_NO_ERROR;
-}
-
-EXPORT_C void NPP_Shutdown(void)
-{
- CSvgtPluginEcomMain* npm = (CSvgtPluginEcomMain*) Dll :: Tls ();
- delete npm;
- Dll :: SetTls ( NULL );
-}
-
--- a/svgtopt/SVGTPlugin/src/VolumeKeyListener.cpp Tue May 11 17:02:26 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,289 +0,0 @@
-/*
-* Copyright (c) 2006 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: It completes on a change in the volume property. Used for
-* the new Central Repository Server. Used in EKA2 builds only
-*
-*/
-
-
-#include <eikapp.h>
-#include <aknconsts.h>
-#include <browseruisdkcrkeys.h>
-
-#include "VolumeKeyListener.h"
-#include "MRepositoryVolumeObserver.h"
-
-// CONSTANTS
-const TInt KFirstTimerExpiryInterval = 1; // Expire immediately
-const TInt KTimerExpiryInterval = KAknStandardKeyboardRepeatRate;
-
-const TInt KMinVolume = 0; // Minimum volume level(Mute)
-const TInt KMaxVolume = 10; // Maximum volume level
-
-// ----------------------------------------------------
-// CVolumeKeyListener::NewL
-// Description: static constructor.
-// Output: none
-// Return: CVolumeKeyListener object
-// ----------------------------------------------------
-CVolumeKeyListener* CVolumeKeyListener::NewL( MRepositoryVolumeObserver* aObserver )
- {
- CVolumeKeyListener* self = new(ELeave) CVolumeKeyListener(
- aObserver);
- CleanupStack::PushL(self);
- self->ConstructL();
- CleanupStack::Pop(self);
- return self;
- }
-
-// ----------------------------------------------------
-// CVolumeKeyListener::CVolumeKeyListener
-// Description: constructor.
-// Output: none
-// Return: none
-// ----------------------------------------------------
-CVolumeKeyListener::CVolumeKeyListener( MRepositoryVolumeObserver* aObserver ):
- iInterfaceSelector(NULL),
- iSelector(NULL),
- iCenRepos(NULL),
- iObserver(aObserver)
- {
- }
-
-// ----------------------------------------------------
-// CVolumeKeyListener::ConstructL
-// Description: second phase constructor.
-// Input: aObserver: link to the calling object
-// Output: none
-// Return: none
-// ----------------------------------------------------
-void CVolumeKeyListener::ConstructL()
- {
- //
- // Open a connection to receive Volume Key events.
- iSelector = CRemConInterfaceSelector::NewL();
- iInterfaceSelector = CRemConCoreApiTarget::NewL(*iSelector,*this);
- TRAP_IGNORE(iSelector->OpenTargetL());
- // Timer for implementing repeat
- iTimer = CPeriodic::NewL(CActive::EPriorityStandard);
-
- //
- // Open a connection to the Central Repository...
- iCenRepos = CRepository::NewL(KCRUidBrowser);
- // iObservers=new(ELeave)CArrayFixSeg<MVolumePropertyWatchObserver*>
- // (KVolumeObserversArrayGranularity);
- }
-
-// ----------------------------------------------------
-// CVolumeKeyListener::~CVolumeKeyListener
-// Description: destructor.
-// Input: none
-// Output: none
-// ----------------------------------------------------
-CVolumeKeyListener::~CVolumeKeyListener()
- {
- if(iSelector)
- {
- delete iSelector;
- iInterfaceSelector=NULL;
- iSelector=NULL; //iSelector has been deleted by "delete iInterfaceSelector"
- }
-
- if(iTimer)
- {
- iTimer->Cancel();
- delete iTimer;
- }
-
- if(iCenRepos)
- {
- delete iCenRepos;
- }
- }
-
-// ----------------------------------------------------
-// CVolumeKeyListener::SetObserver
-// Description: Used to set an observer
-// Input: aObserver: Point to observer
-// Output: none
-// Return: none
-// ----------------------------------------------------
-void CVolumeKeyListener::SetObserver( MRepositoryVolumeObserver* aObserver)
- {
- iObserver = aObserver;
- }
-
-// ----------------------------------------------------
-// CVolumeKeyListener::GetCurrentVolume
-// Description: gets the current volume level from the
-// central directory.
-// Input: none
-// Output: none
-// Return: volume level
-// ----------------------------------------------------
-TInt CVolumeKeyListener::GetCurrentVolume()
- {
- TInt currentVolume = 0;
- //
- // Get the current volume
- if(iCenRepos)
- iCenRepos->Get(KBrowserMediaVolumeControl, currentVolume);
-
-/*
- #if defined(__WINSCW__) //offset required on the emulator
- currentVolume += WINS_DEFAULT_VOLUME;
- #endif
-*/
- return currentVolume;
- }
-
-// ----------------------------------------------------
-// CVolumeKeyListener::MrccatoCommand
-// Description: A Volume key command has been received
-// (from MRemConCoreApiTargetObserver)
-// Input:aOperationId The operation ID of the command
-// aButtonAct The button action associated with the command.
-// Output: none
-// Return: none
-// ----------------------------------------------------
-void CVolumeKeyListener::MrccatoCommand(TRemConCoreApiOperationId aOperationId,
- TRemConCoreApiButtonAction aButtonAct )
- {
-
- switch(aOperationId)
- {
- case ERemConCoreApiVolumeUp:
- {
- switch (aButtonAct)
- {
- case ERemConCoreApiButtonPress:
- {
- //Start Timer
- if (!iTimer->IsActive())
- {
- iCommandId = EVolumeControlCmdVolumeUpByOne;
- iTimer->Start(KFirstTimerExpiryInterval,
- KTimerExpiryInterval,
- TCallBack(TimerCallback, this));
- }
- break;
- }
- case ERemConCoreApiButtonRelease:
- {
- iTimer->Cancel();
- break;
- }
- case ERemConCoreApiButtonClick:
- {
- FilterAndSendCommand(EVolumeControlCmdVolumeUpByOne);
- break;
- }
- default:
- {
- break;
- }
- }
- break;
- }
- case ERemConCoreApiVolumeDown:
- {
- switch (aButtonAct)
- {
- case ERemConCoreApiButtonPress:
- {
- //Start Timer
- iCommandId = EVolumeControlCmdVolumeDownByOne;
- if (!iTimer->IsActive())
- {
- iTimer->Start(KFirstTimerExpiryInterval,
- KTimerExpiryInterval,
- TCallBack(TimerCallback, this));
- }
- break;
- }
- case ERemConCoreApiButtonRelease:
- {
- iTimer->Cancel();
- break;
- }
- case ERemConCoreApiButtonClick:
- {
- FilterAndSendCommand(EVolumeControlCmdVolumeDownByOne);
- break;
- }
- default:
- {
- break;
- }
- }
- break;
- }
- default:
- {
- break;
- }
- }
- }
-
-// -----------------------------------------------------------------------
-// CVolumeKeyListener::HandleRepeatEvent
-// -----------------------------------------------------------------------
-//
-void CVolumeKeyListener::HandleRepeatEvent()
- {
- FilterAndSendCommand(iCommandId);
- }
-
-// -----------------------------------------------------------------------
-// CVolumeKeyListener::TimerCallback
-// -----------------------------------------------------------------------
-//
-TInt CVolumeKeyListener::TimerCallback(TAny* aPtr)
- {
- static_cast<CVolumeKeyListener*>(aPtr)->HandleRepeatEvent();
- return KErrNone;
- }
-
-// -----------------------------------------------------------------------
-// CVolumeKeyListener::FilterAndSendCommand
-// -----------------------------------------------------------------------
-//
-void CVolumeKeyListener::FilterAndSendCommand(TInt aCommandId)
- {
- TInt currentVolume = 0;
-
- iCenRepos->Get(KBrowserMediaVolumeControl,currentVolume);
- switch(aCommandId)
- {
- case EVolumeControlCmdVolumeUpByOne:
- currentVolume=(currentVolume< KMaxVolume)? ++currentVolume : KMaxVolume;
- break;
- case EVolumeControlCmdVolumeDownByOne:
- currentVolume=(currentVolume> KMinVolume)? --currentVolume : KMinVolume;
- break;
- default:
- break;
- }
-
- iCenRepos->Set(KBrowserMediaVolumeControl,currentVolume);
-
-#if defined(__WINS__) //offset required on the emulator
- currentVolume += WINS_DEFAULT_VOLUME;
-#endif
-
- if(iObserver)
- iObserver->VolumeChanged(currentVolume);
- }
-
-// End of File
--- a/svgtopt/VGRenderer/PseudoVG/inc/PseodoVGRendererImpl.h Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/VGRenderer/PseudoVG/inc/PseodoVGRendererImpl.h Tue Aug 31 16:06:58 2010 +0300
@@ -169,7 +169,7 @@
static const TUint ENCODEDDATAGRANULARITY;
TInt iCommonHeaderLength;
const TUint8* iCommonHeader;
- VGErrorCode iVgErrorCode;
+
//Command specific logging methods
#ifdef VGRENDERER_LOG
RFileLogger iLog;//logs
--- a/svgtopt/VGRenderer/PseudoVG/src/PseodoVGRendererImpl.cpp Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/VGRenderer/PseudoVG/src/PseodoVGRendererImpl.cpp Tue Aug 31 16:06:58 2010 +0300
@@ -39,7 +39,6 @@
iHandle = 1;
iCommonHeaderLength = 0;
iCommonHeader = 0;
- iVgErrorCode = VG_NO_ERROR;
}
CPseodoVGRendererImpl::~CPseodoVGRendererImpl()
@@ -233,9 +232,6 @@
TUint CPseodoVGRendererImpl::vgCreatePaint()
{
- if(iVgErrorCode != VG_NO_ERROR)
- return VG_INVALID_HANDLE;
-
iHandle++;
EncodeInt8(EvgCreatePaint);
EncodeInt32(iHandle);
@@ -248,10 +244,6 @@
TUint CPseodoVGRendererImpl::vgCreatePath(TInt pathFormat, TInt datatype, TReal32 scale, TReal32 bias,
TInt segmentCapacityHint, TInt coordCapacityHint, TInt capabilities)
{
- if(iVgErrorCode != VG_NO_ERROR)
- return VG_INVALID_HANDLE;
-
-
iHandle++;
EncodeInt8(EvgCreatePath);
EncodeInt32(pathFormat);
@@ -391,7 +383,7 @@
EncodeInt16(capabilities);
#ifdef VGRENDERER_LOG
- LogvgDrawPath(path,0);
+ LogvgDrawPath(paintModes,0);
#endif
}
@@ -468,9 +460,6 @@
TUint CPseodoVGRendererImpl::vgCreateImage(TInt format, TInt width, TInt height, TInt allowedQuality)
{
- if(iVgErrorCode != VG_NO_ERROR)
- return VG_INVALID_HANDLE;
-
iHandle++;
EncodeInt8(EvgCreateImage);
EncodeInt32(format);
@@ -478,9 +467,6 @@
EncodeInt32(height);
EncodeInt8(allowedQuality);
EncodeInt32(iHandle);
-#ifdef VGRENDERER_LOG
- iLog.WriteFormat(_L("vgcreateimage"));
-#endif
return iHandle;
}
@@ -493,9 +479,6 @@
{
EncodeInt8(EvgDrawImage);
EncodeInt32(image);
-#ifdef VGRENDERER_LOG
- iLog.WriteFormat(_L("vgdrawimage"));
-#endif
}
void CPseodoVGRendererImpl::vgClearImage(TUint image, TInt x, TInt y, TInt width, TInt height)
@@ -506,9 +489,6 @@
EncodeInt32(y);
EncodeInt32(width);
EncodeInt32(height);
-#ifdef VGRENDERER_LOG
- iLog.WriteFormat(_L("vgclearimage"));
-#endif
}
void CPseodoVGRendererImpl::vgImageSubData(TUint image, const void * data, TInt dataStride,
@@ -643,9 +623,6 @@
EncodeData(dstData, dataLength);
delete [] dstData;
-#ifdef VGRENDERER_LOG
- iLog.WriteFormat(_L("vgimagesubdata"));
-#endif
}
else
{
@@ -671,9 +648,6 @@
{
EncodeInt8(EvgDestroyImage);
EncodeInt32(aHandle);
-#ifdef VGRENDERER_LOG
- iLog.WriteFormat(_L("vgdestroyimage"));
-#endif
}
void CPseodoVGRendererImpl::vgDestroyPaint(TUint /*aHandle*/)
@@ -693,7 +667,8 @@
TInt CPseodoVGRendererImpl::vgGetError()
{
- return iVgErrorCode;
+ //TODO
+ return 0;
}
MVGSurfaceImpl* CPseodoVGRendererImpl::CreateVGSurfaceL(TInt /*aOption*/)
@@ -733,13 +708,10 @@
TInt CPseodoVGRendererImpl::EncodeData(const TAny *aData, TUint aLength)
{
-
- if(iVgErrorCode==VG_NO_ERROR)
- {
- TInt result = KErrNone;
- TPtr8 lPtr( iEncodedData->Des() );
- TInt encodedDataLength = lPtr.Length() + aLength;
- TInt encodedDataMaxLength = lPtr.MaxLength();
+ TInt result = KErrNone;
+ TPtr8 lPtr( iEncodedData->Des() );
+ TInt encodedDataLength = lPtr.Length() + aLength;
+ TInt encodedDataMaxLength = lPtr.MaxLength();
if (encodedDataLength >= encodedDataMaxLength)
{
@@ -754,12 +726,7 @@
lPtr.Append((TUint8*)(aData), aLength);
}
- return result;
- }
- else
- {
- return iVgErrorCode;
- }
+ return result;
}
TInt CPseodoVGRendererImpl::ExpandEncodedData(TUint aNewLength)
@@ -773,7 +740,6 @@
if (tmpBuf == 0)
{
result = KErrNoMemory;
- iVgErrorCode = VG_OUT_OF_MEMORY_ERROR;
}
else
@@ -791,17 +757,6 @@
void CPseodoVGRendererImpl::EmptyEncodedData()
{
- iVgErrorCode = VG_NO_ERROR;
- if(iEncodedData->Length() > CPseodoVGRendererImpl::ENCODEDDATALENGTH)
- {
- delete iEncodedData;
- iEncodedData = HBufC8::New(CPseodoVGRendererImpl::ENCODEDDATALENGTH);
- if(!iEncodedData)
- {
- iVgErrorCode = VG_OUT_OF_MEMORY_ERROR;
- return;
- }
- }
TPtr8 lPtr( iEncodedData->Des() );
lPtr.Zero();
WriteHeader();
--- a/svgtopt/VGRenderer/PseudoVG/src/PseudoVGSurfaceImpl.cpp Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/VGRenderer/PseudoVG/src/PseudoVGSurfaceImpl.cpp Tue Aug 31 16:06:58 2010 +0300
@@ -50,8 +50,8 @@
TInt CPseudoVGSurfaceImpl::InitializeSurface(TSize aSize, TInt /*aColorSpace*/)
{
iSize = aSize;
- return iPseodoVGRendererImpl->vgGetError();
-
+ iPseodoVGRendererImpl->EmptyEncodedData();
+ return KErrNone;
}
void CPseudoVGSurfaceImpl::SetConfiguration(TInt aOption, const TAny* aValue)
@@ -69,9 +69,8 @@
TInt CPseudoVGSurfaceImpl::ResizeSurface(TSize aSize)
{
- iSize = aSize;
- iPseodoVGRendererImpl->EmptyEncodedData();
- return iPseodoVGRendererImpl->vgGetError();
+ iSize = aSize;
+ return KErrNone;
}
TInt CPseudoVGSurfaceImpl::CopyBitmap(TInt aDisplayMode, TInt aMaskMode,CFbsBitmap *aBitmap, CFbsBitmap *aMask, TSize /*aSize*/)
--- a/svgtopt/VGRenderer/SWVG/eabi/SWVG.def Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/VGRenderer/SWVG/eabi/SWVG.def Tue Aug 31 16:06:58 2010 +0300
@@ -6,4 +6,6 @@
_ZTV15COpenVGRenderer @ 5 NONAME ; #<VT>#
_ZTV16CSWVGSurfaceImpl @ 6 NONAME ; #<VT>#
_ZTV21CSWOpenVGRendererImpl @ 7 NONAME ; #<VT>#
+ _ZTI22CSWVGTargetSurfaceImpl @ 8 NONAME
+ _ZTV22CSWVGTargetSurfaceImpl @ 9 NONAME
--- a/svgtopt/VGRenderer/SWVG/group/SWVG.mmp Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/VGRenderer/SWVG/group/SWVG.mmp Tue Aug 31 16:06:58 2010 +0300
@@ -32,7 +32,7 @@
SOURCE SWVGSurfaceImpl.cpp
SOURCEPATH ../../OpenVGRenderer/src
-SOURCE OpenVGRenderer.cpp
+SOURCE ../../SWVG/src/swopenvgtargetsurfaceimpl.cpp OpenVGRenderer.cpp
//By default, the build tools look for the WINSCW def file in a BWINS directory
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svgtopt/VGRenderer/SWVG/inc/swopenvgtargetsurfaceimpl.h Tue Aug 31 16:06:58 2010 +0300
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2003 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"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: CSWVGTargetSurfaceImpl header file
+ *
+*/
+
+#ifndef SWOPENVGTARGETSURFACEIMPL_H_
+#define SWOPENVGTARGETSURFACEIMPL_H_
+
+#include "SWVG.h"
+#include "MVGSurfaceImpl.h"
+
+#include <displaymode.h>
+
+class CSvgtBitmap;
+
+class CSWVGTargetSurfaceImpl : public CBase, public MVGSurfaceImpl
+{
+public:
+ static CSWVGTargetSurfaceImpl* NewL();
+ static CSWVGTargetSurfaceImpl* NewLC();
+
+ virtual ~CSWVGTargetSurfaceImpl();
+
+ virtual TInt InitializeSurface(TSize aSize, TInt aColorSpace);
+
+ virtual TInt CreateSurface(TInt /*aDisplayMode*/, RWindow */*aSurface*/, CFbsBitmap */*aBitmap*/);
+ virtual TInt CreateSurface(TInt aDisplayMode, RWindow *aSurface, CSvgtBitmap *aBitmap);
+
+ virtual TInt ResizeSurface(TSize aSize);
+
+ virtual void SetConfiguration(TInt aOption, const TAny* aValue);
+
+ virtual TInt CopyBitmap(TInt /*aDisplayMode*/, TInt /*aMaskMode*/, CFbsBitmap */*aBitmap*/, CFbsBitmap */*aMask*/, TSize /*aSize*/ = TSize(0,0));
+ virtual TInt CopyBitmap(TInt aDisplayMode,TInt aMaskMode,CSvgtBitmap *aBitmap, CSvgtBitmap *aMask, TSize aSize = TSize(0,0));
+
+ virtual TInt PrepareToBindClientBuffer();
+ virtual TInt BindClientBuffer(TInt buffer);
+
+ virtual TInt UnBindClientBuffer();
+
+ virtual void TerminateSurface();
+
+ TInt MapSymbianDisplayModeToOpenVG( TDisplayMode aMode) const;
+ TInt MapOpenVGErrorToSymbianError( TInt aError ) const;
+
+private:
+ CSWVGTargetSurfaceImpl();
+ void ConstructL();
+ TSize iSize;
+};
+
+#endif /* SWOPENVGTARGETSURFACEIMPL_H_ */
--- a/svgtopt/VGRenderer/SWVG/src/SWOpenVGRendererImpl.cpp Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/VGRenderer/SWVG/src/SWOpenVGRendererImpl.cpp Tue Aug 31 16:06:58 2010 +0300
@@ -17,6 +17,7 @@
#include "SWOpenVGRendererImpl.h"
#include "SWVGSurfaceImpl.h"
+#include "swopenvgtargetsurfaceimpl.h"
#include <VG/vgu.h>
@@ -77,7 +78,10 @@
{
}
-MVGSurfaceImpl* CSWOpenVGRendererImpl::CreateVGSurfaceL(TInt /*aOption*/)
+MVGSurfaceImpl* CSWOpenVGRendererImpl::CreateVGSurfaceL(TInt aOption)
{
- return CSWVGSurfaceImpl::NewL();
+ if(aOption)
+ return CSWVGSurfaceImpl::NewL();
+ else
+ return CSWVGTargetSurfaceImpl::NewL(); //M2G: Enable rendering on target buffer.
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svgtopt/VGRenderer/SWVG/src/swopenvgtargetsurfaceimpl.cpp Tue Aug 31 16:06:58 2010 +0300
@@ -0,0 +1,226 @@
+/*
+ * Copyright (c) 2003 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"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: CSWVGTargetSurfaceImpl source file
+ *
+*/
+
+#include "swopenvgtargetSurfaceImpl.h"
+
+#include <platform/vg/vgcontext.h>
+
+#include <svgtbitmap.h>
+
+CSWVGTargetSurfaceImpl::CSWVGTargetSurfaceImpl()
+ {
+ }
+
+CSWVGTargetSurfaceImpl::~CSWVGTargetSurfaceImpl()
+ {
+ }
+
+CSWVGTargetSurfaceImpl* CSWVGTargetSurfaceImpl::NewL()
+ {
+ CSWVGTargetSurfaceImpl* self = CSWVGTargetSurfaceImpl::NewLC();
+ CleanupStack::Pop();
+ return self;
+ }
+
+CSWVGTargetSurfaceImpl* CSWVGTargetSurfaceImpl::NewLC()
+ {
+ CSWVGTargetSurfaceImpl* self = new (ELeave) CSWVGTargetSurfaceImpl();
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ return self;
+ }
+
+inline void CSWVGTargetSurfaceImpl::ConstructL()
+ {
+ }
+
+TInt CSWVGTargetSurfaceImpl::InitializeSurface(TSize aSize, TInt aColorSpace)
+ {
+ iSize = aSize;
+ TInt vgError = ::VGIInitialize(aSize.iWidth,aSize.iHeight, (VGIColorSpace)aColorSpace);
+ return MapOpenVGErrorToSymbianError(vgError);
+ }
+
+void CSWVGTargetSurfaceImpl::SetConfiguration(TInt /*aOption*/, const TAny* /*aValue*/)
+ {
+ }
+
+TInt CSWVGTargetSurfaceImpl::CreateSurface(TInt /*aDisplayMode*/, RWindow */*aSurface*/, CFbsBitmap */*aBitmap*/)
+ {
+ return KErrNotSupported;
+ }
+
+TInt CSWVGTargetSurfaceImpl::CreateSurface(TInt /*aDisplayMode*/, RWindow */*aSurface*/, CSvgtBitmap */*aBitmap*/)
+ {
+ return KErrNone;
+ }
+
+TInt CSWVGTargetSurfaceImpl::ResizeSurface(TSize aSize)
+ {
+ iSize = aSize;
+ TInt vgError = ::VGIResize(aSize.iWidth,aSize.iHeight);
+ return MapOpenVGErrorToSymbianError(vgError);
+ }
+
+TInt CSWVGTargetSurfaceImpl::CopyBitmap(TInt /*aDisplayMode*/, TInt /*aMaskMode*/, CFbsBitmap */*aBitmap*/, CFbsBitmap */*aMask*/, TSize /*aSize*/)
+ {
+ return KErrNotSupported;
+ }
+TInt CSWVGTargetSurfaceImpl::CopyBitmap(TInt /*aDisplayMode*/,TInt /*aMaskMode*/,CSvgtBitmap *aBitmap, CSvgtBitmap *aMask, TSize /*aSize*/)
+ {
+ VGIColorBufferFormat format =
+ (VGIColorBufferFormat)MapSymbianDisplayModeToOpenVG( (TDisplayMode)aBitmap->DisplayMode() );
+
+ TInt vgError = KErrNone;
+ if(aMask)
+ {
+ vgError = ::VGICopyToTarget(format,
+ aBitmap->Stride(), aBitmap->BitmapBuffer(),
+ aMask->Stride(), aMask->BitmapBuffer(),
+ VGI_SKIP_TRANSPARENT_PIXELS);
+ }
+ else
+ {
+ vgError = ::VGICopyToTarget(format,
+ aBitmap->Stride(), aBitmap->BitmapBuffer(),
+ 0, NULL,
+ VGI_COPY_TRANSPARENT_PIXELS);
+ }
+
+ return MapOpenVGErrorToSymbianError(vgError);
+ }
+
+TInt CSWVGTargetSurfaceImpl::PrepareToBindClientBuffer()
+ {
+ return KErrNone;
+ }
+
+TInt CSWVGTargetSurfaceImpl::BindClientBuffer(TInt buffer)
+ {
+ return MapOpenVGErrorToSymbianError(::VGIBindToImage(buffer));
+ }
+
+TInt CSWVGTargetSurfaceImpl::UnBindClientBuffer()
+ {
+ return MapOpenVGErrorToSymbianError(::VGIUnBindImage());
+ }
+
+void CSWVGTargetSurfaceImpl::TerminateSurface()
+ {
+ ::VGITerminate();
+ }
+
+TInt CSWVGTargetSurfaceImpl::MapSymbianDisplayModeToOpenVG( TDisplayMode aMode) const
+ {
+ VGIColorBufferFormat format;
+ switch( aMode )
+ {
+ case EColor16MA:
+ format = VGI_COLOR_BUFFER_FORMAT_ARGB8888;
+ break;
+
+ case EColor16MU:
+ format = VGI_COLOR_BUFFER_FORMAT_XRGB8888;
+ break;
+
+ case EColor16MAP:
+ format = VGI_COLOR_BUFFER_FORMAT_ARGB8888_PRE;
+ break;
+
+ case EColor16M:
+ format = VGI_COLOR_BUFFER_FORMAT_RGB888;
+ break;
+
+ case EColor64K:
+ format = VGI_COLOR_BUFFER_FORMAT_RGB565;
+ break;
+
+ case EColor4K:
+ format = VGI_COLOR_BUFFER_FORMAT_XRGB4444;
+ break;
+
+ default:
+ return KErrNotSupported;
+ }
+ return format;
+ }
+
+TInt CSWVGTargetSurfaceImpl::MapOpenVGErrorToSymbianError( TInt aError ) const
+ {
+ TInt error = KErrNone;
+ switch (aError)
+ {
+ case VGI_OK:
+ {
+ error = KErrNone;
+ break;
+ }
+ case VG_OUT_OF_MEMORY_ERROR:
+ case VGI_ERROR_OUT_OF_MEMORY:
+ {
+ error = KErrNoMemory;
+ break;
+ }
+ case VG_ILLEGAL_ARGUMENT_ERROR:
+ case VGI_ERROR_INVALID_ARGUMENTS:
+ {
+ error = KErrArgument;
+ break;
+ }
+ case VGI_ERROR_ALREADY_EXISTS:
+ {
+ error = KErrAlreadyExists;
+ break;
+ }
+ case VG_UNSUPPORTED_PATH_FORMAT_ERROR:
+ case VGI_ERROR_COLORSPACE_NOT_SUPPORTED:
+ case VG_UNSUPPORTED_IMAGE_FORMAT_ERROR:
+ case VGI_ERROR_NOT_SUPPORTED:
+ {
+ error = KErrNotSupported;
+ break;
+ }
+ case VGI_ERROR_ILLEGAL_IMAGE_HANDLE:
+ {
+ error = KErrBadHandle;
+ break;
+ }
+ case VG_IMAGE_IN_USE_ERROR:
+ case VGI_ERROR_IMAGE_IN_USE:
+ {
+ error = KErrInUse;
+ break;
+ }
+ case VGI_ERROR_ILLEGAL_OPERATION:
+ {
+ error = KErrPermissionDenied;
+ break;
+ }
+ case VG_BAD_HANDLE_ERROR:
+ case VG_PATH_CAPABILITY_ERROR:
+ {
+ error = KErrUnknown;
+ break;
+ }
+ default:
+ {
+ error = KErrUnknown;
+ }
+ }
+
+ return error;
+ }
--- a/svgtopt/VGRenderer/inc/MVGSurfaceImpl.h Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/VGRenderer/inc/MVGSurfaceImpl.h Tue Aug 31 16:06:58 2010 +0300
@@ -23,6 +23,7 @@
class RWindow;
class CFbsBitmap;
+class CSvgtBitmap;
class MVGSurfaceImpl
{
@@ -39,12 +40,14 @@
virtual TInt InitializeSurface(TSize aSize, TInt aColorSpace) = 0;
virtual TInt CreateSurface(TInt aDisplayMode, RWindow *aSurface, CFbsBitmap *aBitmap) = 0;
+ virtual TInt CreateSurface(TInt /*aDisplayMode*/, RWindow */*aSurface*/, CSvgtBitmap */*aBitmap*/){ return KErrNotSupported; }
virtual TInt ResizeSurface(TSize aSize) = 0;
virtual void SetConfiguration(TInt aOption, const TAny* aValue) = 0;
virtual TInt CopyBitmap(TInt aDisplayMode, TInt aMaskMode, CFbsBitmap *aBitmap, CFbsBitmap *aMask, TSize aSize = TSize(0,0)) = 0;
+ virtual TInt CopyBitmap(TInt /*aDisplayMode*/, TInt /*aMaskMode*/, CSvgtBitmap* /*aBitmap*/, CSvgtBitmap */*aMask*/, TSize /*aSize*/ = TSize(0,0)) { return KErrNotSupported; }
virtual TInt BindClientBuffer(TInt aBuffer) = 0;
--- a/svgtopt/VGRenderer/inc/VGSurface.h Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/VGRenderer/inc/VGSurface.h Tue Aug 31 16:06:58 2010 +0300
@@ -27,6 +27,8 @@
class CFbsBitmap;
class CVGRenderer;
+class CSvgtBitmap;
+
/**
* CVGSurface
*
@@ -121,6 +123,11 @@
return iImpl->CopyBitmap(aDisplayMode,aMaskMode, aBitmap, aMask, aSize);
}
+ TInt CopyBitmap(TInt aDisplayMode,TInt aMaskMode,CSvgtBitmap *aBitmap, CSvgtBitmap *aMask, TSize aSize)
+ {
+ return iImpl->CopyBitmap(aDisplayMode,aMaskMode, aBitmap, aMask, aSize);
+ }
+
/**
* @fn PrepareToBindClientBuffer
* Prepares the renderer to bind to an image.
--- a/svgtopt/gfx2d/inc/Gfx2dGcInterface.h Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/gfx2d/inc/Gfx2dGcInterface.h Tue Aug 31 16:06:58 2010 +0300
@@ -34,6 +34,7 @@
#include "SvgBitmapFontProvider.h"
class MGfxShape;
class MGfxPaint;
+class CSvgtBitmap;
typedef enum
{
@@ -347,6 +348,10 @@
*/
virtual void UpdateFramebufferL( CFbsBitmap* aFrameBuffer, CFbsBitmap* aMask ) = 0;
virtual void UpdateFramebufferL( CFbsBitmap* aFrameBuffer, CFbsBitmap* aMask,TSize aFrameBufferSize,TDisplayMode aFrameBufferMode,TDisplayMode aMaskDspMode ) =0;
+
+
+ virtual void UpdateFramebufferL( CSvgtBitmap* /*aFrameBuffer*/, CSvgtBitmap* /*aMask*/ ){}
+ virtual void UpdateFramebufferL( CSvgtBitmap* /*aFrameBuffer*/, CSvgtBitmap* /*aMask*/,TSize /*aFrameBufferSize*/,TDisplayMode /*aFrameBufferMode*/,TDisplayMode /*aMaskDspMode*/ ){}
/**
* Blend aFrameBuffer with background buffer using the opacity value
*
@@ -365,6 +370,7 @@
* @return
*/
virtual void GenerateMask(CFbsBitmap* aMask)=0;
+ virtual void GenerateMask(CSvgtBitmap* /*aMask*/){};
/**
* Set the fill opacity value
--- a/svgtopt/gfx2d/inc/Gfx2dGcOpenVG.h Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/gfx2d/inc/Gfx2dGcOpenVG.h Tue Aug 31 16:06:58 2010 +0300
@@ -26,6 +26,8 @@
#include "VGSurface.h"
#include <VG/openvg.h>
+class CSvgtBitmap;
+
const TUint8 KMediaAnimationVisible = 2;
/**
@@ -47,7 +49,7 @@
*/
static CGfx2dGcOpenVG* NewL( const TSize aBufferSize, TFontSpec& aFontSpec, CSvgBitmapFontProvider* aSvgBitmapFontProvider, TBool aIsMain = ETrue );
- static CGfx2dGcOpenVG* NewL( const TSize aBufferSize, TFontSpec& aFontSpec, CSvgBitmapFontProvider* aSvgBitmapFontProvider,SVGRendererId aRendererType,TBool aIsMain = ETrue );
+ static CGfx2dGcOpenVG* NewL( const TSize aBufferSize, TFontSpec& aFontSpec, CSvgBitmapFontProvider* aSvgBitmapFontProvider,SVGRendererId aRendererType,TBool aRenderOption = ETrue );
void GetFontScaled( TFloatFixPt aHeight, const TDesC& aTypefaceName, CFont*& aFont, TFontSpec& aFontSpec );
/**
@@ -352,7 +354,10 @@
void UpdateFramebufferL( CFbsBitmap* aBitmap, CFbsBitmap* aMask );
void UpdateFramebufferL( CFbsBitmap* aBitmap, CFbsBitmap* aMask,TSize BitmapSize,TDisplayMode aBitmapDspMode,TDisplayMode aMaskDspMode );
- /**
+
+ void UpdateFramebufferL( CSvgtBitmap* aBitmap, CSvgtBitmap* aMask );
+ void UpdateFramebufferL( CSvgtBitmap* aBitmap, CSvgtBitmap* aMask,TSize BitmapSize,TDisplayMode aBitmapDspMode,TDisplayMode aMaskDspMode );
+ /**
* Blend aFrameBuffer with background buffer using the opacity value
*
* @since 1.0
@@ -370,7 +375,8 @@
* @return
*/
void GenerateMask(CFbsBitmap* aMask);
-
+ void GenerateMask(CSvgtBitmap* aMask);
+
/**
* Set the fill opacity value
*
@@ -510,6 +516,12 @@
// Color conversion/copy to Symbian bitmap is needed as final step
TSize iColorBufferSize;
+ TDisplayMode iDisplayMode;
+
+ // M2G: Variable to specify the target rendering option (rendering onto bitmap or onto target)
+ TBool iRenderOption;
+ TBool iGraphicsContextCreated;
+
TGfxRectangle2D iClip;
MGfxPaint* iFillColor;
TFloatFixPt iFillOpacity;
@@ -535,10 +547,6 @@
TFontSpec iFontSpec;
//OpenVG stuff
- TDisplayMode iDisplayMode;
- TBool iGraphicsContextCreated;
- TBool iIsMainContext;
-
VGPaint iFillPaint;
VGPaint iStrokePaint;
VGPath iPath;
--- a/svgtopt/gfx2d/src/GfxGc/Gfx2dGcOpenVG.cpp Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/gfx2d/src/GfxGc/Gfx2dGcOpenVG.cpp Tue Aug 31 16:06:58 2010 +0300
@@ -48,6 +48,7 @@
// OpenVG API Binding Symbian specific
#include <vg/vgcontext_symbian.h>
+#include <svgtbitmap.h>
// For allocating path segment type array
// Found 130 to be max size at bootup
const TInt KPathSegmentTypeInitialSize = 130;
@@ -61,20 +62,21 @@
// --------------------------------------------------------------------------
// CGfx2dGcOpenVG::CGfx2dGcOpenVG() : iScale( 1 ),
// ---------------------------------------------------------------------------
-CGfx2dGcOpenVG::CGfx2dGcOpenVG( TBool /* aIsMainContext */ ) :
+CGfx2dGcOpenVG::CGfx2dGcOpenVG( TBool aRenderOption ) :
+ iRenderOption(aRenderOption),
+ iGraphicsContextCreated( EFalse ),
iFillOpacity( 1 ),
iScale( 1 ),
iStrokeColor( 0 ),
iStrokeOpacity( 1 ),
iBackgroundColor( 0xffffff ),
- iFontSize( 10 ),
- iFontWeight( -1 ),
- iFontStyle( -1 ),
- iFamilies( NULL ),
- iTextAnchor( EGfxTextAnchorNone ),
- iTextDecoration( EGfxTextDecorationNone ),
- iGraphicsContextCreated( EFalse ),
- iRenderQuality(VG_RENDERING_QUALITY_BETTER),
+ iFontSize( 10 ),
+ iFontWeight( -1 ),
+ iFontStyle( -1 ),
+ iFamilies( NULL ),
+ iTextAnchor( EGfxTextAnchorNone ),
+ iTextDecoration( EGfxTextDecorationNone ),
+ iRenderQuality(VG_RENDERING_QUALITY_BETTER),
iCurrentRendererType(ESVGRendererSW)
{
@@ -86,9 +88,9 @@
// --------------------------------------------------------------------------
// CGfx2dGcOpenVG* CGfx2dGcOpenVG::NewL( CFbsBitmap* aFrameBuffer, TFontSpec& aFontSpec )
// ---------------------------------------------------------------------------
- CGfx2dGcOpenVG* CGfx2dGcOpenVG::NewL( const TSize aBufferSize, TFontSpec& aFontSpec, CSvgBitmapFontProvider* aSvgBitmapFontProvider, TBool aIsMainContext )
+ CGfx2dGcOpenVG* CGfx2dGcOpenVG::NewL( const TSize aBufferSize, TFontSpec& aFontSpec, CSvgBitmapFontProvider* aSvgBitmapFontProvider, TBool aRenderOption )
{
- CGfx2dGcOpenVG* self = new( ELeave ) CGfx2dGcOpenVG( aIsMainContext );
+ CGfx2dGcOpenVG* self = new( ELeave ) CGfx2dGcOpenVG( aRenderOption );
CleanupStack::PushL( self );
self->ConstructL( aBufferSize, aFontSpec, aSvgBitmapFontProvider);
CleanupStack::Pop();
@@ -123,7 +125,7 @@
iDashArray = new ( ELeave ) CArrayFixFlat<VGfloat>( 32 );
- iVgRenderer = CVGRenderer::NewL(ESVGRendererSW, 0);
+ iVgRenderer = CVGRenderer::NewL(ESVGRendererSW, iRenderOption);
iVgSurface = iVgRenderer->GetCurrentSurface();
ChangeBufferSizeL( aBufferSize );
}
@@ -131,9 +133,9 @@
// --------------------------------------------------------------------------
// CGfx2dGcOpenVG* CGfx2dGcOpenVG::NewL( CFbsBitmap* aFrameBuffer, TFontSpec& aFontSpec )
// ---------------------------------------------------------------------------
- CGfx2dGcOpenVG* CGfx2dGcOpenVG::NewL( const TSize aBufferSize, TFontSpec& aFontSpec, CSvgBitmapFontProvider* aSvgBitmapFontProvider,SVGRendererId aRendererType,TBool aIsMainContext )
+ CGfx2dGcOpenVG* CGfx2dGcOpenVG::NewL( const TSize aBufferSize, TFontSpec& aFontSpec, CSvgBitmapFontProvider* aSvgBitmapFontProvider,SVGRendererId aRendererType,TBool aRenderOption )
{
- CGfx2dGcOpenVG* self = new( ELeave ) CGfx2dGcOpenVG( aIsMainContext );
+ CGfx2dGcOpenVG* self = new( ELeave ) CGfx2dGcOpenVG( aRenderOption );
CleanupStack::PushL( self );
self->ConstructL( aBufferSize, aFontSpec, aSvgBitmapFontProvider,aRendererType);
CleanupStack::Pop();
@@ -161,7 +163,7 @@
iDashArray = new ( ELeave ) CArrayFixFlat<VGfloat>( 32 );
iCurrentRendererType = aRendererType;
- iVgRenderer = CVGRenderer::NewL(aRendererType, 0);
+ iVgRenderer = CVGRenderer::NewL(aRendererType, iRenderOption);
iVgSurface = iVgRenderer->GetCurrentSurface();
iVgSurface->InitializeSurface( aBufferSize, VGI_COLORSPACE_SRGB );
@@ -2325,6 +2327,36 @@
iVgRenderer->vgSeti( VG_FILTER_CHANNEL_MASK, KOriginalFilterMasks );
}
+ void CGfx2dGcOpenVG::GenerateMask(CSvgtBitmap* aMask)
+ {
+ if ( !aMask || aMask->SizeInPixels() != iColorBufferSize )
+ {
+ return;
+ }
+
+ const TDisplayMode KMaskDisplayMode = aMask->DisplayMode();
+
+ if ( KMaskDisplayMode != EGray256 && KMaskDisplayMode != EGray2 )
+ {
+ return;
+ }
+
+ const TInt KOriginalFilterMasks = iVgRenderer->vgGeti( VG_FILTER_CHANNEL_MASK );//
+ const TInt KStride = CFbsBitmap::ScanLineLength( iColorBufferSize.iWidth, KMaskDisplayMode );
+
+ // Change to get alpha values from OpenVG
+ iVgRenderer->vgSeti( VG_FILTER_CHANNEL_MASK, VG_ALPHA );
+
+ VGImageFormat format = ( KMaskDisplayMode == EGray256 ) ? VG_A_8 : VG_BW_1;
+
+ // Get data address of last line and move upwards (negative stride)
+ // OpenVG uses Cartesian coordinate system and Symbian uses Screen coordinate system.
+
+ iVgRenderer->vgReadPixels( aMask->BitmapBuffer(), -KStride, format, 0, 0,
+ iColorBufferSize.iWidth, iColorBufferSize.iHeight );
+ // Set back the original filter-masks
+ iVgRenderer->vgSeti( VG_FILTER_CHANNEL_MASK, KOriginalFilterMasks );
+ }
// ==========================================================================
// This function calls the low level function to set fill opacity value
@@ -2987,3 +3019,108 @@
{
return(iVgRenderer->TLVEncodedData());
}
+
+//--------------------------------------------------------------------------------
+// M2G: UpdateFramebufferL() is overloaded to enable rendering on target buffer.
+//--------------------------------------------------------------------------------
+void CGfx2dGcOpenVG::UpdateFramebufferL( CSvgtBitmap* aBitmap, CSvgtBitmap* aMask )
+ {
+ if ( !aBitmap || aBitmap->SizeInPixels() != iColorBufferSize )
+ {
+ return;
+ }
+
+ const TDisplayMode KBitmapDisplayMode = aBitmap->DisplayMode();
+ // This check just before VGISymbianCopyToBitmap avoid putting lot
+ // many similar error checks in the code. If there is any problem
+ // during OpenVG call we simply leave without drawing any thing.
+ VGErrorCode vgret = (VGErrorCode)iVgRenderer->vgGetError();
+
+ if(vgret != VG_NO_ERROR )
+ {
+ User::LeaveIfError(OpenVGErrorToSymbianError(vgret));
+ }
+
+ // EGray2 is not support in VGISymbianCopyToBitmap API
+ if ( KBitmapDisplayMode == EGray2 )
+ {
+ const TInt KStride = aBitmap->Stride();
+
+ iVgRenderer->vgReadPixels( aBitmap->BitmapBuffer(), -KStride, VG_BW_1, 0, 0,
+ iColorBufferSize.iWidth, iColorBufferSize.iHeight );
+ }
+ // All other color modes
+ else
+ {
+ // No Mask -- to be generated in GenerateMask
+ TInt error=KErrNone;
+
+ //In cases, where the mask/aMaskBitmap != NULL, the hint should be defined as VGI_SKIP_TRANSPARENT_PIXELS.
+ //In all other cases, i.e., when mask/aMaskBitmap == NULL, the definition should be VGI_COPY_TRANSPARENT_PIXELS
+ error = iVgSurface->CopyBitmap(ENone,ENone, aBitmap, aMask, iColorBufferSize);
+
+ if ( error != KErrNone )
+ {
+ #ifdef _DEBUG
+ RDebug::Printf("VGICopyToTarget failed: error code: %d", error );
+ RDebug::Printf(" - Color mode: %d", aBitmap->DisplayMode() );
+ RDebug::Printf(" - Bitmap size: %dx%d", iColorBufferSize.iWidth, iColorBufferSize.iHeight );
+ #endif
+ User::LeaveIfError(error);
+ }
+ }
+ }
+
+//--------------------------------------------------------------------------------
+// M2G: UpdateFramebufferL() is overloaded to enable rendering on target buffer.
+//--------------------------------------------------------------------------------
+void CGfx2dGcOpenVG::UpdateFramebufferL( CSvgtBitmap* aBitmap, CSvgtBitmap* aMask,TSize /*BitmapSize*/,TDisplayMode aBitmapDspMode,TDisplayMode aMaskDspMode )
+ {
+ if ( !aBitmap)
+ {
+ return;
+ }
+
+ const TDisplayMode KBitmapDisplayMode = aBitmap->DisplayMode();
+ // This check just before VGISymbianCopyToBitmap avoid putting lot
+ // many similar error checks in the code. If there is any problem
+ // during OpenVG call we simply leave without drawing any thing.
+ VGErrorCode vgret = (VGErrorCode)iVgRenderer->vgGetError();
+
+ if(vgret != VG_NO_ERROR )
+ {
+ User::LeaveIfError(OpenVGErrorToSymbianError(vgret));
+ }
+
+ // EGray2 is not support in VGISymbianCopyToBitmap API
+ if ( KBitmapDisplayMode == EGray2 )
+ {
+ const TInt KStride = aBitmap->Stride();
+
+ iVgRenderer->vgReadPixels( aBitmap->BitmapBuffer(), -KStride, VG_BW_1, 0, 0,
+ iColorBufferSize.iWidth, iColorBufferSize.iHeight );
+
+ }
+ // All other color modes
+ else
+ {
+ // No Mask -- to be generated in GenerateMask
+ TInt error=KErrNone;
+
+ //In cases, where the mask/aMaskBitmap != NULL, the hint should be defined as VGI_SKIP_TRANSPARENT_PIXELS.
+ //In all other cases, i.e., when mask/aMaskBitmap == NULL, the definition should be VGI_COPY_TRANSPARENT_PIXELS
+
+ error = iVgSurface->CopyBitmap(aBitmapDspMode, aMaskDspMode, aBitmap, aMask, iColorBufferSize);
+
+ if ( error != KErrNone )
+ {
+ #ifdef _DEBUG
+ RDebug::Printf("VGICopyToTarget failed: error code: %d", error );
+ RDebug::Printf(" - Color mode: %d", aBitmap->DisplayMode() );
+ RDebug::Printf(" - Bitmap size: %dx%d", iColorBufferSize.iWidth, iColorBufferSize.iHeight );
+ #endif
+ User::LeaveIfError(error);
+ }
+ }
+
+ }
--- a/svgtopt/nvgdecoder/src/TLVIconCreator.cpp Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/nvgdecoder/src/TLVIconCreator.cpp Tue Aug 31 16:06:58 2010 +0300
@@ -71,45 +71,45 @@
:
iNVGDataPtr((TUint8 *)&aWidth, 1)
{
- vgapi[EvgSeti] = &DvgAddCommandL;
- vgapi[EvgSetf] = &DvgAddCommandL;
- vgapi[EvgSetParameteri] = &DvgAddCommandL;
- vgapi[EvgSetParameterf] = &DvgAddCommandL;
- vgapi[EvgSetParameterfv] = &DvgSetParameterfvL;
- vgapi[EvgSetColor] = &DvgAddCommandL;
- vgapi[EvgSetPaint] = &DvgAddCommandL;
- vgapi[EvgLoadMatrix] = &DvgAddCommandL;
- vgapi[EvgMultMatrix] = &DvgAddCommandL;
- vgapi[EvgLoadIdentity] = &DvgAddCommandL;
- vgapi[EvgScale] = &DvgAddCommandL;
- vgapi[EvgTranslate] = &DvgAddCommandL;
- vgapi[EvgAppendPathData] = &DvgAppendPathDataL;
- vgapi[EvgDrawPath] = &DvgDrawPathL;
- vgapi[EvgClearPath] = &DvgAddCommandL;
- vgapi[EvguRect] = &DvguRectL;
- vgapi[EvguEllipse] = &DvguEllipseL;
- vgapi[EvguRoundRect] = &DvguRoundRectL;
- vgapi[EvguLine] = &DvguLineL;
- vgapi[EvgCreatePaint] = &DvgAddCommandL;
- vgapi[EvgSetiv] = &DvgSetivL;
- vgapi[EvgClear] = &DvgAddCommandL;
- vgapi[EvgSetfv] = &DvgSetfvL;
- vgapi[EvgRotate] = &DvgAddCommandL;
- vgapi[EvgCreatePath] = &DvgCreatePathL;
- vgapi[EvgCreateImage] = &DvgAddCommandL;
- vgapi[EvgGetPixels] = &DvgGetPixelsL;
- vgapi[EvgDrawImage] = &DvgAddCommandL;
- vgapi[EvgClearImage] = &DvgAddCommandL;
- vgapi[EvgImageSubData] = &DvgImageSubDataL;
- vgapi[EvgDestroyImage] = &DvgAddCommandL;
- vgapi[EvgDestroyPaint] = &DvgDestroyPaintL;
- vgapi[EvgDestroyPath] = &DvgDestroyPathL;
+ vgapi[EvgSeti] = &CTLVIconCreator::DvgAddCommandL;
+ vgapi[EvgSetf] = &CTLVIconCreator::DvgAddCommandL;
+ vgapi[EvgSetParameteri] = &CTLVIconCreator::DvgAddCommandL;
+ vgapi[EvgSetParameterf] = &CTLVIconCreator::DvgAddCommandL;
+ vgapi[EvgSetParameterfv] = &CTLVIconCreator::DvgSetParameterfvL;
+ vgapi[EvgSetColor] = &CTLVIconCreator::DvgAddCommandL;
+ vgapi[EvgSetPaint] = &CTLVIconCreator::DvgAddCommandL;
+ vgapi[EvgLoadMatrix] = &CTLVIconCreator::DvgAddCommandL;
+ vgapi[EvgMultMatrix] = &CTLVIconCreator::DvgAddCommandL;
+ vgapi[EvgLoadIdentity] = &CTLVIconCreator::DvgAddCommandL;
+ vgapi[EvgScale] = &CTLVIconCreator::DvgAddCommandL;
+ vgapi[EvgTranslate] = &CTLVIconCreator::DvgAddCommandL;
+ vgapi[EvgAppendPathData] = &CTLVIconCreator::DvgAppendPathDataL;
+ vgapi[EvgDrawPath] = &CTLVIconCreator::DvgDrawPathL;
+ vgapi[EvgClearPath] = &CTLVIconCreator::DvgAddCommandL;
+ vgapi[EvguRect] = &CTLVIconCreator::DvguRectL;
+ vgapi[EvguEllipse] = &CTLVIconCreator::DvguEllipseL;
+ vgapi[EvguRoundRect] = &CTLVIconCreator::DvguRoundRectL;
+ vgapi[EvguLine] = &CTLVIconCreator::DvguLineL;
+ vgapi[EvgCreatePaint] = &CTLVIconCreator::DvgAddCommandL;
+ vgapi[EvgSetiv] = &CTLVIconCreator::DvgSetivL;
+ vgapi[EvgClear] = &CTLVIconCreator::DvgAddCommandL;
+ vgapi[EvgSetfv] = &CTLVIconCreator::DvgSetfvL;
+ vgapi[EvgRotate] = &CTLVIconCreator::DvgAddCommandL;
+ vgapi[EvgCreatePath] = &CTLVIconCreator::DvgCreatePathL;
+ vgapi[EvgCreateImage] = &CTLVIconCreator::DvgAddCommandL;
+ vgapi[EvgGetPixels] = &CTLVIconCreator::DvgGetPixelsL;
+ vgapi[EvgDrawImage] = &CTLVIconCreator::DvgAddCommandL;
+ vgapi[EvgClearImage] = &CTLVIconCreator::DvgAddCommandL;
+ vgapi[EvgImageSubData] = &CTLVIconCreator::DvgImageSubDataL;
+ vgapi[EvgDestroyImage] = &CTLVIconCreator::DvgAddCommandL;
+ vgapi[EvgDestroyPaint] = &CTLVIconCreator::DvgDestroyPaintL;
+ vgapi[EvgDestroyPath] = &CTLVIconCreator::DvgDestroyPathL;
- vgapi[EvgPrepareToBindImage]= &DvgAddCommandL;
- vgapi[EvgBindImage] = &DvgAddCommandL;
- vgapi[EvgUnBindImage] = &DvgAddCommandL;
+ vgapi[EvgPrepareToBindImage]= &CTLVIconCreator::DvgAddCommandL;
+ vgapi[EvgBindImage] = &CTLVIconCreator::DvgAddCommandL;
+ vgapi[EvgUnBindImage] = &CTLVIconCreator::DvgAddCommandL;
- vgapi[EvgFlush] = &DvgAddCommandL;
+ vgapi[EvgFlush] = &CTLVIconCreator::DvgAddCommandL;
iTargetWidth = aWidth;
iTargetHeight = aHeight;
--- a/svgtopt/nvgdecoder/src/TLVRenderer.cpp Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/nvgdecoder/src/TLVRenderer.cpp Tue Aug 31 16:06:58 2010 +0300
@@ -51,43 +51,43 @@
void CTLVRenderer::ConstructL(const TDesC8& aBuf)
{
- vgapi[EvgSeti] = &DvgSetiL;
- vgapi[EvgSetf] = &DvgSetfL;
- vgapi[EvgSetParameteri] = &DvgSetParameteriL;
- vgapi[EvgSetParameterf] = &DvgSetParameterfL;
- vgapi[EvgSetParameterfv] = &DvgSetParameterfvL;
- vgapi[EvgSetColor] = &DvgSetColorL;
- vgapi[EvgSetPaint] = &DvgSetPaintL;
- vgapi[EvgLoadMatrix] = &DvgLoadMatrixL;
- vgapi[EvgMultMatrix] = &DvgMultMatrixL;
- vgapi[EvgLoadIdentity] = &DvgLoadIdentityL;
- vgapi[EvgScale] = &DvgScaleL;
- vgapi[EvgTranslate] = &DvgTranslateL;
- vgapi[EvgAppendPathData] = &DvgAppendPathDataL;
- vgapi[EvgDrawPath] = &DvgDrawPathL;
- vgapi[EvgClearPath] = &DvgClearPathL;
- vgapi[EvguRect] = &DvguRectL;
- vgapi[EvguEllipse] = &DvguEllipseL;
- vgapi[EvguRoundRect] = &DvguRoundRectL;
- vgapi[EvguLine] = &DvguLineL;
- vgapi[EvgCreatePaint] = &DvgCreatePaintL;
- vgapi[EvgSetiv] = &DvgSetivL;
- vgapi[EvgClear] = &DvgClearL;
- vgapi[EvgSetfv] = &DvgSetfvL;
- vgapi[EvgRotate] = &DvgRotateL;
- vgapi[EvgCreatePath] = &DvgCreatePathL;
- vgapi[EvgCreateImage] = &DvgCreateImageL;
- vgapi[EvgGetPixels] = &DvgGetPixelsL;
- vgapi[EvgDrawImage] = &DvgDrawImageL;
- vgapi[EvgClearImage] = &DvgClearImageL;
- vgapi[EvgImageSubData] = &DvgImageSubDataL;
- vgapi[EvgDestroyImage] = &DvgDestroyImageL;
- vgapi[EvgDestroyPaint] = &DvgDestroyPaintL;
- vgapi[EvgDestroyPath] = &DvgDestroyPathL;
- vgapi[EvgPrepareToBindImage]= &DvgPrepareToBindImageL;
- vgapi[EvgBindImage] = &DvgBindImageL;
- vgapi[EvgUnBindImage] = &DvgUnBindImageL;
- vgapi[EvgFlush] = &DvgFlushL;
+ vgapi[EvgSeti] = &CTLVRenderer::DvgSetiL;
+ vgapi[EvgSetf] = &CTLVRenderer::DvgSetfL;
+ vgapi[EvgSetParameteri] = &CTLVRenderer::DvgSetParameteriL;
+ vgapi[EvgSetParameterf] = &CTLVRenderer::DvgSetParameterfL;
+ vgapi[EvgSetParameterfv] = &CTLVRenderer::DvgSetParameterfvL;
+ vgapi[EvgSetColor] = &CTLVRenderer::DvgSetColorL;
+ vgapi[EvgSetPaint] = &CTLVRenderer::DvgSetPaintL;
+ vgapi[EvgLoadMatrix] = &CTLVRenderer::DvgLoadMatrixL;
+ vgapi[EvgMultMatrix] = &CTLVRenderer::DvgMultMatrixL;
+ vgapi[EvgLoadIdentity] = &CTLVRenderer::DvgLoadIdentityL;
+ vgapi[EvgScale] = &CTLVRenderer::DvgScaleL;
+ vgapi[EvgTranslate] = &CTLVRenderer::DvgTranslateL;
+ vgapi[EvgAppendPathData] = &CTLVRenderer::DvgAppendPathDataL;
+ vgapi[EvgDrawPath] = &CTLVRenderer::DvgDrawPathL;
+ vgapi[EvgClearPath] = &CTLVRenderer::DvgClearPathL;
+ vgapi[EvguRect] = &CTLVRenderer::DvguRectL;
+ vgapi[EvguEllipse] = &CTLVRenderer::DvguEllipseL;
+ vgapi[EvguRoundRect] = &CTLVRenderer::DvguRoundRectL;
+ vgapi[EvguLine] = &CTLVRenderer::DvguLineL;
+ vgapi[EvgCreatePaint] = &CTLVRenderer::DvgCreatePaintL;
+ vgapi[EvgSetiv] = &CTLVRenderer::DvgSetivL;
+ vgapi[EvgClear] = &CTLVRenderer::DvgClearL;
+ vgapi[EvgSetfv] = &CTLVRenderer::DvgSetfvL;
+ vgapi[EvgRotate] = &CTLVRenderer::DvgRotateL;
+ vgapi[EvgCreatePath] = &CTLVRenderer::DvgCreatePathL;
+ vgapi[EvgCreateImage] = &CTLVRenderer::DvgCreateImageL;
+ vgapi[EvgGetPixels] = &CTLVRenderer::DvgGetPixelsL;
+ vgapi[EvgDrawImage] = &CTLVRenderer::DvgDrawImageL;
+ vgapi[EvgClearImage] = &CTLVRenderer::DvgClearImageL;
+ vgapi[EvgImageSubData] = &CTLVRenderer::DvgImageSubDataL;
+ vgapi[EvgDestroyImage] = &CTLVRenderer::DvgDestroyImageL;
+ vgapi[EvgDestroyPaint] = &CTLVRenderer::DvgDestroyPaintL;
+ vgapi[EvgDestroyPath] = &CTLVRenderer::DvgDestroyPathL;
+ vgapi[EvgPrepareToBindImage]= &CTLVRenderer::DvgPrepareToBindImageL;
+ vgapi[EvgBindImage] = &CTLVRenderer::DvgBindImageL;
+ vgapi[EvgUnBindImage] = &CTLVRenderer::DvgUnBindImageL;
+ vgapi[EvgFlush] = &CTLVRenderer::DvgFlushL;
vgGetMatrix(iUserMatrix);
--- a/svgtopt/nvgdecoder/src/nvg.cpp Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/nvgdecoder/src/nvg.cpp Tue Aug 31 16:06:58 2010 +0300
@@ -181,7 +181,8 @@
iLastPathDataType(0),
iPreserveAspectSetting(ENvgPreserveAspectRatio_XmidYmid),
iSmilFitSetting(ENvgMeet),
- iVGImageBinder(0)
+ iVGImageBinder(0),
+ iBackgroundColor(0)
{
}
@@ -406,6 +407,11 @@
iCurrentBufferSize = aSize;
}
+ if (iBackgroundColor)
+ {
+ ClearBackground();
+ }
+
iDstBimtap = aDstBitmap;
TDereferencer nvgIconData(aBuffer);
@@ -1559,14 +1565,14 @@
void CNvgEngine::ClearBackground()
{
- TUint32 rgba = (iBackgroundColor << 8) | (iBackgroundColor >> 24);
+ TUint32 rgba = iBackgroundColor;//(iBackgroundColor << 8) | (iBackgroundColor >> 24);
TInt32 r, g, b, a;
r = (TInt)((rgba & 0xFF000000) >> 24);
g = (TInt)((rgba & 0x00FF0000) >> 16);
b = (TInt)((rgba & 0x0000FF00) >> 8);
a = (TInt)(rgba & 0x000000FF);
- r += r >> 7; g += g >> 7; b += b >> 7; a += a >> 7;
+ //r += r >> 7; g += g >> 7; b += b >> 7; a += a >> 7;
const VGfloat KInverse255 = 1.0f/256.0f;
const VGfloat clearColor[4] = { (KInverse255 * VGfloat (r)),
@@ -1574,10 +1580,10 @@
(KInverse255 * VGfloat (b)),
(KInverse255 * VGfloat (a)) };
- vgSeti(VG_SCISSORING, VG_FALSE);
+ //vgSeti(VG_SCISSORING, VG_FALSE);
vgSetfv(VG_CLEAR_COLOR, 4, clearColor);
vgClear(0, 0, iCurrentBufferSize.iWidth, iCurrentBufferSize.iHeight);
- vgSeti(VG_SCISSORING, VG_TRUE);
+ //vgSeti(VG_SCISSORING, VG_TRUE);
}
TBool CNvgEngine::IsIdentity(VGfloat array[])