Classes | Defines | Enumerations | Functions | Variables

go-color-palette.c File Reference

#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>


struct  _GOColorPalette
struct  GOColorPaletteClass
struct  GOMenuColor
struct  GOMenuColorClass






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


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 Documentation


Enumeration Type Documentation

anonymous enum

Function Documentation

static void cb_combo_custom_clicked ( G_GNUC_UNUSED GtkWidget *  button,
GOColorPalette pal 
) [static]
static void cb_combo_custom_response ( GtkColorSelectionDialog *  dialog,
gint  response_id,
GOColorPalette pal 
) [static]
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]
static void cb_menu_color_activate ( GtkWidget *  button,
GOMenuColor menu 
) [static]
static void cb_menu_custom_activate ( G_GNUC_UNUSED GtkWidget *  button,
GOMenuColor menu 
) [static]
static void cb_menu_custom_response ( GtkColorSelectionDialog *  dialog,
gint  response_id,
GOMenuColor menu 
) [static]
static void cb_menu_default_activate ( G_GNUC_UNUSED GtkWidget *  button,
GOMenuColor menu 
) [static]
static gboolean cb_swatch_key_press ( GtkBin *  button,
GdkEventKey *  event,
GOColorPalette pal 
) [static]
static gboolean cb_swatch_release_event ( GtkBin *  button,
G_GNUC_UNUSED GdkEventButton *  event,
GOColorPalette pal 
) [static]
static GtkWidget* create_color_sel ( GObject *  action_proxy,
GOColor  c,
GCallback  handler,
gboolean  allow_alpha 
) [static]
static gboolean draw_color_cb ( GtkWidget *  widget,
cairo_t *  cr,
gpointer  data 
) [static]
static GtkWidget* go_color_palette_button_new ( GOColorPalette pal,
GtkTable *  table,
GONamedColor const *  color_name,
gint  col,
gint  row 
) [static]
static void go_color_palette_class_init ( GObjectClass *  gobject_class  )  [static]
static void go_color_palette_finalize ( GObject *  object  )  [static]
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: : 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 
void go_color_palette_set_color_to_default ( GOColorPalette pal  ) 
void go_color_palette_set_current_color ( GOColorPalette pal,
GOColor  color 
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 
static GtkWidget* go_color_palette_setup ( GOColorPalette pal,
char const *  no_color_label,
int  cols,
int  rows,
GONamedColor 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  ,
) [static]
GSF_CLASS ( GOColorPalette  ,
go_color_palette  ,
go_color_palette_class_init  ,
static gboolean handle_color_sel ( GtkColorSelectionDialog *  dialog,
gint  response_id,
GOColor res 
) [static]
static GtkWidget* make_colored_menu_item ( char const *  label,
GOColor  c 
) [static]
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]

Variable Documentation

GObjectClass* go_color_palette_parent_class [static]
guint go_color_palette_signals[LAST_SIGNAL] = { 0, } [static]
guint go_menu_color_signals[LAST_SIGNAL] = { 0, } [static]