20 #ifndef __KATE_BUFFER_H__
21 #define __KATE_BUFFER_H__
23 #include "katetextline.h"
24 #include "katecodefoldinghelpers.h"
26 #include <kvmallocator.h>
28 #include <tqptrlist.h>
31 #include <tqvaluevector.h>
35 class KateHighlighting;
62 KateFileLoader *stream = 0 );
74 void fillBlock (KateFileLoader *stream);
141 inline uint
endLine ()
const {
return m_startLine + m_lines; }
147 inline uint
lines ()
const {
return m_lines; }
195 KVMAllocator::Block *m_vmblock;
205 TQValueVector<KateTextLine::Ptr> m_stringList;
261 inline uint
count()
const {
return m_count; }
303 buf->list->removeInternal (buf);
364 static uint m_maxLoadedBlocks;
418 uint editSessionNumber;
428 uint editTagLineStart;
438 bool editTagLineFrom;
443 bool editChangesDone;
456 bool openFile (
const TQString &m_file);
469 bool binary ()
const {
return m_binary; }
482 bool saveFile (
const TQString &m_file);
494 if (i < m_lineHighlighted)
497 return line_internal (buf, i);
506 inline void addIndentBasedFoldingInformation(TQMemArray<uint> &foldingList,
bool addindent,uint deindent);
507 inline void updatePreviousNotEmptyLine(
KateBufBlock *blk,uint current_line,
bool addindent,uint deindent);
524 inline uint
count()
const {
return m_lines; }
538 if ((m_blocks[m_lastFoundBlock]->
startLine() <= i) && (m_blocks[m_lastFoundBlock]->
endLine() > i))
541 (*index) = m_lastFoundBlock;
543 return m_blocks[m_lastFoundBlock];
546 return findBlock_internal (i, index);
549 KateBufBlock *findBlock_internal (uint i, uint *index = 0);
568 inline uint countVisible () {
return m_lines - m_regionTree.getHiddenLinesCount(m_lines); }
570 inline uint lineNumber (uint visibleLine) {
return m_regionTree.getRealLine (visibleLine); }
572 inline uint lineVisibleNumber (uint
line) {
return m_regionTree.getVirtualLine (line); }
574 inline void lineInfo (KateLineInfo *info,
unsigned int line) { m_regionTree.getLineInfo(info,line); }
576 inline uint tabWidth ()
const {
return m_tabWidth; }
579 void setTabWidth (uint w);
589 KateHighlighting *highlight () {
return m_highlight; };
596 KateCodeFoldingTree *foldingTree () {
return &m_regionTree; };
599 void codeFoldingColumnUpdate(
unsigned int lineNr);
614 bool doHighlight (
KateBufBlock *buf, uint from, uint to,
bool invalidate);
643 TQValueVector<KateBufBlock*> m_blocks;
648 uint m_lastInSyncBlock;
653 uint m_lastFoundBlock;
659 bool m_cacheReadError;
660 bool m_cacheWriteError;
665 bool m_loadingBorked;
679 KateHighlighting *m_highlight;
684 KateCodeFoldingTree m_regionTree;
689 uint m_lineHighlightedMax;
690 uint m_lineHighlighted;
695 uint m_maxDynamicContexts;