uifw/ganes/src/HgVgMediaWall.cpp
branchRCL_3
changeset 72 a5e7a4f63858
parent 59 978afdc0236f
equal deleted inserted replaced
64:85902f042028 72:a5e7a4f63858
   157     {    
   157     {    
   158         
   158         
   159     // Set the windows size       
   159     // Set the windows size       
   160     SetRect ( aRect );
   160     SetRect ( aRect );
   161 
   161 
   162 #ifdef MEDIAWALL_ORIENTATION_FIX
   162 #ifdef MEDIAWALL_ORIENTATION_FIX    
   163     TSize screenSize = iCoeEnv->ScreenDevice()->SizeInPixels();
   163     TSize screenSize = iCoeEnv->ScreenDevice()->SizeInPixels();
   164     if (aRect == TRect(TPoint(0,0), screenSize) 
   164     if (aRect == TRect(TPoint(0,0), screenSize) 
   165             && iMediaWallStyle == EHgVgMediaWallStyleCoverflowFullScreen)
   165             && iMediaWallStyle == EHgVgMediaWallStyleCoverflowFullScreen)
   166         {
   166         {
   167         TPixelsAndRotation sizeAndRotation;
       
   168         iCoeEnv->ScreenDevice()->GetDefaultScreenSizeAndRotation(sizeAndRotation);
       
   169         iRotatedDraw = sizeAndRotation.iRotation != CFbsBitGc::EGraphicsOrientationNormal;
       
   170         
       
   171         Window().FixNativeOrientation();
   167         Window().FixNativeOrientation();
   172         }
   168         }
   173 #endif
   169 #endif
   174     
   170     
   175     }
   171     }
   228 // CHgVgMediaWall::RefreshScreen()
   224 // CHgVgMediaWall::RefreshScreen()
   229 // -----------------------------------------------------------------------------
   225 // -----------------------------------------------------------------------------
   230 //
   226 //
   231 EXPORT_C TInt CHgVgMediaWall::SelectedIndex()
   227 EXPORT_C TInt CHgVgMediaWall::SelectedIndex()
   232     {
   228     {
   233     // iObserverNotified flag is set on when animation is about to end and
   229     return iSelectedIndex * iRowCount;
   234     // observer is notified from the selected index.
       
   235     return ((iAnimationState == EHgVgMediaWallAnimationStateTransition ||
       
   236             iAnimationState == EHgVgMediaWallAnimationStateFastTransition) &&
       
   237             !iObserverNotified) ?
       
   238                 KErrNotFound : iSelectedIndex * iRowCount;
       
   239     }
   230     }
   240 
   231 
   241 // -----------------------------------------------------------------------------
   232 // -----------------------------------------------------------------------------
   242 // CHgVgMediaWall::RefreshScreen()
   233 // CHgVgMediaWall::RefreshScreen()
   243 // -----------------------------------------------------------------------------
   234 // -----------------------------------------------------------------------------
   346     delete iSpring;
   337     delete iSpring;
   347     
   338     
   348     iPopupText1.Close();
   339     iPopupText1.Close();
   349     iPopupText2.Close();
   340     iPopupText2.Close();
   350 
   341 
   351     // Just to be safe, this will release all resource, eventhought
       
   352     // they should be already released at this point.
       
   353     eglReleaseThread();
       
   354     }
   342     }
   355 
   343 
   356 // -----------------------------------------------------------------------------
   344 // -----------------------------------------------------------------------------
   357 // CHgVgMediaWall::Style()
   345 // CHgVgMediaWall::Style()
   358 // -----------------------------------------------------------------------------
   346 // -----------------------------------------------------------------------------
   875 
   863 
   876             possibleKeyScrollingState = EKeyScrollingRight;
   864             possibleKeyScrollingState = EKeyScrollingRight;
   877             handled = ETrue;
   865             handled = ETrue;
   878             } break;
   866             } break;
   879         case EKeyEnter:
   867         case EKeyEnter:
   880         case EKeyOK:
       
   881             {
   868             {
   882             if( iSelectedIndex != KErrNotFound && iSelectionObserver )
   869             if( iSelectedIndex != KErrNotFound && iSelectionObserver )
   883                 {
   870                 {
   884                 TRAP_IGNORE( DoStartOpeningAnimationL( ); )
   871                 TRAP_IGNORE( DoStartOpeningAnimationL( ); )                
   885                 return EKeyWasConsumed;
   872                 return EKeyWasConsumed;
   886                 }
   873                 }
   887             return EKeyWasNotConsumed;
   874             return EKeyWasNotConsumed;
   888             }
   875             }
   889         default:
   876         default:
  1118 
  1105 
  1119     if (!DrawAll())
  1106     if (!DrawAll())
  1120         return NULL;
  1107         return NULL;
  1121     
  1108     
  1122 #ifdef MEDIAWALL_ORIENTATION_FIX    
  1109 #ifdef MEDIAWALL_ORIENTATION_FIX    
  1123     return iEGL->GetSurfaceToBitmap(
  1110     return iEGL->GetSurfaceToBitmap(iRect, 
  1124             iRect, 
  1111             iMediaWallStyle == EHgVgMediaWallStyleCoverflowFullScreen);        
  1125             iRotatedDraw && (iMediaWallStyle == EHgVgMediaWallStyleCoverflowFullScreen) );        
       
  1126 #else
  1112 #else
  1127     return iEGL->GetSurfaceToBitmap(iRect, EFalse);            
  1113     return iEGL->GetSurfaceToBitmap(iRect, EFalse);            
  1128 #endif
  1114 #endif
  1129     
  1115     
  1130     }
  1116     }
  1602     
  1588     
  1603     iScrollBar->SetViewPosition( TPoint(iSelectedIndex, 0) );
  1589     iScrollBar->SetViewPosition( TPoint(iSelectedIndex, 0) );
  1604     
  1590     
  1605 #ifdef MEDIAWALL_ORIENTATION_FIX
  1591 #ifdef MEDIAWALL_ORIENTATION_FIX
  1606     iScrollBar->EnableLandscapeRendering( 
  1592     iScrollBar->EnableLandscapeRendering( 
  1607             iRotatedDraw 
  1593             iMediaWallStyle == CHgVgMediaWall::EHgVgMediaWallStyleCoverflowFullScreen );
  1608             && (iMediaWallStyle == CHgVgMediaWall::EHgVgMediaWallStyleCoverflowFullScreen) );
       
  1609 #endif
  1594 #endif
  1610     
  1595     
  1611     }
  1596     }
  1612 
  1597 
  1613 // ---------------------------------------------------------------------------
  1598 // ---------------------------------------------------------------------------
  2452     
  2437     
  2453     InitButtonsL();
  2438     InitButtonsL();
  2454     
  2439     
  2455     InitScrollBarL(EFalse);
  2440     InitScrollBarL(EFalse);
  2456 
  2441 
  2457 #ifdef MEDIAWALL_ORIENTATION_FIX
  2442 #ifdef MEDIAWALL_ORIENTATION_FIX    
  2458     iRenderer->EnableLandscapeMode(iRotatedDraw);
  2443     iRenderer->EnableLandscapeMode(ETrue);
  2459     iAlbumLabel->EnableLandscapeRendering(iRotatedDraw);
  2444     iAlbumLabel->EnableLandscapeRendering(ETrue);
  2460     iArtistLabel->EnableLandscapeRendering(iRotatedDraw);
  2445     iArtistLabel->EnableLandscapeRendering(ETrue);
  2461     iEmptyLabel->EnableLandscapeRendering(iRotatedDraw);
  2446     iEmptyLabel->EnableLandscapeRendering(ETrue);
  2462     iSkinRenderer->EnableLanscapeRendering(iRotatedDraw);
  2447     iSkinRenderer->EnableLanscapeRendering(ETrue);
  2463     iScrollBar->EnableLandscapeRendering(iRotatedDraw);
  2448     iScrollBar->EnableLandscapeRendering(ETrue);
  2464     iHideSKButton->EnableLandscapeRendering(iRotatedDraw);
  2449     iHideSKButton->EnableLandscapeRendering(ETrue);
  2465     iLetterPopup->EnableLandscapeRendering(iRotatedDraw);
  2450     iLetterPopup->EnableLandscapeRendering(ETrue);
  2466 #endif
  2451 #endif
  2467     
  2452     
  2468     }
  2453     }
  2469 
  2454 
  2470 // -----------------------------------------------------------------------------
  2455 // -----------------------------------------------------------------------------