50 #ifndef TEXTBROWSERWIDGET_HH
51 #define TEXTBROWSERWIDGET_HH
53 #include <QPlainTextEdit>
79 Fold(
int _start,
int _end, FoldType _type) :
86 bool contains (
int n)
const {
87 return (start <= n) && (n <= end);
102 void sideAreaPaintEvent(QPaintEvent *event);
106 void resizeEvent(QResizeEvent *event);
107 virtual void mouseDoubleClickEvent(QMouseEvent* e);
110 void updateTextBrowserSideAreaWidth();
111 void updateTextBrowserSideArea(
const QRect &,
int);
114 void fold(
Fold& _fold);
115 void unfold(
Fold& _fold);
116 void toggleFold(
int _position);
129 static QString
const startRenderObjectTag_;
130 static QString
const startVertexShaderTag_;
131 static QString
const endVertexShaderTag_;
132 static QString
const startTessControlShaderTag_;
133 static QString
const endTessControlShaderTag_;
134 static QString
const startTessEvalShaderTag_;
135 static QString
const endTessEvalShaderTag_;
136 static QString
const startGeometryShaderTag_;
137 static QString
const endGeometryShaderTag_;
138 static QString
const startFragmentShaderTag_;
139 static QString
const endFragmentShaderTag_;
141 std::vector<Fold> folds_;
151 QWidget(_textBrowser),
152 textBrowser_(_textBrowser)
155 QSize sizeHint()
const {
156 return QSize(textBrowser_->sideAreaWidth(), 0);
160 void paintEvent(QPaintEvent *event) {
161 textBrowser_->sideAreaPaintEvent(event);
169 #endif // TEXTBROWSERWIDGET_HH
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_