[gtksourceviewmm] Fix plenty of reference problems in completion stuff.



commit dabfb20230d2a97035dcea1644ac29faf0e1da66
Author: Krzesimir Nowak <qdlacz gmail com>
Date:   Mon Nov 8 16:59:24 2010 +0100

    Fix plenty of reference problems in completion stuff.
    
    * codegen/m4/convert_gtksourceview.m4: By default conversions don't take
    additional references - this normally is not needed, as it should be done
    explicitly when wrapping vfuncs and signals. Also, this file needs
    a cleanup - maybe some conversions won't need to sit there.
    * gtksourceview/src/sourcebuffer.hg:
    * gtksourceview/src/sourcecompletion.hg:
    * gtksourceview/src/sourcecompletionproposal.hg:
    * gtksourceview/src/sourcecompletionprovider.hg:
    * gtksourceview/src/sourcegutter.hg: Added explicit conversion for signal
    and vfunc wrappers, so they take an additional reference to avoid premature
    object disposal due to unreffing it upon temporary wrapper destruction.

 codegen/m4/convert_gtksourceview.m4           |    2 +-
 gtksourceview/src/sourcebuffer.hg             |    2 ++
 gtksourceview/src/sourcecompletion.hg         |    2 ++
 gtksourceview/src/sourcecompletionproposal.hg |    2 ++
 gtksourceview/src/sourcecompletionprovider.hg |   14 ++++++++++++++
 gtksourceview/src/sourcegutter.hg             |    2 ++
 6 files changed, 23 insertions(+), 1 deletions(-)
---
diff --git a/codegen/m4/convert_gtksourceview.m4 b/codegen/m4/convert_gtksourceview.m4
index 8affca8..015dd79 100644
--- a/codegen/m4/convert_gtksourceview.m4
+++ b/codegen/m4/convert_gtksourceview.m4
@@ -48,7 +48,7 @@ _CONVERSION(`const Gtk::TextIter&',`const GtkTextIter*',`($3).gobj()')
 
 
 # GtkTextMark -> Gtk::TextMark
-_CONVERSION(`GtkTextMark*',`const Glib::RefPtr<Gtk::TextMark>&',`Glib::wrap($3, true)')
+_CONVERSION(`GtkTextMark*',`const Glib::RefPtr<Gtk::TextMark>&',`Glib::wrap($3)')
 
 
 # Gtk::TextTagTable -> GtkTextTagTable
diff --git a/gtksourceview/src/sourcebuffer.hg b/gtksourceview/src/sourcebuffer.hg
index 7935914..d3ee370 100644
--- a/gtksourceview/src/sourcebuffer.hg
+++ b/gtksourceview/src/sourcebuffer.hg
@@ -469,7 +469,9 @@ public:
    * @par Handler parameters:
    * where An iterator at the location where the change occurred.
    */
+_CONVERSION(`GtkTextMark*',`const Glib::RefPtr<Gtk::TextMark>&',`Glib::wrap($3, true)')
   _WRAP_SIGNAL(void source_mark_updated(const Glib::RefPtr<Gtk::TextMark>& where), "source-mark-updated", no_default_handler)
+_CONVERSION(`GtkTextMark*',`const Glib::RefPtr<Gtk::TextMark>&',`Glib::wrap($3)')
 
   /** Emitted whenever undo is requested.
    *
diff --git a/gtksourceview/src/sourcecompletion.hg b/gtksourceview/src/sourcecompletion.hg
index b7da82d..f021a17 100644
--- a/gtksourceview/src/sourcecompletion.hg
+++ b/gtksourceview/src/sourcecompletion.hg
@@ -202,7 +202,9 @@ public:
    *
    * @newin{2,10}
    */
+#m4 _CONVERSION(`GtkSourceCompletionContext*', `const Glib::RefPtr<SourceCompletionContext>&', `Glib::wrap($3, true)')
   _WRAP_SIGNAL(void populate_context(const Glib::RefPtr<SourceCompletionContext>& context), "populate-context")
+#m4 _CONVERSION(`GtkSourceCompletionContext*', `const Glib::RefPtr<SourceCompletionContext>&', `Glib::wrap($3)')
 
   /** Emitted when the completion window is shown.
    *
diff --git a/gtksourceview/src/sourcecompletionproposal.hg b/gtksourceview/src/sourcecompletionproposal.hg
index 0d3b928..49b48ea 100644
--- a/gtksourceview/src/sourcecompletionproposal.hg
+++ b/gtksourceview/src/sourcecompletionproposal.hg
@@ -156,7 +156,9 @@ private:
 
   _WRAP_VFUNC(guint hash() const, hash)
 
+#m4 _CONVERSION(`GtkSourceCompletionProposal*', `const Glib::RefPtr<const SourceCompletionProposal>&', `Glib::wrap($3, true)')
   _WRAP_VFUNC(bool equal(const Glib::RefPtr<const SourceCompletionProposal>& other) const, equal)
+#m4 _CONVERSION(`GtkSourceCompletionProposal*', `const Glib::RefPtr<const SourceCompletionProposal>&', `Glib::wrap($3)')
 };
 
 } // namespace gtksourceview
diff --git a/gtksourceview/src/sourcecompletionprovider.hg b/gtksourceview/src/sourcecompletionprovider.hg
index 8cc778b..8fd32bf 100644
--- a/gtksourceview/src/sourcecompletionprovider.hg
+++ b/gtksourceview/src/sourcecompletionprovider.hg
@@ -200,19 +200,33 @@ private:
 
   _WRAP_VFUNC(Glib::RefPtr<Gdk::Pixbuf> get_icon(), get_icon, refreturn)
 
+#m4 _CONVERSION(`GtkSourceCompletionContext*', `const Glib::RefPtr<SourceCompletionContext>&', `Glib::wrap($3, true)')
   _WRAP_VFUNC(void populate(const Glib::RefPtr<SourceCompletionContext>& context), populate)
+#m4 _CONVERSION(`GtkSourceCompletionContext*', `const Glib::RefPtr<SourceCompletionContext>&', `Glib::wrap($3)')
 
+#m4 _CONVERSION(`GtkSourceCompletionContext*', `const Glib::RefPtr<const SourceCompletionContext>&', `Glib::wrap($3, true)')
   _WRAP_VFUNC(bool match(const Glib::RefPtr<const SourceCompletionContext>& context) const, match)
+#m4 _CONVERSION(`GtkSourceCompletionContext*', `const Glib::RefPtr<const SourceCompletionContext>&', `Glib::wrap($3)')
 
   _WRAP_VFUNC(SourceCompletionActivation get_activation() const, get_activation)
 
+#m4 _CONVERSION(`GtkSourceCompletionProposal*', `const Glib::RefPtr<const SourceCompletionProposal>&', `Glib::wrap($3, true)')
   _WRAP_VFUNC(Gtk::Widget* get_info_widget(const Glib::RefPtr<const SourceCompletionProposal>& proposal) const, get_info_widget)
+#m4 _CONVERSION(`GtkSourceCompletionProposal*', `const Glib::RefPtr<const SourceCompletionProposal>&', `Glib::wrap($3)')
 
+#m4 _CONVERSION(`GtkSourceCompletionProposal*', `const Glib::RefPtr<const SourceCompletionProposal>&', `Glib::wrap($3, true)')
   _WRAP_VFUNC(void update_info(const Glib::RefPtr<const SourceCompletionProposal>& proposal, const SourceCompletionInfo& info), update_info)
+#m4 _CONVERSION(`GtkSourceCompletionProposal*', `const Glib::RefPtr<const SourceCompletionProposal>&', `Glib::wrap($3)')
 
+#m4 _CONVERSION(`GtkSourceCompletionContext*', `const Glib::RefPtr<const SourceCompletionContext>&', `Glib::wrap($3, true)')
+#m4 _CONVERSION(`GtkSourceCompletionProposal*', `const Glib::RefPtr<const SourceCompletionProposal>&', `Glib::wrap($3, true)')
   _WRAP_VFUNC(bool get_start_iter(const Glib::RefPtr<const SourceCompletionContext>& context, const Glib::RefPtr<const SourceCompletionProposal>& proposal, Gtk::TextIter& iter), get_start_iter)
+#m4 _CONVERSION(`GtkSourceCompletionProposal*', `const Glib::RefPtr<const SourceCompletionProposal>&', `Glib::wrap($3)')
+#m4 _CONVERSION(`GtkSourceCompletionContext*', `const Glib::RefPtr<const SourceCompletionContext>&', `Glib::wrap($3)')
 
+#m4 _CONVERSION(`GtkSourceCompletionProposal*', `const Glib::RefPtr<SourceCompletionProposal>&', `Glib::wrap($3, true)')
   _WRAP_VFUNC(bool activate_proposal(const Glib::RefPtr<SourceCompletionProposal>& proposal, const Gtk::TextIter& iter), activate_proposal)
+#m4 _CONVERSION(`GtkSourceCompletionProposal*', `const Glib::RefPtr<SourceCompletionProposal>&', `Glib::wrap($3)')
 
   _WRAP_VFUNC(int get_interactive_delay() const, get_interactive_delay)
 
diff --git a/gtksourceview/src/sourcegutter.hg b/gtksourceview/src/sourcegutter.hg
index a2d996b..7c63399 100644
--- a/gtksourceview/src/sourcegutter.hg
+++ b/gtksourceview/src/sourcegutter.hg
@@ -212,7 +212,9 @@ public:
    *
    * @newin{2,10}
    */
+#m4 _CONVERSION(`GtkTooltip*', `const Glib::RefPtr<Gtk::Tooltip>&', `Glib::wrap($3, true)')
   _WRAP_SIGNAL(bool query_tooltip(Gtk::CellRenderer* renderer, const Gtk::TextIter& iter, const Glib::RefPtr<Gtk::Tooltip>& tooltip), "query-tooltip")
+#m4 _CONVERSION(`GtkTooltip*', `const Glib::RefPtr<Gtk::Tooltip>&', `Glib::wrap($3)')
 };
 
 } // namespace gtksourceview



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