haiku: Rename internal functions from BE_* to HAIKU_* Fixes Bugzilla #2349.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911
diff --git a/src/main/haiku/SDL_BApp.h b/src/main/haiku/SDL_BApp.h
index ba3f927..3c41675 100644
--- a/src/main/haiku/SDL_BApp.h
+++ b/src/main/haiku/SDL_BApp.h
@@ -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;
diff --git a/src/video/haiku/SDL_BWin.h b/src/video/haiku/SDL_BWin.h
index 3e61888..b385540 100644
--- a/src/video/haiku/SDL_BWin.h
+++ b/src/video/haiku/SDL_BWin.h
@@ -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
diff --git a/src/video/haiku/SDL_bclipboard.cc b/src/video/haiku/SDL_bclipboard.cc
index e7d01b9..0727fd1 100644
--- a/src/video/haiku/SDL_bclipboard.cc
+++ b/src/video/haiku/SDL_bclipboard.cc
@@ -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);
diff --git a/src/video/haiku/SDL_bclipboard.h b/src/video/haiku/SDL_bclipboard.h
index 2f7a1c2..de69ed3 100644
--- a/src/video/haiku/SDL_bclipboard.h
+++ b/src/video/haiku/SDL_bclipboard.h
@@ -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
diff --git a/src/video/haiku/SDL_bevents.cc b/src/video/haiku/SDL_bevents.cc
index c716731..e3884d3 100644
--- a/src/video/haiku/SDL_bevents.cc
+++ b/src/video/haiku/SDL_bevents.cc
@@ -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 */
}
diff --git a/src/video/haiku/SDL_bevents.h b/src/video/haiku/SDL_bevents.h
index 3c090c8..5c34fcf 100644
--- a/src/video/haiku/SDL_bevents.h
+++ b/src/video/haiku/SDL_bevents.h
@@ -28,7 +28,7 @@
extern "C" {
#endif
-extern void BE_PumpEvents(_THIS);
+extern void HAIKU_PumpEvents(_THIS);
#ifdef __cplusplus
}
diff --git a/src/video/haiku/SDL_bframebuffer.cc b/src/video/haiku/SDL_bframebuffer.cc
index f53c500..848d735 100644
--- a/src/video/haiku/SDL_bframebuffer.cc
+++ b/src/video/haiku/SDL_bframebuffer.cc
@@ -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()) {
diff --git a/src/video/haiku/SDL_bframebuffer.h b/src/video/haiku/SDL_bframebuffer.h
index ce0fc62..e48156d 100644
--- a/src/video/haiku/SDL_bframebuffer.h
+++ b/src/video/haiku/SDL_bframebuffer.h
@@ -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
}
diff --git a/src/video/haiku/SDL_bkeyboard.cc b/src/video/haiku/SDL_bkeyboard.cc
index 5c72ecf..d12d238 100644
--- a/src/video/haiku/SDL_bkeyboard.cc
+++ b/src/video/haiku/SDL_bkeyboard.cc
@@ -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;
}
diff --git a/src/video/haiku/SDL_bkeyboard.h b/src/video/haiku/SDL_bkeyboard.h
index 9620c9b..0184828 100644
--- a/src/video/haiku/SDL_bkeyboard.h
+++ b/src/video/haiku/SDL_bkeyboard.h
@@ -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
}
diff --git a/src/video/haiku/SDL_bmodes.cc b/src/video/haiku/SDL_bmodes.cc
index 1105342..1d86821 100644
--- a/src/video/haiku/SDL_bmodes.cc
+++ b/src/video/haiku/SDL_bmodes.cc
@@ -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;
diff --git a/src/video/haiku/SDL_bmodes.h b/src/video/haiku/SDL_bmodes.h
index 38f4b58..3abc1dc 100644
--- a/src/video/haiku/SDL_bmodes.h
+++ b/src/video/haiku/SDL_bmodes.h
@@ -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
diff --git a/src/video/haiku/SDL_bopengl.cc b/src/video/haiku/SDL_bopengl.cc
index 3456932..e599062 100644
--- a/src/video/haiku/SDL_bopengl.cc
+++ b/src/video/haiku/SDL_bopengl.cc
@@ -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);
diff --git a/src/video/haiku/SDL_bopengl.h b/src/video/haiku/SDL_bopengl.h
index bc0798c..b5b0de6 100644
--- a/src/video/haiku/SDL_bopengl.h
+++ b/src/video/haiku/SDL_bopengl.h
@@ -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
}
diff --git a/src/video/haiku/SDL_bvideo.cc b/src/video/haiku/SDL_bvideo.cc
index afe20e3..e6a9736 100644
--- a/src/video/haiku/SDL_bvideo.cc
+++ b/src/video/haiku/SDL_bvideo.cc
@@ -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->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->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 = 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();
}
diff --git a/src/video/haiku/SDL_bvideo.h b/src/video/haiku/SDL_bvideo.h
index 0e28220..a1d01fb 100644
--- a/src/video/haiku/SDL_bvideo.h
+++ b/src/video/haiku/SDL_bvideo.h
@@ -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
}
diff --git a/src/video/haiku/SDL_bwindow.cc b/src/video/haiku/SDL_bwindow.cc
index 0931abe..e89be1e 100644
--- a/src/video/haiku/SDL_bwindow.cc
+++ b/src/video/haiku/SDL_bwindow.cc
@@ -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;
diff --git a/src/video/haiku/SDL_bwindow.h b/src/video/haiku/SDL_bwindow.h
index 100ffed..2894f27 100644
--- a/src/video/haiku/SDL_bwindow.h
+++ b/src/video/haiku/SDL_bwindow.h
@@ -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);