namespace __gnu_cxx { template < typename _Iterator > struct iterator_traits { typedef int difference_type; }; template < typename _Iterator, typename _Container > class __normal_iterator { _Iterator _M_current; public:typedef typename iterator_traits < _Iterator >:: difference_type difference_type; 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 >::difference_type 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; }; }; } struct SPStyle { float value; float computed; }; namespace std { template < typename _Tp > class allocator:public __gnu_cxx::new_allocator < _Tp > { }; 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; unsigned int size() const { return const_iterator(this->_M_impl._M_finish) - const_iterator(this->_M_impl._M_start); } const_reference operator[] (unsigned int __n)const { }}; } namespace Text { class Layout { public:class iterator; iterator end() const; unsigned lineIndex(iterator const &it) const; struct Chunk; struct Character { Chunk const &chunk(Layout const *l) const { }}; struct Chunk { unsigned in_line; }; std::vector < Character > _characters; }; class Layout::iterator { public:unsigned _char_index; iterator(Layout const *p, unsigned c, int g):_char_index(c) { }}; inline Layout::iterator Layout::end() const { return iterator(this, _characters.size(), _characters.size()); } inline unsigned Layout::lineIndex(iterator const &it) const { return it._char_index == _characters.size()? 1 : _characters[0].chunk(this).in_line; }}; void sp_te_adjust_linespacing_screen(double by) { float value; float computed; Text::Layout * layout; SPStyle *style; unsigned line_count = layout->lineIndex(layout->end()); double all_lines_height; double average_line_height = all_lines_height / line_count; switch (1) { default: if (style->computed) style->computed = by; else style->computed = (average_line_height) / average_line_height; if (style->value) style->value = by; else style->value = (average_line_height) / average_line_height; } }