ruler.h revision 781107189e24e0f6157c8e2f4973ee537b252666
1549N/A#ifndef __SP_RULER_H__
1549N/A#define __SP_RULER_H__
1549N/A
1549N/A/*
1549N/A * Customized ruler class for inkscape
1549N/A *
1549N/A * Authors:
1549N/A * Lauris Kaplinski <lauris@kaplinski.com>
1549N/A * Frank Felfe <innerspace@iname.com>
1549N/A *
1549N/A * Copyright (C) 1999-2002 authors
1549N/A *
1549N/A * Released under GNU GPL, read the file 'COPYING' for more information
1549N/A */
1549N/A
1549N/A#include <gtk/gtk.h>
1549N/A#include "sp-metric.h"
1549N/A#include <iostream>
1549N/A#include <glib.h>
1549N/A
1549N/A#define SP_TYPE_RULER (sp_ruler_get_type ())
1549N/A#define SP_RULER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_RULER, SPRuler))
1549N/A#define SP_RULER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SP_TYPE_RULER, SPRulerClass))
1549N/A#define SP_IS_RULER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SP_TYPE_RULER))
1549N/A#define SP_IS_RULER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SP_TYPE_RULER))
1549N/A#define SP_RULER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SP_TYPE_RULER, SPRulerClass))
1549N/A
1549N/A
1549N/Atypedef struct _SPRuler SPRuler;
1549N/Atypedef struct _SPRulerPrivate SPRulerPrivate;
1549N/Atypedef struct _SPRulerClass SPRulerClass;
1549N/Atypedef struct _SPRulerMetric SPRulerMetric;
1549N/A
1549N/A/* All distances below are in 1/72nd's of an inch. (According to
1549N/A * Adobe that's a point, but points are really 1/72.27 in.)
1549N/A */
1549N/Astruct _SPRuler
1549N/A{
1549N/A GtkWidget widget;
1549N/A
1549N/A /*< private >*/
1549N/A SPRulerPrivate *priv;
1549N/A};
1549N/A
1549N/Astruct _SPRulerClass
1549N/A{
1549N/A GtkWidgetClass parent_class;
1549N/A};
1549N/A
1549N/Astruct _SPRulerMetric
1549N/A{
1549N/A gchar const *metric_name;
1549N/A gchar const *abbrev;
1549N/A /* This should be points_per_unit. This is the size of the unit
1549N/A * in 1/72nd's of an inch and has nothing to do with screen pixels */
1549N/A gdouble pixels_per_unit;
1549N/A gdouble ruler_scale[10];
1549N/A gint subdivide[5]; /* five possible modes of subdivision */
1549N/A};
1549N/A
1549N/A
1549N/AGType sp_ruler_get_type (void) G_GNUC_CONST;
1549N/AGtkWidget* sp_ruler_new (GtkOrientation orientation);
1549N/Avoid sp_ruler_set_position (SPRuler *ruler,
1549N/A gdouble set_position);
1549N/Agdouble sp_ruler_get_position (SPRuler *ruler);
1549N/Avoid sp_ruler_set_range (SPRuler *ruler,
1549N/A gdouble lower,
1549N/A gdouble upper,
1549N/A gdouble max_size);
1549N/Avoid sp_ruler_get_range (SPRuler *ruler,
1549N/A gdouble *lower,
1549N/A gdouble *upper,
1549N/A gdouble *max_size);
1549N/Avoid sp_ruler_set_metric (SPRuler *ruler,
1549N/A SPMetric metric);
1549N/ASPMetric sp_ruler_get_metric (SPRuler *ruler);
1549N/A
1549N/A#endif /* __SP_RULER_H__ */
1549N/A
1549N/A/*
1549N/A Local Variables:
1549N/A mode:c++
1549N/A c-file-style:"stroustrup"
1549N/A c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
1549N/A indent-tabs-mode:nil
1549N/A fill-column:99
1549N/A End:
1549N/A*/
1549N/A// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
1549N/A