1 #ifndef __SP_USE_H__
2 #define __SP_USE_H__
4 /*
5 * SVG <use> implementation
6 *
7 * Authors:
8 * Lauris Kaplinski <lauris@kaplinski.com>
9 *
10 * Copyright (C) 1999-2002 Lauris Kaplinski
11 * Copyright (C) 2000-2001 Ximian, Inc.
12 *
13 * Released under GNU GPL, read the file 'COPYING' for more information
14 */
16 #include <sigc++/sigc++.h>
17 #include "svg/svg-length.h"
18 #include "sp-item.h"
21 #define SP_TYPE_USE (sp_use_get_type ())
22 #define SP_USE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_USE, SPUse))
23 #define SP_USE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SP_TYPE_USE, SPUseClass))
24 #define SP_IS_USE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SP_TYPE_USE))
25 #define SP_IS_USE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SP_TYPE_USE))
27 class SPUse;
28 class SPUseClass;
29 class SPUseReference;
31 struct SPUse : public SPItem {
32 // item built from the original's repr (the visible clone)
33 // relative to the SPUse itself, it is treated as a child, similar to a grouped item relative to its group
34 SPObject *child;
36 // SVG attrs
37 SVGLength x;
38 SVGLength y;
39 SVGLength width;
40 SVGLength height;
41 gchar *href;
43 // the reference to the original object
44 SPUseReference *ref;
46 // a sigc connection for delete notifications
47 sigc::connection _delete_connection;
48 sigc::connection _changed_connection;
50 // a sigc connection for transformed signal, used to do move compensation
51 sigc::connection _transformed_connection;
52 };
54 struct SPUseClass {
55 SPItemClass parent_class;
56 };
58 GType sp_use_get_type (void);
60 SPItem *sp_use_unlink (SPUse *use);
61 SPItem *sp_use_get_original (SPUse *use);
62 Geom::Matrix sp_use_get_parent_transform (SPUse *use);
63 Geom::Matrix sp_use_get_root_transform(SPUse *use);
65 SPItem *sp_use_root(SPUse *use);
66 #endif