akntouchgesturefw/src/akntouchgesturefwpointerstate.cpp
branchRCL_3
changeset 59 978afdc0236f
parent 0 2f259fa3e83a
equal deleted inserted replaced
56:d48ab3b357f1 59:978afdc0236f
   140 // Returns the position of the first pointer.
   140 // Returns the position of the first pointer.
   141 // ---------------------------------------------------------------------------
   141 // ---------------------------------------------------------------------------
   142 //
   142 //
   143 TPoint* CAknTouchGestureFwPointerState::FirstPointerPosition()
   143 TPoint* CAknTouchGestureFwPointerState::FirstPointerPosition()
   144     {
   144     {
   145     __ASSERT_ALWAYS( iFirstPointerNumber != KInvalidPointerNumber,
   145     __ASSERT_DEBUG( iFirstPointerNumber != KInvalidPointerNumber,
   146         User::Invariant() );
   146         User::Invariant() );
   147     return &iPointerData[ iFirstPointerNumber ].iPosition;
   147 	
       
   148 	// If iFirstPointerNumber is invalid, use default index instead.
       
   149     return &iPointerData[ iFirstPointerNumber == KInvalidPointerNumber ? 0 : iFirstPointerNumber ].iPosition;
   148     }
   150     }
   149 
   151 
   150 
   152 
   151 // ---------------------------------------------------------------------------
   153 // ---------------------------------------------------------------------------
   152 // Returns the position of the second pointer.
   154 // Returns the position of the second pointer.
   153 // ---------------------------------------------------------------------------
   155 // ---------------------------------------------------------------------------
   154 //
   156 //
   155 TPoint* CAknTouchGestureFwPointerState::SecondPointerPosition()
   157 TPoint* CAknTouchGestureFwPointerState::SecondPointerPosition()
   156     {
   158     {
   157     __ASSERT_ALWAYS( iSecondPointerNumber != KInvalidPointerNumber,
   159     __ASSERT_DEBUG( iSecondPointerNumber != KInvalidPointerNumber,
   158         User::Invariant() );
   160         User::Invariant() );
   159     return &iPointerData[ iSecondPointerNumber ].iPosition;
   161 		
       
   162 	// If iSecondPointerNumber is invalid, use default index instead.
       
   163     return &iPointerData[ iSecondPointerNumber == KInvalidPointerNumber ? 1 : iSecondPointerNumber ].iPosition;
   160     }
   164     }
   161 
   165 
   162 
   166 
   163 // ---------------------------------------------------------------------------
   167 // ---------------------------------------------------------------------------
   164 // Checks whether or not two pointers are currently detected.
   168 // Checks whether or not two pointers are currently detected.