| Flutter Windows Embedder |

Classes | Public Member Functions | Protected Member Functions | Friends | List of all members
flutter::FlutterWindowsView Class Reference

`#include <flutter_windows_view.h>`

Inheritance diagram for flutter::FlutterWindowsView:

## Public Member Functions
| FlutterWindowsView (FlutterViewId view_id, FlutterWindowsEngine *engine, std::unique_ptr< WindowBindingHandler > window_binding, bool is_sized_to_content, const BoxConstraints &box_constraints, FlutterWindowsViewSizingDelegate *sizing_delegate=nullptr, std::shared_ptr< WindowsProcTable > windows_proc_table=nullptr)
virtual | ~FlutterWindowsView ()
FlutterViewId | view_id () const
bool | IsImplicitView () const
void | CreateRenderSurface ()
egl::WindowSurface * | surface () const
virtual HWND | GetWindowHandle () const
FlutterWindowsEngine * | GetEngine () const
void | ForceRedraw ()
virtual bool | ClearSoftwareBitmap ()
virtual bool | PresentSoftwareBitmap (const void *allocation, size_t row_bytes, size_t height)
FlutterWindowMetricsEvent | CreateWindowMetricsEvent () const
void | SendInitialBounds ()
virtual void | AnnounceAlert (const std::wstring &text)
void | OnHighContrastChanged () override
bool | OnEmptyFrameGenerated ()
bool | OnFrameGenerated (size_t width, size_t height)
virtual void | OnFramePresented ()
bool | OnWindowSizeChanged (size_t width, size_t height) override
void | OnWindowRepaint () override
void | OnPointerMove (double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id, int modifiers_state) override
void | OnPointerDown (double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id, FlutterPointerMouseButtons button) override
void | OnPointerUp (double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id, FlutterPointerMouseButtons button) override
void | OnPointerLeave (double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id=0) override
virtual void | OnPointerPanZoomStart (int32_t device_id) override
virtual void | OnPointerPanZoomUpdate (int32_t device_id, double pan_x, double pan_y, double scale, double rotation) override
virtual void | OnPointerPanZoomEnd (int32_t device_id) override
void | OnText (const std::u16string &) override
void | OnKey (int key, int scancode, int action, char32_t character, bool extended, bool was_down, KeyEventCallback callback) override
void | OnFocus (FlutterViewFocusState focus_state, FlutterViewFocusDirection direction) override
void | OnComposeBegin () override
void | OnComposeCommit () override
void | OnComposeEnd () override
void | OnComposeChange (const std::u16string &text, int cursor_pos) override
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 | OnScrollInertiaCancel (int32_t device_id) override
virtual void | OnUpdateSemanticsEnabled (bool enabled) override
virtual gfx::NativeViewAccessible | GetNativeViewAccessible () override
virtual void | OnCursorRectUpdated (const Rect &rect)
virtual void | OnResetImeComposing ()
void | OnDwmCompositionChanged ()
ui::AXPlatformNodeWin * | AlertNode () const
virtual ui::AXFragmentRootDelegateWin * | GetAxFragmentRootDelegate () override
virtual void | UpdateSemanticsEnabled (bool enabled)
std::weak_ptr< AccessibilityBridgeWindows > | accessibility_bridge ()
void | OnWindowStateEvent (HWND hwnd, WindowStateEvent event) override
virtual bool | Focus ()

## Protected Member Functions
virtual void | NotifyWinEventWrapper (ui::AXPlatformNodeWin *node, ax::mojom::Event event)
virtual std::shared_ptr< AccessibilityBridgeWindows > | CreateAccessibilityBridge ()

## Friends
class | ViewModifier

## Additional Inherited Members
Public Types inherited from flutter::WindowBindingHandlerDelegate
using | KeyEventCallback = std::function< void(bool)>

## Detailed Description

Definition at line 46 of file flutter_windows_view.h.

## Constructor & Destructor Documentation

## ◆ FlutterWindowsView()

flutter::FlutterWindowsView::FlutterWindowsView | ( | FlutterViewId | view_id,
|  | FlutterWindowsEngine * | engine,
|  | std::unique_ptr< WindowBindingHandler > | window_binding,
|  | bool | is_sized_to_content,
|  | const BoxConstraints & | box_constraints,
|  | FlutterWindowsViewSizingDelegate * | sizing_delegate = `nullptr`,
|  | std::shared_ptr< WindowsProcTable > | windows_proc_table = `nullptr`
| ) |  |

Definition at line 104 of file flutter_windows_view.cc.

112 : view_id_(view_id),
113 engine_(engine),
114 is_sized_to_content_(is_sized_to_content),
115 box_constraints_(box_constraints),
116 sizing_delegate_(sizing_delegate),
117 windows_proc_table_(std::move(windows_proc_table)) {
118 if (windows_proc_table_ == nullptr) {
119 windows_proc_table_ = std::make_shared<WindowsProcTable>();
120 }
121
122 // Take the binding handler, and give it a pointer back to self.
123 binding_handler_ = std::move(window_binding);
124 binding_handler_->SetView(this);
125 }
flutter::FlutterWindowsView::view_id
FlutterViewId view_id() const
Definition: flutter_windows_view.cc:753

## ◆ ~FlutterWindowsView()

flutter::FlutterWindowsView::~FlutterWindowsView | ( |  | ) |
| virtual

Definition at line 127 of file flutter_windows_view.cc.

127 {
128 // The view owns the child window.
129 // Notify the engine the view's child window will no longer be visible.
130 engine_->OnWindowStateEvent(GetWindowHandle(), WindowStateEvent::kHide);
131
132 if (surface_) {
133 DestroyWindowSurface(*engine_, std::move(surface_));
134 }
135 }
flutter::FlutterWindowsEngine::OnWindowStateEvent
void OnWindowStateEvent(HWND hwnd, WindowStateEvent event)
Definition: flutter_windows_engine.cc:1069
flutter::FlutterWindowsView::GetWindowHandle
virtual HWND GetWindowHandle() const
Definition: flutter_windows_view.cc:822
flutter::WindowStateEvent::kHide
@ kHide

References GetWindowHandle(), flutter::kHide, and flutter::FlutterWindowsEngine::OnWindowStateEvent().

## Member Function Documentation

## ◆ accessibility_bridge()

std::weak_ptr<AccessibilityBridgeWindows> flutter::FlutterWindowsView::accessibility_bridge | ( |  | ) |
| inline

Definition at line 254 of file flutter_windows_view.h.

254 {
255 return accessibility_bridge_;
256 }

Referenced by flutter::FlutterWindowsEngine::Run().

## ◆ AlertNode()

ui::AXPlatformNodeWin * flutter::FlutterWindowsView::AlertNode | ( |  | ) | const

Definition at line 851 of file flutter_windows_view.cc.

851 {
852 return binding_handler_->GetAlert();
853 }

## ◆ AnnounceAlert()

void flutter::FlutterWindowsView::AnnounceAlert | ( | const std::wstring & | text | ) |
| virtual

Definition at line 830 of file flutter_windows_view.cc.

830 {
831 auto alert_delegate = binding_handler_->GetAlertDelegate();
832 if (!alert_delegate) {
833 return;
834 }
835 alert_delegate->SetText(fml::WideStringToUtf16(text));
836 ui::AXPlatformNodeWin* alert_node = binding_handler_->GetAlert();
837 NotifyWinEventWrapper(alert_node, ax::mojom::Event::kAlert);
838 }
flutter::FlutterWindowsView::NotifyWinEventWrapper
virtual void NotifyWinEventWrapper(ui::AXPlatformNodeWin *node, ax::mojom::Event event)
Definition: flutter_windows_view.cc:840
text
std::u16string text
Definition: keyboard_unittests.cc:332

References NotifyWinEventWrapper(), and text.

## ◆ ClearSoftwareBitmap()

bool flutter::FlutterWindowsView::ClearSoftwareBitmap | ( |  | ) |
| virtual

Definition at line 742 of file flutter_windows_view.cc.

742 {
743 return binding_handler_->OnBitmapSurfaceCleared();
744 }

Referenced by flutter::CompositorSoftware::Present().

## ◆ CreateAccessibilityBridge()

std::shared_ptr< AccessibilityBridgeWindows > flutter::FlutterWindowsView::CreateAccessibilityBridge | ( |  | ) |
| protected virtual

Definition at line 856 of file flutter_windows_view.cc.

856 {
857 return std::make_shared<AccessibilityBridgeWindows>(this);
858 }

Referenced by UpdateSemanticsEnabled().

## ◆ CreateRenderSurface()

void flutter::FlutterWindowsView::CreateRenderSurface | ( |  | ) |

Definition at line 761 of file flutter_windows_view.cc.

761 {
762 FML_DCHECK(surface_ == nullptr);
763
764 if (engine_->egl_manager()) {
765 PhysicalWindowBounds bounds = binding_handler_->GetPhysicalWindowBounds();
766 surface_ = engine_->egl_manager()->CreateWindowSurface(
767 GetWindowHandle(), bounds.width, bounds.height);
768
769 UpdateVsync(*engine_, surface_.get(), NeedsVsync());
770
771 resize_target_width_ = bounds.width;
772 resize_target_height_ = bounds.height;
773 }
774 }
flutter::FlutterWindowsEngine::egl_manager
egl::Manager * egl_manager() const
Definition: flutter_windows_engine.h:183
flutter::egl::Manager::CreateWindowSurface
virtual std::unique_ptr< WindowSurface > CreateWindowSurface(HWND hwnd, size_t width, size_t height)
Definition: manager.cc:283

References flutter::egl::Manager::CreateWindowSurface(), flutter::FlutterWindowsEngine::egl_manager(), GetWindowHandle(), flutter::PhysicalWindowBounds::height, and flutter::PhysicalWindowBounds::width.

## ◆ CreateWindowMetricsEvent()

FlutterWindowMetricsEvent flutter::FlutterWindowsView::CreateWindowMetricsEvent | ( |  | ) | const

Definition at line 413 of file flutter_windows_view.cc.

413 {
414 PhysicalWindowBounds bounds = binding_handler_->GetPhysicalWindowBounds();
415 double pixel_ratio = binding_handler_->GetDpiScale();
416 FlutterEngineDisplayId display_id = binding_handler_->GetDisplayId();
417
418 FlutterWindowMetricsEvent event = {};
419 event.struct_size = sizeof(event);
420 event.width = bounds.width;
421 event.height = bounds.height;
422 auto constraints = GetConstraints();
423 event.has_constraints = true;
424 event.min_width_constraint =
425 static_cast<size_t>(constraints.smallest().width());
426 event.min_height_constraint =
427 static_cast<size_t>(constraints.smallest().height());
428 event.max_width_constraint =
429 static_cast<size_t>(constraints.biggest().width());
430 event.max_height_constraint =
431 static_cast<size_t>(constraints.biggest().height());
432 event.pixel_ratio = pixel_ratio;
433 event.display_id = display_id;
434 event.view_id = view_id_;
435
436 return event;
437 }

References flutter::PhysicalWindowBounds::height, and flutter::PhysicalWindowBounds::width.

Referenced by SendInitialBounds().

## ◆ Focus()

bool flutter::FlutterWindowsView::Focus | ( |  | ) |
| virtual

Definition at line 880 of file flutter_windows_view.cc.

880 {
881 return binding_handler_->Focus();
882 }

Referenced by flutter::FlutterWindowsEngine::OnViewFocusChangeRequest().

## ◆ ForceRedraw()

void flutter::FlutterWindowsView::ForceRedraw | ( |  | ) |

Definition at line 194 of file flutter_windows_view.cc.

194 {
195 if (resize_status_ == ResizeState::kDone) {
196 // Request new frame.
197 engine_->ScheduleFrame();
198 }
199 }
flutter::FlutterWindowsEngine::ScheduleFrame
void ScheduleFrame()
Definition: flutter_windows_engine.cc:810

References flutter::FlutterWindowsEngine::ScheduleFrame().

Referenced by OnWindowRepaint().

## ◆ GetAxFragmentRootDelegate()

ui::AXFragmentRootDelegateWin * flutter::FlutterWindowsView::GetAxFragmentRootDelegate | ( |  | ) |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 847 of file flutter_windows_view.cc.

847 {
848 return accessibility_bridge_.get();
849 }

## ◆ GetEngine()

FlutterWindowsEngine * flutter::FlutterWindowsView::GetEngine | ( |  | ) | const

Definition at line 826 of file flutter_windows_view.cc.

826 {
827 return engine_;
828 }

Referenced by flutter::AccessibilityBridgeWindows::DispatchAccessibilityAction(), and FlutterDesktopViewGetGraphicsAdapter().

## ◆ GetNativeViewAccessible()

gfx::NativeViewAccessible flutter::FlutterWindowsView::GetNativeViewAccessible | ( |  | ) |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 372 of file flutter_windows_view.cc.

372 {
373 if (!accessibility_bridge_) {
374 return nullptr;
375 }
376
377 return accessibility_bridge_->GetChildOfAXFragmentRoot();
378 }

## ◆ GetWindowHandle()

HWND flutter::FlutterWindowsView::GetWindowHandle | ( |  | ) | const
| virtual

Definition at line 822 of file flutter_windows_view.cc.

822 {
823 return binding_handler_->GetWindowHandle();
824 }

Referenced by CreateRenderSurface(), FlutterDesktopViewGetHWND(), flutter::FlutterPlatformNodeDelegateWindows::GetBoundsRect(), flutter::FlutterPlatformNodeDelegateWindows::GetTargetForNativeAccessibilityEvent(), InternalFlutterWindows_WindowManager_GetTopLevelWindowHandle(), and ~FlutterWindowsView().

## ◆ IsImplicitView()

bool flutter::FlutterWindowsView::IsImplicitView | ( |  | ) | const

Definition at line 757 of file flutter_windows_view.cc.

757 {
758 return view_id_ == kImplicitViewId;
759 }
flutter::kImplicitViewId
constexpr FlutterViewId kImplicitViewId
Definition: flutter_windows_engine.h:56

References flutter::kImplicitViewId.

Referenced by SendInitialBounds().

## ◆ NotifyWinEventWrapper()

void flutter::FlutterWindowsView::NotifyWinEventWrapper | ( | ui::AXPlatformNodeWin * | node,
|  | ax::mojom::Event | event
| ) |  |
| protected virtual

Definition at line 840 of file flutter_windows_view.cc.

841 {
842 if (node) {
843 node->NotifyAccessibilityEvent(event);
844 }
845 }

Referenced by AnnounceAlert().

## ◆ OnComposeBegin()

void flutter::FlutterWindowsView::OnComposeBegin | ( |  | ) |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 335 of file flutter_windows_view.cc.

335 {
336 SendComposeBegin();
337 }

## ◆ OnComposeChange()

void flutter::FlutterWindowsView::OnComposeChange | ( | const std::u16string & | text,
|  | int | cursor_pos
| ) |  |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 347 of file flutter_windows_view.cc.

348 {
349 SendComposeChange(text, cursor_pos);
350 }

References text.

## ◆ OnComposeCommit()

void flutter::FlutterWindowsView::OnComposeCommit | ( |  | ) |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 339 of file flutter_windows_view.cc.

339 {
340 SendComposeCommit();
341 }

## ◆ OnComposeEnd()

void flutter::FlutterWindowsView::OnComposeEnd | ( |  | ) |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 343 of file flutter_windows_view.cc.

343 {
344 SendComposeEnd();
345 }

## ◆ OnCursorRectUpdated()

void flutter::FlutterWindowsView::OnCursorRectUpdated | ( | const Rect & | rect | ) |
| virtual

Definition at line 380 of file flutter_windows_view.cc.

380 {
381 binding_handler_->OnCursorRectUpdated(rect);
382 }

## ◆ OnDwmCompositionChanged()

void flutter::FlutterWindowsView::OnDwmCompositionChanged | ( |  | ) |

Definition at line 872 of file flutter_windows_view.cc.

872 {
873 UpdateVsync(*engine_, surface_.get(), NeedsVsync());
874 }

## ◆ OnEmptyFrameGenerated()

bool flutter::FlutterWindowsView::OnEmptyFrameGenerated | ( |  | ) |

Definition at line 137 of file flutter_windows_view.cc.

137 {
138 // Called on the raster thread.
139 std::unique_lock<std::mutex> lock(resize_mutex_);
140
141 if (surface_ == nullptr || !surface_->IsValid()) {
142 return false;
143 }
144
145 if (resize_status_ != ResizeState::kResizeStarted) {
146 return true;
147 }
148
149 if (!ResizeRenderSurface(resize_target_height_, resize_target_width_)) {
150 return false;
151 }
152
153 // Platform thread is blocked for the entire duration until the
154 // resize_status_ is set to kDone by |OnFramePresented|.
155 resize_status_ = ResizeState::kFrameGenerated;
156 return true;
157 }

## ◆ OnFocus()

void flutter::FlutterWindowsView::OnFocus | ( | FlutterViewFocusState | focus_state,
|  | FlutterViewFocusDirection | direction
| ) |  |
| override virtual

Notifies the delegate that the backing window has received or lost focus.

Typically called by currently configured WindowBindingHandler.

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 330 of file flutter_windows_view.cc.

331 {
332 SendFocus(focus_state, direction);
333 }

## ◆ OnFrameGenerated()

bool flutter::FlutterWindowsView::OnFrameGenerated | ( | size_t | width,
|  | size_t | height
| ) |  |

Definition at line 159 of file flutter_windows_view.cc.

159 {
160 // Called on the raster thread.
161 std::unique_lock<std::mutex> lock(resize_mutex_);
162
163 if (IsSizedToContent()) {
164 if (!ResizeRenderSurface(width, height)) {
165 return false;
166 }
167
168 sizing_delegate_->DidUpdateViewSize(width, height);
169 return true;
170 }
171
172 if (surface_ == nullptr || !surface_->IsValid()) {
173 return false;
174 }
175
176 if (resize_status_ != ResizeState::kResizeStarted) {
177 return true;
178 }
179
180 if (resize_target_width_ != width || resize_target_height_ != height) {
181 return false;
182 }
183
184 if (!ResizeRenderSurface(resize_target_width_, resize_target_height_)) {
185 return false;
186 }
187
188 // Platform thread is blocked for the entire duration until the
189 // resize_status_ is set to kDone by |OnFramePresented|.
190 resize_status_ = ResizeState::kFrameGenerated;
191 return true;
192 }
flutter::FlutterWindowsViewSizingDelegate::DidUpdateViewSize
virtual void DidUpdateViewSize(int32_t width, int32_t height)=0

References flutter::FlutterWindowsViewSizingDelegate::DidUpdateViewSize().

Referenced by flutter::CompositorOpenGL::Present(), and flutter::testing::TEST_F().

## ◆ OnFramePresented()

void flutter::FlutterWindowsView::OnFramePresented | ( |  | ) |
| virtual

Definition at line 709 of file flutter_windows_view.cc.

709 {
710 // Called on the engine's raster thread.
711 std::unique_lock<std::mutex> lock(resize_mutex_);
712
713 switch (resize_status_) {
714 case ResizeState::kResizeStarted:
715 // The caller must first call |OnFrameGenerated| or
716 // |OnEmptyFrameGenerated| before calling this method. This
717 // indicates one of the following:
718 //
719 // 1. The caller did not call these methods.
720 // 2. The caller ignored these methods' result.
721 // 3. The platform thread started a resize after the caller called these
722 // methods. We might have presented a frame of the wrong size to the
723 // view.
724 return;
725 case ResizeState::kFrameGenerated: {
726 // A frame was generated for a pending resize.
727 resize_status_ = ResizeState::kDone;
728 // Unblock the platform thread.
729 engine_->task_runner()->PostTask([this] {});
730
731 lock.unlock();
732
733 // Blocking the raster thread until DWM flushes alleviates glitches where
734 // previous size surface is stretched over current size view.
735 windows_proc_table_->DwmFlush();
736 }
737 case ResizeState::kDone:
738 return;
739 }
740 }
flutter::FlutterWindowsEngine::task_runner
TaskRunner * task_runner()
Definition: flutter_windows_engine.h:173
flutter::TaskRunner::PostTask
void PostTask(TaskClosure task)
Definition: task_runner.cc:88

References flutter::TaskRunner::PostTask(), and flutter::FlutterWindowsEngine::task_runner().

Referenced by flutter::CompositorOpenGL::Present().

## ◆ OnHighContrastChanged()

void flutter::FlutterWindowsView::OnHighContrastChanged | ( |  | ) |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 818 of file flutter_windows_view.cc.

818 {
819 engine_->UpdateHighContrastMode();
820 }
flutter::FlutterWindowsEngine::UpdateHighContrastMode
void UpdateHighContrastMode()
Definition: flutter_windows_engine.cc:1025

References flutter::FlutterWindowsEngine::UpdateHighContrastMode().

## ◆ OnKey()

void flutter::FlutterWindowsView::OnKey | ( | int | key,
|  | int | scancode,
|  | int | action,
|  | char32_t | character,
|  | bool | extended,
|  | bool | was_down,
|  | KeyEventCallback | callback
| ) |  |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 320 of file flutter_windows_view.cc.

326 {
327 SendKey(key, scancode, action, character, extended, was_down, callback);
328 }
callback
FlutterDesktopBinaryReply callback
Definition: flutter_windows_view_unittests.cc:52
extended
bool extended
Definition: keyboard_key_handler_unittests.cc:118
key
int key
Definition: keyboard_key_handler_unittests.cc:114
character
char32_t character
Definition: keyboard_key_handler_unittests.cc:117
action
int action
Definition: keyboard_key_handler_unittests.cc:116
scancode
int scancode
Definition: keyboard_key_handler_unittests.cc:115
was_down
bool was_down
Definition: keyboard_key_handler_unittests.cc:119

References action, callback, character, extended, key, scancode, and was_down.

## ◆ OnPointerDown()

void flutter::FlutterWindowsView::OnPointerDown | ( | double | x,
|  | double | y,
|  | FlutterPointerDeviceKind | device_kind,
|  | int32_t | device_id,
|  | FlutterPointerMouseButtons | button
| ) |  |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 266 of file flutter_windows_view.cc.

271 {
272 if (flutter_button != 0) {
273 auto state = GetOrCreatePointerState(device_kind, device_id);
274 state->buttons |= flutter_button;
275 SendPointerDown(x, y, state);
276 }
277 }

## ◆ OnPointerLeave()

void flutter::FlutterWindowsView::OnPointerLeave | ( | double | x,
|  | double | y,
|  | FlutterPointerDeviceKind | device_kind,
|  | int32_t | device_id = `0`
| ) |  |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 292 of file flutter_windows_view.cc.

295 {
296 SendPointerLeave(x, y, GetOrCreatePointerState(device_kind, device_id));
297 }

## ◆ OnPointerMove()

void flutter::FlutterWindowsView::OnPointerMove | ( | double | x,
|  | double | y,
|  | FlutterPointerDeviceKind | device_kind,
|  | int32_t | device_id,
|  | int | modifiers_state
| ) |  |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 257 of file flutter_windows_view.cc.

261 {
262 engine_->keyboard_key_handler()->SyncModifiersIfNeeded(modifiers_state);
263 SendPointerMove(x, y, GetOrCreatePointerState(device_kind, device_id));
264 }
flutter::FlutterWindowsEngine::keyboard_key_handler
KeyboardHandlerBase * keyboard_key_handler()
Definition: flutter_windows_engine.h:203
flutter::KeyboardHandlerBase::SyncModifiersIfNeeded
virtual void SyncModifiersIfNeeded(int modifiers_state)=0

References flutter::FlutterWindowsEngine::keyboard_key_handler(), and flutter::KeyboardHandlerBase::SyncModifiersIfNeeded().

## ◆ OnPointerPanZoomEnd()

void flutter::FlutterWindowsView::OnPointerPanZoomEnd | ( | int32_t | device_id | ) |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 312 of file flutter_windows_view.cc.

312 {
313 SendPointerPanZoomEnd(device_id);
314 }

## ◆ OnPointerPanZoomStart()

void flutter::FlutterWindowsView::OnPointerPanZoomStart | ( | int32_t | device_id | ) |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 299 of file flutter_windows_view.cc.

299 {
300 PointerLocation point = binding_handler_->GetPrimaryPointerLocation();
301 SendPointerPanZoomStart(device_id, point.x, point.y);
302 }

References flutter::PointerLocation::x, and flutter::PointerLocation::y.

## ◆ OnPointerPanZoomUpdate()

void flutter::FlutterWindowsView::OnPointerPanZoomUpdate | ( | int32_t | device_id,
|  | double | pan_x,
|  | double | pan_y,
|  | double | scale,
|  | double | rotation
| ) |  |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 304 of file flutter_windows_view.cc.

308 {
309 SendPointerPanZoomUpdate(device_id, pan_x, pan_y, scale, rotation);
310 }

## ◆ OnPointerUp()

void flutter::FlutterWindowsView::OnPointerUp | ( | double | x,
|  | double | y,
|  | FlutterPointerDeviceKind | device_kind,
|  | int32_t | device_id,
|  | FlutterPointerMouseButtons | button
| ) |  |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 279 of file flutter_windows_view.cc.

284 {
285 if (flutter_button != 0) {
286 auto state = GetOrCreatePointerState(device_kind, device_id);
287 state->buttons &= ~flutter_button;
288 SendPointerUp(x, y, state);
289 }
290 }

## ◆ OnResetImeComposing()

void flutter::FlutterWindowsView::OnResetImeComposing | ( |  | ) |
| virtual

Definition at line 384 of file flutter_windows_view.cc.

384 {
385 binding_handler_->OnResetImeComposing();
386 }

## ◆ OnScroll()

void flutter::FlutterWindowsView::OnScroll | ( | double | x,
|  | double | y,
|  | double | delta_x,
|  | double | delta_y,
|  | int | scroll_offset_multiplier,
|  | FlutterPointerDeviceKind | device_kind,
|  | int32_t | device_id
| ) |  |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 352 of file flutter_windows_view.cc.

358 {
359 SendScroll(x, y, delta_x, delta_y, scroll_offset_multiplier, device_kind,
360 device_id);
361 }

## ◆ OnScrollInertiaCancel()

void flutter::FlutterWindowsView::OnScrollInertiaCancel | ( | int32_t | device_id | ) |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 363 of file flutter_windows_view.cc.

363 {
364 PointerLocation point = binding_handler_->GetPrimaryPointerLocation();
365 SendScrollInertiaCancel(device_id, point.x, point.y);
366 }

References flutter::PointerLocation::x, and flutter::PointerLocation::y.

## ◆ OnText()

void flutter::FlutterWindowsView::OnText | ( | const std::u16string & | text | ) |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 316 of file flutter_windows_view.cc.

316 {
317 SendText(text);
318 }

References text.

## ◆ OnUpdateSemanticsEnabled()

void flutter::FlutterWindowsView::OnUpdateSemanticsEnabled | ( | bool | enabled | ) |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 368 of file flutter_windows_view.cc.

368 {
369 engine_->UpdateSemanticsEnabled(enabled);
370 }
flutter::FlutterWindowsEngine::UpdateSemanticsEnabled
void UpdateSemanticsEnabled(bool enabled)
Definition: flutter_windows_engine.cc:990

References flutter::FlutterWindowsEngine::UpdateSemanticsEnabled().

## ◆ OnWindowRepaint()

void flutter::FlutterWindowsView::OnWindowRepaint | ( |  | ) |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 253 of file flutter_windows_view.cc.

253 {
254 ForceRedraw();
255 }
flutter::FlutterWindowsView::ForceRedraw
void ForceRedraw()
Definition: flutter_windows_view.cc:194

References ForceRedraw().

## ◆ OnWindowSizeChanged()

bool flutter::FlutterWindowsView::OnWindowSizeChanged | ( | size_t | width,
|  | size_t | height
| ) |  |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 202 of file flutter_windows_view.cc.

202 {
203 if (IsSizedToContent()) {
204 // No resize synchronization needed for views sized to content.
205 return true;
206 }
207
208 if (!engine_->egl_manager()) {
209 SendWindowMetrics(width, height, binding_handler_->GetDpiScale());
210 return true;
211 }
212
213 if (!surface_ || !surface_->IsValid()) {
214 SendWindowMetrics(width, height, binding_handler_->GetDpiScale());
215 return true;
216 }
217
218 // We're using OpenGL rendering. Resizing the surface must happen on the
219 // raster thread.
220 bool surface_will_update =
221 SurfaceWillUpdate(surface_->width(), surface_->height(), width, height);
222 if (!surface_will_update) {
223 SendWindowMetrics(width, height, binding_handler_->GetDpiScale());
224 return true;
225 }
226
227 {
228 std::unique_lock<std::mutex> lock(resize_mutex_);
229 resize_status_ = ResizeState::kResizeStarted;
230 resize_target_width_ = width;
231 resize_target_height_ = height;
232 }
233
234 SendWindowMetrics(width, height, binding_handler_->GetDpiScale());
235
236 std::chrono::time_point<std::chrono::steady_clock> start_time =
237 std::chrono::steady_clock::now();
238
239 while (true) {
240 if (std::chrono::steady_clock::now() > start_time + kWindowResizeTimeout) {
241 return false;
242 }
243 std::unique_lock<std::mutex> lock(resize_mutex_);
244 if (resize_status_ == ResizeState::kDone) {
245 break;
246 }
247 lock.unlock();
248 engine_->task_runner()->PollOnce(kWindowResizeTimeout);
249 }
250 return true;
251 }
flutter::TaskRunner::PollOnce
void PollOnce(std::chrono::milliseconds timeout)
Definition: task_runner.cc:95

References flutter::FlutterWindowsEngine::egl_manager(), flutter::TaskRunner::PollOnce(), and flutter::FlutterWindowsEngine::task_runner().

## ◆ OnWindowStateEvent()

void flutter::FlutterWindowsView::OnWindowStateEvent | ( | HWND | hwnd,
|  | WindowStateEvent | event
| ) |  |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 876 of file flutter_windows_view.cc.

876 {
877 engine_->OnWindowStateEvent(hwnd, event);
878 }

References flutter::FlutterWindowsEngine::OnWindowStateEvent().

## ◆ PresentSoftwareBitmap()

bool flutter::FlutterWindowsView::PresentSoftwareBitmap | ( | const void * | allocation,
|  | size_t | row_bytes,
|  | size_t | height
| ) |  |
| virtual

Definition at line 746 of file flutter_windows_view.cc.

748 {
749 return binding_handler_->OnBitmapSurfaceUpdated(allocation, row_bytes,
750 height);
751 }

Referenced by flutter::CompositorSoftware::Present().

## ◆ SendInitialBounds()

void flutter::FlutterWindowsView::SendInitialBounds | ( |  | ) |

Definition at line 439 of file flutter_windows_view.cc.

439 {
440 // Non-implicit views' initial window metrics are sent when the view is added
441 // to the engine.
442 if (!IsImplicitView()) {
443 return;
444 }
445
446 engine_->SendWindowMetricsEvent(CreateWindowMetricsEvent());
447 }
flutter::FlutterWindowsEngine::SendWindowMetricsEvent
void SendWindowMetricsEvent(const FlutterWindowMetricsEvent &event)
Definition: flutter_windows_engine.cc:723
flutter::FlutterWindowsView::IsImplicitView
bool IsImplicitView() const
Definition: flutter_windows_view.cc:757
flutter::FlutterWindowsView::CreateWindowMetricsEvent
FlutterWindowMetricsEvent CreateWindowMetricsEvent() const
Definition: flutter_windows_view.cc:413

References CreateWindowMetricsEvent(), IsImplicitView(), and flutter::FlutterWindowsEngine::SendWindowMetricsEvent().

## ◆ surface()

egl::WindowSurface * flutter::FlutterWindowsView::surface | ( |  | ) | const

Definition at line 814 of file flutter_windows_view.cc.

814 {
815 return surface_.get();
816 }

Referenced by flutter::CompositorOpenGL::Present().

## ◆ UpdateSemanticsEnabled()

void flutter::FlutterWindowsView::UpdateSemanticsEnabled | ( | bool | enabled | ) |
| virtual

Definition at line 860 of file flutter_windows_view.cc.

860 {
861 if (semantics_enabled_ != enabled) {
862 semantics_enabled_ = enabled;
863
864 if (!semantics_enabled_ && accessibility_bridge_) {
865 accessibility_bridge_.reset();
866 } else if (semantics_enabled_ && !accessibility_bridge_) {
867 accessibility_bridge_ = CreateAccessibilityBridge();
868 }
869 }
870 }
flutter::FlutterWindowsView::CreateAccessibilityBridge
virtual std::shared_ptr< AccessibilityBridgeWindows > CreateAccessibilityBridge()
Definition: flutter_windows_view.cc:856

References CreateAccessibilityBridge().

## ◆ view_id()

FlutterViewId flutter::FlutterWindowsView::view_id | ( |  | ) | const

Definition at line 753 of file flutter_windows_view.cc.

753 {
754 return view_id_;
755 }

Referenced by flutter::AccessibilityBridgeWindows::DispatchAccessibilityAction(), and flutter::WindowManager::HandleMessage().

## Friends And Related Function Documentation

## ◆ ViewModifier

friend class ViewModifier
| friend

Definition at line 275 of file flutter_windows_view.h.

The documentation for this class was generated from the following files:

- shell/platform/windows/flutter_windows_view.h
- shell/platform/windows/flutter_windows_view.cc