gtksourceviewmm r62 - in trunk: . gtksourceview/src tools/m4
- From: murrayc svn gnome org
- To: svn-commits-list gnome org
- Subject: gtksourceviewmm r62 - in trunk: . gtksourceview/src tools/m4
- Date: Sun, 20 Jan 2008 22:17:19 +0000 (GMT)
Author: murrayc
Date: Sun Jan 20 22:17:19 2008
New Revision: 62
URL: http://svn.gnome.org/viewvc/gtksourceviewmm?rev=62&view=rev
Log:
2008-01-20 Murray Cumming <murrayc murrayc com>
* gtksourceview/src/sourcebuffer.hg:
* gtksourceview/src/sourcemark.ccg:
* gtksourceview/src/sourcemark.hg:
* gtksourceview/src/sourcestyleschememanager.hg:
* gtksourceview/src/sourceview.hg:
Const corrections and ref-counting corrections for getter methods.
* tools/m4/convert_gtksourceview.m4:
* tools/m4/convert_gtksourceviewmm.m4: Moved GList and GSList
conversions to the .m4 files, because the ownership is dependent on
the particular function.
Modified:
trunk/ChangeLog
trunk/gtksourceview/src/sourcebuffer.hg
trunk/gtksourceview/src/sourcemark.ccg
trunk/gtksourceview/src/sourcemark.hg
trunk/gtksourceview/src/sourcestyleschememanager.hg
trunk/gtksourceview/src/sourceview.hg
trunk/tools/m4/convert_gtksourceview.m4
trunk/tools/m4/convert_gtksourceviewmm.m4
Modified: trunk/gtksourceview/src/sourcebuffer.hg
==============================================================================
--- trunk/gtksourceview/src/sourcebuffer.hg (original)
+++ trunk/gtksourceview/src/sourcebuffer.hg Sun Jan 20 22:17:19 2008
@@ -212,7 +212,11 @@
_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)
+
+#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)')
_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)
@@ -226,12 +230,12 @@
/// \brief Emitted whenever there is a change in the buffer's ability to redo an operation.
///
/// parameter can_redo: true if the buffer can now perform a redo, false otherwise.
- _WRAP_SIGNAL(void can_redo (bool can_redo), "can-redo")
+ _WRAP_SIGNAL(void can_redo(bool can_redo), "can-redo")
/// \brief Emitted whenever there is a change in the buffer's ability to undo an operation.
///
/// parameter can_undo: true if the buffer can now perfom an undo, false otherwise.
- _WRAP_SIGNAL(void can_undo (bool can_redo), "can-undo")
+ _WRAP_SIGNAL(void can_undo(bool can_redo), "can-undo")
/// \brief Emitted whenever the syntax highlighting information has been updated,
/// so that views can request a redraw if the region changed is visible.
@@ -239,14 +243,14 @@
/// Usually only view widgets displaying this buffer will be interested in this signal.
/// parameter start: an iterator at the start of the updated region.
/// parameter end: and iterator at the end of the updated region.
- _WRAP_SIGNAL(void highlight_updated (Gtk::TextIter &start, Gtk::TextIter &end), "highlight-updated", no_default_handler)
+ _WRAP_SIGNAL(void highlight_updated(Gtk::TextIter& start, Gtk::TextIter& end), "highlight-updated", no_default_handler)
/// \brief Emitted whenever a marker of sourcebuffer has changed and needs to be redisplayed by the view.
///
/// A change in a marker's type or location can trigger this signal.
/// Note that moving a marker causes the emission of this signal twice: one for the old location and one for the new.
/// parameter where: an iterator at the location where the change occurred.
- _WRAP_SIGNAL(void marker_updated (Gtk::TextIter &where), "marker-updated", no_default_handler)
+ _WRAP_SIGNAL(void marker_updated(Gtk::TextIter &where), "marker-updated", no_default_handler)
/// @}
};
Modified: trunk/gtksourceview/src/sourcemark.ccg
==============================================================================
--- trunk/gtksourceview/src/sourcemark.ccg (original)
+++ trunk/gtksourceview/src/sourcemark.ccg Sun Jan 20 22:17:19 2008
@@ -19,16 +19,37 @@
#include <gtksourceview/gtksourcemark.h>
-namespace gtksourceview {
+namespace gtksourceview
+{
+
+Glib::RefPtr<SourceMark> SourceMark::next()
+{
+ Glib::RefPtr<SourceMark> result = Glib::wrap (gtk_source_mark_next(const_cast<GtkSourceMark*>(gobj()), NULL));
+ result->reference();
+ return result;
+}
-Glib::RefPtr<SourceMark> SourceMark::next() const
+Glib::RefPtr<const SourceMark> SourceMark::next() const
{
- return Glib::wrap (gtk_source_mark_next(const_cast<GtkSourceMark*>(gobj()), NULL));
+ Glib::RefPtr<const SourceMark> result = Glib::wrap (gtk_source_mark_next(const_cast<GtkSourceMark*>(gobj()), NULL));
+ result->reference();
+ return result;
}
-Glib::RefPtr<SourceMark> SourceMark::prev() const
+Glib::RefPtr<SourceMark> SourceMark::prev()
{
- return Glib::wrap (gtk_source_mark_prev(const_cast<GtkSourceMark*>(gobj()), NULL));
+ Glib::RefPtr<SourceMark> result = Glib::wrap (gtk_source_mark_prev(const_cast<GtkSourceMark*>(gobj()), NULL));
+ result->reference();
+ return result;
}
+Glib::RefPtr<const SourceMark> SourceMark::prev() const
+{
+ Glib::RefPtr<const SourceMark> result = Glib::wrap (gtk_source_mark_prev(const_cast<GtkSourceMark*>(gobj()), NULL));
+ result->reference();
+ return result;
}
+
+
+} //namespace gtksourceview
+
Modified: trunk/gtksourceview/src/sourcemark.hg
==============================================================================
--- trunk/gtksourceview/src/sourcemark.hg (original)
+++ trunk/gtksourceview/src/sourcemark.hg Sun Jan 20 22:17:19 2008
@@ -30,24 +30,30 @@
class SourceMark : public Gtk::TextMark
{
-
- _CLASS_GOBJECT(SourceMark, GtkSourceMark, GTK_SOURCE_MARK, Gtk::TextMark, GtkTextMark)
+ _CLASS_GOBJECT(SourceMark, GtkSourceMark, GTK_SOURCE_MARK, Gtk::TextMark, GtkTextMark)
protected:
- _CTOR_DEFAULT
+ _CTOR_DEFAULT
_WRAP_CTOR(SourceMark(const Glib::ustring& category), gtk_source_mark_new)
public:
- _WRAP_CREATE(const Glib::ustring& category)
+ _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)
+ _WRAP_METHOD(Glib::RefPtr<SourceMark> next(const Glib::ustring& category), gtk_source_mark_next, refreturn)
+ _WRAP_METHOD(Glib::RefPtr<const SourceMark> next(const Glib::ustring& category) const, gtk_source_mark_next, refreturn, constversion)
+
// overloaded for category == NULL
- Glib::RefPtr<SourceMark> next() const;
- _WRAP_METHOD(Glib::RefPtr<SourceMark> prev(const Glib::ustring& category) const, gtk_source_mark_prev)
+ Glib::RefPtr<SourceMark> next();
+ Glib::RefPtr<const SourceMark> next() const;
+
+ _WRAP_METHOD(Glib::RefPtr<SourceMark> prev(const Glib::ustring& category), gtk_source_mark_prev, refreturn)
+ _WRAP_METHOD(Glib::RefPtr<const SourceMark> prev(const Glib::ustring& category) const, gtk_source_mark_prev, refreturn, constversion)
+
// overloaded for category == NULL
- Glib::RefPtr<SourceMark> prev() const;
+ Glib::RefPtr<SourceMark> prev();
+ Glib::RefPtr<const SourceMark> prev() const;
};//end class SourceMark
}//end namespace gtksourceview
Modified: trunk/gtksourceview/src/sourcestyleschememanager.hg
==============================================================================
--- trunk/gtksourceview/src/sourcestyleschememanager.hg (original)
+++ trunk/gtksourceview/src/sourcestyleschememanager.hg Sun Jan 20 22:17:19 2008
@@ -31,21 +31,21 @@
class SourceStyleSchemeManager : public Glib::Object
{
-
- _CLASS_GOBJECT(SourceStyleSchemeManager, GtkSourceStyleSchemeManager, GTK_SOURCE_STYLE_SCHEME_MANAGER, Glib::Object, GObject)
+ _CLASS_GOBJECT(SourceStyleSchemeManager, GtkSourceStyleSchemeManager, GTK_SOURCE_STYLE_SCHEME_MANAGER, Glib::Object, GObject)
protected:
- _CTOR_DEFAULT
+ _CTOR_DEFAULT
public:
- _WRAP_CREATE()
- static Glib::RefPtr<SourceStyleSchemeManager> get_default();
+ _WRAP_CREATE()
+ static Glib::RefPtr<SourceStyleSchemeManager> get_default();
// TODO: set_search_path() and get_search_path()
_WRAP_METHOD(void append_search_path(const Glib::ustring& path), gtk_source_style_scheme_manager_append_search_path)
_WRAP_METHOD(void prepend_search_path(const Glib::ustring& path), gtk_source_style_scheme_manager_prepend_search_path)
// TODO: get_scheme_ids
- _WRAP_METHOD(Glib::RefPtr<SourceStyleScheme> get_scheme(const Glib::ustring& scheme_id) const, gtk_source_style_scheme_manager_get_scheme)
+ _WRAP_METHOD(Glib::RefPtr<SourceStyleScheme> get_scheme(const Glib::ustring& scheme_id), gtk_source_style_scheme_manager_get_scheme, refreturn)
+ _WRAP_METHOD(Glib::RefPtr<const SourceStyleScheme> get_scheme(const Glib::ustring& scheme_id) const, gtk_source_style_scheme_manager_get_scheme, refreturn, constversion)
_WRAP_METHOD(void force_rescan(), gtk_source_style_scheme_manager_force_rescan)
};//end class SourceStyleSchemeManager
Modified: trunk/gtksourceview/src/sourceview.hg
==============================================================================
--- trunk/gtksourceview/src/sourceview.hg (original)
+++ trunk/gtksourceview/src/sourceview.hg Sun Jan 20 22:17:19 2008
@@ -161,7 +161,8 @@
_WRAP_METHOD(void set_mark_category_priority(const Glib::ustring& category, gint priority), gtk_source_view_set_mark_category_priority)
_WRAP_METHOD(gint get_mark_category_priority(const Glib::ustring& category) const, gtk_source_view_get_mark_category_priority)
_WRAP_METHOD(void set_mark_category_pixbuf(const Glib::ustring& category, const Glib::RefPtr<Gdk::Pixbuf>& pixbuf), gtk_source_view_set_mark_category_pixbuf)
- _WRAP_METHOD(Glib::RefPtr<Gdk::Pixbuf> get_mark_category_pixbuf(const Glib::ustring& category) const, gtk_source_view_get_mark_category_pixbuf)
+ _WRAP_METHOD(Glib::RefPtr<Gdk::Pixbuf> get_mark_category_pixbuf(const Glib::ustring& category), gtk_source_view_get_mark_category_pixbuf, refreturn)
+ _WRAP_METHOD(Glib::RefPtr<const Gdk::Pixbuf> get_mark_category_pixbuf(const Glib::ustring& category) const, gtk_source_view_get_mark_category_pixbuf, refreturn, constversion)
_WRAP_SIGNAL(void redo(), "redo")
Modified: trunk/tools/m4/convert_gtksourceview.m4
==============================================================================
--- trunk/tools/m4/convert_gtksourceview.m4 (original)
+++ trunk/tools/m4/convert_gtksourceview.m4 Sun Jan 20 22:17:19 2008
@@ -2,7 +2,6 @@
_CONVERSION(`GtkSourceLanguage*',`Glib::RefPtr<const SourceLanguage>',`Glib::wrap($3)')
#_CONVERSION(`Glib::RefPtr<SourceLanguage>',`GtkSourceLanguage*',__CONVERT_REFPTR_TO_P)
_CONVERSION(`const Glib::SListHandle<Glib::ustring>&', `GSList*',`$3.data()')
-_CONVERSION(`GSList*',`Glib::SListHandle<Glib::ustring>', `$2($3, Glib::OWNERSHIP_DEEP)')
_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)
Modified: trunk/tools/m4/convert_gtksourceviewmm.m4
==============================================================================
--- trunk/tools/m4/convert_gtksourceviewmm.m4 (original)
+++ trunk/tools/m4/convert_gtksourceviewmm.m4 Sun Jan 20 22:17:19 2008
@@ -3,9 +3,6 @@
_CONVERSION(`GtkSourceLanguage*',`Glib::RefPtr<const SourceLanguage>',`Glib::wrap($3)')
#_CONVERSION(`Glib::RefPtr<SourceLanguage>',`GtkSourceLanguage*',__CONVERT_REFPTR_TO_P)
_CONVERSION(`const Glib::RefPtr<SourceLanguage>&',`GtkSourceLanguage*',__CONVERT_REFPTR_TO_P)
-_CONVERSION(`GSList*',`Glib::SListHandle<Glib::ustring>', `$2($3, Glib::OWNERSHIP_DEEP)')
-_CONVERSION(`GList*',`Glib::ListHandle<Glib::ustring>', `$2($3, Glib::OWNERSHIP_DEEP)')
-_CONVERSION(`const Glib::SListHandle<const Glib::ustring>&',`const GSList*', `$3.data()')
_CONVERSION(`Glib::ListHandle<const Glib::ustring>&',`const GSList*', `$3.data()')
_CONVERSION(`Glib::ListHandle<Glib::ustring>',`GSList*', `$3.data()')
@@ -23,9 +20,7 @@
_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()')
@@ -37,9 +32,6 @@
_CONVERSION(`GtkSourceLanguageManager*',`Glib::RefPtr<SourceLanguageManager>',`Glib::wrap($3)')
-_CONVERSION(`const GSList*',`Glib::SListHandle<Glib::RefPtr<SourceLanguage> >',`$2((GSList*)$3, Glib::OWNERSHIP_NONE)')
-_CONVERSION(`const GSList*',`Glib::SListHandle<Glib::RefPtr<const SourceLanguage> >',`$2((GSList*)$3, Glib::OWNERSHIP_NONE)')
-_CONVERSION(`const GSList*',`Glib::SListHandle<Glib::ustring>',`$2((GSList*)$3, Glib::OWNERSHIP_NONE)')
_CONVERSION(`const Glib::StringArrayHandle&',`gchar**',`const_cast<gchar**>(($3).data())')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]