Removed EPOC port...it's being replaced by an updated Symbian port with the SDL-1.2
authorRyan C. Gordon <icculus@icculus.org>
Fri, 15 Jun 2007 15:42:15 +0000
branchSDL-1.2
changeset 3968ae0be7edf7d0
parent 3967 d22892eaa1cf
child 3969 e6112676c9a0
Removed EPOC port...it's being replaced by an updated Symbian port with the
original author's blessing.
EpocBuildFiles.zip
README.Epoc
docs.html
src/thread/epoc/SDL_sysmutex.cpp
src/thread/epoc/SDL_syssem.cpp
src/thread/epoc/SDL_systhread.cpp
src/thread/epoc/SDL_systhread_c.h
src/timer/epoc/SDL_systimer.cpp
src/video/epoc/SDL_epocevents.cpp
src/video/epoc/SDL_epocevents_c.h
src/video/epoc/SDL_epocvideo.cpp
src/video/epoc/SDL_epocvideo.h
     1.1 Binary file EpocBuildFiles.zip has changed
     2.1 --- a/README.Epoc	Fri Jun 15 12:26:29 2007 +0000
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,75 +0,0 @@
     2.4 -
     2.5 -==============================================================================
     2.6 -Using the Simple DirectMedia Layer with EPOC/SymbianOS 6.0
     2.7 -==============================================================================
     2.8 -
     2.9 -==============================================================================
    2.10 -I.  Building the Simple DirectMedia Layer libraries:
    2.11 -
    2.12 -  You can get Symbian SDK from: 
    2.13 -    http://www.symbian.com.
    2.14 - 
    2.15 -  First create "Epoc" directory under SDL main directory and unpack 
    2.16 -  EpocBuildFiles.zip in it.
    2.17 -   
    2.18 -  To build the librarys goto "epoc" directory and type:
    2.19 -    bldmake bldfiles
    2.20 -    abld makefile vc6 (for creating Microsoft Visual C++ makefiles)
    2.21 -    abld build wins udeb (building for wins emulator)
    2.22 -    abld build armi urel (building for real device)
    2.23 -
    2.24 -==============================================================================
    2.25 -II. Building the Simple DirectMedia Layer programs:
    2.26 -
    2.27 -  Building SDL test programs is easy once you have built the libraries:
    2.28 -    abld test build wins udeb
    2.29 -    abld test build armi urel
    2.30 -
    2.31 -  Supported real screen resolutions
    2.32 -    320 x 200 x  8 bit
    2.33 -    320 x 200 x 12 bit
    2.34 -    640 x 200 x  8 bit
    2.35 -    640 x 200 x 12 bit
    2.36 -  Supported "emulated" screen resolutions 
    2.37 -    640 x 400 x  8 bit
    2.38 -    640 x 400 x 12 bit
    2.39 -    640 x 480 x  8 bit
    2.40 -    640 x 480 x 12 bit
    2.41 -  "Emulated" resolutions are implemented by by shrinking the screen vertically 
    2.42 -  i.e. only every second scanline is drawn. This is mainly ment to be used for 
    2.43 -  testing quick ports of programs. Using faked resolutions is a waste of memory 
    2.44 -  and cpu power!
    2.45 -
    2.46 -==============================================================================
    2.47 -III. Running test programs
    2.48 -
    2.49 -  Copy executable to the device and run it from the File manager.   The Esc 
    2.50 -  key quits demo programs. In Crystal, Exe programs do not appear in task list 
    2.51 -  nor in Extras :-(. Test programs are tested in Nokia 9210 Communicator.
    2.52 -
    2.53 -  Special keys used in SDL:
    2.54 -    The Caps lock key enables or disables the virtual cursor. 
    2.55 -    Function keys are mapped as follows: 
    2.56 -    F1=chr+q, F2=chr+w,..., F8=chr+i, 
    2.57 -    F9=chr+a,..., F12=chr+d.
    2.58 -
    2.59 -==============================================================================
    2.60 -IV.  Enjoy! :)
    2.61 -
    2.62 -  If you have a project you'd like me to know about, or want to ask questions,
    2.63 -  go ahead and join the SDL developer's mailing list by sending e-mail to:
    2.64 -
    2.65 -	sdl-request@libsdl.org
    2.66 -
    2.67 -  and put "subscribe" into the subject of the message. Or alternatively you
    2.68 -  can use the web interface:
    2.69 -
    2.70 -	http://www.libsdl.org/mailman/listinfo/sdl
    2.71 -
    2.72 -  You can find more info about Epoc version of SDL from Hannu Viitala's 
    2.73 -  homepage
    2.74 -    http://www.mbnet.fi/~haviital
    2.75 -  
    2.76 -==============================================================================
    2.77 -
    2.78 -
     3.1 --- a/docs.html	Fri Jun 15 12:26:29 2007 +0000
     3.2 +++ b/docs.html	Fri Jun 15 15:42:15 2007 +0000
     3.3 @@ -43,6 +43,9 @@
     3.4  <P>
     3.5  	Support for AmigaOS has been removed from the main SDL code.
     3.6  </P>
     3.7 +<P>
     3.8 +	Support for Nokia 9210 "EPOC" driver has been removed from the main SDL code.
     3.9 +</P>
    3.10  </BLOCKQUOTE>
    3.11  
    3.12  <H3> Unix Notes </H3>
     4.1 --- a/src/thread/epoc/SDL_sysmutex.cpp	Fri Jun 15 12:26:29 2007 +0000
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,105 +0,0 @@
     4.4 -/*
     4.5 -    SDL - Simple DirectMedia Layer
     4.6 -    Copyright (C) 1997-2006 Sam Lantinga
     4.7 -
     4.8 -    This library is free software; you can redistribute it and/or
     4.9 -    modify it under the terms of the GNU Lesser General Public
    4.10 -    License as published by the Free Software Foundation; either
    4.11 -    version 2.1 of the License, or (at your option) any later version.
    4.12 -
    4.13 -    This library is distributed in the hope that it will be useful,
    4.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
    4.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    4.16 -    Lesser General Public License for more details.
    4.17 -
    4.18 -    You should have received a copy of the GNU Lesser General Public
    4.19 -    License along with this library; if not, write to the Free Software
    4.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    4.21 -
    4.22 -    Sam Lantinga
    4.23 -    slouken@libsdl.org
    4.24 -*/
    4.25 -#include "SDL_config.h"
    4.26 -
    4.27 -/*
    4.28 -    SDL_sysmutex.cpp
    4.29 -
    4.30 -    Epoc version by Markus Mertama (w@iki.fi)
    4.31 -*/
    4.32 -
    4.33 -
    4.34 -/* Mutex functions using the Win32 API */
    4.35 -
    4.36 -#include<e32std.h>
    4.37 -
    4.38 -#include "SDL_error.h"
    4.39 -#include "SDL_mutex.h"
    4.40 -
    4.41 -
    4.42 -
    4.43 -struct SDL_mutex
    4.44 -    {
    4.45 -    TInt handle;
    4.46 -    };
    4.47 -
    4.48 -extern TInt CreateUnique(TInt (*aFunc)(const TDesC& aName, TAny*, TAny*), TAny*, TAny*);
    4.49 -
    4.50 -TInt NewMutex(const TDesC& aName, TAny* aPtr1, TAny*)
    4.51 -    {
    4.52 -    return ((RMutex*)aPtr1)->CreateGlobal(aName);
    4.53 -    }
    4.54 -
    4.55 -/* Create a mutex */
    4.56 -SDL_mutex *SDL_CreateMutex(void)
    4.57 -{
    4.58 -    RMutex rmutex;
    4.59 -
    4.60 -    TInt status = CreateUnique(NewMutex, &rmutex, NULL);
    4.61 -	if(status != KErrNone)
    4.62 -	    {
    4.63 -			SDL_SetError("Couldn't create mutex");
    4.64 -		}
    4.65 -    SDL_mutex* mutex = new /*(ELeave)*/ SDL_mutex;
    4.66 -    mutex->handle = rmutex.Handle();
    4.67 -	return(mutex);
    4.68 -}
    4.69 -
    4.70 -/* Free the mutex */
    4.71 -void SDL_DestroyMutex(SDL_mutex *mutex)
    4.72 -{
    4.73 -	if ( mutex ) 
    4.74 -	{
    4.75 -    RMutex rmutex;
    4.76 -    rmutex.SetHandle(mutex->handle);
    4.77 -	rmutex.Signal();
    4.78 -	rmutex.Close();
    4.79 -	delete(mutex);
    4.80 -    mutex = NULL;
    4.81 -	}
    4.82 -}
    4.83 -
    4.84 -/* Lock the mutex */
    4.85 -int SDL_mutexP(SDL_mutex *mutex)
    4.86 -{
    4.87 -	if ( mutex == NULL ) {
    4.88 -		SDL_SetError("Passed a NULL mutex");
    4.89 -		return -1;
    4.90 -	}
    4.91 -    RMutex rmutex;
    4.92 -    rmutex.SetHandle(mutex->handle);
    4.93 -	rmutex.Wait(); 
    4.94 -	return(0);
    4.95 -}
    4.96 -
    4.97 -/* Unlock the mutex */
    4.98 -int SDL_mutexV(SDL_mutex *mutex)
    4.99 -{
   4.100 -	if ( mutex == NULL ) {
   4.101 -		SDL_SetError("Passed a NULL mutex");
   4.102 -		return -1;
   4.103 -	}
   4.104 -	RMutex rmutex;
   4.105 -    rmutex.SetHandle(mutex->handle);
   4.106 -	rmutex.Signal();
   4.107 -	return(0);
   4.108 -}
     5.1 --- a/src/thread/epoc/SDL_syssem.cpp	Fri Jun 15 12:26:29 2007 +0000
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,193 +0,0 @@
     5.4 -/*
     5.5 -    SDL - Simple DirectMedia Layer
     5.6 -    Copyright (C) 1997-2006 Sam Lantinga
     5.7 -
     5.8 -    This library is free software; you can redistribute it and/or
     5.9 -    modify it under the terms of the GNU Lesser General Public
    5.10 -    License as published by the Free Software Foundation; either
    5.11 -    version 2.1 of the License, or (at your option) any later version.
    5.12 -
    5.13 -    This library is distributed in the hope that it will be useful,
    5.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
    5.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    5.16 -    Lesser General Public License for more details.
    5.17 -
    5.18 -    You should have received a copy of the GNU Lesser General Public
    5.19 -    License along with this library; if not, write to the Free Software
    5.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    5.21 -
    5.22 -    Sam Lantinga
    5.23 -    slouken@libsdl.org
    5.24 -*/
    5.25 -#include "SDL_config.h"
    5.26 -
    5.27 -/*
    5.28 -    SDL_syssem.cpp
    5.29 -
    5.30 -    Epoc version by Markus Mertama  (w@iki.fi)
    5.31 -*/
    5.32 -
    5.33 -/* Semaphore functions using the Win32 API */
    5.34 -
    5.35 -#include <e32std.h>
    5.36 -
    5.37 -#include "SDL_error.h"
    5.38 -#include "SDL_thread.h"
    5.39 -
    5.40 -
    5.41 -#define SDL_MUTEX_TIMEOUT -2
    5.42 -
    5.43 -struct SDL_semaphore
    5.44 - {
    5.45 - TInt handle;
    5.46 - TInt count;
    5.47 - };
    5.48 -
    5.49 -extern TInt CreateUnique(TInt (*aFunc)(const TDesC& aName, TAny*, TAny*), TAny*, TAny*);
    5.50 -extern TInt NewThread(const TDesC& aName, TAny* aPtr1, TAny* aPtr2);
    5.51 -
    5.52 -TInt NewSema(const TDesC& aName, TAny* aPtr1, TAny* aPtr2) 
    5.53 -    {
    5.54 -    TInt value = *((TInt*) aPtr2);
    5.55 -    return ((RSemaphore*)aPtr1)->CreateGlobal(aName, value);
    5.56 -    }
    5.57 -
    5.58 -/* Create a semaphore */
    5.59 -SDL_sem *SDL_CreateSemaphore(Uint32 initial_value)
    5.60 -{
    5.61 -   RSemaphore s;
    5.62 -   TInt status = CreateUnique(NewSema, &s, &initial_value);
    5.63 -   if(status != KErrNone)
    5.64 -	 {
    5.65 -			SDL_SetError("Couldn't create semaphore");
    5.66 -	}
    5.67 -    SDL_semaphore* sem = new /*(ELeave)*/ SDL_semaphore;  
    5.68 -    sem->handle = s.Handle();
    5.69 -	sem->count = initial_value;
    5.70 -	return(sem);
    5.71 -}
    5.72 -
    5.73 -/* Free the semaphore */
    5.74 -void SDL_DestroySemaphore(SDL_sem *sem)
    5.75 -{
    5.76 -	if ( sem ) 
    5.77 -	{
    5.78 -    RSemaphore sema;
    5.79 -    sema.SetHandle(sem->handle);
    5.80 -	sema.Signal(sema.Count());
    5.81 -    sema.Close();
    5.82 -    delete sem;
    5.83 -	sem = NULL;
    5.84 -	}
    5.85 -}
    5.86 -
    5.87 -
    5.88 -  struct TInfo
    5.89 -    {
    5.90 -        TInfo(TInt aTime, TInt aHandle) : 
    5.91 -        iTime(aTime), iHandle(aHandle), iVal(0) {}
    5.92 -        TInt iTime;
    5.93 -        TInt iHandle;
    5.94 -        TInt iVal; 
    5.95 -    };
    5.96 -
    5.97 -TBool ThreadRun(TAny* aInfo)
    5.98 -    {
    5.99 -        TInfo* info = STATIC_CAST(TInfo*, aInfo);
   5.100 -        User::After(info->iTime);
   5.101 -        RSemaphore sema;
   5.102 -        sema.SetHandle(info->iHandle);
   5.103 -        sema.Signal();
   5.104 -        info->iVal = SDL_MUTEX_TIMEOUT;
   5.105 -        return 0;
   5.106 -    }
   5.107 -    
   5.108 -  
   5.109 -    
   5.110 -    
   5.111 -void _WaitAll(SDL_sem *sem)
   5.112 -    {
   5.113 -       //since SemTryWait may changed the counter.
   5.114 -       //this may not be atomic, but hopes it works.
   5.115 -    RSemaphore sema;
   5.116 -    sema.SetHandle(sem->handle);
   5.117 -    sema.Wait();
   5.118 -    while(sem->count < 0)
   5.119 -        {
   5.120 -        sema.Wait();
   5.121 -        }    
   5.122 -    }
   5.123 -
   5.124 -int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
   5.125 -{
   5.126 -	if ( ! sem ) {
   5.127 -		SDL_SetError("Passed a NULL sem");
   5.128 -		return -1;
   5.129 -	}
   5.130 -
   5.131 -	if ( timeout == SDL_MUTEX_MAXWAIT )
   5.132 -	    {
   5.133 -	    _WaitAll(sem);
   5.134 -		return SDL_MUTEX_MAXWAIT;
   5.135 -	    } 
   5.136 -	
   5.137 -	
   5.138 -	RThread thread;
   5.139 -	
   5.140 -	TInfo* info = new (ELeave)TInfo(timeout, sem->handle);
   5.141 -	
   5.142 -    TInt status = CreateUnique(NewThread, &thread, info);
   5.143 -  
   5.144 -	if(status != KErrNone)
   5.145 -	    return status;
   5.146 -	
   5.147 -	thread.Resume();
   5.148 -	
   5.149 -	_WaitAll(sem);
   5.150 -	
   5.151 -	if(thread.ExitType() == EExitPending)
   5.152 -	    {
   5.153 -	        thread.Kill(SDL_MUTEX_TIMEOUT);
   5.154 -	    }
   5.155 -	
   5.156 -	thread.Close();
   5.157 -	
   5.158 -	return info->iVal;
   5.159 -}
   5.160 -
   5.161 -int SDL_SemTryWait(SDL_sem *sem)
   5.162 -{
   5.163 -    if(sem->count > 0)
   5.164 -        {
   5.165 -        sem->count--;
   5.166 -        }
   5.167 -    return SDL_MUTEX_TIMEOUT;
   5.168 -}
   5.169 -
   5.170 -int SDL_SemWait(SDL_sem *sem)
   5.171 -{
   5.172 -	return SDL_SemWaitTimeout(sem, SDL_MUTEX_MAXWAIT);
   5.173 -}
   5.174 -
   5.175 -/* Returns the current count of the semaphore */
   5.176 -Uint32 SDL_SemValue(SDL_sem *sem)
   5.177 -{
   5.178 -	if ( ! sem ) {
   5.179 -		SDL_SetError("Passed a NULL sem");
   5.180 -		return 0;
   5.181 -	}
   5.182 -	return sem->count;
   5.183 -}
   5.184 -
   5.185 -int SDL_SemPost(SDL_sem *sem)
   5.186 -{
   5.187 -	if ( ! sem ) {
   5.188 -		SDL_SetError("Passed a NULL sem");
   5.189 -		return -1;
   5.190 -	}
   5.191 -	sem->count++;
   5.192 -    RSemaphore sema;
   5.193 -    sema.SetHandle(sem->handle);
   5.194 -	sema.Signal();
   5.195 -	return 0;
   5.196 -}
     6.1 --- a/src/thread/epoc/SDL_systhread.cpp	Fri Jun 15 12:26:29 2007 +0000
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,124 +0,0 @@
     6.4 -/*
     6.5 -    SDL - Simple DirectMedia Layer
     6.6 -    Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002  Sam Lantinga
     6.7 -
     6.8 -    This library is free software; you can redistribute it and/or
     6.9 -    modify it under the terms of the GNU Library General Public
    6.10 -    License as published by the Free Software Foundation; either
    6.11 -    version 2 of the License, or (at your option) any later version.
    6.12 -
    6.13 -    This library is distributed in the hope that it will be useful,
    6.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
    6.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    6.16 -    Library General Public License for more details.
    6.17 -
    6.18 -    You should have received a copy of the GNU Library General Public
    6.19 -    License along with this library; if not, write to the Free
    6.20 -    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    6.21 -
    6.22 -    Sam Lantinga
    6.23 -    slouken@libsdl.org
    6.24 -*/
    6.25 -#include "SDL_config.h"
    6.26 -
    6.27 -/*
    6.28 -    SDL_systhread.cpp
    6.29 -    Epoc thread management routines for SDL
    6.30 -
    6.31 -    Epoc version by Markus Mertama  (w@iki.fi)
    6.32 -*/
    6.33 -
    6.34 -
    6.35 -extern "C" {
    6.36 -#undef NULL
    6.37 -#include "SDL_error.h"
    6.38 -#include "SDL_thread.h"
    6.39 -#include "../SDL_systhread.h"
    6.40 -    };
    6.41 -
    6.42 -#include <e32std.h>
    6.43 -
    6.44 -
    6.45 -static int object_count;
    6.46 -
    6.47 -int RunThread(TAny* data)
    6.48 -{
    6.49 -	SDL_RunThread(data);
    6.50 -	return(0);
    6.51 -}
    6.52 -
    6.53 -
    6.54 -TInt NewThread(const TDesC& aName, TAny* aPtr1, TAny* aPtr2)
    6.55 -    {
    6.56 -    return ((RThread*)(aPtr1))->Create(aName,
    6.57 -            RunThread,
    6.58 -            KDefaultStackSize,
    6.59 -            NULL,
    6.60 -            aPtr2);
    6.61 -    }
    6.62 -
    6.63 -int CreateUnique(TInt (*aFunc)(const TDesC& aName, TAny*, TAny*), TAny* aPtr1, TAny* aPtr2)
    6.64 -    {
    6.65 -    TBuf<16> name;
    6.66 -    TInt status = KErrNone;
    6.67 -    do
    6.68 -        {
    6.69 -        object_count++;
    6.70 -        name.Format(_L("SDL_%x"), object_count);
    6.71 -        status = aFunc(name, aPtr1, aPtr2);
    6.72 -        }
    6.73 -        while(status == KErrAlreadyExists);
    6.74 -    return status;
    6.75 -    }
    6.76 -
    6.77 -
    6.78 -int SDL_SYS_CreateThread(SDL_Thread *thread, void *args)
    6.79 -{
    6.80 -    RThread rthread;
    6.81 -   
    6.82 -    TInt status = CreateUnique(NewThread, &rthread, args);
    6.83 -    if (status != KErrNone) 
    6.84 -    {
    6.85 -        delete(((RThread*)(thread->handle)));
    6.86 -        thread->handle = NULL;
    6.87 -		SDL_SetError("Not enough resources to create thread");
    6.88 -		return(-1);
    6.89 -	}
    6.90 -	rthread.Resume();
    6.91 -    thread->handle = rthread.Handle();
    6.92 -	return(0);
    6.93 -}
    6.94 -
    6.95 -void SDL_SYS_SetupThread(void)
    6.96 -{
    6.97 -	return;
    6.98 -}
    6.99 -
   6.100 -Uint32 SDL_ThreadID(void)
   6.101 -{
   6.102 -    RThread current;
   6.103 -    TThreadId id = current.Id();
   6.104 -	return id;
   6.105 -}
   6.106 -
   6.107 -void SDL_SYS_WaitThread(SDL_Thread *thread)
   6.108 -{
   6.109 -    RUndertaker taker;
   6.110 -    taker.Create();
   6.111 -    TRequestStatus status;
   6.112 -    taker.Logon(status, thread->handle);
   6.113 -    User::WaitForRequest(status);
   6.114 -    taker.Close();
   6.115 -}
   6.116 -
   6.117 -/* WARNING: This function is really a last resort.
   6.118 - * Threads should be signaled and then exit by themselves.
   6.119 - * TerminateThread() doesn't perform stack and DLL cleanup.
   6.120 - */
   6.121 -void SDL_SYS_KillThread(SDL_Thread *thread)
   6.122 -{
   6.123 -    RThread rthread;
   6.124 -    rthread.SetHandle(thread->handle);
   6.125 -	rthread.Kill(0);
   6.126 -	rthread.Close();
   6.127 -}
     7.1 --- a/src/thread/epoc/SDL_systhread_c.h	Fri Jun 15 12:26:29 2007 +0000
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,31 +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 -/*
    7.28 -    SDL_systhread_c.h
    7.29 -
    7.30 -    Epoc version by Markus Mertama (w@iki.fi)
    7.31 -*/
    7.32 -
    7.33 -typedef int SYS_ThreadHandle;
    7.34 -
     8.1 --- a/src/timer/epoc/SDL_systimer.cpp	Fri Jun 15 12:26:29 2007 +0000
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,116 +0,0 @@
     8.4 -/*
     8.5 -    SDL - Simple DirectMedia Layer
     8.6 -    Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002  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 Library General Public
    8.10 -    License as published by the Free Software Foundation; either
    8.11 -    version 2 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 -    Library General Public License for more details.
    8.17 -
    8.18 -    You should have received a copy of the GNU Library General Public
    8.19 -    License along with this library; if not, write to the Free
    8.20 -    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    8.21 -
    8.22 -    Sam Lantinga
    8.23 -    slouken@libsdl.org
    8.24 -*/
    8.25 -#include "SDL_config.h"
    8.26 -
    8.27 -#ifdef SDL_TIMER_EPOC
    8.28 -
    8.29 -/*
    8.30 -    SDL_systimer.cpp
    8.31 -
    8.32 -    Epoc version by Hannu Viitala (hannu.j.viitala@mbnet.fi)
    8.33 -*/
    8.34 -
    8.35 -#include <e32std.h>
    8.36 -#include <e32hal.h>
    8.37 -
    8.38 -extern "C" {
    8.39 -#include "SDL_error.h"
    8.40 -#include "SDL_thread.h"
    8.41 -#include "SDL_timer.h"
    8.42 -#include "../SDL_timer_c.h"
    8.43 -
    8.44 -static TUint start = 0;
    8.45 -static TInt tickPeriodMilliSeconds;
    8.46 -
    8.47 -
    8.48 -void SDL_StartTicks(void)
    8.49 -{
    8.50 -	/* Set first ticks value */
    8.51 -    start = User::TickCount();
    8.52 -
    8.53 -    TTimeIntervalMicroSeconds32 period;
    8.54 -	TInt tmp = UserHal::TickPeriod(period);
    8.55 -    tickPeriodMilliSeconds = period.Int() / 1000;
    8.56 -}
    8.57 -
    8.58 -Uint32 SDL_GetTicks(void)
    8.59 -{
    8.60 -    TUint deltaTics = User::TickCount() - start;
    8.61 -	return(deltaTics * tickPeriodMilliSeconds); 
    8.62 -}
    8.63 -
    8.64 -void SDL_Delay(Uint32 ms)
    8.65 -{
    8.66 -     
    8.67 -    User::After(TTimeIntervalMicroSeconds32(ms*1000));
    8.68 -}
    8.69 -
    8.70 -/* Data to handle a single periodic alarm */
    8.71 -static int timer_alive = 0;
    8.72 -static SDL_Thread *timer = NULL;
    8.73 -
    8.74 -static int RunTimer(void *unused)
    8.75 -{
    8.76 -	Uint32 ms;
    8.77 -
    8.78 -	while ( timer_alive ) {
    8.79 -		if ( SDL_timer_running ) {
    8.80 -			SDL_ThreadedTimerCheck();
    8.81 -		}
    8.82 -		SDL_Delay(10);
    8.83 -	}
    8.84 -	return(0);
    8.85 -}
    8.86 -
    8.87 -/* This is only called if the event thread is not running */
    8.88 -int SDL_SYS_TimerInit(void)
    8.89 -{
    8.90 -	timer_alive = 1;
    8.91 -	timer = SDL_CreateThread(RunTimer, NULL);
    8.92 -	if ( timer == NULL )
    8.93 -		return(-1);
    8.94 -	return(SDL_SetTimerThreaded(1));
    8.95 -}
    8.96 -
    8.97 -void SDL_SYS_TimerQuit(void)
    8.98 -{
    8.99 -	timer_alive = 0;
   8.100 -	if ( timer ) {
   8.101 -		SDL_WaitThread(timer, NULL);
   8.102 -		timer = NULL;
   8.103 -	}
   8.104 -}
   8.105 -
   8.106 -int SDL_SYS_StartTimer(void)
   8.107 -{
   8.108 -	SDL_SetError("Internal logic error: Epoc uses threaded timer");
   8.109 -	return(-1);
   8.110 -}
   8.111 -
   8.112 -void SDL_SYS_StopTimer(void)
   8.113 -{
   8.114 -	return;
   8.115 -}
   8.116 -
   8.117 -}; // extern "C"
   8.118 -
   8.119 -#endif /* SDL_TIMER_EPOC */
     9.1 --- a/src/video/epoc/SDL_epocevents.cpp	Fri Jun 15 12:26:29 2007 +0000
     9.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.3 @@ -1,419 +0,0 @@
     9.4 -/*
     9.5 -    SDL - Simple DirectMedia Layer
     9.6 -    Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002  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 Library General Public
    9.10 -    License as published by the Free Software Foundation; either
    9.11 -    version 2 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 -    Library General Public License for more details.
    9.17 -
    9.18 -    You should have received a copy of the GNU Library General Public
    9.19 -    License along with this library; if not, write to the Free
    9.20 -    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    9.21 -
    9.22 -    Sam Lantinga
    9.23 -    slouken@libsdl.org
    9.24 -*/
    9.25 -#include "SDL_config.h"
    9.26 -
    9.27 -/*
    9.28 -    SDL_epocevents.cpp
    9.29 -    Handle the event stream, converting Epoc events into SDL events
    9.30 -
    9.31 -    Epoc version by Hannu Viitala (hannu.j.viitala@mbnet.fi)
    9.32 -*/
    9.33 -
    9.34 -
    9.35 -#include <stdio.h>
    9.36 -#undef NULL
    9.37 -
    9.38 -extern "C" {
    9.39 -#include "SDL_error.h"
    9.40 -#include "SDL_video.h"
    9.41 -#include "SDL_keysym.h"
    9.42 -#include "SDL_keyboard.h"
    9.43 -#include "SDL_timer.h"
    9.44 -#include "../../events/SDL_events_c.h"
    9.45 -}; /* extern "C" */
    9.46 -
    9.47 -#include "SDL_epocvideo.h"
    9.48 -#include "SDL_epocevents_c.h"
    9.49 -
    9.50 -#include <hal.h>
    9.51 -
    9.52 -extern "C" {
    9.53 -/* The translation tables from a console scancode to a SDL keysym */
    9.54 -static SDLKey keymap[MAX_SCANCODE];
    9.55 -static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym);
    9.56 -}; /* extern "C" */
    9.57 -
    9.58 -TBool isCursorVisible = ETrue;
    9.59 -
    9.60 -int EPOC_HandleWsEvent(_THIS, const TWsEvent& aWsEvent)
    9.61 -{
    9.62 -    int posted = 0;
    9.63 -    SDL_keysym keysym;
    9.64 -
    9.65 -
    9.66 -    switch (aWsEvent.Type()) {
    9.67 -    
    9.68 -    case EEventPointer: /* Mouse pointer events */
    9.69 -    {
    9.70 -        const TPointerEvent* pointerEvent = aWsEvent.Pointer();
    9.71 -        TPoint mousePos = pointerEvent->iPosition;
    9.72 -
    9.73 -        //SDL_TRACE1("SDL: EPOC_HandleWsEvent, pointerEvent->iType=%d", pointerEvent->iType); //!!
    9.74 -
    9.75 -        if (Private->EPOC_ShrinkedHeight) {
    9.76 -            mousePos.iY <<= 1; /* Scale y coordinate to shrinked screen height */
    9.77 -        }
    9.78 -		posted += SDL_PrivateMouseMotion(0, 0, mousePos.iX, mousePos.iY); /* Absolute position on screen */
    9.79 -        if (pointerEvent->iType==TPointerEvent::EButton1Down) {
    9.80 -            posted += SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_LEFT, 0, 0);
    9.81 -        }
    9.82 -        else if (pointerEvent->iType==TPointerEvent::EButton1Up) {
    9.83 -			posted += SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_LEFT, 0, 0);
    9.84 -        }
    9.85 -        else if (pointerEvent->iType==TPointerEvent::EButton2Down) {
    9.86 -            posted += SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_RIGHT, 0, 0);
    9.87 -        }
    9.88 -        else if (pointerEvent->iType==TPointerEvent::EButton2Up) {
    9.89 -			posted += SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_RIGHT, 0, 0);
    9.90 -        }
    9.91 -	    //!!posted += SDL_PrivateKeyboard(SDL_PRESSED, TranslateKey(aWsEvent.Key()->iScanCode, &keysym));
    9.92 -        break;
    9.93 -    }
    9.94 -    
    9.95 -    case EEventKeyDown: /* Key events */
    9.96 -    {
    9.97 -       (void*)TranslateKey(aWsEvent.Key()->iScanCode, &keysym);
    9.98 -        
    9.99 -        /* Special handling */
   9.100 -        switch((int)keysym.sym) {
   9.101 -        case SDLK_CAPSLOCK:
   9.102 -            if (!isCursorVisible) {
   9.103 -                /* Enable virtual cursor */
   9.104 -	            HAL::Set(HAL::EMouseState, HAL::EMouseState_Visible);
   9.105 -            }
   9.106 -            else {
   9.107 -                /* Disable virtual cursor */
   9.108 -                HAL::Set(HAL::EMouseState, HAL::EMouseState_Invisible);
   9.109 -            }
   9.110 -            isCursorVisible = !isCursorVisible;
   9.111 -            break;
   9.112 -        }
   9.113 -        
   9.114 -	    posted += SDL_PrivateKeyboard(SDL_PRESSED, &keysym);
   9.115 -        break;
   9.116 -	} 
   9.117 -
   9.118 -    case EEventKeyUp: /* Key events */
   9.119 -    {
   9.120 -	    posted += SDL_PrivateKeyboard(SDL_RELEASED, TranslateKey(aWsEvent.Key()->iScanCode, &keysym));
   9.121 -        break;
   9.122 -	} 
   9.123 -    
   9.124 -    case EEventFocusGained: /* SDL window got focus */
   9.125 -    {
   9.126 -        //Private->EPOC_IsWindowFocused = ETrue;
   9.127 -        /* Draw window background and screen buffer */
   9.128 -        RedrawWindowL(_this);  
   9.129 -        break;
   9.130 -    }
   9.131 -
   9.132 -    case EEventFocusLost: /* SDL window lost focus */
   9.133 -    {
   9.134 -        //Private->EPOC_IsWindowFocused = EFalse;
   9.135 -
   9.136 -        // Wait and eat events until focus is gained again
   9.137 -        /*
   9.138 -	    while (ETrue) {
   9.139 -            Private->EPOC_WsSession.EventReady(&Private->EPOC_WsEventStatus);
   9.140 -            User::WaitForRequest(Private->EPOC_WsEventStatus);
   9.141 -		    Private->EPOC_WsSession.GetEvent(Private->EPOC_WsEvent);
   9.142 -            TInt eventType = Private->EPOC_WsEvent.Type();
   9.143 -		    Private->EPOC_WsEventStatus = KRequestPending;
   9.144 -		    //Private->EPOC_WsSession.EventReady(&Private->EPOC_WsEventStatus);
   9.145 -            if (eventType == EEventFocusGained) {
   9.146 -                RedrawWindowL(_this);
   9.147 -                break;
   9.148 -            }
   9.149 -	    }
   9.150 -        */
   9.151 -        break;
   9.152 -    }
   9.153 -
   9.154 -    case EEventModifiersChanged: 
   9.155 -    {
   9.156 -	    TModifiersChangedEvent* modEvent = aWsEvent.ModifiersChanged();
   9.157 -        TUint modstate = KMOD_NONE;
   9.158 -        if (modEvent->iModifiers == EModifierLeftShift)
   9.159 -            modstate |= KMOD_LSHIFT;
   9.160 -        if (modEvent->iModifiers == EModifierRightShift)
   9.161 -            modstate |= KMOD_RSHIFT;
   9.162 -        if (modEvent->iModifiers == EModifierLeftCtrl)
   9.163 -            modstate |= KMOD_LCTRL;
   9.164 -        if (modEvent->iModifiers == EModifierRightCtrl)
   9.165 -            modstate |= KMOD_RCTRL;
   9.166 -        if (modEvent->iModifiers == EModifierLeftAlt)
   9.167 -            modstate |= KMOD_LALT;
   9.168 -        if (modEvent->iModifiers == EModifierRightAlt)
   9.169 -            modstate |= KMOD_RALT;
   9.170 -        if (modEvent->iModifiers == EModifierLeftFunc)
   9.171 -            modstate |= KMOD_LMETA;
   9.172 -        if (modEvent->iModifiers == EModifierRightFunc)
   9.173 -            modstate |= KMOD_RMETA;
   9.174 -        if (modEvent->iModifiers == EModifierCapsLock)
   9.175 -            modstate |= KMOD_CAPS;
   9.176 -        SDL_SetModState(STATIC_CAST(SDLMod,(modstate | KMOD_LSHIFT)));
   9.177 -        break;
   9.178 -    }
   9.179 -    default:            
   9.180 -        break;
   9.181 -	} 
   9.182 -	
   9.183 -    return posted;
   9.184 -}
   9.185 -
   9.186 -extern "C" {
   9.187 -
   9.188 -void EPOC_PumpEvents(_THIS)
   9.189 -{
   9.190 -    int posted = 0; // !! Do we need this?
   9.191 -    //Private->EPOC_WsSession.EventReady(&Private->EPOC_WsEventStatus);
   9.192 -	while (Private->EPOC_WsEventStatus != KRequestPending) {
   9.193 -
   9.194 -		Private->EPOC_WsSession.GetEvent(Private->EPOC_WsEvent);
   9.195 -		posted = EPOC_HandleWsEvent(_this, Private->EPOC_WsEvent);
   9.196 -		Private->EPOC_WsEventStatus = KRequestPending;
   9.197 -		Private->EPOC_WsSession.EventReady(&Private->EPOC_WsEventStatus);
   9.198 -	}
   9.199 -}
   9.200 -
   9.201 -
   9.202 -void EPOC_InitOSKeymap(_THIS)
   9.203 -{
   9.204 -	int i;
   9.205 -
   9.206 -	/* Initialize the key translation table */
   9.207 -	for ( i=0; i<SDL_TABLESIZE(keymap); ++i )
   9.208 -		keymap[i] = SDLK_UNKNOWN;
   9.209 -
   9.210 -
   9.211 -	/* Numbers */
   9.212 -	for ( i = 0; i<32; ++i ){
   9.213 -		keymap[' ' + i] = (SDLKey)(SDLK_SPACE+i);
   9.214 -	}
   9.215 -	/* e.g. Alphabet keys */
   9.216 -	for ( i = 0; i<32; ++i ){
   9.217 -		keymap['A' + i] = (SDLKey)(SDLK_a+i);
   9.218 -	}
   9.219 -
   9.220 -	keymap[EStdKeyBackspace]    = SDLK_BACKSPACE;
   9.221 -	keymap[EStdKeyTab]          = SDLK_TAB;
   9.222 -	keymap[EStdKeyEnter]        = SDLK_RETURN;
   9.223 -	keymap[EStdKeyEscape]       = SDLK_ESCAPE;
   9.224 -   	keymap[EStdKeySpace]        = SDLK_SPACE;
   9.225 -   	keymap[EStdKeyPause]        = SDLK_PAUSE;
   9.226 -   	keymap[EStdKeyHome]         = SDLK_HOME;
   9.227 -   	keymap[EStdKeyEnd]          = SDLK_END;
   9.228 -   	keymap[EStdKeyPageUp]       = SDLK_PAGEUP;
   9.229 -   	keymap[EStdKeyPageDown]     = SDLK_PAGEDOWN;
   9.230 -	keymap[EStdKeyDelete]       = SDLK_DELETE;
   9.231 -	keymap[EStdKeyUpArrow]      = SDLK_UP;
   9.232 -	keymap[EStdKeyDownArrow]    = SDLK_DOWN;
   9.233 -	keymap[EStdKeyLeftArrow]    = SDLK_LEFT;
   9.234 -	keymap[EStdKeyRightArrow]   = SDLK_RIGHT;
   9.235 -	keymap[EStdKeyCapsLock]     = SDLK_CAPSLOCK;
   9.236 -	keymap[EStdKeyLeftShift]    = SDLK_LSHIFT;
   9.237 -	keymap[EStdKeyRightShift]   = SDLK_RSHIFT;
   9.238 -	keymap[EStdKeyLeftAlt]      = SDLK_LALT;
   9.239 -	keymap[EStdKeyRightAlt]     = SDLK_RALT;
   9.240 -	keymap[EStdKeyLeftCtrl]     = SDLK_LCTRL;
   9.241 -	keymap[EStdKeyRightCtrl]    = SDLK_RCTRL;
   9.242 -	keymap[EStdKeyLeftFunc]     = SDLK_LMETA;
   9.243 -	keymap[EStdKeyRightFunc]    = SDLK_RMETA;
   9.244 -	keymap[EStdKeyInsert]       = SDLK_INSERT;
   9.245 -	keymap[EStdKeyComma]        = SDLK_COMMA;
   9.246 -	keymap[EStdKeyFullStop]     = SDLK_PERIOD;
   9.247 -	keymap[EStdKeyForwardSlash] = SDLK_SLASH;
   9.248 -	keymap[EStdKeyBackSlash]    = SDLK_BACKSLASH;
   9.249 -	keymap[EStdKeySemiColon]    = SDLK_SEMICOLON;
   9.250 -	keymap[EStdKeySingleQuote]  = SDLK_QUOTE;
   9.251 -	keymap[EStdKeyHash]         = SDLK_HASH;
   9.252 -	keymap[EStdKeySquareBracketLeft]    = SDLK_LEFTBRACKET;
   9.253 -	keymap[EStdKeySquareBracketRight]   = SDLK_RIGHTBRACKET;
   9.254 -	keymap[EStdKeyMinus]        = SDLK_MINUS;
   9.255 -	keymap[EStdKeyEquals]       = SDLK_EQUALS;
   9.256 -
   9.257 -   	keymap[EStdKeyF1]          = SDLK_F1;  /* chr + q */
   9.258 -   	keymap[EStdKeyF2]          = SDLK_F2;  /* chr + w */
   9.259 -   	keymap[EStdKeyF3]          = SDLK_F3;  /* chr + e */
   9.260 -   	keymap[EStdKeyF4]          = SDLK_F4;  /* chr + r */
   9.261 -   	keymap[EStdKeyF5]          = SDLK_F5;  /* chr + t */
   9.262 -   	keymap[EStdKeyF6]          = SDLK_F6;  /* chr + y */
   9.263 -   	keymap[EStdKeyF7]          = SDLK_F7;  /* chr + i */
   9.264 -   	keymap[EStdKeyF8]          = SDLK_F8;  /* chr + o */
   9.265 -
   9.266 -   	keymap[EStdKeyF9]          = SDLK_F9;  /* chr + a */
   9.267 -   	keymap[EStdKeyF10]         = SDLK_F10; /* chr + s */
   9.268 -   	keymap[EStdKeyF11]         = SDLK_F11; /* chr + d */
   9.269 -   	keymap[EStdKeyF12]         = SDLK_F12; /* chr + f */
   9.270 -
   9.271 -    /* !!TODO
   9.272 -	EStdKeyNumLock=0x1b,
   9.273 -	EStdKeyScrollLock=0x1c,
   9.274 -
   9.275 -	EStdKeyNkpForwardSlash=0x84,
   9.276 -	EStdKeyNkpAsterisk=0x85,
   9.277 -	EStdKeyNkpMinus=0x86,
   9.278 -	EStdKeyNkpPlus=0x87,
   9.279 -	EStdKeyNkpEnter=0x88,
   9.280 -	EStdKeyNkp1=0x89,
   9.281 -	EStdKeyNkp2=0x8a,
   9.282 -	EStdKeyNkp3=0x8b,
   9.283 -	EStdKeyNkp4=0x8c,
   9.284 -	EStdKeyNkp5=0x8d,
   9.285 -	EStdKeyNkp6=0x8e,
   9.286 -	EStdKeyNkp7=0x8f,
   9.287 -	EStdKeyNkp8=0x90,
   9.288 -	EStdKeyNkp9=0x91,
   9.289 -	EStdKeyNkp0=0x92,
   9.290 -	EStdKeyNkpFullStop=0x93,
   9.291 -    EStdKeyMenu=0x94,
   9.292 -    EStdKeyBacklightOn=0x95,
   9.293 -    EStdKeyBacklightOff=0x96,
   9.294 -    EStdKeyBacklightToggle=0x97,
   9.295 -    EStdKeyIncContrast=0x98,
   9.296 -    EStdKeyDecContrast=0x99,
   9.297 -    EStdKeySliderDown=0x9a,
   9.298 -    EStdKeySliderUp=0x9b,
   9.299 -    EStdKeyDictaphonePlay=0x9c,
   9.300 -    EStdKeyDictaphoneStop=0x9d,
   9.301 -    EStdKeyDictaphoneRecord=0x9e,
   9.302 -    EStdKeyHelp=0x9f,
   9.303 -    EStdKeyOff=0xa0,
   9.304 -    EStdKeyDial=0xa1,
   9.305 -    EStdKeyIncVolume=0xa2,
   9.306 -    EStdKeyDecVolume=0xa3,
   9.307 -    EStdKeyDevice0=0xa4,
   9.308 -    EStdKeyDevice1=0xa5,
   9.309 -    EStdKeyDevice2=0xa6,
   9.310 -    EStdKeyDevice3=0xa7,
   9.311 -    EStdKeyDevice4=0xa8,
   9.312 -    EStdKeyDevice5=0xa9,
   9.313 -    EStdKeyDevice6=0xaa,
   9.314 -    EStdKeyDevice7=0xab,
   9.315 -    EStdKeyDevice8=0xac,
   9.316 -    EStdKeyDevice9=0xad,
   9.317 -    EStdKeyDeviceA=0xae,
   9.318 -    EStdKeyDeviceB=0xaf,
   9.319 -    EStdKeyDeviceC=0xb0,
   9.320 -    EStdKeyDeviceD=0xb1,
   9.321 -    EStdKeyDeviceE=0xb2,
   9.322 -    EStdKeyDeviceF=0xb3,
   9.323 -    EStdKeyApplication0=0xb4,
   9.324 -    EStdKeyApplication1=0xb5,
   9.325 -    EStdKeyApplication2=0xb6,
   9.326 -    EStdKeyApplication3=0xb7,
   9.327 -    EStdKeyApplication4=0xb8,
   9.328 -    EStdKeyApplication5=0xb9,
   9.329 -    EStdKeyApplication6=0xba,
   9.330 -    EStdKeyApplication7=0xbb,
   9.331 -    EStdKeyApplication8=0xbc,
   9.332 -    EStdKeyApplication9=0xbd,
   9.333 -    EStdKeyApplicationA=0xbe,
   9.334 -    EStdKeyApplicationB=0xbf,
   9.335 -    EStdKeyApplicationC=0xc0,
   9.336 -    EStdKeyApplicationD=0xc1,
   9.337 -    EStdKeyApplicationE=0xc2,
   9.338 -    EStdKeyApplicationF=0xc3,
   9.339 -    EStdKeyYes=0xc4,
   9.340 -    EStdKeyNo=0xc5,
   9.341 -    EStdKeyIncBrightness=0xc6,
   9.342 -    EStdKeyDecBrightness=0xc7, 
   9.343 -    EStdKeyCaseOpen=0xc8,
   9.344 -    EStdKeyCaseClose=0xc9
   9.345 -    */
   9.346 -
   9.347 -}
   9.348 -
   9.349 -
   9.350 -
   9.351 -static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym)
   9.352 -{
   9.353 -    char debug[256];
   9.354 -    //SDL_TRACE1("SDL: TranslateKey, scancode=%d", scancode); //!!
   9.355 -
   9.356 -	/* Set the keysym information */ 
   9.357 -
   9.358 -	keysym->scancode = scancode;
   9.359 -
   9.360 -    if ((scancode >= MAX_SCANCODE) && 
   9.361 -        ((scancode - ENonCharacterKeyBase + 0x0081) >= MAX_SCANCODE)) {
   9.362 -        SDL_SetError("Too big scancode");
   9.363 -        keysym->scancode = SDLK_UNKNOWN;
   9.364 -	    keysym->mod = KMOD_NONE; 
   9.365 -        return keysym;
   9.366 -    }
   9.367 -
   9.368 -	keysym->mod = SDL_GetModState(); //!!Is this right??
   9.369 -
   9.370 -    /* Handle function keys: F1, F2, F3 ... */
   9.371 -    if (keysym->mod & KMOD_META) {
   9.372 -        if (scancode >= 'A' && scancode < ('A' + 24)) { /* first 32 alphapet keys */
   9.373 -            switch(scancode) {
   9.374 -                case 'Q': scancode = EStdKeyF1; break;
   9.375 -                case 'W': scancode = EStdKeyF2; break;
   9.376 -                case 'E': scancode = EStdKeyF3; break;
   9.377 -                case 'R': scancode = EStdKeyF4; break;
   9.378 -                case 'T': scancode = EStdKeyF5; break;
   9.379 -                case 'Y': scancode = EStdKeyF6; break;
   9.380 -                case 'U': scancode = EStdKeyF7; break;
   9.381 -                case 'I': scancode = EStdKeyF8; break;
   9.382 -                case 'A': scancode = EStdKeyF9; break;
   9.383 -                case 'S': scancode = EStdKeyF10; break;
   9.384 -                case 'D': scancode = EStdKeyF11; break;
   9.385 -                case 'F': scancode = EStdKeyF12; break;
   9.386 -            }
   9.387 -            keysym->sym = keymap[scancode];
   9.388 -        }
   9.389 -    }
   9.390 -
   9.391 -    if (scancode >= ENonCharacterKeyBase) {
   9.392 -        // Non character keys
   9.393 -	    keysym->sym = keymap[scancode - 
   9.394 -            ENonCharacterKeyBase + 0x0081]; // !!hard coded
   9.395 -    } else {
   9.396 -	    keysym->sym = keymap[scancode];
   9.397 -    }
   9.398 -
   9.399 -
   9.400 -	/* If UNICODE is on, get the UNICODE value for the key */
   9.401 -	keysym->unicode = 0;
   9.402 -
   9.403 -#if 0 // !!TODO:unicode
   9.404 -
   9.405 -	if ( SDL_TranslateUNICODE ) 
   9.406 -    {
   9.407 -		/* Populate the unicode field with the ASCII value */
   9.408 -		keysym->unicode = scancode;
   9.409 -	}
   9.410 -#endif
   9.411 -
   9.412 -    //!!
   9.413 -    //sprintf(debug, "SDL: TranslateKey: keysym->scancode=%d, keysym->sym=%d, keysym->mod=%d",
   9.414 -    //    keysym->scancode, keysym->sym, keysym->mod);
   9.415 -    //SDL_TRACE(debug); //!!
   9.416 -
   9.417 -	return(keysym);
   9.418 -}
   9.419 -
   9.420 -}; /* extern "C" */
   9.421 -
   9.422 -
    10.1 --- a/src/video/epoc/SDL_epocevents_c.h	Fri Jun 15 12:26:29 2007 +0000
    10.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.3 @@ -1,46 +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 -/*
   10.28 -    SDL_epocevents_c.h
   10.29 -    Handle the event stream, converting Epoc events into SDL events
   10.30 -
   10.31 -    Epoc version by Hannu Viitala (hannu.j.viitala@mbnet.fi)
   10.32 -*/
   10.33 -
   10.34 -
   10.35 -extern "C" {
   10.36 -#include "../SDL_sysvideo.h"
   10.37 -};
   10.38 -
   10.39 -#define MAX_SCANCODE 255
   10.40 -
   10.41 -/* Variables and functions exported by SDL_sysevents.c to other parts 
   10.42 -   of the native video subsystem (SDL_sysvideo.c)
   10.43 -*/
   10.44 -
   10.45 -extern "C" {
   10.46 -extern void EPOC_InitOSKeymap(_THIS);
   10.47 -extern void EPOC_PumpEvents(_THIS);
   10.48 -};
   10.49 -
    11.1 --- a/src/video/epoc/SDL_epocvideo.cpp	Fri Jun 15 12:26:29 2007 +0000
    11.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.3 @@ -1,697 +0,0 @@
    11.4 -/*
    11.5 -    SDL - Simple DirectMedia Layer
    11.6 -    Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002  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 Library General Public
   11.10 -    License as published by the Free Software Foundation; either
   11.11 -    version 2 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 -    Library General Public License for more details.
   11.17 -
   11.18 -    You should have received a copy of the GNU Library General Public
   11.19 -    License along with this library; if not, write to the Free
   11.20 -    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   11.21 -
   11.22 -    Sam Lantinga
   11.23 -    slouken@libsdl.org
   11.24 -*/
   11.25 -#include "SDL_config.h"
   11.26 -
   11.27 -/*
   11.28 -    SDL_epocvideo.cpp
   11.29 -    Epoc based SDL video driver implementation
   11.30 -
   11.31 -    Epoc version by Hannu Viitala (hannu.j.viitala@mbnet.fi)
   11.32 -*/
   11.33 -
   11.34 -extern "C" {
   11.35 -#include "SDL_timer.h"
   11.36 -#include "SDL_video.h"
   11.37 -#undef NULL
   11.38 -#include "../SDL_pixels_c.h"
   11.39 -};
   11.40 -
   11.41 -#include "SDL_epocvideo.h"
   11.42 -#include "SDL_epocevents_c.h"
   11.43 -
   11.44 -#include <hal.h>
   11.45 -#include <coedef.h>
   11.46 -
   11.47 -/* For debugging */
   11.48 -
   11.49 -void RDebug_Print_b(char* error_str, void* param)
   11.50 -    {
   11.51 -    TBuf8<128> error8((TUint8*)error_str);
   11.52 -    TBuf<128> error;
   11.53 -    error.Copy(error8);
   11.54 -    if (param) //!! Do not work if the parameter is really 0!!
   11.55 -        RDebug::Print(error, param);
   11.56 -    else 
   11.57 -        RDebug::Print(error);
   11.58 -    }
   11.59 -
   11.60 -extern "C" void RDebug_Print(char* error_str, void* param)
   11.61 -    {
   11.62 -    RDebug_Print_b(error_str, param);
   11.63 -    }
   11.64 -
   11.65 -
   11.66 -int Debug_AvailMem2()
   11.67 -    {
   11.68 -    //User::CompressAllHeaps();
   11.69 -    TMemoryInfoV1Buf membuf; 
   11.70 -    User::LeaveIfError(UserHal::MemoryInfo(membuf));
   11.71 -    TMemoryInfoV1 minfo = membuf();
   11.72 -	return(minfo.iFreeRamInBytes);
   11.73 -    }
   11.74 -
   11.75 -extern "C" int Debug_AvailMem()
   11.76 -    {
   11.77 -    return(Debug_AvailMem2());
   11.78 -    }
   11.79 -
   11.80 -
   11.81 -extern "C" {
   11.82 -
   11.83 -/* Initialization/Query functions */
   11.84 -
   11.85 -static int EPOC_VideoInit(_THIS, SDL_PixelFormat *vformat);
   11.86 -static SDL_Rect **EPOC_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
   11.87 -static SDL_Surface *EPOC_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
   11.88 -static int EPOC_SetColors(_THIS, int firstcolor, int ncolors,
   11.89 -			  SDL_Color *colors);
   11.90 -static void EPOC_VideoQuit(_THIS);
   11.91 -
   11.92 -/* Hardware surface functions */
   11.93 -
   11.94 -static int EPOC_AllocHWSurface(_THIS, SDL_Surface *surface);
   11.95 -static int EPOC_LockHWSurface(_THIS, SDL_Surface *surface);
   11.96 -static int EPOC_FlipHWSurface(_THIS, SDL_Surface *surface);
   11.97 -static void EPOC_UnlockHWSurface(_THIS, SDL_Surface *surface);
   11.98 -static void EPOC_FreeHWSurface(_THIS, SDL_Surface *surface);
   11.99 -static void EPOC_DirectUpdate(_THIS, int numrects, SDL_Rect *rects);
  11.100 -
  11.101 -static int EPOC_Available(void);
  11.102 -static SDL_VideoDevice *EPOC_CreateDevice(int devindex);
  11.103 -
  11.104 -/* Mouse functions */
  11.105 -
  11.106 -static WMcursor *EPOC_CreateWMCursor(_THIS, Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
  11.107 -static void EPOC_FreeWMCursor(_THIS, WMcursor *cursor);
  11.108 -static int EPOC_ShowWMCursor(_THIS, WMcursor *cursor);
  11.109 -
  11.110 -
  11.111 -
  11.112 -/* !! Table for fast conversion from 8 bit to 12 bit */
  11.113 -static TUint16 EPOC_HWPalette_256_to_4k[256];
  11.114 -
  11.115 -VideoBootStrap EPOC_bootstrap = {
  11.116 -	"epoc", "EPOC system",
  11.117 -    EPOC_Available, EPOC_CreateDevice
  11.118 -};
  11.119 -
  11.120 -const TUint32 WindowClientHandle = 9210; //!!
  11.121 -
  11.122 -/* Epoc video driver bootstrap functions */
  11.123 -
  11.124 -static int EPOC_Available(void)
  11.125 -{
  11.126 -    return 1; /* Always available */
  11.127 -}
  11.128 -
  11.129 -static void EPOC_DeleteDevice(SDL_VideoDevice *device)
  11.130 -{
  11.131 -	SDL_free(device->hidden);
  11.132 -	SDL_free(device);
  11.133 -}
  11.134 -
  11.135 -static SDL_VideoDevice *EPOC_CreateDevice(int devindex)
  11.136 -{
  11.137 -	SDL_VideoDevice *device;
  11.138 -
  11.139 -	/* Allocate all variables that we free on delete */
  11.140 -	device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
  11.141 -	if ( device ) {
  11.142 -		SDL_memset(device, 0, (sizeof *device));
  11.143 -		device->hidden = (struct SDL_PrivateVideoData *)
  11.144 -				SDL_malloc((sizeof *device->hidden));
  11.145 -	}
  11.146 -	if ( (device == NULL) || (device->hidden == NULL) ) {
  11.147 -		SDL_OutOfMemory();
  11.148 -		if ( device ) {
  11.149 -			SDL_free(device);
  11.150 -		}
  11.151 -		return(0);
  11.152 -	}
  11.153 -	SDL_memset(device->hidden, 0, (sizeof *device->hidden));
  11.154 -
  11.155 -	/* Set the function pointers */
  11.156 -	device->VideoInit = EPOC_VideoInit;
  11.157 -	device->ListModes = EPOC_ListModes;
  11.158 -	device->SetVideoMode = EPOC_SetVideoMode;
  11.159 -	device->SetColors = EPOC_SetColors;
  11.160 -	device->UpdateRects = NULL;
  11.161 -	device->VideoQuit = EPOC_VideoQuit;
  11.162 -	device->AllocHWSurface = EPOC_AllocHWSurface;
  11.163 -	device->CheckHWBlit = NULL;
  11.164 -	device->FillHWRect = NULL;
  11.165 -	device->SetHWColorKey = NULL;
  11.166 -	device->SetHWAlpha = NULL;
  11.167 -	device->LockHWSurface = EPOC_LockHWSurface;
  11.168 -	device->UnlockHWSurface = EPOC_UnlockHWSurface;
  11.169 -	device->FlipHWSurface = EPOC_FlipHWSurface;
  11.170 -	device->FreeHWSurface = EPOC_FreeHWSurface;
  11.171 -	device->SetIcon = NULL;
  11.172 -	device->SetCaption = NULL;
  11.173 -	device->GetWMInfo = NULL;
  11.174 -	device->FreeWMCursor = EPOC_FreeWMCursor;
  11.175 -	device->CreateWMCursor = EPOC_CreateWMCursor;
  11.176 -	device->ShowWMCursor = EPOC_ShowWMCursor;
  11.177 -	device->WarpWMCursor = NULL;
  11.178 -	device->InitOSKeymap = EPOC_InitOSKeymap;
  11.179 -	device->PumpEvents = EPOC_PumpEvents;
  11.180 -	device->free = EPOC_DeleteDevice;
  11.181 -
  11.182 -	return device;
  11.183 -}
  11.184 -
  11.185 -
  11.186 -int GetBpp(TDisplayMode displaymode)
  11.187 -{
  11.188 -    TInt numColors = TDisplayModeUtils::NumDisplayModeColors(displaymode);
  11.189 -    TInt bitsPerPixel = 1;
  11.190 -    for (TInt32 i = 2; i < numColors; i <<= 1, bitsPerPixel++);
  11.191 -    return bitsPerPixel;    
  11.192 -}
  11.193 -
  11.194 -void ConstructWindowL(_THIS)
  11.195 -{
  11.196 -	TInt	error;
  11.197 -
  11.198 -	error = Private->EPOC_WsSession.Connect();
  11.199 -	User::LeaveIfError(error);
  11.200 -	Private->EPOC_WsScreen=new(ELeave) CWsScreenDevice(Private->EPOC_WsSession);
  11.201 -	User::LeaveIfError(Private->EPOC_WsScreen->Construct());
  11.202 -	User::LeaveIfError(Private->EPOC_WsScreen->CreateContext(Private->EPOC_WindowGc));
  11.203 -
  11.204 -	Private->EPOC_WsWindowGroup=RWindowGroup(Private->EPOC_WsSession);
  11.205 -	User::LeaveIfError(Private->EPOC_WsWindowGroup.Construct(WindowClientHandle));
  11.206 -	Private->EPOC_WsWindowGroup.SetOrdinalPosition(0);
  11.207 -
  11.208 -    //!!
  11.209 -    TBuf<32> winGroupName;
  11.210 -    winGroupName.Append(0);
  11.211 -    winGroupName.Append(0);
  11.212 -    winGroupName.Append(0);// uid
  11.213 -    winGroupName.Append(0);
  11.214 -    winGroupName.Append(_L("SDL")); // caption
  11.215 -    winGroupName.Append(0);
  11.216 -    winGroupName.Append(0); //doc name
  11.217 -	Private->EPOC_WsWindowGroup.SetName(winGroupName); //!!
  11.218 -
  11.219 -	Private->EPOC_WsWindow=RWindow(Private->EPOC_WsSession);
  11.220 -	User::LeaveIfError(Private->EPOC_WsWindow.Construct(Private->EPOC_WsWindowGroup,WindowClientHandle));
  11.221 -	Private->EPOC_WsWindow.SetBackgroundColor(KRgbWhite);
  11.222 -    Private->EPOC_WsWindow.Activate();
  11.223 -	Private->EPOC_WsWindow.SetSize(Private->EPOC_WsScreen->SizeInPixels()); 
  11.224 -	Private->EPOC_WsWindow.SetVisible(ETrue);
  11.225 -
  11.226 -    Private->EPOC_WsWindowGroupID = Private->EPOC_WsWindowGroup.Identifier();
  11.227 -    Private->EPOC_IsWindowFocused = EFalse;
  11.228 -}
  11.229 -
  11.230 -
  11.231 -int EPOC_VideoInit(_THIS, SDL_PixelFormat *vformat)
  11.232 -{
  11.233 -    // !!TODO:handle leave functions!
  11.234 -
  11.235 -    int i;
  11.236 -
  11.237 -	/* Initialize all variables that we clean on shutdown */   
  11.238 -
  11.239 -	for ( i=0; i<SDL_NUMMODES; ++i ) {
  11.240 -		Private->SDL_modelist[i] = (SDL_Rect *)SDL_malloc(sizeof(SDL_Rect));
  11.241 -		Private->SDL_modelist[i]->x = Private->SDL_modelist[i]->y = 0;
  11.242 -	}
  11.243 -	/* Modes sorted largest to smallest !!TODO:sorting order??*/
  11.244 -	Private->SDL_modelist[0]->w = 640; Private->SDL_modelist[0]->h = 200; 
  11.245 -	Private->SDL_modelist[1]->w = 320; Private->SDL_modelist[1]->h = 200;
  11.246 -	Private->SDL_modelist[2]->w = 640; Private->SDL_modelist[2]->h = 400; 
  11.247 -	Private->SDL_modelist[3]->w = 640; Private->SDL_modelist[3]->h = 480;
  11.248 -	Private->SDL_modelist[4] = NULL;
  11.249 -
  11.250 -    /* Construct Epoc window */
  11.251 -
  11.252 -    ConstructWindowL(_this);
  11.253 -
  11.254 -    /* Initialise Epoc frame buffer */
  11.255 -
  11.256 -    TDisplayMode displayMode = Private->EPOC_WsScreen->DisplayMode();
  11.257 -
  11.258 -    #ifndef __WINS__
  11.259 -
  11.260 -    TScreenInfoV01 screenInfo;
  11.261 -	TPckg<TScreenInfoV01> sInfo(screenInfo);
  11.262 -	UserSvr::ScreenInfo(sInfo);
  11.263 -
  11.264 -	Private->EPOC_ScreenSize		= screenInfo.iScreenSize; 
  11.265 -	Private->EPOC_DisplayMode		= displayMode;
  11.266 -    Private->EPOC_HasFrameBuffer	= screenInfo.iScreenAddressValid;
  11.267 -	Private->EPOC_FrameBuffer		= Private->EPOC_HasFrameBuffer ? (TUint8*) screenInfo.iScreenAddress : NULL;
  11.268 -	Private->EPOC_BytesPerPixel	    = ((GetBpp(displayMode)-1) / 8) + 1;
  11.269 -	Private->EPOC_BytesPerScanLine	= screenInfo.iScreenSize.iWidth * Private->EPOC_BytesPerPixel;
  11.270 -
  11.271 -    /* It seems that in SA1100 machines for 8bpp displays there is a 512 palette table at the 
  11.272 -     * beginning of the frame buffer. E.g. Series 7 and Netbook.
  11.273 -     * In 12 bpp machines the table has 16 entries.
  11.274 -	 */
  11.275 -	if (Private->EPOC_HasFrameBuffer && GetBpp(displayMode) == 8)
  11.276 -		Private->EPOC_FrameBuffer += 512;
  11.277 -	if (Private->EPOC_HasFrameBuffer && GetBpp(displayMode) == 12)
  11.278 -		Private->EPOC_FrameBuffer += 16 * 2;
  11.279 -
  11.280 -    #else /* defined __WINS__ */
  11.281 -    
  11.282 -    /* Create bitmap, device and context for screen drawing */
  11.283 -    Private->EPOC_ScreenSize        = Private->EPOC_WsScreen->SizeInPixels();
  11.284 -
  11.285 -	Private->EPOC_Bitmap = new (ELeave) CWsBitmap(Private->EPOC_WsSession);
  11.286 -	Private->EPOC_Bitmap->Create(Private->EPOC_ScreenSize, displayMode);
  11.287 -
  11.288 -	Private->EPOC_DisplayMode	    = displayMode;
  11.289 -    Private->EPOC_HasFrameBuffer    = ETrue;
  11.290 -    Private->EPOC_FrameBuffer       = NULL; /* Private->EPOC_Bitmap->DataAddress() can change any time */
  11.291 -	Private->EPOC_BytesPerPixel	    = ((GetBpp(displayMode)-1) / 8) + 1;
  11.292 -	Private->EPOC_BytesPerScanLine  = Private->EPOC_WsScreen->SizeInPixels().iWidth * Private->EPOC_BytesPerPixel;
  11.293 -
  11.294 -    #endif /* __WINS__ */
  11.295 -
  11.296 -    _this->info.current_w = Private->EPOC_ScreenSize.iWidth;
  11.297 -    _this->info.current_h = Private->EPOC_ScreenSize.iHeight;
  11.298 -
  11.299 -    /* The "best" video format should be returned to caller. */
  11.300 -
  11.301 -    vformat->BitsPerPixel       = /*!!GetBpp(displayMode) */ 8;
  11.302 -    vformat->BytesPerPixel      = /*!!Private->EPOC_BytesPerPixel*/ 1;
  11.303 -
  11.304 -    /* Activate events for me */
  11.305 -
  11.306 -	Private->EPOC_WsEventStatus = KRequestPending;
  11.307 -	Private->EPOC_WsSession.EventReady(&Private->EPOC_WsEventStatus);
  11.308 -	Private->EPOC_RedrawEventStatus = KRequestPending;
  11.309 -	Private->EPOC_WsSession.RedrawReady(&Private->EPOC_RedrawEventStatus);
  11.310 -    Private->EPOC_WsWindow.PointerFilter(EPointerFilterDrag, 0); 
  11.311 -
  11.312 -    Private->EPOC_ScreenOffset = 0;
  11.313 -
  11.314 -    //!! TODO: error handling
  11.315 -    //if (ret != KErrNone)
  11.316 -    //    return(-1);
  11.317 -    //else
  11.318 -	    return(0);
  11.319 -}
  11.320 -
  11.321 -
  11.322 -SDL_Rect **EPOC_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
  11.323 -{
  11.324 -    if (format->BitsPerPixel == 12 || format->BitsPerPixel == 8)
  11.325 -        return Private->SDL_modelist;
  11.326 -    return NULL;
  11.327 -}
  11.328 -
  11.329 -int EPOC_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
  11.330 -{
  11.331 -    for(int i = firstcolor; i < ncolors; i++) {
  11.332 -	    // 4k value: 000rgb
  11.333 -	    TUint16 color4K = 0;
  11.334 -        color4K |= (colors[i].r & 0x0000f0) << 4; 
  11.335 -	    color4K |= (colors[i].g & 0x0000f0);      
  11.336 -	    color4K |= (colors[i].b & 0x0000f0) >> 4;
  11.337 -        EPOC_HWPalette_256_to_4k[i] = color4K;
  11.338 -    }
  11.339 -	return(0);
  11.340 -}
  11.341 -
  11.342 -
  11.343 -SDL_Surface *EPOC_SetVideoMode(_THIS, SDL_Surface *current,
  11.344 -				int width, int height, int bpp, Uint32 flags)
  11.345 -{
  11.346 -    /* Check parameters */
  11.347 -    if (!((width == 640 && height == 200 && bpp == 12) ||
  11.348 -          (width == 640 && height == 400 && bpp == 12) || 
  11.349 -          (width == 640 && height == 480 && bpp == 12) || 
  11.350 -          (width == 320 && height == 200 && bpp == 12) || 
  11.351 -          (width == 640 && height == 200 && bpp == 8) ||
  11.352 -          (width == 640 && height == 400 && bpp == 8) || 
  11.353 -          (width == 640 && height == 480 && bpp == 8) || 
  11.354 -          (width == 320 && height == 200 && bpp == 8))) {
  11.355 -		SDL_SetError("Requested video mode is not supported");
  11.356 -        return NULL;
  11.357 -    }
  11.358 -
  11.359 -    if (current && current->pixels) {
  11.360 -        SDL_free(current->pixels);
  11.361 -        current->pixels = NULL;
  11.362 -    }
  11.363 -	if ( ! SDL_ReallocFormat(current, bpp, 0, 0, 0, 0) ) {
  11.364 -		return(NULL);
  11.365 -	}
  11.366 -
  11.367 -    /* Set up the new mode framebuffer */
  11.368 -    if (bpp == 8) 
  11.369 -	    current->flags = (SDL_FULLSCREEN|SDL_SWSURFACE|SDL_PREALLOC|SDL_HWPALETTE); 
  11.370 -    else // 12 bpp
  11.371 -	    current->flags = (SDL_FULLSCREEN|SDL_SWSURFACE|SDL_PREALLOC); 
  11.372 -	current->w = width;
  11.373 -	current->h = height;
  11.374 -    int numBytesPerPixel = ((bpp-1)>>3) + 1;   
  11.375 -	current->pitch = numBytesPerPixel * width; // Number of bytes in scanline 
  11.376 -	current->pixels = SDL_malloc(width * height * numBytesPerPixel);
  11.377 -	SDL_memset(current->pixels, 0, width * height * numBytesPerPixel);
  11.378 -
  11.379 -	/* Set the blit function */
  11.380 -	_this->UpdateRects = EPOC_DirectUpdate;
  11.381 -
  11.382 -    /* Must buffer height be shrinked to screen by 2 ? */
  11.383 -    if (current->h >= 400)
  11.384 -        Private->EPOC_ShrinkedHeight = ETrue;
  11.385 -
  11.386 -    /* Centralize game window on device screen  */
  11.387 -    Private->EPOC_ScreenOffset = (Private->EPOC_ScreenSize.iWidth - current->w) / 2;
  11.388 -
  11.389 -	/* We're done */
  11.390 -	return(current);
  11.391 -}
  11.392 -
  11.393 -void RedrawWindowL(_THIS)
  11.394 -{
  11.395 -    SDL_Rect fullScreen;
  11.396 -    fullScreen.x = 0;
  11.397 -    fullScreen.y = 0;
  11.398 -    fullScreen.w = _this->screen->w;
  11.399 -    fullScreen.h = _this->screen->h;
  11.400 -
  11.401 -#ifdef __WINS__
  11.402 -	    TBitmapUtil lock(Private->EPOC_Bitmap);	
  11.403 -        lock.Begin(TPoint(0,0)); // Lock bitmap heap
  11.404 -	    Private->EPOC_WindowGc->Activate(Private->EPOC_WsWindow);
  11.405 -#endif
  11.406 -
  11.407 -    if (fullScreen.w < Private->EPOC_ScreenSize.iWidth
  11.408 -        && fullScreen.w < Private->EPOC_ScreenSize.iWidth) {
  11.409 -        /* Draw blue stripes background */
  11.410 -#ifdef __WINS__
  11.411 -        TUint16* screenBuffer = (TUint16*)Private->EPOC_Bitmap->DataAddress();
  11.412 -#else
  11.413 -        TUint16* screenBuffer = (TUint16*)Private->EPOC_FrameBuffer;
  11.414 -#endif
  11.415 -        for (int y=0; y < Private->EPOC_ScreenSize.iHeight; y++) {
  11.416 -            for (int x=0; x < Private->EPOC_ScreenSize.iWidth; x++) {
  11.417 -                TUint16 color = ((x+y)>>1) & 0xf; /* Draw pattern */
  11.418 -                *screenBuffer++ = color;
  11.419 -            }
  11.420 -        }
  11.421 -    }
  11.422 -
  11.423 -
  11.424 -    /* Tell the system that something has been drawn */
  11.425 -	TRect  rect = TRect(Private->EPOC_WsWindow.Size());
  11.426 -  	Private->EPOC_WsWindow.Invalidate(rect);
  11.427 -
  11.428 -#ifdef __WINS__
  11.429 -	Private->EPOC_WsWindow.BeginRedraw(rect);
  11.430 -	Private->EPOC_WindowGc->BitBlt(TPoint(), Private->EPOC_Bitmap);
  11.431 -	Private->EPOC_WsWindow.EndRedraw();
  11.432 -	Private->EPOC_WindowGc->Deactivate();
  11.433 -    lock.End(); // Unlock bitmap heap
  11.434 -	Private->EPOC_WsSession.Flush();
  11.435 -#endif
  11.436 -
  11.437 -    /* Draw current buffer */
  11.438 -    EPOC_DirectUpdate(_this, 1, &fullScreen);
  11.439 -}
  11.440 -
  11.441 -
  11.442 -/* We don't actually allow hardware surfaces other than the main one */
  11.443 -static int EPOC_AllocHWSurface(_THIS, SDL_Surface *surface)
  11.444 -{
  11.445 -	return(-1);
  11.446 -}
  11.447 -static void EPOC_FreeHWSurface(_THIS, SDL_Surface *surface)
  11.448 -{
  11.449 -	return;
  11.450 -}
  11.451 -
  11.452 -static int EPOC_LockHWSurface(_THIS, SDL_Surface *surface)
  11.453 -{
  11.454 -	return(0);
  11.455 -}
  11.456 -static void EPOC_UnlockHWSurface(_THIS, SDL_Surface *surface)
  11.457 -{
  11.458 -	return;
  11.459 -}
  11.460 -
  11.461 -static int EPOC_FlipHWSurface(_THIS, SDL_Surface *surface)
  11.462 -{
  11.463 -	return(0);
  11.464 -}
  11.465 -
  11.466 -static void EPOC_DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
  11.467 -{
  11.468 -    TInt focusWindowGroupId = Private->EPOC_WsSession.GetFocusWindowGroup();
  11.469 -    if (focusWindowGroupId != Private->EPOC_WsWindowGroupID) {
  11.470 -
  11.471 -        /* Force focus window to redraw again for cleaning away SDL screen graphics */
  11.472 -
  11.473 -  
  11.474 -        TInt pos = Private->EPOC_WsWindowGroup.OrdinalPosition();
  11.475 -        Private->EPOC_WsWindowGroup.SetOrdinalPosition(0, KMaxTInt);
  11.476 -       	TRect  rect = TRect(Private->EPOC_WsWindow.Size());
  11.477 -        Private->EPOC_WsWindow.Invalidate(rect);
  11.478 -        Private->EPOC_WsWindowGroup.SetOrdinalPosition(pos, ECoeWinPriorityNormal);
  11.479 -        
  11.480 -        /* If this is not the topmost window, wait here! Sleep for 1 second to give cpu to 
  11.481 -           multitasking and poll for being the topmost window.
  11.482 -        */
  11.483 -        while (Private->EPOC_WsSession.GetFocusWindowGroup() != Private->EPOC_WsWindowGroupID)
  11.484 -            SDL_Delay(1000);
  11.485 -
  11.486 -        RedrawWindowL(_this);  
  11.487 -    }
  11.488 -
  11.489 -	TInt i;
  11.490 -    TInt sourceNumBytesPerPixel = ((_this->screen->format->BitsPerPixel-1)>>3) + 1;   
  11.491 -    TInt targetNumBytesPerPixel = Private->EPOC_BytesPerPixel;   
  11.492 -    TInt fixedOffset = Private->EPOC_ScreenOffset;   
  11.493 -    TInt screenW = _this->screen->w;
  11.494 -    TInt screenH = _this->screen->h;
  11.495 -    TInt sourceScanlineLength = screenW;
  11.496 -    if (Private->EPOC_ShrinkedHeight) {  /* simulate 400 pixel height in 200 pixel screen */  
  11.497 -        sourceScanlineLength <<= 1; 
  11.498 -        screenH >>= 1;
  11.499 -    }
  11.500 -    TInt targetScanlineLength = Private->EPOC_ScreenSize.iWidth;
  11.501 -#ifdef __WINS__
  11.502 -	TBitmapUtil lock(Private->EPOC_Bitmap);	
  11.503 -    lock.Begin(TPoint(0,0)); // Lock bitmap heap
  11.504 -	Private->EPOC_WindowGc->Activate(Private->EPOC_WsWindow);
  11.505 -    TUint16* screenBuffer = (TUint16*)Private->EPOC_Bitmap->DataAddress();
  11.506 -#else
  11.507 -    TUint16* screenBuffer = (TUint16*)Private->EPOC_FrameBuffer;
  11.508 -#endif
  11.509 -
  11.510 -
  11.511 -	/* Render the rectangles in the list */
  11.512 -
  11.513 -	for ( i=0; i < numrects; ++i ) {
  11.514 -        SDL_Rect rect2;
  11.515 -        const SDL_Rect& currentRect = rects[i];
  11.516 -        rect2.x = currentRect.x;
  11.517 -        rect2.y = currentRect.y;
  11.518 -        rect2.w = currentRect.w;
  11.519 -        rect2.h = currentRect.h;
  11.520 -
  11.521 -        if (rect2.w <= 0 || rect2.h <= 0) /* sanity check */
  11.522 -            continue;
  11.523 -
  11.524 -        if (Private->EPOC_ShrinkedHeight) {  /* simulate 400 pixel height in 200 pixel screen */        
  11.525 -            rect2.y >>= 1;
  11.526 -            if (!(rect2.h >>= 1)) 
  11.527 -                rect2.h = 1; // always at least 1 pixel height!
  11.528 -        }
  11.529 -
  11.530 -        /* All variables are measured in pixels */
  11.531 -
  11.532 -        /* Check rects validity, i.e. upper and lower bounds */
  11.533 -        TInt maxX = Min(screenW - 1, rect2.x + rect2.w - 1);
  11.534 -        TInt maxY = Min(screenH - 1, rect2.y + rect2.h - 1);
  11.535 -        if (maxX < 0 || maxY < 0) /* sanity check */
  11.536 -            continue;
  11.537 -        maxY = Min(maxY, 199); 
  11.538 -
  11.539 -        TInt sourceRectWidth = maxX - rect2.x + 1;
  11.540 -        TInt sourceRectWidthInBytes = sourceRectWidth * sourceNumBytesPerPixel;
  11.541 -        TInt sourceRectHeight = maxY - rect2.y + 1;
  11.542 -        TInt sourceStartOffset = rect2.x + rect2.y * sourceScanlineLength;
  11.543 -        TInt targetStartOffset = fixedOffset + rect2.x + rect2.y * targetScanlineLength;   
  11.544 -        
  11.545 -        // !! Nokia9210 native mode: 12 bpp --> 12 bpp
  11.546 -        if (_this->screen->format->BitsPerPixel == 12) { 
  11.547 -	        TUint16* bitmapLine = (TUint16*)_this->screen->pixels + sourceStartOffset;
  11.548 -            TUint16* screenMemory = screenBuffer + targetStartOffset;
  11.549 -            for(TInt y = 0 ; y < sourceRectHeight ; y++) {
  11.550 -                __ASSERT_DEBUG(screenMemory < (screenBuffer 
  11.551 -                    + Private->EPOC_ScreenSize.iWidth * Private->EPOC_ScreenSize.iHeight), 
  11.552 -                    User::Panic(_L("SDL"), KErrCorrupt));
  11.553 -                __ASSERT_DEBUG(screenMemory >= screenBuffer, 
  11.554 -                    User::Panic(_L("SDL"), KErrCorrupt));
  11.555 -                __ASSERT_DEBUG(bitmapLine < ((TUint16*)_this->screen->pixels + 
  11.556 -                    + (_this->screen->w * _this->screen->h)), 
  11.557 -                    User::Panic(_L("SDL"), KErrCorrupt));
  11.558 -                __ASSERT_DEBUG(bitmapLine >=  (TUint16*)_this->screen->pixels, 
  11.559 -                    User::Panic(_L("SDL"), KErrCorrupt));
  11.560 -		        Mem::Copy(screenMemory, bitmapLine, sourceRectWidthInBytes);
  11.561 -		        bitmapLine += sourceScanlineLength;
  11.562 -		        screenMemory += targetScanlineLength;
  11.563 -            }
  11.564 -        }
  11.565 -        // !! 256 color paletted mode: 8 bpp  --> 12 bpp
  11.566 -        else { 
  11.567 -	        TUint8* bitmapLine = (TUint8*)_this->screen->pixels + sourceStartOffset;
  11.568 -            TUint16* screenMemory = screenBuffer + targetStartOffset;
  11.569 -            for(TInt y = 0 ; y < sourceRectHeight ; y++) {
  11.570 -                TUint8* bitmapPos = bitmapLine; /* 1 byte per pixel */
  11.571 -                TUint16* screenMemoryLinePos = screenMemory; /* 2 bytes per pixel */
  11.572 -                /* Convert each pixel from 256 palette to 4k color values */
  11.573 -                for(TInt x = 0 ; x < sourceRectWidth ; x++) {
  11.574 -                    __ASSERT_DEBUG(screenMemoryLinePos < (screenBuffer 
  11.575 -                        + (Private->EPOC_ScreenSize.iWidth * Private->EPOC_ScreenSize.iHeight)), 
  11.576 -                        User::Panic(_L("SDL"), KErrCorrupt));
  11.577 -                    __ASSERT_DEBUG(screenMemoryLinePos >= screenBuffer, 
  11.578 -                        User::Panic(_L("SDL"), KErrCorrupt));
  11.579 -                    __ASSERT_DEBUG(bitmapPos < ((TUint8*)_this->screen->pixels + 
  11.580 -                        + (_this->screen->w * _this->screen->h)), 
  11.581 -                        User::Panic(_L("SDL"), KErrCorrupt));
  11.582 -                    __ASSERT_DEBUG(bitmapPos >= (TUint8*)_this->screen->pixels, 
  11.583 -                        User::Panic(_L("SDL"), KErrCorrupt));
  11.584 -                    *screenMemoryLinePos = EPOC_HWPalette_256_to_4k[*bitmapPos];
  11.585 -                    bitmapPos++;
  11.586 -                    screenMemoryLinePos++;
  11.587 -                }
  11.588 -		        bitmapLine += sourceScanlineLength;
  11.589 -		        screenMemory += targetScanlineLength;
  11.590 -            }
  11.591 -	    }
  11.592 -
  11.593 -    }    
  11.594 -    
  11.595 -#ifdef __WINS__
  11.596 -
  11.597 -	TRect  rect = TRect(Private->EPOC_WsWindow.Size());
  11.598 -	Private->EPOC_WsWindow.Invalidate(rect);
  11.599 -	Private->EPOC_WsWindow.BeginRedraw(rect);
  11.600 -	Private->EPOC_WindowGc->BitBlt(TPoint(), Private->EPOC_Bitmap);
  11.601 -	Private->EPOC_WsWindow.EndRedraw();
  11.602 -	Private->EPOC_WindowGc->Deactivate();
  11.603 -    lock.End(); // Unlock bitmap heap
  11.604 -	Private->EPOC_WsSession.Flush();
  11.605 -
  11.606 -#endif
  11.607 -
  11.608 -    /* Update virtual cursor */
  11.609 -    //!!Private->EPOC_WsSession.SetPointerCursorPosition(Private->EPOC_WsSession.PointerCursorPosition());
  11.610 -
  11.611 -    return;
  11.612 -}
  11.613 -
  11.614 -
  11.615 -/* Note:  If we are terminated, this could be called in the middle of
  11.616 -   another SDL video routine -- notably UpdateRects.
  11.617 -*/
  11.618 -void EPOC_VideoQuit(_THIS)
  11.619 -{
  11.620 -	int i;
  11.621 -
  11.622 -	/* Free video mode lists */
  11.623 -	for ( i=0; i<SDL_NUMMODES; ++i ) {
  11.624 -		if ( Private->SDL_modelist[i] != NULL ) {
  11.625 -			SDL_free(Private->SDL_modelist[i]);
  11.626 -			Private->SDL_modelist[i] = NULL;
  11.627 -		}
  11.628 -	}
  11.629 -	
  11.630 -    if ( _this->screen && (_this->screen->flags & SDL_HWSURFACE) ) {
  11.631 -		/* Direct screen access, no memory buffer */
  11.632 -		_this->screen->pixels = NULL;
  11.633 -	}
  11.634 -
  11.635 -    if (_this->screen && _this->screen->pixels) {
  11.636 -        SDL_free(_this->screen->pixels);
  11.637 -        _this->screen->pixels = NULL;
  11.638 -    }
  11.639 -
  11.640 -    /* Free Epoc resources */
  11.641 -
  11.642 -    /* Disable events for me */
  11.643 -	if (Private->EPOC_WsEventStatus != KRequestPending)
  11.644 -		Private->EPOC_WsSession.EventReadyCancel();
  11.645 -	if (Private->EPOC_RedrawEventStatus != KRequestPending)
  11.646 -		Private->EPOC_WsSession.RedrawReadyCancel();
  11.647 -
  11.648 -    #ifdef __WINS__
  11.649 -	delete Private->EPOC_Bitmap;
  11.650 -	Private->EPOC_Bitmap = NULL;
  11.651 -    #endif
  11.652 -
  11.653 -	if (Private->EPOC_WsWindow.WsHandle())
  11.654 -		Private->EPOC_WsWindow.Close();
  11.655 -
  11.656 -	if (Private->EPOC_WsWindowGroup.WsHandle())
  11.657 -		Private->EPOC_WsWindowGroup.Close();
  11.658 -
  11.659 -	delete Private->EPOC_WindowGc;
  11.660 -	Private->EPOC_WindowGc = NULL;
  11.661 -
  11.662 -	delete Private->EPOC_WsScreen;
  11.663 -	Private->EPOC_WsScreen = NULL;
  11.664 -
  11.665 -	if (Private->EPOC_WsSession.WsHandle())
  11.666 -		Private->EPOC_WsSession.Close();
  11.667 -}
  11.668 -
  11.669 -
  11.670 -WMcursor *EPOC_CreateWMCursor(_THIS, Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y)
  11.671 -{
  11.672 -	return (WMcursor *) 9210; // it's ok to return something unuseful but true
  11.673 -}
  11.674 -
  11.675 -void EPOC_FreeWMCursor(_THIS, WMcursor *cursor)
  11.676 -{
  11.677 -    /* Disable virtual cursor */
  11.678 -    HAL::Set(HAL::EMouseState, HAL::EMouseState_Invisible);
  11.679 -    Private->EPOC_WsSession.SetPointerCursorMode(EPointerCursorNone);
  11.680 -}
  11.681 -
  11.682 -int EPOC_ShowWMCursor(_THIS, WMcursor *cursor)
  11.683 -{
  11.684 -
  11.685 -    if (cursor ==  (WMcursor *)9210) {
  11.686 -        /* Enable virtual cursor */
  11.687 -	    HAL::Set(HAL::EMouseState, HAL::EMouseState_Visible);
  11.688 -	    Private->EPOC_WsSession.SetPointerCursorMode(EPointerCursorNormal);
  11.689 -    }
  11.690 -    else {
  11.691 -        /* Disable virtual cursor */
  11.692 -        HAL::Set(HAL::EMouseState, HAL::EMouseState_Invisible);
  11.693 -        Private->EPOC_WsSession.SetPointerCursorMode(EPointerCursorNone);
  11.694 -    }
  11.695 -
  11.696 -	return(1);
  11.697 -}
  11.698 -
  11.699 -}; // extern "C"
  11.700 -
    12.1 --- a/src/video/epoc/SDL_epocvideo.h	Fri Jun 15 12:26:29 2007 +0000
    12.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.3 @@ -1,90 +0,0 @@
    12.4 -/*
    12.5 -    SDL - Simple DirectMedia Layer
    12.6 -    Copyright (C) 1997-2004 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 Library General Public
   12.10 -    License as published by the Free Software Foundation; either
   12.11 -    version 2 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 -    Library General Public License for more details.
   12.17 -
   12.18 -    You should have received a copy of the GNU Library General Public
   12.19 -    License along with this library; if not, write to the Free
   12.20 -    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   12.21 -
   12.22 -    Sam Lantinga
   12.23 -    slouken@libsdl.org
   12.24 -*/
   12.25 -#include "SDL_config.h"
   12.26 -
   12.27 -/*
   12.28 -    SDL_epocvideo.h
   12.29 -    Epoc based SDL video driver implementation
   12.30 -
   12.31 -    Epoc version by Hannu Viitala (hannu.j.viitala@mbnet.fi)
   12.32 -*/
   12.33 -
   12.34 -#ifndef _SDL_epocvideo_h
   12.35 -#define _SDL_epocvideo_h
   12.36 -
   12.37 -extern "C" {
   12.38 -#include "SDL_mouse.h"
   12.39 -#include "../SDL_sysvideo.h"
   12.40 -};
   12.41 -
   12.42 -#include <e32std.h>
   12.43 -#include <bitdev.h> 
   12.44 -#include <w32std.h>
   12.45 -
   12.46 -/* Hidden "this" pointer for the video functions */
   12.47 -#define _THIS	SDL_VideoDevice *_this
   12.48 -#define Private	_this->hidden
   12.49 -
   12.50 -#define SDL_NUMMODES	4
   12.51 -
   12.52 -/* Private display data */
   12.53 -struct SDL_PrivateVideoData {
   12.54 -
   12.55 -    SDL_Rect            *SDL_modelist[SDL_NUMMODES+1];
   12.56 -
   12.57 -	/* Epoc window server info */
   12.58 -    
   12.59 -    RWsSession			EPOC_WsSession;
   12.60 -	RWindowGroup		EPOC_WsWindowGroup;
   12.61 -    TInt                EPOC_WsWindowGroupID;
   12.62 -	RWindow				EPOC_WsWindow;
   12.63 -	CWsScreenDevice*	EPOC_WsScreen;
   12.64 -	CWindowGc*			EPOC_WindowGc;
   12.65 -	TRequestStatus		EPOC_WsEventStatus;
   12.66 -	TRequestStatus		EPOC_RedrawEventStatus;
   12.67 -	TWsEvent			EPOC_WsEvent;
   12.68 -	TWsRedrawEvent		EPOC_RedrawEvent;
   12.69 -    #ifdef __WINS__
   12.70 -    CWsBitmap*          EPOC_Bitmap;
   12.71 -    #endif
   12.72 -    TBool               EPOC_IsWindowFocused; //!!Not used for anything yet!
   12.73 -
   12.74 -    /* Screen hardware frame buffer info */
   12.75 -
   12.76 -   	TBool				EPOC_HasFrameBuffer;
   12.77 -	TInt				EPOC_BytesPerPixel;
   12.78 -	TInt				EPOC_BytesPerScanLine;
   12.79 -	TDisplayMode		EPOC_DisplayMode;
   12.80 -	TSize				EPOC_ScreenSize;
   12.81 -	TUint8*				EPOC_FrameBuffer;		/* if NULL in HW we can't do direct screen access */
   12.82 -    TInt                EPOC_ScreenOffset;
   12.83 -
   12.84 -    /* Simulate double screen height */
   12.85 -    TBool               EPOC_ShrinkedHeight;
   12.86 -};
   12.87 -
   12.88 -extern "C" {
   12.89 -extern void RedrawWindowL(_THIS);
   12.90 -};
   12.91 -
   12.92 -
   12.93 -#endif /* _SDL_epocvideo_h */