os/graphics/windowing/windowserver/inc/advancedpointerevent.inl
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // inline implementations for TAdvancedPointerEvent
    15 // 
    16 //
    17 
    18 #ifndef ADVANCEDPOINTEREVENT_INL_
    19 #define ADVANCEDPOINTEREVENT_INL_
    20 
    21 
    22 /**	Does basic initialisation of a TAdvancedPointerEvent
    23 	@internalTechnology */
    24 inline void TAdvancedPointerEvent::Init()
    25 	{
    26 	iModifiers=EModifierAdvancedPointerEvent;
    27 	iData.ints.iSpare1=0;
    28 	iData.ints.iSpare2=0;
    29 	}
    30 
    31 /**	Does specific initialisation of a TAdvancedPointerEvent
    32 	@param aType The pointer event type.
    33 	@param aModifiers Additional modifiers for the event.
    34 	@param aPoint3D The 3D coordinated of the event.
    35 	@param aPointerNumber The pointer number for the event.
    36 	@internalTechnology */
    37 inline void TAdvancedPointerEvent::Init(const TPointerEvent::TType aType, const TUint aModifiers, const TPoint3D &aPoint3D, const TUint8 aPointerNumber)
    38 	{
    39 	Init();
    40 	iType=aType;
    41 	iModifiers|=aModifiers; //add the new modifiers to EModifierAdvancedPointerEvent
    42 	iPosition.iX=aPoint3D.iX;
    43 	iPosition.iY=aPoint3D.iY;
    44 	iData.multiPos3D.iPosZ=aPoint3D.iZ;
    45 	iData.multiPos3D.iPointerNumber=aPointerNumber;
    46 	}
    47 
    48 /** Sets the pointer number and enforces pointer event to an advanced pointer event.
    49 	@internalTechnology */
    50 inline void TAdvancedPointerEvent::SetPointerNumber(TUint8 aPointerNumber)
    51 	{
    52 	iModifiers|=EModifierAdvancedPointerEvent; // ensure we're an AdvancePointerEvent 
    53 	iData.multiPos3D.iPointerNumber=aPointerNumber;
    54 	}
    55 
    56 /** Sets Z and enforces pointer event to advanced pointer event
    57 	@internalTechnology */
    58 inline void TAdvancedPointerEvent::SetPointerZ(TInt aZ)
    59 	{
    60 	iModifiers|=EModifierAdvancedPointerEvent; // ensure we're an advanced pointer event 
    61 	iData.multiPos3D.iPosZ=aZ;
    62 	}
    63 
    64 inline void TAdvancedPointerEvent::Copy(const TAdvancedPointerEvent& aPointerEvent)
    65 	{
    66 	if(aPointerEvent.iModifiers&EModifierAdvancedPointerEvent)
    67 		{
    68 		iType=aPointerEvent.iType;
    69 		iModifiers=aPointerEvent.iModifiers;
    70 		iPosition=aPointerEvent.iPosition;
    71 		iParentPosition=aPointerEvent.iParentPosition;	
    72 		iData=aPointerEvent.iData;
    73 		}
    74 	else
    75 		{
    76 		// delegate to TPointerEvent::Copy
    77 		TPointerEvent::Copy(aPointerEvent);
    78 		}
    79 	}
    80 
    81 #endif /*ADVANCEDPOINTEREVENT_INL_*/