/* GTK - The GIMP Toolkit
 * Copyright (C) 2010 Tristan Van Berkom <tristan.van.berkom@gmail.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 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
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
#endif

#ifndef __GTK_COMPOSITE_H__
#define __GTK_COMPOSITE_H__


#include <gtk/gtkbin.h>


G_BEGIN_DECLS


/**
 * GTK_TYPE_PARAM_COMPOSITE:
 * 
 * The #GType of #GtkParamSpecComposite.
 */
#define	GTK_TYPE_PARAM_COMPOSITE   (gtk_param_composite_get_type())

/**
 * GTK_IS_PARAM_SPEC_COMPOSITE:
 * @pspec: a valid #GParamSpec instance
 * 
 * Checks whether the given #GParamSpec is of type %GTK_TYPE_PARAM_COMPOSITE.
 * 
 * Returns: %TRUE on success.
 */
#define GTK_IS_PARAM_SPEC_COMPOSITE(pspec)				\
  (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GTK_TYPE_PARAM_COMPOSITE))

/**
 * GTK_PARAM_SPEC_COMPOSITE:
 * @pspec: a valid #GParamSpec instance
 * 
 * Casts a #GParamSpec instance into a #GtkParamSpecComposite.
 */
#define GTK_PARAM_SPEC_COMPOSITE(pspec)					\
  (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GTK_TYPE_PARAM_COMPOSITE, GtkParamSpecComposite))


#define GTK_TYPE_COMPOSITE              (gtk_composite_get_type ())
#define GTK_COMPOSITE(obj)              (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_COMPOSITE, GtkComposite))
#define GTK_COMPOSITE_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_COMPOSITE, GtkCompositeClass))
#define GTK_IS_COMPOSITE(obj)           (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_COMPOSITE))
#define GTK_IS_COMPOSITE_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_COMPOSITE))
#define GTK_COMPOSITE_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_COMPOSITE, GtkCompositeClass))

typedef struct _GtkComposite	      GtkComposite;
typedef struct _GtkCompositeClass     GtkCompositeClass;

typedef struct _GtkParamSpecComposite GtkParamSpecComposite;

/**
 * GtkParamSpecComposite:
 * @parent_instance: private #GParamSpec portion
 * 
 * A #GParamSpec derived structure that contains the meta data for composite child object properties.
 */
struct _GtkParamSpecComposite
{
  GParamSpec    parent_instance;
};

struct _GtkComposite
{
  GtkBin bin;
};

struct _GtkCompositeClass
{
  GtkBinClass parent_class;

  gchar *GSEAL (template);
  gchar *GSEAL (template_file);

  /* Padding for future expansion */
  void (*_gtk_reserved1) (void);
  void (*_gtk_reserved2) (void);
  void (*_gtk_reserved3) (void);
  void (*_gtk_reserved4) (void);
  void (*_gtk_reserved5) (void);
  void (*_gtk_reserved6) (void);
  void (*_gtk_reserved7) (void);
  void (*_gtk_reserved8) (void);
};

GType       gtk_param_composite_get_type            (void) G_GNUC_CONST;
GParamSpec *gtk_param_spec_composite                (const gchar	 *name,
						     const gchar	 *nick,
						     const gchar	 *blurb,
						     GType		  object_type,
						     GParamFlags	  flags);


GType       gtk_composite_get_type                  (void) G_GNUC_CONST;


/* Used by concrete classes to setup the GtkBuilder template */
void        gtk_composite_class_use_parent_template (GtkCompositeClass *composite_class);
void        gtk_composite_class_set_template        (GtkCompositeClass *composite_class,
						     const gchar       *template);
void        gtk_composite_class_set_template_file   (GtkCompositeClass *composite_class,
						     const gchar       *template_file);

G_END_DECLS

#endif /* __GTK_COMPOSITE_H__ */
