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/gtkmenu.h>
00026
00027 G_BEGIN_DECLS
00028
00029 typedef void (*GOPaletteSwatchRenderCallback) (cairo_t *cr,
00030 GdkRectangle const *area,
00031 int index,
00032 gpointer data);
00033
00034 #define GO_TYPE_PALETTE (go_palette_get_type ())
00035 #define GO_PALETTE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GO_TYPE_PALETTE, GOPalette))
00036 #define GO_PALETTE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GO_TYPE_PALETTE, GOPaletteClass))
00037 #define GO_IS_PALETTE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GO_TYPE_PALETTE))
00038 #define GO_IS_PALETTE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GO_TYPE_PALETTE))
00039 #define GO_PALETTE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GO_TYPE_PALETTE, GOPaletteClass))
00040
00041 typedef struct _GOPalette GOPalette;
00042 typedef struct _GOPalettePrivate GOPalettePrivate;
00043 typedef struct _GOPaletteClass GOPaletteClass;
00044
00045 struct _GOPalette
00046 {
00047 GtkMenu parent;
00048
00049 GOPalettePrivate *priv;
00050 };
00051
00052 struct _GOPaletteClass
00053 {
00054 GtkMenuClass parent_class;
00055
00056
00057 void (*activate) (GtkWidget *palette, int index);
00058 void (*automatic_activate) (GtkWidget *palette, int index);
00059 void (*custom_activate) (GtkWidget *palette);
00060 };
00061
00062 GType go_palette_get_type (void) G_GNUC_CONST;
00063 GtkWidget *go_palette_new (int n_swatches,
00064 double swatch_width,
00065 int n_colmuns,
00066 GOPaletteSwatchRenderCallback swatch_render,
00067 gpointer data,
00068 GDestroyNotify destroy);
00069 void go_palette_show_automatic (GOPalette *palette, int index, char const *label);
00070 void go_palette_show_custom (GOPalette *palette, char const *label);
00071
00072 gpointer go_palette_get_user_data (GOPalette *palette);
00073
00074 GtkWidget *go_palette_swatch_new (GOPalette *palette, int index);
00075 int go_palette_get_n_swatches (GOPalette *palette);
00076 G_END_DECLS
00077
00078 #endif