[gtksourceviewmm] Cleanup of m4 conversions file.



commit db54f53207dde626301759588bafae81f890fe1f
Author: Krzesimir Nowak <qdlacz gmail com>
Date:   Mon Nov 8 18:07:34 2010 +0100

    Cleanup of m4 conversions file.
    
    * codegen/m4/convert_gtksourceview.m4: Removed m4 conversions from other
    libraries than GtkSourceView and conversions for vfuncs and signals...
    * gtksourceview/src/sourcebuffer.hg:
    * gtksourceview/src/sourcecompletion.hg:
    * gtksourceview/src/sourcecompletioninfo.hg:
    * gtksourceview/src/sourcecompletionprovider.hg:
    * gtksourceview/src/sourcecompletionwords.hg:
    * gtksourceview/src/sourcegutter.hg:
    * gtksourceview/src/sourceprintcompositor.hg:
    * gtksourceview/src/sourceview.hg: ...and put them in those files.

 codegen/m4/convert_gtksourceview.m4           |   78 ++-----------------------
 gtksourceview/src/sourcebuffer.hg             |   14 ++++-
 gtksourceview/src/sourcecompletion.hg         |    1 +
 gtksourceview/src/sourcecompletioninfo.hg     |    2 +
 gtksourceview/src/sourcecompletionprovider.hg |    4 +
 gtksourceview/src/sourcecompletionwords.hg    |    1 +
 gtksourceview/src/sourcegutter.hg             |    5 ++
 gtksourceview/src/sourceprintcompositor.hg    |    1 +
 gtksourceview/src/sourceview.hg               |    5 ++
 9 files changed, 36 insertions(+), 75 deletions(-)
---
diff --git a/codegen/m4/convert_gtksourceview.m4 b/codegen/m4/convert_gtksourceview.m4
index 015dd79..f35b94f 100644
--- a/codegen/m4/convert_gtksourceview.m4
+++ b/codegen/m4/convert_gtksourceview.m4
@@ -1,73 +1,14 @@
 #
-# When adding a new conversion please sort conversion first by module (GDK, GTK,
-# GTKSOURCE), then alphabetically with preference to first write conversions
+# When adding a new conversion please put here conversions only for types
+# specific for GtkSourceView library and only for methods. Conversions from
+# other libraries (like Gtk+ or Gdk) are to be put inside source files. The same
+# with conversions specifically for wrapping vfuncs and signals. Also please
+# sort conversions alphabetically with preference to first write conversions
 # from C type to C++, and then from C++ to C. Just see below how this is done.
 #
 
 
 #
-## GDK
-#
-
-
-# Gdk::Color -> GdkColor
-_CONVERSION(`const Gdk::Color&',`const GdkColor*',`($3).gobj()')
-_CONVERSION(`Gdk::Color&',`GdkColor*',`($3).gobj()')
-
-
-#
-## GTK
-#
-
-
-# GtkCellRenderer -> Gtk::CellRenderer
-_CONVERSION(`GtkCellRenderer*',`Gtk::CellRenderer*',`Glib::wrap($3)')
-
-
-# Gtk::CellRenderer -> GtkCellRenderer
-_CONVERSION(`Gtk::CellRenderer*',`GtkCellRenderer*',`Glib::unwrap($3)')
-
-
-# Gtk::PrintContext -> GtkPrintContext
-_CONVERSION(`const Glib::RefPtr<Gtk::PrintContext>&',`GtkPrintContext*',`Glib::unwrap($3)')
-
-
-# Gtk::TextBuffer -> GtkTextBuffer
-_CONVERSION(`const Glib::RefPtr<Gtk::TextBuffer>&',`GtkTextBuffer*',`Glib::unwrap($3)')
-
-
-# GtkTextIter -> Gtk::TextIter
-_CONVERSION(`GtkTextIter*',`const Gtk::TextIter&',`Glib::wrap($3)')
-_CONVERSION(`GtkTextIter*',`Gtk::TextIter&',`Glib::wrap($3)')
-
-
-# Gtk::TextIter -> GtkTextIter
-_CONVERSION(`const Gtk::TextIter&',`GtkTextIter*',`const_cast<GtkTextIter*>(($3).gobj())')
-_CONVERSION(`Gtk::TextIter&',`GtkTextIter*',`($3).gobj()')
-_CONVERSION(`const Gtk::TextIter&',`const GtkTextIter*',`($3).gobj()')
-
-
-# GtkTextMark -> Gtk::TextMark
-_CONVERSION(`GtkTextMark*',`const Glib::RefPtr<Gtk::TextMark>&',`Glib::wrap($3)')
-
-
-# Gtk::TextTagTable -> GtkTextTagTable
-_CONVERSION(`const Glib::RefPtr<Gtk::TextTagTable>&',`GtkTextTagTable*',`Glib::unwrap($3)')
-
-
-# Gtk::TextView -> GtkTextView
-_CONVERSION(`const Gtk::TextView&',`GtkTextView*',`const_cast<GtkTextView*>(($3).gobj())')
-
-
-# GtkTooltip -> Gtk::Tooltip
-_CONVERSION(`GtkTooltip*',`const Glib::RefPtr<Gtk::Tooltip>&',`Glib::wrap($3)')
-
-
-# Gtk::Tooltip -> GtkTooltip
-_CONVERSION(`const Glib::RefPtr<Gtk::Tooltip>&',`GtkTooltip*',`const_cast<GtkTooltip*>(Glib::unwrap($3))')
-
-
-#
 ## GTKSOURCE
 #
 
@@ -82,13 +23,10 @@ _CONVERSION(`const Glib::RefPtr<SourceBuffer>&',`GtkSourceBuffer*',__CONVERT_REF
 
 # GtkSourceCompletion -> gtksourceview::SourceCompletion
 _CONVERSION(`GtkSourceCompletion*',`Glib::RefPtr<SourceCompletion>',`Glib::wrap($3)')
-_CONVERSION(`GtkSourceCompletion*',`Glib::RefPtr<const SourceCompletion>',`Glib::wrap($3)')
 
 
 # GtkSourceCompletionContext -> gtksourceview::SourceCompletionContext
 _CONVERSION(`GtkSourceCompletionContext*',`Glib::RefPtr<SourceCompletionContext>',`Glib::wrap($3)')
-_CONVERSION(`GtkSourceCompletionContext*',`const Glib::RefPtr<SourceCompletionContext>&',`Glib::wrap($3)')
-_CONVERSION(`GtkSourceCompletionContext*',`const Glib::RefPtr<const SourceCompletionContext>&',`Glib::wrap($3)')
 
 
 # gtksourceview::SourceCompletionContext -> GtkSourceCompletionContext
@@ -106,11 +44,6 @@ _CONVERSION(`GtkSourceCompletionInfo*',`const SourceCompletionInfo&',`(*(Glib::w
 _CONVERSION(`const SourceCompletionInfo&',`GtkSourceCompletionInfo*',`const_cast<GtkSourceCompletionInfo*>(($3).gobj())')
 
 
-# GtkSourceCompletionProposal -> gtksourceview::SourceCompletionProposal
-_CONVERSION(`GtkSourceCompletionProposal*',`const Glib::RefPtr<SourceCompletionProposal>&',`Glib::wrap($3)')
-_CONVERSION(`GtkSourceCompletionProposal*',`const Glib::RefPtr<const SourceCompletionProposal>&',`Glib::wrap($3)')
-
-
 # gtksourceview::SourceCompletionProposal -> GtkSourceCompletionProposal
 _CONVERSION(`const Glib::RefPtr<const SourceCompletionProposal>&',`GtkSourceCompletionProposal*',`const_cast<GtkSourceCompletionProposal*>(Glib::unwrap($3))')
 _CONVERSION(`const Glib::RefPtr<SourceCompletionProposal>&',`GtkSourceCompletionProposal*',`Glib::unwrap($3)')
@@ -122,7 +55,6 @@ _CONVERSION(`const Glib::RefPtr<SourceCompletionProvider>&',`GtkSourceCompletion
 
 # GtkSourceGutter -> gtksourceview::SourceGutter
 _CONVERSION(`GtkSourceGutter*',`Glib::RefPtr<SourceGutter>',`Glib::wrap($3)')
-_CONVERSION(`GtkSourceGutter*',`Glib::RefPtr<const SourceGutter>',`Glib::wrap($3)')
 
 
 # GtkSourceLanguage -> gtksourceview::SourceLanguage
diff --git a/gtksourceview/src/sourcebuffer.hg b/gtksourceview/src/sourcebuffer.hg
index d3ee370..284f1f2 100644
--- a/gtksourceview/src/sourcebuffer.hg
+++ b/gtksourceview/src/sourcebuffer.hg
@@ -193,6 +193,7 @@ public:
    *
    * @return @c true if iter was moved.
    */
+#m4 _CONVERSION(`Gtk::TextIter&',`GtkTextIter*',`($3).gobj()')
   _WRAP_METHOD(bool backward_iter_to_source_mark(Gtk::TextIter& iter, const Glib::ustring& category), gtk_source_buffer_backward_iter_to_source_mark)
 
   /** Moves iter to the position of the previous SourceMark of any category.
@@ -231,6 +232,7 @@ public:
    * @param start Start of the area to highlight.
    * @param end End of the area to highlight.
    */
+#m4 _CONVERSION(`const Gtk::TextIter&',`const GtkTextIter*',`($3).gobj()')
   _WRAP_METHOD(void ensure_highlight(const Gtk::TextIter& start, const Gtk::TextIter& end), gtk_source_buffer_ensure_highlight)
 
   /** Returns the SourceStyleScheme currently used in buffer.
@@ -279,6 +281,8 @@ public:
    *
    * @return A new SourceMark, owned by the buffer.
    */
+   // TODO: check if this shouldn't be marked as refreturn - krnowak
+   // TODO: check parameter order to be consistent with SourceMark's constructor order. - krnowak
   _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)
 
   /** Creates an anonymous source mark in the buffer of category category.
@@ -302,8 +306,10 @@ public:
    *
    * @newin{2,10}
    */
+   // TODO: check if this shouldn't be marked as refreturn - krnowak
   Glib::RefPtr<SourceMark> create_source_mark(const Glib::ustring& category, const Gtk::TextIter& where);
 
+   // TODO: check if this RefPtrs should be additionally reffed. - krnowak
 #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)')
 
@@ -322,6 +328,7 @@ public:
    *
    * @return A list of source marks.
    */
+   // TODO: check if this RefPtrs should be additionally reffed. - krnowak
   Glib::SListHandle<Glib::RefPtr<SourceMark> > get_source_marks_at_line(int line) const;
 
   /** Returns the list of marks of the given @a category at @a iter.
@@ -331,6 +338,7 @@ public:
    *
    * @return A list of source marks.
    */
+   // TODO: check if this RefPtrs should be additionally reffed. - krnowak
   _WRAP_METHOD(Glib::SListHandle<Glib::RefPtr<SourceMark> > get_source_marks_at_iter(Gtk::TextIter& iter, const Glib::ustring& category) const, gtk_source_buffer_get_source_marks_at_iter)
 
   /** Returns the list of marks of any category at @a iter.
@@ -339,6 +347,7 @@ public:
    *
    * @return A list of source marks.
    */
+   // TODO: check if this RefPtrs should be additionally reffed. - krnowak
   Glib::SListHandle<Glib::RefPtr<SourceMark> > get_source_marks_at_iter(Gtk::TextIter& iter) const;
 
   /** Remove all marks of @a category between start and end from the buffer.
@@ -459,6 +468,7 @@ public:
    * start An iterator at the start of the updated region.
    * end An iterator at the end of the updated region.
    */
+#m4 _CONVERSION(`GtkTextIter*',`Gtk::TextIter&',`Glib::wrap($3)')
   _WRAP_SIGNAL(void highlight_updated(Gtk::TextIter& start, Gtk::TextIter& end), "highlight-updated", no_default_handler)
 
   /** Emitted whenever a marker of sourcebuffer has changed and needs to be redisplayed by the view.
@@ -469,9 +479,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)')
+#m4 _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)')
+#m4 _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 f021a17..49ecb37 100644
--- a/gtksourceview/src/sourcecompletion.hg
+++ b/gtksourceview/src/sourcecompletion.hg
@@ -144,6 +144,7 @@ public:
    *
    * @newin{2,10}
    */
+#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)
 
   // TODO: better wording could be used here - it is too convoluted. krnowak
diff --git a/gtksourceview/src/sourcecompletioninfo.hg b/gtksourceview/src/sourcecompletioninfo.hg
index ec5151c..b3a9e26 100644
--- a/gtksourceview/src/sourcecompletioninfo.hg
+++ b/gtksourceview/src/sourcecompletioninfo.hg
@@ -57,6 +57,8 @@ public:
    *
    * @newin{2,10}
    */
+#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)
 
   /** Moves the Gtk::SourceCompletionInfo to the cursor position. Moving will
diff --git a/gtksourceview/src/sourcecompletionprovider.hg b/gtksourceview/src/sourcecompletionprovider.hg
index 8fd32bf..09d8d24 100644
--- a/gtksourceview/src/sourcecompletionprovider.hg
+++ b/gtksourceview/src/sourcecompletionprovider.hg
@@ -144,6 +144,7 @@ public:
    *
    * @newin{2,10}
    */
+#m4 _CONVERSION(`Gtk::TextIter&',`GtkTextIter*',`($3).gobj()')
   _WRAP_METHOD(bool get_start_iter(const Glib::RefPtr<const SourceCompletionContext>& context, const Glib::RefPtr<const SourceCompletionProposal>& proposal, Gtk::TextIter& iter), gtk_source_completion_provider_get_start_iter)
 
   /** Activate @a proposal at @a iter.
@@ -160,6 +161,7 @@ public:
    *
    * @newin{2,10}
    */
+#m4 _CONVERSION(`const Gtk::TextIter&',`GtkTextIter*',`const_cast<GtkTextIter*>(($3).gobj())')
   _WRAP_METHOD(bool activate_proposal(const Glib::RefPtr<SourceCompletionProposal>& proposal, const Gtk::TextIter& iter), gtk_source_completion_provider_activate_proposal)
 
   /** Get with what kind of activation the provider should be activated.
@@ -220,11 +222,13 @@ private:
 
 #m4 _CONVERSION(`GtkSourceCompletionContext*', `const Glib::RefPtr<const SourceCompletionContext>&', `Glib::wrap($3, true)')
 #m4 _CONVERSION(`GtkSourceCompletionProposal*', `const Glib::RefPtr<const SourceCompletionProposal>&', `Glib::wrap($3, true)')
+#m4 _CONVERSION(`GtkTextIter*',`Gtk::TextIter&',`Glib::wrap($3)')
   _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)')
+#m4 _CONVERSION(`GtkTextIter*',`const Gtk::TextIter&',`Glib::wrap($3)')
   _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)')
 
diff --git a/gtksourceview/src/sourcecompletionwords.hg b/gtksourceview/src/sourcecompletionwords.hg
index c1def3d..19add2d 100644
--- a/gtksourceview/src/sourcecompletionwords.hg
+++ b/gtksourceview/src/sourcecompletionwords.hg
@@ -56,6 +56,7 @@ public:
    *
    * @newin{2,10}
    */
+#m4 _CONVERSION(`const Glib::RefPtr<Gtk::TextBuffer>&',`GtkTextBuffer*',`Glib::unwrap($3)')
   _WRAP_METHOD(void register_provider(const Glib::RefPtr<Gtk::TextBuffer>& buffer), gtk_source_completion_words_register)
 
   /** Unregisters this provider from given buffer.
diff --git a/gtksourceview/src/sourcegutter.hg b/gtksourceview/src/sourcegutter.hg
index 7c63399..3cf92c9 100644
--- a/gtksourceview/src/sourcegutter.hg
+++ b/gtksourceview/src/sourcegutter.hg
@@ -94,6 +94,7 @@ public:
    *
    * @newin{2,10}
    */
+#m4 _CONVERSION(`Gtk::CellRenderer*',`GtkCellRenderer*',`Glib::unwrap($3)')
   _WRAP_METHOD(void insert(Gtk::CellRenderer* renderer, int position), gtk_source_gutter_insert)
 
   /** Reorders @a renderer in a gutter to new @a position.
@@ -197,6 +198,9 @@ public:
    *
    * @newin{2,10}
    */
+#m4 _CONVERSION(`GtkCellRenderer*',`Gtk::CellRenderer*',`Glib::wrap($3)')
+#m4 _CONVERSION(`GtkTextIter*',`const Gtk::TextIter&',`Glib::wrap($3)')
+#m4 _CONVERSION(`const Gtk::TextIter&',`GtkTextIter*',`const_cast<GtkTextIter*>(($3).gobj())')
   _WRAP_SIGNAL(void cell_activated(Gtk::CellRenderer* renderer, const Gtk::TextIter& iter, GdkEvent* event), "cell-activated")
 
   /** Emitted when a tooltip is requested for a specific cell.
@@ -213,6 +217,7 @@ public:
    * @newin{2,10}
    */
 #m4 _CONVERSION(`GtkTooltip*', `const Glib::RefPtr<Gtk::Tooltip>&', `Glib::wrap($3, true)')
+#m4 _CONVERSION(`const Glib::RefPtr<Gtk::Tooltip>&',`GtkTooltip*',`const_cast<GtkTooltip*>(Glib::unwrap($3))')
   _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)')
 };
diff --git a/gtksourceview/src/sourceprintcompositor.hg b/gtksourceview/src/sourceprintcompositor.hg
index 2adc026..d69d4ab 100644
--- a/gtksourceview/src/sourceprintcompositor.hg
+++ b/gtksourceview/src/sourceprintcompositor.hg
@@ -566,6 +566,7 @@ public:
    *
    * @newin{2,10}
    */
+#m4 _CONVERSION(`const Glib::RefPtr<Gtk::PrintContext>&',`GtkPrintContext*',`Glib::unwrap($3)')
   _WRAP_METHOD(bool paginate(const Glib::RefPtr<Gtk::PrintContext>& context), gtk_source_print_compositor_paginate)
 
   /** Return value: a fraction from 0.0 to 1.0 inclusive
diff --git a/gtksourceview/src/sourceview.hg b/gtksourceview/src/sourceview.hg
index c28dd69..517b516 100644
--- a/gtksourceview/src/sourceview.hg
+++ b/gtksourceview/src/sourceview.hg
@@ -323,6 +323,7 @@ public:
    *
    * @newin{2,10}
    */
+#m4 _CONVERSION(`const Gdk::Color&',`const GdkColor*',`($3).gobj()')
   _WRAP_METHOD(void set_mark_category_background(const Glib::ustring& category, const Gdk::Color& color), gtk_source_view_set_mark_category_background)
 
   /** Unsets background for mark @a category.
@@ -343,6 +344,7 @@ public:
    *
    * @newin{2,10}
    */
+#m4 _CONVERSION(`Gdk::Color&',`GdkColor*',`($3).gobj()')
   _WRAP_METHOD(bool get_mark_category_background(const Glib::ustring& category, Gdk::Color& dest) const, gtk_source_view_get_mark_category_background)
 
   /** Set if and how the spaces should be visualized.
@@ -370,6 +372,7 @@ public:
    *
    * @newin{3,0}
    */
+#m4 _CONVERSION(`const Gtk::TextIter&',`const GtkTextIter*',`($3).gobj()')
   _WRAP_METHOD(guint get_visual_column(const Gtk::TextIter& iter) const, gtk_source_view_get_visual_column)
 
   /** Slot holding a function.
@@ -498,6 +501,8 @@ public:
    * iter A Gtk::TextIter.
    * event The GdkEvent that activated the event.
    */
+#m4 _CONVERSION(`GtkTextIter*',`Gtk::TextIter&',`Glib::wrap($3)')
+#m4 _CONVERSION(`Gtk::TextIter&',`GtkTextIter*',`($3).gobj()')
   _WRAP_SIGNAL(void line_mark_activated(Gtk::TextIter& mark, GdkEvent* event), "line-mark-activated")
 
   /** Emitted when a the cursor was moved according to the smart home end setting.



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