00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __CR_RGB_H__
00024 #define __CR_RGB_H__
00025
00026 #include <stdio.h>
00027 #include <glib.h>
00028 #include "cr-utils.h"
00029
00030 G_BEGIN_DECLS
00031
00032
00033 typedef struct _CRRgb CRRgb ;
00034 struct _CRRgb
00035 {
00036
00037
00038
00039
00040
00041 const guchar *name ;
00042 glong red ;
00043 glong green ;
00044 glong blue ;
00045 gboolean is_percentage ;
00046 } ;
00047
00048 CRRgb * cr_rgb_new (void) ;
00049
00050 CRRgb * cr_rgb_new_with_vals (gulong a_red, gulong a_green,
00051 gulong a_blue, gboolean a_is_percentage) ;
00052
00053 CRRgb *cr_rgb_parse_from_buf(const guchar *a_str,
00054 enum CREncoding a_enc);
00055
00056 enum CRStatus cr_rgb_compute_from_percentage (CRRgb *a_this) ;
00057
00058 enum CRStatus cr_rgb_set (CRRgb *a_this, gulong a_red,
00059 gulong a_green, gulong a_blue,
00060 gboolean a_is_percentage) ;
00061
00062 enum CRStatus cr_rgb_set_from_rgb (CRRgb *a_this, CRRgb *a_rgb) ;
00063
00064 enum CRStatus cr_rgb_set_from_name (CRRgb *a_this, const guchar *a_color_name) ;
00065
00066 enum CRStatus cr_rgb_set_from_hex_str (CRRgb *a_this, const guchar * a_hex_value) ;
00067
00068 struct _CRTerm;
00069
00070 enum CRStatus cr_rgb_set_from_term (CRRgb *a_this, const struct _CRTerm *a_value);
00071
00072 guchar * cr_rgb_to_string (CRRgb *a_this) ;
00073
00074 void cr_rgb_dump (CRRgb *a_this, FILE *a_fp) ;
00075
00076 void cr_rgb_destroy (CRRgb *a_this) ;
00077
00078 G_END_DECLS
00079
00080 #endif