]> Pileus Git - ~andy/gtk/blob - gtk/gtkhsv.h
Silently return NULL if the widget is not realized. (#316023, Guillaume
[~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/gtkcontainer.h>
35
36 G_BEGIN_DECLS 
37
38 #define GTK_TYPE_HSV            (gtk_hsv_get_type ())
39 #define GTK_HSV(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_HSV, GtkHSV))
40 #define GTK_HSV_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_HSV, GtkHSVClass))
41 #define GTK_IS_HSV(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_HSV))
42 #define GTK_IS_HSV_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_HSV))
43 #define GTK_HSV_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_HSV, GtkHSVClass))
44
45
46 typedef struct _GtkHSV      GtkHSV;
47 typedef struct _GtkHSVClass GtkHSVClass;
48
49 struct _GtkHSV
50 {
51   GtkWidget parent_instance;
52   
53   /* Private data */
54   gpointer priv;
55 };
56
57 struct _GtkHSVClass
58 {
59   GtkWidgetClass parent_class;
60   
61   /* Notification signals */
62   
63   void (*changed) (GtkHSV *hsv);
64
65   /* Keybindings */
66   void (* move) (GtkHSV          *hsv,
67                  GtkDirectionType type);
68 };
69
70
71 GType      gtk_hsv_get_type     (void) G_GNUC_CONST;
72 GtkWidget* gtk_hsv_new          (void);
73 void       gtk_hsv_set_color    (GtkHSV    *hsv,
74                                  double     h,
75                                  double     s,
76                                  double     v);
77 void       gtk_hsv_get_color    (GtkHSV    *hsv,
78                                  gdouble   *h,
79                                  gdouble   *s,
80                                  gdouble   *v);
81 void       gtk_hsv_set_metrics  (GtkHSV    *hsv,
82                                  gint       size,
83                                  gint       ring_width);
84 void       gtk_hsv_get_metrics  (GtkHSV    *hsv,
85                                  gint      *size,
86                                  gint      *ring_width);
87 gboolean   gtk_hsv_is_adjusting (GtkHSV    *hsv);
88 void       gtk_hsv_to_rgb       (gdouble    h,
89                                  gdouble    s,
90                                  gdouble    v,
91                                  gdouble   *r,
92                                  gdouble   *g,
93                                  gdouble   *b);
94 void       gtk_rgb_to_hsv       (gdouble    r,
95                                  gdouble    g,
96                                  gdouble    b,
97                                  gdouble   *h,
98                                  gdouble   *s,
99                                  gdouble   *v);
100
101
102 G_END_DECLS
103
104 #endif /* __GTK_HSV_H__ */