Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

cr-rgb.h

Go to the documentation of this file.
00001 /* -*- Mode: C; indent-tabs-mode:nil; c-basic-offset: 8-*- */
00002 
00003 /*
00004  * This file is part of The Croco Library
00005  *
00006  * Copyright (C) 2002-2003 Dodji Seketeli <dodji@seketeli.org>
00007  *
00008  * This program is free software; you can redistribute it and/or
00009  * modify it under the terms of version 2.1 of the GNU Lesser General Public
00010  * License as published by the Free Software Foundation.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00020  * USA
00021  */
00022 
00023 /*
00024  *$Id: cr-rgb.h,v 1.3 2003/06/03 22:00:24 dodji Exp $
00025  */
00026 
00027 #include <stdio.h>
00028 #include <glib.h>
00029 #include "cr-utils.h"
00030 
00031 #ifndef __CR_RGB_H__
00032 #define __CR_RGB_H__
00033 
00034 G_BEGIN_DECLS
00035 
00036 
00037 typedef struct _CRRgb CRRgb ;
00038 struct _CRRgb
00039 {
00040         /*
00041          *the unit of the rgb.
00042          *Either NO_UNIT (integer) or 
00043          *UNIT_PERCENTAGE (percentage).
00044          */
00045         const guchar *name ;
00046         glong red ;
00047         glong green ;
00048         glong blue ;
00049         gboolean is_percentage ;
00050 } ;
00051 
00052 CRRgb *
00053 cr_rgb_new (void) ;
00054 
00055 CRRgb *
00056 cr_rgb_new_with_vals (gulong a_red, gulong a_green, 
00057                       gulong a_blue, gboolean a_is_percentage) ;
00058 
00059 enum CRStatus
00060 cr_rgb_set (CRRgb *a_this, gulong a_red,
00061             gulong a_green, gulong a_blue,
00062             gboolean a_is_percentage) ;
00063         
00064 enum CRStatus
00065 cr_rgb_set_from_rgb (CRRgb *a_this, CRRgb *a_rgb) ;
00066 
00067 enum CRStatus
00068 cr_rgb_set_from_name (CRRgb *a_this, const guchar *a_color_name) ;
00069 
00070 enum CRStatus
00071 cr_rgb_set_from_hex_str (CRRgb *a_this, const guchar * a_hex_value) ;
00072 
00073 guchar *
00074 cr_rgb_to_string (CRRgb *a_this) ;
00075 
00076 void
00077 cr_rgb_dump (CRRgb *a_this, FILE *a_fp) ;
00078 
00079 void
00080 cr_rgb_destroy (CRRgb *a_this) ;
00081 
00082 G_END_DECLS
00083 
00084 #endif /*__CR_RGB_H__*/

Generated on Wed Oct 1 01:36:47 2003 for Libcroco by doxygen 1.3.3