# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1282117335 -10800 # Node ID ddaf54210378940af6480ff013a8de778d5f8ec8 # Parent 08adb7ae542cdf04e538031e362611e975b53b6e Revision: 201031 Kit: 201033 diff -r 08adb7ae542c -r ddaf54210378 group/bld.inf --- a/group/bld.inf Tue Jul 06 15:17:31 2010 +0300 +++ b/group/bld.inf Wed Aug 18 10:42:15 2010 +0300 @@ -24,7 +24,6 @@ */ #include "../svgtopt/group/bld.inf" -#include "../svgtopt/SVGTPlugin/group/bld.inf" PRJ_PLATFORMS DEFAULT diff -r 08adb7ae542c -r ddaf54210378 package_definition.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/package_definition.xml Wed Aug 18 10:42:15 2010 +0300 @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff -r 08adb7ae542c -r ddaf54210378 package_map.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/package_map.xml Wed Aug 18 10:42:15 2010 +0300 @@ -0,0 +1,1 @@ + diff -r 08adb7ae542c -r ddaf54210378 svgtopt/SVGTPlugin/BWINSCW/NPSVGTPLUGINU.DEF --- a/svgtopt/SVGTPlugin/BWINSCW/NPSVGTPLUGINU.DEF Tue Jul 06 15:17:31 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) - diff -r 08adb7ae542c -r ddaf54210378 svgtopt/SVGTPlugin/eabi/npSvgtPluginU.DEF --- a/svgtopt/SVGTPlugin/eabi/npSvgtPluginU.DEF Tue Jul 06 15:17:31 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 ; ## - _ZTI18CSvgtPluginControl @ 5 NONAME ; ## - _ZTI19CSvgtPluginEcomMain @ 6 NONAME ; ## - _ZTV11CSvgtPlugin @ 7 NONAME ; ## - _ZTV18CSvgtPluginControl @ 8 NONAME ; ## - _ZTV19CSvgtPluginEcomMain @ 9 NONAME ; ## - diff -r 08adb7ae542c -r ddaf54210378 svgtopt/SVGTPlugin/group/SVGTPluginS60.pkg --- a/svgtopt/SVGTPlugin/group/SVGTPluginS60.pkg Tue Jul 06 15:17:31 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" - - - - - - - diff -r 08adb7ae542c -r ddaf54210378 svgtopt/SVGTPlugin/group/SVGTPluginS60Ecom.mmp --- a/svgtopt/SVGTPlugin/group/SVGTPluginS60Ecom.mmp Tue Jul 06 15:17:31 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 - -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 diff -r 08adb7ae542c -r ddaf54210378 svgtopt/SVGTPlugin/group/bld.inf --- a/svgtopt/SVGTPlugin/group/bld.inf Tue Jul 06 15:17:31 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 - diff -r 08adb7ae542c -r ddaf54210378 svgtopt/SVGTPlugin/inc/MRepositoryVolumeObserver.h --- a/svgtopt/SVGTPlugin/inc/MRepositoryVolumeObserver.h Tue Jul 06 15:17:31 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 - diff -r 08adb7ae542c -r ddaf54210378 svgtopt/SVGTPlugin/inc/RepositoryVolumeListener.h --- a/svgtopt/SVGTPlugin/inc/RepositoryVolumeListener.h Tue Jul 06 15:17:31 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 -#include -#include - -// -// for emulator max volume = 65535 -#define WINS_DEFAULT_VOLUME 43690 - -// -// For HW max volume = 9 -#define HW_DEFAULT_VOLUME 6 - -#include - -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 diff -r 08adb7ae542c -r ddaf54210378 svgtopt/SVGTPlugin/inc/SvgtPlugin.hrh --- a/svgtopt/SVGTPlugin/inc/SvgtPlugin.hrh Tue Jul 06 15:17:31 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 diff -r 08adb7ae542c -r ddaf54210378 svgtopt/SVGTPlugin/inc/Svgtplugin.h --- a/svgtopt/SVGTPlugin/inc/Svgtplugin.h Tue Jul 06 15:17:31 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 -#include -#include -#include -#include - -#include -//SVGT Engine interface -#include -#include -#include -#include "SVGListener.h" - -#include -#include - -#include - -#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 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 diff -r 08adb7ae542c -r ddaf54210378 svgtopt/SVGTPlugin/inc/VolumeKeyListener.h --- a/svgtopt/SVGTPlugin/inc/VolumeKeyListener.h Tue Jul 06 15:17:31 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 -#include -#include - -#include -#include //for MRemConCoreApiTargetObserver -#include //for CRemConInterfaceSelector -#include //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 diff -r 08adb7ae542c -r ddaf54210378 svgtopt/SVGTPlugin/loc/npSVGTPlugin.loc --- a/svgtopt/SVGTPlugin/loc/npSVGTPlugin.loc Tue Jul 06 15:17:31 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 diff -r 08adb7ae542c -r ddaf54210378 svgtopt/SVGTPlugin/resource/s60/101F86DF.rss --- a/svgtopt/SVGTPlugin/resource/s60/101F86DF.rss Tue Jul 06 15:17:31 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 - } - }; - } - }; - } - diff -r 08adb7ae542c -r ddaf54210378 svgtopt/SVGTPlugin/resource/s90/npSvgtplugin.rss --- a/svgtopt/SVGTPlugin/resource/s90/npSvgtplugin.rss Tue Jul 06 15:17:31 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 -#include "SvgtPlugin.hrh" -#include - -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 - diff -r 08adb7ae542c -r ddaf54210378 svgtopt/SVGTPlugin/src/RepositoryVolumeListener.cpp --- a/svgtopt/SVGTPlugin/src/RepositoryVolumeListener.cpp Tue Jul 06 15:17:31 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 - - -#include "RepositoryVolumeListener.h" -//#include //include this file when KSDUidMediaVolumeControl and KMediaVolume will be needed -//#include "epocdebug.h" -#include -#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; - } - - } diff -r 08adb7ae542c -r ddaf54210378 svgtopt/SVGTPlugin/src/SvgtPluginControl.cpp --- a/svgtopt/SVGTPlugin/src/SvgtPluginControl.cpp Tue Jul 06 15:17:31 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 -#include -#include -#include -#include -#include -//#include -#include - -#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((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 - - } - diff -r 08adb7ae542c -r ddaf54210378 svgtopt/SVGTPlugin/src/Svgtplugin.cpp --- a/svgtopt/SVGTPlugin/src/Svgtplugin.cpp Tue Jul 06 15:17:31 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 -#include -#include -#include -#include -#include - -#include - -#include - -#include - -#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(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; - } - diff -r 08adb7ae542c -r ddaf54210378 svgtopt/SVGTPlugin/src/Svgtplugindllapi.cpp --- a/svgtopt/SVGTPlugin/src/Svgtplugindllapi.cpp Tue Jul 06 15:17:31 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*/) - { - } diff -r 08adb7ae542c -r ddaf54210378 svgtopt/SVGTPlugin/src/Svgtpluginmain.cpp --- a/svgtopt/SVGTPlugin/src/Svgtpluginmain.cpp Tue Jul 06 15:17:31 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 -#include -/***************************************************/ -/**********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 ); -} - diff -r 08adb7ae542c -r ddaf54210378 svgtopt/SVGTPlugin/src/VolumeKeyListener.cpp --- a/svgtopt/SVGTPlugin/src/VolumeKeyListener.cpp Tue Jul 06 15:17:31 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 -#include -#include - -#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 - // (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(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 diff -r 08adb7ae542c -r ddaf54210378 svgtopt/nvgdecoder/src/nvg.cpp --- a/svgtopt/nvgdecoder/src/nvg.cpp Tue Jul 06 15:17:31 2010 +0300 +++ b/svgtopt/nvgdecoder/src/nvg.cpp Wed Aug 18 10:42:15 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[])