javauis/lcdui_akn/lcdui/src/CMIDUtils.cpp
branchRCL_3
changeset 19 71c436fe3ce0
parent 18 9ac0a0a7da70
child 24 6c158198356e
equal deleted inserted replaced
18:9ac0a0a7da70 19:71c436fe3ce0
   836 // ---------------------------------------------------------------------------
   836 // ---------------------------------------------------------------------------
   837 //
   837 //
   838 // ---------------------------------------------------------------------------
   838 // ---------------------------------------------------------------------------
   839 //
   839 //
   840 CMIDUtils::CMIDUtils(MMIDEnv& aEnv, CMIDUIManager* aUIManager)
   840 CMIDUtils::CMIDUtils(MMIDEnv& aEnv, CMIDUIManager* aUIManager)
   841     : iEnv(&aEnv)
   841         : iEnv(&aEnv)
   842     , iUIManager(aUIManager)
   842         , iUIManager(aUIManager)
   843     , iScalingData()
   843         , iScalingData()
   844     , iQwertyMode(EFalse)
   844         , iQwertyMode(EFalse)
   845     , iStickyKey(0)
   845         , iStickyKey(0)
   846     , iLastScanCode(0)
   846         , iLastScanCode(0)
   847     , iModifier(0)
   847         , iModifier(0)
   848     , iScalingDataInitialized(EFalse)
   848         , iScalingDataInitialized(EFalse)
   849 {}
   849 {}
   850 
   850 
   851 CMIDUtils::~CMIDUtils()
   851 CMIDUtils::~CMIDUtils()
   852 {
   852 {
   853     delete iLight;
   853     delete iLight;
  1200     return scaled;
  1200     return scaled;
  1201 }
  1201 }
  1202 
  1202 
  1203 CMIDUtils::TScalingData CMIDUtils::GetScalingData()
  1203 CMIDUtils::TScalingData CMIDUtils::GetScalingData()
  1204 {
  1204 {
  1205 	UpdateScalingData();
  1205     UpdateScalingData();
  1206     return iScalingData;
  1206     return iScalingData;
  1207 }
  1207 }
  1208 
  1208 
  1209 void CMIDUtils::UpdateScalingData()
  1209 void CMIDUtils::UpdateScalingData()
  1210 {
  1210 {
  1213 
  1213 
  1214     //
  1214     //
  1215     iScalingDataInitialized = ETrue;
  1215     iScalingDataInitialized = ETrue;
  1216 
  1216 
  1217     // Get actual rect of screen without with eventual OSK.
  1217     // Get actual rect of screen without with eventual OSK.
  1218     TRect screenRect =iEnv->Current()->GetCanvasRectFromLaf();
  1218     // Empty rect is OK.
       
  1219     MMIDDisplayable* current = iEnv->Current();
       
  1220     TRect screenRect;
       
  1221     if (current)
       
  1222     {
       
  1223         screenRect = current->GetCanvasRectFromLaf();
       
  1224     }
  1219 
  1225 
  1220     // Traslate of rect of screen into size
  1226     // Traslate of rect of screen into size
  1221     data.iScreenSize = screenRect.Size();
  1227     data.iScreenSize = screenRect.Size();
  1222 
  1228 
  1223     // Check if scaling is is on now.
  1229     // Check if scaling is is on now.