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
Merge remote-tracking branch 'hm-blender/master'

* hm-blender/master:
  Option to lock the interface while rendering
  UI: Refactor timecode functions into BLI_timecode
Merge branch 'master' into mymods

* master:
  Option to lock the interface while rendering
  UI: Refactor timecode functions into BLI_timecode
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.