[gtksourceviewmm/devel] Handle some more NULL cases.



commit 3109e098e3a6f648edbc8822736633fb89937ce7
Author: Krzesimir Nowak <qdlacz gmail com>
Date:   Wed Jan 13 00:07:35 2010 +0100

    Handle some more NULL cases.
    
    * gtksourceview/src/sourcebuffer.ccg:
    * sourcebuffer.hg: Added method overloads for creating anonymous
    source marks and removing them of any category. Also renamed all
    NULLs into 0s.
    * gtksourceview/src/sourcecompletion.ccg:
    * gtksourceview/src/sourcecompletion.hg: Added method overload
    creating context at current cursor position.
    * gtksourceview/src/sourcecompletioninfo.ccg:
    * gtksourceview/src/sourcecompletioninfo.hg: Added method overload
    moving info window to current cursor position.

 gtksourceview/src/sourcebuffer.ccg         |   22 +++++++++++++++++-----
 gtksourceview/src/sourcebuffer.hg          |    3 +++
 gtksourceview/src/sourcecompletion.ccg     |   11 +++++++++++
 gtksourceview/src/sourcecompletion.hg      |    1 +
 gtksourceview/src/sourcecompletioninfo.ccg |   11 +++++++++++
 gtksourceview/src/sourcecompletioninfo.hg  |    1 +
 6 files changed, 44 insertions(+), 5 deletions(-)
---
diff --git a/gtksourceview/src/sourcebuffer.ccg b/gtksourceview/src/sourcebuffer.ccg
index 5056d15..11a4290 100644
--- a/gtksourceview/src/sourcebuffer.ccg
+++ b/gtksourceview/src/sourcebuffer.ccg
@@ -36,28 +36,40 @@ SourceBuffer::SourceBuffer (const Glib::RefPtr<SourceLanguage> &language) :
     else
     {
         gtk_source_buffer_set_language (GTK_SOURCE_BUFFER (gobject_),
-                                        NULL) ;
+                                        0) ;
     }
 }
 
 bool SourceBuffer::backward_iter_to_source_mark(Gtk::TextIter& iter)
 {
-    return gtk_source_buffer_backward_iter_to_source_mark(gobj(), iter.gobj(), NULL);
+    return gtk_source_buffer_backward_iter_to_source_mark(gobj(), iter.gobj(), 0);
 }
 
 bool SourceBuffer::forward_iter_to_source_mark(Gtk::TextIter& iter)
 {
-    return gtk_source_buffer_forward_iter_to_source_mark(gobj(), iter.gobj(), NULL);
+    return gtk_source_buffer_forward_iter_to_source_mark(gobj(), iter.gobj(), 0);
+}
+
+Glib::RefPtr<SourceMark>
+SourceBuffer::create_source_mark(const Glib::ustring& category, const Gtk::TextIter& where)
+{
+  return Glib::wrap(gtk_source_buffer_create_source_mark(gobj(), 0, category.c_str(), where.gobj()));
 }
 
 Glib::SListHandle<Glib::RefPtr<SourceMark> > SourceBuffer::get_source_marks_at_line(int line) const
 {
-    return Glib::SListHandle<Glib::RefPtr<SourceMark> >(gtk_source_buffer_get_source_marks_at_line(const_cast<GtkSourceBuffer*>(gobj()), line, NULL), Glib::OWNERSHIP_SHALLOW);
+    return Glib::SListHandle<Glib::RefPtr<SourceMark> >(gtk_source_buffer_get_source_marks_at_line(const_cast<GtkSourceBuffer*>(gobj()), line, 0), Glib::OWNERSHIP_SHALLOW);
 }
 
 Glib::SListHandle<Glib::RefPtr<SourceMark> > SourceBuffer::get_source_marks_at_iter(Gtk::TextIter& iter) const
 {
-    return Glib::SListHandle<Glib::RefPtr<SourceMark> >(gtk_source_buffer_get_source_marks_at_iter(const_cast<GtkSourceBuffer*>(gobj()), iter.gobj(), NULL), Glib::OWNERSHIP_SHALLOW);
+    return Glib::SListHandle<Glib::RefPtr<SourceMark> >(gtk_source_buffer_get_source_marks_at_iter(const_cast<GtkSourceBuffer*>(gobj()), iter.gobj(), 0), Glib::OWNERSHIP_SHALLOW);
+}
+
+void
+SourceBuffer::remove_source_marks(const Gtk::TextIter& start, const Gtk::TextIter& end)
+{
+  gtk_source_buffer_remove_source_marks(gobj(), start.gobj(), end.gobj(), 0);
 }
 
 }//end namespace gtksourceview
diff --git a/gtksourceview/src/sourcebuffer.hg b/gtksourceview/src/sourcebuffer.hg
index 80455b3..4d0615b 100644
--- a/gtksourceview/src/sourcebuffer.hg
+++ b/gtksourceview/src/sourcebuffer.hg
@@ -260,6 +260,8 @@ public:
   /// \return the newly created #SourceMark
   _WRAP_METHOD(Glib::RefPtr<SourceMark> create_source_mark(const Glib::ustring& name, const Glib::ustring& category, const Gtk::TextIter& where), gtk_source_buffer_create_source_mark)
 
+  Glib::RefPtr<SourceMark> create_source_mark(const Glib::ustring& category, const Gtk::TextIter& where);
+
 #m4 _CONVERSION(`GSList*',`Glib::SListHandle<Glib::RefPtr<SourceMark> >', `$2($3, Glib::OWNERSHIP_SHALLOW)')
 #m4 _CONVERSION(`GSList*',`Glib::SListHandle<Glib::RefPtr<const SourceMark> >', `$2($3, Glib::OWNERSHIP_SHALLOW)')
 
@@ -303,6 +305,7 @@ public:
   /// \param end the end of the region to consider.
   /// \param category the category of the marks to consider.
   _WRAP_METHOD(void remove_source_marks(const Gtk::TextIter& start, const Gtk::TextIter& end, const Glib::ustring& category), gtk_source_buffer_remove_source_marks)
+  void remove_source_marks(const Gtk::TextIter& start, const Gtk::TextIter& end);
 
   _WRAP_METHOD(bool iter_has_context_class(const Gtk::TextIter& iter, const Glib::ustring& context) const, gtk_source_buffer_iter_has_context_class)
 
diff --git a/gtksourceview/src/sourcecompletion.ccg b/gtksourceview/src/sourcecompletion.ccg
index 5f744bd..2e77f2a 100644
--- a/gtksourceview/src/sourcecompletion.ccg
+++ b/gtksourceview/src/sourcecompletion.ccg
@@ -18,3 +18,14 @@
  */
 
 #include <gtksourceview/gtksourcecompletion.h>
+
+namespace gtksourceview
+{
+
+Glib::RefPtr<SourceCompletionContext>
+SourceCompletion::create_context()
+{
+  return Glib::wrap(gtk_source_completion_create_context(gobj(), 0));
+}
+
+} // namespace gtksourceview
diff --git a/gtksourceview/src/sourcecompletion.hg b/gtksourceview/src/sourcecompletion.hg
index 800aa97..37a6b79 100644
--- a/gtksourceview/src/sourcecompletion.hg
+++ b/gtksourceview/src/sourcecompletion.hg
@@ -59,6 +59,7 @@ public:
 #m4 _CONVERSION(`GtkSourceCompletionContext*',`Glib::RefPtr<SourceCompletionContext>',`Glib::wrap($3)')
 #m4 _CONVERSION(`const Gtk::TextIter&',`GtkTextIter*',`const_cast<GtkTextIter*>(($3).gobj())')
   _WRAP_METHOD(Glib::RefPtr<SourceCompletionContext> create_context(const Gtk::TextIter& position), gtk_source_completion_create_context)
+  Glib::RefPtr<SourceCompletionContext> create_context();
 
   _WRAP_METHOD(void move_window(const Gtk::TextIter& position), gtk_source_completion_move_window)
 
diff --git a/gtksourceview/src/sourcecompletioninfo.ccg b/gtksourceview/src/sourcecompletioninfo.ccg
index 22c81ac..5375587 100644
--- a/gtksourceview/src/sourcecompletioninfo.ccg
+++ b/gtksourceview/src/sourcecompletioninfo.ccg
@@ -18,3 +18,14 @@
  */
 
 #include <gtksourceview/gtksourcecompletioninfo.h>
+
+namespace gtksourceview
+{
+
+void
+SourceCompletionInfo::move_to_iter(const Gtk::TextView& view)
+{
+  gtk_source_completion_info_move_to_iter(gobj(), const_cast<GtkTextView*>(view.gobj()), 0);
+}
+
+}
diff --git a/gtksourceview/src/sourcecompletioninfo.hg b/gtksourceview/src/sourcecompletioninfo.hg
index 4c61062..358a849 100644
--- a/gtksourceview/src/sourcecompletioninfo.hg
+++ b/gtksourceview/src/sourcecompletioninfo.hg
@@ -38,6 +38,7 @@ public:
 #m4 _CONVERSION(`const Gtk::TextView&',`GtkTextView*',`const_cast<GtkTextView*>(($3).gobj())')
 #m4 _CONVERSION(`const Gtk::TextIter&',`GtkTextIter*',`const_cast<GtkTextIter*>(($3).gobj())')
   _WRAP_METHOD(void move_to_iter(const Gtk::TextView& view, const Gtk::TextIter& iter), gtk_source_completion_info_move_to_iter)
+  void move_to_iter(const Gtk::TextView& view);
   _WRAP_METHOD(void set_sizing(int width, int height, bool shrink_width, bool shrink_height), gtk_source_completion_info_set_sizing)
   _WRAP_METHOD(void set_widget(Gtk::Widget& widget), gtk_source_completion_info_set_widget)
   _WRAP_METHOD(Gtk::Widget* get_widget(), gtk_source_completion_info_get_widget)



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