os/graphics/windowing/windowserver/nga/CLIENT/w32comm.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/windowing/windowserver/nga/CLIENT/w32comm.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,89 @@
     1.4 +// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +
    1.20 +#if !defined(__W32COMM_H__)
    1.21 +#define __W32COMM_H__
    1.22 +
    1.23 +
    1.24 +const TUint KBufferMessageSlot			=0;
    1.25 +const TUint KReplyBufferMessageSlot		=1;
    1.26 +const TUint KRemoteBufferMessageSlot	=2;
    1.27 +
    1.28 +const TUint KAsyncMessageSlotAnimDllHandle	=0;
    1.29 +const TUint KAsyncMessageSlotAnimHandle		=1;
    1.30 +const TUint KMaxWservStringSize		        =600;
    1.31 +
    1.32 +inline TInt PadValue(TInt aValue)
    1.33 +	{
    1.34 +	TInt padding=aValue&0x3;
    1.35 +	if (padding>0)
    1.36 +		padding=4-padding;
    1.37 +	return padding;
    1.38 +	}
    1.39 +
    1.40 +inline TInt PaddedValue(TInt aValue)
    1.41 +	{
    1.42 +	return aValue + PadValue(aValue); 
    1.43 +	}
    1.44 +
    1.45 +class TDescriptorType
    1.46 +	{
    1.47 +public:
    1.48 +	enum TBufferType
    1.49 +		{
    1.50 +		EDes8,
    1.51 +		EDes16,
    1.52 +		EDesC8,
    1.53 +		EDesC16,
    1.54 +		};
    1.55 +public:
    1.56 +	virtual void SetDescriptorOnIpcArgs(TIpcArgs& aIpcArgs) const=0;
    1.57 +protected:
    1.58 +	inline TDescriptorType(TInt aArgument, TBufferType aBufferType) : iArgument(aArgument), iBufferType(aBufferType) {}
    1.59 +protected:
    1.60 +	TInt iArgument;
    1.61 +	TBufferType iBufferType;
    1.62 +	};
    1.63 +
    1.64 +class TReadDescriptorType : public TDescriptorType
    1.65 +	{
    1.66 +public:
    1.67 +	inline TReadDescriptorType(const TDesC8* aBuffer) : TDescriptorType((TInt)aBuffer, EDesC8)
    1.68 +		{
    1.69 +		}
    1.70 +	inline TReadDescriptorType(const TDesC16* aBuffer) : TDescriptorType((TInt)aBuffer, EDesC16)
    1.71 +		{
    1.72 +		}
    1.73 +public: // from TDescriptorType
    1.74 +	void SetDescriptorOnIpcArgs(TIpcArgs& aIpcArgs) const;
    1.75 +	};
    1.76 +
    1.77 +class TWriteDescriptorType : public TDescriptorType
    1.78 +	{
    1.79 +public:
    1.80 +	inline TWriteDescriptorType(TDes8* aBuffer) : TDescriptorType((TInt)aBuffer, EDes8)
    1.81 +		{
    1.82 +		}
    1.83 +	inline TWriteDescriptorType(TDes16* aBuffer) : TDescriptorType((TInt)aBuffer, EDes16)
    1.84 +		{
    1.85 +		}
    1.86 +public: // from TDescriptorType
    1.87 +	void SetDescriptorOnIpcArgs(TIpcArgs& aIpcArgs) const;
    1.88 +	};
    1.89 +
    1.90 +
    1.91 +
    1.92 +#endif