UI: Refactor timecode functions into BLI_timecode

- deduplicate timecode_simple_string from image.c
- replace V2D_UNIT_SECONDSSEQ with V2D_UNIT_SECONDS
- avoid possible buffer overflow bugs (sprintf -> BLI_snprintf)
- remove option not to use timecode and split into 2 functions

Patch D227 by Andrew Buttery with own refactoring.
Option to lock the interface while rendering

Added function called WM_set_locked_interface which does
two things:

- Prevents event queue from being handled, so no operators
  (see below) or values are even possible to run or change.
  This prevents any kind of "destructive" action performed
  from user while rendering.

- Locks interface refresh for regions which does have lock
  set to truth in their template. Currently it's just a 3D
  viewport, but in the future more regions could be considered
  unsafe, or we could want to lock different parts of
  interface when doing different jobs.

  This is needed because 3D viewport could be using or changing
  the same data as renderer currently uses, leading to threading
  conflict.

  Notifiers are still allowed to handle, so render progress is
  seen on the screen, but would need to doublecheck on this, in
  terms some notifiers could be changing the data.

  For now interface locking happens for render job only in case
  "Lock Interface" checkbox is enabled.

  Other tools like backing would also benefit of this option.

  It is possible to mark operator as safe to be used in locked
  interface mode by adding OPTYPE_ALLOW_LOCKED bit to operator
  template flags.

  This bit is completely handled by wm_evem_system, not
  with operator run routines, so it's still possible to
  run operators from drivers and handlers.

  Currently allowed image editor navigation and zooming.

Reviewers: brecht, campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D142
Move depsgraph debug print under --debug-depsgraph command line argument
UI: minor optimization for button lookup, break early when button found

also reduce int/float conversion
UI: Make "Lock Interface" a icon only button and pack into the Display row, we don't need a dedicated row for this option, also it looked quite bad for Cycles.
Scons: Some tweaks for f70d9660474c, we don't need SSE41 kernel for 32bit, nor vc2008 x64.
Fix sconscript syntax error when using python 2.x instead of 3.x.
Fix T38388: Creating a new scene with full copy sets rigidbody collision shapes to box.

Tweak world rebuilding logic, so it's not done before object data was
updated.
renamed unclear API parameter
Fix T38393: bone roll not restored properly after cancelling rotation of bones.
Fix T37038: user preferences > input category names unnecessarily cut off.
Fix T36955: API docs referred to sys.maxint which does not exist in Python 3.
Fix T38359: incorrect display of material slot with pinned particle settings.

Just hide it in this case, the material slot is not really valid without an
object in the context.
Update Edit Mode tabs for mesh objects

This greatly improves the mesh edit tabs after a few weeks of feedback, making the tabs more practical with less need to switch tabs often.  Based on discussion on IRC and T37568.

Reviewers: campbellbarton

CC: campbellbarton, brecht

Reviewers: campbellbarton

Reviewed By: campbellbarton

CC: campbellbarton, brecht

Differential Revision: https://developer.blender.org/D269
Fix bone transform issue where the bone roll depends on intermediate mouse positions.

It computed the roll compatible with the previous mouse position roll value,
now it uses the initial roll value.
Fix accidental description change in recent commit.
Code cleanup: remove redundant makesrna call with platform "linuxcross".

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D235
Fix T37661: color ramps and curve mapping editing not disabled for linked data.
Fix T38358: Face snapping fails on Orthographic view

Issue is caused by start point of ray used to detect faces under the mouse is set rather far away in ortho 3dviews.
The loss of precision on the ray location induced by this can lead to face snapping failures.

Solution is to do the raycasting with a temp start point, much closer to the object we check, and add back
to the found distance the diff to the real start point once detection is done (as we need all hit distances
from all tested objects to be relative to a common point!).

Note this commit only addresses the "face snapping on mesh" case, other kind of snapping do not seem to suffer
from this issue.

Reviewers: brecht, campbellbarton

Differential Revision: https://developer.blender.org/D268
Fix T38400: crash in image_listener accessing deleted object.

Listeners should never dereference this pointer because the object may have
been deleted, it can only be used for comparisons.