Removed outdated Nano-X support
authorSam Lantinga <slouken@libsdl.org>
Sat, 19 Sep 2009 07:26:51 +0000
changeset 327408574b033f37
parent 3273 e0dfba770eb7
child 3275 a4a34a511ba0
Removed outdated Nano-X support
README.NanoX
configure.in
include/SDL_config.h.in
include/SDL_syswm.h
src/video/SDL_sysvideo.h
src/video/SDL_video.c
src/video/nanox/SDL_nxevents.c
src/video/nanox/SDL_nxevents_c.h
src/video/nanox/SDL_nximage.c
src/video/nanox/SDL_nximage_c.h
src/video/nanox/SDL_nxmodes.c
src/video/nanox/SDL_nxmodes_c.h
src/video/nanox/SDL_nxmouse.c
src/video/nanox/SDL_nxmouse_c.h
src/video/nanox/SDL_nxvideo.c
src/video/nanox/SDL_nxvideo.h
src/video/nanox/SDL_nxwm.c
src/video/nanox/SDL_nxwm_c.h
     1.1 --- a/README.NanoX	Sat Sep 19 07:22:07 2009 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,97 +0,0 @@
     1.4 -  =================================================================
     1.5 -  Patch version 0.9 of SDL(Simple DirectMedia Layer) for Nano-X API
     1.6 -  =================================================================
     1.7 -  
     1.8 -  Authors: Hsieh-Fu Tsai, clare@setabox.com
     1.9 -           Greg Haerr, greg@censoft.com
    1.10 -
    1.11 -  This patch is against SDL version 1.2.4.
    1.12 -  It enhances previous patch 0.8 by providing direct framebuffer
    1.13 -  access as well as dynamic hardware pixel type support, not
    1.14 -  requiring a compile-time option setting for different framebuffer
    1.15 -  modes.
    1.16 -  Tested against Microwindows version 0.89pre9.
    1.17 -
    1.18 -  Older Microwindows versions
    1.19 -  ===========================
    1.20 -  If running on a version older than Microwindows 0.89pre9,
    1.21 -  the following items might need to be patched in Microwindows.
    1.22 -
    1.23 -  1. Patch src/nanox/client.c::GrClose()
    1.24 -  It fixes the client side GrClose(). In the original version, 
    1.25 -  GrOpen() can only be called once. When the GrOpen() is called at 
    1.26 -  the second time, the program will terminate. In order to prevent
    1.27 -  this situation, we need to insert "nxSocket = -1" after 
    1.28 -  "close(nxSocket)" in GrClose(). If you do not have this problem,
    1.29 -  you may skip this step. 
    1.30 -
    1.31 -  2. Patch src/nanox/clientfb.c to return absolute x,y coordinates
    1.32 -  when using GrGetWindowFBInfo().  Copy the version 0.89pre9
    1.33 -  of src/nanox/clientfb.c to your system, or configure
    1.34 -  using --disable-nanox-direct-fb.
    1.35 -
    1.36 -  =============
    1.37 -  Quick Install 
    1.38 -  =============
    1.39 -
    1.40 -  1. ./configure --disable-video-x11 --disable-video-fbcon \ 
    1.41 -       --enable-video-nanox \ 
    1.42 -       --with-nanox-pixel-type=[rgb/0888/888/565/555/332/pal] 
    1.43 -  2. make clean 
    1.44 -  3. make 
    1.45 -  4. make install (as root) 
    1.46 -
    1.47 -  ============
    1.48 -  Nitty-gritty 
    1.49 -  ============
    1.50 -
    1.51 -  --enable-nanox-direct-fb       Use direct framebuffer access
    1.52 -  --enable-nanox-debug           Show debug messages 
    1.53 -  --enable-nanox-share-memory    Use shared-memory to speed up 
    1.54 -
    1.55 -  When running multi-threaded applications using SDL, such
    1.56 -  as SMPEG, set THREADSAFE=Y in Microwindows' config file,
    1.57 -  to enable GrXXX() system call critical section support.
    1.58 -
    1.59 -  =============================================
    1.60 -  Some programs can be used to test this patch. 
    1.61 -  =============================================
    1.62 -
    1.63 -  1. http://www.cs.berkeley.edu/~weimer/atris (a tetris-like game) 
    1.64 -  2. http://www.libsdl.org/projects/newvox/
    1.65 -  3. http://www.libsdl.org/projects/xflame/
    1.66 -  4. http://www.libsdl.org/projects/optimum/ 
    1.67 -  5. http://www.gnugeneration.com/software/loop/ 
    1.68 -  6: http://www.lokigames.com/development/smpeg.php3 (SMPEG version 0.4.4)
    1.69 -
    1.70 -  =========
    1.71 -  Todo List 
    1.72 -  =========
    1.73 -
    1.74 -  1. Create hardware surface
    1.75 -  2. Create YUVOverlay on hardware
    1.76 -  3. Use OpenGL
    1.77 -  4. Gamma correction
    1.78 -  5. Hide/Change mouse pointer
    1.79 -  6. Better window movement control with direct fb access
    1.80 -  7. Palette handling in 8bpp could be improved
    1.81 -
    1.82 -  =====================
    1.83 -  Supporting Institutes
    1.84 -  =====================
    1.85 -  
    1.86 -  Many thanks to go to Setabox Co., Ltd. and CML (Communication and
    1.87 -  Multimedia Laboratory, http://www.cmlab.csie.ntu.edu.tw/) in the 
    1.88 -  Department of Computer Science and Information Engineering of 
    1.89 -  National Taiwan University for supporting this porting project.
    1.90 -  
    1.91 -  Century Embedded Technologies (http://embedded.censoft.com)
    1.92 -  for this patch.
    1.93 -
    1.94 -  ===================
    1.95 -  Contact Information
    1.96 -  ===================
    1.97 -
    1.98 -  Welcome to give me any suggestion and to report bugs.
    1.99 -  My e-mail address : clare@setabox.com or niky@cmlab.csie.ntu.edu.tw
   1.100 -                      or greg@censoft.com
     2.1 --- a/configure.in	Sat Sep 19 07:22:07 2009 +0000
     2.2 +++ b/configure.in	Sat Sep 19 07:26:51 2009 +0000
     2.3 @@ -943,42 +943,6 @@
     2.4  }
     2.5  
     2.6  
     2.7 -dnl Find the nanox include and library directories
     2.8 -CheckNANOX()
     2.9 -{
    2.10 -    AC_ARG_ENABLE(video-nanox,
    2.11 -        AC_HELP_STRING([--enable-video-nanox], [use nanox video driver [[default=no]]]),
    2.12 -        , enable_video_nanox=no)
    2.13 -
    2.14 -    if test x$enable_video = xyes -a x$enable_video_nanox = xyes; then
    2.15 -        AC_ARG_ENABLE(nanox-debug,  
    2.16 -            AC_HELP_STRING([--enable-nanox-debug], [print debug messages [[default=no]]]),
    2.17 -            , enable_nanox_debug=no)
    2.18 -        if test x$enable_nanox_debug = xyes; then
    2.19 -            EXTRA_CFLAGS="$EXTRA_CFLAGS -DENABLE_NANOX_DEBUG"
    2.20 -        fi
    2.21 -
    2.22 -        AC_ARG_ENABLE(nanox-share-memory,  
    2.23 -            AC_HELP_STRING([--enable-nanox-share-memory], [use share memory [[default=no]]]),
    2.24 -            , enable_nanox_share_memory=no)
    2.25 -        if test x$enable_nanox_share_memory = xyes; then
    2.26 -            EXTRA_CFLAGS="$EXTRA_CFLAGS -DNANOX_SHARE_MEMORY"
    2.27 -        fi
    2.28 -
    2.29 -        AC_ARG_ENABLE(nanox_direct_fb, 
    2.30 -            AC_HELP_STRING([--enable-nanox-direct-fb], [use direct framebuffer access [[default=no]]]),
    2.31 -            , enable_nanox_direct_fb=no)
    2.32 -        if test x$enable_nanox_direct_fb = xyes; then
    2.33 -            EXTRA_CFLAGS="$EXTRA_CFLAGS -DENABLE_NANOX_DIRECT_FB"
    2.34 -        fi
    2.35 -
    2.36 -        AC_DEFINE(SDL_VIDEO_DRIVER_NANOX)
    2.37 -        SOURCES="$SOURCES $srcdir/src/video/nanox/*.c"
    2.38 -        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lnano-X"
    2.39 -        have_video=yes
    2.40 -    fi
    2.41 -}
    2.42 -
    2.43  dnl Find the X11 include and library directories
    2.44  CheckX11()
    2.45  {
    2.46 @@ -2422,7 +2386,6 @@
    2.47          CheckESD
    2.48          CheckNAS
    2.49          CheckX11
    2.50 -        CheckNANOX
    2.51          CheckFBCON
    2.52          CheckDirectFB
    2.53          CheckFusionSound
     3.1 --- a/include/SDL_config.h.in	Sat Sep 19 07:22:07 2009 +0000
     3.2 +++ b/include/SDL_config.h.in	Sat Sep 19 07:26:51 2009 +0000
     3.3 @@ -256,7 +256,6 @@
     3.4  #undef SDL_VIDEO_DRIVER_DUMMY
     3.5  #undef SDL_VIDEO_DRIVER_FBCON
     3.6  #undef SDL_VIDEO_DRIVER_GEM
     3.7 -#undef SDL_VIDEO_DRIVER_NANOX
     3.8  #undef SDL_VIDEO_DRIVER_NDS
     3.9  #undef SDL_VIDEO_DRIVER_PHOTON
    3.10  #undef SDL_VIDEO_DRIVER_QNXGF
     4.1 --- a/include/SDL_syswm.h	Sat Sep 19 07:22:07 2009 +0000
     4.2 +++ b/include/SDL_syswm.h	Sat Sep 19 07:26:51 2009 +0000
     4.3 @@ -112,23 +112,6 @@
     4.4      } info;
     4.5  };
     4.6  
     4.7 -#elif defined(SDL_VIDEO_DRIVER_NANOX)
     4.8 -#include <microwin/nano-X.h>
     4.9 -
    4.10 -/* The generic custom event structure */
    4.11 -struct SDL_SysWMmsg
    4.12 -{
    4.13 -    SDL_version version;
    4.14 -    int data;
    4.15 -};
    4.16 -
    4.17 -/* The windows custom window manager information structure */
    4.18 -struct SDL_SysWMinfo
    4.19 -{
    4.20 -    SDL_version version;
    4.21 -    GR_WINDOW_ID window;        /* The display window */
    4.22 -};
    4.23 -
    4.24  #elif defined(SDL_VIDEO_DRIVER_WIN32)
    4.25  #define WIN32_LEAN_AND_MEAN
    4.26  #include <windows.h>
     5.1 --- a/src/video/SDL_sysvideo.h	Sat Sep 19 07:22:07 2009 +0000
     5.2 +++ b/src/video/SDL_sysvideo.h	Sat Sep 19 07:26:51 2009 +0000
     5.3 @@ -341,9 +341,6 @@
     5.4  #if SDL_VIDEO_DRIVER_X11
     5.5  extern VideoBootStrap X11_bootstrap;
     5.6  #endif
     5.7 -#if SDL_VIDEO_DRIVER_NANOX
     5.8 -extern VideoBootStrap NX_bootstrap;
     5.9 -#endif
    5.10  #if SDL_VIDEO_DRIVER_WSCONS
    5.11  extern VideoBootStrap WSCONS_bootstrap;
    5.12  #endif
     6.1 --- a/src/video/SDL_video.c	Sat Sep 19 07:22:07 2009 +0000
     6.2 +++ b/src/video/SDL_video.c	Sat Sep 19 07:26:51 2009 +0000
     6.3 @@ -55,9 +55,6 @@
     6.4  #if SDL_VIDEO_DRIVER_X11
     6.5      &X11_bootstrap,
     6.6  #endif
     6.7 -#if SDL_VIDEO_DRIVER_NANOX
     6.8 -    &NX_bootstrap,
     6.9 -#endif
    6.10  #if SDL_VIDEO_DRIVER_WSCONS
    6.11      &WSCONS_bootstrap,
    6.12  #endif
     7.1 --- a/src/video/nanox/SDL_nxevents.c	Sat Sep 19 07:22:07 2009 +0000
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,403 +0,0 @@
     7.4 -/*
     7.5 -    SDL - Simple DirectMedia Layer
     7.6 -    Copyright (C) 1997-2009 Sam Lantinga
     7.7 -    Copyright (C) 2001  Hsieh-Fu Tsai
     7.8 -    Copyright (C) 2002  Greg Haerr <greg@censoft.com>
     7.9 -
    7.10 -    This library is free software; you can redistribute it and/or
    7.11 -    modify it under the terms of the GNU Library General Public
    7.12 -    License as published by the Free Software Foundation; either
    7.13 -    version 2 of the License, or (at your option) any later version.
    7.14 -
    7.15 -    This library is distributed in the hope that it will be useful,
    7.16 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
    7.17 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    7.18 -    Library General Public License for more details.
    7.19 -
    7.20 -    You should have received a copy of the GNU Library General Public
    7.21 -    License along with this library; if not, write to the Free
    7.22 -    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    7.23 -
    7.24 -    Sam Lantinga
    7.25 -    slouken@libsdl.org
    7.26 -    
    7.27 -    Hsieh-Fu Tsai
    7.28 -    clare@setabox.com
    7.29 -*/
    7.30 -#include "SDL_config.h"
    7.31 -
    7.32 -#include "SDL_keysym.h"
    7.33 -#include "../../events/SDL_events_c.h"
    7.34 -
    7.35 -#include "SDL_nxevents_c.h"
    7.36 -#include "SDL_nximage_c.h"
    7.37 -
    7.38 -// The translation tables from a nanox keysym to a SDL keysym
    7.39 -static SDLKey NX_NONASCII_keymap[MWKEY_LAST + 1];
    7.40 -
    7.41 -void
    7.42 -NX_InitOSKeymap(_THIS)
    7.43 -{
    7.44 -    int i;
    7.45 -
    7.46 -    Dprintf("enter NX_InitOSKeymap\n");
    7.47 -
    7.48 -    // Map the nanox scancodes to SDL keysyms
    7.49 -    for (i = 0; i < SDL_arraysize(NX_NONASCII_keymap); ++i)
    7.50 -        NX_NONASCII_keymap[i] = SDLK_UNKNOWN;
    7.51 -
    7.52 -    NX_NONASCII_keymap[MWKEY_LEFT & 0xFF] = SDLK_LEFT;
    7.53 -    NX_NONASCII_keymap[MWKEY_RIGHT & 0xFF] = SDLK_RIGHT;
    7.54 -    NX_NONASCII_keymap[MWKEY_UP & 0xFF] = SDLK_UP;
    7.55 -    NX_NONASCII_keymap[MWKEY_DOWN & 0xFF] = SDLK_DOWN;
    7.56 -    NX_NONASCII_keymap[MWKEY_INSERT & 0xFF] = SDLK_INSERT;
    7.57 -    NX_NONASCII_keymap[MWKEY_DELETE & 0xFF] = SDLK_DELETE;
    7.58 -    NX_NONASCII_keymap[MWKEY_HOME & 0xFF] = SDLK_HOME;
    7.59 -    NX_NONASCII_keymap[MWKEY_END & 0xFF] = SDLK_END;
    7.60 -    NX_NONASCII_keymap[MWKEY_PAGEUP & 0xFF] = SDLK_PAGEUP;
    7.61 -    NX_NONASCII_keymap[MWKEY_PAGEDOWN & 0xFF] = SDLK_PAGEDOWN;
    7.62 -
    7.63 -    NX_NONASCII_keymap[MWKEY_KP0 & 0xFF] = SDLK_KP0;
    7.64 -    NX_NONASCII_keymap[MWKEY_KP1 & 0xFF] = SDLK_KP1;
    7.65 -    NX_NONASCII_keymap[MWKEY_KP2 & 0xFF] = SDLK_KP2;
    7.66 -    NX_NONASCII_keymap[MWKEY_KP3 & 0xFF] = SDLK_KP3;
    7.67 -    NX_NONASCII_keymap[MWKEY_KP4 & 0xFF] = SDLK_KP4;
    7.68 -    NX_NONASCII_keymap[MWKEY_KP5 & 0xFF] = SDLK_KP5;
    7.69 -    NX_NONASCII_keymap[MWKEY_KP6 & 0xFF] = SDLK_KP6;
    7.70 -    NX_NONASCII_keymap[MWKEY_KP7 & 0xFF] = SDLK_KP7;
    7.71 -    NX_NONASCII_keymap[MWKEY_KP8 & 0xFF] = SDLK_KP8;
    7.72 -    NX_NONASCII_keymap[MWKEY_KP9 & 0xFF] = SDLK_KP9;
    7.73 -    NX_NONASCII_keymap[MWKEY_KP_PERIOD & 0xFF] = SDLK_KP_PERIOD;
    7.74 -    NX_NONASCII_keymap[MWKEY_KP_DIVIDE & 0xFF] = SDLK_KP_DIVIDE;
    7.75 -    NX_NONASCII_keymap[MWKEY_KP_MULTIPLY & 0xFF] = SDLK_KP_MULTIPLY;
    7.76 -    NX_NONASCII_keymap[MWKEY_KP_MINUS & 0xFF] = SDLK_KP_MINUS;
    7.77 -    NX_NONASCII_keymap[MWKEY_KP_PLUS & 0xFF] = SDLK_KP_PLUS;
    7.78 -    NX_NONASCII_keymap[MWKEY_KP_ENTER & 0xFF] = SDLK_KP_ENTER;
    7.79 -    NX_NONASCII_keymap[MWKEY_KP_EQUALS & 0xFF] = SDLK_KP_EQUALS;
    7.80 -
    7.81 -    NX_NONASCII_keymap[MWKEY_F1 & 0xFF] = SDLK_F1;
    7.82 -    NX_NONASCII_keymap[MWKEY_F2 & 0xFF] = SDLK_F2;
    7.83 -    NX_NONASCII_keymap[MWKEY_F3 & 0xFF] = SDLK_F3;
    7.84 -    NX_NONASCII_keymap[MWKEY_F4 & 0xFF] = SDLK_F4;
    7.85 -    NX_NONASCII_keymap[MWKEY_F5 & 0xFF] = SDLK_F5;
    7.86 -    NX_NONASCII_keymap[MWKEY_F6 & 0xFF] = SDLK_F6;
    7.87 -    NX_NONASCII_keymap[MWKEY_F7 & 0xFF] = SDLK_F7;
    7.88 -    NX_NONASCII_keymap[MWKEY_F8 & 0xFF] = SDLK_F8;
    7.89 -    NX_NONASCII_keymap[MWKEY_F9 & 0xFF] = SDLK_F9;
    7.90 -    NX_NONASCII_keymap[MWKEY_F10 & 0xFF] = SDLK_F10;
    7.91 -    NX_NONASCII_keymap[MWKEY_F11 & 0xFF] = SDLK_F11;
    7.92 -    NX_NONASCII_keymap[MWKEY_F12 & 0xFF] = SDLK_F12;
    7.93 -
    7.94 -    NX_NONASCII_keymap[MWKEY_NUMLOCK & 0xFF] = SDLK_NUMLOCK;
    7.95 -    NX_NONASCII_keymap[MWKEY_CAPSLOCK & 0xFF] = SDLK_CAPSLOCK;
    7.96 -    NX_NONASCII_keymap[MWKEY_SCROLLOCK & 0xFF] = SDLK_SCROLLOCK;
    7.97 -    NX_NONASCII_keymap[MWKEY_LSHIFT & 0xFF] = SDLK_LSHIFT;
    7.98 -    NX_NONASCII_keymap[MWKEY_RSHIFT & 0xFF] = SDLK_RSHIFT;
    7.99 -    NX_NONASCII_keymap[MWKEY_LCTRL & 0xFF] = SDLK_LCTRL;
   7.100 -    NX_NONASCII_keymap[MWKEY_RCTRL & 0xFF] = SDLK_RCTRL;
   7.101 -    NX_NONASCII_keymap[MWKEY_LALT & 0xFF] = SDLK_LALT;
   7.102 -    NX_NONASCII_keymap[MWKEY_RALT & 0xFF] = SDLK_RALT;
   7.103 -    NX_NONASCII_keymap[MWKEY_LMETA & 0xFF] = SDLK_LMETA;
   7.104 -    NX_NONASCII_keymap[MWKEY_RMETA & 0xFF] = SDLK_RMETA;
   7.105 -    NX_NONASCII_keymap[MWKEY_ALTGR & 0xFF] = SDLK_MODE;
   7.106 -
   7.107 -    NX_NONASCII_keymap[MWKEY_PRINT & 0xFF] = SDLK_PRINT;
   7.108 -    NX_NONASCII_keymap[MWKEY_SYSREQ & 0xFF] = SDLK_SYSREQ;
   7.109 -    NX_NONASCII_keymap[MWKEY_PAUSE & 0xFF] = SDLK_PAUSE;
   7.110 -    NX_NONASCII_keymap[MWKEY_BREAK & 0xFF] = SDLK_BREAK;
   7.111 -    NX_NONASCII_keymap[MWKEY_MENU & 0xFF] = SDLK_MENU;
   7.112 -
   7.113 -    Dprintf("leave NX_InitOSKeymap\n");
   7.114 -}
   7.115 -
   7.116 -SDL_keysym *
   7.117 -NX_TranslateKey(GR_EVENT_KEYSTROKE * keystroke, SDL_keysym * keysym)
   7.118 -{
   7.119 -    GR_KEY ch = keystroke->ch;
   7.120 -
   7.121 -    Dprintf("enter NX_TranslateKey\n");
   7.122 -
   7.123 -    keysym->scancode = keystroke->scancode;
   7.124 -    keysym->sym = SDLK_UNKNOWN;
   7.125 -
   7.126 -    if (ch & MWKEY_NONASCII_MASK) {
   7.127 -        keysym->sym = NX_NONASCII_keymap[ch & 0xFF];
   7.128 -    } else {
   7.129 -        keysym->sym = ch & 0x7F;
   7.130 -    }
   7.131 -
   7.132 -    keysym->mod = KMOD_NONE;
   7.133 -
   7.134 -#if 1                           //   Retrieve more mode information
   7.135 -    {
   7.136 -        GR_KEYMOD mod = keystroke->modifiers;
   7.137 -
   7.138 -        if (mod & MWKMOD_LSHIFT)
   7.139 -            keysym->mod |= KMOD_LSHIFT;
   7.140 -        if (mod & MWKMOD_RSHIFT)
   7.141 -            keysym->mod |= KMOD_RSHIFT;
   7.142 -        if (mod & MWKMOD_LCTRL)
   7.143 -            keysym->mod |= KMOD_LCTRL;
   7.144 -        if (mod & MWKMOD_RCTRL)
   7.145 -            keysym->mod |= KMOD_RCTRL;
   7.146 -        if (mod & MWKMOD_LALT)
   7.147 -            keysym->mod |= KMOD_LALT;
   7.148 -        if (mod & MWKMOD_RALT)
   7.149 -            keysym->mod |= KMOD_RALT;
   7.150 -        if (mod & MWKMOD_LMETA)
   7.151 -            keysym->mod |= KMOD_LMETA;
   7.152 -        if (mod & MWKMOD_RMETA)
   7.153 -            keysym->mod |= KMOD_RMETA;
   7.154 -        if (mod & MWKMOD_NUM)
   7.155 -            keysym->mod |= KMOD_NUM;
   7.156 -        if (mod & MWKMOD_CAPS)
   7.157 -            keysym->mod |= KMOD_CAPS;
   7.158 -        if (mod & MWKMOD_ALTGR)
   7.159 -            keysym->mod |= KMOD_MODE;
   7.160 -    }
   7.161 -#endif
   7.162 -
   7.163 -    keysym->unicode = ch;
   7.164 -
   7.165 -    Dprintf("leave NX_TranslateKey\n");
   7.166 -    return keysym;
   7.167 -}
   7.168 -
   7.169 -static int
   7.170 -check_boundary(_THIS, int x, int y)
   7.171 -{
   7.172 -    if (x < OffsetX || y < OffsetY || x > OffsetX + this->screen->w ||
   7.173 -        y > OffsetY + this->screen->h)
   7.174 -        return 0;
   7.175 -
   7.176 -    return 1;
   7.177 -}
   7.178 -
   7.179 -void
   7.180 -NX_PumpEvents(_THIS)
   7.181 -{
   7.182 -    GR_EVENT event;
   7.183 -    static GR_BUTTON last_button_down = 0;
   7.184 -
   7.185 -    GrCheckNextEvent(&event);
   7.186 -    while (event.type != GR_EVENT_TYPE_NONE) {
   7.187 -
   7.188 -        // dispatch event
   7.189 -        switch (event.type) {
   7.190 -        case GR_EVENT_TYPE_MOUSE_ENTER:
   7.191 -            {
   7.192 -                Dprintf("mouse enter\n");
   7.193 -                SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
   7.194 -                break;
   7.195 -            }
   7.196 -
   7.197 -        case GR_EVENT_TYPE_MOUSE_EXIT:
   7.198 -            {
   7.199 -                Dprintf("mouse exit\n");
   7.200 -                SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
   7.201 -                break;
   7.202 -            }
   7.203 -
   7.204 -        case GR_EVENT_TYPE_FOCUS_IN:
   7.205 -            {
   7.206 -                Dprintf("focus in\n");
   7.207 -                SDL_PrivateAppActive(1, SDL_APPINPUTFOCUS);
   7.208 -                break;
   7.209 -            }
   7.210 -
   7.211 -        case GR_EVENT_TYPE_FOCUS_OUT:
   7.212 -            {
   7.213 -                Dprintf("focus out\n");
   7.214 -                SDL_PrivateAppActive(0, SDL_APPINPUTFOCUS);
   7.215 -                break;
   7.216 -            }
   7.217 -
   7.218 -        case GR_EVENT_TYPE_MOUSE_MOTION:
   7.219 -            {
   7.220 -                Dprintf("mouse motion\n");
   7.221 -
   7.222 -                if (SDL_VideoSurface) {
   7.223 -                    if (currently_fullscreen) {
   7.224 -                        if (check_boundary
   7.225 -                            (this, event.button.x, event.button.y)) {
   7.226 -                            SDL_PrivateMouseMotion(0, 0,
   7.227 -                                                   event.button.x -
   7.228 -                                                   OffsetX,
   7.229 -                                                   event.button.y - OffsetY);
   7.230 -                        }
   7.231 -                    } else {
   7.232 -                        SDL_PrivateMouseMotion(0, 0, event.button.x,
   7.233 -                                               event.button.y);
   7.234 -                    }
   7.235 -                }
   7.236 -                break;
   7.237 -            }
   7.238 -
   7.239 -        case GR_EVENT_TYPE_BUTTON_DOWN:
   7.240 -            {
   7.241 -                int button = event.button.buttons;
   7.242 -
   7.243 -                Dprintf("button down\n");
   7.244 -
   7.245 -                switch (button) {
   7.246 -                case MWBUTTON_L:
   7.247 -                    button = 1;
   7.248 -                    break;
   7.249 -                case MWBUTTON_M:
   7.250 -                    button = 2;
   7.251 -                    break;
   7.252 -                case MWBUTTON_R:
   7.253 -                    button = 3;
   7.254 -                    break;
   7.255 -                default:
   7.256 -                    button = 0;
   7.257 -                }
   7.258 -                last_button_down = button;
   7.259 -
   7.260 -                if (currently_fullscreen) {
   7.261 -                    if (check_boundary(this, event.button.x, event.button.y)) {
   7.262 -                        SDL_PrivateMouseButton(SDL_PRESSED, button,
   7.263 -                                               event.button.x -
   7.264 -                                               OffsetX,
   7.265 -                                               event.button.y - OffsetY);
   7.266 -                    }
   7.267 -                } else {
   7.268 -                    SDL_PrivateMouseButton(SDL_PRESSED, button,
   7.269 -                                           event.button.x, event.button.y);
   7.270 -                }
   7.271 -                break;
   7.272 -            }
   7.273 -
   7.274 -            // do not konw which button is released
   7.275 -        case GR_EVENT_TYPE_BUTTON_UP:
   7.276 -            {
   7.277 -                Dprintf("button up\n");
   7.278 -
   7.279 -                if (currently_fullscreen) {
   7.280 -                    if (check_boundary(this, event.button.x, event.button.y)) {
   7.281 -                        SDL_PrivateMouseButton(SDL_RELEASED,
   7.282 -                                               last_button_down,
   7.283 -                                               event.button.x -
   7.284 -                                               OffsetX,
   7.285 -                                               event.button.y - OffsetY);
   7.286 -                    }
   7.287 -                } else {
   7.288 -                    SDL_PrivateMouseButton(SDL_RELEASED,
   7.289 -                                           last_button_down,
   7.290 -                                           event.button.x, event.button.y);
   7.291 -                }
   7.292 -                last_button_down = 0;
   7.293 -                break;
   7.294 -            }
   7.295 -
   7.296 -        case GR_EVENT_TYPE_KEY_DOWN:
   7.297 -            {
   7.298 -                SDL_keysym keysym;
   7.299 -
   7.300 -                Dprintf("key down\n");
   7.301 -                SDL_PrivateKeyboard(SDL_PRESSED,
   7.302 -                                    NX_TranslateKey(&event.keystroke,
   7.303 -                                                    &keysym));
   7.304 -                break;
   7.305 -            }
   7.306 -
   7.307 -        case GR_EVENT_TYPE_KEY_UP:
   7.308 -            {
   7.309 -                SDL_keysym keysym;
   7.310 -
   7.311 -                Dprintf("key up\n");
   7.312 -                SDL_PrivateKeyboard(SDL_RELEASED,
   7.313 -                                    NX_TranslateKey(&event.keystroke,
   7.314 -                                                    &keysym));
   7.315 -                break;
   7.316 -            }
   7.317 -
   7.318 -        case GR_EVENT_TYPE_CLOSE_REQ:
   7.319 -            {
   7.320 -                Dprintf("close require\n");
   7.321 -                SDL_PrivateQuit();
   7.322 -                break;
   7.323 -            }
   7.324 -
   7.325 -        case GR_EVENT_TYPE_EXPOSURE:
   7.326 -            {
   7.327 -                Dprintf("event_type_exposure\n");
   7.328 -                if (SDL_VideoSurface) {
   7.329 -                    NX_RefreshDisplay(this);    //, & event.exposure) ;
   7.330 -                }
   7.331 -                break;
   7.332 -            }
   7.333 -
   7.334 -        case GR_EVENT_TYPE_UPDATE:
   7.335 -            {
   7.336 -                switch (event.update.utype) {
   7.337 -                case GR_UPDATE_MAP:
   7.338 -                    {
   7.339 -                        Dprintf("GR_UPDATE_MAP\n");
   7.340 -                        // If we're not active, make ourselves active
   7.341 -                        if (!(SDL_GetAppState() & SDL_APPACTIVE)) {
   7.342 -                            // Send an internal activate event
   7.343 -                            SDL_PrivateAppActive(1, SDL_APPACTIVE);
   7.344 -                        }
   7.345 -                        if (SDL_VideoSurface) {
   7.346 -                            NX_RefreshDisplay(this);
   7.347 -                        }
   7.348 -                        break;
   7.349 -                    }
   7.350 -
   7.351 -                case GR_UPDATE_UNMAP:
   7.352 -                case GR_UPDATE_UNMAPTEMP:
   7.353 -                    {
   7.354 -                        Dprintf("GR_UPDATE_UNMAP or GR_UPDATE_UNMAPTEMP\n");
   7.355 -                        // If we're active, make ourselves inactive
   7.356 -                        if (SDL_GetAppState() & SDL_APPACTIVE) {
   7.357 -                            // Send an internal deactivate event
   7.358 -                            SDL_PrivateAppActive(0,
   7.359 -                                                 SDL_APPACTIVE |
   7.360 -                                                 SDL_APPINPUTFOCUS);
   7.361 -                        }
   7.362 -                        break;
   7.363 -                    }
   7.364 -
   7.365 -                case GR_UPDATE_SIZE:
   7.366 -                    {
   7.367 -                        Dprintf("GR_UPDATE_SIZE\n");
   7.368 -                        SDL_PrivateResize(event.update.width,
   7.369 -                                          event.update.height);
   7.370 -                        break;
   7.371 -                    }
   7.372 -
   7.373 -                case GR_UPDATE_MOVE:
   7.374 -                case GR_UPDATE_REPARENT:
   7.375 -                    {
   7.376 -                        Dprintf("GR_UPDATE_MOVE or GR_UPDATE_REPARENT\n");
   7.377 -#ifdef ENABLE_NANOX_DIRECT_FB
   7.378 -                        if (Clientfb) {
   7.379 -                            /* Get current window position and fb pointer */
   7.380 -                            if (currently_fullscreen)
   7.381 -                                GrGetWindowFBInfo(FSwindow, &fbinfo);
   7.382 -                            else
   7.383 -                                GrGetWindowFBInfo(SDL_Window, &fbinfo);
   7.384 -                        }
   7.385 -#endif
   7.386 -                        break;
   7.387 -                    }
   7.388 -
   7.389 -                default:
   7.390 -                    Dprintf("unknown GR_EVENT_TYPE_UPDATE\n");
   7.391 -                    break;
   7.392 -                }
   7.393 -                break;
   7.394 -            }
   7.395 -
   7.396 -        default:
   7.397 -            {
   7.398 -                Dprintf("pump event default\n");
   7.399 -            }
   7.400 -        }
   7.401 -
   7.402 -        GrCheckNextEvent(&event);
   7.403 -    }
   7.404 -}
   7.405 -
   7.406 -/* vi: set ts=4 sw=4 expandtab: */
     8.1 --- a/src/video/nanox/SDL_nxevents_c.h	Sat Sep 19 07:22:07 2009 +0000
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,33 +0,0 @@
     8.4 -/*
     8.5 -    SDL - Simple DirectMedia Layer
     8.6 -    Copyright (C) 1997-2009 Sam Lantinga
     8.7 -    Copyright (C) 2001  Hsieh-Fu Tsai
     8.8 -
     8.9 -    This library is free software; you can redistribute it and/or
    8.10 -    modify it under the terms of the GNU Library General Public
    8.11 -    License as published by the Free Software Foundation; either
    8.12 -    version 2 of the License, or (at your option) any later version.
    8.13 -
    8.14 -    This library is distributed in the hope that it will be useful,
    8.15 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
    8.16 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    8.17 -    Library General Public License for more details.
    8.18 -
    8.19 -    You should have received a copy of the GNU Library General Public
    8.20 -    License along with this library; if not, write to the Free
    8.21 -    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    8.22 -
    8.23 -    Sam Lantinga
    8.24 -    slouken@libsdl.org
    8.25 -    
    8.26 -    Hsieh-Fu Tsai
    8.27 -    clare@setabox.com
    8.28 -*/
    8.29 -#include "SDL_config.h"
    8.30 -
    8.31 -#include "SDL_nxvideo.h"
    8.32 -
    8.33 -// Functions to be exported
    8.34 -extern void NX_InitOSKeymap(_THIS);
    8.35 -extern void NX_PumpEvents(_THIS);
    8.36 -/* vi: set ts=4 sw=4 expandtab: */
     9.1 --- a/src/video/nanox/SDL_nximage.c	Sat Sep 19 07:22:07 2009 +0000
     9.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.3 @@ -1,243 +0,0 @@
     9.4 -/*
     9.5 -    SDL - Simple DirectMedia Layer
     9.6 -    Copyright (C) 1997-2009 Sam Lantinga
     9.7 -    Copyright (C) 2001  Hsieh-Fu Tsai
     9.8 -    Copyright (C) 2002  Greg Haerr <greg@censoft.com>
     9.9 -
    9.10 -    This library is free software; you can redistribute it and/or
    9.11 -    modify it under the terms of the GNU Library General Public
    9.12 -    License as published by the Free Software Foundation; either
    9.13 -    version 2 of the License, or (at your option) any later version.
    9.14 -
    9.15 -    This library is distributed in the hope that it will be useful,
    9.16 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
    9.17 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    9.18 -    Library General Public License for more details.
    9.19 -
    9.20 -    You should have received a copy of the GNU Library General Public
    9.21 -    License along with this library; if not, write to the Free
    9.22 -    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    9.23 -
    9.24 -    Sam Lantinga
    9.25 -    slouken@libsdl.org
    9.26 -    
    9.27 -    Hsieh-Fu Tsai
    9.28 -    clare@setabox.com
    9.29 -*/
    9.30 -#include "SDL_config.h"
    9.31 -
    9.32 -#include "SDL_nximage_c.h"
    9.33 -
    9.34 -void
    9.35 -NX_NormalUpdate(_THIS, int numrects, SDL_Rect * rects)
    9.36 -{
    9.37 -    int i, j, xinc, yinc, destinc, rowinc;
    9.38 -    int x, y, w, h;
    9.39 -    unsigned char *src = NULL, *dest = NULL;
    9.40 -
    9.41 -    Dprintf("enter NX_NormalUpdate\n");
    9.42 -
    9.43 -    /* These are the values for the incoming image */
    9.44 -    xinc = this->screen->format->BytesPerPixel;
    9.45 -    yinc = this->screen->pitch;
    9.46 -
    9.47 -    for (i = 0; i < numrects; ++i) {
    9.48 -        x = rects[i].x, y = rects[i].y;
    9.49 -        w = rects[i].w, h = rects[i].h;
    9.50 -        src = SDL_Image + y * yinc + x * xinc;
    9.51 -#ifdef ENABLE_NANOX_DIRECT_FB
    9.52 -        if (Clientfb) {
    9.53 -            if (currently_fullscreen)
    9.54 -                dest =
    9.55 -                    fbinfo.winpixels + (((y + OffsetY) * fbinfo.pitch) +
    9.56 -                                        ((x + OffsetX) * fbinfo.bytespp));
    9.57 -            else
    9.58 -                dest =
    9.59 -                    fbinfo.winpixels + ((y * fbinfo.pitch) +
    9.60 -                                        (x * fbinfo.bytespp));
    9.61 -            destinc = fbinfo.pitch;
    9.62 -        } else
    9.63 -#endif
    9.64 -        {
    9.65 -            dest = Image_buff;
    9.66 -            destinc = w * xinc;
    9.67 -        }
    9.68 -        rowinc = w * xinc;
    9.69 -
    9.70 -        // apply GammaRamp table
    9.71 -        if ((pixel_type == MWPF_TRUECOLOR0888
    9.72 -             || pixel_type == MWPF_TRUECOLOR888) && GammaRamp_R
    9.73 -            && GammaRamp_G && GammaRamp_B) {
    9.74 -            Uint8 *ptrsrc;
    9.75 -            Uint8 *ptrdst;
    9.76 -            int k;
    9.77 -
    9.78 -            for (j = h; j > 0; --j, src += yinc, dest += destinc) {
    9.79 -                ptrsrc = src;
    9.80 -                ptrdst = dest;
    9.81 -                for (k = w; k > 0; --k) {
    9.82 -                    *ptrdst++ = GammaRamp_B[*ptrsrc++] >> 8;
    9.83 -                    *ptrdst++ = GammaRamp_G[*ptrsrc++] >> 8;
    9.84 -                    *ptrdst++ = GammaRamp_R[*ptrsrc++] >> 8;
    9.85 -                    *ptrdst++ = 0;
    9.86 -                    ++ptrsrc;
    9.87 -                }
    9.88 -            }
    9.89 -        }
    9.90 -#if 1                           /* This is needed for microwindows 0.90 or older */
    9.91 -        else if (pixel_type == MWPF_TRUECOLOR0888
    9.92 -                 || pixel_type == MWPF_TRUECOLOR888) {
    9.93 -            Uint8 *ptrsrc;
    9.94 -            Uint8 *ptrdst;
    9.95 -            int k;
    9.96 -
    9.97 -            for (j = h; j > 0; --j, src += yinc, dest += destinc) {
    9.98 -                ptrsrc = src;
    9.99 -                ptrdst = dest;
   9.100 -                for (k = w; k > 0; --k) {
   9.101 -                    *ptrdst++ = *ptrsrc++;
   9.102 -                    *ptrdst++ = *ptrsrc++;
   9.103 -                    *ptrdst++ = *ptrsrc++;
   9.104 -                    *ptrdst++ = 0;
   9.105 -                    ++ptrsrc;
   9.106 -                }
   9.107 -            }
   9.108 -        }
   9.109 -#endif
   9.110 -        else {
   9.111 -            for (j = h; j > 0; --j, src += yinc, dest += destinc)
   9.112 -                SDL_memcpy(dest, src, rowinc);
   9.113 -        }
   9.114 -        if (!Clientfb) {
   9.115 -            if (currently_fullscreen) {
   9.116 -                GrArea(FSwindow, SDL_GC, x + OffsetX, y + OffsetY, w,
   9.117 -                       h, Image_buff, pixel_type);
   9.118 -            } else {
   9.119 -                GrArea(SDL_Window, SDL_GC, x, y, w, h, Image_buff,
   9.120 -                       pixel_type);
   9.121 -            }
   9.122 -        }
   9.123 -    }
   9.124 -    GrFlush();
   9.125 -
   9.126 -    Dprintf("leave NX_NormalUpdate\n");
   9.127 -}
   9.128 -
   9.129 -int
   9.130 -NX_SetupImage(_THIS, SDL_Surface * screen)
   9.131 -{
   9.132 -    int size = screen->h * screen->pitch;
   9.133 -
   9.134 -    Dprintf("enter NX_SetupImage\n");
   9.135 -
   9.136 -    screen->pixels = (void *) SDL_malloc(size);
   9.137 -
   9.138 -    if (!Clientfb) {
   9.139 -        Image_buff = (unsigned char *) SDL_malloc(size);
   9.140 -        if (screen->pixels == NULL || Image_buff == NULL) {
   9.141 -            SDL_free(screen->pixels);
   9.142 -            SDL_free(Image_buff);
   9.143 -            SDL_OutOfMemory();
   9.144 -            return -1;
   9.145 -        }
   9.146 -    }
   9.147 -
   9.148 -    SDL_Image = (unsigned char *) screen->pixels;
   9.149 -
   9.150 -    this->UpdateRects = NX_NormalUpdate;
   9.151 -
   9.152 -    Dprintf("leave NX_SetupImage\n");
   9.153 -    return 0;
   9.154 -}
   9.155 -
   9.156 -void
   9.157 -NX_DestroyImage(_THIS, SDL_Surface * screen)
   9.158 -{
   9.159 -    Dprintf("enter NX_DestroyImage\n");
   9.160 -
   9.161 -    if (SDL_Image)
   9.162 -        SDL_free(SDL_Image);
   9.163 -    if (Image_buff)
   9.164 -        SDL_free(Image_buff);
   9.165 -    if (screen)
   9.166 -        screen->pixels = NULL;
   9.167 -
   9.168 -    Dprintf("leave NX_DestroyImage\n");
   9.169 -}
   9.170 -
   9.171 -int
   9.172 -NX_ResizeImage(_THIS, SDL_Surface * screen, Uint32 flags)
   9.173 -{
   9.174 -    int retval;
   9.175 -    GR_SCREEN_INFO si;
   9.176 -
   9.177 -    Dprintf("enter NX_ResizeImage\n");
   9.178 -
   9.179 -    NX_DestroyImage(this, screen);
   9.180 -    retval = NX_SetupImage(this, screen);
   9.181 -
   9.182 -    GrGetScreenInfo(&si);
   9.183 -    OffsetX = (si.cols - screen->w) / 2;
   9.184 -    OffsetY = (si.rows - screen->h) / 2;
   9.185 -
   9.186 -#ifdef ENABLE_NANOX_DIRECT_FB
   9.187 -    if (Clientfb) {
   9.188 -        /* Get current window position and fb pointer */
   9.189 -        if (currently_fullscreen)
   9.190 -            GrGetWindowFBInfo(FSwindow, &fbinfo);
   9.191 -        else
   9.192 -            GrGetWindowFBInfo(SDL_Window, &fbinfo);
   9.193 -    }
   9.194 -#endif
   9.195 -    Dprintf("leave NX_ResizeImage\n");
   9.196 -    return retval;
   9.197 -}
   9.198 -
   9.199 -void
   9.200 -NX_RefreshDisplay(_THIS)
   9.201 -{
   9.202 -    Dprintf("enter NX_RefreshDisplay\n");
   9.203 -
   9.204 -    // Don't refresh a display that doesn't have an image (like GL)
   9.205 -    if (!SDL_Image) {
   9.206 -        return;
   9.207 -    }
   9.208 -#ifdef ENABLE_NANOX_DIRECT_FB
   9.209 -    if (Clientfb) {
   9.210 -        int j;
   9.211 -        char *src, *dest = NULL;
   9.212 -        int xinc, yinc, rowinc;
   9.213 -
   9.214 -        GrGetWindowFBInfo(SDL_Window, &fbinfo);
   9.215 -
   9.216 -        xinc = this->screen->format->BytesPerPixel;
   9.217 -        yinc = this->screen->pitch;
   9.218 -
   9.219 -        src = SDL_Image;
   9.220 -        if (currently_fullscreen)
   9.221 -            dest = fbinfo.winpixels + ((OffsetY * fbinfo.pitch) +
   9.222 -                                       (OffsetX * fbinfo.bytespp));
   9.223 -        else
   9.224 -            dest = fbinfo.winpixels;
   9.225 -        rowinc = xinc * this->screen->w;
   9.226 -
   9.227 -        for (j = this->screen->h; j > 0;
   9.228 -             --j, src += yinc, dest += fbinfo.pitch)
   9.229 -            SDL_memcpy(dest, src, rowinc);
   9.230 -    } else
   9.231 -#endif
   9.232 -    {
   9.233 -        if (currently_fullscreen) {
   9.234 -            GrArea(FSwindow, SDL_GC, OffsetX, OffsetY, this->screen->w,
   9.235 -                   this->screen->h, SDL_Image, pixel_type);
   9.236 -        } else {
   9.237 -            GrArea(SDL_Window, SDL_GC, 0, 0, this->screen->w,
   9.238 -                   this->screen->h, SDL_Image, pixel_type);
   9.239 -        }
   9.240 -    }
   9.241 -    GrFlush();
   9.242 -
   9.243 -    Dprintf("leave NX_RefreshDisplay\n");
   9.244 -}
   9.245 -
   9.246 -/* vi: set ts=4 sw=4 expandtab: */
    10.1 --- a/src/video/nanox/SDL_nximage_c.h	Sat Sep 19 07:22:07 2009 +0000
    10.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.3 @@ -1,36 +0,0 @@
    10.4 -/*
    10.5 -    SDL - Simple DirectMedia Layer
    10.6 -    Copyright (C) 1997-2009 Sam Lantinga
    10.7 -    Copyright (C) 2001  Hsieh-Fu Tsai
    10.8 -
    10.9 -    This library is free software; you can redistribute it and/or
   10.10 -    modify it under the terms of the GNU Library General Public
   10.11 -    License as published by the Free Software Foundation; either
   10.12 -    version 2 of the License, or (at your option) any later version.
   10.13 -
   10.14 -    This library is distributed in the hope that it will be useful,
   10.15 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   10.16 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   10.17 -    Library General Public License for more details.
   10.18 -
   10.19 -    You should have received a copy of the GNU Library General Public
   10.20 -    License along with this library; if not, write to the Free
   10.21 -    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   10.22 -
   10.23 -    Sam Lantinga
   10.24 -    slouken@libsdl.org
   10.25 -    
   10.26 -    Hsieh-Fu Tsai
   10.27 -    clare@setabox.com
   10.28 -*/
   10.29 -#include "SDL_config.h"
   10.30 -
   10.31 -#include "SDL_nxvideo.h"
   10.32 -
   10.33 -extern int NX_SetupImage(_THIS, SDL_Surface * screen);
   10.34 -extern void NX_DestroyImage(_THIS, SDL_Surface * screen);
   10.35 -extern int NX_ResizeImage(_THIS, SDL_Surface * screen, Uint32 flags);
   10.36 -
   10.37 -extern void NX_NormalUpdate(_THIS, int numrects, SDL_Rect * rects);
   10.38 -extern void NX_RefreshDisplay(_THIS);
   10.39 -/* vi: set ts=4 sw=4 expandtab: */
    11.1 --- a/src/video/nanox/SDL_nxmodes.c	Sat Sep 19 07:22:07 2009 +0000
    11.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.3 @@ -1,90 +0,0 @@
    11.4 -/*
    11.5 -    SDL - Simple DirectMedia Layer
    11.6 -    Copyright (C) 1997-2009 Sam Lantinga
    11.7 -    Copyright (C) 2001  Hsieh-Fu Tsai
    11.8 -
    11.9 -    This library is free software; you can redistribute it and/or
   11.10 -    modify it under the terms of the GNU Library General Public
   11.11 -    License as published by the Free Software Foundation; either
   11.12 -    version 2 of the License, or (at your option) any later version.
   11.13 -
   11.14 -    This library is distributed in the hope that it will be useful,
   11.15 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   11.16 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   11.17 -    Library General Public License for more details.
   11.18 -
   11.19 -    You should have received a copy of the GNU Library General Public
   11.20 -    License along with this library; if not, write to the Free
   11.21 -    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   11.22 -
   11.23 -    Sam Lantinga
   11.24 -    slouken@libsdl.org
   11.25 -    
   11.26 -    Hsieh-Fu Tsai
   11.27 -    clare@setabox.com
   11.28 -*/
   11.29 -#include "SDL_config.h"
   11.30 -
   11.31 -#include "SDL_stdinc.h"
   11.32 -#include "SDL_nxmodes_c.h"
   11.33 -
   11.34 -SDL_Rect **
   11.35 -NX_ListModes(_THIS, SDL_PixelFormat * format, Uint32 flags)
   11.36 -{
   11.37 -    if (flags & SDL_FULLSCREEN)
   11.38 -        return SDL_modelist;
   11.39 -
   11.40 -    if (SDL_Visual.bpp == format->BitsPerPixel) {
   11.41 -        return ((SDL_Rect **) - 1);
   11.42 -    } else {
   11.43 -        return ((SDL_Rect **) 0);
   11.44 -    }
   11.45 -}
   11.46 -
   11.47 -void
   11.48 -NX_FreeVideoModes(_THIS)
   11.49 -{
   11.50 -    int i;
   11.51 -
   11.52 -    if (SDL_modelist) {
   11.53 -        for (i = 0; SDL_modelist[i]; ++i) {
   11.54 -            SDL_free(SDL_modelist[i]);
   11.55 -        }
   11.56 -        SDL_free(SDL_modelist);
   11.57 -        SDL_modelist = NULL;
   11.58 -    }
   11.59 -}
   11.60 -
   11.61 -int
   11.62 -NX_EnterFullScreen(_THIS)
   11.63 -{
   11.64 -    if (!currently_fullscreen) {
   11.65 -        GR_SCREEN_INFO si;
   11.66 -
   11.67 -        GrGetScreenInfo(&si);
   11.68 -        GrResizeWindow(FSwindow, si.cols, si.rows);
   11.69 -        GrUnmapWindow(SDL_Window);
   11.70 -        GrMapWindow(FSwindow);
   11.71 -        GrRaiseWindow(FSwindow);
   11.72 -        GrSetFocus(FSwindow);
   11.73 -        currently_fullscreen = 1;
   11.74 -    }
   11.75 -
   11.76 -    return 1;
   11.77 -}
   11.78 -
   11.79 -int
   11.80 -NX_LeaveFullScreen(_THIS)
   11.81 -{
   11.82 -    if (currently_fullscreen) {
   11.83 -        GrUnmapWindow(FSwindow);
   11.84 -        GrMapWindow(SDL_Window);
   11.85 -        GrRaiseWindow(SDL_Window);
   11.86 -        GrSetFocus(SDL_Window);
   11.87 -        currently_fullscreen = 0;
   11.88 -    }
   11.89 -
   11.90 -    return 0;
   11.91 -}
   11.92 -
   11.93 -/* vi: set ts=4 sw=4 expandtab: */
    12.1 --- a/src/video/nanox/SDL_nxmodes_c.h	Sat Sep 19 07:22:07 2009 +0000
    12.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.3 @@ -1,34 +0,0 @@
    12.4 -/*
    12.5 -    SDL - Simple DirectMedia Layer
    12.6 -    Copyright (C) 1997-2009 Sam Lantinga
    12.7 -    Copyright (C) 2001  Hsieh-Fu Tsai
    12.8 -
    12.9 -    This library is free software; you can redistribute it and/or
   12.10 -    modify it under the terms of the GNU Library General Public
   12.11 -    License as published by the Free Software Foundation; either
   12.12 -    version 2 of the License, or (at your option) any later version.
   12.13 -
   12.14 -    This library is distributed in the hope that it will be useful,
   12.15 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   12.16 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   12.17 -    Library General Public License for more details.
   12.18 -
   12.19 -    You should have received a copy of the GNU Library General Public
   12.20 -    License along with this library; if not, write to the Free
   12.21 -    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   12.22 -
   12.23 -    Sam Lantinga
   12.24 -    slouken@libsdl.org
   12.25 -    
   12.26 -    Hsieh-Fu Tsai
   12.27 -    clare@setabox.com
   12.28 -*/
   12.29 -#include "SDL_config.h"
   12.30 -
   12.31 -#include "SDL_nxvideo.h"
   12.32 -
   12.33 -extern SDL_Rect **NX_ListModes(_THIS, SDL_PixelFormat * format, Uint32 flags);
   12.34 -extern void NX_FreeVideoModes(_THIS);
   12.35 -extern int NX_EnterFullScreen(_THIS);
   12.36 -extern int NX_LeaveFullScreen(_THIS);
   12.37 -/* vi: set ts=4 sw=4 expandtab: */
    13.1 --- a/src/video/nanox/SDL_nxmouse.c	Sat Sep 19 07:22:07 2009 +0000
    13.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.3 @@ -1,87 +0,0 @@
    13.4 -/*
    13.5 -    SDL - Simple DirectMedia Layer
    13.6 -    Copyright (C) 1997-2009 Sam Lantinga
    13.7 -    Copyright (C) 2001  Hsieh-Fu Tsai
    13.8 -
    13.9 -    This library is free software; you can redistribute it and/or
   13.10 -    modify it under the terms of the GNU Library General Public
   13.11 -    License as published by the Free Software Foundation; either
   13.12 -    version 2 of the License, or (at your option) any later version.
   13.13 -
   13.14 -    This library is distributed in the hope that it will be useful,
   13.15 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   13.16 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   13.17 -    Library General Public License for more details.
   13.18 -
   13.19 -    You should have received a copy of the GNU Library General Public
   13.20 -    License along with this library; if not, write to the Free
   13.21 -    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   13.22 -
   13.23 -    Sam Lantinga
   13.24 -    slouken@libsdl.org
   13.25 -    
   13.26 -    Hsieh-Fu Tsai
   13.27 -    clare@setabox.com
   13.28 -*/
   13.29 -#include "SDL_config.h"
   13.30 -
   13.31 -#include "../../events/SDL_events_c.h"
   13.32 -
   13.33 -#include "SDL_nxmouse_c.h"
   13.34 -
   13.35 -// The implementation dependent data for the window manager cursor
   13.36 -struct WMcursor
   13.37 -{
   13.38 -    int unused;
   13.39 -};
   13.40 -
   13.41 -WMcursor *
   13.42 -NX_CreateWMCursor(_THIS,
   13.43 -                  Uint8 * data, Uint8 * mask, int w, int h, int hot_x,
   13.44 -                  int hot_y)
   13.45 -{
   13.46 -    WMcursor *cursor;
   13.47 -
   13.48 -    Dprintf("enter NX_CreateWMCursor\n");
   13.49 -
   13.50 -    cursor = (WMcursor *) SDL_malloc(sizeof(WMcursor));
   13.51 -    if (cursor == NULL) {
   13.52 -        SDL_OutOfMemory();
   13.53 -        return NULL;
   13.54 -    }
   13.55 -
   13.56 -    Dprintf("leave NX_CreateWMCursor\n");
   13.57 -    return cursor;
   13.58 -}
   13.59 -
   13.60 -void
   13.61 -NX_FreeWMCursor(_THIS, WMcursor * cursor)
   13.62 -{
   13.63 -    Dprintf("NX_FreeWMCursor\n");
   13.64 -    SDL_free(cursor);
   13.65 -    return;
   13.66 -}
   13.67 -
   13.68 -void
   13.69 -NX_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
   13.70 -{
   13.71 -    GR_WINDOW_INFO info;
   13.72 -
   13.73 -    Dprintf("enter NX_WarpWMCursor\n");
   13.74 -    SDL_Lock_EventThread();
   13.75 -
   13.76 -    GrGetWindowInfo(SDL_Window, &info);
   13.77 -    GrMoveCursor(info.x + x, info.y + y);
   13.78 -
   13.79 -    SDL_Unlock_EventThread();
   13.80 -    Dprintf("leave NX_WarpWMCursor\n");
   13.81 -}
   13.82 -
   13.83 -int
   13.84 -NX_ShowWMCursor(_THIS, WMcursor * cursor)
   13.85 -{
   13.86 -    Dprintf("NX_ShowWMCursor\n");
   13.87 -    return 1;
   13.88 -}
   13.89 -
   13.90 -/* vi: set ts=4 sw=4 expandtab: */
    14.1 --- a/src/video/nanox/SDL_nxmouse_c.h	Sat Sep 19 07:22:07 2009 +0000
    14.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.3 @@ -1,31 +0,0 @@
    14.4 -/*
    14.5 -    SDL - Simple DirectMedia Layer
    14.6 -    Copyright (C) 1997-2009 Sam Lantinga
    14.7 -
    14.8 -    This library is free software; you can redistribute it and/or
    14.9 -    modify it under the terms of the GNU Lesser General Public
   14.10 -    License as published by the Free Software Foundation; either
   14.11 -    version 2.1 of the License, or (at your option) any later version.
   14.12 -
   14.13 -    This library is distributed in the hope that it will be useful,
   14.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   14.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   14.16 -    Lesser General Public License for more details.
   14.17 -
   14.18 -    You should have received a copy of the GNU Lesser General Public
   14.19 -    License along with this library; if not, write to the Free Software
   14.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   14.21 -
   14.22 -    Sam Lantinga
   14.23 -    slouken@libsdl.org
   14.24 -*/
   14.25 -#include "SDL_config.h"
   14.26 -
   14.27 -#include "SDL_nxvideo.h"
   14.28 -
   14.29 -extern WMcursor *NX_CreateWMCursor(_THIS, Uint8 * data, Uint8 * mask, int w,
   14.30 -                                   int h, int hot_x, int hot_y);
   14.31 -void NX_FreeWMCursor(_THIS, WMcursor * cursor);
   14.32 -extern void NX_WarpWMCursor(_THIS, Uint16 x, Uint16 y);
   14.33 -extern int NX_ShowWMCursor(_THIS, WMcursor * cursor);
   14.34 -/* vi: set ts=4 sw=4 expandtab: */
    15.1 --- a/src/video/nanox/SDL_nxvideo.c	Sat Sep 19 07:22:07 2009 +0000
    15.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.3 @@ -1,572 +0,0 @@
    15.4 -/*
    15.5 -    SDL - Simple DirectMedia Layer
    15.6 -    Copyright (C) 1997-2009 Sam Lantinga
    15.7 -    Copyright (C) 2001  Hsieh-Fu Tsai
    15.8 -    Copyright (C) 2002  Greg Haerr <greg@censoft.com>
    15.9 -
   15.10 -    This library is free software; you can redistribute it and/or
   15.11 -    modify it under the terms of the GNU Library General Public
   15.12 -    License as published by the Free Software Foundation; either
   15.13 -    version 2 of the License, or (at your option) any later version.
   15.14 -
   15.15 -    This library is distributed in the hope that it will be useful,
   15.16 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   15.17 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   15.18 -    Library General Public License for more details.
   15.19 -
   15.20 -    You should have received a copy of the GNU Library General Public
   15.21 -    License along with this library; if not, write to the Free
   15.22 -    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   15.23 -
   15.24 -    Sam Lantinga
   15.25 -    slouken@libsdl.org
   15.26 -    
   15.27 -    Hsieh-Fu Tsai
   15.28 -    clare@setabox.com
   15.29 -*/
   15.30 -#include "SDL_config.h"
   15.31 -
   15.32 -#include "SDL_thread.h"
   15.33 -#include "SDL_video.h"
   15.34 -#include "../SDL_pixels_c.h"
   15.35 -#include "../../events/SDL_events_c.h"
   15.36 -
   15.37 -#define MWINCLUDECOLORS
   15.38 -#include "SDL_nxvideo.h"
   15.39 -#include "SDL_nxmodes_c.h"
   15.40 -#include "SDL_nxwm_c.h"
   15.41 -#include "SDL_nxmouse_c.h"
   15.42 -#include "SDL_nximage_c.h"
   15.43 -#include "SDL_nxevents_c.h"
   15.44 -
   15.45 -// Initialization/Query functions
   15.46 -static int NX_VideoInit(_THIS, SDL_PixelFormat * vformat);
   15.47 -static SDL_Surface *NX_SetVideoMode(_THIS, SDL_Surface * current, int width,
   15.48 -                                    int height, int bpp, Uint32 flags);
   15.49 -static int NX_SetColors(_THIS, int firstcolor, int ncolors,
   15.50 -                        SDL_Color * colors);
   15.51 -static void NX_VideoQuit(_THIS);
   15.52 -static void NX_DestroyWindow(_THIS, SDL_Surface * screen);
   15.53 -static int NX_ToggleFullScreen(_THIS, int on);
   15.54 -static void NX_UpdateMouse(_THIS);
   15.55 -static int NX_SetGammaRamp(_THIS, Uint16 * ramp);
   15.56 -static int NX_GetGammaRamp(_THIS, Uint16 * ramp);
   15.57 -
   15.58 -// Microwin driver bootstrap functions
   15.59 -static int
   15.60 -NX_Available()
   15.61 -{
   15.62 -    Dprintf("enter NX_Available\n");
   15.63 -
   15.64 -    if (GrOpen() < 0)
   15.65 -        return 0;
   15.66 -    GrClose();
   15.67 -
   15.68 -    Dprintf("leave NX_Available\n");
   15.69 -    return 1;
   15.70 -}
   15.71 -
   15.72 -static void
   15.73 -NX_DeleteDevice(SDL_VideoDevice * device)
   15.74 -{
   15.75 -    Dprintf("enter NX_DeleteDevice\n");
   15.76 -
   15.77 -    if (device) {
   15.78 -        if (device->hidden)
   15.79 -            SDL_free(device->hidden);
   15.80 -        if (device->gl_data)
   15.81 -            SDL_free(device->gl_data);
   15.82 -        SDL_free(device);
   15.83 -    }
   15.84 -
   15.85 -    Dprintf("leave NX_DeleteDevice\n");
   15.86 -}
   15.87 -
   15.88 -static SDL_VideoDevice *
   15.89 -NX_CreateDevice(int devindex)
   15.90 -{
   15.91 -    SDL_VideoDevice *device;
   15.92 -
   15.93 -    Dprintf("enter NX_CreateDevice\n");
   15.94 -
   15.95 -    // Initialize all variables that we clean on shutdown
   15.96 -    device = (SDL_VideoDevice *) SDL_malloc(sizeof(SDL_VideoDevice));
   15.97 -    if (device) {
   15.98 -        SDL_memset(device, 0, (sizeof *device));
   15.99 -        device->hidden = (struct SDL_PrivateVideoData *)
  15.100 -            SDL_malloc((sizeof *device->hidden));
  15.101 -        device->gl_data = NULL;
  15.102 -    }
  15.103 -    if ((device == NULL) || (device->hidden == NULL)) {
  15.104 -        SDL_OutOfMemory();
  15.105 -        NX_DeleteDevice(device);
  15.106 -        return 0;
  15.107 -    }
  15.108 -    SDL_memset(device->hidden, 0, (sizeof *device->hidden));
  15.109 -
  15.110 -    // Set the function pointers
  15.111 -    device->VideoInit = NX_VideoInit;
  15.112 -    device->ListModes = NX_ListModes;
  15.113 -    device->SetVideoMode = NX_SetVideoMode;
  15.114 -    device->ToggleFullScreen = NX_ToggleFullScreen;
  15.115 -    device->UpdateMouse = NX_UpdateMouse;
  15.116 -    device->CreateYUVOverlay = NULL;
  15.117 -    device->SetColors = NX_SetColors;
  15.118 -    device->UpdateRects = NULL;
  15.119 -    device->VideoQuit = NX_VideoQuit;
  15.120 -    device->AllocHWSurface = NULL;
  15.121 -    device->CheckHWBlit = NULL;
  15.122 -    device->FillHWRect = NULL;
  15.123 -    device->SetHWColorKey = NULL;
  15.124 -    device->SetHWAlpha = NULL;
  15.125 -    device->LockHWSurface = NULL;
  15.126 -    device->UnlockHWSurface = NULL;
  15.127 -    device->FlipHWSurface = NULL;
  15.128 -    device->FreeHWSurface = NULL;
  15.129 -    device->SetGamma = NULL;
  15.130 -    device->GetGamma = NULL;
  15.131 -    device->SetGammaRamp = NX_SetGammaRamp;
  15.132 -    device->GetGammaRamp = NX_GetGammaRamp;
  15.133 -
  15.134 -#if SDL_VIDEO_OPENGL
  15.135 -    device->GL_LoadLibrary = NULL;
  15.136 -    device->GL_GetProcAddress = NULL;
  15.137 -    device->GL_GetAttribute = NULL;
  15.138 -    device->GL_MakeCurrent = NULL;
  15.139 -    device->GL_SwapBuffers = NULL;
  15.140 -#endif
  15.141 -
  15.142 -    device->SetIcon = NULL;
  15.143 -    device->SetCaption = NX_SetCaption;
  15.144 -    device->IconifyWindow = NULL;
  15.145 -    device->GrabInput = NULL;
  15.146 -    device->GetWMInfo = NX_GetWMInfo;
  15.147 -    device->FreeWMCursor = NX_FreeWMCursor;
  15.148 -    device->CreateWMCursor = NX_CreateWMCursor;
  15.149 -    device->ShowWMCursor = NX_ShowWMCursor;
  15.150 -    device->WarpWMCursor = NX_WarpWMCursor;
  15.151 -    device->CheckMouseMode = NULL;
  15.152 -    device->InitOSKeymap = NX_InitOSKeymap;
  15.153 -    device->PumpEvents = NX_PumpEvents;
  15.154 -
  15.155 -    device->free = NX_DeleteDevice;
  15.156 -
  15.157 -    Dprintf("leave NX_CreateDevice\n");
  15.158 -    return device;
  15.159 -}
  15.160 -
  15.161 -VideoBootStrap NX_bootstrap = {
  15.162 -    "nanox", "nanox", NX_Available, NX_CreateDevice
  15.163 -};
  15.164 -
  15.165 -static void
  15.166 -create_aux_windows(_THIS)
  15.167 -{
  15.168 -    GR_WM_PROPERTIES props;
  15.169 -
  15.170 -    Dprintf("enter create_aux_windows\n");
  15.171 -
  15.172 -    // Don't create any extra windows if we are being managed
  15.173 -    if (SDL_windowid) {
  15.174 -        FSwindow = 0;
  15.175 -        return;
  15.176 -    }
  15.177 -
  15.178 -    if (FSwindow && FSwindow != GR_ROOT_WINDOW_ID) {
  15.179 -        GrDestroyWindow(FSwindow);
  15.180 -    }
  15.181 -
  15.182 -    FSwindow = GrNewWindow(GR_ROOT_WINDOW_ID, 0, 0, 1, 1, 0, BLACK, BLACK);
  15.183 -    props.flags = GR_WM_FLAGS_PROPS;
  15.184 -    props.props = GR_WM_PROPS_NODECORATE;
  15.185 -    GrSetWMProperties(FSwindow, &props);
  15.186 -
  15.187 -    GrSelectEvents(FSwindow, (GR_EVENT_MASK_EXPOSURE |
  15.188 -                              GR_EVENT_MASK_BUTTON_DOWN |
  15.189 -                              GR_EVENT_MASK_BUTTON_UP |
  15.190 -                              GR_EVENT_MASK_FOCUS_IN |
  15.191 -                              GR_EVENT_MASK_FOCUS_OUT |
  15.192 -                              GR_EVENT_MASK_KEY_DOWN | GR_EVENT_MASK_KEY_UP |
  15.193 -                              GR_EVENT_MASK_MOUSE_ENTER |
  15.194 -                              GR_EVENT_MASK_MOUSE_EXIT |
  15.195 -                              GR_EVENT_MASK_MOUSE_MOTION |
  15.196 -                              GR_EVENT_MASK_UPDATE |
  15.197 -                              GR_EVENT_MASK_CLOSE_REQ));
  15.198 -
  15.199 -    Dprintf("leave create_aux_windows\n");
  15.200 -}
  15.201 -
  15.202 -int
  15.203 -NX_VideoInit(_THIS, SDL_PixelFormat * vformat)
  15.204 -{
  15.205 -    GR_SCREEN_INFO si;
  15.206 -
  15.207 -    Dprintf("enter NX_VideoInit\n");
  15.208 -
  15.209 -    if (GrOpen() < 0) {
  15.210 -        SDL_SetError("GrOpen() fail");
  15.211 -        return -1;
  15.212 -    }
  15.213 -    // use share memory to speed up
  15.214 -#ifdef NANOX_SHARE_MEMORY
  15.215 -    GrReqShmCmds(0xFFFF);
  15.216 -#endif
  15.217 -
  15.218 -    SDL_Window = 0;
  15.219 -    FSwindow = 0;
  15.220 -
  15.221 -    GammaRamp_R = NULL;
  15.222 -    GammaRamp_G = NULL;
  15.223 -    GammaRamp_B = NULL;
  15.224 -
  15.225 -    GrGetScreenInfo(&si);
  15.226 -    SDL_Visual.bpp = si.bpp;
  15.227 -
  15.228 -    /* Determine the current screen size */
  15.229 -    this->info.current_w = si.cols;
  15.230 -    this->info.current_h = si.rows;
  15.231 -
  15.232 -    // GetVideoMode
  15.233 -    SDL_modelist = (SDL_Rect **) SDL_malloc(sizeof(SDL_Rect *) * 2);
  15.234 -    if (SDL_modelist) {
  15.235 -        SDL_modelist[0] = (SDL_Rect *) SDL_malloc(sizeof(SDL_Rect));
  15.236 -        if (SDL_modelist[0]) {
  15.237 -            SDL_modelist[0]->x = 0;
  15.238 -            SDL_modelist[0]->y = 0;
  15.239 -            SDL_modelist[0]->w = si.cols;
  15.240 -            SDL_modelist[0]->h = si.rows;
  15.241 -        }
  15.242 -        SDL_modelist[1] = NULL;
  15.243 -    }
  15.244 -
  15.245 -    pixel_type = si.pixtype;
  15.246 -    SDL_Visual.red_mask = si.rmask;
  15.247 -    SDL_Visual.green_mask = si.gmask;
  15.248 -    SDL_Visual.blue_mask = si.bmask;
  15.249 -
  15.250 -    vformat->BitsPerPixel = SDL_Visual.bpp;
  15.251 -    if (vformat->BitsPerPixel > 8) {
  15.252 -        vformat->Rmask = SDL_Visual.red_mask;
  15.253 -        vformat->Gmask = SDL_Visual.green_mask;
  15.254 -        vformat->Bmask = SDL_Visual.blue_mask;
  15.255 -    }
  15.256 -    // See if we have been passed a window to use
  15.257 -    SDL_windowid = getenv("SDL_WINDOWID");
  15.258 -
  15.259 -    // Create the fullscreen (and managed windows : no implement)
  15.260 -    create_aux_windows(this);
  15.261 -
  15.262 -    Dprintf("leave NX_VideoInit\n");
  15.263 -    return 0;
  15.264 -}
  15.265 -
  15.266 -void
  15.267 -NX_VideoQuit(_THIS)
  15.268 -{
  15.269 -    Dprintf("enter NX_VideoQuit\n");
  15.270 -
  15.271 -    // Start shutting down the windows
  15.272 -    NX_DestroyImage(this, this->screen);
  15.273 -    NX_DestroyWindow(this, this->screen);
  15.274 -    if (FSwindow && FSwindow != GR_ROOT_WINDOW_ID) {
  15.275 -        GrDestroyWindow(FSwindow);
  15.276 -    }
  15.277 -    NX_FreeVideoModes(this);
  15.278 -    SDL_free(GammaRamp_R);
  15.279 -    SDL_free(GammaRamp_G);
  15.280 -    SDL_free(GammaRamp_B);
  15.281 -
  15.282 -#ifdef ENABLE_NANOX_DIRECT_FB
  15.283 -    if (Clientfb)
  15.284 -        GrCloseClientFramebuffer();
  15.285 -#endif
  15.286 -    GrClose();
  15.287 -
  15.288 -    Dprintf("leave NX_VideoQuit\n");
  15.289 -}
  15.290 -
  15.291 -static void
  15.292 -NX_DestroyWindow(_THIS, SDL_Surface * screen)
  15.293 -{
  15.294 -    Dprintf("enter NX_DestroyWindow\n");
  15.295 -
  15.296 -    if (!SDL_windowid) {
  15.297 -        if (screen && (screen->flags & SDL_FULLSCREEN)) {
  15.298 -            screen->flags &= ~SDL_FULLSCREEN;
  15.299 -            NX_LeaveFullScreen(this);
  15.300 -        }
  15.301 -        // Destroy the output window
  15.302 -        if (SDL_Window && SDL_Window != GR_ROOT_WINDOW_ID) {
  15.303 -            GrDestroyWindow(SDL_Window);
  15.304 -        }
  15.305 -    }
  15.306 -    // Free the graphics context
  15.307 -    if (!SDL_GC) {
  15.308 -        GrDestroyGC(SDL_GC);
  15.309 -        SDL_GC = 0;
  15.310 -    }
  15.311 -
  15.312 -    Dprintf("leave NX_DestroyWindow\n");
  15.313 -}
  15.314 -
  15.315 -static int
  15.316 -NX_CreateWindow(_THIS, SDL_Surface * screen,
  15.317 -                int w, int h, int bpp, Uint32 flags)
  15.318 -{
  15.319 -    Dprintf("enter NX_CreateWindow\n");
  15.320 -
  15.321 -    // If a window is already present, destroy it and start fresh
  15.322 -    if (SDL_Window && SDL_Window != GR_ROOT_WINDOW_ID) {
  15.323 -        NX_DestroyWindow(this, screen);
  15.324 -    }
  15.325 -    // See if we have been given a window id
  15.326 -    if (SDL_windowid) {
  15.327 -        SDL_Window = SDL_strtol(SDL_windowid, NULL, 0);
  15.328 -    } else {
  15.329 -        SDL_Window = 0;
  15.330 -    }
  15.331 -
  15.332 -    if (!SDL_ReallocFormat(screen, bpp, SDL_Visual.red_mask,
  15.333 -                           SDL_Visual.green_mask, SDL_Visual.blue_mask, 0))
  15.334 -        return -1;
  15.335 -
  15.336 -    // Create (or use) the nanox display window
  15.337 -    if (!SDL_windowid) {
  15.338 -
  15.339 -        SDL_Window =
  15.340 -            GrNewWindow(GR_ROOT_WINDOW_ID, 0, 0, w, h, 0, BLACK, WHITE);
  15.341 -
  15.342 -        GrSelectEvents(SDL_Window, (GR_EVENT_MASK_EXPOSURE |
  15.343 -                                    GR_EVENT_MASK_BUTTON_DOWN |
  15.344 -                                    GR_EVENT_MASK_BUTTON_UP |
  15.345 -                                    GR_EVENT_MASK_FOCUS_IN |
  15.346 -                                    GR_EVENT_MASK_FOCUS_OUT |
  15.347 -                                    GR_EVENT_MASK_KEY_DOWN |
  15.348 -                                    GR_EVENT_MASK_KEY_UP |
  15.349 -                                    GR_EVENT_MASK_MOUSE_ENTER |
  15.350 -                                    GR_EVENT_MASK_MOUSE_EXIT |
  15.351 -                                    GR_EVENT_MASK_MOUSE_MOTION |
  15.352 -                                    GR_EVENT_MASK_UPDATE |
  15.353 -                                    GR_EVENT_MASK_CLOSE_REQ));
  15.354 -    }
  15.355 -
  15.356 -    /* Create the graphics context here, once we have a window */
  15.357 -    SDL_GC = GrNewGC();
  15.358 -    if (SDL_GC == 0) {
  15.359 -        SDL_SetError("Couldn't create graphics context");
  15.360 -        return (-1);
  15.361 -    }
  15.362 -    // Map them both and go fullscreen, if requested
  15.363 -    if (!SDL_windowid) {
  15.364 -        GrMapWindow(SDL_Window);
  15.365 -        if (flags & SDL_FULLSCREEN) {
  15.366 -            screen->flags |= SDL_FULLSCREEN;
  15.367 -            NX_EnterFullScreen(this);
  15.368 -        } else {
  15.369 -            screen->flags &= ~SDL_FULLSCREEN;
  15.370 -        }
  15.371 -    }
  15.372 -#ifdef ENABLE_NANOX_DIRECT_FB
  15.373 -    /* attempt allocating the client side framebuffer */
  15.374 -    Clientfb = GrOpenClientFramebuffer();
  15.375 -    /* NULL return will default to using GrArea() */
  15.376 -#endif
  15.377 -
  15.378 -    Dprintf("leave NX_CreateWindow\n");
  15.379 -    return 0;
  15.380 -}
  15.381 -
  15.382 -SDL_Surface *
  15.383 -NX_SetVideoMode(_THIS, SDL_Surface * current,
  15.384 -                int width, int height, int bpp, Uint32 flags)
  15.385 -{
  15.386 -    Dprintf("enter NX_SetVideoMode\n");
  15.387 -
  15.388 -    // Lock the event thread, in multi-threading environments
  15.389 -    SDL_Lock_EventThread();
  15.390 -
  15.391 -    bpp = SDL_Visual.bpp;
  15.392 -    if (NX_CreateWindow(this, current, width, height, bpp, flags) < 0) {
  15.393 -        current = NULL;
  15.394 -        goto done;
  15.395 -    }
  15.396 -
  15.397 -    if (current->w != width || current->h != height) {
  15.398 -        current->w = width;
  15.399 -        current->h = height;
  15.400 -        current->pitch = SDL_CalculatePitch(current);
  15.401 -        NX_ResizeImage(this, current, flags);
  15.402 -    }
  15.403 -    current->flags |= (flags & (SDL_RESIZABLE | SDL_NOFRAME));
  15.404 -
  15.405 -  done:
  15.406 -    SDL_Unlock_EventThread();
  15.407 -
  15.408 -    Dprintf("leave NX_SetVideoMode\n");
  15.409 -
  15.410 -    // We're done!
  15.411 -    return current;
  15.412 -}
  15.413 -
  15.414 -// ncolors <= 256
  15.415 -int
  15.416 -NX_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color * colors)
  15.417 -{
  15.418 -    int i;
  15.419 -    GR_PALETTE pal;
  15.420 -
  15.421 -    Dprintf("enter NX_SetColors\n");
  15.422 -
  15.423 -    if (ncolors > 256)
  15.424 -        return 0;
  15.425 -
  15.426 -    pal.count = ncolors;
  15.427 -    for (i = 0; i < ncolors; ++i) {
  15.428 -        pal.palette[i].r = colors[i].r;
  15.429 -        pal.palette[i].g = colors[i].g;
  15.430 -        pal.palette[i].b = colors[i].b;
  15.431 -    }
  15.432 -    GrSetSystemPalette(firstcolor, &pal);
  15.433 -
  15.434 -    Dprintf("leave NX_SetColors\n");
  15.435 -    return 1;
  15.436 -}
  15.437 -
  15.438 -static int
  15.439 -NX_ToggleFullScreen(_THIS, int on)
  15.440 -{
  15.441 -    SDL_Rect rect;
  15.442 -    Uint32 event_thread;
  15.443 -
  15.444 -    Dprintf("enter NX_ToggleFullScreen\n");
  15.445 -
  15.446 -    // Don't switch if we don't own the window
  15.447 -    if (SDL_windowid)
  15.448 -        return 0;
  15.449 -
  15.450 -    // Don't lock if we are the event thread
  15.451 -    event_thread = SDL_EventThreadID();
  15.452 -    if (event_thread && (SDL_ThreadID() == event_thread)) {
  15.453 -        event_thread = 0;
  15.454 -    }
  15.455 -    if (event_thread) {
  15.456 -        SDL_Lock_EventThread();
  15.457 -    }
  15.458 -
  15.459 -    if (on) {
  15.460 -        NX_EnterFullScreen(this);
  15.461 -    } else {
  15.462 -        this->screen->flags &= ~SDL_FULLSCREEN;
  15.463 -        NX_LeaveFullScreen(this);
  15.464 -    }
  15.465 -
  15.466 -    rect.x = rect.y = 0;
  15.467 -    rect.w = this->screen->w, rect.h = this->screen->h;
  15.468 -    NX_NormalUpdate(this, 1, &rect);
  15.469 -
  15.470 -    if (event_thread) {
  15.471 -        SDL_Unlock_EventThread();
  15.472 -    }
  15.473 -
  15.474 -    Dprintf("leave NX_ToggleFullScreen\n");
  15.475 -    return 1;
  15.476 -}
  15.477 -
  15.478 -// Update the current mouse state and position
  15.479 -static void
  15.480 -NX_UpdateMouse(_THIS)
  15.481 -{
  15.482 -    int x, y;
  15.483 -    GR_WINDOW_INFO info;
  15.484 -    GR_SCREEN_INFO si;
  15.485 -
  15.486 -
  15.487 -    Dprintf("enter NX_UpdateMouse\n");
  15.488 -
  15.489 -    // Lock the event thread, in multi-threading environments
  15.490 -    SDL_Lock_EventThread();
  15.491 -
  15.492 -    GrGetScreenInfo(&si);
  15.493 -    GrGetWindowInfo(SDL_Window, &info);
  15.494 -    x = si.xpos - info.x;
  15.495 -    y = si.ypos - info.y;
  15.496 -    if (x >= 0 && x <= info.width && y >= 0 && y <= info.height) {
  15.497 -        SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
  15.498 -        SDL_PrivateMouseMotion(0, 0, x, y);
  15.499 -    } else {
  15.500 -        SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
  15.501 -    }
  15.502 -
  15.503 -    SDL_Unlock_EventThread();
  15.504 -    Dprintf("leave NX_UpdateMouse\n");
  15.505 -}
  15.506 -
  15.507 -static int
  15.508 -NX_SetGammaRamp(_THIS, Uint16 * ramp)
  15.509 -{
  15.510 -    int i;
  15.511 -    Uint16 *red, *green, *blue;
  15.512 -
  15.513 -    Dprintf("enter NX_SetGammaRamp\n");
  15.514 -
  15.515 -    if (SDL_Visual.bpp != 32 && SDL_Visual.bpp != 24)
  15.516 -        return -1;
  15.517 -
  15.518 -    if (!GammaRamp_R)
  15.519 -        GammaRamp_R = (Uint16 *) SDL_malloc(sizeof(Uint16) * CI_SIZE);
  15.520 -    if (!GammaRamp_G)
  15.521 -        GammaRamp_G = (Uint16 *) SDL_malloc(sizeof(Uint16) * CI_SIZE);
  15.522 -    if (!GammaRamp_B)
  15.523 -        GammaRamp_B = (Uint16 *) SDL_malloc(sizeof(Uint16) * CI_SIZE);
  15.524 -    if ((!GammaRamp_R) || (!GammaRamp_G) || (!GammaRamp_B)) {
  15.525 -        SDL_OutOfMemory();
  15.526 -        return -1;
  15.527 -    }
  15.528 -
  15.529 -    for (i = 0; i < CI_SIZE; ++i)
  15.530 -        GammaRamp_R[i] = GammaRamp_G[i] = GammaRamp_B[i] = i;
  15.531 -
  15.532 -    red = ramp;
  15.533 -    green = ramp + CI_SIZE;
  15.534 -    blue = green + CI_SIZE;
  15.535 -
  15.536 -    for (i = 0; i < CI_SIZE; ++i) {
  15.537 -        GammaRamp_R[i] = red[i];
  15.538 -        GammaRamp_G[i] = green[i];
  15.539 -        GammaRamp_B[i] = blue[i];
  15.540 -    }
  15.541 -    SDL_UpdateRect(this->screen, 0, 0, 0, 0);
  15.542 -
  15.543 -    Dprintf("leave NX_SetGammaRamp\n");
  15.544 -    return 0;
  15.545 -}
  15.546 -
  15.547 -static int
  15.548 -NX_GetGammaRamp(_THIS, Uint16 * ramp)
  15.549 -{
  15.550 -    int i;
  15.551 -    Uint16 *red, *green, *blue;
  15.552 -
  15.553 -    Dprintf("enter NX_GetGammaRamp\n");
  15.554 -
  15.555 -    if (SDL_Visual.bpp != 32 && SDL_Visual.bpp != 24)
  15.556 -        return -1;
  15.557 -    red = ramp;
  15.558 -    green = ramp + CI_SIZE;
  15.559 -    blue = green + CI_SIZE;
  15.560 -    if (GammaRamp_R && GammaRamp_G && GammaRamp_B) {
  15.561 -        for (i = 0; i < CI_SIZE; ++i) {
  15.562 -            red[i] = GammaRamp_R[i];
  15.563 -            green[i] = GammaRamp_G[i];
  15.564 -            blue[i] = GammaRamp_B[i];
  15.565 -        }
  15.566 -    } else {
  15.567 -        for (i = 0; i < CI_SIZE; ++i)
  15.568 -            red[i] = green[i] = blue[i] = i;
  15.569 -    }
  15.570 -
  15.571 -    Dprintf("leave NX_GetGammaRamp\n");
  15.572 -    return 0;
  15.573 -}
  15.574 -
  15.575 -/* vi: set ts=4 sw=4 expandtab: */
    16.1 --- a/src/video/nanox/SDL_nxvideo.h	Sat Sep 19 07:22:07 2009 +0000
    16.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.3 @@ -1,99 +0,0 @@
    16.4 -/*
    16.5 -    SDL - Simple DirectMedia Layer
    16.6 -    Copyright (C) 1997-2009 Sam Lantinga
    16.7 -    Copyright (C) 2001  Hsieh-Fu Tsai
    16.8 -
    16.9 -    This library is free software; you can redistribute it and/or
   16.10 -    modify it under the terms of the GNU Library General Public
   16.11 -    License as published by the Free Software Foundation; either
   16.12 -    version 2 of the License, or (at your option) any later version.
   16.13 -
   16.14 -    This library is distributed in the hope that it will be useful,
   16.15 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   16.16 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   16.17 -    Library General Public License for more details.
   16.18 -
   16.19 -    You should have received a copy of the GNU Library General Public
   16.20 -    License along with this library; if not, write to the Free
   16.21 -    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   16.22 -
   16.23 -    Sam Lantinga
   16.24 -    slouken@libsdl.org
   16.25 -    
   16.26 -    Hsieh-Fu Tsai
   16.27 -    clare@setabox.com
   16.28 -*/
   16.29 -#include "SDL_config.h"
   16.30 -
   16.31 -#ifndef _SDL_nxvideo_h
   16.32 -#define _SDL_nxvideo_h
   16.33 -
   16.34 -#include <microwin/nano-X.h>
   16.35 -
   16.36 -#include "../SDL_sysvideo.h"
   16.37 -
   16.38 -#ifdef ENABLE_NANOX_DEBUG
   16.39 -#define Dprintf printf
   16.40 -#else
   16.41 -#define Dprintf(ignore...)
   16.42 -#endif
   16.43 -
   16.44 -// Hidden "this" pointer for the video functions
   16.45 -#define _THIS   SDL_VideoDevice * this
   16.46 -
   16.47 -// Private display data
   16.48 -typedef struct NX_SDL_VISUAL
   16.49 -{
   16.50 -    int bpp;
   16.51 -    Uint32 red_mask;
   16.52 -    Uint32 green_mask;
   16.53 -    Uint32 blue_mask;
   16.54 -} nx_sdl_visual_t;
   16.55 -
   16.56 -struct SDL_PrivateVideoData
   16.57 -{
   16.58 -    GR_WINDOW_ID SDL_Window;
   16.59 -    GR_WINDOW_ID FSwindow;
   16.60 -    // Flag: true if we have been passed a window
   16.61 -    char *SDL_windowid;
   16.62 -    GR_GC_ID GC;
   16.63 -    unsigned char *Image;
   16.64 -    unsigned char *Image_buff;  /* for GrArea */
   16.65 -    unsigned char *Clientfb;    /* for DirectFB */
   16.66 -    nx_sdl_visual_t SDL_Visual;
   16.67 -    // The current list of available video modes
   16.68 -    SDL_Rect **modelist;
   16.69 -    int currently_fullscreen;
   16.70 -    // for fullscreen
   16.71 -    int OffsetX, OffsetY;
   16.72 -    // for GammaRamp
   16.73 -    Uint16 *GammaRamp_R, *GammaRamp_G, *GammaRamp_B;
   16.74 -    // for GrArea, r_mask, g_mask, b_mask
   16.75 -    int pixel_type;
   16.76 -#ifdef ENABLE_NANOX_DIRECT_FB
   16.77 -    GR_WINDOW_FB_INFO fbinfo;
   16.78 -#endif
   16.79 -};
   16.80 -
   16.81 -#define SDL_Window           (this -> hidden -> SDL_Window)
   16.82 -#define FSwindow             (this -> hidden -> FSwindow)
   16.83 -#define SDL_windowid         (this -> hidden -> SDL_windowid)
   16.84 -#define SDL_GC               (this -> hidden -> GC)
   16.85 -#define SDL_Image            (this -> hidden -> Image)
   16.86 -#define Image_buff           (this -> hidden -> Image_buff)
   16.87 -#define Clientfb             (this -> hidden -> Clientfb)
   16.88 -#define SDL_Visual           (this -> hidden -> SDL_Visual)
   16.89 -#define SDL_modelist         (this -> hidden -> modelist)
   16.90 -#define currently_fullscreen (this -> hidden -> currently_fullscreen)
   16.91 -#define OffsetX              (this -> hidden -> OffsetX)
   16.92 -#define OffsetY              (this -> hidden -> OffsetY)
   16.93 -#define GammaRamp_R          (this -> hidden -> GammaRamp_R)
   16.94 -#define GammaRamp_G          (this -> hidden -> GammaRamp_G)
   16.95 -#define GammaRamp_B          (this -> hidden -> GammaRamp_B)
   16.96 -#define pixel_type           (this -> hidden -> pixel_type)
   16.97 -#define fbinfo               (this -> hidden -> fbinfo)
   16.98 -
   16.99 -#define CI_SIZE 256             // color index size
  16.100 -
  16.101 -#endif // _SDL_nxvideo_h
  16.102 -/* vi: set ts=4 sw=4 expandtab: */
    17.1 --- a/src/video/nanox/SDL_nxwm.c	Sat Sep 19 07:22:07 2009 +0000
    17.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.3 @@ -1,65 +0,0 @@
    17.4 -/*
    17.5 -    SDL - Simple DirectMedia Layer
    17.6 -    Copyright (C) 1997-2009 Sam Lantinga
    17.7 -    Copyright (C) 2001  Hsieh-Fu Tsai
    17.8 -
    17.9 -    This library is free software; you can redistribute it and/or
   17.10 -    modify it under the terms of the GNU Library General Public
   17.11 -    License as published by the Free Software Foundation; either
   17.12 -    version 2 of the License, or (at your option) any later version.
   17.13 -
   17.14 -    This library is distributed in the hope that it will be useful,
   17.15 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   17.16 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   17.17 -    Library General Public License for more details.
   17.18 -
   17.19 -    You should have received a copy of the GNU Library General Public
   17.20 -    License along with this library; if not, write to the Free
   17.21 -    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   17.22 -
   17.23 -    Sam Lantinga
   17.24 -    slouken@libsdl.org
   17.25 -    
   17.26 -    Hsieh-Fu Tsai
   17.27 -    clare@setabox.com
   17.28 -*/
   17.29 -#include "SDL_config.h"
   17.30 -
   17.31 -#include "SDL_syswm.h"
   17.32 -#include "../../events/SDL_events_c.h"
   17.33 -
   17.34 -#include "SDL_nxwm_c.h"
   17.35 -
   17.36 -void
   17.37 -NX_SetCaption(_THIS, const char *title, const char *icon)
   17.38 -{
   17.39 -    Dprintf("enter NX_SetCaption\n");
   17.40 -
   17.41 -    // Lock the event thread, in multi-threading environments
   17.42 -    SDL_Lock_EventThread();
   17.43 -
   17.44 -    if (SDL_Window)
   17.45 -        GrSetWindowTitle(SDL_Window, title);
   17.46 -
   17.47 -    SDL_Unlock_EventThread();
   17.48 -    Dprintf("leave NX_SetCaption\n");
   17.49 -}
   17.50 -
   17.51 -int
   17.52 -NX_GetWMInfo(_THIS, SDL_SysWMinfo * info)
   17.53 -{
   17.54 -    Dprintf("enter NX_GetWMInfo\n");
   17.55 -
   17.56 -    if (info->version.major <= SDL_MAJOR_VERSION) {
   17.57 -        info->window = SDL_Window;
   17.58 -        return 1;
   17.59 -    } else {
   17.60 -        SDL_SetError("Application not compiled with SDL %d.%d\n",
   17.61 -                     SDL_MAJOR_VERSION, SDL_MINOR_VERSION);
   17.62 -        return -1;
   17.63 -    }
   17.64 -
   17.65 -    Dprintf("leave NX_GetWMInfo\n");
   17.66 -}
   17.67 -
   17.68 -/* vi: set ts=4 sw=4 expandtab: */
    18.1 --- a/src/video/nanox/SDL_nxwm_c.h	Sat Sep 19 07:22:07 2009 +0000
    18.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.3 @@ -1,33 +0,0 @@
    18.4 -/*
    18.5 -    SDL - Simple DirectMedia Layer
    18.6 -    Copyright (C) 1997-2009 Sam Lantinga
    18.7 -    Copyright (C) 2001  Hsieh-Fu Tsai
    18.8 -
    18.9 -    This library is free software; you can redistribute it and/or
   18.10 -    modify it under the terms of the GNU Library General Public
   18.11 -    License as published by the Free Software Foundation; either
   18.12 -    version 2 of the License, or (at your option) any later version.
   18.13 -
   18.14 -    This library is distributed in the hope that it will be useful,
   18.15 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   18.16 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   18.17 -    Library General Public License for more details.
   18.18 -
   18.19 -    You should have received a copy of the GNU Library General Public
   18.20 -    License along with this library; if not, write to the Free
   18.21 -    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   18.22 -
   18.23 -    Sam Lantinga
   18.24 -    slouken@libsdl.org
   18.25 -    
   18.26 -    Hsieh-Fu Tsai
   18.27 -    clare@setabox.com
   18.28 -*/
   18.29 -#include "SDL_config.h"
   18.30 -
   18.31 -#include "SDL_nxvideo.h"
   18.32 -
   18.33 -// Functions to be exported
   18.34 -extern void NX_SetCaption(_THIS, const char *title, const char *icon);
   18.35 -extern int NX_GetWMInfo(_THIS, SDL_SysWMinfo * info);
   18.36 -/* vi: set ts=4 sw=4 expandtab: */