Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Latest commit

 

History

History
68 lines (58 loc) · 1.87 KB

SDL_QPEApp.cc

File metadata and controls

68 lines (58 loc) · 1.87 KB
 
May 19, 2002
May 19, 2002
1
2
/*
SDL - Simple DirectMedia Layer
Jan 4, 2004
Jan 4, 2004
3
Copyright (C) 1997-2004 Sam Lantinga
May 19, 2002
May 19, 2002
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
*/
Feb 21, 2006
Feb 21, 2006
22
#include "SDL_config.h"
May 19, 2002
May 19, 2002
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;
May 28, 2006
May 28, 2006
36
int
May 29, 2006
May 29, 2006
37
SDL_InitQPEApp()
May 28, 2006
May 28, 2006
38
39
40
41
42
{
if (SDL_QPEAppActive <= 0) {
if (!qApp) {
int argc = 1;
char *argv[] = { {"SDLApp"} };
May 29, 2006
May 29, 2006
43
app = new QPEApplication(argc, argv);
May 28, 2006
May 28, 2006
44
QWidget dummy;
May 29, 2006
May 29, 2006
45
app->showMainWidget(&dummy);
May 28, 2006
May 28, 2006
46
47
48
49
} else {
app = (QPEApplication *) qApp;
}
SDL_QPEAppActive++;
May 19, 2002
May 19, 2002
50
}
May 28, 2006
May 28, 2006
51
return 0;
May 19, 2002
May 19, 2002
52
53
54
}
/* Quit the QPE Application, if there's nothing left to do */
May 28, 2006
May 28, 2006
55
void
May 29, 2006
May 29, 2006
56
SDL_QuitQPEApp(void)
May 19, 2002
May 19, 2002
57
{
May 28, 2006
May 28, 2006
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;
}
May 19, 2002
May 19, 2002
66
}
May 28, 2006
May 28, 2006
67
68
/* vi: set ts=4 sw=4 expandtab: */