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.
13 #include <QPushButton>
14 #include <QHBoxLayout>
15 #include <QVBoxLayout>
19 // forward declarations
23 class DisassembledCode
;
26 class FindDialog
: public QDialog
33 bool caseSensitive() const { return m_caseCheck
.isChecked(); }
34 QString
searchText() const { return m_searchText
.text(); }
35 virtual void done(int result
);
37 QLineEdit m_searchText
;
38 QCheckBox m_caseCheck
;
39 QPushButton m_buttonForward
;
40 QPushButton m_buttonBackward
;
41 QPushButton m_buttonClose
;
47 virtual void closeEvent(QCloseEvent
* ev
);
49 QHBoxLayout m_buttons
;
53 class WinStack
: public QTabWidget
57 WinStack(QWidget
* parent
);
61 * Slot activate also looks in this directory when the specified file is
64 void setExtraDirectory(const QString
& dir
) { m_lastOpenDir
= dir
; }
65 void activateFile(const QString
& fileName
);
66 bool activeLine(QString
& filename
, int& lineNo
);
67 bool activeLine(QString
& filename
, int& lineNo
, DbgAddr
& address
);
68 bool hasWindows() const { return count() > 0; }
69 QString
activeFileName() const;
70 SourceWindow
* activeWindow() const;
71 SourceWindow
* windowAt(int i
) const;
73 virtual QSize
sizeHint() const;
76 void toggleBreak(const QString
&, int, const DbgAddr
&, bool);
77 void enadisBreak(const QString
&, int, const DbgAddr
&);
79 void initiateValuePopup(const QString
&);
80 void disassemble(const QString
&, int);
81 void setTabWidth(int numChars
);
82 void moveProgramCounter(const QString
&, int, const DbgAddr
&);
85 virtual void slotFindForward();
86 virtual void slotFindBackward();
87 virtual void activate(const QString
& filename
, int lineNo
, const DbgAddr
& address
);
88 void updatePC(const QString
& filename
, int lineNo
, const DbgAddr
& address
, int frameNo
);
89 void reloadAllFiles();
90 void updateLineItems(const KDebugger
* deb
);
91 void slotSetTabWidth(int numChars
);
93 void slotFileReload();
96 void slotBrkptSetTemp();
97 void slotBrkptEnable();
98 void slotMoveProgramCounter();
100 void slotCloseTab(int tab
);
102 // Displays the value tip at m_tipLocation
103 void slotShowValueTip(const QString
& tipText
);
105 // Shows the disassembled code at the location given by file and lineNo
106 void slotDisassembled(const QString
& fileName
, int lineNo
,
107 const std::list
<DisassembledCode
>& disass
);
109 // Updates line items after expanding/collapsing disassembled code
110 void slotExpandCollapse(int lineNo
);
113 bool activatePath(QString pathname
, int lineNo
, const DbgAddr
& address
);
114 virtual bool activateWindow(SourceWindow
* fw
, int lineNo
, const DbgAddr
& address
); /* -1 doesnt change line */
115 virtual void contextMenuEvent(QContextMenuEvent
* e
);
116 virtual bool event(QEvent
* event
);
117 void setPC(bool set
, const QString
& fileName
, int lineNo
,
118 const DbgAddr
& address
, int frameNo
);
119 SourceWindow
* findByFileName(const QString
& fileName
) const;
120 QString m_lastOpenDir
; /* where user opened last file */
124 int m_pcLine
; /* -1 if no PC */
125 QString m_pcAddress
; /* exact address of PC */
128 QPoint m_tipLocation
; /* where tip should appear */
129 QRect m_tipRegion
; /* where tip should remain */
131 int m_tabWidth
; /* number of chars */
135 FindDialog m_findDlg
;