diff options
| author | Tomasz Boczkowski <penginsbacon@gmail.com> | 2015-05-03 10:37:06 +0000 |
|---|---|---|
| committer | Tomasz Boczkowski <penginsbacon@gmail.com> | 2015-05-03 10:37:06 +0000 |
| commit | 705243e1266aec7527ae76065213ca7536ed7c41 (patch) | |
| tree | c4b029fd281bfc4ec433d2d56d77502e16fa1f28 /src | |
| parent | Reformatted SPPattern (diff) | |
| download | inkscape-705243e1266aec7527ae76065213ca7536ed7c41.tar.gz inkscape-705243e1266aec7527ae76065213ca7536ed7c41.zip | |
renamed SPPattern methods to match coding style
(bzr r14059.1.20)
Diffstat (limited to 'src')
| -rw-r--r-- | src/desktop-style.cpp | 4 | ||||
| -rw-r--r-- | src/extension/internal/cairo-render-context.cpp | 16 | ||||
| -rw-r--r-- | src/extension/internal/emf-print.cpp | 8 | ||||
| -rw-r--r-- | src/extension/internal/wmf-print.cpp | 4 | ||||
| -rw-r--r-- | src/knot-holder-entity.cpp | 18 | ||||
| -rw-r--r-- | src/selection-chemistry.cpp | 8 | ||||
| -rw-r--r-- | src/sp-pattern.cpp | 162 | ||||
| -rw-r--r-- | src/sp-pattern.h | 50 | ||||
| -rw-r--r-- | src/widgets/fill-style.cpp | 4 | ||||
| -rw-r--r-- | src/widgets/paint-selector.cpp | 4 |
10 files changed, 139 insertions, 139 deletions
diff --git a/src/desktop-style.cpp b/src/desktop-style.cpp index 275165c9c..fb92ffaf5 100644 --- a/src/desktop-style.cpp +++ b/src/desktop-style.cpp @@ -576,8 +576,8 @@ objects_query_fillstroke (const std::vector<SPItem*> &objects, SPStyle *style_re return QUERY_STYLE_MULTIPLE_DIFFERENT; // different kind of server } - SPPattern *pat = SP_PATTERN (server)->get_root(); - SPPattern *pat_res = SP_PATTERN (server_res)->get_root(); + SPPattern *pat = SP_PATTERN (server)->rootPattern(); + SPPattern *pat_res = SP_PATTERN (server_res)->rootPattern(); if (pat_res != pat) { return QUERY_STYLE_MULTIPLE_DIFFERENT; // different pattern roots } diff --git a/src/extension/internal/cairo-render-context.cpp b/src/extension/internal/cairo-render-context.cpp index abfdd9f1c..b5859c283 100644 --- a/src/extension/internal/cairo-render-context.cpp +++ b/src/extension/internal/cairo-render-context.cpp @@ -1008,16 +1008,16 @@ CairoRenderContext::_createPatternPainter(SPPaintServer const *const paintserver ps2user = Geom::identity(); pcs2dev = Geom::identity(); - double x = pat->get_x(); - double y = pat->get_y(); - double width = pat->get_width(); - double height = pat->get_height(); + double x = pat->x(); + double y = pat->y(); + double width = pat->width(); + double height = pat->height(); double bbox_width_scaler; double bbox_height_scaler; TRACE(("%f x %f pattern\n", width, height)); - if (pbox && pat->get_pattern_units() == SPPattern::UNITS_OBJECTBOUNDINGBOX) { + if (pbox && pat->patternUnits() == SPPattern::UNITS_OBJECTBOUNDINGBOX) { bbox_width_scaler = pbox->width(); bbox_height_scaler = pbox->height(); ps2user[4] = x * bbox_width_scaler + pbox->left(); @@ -1030,13 +1030,13 @@ CairoRenderContext::_createPatternPainter(SPPaintServer const *const paintserver } // apply pattern transformation - Geom::Affine pattern_transform(pat->get_transform()); + Geom::Affine pattern_transform(pat->getTransform()); ps2user *= pattern_transform; Geom::Point ori (ps2user[4], ps2user[5]); // create pattern contents coordinate system if (pat->viewBox_set) { - Geom::Rect view_box = *pat->get_viewbox(); + Geom::Rect view_box = *pat->viewbox(); double x, y, w, h; x = 0; @@ -1049,7 +1049,7 @@ CairoRenderContext::_createPatternPainter(SPPaintServer const *const paintserver pcs2dev[3] = h / view_box.height(); pcs2dev[4] = x - view_box.left() * pcs2dev[0]; pcs2dev[5] = y - view_box.top() * pcs2dev[3]; - } else if (pbox && pat->get_pattern_content_units() == SPPattern::UNITS_OBJECTBOUNDINGBOX) { + } else if (pbox && pat->patternContentUnits() == SPPattern::UNITS_OBJECTBOUNDINGBOX) { pcs2dev[0] = pbox->width(); pcs2dev[3] = pbox->height(); } diff --git a/src/extension/internal/emf-print.cpp b/src/extension/internal/emf-print.cpp index 48591fab2..40d0955e3 100644 --- a/src/extension/internal/emf-print.cpp +++ b/src/extension/internal/emf-print.cpp @@ -388,8 +388,8 @@ int PrintEmf::create_brush(SPStyle const *style, PU_COLORREF fcolor) } else if (SP_IS_PATTERN(SP_STYLE_FILL_SERVER(style))) { // must be paint-server SPPaintServer *paintserver = style->fill.value.href->getObject(); SPPattern *pat = SP_PATTERN(paintserver); - double dwidth = pat->get_width(); - double dheight = pat->get_height(); + double dwidth = pat->width(); + double dheight = pat->height(); width = dwidth; height = dheight; brush_classify(pat, 0, &pixbuf, &hatchType, &hatchColor, &bkColor); @@ -573,8 +573,8 @@ int PrintEmf::create_pen(SPStyle const *style, const Geom::Affine &transform) if (SP_IS_PATTERN(SP_STYLE_STROKE_SERVER(style))) { // must be paint-server SPPaintServer *paintserver = style->stroke.value.href->getObject(); SPPattern *pat = SP_PATTERN(paintserver); - double dwidth = pat->get_width(); - double dheight = pat->get_height(); + double dwidth = pat->width(); + double dheight = pat->height(); width = dwidth; height = dheight; brush_classify(pat, 0, &pixbuf, &hatchType, &hatchColor, &bkColor); diff --git a/src/extension/internal/wmf-print.cpp b/src/extension/internal/wmf-print.cpp index 4894b6740..768909173 100644 --- a/src/extension/internal/wmf-print.cpp +++ b/src/extension/internal/wmf-print.cpp @@ -380,8 +380,8 @@ int PrintWmf::create_brush(SPStyle const *style, U_COLORREF *fcolor) } else if (SP_IS_PATTERN(SP_STYLE_FILL_SERVER(style))) { // must be paint-server SPPaintServer *paintserver = style->fill.value.href->getObject(); SPPattern *pat = SP_PATTERN(paintserver); - double dwidth = pat->get_width(); - double dheight = pat->get_height(); + double dwidth = pat->width(); + double dheight = pat->height(); width = dwidth; height = dheight; brush_classify(pat, 0, &pixbuf, &hatchType, &hatchColor, &bkColor); diff --git a/src/knot-holder-entity.cpp b/src/knot-holder-entity.cpp index 69ee4017e..173025920 100644 --- a/src/knot-holder-entity.cpp +++ b/src/knot-holder-entity.cpp @@ -140,19 +140,19 @@ KnotHolderEntity::snap_knot_position_constrained(Geom::Point const &p, Inkscape: static gdouble sp_pattern_extract_theta(SPPattern const *pat) { - Geom::Affine transf = pat->get_transform(); + Geom::Affine transf = pat->getTransform(); return Geom::atan2(transf.xAxis()); } static Geom::Point sp_pattern_extract_scale(SPPattern const *pat) { - Geom::Affine transf = pat->get_transform(); + Geom::Affine transf = pat->getTransform(); return Geom::Point( transf.expansionX(), transf.expansionY() ); } static Geom::Point sp_pattern_extract_trans(SPPattern const *pat) { - return Geom::Point(pat->get_transform()[4], pat->get_transform()[5]); + return Geom::Point(pat->getTransform()[4], pat->getTransform()[5]); } void @@ -191,7 +191,7 @@ PatternKnotHolderEntityAngle::knot_get() const { SPPattern *pat = _fill ? SP_PATTERN(item->style->getFillPaintServer()) : SP_PATTERN(item->style->getStrokePaintServer()); - gdouble x = pat->get_width(); + gdouble x = pat->width(); gdouble y = 0; Geom::Point delta = Geom::Point(x,y); Geom::Point scale = sp_pattern_extract_scale(pat); @@ -240,8 +240,8 @@ PatternKnotHolderEntityScale::knot_set(Geom::Point const &p, Geom::Point const & // Get the new scale from the position of the knotholder Geom::Point d = p_snapped - sp_pattern_extract_trans(pat); - gdouble pat_x = pat->get_width(); - gdouble pat_y = pat->get_height(); + gdouble pat_x = pat->width(); + gdouble pat_y = pat->height(); Geom::Scale scl(1); if ( state & GDK_CONTROL_MASK ) { // if ctrl is pressed: use 1:1 scaling @@ -267,10 +267,10 @@ PatternKnotHolderEntityScale::knot_get() const { SPPattern *pat = _fill ? SP_PATTERN(item->style->getFillPaintServer()) : SP_PATTERN(item->style->getStrokePaintServer()); - gdouble x = pat->get_width(); - gdouble y = pat->get_height(); + gdouble x = pat->width(); + gdouble y = pat->height(); Geom::Point delta = Geom::Point(x,y); - Geom::Affine a = pat->get_transform(); + Geom::Affine a = pat->getTransform(); a[4] = 0; a[5] = 0; delta = delta * a; diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 23468acc3..a604064cc 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -1939,8 +1939,8 @@ std::vector<SPItem*> sp_get_same_fill_or_stroke_color(SPItem *sel, std::vector<S } } else if (dynamic_cast<SPPattern *>(sel_server) && dynamic_cast<SPPattern *>(iter_server)) { - SPPattern *sel_pat = dynamic_cast<SPPattern *>(sel_server)->get_root(); - SPPattern *iter_pat = dynamic_cast<SPPattern *>(iter_server)->get_root(); + SPPattern *sel_pat = dynamic_cast<SPPattern *>(sel_server)->rootPattern(); + SPPattern *iter_pat = dynamic_cast<SPPattern *>(iter_server)->rootPattern(); if (sel_pat == iter_pat) { match = true; } @@ -3366,9 +3366,9 @@ void sp_selection_untile(SPDesktop *desktop) did = true; - SPPattern *pattern = basePat->get_root(); + SPPattern *pattern = basePat->rootPattern(); - Geom::Affine pat_transform = basePat->get_transform(); + Geom::Affine pat_transform = basePat->getTransform(); pat_transform *= item->transform; for (SPObject *child = pattern->firstChild() ; child != NULL; child = child->next ) { diff --git a/src/sp-pattern.cpp b/src/sp-pattern.cpp index db2017351..755d3d162 100644 --- a/src/sp-pattern.cpp +++ b/src/sp-pattern.cpp @@ -42,21 +42,21 @@ SPPattern::SPPattern() , SPViewBox() { this->ref = new SPPatternReference(this); - this->ref->changedSignal().connect(sigc::mem_fun(this, &SPPattern::_on_ref_changed)); + this->ref->changedSignal().connect(sigc::mem_fun(this, &SPPattern::_onRefChanged)); - this->patternUnits = UNITS_OBJECTBOUNDINGBOX; - this->patternUnits_set = false; + this->_pattern_units = UNITS_OBJECTBOUNDINGBOX; + this->_pattern_units_set = false; - this->patternContentUnits = UNITS_USERSPACEONUSE; - this->patternContentUnits_set = false; + this->_pattern_content_units = UNITS_USERSPACEONUSE; + this->_pattern_content_units_set = false; - this->patternTransform = Geom::identity(); - this->patternTransform_set = false; + this->_pattern_transform = Geom::identity(); + this->_pattern_transform_set = false; - this->x.unset(); - this->y.unset(); - this->width.unset(); - this->height.unset(); + this->_x.unset(); + this->_y.unset(); + this->_width.unset(); + this->_height.unset(); } SPPattern::~SPPattern() {} @@ -88,7 +88,7 @@ void SPPattern::release() } if (this->ref) { - this->modified_connection.disconnect(); + this->_modified_connection.disconnect(); this->ref->detach(); delete this->ref; this->ref = NULL; @@ -103,16 +103,16 @@ void SPPattern::set(unsigned int key, const gchar *value) case SP_ATTR_PATTERNUNITS: if (value) { if (!strcmp(value, "userSpaceOnUse")) { - this->patternUnits = UNITS_USERSPACEONUSE; + this->_pattern_units = UNITS_USERSPACEONUSE; } else { - this->patternUnits = UNITS_OBJECTBOUNDINGBOX; + this->_pattern_units = UNITS_OBJECTBOUNDINGBOX; } - this->patternUnits_set = true; + this->_pattern_units_set = true; } else { - this->patternUnits_set = false; + this->_pattern_units_set = false; } this->requestModified(SP_OBJECT_MODIFIED_FLAG); @@ -121,16 +121,16 @@ void SPPattern::set(unsigned int key, const gchar *value) case SP_ATTR_PATTERNCONTENTUNITS: if (value) { if (!strcmp(value, "userSpaceOnUse")) { - this->patternContentUnits = UNITS_USERSPACEONUSE; + this->_pattern_content_units = UNITS_USERSPACEONUSE; } else { - this->patternContentUnits = UNITS_OBJECTBOUNDINGBOX; + this->_pattern_content_units = UNITS_OBJECTBOUNDINGBOX; } - this->patternContentUnits_set = true; + this->_pattern_content_units_set = true; } else { - this->patternContentUnits_set = false; + this->_pattern_content_units_set = false; } this->requestModified(SP_OBJECT_MODIFIED_FLAG); @@ -140,34 +140,34 @@ void SPPattern::set(unsigned int key, const gchar *value) Geom::Affine t; if (value && sp_svg_transform_read(value, &t)) { - this->patternTransform = t; - this->patternTransform_set = true; + this->_pattern_transform = t; + this->_pattern_transform_set = true; } else { - this->patternTransform = Geom::identity(); - this->patternTransform_set = false; + this->_pattern_transform = Geom::identity(); + this->_pattern_transform_set = false; } this->requestModified(SP_OBJECT_MODIFIED_FLAG); break; } case SP_ATTR_X: - this->x.readOrUnset(value); + this->_x.readOrUnset(value); this->requestModified(SP_OBJECT_MODIFIED_FLAG); break; case SP_ATTR_Y: - this->y.readOrUnset(value); + this->_y.readOrUnset(value); this->requestModified(SP_OBJECT_MODIFIED_FLAG); break; case SP_ATTR_WIDTH: - this->width.readOrUnset(value); + this->_width.readOrUnset(value); this->requestModified(SP_OBJECT_MODIFIED_FLAG); break; case SP_ATTR_HEIGHT: - this->height.readOrUnset(value); + this->_height.readOrUnset(value); this->requestModified(SP_OBJECT_MODIFIED_FLAG); break; @@ -219,7 +219,7 @@ void SPPattern::set(unsigned int key, const gchar *value) /* fixme: We need ::order_changed handler too (Lauris) */ -void SPPattern::_get_children(std::list<SPObject *> &l) +void SPPattern::_getChildren(std::list<SPObject *> &l) { for (SPPattern *pat_i = this; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) { if (pat_i->firstChild()) { // find the first one with children @@ -242,7 +242,7 @@ void SPPattern::update(SPCtx *ctx, unsigned int flags) flags &= SP_OBJECT_MODIFIED_CASCADE; std::list<SPObject *> l; - _get_children(l); + _getChildren(l); for (SPObjectIterator it = l.begin(); it != l.end(); it++) { SPObject *child = *it; @@ -268,7 +268,7 @@ void SPPattern::modified(unsigned int flags) flags &= SP_OBJECT_MODIFIED_CASCADE; std::list<SPObject *> l; - _get_children(l); + _getChildren(l); for (SPObjectIterator it = l.begin(); it != l.end(); it++) { SPObject *child = *it; @@ -283,26 +283,26 @@ void SPPattern::modified(unsigned int flags) } } -void SPPattern::_on_ref_changed(SPObject *old_ref, SPObject *ref) +void SPPattern::_onRefChanged(SPObject *old_ref, SPObject *ref) { if (old_ref) { - modified_connection.disconnect(); + _modified_connection.disconnect(); } if (SP_IS_PATTERN(ref)) { - modified_connection = ref->connectModified(sigc::mem_fun(this, &SPPattern::_on_ref_modified)); + _modified_connection = ref->connectModified(sigc::mem_fun(this, &SPPattern::_onRefModified)); } - _on_ref_modified(ref, 0); + _onRefModified(ref, 0); } -void SPPattern::_on_ref_modified(SPObject * /*ref*/, guint /*flags*/) +void SPPattern::_onRefModified(SPObject * /*ref*/, guint /*flags*/) { requestModified(SP_OBJECT_MODIFIED_FLAG); // Conditional to avoid causing infinite loop if there's a cycle in the href chain. } -guint SPPattern::_count_hrefs(SPObject *o) const +guint SPPattern::_countHrefs(SPObject *o) const { if (!o) return 1; @@ -320,7 +320,7 @@ guint SPPattern::_count_hrefs(SPObject *o) const } for (SPObject *child = o->firstChild(); child != NULL; child = child->next) { - i += _count_hrefs(child); + i += _countHrefs(child); } return i; @@ -347,7 +347,7 @@ SPPattern *SPPattern::_chain() const SPPattern *SPPattern::clone_if_necessary(SPItem *item, const gchar *property) { SPPattern *pattern = this; - if (pattern->href.empty() || pattern->hrefcount > _count_hrefs(item)) { + if (pattern->href.empty() || pattern->hrefcount > _countHrefs(item)) { pattern = _chain(); Glib::ustring href = Glib::ustring::compose("url(#%1)", pattern->getRepr()->attribute("id")); @@ -367,14 +367,14 @@ void SPPattern::transform_multiply(Geom::Affine postmul, bool set) // otherwise the formula is much simpler if (set) { - patternTransform = postmul; + _pattern_transform = postmul; } else { - patternTransform = get_transform() * postmul; + _pattern_transform = getTransform() * postmul; } - patternTransform_set = true; + _pattern_transform_set = true; - Glib::ustring c = sp_svg_transform_write(patternTransform); + Glib::ustring c = sp_svg_transform_write(_pattern_transform); getRepr()->setAttribute("patternTransform", c); } @@ -414,7 +414,7 @@ const gchar *SPPattern::produce(const std::vector<Inkscape::XML::Node *> &reprs, return pat_id; } -SPPattern *SPPattern::get_root() +SPPattern *SPPattern::rootPattern() { for (SPPattern *pat_i = this; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) { if (pat_i->firstChild()) { // find the first one with children @@ -430,70 +430,70 @@ SPPattern *SPPattern::get_root() // Access functions that look up fields up the chain of referenced patterns and return the first one which is set // FIXME: all of them must use chase_hrefs the same as in SPGradient, to avoid lockup on circular refs -SPPattern::PatternUnits SPPattern::get_pattern_units() const +SPPattern::PatternUnits SPPattern::patternUnits() const { for (SPPattern const *pat_i = this; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) { - if (pat_i->patternUnits_set) - return pat_i->patternUnits; + if (pat_i->_pattern_units_set) + return pat_i->_pattern_units; } - return patternUnits; + return _pattern_units; } -SPPattern::PatternUnits SPPattern::get_pattern_content_units() const +SPPattern::PatternUnits SPPattern::patternContentUnits() const { for (SPPattern const *pat_i = this; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) { - if (pat_i->patternContentUnits_set) - return pat_i->patternContentUnits; + if (pat_i->_pattern_content_units_set) + return pat_i->_pattern_content_units; } - return patternContentUnits; + return _pattern_content_units; } -Geom::Affine const &SPPattern::get_transform() const +Geom::Affine const &SPPattern::getTransform() const { for (SPPattern const *pat_i = this; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) { - if (pat_i->patternTransform_set) - return pat_i->patternTransform; + if (pat_i->_pattern_transform_set) + return pat_i->_pattern_transform; } - return patternTransform; + return _pattern_transform; } -gdouble SPPattern::get_x() const +gdouble SPPattern::x() const { for (SPPattern const *pat_i = this; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) { - if (pat_i->x._set) - return pat_i->x.computed; + if (pat_i->_x._set) + return pat_i->_x.computed; } return 0; } -gdouble SPPattern::get_y() const +gdouble SPPattern::y() const { for (SPPattern const *pat_i = this; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) { - if (pat_i->y._set) - return pat_i->y.computed; + if (pat_i->_y._set) + return pat_i->_y.computed; } return 0; } -gdouble SPPattern::get_width() const +gdouble SPPattern::width() const { for (SPPattern const *pat_i = this; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) { - if (pat_i->width._set) - return pat_i->width.computed; + if (pat_i->_width._set) + return pat_i->_width.computed; } return 0; } -gdouble SPPattern::get_height() const +gdouble SPPattern::height() const { for (SPPattern const *pat_i = this; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) { - if (pat_i->height._set) - return pat_i->height.computed; + if (pat_i->_height._set) + return pat_i->_height.computed; } return 0; } -Geom::OptRect SPPattern::get_viewbox() const +Geom::OptRect SPPattern::viewbox() const { Geom::OptRect viewbox; for (SPPattern const *pat_i = this; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) { @@ -505,7 +505,7 @@ Geom::OptRect SPPattern::get_viewbox() const return viewbox; } -bool SPPattern::_has_item_children() const +bool SPPattern::_hasItemChildren() const { bool hasChildren = false; for (SPObject const *child = firstChild(); child && !hasChildren; child = child->getNext()) { @@ -518,8 +518,8 @@ bool SPPattern::_has_item_children() const bool SPPattern::isValid() const { - double tile_width = get_width(); - double tile_height = get_height(); + double tile_width = width(); + double tile_height = height(); if (tile_width <= 0 || tile_height <= 0) return false; @@ -541,7 +541,7 @@ cairo_pattern_t *SPPattern::pattern_new(cairo_t *base_ct, Geom::OptRect const &b for (SPPattern *pat_i = this; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) { // find the first one with item children - if (pat_i && SP_IS_OBJECT(pat_i) && pat_i->_has_item_children()) { + if (pat_i && SP_IS_OBJECT(pat_i) && pat_i->_hasItemChildren()) { shown = pat_i; break; // do not go further up the chain if children are found } @@ -575,11 +575,11 @@ cairo_pattern_t *SPPattern::pattern_new(cairo_t *base_ct, Geom::OptRect const &b // * "x", "y", and "patternTransform" transform tile to user space after tile is generated. // These functions recursively search up the tree to find the values. - double tile_x = get_x(); - double tile_y = get_y(); - double tile_width = get_width(); - double tile_height = get_height(); - if (bbox && (get_pattern_units() == UNITS_OBJECTBOUNDINGBOX)) { + double tile_x = x(); + double tile_y = y(); + double tile_width = width(); + double tile_height = height(); + if (bbox && (patternUnits() == UNITS_OBJECTBOUNDINGBOX)) { tile_x *= bbox->width(); tile_y *= bbox->height(); tile_width *= bbox->width(); @@ -591,7 +591,7 @@ cairo_pattern_t *SPPattern::pattern_new(cairo_t *base_ct, Geom::OptRect const &b // Content to tile (pattern space) Geom::Affine content2ps; - Geom::OptRect effective_view_box = get_viewbox(); + Geom::OptRect effective_view_box = viewbox(); if (effective_view_box) { // viewBox to pattern server (using SPViewBox) viewBox = *effective_view_box; @@ -602,14 +602,14 @@ cairo_pattern_t *SPPattern::pattern_new(cairo_t *base_ct, Geom::OptRect const &b else { // Content to bbox - if (bbox && (get_pattern_content_units() == UNITS_OBJECTBOUNDINGBOX)) { + if (bbox && (patternContentUnits() == UNITS_OBJECTBOUNDINGBOX)) { content2ps = Geom::Affine(bbox->width(), 0.0, 0.0, bbox->height(), 0, 0); } } // Tile (pattern space) to user. - Geom::Affine ps2user = Geom::Translate(tile_x, tile_y) * get_transform(); + Geom::Affine ps2user = Geom::Translate(tile_x, tile_y) * getTransform(); // Transform of object with pattern (includes screen scaling) diff --git a/src/sp-pattern.h b/src/sp-pattern.h index 6c63d0727..145bb934e 100644 --- a/src/sp-pattern.h +++ b/src/sp-pattern.h @@ -47,15 +47,15 @@ public: Glib::ustring href; SPPatternReference *ref; - gdouble get_x() const; - gdouble get_y() const; - gdouble get_width() const; - gdouble get_height() const; - Geom::OptRect get_viewbox() const; - SPPattern::PatternUnits get_pattern_units() const; - SPPattern::PatternUnits get_pattern_content_units() const; - Geom::Affine const &get_transform() const; - SPPattern *get_root(); // TODO: const + gdouble x() const; + gdouble y() const; + gdouble width() const; + gdouble height() const; + Geom::OptRect viewbox() const; + SPPattern::PatternUnits patternUnits() const; + SPPattern::PatternUnits patternContentUnits() const; + Geom::Affine const &getTransform() const; + SPPattern *rootPattern(); // TODO: const SPPattern *clone_if_necessary(SPItem *item, const gchar *property); void transform_multiply(Geom::Affine postmul, bool set); @@ -79,40 +79,40 @@ protected: virtual void modified(unsigned int flags); private: - bool _has_item_children() const; - void _get_children(std::list<SPObject *> &l); + bool _hasItemChildren() const; + void _getChildren(std::list<SPObject *> &l); SPPattern *_chain() const; /** Count how many times pattern is used by the styles of o and its descendants */ - guint _count_hrefs(SPObject *o) const; + guint _countHrefs(SPObject *o) const; /** Gets called when the pattern is reattached to another <pattern> */ - void _on_ref_changed(SPObject *old_ref, SPObject *ref); + void _onRefChanged(SPObject *old_ref, SPObject *ref); /** Gets called when the referenced <pattern> is changed */ - void _on_ref_modified(SPObject *ref, guint flags); + void _onRefModified(SPObject *ref, guint flags); /* patternUnits and patternContentUnits attribute */ - PatternUnits patternUnits : 1; - bool patternUnits_set : 1; - PatternUnits patternContentUnits : 1; - bool patternContentUnits_set : 1; + PatternUnits _pattern_units : 1; + bool _pattern_units_set : 1; + PatternUnits _pattern_content_units : 1; + bool _pattern_content_units_set : 1; /* patternTransform attribute */ - Geom::Affine patternTransform; - bool patternTransform_set : 1; + Geom::Affine _pattern_transform; + bool _pattern_transform_set : 1; /* Tile rectangle */ - SVGLength x; - SVGLength y; - SVGLength width; - SVGLength height; + SVGLength _x; + SVGLength _y; + SVGLength _width; + SVGLength _height; - sigc::connection modified_connection; + sigc::connection _modified_connection; }; diff --git a/src/widgets/fill-style.cpp b/src/widgets/fill-style.cpp index e29420ac6..264ebff5a 100644 --- a/src/widgets/fill-style.cpp +++ b/src/widgets/fill-style.cpp @@ -300,7 +300,7 @@ void FillNStroke::performUpdate() psel->setGradientProperties( rg->getUnits(), rg->getSpread() ); } else if (SP_IS_PATTERN(server)) { - SPPattern *pat = SP_PATTERN(server)->get_root(); + SPPattern *pat = SP_PATTERN(server)->rootPattern(); psel->updatePatternList( pat ); } } @@ -656,7 +656,7 @@ void FillNStroke::updateFromPaint() SPPaintServer *server = (kind == FILL) ? selobj->style->getFillPaintServer() : selobj->style->getStrokePaintServer(); - if (SP_IS_PATTERN(server) && SP_PATTERN(server)->get_root() == pattern) + if (SP_IS_PATTERN(server) && SP_PATTERN(server)->rootPattern() == pattern) // only if this object's pattern is not rooted in our selected pattern, apply continue; } diff --git a/src/widgets/paint-selector.cpp b/src/widgets/paint-selector.cpp index a2160e3ad..e2483343f 100644 --- a/src/widgets/paint-selector.cpp +++ b/src/widgets/paint-selector.cpp @@ -822,7 +822,7 @@ ink_pattern_list_get (SPDocument *source) GSList *pl = NULL; GSList const *patterns = source->getResourceList("pattern"); for (GSList *l = const_cast<GSList *>(patterns); l != NULL; l = l->next) { - if (SP_PATTERN(l->data) == SP_PATTERN(l->data)->get_root()) { // only if this is a root pattern + if (SP_PATTERN(l->data) == SP_PATTERN(l->data)->rootPattern()) { // only if this is a root pattern pl = g_slist_prepend(pl, l->data); } } @@ -1142,7 +1142,7 @@ SPPattern *SPPaintSelector::getPattern() } g_free(paturn); } else { - pat = SP_PATTERN(patid)->get_root(); + pat = SP_PATTERN(patid)->rootPattern(); } if (pat && !SP_IS_PATTERN(pat)) { |
