1 /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * go-color-palette.h - A color selector palette
4  * Copyright 2000-2004, Ximian, Inc.
5  *
6  * Authors:
7  * This code was extracted from widget-color-combo.c
8  *   written by Miguel de Icaza (miguel@kernel.org) and
9  *   Dom Lachowicz (dominicl@seas.upenn.edu). The extracted
10  *   code was re-packaged into a separate object by
11  *   Michael Levy (mlevy@genoscope.cns.fr)
12  *   And later revised and polished by
13  *   Almer S. Tigelaar (almer@gnome.org)
14  *
15  * This library is free software; you can redistribute it and/or
16  * modify it under the terms of the GNU Library General Public
17  * License, version 2, as published by the Free Software Foundation.
18  *
19  * This library is distributed in the hope that it will be useful, but
20  * WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
22  * Library General Public License for more details.
23  *
24  * You should have received a copy of the GNU Library General Public
25  * License along with this library; if not, write to the Free Software
26  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
27  * USA.
28  */
29 
30 #ifndef _GO_COLOR_PALETTE_H_
31 #define _GO_COLOR_PALETTE_H_
32 
33 #include <goffice/goffice.h>
34 
35 G_BEGIN_DECLS
36 
37 typedef struct _GOColorPalette  GOColorPalette;
38 
39 #define GO_TYPE_COLOR_PALETTE     (go_color_palette_get_type ())
40 #define GO_COLOR_PALETTE(obj)     (G_TYPE_CHECK_INSTANCE_CAST((obj), GO_TYPE_COLOR_PALETTE, GOColorPalette))
41 #define GO_COLOR_PALETTE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST(k), GO_TYPE_COLOR_PALETTE)
42 #define GO_IS_COLOR_PALETTE(obj)  (G_TYPE_CHECK_INSTANCE_TYPE((obj), GO_TYPE_COLOR_PALETTE))
43 
44 GType      go_color_palette_get_type (void);
45 
46 GtkWidget *go_color_palette_new	      (char const *no_color_label,
47 				       GOColor default_color,
48 				       GOColorGroup *cg);
49 GtkWidget *go_color_palette_make_menu (char const *no_color_label,
50 				       GOColor default_color,
51 				       GOColorGroup *cg,
52 				       char const *custom_dialog_title,
53 				       GOColor current_color);
54 
55 void	go_color_palette_set_title		(GOColorPalette *p, char const *title);
56 void	go_color_palette_set_group		(GOColorPalette *p, GOColorGroup *cg);
57 void    go_color_palette_set_current_color	(GOColorPalette *p, GOColor color);
58 void    go_color_palette_set_color_to_default	(GOColorPalette *p);
59 GOColor go_color_palette_get_current_color	(GOColorPalette *p,
60 						 gboolean *is_default, gboolean *is_custom);
61 void	go_color_palette_set_allow_alpha	(GOColorPalette *p, gboolean allow_alpha);
62 
63 G_END_DECLS
64 
65 #endif /* __GO_COLOR_PALETTE_H__ */
66