Code

Connector tool: make connectors avoid the convex hull of shapes.
[inkscape.git] / src / sp-mask.h
1 #ifndef __SP_MASK_H__
2 #define __SP_MASK_H__
4 /*
5  * SVG <mask> implementation
6  *
7  * Authors:
8  *   Lauris Kaplinski <lauris@kaplinski.com>
9  *
10  * Copyright (C) 2003 authors
11  *
12  * Released under GNU GPL, read the file 'COPYING' for more information
13  */
15 #define SP_TYPE_MASK (sp_mask_get_type ())
16 #define SP_MASK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_MASK, SPMask))
17 #define SP_MASK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SP_TYPE_MASK, SPMaskClass))
18 #define SP_IS_MASK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SP_TYPE_MASK))
19 #define SP_IS_MASK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SP_TYPE_MASK))
21 class SPMask;
22 class SPMaskClass;
23 class SPMaskView;
25 #include "display/nr-arena-forward.h"
26 #include "libnr/nr-forward.h"
27 #include "sp-object-group.h"
28 #include "uri-references.h"
30 struct SPMask : public SPObjectGroup {
31         unsigned int maskUnits_set : 1;
32         unsigned int maskUnits : 1;
34         unsigned int maskContentUnits_set : 1;
35         unsigned int maskContentUnits : 1;
37         SPMaskView *display;
38 };
40 struct SPMaskClass {
41         SPObjectGroupClass parent_class;
42 };
44 GType sp_mask_get_type (void);
46 class SPMaskReference : public Inkscape::URIReference {
47 public:
48         SPMaskReference(SPObject *obj) : URIReference(obj) {}
49         SPMask *getObject() const {
50                 return (SPMask *)URIReference::getObject();
51         }
52 protected:
53         virtual bool _acceptObject(SPObject *obj) const {
54                 return SP_IS_MASK(obj);
55         }
56 };
58 NRArenaItem *sp_mask_show (SPMask *mask, NRArena *arena, unsigned int key);
59 void sp_mask_hide (SPMask *mask, unsigned int key);
61 void sp_mask_set_bbox (SPMask *mask, unsigned int key, NRRect *bbox);
63 const gchar *sp_mask_create (GSList *reprs, SPDocument *document, Geom::Matrix const* applyTransform);
65 #endif