2 Author: Marco Costalba (C) 2005-2007
4 Copyright: See COPYING file that comes with this distribution
12 #include <QSyntaxHighlighter>
20 class DiffHighlighter
: public QSyntaxHighlighter
{
22 DiffHighlighter(QTextEdit
* p
) : QSyntaxHighlighter(p
), cl(0) {}
23 void setCombinedLength(uint c
) { cl
= c
; }
24 virtual void highlightBlock(const QString
& text
);
29 class PatchContent
: public QTextEdit
{
32 PatchContent(QWidget
* parent
);
33 void setup(Domain
* parent
, Git
* git
);
35 void centerOnFileHeader(StateInfo
& st
);
37 void update(StateInfo
& st
);
44 PatchFilter curFilter
, prevFilter
;
47 void on_highlightPatch(const QString
&, bool);
48 void typeWriterFontChanged();
49 void procReadyRead(const QByteArray
& data
);
53 friend class DiffHighlighter
;
55 void scrollCursorToTop();
56 void scrollLineToTop(int lineNum
);
57 int positionToLineNum(int pos
);
59 void saveRestoreSizes(bool startup
= false);
60 int doSearch(const QString
& txt
, int pos
);
61 bool computeMatches();
62 bool getMatch(int para
, int* indexFrom
, int* indexTo
);
63 void centerMatch(int id
= 0);
64 bool centerTarget(SCRef target
);
65 void processData(const QByteArray
& data
, int* prevLineNum
= NULL
);
68 DiffHighlighter
* diffHighlighter
;
69 QPointer
<MyProcess
> proc
;
71 QByteArray patchRowData
;
78 struct MatchSelection
{
84 typedef QVector
<MatchSelection
> Matches
;