Code

Node tool: correctly save node skewing to undo history
[inkscape.git] / src / svg-view-widget.h
1 #ifndef __SP_SVG_VIEW_WIDGET_H__
2 #define __SP_SVG_VIEW_WIDGET_H__
4 /** \file
5  * SPSVGView, SPSVGSPViewWidget: Generic SVG view and widget
6  *
7  * Authors:
8  *   Lauris Kaplinski <lauris@kaplinski.com>
9  *
10  * Copyright (C) 2001-2002 Lauris Kaplinski
11  * Copyright (C) 2001 Ximian, Inc.
12  *
13  * Released under GNU GPL, read the file 'COPYING' for more information
14  */
16 #include "display/display-forward.h"
17 #include "ui/view/view-widget.h"
19 class SPDocument;
20 class SPSVGSPViewWidget;
21 class SPSVGSPViewWidgetClass;
23 #define SP_TYPE_SVG_VIEW_WIDGET (sp_svg_view_widget_get_type ())
24 #define SP_SVG_VIEW_WIDGET(obj) (GTK_CHECK_CAST ((obj), SP_TYPE_SVG_VIEW_WIDGET, SPSVGSPViewWidget))
25 #define SP_SVG_VIEW_WIDGET_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), SP_TYPE_SVG_VIEW_WIDGET, SPSVGSPViewWidgetClass))
26 #define SP_IS_SVG_VIEW_WIDGET(obj) (GTK_CHECK_TYPE ((obj), SP_TYPE_SVG_VIEW_WIDGET))
27 #define SP_IS_SVG_VIEW_WIDGET_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), SP_TYPE_SVG_VIEW_WIDGET))
29 GtkType sp_svg_view_widget_get_type (void);
31 GtkWidget *sp_svg_view_widget_new (SPDocument *doc);
33 void sp_svg_view_widget_set_resize (SPSVGSPViewWidget *vw, bool resize, gdouble width, gdouble height);
35 /**
36  * An SPSVGSPViewWidget is an SVG view together with a canvas.
37  */
38 struct SPSVGSPViewWidget {
39     public:
40         SPViewWidget widget;
42         GtkWidget *sw;
43         GtkWidget *canvas;
45         /// Whether to resize automatically
46         bool resize;
47         gdouble maxwidth, maxheight;
49     // C++ Wrappers
50     /// Flags the SPSVGSPViewWidget to have its size changed with Gtk.
51     void setResize(bool resize, gdouble width, gdouble height) {
52         sp_svg_view_widget_set_resize(this, resize, width, height);
53     }
54 };
56 /// The SPSVGSPViewWidget vtable.
57 struct SPSVGSPViewWidgetClass {
58         SPViewWidgetClass parent_class;
59 };
62 #endif