[gtkmm/use-dllexport: 9/60] Add Gtk::EmojiChooser



commit a4f3f37c30bca1c5eafc01da665bd26a08ae746f
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Wed Feb 12 16:26:17 2020 +0100

    Add Gtk::EmojiChooser

 .gitignore                                |  2 ++
 gtk/gtkmm.h                               |  1 +
 gtk/src/emojichooser.ccg                  | 17 +++++++++++
 gtk/src/emojichooser.hg                   | 51 +++++++++++++++++++++++++++++++
 gtk/src/filelist.am                       |  1 +
 gtk/src/gtk_signals.defs                  | 11 +++++++
 tools/extra_defs_gen/generate_defs_gtk.cc |  1 +
 7 files changed, 84 insertions(+)
---
diff --git a/.gitignore b/.gitignore
index a239eff1..7c4359d5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -248,6 +248,8 @@ gtk/gtkmm/droptarget.cc
 gtk/gtkmm/droptarget.h
 gtk/gtkmm/editable.cc
 gtk/gtkmm/editable.h
+gtk/gtkmm/emojichooser.cc
+gtk/gtkmm/emojichooser.h
 gtk/gtkmm/entry.cc
 gtk/gtkmm/entry.h
 gtk/gtkmm/entrybuffer.cc
diff --git a/gtk/gtkmm.h b/gtk/gtkmm.h
index fce28749..24d4f363 100644
--- a/gtk/gtkmm.h
+++ b/gtk/gtkmm.h
@@ -141,6 +141,7 @@ extern const int gtkmm_micro_version;
 #include <gtkmm/drawingarea.h>
 #include <gtkmm/droptarget.h>
 #include <gtkmm/editable.h>
+#include <gtkmm/emojichooser.h>
 #include <gtkmm/entry.h>
 #include <gtkmm/expander.h>
 #include <gtkmm/enums.h>
diff --git a/gtk/src/emojichooser.ccg b/gtk/src/emojichooser.ccg
new file mode 100644
index 00000000..57b87fdc
--- /dev/null
+++ b/gtk/src/emojichooser.ccg
@@ -0,0 +1,17 @@
+/* Copyright (C) 2020 The gtkmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <gtk/gtk.h>
diff --git a/gtk/src/emojichooser.hg b/gtk/src/emojichooser.hg
new file mode 100644
index 00000000..659e176b
--- /dev/null
+++ b/gtk/src/emojichooser.hg
@@ -0,0 +1,51 @@
+/* Copyright (C) 2020 The gtkmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <gtkmm/popover.h>
+
+_DEFS(gtkmm,gtk)
+_PINCLUDE(gtkmm/private/popover_p.h)
+
+namespace Gtk
+{
+
+/** A popover to choose an Emoji character.
+ *
+ * The %Gtk::EmojiChooser popover is used by text widgets such as Gtk::Entry or
+ * Gtk::TextView to offer users a convenient way to insert Emoji characters.
+ *
+ * %Gtk::EmojiChooser emits signal_emoji_picked() when an Emoji is selected.
+ *
+ * @newin{3,96}
+ *
+ * @ingroup Widgets
+ * @ingroup Containers
+ */
+class EmojiChooser : public Popover
+{
+  _CLASS_GTKOBJECT(EmojiChooser, GtkEmojiChooser, GTK_EMOJI_CHOOSER, Gtk::Popover, GtkPopover)
+
+public:
+
+  _CTOR_DEFAULT
+
+  // no_default_handler because the wrapped C signal has no default handler.
+  _WRAP_SIGNAL(void emoji_picked(const Glib::ustring& text), "emoji-picked", no_default_handler)
+
+  // PopoverMenu has no properties nor vfuncs.
+};
+
+} //namespace Gtk
diff --git a/gtk/src/filelist.am b/gtk/src/filelist.am
index eaf3b067..efbd1fd6 100644
--- a/gtk/src/filelist.am
+++ b/gtk/src/filelist.am
@@ -71,6 +71,7 @@ gtkmm_files_any_hg =          \
        drawingarea.hg \
        droptarget.hg \
        editable.hg             \
+       emojichooser.hg \
        entry.hg                \
        entrycompletion.hg      \
        entrybuffer.hg          \
diff --git a/gtk/src/gtk_signals.defs b/gtk/src/gtk_signals.defs
index f82b046c..9430c9ae 100644
--- a/gtk/src/gtk_signals.defs
+++ b/gtk/src/gtk_signals.defs
@@ -2990,6 +2990,17 @@
   (default-value "0")
 )
 
+;; From GtkEmojiChooser
+
+(define-signal emoji-picked
+  (of-object "GtkEmojiChooser")
+  (return-type "void")
+  (flags "Run Last")
+  (parameters
+    '("const-gchar*" "p0")
+  )
+)
+
 ;; From GtkEntry
 
 (define-signal activate
diff --git a/tools/extra_defs_gen/generate_defs_gtk.cc b/tools/extra_defs_gen/generate_defs_gtk.cc
index fe79f28d..a2a7ec2d 100644
--- a/tools/extra_defs_gen/generate_defs_gtk.cc
+++ b/tools/extra_defs_gen/generate_defs_gtk.cc
@@ -94,6 +94,7 @@ int main(int /* argc */, char** /* argv */)
             << get_defs( GTK_TYPE_DRAWING_AREA )
             << get_defs( GTK_TYPE_DROP_TARGET )
             << get_defs( GTK_TYPE_EDITABLE )
+            << get_defs( GTK_TYPE_EMOJI_CHOOSER )
             << get_defs( GTK_TYPE_ENTRY )
             << get_defs( GTK_TYPE_ENTRY_COMPLETION )
             << get_defs( GTK_TYPE_ENTRY_BUFFER )


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]