Inkscape
Vector Graphics Editor
|
Minimal wrapper over Cairo. More...
#include <drawing-context.h>
Classes | |
class | Save |
RAII idiom for saving the state of DrawingContext. More... | |
Public Member Functions | |
DrawingContext (cairo_t *ct, Geom::Point const &origin) | |
DrawingContext (cairo_surface_t *surface, Geom::Point const &origin) | |
DrawingContext (DrawingSurface &s) | |
~DrawingContext () | |
void | save () |
void | restore () |
void | pushGroup () |
void | pushAlphaGroup () |
void | popGroupToSource () |
void | transform (Geom::Affine const &trans) |
void | translate (Geom::Point const &t) |
void | translate (double dx, double dy) |
void | scale (Geom::Scale const &s) |
void | scale (double sx, double sy) |
void | device_to_user_distance (double &dx, double &dy) |
void | user_to_device_distance (double &dx, double &dy) |
void | moveTo (Geom::Point const &p) |
void | lineTo (Geom::Point const &p) |
void | curveTo (Geom::Point const &p1, Geom::Point const &p2, Geom::Point const &p3) |
void | arc (Geom::Point const ¢er, double radius, Geom::AngleInterval const &angle) |
void | closePath () |
void | rectangle (Geom::Rect const &r) |
void | rectangle (Geom::IntRect const &r) |
void | revrectangle (Geom::Rect const &r) |
void | revrectangle (Geom::IntRect const &r) |
void | newPath () |
void | newSubpath () |
void | path (Geom::PathVector const &pv) |
void | paint (double alpha=1.0) |
void | fill () |
void | fillPreserve () |
void | stroke () |
void | strokePreserve () |
void | clip () |
void | setLineWidth (double w) |
void | setHairline () |
void | setLineCap (cairo_line_cap_t cap) |
void | setLineJoin (cairo_line_join_t join) |
void | setMiterLimit (double miter) |
void | setFillRule (cairo_fill_rule_t rule) |
void | setOperator (cairo_operator_t op) |
cairo_operator_t | getOperator () |
void | setTolerance (double tol) |
void | setSource (cairo_pattern_t *source) |
void | setSource (cairo_surface_t *surface, double x, double y) |
void | setSource (double r, double g, double b, double a=1.0) |
void | setSource (guint32 rgba) |
void | setSource (DrawingSurface *s) |
void | patternSetFilter (cairo_filter_t filter) |
void | patternSetExtend (cairo_extend_t extend) |
Geom::Rect | targetLogicalBounds () const |
cairo_t * | raw () |
cairo_surface_t * | rawTarget () |
DrawingSurface * | surface () |
Private Member Functions | |
DrawingContext (cairo_t *ct, DrawingSurface *surface, bool destroy) | |
Private Attributes | |
cairo_t * | _ct |
DrawingSurface * | _surface |
bool | _delete_surface |
bool | _restore_context |
Friends | |
class | DrawingSurface |
Minimal wrapper over Cairo.
This is a wrapper over cairo_t, extended with operations that work with 2Geom geometrical primitives. Some of this is probably duplicated in cairo-render-context.cpp, which provides higher level operations for drawing entire SPObjects when exporting.
Definition at line 27 of file drawing-context.h.
Inkscape::DrawingContext::DrawingContext | ( | cairo_t * | ct, |
Geom::Point const & | origin | ||
) |
Definition at line 62 of file drawing-context.cpp.
References _ct, Inkscape::DrawingSurface::_has_context, _surface, origin, Geom::X, and Geom::Y.
Inkscape::DrawingContext::DrawingContext | ( | cairo_surface_t * | surface, |
Geom::Point const & | origin | ||
) |
Definition at line 75 of file drawing-context.cpp.
References _ct, Inkscape::DrawingSurface::_has_context, _surface, and Inkscape::DrawingSurface::createRawContext().
Inkscape::DrawingContext::DrawingContext | ( | DrawingSurface & | s | ) |
Definition at line 85 of file drawing-context.cpp.
Inkscape::DrawingContext::~DrawingContext | ( | ) |
Definition at line 92 of file drawing-context.cpp.
References _ct, _delete_surface, Inkscape::DrawingSurface::_has_context, _restore_context, and _surface.
|
private |
void Inkscape::DrawingContext::arc | ( | Geom::Point const & | center, |
double | radius, | ||
Geom::AngleInterval const & | angle | ||
) |
Definition at line 104 of file drawing-context.cpp.
References _ct.
|
inline |
Definition at line 97 of file drawing-context.h.
References _ct.
Referenced by Inkscape::DrawingImage::_renderItem(), Inkscape::Drawing::render(), and Inkscape::DrawingPattern::renderPattern().
|
inline |
Definition at line 66 of file drawing-context.h.
References _ct.
Referenced by Inkscape::DrawingText::decorateStyle().
|
inline |
Definition at line 62 of file drawing-context.h.
References _ct, cairo_curve_to(), Geom::X, and Geom::Y.
|
inline |
Definition at line 57 of file drawing-context.h.
References _ct.
Referenced by Inkscape::DrawingShape::_renderItem(), Inkscape::DrawingText::_renderItem(), and Inkscape::DrawingShape::_renderStroke().
|
inline |
Definition at line 93 of file drawing-context.h.
References _ct.
Referenced by Inkscape::DrawingShape::_clipItem(), Inkscape::DrawingText::_clipItem(), Inkscape::DrawingCache::_dumpCache(), Inkscape::DrawingText::_renderItem(), Inkscape::DrawingCache::paintFromCache(), and Inkscape::DrawingItem::render().
|
inline |
Definition at line 94 of file drawing-context.h.
References _ct.
Referenced by Inkscape::DrawingShape::_renderFill(), Inkscape::DrawingShape::_renderItem(), and Inkscape::DrawingText::_renderItem().
|
inline |
Definition at line 106 of file drawing-context.h.
References _ct.
|
inline |
Definition at line 61 of file drawing-context.h.
References _ct, cairo_line_to(), Geom::X, and Geom::Y.
Referenced by Inkscape::DrawingImage::_renderItem(), and Inkscape::DrawingText::decorateStyle().
|
inline |
Definition at line 60 of file drawing-context.h.
References _ct, cairo_move_to(), Geom::X, and Geom::Y.
Referenced by Inkscape::DrawingImage::_renderItem(), and Inkscape::DrawingText::decorateStyle().
|
inline |
Definition at line 88 of file drawing-context.h.
References _ct.
Referenced by Inkscape::DrawingShape::_renderFill(), Inkscape::DrawingImage::_renderItem(), Inkscape::DrawingShape::_renderItem(), Inkscape::DrawingText::_renderItem(), and Inkscape::DrawingShape::_renderStroke().
|
inline |
Definition at line 89 of file drawing-context.h.
References _ct.
void Inkscape::DrawingContext::paint | ( | double | alpha = 1.0 | ) |
Definition at line 124 of file drawing-context.cpp.
References _ct.
Referenced by Inkscape::DrawingImage::_renderItem(), Inkscape::DrawingText::_renderItem(), Inkscape::DrawingItem::clip(), Inkscape::DrawingItem::render(), Inkscape::Filters::Filter::render(), render_surface(), Inkscape::DrawingPattern::renderPattern(), sp_export_get_rows(), and sp_generate_internal_bitmap().
void Inkscape::DrawingContext::path | ( | Geom::PathVector const & | pv | ) |
Definition at line 120 of file drawing-context.cpp.
References _ct, and feed_pathvector_to_cairo().
Referenced by Inkscape::DrawingShape::_clipItem(), Inkscape::DrawingText::_clipItem(), Inkscape::DrawingShape::_renderFill(), Inkscape::DrawingShape::_renderItem(), Inkscape::DrawingText::_renderItem(), Inkscape::DrawingShape::_renderStroke(), and Inkscape::Drawing::render().
|
inline |
Definition at line 121 of file drawing-context.h.
References _ct.
Referenced by Inkscape::DrawingImage::_renderItem().
|
inline |
Definition at line 118 of file drawing-context.h.
References _ct.
Referenced by Inkscape::DrawingImage::_renderItem().
|
inline |
Definition at line 50 of file drawing-context.h.
References _ct.
Referenced by Inkscape::DrawingImage::_renderItem(), Inkscape::DrawingItem::clip(), and Inkscape::DrawingItem::render().
|
inline |
Definition at line 49 of file drawing-context.h.
References _ct.
|
inline |
Definition at line 48 of file drawing-context.h.
References _ct.
Referenced by Inkscape::DrawingImage::_renderItem(), Inkscape::DrawingItem::clip(), and Inkscape::DrawingItem::render().
|
inline |
Definition at line 125 of file drawing-context.h.
References _ct.
Referenced by Inkscape::DrawingText::_renderItem(), Inkscape::apply_antialias(), Inkscape::NRStyle::applyStroke(), Inkscape::NRStyle::applyTextDecorationStroke(), and Inkscape::DrawingItem::render().
|
inline |
Definition at line 126 of file drawing-context.h.
References _ct.
Referenced by Inkscape::DrawingImage::_renderItem(), and Inkscape::DrawingItem::render().
|
inline |
Definition at line 70 of file drawing-context.h.
References _ct, cairo_rectangle(), Geom::GenericRect< C >::height(), Geom::GenericRect< C >::left(), Geom::GenericRect< C >::top(), and Geom::GenericRect< C >::width().
|
inline |
Definition at line 67 of file drawing-context.h.
References _ct, cairo_rectangle(), Geom::GenericRect< C >::height(), Geom::GenericRect< C >::left(), Geom::GenericRect< C >::top(), and Geom::GenericRect< C >::width().
Referenced by Inkscape::DrawingCache::_dumpCache(), Inkscape::DrawingImage::_renderItem(), Inkscape::DrawingText::_renderItem(), Inkscape::DrawingText::decorateStyle(), Inkscape::DrawingCache::paintFromCache(), Inkscape::DrawingItem::render(), and Inkscape::DrawingPattern::renderPattern().
|
inline |
Definition at line 47 of file drawing-context.h.
References _ct.
Referenced by Inkscape::DrawingShape::_renderItem(), Inkscape::DrawingShape::_renderStroke(), Inkscape::Drawing::render(), render_surface(), and sp_generate_internal_bitmap().
|
inline |
Definition at line 81 of file drawing-context.h.
References _ct, cairo_move_to(), Geom::GenericRect< C >::height(), Geom::GenericRect< C >::left(), Geom::GenericRect< C >::top(), and Geom::GenericRect< C >::width().
|
inline |
Definition at line 74 of file drawing-context.h.
References _ct, cairo_move_to(), Geom::GenericRect< C >::height(), Geom::GenericRect< C >::left(), Geom::GenericRect< C >::top(), and Geom::GenericRect< C >::width().
|
inline |
Definition at line 46 of file drawing-context.h.
References _ct.
Referenced by Inkscape::DrawingShape::_renderItem(), Inkscape::DrawingShape::_renderStroke(), Inkscape::Drawing::render(), render_surface(), Inkscape::DrawingContext::Save::Save(), Inkscape::DrawingContext::Save::save(), and sp_generate_internal_bitmap().
|
inline |
Definition at line 56 of file drawing-context.h.
References _ct.
|
inline |
Definition at line 55 of file drawing-context.h.
References _ct, Geom::X, and Geom::Y.
Referenced by Inkscape::DrawingImage::_renderItem(), Inkscape::DrawingText::_renderItem(), and Inkscape::Filters::FilterImage::render_cairo().
|
inline |
Definition at line 104 of file drawing-context.h.
References _ct.
Referenced by Inkscape::DrawingShape::_clipItem(), Inkscape::DrawingText::_clipItem(), and Inkscape::NRStyle::applyFill().
void Inkscape::DrawingContext::setHairline | ( | ) |
Definition at line 129 of file drawing-context.cpp.
References _ct, and ink_cairo_set_hairline().
Referenced by Inkscape::DrawingText::_renderItem(), Inkscape::DrawingShape::_renderStroke(), Inkscape::NRStyle::applyStroke(), and Inkscape::NRStyle::applyTextDecorationStroke().
|
inline |
Definition at line 101 of file drawing-context.h.
References _ct.
Referenced by Inkscape::NRStyle::applyStroke(), and Inkscape::NRStyle::applyTextDecorationStroke().
|
inline |
Definition at line 102 of file drawing-context.h.
References _ct, and Inkscape::join().
Referenced by Inkscape::NRStyle::applyStroke(), and Inkscape::NRStyle::applyTextDecorationStroke().
|
inline |
Definition at line 99 of file drawing-context.h.
Referenced by Inkscape::DrawingImage::_renderItem(), Inkscape::DrawingShape::_renderItem(), Inkscape::DrawingText::_renderItem(), Inkscape::NRStyle::applyStroke(), and Inkscape::NRStyle::applyTextDecorationStroke().
|
inline |
Definition at line 103 of file drawing-context.h.
References _ct.
Referenced by Inkscape::NRStyle::applyStroke(), and Inkscape::NRStyle::applyTextDecorationStroke().
|
inline |
Definition at line 105 of file drawing-context.h.
References _ct.
Referenced by Inkscape::DrawingItem::clip(), Inkscape::DrawingItem::render(), Inkscape::Filters::Filter::render(), render_surface(), Inkscape::DrawingPattern::renderPattern(), sp_export_get_rows(), and sp_generate_internal_bitmap().
|
inline |
Definition at line 108 of file drawing-context.h.
References _ct.
Referenced by Inkscape::DrawingCache::_dumpCache(), Inkscape::DrawingImage::_renderItem(), Inkscape::DrawingShape::_renderItem(), Inkscape::DrawingText::_renderItem(), Inkscape::NRStyle::applyFill(), Inkscape::NRStyle::applyStroke(), Inkscape::NRStyle::applyTextDecorationFill(), Inkscape::NRStyle::applyTextDecorationStroke(), Inkscape::DrawingItem::clip(), Inkscape::DrawingCache::paintFromCache(), Inkscape::DrawingItem::render(), Inkscape::Filters::Filter::render(), render_surface(), Inkscape::DrawingPattern::renderPattern(), sp_export_get_rows(), and sp_generate_internal_bitmap().
|
inline |
Definition at line 109 of file drawing-context.h.
|
inline |
Definition at line 112 of file drawing-context.h.
References _ct, and cairo_set_source_rgba().
void Inkscape::DrawingContext::setSource | ( | DrawingSurface * | s | ) |
Definition at line 136 of file drawing-context.cpp.
References _ct, origin, Inkscape::DrawingSurface::origin(), and Inkscape::DrawingSurface::raw().
void Inkscape::DrawingContext::setSource | ( | guint32 | rgba | ) |
Definition at line 133 of file drawing-context.cpp.
References _ct, and ink_cairo_set_source_rgba32().
|
inline |
Definition at line 107 of file drawing-context.h.
References _ct.
Referenced by Inkscape::DrawingShape::_renderItem(), Inkscape::DrawingText::_renderItem(), and Inkscape::DrawingText::decorateItem().
|
inline |
Definition at line 95 of file drawing-context.h.
References _ct.
Referenced by Inkscape::DrawingImage::_renderItem(), Inkscape::DrawingShape::_renderItem(), and Inkscape::DrawingText::_renderItem().
|
inline |
Definition at line 96 of file drawing-context.h.
References _ct.
Referenced by Inkscape::DrawingShape::_renderItem(), Inkscape::DrawingText::_renderItem(), and Inkscape::DrawingShape::_renderStroke().
|
inline |
Definition at line 128 of file drawing-context.h.
References _surface.
Referenced by Inkscape::DrawingItem::render(), and setSource().
Geom::Rect Inkscape::DrawingContext::targetLogicalBounds | ( | ) | const |
Definition at line 141 of file drawing-context.cpp.
References _surface, and Inkscape::DrawingSurface::area().
Referenced by Inkscape::Filters::FilterSlot::FilterSlot(), and Inkscape::Filters::Filter::render().
void Inkscape::DrawingContext::transform | ( | Geom::Affine const & | trans | ) |
Definition at line 116 of file drawing-context.cpp.
References _ct, and ink_cairo_transform().
Referenced by Inkscape::DrawingShape::_clipItem(), Inkscape::DrawingText::_clipItem(), Inkscape::DrawingShape::_renderFill(), Inkscape::DrawingImage::_renderItem(), Inkscape::DrawingShape::_renderItem(), Inkscape::DrawingText::_renderItem(), Inkscape::DrawingShape::_renderStroke(), Inkscape::Filters::FilterImage::render_cairo(), render_surface(), Inkscape::DrawingPattern::renderPattern(), and sp_generate_internal_bitmap().
|
inline |
Definition at line 54 of file drawing-context.h.
References _ct.
|
inline |
Definition at line 53 of file drawing-context.h.
References _ct, Geom::X, and Geom::Y.
Referenced by Inkscape::DrawingImage::_renderItem(), Inkscape::DrawingText::_renderItem(), Inkscape::Filters::FilterImage::render_cairo(), and Inkscape::DrawingPattern::renderPattern().
|
inline |
Definition at line 58 of file drawing-context.h.
References _ct.
|
friend |
Definition at line 138 of file drawing-context.h.
|
private |
Definition at line 133 of file drawing-context.h.
Referenced by arc(), clip(), closePath(), curveTo(), device_to_user_distance(), DrawingContext(), DrawingContext(), fill(), fillPreserve(), getOperator(), lineTo(), moveTo(), newPath(), newSubpath(), paint(), path(), patternSetExtend(), patternSetFilter(), popGroupToSource(), pushAlphaGroup(), pushGroup(), raw(), rawTarget(), rectangle(), rectangle(), restore(), revrectangle(), revrectangle(), save(), scale(), scale(), setFillRule(), setHairline(), setLineCap(), setLineJoin(), setLineWidth(), setMiterLimit(), setOperator(), setSource(), setSource(), setSource(), setSource(), setSource(), setTolerance(), stroke(), strokePreserve(), transform(), translate(), translate(), user_to_device_distance(), and ~DrawingContext().
|
private |
Definition at line 135 of file drawing-context.h.
Referenced by ~DrawingContext().
|
private |
Definition at line 136 of file drawing-context.h.
Referenced by ~DrawingContext().
|
private |
Definition at line 134 of file drawing-context.h.
Referenced by DrawingContext(), DrawingContext(), surface(), targetLogicalBounds(), and ~DrawingContext().