3 // Copyright by Johannes Sixt
4 // This file is under GPL, the GNU General Public Licence
11 #include <qlineedit.h>
13 #include <qcheckbox.h>
14 #include <qpushbutton.h>
15 #include <qpopupmenu.h>
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 ValueTip
: public QToolTip
56 ValueTip(WinStack
* parent
);
57 virtual void maybeTip(const QPoint
& p
);
58 void tip(const QRect
& r
, const QString
& s
) { QToolTip::tip(r
, s
); }
62 class WinStack
: public QWidget
66 WinStack(QWidget
* parent
, const char* name
);
69 enum { WindowMore
=0x100, WindowMask
=0xf };
72 * The menu set with setWindowMenu will be modified by this widget to
73 * list the available windows. The specified popup menu must be set up
74 * to contain an entry with ID WindowMore. The windows will be inserted
77 void setWindowMenu(QPopupMenu
* menu
);
79 * Slot activate also looks in this directory when the specified file is
82 void setExtraDirectory(const QString
& dir
) { m_lastOpenDir
= dir
; }
83 void activateFile(const QString
& fileName
);
84 bool activeLine(QString
& filename
, int& lineNo
);
85 bool activeLine(QString
& filename
, int& lineNo
, DbgAddr
& address
);
86 void maybeTip(const QPoint
& p
);
87 bool hasWindows() const { return m_fileList
.size() > 0; }
89 virtual void resizeEvent(QResizeEvent
*);
94 void toggleBreak(const QString
&, int, const DbgAddr
&, bool);
95 void enadisBreak(const QString
&, int, const DbgAddr
&);
96 void clickedRight(const QPoint
&);
97 void filesRightClick(const QPoint
&);
99 void initiateValuePopup(const QString
&);
100 void disassemble(const QString
&, int);
101 void setTabWidth(int numChars
);
102 void moveProgramCounter(const QString
&, int, const DbgAddr
&);
105 void selectWindow(int id
); /* 1-based index, 0 means dialog More... */
106 virtual void slotFindForward();
107 virtual void slotFindBackward();
108 virtual void activate(const QString
& filename
, int lineNo
, const DbgAddr
& address
);
109 void updatePC(const QString
& filename
, int lineNo
, const DbgAddr
& address
, int frameNo
);
110 void reloadAllFiles();
111 void updateLineItems(const KDebugger
* deb
);
112 void slotSetTabWidth(int numChars
);
114 void slotFileReload();
117 void slotBrkptSetTemp();
118 void slotBrkptEnable();
119 void slotMoveProgramCounter();
121 // Displays the value tip at m_tipLocation
122 void slotShowValueTip(const QString
& tipText
);
124 // Shows the disassembled code at the location given by file and lineNo
125 void slotDisassembled(const QString
& fileName
, int lineNo
,
126 const QList
<DisassembledCode
>& disass
);
128 // Updates line items after expanding/collapsing disassembled code
129 void slotExpandCollapse(int lineNo
);
132 bool activatePath(QString pathname
, int lineNo
, const DbgAddr
& address
);
133 virtual bool activateWindow(SourceWindow
* fw
, int lineNo
, const DbgAddr
& address
); /* -1 doesnt change line */
134 virtual void changeWindowMenu();
135 virtual void mousePressEvent(QMouseEvent
*);
136 void setPC(bool set
, const QString
& fileName
, int lineNo
,
137 const DbgAddr
& address
, int frameNo
);
138 ValArray
<SourceWindow
*> m_fileList
;
139 SourceWindow
* m_activeWindow
;
140 QString m_lastOpenDir
; /* where user opened last file */
141 QPopupMenu
* m_windowMenu
;
145 int m_pcLine
; /* -1 if no PC */
146 QString m_pcAddress
; /* exact address of PC */
150 QRect m_tipLocation
; /* where tip should appear */
152 int m_tabWidth
; /* number of chars */
156 FindDialog m_findDlg
;