/*   EXTRAITS DE LA LICENCE
	Copyright CEA, contributeurs : Luc BILLARD et Damien
	CALISTE, laboratoire L_Sim, (2001-2006)
  
	Adresse mèl :
	BILLARD, non joignable par mèl ;
	CALISTE, damien P caliste AT cea P fr.

	Ce logiciel est un programme informatique servant à visualiser des
	structures atomiques dans un rendu pseudo-3D. 

	Ce logiciel est régi par la licence CeCILL soumise au droit français et
	respectant les principes de diffusion des logiciels libres. Vous pouvez
	utiliser, modifier et/ou redistribuer ce programme sous les conditions
	de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA 
	sur le site "http://www.cecill.info".

	Le fait que vous puissiez accéder à cet en-tête signifie que vous avez 
	pris connaissance de la licence CeCILL, et que vous en avez accepté les
	termes (cf. le fichier Documentation/licence.fr.txt fourni avec ce logiciel).
*/

/*   LICENCE SUM UP
	Copyright CEA, contributors : Luc BILLARD et Damien
	CALISTE, laboratoire L_Sim, (2001-2006)

	E-mail address:
	BILLARD, not reachable any more ;
	CALISTE, damien P caliste AT cea P fr.

	This software is a computer program whose purpose is to visualize atomic
	configurations in 3D.

	This software is governed by the CeCILL  license under French law and
	abiding by the rules of distribution of free software.  You can  use, 
	modify and/ or redistribute the software under the terms of the CeCILL
	license as circulated by CEA, CNRS and INRIA at the following URL
	"http://www.cecill.info". 

	The fact that you are presently reading this means that you have had
	knowledge of the CeCILL license and that you accept its terms. You can
	find a copy of this licence shipped with this software at Documentation/licence.en.txt.
*/
#ifndef GTK_COLORCOMBOBOXWIDGET_H
#define GTK_COLORCOMBOBOXWIDGET_H

#include <glib.h>
#include <glib-object.h>

#include <gtk/gtkcombobox.h>
#include <gtk/gtkliststore.h>

#include <visu_tools.h>

G_BEGIN_DECLS
/**
 * COLOR_COMBOX_TYPE
 *
 * Return the associated #GType to the ColorComboBox objects.
 */
#define COLOR_COMBOX_TYPE         (colorComboBox_get_type ())
/**
 * COLOR_COMBOX:
 *
 * Cast the given object to a #ColorComboBox object.
 */
#define COLOR_COMBOX(obj)         (G_TYPE_CHECK_INSTANCE_CAST ((obj), COLOR_COMBOX_TYPE, ColorComboBox))
/**
 * COLOR_COMBOX_CLASS
 *
 * Cast the given class to a #ColorComboBoxClass object.
 */
#define COLOR_COMBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), COLOR_COMBOX_TYPE, ColorComboBoxClass))
/**
 * IS_COLOR_COMBOX
 *
 * Return if the given object is a valid #ColorComboBox object.
 */
#define IS_COLOR_COMBOX(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), COLOR_COMBOX_TYPE))
/**
 * IS_COLOR_COMBOX_CLASS
 *
 * Return if the given class is a valid #ColorComboBoxClass class.
 */
#define IS_COLOR_COMBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), COLOR_COMBOX_TYPE))

/**
 * ColorComboBox_struct
 *
 * Private structure to store informations of a #ColorComboBox object.
 */
struct ColorComboBox_struct;
/**
 * ColorComboBoxClass_struct
 *
 * Private structure to store informations of a #ColorComboBoxClass object.
 */
struct ColorComboBoxClass_struct;

/**
 * ColorComboBox
 *
 * Short form for a #ColorComboBox_struct structure.
 */
typedef struct ColorComboBox_struct        ColorComboBox;
/* typedef struct ColorComboBoxPrivate_struct ColorComboBoxPrivate; */
/**
 * ColorComboBoxClass
 *
 * Short form for a #ColorComboBoxClass_struct structure.
 */
typedef struct ColorComboBoxClass_struct   ColorComboBoxClass;

/**
 * colorComboBox_get_type
 *
 * #GType are unique numbers to identify objects.
 *
 * Returns: the #GType associated with #ColorComboBox objects.
 */
GType          colorComboBox_get_type        (void);
/**
 * colorComboBox_new :
 * @hasAlphaChannel : a boolean.
 *
 * A #ColorComboBox widget is like a #GtkComboBox widget, but it is already filled
 * with the colors stores in the structures adhoc in visu_tools.h. Using this widget
 * is a convienient way to share colors between all part of V_Sim and to give a consistent
 * look of all color selection. If the argument @hasAlphaChannel is FALSE, the widget
 * display all colors but without their alpha channel, assuming it to be fully opaque.
 *
 * Returns: a newly created #ColorComboBox widget.
 */
GtkWidget*     colorComboBox_new             (gboolean hasAlphaChannel);
/**
 * colorComboBoxSet_selectionByColor:
 * @colorComboBox: a #ColorComboBox widget ;
 * @color: a #Color object.
 *
 * Use this method to set the ComboBox on the given color. This emits a 'color-channel'
 * signal if the color is changed, which means, a previous color has been modified,
 * or a new color is selected.
 *
 * Returns: TRUE if the @color already exists in the model.
 */
gboolean colorComboBoxSet_selectionByColor(ColorComboBox* colorComboBox, Color *color);
/**
 * colorComboBoxGet_selectedPixbuf:
 * @colorComboBox: a #ColorComboBox widget.
 *
 * The @colorComboBox has little pixbufs to represent the color. User methods can
 * use these pixbufs but should considered them read-only.
 *
 * Returns: a pixbuf pointer corresponding to the little image shown on
 *          the @colorComboBox.
 */
GdkPixbuf* colorComboBoxGet_selectedPixbuf(ColorComboBox *colorComboBox);
/**
 * colorComboBoxGet_selectedColor:
 * @colorComboBox: a #ColorComboBox widget.
 *
 * The user can access to the selected #Color object using this method.
 *
 * Returns: a pointer to the selected #Color object (or NULL). This object is read-only.
 */
Color* colorComboBoxGet_selectedColor(ColorComboBox *colorComboBox);
/**
 * colorComboBoxGet_pixbufFromColor:
 * @colorComboBox: a #ColorComboBox widget ;
 * @color: a #Color object.
 *
 * The @colorComboBox has little pixbufs to represent the color. User methods can
 * use these pixbufs but should considered them read-only.
 *
 * Returns: a pixbuf pointer corresponding to the little image shown on
 *          the @colorComboBox.
 */
GdkPixbuf* colorComboBoxGet_pixbufFromColor(ColorComboBox *colorComboBox, Color *color);


G_END_DECLS

#endif
