1 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 1999-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
52 TInt WriteReplyWs(const TAny *pData, TInt length, const TAny *pData2, TInt length2, TUint opcode); |
52 TInt WriteReplyWs(const TAny *pData, TInt length, const TAny *pData2, TInt length2, TUint opcode); |
53 void SetBufferSizeL(TInt aBufSize); |
53 void SetBufferSizeL(TInt aBufSize); |
54 void SetMaxBufferSizeL(TInt aMaxBufSize); |
54 void SetMaxBufferSizeL(TInt aMaxBufSize); |
55 TInt Flush(const TIpcArgs* aIpcArgs=NULL,TBool aRequestFinish=EFalse); |
55 TInt Flush(const TIpcArgs* aIpcArgs=NULL,TBool aRequestFinish=EFalse); |
56 TBool SetAutoFlush(TBool aState); |
56 TBool SetAutoFlush(TBool aState); |
57 void Write(TInt handle,TUint opcode,const TAny *pData, TInt length,const TAny *pData2, TInt length2); |
57 void Write(TInt aHandle, TUint aOpcode, const TAny *aData, TInt aLength, const TAny *aData2, TInt aLength2, const TIpcArgs* aIpcArgs=NULL); |
58 void Write(TInt handle,TUint opcode,const TAny *buf, TInt bufLen); |
58 void Write(TInt aHandle, TUint aOpcode, const TAny *aData, TInt aLength, const TIpcArgs* aIpcArgs=NULL); |
59 void Write(TInt handle,TUint opcode); |
59 void Write(TInt handle,TUint opcode); |
|
60 void AppendData(const TAny *aData, TInt aLength, TBool aFinished); |
60 TInt WriteReply(TInt handle,TUint opcode, const TIpcArgs* aIpcArgs=NULL); |
61 TInt WriteReply(TInt handle,TUint opcode, const TIpcArgs* aIpcArgs=NULL); |
61 TInt WriteReply(TInt handle,TUint opcode,const TAny *buf, TInt bufLen, const TIpcArgs* aIpcArgs=NULL); |
62 TInt WriteReply(TInt handle,TUint opcode,const TAny *buf, TInt bufLen, const TIpcArgs* aIpcArgs=NULL); |
62 TInt WriteReply(TInt handle,TUint opcode,const TAny *buf, TInt bufLen,const TAny *buf2, TInt buflen2, const TIpcArgs* aIpcArgs=NULL); |
63 TInt WriteReply(TInt handle,TUint opcode,const TAny *buf, TInt bufLen,const TAny *buf2, TInt buflen2, const TIpcArgs* aIpcArgs=NULL); |
63 TInt WriteReplyP(TInt aHandle,TUint aOpcode,const TWriteDescriptorType& aReplyBuffer); |
64 TInt WriteReplyP(TInt aHandle,TUint aOpcode,const TWriteDescriptorType& aReplyBuffer); |
64 TInt WriteReplyP(TInt aHandle,TUint aOpcode,const TAny *aData,TInt aLength,const TWriteDescriptorType& aReplyBuffer); |
65 TInt WriteReplyP(TInt aHandle,TUint aOpcode,const TAny *aData,TInt aLength,const TWriteDescriptorType& aReplyBuffer); |
82 inline TBool WindowSizeCacheEnabled() const; |
83 inline TBool WindowSizeCacheEnabled() const; |
83 inline void MarkWindowSizeCacheDirty(TInt aHandle); |
84 inline void MarkWindowSizeCacheDirty(TInt aHandle); |
84 inline void RefreshWindowSizeCache(TInt aHandle, const TSize& aNewSize); |
85 inline void RefreshWindowSizeCache(TInt aHandle, const TSize& aNewSize); |
85 inline TInt CachedWindowSize(TInt aHandle, TSize& aSize); |
86 inline TInt CachedWindowSize(TInt aHandle, TSize& aSize); |
86 inline void DestroyWindowSizeCacheEntry(TInt aHandle); |
87 inline void DestroyWindowSizeCacheEntry(TInt aHandle); |
87 #ifdef SYMBIAN_GRAPHICS_FIXNATIVEORIENTATION |
|
88 void EnableWindowNativeSizeCacheL(); |
|
89 inline TBool WindowNativeSizeCacheEnabled() const; |
|
90 inline TInt SetWindowNativeSize(TInt aHandle, const TSize& aNativeSize); |
|
91 inline TInt WindowNativeSize(TInt aHandle, TSize& aSize); |
|
92 inline void DestroyWindowNativeSizeCacheEntry(TInt aHandle); |
|
93 #endif // SYMBIAN_GRAPHICS_FIXNATIVEORIENTATION |
|
94 |
88 |
95 private: |
89 private: |
96 TInt DoWrite(TInt aHandle, TUint aOpcode, TBool aFlush, const TIpcArgs* aIpcArgs, const TAny* aData1=NULL, TInt aLength1=0, const TAny* aData2=NULL, TInt aLength2=0); |
90 TInt DoWrite(TInt aHandle, TUint aOpcode, TBool aFlush, const TIpcArgs* aIpcArgs, const TAny* aData1=NULL, TInt aLength1=0, const TAny* aData2=NULL, TInt aLength2=0); |
97 inline void SetAndLimitMaxBufSize(TInt aMaxBufSize); |
91 inline void SetAndLimitMaxBufSize(TInt aMaxBufSize); |
98 void ReAllocBufferL(TInt aNewSize); |
92 void ReAllocBufferL(TInt aNewSize); |
106 TPtr8 iBuf; |
100 TPtr8 iBuf; |
107 RWsBuffer *iNext; |
101 RWsBuffer *iNext; |
108 TInt iPreviousHandle; |
102 TInt iPreviousHandle; |
109 TInt iBufSize; // current buffer size, DoWrite can expand this up to iMaxBufize |
103 TInt iBufSize; // current buffer size, DoWrite can expand this up to iMaxBufize |
110 TInt iMaxBufSize; // maximum buffer size, set by SetBufferSizeL or SetMaxBufferSizeL |
104 TInt iMaxBufSize; // maximum buffer size, set by SetBufferSizeL or SetMaxBufferSizeL |
|
105 #if defined(_DEBUG) |
|
106 TInt iAppendDataLength; |
|
107 #endif |
111 private: //Added here as adding it to RWsSession breaks BC. |
108 private: //Added here as adding it to RWsSession breaks BC. |
112 TInt iDirectAcessCount; |
109 TInt iDirectAcessCount; |
113 RArray<TInt> iBitmapArray; |
110 RArray<TInt> iBitmapArray; |
114 TBool iInvalidBitmapArray; |
111 TBool iInvalidBitmapArray; |
115 |
112 |
193 // If there is a window size cache entry, then err == KErrNone. |
187 // If there is a window size cache entry, then err == KErrNone. |
194 // Otherwise, there isn't a size cache entry, and err == KErrNotFound. |
188 // Otherwise, there isn't a size cache entry, and err == KErrNotFound. |
195 __ASSERT_DEBUG(err == KErrNone || err == KErrNotFound, Assert(EW32AssertWindowSizeCacheFailure)); |
189 __ASSERT_DEBUG(err == KErrNone || err == KErrNotFound, Assert(EW32AssertWindowSizeCacheFailure)); |
196 } |
190 } |
197 |
191 |
198 #ifdef SYMBIAN_GRAPHICS_FIXNATIVEORIENTATION |
|
199 inline TBool RWsBuffer::WindowNativeSizeCacheEnabled() const |
|
200 { |
|
201 return iWindowNativeSizeCache ? ETrue : EFalse; |
|
202 } |
|
203 |
|
204 inline TInt RWsBuffer::SetWindowNativeSize(TInt aHandle, const TSize& aNativeSize) |
|
205 { |
|
206 __ASSERT_ALWAYS(iWindowNativeSizeCache != NULL, Assert(EW32AssertWindowNativeSizeCacheFailure)); |
|
207 RWsBuffer::TWindowSizeCacheEntry* entry = iWindowNativeSizeCache->Find(aHandle); |
|
208 __ASSERT_ALWAYS(!entry, Assert(EW32AssertWindowNativeSizeCacheFailure)); |
|
209 return iWindowNativeSizeCache->Insert(aHandle, RWsBuffer::TWindowSizeCacheEntry(aNativeSize)); |
|
210 } |
|
211 |
|
212 inline TInt RWsBuffer::WindowNativeSize(TInt aHandle, TSize& aSize) |
|
213 { |
|
214 __ASSERT_ALWAYS(iWindowNativeSizeCache != NULL, Assert(EW32AssertWindowNativeSizeCacheFailure)); |
|
215 RWsBuffer::TWindowSizeCacheEntry* entry = iWindowNativeSizeCache->Find(aHandle); |
|
216 if (entry) |
|
217 { |
|
218 aSize = entry->iSize; |
|
219 return KErrNone; |
|
220 } |
|
221 else |
|
222 { |
|
223 return KErrNotFound; |
|
224 } |
|
225 } |
|
226 |
|
227 inline void RWsBuffer::DestroyWindowNativeSizeCacheEntry(TInt aHandle) |
|
228 { |
|
229 __ASSERT_ALWAYS(iWindowNativeSizeCache != NULL, Assert(EW32AssertWindowNativeSizeCacheFailure)); |
|
230 TInt err = iWindowNativeSizeCache->Remove(aHandle); |
|
231 // If there is a window size cache entry, then err == KErrNone. |
|
232 // Otherwise, there isn't a size cache entry, and err == KErrNotFound. |
|
233 __ASSERT_DEBUG(err == KErrNone || err == KErrNotFound, Assert(EW32AssertWindowNativeSizeCacheFailure)); |
|
234 } |
|
235 |
|
236 #endif // SYMBIAN_GRAPHICS_FIXNATIVEORIENTATION |
|
237 |
|
238 |
192 |
239 #endif |
193 #endif |