]>
cvs.zerfleddert.de Git - proxmark3-svn/blob - client/proxgui.cpp
6e4ec98e9f6880d6fcd75ed81b035f50ea904d39
1 //-----------------------------------------------------------------------------
2 // Copyright (C) 2009 Michael Gernoth <michael at gernoth.net>
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
7 //-----------------------------------------------------------------------------
9 //-----------------------------------------------------------------------------
12 #include "proxguiqt.h"
13 #include "proxmark3.h"
16 static ProxGuiQT
*gui
= NULL
;
17 static WorkerThread
*main_loop_thread
= NULL
;
19 WorkerThread::WorkerThread(char *script_cmds_file
, char *script_cmd
,
20 bool usb_present
, serial_port
* sp
)
21 : script_cmds_file(script_cmds_file
), script_cmd(script_cmd
),
22 usb_present(usb_present
), sp(sp
)
26 WorkerThread::~WorkerThread()
30 void WorkerThread::run() {
31 main_loop(script_cmds_file
, script_cmd
, usb_present
, sp
);
34 extern "C" void ShowGraphWindow(void)
39 gui
->ShowGraphWindow();
42 extern "C" void HideGraphWindow(void)
47 gui
->HideGraphWindow();
50 extern "C" void RepaintGraphWindow(void)
55 gui
->RepaintGraphWindow();
58 extern "C" void MainGraphics(void)
66 extern "C" void InitGraphics(int argc
, char **argv
, char *script_cmds_file
,
67 char *script_cmd
, bool usb_present
,
71 bool useGUI
= getenv("DISPLAY") != 0;
78 main_loop_thread
= new WorkerThread(script_cmds_file
, script_cmd
, usb_present
, sp
);
79 gui
= new ProxGuiQT(argc
, argv
, main_loop_thread
);
82 extern "C" void ExitGraphics(void)