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 36 G_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 46 typedef struct _GtkColorSelection GtkColorSelection; 47 typedef struct _GtkColorSelectionPrivate GtkColorSelectionPrivate; 48 typedef 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 */ 57 typedef 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 */ 69 typedef void (* GtkColorSelectionChangePaletteWithScreenFunc) (GdkScreen *screen, 70 const GdkColor *colors, 71 gint n_colors); 72 73 struct _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 */ 86 struct _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 104 GDK_DEPRECATED_IN_3_4 105 GType gtk_color_selection_get_type (void) G_GNUC_CONST; 106 GDK_DEPRECATED_IN_3_4_FOR(gtk_color_chooser_widget_new) 107 GtkWidget *gtk_color_selection_new (void); 108 GDK_DEPRECATED_IN_3_4_FOR(gtk_color_chooser_get_use_alpha) 109 gboolean gtk_color_selection_get_has_opacity_control (GtkColorSelection *colorsel); 110 GDK_DEPRECATED_IN_3_4_FOR(gtk_color_chooser_set_use_alpha) 111 void gtk_color_selection_set_has_opacity_control (GtkColorSelection *colorsel, 112 gboolean has_opacity); 113 GDK_DEPRECATED_IN_3_4 114 gboolean gtk_color_selection_get_has_palette (GtkColorSelection *colorsel); 115 GDK_DEPRECATED_IN_3_4 116 void gtk_color_selection_set_has_palette (GtkColorSelection *colorsel, 117 gboolean has_palette); 118 119 120 GDK_DEPRECATED_IN_3_4_FOR(gtk_color_chooser_set_rgba) 121 void gtk_color_selection_set_current_alpha (GtkColorSelection *colorsel, 122 guint16 alpha); 123 GDK_DEPRECATED_IN_3_4_FOR(gtk_color_chooser_get_rgba) 124 guint16 gtk_color_selection_get_current_alpha (GtkColorSelection *colorsel); 125 GDK_DEPRECATED_IN_3_4 126 void gtk_color_selection_set_previous_alpha (GtkColorSelection *colorsel, 127 guint16 alpha); 128 GDK_DEPRECATED_IN_3_4 129 guint16 gtk_color_selection_get_previous_alpha (GtkColorSelection *colorsel); 130 131 GDK_DEPRECATED_IN_3_4_FOR(gtk_color_chooser_set_rgba) 132 void gtk_color_selection_set_current_rgba (GtkColorSelection *colorsel, 133 const GdkRGBA *rgba); 134 GDK_DEPRECATED_IN_3_4_FOR(gtk_color_chooser_get_rgba) 135 void gtk_color_selection_get_current_rgba (GtkColorSelection *colorsel, 136 GdkRGBA *rgba); 137 GDK_DEPRECATED_IN_3_4 138 void gtk_color_selection_set_previous_rgba (GtkColorSelection *colorsel, 139 const GdkRGBA *rgba); 140 GDK_DEPRECATED_IN_3_4 141 void gtk_color_selection_get_previous_rgba (GtkColorSelection *colorsel, 142 GdkRGBA *rgba); 143 144 GDK_DEPRECATED_IN_3_4 145 gboolean gtk_color_selection_is_adjusting (GtkColorSelection *colorsel); 146 147 GDK_DEPRECATED_IN_3_4 148 gboolean gtk_color_selection_palette_from_string (const gchar *str, 149 GdkColor **colors, 150 gint *n_colors); 151 GDK_DEPRECATED_IN_3_4 152 gchar* gtk_color_selection_palette_to_string (const GdkColor *colors, 153 gint n_colors); 154 155 GDK_DEPRECATED_IN_3_4 156 GtkColorSelectionChangePaletteWithScreenFunc gtk_color_selection_set_change_palette_with_screen_hook (GtkColorSelectionChangePaletteWithScreenFunc func); 157 158 GDK_DEPRECATED_IN_3_4_FOR(gtk_color_chooser_set_rgba) 159 void gtk_color_selection_set_current_color (GtkColorSelection *colorsel, 160 const GdkColor *color); 161 GDK_DEPRECATED_IN_3_4_FOR(gtk_color_chooser_get_rgba) 162 void gtk_color_selection_get_current_color (GtkColorSelection *colorsel, 163 GdkColor *color); 164 GDK_DEPRECATED_IN_3_4 165 void gtk_color_selection_set_previous_color (GtkColorSelection *colorsel, 166 const GdkColor *color); 167 GDK_DEPRECATED_IN_3_4 168 void gtk_color_selection_get_previous_color (GtkColorSelection *colorsel, 169 GdkColor *color); 170 171 172 G_END_DECLS 173 174 #endif /* __GTK_COLOR_SELECTION_H__ */ 175