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.
10 #include <qlineedit.h>
12 #include <qpushbutton.h>
15 #include "sys/types.h" /* pid_t */
17 // forward declarations
26 class WatchWindow
: public QWidget
30 WatchWindow(QWidget
* parent
, const char* name
, WFlags f
= 0);
32 ExprWnd
* watchVariables() { return &m_watchVariables
; }
33 QString
watchText() const { return m_watchEdit
.text(); }
34 int columnWidth(int i
) const { return m_watchVariables
.columnWidth(i
); }
35 void setColumnWidth(int i
, int w
) { m_watchVariables
.setColumnWidth(i
, w
); }
38 QLineEdit m_watchEdit
;
39 QPushButton m_watchAdd
;
40 QPushButton m_watchDelete
;
41 ExprWnd m_watchVariables
;
45 virtual bool eventFilter(QObject
* ob
, QEvent
* ev
);
46 virtual void dragEnterEvent(QDragEnterEvent
* event
);
47 virtual void dropEvent(QDropEvent
* event
);
52 void textDropped(const QString
& text
);
55 void slotWatchHighlighted();
59 class DebuggerMainWndBase
62 DebuggerMainWndBase();
63 virtual ~DebuggerMainWndBase();
66 * Sets the command to invoke the terminal that displays the program
67 * output. If cmd is the empty string, the default is substituted.
69 void setTerminalCmd(const QString
& cmd
);
71 * Sets the command to invoke the debugger.
73 void setDebuggerCmdStr(const QString
& cmd
);
75 * Specifies the file where to write the transcript.
77 void setTranscript(const char* name
);
79 * Starts to debug the specified program using the specified language
82 bool debugProgram(const QString
& executable
, QCString lang
, QWidget
* parent
);
84 * Specifies the process to attach to after the program is loaded.
86 void setAttachPid(const QString
& pid
);
88 // the following are needed to handle program arguments
89 void setCoreFile(const QString
& corefile
);
90 void setRemoteDevice(const QString
&remoteDevice
);
91 /** helper around KFileDialog */
92 static QString
myGetFileName(QString caption
,
93 QString dir
, QString filter
,
95 /** invokes the global options dialog */
96 virtual void doGlobalOptions(QWidget
* parent
);
100 virtual void saveSettings(KConfig
*);
101 virtual void restoreSettings(KConfig
*);
103 // override must return the integrated output window
104 virtual TTYWindow
* ttyWindow() = 0;
107 QString m_statusActive
;
110 QString m_outputTermCmdStr
;
111 QString m_outputTermKeepScript
;
112 KProcess
* m_outputTermProc
;
114 virtual QString
createOutputWindow(); /* returns terminal name */
115 void shutdownTermWindow();
117 QString m_lastDirectory
; /* the dir of the most recently opened file */
119 QString m_transcriptFile
; /* where gdb dialog is logged */
121 bool m_popForeground
; /* whether main wnd raises when prog stops */
122 int m_backTimeout
; /* when wnd goes back */
123 int m_tabWidth
; /* tab width in characters (can be 0) */
124 QString m_sourceFilter
;
125 QString m_headerFilter
;
127 // the debugger proper
128 QString m_debuggerCmdStr
;
129 KDebugger
* m_debugger
;
130 void setupDebugger(QWidget
* parent
,
133 QListBox
* backtrace
);
134 DebuggerDriver
* driverFromLang(QCString lang
);
136 * This function derives a driver name from the contents of the named
139 QCString
driverNameFromFile(const QString
& exe
);
143 * Important! The following functions must be overridden in derived
144 * classes and be declared as slots! Note: These must not be declared
145 * virtual here since Qt signal mechanism fails miserably (because this
146 * class will not be the left-most base class!).
148 void newStatusMsg(KStatusBar
* statusbar
);
149 void slotDebuggerStarting();
152 #endif // MAINWNDBASE_H