diff options
Diffstat (limited to 'packages/libsdl/libsdl-qpe-1.2.7/pygame.patch')
-rw-r--r-- | packages/libsdl/libsdl-qpe-1.2.7/pygame.patch | 183 |
1 files changed, 183 insertions, 0 deletions
diff --git a/packages/libsdl/libsdl-qpe-1.2.7/pygame.patch b/packages/libsdl/libsdl-qpe-1.2.7/pygame.patch index e69de29bb2..f87b40d8a9 100644 --- a/packages/libsdl/libsdl-qpe-1.2.7/pygame.patch +++ b/packages/libsdl/libsdl-qpe-1.2.7/pygame.patch @@ -0,0 +1,183 @@ +Index: SDL-1.2.7/src/main/qtopia/SDL_qtopia_main.cc +=================================================================== +--- SDL-1.2.7.orig/src/main/qtopia/SDL_qtopia_main.cc 2005-03-02 22:24:42.713596719 +0100 ++++ /dev/null 1970-01-01 00:00:00.000000000 +0000 +@@ -1,47 +0,0 @@ +- +-/* Include the SDL main definition header */ +-#include "SDL_main.h" +-#include <stdlib.h> +-#include <unistd.h> +-#ifdef main +-#undef main +-#endif +-#ifdef QWS +-#include <qpe/qpeapplication.h> +-#include <qapplication.h> +-#include <qpe/qpeapplication.h> +-#include <stdlib.h> +- +-// Workaround for OPIE to remove taskbar icon. Also fixes +-// some issues in Qtopia where there are left-over qcop files in /tmp/. +-// I'm guessing this will also clean up the taskbar in the Sharp version +-// of Qtopia. +-static inline void cleanupQCop() { +- QString appname(qApp->argv()[0]); +- int slash = appname.findRev("/"); +- if(slash != -1) { appname = appname.mid(slash+1); } +- QString cmd = QPEApplication::qpeDir() + "bin/qcop QPE/System 'closing(QString)' '"+appname+"'"; +- system(cmd.latin1()); +- cmd = "/tmp/qcop-msg-"+appname; +- unlink(cmd.latin1()); +-} +- +-static QPEApplication *app; +-#endif +- +-extern int SDL_main(int argc, char *argv[]); +- +-int main(int argc, char *argv[]) +-{ +-#ifdef QWS +- // This initializes the Qtopia application. It needs to be done here +- // because it parses command line options. +- app = new QPEApplication(argc, argv); +- QWidget dummy; +- app->showMainWidget(&dummy); +- atexit(cleanupQCop); +-#endif +- // Exit here because if return is used, the application +- // doesn't seem to quit correctly. +- exit(SDL_main(argc, argv)); +-} +Index: SDL-1.2.7/src/video/qtopia/SDL_qmain.cc +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ SDL-1.2.7/src/video/qtopia/SDL_qmain.cc 2005-03-02 23:46:58.741836401 +0100 +@@ -0,0 +1,99 @@ ++/* Include the SDL main definition header */ ++#include "SDL_main.h" ++#include <stdlib.h> ++ ++#include <sys/types.h> ++#include <fcntl.h> ++#include <unistd.h> ++ ++ ++#ifdef QWS ++#include <qpe/qpeapplication.h> ++#include <stdlib.h> ++#include <string.h> ++ ++ ++static void initialize_qpe_app() __attribute__((constructor)); ++static void deinitialize_qpe_app() __attribute__((destructor)); ++ ++static QWidget *dummyW = 0; ++static QPEApplication *theApp = 0; ++static char **cmdline= 0; ++static int size = 0; ++ ++static void parse_cmd_line() { ++ /* ++ * find the number ++ */ ++ char buf[1024]; ++ int available = 0; ++ char *string_start = 0; ++ int fd = ::open( "/proc/self/cmdline", O_RDONLY ); ++ if ( fd < 0 ) { ++ qWarning( "Error getting the cmdline, can't be" ); ++ goto error_out; ++ } ++ ++ available = ::read( fd, &buf, sizeof(buf) ); ++ if ( available <= 0 ) ++ goto error_out; ++ ++ /* ++ * find out the number of arguments ++ */ ++ size = 0; ++ for (int i = 0; i < available; ++i ) ++ if ( buf[i] == '\0' ) ++ ++size; ++ ++ /* now create a the cmdline */ ++ cmdline = new char*[size+1]; ++ cmdline[size] = '\0'; // parnoid... ++ ++ string_start = &buf[0]; ++ for ( int i = 0; i < size; ++i ) { ++ /* ++ * find the end of the string ++ */ ++ size_t sz = ::strlen(string_start); ++ cmdline[i] = new char[sz+1]; ++ strncpy( cmdline[i], string_start, sz ); ++ string_start += (sz+1); // +1 for '\0' +1 to set it beyond ++ } ++ ++ return; ++ ++/* error code */ ++error_out: ++ cmdline = new char*[2]; ++ cmdline[0] = "unknown_app"; ++ cmdline[1] = '\0'; ++ size = 1; ++} ++ ++static void free_cmd_line() { ++ /* ++ * free each string and then free the array ++ */ ++ for ( int i = 0; i < size; ++i ) ++ delete [] cmdline[i]; ++ ++ delete [] cmdline; ++} ++ ++static void initialize_qpe_app() { ++ parse_cmd_line(); ++ ++ theApp = new QPEApplication( size, cmdline ); ++ dummyW = new QWidget; ++ theApp->showMainWidget(dummyW); ++} ++ ++static void deinitialize_qpe_app() { ++ free_cmd_line(); ++ delete dummyW; ++ delete theApp; ++} ++ ++ ++#endif +Index: SDL-1.2.7/src/main/Makefile.am +=================================================================== +--- SDL-1.2.7.orig/src/main/Makefile.am 2005-03-02 22:24:42.714596577 +0100 ++++ SDL-1.2.7/src/main/Makefile.am 2005-03-02 22:25:46.932524373 +0100 +@@ -21,11 +21,7 @@ + if TARGET_MACOSX + MAINLIB_ARCH_SRCS = macosx/SDLMain.m macosx/SDLMain.h + else +-if TARGET_QTOPIA +-MAINLIB_ARCH_SRCS = qtopia/SDL_qtopia_main.cc +-else + MAINLIB_ARCH_SRCS = dummy/SDL_dummy_main.c +-endif # !TARGET_QTOPIA + endif # !TARGET_MACOSX + endif # !TARGET_WIN32 + libSDLmain_a_SOURCES = $(MAINLIB_ARCH_SRCS) +Index: SDL-1.2.7/src/video/qtopia/Makefile.am +=================================================================== +--- SDL-1.2.7.orig/src/video/qtopia/Makefile.am 2005-03-02 22:24:42.714596577 +0100 ++++ SDL-1.2.7/src/video/qtopia/Makefile.am 2005-03-02 22:25:46.932524373 +0100 +@@ -15,4 +15,5 @@ + SDL_syswm.cc \ + SDL_syswm_c.h \ + SDL_sysevents.cc \ +- SDL_sysevents_c.h ++ SDL_sysevents_c.h \ ++ SDL_qmain.cc |