David Hedbor is no longer maintaining the Qtopia code.
authorSam Lantinga <slouken@libsdl.org>
Thu, 10 Aug 2006 14:35:42 +0000
changeset 1977754847f19490
parent 1976 b1620a317791
child 1978 542c78b6fb12
David Hedbor is no longer maintaining the Qtopia code.
README.Qtopia
configure.in
include/SDL_config.h.in
src/main/qtopia/SDL_qtopia_main.cc
src/video/SDL_sysvideo.h
src/video/SDL_video.c
src/video/qtopia/SDL_QPEApp.cc
src/video/qtopia/SDL_QPEApp.h
src/video/qtopia/SDL_QWin.cc
src/video/qtopia/SDL_QWin.h
src/video/qtopia/SDL_lowvideo.h
src/video/qtopia/SDL_sysevents.cc
src/video/qtopia/SDL_sysevents_c.h
src/video/qtopia/SDL_sysmouse.cc
src/video/qtopia/SDL_sysmouse_c.h
src/video/qtopia/SDL_sysvideo.cc
src/video/qtopia/SDL_syswm.cc
src/video/qtopia/SDL_syswm_c.h
     1.1 --- a/README.Qtopia	Mon Aug 07 05:25:13 2006 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,84 +0,0 @@
     1.4 -
     1.5 -==============================================================================
     1.6 -Using the Simple DirectMedia Layer with Qtopia/OPIE
     1.7 -==============================================================================
     1.8 -
     1.9 -==============================================================================
    1.10 -I.  Setting up the Qtopia development environment.
    1.11 -
    1.12 -  This document will not explain how to setup the Qtopia development
    1.13 -  environment. That is outside the scope of the document. You can read
    1.14 -  more on this subject in this excellent howto:
    1.15 -
    1.16 -	http://www.zauruszone.com/howtos/linux_compiler_setup_howto.html
    1.17 -
    1.18 -==============================================================================
    1.19 -II.  Building the Simple DirectMedia Layer libraries using the arm
    1.20 -     cross-compiler
    1.21 -
    1.22 -  This is somewhat tricky since the name of the compiler binaries
    1.23 -  differ from the standard. Also you should disable features not
    1.24 -  needed. The command below works for me. Note that it's all one
    1.25 -  line. You can also set the NM, LD etc environment variables
    1.26 -  separately.
    1.27 -
    1.28 -	NM=arm-linux-nm LD=arm-linux-ld CC=arm-linux-gcc CXX=arm-linux-g++ RANLIB=arm-linux-ranlib AR=arm-linux-ar ./configure --enable-video-qtopia --disable-video-dummy --disable-video-fbcon  --disable-video-dga --disable-arts --disable-esd --disable-alsa --disable-cdrom --disable-video-x11 --disable-nasm --prefix=/opt/Qtopia/sharp/ arm-unknown-linux-gnu
    1.29 -
    1.30 -  One thing to note is that the above configure will include joystick
    1.31 -  support, even though you can't have joysticks on the Zaurus. The
    1.32 -  reason for this is to avoid link / compile / runtime errors with
    1.33 -  applications that have joystick support.
    1.34 -
    1.35 -==============================================================================
    1.36 -III.  Building the Simple DirectMedia Layer test programs:
    1.37 -
    1.38 -  After installing, making sure the correct sdl-config is in your
    1.39 -  path, run configure like this:
    1.40 -
    1.41 -	NM=arm-linux-nm LD=arm-linux-ld CC=arm-linux-gcc CXX=arm-linux-g++ AR=arm-linux-ar ./configure arm-unknown-linux-gnu
    1.42 -
    1.43 -==============================================================================
    1.44 -IV.  Application porting notes
    1.45 -
    1.46 -  One thing I have noticed is that applications sometimes don't exit
    1.47 -  correctly. Their icon remains in the taskbar and they tend to
    1.48 -  relaunch themselves automatically. I believe this problem doesn't
    1.49 -  occur if you exit your application using the exit() method. However,
    1.50 -  if you end main() with 'return 0;' or so, this seems to happen.
    1.51 -
    1.52 -  Also note that when running in landscape mode - i.e requesting a
    1.53 -  window that is HEIGHT pixels wide and WIDTH pixels high, where WIDTH
    1.54 -  and HEIGHT normally is 240 and 320 - the image is blitted so that
    1.55 -  the hardware buttons are on the left side of the display. This might
    1.56 -  not always be desirable but such is the code today.
    1.57 -
    1.58 -
    1.59 -==============================================================================
    1.60 -V.  Enjoy! :)
    1.61 -
    1.62 -  If you have a project you'd like me to know about, or want to ask questions,
    1.63 -  go ahead and join the SDL developer's mailing list by sending e-mail to:
    1.64 -
    1.65 -	sdl-request@libsdl.org
    1.66 -
    1.67 -  and put "subscribe" into the subject of the message. Or alternatively you
    1.68 -  can use the web interface:
    1.69 -
    1.70 -	http://www.libsdl.org/mailman/listinfo/sdl
    1.71 -  
    1.72 -==============================================================================
    1.73 -VI.  What is supported:
    1.74 -
    1.75 -Keyboard (Sharp Zaurus)
    1.76 -Hardware buttons
    1.77 -Stylus input (mouse)
    1.78 -Video. Allows fullscreen both in portrait mode (up to WIDTHxHEIGHT
    1.79 -size window) and in landscape mode (up to HEIGHTxWIDTH). 
    1.80 -
    1.81 -All other SDL functionality works like a normal Linux system (threads,
    1.82 -audio etc).
    1.83 -
    1.84 --- 
    1.85 -David Hedbor <david@hedbor.org>
    1.86 -http://david.hedbor.org/ 	http://eongames.com/
    1.87 -
     2.1 --- a/configure.in	Mon Aug 07 05:25:13 2006 +0000
     2.2 +++ b/configure.in	Thu Aug 10 14:35:42 2006 +0000
     2.3 @@ -1268,40 +1268,6 @@
     2.4      fi
     2.5  }
     2.6  
     2.7 -dnl Set up the QTopia video driver if enabled
     2.8 -CheckQtopia()
     2.9 -{
    2.10 -    AC_ARG_ENABLE(video-qtopia,
    2.11 -AC_HELP_STRING([--enable-video-qtopia], [use Qtopia video driver [[default=no]]]),
    2.12 -                  , enable_video_qtopia=no)
    2.13 -    if test x$enable_video = xyes -a x$enable_video_qtopia = xyes; then
    2.14 -        AC_MSG_CHECKING(for Qtopia support)
    2.15 -        video_qtopia=no
    2.16 -        QTOPIA_FLAGS="-DQT_QWS_EBX -DQT_QWS_CUSTOM -DQWS -I${QPEDIR}/include -I${QTDIR}/include/ -DNO_DEBUG -fno-rtti -fno-exceptions"
    2.17 -        AC_LANG_CPLUSPLUS
    2.18 -        OLD_CXX="$CXXFLAGS"
    2.19 -        CXXFLAGS="$QTOPIA_FLAGS"
    2.20 -        AC_TRY_COMPILE([
    2.21 -         #include <qpe/qpeapplication.h>
    2.22 -        ],[
    2.23 -        ],[
    2.24 -        video_qtopia=yes
    2.25 -        ])
    2.26 -        CXXFLAGS="$OLD_CXX"
    2.27 -        AC_MSG_RESULT($video_qtopia)
    2.28 -        if test x$video_qtopia = xyes; then
    2.29 -            AC_DEFINE(SDL_VIDEO_DRIVER_QTOPIA)
    2.30 -            SOURCES="$SOURCES $srcdir/src/video/qtopia/*.cc"
    2.31 -            SDLMAIN_SOURCES="$srcdir/src/main/qtopia/*.cc"
    2.32 -            EXTRA_CFLAGS="$EXTRA_CFLAGS $QTOPIA_FLAGS"
    2.33 -            SDL_CFLAGS="$SDL_CFLAGS -DQWS -Dmain=SDL_main"
    2.34 -            SDL_LIBS="-lSDLmain $SDL_LIBS -L${QPEDIR}/lib -L${QTDIR}/lib/ -lqpe -lqte"
    2.35 -            have_video=yes
    2.36 -        fi
    2.37 -        AC_LANG_C
    2.38 -    fi
    2.39 -}
    2.40 -
    2.41  dnl Set up the Atari Bios keyboard driver
    2.42  CheckAtariBiosEvent()
    2.43  {
    2.44 @@ -2045,7 +2011,6 @@
    2.45          CheckSVGA
    2.46          CheckVGL
    2.47          CheckWscons
    2.48 -        CheckQtopia
    2.49          CheckOpenGLX11
    2.50          CheckInputEvents
    2.51          CheckTslib
     3.1 --- a/include/SDL_config.h.in	Mon Aug 07 05:25:13 2006 +0000
     3.2 +++ b/include/SDL_config.h.in	Thu Aug 10 14:35:42 2006 +0000
     3.3 @@ -266,7 +266,6 @@
     3.4  #undef SDL_VIDEO_DRIVER_OS2FS
     3.5  #undef SDL_VIDEO_DRIVER_PHOTON
     3.6  #undef SDL_VIDEO_DRIVER_PS2GS
     3.7 -#undef SDL_VIDEO_DRIVER_QTOPIA
     3.8  #undef SDL_VIDEO_DRIVER_RISCOS
     3.9  #undef SDL_VIDEO_DRIVER_SVGALIB
    3.10  #undef SDL_VIDEO_DRIVER_TOOLBOX
     4.1 --- a/src/main/qtopia/SDL_qtopia_main.cc	Mon Aug 07 05:25:13 2006 +0000
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,56 +0,0 @@
     4.4 -
     4.5 -/* Include the SDL main definition header */
     4.6 -#include "SDL_main.h"
     4.7 -#include <stdlib.h>
     4.8 -#include <unistd.h>
     4.9 -#ifdef main
    4.10 -#undef main
    4.11 -#endif
    4.12 -#ifdef QWS
    4.13 -#include <qpe/qpeapplication.h>
    4.14 -#include <qapplication.h>
    4.15 -#include <qpe/qpeapplication.h>
    4.16 -#include <stdlib.h>
    4.17 -
    4.18 -// Workaround for OPIE to remove taskbar icon. Also fixes
    4.19 -// some issues in Qtopia where there are left-over qcop files in /tmp/.
    4.20 -// I'm guessing this will also clean up the taskbar in the Sharp version
    4.21 -// of Qtopia.
    4.22 -static inline void
    4.23 -cleanupQCop()
    4.24 -{
    4.25 -    QString appname(qApp->argv()[0]);
    4.26 -    int slash = appname.findRev("/");
    4.27 -    if (slash != -1) {
    4.28 -        appname = appname.mid(slash + 1);
    4.29 -    }
    4.30 -    QString cmd =
    4.31 -        QPEApplication::qpeDir() +
    4.32 -        "bin/qcop QPE/System 'closing(QString)' '" + appname + "'";
    4.33 -    system(cmd.latin1());
    4.34 -    cmd = "/tmp/qcop-msg-" + appname;
    4.35 -    unlink(cmd.latin1());
    4.36 -}
    4.37 -
    4.38 -static QPEApplication *app;
    4.39 -#endif
    4.40 -
    4.41 -extern int SDL_main(int argc, char *argv[]);
    4.42 -
    4.43 -int
    4.44 -main(int argc, char *argv[])
    4.45 -{
    4.46 -#ifdef QWS
    4.47 -    // This initializes the Qtopia application. It needs to be done here
    4.48 -    // because it parses command line options.
    4.49 -    app = new QPEApplication(argc, argv);
    4.50 -    QWidget dummy;
    4.51 -    app->showMainWidget(&dummy);
    4.52 -    atexit(cleanupQCop);
    4.53 -#endif
    4.54 -    // Exit here because if return is used, the application
    4.55 -    // doesn't seem to quit correctly.
    4.56 -    exit(SDL_main(argc, argv));
    4.57 -}
    4.58 -
    4.59 -/* vi: set ts=4 sw=4 expandtab: */
     5.1 --- a/src/video/SDL_sysvideo.h	Mon Aug 07 05:25:13 2006 +0000
     5.2 +++ b/src/video/SDL_sysvideo.h	Thu Aug 10 14:35:42 2006 +0000
     5.3 @@ -306,9 +306,6 @@
     5.4  #if SDL_VIDEO_DRIVER_IPOD
     5.5  extern VideoBootStrap iPod_bootstrap;
     5.6  #endif
     5.7 -#if SDL_VIDEO_DRIVER_QTOPIA
     5.8 -extern VideoBootStrap Qtopia_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	Mon Aug 07 05:25:13 2006 +0000
     6.2 +++ b/src/video/SDL_video.c	Thu Aug 10 14:35:42 2006 +0000
     6.3 @@ -55,9 +55,6 @@
     6.4  #if SDL_VIDEO_DRIVER_IPOD
     6.5      &iPod_bootstrap,
     6.6  #endif
     6.7 -#if SDL_VIDEO_DRIVER_QTOPIA
     6.8 -    &Qtopia_bootstrap,
     6.9 -#endif
    6.10  #if SDL_VIDEO_DRIVER_WSCONS
    6.11      &WSCONS_bootstrap,
    6.12  #endif
     7.1 --- a/src/video/qtopia/SDL_QPEApp.cc	Mon Aug 07 05:25:13 2006 +0000
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,68 +0,0 @@
     7.4 -/*
     7.5 -    SDL - Simple DirectMedia Layer
     7.6 -    Copyright (C) 1997-2004 Sam Lantinga
     7.7 -
     7.8 -    This library is free software; you can redistribute it and/or
     7.9 -    modify it under the terms of the GNU Library General Public
    7.10 -    License as published by the Free Software Foundation; either
    7.11 -    version 2 of the License, or (at your option) any later version.
    7.12 -
    7.13 -    This library is distributed in the hope that it will be useful,
    7.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
    7.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    7.16 -    Library General Public License for more details.
    7.17 -
    7.18 -    You should have received a copy of the GNU Library General Public
    7.19 -    License along with this library; if not, write to the Free
    7.20 -    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    7.21 -
    7.22 -    Sam Lantinga
    7.23 -    slouken@libsdl.org
    7.24 -*/
    7.25 -#include "SDL_config.h"
    7.26 -
    7.27 -#include <qpe/qpeapplication.h>
    7.28 -#include <qapplication.h>
    7.29 -#include <qevent.h>
    7.30 -
    7.31 -#include "SDL_thread.h"
    7.32 -#include "SDL_timer.h"
    7.33 -#include "SDL_error.h"
    7.34 -
    7.35 -/* Flag to tell whether or not the Be application is active or not */
    7.36 -int SDL_QPEAppActive = 0;
    7.37 -static QPEApplication *app;
    7.38 -
    7.39 -int
    7.40 -SDL_InitQPEApp()
    7.41 -{
    7.42 -    if (SDL_QPEAppActive <= 0) {
    7.43 -        if (!qApp) {
    7.44 -            int argc = 1;
    7.45 -            char *argv[] = { {"SDLApp"} };
    7.46 -            app = new QPEApplication(argc, argv);
    7.47 -            QWidget dummy;
    7.48 -            app->showMainWidget(&dummy);
    7.49 -        } else {
    7.50 -            app = (QPEApplication *) qApp;
    7.51 -        }
    7.52 -        SDL_QPEAppActive++;
    7.53 -    }
    7.54 -    return 0;
    7.55 -}
    7.56 -
    7.57 -/* Quit the QPE Application, if there's nothing left to do */
    7.58 -void
    7.59 -SDL_QuitQPEApp(void)
    7.60 -{
    7.61 -    /* Decrement the application reference count */
    7.62 -    SDL_QPEAppActive--;
    7.63 -    /* If the reference count reached zero, clean up the app */
    7.64 -    if (SDL_QPEAppActive == 0 && app) {
    7.65 -        delete app;
    7.66 -        app = 0;
    7.67 -        qApp = 0;
    7.68 -    }
    7.69 -}
    7.70 -
    7.71 -/* vi: set ts=4 sw=4 expandtab: */
     8.1 --- a/src/video/qtopia/SDL_QPEApp.h	Mon Aug 07 05:25:13 2006 +0000
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,34 +0,0 @@
     8.4 -/*
     8.5 -    SDL - Simple DirectMedia Layer
     8.6 -    Copyright (C) 1997-2006 Sam Lantinga
     8.7 -
     8.8 -    This library is free software; you can redistribute it and/or
     8.9 -    modify it under the terms of the GNU Lesser General Public
    8.10 -    License as published by the Free Software Foundation; either
    8.11 -    version 2.1 of the License, or (at your option) any later version.
    8.12 -
    8.13 -    This library is distributed in the hope that it will be useful,
    8.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
    8.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    8.16 -    Lesser General Public License for more details.
    8.17 -
    8.18 -    You should have received a copy of the GNU Lesser General Public
    8.19 -    License along with this library; if not, write to the Free Software
    8.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    8.21 -
    8.22 -    Sam Lantinga
    8.23 -    slouken@libsdl.org
    8.24 -*/
    8.25 -#include "SDL_config.h"
    8.26 -
    8.27 -/* Handle the QPE application loop */
    8.28 -
    8.29 -/* Initialize the QPE Application, if it's not already started */
    8.30 -extern int SDL_InitQPEApp(void);
    8.31 -
    8.32 -/* Quit the QPE Application, if there's nothing left to do */
    8.33 -extern void SDL_QuitQPEApp(void);
    8.34 -
    8.35 -/* Flag to tell whether the app is active or not */
    8.36 -extern int SDL_QPEAppActive;
    8.37 -/* vi: set ts=4 sw=4 expandtab: */
     9.1 --- a/src/video/qtopia/SDL_QWin.cc	Mon Aug 07 05:25:13 2006 +0000
     9.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.3 @@ -1,693 +0,0 @@
     9.4 -/*
     9.5 -    SDL - Simple DirectMedia Layer
     9.6 -    Copyright (C) 1997-2006 Sam Lantinga
     9.7 -
     9.8 -    This library is free software; you can redistribute it and/or
     9.9 -    modify it under the terms of the GNU Lesser General Public
    9.10 -    License as published by the Free Software Foundation; either
    9.11 -    version 2.1 of the License, or (at your option) any later version.
    9.12 -
    9.13 -    This library is distributed in the hope that it will be useful,
    9.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
    9.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    9.16 -    Lesser General Public License for more details.
    9.17 -
    9.18 -    You should have received a copy of the GNU Lesser General Public
    9.19 -    License along with this library; if not, write to the Free Software
    9.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    9.21 -
    9.22 -    Sam Lantinga
    9.23 -    slouken@libsdl.org
    9.24 -*/
    9.25 -#include "SDL_config.h"
    9.26 -
    9.27 -#include "SDL_QWin.h"
    9.28 -#include <qapplication.h>
    9.29 -#include <qdirectpainter_qws.h>
    9.30 -
    9.31 -screenRotationT screenRotation = SDL_QT_NO_ROTATION;
    9.32 -
    9.33 -SDL_QWin::SDL_QWin(const QSize & size):
    9.34 -QWidget(0, "SDL_main"),
    9.35 -my_painter(0),
    9.36 -my_image(0),
    9.37 -my_inhibit_resize(false),
    9.38 -my_mouse_pos(-1, -1),
    9.39 -my_flags(0),
    9.40 -my_has_fullscreen(false),
    9.41 -my_locked(0)
    9.42 -{
    9.43 -    setBackgroundMode(NoBackground);
    9.44 -}
    9.45 -
    9.46 -SDL_QWin::~SDL_QWin()
    9.47 -{
    9.48 -    // Nothing to do yet.
    9.49 -    if (my_image) {
    9.50 -        delete my_image;
    9.51 -    }
    9.52 -}
    9.53 -
    9.54 -void
    9.55 -SDL_QWin::setImage(QImage * image)
    9.56 -{
    9.57 -    if (my_image) {
    9.58 -        delete my_image;
    9.59 -    }
    9.60 -    my_image = image;
    9.61 -    //  setFixedSize(image->size());
    9.62 -}
    9.63 -
    9.64 -void
    9.65 -SDL_QWin::resizeEvent(QResizeEvent * e)
    9.66 -{
    9.67 -    if (size() != qApp->desktop()->size()) {
    9.68 -        // Widget is not the correct size, so do the fullscreen magic
    9.69 -        my_has_fullscreen = false;
    9.70 -        enableFullscreen();
    9.71 -    }
    9.72 -    if (my_inhibit_resize) {
    9.73 -        my_inhibit_resize = false;
    9.74 -    } else {
    9.75 -        SDL_PrivateResize(e->size().width(), e->size().height());
    9.76 -    }
    9.77 -}
    9.78 -
    9.79 -void
    9.80 -SDL_QWin::focusInEvent(QFocusEvent *)
    9.81 -{
    9.82 -    // Always do it here, no matter the size.
    9.83 -    enableFullscreen();
    9.84 -    SDL_PrivateAppActive(true, SDL_APPINPUTFOCUS);
    9.85 -}
    9.86 -
    9.87 -void
    9.88 -SDL_QWin::focusOutEvent(QFocusEvent *)
    9.89 -{
    9.90 -    my_has_fullscreen = false;
    9.91 -    SDL_PrivateAppActive(false, SDL_APPINPUTFOCUS);
    9.92 -}
    9.93 -
    9.94 -void
    9.95 -SDL_QWin::closeEvent(QCloseEvent * e)
    9.96 -{
    9.97 -    SDL_PrivateQuit();
    9.98 -    e->ignore();
    9.99 -}
   9.100 -
   9.101 -void
   9.102 -SDL_QWin::setMousePos(const QPoint & pos)
   9.103 -{
   9.104 -    if (my_image->width() == height()) {
   9.105 -        if (screenRotation == SDL_QT_ROTATION_90)
   9.106 -            my_mouse_pos = QPoint(height() - pos.y(), pos.x());
   9.107 -        else if (screenRotation == SDL_QT_ROTATION_270)
   9.108 -            my_mouse_pos = QPoint(pos.y(), width() - pos.x());
   9.109 -    } else {
   9.110 -        my_mouse_pos = pos;
   9.111 -    }
   9.112 -}
   9.113 -
   9.114 -void
   9.115 -SDL_QWin::mouseMoveEvent(QMouseEvent * e)
   9.116 -{
   9.117 -    Qt::ButtonState button = e->button();
   9.118 -    int sdlstate = 0;
   9.119 -    if ((button & Qt::LeftButton)) {
   9.120 -        sdlstate |= SDL_BUTTON_LMASK;
   9.121 -    }
   9.122 -    if ((button & Qt::RightButton)) {
   9.123 -        sdlstate |= SDL_BUTTON_RMASK;
   9.124 -    }
   9.125 -    if ((button & Qt::MidButton)) {
   9.126 -        sdlstate |= SDL_BUTTON_MMASK;
   9.127 -    }
   9.128 -    setMousePos(e->pos());
   9.129 -    SDL_PrivateMouseMotion(sdlstate, 0, my_mouse_pos.x(), my_mouse_pos.y());
   9.130 -}
   9.131 -
   9.132 -void
   9.133 -SDL_QWin::mousePressEvent(QMouseEvent * e)
   9.134 -{
   9.135 -    mouseMoveEvent(e);
   9.136 -    Qt::ButtonState button = e->button();
   9.137 -    SDL_PrivateMouseButton(SDL_PRESSED,
   9.138 -                           (button & Qt::LeftButton) ? 1 :
   9.139 -                           ((button & Qt::RightButton) ? 2 : 3),
   9.140 -                           my_mouse_pos.x(), my_mouse_pos.y());
   9.141 -}
   9.142 -
   9.143 -void
   9.144 -SDL_QWin::mouseReleaseEvent(QMouseEvent * e)
   9.145 -{
   9.146 -    setMousePos(e->pos());
   9.147 -    Qt::ButtonState button = e->button();
   9.148 -    SDL_PrivateMouseButton(SDL_RELEASED,
   9.149 -                           (button & Qt::LeftButton) ? 1 :
   9.150 -                           ((button & Qt::RightButton) ? 2 : 3),
   9.151 -                           my_mouse_pos.x(), my_mouse_pos.y());
   9.152 -    my_mouse_pos = QPoint(-1, -1);
   9.153 -}
   9.154 -
   9.155 -static inline void
   9.156 -gs_fastRotateBlit_3(unsigned short *fb,
   9.157 -                    unsigned short *bits, const QRect & rect)
   9.158 -{
   9.159 -    // FIXME: this only works correctly for 240x320 displays
   9.160 -    int startx, starty;
   9.161 -    int width, height;
   9.162 -
   9.163 -    startx = rect.left() >> 1;
   9.164 -    starty = rect.top() >> 1;
   9.165 -    width = ((rect.right() - rect.left()) >> 1) + 2;
   9.166 -    height = ((rect.bottom() - rect.top()) >> 1) + 2;
   9.167 -
   9.168 -    if ((startx + width) > 120) {
   9.169 -        width = 120 - startx;   // avoid horizontal overflow
   9.170 -    }
   9.171 -    if ((starty + height) > 160) {
   9.172 -        height = 160 - starty;  // avoid vertical overflow
   9.173 -    }
   9.174 -
   9.175 -    ulong *sp1, *sp2, *dp1, *dp2;
   9.176 -    ulong stop, sbot, dtop, dbot;
   9.177 -
   9.178 -    sp1 = (ulong *) bits + startx + starty * 240;
   9.179 -    sp2 = sp1 + 120;
   9.180 -    dp1 = (ulong *) fb + (159 - starty) + startx * 320;
   9.181 -    dp2 = dp1 + 160;
   9.182 -    int rowadd = (-320 * width) - 1;
   9.183 -    int rowadd2 = 240 - width;
   9.184 -    // transfer in cells of 2x2 pixels in words
   9.185 -    for (int y = 0; y < height; y++) {
   9.186 -        for (int x = 0; x < width; x++) {
   9.187 -            // read source pixels
   9.188 -            stop = *sp1;
   9.189 -            sbot = *sp2;
   9.190 -            // rotate pixels
   9.191 -            dtop = (sbot & 0xffff) + ((stop & 0xffff) << 16);
   9.192 -            dbot = ((sbot & 0xffff0000) >> 16) + (stop & 0xffff0000);
   9.193 -            // write to framebuffer
   9.194 -            *dp1 = dtop;
   9.195 -            *dp2 = dbot;
   9.196 -            // update source ptrs
   9.197 -            sp1++;
   9.198 -            sp2++;
   9.199 -            // update dest ptrs - 2 pix at a time
   9.200 -            dp1 += 320;
   9.201 -            dp2 += 320;
   9.202 -        }
   9.203 -        // adjust src ptrs - skip a row as we work in pairs
   9.204 -        sp1 += rowadd2;
   9.205 -        sp2 += rowadd2;
   9.206 -        // adjust dest ptrs for rotation
   9.207 -        dp1 += rowadd;
   9.208 -        dp2 += rowadd;
   9.209 -    }
   9.210 -}
   9.211 -
   9.212 -static inline void
   9.213 -gs_fastRotateBlit_1(unsigned short *fb,
   9.214 -                    unsigned short *bits, const QRect & rect)
   9.215 -{
   9.216 -    // FIXME: this only works correctly for 240x320 displays
   9.217 -    int startx, starty;
   9.218 -    int width, height;
   9.219 -
   9.220 -    startx = rect.left() >> 1;
   9.221 -    starty = rect.top() >> 1;
   9.222 -    width = ((rect.right() - rect.left()) >> 1) + 2;
   9.223 -    height = ((rect.bottom() - rect.top()) >> 1) + 2;
   9.224 -
   9.225 -    if ((startx + width) > 120) {
   9.226 -        width = 120 - startx;   // avoid horizontal overflow
   9.227 -    }
   9.228 -    if ((starty + height) > 160) {
   9.229 -        height = 160 - starty;  // avoid vertical overflow
   9.230 -    }
   9.231 -
   9.232 -    ulong *sp1, *sp2, *dp1, *dp2;
   9.233 -    ulong stop, sbot, dtop, dbot;
   9.234 -    fb += 320 * 239;            // Move "fb" to top left corner
   9.235 -    sp1 = (ulong *) bits + startx + starty * 240;
   9.236 -    sp2 = sp1 + 120;
   9.237 -    dp1 = (ulong *) fb - startx * 320 - starty;
   9.238 -    dp2 = dp1 - 160;
   9.239 -    int rowadd = (320 * width) + 1;
   9.240 -    int rowadd2 = 240 - width;
   9.241 -    // transfer in cells of 2x2 pixels in words
   9.242 -    for (int y = 0; y < height; y++) {
   9.243 -        for (int x = 0; x < width; x++) {
   9.244 -            // read
   9.245 -            stop = *sp1;
   9.246 -            sbot = *sp2;
   9.247 -            // rotate
   9.248 -            dtop = (stop & 0xffff) + ((sbot & 0xffff) << 16);
   9.249 -            dbot = ((stop & 0xffff0000) >> 16) + (sbot & 0xffff0000);
   9.250 -            // write
   9.251 -            *dp1 = dtop;
   9.252 -            *dp2 = dbot;
   9.253 -            // update source ptrs
   9.254 -            sp1++;
   9.255 -            sp2++;
   9.256 -            // update dest ptrs - 2 pix at a time
   9.257 -            dp1 -= 320;
   9.258 -            dp2 -= 320;
   9.259 -        }
   9.260 -        // adjust src ptrs - skip a row as we work in pairs
   9.261 -        sp1 += rowadd2;
   9.262 -        sp2 += rowadd2;
   9.263 -        // adjust dest ptrs for rotation
   9.264 -        dp1 += rowadd;
   9.265 -        dp2 += rowadd;
   9.266 -    }
   9.267 -}
   9.268 -
   9.269 -// desktop, SL-A300 etc
   9.270 -/* *INDENT-OFF* */
   9.271 -bool SDL_QWin::repaintRotation0 (const QRect & rect)
   9.272 -{
   9.273 -    if (my_image->width () == width ()) {
   9.274 -        uchar * fb = (uchar *) my_painter->frameBuffer ();
   9.275 -        uchar * buf = (uchar *) my_image->bits ();
   9.276 -        if (rect == my_image->rect ()) {
   9.277 -            SDL_memcpy (fb, buf, width () * height () * 2);
   9.278 -        } else {
   9.279 -            int h = rect.height ();
   9.280 -            int wd = rect.width () << 1;
   9.281 -            int fblineadd = my_painter->lineStep ();
   9.282 -            int buflineadd = my_image->bytesPerLine ();
   9.283 -            fb += (rect.left () << 1) + rect.top () * my_painter->lineStep ();
   9.284 -            buf += (rect.left () << 1) + rect.top () * my_image->bytesPerLine ();
   9.285 -            while (h--) {
   9.286 -                SDL_memcpy (fb, buf, wd);
   9.287 -                fb += fblineadd;
   9.288 -                buf += buflineadd;
   9.289 -            }
   9.290 -        }
   9.291 -    } else {
   9.292 -        return false;           // FIXME: Landscape
   9.293 -    }
   9.294 -#ifdef __i386__
   9.295 -    my_painter->fillRect (rect, QBrush (Qt::NoBrush));
   9.296 -#endif
   9.297 -    return true;
   9.298 -}
   9.299 -/* *INDENT-ON* */
   9.300 -
   9.301 -
   9.302 -// Sharp Zaurus SL-5500 etc 
   9.303 -/* *INDENT-OFF* */
   9.304 -bool SDL_QWin::repaintRotation3 (const QRect & rect)
   9.305 -{
   9.306 -    if (my_image->width () == width ()) {
   9.307 -        ushort * fb = (ushort *) my_painter->frameBuffer ();
   9.308 -        ushort * buf = (ushort *) my_image->bits ();
   9.309 -        gs_fastRotateBlit_3 (fb, buf, rect);
   9.310 -    } else {
   9.311 -        // landscape mode
   9.312 -        if (screenRotation == SDL_QT_ROTATION_90) {
   9.313 -            uchar * fb = (uchar *) my_painter->frameBuffer ();
   9.314 -            uchar * buf = (uchar *) my_image->bits ();
   9.315 -            if (rect == my_image->rect ()) {
   9.316 -                SDL_memcpy (fb, buf, width () * height () * 2);
   9.317 -            } else {
   9.318 -                int h = rect.height ();
   9.319 -                int wd = rect.width () << 1;
   9.320 -                int fblineadd = my_painter->lineStep ();
   9.321 -                int buflineadd = my_image->bytesPerLine ();
   9.322 -                fb +=
   9.323 -                    (rect.left () << 1) +
   9.324 -                    rect.top () * my_painter->lineStep ();
   9.325 -                buf +=
   9.326 -                    (rect.left () << 1) +
   9.327 -                    rect.top () * my_image->bytesPerLine ();
   9.328 -                while (h--) {
   9.329 -                    SDL_memcpy (fb, buf, wd);
   9.330 -                    fb += fblineadd;
   9.331 -                    buf += buflineadd;
   9.332 -                }
   9.333 -            }
   9.334 -        } else if (screenRotation == SDL_QT_ROTATION_270) {
   9.335 -            int h = rect.height ();
   9.336 -            int wd = rect.width ();
   9.337 -            int fblineadd = my_painter->lineStep () - (rect.width () << 1);
   9.338 -            int buflineadd = my_image->bytesPerLine () - (rect.width () << 1);
   9.339 -            int w;
   9.340 -
   9.341 -            uchar * fb = (uchar *) my_painter->frameBuffer ();
   9.342 -            uchar * buf = (uchar *) my_image->bits ();
   9.343 -
   9.344 -            fb +=
   9.345 -                ((my_painter->width () -
   9.346 -                  (rect.top () +
   9.347 -                   rect.height ())) * my_painter->lineStep ()) +
   9.348 -                ((my_painter->height () -
   9.349 -                  ((rect.left () + rect.width ()))) << 1);
   9.350 -
   9.351 -            buf +=
   9.352 -                my_image->bytesPerLine () * (rect.top () +
   9.353 -                                             rect.height ()) -
   9.354 -                (((my_image->width () -
   9.355 -                   (rect.left () + rect.width ())) << 1) + 2);
   9.356 -
   9.357 -            while (h--) {
   9.358 -                w = wd;
   9.359 -                while (w--)
   9.360 -                    *((unsigned short *) fb)++ = *((unsigned short *) buf)--;
   9.361 -                fb += fblineadd;
   9.362 -                buf -= buflineadd;
   9.363 -            }
   9.364 -        }
   9.365 -    }
   9.366 -    return true;
   9.367 -}
   9.368 -/* *INDENT-ON* */
   9.369 -
   9.370 -// ipaq 3800...
   9.371 -/* *INDENT-OFF* */
   9.372 -bool SDL_QWin::repaintRotation1 (const QRect & rect)
   9.373 -{
   9.374 -    if (my_image->width () == width ()) {
   9.375 -        ushort *fb = (ushort *) my_painter->frameBuffer ();
   9.376 -        ushort *buf = (ushort *) my_image->bits ();
   9.377 -        gs_fastRotateBlit_1 (fb, buf, rect);
   9.378 -    } else {
   9.379 -        return false;           // FIXME: landscape mode
   9.380 -    }
   9.381 -    return true;
   9.382 -}
   9.383 -/* *INDENT-ON* */
   9.384 -
   9.385 -void
   9.386 -SDL_QWin::repaintRect(const QRect & rect)
   9.387 -{
   9.388 -    if (!my_painter || !rect.width() || !rect.height()) {
   9.389 -        return;
   9.390 -    }
   9.391 -
   9.392 -    if (QPixmap::defaultDepth() == 16) {
   9.393 -        switch (my_painter->transformOrientation()) {
   9.394 -        case 3:
   9.395 -            if (repaintRotation3(rect)) {
   9.396 -                return;
   9.397 -            }
   9.398 -            break;
   9.399 -        case 1:
   9.400 -            if (repaintRotation1(rect)) {
   9.401 -                return;
   9.402 -            }
   9.403 -            break;
   9.404 -        case 0:
   9.405 -            if (repaintRotation0(rect)) {
   9.406 -                return;
   9.407 -            }
   9.408 -            break;
   9.409 -        }
   9.410 -    }
   9.411 -    my_painter->drawImage(rect.topLeft(), *my_image, rect);
   9.412 -}
   9.413 -
   9.414 -// This paints the current buffer to the screen, when desired. 
   9.415 -void
   9.416 -SDL_QWin::paintEvent(QPaintEvent * ev)
   9.417 -{
   9.418 -    if (my_image) {
   9.419 -        lockScreen(true);
   9.420 -        repaintRect(ev->rect());
   9.421 -        unlockScreen();
   9.422 -    }
   9.423 -}
   9.424 -
   9.425 -/* Function to translate a keyboard transition and queue the key event
   9.426 - * This should probably be a table although this method isn't exactly
   9.427 - * slow.
   9.428 - */
   9.429 -void
   9.430 -SDL_QWin::QueueKey(QKeyEvent * e, int pressed)
   9.431 -{
   9.432 -    SDL_keysym keysym;
   9.433 -    int scancode = e->key();
   9.434 -    /* Set the keysym information */
   9.435 -    if (scancode >= 'A' && scancode <= 'Z') {
   9.436 -        // Qt sends uppercase, SDL wants lowercase
   9.437 -        keysym.sym = static_cast < SDLKey > (scancode + 32);
   9.438 -    } else if (scancode >= 0x1000) {
   9.439 -        // Special keys
   9.440 -        switch (scancode) {
   9.441 -        case Qt::Key_Escape:
   9.442 -            scancode = SDLK_ESCAPE;
   9.443 -            break;
   9.444 -        case Qt::Key_Tab:
   9.445 -            scancode = SDLK_TAB;
   9.446 -            break;
   9.447 -        case Qt::Key_Backspace:
   9.448 -            scancode = SDLK_BACKSPACE;
   9.449 -            break;
   9.450 -        case Qt::Key_Return:
   9.451 -            scancode = SDLK_RETURN;
   9.452 -            break;
   9.453 -        case Qt::Key_Enter:
   9.454 -            scancode = SDLK_KP_ENTER;
   9.455 -            break;
   9.456 -        case Qt::Key_Insert:
   9.457 -            scancode = SDLK_INSERT;
   9.458 -            break;
   9.459 -        case Qt::Key_Delete:
   9.460 -            scancode = SDLK_DELETE;
   9.461 -            break;
   9.462 -        case Qt::Key_Pause:
   9.463 -            scancode = SDLK_PAUSE;
   9.464 -            break;
   9.465 -        case Qt::Key_Print:
   9.466 -            scancode = SDLK_PRINT;
   9.467 -            break;
   9.468 -        case Qt::Key_SysReq:
   9.469 -            scancode = SDLK_SYSREQ;
   9.470 -            break;
   9.471 -        case Qt::Key_Home:
   9.472 -            scancode = SDLK_HOME;
   9.473 -            break;
   9.474 -        case Qt::Key_End:
   9.475 -            scancode = SDLK_END;
   9.476 -            break;
   9.477 -            // We want the control keys to rotate with the screen
   9.478 -        case Qt::Key_Left:
   9.479 -            if (screenRotation == SDL_QT_ROTATION_90)
   9.480 -                scancode = SDLK_UP;
   9.481 -            else if (screenRotation == SDL_QT_ROTATION_270)
   9.482 -                scancode = SDLK_DOWN;
   9.483 -            else
   9.484 -                scancode = SDLK_LEFT;
   9.485 -            break;
   9.486 -        case Qt::Key_Up:
   9.487 -            if (screenRotation == SDL_QT_ROTATION_90)
   9.488 -                scancode = SDLK_RIGHT;
   9.489 -            else if (screenRotation == SDL_QT_ROTATION_270)
   9.490 -                scancode = SDLK_LEFT;
   9.491 -            else
   9.492 -                scancode = SDLK_UP;
   9.493 -            break;
   9.494 -        case Qt::Key_Right:
   9.495 -            if (screenRotation == SDL_QT_ROTATION_90)
   9.496 -                scancode = SDLK_DOWN;
   9.497 -            else if (screenRotation == SDL_QT_ROTATION_270)
   9.498 -                scancode = SDLK_UP;
   9.499 -            else
   9.500 -                scancode = SDLK_RIGHT;
   9.501 -            break;
   9.502 -        case Qt::Key_Down:
   9.503 -            if (screenRotation == SDL_QT_ROTATION_90)
   9.504 -                scancode = SDLK_LEFT;
   9.505 -            else if (screenRotation == SDL_QT_ROTATION_270)
   9.506 -                scancode = SDLK_RIGHT;
   9.507 -            else
   9.508 -                scancode = SDLK_DOWN;
   9.509 -            break;
   9.510 -        case Qt::Key_Prior:
   9.511 -            scancode = SDLK_PAGEUP;
   9.512 -            break;
   9.513 -        case Qt::Key_Next:
   9.514 -            scancode = SDLK_PAGEDOWN;
   9.515 -            break;
   9.516 -        case Qt::Key_Shift:
   9.517 -            scancode = SDLK_LSHIFT;
   9.518 -            break;
   9.519 -        case Qt::Key_Control:
   9.520 -            scancode = SDLK_LCTRL;
   9.521 -            break;
   9.522 -        case Qt::Key_Meta:
   9.523 -            scancode = SDLK_LMETA;
   9.524 -            break;
   9.525 -        case Qt::Key_Alt:
   9.526 -            scancode = SDLK_LALT;
   9.527 -            break;
   9.528 -        case Qt::Key_CapsLock:
   9.529 -            scancode = SDLK_CAPSLOCK;
   9.530 -            break;
   9.531 -        case Qt::Key_NumLock:
   9.532 -            scancode = SDLK_NUMLOCK;
   9.533 -            break;
   9.534 -        case Qt::Key_ScrollLock:
   9.535 -            scancode = SDLK_SCROLLOCK;
   9.536 -            break;
   9.537 -        case Qt::Key_F1:
   9.538 -            scancode = SDLK_F1;
   9.539 -            break;
   9.540 -        case Qt::Key_F2:
   9.541 -            scancode = SDLK_F2;
   9.542 -            break;
   9.543 -        case Qt::Key_F3:
   9.544 -            scancode = SDLK_F3;
   9.545 -            break;
   9.546 -        case Qt::Key_F4:
   9.547 -            scancode = SDLK_F4;
   9.548 -            break;
   9.549 -        case Qt::Key_F5:
   9.550 -            scancode = SDLK_F5;
   9.551 -            break;
   9.552 -        case Qt::Key_F6:
   9.553 -            scancode = SDLK_F6;
   9.554 -            break;
   9.555 -        case Qt::Key_F7:
   9.556 -            scancode = SDLK_F7;
   9.557 -            break;
   9.558 -        case Qt::Key_F8:
   9.559 -            scancode = SDLK_F8;
   9.560 -            break;
   9.561 -        case Qt::Key_F9:
   9.562 -            scancode = SDLK_F9;
   9.563 -            break;
   9.564 -        case Qt::Key_F10:
   9.565 -            scancode = SDLK_F10;
   9.566 -            break;
   9.567 -        case Qt::Key_F11:
   9.568 -            scancode = SDLK_F11;
   9.569 -            break;
   9.570 -        case Qt::Key_F12:
   9.571 -            scancode = SDLK_F12;
   9.572 -            break;
   9.573 -        case Qt::Key_F13:
   9.574 -            scancode = SDLK_F13;
   9.575 -            break;
   9.576 -        case Qt::Key_F14:
   9.577 -            scancode = SDLK_F14;
   9.578 -            break;
   9.579 -        case Qt::Key_F15:
   9.580 -            scancode = SDLK_F15;
   9.581 -            break;
   9.582 -        case Qt::Key_Super_L:
   9.583 -            scancode = SDLK_LSUPER;
   9.584 -            break;
   9.585 -        case Qt::Key_Super_R:
   9.586 -            scancode = SDLK_RSUPER;
   9.587 -            break;
   9.588 -        case Qt::Key_Menu:
   9.589 -            scancode = SDLK_MENU;
   9.590 -            break;
   9.591 -        case Qt::Key_Help:
   9.592 -            scancode = SDLK_HELP;
   9.593 -            break;
   9.594 -
   9.595 -        case Qt::Key_F33:
   9.596 -            // FIXME: This is a hack to enable the OK key on
   9.597 -            // Zaurii devices. SDLK_RETURN is a suitable key to use
   9.598 -            // since it often is used as such.
   9.599 -            //     david@hedbor.org
   9.600 -            scancode = SDLK_RETURN;
   9.601 -            break;
   9.602 -        default:
   9.603 -            scancode = SDLK_UNKNOWN;
   9.604 -            break;
   9.605 -        }
   9.606 -        keysym.sym = static_cast < SDLKey > (scancode);
   9.607 -    } else {
   9.608 -        keysym.sym = static_cast < SDLKey > (scancode);
   9.609 -    }
   9.610 -    keysym.scancode = scancode;
   9.611 -    keysym.mod = KMOD_NONE;
   9.612 -    ButtonState st = e->state();
   9.613 -    if ((st & ShiftButton)) {
   9.614 -        keysym.mod = static_cast < SDLMod > (keysym.mod | KMOD_LSHIFT);
   9.615 -    }
   9.616 -    if ((st & ControlButton)) {
   9.617 -        keysym.mod = static_cast < SDLMod > (keysym.mod | KMOD_LCTRL);
   9.618 -    }
   9.619 -    if ((st & AltButton)) {
   9.620 -        keysym.mod = static_cast < SDLMod > (keysym.mod | KMOD_LALT);
   9.621 -    }
   9.622 -    if (SDL_TranslateUNICODE) {
   9.623 -        QChar qchar = e->text()[0];
   9.624 -        keysym.unicode = qchar.unicode();
   9.625 -    } else {
   9.626 -        keysym.unicode = 0;
   9.627 -    }
   9.628 -
   9.629 -    /* NUMLOCK and CAPSLOCK are implemented as double-presses in reality */
   9.630 -    //    if ( (keysym.sym == SDLK_NUMLOCK) || (keysym.sym == SDLK_CAPSLOCK) ) {
   9.631 -    //            pressed = 1;
   9.632 -    //    }
   9.633 -
   9.634 -    /* Queue the key event */
   9.635 -    if (pressed) {
   9.636 -        SDL_PrivateKeyboard(SDL_PRESSED, &keysym);
   9.637 -    } else {
   9.638 -        SDL_PrivateKeyboard(SDL_RELEASED, &keysym);
   9.639 -    }
   9.640 -}
   9.641 -
   9.642 -void
   9.643 -SDL_QWin::setFullscreen(bool fs_on)
   9.644 -{
   9.645 -    my_has_fullscreen = false;
   9.646 -    enableFullscreen();
   9.647 -}
   9.648 -
   9.649 -void
   9.650 -SDL_QWin::enableFullscreen()
   9.651 -{
   9.652 -    // Make sure size is correct
   9.653 -    if (!my_has_fullscreen) {
   9.654 -        setFixedSize(qApp->desktop()->size());
   9.655 -        // This call is needed because showFullScreen won't work
   9.656 -        // correctly if the widget already considers itself to be fullscreen.
   9.657 -        showNormal();
   9.658 -        // This is needed because showNormal() forcefully changes the window
   9.659 -        // style to WSTyle_TopLevel.
   9.660 -        setWFlags(WStyle_Customize | WStyle_NoBorder);
   9.661 -        // Enable fullscreen.
   9.662 -        showFullScreen();
   9.663 -        my_has_fullscreen = true;
   9.664 -    }
   9.665 -}
   9.666 -
   9.667 -/* *INDENT-OFF* */
   9.668 -bool
   9.669 -SDL_QWin::lockScreen (bool force)
   9.670 -{
   9.671 -    if (!my_painter) {
   9.672 -        if (force || (isVisible () && isActiveWindow ())) {
   9.673 -            my_painter = new QDirectPainter (this);
   9.674 -        } else {
   9.675 -            return false;
   9.676 -        }
   9.677 -    }
   9.678 -    my_locked++;                // Increate lock refcount
   9.679 -    return true;
   9.680 -}
   9.681 -/* *INDENT-ON* */
   9.682 -
   9.683 -void
   9.684 -SDL_QWin::unlockScreen()
   9.685 -{
   9.686 -    if (my_locked > 0) {
   9.687 -        my_locked--;            // decrease lock refcount;
   9.688 -    }
   9.689 -    if (!my_locked && my_painter) {
   9.690 -        my_painter->end();
   9.691 -        delete my_painter;
   9.692 -        my_painter = 0;
   9.693 -    }
   9.694 -}
   9.695 -
   9.696 -/* vi: set ts=4 sw=4 expandtab: */
    10.1 --- a/src/video/qtopia/SDL_QWin.h	Mon Aug 07 05:25:13 2006 +0000
    10.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.3 @@ -1,130 +0,0 @@
    10.4 -/*
    10.5 -    SDL - Simple DirectMedia Layer
    10.6 -    Copyright (C) 1997-2006 Sam Lantinga
    10.7 -
    10.8 -    This library is free software; you can redistribute it and/or
    10.9 -    modify it under the terms of the GNU Lesser General Public
   10.10 -    License as published by the Free Software Foundation; either
   10.11 -    version 2.1 of the License, or (at your option) any later version.
   10.12 -
   10.13 -    This library is distributed in the hope that it will be useful,
   10.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   10.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   10.16 -    Lesser General Public License for more details.
   10.17 -
   10.18 -    You should have received a copy of the GNU Lesser General Public
   10.19 -    License along with this library; if not, write to the Free Software
   10.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   10.21 -
   10.22 -    Sam Lantinga
   10.23 -    slouken@libsdl.org
   10.24 -*/
   10.25 -#include "SDL_config.h"
   10.26 -
   10.27 -#ifndef _SDL_QWin_h
   10.28 -#define _SDL_QWin_h
   10.29 -
   10.30 -#include <stdio.h>
   10.31 -
   10.32 -#include <qimage.h>
   10.33 -#include <qpixmap.h>
   10.34 -#include <qwidget.h>
   10.35 -#include <qpainter.h>
   10.36 -#include <qdirectpainter_qws.h>
   10.37 -
   10.38 -#include "SDL_events.h"
   10.39 -
   10.40 -extern "C"
   10.41 -{
   10.42 -#include "../../events/SDL_events_c.h"
   10.43 -};
   10.44 -
   10.45 -typedef enum
   10.46 -{
   10.47 -    SDL_QT_NO_ROTATION = 0,
   10.48 -    SDL_QT_ROTATION_90,
   10.49 -    SDL_QT_ROTATION_270
   10.50 -} screenRotationT;
   10.51 -
   10.52 -extern screenRotationT screenRotation;
   10.53 -
   10.54 -class SDL_QWin:public QWidget
   10.55 -{
   10.56 -    void QueueKey(QKeyEvent * e, int pressed);
   10.57 -  public:
   10.58 -      SDL_QWin(const QSize & size);
   10.59 -      virtual ~ SDL_QWin();
   10.60 -    virtual bool shown(void)
   10.61 -    {
   10.62 -        return isVisible();
   10.63 -    }
   10.64 -    /* If called, the next resize event will not be forwarded to SDL. */
   10.65 -    virtual void inhibitResize(void)
   10.66 -    {
   10.67 -        my_inhibit_resize = true;
   10.68 -    }
   10.69 -    void setImage(QImage * image);
   10.70 -    void setOffset(int x, int y)
   10.71 -    {
   10.72 -        my_offset = QPoint(x, y);
   10.73 -    }
   10.74 -    void GetXYOffset(int &x, int &y)
   10.75 -    {
   10.76 -        x = my_offset.x();
   10.77 -        y = my_offset.y();
   10.78 -    }
   10.79 -    QImage *image(void)
   10.80 -    {
   10.81 -        return my_image;
   10.82 -    }
   10.83 -
   10.84 -    void setWFlags(WFlags flags)
   10.85 -    {
   10.86 -        QWidget::setWFlags(flags);
   10.87 -        my_flags = flags;
   10.88 -    }
   10.89 -    const QPoint & mousePos() const
   10.90 -    {
   10.91 -        return my_mouse_pos;
   10.92 -    }
   10.93 -    void setMousePos(const QPoint & newpos);
   10.94 -    void setFullscreen(bool);
   10.95 -
   10.96 -    bool lockScreen(bool force = false);
   10.97 -    void unlockScreen();
   10.98 -    void repaintRect(const QRect & rect);
   10.99 -  protected:
  10.100 -    /* Handle resizing of the window */
  10.101 -    virtual void resizeEvent(QResizeEvent * e);
  10.102 -    void focusInEvent(QFocusEvent *);
  10.103 -    void focusOutEvent(QFocusEvent *);
  10.104 -    void closeEvent(QCloseEvent * e);
  10.105 -    void mouseMoveEvent(QMouseEvent * e);
  10.106 -    void mousePressEvent(QMouseEvent * e);
  10.107 -    void mouseReleaseEvent(QMouseEvent * e);
  10.108 -    void paintEvent(QPaintEvent * ev);
  10.109 -    void keyPressEvent(QKeyEvent * e)
  10.110 -    {
  10.111 -        QueueKey(e, 1);
  10.112 -    }
  10.113 -    void keyReleaseEvent(QKeyEvent * e)
  10.114 -    {
  10.115 -        QueueKey(e, 0);
  10.116 -    }
  10.117 -  private:
  10.118 -    bool repaintRotation0(const QRect & rect);
  10.119 -    bool repaintRotation1(const QRect & rect);
  10.120 -    bool repaintRotation3(const QRect & rect);
  10.121 -    void enableFullscreen();
  10.122 -    QDirectPainter *my_painter;
  10.123 -    QImage *my_image;
  10.124 -    bool my_inhibit_resize;
  10.125 -    QPoint my_offset;
  10.126 -    QPoint my_mouse_pos;
  10.127 -    WFlags my_flags;
  10.128 -    WFlags my_has_fullscreen;
  10.129 -    unsigned int my_locked;
  10.130 -};
  10.131 -
  10.132 -#endif /* _SDL_QWin_h */
  10.133 -/* vi: set ts=4 sw=4 expandtab: */
    11.1 --- a/src/video/qtopia/SDL_lowvideo.h	Mon Aug 07 05:25:13 2006 +0000
    11.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.3 @@ -1,67 +0,0 @@
    11.4 -/*
    11.5 -    SDL - Simple DirectMedia Layer
    11.6 -    Copyright (C) 1997-2006 Sam Lantinga
    11.7 -
    11.8 -    This library is free software; you can redistribute it and/or
    11.9 -    modify it under the terms of the GNU Lesser General Public
   11.10 -    License as published by the Free Software Foundation; either
   11.11 -    version 2.1 of the License, or (at your option) any later version.
   11.12 -
   11.13 -    This library is distributed in the hope that it will be useful,
   11.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   11.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   11.16 -    Lesser General Public License for more details.
   11.17 -
   11.18 -    You should have received a copy of the GNU Lesser General Public
   11.19 -    License along with this library; if not, write to the Free Software
   11.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   11.21 -
   11.22 -    Sam Lantinga
   11.23 -    slouken@libsdl.org
   11.24 -*/
   11.25 -#include "SDL_config.h"
   11.26 -
   11.27 -#ifndef _SDL_lowvideo_h
   11.28 -#define _SDL_lowvideo_h
   11.29 -
   11.30 -#include "SDL_mouse.h"
   11.31 -#include "../SDL_sysvideo.h"
   11.32 -
   11.33 -/* Hidden "this" pointer for the video functions */
   11.34 -#define _THIS	SDL_VideoDevice *_this
   11.35 -
   11.36 -/* Private display data */
   11.37 -struct SDL_PrivateVideoData
   11.38 -{
   11.39 -    /* The main window */
   11.40 -    SDL_QWin *SDL_Win;
   11.41 -
   11.42 -    /* The fullscreen mode list */
   11.43 -#define NUM_MODELISTS	4       /* 8, 16, 24, and 32 bits-per-pixel */
   11.44 -    int SDL_nummodes[NUM_MODELISTS];
   11.45 -    SDL_Rect **SDL_modelist[NUM_MODELISTS];
   11.46 -
   11.47 -    /* A completely clear cursor */
   11.48 -    WMcursor *BlankCursor;
   11.49 -
   11.50 -    /* Mouse state variables */
   11.51 -    Uint32 last_buttons;
   11.52 -    QPoint last_point;
   11.53 -
   11.54 -    /* Keyboard state variables */
   11.55 -    int key_flip;
   11.56 -    //struct key_info keyinfo[2];
   11.57 -};
   11.58 -/* Old variable names */
   11.59 -#define SDL_Win		(_this->hidden->SDL_Win)
   11.60 -#define saved_mode	(_this->hidden->saved_mode)
   11.61 -#define SDL_nummodes	(_this->hidden->SDL_nummodes)
   11.62 -#define SDL_modelist	(_this->hidden->SDL_modelist)
   11.63 -#define SDL_BlankCursor	(_this->hidden->BlankCursor)
   11.64 -#define last_buttons	(_this->hidden->last_buttons)
   11.65 -#define last_point	(_this->hidden->last_point)
   11.66 -#define key_flip	(_this->hidden->key_flip)
   11.67 -#define keyinfo		(_this->hidden->keyinfo)
   11.68 -
   11.69 -#endif /* _SDL_lowvideo_h */
   11.70 -/* vi: set ts=4 sw=4 expandtab: */
    12.1 --- a/src/video/qtopia/SDL_sysevents.cc	Mon Aug 07 05:25:13 2006 +0000
    12.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.3 @@ -1,272 +0,0 @@
    12.4 -/*
    12.5 -    SDL - Simple DirectMedia Layer
    12.6 -    Copyright (C) 1997-2006 Sam Lantinga
    12.7 -
    12.8 -    This library is free software; you can redistribute it and/or
    12.9 -    modify it under the terms of the GNU Lesser General Public
   12.10 -    License as published by the Free Software Foundation; either
   12.11 -    version 2.1 of the License, or (at your option) any later version.
   12.12 -
   12.13 -    This library is distributed in the hope that it will be useful,
   12.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   12.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   12.16 -    Lesser General Public License for more details.
   12.17 -
   12.18 -    You should have received a copy of the GNU Lesser General Public
   12.19 -    License along with this library; if not, write to the Free Software
   12.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   12.21 -
   12.22 -    Sam Lantinga
   12.23 -    slouken@libsdl.org
   12.24 -*/
   12.25 -#include "SDL_config.h"
   12.26 -
   12.27 -#include <qpe/qpeapplication.h>
   12.28 -
   12.29 -#include <stdio.h>
   12.30 -#include <string.h>
   12.31 -#include "SDL_error.h"
   12.32 -#include "SDL_events.h"
   12.33 -#include "SDL_QWin.h"
   12.34 -#include "SDL_lowvideo.h"
   12.35 -#include "SDL_timer.h"
   12.36 -
   12.37 -extern "C"
   12.38 -{
   12.39 -#include "../../events/SDL_sysevents.h"
   12.40 -#include "../../events/SDL_events_c.h"
   12.41 -#include "SDL_sysevents_c.h"
   12.42 -
   12.43 -    //  static SDLKey keymap[128];
   12.44 -/* This is special because we know it will be run in a loop in a separate
   12.45 -   thread.  Normally this function should loop as long as there are input
   12.46 -   states changing, i.e. new events arriving.
   12.47 -*/
   12.48 -    void QT_PumpEvents(_THIS)
   12.49 -    {
   12.50 -        if (!qApp) {
   12.51 -            return;
   12.52 -        }
   12.53 -        //  printf("processing events: %p\n", qApp);
   12.54 -        //qApp->processOneEvent(); // wait for a event
   12.55 -        qApp->processEvents();  // and process all outstanding ones
   12.56 -#if 0
   12.57 -        BView *view;
   12.58 -        BRect bounds;
   12.59 -        BPoint point;
   12.60 -        uint32 buttons;
   12.61 -        const uint32 button_masks[3] = {
   12.62 -            B_PRIMARY_MOUSE_BUTTON,
   12.63 -            B_TERTIARY_MOUSE_BUTTON,
   12.64 -            B_SECONDARY_MOUSE_BUTTON,
   12.65 -        };
   12.66 -        unsigned int i, j;
   12.67 -
   12.68 -        /* Check out the mouse buttons and position (slight race condition) */
   12.69 -        if (SDL_Win->Lock()) {
   12.70 -            /* Don't do anything if we have no view */
   12.71 -            view = SDL_Win->View();
   12.72 -            if (!view) {
   12.73 -                SDL_Win->Unlock();
   12.74 -                return;
   12.75 -            }
   12.76 -            bounds = view->Bounds();
   12.77 -            /* Get new input state, if still active */
   12.78 -            if (SDL_Win->IsActive()) {
   12.79 -                key_flip = !key_flip;
   12.80 -                get_key_info(&keyinfo[key_flip]);
   12.81 -                view->GetMouse(&point, &buttons, true);
   12.82 -            } else {
   12.83 -                key_flip = key_flip;
   12.84 -                point = last_point;
   12.85 -                buttons = last_buttons;
   12.86 -            }
   12.87 -            SDL_Win->Unlock();
   12.88 -        } else {
   12.89 -            return;
   12.90 -        }
   12.91 -
   12.92 -        /* If our view is active, we'll find key changes here */
   12.93 -        if (SDL_memcmp(keyinfo[0].key_states, keyinfo[1].key_states, 16) != 0) {
   12.94 -            for (i = 0; i < 16; ++i) {
   12.95 -                Uint8 new_state, transition;
   12.96 -
   12.97 -                new_state = keyinfo[key_flip].key_states[i];
   12.98 -                transition = keyinfo[!key_flip].key_states[i] ^
   12.99 -                    keyinfo[key_flip].key_states[i];
  12.100 -                for (j = 0; j < 8; ++j) {
  12.101 -                    if (transition & 0x80)
  12.102 -                        QueueKey(i * 8 + j, new_state & 0x80);
  12.103 -                    transition <<= 1;
  12.104 -                    new_state <<= 1;
  12.105 -                }
  12.106 -            }
  12.107 -        }
  12.108 -
  12.109 -        /* We check keyboard, but not mouse if mouse isn't in window */
  12.110 -        if (!bounds.Contains(point)) {
  12.111 -            /* Mouse moved outside our view? */
  12.112 -            if (SDL_GetAppState() & SDL_APPMOUSEFOCUS) {
  12.113 -                SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
  12.114 -                be_app->SetCursor(B_HAND_CURSOR);
  12.115 -            }
  12.116 -            return;
  12.117 -        }
  12.118 -        /* Has the mouse moved back into our view? */
  12.119 -        if (!(SDL_GetAppState() & SDL_APPMOUSEFOCUS)) {
  12.120 -            /* Reset the B_HAND_CURSOR to our own */
  12.121 -            SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
  12.122 -            SDL_SetCursor(NULL);
  12.123 -        }
  12.124 -
  12.125 -        /* Check for mouse motion */
  12.126 -        if (point != last_point) {
  12.127 -            int x, y;
  12.128 -
  12.129 -            SDL_Win->GetXYOffset(x, y);
  12.130 -            x = (int) point.x - x;
  12.131 -            y = (int) point.y - y;
  12.132 -            SDL_PrivateMouseMotion(0, 0, x, y);
  12.133 -        }
  12.134 -        last_point = point;
  12.135 -
  12.136 -        /* Add any mouse button events */
  12.137 -        for (i = 0; i < SDL_TABLESIZE(button_masks); ++i) {
  12.138 -            if ((buttons ^ last_buttons) & button_masks[i]) {
  12.139 -                if (buttons & button_masks[i]) {
  12.140 -                    SDL_PrivateMouseButton(SDL_PRESSED, 1 + i, 0, 0);
  12.141 -                } else {
  12.142 -                    SDL_PrivateMouseButton(SDL_RELEASED, 1 + i, 0, 0);
  12.143 -                }
  12.144 -            }
  12.145 -        }
  12.146 -        last_buttons = buttons;
  12.147 -#endif
  12.148 -    }
  12.149 -
  12.150 -    void QT_InitOSKeymap(_THIS)
  12.151 -    {
  12.152 -#if 0
  12.153 -        unsigned int i;
  12.154 -
  12.155 -        /* Initialize all the key states as "up" */
  12.156 -        key_flip = 0;
  12.157 -        SDL_memset(keyinfo[key_flip].key_states, 0, 16);
  12.158 -
  12.159 -        /* Initialize the key translation table */
  12.160 -        for (i = 0; i < SDL_TABLESIZE(keymap); ++i)
  12.161 -            keymap[i] = SDLK_UNKNOWN;
  12.162 -
  12.163 -        //  keymap[0x01]              = SDLK_ESCAPE;
  12.164 -        //  keymap[B_F1_KEY]  = SDLK_F1;
  12.165 -        //  keymap[B_F2_KEY]  = SDLK_F2;
  12.166 -        //  keymap[B_F3_KEY]  = SDLK_F3;
  12.167 -        //  keymap[B_F4_KEY]  = SDLK_F4;
  12.168 -        //  keymap[B_F5_KEY]  = SDLK_F5;
  12.169 -        //  keymap[B_F6_KEY]  = SDLK_F6;
  12.170 -        //  keymap[B_F7_KEY]  = SDLK_F7;
  12.171 -        //  keymap[B_F8_KEY]  = SDLK_F8;
  12.172 -        //  keymap[B_F9_KEY]  = SDLK_F9;
  12.173 -        //  keymap[B_F10_KEY] = SDLK_F10;
  12.174 -        //  keymap[B_F11_KEY] = SDLK_F11;
  12.175 -        //  keymap[B_F12_KEY] = SDLK_F12;
  12.176 -        //  keymap[B_PRINT_KEY]       = SDLK_PRINT;
  12.177 -        //keymap[B_SCROLL_KEY]        = SDLK_SCROLLOCK;
  12.178 -        //  keymap[B_PAUSE_KEY]       = SDLK_PAUSE;
  12.179 -        keymap[0x11] = SDLK_BACKQUOTE;
  12.180 -        keymap[0x12] = SDLK_1;
  12.181 -        keymap[0x13] = SDLK_2;
  12.182 -        keymap[0x14] = SDLK_3;
  12.183 -        keymap[0x15] = SDLK_4;
  12.184 -        keymap[0x16] = SDLK_5;
  12.185 -        keymap[0x17] = SDLK_6;
  12.186 -        keymap[0x18] = SDLK_7;
  12.187 -        keymap[0x19] = SDLK_8;
  12.188 -        keymap[0x1a] = SDLK_9;
  12.189 -        keymap[0x1b] = SDLK_0;
  12.190 -        keymap[0x1c] = SDLK_MINUS;
  12.191 -        keymap[0x1d] = SDLK_EQUALS;
  12.192 -        keymap[0x1e] = SDLK_BACKSPACE;
  12.193 -        keymap[0x1f] = SDLK_INSERT;
  12.194 -        keymap[0x20] = SDLK_HOME;
  12.195 -        keymap[0x21] = SDLK_PAGEUP;
  12.196 -        //keymap[0x22]                = SDLK_NUMLOCK;
  12.197 -        keymap[0x23] = SDLK_KP_DIVIDE;
  12.198 -        keymap[0x24] = SDLK_KP_MULTIPLY;
  12.199 -        keymap[0x25] = SDLK_KP_MINUS;
  12.200 -        keymap[0x26] = SDLK_TAB;
  12.201 -        keymap[0x27] = SDLK_q;
  12.202 -        keymap[0x28] = SDLK_w;
  12.203 -        keymap[0x29] = SDLK_e;
  12.204 -        keymap[0x2a] = SDLK_r;
  12.205 -        keymap[0x2b] = SDLK_t;
  12.206 -        keymap[0x2c] = SDLK_y;
  12.207 -        keymap[0x2d] = SDLK_u;
  12.208 -        keymap[0x2e] = SDLK_i;
  12.209 -        keymap[0x2f] = SDLK_o;
  12.210 -        keymap[0x30] = SDLK_p;
  12.211 -        keymap[0x31] = SDLK_LEFTBRACKET;
  12.212 -        keymap[0x32] = SDLK_RIGHTBRACKET;
  12.213 -        keymap[0x33] = SDLK_BACKSLASH;
  12.214 -        keymap[0x34] = SDLK_DELETE;
  12.215 -        keymap[0x35] = SDLK_END;
  12.216 -        keymap[0x36] = SDLK_PAGEDOWN;
  12.217 -        keymap[0x37] = SDLK_KP7;
  12.218 -        keymap[0x38] = SDLK_KP8;
  12.219 -        keymap[0x39] = SDLK_KP9;
  12.220 -        keymap[0x3a] = SDLK_KP_PLUS;
  12.221 -        //keymap[0x3b]                = SDLK_CAPSLOCK;
  12.222 -        keymap[0x3c] = SDLK_a;
  12.223 -        keymap[0x3d] = SDLK_s;
  12.224 -        keymap[0x3e] = SDLK_d;
  12.225 -        keymap[0x3f] = SDLK_f;
  12.226 -        keymap[0x40] = SDLK_g;
  12.227 -        keymap[0x41] = SDLK_h;
  12.228 -        keymap[0x42] = SDLK_j;
  12.229 -        keymap[0x43] = SDLK_k;
  12.230 -        keymap[0x44] = SDLK_l;
  12.231 -        keymap[0x45] = SDLK_SEMICOLON;
  12.232 -        keymap[0x46] = SDLK_QUOTE;
  12.233 -        keymap[0x47] = SDLK_RETURN;
  12.234 -        keymap[0x48] = SDLK_KP4;
  12.235 -        keymap[0x49] = SDLK_KP5;
  12.236 -        keymap[0x4a] = SDLK_KP6;
  12.237 -        keymap[0x4b] = SDLK_LSHIFT;
  12.238 -        keymap[0x4c] = SDLK_z;
  12.239 -        keymap[0x4d] = SDLK_x;
  12.240 -        keymap[0x4e] = SDLK_c;
  12.241 -        keymap[0x4f] = SDLK_v;
  12.242 -        keymap[0x50] = SDLK_b;
  12.243 -        keymap[0x51] = SDLK_n;
  12.244 -        keymap[0x52] = SDLK_m;
  12.245 -        keymap[0x53] = SDLK_COMMA;
  12.246 -        keymap[0x54] = SDLK_PERIOD;
  12.247 -        keymap[0x55] = SDLK_SLASH;
  12.248 -        keymap[0x56] = SDLK_RSHIFT;
  12.249 -        keymap[0x57] = SDLK_UP;
  12.250 -        keymap[0x58] = SDLK_KP1;
  12.251 -        keymap[0x59] = SDLK_KP2;
  12.252 -        keymap[0x5a] = SDLK_KP3;
  12.253 -        keymap[0x5b] = SDLK_KP_ENTER;
  12.254 -        //keymap[0x5c]                = SDLK_LCTRL;
  12.255 -        //keymap[0x5d]                = SDLK_LALT;
  12.256 -        keymap[0x5e] = SDLK_SPACE;
  12.257 -        //keymap[0x5f]                = SDLK_RALT;
  12.258 -        //keymap[0x60]                = SDLK_RCTRL;
  12.259 -        keymap[0x61] = SDLK_LEFT;
  12.260 -        keymap[0x62] = SDLK_DOWN;
  12.261 -        keymap[0x63] = SDLK_RIGHT;
  12.262 -        keymap[0x64] = SDLK_KP0;
  12.263 -        keymap[0x65] = SDLK_KP_PERIOD;
  12.264 -        //keymap[0x66]                = SDLK_LMETA;
  12.265 -        //keymap[0x67]                = SDLK_RMETA;
  12.266 -        //keymap[0x68]                = SDLK_MENU;
  12.267 -        keymap[0x69] = SDLK_EURO;
  12.268 -        keymap[0x6a] = SDLK_KP_EQUALS;
  12.269 -        keymap[0x6b] = SDLK_POWER;
  12.270 -#endif
  12.271 -    }
  12.272 -
  12.273 -};                              /* Extern C */
  12.274 -
  12.275 -/* vi: set ts=4 sw=4 expandtab: */
    13.1 --- a/src/video/qtopia/SDL_sysevents_c.h	Mon Aug 07 05:25:13 2006 +0000
    13.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.3 @@ -1,32 +0,0 @@
    13.4 -/*
    13.5 -    SDL - Simple DirectMedia Layer
    13.6 -    Copyright (C) 1997-2006 Sam Lantinga
    13.7 -
    13.8 -    This library is free software; you can redistribute it and/or
    13.9 -    modify it under the terms of the GNU Lesser General Public
   13.10 -    License as published by the Free Software Foundation; either
   13.11 -    version 2.1 of the License, or (at your option) any later version.
   13.12 -
   13.13 -    This library is distributed in the hope that it will be useful,
   13.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   13.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   13.16 -    Lesser General Public License for more details.
   13.17 -
   13.18 -    You should have received a copy of the GNU Lesser General Public
   13.19 -    License along with this library; if not, write to the Free Software
   13.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   13.21 -
   13.22 -    Sam Lantinga
   13.23 -    slouken@libsdl.org
   13.24 -*/
   13.25 -#include "SDL_config.h"
   13.26 -
   13.27 -#include "SDL_lowvideo.h"
   13.28 -
   13.29 -/* Variables and functions exported by SDL_sysevents.c to other parts 
   13.30 -   of the native video subsystem (SDL_sysvideo.c)
   13.31 -*/
   13.32 -
   13.33 -extern void QT_InitOSKeymap(_THIS);
   13.34 -extern void QT_PumpEvents(_THIS);
   13.35 -/* vi: set ts=4 sw=4 expandtab: */
    14.1 --- a/src/video/qtopia/SDL_sysmouse.cc	Mon Aug 07 05:25:13 2006 +0000
    14.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.3 @@ -1,61 +0,0 @@
    14.4 -/*
    14.5 -    SDL - Simple DirectMedia Layer
    14.6 -    Copyright (C) 1997-2006 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_QWin.h"
   14.28 -
   14.29 -extern "C"
   14.30 -{
   14.31 -
   14.32 -#include "SDL_sysmouse_c.h"
   14.33 -
   14.34 -/* The implementation dependent data for the window manager cursor */
   14.35 -    struct WMcursor
   14.36 -    {
   14.37 -        char *bits;
   14.38 -    };
   14.39 -    WMcursor *QT_CreateWMCursor(_THIS,
   14.40 -                                Uint8 * data, Uint8 * mask, int w, int h,
   14.41 -                                int hot_x, int hot_y)
   14.42 -    {
   14.43 -        static WMcursor dummy;
   14.44 -          dummy.bits = 0;
   14.45 -          return &dummy;
   14.46 -    }
   14.47 -
   14.48 -    int QT_ShowWMCursor(_THIS, WMcursor * cursor)
   14.49 -    {
   14.50 -        return 1;
   14.51 -    }
   14.52 -
   14.53 -    void QT_FreeWMCursor(_THIS, WMcursor * cursor)
   14.54 -    {
   14.55 -    }
   14.56 -
   14.57 -    void QT_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
   14.58 -    {
   14.59 -        SDL_Win->setMousePos(QPoint(x, y));
   14.60 -    }
   14.61 -
   14.62 -};                              /* Extern C */
   14.63 -
   14.64 -/* vi: set ts=4 sw=4 expandtab: */
    15.1 --- a/src/video/qtopia/SDL_sysmouse_c.h	Mon Aug 07 05:25:13 2006 +0000
    15.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.3 @@ -1,33 +0,0 @@
    15.4 -/*
    15.5 -    SDL - Simple DirectMedia Layer
    15.6 -    Copyright (C) 1997-2006 Sam Lantinga
    15.7 -
    15.8 -    This library is free software; you can redistribute it and/or
    15.9 -    modify it under the terms of the GNU Lesser General Public
   15.10 -    License as published by the Free Software Foundation; either
   15.11 -    version 2.1 of the License, or (at your option) any later version.
   15.12 -
   15.13 -    This library is distributed in the hope that it will be useful,
   15.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   15.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   15.16 -    Lesser General Public License for more details.
   15.17 -
   15.18 -    You should have received a copy of the GNU Lesser General Public
   15.19 -    License along with this library; if not, write to the Free Software
   15.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   15.21 -
   15.22 -    Sam Lantinga
   15.23 -    slouken@libsdl.org
   15.24 -*/
   15.25 -#include "SDL_config.h"
   15.26 -
   15.27 -#include "SDL_lowvideo.h"
   15.28 -
   15.29 -/* Functions to be exported */
   15.30 -extern void QT_FreeWMCursor(_THIS, WMcursor * cursor);
   15.31 -extern WMcursor *QT_CreateWMCursor(_THIS,
   15.32 -                                   Uint8 * data, Uint8 * mask, int w, int h,
   15.33 -                                   int hot_x, int hot_y);
   15.34 -extern int QT_ShowWMCursor(_THIS, WMcursor * cursor);
   15.35 -extern void QT_WarpWMCursor(_THIS, Uint16 x, Uint16 y);
   15.36 -/* vi: set ts=4 sw=4 expandtab: */
    16.1 --- a/src/video/qtopia/SDL_sysvideo.cc	Mon Aug 07 05:25:13 2006 +0000
    16.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.3 @@ -1,414 +0,0 @@
    16.4 -/*
    16.5 -    SDL - Simple DirectMedia Layer
    16.6 -    Copyright (C) 1997-2006 Sam Lantinga
    16.7 -
    16.8 -    This library is free software; you can redistribute it and/or
    16.9 -    modify it under the terms of the GNU Lesser General Public
   16.10 -    License as published by the Free Software Foundation; either
   16.11 -    version 2.1 of the License, or (at your option) any later version.
   16.12 -
   16.13 -    This library is distributed in the hope that it will be useful,
   16.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   16.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   16.16 -    Lesser General Public License for more details.
   16.17 -
   16.18 -    You should have received a copy of the GNU Lesser General Public
   16.19 -    License along with this library; if not, write to the Free Software
   16.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   16.21 -
   16.22 -    Sam Lantinga
   16.23 -    slouken@libsdl.org
   16.24 -*/
   16.25 -#include "SDL_config.h"
   16.26 -
   16.27 -/* Qtopia based framebuffer implementation */
   16.28 -
   16.29 -#include <unistd.h>
   16.30 -
   16.31 -#include <qapplication.h>
   16.32 -#include <qpe/qpeapplication.h>
   16.33 -
   16.34 -#include "SDL_timer.h"
   16.35 -
   16.36 -#include "SDL_QWin.h"
   16.37 -
   16.38 -extern "C"
   16.39 -{
   16.40 -
   16.41 -#include "../SDL_sysvideo.h"
   16.42 -#include "../../events/SDL_events_c.h"
   16.43 -#include "SDL_sysevents_c.h"
   16.44 -#include "SDL_sysmouse_c.h"
   16.45 -#include "SDL_syswm_c.h"
   16.46 -#include "SDL_lowvideo.h"
   16.47 -
   16.48 -    //#define QTOPIA_DEBUG
   16.49 -#define QT_HIDDEN_SIZE	32      /* starting hidden window size */
   16.50 -
   16.51 -    /* Name of the environment variable used to invert the screen rotation or not:
   16.52 -       Possible values:
   16.53 -       !=0 : Screen is 270 rotated
   16.54 -       0: Screen is 90 rotated */
   16.55 -#define SDL_QT_ROTATION_ENV_NAME "SDL_QT_INVERT_ROTATION"
   16.56 -
   16.57 -    /* Initialization/Query functions */
   16.58 -    static int QT_VideoInit(_THIS, SDL_PixelFormat * vformat);
   16.59 -    static SDL_Rect **QT_ListModes(_THIS, SDL_PixelFormat * format,
   16.60 -                                   Uint32 flags);
   16.61 -    static SDL_Surface *QT_SetVideoMode(_THIS, SDL_Surface * current,
   16.62 -                                        int width, int height, int bpp,
   16.63 -                                        Uint32 flags);
   16.64 -    static void QT_UpdateMouse(_THIS);
   16.65 -    static int QT_SetColors(_THIS, int firstcolor, int ncolors,
   16.66 -                            SDL_Color * colors);
   16.67 -    static void QT_VideoQuit(_THIS);
   16.68 -
   16.69 -    /* Hardware surface functions */
   16.70 -    static int QT_AllocHWSurface(_THIS, SDL_Surface * surface);
   16.71 -    static int QT_LockHWSurface(_THIS, SDL_Surface * surface);
   16.72 -    static void QT_UnlockHWSurface(_THIS, SDL_Surface * surface);
   16.73 -    static void QT_FreeHWSurface(_THIS, SDL_Surface * surface);
   16.74 -
   16.75 -    static int QT_ToggleFullScreen(_THIS, int fullscreen);
   16.76 -
   16.77 -    static int QT_IconifyWindow(_THIS);
   16.78 -    static SDL_GrabMode QT_GrabInput(_THIS, SDL_GrabMode mode);
   16.79 -
   16.80 -    /* FB driver bootstrap functions */
   16.81 -
   16.82 -    static int QT_Available(void)
   16.83 -    {
   16.84 -        return (1);
   16.85 -    }
   16.86 -
   16.87 -    static void QT_DeleteDevice(SDL_VideoDevice * device)
   16.88 -    {
   16.89 -        SDL_free(device->hidden);
   16.90 -        SDL_free(device);
   16.91 -    }
   16.92 -
   16.93 -    static SDL_VideoDevice *QT_CreateDevice(int devindex)
   16.94 -    {
   16.95 -        SDL_VideoDevice *device;
   16.96 -
   16.97 -        /* Initialize all variables that we clean on shutdown */
   16.98 -        device = (SDL_VideoDevice *) SDL_malloc(sizeof(SDL_VideoDevice));
   16.99 -        if (device) {
  16.100 -            SDL_memset(device, 0, (sizeof *device));
  16.101 -            device->hidden = (struct SDL_PrivateVideoData *)
  16.102 -                SDL_malloc((sizeof *device->hidden));
  16.103 -        }
  16.104 -        if ((device == NULL) || (device->hidden == NULL)) {
  16.105 -            SDL_OutOfMemory();
  16.106 -            if (device) {
  16.107 -                SDL_free(device);
  16.108 -            }
  16.109 -            return (0);
  16.110 -        }
  16.111 -        SDL_memset(device->hidden, 0, (sizeof *device->hidden));
  16.112 -
  16.113 -        /* Set the function pointers */
  16.114 -        device->VideoInit = QT_VideoInit;
  16.115 -        device->ListModes = QT_ListModes;
  16.116 -        device->SetVideoMode = QT_SetVideoMode;
  16.117 -        device->UpdateMouse = QT_UpdateMouse;
  16.118 -        device->SetColors = QT_SetColors;
  16.119 -        device->UpdateRects = NULL;
  16.120 -        device->VideoQuit = QT_VideoQuit;
  16.121 -        device->AllocHWSurface = QT_AllocHWSurface;
  16.122 -        device->CheckHWBlit = NULL;
  16.123 -        device->FillHWRect = NULL;
  16.124 -        device->SetHWColorKey = NULL;
  16.125 -        device->SetHWAlpha = NULL;
  16.126 -        device->LockHWSurface = QT_LockHWSurface;
  16.127 -        device->UnlockHWSurface = QT_UnlockHWSurface;
  16.128 -        device->FlipHWSurface = NULL;
  16.129 -        device->FreeHWSurface = QT_FreeHWSurface;
  16.130 -        device->SetIcon = NULL;
  16.131 -        device->SetCaption = QT_SetWMCaption;
  16.132 -        device->IconifyWindow = QT_IconifyWindow;
  16.133 -        device->GrabInput = QT_GrabInput;
  16.134 -        device->GetWMInfo = NULL;
  16.135 -        device->FreeWMCursor = QT_FreeWMCursor;
  16.136 -        device->CreateWMCursor = QT_CreateWMCursor;
  16.137 -        device->ShowWMCursor = QT_ShowWMCursor;
  16.138 -        device->WarpWMCursor = QT_WarpWMCursor;
  16.139 -        device->InitOSKeymap = QT_InitOSKeymap;
  16.140 -        device->PumpEvents = QT_PumpEvents;
  16.141 -
  16.142 -        device->free = QT_DeleteDevice;
  16.143 -        device->ToggleFullScreen = QT_ToggleFullScreen;
  16.144 -
  16.145 -        /* Set the driver flags */
  16.146 -        device->handles_any_size = 0;
  16.147 -
  16.148 -        return device;
  16.149 -    }
  16.150 -
  16.151 -    VideoBootStrap Qtopia_bootstrap = {
  16.152 -        "qtopia", "Qtopia / QPE graphics",
  16.153 -        QT_Available, QT_CreateDevice
  16.154 -    };
  16.155 -
  16.156 -    /* Function to sort the display_list */
  16.157 -    static int CompareModes(const void *A, const void *B)
  16.158 -    {
  16.159 -#if 0
  16.160 -        const display_mode *a = (display_mode *) A;
  16.161 -        const display_mode *b = (display_mode *) B;
  16.162 -
  16.163 -        if (a->space == b->space) {
  16.164 -            return ((b->virtual_width * b->virtual_height) -
  16.165 -                    (a->virtual_width * a->virtual_height));
  16.166 -        } else {
  16.167 -            return (ColorSpaceToBitsPerPixel(b->space) -
  16.168 -                    ColorSpaceToBitsPerPixel(a->space));
  16.169 -        }
  16.170 -#endif
  16.171 -        return 0;
  16.172 -    }
  16.173 -
  16.174 -    /* Yes, this isn't the fastest it could be, but it works nicely */
  16.175 -    static int QT_AddMode(_THIS, int index, unsigned int w, unsigned int h)
  16.176 -    {
  16.177 -        SDL_Rect *mode;
  16.178 -        int i;
  16.179 -        int next_mode;
  16.180 -
  16.181 -        /* Check to see if we already have this mode */
  16.182 -        if (SDL_nummodes[index] > 0) {
  16.183 -            for (i = SDL_nummodes[index] - 1; i >= 0; --i) {
  16.184 -                mode = SDL_modelist[index][i];
  16.185 -                if ((mode->w == w) && (mode->h == h)) {
  16.186 -                    return (0);
  16.187 -                }
  16.188 -            }
  16.189 -        }
  16.190 -
  16.191 -        /* Set up the new video mode rectangle */
  16.192 -        mode = (SDL_Rect *) SDL_malloc(sizeof *mode);
  16.193 -        if (mode == NULL) {
  16.194 -            SDL_OutOfMemory();
  16.195 -            return (-1);
  16.196 -        }
  16.197 -        mode->x = 0;
  16.198 -        mode->y = 0;
  16.199 -        mode->w = w;
  16.200 -        mode->h = h;
  16.201 -#ifdef QTOPIA_DEBUG
  16.202 -        fprintf(stderr, "Adding mode %dx%d at %d bytes per pixel\n", w, h,
  16.203 -                index + 1);
  16.204 -#endif
  16.205 -
  16.206 -        /* Allocate the new list of modes, and fill in the new mode */
  16.207 -        next_mode = SDL_nummodes[index];
  16.208 -        SDL_modelist[index] = (SDL_Rect **)
  16.209 -            SDL_realloc(SDL_modelist[index],
  16.210 -                        (1 + next_mode + 1) * sizeof(SDL_Rect *));
  16.211 -        if (SDL_modelist[index] == NULL) {
  16.212 -            SDL_OutOfMemory();
  16.213 -            SDL_nummodes[index] = 0;
  16.214 -            SDL_free(mode);
  16.215 -            return (-1);
  16.216 -        }
  16.217 -        SDL_modelist[index][next_mode] = mode;
  16.218 -        SDL_modelist[index][next_mode + 1] = NULL;
  16.219 -        SDL_nummodes[index]++;
  16.220 -
  16.221 -        return (0);
  16.222 -    }
  16.223 -
  16.224 -    int QT_VideoInit(_THIS, SDL_PixelFormat * vformat)
  16.225 -    {
  16.226 -        /* Initialize the QPE Application  */
  16.227 -        /* Determine the screen depth */
  16.228 -        vformat->BitsPerPixel = QPixmap::defaultDepth();
  16.229 -
  16.230 -        // For now we hardcode the current depth because anything else
  16.231 -        // might as well be emulated by SDL rather than by Qtopia.
  16.232 -
  16.233 -        QSize desktop_size = qApp->desktop()->size();
  16.234 -        QT_AddMode(_this, ((vformat->BitsPerPixel + 7) / 8) - 1,
  16.235 -                   desktop_size.width(), desktop_size.height());
  16.236 -        QT_AddMode(_this, ((vformat->BitsPerPixel + 7) / 8) - 1,
  16.237 -                   desktop_size.height(), desktop_size.width());
  16.238 -
  16.239 -        /* Determine the current screen size */
  16.240 -        _this->info.current_w = desktop_size.width();
  16.241 -        _this->info.current_h = desktop_size.height();
  16.242 -
  16.243 -        /* Create the window / widget */
  16.244 -        SDL_Win = new SDL_QWin(QSize(QT_HIDDEN_SIZE, QT_HIDDEN_SIZE));
  16.245 -        ((QPEApplication *) qApp)->showMainWidget(SDL_Win);
  16.246 -        /* Fill in some window manager capabilities */
  16.247 -        _this->info.wm_available = 0;
  16.248 -
  16.249 -        /* We're done! */
  16.250 -        return (0);
  16.251 -    }
  16.252 -
  16.253 -    /* We support any dimension at our bit-depth */
  16.254 -    SDL_Rect **QT_ListModes(_THIS, SDL_PixelFormat * format, Uint32 flags)
  16.255 -    {
  16.256 -        SDL_Rect **modes;
  16.257 -
  16.258 -        modes = ((SDL_Rect **) 0);
  16.259 -        if ((flags & SDL_FULLSCREEN) == SDL_FULLSCREEN) {
  16.260 -            modes = SDL_modelist[((format->BitsPerPixel + 7) / 8) - 1];
  16.261 -        } else {
  16.262 -            if (format->BitsPerPixel == _this->screen->format->BitsPerPixel) {
  16.263 -                modes = ((SDL_Rect **) - 1);
  16.264 -            }
  16.265 -        }
  16.266 -        return (modes);
  16.267 -    }
  16.268 -
  16.269 -    /* Various screen update functions available */
  16.270 -    static void QT_NormalUpdate(_THIS, int numrects, SDL_Rect * rects);
  16.271 -
  16.272 -
  16.273 -    static int QT_SetFullScreen(_THIS, SDL_Surface * screen, int fullscreen)
  16.274 -    {
  16.275 -        return -1;
  16.276 -    }
  16.277 -
  16.278 -    static int QT_ToggleFullScreen(_THIS, int fullscreen)
  16.279 -    {
  16.280 -        return -1;
  16.281 -    }
  16.282 -
  16.283 -    /* FIXME: check return values and cleanup here */
  16.284 -    SDL_Surface *QT_SetVideoMode(_THIS, SDL_Surface * current,
  16.285 -                                 int width, int height, int bpp, Uint32 flags)
  16.286 -    {
  16.287 -
  16.288 -        QImage *qimage;
  16.289 -        QSize desktop_size = qApp->desktop()->size();
  16.290 -
  16.291 -
  16.292 -        current->flags = 0;     //SDL_FULLSCREEN; // We always run fullscreen.
  16.293 -
  16.294 -        if (width <= desktop_size.width()
  16.295 -            && height <= desktop_size.height()) {
  16.296 -            current->w = desktop_size.width();
  16.297 -            current->h = desktop_size.height();
  16.298 -        } else if (width <= desktop_size.height()
  16.299 -                   && height <= desktop_size.width()) {
  16.300 -            // Landscape mode
  16.301 -            char *envString = SDL_getenv(SDL_QT_ROTATION_ENV_NAME);
  16.302 -            int envValue = envString ? atoi(envString) : 0;
  16.303 -            screenRotation =
  16.304 -                envValue ? SDL_QT_ROTATION_270 : SDL_QT_ROTATION_90;
  16.305 -            current->h = desktop_size.width();
  16.306 -            current->w = desktop_size.height();
  16.307 -        } else {
  16.308 -            SDL_SetError("Unsupported resolution, %dx%d\n", width, height);
  16.309 -        }
  16.310 -        if (flags & SDL_INTERNALOPENGL) {
  16.311 -            SDL_SetError("OpenGL not supported");
  16.312 -            return (NULL);
  16.313 -        }
  16.314 -        /* Create the QImage framebuffer */
  16.315 -        qimage = new QImage(current->w, current->h, bpp);
  16.316 -        if (qimage->isNull()) {
  16.317 -            SDL_SetError("Couldn't create screen bitmap");
  16.318 -            delete qimage;
  16.319 -            return (NULL);
  16.320 -        }
  16.321 -        current->pitch = qimage->bytesPerLine();
  16.322 -        current->pixels = (void *) qimage->bits();
  16.323 -        SDL_Win->setImage(qimage);
  16.324 -        _this->UpdateRects = QT_NormalUpdate;
  16.325 -        SDL_Win->setFullscreen(true);
  16.326 -        /* We're done */
  16.327 -        return (current);
  16.328 -    }
  16.329 -
  16.330 -    /* Update the current mouse state and position */
  16.331 -    void QT_UpdateMouse(_THIS)
  16.332 -    {
  16.333 -        QPoint point(-1, -1);
  16.334 -        if (SDL_Win->isActiveWindow()) {
  16.335 -            point = SDL_Win->mousePos();
  16.336 -        }
  16.337 -
  16.338 -        if ((point.x() >= 0) && (point.x() < SDL_VideoSurface->w) &&
  16.339 -            (point.y() >= 0) && (point.y() < SDL_VideoSurface->h)) {
  16.340 -            SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
  16.341 -            SDL_PrivateMouseMotion(0, 0,
  16.342 -                                   (Sint16) point.x(), (Sint16) point.y());
  16.343 -        } else {
  16.344 -            SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
  16.345 -        }
  16.346 -    }
  16.347 -
  16.348 -    /* We don't actually allow hardware surfaces other than the main one */
  16.349 -    static int QT_AllocHWSurface(_THIS, SDL_Surface * surface)
  16.350 -    {
  16.351 -        return (-1);
  16.352 -    }
  16.353 -    static void QT_FreeHWSurface(_THIS, SDL_Surface * surface)
  16.354 -    {
  16.355 -        return;
  16.356 -    }
  16.357 -    static int QT_LockHWSurface(_THIS, SDL_Surface * surface)
  16.358 -    {
  16.359 -        return (0);
  16.360 -    }
  16.361 -    static void QT_UnlockHWSurface(_THIS, SDL_Surface * surface)
  16.362 -    {
  16.363 -        return;
  16.364 -    }
  16.365 -
  16.366 -    static void QT_NormalUpdate(_THIS, int numrects, SDL_Rect * rects)
  16.367 -    {
  16.368 -        if (SDL_Win->lockScreen()) {
  16.369 -            for (int i = 0; i < numrects; ++i) {
  16.370 -                QRect rect(rects[i].x, rects[i].y, rects[i].w, rects[i].h);
  16.371 -                SDL_Win->repaintRect(rect);
  16.372 -            }
  16.373 -            SDL_Win->unlockScreen();
  16.374 -        }
  16.375 -    }
  16.376 -    /* Is the system palette settable? */
  16.377 -    int QT_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color * colors)
  16.378 -    {
  16.379 -        return -1;
  16.380 -    }
  16.381 -
  16.382 -    void QT_VideoQuit(_THIS)
  16.383 -    {
  16.384 -        // This is dumb, but if I free this, the app doesn't exit correctly.
  16.385 -        // Of course, this will leak memory if init video is done more than once.
  16.386 -        // Sucks but such is life.
  16.387 -
  16.388 -        //    -- David Hedbor
  16.389 -        //    delete SDL_Win; 
  16.390 -        //    SDL_Win = 0;
  16.391 -        _this->screen->pixels = NULL;
  16.392 -        QT_GrabInput(_this, SDL_GRAB_OFF);
  16.393 -    }
  16.394 -
  16.395 -    static int QT_IconifyWindow(_THIS)
  16.396 -    {
  16.397 -        SDL_Win->hide();
  16.398 -
  16.399 -        return true;
  16.400 -    }
  16.401 -
  16.402 -    static SDL_GrabMode QT_GrabInput(_THIS, SDL_GrabMode mode)
  16.403 -    {
  16.404 -        if (mode == SDL_GRAB_OFF) {
  16.405 -            QPEApplication::grabKeyboard();
  16.406 -            qApp->processEvents();
  16.407 -            QPEApplication::ungrabKeyboard();
  16.408 -        } else {
  16.409 -            QPEApplication::grabKeyboard();
  16.410 -        }
  16.411 -        qApp->processEvents();
  16.412 -        return mode;
  16.413 -    }
  16.414 -
  16.415 -};                              /* Extern C */
  16.416 -
  16.417 -/* vi: set ts=4 sw=4 expandtab: */
    17.1 --- a/src/video/qtopia/SDL_syswm.cc	Mon Aug 07 05:25:13 2006 +0000
    17.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.3 @@ -1,37 +0,0 @@
    17.4 -/*
    17.5 -    SDL - Simple DirectMedia Layer
    17.6 -    Copyright (C) 1997-2006 Sam Lantinga
    17.7 -
    17.8 -    This library is free software; you can redistribute it and/or
    17.9 -    modify it under the terms of the GNU Lesser General Public
   17.10 -    License as published by the Free Software Foundation; either
   17.11 -    version 2.1 of the License, or (at your option) any later version.
   17.12 -
   17.13 -    This library is distributed in the hope that it will be useful,
   17.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   17.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   17.16 -    Lesser General Public License for more details.
   17.17 -
   17.18 -    You should have received a copy of the GNU Lesser General Public
   17.19 -    License along with this library; if not, write to the Free Software
   17.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   17.21 -
   17.22 -    Sam Lantinga
   17.23 -    slouken@libsdl.org
   17.24 -*/
   17.25 -#include "SDL_config.h"
   17.26 -
   17.27 -#include "SDL_QWin.h"
   17.28 -
   17.29 -extern "C"
   17.30 -{
   17.31 -
   17.32 -#include "SDL_syswm_c.h"
   17.33 -
   17.34 -    void QT_SetWMCaption(_THIS, const char *title, const char *icon)
   17.35 -    {
   17.36 -        SDL_Win->setCaption(title);
   17.37 -    }
   17.38 -
   17.39 -};                              /* Extern C */
   17.40 -/* vi: set ts=4 sw=4 expandtab: */
    18.1 --- a/src/video/qtopia/SDL_syswm_c.h	Mon Aug 07 05:25:13 2006 +0000
    18.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.3 @@ -1,28 +0,0 @@
    18.4 -/*
    18.5 -    SDL - Simple DirectMedia Layer
    18.6 -    Copyright (C) 1997-2006 Sam Lantinga
    18.7 -
    18.8 -    This library is free software; you can redistribute it and/or
    18.9 -    modify it under the terms of the GNU Lesser General Public
   18.10 -    License as published by the Free Software Foundation; either
   18.11 -    version 2.1 of the License, or (at your option) any later version.
   18.12 -
   18.13 -    This library is distributed in the hope that it will be useful,
   18.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   18.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   18.16 -    Lesser General Public License for more details.
   18.17 -
   18.18 -    You should have received a copy of the GNU Lesser General Public
   18.19 -    License along with this library; if not, write to the Free Software
   18.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   18.21 -
   18.22 -    Sam Lantinga
   18.23 -    slouken@libsdl.org
   18.24 -*/
   18.25 -#include "SDL_config.h"
   18.26 -
   18.27 -#include "SDL_lowvideo.h"
   18.28 -
   18.29 -/* Functions to be exported */
   18.30 -extern void QT_SetWMCaption(_THIS, const char *title, const char *icon);
   18.31 -/* vi: set ts=4 sw=4 expandtab: */