[gtksourceviewmm/devel: 8/26] Mostly fixes of the template code.



commit a9fe3b3cc1e249caa398338017542e3330a84393
Author: Krzesimir Nowak <qdlacz gmail com>
Date:   Sat Dec 12 11:38:41 2009 +0100

    Mostly fixes of the template code.
    
    * gtksourceview/gtksourceviewmm/.gitignore: Added new entries to
    ignore.
    * gtksourceview/src/filelist.am: Added new .hg files to build
    system.
    * gtksourceview/src/gtksourceview_docs.xml: Removed a strange char,
    which made gmmproc complain about this file being badly formed xml.
    The documentation is also fixed in gtksourceview already.
    * gtksourceview/src/sourcebuffer.hg:
    * gtksourceview/src/sourcecompletioninfo.hg:
    * gtksourceview/src/sourcecompletionproposal.hg:
    * gtksourceview/src/sourcecompletionproposal.ccg:
    * gtksourceview/src/sourcegutter.ccg:
    * gtksourceview/src/sourcegutter.hg:
    * gtksourceview/src/sourceview.ccg:
    * gtksourceview/src/sourceview.hg: Fixed to make them compilable.

 gtksourceview/gtksourceviewmm/.gitignore       |    3 +++
 gtksourceview/src/filelist.am                  |    5 ++++-
 gtksourceview/src/gtksourceview_docs.xml       |    2 +-
 gtksourceview/src/sourcebuffer.hg              |    4 ++--
 gtksourceview/src/sourcecompletioninfo.hg      |    7 +++++--
 gtksourceview/src/sourcecompletionproposal.ccg |    1 -
 gtksourceview/src/sourcecompletionproposal.hg  |    7 ++++++-
 gtksourceview/src/sourcegutter.ccg             |   14 +++++++-------
 gtksourceview/src/sourcegutter.hg              |   21 ++++++++++++++++-----
 gtksourceview/src/sourceview.ccg               |   14 +++++++-------
 gtksourceview/src/sourceview.hg                |    4 ++--
 11 files changed, 53 insertions(+), 29 deletions(-)
---
diff --git a/gtksourceview/gtksourceviewmm/.gitignore b/gtksourceview/gtksourceviewmm/.gitignore
index 2074512..fa091b1 100644
--- a/gtksourceview/gtksourceviewmm/.gitignore
+++ b/gtksourceview/gtksourceviewmm/.gitignore
@@ -8,3 +8,6 @@
 /sourcestyleschememanager.*
 /sourceview.*
 /wrap_init.cc
+/sourcegutter.*
+/sourcecompletionproposal.*
+/sourcecompletioninfo.*
diff --git a/gtksourceview/src/filelist.am b/gtksourceview/src/filelist.am
index dd6b134..967fd56 100644
--- a/gtksourceview/src/filelist.am
+++ b/gtksourceview/src/filelist.am
@@ -15,6 +15,9 @@ files_hg =				\
 	sourcebuffer.hg			\
 	sourceiter.hg			\
 	sourcemark.hg			\
-	sourcestyleschememanager.hg
+	sourcestyleschememanager.hg	\
+	sourcegutter.hg			\
+	sourcecompletioninfo.hg		\
+	sourcecompletionproposal.hg
 
 files_ccg = $(files_hg:.hg=.ccg)
diff --git a/gtksourceview/src/gtksourceview_docs.xml b/gtksourceview/src/gtksourceview_docs.xml
index a856dfc..15bf0aa 100644
--- a/gtksourceview/src/gtksourceview_docs.xml
+++ b/gtksourceview/src/gtksourceview_docs.xml
@@ -579,7 +579,7 @@ typing, we can undo the whole word and not each letter by itself.
 </parameter_description>
 </parameter>
 </parameters>
-<return> %TRUE is merge was sucessful, %FALSE otherwise.²
+<return> %TRUE is merge was sucessful, %FALSE otherwise.
 </return>
 </function>
 
diff --git a/gtksourceview/src/sourcebuffer.hg b/gtksourceview/src/sourcebuffer.hg
index ce6fe10..9e3c4cf 100644
--- a/gtksourceview/src/sourcebuffer.hg
+++ b/gtksourceview/src/sourcebuffer.hg
@@ -322,14 +322,14 @@ public:
   /// 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)
 
-#m4 _CONVERSION(`GtkSourceMark*',`const Glib::RefPtr<SourceMark>&',`Glib::wrap($3, true)')
+#m4 _CONVERSION(`GtkTextMark*',`const Glib::RefPtr<Gtk::TextMark>&',`Glib::wrap($3, true)')
 
   /// \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 source_mark_updated(const Glib::RefPtr<SourceMark>& where), "source-mark-updated", no_default_handler)
+  _WRAP_SIGNAL(void source_mark_updated(const Glib::RefPtr<Gtk::TextMark>& where), "source-mark-updated", no_default_handler)
   /// @}
 };
 
diff --git a/gtksourceview/src/sourcecompletioninfo.hg b/gtksourceview/src/sourcecompletioninfo.hg
index 0e249fe..cc28489 100644
--- a/gtksourceview/src/sourcecompletioninfo.hg
+++ b/gtksourceview/src/sourcecompletioninfo.hg
@@ -20,6 +20,7 @@
 #include <glibmm/object.h>
 #include <gtkmm/widget.h>
 #include <gtkmm/textview.h>
+#include <gtkmm/window.h>
 
 _DEFS(gtksourceviewmm,gtksourceview)
 _PINCLUDE(gtkmm/private/window_p.h)
@@ -34,8 +35,10 @@ class SourceCompletionInfo : public Gtk::Window
 
 public:
   _CTOR_DEFAULT()
-  
-  _WRAP_METHOD(void move_to_iter(const Gtk::Textview& view, const Gtk::TextIter& iter), gtk_source_completion_info_move_to_iter)
+
+#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)
   _WRAP_METHOD(void set_sizing(int width, int height, bool shrink_width, bool shrink_height), gtk_source_completion_info_set_sizing)
   _WRAP_METHOD(void set_widget(Gtk::Widget& widget), gtk_source_completion_info_set_widget)
   _WRAP_METHOD(Gtk::Widget* get_widget(), gtk_source_completion_info_get_widget)
diff --git a/gtksourceview/src/sourcecompletionproposal.ccg b/gtksourceview/src/sourcecompletionproposal.ccg
index e184801..a42ac11 100644
--- a/gtksourceview/src/sourcecompletionproposal.ccg
+++ b/gtksourceview/src/sourcecompletionproposal.ccg
@@ -17,4 +17,3 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <gtksourceview/gtksourcecompletionproposal.h>
diff --git a/gtksourceview/src/sourcecompletionproposal.hg b/gtksourceview/src/sourcecompletionproposal.hg
index 7a1cb44..743cd22 100644
--- a/gtksourceview/src/sourcecompletionproposal.hg
+++ b/gtksourceview/src/sourcecompletionproposal.hg
@@ -19,6 +19,8 @@
 
 #include <glibmm/interface.h>
 #include <glibmm/ustring.h>
+#include <gdkmm/pixbuf.h>
+#include <gtksourceview/gtksourcecompletionproposal.h>
 
 _DEFS(gtksourceviewmm,gtksourceview)
 _PINCLUDE(glibmm/private/object_p.h)
@@ -39,8 +41,11 @@ public:
   _WRAP_METHOD(Glib::ustring get_info() const, gtk_source_completion_proposal_get_info)
   _WRAP_METHOD(void changed(), gtk_source_completion_proposal_changed)
   _WRAP_METHOD(guint hash() const, gtk_source_completion_proposal_hash)
+
+#m4 _CONVERSION(`const SourceCompletionProposal&',`GtkSourceCompletionProposal*',`const_cast<GtkSourceCompletionProposal*>(($3).gobj())')
   _WRAP_METHOD(bool equal(const SourceCompletionProposal& other) const, gtk_source_completion_proposal_equal)
-//  bool operator==(const SourceCompletionProposal& other) const;
+#m4 _CONVERSION(`const Glib::RefPtr<SourceCompletionProposal>&',`GtkSourceCompletionProposal*',`const_cast<GtkSourceCompletionProposal*>(($3)->gobj())')
+  _WRAP_METHOD(bool equal(const Glib::RefPtr<SourceCompletionProposal>& other) const, gtk_source_completion_proposal_equal)
   
   _WRAP_SIGNAL(void changed(), "changed")
 };
diff --git a/gtksourceview/src/sourcegutter.ccg b/gtksourceview/src/sourcegutter.ccg
index 7821076..d1534f8 100644
--- a/gtksourceview/src/sourcegutter.ccg
+++ b/gtksourceview/src/sourcegutter.ccg
@@ -17,13 +17,15 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-static void SignalProxy_CellData_gtk_callback(GtkSourceGutter *gutter,
+#include <gtksourceview/gtksourcegutter.h>
+
+static void SignalProxy_CellData_gtk_callback(GtkSourceGutter *gutter G_GNUC_UNUSED,
                                               GtkCellRenderer *cell,
                                               gint line_number,
                                               gboolean current_line,
                                               gpointer data)
 {
-  gtksourceview::SourceGutter::SlotData* the_slot = static_cast<gtksourceview::SourceGutter::SlotData*>(user_data);
+  gtksourceview::SourceGutter::SlotData* the_slot = static_cast<gtksourceview::SourceGutter::SlotData*>(data);
 
   #ifdef GLIBMM_EXCEPTIONS_ENABLED
   try
@@ -44,13 +46,11 @@ static void SignalProxy_CellData_gtk_callback_destroy(void* data)
   delete static_cast<gtksourceview::SourceGutter::SlotData*>(data);
 }
 
-static void SignalProxy_CellSize_gtk_callback(GtkSourceGutter *gutter,
+static void SignalProxy_CellSize_gtk_callback(GtkSourceGutter *gutter G_GNUC_UNUSED,
                                               GtkCellRenderer *cell,
-                                              gint line_number,
-                                              gboolean current_line,
                                               gpointer data)
 {
-  gtksourceview::SourceGutter::SlotSize* the_slot = static_cast<gtksourceview::SourceGutter::SlotData*>(user_data);
+  gtksourceview::SourceGutter::SlotSize* the_slot = static_cast<gtksourceview::SourceGutter::SlotSize*>(data);
 
   #ifdef GLIBMM_EXCEPTIONS_ENABLED
   try
@@ -83,7 +83,7 @@ void SourceGutter::set_cell_data_func(Gtk::CellRenderer* renderer, const SlotDat
       &SignalProxy_CellData_gtk_callback_destroy);
 }
 
-void SourceGutter::set_cell_size_func(Gtk::CellRenderer& renderer, const SlotSize& slot)
+void SourceGutter::set_cell_size_func(Gtk::CellRenderer* renderer, const SlotSize& slot)
 {
   SlotSize* slot_copy = new SlotSize(slot);
 
diff --git a/gtksourceview/src/sourcegutter.hg b/gtksourceview/src/sourcegutter.hg
index 943829a..1921c5a 100644
--- a/gtksourceview/src/sourcegutter.hg
+++ b/gtksourceview/src/sourcegutter.hg
@@ -24,6 +24,8 @@
 #include <glibmm/object.h>
 #include <glibmm/refptr.h>
 #include <gtkmm/cellrenderer.h>
+#include <gtkmm/tooltip.h>
+#include <gtksourceviewmm/sourceview.h>
 
 _DEFS(gtksourceviewmm,gtksourceview)
 _PINCLUDE(glibmm/private/object_p.h)
@@ -43,7 +45,8 @@ public:
 
   _WRAP_METHOD(Glib::RefPtr<Gdk::Window> get_window(), gtk_source_gutter_get_window, refreturn)
   _WRAP_METHOD(Glib::RefPtr<const Gdk::Window> get_window() const, gtk_source_gutter_get_window, constversion, refreturn)
-  
+
+#m4 _CONVERSION(`Gtk::CellRenderer*',`GtkCellRenderer*',`($3)->gobj()')
   _WRAP_METHOD(void insert(Gtk::CellRenderer* renderer, int position), gtk_source_gutter_insert)
   _WRAP_METHOD(void reorder(Gtk::CellRenderer* renderer, int position), gtk_source_gutter_reorder)
   _WRAP_METHOD(void remove(Gtk::CellRenderer* renderer), gtk_source_gutter_remove)
@@ -60,11 +63,19 @@ public:
   void set_cell_data_func(Gtk::CellRenderer* renderer, const SlotData& slot);
   void set_cell_size_func(Gtk::CellRenderer* renderer, const SlotSize& slot);
 
-  _WRAP_PROPERTY("view", SourceView*);
-  _WRAP_PROPERTY("window-type", Gtk::TextWindowType);
-  
+  _WRAP_PROPERTY("view", SourceView*)
+  _WRAP_PROPERTY("window-type", Gtk::TextWindowType)
+
+#m4 _CONVERSION(`GtkCellRenderer*',`const Gtk::CellRenderer*',`Glib::wrap($3)')
+#m4 _CONVERSION(`GtkTextIter*',`const Gtk::TextIter&',`Glib::wrap($3)')
+#m4 _CONVERSION(`gpointer',`GdkEvent*',`static_cast<GdkEvent*>($3)')
+#m4 _CONVERSION(`const Gtk::CellRenderer*',`GtkCellRenderer*',`const_cast<GtkCellRenderer*>(($3)->gobj())')
+#m4 _CONVERSION(`const Gtk::TextIter&',`GtkTextIter*',`const_cast<GtkTextIter*>(($3).gobj())')
+#m4 _CONVERSION(`GdkEvent*',`gpointer',`static_cast<gpointer>($3)')
+#m4 _CONVERSION(`GtkTooltip*',`const Glib::RefPtr<Gtk::Tooltip>&',`Glib::wrap($3)')
+#m4 _CONVERSION(`const Glib::RefPtr<Gtk::Tooltip>&',`GtkTooltip*',`const_cast<GtkTooltip*>(($3)->gobj())')
   _WRAP_SIGNAL(void cell_activated(const Gtk::CellRenderer* renderer, const Gtk::TextIter& iter, GdkEvent* event), "cell-activated")
-  _WRAP_SIGNAL(bool query_tooltip(const Gtk::CellRenderer* renderer, const Gtk::TextIter& iter, const Glib::RefPtr<Tooltip>& tooltip), "query-tooltip")
+  _WRAP_SIGNAL(bool query_tooltip(const Gtk::CellRenderer* renderer, const Gtk::TextIter& iter, const Glib::RefPtr<Gtk::Tooltip>& tooltip), "query-tooltip")
 
 };
 
diff --git a/gtksourceview/src/sourceview.ccg b/gtksourceview/src/sourceview.ccg
index 914686b..97b0a88 100644
--- a/gtksourceview/src/sourceview.ccg
+++ b/gtksourceview/src/sourceview.ccg
@@ -91,22 +91,22 @@ SourceView::set_source_buffer (const Glib::RefPtr<SourceBuffer> &source_buffer)
     set_buffer (source_buffer) ;
 }
 
-void SourceView::set_mark_category_tooltip_func(const SlotMarkTooltip& slot)
+void SourceView::set_mark_category_tooltip_func(const Glib::ustring& category, const SlotMarkTooltip& slot)
 {
   SlotMarkTooltip* slot_copy = new SlotMarkTooltip(slot);
 
-  gtk_source_view_set_mark_category_tooltip_func(gobj(),
-      &SignalProxy_MarkTooltip_gtk_callback, slot_copy,
-      &SignalProxy_MarkTooltip_gtk_callback_destroy);
+  gtk_source_view_set_mark_category_tooltip_func(gobj(), category.c_str(),
+    &SignalProxy_MarkTooltip_gtk_callback, slot_copy,
+    &SignalProxy_MarkTooltip_gtk_callback_destroy);
 }
 
-void SourceView::set_mark_category_tooltip_markup_func(const SlotMarkTooltip& slot)
+void SourceView::set_mark_category_tooltip_markup_func(const Glib::ustring& category, const SlotMarkTooltip& slot)
 {
   SlotMarkTooltip* slot_copy = new SlotMarkTooltip(slot);
 
   gtk_source_view_set_mark_category_tooltip_markup_func(gobj(),
-      &SignalProxy_MarkTooltip_gtk_callback, slot_copy,
-      &SignalProxy_MarkTooltip_gtk_callback_destroy);
+    category.c_str(), &SignalProxy_MarkTooltip_gtk_callback, slot_copy,
+    &SignalProxy_MarkTooltip_gtk_callback_destroy);
 }
 
 }//end namespace gtksourceview
diff --git a/gtksourceview/src/sourceview.hg b/gtksourceview/src/sourceview.hg
index 02254e9..275031d 100644
--- a/gtksourceview/src/sourceview.hg
+++ b/gtksourceview/src/sourceview.hg
@@ -249,8 +249,8 @@ public:
   typedef sigc::slot<Glib::ustring, const Glib::RefPtr<SourceMark>& /* mark */> SlotMarkTooltip;
   
   _IGNORE(gtk_source_view_set_mark_category_tooltip_func, gtk_source_view_set_mark_category_tooltip_markup_func)
-  void set_mark_category_tooltip_func(const SlotMarkTooltip& slot);
-  void set_mark_category_tooltip_markup_func(const SlotMarkTooltip& slot);
+  void set_mark_category_tooltip_func(const Glib::ustring& category, const SlotMarkTooltip& slot);
+  void set_mark_category_tooltip_markup_func(const Glib::ustring& category, const SlotMarkTooltip& slot);
 
   _WRAP_SIGNAL(void redo(), "redo")
   _WRAP_SIGNAL(void undo(), "undo")



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