1 /* PSPPIRE - a graphical user interface for PSPP.
2 Copyright (C) 2008 Free Software Foundation
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.
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.
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/>. */
18 #ifndef PSPPIRE_AXIS_H__
19 #define PSPPIRE_AXIS_H__
22 #include <glib-object.h>
25 #include <libpspp/tower.h>
30 /* --- type macros --- */
31 #define G_TYPE_PSPPIRE_AXIS (psppire_axis_get_type ())
32 #define PSPPIRE_AXIS(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), G_TYPE_PSPPIRE_AXIS, PsppireAxis))
33 #define PSPPIRE_AXIS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G_TYPE_PSPPIRE_AXIS, PsppireAxisClass))
34 #define PSPPIRE_IS_AXIS(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), G_TYPE_PSPPIRE_AXIS))
35 #define PSPPIRE_IS_AXIS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G_TYPE_PSPPIRE_AXIS))
36 #define PSPPIRE_AXIS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G_TYPE_PSPPIRE_AXIS, PsppireAxisClass))
40 /* --- typedefs & structures --- */
41 typedef struct _PsppireAxis PsppireAxis;
42 typedef struct _PsppireAxisClass PsppireAxisClass;
53 struct _PsppireAxisClass
55 GObjectClass parent_class;
59 GType psppire_axis_get_type (void);
61 PsppireAxis* psppire_axis_new (gint w);
64 /* Interface between sheet and axis */
66 gint psppire_axis_unit_size (PsppireAxis *a, gint unit);
68 gint psppire_axis_unit_count (PsppireAxis *a);
70 glong psppire_axis_pixel_start (PsppireAxis *a, gint unit);
72 gint psppire_axis_get_unit_at_pixel (PsppireAxis *a, glong pixel);
76 /* Interface between axis and model */
78 void psppire_axis_append (PsppireAxis *a, gint width);
82 #endif /* PSPPIRE_AXIS_H__ */