]> Pileus Git - ~andy/gtk/blob - gtk/gtkcolorchooser.h
d97087bd0e6be072d9e4f81a051ddaabb3a7abce
[~andy/gtk] / gtk / gtkcolorchooser.h
1 /* GTK - The GIMP Toolkit
2  *
3  * Copyright (C) 2012 Red Hat, Inc.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  */
20
21 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
22 #error "Only <gtk/gtk.h> can be included directly."
23 #endif
24
25 #ifndef __GTK_COLOR_CHOOSER_H__
26 #define __GTK_COLOR_CHOOSER_H__
27
28 #include <gtk/gtkwidget.h>
29
30 G_BEGIN_DECLS
31
32 #define GTK_TYPE_COLOR_CHOOSER                  (gtk_color_chooser_get_type ())
33 #define GTK_COLOR_CHOOSER(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_COLOR_CHOOSER, GtkColorChooser))
34 #define GTK_IS_COLOR_CHOOSER(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_COLOR_CHOOSER))
35 #define GTK_COLOR_CHOOSER_GET_IFACE(inst)       (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GTK_TYPE_COLOR_CHOOSER, GtkColorChooserInterface))
36
37 typedef struct _GtkColorChooser          GtkColorChooser;
38 typedef struct _GtkColorChooserInterface GtkColorChooserInterface;
39
40 struct _GtkColorChooserInterface
41 {
42   GTypeInterface base_interface;
43
44   /* Methods */
45   void (* get_rgba)    (GtkColorChooser *chooser,
46                         GdkRGBA         *color);
47   void (* set_rgba)    (GtkColorChooser *chooser,
48                         const GdkRGBA   *color);
49
50   void (* add_palette) (GtkColorChooser *chooser,
51                         gboolean         horizontal,
52                         gint             colors_per_line,
53                         gint             n_colors,
54                         GdkRGBA         *colors);
55
56   /* Signals */
57   void (* color_activated) (GtkColorChooser *chooser,
58                             const GdkRGBA   *color);
59
60   /* Padding */
61   gpointer padding[12];
62 };
63
64 GDK_AVAILABLE_IN_3_4
65 GType    gtk_color_chooser_get_type        (void) G_GNUC_CONST;
66
67 GDK_AVAILABLE_IN_3_4
68 void     gtk_color_chooser_get_rgba       (GtkColorChooser *chooser,
69                                            GdkRGBA         *color);
70 GDK_AVAILABLE_IN_3_4
71 void     gtk_color_chooser_set_rgba       (GtkColorChooser *chooser,
72                                            const GdkRGBA   *color);
73 GDK_AVAILABLE_IN_3_4
74 gboolean gtk_color_chooser_get_use_alpha  (GtkColorChooser *chooser);
75 GDK_AVAILABLE_IN_3_4
76 void     gtk_color_chooser_set_use_alpha  (GtkColorChooser *chooser,
77                                            gboolean         use_alpha);
78
79 GDK_AVAILABLE_IN_3_4
80 void     gtk_color_chooser_add_palette    (GtkColorChooser *chooser,
81                                            gboolean         horizontal,
82                                            gint             colors_per_line,
83                                            gint             n_colors,
84                                            GdkRGBA         *colors);
85
86 G_END_DECLS
87
88 #endif /* __GTK_COLOR_CHOOSER_H__ */