1 #ifndef SP_CANVAS_GRID_H
2 #define SP_CANVAS_GRID_H
4 /*
5 * SPCGrid
6 *
7 * Generic (and quite unintelligent) grid item for gnome canvas
8 *
9 * Copyright (C) Lauris Kaplinski 2000
10 *
11 */
13 #include <display/sp-canvas.h>
17 #define SP_TYPE_CGRID (sp_cgrid_get_type ())
18 #define SP_CGRID(obj) (GTK_CHECK_CAST ((obj), SP_TYPE_CGRID, SPCGrid))
19 #define SP_CGRID_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), SP_TYPE_CGRID, SPCGridClass))
20 #define SP_IS_CGRID(obj) (GTK_CHECK_TYPE ((obj), SP_TYPE_CGRID))
21 #define SP_IS_CGRID_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), SP_TYPE_CGRID))
24 /** \brief All the variables that are tracked for a grid specific
25 canvas item. */
26 struct SPCGrid : public SPCanvasItem{
27 NR::Point origin; /**< Origin of the grid */
28 NR::Point spacing; /**< Spacing between elements of the grid */
29 guint32 color; /**< Color for normal lines */
30 guint32 empcolor; /**< Color for emphisis lines */
31 gint empspacing; /**< Spacing between emphisis lines */
32 bool scaled[2]; /**< Whether the grid is in scaled mode, which can
33 be different in the X or Y direction, hense two
34 variables */
35 NR::Point ow; /**< Transformed origin by the affine for the zoom */
36 NR::Point sw; /**< Transformed spacing by the affine for the zoom */
37 };
39 struct SPCGridClass {
40 SPCanvasItemClass parent_class;
41 };
44 /* Standard Gtk function */
45 GtkType sp_cgrid_get_type (void);
49 #endif