Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Inkscape::CanvasItemDrawing Class Referencefinal

#include <canvas-item-drawing.h>

Inheritance diagram for Inkscape::CanvasItemDrawing:
Inkscape::CanvasItem

Public Member Functions

 CanvasItemDrawing (CanvasItemGroup *group)
 Create the drawing.
 
bool contains (Geom::Point const &p, double tolerance=0) override
 Returns true if point p (in canvas units) is inside some object in drawing.
 
Inkscape::Drawingget_drawing ()
 
void set_active (Inkscape::DrawingItem *active)
 
Inkscape::DrawingItemget_active ()
 
bool handle_event (CanvasEvent const &event) override
 Handle events directed at the drawing.
 
void set_sticky (bool sticky)
 
void set_pick_outline (bool pick_outline)
 
sigc::connection connect_drawing_event (sigc::slot< bool(CanvasEvent const &, Inkscape::DrawingItem *)> slot)
 
- Public Member Functions inherited from Inkscape::CanvasItem
 CanvasItem (CanvasItemContext *context)
 
 CanvasItem (CanvasItemGroup *parent)
 
 CanvasItem (CanvasItem const &)=delete
 
CanvasItemoperator= (CanvasItem const &)=delete
 
void unlink ()
 
UI::Widget::Canvasget_canvas () const
 
CanvasItemGroupget_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)
 
virtual void visit_page_rects (std::function< void(Geom::Rect const &)> const &) const
 
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 ()
 
virtual void set_fill (uint32_t rgba)
 
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)
 
void canvas_item_print_tree (int level=0, int zorder=0) const
 

Protected Member Functions

 ~CanvasItemDrawing () override=default
 
void _update (bool propagate) override
 Update and redraw drawing.
 
void _render (Inkscape::CanvasItemBuffer &buf) const override
 Render drawing to screen via Cairo.
 
- Protected Member Functions inherited from Inkscape::CanvasItem
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::Point _c
 
double _delta = Geom::infinity()
 
Inkscape::DrawingItem_active_item = nullptr
 
Inkscape::DrawingItem_picked_item = nullptr
 
std::unique_ptr< Inkscape::Drawing_drawing
 
Geom::Affine _drawing_affine
 
bool _cursor = false
 
bool _sticky = false
 
bool _pick_outline = false
 
sigc::signal< bool(CanvasEvent const &, Inkscape::DrawingItem *)> _drawing_event_signal
 
- Protected Attributes inherited from Inkscape::CanvasItem
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

- Public Attributes inherited from Inkscape::CanvasItem
boost::intrusive::list_member_hook member_hook
 

Detailed Description

Definition at line 30 of file canvas-item-drawing.h.

Constructor & Destructor Documentation

◆ CanvasItemDrawing()

Inkscape::CanvasItemDrawing::CanvasItemDrawing ( CanvasItemGroup group)

Create the drawing.

One per window!

Definition at line 36 of file canvas-item-drawing.cpp.

References _drawing, Inkscape::CanvasItem::_name, Inkscape::CanvasItem::_pickable, and root.

◆ ~CanvasItemDrawing()

Inkscape::CanvasItemDrawing::~CanvasItemDrawing ( )
overrideprotecteddefault

Member Function Documentation

◆ _render()

void Inkscape::CanvasItemDrawing::_render ( Inkscape::CanvasItemBuffer buf) const
overrideprotectedvirtual

Render drawing to screen via Cairo.

Implements Inkscape::CanvasItem.

Definition at line 113 of file canvas-item-drawing.cpp.

References _drawing, buf, and Inkscape::DrawingItem::RENDER_OUTLINE.

◆ _update()

◆ connect_drawing_event()

sigc::connection Inkscape::CanvasItemDrawing::connect_drawing_event ( sigc::slot< bool(CanvasEvent const &, Inkscape::DrawingItem *)>  slot)
inline

◆ contains()

bool Inkscape::CanvasItemDrawing::contains ( Geom::Point const &  p,
double  tolerance = 0 
)
overridevirtual

Returns true if point p (in canvas units) is inside some object in drawing.

Reimplemented from Inkscape::CanvasItem.

Definition at line 51 of file canvas-item-drawing.cpp.

References _drawing, _pick_outline, _picked_item, _sticky, Inkscape::DrawingItem::pick(), Inkscape::DrawingItem::PICK_OUTLINE, and Inkscape::DrawingItem::PICK_STICKY.

◆ get_active()

Inkscape::DrawingItem * Inkscape::CanvasItemDrawing::get_active ( )
inline

Definition at line 43 of file canvas-item-drawing.h.

References _active_item.

◆ get_drawing()

◆ handle_event()

◆ set_active()

void Inkscape::CanvasItemDrawing::set_active ( Inkscape::DrawingItem active)
inline

Definition at line 42 of file canvas-item-drawing.h.

References _active_item.

◆ set_pick_outline()

void Inkscape::CanvasItemDrawing::set_pick_outline ( bool  pick_outline)
inline

Definition at line 48 of file canvas-item-drawing.h.

References _pick_outline.

◆ set_sticky()

void Inkscape::CanvasItemDrawing::set_sticky ( bool  sticky)
inline

Definition at line 47 of file canvas-item-drawing.h.

References _sticky.

Referenced by Inkscape::UI::Widget::Canvas::on_button_pressed().

Member Data Documentation

◆ _active_item

Inkscape::DrawingItem* Inkscape::CanvasItemDrawing::_active_item = nullptr
protected

Definition at line 64 of file canvas-item-drawing.h.

Referenced by _update(), get_active(), handle_event(), and set_active().

◆ _c

Geom::Point Inkscape::CanvasItemDrawing::_c
protected

Definition at line 62 of file canvas-item-drawing.h.

Referenced by _update(), and handle_event().

◆ _cursor

bool Inkscape::CanvasItemDrawing::_cursor = false
protected

Definition at line 72 of file canvas-item-drawing.h.

Referenced by _update(), and handle_event().

◆ _delta

double Inkscape::CanvasItemDrawing::_delta = Geom::infinity()
protected

Definition at line 63 of file canvas-item-drawing.h.

Referenced by _update().

◆ _drawing

std::unique_ptr<Inkscape::Drawing> Inkscape::CanvasItemDrawing::_drawing
protected

◆ _drawing_affine

Geom::Affine Inkscape::CanvasItemDrawing::_drawing_affine
protected

Definition at line 69 of file canvas-item-drawing.h.

Referenced by _update().

◆ _drawing_event_signal

sigc::signal<bool(CanvasEvent const &, Inkscape::DrawingItem *)> Inkscape::CanvasItemDrawing::_drawing_event_signal
protected

Definition at line 77 of file canvas-item-drawing.h.

Referenced by _update(), connect_drawing_event(), and handle_event().

◆ _pick_outline

bool Inkscape::CanvasItemDrawing::_pick_outline = false
protected

Definition at line 74 of file canvas-item-drawing.h.

Referenced by _update(), contains(), handle_event(), and set_pick_outline().

◆ _picked_item

Inkscape::DrawingItem* Inkscape::CanvasItemDrawing::_picked_item = nullptr
protected

Definition at line 65 of file canvas-item-drawing.h.

Referenced by contains().

◆ _sticky

bool Inkscape::CanvasItemDrawing::_sticky = false
protected

Definition at line 73 of file canvas-item-drawing.h.

Referenced by _update(), contains(), handle_event(), and set_sticky().


The documentation for this class was generated from the following files: