summaryrefslogtreecommitdiffstats
path: root/src/ui/tool/shape-record.h
blob: 1f29453398ab2ab5dd796c48036b1a9e8e889185 (plain)
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
63
64
65
// SPDX-License-Identifier: GPL-2.0-or-later
/** @file
 * Structures that store data needed for shape editing which are not contained
 * directly in the XML node
 */
/* Authors:
 *   Krzysztof Kosiński <tweenk.pl@gmail.com>
 *
 * Copyright (C) 2009 Authors
 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
 */

#ifndef SEEN_UI_TOOL_SHAPE_RECORD_H
#define SEEN_UI_TOOL_SHAPE_RECORD_H

#include <glibmm/ustring.h>
#include <boost/operators.hpp>
#include <2geom/affine.h>

class SPItem;
class SPObject;
namespace Inkscape {
namespace UI {

/** Role of the shape in the drawing - affects outline display and color */
enum ShapeRole {
    SHAPE_ROLE_NORMAL,
    SHAPE_ROLE_CLIPPING_PATH,
    SHAPE_ROLE_MASK,
    SHAPE_ROLE_LPE_PARAM // implies edit_original set to true in ShapeRecord
};

struct ShapeRecord :
    public boost::totally_ordered<ShapeRecord>
{
    SPObject *object; // SP node for the edited shape could be a lpeoject invisible so we use a spobject
    ShapeRole role;
    Glib::ustring lpe_key; // name of LPE shape param being edited

    Geom::Affine edit_transform; // how to transform controls - used for clipping paths, masks, and markers
    double edit_rotation; // how to transform controls - used for markers

    inline bool operator==(ShapeRecord const &o) const {
        return object == o.object && lpe_key == o.lpe_key;
    }
    inline bool operator<(ShapeRecord const &o) const {
        return object == o.object ? (lpe_key < o.lpe_key) : (object < o.object);
    }
};

} // namespace UI
} // namespace Inkscape

#endif

/*
  Local Variables:
  mode:c++
  c-file-style:"stroustrup"
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
  indent-tabs-mode:nil
  fill-column:99
  End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :