Merge pull request #77 from Proxmark/usb_check
[legacy-proxmark3.git] / client / proxgui.cpp
blob12faab79cd3d7eb002d50b2dd53b06ce34989913
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 functions
9 //-----------------------------------------------------------------------------
11 #include "proxgui.h"
12 #include "proxguiqt.h"
14 static ProxGuiQT *gui = NULL;
16 extern "C" void ShowGraphWindow(void)
18 if (!gui)
19 return;
21 gui->ShowGraphWindow();
24 extern "C" void HideGraphWindow(void)
26 if (!gui)
27 return;
29 gui->HideGraphWindow();
32 extern "C" void RepaintGraphWindow(void)
34 if (!gui)
35 return;
37 gui->RepaintGraphWindow();
40 extern "C" void MainGraphics(void)
42 if (!gui)
43 return;
45 gui->MainLoop();
48 extern "C" void InitGraphics(int argc, char **argv)
50 #ifdef Q_WS_X11
51 bool useGUI = getenv("DISPLAY") != 0;
52 #else
53 bool useGUI = true;
54 #endif
55 if (!useGUI)
56 return;
58 gui = new ProxGuiQT(argc, argv);
61 extern "C" void ExitGraphics(void)
63 if (!gui)
64 return;
66 delete gui;
67 gui = NULL;