1 | /* GTK - The GIMP Toolkit |
---|
2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald |
---|
3 | * |
---|
4 | * This library is free software; you can redistribute it and/or |
---|
5 | * modify it under the terms of the GNU Library General Public |
---|
6 | * License as published by the Free Software Foundation; either |
---|
7 | * version 2 of the License, or (at your option) any later version. |
---|
8 | * |
---|
9 | * This library is distributed in the hope that it will be useful, |
---|
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
12 | * Library General Public License for more details. |
---|
13 | * |
---|
14 | * You should have received a copy of the GNU Library General Public |
---|
15 | * License along with this library; if not, write to the |
---|
16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
---|
17 | * Boston, MA 02111-1307, USA. |
---|
18 | */ |
---|
19 | |
---|
20 | /* |
---|
21 | * Modified by the GTK+ Team and others 1997-1999. See the AUTHORS |
---|
22 | * file for a list of people on the GTK+ Team. See the ChangeLog |
---|
23 | * files for a list of changes. These files are distributed with |
---|
24 | * GTK+ at ftp://ftp.gtk.org/pub/gtk/. |
---|
25 | */ |
---|
26 | |
---|
27 | #ifndef __GTK_COLORSEL_H__ |
---|
28 | #define __GTK_COLORSEL_H__ |
---|
29 | |
---|
30 | #include <gtk/gtkwindow.h> |
---|
31 | #include <gtk/gtkvbox.h> |
---|
32 | #include <gtk/gtkframe.h> |
---|
33 | #include <gtk/gtkpreview.h> |
---|
34 | #include <gtk/gtkbutton.h> |
---|
35 | #include <gtk/gtkentry.h> |
---|
36 | #include <gtk/gtkhbox.h> |
---|
37 | #include <gtk/gtklabel.h> |
---|
38 | #include <gtk/gtkmain.h> |
---|
39 | #include <gtk/gtksignal.h> |
---|
40 | #include <gtk/gtkmisc.h> |
---|
41 | #include <gtk/gtkrange.h> |
---|
42 | #include <gtk/gtkscale.h> |
---|
43 | #include <gtk/gtkhscale.h> |
---|
44 | #include <gtk/gtktable.h> |
---|
45 | #include <gtk/gtkeventbox.h> |
---|
46 | |
---|
47 | |
---|
48 | #ifdef __cplusplus |
---|
49 | extern "C" { |
---|
50 | #endif /* __cplusplus */ |
---|
51 | |
---|
52 | |
---|
53 | #define GTK_TYPE_COLOR_SELECTION (gtk_color_selection_get_type ()) |
---|
54 | #define GTK_COLOR_SELECTION(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_COLOR_SELECTION, GtkColorSelection)) |
---|
55 | #define GTK_COLOR_SELECTION_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_COLOR_SELECTION, GtkColorSelectionClass)) |
---|
56 | #define GTK_IS_COLOR_SELECTION(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_COLOR_SELECTION)) |
---|
57 | #define GTK_IS_COLOR_SELECTION_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_COLOR_SELECTION)) |
---|
58 | |
---|
59 | #define GTK_TYPE_COLOR_SELECTION_DIALOG (gtk_color_selection_dialog_get_type ()) |
---|
60 | #define GTK_COLOR_SELECTION_DIALOG(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_COLOR_SELECTION_DIALOG, GtkColorSelectionDialog)) |
---|
61 | #define GTK_COLOR_SELECTION_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_COLOR_SELECTION_DIALOG, GtkColorSelectionDialogClass)) |
---|
62 | #define GTK_IS_COLOR_SELECTION_DIALOG(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_COLOR_SELECTION_DIALOG)) |
---|
63 | #define GTK_IS_COLOR_SELECTION_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_COLOR_SELECTION_DIALOG)) |
---|
64 | |
---|
65 | typedef struct _GtkColorSelection GtkColorSelection; |
---|
66 | typedef struct _GtkColorSelectionClass GtkColorSelectionClass; |
---|
67 | |
---|
68 | typedef struct _GtkColorSelectionDialog GtkColorSelectionDialog; |
---|
69 | typedef struct _GtkColorSelectionDialogClass GtkColorSelectionDialogClass; |
---|
70 | |
---|
71 | |
---|
72 | struct _GtkColorSelection |
---|
73 | { |
---|
74 | GtkVBox vbox; |
---|
75 | |
---|
76 | GtkWidget *wheel_area; |
---|
77 | GtkWidget *value_area; |
---|
78 | GtkWidget *sample_area; |
---|
79 | GtkWidget *sample_area_eb; |
---|
80 | |
---|
81 | GtkWidget *scales[8]; |
---|
82 | GtkWidget *entries[8]; |
---|
83 | GtkWidget *opacity_label; |
---|
84 | |
---|
85 | GdkGC *wheel_gc; |
---|
86 | GdkGC *value_gc; |
---|
87 | GdkGC *sample_gc; |
---|
88 | |
---|
89 | GtkUpdateType policy; |
---|
90 | gint use_opacity; |
---|
91 | gint timer_active; |
---|
92 | gint timer_tag; |
---|
93 | gdouble values[8]; |
---|
94 | gdouble old_values[8]; |
---|
95 | |
---|
96 | guchar *wheel_buf; |
---|
97 | guchar *value_buf; |
---|
98 | guchar *sample_buf; |
---|
99 | }; |
---|
100 | |
---|
101 | struct _GtkColorSelectionClass |
---|
102 | { |
---|
103 | GtkVBoxClass parent_class; |
---|
104 | |
---|
105 | void (* color_changed) (GtkColorSelection *colorsel); |
---|
106 | }; |
---|
107 | |
---|
108 | struct _GtkColorSelectionDialog |
---|
109 | { |
---|
110 | GtkWindow window; |
---|
111 | |
---|
112 | GtkWidget *colorsel; |
---|
113 | GtkWidget *main_vbox; |
---|
114 | GtkWidget *ok_button; |
---|
115 | GtkWidget *reset_button; |
---|
116 | GtkWidget *cancel_button; |
---|
117 | GtkWidget *help_button; |
---|
118 | }; |
---|
119 | |
---|
120 | struct _GtkColorSelectionDialogClass |
---|
121 | { |
---|
122 | GtkWindowClass parent_class; |
---|
123 | }; |
---|
124 | |
---|
125 | |
---|
126 | /* ColorSelection */ |
---|
127 | |
---|
128 | GtkType gtk_color_selection_get_type (void); |
---|
129 | |
---|
130 | GtkWidget* gtk_color_selection_new (void); |
---|
131 | |
---|
132 | void gtk_color_selection_set_update_policy (GtkColorSelection *colorsel, |
---|
133 | GtkUpdateType policy); |
---|
134 | |
---|
135 | void gtk_color_selection_set_opacity (GtkColorSelection *colorsel, |
---|
136 | gint use_opacity); |
---|
137 | |
---|
138 | void gtk_color_selection_set_color (GtkColorSelection *colorsel, |
---|
139 | gdouble *color); |
---|
140 | |
---|
141 | void gtk_color_selection_get_color (GtkColorSelection *colorsel, |
---|
142 | gdouble *color); |
---|
143 | |
---|
144 | /* ColorSelectionDialog */ |
---|
145 | |
---|
146 | GtkType gtk_color_selection_dialog_get_type (void); |
---|
147 | |
---|
148 | GtkWidget* gtk_color_selection_dialog_new (const gchar *title); |
---|
149 | |
---|
150 | |
---|
151 | #ifdef __cplusplus |
---|
152 | } |
---|
153 | #endif /* __cplusplus */ |
---|
154 | |
---|
155 | |
---|
156 | #endif /* __GTK_COLORSEL_H__ */ |
---|