mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-10 03:46:27 +00:00
Haiku: use a BLooper for events, only create a BApplication when it doesn't already exist. (#7555)
This commit is contained in:
@@ -47,6 +47,7 @@ extern "C" {
|
||||
#include <vector>
|
||||
|
||||
/* Forward declarations */
|
||||
class SDL_BLooper;
|
||||
class SDL_BWin;
|
||||
|
||||
/* Message constants */
|
||||
@@ -72,31 +73,25 @@ enum ToSDL
|
||||
BAPP_SCREEN_CHANGED
|
||||
};
|
||||
|
||||
/* Create a descendant of BApplication */
|
||||
class SDL_BApp : public BApplication
|
||||
|
||||
extern "C" SDL_BLooper *SDL_Looper;
|
||||
|
||||
|
||||
/* Create a descendant of BLooper */
|
||||
class SDL_BLooper : public BLooper
|
||||
{
|
||||
public:
|
||||
SDL_BApp(const char *signature) : BApplication(signature)
|
||||
SDL_BLooper(const char* name) : BLooper(name)
|
||||
{
|
||||
#ifdef SDL_VIDEO_OPENGL
|
||||
_current_context = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
virtual ~SDL_BApp()
|
||||
virtual ~SDL_BLooper()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void RefsReceived(BMessage *message)
|
||||
{
|
||||
entry_ref entryRef;
|
||||
for (int32 i = 0; message->FindRef("refs", i, &entryRef) == B_OK; i++) {
|
||||
BPath referencePath = BPath(&entryRef);
|
||||
SDL_SendDropFile(NULL, referencePath.Path());
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* Event-handling functions */
|
||||
virtual void MessageReceived(BMessage *message)
|
||||
{
|
||||
@@ -167,7 +162,7 @@ class SDL_BApp : public BApplication
|
||||
break;
|
||||
|
||||
default:
|
||||
BApplication::MessageReceived(message);
|
||||
BLooper::MessageReceived(message);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user