Pass the result of ExprWind::exprList() in the return value.
[kdbg.git] / kdbg / winstack.h
blobff36d32c19d2a6d5a1a39a3c21e648dfa86c7120
1 /*
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.
5 */
7 #ifndef WINSTACK_H
8 #define WINSTACK_H
10 #include <qptrlist.h>
11 #include <qdialog.h>
12 #include <qlineedit.h>
13 #include <qlayout.h>
14 #include <qcheckbox.h>
15 #include <qpushbutton.h>
16 #include <qpopupmenu.h>
17 #include <qtooltip.h>
18 #include <qvaluevector.h>
20 // forward declarations
21 class KDebugger;
22 class WinStack;
23 class SourceWindow;
24 class DisassembledCode;
25 struct DbgAddr;
27 class FindDialog : public QDialog
29 Q_OBJECT
30 public:
31 FindDialog();
32 ~FindDialog();
34 bool caseSensitive() const { return m_caseCheck.isChecked(); }
35 QString searchText() const { return m_searchText.text(); }
36 virtual void done(int result);
38 QLineEdit m_searchText;
39 QCheckBox m_caseCheck;
40 QPushButton m_buttonForward;
41 QPushButton m_buttonBackward;
42 QPushButton m_buttonClose;
44 signals:
45 void closed();
47 protected:
48 virtual void closeEvent(QCloseEvent* ev);
49 QVBoxLayout m_layout;
50 QHBoxLayout m_buttons;
54 class ValueTip : public QToolTip
56 public:
57 ValueTip(WinStack* parent);
58 virtual ~ValueTip() {} // Qt3's QToolTip lacks virtual dtor!
59 virtual void maybeTip(const QPoint& p);
60 void tip(const QRect& r, const QString& s) { QToolTip::tip(r, s); }
64 class WinStack : public QWidget
66 Q_OBJECT
67 public:
68 WinStack(QWidget* parent, const char* name);
69 virtual ~WinStack();
71 enum { WindowMore=0x100, WindowMask=0xf };
73 /**
74 * The menu set with setWindowMenu will be modified by this widget to
75 * list the available windows. The specified popup menu must be set up
76 * to contain an entry with ID WindowMore. The windows will be inserted
77 * before this entry.
79 void setWindowMenu(QPopupMenu* menu);
80 /**
81 * Slot activate also looks in this directory when the specified file is
82 * a relative path.
84 void setExtraDirectory(const QString& dir) { m_lastOpenDir = dir; }
85 void activateFile(const QString& fileName);
86 bool activeLine(QString& filename, int& lineNo);
87 bool activeLine(QString& filename, int& lineNo, DbgAddr& address);
88 void maybeTip(const QPoint& p);
89 bool hasWindows() const { return m_fileList.size() > 0; }
90 QString activeFileName() const;
92 virtual QSize sizeHint() const;
93 virtual void resizeEvent(QResizeEvent*);
95 signals:
96 void fileChanged();
97 void toggleBreak(const QString&, int, const DbgAddr&, bool);
98 void enadisBreak(const QString&, int, const DbgAddr&);
99 void newFileLoaded();
100 void initiateValuePopup(const QString&);
101 void disassemble(const QString&, int);
102 void setTabWidth(int numChars);
103 void moveProgramCounter(const QString&, int, const DbgAddr&);
105 public slots:
106 void selectWindow(int id); /* 1-based index, 0 means dialog More... */
107 virtual void slotFindForward();
108 virtual void slotFindBackward();
109 virtual void activate(const QString& filename, int lineNo, const DbgAddr& address);
110 void updatePC(const QString& filename, int lineNo, const DbgAddr& address, int frameNo);
111 void reloadAllFiles();
112 void updateLineItems(const KDebugger* deb);
113 void slotSetTabWidth(int numChars);
115 void slotFileReload();
116 void slotViewFind();
117 void slotBrkptSet();
118 void slotBrkptSetTemp();
119 void slotBrkptEnable();
120 void slotMoveProgramCounter();
122 // Displays the value tip at m_tipLocation
123 void slotShowValueTip(const QString& tipText);
125 // Shows the disassembled code at the location given by file and lineNo
126 void slotDisassembled(const QString& fileName, int lineNo,
127 const QList<DisassembledCode>& disass);
129 // Updates line items after expanding/collapsing disassembled code
130 void slotExpandCollapse(int lineNo);
132 protected:
133 bool activatePath(QString pathname, int lineNo, const DbgAddr& address);
134 virtual bool activateWindow(SourceWindow* fw, int lineNo, const DbgAddr& address); /* -1 doesnt change line */
135 virtual void changeWindowMenu();
136 virtual void contextMenuEvent(QContextMenuEvent* e);
137 void setPC(bool set, const QString& fileName, int lineNo,
138 const DbgAddr& address, int frameNo);
139 typedef QValueVector<SourceWindow*> SourceWindowList;
140 SourceWindowList m_fileList;
141 SourceWindow* m_activeWindow;
142 QString m_lastOpenDir; /* where user opened last file */
143 QPopupMenu* m_windowMenu;
145 // program counter
146 QString m_pcFile;
147 int m_pcLine; /* -1 if no PC */
148 QString m_pcAddress; /* exact address of PC */
149 int m_pcFrame;
151 ValueTip m_valueTip;
152 QRect m_tipLocation; /* where tip should appear */
154 int m_tabWidth; /* number of chars */
156 public:
157 // find dialog
158 FindDialog m_findDlg;
161 #endif // WINSTACK_H