1 typedef struct _GObject {
4 struct random_access_iterator_tag {
6 template < typename _Iterator > struct iterator_traits {
8 template < typename _Tp > struct iterator_traits <_Tp * > {
9 struct iterator_category {};
11 } namespace __gnu_cxx {
12 using std::iterator_traits;
13 template < typename _Iterator,
14 typename _Container > class __normal_iterator {
15 protected:_Iterator _M_current;
16 public:typedef typename iterator_traits <
18 iterator_category iterator_category;
19 typedef typename iterator_traits <
21 explicit __normal_iterator(const _Iterator &
22 __i):_M_current(__i) {
23 } const _Iterator & base() const {
26 template < typename _IteratorL, typename _IteratorR,
27 typename _Container > inline typename __normal_iterator <
29 _Container >::int operator-(const __normal_iterator <
32 const __normal_iterator <
34 _Container > &__rhs) {
35 return __lhs.base() - __rhs.base();
37 template < typename _Tp > class new_allocator {
38 public:typedef const _Tp *const_pointer;
39 typedef const _Tp & const_reference;
40 template < typename _Tp1 > struct rebind {
41 typedef new_allocator < _Tp1 > other;
47 template < typename _Tp >
48 class allocator:public __gnu_cxx::new_allocator < _Tp > {
51 extern double fabs(double);
57 enum CollectionPolicy {
60 template < ScanPolicy default_scan =
61 SCANNED, CollectionPolicy default_collect =
62 AUTO > class Managed {
68 protected:Anchored():_anchor(__null)
70 } private:struct Anchor:public Managed < SCANNED,
73 mutable Anchor *_anchor;
78 class View:public GC::Managed <>, public GC::Finalized,
81 }}} struct SPDesktop:public Inkscape::UI::View::View {
84 SP_CSS_UNIT_NONE, SP_CSS_UNIT_PX, SP_CSS_UNIT_PT, SP_CSS_UNIT_PC,
85 SP_CSS_UNIT_MM, SP_CSS_UNIT_CM, SP_CSS_UNIT_IN, SP_CSS_UNIT_EM,
86 SP_CSS_UNIT_EX, SP_CSS_UNIT_PERCENT
88 struct SPILengthOrNormal {
94 SPILengthOrNormal line_height;
97 template < typename _Tp, typename _Alloc > struct _Vector_base {
98 typedef typename _Alloc::template rebind <
99 _Tp >::other _Tp_alloc_type;
100 struct _Vector_impl:public _Tp_alloc_type {
104 public:_Vector_impl _M_impl;
106 template < typename _Tp, typename _Alloc = std::allocator < _Tp > >class vector:protected _Vector_base < _Tp,
109 typedef _Vector_base < _Tp, _Alloc > _Base;
110 typedef vector < _Tp, _Alloc > vector_type;
111 typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
112 public:typedef _Tp value_type;
113 typedef typename _Tp_alloc_type::const_pointer const_pointer;
114 typedef typename _Tp_alloc_type::
115 const_reference const_reference;
116 typedef __gnu_cxx::__normal_iterator < const_pointer,
117 vector_type > const_iterator;
118 const_iterator begin() const {
119 return const_iterator(this->_M_impl._M_start);
120 } const_iterator end() const {
121 return const_iterator(this->_M_impl._M_finish);
122 } unsigned int size() const {
123 return end() - begin();
124 } const_reference operator[] (unsigned int __n)const {
131 public:class iterator;
132 inline iterator end() const;
133 inline unsigned lineIndex(iterator const &it) const;
138 inline Chunk const &chunk(Layout const *l) const {
145 std::vector < Line > _lines;
146 std::vector < Character > _characters;
147 std::vector < Glyph > _glyphs;
148 class PredicateLineToCharacter {
149 Layout const *const _flow;
150 public:inline PredicateLineToCharacter(Layout const
155 class Layout::iterator {
156 public:friend class Layout;
160 unsigned _char_index;
161 bool _cursor_moving_vertically;
162 double _x_coordinate;
163 inline iterator(Layout const *p, unsigned c,
164 int g):_parent_layout(p),
165 _glyph_index(g), _char_index(c),
166 _cursor_moving_vertically(false),
169 inline Layout::iterator Layout::end() const {
170 return iterator(this, _characters.size(),
172 } inline unsigned Layout::lineIndex(iterator const &it) const {
173 return it._char_index ==
174 _characters.size()? _lines.size() -
175 1 : _characters[it._char_index].chunk(this).in_line;
177 void sp_te_adjust_linespacing_screen(GObject * text,
178 Inkscape::Text::Layout::
179 iterator const &start,
180 Inkscape::Text::Layout::
181 iterator const &end, SPDesktop * desktop,
184 Inkscape::Text::Layout const *layout;
186 unsigned line_count = layout->lineIndex(layout->end());
187 double all_lines_height;
188 double average_line_height =
189 all_lines_height / (line_count == 0 ? 1 : line_count);
191 switch (style->line_height.unit) {
192 case SP_CSS_UNIT_NONE:
194 if (fabs(style->line_height.computed) < 0.001)
195 style->line_height.computed = by;
197 style->line_height.computed *=
198 (average_line_height + zby) / average_line_height;
201 case SP_CSS_UNIT_PERCENT:
202 if (fabs(style->line_height.value) < 0.001)
203 style->line_height.value = by;
205 style->line_height.value *=
206 (average_line_height + zby) / average_line_height;