[gtkmm: 1/5] Add Gtk::DropDown



commit 2ef5dd9361106c60c972c4fb6f8c84106bc76cc2
Author: Andreas Persson <andreasp56 outlook com>
Date:   Wed Jul 15 10:45:02 2020 +0200

    Add Gtk::DropDown
    
    Add partial binding for Gtk::DropDown, including ListItem,
    ListItemFactory, SignalListItemFactory and StringList.
    
    Gtk::Expression binding is not done. Class documentation is also left to do.

 .gitignore                                |  10 +++
 gtk/gtkmm.h                               |   3 +
 gtk/gtkmm/meson.build                     |   5 ++
 gtk/src/dropdown.ccg                      |  17 +++++
 gtk/src/dropdown.hg                       |  67 +++++++++++++++++
 gtk/src/filelist.am                       |   5 ++
 gtk/src/gtk_extra_objects.defs            |  14 +++-
 gtk/src/gtk_signals.defs                  | 117 ++++++++++++++++++++++++++++++
 gtk/src/listitem.ccg                      |  17 +++++
 gtk/src/listitem.hg                       |  43 +++++++++++
 gtk/src/listitemfactory.ccg               |  17 +++++
 gtk/src/listitemfactory.hg                |  31 ++++++++
 gtk/src/signallistitemfactory.ccg         |  17 +++++
 gtk/src/signallistitemfactory.hg          |  42 +++++++++++
 gtk/src/stringlist.ccg                    |  30 ++++++++
 gtk/src/stringlist.hg                     |  59 +++++++++++++++
 tools/extra_defs_gen/generate_defs_gtk.cc |   3 +
 tools/m4/convert_gtk.m4                   |   3 +
 18 files changed, 499 insertions(+), 1 deletion(-)
---
diff --git a/.gitignore b/.gitignore
index c5ff44c22..0e25c57ff 100644
--- a/.gitignore
+++ b/.gitignore
@@ -257,6 +257,8 @@ gtk/gtkmm/drawingarea.cc
 gtk/gtkmm/drawingarea.h
 gtk/gtkmm/dropcontrollermotion.cc
 gtk/gtkmm/dropcontrollermotion.h
+gtk/gtkmm/dropdown.cc
+gtk/gtkmm/dropdown.h
 gtk/gtkmm/droptarget.cc
 gtk/gtkmm/droptarget.h
 gtk/gtkmm/droptargetasync.cc
@@ -369,6 +371,10 @@ gtk/gtkmm/listbox.cc
 gtk/gtkmm/listbox.h
 gtk/gtkmm/listboxrow.cc
 gtk/gtkmm/listboxrow.h
+gtk/gtkmm/listitem.cc
+gtk/gtkmm/listitem.h
+gtk/gtkmm/listitemfactory.cc
+gtk/gtkmm/listitemfactory.h
 gtk/gtkmm/liststore.cc
 gtk/gtkmm/liststore.h
 gtk/gtkmm/lockbutton.cc
@@ -489,6 +495,8 @@ gtk/gtkmm/shortcutsshortcut.cc
 gtk/gtkmm/shortcutsshortcut.h
 gtk/gtkmm/shortcutswindow.cc
 gtk/gtkmm/shortcutswindow.h
+gtk/gtkmm/signallistitemfactory.cc
+gtk/gtkmm/signallistitemfactory.h
 gtk/gtkmm/singleselection.cc
 gtk/gtkmm/singleselection.h
 gtk/gtkmm/sizegroup.cc
@@ -509,6 +517,8 @@ gtk/gtkmm/stackswitcher.cc
 gtk/gtkmm/stackswitcher.h
 gtk/gtkmm/statusbar.cc
 gtk/gtkmm/statusbar.h
+gtk/gtkmm/stringlist.cc
+gtk/gtkmm/stringlist.h
 gtk/gtkmm/stylecontext.cc
 gtk/gtkmm/stylecontext.h
 gtk/gtkmm/styleprovider.cc
diff --git a/gtk/gtkmm.h b/gtk/gtkmm.h
index e2bacf564..edae1a088 100644
--- a/gtk/gtkmm.h
+++ b/gtk/gtkmm.h
@@ -138,6 +138,7 @@ extern const int gtkmm_micro_version;
 #include <gtkmm/dragsource.h>
 #include <gtkmm/drawingarea.h>
 #include <gtkmm/dropcontrollermotion.h>
+#include <gtkmm/dropdown.h>
 #include <gtkmm/droptarget.h>
 #include <gtkmm/droptargetasync.h>
 #include <gtkmm/editablelabel.h>
@@ -245,6 +246,7 @@ extern const int gtkmm_micro_version;
 #include <gtkmm/shortcutssection.h>
 #include <gtkmm/shortcutsshortcut.h>
 #include <gtkmm/shortcutswindow.h>
+#include <gtkmm/signallistitemfactory.h>
 #include <gtkmm/singleselection.h>
 #include <gtkmm/sizegroup.h>
 #include <gtkmm/snapshot.h>
@@ -254,6 +256,7 @@ extern const int gtkmm_micro_version;
 #include <gtkmm/stacksidebar.h>
 #include <gtkmm/stackswitcher.h>
 #include <gtkmm/statusbar.h>
+#include <gtkmm/stringlist.h>
 #include <gtkmm/stylecontext.h>
 #include <gtkmm/switch.h>
 #include <gtkmm/text.h>
diff --git a/gtk/gtkmm/meson.build b/gtk/gtkmm/meson.build
index 1b8a5a5b8..dfc45828f 100644
--- a/gtk/gtkmm/meson.build
+++ b/gtk/gtkmm/meson.build
@@ -86,6 +86,7 @@ gtkmm_any_hg_ccg_basenames = [
   'dragsource',
   'drawingarea',
   'dropcontrollermotion',
+  'dropdown',
   'droptarget',
   'droptargetasync',
   'editable',
@@ -142,6 +143,8 @@ gtkmm_any_hg_ccg_basenames = [
   'linkbutton',
   'listbox',
   'listboxrow',
+  'listitem',
+  'listitemfactory',
   'liststore',
   'lockbutton',
   'mediacontrols',
@@ -189,6 +192,7 @@ gtkmm_any_hg_ccg_basenames = [
   'selectionmodel',
   'separator',
   'settings',
+  'signallistitemfactory',
   'shortcutcontroller',
   'shortcutlabel',
   'shortcutmanager',
@@ -206,6 +210,7 @@ gtkmm_any_hg_ccg_basenames = [
   'stacksidebar',
   'stackswitcher',
   'statusbar',
+  'stringlist',
   'stylecontext',
   'styleprovider',
   'switch',
diff --git a/gtk/src/dropdown.ccg b/gtk/src/dropdown.ccg
new file mode 100644
index 000000000..57b87fdcf
--- /dev/null
+++ b/gtk/src/dropdown.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/dropdown.hg b/gtk/src/dropdown.hg
new file mode 100644
index 000000000..f87e8865c
--- /dev/null
+++ b/gtk/src/dropdown.hg
@@ -0,0 +1,67 @@
+/* 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 <giomm/listmodel.h>
+#include <gtkmm/listitemfactory.h>
+#include <gtkmm/widget.h>
+
+_DEFS(gtkmm,gtk)
+_PINCLUDE(gtkmm/private/widget_p.h)
+
+namespace Gtk
+{
+class GTKMM_API DropDown : public Widget
+{
+  _CLASS_GTKOBJECT(DropDown, GtkDropDown, GTK_DROP_DOWN, Gtk::Widget, GtkWidget, , , GTKMM_API)
+  _STRUCT_NOT_HIDDEN
+
+public:
+  _CTOR_DEFAULT
+
+#m4 _CONVERSION(`const std::vector<Glib::ustring>&',`const 
char*-const*',`Glib::ArrayHandler<Glib::ustring>::vector_to_array($3).data()')
+  _WRAP_METHOD(void set_from_strings(const std::vector<Glib::ustring>& strings), 
gtk_drop_down_set_from_strings)
+
+  _WRAP_METHOD(void set_model(const Glib::RefPtr<Gio::ListModel>& model), gtk_drop_down_set_model)
+  _WRAP_METHOD(Glib::RefPtr<Gio::ListModel> get_model(), gtk_drop_down_get_model, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Gio::ListModel> get_model() const, gtk_drop_down_get_model, refreturn, 
constversion)
+  _WRAP_METHOD(void set_selected(guint position), gtk_drop_down_set_selected)
+  _WRAP_METHOD(guint get_selected() const, gtk_drop_down_get_selected)
+
+#m4 _CONVERSION(`gpointer',`Glib::RefPtr<Glib::ObjectBase>',`Glib::wrap(G_OBJECT($3))')
+  _WRAP_METHOD(Glib::RefPtr<Glib::ObjectBase> get_selected_item(),
+    gtk_drop_down_get_selected_item, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Glib::ObjectBase> get_selected_item() const,
+    gtk_drop_down_get_selected_item, refreturn, constversion)
+
+  _WRAP_METHOD(void set_factory(const Glib::RefPtr<ListItemFactory>& factory), gtk_drop_down_set_factory)
+  _WRAP_METHOD(Glib::RefPtr<ListItemFactory> get_factory(), gtk_drop_down_get_factory, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const ListItemFactory> get_factory() const, gtk_drop_down_get_factory, 
refreturn, constversion)
+  _WRAP_METHOD(void set_list_factory(const Glib::RefPtr<ListItemFactory>& factory), 
gtk_drop_down_set_list_factory, constversion)
+  _WRAP_METHOD(Glib::RefPtr<ListItemFactory> get_list_factory(), gtk_drop_down_get_list_factory, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const ListItemFactory> get_list_factory() const, gtk_drop_down_get_list_factory, 
refreturn, constversion)
+
+  _WRAP_METHOD(void set_enable_search(bool enable_search = true), gtk_drop_down_set_enable_search)
+  _WRAP_METHOD(bool get_enable_search() const, gtk_drop_down_get_enable_search)
+
+  _WRAP_PROPERTY("factory", Glib::RefPtr<ListItemFactory>)
+  _WRAP_PROPERTY("list-factory", Glib::RefPtr<ListItemFactory>)
+  _WRAP_PROPERTY("model", Glib::RefPtr<Gio::ListModel>)
+  _WRAP_PROPERTY("selected", guint)
+  _WRAP_PROPERTY("selected-item", Glib::RefPtr<Glib::ObjectBase>)
+  _WRAP_PROPERTY("enable-search", bool)
+};
+
+} // namespace Gtk
diff --git a/gtk/src/filelist.am b/gtk/src/filelist.am
index c0114a6bf..d08ef3c9f 100644
--- a/gtk/src/filelist.am
+++ b/gtk/src/filelist.am
@@ -71,6 +71,7 @@ gtkmm_files_any_hg =          \
        dragsource.hg \
        drawingarea.hg \
        dropcontrollermotion.hg \
+       dropdown.hg \
        droptarget.hg \
        droptargetasync.hg \
        editable.hg             \
@@ -127,6 +128,8 @@ gtkmm_files_any_hg =                \
        linkbutton.hg           \
        listbox.hg \
        listboxrow.hg \
+       listitem.hg \
+       listitemfactory.hg \
        liststore.hg            \
        lockbutton.hg           \
        mediacontrols.hg \
@@ -181,6 +184,7 @@ gtkmm_files_any_hg =                \
        shortcutssection.hg             \
        shortcutsshortcut.hg            \
        shortcutswindow.hg              \
+       signallistitemfactory.hg \
        singleselection.hg \
        sizegroup.hg            \
        snapshot.hg             \
@@ -191,6 +195,7 @@ gtkmm_files_any_hg =                \
        stacksidebar.hg         \
        stackswitcher.hg        \
        statusbar.hg            \
+       stringlist.hg \
        stylecontext.hg         \
        styleprovider.hg        \
        switch.hg               \
diff --git a/gtk/src/gtk_extra_objects.defs b/gtk/src/gtk_extra_objects.defs
index 8e1716fa7..1531af62d 100644
--- a/gtk/src/gtk_extra_objects.defs
+++ b/gtk/src/gtk_extra_objects.defs
@@ -286,7 +286,7 @@
   (gtype-id "GTK_TYPE_LABEL")
 )
 
-(define-object LeveƶBar
+(define-object LevelBar
   (in-module "Gtk")
   (c-name "GtkLevelBar")
   (gtype-id "GTK_TYPE_LEVEL_BAR")
@@ -304,6 +304,12 @@
   (gtype-id "GTK_TYPE_LIST_BOX")
 )
 
+(define-object ListItem
+  (in-module "Gtk")
+  (c-name "GtkListItem")
+  (gtype-id "GTK_TYPE_LIST_ITEM")
+)
+
 (define-object MediaFile
   (in-module "Gtk")
   (c-name "GtkMediaFile")
@@ -514,6 +520,12 @@
   (gtype-id "GTK_TYPE_STACK_SWITCHER")
 )
 
+(define-object StringList
+  (in-module "Gtk")
+  (c-name "GtkStringList")
+  (gtype-id "GTK_TYPE_STRING_LIST")
+)
+
 (define-object Switch
   (in-module "Gtk")
   (c-name "GtkSwitch")
diff --git a/gtk/src/gtk_signals.defs b/gtk/src/gtk_signals.defs
index 08b811a18..f0ed01286 100644
--- a/gtk/src/gtk_signals.defs
+++ b/gtk/src/gtk_signals.defs
@@ -2831,6 +2831,73 @@
   (default-value "FALSE")
 )
 
+;; From GtkDropDown
+
+(define-property factory
+  (of-object "GtkDropDown")
+  (prop-type "GParamObject")
+  (docs "Factory for populating list items")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property list-factory
+  (of-object "GtkDropDown")
+  (prop-type "GParamObject")
+  (docs "Factory for populating list items")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property model
+  (of-object "GtkDropDown")
+  (prop-type "GParamObject")
+  (docs "Model for the displayed items")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property selected
+  (of-object "GtkDropDown")
+  (prop-type "GParamUInt")
+  (docs "Position of the selected item")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+  (default-value "4294967295")
+)
+
+(define-property selected-item
+  (of-object "GtkDropDown")
+  (prop-type "GParamObject")
+  (docs "The selected item")
+  (readable #t)
+  (writable #f)
+  (construct-only #f)
+)
+
+(define-property enable-search
+  (of-object "GtkDropDown")
+  (prop-type "GParamBoolean")
+  (docs "Whether to show a search entry in the popup")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+  (default-value "FALSE")
+)
+
+(define-property expression
+  (of-object "GtkDropDown")
+  (prop-type "GtkParamSpecExpression")
+  (docs "Expression to determine strings to search for")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
 ;; From GtkDropTarget
 
 (define-signal drop
@@ -9245,6 +9312,44 @@
   (default-value "")
 )
 
+;; From GtkSignalListItemFactory
+
+(define-signal setup
+  (of-object "GtkSignalListItemFactory")
+  (return-type "void")
+  (flags "Run First")
+  (parameters
+    '("GtkListItem*" "p0")
+  )
+)
+
+(define-signal bind
+  (of-object "GtkSignalListItemFactory")
+  (return-type "void")
+  (flags "Run First")
+  (parameters
+    '("GtkListItem*" "p0")
+  )
+)
+
+(define-signal unbind
+  (of-object "GtkSignalListItemFactory")
+  (return-type "void")
+  (flags "Run First")
+  (parameters
+    '("GtkListItem*" "p0")
+  )
+)
+
+(define-signal teardown
+  (of-object "GtkSignalListItemFactory")
+  (return-type "void")
+  (flags "Run First")
+  (parameters
+    '("GtkListItem*" "p0")
+  )
+)
+
 ;; From GtkSingleSelection
 
 (define-property autoselect
@@ -9641,6 +9746,18 @@
   )
 )
 
+;; From GtkStringObject
+
+(define-property string
+  (of-object "GtkStringObject")
+  (prop-type "GParamString")
+  (docs "String")
+  (readable #t)
+  (writable #f)
+  (construct-only #f)
+  (default-value "")
+)
+
 ;; From GtkStyleContext
 
 (define-property display
diff --git a/gtk/src/listitem.ccg b/gtk/src/listitem.ccg
new file mode 100644
index 000000000..57b87fdcf
--- /dev/null
+++ b/gtk/src/listitem.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/listitem.hg b/gtk/src/listitem.hg
new file mode 100644
index 000000000..3d49a1860
--- /dev/null
+++ b/gtk/src/listitem.hg
@@ -0,0 +1,43 @@
+/* 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/widget.h>
+
+_DEFS(gtkmm,gtk)
+_PINCLUDE(glibmm/private/object_p.h)
+
+namespace Gtk
+{
+class GTKMM_API ListItem : public Glib::Object
+{
+  _CLASS_GOBJECT(ListItem, GtkListItem, GTK_LIST_ITEM, Glib::Object, GObject, , , GTKMM_API)
+
+public:
+#m4 _CONVERSION(`gpointer',`Glib::RefPtr<Glib::ObjectBase>',`Glib::wrap(G_OBJECT($3))')
+  _WRAP_METHOD(Glib::RefPtr<Glib::ObjectBase> get_item(), gtk_list_item_get_item, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Glib::ObjectBase> get_item() const, gtk_list_item_get_item, refreturn, 
constversion)
+  _WRAP_METHOD(guint get_position() const, gtk_list_item_get_position)
+  _WRAP_METHOD(bool get_selected() const, gtk_list_item_get_selected)
+  _WRAP_METHOD(bool get_selectable() const, gtk_list_item_get_selectable)
+  _WRAP_METHOD(void set_selectable(bool selectable = true), gtk_list_item_set_selectable)
+  _WRAP_METHOD(bool get_activatable() const, gtk_list_item_get_activatable)
+  _WRAP_METHOD(void set_activatable(bool activatable = true), gtk_list_item_set_activatable)
+  _WRAP_METHOD(void set_child(Widget& child), gtk_list_item_set_child)
+  _WRAP_METHOD(Widget* get_child(), gtk_list_item_get_child)
+  _WRAP_METHOD(const Widget* get_child() const, gtk_list_item_get_child, constversion)
+};
+
+} // namespace Gtk
diff --git a/gtk/src/listitemfactory.ccg b/gtk/src/listitemfactory.ccg
new file mode 100644
index 000000000..57b87fdcf
--- /dev/null
+++ b/gtk/src/listitemfactory.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/listitemfactory.hg b/gtk/src/listitemfactory.hg
new file mode 100644
index 000000000..2125efeeb
--- /dev/null
+++ b/gtk/src/listitemfactory.hg
@@ -0,0 +1,31 @@
+/* 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/>.
+ */
+
+_CONFIGINCLUDE(gtkmmconfig.h)
+
+#include <glibmm/object.h>
+
+_DEFS(gtkmm,gtk)
+_PINCLUDE(glibmm/private/object_p.h)
+
+namespace Gtk
+{
+class GTKMM_API ListItemFactory : public Glib::Object
+{
+  _CLASS_GOBJECT(ListItemFactory, GtkListItemFactory, GTK_LIST_ITEM_FACTORY, Glib::Object, GObject, , , 
GTKMM_API)
+};
+
+} // namespace Gtk
diff --git a/gtk/src/signallistitemfactory.ccg b/gtk/src/signallistitemfactory.ccg
new file mode 100644
index 000000000..57b87fdcf
--- /dev/null
+++ b/gtk/src/signallistitemfactory.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/signallistitemfactory.hg b/gtk/src/signallistitemfactory.hg
new file mode 100644
index 000000000..f6f1ed138
--- /dev/null
+++ b/gtk/src/signallistitemfactory.hg
@@ -0,0 +1,42 @@
+/* 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/listitem.h>
+#include <gtkmm/listitemfactory.h>
+
+_DEFS(gtkmm,gtk)
+_PINCLUDE(gtkmm/private/listitemfactory_p.h)
+
+namespace Gtk
+{
+class GTKMM_API SignalListItemFactory : public ListItemFactory
+{
+  _CLASS_GOBJECT(SignalListItemFactory, GtkSignalListItemFactory, GTK_SIGNAL_LIST_ITEM_FACTORY, 
Gtk::ListItemFactory, GtkListItemFactory, , , GTKMM_API)
+
+protected:
+  _CTOR_DEFAULT
+
+public:
+  _WRAP_CREATE()
+
+#m4 _CONVERSION(`GtkListItem*',`const Glib::RefPtr<ListItem>&',`Glib::wrap($3, true)')
+  _WRAP_SIGNAL(void setup(const Glib::RefPtr<ListItem>& list_item), "setup", no_default_handler)
+  _WRAP_SIGNAL(void bind(const Glib::RefPtr<ListItem>& list_item), "bind", no_default_handler)
+  _WRAP_SIGNAL(void unbind(const Glib::RefPtr<ListItem>& list_item), "unbind", no_default_handler)
+  _WRAP_SIGNAL(void teardown(const Glib::RefPtr<ListItem>& list_item), "teardown", no_default_handler)
+};
+
+} // namespace Gtk
diff --git a/gtk/src/stringlist.ccg b/gtk/src/stringlist.ccg
new file mode 100644
index 000000000..7c266ed9c
--- /dev/null
+++ b/gtk/src/stringlist.ccg
@@ -0,0 +1,30 @@
+/* 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>
+
+namespace Gtk
+{
+
+StringList::StringList(const std::vector<Glib::ustring>& strings)
+:
+  _CONSTRUCT()
+{
+  gtk_string_list_splice(gobj(), 0, 0,
+      Glib::ArrayHandler<Glib::ustring>::vector_to_array(strings).data());
+}
+
+} // namespace Gtk
diff --git a/gtk/src/stringlist.hg b/gtk/src/stringlist.hg
new file mode 100644
index 000000000..2d0406bd5
--- /dev/null
+++ b/gtk/src/stringlist.hg
@@ -0,0 +1,59 @@
+/* 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/buildable.h>
+#include <giomm/listmodel.h>
+#include <gtk/gtk.h>
+
+_DEFS(gtkmm,gtk)
+_PINCLUDE(glibmm/private/object_p.h)
+
+namespace Gtk
+{
+class GTKMM_API StringObject : public Glib::Object
+{
+  _CLASS_GOBJECT(StringObject, GtkStringObject, GTK_STRING_OBJECT, Glib::Object, GObject, , , GTKMM_API)
+  _STRUCT_NOT_HIDDEN
+
+protected:
+  _WRAP_CTOR(StringObject(const Glib::ustring& string), gtk_string_object_new)
+
+public:
+  _WRAP_METHOD(Glib::ustring get_string() const, gtk_string_object_get_string)
+  _WRAP_PROPERTY("string", Glib::ustring)
+};
+
+class GTKMM_API StringList : public Glib::Object, public Gio::ListModel, public Buildable
+{
+  _CLASS_GOBJECT(StringList, GtkStringList, GTK_STRING_LIST, Glib::Object, GObject, , , GTKMM_API)
+  _IMPLEMENTS_INTERFACE(Gio::ListModel)
+  _IMPLEMENTS_INTERFACE(Buildable)
+  _STRUCT_NOT_HIDDEN
+
+protected:
+  StringList(const std::vector<Glib::ustring>& strings);
+
+public:
+  _WRAP_CREATE(const std::vector<Glib::ustring>& strings)
+  _WRAP_METHOD(void append(const Glib::ustring& string), gtk_string_list_append)
+  _WRAP_METHOD(void remove(guint position), gtk_string_list_remove)
+#m4 _CONVERSION(`const std::vector<Glib::ustring>&',`const 
char*-const*',`Glib::ArrayHandler<Glib::ustring>::vector_to_array($3).data()')
+  _WRAP_METHOD(void splice(guint position, guint n_removals, const std::vector<Glib::ustring>& additions),
+    gtk_string_list_splice)
+  _WRAP_METHOD(Glib::ustring get_string(guint position) const, gtk_string_list_get_string)
+};
+
+} // namespace Gtk
diff --git a/tools/extra_defs_gen/generate_defs_gtk.cc b/tools/extra_defs_gen/generate_defs_gtk.cc
index d47acacae..16461cbfd 100644
--- a/tools/extra_defs_gen/generate_defs_gtk.cc
+++ b/tools/extra_defs_gen/generate_defs_gtk.cc
@@ -91,6 +91,7 @@ int main(int /* argc */, char** /* argv */)
             << get_defs( GTK_TYPE_DRAG_SOURCE )
             << get_defs( GTK_TYPE_DRAWING_AREA )
             << get_defs( GTK_TYPE_DROP_CONTROLLER_MOTION )
+            << get_defs( GTK_TYPE_DROP_DOWN )
             << get_defs( GTK_TYPE_DROP_TARGET )
             << get_defs( GTK_TYPE_DROP_TARGET_ASYNC )
             << get_defs( GTK_TYPE_EDITABLE )
@@ -201,6 +202,7 @@ int main(int /* argc */, char** /* argv */)
             << get_defs( GTK_TYPE_SHORTCUTS_SECTION )
             << get_defs( GTK_TYPE_SHORTCUTS_SHORTCUT )
             << get_defs( GTK_TYPE_SHORTCUTS_WINDOW )
+            << get_defs( GTK_TYPE_SIGNAL_LIST_ITEM_FACTORY )
             << get_defs( GTK_TYPE_SINGLE_SELECTION )
             << get_defs( GTK_TYPE_SIZE_GROUP )
             << get_defs( GTK_TYPE_SPINNER )
@@ -210,6 +212,7 @@ int main(int /* argc */, char** /* argv */)
             << get_defs( GTK_TYPE_STACK_SIDEBAR )
             << get_defs( GTK_TYPE_STACK_SWITCHER )
             << get_defs( GTK_TYPE_STATUSBAR )
+            << get_defs( GTK_TYPE_STRING_OBJECT )
             << get_defs( GTK_TYPE_STYLE_CONTEXT )
             << get_defs( GTK_TYPE_STYLE_PROVIDER )
             << get_defs( GTK_TYPE_SWITCH )
diff --git a/tools/m4/convert_gtk.m4 b/tools/m4/convert_gtk.m4
index f82d56741..e5211f45a 100644
--- a/tools/m4/convert_gtk.m4
+++ b/tools/m4/convert_gtk.m4
@@ -579,3 +579,6 @@ _CONVERSION(`const Glib::RefPtr<Constraint>&',`GtkConstraint*',__CONVERT_REFPTR_
 _CONVERSION(`const Glib::RefPtr<ConstraintGuide>&',`GtkConstraintGuide*',__CONVERT_REFPTR_TO_P)
 _CONVERSION(`GtkConstraintTarget*',`Glib::RefPtr<ConstraintTarget>',`Glib::wrap($3)')
 _CONVERSION(`const Glib::RefPtr<ConstraintTarget>&',`gpointer',__CONVERT_REFPTR_TO_P)
+
+_CONVERSION(`const Glib::RefPtr<ListItemFactory>&', `GtkListItemFactory*', __CONVERT_REFPTR_TO_P)
+_CONVERSION(`GtkListItemFactory*',`Glib::RefPtr<ListItemFactory>',`Glib::wrap($3)')


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