Commit Graph

59421 Commits

Author SHA1 Message Date
Eskil Abrahamsen Blomfeldt
ac4af55972 Make pixel size a qreal in QRawFont
The pixel size in the font engines is already a floating point value.
For maximum flexibility, we should expose this in the public API.

Task-number: QTBUG-18817
Reviewed-by: Jiang Jiang
(cherry picked from commit ac9e63b58533a3215106ed9da82cff3a3e3dda3a)
2011-05-02 10:13:32 +02:00
Dmitry Zelenkovsky
f26c4ba80d Support more items for QTextCharFormat::VerticalAlignment enum for custom text objects.
* QTextCharFormat::AlignNormal - support text format descent, place text object bottom on (baseline - descent).
 * QTextCharFormat::AlignBottom - place text object bottom on baseline.
 * QTextCharFormat::AlignTop - Still not supported.
 * Any other vertical alignment is mapped QTextCharFormat::AlignBottom.

Add new enum AlignBaseline for custom inline objects to take into account font baseline.

Merge-request: 2578
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
(cherry picked from commit ee9455ed2a83084692d969c398ecb91bcd4fc33a)
2011-05-02 09:53:25 +02:00
Samuel Rødal
af77656f15 Proper child delivery of mouse and key events. 2011-05-02 09:26:40 +02:00
Paul Olav Tvete
a90d1b432c Make the wayland plugin compile 2011-04-29 17:07:06 +02:00
Paul Olav Tvete
6e2bbb58fd include file fix for wayland 2011-04-29 16:30:12 +02:00
Paul Olav Tvete
15d73f83bd Compile after latest change. 2011-04-29 16:30:12 +02:00
Samuel Rødal
57b7c82560 Add QWidgetWindow to bridge events from QWindow to QWidget.
Gets rid of QWidget dependencies in QWindow and QWindowSurface. Events
are not delivered to the correct child widget yet.
2011-04-29 15:46:07 +02:00
Paul Olav Tvete
c1aa42e195 Minimal plugin works again. 2011-04-29 12:59:23 +02:00
Jiang Jiang
774527dd1e Use maximum ascent/descent/leading from fallback fonts in shaping
When shaping a QScriptItem with a multi font engine, currently we
only take the ascent/descent/leading from the primary (first) font
engine in that multi font engine, however, subsequent engines used
during shaping may have larger ascent/descent/leading, disregarding
them may cause clipping issues in some cases.

It's fixed by checking each font engine used in the shaping process
and take the maximum value instead of the first one. On ATSUI we
merely make it compile.

Task-number: QTBUG-16719
Reviewed-by: Eskil
(cherry picked from commit c501403cb5a0c9ec21b00e0c2f640ae85566e0cf)
2011-04-29 11:02:25 +02:00
Jiang Jiang
bbbfc9b0eb Another ugly hack to make bidi cursor work with Core Text
If the text is wrapped with LRE/LRO/RLE/RLO override/embed marks,
Core Text in Mac OS X 10.5 doesn't produce an empty glyph at the
beginning of the glyphs (while it does in Mac OS X 10.6), thus
we need to prepend an empty glyph here, otherwise cursor position
calculation will consider the first two characters as a ligature
of the same glyph.

Reviewed-by: Eskil
(cherry picked from commit a36ac6c34bafa801c2c30d76f59e4a3594efc4d5)
2011-04-29 11:02:24 +02:00
Jiang Jiang
d64460fffb Make sure layoutData exist before checking for string direction
Otherwise accessing that through QTextEngine::alignLine may cause crash.

Reviewed-by: Samuel Rødal
(cherry picked from commit dcdb62c3d1a76d951c4b65bc1b1bd930e2ad14ec)
2011-04-29 11:02:24 +02:00
Jiang Jiang
044e7602ae Take leading space width into account for painting and selection
When painting horizontally centered RTL text and selection with
trailing spaces, we need to take that space width into account
because line.textAdvance doesn't include it.

Task-number: QTBUG-18612
Reviewed-by: Eskil
(cherry picked from commit 224226727f07e8940e0d3131fe7587b11cc4a6ca)
2011-04-29 11:02:24 +02:00
Jiang Jiang
d623257584 Remove extra comma at the end of enum list
It fails compilerwarnings test.

Reviewed-by: TrustMe
(cherry picked from commit 1e847c00dcf4948b8892d0a552576e1d3ea554b9)
2011-04-29 11:02:24 +02:00
Jiang Jiang
0d32728af2 Don't transform glyph positions for Core Graphics paint engine
Since it already transformed text positions based on transform matrix
on QPainter.

Reviewed-by: Eskil
(cherry picked from commit b86c9120710bf1481df5f6541618169a82fd65b8)
2011-04-29 11:02:24 +02:00
Jiang Jiang
a7b6f4c8a5 Turn on HarfBuzz support for Mac/Cocoa
It's possible to enable HarfBuzz text layout on Mac by either:

- Set QT_ENABLE_HARFBUZZ environment variable when running a Qt
  app.

- configure with -harfbuzz to build Qt, then HarfBuzz support
  will be turned on by default.

HarfBuzz will only be used when the font explicitly requested
is supported by HarfBuzz (aka. TrueType/OpenType font), other
fonts (AAT fonts) will still be handled by Core Text.

Using HarfBuzz for text layout will hopefully solve most tricky
complex text shaping bugs on Mac.

Task-number: QTBUG-17728
Reviewed-by: Eskil
2011-04-29 11:02:23 +02:00
Jiang Jiang
0f7cba14f6 Support visual cursor movement for BIDI text
Bidi input can in some contexts be more intuitive if the cursor
works in visual way: pressing left arrow key always make cursor
move one character to the left regardless the language of text,
pressing right arrow key always make cursor move to the right.
It is also the behavior of Mac OS X. Based on the above reason
and requests from Symbian we implemented this support for visual
movement in BIDI text. 3 public properties are added to
QTextDocument, QTextLayout and QLineEdit respectively:

- QTextDocument::defaultCursorMoveStyle can be used to control
  the cursor behavior in all widgets based on QTextDocument,
  like QTextEdit, QPlainTextEdit, etc. When set to QTextCursor::
  Visual, it will enable visual movement for all the cursors in
  the corresponding text edit. Default is QTextCursor::Logical.

- QTextLayout::cursorMoveStyle is used for low-level cursor
  manipulation. When set to Visual, it will enable visual movement
  behavior for all the cursor related methods, including cursorToX,
  xToCursor and drawCursor. Default is Logical.

- QLineEdit::cursorMoveStyle is used to control cursor movement
  behavior in QLineEdit. Default is Logical.:

Task-number: QTBUG-13859
Reviewed-by: Eskil
(cherry picked from commit c480dd641f5d22d1ee72cb27bf39e24c6df65658)
2011-04-29 11:02:23 +02:00
Jiang Jiang
028aa80d70 Disable tst_QPixmap::onlyNullPixmapsOutsideGuiThread on Mac
No need to check it anymore after the switch to raster engine.

Reviewed-by: Eskil
(cherry picked from commit e004701bd7ba9e4a7cd5ac1bf784829feae16cae)
2011-04-29 11:02:23 +02:00
Eskil Abrahamsen Blomfeldt
e99aa8b20c Make sure QFont's resolve mask is copied on compilers with C++0x support
The QFont consists of a d pointer and a resolve mask, and they should
both be copied in the assignment operator.

Task-number: QTBUG-18921
Done-by: Friedemann Kleint
(cherry picked from commit cb5e526c6023237c36aac3446a0a18288f39f3a9)
2011-04-29 10:12:27 +02:00
Jiang Jiang
8c90fb22c4 Fix glyph position issue with fallback fonts
Task-number: QTBUG-18933
Reviewed-by: Eskil
(cherry picked from commit 18fcbf7ae41504324cd453ba9b9655f3e94f6495)
2011-04-29 10:09:13 +02:00
Samuel Rødal
7dda80e1d0 Key and wheel events. 2011-04-29 09:33:50 +02:00
Eskil Abrahamsen Blomfeldt
b2db259a32 Fix crash in raster on X11 when text contains unsupported characters
We would assume the font engine was a FT engine and do a static cast
here, which would cause a crash if the box engine was in use instead.

Task-number: QTBUG-17443
Reviewed-by: Samuel
(cherry picked from commit c9c54682bcd23598ac7a8db3b10e9f18c978e268)
2011-04-29 09:05:26 +02:00
Eskil Abrahamsen Blomfeldt
544babaaf9 doc: Minor cleanup in QGlyphs docs
Just a minor clean-up in the QGlyphs docs. Mainly to try to trigger
CI.

Reviewed-by: TrustMe
(cherry picked from commit 774b5b8c6a627fc90fb7382bc907db5d2e8193bf)
2011-04-29 08:55:03 +02:00
Eskil Abrahamsen Blomfeldt
064d54b2b0 doc: Simplify language in QGlyphs docs
Mainly to trigger CI.

Reviewed-by: TrustMe
(cherry picked from commit 1a1683c2d57debbb3e7f3ae6001eb2c8685dca02)
2011-04-29 08:54:41 +02:00
Samuel Rødal
b68d0688fe Add resize event support to QWindow.
(cherry picked from commit 12b4e7e5a2b18cdd23f540821e1f2785f62b0b9a)
2011-04-28 15:40:01 +02:00
Samuel Rødal
33e1b8dda5 Remove unused parameters in hellowindow.
(cherry picked from commit 3d7f0d967ca1e7e76087d84efc67f5247b72dae6)
2011-04-28 15:39:57 +02:00
Samuel Rødal
f1601a4930 Added QWindow example in examples/opengl/hellowindow.
(cherry picked from commit 712f5fe0acc7ef73117151cd8206a0d4f5d01428)
2011-04-28 15:39:54 +02:00
Samuel Rødal
bbee0db8f9 Preliminary QWindow event delivery.
(cherry picked from commit 28a09e668a8125cff680ab9f1e7256e7e4e34158)
2011-04-28 15:39:52 +02:00
Jørgen Lind
290573425c QApplication: Baseclass fixup
(cherry picked from commit 5bbdf65632feed1a2e3f30e97bcdd47950f2b8d4)
2011-04-28 15:39:49 +02:00
Jørgen Lind
9f14dc661e Font
(cherry picked from commit 050925ccac957dea3d4e138babdd7aa93925dffc)
2011-04-28 15:39:46 +02:00
Jørgen Lind
9b8759284b clipboard
(cherry picked from commit 3f5c0e26e0f8b6876c3fb4d3822df49c748b2eea)
2011-04-28 15:39:44 +02:00
Samuel Rødal
0d12e17d25 QGuiApplication refactor in progress.
Things are a bit broken now... At least wiggly runs :)
(cherry picked from commit 6cdcf395ffe1e051d109a45ecd71141173a4a4c0)
2011-04-28 15:39:41 +02:00
Jørgen Lind
dd34255948 Fix QWindow::destroy
(cherry picked from commit 00cd7aa93f916772b22c6137293c7127fe5a33b8)
2011-04-28 15:39:38 +02:00
Jørgen Lind
dc897ca7d9 Lazy init of QWindow
(cherry picked from commit a2c884b6d2fcc77f6aa5e7aaa0aa329f5bef0bbd)
2011-04-28 15:39:36 +02:00
Jørgen Lind
d04aee22e7 Added a visible state to QWindow
(cherry picked from commit 6cd96d1921af9740bf92405ae3adf466140f8923)
2011-04-28 15:39:33 +02:00
Jørgen Lind
2a8189035f Add isWindow type to QObject
(cherry picked from commit 77f08730b4cdb23b43471b2b29ece59e159103d7)
2011-04-28 15:39:30 +02:00
Jørgen Lind
d72a994a06 For QWindow we need topLevelExtra to be created when we have
native widgets
(cherry picked from commit 247088f8fe929d55832f48af3da6f7e5e80cf8a4)
2011-04-28 15:39:28 +02:00
Jørgen Lind
d8784df713 use QObject parent logic when setting parent for QWindow
(cherry picked from commit 2be9fdb4b58accea4078654efed49a50acf6c74d)
2011-04-28 15:39:25 +02:00
Jørgen Lind
54ab99d5e2 Fix compile warnings
(cherry picked from commit e7e856403f32af3e75958c0a8ab68dc37d28df83)
2011-04-28 15:39:23 +02:00
Jørgen Lind
4eb1543337 Lighthouse: use maybetopdata instead of creating topdata for all
widgets
(cherry picked from commit 873764aa3cfbbd87bbbb4f3224a7807d46a16fc7)
2011-04-28 15:39:20 +02:00
Samuel Rødal
45272d5e45 Get rid of QWindow::WindowType and clean up Qt::WindowFlags instead.
(cherry picked from commit 72176bf2a490d2f831d53a66a0987213efa60935)
2011-04-28 15:39:03 +02:00
Samuel Rødal
96b872506a Don't create a platform window if we already have one.
(cherry picked from commit c4dea497adc36a0be840a51c9b98177f1f4b65b2)
2011-04-28 15:39:00 +02:00
Jørgen Lind
02d44966ba Add proper parent logic for qwidget
(cherry picked from commit 98118fb729c39083718c220383fff462ba8eaebd)
2011-04-28 15:38:57 +02:00
Jørgen Lind
61c6f64872 Dont call QPlatformGLContext::makeCurrent from subclass
(cherry picked from commit fc0a6ab220ab97b8f6acf90bf04b46de513a4d96)
2011-04-28 15:38:54 +02:00
Samuel Rødal
ef77e8b651 Added QWindowContext and got wiggly up and running with xcb.
(cherry picked from commit c980e4ef4ebc7699a6c3a7529d3f08ebafc21ffe)
2011-04-28 15:38:51 +02:00
Jørgen Lind
fbef41167a Make QtGui compile again....
Comment out stuff in QWidget::create_sys
(cherry picked from commit 1bbc6a6bb2bf1175080e7a5ba6834ff642fd47ab)
2011-04-28 15:38:48 +02:00
Samuel Rødal
25028e3b14 QPlatformWindowFormat -> QWindowFormat fixes.
(cherry picked from commit 4c2eba33ca0433386fa1273fb1bc14adb852d9ac)
2011-04-28 15:38:46 +02:00
Samuel Rødal
864a2dfa9b QWindow implementation fixes.
(cherry picked from commit 2682cb6bd76a89c8d4ae81b0dd4a77abbf987c24)
2011-04-28 15:38:43 +02:00
Samuel Rødal
dffc816f49 Make QWindowFormat in QWindow a setter and not a constructor argument.
(cherry picked from commit 61e0c55dd0c82031cf5cd021bf3f3537ee91b4a8)
2011-04-28 15:38:41 +02:00
Samuel Rødal
6d28965b10 Move WindowType to QWindow.
(cherry picked from commit cfa7dc87bc962bd0f3a43a464723d74d87f997e2)
2011-04-28 15:38:38 +02:00
Jørgen Lind
498f938f2d Just some more on QWindow. Nothing works
(cherry picked from commit 3acf7aa979630a57791e2a039b1b7b0b85b0aac8)
2011-04-28 15:38:35 +02:00