Ewl_Spectrum: The colour spectrum widget
Detailed Description
Defines a colour spectrum widget
- Remarks:
- Inherits from Ewl_Container.
Data Structures | |
struct | Ewl_Spectrum |
Inherits from Ewl_Container and extends to provide a colour spectrum. More... | |
Defines | |
#define | EWL_SPECTRUM(sp) ((Ewl_Spectrum *)sp) |
#define | EWL_SPECTRUM_IS(w) (ewl_widget_type_is(EWL_WIDGET(w), EWL_SPECTRUM_TYPE)) |
#define | EWL_SPECTRUM_TYPE "spectrum" |
Typedefs | |
typedef struct Ewl_Spectrum | Ewl_Spectrum |
Functions | |
void | ewl_spectrum_canvas_cb_reveal (Ewl_Widget *w, void *ev, void *data) |
void | ewl_spectrum_cb_configure (Ewl_Widget *w, void *ev, void *data) |
void | ewl_spectrum_cb_mouse_down (Ewl_Widget *w, void *ev, void *data) |
void | ewl_spectrum_cb_mouse_move (Ewl_Widget *w, void *ev, void *data) |
void | ewl_spectrum_cb_mouse_up (Ewl_Widget *w, void *ev, void *data) |
void | ewl_spectrum_hsv_get (Ewl_Spectrum *sp, double *h, double *s, double *v) |
Get the HSV value from the spectrum. | |
void | ewl_spectrum_hsv_set (Ewl_Spectrum *sp, double h, double s, double v) |
Set the HSV values for the spectrum. | |
int | ewl_spectrum_init (Ewl_Spectrum *sp) |
Initializes an Ewl_Specturm widget to default values. | |
Ewl_Color_Mode | ewl_spectrum_mode_get (Ewl_Spectrum *sp) |
Get the mode of the spectrum. | |
void | ewl_spectrum_mode_set (Ewl_Spectrum *sp, Ewl_Color_Mode mode) |
Set the mode of the spectrum. | |
Ewl_Widget * | ewl_spectrum_new (void) |
Creates a new Ewl_Spectrum widget. | |
void | ewl_spectrum_rgb_get (Ewl_Spectrum *sp, unsigned int *r, unsigned int *g, unsigned int *b) |
Get the RGB values for the spectrum. | |
void | ewl_spectrum_rgb_set (Ewl_Spectrum *sp, unsigned int r, unsigned int g, unsigned int b) |
Set the RGB values for the spectrum. | |
Ewl_Spectrum_Type | ewl_spectrum_type_get (Ewl_Spectrum *sp) |
Get the type of the spectrum. | |
void | ewl_spectrum_type_set (Ewl_Spectrum *sp, Ewl_Spectrum_Type type) |
Set the type of the spectrum. |
Define Documentation
#define EWL_SPECTRUM | ( | sp | ) | ((Ewl_Spectrum *)sp) |
Typecasts a pointer to an Ewl_Spectrum pointer.
Referenced by ewl_colorpicker_cb_radio_change(), ewl_colorpicker_cb_spinner_change(), ewl_colorpicker_cb_square_change(), ewl_colorpicker_cb_vertical_change(), ewl_colorpicker_color_mode_set(), ewl_colorpicker_current_rgb_get(), ewl_colorpicker_current_rgb_set(), ewl_colorpicker_init(), ewl_spectrum_canvas_cb_reveal(), ewl_spectrum_cb_configure(), ewl_spectrum_cb_mouse_down(), ewl_spectrum_cb_mouse_move(), ewl_spectrum_cb_mouse_up(), and ewl_spectrum_new().
#define EWL_SPECTRUM_IS | ( | w | ) | (ewl_widget_type_is(EWL_WIDGET(w), EWL_SPECTRUM_TYPE)) |
Returns TRUE if the widget is an Ewl_Spectrum, FALSE otherwise
#define EWL_SPECTRUM_TYPE "spectrum" |
The type name for the Ewl_Spectrum widget
Referenced by ewl_spectrum_canvas_cb_reveal(), ewl_spectrum_cb_configure(), ewl_spectrum_cb_mouse_down(), ewl_spectrum_cb_mouse_move(), ewl_spectrum_cb_mouse_up(), ewl_spectrum_hsv_get(), ewl_spectrum_hsv_set(), ewl_spectrum_init(), ewl_spectrum_mode_get(), ewl_spectrum_mode_set(), ewl_spectrum_rgb_get(), ewl_spectrum_rgb_set(), ewl_spectrum_type_get(), and ewl_spectrum_type_set().
Typedef Documentation
typedef struct Ewl_Spectrum Ewl_Spectrum |
Provides a colour spectrum.
Function Documentation
void ewl_spectrum_canvas_cb_reveal | ( | Ewl_Widget * | w, | |
void * | ev, | |||
void * | data | |||
) |
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, dirty, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_SPECTRUM, EWL_SPECTRUM_TYPE, EWL_WIDGET, and ewl_widget_configure().
Referenced by ewl_spectrum_init().
void ewl_spectrum_cb_configure | ( | Ewl_Widget * | w, | |
void * | ev, | |||
void * | data | |||
) |
References canvas, CURRENT_H, CURRENT_W, CURRENT_X, CURRENT_Y, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, EWL_OBJECT, ewl_object_position_request(), ewl_object_size_request(), EWL_SPECTRUM, EWL_SPECTRUM_TYPE, and REALIZED.
Referenced by ewl_spectrum_init().
void ewl_spectrum_cb_mouse_down | ( | Ewl_Widget * | w, | |
void * | ev, | |||
void * | data | |||
) |
void ewl_spectrum_cb_mouse_move | ( | Ewl_Widget * | w, | |
void * | ev, | |||
void * | data | |||
) |
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_SPECTRUM, EWL_SPECTRUM_TYPE, Ewl_Event_Mouse::x, and Ewl_Event_Mouse::y.
Referenced by ewl_spectrum_cb_mouse_down(), and ewl_spectrum_cb_mouse_up().
void ewl_spectrum_cb_mouse_up | ( | Ewl_Widget * | w, | |
void * | ev, | |||
void * | data | |||
) |
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, ewl_callback_del(), EWL_CALLBACK_MOUSE_MOVE, EWL_SPECTRUM, ewl_spectrum_cb_mouse_move(), and EWL_SPECTRUM_TYPE.
Referenced by ewl_spectrum_init().
void ewl_spectrum_hsv_get | ( | Ewl_Spectrum * | sp, | |
double * | h, | |||
double * | s, | |||
double * | v | |||
) |
Get the HSV value from the spectrum.
- Parameters:
-
sp,: The Ewl_Spectrum to get the hsv values from h,: Where to place the hue s,: Where to place the saturation v,: Where to place the value
- Returns:
- Returns no value.
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_SPECTRUM_TYPE, h, hsv, s, and v.
Referenced by ewl_colorpicker_cb_spinner_change(), ewl_colorpicker_cb_square_change(), ewl_colorpicker_cb_vertical_change(), ewl_colorpicker_current_rgb_set(), and ewl_colorpicker_init().
void ewl_spectrum_hsv_set | ( | Ewl_Spectrum * | sp, | |
double | h, | |||
double | s, | |||
double | v | |||
) |
Set the HSV values for the spectrum.
- Parameters:
-
sp,: The Ewl_Spectrum to set the hsv value into h,: The hue to set s,: The saturation to set v,: The value to set
- Returns:
- Returns no value
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, dirty, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_SPECTRUM_TYPE, EWL_WIDGET, ewl_widget_configure(), h, hsv, s, and v.
Referenced by ewl_colorpicker_cb_spinner_change(), and ewl_colorpicker_cb_vertical_change().
int ewl_spectrum_init | ( | Ewl_Spectrum * | sp | ) |
Initializes an Ewl_Specturm widget to default values.
- Parameters:
-
sp,: The Ewl_Spectrum to init
- Returns:
- Returns TRUE on success or FALSE on failure
References canvas, cross_hairs, DCHECK_PARAM_PTR_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, ewl_callback_append(), EWL_CALLBACK_CONFIGURE, EWL_CALLBACK_MOUSE_DOWN, EWL_CALLBACK_MOUSE_MOVE, EWL_CALLBACK_MOUSE_UP, EWL_CALLBACK_REVEAL, EWL_CONTAINER, ewl_container_callback_intercept(), ewl_container_child_append(), ewl_container_init(), EWL_FLAG_FILL_FILL, ewl_hseparator_new(), ewl_image_new(), EWL_OBJECT, ewl_object_fill_policy_set(), ewl_spectrum_canvas_cb_reveal(), ewl_spectrum_cb_configure(), ewl_spectrum_cb_mouse_down(), ewl_spectrum_cb_mouse_up(), ewl_spectrum_rgb_set(), EWL_SPECTRUM_TYPE, EWL_SPECTRUM_TYPE_SQUARE, ewl_vseparator_new(), EWL_WIDGET, ewl_widget_appearance_set(), ewl_widget_inherit(), ewl_widget_internal_set(), ewl_widget_layer_priority_set(), ewl_widget_show(), horizontal, type, and vertical.
Referenced by ewl_spectrum_new().
Ewl_Color_Mode ewl_spectrum_mode_get | ( | Ewl_Spectrum * | sp | ) |
Get the mode of the spectrum.
- Parameters:
-
sp,: The Ewl_Spectrum to get the mode from
- Returns:
- Returns the mode of the spectrum
References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_COLOR_MODE_HSV_HUE, EWL_SPECTRUM_TYPE, and mode.
void ewl_spectrum_mode_set | ( | Ewl_Spectrum * | sp, | |
Ewl_Color_Mode | mode | |||
) |
Set the mode of the spectrum.
- Parameters:
-
sp,: The Ewl_Spectrum to set the mode on mode,: The mode to set the spectrum too
- Returns:
- Returns no value.
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, dirty, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_SPECTRUM_TYPE, EWL_WIDGET, ewl_widget_configure(), and mode.
Referenced by ewl_colorpicker_cb_radio_change(), and ewl_colorpicker_color_mode_set().
Ewl_Widget* ewl_spectrum_new | ( | void | ) |
Creates a new Ewl_Spectrum widget.
- Returns:
- Returns a new Ewl_Spectrum widget or NULL on failure
References DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_PTR, EWL_SPECTRUM, ewl_spectrum_init(), ewl_widget_destroy(), and NEW.
Referenced by ewl_colorpicker_init().
void ewl_spectrum_rgb_get | ( | Ewl_Spectrum * | sp, | |
unsigned int * | r, | |||
unsigned int * | g, | |||
unsigned int * | b | |||
) |
Get the RGB values for the spectrum.
- Parameters:
-
sp,: The Ewl_Spectrum to get the rgb values from r,: Where to store the red value g,: Where to store the green value b,: Where to store the blue value
- Returns:
- Returns no value.
References b, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_SPECTRUM_TYPE, g, r, and rgb.
Referenced by ewl_colorpicker_cb_spinner_change(), ewl_colorpicker_cb_square_change(), ewl_colorpicker_cb_vertical_change(), and ewl_colorpicker_current_rgb_get().
void ewl_spectrum_rgb_set | ( | Ewl_Spectrum * | sp, | |
unsigned int | r, | |||
unsigned int | g, | |||
unsigned int | b | |||
) |
Set the RGB values for the spectrum.
- Parameters:
-
sp,: The Ewl_Spectrum to set the colour into r,: The red value to set g,: The green value to set b,: The blue value to set
- Returns:
- Returns no value
References b, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, dirty, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_SPECTRUM_TYPE, EWL_WIDGET, ewl_widget_configure(), g, r, and rgb.
Referenced by ewl_colorpicker_cb_spinner_change(), ewl_colorpicker_cb_vertical_change(), ewl_colorpicker_current_rgb_set(), ewl_colorpicker_init(), and ewl_spectrum_init().
Ewl_Spectrum_Type ewl_spectrum_type_get | ( | Ewl_Spectrum * | sp | ) |
Get the type of the spectrum.
- Parameters:
-
sp,: The Ewl_Spectrum to get the type from
- Returns:
- Returns the spectrum type
References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_SPECTRUM_TYPE, EWL_SPECTRUM_TYPE_SQUARE, and type.
void ewl_spectrum_type_set | ( | Ewl_Spectrum * | sp, | |
Ewl_Spectrum_Type | type | |||
) |
Set the type of the spectrum.
- Parameters:
-
sp,: The Ewl_Spectrum to set the type on type,: The type to set the spectrum too
- Returns:
- Returns no value
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_SPECTRUM_TYPE, EWL_WIDGET, ewl_widget_configure(), and type.
Referenced by ewl_colorpicker_init().