From ac8ee9a08cc06c133196e4109baf76658e839e15 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Thu, 21 Dec 2017 18:15:07 +0100 Subject: [PATCH] clutter: Add clutter_text_has_preedit() This function returns TRUE if there is any preedit going on. This method will be useful in gnome-shell where similar checks are performed on StIMText actors. --- clutter/clutter/clutter-text.c | 8 ++++++++ clutter/clutter/clutter-text.h | 3 +++ 2 files changed, 11 insertions(+) diff --git a/clutter/clutter/clutter-text.c b/clutter/clutter/clutter-text.c index 0f9878f2e..c0a18febd 100644 --- a/clutter/clutter/clutter-text.c +++ b/clutter/clutter/clutter-text.c @@ -6531,3 +6531,11 @@ clutter_text_get_input_purpose (ClutterText *self) return self->priv->input_purpose; } + +gboolean +clutter_text_has_preedit (ClutterText *self) +{ + g_return_val_if_fail (CLUTTER_IS_TEXT (self), FALSE); + + return self->priv->preedit_set; +} diff --git a/clutter/clutter/clutter-text.h b/clutter/clutter/clutter-text.h index 9660e653f..1b17fbe03 100644 --- a/clutter/clutter/clutter-text.h +++ b/clutter/clutter/clutter-text.h @@ -313,6 +313,9 @@ ClutterInputContentHintFlags clutter_text_get_input_hints (ClutterText *self); CLUTTER_AVAILABLE_IN_MUTTER ClutterInputContentPurpose clutter_text_get_input_purpose (ClutterText *self); +CLUTTER_AVAILABLE_IN_MUTTER +gboolean clutter_text_has_preedit (ClutterText *self); + G_END_DECLS #endif /* __CLUTTER_TEXT_H__ */