[gtksourceview/wip/gsv-4] View: remove the deprecated API
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/gsv-4] View: remove the deprecated API
- Date: Fri, 4 Nov 2016 21:23:37 +0000 (UTC)
commit 8ad823527b1edee346e3b7a7210a047629dc5a61
Author: Sébastien Wilmet <swilmet gnome org>
Date: Fri Nov 4 22:13:11 2016 +0100
View: remove the deprecated API
docs/reference/gtksourceview-4.0-sections.txt | 3 -
gtksourceview/gtksourcespacedrawer-private.h | 9 --
gtksourceview/gtksourcespacedrawer.c | 151 +------------------------
gtksourceview/gtksourceview.c | 90 ---------------
gtksourceview/gtksourceview.h | 43 -------
5 files changed, 1 insertions(+), 295 deletions(-)
---
diff --git a/docs/reference/gtksourceview-4.0-sections.txt b/docs/reference/gtksourceview-4.0-sections.txt
index c39029f..84bf010 100644
--- a/docs/reference/gtksourceview-4.0-sections.txt
+++ b/docs/reference/gtksourceview-4.0-sections.txt
@@ -946,7 +946,6 @@ GTK_SOURCE_VERSION_MAX_ALLOWED
<TITLE>GtkSourceView</TITLE>
GtkSourceView
GtkSourceSmartHomeEndType
-GtkSourceDrawSpacesFlags
GtkSourceViewGutterPosition
GtkSourceBackgroundPatternType
gtk_source_view_new
@@ -983,8 +982,6 @@ gtk_source_view_set_mark_attributes
gtk_source_view_get_mark_attributes
gtk_source_view_set_show_line_marks
gtk_source_view_get_show_line_marks
-gtk_source_view_set_draw_spaces
-gtk_source_view_get_draw_spaces
gtk_source_view_set_background_pattern
gtk_source_view_get_background_pattern
<SUBSECTION Standard>
diff --git a/gtksourceview/gtksourcespacedrawer-private.h b/gtksourceview/gtksourcespacedrawer-private.h
index 595083b..88a8917 100644
--- a/gtksourceview/gtksourcespacedrawer-private.h
+++ b/gtksourceview/gtksourcespacedrawer-private.h
@@ -25,19 +25,10 @@
#include <gtk/gtk.h>
#include "gtksourcetypes.h"
#include "gtksourcetypes-private.h"
-#include "gtksourceview.h"
G_BEGIN_DECLS
GTK_SOURCE_INTERNAL
-GtkSourceDrawSpacesFlags
- _gtk_source_space_drawer_get_flags (GtkSourceSpaceDrawer *drawer);
-
-GTK_SOURCE_INTERNAL
-void _gtk_source_space_drawer_set_flags (GtkSourceSpaceDrawer *drawer,
- GtkSourceDrawSpacesFlags flags);
-
-GTK_SOURCE_INTERNAL
void _gtk_source_space_drawer_update_color (GtkSourceSpaceDrawer *drawer,
GtkSourceView *view);
diff --git a/gtksourceview/gtksourcespacedrawer.c b/gtksourceview/gtksourcespacedrawer.c
index db1ec0d..df77941 100644
--- a/gtksourceview/gtksourcespacedrawer.c
+++ b/gtksourceview/gtksourcespacedrawer.c
@@ -30,6 +30,7 @@
#include "gtksourceiter.h"
#include "gtksourcestylescheme.h"
#include "gtksourcetag.h"
+#include "gtksourceview.h"
/**
* SECTION:spacedrawer
@@ -391,156 +392,6 @@ gtk_source_space_drawer_new (void)
return g_object_new (GTK_SOURCE_TYPE_SPACE_DRAWER, NULL);
}
-static GtkSourceSpaceLocationFlags
-get_nonzero_locations_for_draw_spaces_flags (GtkSourceSpaceDrawer *drawer)
-{
- GtkSourceSpaceLocationFlags locations = GTK_SOURCE_SPACE_LOCATION_NONE;
- GtkSourceSpaceTypeFlags types;
-
- types = gtk_source_space_drawer_get_types_for_locations (drawer, GTK_SOURCE_SPACE_LOCATION_LEADING);
- if (types != GTK_SOURCE_SPACE_TYPE_NONE)
- {
- locations |= GTK_SOURCE_SPACE_LOCATION_LEADING;
- }
-
- types = gtk_source_space_drawer_get_types_for_locations (drawer,
GTK_SOURCE_SPACE_LOCATION_INSIDE_TEXT);
- if (types != GTK_SOURCE_SPACE_TYPE_NONE)
- {
- locations |= GTK_SOURCE_SPACE_LOCATION_INSIDE_TEXT;
- }
-
- types = gtk_source_space_drawer_get_types_for_locations (drawer, GTK_SOURCE_SPACE_LOCATION_TRAILING);
- if (types != GTK_SOURCE_SPACE_TYPE_NONE)
- {
- locations |= GTK_SOURCE_SPACE_LOCATION_TRAILING;
- }
-
- return locations;
-}
-
-GtkSourceDrawSpacesFlags
-_gtk_source_space_drawer_get_flags (GtkSourceSpaceDrawer *drawer)
-{
- GtkSourceSpaceLocationFlags locations;
- GtkSourceSpaceTypeFlags common_types;
- GtkSourceDrawSpacesFlags flags = 0;
-
- g_return_val_if_fail (GTK_SOURCE_IS_SPACE_DRAWER (drawer), 0);
-
- if (!drawer->priv->enable_matrix)
- {
- return 0;
- }
-
- locations = get_nonzero_locations_for_draw_spaces_flags (drawer);
- common_types = gtk_source_space_drawer_get_types_for_locations (drawer, locations);
-
- if (locations & GTK_SOURCE_SPACE_LOCATION_LEADING)
- {
- flags |= GTK_SOURCE_DRAW_SPACES_LEADING;
- }
- if (locations & GTK_SOURCE_SPACE_LOCATION_INSIDE_TEXT)
- {
- flags |= GTK_SOURCE_DRAW_SPACES_TEXT;
- }
- if (locations & GTK_SOURCE_SPACE_LOCATION_TRAILING)
- {
- flags |= GTK_SOURCE_DRAW_SPACES_TRAILING;
- }
-
- if (common_types & GTK_SOURCE_SPACE_TYPE_SPACE)
- {
- flags |= GTK_SOURCE_DRAW_SPACES_SPACE;
- }
- if (common_types & GTK_SOURCE_SPACE_TYPE_TAB)
- {
- flags |= GTK_SOURCE_DRAW_SPACES_TAB;
- }
- if (common_types & GTK_SOURCE_SPACE_TYPE_NEWLINE)
- {
- flags |= GTK_SOURCE_DRAW_SPACES_NEWLINE;
- }
- if (common_types & GTK_SOURCE_SPACE_TYPE_NBSP)
- {
- flags |= GTK_SOURCE_DRAW_SPACES_NBSP;
- }
-
- return flags;
-}
-
-static GtkSourceSpaceLocationFlags
-get_locations_from_draw_spaces_flags (GtkSourceDrawSpacesFlags flags)
-{
- GtkSourceSpaceLocationFlags locations = GTK_SOURCE_SPACE_LOCATION_NONE;
-
- if (flags & GTK_SOURCE_DRAW_SPACES_LEADING)
- {
- locations |= GTK_SOURCE_SPACE_LOCATION_LEADING;
- }
- if (flags & GTK_SOURCE_DRAW_SPACES_TEXT)
- {
- locations |= GTK_SOURCE_SPACE_LOCATION_INSIDE_TEXT;
- }
- if (flags & GTK_SOURCE_DRAW_SPACES_TRAILING)
- {
- locations |= GTK_SOURCE_SPACE_LOCATION_TRAILING;
- }
-
- if (locations == GTK_SOURCE_SPACE_LOCATION_NONE)
- {
- locations = (GTK_SOURCE_SPACE_LOCATION_LEADING |
- GTK_SOURCE_SPACE_LOCATION_INSIDE_TEXT |
- GTK_SOURCE_SPACE_LOCATION_TRAILING);
- }
-
- return locations;
-}
-
-static GtkSourceSpaceTypeFlags
-get_space_types_from_draw_spaces_flags (GtkSourceDrawSpacesFlags flags)
-{
- GtkSourceSpaceTypeFlags types = GTK_SOURCE_SPACE_TYPE_NONE;
-
- if (flags & GTK_SOURCE_DRAW_SPACES_SPACE)
- {
- types |= GTK_SOURCE_SPACE_TYPE_SPACE;
- }
- if (flags & GTK_SOURCE_DRAW_SPACES_TAB)
- {
- types |= GTK_SOURCE_SPACE_TYPE_TAB;
- }
- if (flags & GTK_SOURCE_DRAW_SPACES_NEWLINE)
- {
- types |= GTK_SOURCE_SPACE_TYPE_NEWLINE;
- }
- if (flags & GTK_SOURCE_DRAW_SPACES_NBSP)
- {
- types |= GTK_SOURCE_SPACE_TYPE_NBSP;
- }
-
- return types;
-}
-
-void
-_gtk_source_space_drawer_set_flags (GtkSourceSpaceDrawer *drawer,
- GtkSourceDrawSpacesFlags flags)
-{
- GtkSourceSpaceLocationFlags locations;
- GtkSourceSpaceTypeFlags types;
-
- g_return_if_fail (GTK_SOURCE_IS_SPACE_DRAWER (drawer));
-
- gtk_source_space_drawer_set_types_for_locations (drawer,
- GTK_SOURCE_SPACE_LOCATION_ALL,
- GTK_SOURCE_SPACE_TYPE_NONE);
-
- locations = get_locations_from_draw_spaces_flags (flags);
- types = get_space_types_from_draw_spaces_flags (flags);
- gtk_source_space_drawer_set_types_for_locations (drawer, locations, types);
-
- gtk_source_space_drawer_set_enable_matrix (drawer, TRUE);
-}
-
/**
* gtk_source_space_drawer_get_types_for_locations:
* @drawer: a #GtkSourceSpaceDrawer.
diff --git a/gtksourceview/gtksourceview.c b/gtksourceview/gtksourceview.c
index 28ec45d..ed38321 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -157,7 +157,6 @@ enum
PROP_SMART_HOME_END,
PROP_HIGHLIGHT_CURRENT_LINE,
PROP_INDENT_ON_TAB,
- PROP_DRAW_SPACES,
PROP_BACKGROUND_PATTERN,
PROP_SMART_BACKSPACE,
PROP_SPACE_DRAWER
@@ -638,29 +637,6 @@ gtk_source_view_class_init (GtkSourceViewClass *klass)
G_PARAM_STATIC_STRINGS));
/**
- * GtkSourceView:draw-spaces:
- *
- * Set if and how the spaces should be visualized.
- *
- * For a finer-grained method, there is also the GtkSourceTag's
- * #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,
- g_param_spec_flags ("draw-spaces",
- "Draw Spaces",
- "Set if and how the spaces should be visualized",
- GTK_SOURCE_TYPE_DRAW_SPACES_FLAGS,
- 0,
- G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS |
- G_PARAM_DEPRECATED));
-
- /**
* GtkSourceView:background-pattern:
*
* Draw a specific background pattern on the view.
@@ -1163,12 +1139,6 @@ gtk_source_view_set_property (GObject *object,
gtk_source_view_set_indent_on_tab (view, g_value_get_boolean (value));
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:
gtk_source_view_set_background_pattern (view, g_value_get_enum (value));
break;
@@ -1245,12 +1215,6 @@ gtk_source_view_get_property (GObject *object,
g_value_set_boolean (value, gtk_source_view_get_indent_on_tab (view));
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:
g_value_set_enum (value, gtk_source_view_get_background_pattern (view));
break;
@@ -1275,7 +1239,6 @@ space_drawer_notify_cb (GtkSourceSpaceDrawer *space_drawer,
GtkSourceView *view)
{
gtk_widget_queue_draw (GTK_WIDGET (view));
- g_object_notify (G_OBJECT (view), "draw-spaces");
}
static void
@@ -4482,59 +4445,6 @@ gtk_source_view_get_smart_home_end (GtkSourceView *view)
}
/**
- * gtk_source_view_set_draw_spaces:
- * @view: a #GtkSourceView.
- * @flags: #GtkSourceDrawSpacesFlags specifing how white spaces should
- * be displayed
- *
- * Set if and how the spaces should be visualized. Specifying @flags as 0 will
- * disable display of spaces.
- *
- * 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,
- GtkSourceDrawSpacesFlags flags)
-{
- g_return_if_fail (GTK_SOURCE_IS_VIEW (view));
-
- if (view->priv->space_drawer == NULL)
- {
- return;
- }
-
- _gtk_source_space_drawer_set_flags (view->priv->space_drawer, flags);
-}
-
-/**
- * gtk_source_view_get_draw_spaces:
- * @view: a #GtkSourceView
- *
- * Returns the #GtkSourceDrawSpacesFlags specifying if and how spaces
- * 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)
-{
- g_return_val_if_fail (GTK_SOURCE_IS_VIEW (view), 0);
-
- if (view->priv->space_drawer == NULL)
- {
- return 0;
- }
-
- return _gtk_source_space_drawer_get_flags (view->priv->space_drawer);
-}
-
-/**
* gtk_source_view_get_visual_column:
* @view: a #GtkSourceView.
* @iter: a position in @view.
diff --git a/gtksourceview/gtksourceview.h b/gtksourceview/gtksourceview.h
index 628c14f..a89153b 100644
--- a/gtksourceview/gtksourceview.h
+++ b/gtksourceview/gtksourceview.h
@@ -81,41 +81,6 @@ typedef enum _GtkSourceSmartHomeEndType
} GtkSourceSmartHomeEndType;
/**
- * GtkSourceDrawSpacesFlags:
- * @GTK_SOURCE_DRAW_SPACES_SPACE: whether the space character should be drawn.
- * @GTK_SOURCE_DRAW_SPACES_TAB: whether the tab character should be drawn.
- * @GTK_SOURCE_DRAW_SPACES_NEWLINE: whether the line breaks should be drawn. If
- * the #GtkSourceBuffer:implicit-trailing-newline property is %TRUE, a line
- * break is also drawn at the end of the buffer.
- * @GTK_SOURCE_DRAW_SPACES_NBSP: whether the non-breaking whitespaces should be drawn.
- * @GTK_SOURCE_DRAW_SPACES_LEADING: whether leading whitespaces should be drawn.
- * @GTK_SOURCE_DRAW_SPACES_TEXT: whether whitespaces inside text should be drawn.
- * @GTK_SOURCE_DRAW_SPACES_TRAILING: whether trailing whitespaces should be drawn.
- * @GTK_SOURCE_DRAW_SPACES_ALL: wheter all kind of spaces should be drawn.
- *
- * GtkSourceDrawSpacesFlags determine what kind of spaces whould be drawn. If none
- * 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,
- GTK_SOURCE_DRAW_SPACES_TAB = 1 << 1,
- GTK_SOURCE_DRAW_SPACES_NEWLINE = 1 << 2,
- GTK_SOURCE_DRAW_SPACES_NBSP = 1 << 3,
- GTK_SOURCE_DRAW_SPACES_LEADING = 1 << 4,
- GTK_SOURCE_DRAW_SPACES_TEXT = 1 << 5,
- GTK_SOURCE_DRAW_SPACES_TRAILING = 1 << 6,
- GTK_SOURCE_DRAW_SPACES_ALL = 0x7f
-} GtkSourceDrawSpacesFlags;
-#endif
-
-/**
* GtkSourceBackgroundPatternType:
* @GTK_SOURCE_BACKGROUND_PATTERN_TYPE_NONE: no pattern
* @GTK_SOURCE_BACKGROUND_PATTERN_TYPE_GRID: grid pattern
@@ -277,14 +242,6 @@ GTK_SOURCE_AVAILABLE_IN_ALL
GtkSourceSmartHomeEndType
gtk_source_view_get_smart_home_end (GtkSourceView *view);
-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_DEPRECATED_IN_3_24_FOR (gtk_source_space_drawer_get_types_for_locations)
-GtkSourceDrawSpacesFlags
- gtk_source_view_get_draw_spaces (GtkSourceView *view);
-
GTK_SOURCE_AVAILABLE_IN_ALL
guint gtk_source_view_get_visual_column (GtkSourceView *view,
const GtkTextIter *iter);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]