Commit Graph

22 Commits

Author SHA1 Message Date
Andy Weiss 81110bb8ec Support empty strings and vectors in standard codec (#12974)
* Support empty strings and vectors in standard codec

Fixes #41993

Currently an empty string or vector will call through to WriteBytes
which asserts that the number of bytes it is being asked to write is
strictly positive. Instead we should not call WriteBytes if the length
is zero.

Similarly, when we read, we don't need to call out if the length is
zero.

* fix typo in test name

* remove unnecessary length check in ReadValue for List

* we also don't need this check before calling read as memcpy can handle size 0
2019-10-15 08:35:50 -07:00
chunhtai daf1eb9a6a add windows embedding test (#12423) 2019-10-03 12:42:44 -07:00
stuartmorgan 709fc6e00c Adds PluginRegistry to the C++ client wrapper API (#12287)
Makes the plugin registration structure consistent with macOS. This will
be used in generated plugin registrant files rather than a specific
implemenation class, so this helps unblock the creation of generated
registrants on Windows and Linux.
2019-09-17 11:41:22 -07:00
shoryukenn 38d545ee17 Improve Unicode handling on Windows (#11899)
Significantly improves the behavior of non-ASCII text input on Windows. Correctly
processes incoming character events as UTF-16, and for now uses UTF-32 for
the text model so that the existing index-based logic will work much more often.

Future work is still needed, but this will handle far more cases correctly.
2019-09-08 12:13:59 -07:00
Francisco Magdaleno ef26c460ab Finish plumbing message responses on method channels (#11877) 2019-09-04 16:17:10 -07:00
Chris Bracken 92c63e848a Ensure trailing newline before EOF in C++ sources (#11489)
In generated text fixture location lookup code:
When the second argument to write_file() is a list, it is written one
item per line to the path specified by the first argument. This ensures
that we emit a trailing newline at EOF to comply with -Wnewline-eof.

Elsewhere:
Lack of a newline at EOF was undefined behaviour prior to C++11. The
Fuchsia tree sets -Wnewline-eof in its buildroot, so we plan to do the
same. This cleans up remaining first-party C++ sources that don't
include a trailing newline.
2019-08-27 00:13:00 -07:00
James Clarke ff484d4f69 [Windows] Alternative Windows shell platform implementation (#9835)
Start work on flutter/flutter#30726 by adding an alternative win32 shell platform implementation for Windows that is not based on GLFW and that uses LIBANGLE for rendering and native win32 windowing and input. This change does not replace the GLFW implementation but rather runs side by side with it producing a secondary flutter_windows_win32.dll artifact. The following items must be added to attain parity with the GLFW implementation:
- Custom task scheduling
- Support for keyboard modifier keys
- Async texture uploads
- Correct high DPI handling on Windows versions < 1703
and will be added in subsequent changes.
2019-08-14 15:52:52 -07:00
Francisco Magdaleno 6aad13910c [glfw] Enables replies on binary messenger in glfw embedder (#9948) 2019-07-31 14:27:46 -07:00
stuartmorgan 7d320c45ab Add a macro for prefixing embedder.h symbols (#9851)
embedder.h is a C API, so has no namespace, and only uses 'Flutter' as a
prefix for most symbol names. This creates potential collisions with
other code; for instance, FlutterEngine is the name of a type in
embedder.h, but also an ObjC class in the iOS Flutter API.

This adds a macro that can be set to prefix symbol names, allowing
clients (notably, the macOS embedding) to adjust the names used by the
embedding API internally without breaking ABI or API compatibility for
the standard engine build.

Currently the macro is only applied to FlutterEngine, since that's the
symbol that is currently at issue, but it can be expanded to other
symbols in the future.
2019-07-23 05:48:48 -07:00
stuartmorgan ba6cc8c93c Fix type mismatches in C++ standard codec (#9112)
There were some implicit casts in the standard codec implementation that
didn't show up on Linux, but do on Windows.
2019-05-30 10:17:08 -07:00
Chinmay Garde 37b367e4d2 Allow specifying both Dart and non-Dart fixtures in engine unit-tests. (#9113)
* Allow specifying both Dart and non-Dart fixtures in engine unittests.

This fixes numerous issues in the way in which fixtures were managed
in the engine unit-tests.

* Instead of only being able to specify Dart fixtures, unit-tests may specify
  non-Dart fixtures as well. These are simply copied over to the fixtures
  directory known to the unit-test at runtime.
* An issue where numerous Dart files could be given to the kernel snapshotter
  has been addressed. It was anticipated that such a (legal) invocation to the
  kernel snapshotter would produce a snapshot with the contents of all the Dart
  files added to the root library. This is incorrect and the behavior in this
  case is undefined.
* Dart files referenced by the main Dart file are correctly tracked via a
  depfile.
* The snapshotter arguments have been cleaned up to get rid of unused
  arguments (`—strong`) and  the use of the VM product mode argument has been
  corrected to no longer depend on the Flutter product mode.
2019-05-28 19:11:47 -07:00
Chris Bracken 0f1ff3bdb3 Correct typos, adopt US spellings (#9081)
Corects a bnuch of typeos throughout teh engien codebsae. Also makes
a couple minor Commonwealth -> US spelling adjustments for consistency
with the rest of Flutter's codebase.

Made use of `misspell` tool:
https://github.com/client9/misspell
2019-05-25 13:14:46 -07:00
stuartmorgan 75678602b4 Minor fixes/adjustments to the GLFW shell (#8990)
- Makes json_method_codec.cc compatible with the last stable RapidJSON release.
- Allows removing the GTK dependency with a compile flag.
- Fixes a missing break in a switch flagged by some toolchains.
2019-05-20 14:36:59 -04:00
stuartmorgan 62ab9c7b81 Provide access to GLFW window in plugins (#8806)
Plugins may need to be able to access functions affecting the GLFW
window (e.g., a plugin to resize the window). This restructures the API
to create a distinction at both the C and C++ level between the window
controller, which provides access to high-level behaviors driving the
Flutter application, and the window, which provides access to functions
to affect the UI state of the window (i.e., wrapped GLFWwindow
functions).

Also provides a PluginRegistrar extension for plugins that need access
to GLFW-specific functionality.
2019-05-06 15:37:02 -04:00
Shi-Hao Hong d8aa6bca16 Fix typo in comment (#8617) 2019-04-17 15:03:50 -07:00
stuartmorgan 4266f8583f Add desktop shell unittests to test script (#8600)
Builds the unit test on all platforms, and adds them to the aggregate test script.
2019-04-16 22:37:39 -07:00
stuartmorgan 4805d72a49 Implement StandardMethodCodec for C++ shells (#8598)
Adds StandardMethodCodec support to the C++ client wrapper. This makes it
substantially easier to add Windows and Linux support for existing plugins, as
StandardMethodCodec is the default plugin protocol.

Fixes flutter/flutter#30670

Does not include extensibility for the codec, which will be added later.
2019-04-16 19:49:09 -07:00
stuartmorgan b819b62bed Variant type for C++ client wrapper (#8592)
Adds a type that can hold any of the types corresponding to the Dart types
that are supported by the standard message channel codec. This provides
the foundation for adding standard message codec support for the C++
desktop shells (flutter/flutter#30670).
2019-04-16 16:33:07 -07:00
Diego Ballesteros Villamizar ad04340e52 Add missing <memory> include to text_input_model.h (#8562)
text_input_model.h uses std::unique_ptr but does not include the memory header.
2019-04-12 10:48:11 -07:00
Chinmay Garde 56052c70af Rename the shell namespace to flutter. (#8520) 2019-04-09 17:10:46 -07:00
stuartmorgan 84c62b4c7d Build Windows shell (#8331)
Enables the build of the Windows shell, based on the same GLFW code used
by the current Linux shell.
2019-03-27 23:38:44 -04:00
stuartmorgan d452dd5c36 Initial import of GLFW Linux shell from FDE (#8159)
Changes include:
- File structure
- Header guards
- Include paths
- Namespaces
- Integration with the engine's GN build
- Conversion from jsoncpp to rapidjson
- Style and clang-format adjustment to match engine repository
2019-03-20 17:15:52 -04:00