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 showguides : 1;
40 unsigned int showborder : 1;
41 unsigned int showpageshadow : 1;
42 unsigned int borderlayer : 2;
44 double zoom;
45 double cx;
46 double cy;
47 gint window_width;
48 gint window_height;
49 gint window_x;
50 gint window_y;
52 SnapManager snap_manager;
53 GSList * grids;
55 SPUnit const *doc_units;
57 SPUnit const *gridtoleranceunit;
58 gdouble gridtolerance;
60 SPUnit const *guidetoleranceunit;
61 gdouble guidetolerance;
63 SPUnit const *objecttoleranceunit;
64 gdouble objecttolerance;
66 GQuark default_layer_id;
68 double connector_spacing;
70 guint32 guidecolor;
71 guint32 guidehicolor;
72 guint32 bordercolor;
73 guint32 pagecolor;
74 guint32 pageshadow;
76 GSList *guides;
77 GSList *views;
79 gint viewcount;
81 void show(SPDesktop *desktop);
82 void hide(SPDesktop const *desktop);
83 void activateGuides(gpointer desktop, gboolean active);
84 gchar const *getName() const;
85 guint getViewCount();
86 GSList const *getViewList() const;
87 SPMetric getDefaultMetric() const;
88 };
90 struct SPNamedViewClass {
91 SPObjectGroupClass parent_class;
92 };
94 GType sp_namedview_get_type();
96 SPNamedView *sp_document_namedview(SPDocument *document, gchar const *name);
98 void sp_namedview_window_from_document(SPDesktop *desktop);
99 void sp_namedview_document_from_window(SPDesktop *desktop);
100 void sp_namedview_update_layers_from_document (SPDesktop *desktop);
102 void sp_namedview_toggle_guides(SPDocument *doc, Inkscape::XML::Node *repr);
104 #endif /* !INKSCAPE_SP_NAMEDVIEW_H */
107 /*
108 Local Variables:
109 mode:c++
110 c-file-style:"stroustrup"
111 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
112 indent-tabs-mode:nil
113 fill-column:99
114 End:
115 */
116 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :