Commits

Anonymous committed 696d0ad

Added missing pygame 'threads' package
Added Python version to sis package
Fine tuned SDL flags to fix change to background

Comments (0)

Files changed (3)

symbian/SConscript.pygame.py

 for x in glob( "../lib/*.py"):
     to_package( source = x, target = pygame_lib )
 
+for x in glob( "../lib/threads/*.py"):
+    to_package( source = x, target = join( pygame_lib, "threads") )
+    
 # Copy Symbian specific libs
 for x in glob( "lib/*.py"): 
     to_package( source = x, target = pygame_lib )

symbian/SConstruct

 try:
     import pysvn
     SVNCLIENT = pysvn.Client()
-    SVNREVISION = "_SVN-%d" % ( SVNCLIENT.info(".")["revision"].number )
+    SVNREVISION = "SVN-%d" % ( SVNCLIENT.info(".")["revision"].number )
 except ImportError:
     pass
 
 DATE = list(time.gmtime()[:3])    
 DATE = [ str(x).zfill(2) for x in DATE ]
 DATE = "".join( DATE )    
-
-# Pygame's installer package
-PACKAGE_NAME = ARGUMENTS.get( "package", "pygame-S60%(REVISION)s_%(DATE)s_%(COMPILER)s-%(RELEASE)s.sis" % \
-                            {   "DATE"     : DATE, 
-                                "REVISION" : SVNREVISION, 
-                                "COMPILER" : COMPILER.upper(), 
-                                "RELEASE"  : RELEASE.upper() 
-                            } )
-
+ 
 #: Name of the title on installer.
 PACKAGE_TITLE = ARGUMENTS.get( "sisappname", "pygame for S60" )
 
     CAPABILITIES = CAPS_SELF_SIGNED
     constants.SIGNSIS_OUTPUT_EXTENSION = "selfsigned.sisx"
 
-SISVERSION    = ARGUMENTS.get( "sisversion", "1,0,0").split(",")
+SISVERSION     = ARGUMENTS.get( "sisversion", "1,0,0").split(",")
 PYTHON_INCLUDE = ARGUMENTS.get( "pythoninclude", EPOC32_INCLUDE + "/python")
+PYTHON_VERSION = PYTHON_INCLUDE[-2:] # epoc32/include/python25
+if not PYTHON_VERSION.isdigit(): # But missing on pre 1.9.x PyS60( Python 2.2 )
+    PYTHON_VERSION = "22"
+
+# Pygame's installer package
+PACKAGE_NAME = ARGUMENTS.get( "package", "pygame-S60_py%(PYVER)s_%(REVISION)s_%(DATE)s_%(COMPILER)s-%(RELEASE)s.sis" % \
+                            {   "DATE"     : DATE, 
+                                "REVISION" : SVNREVISION, 
+                                "COMPILER" : COMPILER.upper(), 
+                                "RELEASE"  : RELEASE.upper(),
+                                "PYVER"    : PYTHON_VERSION 
+                            } )
 
 # SIS certificate 
 CERT = ARGUMENTS.get("cert", None)

symbian/app/pygame_app.cpp

 	~CSdlAppUi();
 private:
 	void HandleCommandL(TInt aCommand);
-	void HandleResourceChangeL( TInt aType );
+	void HandleResourceChangeL(TInt aType);
 	void StartTestL(TInt aCmd);
 	void DoExit(TInt aErr);
 	void HandleWsEventL(const TWsEvent& aEvent, CCoeControl* aDestination);
 	// Draw black( it will be white otherwise and that's even worse looking )
 	// TODO: Take a screenshot and maybe do some kind of fade thingy
 	CWindowGc& gc = SystemGc();
-	gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
+	gc.SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
 	gc.Clear();
 
 	gc.SetPenStyle(CGraphicsContext::ENullPen);
 void CSdlAppUi::ConstructL()
 {
 	BaseConstructL(CAknAppUi::EAknEnableSkin /* | ENoScreenFurniture*/);
-	
+
 	iSDLWin = new (ELeave) CSDLWin;
 	iSDLWin->ConstructL(ApplicationRect());
 
 {
 }
 
-extern "C" {
+extern "C"
+{
 #include <SDL_events.h>
 }
-void CSdlAppUi::HandleResourceChangeL( TInt aType )
+void CSdlAppUi::HandleResourceChangeL(TInt aType)
 {
 
 	//User::InfoPrint(_L("rect.Height()"));
-	if( aType == KEikDynamicLayoutVariantSwitch )
+	if (aType == KEikDynamicLayoutVariantSwitch)
 	{
 		// Create SDL resize event
 		TRect rect;
-		AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EApplicationWindow,rect);
+		AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EApplicationWindow,
+				rect);
 
 		SDL_Event event;
 		event.type = SDL_VIDEORESIZE;
 		SDL_PushEvent(&event);
 
 		iSDLWin->SetRect(rect);
-/*
-		iSdl->SetContainerWindowL(
-					iSDLWin->GetWindow(),
-					iEikonEnv->WsSession(),
-					*iEikonEnv->ScreenDevice());
-*/
+		/*
+		 iSdl->SetContainerWindowL(
+		 iSDLWin->GetWindow(),
+		 iEikonEnv->WsSession(),
+		 *iEikonEnv->ScreenDevice());
+		 */
 	}
 
 	CAknAppUi::HandleResourceChangeL(aType);
 
 	TInt flags = 0;
 
-	flags |= CSDL::EDrawModeDSB | CSDL::EDrawModeDSBDoubleBuffer;
+	//flags |= CSDL::EDrawModeDSB | CSDL::EDrawModeDSBDoubleBuffer;
+	flags |= CSDL::EDrawModeGdi;
 	// Don't draw when in background.
-	flags |= CSDL::EEnableFocusStop;
+	//flags |= CSDL::EEnableFocusStop;
+	flags |= CSDL::EAutoOrientation;
 	// This should be on by default anyway
 	flags |= CSDL::EMainThread;
-	
+
 	//Create CommandLine Arguments and read it.
-	CDesC8ArrayFlat *arr = new (ELeave) CDesC8ArrayFlat (1);
+	CDesC8ArrayFlat *arr = new (ELeave) CDesC8ArrayFlat(1);
 	CleanupStack::PushL(arr);
-	
-	CCommandLineArguments* args=CCommandLineArguments::NewLC();
+
+	CCommandLineArguments* args = CCommandLineArguments::NewLC();
 	// The real args we are interested in start at the 2nd arg
-	for (TInt i=1; i<args->Count(); i++) 
+	for (TInt i = 1; i < args->Count(); i++)
 	{
 		TBuf8<256> arg;
-		arg.Copy(args->Arg(i) );
-		
+		arg.Copy(args->Arg(i));
+
 		arr->AppendL(arg);
 		//TPtrC argumentPrt(args->Arg(i));
-		//console->Printf(_L("Arg %d == %S\n"), i, &argumentPrt); 
+		//console->Printf(_L("Arg %d == %S\n"), i, &argumentPrt);
 	}
-	
+
 	iSdl = CSDL::NewL(flags);
-	
+
 	iSdl->SetContainerWindowL(iSDLWin->GetWindow(), iEikonEnv->WsSession(),
 			*iEikonEnv->ScreenDevice());
 	iSdl->CallMainL(iWait->iStatus, *arr, flags, 0x14000);
 	iWait->Start();
-	
+
 	arr->Reset();
 	CleanupStack::PopAndDestroy(2); // command line and arr
 }
 	Exit();
 }
 
-void CSdlAppUi::HandleWsEventL(const TWsEvent& aEvent,
-		CCoeControl* aDestination)
+void CSdlAppUi::HandleWsEventL(
+		const TWsEvent& aEvent, CCoeControl* aDestination)
 {
 	if (iSdl != NULL)
 		iSdl->AppendWsEvent(aEvent);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.