5#ifndef FLUTTER_SHELL_PLATFORM_WINDOWS_FLUTTER_WINDOWS_VIEW_H_
6#define FLUTTER_SHELL_PLATFORM_WINDOWS_FLUTTER_WINDOWS_VIEW_H_
11#include <unordered_map>
53 std::unique_ptr<WindowBindingHandler> window_binding,
54 bool is_sized_to_content,
57 std::shared_ptr<WindowsProcTable> windows_proc_table =
nullptr);
154 int modifiers_state)
override;
174 int32_t device_id = 0)
override;
184 double rotation)
override;
190 void OnText(
const std::u16string&)
override;
222 int scroll_offset_multiplier,
224 int32_t device_id)
override;
246 ui::AXPlatformNodeWin*
AlertNode()
const;
255 return accessibility_bridge_;
263 virtual bool Focus();
270 virtual std::shared_ptr<AccessibilityBridgeWindows>
280 struct PointerState {
285 int32_t pointer_id = 0;
288 bool flutter_state_is_down =
false;
293 bool flutter_state_is_added =
false;
296 uint64_t buttons = 0;
299 double pan_zoom_start_x = 0;
302 double pan_zoom_start_y = 0;
306 enum class ResizeState {
327 bool ResizeRenderSurface(
size_t width,
size_t height);
331 void SendWindowMetrics(
size_t width,
size_t height,
double pixel_ratio)
const;
334 void SendPointerMove(
double x,
double y, PointerState* state);
337 void SendPointerDown(
double x,
double y, PointerState* state);
340 void SendPointerUp(
double x,
double y, PointerState* state);
347 void SendPointerLeave(
double x,
double y, PointerState* state);
349 void SendPointerPanZoomStart(int32_t device_id,
double x,
double y);
351 void SendPointerPanZoomUpdate(int32_t device_id,
357 void SendPointerPanZoomEnd(int32_t device_id);
360 void SendText(
const std::u16string&);
363 void SendKey(
int key,
379 void SendComposeBegin();
386 void SendComposeCommit();
392 void SendComposeEnd();
398 void SendComposeChange(
const std::u16string&
text,
int cursor_pos);
401 void SendScroll(
double x,
405 int scroll_offset_multiplier,
410 void SendScrollInertiaCancel(int32_t device_id,
double x,
double y);
419 const PointerState* state)
const;
425 PointerState* state);
429 bool NeedsVsync()
const;
435 bool IsSizedToContent()
const;
438 BoxConstraints GetConstraints()
const;
444 FlutterWindowsEngine* engine_ =
nullptr;
447 std::shared_ptr<WindowsProcTable> windows_proc_table_;
453 std::unique_ptr<egl::WindowSurface> surface_ =
nullptr;
456 std::unordered_map<int32_t, std::unique_ptr<PointerState>> pointer_states_;
459 std::unique_ptr<WindowBindingHandler> binding_handler_;
462 std::mutex resize_mutex_;
466 ResizeState resize_status_ = ResizeState::kDone;
470 size_t resize_target_width_ = 0;
474 size_t resize_target_height_ = 0;
477 bool semantics_enabled_ =
false;
480 std::shared_ptr<AccessibilityBridgeWindows> accessibility_bridge_;
484 bool is_sized_to_content_ =
false;
487 BoxConstraints box_constraints_;
490 FlutterWindowsViewSizingDelegate* sizing_delegate_ =
nullptr;
virtual void OnFramePresented()
virtual void OnPointerPanZoomStart(int32_t device_id) override
void CreateRenderSurface()
void OnPointerUp(double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id, FlutterPointerMouseButtons button) override
virtual void UpdateSemanticsEnabled(bool enabled)
virtual ui::AXFragmentRootDelegateWin * GetAxFragmentRootDelegate() override
void OnPointerMove(double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id, int modifiers_state) override
bool IsImplicitView() const
void OnScrollInertiaCancel(int32_t device_id) override
virtual std::shared_ptr< AccessibilityBridgeWindows > CreateAccessibilityBridge()
void OnComposeBegin() override
ui::AXPlatformNodeWin * AlertNode() const
virtual void OnResetImeComposing()
virtual void OnUpdateSemanticsEnabled(bool enabled) override
void OnPointerLeave(double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id=0) override
virtual void NotifyWinEventWrapper(ui::AXPlatformNodeWin *node, ax::mojom::Event event)
FlutterWindowsEngine * GetEngine() const
void OnScroll(double x, double y, double delta_x, double delta_y, int scroll_offset_multiplier, FlutterPointerDeviceKind device_kind, int32_t device_id) override
void OnWindowStateEvent(HWND hwnd, WindowStateEvent event) override
virtual void OnPointerPanZoomEnd(int32_t device_id) override
FlutterWindowMetricsEvent CreateWindowMetricsEvent() const
FlutterViewId view_id() const
virtual void AnnounceAlert(const std::wstring &text)
std::weak_ptr< AccessibilityBridgeWindows > accessibility_bridge()
virtual bool PresentSoftwareBitmap(const void *allocation, size_t row_bytes, size_t height)
void OnFocus(FlutterViewFocusState focus_state, FlutterViewFocusDirection direction) override
virtual HWND GetWindowHandle() const
egl::WindowSurface * surface() const
bool OnWindowSizeChanged(size_t width, size_t height) override
void OnText(const std::u16string &) override
void OnWindowRepaint() override
virtual void OnPointerPanZoomUpdate(int32_t device_id, double pan_x, double pan_y, double scale, double rotation) override
void OnComposeChange(const std::u16string &text, int cursor_pos) override
void OnDwmCompositionChanged()
void OnComposeCommit() override
virtual bool ClearSoftwareBitmap()
void OnPointerDown(double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id, FlutterPointerMouseButtons button) override
virtual gfx::NativeViewAccessible GetNativeViewAccessible() override
virtual ~FlutterWindowsView()
void OnHighContrastChanged() override
virtual void OnCursorRectUpdated(const Rect &rect)
void OnKey(int key, int scancode, int action, char32_t character, bool extended, bool was_down, KeyEventCallback callback) override
void OnComposeEnd() override
bool OnEmptyFrameGenerated()
bool OnFrameGenerated(size_t width, size_t height)
virtual WindowRect GetWorkArea() const =0
virtual void DidUpdateViewSize(int32_t width, int32_t height)=0
std::function< void(bool)> KeyEventCallback
FlutterViewFocusState
Represents the focus state of a given [FlutterView].
FlutterViewFocusDirection
FlutterPointerMouseButtons
FlutterPointerDeviceKind
The device type that created a pointer event.
@ kFlutterPointerDeviceKindMouse
FlutterDesktopBinaryReply callback
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
WindowStateEvent
An event representing a change in window state that may update the.
UnimplementedNativeViewAccessible * NativeViewAccessible