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()) &&
404 int KateLayoutCache::displayViewLine(const KTextEditor::Cursor& virtualCursor, bool limitToVisible)
453 if (realCursor.column() == -1) realCursor.setColumn(m_renderer->doc()->lineLength(realCursor.line()));
void setUsePlainTextLine(bool plain=true)
Definition: katelinelayout.cpp:239
Cursor & start()
KTextEditor::Cursor viewCacheStart() const
Definition: katelayoutcache.cpp:369
KateTextLayout viewLine(int viewLine) const
Definition: katelinelayout.cpp:177
QPair< int, KateLineLayoutPtr > LineLayoutPair
Definition: katelayoutcache.h:56
void insert(int realLine, const KateLineLayoutPtr &lineLayoutPtr)
Definition: katelayoutcache.cpp:61
int visibleLineToLine(int visibleLine) const
Convert a visible line number to a line number in the text buffer.
Definition: katetextfolding.cpp:422
const Kate::TextLine & textLine(bool forceReload=false) const
Definition: katelinelayout.cpp:65
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
void setLine(int line, int virtualLine=-1)
Only pass virtualLine if you know it (and thus we shouldn't try to look it up)
Definition: katelinelayout.cpp:80
void layoutLine(KateLineLayoutPtr line, int maxwidth=-1, bool cacheLayout=false) const
Text width & height calculation functions...
Definition: katerenderer.cpp:912
void setLayoutDirty(bool dirty=true)
Definition: katelinelayout.cpp:229
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
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:561
Handles all of the work of rendering the text (used for the views and printing)
Definition: katerenderer.h:50
bool lessThan(const KateLineLayoutMap::LineLayoutPair &lhs, const KateLineLayoutMap::LineLayoutPair &rhs)
Definition: katelayoutcache.cpp:43
void viewWidthDecreased(int newWidth)
Definition: katelayoutcache.cpp:82
virtual bool isValid() const
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
KateLineLayoutPtr & operator[](int i)
Definition: katelayoutcache.cpp:132
virtual int line() const
This class represents one visible line of text; with dynamic wrapping, many KateTextLayouts can be ne...
Definition: katetextlayout.h:38
virtual void setLine(int line)
void relayoutLines(int startRealLine, int endRealLine)
Definition: katelayoutcache.cpp:548
KTextEditor::Cursor viewCacheEnd() const
Definition: katelayoutcache.cpp:374
KateDocument * doc() const
Returns the document to which this renderer is bound.
Definition: katerenderer.h:92
static QDebug kWarning(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
int displayViewLine(const KTextEditor::Cursor &virtualCursor, bool limitToVisible=false)
Definition: katelayoutcache.cpp:404
void viewCacheDebugOutput() const
Definition: katelayoutcache.cpp:476
int viewCacheLineCount() const
Definition: katelayoutcache.cpp:364
void updateViewCache(const KTextEditor::Cursor &startPos, int newViewLineCount=-1, int viewLinesScrolled=0)
Definition: katelayoutcache.cpp:159
const KShortcut & end()
virtual void setColumn(int column)
int column() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:31:52 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:31:52 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.