#include <goffice/goffice-config.h>#include "go-color-palette.h"#include "goffice-gtk.h"#include <goffice/utils/go-marshalers.h>#include <goffice/utils/go-color.h>#include <gtk/gtk.h>#include <gdk/gdkkeysyms.h>#include <gdk/gdkcolor.h>#include <glib/gi18n-lib.h>#include <gsf/gsf-impl-utils.h>#include <string.h>Classes | |
| struct | _GOColorPalette |
| struct | GOColorPaletteClass |
| struct | _ColorNamePair |
| struct | GOMenuColor |
| struct | GOMenuColorClass |
Defines | |
| #define | COLOR_PREVIEW_WIDTH 12 |
| #define | COLOR_PREVIEW_HEIGHT 12 |
Typedefs | |
| typedef struct _ColorNamePair | ColorNamePair |
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 (GtkWidget *button, GdkEventButton *event, GOColorPalette *pal) |
| static void | swatch_activated (GOColorPalette *pal, GtkBin *button) |
| static gboolean | cb_swatch_release_event (GtkBin *button, GdkEventButton *event, GOColorPalette *pal) |
| static gboolean | cb_swatch_key_press (GtkBin *button, GdkEventKey *event, GOColorPalette *pal) |
| static GtkWidget * | go_color_palette_button_new (GOColorPalette *pal, GtkTable *table, GtkTooltips *tip, ColorNamePair 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 (GtkWidget *button, GOColorPalette *pal) |
| void | go_color_palette_set_title (GOColorPalette *pal, char const *title) |
| void | go_color_palette_set_group (GOColorPalette *pal, GOColorGroup *cg) |
| go_color_palette_set_group : : GOColorGroup | |
| static GtkWidget * | go_color_palette_setup (GOColorPalette *pal, char const *no_color_label, int cols, int rows, ColorNamePair 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) |
| 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 void | cb_menu_default_activate (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 (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: : default_color: GOColor : GOColorGroup : : GOColor | |
Variables | |
| static ColorNamePair 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 GSF_CLASS().
| #define COLOR_PREVIEW_WIDTH 12 |
Referenced by go_color_palette_button_new(), and GSF_CLASS().
| typedef struct _ColorNamePair ColorNamePair |
| static void cb_combo_custom_clicked | ( | 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] |
| static gboolean cb_default_release_event | ( | GtkWidget * | button, | |
| GdkEventButton * | event, | |||
| GOColorPalette * | pal | |||
| ) | [static] |
| static void cb_history_changed | ( | GOColorPalette * | pal | ) | [static] |
References GO_COLOR_GROUP_HISTORY_SIZE, and 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 | ( | 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 | ( | 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] |
| static gboolean cb_swatch_release_event | ( | GtkBin * | button, | |
| GdkEventButton * | event, | |||
| GOColorPalette * | pal | |||
| ) | [static] |
| static GtkWidget* create_color_sel | ( | GObject * | action_proxy, | |
| GOColor | c, | |||
| GCallback | handler, | |||
| gboolean | allow_alpha | |||
| ) | [static] |
| static GtkWidget* go_color_palette_button_new | ( | GOColorPalette * | pal, | |
| GtkTable * | table, | |||
| GtkTooltips * | tip, | |||
| ColorNamePair const * | color_name, | |||
| gint | col, | |||
| gint | row | |||
| ) | [static] |
References _, cb_swatch_key_press(), cb_swatch_release_event(), _ColorNamePair::color, COLOR_PREVIEW_HEIGHT, COLOR_PREVIEW_WIDTH, and _ColorNamePair::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().
Referenced by go_color_palette_class_init().
| 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: : default_color: GOColor : GOColorGroup : : GOColor
Create a submenu with a palette of colours. Caller is responsible for creating an item to point to the submenu.
References _, cb_menu_color_activate(), cb_menu_custom_activate(), cb_menu_default_activate(), GO_COLOR_GROUP_HISTORY_SIZE, GOColorGroup::history, name, and rows.
| GtkWidget* go_color_palette_new | ( | char const * | no_color_label, | |
| GOColor | default_color, | |||
| GOColorGroup * | cg | |||
| ) |
References go_color_palette_set_group(), go_color_palette_setup(), GO_COLOR_PALETTE_TYPE, and rows.
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 | ) |
References set_color().
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 | |||
| ) |
References set_color().
Referenced by go_combo_color_set_color(), and go_combo_color_set_color_gdk().
| void go_color_palette_set_group | ( | GOColorPalette * | pal, | |
| GOColorGroup * | cg | |||
| ) |
go_color_palette_set_group : : GOColorGroup
Absorb the reference to the group
References cb_history_changed().
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, | |||
| ColorNamePair const * | color_names | |||
| ) | [static] |
| static void go_menu_color_class_init | ( | GObjectClass * | gobject_class | ) | [static] |
| static GSF_CLASS | ( | GOMenuColor | , | |
| go_menu_color | , | |||
| go_menu_color_class_init | , | |||
| NULL | , | |||
| GTK_TYPE_MENU | ||||
| ) | [static] |
References COLOR_PREVIEW_HEIGHT, and COLOR_PREVIEW_WIDTH.
| 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 GDK_TO_UINT, and UINT_RGBA_CHANGE_A.
Referenced by cb_combo_custom_response(), and cb_menu_custom_response().
| 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 GDK_TO_UINT, and set_color().
Referenced by cb_swatch_key_press(), and cb_swatch_release_event().
ColorNamePair const default_color_set[] [static] |
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.5.5