Tizen 2.1 base
[framework/uifw/ise-engine-anthy.git] / src / scim_anthy_color_button.h
1 /* 
2  * Copyright (C) 2005 Hiroyuki Ikezoe <poincare@ikezoe.net>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program 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
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  */
18 /*
19  * The original code is gimpfgbgeditor.h in GIMP-2.3.2.
20  * Copyright (C) 2004 Michael Natterer <mitch@gimp.org>
21  */
22
23 #ifndef __SCIM_ANTHY_COLOR_BUTTON_H__
24 #define __SCIM_ANTHY_COLOR_BUTTON_H__
25
26
27 #include <gtk/gtk.h>
28 #include <scim.h>
29
30 using namespace scim;
31
32 #define SCIM_ANTHY_TYPE_COLOR_BUTTON            (scim_anthy_color_button_get_type ())
33 #define SCIM_ANTHY_COLOR_BUTTON(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), SCIM_ANTHY_TYPE_COLOR_BUTTON, ScimAnthyColorButton))
34 #define SCIM_ANTHY_COLOR_BUTTON_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), SCIM_ANTHY_TYPE_COLOR_BUTTON, ScimAnthyColorButtonClass))
35 #define SCIM_ANTHY_IS_COLOR_BUTTON(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SCIM_ANTHY_TYPE_COLOR_BUTTON))
36 #define SCIM_ANTHY_IS_COLOR_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SCIM_ANTHY_TYPE_COLOR_BUTTON))
37 #define SCIM_ANTHY_COLOR_BUTTON_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), SCIM_ANTHY_TYPE_COLOR_BUTTON, ScimAnthyColorButtonClass))
38
39
40 typedef struct _ScimAnthyColorButtonClass ScimAnthyColorButtonClass;
41 typedef struct _ScimAnthyColorButton ScimAnthyColorButton;
42
43 struct _ScimAnthyColorButton
44 {
45   GtkDrawingArea   parent_instance;
46
47   guchar          *render_buf;
48   gint             render_buf_size;
49
50   GdkPixbuf       *swap_icon;
51
52   gint             rect_width;
53   gint             rect_height;
54   gint             click_target;
55
56   GdkColor         fg_color;
57   GdkColor         bg_color;
58 };
59
60 struct _ScimAnthyColorButtonClass
61 {
62   GtkDrawingAreaClass  parent_class;
63
64   /*  signals  */
65
66   void (* color_changed) (ScimAnthyColorButton  *button);
67 };
68
69
70 GType       scim_anthy_color_button_get_type    (void) G_GNUC_CONST;
71
72 GtkWidget * scim_anthy_color_button_new         (void);
73
74 gboolean    scim_anthy_color_button_get_colors  (ScimAnthyColorButton *button,
75                                                  String *fg_value,
76                                                  String *bg_value);
77 gboolean    scim_anthy_color_button_set_colors  (ScimAnthyColorButton *button,
78                                                  const String &fg_value,
79                                                  const String &bg_value);
80
81 #endif  /*  __SCIM_ANTHY_COLOR_BUTTON_H__  */