From 3f0f7c73e091c2179b2175eb56aef62f16dd9b10 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 28 Mar 2019 16:58:00 +0000 Subject: Connect LayoutManager to LayoutChild If we want to inspect the type of layout properties exposed by a GtkLayoutManager, we need a way to connect the layout manager type to the GtkLayoutChild type it creates. In order to do so, we can set the GtkLayoutChild type on a field of the GtkLayoutManagerClass structure. Storing the GtkLayoutChild type on the class structure of the layout manager also allows us to implement a default create_layout_child() virtual function. --- gtk/gtklayoutmanager.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gtk/gtklayoutmanager.h') diff --git a/gtk/gtklayoutmanager.h b/gtk/gtklayoutmanager.h index 53f4931c69..06659ee70e 100644 --- a/gtk/gtklayoutmanager.h +++ b/gtk/gtklayoutmanager.h @@ -39,6 +39,7 @@ G_DECLARE_DERIVABLE_TYPE (GtkLayoutManager, gtk_layout_manager, GTK, LAYOUT_MANA * sizes of the widget using the layout manager for a given orientation * @allocate: a virtual function, used to allocate the size of the widget * using the layout manager + * @layout_child_type: the type of #GtkLayoutChild used by this layout manager * @create_layout_child: a virtual function, used to create a #GtkLayoutChild * meta object for the layout properties * @@ -70,6 +71,8 @@ struct _GtkLayoutManagerClass int height, int baseline); + GType layout_child_type; + GtkLayoutChild * (* create_layout_child) (GtkLayoutManager *manager, GtkWidget *widget, GtkWidget *for_child); -- cgit v1.2.1