Code

Purging old axonometric grid code: reworked it into the new grid class structure...
[inkscape.git] / src / sp-namedview.h
1 #ifndef INKSCAPE_SP_NAMEDVIEW_H
2 #define INKSCAPE_SP_NAMEDVIEW_H
4 /*
5  * <sodipodi:namedview> implementation
6  *
7  * Authors:
8  *   Lauris Kaplinski <lauris@kaplinski.com>
9  *
10  * Copyright (C) 2006 Johan Engelen <johan@shouraizou.nl>
11  * Copyright (C) Lauris Kaplinski 2000-2002
12  *
13  * Released under GNU GPL, read the file 'COPYING' for more information
14  */
16 #define SP_TYPE_NAMEDVIEW (sp_namedview_get_type())
17 #define SP_NAMEDVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), SP_TYPE_NAMEDVIEW, SPNamedView))
18 #define SP_NAMEDVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), SP_TYPE_NAMEDVIEW, SPNamedViewClass))
19 #define SP_IS_NAMEDVIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), SP_TYPE_NAMEDVIEW))
20 #define SP_IS_NAMEDVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), SP_TYPE_NAMEDVIEW))
22 #include "helper/helper-forward.h"
23 #include "sp-object-group.h"
24 #include "libnr/nr-point.h"
25 #include "sp-metric.h"
26 #include "snap.h"
28 namespace Inkscape {
29 class CanvasGrid;
30 }
32 enum {
33     SP_BORDER_LAYER_BOTTOM,
34     SP_BORDER_LAYER_TOP
35 };
37 struct SPNamedView : public SPObjectGroup {
38     unsigned int editable : 1;
39     unsigned int showgrid : 1;
40     unsigned int showguides : 1;
41     unsigned int showborder : 1;
42     unsigned int showpageshadow : 1;
43     unsigned int borderlayer : 2;
45     double zoom;
46     double cx;
47     double cy;
48     gint window_width;
49     gint window_height;
50     gint window_x;
51     gint window_y;
53     SnapManager snap_manager;
54     //GridManager grid_manager;
55     GSList * grids;
57     SPUnit const *gridunit;
58     /* Grid data is in points regardless of unit */
59     NR::Point gridorigin;
60     gdouble gridspacing[2];
61     gint gridempspacing;
63     SPUnit const *doc_units;
65     SPUnit const *gridtoleranceunit;
66     gdouble gridtolerance;
68     SPUnit const *guidetoleranceunit;
69     gdouble guidetolerance;
71     SPUnit const *objecttoleranceunit;
72     gdouble objecttolerance;
74     bool has_abs_tolerance;
75     
76     GQuark default_layer_id;
77     
78     double connector_spacing;
80     guint32 gridcolor;
81     guint32 gridempcolor;
82     guint32 guidecolor;
83     guint32 guidehicolor;
84     guint32 bordercolor;
85     guint32 pagecolor;
86     guint32 pageshadow;
88     GSList *guides;
89     GSList *views;
90     GSList *gridviews;
91     
92     gint viewcount;
94     void show(SPDesktop *desktop);
95     void hide(SPDesktop const *desktop);
96     void activateGuides(gpointer desktop, gboolean active);
97     gchar const *getName() const;
98     guint getViewCount();
99     GSList const *getViewList() const;
100     SPMetric getDefaultMetric() const;
101 };
103 struct SPNamedViewClass {
104     SPObjectGroupClass parent_class;
105 };
107 GType sp_namedview_get_type();
109 SPNamedView *sp_document_namedview(SPDocument *document, gchar const *name);
111 void sp_namedview_window_from_document(SPDesktop *desktop);
112 void sp_namedview_document_from_window(SPDesktop *desktop);
113 void sp_namedview_update_layers_from_document (SPDesktop *desktop);
115 void sp_namedview_toggle_guides(SPDocument *doc, Inkscape::XML::Node *repr);
116 void sp_namedview_toggle_grid(SPDocument *doc, Inkscape::XML::Node *repr);
117 void sp_namedview_set_gridtype(unsigned int type, SPDocument *doc, Inkscape::XML::Node *repr);
119 #endif /* !INKSCAPE_SP_NAMEDVIEW_H */
122 /*
123   Local Variables:
124   mode:c++
125   c-file-style:"stroustrup"
126   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
127   indent-tabs-mode:nil
128   fill-column:99
129   End:
130 */
131 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :