37 : _context(
parent->_context)
42 parent->items.push_back(*
this);
78 if (
item == ancestor) {
89 std::cerr <<
"CanvasItem::set_z_position: No parent!" << std::endl;
102 std::advance(it, zpos);
111 std::cerr <<
"CanvasItem::raise_to_top: No parent!" << std::endl;
124 std::cerr <<
"CanvasItem::lower_to_bottom: No parent!" << std::endl;
193 if (canvas->get_grabbed_canvas_item()) {
197 canvas->set_grabbed_canvas_item(
this, event_mask);
198 canvas->set_current_canvas_item(
this);
203 if constexpr (
DEBUG_LOGGING) std::cout <<
"CanvasItem::ungrab: " <<
_name << std::endl;
207 if (canvas->get_grabbed_canvas_item() !=
this) {
211 canvas->set_grabbed_canvas_item(
nullptr, {});
222 buf.cr->set_source_rgba(1.0, 0.0, 0.0, 1.0);
270 if (
_fill == fill)
return;
278 defer([fill_pattern = std::move(fill_pattern),
this] ()
mutable {
343 ctrl->set_size_via_index(size_index);
345 for (
auto &
item : group->items) {
346 item.update_canvas_item_ctrl_sizes(size_index);
354 std::cout <<
"Canvas Item Tree" << std::endl;
358 for (
int i = 0; i < level; ++i) {
362 std::cout << zorder <<
": " <<
_name << std::endl;
366 for (
auto &
item : group->items) {
367 item.canvas_item_print_tree(level + 1, i);
constexpr bool DEBUG_LOGGING
A CanvasItem that contains other CanvasItem's.
constexpr bool DEBUG_LOGGING
Abstract base class for on-canvas control items.
constexpr bool DEBUG_BOUNDS
void expandBy(C amount)
Expand the rectangle in both directions by the specified amount.
C height() const
Get the vertical extent of the rectangle.
C width() const
Get the horizontal extent of the rectangle.
CPoint min() const
Get the corner of the rectangle with smallest coordinate values.
virtual void set_visible(bool visible)
void render(Inkscape::CanvasItemBuffer &buf) const
double get_effective_outline() const
Get the effective outline.
Cairo::RefPtr< Cairo::Pattern > _fill_pattern
CanvasItem(CanvasItemContext *context)
std::string const & get_name() const
void set_outline(uint32_t color)
Set the outline color.
virtual void _mark_net_invisible()
void set_outline_width(double width)
Set the outline width.
void set_z_position(int zpos)
void grab(EventMask event_mask, Glib::RefPtr< Gdk::Cursor > const &={})
CanvasItemGroup * _parent
void set_fill_pattern(Cairo::RefPtr< Cairo::Pattern > pattern)
virtual void set_fill(uint32_t rgba)
virtual void set_stroke(uint32_t rgba)
void canvas_item_print_tree(int level=0, int zorder=0) const
bool is_descendant_of(CanvasItem const *ancestor) const
virtual void _render(Inkscape::CanvasItemBuffer &buf) const =0
void set_stroke_width(double width)
Set the stroke width.
virtual void _update(bool propagate)=0
void update(bool propagate)
void update_canvas_item_ctrl_sizes(int size_index)
UI::Widget::Canvas * get_canvas() const
A mask representing a subset of EventTypes.
static char const *const parent
Helper class to stream background task notifications as a series of messages.
Class used when rendering canvas items.