os/graphics/windowing/windowserver/nga/CLIENT/advancedpointerevent.cpp
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 // TAdvancedPointerEvent encapsulates additional information to that contained in TPointerEvent.
    15 // For multi-touch, pressure and proximity.
    16 // 
    17 //
    18 
    19 #include "W32STD.H"
    20 
    21 
    22 EXPORT_C TInt TAdvancedPointerEvent::DoGetPointerNumber() const
    23 /** Gets the pointer number for the event
    24   
    25   @return TInt. The pointer number for the event
    26   @internalTechnology */
    27 	{
    28 	return iData.multiPos3D.iPointerNumber;
    29 	}
    30 
    31 EXPORT_C TInt TAdvancedPointerEvent::DoGetProximity() const
    32 /** Gets the pointer event proximity
    33   
    34   @return TInt.  The pointer event proximity
    35   @internalTechnology */
    36 	{
    37 	return Min(iData.multiPos3D.iPosZ,EPressureProximityCrossover);
    38 	}
    39 
    40 EXPORT_C TInt TAdvancedPointerEvent::DoGetPressure() const
    41 /** Gets the pointer event pressure
    42   
    43   @return TInt.  The pointer event pressure
    44   @internalTechnology */
    45 	{
    46 	return Max(iData.multiPos3D.iPosZ,EPressureProximityCrossover);
    47 	}
    48 
    49 EXPORT_C TInt TAdvancedPointerEvent::DoGetProximityAndPressure() const
    50 /** Gets the pointer event combined proximity and pressure.
    51   
    52   Negative values are proximity, positive values are pressure.
    53   
    54   @return TInt.  The pointer event combined proximity and pressure
    55   @internalTechnology */
    56 	{
    57 	return iData.multiPos3D.iPosZ;
    58 	}
    59 
    60 EXPORT_C TAdvancedPointerEvent::TAdvancedPointerEvent(const TAdvancedPointerEvent& aPointerEvent)
    61 /** Copy Constructor for TAdvancedPointerEvent
    62   
    63   @param  const TAdvancedPointerEvent& aPointerEvent.  The event to copy.
    64   @internalTechnology */
    65 	{
    66 	Copy(aPointerEvent);
    67 	}
    68 
    69 EXPORT_C TAdvancedPointerEvent& TAdvancedPointerEvent::operator=(const TAdvancedPointerEvent& aPointerEvent) // Operator = overload
    70 /** Operator= overload for TAdvancedPointerEvent
    71   
    72   @param  const TAdvancedPointerEvent& aPointerEvent.  The event to copy.
    73   @internalTechnology */
    74 	{
    75 	if(this != &aPointerEvent)
    76 		{
    77 		Copy(aPointerEvent);
    78 		}
    79 	return *this;
    80 	}
    81 
    82 EXPORT_C void TWsEvent::InitAdvancedPointerEvent(TPointerEvent::TType aType, TUint aModifiers, const TPoint3D &aPoint3D, TUint8 aPointerNumber)
    83 /** Initializes TAdvancedPointerEvent contained in this TWsEvent.
    84  @param aType type of TAdvancedPointerEvent
    85  @param aModifiers the state of the modifier keys at the time when the event occured, 
    86                    defined in TEventModifier
    87  @param aPoint3D x and y coordinates of the pointer plus z coordinate representing proximity of the pointer
    88                  combined with its pressure, as returned by TAdvancedPointerEvent::PositionAndPressure3D()
    89  @param aPointerNumber pointer number of the pointer whose state change is described by this event
    90  @see TWsEvent::Pointer()
    91  @see TAdvancedPointerEvent::PositionAndPressure3D()
    92  @see TAdvancedPointerEvent::PointerNumber()
    93  @publishedPartner To become publishedAll with WSERV NGA APIs
    94  @prototype To become released with WSERV NGA APIs */
    95 	{
    96 	Pointer()->Init(aType, aModifiers, aPoint3D, aPointerNumber);
    97 	}
    98 
    99 EXPORT_C void TWsEvent::SetPointerNumber(TUint8 aPointerNumber)
   100 /** Changes pointer number of TAdvancedPointerEvent contained in this TWsEvent.
   101  @param aPointerNumber new pointer number to set in TAdvancedPointerEvent contained in this
   102                        TWsEvent
   103  @see TWsEvent::Pointer()
   104  @see TAdvancedPointerEvent::PointerNumber()
   105  @publishedPartner To become publishedAll with WSERV NGA APIs
   106  @prototype To become released with WSERV NGA APIs */
   107 	{
   108 	Pointer()->SetPointerNumber(aPointerNumber);
   109 	}
   110 
   111 EXPORT_C void TWsEvent::SetPointerZ(TInt aZ)
   112 /** Changes pressure and proximity of TAdvancedPointerEvent contained in this TWsEvent.
   113  @param aZ new pressure and proximity to set, combined the same way as returned
   114            by TAdvancedPointerEvent::ProximityAndPressure()
   115  @see TWsEvent::Pointer()
   116  @see TAdvancedPointerEvent::ProximityAndPressure()
   117  @publishedPartner To become publishedAll with WSERV NGA APIs
   118  @prototype To become released with WSERV NGA APIs */
   119 	{
   120 	Pointer()->SetPointerZ(aZ);
   121 	}