summaryrefslogtreecommitdiffstats
path: root/heimdall-frontend/source/mainwindow.h
diff options
context:
space:
mode:
authorBenjamin Dobell <benjamin.dobell+git@glassechidna.com.au>2015-02-20 17:44:07 +0100
committerBenjamin Dobell <benjamin.dobell+git@glassechidna.com.au>2015-02-20 17:50:55 +0100
commitd3335dec58fff9fd5f33433f80c0a1f7500c1ea5 (patch)
tree76a710ad3cc495b5c4a8a2271f904256c5e265c5 /heimdall-frontend/source/mainwindow.h
parentImplemented hack to make WinUSB play nice with empty receive transfers (diff)
downloadHeimdall-d3335dec58fff9fd5f33433f80c0a1f7500c1ea5.tar
Heimdall-d3335dec58fff9fd5f33433f80c0a1f7500c1ea5.tar.gz
Heimdall-d3335dec58fff9fd5f33433f80c0a1f7500c1ea5.tar.bz2
Heimdall-d3335dec58fff9fd5f33433f80c0a1f7500c1ea5.tar.lz
Heimdall-d3335dec58fff9fd5f33433f80c0a1f7500c1ea5.tar.xz
Heimdall-d3335dec58fff9fd5f33433f80c0a1f7500c1ea5.tar.zst
Heimdall-d3335dec58fff9fd5f33433f80c0a1f7500c1ea5.zip
Diffstat (limited to '')
-rw-r--r--heimdall-frontend/source/mainwindow.h43
1 files changed, 33 insertions, 10 deletions
diff --git a/heimdall-frontend/source/mainwindow.h b/heimdall-frontend/source/mainwindow.h
index 8783792..d0b8703 100644
--- a/heimdall-frontend/source/mainwindow.h
+++ b/heimdall-frontend/source/mainwindow.h
@@ -39,22 +39,45 @@ using namespace libpit;
namespace HeimdallFrontend
{
+ enum class HeimdallState : int
+ {
+ Stopped = 1,
+ Flashing = (int)Stopped << 1,
+ DetectingDevice = (int)Flashing << 1,
+ ClosingPcScreen = (int)DetectingDevice << 1,
+ PrintingPit = (int)ClosingPcScreen << 1,
+ DownloadingPit = (int)PrintingPit << 1,
+ NoReboot = (int)DownloadingPit << 1
+ };
+
+ inline HeimdallState operator|(HeimdallState lhs, HeimdallState rhs)
+ {
+ return (HeimdallState)((int)lhs | (int)rhs);
+ }
+
+ inline HeimdallState& operator|=(HeimdallState& lhs, HeimdallState rhs)
+ {
+ lhs = lhs | rhs;
+ return lhs;
+ }
+
+ inline HeimdallState operator&(HeimdallState lhs, HeimdallState rhs)
+ {
+ lhs = (HeimdallState)((int)lhs & (int)rhs);
+ return lhs;
+ }
+
+ inline bool operator!(HeimdallState state)
+ {
+ return (int)state == 0;
+ }
+
class MainWindow : public QMainWindow, public Ui::MainWindow
{
Q_OBJECT
private:
- enum class HeimdallState
- {
- Stopped = 0,
- Flashing,
- DetectingDevice,
- ClosingPcScreen,
- PrintingPit,
- DownloadingPit
- };
-
enum
{
kPrintPitSourceDevice = 0,