]> cvs.zerfleddert.de Git - proxmark3-svn/blob - client/proxgui.cpp
fabbd204d20ffc9738a26c017ee62491aa3f5095
[proxmark3-svn] / client / proxgui.cpp
1 //-----------------------------------------------------------------------------
2 // This code is licensed to you under the terms of the GNU GPL, version 2 or,
3 // at your option, any later version. See the LICENSE.txt file for the text of
4 // the license.
5 //-----------------------------------------------------------------------------
6 // GUI functions
7 //-----------------------------------------------------------------------------
8
9 #include "proxgui.h"
10 #include "proxguiqt.h"
11
12 static ProxGuiQT *gui = NULL;
13
14 extern "C" void ShowGraphWindow(void)
15 {
16 if (!gui)
17 return;
18
19 gui->ShowGraphWindow();
20 }
21
22 extern "C" void HideGraphWindow(void)
23 {
24 if (!gui)
25 return;
26
27 gui->HideGraphWindow();
28 }
29
30 extern "C" void RepaintGraphWindow(void)
31 {
32 if (!gui)
33 return;
34
35 gui->RepaintGraphWindow();
36 }
37
38 extern "C" void MainGraphics(void)
39 {
40 if (!gui)
41 return;
42
43 gui->MainLoop();
44 }
45
46 extern "C" void InitGraphics(int argc, char **argv)
47 {
48 #ifdef Q_WS_X11
49 bool useGUI = getenv("DISPLAY") != 0;
50 #else
51 bool useGUI = true;
52 #endif
53 if (!useGUI)
54 return;
55
56 gui = new ProxGuiQT(argc, argv);
57 }
58
59 extern "C" void ExitGraphics(void)
60 {
61 if (!gui)
62 return;
63
64 delete gui;
65 gui = NULL;
66 }
Impressum, Datenschutz