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 program is free software: you can redistribute it and/or modify 10 * it under the terms of the GNU General Public License as published by 11 * the Free Software Foundation; either version 3 of the License, or 12 * (at your option) any later version. 13 * 14 * This program 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 17 * GNU General Public License for more details. 18 * 19 * You should have received a copy of the GNU General Public License 20 * along with this program. If not, see <https://www.gnu.org/licenses/>. 21 */ 22 23 /* 24 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS 25 * file for a list of people on the GTK+ Team. See the ChangeLog 26 * files for a list of changes. These files are distributed with 27 * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 28 */ 29 30 #ifndef __GIMP_COLOR_WHEEL_H__ 31 #define __GIMP_COLOR_WHEEL_H__ 32 33 G_BEGIN_DECLS 34 35 #define GIMP_TYPE_COLOR_WHEEL (gimp_color_wheel_get_type ()) 36 #define GIMP_COLOR_WHEEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_COLOR_WHEEL, GimpColorWheel)) 37 #define GIMP_COLOR_WHEEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_COLOR_WHEEL, GimpColorWheelClass)) 38 #define GIMP_IS_COLOR_WHEEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_COLOR_WHEEL)) 39 #define GIMP_IS_COLOR_WHEEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_COLOR_WHEEL)) 40 #define GIMP_COLOR_WHEEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_COLOR_WHEEL, GimpColorWheelClass)) 41 42 43 typedef struct _GimpColorWheel GimpColorWheel; 44 typedef struct _GimpColorWheelClass GimpColorWheelClass; 45 46 struct _GimpColorWheel 47 { 48 GtkWidget parent_instance; 49 50 /* Private data */ 51 gpointer priv; 52 }; 53 54 struct _GimpColorWheelClass 55 { 56 GtkWidgetClass parent_class; 57 58 /* Notification signals */ 59 void (* changed) (GimpColorWheel *wheel); 60 61 /* Keybindings */ 62 void (* move) (GimpColorWheel *wheel, 63 GtkDirectionType type); 64 65 /* Padding for future expansion */ 66 void (*_gimp_reserved1) (void); 67 void (*_gimp_reserved2) (void); 68 void (*_gimp_reserved3) (void); 69 void (*_gimp_reserved4) (void); 70 }; 71 72 73 void color_wheel_register_type (GTypeModule *module); 74 75 GType gimp_color_wheel_get_type (void) G_GNUC_CONST; 76 GtkWidget * gimp_color_wheel_new (void); 77 78 void gimp_color_wheel_set_color (GimpColorWheel *wheel, 79 double h, 80 double s, 81 double v); 82 void gimp_color_wheel_get_color (GimpColorWheel *wheel, 83 gdouble *h, 84 gdouble *s, 85 gdouble *v); 86 87 void gimp_color_wheel_set_ring_fraction (GimpColorWheel *wheel, 88 gdouble fraction); 89 gdouble gimp_color_wheel_get_ring_fraction (GimpColorWheel *wheel); 90 91 void gimp_color_wheel_set_color_config (GimpColorWheel *wheel, 92 GimpColorConfig *config); 93 94 gboolean gimp_color_wheel_is_adjusting (GimpColorWheel *wheel); 95 96 G_END_DECLS 97 98 #endif /* __GIMP_COLOR_WHEEL_H__ */ 99