Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
canvas-item-context.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
6#ifndef SEEN_CANVAS_ITEM_CONTEXT_H
7#define SEEN_CANVAS_ITEM_CONTEXT_H
8
9#include <2geom/affine.h>
10#include <sigc++/scoped_connection.h>
11#include "util/funclog.h"
12
13namespace Inkscape {
14
15namespace UI::Widget { class Canvas; }
16namespace Handles { class Css; }
17
18class CanvasItemGroup;
19
21{
22public:
27
28 // Structure
29 UI::Widget::Canvas *canvas() const { return _canvas; }
30 CanvasItemGroup *root() const { return _root; }
31
32 // Geometry
33 Geom::Affine const &affine() const { return _affine; }
35
36 // Control handle styling
37 std::shared_ptr<Handles::Css const> const &handlesCss() const { return _handles_css; }
38
39 // Snapshotting
40 void snapshot();
41 void unsnapshot();
42 bool snapshotted() const { return _snapshotted; }
43
44 template<typename F>
45 void defer(F &&f) { _snapshotted ? _funclog.emplace(std::forward<F>(f)) : f(); }
46
47private:
48 // Structure
51
52 // Geometry
54
55 // Control handle styling
56 std::shared_ptr<Handles::Css const> _handles_css;
57 sigc::scoped_connection _css_updated_conn;
58
59 // Snapshotting
61
62 bool _snapshotted = false;
64};
65
66} // namespace Inkscape
67
68#endif // SEEN_CANVAS_ITEM_CONTEXT_H
69
70/*
71 Local Variables:
72 mode:c++
73 c-file-style:"stroustrup"
74 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
75 indent-tabs-mode:nil
76 fill-column:99
77 End:
78*/
79// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
3x3 affine transformation matrix.
3x3 matrix representing an affine transformation.
Definition affine.h:70
CanvasItemGroup * root() const
sigc::scoped_connection _css_updated_conn
CanvasItemContext(CanvasItemContext const &)=delete
std::shared_ptr< Handles::Css const > const & handlesCss() const
void setAffine(Geom::Affine const &affine)
CanvasItemContext & operator=(CanvasItemContext const &)=delete
std::shared_ptr< Handles::Css const > _handles_css
Geom::Affine const & affine() const
UI::Widget::Canvas * canvas() const
A widget for Inkscape's canvas.
Definition canvas.h:62
A FuncLog is effectively a std::vector<std::function<void()>>, with the ability to hold move-only fun...
Definition funclog.h:24
void emplace(F &&f)
Append a callable object to the log.
Definition funclog.h:36
Helper class to stream background task notifications as a series of messages.
The result of parsing the handle styling CSS files, containing all information needed to style a give...