mirror of https://github.com/encounter/SDL.git
haiku: Rename internal functions from BE_* to HAIKU_*
Fixes Bugzilla #2349.
This commit is contained in:
parent
c0ac09edcc
commit
941c5b4760
|
@ -231,7 +231,7 @@ private:
|
|||
SDL_SendMouseMotion(win, 0, 0, x, y);
|
||||
|
||||
/* Tell the application that the mouse passed over, redraw needed */
|
||||
BE_UpdateWindowFramebuffer(NULL,win,NULL,-1);
|
||||
HAIKU_UpdateWindowFramebuffer(NULL,win,NULL,-1);
|
||||
}
|
||||
|
||||
void _HandleMouseButton(BMessage *msg) {
|
||||
|
@ -274,11 +274,11 @@ private:
|
|||
}
|
||||
|
||||
/* Make sure this isn't a repeated event (key pressed and held) */
|
||||
if(state == SDL_PRESSED && BE_GetKeyState(scancode) == SDL_PRESSED) {
|
||||
if(state == SDL_PRESSED && HAIKU_GetKeyState(scancode) == SDL_PRESSED) {
|
||||
return;
|
||||
}
|
||||
BE_SetKeyState(scancode, state);
|
||||
SDL_SendKeyboardKey(state, BE_GetScancodeFromBeKey(scancode));
|
||||
HAIKU_SetKeyState(scancode, state);
|
||||
SDL_SendKeyboardKey(state, HAIKU_GetScancodeFromBeKey(scancode));
|
||||
|
||||
if (state == SDL_PRESSED && SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) {
|
||||
const int8 *keyUtf8;
|
||||
|
|
|
@ -88,7 +88,7 @@ class SDL_BWin:public BDirectWindow
|
|||
_clips = NULL;
|
||||
|
||||
#ifdef DRAWTHREAD
|
||||
_draw_thread_id = spawn_thread(BE_DrawThread, "drawing_thread",
|
||||
_draw_thread_id = spawn_thread(HAIKU_DrawThread, "drawing_thread",
|
||||
B_NORMAL_PRIORITY, (void*) this);
|
||||
resume_thread(_draw_thread_id);
|
||||
#endif
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
int BE_SetClipboardText(_THIS, const char *text) {
|
||||
int HAIKU_SetClipboardText(_THIS, const char *text) {
|
||||
BMessage *clip = NULL;
|
||||
if(be_clipboard->Lock()) {
|
||||
be_clipboard->Clear();
|
||||
|
@ -51,7 +51,7 @@ int BE_SetClipboardText(_THIS, const char *text) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
char *BE_GetClipboardText(_THIS) {
|
||||
char *HAIKU_GetClipboardText(_THIS) {
|
||||
BMessage *clip = NULL;
|
||||
const char *text = NULL;
|
||||
ssize_t length;
|
||||
|
@ -76,9 +76,9 @@ char *BE_GetClipboardText(_THIS) {
|
|||
return result;
|
||||
}
|
||||
|
||||
SDL_bool BE_HasClipboardText(_THIS) {
|
||||
SDL_bool HAIKU_HasClipboardText(_THIS) {
|
||||
SDL_bool result = SDL_FALSE;
|
||||
char *text = BE_GetClipboardText(_this);
|
||||
char *text = HAIKU_GetClipboardText(_this);
|
||||
if (text) {
|
||||
result = text[0] != '\0' ? SDL_TRUE : SDL_FALSE;
|
||||
SDL_free(text);
|
||||
|
|
|
@ -24,9 +24,9 @@
|
|||
#ifndef SDL_BCLIPBOARD_H
|
||||
#define SDL_BCLIPBOARD_H
|
||||
|
||||
extern int BE_SetClipboardText(_THIS, const char *text);
|
||||
extern char *BE_GetClipboardText(_THIS);
|
||||
extern SDL_bool BE_HasClipboardText(_THIS);
|
||||
extern int HAIKU_SetClipboardText(_THIS, const char *text);
|
||||
extern char *HAIKU_GetClipboardText(_THIS);
|
||||
extern SDL_bool HAIKU_HasClipboardText(_THIS);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
void BE_PumpEvents(_THIS) {
|
||||
void HAIKU_PumpEvents(_THIS) {
|
||||
/* Since the event thread is its own thread, this isn't really necessary */
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern void BE_PumpEvents(_THIS);
|
||||
extern void HAIKU_PumpEvents(_THIS);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
#ifndef DRAWTHREAD
|
||||
static int32 BE_UpdateOnce(SDL_Window *window);
|
||||
static int32 HAIKU_UpdateOnce(SDL_Window *window);
|
||||
#endif
|
||||
|
||||
static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) {
|
||||
|
@ -47,7 +47,7 @@ static SDL_INLINE SDL_BApp *_GetBeApp() {
|
|||
return ((SDL_BApp*)be_app);
|
||||
}
|
||||
|
||||
int BE_CreateWindowFramebuffer(_THIS, SDL_Window * window,
|
||||
int HAIKU_CreateWindowFramebuffer(_THIS, SDL_Window * window,
|
||||
Uint32 * format,
|
||||
void ** pixels, int *pitch) {
|
||||
SDL_BWin *bwin = _ToBeWin(window);
|
||||
|
@ -64,8 +64,8 @@ int BE_CreateWindowFramebuffer(_THIS, SDL_Window * window,
|
|||
/* format */
|
||||
display_mode bmode;
|
||||
bscreen.GetMode(&bmode);
|
||||
int32 bpp = BE_ColorSpaceToBitsPerPixel(bmode.space);
|
||||
*format = BE_BPPToSDLPxFormat(bpp);
|
||||
int32 bpp = HAIKU_ColorSpaceToBitsPerPixel(bmode.space);
|
||||
*format = HAIKU_BPPToSDLPxFormat(bpp);
|
||||
|
||||
/* Create the new bitmap object */
|
||||
BBitmap *bitmap = bwin->GetBitmap();
|
||||
|
@ -99,7 +99,7 @@ int BE_CreateWindowFramebuffer(_THIS, SDL_Window * window,
|
|||
|
||||
|
||||
|
||||
int BE_UpdateWindowFramebuffer(_THIS, SDL_Window * window,
|
||||
int HAIKU_UpdateWindowFramebuffer(_THIS, SDL_Window * window,
|
||||
const SDL_Rect * rects, int numrects) {
|
||||
if(!window)
|
||||
return 0;
|
||||
|
@ -112,13 +112,13 @@ int BE_UpdateWindowFramebuffer(_THIS, SDL_Window * window,
|
|||
bwin->UnlockBuffer();
|
||||
#else
|
||||
bwin->SetBufferDirty(true);
|
||||
BE_UpdateOnce(window);
|
||||
HAIKU_UpdateOnce(window);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32 BE_DrawThread(void *data) {
|
||||
int32 HAIKU_DrawThread(void *data) {
|
||||
SDL_BWin *bwin = (SDL_BWin*)data;
|
||||
|
||||
BScreen bscreen;
|
||||
|
@ -181,7 +181,7 @@ escape:
|
|||
return B_OK;
|
||||
}
|
||||
|
||||
void BE_DestroyWindowFramebuffer(_THIS, SDL_Window * window) {
|
||||
void HAIKU_DestroyWindowFramebuffer(_THIS, SDL_Window * window) {
|
||||
SDL_BWin *bwin = _ToBeWin(window);
|
||||
|
||||
bwin->LockBuffer();
|
||||
|
@ -202,7 +202,7 @@ void BE_DestroyWindowFramebuffer(_THIS, SDL_Window * window) {
|
|||
* solved, but I doubt it- they were pretty sporadic before now.
|
||||
*/
|
||||
#ifndef DRAWTHREAD
|
||||
static int32 BE_UpdateOnce(SDL_Window *window) {
|
||||
static int32 HAIKU_UpdateOnce(SDL_Window *window) {
|
||||
SDL_BWin *bwin = _ToBeWin(window);
|
||||
BScreen bscreen;
|
||||
if(!bscreen.IsValid()) {
|
||||
|
|
|
@ -30,13 +30,13 @@ extern "C" {
|
|||
|
||||
#include "../SDL_sysvideo.h"
|
||||
|
||||
extern int BE_CreateWindowFramebuffer(_THIS, SDL_Window * window,
|
||||
extern int HAIKU_CreateWindowFramebuffer(_THIS, SDL_Window * window,
|
||||
Uint32 * format,
|
||||
void ** pixels, int *pitch);
|
||||
extern int BE_UpdateWindowFramebuffer(_THIS, SDL_Window * window,
|
||||
extern int HAIKU_UpdateWindowFramebuffer(_THIS, SDL_Window * window,
|
||||
const SDL_Rect * rects, int numrects);
|
||||
extern void BE_DestroyWindowFramebuffer(_THIS, SDL_Window * window);
|
||||
extern int32 BE_DrawThread(void *data);
|
||||
extern void HAIKU_DestroyWindowFramebuffer(_THIS, SDL_Window * window);
|
||||
extern int32 HAIKU_DrawThread(void *data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ extern "C" {
|
|||
static SDL_Scancode keymap[KEYMAP_SIZE];
|
||||
static int8 keystate[KEYMAP_SIZE];
|
||||
|
||||
void BE_InitOSKeymap(void) {
|
||||
void HAIKU_InitOSKeymap(void) {
|
||||
for( uint i = 0; i < SDL_TABLESIZE(keymap); ++i ) {
|
||||
keymap[i] = SDL_SCANCODE_UNKNOWN;
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ void BE_InitOSKeymap(void) {
|
|||
keymap[0x6b] = SDL_GetScancodeFromKey(SDLK_POWER);
|
||||
}
|
||||
|
||||
SDL_Scancode BE_GetScancodeFromBeKey(int32 bkey) {
|
||||
SDL_Scancode HAIKU_GetScancodeFromBeKey(int32 bkey) {
|
||||
if(bkey > 0 && bkey < (int32)SDL_TABLESIZE(keymap)) {
|
||||
return keymap[bkey];
|
||||
} else {
|
||||
|
@ -167,7 +167,7 @@ SDL_Scancode BE_GetScancodeFromBeKey(int32 bkey) {
|
|||
}
|
||||
}
|
||||
|
||||
int8 BE_GetKeyState(int32 bkey) {
|
||||
int8 HAIKU_GetKeyState(int32 bkey) {
|
||||
if(bkey > 0 && bkey < KEYMAP_SIZE) {
|
||||
return keystate[bkey];
|
||||
} else {
|
||||
|
@ -175,7 +175,7 @@ int8 BE_GetKeyState(int32 bkey) {
|
|||
}
|
||||
}
|
||||
|
||||
void BE_SetKeyState(int32 bkey, int8 state) {
|
||||
void HAIKU_SetKeyState(int32 bkey, int8 state) {
|
||||
if(bkey > 0 && bkey < KEYMAP_SIZE) {
|
||||
keystate[bkey] = state;
|
||||
}
|
||||
|
|
|
@ -30,10 +30,10 @@ extern "C" {
|
|||
|
||||
#include "../../../include/SDL_keyboard.h"
|
||||
|
||||
extern void BE_InitOSKeymap(void);
|
||||
extern SDL_Scancode BE_GetScancodeFromBeKey(int32 bkey);
|
||||
extern int8 BE_GetKeyState(int32 bkey);
|
||||
extern void BE_SetKeyState(int32 bkey, int8 state);
|
||||
extern void HAIKU_InitOSKeymap(void);
|
||||
extern SDL_Scancode HAIKU_GetScancodeFromBeKey(int32 bkey);
|
||||
extern int8 HAIKU_GetKeyState(int32 bkey);
|
||||
extern void HAIKU_SetKeyState(int32 bkey, int8 state);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -132,7 +132,7 @@ void _SpoutModeData(display_mode *bmode) {
|
|||
|
||||
|
||||
|
||||
int32 BE_ColorSpaceToBitsPerPixel(uint32 colorspace)
|
||||
int32 HAIKU_ColorSpaceToBitsPerPixel(uint32 colorspace)
|
||||
{
|
||||
int bitsperpixel;
|
||||
|
||||
|
@ -163,7 +163,7 @@ int32 BE_ColorSpaceToBitsPerPixel(uint32 colorspace)
|
|||
return(bitsperpixel);
|
||||
}
|
||||
|
||||
int32 BE_BPPToSDLPxFormat(int32 bpp) {
|
||||
int32 HAIKU_BPPToSDLPxFormat(int32 bpp) {
|
||||
/* Translation taken from SDL_windowsmodes.c */
|
||||
switch (bpp) {
|
||||
case 32:
|
||||
|
@ -210,8 +210,8 @@ static void _BDisplayModeToSdlDisplayMode(display_mode *bmode,
|
|||
#endif
|
||||
|
||||
/* Set the format */
|
||||
int32 bpp = BE_ColorSpaceToBitsPerPixel(bmode->space);
|
||||
mode->format = BE_BPPToSDLPxFormat(bpp);
|
||||
int32 bpp = HAIKU_ColorSpaceToBitsPerPixel(bmode->space);
|
||||
mode->format = HAIKU_BPPToSDLPxFormat(bpp);
|
||||
}
|
||||
|
||||
/* Later, there may be more than one monitor available */
|
||||
|
@ -235,7 +235,7 @@ static void _AddDisplay(BScreen *screen) {
|
|||
* Functions called by SDL
|
||||
*/
|
||||
|
||||
int BE_InitModes(_THIS) {
|
||||
int HAIKU_InitModes(_THIS) {
|
||||
BScreen screen;
|
||||
|
||||
/* TODO: When Haiku supports multiple display screens, call
|
||||
|
@ -244,13 +244,13 @@ int BE_InitModes(_THIS) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int BE_QuitModes(_THIS) {
|
||||
int HAIKU_QuitModes(_THIS) {
|
||||
/* FIXME: Nothing really needs to be done here at the moment? */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int BE_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) {
|
||||
int HAIKU_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) {
|
||||
BScreen bscreen;
|
||||
BRect rc = bscreen.Frame();
|
||||
rect->x = (int)rc.left;
|
||||
|
@ -260,7 +260,7 @@ int BE_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
void BE_GetDisplayModes(_THIS, SDL_VideoDisplay *display) {
|
||||
void HAIKU_GetDisplayModes(_THIS, SDL_VideoDisplay *display) {
|
||||
/* Get the current screen */
|
||||
BScreen bscreen;
|
||||
|
||||
|
@ -285,7 +285,7 @@ void BE_GetDisplayModes(_THIS, SDL_VideoDisplay *display) {
|
|||
}
|
||||
|
||||
|
||||
int BE_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode){
|
||||
int HAIKU_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode){
|
||||
/* Get the current screen */
|
||||
BScreen bscreen;
|
||||
if(!bscreen.IsValid()) {
|
||||
|
@ -318,7 +318,7 @@ int BE_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode){
|
|||
#if SDL_VIDEO_OPENGL
|
||||
/* FIXME: Is there some way to reboot the OpenGL context? This doesn't
|
||||
help */
|
||||
// BE_GL_RebootContexts(_this);
|
||||
// HAIKU_GL_RebootContexts(_this);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -28,15 +28,15 @@ extern "C" {
|
|||
|
||||
#include "../SDL_sysvideo.h"
|
||||
|
||||
extern int32 BE_ColorSpaceToBitsPerPixel(uint32 colorspace);
|
||||
extern int32 BE_BPPToSDLPxFormat(int32 bpp);
|
||||
extern int32 HAIKU_ColorSpaceToBitsPerPixel(uint32 colorspace);
|
||||
extern int32 HAIKU_BPPToSDLPxFormat(int32 bpp);
|
||||
|
||||
extern int BE_InitModes(_THIS);
|
||||
extern int BE_QuitModes(_THIS);
|
||||
extern int BE_GetDisplayBounds(_THIS, SDL_VideoDisplay *display,
|
||||
extern int HAIKU_InitModes(_THIS);
|
||||
extern int HAIKU_QuitModes(_THIS);
|
||||
extern int HAIKU_GetDisplayBounds(_THIS, SDL_VideoDisplay *display,
|
||||
SDL_Rect *rect);
|
||||
extern void BE_GetDisplayModes(_THIS, SDL_VideoDisplay *display);
|
||||
extern int BE_SetDisplayMode(_THIS, SDL_VideoDisplay *display,
|
||||
extern void HAIKU_GetDisplayModes(_THIS, SDL_VideoDisplay *display);
|
||||
extern int HAIKU_SetDisplayMode(_THIS, SDL_VideoDisplay *display,
|
||||
SDL_DisplayMode *mode);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -44,7 +44,7 @@ static SDL_INLINE SDL_BApp *_GetBeApp() {
|
|||
}
|
||||
|
||||
/* Passing a NULL path means load pointers from the application */
|
||||
int BE_GL_LoadLibrary(_THIS, const char *path)
|
||||
int HAIKU_GL_LoadLibrary(_THIS, const char *path)
|
||||
{
|
||||
/* FIXME: Is this working correctly? */
|
||||
image_info info;
|
||||
|
@ -63,7 +63,7 @@ int BE_GL_LoadLibrary(_THIS, const char *path)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void *BE_GL_GetProcAddress(_THIS, const char *proc)
|
||||
void *HAIKU_GL_GetProcAddress(_THIS, const char *proc)
|
||||
{
|
||||
if (_this->gl_config.dll_handle != NULL) {
|
||||
void *location = NULL;
|
||||
|
@ -86,19 +86,19 @@ void *BE_GL_GetProcAddress(_THIS, const char *proc)
|
|||
|
||||
|
||||
|
||||
int BE_GL_SwapWindow(_THIS, SDL_Window * window) {
|
||||
int HAIKU_GL_SwapWindow(_THIS, SDL_Window * window) {
|
||||
_ToBeWin(window)->SwapBuffers();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int BE_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) {
|
||||
int HAIKU_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) {
|
||||
SDL_BWin* win = (SDL_BWin*)context;
|
||||
_GetBeApp()->SetCurrentContext(win ? win->GetGLView() : NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
SDL_GLContext BE_GL_CreateContext(_THIS, SDL_Window * window) {
|
||||
SDL_GLContext HAIKU_GL_CreateContext(_THIS, SDL_Window * window) {
|
||||
/* FIXME: Not sure what flags should be included here; may want to have
|
||||
most of them */
|
||||
SDL_BWin *bwin = _ToBeWin(window);
|
||||
|
@ -127,24 +127,24 @@ SDL_GLContext BE_GL_CreateContext(_THIS, SDL_Window * window) {
|
|||
return (SDL_GLContext)(bwin);
|
||||
}
|
||||
|
||||
void BE_GL_DeleteContext(_THIS, SDL_GLContext context) {
|
||||
void HAIKU_GL_DeleteContext(_THIS, SDL_GLContext context) {
|
||||
/* Currently, automatically unlocks the view */
|
||||
((SDL_BWin*)context)->RemoveGLView();
|
||||
}
|
||||
|
||||
|
||||
int BE_GL_SetSwapInterval(_THIS, int interval) {
|
||||
int HAIKU_GL_SetSwapInterval(_THIS, int interval) {
|
||||
/* TODO: Implement this, if necessary? */
|
||||
return SDL_Unsupported();
|
||||
}
|
||||
|
||||
int BE_GL_GetSwapInterval(_THIS) {
|
||||
int HAIKU_GL_GetSwapInterval(_THIS) {
|
||||
/* TODO: Implement this, if necessary? */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void BE_GL_UnloadLibrary(_THIS) {
|
||||
void HAIKU_GL_UnloadLibrary(_THIS) {
|
||||
/* TODO: Implement this, if necessary? */
|
||||
}
|
||||
|
||||
|
@ -152,7 +152,7 @@ void BE_GL_UnloadLibrary(_THIS) {
|
|||
/* FIXME: This function is meant to clear the OpenGL context when the video
|
||||
mode changes (see SDL_bmodes.cc), but it doesn't seem to help, and is not
|
||||
currently in use. */
|
||||
void BE_GL_RebootContexts(_THIS) {
|
||||
void HAIKU_GL_RebootContexts(_THIS) {
|
||||
SDL_Window *window = _this->windows;
|
||||
while(window) {
|
||||
SDL_BWin *bwin = _ToBeWin(window);
|
||||
|
|
|
@ -31,18 +31,18 @@ extern "C" {
|
|||
#include "../SDL_sysvideo.h"
|
||||
|
||||
|
||||
extern int BE_GL_LoadLibrary(_THIS, const char *path); /* FIXME */
|
||||
extern void *BE_GL_GetProcAddress(_THIS, const char *proc); /* FIXME */
|
||||
extern void BE_GL_UnloadLibrary(_THIS); /* TODO */
|
||||
extern int BE_GL_MakeCurrent(_THIS, SDL_Window * window,
|
||||
extern int HAIKU_GL_LoadLibrary(_THIS, const char *path); /* FIXME */
|
||||
extern void *HAIKU_GL_GetProcAddress(_THIS, const char *proc); /* FIXME */
|
||||
extern void HAIKU_GL_UnloadLibrary(_THIS); /* TODO */
|
||||
extern int HAIKU_GL_MakeCurrent(_THIS, SDL_Window * window,
|
||||
SDL_GLContext context);
|
||||
extern int BE_GL_SetSwapInterval(_THIS, int interval); /* TODO */
|
||||
extern int BE_GL_GetSwapInterval(_THIS); /* TODO */
|
||||
extern int BE_GL_SwapWindow(_THIS, SDL_Window * window);
|
||||
extern SDL_GLContext BE_GL_CreateContext(_THIS, SDL_Window * window);
|
||||
extern void BE_GL_DeleteContext(_THIS, SDL_GLContext context);
|
||||
extern int HAIKU_GL_SetSwapInterval(_THIS, int interval); /* TODO */
|
||||
extern int HAIKU_GL_GetSwapInterval(_THIS); /* TODO */
|
||||
extern int HAIKU_GL_SwapWindow(_THIS, SDL_Window * window);
|
||||
extern SDL_GLContext HAIKU_GL_CreateContext(_THIS, SDL_Window * window);
|
||||
extern void HAIKU_GL_DeleteContext(_THIS, SDL_GLContext context);
|
||||
|
||||
extern void BE_GL_RebootContexts(_THIS);
|
||||
extern void HAIKU_GL_RebootContexts(_THIS);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -37,17 +37,17 @@ extern "C" {
|
|||
#include "SDL_bevents.h"
|
||||
|
||||
/* FIXME: Undefined functions */
|
||||
// #define BE_PumpEvents NULL
|
||||
#define BE_StartTextInput NULL
|
||||
#define BE_StopTextInput NULL
|
||||
#define BE_SetTextInputRect NULL
|
||||
// #define HAIKU_PumpEvents NULL
|
||||
#define HAIKU_StartTextInput NULL
|
||||
#define HAIKU_StopTextInput NULL
|
||||
#define HAIKU_SetTextInputRect NULL
|
||||
|
||||
// #define BE_DeleteDevice NULL
|
||||
// #define HAIKU_DeleteDevice NULL
|
||||
|
||||
/* End undefined functions */
|
||||
|
||||
static SDL_VideoDevice *
|
||||
BE_CreateDevice(int devindex)
|
||||
HAIKU_CreateDevice(int devindex)
|
||||
{
|
||||
SDL_VideoDevice *device;
|
||||
/*SDL_VideoData *data;*/
|
||||
|
@ -61,78 +61,78 @@ BE_CreateDevice(int devindex)
|
|||
/* TODO: Figure out if any initialization needs to go here */
|
||||
|
||||
/* Set the function pointers */
|
||||
device->VideoInit = BE_VideoInit;
|
||||
device->VideoQuit = BE_VideoQuit;
|
||||
device->GetDisplayBounds = BE_GetDisplayBounds;
|
||||
device->GetDisplayModes = BE_GetDisplayModes;
|
||||
device->SetDisplayMode = BE_SetDisplayMode;
|
||||
device->PumpEvents = BE_PumpEvents;
|
||||
device->VideoInit = HAIKU_VideoInit;
|
||||
device->VideoQuit = HAIKU_VideoQuit;
|
||||
device->GetDisplayBounds = HAIKU_GetDisplayBounds;
|
||||
device->GetDisplayModes = HAIKU_GetDisplayModes;
|
||||
device->SetDisplayMode = HAIKU_SetDisplayMode;
|
||||
device->PumpEvents = HAIKU_PumpEvents;
|
||||
|
||||
device->CreateSDLWindow = BE_CreateWindow;
|
||||
device->CreateSDLWindowFrom = BE_CreateWindowFrom;
|
||||
device->SetWindowTitle = BE_SetWindowTitle;
|
||||
device->SetWindowIcon = BE_SetWindowIcon;
|
||||
device->SetWindowPosition = BE_SetWindowPosition;
|
||||
device->SetWindowSize = BE_SetWindowSize;
|
||||
device->ShowWindow = BE_ShowWindow;
|
||||
device->HideWindow = BE_HideWindow;
|
||||
device->RaiseWindow = BE_RaiseWindow;
|
||||
device->MaximizeWindow = BE_MaximizeWindow;
|
||||
device->MinimizeWindow = BE_MinimizeWindow;
|
||||
device->RestoreWindow = BE_RestoreWindow;
|
||||
device->SetWindowBordered = BE_SetWindowBordered;
|
||||
device->SetWindowResizable = BE_SetWindowResizable;
|
||||
device->SetWindowFullscreen = BE_SetWindowFullscreen;
|
||||
device->SetWindowGammaRamp = BE_SetWindowGammaRamp;
|
||||
device->GetWindowGammaRamp = BE_GetWindowGammaRamp;
|
||||
device->SetWindowGrab = BE_SetWindowGrab;
|
||||
device->DestroyWindow = BE_DestroyWindow;
|
||||
device->GetWindowWMInfo = BE_GetWindowWMInfo;
|
||||
device->CreateWindowFramebuffer = BE_CreateWindowFramebuffer;
|
||||
device->UpdateWindowFramebuffer = BE_UpdateWindowFramebuffer;
|
||||
device->DestroyWindowFramebuffer = BE_DestroyWindowFramebuffer;
|
||||
device->CreateSDLWindow = HAIKU_CreateWindow;
|
||||
device->CreateSDLWindowFrom = HAIKU_CreateWindowFrom;
|
||||
device->SetWindowTitle = HAIKU_SetWindowTitle;
|
||||
device->SetWindowIcon = HAIKU_SetWindowIcon;
|
||||
device->SetWindowPosition = HAIKU_SetWindowPosition;
|
||||
device->SetWindowSize = HAIKU_SetWindowSize;
|
||||
device->ShowWindow = HAIKU_ShowWindow;
|
||||
device->HideWindow = HAIKU_HideWindow;
|
||||
device->RaiseWindow = HAIKU_RaiseWindow;
|
||||
device->MaximizeWindow = HAIKU_MaximizeWindow;
|
||||
device->MinimizeWindow = HAIKU_MinimizeWindow;
|
||||
device->RestoreWindow = HAIKU_RestoreWindow;
|
||||
device->SetWindowBordered = HAIKU_SetWindowBordered;
|
||||
device->SetWindowResizable = HAIKU_SetWindowResizable;
|
||||
device->SetWindowFullscreen = HAIKU_SetWindowFullscreen;
|
||||
device->SetWindowGammaRamp = HAIKU_SetWindowGammaRamp;
|
||||
device->GetWindowGammaRamp = HAIKU_GetWindowGammaRamp;
|
||||
device->SetWindowGrab = HAIKU_SetWindowGrab;
|
||||
device->DestroyWindow = HAIKU_DestroyWindow;
|
||||
device->GetWindowWMInfo = HAIKU_GetWindowWMInfo;
|
||||
device->CreateWindowFramebuffer = HAIKU_CreateWindowFramebuffer;
|
||||
device->UpdateWindowFramebuffer = HAIKU_UpdateWindowFramebuffer;
|
||||
device->DestroyWindowFramebuffer = HAIKU_DestroyWindowFramebuffer;
|
||||
|
||||
device->shape_driver.CreateShaper = NULL;
|
||||
device->shape_driver.SetWindowShape = NULL;
|
||||
device->shape_driver.ResizeWindowShape = NULL;
|
||||
|
||||
#if SDL_VIDEO_OPENGL
|
||||
device->GL_LoadLibrary = BE_GL_LoadLibrary;
|
||||
device->GL_GetProcAddress = BE_GL_GetProcAddress;
|
||||
device->GL_UnloadLibrary = BE_GL_UnloadLibrary;
|
||||
device->GL_CreateContext = BE_GL_CreateContext;
|
||||
device->GL_MakeCurrent = BE_GL_MakeCurrent;
|
||||
device->GL_SetSwapInterval = BE_GL_SetSwapInterval;
|
||||
device->GL_GetSwapInterval = BE_GL_GetSwapInterval;
|
||||
device->GL_SwapWindow = BE_GL_SwapWindow;
|
||||
device->GL_DeleteContext = BE_GL_DeleteContext;
|
||||
device->GL_LoadLibrary = HAIKU_GL_LoadLibrary;
|
||||
device->GL_GetProcAddress = HAIKU_GL_GetProcAddress;
|
||||
device->GL_UnloadLibrary = HAIKU_GL_UnloadLibrary;
|
||||
device->GL_CreateContext = HAIKU_GL_CreateContext;
|
||||
device->GL_MakeCurrent = HAIKU_GL_MakeCurrent;
|
||||
device->GL_SetSwapInterval = HAIKU_GL_SetSwapInterval;
|
||||
device->GL_GetSwapInterval = HAIKU_GL_GetSwapInterval;
|
||||
device->GL_SwapWindow = HAIKU_GL_SwapWindow;
|
||||
device->GL_DeleteContext = HAIKU_GL_DeleteContext;
|
||||
#endif
|
||||
|
||||
device->StartTextInput = BE_StartTextInput;
|
||||
device->StopTextInput = BE_StopTextInput;
|
||||
device->SetTextInputRect = BE_SetTextInputRect;
|
||||
device->StartTextInput = HAIKU_StartTextInput;
|
||||
device->StopTextInput = HAIKU_StopTextInput;
|
||||
device->SetTextInputRect = HAIKU_SetTextInputRect;
|
||||
|
||||
device->SetClipboardText = BE_SetClipboardText;
|
||||
device->GetClipboardText = BE_GetClipboardText;
|
||||
device->HasClipboardText = BE_HasClipboardText;
|
||||
device->SetClipboardText = HAIKU_SetClipboardText;
|
||||
device->GetClipboardText = HAIKU_GetClipboardText;
|
||||
device->HasClipboardText = HAIKU_HasClipboardText;
|
||||
|
||||
device->free = BE_DeleteDevice;
|
||||
device->free = HAIKU_DeleteDevice;
|
||||
|
||||
return device;
|
||||
}
|
||||
|
||||
VideoBootStrap HAIKU_bootstrap = {
|
||||
"haiku", "Haiku graphics",
|
||||
BE_Available, BE_CreateDevice
|
||||
HAIKU_Available, HAIKU_CreateDevice
|
||||
};
|
||||
|
||||
void BE_DeleteDevice(SDL_VideoDevice * device)
|
||||
void HAIKU_DeleteDevice(SDL_VideoDevice * device)
|
||||
{
|
||||
SDL_free(device->driverdata);
|
||||
SDL_free(device);
|
||||
}
|
||||
|
||||
int BE_VideoInit(_THIS)
|
||||
int HAIKU_VideoInit(_THIS)
|
||||
{
|
||||
/* Initialize the Be Application for appserver interaction */
|
||||
if (SDL_InitBeApp() < 0) {
|
||||
|
@ -140,31 +140,31 @@ int BE_VideoInit(_THIS)
|
|||
}
|
||||
|
||||
/* Initialize video modes */
|
||||
BE_InitModes(_this);
|
||||
HAIKU_InitModes(_this);
|
||||
|
||||
/* Init the keymap */
|
||||
BE_InitOSKeymap();
|
||||
HAIKU_InitOSKeymap();
|
||||
|
||||
|
||||
#if SDL_VIDEO_OPENGL
|
||||
/* testgl application doesn't load library, just tries to load symbols */
|
||||
/* is it correct? if so we have to load library here */
|
||||
BE_GL_LoadLibrary(_this, NULL);
|
||||
HAIKU_GL_LoadLibrary(_this, NULL);
|
||||
#endif
|
||||
|
||||
/* We're done! */
|
||||
return (0);
|
||||
}
|
||||
|
||||
int BE_Available(void)
|
||||
int HAIKU_Available(void)
|
||||
{
|
||||
return (1);
|
||||
}
|
||||
|
||||
void BE_VideoQuit(_THIS)
|
||||
void HAIKU_VideoQuit(_THIS)
|
||||
{
|
||||
|
||||
BE_QuitModes(_this);
|
||||
HAIKU_QuitModes(_this);
|
||||
|
||||
SDL_QuitBeApp();
|
||||
}
|
||||
|
|
|
@ -30,10 +30,10 @@ extern "C" {
|
|||
#include "../SDL_sysvideo.h"
|
||||
|
||||
|
||||
extern void BE_VideoQuit(_THIS);
|
||||
extern int BE_VideoInit(_THIS);
|
||||
extern void BE_DeleteDevice(_THIS);
|
||||
extern int BE_Available(void);
|
||||
extern void HAIKU_VideoQuit(_THIS);
|
||||
extern int HAIKU_VideoInit(_THIS);
|
||||
extern void HAIKU_DeleteDevice(_THIS);
|
||||
extern int HAIKU_Available(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ static int _InitWindow(_THIS, SDL_Window *window) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int BE_CreateWindow(_THIS, SDL_Window *window) {
|
||||
int HAIKU_CreateWindow(_THIS, SDL_Window *window) {
|
||||
if (_InitWindow(_this, window) < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ int BE_CreateWindow(_THIS, SDL_Window *window) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int BE_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) {
|
||||
int HAIKU_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) {
|
||||
|
||||
SDL_BWin *otherBWin = (SDL_BWin*)data;
|
||||
if(!otherBWin->LockLooper())
|
||||
|
@ -117,73 +117,73 @@ int BE_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
void BE_SetWindowTitle(_THIS, SDL_Window * window) {
|
||||
void HAIKU_SetWindowTitle(_THIS, SDL_Window * window) {
|
||||
BMessage msg(BWIN_SET_TITLE);
|
||||
msg.AddString("window-title", window->title);
|
||||
_ToBeWin(window)->PostMessage(&msg);
|
||||
}
|
||||
|
||||
void BE_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) {
|
||||
void HAIKU_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) {
|
||||
/* FIXME: Icons not supported by Haiku */
|
||||
}
|
||||
|
||||
void BE_SetWindowPosition(_THIS, SDL_Window * window) {
|
||||
void HAIKU_SetWindowPosition(_THIS, SDL_Window * window) {
|
||||
BMessage msg(BWIN_MOVE_WINDOW);
|
||||
msg.AddInt32("window-x", window->x);
|
||||
msg.AddInt32("window-y", window->y);
|
||||
_ToBeWin(window)->PostMessage(&msg);
|
||||
}
|
||||
|
||||
void BE_SetWindowSize(_THIS, SDL_Window * window) {
|
||||
void HAIKU_SetWindowSize(_THIS, SDL_Window * window) {
|
||||
BMessage msg(BWIN_RESIZE_WINDOW);
|
||||
msg.AddInt32("window-w", window->w - 1);
|
||||
msg.AddInt32("window-h", window->h - 1);
|
||||
_ToBeWin(window)->PostMessage(&msg);
|
||||
}
|
||||
|
||||
void BE_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered) {
|
||||
void HAIKU_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered) {
|
||||
BMessage msg(BWIN_SET_BORDERED);
|
||||
msg.AddBool("window-border", bordered != SDL_FALSE);
|
||||
_ToBeWin(window)->PostMessage(&msg);
|
||||
}
|
||||
|
||||
void BE_SetWindowResizable(_THIS, SDL_Window * window, SDL_bool resizable) {
|
||||
void HAIKU_SetWindowResizable(_THIS, SDL_Window * window, SDL_bool resizable) {
|
||||
BMessage msg(BWIN_SET_RESIZABLE);
|
||||
msg.AddBool("window-resizable", resizable != SDL_FALSE);
|
||||
_ToBeWin(window)->PostMessage(&msg);
|
||||
}
|
||||
|
||||
void BE_ShowWindow(_THIS, SDL_Window * window) {
|
||||
void HAIKU_ShowWindow(_THIS, SDL_Window * window) {
|
||||
BMessage msg(BWIN_SHOW_WINDOW);
|
||||
_ToBeWin(window)->PostMessage(&msg);
|
||||
}
|
||||
|
||||
void BE_HideWindow(_THIS, SDL_Window * window) {
|
||||
void HAIKU_HideWindow(_THIS, SDL_Window * window) {
|
||||
BMessage msg(BWIN_HIDE_WINDOW);
|
||||
_ToBeWin(window)->PostMessage(&msg);
|
||||
}
|
||||
|
||||
void BE_RaiseWindow(_THIS, SDL_Window * window) {
|
||||
void HAIKU_RaiseWindow(_THIS, SDL_Window * window) {
|
||||
BMessage msg(BWIN_SHOW_WINDOW); /* Activate this window and move to front */
|
||||
_ToBeWin(window)->PostMessage(&msg);
|
||||
}
|
||||
|
||||
void BE_MaximizeWindow(_THIS, SDL_Window * window) {
|
||||
void HAIKU_MaximizeWindow(_THIS, SDL_Window * window) {
|
||||
BMessage msg(BWIN_MAXIMIZE_WINDOW);
|
||||
_ToBeWin(window)->PostMessage(&msg);
|
||||
}
|
||||
|
||||
void BE_MinimizeWindow(_THIS, SDL_Window * window) {
|
||||
void HAIKU_MinimizeWindow(_THIS, SDL_Window * window) {
|
||||
BMessage msg(BWIN_MINIMIZE_WINDOW);
|
||||
_ToBeWin(window)->PostMessage(&msg);
|
||||
}
|
||||
|
||||
void BE_RestoreWindow(_THIS, SDL_Window * window) {
|
||||
void HAIKU_RestoreWindow(_THIS, SDL_Window * window) {
|
||||
BMessage msg(BWIN_RESTORE_WINDOW);
|
||||
_ToBeWin(window)->PostMessage(&msg);
|
||||
}
|
||||
|
||||
void BE_SetWindowFullscreen(_THIS, SDL_Window * window,
|
||||
void HAIKU_SetWindowFullscreen(_THIS, SDL_Window * window,
|
||||
SDL_VideoDisplay * display, SDL_bool fullscreen) {
|
||||
/* Haiku tracks all video display information */
|
||||
BMessage msg(BWIN_FULLSCREEN);
|
||||
|
@ -192,29 +192,29 @@ void BE_SetWindowFullscreen(_THIS, SDL_Window * window,
|
|||
|
||||
}
|
||||
|
||||
int BE_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp) {
|
||||
int HAIKU_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp) {
|
||||
/* FIXME: Not Haiku supported */
|
||||
return -1;
|
||||
}
|
||||
|
||||
int BE_GetWindowGammaRamp(_THIS, SDL_Window * window, Uint16 * ramp) {
|
||||
int HAIKU_GetWindowGammaRamp(_THIS, SDL_Window * window, Uint16 * ramp) {
|
||||
/* FIXME: Not Haiku supported */
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
void BE_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed) {
|
||||
void HAIKU_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed) {
|
||||
/* TODO: Implement this! */
|
||||
}
|
||||
|
||||
void BE_DestroyWindow(_THIS, SDL_Window * window) {
|
||||
void HAIKU_DestroyWindow(_THIS, SDL_Window * window) {
|
||||
_ToBeWin(window)->LockLooper(); /* This MUST be locked */
|
||||
_GetBeApp()->ClearID(_ToBeWin(window));
|
||||
_ToBeWin(window)->Quit();
|
||||
window->driverdata = NULL;
|
||||
}
|
||||
|
||||
SDL_bool BE_GetWindowWMInfo(_THIS, SDL_Window * window,
|
||||
SDL_bool HAIKU_GetWindowWMInfo(_THIS, SDL_Window * window,
|
||||
struct SDL_SysWMinfo *info) {
|
||||
/* FIXME: What is the point of this? What information should be included? */
|
||||
return SDL_FALSE;
|
||||
|
|
|
@ -26,26 +26,26 @@
|
|||
#include "../SDL_sysvideo.h"
|
||||
|
||||
|
||||
extern int BE_CreateWindow(_THIS, SDL_Window *window);
|
||||
extern int BE_CreateWindowFrom(_THIS, SDL_Window * window, const void *data);
|
||||
extern void BE_SetWindowTitle(_THIS, SDL_Window * window);
|
||||
extern void BE_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon);
|
||||
extern void BE_SetWindowPosition(_THIS, SDL_Window * window);
|
||||
extern void BE_SetWindowSize(_THIS, SDL_Window * window);
|
||||
extern void BE_ShowWindow(_THIS, SDL_Window * window);
|
||||
extern void BE_HideWindow(_THIS, SDL_Window * window);
|
||||
extern void BE_RaiseWindow(_THIS, SDL_Window * window);
|
||||
extern void BE_MaximizeWindow(_THIS, SDL_Window * window);
|
||||
extern void BE_MinimizeWindow(_THIS, SDL_Window * window);
|
||||
extern void BE_RestoreWindow(_THIS, SDL_Window * window);
|
||||
extern void BE_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered);
|
||||
extern void BE_SetWindowResizable(_THIS, SDL_Window * window, SDL_bool resizable);
|
||||
extern void BE_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen);
|
||||
extern int BE_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp);
|
||||
extern int BE_GetWindowGammaRamp(_THIS, SDL_Window * window, Uint16 * ramp);
|
||||
extern void BE_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed);
|
||||
extern void BE_DestroyWindow(_THIS, SDL_Window * window);
|
||||
extern SDL_bool BE_GetWindowWMInfo(_THIS, SDL_Window * window,
|
||||
extern int HAIKU_CreateWindow(_THIS, SDL_Window *window);
|
||||
extern int HAIKU_CreateWindowFrom(_THIS, SDL_Window * window, const void *data);
|
||||
extern void HAIKU_SetWindowTitle(_THIS, SDL_Window * window);
|
||||
extern void HAIKU_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon);
|
||||
extern void HAIKU_SetWindowPosition(_THIS, SDL_Window * window);
|
||||
extern void HAIKU_SetWindowSize(_THIS, SDL_Window * window);
|
||||
extern void HAIKU_ShowWindow(_THIS, SDL_Window * window);
|
||||
extern void HAIKU_HideWindow(_THIS, SDL_Window * window);
|
||||
extern void HAIKU_RaiseWindow(_THIS, SDL_Window * window);
|
||||
extern void HAIKU_MaximizeWindow(_THIS, SDL_Window * window);
|
||||
extern void HAIKU_MinimizeWindow(_THIS, SDL_Window * window);
|
||||
extern void HAIKU_RestoreWindow(_THIS, SDL_Window * window);
|
||||
extern void HAIKU_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered);
|
||||
extern void HAIKU_SetWindowResizable(_THIS, SDL_Window * window, SDL_bool resizable);
|
||||
extern void HAIKU_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen);
|
||||
extern int HAIKU_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp);
|
||||
extern int HAIKU_GetWindowGammaRamp(_THIS, SDL_Window * window, Uint16 * ramp);
|
||||
extern void HAIKU_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed);
|
||||
extern void HAIKU_DestroyWindow(_THIS, SDL_Window * window);
|
||||
extern SDL_bool HAIKU_GetWindowWMInfo(_THIS, SDL_Window * window,
|
||||
struct SDL_SysWMinfo *info);
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue