#include <goffice/goffice-config.h>
#include <goffice/goffice.h>
#include <glib/gi18n-lib.h>
#include <gdk/gdkkeysyms.h>
#include <math.h>
Classes | |
struct | _GOPalettePrivate |
Enumerations | |
enum | { GO_PALETTE_ACTIVATE, GO_PALETTE_AUTOMATIC_ACTIVATE, GO_PALETTE_CUSTOM_ACTIVATE, GO_PALETTE_LAST_SIGNAL } |
Functions | |
static void | go_palette_finalize (GObject *object) |
static GtkWidget * | go_palette_menu_item_new (GOPalette *palette, int index) |
static void | cb_automatic_activate (GtkWidget *item, GOPalette *palette) |
static void | cb_custom_activate (GtkWidget *item, GOPalette *palette) |
static void | go_palette_init (GOPalette *palette) |
static void | go_palette_realize (GtkWidget *widget) |
static void | go_palette_class_init (GOPaletteClass *class) |
static gboolean | cb_swatch_draw (GtkWidget *swatch, cairo_t *cr, GOPalette *palette) |
static void | cb_menu_item_activate (GtkWidget *item, GOPalette *palette) |
static void | cb_menu_item_toggle_size_request (GtkWidget *item, gint *requitision) |
GtkWidget * | go_palette_new (int n_swatches, double swatch_width, int n_columns, GOPaletteSwatchRenderCallback swatch_render, GOPaletteSwatchTooltipCallback get_tooltip, gpointer data, GDestroyNotify destroy) |
go_palette_new: : number of palette items : swatch width as multiple of swatch height : number of columns for displaying palette items : a user function used for swatch rendering : user data for use by swatch render function : a function to destroy user data on widget finalization | |
void | go_palette_show_automatic (GOPalette *palette, int index, char const *label) |
go_palette_show_automatic: : a GOPalette : index to use on automatic item activation : if not NULL, replace automatic button label | |
void | go_palette_show_custom (GOPalette *palette, char const *label) |
go_palette_show_custom: : a GOPalette : if not NULL, replaces custom button label | |
gpointer | go_palette_get_user_data (GOPalette *palette) |
go_palette_get_user_data: : a GOPalette | |
GtkWidget * | go_palette_swatch_new (GOPalette *palette, int index) |
go_palette_swatch_new: : a GOPalette : default index | |
int | go_palette_get_n_swatches (GOPalette *palette) |
go_palette_get_n_swatches: : a GOPalette | |
Variables | |
static guint | go_palette_signals [GO_PALETTE_LAST_SIGNAL] = {0,} |
anonymous enum |
static void cb_automatic_activate | ( | GtkWidget * | item, | |
GOPalette * | palette | |||
) | [static] |
References _GOPalettePrivate::automatic_index, GO_PALETTE_AUTOMATIC_ACTIVATE, go_palette_signals, and _GOPalette::priv.
Referenced by go_palette_realize().
static void cb_custom_activate | ( | GtkWidget * | item, | |
GOPalette * | palette | |||
) | [static] |
References GO_PALETTE_CUSTOM_ACTIVATE, and go_palette_signals.
Referenced by go_palette_realize().
static void cb_menu_item_activate | ( | GtkWidget * | item, | |
GOPalette * | palette | |||
) | [static] |
References GO_PALETTE_ACTIVATE, and go_palette_signals.
Referenced by go_palette_menu_item_new().
static void cb_menu_item_toggle_size_request | ( | GtkWidget * | item, | |
gint * | requitision | |||
) | [static] |
Referenced by go_palette_menu_item_new(), and make_colored_menu_item().
static gboolean cb_swatch_draw | ( | GtkWidget * | swatch, | |
cairo_t * | cr, | |||
GOPalette * | palette | |||
) | [static] |
References _GOPalettePrivate::data, gtk_widget_get_allocation(), _GOPalette::priv, and _GOPalettePrivate::swatch_render.
Referenced by go_palette_swatch_new().
static void go_palette_class_init | ( | GOPaletteClass * | class | ) | [static] |
References go_palette_signals.
static void go_palette_finalize | ( | GObject * | object | ) | [static] |
int go_palette_get_n_swatches | ( | GOPalette * | palette | ) |
go_palette_get_n_swatches: : a GOPalette
A convenience function.
Returns: the number of palette items.
go_palette_get_user_data: : a GOPalette
Returns: a pointer to user data given to go_palette_new function.
static void go_palette_init | ( | GOPalette * | palette | ) | [static] |
References _GOPalettePrivate::automatic, _GOPalettePrivate::automatic_index, _GOPalettePrivate::automatic_label, _GOPalettePrivate::automatic_separator, _GOPalettePrivate::custom, _GOPalettePrivate::custom_label, _GOPalettePrivate::custom_separator, _GOPalettePrivate::data, _GOPalettePrivate::destroy, GO_TYPE_PALETTE, _GOPalettePrivate::n_columns, _GOPalettePrivate::n_swatches, _GOPalettePrivate::show_automatic, _GOPalettePrivate::show_custom, _GOPalettePrivate::swatch_height, _GOPalettePrivate::swatch_render, and _GOPalettePrivate::swatch_width.
static GtkWidget * go_palette_menu_item_new | ( | GOPalette * | palette, | |
int | index | |||
) | [static] |
GtkWidget* go_palette_new | ( | int | n_swatches, | |
double | swatch_width, | |||
int | n_columns, | |||
GOPaletteSwatchRenderCallback | swatch_render, | |||
GOPaletteSwatchTooltipCallback | get_tooltip, | |||
gpointer | data, | |||
GDestroyNotify | destroy | |||
) |
go_palette_new: : number of palette items : swatch width as multiple of swatch height : number of columns for displaying palette items : a user function used for swatch rendering : user data for use by swatch render function : a function to destroy user data on widget finalization
Returns: a new GOPalette object.
References _GOPalettePrivate::data, _GOPalettePrivate::destroy, _GOPalettePrivate::get_tooltip, GO_PALETTE, GO_TYPE_PALETTE, _GOPalettePrivate::n_columns, _GOPalettePrivate::n_swatches, _GOPalettePrivate::swatch_height, _GOPalettePrivate::swatch_render, and _GOPalettePrivate::swatch_width.
Referenced by go_color_selector_new().
static void go_palette_realize | ( | GtkWidget * | widget | ) | [static] |
References _GOPalettePrivate::automatic, _GOPalettePrivate::automatic_label, _GOPalettePrivate::automatic_separator, cb_automatic_activate(), cb_custom_activate(), _GOPalettePrivate::custom, _GOPalettePrivate::custom_label, _GOPalettePrivate::custom_separator, GO_PALETTE, go_palette_menu_item_new(), _GOPalettePrivate::n_columns, _GOPalettePrivate::n_swatches, _GOPalette::priv, _GOPalettePrivate::show_automatic, and _GOPalettePrivate::show_custom.
void go_palette_show_automatic | ( | GOPalette * | palette, | |
int | index, | |||
char const * | label | |||
) |
go_palette_show_automatic: : a GOPalette : index to use on automatic item activation : if not NULL, replace automatic button label
Adds an automatic button to .
Referenced by go_color_selector_new().
void go_palette_show_custom | ( | GOPalette * | palette, | |
char const * | label | |||
) |
go_palette_show_custom: : a GOPalette : if not NULL, replaces custom button label
Adds a custom button to bottom of . An activation of custom button will cause an emition of "custom_activate" signal.
Referenced by go_color_selector_new().
GtkWidget* go_palette_swatch_new | ( | GOPalette * | palette, | |
int | index | |||
) |
go_palette_swatch_new: : a GOPalette : default index
Returns: a new GtkDrawingArea which will be rendered like a swatch. can be changed later by changing swatch "index" data.
Referenced by go_palette_menu_item_new().
guint go_palette_signals[GO_PALETTE_LAST_SIGNAL] = {0,} [static] |
Referenced by cb_automatic_activate(), cb_custom_activate(), cb_menu_item_activate(), and go_palette_class_init().