nemiver r679 - in trunk: . src/persp/dbgperspective src/uicommon



Author: jjongsma
Date: Sun Jan 13 21:13:25 2008
New Revision: 679
URL: http://svn.gnome.org/viewvc/nemiver?rev=679&view=rev

Log:
port to gtksourceviewmm-2.0


Modified:
   trunk/config.h.in
   trunk/configure.ac
   trunk/src/persp/dbgperspective/nmv-dbg-perspective.cc
   trunk/src/uicommon/nmv-source-editor.cc
   trunk/src/uicommon/nmv-source-editor.h

Modified: trunk/config.h.in
==============================================================================
--- trunk/config.h.in	(original)
+++ trunk/config.h.in	Sun Jan 13 21:13:25 2008
@@ -93,9 +93,6 @@
 /* Version number of package */
 #undef VERSION
 
-/* enable global variables widgets */
-#undef WITH_GLOBAL_VARIABLES
-
 /* compile the workbench */
 #undef WITH_MEMORYVIEW
 

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Sun Jan 13 21:13:25 2008
@@ -36,7 +36,7 @@
 AC_SUBST([LIBXML2_VERSION])
 LIBGTKMM_VERSION=2.6.0
 LIBGLADEMM_VERSION=2.6.0
-LIBGTKSOURCEVIEWMM_VERSION=0.3.0
+LIBGTKSOURCEVIEWMM_VERSION=1.9.4
 SQLITE3_VERSION=3.0
 LIBGTOP_VERSION=2.14
 LIBVTE_VERSION=0.12.0
@@ -220,7 +220,7 @@
 if test x$ENABLE_WORKBENCH = xyes ; then
     PKG_CHECK_MODULES(LIBGTKMM, [gtkmm-2.4 >= $LIBGTKMM_VERSION])
     PKG_CHECK_MODULES(LIBGLADEMM, [libglademm-2.4 >= $LIBGLADEMM_VERSION])
-    PKG_CHECK_MODULES(LIBGTKSOURCEVIEWMM, [libgtksourceviewmm-1.0 >= $LIBGTKSOURCEVIEWMM_VERSION])
+    PKG_CHECK_MODULES(LIBGTKSOURCEVIEWMM, [gtksourceviewmm-2.0 >= $LIBGTKSOURCEVIEWMM_VERSION])
 fi
 
 if test x$ENABLE_MEMORYVIEW = xyes ; then

Modified: trunk/src/persp/dbgperspective/nmv-dbg-perspective.cc
==============================================================================
--- trunk/src/persp/dbgperspective/nmv-dbg-perspective.cc	(original)
+++ trunk/src/persp/dbgperspective/nmv-dbg-perspective.cc	Sun Jan 13 21:13:25 2008
@@ -33,11 +33,12 @@
 #include <libgnomevfs/gnome-vfs-ops.h>
 #include <libgnomevfs/gnome-vfs-utils.h>
 #include <gtksourceviewmm/init.h>
-#include <gtksourceviewmm/sourcelanguagesmanager.h>
+#include <gtksourceviewmm/sourcelanguagemanager.h>
 #include <pangomm/fontdescription.h>
 #include <gtkmm/clipboard.h>
 #include <gtkmm/separatortoolitem.h>
 #include <gdkmm/cursor.h>
+#include <gtk/gtkseparatortoolitem.h>
 #include "common/nmv-safe-ptr-utils.h"
 #include "common/nmv-env.h"
 #include "common/nmv-date-utils.h"
@@ -1642,7 +1643,7 @@
              it != m_priv->pagenum_2_source_editor_map.end ();
              ++it) {
             if (it->second && it->second->source_view ().get_buffer ()) {
-                it->second->source_view ().get_source_buffer ()->set_highlight
+                it->second->source_view ().get_source_buffer ()->set_highlight_syntax
                                                 (boost::get<bool> (a_value)) ;
             }
         }
@@ -3770,10 +3771,10 @@
     }
     LOG_DD ("file has mime type: " << mime_type) ;
 
-    Glib::RefPtr<SourceLanguagesManager> lang_manager =
-                                    SourceLanguagesManager::create () ;
+    Glib::RefPtr<SourceLanguageManager> lang_manager =
+                                    SourceLanguageManager::create () ;
     Glib::RefPtr<SourceLanguage> lang =
-        lang_manager->get_language_from_mime_type (mime_type) ;
+        lang_manager->get_language (mime_type) ;
 
     Glib::RefPtr<SourceBuffer> source_buffer ;
     if (a_source_buffer) {
@@ -3800,7 +3801,7 @@
     }
     file.close () ;
 
-    source_buffer->set_highlight (m_priv->enable_syntax_highlight) ;
+    source_buffer->set_highlight_syntax (m_priv->enable_syntax_highlight) ;
 
     a_source_buffer = source_buffer ;
     NEMIVER_CATCH_AND_RETURN (false) ;
@@ -3872,10 +3873,10 @@
         Gtk::TextIter cur_line_iter =
                 source_buffer->get_iter_at_line (a_current_line) ;
         if (cur_line_iter) {
-            Glib::RefPtr<SourceMarker> where_marker =
-                source_buffer->create_marker ("where-marker",
-                                              "line-pointer-marker",
-                                              cur_line_iter) ;
+            Glib::RefPtr<SourceMark> where_marker =
+                source_buffer->create_mark (WHERE_MARK,
+                                            WHERE_CATEGORY,
+                                            cur_line_iter) ;
             THROW_IF_FAIL (where_marker) ;
         }
     }

Modified: trunk/src/uicommon/nmv-source-editor.cc
==============================================================================
--- trunk/src/uicommon/nmv-source-editor.cc	(original)
+++ trunk/src/uicommon/nmv-source-editor.cc	Sun Jan 13 21:13:25 2008
@@ -27,7 +27,7 @@
 #include <gtkmm/table.h>
 #include <gtkmm/label.h>
 #include <gtkmm/scrolledwindow.h>
-#include <gtksourceviewmm/sourcemarker.h>
+#include <gtksourceviewmm/sourcemark.h>
 #include <gtksourceviewmm/sourceiter.h>
 #include "common/nmv-exception.h"
 #include "common/nmv-sequence.h"
@@ -36,15 +36,18 @@
 
 using namespace std ;
 using namespace nemiver::common;
-using gtksourceview::SourceMarker;
+using gtksourceview::SourceMark;
 using gtksourceview::SourceIter;
 using gtksourceview::SearchFlags;
 
-#define BREAKPOINT_TYPE_ENABLED     "breakpoint-enabled-type"
-#define BREAKPOINT_TYPE_DISABLED    "breakpoint-disabled-type"
-
 namespace nemiver {
 
+const char* BREAKPOINT_ENABLED_CATEGORY = "breakpoint-enabled-category";
+const char* BREAKPOINT_DISABLED_CATEGORY = "breakpoint-disabled-category";
+const char* WHERE_CATEGORY = "line-pointer-category";
+
+const char* WHERE_MARK = "where-marker";
+
 class SourceView : public gtksourceview::SourceView {
 
     sigc::signal<void, int> m_marker_region_got_clicked_signal ;
@@ -132,7 +135,7 @@
 
 struct SourceEditor::Priv {
     Sequence sequence ;
-    std::map<int, Glib::RefPtr<gtksourceview::SourceMarker> > markers ;
+    std::map<int, Glib::RefPtr<gtksourceview::SourceMark> > markers ;
     UString root_dir ;
     gint current_column ;
     gint current_line ;
@@ -266,7 +269,8 @@
 
         Glib::RefPtr<Gdk::Pixbuf> bm_pixbuf =
                                 Gdk::Pixbuf::create_from_file (path) ;
-        source_view->set_marker_pixbuf (a_name, bm_pixbuf) ;
+        source_view->set_mark_category_pixbuf (a_name, bm_pixbuf) ;
+        source_view->set_mark_category_priority (a_name, 0);
     }
 
     void init ()
@@ -275,10 +279,10 @@
         status_box->pack_end (*line_col_label, Gtk::PACK_SHRINK) ;
         init_signals () ;
         source_view->set_editable (false) ;
-        register_breakpoint_marker_type (BREAKPOINT_TYPE_ENABLED,
+        register_breakpoint_marker_type (BREAKPOINT_ENABLED_CATEGORY,
                                          "icons/breakpoint-marker.png");
         register_breakpoint_marker_type
-                                (BREAKPOINT_TYPE_DISABLED,
+                                (BREAKPOINT_DISABLED_CATEGORY,
                                  "icons/breakpoint-disabled-marker.png");
     }
 
@@ -325,9 +329,11 @@
         THROW ("could not get path to line-pointer.png") ;
     }
     Glib::RefPtr<Gdk::Pixbuf> lp_pixbuf = Gdk::Pixbuf::create_from_file (path) ;
-    source_view ().set_marker_pixbuf ("line-pointer-marker", lp_pixbuf) ;
+    source_view ().set_mark_category_pixbuf (WHERE_CATEGORY, lp_pixbuf) ;
+    // show this on top
+    source_view ().set_mark_category_priority (WHERE_CATEGORY, 100);
 
-    source_view ().set_show_line_markers (true) ;
+    source_view ().set_show_line_marks (true) ;
 }
 
 SourceEditor::SourceEditor ()
@@ -389,18 +395,18 @@
             source_view ().get_source_buffer ()->get_iter_at_line (a_line - 1) ;
     THROW_IF_FAIL (line_iter) ;
 
-    Glib::RefPtr<SourceMarker> where_marker =
-        source_view ().get_source_buffer ()->get_marker ("where-marker") ;
+    Glib::RefPtr<Gtk::TextMark> where_marker =
+        source_view ().get_source_buffer ()->get_mark (WHERE_MARK) ;
     if (!where_marker) {
-        Glib::RefPtr<SourceMarker> where_marker =
-            source_view ().get_source_buffer ()->create_marker
-                                                        ("where-marker",
-                                                         "line-pointer-marker",
+        Glib::RefPtr<Gtk::TextMark> where_marker =
+            source_view ().get_source_buffer ()->create_mark
+                                                        (WHERE_MARK,
+                                                         WHERE_CATEGORY,
                                                          line_iter) ;
         THROW_IF_FAIL (where_marker) ;
     } else {
-        source_view ().get_source_buffer ()->move_marker (where_marker,
-                                                          line_iter) ;
+        source_view ().get_source_buffer ()->move_mark (where_marker,
+                                                        line_iter) ;
     }
     if (a_do_scroll) {
         scroll_to_line (a_line) ;
@@ -411,10 +417,10 @@
 void
 SourceEditor::unset_where_marker ()
 {
-    Glib::RefPtr<SourceMarker> where_marker =
-        source_view ().get_source_buffer ()->get_marker ("where-marker") ;
+    Glib::RefPtr<Gtk::TextMark> where_marker =
+        source_view ().get_source_buffer ()->get_mark (WHERE_MARK) ;
     if (where_marker && !where_marker->get_deleted ()) {
-        source_view ().get_source_buffer ()->delete_marker (where_marker) ;
+        source_view ().get_source_buffer ()->delete_mark (where_marker) ;
     }
 }
 
@@ -425,18 +431,18 @@
 
     UString marker_type;
     if (enabled) {
-        marker_type = BREAKPOINT_TYPE_ENABLED;
+        marker_type = BREAKPOINT_ENABLED_CATEGORY;
     } else {
-        marker_type = BREAKPOINT_TYPE_DISABLED;
+        marker_type = BREAKPOINT_DISABLED_CATEGORY;
     }
 
     std::map<int,
-            Glib::RefPtr<gtksourceview::SourceMarker> >::iterator mark_iter =
+            Glib::RefPtr<gtksourceview::SourceMark> >::iterator mark_iter =
                                             m_priv->markers.find (a_line);
     if (mark_iter !=  m_priv->markers.end ()) {
         if (!mark_iter->second->get_deleted ()) {
             LOG_DD ("deleting marker") ;
-            source_view ().get_source_buffer ()->delete_marker
+            source_view ().get_source_buffer ()->delete_mark
                                                     (mark_iter->second);
         }
         m_priv->markers.erase (a_line);
@@ -448,8 +454,8 @@
     UString marker_name = UString::from_int (a_line);
 
     LOG_DD ("creating marker of type: " << marker_type) ;
-    Glib::RefPtr<gtksourceview::SourceMarker> marker =
-        source_view ().get_source_buffer ()->create_marker
+    Glib::RefPtr<gtksourceview::SourceMark> marker =
+        source_view ().get_source_buffer ()->create_mark
                                         (marker_name, marker_type, iter) ;
     m_priv->markers[a_line] = marker ;
 }
@@ -457,20 +463,20 @@
 void
 SourceEditor::remove_visual_breakpoint_from_line (int a_line)
 {
-    std::map<int, Glib::RefPtr<gtksourceview::SourceMarker> >::iterator iter ;
+    std::map<int, Glib::RefPtr<gtksourceview::SourceMark> >::iterator iter ;
     iter = m_priv->markers.find (a_line) ;
     if (iter == m_priv->markers.end ()) {
         return ;
     }
     if (!iter->second->get_deleted ())
-        source_view ().get_source_buffer ()->delete_marker (iter->second) ;
+        source_view ().get_source_buffer ()->delete_mark (iter->second) ;
     m_priv->markers.erase (iter) ;
 }
 
 bool
 SourceEditor::is_visual_breakpoint_set_at_line (int a_line) const
 {
-    std::map<int, Glib::RefPtr<gtksourceview::SourceMarker> >::iterator iter ;
+    std::map<int, Glib::RefPtr<gtksourceview::SourceMark> >::iterator iter ;
     iter = m_priv->markers.find (a_line) ;
     if (iter == m_priv->markers.end ()) {
         return false ;

Modified: trunk/src/uicommon/nmv-source-editor.h
==============================================================================
--- trunk/src/uicommon/nmv-source-editor.h	(original)
+++ trunk/src/uicommon/nmv-source-editor.h	Sun Jan 13 21:13:25 2008
@@ -40,6 +40,13 @@
 
 namespace nemiver {
 
+extern const char* BREAKPOINT_ENABLED_CATEGORY;
+extern const char* BREAKPOINT_DISABLED_CATEGORY;
+extern const char* WHERE_CATEGORY;
+
+extern const char* WHERE_MARK;
+
+
 class SourceEditor : public  VBox {
     //non copyable
     SourceEditor (const SourceEditor&) ;



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