Add __array_interface__ to _view.view object
For Surface.get_view, move surface locking to View object

A surface is locked when an array interface is exported,
not when the View is created. Also, the capsule is created by
the View object when needed, rather than being passed to the
View constructor. This is in preparation to adding the new buffer
interface to View.
Add new buffer interface to pygame._view.View, and update Surface.get_view.

For Python 3.x, pygame._view.View now exposes a new buffer interface. Internally, View now stores a Py_buffer. This makes it comparable to a Python memoryview. However, View also takes callbacks that support buffer creation and release event. This enables explicit control of Surface locking through the View proxy.

This is a preliminary commit. The changes build with Python 3.3. However, further buffer interface unit testing is needed.
Fold Pygame changes since new buffer protocol branch started.
bring in Python 3.3 support
Port pygame.bufferproxy.BufferProxy properties to pygame._view.View. Enable View subclassing.

For backward compatibility, add __dict__, raw, and length properties to
pygame._view.View. Since the BufferProxy dictionary (__dict__) is for use by
BufferProxy subclass instances, also allow View to be subclassed.
Refactor some identifiers as part of BufferProxy replacement

Replace "view" with "bufferproxy" in the pygame._view extension module.
Make the necessary updates to pygame.Surface and the unit tests.
White space cleanup on pygame._view related files
Shorten some pygame._view indentifiers.

Save all of 3 characters per name.
Give the pygame._view.BufferProxy callback hooks more convensional names.

The words "prelude" and "postscript" are replaced with "before" and "after".
Add pygame.bufferproxy.Bufferproxy compatibility option to pygame.Surface.get_view()

The Surface.get_view() option '&' returns a pygame._view.BufferProxy
instance exposing the surface data as raw bytes. The _view.BufferProxy
still needs to be updated to properly expose those bytes.

The docs for Surface.get_view are updated to describe the completed
method before is replaces Surface.get_buffer.
Shorten some static names local to the _view.c C module.

The "proxy_" prefix exists to avoid conflicts with external function names.
This prefix need not be descriptive or start with '_', just unique. The "surf_"
prefix in surface.c is a precedent.
The Surface.get_view now properly exposes raw bytes as a buffer

For the '&' argument value, the buffer length is the size of the entire
surface buffer, including padding bytes. _view.BufferProxy also exports
the old buffer interface for Python 2.x.
The Surface.get_view now properly exposes contiguous bytes as a buffer

This implements the '0' Surface.get_view argument.
All Surface.get_view argument value now supported

Fix a bug with the '0' argument value. Add the remaining '1' option.
Bring pygame-newbuf in synch with tip
replace pygame.bufferproxy with pygame._view

Remove the bufferproxy module, renaming _view to replace it. Remove the
unnecessary Surface.get_view(), and mixer.Sound.get_buffer methods(). Add
Sound.get_raw() as a replacement in the mixer unit tests. Also add the
Sound._samples_address property to help test get_raw(). Make necessary
header file name changes in pixelarray and _freetype modules. Replace
Surface.get_view() calls in pygame.surfarray. Update docs and unit tests
to reflect the changes.

This is a basic changeset to make the module switch. The new bufferproxy
still implements two general purpose array interface api functions that
do not rely on BufferProxy. These should be moved to pygame.base, so
modules using them do not need to import bufferproxy as well.

--HG--
rename : src/pgview.h => src/pgbufferproxy.h
bring in Python 3.3 compatibility change to makeref.py
Add a couple of array interface routines to pygame.base

Just copy a some bufferproxy to base, then make sure everything builds
and passes the unit tests without crashing.

TODO: actually use the routines in base rather than the equivalents in
bufferproxy.
Move generic array interface support from the bufferproxy to the base module

Py_buffer <-> PyArrayInterface conversion routines become PyGame C api
functions implemented in base.c