]> Pileus Git - ~andy/gtk/blob - gtk/gtkcolorsel.h
wrapped enum definitions with glib macros.
[~andy/gtk] / gtk / gtkcolorsel.h
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 #ifndef __GTK_COLORSEL_H__
20 #define __GTK_COLORSEL_H__
21
22 #include <gtk/gtkwindow.h>
23 #include <gtk/gtkvbox.h>
24 #include <gtk/gtkframe.h>
25 #include <gtk/gtkpreview.h>
26 #include <gtk/gtkbutton.h>
27 #include <gtk/gtkentry.h>
28 #include <gtk/gtkhbox.h>
29 #include <gtk/gtklabel.h>
30 #include <gtk/gtkmain.h>
31 #include <gtk/gtksignal.h>
32 #include <gtk/gtkmisc.h>
33 #include <gtk/gtkrange.h>
34 #include <gtk/gtkscale.h>
35 #include <gtk/gtkhscale.h>
36 #include <gtk/gtktable.h>
37 #include <gtk/gtkeventbox.h>
38
39
40 #ifdef __cplusplus
41 extern "C" {
42 #endif /* __cplusplus */
43
44
45 #define GTK_COLOR_SELECTION(obj)          GTK_CHECK_CAST (obj, gtk_color_selection_get_type (), GtkColorSelection)
46 #define GTK_COLOR_SELECTION_CLASS(klass)  GTK_CHECK_CLASS_CAST (klass, gtk_color_selection_get_type (), GtkColorSelectionClass)
47 #define GTK_IS_COLOR_SELECTION(obj)       GTK_CHECK_TYPE (obj, gtk_color_selection_get_type ())
48
49 #define GTK_COLOR_SELECTION_DIALOG(obj)          GTK_CHECK_CAST (obj, gtk_color_selection_dialog_get_type (), GtkColorSelectionDialog)
50 #define GTK_COLOR_SELECTION_DIALOG_CLASS(klass)  GTK_CHECK_CLASS_CAST (klass, gtk_color_selection_dialog_get_type (), GtkColorSelectionDialogClass)
51 #define GTK_IS_COLOR_SELECTION_DIALOG(obj)       GTK_CHECK_TYPE (obj, gtk_color_selection_dialog_get_type ())
52
53
54 typedef struct _GtkColorSelection             GtkColorSelection;
55 typedef struct _GtkColorSelectionClass        GtkColorSelectionClass;
56
57 typedef struct _GtkColorSelectionDialog       GtkColorSelectionDialog;
58 typedef struct _GtkColorSelectionDialogClass  GtkColorSelectionDialogClass;
59
60
61 struct _GtkColorSelection
62 {
63   GtkVBox vbox;
64
65   GtkWidget *wheel_area;
66   GtkWidget *value_area;
67   GtkWidget *sample_area;
68   GtkWidget *sample_area_eb;
69
70   GtkWidget *scales[8];
71   GtkWidget *entries[8];
72   GtkWidget *opacity_label;
73
74   GdkGC *wheel_gc;
75   GdkGC *value_gc;
76   GdkGC *sample_gc;
77
78   GtkUpdateType policy;
79   gint use_opacity;
80   gint timer_active;
81   gint timer_tag;
82   gdouble values[8];
83   gdouble old_values[8];
84
85   guchar *wheel_buf;
86   guchar *value_buf;
87   guchar *sample_buf;
88 };
89
90 struct _GtkColorSelectionClass
91 {
92   GtkVBoxClass parent_class;
93
94   void (* color_changed) (GtkColorSelection *colorsel);
95 };
96
97 struct _GtkColorSelectionDialog
98 {
99   GtkWindow window;
100
101   GtkWidget *colorsel;
102   GtkWidget *main_vbox;
103   GtkWidget *ok_button;
104   GtkWidget *reset_button;
105   GtkWidget *cancel_button;
106   GtkWidget *help_button;
107 };
108
109 struct _GtkColorSelectionDialogClass
110 {
111   GtkWindowClass parent_class;
112 };
113
114
115 /* ColorSelection */
116
117 guint      gtk_color_selection_get_type          (void);
118
119 GtkWidget* gtk_color_selection_new               (void);
120
121 void       gtk_color_selection_set_update_policy (GtkColorSelection     *colorsel,
122                                                   GtkUpdateType          policy);
123
124 void       gtk_color_selection_set_opacity       (GtkColorSelection     *colorsel,
125                                                   gint                   use_opacity);
126
127 void       gtk_color_selection_set_color         (GtkColorSelection     *colorsel,
128                                                   gdouble               *color);
129
130 void       gtk_color_selection_get_color         (GtkColorSelection     *colorsel,
131                                                   gdouble               *color);
132
133 /* ColorSelectionDialog */
134
135 guint      gtk_color_selection_dialog_get_type   (void);
136
137 GtkWidget* gtk_color_selection_dialog_new        (const gchar *title);
138
139
140 #ifdef __cplusplus
141 }
142 #endif /* __cplusplus */
143
144
145 #endif /* __GTK_COLORSEL_H__ */