fbs/fontandbitmapserver/sfbs/SESSION.CPP
changeset 116 171fae344dd4
parent 103 2717213c588a
child 160 969102054596
equal deleted inserted replaced
103:2717213c588a 116:171fae344dd4
    18 #include "UTILS.H"
    18 #include "UTILS.H"
    19 #include "FBSVER.H"
    19 #include "FBSVER.H"
    20 #include "FbsRalc.h"
    20 #include "FbsRalc.h"
    21 #include "fbshelper.h"
    21 #include "fbshelper.h"
    22 #include "FbsMessage.H"
    22 #include "FbsMessage.H"
       
    23 #include <graphics/fbsoogmmessage.h>
    23 
    24 
    24 GLDEF_C void Panic(TFbsPanic aPanic)
    25 GLDEF_C void Panic(TFbsPanic aPanic)
    25 	{
    26 	{
    26 	_LIT(KFBSERVClientPanicCategory,"FBSCLI");
    27 	_LIT(KFBSERVClientPanicCategory,"FBSCLI");
    27 	User::Panic(KFBSERVClientPanicCategory,aPanic);
    28 	User::Panic(KFBSERVClientPanicCategory,aPanic);
   236 @internalComponent
   237 @internalComponent
   237 */
   238 */
   238 EXPORT_C TInt RFbsSession::SendCommand(TInt aMessage,TInt aInt0,TInt aInt1,TInt aInt2,TInt aInt3) const
   239 EXPORT_C TInt RFbsSession::SendCommand(TInt aMessage,TInt aInt0,TInt aInt1,TInt aInt2,TInt aInt3) const
   239    {
   240    {
   240 	__ASSERT_ALWAYS(iConnections>0,Panic(EFbsPanicBadConnection));
   241 	__ASSERT_ALWAYS(iConnections>0,Panic(EFbsPanicBadConnection));
       
   242 
   241 	switch(aMessage)
   243 	switch(aMessage)
   242 		{
   244 		{
   243 	case EFbsMessShutdown:
   245 	case EFbsMessShutdown:
   244 	case EFbsMessClose:
   246 	case EFbsMessClose:
   245 		SetCallBackPtr(aMessage==EFbsMessClose ? &aInt1 : 0);
   247 		SetCallBackPtr(aMessage==EFbsMessClose ? &aInt1 : 0);
   246 		iCallBack.CallBack();
   248 		iCallBack.CallBack();
   247 	default:
   249 	default:
   248 		break;
   250 		break;
   249 		}
   251 		}
       
   252 
   250 	TInt ret = SendReceive(aMessage, TIpcArgs(aInt0,aInt1,aInt2,aInt3));
   253 	TInt ret = SendReceive(aMessage, TIpcArgs(aInt0,aInt1,aInt2,aInt3));
       
   254 
   251 	return(ret);
   255 	return(ret);
   252 	}
   256 	}
   253 
   257 
   254 TInt RFbsSession::SendCommand(TInt aMessage, const TIpcArgs& aArgs) const
   258 TInt RFbsSession::SendCommand(TInt aMessage, const TIpcArgs& aArgs) const
   255 	{
   259 	{
   483 TInt RFbsSession::ServerSessionHandle() const
   487 TInt RFbsSession::ServerSessionHandle() const
   484 	{
   488 	{
   485 	__ASSERT_ALWAYS(iConnections>0,Panic(EFbsPanicBadConnection));
   489 	__ASSERT_ALWAYS(iConnections>0,Panic(EFbsPanicBadConnection));
   486 	return iHelper->iServerSessionHandle;
   490 	return iHelper->iServerSessionHandle;
   487 	}
   491 	}
       
   492 
       
   493 EXPORT_C TInt RFbsSession::GetGlyphCacheMetrics( TGlyphCacheMetrics& aGlyphCacheMetrics )
       
   494     {
       
   495     TPckgBuf<TGlyphCacheMetrics> metrics;
       
   496     TIpcArgs args( &metrics );
       
   497 
       
   498     TInt ret = SendReceive( EFbsMessGetGlyphCacheMetrics, args );
       
   499     aGlyphCacheMetrics = metrics();
       
   500 
       
   501     return ret;
       
   502     }
       
   503 
       
   504 /**
       
   505  Perform the IPC to convey the desired OoGM action to the glyph atlas.
       
   506 
       
   507  @return KErrNone if IPC was successful. One of the system-wide error
       
   508          codes, as described for RSessionBase::SendReceive(), if not.
       
   509 
       
   510  @note The server-side platform security policy applied to this method is such that it is only useable by the GOoM framework.
       
   511 
       
   512  @param aOogmMessage. A reference to the class encapsulating the OoGM action required of the glyph atlas.
       
   513 */
       
   514 EXPORT_C TInt RFbsSession::ConveyOogmMessage( TFbsOogmMessage& aOogmMessage )
       
   515     {
       
   516     TPckgBuf<TFbsOogmMessage> oogmMessage;
       
   517     oogmMessage() = aOogmMessage;
       
   518     TIpcArgs args( &oogmMessage );
       
   519 
       
   520     return SendReceive( EFbsMessOogmNotification, args );
       
   521     }
   488 
   522 
   489 /**
   523 /**
   490 Returns the current sizes of the FBServ default heap, the heap for large bitmaps, 
   524 Returns the current sizes of the FBServ default heap, the heap for large bitmaps, 
   491 and the heap for small bitmaps.
   525 and the heap for small bitmaps.
   492 
   526