uiacceltk/hitchcock/CommonInc/alfmoduletest.h
branchRCL_3
changeset 7 433cbbb6a04b
parent 3 d8a3531bc6b8
child 8 10534483575f
--- a/uiacceltk/hitchcock/CommonInc/alfmoduletest.h	Mon Feb 22 17:57:49 2010 +0200
+++ b/uiacceltk/hitchcock/CommonInc/alfmoduletest.h	Fri Mar 12 15:47:04 2010 +0200
@@ -5,24 +5,30 @@
 #define ALFMODULETEST_H
 
 // Define this to build module testing enchanced version of ALF
-//#define USE_MODULE_TEST_HOOKS_FOR_ALF
+// #define USE_MODULE_TEST_HOOKS_FOR_ALF 
 
 #if !defined(USE_MODULE_TEST_HOOKS_FOR_ALF) || !defined(AMT_CONTROL)
 
 #define AMT_FUNC(func)                                
 #define AMT_FUNC_EXC(func)    
+#define AMT_FUNC_EXC_IF(cond, func)    
 #define AMT_INC_COUNTER(member)
 #define AMT_DEC_COUNTER(member)
 #define AMT_SET_VALUE(member, val)
 #define AMT_GET_VALUE(x, member)
+#define AMT_INC_COUNTER_IF(cond, member)
+#define AMT_DEC_COUNTER_IF(cond, member)
+#define AMT_SET_VALUE_IF(cond, member, val)
+#define AMT_GET_VALUE_IF(cond, x, member)
 #define AMT_PRINT_STATE()
 
 #ifndef AMT_CONTROL
 #error "Error: you need to define AMT_CONTROL macro in your code to be able to use ALF module test system!"
 // The user have to define AMT_CONTROL, e.g. like this:
-// #define AMT_CONTROL()                static_cast<CAlfModuleTestDataControl*>(Dll::Tls())
+// #define AMT_CONTROL() static_cast<CAlfModuleTestDataControl*>(Dll::Tls())
 // or
-// #define AMT_CONTROL()                iMyModuleTestDataControl
+// #define AMT_CONTROL() iMyModuleTestDataControl
+// etc.
 #endif
 
 #else
@@ -41,6 +47,7 @@
 #define AMT_DATA()                  AMT_CONTROL()->iModuleTestData
 #define AMT_FUNC(func)              if (AMT_DATA()->iIsEnabled) {func;}                                         
 #define AMT_FUNC_EXC(func)          {AMT_CONTROL()->Lock(); if (AMT_DATA()->iIsEnabled) {func;} AMT_CONTROL()->Unlock();}        
+#define AMT_FUNC_EXC_IF(cond, func) {AMT_CONTROL()->Lock(); if (AMT_DATA()->iIsEnabled && (cond)) {func;} AMT_CONTROL()->Unlock();}        
 
 // Single operation macros, that will do lock/unlock.
 #define AMT_INC_COUNTER(member)     AMT_FUNC_EXC(AMT_DATA()->member++)
@@ -49,6 +56,13 @@
 #define AMT_GET_VALUE(x, member)    AMT_FUNC_EXC((x) = AMT_DATA()->member)
 #define AMT_PRINT_STATE()           AMT_FUNC_EXC(AMT_DATA()->PrintState())
 
+// Conditional single operation macros, that will do lock/unlock.
+#define AMT_INC_COUNTER_IF(cond, member)    AMT_FUNC_EXC_IF((cond), AMT_DATA()->member++)
+#define AMT_DEC_COUNTER_IF(cond, member)    AMT_FUNC_EXC_IF((cond), AMT_DATA()->member--)
+#define AMT_SET_VALUE_IF(cond, member, val) AMT_FUNC_EXC_IF((cond), AMT_DATA()->member=(val))
+#define AMT_GET_VALUE_IF(cond, x, member)   AMT_FUNC_EXC_IF((cond), (x) = AMT_DATA()->member)
+
+
 // *** Global object names
 _LIT(KAlfModuleTestChunkName, "ALF_MODULE_TEST_CHUNK");
 _LIT(KAlfModuleTestMutexName, "ALF_MODULE_TEST_MUTEX");
@@ -66,16 +80,42 @@
         RDebug::Print(_L("iTotalLayerCount[0]=%d"), iTotalLayerCount[0]);
         RDebug::Print(_L("iTotalLayerCount[1]=%d"), iTotalLayerCount[1]);
         RDebug::Print(_L("iCloneLayerCount=%d"), iCloneLayerCount);
+        RDebug::Print(_L("iRsTotalNodeCount=%d"), iRsTotalNodeCount);
+        RDebug::Print(_L("iRsWindowGroupNodeCount=%d"), iRsWindowGroupNodeCount);
+        RDebug::Print(_L("iRsWindowNodeCount=%d"), iRsWindowNodeCount);
+        RDebug::Print(_L("iRsAnimNodeCount=%d"), iRsAnimNodeCount);
+        RDebug::Print(_L("iRsWindowNodeActivatedCount=%d"), iRsWindowNodeActivatedCount);
+        RDebug::Print(_L("iRsNodeExtentChangedCount=%d"), iRsNodeExtentChangedCount);
+        RDebug::Print(_L("iRsLatestNodeExtentRect= x:%d, y:%d, width=%d, height=%d"), 
+                         iRsLatestNodeExtentRect.iTl.iX, iRsLatestNodeExtentRect.iTl.iY, 
+                         iRsLatestNodeExtentRect.Width(), iRsLatestNodeExtentRect.Height());
+        RDebug::Print(_L("iRsTotalNodeFlagChangedCount=%d"), iRsTotalNodeFlagChangedCount);
+        RDebug::Print(_L("iRsTotalNodeAttributeChangedCount=%d"), iRsTotalNodeAttributeChangedCount);
         RDebug::Print(_L("iTotalNodeCount=%d"), iTotalNodeCount);
         RDebug::Print(_L("iWindowGroupNodeCount=%d"), iWindowGroupNodeCount);
         RDebug::Print(_L("iWindowNodeCount=%d"), iWindowNodeCount);
         RDebug::Print(_L("iAnimNodeCount=%d"), iAnimNodeCount);
+        RDebug::Print(_L("iWindowNodeActivatedCount=%d"), iWindowNodeActivatedCount);
+        RDebug::Print(_L("iNodeExtentChangedCount=%d"), iNodeExtentChangedCount);
+        RDebug::Print(_L("iLatestNodeExtentRect= x:%d, y:%d, width=%d, height=%d"), 
+                         iLatestNodeExtentRect.iTl.iX, iLatestNodeExtentRect.iTl.iY, 
+                         iLatestNodeExtentRect.Width(), iLatestNodeExtentRect.Height());
+        RDebug::Print(_L("iTotalNodeFlagChangedCount=%d"), iTotalNodeFlagChangedCount);
+        RDebug::Print(_L("iTotalNodeAttributeChangedCount=%d"), iTotalNodeAttributeChangedCount);        
         RDebug::Print(_L("iTotalVisualCount=%d"), iTotalVisualCount);
         RDebug::Print(_L("iVisibleVisualCount=%d"), iVisibleVisualCount);
         RDebug::Print(_L("iActiveVisualCount=%d"), iActiveVisualCount);
         RDebug::Print(_L("iPassiveVisualCount=%d"), iPassiveVisualCount);
         RDebug::Print(_L("iTextureCount=%d"), iTextureCount);
         RDebug::Print(_L("iRenderBufferCount=%d"), iRenderBufferCount);
+        RDebug::Print(_L("iTotalControlGroupCount=%d"), iTotalControlGroupCount);        
+        RDebug::Print(_L("iVisualSizeChangedCount=%d"), iVisualSizeChangedCount);        
+        RDebug::Print(_L("iVisualPositionChangedCount=%d"), iVisualPositionChangedCount);
+        RDebug::Print(_L("iLatestVisualExtentRect= x:%d, y:%d, width=%d, height=%d"), 
+                         iLatestVisualExtentRect.iTl.iX, iLatestVisualExtentRect.iTl.iY, 
+                         iLatestVisualExtentRect.Width(), iLatestVisualExtentRect.Height());
+        RDebug::Print(_L("iTotalVisualFlagChangedCount=%d"), iTotalVisualFlagChangedCount);
+        RDebug::Print(_L("iTotalVisualAttributeChangedCount=%d"), iTotalVisualAttributeChangedCount);        
         RDebug::Print(_L("*** ALF INTERNAL STATE ***"));
         }
     
@@ -87,20 +127,56 @@
     TInt iScreenCount;          // *** not yet implemented
     TInt iTotalLayerCount[10];  // For each screen
     TInt iCloneLayerCount;      // ** not yet implemented
-    
+    TInt iRsTotalNodeCount;
+    TInt iRsWindowGroupNodeCount;
+    TInt iRsWindowNodeCount;
+    TInt iRsAnimNodeCount;
+    TInt iRsWindowNodeActivatedCount;    
+    TInt iRsNodeExtentChangedCount;
+    TRect iRsLatestNodeExtentRect;
+    TInt iRsTotalNodeFlagChangedCount;
+    TInt iRsTotalNodeAttributeChangedCount;
+    // These are temporary variables for Alf Render Stage thread internal use only!
+    TInt iARS_Temp1;
+    TInt iARS_Temp2;
+    TInt iARS_Temp3;
+    TInt iARS_Temp4;
+   
     // Alf Streamer
-    TInt iTotalNodeCount;       // *** not yet implemented
-    TInt iWindowGroupNodeCount; // *** not yet implemented
-    TInt iWindowNodeCount;      // *** not yet implemented
-    TInt iAnimNodeCount;        // *** not yet implemented
-    
+    TInt iTotalNodeCount;
+    TInt iWindowGroupNodeCount;
+    TInt iWindowNodeCount;
+    TInt iAnimNodeCount;
+    TInt iWindowNodeActivatedCount;
+    TInt iNodeExtentChangedCount;
+    TRect iLatestNodeExtentRect;
+    TInt iTotalNodeFlagChangedCount;
+    TInt iTotalNodeAttributeChangedCount;
+    // These are temporary variables for Alf Streamer thread internal use only!
+    TInt iAST_Temp1;
+    TInt iAST_Temp2;
+    TInt iAST_Temp3;
+    TInt iAST_Temp4;
+   
     // Alf Server
-    TInt iTotalVisualCount;     // *** not yet implemented
-    TInt iVisibleVisualCount;   // *** not yet implemented
-    TInt iActiveVisualCount;    // Active visual count
-    TInt iPassiveVisualCount;   // Passive visual count
+    TInt iTotalVisualCount;
+    TInt iVisibleVisualCount;
+    TInt iActiveVisualCount;
+    TInt iPassiveVisualCount;
     TInt iTextureCount;         // *** not yet implemented
     TInt iRenderBufferCount;    // *** not yet implemented
+    TInt iTotalControlGroupCount;
+    TInt iVisualSizeChangedCount;
+    TInt iVisualPositionChangedCount;
+    TRect iLatestVisualExtentRect;
+    TInt iTotalVisualFlagChangedCount;
+    TInt iTotalVisualAttributeChangedCount;
+    TInt iOrdinalChange;
+    // These are temporary variables for Alf Server thread internal use only!
+    TInt iASE_Temp1;
+    TInt iASE_Temp2;
+    TInt iASE_Temp3;
+    TInt iASE_Temp4;
     };
 
 
@@ -124,6 +200,7 @@
      */
     TInt OpenGlobalObjects()
         {
+        RDebug::Print(_L("CAlfModuleTestDataControl::OpenGlobalObjects()."));
         // Open global module testing chunk
         TBool isReadOnly = EFalse;
         TInt err = iModuleTestChunk.OpenGlobal(KAlfModuleTestChunkName, isReadOnly);
@@ -136,7 +213,7 @@
                 iModuleTestData = reinterpret_cast<CAlfModuleTestData*>(iModuleTestChunk.Base());
                 }
             }
-        RDebug::Print(_L("CAlfModuleTestDataControl::OpenGlobalObjects. err=%d"), err);
+        RDebug::Print(_L("CAlfModuleTestDataControl::OpenGlobalObjects. ret=%d"), err);
         return err;
         }