2 * Copyright Johannes Sixt
3 * This file is licensed under the GNU General Public License Version 2.
4 * See the file COPYING in the toplevel directory of the source directory.
12 #include <qlineedit.h>
14 #include <qcheckbox.h>
15 #include <qpushbutton.h>
17 #include <ktabwidget.h>
20 // forward declarations
24 class DisassembledCode
;
27 class FindDialog
: public QDialog
34 bool caseSensitive() const { return m_caseCheck
.isChecked(); }
35 QString
searchText() const { return m_searchText
.text(); }
36 virtual void done(int result
);
38 QLineEdit m_searchText
;
39 QCheckBox m_caseCheck
;
40 QPushButton m_buttonForward
;
41 QPushButton m_buttonBackward
;
42 QPushButton m_buttonClose
;
48 virtual void closeEvent(QCloseEvent
* ev
);
50 QHBoxLayout m_buttons
;
54 class ValueTip
: public QToolTip
57 ValueTip(WinStack
* parent
);
58 virtual ~ValueTip() {} // Qt3's QToolTip lacks virtual dtor!
59 virtual void maybeTip(const QPoint
& p
);
60 void tip(const QRect
& r
, const QString
& s
) { QToolTip::tip(r
, s
); }
64 class WinStack
: public KTabWidget
68 WinStack(QWidget
* parent
, const char* name
);
72 * Slot activate also looks in this directory when the specified file is
75 void setExtraDirectory(const QString
& dir
) { m_lastOpenDir
= dir
; }
76 void activateFile(const QString
& fileName
);
77 bool activeLine(QString
& filename
, int& lineNo
);
78 bool activeLine(QString
& filename
, int& lineNo
, DbgAddr
& address
);
79 void maybeTip(const QPoint
& p
);
80 bool hasWindows() const { return m_fileList
.size() > 0; }
81 QString
activeFileName() const;
82 SourceWindow
* activeWindow() const;
84 virtual QSize
sizeHint() const;
88 void toggleBreak(const QString
&, int, const DbgAddr
&, bool);
89 void enadisBreak(const QString
&, int, const DbgAddr
&);
91 void initiateValuePopup(const QString
&);
92 void disassemble(const QString
&, int);
93 void setTabWidth(int numChars
);
94 void moveProgramCounter(const QString
&, int, const DbgAddr
&);
97 virtual void slotFindForward();
98 virtual void slotFindBackward();
99 virtual void activate(const QString
& filename
, int lineNo
, const DbgAddr
& address
);
100 void updatePC(const QString
& filename
, int lineNo
, const DbgAddr
& address
, int frameNo
);
101 void reloadAllFiles();
102 void updateLineItems(const KDebugger
* deb
);
103 void slotSetTabWidth(int numChars
);
105 void slotFileReload();
108 void slotBrkptSetTemp();
109 void slotBrkptEnable();
110 void slotMoveProgramCounter();
112 // Displays the value tip at m_tipLocation
113 void slotShowValueTip(const QString
& tipText
);
115 // Shows the disassembled code at the location given by file and lineNo
116 void slotDisassembled(const QString
& fileName
, int lineNo
,
117 const QList
<DisassembledCode
>& disass
);
119 // Updates line items after expanding/collapsing disassembled code
120 void slotExpandCollapse(int lineNo
);
123 bool activatePath(QString pathname
, int lineNo
, const DbgAddr
& address
);
124 virtual bool activateWindow(SourceWindow
* fw
, int lineNo
, const DbgAddr
& address
); /* -1 doesnt change line */
125 virtual void contextMenuEvent(QContextMenuEvent
* e
);
126 void setPC(bool set
, const QString
& fileName
, int lineNo
,
127 const DbgAddr
& address
, int frameNo
);
128 SourceWindow
* findByFileName(const QString
& fileName
) const;
129 ValArray
<SourceWindow
*> m_fileList
;
130 QString m_lastOpenDir
; /* where user opened last file */
134 int m_pcLine
; /* -1 if no PC */
135 QString m_pcAddress
; /* exact address of PC */
139 QRect m_tipLocation
; /* where tip should appear */
141 int m_tabWidth
; /* number of chars */
145 FindDialog m_findDlg
;