1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library 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 GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
19 #ifndef __GTK_RULER_H__
20 #define __GTK_RULER_H__
24 #include <gtk/gtkwidget.h>
29 #endif /* __cplusplus */
32 #define GTK_RULER(obj) GTK_CHECK_CAST (obj, gtk_ruler_get_type (), GtkRuler)
33 #define GTK_RULER_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_ruler_get_type (), GtkRulerClass)
34 #define GTK_IS_RULER(obj) GTK_CHECK_TYPE (obj, gtk_ruler_get_type ())
37 typedef struct _GtkRuler GtkRuler;
38 typedef struct _GtkRulerClass GtkRulerClass;
39 typedef struct _GtkRulerMetric GtkRulerMetric;
41 /* All distances below are in 1/72nd's of an inch. (According to
42 * Adobe that's a point, but points are really 1/72.27 in.)
48 GdkPixmap *backing_store;
50 GtkRulerMetric *metric;
54 /* The upper limit of the ruler (in points) */
56 /* The lower limit of the ruler */
58 /* The position of the mark on the ruler */
60 /* The maximum size of the ruler */
66 GtkWidgetClass parent_class;
68 void (* draw_ticks) (GtkRuler *ruler);
69 void (* draw_pos) (GtkRuler *ruler);
72 struct _GtkRulerMetric
76 /* This should be points_per_unit. This is the size of the unit
77 * in 1/72nd's of an inch and has nothing to do with screen pixels */
78 gfloat pixels_per_unit;
79 gfloat ruler_scale[10];
80 gint subdivide[5]; /* five possible modes of subdivision */
84 guint gtk_ruler_get_type (void);
85 void gtk_ruler_set_metric (GtkRuler *ruler,
86 GtkMetricType metric);
87 void gtk_ruler_set_range (GtkRuler *ruler,
92 void gtk_ruler_draw_ticks (GtkRuler *ruler);
93 void gtk_ruler_draw_pos (GtkRuler *ruler);
98 #endif /* __cplusplus */
101 #endif /* __GTK_RULER_H__ */