[gtksourceviewmm] Fix the build with latest GtkSourceView.



commit 8a04d9360593517c8f5022646b6c2dfbdc602688
Author: Krzesimir Nowak <qdlacz gmail com>
Date:   Tue Nov 30 20:13:32 2010 +0100

    Fix the build with latest GtkSourceView.
    
    * gtksourceview/src/sourcegutter.ccg:
    * gtksourceview/src/sourcegutter.hg: Removed or commented methods with
    Gtk::CellRenderers.
    * gtksourceview/src/sourceview.ccg:
    * gtksourceview/src/sourceview.hg: Removed or commented methods with mark
    categories.

 gtksourceview/src/sourcegutter.ccg |   87 ---------------------
 gtksourceview/src/sourcegutter.hg  |  111 ++-------------------------
 gtksourceview/src/sourceview.ccg   |   65 ----------------
 gtksourceview/src/sourceview.hg    |  150 ------------------------------------
 4 files changed, 7 insertions(+), 406 deletions(-)
---
diff --git a/gtksourceview/src/sourcegutter.ccg b/gtksourceview/src/sourcegutter.ccg
index 34a9ea5..6e868e5 100644
--- a/gtksourceview/src/sourcegutter.ccg
+++ b/gtksourceview/src/sourcegutter.ccg
@@ -19,90 +19,3 @@
 
 #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)
-{
-  Gsv::SourceGutter::SlotData* the_slot = static_cast<Gsv::SourceGutter::SlotData*>(data);
-
-  #ifdef GLIBMM_EXCEPTIONS_ENABLED
-  try
-  {
-  #endif //GLIBMM_EXCEPTIONS_ENABLED
-    (*the_slot)(Glib::wrap(cell), line_number, current_line);
-  #ifdef GLIBMM_EXCEPTIONS_ENABLED
-  }
-  catch(...)
-  {
-    Glib::exception_handlers_invoke();
-  }
-  #endif //GLIBMM_EXCEPTIONS_ENABLED
-}
-
-static void SignalProxy_CellData_gtk_callback_destroy(void* data)
-{
-  delete static_cast<Gsv::SourceGutter::SlotData*>(data);
-}
-
-static void SignalProxy_CellSize_gtk_callback(GtkSourceGutter *gutter G_GNUC_UNUSED,
-                                              GtkCellRenderer *cell,
-                                              gpointer data)
-{
-  Gsv::SourceGutter::SlotSize* the_slot = static_cast<Gsv::SourceGutter::SlotSize*>(data);
-
-  #ifdef GLIBMM_EXCEPTIONS_ENABLED
-  try
-  {
-  #endif //GLIBMM_EXCEPTIONS_ENABLED
-    (*the_slot)(Glib::wrap(cell));
-  #ifdef GLIBMM_EXCEPTIONS_ENABLED
-  }
-  catch(...)
-  {
-    Glib::exception_handlers_invoke();
-  }
-  #endif //GLIBMM_EXCEPTIONS_ENABLED
-}
-
-static void SignalProxy_CellSize_gtk_callback_destroy(void* data)
-{
-  delete static_cast<Gsv::SourceGutter::SlotSize*>(data);
-}
-
-namespace Gsv
-{
-
-void SourceGutter::set_cell_data_func(Gtk::CellRenderer* renderer, const SlotData& slot)
-{
-  SlotData* slot_copy = new SlotData(slot);
-
-  gtk_source_gutter_set_cell_data_func(gobj(), Glib::unwrap(renderer),
-      &SignalProxy_CellData_gtk_callback, slot_copy,
-      &SignalProxy_CellData_gtk_callback_destroy);
-}
-
-void SourceGutter::set_cell_size_func(Gtk::CellRenderer* renderer, const SlotSize& slot)
-{
-  SlotSize* slot_copy = new SlotSize(slot);
-
-  gtk_source_gutter_set_cell_size_func(gobj(), Glib::unwrap(renderer),
-      &SignalProxy_CellSize_gtk_callback, slot_copy,
-      &SignalProxy_CellSize_gtk_callback_destroy);
-}
-
-void
-SourceGutter::reset_cell_data_func(Gtk::CellRenderer* renderer)
-{
-  gtk_source_gutter_set_cell_data_func(gobj(), Glib::unwrap(renderer), 0, 0, 0);
-}
-
-void
-SourceGutter::reset_cell_size_func(Gtk::CellRenderer* renderer)
-{
-  gtk_source_gutter_set_cell_size_func(gobj(), Glib::unwrap(renderer), 0, 0, 0);
-}
-
-}//end namespace Gsv
-
diff --git a/gtksourceview/src/sourcegutter.hg b/gtksourceview/src/sourcegutter.hg
index ef8ef06..b8514b0 100644
--- a/gtksourceview/src/sourcegutter.hg
+++ b/gtksourceview/src/sourcegutter.hg
@@ -23,7 +23,6 @@
 #include <gdkmm/window.h>
 #include <glibmm/object.h>
 #include <glibmm/refptr.h>
-#include <gtkmm/cellrenderer.h>
 #include <gtkmm/tooltip.h>
 #include <gtksourceviewmm/sourceview.h>
 
@@ -35,6 +34,7 @@ namespace Gsv
 
 class SourceView;
 
+// TODO: update docs.
 /** Gutter object for SourceView
  *
  * The SourceGutter object represents the left and right gutters of the text
@@ -87,7 +87,6 @@ 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.
@@ -95,7 +94,7 @@ public:
    *
    * @newin{2,10}
    */
-  _WRAP_METHOD(void insert(Gtk::CellRenderer* renderer, int position), gtk_source_gutter_insert)
+//  _WRAP_METHOD(void insert(Gtk::CellRenderer* renderer, int position), gtk_source_gutter_insert)
 
   /** Reorders @a renderer in a gutter to new @a position.
    *
@@ -104,7 +103,7 @@ public:
    *
    * @newin{2,10}
    */
-  _WRAP_METHOD(void reorder(Gtk::CellRenderer* renderer, int position), gtk_source_gutter_reorder)
+//  _WRAP_METHOD(void reorder(Gtk::CellRenderer* renderer, int position), gtk_source_gutter_reorder)
 
   /** Removes @a renderer from a gutter.
    *
@@ -112,114 +111,18 @@ public:
    *
    * @newin{2,10}
    */
-  _WRAP_METHOD(void remove(Gtk::CellRenderer* renderer), gtk_source_gutter_remove)
+//  _WRAP_METHOD(void remove(Gtk::CellRenderer* renderer), gtk_source_gutter_remove)
 
-  /** Invalidates the drawable area of the gutter.
-   *
-   * You can use this to force a redraw of the gutter if something has changed
-   * and needs to be redrawn.
-   *
-   * @newin{2,10}
-   */
   _WRAP_METHOD(void queue_draw(), gtk_source_gutter_queue_draw)
 
-  /** Slot holding a function.
-   *
-   * @par Prototype:
-   * <tt>void on_cell_data(Gtk::CellRenderer& cell, int line_number, bool current_line);</tt>
-   *
-   * @newin{2,10}
-   */
-  typedef sigc::slot<void, Gtk::CellRenderer* /* cell */, int /* line_number */, bool /* current_line */> SlotData;
-
-  /** Slot holding a function.
-   *
-   * @par Prototype:
-   * <tt>void on_cell_size(Gtk::CellRenderer& cell);</tt>
-   *
-   * @newin{2,10}
-   */
-  typedef sigc::slot<void, Gtk::CellRenderer* /* cell */> SlotSize;
-  _IGNORE(gtk_source_gutter_set_cell_data_func, gtk_source_gutter_set_cell_size_func)
-
-  /** Sets the SlotData to use for @a renderer.
-   *
-   * This function is used to setup the cell renderer properties for rendering
-   * the current cell.
-   *
-   * @param renderer A Gtk::CellRenderer.
-   * @param slot A slot containing function to use.
-   *
-   * @newin{2,10}
-   */
-  void set_cell_data_func(Gtk::CellRenderer* renderer, const SlotData& slot);
-
-  /** Sets the SlotSize to use for @a renderer.
-   *
-   * This function is used to setup the cell renderer properties for measuring
-   * the maximum size of the cell.
-   *
-   * @param renderer A Gtk::CellRenderer.
-   * @param slot A slot containing function to use.
-   *
-   * @newin{2,10}
-   */
-  void set_cell_size_func(Gtk::CellRenderer* renderer, const SlotSize& slot);
+  _WRAP_METHOD(void set_padding(int xpad, int ypad), gtk_source_gutter_set_padding)
 
-  /** Resets a SlotData to use for @a renderer.
-   *
-   * @param renderer A Gtk::CellRenderer.
-   *
-   * @newin{2,10}
-   */
-  void reset_cell_data_func(Gtk::CellRenderer* renderer);
+  // TODO: create a Padding class.
 
-  /** Resets a SlotSize to use for @a renderer.
-   *
-   * @param renderer A Gtk::CellRenderer.
-   *
-   * @newin{2,10}
-   */
-  void reset_cell_size_func(Gtk::CellRenderer* renderer);
+  _WRAP_METHOD(void get_padding(int& xpad, int& ypad) const, gtk_source_gutter_get_padding)
 
   _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).
-   *
-   * The signal is only emitted for cells that have the @c activatable property
-   * set to @c true.
-   *
-   * @par Handler parameters:
-   * renderer A Gtk::CellRenderer which was activated.
-   * iter The Gtk::TextIter at which the cell was activated.
-   * event An event with which the cell was activated.
-   *
-   * @newin{2,10}
-   */
-  _WRAP_SIGNAL(void cell_activated(Gtk::CellRenderer* renderer, const Gtk::TextIter& iter, GdkEvent* event), "cell-activated")
-
-#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))')
-  /** Emitted when a tooltip is requested for a specific cell.
-   *
-   * Signal handlers can return @c true to notify the tooltip has been handled.
-   *
-   * @par Handler parameters:
-   * renderer A Gtk::CellRenderer which was activated.
-   * iter The Gtk::TextIter at which the cell was activated.
-   * tooltip A Gtk::Tooltip.
-   *
-   * @return @c true if tooltip has been handled, otherwise @c false.
-   *
-   * @newin{2,10}
-   */
-  _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 Gsv
diff --git a/gtksourceview/src/sourceview.ccg b/gtksourceview/src/sourceview.ccg
index 71b8e64..9c26ef9 100644
--- a/gtksourceview/src/sourceview.ccg
+++ b/gtksourceview/src/sourceview.ccg
@@ -23,31 +23,6 @@
 #include <gtksourceview/gtksourceview.h>
 #include <gtksourceview/gtksourceview-typebuiltins.h>
 
-static gchar* SignalProxy_MarkTooltip_gtk_callback(GtkSourceMark* mark, gpointer user_data)
-{
-  Gsv::SourceView::SlotMarkTooltip* the_slot = static_cast<Gsv::SourceView::SlotMarkTooltip*>(user_data);
-
-  #ifdef GLIBMM_EXCEPTIONS_ENABLED
-  try
-  {
-  #endif //GLIBMM_EXCEPTIONS_ENABLED
-    return g_strdup((*the_slot)(Glib::wrap(mark)).c_str());
-  #ifdef GLIBMM_EXCEPTIONS_ENABLED
-  }
-  catch(...)
-  {
-    Glib::exception_handlers_invoke();
-  }
-
-  return 0; //An arbitary default, just to avoid the compiler warning.
-  #endif //GLIBMM_EXCEPTIONS_ENABLED
-}
-
-static void SignalProxy_MarkTooltip_gtk_callback_destroy(void* data)
-{
-  delete static_cast<Gsv::SourceView::SlotMarkTooltip*>(data);
-}
-
 namespace Gsv
 {
 
@@ -91,45 +66,5 @@ SourceView::set_source_buffer (const Glib::RefPtr<SourceBuffer> &source_buffer)
     set_buffer (source_buffer) ;
 }
 
-void
-SourceView::unset_mark_category_icon(const Glib::ustring& category)
-{
-  gtk_source_view_set_mark_category_icon_from_icon_name(gobj(), category.c_str(), 0);
-  gtk_source_view_set_mark_category_icon_from_stock(gobj(), category.c_str(), 0);
-  gtk_source_view_set_mark_category_icon_from_pixbuf(gobj(), category.c_str(), 0);
-}
-
-void
-SourceView::unset_mark_category_background(const Glib::ustring& category)
-{
-  gtk_source_view_set_mark_category_background(gobj(), category.c_str(), 0);
-}
-
-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(), category.c_str(),
-    &SignalProxy_MarkTooltip_gtk_callback, slot_copy,
-    &SignalProxy_MarkTooltip_gtk_callback_destroy);
-}
-
-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(),
-    category.c_str(), &SignalProxy_MarkTooltip_gtk_callback, slot_copy,
-    &SignalProxy_MarkTooltip_gtk_callback_destroy);
-}
-
-void
-SourceView::unset_mark_category_tooltip_func(const Glib::ustring& category)
-{
-  gtk_source_view_set_mark_category_tooltip_func(gobj(), category.c_str(), 0, 0, 0);
-}
-
 }//end namespace Gsv
 
diff --git a/gtksourceview/src/sourceview.hg b/gtksourceview/src/sourceview.hg
index 384270d..dadccfc 100644
--- a/gtksourceview/src/sourceview.hg
+++ b/gtksourceview/src/sourceview.hg
@@ -258,95 +258,6 @@ public:
    */
   _WRAP_METHOD(gint get_indent_width() const, gtk_source_view_get_indent_width)
 
-  /** Set the @a priority for the given mark @a category.
-   *
-   * When there are multiple marks on the same line, marks of categories with
-   * higher priorities will be drawn on top.
-   *
-   * @param category A mark category.
-   * @param priority The priority for the category.
-   *
-   * @newin{2,2}
-   */
-  _WRAP_METHOD(void set_mark_category_priority(const Glib::ustring& category, gint priority), gtk_source_view_set_mark_category_priority)
-
-  /** Gets the priority which is associated with the given @a category.
-   *
-   * @param category A mark category.
-   *
-   * @return The priority or if @a category exists but no priority was set, it
-   * defaults to 0.
-   *
-   * @newin{2,2}
-   */
-  _WRAP_METHOD(gint get_mark_category_priority(const Glib::ustring& category) const, gtk_source_view_get_mark_category_priority)
-
-  /** Sets the icon to be used for @a category to @a pixbuf.
-   *
-   * @param category A mark category.
-   * @param pixbuf A Gdk::Pixbuf or empty Glib::RefPtr.
-   *
-   * @newin{2,10}
-   */
-  _WRAP_METHOD(void set_mark_category_icon(const Glib::ustring& category, const Glib::RefPtr<Gdk::Pixbuf>& pixbuf), gtk_source_view_set_mark_category_icon_from_pixbuf)
-
-  /** Sets the icon to be used for @a category to the stock item @a stock_id.
-   *
-   * @param category A mark category.
-   * @param stock_id The stock id.
-   *
-   * @newin{2,10}
-   */
-  _WRAP_METHOD(void set_mark_category_icon(const Glib::ustring& category, const Gtk::StockID& stock_id), gtk_source_view_set_mark_category_icon_from_stock)
-
-  /** Sets the icon to be used for @a category to the named theme item @a name.
-   *
-   * @param category A mark category.
-   * @param name The themed icon name.
-   *
-   * @newin{2,10}
-   */
-  _WRAP_METHOD(void set_mark_category_icon(const Glib::ustring& category, const Glib::ustring& name), gtk_source_view_set_mark_category_icon_from_icon_name)
-
-  /** Unsets the icon used for @a category.
-   *
-   * @param category A mark category.
-   *
-   * @newin{2,10}
-   */
-  void unset_mark_category_icon(const Glib::ustring& category);
-
-#m4 _CONVERSION(`const Gdk::Color&',`const GdkColor*',`($3).gobj()')
-  /** Sets given background @a color for mark @a category.
-   *
-   * @param category A mark category.
-   * @param color Background color.
-   *
-   * @newin{2,10}
-   */
-  _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.
-   *
-   * @param category A mark category.
-   *
-   * @newin{2,10}
-   */
-  void unset_mark_category_background(const Glib::ustring& category);
-
-#m4 _CONVERSION(`Gdk::Color&',`GdkColor*',`($3).gobj()')
-  /** Gets the background color associated with given @a category.
-   *
-   * @param category A mark category.
-   * @param dest Destination Gdk::Color structure to fill in.
-   *
-   * @return @c true if background color for @a category was set and @a dest is
-   * set to a valid color, or @c false otherwise.
-   *
-   * @newin{2,10}
-   */
-  _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.
    *
    * Specifying @a flags as 0 will disable display of spaces.
@@ -375,67 +286,6 @@ public:
    */
   _WRAP_METHOD(guint get_visual_column(const Gtk::TextIter& iter) const, gtk_source_view_get_visual_column)
 
-  /** Slot holding a function.
-   *
-   * @par Prototype:
-   * <tt>Glib::ustring on_mark_tooltip(const Glib::RefPtr<SourceMark>& mark);</tt>
-   *
-   * @newin{2,10}
-   */
-  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)
-
-  /** Set a SlotMarkTooltip used to set tooltip on marks from the given mark
-   *  @a category.
-   *
-   * If you also specified a function with
-   * set_mark_category_tooltip_markup_func() the markup variant takes
-   * precedence.
-   *
-   * @code
-   * static Glib::ustring
-   * tooltip_func (Gsv::SourceMark *mark)
-   * {
-   *   return get_tooltip_for_mark(mark);
-   * }
-   *
-   * ...
-   *
-   * SourceView view;
-   *
-   * view->set_mark_category_tooltip_func("other-mark",
-   *                                      sigc::ptr_fun(&tooltip_func));
-   * @endcode
-   *
-   * @param category A mark category.
-   * @param slot A SlotMarkTooltip.
-   *
-   * @newin{2,10}
-   */
-  void set_mark_category_tooltip_func(const Glib::ustring& category, const SlotMarkTooltip& slot);
-
-  /** Set a SlotMarkTooltip used to set tooltip on marks from the given mark
-   *  @a category.
-   *
-   * See set_mark_category_tooltip_func() for more information.
-   *
-   * @param category A mark category.
-   * @param slot A SlotMarkTooltip.
-   *
-   * @newin{2,10}
-   */
-  void set_mark_category_tooltip_markup_func(const Glib::ustring& category, const SlotMarkTooltip& slot);
-
-  /** Unsets a function used to set tooltip marks from the given mark
-   *  @a category.
-   *
-   * @param category A mark category.
-   *
-   * @newin{2,10}
-   */
-  void unset_mark_category_tooltip_func(const Glib::ustring& category);
-
   /** Returns the SourceGutter object associated with @a window_type for this
    *  view.
    *



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