25 #ifndef __NMV_SOURCE_EDITOR_H__
26 #define __NMV_SOURCE_EDITOR_H__
31 #include <gtkmm/box.h>
32 #include <gtksourceviewmm/view.h>
50 NEMIVER_BEGIN_NAMESPACE (
nemiver);
81 Glib::RefPtr<Buffer> &a_buf,
82 bool a_composite =
false);
84 View& source_view ()
const;
85 int current_line ()
const;
86 void current_line (
int a_line);
87 int current_column ()
const;
88 const Loc* current_location ()
const;
89 void current_column (
int &a_col);
90 bool move_where_marker_to_line (
int a_line,
bool a_do_scroll =
true);
91 void unset_where_marker ();
92 bool set_visual_breakpoint_at_line (
int a_line,
93 bool a_is_count_point,
95 bool remove_visual_breakpoint_from_line (
int a_line);
96 void clear_decorations ();
97 bool is_visual_breakpoint_set_at_line (
int a_line)
const;
98 bool scroll_to_line (
int a_line);
99 void scroll_to_iter (Gtk::TextIter &a_iter);
100 void set_path (
const UString &a_path);
101 void get_path (
UString &a_path)
const;
102 const UString& get_path ()
const;
103 void get_file_name (
UString &a_file_name);
104 bool get_word_at_position (
int a_x,
107 Gdk::Rectangle &a_start_rect,
108 Gdk::Rectangle &a_end_rect)
const;
110 bool do_search (
const UString &a_str,
111 Gtk::TextIter &a_start,
112 Gtk::TextIter &a_end,
113 bool a_match_case=
false,
114 bool a_match_entire_word=
false,
115 bool a_search_backwards=
false,
116 bool a_clear_selection=
false);
118 void setup_and_popup_menu (GdkEventButton *a_event,
119 Gtk::Widget *attach_to,
120 Gtk::Menu *custom_menu);
122 static bool get_file_mime_type (
const UString &a_path,
125 static bool setup_buffer_mime_and_lang (Glib::RefPtr<Buffer> &a_buf,
126 const std::string &a_mime_type =
129 static Glib::RefPtr<Buffer> create_source_buffer ();
131 static bool load_file (Gtk::Window &a_parent,
133 const std::list<std::string> &a_supported_encodings,
134 bool a_enable_syntaxt_highlight,
135 Glib::RefPtr<Buffer> &a_source_buffer);
152 BufferType get_buffer_type ()
const;
154 bool current_address (
Address&)
const;
156 void register_assembly_source_buffer
157 (Glib::RefPtr<Buffer> &a_buf);
159 void register_non_assembly_source_buffer
160 (Glib::RefPtr<Buffer> &a_buf);
162 Glib::RefPtr<Buffer> get_assembly_source_buffer ()
const;
164 Glib::RefPtr<Buffer> get_non_assembly_source_buffer ()
const;
166 bool switch_to_assembly_source_buffer ();
168 bool switch_to_non_assembly_source_buffer ();
170 bool assembly_buf_addr_to_line (
const Address&,
bool,
int&)
const;
171 bool assembly_buf_line_to_addr (
int,
Address &)
const;
173 bool move_where_marker_to_address (
const Address &address,
176 bool place_cursor_at_line (
size_t);
177 bool place_cursor_at_address (
const Address &);
178 bool set_visual_breakpoint_at_address (
const Address &a_address,
181 bool remove_visual_breakpoint_from_address (
const Address &);
182 bool scroll_to_address (
const Address &a_address,
185 static bool add_asm (Gtk::Window &a_parent_window,
187 const std::list<common::Asm> &a_asm,
189 const list<UString> &a_src_search_dirs,
190 list<UString> &a_session_dirs,
191 std::map<UString, bool> &a_ignore_paths,
192 Glib::RefPtr<Buffer> &a_buf);
194 static bool load_asm (Gtk::Window &a_parent_window,
196 const std::list<common::Asm> &a_asm,
198 const list<UString> &a_src_search_dirs,
199 list<UString> &a_session_dirs,
200 std::map<UString, bool> &a_ignore_paths,
201 Glib::RefPtr<Buffer> &a_buf);
211 marker_region_got_clicked_signal ()
const;
212 sigc::signal<void, const Gtk::TextBuffer::iterator&>&
213 insertion_changed_signal ()
const;
217 NEMIVER_END_NAMESPACE (
nemiver)
219 #endif //__NMV_DBG_SOURCE_EDITOR_H__