• 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/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     /* signals */
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 /* GO_PALETTE_H */

Generated on Wed Mar 5 2014 for AbiWord by  doxygen 1.7.1