Code

Cleanup of SP_ACTIVE_DESKTOP to prepare clipboard code for reuse.
[inkscape.git] / src / ui / tool / shape-record.h
1 /** @file
2  * Structures that store data needed for shape editing which are not contained
3  * directly in the XML node
4  */
5 /* Authors:
6  *   Krzysztof KosiƄski <tweenk.pl@gmail.com>
7  *
8  * Copyright (C) 2009 Authors
9  * Released under GNU GPL, read the file 'COPYING' for more information
10  */
12 #ifndef SEEN_UI_TOOL_SHAPE_RECORD_H
13 #define SEEN_UI_TOOL_SHAPE_RECORD_H
15 #include <glibmm/ustring.h>
16 #include <boost/operators.hpp>
17 #include <2geom/matrix.h>
19 class SPItem;
20 namespace Inkscape {
21 namespace UI {
23 /** Role of the shape in the drawing - affects outline display and color */
24 enum ShapeRole {
25     SHAPE_ROLE_NORMAL,
26     SHAPE_ROLE_CLIPPING_PATH,
27     SHAPE_ROLE_MASK,
28     SHAPE_ROLE_LPE_PARAM // implies edit_original set to true in ShapeRecord
29 };
31 struct ShapeRecord :
32     public boost::totally_ordered<ShapeRecord>
33 {
34     SPItem *item; // SP node for the edited shape
35     Geom::Matrix edit_transform; // how to transform controls - used for clipping paths and masks
36     ShapeRole role;
37     Glib::ustring lpe_key; // name of LPE shape param being edited
39     inline bool operator==(ShapeRecord const &o) const {
40         return item == o.item && lpe_key == o.lpe_key;
41     }
42     inline bool operator<(ShapeRecord const &o) const {
43         return item == o.item ? (lpe_key < o.lpe_key) : (item < o.item);
44     }
45 };
47 } // namespace UI
48 } // namespace Inkscape
50 #endif
52 /*
53   Local Variables:
54   mode:c++
55   c-file-style:"stroustrup"
56   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
57   indent-tabs-mode:nil
58   fill-column:99
59   End:
60 */
61 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :