camerauis/cameraapp/generic/src/CamPreCaptureContainerBase.cpp
changeset 1 f5ec9446e5bf
parent 0 1ddebce53859
child 2 e8773a61782d
equal deleted inserted replaced
0:1ddebce53859 1:f5ec9446e5bf
   234       PRINT( _L("Camera => CCamPreCaptureContainerBase::BaseConstructL - create iLocationIconController") )
   234       PRINT( _L("Camera => CCamPreCaptureContainerBase::BaseConstructL - create iLocationIconController") )
   235       iLocationIconController = CCamLocationIconController::NewL( iController, *this, ETrue, Locrect );
   235       iLocationIconController = CCamLocationIconController::NewL( iController, *this, ETrue, Locrect );
   236       SetLocationIndicatorVisibility();
   236       SetLocationIndicatorVisibility();
   237       }
   237       }
   238 
   238 
   239   TInt color;
   239   TBool dsaAlways = iController.IsDirectScreenVFSupported( ETrue ) && 
   240   TInt gray;
   240                     iController.IsDirectScreenVFSupported( EFalse );
   241   
   241                  
   242   TDisplayMode displaymode =
   242   if ( !dsaAlways )
   243       CEikonEnv::Static()->WsSession().GetDefModeMaxNumColors( color, gray );
   243       {
   244   
   244       // If bitmap VF is not possible in this configuration, 
   245   // set up the offscreen bitmap
   245       // offscreen bitmap is not needed
   246   iOffScreenBitmap = new ( ELeave ) CFbsBitmap();
   246       TInt color;
   247   
   247       TInt gray;
   248   User::LeaveIfError( iOffScreenBitmap->Create( Rect().Size(), EColor16MU/*displaymode*/ ) );
   248   
   249   
   249       TDisplayMode displaymode =
   250   PRINT1( _L("Camera => CCamPreCaptureContainerBase::BaseConstructL disp mode (%d)"), displaymode )
   250           CEikonEnv::Static()->WsSession().GetDefModeMaxNumColors( color, gray );
   251   iBitmapDevice = CFbsBitmapDevice::NewL( iOffScreenBitmap );
   251   
   252   User::LeaveIfError( iBitmapDevice->CreateContext( iBitmapGc ) );
   252       // set up the offscreen bitmap
       
   253       iOffScreenBitmap = new ( ELeave ) CFbsBitmap();  
       
   254   
       
   255       User::LeaveIfError( iOffScreenBitmap->Create( Rect().Size(), EColor16MU/*displaymode*/ ) );
       
   256   
       
   257       PRINT1( _L("Camera => CCamPreCaptureContainerBase::BaseConstructL disp mode (%d)"), displaymode )
       
   258       iBitmapDevice = CFbsBitmapDevice::NewL( iOffScreenBitmap );
       
   259       User::LeaveIfError( iBitmapDevice->CreateContext( iBitmapGc ) );
       
   260       }
   253 
   261 
   254   iRect = ViewFinderFrameRect();
   262   iRect = ViewFinderFrameRect();
   255   // if using direct viewfinding pass Rect to control
   263   // if using direct viewfinding pass Rect to control
   256 
   264 
   257 
   265 
   433         {
   441         {
   434         iController.SetDemandKeyRelease( EFalse ); 
   442         iController.SetDemandKeyRelease( EFalse ); 
   435         }
   443         }
   436 
   444 
   437     CCamAppUi* appUi = static_cast<CCamAppUi*>( iEikonEnv->AppUi() );
   445     CCamAppUi* appUi = static_cast<CCamAppUi*>( iEikonEnv->AppUi() );
   438 
   446 	__ASSERT_DEBUG(appUi, CamPanic(ECamPanicNullPointer) );
   439     if ( appUi && appUi->CheckCourtesyKeyEventL( aKeyEvent, aType, ETrue ) == EKeyWasConsumed )
   447     if ( appUi->CheckCourtesyKeyEventL( aKeyEvent, aType, ETrue ) == EKeyWasConsumed )
   440         {
   448         {
   441         PRINT( _L("Camera <= CCamPreCaptureContainerBase::OfferKeyEventL courtesy key") );
   449         PRINT( _L("Camera <= CCamPreCaptureContainerBase::OfferKeyEventL courtesy key") );
   442         return EKeyWasConsumed;
   450         return EKeyWasConsumed;
   443         }
   451         }
   444 
   452 
   478     else if ( EEventKey == aType
   486     else if ( EEventKey == aType
   479             && EKeyOK    == aKeyEvent.iCode
   487             && EKeyOK    == aKeyEvent.iCode
   480             && 0         == aKeyEvent.iRepeats )
   488             && 0         == aKeyEvent.iRepeats )
   481         {
   489         {
   482         TBool MSKCapture(EFalse);
   490         TBool MSKCapture(EFalse);
   483         if ( appUi && !appUi->IsToolBarVisible() && aKeyEvent.iScanCode == EStdKeyDevice3 )
   491         if ( !appUi->IsToolBarVisible() && aKeyEvent.iScanCode == EStdKeyDevice3 )
   484             {
   492             {
   485             MSKCapture = ETrue;
   493             MSKCapture = ETrue;
   486             }
   494             }
   487         if( appUi->ActiveCamera() == ECamActiveCameraPrimary
   495         if( appUi->ActiveCamera() == ECamActiveCameraPrimary
   488                 && !MSKCapture )
   496                 && !MSKCapture )