screensaver/snsrdisplaycontrol_s60/src/snsrdisplaycontrolsession.cpp
changeset 96 458d8c8d9580
parent 92 6727c5d0afc7
child 97 66b5fe3c07fd
equal deleted inserted replaced
92:6727c5d0afc7 96:458d8c8d9580
    16 *
    16 *
    17 */
    17 */
    18 
    18 
    19 #include <power_save_display_mode.h>
    19 #include <power_save_display_mode.h>
    20 #include <hal.h>
    20 #include <hal.h>
       
    21 #include <coreapplicationuisdomainpskeys.h>
       
    22 #include <e32property.h>
    21 
    23 
    22 #include "snsrdisplaycontrolsession.h"
    24 #include "snsrdisplaycontrolsession.h"
    23 #include "snsrdisplaycontrolcommon.h"
    25 #include "snsrdisplaycontrolcommon.h"
    24 
    26 
    25 
    27 
    94     
    96     
    95     switch ( func )
    97     switch ( func )
    96         {
    98         {
    97         case ESnsrDispCtrlSrvDisplayOff:
    99         case ESnsrDispCtrlSrvDisplayOff:
    98             {
   100             {
    99             // off
   101             // Disable touch
   100             // TODO
   102             HAL::Set( HALData::EPenState, 0 );
       
   103             
       
   104             // Lights off
       
   105             err = RProperty::Set(KPSUidCoreApplicationUIs, KLightsSSForcedLightsOn, 0);
   101             break;
   106             break;
   102             }
   107             }
   103         case ESnsrDispCtrlSrvDisplayLowPower:
   108         case ESnsrDispCtrlSrvDisplayLowPower:
   104             {
   109             {
   105             // low power
   110             // Disable touch
       
   111             HAL::Set( HALData::EPenState, 0 );
       
   112             
       
   113             // Set display mode
   106             TInt startRow = aMessage.Int0();
   114             TInt startRow = aMessage.Int0();
   107             TInt endRow = aMessage.Int1();
   115             TInt endRow = aMessage.Int1();
   108             // TODO: for now, we pass a zero-filled pixel buffer to power save API.
   116             // TODO: for now, we pass a zero-filled pixel buffer to power save API.
   109             // This works fine with our reference hardware but some types of displays
   117             // This works fine with our reference hardware but some types of displays
   110             // might require passing the actual screen contents in this buffer.
   118             // might require passing the actual screen contents in this buffer.
   112             err = iPowerSave->Set(startRow, endRow, ptr);
   120             err = iPowerSave->Set(startRow, endRow, ptr);
   113             break;
   121             break;
   114             }
   122             }
   115         case ESnsrDispCtrlSrvDisplayFullPower:
   123         case ESnsrDispCtrlSrvDisplayFullPower:
   116             {
   124             {
   117             // full power
   125             // Enable touch
       
   126             HAL::Set( HALData::EPenState, 1 );
       
   127             
       
   128             // Set display mode
   118             err = iPowerSave->Exit();
   129             err = iPowerSave->Exit();
       
   130             
       
   131             // Lights on
       
   132             err = RProperty::Set(KPSUidCoreApplicationUIs, KLightsSSForcedLightsOn, 30) || err;
   119             break;
   133             break;
   120             }
   134             }
   121         default:
   135         default:
   122             {
   136             {
   123             err = KErrNotSupported;
   137             err = KErrNotSupported;