Functions

go-color-selector.h File Reference

#include <goffice/utils/go-color.h>
#include <goffice/gtk/go-selector.h>
#include <gtk/gtkwidget.h>

Go to the source code of this file.

Functions

G_BEGIN_DECLS 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
GOColor go_color_selector_get_color (GOSelector *selector, gboolean *is_auto)
 go_color_selector_get_color: : a GOSelector : non-NULL result storage
gboolean go_color_selector_set_color (GOSelector *selector, GOColor color)
 go_color_selector_set_color: : a color selector : a color

Function Documentation

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.

References GOColorSelectorState::color_group, GOColorSelectorState::default_color, get_color(), GO_COLOR_WHITE, GOColorSelectorState::n_swatches, and RGB_WHITE.

Referenced by cb_combo_custom_activate().

G_BEGIN_DECLS 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.

References GOColorSelectorState::allow_alpha, cb_combo_custom_activate(), GOColorSelectorState::color_group, GOColorSelectorState::default_color, get_index(), go_color_group_fetch(), go_color_palette_render_func(), go_color_selector_drag_data_get(), go_color_selector_drag_data_received(), go_color_selector_drag_fill_icon(), go_color_selector_state_free(), GO_PALETTE, go_palette_new(), go_palette_show_automatic(), go_palette_show_custom(), and GOColorSelectorState::n_swatches.

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.

References GOColorSelectorState::color_group, get_index(), and GOColorSelectorState::n_swatches.

Referenced by cb_color_dialog_response(), and go_color_selector_drag_data_received().