gdkcolor.h 2.52 KB
Newer Older
Cody Russell's avatar
Cody Russell committed
1
/* GDK - The GIMP Drawing Kit
2 3 4 5 6 7 8 9 10 11 12 13 14
 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
Javier Jardón's avatar
Javier Jardón committed
15
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16 17 18 19 20 21
 */

/*
 * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
 * file for a list of people on the GTK+ Team.  See the ChangeLog
 * files for a list of changes.  These files are distributed with
22
 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
23 24
 */

25 26 27
#ifndef __GDK_COLOR_H__
#define __GDK_COLOR_H__

28
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
29 30 31
#error "Only <gdk/gdk.h> can be included directly."
#endif

32
#include <cairo.h>
Owen Taylor's avatar
Owen Taylor committed
33
#include <gdk/gdktypes.h>
34
#include <gdk/gdkversionmacros.h>
Owen Taylor's avatar
Owen Taylor committed
35

36
G_BEGIN_DECLS
Owen Taylor's avatar
Owen Taylor committed
37

38 39 40

/**
 * GdkColor:
41 42
 * @pixel: For allocated colors, the pixel value used to
 *     draw this color on the screen. Not used anymore.
43
 * @red: The red component of the color. This is
44
 *     a value between 0 and 65535, with 65535 indicating
Matthias Clasen's avatar
Matthias Clasen committed
45
 *     full intensity
46 47
 * @green: The green component of the color
 * @blue: The blue component of the color
48
 *
49 50
 * The #GdkColor structure is used to describe a color,
 * similar to the XColor struct used in the X11 drawing API.
Owen Taylor's avatar
Owen Taylor committed
51 52 53
 */
struct _GdkColor
{
54 55 56 57
  guint32 pixel;
  guint16 red;
  guint16 green;
  guint16 blue;
Owen Taylor's avatar
Owen Taylor committed
58 59
};

60 61
#define GDK_TYPE_COLOR (gdk_color_get_type ())

62
GDK_AVAILABLE_IN_ALL
63
GType     gdk_color_get_type (void) G_GNUC_CONST;
64

65
GDK_AVAILABLE_IN_ALL
66
GdkColor *gdk_color_copy      (const GdkColor *color);
67
GDK_AVAILABLE_IN_ALL
68
void      gdk_color_free      (GdkColor       *color);
69

70
GDK_AVAILABLE_IN_ALL
71
guint     gdk_color_hash      (const GdkColor *color);
72
GDK_AVAILABLE_IN_ALL
73
gboolean  gdk_color_equal     (const GdkColor *colora,
74
                               const GdkColor *colorb);
Owen Taylor's avatar
Owen Taylor committed
75

76
GDK_AVAILABLE_IN_ALL
77 78
gboolean  gdk_color_parse     (const gchar    *spec,
                               GdkColor       *color);
79
GDK_AVAILABLE_IN_ALL
80
gchar *   gdk_color_to_string (const GdkColor *color);
81

Owen Taylor's avatar
Owen Taylor committed
82

83
G_END_DECLS
Owen Taylor's avatar
Owen Taylor committed
84 85

#endif /* __GDK_COLOR_H__ */