mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-05 09:26:25 +00:00
os2: integrate the port into main tree.
This commit is contained in:
17
src/SDL.c
17
src/SDL.c
@@ -27,6 +27,12 @@
|
||||
#elif !defined(__WINRT__)
|
||||
#include <unistd.h> /* For _exit(), etc. */
|
||||
#endif
|
||||
#if defined(__OS2__)
|
||||
#include "core/os2/SDL_os2.h"
|
||||
#endif
|
||||
#if SDL_THREAD_OS2
|
||||
#include "thread/os2/SDL_systls_c.h"
|
||||
#endif
|
||||
|
||||
#if defined(__EMSCRIPTEN__)
|
||||
#include <emscripten.h>
|
||||
@@ -159,6 +165,10 @@ SDL_InitSubSystem(Uint32 flags)
|
||||
flags |= SDL_INIT_EVENTS;
|
||||
}
|
||||
|
||||
#if SDL_THREAD_OS2
|
||||
SDL_OS2TLSAlloc(); /* thread/os2/SDL_systls.c */
|
||||
#endif
|
||||
|
||||
#if SDL_VIDEO_DRIVER_WINDOWS
|
||||
if ((flags & (SDL_INIT_HAPTIC|SDL_INIT_JOYSTICK))) {
|
||||
if (SDL_HelperWindowCreate() < 0) {
|
||||
@@ -294,6 +304,13 @@ SDL_Init(Uint32 flags)
|
||||
void
|
||||
SDL_QuitSubSystem(Uint32 flags)
|
||||
{
|
||||
#if SDL_THREAD_OS2
|
||||
SDL_OS2TLSFree(); /* thread/os2/SDL_systls.c */
|
||||
#endif
|
||||
#if defined(__OS2__)
|
||||
SDL_OS2Quit();
|
||||
#endif
|
||||
|
||||
/* Shut down requested initialized subsystems */
|
||||
#if !SDL_SENSOR_DISABLED
|
||||
if ((flags & SDL_INIT_SENSOR)) {
|
||||
|
@@ -104,6 +104,9 @@ static const AudioBootStrap *const bootstrap[] = {
|
||||
#if SDL_AUDIO_DRIVER_JACK
|
||||
&JACK_bootstrap,
|
||||
#endif
|
||||
#if SDL_AUDIO_DRIVER_OS2
|
||||
&OS2AUDIO_bootstrap,
|
||||
#endif
|
||||
#if SDL_AUDIO_DRIVER_DISK
|
||||
&DISKAUDIO_bootstrap,
|
||||
#endif
|
||||
|
@@ -207,6 +207,7 @@ extern AudioBootStrap openslES_bootstrap;
|
||||
extern AudioBootStrap ANDROIDAUDIO_bootstrap;
|
||||
extern AudioBootStrap PSPAUDIO_bootstrap;
|
||||
extern AudioBootStrap EMSCRIPTENAUDIO_bootstrap;
|
||||
extern AudioBootStrap OS2AUDIO_bootstrap;
|
||||
|
||||
#endif /* SDL_sysaudio_h_ */
|
||||
|
||||
|
@@ -32,6 +32,10 @@
|
||||
#ifdef __WIN32__
|
||||
#include "../core/windows/SDL_windows.h" // For GetDoubleClickTime()
|
||||
#endif
|
||||
#if defined(__OS2__)
|
||||
#define INCL_WIN
|
||||
#include <os2.h>
|
||||
#endif
|
||||
|
||||
/* #define DEBUG_MOUSE */
|
||||
|
||||
@@ -54,6 +58,8 @@ SDL_MouseDoubleClickTimeChanged(void *userdata, const char *name, const char *ol
|
||||
} else {
|
||||
#ifdef __WIN32__
|
||||
mouse->double_click_time = GetDoubleClickTime();
|
||||
#elif defined(__OS2__)
|
||||
mouse->double_click_time = WinQuerySysValue(HWND_DESKTOP, SV_DBLCLKTIME);
|
||||
#else
|
||||
mouse->double_click_time = 500;
|
||||
#endif
|
||||
|
@@ -36,6 +36,8 @@
|
||||
#include "psp/SDL_systhread_c.h"
|
||||
#elif SDL_THREAD_STDCPP
|
||||
#include "stdcpp/SDL_systhread_c.h"
|
||||
#elif SDL_THREAD_OS2
|
||||
#include "os2/SDL_systhread_c.h"
|
||||
#else
|
||||
#error Need thread implementation for this platform
|
||||
#include "generic/SDL_systhread_c.h"
|
||||
|
@@ -436,6 +436,8 @@ extern VideoBootStrap VIVANTE_bootstrap;
|
||||
extern VideoBootStrap Emscripten_bootstrap;
|
||||
extern VideoBootStrap QNX_bootstrap;
|
||||
extern VideoBootStrap OFFSCREEN_bootstrap;
|
||||
extern VideoBootStrap OS2DIVE_bootstrap;
|
||||
extern VideoBootStrap OS2VMAN_bootstrap;
|
||||
|
||||
extern SDL_VideoDevice *SDL_GetVideoDevice(void);
|
||||
extern int SDL_AddBasicVideoDisplay(const SDL_DisplayMode * desktop_mode);
|
||||
|
@@ -112,6 +112,10 @@ static VideoBootStrap *bootstrap[] = {
|
||||
#if SDL_VIDEO_DRIVER_OFFSCREEN
|
||||
&OFFSCREEN_bootstrap,
|
||||
#endif
|
||||
#if SDL_VIDEO_DRIVER_OS2
|
||||
&OS2DIVE_bootstrap,
|
||||
&OS2VMAN_bootstrap,
|
||||
#endif
|
||||
#if SDL_VIDEO_DRIVER_DUMMY
|
||||
&DUMMY_bootstrap,
|
||||
#endif
|
||||
@@ -3926,9 +3930,11 @@ SDL_IsScreenKeyboardShown(SDL_Window *window)
|
||||
#if SDL_VIDEO_DRIVER_HAIKU
|
||||
#include "haiku/SDL_bmessagebox.h"
|
||||
#endif
|
||||
#if SDL_VIDEO_DRIVER_OS2
|
||||
#include "os2/SDL_os2messagebox.h"
|
||||
#endif
|
||||
|
||||
|
||||
#if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_WINRT || SDL_VIDEO_DRIVER_COCOA || SDL_VIDEO_DRIVER_UIKIT || SDL_VIDEO_DRIVER_X11 || SDL_VIDEO_DRIVER_HAIKU
|
||||
#if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_WINRT || SDL_VIDEO_DRIVER_COCOA || SDL_VIDEO_DRIVER_UIKIT || SDL_VIDEO_DRIVER_X11 || SDL_VIDEO_DRIVER_HAIKU || SDL_VIDEO_DRIVER_OS2
|
||||
static SDL_bool SDL_MessageboxValidForDriver(const SDL_MessageBoxData *messageboxdata, SDL_SYSWM_TYPE drivertype)
|
||||
{
|
||||
SDL_SysWMinfo info;
|
||||
@@ -4027,6 +4033,13 @@ SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
|
||||
HAIKU_ShowMessageBox(messageboxdata, buttonid) == 0) {
|
||||
retval = 0;
|
||||
}
|
||||
#endif
|
||||
#if SDL_VIDEO_DRIVER_OS2
|
||||
if (retval == -1 &&
|
||||
SDL_MessageboxValidForDriver(messageboxdata, SDL_SYSWM_OS2) &&
|
||||
OS2_ShowMessageBox(messageboxdata, buttonid) == 0) {
|
||||
retval = 0;
|
||||
}
|
||||
#endif
|
||||
if (retval == -1) {
|
||||
SDL_SetError("No message system available");
|
||||
|
Reference in New Issue
Block a user