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