videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/src/videoplaybackcontrolstestblocks.cpp
branchRCL_3
changeset 6 7d91903f795f
parent 2 dec420019252
child 9 5294c000a26d
equal deleted inserted replaced
2:dec420019252 6:7d91903f795f
    13 *
    13 *
    14 * Description:  Test Harness for VideoPlayControls
    14 * Description:  Test Harness for VideoPlayControls
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 // Version : %version: 9 %
    18 // Version : %version: 10 %
    19 
    19 
    20 
    20 
    21 // [INCLUDE FILES] - do not remove
    21 // [INCLUDE FILES] - do not remove
    22 #include <e32svr.h>
    22 #include <e32svr.h>
    23 #include <e32std.h>
    23 #include <e32std.h>
   539 void CVideoPlaybackControlsTest::TapOnScreen( TPointerEvent::TType aType,
   539 void CVideoPlaybackControlsTest::TapOnScreen( TPointerEvent::TType aType,
   540                                               TPoint aPosition )
   540                                               TPoint aPosition )
   541 {
   541 {
   542     MPX_DEBUG(_L("CVideoPlaybackControlsTest::TapOnScreen()"));
   542     MPX_DEBUG(_L("CVideoPlaybackControlsTest::TapOnScreen()"));
   543 
   543 
       
   544     MPX_DEBUG(_L("   aType = %d, aPosition = (%d,%d)"), aType, aPosition.iX, aPosition.iY);
       
   545 
       
   546     TPoint tapPoint( aPosition );
       
   547 
       
   548 #if !defined(__WINS__)
       
   549 
       
   550     //
       
   551     //  On the hardware, the window server is performing a rotation.
       
   552     //  This calculation will adjust the points so the same touch point is received
       
   553     //  on both the emulator and hardware
       
   554     //
       
   555     //  ix = ( ScreenWidth - 1 ) - oldPosition.iY - YOffset
       
   556     //      I am not sure why they subtract 1 from the screen width, but they do
       
   557     //      The YOffset can be read from the wsini.ini file
       
   558     //
       
   559     //  iy = oldPosition.iX
       
   560     //  
       
   561     tapPoint.iX = ( 360 - 1 ) - aPosition.iY - 12;
       
   562     tapPoint.iY = aPosition.iX;
       
   563 
       
   564 #endif
       
   565     
       
   566     MPX_DEBUG(_L("   tapPosition = (%d,%d)"), tapPoint.iX, tapPoint.iY);
       
   567 
   544     TRawEvent pointer;
   568     TRawEvent pointer;
   545 
   569 
   546     if ( aType == TPointerEvent::EButton1Down )
   570     if ( aType == TPointerEvent::EButton1Down )
   547     {
   571     {
   548         pointer.Set( TRawEvent::EButton1Down, aPosition.iX, aPosition.iY );
   572         pointer.Set( TRawEvent::EButton1Down, tapPoint.iX, tapPoint.iY );
   549 
   573 
   550         iWsSession.SimulateRawEvent( pointer );
   574         iWsSession.SimulateRawEvent( pointer );
   551         iWsSession.Flush();
   575         iWsSession.Flush();
   552     }
   576     }
   553     else if ( aType == TPointerEvent::EButton1Up )
   577     else if ( aType == TPointerEvent::EButton1Up )
   554     {
   578     {
   555         pointer.Set( TRawEvent::EButton1Up, aPosition.iX, aPosition.iY );
   579         pointer.Set( TRawEvent::EButton1Up, tapPoint.iX, tapPoint.iY );
   556 
   580 
   557         iWsSession.SimulateRawEvent( pointer );
   581         iWsSession.SimulateRawEvent( pointer );
   558         iWsSession.Flush();
   582         iWsSession.Flush();
   559     }
   583     }
   560 }
   584 }