Slight format change and calling method

Hey, is it possible to apply this small patch to the SDL sources?
It basically renames the getWindowView() function to
SDL_getUikitView() and removes the static qualifier.
I did these changes because I needed to get the sdl uiview from the
program and external functions always begin with SDL_ (while i changed
window to uikit because it is referring to the uikit window only,
that in sdl carry a single uiview anyways).
The patch is also available here http://dl.dropbox.com/u/24468/sdluiview.patch
Thanks
Vittorio

diff -r 9738f2a8eee4 src/video/uikit/SDL_uikitview.m
— a/src/video/uikit/SDL_uikitview.m Wed Nov 09 02:35:49 2011 -0500
+++ b/src/video/uikit/SDL_uikitview.m Sat Nov 19 15:43:20 2011 +0100
@@ -316,7 +316,7 @@
/* iPhone keyboard addition functions */
#if SDL_IPHONE_KEYBOARD

-static SDL_uikitview * getWindowView(SDL_Window * window)
+SDL_uikitview *SDL_getUikitView(SDL_Window *window)
{
if (window == NULL) {
SDL_SetError(“Window does not exist”);
@@ -333,9 +333,9 @@
return view;
}

-int SDL_iPhoneKeyboardShow(SDL_Window * window)
+int SDL_iPhoneKeyboardShow(SDL_Window *window)
{

  • SDL_uikitview *view = getWindowView(window);
  • SDL_uikitview *view = SDL_getUikitView(window);
    if (view == nil) {
    return -1;
    }
    @@ -344,9 +344,9 @@
    return 0;
    }

-int SDL_iPhoneKeyboardHide(SDL_Window * window)
+int SDL_iPhoneKeyboardHide(SDL_Window *window)
{

  • SDL_uikitview *view = getWindowView(window);
  • SDL_uikitview *view = SDL_getUikitView(window);
    if (view == nil) {
    return -1;
    }
    @@ -355,9 +355,9 @@
    return 0;
    }

-SDL_bool SDL_iPhoneKeyboardIsShown(SDL_Window * window)
+SDL_bool SDL_iPhoneKeyboardIsShown(SDL_Window *window)
{

  • SDL_uikitview *view = getWindowView(window);
  • SDL_uikitview *view = SDL_getUikitView(window);
    if (view == nil) {
    return 0;
    }
    @@ -365,9 +365,9 @@
    return view.keyboardVisible;
    }

-int SDL_iPhoneKeyboardToggle(SDL_Window * window)
+int SDL_iPhoneKeyboardToggle(SDL_Window *window)
{

  • SDL_uikitview *view = getWindowView(window);
  • SDL_uikitview *view = SDL_getUikitView(window);
    if (view == nil) {
    return -1;
    }
    @@ -385,24 +385,24 @@

/* stubs, used if compiled without keyboard support */

-int SDL_iPhoneKeyboardShow(SDL_Window * window)
+int SDL_iPhoneKeyboardShow(SDL_Window *window)
{
SDL_SetError(“Not compiled with keyboard support”);
return -1;
}

-int SDL_iPhoneKeyboardHide(SDL_Window * window)
+int SDL_iPhoneKeyboardHide(SDL_Window *window)
{
SDL_SetError(“Not compiled with keyboard support”);
return -1;
}

-SDL_bool SDL_iPhoneKeyboardIsShown(SDL_Window * window)
+SDL_bool SDL_iPhoneKeyboardIsShown(SDL_Window *window)
{
return 0;
}

-int SDL_iPhoneKeyboardToggle(SDL_Window * window)
+int SDL_iPhoneKeyboardToggle(SDL_Window *window)
{
SDL_SetError(“Not compiled with keyboard support”);
return -1;

Hey, is it possible to apply this small patch to the SDL sources?
It basically renames the getWindowView() function to
SDL_getUikitView() and removes the static qualifier.
I did these changes because I needed to get the sdl uiview from the
program and external functions always begin with SDL_ (while i changed

Use SDL_GetWindowWMInfo() for this.

#ifdef iPhoneOS // or whatever this should be
SDL_SysWMinfo info;
SDL_GetWindowWMInfo(my_sdl_window, &info);
if (info.subsystem == SDL_SYSWM_UIKIT) {
UIWindow *win = info.info.uikit.window;
// This is the UIView.
}
#endif

–ryan.

I admit I haven’t yet tried that, but won’t that return just the
UIWindow instance?
VittorioOn Sun, Nov 20, 2011 at 1:11 AM, Ryan C. Gordon wrote:

Hey, is it possible to apply this small patch to the SDL sources?
It basically renames the getWindowView() function to
SDL_getUikitView() and removes the static qualifier.
I did these changes because I needed to get the sdl uiview from the
program and external functions always begin with SDL_ (while i changed

Use SDL_GetWindowWMInfo() for this.

#ifdef iPhoneOS ?// or whatever this should be
SDL_SysWMinfo info;
SDL_GetWindowWMInfo(my_sdl_window, &info);
if (info.subsystem == SDL_SYSWM_UIKIT) {
? ?UIWindow *win = info.info.uikit.window;
? ?// This is the UIView.
}
#endif

–ryan.

UIWindow *win = info.info.uikit.window;
// This is the UIView.

I admit I haven’t yet tried that, but won’t that return just the
UIWindow instance?

[win subviews];

–ryan.