summaryrefslogtreecommitdiff
path: root/gtk/gtklayoutmanager.h
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2018-12-19 16:01:17 +0000
committerEmmanuele Bassi <ebassi@gnome.org>2019-03-26 00:11:27 +0000
commit5cbf6f5fbdf8146a62fa611b2279f587e34ee1f0 (patch)
tree12eb9ce0997e62210b71a423fc001b2d1d54c1da /gtk/gtklayoutmanager.h
parent15fda18791ae6df027620a2a8a42899f632337a8 (diff)
downloadgtk+-5cbf6f5fbdf8146a62fa611b2279f587e34ee1f0.tar.gz
Add GtkLayoutChild
Layout managers needs a way to store properties that control the layout policy of a widget; typically, we used to store these in GtkContainer's child properties, but since GtkLayoutManager is decoupled from the actual container widget, we need a separate storage. Additionally, child properties have their own downsides, like requiring a separate, global GParamSpecPool storage, and additional lookup API. GtkLayoutChild is a simple GObject class, which means you can introspect and document it as you would any other type.
Diffstat (limited to 'gtk/gtklayoutmanager.h')
-rw-r--r--gtk/gtklayoutmanager.h38
1 files changed, 23 insertions, 15 deletions
diff --git a/gtk/gtklayoutmanager.h b/gtk/gtklayoutmanager.h
index 4d05132c4d..02f2173a36 100644
--- a/gtk/gtklayoutmanager.h
+++ b/gtk/gtklayoutmanager.h
@@ -20,6 +20,7 @@
#include <gtk/gtktypes.h>
#include <gtk/gtkwidget.h>
+#include <gtk/gtklayoutchild.h>
G_BEGIN_DECLS
@@ -48,23 +49,26 @@ struct _GtkLayoutManagerClass
GObjectClass parent_class;
/*< public >*/
- GtkSizeRequestMode (* get_request_mode) (GtkLayoutManager *manager,
- GtkWidget *widget);
+ GtkSizeRequestMode (* get_request_mode) (GtkLayoutManager *manager,
+ GtkWidget *widget);
- void (* measure) (GtkLayoutManager *manager,
- GtkWidget *widget,
- GtkOrientation orientation,
- int for_size,
- int *minimum,
- int *natural,
- int *minimum_baseline,
- int *natural_baseline);
+ void (* measure) (GtkLayoutManager *manager,
+ GtkWidget *widget,
+ GtkOrientation orientation,
+ int for_size,
+ int *minimum,
+ int *natural,
+ int *minimum_baseline,
+ int *natural_baseline);
- void (* allocate) (GtkLayoutManager *manager,
- GtkWidget *widget,
- int width,
- int height,
- int baseline);
+ void (* allocate) (GtkLayoutManager *manager,
+ GtkWidget *widget,
+ int width,
+ int height,
+ int baseline);
+
+ GtkLayoutChild * (* create_layout_child) (GtkLayoutManager *manager,
+ GtkWidget *widget);
/*< private >*/
gpointer _padding[16];
@@ -95,4 +99,8 @@ GtkWidget * gtk_layout_manager_get_widget (GtkLayoutManage
GDK_AVAILABLE_IN_ALL
void gtk_layout_manager_layout_changed (GtkLayoutManager *manager);
+GDK_AVAILABLE_IN_ALL
+GtkLayoutChild * gtk_layout_manager_get_layout_child (GtkLayoutManager *manager,
+ GtkWidget *widget);
+
G_END_DECLS