1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * widget-color-combo.h - A color selector combo box
4 * Copyright 2000, 2001, Ximian, Inc.
7 * Miguel de Icaza (miguel@kernel.org)
8 * Dom Lachowicz (dominicl@seas.upenn.edu)
10 * Reworked and split up into a separate ColorPalette object:
11 * Michael Levy (mlevy@genoscope.cns.fr)
13 * And later revised and polished by:
14 * Almer S. Tigelaar (almer@gnome.org)
16 * Modified for gLabels by:
17 * Jim Evins <evins@snaught.com>
19 * This library is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public
21 * License, version 2, as published by the Free Software Foundation.
23 * This library is distributed in the hope that it will be useful, but
24 * WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
26 * General Public License for more details.
28 * You should have received a copy of the GNU General Public
29 * License along with this library; if not, write to the Free Software
30 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
34 #ifndef GNUMERIC_WIDGET_COLOR_COMBO_H
35 #define GNUMERIC_WIDGET_COLOR_COMBO_H
37 #include <gtk/gtkwidget.h>
38 #include "mygal-combo-box.h"
39 #include "color-palette.h"
43 typedef struct _ColorCombo {
44 MygalComboBox combo_box;
47 * GtkImage where we display
49 GtkWidget *preview_button;
50 GtkWidget *preview_image;
51 gboolean preview_is_icon;
53 ColorPalette *palette;
55 GdkColor *default_color;
60 MygalComboBoxClass parent_class;
62 /* Signals emited by this widget */
63 void (* color_changed) (ColorCombo *color_combo, GdkColor *color,
64 gboolean custom, gboolean by_user, gboolean is_default);
67 #define COLOR_COMBO_TYPE (color_combo_get_type ())
68 #define COLOR_COMBO(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), COLOR_COMBO_TYPE, ColorCombo))
69 #define COLOR_COMBO_CLASS(k) (G_TYPE_CHECK_CLASS_CAST(k), COLOR_COMBO_TYPE)
70 #define IS_COLOR_COMBO(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), COLOR_COMBO_TYPE))
72 GtkType color_combo_get_type (void);
73 GtkWidget *color_combo_new (GdkPixbuf *icon,
74 char const *no_color_label,
75 GdkColor *default_color,
76 ColorGroup *color_group);
77 void color_combo_set_color (ColorCombo *cc,
79 void color_combo_set_color_to_default (ColorCombo *cc);
80 GdkColor *color_combo_get_color (ColorCombo *cc, gboolean *is_default);
82 void color_combo_box_set_preview_relief (ColorCombo *cc, GtkReliefStyle relief);
86 #endif /* GNUMERIC_WIDGET_COLOR_COMBO_H */