1/* GTK - The GIMP Toolkit
2 * Copyright (C) 2000 Red Hat, Inc.
3 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
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, see <http://www.gnu.org/licenses/>.
17 */
18
19/*
20 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
21 * file for a list of people on the GTK+ Team. See the ChangeLog
22 * files for a list of changes. These files are distributed with
23 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
24 */
25
26#ifndef __GTK_COLOR_SELECTION_H__
27#define __GTK_COLOR_SELECTION_H__
28
29#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
30#error "Only <gtk/gtk.h> can be included directly."
31#endif
32
33#include <gtk/gtkdialog.h>
34#include <gtk/gtkbox.h>
35
36G_BEGIN_DECLS
37
38#define GTK_TYPE_COLOR_SELECTION (gtk_color_selection_get_type ())
39#define GTK_COLOR_SELECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_COLOR_SELECTION, GtkColorSelection))
40#define GTK_COLOR_SELECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_COLOR_SELECTION, GtkColorSelectionClass))
41#define GTK_IS_COLOR_SELECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_COLOR_SELECTION))
42#define GTK_IS_COLOR_SELECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_COLOR_SELECTION))
43#define GTK_COLOR_SELECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_COLOR_SELECTION, GtkColorSelectionClass))
44
45
46typedef struct _GtkColorSelection GtkColorSelection;
47typedef struct _GtkColorSelectionPrivate GtkColorSelectionPrivate;
48typedef struct _GtkColorSelectionClass GtkColorSelectionClass;
49
50/**
51 * GtkColorSelectionChangePaletteFunc:
52 * @colors: (array length=n_colors): Array of colors
53 * @n_colors: Number of colors in the array
54 *
55 * Deprecated: 3.4
56 */
57typedef void (* GtkColorSelectionChangePaletteFunc) (const GdkColor *colors,
58 gint n_colors);
59
60/**
61 * GtkColorSelectionChangePaletteWithScreenFunc:
62 * @screen:
63 * @colors: (array length=n_colors): Array of colors
64 * @n_colors: Number of colors in the array
65 *
66 * Since: 2.2
67 * Deprecated: 3.4
68 */
69typedef void (* GtkColorSelectionChangePaletteWithScreenFunc) (GdkScreen *screen,
70 const GdkColor *colors,
71 gint n_colors);
72
73struct _GtkColorSelection
74{
75 GtkBox parent_instance;
76
77 /*< private >*/
78 GtkColorSelectionPrivate *private_data;
79};
80
81/**
82 * GtkColorSelectionClass:
83 * @parent_class: The parent class.
84 * @color_changed:
85 */
86struct _GtkColorSelectionClass
87{
88 GtkBoxClass parent_class;
89
90 void (*color_changed) (GtkColorSelection *color_selection);
91
92 /*< private >*/
93
94 /* Padding for future expansion */
95 void (*_gtk_reserved1) (void);
96 void (*_gtk_reserved2) (void);
97 void (*_gtk_reserved3) (void);
98 void (*_gtk_reserved4) (void);
99};
100
101
102/* ColorSelection */
103
104GDK_DEPRECATED_IN_3_4
105GType gtk_color_selection_get_type (void) G_GNUC_CONST;
106GDK_DEPRECATED_IN_3_4_FOR(gtk_color_chooser_widget_new)
107GtkWidget *gtk_color_selection_new (void);
108GDK_DEPRECATED_IN_3_4_FOR(gtk_color_chooser_get_use_alpha)
109gboolean gtk_color_selection_get_has_opacity_control (GtkColorSelection *colorsel);
110GDK_DEPRECATED_IN_3_4_FOR(gtk_color_chooser_set_use_alpha)
111void gtk_color_selection_set_has_opacity_control (GtkColorSelection *colorsel,
112 gboolean has_opacity);
113GDK_DEPRECATED_IN_3_4
114gboolean gtk_color_selection_get_has_palette (GtkColorSelection *colorsel);
115GDK_DEPRECATED_IN_3_4
116void gtk_color_selection_set_has_palette (GtkColorSelection *colorsel,
117 gboolean has_palette);
118
119
120GDK_DEPRECATED_IN_3_4_FOR(gtk_color_chooser_set_rgba)
121void gtk_color_selection_set_current_alpha (GtkColorSelection *colorsel,
122 guint16 alpha);
123GDK_DEPRECATED_IN_3_4_FOR(gtk_color_chooser_get_rgba)
124guint16 gtk_color_selection_get_current_alpha (GtkColorSelection *colorsel);
125GDK_DEPRECATED_IN_3_4
126void gtk_color_selection_set_previous_alpha (GtkColorSelection *colorsel,
127 guint16 alpha);
128GDK_DEPRECATED_IN_3_4
129guint16 gtk_color_selection_get_previous_alpha (GtkColorSelection *colorsel);
130
131GDK_DEPRECATED_IN_3_4_FOR(gtk_color_chooser_set_rgba)
132void gtk_color_selection_set_current_rgba (GtkColorSelection *colorsel,
133 const GdkRGBA *rgba);
134GDK_DEPRECATED_IN_3_4_FOR(gtk_color_chooser_get_rgba)
135void gtk_color_selection_get_current_rgba (GtkColorSelection *colorsel,
136 GdkRGBA *rgba);
137GDK_DEPRECATED_IN_3_4
138void gtk_color_selection_set_previous_rgba (GtkColorSelection *colorsel,
139 const GdkRGBA *rgba);
140GDK_DEPRECATED_IN_3_4
141void gtk_color_selection_get_previous_rgba (GtkColorSelection *colorsel,
142 GdkRGBA *rgba);
143
144GDK_DEPRECATED_IN_3_4
145gboolean gtk_color_selection_is_adjusting (GtkColorSelection *colorsel);
146
147GDK_DEPRECATED_IN_3_4
148gboolean gtk_color_selection_palette_from_string (const gchar *str,
149 GdkColor **colors,
150 gint *n_colors);
151GDK_DEPRECATED_IN_3_4
152gchar* gtk_color_selection_palette_to_string (const GdkColor *colors,
153 gint n_colors);
154
155GDK_DEPRECATED_IN_3_4
156GtkColorSelectionChangePaletteWithScreenFunc gtk_color_selection_set_change_palette_with_screen_hook (GtkColorSelectionChangePaletteWithScreenFunc func);
157
158GDK_DEPRECATED_IN_3_4_FOR(gtk_color_chooser_set_rgba)
159void gtk_color_selection_set_current_color (GtkColorSelection *colorsel,
160 const GdkColor *color);
161GDK_DEPRECATED_IN_3_4_FOR(gtk_color_chooser_get_rgba)
162void gtk_color_selection_get_current_color (GtkColorSelection *colorsel,
163 GdkColor *color);
164GDK_DEPRECATED_IN_3_4
165void gtk_color_selection_set_previous_color (GtkColorSelection *colorsel,
166 const GdkColor *color);
167GDK_DEPRECATED_IN_3_4
168void gtk_color_selection_get_previous_color (GtkColorSelection *colorsel,
169 GdkColor *color);
170
171
172G_END_DECLS
173
174#endif /* __GTK_COLOR_SELECTION_H__ */
175