gtkcolorsel.h 6.58 KB
Newer Older
Cody Russell's avatar
Cody Russell committed
1
/* GTK - The GIMP Toolkit
2
 * Copyright (C) 2000 Red Hat, Inc.
Elliot Lee's avatar
Elliot Lee committed
3 4 5
 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
 *
 * This library is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU Lesser General Public
Elliot Lee's avatar
Elliot Lee committed
7 8 9 10 11 12
 * 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
13
 * Lesser General Public License for more details.
Elliot Lee's avatar
Elliot Lee committed
14
 *
15
 * You should have received a copy of the GNU Lesser General Public
Javier Jardón's avatar
Javier Jardón committed
16
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
Elliot Lee's avatar
Elliot Lee committed
17
 */
18 19

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

26 27 28
#ifndef __GTK_COLOR_SELECTION_H__
#define __GTK_COLOR_SELECTION_H__

29
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
30 31 32
#error "Only <gtk/gtk.h> can be included directly."
#endif

33
#include <gtk/gtkdialog.h>
34
#include <gtk/gtkbox.h>
Elliot Lee's avatar
Elliot Lee committed
35

36
G_BEGIN_DECLS
37

38
#define GTK_TYPE_COLOR_SELECTION			(gtk_color_selection_get_type ())
Manish Singh's avatar
Manish Singh committed
39 40 41 42 43
#define GTK_COLOR_SELECTION(obj)			(G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_COLOR_SELECTION, GtkColorSelection))
#define GTK_COLOR_SELECTION_CLASS(klass)		(G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_COLOR_SELECTION, GtkColorSelectionClass))
#define GTK_IS_COLOR_SELECTION(obj)			(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_COLOR_SELECTION))
#define GTK_IS_COLOR_SELECTION_CLASS(klass)		(G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_COLOR_SELECTION))
#define GTK_COLOR_SELECTION_GET_CLASS(obj)              (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_COLOR_SELECTION, GtkColorSelectionClass))
Tim Janik's avatar
Tim Janik committed
44

45

46
typedef struct _GtkColorSelection       GtkColorSelection;
47
typedef struct _GtkColorSelectionPrivate  GtkColorSelectionPrivate;
48
typedef struct _GtkColorSelectionClass  GtkColorSelectionClass;
Elliot Lee's avatar
Elliot Lee committed
49

50 51
typedef void (* GtkColorSelectionChangePaletteFunc) (const GdkColor    *colors,
                                                     gint               n_colors);
52 53 54 55 56 57 58 59 60

/**
 * GtkColorSelectionChangePaletteWithScreenFunc:
 * @screen:
 * @colors:
 * @n_colors:
 *
 * Since: 2.2
 */
61 62 63
typedef void (* GtkColorSelectionChangePaletteWithScreenFunc) (GdkScreen         *screen,
							       const GdkColor    *colors,
							       gint               n_colors);
64

Elliot Lee's avatar
Elliot Lee committed
65 66
struct _GtkColorSelection
{
67
  GtkBox parent_instance;
68

69
  /* < private_data > */
70
  GtkColorSelectionPrivate *private_data;
Elliot Lee's avatar
Elliot Lee committed
71 72 73 74
};

struct _GtkColorSelectionClass
{
75
  GtkBoxClass parent_class;
Elliot Lee's avatar
Elliot Lee committed
76

77
  void (*color_changed)	(GtkColorSelection *color_selection);
78 79 80 81 82 83

  /* Padding for future expansion */
  void (*_gtk_reserved1) (void);
  void (*_gtk_reserved2) (void);
  void (*_gtk_reserved3) (void);
  void (*_gtk_reserved4) (void);
Elliot Lee's avatar
Elliot Lee committed
84 85 86
};


87
/* ColorSelection */
Elliot Lee's avatar
Elliot Lee committed
88

89
GDK_DEPRECATED_IN_3_4
Manish Singh's avatar
Manish Singh committed
90
GType      gtk_color_selection_get_type                (void) G_GNUC_CONST;
91
GDK_DEPRECATED_IN_3_4_FOR(gtk_color_chooser_widget_new)
92
GtkWidget *gtk_color_selection_new                     (void);
93
GDK_DEPRECATED_IN_3_4_FOR(gtk_color_chooser_get_use_alpha)
94
gboolean   gtk_color_selection_get_has_opacity_control (GtkColorSelection *colorsel);
95
GDK_DEPRECATED_IN_3_4_FOR(gtk_color_chooser_set_use_alpha)
96
void       gtk_color_selection_set_has_opacity_control (GtkColorSelection *colorsel,
97
							gboolean           has_opacity);
98
GDK_DEPRECATED_IN_3_4
99
gboolean   gtk_color_selection_get_has_palette         (GtkColorSelection *colorsel);
100
GDK_DEPRECATED_IN_3_4
101
void       gtk_color_selection_set_has_palette         (GtkColorSelection *colorsel,
102
							gboolean           has_palette);
103 104


105
GDK_DEPRECATED_IN_3_4_FOR(gtk_color_chooser_set_rgba)
106 107
void     gtk_color_selection_set_current_alpha   (GtkColorSelection *colorsel,
						  guint16            alpha);
108
GDK_DEPRECATED_IN_3_4_FOR(gtk_color_chooser_get_rgba)
109
guint16  gtk_color_selection_get_current_alpha   (GtkColorSelection *colorsel);
110
GDK_DEPRECATED_IN_3_4
111 112
void     gtk_color_selection_set_previous_alpha  (GtkColorSelection *colorsel,
						  guint16            alpha);
113
GDK_DEPRECATED_IN_3_4
114
guint16  gtk_color_selection_get_previous_alpha  (GtkColorSelection *colorsel);
115

116
GDK_DEPRECATED_IN_3_4_FOR(gtk_color_chooser_set_rgba)
117 118
void     gtk_color_selection_set_current_rgba    (GtkColorSelection *colorsel,
                                                  const GdkRGBA     *rgba);
119
GDK_DEPRECATED_IN_3_4_FOR(gtk_color_chooser_get_rgba)
120 121
void     gtk_color_selection_get_current_rgba    (GtkColorSelection *colorsel,
                                                  GdkRGBA           *rgba);
122
GDK_DEPRECATED_IN_3_4
123 124
void     gtk_color_selection_set_previous_rgba   (GtkColorSelection *colorsel,
                                                  const GdkRGBA     *rgba);
125
GDK_DEPRECATED_IN_3_4
126 127 128
void     gtk_color_selection_get_previous_rgba   (GtkColorSelection *colorsel,
                                                  GdkRGBA           *rgba);

129
GDK_DEPRECATED_IN_3_4
130 131
gboolean gtk_color_selection_is_adjusting        (GtkColorSelection *colorsel);

132
GDK_DEPRECATED_IN_3_4
133 134 135
gboolean gtk_color_selection_palette_from_string (const gchar       *str,
                                                  GdkColor         **colors,
                                                  gint              *n_colors);
136
GDK_DEPRECATED_IN_3_4
137 138 139
gchar*   gtk_color_selection_palette_to_string   (const GdkColor    *colors,
                                                  gint               n_colors);

140
GDK_DEPRECATED_IN_3_4
141
GtkColorSelectionChangePaletteWithScreenFunc gtk_color_selection_set_change_palette_with_screen_hook (GtkColorSelectionChangePaletteWithScreenFunc func);
142

143
GDK_DEPRECATED_IN_3_4_FOR(gtk_color_chooser_set_rgba)
144 145
void     gtk_color_selection_set_current_color   (GtkColorSelection *colorsel,
                                                  const GdkColor    *color);
146
GDK_DEPRECATED_IN_3_4_FOR(gtk_color_chooser_get_rgba)
147 148
void     gtk_color_selection_get_current_color   (GtkColorSelection *colorsel,
                                                  GdkColor          *color);
149
GDK_DEPRECATED_IN_3_4
150 151
void     gtk_color_selection_set_previous_color  (GtkColorSelection *colorsel,
                                                  const GdkColor    *color);
152
GDK_DEPRECATED_IN_3_4
153 154 155 156
void     gtk_color_selection_get_previous_color  (GtkColorSelection *colorsel,
                                                  GdkColor          *color);


157
G_END_DECLS
Elliot Lee's avatar
Elliot Lee committed
158

159
#endif /* __GTK_COLOR_SELECTION_H__ */