2006-09-12 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
[hildon] / hildon-widgets / hildon-color-chooser-button.h
1 /*
2  * This file is part of hildon-libs
3  *
4  * Copyright (C) 2005, 2006 Nokia Corporation, all rights reserved.
5  *
6  * Author: Kuisma Salonen <kuisma.salonen@nokia.com>
7  * Contact: Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public License
11  * as published by the Free Software Foundation; version 2.1 of
12  * the License or any later version.
13  *
14  * This library is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
22  * 02110-1301 USA
23  *
24  */
25
26
27 #ifndef __HILDON_COLOR_CHOOSER_BUTTON_H__
28 #define __HILDON_COLOR_CHOOSER_BUTTON_H__
29
30
31 #include <gdk/gdkcolor.h>
32
33 #include <gtk/gtkwidget.h>
34
35
36 #define HILDON_TYPE_COLOR_CHOOSER_BUTTON             (hildon_color_chooser_button_get_type())
37
38 #define HILDON_COLOR_CHOOSER_BUTTON(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), HILDON_TYPE_COLOR_CHOOSER_BUTTON, HildonColorChooserButton))
39 #define HILDON_COLOR_CHOOSER_BUTTON_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), HILDON_TYPE_COLOR_CHOOSER_BUTTON, HildonColorChooserButtonClass))
40 #define HILDON_IS_COLOR_CHOOSER_BUTTON(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), HILDON_TYPE_COLOR_CHOOSER_BUTTON))
41
42
43 typedef struct HildonColorChooserButton_            HildonColorChooserButton;
44 typedef struct HildonColorChooserButtonClass_       HildonColorChooserButtonClass;
45
46
47 struct HildonColorChooserButton_
48 {
49   GtkButton parent;
50
51   GdkColor color;
52
53   GtkWidget *area;
54
55   GdkGC *color_gc;
56
57
58   struct {
59     GtkBorder outer;
60     GtkBorder inner;
61     GtkBorder min;
62   } style_info;
63 };
64
65 struct HildonColorChooserButtonClass_
66 {
67   GtkButtonClass parent;
68
69   void (*color_changed) (HildonColorChooserButton *button, GdkColor *color);
70
71   void (*set_color) (HildonColorChooserButton *, GdkColor *);
72 };
73
74
75 GtkType hildon_color_chooser_button_get_type();
76 GtkWidget *hildon_color_chooser_button_new();
77
78 void hildon_color_chooser_button_set_color(HildonColorChooserButton *button, GdkColor *color);
79 void hildon_color_chooser_button_get_color(HildonColorChooserButton *button, GdkColor *color);
80
81
82 #endif /* __HILDON_COLOR_CHOOSER_BUTTON_H__ */