int AbstractManager::commandCount(int severity) { int count=0; if(severity != -1) { CommandQueue* queue = mHashCommandQueues.value(severity,0); if(queue) { count = queue->count(); } } else { foreach(int sever,mHashCommandQueues.keys()) { count += commandCount(sever); } } return count; }
// --------------------------------------------------------------------------- // ExecuteCommandsL // --------------------------------------------------------------------------- // void CAlfHierarchyModel::ExecuteCommandsL( TBool aCompositionModified ) { if ( !iStream ) { return; } TInt offset = iStream->Source()->TellL( MStreamBuf::ERead ).Offset(); #ifdef _ALF_LOGGING TInt commandCount(0); TSgcCanvasCommands previousCommand; #endif TSgcCanvasCommands command = EAlfCommandNotInitialized; TTime beginTime; beginTime.HomeTime(); __ALFLOGSTRING1( "CAlfHierarchyModel::ExecuteCommandsL - Committed write offset: %d", iChunkHeader->iCommittedWriteOffset ); while( iChunkHeader->iCommittedWriteOffset != offset ) { #ifdef _ALF_LOGGING previousCommand = command; #endif TRAPD( err, command = (TSgcCanvasCommands)iStream->ReadUint8L(); iScreenNumber = iStream->ReadUint8L(); ); if ( err != KErrNone ) { #ifdef _ALF_LOGGING __ALFLOGSTRING3("CAlfHierarchyModel::ExecuteCommandsL - Cmd: %d, Previous Cmd: %d, Count: %d..", command, previousCommand, commandCount ); #endif __ALFLOGSTRING2("..CAlfHierarchyModel::ExecuteCommandsL - Offset: %d, LEAVE WITH ERROR: %d", offset, err ); } #ifdef ALF_DEBUG_TRACK_DRAWING commandCount++; iUsedCommands[command]++; iCommandDebugger->SetDescription( command ); __ALFLOGSTRING3("CAlfHierarchyModel::ExecuteCommandsL (%d) %S offset: %d,", command, &iCommandDebugger->Text(), offset ); #endif switch ( command ) { case EAlfSetWindowId: { TUint32 nodeId = (TUint32)iStream->ReadUint32L(); CAlfNodeVisual* node = (CAlfNodeVisual*)FindNode( nodeId ); if ( node ) { #ifdef ALF_DEBUG_TRACK_DRAWING if (node->iId == iSearchNode || node->Tracking() ) { RDebug::Print( _L( "CAlfHierarchyModel::ExecuteCommandsL - Tracking")); } #endif #ifdef ALF_DEBUG_PRINT_NODE_INFO _LIT( KText, "Drawing"); // node->PrintInfo(0, node, TPtrC(KText) , iSearchNode); #endif node->DrawWindowFrameL( *iStream ); } else { ProcessUnknownNodeDrawingL( *iStream ); } break; } case EAlfNodeCreated: { DoNodeCreatedL(); break; } case EAlfNodeReleased: { DoNodeReleasedL(); break; } case EAlfNodeActivated: { DoNodeActivatedL(); break; } case EAlfNodeExtentChanged: { DoNodeExtentChangedL(); break; } case EAlfNodeSiblingOrderChanged: { DoNodeSiblingOrderChangedL(); break; } case EAlfNodeFlagChanged: { DoNodeFlagChangedL(); break; } case EAlfNodeFadeCountChanged: { DoNodeFadeCountChangedL(); break; } case EAlfNodeFadeAllChildren: { DoNodeFadeAllChildrenL(); break; } case EAlfNodeTransparentRegionChanged: { DoNodeTransparentRegionChangedL(); break; } case EAlfNodeLayerAdded: { DoNodeLayerAddedL(); break; } case EAlfNodeLayerExtentChanged: { DoNodeLayerExtentChangedL(); break; } case EAlfNodeLayerUsesAlphaFlagChanged: { DoNodeLayerUsesAlphaFlagChangedL(); break; } case EAlfNodeMovedToWindowGroup: { DoNodeMovedToWindowGroupL(); break; } case EAlfNodeWindowGroupChained: { DoNodeWindowGroupChainedL(); break; } case EAlfNodeWindowGroupChainBrokenAfter: { DoNodeWindowGroupChainBrokenAfterL(); break; } case EAlfWrap: { ReadEndMarkerL(); // futile, but just in case somet iStream->Source()->SeekL( MStreamBuf::ERead, TStreamPos(0)); iChunkHeader->iReadOffset = 0; break; } case EAlfNodeAttributeChanged: // currently only textcursor may receive these events { DoNodeAttributeChangedL(); break; } case EAlfNodeSetWindowArea: { DoNodeSetWindowAreaL(); } break; case EAlfCommitBatch: { RequestFrameEndCallback(aCompositionModified); break; } #ifdef ALF_DEBUG_TRACK_DRAWING case EAlfDebugTrackNode: { DoNodeDebugTrackL(); break; } #endif case EAlfDestroyChunk: { TInt chunkId = iStream->ReadInt32L(); iServer.Bridge()->AddData( EAlfReleaseTemporaryChunk, chunkId ); break; } case EAlfJumpToAnotherChunk: { RequestPacketEndCallback( offset ); TInt32 readChunkId = iStream->ReadInt32L(); TInt size = iStream->ReadInt32L(); ReadEndMarkerL(); // __ALFLOGSTRING1("Next chunk: %d, size: %d, previous chunk: %d"), readChunkId, size, iChunkInUse ); if ( readChunkId == 0 ) { iChunkHeader = reinterpret_cast<TChunkHeader*>(iChunk.Base()); iStream->Close(); iStream->Open( iChunk.Base() + sizeof( TChunkHeader), KChunkMaxSize ); iStream->Source()->SeekL( MStreamBuf::ERead, TStreamPos(0)); } else { iStream->Close(); iStream->Open( iCacheChunks.Find( readChunkId )->Base() + sizeof( TChunkHeader), size ); iChunkHeader = reinterpret_cast<TChunkHeader*>(iCacheChunks.Find( readChunkId )->Base()); } iChunkInUse = readChunkId; break; } default: { __ALFLOGSTRING("CAlfHierarchyModel::ExecuteCommandsL, off track"); #ifdef _ALF_LOGGING __ALFLOGSTRING3("CAlfHierarchyModel::ExecuteCommandsL, off track - Cmd: %d, Previous Cmd: %d, Count: %d..", command, previousCommand, commandCount ); #endif __ALFLOGSTRING1("..CAlfHierarchyModel::ExecuteCommandsL, unrecoverable error : HALTING at offset: %d", offset ); USER_INVARIANT(); break; } } ReadEndMarkerL(); offset = iStream->Source()->TellL( MStreamBuf::ERead ).Offset(); RequestPacketEndCallback( offset ); //__ALFLOGSTRING1("end offset %d offset %d, command %d"), aEndOffset, offset, command ); };