typedef struct _GObject { } GObject; namespace std { struct random_access_iterator_tag { }; template < typename _Iterator > struct iterator_traits { }; template < typename _Tp > struct iterator_traits <_Tp * > { struct iterator_category {}; }; } namespace __gnu_cxx { using std::iterator_traits; template < typename _Iterator, typename _Container > class __normal_iterator { protected:_Iterator _M_current; public:typedef typename iterator_traits < _Iterator >:: iterator_category iterator_category; typedef typename iterator_traits < _Iterator >::int int; explicit __normal_iterator(const _Iterator & __i):_M_current(__i) { } const _Iterator & base() const { return _M_current; }}; template < typename _IteratorL, typename _IteratorR, typename _Container > inline typename __normal_iterator < _IteratorL, _Container >::int operator-(const __normal_iterator < _IteratorL, _Container > &__lhs, const __normal_iterator < _IteratorR, _Container > &__rhs) { return __lhs.base() - __rhs.base(); } template < typename _Tp > class new_allocator { public:typedef const _Tp *const_pointer; typedef const _Tp & const_reference; template < typename _Tp1 > struct rebind { typedef new_allocator < _Tp1 > other; }; }; } namespace std { template < typename _Tp > class allocator:public __gnu_cxx::new_allocator < _Tp > { }; } extern double fabs(double); namespace Inkscape { namespace GC { enum ScanPolicy { SCANNED }; enum CollectionPolicy { AUTO, MANUAL }; template < ScanPolicy default_scan = SCANNED, CollectionPolicy default_collect = AUTO > class Managed { }; class Finalized { public:Finalized() { }}; class Anchored { protected:Anchored():_anchor(__null) { } private:struct Anchor:public Managed < SCANNED, MANUAL > { }; mutable Anchor *_anchor; }; } namespace UI { namespace View { class View:public GC::Managed <>, public GC::Finalized, public GC::Anchored { }; }}} struct SPDesktop:public Inkscape::UI::View::View { }; enum SPMarkerLoc { SP_CSS_UNIT_NONE, SP_CSS_UNIT_PX, SP_CSS_UNIT_PT, SP_CSS_UNIT_PC, SP_CSS_UNIT_MM, SP_CSS_UNIT_CM, SP_CSS_UNIT_IN, SP_CSS_UNIT_EM, SP_CSS_UNIT_EX, SP_CSS_UNIT_PERCENT }; struct SPILengthOrNormal { unsigned unit; float value; float computed; }; struct SPStyle { SPILengthOrNormal line_height; }; namespace std { template < typename _Tp, typename _Alloc > struct _Vector_base { typedef typename _Alloc::template rebind < _Tp >::other _Tp_alloc_type; struct _Vector_impl:public _Tp_alloc_type { _Tp *_M_start; _Tp *_M_finish; }; public:_Vector_impl _M_impl; }; template < typename _Tp, typename _Alloc = std::allocator < _Tp > >class vector:protected _Vector_base < _Tp, _Alloc > { typedef _Vector_base < _Tp, _Alloc > _Base; typedef vector < _Tp, _Alloc > vector_type; typedef typename _Base::_Tp_alloc_type _Tp_alloc_type; public:typedef _Tp value_type; typedef typename _Tp_alloc_type::const_pointer const_pointer; typedef typename _Tp_alloc_type:: const_reference const_reference; typedef __gnu_cxx::__normal_iterator < const_pointer, vector_type > const_iterator; const_iterator begin() const { return const_iterator(this->_M_impl._M_start); } const_iterator end() const { return const_iterator(this->_M_impl._M_finish); } unsigned int size() const { return end() - begin(); } const_reference operator[] (unsigned int __n)const { }}; } namespace Inkscape { namespace Text { class Layout { public:class iterator; inline iterator end() const; inline unsigned lineIndex(iterator const &it) const; struct Chunk; struct Glyph { }; struct Character { inline Chunk const &chunk(Layout const *l) const { }}; struct Chunk { unsigned in_line; }; struct Line { }; std::vector < Line > _lines; std::vector < Character > _characters; std::vector < Glyph > _glyphs; class PredicateLineToCharacter { Layout const *const _flow; public:inline PredicateLineToCharacter(Layout const *flow):_flow (flow) { }}; }; class Layout::iterator { public:friend class Layout; private:Layout const *_parent_layout; int _glyph_index; unsigned _char_index; bool _cursor_moving_vertically; double _x_coordinate; inline iterator(Layout const *p, unsigned c, int g):_parent_layout(p), _glyph_index(g), _char_index(c), _cursor_moving_vertically(false), _x_coordinate(0.0) { }}; inline Layout::iterator Layout::end() const { return iterator(this, _characters.size(), _glyphs.size()); } inline unsigned Layout::lineIndex(iterator const &it) const { return it._char_index == _characters.size()? _lines.size() - 1 : _characters[it._char_index].chunk(this).in_line; }}}; void sp_te_adjust_linespacing_screen(GObject * text, Inkscape::Text::Layout:: iterator const &start, Inkscape::Text::Layout:: iterator const &end, SPDesktop * desktop, double by) { Inkscape::Text::Layout const *layout; SPStyle *style; unsigned line_count = layout->lineIndex(layout->end()); double all_lines_height; double average_line_height = all_lines_height / (line_count == 0 ? 1 : line_count); double zby; switch (style->line_height.unit) { case SP_CSS_UNIT_NONE: default: if (fabs(style->line_height.computed) < 0.001) style->line_height.computed = by; else style->line_height.computed *= (average_line_height + zby) / average_line_height; case SP_CSS_UNIT_EM: case SP_CSS_UNIT_EX: case SP_CSS_UNIT_PERCENT: if (fabs(style->line_height.value) < 0.001) style->line_height.value = by; else style->line_height.value *= (average_line_height + zby) / average_line_height; } }