~ubuntu-branches/ubuntu/utopic/inkscape/utopic-proposed

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef __SP_SVG_VIEW_WIDGET_H__
#define __SP_SVG_VIEW_WIDGET_H__

/** \file
 * SPSVGView, SPSVGSPViewWidget: Generic SVG view and widget
 *
 * Authors:
 *   Lauris Kaplinski <lauris@kaplinski.com>
 *
 * Copyright (C) 2001-2002 Lauris Kaplinski
 * Copyright (C) 2001 Ximian, Inc.
 *
 * Released under GNU GPL, read the file 'COPYING' for more information
 */

#include "display/display-forward.h"
#include "ui/view/view-widget.h"

class SPDocument;
class SPSVGSPViewWidget;
class SPSVGSPViewWidgetClass;

#define SP_TYPE_SVG_VIEW_WIDGET (sp_svg_view_widget_get_type ())
#define SP_SVG_VIEW_WIDGET(obj) (GTK_CHECK_CAST ((obj), SP_TYPE_SVG_VIEW_WIDGET, SPSVGSPViewWidget))
#define SP_SVG_VIEW_WIDGET_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), SP_TYPE_SVG_VIEW_WIDGET, SPSVGSPViewWidgetClass))
#define SP_IS_SVG_VIEW_WIDGET(obj) (GTK_CHECK_TYPE ((obj), SP_TYPE_SVG_VIEW_WIDGET))
#define SP_IS_SVG_VIEW_WIDGET_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), SP_TYPE_SVG_VIEW_WIDGET))

GtkType sp_svg_view_widget_get_type (void);

GtkWidget *sp_svg_view_widget_new (SPDocument *doc);

void sp_svg_view_widget_set_resize (SPSVGSPViewWidget *vw, bool resize, gdouble width, gdouble height);

/**
 * An SPSVGSPViewWidget is an SVG view together with a canvas.
 */
struct SPSVGSPViewWidget {
    public:
	SPViewWidget widget;

	GtkWidget *sw;
	GtkWidget *canvas;

	/// Whether to resize automatically
	bool resize;
	gdouble maxwidth, maxheight;

    // C++ Wrappers
    /// Flags the SPSVGSPViewWidget to have its size changed with Gtk.
    void setResize(bool resize, gdouble width, gdouble height) {
	sp_svg_view_widget_set_resize(this, resize, width, height);
    }
};

/// The SPSVGSPViewWidget vtable.
struct SPSVGSPViewWidgetClass {
	SPViewWidgetClass parent_class;
};


#endif