5#ifndef FLUTTER_SHELL_PLATFORM_FUCHSIA_FLUTTER_PLATFORM_VIEW_H_
6#define FLUTTER_SHELL_PLATFORM_FUCHSIA_FLUTTER_PLATFORM_VIEW_H_
8#include <fuchsia/ui/composition/cpp/fidl.h>
9#include <fuchsia/ui/input/cpp/fidl.h>
10#include <fuchsia/ui/input3/cpp/fidl.h>
11#include <fuchsia/ui/pointer/cpp/fidl.h>
12#include <fuchsia/ui/test/input/cpp/fidl.h>
13#include <lib/fidl/cpp/binding.h>
14#include <lib/fit/function.h>
15#include <lib/sys/cpp/service_directory.h>
23#include <unordered_map>
25#include "flutter/fml/memory/weak_ptr.h"
26#include "flutter/shell/platform/fuchsia/flutter/external_view_embedder.h"
29#include "flutter/fml/macros.h"
30#include "flutter/fml/memory/weak_ptr.h"
31#include "flutter/fml/time/time_delta.h"
32#include "flutter/shell/common/platform_view.h"
33#include "flutter/shell/platform/fuchsia/flutter/keyboard.h"
34#include "flutter/shell/platform/fuchsia/flutter/vsync_waiter.h"
46 fit::function<std::unique_ptr<flutter::Surface>()>;
76 fuchsia::ui::views::ViewRef view_ref,
77 std::shared_ptr<flutter::ExternalViewEmbedder> external_view_embedder,
78 fuchsia::ui::input::ImeServiceHandle ime_service,
79 fuchsia::ui::input3::KeyboardHandle keyboard,
80 fuchsia::ui::pointer::TouchSourceHandle touch_source,
81 fuchsia::ui::pointer::MouseSourceHandle mouse_source,
82 fuchsia::ui::views::FocuserHandle focuser,
83 fuchsia::ui::views::ViewRefFocusedHandle view_ref_focused,
84 fuchsia::ui::composition::ParentViewportWatcherHandle
85 parent_viewport_watcher,
86 fuchsia::ui::pointerinjector::RegistryHandle pointerinjector_registry,
97 await_vsync_for_secondary_callback_callback,
98 std::shared_ptr<sys::ServiceDirectory> dart_application_svc);
104 fuchsia::ui::composition::ParentViewportStatus status);
106 fuchsia::ui::composition::ChildViewStatus status);
109 fuchsia::ui::views::ViewRef view_ref);
119 void RegisterPlatformMessageHandlers();
121 bool OnHandlePointerEvent(
const fuchsia::ui::input::PointerEvent& pointer);
123 bool OnHandleFocusEvent(
const fuchsia::ui::input::FocusEvent& focus);
126 std::unique_ptr<flutter::VsyncWaiter> CreateVSyncWaiter()
override;
129 std::unique_ptr<flutter::Surface> CreateRenderingSurface()
override;
132 void HandlePlatformMessage(
133 std::unique_ptr<flutter::PlatformMessage>
message)
override;
136 void UpdateSemantics(
143 bool HandleAccessibilityChannelPlatformMessage(
144 std::unique_ptr<flutter::PlatformMessage>
message);
147 bool HandleFlutterPlatformChannelPlatformMessage(
148 std::unique_ptr<flutter::PlatformMessage>
message);
151 bool HandleFlutterPlatformViewsChannelPlatformMessage(
152 std::unique_ptr<flutter::PlatformMessage>
message);
155 static bool HandleFuchsiaShaderWarmupChannelPlatformMessage(
157 std::unique_ptr<flutter::PlatformMessage>
message);
160 bool HandleFuchsiaInputTestChannelPlatformMessage(
161 std::unique_ptr<flutter::PlatformMessage>
message);
164 bool HandleFuchsiaChildViewChannelPlatformMessage(
165 std::unique_ptr<flutter::PlatformMessage>
message);
171 void OnDisposeView(int64_t view_id_raw);
175 void OnChildViewConnected(uint64_t content_id);
180 void OnChildViewDisconnected(uint64_t content_id);
183 std::array<float, 2> ClampToViewSpace(
const float x,
const float y)
const;
192 std::optional<std::array<float, 2>> view_logical_size_;
193 std::optional<std::array<float, 2>> view_logical_origin_;
194 std::optional<float> view_pixel_ratio_;
196 std::shared_ptr<flutter::ExternalViewEmbedder> external_view_embedder_;
198 std::shared_ptr<FocusDelegate> focus_delegate_;
199 std::shared_ptr<PointerDelegate> pointer_delegate_;
200 std::unique_ptr<PointerInjectorDelegate> pointer_injector_delegate_;
203 std::unique_ptr<TextDelegate> text_delegate_;
205 std::set<int> down_pointers_;
210 platform_message_handlers_;
214 std::set<std::string > unregistered_channels_;
226 await_vsync_for_secondary_callback_callback_;
229 fuchsia::ui::test::input::TouchInputListenerPtr touch_input_listener_;
230 fuchsia::ui::test::input::KeyboardInputListenerPtr keyboard_input_listener_;
231 fuchsia::ui::test::input::MouseInputListenerPtr mouse_input_listener_;
234 std::shared_ptr<sys::ServiceDirectory> dart_application_svc_;
238 struct ChildViewInfo {
239 ChildViewInfo(zx_handle_t token,
240 fuchsia::ui::composition::ChildViewWatcherPtr watcher)
241 : view_id(token), child_view_watcher(
std::move(watcher)) {}
243 fuchsia::ui::composition::ChildViewWatcherPtr child_view_watcher;
245 std::unordered_map<uint64_t ,
249 fuchsia::ui::composition::ParentViewportWatcherPtr parent_viewport_watcher_;
250 fuchsia::ui::composition::ParentViewportStatus parent_viewport_status_;
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Dart_NativeFunction function
std::function< void(const std::vector< std::string > &, std::function< void(uint32_t)>, uint64_t, uint64_t)> OnShaderWarmupCallback
fit::function< void(int64_t, ViewCallback, ViewCreatedCallback, bool, bool)> OnCreateViewCallback
fit::function< void(int64_t, ViewIdCallback)> OnDestroyViewCallback
fit::function< void(int64_t, SkRect, bool, bool)> OnUpdateViewCallback
fit::function< std::unique_ptr< flutter::Surface >()> OnCreateSurfaceCallback
std::function< void()> ViewCallback
std::function< void(FireCallbackCallback)> AwaitVsyncForSecondaryCallbackCallback
fit::function< void(flutter::SemanticsNodeUpdates, float)> OnSemanticsNodeUpdateCallback
std::function< void(fuchsia::ui::composition::ContentId)> ViewIdCallback
std::function< void(FireCallbackCallback)> AwaitVsyncCallback
fit::function< void(std::string)> OnRequestAnnounceCallback
std::function< void(fuchsia::ui::composition::ContentId, fuchsia::ui::composition::ChildViewWatcherHandle child_view_watcher)> ViewCreatedCallback
fit::function< void(bool)> OnEnableWireframeCallback
std::unordered_map< int32_t, SemanticsNode > SemanticsNodeUpdates
std::unordered_map< int32_t, CustomAccessibilityAction > CustomAccessibilityActionUpdates
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not set
SI auto map(std::index_sequence< I... >, Fn &&fn, const Args &... args) -> skvx::Vec< sizeof...(I), decltype(fn(args[0]...))>