From 3918dd4643fe184669ce474807dc25652da5a807 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 19 Oct 2020 12:36:54 -0400 Subject: Add gtk_editable_get_delegate We need access to the delegate in the a11y layer, so we might as well make this function public. --- docs/reference/gtk/gtk4-sections.txt | 1 + gtk/gtkeditable.c | 15 +++++++++++++++ gtk/gtkeditable.h | 2 ++ 3 files changed, 18 insertions(+) diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt index bf33adde32..a0e123947b 100644 --- a/docs/reference/gtk/gtk4-sections.txt +++ b/docs/reference/gtk/gtk4-sections.txt @@ -971,6 +971,7 @@ gtk_editable_get_enable_undo gtk_editable_set_enable_undo gtk_editable_install_properties +gtk_editable_get_delegate gtk_editable_init_delegate gtk_editable_finish_delegate gtk_editable_delegate_set_property diff --git a/gtk/gtkeditable.c b/gtk/gtkeditable.c index af0325f80f..eae161c542 100644 --- a/gtk/gtkeditable.c +++ b/gtk/gtkeditable.c @@ -941,6 +941,21 @@ delegate_notify (GObject *object, g_object_notify (data, pspec->name); } +/** + * gtk_editable_get_delegate: + * @editable: a #GtkEditable + * + * Gets the #GtkEditable that @editable is delegating its + * implementation to. Typically, the delegate is a #GtkText widget. + * + * Returns: (nullable) (transfer none): the delegate #GtkEditable + */ +GtkEditable * +gtk_editable_get_delegate (GtkEditable *editable) +{ + return get_delegate (editable); +} + /** * gtk_editable_init_delegate: * @editable: a #GtkEditable diff --git a/gtk/gtkeditable.h b/gtk/gtkeditable.h index 2e3f886f56..4ca68e44a7 100644 --- a/gtk/gtkeditable.h +++ b/gtk/gtkeditable.h @@ -162,6 +162,8 @@ GDK_AVAILABLE_IN_ALL guint gtk_editable_install_properties (GObjectClass *object_class, guint first_prop); GDK_AVAILABLE_IN_ALL +GtkEditable *gtk_editable_get_delegate (GtkEditable *editable); +GDK_AVAILABLE_IN_ALL void gtk_editable_init_delegate (GtkEditable *editable); GDK_AVAILABLE_IN_ALL void gtk_editable_finish_delegate (GtkEditable *editable); -- cgit v1.2.1