javauis/mmapi_qt/baseline/src/cmmacamerawindow.cpp
changeset 26 dc7c549001d5
parent 23 98ccebc37403
child 56 abc41079b313
--- a/javauis/mmapi_qt/baseline/src/cmmacamerawindow.cpp	Fri May 14 15:47:24 2010 +0300
+++ b/javauis/mmapi_qt/baseline/src/cmmacamerawindow.cpp	Thu May 27 12:49:31 2010 +0300
@@ -41,7 +41,7 @@
 const TInt KErrorIconMargin = 5; //5 pixels
 
 
-_LIT(KCameraAppBitmapFile, "z:\\resource\\apps\\cameraapp.mif");
+//_LIT(KCameraAppBitmapFile, "z:\\resource\\apps\\cameraapp.mif");
 
 
 // ---------------------------------------------------------------------------
@@ -99,16 +99,16 @@
     {
         if (iStarted)
         {
-          //  iDisplay->UIGetCallback(
-          //      *this, CMMACameraWindow::EShowViewFinder);
+            //  iDisplay->UIGetCallback(
+            //      *this, CMMACameraWindow::EShowViewFinder);
             LOG(EJavaMMAPI,EInfo,"CMMACameraWindow::SetStarted : before GetCallbackInUiThread + EShowViewFinder");
             iDisplay->GetCallbackInUiThread((TInt)CMMACameraWindow::EShowViewFinder);
             LOG(EJavaMMAPI,EInfo,"CMMACameraWindow::SetStarted : before GetCallbackInUiThread  - EShowViewFinder");
         }
         else
         {
-         //   iDisplay->UIGetCallback(
-         //       *this, CMMACameraWindow::EHideViewFinder);
+            //   iDisplay->UIGetCallback(
+            //       *this, CMMACameraWindow::EHideViewFinder);
             LOG(EJavaMMAPI,EInfo,"CMMACameraWindow::SetStarted : before GetCallbackInUiThread + EHideViewFinder");
             iDisplay->GetCallbackInUiThread((TInt)CMMACameraWindow::EHideViewFinder);
             LOG(EJavaMMAPI,EInfo,"CMMACameraWindow::SetStarted : before GetCallbackInUiThread  - EHideViewFinder");
@@ -147,10 +147,10 @@
                                          "()I");
 
              iJni->CallIntMethod(iJavaDisplayObject,releaseUiResourceID);*/
-             //MMAPI UI 3.x req.
-			       LOG(EJavaMMAPI,EInfo,"CMMACameraWindow::SetDisplay : before GetCallbackInUiThread +");
-             iDisplay->GetCallbackInUiThread((TInt)CMMACameraWindow::EDeleteViewFinder);
-             LOG(EJavaMMAPI,EInfo,"CMMACameraWindow::SetDisplay : before GetCallbackInUiThread  -");
+            //MMAPI UI 3.x req.
+            LOG(EJavaMMAPI,EInfo,"CMMACameraWindow::SetDisplay : before GetCallbackInUiThread +");
+            iDisplay->GetCallbackInUiThread((TInt)CMMACameraWindow::EDeleteViewFinder);
+            LOG(EJavaMMAPI,EInfo,"CMMACameraWindow::SetDisplay : before GetCallbackInUiThread  -");
         }
 
         // Set the new Display
@@ -159,7 +159,7 @@
         if (iDisplay)
         {
             // Get a DSA resources for the new Display
-        //    iDisplay->UIGetDSAResources(*this, MMMADisplay::EMmaThread);
+            //    iDisplay->UIGetDSAResources(*this, MMMADisplay::EMmaThread);
 
         }
     }
@@ -201,9 +201,9 @@
 {
     // MMAPI thread
     LOG2(EJavaMMAPI,EInfo,"MMA::CMMACameraWindow::SetDrawRect TL:%d,%d",
-               aRect.iTl.iX, aRect.iTl.iY);
+         aRect.iTl.iX, aRect.iTl.iY);
     LOG2(EJavaMMAPI,EInfo,"MMA::CMMACameraWindow::SetDrawRect BR:%d,%d",
-               aRect.iBr.iX, aRect.iBr.iY);
+         aRect.iBr.iX, aRect.iBr.iY);
 
     iDrawRect = aRect;
 
@@ -226,10 +226,10 @@
 //
 void CMMACameraWindow::SetDrawRectThread(const TRect& aRect)
 {
-    LOG2( EJavaMMAPI, EInfo, "MMA::CMMACameraWindow::SetDrawRectThread TL:%d,%d",
-               aRect.iTl.iX, aRect.iTl.iY);
-    LOG2( EJavaMMAPI, EInfo, "MMA::CMMACameraWindow::SetDrawRectThread BR:%d,%d",
-               aRect.iBr.iX, aRect.iBr.iY);
+    LOG2(EJavaMMAPI, EInfo, "MMA::CMMACameraWindow::SetDrawRectThread TL:%d,%d",
+         aRect.iTl.iX, aRect.iTl.iY);
+    LOG2(EJavaMMAPI, EInfo, "MMA::CMMACameraWindow::SetDrawRectThread BR:%d,%d",
+         aRect.iBr.iX, aRect.iBr.iY);
 
     // Note: Runs in UI thread only
 
@@ -304,7 +304,7 @@
         {
             if (aVisible)
             {
-               // iDisplay->UIGetCallback(
+                // iDisplay->UIGetCallback(
                 //    *this, CMMACameraWindow::EShowViewFinder);
                 LOG(EJavaMMAPI,EInfo,"CMMACameraWindow::SetVisible : before GetCallbackInUiThread - EShowViewFinder");
                 iDisplay->GetCallbackInUiThread((TInt)CMMACameraWindow::EShowViewFinder);
@@ -312,8 +312,8 @@
             }
             else
             {
-               // iDisplay->UIGetCallback(
-               //     *this, CMMACameraWindow::EHideViewFinder);
+                // iDisplay->UIGetCallback(
+                //     *this, CMMACameraWindow::EHideViewFinder);
                 LOG(EJavaMMAPI,EInfo,"CMMACameraWindow::SetVisible : before GetCallbackInUiThread - EHideViewFinder");
                 iDisplay->GetCallbackInUiThread((TInt)CMMACameraWindow::EHideViewFinder);
                 LOG(EJavaMMAPI,EInfo,"CMMACameraWindow::SetVisible : before GetCallbackInUiThread  - EHideViewFinder");
@@ -333,10 +333,10 @@
     const TRect& aRect,
     MMMADisplay::TThreadType aThreadType)
 {
-    LOG2( EJavaMMAPI, EInfo, "MMA::CMMACameraWindow::SetWindowRect TL:%d,%d",
-               aRect.iTl.iX, aRect.iTl.iY);
-    LOG2( EJavaMMAPI, EInfo, "MMA::CMMACameraWindow::SetWindowRect BR:%d,%d",
-               aRect.iBr.iX, aRect.iBr.iY);
+    LOG2(EJavaMMAPI, EInfo, "MMA::CMMACameraWindow::SetWindowRect TL:%d,%d",
+         aRect.iTl.iX, aRect.iTl.iY);
+    LOG2(EJavaMMAPI, EInfo, "MMA::CMMACameraWindow::SetWindowRect BR:%d,%d",
+         aRect.iBr.iX, aRect.iBr.iY);
 
     if (iClientRect != aRect)
     {
@@ -348,8 +348,8 @@
         }
         else
         {
-          //  iDisplay->UIGetCallback(
-          //      *this, CMMACameraWindow::EResetViewFinder);
+            //  iDisplay->UIGetCallback(
+            //      *this, CMMACameraWindow::EResetViewFinder);
             LOG(EJavaMMAPI,EInfo,"CMMACameraWindow::SetWindowRect : before GetCallbackInUiThread + EResetViewFinder");
             iDisplay->GetCallbackInUiThread((TInt)CMMACameraWindow::EHideViewFinder);
             LOG(EJavaMMAPI,EInfo,"CMMACameraWindow::SetWindowRect : before GetCallbackInUiThread  - EResetViewFinder");
@@ -413,7 +413,7 @@
     if (!iUICamera && iDisplay)
     {
         // Get a DSA stuff for the new Display
-       // iDisplay->UIGetDSAResources(*this, MMMADisplay::EUiThread);
+        // iDisplay->UIGetDSAResources(*this, MMMADisplay::EUiThread);
     }
 }
 
@@ -457,7 +457,7 @@
 //
 void CMMACameraWindow::PowerOnComplete(TInt aError)
 {
-    ELOG1( EJavaMMAPI, "MMA::CMMACameraWindow::PowerOnComplete %d", aError);
+    ELOG1(EJavaMMAPI, "MMA::CMMACameraWindow::PowerOnComplete %d", aError);
 
     if (aError == KErrNone)
     {
@@ -582,9 +582,9 @@
         TRAPD(error, iUICamera =
                   CCamera::NewDuplicateL(*this, iCameraHandle));
 
-        ELOG1( EJavaMMAPI, 
-            "MMA::CMMACameraWindow::UIStartViewFinder - NewDuplicateL %d",
-            error);
+        ELOG1(EJavaMMAPI,
+              "MMA::CMMACameraWindow::UIStartViewFinder - NewDuplicateL %d",
+              error);
 
         if (error == KErrNone)
         {
@@ -602,8 +602,8 @@
 //
 void CMMACameraWindow::SetViewFinderVisibility(TBool aVisible)
 {
-    LOG1( EJavaMMAPI, EInfo, "MMA::CMMACameraWindow::SetViewFinderVisibility - %d",
-              aVisible);
+    LOG1(EJavaMMAPI, EInfo, "MMA::CMMACameraWindow::SetViewFinderVisibility - %d",
+         aVisible);
 
     if (!iUICamera || !iCameraPowerOn || iViewFinderVisible == aVisible)
     {
@@ -629,9 +629,9 @@
 
             if (timerErr != KErrNone)
             {
-             ELOG1( EJavaMMAPI, 
-            "MMA::CMMACameraWindow::SetViewFinderVisibility - timer error = %d",
-            timerErr);	
+                ELOG1(EJavaMMAPI,
+                      "MMA::CMMACameraWindow::SetViewFinderVisibility - timer error = %d",
+                      timerErr);
                 __ASSERT_DEBUG(EFalse, User::Invariant());
             }
         }
@@ -696,12 +696,12 @@
 void CMMACameraWindow::SetRWindowRect(const TRect& aRect,
                                       MMMADisplay::TThreadType aThreadType)
 {
-    ELOG2( EJavaMMAPI, 
-            "MID::CMMACameraWindow::SetRWindowRect TL %d %d",
-               aRect.iTl.iX, aRect.iTl.iY);
-	ELOG2( EJavaMMAPI, 
-            "MID::CMMACameraWindow::SetRWindowRect BR %d %d",
-               aRect.iBr.iX, aRect.iBr.iY);	   	
+    ELOG2(EJavaMMAPI,
+          "MID::CMMACameraWindow::SetRWindowRect TL %d %d",
+          aRect.iTl.iX, aRect.iTl.iY);
+    ELOG2(EJavaMMAPI,
+          "MID::CMMACameraWindow::SetRWindowRect BR %d %d",
+          aRect.iBr.iX, aRect.iBr.iY);
     iRWindowRect = aRect;
 
     if (MMMADisplay::EMmaThread == aThreadType)
@@ -709,7 +709,7 @@
         if (iDisplay)
         {
             //iDisplay->UIGetCallback(*this,
-           //                         CMMACameraWindow::EResetViewFinder);
+            //                         CMMACameraWindow::EResetViewFinder);
         }
     }
     else if (MMMADisplay::EUiThread == aThreadType)
@@ -744,14 +744,14 @@
     TRect drawRect(iDrawRect);
     drawRect.Move(relativeClientRect.iTl);
 
-    LOG2( EJavaMMAPI, EInfo, 
-        "MMA::CMMACameraWindow::StartViewFinder - Starting VF TL:%d,%d",
-        drawRect.iTl.iX,
-        drawRect.iTl.iY);
-    LOG2( EJavaMMAPI, EInfo, 
-        "MMA::CMMACameraWindow::StartViewFinder - Starting VF BR:%d,%d",
-        drawRect.iBr.iX,
-        drawRect.iBr.iY);
+    LOG2(EJavaMMAPI, EInfo,
+         "MMA::CMMACameraWindow::StartViewFinder - Starting VF TL:%d,%d",
+         drawRect.iTl.iX,
+         drawRect.iTl.iY);
+    LOG2(EJavaMMAPI, EInfo,
+         "MMA::CMMACameraWindow::StartViewFinder - Starting VF BR:%d,%d",
+         drawRect.iBr.iX,
+         drawRect.iBr.iY);
 
     TRAPD(vfError, iUICamera->StartViewFinderDirectL(
               *iWs, *iScreenDevice, *iWindow, drawRect));
@@ -762,8 +762,8 @@
     }
     else
     {
-        LOG1( EJavaMMAPI, EInfo, 
-            "MMA::CMMACameraWindow::StartViewFinder()  - \
+        LOG1(EJavaMMAPI, EInfo,
+             "MMA::CMMACameraWindow::StartViewFinder()  - \
 StartViewFinderDirectL error=%d", vfError);
 
         TRAP_IGNORE(DrawViewFinderErrorL(vfError, drawRect));
@@ -820,17 +820,17 @@
                 delete iErrorIconMaskBitmap;
                 iErrorIconMaskBitmap = NULL;
             }
-/*
-            AknsUtils::CreateIconL(
-                AknsUtils::SkinInstance(),
-                KAknsIIDQgnIndiCam4Camera,
-                iErrorIconBitmap,
-                iErrorIconMaskBitmap,
-                KCameraAppBitmapFile,
-                EMbmCameraappQgn_indi_cam4_camera,
-                EMbmCameraappQgn_indi_cam4_camera_mask
-            );
-            */
+            /*
+                        AknsUtils::CreateIconL(
+                            AknsUtils::SkinInstance(),
+                            KAknsIIDQgnIndiCam4Camera,
+                            iErrorIconBitmap,
+                            iErrorIconMaskBitmap,
+                            KCameraAppBitmapFile,
+                            EMbmCameraappQgn_indi_cam4_camera,
+                            EMbmCameraappQgn_indi_cam4_camera_mask
+                        );
+                        */
         }
 
         //TRect iconRect