+
+ if (minimum_size)
+ *minimum_size = minimum;
+
+ if (natural_size)
+ *natural_size = natural;
+}
+
+static void
+gtk_alignment_get_preferred_width (GtkWidget *widget,
+ gint *minimum_size,
+ gint *natural_size)
+{
+ gtk_alignment_get_preferred_size (widget, GTK_ORIENTATION_HORIZONTAL, -1, minimum_size, natural_size);
+}
+
+static void
+gtk_alignment_get_preferred_height (GtkWidget *widget,
+ gint *minimum_size,
+ gint *natural_size)
+{
+ gtk_alignment_get_preferred_size (widget, GTK_ORIENTATION_VERTICAL, -1, minimum_size, natural_size);
+}
+
+
+static void
+gtk_alignment_get_preferred_width_for_height (GtkWidget *widget,
+ gint for_size,
+ gint *minimum_size,
+ gint *natural_size)
+{
+ gtk_alignment_get_preferred_size (widget, GTK_ORIENTATION_HORIZONTAL, for_size, minimum_size, natural_size);
+}
+
+static void
+gtk_alignment_get_preferred_height_for_width (GtkWidget *widget,
+ gint for_size,
+ gint *minimum_size,
+ gint *natural_size)
+{
+ gtk_alignment_get_preferred_size (widget, GTK_ORIENTATION_VERTICAL, for_size, minimum_size, natural_size);
+}
+
+/**
+ * gtk_alignment_set_padding:
+ * @alignment: a #GtkAlignment
+ * @padding_top: the padding at the top of the widget
+ * @padding_bottom: the padding at the bottom of the widget
+ * @padding_left: the padding at the left of the widget
+ * @padding_right: the padding at the right of the widget.
+ *
+ * Sets the padding on the different sides of the widget.
+ * The padding adds blank space to the sides of the widget. For instance,
+ * this can be used to indent the child widget towards the right by adding
+ * padding on the left.
+ *
+ * Since: 2.4
+ */
+void
+gtk_alignment_set_padding (GtkAlignment *alignment,
+ guint padding_top,
+ guint padding_bottom,
+ guint padding_left,
+ guint padding_right)
+{
+ GtkAlignmentPrivate *priv;
+ GtkWidget *child;
+
+ g_return_if_fail (GTK_IS_ALIGNMENT (alignment));
+
+ priv = alignment->priv;
+
+ g_object_freeze_notify (G_OBJECT (alignment));
+
+ if (priv->padding_top != padding_top)
+ {
+ priv->padding_top = padding_top;
+ g_object_notify (G_OBJECT (alignment), "top-padding");
+ }
+ if (priv->padding_bottom != padding_bottom)
+ {
+ priv->padding_bottom = padding_bottom;
+ g_object_notify (G_OBJECT (alignment), "bottom-padding");
+ }
+ if (priv->padding_left != padding_left)
+ {
+ priv->padding_left = padding_left;
+ g_object_notify (G_OBJECT (alignment), "left-padding");
+ }
+ if (priv->padding_right != padding_right)
+ {
+ priv->padding_right = padding_right;
+ g_object_notify (G_OBJECT (alignment), "right-padding");
+ }
+
+ g_object_thaw_notify (G_OBJECT (alignment));
+
+ /* Make sure that the widget and children are redrawn with the new setting: */
+ child = gtk_bin_get_child (GTK_BIN (alignment));
+ if (child)
+ gtk_widget_queue_resize (child);
+
+ gtk_widget_queue_draw (GTK_WIDGET (alignment));
+}
+
+/**
+ * gtk_alignment_get_padding:
+ * @alignment: a #GtkAlignment
+ * @padding_top: (out) (allow-none): location to store the padding for
+ * the top of the widget, or %NULL
+ * @padding_bottom: (out) (allow-none): location to store the padding
+ * for the bottom of the widget, or %NULL
+ * @padding_left: (out) (allow-none): location to store the padding
+ * for the left of the widget, or %NULL
+ * @padding_right: (out) (allow-none): location to store the padding
+ * for the right of the widget, or %NULL
+ *
+ * Gets the padding on the different sides of the widget.
+ * See gtk_alignment_set_padding ().
+ *
+ * Since: 2.4
+ */
+void
+gtk_alignment_get_padding (GtkAlignment *alignment,
+ guint *padding_top,
+ guint *padding_bottom,
+ guint *padding_left,
+ guint *padding_right)
+{
+ GtkAlignmentPrivate *priv;
+
+ g_return_if_fail (GTK_IS_ALIGNMENT (alignment));
+
+ priv = alignment->priv;
+
+ if(padding_top)
+ *padding_top = priv->padding_top;
+ if(padding_bottom)
+ *padding_bottom = priv->padding_bottom;
+ if(padding_left)
+ *padding_left = priv->padding_left;
+ if(padding_right)
+ *padding_right = priv->padding_right;