Commits

Anonymous committed cdea134

Merge update, added resizing to movie module. Cleaned up several really
long functions to be smaller and simpler.

  • Participants
  • Parent commits 9a7a9bc
  • Branches tylerthemovie

Comments (0)

Files changed (40)

 # This is a list of changes in pygame's history.
 #
-# CVS tag names are placed before the date
+# SVN revision numbers, and CVS tag names are placed before the date
 # BREAK = change breaks existing code
 # BUG    = fixed a bug that was (or could have been) crashing
 #
 #
-[SVN 2268] May 27, 2009
-    updated docs for cursors.load_xbm, thanks Saul Spatz, and Thomas Ibbotson
 
-[SVN 2259] May 26, 2009
+[SVN 2366] Jun 17, 2009
+    [BUG] Memory leak in a few modules.  Thanks Lorenz Quack.
+
+[SVN 2365] Jun 16, 2009
+    Started to add basic slice support to Color type.
+
+[SVN 2311] Jun 4, 2009
+    Fixed another Color regression... colors are now tasty again when pickled.
+
+[SVN 2305] Jun 2, 2009
+    Make pygame.tests.__init__.py import __main__.py. This is done
+      consistently with other pygame.tests modules.
+
+[SVN 2294-2303] Jun 1, 2009
+    Added some notes about Color instead of tuple for some Surface functions.
+    Midi, no abort on dealloc by default. have explicit close/abort available.
+    Updated midi docs.
+    Sysfont tests pass ok on OSX now(and windows+linux etc).
+    Sysfont on OSX more resiliant. Broke up tests to find broken ones more
+      easily.
+    Updated test/README.TXT for tags files... eg: some_module_tags.py.
+    Added a little tool to help with creating WHATSNEW from svn logs.
+    Add a little TODO to svn_log_to_whatsnew.py to make its WHATSNEW output
+      nicer.
+
+[SVN 2289-2293] May 31, 2009
+    Fix midi_test.py so Python3 compiles it without errors.
+    Let Surface methods accept and return Color instances.
+    Minor type correction in Rect docs.
+    Extend background unit test default timeout to 2 minutes.
+    Add gfxdraw unit tests and fix uncovered bugs.
+
+[SVN 2284-2287] May 30, 2009
+    Sysfont, added fallback for OSX that doesn't have X11.
+    Tests and fixes for midi. Better validation Input/Output to avoid crashes.
+    Fixed up test which was failing on ubuntu with python2.x.
+
+[SVN 2278] May 29, 2009
+    Fixed test to not fail on OSX which doesn't have midi devices by default.
+
+[SVN 2264-2269] May 27, 2009
+    Enable font_test.py on Windows.
+    Add svn properties to track which files are converted to Python 3.x.
+    Updated docs for cursors.load_xbm, thanks Saul Spatz, and Thomas Ibbotson.
+    Cursors update note.
+
+[SVN 2248-2261] May 26, 2009
+    Disable debug printing for Windows build of portmidi.
+    Symbian Launcher:
+      - Removed unneeded buffer to save memory   
+      - Removed fade from slide animations to improve performance   
+      - Increased heap size to 100k,4Mb   
+      - Don't byte compile regular scripts so they can be easily edited.    
+    Symbian other:
+      - The pygame library is now zipped as well for better performance.
+    Removed color.py warning from Symbian. It is used as wrapper for the
+      native module.
+    Camera module and computer vision tutorial.
+    Cleaning camera module documentation and makeref on transform.
+    Added palette_colors to mask.from_threshold.  TODO notes to some
+      functions.
     [BUG] surflock.c PySurface_LockBy was leaking weakrefs.
-    Thanks Tom Rothamel for the patch!
+      Thanks Tom Rothamel.
 
-[SVN 2118] May 12, 2009
+[SVN 2242-2245] May 25, 2009
+    Added a palette_colors option to average_surfaces... which doesn't handle
+      palette using surfaces correctly(yet).
+    Fixed possible memory leak.  Made some comments about return values.
+    Recompile pymp.pyx with Cython. Enable Python 3.x support of midi module.
+    Enable midi_test.py for Python 3.x.
+
+[SVN 2230-2237] May 24, 2009
+    Added some more midi tests.
+    Python 3.x: disable midi_test.py and clean out movieext from setup.py.
+    A tool for generating .doc docs from .py docstrings, and new midi.doc.
+    Shortened midi.get_default_*_device_id to get_default_*_id.
+    Fixed up create_doc_from_py and updated a few documentation items.
+    Updated a doc for pygame.midi.time.
+
+[SVN 2216-2219] May 23, 2009
+    Simplified sysfont.initsysfonts_win() fonts directory scan.
+    In init functions: fix minor Python 3.x related memory leaks and clean up
+      indentation.
+    Fix sndarray_test.py problem where failed to detect unsupported formats.
+
+[SVN 2201-2212] May 22, 2009
+    Added missing gfxdraw wrapper for Symbian.
+    Fixed to work on PyS60 1.9.4  The pygame python files are compiled into
+      byte-code. Feature of scons-for-symbian.
+    Have sysfont.py search the Windows font directory default fonts before
+      checking the registry.
+    Added another possible registry key where there might be fonts on win.
+    Fix possible problem with WINDIR, windir environment variable name.
+
+[SVN 2193-2199] May 21, 2009
+    Small svn prop tweak with run_tests.py and ignore font_test.py for Python
+      3.x on Windows.
+    More font unit tests and a unit test bug fix.
+    Add some interactive font unit tests to fill in some holes.
+    Move locals.doc and remove redundant constant descriptions. instead refer
+      to other module pages.
+    Add TIMER_RESOLUTION description to time.doc.
+
+[SVN 2183-2189] May 20, 2009
+    Remove defunct movieext.c (ancient non-working ffmpeg movie module).
+    Clean up props/modes on lib/midi.py.
+    Undo unintended changes in r 2184.
+    Partial support for OSX sysfont... 10.5.x onwards.  just use unix method.
+    Additions to font_test.py and sysfont.py.
+
+[SVN 2165-2180] May 19, 2009
+    Minor doc corrections to midi example's output_main.
+    Add setmods script missing from r 2129.
+    Added -x on lib files...  Should this be moved into the setup.py ?.
+    Make python -m pygame.docs bring up the docs in a browser. also fix Python
+      3 issues with executable packages.
+    Add gfxdraw docs.
+    Marked camera, gfxdraw, and scrap as experimental in the docs.
+    House_lo.mp3 crashes smpeg on Debian Linux. Remove from unit tests and add
+      MP3 warning to docs.
+    Finished midi docs.
+    Added the start of some midi tests... all stubs.
+    Updated generated docs.
+
+[SVN 2163] May 18, 2009
+    Fix midi.py examples quit() bug.
+
+[SVN 2154-2161] May 17, 2009
+    Added channel argument to note_on and note_off methods.
+    Fixing up spacing between functions.
+    Fix midi.py example init bug for --list option.
+    Fix midi channels  changed default channel to 0  added to note_on and
+      set_instrument.
+    Starting to add docs in the pygame style to midi module.
+
+[SVN 2126-2132] May 14, 2009
+    Add pygame.examples.go shortcut.
+    Add movieplayer example to the documents.
+    Some doc updates for test tags and python -m option.
+    Remove svn:executable tags and add setmods script to set executable
+      permissions.
+    Allowed the use of python -m pygame.tests.
+
+[SVN 2117-2122] May 13, 2009
+    A little tag test with the examples.
+    Undo prop change in rev 2120 test.
     [BUG] Fixed bug in font.c where pygame.font.Font returned the wrong
-    exception type and message when a font file was not found.
-    Thanks Bo Jangeborg.
+      exception type and message when a font file was not found.
+      Thanks Bo Jangeborg.
 
-[SVN 2114] May 10, 2009
+[SVN 2113-2115] May 11, 2009
+    Fixed color.c for Symbian  Updated Symbian build instructions  Updated
+      makeref.py with '--no-code-docs' feature to set empty module docstrings.
     Add <module>_tags.py modules to pygame.tests. This is an alternative
-    module level __tags__ globals in the unit test <module>_test.py files
-    themselves. The __tags__ global is placed in the corresponding
-    <module>_tags.py file instead. This means test modules can be skipped
-    by the pygame.tests.go test framework without actually loading the
-    test module and running possibly problematic code. It also means
-    the test framework can report on which test modules were skipped
-    and why.
+      module level __tags__ globals in the unit test <module>_test.py files
+      themselves. The __tags__ global is placed in the corresponding
+      <module>_tags.py file instead. This means test modules can be skipped
+      by the pygame.tests.go test framework without actually loading the
+      test module and running possibly problematic code. It also means
+      the test framework can report on which test modules were skipped
+      and why.
 
-[SVN 2104] May 9, 2009
+[SVN 2110-2112] May 10, 2009
+    Adapt run_tests.py test framework to Python 3.1.
+    Add automatic skip of unimplemented modules to run_tests.py framework.
+    Undo broken rev 2111.
+
+[SVN 2103-2106] May 9, 2009
+    Minor fixes for symbian merge.
+    Merging from symbian branch.
     [BUG] pygame.transform.threshold behaved incorrectly when passed a
-    Python long for the threshold argument.
+      Python long for the threshold argument.
 
-[SVN 2112] May 9, 2009
+[SVN 2078-2102] May 8, 2009
+    Starting to merge in sybian_s60 branch.
     Pygame unit test framework now works with Python 3.1. This includes the
-    run_tests__tests submodule.
+      run_tests__tests submodule.
+    Increase timeout limit to 2 min. for run_tests.py subprocesses.
+      This allows surface_test.py more time to complete (timed out on
+      automated build sites Mac.)
+    All standard Pygame extension modules compile and run with Python 3.
+      For a Python 3 build setup.py skips unsupported modules.
 
-[SVN 2080] May 7, 2009
-    Increase timeout limit to 2 min. for run_tests.py subprocesses.
-    This allows surface_test.py more time to complete (timed out on
-    automated build sites Mac.)
+[SVN 2074-2077] May 7, 2009
+    Just skip the scrap not-init test completely; Figure out how to test for
+      OS X later.  scrap not properly supported on OS X anyway
+    Fix string comprehension bug in sndarray_test.py.
+    Try to allow scrap test in base_test.py on non-OS X platforms.
 
-[SVN 2078] May 7, 2009
-    All standard Pygame extension modules compile and run with Python 3.
-    For a Python 3 build setup.py skips unsupported modules.
+[SVN 2065-2073] May 06, 2009
+    Adapt fastevent module for Python 3.1.
+    OS X now passes tests. See if the problem in base_test.py is with scrap.
+    Allow all Python modules to install with Python 3.1, though some may not
+      work correctly.
+    Update python 3.1 README to reflect current status.
+    Adapt overlay for python 3.1; untested though importing doesn't crash
+      anything.
+    OS X problem with base_test.py isolated to scrap module. Try a temporary
+      workaround.
+    Adapt joystick and cdrom modules for Python 3.1.
+    Try again with OS X and base_test.py.
 
-[SVN 2075] May 6, 2009
-    For OS X Skip scrap test in base_test.py which was causing some unit
-    tests to fail. scrap not properly supported on OS X anyway.
- 
+[SVN 2058-2064] May 05, 2009
+    Why does base_test.py fail on OS X?.
+    Yet more OS X testing with base_test.py.
+    More OS X testing of base_test.py.
+    Adapt mask module for Python 3.1.
+    Fix font.c problem with Python 3.1.
+    Undo accidental changes to Setup.in and __init__.py.
+    Add scroll.py example to Python 3.1 adapted programs.
+
+[SVN 2055-2057] May 04, 2009
+    More code fixes to transform.c for non-MMX machines.
+    Clean up METH_NOARG functions which were accidently given a second C
+      argument in display.c.
+    Make scrap test in base_test.py conditional on the presence of scrap.
+
+[SVN 2052] May 03, 2009
+    Fix compiler error in transform.c for non-MMX machines.
+
+[SVN 2049-2050] May 02, 2009
+    Merging with python3 branch r 2048.
+    Port Python 3 specific files from python3 branch.
+
 [SVN 2047] May 1, 2009
     Merge python3 branch back into trunk. This allows a minimal Pygame
     system to be built for Python 3. It also improves error checking
     in module init functions.
 
+[SVN 2046] Apr 30, 2009
+    [BUG] SDL_gfx used WIN32 macro instead of _WIN32 to detected Windows.
+
 [SVN 2040] Apr 24, 2009
     SDL_gfx module officially added to Pygame. 
-   
-[SVN 2046]
-    [BUG] SDL_gfx used WIN32 macro instead of _WIN32 to detected Windows.
 
-[SVN 2017] Apr 13, 2009
+[SVN 2024] Apr 18, 2009
+    A quick fix for jpeg saving not checking color order in 24 bit surfaces
+      Note that there is a similar bug remaining in the camera module.
+
+[SVN 2019] Apr 15, 2009
+    Merge src/__init__.py from python3 branch back into trunk.
+
+[SVN 2009-2017] Apr 13, 2009
     Add equality/inequality Event comparison as per mailing list request.
+    Patch from Sean Berry updating missing tests for Rects.
 
-[SVN 1953] Feb 22, 2009
+[SVN 1997] Apr 11, 2009
+    Make gfxdraw build on Windows.
+
+[SVN 1993] Apr 06, 2009
+    Bmp gives out of memory error... so use png instead.
+
+[SVN 1983-1985] Mar 30, 2009
+    Oops... hopefully this will work with mac/win.
+    Trying to move the source around to fix the compile bug...
+    Removing gfxdraw from compiling by default until get a chance to fix...
+
+[SVN 1980-1982] Mar 29, 2009
+    Included a couple of files from SDL_gfx for the gfxdraw module.
+    Added some more documentation, and a TODO note to the top of the file.
+    A tool for finding out what is documented, and what isn't.
+
+[SVN 1974-1976] Mar 26, 2009
+    Fixes gfxdraw.filled_polygon bug involving the point list.
+    More point list bug fixes.
+
+[SVN 1973] Mar 25, 2009
+    Adds tentative SDL_gfx module.
+
+[SVN 1969] Mar 24, 2009
+    Some minor comment corrections.
+
+[SVN 1967] Mar 16, 2009
+    Yuv420 reimplemented with formulas from libv4l.
+
+[SVN 1966] Mar 13, 2009
+    Re-add yuyv to rgb based on libv4l by Hans de Goede, licensed LGPL.
+
+[SVN 1965] Mar 12, 2009
+    Licensing problems in the Camera module.    Fixes the licensing for the
+      Bayer to RGB function.  Removes YUYV to RGB and YUV420 to YUV and RGB
+      functions until they are properly licensed.
+
+[SVN 1962] Mar 05, 2009
+    Fix bug that let the example scroll past the bottom.
+
+[SVN 1960] Mar 03, 2009
+    Don't need aliens_bootstrap.py as far as I can see.  Updated checks for
+      music module.  Made README.txt instructions correct.
+
+[SVN 1956-1957] Mar 01, 2009
+    Fixed some typos.
+    Started adding documentation for pygame.midi module.
+
+[SVN 1954] Feb 25, 2009
+    Allowed holding down the mouse, or key to scroll.
+
+[SVN 1940-1953] Feb 22, 2009
     Add 8 bit-per-pixel support to Surface.blit blends.
-
-[SVN 1952] Feb 22, 2009
     Added Surface.scroll method along with the scroll.py example.
-
-[SVN 1947] Feb 21, 2009
-    Made colorkey and blanket alpha blits handle a surface blit to self.
-    This addresses Bugzilla bug 19.
+    Added a runtime check for old unneeded files.
+    Made the error message nicer... and added checks for old py files too.
+    Removed debug print from warn_unwanted_files().
+    Add some comments, and a doc string to warn_unwanted_files.
+    Camera.init tries to detect correct platform camera module to use.
+    Added a few empty methods to opencv camera class that _camera uses.
+    Fixed dest_surf on opencv camera driver, added missing methods to vidcap
+      one.
+    [BUG]Made colorkey and blanket alpha blits handle a surface blit to self.
+      This addresses Bugzilla bug 19.
 
 [SVN 1937] Feb 19, 2009
     Add self-blit capacity to Pygame surfaces.
 
 [SVN 1934] Feb 18, 2009
     Surface raises a ValueError if the mask argument is rejected by SDL.
-    Before this the mangled, and invalid, SDL value was used.
+      Before this the mangled, and invalid, SDL value was used.
 
-[SVN 1924] Feb 12, 2009
+[SVN 1931-1932] Feb 16, 2009
+    Fixed to work with new test file layout.  Also imports modules if not
+      found.
+    Moved camera.c _camera.c .  created a lib/camera.py.
+
+[SVN 1928-1929] Feb 15, 2009
+    Made it use the pygame.examples.camera to test it.  Filled in missing
+      methods.
+    Fix erroneous ALPHA_BLEND macro argument.
+
+[SVN 1926-1927] Feb 14, 2009
+    Add psuedo-import to __init__.py atexit, required by pygame.base.
+    Remove an accidental colordict import introduced into __init__.py.
+
+[SVN 1924-1925] Feb 12, 2009
     Add Rect.copy method as per Bugzilla feature request 25.
+    Adding another import declaration for py2app/py2exe.
+      This makes using py2exe easy again.
 
-[SVN 1923] Feb 11, 2009
+[SVN 1922-1923] Feb 11, 2009
     [BUG] Fix per-pixel-alpha unpacking in surface fill-blends.
-
-[SVN 1922] Feb 11, 2009
     [BUG] Fix 24 bit-per-pixel fill-blends.
+    BLEND_RGBA_xxx and more BLEND_xxx tests; related bug fixes  (mostly 24 bit
+      surface related).
+    Fix per-pixel alpha bug involving pixel unpacking.
 
 [SVN 1920] Feb 11, 2009
     The Pygame documents and examples are now part of the Pygame package,
 
 [SVN 1912] Feb 6, 2009
     [BUG] Extension modules failed to raise an error when required modules
-    failed to import, as can happen with an incomplete py2exe/py2app
-    executable. This would later lead to mysterious segfaults. Extension
-    modules now forward import errors in the init function.
+      failed to import, as can happen with an incomplete py2exe/py2app
+      executable. This would later lead to mysterious segfaults. Extension
+      modules now forward import errors in the init function.
 
 [SVN 1903] Feb 3, 2009
     [BUG] _numpysurfarray.array_alpha() when a per-pixel alpha surface also
 
 [SVN 1893] Jan 29, 2009
     [BUG] Documentation infers that mixer.init and mixer.pre_init have keyword
-    arguments. Added as per Bugzilla issue 6.
+      arguments. Added as per Bugzilla issue 6.
     [BUG] Documentation states that mixer buffer sizes must be a power of 2.
-    New default buffer size is 4096. This was the implicit size anyway as
-    buffer size values were rounded up the the nearest power of 2.
+      New default buffer size is 4096. This was the implicit size anyway as
+      buffer size values were rounded up the the nearest power of 2.
 
-[SVN 1889] Jan 29, 2009
+[SVN 1888-1889] Jan 29, 2009
     sound_array_demos.py now uses either NumPy or Numeric.
+    _numpysndarray.py bug fix submitted by Nicholas Dudfield.
 
-[SVN 1881] Jan 26, 2009
+[SVN 1886] Jan 28, 2009
+    Updated msys config to use a fake PORTTIME variable... so it builds again
+      with mingw.
+
+[SVN 1881-1883] Jan 27, 2009
+    Add array_alpha and array_colorkey tests to surfarray_test.py.
+      array_alpha values incompatible with unmap_rgb for 16 bit surfaces -
+      fixed in _numpysurfarray.py, ignored in deprecated _numericsurfarray.c.
     For 16 bit surfaces make surfarray.array_alpha values consistent with those
-    returned by Surface.unmap_rgb.
+      returned by Surface.unmap_rgb.
+    Revert unintended change to surface.rgb_map in rev 1875.
+    Surfarray tests for make_surface, map_array, pixels2d and pixels_alpha,
+      Finished surfarray_test.py.
 
-[SVN 1859] Jan 22, 2009
-    NumPy now preferred over Numeric by surfarray and sndarray.
+[SVN 1880] Jan 26, 2009
+    Made it so we can use ctypes, instead of requiring win32 modules for the
+      windows test runner.
+
+[SVN 1871-1879] Jan 25, 2009
+    Completing the process to actually have numpy be the default.
+    Make subprocesses mode default for test runner.
+    Small fix for the nosubprocess change.
+    Fix pygame.init() problem in surfarray_test.py.
+    Surface.unmap_rgb now METH_O.
+    Add surface.map_rgb unit test.
+    Add surfarray.array2d, array3d, pixels2d and pixels3d unit tests.
+    Make surfarray_test skip tests known to fail with Numeric.
+    Making mac build with portmidi lib linked in.
+
+[SVN 1863-1870] Jan 24, 2009
+    Add array2d test to surfarray_test.py.
+    Move surfarray surface lock test to surfarray_test.py.
+    Surfarray.array3d unit test and 16 bitsize bug fix.
+    Surfarray get_arraytype, get_arraytypes and use_arraytype tests.
+    Edit tests module docs.
+    Another small tests doc typo.
+    Making it so we don't swallow exceptions...
+
+[SVN 1854-1861] Jan 23, 2009
+    Making it so we won't try to re-enter application installation.
+    Fix VC compiler error and make small code tweaks.
+    Add blit_array test for surface shifts.
+    Surfarray_test does nothing if no array module installed.
+    Add array tags to tests requiring NumPy or Numeric.
+    Numpy now takes priority over Numeric in sndarry and surfarray.
+    Fixed __hasnumpy/__hasnumeric confusion in sndarray.
 
 [SVN 1852] Jan 22, 2009
     [BUG] Fix Bugzilla bug 24 where surfarray.blit_array fails with a
     24 bit surface. A new blit_array, using the array structure interface,
     was added to a new _arraysurfarray extension module.
 
-[SVN 1846] Jan 18, 2009
+[SVN 1849-1853] Jan 22, 2009
+    [BUG] Fix Bugzilla bug 24 where surfarray.blit_array fails with a
+      24 bit surface. A new blit_array, using the array structure interface,
+      was added to a new _arraysurfarray extension module.
+    Fix NumPy bug in arraydemo.py and add an array choice command line
+      arguemnt.
+    Removed PyObjC dependency on OSX.
+
+[SVN 1845-1848] Jan 19, 2009
+    Make the main function consistent accross examples, taking arguments
+      where the programs except command line arguments.
+    Add examples module document page.
+    Minor change to usage message in test_runner.py.
+    Make some hyperlinks in the examples doc work.
     The Pygame examples is now a Pygame subpackage. Example programs can be
-    imported as modules and run by their main functions. The package
-    documentation is now part of the Pygame module docs.
+      imported as modules and run by their main functions. The package
+      documentation is now part of the Pygame module docs.
 
-[SVN 1839] Jan 14, 2009
+[SVN 1841-1843] Jan 16, 2009
+    Add pygame/tests/fixtures to installation (broken in previous setup.py
+      changes).
+    Add arguments to pygame.tests.run().
+    Add addition fake tests to installation.
+
+[SVN 1839-1840] Jan 15, 2009
     Color objects now support equality/inequality comparison with other
-    Color objects and color tuples.
+      Color objects and color tuples.
+    Jpeg image saving is not thread safe on windows after all.
 
-[SVN 1820] Jan 11, 2009
+[SVN 1834-1838] Jan 14, 2009
+    Examples\midi.py: add list option and main() function.
+    Remove absolete Windows doc installer stuff.
+    Remove old default Windows setup info.
+    Fix porttime Setup.in change.
+
+[SVN 1829-1833] Jan 13, 2009
+    Added argv arguments to main() too, and used pygame.quit.
+    Updated portmidi config for unix and darwin.  tested on ubuntu, not osx.
+    Added libporttime dependency, as required by ubuntu.
+    Added get_device_info function.
+    Printed out device info.  Allowed setting device id on the cmd line.
+
+[SVN 1819-1827] Jan 12, 2009
+    Pygame docs: fixed some links.
+    Docs added to Pygame package.
+    Added __init__.py to make examples a package.
+    Examples can be run from outside the examples directory.
+    Corrects some terminology in the tests package doc.
+    Call pygame.quit to clean up things.  closes window when called from
+      pygame.examples.chimp.main() finishes, and for when run from idle.
+    Update setup.py to reflect examples becoming a package.
+    Updated examples so that they all have a main() and use pygame.quit.
     Pygame documents now installed as part of the pygame package directory.
 
-[SVN 1814] Jan 09, 2009
+[SVN 1816-1817] Jan 11, 2009
+    Pygame.tests: prepare run_tests__tests for addition.
+    Pygame.examples: completely installs.
+
+[SVN 1813-1815] Jan 10, 2009
     Pygame unit test suite is now the pygame.tests package. For Pygame
     development the unit tests still run from test in the installation
     directory without conflicts.
 
-[SVN 1803] Jan 6, 2009
-    Add midi.py keyboard example.
+[SVN 1802-1804] Jan 07, 2009
+    Refactored midi.py example and added comments.
+    Finished midi.py keyboard example, added velocity.
+    Added test command to setup.py.  so you can do 'python setup.py test'.
 
-[SVN 1794] Jan 3, 2009
+[SVN 1796-1798] Jan 05, 2009
+    Mask convolve function and tests from Michael George.
+    Update docs for pygame.mixer.music.load: thanks Forrest Voight.
+    Clean up some carriage return confusion in the docs.
+
+[SVN 1793-1794] Jan 04, 2009
+    Update midi example to add animated keyboard keys.
     Add scripts to build Python 2.6/3.0 Windows dependencies linked to msvcr90.
 
+[SVN 1776-1777] Dec 27, 2008
+    Add get default device functions for midi module.
+    Expand midi output example into a musical keyboard demo.
+
+[SVN 1772-1775] Dec 24, 2008
+    Pypm: temporary Setup.in fix to add header and library paths for Windows
+      prebuilt.
+    Added Output class and atexit stuff similar to Lenards code.
+    Added output example from Lenard, and moved input example out of midi
+      module into the midi example.
+
+[SVN 1764-1771] Dec 23, 2008
+    Windows prebuilts: Python 2.6 preparation.
+    Added pygame.mixer_music fake import in function to maybe help with py2app.
+    Undo fake import for py2app.
+    Try rearranging stuff for py2app.
+    Add portmidi to Windows build.
+    Added code from pyportmidi to be used from pygame.midi.
+    Added pyportmidi 0.0.4 changes from Tim Thompson.  Thanks!.
+
+[SVN 1759-1760] Dec 22, 2008
+    The freetype dll was not being copied into the site-packages/pygame dir on
+      windows.
+    Added start of midi module which uses portmidi.
+
+[SVN 1755-1758] Dec 19, 2008
+    Added in an extra debugging line... for testing with py2app.
+    Fixed error for msvc compiler.
+    Moved brackets closer... suspecting possible dodgey introspection in
+      py2app.
+    Missed freeing surface on malloc out of memory error for saving jpegs.
+
+[SVN 1751-1754] Dec 18, 2008
+    Added some debugging notes for py2app mixer_music issue.
+    Msys_build_deps.py: added portmidi.
+    Setup_Win.in: add portmidi.
+
+[SVN 1749-1750] Dec 17, 2008
+    Add program to list Pygame modules accessed by a unit test module.
+    [BUG] Bug 28: possible fix.
+
 Dec 05, 2008
     exposed mask C API from Michael George.  Thanks!
 
-
 Aug 30, 2008
     [BUG] Fixed CREATE_PIXEL macro's use of Aloss
     which was making surface.fill with surfaces with no alpha go green 
 
+
+release_1_8_1release
+[SVN 1537] Jul 28, 2008
+    pygame 1.8.1release released.
+
 Jul 18, 2008
     Added Surface.set_masks and .set_shifts useful for using data in
         b,g,r,a mode... and other fun hacks.

File docs/ref/cursors.html

 <a name="pygame.cursors.load_xbm">
 <big><b>pygame.cursors.load_xbm</big></b><br><ul>
   <i>load cursor data from an xbm file</i><br>
-  <tt>pygame.cursors.load_xbm(cursorfile, maskfile=None): return cursor_args</tt><br>
+  <tt>pygame.cursors.load_xbm(cursorfile): return cursor_args</tt><br>
+  <tt>pygame.cursors.load_xbm(cursorfile, maskfile): return cursor_args</tt><br>
 <p>This loads cursors for a simple subset of <tt>XBM</tt> files. <tt>XBM</tt> files are traditionally used to store cursors on unix systems, they are an ascii format used to represent simple images. </p>
 <p>Sometimes the black and white color values will be split into two separate <tt>XBM</tt> files. You can pass a second maskfile argument to load the two images into a single cursor. </p>
 <p>The cursorfile and maskfile arguments can either be filenames or filelike object with the readlines method. </p>

File docs/ref/gfxdraw.html

 <p><tt>EXPERIMENTAL!:</tt> meaning this api may change, or dissapear in later pygame releases. If you use this, your code will break with the next pygame release. </p>
 <p>Most of the functions accept a color argument that is an <tt>RGB</tt> triplet. These can also accept an <tt>RGBA</tt> quadruplet. The color argument can also be an integer pixel value that is already mapped to the Surface's pixel format. </p>
 <p>For all functions the arguments are strictly positional. Only integers are accepted for coordinates and radii. </p>
+<p>For functions like rectangle that accept a rect argument any (x, y, w, h) sequence is accepted, though <tt>pygame.Rect</tt> instances are prefered. Note that for a <tt>pygame.Rect</tt> the drawing will not include <tt>Rect.bottomright</tt>. The right and bottom attributes of a Rect lie one pixel outside of the Rect's boarder. </p>
 <p>New in pygame <tt>1.9.0</tt>. </p>
 <!--COMMENTS:pygame.gfxdraw--> &nbsp;<br> 
 
 <big><b>pygame.gfxdraw.textured_polygon</big></b><br><ul>
   <i>draw a textured polygon</i><br>
   <tt>pgyame.gfxdraw.textured_polygon(surface, points, texture, tx, ty): return None</tt><br>
- &nbsp;<br> 
+<p><tt>A</tt> per-pixel alpha texture blit to a per-pixel alpha surface will differ from a <tt><a href="surface.html#Surface.blit">Surface.blit</a> - <font size=-1>draw one image onto another</font></tt> blit. Also, a per-pixel alpha texture cannot be used with an 8-bit per pixel destination. </p>
 <!--COMMENTS:pygame.gfxdraw.textured_polygon--> &nbsp;<br> 
 <br></ul>
 

File docs/ref/index.html

 <ul>
 <li><a href="midi.html#pygame.midi.Input">pygame.midi.Input</a> - <font size=-1>Input is used to get midi input from midi devices.</font></li>
 <ul>
+<li><a href="midi.html#Input.close">Input.close</a> - <font size=-1> closes a midi stream, flushing any pending buffers.</font></li>
 <li><a href="midi.html#Input.poll">Input.poll</a> - <font size=-1>returns true if there's data, or false if not.</font></li>
 <li><a href="midi.html#Input.read">Input.read</a> - <font size=-1>reads num_events midi events from the buffer.</font></li>
 </ul>
 <li><a href="midi.html#pygame.midi.MidiException">pygame.midi.MidiException</a> - <font size=-1>exception that pygame.midi functions and classes can raise</font></li>
 <li><a href="midi.html#pygame.midi.Output">pygame.midi.Output</a> - <font size=-1>Output is used to send midi to an output device</font></li>
 <ul>
+<li><a href="midi.html#Output.abort">Output.abort</a> - <font size=-1> terminates outgoing messages immediately</font></li>
+<li><a href="midi.html#Output.close">Output.close</a> - <font size=-1> closes a midi stream, flushing any pending buffers.</font></li>
 <li><a href="midi.html#Output.note_off">Output.note_off</a> - <font size=-1>turns a midi note off.  Note must be on.</font></li>
 <li><a href="midi.html#Output.note_on">Output.note_on</a> - <font size=-1>turns a midi note on.  Note must be off.</font></li>
 <li><a href="midi.html#Output.set_instrument">Output.set_instrument</a> - <font size=-1>select an instrument, with a value between 0 and 127</font></li>

File docs/ref/mask.html

 <a name="pygame.mask.from_threshold">
 <big><b>pygame.mask.from_threshold</big></b><br><ul>
   <i>Creates a mask by thresholding Surfaces</i><br>
-  <tt>pygame.mask.from_surface(Surface, color, threshold = (0,0,0,255), othersurface = None) -> Mask</tt><br>
+  <tt>pygame.mask.from_surface(Surface, color, threshold = (0,0,0,255), othersurface = None, palette_colors = 1) -> Mask</tt><br>
 <p>This is a more featureful method of getting a Mask from a Surface. If supplied with only one Surface, all pixels within the threshold of the supplied color are set in the Mask. If given the optional othersurface, all pixels in Surface that are within the threshold of the corresponding pixel in othersurface are set in the Mask. </p>
 <!--COMMENTS:pygame.mask.from_threshold--> &nbsp;<br> 
 <br></ul>

File docs/ref/midi.html

 <p>The midi module can send output to midi devices, and get input from midi devices. It can also list midi devices on the system. </p>
 <p>Including real midi devices, and virtual ones. </p>
 <p>It uses the portmidi library. Is portable to which ever platforms portmidi supports (currently windows, <tt>OSX</tt>, and linux). </p>
-<p>This uses pyportmidi for now, but may use its own bindings at some point in the future. </p>
+<p>This uses pyportmidi for now, but may use its own bindings at some point in the future. The pyportmidi bindings are included with pygame. </p>
 <p>New in pygame <tt>1.9.0</tt>. </p>
 <!--COMMENTS:pygame.midi--> &nbsp;<br> 
 
   <tt>Input(device_id)</tt><br>
   <tt>Input(device_id, buffer_size)</tt><br>
 <ul><small><table>
+  <tr><td><a href="midi.html#Input.close">Input.close</a> - <font size=-1> closes a midi stream, flushing any pending buffers.</font></td><td> closes a midi stream, flushing any pending buffers.</td></tr>
   <tr><td><a href="midi.html#Input.poll">Input.poll</a> - <font size=-1>returns true if there's data, or false if not.</font></td><td>returns true if there's data, or false if not.</td></tr>
   <tr><td><a href="midi.html#Input.read">Input.read</a> - <font size=-1>reads num_events midi events from the buffer.</font></td><td>reads num_events midi events from the buffer.</td></tr>
 </table></small></ul>
 <!--COMMENTS:pygame.midi.Input--> &nbsp;<br> 
 
 
+<a name="Input.close">
+<big><b>Input.close</big></b><br><ul>
+  <i> closes a midi stream, flushing any pending buffers.</i><br>
+  <tt>Input.close(): return None</tt><br>
+<p>PortMidi attempts to close open streams when the application exits -- this is particularly difficult under Windows. </p>
+<!--COMMENTS:Input.close--> &nbsp;<br> 
+<br></ul>
+
+
 <a name="Input.poll">
 <big><b>Input.poll</big></b><br><ul>
   <i>returns true if there's data, or false if not.</i><br>
   <tt>Output(device_id, buffer_size = 4096)</tt><br>
   <tt>Output(device_id, latency, buffer_size)</tt><br>
 <ul><small><table>
+  <tr><td><a href="midi.html#Output.abort">Output.abort</a> - <font size=-1> terminates outgoing messages immediately</font></td><td> terminates outgoing messages immediately</td></tr>
+  <tr><td><a href="midi.html#Output.close">Output.close</a> - <font size=-1> closes a midi stream, flushing any pending buffers.</font></td><td> closes a midi stream, flushing any pending buffers.</td></tr>
   <tr><td><a href="midi.html#Output.note_off">Output.note_off</a> - <font size=-1>turns a midi note off.  Note must be on.</font></td><td>turns a midi note off.  Note must be on.</td></tr>
   <tr><td><a href="midi.html#Output.note_on">Output.note_on</a> - <font size=-1>turns a midi note on.  Note must be off.</font></td><td>turns a midi note on.  Note must be off.</td></tr>
   <tr><td><a href="midi.html#Output.set_instrument">Output.set_instrument</a> - <font size=-1>select an instrument, with a value between 0 and 127</font></td><td>select an instrument, with a value between 0 and 127</td></tr>
 <!--COMMENTS:pygame.midi.Output--> &nbsp;<br> 
 
 
+<a name="Output.abort">
+<big><b>Output.abort</big></b><br><ul>
+  <i> terminates outgoing messages immediately</i><br>
+  <tt>Output.abort(): return None</tt><br>
+<p>The caller should immediately close the output port; this call may result in transmission of a partial midi message. There is no abort for Midi input because the user can simply ignore messages in the buffer and close an input device at any time. </p>
+<!--COMMENTS:Output.abort--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="Output.close">
+<big><b>Output.close</big></b><br><ul>
+  <i> closes a midi stream, flushing any pending buffers.</i><br>
+  <tt>Output.close(): return None</tt><br>
+<p>PortMidi attempts to close open streams when the application exits -- this is particularly difficult under Windows. </p>
+<!--COMMENTS:Output.close--> &nbsp;<br> 
+<br></ul>
+
+
 <a name="Output.note_off">
 <big><b>Output.note_off</big></b><br><ul>
   <i>turns a midi note off.  Note must be on.</i><br>

File docs/ref/rect.html

 <p>The coordinates for Rect objects are all integers. The size values can be programmed to have negative values, but these are considered illegal Rects for most operations. </p>
 <p>There are several collision tests between other rectangles. Most python containers can be searched for collisions against a single Rect. </p>
 <p>The area covered by a Rect does not include the right- and bottom-most edge of pixels. If one Rect's bottom border is another Rect's top border <tt>(i.e.</tt>, <tt>rect1.bottom=rect2.top)</tt>, the two meet exactly on the screen but do not overlap, and <tt>rect1.colliderect(rect2)</tt> returns false. </p>
-<p>Though Rect can be subclassed, methods that return new rectangles are not subclass aware. That is, move or copy with return a new <tt>pygame.Rect</tt> instance, not an instance of the subclass. This may change. To make subclass awareness work though, subclasses may have to maintain the same constructor signature as Rect. </p>
+<p>Though Rect can be subclassed, methods that return new rectangles are not subclass aware. That is, move or copy return a new <tt>pygame.Rect</tt> instance, not an instance of the subclass. This may change. To make subclass awareness work though, subclasses may have to maintain the same constructor signature as Rect. </p>
 <!--COMMENTS:pygame.Rect--> &nbsp;<br> 
 
 

File docs/ref/surface.html

 <p>Return the <tt>RGBA</tt> color value at the given pixel. If the Surface has no per pixel alpha, then the alpha value will always be 255 (opaque). If the pixel position is outside the area of the Surface an IndexError exception will be raised. </p>
 <p>Getting and setting pixels one at a time is generally too slow to be used in a game or realtime situation. </p>
 <p>This function will temporarily lock and unlock the Surface as needed. </p>
+<p>Returning a Color instead of tuple, New in pygame <tt>1.9.0</tt>. Use <tt>tuple(surf.get_at((x,y)))</tt> if you want a tuple, and not a Color. This should only matter if you want to use the color as a key in a dict. </p>
 <!--COMMENTS:Surface.get_at--> &nbsp;<br> 
 <br></ul>
 
   <i>get the color index palette for an 8bit Surface</i><br>
   <tt>Surface.get_palette(): return [RGB, RGB, RGB, ...]</tt><br>
 <p>Return a list of up to 256 color elements that represent the indexed colors used in an 8bit Surface. The returned list is a copy of the palette, and changes will have no effect on the Surface. </p>
+<p>Returning a list of Color instances instead of tuples, New in pygame <tt>1.9.0</tt> </p>
 <!--COMMENTS:Surface.get_palette--> &nbsp;<br> 
 <br></ul>
 
   <i>get the color for a single entry in a palette</i><br>
   <tt>Surface.get_palette_at(index): return RGB</tt><br>
 <p>Returns the red, green, and blue color values for a single index in a Surface palette. The index should be a value from 0 to 255. </p>
+<p>Returning Color instance instead of a tuple, New in pygame <tt>1.9.0</tt> </p>
 <!--COMMENTS:Surface.get_palette_at--> &nbsp;<br> 
 <br></ul>
 

File examples/aacircle.py

-#!/usr/bin/env python
-
-"""Proof of concept gfxdraw example"""
-
-import pygame
-import pygame.gfxdraw
-
-def main():
-    pygame.init()
-    screen = pygame.display.set_mode((500,500))
-    screen.fill((255, 0, 0))
-    s = pygame.Surface(screen.get_size(), pygame.SRCALPHA, 32)
-    pygame.gfxdraw.aacircle(s, 250, 250, 200, (0, 0, 0))
-    screen.blit(s, (0, 0))
-    pygame.display.flip()
-    try:
-        while 1:
-            event = pygame.event.wait()
-            if event.type == pygame.QUIT:
-                break
-            if event.type == pygame.KEYDOWN:
-                if event.key == pygame.K_ESCAPE or event.unicode == 'q':
-                    break
-            pygame.display.flip()
-    finally:
-        pygame.quit()
-
-if __name__ == '__main__':
-    main()
+#!/usr/bin/env python
+
+"""Proof of concept gfxdraw example"""
+
+import pygame
+import pygame.gfxdraw
+
+def main():
+    pygame.init()
+    screen = pygame.display.set_mode((500,500))
+    screen.fill((255, 0, 0))
+    s = pygame.Surface(screen.get_size(), pygame.SRCALPHA, 32)
+    pygame.gfxdraw.aacircle(s, 250, 250, 200, (0, 0, 0))
+    screen.blit(s, (0, 0))
+    pygame.display.flip()
+    try:
+        while 1:
+            event = pygame.event.wait()
+            if event.type == pygame.QUIT:
+                break
+            if event.type == pygame.KEYDOWN:
+                if event.key == pygame.K_ESCAPE or event.unicode == 'q':
+                    break
+            pygame.display.flip()
+    finally:
+        pygame.quit()
+
+if __name__ == '__main__':
+    main()

File examples/midi.py

     _print_device_info()
 
     if device_id is None:
-        port = pygame.midi.get_default_device_id()
+        port = pygame.midi.get_default_output_id()
     else:
         port = device_id
 

File lib/__init__.py

     ext_to_remove = ["camera"]
 
     # here are the .py/.pyo/.pyc files we need to ask to remove.
-    py_to_remove = ["color"]
+    #py_to_remove = ["color"]
+    # color.py from the symbian branch imports color.so
+    py_to_remove = []
     
     if os.name == "e32": # Don't warn on Symbian. The color.py is used as a wrapper.
         py_to_remove = []
 	return __rect_constructor, (r.x, r.y, r.w, r.h)
 copy_reg.pickle(Rect, __rect_reduce, __rect_constructor)
 
+
+#make Colors pickleable
+def __color_constructor(r,g,b,a):
+        return Color(r,g,b,a)
+def __color_reduce(c):
+        assert type(c) == Color
+        return __color_constructor, (c.r, c.g, c.b, c.a)
+copy_reg.pickle(Color, __color_reduce, __color_constructor)
+
+
+
+
 #cleanup namespace
 del pygame, os, sys, rwobject, surflock, MissingModule, copy_reg, geterror

File lib/midi.doc

 portmidi supports (currently windows, OSX, and linux).
 
 This uses pyportmidi for now, but may use its own bindings at some
-point in the future.
+point in the future.  The pyportmidi bindings are included with pygame.
 
 New in pygame 1.9.0.
 
 
 
 
+close
+ closes a midi stream, flushing any pending buffers.
+Input.close(): return None
+
+PortMidi attempts to close open streams when the application
+exits -- this is particularly difficult under Windows.
+<END>
+
+
+
 poll
 returns true if there's data, or false if not.
 Input.poll(): return Bool
 
 
 
+abort
+ terminates outgoing messages immediately
+Output.abort(): return None
+
+The caller should immediately close the output port;
+this call may result in transmission of a partial midi message.
+There is no abort for Midi input because the user can simply
+ignore messages in the buffer and close an input device at
+any time.
+<END>
+
+
+
+close
+ closes a midi stream, flushing any pending buffers.
+Output.close(): return None
+
+PortMidi attempts to close open streams when the application
+exits -- this is particularly difficult under Windows.
+<END>
+
+
+
 note_off
 turns a midi note off.  Note must be on.
 Output.note_off(note, velocity=None, channel = 0)
 portmidi supports (currently windows, OSX, and linux).
 
 This uses pyportmidi for now, but may use its own bindings at some
-point in the future.
+point in the future.  The pyportmidi bindings are included with pygame.
 
 New in pygame 1.9.0.
 """
         atexit.register(quit)
 
 
-
 def quit():
     """uninitialize the midi module
     pygame.midi.quit(): return None
     Note: in the current release, the default is simply the first device
     (the input or output device with the lowest PmDeviceID).
     """
+    _check_init()
     return _pypm.GetDefaultOutputDeviceID()
 
 
 
     If the id is out of range, the function returns None.
     """
+    _check_init()
     return _pypm.GetDeviceInfo(an_id) 
 
 
         The buffer_size specifies the number of input events to be buffered 
         waiting to be read using Input.read().
         """
-        self._input = _pypm.Input(device_id, buffer_size)
-        self.device_id = device_id
+        _check_init()
+ 
+        if device_id == -1:
+            raise MidiException("Device id is -1, not a valid output id.  -1 usually means there were no default Output devices.")
+            
+        try:
+            r = get_device_info(device_id)
+        except TypeError:
+            raise TypeError("an integer is required")
+        except OverflowError:
+            raise OverflowError("long int too large to convert to int")
+
+        # and now some nasty looking error checking, to provide nice error 
+        #   messages to the kind, lovely, midi using people of whereever.
+        if r:
+            interf, name, input, output, opened = r
+            if input:
+                try:
+                    self._input = _pypm.Input(device_id, buffer_size)
+                except TypeError:
+                    raise TypeError("an integer is required")
+                self.device_id = device_id
+
+            elif output:
+                raise MidiException("Device id given is not a valid input id, it is an output id.")
+            else:
+                raise MidiException("Device id given is not a valid input id.")
+        else:
+            raise MidiException("Device id invalid, out of range.")
+
+
+
+
+    def _check_open(self):
+        if self._input is None:
+            raise MidiException("midi not open.")
+
+
+
+    def close(self):
+        """ closes a midi stream, flushing any pending buffers.
+        Input.close(): return None
+
+        PortMidi attempts to close open streams when the application
+        exits -- this is particularly difficult under Windows.
+        """
+        _check_init()
+        if not (self._input is None):
+            self._input.Close()
+        self._input = None
+
 
 
     def read(self, num_events):
         [[[status,data1,data2,data3],timestamp],
          [[status,data1,data2,data3],timestamp],...]
         """
+        _check_init()
+        self._check_open()
         return self._input.Read(num_events)
 
 
 
         raises a MidiException on error.
         """
+        _check_init()
+        self._check_open()
+
         r = self._input.Poll()
         if r == _pypm.TRUE:
             return True
         to synchronize midi data to audio data by matching midi latency to 
         the audio buffer latency.
         """
-        self._output = _pypm.Output(device_id, latency)
-        self.device_id = device_id
+     
+        _check_init()
+        self._aborted = 0
+
+        if device_id == -1:
+            raise MidiException("Device id is -1, not a valid output id.  -1 usually means there were no default Output devices.")
+            
+        try:
+            r = get_device_info(device_id)
+        except TypeError:
+            raise TypeError("an integer is required")
+        except OverflowError:
+            raise OverflowError("long int too large to convert to int")
+
+        # and now some nasty looking error checking, to provide nice error 
+        #   messages to the kind, lovely, midi using people of whereever.
+        if r:
+            interf, name, input, output, opened = r
+            if output:
+                try:
+                    self._output = _pypm.Output(device_id, latency)
+                except TypeError:
+                    raise TypeError("an integer is required")
+                self.device_id = device_id
+
+            elif input:
+                raise MidiException("Device id given is not a valid output id, it is an input id.")
+            else:
+                raise MidiException("Device id given is not a valid output id.")
+        else:
+            raise MidiException("Device id invalid, out of range.")
+
+    def _check_open(self):
+        if self._output is None:
+            raise MidiException("midi not open.")
+
+        if self._aborted:
+            raise MidiException("midi aborted.")
+
+
+    def close(self):
+        """ closes a midi stream, flushing any pending buffers.
+        Output.close(): return None
+
+        PortMidi attempts to close open streams when the application
+        exits -- this is particularly difficult under Windows.
+        """
+        _check_init()
+        if not (self._output is None):
+            self._output.Close()
+        self._output = None
+
+    def abort(self):
+        """terminates outgoing messages immediately
+        Output.abort(): return None
+
+        The caller should immediately close the output port;
+        this call may result in transmission of a partial midi message.
+        There is no abort for Midi input because the user can simply
+        ignore messages in the buffer and close an input device at
+        any time.
+        """
+
+        _check_init()
+        if self._output:
+            self._output.Abort()
+        self._aborted = 1
+
+
+
+
 
     def write(self, data):
         """writes a list of midi data to the Output
         Can send up to 1024 elements in your data list, otherwise an 
          IndexError exception is raised.
         """
+        _check_init()
+        self._check_open()
+
         self._output.Write(data)
 
 
         example: note 65 on with velocity 100
              write_short(0x90,65,100)
         """
+        _check_init()
+        self._check_open()
         self._output.WriteShort(status, data1, data2)
 
 
             o.write_sys_ex(pygame.midi.time(),
                            [0xF0,0x7D,0x10,0x11,0x12,0x13,0xF7])
         """
+        _check_init()
+        self._check_open()
         self._output.WriteSysEx(when, msg)
 
 

File lib/sysfont.py

 # with extra files added from:
 # http://www.ampsoft.net/webdesign-l/windows-fonts-by-version.html
 # File name, family, (Bold, Italic)
-XP_default_font_files = [
+_XP_default_font_files = [
     ('ahronbd.ttf', 'Aharoni', True, False),
     ('andlso.ttf', 'Andalus', False, False),
     ('angsa.ttf', 'Angsana New', False, False),
     ('batang.ttc', 'Batang', False, False),
     ]
 
+
+
+
 def initsysfonts_win32():
     try:
         import _winreg
     #fonts may not be entered in the registry.
     win_font_files_mapping = dict(
         [(file_name.lower(), (_simplename(name), bold, italic))
-         for file_name, name, bold, italic in XP_default_font_files])
+         for file_name, name, bold, italic in _XP_default_font_files])
 
     font_dir_path = os.path.join(windir, 'fonts')
     try:
     return fonts
 
 
-#read of the fonts on osx (fill me in!)
+
+
+
+_OSX_default_font_files = {
+ 'albayan': {(False, False): '/Library/Fonts/AlBayan.ttf',
+             (True, False): '/Library/Fonts/AlBayanBold.ttf'},
+ 'andalemono': {(False, False): '/Library/Fonts/Andale Mono.ttf'},
+ 'applebraille': {(False, False): '/System/Library/Fonts/Apple Braille Outline 6 Dot.ttf'},
+ 'applegothic': {(False, False): '/System/Library/Fonts/AppleGothic.ttf'},
+ 'applesymbols': {(False, False): '/System/Library/Fonts/Apple Symbols.ttf'},
+ 'arial': {(False, False): '/Library/Fonts/Arial.ttf',
+           (False, True): '/Library/Fonts/Arial Italic.ttf',
+           (True, False): '/Library/Fonts/Arial Bold.ttf',
+           (True, True): '/Library/Fonts/Arial Bold Italic.ttf'},
+ 'arialblack': {(False, False): '/Library/Fonts/Arial Black.ttf'},
+ 'arialhebrew': {(False, False): '/Library/Fonts/ArialHB.ttf',
+                 (True, False): '/Library/Fonts/ArialHBBold.ttf'},
+ 'arialnarrow': {(False, False): '/Library/Fonts/Arial Narrow.ttf',
+                 (False, True): '/Library/Fonts/Arial Narrow Italic.ttf',
+                 (True, False): '/Library/Fonts/Arial Narrow Bold.ttf',
+                 (True, True): '/Library/Fonts/Arial Narrow Bold Italic.ttf'},
+ 'arialroundedmtbold': {(False, False): '/Library/Fonts/Arial Rounded Bold.ttf'},
+ 'arialunicodems': {(False, False): '/Library/Fonts/Arial Unicode.ttf'},
+ 'ayuthaya': {(False, False): '/Library/Fonts/Ayuthaya.ttf'},
+ 'baghdad': {(False, False): '/Library/Fonts/Baghdad.ttf'},
+ 'brushscriptmt': {(False, True): '/Library/Fonts/Brush Script.ttf'},
+ 'chalkboard': {(False, False): '/Library/Fonts/Chalkboard.ttf',
+                (True, False): '/Library/Fonts/ChalkboardBold.ttf'},
+ 'comicsansms': {(False, False): '/Library/Fonts/Comic Sans MS.ttf',
+                 (True, False): '/Library/Fonts/Comic Sans MS Bold.ttf'},
+ 'corsivahebrew': {(False, False): '/Library/Fonts/Corsiva.ttf',
+                   (True, False): '/Library/Fonts/CorsivaBold.ttf'},
+ 'couriernew': {(False, False): '/Library/Fonts/Courier New.ttf',
+                (False, True): '/Library/Fonts/Courier New Italic.ttf',
+                (True, False): '/Library/Fonts/Courier New Bold.ttf',
+                (True, True): '/Library/Fonts/Courier New Bold Italic.ttf'},
+ 'decotypenaskh': {(False, False): '/Library/Fonts/DecoTypeNaskh.ttf'},
+ 'devanagarimt': {(False, False): '/Library/Fonts/DevanagariMT.ttf',
+                  (True, False): '/Library/Fonts/DevanagariMTBold.ttf'},
+ 'euphemiaucas': {(False, False): '/Library/Fonts/EuphemiaCASRegular.ttf',
+                  (False, True): '/Library/Fonts/EuphemiaCASItalic.ttf',
+                  (True, False): '/Library/Fonts/EuphemiaCASBold.ttf'},
+ 'gb18030bitmap': {(False, False): '/Library/Fonts/NISC18030.ttf'},
+ 'geezapro': {(False, False): '/System/Library/Fonts/Geeza Pro.ttf',
+              (True, False): '/System/Library/Fonts/Geeza Pro Bold.ttf'},
+ 'georgia': {(False, False): '/Library/Fonts/Georgia.ttf',
+             (False, True): '/Library/Fonts/Georgia Italic.ttf',
+             (True, False): '/Library/Fonts/Georgia Bold.ttf',
+             (True, True): '/Library/Fonts/Georgia Bold Italic.ttf'},
+ 'gujaratimt': {(False, False): '/Library/Fonts/GujaratiMT.ttf',
+                (True, False): '/Library/Fonts/GujaratiMTBold.ttf'},
+ 'gurmukhimt': {(False, False): '/Library/Fonts/Gurmukhi.ttf'},
+ 'impact': {(False, False): '/Library/Fonts/Impact.ttf'},
+ 'inaimathi': {(False, False): '/Library/Fonts/InaiMathi.ttf'},
+ 'kailasa': {(False, False): '/Library/Fonts/Kailasa.ttf'},
+ 'kokonor': {(False, False): '/Library/Fonts/Kokonor.ttf'},
+ 'krungthep': {(False, False): '/Library/Fonts/Krungthep.ttf'},
+ 'kufistandardgk': {(False, False): '/Library/Fonts/KufiStandardGK.ttf'},
+ 'liheipro': {(False, False): '/System/Library/Fonts/ Pro.ttf'},
+ 'lisongpro': {(False, False): '/Library/Fonts/ Pro.ttf'},
+ 'microsoftsansserif': {(False, False): '/Library/Fonts/Microsoft Sans Serif.ttf'},
+ 'mshtakan': {(False, False): '/Library/Fonts/MshtakanRegular.ttf',
+              (False, True): '/Library/Fonts/MshtakanOblique.ttf',
+              (True, False): '/Library/Fonts/MshtakanBold.ttf',
+              (True, True): '/Library/Fonts/MshtakanBoldOblique.ttf'},
+ 'nadeem': {(False, False): '/Library/Fonts/Nadeem.ttf'},
+ 'newpeninimmt': {(False, False): '/Library/Fonts/NewPeninimMT.ttf',
+                  (True, False): '/Library/Fonts/NewPeninimMTBoldInclined.ttf'},
+ 'plantagenetcherokee': {(False, False): '/Library/Fonts/PlantagenetCherokee.ttf'},
+ 'raanana': {(False, False): '/Library/Fonts/Raanana.ttf',
+             (True, False): '/Library/Fonts/RaananaBold.ttf'},
+ 'sathu': {(False, False): '/Library/Fonts/Sathu.ttf'},
+ 'silom': {(False, False): '/Library/Fonts/Silom.ttf'},
+ 'stfangsong': {(False, False): '/Library/Fonts/.ttf'},
+ 'stheiti': {(False, False): '/System/Library/Fonts/.ttf'},
+ 'stkaiti': {(False, False): '/Library/Fonts/.ttf'},
+ 'stsong': {(False, False): '/Library/Fonts/.ttf'},
+ 'tahoma': {(False, False): '/Library/Fonts/Tahoma.ttf',
+            (True, False): '/Library/Fonts/Tahoma Bold.ttf'},
+ 'thonburi': {(False, False): '/System/Library/Fonts/Thonburi.ttf',
+              (True, False): '/System/Library/Fonts/ThonburiBold.ttf'},
+ 'timesnewroman': {(False, False): '/Library/Fonts/Times New Roman.ttf',
+                   (False, True): '/Library/Fonts/Times New Roman Italic.ttf',
+                   (True, False): '/Library/Fonts/Times New Roman Bold.ttf',
+                   (True, True): '/Library/Fonts/Times New Roman Bold Italic.ttf'},
+ 'trebuchetms': {(False, False): '/Library/Fonts/Trebuchet MS.ttf',
+                 (False, True): '/Library/Fonts/Trebuchet MS Italic.ttf',
+                 (True, False): '/Library/Fonts/Trebuchet MS Bold.ttf',
+                 (True, True): '/Library/Fonts/Trebuchet MS Bold Italic.ttf'},
+ 'verdana': {(False, False): '/Library/Fonts/Verdana.ttf',
+             (False, True): '/Library/Fonts/Verdana Italic.ttf',
+             (True, False): '/Library/Fonts/Verdana Bold.ttf',
+             (True, True): '/Library/Fonts/Verdana Bold Italic.ttf'},
+ 'webdings': {(False, False): '/Library/Fonts/Webdings.ttf'},
+ 'wingdings': {(False, False): '/Library/Fonts/Wingdings.ttf'},
+ 'wingdings2': {(False, False): '/Library/Fonts/Wingdings 2.ttf'},
+ 'wingdings3': {(False, False): '/Library/Fonts/Wingdings 3.ttf'}}
+
+
+def _search_osx_font_paths(fonts):
+
+    for name, details in _OSX_default_font_files.items():
+        for k, apath in details.items():
+            if os.path.exists(apath):
+                bold, italic = k
+                _addfont(name, bold, italic, apath, fonts) 
+
+
 def initsysfonts_darwin():
+    """ read the fonts on OSX.
+    """
     # if the X11 binary exists... try and use that.
-    #  TODO: Not likely to be there on pre 10.4.x ...
-    #    so still need to do other OSX specific method.
+    #  Not likely to be there on pre 10.4.x ...
+    #    so still need to do other OSX specific method below.
     if os.path.exists("/usr/X11/bin/fc-list"):
-        return initsysfonts_unix()
+        fonts = initsysfonts_unix()
+    
+    # we look for the default paths.
+    _search_osx_font_paths(fonts)
+    
+    return fonts
+    
+
+
+
 
     paths = ['/Library/Fonts',
              '~/Library/Fonts',
 def create_aliases():
     aliases = (
         ('monospace', 'misc-fixed', 'courier', 'couriernew', 'console',
-                'fixed', 'mono', 'freemono', 'bitstreamverasansmono',
-                'verasansmono', 'monotype', 'lucidaconsole'),
+         'fixed', 'mono', 'freemono', 'bitstreamverasansmono',
+         'verasansmono', 'monotype', 'lucidaconsole'),
         ('sans', 'arial', 'helvetica', 'swiss', 'freesans',
-                'bitstreamverasans', 'verasans', 'verdana', 'tahoma'),
+         'bitstreamverasans', 'verasans', 'verdana', 'tahoma'),
         ('serif', 'times', 'freeserif', 'bitstreamveraserif', 'roman',
-                'timesroman', 'timesnewroman', 'dutch', 'veraserif',
-                'georgia'),
+         'timesroman', 'timesnewroman', 'dutch', 'veraserif',
+         'georgia'),
         ('wingdings', 'wingbats'),
     )
     for set in aliases:

File src/_gmovie.c

 
     memset(&sp->sub, 0, sizeof(AVSubtitle));
 }
+void inline get_width(PyMovie *movie, int *width)
+{
+	if(movie->resize)
+	{
+		*width=movie->width;
+	}
+	else
+	{
+		if(movie->video_st)
+			*width=movie->video_st->codec->width;
+	}
+}
+
+void inline get_height(PyMovie *movie, int *height)
+{
+	if(movie->resize)
+	{
+		*height=movie->height;
+	}
+	else
+	{
+		if(movie->video_st)
+			*height=movie->video_st->codec->height;
+	}
+}
+
+void get_height_width(PyMovie *movie, int *height, int*width)
+{
+	get_height(movie, height);
+	get_width(movie, width);
+}
+
 inline int clamp0_255(int x) {
 	x &= (~x) >> 31;
 	x -= 255;
     GRABGIL
     Py_INCREF( is);
     RELEASEGIL
-    SubPicture *sp;
     VidPicture *vp;
-    AVPicture pict;
     float aspect_ratio;
     int width, height, x, y;
     
-    int i;
     vp = &is->pictq[is->pictq_rindex];
     vp->ready =0;
+    if (is->video_st->sample_aspect_ratio.num)
+        aspect_ratio = av_q2d(is->video_st->sample_aspect_ratio);
+    else if (is->video_st->codec->sample_aspect_ratio.num)
+        aspect_ratio = av_q2d(is->video_st->codec->sample_aspect_ratio);
+    else
+        aspect_ratio = 0;
+    if (aspect_ratio <= 0.0)
+        aspect_ratio = 1.0;
+	int w=0;
+	int h=0;
+	get_height_width(is, &h, &w);
+    aspect_ratio *= (float)w / h;
+	/* XXX: we suppose the screen has a 1.0 pixel ratio */
+    height = vp->height;
+    width = ((int)rint(height * aspect_ratio)) & ~1;
+    if (width > vp->width) {
+        width = vp->width;
+        height = ((int)rint(width / aspect_ratio)) & ~1;
+    }
+    x = (vp->width - width) / 2;
+    y = (vp->height - height) / 2;
+   
+    vp->dest_rect.x = vp->xleft + x;
+    vp->dest_rect.y = vp->ytop  + y;
+    vp->dest_rect.w = width;
+    vp->dest_rect.h = height;
+    
     if (vp->dest_overlay && vp->overlay>0) {
-        /* XXX: use variable in the frame */
-        if (is->video_st->sample_aspect_ratio.num)
-            aspect_ratio = av_q2d(is->video_st->sample_aspect_ratio);
-        else if (is->video_st->codec->sample_aspect_ratio.num)
-            aspect_ratio = av_q2d(is->video_st->codec->sample_aspect_ratio);
-        else
-            aspect_ratio = 0;
-        if (aspect_ratio <= 0.0)
-            aspect_ratio = 1.0;
-        aspect_ratio *= (float)is->video_st->codec->width / is->video_st->codec->height;
-        /* if an active format is indicated, then it overrides the
-           mpeg format */
         
-        if (is->subtitle_stream>-1)
-        {
-            
-            if (is->subpq_size > 0)
-            {
-                sp = &is->subpq[is->subpq_rindex];
 
-                if (is->pts >= is->pts + ((float) sp->sub.start_display_time / 1000))
-                {
-
-                    if(is->overlay>0)
-                    {
-                        SDL_LockYUVOverlay (is->dest_overlay);
-
-                        pict.data[0] = is->dest_overlay->pixels[0];
-                        pict.data[1] = is->dest_overlay->pixels[2];
-                        pict.data[2] = is->dest_overlay->pixels[1];
-
-                        pict.linesize[0] = is->dest_overlay->pitches[0];
-                        pict.linesize[1] = is->dest_overlay->pitches[2];
-                        pict.linesize[2] = is->dest_overlay->pitches[1];
-
-                        for (i = 0; i < sp->sub.num_rects; i++)
-                            blend_subrect(&pict, sp->sub.rects[i],
-                                          vp->dest_overlay->w, vp->dest_overlay->h);
-
-                        SDL_UnlockYUVOverlay (is->dest_overlay);
-                    }
-                }
-            }
-        }
-
-
-        /* XXX: we suppose the screen has a 1.0 pixel ratio */
-        height = vp->height;
-        width = ((int)rint(height * aspect_ratio)) & ~1;
-        if (width > vp->width) {
-            width = vp->width;
-            height = ((int)rint(width / aspect_ratio)) & ~1;
-        }
-        x = (vp->width - width) / 2;
-        y = (vp->height - height) / 2;
-       
-        vp->dest_rect.x = vp->xleft + x;
-        vp->dest_rect.y = vp->ytop  + y;
-        vp->dest_rect.w = width;
-        vp->dest_rect.h = height;
         if(vp->overlay>0) 
         {      
         	SDL_LockYUVOverlay(vp->dest_overlay); 
     } 
     else if(vp->dest_surface && vp->overlay<=0)
     {
-    	/* XXX: use variable in the frame */
-        if (is->video_st->sample_aspect_ratio.num)
-            aspect_ratio = av_q2d(is->video_st->sample_aspect_ratio);
-        else if (is->video_st->codec->sample_aspect_ratio.num)
-            aspect_ratio = av_q2d(is->video_st->codec->sample_aspect_ratio);
-        else
-            aspect_ratio = 0;
-        if (aspect_ratio <= 0.0)
-            aspect_ratio = 1.0;
-        aspect_ratio *= (float)is->video_st->codec->width / is->video_st->codec->height;
-        /* if an active format is indicated, then it overrides the
-           mpeg format */
     	
-    	height = vp->height;
-        width = ((int)rint(height * aspect_ratio)) & ~1;
-        if (width > vp->width) {
-            width = vp->width;
-            height = ((int)rint(width / aspect_ratio)) & ~1;
-        }
-        x = (vp->width - width) / 2;
-        y = (vp->height - height) / 2;
-       
-        vp->dest_rect.x = vp->xleft + x;
-        vp->dest_rect.y = vp->ytop  + y;
-        vp->dest_rect.w = width;
-        vp->dest_rect.h = height;
-        //GRABGIL
-        //PySys_WriteStdout("Just before blitting...\n");
         //pygame_Blit (vp->dest_surface, &vp->dest_rect,
         //     is->canon_surf, &vp->dest_rect, 0);
     	SDL_BlitSurface(vp->dest_surface, &vp->dest_rect, is->canon_surf, &vp->dest_rect);
-    	//PySys_WriteStdout("After blitting...\n");
-    	//RELEASEGIL
     }
+
     is->pictq_rindex= (is->pictq_rindex+1)%VIDEO_PICTURE_QUEUE_SIZE;
     is->pictq_size--;
     video_refresh_timer(is);
 }
 
 int video_open(PyMovie *is, int index){
-    int w,h;
+    int w=0;
+    int h=0;
     DECLAREGIL
     GRABGIL
     Py_INCREF( is);
     RELEASEGIL
-    w = is->video_st->codec->width;
-    h = is->video_st->codec->height;
-
-	VidPicture *vp;
+ 	get_height_width(is, &h, &w);
+ 	VidPicture *vp;
 	vp = &is->pictq[index];
-    
-    if(!vp->dest_overlay && is->overlay>0)
+   
+    if((!vp->dest_overlay && is->overlay>0) || (is->resize && vp->dest_overlay && (vp->height!=h || vp->width!=w)))
     {
+    	if(is->resize)
+    	{
+    		SDL_FreeYUVOverlay(vp->dest_overlay);
+    	}
         //now we have to open an overlay up
         SDL_Surface *screen;
         if (!SDL_WasInit (SDL_INIT_VIDEO))
         	return -1;
         }
         screen = SDL_GetVideoSurface ();
-        if (!screen)
+        if (!screen || (screen && (screen->w!=w || screen->h !=h)))
 		{
 			screen = SDL_SetVideoMode(w, h, 0, SDL_SWSURFACE);
 			if(!screen)
 	        	return -1;	
 			}
 		}
+		
+		
         vp->dest_overlay = SDL_CreateYUVOverlay (w, h, SDL_YV12_OVERLAY, screen);
         if (!vp->dest_overlay)
         {
         }
         vp->overlay = is->overlay;
     } 
-    else if (!vp->dest_surface && is->overlay<=0)
+    else if ((!vp->dest_surface && is->overlay<=0) || (is->resize && vp->dest_surface && (vp->height!=h || vp->width!=w)))
     {
     	//now we have to open an overlay up
+    	if(is->resize)
+    	{
+    		SDL_FreeSurface(vp->dest_surface);
+    	}
         SDL_Surface *screen = is->canon_surf;
         if (!SDL_WasInit (SDL_INIT_VIDEO))
         {
         	RELEASEGIL										  // happen if there's some cleaning up.
         	return -1;	
 		}
+		int tw=w;
+		int th=h;
+		if(!is->resize)
+		{
+			tw=screen->w;
+			th=screen->h;
+		}
         vp->dest_surface = SDL_CreateRGBSurface(screen->flags, 
-        										screen->w, 
-        										screen->h, 
+        										tw, 
+        										th, 
         										screen->format->BitsPerPixel, 
         										screen->format->Rmask, 
         										screen->format->Gmask, 
         }
         vp->overlay = is->overlay;
     }
-
-    is->width = w;
-    vp->width = w;
-    is->height = h;
+	vp->width = w;
     vp->height = h;
 	GRABGIL
     Py_DECREF( is);
 
 	vp = &movie->pictq[movie->pictq_windex];
 	
-	if(!vp->dest_overlay||!vp->dest_surface)
+	int w=0;
+	int h=0;
+	get_height_width(movie, &h, &w);
+	
+	if(!vp->dest_overlay||!vp->dest_surface||vp->width!=movie->width||vp->height!=movie->height)
 	{
 		video_open(movie, movie->pictq_windex);
 	}	
+	dst_pix_fmt = PIX_FMT_YUV420P;
     if (vp->dest_overlay && vp->overlay>0) {
         /* get a pointer on the bitmap */
-        
-        dst_pix_fmt = PIX_FMT_YUV420P;
-           
         SDL_LockYUVOverlay(vp->dest_overlay);
 
         pict.data[0] = vp->dest_overlay->pixels[0];
         pict.linesize[0] = vp->dest_overlay->pitches[0];
         pict.linesize[1] = vp->dest_overlay->pitches[2];
         pict.linesize[2] = vp->dest_overlay->pitches[1];
-
-		int sws_flags = SWS_BICUBIC;
-        img_convert_ctx = sws_getCachedContext(img_convert_ctx,
-            movie->video_st->codec->width, movie->video_st->codec->height,
-            movie->video_st->codec->pix_fmt,
-            movie->video_st->codec->width, movie->video_st->codec->height,
-            dst_pix_fmt, sws_flags, NULL, NULL, NULL);
-        if (img_convert_ctx == NULL) {
-            fprintf(stderr, "Cannot initialize the conversion context\n");
-            exit(1);
-        }
-        movie->img_convert_ctx = img_convert_ctx;
-        sws_scale(img_convert_ctx, src_frame->data, src_frame->linesize,
-                  0, movie->video_st->codec->height, pict.data, pict.linesize);
-
-        SDL_UnlockYUVOverlay(vp->dest_overlay);
-
-        vp->pts = movie->pts;  
-    	movie->pictq_windex = (movie->pictq_windex+1)%VIDEO_PICTURE_QUEUE_SIZE;
-		movie->pictq_size++;
-		vp->ready=1;
     }
     else if(vp->dest_surface)
     {
-    	   /* get a pointer on the bitmap */
-        
-        dst_pix_fmt = PIX_FMT_YUV420P;
-
-		avpicture_alloc(&pict, dst_pix_fmt, vp->width, vp->height);
+    	/* get a pointer on the bitmap */
+		avpicture_alloc(&pict, dst_pix_fmt, w, h);
         SDL_LockSurface(vp->dest_surface);
-		int sws_flags = SWS_BICUBIC;
-        img_convert_ctx = sws_getCachedContext(img_convert_ctx,
-            								   movie->video_st->codec->width, 
-            								   movie->video_st->codec->height,
-            								   movie->video_st->codec->pix_fmt,
-            								   vp->width,
-            								   vp->height,
-            								   dst_pix_fmt, 
-            								   sws_flags, 
-            								   NULL, NULL, NULL);
-        if (img_convert_ctx == NULL) {
-            fprintf(stderr, "Cannot initialize the conversion context\n");
-            exit(1);
-        }
-        movie->img_convert_ctx = img_convert_ctx;
-        sws_scale(img_convert_ctx, src_frame->data, src_frame->linesize,
-                  0, movie->video_st->codec->height, pict.data, pict.linesize);
-
+    }
+    int sws_flags = SWS_BICUBIC;
+	img_convert_ctx = sws_getCachedContext(img_convert_ctx,
+        								   movie->video_st->codec->width, 
+        								   movie->video_st->codec->height,
+        								   movie->video_st->codec->pix_fmt,
+        								   w,
+        								   h,
+        								   dst_pix_fmt, 
+        								   sws_flags, 
+        								   NULL, NULL, NULL);
+    if (img_convert_ctx == NULL) {
+        fprintf(stderr, "Cannot initialize the conversion context\n");
+        exit(1);
+    }
+    movie->img_convert_ctx = img_convert_ctx;
+    if(movie->resize)
+    {
+    	sws_scale(img_convert_ctx, src_frame->data, src_frame->linesize,
+        	      0, h, pict.data, pict.linesize);
+    }
+    else
+    {
+    	sws_scale(img_convert_ctx, src_frame->data, src_frame->linesize,
+              0, movie->video_st->codec->height, pict.data, pict.linesize);
+    }
+    if (vp->dest_overlay && vp->overlay>0) {
+    	SDL_UnlockYUVOverlay(vp->dest_overlay);
+    }
+    else if(vp->dest_surface)
+    {
 		ConvertYUV420PtoRGBA(&pict,vp->dest_surface, src_frame->interlaced_frame );
 		SDL_UnlockSurface(vp->dest_surface);
-        vp->pts = movie->pts;  
-    	movie->pictq_windex = (movie->pictq_windex+1)%VIDEO_PICTURE_QUEUE_SIZE;
-		movie->pictq_size++;
-		vp->ready=1;
 		avpicture_free(&pict);
-    }	
+    }
+    vp->pts = movie->pts;  
+	movie->pictq_windex = (movie->pictq_windex+1)%VIDEO_PICTURE_QUEUE_SIZE;
+	movie->pictq_size++;
+	vp->ready=1;	
 	GRABGIL
 	Py_DECREF(movie);
     RELEASEGIL
 	ic=is->ic;
 	int co=0;
 	is->last_showtime = av_gettime()/1000.0;
-	RELEASEGIL
-    //video_open(is, is->pictq_windex);
+	//RELEASEGIL
     for(;;) {
-		//PySys_WriteStdout("decoder: loop %i.\n", co);
 		co++;
 		
         if (is->abort_request)
 	GRABGIL		
     Py_DECREF( is);
     RELEASEGIL
+    RELEASEGIL
     is->stop =1;
     if(is->abort_request)
     {	return -1;}

File src/_gmovie.h

     int ytop;
     int xleft;
     int loops;
+    int resize;
 	int64_t start_time;
 	AVInputFormat *iformat;
 	SDL_mutex *dest_mutex;
 static PyObject* _color_item (PyColor *color, Py_ssize_t _index);
 static int _color_ass_item (PyColor *color, Py_ssize_t _index, PyObject *value);
 
+static PyObject * _color_slice(register PyColor *a, 
+                               register Py_ssize_t ilow, 
+                               register Py_ssize_t ihigh);
+
+
 /* Comparison */
 static PyObject* _color_richcompare(PyObject *o1, PyObject *o2, int opid);
 
     NULL,                              /* sq_concat */
     NULL,                              /* sq_repeat */
     (ssizeargfunc) _color_item,        /* sq_item */
-    NULL,                              /* sq_slice */
+    (ssizessizeargfunc)_color_slice,    /* sq_slice */
     (ssizeobjargproc) _color_ass_item, /* sq_ass_item */
-    NULL,                              /* sq_ass_slice */
+    NULL, /* sq_ass_slice */
     NULL,                              /* sq_contains */
     NULL,                              /* sq_inplace_concat */
     NULL,                              /* sq_inplace_repeat */
 };
 
+#define DEFERRED_ADDRESS(ADDR) 0
+
 static PyTypeObject PyColor_Type =
 {
     TYPE_HEAD (NULL, 0)
     return color;
 }
 
+
+
 /**
  * Creates a new PyColor.
  */
     return -1;
 }
 
+
+
+static PyObject *
+_color_slice(register PyColor *a, 
+             register Py_ssize_t ilow, 
+             register Py_ssize_t ihigh)
+{
+
+        Py_ssize_t len;
+        Py_ssize_t c1, c2, c3, c4;
+        c1=0;c2=0;c3=0;c4=0;
+
+        /* printf("ilow :%d:, ihigh:%d:\n", ilow, ihigh); */
+
+        if (ilow < 0)
+                ilow = 0;
+        if (ihigh > 3)
+                ihigh = 4;
+        if (ihigh < ilow)
+                ihigh = ilow;
+
+        len = ihigh - ilow;
+        /* printf("2 ilow :%d:, ihigh:%d: len:%d:\n", ilow, ihigh, len); */
+        
+        if(ilow == 0) {
+            c1 = a->r;
+            c2 = a->g;
+            c3 = a->b;
+            c4 = a->a;
+        } else if(ilow == 1) {
+            c1 = a->g;
+            c2 = a->b;
+            c3 = a->a;
+
+        } else if(ilow == 2) {
+            c1 = a->b;
+            c2 = a->a;
+
+        } else if(ilow == 3) {
+            c1 = a->a;
+        }
+
+
+
+        /* return a tuple depending on which elements are wanted.  */
+        if(len == 4) {
+            return Py_BuildValue ("(iiii)",c1,c2,c3,c4);
+        } else if(len == 3) {
+            return Py_BuildValue ("(iii)",c1,c2,c3);
+        } else if(len == 2) {
+            return Py_BuildValue ("(ii)",c1,c2);
+        } else if(len == 1) {
+            return Py_BuildValue ("(i)",c1);
+        } else {
+            return Py_BuildValue ("()");
+        }
+}
+
+
+
+
+
+
+
+
 /*
  * colorA == colorB
  * colorA != colorB
 {
     PyObject *colordict;
     PyObject *module;
-    PyObject *dict;
     PyObject *apiobj;
     static void* c_api[PYGAMEAPI_COLOR_NUMSLOTS];
     
         DECREF_MOD(module);
         MODINIT_ERROR;
     }
-    dict = PyModule_GetDict (module);
 
     c_api[0] = &PyColor_Type;
     c_api[1] = PyColor_New;
         DECREF_MOD(module);
         MODINIT_ERROR;
     }
-    if (PyDict_SetItemString (dict, PYGAMEAPI_LOCAL_ENTRY, apiobj)) {
+    if (PyModule_AddObject (module, PYGAMEAPI_LOCAL_ENTRY, apiobj)) {
+        Py_DECREF (apiobj);
         Py_DECREF (_COLORDICT);
         DECREF_MOD(module);
         MODINIT_ERROR;
     }
-    Py_DECREF (apiobj);
     MODINIT_RETURN (module);
 }
         MODINIT_ERROR;
     }
     if (PyModule_AddObject (module, PYGAMEAPI_LOCAL_ENTRY, apiobj) == -1) {
+        Py_DECREF (apiobj);
         DECREF_MOD (module);
         MODINIT_ERROR;
     }

File src/gfxdraw.c

 _gfx_rectanglecolor (PyObject *self, PyObject* args)
 {
     PyObject *surface, *color, *rect;
-    GAME_Rect sdlrect;
+    GAME_Rect temprect, *sdlrect;
     Sint16 x1, x2, _y1, y2;
     Uint8 rgba[4];
 
     ASSERT_VIDEO_INIT (NULL);
 
-    if (!PyArg_ParseTuple (args, "OOO:rectangle", &surface, &rect, &color))
+    if (!PyArg_ParseTuple (args, "OOO:rectangle", &surface, &rect, &color)) {
         return NULL;
+    }
     
-    if (!PySurface_Check (surface))
-    {
+    if (!PySurface_Check (surface)) {
         PyErr_SetString (PyExc_TypeError, "surface must be a Surface");
         return NULL;
     }
-    if (!GameRect_FromObject (rect, &sdlrect))
+    sdlrect = GameRect_FromObject (rect, &temprect);
+    if (sdlrect == NULL) {
         return NULL;
+    }
 
-    if (!RGBAFromObj (color, rgba))
-    {
+    if (!RGBAFromObj (color, rgba)) {
         PyErr_SetString (PyExc_TypeError, "invalid color argument");
         return NULL;
     }
 
-    x1 = sdlrect.x;
-    _y1 = sdlrect.y;
-    x2 = (Sint16) (sdlrect.x + sdlrect.w);
-    y2 = (Sint16) (sdlrect.y + sdlrect.h);
+    x1 = sdlrect->x;
+    _y1 = sdlrect->y;
+    x2 = (Sint16) (sdlrect->x + sdlrect->w - 1);
+    y2 = (Sint16) (sdlrect->y + sdlrect->h - 1);
 
-    if (rectangleRGBA (PySurface_AsSurface (surface), x1, x2, _y1, y2,
+    if (rectangleRGBA (PySurface_AsSurface (surface), x1, _y1, x2, y2,
 		       rgba[0], rgba[1], rgba[2], rgba[3]) ==
-        -1)
-    {
+        -1) {
         PyErr_SetString (PyExc_SDLError, SDL_GetError ());
         return NULL;
     }
 _gfx_boxcolor (PyObject *self, PyObject* args)
 {
     PyObject *surface, *color, *rect;
-    GAME_Rect sdlrect;
+    GAME_Rect temprect, *sdlrect;
     Sint16 x1, x2, _y1, y2;
     Uint8 rgba[4];
 
     ASSERT_VIDEO_INIT (NULL);
 
-    if (!PyArg_ParseTuple (args, "OOO:box", &surface, &rect, &color))
+    if (!PyArg_ParseTuple (args, "OOO:box", &surface, &rect, &color)) {
         return NULL;
+    }
     
-    if (!PySurface_Check (surface))
-    {
+    if (!PySurface_Check (surface)) {
         PyErr_SetString (PyExc_TypeError, "surface must be a Surface");
         return NULL;
     }
-    if (!GameRect_FromObject (rect, &sdlrect))
+    sdlrect = GameRect_FromObject (rect, &temprect);
+    if (sdlrect == NULL) {
         return NULL;
-
-    if (!RGBAFromObj (color, rgba))
-    {
+    }
+    if (!RGBAFromObj (color, rgba)) {
         PyErr_SetString (PyExc_TypeError, "invalid color argument");
         return NULL;
     }
 
-    x1 = sdlrect.x;
-    _y1 = sdlrect.y;
-    x2 = (Sint16) (sdlrect.x + sdlrect.w);
-    y2 = (Sint16) (sdlrect.y + sdlrect.h);
+    x1 = sdlrect->x;
+    _y1 = sdlrect->y;
+    x2 = (Sint16) (sdlrect->x + sdlrect->w - 1);
+    y2 = (Sint16) (sdlrect->y + sdlrect->h - 1);
 
-    if (rectangleRGBA (PySurface_AsSurface (surface), x1, x2, _y1, y2,
+    if (boxRGBA (PySurface_AsSurface (surface), x1, _y1, x2, y2,
 		       rgba[0], rgba[1], rgba[2], rgba[3]) ==
-        -1)
-    {
+        -1) {
         PyErr_SetString (PyExc_SDLError, SDL_GetError ());
         return NULL;
     }
 _gfx_texturedpolygon (PyObject *self, PyObject* args)
 {
     PyObject *surface, *texture, *points, *item;
+    SDL_Surface *s_surface, *s_texture;
     Sint16 *vx, *vy, x, y, tdx, tdy;
     Py_ssize_t count, i;
     int ret;
         PyErr_SetString (PyExc_TypeError, "surface must be a Surface");
         return NULL;
     }
+    s_surface = PySurface_AsSurface (surface);
     if (!PySurface_Check (texture))
     {
         PyErr_SetString (PyExc_TypeError, "texture must be a Surface");
         return NULL;
     }
+    s_texture = PySurface_AsSurface (texture);
     if (!PySequence_Check (points))
     {
         PyErr_SetString (PyExc_TypeError, "points must be a sequence");
         return NULL;
     }
+    if (s_surface->format->BytesPerPixel == 1 &&
+        (s_texture->format->Amask || s_texture->flags & SDL_SRCALPHA)) {
+        PyErr_SetString (PyExc_ValueError,
+                           "Per-byte alpha texture unsupported "
+                           "for 8 bit surfaces");
+        return NULL;
+    }
 
     count = PySequence_Size (points);
     if (count < 3)
     }
 
     Py_BEGIN_ALLOW_THREADS;
-    ret = texturedPolygon (PySurface_AsSurface (surface), vx, vy, (int)count,
-			   PySurface_AsSurface (texture), tdx, tdy);
+    ret = texturedPolygon (s_surface, vx, vy, (int)count,
+                           s_texture, tdx, tdy);
     Py_END_ALLOW_THREADS;
 
     PyMem_Free (vx);

File src/gfxdraw.doc

 For all functions the arguments are strictly positional. Only integers are
 accepted for coordinates and radii.