7eafd124934c5a8113a4e498745fc01deba62951
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 "sp-metric.h"
25 #include "snap.h"
27 namespace Inkscape {
28 class CanvasGrid;
29 }
31 enum {
32 SP_BORDER_LAYER_BOTTOM,
33 SP_BORDER_LAYER_TOP
34 };
36 struct SPNamedView : public SPObjectGroup {
37 unsigned int editable : 1;
38 unsigned int showguides : 1;
39 unsigned int showborder : 1;
40 unsigned int showpageshadow : 1;
41 unsigned int borderlayer : 2;
43 double zoom;
44 double cx;
45 double cy;
46 gint window_width;
47 gint window_height;
48 gint window_x;
49 gint window_y;
51 SnapManager snap_manager;
52 GSList * grids;
53 bool grids_visible;
55 SPUnit const *doc_units;
57 GQuark default_layer_id;
59 double connector_spacing;
61 guint32 guidecolor;
62 guint32 guidehicolor;
63 guint32 bordercolor;
64 guint32 pagecolor;
65 guint32 pageshadow;
67 GSList *guides;
68 GSList *views;
70 gint viewcount;
72 void show(SPDesktop *desktop);
73 void hide(SPDesktop const *desktop);
74 void activateGuides(gpointer desktop, gboolean active);
75 gchar const *getName() const;
76 guint getViewCount();
77 GSList const *getViewList() const;
78 SPMetric getDefaultMetric() const;
80 void translateGuides(Geom::Translate const &translation);
81 void scrollAllDesktops(double dx, double dy, bool is_scrolling);
82 };
84 struct SPNamedViewClass {
85 SPObjectGroupClass parent_class;
86 };
88 GType sp_namedview_get_type();
90 SPNamedView *sp_document_namedview(SPDocument *document, gchar const *name);
92 void sp_namedview_window_from_document(SPDesktop *desktop);
93 void sp_namedview_document_from_window(SPDesktop *desktop);
94 void sp_namedview_update_layers_from_document (SPDesktop *desktop);
96 void sp_namedview_toggle_guides(SPDocument *doc, Inkscape::XML::Node *repr);
97 void sp_namedview_show_grids(SPNamedView *namedview, bool show, bool dirty_document);
98 Inkscape::CanvasGrid * sp_namedview_get_first_enabled_grid(SPNamedView *namedview);
100 #endif /* !INKSCAPE_SP_NAMEDVIEW_H */
103 /*
104 Local Variables:
105 mode:c++
106 c-file-style:"stroustrup"
107 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
108 indent-tabs-mode:nil
109 fill-column:99
110 End:
111 */
112 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :