Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
6d9defb
Add UWP Target
clarkezone Oct 5, 2020
b0940b7
Merge remote-tracking branch 'upstream/master' into add-winuwp-target
clarkezone Oct 31, 2020
df7af06
CR feedback
clarkezone Oct 31, 2020
925c571
Update licenses
clarkezone Oct 31, 2020
8ec92be
Move the flutter_windows_winuwp_defs to buildroot
clarkezone Oct 31, 2020
642332d
CR Feedback: UWP ifdef applied automatically by buildroot
clarkezone Nov 5, 2020
0607fa0
CR feedback: split flutter_windows.cc
clarkezone Nov 5, 2020
28cfc6a
CR Feedback
clarkezone Nov 7, 2020
a4d28f4
Merge remote-tracking branch 'upstream/master' into add-winuwp-target
clarkezone Nov 7, 2020
8cafe53
Merge remote-tracking branch 'upstream/master' into add-winuwp-target
clarkezone Nov 12, 2020
287029c
Rename task runners
stuartmorgan-g Nov 19, 2020
fd8b690
Minor cleanup
stuartmorgan-g Nov 19, 2020
b6fa938
TaskRunner factory
stuartmorgan-g Nov 19, 2020
9576f5c
Abstract PlatformHandler. Minor fixes
stuartmorgan-g Nov 23, 2020
e4c8484
Do some testing backfill on the refactored PlatformHandler
stuartmorgan-g Nov 24, 2020
895088c
Formatting
stuartmorgan-g Nov 24, 2020
111063c
Formatting again, but with the right gn
stuartmorgan-g Nov 24, 2020
a3eba8c
Merge remote-tracking branch 'upstream/master' into add-winuwp-target
clarkezone Dec 5, 2020
26f2b55
Fix UWP build
clarkezone Dec 5, 2020
59d6d53
Fix the win32 build
clarkezone Dec 5, 2020
81b31d7
CR feedback
clarkezone Dec 5, 2020
15d6fb6
Make licenses happy again
clarkezone Dec 5, 2020
a4a43c6
Make licenses happy again take 2
clarkezone Dec 5, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,15 @@ group("flutter") {
}

if (is_win) {
public_deps += [
"//flutter/shell/platform/windows:flutter_windows_unittests",
"//flutter/shell/platform/windows/client_wrapper:client_wrapper_windows_unittests",
]
if (target_os == "winuwp") {
# TODO: Add winnup variant of the unit tests here; see
# https://github.com/flutter/flutter/issues/70197
} else {
public_deps += [
"//flutter/shell/platform/windows:flutter_windows_unittests",
"//flutter/shell/platform/windows/client_wrapper:client_wrapper_windows_unittests",
]
}
}
}
}
Expand Down
19 changes: 15 additions & 4 deletions ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -1408,16 +1408,31 @@ FILE: ../../../flutter/shell/platform/windows/flutter_windows_engine.h
FILE: ../../../flutter/shell/platform/windows/flutter_windows_engine_unittests.cc
FILE: ../../../flutter/shell/platform/windows/flutter_windows_view.cc
FILE: ../../../flutter/shell/platform/windows/flutter_windows_view.h
FILE: ../../../flutter/shell/platform/windows/flutter_windows_win32.cc
FILE: ../../../flutter/shell/platform/windows/flutter_windows_winuwp.cc
FILE: ../../../flutter/shell/platform/windows/key_event_handler.cc
FILE: ../../../flutter/shell/platform/windows/key_event_handler.h
FILE: ../../../flutter/shell/platform/windows/keyboard_hook_handler.h
FILE: ../../../flutter/shell/platform/windows/platform_handler.cc
FILE: ../../../flutter/shell/platform/windows/platform_handler.h
FILE: ../../../flutter/shell/platform/windows/platform_handler_unittests.cc
FILE: ../../../flutter/shell/platform/windows/platform_handler_win32.cc
FILE: ../../../flutter/shell/platform/windows/platform_handler_win32.h
FILE: ../../../flutter/shell/platform/windows/platform_handler_winuwp.cc
FILE: ../../../flutter/shell/platform/windows/platform_handler_winuwp.h
FILE: ../../../flutter/shell/platform/windows/public/flutter_windows.h
FILE: ../../../flutter/shell/platform/windows/string_conversion.cc
FILE: ../../../flutter/shell/platform/windows/string_conversion.h
FILE: ../../../flutter/shell/platform/windows/string_conversion_unittests.cc
FILE: ../../../flutter/shell/platform/windows/system_utils.h
FILE: ../../../flutter/shell/platform/windows/system_utils_unittests.cc
FILE: ../../../flutter/shell/platform/windows/system_utils_win32.cc
FILE: ../../../flutter/shell/platform/windows/system_utils_winuwp.cc
FILE: ../../../flutter/shell/platform/windows/task_runner.h
FILE: ../../../flutter/shell/platform/windows/task_runner_win32.cc
FILE: ../../../flutter/shell/platform/windows/task_runner_win32.h
FILE: ../../../flutter/shell/platform/windows/task_runner_winuwp.cc
FILE: ../../../flutter/shell/platform/windows/task_runner_winuwp.h
FILE: ../../../flutter/shell/platform/windows/text_input_plugin.cc
FILE: ../../../flutter/shell/platform/windows/text_input_plugin.h
FILE: ../../../flutter/shell/platform/windows/win32_dpi_utils.cc
Expand All @@ -1426,10 +1441,6 @@ FILE: ../../../flutter/shell/platform/windows/win32_dpi_utils_unittests.cc
FILE: ../../../flutter/shell/platform/windows/win32_flutter_window.cc
FILE: ../../../flutter/shell/platform/windows/win32_flutter_window.h
FILE: ../../../flutter/shell/platform/windows/win32_flutter_window_unittests.cc
FILE: ../../../flutter/shell/platform/windows/win32_platform_handler.cc
FILE: ../../../flutter/shell/platform/windows/win32_platform_handler.h
FILE: ../../../flutter/shell/platform/windows/win32_task_runner.cc
FILE: ../../../flutter/shell/platform/windows/win32_task_runner.h
FILE: ../../../flutter/shell/platform/windows/win32_window.cc
FILE: ../../../flutter/shell/platform/windows/win32_window.h
FILE: ../../../flutter/shell/platform/windows/win32_window_proc_delegate_manager.cc
Expand Down
145 changes: 95 additions & 50 deletions shell/platform/windows/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,20 @@ source_set("flutter_windows_headers") {
public_deps =
[ "//flutter/shell/platform/common/cpp:common_cpp_library_headers" ]

configs +=
[ "//flutter/shell/platform/common/cpp:desktop_library_implementation" ]
if (target_os == "winuwp") {
configs +=
[ "//flutter/shell/platform/common/cpp:desktop_library_implementation" ]
} else {
configs +=
[ "//flutter/shell/platform/common/cpp:desktop_library_implementation" ]
}

public_configs =
[ "//flutter/shell/platform/common/cpp:relative_flutter_library_headers" ]
}

source_set("flutter_windows_source") {
# Common Windows sources.
sources = [
"angle_surface_manager.cc",
"angle_surface_manager.h",
Expand All @@ -52,29 +58,48 @@ source_set("flutter_windows_source") {
"key_event_handler.cc",
"key_event_handler.h",
"keyboard_hook_handler.h",
"platform_handler.cc",
"platform_handler.h",
"string_conversion.cc",
"string_conversion.h",
"system_utils.h",
"system_utils_win32.cc",
"task_runner.h",
"text_input_plugin.cc",
"text_input_plugin.h",
"win32_dpi_utils.cc",
"win32_dpi_utils.h",
"win32_flutter_window.cc",
"win32_flutter_window.h",
"win32_platform_handler.cc",
"win32_platform_handler.h",
"win32_task_runner.cc",
"win32_task_runner.h",
"win32_window.cc",
"win32_window.h",
"win32_window_proc_delegate_manager.cc",
"win32_window_proc_delegate_manager.h",
"window_binding_handler.h",
"window_binding_handler_delegate.h",
"window_state.h",
]

# Target-specific sources.
if (target_os == "winuwp") {
sources += [
"flutter_windows_winuwp.cc",
"platform_handler_winuwp.cc",
"platform_handler_winuwp.h",
"system_utils_winuwp.cc",
"task_runner_winuwp.cc",
"task_runner_winuwp.h",
]
} else {
sources += [
"flutter_windows_win32.cc",
"platform_handler_win32.cc",
"platform_handler_win32.h",
"system_utils_win32.cc",
"task_runner_win32.cc",
"task_runner_win32.h",
"win32_dpi_utils.cc",
"win32_dpi_utils.h",
"win32_flutter_window.cc",
"win32_flutter_window.h",
"win32_window.cc",
"win32_window.h",
"win32_window_proc_delegate_manager.cc",
"win32_window_proc_delegate_manager.h",
]
}

configs += [
"//flutter/shell/platform/common/cpp:desktop_library_implementation",
"//third_party/angle:gl_prototypes",
Expand Down Expand Up @@ -116,40 +141,51 @@ shared_library("flutter_windows") {
public_configs = [ "//flutter:config" ]
}

shared_library("flutter_windows_winuwp") {
deps = [ ":flutter_windows_source" ]
libs = [ "windowsapp.lib" ]
public_configs = [ "//flutter:config" ]
}

test_fixtures("flutter_windows_fixtures") {
fixtures = []
}

executable("flutter_windows_unittests") {
testonly = true

sources = [
"flutter_project_bundle_unittests.cc",
"flutter_windows_engine_unittests.cc",
"string_conversion_unittests.cc",
"system_utils_unittests.cc",
"testing/engine_embedder_api_modifier.h",
"testing/mock_win32_window.cc",
"testing/mock_win32_window.h",
"testing/win32_flutter_window_test.cc",
"testing/win32_flutter_window_test.h",
"win32_dpi_utils_unittests.cc",
"win32_flutter_window_unittests.cc",
"win32_window_proc_delegate_manager_unittests.cc",
"win32_window_unittests.cc",
]

public_configs = [ "//flutter:config" ]

deps = [
":flutter_windows_fixtures",
":flutter_windows_headers",
":flutter_windows_source",
"//flutter/shell/platform/embedder:embedder_as_internal_library",
"//flutter/shell/platform/embedder:embedder_test_utils",
"//flutter/testing",
"//third_party/rapidjson",
]
if (target_os == "winuwp") {
# disabled until the uwp implementation is present
} else {
executable("flutter_windows_unittests") {
testonly = true

sources = [
"flutter_project_bundle_unittests.cc",
"flutter_windows_engine_unittests.cc",
"string_conversion_unittests.cc",
"system_utils_unittests.cc",
"testing/engine_embedder_api_modifier.h",
"testing/mock_win32_window.cc",
"testing/mock_win32_window.h",
"testing/win32_flutter_window_test.cc",
"testing/win32_flutter_window_test.h",
"win32_dpi_utils_unittests.cc",
"win32_flutter_window_unittests.cc",
"win32_window_proc_delegate_manager_unittests.cc",
"win32_window_unittests.cc",
]

public_configs = [ "//flutter:config" ]

deps = [
":flutter_windows_fixtures",
":flutter_windows_headers",
":flutter_windows_source",
"//flutter/shell/platform/common/cpp:common_cpp",
"//flutter/shell/platform/embedder:embedder_as_internal_library",
"//flutter/shell/platform/embedder:embedder_test_utils",
"//flutter/testing",
"//third_party/rapidjson",
]
}
}

shared_library("flutter_windows_glfw") {
Expand All @@ -168,11 +204,20 @@ group("windows_glfw") {
}

group("windows") {
deps = [
":flutter_windows",
":publish_headers_windows",
"//flutter/shell/platform/windows/client_wrapper:publish_wrapper_windows",
]
if (target_os == "winuwp") {
deps = [
":flutter_windows_winuwp",
":publish_headers_windows",
"//flutter/shell/platform/windows/client_wrapper:publish_wrapper_windows",
]
} else {
deps = [
":flutter_windows",
":publish_headers_windows",
"//flutter/shell/platform/windows/client_wrapper:publish_wrapper_windows",
]
}

if (build_glfw_shell) {
deps += [ ":windows_glfw" ]
}
Expand Down
2 changes: 2 additions & 0 deletions shell/platform/windows/client_wrapper/flutter_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ void FlutterEngine::ShutDown() {
engine_ = nullptr;
}

#ifndef WINUWP
std::chrono::nanoseconds FlutterEngine::ProcessMessages() {
return std::chrono::nanoseconds(FlutterDesktopEngineProcessMessages(engine_));
}
#endif

void FlutterEngine::ReloadSystemFonts() {
FlutterDesktopEngineReloadSystemFonts(engine_);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ FlutterViewController::~FlutterViewController() {
}
}

#ifndef WINUWP
std::optional<LRESULT> FlutterViewController::HandleTopLevelWindowProc(
HWND hwnd,
UINT message,
Expand All @@ -39,5 +40,6 @@ std::optional<LRESULT> FlutterViewController::HandleTopLevelWindowProc(
controller_, hwnd, message, wparam, lparam, &result);
return handled ? result : std::optional<LRESULT>(std::nullopt);
}
#endif

} // namespace flutter
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class FlutterViewController {
// Returns the view managed by this controller.
FlutterView* view() { return view_.get(); }

#ifndef WINUWP
// Allows the Flutter engine and any interested plugins an opportunity to
// handle the given message.
//
Expand All @@ -55,6 +56,7 @@ class FlutterViewController {
UINT message,
WPARAM wparam,
LPARAM lparam);
#endif

private:
// Handle for interacting with the C API's view controller, if any.
Expand Down
2 changes: 1 addition & 1 deletion shell/platform/windows/flutter_project_bundle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <filesystem>
#include <iostream>

#include "flutter/shell/platform/common/cpp/engine_switches.h"
#include "flutter/shell/platform/common/cpp/engine_switches.h" // nogncheck
#include "flutter/shell/platform/common/cpp/path_utils.h"

namespace flutter {
Expand Down
Loading