#include <gtk/gtk.h>#include <goffice/goffice-config.h>#include <goffice/goffice.h>#include <goffice/utils/go-marshalers.h>#include <gdk/gdkkeysyms.h>#include <gdk/gdk.h>#include <glib/gi18n-lib.h>#include <gsf/gsf-impl-utils.h>#include <string.h>Classes | |
| struct | _GOColorPalette |
| struct | GOColorPaletteClass |
| struct | GOMenuColor |
| struct | GOMenuColorClass |
Defines | |
| #define | COLOR_PREVIEW_WIDTH 12 |
| #define | COLOR_PREVIEW_HEIGHT 12 |
Enumerations | |
| enum | { COLOR_CHANGED, DISPLAY_CUSTOM_DIALOG, LAST_SIGNAL } |
Functions | |
| static GtkWidget * | create_color_sel (GObject *action_proxy, GOColor c, GCallback handler, gboolean allow_alpha) |
| static gboolean | handle_color_sel (GtkColorSelectionDialog *dialog, gint response_id, GOColor *res) |
| static void | go_color_palette_finalize (GObject *object) |
| static void | go_color_palette_class_init (GObjectClass *gobject_class) |
| GSF_CLASS (GOColorPalette, go_color_palette, go_color_palette_class_init, NULL, GTK_TYPE_VBOX) | |
| static void | set_color (GOColorPalette *pal, GOColor color, gboolean is_custom, gboolean by_user, gboolean is_default) |
| static void | cb_history_changed (GOColorPalette *pal) |
| static gboolean | cb_default_release_event (G_GNUC_UNUSED GtkWidget *button, G_GNUC_UNUSED GdkEventButton *event, GOColorPalette *pal) |
| static void | swatch_activated (GOColorPalette *pal, GtkBin *button) |
| static gboolean | cb_swatch_release_event (GtkBin *button, G_GNUC_UNUSED GdkEventButton *event, GOColorPalette *pal) |
| static gboolean | cb_swatch_key_press (GtkBin *button, GdkEventKey *event, GOColorPalette *pal) |
| static gboolean | draw_color_cb (GtkWidget *widget, cairo_t *cr, gpointer data) |
| static GtkWidget * | go_color_palette_button_new (GOColorPalette *pal, GtkTable *table, GONamedColor const *color_name, gint col, gint row) |
| static void | cb_combo_custom_response (GtkColorSelectionDialog *dialog, gint response_id, GOColorPalette *pal) |
| static void | cb_combo_custom_clicked (G_GNUC_UNUSED GtkWidget *button, GOColorPalette *pal) |
| void | go_color_palette_set_title (GOColorPalette *pal, char const *title) |
| void | go_color_palette_set_group (GOColorPalette *p, GOColorGroup *cg) |
go_color_palette_set_group : : GOColorPalette : GOColorGroup | |
| static GtkWidget * | go_color_palette_setup (GOColorPalette *pal, char const *no_color_label, int cols, int rows, GONamedColor const *color_names) |
| void | go_color_palette_set_color_to_default (GOColorPalette *pal) |
| void | go_color_palette_set_current_color (GOColorPalette *pal, GOColor color) |
| GOColor | go_color_palette_get_current_color (GOColorPalette *pal, gboolean *is_default, gboolean *is_custom) |
| void | go_color_palette_set_allow_alpha (GOColorPalette *pal, gboolean allow_alpha) |
| GtkWidget * | go_color_palette_new (char const *no_color_label, GOColor default_color, GOColorGroup *cg) |
| go_color_palette_new: : color label : GOColor : GOColorGroup | |
| static void | go_menu_color_class_init (GObjectClass *gobject_class) |
| static | GSF_CLASS (GOMenuColor, go_menu_color, go_menu_color_class_init, NULL, GTK_TYPE_MENU) |
| static GtkWidget * | make_colored_menu_item (char const *label, GOColor c) |
| static void | cb_menu_default_activate (G_GNUC_UNUSED GtkWidget *button, GOMenuColor *menu) |
| static void | cb_menu_color_activate (GtkWidget *button, GOMenuColor *menu) |
| static void | cb_menu_custom_response (GtkColorSelectionDialog *dialog, gint response_id, GOMenuColor *menu) |
| static void | cb_menu_custom_activate (G_GNUC_UNUSED GtkWidget *button, GOMenuColor *menu) |
| GtkWidget * | go_color_palette_make_menu (char const *no_color_label, GOColor default_color, GOColorGroup *cg, char const *custom_dialog_title, GOColor current_color) |
| go_color_palette_make_menu: : color label : GOColor : GOColorGroup : optional string : GOColor | |
Variables | |
| GONamedColor const | default_color_set [] |
| static guint | go_color_palette_signals [LAST_SIGNAL] = { 0, } |
| static GObjectClass * | go_color_palette_parent_class |
| static guint | go_menu_color_signals [LAST_SIGNAL] = { 0, } |
| #define COLOR_PREVIEW_HEIGHT 12 |
Referenced by go_color_palette_button_new(), and make_colored_menu_item().
| #define COLOR_PREVIEW_WIDTH 12 |
Referenced by go_color_palette_button_new(), and make_colored_menu_item().
| static void cb_combo_custom_clicked | ( | G_GNUC_UNUSED GtkWidget * | button, | |
| GOColorPalette * | pal | |||
| ) | [static] |
References cb_combo_custom_response(), create_color_sel(), DISPLAY_CUSTOM_DIALOG, and go_color_palette_signals.
Referenced by go_color_palette_setup().
| static void cb_combo_custom_response | ( | GtkColorSelectionDialog * | dialog, | |
| gint | response_id, | |||
| GOColorPalette * | pal | |||
| ) | [static] |
References GOColor, handle_color_sel(), and set_color().
Referenced by cb_combo_custom_clicked().
| static gboolean cb_default_release_event | ( | G_GNUC_UNUSED GtkWidget * | button, | |
| G_GNUC_UNUSED GdkEventButton * | event, | |||
| GOColorPalette * | pal | |||
| ) | [static] |
References set_color().
Referenced by go_color_palette_setup().
| static void cb_history_changed | ( | GOColorPalette * | pal | ) | [static] |
References GOColorGroup::history.
Referenced by go_color_palette_set_group().
| static void cb_menu_color_activate | ( | GtkWidget * | button, | |
| GOMenuColor * | menu | |||
| ) | [static] |
References COLOR_CHANGED, go_menu_color_signals, GOColor, and GOMenuColor::selection.
Referenced by go_color_palette_make_menu().
| static void cb_menu_custom_activate | ( | G_GNUC_UNUSED GtkWidget * | button, | |
| GOMenuColor * | menu | |||
| ) | [static] |
References GOMenuColor::allow_alpha, cb_menu_custom_response(), create_color_sel(), DISPLAY_CUSTOM_DIALOG, go_menu_color_signals, and GOMenuColor::selection.
Referenced by go_color_palette_make_menu().
| static void cb_menu_custom_response | ( | GtkColorSelectionDialog * | dialog, | |
| gint | response_id, | |||
| GOMenuColor * | menu | |||
| ) | [static] |
References COLOR_CHANGED, go_menu_color_signals, GOColor, handle_color_sel(), and GOMenuColor::selection.
Referenced by cb_menu_custom_activate().
| static void cb_menu_default_activate | ( | G_GNUC_UNUSED GtkWidget * | button, | |
| GOMenuColor * | menu | |||
| ) | [static] |
References COLOR_CHANGED, GOMenuColor::default_color, go_menu_color_signals, and GOMenuColor::selection.
Referenced by go_color_palette_make_menu().
| static gboolean cb_swatch_key_press | ( | GtkBin * | button, | |
| GdkEventKey * | event, | |||
| GOColorPalette * | pal | |||
| ) | [static] |
References GDK_KEY_KP_Enter, GDK_KEY_Return, GDK_KEY_space, and swatch_activated().
Referenced by go_color_palette_button_new().
| static gboolean cb_swatch_release_event | ( | GtkBin * | button, | |
| G_GNUC_UNUSED GdkEventButton * | event, | |||
| GOColorPalette * | pal | |||
| ) | [static] |
References swatch_activated().
Referenced by go_color_palette_button_new().
| static GtkWidget* create_color_sel | ( | GObject * | action_proxy, | |
| GOColor | c, | |||
| GCallback | handler, | |||
| gboolean | allow_alpha | |||
| ) | [static] |
References gtk_color_selection_dialog_get_color_selection(), and gtk_color_selection_set_current_rgba().
Referenced by cb_combo_custom_clicked(), and cb_menu_custom_activate().
| static gboolean draw_color_cb | ( | GtkWidget * | widget, | |
| cairo_t * | cr, | |||
| gpointer | data | |||
| ) | [static] |
References GO_COLOR_TO_CAIRO, GOColor, and gtk_widget_get_allocation().
Referenced by go_color_palette_button_new().
| static GtkWidget* go_color_palette_button_new | ( | GOColorPalette * | pal, | |
| GtkTable * | table, | |||
| GONamedColor const * | color_name, | |||
| gint | col, | |||
| gint | row | |||
| ) | [static] |
References _, cb_swatch_key_press(), cb_swatch_release_event(), GONamedColor::color, COLOR_PREVIEW_HEIGHT, COLOR_PREVIEW_WIDTH, draw_color_cb(), gtk_box_new(), and GONamedColor::name.
Referenced by go_color_palette_setup().
| static void go_color_palette_class_init | ( | GObjectClass * | gobject_class | ) | [static] |
| static void go_color_palette_finalize | ( | GObject * | object | ) | [static] |
References GO_COLOR_PALETTE, go_color_palette_parent_class, and go_color_palette_set_group().
| GOColor go_color_palette_get_current_color | ( | GOColorPalette * | pal, | |
| gboolean * | is_default, | |||
| gboolean * | is_custom | |||
| ) |
Referenced by cb_preview_clicked(), go_combo_color_get_color(), and go_combo_color_new().
| GtkWidget* go_color_palette_make_menu | ( | char const * | no_color_label, | |
| GOColor | default_color, | |||
| GOColorGroup * | cg, | |||
| char const * | custom_dialog_title, | |||
| GOColor | current_color | |||
| ) |
go_color_palette_make_menu: : color label : GOColor : GOColorGroup : optional string : GOColor
Returns: a submenu with a palette of colours. Caller is responsible for creating an item to point to the submenu.
| GtkWidget* go_color_palette_new | ( | char const * | no_color_label, | |
| GOColor | default_color, | |||
| GOColorGroup * | cg | |||
| ) |
go_color_palette_new: : color label : GOColor : GOColorGroup
Returns: A new palette
Referenced by color_table_setup().
| void go_color_palette_set_allow_alpha | ( | GOColorPalette * | pal, | |
| gboolean | allow_alpha | |||
| ) |
Referenced by go_combo_color_set_allow_alpha().
| void go_color_palette_set_color_to_default | ( | GOColorPalette * | pal | ) |
Referenced by go_combo_color_set_color_gdk(), and go_combo_color_set_color_to_default().
| void go_color_palette_set_current_color | ( | GOColorPalette * | pal, | |
| GOColor | color | |||
| ) |
Referenced by go_combo_color_set_color(), and go_combo_color_set_color_gdk().
| void go_color_palette_set_group | ( | GOColorPalette * | p, | |
| GOColorGroup * | cg | |||
| ) |
go_color_palette_set_group : : GOColorPalette : GOColorGroup
Referenced by go_color_palette_finalize(), and go_color_palette_new().
| void go_color_palette_set_title | ( | GOColorPalette * | pal, | |
| char const * | title | |||
| ) |
Referenced by go_combo_color_set_title().
| static GtkWidget* go_color_palette_setup | ( | GOColorPalette * | pal, | |
| char const * | no_color_label, | |||
| int | cols, | |||
| int | rows, | |||
| GONamedColor const * | color_names | |||
| ) | [static] |
References _, cb_combo_custom_clicked(), cb_default_release_event(), GONamedColor::color, go_color_palette_button_new(), and go_gtk_button_new_with_stock().
Referenced by go_color_palette_new().
| static void go_menu_color_class_init | ( | GObjectClass * | gobject_class | ) | [static] |
References go__VOID__INT_BOOLEAN_BOOLEAN_BOOLEAN(), and go_menu_color_signals.
| static GSF_CLASS | ( | GOMenuColor | , | |
| go_menu_color | , | |||
| go_menu_color_class_init | , | |||
| NULL | , | |||
| GTK_TYPE_MENU | ||||
| ) | [static] |
| GSF_CLASS | ( | GOColorPalette | , | |
| go_color_palette | , | |||
| go_color_palette_class_init | , | |||
| NULL | , | |||
| GTK_TYPE_VBOX | ||||
| ) |
| static gboolean handle_color_sel | ( | GtkColorSelectionDialog * | dialog, | |
| gint | response_id, | |||
| GOColor * | res | |||
| ) | [static] |
References GO_COLOR_FROM_GDK_RGBA, gtk_color_selection_dialog_get_color_selection(), and gtk_color_selection_get_current_rgba().
Referenced by cb_combo_custom_response(), and cb_menu_custom_response().
| static GtkWidget* make_colored_menu_item | ( | char const * | label, | |
| GOColor | c | |||
| ) | [static] |
References cb_menu_item_toggle_size_request(), COLOR_PREVIEW_HEIGHT, and COLOR_PREVIEW_WIDTH.
Referenced by go_color_palette_make_menu().
| static void set_color | ( | GOColorPalette * | pal, | |
| GOColor | color, | |||
| gboolean | is_custom, | |||
| gboolean | by_user, | |||
| gboolean | is_default | |||
| ) | [static] |
| static void swatch_activated | ( | GOColorPalette * | pal, | |
| GtkBin * | button | |||
| ) | [static] |
References GO_COLOR_FROM_GDK_RGBA, and set_color().
Referenced by cb_swatch_key_press(), and cb_swatch_release_event().
| GONamedColor const default_color_set[] |
GObjectClass* go_color_palette_parent_class [static] |
Referenced by go_color_palette_class_init(), and go_color_palette_finalize().
guint go_color_palette_signals[LAST_SIGNAL] = { 0, } [static] |
Referenced by cb_combo_custom_clicked(), go_color_palette_class_init(), and set_color().
guint go_menu_color_signals[LAST_SIGNAL] = { 0, } [static] |
1.7.1