Kate
katelayoutcache.cpp
Go to the documentation of this file.
57 qBinaryFind(m_lineLayouts.constBegin(), m_lineLayouts.constEnd(), LineLayoutPair(i,KateLineLayoutPtr()), lessThan);
64 qBinaryFind(m_lineLayouts.begin(), m_lineLayouts.end(), LineLayoutPair(realLine,KateLineLayoutPtr()), lessThan);
68 it = qUpperBound(m_lineLayouts.begin(), m_lineLayouts.end(), LineLayoutPair(realLine,KateLineLayoutPtr()), lessThan);
95 qLowerBound(m_lineLayouts.begin(), m_lineLayouts.end(), LineLayoutPair(startRealLine, KateLineLayoutPtr()), lessThan);
97 qUpperBound(start, m_lineLayouts.end(), LineLayoutPair(endRealLine, KateLineLayoutPtr()), lessThan);
108 qLowerBound(m_lineLayouts.begin(), m_lineLayouts.end(), LineLayoutPair(fromLine, KateLineLayoutPtr()), lessThan);
135 qBinaryFind(m_lineLayouts.begin(), m_lineLayouts.end(), LineLayoutPair(i, KateLineLayoutPtr()), lessThan);
153 connect(&m_renderer->doc()->buffer(), SIGNAL(lineWrapped(KTextEditor::Cursor)), this, SLOT(wrapLine(KTextEditor::Cursor)));
155 connect(&m_renderer->doc()->buffer(), SIGNAL(textInserted(KTextEditor::Cursor,QString)), this, SLOT(insertText(KTextEditor::Cursor,QString)));
156 connect(&m_renderer->doc()->buffer(), SIGNAL(textRemoved(KTextEditor::Range,QString)), this, SLOT(removeText(KTextEditor::Range)));
159 void KateLayoutCache::updateViewCache(const KTextEditor::Cursor& startPos, int newViewLineCount, int viewLinesScrolled)
171 realLine = m_renderer->folding().visibleLineToLine(m_renderer->folding().lineToVisibleLine(startPos.line()));
211 for (int z = forwards ? 0 : m_textLayouts.count() - 1; forwards ? (z < m_textLayouts.count()) : (z >= 0); forwards ? z++ : z--) {
250 if (m_textLayouts[i].line() != realLine || m_textLayouts[i].viewLine() != _viewLine || (!m_textLayouts[i].isValid() && l->viewLine(_viewLine).isValid()))
260 //kDebug( 13033 ) << "Laid out line " << realLine << " (" << l << "), viewLine " << _viewLine << " (" << m_textLayouts[i].kateLineLayout().data() << ")";
339 /*if (realCursor >= viewCacheStart() && (realCursor < viewCacheEnd() || realCursor == viewCacheEnd() && !m_textLayouts.last().wrap()))
349 /*if (m_textLayouts.count() && (realLine >= m_textLayouts.first().line() && _viewLine >= m_textLayouts.first().viewLine()) &&
405 int KateLayoutCache::displayViewLine(const KTextEditor::Cursor& virtualCursor, bool limitToVisible)
457 if (realCursor.column() == -1) realCursor.setColumn(m_renderer->doc()->lineLength(realCursor.line()));
KTextEditor::Cursor viewCacheStart() const
Definition: katelayoutcache.cpp:369
void append(const T &value)
iterator begin()
QPair< int, KateLineLayoutPtr > LineLayoutPair
Definition: katelayoutcache.h:56
void insert(int realLine, const KateLineLayoutPtr &lineLayoutPtr)
Definition: katelayoutcache.cpp:61
const_iterator constEnd() const
int visibleLineToLine(int visibleLine) const
Convert a visible line number to a line number in the text buffer.
Definition: katetextfolding.cpp:422
T & last()
void insert(int i, const T &value)
iterator erase(iterator begin, iterator end)
KateTextLayout textLayout(const KTextEditor::Cursor &realCursor)
Returns the layout describing the text line which is occupied by realCursor.
Definition: katelayoutcache.cpp:337
void slotEditDone(int fromLine, int toLine, int shiftAmount)
Definition: katelayoutcache.cpp:105
T & first()
void layoutLine(KateLineLayoutPtr line, int maxwidth=-1, bool cacheLayout=false) const
Text width & height calculation functions...
Definition: katerenderer.cpp:912
void relayoutLines(int startRealLine, int endRealLine)
Definition: katelayoutcache.cpp:92
Definition: katelinelayout.h:34
int endCol(bool indicateEOL=false) const
Return the end column of this text line.
Definition: katetextlayout.cpp:140
void setAcceptDirtyLayouts(bool accept)
Definition: katelayoutcache.cpp:565
Handles all of the work of rendering the text (used for the views and printing)
Definition: katerenderer.h:50
void clear()
bool lessThan(const KateLineLayoutMap::LineLayoutPair &lhs, const KateLineLayoutMap::LineLayoutPair &rhs)
Definition: katelayoutcache.cpp:43
void viewWidthDecreased(int newWidth)
Definition: katelayoutcache.cpp:82
void resize(int size)
int viewLine() const
Return the index of this visual line inside the document line (KateLineLayout).
Definition: katetextlayout.cpp:109
KateView * view() const
Returns the view to which this renderer is bound.
Definition: katerenderer.h:103
KateLayoutCache(KateRenderer *renderer, QObject *parent)
Definition: katelayoutcache.cpp:140
KateLineLayoutPtr line(int realLine, int virtualLine=-1)
Returns the KateLineLayout for the specified line.
Definition: katelayoutcache.cpp:280
KateTextLayout & viewLine(int viewLine)
Returns the layout of the corresponding line in the view.
Definition: katelayoutcache.cpp:358
int lineToVisibleLine(int line) const
Convert a text buffer line to a visible line number.
Definition: katetextfolding.cpp:366
Kate::TextFolding & folding() const
Returns the folding info to which this renderer is bound.
Definition: katerenderer.h:98
void reserve(int size)
KateLineLayoutPtr & operator[](int i)
Definition: katelayoutcache.cpp:132
const_iterator constBegin() const
This class represents one visible line of text; with dynamic wrapping, many KateTextLayouts can be ne...
Definition: katetextlayout.h:38
void relayoutLines(int startRealLine, int endRealLine)
Definition: katelayoutcache.cpp:552
KTextEditor::Cursor viewCacheEnd() const
Definition: katelayoutcache.cpp:374
int count(const T &value) const
KateDocument * doc() const
Returns the document to which this renderer is bound.
Definition: katerenderer.h:92
int displayViewLine(const KTextEditor::Cursor &virtualCursor, bool limitToVisible=false)
Definition: katelayoutcache.cpp:405
void viewCacheDebugOutput() const
Definition: katelayoutcache.cpp:480
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
int viewCacheLineCount() const
Definition: katelayoutcache.cpp:364
void updateViewCache(const KTextEditor::Cursor &startPos, int newViewLineCount=-1, int viewLinesScrolled=0)
Definition: katelayoutcache.cpp:159
iterator end()
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:58 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:58 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.