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 ~ValueTip() {} // Qt3's QToolTip lacks virtual dtor!
58 virtual void maybeTip(const QPoint
& p
);
59 void tip(const QRect
& r
, const QString
& s
) { QToolTip::tip(r
, s
); }
63 class WinStack
: public QWidget
67 WinStack(QWidget
* parent
, const char* name
);
70 enum { WindowMore
=0x100, WindowMask
=0xf };
73 * The menu set with setWindowMenu will be modified by this widget to
74 * list the available windows. The specified popup menu must be set up
75 * to contain an entry with ID WindowMore. The windows will be inserted
78 void setWindowMenu(QPopupMenu
* menu
);
80 * Slot activate also looks in this directory when the specified file is
83 void setExtraDirectory(const QString
& dir
) { m_lastOpenDir
= dir
; }
84 void activateFile(const QString
& fileName
);
85 bool activeLine(QString
& filename
, int& lineNo
);
86 bool activeLine(QString
& filename
, int& lineNo
, DbgAddr
& address
);
87 void maybeTip(const QPoint
& p
);
88 bool hasWindows() const { return m_fileList
.size() > 0; }
89 QString
activeFileName() const;
91 virtual QSize
sizeHint() const;
92 virtual void resizeEvent(QResizeEvent
*);
97 void toggleBreak(const QString
&, int, const DbgAddr
&, bool);
98 void enadisBreak(const QString
&, int, const DbgAddr
&);
100 void initiateValuePopup(const QString
&);
101 void disassemble(const QString
&, int);
102 void setTabWidth(int numChars
);
103 void moveProgramCounter(const QString
&, int, const DbgAddr
&);
106 void selectWindow(int id
); /* 1-based index, 0 means dialog More... */
107 virtual void slotFindForward();
108 virtual void slotFindBackward();
109 virtual void activate(const QString
& filename
, int lineNo
, const DbgAddr
& address
);
110 void updatePC(const QString
& filename
, int lineNo
, const DbgAddr
& address
, int frameNo
);
111 void reloadAllFiles();
112 void updateLineItems(const KDebugger
* deb
);
113 void slotSetTabWidth(int numChars
);
115 void slotFileReload();
118 void slotBrkptSetTemp();
119 void slotBrkptEnable();
120 void slotMoveProgramCounter();
122 // Displays the value tip at m_tipLocation
123 void slotShowValueTip(const QString
& tipText
);
125 // Shows the disassembled code at the location given by file and lineNo
126 void slotDisassembled(const QString
& fileName
, int lineNo
,
127 const QList
<DisassembledCode
>& disass
);
129 // Updates line items after expanding/collapsing disassembled code
130 void slotExpandCollapse(int lineNo
);
133 bool activatePath(QString pathname
, int lineNo
, const DbgAddr
& address
);
134 virtual bool activateWindow(SourceWindow
* fw
, int lineNo
, const DbgAddr
& address
); /* -1 doesnt change line */
135 virtual void changeWindowMenu();
136 virtual void contextMenuEvent(QContextMenuEvent
* e
);
137 void setPC(bool set
, const QString
& fileName
, int lineNo
,
138 const DbgAddr
& address
, int frameNo
);
139 ValArray
<SourceWindow
*> m_fileList
;
140 SourceWindow
* m_activeWindow
;
141 QString m_lastOpenDir
; /* where user opened last file */
142 QPopupMenu
* m_windowMenu
;
146 int m_pcLine
; /* -1 if no PC */
147 QString m_pcAddress
; /* exact address of PC */
151 QRect m_tipLocation
; /* where tip should appear */
153 int m_tabWidth
; /* number of chars */
157 FindDialog m_findDlg
;