New composite engine.

committed in order to start the migration of the nodes.
have some issues with some changes in trunk based on the UI event handlers.
sometimes an exception happens in the malloc of a UI-control.
need to discuss what the issue is.

OpenCL part is disabled right now. will be enabled in a folowing commit.

Jeroen & Monique.
 - At Mind -
optimized the interface of nodes and operations sockets
Tile-branch

removed the strange vector allocations in NodeBase. This stabelize the code a lot. 
Next crash was about preview images. In order to do dynamic screen update the data can be lost during drawing. this needs to be fixed by working on copies.
Tile Branch:
* Minor UI tweak to save some space in the node editor properties region.
* Rename RNA "opencl" to "use_opencl", to follow boolean rna-naming conventions.
Branch Tile:

added the GPL header to all files.
Tile Branch
* Compile fixes for MSVC, patch by Andrew Wiggin (ender79). Thanks a lot! 
* Fixed scons compile on win, missing pthreads include.
Tile Branch:
* Some UI cleanup of the Viewer Center Buttons + naming fixes.
* Fixing some align booleans in the UI code, there is only 0 and 1. 

ToDo: Do not re composite when changing the center value.
Tile branch:
cleaned up some debugging information
Tile Branch:
* Fixing wrong button RNA identifier, causing the Switch Buttons not to display.
Use the default_value data in bNodeSocket for input constants instead of the deprecated bNodeStack ns member. The ns member only still works partially since it is updated back from the actual default_value on each file write and also undo pushes (for forward compatibility).
Finished all blend modes for the color mix node.

In detail:
* Added missing implementations for Dodge, Burn, Hue, Saturation, Value and Color blend modes.
* Reviewed all other blend modes for correctness.
* Base Operation: Leave alpha unchanged (all color mix ops do so); use the alpha multiply value like all others (just for clarity, base op is not really used)
* Difference: Use fabsf instead of fabs, the latter works on doubles instead floats.
* Divide: return 0 if divisor is 0.
Fix for group nodes in new compositor: when ungrouping the internal groups prior to conversion all unlinked inputs of the group node would be ignored. What should actually happen is that inputs without _internal_ connections are ignored, since these are not used for any outputs.
Fixed some destructor calls on array variables.
Generalization of group node conversion in the new compositor.

This allows groups inside groups to work and also simplifies the code a lot.

* Ungrouping of group nodes ("expanding" might be a better name?) is
done as part of the general addNodeTree function now. This way the
ungrouping happens recursively on all levels of group nodes.
* The adding of a node tree works in three basic steps:
 1) Add all nodes, including group nodes (ignoring internals of the
group at this point)
 2) Add links between nodes (again, no group internals here)
 3) Expand all newly added group nodes from this tree, which replaces
them with internal nodes and proxy nodes for inputs and outputs.
* Expanding the node tree works different now:
 1) First add proxy nodes for all input/output sockets. The group
node sockets are then reconnected to the "outer" proxy sockets, while
the internal group sockets (sock->groupsock) are assigned to the
"inner" proxy sockets.
 2) Then the actual inner node tree is added, which connects internal
nodes to the proxies
 An important change is that the list of nodes, which is used to look
up link targets by their bNode/bNodeSocket pairs, is now limited to
the nodes added from the current tree (including proxies from the
group). This is necessary to avoid ambiguous assignments from other
instances of the same group node type!
 An advantage is also that now no more special group socket pointers
and "insideGroup" flags are needed for the Socket class, making the
code a bit simpler.
* Currently the "actual data type" is not converted on proxy
nodes (XXX TODO in the patch), this should be revisited.
Tile branch

some changes to clean up memory in order to continue tracking the threading/memory issue
Tile branch:
added the worker pattern in the workscheduler for stability reasons.
the execution time is slower (+-70% of normal speed) but it does not crash that much.

Goal is still to use the pthreaded model. but this needs some more complex debugging.

Jeroen
Tile branch:

removed a warning (missing return)
removed a debug statement
Tile branch

implemented the thread queue pattern for work scheduling.
This is stable and has the possibility to do OpenCL threading in the future.
This threading model is selected to be the default one.

Still needed to be tested by other users to make sure it is the right direction.

Jeroen Bakker
 - At Mind -
Tile Branch
* Fix some wrong #if's to #ifdef's
Merging Trunk changes into Tile branch:
SVN Range: 42300-43091.

Resolved issues:
* Re-added compat code for new Compositor in readfile.c
* Matrix multiplication order fixes, see commit 42670.

Tested compile on windows, branch looks good after merge! :)