[nemiver/count-point: 13/14] Add a SourceEditor::current_address



commit a5f7103044fd6a0a077df7f742723f9dcae00b3b
Author: Dodji Seketeli <dodji seketeli org>
Date:   Sun Oct 10 17:37:47 2010 +0200

    Add a SourceEditor::current_address
    
    	* src/uicommon/nmv-source-editor.h
    	(SourceEditor::current_address): New API.
    	* src/uicommon/nmv-source-editor.cc
    	(SourceEditor::current_address): Implement the new API.

 src/uicommon/nmv-source-editor.cc |   10 ++++++++++
 src/uicommon/nmv-source-editor.h  |    2 ++
 2 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/src/uicommon/nmv-source-editor.cc b/src/uicommon/nmv-source-editor.cc
index 7d9cd3d..292189d 100644
--- a/src/uicommon/nmv-source-editor.cc
+++ b/src/uicommon/nmv-source-editor.cc
@@ -1563,6 +1563,16 @@ SourceEditor::get_buffer_type () const
     return m_priv->get_buffer_type ();
 }
 
+bool
+SourceEditor::current_address (Address &a_address) const
+{
+  if (get_buffer_type () != BUFFER_TYPE_ASSEMBLY)
+    return false;
+
+  a_address = m_priv->asm_ctxt.current_address;
+  return true;
+}
+
 /// Registers a normal (non-assembly) source buffer.
 /// \param a_buf the source buffer to register.
 void
diff --git a/src/uicommon/nmv-source-editor.h b/src/uicommon/nmv-source-editor.h
index d1b0600..bbf1442 100644
--- a/src/uicommon/nmv-source-editor.h
+++ b/src/uicommon/nmv-source-editor.h
@@ -142,6 +142,8 @@ public:
 
     BufferType get_buffer_type () const;
 
+    bool current_address (Address&) const;
+
     void register_assembly_source_buffer
                         (Glib::RefPtr<SourceBuffer> &a_buf);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]