[gtksourceviewmm/gtksourceviewmm-2.0] Cleanup of m4 conversions file.



commit 8511cbec952912e2da3b3ad3c1a55940f7f0a774
Author: Krzesimir Nowak <qdlacz gmail com>
Date:   Sat Nov 13 23:16:37 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           |   65 ++----------------------
 gtksourceview/src/sourcebuffer.hg             |    3 +
 gtksourceview/src/sourcecompletion.hg         |    5 +-
 gtksourceview/src/sourcecompletioninfo.hg     |    2 +
 gtksourceview/src/sourcecompletionprovider.hg |    6 ++-
 gtksourceview/src/sourcecompletionwords.hg    |    1 +
 gtksourceview/src/sourcegutter.hg             |    5 ++
 gtksourceview/src/sourceprintcompositor.hg    |    1 +
 gtksourceview/src/sourceview.hg               |    3 +
 9 files changed, 29 insertions(+), 62 deletions(-)
---
diff --git a/codegen/m4/convert_gtksourceview.m4 b/codegen/m4/convert_gtksourceview.m4
index 119dfd0..73e1aef 100644
--- a/codegen/m4/convert_gtksourceview.m4
+++ b/codegen/m4/convert_gtksourceview.m4
@@ -1,57 +1,12 @@
 #
-## GDK
+# 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::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()')
-
-
-# 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
@@ -67,13 +22,10 @@ _CONVERSION(`const Glib::RefPtr<SourceBuffer>&',`GtkSourceBuffer*',__CONVERT_REF
 
 # GtkSourceCompletion -> gtksourceview::SourceCompletion
 _CONVERSION(`GtkSourceCompletion*',`SourceCompletion*',`Glib::wrap($3)')
-_CONVERSION(`GtkSourceCompletion*',`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
@@ -83,7 +35,6 @@ _CONVERSION(`const Glib::RefPtr<const SourceCompletionContext>&',`GtkSourceCompl
 
 # GtkSourceCompletionInfo -> gtksourceview::SourceCompletionInfo
 _CONVERSION(`GtkSourceCompletionInfo*',`SourceCompletionInfo*',`Glib::wrap($3)')
-_CONVERSION(`GtkSourceCompletionInfo*',`const SourceCompletionInfo*',`Glib::wrap($3)')
 _CONVERSION(`GtkSourceCompletionInfo*',`const SourceCompletionInfo&',`(*(Glib::wrap($3)))')
 
 
@@ -92,8 +43,6 @@ _CONVERSION(`const SourceCompletionInfo&',`GtkSourceCompletionInfo*',`const_cast
 
 
 # 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
@@ -107,7 +56,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
@@ -152,7 +100,6 @@ _CONVERSION(`const Glib::RefPtr<const SourceUndoManager>&',`GtkSourceUndoManager
 
 # GtkSourceView -> Gtk::SourceView
 _CONVERSION(`GtkSourceView*',`SourceView*',`Glib::wrap($3)')
-_CONVERSION(`GtkSourceView*',`const SourceView*',`Glib::wrap($3)')
 
 #
 ## ENUMS
diff --git a/gtksourceview/src/sourcebuffer.hg b/gtksourceview/src/sourcebuffer.hg
index 83f1684..5cdc8f9 100644
--- a/gtksourceview/src/sourcebuffer.hg
+++ b/gtksourceview/src/sourcebuffer.hg
@@ -166,6 +166,7 @@ public:
 
   _WRAP_METHOD(void end_not_undoable_action(), gtk_source_buffer_end_not_undoable_action)
 
+#m4 _CONVERSION(`Gtk::TextIter&',`GtkTextIter*',`($3).gobj()')
   /** Moves iter to the position of the previous SourceMark of the given
    *  category.
    *
@@ -203,6 +204,7 @@ public:
    */
   bool forward_iter_to_source_mark(Gtk::TextIter& iter);
 
+#m4 _CONVERSION(`const Gtk::TextIter&',`const GtkTextIter*',`($3).gobj()')
   /** Forces buffer to analyze and highlight the given area synchronously.
    *
    * @note This is a potentially slow operation and should be used only when you
@@ -431,6 +433,7 @@ public:
   _WRAP_PROPERTY("style-scheme", Glib::RefPtr<SourceStyleScheme>)
   _WRAP_PROPERTY("undo-manager", Glib::RefPtr<SourceUndoManager>)
 
+#m4 _CONVERSION(`GtkTextIter*',`Gtk::TextIter&',`Glib::wrap($3)')
   /** Emitted whenever the syntax highlighting information has been updated,
    *  so that views can request a redraw if the region changed is visible.
    *
diff --git a/gtksourceview/src/sourcecompletion.hg b/gtksourceview/src/sourcecompletion.hg
index d80f13b..a5da00d 100644
--- a/gtksourceview/src/sourcecompletion.hg
+++ b/gtksourceview/src/sourcecompletion.hg
@@ -114,7 +114,7 @@ public:
    *
    * @newin{2,10}
    */
-  _WRAP_METHOD(const SourceCompletionInfo* get_info_window() const, gtk_source_completion_get_info_window)
+  _WRAP_METHOD(const SourceCompletionInfo* get_info_window() const, gtk_source_completion_get_info_window, constversion)
 
   /** Gets the SourceView associated with completion.
    *
@@ -130,9 +130,10 @@ public:
    *
    * @newin{2,10}
    */
-  _WRAP_METHOD(const SourceView* get_view() const, gtk_source_completion_get_view)
+  _WRAP_METHOD(const SourceView* get_view() const, gtk_source_completion_get_view, constversion)
 
   // TODO: Does "The reference being returned is a 'floating' reference, so if you invoke gtk_source_completion_show with this context you don't need to unref it." something mean for us? krnowak
+#m4 _CONVERSION(`const Gtk::TextIter&',`GtkTextIter*',`const_cast<GtkTextIter*>(($3).gobj())')
   /** Create a new SourceCompletionContext for completion.
    *
    * The position at which the completion using the new context will consider
diff --git a/gtksourceview/src/sourcecompletioninfo.hg b/gtksourceview/src/sourcecompletioninfo.hg
index ec5151c..65ea7e5 100644
--- a/gtksourceview/src/sourcecompletioninfo.hg
+++ b/gtksourceview/src/sourcecompletioninfo.hg
@@ -48,6 +48,8 @@ public:
    */
   SourceCompletionInfo();
 
+#m4 _CONVERSION(`const Gtk::TextView&',`GtkTextView*',`const_cast<GtkTextView*>(($3).gobj())')
+#m4 _CONVERSION(`const Gtk::TextIter&',`GtkTextIter*',`const_cast<GtkTextIter*>(($3).gobj())')
   /** Moves the SourceCompletionInfo to @a iter. Moving will respect the
    * Gdk::Gravity setting of the info window and will ensure the line at @a iter
    * is not occluded by the window.
diff --git a/gtksourceview/src/sourcecompletionprovider.hg b/gtksourceview/src/sourcecompletionprovider.hg
index 85da651..d5320c6 100644
--- a/gtksourceview/src/sourcecompletionprovider.hg
+++ b/gtksourceview/src/sourcecompletionprovider.hg
@@ -115,7 +115,7 @@ public:
    *
    * @newin{2,10}
    */
-  _WRAP_METHOD(const Gtk::Widget* get_info_widget(const Glib::RefPtr<const SourceCompletionProposal>& proposal) const, gtk_source_completion_provider_get_info_widget)
+  _WRAP_METHOD(const Gtk::Widget* get_info_widget(const Glib::RefPtr<const SourceCompletionProposal>& proposal) const, gtk_source_completion_provider_get_info_widget, constversion)
 
   /** Update extra information shown in @a info for @a proposal.
    *
@@ -130,6 +130,7 @@ public:
    */
   _WRAP_METHOD(void update_info(const Glib::RefPtr<const SourceCompletionProposal>& proposal, const SourceCompletionInfo& info), gtk_source_completion_provider_update_info)
 
+#m4 _CONVERSION(`Gtk::TextIter&',`GtkTextIter*',`($3).gobj()')
   /** Get the Gtk::TextIter at which the completion for @a proposal starts.
    *
    * When implemented, the completion can use this information to position the
@@ -146,6 +147,7 @@ public:
    */
   _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)
 
+#m4 _CONVERSION(`const Gtk::TextIter&',`GtkTextIter*',`const_cast<GtkTextIter*>(($3).gobj())')
   /** Activate @a proposal at @a iter.
    *
    * When this functions returns <tt>false</tt>, the default activation of
@@ -218,11 +220,13 @@ public:
 
 #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 6983ad1..7e284a2 100644
--- a/gtksourceview/src/sourcecompletionwords.hg
+++ b/gtksourceview/src/sourcecompletionwords.hg
@@ -49,6 +49,7 @@ public:
    */
   _WRAP_CREATE(const Glib::ustring& name, const Glib::RefPtr<Gdk::Pixbuf>& icon)
 
+#m4 _CONVERSION(`const Glib::RefPtr<Gtk::TextBuffer>&',`GtkTextBuffer*',`Glib::unwrap($3)')
   /** Registers this provider in given buffer.
    *
    * @param buffer A buffer which will use this provider.
diff --git a/gtksourceview/src/sourcegutter.hg b/gtksourceview/src/sourcegutter.hg
index 7c63399..7cd9daf 100644
--- a/gtksourceview/src/sourcegutter.hg
+++ b/gtksourceview/src/sourcegutter.hg
@@ -87,6 +87,7 @@ public:
    */
   _WRAP_METHOD(Glib::RefPtr<const Gdk::Window> get_window() const, gtk_source_gutter_get_window, constversion, refreturn)
 
+#m4 _CONVERSION(`Gtk::CellRenderer*',`GtkCellRenderer*',`Glib::unwrap($3)')
   /** Inserts @a renderer into a gutter at @a position.
    *
    * @param renderer A Gtk::CellRenderer.
@@ -184,6 +185,9 @@ public:
   _WRAP_PROPERTY("view", SourceView*)
   _WRAP_PROPERTY("window-type", Gtk::TextWindowType)
 
+#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())')
   /** Emitted when a cell has been activated (for instance when there was
    *  a button press on the 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..8784666 100644
--- a/gtksourceview/src/sourceprintcompositor.hg
+++ b/gtksourceview/src/sourceprintcompositor.hg
@@ -505,6 +505,7 @@ public:
    */
   _WRAP_METHOD(int get_n_pages() const, gtk_source_print_compositor_get_n_pages)
 
+#m4 _CONVERSION(`const Glib::RefPtr<Gtk::PrintContext>&',`GtkPrintContext*',`Glib::unwrap($3)')
   /** Paginate the document associated with the @a compositor.
    *
    * In order to support non-blocking pagination, document is paginated in small
diff --git a/gtksourceview/src/sourceview.hg b/gtksourceview/src/sourceview.hg
index d75efa3..03862b5 100644
--- a/gtksourceview/src/sourceview.hg
+++ b/gtksourceview/src/sourceview.hg
@@ -370,6 +370,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.
@@ -390,6 +391,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.
@@ -525,6 +527,7 @@ public:
    */
   _WRAP_SIGNAL(void undo(), "undo")
 
+#m4 _CONVERSION(`GtkTextIter*',`Gtk::TextIter&',`Glib::wrap($3)')
   /** Emitted when a line mark has been activated (for instance when there
    * was a button press in the line marks gutter).
    *



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