summaryrefslogtreecommitdiff
path: root/gtk/gtksizerequest.h
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.van.berkom@gmail.com>2010-08-05 12:45:48 -0400
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2010-08-05 12:50:25 -0400
commit6c76243f463e95f023250aec5f7c1fe29e92673c (patch)
tree27cb75a2ee1ced7cd7ca799ca57d66f3aa2c0860 /gtk/gtksizerequest.h
parent32869d439d21113cc2217ced7ed4c666f48c4ba7 (diff)
downloadgtk+-6c76243f463e95f023250aec5f7c1fe29e92673c.tar.gz
Added gtk_distribute_allocation()
Added a convenience api for containers to use when allocating children (used to distribute space evenly to children).
Diffstat (limited to 'gtk/gtksizerequest.h')
-rw-r--r--gtk/gtksizerequest.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/gtk/gtksizerequest.h b/gtk/gtksizerequest.h
index c3975855a7..272458930a 100644
--- a/gtk/gtksizerequest.h
+++ b/gtk/gtksizerequest.h
@@ -36,6 +36,24 @@ G_BEGIN_DECLS
typedef struct _GtkSizeRequest GtkSizeRequest;
typedef struct _GtkSizeRequestIface GtkSizeRequestIface;
+typedef struct _GtkRequestedSize GtkRequestedSize;
+
+/**
+ * GtkRequestedSize:
+ * @data: A client pointer
+ * @minimum_size: The minimum size needed for allocation in a given orientation
+ * @natural_size: The natural size for allocation in a given orientation
+ *
+ * Represents a request of a screen object in a given orientation. These
+ * are primarily used in container implementations when allocating a natural
+ * size for children calling. See gtk_distribute_natural_allocation().
+ */
+struct _GtkRequestedSize
+{
+ gpointer data;
+ gint minimum_size;
+ gint natural_size;
+};
struct _GtkSizeRequestIface
@@ -82,6 +100,13 @@ void gtk_size_request_get_size (GtkSizeRequest *widge
GtkRequisition *minimum_size,
GtkRequisition *natural_size);
+
+/* General convenience function to aid in allocating natural sizes */
+gint gtk_distribute_natural_allocation (gint extra_space,
+ guint n_requested_sizes,
+ GtkRequestedSize *sizes);
+
+
G_END_DECLS
#endif /* __GTK_SIZE_REQUEST_H__ */