51
|
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 "MemSpyAppUi.h"
|
|
19 |
|
|
20 |
// System includes
|
|
21 |
#include <AknQueryDialog.h>
|
|
22 |
#include <aknmessagequerydialog.h>
|
|
23 |
#include <aknradiobuttonsettingpage.h>
|
|
24 |
#include <eikaufty.h>
|
|
25 |
#include <eikmenub.h>
|
|
26 |
#include <avkon.hrh>
|
|
27 |
#include <barsread.h>
|
|
28 |
#include <f32file.h>
|
|
29 |
#include <memspyui.rsg>
|
|
30 |
|
|
31 |
// Engine includes
|
|
32 |
#include <memspy/engine/memspyengine.h>
|
|
33 |
#include <memspy/engine/memspyengineoutputsink.h>
|
|
34 |
#include <memspy/engine/memspyengineobjectcontainer.h>
|
|
35 |
#include <memspy/engine/memspyengineobjectprocess.h>
|
|
36 |
#include <memspy/engine/memspyengineobjectthread.h>
|
|
37 |
#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
|
|
38 |
#include <memspy/engine/memspyenginehelperchunk.h>
|
|
39 |
#include <memspy/engine/memspyenginehelperthread.h>
|
|
40 |
#include <memspy/engine/memspyenginehelperprocess.h>
|
|
41 |
#include <memspy/engine/memspyenginehelperkernelcontainers.h>
|
|
42 |
#include <memspy/engine/memspyenginehelperfbserv.h>
|
|
43 |
#include <memspyengineclientinterface.h>
|
|
44 |
#include <memspy/driver/memspydriverenumerationsshared.h>
|
|
45 |
#include <memspy/engine/memspyenginehelperkernelcontainers.h>
|
|
46 |
//cigasto
|
|
47 |
#include <memspysession.h>
|
|
48 |
|
|
49 |
// User includes
|
|
50 |
#include "MemSpyContainer.h"
|
|
51 |
#include "MemSpyDocument.h"
|
|
52 |
#include "MemSpySettings.h"
|
|
53 |
#include "MemSpyDeviceWideOperationDialog.h"
|
|
54 |
#include "MemSpyViewRAMInfo.h" // for aknicon config check
|
|
55 |
#include "MemSpyExportBitmapsToMemoryCardDialog.h"
|
|
56 |
#include "MemSpy.hrh"
|
|
57 |
#include "viewcli.h"
|
|
58 |
|
|
59 |
// Constants
|
|
60 |
const TInt KMemSpyDefaultAutoCaptureTimerPeriod = 60;
|
|
61 |
const TUint32 KMemSpyEikSrvSID = 0x10003a4a;
|
|
62 |
|
|
63 |
/*
|
|
64 |
CMemSpyAppUi::CMemSpyAppUi( CMemSpyEngine& aEngine )
|
|
65 |
: iEngine( aEngine ), iAutoCaptureTimerPeriod( KMemSpyDefaultAutoCaptureTimerPeriod ), iAutoCaptureOperationType( CMemSpyDeviceWideOperations::EPerEntityHeapInfo )
|
|
66 |
{
|
|
67 |
iEngine.SetObserver( this );
|
|
68 |
}
|
|
69 |
*/
|
|
70 |
CMemSpyAppUi::CMemSpyAppUi( RMemSpySession &aSession )
|
|
71 |
: iMemSpySession( aSession ), iAutoCaptureTimerPeriod( KMemSpyDefaultAutoCaptureTimerPeriod ), iAutoCaptureOperationType( CMemSpyDeviceWideOperations::EPerEntityHeapInfo )
|
|
72 |
{
|
|
73 |
//iEngine.SetObserver( this );
|
|
74 |
}
|
|
75 |
|
|
76 |
CMemSpyAppUi::~CMemSpyAppUi()
|
|
77 |
{
|
|
78 |
RDebug::Printf( "[MemSpy] MemSpy is now closing." );
|
|
79 |
//
|
|
80 |
delete iAutoCaptureTimer;
|
|
81 |
//
|
|
82 |
if (iAppContainer)
|
|
83 |
{
|
|
84 |
RemoveFromStack( iAppContainer );
|
|
85 |
delete iAppContainer;
|
|
86 |
}
|
|
87 |
//
|
|
88 |
//iEngine.SetObserver( NULL );
|
|
89 |
SetViewServerTimeOutStatus( ETrue );
|
|
90 |
}
|
|
91 |
|
|
92 |
|
|
93 |
void CMemSpyAppUi::ConstructL()
|
|
94 |
{
|
|
95 |
BaseConstructL( EAknEnableSkin );
|
|
96 |
//
|
|
97 |
//iAppContainer = new (ELeave) CMemSpyContainer( iEngine, *this );
|
|
98 |
iAppContainer = new (ELeave) CMemSpyContainer( iMemSpySession, *this );
|
|
99 |
iAppContainer->SetMopParent(this);
|
|
100 |
iAppContainer->ConstructL( ClientRect() );
|
|
101 |
iAppContainer->SetObserver( this );
|
|
102 |
iAppContainer->SetFocus( ETrue );
|
|
103 |
AddToStackL( iAppContainer );
|
|
104 |
//
|
|
105 |
iAutoCaptureTimer = CPeriodic::NewL( CActive::EPriorityIdle );
|
|
106 |
//
|
|
107 |
iEikonEnv->SetSystem( ETrue );
|
|
108 |
//
|
|
109 |
SetViewServerTimeOutStatus( EFalse );
|
|
110 |
}
|
|
111 |
|
|
112 |
|
|
113 |
CMemSpyDocument& CMemSpyAppUi::MemSpyDocument()
|
|
114 |
{
|
|
115 |
CMemSpyDocument* doc = static_cast< CMemSpyDocument* >( Document() );
|
|
116 |
return *doc;
|
|
117 |
}
|
|
118 |
|
|
119 |
|
|
120 |
const CMemSpyDocument& CMemSpyAppUi::MemSpyDocument() const
|
|
121 |
{
|
|
122 |
const CMemSpyDocument* doc = static_cast< const CMemSpyDocument* >( Document() );
|
|
123 |
return *doc;
|
|
124 |
}
|
|
125 |
|
|
126 |
|
|
127 |
void CMemSpyAppUi::HandleStatusPaneSizeChange()
|
|
128 |
{
|
|
129 |
iAppContainer->SetRect( ClientRect() );
|
|
130 |
}
|
|
131 |
|
|
132 |
|
|
133 |
void CMemSpyAppUi::HandleControlEventL( CCoeControl* aControl, TCoeEvent /*aEventType*/ )
|
|
134 |
{
|
|
135 |
if ( aControl == iAppContainer )
|
|
136 |
{
|
|
137 |
UpdateCBAL();
|
|
138 |
}
|
|
139 |
}
|
|
140 |
|
|
141 |
|
|
142 |
void CMemSpyAppUi::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
|
|
143 |
{
|
|
144 |
CMemSpyViewBase& view = iAppContainer->ActiveView();
|
|
145 |
const TMemSpyViewType viewType = iAppContainer->ActiveViewType();
|
|
146 |
//
|
|
147 |
const TBool openableView = MemSpyViewTypeUtils::IsOpenableItem( viewType );
|
|
148 |
const TBool exitable = MemSpyViewTypeUtils::IsExitableView( viewType );
|
|
149 |
//
|
|
150 |
#ifdef _DEBUG
|
|
151 |
RDebug::Printf( "[MemSpy] CMemSpyAppUi::DynInitMenuPaneL() - START - aResourceId: 0x%08x (%8d), iAutoCaptureOperationType: %d, iAutoCaptureTimer is active: %d, viewType: %d, openableView: %d, exitable: %d", aResourceId, aResourceId, iAutoCaptureOperationType, iAutoCaptureTimer->IsActive(), viewType, openableView, exitable );
|
|
152 |
#endif
|
|
153 |
//
|
|
154 |
if ( aResourceId == R_MEMSPY_MENUPANE )
|
|
155 |
{
|
|
156 |
const TInt count = aMenuPane->NumberOfItemsInPane();
|
|
157 |
for( TInt i=0; i<count; i++ )
|
|
158 |
{
|
|
159 |
TBool dimItem = EFalse;
|
|
160 |
CEikMenuPaneItem::SData& menuPaneMetaData = aMenuPane->ItemDataByIndexL( i );
|
|
161 |
|
|
162 |
// If the command is inside the view-specific range then we'll hide it
|
|
163 |
// unless the view and command id matches.
|
|
164 |
const TBool isViewSpecific = ( menuPaneMetaData.iCommandId >= KMemSpyMenuCommandViewSpecific );
|
|
165 |
if ( isViewSpecific )
|
|
166 |
{
|
|
167 |
// Check whether this view requires this command item.
|
|
168 |
dimItem = ( view.MenuCascadeCommandId() != menuPaneMetaData.iCommandId );
|
|
169 |
}
|
|
170 |
|
|
171 |
aMenuPane->SetItemDimmed( menuPaneMetaData.iCommandId, dimItem );
|
|
172 |
}
|
|
173 |
|
|
174 |
aMenuPane->SetItemDimmed( EMemSpyCmdOpen, !openableView );
|
|
175 |
aMenuPane->SetItemDimmed( EAknSoftkeyBack, exitable );
|
|
176 |
aMenuPane->SetItemDimmed( EAknCmdExit, !exitable );
|
|
177 |
}
|
|
178 |
else if ( aResourceId == R_MEMSPY_MENUPANE_TOOLS )
|
|
179 |
{
|
|
180 |
const TBool inOpenFilesView = ( viewType == EMemSpyViewTypeOpenFiles );
|
|
181 |
aMenuPane->SetItemDimmed( EMemSpyCmdToolsListOpenFiles, !inOpenFilesView );
|
|
182 |
}
|
|
183 |
else if ( aResourceId == R_MEMSPY_MENUPANE_VIEW )
|
|
184 |
{
|
|
185 |
// Hide the refresh item when in the thread info container view
|
|
186 |
aMenuPane->SetItemDimmed( EMemSpyCmdViewRefresh, viewType == EMemSpyViewTypeThreadInfoItemList );
|
|
187 |
aMenuPane->SetItemDimmed( EMemSpyCmdViewOutputToSink, viewType == EMemSpyViewTypeThreadInfoItemList );
|
|
188 |
}
|
|
189 |
else if ( aResourceId == R_MEMSPY_MENUPANE_OUTPUT )
|
|
190 |
{
|
|
191 |
TMemSpySinkType currentSink;
|
|
192 |
iMemSpySession.GetOutputSink( currentSink );
|
|
193 |
aMenuPane->SetItemDimmed( EMemSpyCmdOutputToDebug, currentSink == ESinkTypeDebug );
|
|
194 |
aMenuPane->SetItemDimmed( EMemSpyCmdOutputToFile, currentSink == ESinkTypeFile );
|
|
195 |
}
|
|
196 |
else if ( aResourceId == R_MEMSPY_MENUPANE_AUTO_CAPTURE )
|
|
197 |
{
|
|
198 |
// Change the auto-capture toggle caption appropriately...
|
|
199 |
TInt resId = R_MEMSPY_AUTO_CAPTURE_ENABLE;
|
|
200 |
if ( iAutoCaptureTimer->IsActive() )
|
|
201 |
{
|
|
202 |
resId = R_MEMSPY_AUTO_CAPTURE_DISABLE;
|
|
203 |
}
|
|
204 |
aMenuPane->SetItemTextL( EMemSpyCmdAutoCaptureToggle, resId );
|
|
205 |
}
|
|
206 |
|
|
207 |
#ifdef _DEBUG
|
|
208 |
RDebug::Printf( "[MemSpy] CMemSpyAppUi::DynInitMenuPaneL() - sending to view..." );
|
|
209 |
#endif
|
|
210 |
|
|
211 |
view.DynInitMenuPaneL( aResourceId, aMenuPane );
|
|
212 |
|
|
213 |
#ifdef _DEBUG
|
|
214 |
RDebug::Printf( "[MemSpy] CMemSpyAppUi::DynInitMenuPaneL() - END - aResourceId: 0x%08x (%8d), iAutoCaptureOperationType: %d, iAutoCaptureTimer is active: %d, viewType: %d, openableView: %d, exitable: %d", aResourceId, aResourceId, iAutoCaptureOperationType, iAutoCaptureTimer->IsActive(), viewType, openableView, exitable );
|
|
215 |
#endif
|
|
216 |
}
|
|
217 |
|
|
218 |
|
|
219 |
TKeyResponse CMemSpyAppUi::HandleKeyEventL( const TKeyEvent& /*aKeyEvent*/, TEventCode /*aType*/ )
|
|
220 |
{
|
|
221 |
return EKeyWasNotConsumed;
|
|
222 |
}
|
|
223 |
|
|
224 |
|
|
225 |
void CMemSpyAppUi::HandleCommandL( TInt aCommand )
|
|
226 |
{
|
|
227 |
#ifdef _DEBUG
|
|
228 |
RDebug::Printf( "[MemSpy] CMemSpyAppUi::HandleCommandL() - START - aCommand: %8d, iAutoCaptureOperationType: %d, iAutoCaptureTimer is active: %d", aCommand, iAutoCaptureOperationType, iAutoCaptureTimer->IsActive() );
|
|
229 |
#endif
|
|
230 |
|
|
231 |
switch ( aCommand )
|
|
232 |
{
|
|
233 |
case EAknSoftkeyBack:
|
|
234 |
OnCmdBackL();
|
|
235 |
break;
|
|
236 |
|
|
237 |
case EEikCmdExit:
|
|
238 |
case EAknCmdExit:
|
|
239 |
case EAknSoftkeyExit:
|
|
240 |
OnCmdExitL();
|
|
241 |
break;
|
|
242 |
|
|
243 |
case EMemSpyCmdOpen:
|
|
244 |
OnCmdOpenL();
|
|
245 |
break;
|
|
246 |
|
|
247 |
case EMemSpyCmdOutputToDebug:
|
|
248 |
OnCmdOutputToDebugL();
|
|
249 |
break;
|
|
250 |
case EMemSpyCmdOutputToFile:
|
|
251 |
OnCmdOutputToFileL();
|
|
252 |
break;
|
|
253 |
|
|
254 |
case EMemSpyCmdToolsAbout:
|
|
255 |
OnCmdAboutL();
|
|
256 |
break;
|
|
257 |
//
|
|
258 |
case EMemSpyCmdPhoneInfoGeneralSummary:
|
|
259 |
//OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityGeneralSummary );
|
|
260 |
OnCmdPhoneInformationOperationL( OutputPhoneInfo );
|
|
261 |
break;
|
|
262 |
case EMemSpyCmdPhoneInfoGeneralDetailed:
|
|
263 |
//OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityGeneralDetailed );
|
|
264 |
OnCmdPhoneInformationOperationL( OutputDetailedPhoneInfo );
|
|
265 |
break;
|
|
266 |
/*
|
|
267 |
case EMemSpyCmdPhoneInfoGeneralHandles:
|
|
268 |
OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityGeneralHandles );
|
|
269 |
break;
|
|
270 |
case EMemSpyCmdPhoneInfoGeneralKernelContainers:
|
|
271 |
OnCmdPhoneInformationOperationKernelContainersL();
|
|
272 |
break;
|
|
273 |
//
|
|
274 |
*/
|
|
275 |
case EMemSpyCmdPhoneInfoHeapInfoSummary:
|
|
276 |
//OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityHeapInfo );
|
|
277 |
OnCmdPhoneInformationOperationL (OutputHeapInfo );
|
|
278 |
break;
|
|
279 |
case EMemSpyCmdPhoneInfoHeapInfoCompact:
|
|
280 |
//OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EEntireDeviceHeapInfoCompact );
|
|
281 |
OnCmdPhoneInformationOperationL( OutputCompactHeapInfo );
|
|
282 |
break;
|
|
283 |
case EMemSpyCmdPhoneInfoHeapCellListing:
|
|
284 |
//OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityHeapCellListing );
|
|
285 |
OnCmdPhoneInformationOperationL( OutputHeapCellListing );
|
|
286 |
break;
|
|
287 |
|
|
288 |
case EMemSpyCmdPhoneInfoHeapDump:
|
|
289 |
//OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityHeapData );
|
|
290 |
OnCmdPhoneInformationOperationL( OutputHeapData );
|
|
291 |
break;
|
|
292 |
//
|
|
293 |
case EMemSpyCmdPhoneInfoStackInfo:
|
|
294 |
//OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityStackInfo );
|
|
295 |
OnCmdPhoneInformationOperationL( OutputStackInfo );
|
|
296 |
break;
|
|
297 |
case EMemSpyCmdPhoneInfoStackInfoCompact:
|
|
298 |
//OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EEntireDeviceStackInfoCompact );
|
|
299 |
OnCmdPhoneInformationOperationL( OutputCompactStackInfo );
|
|
300 |
break;
|
|
301 |
case EMemSpyCmdPhoneInfoStackDumpUser:
|
|
302 |
//OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityStackDataUser );
|
|
303 |
OnCmdPhoneInformationOperationL( OutputUserStackData );
|
|
304 |
break;
|
|
305 |
case EMemSpyCmdPhoneInfoStackDumpKernel:
|
|
306 |
//OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityStackDataKernel );
|
|
307 |
OnCmdPhoneInformationOperationL( OutputKernelStackData );
|
|
308 |
break;
|
|
309 |
|
|
310 |
case EMemSpyCmdAutoCaptureToggle:
|
|
311 |
OnCmdAutoCaptureToggleL();
|
|
312 |
break;
|
|
313 |
case EMemSpyCmdAutoCaptureRetryTime:
|
|
314 |
OnCmdAutoCaptureRetryTimeL();
|
|
315 |
break;
|
|
316 |
case EMemSpyCmdAutoCaptureOperationType:
|
|
317 |
OnCmdAutoCaptureOperationTypeL();
|
|
318 |
break;
|
|
319 |
|
|
320 |
default:
|
|
321 |
iAppContainer->HandleCommandL( aCommand );
|
|
322 |
break;
|
|
323 |
}
|
|
324 |
|
|
325 |
#ifdef _DEBUG
|
|
326 |
RDebug::Printf( "[MemSpy] CMemSpyAppUi::HandleCommandL() - END - aCommand: %8d, iAutoCaptureOperationType: %d, iAutoCaptureTimer is active: %d", aCommand, iAutoCaptureOperationType, iAutoCaptureTimer->IsActive() );
|
|
327 |
#endif
|
|
328 |
}
|
|
329 |
|
|
330 |
|
|
331 |
void CMemSpyAppUi::HandleForegroundEventL( TBool aForeground)
|
|
332 |
{
|
|
333 |
// Refresh the container when coming to the foreground
|
|
334 |
if ( aForeground )
|
|
335 |
{
|
|
336 |
iAppContainer->OnCmdViewRefreshL();
|
|
337 |
}
|
|
338 |
}
|
|
339 |
|
|
340 |
|
|
341 |
void CMemSpyAppUi::HandleThreadSelectedL( const CMemSpyThread& /*aThread*/ )
|
|
342 |
{
|
|
343 |
MEikAppUiFactory* appUiFactory = (iEikonEnv)->AppUiFactory();
|
|
344 |
appUiFactory->MenuBar()->TryDisplayMenuBarL();
|
|
345 |
}
|
|
346 |
|
|
347 |
|
|
348 |
void CMemSpyAppUi::HandleMemSpyEngineEventL( MMemSpyEngineObserver::TEvent aEvent, TAny* aContext )
|
|
349 |
{
|
|
350 |
if ( aEvent == MMemSpyEngineObserver::EHandleThreadsOrProcessesChanged )
|
|
351 |
{
|
|
352 |
// Get the original container
|
|
353 |
const CMemSpyEngineObjectContainer& oldContainer = *reinterpret_cast< CMemSpyEngineObjectContainer* >( aContext );
|
|
354 |
(void) oldContainer;
|
|
355 |
|
|
356 |
// Refresh the container
|
|
357 |
iAppContainer->OnCmdViewRefreshL();
|
|
358 |
}
|
|
359 |
else if ( aEvent == MMemSpyEngineObserver::EHandleClientServerOperationRequest )
|
|
360 |
{
|
|
361 |
const TInt function = reinterpret_cast<TInt>( aContext );
|
|
362 |
InitiateMemSpyClientServerOperationL( function );
|
|
363 |
}
|
|
364 |
}
|
|
365 |
|
|
366 |
|
|
367 |
void CMemSpyAppUi::DWOperationStarted()
|
|
368 |
{
|
|
369 |
#ifdef _DEBUG
|
|
370 |
RDebug::Printf( "[MemSpy] CMemSpyAppUi::DWOperationStarted() - START - iRunningDeviceWideOperation: %d, iAutoCaptureTimer is active: %d", iRunningDeviceWideOperation, iAutoCaptureTimer->IsActive() );
|
|
371 |
#endif
|
|
372 |
|
|
373 |
iRunningDeviceWideOperation = ETrue;
|
|
374 |
|
|
375 |
#ifdef _DEBUG
|
|
376 |
RDebug::Printf( "[MemSpy] CMemSpyAppUi::DWOperationStarted() - END - iRunningDeviceWideOperation: %d, iAutoCaptureTimer is active: %d", iRunningDeviceWideOperation, iAutoCaptureTimer->IsActive() );
|
|
377 |
#endif
|
|
378 |
}
|
|
379 |
|
|
380 |
|
|
381 |
void CMemSpyAppUi::DWOperationCancelled()
|
|
382 |
{
|
|
383 |
#ifdef _DEBUG
|
|
384 |
RDebug::Printf( "[MemSpy] CMemSpyAppUi::DWOperationCancelled() - START - iRunningDeviceWideOperation: %d, iAutoCaptureTimer is active: %d", iRunningDeviceWideOperation, iAutoCaptureTimer->IsActive() );
|
|
385 |
#endif
|
|
386 |
|
|
387 |
iAutoCaptureTimer->Cancel();
|
|
388 |
|
|
389 |
#ifdef _DEBUG
|
|
390 |
RDebug::Printf( "[MemSpy] CMemSpyAppUi::DWOperationCancelled() - END - iRunningDeviceWideOperation: %d, iAutoCaptureTimer is active: %d", iRunningDeviceWideOperation, iAutoCaptureTimer->IsActive() );
|
|
391 |
#endif
|
|
392 |
}
|
|
393 |
|
|
394 |
|
|
395 |
void CMemSpyAppUi::DWOperationCompleted()
|
|
396 |
{
|
|
397 |
#ifdef _DEBUG
|
|
398 |
RDebug::Printf( "[MemSpy] CMemSpyAppUi::DWOperationCompleted() - START - iRunningDeviceWideOperation: %d, iAutoCaptureTimer is active: %d", iRunningDeviceWideOperation, iAutoCaptureTimer->IsActive() );
|
|
399 |
#endif
|
|
400 |
|
|
401 |
iRunningDeviceWideOperation = EFalse;
|
|
402 |
|
|
403 |
#ifdef _DEBUG
|
|
404 |
RDebug::Printf( "[MemSpy] CMemSpyAppUi::DWOperationCompleted() - END - iAutoCaptureTimer is active: %d", iAutoCaptureTimer->IsActive() );
|
|
405 |
#endif
|
|
406 |
}
|
|
407 |
|
|
408 |
|
|
409 |
void CMemSpyAppUi::UpdateCBAL()
|
|
410 |
{
|
|
411 |
CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
|
|
412 |
const TMemSpyViewType viewType = iAppContainer->ActiveViewType();
|
|
413 |
//
|
|
414 |
if ( MemSpyViewTypeUtils::IsExitableView( viewType ) )
|
|
415 |
{
|
|
416 |
cba->SetCommandSetL( R_AVKON_SOFTKEYS_OPTIONS_EXIT );
|
|
417 |
}
|
|
418 |
else
|
|
419 |
{
|
|
420 |
cba->SetCommandSetL( R_AVKON_SOFTKEYS_OPTIONS_BACK );
|
|
421 |
}
|
|
422 |
|
|
423 |
cba->MakeVisible( ETrue );
|
|
424 |
cba->DrawNow();
|
|
425 |
}
|
|
426 |
|
|
427 |
|
|
428 |
void CMemSpyAppUi::InitiateMemSpyClientServerOperationL( TInt aOpCode )
|
|
429 |
{
|
|
430 |
#ifdef _DEBUG
|
|
431 |
RDebug::Printf( "[MemSpy] CMemSpyAppUi::InitiateMemSpyClientServerOperationL() - START - aOpCode: %d", aOpCode );
|
|
432 |
#endif
|
|
433 |
|
|
434 |
switch( aOpCode )
|
|
435 |
{
|
|
436 |
case EMemSpyClientServerOpSummaryInfo:
|
|
437 |
HandleCommandL( EMemSpyCmdPhoneInfoGeneralSummary );
|
|
438 |
break;
|
|
439 |
case EMemSpyClientServerOpSummaryInfoDetailed:
|
|
440 |
HandleCommandL( EMemSpyCmdPhoneInfoGeneralDetailed );
|
|
441 |
break;
|
|
442 |
//
|
|
443 |
case EMemSpyClientServerOpHeapInfo:
|
|
444 |
HandleCommandL( EMemSpyCmdPhoneInfoHeapInfoSummary );
|
|
445 |
break;
|
|
446 |
case EMemSpyClientServerOpHeapCellListing:
|
|
447 |
HandleCommandL( EMemSpyCmdPhoneInfoHeapCellListing );
|
|
448 |
break;
|
|
449 |
case EMemSpyClientServerOpHeapData:
|
|
450 |
HandleCommandL( EMemSpyCmdPhoneInfoHeapDump );
|
|
451 |
break;
|
|
452 |
//
|
|
453 |
case EMemSpyClientServerOpStackInfo:
|
|
454 |
HandleCommandL( EMemSpyCmdPhoneInfoStackInfo );
|
|
455 |
break;
|
|
456 |
case EMemSpyClientServerOpStackDataUser:
|
|
457 |
HandleCommandL( EMemSpyCmdPhoneInfoStackDumpUser );
|
|
458 |
break;
|
|
459 |
case EMemSpyClientServerOpStackDataKernel:
|
|
460 |
HandleCommandL( EMemSpyCmdPhoneInfoStackDumpKernel );
|
|
461 |
break;
|
|
462 |
//
|
|
463 |
case EMemSpyClientServerOpBitmapsSave:
|
|
464 |
OnCmdToolsBitmapsSaveToMemoryCardL();
|
|
465 |
break;
|
|
466 |
case EMemSpyClientServerOpSendToBackground:
|
|
467 |
OnCmdToolsSendToBackgroundL();
|
|
468 |
break;
|
|
469 |
case EMemSpyClientServerOpBringToForeground:
|
|
470 |
OnCmdToolsBringToForegroundL();
|
|
471 |
break;
|
|
472 |
case EMemSpyClientServerOpExit:
|
|
473 |
OnCmdExitL();
|
|
474 |
break;
|
|
475 |
//
|
|
476 |
default:
|
|
477 |
User::Leave( KErrNotSupported );
|
|
478 |
break;
|
|
479 |
}
|
|
480 |
|
|
481 |
#ifdef _DEBUG
|
|
482 |
RDebug::Printf( "[MemSpy] CMemSpyAppUi::InitiateMemSpyClientServerOperationL() - END - aOpCode: %d", aOpCode );
|
|
483 |
#endif
|
|
484 |
}
|
|
485 |
|
|
486 |
|
|
487 |
void CMemSpyAppUi::SetViewServerTimeOutStatus( TBool aEnabled )
|
|
488 |
{
|
|
489 |
/* TODO
|
|
490 |
iMemSpySession.SetServerTimeOutStatus( KMemSpyEikSrvSID, aEnabled );
|
|
491 |
*/
|
|
492 |
/*
|
|
493 |
TRAP_IGNORE(
|
|
494 |
iEngine.HelperProcess().ImpersonateL( KMemSpyEikSrvSID );
|
|
495 |
//
|
|
496 |
CVwsSessionWrapper* ses = CVwsSessionWrapper::NewLC();
|
|
497 |
ses->EnableServerEventTimeOut( aEnabled );
|
|
498 |
CleanupStack::PopAndDestroy( ses );
|
|
499 |
//
|
|
500 |
iEngine.HelperProcess().ImpersonateL( 0 );
|
|
501 |
);
|
|
502 |
*/
|
|
503 |
}
|
|
504 |
|
|
505 |
|
|
506 |
void CMemSpyAppUi::OnCmdBackL()
|
|
507 |
{
|
|
508 |
const TMemSpyViewType viewType = iAppContainer->ActiveViewType();
|
|
509 |
//
|
|
510 |
if ( !MemSpyViewTypeUtils::IsExitableView( viewType ) )
|
|
511 |
{
|
|
512 |
// Should go back one view
|
|
513 |
iAppContainer->NavigateToParentViewL();
|
|
514 |
}
|
|
515 |
}
|
|
516 |
|
|
517 |
|
|
518 |
void CMemSpyAppUi::OnCmdExitL()
|
|
519 |
{
|
|
520 |
Exit();
|
|
521 |
}
|
|
522 |
|
|
523 |
|
|
524 |
void CMemSpyAppUi::OnCmdOpenL()
|
|
525 |
{
|
|
526 |
const TMemSpyViewType viewType = iAppContainer->ActiveViewType();
|
|
527 |
//
|
|
528 |
if ( MemSpyViewTypeUtils::IsOpenableItem( viewType ) )
|
|
529 |
{
|
|
530 |
// Should go back one view
|
|
531 |
iAppContainer->NavigateToChildViewL();
|
|
532 |
}
|
|
533 |
}
|
|
534 |
|
|
535 |
|
|
536 |
void CMemSpyAppUi::OnCmdPhoneInformationOperationL( TDeviceWideOperation aOperation )
|
|
537 |
{
|
|
538 |
//
|
|
539 |
//CMemSpyDeviceWideOperationDialog::ExecuteLD( iMemSpySession, aOperation );
|
|
540 |
CMemSpyDwoTracker* tracker = CMemSpyDeviceWideOperationDialog::CreateDeviceWideOperation( iMemSpySession, aOperation );
|
|
541 |
tracker->Start();
|
|
542 |
/*
|
|
543 |
#ifdef _DEBUG
|
|
544 |
RDebug::Printf( "[MemSpy] CMemSpyAppUi::OnCmdPhoneInformationOperationL() - START - aOp: %d, iRunningDeviceWideOperation: %d, iAutoCaptureTimer is active: %d", aOp, iRunningDeviceWideOperation, iAutoCaptureTimer->IsActive() );
|
|
545 |
#endif
|
|
546 |
|
|
547 |
if ( !iRunningDeviceWideOperation )
|
|
548 |
{
|
|
549 |
CMemSpyDeviceWideOperationDialog::ExecuteLD( iMemSpySession, *this, aOp );
|
|
550 |
}
|
|
551 |
|
|
552 |
#ifdef _DEBUG
|
|
553 |
RDebug::Printf( "[MemSpy] CMemSpyAppUi::OnCmdPhoneInformationOperationL() - END - aOp: %d, iRunningDeviceWideOperation: %d, iAutoCaptureTimer is active: %d", aOp, iRunningDeviceWideOperation, iAutoCaptureTimer->IsActive() );
|
|
554 |
#endif
|
|
555 |
*/
|
|
556 |
}
|
|
557 |
|
|
558 |
|
|
559 |
void CMemSpyAppUi::OnCmdPhoneInformationOperationKernelContainersL()
|
|
560 |
{
|
|
561 |
/* TODO
|
|
562 |
iMemSpySession.OutputKernelObjects();
|
|
563 |
*/
|
|
564 |
/*
|
|
565 |
CMemSpyEngineGenericKernelObjectContainer* list = iEngine.HelperKernelContainers().ObjectsAllL();
|
|
566 |
CleanupStack::PushL( list );
|
|
567 |
iEngine.HelperKernelContainers().OutputL( *list );
|
|
568 |
CleanupStack::PopAndDestroy( list );
|
|
569 |
*/
|
|
570 |
}
|
|
571 |
|
|
572 |
|
|
573 |
|
|
574 |
|
|
575 |
|
|
576 |
|
|
577 |
|
|
578 |
|
|
579 |
|
|
580 |
|
|
581 |
|
|
582 |
|
|
583 |
|
|
584 |
|
|
585 |
|
|
586 |
|
|
587 |
|
|
588 |
|
|
589 |
|
|
590 |
|
|
591 |
|
|
592 |
|
|
593 |
void CMemSpyAppUi::OnCmdAutoCaptureToggleL()
|
|
594 |
{
|
|
595 |
#ifdef _DEBUG
|
|
596 |
RDebug::Printf( "[MemSpy] CMemSpyAppUi::OnCmdAutoCaptureToggleL() - START - iAutoCaptureOperationType: %d, iAutoCaptureTimer is active: %d", iAutoCaptureOperationType, iAutoCaptureTimer->IsActive() );
|
|
597 |
#endif
|
|
598 |
|
|
599 |
if ( iAutoCaptureTimer->IsActive() )
|
|
600 |
{
|
|
601 |
iAutoCaptureTimer->Cancel();
|
|
602 |
}
|
|
603 |
else
|
|
604 |
{
|
|
605 |
iAutoCaptureTimer->Cancel();
|
|
606 |
//
|
|
607 |
const TTimeIntervalMicroSeconds32 interval( iAutoCaptureTimerPeriod * 1000000 );
|
|
608 |
iAutoCaptureTimer->Start( 0, interval, TCallBack(AutoCaptureCallBack, this) );
|
|
609 |
}
|
|
610 |
|
|
611 |
#ifdef _DEBUG
|
|
612 |
RDebug::Printf( "[MemSpy] CMemSpyAppUi::OnCmdAutoCaptureToggleL() - START - iAutoCaptureOperationType: %d, iAutoCaptureTimer is active: %d", iAutoCaptureOperationType, iAutoCaptureTimer->IsActive() );
|
|
613 |
#endif
|
|
614 |
}
|
|
615 |
|
|
616 |
|
|
617 |
void CMemSpyAppUi::OnCmdAutoCaptureRetryTimeL()
|
|
618 |
{
|
|
619 |
CAknNumberQueryDialog* dialog = new(ELeave) CAknNumberQueryDialog( iAutoCaptureTimerPeriod );
|
|
620 |
dialog->ExecuteLD( R_MEMSPY_DEVICE_WIDE_SETTINGS );
|
|
621 |
}
|
|
622 |
|
|
623 |
|
|
624 |
void CMemSpyAppUi::OnCmdAutoCaptureOperationTypeL()
|
|
625 |
{
|
|
626 |
CDesCArrayFlat* items = iCoeEnv->ReadDesC16ArrayResourceL( R_MEMSPY_AUTO_CAPTURE_OPERATION_TYPES );
|
|
627 |
CleanupStack::PushL(items);
|
|
628 |
//
|
|
629 |
TInt currentItem = iAutoCaptureOperationType;
|
|
630 |
//
|
|
631 |
CAknRadioButtonSettingPage* dialog = new(ELeave) CAknRadioButtonSettingPage( R_MEMSPY_AUTO_CAPTURE_OPERATION_TYPES_SETTINGS_PAGE, currentItem, items );
|
|
632 |
if ( dialog->ExecuteLD( CAknSettingPage::EUpdateWhenAccepted ) )
|
|
633 |
{
|
|
634 |
iAutoCaptureOperationType = static_cast< CMemSpyDeviceWideOperations::TOperation >( currentItem );
|
|
635 |
}
|
|
636 |
//
|
|
637 |
CleanupStack::PopAndDestroy( items );
|
|
638 |
}
|
|
639 |
|
|
640 |
|
|
641 |
TInt CMemSpyAppUi::AutoCaptureCallBack( TAny* aSelf )
|
|
642 |
{
|
|
643 |
CMemSpyAppUi* self = reinterpret_cast< CMemSpyAppUi* >( aSelf );
|
|
644 |
TRAPD( err, self->AutoCaptureCallBackL() );
|
|
645 |
//
|
|
646 |
const TBool callMeBackAgain = ( err == KErrNone );
|
|
647 |
return callMeBackAgain;
|
|
648 |
}
|
|
649 |
|
|
650 |
|
|
651 |
void CMemSpyAppUi::AutoCaptureCallBackL()
|
|
652 |
{
|
|
653 |
#ifdef _DEBUG
|
|
654 |
RDebug::Printf( "[MemSpy] CMemSpyAppUi::AutoCaptureCallBackL() - START - iAutoCaptureOperationType: %d, iAutoCaptureTimer is active: %d", iAutoCaptureOperationType, iAutoCaptureTimer->IsActive() );
|
|
655 |
#endif
|
|
656 |
|
|
657 |
// OnCmdPhoneInformationOperationL( iAutoCaptureOperationType );
|
|
658 |
|
|
659 |
#ifdef _DEBUG
|
|
660 |
RDebug::Printf( "[MemSpy] CMemSpyAppUi::AutoCaptureCallBackL() - END - iAutoCaptureOperationType: %d, iAutoCaptureTimer is active: %d", iAutoCaptureOperationType, iAutoCaptureTimer->IsActive() );
|
|
661 |
#endif
|
|
662 |
}
|
|
663 |
|
|
664 |
|
|
665 |
|
|
666 |
|
|
667 |
|
|
668 |
|
|
669 |
|
|
670 |
|
|
671 |
|
|
672 |
|
|
673 |
|
|
674 |
|
|
675 |
|
|
676 |
|
|
677 |
|
|
678 |
|
|
679 |
|
|
680 |
|
|
681 |
|
|
682 |
|
|
683 |
|
|
684 |
void CMemSpyAppUi::OnCmdOutputToDebugL()
|
|
685 |
{
|
|
686 |
iMemSpySession.SwitchOutputSinkL( ESinkTypeDebug ); //set in engine
|
|
687 |
MemSpyDocument().Settings().SetSinkType( ESinkTypeDebug ); //set in settings
|
|
688 |
}
|
|
689 |
|
|
690 |
|
|
691 |
void CMemSpyAppUi::OnCmdOutputToFileL()
|
|
692 |
{
|
|
693 |
iMemSpySession.SwitchOutputSinkL( ESinkTypeFile ); //set in engine
|
|
694 |
MemSpyDocument().Settings().SetSinkType( ESinkTypeFile ); //set in settings
|
|
695 |
}
|
|
696 |
|
|
697 |
|
|
698 |
|
|
699 |
|
|
700 |
|
|
701 |
|
|
702 |
|
|
703 |
|
|
704 |
|
|
705 |
|
|
706 |
|
|
707 |
void CMemSpyAppUi::OnCmdAboutL()
|
|
708 |
{
|
|
709 |
CAknMessageQueryDialog* dialog = new(ELeave) CAknMessageQueryDialog;
|
|
710 |
dialog->ExecuteLD( R_MEMSPYUI_ABOUT_DIALOG );
|
|
711 |
}
|
|
712 |
|
|
713 |
|
|
714 |
|
|
715 |
|
|
716 |
|
|
717 |
|
|
718 |
|
|
719 |
|
|
720 |
|
|
721 |
|
|
722 |
|
|
723 |
|
|
724 |
void CMemSpyAppUi::OnCmdToolsBitmapsSaveToMemoryCardL()
|
|
725 |
{
|
|
726 |
/* TODO
|
|
727 |
// Get bitmap handles
|
|
728 |
RArray<TInt> handles;
|
|
729 |
CleanupClosePushL( handles );
|
|
730 |
iEngine.HelperFbServ().GetArrayOfBitmapHandlesL( handles );
|
|
731 |
|
|
732 |
// Build bitmap list
|
|
733 |
CMemSpyEngineFbServBitmapArray* array = CMemSpyEngineFbServBitmapArray::NewL( handles );
|
|
734 |
CleanupStack::PopAndDestroy( &handles );
|
|
735 |
CleanupStack::PushL( array );
|
|
736 |
|
|
737 |
// Export...
|
|
738 |
CMemSpyExportBitmapsToMemoryCardDialog* dialog = CMemSpyExportBitmapsToMemoryCardDialog::NewL( iCoeEnv->FsSession(), *array );
|
|
739 |
|
|
740 |
// All done
|
|
741 |
CleanupStack::PopAndDestroy( array );
|
|
742 |
*/
|
|
743 |
}
|
|
744 |
|
|
745 |
|
|
746 |
void CMemSpyAppUi::OnCmdToolsSendToBackgroundL()
|
|
747 |
{
|
52
|
748 |
/*
|
51
|
749 |
TApaTask task( iCoeEnv->WsSession() );
|
|
750 |
task.SendToBackground();
|
52
|
751 |
*/
|
51
|
752 |
}
|
|
753 |
|
|
754 |
|
|
755 |
void CMemSpyAppUi::OnCmdToolsBringToForegroundL()
|
|
756 |
{
|
|
757 |
iCoeEnv->BringOwnerToFront();
|
|
758 |
}
|
|
759 |
|
|
760 |
|
|
761 |
|
|
762 |
|