Mercurial > sdl-ios-xcode
comparison src/video/qtopia/SDL_QPEApp.cc @ 1895:c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 10 Jul 2006 21:04:37 +0000 |
parents | 376665398b25 |
children |
comparison
equal
deleted
inserted
replaced
1894:c69cee13dd76 | 1895:c121d94672cb |
---|---|
31 | 31 |
32 /* Flag to tell whether or not the Be application is active or not */ | 32 /* Flag to tell whether or not the Be application is active or not */ |
33 int SDL_QPEAppActive = 0; | 33 int SDL_QPEAppActive = 0; |
34 static QPEApplication *app; | 34 static QPEApplication *app; |
35 | 35 |
36 int SDL_InitQPEApp() { | 36 int |
37 if(SDL_QPEAppActive <= 0) { | 37 SDL_InitQPEApp() |
38 if(!qApp) { | 38 { |
39 int argc = 1; | 39 if (SDL_QPEAppActive <= 0) { |
40 char *argv[] = { { "SDLApp" } }; | 40 if (!qApp) { |
41 app = new QPEApplication(argc, argv); | 41 int argc = 1; |
42 QWidget dummy; | 42 char *argv[] = { {"SDLApp"} }; |
43 app->showMainWidget(&dummy); | 43 app = new QPEApplication(argc, argv); |
44 } else { | 44 QWidget dummy; |
45 app = (QPEApplication*)qApp; | 45 app->showMainWidget(&dummy); |
46 } else { | |
47 app = (QPEApplication *) qApp; | |
48 } | |
49 SDL_QPEAppActive++; | |
46 } | 50 } |
47 SDL_QPEAppActive++; | 51 return 0; |
48 } | |
49 return 0; | |
50 } | 52 } |
51 | 53 |
52 /* Quit the QPE Application, if there's nothing left to do */ | 54 /* Quit the QPE Application, if there's nothing left to do */ |
53 void SDL_QuitQPEApp(void) | 55 void |
56 SDL_QuitQPEApp(void) | |
54 { | 57 { |
55 /* Decrement the application reference count */ | 58 /* Decrement the application reference count */ |
56 SDL_QPEAppActive--; | 59 SDL_QPEAppActive--; |
57 /* If the reference count reached zero, clean up the app */ | 60 /* If the reference count reached zero, clean up the app */ |
58 if ( SDL_QPEAppActive == 0 && app) { | 61 if (SDL_QPEAppActive == 0 && app) { |
59 delete app; | 62 delete app; |
60 app = 0; | 63 app = 0; |
61 qApp = 0; | 64 qApp = 0; |
62 } | 65 } |
63 } | 66 } |
67 | |
68 /* vi: set ts=4 sw=4 expandtab: */ |