[gtksourceview/wip/new-space-drawing-api: 2/2] view: deprecate old white space drawing API



commit 2a8f765ae67556f20f0c6d3290463b635930909e
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sun Sep 25 19:00:16 2016 +0200

    view: deprecate old white space drawing API
    
    The new API is more powerful, and it makes more sense to have two
    separate enums for the space types vs locations.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=683678

 gtksourceview/gtksourceview.c |   14 +++++++++++++-
 gtksourceview/gtksourceview.h |    9 +++++++--
 2 files changed, 20 insertions(+), 3 deletions(-)
---
diff --git a/gtksourceview/gtksourceview.c b/gtksourceview/gtksourceview.c
index 7a897a9..c2d68fa 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -646,6 +646,8 @@ gtk_source_view_class_init (GtkSourceViewClass *klass)
         * #GtkSourceTag:draw-spaces property.
         *
         * Since: 2.4
+        * Deprecated: 3.24: Use the #GtkSourceSpaceDrawer:matrix property
+        * instead.
         */
        g_object_class_install_property (object_class,
                                         PROP_DRAW_SPACES,
@@ -655,7 +657,8 @@ gtk_source_view_class_init (GtkSourceViewClass *klass)
                                                             GTK_SOURCE_TYPE_DRAW_SPACES_FLAGS,
                                                             0,
                                                             G_PARAM_READWRITE |
-                                                            G_PARAM_STATIC_STRINGS));
+                                                            G_PARAM_STATIC_STRINGS |
+                                                            G_PARAM_DEPRECATED));
 
        /**
         * GtkSourceView:background-pattern:
@@ -1161,7 +1164,9 @@ gtk_source_view_set_property (GObject      *object,
                        break;
 
                case PROP_DRAW_SPACES:
+                       G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
                        gtk_source_view_set_draw_spaces (view, g_value_get_flags (value));
+                       G_GNUC_END_IGNORE_DEPRECATIONS;
                        break;
 
                case PROP_BACKGROUND_PATTERN:
@@ -1241,7 +1246,9 @@ gtk_source_view_get_property (GObject    *object,
                        break;
 
                case PROP_DRAW_SPACES:
+                       G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
                        g_value_set_flags (value, gtk_source_view_get_draw_spaces (view));
+                       G_GNUC_END_IGNORE_DEPRECATIONS;
                        break;
 
                case PROP_BACKGROUND_PATTERN:
@@ -4467,6 +4474,9 @@ gtk_source_view_get_smart_home_end (GtkSourceView *view)
  *
  * For a finer-grained method, there is also the GtkSourceTag's
  * #GtkSourceTag:draw-spaces property.
+ *
+ * Deprecated: 3.24: Use gtk_source_space_drawer_set_types_for_locations()
+ * instead.
  */
 void
 gtk_source_view_set_draw_spaces (GtkSourceView            *view,
@@ -4490,6 +4500,8 @@ gtk_source_view_set_draw_spaces (GtkSourceView            *view,
  * should be displayed for this @view.
  *
  * Returns: the #GtkSourceDrawSpacesFlags, 0 if no spaces should be drawn.
+ * Deprecated: 3.24: Use gtk_source_space_drawer_get_types_for_locations()
+ * instead.
  */
 GtkSourceDrawSpacesFlags
 gtk_source_view_get_draw_spaces (GtkSourceView *view)
diff --git a/gtksourceview/gtksourceview.h b/gtksourceview/gtksourceview.h
index 1c3413d..628c14f 100644
--- a/gtksourceview/gtksourceview.h
+++ b/gtksourceview/gtksourceview.h
@@ -97,7 +97,11 @@ typedef enum _GtkSourceSmartHomeEndType
  * of GTK_SOURCE_DRAW_SPACES_LEADING, GTK_SOURCE_DRAW_SPACES_TEXT or
  * GTK_SOURCE_DRAW_SPACES_TRAILING is specified, whitespaces at any position in
  * the line will be drawn (i.e. it has the same effect as specifying all of them).
+ *
+ * Deprecated: 3.24: Use #GtkSourceSpaceTypeFlags and
+ * #GtkSourceSpaceLocationFlags instead.
  */
+#ifndef GTKSOURCEVIEW_DISABLE_DEPRECATED
 typedef enum _GtkSourceDrawSpacesFlags
 {
        GTK_SOURCE_DRAW_SPACES_SPACE      = 1 << 0,
@@ -109,6 +113,7 @@ typedef enum _GtkSourceDrawSpacesFlags
        GTK_SOURCE_DRAW_SPACES_TRAILING   = 1 << 6,
        GTK_SOURCE_DRAW_SPACES_ALL        = 0x7f
 } GtkSourceDrawSpacesFlags;
+#endif
 
 /**
  * GtkSourceBackgroundPatternType:
@@ -272,11 +277,11 @@ GTK_SOURCE_AVAILABLE_IN_ALL
 GtkSourceSmartHomeEndType
                 gtk_source_view_get_smart_home_end     (GtkSourceView   *view);
 
-GTK_SOURCE_AVAILABLE_IN_ALL
+GTK_SOURCE_DEPRECATED_IN_3_24_FOR (gtk_source_space_drawer_set_types_for_locations)
 void            gtk_source_view_set_draw_spaces        (GtkSourceView            *view,
                                                         GtkSourceDrawSpacesFlags  flags);
 
-GTK_SOURCE_AVAILABLE_IN_ALL
+GTK_SOURCE_DEPRECATED_IN_3_24_FOR (gtk_source_space_drawer_get_types_for_locations)
 GtkSourceDrawSpacesFlags
                 gtk_source_view_get_draw_spaces        (GtkSourceView   *view);
 


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