Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef GO_PALETTE_H
00023 #define GO_PALETTE_H
00024
00025 #include <gtk/gtk.h>
00026 #include <cairo.h>
00027
00028 G_BEGIN_DECLS
00029
00030 typedef void (*GOPaletteSwatchRenderCallback) (cairo_t *cr,
00031 GdkRectangle const *area,
00032 int index,
00033 gpointer data);
00034 typedef const char * (*GOPaletteSwatchTooltipCallback) (int index,
00035 gpointer data);
00036
00037 #define GO_TYPE_PALETTE (go_palette_get_type ())
00038 #define GO_PALETTE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GO_TYPE_PALETTE, GOPalette))
00039 #define GO_PALETTE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GO_TYPE_PALETTE, GOPaletteClass))
00040 #define GO_IS_PALETTE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GO_TYPE_PALETTE))
00041 #define GO_IS_PALETTE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GO_TYPE_PALETTE))
00042 #define GO_PALETTE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GO_TYPE_PALETTE, GOPaletteClass))
00043
00044 typedef struct _GOPalette GOPalette;
00045 typedef struct _GOPalettePrivate GOPalettePrivate;
00046 typedef struct _GOPaletteClass GOPaletteClass;
00047
00048 struct _GOPalette
00049 {
00050 GtkMenu parent;
00051
00052 GOPalettePrivate *priv;
00053 };
00054
00055 struct _GOPaletteClass
00056 {
00057 GtkMenuClass parent_class;
00058
00059
00060 void (*activate) (GtkWidget *palette, int index);
00061 void (*automatic_activate) (GtkWidget *palette, int index);
00062 void (*custom_activate) (GtkWidget *palette);
00063 };
00064
00065 GType go_palette_get_type (void) G_GNUC_CONST;
00066 GtkWidget *go_palette_new (int n_swatches,
00067 double swatch_width,
00068 int n_columns,
00069 GOPaletteSwatchRenderCallback swatch_render,
00070 GOPaletteSwatchTooltipCallback get_tooltip,
00071 gpointer data,
00072 GDestroyNotify destroy);
00073 void go_palette_show_automatic (GOPalette *palette, int index, char const *label);
00074 void go_palette_show_custom (GOPalette *palette, char const *label);
00075
00076 gpointer go_palette_get_user_data (GOPalette *palette);
00077
00078 GtkWidget *go_palette_swatch_new (GOPalette *palette, int index);
00079 int go_palette_get_n_swatches (GOPalette *palette);
00080 G_END_DECLS
00081
00082 #endif