/*
* This file is a part of hildon
*
* Copyright (C) 2005, 2006 Nokia Corporation, all rights reserved.
*
* Contact: Rodrigo Novo <rodrigo.novo@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, or (at your option) any later version.
*
* 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
*
*/
/**
* SECTION:hildon-caption
* @short_description: A single-child container widget that precedes the
* contained widget with a field label and an optional icon.
*
* #HildonCaption is a single-child container widget that precedes the
* contained widget with a field label and an optional icon. It allows
* grouping of several controls together. When a captioned widget has focus,
* both widget and caption label are displayed with active focus.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <libintl.h>
#include <gtk/gtk.h>
#include "hildon-defines.h"
#include "hildon-caption.h"
#include "hildon-caption-private.h"
#define _(String)\
dgettext("hildon-libs", 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_get_preferred_width (GtkWidget *widget,
gint *minimal_width,
gint *natural_width);
static void
hildon_caption_get_preferred_height (GtkWidget *widget,
gint *minimal_height,
gint *natural_height);
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_grab_focus (GtkWidget *widget);
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 void
hildon_caption_destroy (GtkWidget *self);
static gboolean
hildon_caption_button_press (GtkWidget *widget,
GdkEventButton *event);
static void
hildon_caption_set_label_text (HildonCaptionPrivate *priv,
gboolean markup);
static void
hildon_caption_set_child_property (GtkContainer *container,
GtkWidget *child,
guint property_id,