Renamed all .c files in src/video/bwindow to .cc files.
authorNathan Heisey <nathanheisey@gmail.com>
Wed, 13 Jul 2011 09:29:43 +0000
changeset 59182063df37190b
parent 5917 cfd6c08e2326
child 5919 e19c4c44f224
Renamed all .c files in src/video/bwindow to .cc files.
src/video/bwindow/SDL_bclipboard.c
src/video/bwindow/SDL_bclipboard.cc
src/video/bwindow/SDL_bmodes.c
src/video/bwindow/SDL_bmodes.cc
src/video/bwindow/SDL_bopengl.c
src/video/bwindow/SDL_bopengl.cc
src/video/bwindow/SDL_bvideo.c
src/video/bwindow/SDL_bvideo.cc
src/video/bwindow/SDL_bwindow.c
src/video/bwindow/SDL_bwindow.cc
     1.1 --- a/src/video/bwindow/SDL_bclipboard.c	Tue Jul 12 15:09:44 2011 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,109 +0,0 @@
     1.4 -/*
     1.5 -  Simple DirectMedia Layer
     1.6 -  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
     1.7 -
     1.8 -  This software is provided 'as-is', without any express or implied
     1.9 -  warranty.  In no event will the authors be held liable for any damages
    1.10 -  arising from the use of this software.
    1.11 -
    1.12 -  Permission is granted to anyone to use this software for any purpose,
    1.13 -  including commercial applications, and to alter it and redistribute it
    1.14 -  freely, subject to the following restrictions:
    1.15 -
    1.16 -  1. The origin of this software must not be misrepresented; you must not
    1.17 -     claim that you wrote the original software. If you use this software
    1.18 -     in a product, an acknowledgment in the product documentation would be
    1.19 -     appreciated but is not required.
    1.20 -  2. Altered source versions must be plainly marked as such, and must not be
    1.21 -     misrepresented as being the original software.
    1.22 -  3. This notice may not be removed or altered from any source distribution.
    1.23 -*/
    1.24 -
    1.25 -
    1.26 -/* BWindow based framebuffer implementation */
    1.27 -#include "SDL_config.h"
    1.28 -
    1.29 -#include <unistd.h>
    1.30 -#include <TypeConstants.h>
    1.31 -
    1.32 -#include "SDL_BWin.h"
    1.33 -#include "SDL_timer.h"
    1.34 -#include "../SDL_sysvideo.h"
    1.35 -
    1.36 -#ifdef __cplusplus
    1.37 -extern "C" {
    1.38 -#endif
    1.39 -
    1.40 -int BE_SetClipboardText(_THIS, const char *text) {
    1.41 -#if 0
    1.42 -	BMessage *clip = NULL;
    1.43 -	if(be_clipboard->Lock()) {
    1.44 -		be_clipboard->Clear();
    1.45 -		if((clip = be_clipboard->Data())) {
    1.46 -			/* Presumably the string of characters is ascii-format */
    1.47 -			ssize_t asciiLength = 0;
    1.48 -			for(; text[asciiLength] != 0; ++asciiLength) {}
    1.49 -			clip->AddData("text/plain", B_MIME_TYPE, &text, asciiLength);
    1.50 -			be_clipboard->Commit();
    1.51 -		}
    1.52 -		be_clipboard->Unlock();
    1.53 -	}
    1.54 -#else
    1.55 -return -1;
    1.56 -#endif
    1.57 -}
    1.58 -
    1.59 -char *BE_GetClipboardText(_THIS) {
    1.60 -#if 0
    1.61 -	BMessage *clip = NULL;
    1.62 -	const char *text;
    1.63 -	ssize_t length;
    1.64 -	if(be_clipboard->Lock()) {
    1.65 -		if((clip = be_clipboard->Data())) {
    1.66 -			/* Presumably the string of characters is ascii-format */
    1.67 -			clip->FindData("text/plain", B_MIME_TYPE, (void**)&text, &length);
    1.68 -		} else {
    1.69 -			be_clipboard->Unlock();
    1.70 -			return NULL;
    1.71 -		}
    1.72 -		be_clipboard->Unlock();
    1.73 -	} else {
    1.74 -		return NULL;
    1.75 -	}
    1.76 -	
    1.77 -	/* Copy the data and pass on to SDL */
    1.78 -	char *result = (char*)SDL_calloc(1, sizeof(char*)*length);
    1.79 -	SDL_strlcpy(result, text, length);
    1.80 -	
    1.81 -	return result;
    1.82 -#else
    1.83 -return NULL;
    1.84 -#endif;
    1.85 -}
    1.86 -
    1.87 -SDL_bool BE_HasClipboardText(_THIS) {
    1.88 -#if 0
    1.89 -	BMessage *clip = NULL;
    1.90 -	const char *text;
    1.91 -	ssize_t length;
    1.92 -	SDL_bool retval = SDL_FALSE;
    1.93 -	
    1.94 -	if(be_clipboard->Lock()) {
    1.95 -		if((clip = be_clipboard->Data())) {
    1.96 -			/* Presumably the string of characters is ascii-format */
    1.97 -			clip->FindData("text/plain", B_MIME_TYPE, (void**)&text, &length);
    1.98 -			if( text ) retval = SDL_TRUE;
    1.99 -		}
   1.100 -		be_clipboard->Unlock();
   1.101 -	}
   1.102 -	return retval;
   1.103 -#else
   1.104 -return SDL_FALSE;
   1.105 -#endif
   1.106 -
   1.107 -}
   1.108 -
   1.109 -#ifdef __cplusplus
   1.110 -}					/* Extern C */
   1.111 -#endif
   1.112 -
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/src/video/bwindow/SDL_bclipboard.cc	Wed Jul 13 09:29:43 2011 +0000
     2.3 @@ -0,0 +1,109 @@
     2.4 +/*
     2.5 +  Simple DirectMedia Layer
     2.6 +  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
     2.7 +
     2.8 +  This software is provided 'as-is', without any express or implied
     2.9 +  warranty.  In no event will the authors be held liable for any damages
    2.10 +  arising from the use of this software.
    2.11 +
    2.12 +  Permission is granted to anyone to use this software for any purpose,
    2.13 +  including commercial applications, and to alter it and redistribute it
    2.14 +  freely, subject to the following restrictions:
    2.15 +
    2.16 +  1. The origin of this software must not be misrepresented; you must not
    2.17 +     claim that you wrote the original software. If you use this software
    2.18 +     in a product, an acknowledgment in the product documentation would be
    2.19 +     appreciated but is not required.
    2.20 +  2. Altered source versions must be plainly marked as such, and must not be
    2.21 +     misrepresented as being the original software.
    2.22 +  3. This notice may not be removed or altered from any source distribution.
    2.23 +*/
    2.24 +
    2.25 +
    2.26 +/* BWindow based framebuffer implementation */
    2.27 +#include "SDL_config.h"
    2.28 +
    2.29 +#include <unistd.h>
    2.30 +#include <TypeConstants.h>
    2.31 +
    2.32 +#include "SDL_BWin.h"
    2.33 +#include "SDL_timer.h"
    2.34 +#include "../SDL_sysvideo.h"
    2.35 +
    2.36 +#ifdef __cplusplus
    2.37 +extern "C" {
    2.38 +#endif
    2.39 +
    2.40 +int BE_SetClipboardText(_THIS, const char *text) {
    2.41 +#if 0
    2.42 +	BMessage *clip = NULL;
    2.43 +	if(be_clipboard->Lock()) {
    2.44 +		be_clipboard->Clear();
    2.45 +		if((clip = be_clipboard->Data())) {
    2.46 +			/* Presumably the string of characters is ascii-format */
    2.47 +			ssize_t asciiLength = 0;
    2.48 +			for(; text[asciiLength] != 0; ++asciiLength) {}
    2.49 +			clip->AddData("text/plain", B_MIME_TYPE, &text, asciiLength);
    2.50 +			be_clipboard->Commit();
    2.51 +		}
    2.52 +		be_clipboard->Unlock();
    2.53 +	}
    2.54 +#else
    2.55 +return -1;
    2.56 +#endif
    2.57 +}
    2.58 +
    2.59 +char *BE_GetClipboardText(_THIS) {
    2.60 +#if 0
    2.61 +	BMessage *clip = NULL;
    2.62 +	const char *text;
    2.63 +	ssize_t length;
    2.64 +	if(be_clipboard->Lock()) {
    2.65 +		if((clip = be_clipboard->Data())) {
    2.66 +			/* Presumably the string of characters is ascii-format */
    2.67 +			clip->FindData("text/plain", B_MIME_TYPE, (void**)&text, &length);
    2.68 +		} else {
    2.69 +			be_clipboard->Unlock();
    2.70 +			return NULL;
    2.71 +		}
    2.72 +		be_clipboard->Unlock();
    2.73 +	} else {
    2.74 +		return NULL;
    2.75 +	}
    2.76 +	
    2.77 +	/* Copy the data and pass on to SDL */
    2.78 +	char *result = (char*)SDL_calloc(1, sizeof(char*)*length);
    2.79 +	SDL_strlcpy(result, text, length);
    2.80 +	
    2.81 +	return result;
    2.82 +#else
    2.83 +return NULL;
    2.84 +#endif;
    2.85 +}
    2.86 +
    2.87 +SDL_bool BE_HasClipboardText(_THIS) {
    2.88 +#if 0
    2.89 +	BMessage *clip = NULL;
    2.90 +	const char *text;
    2.91 +	ssize_t length;
    2.92 +	SDL_bool retval = SDL_FALSE;
    2.93 +	
    2.94 +	if(be_clipboard->Lock()) {
    2.95 +		if((clip = be_clipboard->Data())) {
    2.96 +			/* Presumably the string of characters is ascii-format */
    2.97 +			clip->FindData("text/plain", B_MIME_TYPE, (void**)&text, &length);
    2.98 +			if( text ) retval = SDL_TRUE;
    2.99 +		}
   2.100 +		be_clipboard->Unlock();
   2.101 +	}
   2.102 +	return retval;
   2.103 +#else
   2.104 +return SDL_FALSE;
   2.105 +#endif
   2.106 +
   2.107 +}
   2.108 +
   2.109 +#ifdef __cplusplus
   2.110 +}					/* Extern C */
   2.111 +#endif
   2.112 +
     3.1 --- a/src/video/bwindow/SDL_bmodes.c	Tue Jul 12 15:09:44 2011 +0000
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,78 +0,0 @@
     3.4 -/*
     3.5 -  Simple DirectMedia Layer
     3.6 -  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
     3.7 -
     3.8 -  This software is provided 'as-is', without any express or implied
     3.9 -  warranty.  In no event will the authors be held liable for any damages
    3.10 -  arising from the use of this software.
    3.11 -
    3.12 -  Permission is granted to anyone to use this software for any purpose,
    3.13 -  including commercial applications, and to alter it and redistribute it
    3.14 -  freely, subject to the following restrictions:
    3.15 -
    3.16 -  1. The origin of this software must not be misrepresented; you must not
    3.17 -     claim that you wrote the original software. If you use this software
    3.18 -     in a product, an acknowledgment in the product documentation would be
    3.19 -     appreciated but is not required.
    3.20 -  2. Altered source versions must be plainly marked as such, and must not be
    3.21 -     misrepresented as being the original software.
    3.22 -  3. This notice may not be removed or altered from any source distribution.
    3.23 -*/
    3.24 -
    3.25 -#include "../SDL_sysvideo.h"
    3.26 -
    3.27 -int BE_InitModes(_THIS) {
    3.28 -#if 0
    3.29 -	display_mode *modes;
    3.30 -	uint32 i, nmodes;
    3.31 -	int bpp;
    3.32 -
    3.33 -	/* It is important that this be created after SDL_InitBeApp() */
    3.34 -	BScreen bscreen;
    3.35 -
    3.36 -	/* Save the current display mode */
    3.37 -	bscreen.GetMode(&saved_mode);
    3.38 -	_this->info.current_w = saved_mode.virtual_width;
    3.39 -	_this->info.current_h = saved_mode.virtual_height;
    3.40 -        
    3.41 -	/* Get the video modes we can switch to in fullscreen mode */
    3.42 -	bscreen.GetModeList(&modes, &nmodes);
    3.43 -	SDL_qsort(modes, nmodes, sizeof *modes, CompareModes);
    3.44 -	for (i = 0; i < nmodes; ++i) {
    3.45 -		bpp = ColorSpaceToBitsPerPixel(modes[i].space);
    3.46 -		//if ( bpp != 0 ) { // There are bugs in changing colorspace
    3.47 -		if (modes[i].space == saved_mode.space) {
    3.48 -			BE_AddMode(_this, ((bpp + 7) / 8) - 1,
    3.49 -				modes[i].virtual_width, modes[i].virtual_height);
    3.50 -		}
    3.51 -	}
    3.52 -#else
    3.53 -return -1;
    3.54 -#endif
    3.55 -}
    3.56 -
    3.57 -int BE_QuitModes(_THIS) {
    3.58 -#if 0
    3.59 -    int i, j;
    3.60 -	for (i = 0; i < NUM_MODELISTS; ++i) {
    3.61 -		if (SDL_modelist[i]) {
    3.62 -			for (j = 0; SDL_modelist[i][j]; ++j) {
    3.63 -				SDL_free(SDL_modelist[i][j]);
    3.64 -			}
    3.65 -			SDL_free(SDL_modelist[i]);
    3.66 -			SDL_modelist[i] = NULL;
    3.67 -		}
    3.68 -	}
    3.69 -
    3.70 -	/* Restore the original video mode */
    3.71 -	if (_this->screen) {
    3.72 -		if ((_this->screen->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN) {
    3.73 -			BScreen bscreen;
    3.74 -			bscreen.SetMode(&saved_mode);
    3.75 -		}
    3.76 -		_this->screen->pixels = NULL;
    3.77 -	}
    3.78 -#else
    3.79 -return -1;
    3.80 -#endif
    3.81 -}
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/src/video/bwindow/SDL_bmodes.cc	Wed Jul 13 09:29:43 2011 +0000
     4.3 @@ -0,0 +1,78 @@
     4.4 +/*
     4.5 +  Simple DirectMedia Layer
     4.6 +  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
     4.7 +
     4.8 +  This software is provided 'as-is', without any express or implied
     4.9 +  warranty.  In no event will the authors be held liable for any damages
    4.10 +  arising from the use of this software.
    4.11 +
    4.12 +  Permission is granted to anyone to use this software for any purpose,
    4.13 +  including commercial applications, and to alter it and redistribute it
    4.14 +  freely, subject to the following restrictions:
    4.15 +
    4.16 +  1. The origin of this software must not be misrepresented; you must not
    4.17 +     claim that you wrote the original software. If you use this software
    4.18 +     in a product, an acknowledgment in the product documentation would be
    4.19 +     appreciated but is not required.
    4.20 +  2. Altered source versions must be plainly marked as such, and must not be
    4.21 +     misrepresented as being the original software.
    4.22 +  3. This notice may not be removed or altered from any source distribution.
    4.23 +*/
    4.24 +
    4.25 +#include "../SDL_sysvideo.h"
    4.26 +
    4.27 +int BE_InitModes(_THIS) {
    4.28 +#if 0
    4.29 +	display_mode *modes;
    4.30 +	uint32 i, nmodes;
    4.31 +	int bpp;
    4.32 +
    4.33 +	/* It is important that this be created after SDL_InitBeApp() */
    4.34 +	BScreen bscreen;
    4.35 +
    4.36 +	/* Save the current display mode */
    4.37 +	bscreen.GetMode(&saved_mode);
    4.38 +	_this->info.current_w = saved_mode.virtual_width;
    4.39 +	_this->info.current_h = saved_mode.virtual_height;
    4.40 +        
    4.41 +	/* Get the video modes we can switch to in fullscreen mode */
    4.42 +	bscreen.GetModeList(&modes, &nmodes);
    4.43 +	SDL_qsort(modes, nmodes, sizeof *modes, CompareModes);
    4.44 +	for (i = 0; i < nmodes; ++i) {
    4.45 +		bpp = ColorSpaceToBitsPerPixel(modes[i].space);
    4.46 +		//if ( bpp != 0 ) { // There are bugs in changing colorspace
    4.47 +		if (modes[i].space == saved_mode.space) {
    4.48 +			BE_AddMode(_this, ((bpp + 7) / 8) - 1,
    4.49 +				modes[i].virtual_width, modes[i].virtual_height);
    4.50 +		}
    4.51 +	}
    4.52 +#else
    4.53 +return -1;
    4.54 +#endif
    4.55 +}
    4.56 +
    4.57 +int BE_QuitModes(_THIS) {
    4.58 +#if 0
    4.59 +    int i, j;
    4.60 +	for (i = 0; i < NUM_MODELISTS; ++i) {
    4.61 +		if (SDL_modelist[i]) {
    4.62 +			for (j = 0; SDL_modelist[i][j]; ++j) {
    4.63 +				SDL_free(SDL_modelist[i][j]);
    4.64 +			}
    4.65 +			SDL_free(SDL_modelist[i]);
    4.66 +			SDL_modelist[i] = NULL;
    4.67 +		}
    4.68 +	}
    4.69 +
    4.70 +	/* Restore the original video mode */
    4.71 +	if (_this->screen) {
    4.72 +		if ((_this->screen->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN) {
    4.73 +			BScreen bscreen;
    4.74 +			bscreen.SetMode(&saved_mode);
    4.75 +		}
    4.76 +		_this->screen->pixels = NULL;
    4.77 +	}
    4.78 +#else
    4.79 +return -1;
    4.80 +#endif
    4.81 +}
     5.1 --- a/src/video/bwindow/SDL_bopengl.c	Tue Jul 12 15:09:44 2011 +0000
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,195 +0,0 @@
     5.4 -/*
     5.5 -  Simple DirectMedia Layer
     5.6 -  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
     5.7 -
     5.8 -  This software is provided 'as-is', without any express or implied
     5.9 -  warranty.  In no event will the authors be held liable for any damages
    5.10 -  arising from the use of this software.
    5.11 -
    5.12 -  Permission is granted to anyone to use this software for any purpose,
    5.13 -  including commercial applications, and to alter it and redistribute it
    5.14 -  freely, subject to the following restrictions:
    5.15 -
    5.16 -  1. The origin of this software must not be misrepresented; you must not
    5.17 -     claim that you wrote the original software. If you use this software
    5.18 -     in a product, an acknowledgment in the product documentation would be
    5.19 -     appreciated but is not required.
    5.20 -  2. Altered source versions must be plainly marked as such, and must not be
    5.21 -     misrepresented as being the original software.
    5.22 -  3. This notice may not be removed or altered from any source distribution.
    5.23 -*/
    5.24 -
    5.25 -#include "SDL_bopengl.h"
    5.26 -#include "../SDL_sysvideo.h"
    5.27 -
    5.28 -
    5.29 -/* Passing a NULL path means load pointers from the application */
    5.30 -int BE_GL_LoadLibrary(_THIS, const char *path)
    5.31 -{
    5.32 -#if 0
    5.33 -	if (path == NULL) {
    5.34 -		if (_this->gl_config.dll_handle == NULL) {
    5.35 -			image_info info;
    5.36 -			int32 cookie = 0;
    5.37 -			while (get_next_image_info(0, &cookie, &info) == B_OK) {
    5.38 -				void *location = NULL;
    5.39 -				if (get_image_symbol
    5.40 -				((image_id) cookie, "glBegin",
    5.41 -				B_SYMBOL_TYPE_ANY, &location) == B_OK) {
    5.42 -					_this->gl_config.dll_handle = (void *) cookie;
    5.43 -					_this->gl_config.driver_loaded = 1;
    5.44 -					SDL_strlcpy(_this->gl_config.driver_path,
    5.45 -					"libGL.so",
    5.46 -					SDL_arraysize(_this->
    5.47 -					gl_config.driver_path));
    5.48 -				}
    5.49 -			}
    5.50 -		}
    5.51 -	} else {
    5.52 -        /*
    5.53 -           FIXME None of BeOS libGL.so implementations have exported functions 
    5.54 -           to load BGLView, which should be reloaded from new lib.
    5.55 -           So for now just "load" linked libGL.so :(
    5.56 -        */
    5.57 -        if (_this->gl_config.dll_handle == NULL) {
    5.58 -        	return BE_GL_LoadLibrary(_this, NULL);
    5.59 -        }
    5.60 -
    5.61 -            /* Unload old first */
    5.62 -            /*if (_this->gl_config.dll_handle != NULL) { */
    5.63 -            /* Do not try to unload application itself (if LoadLibrary was called before with NULL ;) */
    5.64 -            /*      image_info info;
    5.65 -               if (get_image_info((image_id)_this->gl_config.dll_handle, &info) == B_OK) {
    5.66 -               if (info.type != B_APP_IMAGE) {
    5.67 -               unload_add_on((image_id)_this->gl_config.dll_handle);
    5.68 -               }
    5.69 -               }
    5.70 -
    5.71 -               }
    5.72 -
    5.73 -               if ((_this->gl_config.dll_handle = (void*)load_add_on(path)) != (void*)B_ERROR) {
    5.74 -               _this->gl_config.driver_loaded = 1;
    5.75 -               SDL_strlcpy(_this->gl_config.driver_path, path, SDL_arraysize(_this->gl_config.driver_path));
    5.76 -               } */
    5.77 -	}
    5.78 -	
    5.79 -	if (_this->gl_config.dll_handle != NULL) {
    5.80 -		return 0;
    5.81 -	} else {
    5.82 -		_this->gl_config.dll_handle = NULL;
    5.83 -		_this->gl_config.driver_loaded = 0;
    5.84 -		*_this->gl_config.driver_path = '\0';
    5.85 -		return -1;
    5.86 -	}
    5.87 -#endif
    5.88 -}
    5.89 -
    5.90 -void *BE_GL_GetProcAddress(_THIS, const char *proc)
    5.91 -{
    5.92 -#if 0
    5.93 -	if (_this->gl_config.dll_handle != NULL) {
    5.94 -		void *location = NULL;
    5.95 -		status_t err;
    5.96 -		if ((err =
    5.97 -			get_image_symbol((image_id) _this->gl_config.dll_handle,
    5.98 -                              proc, B_SYMBOL_TYPE_ANY,
    5.99 -                              &location)) == B_OK) {
   5.100 -            return location;
   5.101 -        } else {
   5.102 -                SDL_SetError("Couldn't find OpenGL symbol");
   5.103 -                return NULL;
   5.104 -        }
   5.105 -	} else {
   5.106 -		SDL_SetError("OpenGL library not loaded");
   5.107 -		return NULL;
   5.108 -	}
   5.109 -#endif
   5.110 -}
   5.111 -
   5.112 -
   5.113 -
   5.114 -
   5.115 -int BE_GL_MakeCurrent(_THIS)
   5.116 -{
   5.117 -	/* FIXME: should we glview->unlock and then glview->lock()? */
   5.118 -	return 0;
   5.119 -}
   5.120 -
   5.121 -
   5.122 -
   5.123 -
   5.124 -
   5.125 -
   5.126 -
   5.127 -
   5.128 -
   5.129 -
   5.130 -
   5.131 -
   5.132 -#if 0 /* Functions from 1.2 that do not appear to be used in 1.3 */
   5.133 -
   5.134 -    int BE_GL_GetAttribute(_THIS, SDL_GLattr attrib, int *value)
   5.135 -    {
   5.136 -        /*
   5.137 -           FIXME? Right now BE_GL_GetAttribute shouldn't be called between glBegin() and glEnd() - it doesn't use "cached" values
   5.138 -         */
   5.139 -        switch (attrib) {
   5.140 -        case SDL_GL_RED_SIZE:
   5.141 -            glGetIntegerv(GL_RED_BITS, (GLint *) value);
   5.142 -            break;
   5.143 -        case SDL_GL_GREEN_SIZE:
   5.144 -            glGetIntegerv(GL_GREEN_BITS, (GLint *) value);
   5.145 -            break;
   5.146 -        case SDL_GL_BLUE_SIZE:
   5.147 -            glGetIntegerv(GL_BLUE_BITS, (GLint *) value);
   5.148 -            break;
   5.149 -        case SDL_GL_ALPHA_SIZE:
   5.150 -            glGetIntegerv(GL_ALPHA_BITS, (GLint *) value);
   5.151 -            break;
   5.152 -        case SDL_GL_DOUBLEBUFFER:
   5.153 -            glGetBooleanv(GL_DOUBLEBUFFER, (GLboolean *) value);
   5.154 -            break;
   5.155 -        case SDL_GL_BUFFER_SIZE:
   5.156 -            int v;
   5.157 -            glGetIntegerv(GL_RED_BITS, (GLint *) & v);
   5.158 -            *value = v;
   5.159 -            glGetIntegerv(GL_GREEN_BITS, (GLint *) & v);
   5.160 -            *value += v;
   5.161 -            glGetIntegerv(GL_BLUE_BITS, (GLint *) & v);
   5.162 -            *value += v;
   5.163 -            glGetIntegerv(GL_ALPHA_BITS, (GLint *) & v);
   5.164 -            *value += v;
   5.165 -            break;
   5.166 -        case SDL_GL_DEPTH_SIZE:
   5.167 -            glGetIntegerv(GL_DEPTH_BITS, (GLint *) value);      /* Mesa creates 16 only? r5 always 32 */
   5.168 -            break;
   5.169 -        case SDL_GL_STENCIL_SIZE:
   5.170 -            glGetIntegerv(GL_STENCIL_BITS, (GLint *) value);
   5.171 -            break;
   5.172 -        case SDL_GL_ACCUM_RED_SIZE:
   5.173 -            glGetIntegerv(GL_ACCUM_RED_BITS, (GLint *) value);
   5.174 -            break;
   5.175 -        case SDL_GL_ACCUM_GREEN_SIZE:
   5.176 -            glGetIntegerv(GL_ACCUM_GREEN_BITS, (GLint *) value);
   5.177 -            break;
   5.178 -        case SDL_GL_ACCUM_BLUE_SIZE:
   5.179 -            glGetIntegerv(GL_ACCUM_BLUE_BITS, (GLint *) value);
   5.180 -            break;
   5.181 -        case SDL_GL_ACCUM_ALPHA_SIZE:
   5.182 -            glGetIntegerv(GL_ACCUM_ALPHA_BITS, (GLint *) value);
   5.183 -            break;
   5.184 -        case SDL_GL_STEREO:
   5.185 -        case SDL_GL_MULTISAMPLEBUFFERS:
   5.186 -        case SDL_GL_MULTISAMPLESAMPLES:
   5.187 -        default:
   5.188 -            *value = 0;
   5.189 -            return (-1);
   5.190 -        }
   5.191 -        return 0;
   5.192 -    }
   5.193 -
   5.194 -    void BE_GL_SwapBuffers(_THIS)
   5.195 -    {
   5.196 -        SDL_Win->SwapBuffers();
   5.197 -    }
   5.198 -#endif
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/src/video/bwindow/SDL_bopengl.cc	Wed Jul 13 09:29:43 2011 +0000
     6.3 @@ -0,0 +1,195 @@
     6.4 +/*
     6.5 +  Simple DirectMedia Layer
     6.6 +  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
     6.7 +
     6.8 +  This software is provided 'as-is', without any express or implied
     6.9 +  warranty.  In no event will the authors be held liable for any damages
    6.10 +  arising from the use of this software.
    6.11 +
    6.12 +  Permission is granted to anyone to use this software for any purpose,
    6.13 +  including commercial applications, and to alter it and redistribute it
    6.14 +  freely, subject to the following restrictions:
    6.15 +
    6.16 +  1. The origin of this software must not be misrepresented; you must not
    6.17 +     claim that you wrote the original software. If you use this software
    6.18 +     in a product, an acknowledgment in the product documentation would be
    6.19 +     appreciated but is not required.
    6.20 +  2. Altered source versions must be plainly marked as such, and must not be
    6.21 +     misrepresented as being the original software.
    6.22 +  3. This notice may not be removed or altered from any source distribution.
    6.23 +*/
    6.24 +
    6.25 +#include "SDL_bopengl.h"
    6.26 +#include "../SDL_sysvideo.h"
    6.27 +
    6.28 +
    6.29 +/* Passing a NULL path means load pointers from the application */
    6.30 +int BE_GL_LoadLibrary(_THIS, const char *path)
    6.31 +{
    6.32 +#if 0
    6.33 +	if (path == NULL) {
    6.34 +		if (_this->gl_config.dll_handle == NULL) {
    6.35 +			image_info info;
    6.36 +			int32 cookie = 0;
    6.37 +			while (get_next_image_info(0, &cookie, &info) == B_OK) {
    6.38 +				void *location = NULL;
    6.39 +				if (get_image_symbol
    6.40 +				((image_id) cookie, "glBegin",
    6.41 +				B_SYMBOL_TYPE_ANY, &location) == B_OK) {
    6.42 +					_this->gl_config.dll_handle = (void *) cookie;
    6.43 +					_this->gl_config.driver_loaded = 1;
    6.44 +					SDL_strlcpy(_this->gl_config.driver_path,
    6.45 +					"libGL.so",
    6.46 +					SDL_arraysize(_this->
    6.47 +					gl_config.driver_path));
    6.48 +				}
    6.49 +			}
    6.50 +		}
    6.51 +	} else {
    6.52 +        /*
    6.53 +           FIXME None of BeOS libGL.so implementations have exported functions 
    6.54 +           to load BGLView, which should be reloaded from new lib.
    6.55 +           So for now just "load" linked libGL.so :(
    6.56 +        */
    6.57 +        if (_this->gl_config.dll_handle == NULL) {
    6.58 +        	return BE_GL_LoadLibrary(_this, NULL);
    6.59 +        }
    6.60 +
    6.61 +            /* Unload old first */
    6.62 +            /*if (_this->gl_config.dll_handle != NULL) { */
    6.63 +            /* Do not try to unload application itself (if LoadLibrary was called before with NULL ;) */
    6.64 +            /*      image_info info;
    6.65 +               if (get_image_info((image_id)_this->gl_config.dll_handle, &info) == B_OK) {
    6.66 +               if (info.type != B_APP_IMAGE) {
    6.67 +               unload_add_on((image_id)_this->gl_config.dll_handle);
    6.68 +               }
    6.69 +               }
    6.70 +
    6.71 +               }
    6.72 +
    6.73 +               if ((_this->gl_config.dll_handle = (void*)load_add_on(path)) != (void*)B_ERROR) {
    6.74 +               _this->gl_config.driver_loaded = 1;
    6.75 +               SDL_strlcpy(_this->gl_config.driver_path, path, SDL_arraysize(_this->gl_config.driver_path));
    6.76 +               } */
    6.77 +	}
    6.78 +	
    6.79 +	if (_this->gl_config.dll_handle != NULL) {
    6.80 +		return 0;
    6.81 +	} else {
    6.82 +		_this->gl_config.dll_handle = NULL;
    6.83 +		_this->gl_config.driver_loaded = 0;
    6.84 +		*_this->gl_config.driver_path = '\0';
    6.85 +		return -1;
    6.86 +	}
    6.87 +#endif
    6.88 +}
    6.89 +
    6.90 +void *BE_GL_GetProcAddress(_THIS, const char *proc)
    6.91 +{
    6.92 +#if 0
    6.93 +	if (_this->gl_config.dll_handle != NULL) {
    6.94 +		void *location = NULL;
    6.95 +		status_t err;
    6.96 +		if ((err =
    6.97 +			get_image_symbol((image_id) _this->gl_config.dll_handle,
    6.98 +                              proc, B_SYMBOL_TYPE_ANY,
    6.99 +                              &location)) == B_OK) {
   6.100 +            return location;
   6.101 +        } else {
   6.102 +                SDL_SetError("Couldn't find OpenGL symbol");
   6.103 +                return NULL;
   6.104 +        }
   6.105 +	} else {
   6.106 +		SDL_SetError("OpenGL library not loaded");
   6.107 +		return NULL;
   6.108 +	}
   6.109 +#endif
   6.110 +}
   6.111 +
   6.112 +
   6.113 +
   6.114 +
   6.115 +int BE_GL_MakeCurrent(_THIS)
   6.116 +{
   6.117 +	/* FIXME: should we glview->unlock and then glview->lock()? */
   6.118 +	return 0;
   6.119 +}
   6.120 +
   6.121 +
   6.122 +
   6.123 +
   6.124 +
   6.125 +
   6.126 +
   6.127 +
   6.128 +
   6.129 +
   6.130 +
   6.131 +
   6.132 +#if 0 /* Functions from 1.2 that do not appear to be used in 1.3 */
   6.133 +
   6.134 +    int BE_GL_GetAttribute(_THIS, SDL_GLattr attrib, int *value)
   6.135 +    {
   6.136 +        /*
   6.137 +           FIXME? Right now BE_GL_GetAttribute shouldn't be called between glBegin() and glEnd() - it doesn't use "cached" values
   6.138 +         */
   6.139 +        switch (attrib) {
   6.140 +        case SDL_GL_RED_SIZE:
   6.141 +            glGetIntegerv(GL_RED_BITS, (GLint *) value);
   6.142 +            break;
   6.143 +        case SDL_GL_GREEN_SIZE:
   6.144 +            glGetIntegerv(GL_GREEN_BITS, (GLint *) value);
   6.145 +            break;
   6.146 +        case SDL_GL_BLUE_SIZE:
   6.147 +            glGetIntegerv(GL_BLUE_BITS, (GLint *) value);
   6.148 +            break;
   6.149 +        case SDL_GL_ALPHA_SIZE:
   6.150 +            glGetIntegerv(GL_ALPHA_BITS, (GLint *) value);
   6.151 +            break;
   6.152 +        case SDL_GL_DOUBLEBUFFER:
   6.153 +            glGetBooleanv(GL_DOUBLEBUFFER, (GLboolean *) value);
   6.154 +            break;
   6.155 +        case SDL_GL_BUFFER_SIZE:
   6.156 +            int v;
   6.157 +            glGetIntegerv(GL_RED_BITS, (GLint *) & v);
   6.158 +            *value = v;
   6.159 +            glGetIntegerv(GL_GREEN_BITS, (GLint *) & v);
   6.160 +            *value += v;
   6.161 +            glGetIntegerv(GL_BLUE_BITS, (GLint *) & v);
   6.162 +            *value += v;
   6.163 +            glGetIntegerv(GL_ALPHA_BITS, (GLint *) & v);
   6.164 +            *value += v;
   6.165 +            break;
   6.166 +        case SDL_GL_DEPTH_SIZE:
   6.167 +            glGetIntegerv(GL_DEPTH_BITS, (GLint *) value);      /* Mesa creates 16 only? r5 always 32 */
   6.168 +            break;
   6.169 +        case SDL_GL_STENCIL_SIZE:
   6.170 +            glGetIntegerv(GL_STENCIL_BITS, (GLint *) value);
   6.171 +            break;
   6.172 +        case SDL_GL_ACCUM_RED_SIZE:
   6.173 +            glGetIntegerv(GL_ACCUM_RED_BITS, (GLint *) value);
   6.174 +            break;
   6.175 +        case SDL_GL_ACCUM_GREEN_SIZE:
   6.176 +            glGetIntegerv(GL_ACCUM_GREEN_BITS, (GLint *) value);
   6.177 +            break;
   6.178 +        case SDL_GL_ACCUM_BLUE_SIZE:
   6.179 +            glGetIntegerv(GL_ACCUM_BLUE_BITS, (GLint *) value);
   6.180 +            break;
   6.181 +        case SDL_GL_ACCUM_ALPHA_SIZE:
   6.182 +            glGetIntegerv(GL_ACCUM_ALPHA_BITS, (GLint *) value);
   6.183 +            break;
   6.184 +        case SDL_GL_STEREO:
   6.185 +        case SDL_GL_MULTISAMPLEBUFFERS:
   6.186 +        case SDL_GL_MULTISAMPLESAMPLES:
   6.187 +        default:
   6.188 +            *value = 0;
   6.189 +            return (-1);
   6.190 +        }
   6.191 +        return 0;
   6.192 +    }
   6.193 +
   6.194 +    void BE_GL_SwapBuffers(_THIS)
   6.195 +    {
   6.196 +        SDL_Win->SwapBuffers();
   6.197 +    }
   6.198 +#endif
     7.1 --- a/src/video/bwindow/SDL_bvideo.c	Tue Jul 12 15:09:44 2011 +0000
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,202 +0,0 @@
     7.4 -/*
     7.5 -  Simple DirectMedia Layer
     7.6 -  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
     7.7 -
     7.8 -  This software is provided 'as-is', without any express or implied
     7.9 -  warranty.  In no event will the authors be held liable for any damages
    7.10 -  arising from the use of this software.
    7.11 -
    7.12 -  Permission is granted to anyone to use this software for any purpose,
    7.13 -  including commercial applications, and to alter it and redistribute it
    7.14 -  freely, subject to the following restrictions:
    7.15 -
    7.16 -  1. The origin of this software must not be misrepresented; you must not
    7.17 -     claim that you wrote the original software. If you use this software
    7.18 -     in a product, an acknowledgment in the product documentation would be
    7.19 -     appreciated but is not required.
    7.20 -  2. Altered source versions must be plainly marked as such, and must not be
    7.21 -     misrepresented as being the original software.
    7.22 -  3. This notice may not be removed or altered from any source distribution.
    7.23 -*/
    7.24 -
    7.25 -
    7.26 -#include "SDL_bwindow.h"
    7.27 -#include "SDL_bclipboard.h"
    7.28 -#include "SDL_bvideo.h"
    7.29 -#include "SDL_bopengl.h"
    7.30 -#include "SDL_bmodes.h"
    7.31 -
    7.32 -#ifdef __cplusplus
    7.33 -extern "C" {
    7.34 -#endif
    7.35 -/* FIXME: Undefined functions */
    7.36 -//    #define BE_VideoInit NULL
    7.37 -//    #define BE_VideoQuit NULL
    7.38 -    #define BE_GetDisplayBounds NULL
    7.39 -    #define BE_GetDisplayModes NULL
    7.40 -    #define BE_SetDisplayMode NULL
    7.41 -    #define BE_PumpEvents NULL
    7.42 -    
    7.43 -#if SDL_VIDEO_OPENGL_WGL	/* FIXME: Replace with BeOs's SDL OPENGL stuff */
    7.44 -//    #define BE_GL_LoadLibrary NULL
    7.45 -//    #define BE_GL_GetProcAddress NULL
    7.46 -    #define BE_GL_UnloadLibrary NULL
    7.47 -    #define BE_GL_CreateContext NULL
    7.48 -//    #define BE_GL_MakeCurrent NULL
    7.49 -    #define BE_GL_SetSwapInterval NULL
    7.50 -    #define BE_GL_GetSwapInterval NULL
    7.51 -    #define BE_GL_SwapWindow NULL
    7.52 -    #define BE_GL_DeleteContext NULL
    7.53 -#endif
    7.54 -    #define BE_StartTextInput NULL
    7.55 -    #define BE_StopTextInput NULL
    7.56 -    #define BE_SetTextInputRect NULL
    7.57 -
    7.58 -//    #define BE_DeleteDevice NULL
    7.59 -
    7.60 -/* End undefined functions */
    7.61 -
    7.62 -static SDL_VideoDevice *
    7.63 -BE_CreateDevice(int devindex)
    7.64 -{
    7.65 -    SDL_VideoDevice *device;
    7.66 -    SDL_VideoData *data;
    7.67 -
    7.68 -    /* Initialize all variables that we clean on shutdown */
    7.69 -    device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
    7.70 -    if (device) {
    7.71 -        data = (struct SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData));
    7.72 -    } else {
    7.73 -        data = NULL;
    7.74 -    }
    7.75 -    if (!data) {
    7.76 -        SDL_OutOfMemory();
    7.77 -        if (device) {
    7.78 -            SDL_free(device);
    7.79 -        }
    7.80 -        return NULL;
    7.81 -    }
    7.82 -    device->driverdata = data;
    7.83 -
    7.84 -/* TODO: Figure out what sort of initialization needs to go here */
    7.85 -
    7.86 -    /* Set the function pointers */
    7.87 -    device->VideoInit = BE_VideoInit;
    7.88 -    device->VideoQuit = BE_VideoQuit;
    7.89 -    device->GetDisplayBounds = BE_GetDisplayBounds;
    7.90 -    device->GetDisplayModes = BE_GetDisplayModes;
    7.91 -    device->SetDisplayMode = BE_SetDisplayMode;
    7.92 -    device->PumpEvents = BE_PumpEvents;
    7.93 -
    7.94 -    device->CreateWindow = BE_CreateWindow;
    7.95 -    device->CreateWindowFrom = BE_CreateWindowFrom;
    7.96 -    device->SetWindowTitle = BE_SetWindowTitle;
    7.97 -    device->SetWindowIcon = BE_SetWindowIcon;
    7.98 -    device->SetWindowPosition = BE_SetWindowPosition;
    7.99 -    device->SetWindowSize = BE_SetWindowSize;
   7.100 -    device->ShowWindow = BE_ShowWindow;
   7.101 -    device->HideWindow = BE_HideWindow;
   7.102 -    device->RaiseWindow = BE_RaiseWindow;
   7.103 -    device->MaximizeWindow = BE_MaximizeWindow;
   7.104 -    device->MinimizeWindow = BE_MinimizeWindow;
   7.105 -    device->RestoreWindow = BE_RestoreWindow;
   7.106 -    device->SetWindowFullscreen = BE_SetWindowFullscreen;
   7.107 -    device->SetWindowGammaRamp = BE_SetWindowGammaRamp;
   7.108 -    device->GetWindowGammaRamp = BE_GetWindowGammaRamp;
   7.109 -    device->SetWindowGrab = BE_SetWindowGrab;
   7.110 -    device->DestroyWindow = BE_DestroyWindow;
   7.111 -    device->GetWindowWMInfo = BE_GetWindowWMInfo;
   7.112 -    device->CreateWindowFramebuffer = BE_CreateWindowFramebuffer;
   7.113 -    device->UpdateWindowFramebuffer = BE_UpdateWindowFramebuffer;
   7.114 -    device->DestroyWindowFramebuffer = BE_DestroyWindowFramebuffer;
   7.115 -    
   7.116 -    device->shape_driver.CreateShaper = NULL;
   7.117 -    device->shape_driver.SetWindowShape = NULL;
   7.118 -    device->shape_driver.ResizeWindowShape = NULL;
   7.119 -    
   7.120 -#if SDL_VIDEO_OPENGL_WGL	/* FIXME: Replace with BeOs's SDL OPENGL stuff */
   7.121 -    device->GL_LoadLibrary = BE_GL_LoadLibrary;
   7.122 -    device->GL_GetProcAddress = BE_GL_GetProcAddress;
   7.123 -    device->GL_UnloadLibrary = BE_GL_UnloadLibrary;
   7.124 -    device->GL_CreateContext = BE_GL_CreateContext;
   7.125 -    device->GL_MakeCurrent = BE_GL_MakeCurrent;
   7.126 -    device->GL_SetSwapInterval = BE_GL_SetSwapInterval;
   7.127 -    device->GL_GetSwapInterval = BE_GL_GetSwapInterval;
   7.128 -    device->GL_SwapWindow = BE_GL_SwapWindow;
   7.129 -    device->GL_DeleteContext = BE_GL_DeleteContext;
   7.130 -#endif
   7.131 -    device->StartTextInput = BE_StartTextInput;
   7.132 -    device->StopTextInput = BE_StopTextInput;
   7.133 -    device->SetTextInputRect = BE_SetTextInputRect;
   7.134 -
   7.135 -    device->SetClipboardText = BE_SetClipboardText;
   7.136 -    device->GetClipboardText = BE_GetClipboardText;
   7.137 -    device->HasClipboardText = BE_HasClipboardText;
   7.138 -
   7.139 -    device->free = BE_DeleteDevice;
   7.140 -
   7.141 -    return device;
   7.142 -}
   7.143 -
   7.144 -static void BE_DeleteDevice(SDL_VideoDevice * device)
   7.145 -{
   7.146 -	SDL_free(device->driverdata);
   7.147 -	SDL_free(device);
   7.148 -}
   7.149 -
   7.150 -/* FIXME: This is the 1.2 function at the moment.  Read through it and
   7.151 -  o understand what it does. */
   7.152 -int BE_VideoInit(_THIS)
   7.153 -{
   7.154 -	/* Initialize the Be Application for appserver interaction */
   7.155 -	if (SDL_InitBeApp() < 0) {
   7.156 -		return -1;
   7.157 -	}
   7.158 -	
   7.159 -	BE_InitModes(_this);
   7.160 -
   7.161 -#if SDL_VIDEO_OPENGL
   7.162 -        /* testgl application doesn't load library, just tries to load symbols */
   7.163 -        /* is it correct? if so we have to load library here */
   7.164 -    BE_GL_LoadLibrary(_this, NULL);
   7.165 -#endif
   7.166 -
   7.167 -        /* Fill in some window manager capabilities */
   7.168 -//    _this->info.wm_available = 1;
   7.169 -
   7.170 -        /* We're done! */
   7.171 -    return (0);
   7.172 -}
   7.173 -
   7.174 -static int BE_Available(void)
   7.175 -{
   7.176 -    return (1);
   7.177 -}
   7.178 -
   7.179 -void BE_VideoQuit(_THIS)
   7.180 -{
   7.181 -
   7.182 -#if 0
   7.183 -        SDL_Win->Quit();
   7.184 -        SDL_Win = NULL;
   7.185 -#endif
   7.186 -#if 0
   7.187 -        if (SDL_BlankCursor != NULL) {
   7.188 -            BE_FreeWMCursor(_this, SDL_BlankCursor);
   7.189 -            SDL_BlankCursor = NULL;
   7.190 -        }
   7.191 -#endif
   7.192 -
   7.193 -    BE_QuitModes(_this);
   7.194 -
   7.195 -#if SDL_VIDEO_OPENGL
   7.196 -//    if (_this->gl_config.dll_handle != NULL)
   7.197 -//        unload_add_on((image_id) _this->gl_config.dll_handle);
   7.198 -#endif
   7.199 -
   7.200 -    SDL_QuitBeApp();
   7.201 -}
   7.202 -
   7.203 -#ifdef __cplusplus
   7.204 -}
   7.205 -#endif
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/src/video/bwindow/SDL_bvideo.cc	Wed Jul 13 09:29:43 2011 +0000
     8.3 @@ -0,0 +1,202 @@
     8.4 +/*
     8.5 +  Simple DirectMedia Layer
     8.6 +  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
     8.7 +
     8.8 +  This software is provided 'as-is', without any express or implied
     8.9 +  warranty.  In no event will the authors be held liable for any damages
    8.10 +  arising from the use of this software.
    8.11 +
    8.12 +  Permission is granted to anyone to use this software for any purpose,
    8.13 +  including commercial applications, and to alter it and redistribute it
    8.14 +  freely, subject to the following restrictions:
    8.15 +
    8.16 +  1. The origin of this software must not be misrepresented; you must not
    8.17 +     claim that you wrote the original software. If you use this software
    8.18 +     in a product, an acknowledgment in the product documentation would be
    8.19 +     appreciated but is not required.
    8.20 +  2. Altered source versions must be plainly marked as such, and must not be
    8.21 +     misrepresented as being the original software.
    8.22 +  3. This notice may not be removed or altered from any source distribution.
    8.23 +*/
    8.24 +
    8.25 +
    8.26 +#include "SDL_bwindow.h"
    8.27 +#include "SDL_bclipboard.h"
    8.28 +#include "SDL_bvideo.h"
    8.29 +#include "SDL_bopengl.h"
    8.30 +#include "SDL_bmodes.h"
    8.31 +
    8.32 +#ifdef __cplusplus
    8.33 +extern "C" {
    8.34 +#endif
    8.35 +/* FIXME: Undefined functions */
    8.36 +//    #define BE_VideoInit NULL
    8.37 +//    #define BE_VideoQuit NULL
    8.38 +    #define BE_GetDisplayBounds NULL
    8.39 +    #define BE_GetDisplayModes NULL
    8.40 +    #define BE_SetDisplayMode NULL
    8.41 +    #define BE_PumpEvents NULL
    8.42 +    
    8.43 +#if SDL_VIDEO_OPENGL_WGL	/* FIXME: Replace with BeOs's SDL OPENGL stuff */
    8.44 +//    #define BE_GL_LoadLibrary NULL
    8.45 +//    #define BE_GL_GetProcAddress NULL
    8.46 +    #define BE_GL_UnloadLibrary NULL
    8.47 +    #define BE_GL_CreateContext NULL
    8.48 +//    #define BE_GL_MakeCurrent NULL
    8.49 +    #define BE_GL_SetSwapInterval NULL
    8.50 +    #define BE_GL_GetSwapInterval NULL
    8.51 +    #define BE_GL_SwapWindow NULL
    8.52 +    #define BE_GL_DeleteContext NULL
    8.53 +#endif
    8.54 +    #define BE_StartTextInput NULL
    8.55 +    #define BE_StopTextInput NULL
    8.56 +    #define BE_SetTextInputRect NULL
    8.57 +
    8.58 +//    #define BE_DeleteDevice NULL
    8.59 +
    8.60 +/* End undefined functions */
    8.61 +
    8.62 +static SDL_VideoDevice *
    8.63 +BE_CreateDevice(int devindex)
    8.64 +{
    8.65 +    SDL_VideoDevice *device;
    8.66 +    SDL_VideoData *data;
    8.67 +
    8.68 +    /* Initialize all variables that we clean on shutdown */
    8.69 +    device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
    8.70 +    if (device) {
    8.71 +        data = (struct SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData));
    8.72 +    } else {
    8.73 +        data = NULL;
    8.74 +    }
    8.75 +    if (!data) {
    8.76 +        SDL_OutOfMemory();
    8.77 +        if (device) {
    8.78 +            SDL_free(device);
    8.79 +        }
    8.80 +        return NULL;
    8.81 +    }
    8.82 +    device->driverdata = data;
    8.83 +
    8.84 +/* TODO: Figure out what sort of initialization needs to go here */
    8.85 +
    8.86 +    /* Set the function pointers */
    8.87 +    device->VideoInit = BE_VideoInit;
    8.88 +    device->VideoQuit = BE_VideoQuit;
    8.89 +    device->GetDisplayBounds = BE_GetDisplayBounds;
    8.90 +    device->GetDisplayModes = BE_GetDisplayModes;
    8.91 +    device->SetDisplayMode = BE_SetDisplayMode;
    8.92 +    device->PumpEvents = BE_PumpEvents;
    8.93 +
    8.94 +    device->CreateWindow = BE_CreateWindow;
    8.95 +    device->CreateWindowFrom = BE_CreateWindowFrom;
    8.96 +    device->SetWindowTitle = BE_SetWindowTitle;
    8.97 +    device->SetWindowIcon = BE_SetWindowIcon;
    8.98 +    device->SetWindowPosition = BE_SetWindowPosition;
    8.99 +    device->SetWindowSize = BE_SetWindowSize;
   8.100 +    device->ShowWindow = BE_ShowWindow;
   8.101 +    device->HideWindow = BE_HideWindow;
   8.102 +    device->RaiseWindow = BE_RaiseWindow;
   8.103 +    device->MaximizeWindow = BE_MaximizeWindow;
   8.104 +    device->MinimizeWindow = BE_MinimizeWindow;
   8.105 +    device->RestoreWindow = BE_RestoreWindow;
   8.106 +    device->SetWindowFullscreen = BE_SetWindowFullscreen;
   8.107 +    device->SetWindowGammaRamp = BE_SetWindowGammaRamp;
   8.108 +    device->GetWindowGammaRamp = BE_GetWindowGammaRamp;
   8.109 +    device->SetWindowGrab = BE_SetWindowGrab;
   8.110 +    device->DestroyWindow = BE_DestroyWindow;
   8.111 +    device->GetWindowWMInfo = BE_GetWindowWMInfo;
   8.112 +    device->CreateWindowFramebuffer = BE_CreateWindowFramebuffer;
   8.113 +    device->UpdateWindowFramebuffer = BE_UpdateWindowFramebuffer;
   8.114 +    device->DestroyWindowFramebuffer = BE_DestroyWindowFramebuffer;
   8.115 +    
   8.116 +    device->shape_driver.CreateShaper = NULL;
   8.117 +    device->shape_driver.SetWindowShape = NULL;
   8.118 +    device->shape_driver.ResizeWindowShape = NULL;
   8.119 +    
   8.120 +#if SDL_VIDEO_OPENGL_WGL	/* FIXME: Replace with BeOs's SDL OPENGL stuff */
   8.121 +    device->GL_LoadLibrary = BE_GL_LoadLibrary;
   8.122 +    device->GL_GetProcAddress = BE_GL_GetProcAddress;
   8.123 +    device->GL_UnloadLibrary = BE_GL_UnloadLibrary;
   8.124 +    device->GL_CreateContext = BE_GL_CreateContext;
   8.125 +    device->GL_MakeCurrent = BE_GL_MakeCurrent;
   8.126 +    device->GL_SetSwapInterval = BE_GL_SetSwapInterval;
   8.127 +    device->GL_GetSwapInterval = BE_GL_GetSwapInterval;
   8.128 +    device->GL_SwapWindow = BE_GL_SwapWindow;
   8.129 +    device->GL_DeleteContext = BE_GL_DeleteContext;
   8.130 +#endif
   8.131 +    device->StartTextInput = BE_StartTextInput;
   8.132 +    device->StopTextInput = BE_StopTextInput;
   8.133 +    device->SetTextInputRect = BE_SetTextInputRect;
   8.134 +
   8.135 +    device->SetClipboardText = BE_SetClipboardText;
   8.136 +    device->GetClipboardText = BE_GetClipboardText;
   8.137 +    device->HasClipboardText = BE_HasClipboardText;
   8.138 +
   8.139 +    device->free = BE_DeleteDevice;
   8.140 +
   8.141 +    return device;
   8.142 +}
   8.143 +
   8.144 +static void BE_DeleteDevice(SDL_VideoDevice * device)
   8.145 +{
   8.146 +	SDL_free(device->driverdata);
   8.147 +	SDL_free(device);
   8.148 +}
   8.149 +
   8.150 +/* FIXME: This is the 1.2 function at the moment.  Read through it and
   8.151 +  o understand what it does. */
   8.152 +int BE_VideoInit(_THIS)
   8.153 +{
   8.154 +	/* Initialize the Be Application for appserver interaction */
   8.155 +	if (SDL_InitBeApp() < 0) {
   8.156 +		return -1;
   8.157 +	}
   8.158 +	
   8.159 +	BE_InitModes(_this);
   8.160 +
   8.161 +#if SDL_VIDEO_OPENGL
   8.162 +        /* testgl application doesn't load library, just tries to load symbols */
   8.163 +        /* is it correct? if so we have to load library here */
   8.164 +    BE_GL_LoadLibrary(_this, NULL);
   8.165 +#endif
   8.166 +
   8.167 +        /* Fill in some window manager capabilities */
   8.168 +//    _this->info.wm_available = 1;
   8.169 +
   8.170 +        /* We're done! */
   8.171 +    return (0);
   8.172 +}
   8.173 +
   8.174 +static int BE_Available(void)
   8.175 +{
   8.176 +    return (1);
   8.177 +}
   8.178 +
   8.179 +void BE_VideoQuit(_THIS)
   8.180 +{
   8.181 +
   8.182 +#if 0
   8.183 +        SDL_Win->Quit();
   8.184 +        SDL_Win = NULL;
   8.185 +#endif
   8.186 +#if 0
   8.187 +        if (SDL_BlankCursor != NULL) {
   8.188 +            BE_FreeWMCursor(_this, SDL_BlankCursor);
   8.189 +            SDL_BlankCursor = NULL;
   8.190 +        }
   8.191 +#endif
   8.192 +
   8.193 +    BE_QuitModes(_this);
   8.194 +
   8.195 +#if SDL_VIDEO_OPENGL
   8.196 +//    if (_this->gl_config.dll_handle != NULL)
   8.197 +//        unload_add_on((image_id) _this->gl_config.dll_handle);
   8.198 +#endif
   8.199 +
   8.200 +    SDL_QuitBeApp();
   8.201 +}
   8.202 +
   8.203 +#ifdef __cplusplus
   8.204 +}
   8.205 +#endif
     9.1 --- a/src/video/bwindow/SDL_bwindow.c	Tue Jul 12 15:09:44 2011 +0000
     9.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.3 @@ -1,203 +0,0 @@
     9.4 -/*
     9.5 -  Simple DirectMedia Layer
     9.6 -  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
     9.7 -
     9.8 -  This software is provided 'as-is', without any express or implied
     9.9 -  warranty.  In no event will the authors be held liable for any damages
    9.10 -  arising from the use of this software.
    9.11 -
    9.12 -  Permission is granted to anyone to use this software for any purpose,
    9.13 -  including commercial applications, and to alter it and redistribute it
    9.14 -  freely, subject to the following restrictions:
    9.15 -
    9.16 -  1. The origin of this software must not be misrepresented; you must not
    9.17 -     claim that you wrote the original software. If you use this software
    9.18 -     in a product, an acknowledgment in the product documentation would be
    9.19 -     appreciated but is not required.
    9.20 -  2. Altered source versions must be plainly marked as such, and must not be
    9.21 -     misrepresented as being the original software.
    9.22 -  3. This notice may not be removed or altered from any source distribution.
    9.23 -*/
    9.24 -#include "SDL_config.h"
    9.25 -#include "../SDL_sysvideo.h"
    9.26 -
    9.27 -#include "SDL_BWin.h"
    9.28 -#include <new>
    9.29 -
    9.30 -/* Define a path to window's BWIN data */
    9.31 -#ifdef __cplusplus
    9.32 -extern "C" {
    9.33 -#endif
    9.34 -
    9.35 -static inline SDL_BWin *_ToBeWin(SDL_Window *window) {
    9.36 -	return ((SDL_BWin*)(window->driverdata));
    9.37 -}
    9.38 -
    9.39 -static inline SDL_BApp *_GetBeApp() {
    9.40 -	return ((SDL_BApp*)be_app);
    9.41 -}
    9.42 -
    9.43 -int _InitWindow(_THIS, SDL_Window *window) {
    9.44 -	BRect bounds(
    9.45 -        window->x,
    9.46 -        window->y,
    9.47 -        window->x + window->w - 1,	//BeWindows have an off-by-one px w/h thing
    9.48 -        window->y + window->h - 1
    9.49 -    );
    9.50 -    
    9.51 -    SDL_BWin *bwin = new(std::nothrow) SDL_BWin(bounds);
    9.52 -    if(bwin == NULL)
    9.53 -    	return ENOMEM;
    9.54 -    
    9.55 -    window->driverdata = bwin;
    9.56 -    int32 winID = _GetBeApp()->GetID(window);
    9.57 -    bwin->SetID(winID);
    9.58 -    return 0;
    9.59 -}
    9.60 -
    9.61 -int BE_CreateWindow(_THIS, SDL_Window *window) {
    9.62 -	if(_InitWindow(_this, window) == ENOMEM)
    9.63 -		return ENOMEM;
    9.64 -	
    9.65 -	/* Start window loop */
    9.66 -    _ToBeWin(window)->Show();
    9.67 -    return 0;
    9.68 -}
    9.69 -
    9.70 -int BE_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) {
    9.71 -
    9.72 -	SDL_BWin *otherBWin = (SDL_BWin*)data;
    9.73 -	if(!otherBWin->LockLooper())
    9.74 -		return -1;
    9.75 -	
    9.76 -	/* Create the new window and initialize its members */
    9.77 -	window->x = (int)otherBWin->Frame().left;
    9.78 -	window->y = (int)otherBWin->Frame().top;
    9.79 -	window->w = (int)otherBWin->Frame().Width();
    9.80 -	window->h = (int)otherBWin->Frame().Height();
    9.81 -	
    9.82 -	/* If we are out of memory, return the error code */
    9.83 -	if(_InitWindow(_this, window) == ENOMEM)
    9.84 -		return ENOMEM;
    9.85 -	
    9.86 -	/* TODO: Add any other SDL-supported window attributes here */
    9.87 -    _ToBeWin(window)->SetTitle(otherBWin->Title());
    9.88 -    
    9.89 -    /* Start window loop and unlock the other window */
    9.90 -    _ToBeWin(window)->Show();
    9.91 -    
    9.92 -    otherBWin->UnlockLooper();
    9.93 -    return 0;
    9.94 -}
    9.95 -
    9.96 -void BE_SetWindowTitle(_THIS, SDL_Window * window) {
    9.97 -	BMessage msg(BWIN_SET_TITLE);
    9.98 -	msg.AddString("window-title", window->title);
    9.99 -	_ToBeWin(window)->PostMessage(&msg);
   9.100 -}
   9.101 -
   9.102 -void BE_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) {
   9.103 -	/* FIXME: Icons not supported by BeOs/Haiku */
   9.104 -}
   9.105 -
   9.106 -void BE_SetWindowPosition(_THIS, SDL_Window * window) {
   9.107 -	BMessage msg(BWIN_MOVE_WINDOW);
   9.108 -	msg.AddInt32("window-x", window->x);
   9.109 -	msg.AddInt32("window-y", window->y);
   9.110 -	_ToBeWin(window)->PostMessage(&msg);
   9.111 -}
   9.112 -
   9.113 -void BE_SetWindowSize(_THIS, SDL_Window * window) {
   9.114 -	BMessage msg(BWIN_RESIZE_WINDOW);
   9.115 -	msg.AddInt32("window-w", window->w - 1);
   9.116 -	msg.AddInt32("window-h", window->h - 1);
   9.117 -	_ToBeWin(window)->PostMessage(&msg);
   9.118 -}
   9.119 -
   9.120 -void BE_ShowWindow(_THIS, SDL_Window * window) {
   9.121 -	BMessage msg(BWIN_SHOW_WINDOW);
   9.122 -	_ToBeWin(window)->PostMessage(&msg);
   9.123 -}
   9.124 -
   9.125 -void BE_HideWindow(_THIS, SDL_Window * window) {
   9.126 -	BMessage msg(BWIN_HIDE_WINDOW);
   9.127 -	_ToBeWin(window)->PostMessage(&msg);
   9.128 -}
   9.129 -
   9.130 -void BE_RaiseWindow(_THIS, SDL_Window * window) {
   9.131 -	BMessage msg(BWIN_SHOW_WINDOW);	/* Activate this window and move to front */
   9.132 -	_ToBeWin(window)->PostMessage(&msg);
   9.133 -}
   9.134 -
   9.135 -void BE_MaximizeWindow(_THIS, SDL_Window * window) {
   9.136 -	BMessage msg(BWIN_MAXIMIZE_WINDOW);
   9.137 -	_ToBeWin(window)->PostMessage(&msg);
   9.138 -}
   9.139 -
   9.140 -void BE_MinimizeWindow(_THIS, SDL_Window * window) {
   9.141 -	BMessage msg(BWIN_MINIMIZE_WINDOW);
   9.142 -	_ToBeWin(window)->PostMessage(&msg);
   9.143 -}
   9.144 -
   9.145 -void BE_RestoreWindow(_THIS, SDL_Window * window) {
   9.146 -	BMessage msg(BWIN_RESTORE_WINDOW);
   9.147 -	_ToBeWin(window)->PostMessage(&msg);
   9.148 -}
   9.149 -
   9.150 -void BE_SetWindowFullscreen(_THIS, SDL_Window * window,
   9.151 -		SDL_VideoDisplay * display, SDL_bool fullscreen) {
   9.152 -	/* Haiku tracks all video display information */
   9.153 -	BMessage msg(BWIN_FULLSCREEN);
   9.154 -	msg.AddBool("fullscreen", fullscreen);
   9.155 -	_ToBeWin(window)->PostMessage(&msg);
   9.156 -	
   9.157 -}
   9.158 -
   9.159 -int BE_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp) {
   9.160 -	/* FIXME: Not BeOs/Haiku supported */
   9.161 -}
   9.162 -
   9.163 -int BE_GetWindowGammaRamp(_THIS, SDL_Window * window, Uint16 * ramp) {
   9.164 -	/* FIXME: Not BeOs/Haiku supported */
   9.165 -}
   9.166 -
   9.167 -
   9.168 -void BE_SetWindowGrab(_THIS, SDL_Window * window) {
   9.169 -	/* TODO: Implement this! */
   9.170 -}
   9.171 -
   9.172 -void BE_DestroyWindow(_THIS, SDL_Window * window) {
   9.173 -	_ToBeWin(window)->LockLooper();	/* This MUST be locked */
   9.174 -	_GetBeApp()->ClearID(_ToBeWin(window));
   9.175 -	_ToBeWin(window)->Quit();
   9.176 -	window->driverdata = NULL;
   9.177 -}
   9.178 -
   9.179 -SDL_bool BE_GetWindowWMInfo(_THIS, SDL_Window * window,
   9.180 -                                    struct SDL_SysWMinfo *info) {
   9.181 -	/* FIXME: What is the point of this? What information should be included? */
   9.182 -}
   9.183 -
   9.184 -
   9.185 -extern int BE_CreateWindowFramebuffer(_THIS, SDL_Window * window,
   9.186 -                                       Uint32 * format,
   9.187 -                                       void ** pixels, int *pitch) {
   9.188 -	/* FIXME: Not BeOs/Haiku supported */
   9.189 -	return -1;
   9.190 -}
   9.191 -
   9.192 -extern int BE_UpdateWindowFramebuffer(_THIS, SDL_Window * window,
   9.193 -                                       SDL_Rect * rects, int numrects) {
   9.194 -	/* FIXME: Not BeOs/Haiku supported */
   9.195 -	return -1;
   9.196 -}
   9.197 -
   9.198 -extern void BE_DestroyWindowFramebuffer(_THIS, SDL_Window * window) {
   9.199 -	/* FIXME: Not BeOs/Haiku supported */
   9.200 -}
   9.201 -
   9.202 - 
   9.203 -#ifdef __cplusplus
   9.204 -}
   9.205 -#endif
   9.206 -
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/src/video/bwindow/SDL_bwindow.cc	Wed Jul 13 09:29:43 2011 +0000
    10.3 @@ -0,0 +1,203 @@
    10.4 +/*
    10.5 +  Simple DirectMedia Layer
    10.6 +  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
    10.7 +
    10.8 +  This software is provided 'as-is', without any express or implied
    10.9 +  warranty.  In no event will the authors be held liable for any damages
   10.10 +  arising from the use of this software.
   10.11 +
   10.12 +  Permission is granted to anyone to use this software for any purpose,
   10.13 +  including commercial applications, and to alter it and redistribute it
   10.14 +  freely, subject to the following restrictions:
   10.15 +
   10.16 +  1. The origin of this software must not be misrepresented; you must not
   10.17 +     claim that you wrote the original software. If you use this software
   10.18 +     in a product, an acknowledgment in the product documentation would be
   10.19 +     appreciated but is not required.
   10.20 +  2. Altered source versions must be plainly marked as such, and must not be
   10.21 +     misrepresented as being the original software.
   10.22 +  3. This notice may not be removed or altered from any source distribution.
   10.23 +*/
   10.24 +#include "SDL_config.h"
   10.25 +#include "../SDL_sysvideo.h"
   10.26 +
   10.27 +#include "SDL_BWin.h"
   10.28 +#include <new>
   10.29 +
   10.30 +/* Define a path to window's BWIN data */
   10.31 +#ifdef __cplusplus
   10.32 +extern "C" {
   10.33 +#endif
   10.34 +
   10.35 +static inline SDL_BWin *_ToBeWin(SDL_Window *window) {
   10.36 +	return ((SDL_BWin*)(window->driverdata));
   10.37 +}
   10.38 +
   10.39 +static inline SDL_BApp *_GetBeApp() {
   10.40 +	return ((SDL_BApp*)be_app);
   10.41 +}
   10.42 +
   10.43 +int _InitWindow(_THIS, SDL_Window *window) {
   10.44 +	BRect bounds(
   10.45 +        window->x,
   10.46 +        window->y,
   10.47 +        window->x + window->w - 1,	//BeWindows have an off-by-one px w/h thing
   10.48 +        window->y + window->h - 1
   10.49 +    );
   10.50 +    
   10.51 +    SDL_BWin *bwin = new(std::nothrow) SDL_BWin(bounds);
   10.52 +    if(bwin == NULL)
   10.53 +    	return ENOMEM;
   10.54 +    
   10.55 +    window->driverdata = bwin;
   10.56 +    int32 winID = _GetBeApp()->GetID(window);
   10.57 +    bwin->SetID(winID);
   10.58 +    return 0;
   10.59 +}
   10.60 +
   10.61 +int BE_CreateWindow(_THIS, SDL_Window *window) {
   10.62 +	if(_InitWindow(_this, window) == ENOMEM)
   10.63 +		return ENOMEM;
   10.64 +	
   10.65 +	/* Start window loop */
   10.66 +    _ToBeWin(window)->Show();
   10.67 +    return 0;
   10.68 +}
   10.69 +
   10.70 +int BE_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) {
   10.71 +
   10.72 +	SDL_BWin *otherBWin = (SDL_BWin*)data;
   10.73 +	if(!otherBWin->LockLooper())
   10.74 +		return -1;
   10.75 +	
   10.76 +	/* Create the new window and initialize its members */
   10.77 +	window->x = (int)otherBWin->Frame().left;
   10.78 +	window->y = (int)otherBWin->Frame().top;
   10.79 +	window->w = (int)otherBWin->Frame().Width();
   10.80 +	window->h = (int)otherBWin->Frame().Height();
   10.81 +	
   10.82 +	/* If we are out of memory, return the error code */
   10.83 +	if(_InitWindow(_this, window) == ENOMEM)
   10.84 +		return ENOMEM;
   10.85 +	
   10.86 +	/* TODO: Add any other SDL-supported window attributes here */
   10.87 +    _ToBeWin(window)->SetTitle(otherBWin->Title());
   10.88 +    
   10.89 +    /* Start window loop and unlock the other window */
   10.90 +    _ToBeWin(window)->Show();
   10.91 +    
   10.92 +    otherBWin->UnlockLooper();
   10.93 +    return 0;
   10.94 +}
   10.95 +
   10.96 +void BE_SetWindowTitle(_THIS, SDL_Window * window) {
   10.97 +	BMessage msg(BWIN_SET_TITLE);
   10.98 +	msg.AddString("window-title", window->title);
   10.99 +	_ToBeWin(window)->PostMessage(&msg);
  10.100 +}
  10.101 +
  10.102 +void BE_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) {
  10.103 +	/* FIXME: Icons not supported by BeOs/Haiku */
  10.104 +}
  10.105 +
  10.106 +void BE_SetWindowPosition(_THIS, SDL_Window * window) {
  10.107 +	BMessage msg(BWIN_MOVE_WINDOW);
  10.108 +	msg.AddInt32("window-x", window->x);
  10.109 +	msg.AddInt32("window-y", window->y);
  10.110 +	_ToBeWin(window)->PostMessage(&msg);
  10.111 +}
  10.112 +
  10.113 +void BE_SetWindowSize(_THIS, SDL_Window * window) {
  10.114 +	BMessage msg(BWIN_RESIZE_WINDOW);
  10.115 +	msg.AddInt32("window-w", window->w - 1);
  10.116 +	msg.AddInt32("window-h", window->h - 1);
  10.117 +	_ToBeWin(window)->PostMessage(&msg);
  10.118 +}
  10.119 +
  10.120 +void BE_ShowWindow(_THIS, SDL_Window * window) {
  10.121 +	BMessage msg(BWIN_SHOW_WINDOW);
  10.122 +	_ToBeWin(window)->PostMessage(&msg);
  10.123 +}
  10.124 +
  10.125 +void BE_HideWindow(_THIS, SDL_Window * window) {
  10.126 +	BMessage msg(BWIN_HIDE_WINDOW);
  10.127 +	_ToBeWin(window)->PostMessage(&msg);
  10.128 +}
  10.129 +
  10.130 +void BE_RaiseWindow(_THIS, SDL_Window * window) {
  10.131 +	BMessage msg(BWIN_SHOW_WINDOW);	/* Activate this window and move to front */
  10.132 +	_ToBeWin(window)->PostMessage(&msg);
  10.133 +}
  10.134 +
  10.135 +void BE_MaximizeWindow(_THIS, SDL_Window * window) {
  10.136 +	BMessage msg(BWIN_MAXIMIZE_WINDOW);
  10.137 +	_ToBeWin(window)->PostMessage(&msg);
  10.138 +}
  10.139 +
  10.140 +void BE_MinimizeWindow(_THIS, SDL_Window * window) {
  10.141 +	BMessage msg(BWIN_MINIMIZE_WINDOW);
  10.142 +	_ToBeWin(window)->PostMessage(&msg);
  10.143 +}
  10.144 +
  10.145 +void BE_RestoreWindow(_THIS, SDL_Window * window) {
  10.146 +	BMessage msg(BWIN_RESTORE_WINDOW);
  10.147 +	_ToBeWin(window)->PostMessage(&msg);
  10.148 +}
  10.149 +
  10.150 +void BE_SetWindowFullscreen(_THIS, SDL_Window * window,
  10.151 +		SDL_VideoDisplay * display, SDL_bool fullscreen) {
  10.152 +	/* Haiku tracks all video display information */
  10.153 +	BMessage msg(BWIN_FULLSCREEN);
  10.154 +	msg.AddBool("fullscreen", fullscreen);
  10.155 +	_ToBeWin(window)->PostMessage(&msg);
  10.156 +	
  10.157 +}
  10.158 +
  10.159 +int BE_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp) {
  10.160 +	/* FIXME: Not BeOs/Haiku supported */
  10.161 +}
  10.162 +
  10.163 +int BE_GetWindowGammaRamp(_THIS, SDL_Window * window, Uint16 * ramp) {
  10.164 +	/* FIXME: Not BeOs/Haiku supported */
  10.165 +}
  10.166 +
  10.167 +
  10.168 +void BE_SetWindowGrab(_THIS, SDL_Window * window) {
  10.169 +	/* TODO: Implement this! */
  10.170 +}
  10.171 +
  10.172 +void BE_DestroyWindow(_THIS, SDL_Window * window) {
  10.173 +	_ToBeWin(window)->LockLooper();	/* This MUST be locked */
  10.174 +	_GetBeApp()->ClearID(_ToBeWin(window));
  10.175 +	_ToBeWin(window)->Quit();
  10.176 +	window->driverdata = NULL;
  10.177 +}
  10.178 +
  10.179 +SDL_bool BE_GetWindowWMInfo(_THIS, SDL_Window * window,
  10.180 +                                    struct SDL_SysWMinfo *info) {
  10.181 +	/* FIXME: What is the point of this? What information should be included? */
  10.182 +}
  10.183 +
  10.184 +
  10.185 +extern int BE_CreateWindowFramebuffer(_THIS, SDL_Window * window,
  10.186 +                                       Uint32 * format,
  10.187 +                                       void ** pixels, int *pitch) {
  10.188 +	/* FIXME: Not BeOs/Haiku supported */
  10.189 +	return -1;
  10.190 +}
  10.191 +
  10.192 +extern int BE_UpdateWindowFramebuffer(_THIS, SDL_Window * window,
  10.193 +                                       SDL_Rect * rects, int numrects) {
  10.194 +	/* FIXME: Not BeOs/Haiku supported */
  10.195 +	return -1;
  10.196 +}
  10.197 +
  10.198 +extern void BE_DestroyWindowFramebuffer(_THIS, SDL_Window * window) {
  10.199 +	/* FIXME: Not BeOs/Haiku supported */
  10.200 +}
  10.201 +
  10.202 + 
  10.203 +#ifdef __cplusplus
  10.204 +}
  10.205 +#endif
  10.206 +