1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
/***************************************************************************
difftextwindow.h - description
-------------------
begin : Mon Mar 18 2002
copyright : (C) 2002-2007 by Joachim Eibl
email : joachim.eibl at gmx.de
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef DIFFTEXTWINDOW_H
#define DIFFTEXTWINDOW_H
#include "diff.h"
#include <tqwidget.h>
class TQStatusBar;
class OptionDialog;
class DiffTextWindowData;
class DiffTextWindowFrame;
class DiffTextWindow : public TQWidget
{
Q_OBJECT
public:
DiffTextWindow(
DiffTextWindowFrame* pParent,
TQStatusBar* pStatusBar,
OptionDialog* pOptionDialog,
int winIdx
);
~DiffTextWindow();
void init(
const TQString& fileName,
const LineData* pLineData,
int size,
const Diff3LineVector* pDiff3LineVector,
const ManualDiffHelpList* pManualDiffHelpList,
bool bTriple
);
void reset();
void convertToLinePos( int x, int y, int& line, int& pos );
TQString getSelection();
int getFirstLine();
int calcTopLineInFile( int firstLine );
int getNofColumns();
int getNofLines();
int getNofVisibleLines();
int getNofVisibleColumns();
int convertLineToDiff3LineIdx( int line );
int convertDiff3LineIdxToLine( int d3lIdx );
void convertD3LCoordsToLineCoords( int d3LIdx, int d3LPos, int& line, int& pos );
void convertLineCoordsToD3LCoords( int line, int pos, int& d3LIdx, int& d3LPos );
void convertSelectionToD3LCoords();
bool findString( const TQString& s, int& d3vLine, int& posInLine, bool bDirDown, bool bCaseSensitive );
void setSelection( int firstLine, int startPos, int lastLine, int endPos, int& l, int& p );
void getSelectionRange( int* firstLine, int* lastLine, e_CoordType coordType );
void setPaintingAllowed( bool bAllowPainting );
void recalcWordWrap( bool bWordWrap, int wrapLineVectorSize, int nofVisibleColumns );
void print( MyPainter& painter, const TQRect& r, int firstLine, int nofLinesPerPage );
signals:
void resizeSignal( int nofVisibleColumns, int nofVisibleLines );
void scroll( int deltaX, int deltaY );
void newSelection();
void selectionEnd();
void setFastSelectorLine( int line );
void gotFocus();
void lineClicked( int winIdx, int line );
public slots:
void setFirstLine( int line );
void setFirstColumn( int col );
void resetSelection();
void setFastSelectorRange( int line1, int nofLines );
protected:
virtual void mousePressEvent ( TQMouseEvent * );
virtual void mouseReleaseEvent ( TQMouseEvent * );
virtual void mouseMoveEvent ( TQMouseEvent * );
virtual void mouseDoubleClickEvent ( TQMouseEvent * e );
virtual void paintEvent( TQPaintEvent* );
virtual void dragEnterEvent( TQDragEnterEvent* e );
virtual void focusInEvent( TQFocusEvent* e );
virtual void resizeEvent( TQResizeEvent* );
virtual void timerEvent(TQTimerEvent*);
private:
DiffTextWindowData* d;
void showStatusLine( int line );
friend class DiffTextWindowFrame;
};
class DiffTextWindowFrameData;
class DiffTextWindowFrame : public TQWidget
{
Q_OBJECT
public:
DiffTextWindowFrame( TQWidget* pParent, TQStatusBar* pStatusBar, OptionDialog* pOptionDialog, int winIdx );
~DiffTextWindowFrame();
DiffTextWindow* getDiffTextWindow();
void init();
void setFirstLine(int firstLine);
signals:
void fileNameChanged(const TQString&, int);
protected:
bool eventFilter( TQObject*, TQEvent* );
private slots:
void slotReturnPressed();
void slotBrowseButtonClicked();
private:
DiffTextWindowFrameData* d;
};
#endif
|