2018-06-10 08:06:02 +00:00
|
|
|
//$(moc) -i -o qt.moc qt.hpp
|
2016-05-04 10:07:13 +00:00
|
|
|
|
Update to v094r40 release.
byuu says:
Changelog:
- updated to newest hiro API
- SFC performance profile builds once again
- hiro: Qt port completed
Errata 1: the hiro/Qt target won't run tomoko just yet. Starts by
crashing inside InputSettings because hiro/Qt isn't forcefully selecting
the first item added to a ComboButton just yet. Even with a monkey patch
to get around that, the UI is incredibly unstable. Lots of geometry
calculation bugs, and a crash when you try and access certain folders in
the browser dialog. Lots of work left to be done there, sadly.
Errata 2: the hiro/Windows port has black backgrounds on all ListView
items. It's because I need to test for unassigned colors and grab the
default Windows brush colors in those cases.
Note: alternating row colors on multi-column ListView widgets is gone
now. Not a bug. May add it back later, but I'm not sure. It doesn't
interact nicely with per-cell background colors.
Things left to do:
First, I have to fix the Windows and Qt target bugs.
Next, I need to go through and revise the hiro API even more (nothing
too major.)
Next, I need to update icarus to use the new hiro API, and add support
for the SFC games database.
Next, I have to rewrite my TSV->BML cheat code tool.
Next, I need to post a final WIP of higan+icarus publicly and wait a few
days.
Next, I need to fix any bugs reported from the final WIP that I can.
Finally, I should be able to release v095.
2015-08-18 10:18:00 +00:00
|
|
|
/*
|
|
|
|
Qt requires moc in order to bind callbacks, which causes many complications.
|
|
|
|
|
|
|
|
First, moc is not C++11-aware. Thus, all of the "public slots:" functions must
|
|
|
|
be declared using C++98 syntax.
|
|
|
|
|
|
|
|
Second, multiple inheritance with QObject (eg pWindow : QObject, pObject)
|
|
|
|
seems to cause heap corruption. As such, we need to have separate classes for
|
|
|
|
inheriting from QObject, which are defined in this file.
|
|
|
|
|
|
|
|
Third, moc preprocessor output is required for every Q_OBJECT class. So to
|
|
|
|
avoid needing to generate several .moc files, all QObject classes are placed
|
|
|
|
inside this one file instead.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#if !defined(HIRO_QT)
|
|
|
|
#include "../components.hpp"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
namespace hiro {
|
|
|
|
|
|
|
|
#if defined(Hiro_Timer)
|
|
|
|
struct QtTimer : public QTimer {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
QtTimer(pTimer& p) : p(p) {}
|
|
|
|
pTimer& p;
|
|
|
|
public slots:
|
|
|
|
void onActivate();
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Hiro_Window)
|
|
|
|
struct QtWindow : public QWidget {
|
|
|
|
QtWindow(pWindow& p) : p(p) {}
|
|
|
|
auto closeEvent(QCloseEvent*) -> void;
|
|
|
|
auto dragEnterEvent(QDragEnterEvent*) -> void;
|
|
|
|
auto dropEvent(QDropEvent*) -> void;
|
|
|
|
auto keyPressEvent(QKeyEvent*) -> void;
|
|
|
|
auto keyReleaseEvent(QKeyEvent*) -> void;
|
|
|
|
auto moveEvent(QMoveEvent*) -> void;
|
|
|
|
auto resizeEvent(QResizeEvent*) -> void;
|
|
|
|
auto sizeHint() const -> QSize;
|
|
|
|
pWindow& p;
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Hiro_MenuItem)
|
|
|
|
struct QtMenuItem : public QAction {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
QtMenuItem(pMenuItem& p) : QAction(nullptr), p(p) {}
|
|
|
|
pMenuItem& p;
|
|
|
|
public slots:
|
|
|
|
void onActivate();
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Hiro_MenuCheckItem)
|
|
|
|
struct QtMenuCheckItem : public QAction {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
QtMenuCheckItem(pMenuCheckItem& p) : QAction(nullptr), p(p) {}
|
|
|
|
pMenuCheckItem& p;
|
|
|
|
public slots:
|
|
|
|
void onToggle();
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Hiro_MenuRadioItem)
|
|
|
|
struct QtMenuRadioItem : public QAction {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
QtMenuRadioItem(pMenuRadioItem& p) : QAction(nullptr), p(p) {}
|
|
|
|
pMenuRadioItem& p;
|
|
|
|
public slots:
|
|
|
|
void onActivate();
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Hiro_Button)
|
|
|
|
struct QtButton : public QToolButton {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
QtButton(pButton& p) : p(p) {}
|
|
|
|
pButton& p;
|
|
|
|
public slots:
|
|
|
|
void onActivate();
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Hiro_Canvas)
|
|
|
|
struct QtCanvas : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
QtCanvas(pCanvas& p) : p(p) {}
|
|
|
|
auto dragEnterEvent(QDragEnterEvent*) -> void;
|
|
|
|
auto dropEvent(QDropEvent*) -> void;
|
|
|
|
auto leaveEvent(QEvent*) -> void;
|
|
|
|
auto mouseMoveEvent(QMouseEvent*) -> void;
|
|
|
|
auto mousePressEvent(QMouseEvent*) -> void;
|
|
|
|
auto mouseReleaseEvent(QMouseEvent*) -> void;
|
|
|
|
auto paintEvent(QPaintEvent*) -> void;
|
|
|
|
pCanvas& p;
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Hiro_CheckButton)
|
|
|
|
struct QtCheckButton : public QToolButton {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
QtCheckButton(pCheckButton& p) : p(p) {}
|
|
|
|
pCheckButton& p;
|
|
|
|
public slots:
|
|
|
|
void onToggle(bool checked);
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Hiro_CheckLabel)
|
|
|
|
struct QtCheckLabel : public QCheckBox {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
QtCheckLabel(pCheckLabel& p) : p(p) {}
|
|
|
|
pCheckLabel& p;
|
|
|
|
public slots:
|
|
|
|
void onToggle();
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Hiro_ComboButton)
|
|
|
|
struct QtComboButton : public QComboBox {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
QtComboButton(pComboButton& p) : p(p) {}
|
|
|
|
pComboButton& p;
|
|
|
|
public slots:
|
2015-08-21 10:56:39 +00:00
|
|
|
void onChange(int offset);
|
Update to v094r40 release.
byuu says:
Changelog:
- updated to newest hiro API
- SFC performance profile builds once again
- hiro: Qt port completed
Errata 1: the hiro/Qt target won't run tomoko just yet. Starts by
crashing inside InputSettings because hiro/Qt isn't forcefully selecting
the first item added to a ComboButton just yet. Even with a monkey patch
to get around that, the UI is incredibly unstable. Lots of geometry
calculation bugs, and a crash when you try and access certain folders in
the browser dialog. Lots of work left to be done there, sadly.
Errata 2: the hiro/Windows port has black backgrounds on all ListView
items. It's because I need to test for unassigned colors and grab the
default Windows brush colors in those cases.
Note: alternating row colors on multi-column ListView widgets is gone
now. Not a bug. May add it back later, but I'm not sure. It doesn't
interact nicely with per-cell background colors.
Things left to do:
First, I have to fix the Windows and Qt target bugs.
Next, I need to go through and revise the hiro API even more (nothing
too major.)
Next, I need to update icarus to use the new hiro API, and add support
for the SFC games database.
Next, I have to rewrite my TSV->BML cheat code tool.
Next, I need to post a final WIP of higan+icarus publicly and wait a few
days.
Next, I need to fix any bugs reported from the final WIP that I can.
Finally, I should be able to release v095.
2015-08-18 10:18:00 +00:00
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Hiro_HexEdit)
|
|
|
|
struct QtHexEdit : public QTextEdit {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
QtHexEdit(pHexEdit& p) : p(p) {}
|
|
|
|
auto keyPressEvent(QKeyEvent*) -> void;
|
|
|
|
auto keyPressEventAcknowledge(QKeyEvent*) -> void;
|
|
|
|
auto wheelEvent(QWheelEvent*) -> void;
|
|
|
|
pHexEdit& p;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct QtHexEditScrollBar : public QScrollBar {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
QtHexEditScrollBar(pHexEdit& p) : p(p) {}
|
|
|
|
auto event(QEvent*) -> bool;
|
|
|
|
pHexEdit& p;
|
|
|
|
public slots:
|
|
|
|
void onScroll();
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2015-08-21 10:56:39 +00:00
|
|
|
#if defined(Hiro_HorizontalScrollBar)
|
|
|
|
struct QtHorizontalScrollBar : public QScrollBar {
|
Update to v094r40 release.
byuu says:
Changelog:
- updated to newest hiro API
- SFC performance profile builds once again
- hiro: Qt port completed
Errata 1: the hiro/Qt target won't run tomoko just yet. Starts by
crashing inside InputSettings because hiro/Qt isn't forcefully selecting
the first item added to a ComboButton just yet. Even with a monkey patch
to get around that, the UI is incredibly unstable. Lots of geometry
calculation bugs, and a crash when you try and access certain folders in
the browser dialog. Lots of work left to be done there, sadly.
Errata 2: the hiro/Windows port has black backgrounds on all ListView
items. It's because I need to test for unassigned colors and grab the
default Windows brush colors in those cases.
Note: alternating row colors on multi-column ListView widgets is gone
now. Not a bug. May add it back later, but I'm not sure. It doesn't
interact nicely with per-cell background colors.
Things left to do:
First, I have to fix the Windows and Qt target bugs.
Next, I need to go through and revise the hiro API even more (nothing
too major.)
Next, I need to update icarus to use the new hiro API, and add support
for the SFC games database.
Next, I have to rewrite my TSV->BML cheat code tool.
Next, I need to post a final WIP of higan+icarus publicly and wait a few
days.
Next, I need to fix any bugs reported from the final WIP that I can.
Finally, I should be able to release v095.
2015-08-18 10:18:00 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2015-08-21 10:56:39 +00:00
|
|
|
QtHorizontalScrollBar(pHorizontalScrollBar& p) : QScrollBar(Qt::Horizontal), p(p) {}
|
|
|
|
pHorizontalScrollBar& p;
|
Update to v094r40 release.
byuu says:
Changelog:
- updated to newest hiro API
- SFC performance profile builds once again
- hiro: Qt port completed
Errata 1: the hiro/Qt target won't run tomoko just yet. Starts by
crashing inside InputSettings because hiro/Qt isn't forcefully selecting
the first item added to a ComboButton just yet. Even with a monkey patch
to get around that, the UI is incredibly unstable. Lots of geometry
calculation bugs, and a crash when you try and access certain folders in
the browser dialog. Lots of work left to be done there, sadly.
Errata 2: the hiro/Windows port has black backgrounds on all ListView
items. It's because I need to test for unassigned colors and grab the
default Windows brush colors in those cases.
Note: alternating row colors on multi-column ListView widgets is gone
now. Not a bug. May add it back later, but I'm not sure. It doesn't
interact nicely with per-cell background colors.
Things left to do:
First, I have to fix the Windows and Qt target bugs.
Next, I need to go through and revise the hiro API even more (nothing
too major.)
Next, I need to update icarus to use the new hiro API, and add support
for the SFC games database.
Next, I have to rewrite my TSV->BML cheat code tool.
Next, I need to post a final WIP of higan+icarus publicly and wait a few
days.
Next, I need to fix any bugs reported from the final WIP that I can.
Finally, I should be able to release v095.
2015-08-18 10:18:00 +00:00
|
|
|
public slots:
|
|
|
|
void onChange();
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Hiro_HorizontalSlider)
|
|
|
|
struct QtHorizontalSlider : public QSlider {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
QtHorizontalSlider(pHorizontalSlider& p) : QSlider(Qt::Horizontal), p(p) {}
|
|
|
|
pHorizontalSlider& p;
|
|
|
|
public slots:
|
|
|
|
void onChange();
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Hiro_LineEdit)
|
|
|
|
struct QtLineEdit : public QLineEdit {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
QtLineEdit(pLineEdit& p) : p(p) {}
|
|
|
|
pLineEdit& p;
|
|
|
|
public slots:
|
|
|
|
void onActivate();
|
|
|
|
void onChange();
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Hiro_RadioLabel)
|
|
|
|
struct QtRadioLabel : public QRadioButton {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
QtRadioLabel(pRadioLabel& p) : p(p) {}
|
|
|
|
pRadioLabel& p;
|
|
|
|
public slots:
|
|
|
|
void onActivate();
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Hiro_RadioButton)
|
|
|
|
struct QtRadioButton : public QToolButton {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
QtRadioButton(pRadioButton& p) : p(p) {}
|
|
|
|
pRadioButton& p;
|
|
|
|
public slots:
|
|
|
|
void onActivate();
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Hiro_TabFrame)
|
|
|
|
struct QtTabFrame : public QTabWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
QtTabFrame(pTabFrame& p) : p(p) {}
|
|
|
|
pTabFrame& p;
|
|
|
|
auto showEvent(QShowEvent*) -> void override;
|
|
|
|
public slots:
|
|
|
|
void onChange(int selection);
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2016-05-04 10:07:13 +00:00
|
|
|
#if defined(Hiro_TableView)
|
|
|
|
struct QtTableView : public QTreeWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
QtTableView(pTableView& p) : p(p) {}
|
|
|
|
auto mousePressEvent(QMouseEvent*) -> void override;
|
|
|
|
auto resizeEvent(QResizeEvent*) -> void override;
|
|
|
|
auto showEvent(QShowEvent*) -> void override;
|
|
|
|
pTableView& p;
|
|
|
|
public slots:
|
|
|
|
void onActivate();
|
|
|
|
void onChange();
|
|
|
|
void onContext();
|
|
|
|
void onSort(int column);
|
|
|
|
void onToggle(QTreeWidgetItem* item, int column);
|
|
|
|
};
|
|
|
|
|
|
|
|
struct QtTableViewDelegate : public QStyledItemDelegate {
|
|
|
|
QtTableViewDelegate(pTableView& p);
|
|
|
|
auto paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const -> void;
|
|
|
|
pTableView& p;
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
Update to v094r40 release.
byuu says:
Changelog:
- updated to newest hiro API
- SFC performance profile builds once again
- hiro: Qt port completed
Errata 1: the hiro/Qt target won't run tomoko just yet. Starts by
crashing inside InputSettings because hiro/Qt isn't forcefully selecting
the first item added to a ComboButton just yet. Even with a monkey patch
to get around that, the UI is incredibly unstable. Lots of geometry
calculation bugs, and a crash when you try and access certain folders in
the browser dialog. Lots of work left to be done there, sadly.
Errata 2: the hiro/Windows port has black backgrounds on all ListView
items. It's because I need to test for unassigned colors and grab the
default Windows brush colors in those cases.
Note: alternating row colors on multi-column ListView widgets is gone
now. Not a bug. May add it back later, but I'm not sure. It doesn't
interact nicely with per-cell background colors.
Things left to do:
First, I have to fix the Windows and Qt target bugs.
Next, I need to go through and revise the hiro API even more (nothing
too major.)
Next, I need to update icarus to use the new hiro API, and add support
for the SFC games database.
Next, I have to rewrite my TSV->BML cheat code tool.
Next, I need to post a final WIP of higan+icarus publicly and wait a few
days.
Next, I need to fix any bugs reported from the final WIP that I can.
Finally, I should be able to release v095.
2015-08-18 10:18:00 +00:00
|
|
|
#if defined(Hiro_TextEdit)
|
|
|
|
struct QtTextEdit : public QTextEdit {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
QtTextEdit(pTextEdit& p) : p(p) {}
|
|
|
|
pTextEdit& p;
|
|
|
|
public slots:
|
|
|
|
void onChange();
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2015-08-21 10:56:39 +00:00
|
|
|
#if defined(Hiro_VerticalScrollBar)
|
|
|
|
struct QtVerticalScrollBar : public QScrollBar {
|
Update to v094r40 release.
byuu says:
Changelog:
- updated to newest hiro API
- SFC performance profile builds once again
- hiro: Qt port completed
Errata 1: the hiro/Qt target won't run tomoko just yet. Starts by
crashing inside InputSettings because hiro/Qt isn't forcefully selecting
the first item added to a ComboButton just yet. Even with a monkey patch
to get around that, the UI is incredibly unstable. Lots of geometry
calculation bugs, and a crash when you try and access certain folders in
the browser dialog. Lots of work left to be done there, sadly.
Errata 2: the hiro/Windows port has black backgrounds on all ListView
items. It's because I need to test for unassigned colors and grab the
default Windows brush colors in those cases.
Note: alternating row colors on multi-column ListView widgets is gone
now. Not a bug. May add it back later, but I'm not sure. It doesn't
interact nicely with per-cell background colors.
Things left to do:
First, I have to fix the Windows and Qt target bugs.
Next, I need to go through and revise the hiro API even more (nothing
too major.)
Next, I need to update icarus to use the new hiro API, and add support
for the SFC games database.
Next, I have to rewrite my TSV->BML cheat code tool.
Next, I need to post a final WIP of higan+icarus publicly and wait a few
days.
Next, I need to fix any bugs reported from the final WIP that I can.
Finally, I should be able to release v095.
2015-08-18 10:18:00 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2015-08-21 10:56:39 +00:00
|
|
|
QtVerticalScrollBar(pVerticalScrollBar& p) : QScrollBar(Qt::Vertical), p(p) {}
|
|
|
|
pVerticalScrollBar& p;
|
Update to v094r40 release.
byuu says:
Changelog:
- updated to newest hiro API
- SFC performance profile builds once again
- hiro: Qt port completed
Errata 1: the hiro/Qt target won't run tomoko just yet. Starts by
crashing inside InputSettings because hiro/Qt isn't forcefully selecting
the first item added to a ComboButton just yet. Even with a monkey patch
to get around that, the UI is incredibly unstable. Lots of geometry
calculation bugs, and a crash when you try and access certain folders in
the browser dialog. Lots of work left to be done there, sadly.
Errata 2: the hiro/Windows port has black backgrounds on all ListView
items. It's because I need to test for unassigned colors and grab the
default Windows brush colors in those cases.
Note: alternating row colors on multi-column ListView widgets is gone
now. Not a bug. May add it back later, but I'm not sure. It doesn't
interact nicely with per-cell background colors.
Things left to do:
First, I have to fix the Windows and Qt target bugs.
Next, I need to go through and revise the hiro API even more (nothing
too major.)
Next, I need to update icarus to use the new hiro API, and add support
for the SFC games database.
Next, I have to rewrite my TSV->BML cheat code tool.
Next, I need to post a final WIP of higan+icarus publicly and wait a few
days.
Next, I need to fix any bugs reported from the final WIP that I can.
Finally, I should be able to release v095.
2015-08-18 10:18:00 +00:00
|
|
|
public slots:
|
|
|
|
void onChange();
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Hiro_VerticalSlider)
|
|
|
|
struct QtVerticalSlider : public QSlider {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
QtVerticalSlider(pVerticalSlider& p) : QSlider(Qt::Vertical), p(p) {}
|
|
|
|
pVerticalSlider& p;
|
|
|
|
public slots:
|
|
|
|
void onChange();
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Hiro_Viewport)
|
|
|
|
struct QtViewport : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
QtViewport(pViewport& p) : p(p) {}
|
|
|
|
auto dragEnterEvent(QDragEnterEvent*) -> void;
|
|
|
|
auto dropEvent(QDropEvent*) -> void;
|
|
|
|
auto leaveEvent(QEvent*) -> void;
|
|
|
|
auto mouseMoveEvent(QMouseEvent*) -> void;
|
|
|
|
auto mousePressEvent(QMouseEvent*) -> void;
|
|
|
|
auto mouseReleaseEvent(QMouseEvent*) -> void;
|
|
|
|
pViewport& p;
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
}
|