From: Matthias Clasen Date: Mon, 3 Feb 2020 11:49:36 +0000 (+0100) Subject: emojichooser: Make public X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1^2~18^2~20^2~91^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=ef7172dc1ee86acb5ed686d16cea6c8bc3cad63a;p=gtk4.git emojichooser: Make public This is a useful widget to have, and it has minimal api. Not having it public forces apps to recreate a lot of complicated machinery for not good reason, if they need an Emoji chooser in a different context. --- diff --git a/docs/reference/gtk/gtk4-docs.xml b/docs/reference/gtk/gtk4-docs.xml index a85bbd80e4..b2afad8d64 100644 --- a/docs/reference/gtk/gtk4-docs.xml +++ b/docs/reference/gtk/gtk4-docs.xml @@ -246,6 +246,7 @@ + diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt index 723e620a6e..445f0c287a 100644 --- a/docs/reference/gtk/gtk4-sections.txt +++ b/docs/reference/gtk/gtk4-sections.txt @@ -7147,3 +7147,20 @@ GTK_DRAG_ICON_GET_CLASS gtk_drag_icon_get_type + +
+gtkemojichooser +GtkEmojiChooser +gtk_emoji_chooser_new + + +GTK_TYPE_EMOJI_CHOOSER +GTK_EMOJI_CHOOSER +GTK_EMOJI_CHOOSER_CLASS +GTK_IS_EMOJI_CHOOSER +GTK_IS_EMOJI_CHOOSER_CLASS +GTK_EMOJI_CHOOSER_GET_CLASS + + +gtk_emoji_chooser_get_type +
diff --git a/docs/reference/gtk/gtk4.types.in b/docs/reference/gtk/gtk4.types.in index 60d8712f97..19f4569d5b 100644 --- a/docs/reference/gtk/gtk4.types.in +++ b/docs/reference/gtk/gtk4.types.in @@ -62,6 +62,7 @@ gtk_drag_source_get_type gtk_drawing_area_get_type gtk_drop_target_get_type gtk_editable_get_type +gtk_emoji_chooser_get_type gtk_entry_buffer_get_type gtk_entry_completion_get_type gtk_entry_get_type diff --git a/gtk/gtk.h b/gtk/gtk.h index 8205a19622..53bf22169b 100644 --- a/gtk/gtk.h +++ b/gtk/gtk.h @@ -95,6 +95,7 @@ #include #include #include +#include #include #include #include diff --git a/gtk/gtkemojichooser.c b/gtk/gtkemojichooser.c index 9865ce8aeb..9703fb91a5 100644 --- a/gtk/gtkemojichooser.c +++ b/gtk/gtkemojichooser.c @@ -36,6 +36,18 @@ #include "gtkstylecontext.h" #include "gtktext.h" +/** + * SECTION:emojichooser + * @Title: GtkEmojiChooser + * @Short_description: A popover to choose an Emoji character + * + * The #GtkEmojiChooser popover is used by text widgets such as #GtkEntry or + * #GtkTextView to offer users a convenient way to insert Emoji characters. + * + * GtkEmojiChooser emits the #GtkEmojiChooser:emoji-picked signal when an + * Emoji is selected. + */ + #define BOX_SPACE 6 typedef struct { @@ -711,6 +723,14 @@ gtk_emoji_chooser_class_init (GtkEmojiChooserClass *klass) object_class->finalize = gtk_emoji_chooser_finalize; widget_class->show = gtk_emoji_chooser_show; + /** + * GtkEmojiChooser::emoji-picked: + * @chooser: the #GtkEmojiChooser + * @text: the Unicode sequence for the picked Emoji, in UTF-8 + * + * The ::emoji-picked signal is emitted when the user selects an + * Emoji. + */ signals[EMOJI_PICKED] = g_signal_new ("emoji-picked", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -771,6 +791,13 @@ gtk_emoji_chooser_class_init (GtkEmojiChooserClass *klass) gtk_widget_class_bind_template_callback (widget_class, long_pressed_cb); } +/** + * gtk_emoji_chooser_new: + * + * Creates a new #GtkEmojiChooser. + * + * Returns: a new #GtkEmojiChoser + */ GtkWidget * gtk_emoji_chooser_new (void) {