21 #include "../../SDL_internal.h" 23 #if defined(__HAIKU__) 28 #include <storage/AppFileInfo.h> 29 #include <storage/Path.h> 30 #include <storage/Entry.h> 31 #include <storage/File.h> 39 #include "../../video/haiku/SDL_BWin.h" 45 #include "../../thread/SDL_systhread.h" 48 static int SDL_BeAppActive = 0;
52 StartBeApp(
void *unused)
57 const char *signature =
"application/x-SDL-executable";
61 if (get_next_image_info(B_CURRENT_TEAM, &cookie, &info) == B_OK) {
62 BFile
f(info.name, O_RDONLY);
63 if (
f.InitCheck() == B_OK) {
64 BAppFileInfo app_info(&
f);
65 if (app_info.InitCheck() == B_OK) {
66 char sig[B_MIME_TYPE_LENGTH];
67 if (app_info.GetSignature(sig) == B_OK)
68 signature = strndup(sig, B_MIME_TYPE_LENGTH);
85 if (SDL_BeAppActive <= 0) {
87 if (SDL_AppThread ==
NULL) {
88 return SDL_SetError(
"Couldn't create BApplication thread");
93 if (B_OK == be_app->GetAppInfo(&info)) {
94 entry_ref
ref = info.ref;
96 if (B_OK == entry.SetTo(&ref)) {
98 if (B_OK == path.SetTo(&entry)) {
99 if (B_OK == path.GetParent(&path)) {
108 }
while ((be_app ==
NULL) || be_app->IsLaunching());
129 if (SDL_BeAppActive == 0) {
130 if (SDL_AppThread !=
NULL) {
131 if (be_app !=
NULL) {
132 be_app->PostMessage(B_QUIT_REQUESTED);
135 SDL_AppThread =
NULL;
int32 _GetNumWindowSlots()
void _SetSDLWindow(SDL_Window *win, int32 winID)
SDL_Thread * SDL_CreateThreadInternal(int(*fn)(void *), const char *name, const size_t stacksize, void *data)
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
SDL_Window * GetSDLWindow(int32 winID)
void ClearID(SDL_BWin *bwin)
GLsizei const GLchar *const * path