|
1 /* |
|
2 * Copyright (c) 2006 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: TFX server definitions. Contains various names and numbers |
|
15 * used in the server. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef _SERVERDEF_H_ |
|
21 #define _SERVERDEF_H_ |
|
22 |
|
23 #include <e32base.h> |
|
24 |
|
25 _LIT(KTfxServerName,"TfxServer"); |
|
26 _LIT(KTfxServerImageName, "TfxServer"); |
|
27 _LIT(KAnyName, "*"); |
|
28 |
|
29 /** transition server version numbers */ |
|
30 const TInt KTfxServerMajorVN = 0; |
|
31 const TInt KTfxServerMinorVN = 6; |
|
32 const TInt KTfxServerBuildVN = 0; |
|
33 |
|
34 /** transition server uid */ |
|
35 const TUid KTfxServerUid = { 0x10281F7D }; |
|
36 |
|
37 /** RProperty value for server status */ |
|
38 const TUint KTfxServerStatus = 0x10281F7D; |
|
39 |
|
40 /** transition server stack size */ |
|
41 const TInt KTfxServerStackSize = KDefaultStackSize; |
|
42 /** transition server minimum heap size */ |
|
43 const TInt KTfxServerHeapMinSize = 64*1024; //64KB |
|
44 /** transition server maximum heap size */ |
|
45 const TInt KTfxServerHeapMaxSize = 4*1024*1024; //4MB |
|
46 |
|
47 /** The time between start of frames the engine will try to keep, in ms. (1000/fps) */ |
|
48 const TInt KDefaultWantedTime = 67; |
|
49 /** The minimum time between end of a frame to start of next frame allowed, in ms |
|
50 increase this to give more time to other threads. |
|
51 A high number will decrease framerate on complex scenes. */ |
|
52 const TInt KDefaultMinTime = 22; |
|
53 |
|
54 /* |
|
55 default values for cache size |
|
56 see TCacheSizeProperties for comments |
|
57 */ |
|
58 const TInt KDefaultMaxBytesOngoing = 1024*1024; // 1MB |
|
59 const TInt KDefaultMaxBytesBetween = 0; // |
|
60 |
|
61 /* |
|
62 The maximum cache size between effects |
|
63 if the phone is low on ram |
|
64 */ |
|
65 const TInt KLowMemoryMaxBytesBetween = 0; |
|
66 |
|
67 /** priority of repository handler. Has to be higher then message loop to ensure repository changes are heeded */ |
|
68 const TInt KTfxServerRepositoryHandler = 110; |
|
69 /** priority of CServer2 object. only repository handler is higher. */ |
|
70 const TInt KTfxServerMessageLoopPrio = 100; |
|
71 /** priority of frame timer. needs to be kept high, but lower then message loop */ |
|
72 const TInt KTfxServerFrameTimerPrio = 80; |
|
73 /** priority of the requesthandler. needs to be higher then the frame timer, but lower then message loop */ |
|
74 const TInt KTfxServerRequestHandlerPrio = 90; |
|
75 |
|
76 /** microseconds to wait after InitControltransition before assuming client has failed */ |
|
77 const TInt KStartControlTransitionTimeout = 2000000; //2s |
|
78 |
|
79 /** Window Server Secure ID */ |
|
80 const TInt KWServSID = 268450592; |
|
81 |
|
82 /** Nokia VID: = VID_DEFAULT */ |
|
83 const TInt KNokiaVID = 0x101FB657; |
|
84 |
|
85 /** Ranges for TFX messages */ |
|
86 const TInt KTfxRanges[] = |
|
87 { |
|
88 0, //range is 0-10 inclusive |
|
89 10, //range is 11-254 inclusive |
|
90 255 // message 255 (shutdown) |
|
91 }; |
|
92 |
|
93 /** Element Indexes for PolicyElement */ |
|
94 const TUint8 KTfxElementsIndex[] = |
|
95 { |
|
96 0, |
|
97 CPolicyServer::EAlwaysPass, |
|
98 1 |
|
99 }; |
|
100 |
|
101 /** Policy Elements */ |
|
102 const CPolicyServer::TPolicyElement KTfxElements[] = |
|
103 { |
|
104 {_INIT_SECURITY_POLICY_S0(KWServSID), CPolicyServer::EFailClient}, |
|
105 {_INIT_SECURITY_POLICY_V0(KNokiaVID), CPolicyServer::EFailClient} |
|
106 }; |
|
107 |
|
108 /** Policy definition */ |
|
109 const CPolicyServer::TPolicy KTfxPolicy = |
|
110 { |
|
111 CPolicyServer::EAlwaysPass, //specifies all connect attempts should pass |
|
112 sizeof(KTfxRanges) / sizeof(TInt), |
|
113 KTfxRanges, |
|
114 KTfxElementsIndex, |
|
115 KTfxElements, |
|
116 }; |
|
117 |
|
118 /** opcodes used in message passing between client and server */ |
|
119 enum TTfxServerServRqst |
|
120 { |
|
121 //Wserv only: |
|
122 ETfxServerOpRegisterControlDrawer, //0 |
|
123 ETfxServerOpDeregisterControlDrawer, |
|
124 //Wserv only: |
|
125 ETfxServerOpStartTransition, |
|
126 ETfxServerOpFullscreenBegin, |
|
127 ETfxServerOpFullscreenEnd, |
|
128 //Wserv only: |
|
129 ETfxServerOpDSABegin, //5 |
|
130 ETfxServerOpDSAEnd, |
|
131 //Wserv only: |
|
132 ETfxServerOpFailedControlTransition, |
|
133 //Wserv only: |
|
134 ETfxServerOpReqUnredirEvent, |
|
135 ETfxServerOpCancelUnredirEvent, |
|
136 //Any thread: |
|
137 ETfxServerOpSendStartTick, //10 |
|
138 ETfxServerOpRequestFinishedEvent, |
|
139 //Any thread: |
|
140 ETfxServerOpFullscreenAbort, |
|
141 ETfxServerOpControlPolicyUpdate, |
|
142 ETfxServerOpBeginGroup, |
|
143 ETfxServerOpEndGroup, //15 |
|
144 ETfxServerOpAddFullscreenKML, |
|
145 ETfxServerOpRemoveFullscreenKML, |
|
146 ETfxServerOpControlPolicyRemove, |
|
147 ETfxServerOpControlPolicyGet, //20 |
|
148 ETfxServerOpControlPolicyRequest, |
|
149 ETfxServerOpBlockFullscreenUid, |
|
150 ETfxServerOpRegisterControlKml, |
|
151 ETfxServerOpRemoveControlKml, |
|
152 ETfxServerOpControlCancelPolicyUpdate, //25 |
|
153 //Any thread: |
|
154 ETfxServerOpSetWantedTime, |
|
155 ETfxServerOpSetMinTime, |
|
156 ETfxServerVerifyConnection, |
|
157 ETfxServerOpAddFullscreenKMLEx, |
|
158 //Any thread: |
|
159 ETfxServerOpDumpClients, //30 |
|
160 //Any thread: |
|
161 ETfxServerOpHandover, |
|
162 ETfxServerOpUpdateLiveBuffer, |
|
163 ETfxServerOpControlTransitionAbort, |
|
164 ETfxServerOpRemoveAllKml, |
|
165 ETfxServerOpFreeRam, |
|
166 ETfxServerOpMemoryGood, //36 |
|
167 ETfxServerOpRegisterControlKmlEx, |
|
168 ETfxServerOpControlSetFrameTime, |
|
169 ETfxServerOpControlSetMinFrameTime, |
|
170 // ListBox opcodes |
|
171 ETfxServerOpListBoxStart = 100, |
|
172 ETfxServerOpListBoxRegister, |
|
173 ETfxServerOpListBoxMakeMove, |
|
174 ETfxServerOpListBoxGetObsoleteItems, |
|
175 ETfxServerOpListBoxRequestFrame, |
|
176 ETfxServerOpListBoxGetDirtyRect, |
|
177 ETfxServerOpListBoxInvalidate, |
|
178 ETfxServerOpListBoxSetFrameTime, |
|
179 ETfxServerOpListBoxSetMinFrameTime, |
|
180 ETfxServerOpListBoxDeregister, |
|
181 ETfxServerOpListBoxVerifyKML, |
|
182 ETfxServerOpListBoxSetBorderDims, |
|
183 ETfxServerOpListBoxRegisterKML, |
|
184 ETfxServerOpListBoxUnregisterKML, |
|
185 ETfxServerOpListBoxInPosition, |
|
186 ETfxServerOpListBoxSetDrawing, |
|
187 #ifdef RD_UI_TRANSITION_EFFECTS_TOUCH_P2 |
|
188 ETfxServerOpListBoxLongTapStart, |
|
189 ETfxServerOpListBoxLongTapEnd, |
|
190 #endif |
|
191 |
|
192 ETfxServerOpListBoxEnd, |
|
193 // Shutdown |
|
194 ETfxServerOpShutdown = 255 |
|
195 }; |
|
196 |
|
197 enum TTfxServPanic |
|
198 { |
|
199 EAlreadyRegistered, |
|
200 ENotRegistered |
|
201 }; |
|
202 |
|
203 /** |
|
204 * This is a utility class that retrieves the name and version number |
|
205 * of the tfxserver. |
|
206 */ |
|
207 class KSCliDefinitions |
|
208 { |
|
209 public: |
|
210 static const TDesC& ServerAndThreadName(); |
|
211 static const TDesC& ServerImageName(); |
|
212 static TUidType ServerUidType(); |
|
213 static TVersion Version(); |
|
214 }; |
|
215 |
|
216 /** |
|
217 * Holds animation and cache priority information of a fullscreen transition |
|
218 */ |
|
219 class TFullscreenInfo |
|
220 { |
|
221 public: |
|
222 TFullscreenInfo(); |
|
223 TFullscreenInfo(TInt aActionId, TInt aCachePriority, TInt aWantedTime, TInt aMinTime); |
|
224 TInt iActionId; |
|
225 TInt iCachePriority; |
|
226 TInt iWantedTime; |
|
227 TInt iMinTime; |
|
228 }; |
|
229 |
|
230 /** |
|
231 * Holds cache size properties |
|
232 */ |
|
233 class TCacheSizeProperties |
|
234 { |
|
235 public: |
|
236 /* |
|
237 Maximum amount of bytes that may be cached while a transition |
|
238 is ongoing. If this value is less than the total size of the |
|
239 decoded images in the effect the images has to be decoded every |
|
240 frame which will have a huge impact on performance. |
|
241 Default is KDefaultMaxBytesOngoing |
|
242 */ |
|
243 TInt32 iMaxBytesOngoing; |
|
244 /* |
|
245 Maximum amount of bytes that may be cached when a transition |
|
246 is not ongoing. |
|
247 Default is KDefaultMaxBytesBetween. |
|
248 */ |
|
249 TInt32 iMaxBytesBetween; |
|
250 }; |
|
251 |
|
252 struct TParticipantInfo |
|
253 { |
|
254 TPoint iTl; |
|
255 TInt iBitmapHandle; |
|
256 TUint32 iId; |
|
257 }; |
|
258 |
|
259 struct TWantedTimes |
|
260 { |
|
261 TInt32 iWantedTime : 16; |
|
262 TInt32 iMinTime : 16; |
|
263 }; |
|
264 |
|
265 union TWantedTimesPacked |
|
266 { |
|
267 struct TWantedTimes times; |
|
268 TInt32 packed; |
|
269 }; |
|
270 |
|
271 const TUint KMaxDirtyRegions = 5; |
|
272 |
|
273 /** |
|
274 * The time between start of frames the engine will try to keep, |
|
275 * in microseconds. |
|
276 */ |
|
277 const TInt KDefaultListBoxWantedTime = 33; |
|
278 |
|
279 /** |
|
280 * The minimum time between end of a frame to start of next frame allowed, |
|
281 * in microseconds. |
|
282 * Increase this to give more time to other threads. |
|
283 * A high number will decrease framerate on complex scenes. |
|
284 */ |
|
285 const TInt KDefaultListBoxMinTime = 10; |
|
286 |
|
287 _LIT( KTfxListBoxMutexName, "TfxListBox%d" ); |
|
288 |
|
289 #endif |