+/**
+ * hildon_button_set_image:
+ * @button: a #HildonButton
+ * @image: a widget to set as the button image
+ *
+ * Sets the image of @button to the given widget. The previous image
+ * (if any) will be removed.
+ **/
+void
+hildon_button_set_image (HildonButton *button,
+ GtkWidget *image)
+{
+ HildonButtonPrivate *priv;
+
+ g_return_if_fail (HILDON_IS_BUTTON (button));
+ g_return_if_fail (!image || GTK_IS_WIDGET (image));
+
+ priv = HILDON_BUTTON_GET_PRIVATE (button);
+
+ /* Return if there's nothing to do */
+ if (image == priv->image)
+ return;
+
+ if (priv->image && priv->image->parent)
+ gtk_container_remove (GTK_CONTAINER (priv->image->parent), priv->image);
+
+ priv->image = image;
+
+ hildon_button_construct_child (button);
+}
+
+/**
+ * hildon_button_get_image:
+ * @button: a #HildonButton
+ *
+ * Gets the widget that is currenty set as the image of @button,
+ * previously set with hildon_button_set_image()
+ *
+ * Returns: a #GtkWidget or %NULL in case there is no image
+ **/
+GtkWidget *
+hildon_button_get_image (HildonButton *button)
+{
+ HildonButtonPrivate *priv;
+
+ g_return_val_if_fail (HILDON_IS_BUTTON (button), NULL);
+
+ priv = HILDON_BUTTON_GET_PRIVATE (button);
+
+ return priv->image;
+}
+
+/**
+ * hildon_button_set_image_position:
+ * @button: a #HildonButton
+ * @position: the position of the image (%GTK_POS_LEFT or %GTK_POS_RIGHT)
+ *
+ * Sets the position of the image inside @button. Only %GTK_POS_LEFT
+ * and %GTK_POS_RIGHT are currently supported.
+ **/
+void
+hildon_button_set_image_position (HildonButton *button,
+ GtkPositionType position)
+{
+ HildonButtonPrivate *priv;
+
+ g_return_if_fail (HILDON_IS_BUTTON (button));
+ g_return_if_fail (position == GTK_POS_LEFT || position == GTK_POS_RIGHT);
+
+ priv = HILDON_BUTTON_GET_PRIVATE (button);
+
+ /* Return if there's nothing to do */
+ if (priv->image_position == position)
+ return;
+
+ priv->image_position = position;
+
+ hildon_button_construct_child (button);
+}
+
+/**
+ * hildon_button_set_alignment:
+ * @button: a #HildonButton
+ * @xalign: the horizontal alignment of the contents, from 0 (left) to 1 (right).
+ * @yalign: the vertical alignment of the contents, from 0 (top) to 1 (bottom).
+ * @xscale: the amount that the child widget expands horizontally to fill up unused space, from 0 to 1
+ * @yscale: the amount that the child widget expands vertically to fill up unused space, from 0 to 1
+ *
+ * Sets the alignment of the contents of the widget. If you don't need
+ * to change @xscale or @yscale you can just use
+ * gtk_button_set_alignment() instead.
+ **/
+void
+hildon_button_set_alignment (HildonButton *button,
+ gfloat xalign,
+ gfloat yalign,
+ gfloat xscale,
+ gfloat yscale)
+{
+ HildonButtonPrivate *priv;
+ GtkWidget *child;
+
+ g_return_if_fail (HILDON_IS_BUTTON (button));
+
+ priv = HILDON_BUTTON_GET_PRIVATE (button);
+
+ child = gtk_bin_get_child (GTK_BIN (button));
+
+ if (GTK_IS_ALIGNMENT (child)) {
+ gtk_button_set_alignment (GTK_BUTTON (button), xalign, yalign);
+ g_object_set (child, "xscale", xscale, "yscale", yscale, NULL);
+ }
+}
+
+/**
+ * hildon_button_set_title_alignment:
+ * @button: a #HildonButton
+ * @xalign: the horizontal alignment of the title label, from 0 (left) to 1 (right).
+ * @yalign: the vertical alignment of the title label, from 0 (top) to 1 (bottom).
+ *
+ * Sets the alignment of the title label. See also
+ * hildon_button_set_alignment() to set the alignment of the whole
+ * contents of the button.
+ **/
+void
+hildon_button_set_title_alignment (HildonButton *button,
+ gfloat xalign,
+ gfloat yalign)
+{
+ HildonButtonPrivate *priv;
+
+ g_return_if_fail (HILDON_IS_BUTTON (button));
+
+ priv = HILDON_BUTTON_GET_PRIVATE (button);
+
+ gtk_misc_set_alignment (GTK_MISC (priv->title), xalign, yalign);
+}
+
+/**
+ * hildon_button_set_value_alignment:
+ * @button: a #HildonButton
+ * @xalign: the horizontal alignment of the value label, from 0 (left) to 1 (right).
+ * @yalign: the vertical alignment of the value label, from 0 (top) to 1 (bottom).
+ *
+ * Sets the alignment of the value label. See also
+ * hildon_button_set_alignment() to set the alignment of the whole
+ * contents of the button.
+ **/
+void
+hildon_button_set_value_alignment (HildonButton *button,
+ gfloat xalign,
+ gfloat yalign)
+{
+ HildonButtonPrivate *priv;
+
+ g_return_if_fail (HILDON_IS_BUTTON (button));
+
+ priv = HILDON_BUTTON_GET_PRIVATE (button);
+
+ gtk_misc_set_alignment (GTK_MISC (priv->value), xalign, yalign);
+}
+
+/**
+ * hildon_button_set_image_alignment:
+ * @button: a #HildonButton
+ * @xalign: the horizontal alignment of the image, from 0 (left) to 1 (right).
+ * @yalign: the vertical alignment of the image, from 0 (top) to 1 (bottom).
+ *
+ * Sets the alignment of the image. See also
+ * hildon_button_set_alignment() to set the alignment of the whole
+ * contents of the button.
+ **/
+void
+hildon_button_set_image_alignment (HildonButton *button,
+ gfloat xalign,
+ gfloat yalign)
+{
+ HildonButtonPrivate *priv;
+
+ g_return_if_fail (HILDON_IS_BUTTON (button));
+
+ priv = HILDON_BUTTON_GET_PRIVATE (button);
+
+ /* Return if there's nothing to do */
+ if (priv->image_xalign == xalign && priv->image_yalign == yalign)
+ return;
+
+ priv->image_xalign = xalign;
+ priv->image_yalign = yalign;
+
+ hildon_button_construct_child (button);
+}
+