diff options
| author | MenTaLguY <mental@rydia.net> | 2006-01-16 02:36:01 +0000 |
|---|---|---|
| committer | mental <mental@users.sourceforge.net> | 2006-01-16 02:36:01 +0000 |
| commit | 179fa413b047bede6e32109e2ce82437c5fb8d34 (patch) | |
| tree | a5a6ac2c1708bd02288fbd8edb2ff500ff2e0916 /src/svg-view.h | |
| download | inkscape-179fa413b047bede6e32109e2ce82437c5fb8d34.tar.gz inkscape-179fa413b047bede6e32109e2ce82437c5fb8d34.zip | |
moving trunk for module inkscape
(bzr r1)
Diffstat (limited to 'src/svg-view.h')
| -rw-r--r-- | src/svg-view.h | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/src/svg-view.h b/src/svg-view.h new file mode 100644 index 000000000..4494945d5 --- /dev/null +++ b/src/svg-view.h @@ -0,0 +1,75 @@ +#ifndef __SP_SVG_VIEW_H__ +#define __SP_SVG_VIEW_H__ + +/** \file + * SPSVGView, SPSVGSPViewWidget: Generic SVG view and widget + * + * Authors: + * Lauris Kaplinski <lauris@kaplinski.com> + * Ralf Stephan <ralf@ark.in-berlin.de> + * + * Copyright (C) 2001-2002 Lauris Kaplinski + * Copyright (C) 2001 Ximian, Inc. + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ + +#include "ui/view/view.h" + +class SPCanvasGroup; +class SPCanvasItem; + + +/** + * Generic SVG view. + */ +class SPSVGView : public Inkscape::UI::View::View { +public: + unsigned int _dkey; + SPCanvasGroup *_parent; + SPCanvasItem *_drawing; + gdouble _hscale; ///< horizontal scale + gdouble _vscale; ///< vertical scale + bool _rescale; ///< whether to rescale automatically + bool _keepaspect; + gdouble _width; + gdouble _height; + + + SPSVGView (SPCanvasGroup* parent); + virtual ~SPSVGView(); + + /// Rescales SPSVGView to given proportions. + void setScale (gdouble hscale, gdouble vscale); + + /// Rescales SPSVGView and keeps aspect ratio. + void setRescale (bool rescale, bool keepaspect, gdouble width, gdouble height); + + void doRescale (bool event); + + virtual void setDocument (SPDocument*); + virtual void mouseover(); + virtual void mouseout(); + virtual bool shutdown() { return true; } + +private: + virtual void onPositionSet (double, double) {} + virtual void onResized (double, double) {} + virtual void onRedrawRequested() {} + virtual void onStatusMessage (Inkscape::MessageType type, gchar const *message) {} + virtual void onDocumentURISet (gchar const* uri) {} + virtual void onDocumentResized (double, double); +}; + +#endif + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 : |
