sl@0: // Copyright (c) 1995-2010 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #include sl@0: #include "fbsdefs.h" sl@0: #include "UTILS.H" sl@0: #include "FBSVER.H" sl@0: #include "FbsRalc.h" sl@0: #include "fbshelper.h" sl@0: #include "FbsMessage.H" sl@0: #include sl@0: #include "OstTraceDefinitions.h" sl@0: #include "fbstrace.h" sl@0: #ifdef OST_TRACE_COMPILER_IN_USE sl@0: #include "SESSIONTraces.h" sl@0: #endif sl@0: sl@0: GLDEF_C void Panic(TFbsPanic aPanic) sl@0: { sl@0: _LIT(KFBSERVClientPanicCategory,"FBSCLI"); sl@0: User::Panic(KFBSERVClientPanicCategory,aPanic); sl@0: } sl@0: sl@0: EXPORT_C TInt FbsStartup() sl@0: { sl@0: RChunk sharedchunk; sl@0: TInt ret = sharedchunk.OpenGlobal(KFBSERVSharedChunkName,EFalse); sl@0: if (ret == KErrNone) sl@0: { sl@0: sharedchunk.Close(); sl@0: return KErrNone; sl@0: } sl@0: sl@0: RProcess fbs; sl@0: _LIT(KFBSERVServerExe,"z:\\sys\\bin\\fbserv.exe"); sl@0: ret = fbs.Create(KFBSERVServerExe,KNullDesC); sl@0: sl@0: if (ret!=KErrNone) sl@0: return ret; sl@0: sl@0: sl@0: TRequestStatus stat; sl@0: fbs.Rendezvous(stat); sl@0: if (stat!=KRequestPending) sl@0: fbs.Kill(0); // abort startup sl@0: else sl@0: fbs.Resume(); // logon OK - start the server sl@0: User::WaitForRequest(stat); // wait for start or death sl@0: // we can't use the 'exit reason' if the server panicked as this sl@0: // is the panic 'reason' and may be '0' which cannot be distinguished sl@0: // from KErrNone sl@0: ret=(fbs.ExitType()==EExitPanic) ? KErrGeneral : stat.Int(); sl@0: fbs.Close(); sl@0: return ret; sl@0: } sl@0: sl@0: sl@0: // sl@0: // Fontbitmap server client side session sl@0: // sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: EXPORT_C RFbsSession::RFbsSession(): sl@0: RSessionBase(), sl@0: iConnections(0), sl@0: iCallBack(), sl@0: iSharedChunk(), sl@0: iHelper(NULL), sl@0: iRomFileAddrCache(NULL), sl@0: iDecompressionBuffer(NULL), sl@0: iScanLineBuffer(NULL), sl@0: iSpare(NULL) sl@0: {} sl@0: sl@0: /** Creates a session with the Font and Bitmap server. sl@0: @param aFileServer A fuly constructed file server session sl@0: @return KErrNone, if successful; KErrNoMemory if there is not enough memory sl@0: to create the session; otherwise another of the system-wide error codes. sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: EXPORT_C TInt RFbsSession::Connect(RFs& aFileServer) sl@0: { sl@0: TInt ret = KErrNone; sl@0: RFbsSession* thisptr = (RFbsSession*)Dll::Tls(); sl@0: FBS_OST(OstTrace1(GRAPHICS_CONTROL_FUNCTIONS, RFBSSESSION_CONNECT_ENTRY, "> this=0x%08x;", (TUint)thisptr);) sl@0: if(thisptr) sl@0: { sl@0: thisptr->iConnections++; sl@0: FBS_OST(OstTraceExt2(GRAPHICS_CONTROL_SEMANTICS, RFBSSESSION_CONNECT_INFO, "# Connected to existing session; this=0x%08x; iConnections=%d;", (TInt)thisptr, thisptr->iConnections);) sl@0: } sl@0: else sl@0: { sl@0: ret = RFbsSession::DoAlloc(thisptr); sl@0: if(ret!=KErrNone) sl@0: { sl@0: FBS_OST(OstTrace1(TRACE_ERROR, RFBSSESSION_CONNECT_ERROR, "! DoAlloc returned %d", ret);) sl@0: } sl@0: else sl@0: { sl@0: ret = thisptr->DoConnect(aFileServer); sl@0: if(ret!=KErrNone) sl@0: { sl@0: FBS_OST(OstTraceExt2(TRACE_ERROR, RFBSSESSION_CONNECT_ERROR2, "! this=0x%08x; DoConnect returned %d", (TInt)thisptr, ret);) sl@0: } sl@0: } sl@0: } sl@0: sl@0: FBS_OST(OstTraceExt2(GRAPHICS_CONTROL_FUNCTIONS, RFBSSESSION_CONNECT_EXIT, "< this=0x%08x; ret=%d", (TUint)thisptr, ret);) sl@0: return ret; sl@0: } sl@0: sl@0: /** Creates a session with the Font and Bitmap server. sl@0: @return KErrNone, if successful; KErrNoMemory if there is not enough memory sl@0: to create the session; otherwise another of the system-wide error codes. sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: EXPORT_C TInt RFbsSession::Connect() sl@0: { sl@0: TInt ret = KErrNone; sl@0: RFbsSession* thisptr = (RFbsSession*)Dll::Tls(); sl@0: FBS_OST(OstTrace1(GRAPHICS_CONTROL_FUNCTIONS, RFBSSESSION_CONNECT2_ENTRY, "> this=0x%08x;", (TUint)thisptr);) sl@0: if(thisptr) sl@0: { sl@0: thisptr->iConnections++; sl@0: FBS_OST(OstTraceExt2(GRAPHICS_CONTROL_SEMANTICS, RFBSSESSION_CONNECT2_INFO, "# Connected to existing session; this=0x%08x; iConnections=%d;", (TInt)thisptr, thisptr->iConnections);) sl@0: } sl@0: else sl@0: { sl@0: TInt ret = RFbsSession::DoAlloc(thisptr); sl@0: if (ret!=KErrNone) sl@0: { sl@0: FBS_OST(OstTrace1(TRACE_ERROR, RFBSSESSION_CONNECT2_ERROR, "! DoAlloc returned %d", ret);) sl@0: goto end; sl@0: } sl@0: sl@0: ret = thisptr->iFileServer.Connect(); sl@0: if(ret!=KErrNone) sl@0: { sl@0: thisptr->Disconnect(); sl@0: FBS_OST(OstTraceExt2(TRACE_ERROR, RFBSSESSION_CONNECT2_ERROR2, "! this=0x%08x; RFs::Connect() returned %d", (TInt)thisptr, ret);) sl@0: goto end; sl@0: } sl@0: sl@0: ret = thisptr->DoConnect(thisptr->iFileServer); sl@0: if(ret!=KErrNone) sl@0: { sl@0: FBS_OST(OstTraceExt2(TRACE_ERROR, RFBSSESSION_CONNECT2_ERROR3, "! this=0x%08x; DoConnect returned %d", (TInt)thisptr, ret);) sl@0: } sl@0: } sl@0: end: sl@0: FBS_OST(OstTraceExt2(GRAPHICS_CONTROL_FUNCTIONS, RFBSSESSION_CONNECT2_EXIT, "< this=0x%08x; ret=%d", (TUint)thisptr, ret);) sl@0: return ret; sl@0: } sl@0: sl@0: /** Closes the session with the Font and Bitmap server. sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: EXPORT_C void RFbsSession::Disconnect() sl@0: { sl@0: RFbsSession* thisptr=(RFbsSession*)Dll::Tls(); sl@0: FBS_OST(OstTrace1(GRAPHICS_CONTROL_FUNCTIONS, RFBSSESSION_DISCONNECT_ENTRY, "> this=0x%08x;", (TUint)thisptr);) sl@0: if(thisptr) sl@0: { sl@0: TInt tempServerSessionHandle = thisptr->ServerSessionHandle(); sl@0: if(thisptr->iConnections>0) sl@0: { sl@0: thisptr->iCallBack.iPtr=NULL; sl@0: thisptr->iCallBack.CallBack(); sl@0: // Destructor of CFbsSessionHelper may call SendCommand to cancel an sl@0: // outstanding request, therefore destruction must be done before sl@0: // iConnections is 0 to avoid an assertion going off. sl@0: if(thisptr->iConnections==1) sl@0: { sl@0: delete thisptr->iHelper; sl@0: } sl@0: thisptr->iConnections--; sl@0: } sl@0: if(thisptr->iConnections==0) sl@0: { sl@0: thisptr->iSharedChunk.Close(); sl@0: thisptr->iLargeBitmapChunk.Close(); sl@0: // Call close on the iFileServer regardless of whether this session owns it: sl@0: // if we don't own it, close will do nothing if there are still open files, sl@0: // so always calling close introduces extra safety sl@0: thisptr->iFileServer.Close(); sl@0: delete thisptr->iRomFileAddrCache; sl@0: delete thisptr->iScanLineBuffer; sl@0: delete thisptr->iDecompressionBuffer; sl@0: thisptr->Close(); sl@0: delete thisptr; sl@0: Dll::FreeTls(); sl@0: } sl@0: FBS_OST(OstTraceExt3(GRAPHICS_CONTROL_SEMANTICS, RFBSSESSION_DISCONNECT_INFO, "# Disconnected from session; this=0x%08x; iConnections=%d; iSSH=0x%08x", (TInt)thisptr, thisptr->iConnections, tempServerSessionHandle);) sl@0: } sl@0: FBS_OST(OstTrace1(GRAPHICS_CONTROL_FUNCTIONS, RFBSSESSION_DISCONNECT_EXIT2, "< this=0x%08x;", (TUint)thisptr);) sl@0: } sl@0: sl@0: /** Gets the current Font and Bitmap server session. sl@0: @return A pointer to the current session or NULL if Connect() has not been sl@0: called yet. sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: EXPORT_C RFbsSession* RFbsSession::GetSession() sl@0: { sl@0: return((RFbsSession*)Dll::Tls()); sl@0: } sl@0: sl@0: /** Triggers the most recently registered callback. This is mainly called by sl@0: bitmaps when their twips size changes and when any FBSERV objects are closed sl@0: to notify clients of a change that may affect their operation. sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: EXPORT_C void RFbsSession::CallBack() sl@0: { sl@0: iCallBack.CallBack(); sl@0: iCallBack.iPtr=NULL; sl@0: } sl@0: sl@0: void RFbsSession::SetCallBackPtr(TInt* aBitmapHandle)const sl@0: { sl@0: iCallBack.iPtr=aBitmapHandle; sl@0: } sl@0: sl@0: /** Sets the callback. sl@0: @param aCallBack callback object to be called by CallBack(). Only one may be sl@0: in use at a time and subsequent calls will displace previous calls. sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: EXPORT_C void RFbsSession::SetCallBack(TCallBack aCallBack) sl@0: { sl@0: iCallBack=aCallBack; sl@0: } sl@0: sl@0: /** Resets the callback. sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: EXPORT_C void RFbsSession::ResetCallBack() sl@0: { sl@0: TCallBack cb(NULL); sl@0: iCallBack=cb; sl@0: } sl@0: sl@0: /** Returns the number of Font and Bitmap Server objects currently in sl@0: use by this session. sl@0: @return The number of resources in use: bitmaps, fonts, typeface stores. sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: EXPORT_C TInt RFbsSession::ResourceCount() sl@0: { sl@0: return(SendCommand(EFbsMessResourceCount)); sl@0: } sl@0: sl@0: /** Utility function for passing commands to the server. sl@0: @param aMessage Integer code for the message to pass - see TFbsMessage. sl@0: @param aInt0 Parameter 0 for the message. sl@0: @param aInt1 Parameter 1 for the message. sl@0: @param aInt2 Parameter 2 for the message. sl@0: @param aInt3 Parameter 3 for the message. sl@0: @return Return code from RSessionBase::SendReceive(). sl@0: @internalComponent sl@0: */ sl@0: EXPORT_C TInt RFbsSession::SendCommand(TInt aMessage,TInt aInt0,TInt aInt1,TInt aInt2,TInt aInt3) const sl@0: { sl@0: __ASSERT_ALWAYS(iConnections>0,Panic(EFbsPanicBadConnection)); sl@0: sl@0: switch(aMessage) sl@0: { sl@0: case EFbsMessShutdown: sl@0: case EFbsMessClose: sl@0: SetCallBackPtr(aMessage==EFbsMessClose ? &aInt1 : 0); sl@0: iCallBack.CallBack(); sl@0: default: sl@0: break; sl@0: } sl@0: sl@0: TInt ret = SendReceive(aMessage, TIpcArgs(aInt0,aInt1,aInt2,aInt3)); sl@0: sl@0: return(ret); sl@0: } sl@0: sl@0: TInt RFbsSession::SendCommand(TInt aMessage, const TIpcArgs& aArgs) const sl@0: { sl@0: __ASSERT_ALWAYS(iConnections>0,Panic(EFbsPanicBadConnection)); sl@0: return SendReceive(aMessage,aArgs); sl@0: } sl@0: sl@0: void RFbsSession::SendCommand(TInt aMessage, const TIpcArgs& aArgs, TRequestStatus &aStatus) const sl@0: { sl@0: __ASSERT_ALWAYS(iConnections>0,Panic(EFbsPanicBadConnection)); sl@0: SendReceive(aMessage,aArgs,aStatus); sl@0: } sl@0: sl@0: /** Gets the current Font and Bitmap server version. sl@0: @return The current version of the server. sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: EXPORT_C TVersion RFbsSession::Version() sl@0: { sl@0: TVersion v(KFbsMajorVersionNumber,KFbsMinorVersionNumber,KFbsBuildVersionNumber); sl@0: return(v); sl@0: } sl@0: sl@0: /** Gets the address of first location in the global shared heap containing sl@0: fonts and bitmaps. sl@0: @return Pointer to the base of the shared heap. sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: EXPORT_C TUint8* RFbsSession::HeapBase() const sl@0: { sl@0: return(iSharedChunk.Base()); sl@0: } sl@0: sl@0: TBool RFbsSession::LookupBitmapInROM(const TDesC& aFilename, TAny*& aAddr) sl@0: { sl@0: aAddr = iRomFileAddrCache->Lookup(aFilename); sl@0: if (aAddr) sl@0: return ETrue; sl@0: return EFalse; sl@0: } sl@0: sl@0: TInt RFbsSession::DoAlloc(RFbsSession*& aNewSession) sl@0: { sl@0: aNewSession = (RFbsSession*)User::Alloc(sizeof(RFbsSession)); sl@0: if(!aNewSession) sl@0: return KErrNoMemory; sl@0: new(aNewSession) RFbsSession; sl@0: aNewSession->iConnections = 1; sl@0: TInt ret = Dll::SetTls(aNewSession); sl@0: if(ret!=KErrNone) sl@0: { sl@0: delete aNewSession; sl@0: aNewSession = NULL; sl@0: } sl@0: return ret; sl@0: } sl@0: sl@0: /** sl@0: Do actual connect as common to both Connect() and Connect(RFs& aFileServer). Store fully constructed sl@0: file server session to iSpare member variable sl@0: @see Connect() sl@0: @return KErrNone, if successful; KErrNoMemory if there is not enough memory sl@0: to create the session; otherwise another of the system-wide error codes. sl@0: @internalComponent sl@0: */ sl@0: TInt RFbsSession::DoConnect(RFs& aFileServer) sl@0: { sl@0: //Allow this session to be accessed by other process to lead bitmap in server sl@0: TInt ret = aFileServer.ShareProtected(); sl@0: if (ret!=KErrNone) sl@0: { sl@0: Disconnect(); sl@0: return ret; sl@0: } sl@0: iRomFileAddrCache = CFbsRalCache::New(4, aFileServer); sl@0: if (!iRomFileAddrCache) sl@0: { sl@0: Disconnect(); sl@0: return KErrNoMemory; sl@0: } sl@0: sl@0: ret = CreateSession(KFBSERVGlobalThreadName,Version(),-1); sl@0: if(ret!=KErrNone) sl@0: { sl@0: Disconnect(); sl@0: return ret; sl@0: } sl@0: const TInt serverAssignedHandle = SendReceive(EFbsMessInit); sl@0: if(serverAssignedHandle <= 0) sl@0: { sl@0: Disconnect(); sl@0: return serverAssignedHandle; sl@0: } sl@0: ret = iSharedChunk.OpenGlobal(KFBSERVSharedChunkName,EFalse); sl@0: if(ret!=KErrNone) sl@0: Panic(EFbsPanicChunkError); sl@0: iHelper = new CFbsSessionHelper(*this); sl@0: if (!iHelper) sl@0: { sl@0: Disconnect(); sl@0: return KErrNoMemory; sl@0: } sl@0: iHelper->iServerSessionHandle = serverAssignedHandle; sl@0: sl@0: ret = iLargeBitmapChunk.OpenGlobal(KFBSERVLargeChunkName,EFalse); sl@0: if(ret!=KErrNone) sl@0: Panic(EFbsPanicChunkError); sl@0: sl@0: iSpare = (TUint32*)&aFileServer; sl@0: sl@0: FBS_OST(OstTraceExt2(GRAPHICS_CONTROL_SEMANTICS, RFBSSESSION_DOCONNECT_INFO, "# New FBS Session created; this=0x%08x; iSSH=0x%08x;", (TInt)this, serverAssignedHandle);) sl@0: return KErrNone; sl@0: } sl@0: sl@0: /** sl@0: Allocates the buffer for decoding compressed rom bitmaps. sl@0: sl@0: Internal use only. sl@0: sl@0: @param aSize Minimum size of the buffer required. sl@0: If the buffer is too small an attempt to resize it will be made. sl@0: @return KErrNone if successful, sl@0: KErrNoMemory if the buffer was too small and could sl@0: not be expanded. sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: TInt RFbsSession::AllocScanLineBuffer(TInt aSize) sl@0: { sl@0: if (iScanLineBuffer && iScanLineBuffer->Des().MaxSize() >= aSize) sl@0: { sl@0: return KErrNone; sl@0: } sl@0: sl@0: HBufC8* newBuffer = HBufC8::New(aSize); sl@0: sl@0: if (newBuffer) sl@0: { sl@0: delete iScanLineBuffer; sl@0: iScanLineBuffer = newBuffer; sl@0: return KErrNone; sl@0: } sl@0: sl@0: return KErrNoMemory; sl@0: } sl@0: sl@0: /** sl@0: Gets a reference to the buffer currently in use for decoding sl@0: compressed rom bitmaps. sl@0: sl@0: Internal use only. sl@0: sl@0: @return The buffer area currently in use, sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: HBufC8* RFbsSession::GetScanLineBuffer() sl@0: { sl@0: return iScanLineBuffer; sl@0: } sl@0: sl@0: /** sl@0: Gets a pointer to the buffer currently in use for decoding sl@0: compressed mask bitmaps. sl@0: sl@0: Internal use only. sl@0: @param aSize Minimum size of the buffer required. sl@0: If the buffer is too small an attempt to resize it will be made. sl@0: @return The buffer area currently in use or NULL if there is no memory. sl@0: @internalComponent sl@0: */ sl@0: HBufC8* RFbsSession::GetDecompressionBuffer(TInt aSize) sl@0: { sl@0: if (iDecompressionBuffer) sl@0: { sl@0: if (iDecompressionBuffer->Des().MaxSize() < aSize) sl@0: { sl@0: HBufC8* tempBuffer = iDecompressionBuffer->ReAlloc(aSize); sl@0: if (!tempBuffer) sl@0: { sl@0: return NULL; sl@0: } sl@0: iDecompressionBuffer = tempBuffer; sl@0: } sl@0: } sl@0: else sl@0: { sl@0: iDecompressionBuffer = HBufC8::New(aSize); sl@0: } sl@0: sl@0: return iDecompressionBuffer; sl@0: } sl@0: sl@0: /** sl@0: Gets a pointer to an extra buffer for general use. sl@0: sl@0: Internal use only. sl@0: @param aSize Minimum size of the buffer required. sl@0: If the buffer is too small an attempt to resize it will be made. sl@0: @return The buffer area currently in use or NULL if there is no memory. sl@0: @internalComponent sl@0: */ sl@0: HBufC8* RFbsSession::GetExtraBuffer(TInt aSize) sl@0: { sl@0: if (iHelper->iExtraBuffer) sl@0: { sl@0: if (iHelper->iExtraBuffer->Des().MaxSize() < aSize) sl@0: { sl@0: HBufC8* tempBuffer = iHelper->iExtraBuffer->ReAlloc(aSize); sl@0: if (!tempBuffer) sl@0: { sl@0: return NULL; sl@0: } sl@0: iHelper->iExtraBuffer = tempBuffer; sl@0: } sl@0: } sl@0: else sl@0: { sl@0: iHelper->iExtraBuffer = HBufC8::New(aSize); sl@0: } sl@0: sl@0: return iHelper->iExtraBuffer; sl@0: } sl@0: sl@0: /** sl@0: Returns a handle assigned to this session by the server upon connection. sl@0: This method should be used instead of SessionHandle() when passing a session sl@0: handle to FbServ APIs that require Session handles. sl@0: @return A handle representing this session on the server. sl@0: @pre The session has successfully connected to the server. sl@0: */ sl@0: TInt RFbsSession::ServerSessionHandle() const sl@0: { sl@0: __ASSERT_ALWAYS(iConnections>0,Panic(EFbsPanicBadConnection)); sl@0: return iHelper->iServerSessionHandle; sl@0: } sl@0: sl@0: EXPORT_C TInt RFbsSession::GetGlyphCacheMetrics( TGlyphCacheMetrics& aGlyphCacheMetrics ) sl@0: { sl@0: TPckgBuf metrics; sl@0: TIpcArgs args( &metrics ); sl@0: sl@0: TInt ret = SendReceive( EFbsMessGetGlyphCacheMetrics, args ); sl@0: aGlyphCacheMetrics = metrics(); sl@0: sl@0: return ret; sl@0: } sl@0: sl@0: /** sl@0: Perform the IPC to convey the desired OoGM action to the glyph atlas. sl@0: sl@0: @return KErrNone if IPC was successful. One of the system-wide error sl@0: codes, as described for RSessionBase::SendReceive(), if not. sl@0: sl@0: @note The server-side platform security policy applied to this method is such that it is only useable by the GOoM framework. sl@0: sl@0: @param aOogmMessage. A reference to the class encapsulating the OoGM action required of the glyph atlas. sl@0: */ sl@0: EXPORT_C TInt RFbsSession::ConveyOogmMessage( TFbsOogmMessage& aOogmMessage ) sl@0: { sl@0: TPckgBuf oogmMessage; sl@0: oogmMessage() = aOogmMessage; sl@0: TIpcArgs args( &oogmMessage ); sl@0: sl@0: return SendReceive( EFbsMessOogmNotification, args ); sl@0: } sl@0: sl@0: /** sl@0: Returns the current sizes of the FBServ default heap, the heap for large bitmaps, sl@0: and the heap for small bitmaps. sl@0: sl@0: Not supported in release builds. sl@0: sl@0: @internalComponent sl@0: @test sl@0: @param aDefaultHeapSize A reference to an integer supplied by the caller. On return from this function, contains the size of the FBServ default heap. sl@0: @param aSmallBmpHeapSize A reference to an integer supplied by the caller. On return from this function, contains the size of the FBServ heap for small bitmaps sl@0: @param aBigBmpHeapSize A reference to an integer supplied by the caller. On return from this function, contains the size of the FBServ heap for large bitmaps sl@0: @return KErrNone or one of the system wide error codes in debug mode, or KErrNotSupported in release mode. sl@0: */ sl@0: #ifdef _DEBUG sl@0: EXPORT_C TInt RFbsSession::GetHeapSizes(TInt& aDefaultHeapSize, TInt& aSmallBmpHeapSize, TInt& aBigBmpHeapSize) sl@0: { sl@0: TPckgBuf data; sl@0: TIpcArgs args(&data); sl@0: TInt ret = SendReceive(EFbsMessGetHeapSizes, args); sl@0: if(ret == KErrNone) sl@0: { sl@0: aDefaultHeapSize = data().iDefault; sl@0: aSmallBmpHeapSize = data().iSmall; sl@0: aBigBmpHeapSize = data().iBig; sl@0: } sl@0: return ret; sl@0: } sl@0: #else sl@0: EXPORT_C TInt RFbsSession::GetHeapSizes(TInt&, TInt&, TInt&) sl@0: { sl@0: return KErrNotSupported; sl@0: } sl@0: #endif