diff options
Diffstat (limited to 'heimdall-frontend/source/mainwindow.h')
-rw-r--r-- | heimdall-frontend/source/mainwindow.h | 43 |
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, |