Clean-up some leftovers

Change-Id: Ia7fb57831af55cf8e0403dbdef2e73f9957fccf7
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Decrease code duplication

Check engine's supported scripts in a single place
and remove unused script parameter from fontEngine().

Change-Id: Ic153803bef519320c370b058e77eac1a4d92afd0
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Get rid of SpecialData::addFormatIndices

and rename SpecialData:: resolvedFormatIndices to resolvedFormats.
Instead, resolvedFormats now stores QTextCharFormat shared copies.

Change-Id: I4a22cb3f5679b980ef52d47e4e1935663dd257ea
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
iOS: change logic for when to scroll screen

The current implementation will stop scrolling the screen to reveal
the cursor if the input item changes transformation. This to not
interfere with flicking etc. This strategy turns out to be too
strict, as some qml apps/games can easily have small animations
applied (e.g qtquick cork board example) that moves or scales
the text areas (or their parents) upon focus.

So instead of relying on input item transformation, we now
scroll whenever the cursor changes position inside the input
item (in addition to orientation changes etc). We also
refactor scrollRootView into two functions, since we in
many cases know if the keyboard should scroll up or down
already when the call is made.

Change-Id: If5bf349139eed69823cfc8986bb4b32c93bdf91b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
iOS: move QUIView interface decl into separate header file

Change-Id: Idc90d85859229d49b1deecc2472b330f0adb1ef8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
iOS: move key/text input into separate category

Change-Id: I62c588226b307d51f7f88b1cc0c1e00c0d0f14c6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
iOS: implement support for input methods

This change will add support for input methods, word
completion, spell checking and related functionality.

Change-Id: I41d4de1cab521c679d414cfc7c1a2d0f9c1fcaaf
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
iOS: add spell checking support

We don't have a separate enum just for spell checking in Qt, but
Qt::ImhNoPredicitiveText should cover it. So use it
to enable/disable both spell checking and auto completion.

Change-Id: I7ad661cb7d720988f13bc1ed940573006c0ce229
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
iOS: send IM events instead of fake key events

Sending faked key events is not such a good idea, since:
1. We don't get key events on iOS, but text events
2. We cannot determine correct key code or modifiers, nor
    do we want to fake modifer press/release etc.
3. Android uses IM for all text input

So it seems that the correct solution is to avoid sending
key events in the first place. This will also bring the iOS
port on par with the Android port.

Change-Id: Ibac1d335184e62eb4185cfd4218a0ec73dffb2c4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
iOS: send backspace events directly

For legacy reasons, we send IM events to the focus
object directly instead of through QPA. To be consistent,
and to ensure that IM and key events end up at the same
object in the same order, we need to send key events
directly to the focus object as well.
We should consider fixing up QPA to support IM events
better, but this will do for now.

Change-Id: I8a18a1f7b7295e5c64a109fb98eee928fae06a0f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
iOS: return styling hints for text correction pop-ups

By returning the font used at the cursor position, the
correction pop-up will be resized to match the
point size, and the text marking will get correct
height.

Change-Id: I362579b793794835323bb9ceb5ddb4655526f392
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
iOS: be more specific about IM callbacks to iOS

No need to call textWillChange all the time if the text is
really not changing. And report that selectionWillChange
when Qt reports that it has changed.

Change-Id: I7bd9f540cd9302c37888926a6152b803cc871ccb
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
iOS: return correct uiview for IM rectangles

UITextView has a property for specifying which UIView the CGRects
you return should be aligned with. This makes a difference for
widgets when not using alien, since then the view that draws the
text will usually not be the same as the view that backs
the top level QWindow.

Change-Id: I240d63c98544c39308cd91465ee84351e7d7d1f4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Cocoa: Handle gracefully closing a window without event dispatcher

Task-number: QTBUG-36696

Change-Id: I799eb351ee8ac1529cfbf009df3e7d57ec3a24ea
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Force surface repaint after is (re)created.

Every time when a surface is (re)created we must paint something in it
otherwise it will appear black.

Task-number: QTBUG-36594
Change-Id: Ib4baaef189f59a83a251cf89db30b0a3aec16d92
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Add QString::fromUtf16 with char16_t and fromUcs4 with char32_t

Because they make sense. I'm even thinking that the char16_t version
should get a QString implicit constructor. Maybe both encodings.

Change-Id: Ifffc61dd890795fbbbd5f7cb5efb3e6287d1270e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
QPA: Introduce QPlatformWindow::normalGeometry().

QWidgetWindow stores the normal geometry obtained from the widget when
transiting to other states. This does not work reliably on Windows,
where this geometry is already that of the new state. Instead,
introduce  QPlatformWindow::normalGeometry(), add implementation
for Windows and use that in QWidgetWindow.

Task-number: QTBUG-21371

Change-Id: I3819ebaf55b4e7d2f7eef1affe6c20712ba45d7c
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Long live QStringIterator!

UCS-4 iterator over a QString.
Kept private for now so we can still work on the API.

Done-with: Thiago
Change-Id: I377f8bb1921e591ee3292c08c3e097fb6bc7f0c4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Fix compilation after b0afad8f0b6a3be7ab3a23e063b0201cd68ada95

That commit made QString::toXxx (8-bit) functions use C++11 ref
qualifiers, so we need to match it here.

Change-Id: I45b50464d36f858d012b12e0cb511aae347ddb6f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Refactor and remove dead code, add property caching.

This helps with a flood of dbus messages due to properties.

Change-Id: I7aa9d36a077d84a88dab561d007d597b0780e096
Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com>