[gtksourceview/wip/gutter: 3/3] Gutter: add get_view() and get_window_type() public functions
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/gutter: 3/3] Gutter: add get_view() and get_window_type() public functions
- Date: Fri, 21 Oct 2016 15:00:27 +0000 (UTC)
commit d5865825b7f242959a128a26c1544fe3f73a63d4
Author: Sébastien Wilmet <swilmet gnome org>
Date: Fri Oct 21 16:55:19 2016 +0200
Gutter: add get_view() and get_window_type() public functions
The Gutter class has already properties for the view and the window
type, but getters were missing. And since get_window() is deprecated and
will be removed, it's better to provide get_window_type().
docs/reference/gtksourceview-3.0-sections.txt | 2 +
gtksourceview/gtksourcegutter.c | 30 +++++++++++++++++++++++++
gtksourceview/gtksourcegutter.h | 8 ++++++
3 files changed, 40 insertions(+), 0 deletions(-)
---
diff --git a/docs/reference/gtksourceview-3.0-sections.txt b/docs/reference/gtksourceview-3.0-sections.txt
index b82c63f..087bf29 100644
--- a/docs/reference/gtksourceview-3.0-sections.txt
+++ b/docs/reference/gtksourceview-3.0-sections.txt
@@ -371,6 +371,8 @@ gtk_source_file_saver_flags_get_type
<FILE>gutter</FILE>
<TITLE>GtkSourceGutter</TITLE>
GtkSourceGutter
+gtk_source_gutter_get_view
+gtk_source_gutter_get_window_type
gtk_source_gutter_get_window
gtk_source_gutter_insert
gtk_source_gutter_reorder
diff --git a/gtksourceview/gtksourcegutter.c b/gtksourceview/gtksourcegutter.c
index b124daa..a5352d5 100644
--- a/gtksourceview/gtksourcegutter.c
+++ b/gtksourceview/gtksourcegutter.c
@@ -615,6 +615,36 @@ _gtk_source_gutter_new (GtkSourceView *view,
/* Public API */
/**
+ * gtk_source_gutter_get_view:
+ * @gutter: a #GtkSourceGutter.
+ *
+ * Returns: (transfer none): the associated #GtkSourceView.
+ * Since: 3.24
+ */
+GtkSourceView *
+gtk_source_gutter_get_view (GtkSourceGutter *gutter)
+{
+ g_return_val_if_fail (GTK_SOURCE_IS_GUTTER (gutter), NULL);
+
+ return gutter->priv->view;
+}
+
+/**
+ * gtk_source_gutter_get_window_type:
+ * @gutter: a #GtkSourceGutter.
+ *
+ * Returns: the #GtkTextWindowType of @gutter.
+ * Since: 3.24
+ */
+GtkTextWindowType
+gtk_source_gutter_get_window_type (GtkSourceGutter *gutter)
+{
+ g_return_val_if_fail (GTK_SOURCE_IS_GUTTER (gutter), GTK_TEXT_WINDOW_PRIVATE);
+
+ return gutter->priv->window_type;
+}
+
+/**
* gtk_source_gutter_get_window:
* @gutter: a #GtkSourceGutter.
*
diff --git a/gtksourceview/gtksourcegutter.h b/gtksourceview/gtksourcegutter.h
index 3c00f9e..8d7f5f0 100644
--- a/gtksourceview/gtksourcegutter.h
+++ b/gtksourceview/gtksourcegutter.h
@@ -60,6 +60,14 @@ struct _GtkSourceGutterClass
GTK_SOURCE_AVAILABLE_IN_ALL
GType gtk_source_gutter_get_type (void) G_GNUC_CONST;
+GTK_SOURCE_AVAILABLE_IN_3_24
+GtkSourceView *
+ gtk_source_gutter_get_view (GtkSourceGutter *gutter);
+
+GTK_SOURCE_AVAILABLE_IN_3_24
+GtkTextWindowType
+ gtk_source_gutter_get_window_type (GtkSourceGutter *gutter);
+
GTK_SOURCE_DEPRECATED_IN_3_10_FOR (gtk_text_view_get_window)
GdkWindow *gtk_source_gutter_get_window (GtkSourceGutter *gutter);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]