Inkscape
Vector Graphics Editor
|
#include <canvas-item-rect.h>
Public Member Functions | |
CanvasItemRect (CanvasItemGroup *group) | |
Create an null control rect. | |
CanvasItemRect (CanvasItemGroup *group, Geom::Rect const &rect) | |
Create a control rect. | |
void | set_rect (Geom::Rect const &rect) |
Set a control rect. | |
void | visit_page_rects (std::function< void(Geom::Rect const &)> const &) const override |
Run a callback for each rectangle that should be filled and painted in the background. | |
bool | contains (Geom::Point const &p, double tolerance=0) override |
Returns true if point p (in canvas units) is within tolerance (canvas units) distance of rect. | |
void | set_is_page (bool is_page) |
void | set_fill (uint32_t color) override |
void | set_dashed (bool dash=true) |
void | set_inverted (bool inverted=false) |
void | set_shadow (uint32_t color, int width) |
![]() | |
CanvasItem (CanvasItemContext *context) | |
CanvasItem (CanvasItemGroup *parent) | |
CanvasItem (CanvasItem const &)=delete | |
CanvasItem & | operator= (CanvasItem const &)=delete |
void | unlink () |
UI::Widget::Canvas * | get_canvas () const |
CanvasItemGroup * | get_parent () const |
bool | is_descendant_of (CanvasItem const *ancestor) const |
void | set_z_position (int zpos) |
void | raise_to_top () |
void | lower_to_bottom () |
void | request_update () |
void | update (bool propagate) |
Geom::OptRect const & | get_bounds () const |
void | grab (EventMask event_mask, Glib::RefPtr< Gdk::Cursor > const &={}) |
void | ungrab () |
void | render (Inkscape::CanvasItemBuffer &buf) const |
bool | is_visible () const |
virtual void | set_visible (bool visible) |
void | request_redraw () |
void | set_fill (CanvasItemColor color) |
void | set_fill_pattern (Cairo::RefPtr< Cairo::Pattern > pattern) |
virtual void | set_stroke (uint32_t rgba) |
void | set_stroke (CanvasItemColor color) |
void | set_stroke_width (double width) |
Set the stroke width. | |
void | set_outline (uint32_t color) |
Set the outline color. | |
void | set_outline_width (double width) |
Set the outline width. | |
double | get_effective_outline () const |
Get the effective outline. | |
void | set_name (std::string &&name) |
std::string const & | get_name () const |
void | update_canvas_item_ctrl_sizes (int size_index) |
void | set_pickable (bool pickable) |
bool | is_pickable () const |
sigc::connection | connect_event (sigc::slot< bool(CanvasEvent const &)> const &slot) |
virtual bool | handle_event (CanvasEvent const &event) |
void | canvas_item_print_tree (int level=0, int zorder=0) const |
Protected Member Functions | |
~CanvasItemRect () override=default | |
void | _update (bool propagate) override |
Update and redraw control rect. | |
void | _render (Inkscape::CanvasItemBuffer &buf) const override |
Render rect to screen via Cairo. | |
double | get_shadow_size () const |
![]() | |
virtual | ~CanvasItem () |
Geom::Affine const & | affine () const |
virtual void | _mark_net_invisible () |
virtual void | _invalidate_ctrl_handles () |
template<typename F > | |
void | defer (F &&f) |
Protected Attributes | |
Geom::Rect | _rect |
bool | _is_page = false |
bool | _dashed = false |
bool | _inverted = false |
int | _shadow_width = 0 |
uint32_t | _shadow_color = 0x0 |
![]() | |
CanvasItemContext * | _context |
CanvasItemGroup * | _parent |
Geom::OptRect | _bounds |
bool | _need_update = false |
bool | _visible = true |
bool | _net_visible = true |
bool | _pickable = false |
uint32_t | _fill = CANVAS_ITEM_COLORS[CANVAS_ITEM_SECONDARY] |
Cairo::RefPtr< Cairo::Pattern > | _fill_pattern |
uint32_t | _stroke = CANVAS_ITEM_COLORS[CANVAS_ITEM_PRIMARY] |
double | _stroke_width = 1.0 |
uint32_t | _outline = 0x0 |
double | _outline_width = 0 |
std::string | _name |
sigc::signal< bool(CanvasEvent const &)> | _event_signal |
Additional Inherited Members | |
![]() | |
boost::intrusive::list_member_hook | member_hook |
Definition at line 28 of file canvas-item-rect.h.
Inkscape::CanvasItemRect::CanvasItemRect | ( | CanvasItemGroup * | group | ) |
Create an null control rect.
Definition at line 33 of file canvas-item-rect.cpp.
References Inkscape::CanvasItem::_fill, and Inkscape::CanvasItem::_name.
Inkscape::CanvasItemRect::CanvasItemRect | ( | CanvasItemGroup * | group, |
Geom::Rect const & | rect | ||
) |
Create a control rect.
Point are in document coordinates.
Definition at line 43 of file canvas-item-rect.cpp.
References Inkscape::CanvasItem::_fill, and Inkscape::CanvasItem::_name.
|
overrideprotecteddefault |
|
overrideprotectedvirtual |
Render rect to screen via Cairo.
Implements Inkscape::CanvasItem.
Definition at line 113 of file canvas-item-rect.cpp.
References _dashed, Inkscape::CanvasItem::_fill, Inkscape::CanvasItem::_fill_pattern, _inverted, _is_page, Inkscape::CanvasItem::_outline, Inkscape::CanvasItem::_outline_width, _rect, _shadow_color, _shadow_width, Inkscape::CanvasItem::_stroke, Inkscape::CanvasItem::_stroke_width, Inkscape::CanvasItem::affine(), Geom::are_near(), buf, desktop, SPDesktop::doc2dt(), floor(), geom_to_cairo(), Inkscape::CanvasItem::get_canvas(), Inkscape::CanvasItem::get_effective_outline(), get_shadow_size(), Geom::identity(), ink_cairo_draw_drop_shadow(), ink_cairo_set_source_rgba32(), shift(), SP_RGBA32_A_F(), and SP_RGBA32_A_U().
|
overrideprotectedvirtual |
Update and redraw control rect.
Implements Inkscape::CanvasItem.
Definition at line 89 of file canvas-item-rect.cpp.
References Inkscape::CanvasItem::_bounds, _dashed, _rect, _shadow_width, Inkscape::CanvasItem::affine(), Inkscape::CanvasItem::get_effective_outline(), get_shadow_size(), and Inkscape::CanvasItem::request_redraw().
|
overridevirtual |
Returns true if point p (in canvas units) is within tolerance (canvas units) distance of rect.
Non-zero tolerance not implemented! Is valid for a rotated canvas.
Reimplemented from Inkscape::CanvasItem.
Definition at line 77 of file canvas-item-rect.cpp.
References _rect, Inkscape::CanvasItem::affine(), and Geom::GenericRect< C >::contains().
|
protected |
Definition at line 264 of file canvas-item-rect.cpp.
References _shadow_width, Inkscape::CanvasItem::affine(), Geom::Affine::descrim(), scale, and Inkscape::size.
void Inkscape::CanvasItemRect::set_dashed | ( | bool | dash = true | ) |
Definition at line 235 of file canvas-item-rect.cpp.
References _dashed, Inkscape::CanvasItem::defer(), and Inkscape::CanvasItem::request_redraw().
Referenced by Inkscape::UI::TransformHandleSet::TransformHandleSet().
|
overridevirtual |
Reimplemented from Inkscape::CanvasItem.
Definition at line 224 of file canvas-item-rect.cpp.
References Inkscape::CanvasItem::_fill, _is_page, Inkscape::CanvasItem::defer(), Inkscape::CanvasItem::get_canvas(), Inkscape::CanvasItem::request_redraw(), and Inkscape::UI::Widget::Canvas::set_page().
void Inkscape::CanvasItemRect::set_inverted | ( | bool | inverted = false | ) |
Definition at line 244 of file canvas-item-rect.cpp.
References _inverted, Inkscape::CanvasItem::defer(), and Inkscape::CanvasItem::request_redraw().
void Inkscape::CanvasItemRect::set_is_page | ( | bool | is_page | ) |
Definition at line 215 of file canvas-item-rect.cpp.
References _is_page, Inkscape::CanvasItem::defer(), and Inkscape::CanvasItem::request_redraw().
void Inkscape::CanvasItemRect::set_rect | ( | Geom::Rect const & | rect | ) |
Set a control rect.
Points are in document coordinates.
Definition at line 54 of file canvas-item-rect.cpp.
References _rect, Inkscape::CanvasItem::defer(), and Inkscape::CanvasItem::request_update().
Referenced by Inkscape::UI::TransformHandleSet::setBounds().
void Inkscape::CanvasItemRect::set_shadow | ( | uint32_t | color, |
int | width | ||
) |
Definition at line 253 of file canvas-item-rect.cpp.
References _is_page, _shadow_color, _shadow_width, Inkscape::CanvasItem::defer(), Inkscape::CanvasItem::get_canvas(), Inkscape::CanvasItem::request_redraw(), Inkscape::UI::Widget::Canvas::set_border(), and width.
|
overridevirtual |
Run a callback for each rectangle that should be filled and painted in the background.
Reimplemented from Inkscape::CanvasItem.
Definition at line 66 of file canvas-item-rect.cpp.
References Inkscape::CanvasItem::_fill, _is_page, and _rect.
|
protected |
Definition at line 58 of file canvas-item-rect.h.
Referenced by _render(), _update(), and set_dashed().
|
protected |
Definition at line 59 of file canvas-item-rect.h.
Referenced by _render(), and set_inverted().
|
protected |
Definition at line 57 of file canvas-item-rect.h.
Referenced by _render(), set_fill(), set_is_page(), set_shadow(), and visit_page_rects().
|
protected |
Definition at line 56 of file canvas-item-rect.h.
Referenced by _render(), _update(), contains(), set_rect(), and visit_page_rects().
|
protected |
Definition at line 61 of file canvas-item-rect.h.
Referenced by _render(), and set_shadow().
|
protected |
Definition at line 60 of file canvas-item-rect.h.
Referenced by _render(), _update(), get_shadow_size(), and set_shadow().