[gtksourceviewmm] Added SourceView::get/set_draw_spaces().



commit 4e29e355fa662aa17085309616d20c3ccff91a1a
Author: Parent Fabien <parent f gmail com>
Date:   Mon Jun 15 17:22:55 2009 +0200

    Added SourceView::get/set_draw_spaces().
    
    * gtksourceview/src/gtksourceview_enums.defs:
    * gtksourceview/src/gtksourceview_methods.defs:
    * gtksourceview/src/gtksourceview_signals.defs: Regenerated.
    * gtksourceview/src/sourceview.hg: Added get/set_draw_spaces() and the
    property and related enum.
    * tools/m4/convert_gtksourceviewmm.m4: Add a conversion for the enum.
    Bug #585278.

 ChangeLog                                    |   12 ++++++++++++
 gtksourceview/src/gtksourceview_enums.defs   |   12 ++++++++++++
 gtksourceview/src/gtksourceview_methods.defs |   26 ++++++++++++++++++++++++++
 gtksourceview/src/gtksourceview_signals.defs |    9 +++++++++
 gtksourceview/src/sourceview.hg              |   17 +++++++++++++++++
 tools/m4/convert_gtksourceviewmm.m4          |    1 +
 6 files changed, 77 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 78faac1..fd5c092 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2009-06-15  Parent Fabien  <parent f gmail com>
+
+	Added SourceView::get/set_draw_spaces().
+	
+	* gtksourceview/src/gtksourceview_enums.defs:
+	* gtksourceview/src/gtksourceview_methods.defs:
+	* gtksourceview/src/gtksourceview_signals.defs: Regenerated.
+	* gtksourceview/src/sourceview.hg: Added get/set_draw_spaces() and the 
+	property and related enum.
+	* tools/m4/convert_gtksourceviewmm.m4: Add a conversion for the enum.
+	Bug #585278.
+
 2.3.1:
 
 2008-12-15  Murray Cumming  <murrayc murrayc com>
diff --git a/gtksourceview/src/gtksourceview_enums.defs b/gtksourceview/src/gtksourceview_enums.defs
index ca5b6a8..c4e0a7f 100644
--- a/gtksourceview/src/gtksourceview_enums.defs
+++ b/gtksourceview/src/gtksourceview_enums.defs
@@ -23,3 +23,15 @@
   )
 )
 
+(define-flags-extended SourceDrawSpacesFlags
+  (in-module "Gtk")
+  (c-name "GtkSourceDrawSpacesFlags")
+  (values
+    '("space" "GTK_SOURCE_DRAW_SPACES_SPACE" "1 << 0")
+    '("tab" "GTK_SOURCE_DRAW_SPACES_TAB" "1 << 1")
+    '("newline" "GTK_SOURCE_DRAW_SPACES_NEWLINE" "1 << 2")
+    '("nbsp" "GTK_SOURCE_DRAW_SPACES_NBSP" "1 << 3")
+    '("all" "GTK_SOURCE_DRAW_SPACES_ALL" "SOURCE_DRAW_SPACES_SPACE | SOURCE_DRAW_SPACES_TAB | SOURCE_DRAW_SPACES_NEWLINE | SOURCE_DRAW_SPACES_NBSP")
+  )
+)
+
diff --git a/gtksourceview/src/gtksourceview_methods.defs b/gtksourceview/src/gtksourceview_methods.defs
index 4dce5e1..7f75c4f 100644
--- a/gtksourceview/src/gtksourceview_methods.defs
+++ b/gtksourceview/src/gtksourceview_methods.defs
@@ -127,6 +127,18 @@
   )
 )
 
+(define-flags SourceDrawSpacesFlags
+  (in-module "Gtk")
+  (c-name "GtkSourceDrawSpacesFlags")
+  (gtype-id "GTK_TYPE_SOURCE_DRAW_SPACES_FLAGS")
+  (values
+    '("space" "GTK_SOURCE_DRAW_SPACES_SPACE")
+    '("tab" "GTK_SOURCE_DRAW_SPACES_TAB")
+    '("newline" "GTK_SOURCE_DRAW_SPACES_NEWLINE")
+    '("nbsp" "GTK_SOURCE_DRAW_SPACES_NBSP")
+    '("all" "GTK_SOURCE_DRAW_SPACES_ALL")
+  )
+)
 
 ;; From gtksourcebuffer.h
 
@@ -1267,6 +1279,20 @@
   (return-type "GtkSourceSmartHomeEndType")
 )
 
+(define-method set_draw_spaces
+  (of-object "GtkSourceView")
+  (c-name "gtk_source_view_set_draw_spaces")
+  (return-type "none")
+  (parameters
+    '("GtkSourceDrawSpacesFlags" "flags")
+  )
+)
+
+(define-method get_draw_spaces
+  (of-object "GtkSourceView")
+  (c-name "gtk_source_view_get_draw_spaces")
+  (return-type "GtkSourceDrawSpacesFlags")
+)
 
 
 ;; From gtksourceview-i18n.h
diff --git a/gtksourceview/src/gtksourceview_signals.defs b/gtksourceview/src/gtksourceview_signals.defs
index 6f28d43..1bd31a8 100644
--- a/gtksourceview/src/gtksourceview_signals.defs
+++ b/gtksourceview/src/gtksourceview_signals.defs
@@ -873,5 +873,14 @@
   (construct-only #f)
 )
 
+(define-property draw-spaces
+  (of-object "GtkSourceView")
+  (prop-type "GParamFlags")
+  (docs "Set if and how the spaces should be visualized")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
 ;; From GtkSourceSearchFlags
 
diff --git a/gtksourceview/src/sourceview.hg b/gtksourceview/src/sourceview.hg
index 759d729..2838917 100644
--- a/gtksourceview/src/sourceview.hg
+++ b/gtksourceview/src/sourceview.hg
@@ -32,6 +32,7 @@ namespace gtksourceview
 {
 
 _WRAP_ENUM(SourceSmartHomeEndType, GtkSourceSmartHomeEndType)
+_WRAP_ENUM(SourceDrawSpacesFlags, GtkSourceDrawSpacesFlags)
 
 /// \brief Multi-line source editing widget.
 ///
@@ -222,6 +223,17 @@ public:
   /// \param category a mark category.
   /// \return the associated GdkPixbuf, or NULL if not found.
   _WRAP_METHOD(Glib::RefPtr<const Gdk::Pixbuf> get_mark_category_pixbuf(const Glib::ustring& category) const, gtk_source_view_get_mark_category_pixbuf, refreturn, constversion)
+  
+  /// \brief Set if and how the spaces should be visualized/
+  ///
+  /// \param flags specifing how white spaces should be displayed.
+  _WRAP_METHOD(void set_draw_spaces(SourceDrawSpacesFlags flags = static_cast<SourceDrawSpacesFlags>(SOURCE_DRAW_SPACES_ALL)), gtk_source_view_set_draw_spaces)
+  
+  /// \brief Returns the SourceDrawSpacesFlags specifying if and how
+  /// spaces should be displayed for this view 
+  ///
+  /// \return flags the SourceDrawSpacesFlags, 0 if no spaces should be drawn.
+  _WRAP_METHOD(SourceDrawSpacesFlags get_draw_spaces() const, gtk_source_view_get_draw_spaces)
 
   _WRAP_SIGNAL(void redo(), "redo")
   _WRAP_SIGNAL(void undo(), "undo")
@@ -284,6 +296,11 @@ public:
   ///
   /// Default value is true.
   _WRAP_PROPERTY("indent_on_tab", bool)
+  
+  /// \brief Set if and how the spaces should be visualized.
+  ///
+  /// Default value is 0.
+  _WRAP_PROPERTY("draw-spaces", SourceDrawSpacesFlags)
 
 };
 
diff --git a/tools/m4/convert_gtksourceviewmm.m4 b/tools/m4/convert_gtksourceviewmm.m4
index 2dc5fea..59e73f8 100644
--- a/tools/m4/convert_gtksourceviewmm.m4
+++ b/tools/m4/convert_gtksourceviewmm.m4
@@ -48,4 +48,5 @@ _CONVERSION(`GdkPixbuf*',`Glib::RefPtr<const Gdk::Pixbuf>',`Glib::wrap($3)')
 _CONVERSION(`GtkSourceStyleSchemeManager*',`Glib::RefPtr<SourceStyleSchemeManager>',`Glib::wrap($3)')
 
 _CONV_ENUM(Gtk,SourceSmartHomeEndType)
+_CONV_ENUM(Gtk,SourceDrawSpacesFlags)
 



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