1 /* 2 * go-selector.h : 3 * 4 * Copyright (C) 2006 Emmanuel Pacaud (emmanuel.pacaud@lapp.in2p3.fr) 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License as 8 * published by the Free Software Foundation; either version 2 of the 9 * License, or (at your option) version 3. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 19 * USA 20 */ 21 22 #ifndef GO_SELECTOR_H 23 #define GO_SELECTOR_H 24 25 #include <goffice/goffice.h> 26 27 G_BEGIN_DECLS 28 29 #define GO_TYPE_SELECTOR (go_selector_get_type ()) 30 #define GO_SELECTOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GO_TYPE_SELECTOR, GOSelector)) 31 #define GO_SELECTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GO_TYPE_SELECTOR, GOSelectorClass)) 32 #define GO_IS_SELECTOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GO_TYPE_SELECTOR)) 33 #define GO_IS_SELECTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GO_TYPE_SELECTOR)) 34 #define GO_SELECTOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GO_TYPE_SELECTOR, GOSelectorClass)) 35 36 typedef struct _GOSelector GOSelector; 37 typedef struct _GOSelectorPrivate GOSelectorPrivate; 38 typedef struct _GOSelectorClass GOSelectorClass; 39 40 struct _GOSelector 41 { 42 GtkBox parent; 43 44 GOSelectorPrivate *priv; 45 }; 46 47 struct _GOSelectorClass 48 { 49 GtkBoxClass parent_class; 50 51 /* signals */ 52 void (*activate) (GtkWidget *selector); 53 }; 54 55 GType go_selector_get_type (void); 56 57 GtkWidget *go_selector_new (GOPalette *palette); 58 59 int go_selector_get_active (GOSelector *selector, gboolean *is_auto); 60 gboolean go_selector_set_active (GOSelector *selector, int index); 61 62 void go_selector_update_swatch (GOSelector *selector); 63 void go_selector_activate (GOSelector *selector); 64 65 gpointer go_selector_get_user_data (GOSelector *selector); 66 67 typedef void (*GOSelectorDndDataReceived) (GOSelector *selector, guchar const *data); 68 typedef gpointer (*GOSelectorDndDataGet) (GOSelector *selector); 69 typedef void (*GOSelectorDndFillIcon) (GOSelector *selector, GdkPixbuf *pixbuf); 70 71 void go_selector_setup_dnd (GOSelector *selector, 72 char const *dnd_target, 73 int dnd_length, 74 GOSelectorDndDataGet data_get, 75 GOSelectorDndDataReceived data_received, 76 GOSelectorDndFillIcon fill_icon); 77 78 G_END_DECLS 79 80 #endif /* GO_SELECTOR_H */ 81 82