aboutsummaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2018-06-05 21:03:06 +0200
committerMiodrag Milanovic <mmicko@gmail.com>2018-06-05 21:03:06 +0200
commit7cb42f4368e873e5930cf84bc2494a8e8172a046 (patch)
treeed773278240546b1b525c066b95a4e69150aabf1 /gui
parentbd08f9e698269764d9e06052470d4a699f69f951 (diff)
downloadnextpnr-7cb42f4368e873e5930cf84bc2494a8e8172a046.tar.gz
nextpnr-7cb42f4368e873e5930cf84bc2494a8e8172a046.tar.bz2
nextpnr-7cb42f4368e873e5930cf84bc2494a8e8172a046.zip
Initial GUI work
Diffstat (limited to 'gui')
-rw-r--r--gui/Qt5Customizations.cmake60
-rw-r--r--gui/emb.cc150
-rw-r--r--gui/emb.h21
-rw-r--r--gui/fpgaviewwidget.cc153
-rw-r--r--gui/fpgaviewwidget.h43
-rw-r--r--gui/gui.cmake26
-rw-r--r--gui/mainwindow.cc87
-rw-r--r--gui/mainwindow.h30
-rw-r--r--gui/mainwindow.ui210
-rw-r--r--gui/nextpnr.qrc8
-rw-r--r--gui/resources/exit.pngbin0 -> 2360 bytes
-rw-r--r--gui/resources/new.pngbin0 -> 1136 bytes
-rw-r--r--gui/resources/open.pngbin0 -> 2051 bytes
-rw-r--r--gui/resources/save.pngbin0 -> 1391 bytes
14 files changed, 788 insertions, 0 deletions
diff --git a/gui/Qt5Customizations.cmake b/gui/Qt5Customizations.cmake
new file mode 100644
index 00000000..39d3a644
--- /dev/null
+++ b/gui/Qt5Customizations.cmake
@@ -0,0 +1,60 @@
+include(CMakeParseArguments)
+
+# qt5_wrap_ui_custom(outfiles inputfile ... )
+
+function(QT5_WRAP_UI_CUSTOM outfiles )
+ set(options)
+ set(oneValueArgs)
+ set(multiValueArgs OPTIONS)
+
+ cmake_parse_arguments(_WRAP_UI "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+
+ set(ui_files ${_WRAP_UI_UNPARSED_ARGUMENTS})
+ set(ui_options ${_WRAP_UI_OPTIONS})
+
+ foreach(it ${ui_files})
+ get_filename_component(outfile ${it} NAME_WE)
+ get_filename_component(infile ${it} ABSOLUTE)
+ set(outfile ${CMAKE_CURRENT_BINARY_DIR}/generated/ui_${outfile}.h)
+ add_custom_command(OUTPUT ${outfile}
+ COMMAND ${Qt5Widgets_UIC_EXECUTABLE}
+ ARGS ${ui_options} -o ${outfile} ${infile}
+ MAIN_DEPENDENCY ${infile} VERBATIM)
+ list(APPEND ${outfiles} ${outfile})
+ endforeach()
+ set(${outfiles} ${${outfiles}} PARENT_SCOPE)
+endfunction()
+
+# qt5_add_resources_custom(outfiles inputfile ... )
+
+function(QT5_ADD_RESOURCES_CUSTOM outfiles )
+
+ set(options)
+ set(oneValueArgs)
+ set(multiValueArgs OPTIONS)
+
+ cmake_parse_arguments(_RCC "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+
+ set(rcc_files ${_RCC_UNPARSED_ARGUMENTS})
+ set(rcc_options ${_RCC_OPTIONS})
+
+ if("${rcc_options}" MATCHES "-binary")
+ message(WARNING "Use qt5_add_binary_resources for binary option")
+ endif()
+
+ foreach(it ${rcc_files})
+ get_filename_component(outfilename ${it} NAME_WE)
+ get_filename_component(infile ${it} ABSOLUTE)
+ set(outfile ${CMAKE_CURRENT_BINARY_DIR}/generated/qrc_${outfilename}.cc)
+
+ _QT5_PARSE_QRC_FILE(${infile} _out_depends _rc_depends)
+
+ add_custom_command(OUTPUT ${outfile}
+ COMMAND ${Qt5Core_RCC_EXECUTABLE}
+ ARGS ${rcc_options} --name ${outfilename} --output ${outfile} ${infile}
+ MAIN_DEPENDENCY ${infile}
+ DEPENDS ${_rc_depends} "${out_depends}" VERBATIM)
+ list(APPEND ${outfiles} ${outfile})
+ endforeach()
+ set(${outfiles} ${${outfiles}} PARENT_SCOPE)
+endfunction() \ No newline at end of file
diff --git a/gui/emb.cc b/gui/emb.cc
new file mode 100644
index 00000000..59915111
--- /dev/null
+++ b/gui/emb.cc
@@ -0,0 +1,150 @@
+//
+// Copyright (C) 2011 Mateusz Loskot <mateusz@loskot.net>
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// Blog article: http://mateusz.loskot.net/?p=2819
+
+#include <functional>
+#include <iostream>
+#include <string>
+#include <Python.h>
+#include "emb.h"
+
+namespace emb
+{
+struct Stdout
+{
+ PyObject_HEAD
+ stdout_write_type write;
+};
+
+PyObject* Stdout_write(PyObject* self, PyObject* args)
+{
+ std::size_t written(0);
+ Stdout* selfimpl = reinterpret_cast<Stdout*>(self);
+ if (selfimpl->write)
+ {
+ char* data;
+ if (!PyArg_ParseTuple(args, "s", &data))
+ return 0;
+
+ std::string str(data);
+ selfimpl->write(str);
+ written = str.size();
+ }
+ return PyLong_FromSize_t(written);
+}
+
+PyObject* Stdout_flush(PyObject* self, PyObject* args)
+{
+ // no-op
+ return Py_BuildValue("");
+}
+
+PyMethodDef Stdout_methods[] =
+{
+ {"write", Stdout_write, METH_VARARGS, "sys.stdout.write"},
+ {"flush", Stdout_flush, METH_VARARGS, "sys.stdout.write"},
+ {0, 0, 0, 0} // sentinel
+};
+
+PyTypeObject StdoutType =
+{
+ PyVarObject_HEAD_INIT(0, 0)
+ "emb.StdoutType", /* tp_name */
+ sizeof(Stdout), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_reserved */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT, /* tp_flags */
+ "emb.Stdout objects", /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ Stdout_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+};
+
+PyModuleDef embmodule =
+{
+ PyModuleDef_HEAD_INIT,
+ "emb", 0, -1, 0,
+};
+
+// Internal state
+PyObject* g_stdout;
+PyObject* g_stdout_saved;
+
+PyMODINIT_FUNC PyInit_emb(void)
+{
+ g_stdout = 0;
+ g_stdout_saved = 0;
+
+ StdoutType.tp_new = PyType_GenericNew;
+ if (PyType_Ready(&StdoutType) < 0)
+ return 0;
+
+ PyObject* m = PyModule_Create(&embmodule);
+ if (m)
+ {
+ Py_INCREF(&StdoutType);
+ PyModule_AddObject(m, "Stdout", reinterpret_cast<PyObject*>(&StdoutType));
+ }
+ return m;
+}
+
+void set_stdout(stdout_write_type write)
+{
+ if (!g_stdout)
+ {
+ g_stdout_saved = PySys_GetObject("stdout"); // borrowed
+ g_stdout = StdoutType.tp_new(&StdoutType, 0, 0);
+ }
+
+ Stdout* impl = reinterpret_cast<Stdout*>(g_stdout);
+ impl->write = write;
+ PySys_SetObject("stdout", g_stdout);
+}
+
+void reset_stdout()
+{
+ if (g_stdout_saved)
+ PySys_SetObject("stdout", g_stdout_saved);
+
+ Py_XDECREF(g_stdout);
+ g_stdout = 0;
+}
+
+void append_inittab()
+{
+ PyImport_AppendInittab("emb", emb::PyInit_emb);
+}
+
+} // namespace emb
diff --git a/gui/emb.h b/gui/emb.h
new file mode 100644
index 00000000..f76588f5
--- /dev/null
+++ b/gui/emb.h
@@ -0,0 +1,21 @@
+//
+// Copyright (C) 2011 Mateusz Loskot <mateusz@loskot.net>
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// Blog article: http://mateusz.loskot.net/?p=2819
+
+#include <functional>
+#include <iostream>
+#include <string>
+
+namespace emb
+{
+ typedef std::function<void(std::string)> stdout_write_type;
+
+ void set_stdout(stdout_write_type write);
+ void reset_stdout();
+
+ void append_inittab();
+} // namespace emb
diff --git a/gui/fpgaviewwidget.cc b/gui/fpgaviewwidget.cc
new file mode 100644
index 00000000..bd36b724
--- /dev/null
+++ b/gui/fpgaviewwidget.cc
@@ -0,0 +1,153 @@
+#include <QMouseEvent>
+#include <QCoreApplication>
+#include <math.h>
+#include "fpgaviewwidget.h"
+
+FPGAViewWidget::FPGAViewWidget(QWidget *parent)
+ : QOpenGLWidget(parent),
+ m_xMove(0),m_yMove(0),m_zDistance(1.0)
+{
+
+}
+
+FPGAViewWidget::~FPGAViewWidget()
+{
+}
+
+QSize FPGAViewWidget::minimumSizeHint() const
+{
+ return QSize(640, 480);
+}
+
+QSize FPGAViewWidget::sizeHint() const
+{
+ return QSize(640, 480);
+}
+
+void FPGAViewWidget::setXTranslation(float t_x)
+{
+ if(t_x != m_xMove)
+ {
+ m_xMove = t_x;
+ update();
+ }
+}
+
+
+void FPGAViewWidget::setYTranslation(float t_y)
+{
+ if(t_y != m_yMove)
+ {
+ m_yMove = t_y;
+ update();
+ }
+}
+
+
+void FPGAViewWidget::setZoom(float t_z)
+{
+ if(t_z != m_zDistance)
+ {
+ m_zDistance -= t_z;
+ if(m_zDistance < 0.1f)
+ m_zDistance = 0.1f;
+ if(m_zDistance > 10.0f)
+ m_zDistance = 10.0f;
+
+ update();
+ }
+}
+
+void FPGAViewWidget::initializeGL()
+{
+ initializeOpenGLFunctions();
+ glClearColor(1.0, 1.0, 1.0, 0.0);
+}
+
+void FPGAViewWidget::paintGL()
+{
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ glLoadIdentity();
+
+ glTranslatef(m_xMove, m_yMove, -10.0);
+ glScalef(m_zDistance,m_zDistance, 0.0f);
+
+ // Example grid
+ glColor3f(0.8, 0.8, 0.8);
+ glBegin(GL_LINES);
+ for(float i = -100; i <= 100; i += 0.1)
+ {
+ glVertex3f((float)i, -100.0f, 0.0f);
+ glVertex3f((float)i, 100.0f, 0.0f);
+ glVertex3f(-100.0f, (float)i, 0.0f);
+ glVertex3f(100.0f, (float)i, 0.0f);
+ }
+ glColor3f(0.5, 0.5, 0.5);
+ for(int i = -100; i <= 100; i += 1)
+ {
+ glVertex3f((float)i, -100.0f, 0.0f);
+ glVertex3f((float)i, 100.0f, 0.0f);
+ glVertex3f(-100.0f, (float)i, 0.0f);
+ glVertex3f(100.0f, (float)i, 0.0f);
+ }
+ glEnd();
+
+ // Example triangle
+ glBegin(GL_TRIANGLES);
+ glColor3f(1.0, 0.0, 0.0);
+ glVertex3f(-0.5, -0.5, 0);
+ glColor3f(0.0, 1.0, 0.0);
+ glVertex3f(0.5, -0.5, 0);
+ glColor3f(0.0, 0.0, 1.0);
+ glVertex3f(0, 0.5, 0);
+ glEnd();
+
+}
+
+void FPGAViewWidget::resizeGL(int width, int height)
+{
+ m_windowWidth = width;
+ m_windowHeight = height;
+ glViewport(0, 0, m_windowWidth, m_windowHeight);
+
+ float aspect = width * 1.0 / height;
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0* aspect, +1.0* aspect, -1.0, +1.0, 1.0, 15.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+void FPGAViewWidget::mousePressEvent(QMouseEvent *event)
+{
+ m_lastPos = event->pos();
+}
+
+void FPGAViewWidget::mouseMoveEvent(QMouseEvent *event)
+{
+ int dx = event->x() - m_lastPos.x();
+ int dy = event->y() - m_lastPos.y();
+ float dx_scale = dx * (1 / (float)640);
+ float dy_scale = -dy * (1 / (float)480);
+
+ if (event->buttons() & Qt::LeftButton)
+ {
+ float xpos = m_xMove + dx_scale;
+ float ypos = m_yMove + dy_scale;
+ if (m_xMove/m_zDistance <= 100.0 && m_xMove/m_zDistance>= -100.0) setXTranslation(xpos);
+ if (m_yMove/m_zDistance <= 100.0 && m_yMove/m_zDistance>= -100.0) setYTranslation(ypos);
+
+ }
+ m_lastPos = event->pos();
+}
+
+void FPGAViewWidget::wheelEvent(QWheelEvent *event)
+{
+ QPoint degree = event->angleDelta() / 8;
+
+ if(!degree.isNull())
+ {
+ QPoint step = degree / 15;
+ setZoom(step.y() * -0.1f);
+ }
+}
diff --git a/gui/fpgaviewwidget.h b/gui/fpgaviewwidget.h
new file mode 100644
index 00000000..c222e405
--- /dev/null
+++ b/gui/fpgaviewwidget.h
@@ -0,0 +1,43 @@
+#ifndef MAPGLWIDGET_H
+#define MAPGLWIDGET_H
+
+#include <QOpenGLWidget>
+#include <QOpenGLFunctions>
+#include <QPainter>
+
+class FPGAViewWidget : public QOpenGLWidget, protected QOpenGLFunctions
+{
+ Q_OBJECT
+
+public:
+ FPGAViewWidget(QWidget *parent = 0);
+ ~FPGAViewWidget();
+
+ QSize minimumSizeHint() const override;
+ QSize sizeHint() const override;
+
+ void setXTranslation(float t_x);
+ void setYTranslation(float t_y);
+ void setZoom(float t_z);
+
+ void xRotationChanged(int angle);
+ void yRotationChanged(int angle);
+ void zRotationChanged(int angle);
+
+protected:
+ void initializeGL() Q_DECL_OVERRIDE;
+ void paintGL() Q_DECL_OVERRIDE;
+ void resizeGL(int width, int height) Q_DECL_OVERRIDE;
+ void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+ void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+ void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
+
+private:
+ int m_windowWidth;
+ int m_windowHeight;
+ float m_xMove;
+ float m_yMove;
+ float m_zDistance;
+ QPoint m_lastPos;
+};
+#endif
diff --git a/gui/gui.cmake b/gui/gui.cmake
new file mode 100644
index 00000000..6fe1e4ac
--- /dev/null
+++ b/gui/gui.cmake
@@ -0,0 +1,26 @@
+# Find the Qt5 libraries
+find_package(Qt5 COMPONENTS Core Widgets OpenGL REQUIRED)
+
+ADD_DEFINITIONS(-DQT_NO_KEYWORDS)
+
+include( gui/Qt5Customizations.cmake )
+
+# Find includes in corresponding build directories
+include_directories(${CMAKE_CURRENT_BINARY_DIR}/generated)
+
+qt5_generate_moc(gui/mainwindow.h ${CMAKE_CURRENT_BINARY_DIR}/generated/moc_mainwindow.cc)
+qt5_generate_moc(gui/fpgaviewwidget.h ${CMAKE_CURRENT_BINARY_DIR}/generated/moc_fpgaviewwidget.cc)
+
+set(GENERATED_MOC_FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/generated/moc_mainwindow.cc
+ ${CMAKE_CURRENT_BINARY_DIR}/generated/moc_fpgaviewwidget.cc
+)
+
+set(UI_SOURCES
+ gui/mainwindow.ui
+)
+qt5_wrap_ui_custom(GENERATED_UI_HEADERS ${UI_SOURCES})
+qt5_add_resources_custom(GUI_RESOURCE_FILES gui/nextpnr.qrc)
+
+set(GUI_SOURCE_FILES gui/mainwindow.cc gui/fpgaviewwidget.cc gui/emb.cc ${GENERATED_MOC_FILES} ${GENERATED_UI_HEADERS} ${GUI_RESOURCE_FILES})
+set(GUI_LIBRARY_FILES Qt5::Widgets Qt5::OpenGL GL) \ No newline at end of file
diff --git a/gui/mainwindow.cc b/gui/mainwindow.cc
new file mode 100644
index 00000000..4404fc5a
--- /dev/null
+++ b/gui/mainwindow.cc
@@ -0,0 +1,87 @@
+#include "mainwindow.h"
+#include "ui_mainwindow.h"
+#include <functional>
+#include <iostream>
+#include <string>
+#include "pybindings.h"
+#include "emb.h"
+
+MainWindow::MainWindow(QWidget *parent) :
+ QMainWindow(parent),
+ ui(new Ui::MainWindow)
+{
+ ui->setupUi(this);
+ emb::append_inittab();
+ arch_appendinittab();
+ Py_Initialize();
+ PyImport_ImportModule("emb");
+
+ write = [this] (std::string s) {
+ //ui->plainTextEdit->moveCursor(QTextCursor::End);
+ //ui->plainTextEdit->insertPlainText(s.c_str());
+ //ui->plainTextEdit->moveCursor(QTextCursor::End);
+ ui->plainTextEdit->appendPlainText(s.c_str());
+ };
+ emb::set_stdout(write);
+}
+
+MainWindow::~MainWindow()
+{
+ Py_Finalize();
+ delete ui;
+}
+
+void handle_system_exit()
+{
+ exit(-1);
+}
+
+int MainWindow::executePython(std::string command)
+{
+ PyObject *m, *d, *v;
+ m = PyImport_AddModule("__main__");
+ if (m == NULL)
+ return -1;
+ d = PyModule_GetDict(m);
+ v = PyRun_StringFlags(command.c_str(), (command.empty() ? Py_file_input : Py_single_input), d, d, NULL);
+ if (v == NULL)
+ {
+ PyObject *exception, *v, *tb;
+
+ if (PyErr_ExceptionMatches(PyExc_SystemExit)) {
+ handle_system_exit();
+ }
+ PyErr_Fetch(&exception, &v, &tb);
+ if (exception == NULL)
+ return 0;
+ PyErr_NormalizeException(&exception, &v, &tb);
+ if (tb == NULL) {
+ tb = Py_None;
+ Py_INCREF(tb);
+ }
+ PyException_SetTraceback(v, tb);
+ if (exception == NULL)
+ return 0;
+ PyErr_Clear();
+
+ PyObject* objectsRepresentation = PyObject_Str(v);
+ const char* errorStr = PyUnicode_AsUTF8(objectsRepresentation);
+ ui->plainTextEdit->appendPlainText(errorStr);
+ Py_DECREF(objectsRepresentation);
+ Py_XDECREF(exception);
+ Py_XDECREF(v);
+ Py_XDECREF(tb);
+ return -1;
+ }
+ Py_DECREF(v);
+ return 0;
+}
+
+void MainWindow::on_lineEdit_returnPressed()
+{
+ std::string input = ui->lineEdit->text().toStdString();
+ ui->plainTextEdit->appendPlainText(std::string(">>> " + input).c_str());
+ ui->plainTextEdit->update();
+ ui->lineEdit->clear();
+ int error = executePython(input);
+}
diff --git a/gui/mainwindow.h b/gui/mainwindow.h
new file mode 100644
index 00000000..5b242356
--- /dev/null
+++ b/gui/mainwindow.h
@@ -0,0 +1,30 @@
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+#include "emb.h"
+
+#include <QMainWindow>
+
+namespace Ui {
+class MainWindow;
+}
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ explicit MainWindow(QWidget *parent = 0);
+ ~MainWindow();
+
+private:
+ int executePython(std::string command);
+
+private Q_SLOTS:
+ void on_lineEdit_returnPressed();
+
+private:
+ Ui::MainWindow *ui;
+ emb::stdout_write_type write;
+};
+
+#endif // MAINWINDOW_H
diff --git a/gui/mainwindow.ui b/gui/mainwindow.ui
new file mode 100644
index 00000000..4e236f3c
--- /dev/null
+++ b/gui/mainwindow.ui
@@ -0,0 +1,210 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>969</width>
+ <height>629</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>nextpnr</string>
+ </property>
+ <widget class="QWidget" name="centralWidget">
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QSplitter" name="splitter_3">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <widget class="QSplitter" name="splitter">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <widget class="FPGAViewWidget" name="openGLWidget" native="true"/>
+ <widget class="QPlainTextEdit" name="plainTextEdit">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>50</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>16777215</width>
+ <height>200</height>
+ </size>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLineEdit" name="lineEdit">
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>30</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>16777215</width>
+ <height>30</height>
+ </size>
+ </property>
+ </widget>
+ </widget>
+ <widget class="QSplitter" name="splitter_2">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <widget class="QTreeView" name="treeView">
+ <property name="minimumSize">
+ <size>
+ <width>200</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>200</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ <widget class="QTableView" name="tableView"/>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QMenuBar" name="menuBar">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>969</width>
+ <height>27</height>
+ </rect>
+ </property>
+ <widget class="QMenu" name="menu_File">
+ <property name="title">
+ <string>&amp;File</string>
+ </property>
+ <addaction name="actionNew"/>
+ <addaction name="actionOpen"/>
+ <addaction name="actionSave"/>
+ <addaction name="actionSave_as"/>
+ <addaction name="actionClose"/>
+ <addaction name="separator"/>
+ <addaction name="actionExit"/>
+ </widget>
+ <widget class="QMenu" name="menu_Help">
+ <property name="title">
+ <string>&amp;Help</string>
+ </property>
+ <addaction name="actionAbout"/>
+ </widget>
+ <addaction name="menu_File"/>
+ <addaction name="menu_Help"/>
+ </widget>
+ <widget class="QToolBar" name="mainToolBar">
+ <attribute name="toolBarArea">
+ <enum>TopToolBarArea</enum>
+ </attribute>
+ <attribute name="toolBarBreak">
+ <bool>false</bool>
+ </attribute>
+ <addaction name="actionNew"/>
+ <addaction name="actionOpen"/>
+ <addaction name="actionSave"/>
+ </widget>
+ <widget class="QStatusBar" name="statusBar"/>
+ <action name="actionNew">
+ <property name="icon">
+ <iconset resource="nextpnr.qrc">
+ <normaloff>:/icons/resources/new.png</normaloff>:/icons/resources/new.png</iconset>
+ </property>
+ <property name="text">
+ <string>New</string>
+ </property>
+ </action>
+ <action name="actionOpen">
+ <property name="icon">
+ <iconset resource="nextpnr.qrc">
+ <normaloff>:/icons/resources/open.png</normaloff>:/icons/resources/open.png</iconset>
+ </property>
+ <property name="text">
+ <string>Open</string>
+ </property>
+ </action>
+ <action name="actionSave">
+ <property name="icon">
+ <iconset resource="nextpnr.qrc">
+ <normaloff>:/icons/resources/save.png</normaloff>:/icons/resources/save.png</iconset>
+ </property>
+ <property name="text">
+ <string>Save</string>
+ </property>
+ </action>
+ <action name="actionSave_as">
+ <property name="text">
+ <string>Save as ...</string>
+ </property>
+ </action>
+ <action name="actionClose">
+ <property name="text">
+ <string>Close</string>
+ </property>
+ </action>
+ <action name="actionExit">
+ <property name="icon">
+ <iconset resource="nextpnr.qrc">
+ <normaloff>:/icons/resources/exit.png</normaloff>:/icons/resources/exit.png</iconset>
+ </property>
+ <property name="text">
+ <string>Exit</string>
+ </property>
+ </action>
+ <action name="actionAbout">
+ <property name="text">
+ <string>About</string>
+ </property>
+ </action>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <customwidgets>
+ <customwidget>
+ <class>FPGAViewWidget</class>
+ <extends>QWidget</extends>
+ <header>fpgaviewwidget.h</header>
+ </customwidget>
+ </customwidgets>
+ <resources>
+ <include location="nextpnr.qrc"/>
+ </resources>
+ <connections>
+ <connection>
+ <sender>actionExit</sender>
+ <signal>triggered()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>close()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>-1</x>
+ <y>-1</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>484</x>
+ <y>314</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/gui/nextpnr.qrc b/gui/nextpnr.qrc
new file mode 100644
index 00000000..b9e2f237
--- /dev/null
+++ b/gui/nextpnr.qrc
@@ -0,0 +1,8 @@
+<RCC>
+ <qresource prefix="/icons">
+ <file>resources/new.png</file>
+ <file>resources/open.png</file>
+ <file>resources/save.png</file>
+ <file>resources/exit.png</file>
+ </qresource>
+</RCC>
diff --git a/gui/resources/exit.png b/gui/resources/exit.png
new file mode 100644
index 00000000..b1329cbc
--- /dev/null
+++ b/gui/resources/exit.png
Binary files differ
diff --git a/gui/resources/new.png b/gui/resources/new.png
new file mode 100644
index 00000000..f06c66ad
--- /dev/null
+++ b/gui/resources/new.png
Binary files differ
diff --git a/gui/resources/open.png b/gui/resources/open.png
new file mode 100644
index 00000000..e77fc6e7
--- /dev/null
+++ b/gui/resources/open.png
Binary files differ
diff --git a/gui/resources/save.png b/gui/resources/save.png
new file mode 100644
index 00000000..17321109
--- /dev/null
+++ b/gui/resources/save.png
Binary files differ