821a6e9ea44c0dfba2f110686c51a2a399e093af
[pspp] / src / ui / gui / psppire-cell-renderer-button.h
1 /* PSPPIRE - a graphical user interface for PSPP.
2    Copyright (C) 2011, 2012 Free Software Foundation, Inc.
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 3 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, see <http://www.gnu.org/licenses/>. */
16
17 #ifndef PSPPIRE_CELL_RENDERER_BUTTON_H
18 #define PSPPIRE_CELL_RENDERER_BUTTON_H 1
19
20 #include <gtk/gtk.h>
21
22 G_BEGIN_DECLS
23
24 #define PSPPIRE_TYPE_CELL_RENDERER_BUTTON             (psppire_cell_renderer_button_get_type())
25 #define PSPPIRE_CELL_RENDERER_BUTTON(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj),PSPPIRE_TYPE_CELL_RENDERER_BUTTON,PsppireCellRendererButton))
26 #define PSPPIRE_CELL_RENDERER_BUTTON_CLASS(class)     (G_TYPE_CHECK_CLASS_CAST ((class),PSPPIRE_TYPE_CELL_RENDERER_BUTTON,PsppireCellRendererButtonClass))
27 #define PSPPIRE_IS_CELL_RENDERER_BUTTON(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj),PSPPIRE_TYPE_CELL_RENDERER_BUTTON))
28 #define PSPPIRE_IS_CELL_RENDERER_BUTTON_CLASS(class)  (G_TYPE_CHECK_CLASS_TYPE ((class),PSPPIRE_TYPE_CELL_RENDERER_BUTTON))
29 #define PSPPIRE_CELL_RENDERER_BUTTON_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj),PSPPIRE_TYPE_CELL_RENDERER_BUTTON,PsppireCellRendererButtonClass))
30
31 typedef struct _PsppireCellRendererButton      PsppireCellRendererButton;
32 typedef struct _PsppireCellRendererButtonClass PsppireCellRendererButtonClass;
33
34 struct _PsppireCellRendererButton {
35   GtkCellRenderer parent;
36
37   gboolean editable;
38   gchar *label;
39   gint border_width;
40   gint xpad;
41   gint ypad;
42
43   GtkWidget *button;
44   guint32 click_time;
45   gdouble click_x;
46   gdouble click_y;
47
48   /* Style caching. */
49   GtkStyle *button_style;
50   GtkStyle *label_style;
51   GtkWidget *base;
52   gulong style_set_handler;
53   gulong destroy_handler;
54 };
55
56 struct _PsppireCellRendererButtonClass {
57   GtkCellRendererClass parent_class;
58 };
59
60 GType psppire_cell_renderer_button_get_type (void) G_GNUC_CONST;
61 GtkCellRenderer* psppire_cell_renderer_button_new (void);
62
63 G_END_DECLS
64
65 #endif /* PSPPIRE_CELL_RENDERER_BUTTON_H */