4 * Copyright 2006 Develer S.r.l. (http://www.develer.com/)
5 * Copyright 2000, 2001 Bernardo Innocenti <bernie@codewiz.org>
6 * This file is part of DevLib - See README.devlib for information.
11 * \author Bernardo Innocenti <bernie@develer.com>
13 * \brief Qt-based emulator framework for embedded applications (implementation)
18 *#* Revision 1.3 2006/02/20 02:00:40 bernie
21 *#* Revision 1.2 2006/01/16 03:51:51 bernie
24 *#* Revision 1.1 2006/01/16 03:37:12 bernie
25 *#* Add emulator skeleton.
31 #include <cfg/module.h>
33 #include <cstdlib> // std::exit()
36 #include <qapplication.h>
38 #include <QtGui/qapplication.h>
42 /// The global emulator instance.
45 Emulator::Emulator(int &argc, char **argv) :
46 emulApp(new QApplication(argc, argv)),
47 emulWin(new EmulWin(this))
49 #if QT_VERSION < ((4 << 16) + (0 << 8) + 0)
50 emulApp->setMainWidget(emulWin);
58 // we don't delete emulWin because it automatically
59 // deletes itself when closed
64 NORETURN void Emulator::quit()
70 // do we have a better way to shut down the emulation?
76 /// Main emulator entry point.
77 extern "C" void emul_init(int *argc, char *argv[])
79 // setup global emulator pointer
80 emul = new Emulator(*argc, argv);
85 extern "C" void emul_cleanup()
93 extern "C" void emul_idle()
95 // We process GUI events when the application is idle.
96 emul->emulApp->processEvents();