Nemiver  0.3
nmv-dbg-perspective.h
Go to the documentation of this file.
1 //Author: Dodji Seketeli
2 /*
3  *This file is part of the Nemiver project
4  *
5  *Nemiver is free software; you can redistribute
6  *it and/or modify it under the terms of
7  *the GNU General Public License as published by the
8  *Free Software Foundation; either version 2,
9  *or (at your option) any later version.
10  *
11  *Nemiver is distributed in the hope that it will
12  *be useful, but WITHOUT ANY WARRANTY;
13  *without even the implied warranty of
14  *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15  *See the GNU General Public License for more details.
16  *
17  *You should have received a copy of the
18  *GNU General Public License along with Nemiver;
19  *see the file COPYING.
20  *If not, write to the Free Software Foundation,
21  *Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22  *
23  *See COPYRIGHT file copyright information.
24  */
25 #ifndef __NMV_DBG_PERSPECTIVE_H__
26 #define __NMV_DBG_PERSPECTIVE_H__
27 
28 #include <list>
29 #include "nmv-i-perspective.h"
30 #include "nmv-i-debugger.h"
31 #include "nmv-sess-mgr.h"
32 #include "nmv-i-conf-mgr.h"
33 #include <sigc++/trackable.h>
34 
35 NEMIVER_BEGIN_NAMESPACE (nemiver)
36 
37 extern const char *CONTEXT_VIEW_TITLE;
38 extern const char *TARGET_TERMINAL_VIEW_TITLE;
39 extern const char *BREAKPOINTS_VIEW_TITLE;
40 extern const char *REGISTERS_VIEW_TITLE;
41 extern const char *MEMORY_VIEW_TITLE;
42 
44 {
49 #ifdef WITH_MEMORYVIEW
50  MEMORY_VIEW_INDEX,
51 #endif // WITH_MEMORYVIEW
53 };
54 
55 class SourceEditor;
57  //non copyable
59  IDBGPerspective& operator= (const IPerspective&);
60 
61 public:
62 
64  IPerspective (a_dynmod)
65  {
66  }
67 
68  virtual ~IDBGPerspective () {};
69 
70  virtual void do_init (IWorkbench *a_workbench) = 0;
71 
72  virtual const UString& get_perspective_identifier () = 0;
73 
74  virtual void get_toolbars (list<Gtk::Widget*> &a_tbs) = 0;
75 
76  virtual Gtk::Widget* get_body () = 0;
77 
78  virtual Gtk::Widget& get_source_view_widget () = 0;
79 
80  virtual IWorkbench& get_workbench () = 0;
81 
82  virtual void edit_workbench_menu () = 0;
83 
84  virtual void open_file () = 0;
85 
86  virtual bool open_file (const UString &a_uri,
87  int current_line=-1)= 0;
88 
89  virtual void close_current_file () = 0;
90 
91  virtual void close_file (const UString &a_uri) = 0;
92 
93  virtual Gtk::Widget* load_menu (const UString &a_filename,
94  const UString &a_widget_name) = 0;
95 
96  virtual void close_opened_files () = 0;
97 
98  virtual ISessMgr& session_manager () = 0;
99 
100  virtual void execute_session (ISessMgr::Session &a_session) = 0;
101 
102  virtual void execute_program () = 0;
103 
104  virtual void execute_program (const UString &a_prog,
105  const vector<UString> &a_args,
106  const map<UString, UString> &a_env,
107  const UString &a_cwd = ".",
108  bool a_close_opened_files = false,
109  bool a_break_in_main_run = true) = 0;
110 
111  virtual void execute_program (const UString &a_prog,
112  const vector<UString> &a_args,
113  const map<UString, UString> &a_env,
114  const UString &a_cwd,
115  const vector<IDebugger::Breakpoint>
116  &a_breaks,
117  bool a_check_is_new_program = true,
118  bool a_close_opened_files = false,
119  bool a_break_in_main_run = true) = 0;
120 
121  virtual void attach_to_program (unsigned int a_pid,
122  bool a_close_open_files = false) = 0;
123 
124  virtual void connect_to_remote_target (const UString &a_server_address,
125  unsigned a_server_port,
126  const UString &a_prog_path,
127  const UString &a_solib_prefix) = 0;
128 
129  virtual void connect_to_remote_target (const UString &a_serial_line,
130  const UString &a_prog_path,
131  const UString &a_solib_prefix) = 0;
132 
133  virtual void load_core_file () = 0;
134 
135  virtual void load_core_file (const UString &a_prog_path,
136  const UString &a_core_file_path) = 0;
137 
138  virtual void run () = 0;
139 
140  virtual void step_over () = 0;
141 
142  virtual void step_into () = 0;
143 
144  virtual void step_out () = 0;
145 
146  virtual void do_continue () = 0;
147 
148  virtual void set_breakpoint () = 0;
149 
150  virtual void set_breakpoint (const UString &a_file,
151  int a_line,
152  const UString &a_condition,
153  bool a_is_count_point) = 0;
154 
155  virtual void set_breakpoint (const UString &a_func_name,
156  const UString &a_condition,
157  bool a_is_count_point) = 0;
158 
159  virtual void set_breakpoint (const IDebugger::Breakpoint &a_breakpoint) = 0;
160 
161  virtual void append_breakpoints
162  (const map<string, IDebugger::Breakpoint> &a_breaks) = 0;
163 
164  virtual bool delete_breakpoint () = 0;
165 
166  virtual bool delete_breakpoint (const string &a_breakpoint_num) = 0;
167 
168  virtual bool delete_breakpoint (const UString &a_file_uri,
169  int a_linenum) = 0;
170 
171  virtual IDebuggerSafePtr& debugger () = 0;
172 
173  virtual bool set_where (const UString &a_uri,
174  int line,
175  bool a_do_scroll=true) = 0;
176 
177  virtual Gtk::Widget* get_contextual_menu () = 0;
178 
179  virtual IConfMgr& get_conf_mgr () = 0;
180 
181  virtual bool uses_launch_terminal () const = 0;
182 
183  virtual void uses_launch_terminal (bool a_flag) = 0;
184 
185  virtual sigc::signal<void, bool>& activated_signal () = 0;
186 
187  virtual sigc::signal<void>& layout_changed_signal () = 0;
188 
189  virtual bool agree_to_shutdown () = 0;
190 };//end class IDBGPerspective
191 
192 NEMIVER_END_NAMESPACE (nemiver)
193 #endif //__NMV_DBG_PERSPECTIVE_H__
nemiver::ISessMgr
Definition: nmv-sess-mgr.h:49
nemiver::IPerspective::edit_workbench_menu
virtual void edit_workbench_menu()=0
nemiver::MEMORY_VIEW_TITLE
const char * MEMORY_VIEW_TITLE
nemiver
Definition: nmv-address.h:31
nemiver::CONTEXT_VIEW_INDEX
@ CONTEXT_VIEW_INDEX
Definition: nmv-dbg-perspective.h:46
nemiver::IPerspective::get_body
virtual Gtk::Widget * get_body()=0
nemiver::IWorkbench
the interface of the Workbench. The workbench is what you see graphically when you use Nemiver....
Definition: nmv-i-workbench.h:93
nemiver::TARGET_TERMINAL_VIEW_INDEX
@ TARGET_TERMINAL_VIEW_INDEX
Definition: nmv-dbg-perspective.h:45
NEMIVER_API
#define NEMIVER_API
Definition: nmv-api-macros.h:53
nemiver::IPerspective::load_menu
virtual Gtk::Widget * load_menu(const UString &a_filename, const UString &a_widget_name)=0
load a menu file
nemiver::common::DynamicModule
The base class for loadable modules.
Definition: nmv-dynamic-module.h:76
nemiver::IPerspective::close_current_file
virtual void close_current_file()=0
close the currently selected file
nemiver::EXPR_MONITOR_VIEW_INDEX
@ EXPR_MONITOR_VIEW_INDEX
Definition: nmv-dbg-perspective.h:52
nmv-sess-mgr.h
nemiver::common::UString
Definition: nmv-ustring.h:45
nemiver::IDBGPerspective::~IDBGPerspective
virtual ~IDBGPerspective()
Definition: nmv-dbg-perspective.h:68
nemiver::BREAKPOINTS_VIEW_TITLE
const char * BREAKPOINTS_VIEW_TITLE
nemiver::TARGET_TERMINAL_VIEW_TITLE
const char * TARGET_TERMINAL_VIEW_TITLE
nemiver::REGISTERS_VIEW_TITLE
const char * REGISTERS_VIEW_TITLE
nemiver::IDBGPerspective::IDBGPerspective
IDBGPerspective(DynamicModule *a_dynmod)
Definition: nmv-dbg-perspective.h:63
nemiver::IConfMgr
Definition: nmv-i-conf-mgr.h:46
nemiver::IPerspective::agree_to_shutdown
virtual bool agree_to_shutdown()=0
Should return true to allow shutdown. This Method will be called for each perspective before workbenc...
nemiver::IPerspective::get_toolbars
virtual void get_toolbars(list< Gtk::Widget * > &a_tbs)=0
nemiver::IDBGPerspective
Definition: nmv-dbg-perspective.h:56
nmv-i-conf-mgr.h
nemiver::REGISTERS_VIEW_INDEX
@ REGISTERS_VIEW_INDEX
Definition: nmv-dbg-perspective.h:48
nemiver::ISessMgr::Session
Definition: nmv-sess-mgr.h:163
nemiver::IPerspective::activated_signal
virtual sigc::signal< void, bool > & activated_signal()=0
nemiver::ViewsIndex
ViewsIndex
Definition: nmv-dbg-perspective.h:43
nemiver::BREAKPOINTS_VIEW_INDEX
@ BREAKPOINTS_VIEW_INDEX
Definition: nmv-dbg-perspective.h:47
nmv-i-perspective.h
nemiver::IPerspective::do_init
virtual void do_init(IWorkbench *a_workbench)=0
nmv-i-debugger.h
nemiver::IDebugger::Breakpoint
a breakpoint descriptor
Definition: nmv-i-debugger.h:90
nemiver::CONTEXT_VIEW_TITLE
const char * CONTEXT_VIEW_TITLE
nemiver::IPerspective
Definition: nmv-i-perspective.h:54
nemiver::IPerspective::layout_changed_signal
virtual sigc::signal< void > & layout_changed_signal()=0
nemiver::IPerspective::get_workbench
virtual IWorkbench & get_workbench()=0
nemiver::common::SafePtr
Definition: nmv-safe-ptr.h:71
nemiver::IPerspective::get_perspective_identifier
virtual const UString & get_perspective_identifier()=0
nemiver::IPerspective::close_file
virtual void close_file(const UString &a_uri)=0
closes a file
nemiver::IPerspective::open_file
virtual void open_file()=0
open a source file