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>
18 // forward declarations
22 class DisassembledCode
;
25 class FindDialog
: public QDialog
32 bool caseSensitive() const { return m_caseCheck
.isChecked(); }
33 QString
searchText() const { return m_searchText
.text(); }
34 virtual void done(int result
);
36 QLineEdit m_searchText
;
37 QCheckBox m_caseCheck
;
38 QPushButton m_buttonForward
;
39 QPushButton m_buttonBackward
;
40 QPushButton m_buttonClose
;
46 virtual void closeEvent(QCloseEvent
* ev
);
48 QHBoxLayout m_buttons
;
52 class ValueTip
: public QToolTip
55 ValueTip(WinStack
* parent
);
56 virtual void maybeTip(const QPoint
& p
);
57 void tip(const QRect
& r
, const QString
& s
) { QToolTip::tip(r
, s
); }
61 class WinStack
: public QWidget
65 WinStack(QWidget
* parent
, const char* name
);
68 enum { WindowMore
=0x100, WindowMask
=0xf };
71 * The menu set with setWindowMenu will be modified by this widget to
72 * list the available windows. The specified popup menu must be set up
73 * to contain an entry with ID WindowMore. The windows will be inserted
76 void setWindowMenu(QPopupMenu
* menu
);
78 * Slot activate also looks in this directory when the specified file is
81 void setExtraDirectory(const QString
& dir
) { m_lastOpenDir
= dir
; }
82 void activateFile(const QString
& fileName
);
83 bool activeLine(QString
& filename
, int& lineNo
);
84 bool activeLine(QString
& filename
, int& lineNo
, DbgAddr
& address
);
85 void maybeTip(const QPoint
& p
);
87 virtual void resizeEvent(QResizeEvent
*);
92 void toggleBreak(const QString
&, int, const DbgAddr
&, bool);
93 void enadisBreak(const QString
&, int, const DbgAddr
&);
94 void clickedRight(const QPoint
&);
95 void filesRightClick(const QPoint
&);
97 void initiateValuePopup(const QString
&);
98 void disassemble(const QString
&, int);
99 void setTabWidth(int numChars
);
102 void selectWindow(int id
); /* 1-based index, 0 means dialog More... */
103 virtual void slotFindForward();
104 virtual void slotFindBackward();
105 virtual void activate(const QString
& filename
, int lineNo
, const DbgAddr
& address
);
106 void updatePC(const QString
& filename
, int lineNo
, const DbgAddr
& address
, int frameNo
);
107 void reloadAllFiles();
108 void updateLineItems(const KDebugger
* deb
);
109 void slotSetTabWidth(int numChars
);
111 void slotFileReload();
114 void slotBrkptSetTemp();
115 void slotBrkptEnable();
117 // Displays the value tip at m_tipLocation
118 void slotShowValueTip(const QString
& tipText
);
120 // Shows the disassembled code at the location given by file and lineNo
121 void slotDisassembled(const QString
& fileName
, int lineNo
,
122 const QList
<DisassembledCode
>& disass
);
124 // Updates line items after expanding/collapsing disassembled code
125 void slotExpandCollapse(int lineNo
);
128 bool activatePath(QString pathname
, int lineNo
, const DbgAddr
& address
);
129 virtual bool activateWindow(SourceWindow
* fw
, int lineNo
, const DbgAddr
& address
); /* -1 doesnt change line */
130 virtual void changeWindowMenu();
131 virtual void mousePressEvent(QMouseEvent
*);
132 void setPC(bool set
, const QString
& fileName
, int lineNo
,
133 const DbgAddr
& address
, int frameNo
);
134 QList
<SourceWindow
> m_fileList
;
135 SourceWindow
* m_activeWindow
;
136 QString m_lastOpenDir
; /* where user opened last file */
137 QPopupMenu
* m_windowMenu
;
143 int m_pcLine
; /* -1 if no PC */
144 QString m_pcAddress
; /* exact address of PC */
148 QRect m_tipLocation
; /* where tip should appear */
150 int m_tabWidth
; /* number of chars */
154 FindDialog m_findDlg
;