nextpnr/gui/pythontab.h

37 lines
724 B
C
Raw Normal View History

2018-06-15 00:53:32 +08:00
#ifndef PYTHONTAB_H
#define PYTHONTAB_H
#include <QLineEdit>
#include <QMenu>
2018-06-15 00:53:32 +08:00
#include <QPlainTextEdit>
2018-06-15 00:53:48 +08:00
#include "emb.h"
2018-06-20 15:42:47 +08:00
#include "line_editor.h"
2018-06-15 00:53:48 +08:00
#include "nextpnr.h"
2018-06-15 00:53:32 +08:00
// FIXME
USING_NEXTPNR_NAMESPACE
class PythonTab : public QWidget
{
Q_OBJECT
public:
explicit PythonTab(QWidget *parent = 0);
private:
2018-06-20 15:42:47 +08:00
void print(std::string line);
int executePython(std::string &command);
2018-06-15 00:53:32 +08:00
private Q_SLOTS:
2018-06-20 15:42:47 +08:00
void editLineReturnPressed(QString text);
void showContextMenu(const QPoint &pt);
void clearBuffer();
2018-06-15 00:53:32 +08:00
private:
QPlainTextEdit *plainTextEdit;
2018-06-20 15:42:47 +08:00
LineEditor *lineEdit;
QMenu *contextMenu;
2018-06-15 00:53:32 +08:00
emb::stdout_write_type write;
};
#endif // PYTHONTAB_H