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.
This commit is contained in:
Matthias Clasen 2020-02-03 12:49:36 +01:00
parent e7f2833703
commit ef7172dc1e
5 changed files with 47 additions and 0 deletions

View File

@ -246,6 +246,7 @@
<xi:include href="xml/gtkfontbutton.xml" />
<xi:include href="xml/gtkfontchooserwidget.xml" />
<xi:include href="xml/gtkfontchooserdialog.xml" />
<xi:include href="xml/gtkemojichooser.xml" />
</chapter>
<chapter id="DrawingWidgets">

View File

@ -7147,3 +7147,20 @@ GTK_DRAG_ICON_GET_CLASS
<SUBSECTION Private>
gtk_drag_icon_get_type
</SECTION>
<SECTION>
<FILE>gtkemojichooser</FILE>
GtkEmojiChooser
gtk_emoji_chooser_new
<SUBSECTION Standard>
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
<SUBSECTION Private>
gtk_emoji_chooser_get_type
</SECTION>

View File

@ -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

View File

@ -95,6 +95,7 @@
#include <gtk/gtkdragsource.h>
#include <gtk/gtkdrawingarea.h>
#include <gtk/gtkeditable.h>
#include <gtk/gtkemojichooser.h>
#include <gtk/gtkentry.h>
#include <gtk/gtkentrybuffer.h>
#include <gtk/gtkentrycompletion.h>

View File

@ -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)
{