gtksourceviewmm r58 - in trunk: . gtksourceview/gtksourceviewmm gtksourceview/gtksourceviewmm/private gtksourceview/src tools/m4



Author: jjongsma
Date: Sat Jan 12 20:01:20 2008
New Revision: 58
URL: http://svn.gnome.org/viewvc/gtksourceviewmm?rev=58&view=rev

Log:
2008-01-12  Jonathon Jongsma  <jjongsma gnome org>

	* gtksourceview/src/Makefile_list_of_hg.am_fragment:
	* gtksourceview/src/sourcebuffer.ccg:
	* gtksourceview/src/sourcebuffer.hg:
	* gtksourceview/src/sourcemark.ccg:
	* gtksourceview/src/sourcemark.hg:
	* tools/m4/convert_gtksourceviewmm.m4: added SourceMark class and
	SourceMark-related API to SourceBuffer


Added:
   trunk/gtksourceview/src/sourcemark.ccg
   trunk/gtksourceview/src/sourcemark.hg
Modified:
   trunk/ChangeLog
   trunk/gtksourceview/gtksourceviewmm/   (props changed)
   trunk/gtksourceview/gtksourceviewmm/private/   (props changed)
   trunk/gtksourceview/src/Makefile_list_of_hg.am_fragment
   trunk/gtksourceview/src/sourcebuffer.ccg
   trunk/gtksourceview/src/sourcebuffer.hg
   trunk/tools/m4/convert_gtksourceviewmm.m4

Modified: trunk/gtksourceview/src/Makefile_list_of_hg.am_fragment
==============================================================================
--- trunk/gtksourceview/src/Makefile_list_of_hg.am_fragment	(original)
+++ trunk/gtksourceview/src/Makefile_list_of_hg.am_fragment	Sat Jan 12 20:01:20 2008
@@ -11,7 +11,8 @@
 sourcelanguagemanager.hg \
 sourceview.hg \
 sourcebuffer.hg \
-sourceiter.hg
+sourceiter.hg \
+sourcemark.hg
 
 files_general_deprecated_hg =
 

Modified: trunk/gtksourceview/src/sourcebuffer.ccg
==============================================================================
--- trunk/gtksourceview/src/sourcebuffer.ccg	(original)
+++ trunk/gtksourceview/src/sourcebuffer.ccg	Sat Jan 12 20:01:20 2008
@@ -39,6 +39,26 @@
     }
 }
 
+bool SourceBuffer::backward_iter_to_mark(Gtk::TextIter& iter)
+{
+    return gtk_source_buffer_backward_iter_to_mark(gobj(), iter.gobj(), NULL);
+}
+
+bool SourceBuffer::forward_iter_to_mark(Gtk::TextIter& iter)
+{
+    return gtk_source_buffer_forward_iter_to_mark(gobj(), iter.gobj(), NULL);
+}
+
+Glib::SListHandle<Glib::RefPtr<SourceMark> > SourceBuffer::get_marks_at_line(int line) const
+{
+    return Glib::SListHandle<Glib::RefPtr<SourceMark> >(gtk_source_buffer_get_marks_at_line(const_cast<GtkSourceBuffer*>(gobj()), line, NULL), Glib::OWNERSHIP_SHALLOW);
+}
+
+Glib::SListHandle<Glib::RefPtr<SourceMark> > SourceBuffer::get_marks_at_iter(Gtk::TextIter& iter) const
+{
+    return Glib::SListHandle<Glib::RefPtr<SourceMark> >(gtk_source_buffer_get_marks_at_iter(const_cast<GtkSourceBuffer*>(gobj()), iter.gobj(), NULL), Glib::OWNERSHIP_SHALLOW);
+}
+
 }//end namespace gtksourceview
 
 

Modified: trunk/gtksourceview/src/sourcebuffer.hg
==============================================================================
--- trunk/gtksourceview/src/sourcebuffer.hg	(original)
+++ trunk/gtksourceview/src/sourcebuffer.hg	Sat Jan 12 20:01:20 2008
@@ -25,6 +25,7 @@
 
 #include <gtkmm/textbuffer.h>
 #include <gtksourceviewmm/sourcelanguage.h>
+#include <gtksourceviewmm/sourcemark.h>
 
 _DEFS(gtksourceviewmm,gtksourceview)
 _PINCLUDE(gtkmm/private/textbuffer_p.h)
@@ -200,16 +201,23 @@
 
   _WRAP_METHOD(bool backward_iter_to_mark(Gtk::TextIter& iter, const Glib::ustring& category), gtk_source_buffer_backward_iter_to_mark)
   // overload with category == NULL
-  //_WRAP_METHOD(bool backward_iter_to_mark(Gtk::TextIter& iter), gtk_source_buffer_backward_iter_to_mark)
+  bool backward_iter_to_mark(Gtk::TextIter& iter);
 
   _WRAP_METHOD(bool forward_iter_to_mark(Gtk::TextIter& iter, const Glib::ustring& category), gtk_source_buffer_forward_iter_to_mark)
   // overload with category == NULL
-  //_WRAP_METHOD(bool forward_iter_to_mark(Gtk::TextIter& iter), gtk_source_buffer_forward_iter_to_mark)
+  bool forward_iter_to_mark(Gtk::TextIter& iter);
 
   _WRAP_METHOD(void ensure_highlight(const Gtk::TextIter& start, const Gtk::TextIter& end), gtk_source_buffer_ensure_highlight)
   _WRAP_METHOD(void set_style_scheme(const Glib::RefPtr<SourceStyleScheme>& scheme), gtk_source_buffer_set_style_scheme)
   _WRAP_METHOD(Glib::RefPtr<SourceStyleScheme> get_style_scheme(), gtk_source_buffer_get_style_scheme, refreturn)
   _WRAP_METHOD(Glib::RefPtr<const SourceStyleScheme> get_style_scheme() const, gtk_source_buffer_get_style_scheme, constversion, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<SourceMark> create_mark(const Glib::ustring& name, const Glib::ustring& category, const Gtk::TextIter& where), gtk_source_buffer_create_mark)
+  _WRAP_METHOD(Glib::SListHandle<Glib::RefPtr<SourceMark> > get_marks_at_line(int line, const Glib::ustring& category) const, gtk_source_buffer_get_marks_at_line)
+  // overloaded with category == NULL
+  Glib::SListHandle<Glib::RefPtr<SourceMark> > get_marks_at_line(int line) const;
+  _WRAP_METHOD(Glib::SListHandle<Glib::RefPtr<SourceMark> > get_marks_at_iter(Gtk::TextIter& iter, const Glib::ustring& category) const, gtk_source_buffer_get_marks_at_iter)
+  // overloaded with category == NULL
+  Glib::SListHandle<Glib::RefPtr<SourceMark> > get_marks_at_iter(Gtk::TextIter& iter) const;
 
 
   /// \name signals

Added: trunk/gtksourceview/src/sourcemark.ccg
==============================================================================
--- (empty file)
+++ trunk/gtksourceview/src/sourcemark.ccg	Sat Jan 12 20:01:20 2008
@@ -0,0 +1,34 @@
+/* sourcemark.hg
+ *
+ * Copyright (C)2008 Jonathon Jongsma
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <gtksourceview/gtksourcemark.h>
+
+namespace gtksourceview {
+
+Glib::RefPtr<SourceMark> SourceMark::next() const
+{
+    return Glib::wrap (gtk_source_mark_next(const_cast<GtkSourceMark*>(gobj()), NULL));
+}
+
+Glib::RefPtr<SourceMark> SourceMark::prev() const
+{
+    return Glib::wrap (gtk_source_mark_prev(const_cast<GtkSourceMark*>(gobj()), NULL));
+}
+
+}

Added: trunk/gtksourceview/src/sourcemark.hg
==============================================================================
--- (empty file)
+++ trunk/gtksourceview/src/sourcemark.hg	Sat Jan 12 20:01:20 2008
@@ -0,0 +1,55 @@
+/* sourcemark.hg
+ * 
+ * Copyright (C)2008 Jonathon Jongsma
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/// \file
+/// \brief SourceMark class
+
+#include <gtkmm/textmark.h>
+
+_DEFS(gtksourceviewmm,gtksourceview)
+_PINCLUDE(gtkmm/private/textmark_p.h)
+
+namespace gtksourceview
+{
+
+class SourceMark : public Gtk::TextMark
+{
+
+    _CLASS_GOBJECT(SourceMark, GtkSourceMark, GTK_SOURCE_MARK, Gtk::TextMark, GtkTextMark)
+
+protected:
+  _CTOR_DEFAULT
+
+  _WRAP_CTOR(SourceMark(const Glib::ustring& category), gtk_source_mark_new)
+
+public:
+   _WRAP_CREATE(const Glib::ustring& category)
+
+  _WRAP_METHOD(Glib::ustring get_category() const, gtk_source_mark_get_category)
+  _WRAP_METHOD(Glib::RefPtr<SourceMark> next(const Glib::ustring& category) const, gtk_source_mark_next)
+  // overloaded for category == NULL
+  Glib::RefPtr<SourceMark> next() const;
+  _WRAP_METHOD(Glib::RefPtr<SourceMark> prev(const Glib::ustring& category) const, gtk_source_mark_prev)
+  // overloaded for category == NULL
+  Glib::RefPtr<SourceMark> prev() const;
+};//end class SourceMark
+
+}//end namespace gtksourceview
+
+

Modified: trunk/tools/m4/convert_gtksourceviewmm.m4
==============================================================================
--- trunk/tools/m4/convert_gtksourceviewmm.m4	(original)
+++ trunk/tools/m4/convert_gtksourceviewmm.m4	Sat Jan 12 20:01:20 2008
@@ -18,14 +18,14 @@
 
 _CONVERSION(`GtkSourceStyle*',`Glib::RefPtr<SourceStyle>',`Glib::wrap($3)')
 
-#SourceMarker
-_CONVERSION(`GtkSourceMarker*',`Glib::RefPtr<SourceMarker>',`Glib::wrap($3)')
-_CONVERSION(`GtkSourceMarker*',`Glib::RefPtr<const SourceMarker>',`Glib::wrap($3)')
-#_CONVERSION(`Glib::RefPtr<SourceMarker>',`GtkSourceMarker*',__CONVERT_REFPTR_TO_P)
-_CONVERSION(`const Glib::RefPtr<SourceMarker>&',`GtkSourceMarker*',__CONVERT_REFPTR_TO_P)
-#_CONVERSION(`GSList*',`Glib::SListHandle<Glib::RefPtr<SourceMarker> >', __FL2H_SHALLOW)
-_CONVERSION(`GSList*',`Glib::SListHandle<Glib::RefPtr<SourceMarker> >', `$2($3, Glib::OWNERSHIP_SHALLOW)')
-_CONVERSION(`GSList*',`Glib::SListHandle<Glib::RefPtr<const SourceMarker> >', `$2($3, Glib::OWNERSHIP_SHALLOW)')
+#SourceMark
+_CONVERSION(`GtkSourceMark*',`Glib::RefPtr<SourceMark>',`Glib::wrap($3)')
+_CONVERSION(`GtkSourceMark*',`Glib::RefPtr<const SourceMark>',`Glib::wrap($3)')
+#_CONVERSION(`Glib::RefPtr<SourceMark>',`GtkSourceMark*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`const Glib::RefPtr<SourceMark>&',`GtkSourceMark*',__CONVERT_REFPTR_TO_P)
+#_CONVERSION(`GSList*',`Glib::SListHandle<Glib::RefPtr<SourceMark> >', __FL2H_SHALLOW)
+_CONVERSION(`GSList*',`Glib::SListHandle<Glib::RefPtr<SourceMark> >', `$2($3, Glib::OWNERSHIP_SHALLOW)')
+_CONVERSION(`GSList*',`Glib::SListHandle<Glib::RefPtr<const SourceMark> >', `$2($3, Glib::OWNERSHIP_SHALLOW)')
 
 #TextIter
 _CONVERSION(`const Gtk::TextIter&',`const GtkTextIter*',`$3.gobj()')



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