windowing/windowserver/nga/CLIENT/MWSCLI.CPP
branchRCL_3
changeset 163 bbf46f59e123
parent 26 15986eb6c500
child 164 25ffed67c7ef
equal deleted inserted replaced
150:57c618273d5c 163:bbf46f59e123
     1 // Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 1996-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".
    26 
    26 
    27 MWsClientClass::MWsClientClass(RWsBuffer *aBuffer) : iWsHandle(0), iBuffer(aBuffer)
    27 MWsClientClass::MWsClientClass(RWsBuffer *aBuffer) : iWsHandle(0), iBuffer(aBuffer)
    28 	{
    28 	{
    29 	}
    29 	}
    30 
    30 
    31 void MWsClientClass::Write(const TAny *aData1, TInt aLength1,const TAny *aData2, TInt aLength2,TUint aOpcode) const
    31 /**
    32 	{
    32 Writes data sent in aData1 of length aLength1 for the specifed aOpcode
    33 	iBuffer->Write(iWsHandle,aOpcode,aData1,aLength1,aData2,aLength2);
    33 into wserv buffer. It also takes aLength2 paratmeter, which is the length of second data 
    34 	}
    34 that will be added using AppendData. This Function checks if current command and aLength2 
    35 
    35 can fit in the remaining buffer, if not then it does flush of previous command so that
    36 void MWsClientClass::Write(const TAny *aData1, TInt aLength1,TUint aOpcode) const
    36 the current command can be set along with data of aLength2. 
    37 	{
    37 
    38 	iBuffer->Write(iWsHandle,aOpcode,aData1,aLength1);
    38 @param aData1 Data to be added to the buffer
       
    39 @param aLength1 Length of the data to be added to buffer
       
    40 @param aLength2 Length of second data that will(and must) be added using AppendData()
       
    41 @param aOpcode Opcode for the current command
       
    42 */
       
    43 void MWsClientClass::Write(const TAny *aData1,TInt aLength1,TInt aLength2,TUint aOpcode) const
       
    44 	{
       
    45 	Write(aData1,aLength1,NULL,aLength2,aOpcode);
       
    46 	}
       
    47 
       
    48 /**
       
    49 Writes data sent in aData1 and aData2 of lengths aLength1 and aLength2 
       
    50 for the specifed aOpcode into wserv buffer. It also takes an TIpcArgs by which 
       
    51 you can send additional data. But one thing needs to be noted that if aIpcArgs 
       
    52 has some content then this function flushes the wserv buffer 
       
    53 
       
    54 @param aData1 Data to be added to the buffer
       
    55 @param aLength1 Length of the data to be added to buffer
       
    56 @param aData2 second Data to be added to the buffer
       
    57 @param aLength2 second Length of second data then can be added using AppendData()
       
    58 @param aOpcode Opcode for the current command
       
    59 @param aIpcArgs Additional data sent from client to server. It has default argument NULL.
       
    60 				And if some data is sent in aIpcArgs, it flushes wserv buffer.
       
    61 
       
    62 Note:Only second, third and fourth slot of IPC agrs can be used to send data 
       
    63 as first slot is used up for normal wserv buffer
       
    64 */
       
    65 void MWsClientClass::Write(const TAny *aData1, TInt aLength1,const TAny *aData2, TInt aLength2,TUint aOpcode,const TIpcArgs* aIpcArgs/*=NULL*/) const
       
    66 	{
       
    67 	iBuffer->Write(iWsHandle,aOpcode,aData1,aLength1,aData2,aLength2,aIpcArgs);
       
    68 	}
       
    69 
       
    70 /**
       
    71 Writes data sent in aData1 of length aLength1 for the specifed aOpcode 
       
    72 into wserv buffer. It also takes an TIpcArgs by which you can send additional data. 
       
    73 But one thing needs to be noted that if aIpcArgs has some content then this 
       
    74 function flushes the wserv buffer 
       
    75 
       
    76 @param aData1 Data to be added to the buffer
       
    77 @param aLength1 Length of the data to be added to buffer
       
    78 @param aOpcode Opcode for the current command
       
    79 @param aIpcArgs Additional data sent from client to server. It has default argument NULL.
       
    80 				And if some data is sent in aIpcArgs, it flushes wserv buffer
       
    81 
       
    82 Note:Only second, third and fourth slot of IPC agrs can be used to send data 
       
    83 as first slot is used up for normal wserv buffer				
       
    84 */
       
    85 void MWsClientClass::Write(const TAny *aData, TInt aLength, TUint aOpcode, const TIpcArgs* aIpcArgs/*=NULL*/) const
       
    86 	{
       
    87 	iBuffer->Write(iWsHandle,aOpcode,aData,aLength,aIpcArgs);
    39 	}
    88 	}
    40 
    89 
    41 void MWsClientClass::Write(TUint aOpcode) const
    90 void MWsClientClass::Write(TUint aOpcode) const
    42 	{
    91 	{
    43 	iBuffer->Write(iWsHandle,aOpcode);
    92 	iBuffer->Write(iWsHandle,aOpcode);
    61 void MWsClientClass::WriteSize(const TSize &aSize, TUint aOpcode) const
   110 void MWsClientClass::WriteSize(const TSize &aSize, TUint aOpcode) const
    62 	{
   111 	{
    63 	Write(&aSize,sizeof(aSize),aOpcode);
   112 	Write(&aSize,sizeof(aSize),aOpcode);
    64 	}
   113 	}
    65 
   114 
       
   115 /**
       
   116 Appends data directly to wserv buffer for the current command. So this function 
       
   117 should be used after adding the current command.
       
   118 Typically this function is used in conjunction with  
       
   119 MWsClientClass::Write(const TAny *aData1,TInt aLength1,TInt aLength2,TUint aOpcode)
       
   120 Please see its description for more details.  
       
   121 
       
   122 @param aData Data to be added to the buffer
       
   123 @param aLength Length of the data to be added to buffer. Make sure that its length
       
   124 		is less than availabe buffer.
       
   125 @param aFinished EFalse, adds data to buffer and disables flushing(notfies that more data is pending to be added)
       
   126 				 ETrue, adds data to buffer and enables flushing(Signals that this is the last bit of data to be added)
       
   127 
       
   128 Notes:
       
   129 1. The total length of all data added by using this API(by one or more calls) must be less then(See note 3)or 
       
   130 same as aLength2 passed in earlier call to MWsClientClass::Write(const TAny *aData1,TInt aLength1,TInt aLength2,TUint aOpcode)
       
   131 2. When data is added using this API, it pads out buffer to multiple of 4 bytes so that 
       
   132 all strings added to the buffer will begin on a 4 byte boundary.
       
   133 3. If data added is less then the length passed to above Write API it works, but wastes buffer spaces. 
       
   134 */
       
   135 void MWsClientClass::AppendData(const TAny *aData,TInt aLength,TBool aFinished)
       
   136 	{
       
   137 	iBuffer->AppendData(aData,aLength,aFinished);
       
   138 	}
       
   139 
    66 TInt MWsClientClass::WriteReply(TUint aOpcode,const TIpcArgs* aIpcArgs) const
   140 TInt MWsClientClass::WriteReply(TUint aOpcode,const TIpcArgs* aIpcArgs) const
    67 	{
   141 	{
    68 	return(iBuffer->WriteReply(iWsHandle,aOpcode,aIpcArgs));
   142 	return(iBuffer->WriteReply(iWsHandle,aOpcode,aIpcArgs));
    69 	}
   143 	}
    70 
   144 
   140 
   214 
   141 void MWsClientClass::DestroyWindowSizeCacheEntry()
   215 void MWsClientClass::DestroyWindowSizeCacheEntry()
   142     {
   216     {
   143     iBuffer->DestroyWindowSizeCacheEntry(iWsHandle);
   217     iBuffer->DestroyWindowSizeCacheEntry(iWsHandle);
   144     }
   218     }
   145 
       
   146 #ifdef SYMBIAN_GRAPHICS_FIXNATIVEORIENTATION
       
   147 void MWsClientClass::EnableWindowNativeSizeCacheL()
       
   148     {
       
   149     return iBuffer->EnableWindowNativeSizeCacheL();
       
   150     }
       
   151 
       
   152 TBool MWsClientClass::WindowNativeSizeCacheEnabled() const
       
   153     {
       
   154     return iBuffer->WindowNativeSizeCacheEnabled();
       
   155     }
       
   156 
       
   157 TInt MWsClientClass::SetWindowNativeSize(const TSize& aNativeSize) const
       
   158     {
       
   159     return iBuffer->SetWindowNativeSize(iWsHandle,aNativeSize);
       
   160     }
       
   161 
       
   162 TInt MWsClientClass::WindowNativeSize(TSize& aSize) const
       
   163     {
       
   164     return iBuffer->WindowNativeSize(iWsHandle, aSize);
       
   165     }
       
   166 
       
   167 void MWsClientClass::DestroyWindowNativeSizeCacheEntry()
       
   168     {
       
   169     iBuffer->DestroyWindowNativeSizeCacheEntry(iWsHandle);
       
   170     }
       
   171 #endif // SYMBIAN_GRAPHICS_FIXNATIVEORIENTATION
       
   172