Remove the gsheet-row-* modules and replaced with psppire-axis-*
[pspp-builds.git] / lib / gtksheet / psppire-axis.h
1 /* PSPPIRE - a graphical user interface for PSPP.
2    Copyright (C) 2008  Free Software Foundation
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
18 #ifndef PSPPIRE_AXIS_H__
19 #define PSPPIRE_AXIS_H__
20
21
22 #include <glib-object.h>
23 #include <glib.h>
24
25 #include <libpspp/tower.h>
26
27 G_BEGIN_DECLS
28
29
30
31 /* --- type macros --- */
32 #define G_TYPE_PSPPIRE_AXIS              (psppire_axis_get_type ())
33 #define PSPPIRE_AXIS(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), G_TYPE_PSPPIRE_AXIS, PsppireAxis))
34 #define PSPPIRE_AXIS_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), G_TYPE_PSPPIRE_AXIS, PsppireAxisClass))
35 #define PSPPIRE_IS_AXIS(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), G_TYPE_PSPPIRE_AXIS))
36 #define PSPPIRE_IS_AXIS_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), G_TYPE_PSPPIRE_AXIS))
37 #define PSPPIRE_AXIS_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), G_TYPE_PSPPIRE_AXIS, PsppireAxisClass))
38
39
40 /* --- typedefs & structures --- */
41 typedef struct _PsppireAxis        PsppireAxis;
42 typedef struct _PsppireAxisClass PsppireAxisClass;
43
44 struct _PsppireAxis
45 {
46   GObject             parent;
47
48   glong min_extent;
49   gint default_size;
50 };
51
52 struct _PsppireAxisClass
53 {
54   GObjectClass parent_class;
55 };
56
57
58 GType          psppire_axis_get_type (void);
59
60
61 \f
62
63 GType psppire_axis_iface_get_type (void);
64
65 #define PSPPIRE_TYPE_AXIS_IFACE (psppire_axis_iface_get_type ())
66
67 typedef struct _PsppireAxisIface PsppireAxisIface;
68
69 struct _PsppireAxisIface
70 {
71   GTypeInterface g_iface;
72
73
74   /* Virtual Table */
75
76   gint  (*unit_size) (const PsppireAxis *a, gint unit);
77
78   gint  (*unit_count) (const PsppireAxis *a);
79
80   glong (*pixel_start) (const PsppireAxis *a, gint unit);
81
82   gint  (*get_unit_at_pixel) (const PsppireAxis *a, glong pixel);
83
84   glong (*total_size ) (const PsppireAxis *a);
85 };
86
87
88 /* Interface between sheet and axis */
89
90 gint psppire_axis_unit_size (const PsppireAxis *a, gint unit);
91
92 gint psppire_axis_unit_count (const PsppireAxis *a);
93
94 glong psppire_axis_pixel_start (const PsppireAxis *a, gint unit);
95
96 gint psppire_axis_get_unit_at_pixel (const PsppireAxis *a, glong pixel);
97
98
99 G_END_DECLS
100
101 #endif /* PSPPIRE_AXIS_H__ */