[nemiver/count-point: 12/14] Connect asm buffers to relevant signals too
- From: Dodji Seketeli <dodji src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nemiver/count-point: 12/14] Connect asm buffers to relevant signals too
- Date: Sun, 10 Oct 2010 16:37:11 +0000 (UTC)
commit 29e0bbbfc7bc01aab9dfc438665bf4ddc6804a8e
Author: Dodji Seketeli <dodji seketeli org>
Date: Sun Oct 10 17:33:32 2010 +0200
Connect asm buffers to relevant signals too
* src/uicommon/nmv-source-editor.cc
(SourceEditor::Priv::init_common_buffer_signals)
(SourceEditor::Priv::init_assembly_buffer_signals)
(SourceEditor::Priv::init_assembly_context_signals)
(SourceEditor::Priv::init_non_assembly_buffer_signals)
(SourceEditor::Priv::init_non_assembly_context_signals): New fnctions.
(SourceEditor::Priv::register_assembly_source_buffer): Connect
asm buffer to relevant signals
(SourceEditor::Priv::register_non_assembly_source_buffer): Connect
non-asm buffer relevant signals.
(SourceEditor::Priv::init_signals): Separately connect asm and
non-asm buffer to their signals.
src/uicommon/nmv-source-editor.cc | 46 +++++++++++++++++++++++++++++++++---
1 files changed, 42 insertions(+), 4 deletions(-)
---
diff --git a/src/uicommon/nmv-source-editor.cc b/src/uicommon/nmv-source-editor.cc
index 708e1e9..7d9cd3d 100644
--- a/src/uicommon/nmv-source-editor.cc
+++ b/src/uicommon/nmv-source-editor.cc
@@ -266,6 +266,7 @@ struct SourceEditor::Priv {
{
asm_ctxt.buffer = a_buf;
source_view->set_source_buffer (a_buf);
+ init_assembly_buffer_signals ();
}
void
@@ -273,6 +274,7 @@ struct SourceEditor::Priv {
{
non_asm_ctxt.buffer = a_buf;
source_view->set_source_buffer (a_buf);
+ init_non_assembly_buffer_signals ();
}
bool
@@ -596,15 +598,51 @@ struct SourceEditor::Priv {
source_view->marker_region_got_clicked_signal ().connect
(sigc::mem_fun (*this,
&SourceEditor::Priv::on_marker_region_got_clicked));
- source_view->get_buffer ()->signal_mark_set ().connect
+ init_assembly_context_signals ();
+ init_non_assembly_context_signals ();
+ }
+
+ void
+ init_common_buffer_signals (Glib::RefPtr<SourceBuffer> a_buf)
+ {
+ if (!a_buf)
+ return;
+ a_buf->signal_mark_set ().connect
(sigc::mem_fun (*this, &SourceEditor::Priv::on_mark_set_signal));
- source_view->get_buffer ()->signal_insert ().connect
+ a_buf->signal_insert ().connect
(sigc::mem_fun (*this, &SourceEditor::Priv::on_signal_insert));
+ a_buf->signal_mark_set ().connect
+ (sigc::mem_fun (*this, &SourceEditor::Priv::on_signal_mark_set));
+ }
+
+ void
+ init_assembly_buffer_signals ()
+ {
+ Glib::RefPtr<SourceBuffer> buf = asm_ctxt.buffer;
+ if (!buf)
+ return;
+ init_common_buffer_signals (buf);
+ }
+
+ void
+ init_assembly_context_signals ()
+ {
+ init_assembly_buffer_signals ();
+ }
+
+ void init_non_assembly_buffer_signals ()
+ {
+ Glib::RefPtr<SourceBuffer> buf = non_asm_ctxt.buffer;
+ init_common_buffer_signals (buf);
+ }
+
+ void
+ init_non_assembly_context_signals ()
+ {
non_asm_ctxt.signal_insertion_moved.connect
(sigc::mem_fun (*this,
&SourceEditor::Priv::on_signal_insertion_moved));
- source_view->get_buffer ()->signal_mark_set ().connect
- (sigc::mem_fun (*this, &SourceEditor::Priv::on_signal_mark_set));
+ init_non_assembly_buffer_signals ();
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]