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(); }
35 QLineEdit m_watchEdit
;
36 QPushButton m_watchAdd
;
37 QPushButton m_watchDelete
;
38 ExprWnd m_watchVariables
;
42 virtual bool eventFilter(QObject
* ob
, QEvent
* ev
);
49 void slotWatchHighlighted(int);
53 class DebuggerMainWndBase
56 DebuggerMainWndBase();
57 virtual ~DebuggerMainWndBase();
60 * Sets the command to invoke the terminal that displays the program
61 * output. If cmd is the empty string, the default is substituted.
63 void setTerminalCmd(const QString
& cmd
);
65 * Sets the command to invoke the debugger.
67 void setDebuggerCmdStr(const QString
& cmd
);
69 * Specifies the file where to write the transcript.
71 void setTranscript(const char* name
);
73 // the following are needed to handle program arguments
74 bool debugProgram(const QString
& executable
, QWidget
* parent
);
75 void setCoreFile(const QString
& corefile
);
76 void setRemoteDevice(const QString
&remoteDevice
);
77 void setLanguage(const QCString
& lang
);
78 /** helper around KFileDialog */
79 static QString
myGetFileName(QString caption
,
80 QString dir
, QString filter
,
82 /** invokes the global options dialog */
83 virtual void doGlobalOptions(QWidget
* parent
);
84 /** add recent executable; moves it to top of list if present */
85 void addRecentExec(const QString
& executable
);
86 /** remove recent executable */
87 void removeRecentExec(const QString
& executable
);
88 /** start a new session; error popups appear on errors */
89 bool debugProgramInteractive(const QString
& executable
, QWidget
* parent
);
93 virtual void saveSettings(KConfig
*);
94 virtual void restoreSettings(KConfig
*);
96 // override must return the toolbar containing the animation and
98 virtual KToolBar
* dbgToolBar() = 0;
99 // override must return the statusbar
100 virtual KStatusBar
* dbgStatusBar() = 0;
101 // override must return the integrated output window
102 virtual TTYWindow
* ttyWindow() = 0;
105 QString m_statusActive
;
108 QList
<QPixmap
> m_animation
;
109 uint m_animationCounter
;
110 void initAnimation();
113 QString m_outputTermCmdStr
;
114 QString m_outputTermKeepScript
;
115 KProcess
* m_outputTermProc
;
117 virtual QString
createOutputWindow(); /* returns terminal name */
118 void shutdownTermWindow();
120 QString m_lastDirectory
; /* the dir of the most recently opened file */
122 QString m_transcriptFile
; /* where gdb dialog is logged */
124 bool m_popForeground
; /* whether main wnd raises when prog stops */
125 int m_backTimeout
; /* when wnd goes back */
126 int m_tabWidth
; /* tab width in characters (can be 0) */
127 QString m_sourceFilter
;
128 QString m_headerFilter
;
130 // recent execs in File menu
131 QStrList m_recentExecList
;
133 // the debugger proper
134 QString m_debuggerCmdStr
;
135 KDebugger
* m_debugger
;
136 void setupDebugger(QWidget
* parent
,
139 QListBox
* backtrace
);
140 // which language are we debugging?
142 static DebuggerDriver
* driverFromLang(const QCString
& lang
);
146 * Important! The following functions must be overridden in derived
147 * classes and be declared as slots! Note: These must not be declared
148 * virtual here since Qt signal mechanism fails miserably (because this
149 * class will not be the left-most base class!).
151 void updateUIItem(UpdateUI
* item
);
152 void updateLineItems();
153 void slotNewStatusMsg();
154 void slotAnimationTimeout();
155 void slotDebuggerStarting();
158 #endif // MAINWNDBASE_H