Merge 1. Pull in cpp files in the performance enhanced Khronos RI OVG files which are newly added. I've ignored platform-specific cpp files for linux, macosx, and null operating systems because this local solution has its own platform glue (i.e. facility to target Bitmaps but no full windowing support). I've ignored sfEGLInterface.cpp because this is used as a bridge to go from EGL to Nokia's Platsim which offers an EGL service. That's not relevant to this implementation because this is ARM side code, not Intel side. I just left a comment to sfEGLInterface.cpp in case we need to pick up this later on. The current code compiles on winscw. Prior to this fix, the code works on winscw, and can launch the SVG tiger (tiger.exe). That takes about 20 seconds to render. I hope to always be able to show this icon on each commit, and the plan is for the render time to reduce with this series of submissions. On this commit, the tiger renders ok in 20 seconds.
// Copyright (c) 1997-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:
//
#ifndef PDRBODY_H
#define PDRBODY_H
#include <e32std.h>
#include <s32file.h>
#include <PDRSTORE.H>
/**
@internalComponent
*/
const TInt KCInfoFontUidVal = 268435524;
/**
pdr store files are backwardly compatible to this value
@internalComponent
*/
const TInt KPdrtranVersion = 22;
/**
50 points
@internalComponent
*/
const TInt KScalableWidthTableHeightInTwips = 1000;
/**
@internalComponent
*/
const TInt KMaxCommandStringMaxLength=0x100;
/**
@internalComponent
*/
enum TStyleIndex
{
EStyleNormal,
EStyleBold,
EStyleItalic,
EStyleBoldItalic
};
class TPdrResource
/**
@internalComponent
*/
{
public:
TPdrResource();
void InternalizeL(RReadStream& aStream);
public:
TInt iId;
TCommandString iString;
};
NONSHARABLE_CLASS(CPdrTranslation) : public CBase
/**
@internalComponent
*/
{
public:
CPdrTranslation();
~CPdrTranslation();
void InternalizeL(RReadStream& aStream);
public:
TInt iFrom;
HBufC8* iTo;
};
NONSHARABLE_CLASS(CPdrTranslates) : public CBase
/**
@internalComponent
*/
{
public:
CPdrTranslates();
void InternalizeL(RReadStream& aStream);
~CPdrTranslates();
HBufC8* TranslateStringL(const TDesC& aString) const;
public:
TStreamId iStreamId;
TInt iNumTranslations;
CPdrTranslation** iTranslationList;
};
NONSHARABLE_CLASS(CWidthsCodeSection) : public CBase
/**
@internalComponent
*/
{
public:
CWidthsCodeSection();
void InternalizeL(RReadStream& aStream);
~CWidthsCodeSection();
public:
TCodeSection iCodeSection;
TInt iNumWidths;
TUint16* iWidthList;
};
NONSHARABLE_CLASS(CFontInfo) : public CBase
/**
@internalComponent
*/
{
public:
CFontInfo(TStreamId aStreamId);
void InternalizeL(RReadStream &aStream);
~CFontInfo();
TInt CharWidthInPixels(TChar aChar) const;
TInt NumCodeSections() const;
TCodeSection CodeSection(TInt anIndex) const;
public:
TStreamId iStreamId;
TUint16 iAscentInPixels;
TUint16 iMaxCharWidthInPixels;
TUint16 iMaxNormalCharWidthInPixels;
TInt iNumCodeSections;
CWidthsCodeSection** iCodeSectionList;
};
class TPdrStyle
/**
@internalComponent
*/
{
public:
TPdrStyle();
void InternalizeL(RReadStream &aStream);
public:
TBool iIsAvailable;
TStreamId iFontInfoStreamId;
};
class TPdrFontHeight
/**
@internalComponent
*/
{
public:
TPdrFontHeight();
void InternalizeL(RReadStream& aStream);
public:
TCommandString iCommandString;
TInt iHeightInTwips;
TInt iWidthScale;
TPdrStyle iStyle[EStyleBoldItalic + 1]; // N.B. Don't use enums TFontPosture and TFontStrokeWeight as indices
};
class TPdrScalableFontHeight
/**
@internalComponent
*/
{
public:
TPdrScalableFontHeight();
void InternalizeL(RReadStream& aStream);
public:
TCommandString iCommandString;
TInt iHeightMinInTwips;
TInt iHeightMaxInTwips;
TInt iHeightDeltaInTwips;
TPdrStyle iStyle[EStyleBoldItalic + 1]; // N.B. Don't use enums TFontPosture and TFontStrokeWeight as indices
};
NONSHARABLE_CLASS(CTypefaceFonts) : public CBase
/**
@internalComponent
*/
{
public:
CTypefaceFonts();
void InternalizeL(RReadStream& aStream);
~CTypefaceFonts();
TInt IsScalable() const;
TInt NumFontHeights() const;
TInt FontHeightInTwips(TInt aHeightIndex) const;
TInt FontInfoHeightInTwips(TInt aHeightIndex) const;
void CommandString(TDes8& aDes, TInt aHeightIndex) const;
TPdrStyle* Style(TInt aHeightIndex, TFontStyle& aFontStyle) const;
TTypeface Typeface();
private:
TStyleIndex StyleIndex(TFontStyle& aFontStyle) const;
private:
TTypeface iTypeface;
TInt iNumFontHeights; // Also used as flag for !iIsScalable
TPdrFontHeight* iFontHeightList;
TPdrScalableFontHeight* iScalableFontHeight;
public:
TSwizzle<CPdrTranslates> iTranslates;
};
#endif