Improvements for DirectWrite font engine

- don't check if m_directWriteFontFace is not null, it MUST be initialized
  just in the constructor;
- fix support for surrogate pairs in stringToCMap();
- reorder some affected code for better readability.

Change-Id: Ibdcf7b50f06910e95cefe074f33932b8fbcdcfe1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Use variadic templates to mark function pointers as non-QObjects.

Change-Id: I4d4e7a0498ff8f5b834dae4008d1311838180036
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Use Qt::Key_unknown for unknown keys instead of -1 with xcb

Task-number: QTBUG-3515
Change-Id: I9875437744455a2cce2da075c1fa6e2a91f55b63
Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Improve desktop environment detection.

UNKNOWN now means generic unix theme, rather than Gtk: there
are other KDE/Qt-based desktops, and there's also the case of
no desktop at all (e.g. bare Xvfb, as used by automated builds).

To make this correct for GTK-based desktops, this commits improves
the detection of the current desktop environment.

Change-Id: Ib696624de39d5024527880df7adc26c65b838d15
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>