~ubuntu-branches/ubuntu/lucid/codelite/lucid

« back to all changes in this revision

Viewing changes to LiteEditor/manager.h

  • Committer: Bazaar Package Importer
  • Author(s): Chow Loong Jin
  • Date: 2009-01-12 15:46:55 UTC
  • Revision ID: james.westby@ubuntu.com-20090112154655-sdynrljcb6u167yw
Tags: upstream-1.0.2674+dfsg
ImportĀ upstreamĀ versionĀ 1.0.2674+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//////////////////////////////////////////////////////////////////////////////
 
2
//////////////////////////////////////////////////////////////////////////////
 
3
//
 
4
// copyright            : (C) 2008 by Eran Ifrah
 
5
// file name            : manager.h
 
6
//
 
7
// -------------------------------------------------------------------------
 
8
// A
 
9
//              _____           _      _     _ _
 
10
//             /  __ \         | |    | |   (_) |
 
11
//             | /  \/ ___   __| | ___| |    _| |_ ___
 
12
//             | |    / _ \ / _  |/ _ \ |   | | __/ _ )
 
13
//             | \__/\ (_) | (_| |  __/ |___| | ||  __/
 
14
//              \____/\___/ \__,_|\___\_____/_|\__\___|
 
15
//
 
16
//                                                  F i l e
 
17
//
 
18
//    This program is free software; you can redistribute it and/or modify
 
19
//    it under the terms of the GNU General Public License as published by
 
20
//    the Free Software Foundation; either version 2 of the License, or
 
21
//    (at your option) any later version.
 
22
//
 
23
//////////////////////////////////////////////////////////////////////////////
 
24
//////////////////////////////////////////////////////////////////////////////
 
25
#ifndef MANAGER_H
 
26
#define MANAGER_H
 
27
 
 
28
#include "acceltabledlg.h"
 
29
#include "singleton.h"
 
30
#include "cpptoken.h"
 
31
#include "wx/string.h"
 
32
#include "readtags.h"
 
33
#include "entry.h"
 
34
#include "project.h"
 
35
#include "context_base.h"
 
36
#include "ctags_manager.h"
 
37
#include "workspace.h"
 
38
#include <list>
 
39
#include <map>
 
40
#include "compile_request.h"
 
41
#include "clean_request.h"
 
42
#include "wx/event.h"
 
43
#include "filehistory.h"
 
44
#include "browse_record.h"
 
45
#include "wx/timer.h"
 
46
#include "breakpointsmgr.h"
 
47
#include "debuggermanager.h"
 
48
#include "debuggerobserver.h"
 
49
 
 
50
class wxFrame;
 
51
class LEditor;
 
52
class AsyncExeCmd;
 
53
class QuickWatchDlg;
 
54
 
 
55
// ====================================================================
 
56
// The Manager class
 
57
// ====================================================================
 
58
class Manager : public wxEvtHandler, public IDebuggerObserver
 
59
{
 
60
        friend class Singleton<Manager>;
 
61
        wxString  m_startupDir;
 
62
        ShellCommand *m_shellProcess;
 
63
        AsyncExeCmd *m_asyncExeCmd;
 
64
        FileHistory m_recentFiles;
 
65
        FileHistory m_recentWorkspaces;
 
66
        BreakptMgr* m_breakptsmgr;
 
67
        bool m_dbgCanInteract;
 
68
        bool m_dbgWaitingFirstBp;       // TODO: This doesn't seem to be used for anything :/
 
69
        QuickWatchDlg *m_quickWatchDlg;
 
70
        int m_frameLineno;
 
71
        bool m_useTipWin;
 
72
        long m_tipWinPos;
 
73
        wxString m_installDir;
 
74
        std::list<QueueCommand> m_buildQueue;
 
75
        bool m_workspceClosing;
 
76
        bool m_isShutdown;
 
77
 
 
78
public:
 
79
        /*!
 
80
         * \brief
 
81
         * check if a workspace is open
 
82
         *
 
83
         * \returns
 
84
         * true if a workspace is open
 
85
         */
 
86
        bool IsWorkspaceOpen() const;
 
87
 
 
88
        /**
 
89
         * Create new file on the disk and open it in the main editor
 
90
         * \param fileName file full path (including directories)
 
91
         * \param vdFullPath path of the virtual directory
 
92
         */
 
93
        bool AddNewFileToProject(const wxString &fileName, const wxString &vdFullPath, bool openIt = true);
 
94
 
 
95
        /**
 
96
         * Add an existing file to workspace
 
97
         * \param fileName file full path (including directories)
 
98
         * \param vdFullPath path of the virtual directory
 
99
         */
 
100
        bool AddFileToProject(const wxString &fileName, const wxString &vdFullPath, bool openIt = false);
 
101
        /**
 
102
         * \brief
 
103
         * \param files
 
104
         * \param vdFullPath
 
105
         * \param actualAdded
 
106
         * \return
 
107
         */
 
108
        void AddFilesToProject(const wxArrayString &files, const wxString &vdFullPath, wxArrayString &actualAdded);
 
109
 
 
110
        void SetWorkspaceClosing(const bool& inShutdown) {
 
111
                this->m_workspceClosing = inShutdown;
 
112
        }
 
113
 
 
114
        const bool& IsWorkspaceClosing() const {
 
115
                return m_workspceClosing;
 
116
        }
 
117
 
 
118
        bool IsShutdownInProgress() const {
 
119
                return m_isShutdown;
 
120
        }
 
121
 
 
122
        void SetShutdownInProgress(bool b) {
 
123
                m_isShutdown = b;
 
124
        }
 
125
 
 
126
        /*!
 
127
         * \brief
 
128
         * Free all singleton objects initialised in CodeLite
 
129
         */
 
130
        void UnInitialize();
 
131
 
 
132
        /*!
 
133
         * \brief
 
134
         * Return a pointer to the breakpoints manager
 
135
         */
 
136
        BreakptMgr* GetBreakpointsMgr();
 
137
 
 
138
        /*!
 
139
         * \brief
 
140
         * Create a workspace with a given name and path
 
141
         *
 
142
         * \param name
 
143
         * workspace name
 
144
         *
 
145
         * \param path
 
146
         * workspace path
 
147
         *
 
148
         */
 
149
        void CreateWorkspace(const wxString &name, const wxString &path);
 
150
 
 
151
        /**
 
152
         * \brief create an empty project
 
153
         * \param name project name
 
154
         * \param path project file path
 
155
         * \param type project type, Project::STATIC_LIBRARY, Project::DYNAMIC_LIBRARY or Project::EXECUTABLE
 
156
         */
 
157
        void CreateProject(ProjectData &data);
 
158
 
 
159
        /**
 
160
         * Open an existing workspace by path
 
161
         */
 
162
        void OpenWorkspace(const wxString &path);
 
163
 
 
164
        /**
 
165
         * Close the current workspace and save all
 
166
         * changes
 
167
         */
 
168
        void CloseWorkspace();
 
169
 
 
170
        /**
 
171
         * \brief close the currently opened workspace and reload it without saving any modifications made to it, if no workspace is opened, this functiond does anything
 
172
         */
 
173
        void ReloadWorkspace();
 
174
 
 
175
        /**
 
176
         * Return a tree for the file view of a single project
 
177
         */
 
178
        ProjectTreePtr GetProjectFileViewTree(const wxString &projectName);
 
179
 
 
180
        /**
 
181
         * Return all project names under this workspace
 
182
         */
 
183
        void GetProjectList(wxArrayString &list);
 
184
 
 
185
        /**
 
186
         * find project by name
 
187
         */
 
188
        ProjectPtr GetProject(const wxString &name) const;
 
189
 
 
190
        /**
 
191
         * Add an existing project to the workspace. If no workspace is open,
 
192
         * this function does nothing
 
193
         * \param path project file path name to add
 
194
         */
 
195
        void AddProject(const wxString &path);
 
196
 
 
197
        /**
 
198
         * Remove the a project from the workspace
 
199
         * \param name project name to remove
 
200
         * \return true on success false otherwise
 
201
         */
 
202
        bool RemoveProject(const wxString &name) ;
 
203
 
 
204
        /**
 
205
         * \return active project name
 
206
         */
 
207
        wxString GetActiveProjectName();
 
208
 
 
209
        /**
 
210
         * Set project as active
 
211
         * \param name project name to set as active
 
212
         */
 
213
        void SetActiveProject(const wxString &name);
 
214
 
 
215
        /**
 
216
         * Add new virtual directory to the workspace.
 
217
         * \param virtualDirFullPath a dot separated string of the new virtual directory full path up to the parent project
 
218
         *        for example: to add a new VD name VD3 under: Project1->VD1->VD2 path should contain: Project1.VD1.VD2.VD3
 
219
         */
 
220
        void AddVirtualDirectory(const wxString &virtualDirFullPath);
 
221
 
 
222
        /**
 
223
         * Remove virtual directory from the workspace.
 
224
         * \param virtualDirFullPath a dot separated string of the virtual directory to be removed
 
225
         */
 
226
        void RemoveVirtualDirectory(const wxString &virtualDirFullPath);
 
227
 
 
228
        /**
 
229
         * Save workspace
 
230
         */
 
231
        void SaveWorkspace();
 
232
 
 
233
        /**
 
234
         * remove file from the workspace
 
235
         * \param fileName the full path of the file to be removed
 
236
         * \param vdFullPath the files' virtual directory path (including project)
 
237
         */
 
238
        bool RemoveFile(const wxString &fileName, const wxString &vdFullPath);
 
239
 
 
240
        /**
 
241
         * Return a project working directory
 
242
         * \param project project name
 
243
         */
 
244
        wxString GetProjectCwd(const wxString &project) const;
 
245
 
 
246
        /**
 
247
         * Show output pane and set focus to focusWin
 
248
         * \param focusWin tab name to set the focus
 
249
         * \return return true if the output pane was hidden and this function forced it to appear. false if the window was already
 
250
         * shown and nothing needed to be done
 
251
         */
 
252
        bool ShowOutputPane(wxString focusWin = wxEmptyString, bool commit = true );
 
253
 
 
254
        /**
 
255
         * Show the debugger pane
 
256
         */
 
257
        void ShowDebuggerPane(bool commit = true);
 
258
 
 
259
        /**
 
260
         * Show the main toolbar
 
261
         * \param show set to true to show it, false otherwise
 
262
         */
 
263
        void ShowMainToolbar(bool show = true);
 
264
 
 
265
        /**
 
266
         * Show the workspace pane and set focus to focusWin
 
267
         * \param focusWin tab name to set the focus
 
268
         */
 
269
        void ShowWorkspacePane(wxString focusWin = wxEmptyString, bool commit = true );
 
270
 
 
271
        /**
 
272
         * Hide pane
 
273
         */
 
274
        void HidePane(const wxString &paneName, bool commit = true);
 
275
 
 
276
        /**
 
277
         * Return project settings by name
 
278
         * \param projectName project name
 
279
         * \return project settings smart prt
 
280
         */
 
281
        ProjectSettingsPtr GetProjectSettings(const wxString &projectName) const;
 
282
 
 
283
        /**
 
284
         * Set project settings
 
285
         * \param projectName project name
 
286
         * \param settings settings to update
 
287
         */
 
288
        void SetProjectSettings(const wxString &projectName, ProjectSettingsPtr settings);
 
289
 
 
290
        /**
 
291
         * Return the workspace build matrix
 
292
         */
 
293
        BuildMatrixPtr GetWorkspaceBuildMatrix() const;
 
294
 
 
295
        /**
 
296
         * Set or update the workspace build matrix
 
297
         */
 
298
        void SetWorkspaceBuildMatrix(BuildMatrixPtr matrix);
 
299
 
 
300
        /**
 
301
         * Hide/Show all panes. This function saves the current prespective and
 
302
         * then hides all panes, when called again, all panes are restored
 
303
         */
 
304
        void TogglePanes();
 
305
 
 
306
        /**
 
307
         * create default new compiler
 
308
         * \return true on success false when a compiler with this name already exist
 
309
         */
 
310
        bool CreateDefaultNewCompiler(const wxString &name);
 
311
 
 
312
        /**
 
313
         * delete compiler
 
314
         * \param name compiler to delete
 
315
         */
 
316
        bool DeleteCompiler(const wxString &name);
 
317
 
 
318
        /**
 
319
         * Return a list of availanle project templates
 
320
         * \param list output
 
321
         */
 
322
        void GetProjectTemplateList(std::list<ProjectPtr> &list);
 
323
 
 
324
        /**
 
325
         * Save project as template
 
326
         * \param proj project to duplicate
 
327
         * \param name the template name
 
328
         * \param description project short description
 
329
         */
 
330
        void SaveProjectTemplate(ProjectPtr proj, const wxString &name, const wxString &description);
 
331
 
 
332
        /**
 
333
         * Set lite editor's startup directory
 
334
         */
 
335
        void SetStarupDirectory(const wxString &path) {
 
336
                m_startupDir = path;
 
337
        }
 
338
 
 
339
        /**
 
340
         * Get lite editor's startup directory
 
341
         */
 
342
        const wxString &GetStarupDirectory() const {
 
343
                return m_startupDir;
 
344
        }
 
345
 
 
346
        /**
 
347
         * \brief return the OS specific installation directory
 
348
         */
 
349
        const wxString &GetInstallDir() const {
 
350
                return m_installDir;
 
351
        }
 
352
 
 
353
        /**
 
354
         * \brief set the installation directory
 
355
         */
 
356
        void SetInstallDir(const wxString &dir) {
 
357
                m_installDir = dir;
 
358
        }
 
359
 
 
360
        /**
 
361
         * Popup project dependencies dialog
 
362
         * \param projectName project name
 
363
         */
 
364
        void PopupProjectDependsDlg(const wxString &projectName);
 
365
 
 
366
        /**
 
367
         * \brief when building using custom build, execute the makefile generation command provided by the user
 
368
         * \param project project to execute it for
 
369
         */
 
370
        void RunCustomPreMakeCommand(const wxString &project);
 
371
 
 
372
        /**
 
373
         * compile single file from a given
 
374
         * given project
 
375
         */
 
376
        void CompileFile(const wxString &project, const wxString &fileName, bool preprocessOnly = false);
 
377
 
 
378
        /**
 
379
         * Stop current build process
 
380
         */
 
381
        void StopBuild();
 
382
 
 
383
        /**
 
384
         * return true if a compilation is in process (either clean or build)
 
385
         */
 
386
        bool IsBuildInProgress() const;
 
387
 
 
388
        /**
 
389
         * return true a child program is running
 
390
         */
 
391
        bool IsProgramRunning() const;
 
392
 
 
393
        /**
 
394
         * Kill child program which is running
 
395
         */
 
396
        void KillProgram();
 
397
 
 
398
        /**
 
399
         * Execute the project with no debugger
 
400
         */
 
401
        void ExecuteNoDebug(const wxString &projectName);
 
402
 
 
403
        /**
 
404
         * Return the active's project build configuration that matches
 
405
         * the workspace selected configuration
 
406
         */
 
407
        BuildConfigPtr GetActiveProjectBuildConf();
 
408
 
 
409
        /**
 
410
         * use an external database
 
411
         */
 
412
        void SetExternalDatabase(const wxFileName &dbname);
 
413
 
 
414
        /**
 
415
         * close the currenlty open extern database
 
416
         * and free all its resources
 
417
         */
 
418
        void CloseExternalDatabase();
 
419
 
 
420
        /**
 
421
         * return list of files that are part of the workspace
 
422
         */
 
423
        void GetWorkspaceFiles(std::vector<wxFileName> &files, bool absPath = false);
 
424
 
 
425
        /**
 
426
         * check if a file is part of the workspace
 
427
         * \param fileName the file name in absolute path
 
428
         */
 
429
        bool IsFileInWorkspace(const wxString &fileName);
 
430
 
 
431
    /**
 
432
     * Search for (non-absolute) file in the workspace
 
433
     */
 
434
    wxFileName FindFile(const wxString &fileName, const wxString &project = wxEmptyString);
 
435
        
 
436
        /**
 
437
         * Rebuild the database by removing all entries from the database
 
438
         * that belongs to a given project, and then re-index all files
 
439
         * \param projectName project to re-tag
 
440
         */
 
441
        void RetagProject(const wxString &projectName);
 
442
 
 
443
        /**
 
444
         * retag workspace
 
445
         */
 
446
        void RetagWorkspace();
 
447
 
 
448
        /**
 
449
         * \brief retag a given file
 
450
         * \param filename
 
451
         */
 
452
        void RetagFile(const wxString &filename);
 
453
 
 
454
        /**
 
455
         * Add a debug message in the debug output window
 
456
         * \param msg
 
457
         */
 
458
        void DebugMessage(wxString msg);
 
459
 
 
460
        /**
 
461
         * Add a message in the output tab window
 
462
         * \param msg
 
463
         */
 
464
        void OutputMessage(wxString msg);
 
465
 
 
466
        /**
 
467
         * return the project name that 'fullPathFileName' belogs to. if 2 matches were found, return
 
468
         * the first one, or empty string if no match was found
 
469
         */
 
470
        wxString GetProjectNameByFile(const wxString &fullPathFileName);
 
471
 
 
472
        /**
 
473
        * Import a workspace from a makefile
 
474
        */
 
475
//      void ImportFromMakefile(const wxString &path);
 
476
 
 
477
        /**
 
478
         * add single file to the recently opened files
 
479
         */
 
480
        void AddToRecentlyOpenedFiles(const wxString &fileName);
 
481
 
 
482
        /**
 
483
         * return the FileHistory object that holds the recently opened
 
484
         * files data
 
485
         */
 
486
        FileHistory &GetRecentlyOpenedFilesClass() {
 
487
                return m_recentFiles;
 
488
        }
 
489
 
 
490
        /**
 
491
         * \brief clear the recent workspace / files list
 
492
         */
 
493
        void ClearFileHistory();
 
494
 
 
495
        /**
 
496
         * \brief return true if the file history is not empty, false otherwise
 
497
         */
 
498
        bool HasHistory() const;
 
499
 
 
500
        /**
 
501
         * add workspace file to the recently opened workspaces
 
502
         */
 
503
        void AddToRecentlyOpenedWorkspaces(const wxString &fileName);
 
504
 
 
505
        /**
 
506
         * return the FileHistory object that holds the recently opened
 
507
         * workspace data
 
508
         */
 
509
        FileHistory &GetRecentlyOpenedWorkspacesClass() {
 
510
                return m_recentWorkspaces;
 
511
        }
 
512
 
 
513
        /**
 
514
         * Return list of recently opened files from the configuration file
 
515
         * \param files [output]
 
516
         */
 
517
        void GetRecentlyOpenedFiles(wxArrayString &files);
 
518
 
 
519
        /**
 
520
         * Return list of recently opened workspaces from the configuration file
 
521
         * \param files [output]
 
522
         */
 
523
        void GetRecentlyOpenedWorkspaces(wxArrayString &files);
 
524
 
 
525
        bool MoveFileToVD(const wxString &fileName, const wxString &srcVD, const wxString &targetVD);
 
526
 
 
527
        /**
 
528
         * return list of files in absolute path of a given project
 
529
         * \param project project name
 
530
         */
 
531
        void GetProjectFiles(const wxString &project, wxArrayString &files);
 
532
 
 
533
        /**
 
534
         * return list of files in absolute path of the whole workspace
 
535
         */
 
536
        void GetWorkspaceFiles(wxArrayString &files);
 
537
 
 
538
        /**
 
539
         * Import a MS Solution file and open it in the editor
 
540
         * \param path path to the .sln file
 
541
         */
 
542
        void ImportMSVSSolution(const wxString &path);
 
543
 
 
544
        /**
 
545
         * Expand variables to their real value, if expanding fails
 
546
         * the return value is same as input. The variable is expanded
 
547
         * in the project context
 
548
         */
 
549
        wxString ExpandVariables(const wxString &expression, ProjectPtr proj);
 
550
 
 
551
        /**
 
552
         * return true if the last buid ended successfully
 
553
         */
 
554
        bool IsBuildEndedSuccessfully() const;
 
555
 
 
556
        /**
 
557
         * \brief update the path & name of the build tool
 
558
         * on windows, try to locate make, followed by mingw32-make
 
559
         */
 
560
        void UpdateBuildTools();
 
561
 
 
562
        /**
 
563
         * \brief open file specified by the 'fileName' parameter and append 'text'
 
564
         * to its content
 
565
         * \param fileName file to open. Must be in full path
 
566
         * \param text string text to append
 
567
         * \return true on success, false otherwise
 
568
         */
 
569
        bool OpenFileAndAppend(const wxString &fileName, const wxString &text);
 
570
 
 
571
        /**
 
572
         * \brief update the menu bar accelerators
 
573
         */
 
574
        void UpdateMenuAccelerators();
 
575
 
 
576
        /**
 
577
         * \brief load accelerator table from the configuration section
 
578
         * \param file
 
579
         * \param map
 
580
         */
 
581
        void LoadAcceleratorTable(const wxArrayString &files, MenuItemDataMap &map);
 
582
 
 
583
        /**
 
584
         * \brief retrun map of the accelerator table. the StringMap maps between the actions and their accelerators
 
585
         */
 
586
        void GetAcceleratorMap(MenuItemDataMap& accelMap);
 
587
 
 
588
        /**
 
589
         * \brief retrun map of the default accelerator table
 
590
         */
 
591
        void GetDefaultAcceleratorMap(MenuItemDataMap& accelMap);
 
592
 
 
593
        /**
 
594
         * \brief parse list of files and construct a token database that will be used for refactoring
 
595
         * \param word word to search
 
596
         * \param files list of files to parse
 
597
         */
 
598
        void BuildRefactorDatabase(const wxString& word, CppTokensMap &l);
 
599
 
 
600
        /**
 
601
         * \brief replace list of toens representd by li with 'word'
 
602
         * \param li
 
603
         * \return
 
604
         */
 
605
        void ReplaceInFiles(const wxString &word, std::list<CppToken> &li);
 
606
 
 
607
        void UpdateMenu(wxMenu *menu, MenuItemDataMap &accelMap, std::vector< wxAcceleratorEntry > &accelVec);
 
608
 
 
609
        /**
 
610
         * \brief return the project excution command as it appears in the project settings
 
611
         * \param projectName
 
612
         * \param wd the working directory that the command should be running from
 
613
         * \param considerPauseWhenExecuting when set to true (default) CodeLite will take into consideration the value set in the project
 
614
         * settings 'Pause when execution ends'
 
615
         * \return project execution command or wxEmptyString if the project does not exist
 
616
         */
 
617
        wxString GetProjectExecutionCommand(const wxString &projectName, wxString &wd, bool considerPauseWhenExecuting = true);
 
618
 
 
619
        /**
 
620
         * \brief add build job to the internal queue
 
621
         * \param buildInfo
 
622
         */
 
623
        void PushQueueCommand(const QueueCommand &buildInfo);
 
624
 
 
625
        /**
 
626
         * \brief process the next build job
 
627
         */
 
628
        void ProcessCommandQueue();
 
629
 
 
630
        /**
 
631
         * \brief build the entire workspace. This operation is equal to
 
632
         * manually right clicking on each project in the workspace and selecting
 
633
         * 'build'
 
634
         */
 
635
        void BuildWorkspace();
 
636
 
 
637
        /**
 
638
         * \brief clean the entire workspace. This operation is equal to
 
639
         * manually right clicking on each project in the workspace and selecting
 
640
         * 'clean'
 
641
         */
 
642
        void CleanWorkspace();
 
643
 
 
644
        /**
 
645
         * \brief clean, followed by buid of the entire workspace. This operation is equal to
 
646
         * manually right clicking on each project in the workspace and selecting
 
647
         * 'clean'
 
648
         */
 
649
        void RebuildWorkspace();
 
650
 
 
651
        /**
 
652
         * \brief test if pane_name is resides in the wxAuiManager and is visible
 
653
         * \param pane_name pane name to search for
 
654
         * \return true on success (exist in the AUI manager and visible), false otherwise
 
655
         */
 
656
        bool IsPaneVisible(const wxString &pane_name);
 
657
 
 
658
        //--------------------------------------------------------------------
 
659
        //IDebuggerObserver implementation. These set of functions are called
 
660
        //from the debugger whenever event occurs there
 
661
        //--------------------------------------------------------------------
 
662
        void UpdateStopped();
 
663
        void UpdateAddLine(const wxString &line);
 
664
        void UpdateRemoteTargetConnected(const wxString &line);
 
665
        void UpdateBpAdded(const int internal_id, const int debugger_id);
 
666
        void UpdateFileLine(const wxString &file, int lineno);
 
667
        void UpdateGotControl(DebuggerReasons reason);
 
668
        void UpdateLostControl();
 
669
        void UpdateLocals(TreeNode<wxString, NodeData> *tree);
 
670
        void UpdateExpression(const wxString &expression, const wxString &evaluated);
 
671
        void UpdateQuickWatch(const wxString &expression, TreeNode<wxString, NodeData> *tree);
 
672
        void UpdateStackList(const StackEntryArray &stackArray);
 
673
 
 
674
        //----------------------------------------------------------
 
675
        // Debugging API
 
676
        //----------------------------------------------------------
 
677
        void DbgStart(long pid = wxNOT_FOUND);
 
678
        void DbgStop();
 
679
        void DbgDoSimpleCommand(int cmd);
 
680
        void DbgMarkDebuggerLine(const wxString &fileName, int lineno);
 
681
        void DbgUnMarkDebuggerLine();
 
682
        void DbgQuickWatch(const wxString &expression, bool useTipWin = false, long pos = wxNOT_FOUND);
 
683
        void DbgCancelQuickWatchTip();
 
684
        void DbgSetFrame(int frame, int lineno);
 
685
        void DbgSetThread(long threadId);
 
686
        bool DbgCanInteract() {
 
687
                return m_dbgCanInteract;
 
688
        }
 
689
        void UpdateDebuggerPane();
 
690
        void SetMemory(const wxString &address, size_t count, const wxString &hex_value);
 
691
 
 
692
protected:
 
693
        Manager(void);
 
694
        virtual ~Manager(void);
 
695
        void OnProcessEnd(wxProcessEvent &event);
 
696
        void DoShowPane(const wxString &pane);
 
697
        void DoSetupWorkspace(const wxString &path);
 
698
        void DoCleanProject(const QueueCommand &buildInfo);
 
699
        void DoBuildProject(const QueueCommand &buildInfo);
 
700
        void DoCustomBuild(const QueueCommand &buildInfo);
 
701
        void DoCmdWorkspace(int cmd);
 
702
        void DoGetAccelFiles(wxArrayString &files);
 
703
 
 
704
private:
 
705
        /**
 
706
         * Update the symbol & file tress
 
707
         */
 
708
        void RebuildFileView();
 
709
 
 
710
        /**
 
711
         * Remove a file from the gui tree
 
712
         */
 
713
        void RemoveFileFromSymbolTree(const wxFileName &fileName, const wxString &project);
 
714
 
 
715
        void DumpMenu( wxMenu *menu, const wxString &label, wxString &content );
 
716
    
 
717
    wxFileName FindFile ( const wxArrayString& files, const wxFileName &fn );
 
718
};
 
719
 
 
720
typedef Singleton<Manager> ManagerST;
 
721
 
 
722
#endif // MANAGER_H