44 #include <QPlainTextEdit> 70 Fold(
int _start,
int _end, FoldType _type) :
77 bool contains (
int n)
const {
78 return (start <= n) && (n <= end);
93 void sideAreaPaintEvent(QPaintEvent *event);
97 void resizeEvent(QResizeEvent *event);
98 virtual void mouseDoubleClickEvent(QMouseEvent* e);
101 void updateTextBrowserSideAreaWidth();
102 void updateTextBrowserSideArea(
const QRect &,
int);
105 void fold(
Fold& _fold);
106 void unfold(
Fold& _fold);
107 void toggleFold(
int _position);
120 static QString
const startRenderObjectTag_;
121 static QString
const startVertexShaderTag_;
122 static QString
const endVertexShaderTag_;
123 static QString
const startTessControlShaderTag_;
124 static QString
const endTessControlShaderTag_;
125 static QString
const startTessEvalShaderTag_;
126 static QString
const endTessEvalShaderTag_;
127 static QString
const startGeometryShaderTag_;
128 static QString
const endGeometryShaderTag_;
129 static QString
const startFragmentShaderTag_;
130 static QString
const endFragmentShaderTag_;
132 std::vector<Fold> folds_;
142 QWidget(_textBrowser),
143 textBrowser_(_textBrowser)
146 QSize sizeHint()
const {
147 return QSize(textBrowser_->sideAreaWidth(), 0);
151 void paintEvent(QPaintEvent *event) {
152 textBrowser_->sideAreaPaintEvent(event);
bool getFold(int _position, Fold &_fold)
get the _fold corresponding to the document _position
std::map< int, size_t > blockPosToFold_
maps positions in the document to indices in folds_