]> Pileus Git - ~andy/gtk/blob - gtk/gtkhsv.h
ff39689529536a13f5eaa650b2fd6ab1bde1ad8d
[~andy/gtk] / gtk / gtkhsv.h
1 /* HSV color selector for GTK+
2  *
3  * Copyright (C) 1999 The Free Software Foundation
4  *
5  * Authors: Simon Budig <Simon.Budig@unix-ag.org> (original code)
6  *          Federico Mena-Quintero <federico@gimp.org> (cleanup for GTK+)
7  *          Jonathan Blandford <jrb@redhat.com> (cleanup for GTK+)
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the
21  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22  * Boston, MA 02111-1307, USA.
23  */
24 #ifndef __GTK_HSV_H__
25 #define __GTK_HSV_H__
26
27 /*
28  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
29  * file for a list of people on the GTK+ Team.  See the ChangeLog
30  * files for a list of changes.  These files are distributed with
31  * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
32  */
33
34 #include <gtk/gtkwidget.h>
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40 #define GTK_TYPE_HSV            (gtk_hsv_get_type ())
41 #define GTK_HSV(obj)            (GTK_CHECK_CAST ((obj), GTK_TYPE_HSV, GtkHSV))
42 #define GTK_HSV_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_HSV, GtkHSV))
43 #define GTK_IS_HSV(obj)         (GTK_CHECK_TYPE ((obj), GTK_TYPE_HSV))
44 #define GTK_IS_HSV_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_HSV))
45 #define GTK_HSV_GET_CLASS(obj)  (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_HSV, GtkHSVClass))
46
47
48 typedef struct _GtkHSV      GtkHSV;
49 typedef struct _GtkHSVClass GtkHSVClass;
50
51 struct _GtkHSV
52 {
53   GtkWidget parent_instance;
54   
55   /* Private data */
56   gpointer priv;
57 };
58
59 struct _GtkHSVClass
60 {
61   GtkWidgetClass parent_class;
62   
63   /* Notification signals */
64   
65   void (*changed) (GtkHSV *hsv);
66 };
67
68
69 GtkType    gtk_hsv_get_type     (void);
70 GtkWidget* gtk_hsv_new          (void);
71 void       gtk_hsv_set_color    (GtkHSV    *hsv,
72                                  double     h,
73                                  double     s,
74                                  double     v);
75 void       gtk_hsv_get_color    (GtkHSV    *hsv,
76                                  gdouble   *h,
77                                  gdouble   *s,
78                                  gdouble   *v);
79 void       gtk_hsv_set_metrics  (GtkHSV    *hsv,
80                                  gint       size,
81                                  gint       ring_width);
82 void       gtk_hsv_get_metrics  (GtkHSV    *hsv,
83                                  gint      *size,
84                                  gint      *ring_width);
85 gboolean   gtk_hsv_is_adjusting (GtkHSV    *hsv);
86 void       gtk_hsv_to_rgb       (gdouble    h,
87                                  gdouble    s,
88                                  gdouble    v,
89                                  gdouble   *r,
90                                  gdouble   *g,
91                                  gdouble   *b);
92 void       gtk_rgb_to_hsv       (gdouble    r,
93                                  gdouble    g,
94                                  gdouble    b,
95                                  gdouble   *h,
96                                  gdouble   *s,
97                                  gdouble   *v);
98
99
100 #ifdef __cplusplus
101 }
102 #endif
103
104 #endif /* __GTK_HSV_H__ */