• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

go-palette.h

Go to the documentation of this file.
00001 /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
00002 /*
00003  * go-palette.h :
00004  *
00005  * Copyright (C) 2006 Emmanuel Pacaud (emmanuel.pacaud@lapp.in2p3.fr)
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of version 2 of the GNU General Public
00009  * License as published by the Free Software Foundation.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
00019  * USA
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     /* signals */
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 /* GO_PALETTE_H */

Generated on Wed Mar 5 2014 for AbiWord by  doxygen 1.7.1