|
mate-desktop 1.29.2
Library with common API for various MATE modules
|
Data Structures | |
| struct | _MateHSVPrivate |
Macros | |
| #define | I_(string) g_intern_static_string (string) |
| #define | DEFAULT_SIZE 100 |
| SECTION:mate-hsv @Short_description: A “color wheel” widget @Title: MateHSV. | |
| #define | DEFAULT_RING_WIDTH 10 |
| #define | INTENSITY(r, g, b) ((r) * 0.30 + (g) * 0.59 + (b) * 0.11) |
| #define | SWAP(a, b, t) ((t) = (a), (a) = (b), (b) = (t)) |
| #define | LERP(a, b, v1, v2, i) |
| #define | PAD 3 |
| #define | RADIUS 4 |
| #define | FOCUS_RADIUS 6 |
| #define | HUE_DELTA 0.002 |
Enumerations | |
| enum | DragMode { DRAG_NONE , DRAG_H , DRAG_SV } |
| enum | { CHANGED , MOVE , LAST_SIGNAL } |
Functions | |
| static void | mate_hsv_destroy (GtkWidget *widget) |
| static void | mate_hsv_realize (GtkWidget *widget) |
| static void | mate_hsv_unrealize (GtkWidget *widget) |
| static void | mate_hsv_get_preferred_width (GtkWidget *widget, gint *minimum, gint *natural) |
| static void | mate_hsv_get_preferred_height (GtkWidget *widget, gint *minimum, gint *natural) |
| static void | mate_hsv_size_allocate (GtkWidget *widget, GtkAllocation *allocation) |
| static gboolean | mate_hsv_button_press (GtkWidget *widget, GdkEventButton *event) |
| static gboolean | mate_hsv_button_release (GtkWidget *widget, GdkEventButton *event) |
| static gboolean | mate_hsv_motion (GtkWidget *widget, GdkEventMotion *event) |
| static gboolean | mate_hsv_draw (GtkWidget *widget, cairo_t *cr) |
| static gboolean | mate_hsv_grab_broken (GtkWidget *widget, GdkEventGrabBroken *event) |
| static gboolean | mate_hsv_focus (GtkWidget *widget, GtkDirectionType direction) |
| static void | mate_hsv_move (MateHSV *hsv, GtkDirectionType dir) |
| static void | mate_hsv_class_init (MateHSVClass *class) |
| static void | mate_hsv_init (MateHSV *hsv) |
| static void | hsv_to_rgb (gdouble *h, gdouble *s, gdouble *v) |
| static void | compute_triangle (MateHSV *hsv, gint *hx, gint *hy, gint *sx, gint *sy, gint *vx, gint *vy) |
| static gboolean | is_in_ring (MateHSV *hsv, gdouble x, gdouble y) |
| static void | compute_sv (MateHSV *hsv, gdouble x, gdouble y, gdouble *s, gdouble *v) |
| static gboolean | is_in_triangle (MateHSV *hsv, gdouble x, gdouble y) |
| static double | compute_v (MateHSV *hsv, gdouble x, gdouble y) |
| static void | set_cross_grab (MateHSV *hsv, GdkDevice *device, guint32 time) |
| static void | paint_ring (MateHSV *hsv, cairo_t *cr) |
| static void | get_color (gdouble h, gdouble s, gdouble v, gint *r, gint *g, gint *b) |
| static void | paint_triangle (MateHSV *hsv, cairo_t *cr, gboolean draw_focus) |
| GtkWidget * | mate_hsv_new (void) |
| mate_hsv_new: | |
| void | mate_hsv_set_color (MateHSV *hsv, gdouble h, gdouble s, gdouble v) |
| mate_hsv_set_color: @hsv: An HSV color selector @h: Hue @s: Saturation @v: Value | |
| void | mate_hsv_get_color (MateHSV *hsv, double *h, double *s, double *v) |
| mate_hsv_get_color: @hsv: An HSV color selector @h: (out): Return value for the hue @s: (out): Return value for the saturation @v: (out): Return value for the value | |
| void | mate_hsv_set_metrics (MateHSV *hsv, gint size, gint ring_width) |
| mate_hsv_set_metrics: @hsv: An HSV color selector @size: Diameter for the hue ring @ring_width: Width of the hue ring | |
| void | mate_hsv_get_metrics (MateHSV *hsv, gint *size, gint *ring_width) |
| mate_hsv_get_metrics: @hsv: An HSV color selector @size: (out): Return value for the diameter of the hue ring @ring_width: (out): Return value for the width of the hue ring | |
| gboolean | mate_hsv_is_adjusting (MateHSV *hsv) |
| mate_hsv_is_adjusting: @hsv: A MateHSV | |
Variables | |
| static guint | hsv_signals [LAST_SIGNAL] |
| #define DEFAULT_RING_WIDTH 10 |
| #define DEFAULT_SIZE 100 |
SECTION:mate-hsv @Short_description: A “color wheel” widget @Title: MateHSV.
MateHSV is the “color wheel” part of a complete color selector widget. It allows to select a color by determining its HSV components in an intuitive way. Moving the selection around the outer ring changes the hue, and moving the selection point inside the inner triangle changes value and saturation.
| #define FOCUS_RADIUS 6 |
| #define HUE_DELTA 0.002 |
| #define I_ | ( | string | ) | g_intern_static_string (string) |
| #define INTENSITY | ( | r, | |
| g, | |||
| b | |||
| ) | ((r) * 0.30 + (g) * 0.59 + (b) * 0.11) |
| #define LERP | ( | a, | |
| b, | |||
| v1, | |||
| v2, | |||
| i | |||
| ) |
| #define PAD 3 |
| #define RADIUS 4 |
| #define SWAP | ( | a, | |
| b, | |||
| t | |||
| ) | ((t) = (a), (a) = (b), (b) = (t)) |
| enum DragMode |
|
static |
References compute_triangle().
Referenced by mate_hsv_button_press(), mate_hsv_button_release(), mate_hsv_motion(), and mate_hsv_move().
|
static |
References _MateHSVPrivate::h, _MateHSV::priv, _MateHSVPrivate::ring_width, and _MateHSVPrivate::size.
Referenced by compute_sv(), is_in_triangle(), mate_hsv_move(), and paint_triangle().
|
static |
Referenced by mate_hsv_button_press(), mate_hsv_button_release(), and mate_hsv_motion().
|
static |
|
static |
Referenced by get_color(), paint_ring(), and paint_triangle().
|
static |
References _MateHSV::priv, _MateHSVPrivate::ring_width, and _MateHSVPrivate::size.
Referenced by mate_hsv_button_press().
|
static |
References compute_triangle().
Referenced by mate_hsv_button_press().
|
static |
References compute_sv(), compute_v(), DRAG_H, DRAG_NONE, DRAG_SV, _MateHSVPrivate::focus_on_ring, _MateHSVPrivate::h, is_in_ring(), is_in_triangle(), MATE_HSV, mate_hsv_set_color(), _MateHSVPrivate::mode, _MateHSV::priv, _MateHSVPrivate::s, set_cross_grab(), and _MateHSVPrivate::v.
Referenced by mate_hsv_class_init().
|
static |
References compute_sv(), compute_v(), DRAG_H, DRAG_NONE, DRAG_SV, _MateHSVPrivate::h, MATE_HSV, mate_hsv_set_color(), _MateHSVPrivate::mode, _MateHSV::priv, _MateHSVPrivate::s, and _MateHSVPrivate::v.
Referenced by mate_hsv_class_init().
|
static |
References CHANGED, hsv_signals, I_, mate_hsv_button_press(), mate_hsv_button_release(), MATE_HSV_CLASS, mate_hsv_destroy(), mate_hsv_draw(), mate_hsv_focus(), mate_hsv_get_preferred_height(), mate_hsv_get_preferred_width(), mate_hsv_grab_broken(), mate_hsv_motion(), mate_hsv_move(), mate_hsv_realize(), mate_hsv_size_allocate(), mate_hsv_unrealize(), MOVE, and _MateHSVClass::move.
|
static |
Referenced by mate_hsv_class_init().
|
static |
References _MateHSVPrivate::focus_on_ring, MATE_HSV, paint_ring(), paint_triangle(), and _MateHSV::priv.
Referenced by mate_hsv_class_init().
|
static |
References _MateHSVPrivate::focus_on_ring, MATE_HSV, and _MateHSV::priv.
Referenced by mate_hsv_class_init().
| void mate_hsv_get_color | ( | MateHSV * | hsv, |
| double * | h, | ||
| double * | s, | ||
| double * | v | ||
| ) |
mate_hsv_get_color: @hsv: An HSV color selector @h: (out): Return value for the hue @s: (out): Return value for the saturation @v: (out): Return value for the value
Queries the current color in an HSV color selector. Returned values will be in the [0.0, 1.0] range.
References _MateHSVPrivate::h, MATE_IS_HSV, _MateHSV::priv, _MateHSVPrivate::s, and _MateHSVPrivate::v.
Referenced by hsv_changed().
| void mate_hsv_get_metrics | ( | MateHSV * | hsv, |
| gint * | size, | ||
| gint * | ring_width | ||
| ) |
mate_hsv_get_metrics: @hsv: An HSV color selector @size: (out): Return value for the diameter of the hue ring @ring_width: (out): Return value for the width of the hue ring
Queries the size and ring width of an HSV color selector.
References MATE_IS_HSV, _MateHSV::priv, _MateHSVPrivate::ring_width, and _MateHSVPrivate::size.
|
static |
References MATE_HSV, _MateHSV::priv, and _MateHSVPrivate::size.
Referenced by mate_hsv_class_init().
|
static |
References MATE_HSV, _MateHSV::priv, and _MateHSVPrivate::size.
Referenced by mate_hsv_class_init().
|
static |
References DRAG_NONE, MATE_HSV, _MateHSVPrivate::mode, and _MateHSV::priv.
Referenced by mate_hsv_class_init().
|
static |
| gboolean mate_hsv_is_adjusting | ( | MateHSV * | hsv | ) |
mate_hsv_is_adjusting: @hsv: A MateHSV
An HSV color selector can be said to be adjusting if multiple rapid changes are being made to its value, for example, when the user is adjusting the value with the mouse. This function queries whether the HSV color selector is being adjusted or not.
Returns: TRUE if clients can ignore changes to the color value, since they may be transitory, or FALSE if they should consider the color value status to be final.
References DRAG_NONE, MATE_IS_HSV, _MateHSVPrivate::mode, and _MateHSV::priv.
Referenced by mate_color_selection_is_adjusting().
|
static |
References compute_sv(), compute_v(), DRAG_H, DRAG_NONE, DRAG_SV, _MateHSVPrivate::h, MATE_HSV, mate_hsv_set_color(), _MateHSVPrivate::mode, _MateHSV::priv, _MateHSVPrivate::s, and _MateHSVPrivate::v.
Referenced by mate_hsv_class_init().
|
static |
References compute_sv(), compute_triangle(), _MateHSVPrivate::focus_on_ring, _MateHSVPrivate::h, HUE_DELTA, mate_hsv_set_color(), _MateHSV::priv, _MateHSVPrivate::s, and _MateHSVPrivate::v.
Referenced by mate_hsv_class_init().
| GtkWidget * mate_hsv_new | ( | void | ) |
mate_hsv_new:
Creates a new HSV color selector.
Returns: A newly-created HSV color selector.
References MATE_TYPE_HSV.
Referenced by mate_color_selection_init().
|
static |
References MATE_HSV, _MateHSV::priv, and _MateHSVPrivate::window.
Referenced by mate_hsv_class_init().
| void mate_hsv_set_color | ( | MateHSV * | hsv, |
| gdouble | h, | ||
| gdouble | s, | ||
| gdouble | v | ||
| ) |
mate_hsv_set_color: @hsv: An HSV color selector @h: Hue @s: Saturation @v: Value
Sets the current color in an HSV color selector. Color component values must be in the [0.0, 1.0] range.
References CHANGED, _MateHSVPrivate::h, hsv_signals, MATE_IS_HSV, _MateHSV::priv, _MateHSVPrivate::s, and _MateHSVPrivate::v.
Referenced by mate_hsv_button_press(), mate_hsv_button_release(), mate_hsv_motion(), mate_hsv_move(), and update_color().
| void mate_hsv_set_metrics | ( | MateHSV * | hsv, |
| gint | size, | ||
| gint | ring_width | ||
| ) |
mate_hsv_set_metrics: @hsv: An HSV color selector @size: Diameter for the hue ring @ring_width: Width of the hue ring
Sets the size and ring width of an HSV color selector.
References MATE_IS_HSV, _MateHSV::priv, _MateHSVPrivate::ring_width, and _MateHSVPrivate::size.
Referenced by mate_color_selection_init().
|
static |
References MATE_HSV, _MateHSV::priv, and _MateHSVPrivate::window.
Referenced by mate_hsv_class_init().
|
static |
References MATE_HSV, _MateHSV::priv, and _MateHSVPrivate::window.
Referenced by mate_hsv_class_init().
|
static |
References _MateHSVPrivate::h, hsv_to_rgb(), INTENSITY, _MateHSV::priv, _MateHSVPrivate::ring_width, and _MateHSVPrivate::size.
Referenced by mate_hsv_draw().
|
static |
References compute_triangle(), _MateHSVPrivate::focus_on_ring, FOCUS_RADIUS, get_color(), _MateHSVPrivate::h, hsv_to_rgb(), INTENSITY, LERP, PAD, _MateHSV::priv, RADIUS, _MateHSVPrivate::s, SWAP, and _MateHSVPrivate::v.
Referenced by mate_hsv_draw().
|
static |
References _MateHSV::priv, and _MateHSVPrivate::window.
Referenced by mate_hsv_button_press().
|
static |
Referenced by mate_hsv_class_init(), and mate_hsv_set_color().