#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 (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 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 (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 *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) |
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 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: : 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 | ( | 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 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 UINT_RGBA_A.
Referenced by cb_combo_custom_clicked(), and cb_menu_custom_activate().
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().
GOColor go_color_palette_get_current_color | ( | GOColorPalette * | pal, | |
gboolean * | is_default, | |||
gboolean * | is_custom | |||
) |
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
go_color_palette_make_menu: : color label : GOColor : GOColorGroup : optional string : 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(), GOColorGroup::history, make_colored_menu_item(), and rows.
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
References go_color_palette_set_group(), go_color_palette_setup(), GO_COLOR_PALETTE_TYPE, GO_TYPE_COLOR_PALETTE, and rows.
void go_color_palette_set_allow_alpha | ( | GOColorPalette * | pal, | |
gboolean | allow_alpha | |||
) |
void go_color_palette_set_color_to_default | ( | GOColorPalette * | pal | ) |
References set_color().
void go_color_palette_set_current_color | ( | GOColorPalette * | pal, | |
GOColor | color | |||
) |
References set_color().
void go_color_palette_set_group | ( | GOColorPalette * | pal, | |
GOColorGroup * | cg | |||
) |
go_color_palette_set_group : : GOColorGroup
go_color_palette_set_group : : GOColorPalette : GOColorGroup
Absorb the reference to the group
References cb_history_changed().
void go_color_palette_set_title | ( | GOColorPalette * | pal, | |
char const * | title | |||
) |
static GtkWidget* go_color_palette_setup | ( | GOColorPalette * | pal, | |
char const * | no_color_label, | |||
int | cols, | |||
int | rows, | |||
ColorNamePair const * | color_names | |||
) | [static] |
References _, cb_combo_custom_clicked(), cb_default_release_event(), _ColorNamePair::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] |
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] |