MCPcopy Create free account
hub / github.com/KDE/kdiff3 / DiffTextWindow

Class DiffTextWindow

src/difftextwindow.h:48–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46class KDiff3App;
47
48class DiffTextWindow: public QWidget
49{
50 Q_OBJECT
51 public:
52 //Using this as a scoped global
53 static QPointer<QScrollBar> mVScrollBar;
54 static QAtomicInteger<size_t> maxThreads();
55
56 DiffTextWindow(DiffTextWindowFrame* pParent, e_SrcSelector winIdx, KDiff3App& app);
57 ~DiffTextWindow() override;
58 void init(
59 const QString& fileName,
60 const char* pTextCodec,
61 e_LineEndStyle eLineEndStyle,
62 const std::shared_ptr<LineDataVector>& pLineData,
63 LineType size,
64 const Diff3LineVector* pDiff3LineVector,
65 const ManualDiffHelpList* pManualDiffHelpList);
66
67 void setupConnections(const KDiff3App* app);
68
69 void reset();
70 void convertToLinePos(qint32 x, qint32 y, LineRef& line, qint32& pos);
71
72 [[nodiscard]] QString getSelection() const;
73 [[nodiscard]] LineRef getFirstLine() const;
74 LineRef calcTopLineInFile(const LineRef firstLine) const;
75
76 [[nodiscard]] qint32 getMaxTextWidth() const;
77 [[nodiscard]] LineType getNofLines() const;
78 [[nodiscard]] LineType getNofVisibleLines() const;
79 [[nodiscard]] qint32 getVisibleTextAreaWidth() const;
80
81 LineType convertLineToDiff3LineIdx(const LineRef line) const;
82 LineRef convertDiff3LineIdxToLine(const LineType d3lIdx) const;
83
84 void convertD3LCoordsToLineCoords(LineType d3LIdx, qsizetype d3LPos, LineRef& line, qsizetype& pos) const;
85 void convertLineCoordsToD3LCoords(LineRef line, qsizetype pos, LineType& d3LIdx, qsizetype& d3LPos) const;
86
87 void convertSelectionToD3LCoords() const;
88
89 bool findString(const QString& s, LineRef& d3vLine, qsizetype& posInLine, bool bDirDown, bool bCaseSensitive);
90 void setSelection(LineRef firstLine, qsizetype startPos, LineRef lastLine, qsizetype endPos);
91 void getSelectionRange(LineRef* firstLine, LineRef* lastLine, e_CoordType coordType) const;
92
93 void setPaintingAllowed(bool bAllowPainting);
94 void recalcWordWrap(bool bWordWrap, size_t wrapLineVectorSize, qint32 visibleTextWidth);
95
96 void printWindow(RLPainter& painter, const QRect& view, const QString& headerText, qint32 line, const LineType linesPerPage, const QColor& fgColor);
97 void print(RLPainter& painter, const QRect& r, qint32 firstLine, const LineType nofLinesPerPage);
98
99 void draw(RLPainter& p, const QRect& invalidRect, const qint32 beginLine, const LineRef& endLine);
100
101 static bool startRunnables();
102
103 [[nodiscard]] bool isThreeWay() const;
104 [[nodiscard]] const QString& getFileName() const;
105

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected