nextpnr/gui/basewindow.h

78 lines
2.0 KiB
C
Raw Normal View History

2018-06-22 22:21:20 +08:00
/*
* nextpnr -- Next Generation Place and Route
*
* Copyright (C) 2018 Miodrag Milanovic <miodrag@symbioticeda.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/
2018-06-21 19:41:16 +08:00
#ifndef BASEMAINWINDOW_H
#define BASEMAINWINDOW_H
#include "infotab.h"
#include "nextpnr.h"
#include <QMainWindow>
#include <QMenu>
#include <QMenuBar>
#include <QStatusBar>
2018-06-21 19:55:36 +08:00
#include <QTabWidget>
#include <QToolBar>
2018-07-12 20:54:16 +08:00
#include <QProgressBar>
2018-06-21 19:41:16 +08:00
Q_DECLARE_METATYPE(std::string)
2018-06-22 19:10:27 +08:00
NEXTPNR_NAMESPACE_BEGIN
2018-06-21 19:41:16 +08:00
class BaseMainWindow : public QMainWindow
{
Q_OBJECT
public:
2018-06-26 21:47:22 +08:00
explicit BaseMainWindow(QWidget *parent = 0);
virtual ~BaseMainWindow();
2018-06-21 19:41:16 +08:00
Context *getContext() { return ctx; }
protected:
void createMenusAndBars();
protected Q_SLOTS:
void writeInfo(std::string text);
2018-06-26 20:17:17 +08:00
virtual void new_proj() = 0;
virtual void open_proj() = 0;
virtual bool save_proj() = 0;
2018-06-21 19:41:16 +08:00
2018-06-26 21:47:22 +08:00
Q_SIGNALS:
void contextChanged(Context *ctx);
2018-07-06 02:06:12 +08:00
void updateTreeView();
2018-06-26 21:47:22 +08:00
2018-06-21 19:41:16 +08:00
protected:
Context *ctx;
QTabWidget *tabWidget;
2018-06-21 20:12:02 +08:00
QTabWidget *centralTabWidget;
2018-06-21 19:41:16 +08:00
InfoTab *info;
2018-06-21 19:55:36 +08:00
2018-06-21 19:41:16 +08:00
QMenuBar *menuBar;
QToolBar *mainToolBar;
QStatusBar *statusBar;
QAction *actionNew;
QAction *actionOpen;
2018-07-12 20:54:16 +08:00
QProgressBar *progressBar;
2018-06-21 19:41:16 +08:00
};
2018-06-22 19:10:27 +08:00
NEXTPNR_NAMESPACE_END
2018-06-21 19:41:16 +08:00
#endif // BASEMAINWINDOW_H