Merge remote-tracking branch 'origin/master' into sheet
[pspp] /
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 {
36   GtkCellRenderer parent;
37
38   gboolean editable;
39   gchar *label;
40   gint border_width;
41   gint xpad;
42   gint ypad;
43
44   gboolean slash;
45
46   GtkWidget *button;
47   guint32 click_time;
48   gdouble click_x;
49   gdouble click_y;
50
51   /* Style caching. */
52   GtkStyle *button_style;
53   GtkStyle *label_style;
54   GtkWidget *base;
55   gulong style_set_handler;
56   gboolean dispose_has_run;
57 };
58
59 struct _PsppireCellRendererButtonClass {
60   GtkCellRendererClass parent_class;
61 };
62
63 GType psppire_cell_renderer_button_get_type (void) G_GNUC_CONST;
64 GtkCellRenderer* psppire_cell_renderer_button_new (void);
65
66 void psppire_cell_renderer_button_set_slash (PsppireCellRendererButton *,
67                                              gboolean slash);
68 gboolean psppire_cell_renderer_button_get_slash (const PsppireCellRendererButton *);
69
70 G_END_DECLS
71
72 #endif /* PSPPIRE_CELL_RENDERER_BUTTON_H */