You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kdbg/kdbg/mainwndbase.h

154 lines
4.4 KiB

11 years ago
/*
* Copyright Johannes Sixt
* This file is licensed under the GNU General Public License Version 2.
* See the file COPYING in the toplevel directory of the source directory.
*/
#ifndef MAINWNDBASE_H
#define MAINWNDBASE_H
#include <tqlineedit.h>
#include <tqlayout.h>
#include <tqpushbutton.h>
#include <tqcstring.h>
11 years ago
#include "exprwnd.h"
#include "sys/types.h" /* pid_t */
// forward declarations
class KDebugger;
class TTYWindow;
class UpdateUI;
class TDEToolBar;
11 years ago
class KStatusBar;
class TDEProcess;
11 years ago
class DebuggerDriver;
class WatchWindow : public TQWidget
11 years ago
{
TQ_OBJECT
11 years ago
public:
WatchWindow(TQWidget* parent, const char* name, WFlags f = 0);
11 years ago
~WatchWindow();
ExprWnd* watchVariables() { return &m_watchVariables; }
TQString watchText() const { return m_watchEdit.text(); }
11 years ago
int columnWidth(int i) const { return m_watchVariables.columnWidth(i); }
void setColumnWidth(int i, int w) { m_watchVariables.setColumnWidth(i, w); }
protected:
TQLineEdit m_watchEdit;
TQPushButton m_watchAdd;
TQPushButton m_watchDelete;
11 years ago
ExprWnd m_watchVariables;
TQVBoxLayout m_watchV;
TQHBoxLayout m_watchH;
11 years ago
virtual bool eventFilter(TQObject* ob, TQEvent* ev);
virtual void dragEnterEvent(TQDragEnterEvent* event);
virtual void dropEvent(TQDropEvent* event);
11 years ago
signals:
void addWatch();
void deleteWatch();
void textDropped(const TQString& text);
11 years ago
protected slots:
void slotWatchHighlighted();
};
class DebuggerMainWndBase
{
public:
DebuggerMainWndBase();
virtual ~DebuggerMainWndBase();
/**
* Sets the command to invoke the terminal that displays the program
* output. If cmd is the empty string, the default is substituted.
*/
void setTerminalCmd(const TQString& cmd);
11 years ago
/**
* Sets the command to invoke the debugger.
*/
void setDebuggerCmdStr(const TQString& cmd);
11 years ago
/**
* Specifies the file where to write the transcript.
*/
void setTranscript(const TQString& name);
11 years ago
/**
* Starts to debug the specified program using the specified language
* driver.
*/
bool debugProgram(const TQString& executable, TQString lang, TQWidget* parent);
11 years ago
/**
* Specifies the process to attach to after the program is loaded.
*/
void setAttachPid(const TQString& pid);
11 years ago
// the following are needed to handle program arguments
void setCoreFile(const TQString& corefile);
void setRemoteDevice(const TQString &remoteDevice);
void overrideProgramArguments(const TQString& args);
11 years ago
/** helper around KFileDialog */
static TQString myGetFileName(TQString caption,
TQString dir, TQString filter,
TQWidget* parent);
11 years ago
/** invokes the global options dialog */
virtual void doGlobalOptions(TQWidget* parent);
11 years ago
protected:
// settings
virtual void saveSettings(TDEConfig*);
virtual void restoreSettings(TDEConfig*);
11 years ago
// override must return the integrated output window
virtual TTYWindow* ttyWindow() = 0;
// statusbar texts
TQString m_statusActive;
11 years ago
// output window
TQString m_outputTermCmdStr;
TQString m_outputTermKeepScript;
TDEProcess* m_outputTermProc;
11 years ago
int m_ttyLevel;
virtual TQString createOutputWindow(); /* returns terminal name */
11 years ago
void shutdownTermWindow();
TQString m_lastDirectory; /* the dir of the most recently opened file */
11 years ago
TQString m_transcriptFile; /* where gdb dialog is logged */
11 years ago
bool m_popForeground; /* whether main wnd raises when prog stops */
int m_backTimeout; /* when wnd goes back */
int m_tabWidth; /* tab width in characters (can be 0) */
TQString m_sourceFilter;
TQString m_headerFilter;
11 years ago
// the debugger proper
TQString m_debuggerCmdStr;
11 years ago
KDebugger* m_debugger;
void setupDebugger(TQWidget* parent,
11 years ago
ExprWnd* localVars,
ExprWnd* watchVars,
TQListBox* backtrace);
DebuggerDriver* driverFromLang(TQString lang);
11 years ago
/**
* This function derives a driver name from the contents of the named
* file.
*/
TQString driverNameFromFile(const TQString& exe);
11 years ago
public:
/*
* Important! The following functions must be overridden in derived
* classes and be declared as slots! Note: These must not be declared
* virtual here since TQt signal mechanism fails miserably (because this
11 years ago
* class will not be the left-most base class!).
*/
void newStatusMsg(KStatusBar* statusbar);
void slotDebuggerStarting();
};
#endif // MAINWNDBASE_H