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
24 extern KStdAccel
* keys
;
27 class WatchWindow
: public QWidget
31 WatchWindow(QWidget
* parent
, const char* name
, WFlags f
= 0);
33 ExprWnd
* watchVariables() { return &m_watchVariables
; }
34 QString
watchText() const { return m_watchEdit
.text(); }
37 QLineEdit m_watchEdit
;
38 QPushButton m_watchAdd
;
39 QPushButton m_watchDelete
;
40 ExprWnd m_watchVariables
;
44 virtual bool eventFilter(QObject
* ob
, QEvent
* ev
);
51 void slotWatchHighlighted(int);
55 class DebuggerMainWndBase
58 DebuggerMainWndBase();
59 virtual ~DebuggerMainWndBase();
62 * Sets the command to invoke the terminal that displays the program
63 * output. If cmd is the empty string, the default is substituted.
65 void setTerminalCmd(const QString
& cmd
);
67 * Sets the command to invoke the debugger.
69 void setDebuggerCmdStr(const QString
& cmd
);
71 * Specifies the file where to write the transcript.
73 void setTranscript(const char* name
);
75 // the following are needed to handle program arguments
76 bool debugProgram(const QString
& executable
);
77 void setCoreFile(const QString
& corefile
);
78 void setRemoteDevice(const QString
&remoteDevice
);
79 /** returns true if the command was handled */
80 bool handleCommand(int item
);
81 /** helper around KFileDialog */
82 static QString
myGetFileName(QString caption
,
83 QString dir
, QString filter
,
85 /** invokes the global options dialog */
86 virtual void doGlobalOptions();
87 /** add recent executable; moves it to top of list if present */
88 void addRecentExec(const QString
& executable
);
89 /** remove recent executable */
90 void removeRecentExec(const QString
& executable
);
91 /** start a new session; error popups appear on errors */
92 bool debugProgramInteractive(const QString
& executable
);
96 virtual void saveSettings(KConfig
*);
97 virtual void restoreSettings(KConfig
*);
99 // override must return the toolbar containing the animation and
101 virtual KToolBar
* dbgToolBar() = 0;
102 // override must return the statusbar
103 virtual KStatusBar
* dbgStatusBar() = 0;
104 // override must return the main window (usually this)
105 virtual QWidget
* dbgMainWnd() = 0;
106 // override must return the integrated output window
107 virtual TTYWindow
* ttyWindow() = 0;
110 QString m_statusActive
;
113 QList
<QPixmap
> m_animation
;
114 uint m_animationCounter
;
115 void initAnimation();
118 QString m_outputTermCmdStr
;
119 QString m_outputTermKeepScript
;
120 KProcess
* m_outputTermProc
;
122 virtual QString
createOutputWindow(); /* returns terminal name */
123 void shutdownTermWindow();
125 QString m_lastDirectory
; /* the dir of the most recently opened file */
127 QString m_transcriptFile
; /* where gdb dialog is logged */
129 bool m_popForeground
; /* whether main wnd raises when prog stops */
130 int m_backTimeout
; /* when wnd goes back */
131 int m_tabWidth
; /* tab width in characters (can be 0) */
132 QString m_sourceFilter
;
133 QString m_headerFilter
;
135 // recent execs in File menu
136 QStrList m_recentExecList
;
138 // the debugger proper
139 QString m_debuggerCmdStr
;
140 KDebugger
* m_debugger
;
141 void setupDebugger(ExprWnd
* localVars
,
143 QListBox
* backtrace
);
147 * Important! The following functions must be overridden in derived
148 * classes and be declared as slots! Note: These must not be declared
149 * virtual here since Qt signal mechanism fails miserably (because this
150 * class will not be the left-most base class!).
152 void updateUIItem(UpdateUI
* item
);
153 void updateLineItems();
154 void slotNewStatusMsg();
155 void slotAnimationTimeout();
156 void slotDebuggerStarting();
159 #endif // MAINWNDBASE_H