Libcroco
|
Go to the source code of this file.
Data Structures | |
struct | _CRRgb |
Typedefs | |
typedef typedefG_BEGIN_DECLS struct _CRRgb | CRRgb |
Functions | |
CRRgb * | cr_rgb_new (void) |
cr_rgb_new: More... | |
CRRgb * | cr_rgb_new_with_vals (gulong a_red, gulong a_green, gulong a_blue, gboolean a_is_percentage) |
cr_rgb_new_with_vals: @a_red: the red component of the color. More... | |
CRRgb * | cr_rgb_parse_from_buf (const guchar *a_str, enum CREncoding a_enc) |
cr_rgb_parse_from_buf: @a_str: a string that contains a color description @a_enc: the encoding of a_str More... | |
enum CRStatus | cr_rgb_compute_from_percentage (CRRgb *a_this) |
cr_rgb_compute_from_percentage: @a_this: the current instance of CRRgb More... | |
enum CRStatus | cr_rgb_set (CRRgb *a_this, gulong a_red, gulong a_green, gulong a_blue, gboolean a_is_percentage) |
cr_rgb_set: @a_this: the current instance of CRRgb. More... | |
enum CRStatus | cr_rgb_copy (CRRgb *a_dest, CRRgb const *a_src) |
enum CRStatus | cr_rgb_set_to_inherit (CRRgb *a_this, gboolean a_inherit) |
cr_rgb_set_to_inherit: @a_this: the current instance of CRRgb More... | |
gboolean | cr_rgb_is_set_to_inherit (CRRgb const *a_this) |
cr_rgb_is_set_to_inherit: More... | |
gboolean | cr_rgb_is_set_to_transparent (CRRgb const *a_this) |
cr_rgb_is_set_to_transparent: @a_this: the current instance of CRRgb More... | |
enum CRStatus | cr_rgb_set_to_transparent (CRRgb *a_this, gboolean a_is_transparent) |
cr_rgb_set_to_transparent: @a_this: the current instance of CRRgb @a_is_transparent: set to transparent or not. More... | |
enum CRStatus | cr_rgb_set_from_rgb (CRRgb *a_this, CRRgb const *a_rgb) |
cr_rgb_set_from_rgb: @a_this: the current instance of CRRgb. More... | |
enum CRStatus | cr_rgb_set_from_name (CRRgb *a_this, const guchar *a_color_name) |
cr_rgb_set_from_name: @a_this: the current instance of CRRgb @a_color_name: the color name More... | |
enum CRStatus | cr_rgb_set_from_hex_str (CRRgb *a_this, const guchar *a_hex_value) |
cr_rgb_set_from_hex_str: @a_this: the current instance of CRRgb @a_hex: the hexadecimal value to set. More... | |
enum CRStatus | cr_rgb_set_from_term (CRRgb *a_this, const struct _CRTerm *a_value) |
cr_rgb_set_from_term: @a_this: the instance of CRRgb to set @a_value: the terminal from which to set More... | |
guchar * | cr_rgb_to_string (CRRgb const *a_this) |
cr_rgb_to_string: @a_this: the instance of CRRgb to serialize. More... | |
void | cr_rgb_dump (CRRgb const *a_this, FILE *a_fp) |
cr_rgb_dump: @a_this: the "this pointer" of the current instance of CRRgb. More... | |
void | cr_rgb_destroy (CRRgb *a_this) |
cr_rgb_destroy: @a_this: the "this pointer" of the current instance of CRRgb. More... | |
cr_rgb_compute_from_percentage: @a_this: the current instance of CRRgb
If the rgb values are expressed in percentage, compute their real value.
Returns CR_OK upon successful completion, an error code otherwise.
Definition at line 319 of file cr-rgb.c.
References CR_BAD_PARAM_ERROR, and CR_OK.
Definition at line 615 of file cr-rgb.c.
References CR_BAD_PARAM_ERROR, and CR_OK.
Referenced by cr_rgb_set_from_rgb(), and cr_style_resolve_inherited_properties().
void cr_rgb_destroy | ( | CRRgb * | a_this | ) |
void cr_rgb_dump | ( | CRRgb const * | a_this, |
FILE * | a_fp | ||
) |
cr_rgb_dump: @a_this: the "this pointer" of the current instance of CRRgb.
@a_fp: the destination file pointer.
Dumps the current instance of CRRgb to a file.
Definition at line 294 of file cr-rgb.c.
References cr_rgb_to_string().
gboolean cr_rgb_is_set_to_inherit | ( | CRRgb const * | a_this | ) |
cr_rgb_is_set_to_inherit:
@a_this: the current instance of CRRgb.
Returns TRUE if the rgb is set to the value "inherit", FALSE otherwise.
Definition at line 393 of file cr-rgb.c.
References CR_BAD_PARAM_ERROR.
Referenced by cr_style_resolve_inherited_properties().
gboolean cr_rgb_is_set_to_transparent | ( | CRRgb const * | a_this | ) |
CRRgb* cr_rgb_new | ( | void | ) |
cr_rgb_new:
The default constructor of CRRgb.
Returns the newly built instance of CRRgb
Definition at line 192 of file cr-rgb.c.
References cr_utils_trace_info.
Referenced by cr_rgb_new_with_vals(), and cr_rgb_parse_from_buf().
CRRgb* cr_rgb_new_with_vals | ( | gulong | a_red, |
gulong | a_green, | ||
gulong | a_blue, | ||
gboolean | a_is_percentage | ||
) |
cr_rgb_new_with_vals: @a_red: the red component of the color.
@a_green: the green component of the color. @a_blue: the blue component of the color. @a_unit: the unit of the rgb values. (either percentage or integer values)
A constructor of CRRgb.
Returns the newly built instance of CRRgb.
Definition at line 221 of file cr-rgb.c.
References cr_rgb_new().
CRRgb* cr_rgb_parse_from_buf | ( | const guchar * | a_str, |
enum CREncoding | a_enc | ||
) |
cr_rgb_parse_from_buf: @a_str: a string that contains a color description @a_enc: the encoding of a_str
Parses a text buffer that contains a rgb color
Returns the parsed color, or NULL in case of error
Definition at line 648 of file cr-rgb.c.
References CR_OK, cr_parser_destroy(), cr_parser_new_from_buf(), cr_parser_parse_term(), cr_parser_try_to_skip_spaces_and_comments(), cr_rgb_new(), cr_rgb_set_from_term(), and cr_term_destroy().
enum CRStatus cr_rgb_set | ( | CRRgb * | a_this, |
gulong | a_red, | ||
gulong | a_green, | ||
gulong | a_blue, | ||
gboolean | a_is_percentage | ||
) |
cr_rgb_set: @a_this: the current instance of CRRgb.
@a_red: the red value. @a_green: the green value. @a_blue: the blue value.
Sets rgb values to the RGB.
Returns CR_OK upon successful completion, an error code otherwise.
Definition at line 345 of file cr-rgb.c.
References CR_BAD_PARAM_ERROR, and CR_OK.
Referenced by cr_rgb_set_from_hex_str(), cr_style_set_props_to_default_values(), and cr_style_set_props_to_initial_values().
cr_rgb_set_from_hex_str: @a_this: the current instance of CRRgb @a_hex: the hexadecimal value to set.
Returns CR_OK upon successful completion.
Definition at line 501 of file cr-rgb.c.
References CR_BAD_PARAM_ERROR, CR_OK, cr_rgb_set(), cr_rgb_set_to_transparent(), and CR_UNKNOWN_TYPE_ERROR.
Referenced by cr_rgb_set_from_term().
cr_rgb_set_from_name: @a_this: the current instance of CRRgb @a_color_name: the color name
Returns CR_OK upon successful completion, an error code otherwise.
Definition at line 473 of file cr-rgb.c.
References CR_BAD_PARAM_ERROR, and CR_OK.
Referenced by cr_rgb_set_from_term().
cr_rgb_set_from_rgb: @a_this: the current instance of CRRgb.
@a_rgb: the rgb to "copy"
Sets the rgb from an other one.
Returns CR_OK upon successful completion, an error code otherwise.
Definition at line 446 of file cr-rgb.c.
References CR_BAD_PARAM_ERROR, CR_OK, and cr_rgb_copy().
Referenced by cr_rgb_set_from_term().
cr_rgb_set_from_term: @a_this: the instance of CRRgb to set @a_value: the terminal from which to set
Set the rgb from a terminal symbol
Returns CR_OK upon successful completion, an error code otherwise.
Definition at line 564 of file cr-rgb.c.
References _CRTerm::content, CR_BAD_PARAM_ERROR, CR_OK, cr_rgb_set_from_hex_str(), cr_rgb_set_from_name(), cr_rgb_set_from_rgb(), CR_UNKNOWN_TYPE_ERROR, cr_utils_trace_info, _CRTerm::rgb, _CRTerm::str, TERM_HASH, TERM_IDENT, TERM_RGB, and _CRTerm::type.
Referenced by cr_rgb_parse_from_buf().
cr_rgb_set_to_inherit: @a_this: the current instance of CRRgb
sets the value of the rgb to inherit. Look at the css spec from chapter 6.1 to 6.2 to understand the meaning of "inherit".
Returns CR_OK upon succesful completion, an error code otherwise.
Definition at line 376 of file cr-rgb.c.
References CR_BAD_PARAM_ERROR, and CR_OK.
Referenced by cr_style_set_props_to_default_values().
cr_rgb_set_to_transparent: @a_this: the current instance of CRRgb @a_is_transparent: set to transparent or not.
Sets the rgb to the "transparent" value (or not) Returns CR_OK upon successfull completion, an error code otherwise.
Definition at line 428 of file cr-rgb.c.
References CR_BAD_PARAM_ERROR, and CR_OK.
Referenced by cr_rgb_set_from_hex_str(), cr_style_set_props_to_default_values(), and cr_style_set_props_to_initial_values().
guchar* cr_rgb_to_string | ( | CRRgb const * | a_this | ) |
cr_rgb_to_string: @a_this: the instance of CRRgb to serialize.
Serializes the rgb into a zero terminated string.
Returns the zero terminated string containing the serialized rgb. MUST BE FREED by the caller using g_free().
Definition at line 248 of file cr-rgb.c.
Referenced by cr_rgb_dump(), cr_style_rgb_prop_val_to_string(), cr_term_one_to_string(), and cr_term_to_string().