mate-desktop 1.29.2
Library with common API for various MATE modules
Loading...
Searching...
No Matches
mate-colorsel.h File Reference
View source
#include <glib.h>
#include <gtk/gtk.h>
Include dependency graph for mate-colorsel.h:
This graph shows which files directly or indirectly include this file:

Data Structures

struct  _MateColorSelection
 
struct  _MateColorSelectionClass
 

Macros

#define MATE_TYPE_COLOR_SELECTION   (mate_color_selection_get_type ())
 
#define MATE_COLOR_SELECTION(obj)   (G_TYPE_CHECK_INSTANCE_CAST ((obj), MATE_TYPE_COLOR_SELECTION, MateColorSelection))
 
#define MATE_COLOR_SELECTION_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), MATE_TYPE_COLOR_SELECTION, MateColorSelectionClass))
 
#define MATE_IS_COLOR_SELECTION(obj)   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MATE_TYPE_COLOR_SELECTION))
 
#define MATE_IS_COLOR_SELECTION_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), MATE_TYPE_COLOR_SELECTION))
 
#define MATE_COLOR_SELECTION_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), MATE_TYPE_COLOR_SELECTION, MateColorSelectionClass))
 

Typedefs

typedef struct _MateColorSelection MateColorSelection
 
typedef struct _MateColorSelectionClass MateColorSelectionClass
 
typedef struct _MateColorSelectionPrivate MateColorSelectionPrivate
 
typedef void(* MateColorSelectionChangePaletteFunc) (const GdkRGBA *colors, gint n_colors)
 
typedef void(* MateColorSelectionChangePaletteWithScreenFunc) (GdkScreen *screen, const GdkRGBA *colors, gint n_colors)
 

Functions

GType mate_color_selection_get_type (void)
 
GtkWidget * mate_color_selection_new (void)
 mate_color_selection_new:
 
gboolean mate_color_selection_get_has_opacity_control (MateColorSelection *colorsel)
 mate_color_selection_get_has_opacity_control: @colorsel: a MateColorSelection.
 
void mate_color_selection_set_has_opacity_control (MateColorSelection *colorsel, gboolean has_opacity)
 mate_color_selection_set_has_opacity_control: @colorsel: a MateColorSelection.
 
gboolean mate_color_selection_get_has_palette (MateColorSelection *colorsel)
 mate_color_selection_get_has_palette: @colorsel: a MateColorSelection.
 
void mate_color_selection_set_has_palette (MateColorSelection *colorsel, gboolean has_palette)
 mate_color_selection_set_has_palette: @colorsel: a MateColorSelection.
 
void mate_color_selection_set_current_rgba (MateColorSelection *colorsel, const GdkRGBA *color)
 mate_color_selection_set_current_rgba: @colorsel: a MateColorSelection.
 
void mate_color_selection_set_current_alpha (MateColorSelection *colorsel, guint16 alpha)
 mate_color_selection_set_current_alpha: @colorsel: a MateColorSelection.
 
void mate_color_selection_get_current_rgba (MateColorSelection *colorsel, GdkRGBA *color)
 mate_color_selection_get_current_rgba: @colorsel: a MateColorSelection.
 
guint16 mate_color_selection_get_current_alpha (MateColorSelection *colorsel)
 mate_color_selection_get_current_alpha: @colorsel: a MateColorSelection.
 
void mate_color_selection_set_previous_color (MateColorSelection *colorsel, const GdkRGBA *color)
 mate_color_selection_set_previous_color: @colorsel: a MateColorSelection.
 
void mate_color_selection_set_previous_alpha (MateColorSelection *colorsel, guint16 alpha)
 mate_color_selection_set_previous_alpha: @colorsel: a MateColorSelection.
 
void mate_color_selection_get_previous_color (MateColorSelection *colorsel, GdkRGBA *color)
 mate_color_selection_get_previous_color: @colorsel: a MateColorSelection.
 
guint16 mate_color_selection_get_previous_alpha (MateColorSelection *colorsel)
 mate_color_selection_get_previous_alpha: @colorsel: a MateColorSelection.
 
gboolean mate_color_selection_is_adjusting (MateColorSelection *colorsel)
 mate_color_selection_is_adjusting: @colorsel: a MateColorSelection.
 
gboolean mate_color_selection_palette_from_string (const gchar *str, GdkRGBA **colors, gint *n_colors)
 mate_color_selection_palette_from_string: @str: a string encoding a color palette.
 
gchar * mate_color_selection_palette_to_string (const GdkRGBA *colors, gint n_colors)
 mate_color_selection_palette_to_string: @colors: (array length=n_colors): an array of colors.
 
MateColorSelectionChangePaletteFunc mate_color_selection_set_change_palette_hook (MateColorSelectionChangePaletteFunc func)
 mate_color_selection_set_change_palette_hook: @func: a function to call when the custom palette needs saving.
 
MateColorSelectionChangePaletteWithScreenFunc mate_color_selection_set_change_palette_with_screen_hook (MateColorSelectionChangePaletteWithScreenFunc func)
 mate_color_selection_set_change_palette_with_screen_hook: @func: a function to call when the custom palette needs saving.
 
void mate_color_selection_set_color (MateColorSelection *colorsel, gdouble *color)
 mate_color_selection_set_color: @colorsel: a MateColorSelection.
 
void mate_color_selection_get_color (MateColorSelection *colorsel, gdouble *color)
 mate_color_selection_get_color: @colorsel: a MateColorSelection.
 

Macro Definition Documentation

◆ MATE_COLOR_SELECTION

#define MATE_COLOR_SELECTION (   obj)    (G_TYPE_CHECK_INSTANCE_CAST ((obj), MATE_TYPE_COLOR_SELECTION, MateColorSelection))

◆ MATE_COLOR_SELECTION_CLASS

#define MATE_COLOR_SELECTION_CLASS (   klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), MATE_TYPE_COLOR_SELECTION, MateColorSelectionClass))

◆ MATE_COLOR_SELECTION_GET_CLASS

#define MATE_COLOR_SELECTION_GET_CLASS (   obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), MATE_TYPE_COLOR_SELECTION, MateColorSelectionClass))

◆ MATE_IS_COLOR_SELECTION

#define MATE_IS_COLOR_SELECTION (   obj)    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MATE_TYPE_COLOR_SELECTION))

◆ MATE_IS_COLOR_SELECTION_CLASS

#define MATE_IS_COLOR_SELECTION_CLASS (   klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), MATE_TYPE_COLOR_SELECTION))

◆ MATE_TYPE_COLOR_SELECTION

#define MATE_TYPE_COLOR_SELECTION   (mate_color_selection_get_type ())

Typedef Documentation

◆ MateColorSelection

◆ MateColorSelectionChangePaletteFunc

typedef void(* MateColorSelectionChangePaletteFunc) (const GdkRGBA *colors, gint n_colors)

◆ MateColorSelectionChangePaletteWithScreenFunc

typedef void(* MateColorSelectionChangePaletteWithScreenFunc) (GdkScreen *screen, const GdkRGBA *colors, gint n_colors)

◆ MateColorSelectionClass

◆ MateColorSelectionPrivate

Function Documentation

◆ mate_color_selection_get_color()

void mate_color_selection_get_color ( MateColorSelection *  colorsel,
gdouble *  color 
)

mate_color_selection_get_color: @colorsel: a MateColorSelection.

@color: an array of 4 #gdouble to fill in with the current color.

Sets @color to be the current color in the MateColorSelection widget.

Deprecated: 2.0: Use mate_color_selection_get_current_color() instead.

References _MateColorSelectionPrivate::color, COLORSEL_BLUE, COLORSEL_GREEN, COLORSEL_OPACITY, COLORSEL_RED, _MateColorSelectionPrivate::has_opacity, MATE_IS_COLOR_SELECTION, and _MateColorSelection::private_data.

◆ mate_color_selection_get_current_alpha()

guint16 mate_color_selection_get_current_alpha ( MateColorSelection *  colorsel)

mate_color_selection_get_current_alpha: @colorsel: a MateColorSelection.

Returns the current alpha value.

Return value: an integer between 0 and 65535.

References _MateColorSelectionPrivate::color, COLORSEL_OPACITY, _MateColorSelectionPrivate::has_opacity, MATE_IS_COLOR_SELECTION, _MateColorSelection::private_data, and UNSCALE.

Referenced by mate_color_selection_get_property().

◆ mate_color_selection_get_current_rgba()

void mate_color_selection_get_current_rgba ( MateColorSelection *  colorsel,
GdkRGBA *  color 
)

mate_color_selection_get_current_rgba: @colorsel: a MateColorSelection.

@color: (out): a #GdkRGBA to fill in with the current color.

Sets @color to be the current color in the MateColorSelection widget.

References _MateColorSelectionPrivate::color, COLORSEL_BLUE, COLORSEL_GREEN, COLORSEL_RED, MATE_IS_COLOR_SELECTION, and _MateColorSelection::private_data.

Referenced by copy_color(), and mate_color_selection_get_property().

◆ mate_color_selection_get_has_opacity_control()

gboolean mate_color_selection_get_has_opacity_control ( MateColorSelection *  colorsel)

mate_color_selection_get_has_opacity_control: @colorsel: a MateColorSelection.

Determines whether the colorsel has an opacity control.

Return value: TRUE if the @colorsel has an opacity control. FALSE if it does't.

References _MateColorSelectionPrivate::has_opacity, MATE_IS_COLOR_SELECTION, and _MateColorSelection::private_data.

Referenced by mate_color_selection_get_property().

◆ mate_color_selection_get_has_palette()

gboolean mate_color_selection_get_has_palette ( MateColorSelection *  colorsel)

mate_color_selection_get_has_palette: @colorsel: a MateColorSelection.

Determines whether the color selector has a color palette.

Return value: TRUE if the selector has a palette. FALSE if it hasn't.

References _MateColorSelectionPrivate::has_palette, MATE_IS_COLOR_SELECTION, and _MateColorSelection::private_data.

Referenced by mate_color_selection_get_property().

◆ mate_color_selection_get_previous_alpha()

guint16 mate_color_selection_get_previous_alpha ( MateColorSelection *  colorsel)

mate_color_selection_get_previous_alpha: @colorsel: a MateColorSelection.

Returns the previous alpha value.

Return value: an integer between 0 and 65535.

References COLORSEL_OPACITY, _MateColorSelectionPrivate::has_opacity, MATE_IS_COLOR_SELECTION, _MateColorSelectionPrivate::old_color, _MateColorSelection::private_data, and UNSCALE.

◆ mate_color_selection_get_previous_color()

void mate_color_selection_get_previous_color ( MateColorSelection *  colorsel,
GdkRGBA *  color 
)

mate_color_selection_get_previous_color: @colorsel: a MateColorSelection.

@color: (out): a #GdkRGBA to fill in with the original color value.

Fills @color in with the original color value.

References COLORSEL_BLUE, COLORSEL_GREEN, COLORSEL_RED, MATE_IS_COLOR_SELECTION, _MateColorSelectionPrivate::old_color, and _MateColorSelection::private_data.

◆ mate_color_selection_get_type()

GType mate_color_selection_get_type ( void  )

◆ mate_color_selection_is_adjusting()

gboolean mate_color_selection_is_adjusting ( MateColorSelection *  colorsel)

mate_color_selection_is_adjusting: @colorsel: a MateColorSelection.

Gets the current state of the @colorsel.

Return value: TRUE if the user is currently dragging a color around, and FALSE if the selection has stopped.

References MATE_HSV, mate_hsv_is_adjusting(), MATE_IS_COLOR_SELECTION, _MateColorSelection::private_data, and _MateColorSelectionPrivate::triangle_colorsel.

Here is the call graph for this function:

◆ mate_color_selection_new()

GtkWidget * mate_color_selection_new ( void  )

mate_color_selection_new:

Creates a new MateColorSelection.

Return value: a new MateColorSelection

References _MateColorSelectionPrivate::default_alpha_set, _MateColorSelectionPrivate::default_set, mate_color_selection_set_has_opacity_control(), MATE_TYPE_COLOR_SELECTION, _MateColorSelection::private_data, and set_color_internal().

Referenced by mate_color_selection_dialog_init().

Here is the call graph for this function:

◆ mate_color_selection_palette_from_string()

gboolean mate_color_selection_palette_from_string ( const gchar *  str,
GdkRGBA **  colors,
gint *  n_colors 
)

mate_color_selection_palette_from_string: @str: a string encoding a color palette.

@colors: (out) (array length=n_colors): return location for allocated array of #GdkRGBA. @n_colors: return location for length of array.

Parses a color palette string; the string is a colon-separated list of color names readable by gdk_color_parse().

Return value: TRUE if a palette was successfully parsed.

Referenced by get_current_colors().

◆ mate_color_selection_palette_to_string()

gchar * mate_color_selection_palette_to_string ( const GdkRGBA *  colors,
gint  n_colors 
)

mate_color_selection_palette_to_string: @colors: (array length=n_colors): an array of colors.

@n_colors: length of the array.

Encodes a palette as a string, useful for persistent storage.

Return value: allocated string encoding the palette.

References scale_round().

Referenced by default_change_palette_func().

Here is the call graph for this function:

◆ mate_color_selection_set_change_palette_hook()

MateColorSelectionChangePaletteFunc mate_color_selection_set_change_palette_hook ( MateColorSelectionChangePaletteFunc  func)

mate_color_selection_set_change_palette_hook: @func: a function to call when the custom palette needs saving.

Installs a global function to be called whenever the user tries to modify the palette in a color selection. This function should save the new palette contents, and update the GtkSettings property "gtk-color-palette" so all MateColorSelection widgets will be modified.

Return value: the previous change palette hook (that was replaced).

Deprecated: 2.4: This function does not work in multihead environments. Use mate_color_selection_set_change_palette_with_screen_hook() instead.

References noscreen_change_palette_hook.

◆ mate_color_selection_set_change_palette_with_screen_hook()

MateColorSelectionChangePaletteWithScreenFunc mate_color_selection_set_change_palette_with_screen_hook ( MateColorSelectionChangePaletteWithScreenFunc  func)

mate_color_selection_set_change_palette_with_screen_hook: @func: a function to call when the custom palette needs saving.

Installs a global function to be called whenever the user tries to modify the palette in a color selection. This function should save the new palette contents, and update the GtkSettings property "gtk-color-palette" so all MateColorSelection widgets will be modified.

Return value: the previous change palette hook (that was replaced).

Since: 1.9.1

References change_palette_hook.

◆ mate_color_selection_set_color()

void mate_color_selection_set_color ( MateColorSelection *  colorsel,
gdouble *  color 
)

mate_color_selection_set_color: @colorsel: a MateColorSelection.

@color: an array of 4 doubles specifying the red, green, blue and opacity to set the current color to.

Sets the current color to be @color. The first time this is called, it will also set the original color to be @color too.

Deprecated: 2.0: Use mate_color_selection_set_current_color() instead.

References MATE_IS_COLOR_SELECTION, and set_color_internal().

Here is the call graph for this function:

◆ mate_color_selection_set_current_alpha()

void mate_color_selection_set_current_alpha ( MateColorSelection *  colorsel,
guint16  alpha 
)

mate_color_selection_set_current_alpha: @colorsel: a MateColorSelection.

@alpha: an integer between 0 and 65535.

Sets the current opacity to be @alpha. The first time this is called, it will also set the original opacity to be @alpha too.

References _MateColorSelectionPrivate::changing, _MateColorSelectionPrivate::color, COLORSEL_NUM_CHANNELS, COLORSEL_OPACITY, _MateColorSelectionPrivate::default_alpha_set, MATE_IS_COLOR_SELECTION, _MateColorSelectionPrivate::old_color, _MateColorSelection::private_data, SCALE, and update_color().

Referenced by mate_color_selection_set_property().

Here is the call graph for this function:

◆ mate_color_selection_set_current_rgba()

void mate_color_selection_set_current_rgba ( MateColorSelection *  colorsel,
const GdkRGBA *  rgba 
)

mate_color_selection_set_current_rgba: @colorsel: a MateColorSelection.

@color: A #GdkRGBA to set the current color with.

Sets the current color to be @color. The first time this is called, it will also set the original color to be @color too.

References _MateColorSelectionPrivate::changing, _MateColorSelectionPrivate::color, COLORSEL_BLUE, COLORSEL_GREEN, COLORSEL_HUE, COLORSEL_NUM_CHANNELS, COLORSEL_OPACITY, COLORSEL_RED, COLORSEL_SATURATION, COLORSEL_VALUE, _MateColorSelectionPrivate::default_set, MATE_IS_COLOR_SELECTION, _MateColorSelectionPrivate::old_color, _MateColorSelection::private_data, and update_color().

Referenced by mate_color_selection_set_property().

Here is the call graph for this function:

◆ mate_color_selection_set_has_opacity_control()

void mate_color_selection_set_has_opacity_control ( MateColorSelection *  colorsel,
gboolean  has_opacity 
)

mate_color_selection_set_has_opacity_control: @colorsel: a MateColorSelection.

@has_opacity: TRUE if @colorsel can set the opacity, FALSE otherwise.

Sets the @colorsel to use or not use opacity.

References color_sample_update_samples(), _MateColorSelectionPrivate::has_opacity, MATE_IS_COLOR_SELECTION, _MateColorSelectionPrivate::opacity_entry, _MateColorSelectionPrivate::opacity_label, _MateColorSelectionPrivate::opacity_slider, and _MateColorSelection::private_data.

Referenced by mate_color_selection_dialog_init(), mate_color_selection_new(), and mate_color_selection_set_property().

Here is the call graph for this function:

◆ mate_color_selection_set_has_palette()

void mate_color_selection_set_has_palette ( MateColorSelection *  colorsel,
gboolean  has_palette 
)

mate_color_selection_set_has_palette: @colorsel: a MateColorSelection.

@has_palette: TRUE if palette is to be visible, FALSE otherwise.

Shows and hides the palette based upon the value of @has_palette.

References _MateColorSelectionPrivate::has_palette, MATE_IS_COLOR_SELECTION, _MateColorSelectionPrivate::palette_frame, _MateColorSelection::private_data, and update_tooltips().

Referenced by main(), mate_color_selection_dialog_init(), and mate_color_selection_set_property().

Here is the call graph for this function:

◆ mate_color_selection_set_previous_alpha()

void mate_color_selection_set_previous_alpha ( MateColorSelection *  colorsel,
guint16  alpha 
)

mate_color_selection_set_previous_alpha: @colorsel: a MateColorSelection.

@alpha: an integer between 0 and 65535.

Sets the 'previous' alpha to be @alpha. This function should be called with some hesitations, as it might seem confusing to have that alpha change.

References _MateColorSelectionPrivate::changing, color_sample_update_samples(), COLORSEL_OPACITY, _MateColorSelectionPrivate::default_alpha_set, MATE_IS_COLOR_SELECTION, _MateColorSelectionPrivate::old_color, _MateColorSelection::private_data, and SCALE.

Here is the call graph for this function:

◆ mate_color_selection_set_previous_color()

void mate_color_selection_set_previous_color ( MateColorSelection *  colorsel,
const GdkRGBA *  color 
)

mate_color_selection_set_previous_color: @colorsel: a MateColorSelection.

@color: a #GdkRGBA to set the previous color with.

Sets the 'previous' color to be @color. This function should be called with some hesitations, as it might seem confusing to have that color change. Calling mate_color_selection_set_current_color() will also set this color the first time it is called.

References _MateColorSelectionPrivate::changing, color_sample_update_samples(), COLORSEL_BLUE, COLORSEL_GREEN, COLORSEL_HUE, COLORSEL_RED, COLORSEL_SATURATION, COLORSEL_VALUE, _MateColorSelectionPrivate::default_set, MATE_IS_COLOR_SELECTION, _MateColorSelectionPrivate::old_color, and _MateColorSelection::private_data.

Here is the call graph for this function: