[gtksourceview/wip/new-space-drawing-api: 1/2] view: add get_space_drawer() and space-drawer property
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/new-space-drawing-api: 1/2] view: add get_space_drawer() and space-drawer property
- Date: Fri, 23 Sep 2016 18:01:44 +0000 (UTC)
commit a54185246294386fff2ca29c8e6d6e55e241b492
Author: Sébastien Wilmet <swilmet gnome org>
Date: Fri Sep 23 19:54:53 2016 +0200
view: add get_space_drawer() and space-drawer property
Like for GtkSourceCompletion.
docs/reference/gtksourceview-3.0-sections.txt | 1 +
gtksourceview/gtksourceview.c | 40 ++++++++++++++++++++++++-
gtksourceview/gtksourceview.h | 4 ++
3 files changed, 44 insertions(+), 1 deletions(-)
---
diff --git a/docs/reference/gtksourceview-3.0-sections.txt b/docs/reference/gtksourceview-3.0-sections.txt
index d0c6101..3888e2a 100644
--- a/docs/reference/gtksourceview-3.0-sections.txt
+++ b/docs/reference/gtksourceview-3.0-sections.txt
@@ -979,6 +979,7 @@ gtk_source_view_set_draw_spaces
gtk_source_view_get_draw_spaces
gtk_source_view_get_completion
gtk_source_view_get_gutter
+gtk_source_view_get_space_drawer
gtk_source_view_set_background_pattern
gtk_source_view_get_background_pattern
<SUBSECTION Standard>
diff --git a/gtksourceview/gtksourceview.c b/gtksourceview/gtksourceview.c
index 45840c9..b17512b 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -50,6 +50,7 @@
#include "gtksourcegutterrenderermarks.h"
#include "gtksourceiter.h"
#include "gtksourcesearchcontext.h"
+#include "gtksourcespacedrawer.h"
#include "gtksourcespacedrawer-private.h"
/**
@@ -159,7 +160,8 @@ enum
PROP_INDENT_ON_TAB,
PROP_DRAW_SPACES,
PROP_BACKGROUND_PATTERN,
- PROP_SMART_BACKSPACE
+ PROP_SMART_BACKSPACE,
+ PROP_SPACE_DRAWER
};
struct _GtkSourceViewPrivate
@@ -689,6 +691,22 @@ gtk_source_view_class_init (GtkSourceViewClass *klass)
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
+ /**
+ * GtkSourceView:space-drawer:
+ *
+ * The #GtkSourceSpaceDrawer object associated with the view.
+ *
+ * Since: 3.24
+ */
+ g_object_class_install_property (object_class,
+ PROP_SPACE_DRAWER,
+ g_param_spec_object ("space-drawer",
+ "Space Drawer",
+ "",
+ GTK_SOURCE_TYPE_SPACE_DRAWER,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS));
+
signals[UNDO] =
g_signal_new ("undo",
G_TYPE_FROM_CLASS (klass),
@@ -1235,6 +1253,10 @@ gtk_source_view_get_property (GObject *object,
g_value_set_boolean (value, gtk_source_view_get_smart_backspace (view));
break;
+ case PROP_SPACE_DRAWER:
+ g_value_set_object (value, gtk_source_view_get_space_drawer (view));
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -4901,3 +4923,19 @@ gtk_source_view_get_background_pattern (GtkSourceView *view)
return view->priv->background_pattern;
}
+
+/**
+ * gtk_source_view_get_space_drawer:
+ * @view: a #GtkSourceView.
+ *
+ * Returns: (type GtkSource.SpaceDrawer) (transfer none) (nullable): the
+ * #GtkSourceSpaceDrawer associated with @view.
+ * Since: 3.24
+ */
+GtkSourceSpaceDrawer *
+gtk_source_view_get_space_drawer (GtkSourceView *view)
+{
+ g_return_val_if_fail (GTK_SOURCE_IS_VIEW (view), NULL);
+
+ return view->priv->space_drawer;
+}
diff --git a/gtksourceview/gtksourceview.h b/gtksourceview/gtksourceview.h
index 55265ec..1c3413d 100644
--- a/gtksourceview/gtksourceview.h
+++ b/gtksourceview/gtksourceview.h
@@ -300,6 +300,10 @@ GTK_SOURCE_AVAILABLE_IN_3_16
GtkSourceBackgroundPatternType
gtk_source_view_get_background_pattern (GtkSourceView *view);
+GTK_SOURCE_AVAILABLE_IN_3_24
+GtkSourceSpaceDrawer *
+ gtk_source_view_get_space_drawer (GtkSourceView *view);
+
G_END_DECLS
#endif /* end of GTK_SOURCE_VIEW_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]