1 /* 2 * color-combo.h 3 * Copyright (C) 2008-2009 Jim Evins <evins@snaught.com>. 4 * 5 * This file is part of gLabels. 6 * 7 * gLabels is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * gLabels is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with gLabels. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 21 #ifndef __GL_COLOR_COMBO_H__ 22 #define __GL_COLOR_COMBO_H__ 23 24 25 #include <gtk/gtk.h> 26 27 28 G_BEGIN_DECLS 29 30 #define TYPE_GL_COLOR_COMBO (gl_color_combo_get_type ()) 31 #define GL_COLOR_COMBO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_GL_COLOR_COMBO, glColorCombo)) 32 #define GL_COLOR_COMBO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_GL_COLOR_COMBO, glColorComboClass)) 33 #define IS_GL_COLOR_COMBO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_GL_COLOR_COMBO)) 34 #define IS_GL_COLOR_COMBO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_GL_COLOR_COMBO)) 35 #define GL_COLOR_COMBO_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), TYPE_GL_COLOR_COMBO, glColorComboClass)) 36 37 38 typedef struct _glColorCombo glColorCombo; 39 typedef struct _glColorComboPrivate glColorComboPrivate; 40 typedef struct _glColorComboClass glColorComboClass; 41 42 43 struct _glColorCombo { 44 GtkToggleButton parent; 45 46 glColorComboPrivate *priv; 47 }; 48 49 struct _glColorComboClass { 50 GtkToggleButtonClass parent_class; 51 52 /* 53 * Signals 54 */ 55 void (*color_changed) (glColorCombo *object, 56 guint color, 57 gboolean is_default, 58 gpointer user_data); 59 60 }; 61 62 63 GType gl_color_combo_get_type (void) G_GNUC_CONST; 64 65 GtkWidget *gl_color_combo_new (const gchar *default_label, 66 guint default_color, 67 guint color); 68 69 void gl_color_combo_set_color (glColorCombo *this, 70 guint color); 71 72 void gl_color_combo_set_to_default (glColorCombo *this); 73 74 guint gl_color_combo_get_color (glColorCombo *this, 75 gboolean *is_default); 76 77 void gl_color_combo_set_relief (glColorCombo *this, 78 GtkReliefStyle relief); 79 80 81 G_END_DECLS 82 83 #endif /* __GL_COLOR_COMBO_H__ */ 84 85 86 87 /* 88 * Local Variables: -- emacs 89 * mode: C -- emacs 90 * c-basic-offset: 8 -- emacs 91 * tab-width: 8 -- emacs 92 * indent-tabs-mode: nil -- emacs 93 * End: -- emacs 94 */ 95