aboutsummaryrefslogtreecommitdiffstats
path: root/gui/pythontab.h
blob: 52a8ff8dbee2a0ed76bbcef0ff464f13f2859583 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef PYTHONTAB_H
#define PYTHONTAB_H

#include <QLineEdit>
#include <QMenu>
#include <QPlainTextEdit>
#include "emb.h"
#include "line_editor.h"
#include "nextpnr.h"

NEXTPNR_NAMESPACE_BEGIN

class PythonTab : public QWidget
{
    Q_OBJECT

  public:
    explicit PythonTab(QWidget *parent = 0);

  private:
    void print(std::string line);
    int executePython(std::string &command);
  private Q_SLOTS:
    void editLineReturnPressed(QString text);
    void showContextMenu(const QPoint &pt);
    void clearBuffer();

  private:
    QPlainTextEdit *plainTextEdit;
    LineEditor *lineEdit;
    QMenu *contextMenu;
    emb::stdout_write_type write;
};

NEXTPNR_NAMESPACE_END

#endif // PYTHONTAB_H