3 // Copyright by Johannes Sixt
4 // This file is under GPL, the GNU General Public Licence
11 #include <qpushbutton.h>
14 #include "sys/types.h" /* pid_t */
16 // forward declarations
25 class WatchWindow
: public QWidget
29 WatchWindow(QWidget
* parent
, const char* name
, WFlags f
= 0);
31 ExprWnd
* watchVariables() { return &m_watchVariables
; }
32 QString
watchText() const { return m_watchEdit
.text(); }
33 int columnWidth(int i
) const { return m_watchVariables
.columnWidth(i
); }
34 void setColumnWidth(int i
, int w
) { m_watchVariables
.setColumnWidth(i
, w
); }
37 QLineEdit m_watchEdit
;
38 QPushButton m_watchAdd
;
39 QPushButton m_watchDelete
;
40 ExprWnd m_watchVariables
;
44 virtual bool eventFilter(QObject
* ob
, QEvent
* ev
);
45 virtual void dragEnterEvent(QDragEnterEvent
* event
);
46 virtual void dropEvent(QDropEvent
* event
);
51 void textDropped(const QString
& text
);
54 void slotWatchHighlighted();
58 class DebuggerMainWndBase
61 DebuggerMainWndBase();
62 virtual ~DebuggerMainWndBase();
65 * Sets the command to invoke the terminal that displays the program
66 * output. If cmd is the empty string, the default is substituted.
68 void setTerminalCmd(const QString
& cmd
);
70 * Sets the command to invoke the debugger.
72 void setDebuggerCmdStr(const QString
& cmd
);
74 * Specifies the file where to write the transcript.
76 void setTranscript(const char* name
);
78 * Starts to debug the specified program using the specified language
81 bool debugProgram(const QString
& executable
, QCString lang
, QWidget
* parent
);
83 * Specifies the process to attach to after the program is loaded.
85 void setAttachPid(const QString
& pid
);
87 // the following are needed to handle program arguments
88 void setCoreFile(const QString
& corefile
);
89 void setRemoteDevice(const QString
&remoteDevice
);
90 /** helper around KFileDialog */
91 static QString
myGetFileName(QString caption
,
92 QString dir
, QString filter
,
94 /** invokes the global options dialog */
95 virtual void doGlobalOptions(QWidget
* parent
);
99 virtual void saveSettings(KConfig
*);
100 virtual void restoreSettings(KConfig
*);
102 // override must return the integrated output window
103 virtual TTYWindow
* ttyWindow() = 0;
106 QString m_statusActive
;
109 QString m_outputTermCmdStr
;
110 QString m_outputTermKeepScript
;
111 KProcess
* m_outputTermProc
;
113 virtual QString
createOutputWindow(); /* returns terminal name */
114 void shutdownTermWindow();
116 QString m_lastDirectory
; /* the dir of the most recently opened file */
118 QString m_transcriptFile
; /* where gdb dialog is logged */
120 bool m_popForeground
; /* whether main wnd raises when prog stops */
121 int m_backTimeout
; /* when wnd goes back */
122 int m_tabWidth
; /* tab width in characters (can be 0) */
123 QString m_sourceFilter
;
124 QString m_headerFilter
;
126 // the debugger proper
127 QString m_debuggerCmdStr
;
128 KDebugger
* m_debugger
;
129 void setupDebugger(QWidget
* parent
,
132 QListBox
* backtrace
);
133 DebuggerDriver
* driverFromLang(QCString lang
);
135 * This function derives a driver name from the contents of the named
138 QCString
driverNameFromFile(const QString
& exe
);
142 * Important! The following functions must be overridden in derived
143 * classes and be declared as slots! Note: These must not be declared
144 * virtual here since Qt signal mechanism fails miserably (because this
145 * class will not be the left-most base class!).
147 void newStatusMsg(KStatusBar
* statusbar
);
148 void slotDebuggerStarting();
151 #endif // MAINWNDBASE_H