#include <goffice/goffice-config.h>
#include "go-color-selector.h"
#include <goffice/utils/go-color.h>
#include <goffice/gtk/go-color-group.h>
#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>
Classes | |
struct | GOColorSelectorState |
Functions | |
static void | go_color_selector_state_free (gpointer data) |
static int | get_index (int n_swatches, GOColorGroup *color_group, GOColor color) |
static GOColor | get_color (int n_swatches, GOColorGroup *color_group, int index) |
static cairo_status_t | draw_check (cairo_surface_t *surface, int width, int height) |
static void | go_color_palette_render_func (cairo_t *cr, GdkRectangle const *area, int index, gpointer data) |
static void | cb_color_dialog_response (GtkColorSelectionDialog *color_dialog, gint response, GOSelector *selector) |
static void | cb_combo_custom_activate (GOPalette *palette, GOSelector *selector) |
static void | go_color_selector_drag_data_received (GOSelector *selector, guchar const *data) |
static gpointer | go_color_selector_drag_data_get (GOSelector *selector) |
static void | go_color_selector_drag_fill_icon (GOSelector *selector, GdkPixbuf *pixbuf) |
GtkWidget * | go_color_selector_new (GOColor initial_color, GOColor default_color, char const *group) |
go_color_selector_new: : initially selected color : automatic color : a GOColorGroup name | |
gboolean | go_color_selector_set_color (GOSelector *selector, GOColor color) |
go_color_selector_set_color: : a color selector : a color | |
GOColor | go_color_selector_get_color (GOSelector *selector, gboolean *is_auto) |
go_color_selector_get_color: : a GOSelector : non-NULL result storage | |
void | go_color_selector_set_allow_alpha (GOSelector *selector, gboolean allow_alpha) |
go_color_selector_set_allow_alpha : : GOColorSelector : boolean | |
Variables | |
GONamedColor | default_color_set [] |
static void cb_color_dialog_response | ( | GtkColorSelectionDialog * | color_dialog, | |
gint | response, | |||
GOSelector * | selector | |||
) | [static] |
static void cb_combo_custom_activate | ( | GOPalette * | palette, | |
GOSelector * | selector | |||
) | [static] |
static cairo_status_t draw_check | ( | cairo_surface_t * | surface, | |
int | width, | |||
int | height | |||
) | [static] |
Referenced by go_color_palette_render_func().
static GOColor get_color | ( | int | n_swatches, | |
GOColorGroup * | color_group, | |||
int | index | |||
) | [static] |
static int get_index | ( | int | n_swatches, | |
GOColorGroup * | color_group, | |||
GOColor | color | |||
) | [static] |
References go_color_group_add_color().
Referenced by go_color_selector_new(), and go_color_selector_set_color().
static void go_color_palette_render_func | ( | cairo_t * | cr, | |
GdkRectangle const * | area, | |||
int | index, | |||
gpointer | data | |||
) | [static] |
References GOColorSelectorState::color_group, draw_check(), get_color(), GO_COLOR_DOUBLE_A, GO_COLOR_DOUBLE_B, GO_COLOR_DOUBLE_G, GO_COLOR_DOUBLE_R, GOColor, and GOColorSelectorState::n_swatches.
Referenced by go_color_selector_new().
static gpointer go_color_selector_drag_data_get | ( | GOSelector * | selector | ) | [static] |
References GOColorSelectorState::color_group, get_color(), GO_COLOR_UINT_A, GO_COLOR_UINT_B, GO_COLOR_UINT_G, GO_COLOR_UINT_R, GOColor, and GOColorSelectorState::n_swatches.
Referenced by go_color_selector_new().
static void go_color_selector_drag_data_received | ( | GOSelector * | selector, | |
guchar const * | data | |||
) | [static] |
References GO_COLOR_CHANGE_A, GO_COLOR_CHANGE_B, GO_COLOR_CHANGE_G, GO_COLOR_CHANGE_R, go_color_selector_set_color(), and GOColor.
Referenced by go_color_selector_new().
static void go_color_selector_drag_fill_icon | ( | GOSelector * | selector, | |
GdkPixbuf * | pixbuf | |||
) | [static] |
References GOColorSelectorState::color_group, get_color(), GOColor, and GOColorSelectorState::n_swatches.
Referenced by go_color_selector_new().
GOColor go_color_selector_get_color | ( | GOSelector * | selector, | |
gboolean * | is_auto | |||
) |
go_color_selector_get_color: : a GOSelector : non-NULL result storage
Retrieves current color selection of a GOSelector created via . will be set to TRUE if current selection was set by clicking on automatic palette item.
Returns: current color selection.
Referenced by cb_combo_custom_activate().
GtkWidget* go_color_selector_new | ( | GOColor | initial_color, | |
GOColor | default_color, | |||
char const * | group | |||
) |
go_color_selector_new: : initially selected color : automatic color : a GOColorGroup name
Creates a new color selector, with selected. Palette will contain an automatic button, which can be used to select . This widget supports color drag and drop.
Returns: a GtkWidget.
void go_color_selector_set_allow_alpha | ( | GOSelector * | selector, | |
gboolean | allow_alpha | |||
) |
go_color_selector_set_allow_alpha : : GOColorSelector : boolean
Should the custom colour selector allow the use of opacity.
References GOColorSelectorState::allow_alpha.
gboolean go_color_selector_set_color | ( | GOSelector * | selector, | |
GOColor | color | |||
) |
go_color_selector_set_color: : a color selector : a color
Sets current selection to . An "activate" signal will be emited. Selector has to be a selector created via .
Returns: TRUE if selection changed.
Referenced by cb_color_dialog_response(), and go_color_selector_drag_data_received().
static void go_color_selector_state_free | ( | gpointer | data | ) | [static] |
References GOColorSelectorState::color_group.
Referenced by go_color_selector_new().