Cleaning up the HildonCaption.
authorMichael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
Mon, 18 Dec 2006 13:22:24 +0000 (13:22 +0000)
committerMichael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
Mon, 18 Dec 2006 13:22:24 +0000 (13:22 +0000)
ChangeLog
src/hildon-caption-private.h [new file with mode: 0644]
src/hildon-caption.c
src/hildon-caption.h

index af45300..13b2dbc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2006-12-18  Michael Dominic Kostrzewa  <michael.kostrzewa@nokia.com> 
 
+       * src/hildon-caption-private.h:
+       * src/hildon-caption.c:
+       * src/hildon-caption.h: Cleaning up the HildonCaption.
+
+2006-12-18  Michael Dominic Kostrzewa  <michael.kostrzewa@nokia.com> 
+
        * src/hildon-sort-dialog-private.h:
        * src/hildon-sort-dialog.c:
        * src/hildon-sort-dialog.h: Cleaning up the HildonSortDialog.
diff --git a/src/hildon-caption-private.h b/src/hildon-caption-private.h
new file mode 100644 (file)
index 0000000..22683c9
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * This file is part of hildon-libs
+ *
+ * Copyright (C) 2005, 2006 Nokia Corporation, all rights reserved.
+ *
+ * Contact: Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; version 2.1 of
+ * the License.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+#ifndef                                         __HILDON_CAPTION_PRIVATE_H__
+#define                                         __HILDON_CAPTION_PRIVATE_H__
+
+G_BEGIN_DECLS
+
+typedef struct                                  _HildonCaptionPrivate HildonCaptionPrivate;
+
+#define                                         HILDON_CAPTION_GET_PRIVATE(obj) \
+                                                (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
+                                                HILDON_TYPE_CAPTION, HildonCaptionPrivate));
+
+struct                                          _HildonCaptionPrivate
+{
+    GtkWidget *caption_area;
+    GtkWidget *label;
+    GtkWidget *icon;
+    GtkWidget *icon_align; /* Arbitrary icon widgets do not support alignment */
+    GtkSizeGroup *group;
+    gchar *text;
+    gchar *separator;
+    guint is_focused : 1;
+    guint expand : 1;
+    HildonCaptionStatus status;
+    HildonCaptionIconPosition icon_position;
+};
+
+G_END_DECLS
+
+#endif                                          /* __HILDON_CAPTION_PRIVATE_H__ */
index b29cc4a..f7b549a 100644 (file)
  * both widget and caption label are displayed with active focus. 
  */
 
-#include <config.h>
-#include "hildon-caption.h"
-#include <gtk/gtkhbox.h>
-#include <gtk/gtklabel.h>
-#include <gtk/gtkimage.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtkcombo.h>
-#include <gtk/gtkcombobox.h>
-#include <gtk/gtkcomboboxentry.h>
-#include <gtk/gtkoptionmenu.h>
-#include <gtk/gtkmarshal.h>
-#include <gtk/gtkalignment.h>
-#include <stdio.h>
-#include <string.h>
-#include "hildon-defines.h"
-#include <libintl.h>
-
-#define _(String) dgettext(PACKAGE, String)
-
-#define HILDON_CAPTION_SPACING 6
-
-#define HILDON_CAPTION_GET_PRIVATE(obj) \
-    (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
-     HILDON_TYPE_CAPTION, HildonCaptionPrivate));
-
-/*our parent class*/
-static GtkEventBox *parent_class = NULL;
-
-typedef struct _HildonCaptionPrivate HildonCaptionPrivate;
+#ifdef                                          HAVE_CONFIG_H
+#include                                        <config.h>
+#endif
 
-enum
-{
-  PROP_NONE,
-  PROP_LABEL,
-  PROP_ICON,
-  PROP_STATUS,
-  PROP_SEPARATOR,
-  PROP_SIZE_GROUP,
-  PROP_ICON_POSITION,
-};
+#include                                        "hildon-caption.h"
+#include                                        <gtk/gtkhbox.h>
+#include                                        <gtk/gtklabel.h>
+#include                                        <gtk/gtkimage.h>
+#include                                        <gtk/gtkentry.h>
+#include                                        <gtk/gtkcombo.h>
+#include                                        <gtk/gtkcombobox.h>
+#include                                        <gtk/gtkcomboboxentry.h>
+#include                                        <gtk/gtkoptionmenu.h>
+#include                                        <gtk/gtkmarshal.h>
+#include                                        <gtk/gtkalignment.h>
+#include                                        <stdio.h>
+#include                                        <string.h>
+#include                                        "hildon-defines.h"
+#include                                        <libintl.h>
+#include                                        "hildon-caption-private.h"
+
+#define                                         _(String)\
+                                                dgettext(PACKAGE, String)
+
+#define                                         HILDON_CAPTION_SPACING 6
+
+static GtkEventBox*                             parent_class = NULL;
+
+static void 
+hildon_caption_class_init                       (HildonCaptionClass *caption_class);
+
+static void
+hildon_caption_init                             (HildonCaption *caption);
+
+static void 
+hildon_caption_size_request                     (GtkWidget *widget, 
+                                                 GtkRequisition *requisition);
+
+static void 
+hildon_caption_size_allocate                    (GtkWidget *widget, 
+                                                 GtkAllocation *allocation);
+
+static void 
+hildon_caption_forall                           (GtkContainer *container,
+                                                 gboolean include_internals,
+                                                 GtkCallback callback, 
+                                                 gpointer data );
+
+static void
+hildon_caption_hierarchy_changed                (GtkWidget *widget,
+                                                 GtkWidget *previous_toplevel);
+
+static void 
+hildon_caption_set_focus                        (GtkWindow *window, 
+                                                 GtkWidget *widget,
+                                                 GtkWidget *caption);
+
+static void 
+hildon_caption_activate                         (GtkWidget *widget);
+
+static void
+hildon_caption_set_property                     (GObject *object, 
+                                                 guint param_id,
+                                                 const GValue *value, 
+                                                 GParamSpec *pspec );
+
+static void
+hildon_caption_get_property                     (GObject *object, 
+                                                 guint param_id,
+                                                 GValue *value, 
+                                                 GParamSpec *pspec);
+
+static gboolean 
+hildon_caption_expose                           (GtkWidget *widget,
+                                                 GdkEventExpose *event);
+
+static void 
+hildon_caption_destroy                          (GtkObject *self);
+
+static gboolean 
+hildon_caption_button_press                     (GtkWidget *widget, 
+                                                 GdkEventButton *event);
+
+static void
+hildon_caption_set_label_text                   (HildonCaptionPrivate *priv);
+
+static void 
+hildon_caption_set_child_property               (GtkContainer *container,
+                                                 GtkWidget *child,
+                                                 guint property_id,
+                                                 const GValue *value,
+                                                 GParamSpec *pspec);
+
+static void 
+hildon_caption_get_child_property               (GtkContainer *container,
+                                                 GtkWidget *child,
+                                                 guint property_id,
+                                                 GValue *value,
+                                                 GParamSpec *pspec);
 
 enum
 {
-  CHILD_PROP_NONE,
-  CHILD_PROP_EXPAND
+    PROP_0,
+    PROP_LABEL,
+    PROP_ICON,
+    PROP_STATUS,
+    PROP_SEPARATOR,
+    PROP_SIZE_GROUP,
+    PROP_ICON_POSITION,
 };
 
-static void hildon_caption_class_init   ( HildonCaptionClass *caption_class );
-static void hildon_caption_init         ( HildonCaption *caption );
-static void hildon_caption_size_request ( GtkWidget *widget, GtkRequisition *requisition );
-static void hildon_caption_size_allocate( GtkWidget *widget, GtkAllocation *allocation );
-
-static void hildon_caption_forall( GtkContainer *container,
-                                   gboolean include_internals,
-                                   GtkCallback callback, gpointer data );
-static void hildon_caption_hierarchy_changed( GtkWidget *widget,
-                                              GtkWidget *previous_toplevel);
-static void hildon_caption_set_focus( GtkWindow *window, GtkWidget *widget,
-                                      GtkWidget *caption );
-static void hildon_caption_activate( GtkWidget *widget );
-
-static void hildon_caption_set_property( GObject *object, guint param_id,
-                                                        const GValue *value, GParamSpec *pspec );
-static void hildon_caption_get_property( GObject *object, guint param_id,
-                                                          GValue *value, GParamSpec *pspec );
-static gboolean hildon_caption_expose( GtkWidget *widget,
-                                       GdkEventExpose *event );
-static void hildon_caption_destroy( GtkObject *self );
-static gboolean hildon_caption_button_press( GtkWidget *widget, GdkEventButton *event );
-
-static void
-hildon_caption_set_label_text( HildonCaptionPrivate *priv );
-
-static void hildon_caption_set_child_property (GtkContainer    *container,
-                                              GtkWidget       *child,
-                                              guint            property_id,
-                                              const GValue    *value,
-                                              GParamSpec      *pspec);
-static void hildon_caption_get_child_property (GtkContainer    *container,
-                                              GtkWidget       *child,
-                                              guint            property_id,
-                                              GValue          *value,
-                                              GParamSpec      *pspec);
-
-struct _HildonCaptionPrivate
+enum
 {
-  GtkWidget *caption_area;
-  GtkWidget *label;
-  GtkWidget *icon;
-  GtkWidget *icon_align; /* Arbitrary icon widgets do not support alignment */
-  GtkSizeGroup *group;
-  gchar *text;
-  gchar *separator;
-  guint is_focused : 1;
-  guint expand : 1;
-  HildonCaptionStatus status;
-  HildonCaptionIconPosition icon_position;
+    CHILD_PROP_NONE,
+    CHILD_PROP_EXPAND
 };
 
 /**
@@ -139,619 +157,646 @@ struct _HildonCaptionPrivate
  *
  * @Returns: GType of #HildonCaption
  */
-GType hildon_caption_get_type (void)
+GType G_GNUC_CONST 
+hildon_caption_get_type                         (void)
 {
-  static GType caption_type = 0;
-
-  if (!caption_type)
-  {
-    static const GTypeInfo caption_info = {
-        sizeof(HildonCaptionClass),
-               NULL,       /* base_init */
-               NULL,       /* base_finalize */
-               (GClassInitFunc) hildon_caption_class_init,
-               NULL,       /* class_finalize */
-               NULL,       /* class_data */
-               sizeof(HildonCaption),
-               0,  /* n_preallocs */
-               (GInstanceInitFunc) hildon_caption_init,
-    };
-    caption_type = g_type_register_static( GTK_TYPE_EVENT_BOX,
-                                           "HildonCaption", &caption_info, 0 );
-  }
-  return caption_type;
+    static GType caption_type = 0;
+
+    if (!caption_type)
+    {
+        static const GTypeInfo caption_info = {
+            sizeof (HildonCaptionClass),
+            NULL,       /* base_init */
+            NULL,       /* base_finalize */
+            (GClassInitFunc) hildon_caption_class_init,
+            NULL,       /* class_finalize */
+            NULL,       /* class_data */
+            sizeof (HildonCaption),
+            0,  /* n_preallocs */
+            (GInstanceInitFunc) hildon_caption_init,
+        };
+        caption_type = g_type_register_static (GTK_TYPE_EVENT_BOX,
+                "HildonCaption", &caption_info, 0 );
+    }
+    return caption_type;
 }
 
 /*
  * Initialises the caption class.
  */
-static void hildon_caption_class_init( HildonCaptionClass *caption_class )
+static void 
+hildon_caption_class_init                       (HildonCaptionClass *caption_class)
 {
-  GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(caption_class);
-  GObjectClass *gobject_class = G_OBJECT_CLASS(caption_class);
-  GtkContainerClass *container_class = GTK_CONTAINER_CLASS(caption_class);
-  
-  parent_class = g_type_class_peek_parent( caption_class );
-
-  g_type_class_add_private( caption_class, sizeof(HildonCaptionPrivate) );
-
-  /* Override virtual functions */
-  gobject_class->get_property = hildon_caption_get_property;
-  gobject_class->set_property = hildon_caption_set_property;
-
-  caption_class->activate = (gpointer) hildon_caption_activate;
-
-  GTK_OBJECT_CLASS(caption_class)->destroy = hildon_caption_destroy;
-
-  container_class->forall             = hildon_caption_forall;
-  container_class->set_child_property = hildon_caption_set_child_property;
-  container_class->get_child_property = hildon_caption_get_child_property;
-
-  widget_class->expose_event       = hildon_caption_expose;
-  widget_class->hierarchy_changed  = hildon_caption_hierarchy_changed;
-  widget_class->size_request       = hildon_caption_size_request;
-  widget_class->size_allocate      = hildon_caption_size_allocate;
-  widget_class->button_press_event = hildon_caption_button_press;
-
-  /* Create new signals and properties */
-  widget_class->activate_signal = g_signal_new( "activate",
-                                                G_OBJECT_CLASS_TYPE(
-                                                gobject_class),
-                                                G_SIGNAL_RUN_FIRST |
-                                                G_SIGNAL_ACTION,
-                                                G_STRUCT_OFFSET( HildonCaptionClass,
-                                                activate), NULL, NULL,
-                                                gtk_marshal_VOID__VOID,
-                                                G_TYPE_NONE, 0);
-
-  /**
-   * HildonCaption:label:
-   *
-   * Caption label.
-   */
-  g_object_class_install_property( gobject_class, PROP_LABEL,
-                                   g_param_spec_string("label",
-                                   "Current label", "Caption label",
-                                   NULL, G_PARAM_READABLE | G_PARAM_WRITABLE) );
-
-  /**
-   * HildonCaption:icon:
-   *
-   * The icon shown on the caption area.
-   */
-  g_object_class_install_property( gobject_class, PROP_ICON,
-                                   g_param_spec_object("icon",
-                                   "Current icon",
-                                   "The icon shown on the caption area",
-                                   GTK_TYPE_WIDGET, G_PARAM_READABLE | 
-                                   G_PARAM_WRITABLE) );
-  /**
-   * HildonCaption:status:
-   *
-   * Mandatory or optional status.
-   */
-  g_object_class_install_property( gobject_class, PROP_STATUS,
-                                  g_param_spec_enum("status",
-                                  "Current status",
-                                  "Mandatory or optional status",
-                                  HILDON_TYPE_CAPTION_STATUS,
-                                  HILDON_CAPTION_OPTIONAL,
-                                  G_PARAM_READABLE | G_PARAM_WRITABLE) );
-  /**
-   * HildonCaption:icon-position:
-   *
-   * If the icon is positioned on the left or right side.
-   *
-   * Since: 0.14.5
-   */
-  g_object_class_install_property( gobject_class, PROP_ICON_POSITION,
-                                  g_param_spec_enum("icon-position",
-                                  "Icon position",
-                                  "If the icon is on the left or right side",
-                                  HILDON_TYPE_CAPTION_ICON_POSITION,
-                                  HILDON_CAPTION_POSITION_RIGHT,
-                                  G_PARAM_READABLE | G_PARAM_WRITABLE) );
-
-  /**
-   * HildonCaption:size_group:
-   *
-   * Current size group the caption is in.
-   */
-  g_object_class_install_property( gobject_class, PROP_SIZE_GROUP,
-                                   g_param_spec_object("size_group",
-                                   "Current size group",
-                                   "Current size group the caption is in",
-                                   GTK_TYPE_SIZE_GROUP, G_PARAM_READABLE | 
-                                   G_PARAM_WRITABLE) );
-  
-  /**
-   * HildonCaption:separator:
-   *
-   * The current separator.
-   */
-  g_object_class_install_property( gobject_class, PROP_SEPARATOR,
-                                   g_param_spec_string("separator",
-                                   "Current separator", "Current separator",
-                                   _("ecdg_ti_caption_separator"),
-                                   G_PARAM_READABLE | G_PARAM_WRITABLE) );
-
-  /* Create child properties. These are related to
-     child <-> parent relationship, not to either of objects itself */
-  gtk_container_class_install_child_property (container_class,
-                               CHILD_PROP_EXPAND,
-                                       g_param_spec_boolean ("expand",
-                                       "Same as GtkBox expand.",
-                                       "Same as GtkBox expand. Wheter the child should be expanded or not.",
-                                       FALSE,
-                                       G_PARAM_READWRITE));
+    GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (caption_class);
+    GObjectClass *gobject_class = G_OBJECT_CLASS (caption_class);
+    GtkContainerClass *container_class = GTK_CONTAINER_CLASS (caption_class);
+
+    parent_class = g_type_class_peek_parent (caption_class);
+
+    g_type_class_add_private (caption_class, sizeof (HildonCaptionPrivate));
+
+    /* Override virtual functions */
+    gobject_class->get_property                 = hildon_caption_get_property;
+    gobject_class->set_property                 = hildon_caption_set_property;
+    caption_class->activate                     = (gpointer) hildon_caption_activate;
+    GTK_OBJECT_CLASS(caption_class)->destroy    = hildon_caption_destroy;
+
+    container_class->forall                     = hildon_caption_forall;
+    container_class->set_child_property         = hildon_caption_set_child_property;
+    container_class->get_child_property         = hildon_caption_get_child_property;
+
+    widget_class->expose_event                  = hildon_caption_expose;
+    widget_class->hierarchy_changed             = hildon_caption_hierarchy_changed;
+    widget_class->size_request                  = hildon_caption_size_request;
+    widget_class->size_allocate                 = hildon_caption_size_allocate;
+    widget_class->button_press_event            = hildon_caption_button_press;
+
+    /* Create new signals and properties */
+    widget_class->activate_signal = g_signal_new ("activate",
+            G_OBJECT_CLASS_TYPE (
+                gobject_class),
+            G_SIGNAL_RUN_FIRST |
+            G_SIGNAL_ACTION,
+            G_STRUCT_OFFSET (HildonCaptionClass,
+                activate), NULL, NULL,
+            gtk_marshal_VOID__VOID,
+            G_TYPE_NONE, 0);
+
+    /**
+     * HildonCaption:label:
+     *
+     * Caption label.
+     */
+    g_object_class_install_property (gobject_class, PROP_LABEL,
+            g_param_spec_string ("label",
+                "Current label", "Caption label",
+                NULL, G_PARAM_READABLE | G_PARAM_WRITABLE) );
+
+    /**
+     * HildonCaption:icon:
+     *
+     * The icon shown on the caption area.
+     */
+    g_object_class_install_property (gobject_class, PROP_ICON,
+            g_param_spec_object ("icon",
+                "Current icon",
+                "The icon shown on the caption area",
+                GTK_TYPE_WIDGET, G_PARAM_READABLE | 
+                G_PARAM_WRITABLE) );
+    /**
+     * HildonCaption:status:
+     *
+     * Mandatory or optional status.
+     */
+    g_object_class_install_property (gobject_class, PROP_STATUS,
+            g_param_spec_enum ("status",
+                "Current status",
+                "Mandatory or optional status",
+                HILDON_TYPE_CAPTION_STATUS,
+                HILDON_CAPTION_OPTIONAL,
+                G_PARAM_READABLE | G_PARAM_WRITABLE) );
+    /**
+     * HildonCaption:icon-position:
+     *
+     * If the icon is positioned on the left or right side.
+     */
+    g_object_class_install_property (gobject_class, PROP_ICON_POSITION,
+            g_param_spec_enum ("icon-position",
+                "Icon position",
+                "If the icon is on the left or right side",
+                HILDON_TYPE_CAPTION_ICON_POSITION,
+                HILDON_CAPTION_POSITION_RIGHT,
+                G_PARAM_READABLE | G_PARAM_WRITABLE) );
+
+    /**
+     * HildonCaption:size_group:
+     *
+     * Current size group the caption is in.
+     */
+    g_object_class_install_property (gobject_class, PROP_SIZE_GROUP,
+            g_param_spec_object ("size_group",
+                "Current size group",
+                "Current size group the caption is in",
+                GTK_TYPE_SIZE_GROUP, G_PARAM_READABLE | 
+                G_PARAM_WRITABLE) );
+
+    /**
+     * HildonCaption:separator:
+     *
+     * The current separator.
+     */
+    g_object_class_install_property (gobject_class, PROP_SEPARATOR,
+            g_param_spec_string ("separator",
+                "Current separator", "Current separator",
+                _("ecdg_ti_caption_separator"),
+                G_PARAM_READABLE | G_PARAM_WRITABLE) );
+
+    /* Create child properties. These are related to
+       child <-> parent relationship, not to either of objects itself */
+    gtk_container_class_install_child_property (container_class,
+            CHILD_PROP_EXPAND,
+            g_param_spec_boolean ("expand",
+                "Same as GtkBox expand.",
+                "Same as GtkBox expand. Wheter the child should be expanded or not.",
+                FALSE,
+                G_PARAM_READWRITE));
 }
 
 /* Destroy can be called multiple times, remember to set pointers to NULL */
-static void hildon_caption_destroy( GtkObject *self )
+static void 
+hildon_caption_destroy                          (GtkObject *self)
 {
-  HildonCaptionPrivate *priv = HILDON_CAPTION_GET_PRIVATE(self);
-
-  /* Free our internal child */
-  if( priv->caption_area )
-  {
-    gtk_widget_unparent( priv->caption_area );
-    priv->caption_area = NULL;
-  }
-
-  /* Free user provided strings */
-  if( priv->text )
-  {
-    g_free( priv->text );
-    priv->text = NULL;
-  }
-  if( priv->separator )
-  {
-    g_free( priv->separator );
-    priv->separator = NULL;
-  }
-
-  /* Parent classes destroy takes care of user packed contents */
-  if( GTK_OBJECT_CLASS(parent_class)->destroy )
-    GTK_OBJECT_CLASS(parent_class)->destroy( self );
+    HildonCaptionPrivate *priv = HILDON_CAPTION_GET_PRIVATE (self);
+
+    /* Free our internal child */
+    if (priv && priv->caption_area)
+    {
+        gtk_widget_unparent (priv->caption_area);
+        priv->caption_area = NULL;
+    }
+
+    /* Free user provided strings */
+    if (priv && priv->text)
+    {
+        g_free (priv->text);
+        priv->text = NULL;
+    }
+
+    if (priv && priv->separator)
+    {
+        g_free (priv->separator);
+        priv->separator = NULL;
+    }
+
+    /* Parent classes destroy takes care of user packed contents */
+    if (GTK_OBJECT_CLASS (parent_class)->destroy)
+        GTK_OBJECT_CLASS (parent_class)->destroy (self);
 }
 
 /* Parent, eventbox will run allocate also for the child which may be
  * owning a window too. This window is then moved and resized
  * and we do not want to do that (it causes flickering).
  */
-static gboolean hildon_caption_expose( GtkWidget *widget,
-                                       GdkEventExpose *event )
+static gboolean 
+hildon_caption_expose                           (GtkWidget *widget,
+                                                 GdkEventExpose *event)
 {
-  HildonCaptionPrivate *priv = NULL;
-  GtkRequisition req;
-  GtkAllocation alloc;
-  gfloat align;
+    HildonCaptionPrivate *priv = NULL;
+    GtkRequisition req;
+    GtkAllocation alloc;
+    gfloat align;
 
-  g_assert( HILDON_IS_CAPTION(widget) );
-  priv = HILDON_CAPTION_GET_PRIVATE(widget);
+    g_assert (HILDON_IS_CAPTION (widget));
+    priv = HILDON_CAPTION_GET_PRIVATE (widget);
+    g_assert (priv);
 
-  if( !GTK_WIDGET_DRAWABLE(widget) )
-    return FALSE;
+    if (! GTK_WIDGET_DRAWABLE (widget))
+        return FALSE;
 
-  GTK_WIDGET_CLASS(parent_class)->expose_event( widget, event );
-
-  /* If our child control is focused, we draw nice looking focus
-     graphics for the caption */  
-  if ( priv->is_focused && priv->text )
-  {
-    /* Determine focus box dimensions */
-    gtk_widget_get_child_requisition( priv->caption_area, &req );
-    align = hildon_caption_get_label_alignment(HILDON_CAPTION(widget));
-
-    alloc.width = priv->caption_area->allocation.width + HILDON_CAPTION_SPACING;
-    alloc.height = MIN (req.height + (2 * widget->style->ythickness), priv->caption_area->allocation.height);
-
-    alloc.x = priv->caption_area->allocation.x - HILDON_CAPTION_SPACING; /* - left margin */
-    alloc.y = priv->caption_area->allocation.y + 
-              MAX(((priv->caption_area->allocation.height - alloc.height) * align), 0);
-
-    /* Paint the focus box */
-    gtk_paint_box( widget->style, widget->window, GTK_STATE_ACTIVE,
-                   GTK_SHADOW_OUT, NULL, widget, "selection",
-                   alloc.x, alloc.y, alloc.width, alloc.height );
-
-    /* Paint caption contents on top of the focus box */
-    GTK_WIDGET_GET_CLASS(priv->caption_area)->expose_event(
-         priv->caption_area, event);
-  }
-  
-  return FALSE;
-}
+    GTK_WIDGET_CLASS (parent_class)->expose_event (widget, event);
 
-static void hildon_caption_set_property( GObject *object, guint param_id,
-                                                          const GValue *value,
-                                         GParamSpec *pspec )
-{
-  HildonCaptionPrivate *priv = HILDON_CAPTION_GET_PRIVATE(object);
+    /* If our child control is focused, we draw nice looking focus
+       graphics for the caption */  
+    if (priv->is_focused && priv->text)
+    {
+        /* Determine focus box dimensions */
+        gtk_widget_get_child_requisition (priv->caption_area, &req);
+        align = hildon_caption_get_label_alignment (HILDON_CAPTION(widget));
 
-  switch( param_id ) 
-  {
-    case PROP_ICON_POSITION:
+        alloc.width = priv->caption_area->allocation.width + HILDON_CAPTION_SPACING;
+        alloc.height = MIN (req.height + (2 * widget->style->ythickness), priv->caption_area->allocation.height);
 
-      hildon_caption_set_icon_position (HILDON_CAPTION (object), 
-                                        g_value_get_enum (value));
+        alloc.x = priv->caption_area->allocation.x - HILDON_CAPTION_SPACING; /* - left margin */
+        alloc.y = priv->caption_area->allocation.y + 
+            MAX (((priv->caption_area->allocation.height - alloc.height) * align), 0);
 
-      break;
+        /* Paint the focus box */
+        gtk_paint_box (widget->style, widget->window, GTK_STATE_ACTIVE,
+                GTK_SHADOW_OUT, NULL, widget, "selection",
+                alloc.x, alloc.y, alloc.width, alloc.height);
 
-    case PROP_LABEL:
-      /* Free old label string */
-      if( priv->text )
-      {
-        g_free( priv->text );
-        priv->text = NULL;
-      }
-
-      /* Update label */
-      priv->text = g_value_dup_string(value);
-      hildon_caption_set_label_text( priv );
-      break;
-      
-    case PROP_ICON:
-      /* Remove old icon */
-      if( priv->icon )
-        gtk_container_remove( GTK_CONTAINER(priv->icon_align), priv->icon );
-
-      /* Pack and display new icon */
-      priv->icon = g_value_get_object( value );
-      if( priv->icon )
-      {
-        gtk_container_add(GTK_CONTAINER(priv->icon_align), priv->icon);
-        gtk_widget_show_all( priv->caption_area );
-      }
-      break;
-
-    case PROP_STATUS:
-      priv->status = g_value_get_enum( value );
-      break;
-
-    case PROP_SIZE_GROUP:
-      /* Detach from previous size group */
-      if( priv->group )
-        gtk_size_group_remove_widget( priv->group, priv->caption_area );
-      
-      priv->group = g_value_get_object( value );
-      
-      /* Attach to new size group */
-      if( priv->group )
-        gtk_size_group_add_widget( priv->group, priv->caption_area );
-      gtk_widget_queue_draw( GTK_WIDGET(object) );
-      break;
-    
-    case PROP_SEPARATOR:
+        /* Paint caption contents on top of the focus box */
+        GTK_WIDGET_GET_CLASS (priv->caption_area)->expose_event (priv->caption_area, event);
+    }
 
-      /* Free old separator */
-      if( priv->separator )
-      {
-        g_free( priv->separator );
-        priv->separator = NULL;
-      }
+    return FALSE;
+}
 
-      priv->separator = g_value_dup_string(value);
-      hildon_caption_set_label_text( priv );
-      break;
+static void 
+hildon_caption_set_property                     (GObject *object, 
+                                                 guint param_id,
+                                                 const GValue *value,
+                                                 GParamSpec *pspec)
+{
+    HildonCaptionPrivate *priv = HILDON_CAPTION_GET_PRIVATE (object);
+    g_assert (priv);
 
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID(object, param_id, pspec);
-      break;
-  }
+    switch (param_id) 
+    {
+        case PROP_ICON_POSITION:
+            hildon_caption_set_icon_position (HILDON_CAPTION (object), g_value_get_enum (value));
+            break;
+
+        case PROP_LABEL:
+            /* Free old label string */
+            if (priv->text)
+            {
+                g_free (priv->text);
+                priv->text = NULL;
+            }
+
+            /* Update label */
+            priv->text = g_value_dup_string (value);
+            hildon_caption_set_label_text (priv);
+            break;
+
+        case PROP_ICON:
+            /* Remove old icon */
+            if (priv->icon)
+                gtk_container_remove (GTK_CONTAINER (priv->icon_align), priv->icon);
+
+            /* Pack and display new icon */
+            priv->icon = g_value_get_object (value);
+            if (priv->icon)
+            {
+                gtk_container_add (GTK_CONTAINER (priv->icon_align), priv->icon);
+                gtk_widget_show_all (priv->caption_area);
+            }
+            break;
+
+        case PROP_STATUS:
+            priv->status = g_value_get_enum (value);
+            break;
+
+        case PROP_SIZE_GROUP:
+            /* Detach from previous size group */
+            if (priv->group)
+                gtk_size_group_remove_widget (priv->group, priv->caption_area);
+
+            priv->group = g_value_get_object (value);
+
+            /* Attach to new size group */
+            if (priv->group)
+                gtk_size_group_add_widget (priv->group, priv->caption_area);
+
+            gtk_widget_queue_draw (GTK_WIDGET(object));
+            break;
+
+        case PROP_SEPARATOR:
+
+            /* Free old separator */
+            if (priv->separator)
+            {
+                g_free (priv->separator);
+                priv->separator = NULL;
+            }
+
+            priv->separator = g_value_dup_string (value);
+            hildon_caption_set_label_text (priv);
+            break;
+
+        default:
+            G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+            break;
+    }
 }
 
-static void hildon_caption_get_property( GObject *object, guint param_id,
-                                                          GValue *value, GParamSpec *pspec )
+static void 
+hildon_caption_get_property                     (GObject *object, 
+                                                 guint param_id,
+                                                 GValue *value, 
+                                                 GParamSpec *pspec)
 {
-  HildonCaptionPrivate *priv = HILDON_CAPTION_GET_PRIVATE(object);
+    HildonCaptionPrivate *priv = HILDON_CAPTION_GET_PRIVATE (object);
 
-  switch (param_id) 
+    switch (param_id) 
     {
-    case PROP_LABEL:
-      g_value_set_string( value, priv->text );
-      break;
-    case PROP_ICON:
-      g_value_set_object( value, priv->icon );
-      break;
-    case PROP_STATUS:
-      g_value_set_enum( value, priv->status );
-      break;
-    case PROP_ICON_POSITION:
-      g_value_set_enum( value, priv->icon_position);
-      break;
-    case PROP_SIZE_GROUP:
-      g_value_set_object( value, priv->group );
-      break;
-    case PROP_SEPARATOR:
-      g_value_set_string( value, priv->separator );
-      break;
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID(object, param_id, pspec);
-      break;
+        case PROP_LABEL:
+            g_value_set_string (value, priv->text);
+            break;
+
+        case PROP_ICON:
+            g_value_set_object (value, priv->icon);
+            break;
+
+        case PROP_STATUS:
+            g_value_set_enum (value, priv->status);
+            break;
+
+        case PROP_ICON_POSITION:
+            g_value_set_enum (value, priv->icon_position);
+            break;
+
+        case PROP_SIZE_GROUP:
+            g_value_set_object (value, priv->group);
+            break;
+
+        case PROP_SEPARATOR:
+            g_value_set_string (value, priv->separator);
+            break;
+
+        default:
+            G_OBJECT_WARN_INVALID_PROPERTY_ID(object, param_id, pspec);
+            break;
     }
 }
 
-static void hildon_caption_set_child_property( GtkContainer    *container,
-                                             GtkWidget       *child,
-                                             guint            property_id,
-                                             const GValue    *value,
-                                             GParamSpec      *pspec )
+static void 
+hildon_caption_set_child_property               (GtkContainer *container,
+                                                 GtkWidget *child,
+                                                 guint property_id,
+                                                 const GValue *value,
+                                                 GParamSpec *pspec)
 {
-  switch (property_id)
+    switch (property_id)
     {
-    case CHILD_PROP_EXPAND:
-      hildon_caption_set_child_expand( HILDON_CAPTION(container),
-                                     g_value_get_boolean(value) );
-      break;
-
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID(container, property_id, pspec);
-      break;
+        case CHILD_PROP_EXPAND:
+            hildon_caption_set_child_expand (HILDON_CAPTION (container),
+                    g_value_get_boolean (value));
+            break;
+
+        default:
+            G_OBJECT_WARN_INVALID_PROPERTY_ID (container, property_id, pspec);
+            break;
     }
 }
 
-static void hildon_caption_get_child_property( GtkContainer    *container,
-                                             GtkWidget       *child,
-                                             guint            property_id,
-                                             GValue          *value,
-                                             GParamSpec      *pspec )
+static void 
+hildon_caption_get_child_property               (GtkContainer *container,
+                                                 GtkWidget *child,
+                                                 guint property_id,
+                                                 GValue *value,
+                                                 GParamSpec *pspec)
 {
-  switch (property_id)
+    switch (property_id)
     {
-    case CHILD_PROP_EXPAND:
-      g_value_set_boolean( value, hildon_caption_get_child_expand(
-                           HILDON_CAPTION(container)) );
-      break;
-
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID(container, property_id, pspec);
-      break;
+        case CHILD_PROP_EXPAND:
+            g_value_set_boolean (value, hildon_caption_get_child_expand(
+                        HILDON_CAPTION (container)));
+            break;
+
+        default:
+            G_OBJECT_WARN_INVALID_PROPERTY_ID(container, property_id, pspec);
+            break;
     }
 }
 
 /* We want to activate out child control on button press */
-static gboolean hildon_caption_button_press( GtkWidget *widget, 
-                                            GdkEventButton *event )
+static gboolean
+hildon_caption_button_press                     (GtkWidget *widget, 
+                                                 GdkEventButton *event)
 {
-  HildonCaptionPrivate *priv = HILDON_CAPTION_GET_PRIVATE(widget);
-  GtkWidget *child = GTK_BIN(widget)->child;
+    HildonCaptionPrivate *priv = HILDON_CAPTION_GET_PRIVATE (widget);
+    g_assert (priv);
+    GtkWidget *child = GTK_BIN (widget)->child;
 
-  /* nothing to do */
-  if (priv->is_focused == TRUE)
-    return FALSE;
+    /* nothing to do */
+    if (priv->is_focused == TRUE)
+        return FALSE;
 
-  /* If child can take focus, we simply grab focus to it */
-  if ((GTK_WIDGET_CAN_FOCUS(child) || GTK_IS_CONTAINER(child)) &&
-      GTK_WIDGET_IS_SENSITIVE(child))
-  {
-    /* Only if container can be focusable we must set is_focused to TRUE */ 
-    if (GTK_IS_CONTAINER(child))
-    {
-      if (gtk_widget_child_focus (child,
-                                 GTK_DIR_TAB_FORWARD))
-       priv->is_focused = TRUE;
-    }
-    else
+    /* If child can take focus, we simply grab focus to it */
+    if ((GTK_WIDGET_CAN_FOCUS (child) || GTK_IS_CONTAINER (child)) &&
+            GTK_WIDGET_IS_SENSITIVE (child))
     {
-      priv->is_focused = TRUE;
-      gtk_widget_grab_focus (GTK_BIN (widget)->child);
+        /* Only if container can be focusable we must set is_focused to TRUE */ 
+        if (GTK_IS_CONTAINER (child))
+        {
+            if (gtk_widget_child_focus (child, GTK_DIR_TAB_FORWARD))
+                priv->is_focused = TRUE;
+        }
+        else
+        {
+            priv->is_focused = TRUE;
+            gtk_widget_grab_focus (GTK_BIN (widget)->child);
+        }
     }
-  }
 
-  return FALSE;
+    return FALSE;
 }
 
-static void hildon_caption_init( HildonCaption *caption )
+static void 
+hildon_caption_init                             (HildonCaption *caption)
 {
-  HildonCaptionPrivate *priv = NULL;
+    HildonCaptionPrivate *priv = NULL;
 
-  /* Initialize startup state */
-  priv = HILDON_CAPTION_GET_PRIVATE(caption);
-  priv->status = HILDON_CAPTION_OPTIONAL;
-  priv->icon = NULL;
-  priv->group = NULL;
-  priv->is_focused = FALSE;
-  priv->text = NULL;
+    /* Initialize startup state */
+    priv = HILDON_CAPTION_GET_PRIVATE (caption);
+    g_assert (priv);
 
-  priv->separator = g_strdup(_("ecdg_ti_caption_separator"));
+    priv->status = HILDON_CAPTION_OPTIONAL;
+    priv->icon = NULL;
+    priv->group = NULL;
+    priv->is_focused = FALSE;
+    priv->text = NULL;
 
-  gtk_widget_push_composite_child();
-  
-  /* Create caption text */
-  priv->caption_area = gtk_hbox_new( FALSE, HILDON_CAPTION_SPACING ); 
-  priv->label = gtk_label_new( NULL );
-  priv->icon_align = gtk_alignment_new(0.5f, 0.5f, 0.0f, 0.0f);
-  priv->icon_position = HILDON_CAPTION_POSITION_RIGHT;
+    priv->separator = g_strdup(_("ecdg_ti_caption_separator"));
 
-  /* We want to receive button presses for child widget activation */
-  gtk_event_box_set_above_child( GTK_EVENT_BOX(caption), FALSE );
-  gtk_widget_add_events( GTK_WIDGET(caption), GDK_BUTTON_PRESS_MASK );
+    gtk_widget_push_composite_child();
 
-  /* Pack text label caption layout */
-  gtk_box_pack_end( GTK_BOX(priv->caption_area), priv->icon_align, FALSE, FALSE, 0);
-  gtk_box_pack_end( GTK_BOX(priv->caption_area), priv->label, FALSE, FALSE, 0 );
-  gtk_widget_set_parent( priv->caption_area, GTK_WIDGET(caption) );
+    /* Create caption text */
+    priv->caption_area = gtk_hbox_new (FALSE, HILDON_CAPTION_SPACING); 
+    priv->label = gtk_label_new (NULL);
+    priv->icon_align = gtk_alignment_new (0.5f, 0.5f, 0.0f, 0.0f);
+    priv->icon_position = HILDON_CAPTION_POSITION_RIGHT;
 
+    /* We want to receive button presses for child widget activation */
+    gtk_event_box_set_above_child (GTK_EVENT_BOX (caption), FALSE);
+    gtk_widget_add_events (GTK_WIDGET (caption), GDK_BUTTON_PRESS_MASK);
 
-  gtk_widget_pop_composite_child();
+    /* Pack text label caption layout */
+    gtk_box_pack_end (GTK_BOX (priv->caption_area), priv->icon_align, FALSE, FALSE, 0);
+    gtk_box_pack_end (GTK_BOX (priv->caption_area), priv->label, FALSE, FALSE, 0);
+    gtk_widget_set_parent (priv->caption_area, GTK_WIDGET (caption));
 
-  hildon_caption_set_child_expand( caption, TRUE );
+    gtk_widget_pop_composite_child ();
 
-  gtk_widget_show_all( priv->caption_area );
+    hildon_caption_set_child_expand (caption, TRUE);
+
+    gtk_widget_show_all (priv->caption_area);
 }
 
-static void hildon_caption_set_focus( GtkWindow *window, GtkWidget *widget,
-                                      GtkWidget *caption )
+static void 
+hildon_caption_set_focus                        (GtkWindow *window, 
+                                                 GtkWidget *widget,
+                                                 GtkWidget *caption)
 {
-  HildonCaptionPrivate *priv = HILDON_CAPTION_GET_PRIVATE(caption);
-
-  /* check if ancestor gone */
-  if (!widget)
-  {
-    return;
-  }
-  
-  /* Try to find caption among the ancestors of widget */
-  if (gtk_widget_is_ancestor(widget, caption))
+    HildonCaptionPrivate *priv = HILDON_CAPTION_GET_PRIVATE (caption);
+    g_assert (priv);
+
+    /* check if ancestor gone */
+    if (! widget)
     {
-      priv->is_focused = TRUE;
-      gtk_widget_queue_draw( caption );
-      return;
+        return;
     }
 
-  if( priv->is_focused == TRUE )
-  {
-    /* Caption wasn't found, so cannot focus */
-    priv->is_focused = FALSE;
-    gtk_widget_queue_draw( caption );
-  }
+    /* Try to find caption among the ancestors of widget */
+    if (gtk_widget_is_ancestor (widget, caption))
+    {
+        priv->is_focused = TRUE;
+        gtk_widget_queue_draw (caption);
+        return;
+    }
+
+    if (priv->is_focused == TRUE)
+    {
+        /* Caption wasn't found, so cannot focus */
+        priv->is_focused = FALSE;
+        gtk_widget_queue_draw (caption);
+    }
 }
 
 /* We need to connect/disconnect signal handlers to toplevel window
    in which we reside. Ww want to update connected signals if our
    parent changes */
-static void hildon_caption_hierarchy_changed( GtkWidget *widget,
-                                              GtkWidget *previous_toplevel)
+static void 
+hildon_caption_hierarchy_changed                (GtkWidget *widget,
+                                                 GtkWidget *previous_toplevel)
 {
-  GtkWidget *current_ancestor;
-  HildonCaptionPrivate *priv;
+    GtkWidget *current_ancestor;
+    HildonCaptionPrivate *priv;
 
-  priv = HILDON_CAPTION_GET_PRIVATE(widget);
+    priv = HILDON_CAPTION_GET_PRIVATE (widget);
+    g_assert (priv);
 
-  if( GTK_WIDGET_CLASS(parent_class)->hierarchy_changed )
-    GTK_WIDGET_CLASS(parent_class)->hierarchy_changed( widget,
-                                                       previous_toplevel );
+    if (GTK_WIDGET_CLASS (parent_class)->hierarchy_changed)
+        GTK_WIDGET_CLASS (parent_class)->hierarchy_changed (widget, previous_toplevel);
 
-  /* If we already were inside a window, remove old handler */
-  if (previous_toplevel) {
-  /* This is a compilation workaround for gcc > 3.3 since glib is buggy */
-  /* see http://bugzilla.gnome.org/show_bug.cgi?id=310175 */
+    /* If we already were inside a window, remove old handler */
+    if (previous_toplevel) {
+        /* This is a compilation workaround for gcc > 3.3 since glib is buggy */
+        /* see http://bugzilla.gnome.org/show_bug.cgi?id=310175 */
 #ifdef __GNUC__
-  __extension__
+        __extension__
 #endif
-    g_signal_handlers_disconnect_by_func
-      (previous_toplevel, (gpointer) hildon_caption_set_focus, widget);
-  }
-  current_ancestor = gtk_widget_get_ancestor(widget, GTK_TYPE_WINDOW);
-
-  /* Install new handler for focus movement */
-  if (current_ancestor)
-    g_signal_connect( current_ancestor, "set-focus", 
-      G_CALLBACK(hildon_caption_set_focus), widget );
+            g_signal_handlers_disconnect_by_func
+            (previous_toplevel, (gpointer) hildon_caption_set_focus, widget);
+    }
+
+    current_ancestor = gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW);
+
+    /* Install new handler for focus movement */
+    if (current_ancestor)
+        g_signal_connect( current_ancestor, "set-focus", 
+                G_CALLBACK (hildon_caption_set_focus), widget );
 }
 
-static void hildon_caption_size_request( GtkWidget *widget,
-                                         GtkRequisition *requisition )
+static void 
+hildon_caption_size_request                     (GtkWidget *widget,
+                                                 GtkRequisition *requisition)
 {
-  GtkRequisition req;
-  HildonCaptionPrivate *priv = NULL;
-  g_return_if_fail( HILDON_IS_CAPTION(widget) );
-  priv = HILDON_CAPTION_GET_PRIVATE(widget);
+    GtkRequisition req;
+    HildonCaptionPrivate *priv = NULL;
+    g_return_if_fail (HILDON_IS_CAPTION(widget));
 
-  /* Use the same size requisition for the main box of the caption */
-  gtk_widget_size_request( priv->caption_area, &req );
+    priv = HILDON_CAPTION_GET_PRIVATE (widget);
+    g_assert (priv);
 
-  if( GTK_WIDGET_CLASS(parent_class)->size_request )
-    GTK_WIDGET_CLASS(parent_class)->size_request( widget, requisition );
+    /* Use the same size requisition for the main box of the caption */
+    gtk_widget_size_request (priv->caption_area, &req);
 
-  requisition->width += req.width + HILDON_CAPTION_SPACING * 3;
+    if (GTK_WIDGET_CLASS (parent_class)->size_request)
+        GTK_WIDGET_CLASS (parent_class)->size_request (widget, requisition);
 
-  if( (req.height + (2 * widget->style->ythickness)) > requisition->height )
-   requisition->height = req.height + (2 * widget->style->ythickness);
+    requisition->width += req.width + HILDON_CAPTION_SPACING * 3;
+
+    if ((req.height + (2 * widget->style->ythickness)) > requisition->height)
+        requisition->height = req.height + (2 * widget->style->ythickness);
 }
 
 /* We use HILDON_CAPTION_SPACING to make it look a bit nicer */
-static void hildon_caption_size_allocate( GtkWidget *widget,
-                                          GtkAllocation *allocation )
+static void 
+hildon_caption_size_allocate                    (GtkWidget *widget,
+                                                 GtkAllocation *allocation)
 {
-  GtkAllocation allocA;
-  GtkAllocation allocB;
-  GtkRequisition req;
-  GtkWidget *child = NULL;
-  HildonCaptionPrivate *priv = NULL;
-
-  g_assert( HILDON_IS_CAPTION(widget) );
-  priv = HILDON_CAPTION_GET_PRIVATE(widget);
-
-  /* Position the caption to its allocated location */
-  if( GTK_WIDGET_REALIZED(widget) )
-    gdk_window_move_resize (widget->window,
-                               allocation->x + GTK_CONTAINER (widget)->border_width,
-                               allocation->y + GTK_CONTAINER (widget)->border_width,
-                               MAX (allocation->width - GTK_CONTAINER (widget)->border_width * 2, 0),
-                               MAX (allocation->height - GTK_CONTAINER (widget)->border_width * 2, 0));
-
-  child = GTK_BIN(widget)->child;
-
-  widget->allocation = *allocation;  
-  gtk_widget_get_child_requisition( priv->caption_area, &req );
-
-  allocA.height = allocB.height = allocation->height;
-  allocA.width  = allocB.width  = allocation->width;
-  allocA.x = allocB.x = allocB.y = allocA.y = 0;
-  
-  /* Center the captioned widget */
-  if( allocA.width > req.width + HILDON_CAPTION_SPACING )
-  {
-    allocA.x += req.width + HILDON_CAPTION_SPACING * 2;
-    allocB.width = req.width;
-  }
-
-  /* Leave at least the space of the HILDON_CAPTION_SPACING in the left */
-  allocB.x = HILDON_CAPTION_SPACING;
-
-  /* Leave room for the other drawable parts of the caption control */
-  allocA.width -= req.width + HILDON_CAPTION_SPACING * 2;
-
-  /* Give the child at least its minimum requisition, unless it is expandable */
-  if( !priv->expand && child && GTK_WIDGET_VISIBLE(child) )
-  {
-    GtkRequisition child_req;
-    gtk_widget_get_child_requisition( child, &child_req );
-    allocA.width  = MIN( allocA.width,  child_req.width  );
-    allocA.height = MIN( allocA.height, child_req.height );
-  }
-
-  /* Ensure there are no negative dimensions */
-  if( allocA.width < 0 )
-  {
-    allocB.width = req.width + allocA.width;
-    allocA.width = 0;
-    allocB.width = MAX (allocB.width, 0);
-  }
-
-  allocA.height = MAX (allocA.height, 0);
-  allocB.height = MAX (allocB.height, 0);
-
-  if (child && GTK_WIDGET_VISIBLE(child) )
-    gtk_widget_size_allocate( child, &allocA );
-
-  gtk_widget_size_allocate( priv->caption_area, &allocB );
+    GtkAllocation allocA;
+    GtkAllocation allocB;
+    GtkRequisition req;
+    GtkWidget *child = NULL;
+    HildonCaptionPrivate *priv = NULL;
+
+    g_assert (HILDON_IS_CAPTION (widget));
+    priv = HILDON_CAPTION_GET_PRIVATE (widget);
+    g_assert (priv);
+
+    /* Position the caption to its allocated location */
+    if (GTK_WIDGET_REALIZED (widget))
+        gdk_window_move_resize (widget->window,
+                allocation->x + GTK_CONTAINER (widget)->border_width,
+                allocation->y + GTK_CONTAINER (widget)->border_width,
+                MAX (allocation->width - GTK_CONTAINER (widget)->border_width * 2, 0),
+                MAX (allocation->height - GTK_CONTAINER (widget)->border_width * 2, 0));
+
+    child = GTK_BIN (widget)->child;
+
+    widget->allocation = *allocation;  
+    gtk_widget_get_child_requisition (priv->caption_area, &req);
+
+    allocA.height = allocB.height = allocation->height;
+    allocA.width  = allocB.width  = allocation->width;
+    allocA.x = allocB.x = allocB.y = allocA.y = 0;
+
+    /* Center the captioned widget */
+    if (allocA.width > req.width + HILDON_CAPTION_SPACING)
+    {
+        allocA.x += req.width + HILDON_CAPTION_SPACING * 2;
+        allocB.width = req.width;
+    }
+
+    /* Leave at least the space of the HILDON_CAPTION_SPACING in the left */
+    allocB.x = HILDON_CAPTION_SPACING;
+
+    /* Leave room for the other drawable parts of the caption control */
+    allocA.width -= req.width + HILDON_CAPTION_SPACING * 2;
+
+    /* Give the child at least its minimum requisition, unless it is expandable */
+    if (! priv->expand && child && GTK_WIDGET_VISIBLE(child))
+    {
+        GtkRequisition child_req;
+        gtk_widget_get_child_requisition (child, &child_req);
+        allocA.width  = MIN (allocA.width,  child_req.width);
+        allocA.height = MIN (allocA.height, child_req.height);
+    }
+
+    /* Ensure there are no negative dimensions */
+    if (allocA.width < 0)
+    {
+        allocB.width = req.width + allocA.width;
+        allocA.width = 0;
+        allocB.width = MAX (allocB.width, 0);
+    }
+
+    allocA.height = MAX (allocA.height, 0);
+    allocB.height = MAX (allocB.height, 0);
+
+    if (child && GTK_WIDGET_VISIBLE(child) )
+        gtk_widget_size_allocate( child, &allocA );
+
+    gtk_widget_size_allocate (priv->caption_area, &allocB);
 }
 
-static void hildon_caption_forall( GtkContainer *container,
-                                   gboolean include_internals,
-                                   GtkCallback callback, gpointer data )
+static void 
+hildon_caption_forall                           (GtkContainer *container,
+                                                 gboolean include_internals,
+                                                 GtkCallback callback, 
+                                                 gpointer data)
 {
-  HildonCaptionPrivate *priv = NULL;
+    HildonCaptionPrivate *priv = NULL;
 
-  g_assert( HILDON_IS_CAPTION(container) );
-  g_assert( callback != NULL );
+    g_assert (HILDON_IS_CAPTION (container));
+    g_assert (callback != NULL);
 
-  priv = HILDON_CAPTION_GET_PRIVATE(container);
+    priv = HILDON_CAPTION_GET_PRIVATE (container);
+    g_assert (priv);
 
-  /* Execute callback for the child widgets */
-  if( GTK_CONTAINER_CLASS(parent_class)->forall )
-    GTK_CONTAINER_CLASS(parent_class)->forall( container, include_internals,
-                                               callback, data );
+    /* Execute callback for the child widgets */
+    if (GTK_CONTAINER_CLASS (parent_class)->forall)
+        GTK_CONTAINER_CLASS (parent_class)->forall (container, include_internals, callback, data);
 
-  if( include_internals )
-    /* Execute callback for the parent box as well */
-    (*callback)( priv->caption_area, data );
+    if (include_internals)
+        /* Execute callback for the parent box as well */
+        (*callback) (priv->caption_area, data);
 }
 
-
 /**
  * hildon_caption_set_sizegroup:
  * @caption : a #HildonCaption
@@ -760,10 +805,11 @@ static void hildon_caption_forall( GtkContainer *container,
  * Sets a #GtkSizeGroup of a given captioned control.
  *
  */
-void hildon_caption_set_size_group( const HildonCaption *self,
-                                    GtkSizeGroup *group )
+void 
+hildon_caption_set_size_group                   (const HildonCaption *self,
+                                                 GtkSizeGroup *group)
 {
-  g_object_set( G_OBJECT(self), "size_group", group, NULL );
+    g_object_set (G_OBJECT(self), "size_group", group, NULL);
 }
 
 /**
@@ -775,12 +821,16 @@ void hildon_caption_set_size_group( const HildonCaption *self,
  * @Returns : a #GtkSizeGroup
  * 
  */
-GtkSizeGroup *hildon_caption_get_size_group( const HildonCaption *self )
+GtkSizeGroup*
+hildon_caption_get_size_group                   (const HildonCaption *self)
 {
-  HildonCaptionPrivate *priv;
-  g_return_val_if_fail( HILDON_IS_CAPTION (self), NULL );
-  priv = HILDON_CAPTION_GET_PRIVATE(self);
-  return priv->group;
+    HildonCaptionPrivate *priv;
+    g_return_val_if_fail (HILDON_IS_CAPTION (self), NULL);
+
+    priv = HILDON_CAPTION_GET_PRIVATE(self);
+    g_assert (priv);
+
+    return priv->group;
 }
 
 /**
@@ -803,18 +853,25 @@ GtkSizeGroup *hildon_caption_get_size_group( const HildonCaption *self )
  * 
  * @Returns : a #GtkWidget pointer of Caption
  */
-GtkWidget *hildon_caption_new( GtkSizeGroup *group, const gchar *value,
-                               GtkWidget *child, GtkWidget *icon,
-                               HildonCaptionStatus flag)
+GtkWidget*
+hildon_caption_new                              (GtkSizeGroup *group, 
+                                                 const gchar *value,
+                                                 GtkWidget *child, 
+                                                 GtkWidget *icon,
+                                                 HildonCaptionStatus flag)
 {
-  GtkWidget *widget;
-  g_return_val_if_fail( GTK_IS_WIDGET(child), NULL );
-  
-  widget = g_object_new( HILDON_TYPE_CAPTION, "label", value,
-                       "child" /* From GtkContainer */, child, "size_group", group, "icon", icon, "status", flag,
-                        NULL );
-
-  return widget;
+    GtkWidget *widget;
+    g_return_val_if_fail (GTK_IS_WIDGET (child), NULL);
+
+    widget = g_object_new (HILDON_TYPE_CAPTION, 
+            "label", value,
+            "child", child, 
+            "size_group", group, 
+            "icon", icon, 
+            "status", flag,
+            NULL);
+
+    return widget;
 }
 
 /**
@@ -825,14 +882,17 @@ GtkWidget *hildon_caption_new( GtkSizeGroup *group, const gchar *value,
  *
  * @Returns : is this captioned control a mandatory one?
  */
-
-gboolean hildon_caption_is_mandatory( const HildonCaption *caption )
+gboolean 
+hildon_caption_is_mandatory                     (const HildonCaption *caption)
 {
-  HildonCaptionPrivate *priv;
-  g_return_val_if_fail( HILDON_IS_CAPTION(caption), FALSE );
-  priv = HILDON_CAPTION_GET_PRIVATE(caption);
+    HildonCaptionPrivate *priv;
+
+    g_return_val_if_fail (HILDON_IS_CAPTION (caption), FALSE);
 
-  return priv->status == HILDON_CAPTION_MANDATORY;
+    priv = HILDON_CAPTION_GET_PRIVATE (caption);
+    g_assert (priv);
+
+    return (priv->status == HILDON_CAPTION_MANDATORY);
 }
 
 /**
@@ -842,20 +902,21 @@ gboolean hildon_caption_is_mandatory( const HildonCaption *caption )
  *
  * Sets #HildonCaption icon position.
  *
- * Since: 0.14.5
  */
-
-void hildon_caption_set_icon_position( HildonCaption *caption,
-                               HildonCaptionIconPosition pos )
+void 
+hildon_caption_set_icon_position                (HildonCaption *caption,
+                                                 HildonCaptionIconPosition pos)
 {
-  g_return_if_fail (HILDON_IS_CAPTION (caption));
-  HildonCaptionPrivate *priv = HILDON_CAPTION_GET_PRIVATE(caption);
+    g_return_if_fail (HILDON_IS_CAPTION (caption));
+    HildonCaptionPrivate *priv = HILDON_CAPTION_GET_PRIVATE (caption);
+    g_assert (priv);
 
-  g_return_if_fail (priv->caption_area != NULL);
-  int order = (pos == HILDON_CAPTION_POSITION_LEFT) ? -1 : 0;
-  gtk_box_reorder_child (GTK_BOX (priv->caption_area), priv->icon_align, order);
+    g_return_if_fail (priv->caption_area != NULL);
+    
+    int order = (pos == HILDON_CAPTION_POSITION_LEFT) ? -1 : 0;
+    gtk_box_reorder_child (GTK_BOX (priv->caption_area), priv->icon_align, order);
 
-  priv->icon_position = pos;
+    priv->icon_position = pos;
 }
 
 /**
@@ -866,15 +927,17 @@ void hildon_caption_set_icon_position( HildonCaption *caption,
  *
  * @Returns : one of the values from #HildonCaptionIconPosition.
  *
- * Since: 0.14.5
  */
 
-HildonCaptionIconPosition hildon_caption_get_icon_position( const HildonCaption *caption )
+HildonCaptionIconPosition 
+hildon_caption_get_icon_position                (const HildonCaption *caption)
 {
-  g_return_val_if_fail (HILDON_IS_CAPTION (caption), 0);
-  HildonCaptionPrivate *priv = HILDON_CAPTION_GET_PRIVATE(caption);
+    g_return_val_if_fail (HILDON_IS_CAPTION (caption), 0);
+
+    HildonCaptionPrivate *priv = HILDON_CAPTION_GET_PRIVATE (caption);
+    g_assert (priv);
 
-  return priv->icon_position;
+    return priv->icon_position;
 }
 
 /**
@@ -884,13 +947,13 @@ HildonCaptionIconPosition hildon_caption_get_icon_position( const HildonCaption
  *
  * Sets #HildonCaption status.
  */
-
-void hildon_caption_set_status( HildonCaption *caption,
-                                HildonCaptionStatus flag )
+void 
+hildon_caption_set_status                       (HildonCaption *caption,
+                                                 HildonCaptionStatus flag)
 {
-  g_return_if_fail( HILDON_IS_CAPTION(caption) );
+    g_return_if_fail (HILDON_IS_CAPTION(caption));
 
-  g_object_set( G_OBJECT(caption), "status", flag, NULL );
+    g_object_set (G_OBJECT(caption), "status", flag, NULL);
 }
 
 /**
@@ -901,14 +964,16 @@ void hildon_caption_set_status( HildonCaption *caption,
  *
  * @Returns : one of the values from #HildonCaptionStatus
  */
-
-HildonCaptionStatus hildon_caption_get_status( const HildonCaption *caption )
+HildonCaptionStatus 
+hildon_caption_get_status                       (const HildonCaption *caption)
 {
-  HildonCaptionPrivate *priv;
-  g_return_val_if_fail( HILDON_IS_CAPTION(caption), HILDON_CAPTION_OPTIONAL );
-  priv = HILDON_CAPTION_GET_PRIVATE(caption);
+    HildonCaptionPrivate *priv;
+    g_return_val_if_fail (HILDON_IS_CAPTION (caption), HILDON_CAPTION_OPTIONAL);
+
+    priv = HILDON_CAPTION_GET_PRIVATE(caption);
+    g_assert (priv);
 
-  return priv->status;
+    return priv->status;
 }
 
 /**
@@ -917,14 +982,15 @@ HildonCaptionStatus hildon_caption_get_status( const HildonCaption *caption )
  * @icon : the #GtkImage to use as the icon. 
  *         calls gtk_widget_show on the icon if !GTK_WIDGET_VISIBLE(icon)
  *
- * Sets the icon to be used by this hildon_caption widget.
+ * Sets the icon image widget to be used by this hildon_caption widget.
  */
-
-void hildon_caption_set_icon_image( HildonCaption *caption, GtkWidget *icon )
+void 
+hildon_caption_set_icon_image                   (HildonCaption *caption, 
+                                                 GtkWidget *icon)
 {
-  g_return_if_fail( HILDON_IS_CAPTION(caption) );
+    g_return_if_fail (HILDON_IS_CAPTION(caption));
 
-  g_object_set( G_OBJECT(caption), "icon", icon, NULL );
+    g_object_set (G_OBJECT(caption), "icon", icon, NULL);
 }
 
 /**
@@ -933,17 +999,20 @@ void hildon_caption_set_icon_image( HildonCaption *caption, GtkWidget *icon )
  *
  * Gets icon of #HildonCaption
  *
- * @Returns : the #GtkImage that is being used as the icon by the
- *            hildon_caption, or NULL if no icon is in use
+ * @Returns : the #GtkImage widget that is being used as the icon by the
+ *            hildon_caption, or NULL if no icon image is in use.
  */
-
-GtkWidget *hildon_caption_get_icon_image( const HildonCaption *caption )
+GtkWidget*
+hildon_caption_get_icon_image                   (const HildonCaption *caption)
 {
-  HildonCaptionPrivate *priv;
-  g_return_val_if_fail( HILDON_IS_CAPTION(caption), NULL );
-  priv = HILDON_CAPTION_GET_PRIVATE(caption);
+    HildonCaptionPrivate *priv;
+
+    g_return_val_if_fail (HILDON_IS_CAPTION (caption), NULL);
+
+    priv = HILDON_CAPTION_GET_PRIVATE (caption);
+    g_assert (priv);
 
-  return priv->icon;
+    return priv->icon;
 }
 
 /**
@@ -955,12 +1024,13 @@ GtkWidget *hildon_caption_get_icon_image( const HildonCaption *caption )
  * Separator character is added to the end of the label string. By default
  * the separator is ":".
  */
-
-void hildon_caption_set_label( HildonCaption *caption, const gchar *label )
+void 
+hildon_caption_set_label                        (HildonCaption *caption, 
+                                                 const gchar *label)
 {
-  g_return_if_fail( HILDON_IS_CAPTION(caption) );
+    g_return_if_fail (HILDON_IS_CAPTION(caption));
 
-  g_object_set( G_OBJECT(caption), "label", label, NULL );
+    g_object_set (G_OBJECT(caption), "label", label, NULL);
 }
 
 /**
@@ -973,14 +1043,15 @@ void hildon_caption_set_label( HildonCaption *caption, const gchar *label )
  *  control. The string is owned by the label and the caller should never 
  *  free or modify this value.
  */
-
-gchar *hildon_caption_get_label( const HildonCaption *caption )
+gchar*
+hildon_caption_get_label                        (const HildonCaption *caption)
 {
-  HildonCaptionPrivate *priv;
-  g_return_val_if_fail(HILDON_IS_CAPTION(caption), "");
-  priv = HILDON_CAPTION_GET_PRIVATE(caption);
+    HildonCaptionPrivate *priv;
+    g_return_val_if_fail (HILDON_IS_CAPTION (caption), "");
+    priv = HILDON_CAPTION_GET_PRIVATE (caption);
+    g_assert (priv);
 
-  return (gchar*)gtk_label_get_text(GTK_LABEL(GTK_LABEL(priv->label)));
+    return (gchar*) gtk_label_get_text (GTK_LABEL (GTK_LABEL (priv->label)));
 }
 
 /**
@@ -992,13 +1063,12 @@ gchar *hildon_caption_get_label( const HildonCaption *caption )
  * The default seaparator character is ":"
  * separately.
  */
-
-void hildon_caption_set_separator( HildonCaption *caption, 
-                                   const gchar *separator )
+void hildon_caption_set_separator               (HildonCaption *caption, 
+                                                 const gchar *separator)
 {
-  g_return_if_fail( HILDON_IS_CAPTION(caption) );
+    g_return_if_fail (HILDON_IS_CAPTION (caption));
 
-  g_object_set( G_OBJECT(caption), "separator", separator, NULL );
+    g_object_set (G_OBJECT (caption), "separator", separator, NULL);
 }
 
 /**
@@ -1011,30 +1081,30 @@ void hildon_caption_set_separator( HildonCaption *caption,
  *  control. The string is owned by the caption control and the caller should
  *  never free or modify this value.   
  */
-
-gchar *hildon_caption_get_separator( const HildonCaption *caption )
+gchar*
+hildon_caption_get_separator                    (const HildonCaption *caption)
 {
-  HildonCaptionPrivate *priv;
-  g_return_val_if_fail(HILDON_IS_CAPTION(caption), "");
-  priv = HILDON_CAPTION_GET_PRIVATE(caption);
+    HildonCaptionPrivate *priv;
+    g_return_val_if_fail (HILDON_IS_CAPTION (caption), "");
+
+    priv = HILDON_CAPTION_GET_PRIVATE (caption);
+    g_assert (priv);
 
-  return priv->separator;
+    return priv->separator;
 }
 
-/*activates the child control
- *We have this signal so that if needed an application can 
- *know when we've been activated (useful for captions with
- *multiple children
+/* Activates the child control
+ * We have this signal so that if needed an application can 
+ * know when we've been activated (useful for captions with
+ * multiple children
+ * FIXME: There never are multiple children. Possibly activate
+ *  signal could be removed entirely? (does anyone use it?) 
  */
-/* FIXME: There never are multiple children. Possibly activate
-   signal could be removed entirely? (does anyone use it?) */
-static void hildon_caption_activate( GtkWidget *widget )
+static void 
+hildon_caption_activate                         (GtkWidget *widget)
 {
-  HildonCaptionPrivate *priv;
-  GtkWidget *child = GTK_BIN(widget)->child;
-  priv = HILDON_CAPTION_GET_PRIVATE(widget);
-
-  gtk_widget_grab_focus( child );
+    GtkWidget *child = GTK_BIN (widget)->child;
+    gtk_widget_grab_focus (child);
 }
 
 /**
@@ -1044,29 +1114,32 @@ static void hildon_caption_activate( GtkWidget *widget )
  *
  * Sets child expandability.
  */
-void hildon_caption_set_child_expand( HildonCaption *caption, gboolean expand )
+void 
+hildon_caption_set_child_expand                 (HildonCaption *caption, 
+                                                 gboolean expand)
 {
-  HildonCaptionPrivate *priv = NULL;
-  GtkWidget *child = NULL;
-  g_return_if_fail( HILDON_IS_CAPTION(caption) );
+    HildonCaptionPrivate *priv = NULL;
+    GtkWidget *child = NULL;
+    g_return_if_fail (HILDON_IS_CAPTION (caption));
 
-  priv = HILDON_CAPTION_GET_PRIVATE(caption);
+    priv = HILDON_CAPTION_GET_PRIVATE (caption);
+    g_assert (priv);
 
-  /* Did the setting really change? */
-  if( priv->expand == expand )
-    return;
+    /* Did the setting really change? */
+    if (priv->expand == expand)
+        return;
 
-  priv->expand = expand;
-  child = GTK_BIN(caption)->child;
+    priv->expand = expand;
+    child = GTK_BIN (caption)->child;
 
-  /* We do not have a child, nothing to do */
-  if( !GTK_IS_WIDGET(child) )
-    return;
+    /* We do not have a child, nothing to do */
+    if (! GTK_IS_WIDGET (child))
+        return;
 
-  if( GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_VISIBLE (caption) )
-    gtk_widget_queue_resize( child );
+    if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_VISIBLE (caption))
+        gtk_widget_queue_resize (child);
 
-  gtk_widget_child_notify( child, "expand" );
+    gtk_widget_child_notify (child, "expand");
 }
 
 /**
@@ -1077,47 +1150,51 @@ void hildon_caption_set_child_expand( HildonCaption *caption, gboolean expand )
  *
  * @Returns : wheter the child is expandable or not.
  */
-gboolean hildon_caption_get_child_expand( const HildonCaption *caption )
+gboolean 
+hildon_caption_get_child_expand                 (const HildonCaption *caption)
 {
-  HildonCaptionPrivate *priv = NULL;
-  g_return_val_if_fail( HILDON_IS_CAPTION(caption), FALSE );
-  priv = HILDON_CAPTION_GET_PRIVATE(caption);
-  return priv->expand;
+    HildonCaptionPrivate *priv = NULL;
+    g_return_val_if_fail (HILDON_IS_CAPTION (caption), FALSE);
+
+    priv = HILDON_CAPTION_GET_PRIVATE (caption);
+    g_assert (priv);
+
+    return priv->expand;
 }
 
 static void
-hildon_caption_set_label_text( HildonCaptionPrivate *priv )
+hildon_caption_set_label_text                   (HildonCaptionPrivate *priv)
 {
-  gchar *tmp = NULL;
-  g_assert ( priv != NULL );
+    gchar *tmp = NULL;
+    g_assert (priv != NULL);
 
-  if ( priv->text )
-  {
-    if( priv->separator )
+    if (priv->text)
     {
-      /* Don't duplicate the separator, if the string already contains one */
-      if (g_str_has_suffix(priv->text, priv->separator))
-      {
-        gtk_label_set_text( GTK_LABEL( priv->label ), priv->text );
-      }
-      else
-      {
-        /* Append separator and set text */
-        tmp = g_strconcat( priv->text, priv->separator, NULL );
-        gtk_label_set_text( GTK_LABEL( priv->label ), tmp );
-        g_free( tmp );
-      }
+        if (priv->separator)
+        {
+            /* Don't duplicate the separator, if the string already contains one */
+            if (g_str_has_suffix (priv->text, priv->separator))
+            {
+                gtk_label_set_text (GTK_LABEL (priv->label), priv->text);
+            }
+            else
+            {
+                /* Append separator and set text */
+                tmp = g_strconcat( priv->text, priv->separator, NULL );
+                gtk_label_set_text (GTK_LABEL( priv->label), tmp);
+                g_free (tmp);
+            }
+        }
+        else
+        {
+            gtk_label_set_text (GTK_LABEL (priv->label), priv->text);
+        }
     }
     else
     {
-      gtk_label_set_text( GTK_LABEL( priv->label ), priv->text );
+        /* Clear the label */
+        gtk_label_set_text (GTK_LABEL (priv->label), "" );
     }
-  }
-  else
-  {
-    /* Clear the label */
-    gtk_label_set_text( GTK_LABEL( priv->label ), "" );
-  }
 
 }
 
@@ -1130,18 +1207,20 @@ hildon_caption_set_label_text( HildonCaptionPrivate *priv )
  * text part of the caption. Applications need to
  * align the child control themselves.
  *
- * Since: 0.12.0
  */   
-void hildon_caption_set_label_alignment(HildonCaption *caption, 
-                                        gfloat alignment)
+void 
+hildon_caption_set_label_alignment              (HildonCaption *caption, 
+                                                 gfloat alignment)
 {
-  HildonCaptionPrivate *priv;
+    HildonCaptionPrivate *priv;
+
+    g_return_if_fail (HILDON_IS_CAPTION (caption));
 
-  g_return_if_fail(HILDON_IS_CAPTION(caption));
+    priv = HILDON_CAPTION_GET_PRIVATE (caption);
+    g_assert (priv);
 
-  priv = HILDON_CAPTION_GET_PRIVATE(caption);
-  g_object_set(priv->label, "yalign", alignment, NULL);
-  g_object_set(priv->icon_align, "yalign", alignment, NULL);
+    g_object_set (priv->label, "yalign", alignment, NULL);
+    g_object_set (priv->icon_align, "yalign", alignment, NULL);
 
 }
 
@@ -1153,16 +1232,18 @@ void hildon_caption_set_label_alignment(HildonCaption *caption,
  *
  * Returns: vertical alignment
  *
- * Since: 0.12.0
  */
-gfloat hildon_caption_get_label_alignment(HildonCaption *caption)
+gfloat 
+hildon_caption_get_label_alignment              (HildonCaption *caption)
 {
-  HildonCaptionPrivate *priv;
-  gfloat result;
+    HildonCaptionPrivate *priv;
+    gfloat result;
+
+    g_return_val_if_fail (HILDON_IS_CAPTION (caption), 0);
+    priv = HILDON_CAPTION_GET_PRIVATE (caption);
+    g_assert (priv);
 
-  g_return_val_if_fail( HILDON_IS_CAPTION(caption), 0);
-  priv = HILDON_CAPTION_GET_PRIVATE(caption);
-  g_object_get(priv->label, "yalign", &result, NULL);
+    g_object_get (priv->label, "yalign", &result, NULL);
 
-  return result;
+    return result;
 }
index d36ab93..f03a4c7 100644 (file)
  *
  */
  
-#ifndef __HILDON_CAPTION_H__
-#define __HILDON_CAPTION_H__
+#ifndef                                         __HILDON_CAPTION_H__
+#define                                         __HILDON_CAPTION_H__
 
-#include <glib.h>
-#include <glib-object.h>
-#include <gtk/gtkeventbox.h>
-#include <gtk/gtksizegroup.h>
-#include "hildon-enum-types.h"
+#include                                        <glib.h>
+#include                                        <glib-object.h>
+#include                                        <gtk/gtkeventbox.h>
+#include                                        <gtk/gtksizegroup.h>
+#include                                        "hildon-enum-types.h"
 
 G_BEGIN_DECLS
 
+typedef struct                                  _HildonCaption HildonCaption;
 
-#define HILDON_TYPE_CAPTION ( hildon_caption_get_type() )
-#define HILDON_CAPTION(obj) \
-    (GTK_CHECK_CAST (obj, HILDON_TYPE_CAPTION, HildonCaption))
-#define HILDON_CAPTION_CLASS(klass) \
-    (GTK_CHECK_CLASS_CAST ((klass),\
-     HILDON_TYPE_CAPTION, HildonCaptionClass))
-#define HILDON_IS_CAPTION(obj) (GTK_CHECK_TYPE (obj, HILDON_TYPE_CAPTION))
-#define HILDON_IS_CAPTION_CLASS(klass) \
-    (GTK_CHECK_CLASS_TYPE ((klass), HILDON_TYPE_CAPTION))
+typedef struct                                  _HildonCaptionClass HildonCaptionClass;
 
+#define                                         HILDON_TYPE_CAPTION (hildon_caption_get_type())
+
+#define                                         HILDON_CAPTION(obj) \
+                                                (GTK_CHECK_CAST (obj, HILDON_TYPE_CAPTION, HildonCaption))
+
+#define                                         HILDON_CAPTION_CLASS(klass) \
+                                                (GTK_CHECK_CLASS_CAST ((klass),\
+                                                HILDON_TYPE_CAPTION, HildonCaptionClass))
+
+#define                                         HILDON_IS_CAPTION(obj) \
+                                                (GTK_CHECK_TYPE (obj, HILDON_TYPE_CAPTION))
+
+#define                                         HILDON_IS_CAPTION_CLASS(klass) \
+                                                (GTK_CHECK_CLASS_TYPE ((klass), HILDON_TYPE_CAPTION))
     
 /**
  * HildonCaptionStatus:
@@ -56,7 +63,7 @@ typedef enum
 {
     HILDON_CAPTION_OPTIONAL = 0,
     HILDON_CAPTION_MANDATORY
-} HildonCaptionStatus;
+}                                               HildonCaptionStatus;
 
 /**
  * HildonCaptionIconPosition:
@@ -71,72 +78,90 @@ typedef enum
 {
     HILDON_CAPTION_POSITION_LEFT = 0,
     HILDON_CAPTION_POSITION_RIGHT
-} HildonCaptionIconPosition;
-
-/**
- * HildonCaption:
- *
- * Contains only private data.
- */
-typedef struct _HildonCaption HildonCaption;
-typedef struct _HildonCaptionClass HildonCaptionClass;
+}                                               HildonCaptionIconPosition;
 
 
-struct _HildonCaption
+struct                                          _HildonCaption
 {
-  GtkEventBox event_box;
+    GtkEventBox parent;
 };
 
 
-struct _HildonCaptionClass
+struct                                          _HildonCaptionClass
 {
-  GtkEventBoxClass parent_class;
-  void (*activate) (HildonCaption *widget);
+    GtkEventBoxClass parent_class;
+    void (*activate) (HildonCaption *widget);
 };
 
+GType G_GNUC_CONST
+hildon_caption_get_type                         (void);
 
-GType hildon_caption_get_type (void) G_GNUC_CONST;
+GtkWidget* 
+hildon_caption_new                              (GtkSizeGroup *group, 
+                                                 const gchar *value,
+                                                 GtkWidget *control, 
+                                                 GtkWidget *icon,
+                                                 HildonCaptionStatus flag);
 
-GtkWidget *hildon_caption_new( GtkSizeGroup *group, const gchar *value,
-                               GtkWidget *control, GtkWidget *icon,
-                               HildonCaptionStatus flag );
+GtkSizeGroup*
+hildon_caption_get_size_group                   (const HildonCaption *caption);
 
-GtkSizeGroup *hildon_caption_get_size_group( const HildonCaption *caption );
+void 
+hildon_caption_set_size_group                   (const HildonCaption *caption,
+                                                 GtkSizeGroup *new_group );
 
-void hildon_caption_set_size_group( const HildonCaption *caption,
-                                    GtkSizeGroup *new_group );
+gboolean 
+hildon_caption_is_mandatory                     (const HildonCaption *caption);
 
-gboolean hildon_caption_is_mandatory( const HildonCaption *caption );
+void 
+hildon_caption_set_status                       (HildonCaption *caption,
+                                                 HildonCaptionStatus flag);
 
-void hildon_caption_set_status( HildonCaption *caption,
-                               HildonCaptionStatus flag );
+HildonCaptionStatus
+hildon_caption_get_status                       (const HildonCaption *caption);
 
-HildonCaptionStatus hildon_caption_get_status( const HildonCaption *caption );
+void 
+hildon_caption_set_icon_position                (HildonCaption *caption,
+                                                 HildonCaptionIconPosition pos );
 
-void hildon_caption_set_icon_position( HildonCaption *caption,
-                               HildonCaptionIconPosition pos );
+HildonCaptionIconPosition
+hildon_caption_get_icon_position                (const HildonCaption *caption);
 
-HildonCaptionIconPosition hildon_caption_get_icon_position( const HildonCaption *caption );
+void
+hildon_caption_set_icon_image                   (HildonCaption *caption, 
+                                                 GtkWidget *icon);
 
-void hildon_caption_set_icon_image( HildonCaption *caption, GtkWidget *icon );
+GtkWidget*
+hildon_caption_get_icon_image                   (const HildonCaption *caption);
 
-GtkWidget *hildon_caption_get_icon_image(const HildonCaption *caption);
+void
+hildon_caption_set_label                        (HildonCaption *caption, 
+                                                 const gchar *label );
 
-void hildon_caption_set_label( HildonCaption *caption, const gchar *label );
+gchar*
+hildon_caption_get_label                        (const HildonCaption *caption);
 
-gchar *hildon_caption_get_label( const HildonCaption *caption );
+void 
+hildon_caption_set_separator                    (HildonCaption *caption, 
+                                                 const gchar *separator);
 
-void hildon_caption_set_separator( HildonCaption *caption, 
-                                    const gchar *separator );
+gchar*
+hildon_caption_get_separator                    (const HildonCaption *caption);
 
-gchar *hildon_caption_get_separator( const HildonCaption *caption );
+void 
+hildon_caption_set_label_alignment              (HildonCaption *caption, 
+                                                 gfloat alignment);
 
-void hildon_caption_set_label_alignment(HildonCaption *caption, 
-                                        gfloat alignment);
-gfloat hildon_caption_get_label_alignment(HildonCaption *caption);
+gfloat 
+hildon_caption_get_label_alignment              (HildonCaption *caption);
 
-void hildon_caption_set_child_expand( HildonCaption *caption, gboolean expand );
-gboolean hildon_caption_get_child_expand( const HildonCaption *caption );
+void 
+hildon_caption_set_child_expand                 (HildonCaption *caption, 
+                                                 gboolean expand);
+
+gboolean 
+hildon_caption_get_child_expand                 (const HildonCaption *caption);
 
 G_END_DECLS
-#endif /* __HILDON_CAPTION_H__ */
+
+#endif                                          /* __HILDON_CAPTION_H__ */