3 // Copyright by Johannes Sixt
4 // This file is under GPL, the GNU General Public Licence
11 #include <qpushbutton.h>
13 #include "sys/types.h" /* pid_t */
15 // forward declarations
23 class WatchWindow
: public QWidget
27 WatchWindow(QWidget
* parent
, const char* name
, WFlags f
= 0);
29 ExprWnd
* watchVariables() { return &m_watchVariables
; }
30 QString
watchText() const { return m_watchEdit
.text(); }
33 QLineEdit m_watchEdit
;
34 QPushButton m_watchAdd
;
35 QPushButton m_watchDelete
;
36 ExprWnd m_watchVariables
;
40 virtual bool eventFilter(QObject
* ob
, QEvent
* ev
);
47 void slotWatchHighlighted(int);
51 class DebuggerMainWndBase
54 DebuggerMainWndBase();
55 virtual ~DebuggerMainWndBase();
58 * Sets the command to invoke the terminal that displays the program
59 * output. If cmd is the empty string, the default is substituted.
61 void setTerminalCmd(const QString
& cmd
);
63 * Sets the command to invoke the debugger.
65 void setDebuggerCmdStr(const QString
& cmd
);
67 * Specifies the file where to write the transcript.
69 void setTranscript(const char* name
);
71 // the following are needed to handle program arguments
72 bool debugProgram(const QString
& executable
);
73 void setCoreFile(const QString
& corefile
);
74 void setRemoteDevice(const QString
&remoteDevice
);
75 /** helper around KFileDialog */
76 static QString
myGetFileName(QString caption
,
77 QString dir
, QString filter
,
79 /** invokes the global options dialog */
80 virtual void doGlobalOptions(QWidget
* parent
);
81 /** add recent executable; moves it to top of list if present */
82 void addRecentExec(const QString
& executable
);
83 /** remove recent executable */
84 void removeRecentExec(const QString
& executable
);
85 /** start a new session; error popups appear on errors */
86 bool debugProgramInteractive(const QString
& executable
, QWidget
* parent
);
90 virtual void saveSettings(KConfig
*);
91 virtual void restoreSettings(KConfig
*);
93 // override must return the toolbar containing the animation and
95 virtual KToolBar
* dbgToolBar() = 0;
96 // override must return the statusbar
97 virtual KStatusBar
* dbgStatusBar() = 0;
98 // override must return the integrated output window
99 virtual TTYWindow
* ttyWindow() = 0;
102 QString m_statusActive
;
105 QList
<QPixmap
> m_animation
;
106 uint m_animationCounter
;
107 void initAnimation();
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 // recent execs in File menu
128 QStrList m_recentExecList
;
130 // the debugger proper
131 QString m_debuggerCmdStr
;
132 KDebugger
* m_debugger
;
133 void setupDebugger(QWidget
* parent
,
136 QListBox
* backtrace
);
140 * Important! The following functions must be overridden in derived
141 * classes and be declared as slots! Note: These must not be declared
142 * virtual here since Qt signal mechanism fails miserably (because this
143 * class will not be the left-most base class!).
145 void updateUIItem(UpdateUI
* item
);
146 void updateLineItems();
147 void slotNewStatusMsg();
148 void slotAnimationTimeout();
149 void slotDebuggerStarting();
152 #endif // MAINWNDBASE_H