43 Commits

Author SHA1 Message Date
Robert Ancell
c411d37046 Add fl_texture_get_id, so textures can be passed to Flutter (flutter/engine#40290)
Add fl_texture_get_id, so textures can be passed to Flutter
2023-03-16 01:10:07 +00:00
gaaclarke
af036b8857 Turned on performance-unnecessary-value-param everywhere. (flutter/engine#37447)
* Turned on performance-unnecessary-value-param everywhere.

* linux host additions

* ios patch

* reverted bad fix

* revert bad fix

* another ios patch

* removed lint fix printer
2022-11-09 20:55:13 +00:00
J-P Nurmi
5ced18fed0 [Linux] use top-level GTK IM client window (flutter/engine#35272)
This PR takes a step back and changes the GTK IM client window back from FlView to GtkApplicationWindow as it was before #33111. The window was originally changed to FlView to make the code testable by cutting a dependency to gtk_widget_translate_coordinates(). The change was hard to revert because there were several conflicting changes on top. Therefore, this PR introduces an FlTextInputViewDelegate to be able to provide coordinate mapping in a testable way.

Fixes: flutter/flutter#108832
2022-08-09 16:55:41 -07:00
J-P Nurmi
433ac149bf [Linux][A11y] implement AtkEditableText interface (flutter/engine#33955)
* Make FlAccessibleNode derivable

This allows introducing specialized subclasses that implement such a11y
interfaces as AtkEditableText that should not be implemented for the
generic node.

* FlAccessibleNode: add set value, text selection & perform action

Prepare API required for the upcoming AtkEditableText implementation.

* FlViewAccessible: postpone child node creation

This changes the a11y node creation flow so that (unknown) child nodes
are not pre-created when their parent is updated but "pending" child
node IDs are collected for later. Parent-child relationships are
established at the end of update batches when all nodes have been
created.

* Add FlAccessibleTextField that implements AtkEditableText

Solves: flutter/flutter#103191
2022-06-27 10:11:40 +12:00
J-P Nurmi
514b0a43b8 [Linux][A11y] report disabled animations and high contrast accessibility features (flutter/engine#33313)
* FlEngine: add fl_engine_update_accessibility_features()
* FlSettings: add API for high-contrast & animations
* FlEngine: allow passing mock messenger at construction time
* FlSettingsPlugin: report accessibility features
2022-06-27 10:10:55 +12:00
J-P Nurmi
b7bfa342dd [Linux] Test text input (flutter/engine#34186)
This PR finishes what #33661 and #33111 started - most of `FlTextInputPlugin` is now covered by tests.
2022-06-21 10:03:30 -07:00
J-P Nurmi
024fd472b8 [Linux][Testing] reduce the boilerplate for MockBinaryMessenger (flutter/engine#34029)
Let MockBinaryMessenger internally manage the FlBinaryMessenger wrapper
instance and provide it via operator FlBinaryMessenger*() to avoid
having to create two objects in every test. The same technique was used
for MockSettings in #32618.
2022-06-21 09:07:05 +12:00
J-P Nurmi
f7d46e29c2 [Linux] take first steps towards testable text input (flutter/engine#33661)
This PR is a continuation of #33111 and includes necessary changes to test the `TextInputType.setClient()` platform channel call. Testing the actual text input flow requires a mock IM context that will follow in a separate PR.

* [Linux] pass GdkWindow instead of FlView to FlTextInputPlugin
* [Linux] add MockBinaryMessenger::ReceiveMessage()
* [Linux] add test for TextInputType.setClient
* Drop the offscreen window

GdkOffscreenWindow requires display & screen which is a problem in
headless mode. Luckily, we don't really need a window instance in tests
because its only passed as a client window to the IM context which will
be mocked out when we get to tests that depend on it.
2022-06-10 11:17:22 -07:00
Chris Bracken
56fbdd0232 [lint] Enforce k prefix for global constants (flutter/engine#33666)
Enforces that all global constants are prefixed with a 'k' as per the
style guide and updates the codebase into conformance where necessary.

This does not change any public API.

Additional testing provided by the addition of the lint rule.

Ref: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#begin-global-constant-names-with-prefix-k
2022-05-27 18:33:38 -07:00
Sophie Winter
86379d5cb3 Force GTK IM context to initialize at start (flutter/engine#32118)
Fixes https://github.com/flutter/flutter/issues/100385
2022-05-26 13:07:34 -07:00
J-P Nurmi
050055f52c [Linux] fix and test light vs. dark theme detection (flutter/engine#32618) 2022-04-26 10:39:03 -07:00
J-P Nurmi
1bfba47c48 [Linux] add MockSignalHandler for testing GObject signals (flutter/engine#32650) 2022-04-14 13:19:05 -07:00
J-P Nurmi
4248b9b708 [Linux] add (Fl)MockBinaryMessenger for GMock (flutter/engine#32649) 2022-04-14 13:14:05 -07:00
J-P Nurmi
0002a8f57c [Linux] add GTest printer for FlValue (flutter/engine#32652)
Improves test failure messages when matching FlValue arguments.

For example, before:

  Expected arg #2: has setting ("platformBrightness", 0x32f0980)
           Actual: 0x7f81ec005990, 0x32f0900

And after:

  Expected arg #2: has setting ("platformBrightness", dark)
           Actual: 0x27bded0, {textScaleFactor: 0.0, alwaysUse24HourFormat: false, platformBrightness: light}
2022-04-14 10:52:51 +12:00
Robert Ancell
702af087ba Can't test FlView on a server - no display 2021-10-29 11:46:22 +13:00
Robert Ancell
24372ebfa9 Move mock objects into separate modules 2021-10-29 11:46:22 +13:00
Yuhui Huang
1b2b1cae4c Linux texture support (flutter/engine#24916) 2021-09-23 13:53:02 -07:00
George Wright
f4aa3aad88 Add unit tests for Dart entrypoint arguments on Linux (flutter/engine#26951) 2021-06-25 11:05:24 -07:00
Tong Mu
00e9f108c1 Hardware Keyboard: Linux (GTK) (flutter/engine#23467)
Linux (GTK) changes for the Hardware Keyboard project.
2021-05-25 18:04:03 -07:00
huanghongxun
87509d8518 Fix incorrect texture format with OpenGL ES 2021-03-12 11:27:02 +13:00
Yuhui Huang
0561c75b4d Refactor FlRenderer to platform-independent implementation (flutter/engine#24011)
Refactor FlRenderer to platform-independent implementation
2021-02-03 11:31:51 +13:00
Robert Ancell
0cadee4e98 Add accessibility suport to Linux shell. (flutter/engine#19634)
Add accessibility support to the Linux shell
2021-01-13 13:49:48 +13:00
Greg Spencer
70bba34e51 Make pending event handling more lenient to allow out of order responses (flutter/engine#23504)
This PR makes the Linux key handling code a little more lenient when it comes to the order in which it receives responses to key events from the framework. I had assumed that there wasn't a case where responses could get out of order, but it seems that it is possible, given that you can mash on the keyboard and eventually get one out of order.

This changes the code so that instead of just looking at the first entry in the pending event deque, it searches the deque starting at the beginning to find the event, and remove it.
2021-01-08 10:43:59 -08:00
Greg Spencer
49935d5547 Add delayed event delivery for Linux. (flutter/engine#22577)
This changes the text handling so that keyboard events are sent to the framework first for handling, and then passed to the text input plugin, so that the framework has a chance to handle keys before they get given to the text field.

This is complicated by the async nature of the interaction with the framework, since GTK wants a synchronous response. So, in this change, I always tell GTK that the event was handled, and if it wasn't, then I re-dispatch the event once we know one way or the other.
2020-12-03 15:00:37 -08:00
stuartmorgan
156dafb961 Switch Linux embedding to proc table embedder API (flutter/engine#22280)
Switches the Linux embedding from the standard C API to the new proctable version, to allow for unit testing of the embedding layer separately from the embedder APIs implementation.
2020-11-04 15:12:44 -08:00
Robert Ancell
396ad5a9a9 Add braces on if statements to match linter style (flutter/engine#22130) 2020-11-03 12:32:39 +13:00
Anirudh Balaji
07498fbc67 Refactor make_mock_engine into fl_test (flutter/engine#21585) 2020-10-29 15:08:03 -07:00
Robert Ancell
eb7e81fe4c Add FlEventChannel (flutter/engine#21316)
Related to https://github.com/flutter/flutter/issues/65270
2020-10-22 15:06:52 -07:00
William Wold
983b6a8636 Add Linux Wayland support (flutter/engine#20629) 2020-09-16 14:13:06 +12:00
Chris Bracken
d03692449b Prefer C++ standard headers to their C counterpart (flutter/engine#21091)
We currently use a mix of C standard includes (e.g. limits.h) and their
C++ variants (e.g. climits). This migrates to a consistent style for all
cases where the C++ variants are acceptable, but leaves the C
equivalents in place where they are required, such as in the embedder
API and other headers that may be used from C.
2020-09-11 17:10:00 -07:00
Chris Bracken
7acd2b407c Fix linter errors in mock_engine (flutter/engine#21102)
Make a single-param ctor explicit in order to prevent surprising
implicit conversions.

Add a check for zero message-size and don't malloc/memcpy the incoming
message in those cases.

Add braces where they were missing.
2020-09-11 10:27:00 -07:00
William Wold
2752ef1dcd Replace FlRenderer::get_visual() with more generic FlRenderer::setup_window_attr() (flutter/engine#20833) 2020-08-28 14:31:34 +12:00
William Wold
ef326b26ef Improve FlRenderer interface in preperation for Wayland on Linux (flutter/engine#20006) 2020-08-05 12:04:01 +12:00
Robert Ancell
84ccba79fc Set locale in Linux shell (flutter/engine#19470) 2020-07-10 11:16:50 +12:00
Robert Ancell
6d6143c30f Use the X visual from the EGL configuration when making an FlView. (flutter/engine#19438) 2020-07-03 09:37:51 +12:00
Robert Ancell
4ffa68b795 Show EGL configuration debugging when fail to create surface/context (flutter/engine#19397) 2020-07-02 09:35:00 +12:00
Robert Ancell
d302d26b65 Implement an EGL resource context for the Linux shell. (flutter/engine#18918)
Fixes https://github.com/flutter/flutter/issues/54855
2020-06-11 12:31:06 +12:00
Robert Ancell
9b27253467 Log EGL errors (flutter/engine#18917) 2020-06-10 06:27:30 +12:00
Robert Ancell
1a82a8bf32 Support AOT mode in GTK shell (flutter/engine#18809)
Simplify FlDartProject by removing the path arguments - we'll assume that it's
in the standard bundle layout and add new methods later if we need to support
other cases.
2020-06-08 13:18:52 +12:00
Robert Ancell
29a0d55666 Add tests for FlBinaryMessenger, FlBasicMessageChannel, FlMethodChannel (flutter/engine#18638) 2020-06-02 09:39:37 +12:00
Robert Ancell
567c770994 Revert "Add tests for FlBinaryMessenger, FlBasicMessageChannel, FlMethodChannel (#18597)"
This reverts commit 6b0417a1a19f69ec18c2176e3f5cde60aeb9b96d.
2020-05-28 13:32:26 +12:00
Robert Ancell
6b0417a1a1 Add tests for FlBinaryMessenger, FlBasicMessageChannel, FlMethodChannel (flutter/engine#18597)
* Add mock implementations of the Flutter embedding API and EGL
* Add tests for FlBinaryMessenger, FlBasicMessageChannel, FlMethodChannel
2020-05-28 13:13:32 +12:00
Robert Ancell
c23b125ec3 Add FlMessageCodec, FlBinaryCodec, FlStringCodec (flutter/engine#18186)
Classs for binary message encoding/decoding that matches the ones in the Flutter services library.
2020-05-08 16:13:54 +12:00