Merge pull request #115 from marshmellow42/master
[legacy-proxmark3.git] / client / proxguiqt.h
blob303a37d01cb66a48897f7003be6ae79453c08a6f
1 //-----------------------------------------------------------------------------
2 // Copyright (C) 2009 Michael Gernoth <michael at gernoth.net>
3 //
4 // This code is licensed to you under the terms of the GNU GPL, version 2 or,
5 // at your option, any later version. See the LICENSE.txt file for the text of
6 // the license.
7 //-----------------------------------------------------------------------------
8 // GUI (QT)
9 //-----------------------------------------------------------------------------
11 #include <QApplication>
12 #include <QPushButton>
13 #include <QObject>
14 #include <QWidget>
15 #include <QPainter>
17 class ProxWidget : public QWidget
19 Q_OBJECT;
21 private:
22 int GraphStart;
23 double GraphPixelsPerPoint;
24 int CursorAPos;
25 int CursorBPos;
27 public:
28 ProxWidget(QWidget *parent = 0);
30 protected:
31 void paintEvent(QPaintEvent *event);
32 void closeEvent(QCloseEvent *event);
33 void mouseMoveEvent(QMouseEvent *event);
34 void mousePressEvent(QMouseEvent *event) { mouseMoveEvent(event); }
35 void keyPressEvent(QKeyEvent *event);
38 class ProxGuiQT : public QObject
40 Q_OBJECT;
42 private:
43 QApplication *plotapp;
44 ProxWidget *plotwidget;
45 int argc;
46 char **argv;
47 void (*main_func)(void);
49 public:
50 ProxGuiQT(int argc, char **argv);
51 ~ProxGuiQT(void);
52 void ShowGraphWindow(void);
53 void RepaintGraphWindow(void);
54 void HideGraphWindow(void);
55 void MainLoop(void);
57 private slots:
58 void _ShowGraphWindow(void);
59 void _RepaintGraphWindow(void);
60 void _HideGraphWindow(void);
62 signals:
63 void ShowGraphWindowSignal(void);
64 void RepaintGraphWindowSignal(void);
65 void HideGraphWindowSignal(void);