1 #ifndef __SP_CLIPPATH_H__
2 #define __SP_CLIPPATH_H__
4 /*
5 * SVG <clipPath> implementation
6 *
7 * Authors:
8 * Lauris Kaplinski <lauris@kaplinski.com>
9 *
10 * Copyright (C) 2001-2002 authors
11 * Copyright (C) 2001 Ximian, Inc.
12 *
13 * Released under GNU GPL, read the file 'COPYING' for more information
14 */
16 #define SP_TYPE_CLIPPATH (sp_clippath_get_type ())
17 #define SP_CLIPPATH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_CLIPPATH, SPClipPath))
18 #define SP_CLIPPATH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SP_TYPE_CLIPPATH, SPClipPathClass))
19 #define SP_IS_CLIPPATH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SP_TYPE_CLIPPATH))
20 #define SP_IS_CLIPPATH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SP_TYPE_CLIPPATH))
22 class SPClipPathView;
24 #include "display/nr-arena-forward.h"
25 #include "sp-object-group.h"
26 #include "uri-references.h"
27 #include <libnr/nr-forward.h>
29 struct SPClipPath : public SPObjectGroup {
30 class Reference;
32 unsigned int clipPathUnits_set : 1;
33 unsigned int clipPathUnits : 1;
35 SPClipPathView *display;
36 };
38 struct SPClipPathClass {
39 SPObjectGroupClass parent_class;
40 };
42 GType sp_clippath_get_type (void);
44 class SPClipPathReference : public Inkscape::URIReference {
45 public:
46 SPClipPathReference(SPObject *obj) : URIReference(obj) {}
47 SPClipPath *getObject() const {
48 return (SPClipPath *)URIReference::getObject();
49 }
50 protected:
51 virtual bool _acceptObject(SPObject *obj) const {
52 return SP_IS_CLIPPATH(obj);
53 }
54 };
56 NRArenaItem *sp_clippath_show(SPClipPath *cp, NRArena *arena, unsigned int key);
57 void sp_clippath_hide(SPClipPath *cp, unsigned int key);
59 void sp_clippath_set_bbox(SPClipPath *cp, unsigned int key, NRRect *bbox);
60 void sp_clippath_get_bbox(SPClipPath *cp, NRRect *bbox, Geom::Matrix const &transform, unsigned const flags);
62 const gchar *sp_clippath_create (GSList *reprs, SPDocument *document, Geom::Matrix const* applyTransform);
64 #endif