|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "MemSpyViewThreadInfoItemCodeSeg.h" |
|
19 |
|
20 // Engine includes |
|
21 #include <memspy/engine/memspyengine.h> |
|
22 #include <memspy/engine/memspyengineobjectprocess.h> |
|
23 #include <memspy/engine/memspyengineobjectthread.h> |
|
24 #include <memspy/engine/memspyengineobjectcontainer.h> |
|
25 #include <memspy/engine/memspyengineobjectthreadinfoobjects.h> |
|
26 #include <memspy/engine/memspyengineobjectthreadinfocontainer.h> |
|
27 #include <memspy/engine/memspyenginehelperprocess.h> |
|
28 #include <memspy/engine/memspyenginehelpercodesegment.h> |
|
29 |
|
30 // User includes |
|
31 #include "MemSpyContainerObserver.h" |
|
32 #include "MemSpyViewCodeSegList.h" |
|
33 |
|
34 |
|
35 |
|
36 CMemSpyViewThreadInfoItemCodeSeg::CMemSpyViewThreadInfoItemCodeSeg( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer ) |
|
37 : CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeCodeSeg ) |
|
38 { |
|
39 } |
|
40 |
|
41 |
|
42 TBool CMemSpyViewThreadInfoItemCodeSeg::HandleCommandL( TInt aCommand ) |
|
43 { |
|
44 TBool handled = CMemSpyViewBase::HandleCommandL( aCommand ); |
|
45 return handled; |
|
46 } |
|
47 |
|
48 |
|
49 CMemSpyViewBase* CMemSpyViewThreadInfoItemCodeSeg::PrepareChildViewL() |
|
50 { |
|
51 CMemSpyViewBase* child = NULL; |
|
52 |
|
53 // Get the code segment list |
|
54 CMemSpyThreadInfoCodeSeg* codeSegInfoItem = static_cast< CMemSpyThreadInfoCodeSeg* >( iInfoItem ); |
|
55 CMemSpyEngineCodeSegList* list = &codeSegInfoItem->List(); |
|
56 |
|
57 // Get the current code segment that corresponds to our currently focused list item. |
|
58 const TInt index = iListBox->CurrentItemIndex(); |
|
59 if ( index >= 0 && index < list->Count() ) |
|
60 { |
|
61 CMemSpyEngineCodeSegEntry& entry = list->At( index ); |
|
62 child = new(ELeave) CMemSpyViewCodeSegDetails( iEngine, iObserver, *list, entry ); |
|
63 |
|
64 // Ownership is transferred to child. Cleanupstack guarantees it will be destroyed now. |
|
65 // This object is about to die in any case. |
|
66 codeSegInfoItem->NullifyList(); |
|
67 |
|
68 CleanupStack::PushL( child ); |
|
69 child->ConstructL( Rect(), *Parent() ); |
|
70 CleanupStack::Pop( child ); |
|
71 } |
|
72 |
|
73 return child; |
|
74 } |
|
75 |
|
76 |