1 /* |
|
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #if (!defined __T_GRAPHICS_UTIL_H__) |
|
20 #define __T_GRAPHICS_UTIL_H__ |
|
21 |
|
22 // User includes |
|
23 #include "DataWrapperBase.h" |
|
24 |
|
25 // EPOC includes |
|
26 #include <gdi.h> |
|
27 #include <fntstore.h> |
|
28 #include <bitmap.h> |
|
29 #include <w32std.h> |
|
30 #include <icl/imagedata.h> |
|
31 #include <w32stdgraphic.h> // for TWsGraphicAnimation |
|
32 |
|
33 class CT_GraphicsUtil |
|
34 { |
|
35 public: |
|
36 static TBool ReadBitmapfileCompressionScheme(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TBitmapfileCompressionScheme& aCompressionScheme); |
|
37 static TBool ReadBrushStyle(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CGraphicsContext::TBrushStyle& aBrushStyle); |
|
38 static TBool ReadCaptureFlags(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TUint& aCaptureFlags); |
|
39 static TBool ReadComputeMode(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, RWsSession::TComputeMode& aComputeMode); |
|
40 static TBool ReadCornerType(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TCornerType& aCornerType); |
|
41 static TBool ReadDisplayMode(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TDisplayMode& aDisplayMode); |
|
42 static TBool ReadDrawMode(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CGraphicsContext::TDrawMode& aDrawMode); |
|
43 static TBool ReadErrorCategory(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TWsErrorMessage::TErrorCategory& aErrorCategory); |
|
44 static TBool ReadEventCode(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TEventCode& aEventCode); |
|
45 static TBool ReadEventControl(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TEventControl& aEventControl); |
|
46 static TBool ReadEventModifier(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TEventModifier& aEventModifier); |
|
47 static TBool ReadEventModifier(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TUint& aEventModifier); |
|
48 static TBool ReadFadeControl(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, RWindowTreeNode::TFadeControl& aFadeControl); |
|
49 static TBool ReadFillRule(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CGraphicsContext::TFillRule& aFillRule); |
|
50 static TBool ReadFontStrikethrough(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TFontStrikethrough& aFontStrikethrough); |
|
51 static TBool ReadFontUnderline(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TFontUnderline& aFontUnderline); |
|
52 static TBool ReadGlyphBitmapType(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TGlyphBitmapType& aGlyphBitmapType); |
|
53 static TBool ReadGraphicsOrientation(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CFbsBitGc::TGraphicsOrientation& aGraphicsOrientation); |
|
54 static TBool ReadHotKey(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, THotKey& aHotKey); |
|
55 static TBool ReadKeyCode(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TKeyCode& aKeyCode); |
|
56 static TBool ReadLoggingCommand(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, RWsSession::TLoggingCommand& aLoggingCommand); |
|
57 static TBool ReadModifierState(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TModifierState& aModifierState); |
|
58 static TBool ReadPasswordMode(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TPasswordMode& aPasswordMode); |
|
59 static TBool ReadPenStyle(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CGraphicsContext::TPenStyle& aPenStyle); |
|
60 static TBool ReadPointerCursorMode(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TPointerCursorMode& aPointerCursorMode); |
|
61 static TBool ReadPointerFilter(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TPointerFilter& aPointerFilter); |
|
62 static TBool ReadPointerFilter(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TUint& aPointerFilter); |
|
63 //For MAnim |
|
64 static TBool ReadAnimCommand(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TInt& aCommand); |
|
65 static TBool ReadAnimType(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TInt& aType); |
|
66 static TBool ReadTUsage(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CPolygonFiller::TUsage& aUsage); |
|
67 #if defined(SYMBIAN_WSERV_AND_CONE_MULTIPLE_SCREENS) |
|
68 static TBool ReadPriorities(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TInt& aPriorities); |
|
69 #endif |
|
70 static TBool ReadPriority(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CActive::TPriority& aPriority); |
|
71 static TBool ReadScreenModeEnforcement(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TScreenModeEnforcement& aScreenModeEnforcement); |
|
72 static TBool ReadSpriteInCompare(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TUint& aSpriteInCompare); |
|
73 static TBool ReadStdScanCode(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TStdScanCode& aStdScanCode); |
|
74 static TBool ReadTextAlign(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CGraphicsContext::TTextAlign& aTextAlign); |
|
75 static TBool ReadTextDirection(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CFont::TTextDirection& aTextDirection); |
|
76 static TBool ReadType(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TPointerEvent::TType& aType); |
|
77 static TBool ReadType(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TRawEvent::TType& aType); |
|
78 static TBool ReadWindowBackupType(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TUint& aWindowBackupType); |
|
79 static TBool ReadWsTransparencyPolicy(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TWsTransparencyPolicy& aWsTransparencyPolicy); |
|
80 static TBool ReadWsVisibilityChangedEvent(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TWsVisibilityChangedEvent& aWsVisibilityChangedEvent); |
|
81 static TBool ReadLongCaptureFlags(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TLongCaptureFlags& aLongCaptureFlags); |
|
82 static TBool ReadSpriteFlags(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TSpriteFlags& aSpriteFlags); |
|
83 static TBool ReadSpriteFlags(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TUint& aSpriteFlags); |
|
84 static TBool ReadCustomTextCursorAlignment(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, RWsSession::TCustomTextCursorAlignment& aAlignment); |
|
85 static TBool ReadTypefaceSupport(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TTypefaceSupport& aTypefaceSupport); |
|
86 static TBool GetAlgStyleL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TAlgStyle*& aData); |
|
87 static TBool GetDrawableWindowL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, RDrawableWindow*& aData); |
|
88 static TBool GetDrawTextExtendedParamL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CGraphicsContext::TDrawTextExtendedParam*& aData); |
|
89 static TBool GetFbsBitmapL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CFbsBitmap*& aData); |
|
90 static TBool GetFbsDeviceL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CFbsDevice*& aData); |
|
91 static TBool GetFontL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CFont*& aData); |
|
92 static TBool GetPaletteL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CPalette*& aData); |
|
93 static TBool GetWsBitmapL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CWsBitmap*& aData); |
|
94 static TBool GetWsEventL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TWsEvent*& aData); |
|
95 static TBool GetWsGraphicMsgBufL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, RWsGraphicMsgBuf*& aData); |
|
96 static TBool GetWsScreenDeviceL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CWsScreenDevice*& aData); |
|
97 static TBool GetWsGraphicMsgFixedBaseL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TWsGraphicMsgFixedBase*& aData); |
|
98 static TBool GetWsPriorityKeyEventL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TWsPriorityKeyEvent*& aData); |
|
99 static TBool GetWsRedrawEventL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TWsRedrawEvent*& aData); |
|
100 static TBool GetTextCursor(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TTextCursor& aTextCursor); |
|
101 static TBool GetSpriteMemberL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TSpriteMember& aSpriteMember); |
|
102 static TBool GetSpriteMemberListL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CArrayFix<TSpriteMember>& aResult); |
|
103 static TBool BringAppForegroundL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aSessionKeyName , const TDesC& aAppKeyName); |
|
104 static TBool ReadTerminateReason(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, RDirectScreenAccess::TTerminationReasons& aReason); |
|
105 static void EatupMemory(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName); |
|
106 static void FreeEatenMemory(CDataWrapperBase& aDataWrapper); |
|
107 static TBool GetFrameInfo(CDataWrapperBase& aDataWrapper,const TDesC& aSectName, TFrameInfo& frameinfo); |
|
108 static TBool ReadFrameInfoFlags(CDataWrapperBase& aDataWrapper,const TDesC& aSectName, const TDesC& aKeyName,TUint32& aFlags); |
|
109 static TBool GetFrameInfoState(CDataWrapperBase& aDataWrapper,const TDesC& aSectName, const TDesC& aKeyName,TFrameInfo::TFrameInfoState& aState); |
|
110 static TBool GetWsGraphicAnimationL(CDataWrapperBase& aDataWrapper,const TDesC& aSectName, const TDesC& aKeyName, TWsGraphicAnimation*& aData); |
|
111 static TBool StartAnimTesterClientL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName); |
|
112 static TBool CloseAnimTesterClientL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName); |
|
113 static TBool GetFbsBitGcL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CFbsBitGc*& aData); |
|
114 static TBool GetTextParametersL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CGraphicsContext::TTextParameters* aParam); |
|
115 static TBool GetGraphicsOrientation(CDataWrapperBase& aDataWrapper,const TDesC& aSectName, const TDesC& aKeyName,CFbsBitGc::TGraphicsOrientation& aParam); |
|
116 static TBool GetLinkedTypefaceSpecificationL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CLinkedTypefaceSpecification*& aData); |
|
117 static TBool GetRasterizerL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, COpenFontRasterizer*& aData); |
|
118 static TBool GetShaperFactoryL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CShaperFactory*& aData); |
|
119 static TBool GetOpenFontGlyphDataL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TOpenFontGlyphData*& aData); |
|
120 private: |
|
121 static TBool ConvertToCaptureFlags(const TDesC& aStr, RWindowBase::TCaptureFlags& aCaptureFlags); |
|
122 static TBool ConvertToCaptureFlags(const TDesC& aStr, TUint& aCaptureFlags); |
|
123 |
|
124 static TBool ConvertToEventModifier(const TDesC& aStr, TEventModifier& aEventModifier); |
|
125 static TBool ConvertToEventModifier(const TDesC& aStr, TUint& aEventModifier); |
|
126 |
|
127 static TBool ConvertToPointerFilter(const TDesC& aStr, TPointerFilter& aPointerFilter); |
|
128 static TBool ConvertToPointerFilter(const TDesC& aStr, TUint& aPointerFilter); |
|
129 |
|
130 static TBool ConvertToSpriteInCompare(const TDesC& aStr, TUint& aSpriteInCompare); |
|
131 |
|
132 static TBool ConvertToWindowBackupType(const TDesC& aStr, TWindowBackupType& aWindowBackupType); |
|
133 static TBool ConvertToWindowBackupType(const TDesC& aStr, TUint& aWindowBackupType); |
|
134 |
|
135 static TBool ConvertToWsVisibilityChangedEvent(const TDesC& aStr, TUint& aWsVisibilityChangedEvent); |
|
136 |
|
137 static TBool ConvertToSpriteFlags(const TDesC& aStr, TSpriteFlags& aSpriteFlags); |
|
138 static TBool ConvertToSpriteFlags(const TDesC& aStr, TUint& aSpriteFlags); |
|
139 static TBool ConvertToFrameInfoFlags(const TDesC& aStr,TUint32& aFrameInfoFlags); |
|
140 private: |
|
141 |
|
142 static TInt iAvaiableSpace; |
|
143 static TInt iBiggestBlock; |
|
144 static RPointerArray < TAny > iMemArray; |
|
145 }; |
|
146 |
|
147 #endif /* __T_GRAPHICS_UTIL_H__ */ |
|