This repository has been archived by the owner on Feb 11, 2021. It is now read-only.
/
SDL_QPEApp.cc
68 lines (58 loc) · 1.87 KB
1
2
/*
SDL - Simple DirectMedia Layer
3
Copyright (C) 1997-2004 Sam Lantinga
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Sam Lantinga
slouken@libsdl.org
*/
22
#include "SDL_config.h"
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <qpe/qpeapplication.h>
#include <qapplication.h>
#include <qevent.h>
#include "SDL_thread.h"
#include "SDL_timer.h"
#include "SDL_error.h"
/* Flag to tell whether or not the Be application is active or not */
int SDL_QPEAppActive = 0;
static QPEApplication *app;
36
int
37
SDL_InitQPEApp()
38
39
40
41
42
{
if (SDL_QPEAppActive <= 0) {
if (!qApp) {
int argc = 1;
char *argv[] = { {"SDLApp"} };
43
app = new QPEApplication(argc, argv);
44
QWidget dummy;
45
app->showMainWidget(&dummy);
46
47
48
49
} else {
app = (QPEApplication *) qApp;
}
SDL_QPEAppActive++;
50
}
51
return 0;
52
53
54
}
/* Quit the QPE Application, if there's nothing left to do */
55
void
56
SDL_QuitQPEApp(void)
57
{
58
59
60
61
62
63
64
65
/* Decrement the application reference count */
SDL_QPEAppActive--;
/* If the reference count reached zero, clean up the app */
if (SDL_QPEAppActive == 0 && app) {
delete app;
app = 0;
qApp = 0;
}
66
}
67
68
/* vi: set ts=4 sw=4 expandtab: */