Added new Output Line Style shader node for defining a node-based line material.
Fix for a wrong ID datablock referenced due to a typo in BKE_copy_linestyle().
Changed ntreeCopyTree_ex() to accept a pointer to struct Main.
Freestyle: Added preliminary support for textured strokes in Cycles.

Now the shader node tree of a line style ID datablock is used to define textures
as well as their mapping and influence.

TODO: Textures alpha channel mapping and influence.
TODO: Blend mode in the Output Line Style shader node.
Follow-up to rB647969f9b617: Renamed CTX_data_linestyle_from_scene() to BKE_get_linestyle_from_scene().
Freestyle: Add BKE_linestyle_default_shader() for creating the default line style shader node tree.

Changes to ED_node_shader_default() were reverted since the code there was actually
not suitable for setting up the default line style node tree properly.
Freestyle: Changed the default Color value of the Output Line Style node.
Freestyle: Fix for stroke_shader node default values copied from the Output Line Style node.
Freestyle: Fix for a crash in BKE_linestyle_default_shader() due to a typo.
Freestyle: Added "blend_type" and "use_clamp" options to the Output Line Style shader node.
Freestyle: Removed a debug print in BlenderStrokeRenderer::GetStrokeShader().
Fix for renamed API functions in rB415af0b.
Freestyle: show "use_nodes" option in the UI when Cycles is enabled.

The "use_textures" option is intended for the BI and does not make sense in Cycles.
Freestyle: Keep a reference of the line style in Stroke rather than in StrokeRep.
Added BKE_linestyle_use_textures() to check if stroke textures are enabled.
Freestyle: Fix for a crash during access to Scene properties from within Python.
Made temporary changes to use G.main rather than Freestyle-local Main for debugging.
WIP commit just for a record of a working snapshot of code revisions for node-based textured strokes.
Freestyle: an improved workflow of line style shading nodes.

Removed the previous changes for passing a line style through the Controller, and
revised the BlenderTextureShader to assign the shader node tree of a line style
(if specified) to strokes.  This way the assignment of shading nodes can be done
through both the Freestyle GUI and Python scripting.
Removed/disabled debugging code.