| 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, std::shared_ptr< WindowsProcTable > windows_proc_table=nullptr)
virtual | ~FlutterWindowsView ()
FlutterViewId | view_id () const
void | CreateRenderSurface ()
void | DestroyRenderSurface ()
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)
void | SendInitialBounds ()
void | AnnounceAlert (const std::wstring &text)
void | OnHighContrastChanged () override
bool | OnEmptyFrameGenerated ()
bool | OnFrameGenerated (size_t width, size_t height)
virtual void | OnFramePresented ()
void | UpdateFlutterCursor (const std::string &cursor_name)
void | SetFlutterCursor (HCURSOR cursor)
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 | 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

## 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 34 of file flutter_windows_view.h.

## Constructor & Destructor Documentation

## ◆ FlutterWindowsView()

flutter::FlutterWindowsView::FlutterWindowsView | ( | FlutterViewId | view_id,
|  | FlutterWindowsEngine * | engine,
|  | std::unique_ptr< WindowBindingHandler > | window_binding,
|  | std::shared_ptr< WindowsProcTable > | windows_proc_table = `nullptr`
| ) |  |

Definition at line 86 of file flutter_windows_view.cc.

91 : view_id_(view_id),
92 engine_(engine),
93 windows_proc_table_(std::move(windows_proc_table)) {
94 if (windows_proc_table_ == nullptr) {
95 windows_proc_table_ = std::make_shared<WindowsProcTable>();
96 }
97
98 // Take the binding handler, and give it a pointer back to self.
99 binding_handler_ = std::move(window_binding);
100 binding_handler_->SetView(this);
101 }

## ◆ ~FlutterWindowsView()

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

Definition at line 103 of file flutter_windows_view.cc.

103 {
104 // The view owns the child window.
105 // Notify the engine the view's child window will no longer be visible.
106 engine_->OnWindowStateEvent(GetWindowHandle(), WindowStateEvent::kHide);
107
108 // The engine renders into the view's surface. The engine must be
109 // shutdown before the view's resources can be destroyed.
110 engine_->Stop();
111
112 DestroyRenderSurface();
113 }

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

## Member Function Documentation

## ◆ accessibility_bridge()

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

Definition at line 220 of file flutter_windows_view.h.

220 {
221 return accessibility_bridge_;
222 }

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

## ◆ AlertNode()

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

Definition at line 756 of file flutter_windows_view.cc.

756 {
757 return binding_handler_->GetAlert();
758 }

## ◆ AnnounceAlert()

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

Definition at line 735 of file flutter_windows_view.cc.

735 {
736 auto alert_delegate = binding_handler_->GetAlertDelegate();
737 if (!alert_delegate) {
738 return;
739 }
740 alert_delegate->SetText(fml::WideStringToUtf16(text));
741 ui::AXPlatformNodeWin* alert_node = binding_handler_->GetAlert();
742 NotifyWinEventWrapper(alert_node, ax::mojom::Event::kAlert);
743 }

References NotifyWinEventWrapper(), and text.

## ◆ ClearSoftwareBitmap()

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

Definition at line 645 of file flutter_windows_view.cc.

645 {
646 return binding_handler_->OnBitmapSurfaceCleared();
647 }

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

## ◆ CreateAccessibilityBridge()

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

Definition at line 761 of file flutter_windows_view.cc.

761 {
762 return std::make_shared<AccessibilityBridgeWindows>(this);
763 }

Referenced by UpdateSemanticsEnabled().

## ◆ CreateRenderSurface()

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

Definition at line 660 of file flutter_windows_view.cc.

660 {
661 FML_DCHECK(surface_ == nullptr);
662
663 if (engine_->egl_manager()) {
664 PhysicalWindowBounds bounds = binding_handler_->GetPhysicalWindowBounds();
665 surface_ = engine_->egl_manager()->CreateWindowSurface(
666 GetWindowHandle(), bounds.width, bounds.height);
667
668 UpdateVsync(*engine_, surface_.get(), NeedsVsync());
669
670 resize_target_width_ = bounds.width;
671 resize_target_height_ = bounds.height;
672 }
673 }

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

## ◆ DestroyRenderSurface()

void flutter::FlutterWindowsView::DestroyRenderSurface | ( |  | ) |

Definition at line 713 of file flutter_windows_view.cc.

713 {
714 if (surface_) {
715 surface_->Destroy();
716 }
717 }

Referenced by ~FlutterWindowsView().

## ◆ ForceRedraw()

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

Definition at line 171 of file flutter_windows_view.cc.

171 {
172 if (resize_status_ == ResizeState::kDone) {
173 // Request new frame.
174 engine_->ScheduleFrame();
175 }
176 }

References flutter::FlutterWindowsEngine::ScheduleFrame().

Referenced by OnWindowRepaint().

## ◆ GetAxFragmentRootDelegate()

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

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 752 of file flutter_windows_view.cc.

752 {
753 return accessibility_bridge_.get();
754 }

## ◆ GetEngine()

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

Definition at line 731 of file flutter_windows_view.cc.

731 {
732 return engine_;
733 }

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

## ◆ GetNativeViewAccessible()

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

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 330 of file flutter_windows_view.cc.

330 {
331 if (!accessibility_bridge_) {
332 return nullptr;
333 }
334
335 return accessibility_bridge_->GetChildOfAXFragmentRoot();
336 }

## ◆ GetWindowHandle()

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

Definition at line 727 of file flutter_windows_view.cc.

727 {
728 return binding_handler_->GetWindowHandle();
729 }

Referenced by CreateRenderSurface(), FlutterDesktopViewGetHWND(), flutter::FlutterPlatformNodeDelegateWindows::GetBoundsRect(), flutter::PlatformHandler::GetHasStrings(), flutter::PlatformHandler::GetPlainText(), flutter::FlutterPlatformNodeDelegateWindows::GetTargetForNativeAccessibilityEvent(), flutter::PlatformHandler::SetPlainText(), and ~FlutterWindowsView().

## ◆ NotifyWinEventWrapper()

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

Definition at line 745 of file flutter_windows_view.cc.

746 {
747 if (node) {
748 node->NotifyAccessibilityEvent(event);
749 }
750 }

Referenced by AnnounceAlert().

## ◆ OnComposeBegin()

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

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 293 of file flutter_windows_view.cc.

293 {
294 SendComposeBegin();
295 }

## ◆ OnComposeChange()

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

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 305 of file flutter_windows_view.cc.

306 {
307 SendComposeChange(text, cursor_pos);
308 }

References text.

## ◆ OnComposeCommit()

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

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 297 of file flutter_windows_view.cc.

297 {
298 SendComposeCommit();
299 }

## ◆ OnComposeEnd()

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

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 301 of file flutter_windows_view.cc.

301 {
302 SendComposeEnd();
303 }

## ◆ OnCursorRectUpdated()

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

Definition at line 338 of file flutter_windows_view.cc.

338 {
339 binding_handler_->OnCursorRectUpdated(rect);
340 }

## ◆ OnDwmCompositionChanged()

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

Definition at line 777 of file flutter_windows_view.cc.

777 {
778 UpdateVsync(*engine_, surface_.get(), NeedsVsync());
779 }

## ◆ OnEmptyFrameGenerated()

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

Definition at line 115 of file flutter_windows_view.cc.

115 {
116 // Called on the raster thread.
117 std::unique_lock<std::mutex> lock(resize_mutex_);
118
119 if (surface_ == nullptr || !surface_->IsValid()) {
120 return false;
121 }
122
123 if (resize_status_ != ResizeState::kResizeStarted) {
124 return true;
125 }
126
127 if (!ResizeRenderSurface(resize_target_height_, resize_target_width_)) {
128 return false;
129 }
130
131 // Platform thread is blocked for the entire duration until the
132 // resize_status_ is set to kDone by |OnFramePresented|.
133 resize_status_ = ResizeState::kFrameGenerated;
134 return true;
135 }

## ◆ OnFrameGenerated()

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

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 (resize_target_width_ != width || resize_target_height_ != height) {
150 return false;
151 }
152
153 if (!ResizeRenderSurface(resize_target_width_, resize_target_height_)) {
154 return false;
155 }
156
157 // Platform thread is blocked for the entire duration until the
158 // resize_status_ is set to kDone by |OnFramePresented|.
159 resize_status_ = ResizeState::kFrameGenerated;
160 return true;
161 }

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

## ◆ OnFramePresented()

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

Definition at line 613 of file flutter_windows_view.cc.

613 {
614 // Called on the engine's raster thread.
615 std::unique_lock<std::mutex> lock(resize_mutex_);
616
617 switch (resize_status_) {
618 case ResizeState::kResizeStarted:
619 // The caller must first call |OnFrameGenerated| or
620 // |OnEmptyFrameGenerated| before calling this method. This
621 // indicates one of the following:
622 //
623 // 1. The caller did not call these methods.
624 // 2. The caller ignored these methods' result.
625 // 3. The platform thread started a resize after the caller called these
626 // methods. We might have presented a frame of the wrong size to the
627 // view.
628 return;
629 case ResizeState::kFrameGenerated: {
630 // A frame was generated for a pending resize.
631 // Unblock the platform thread.
632 resize_status_ = ResizeState::kDone;
633 lock.unlock();
634 resize_cv_.notify_all();
635
636 // Blocking the raster thread until DWM flushes alleviates glitches where
637 // previous size surface is stretched over current size view.
638 windows_proc_table_->DwmFlush();
639 }
640 case ResizeState::kDone:
641 return;
642 }
643 }

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

## ◆ OnHighContrastChanged()

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

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 723 of file flutter_windows_view.cc.

723 {
724 engine_->UpdateHighContrastMode();
725 }

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 283 of file flutter_windows_view.cc.

289 {
290 SendKey(key, scancode, action, character, extended, was_down, callback);
291 }

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 229 of file flutter_windows_view.cc.

234 {
235 if (flutter_button != 0) {
236 auto state = GetOrCreatePointerState(device_kind, device_id);
237 state->buttons |= flutter_button;
238 SendPointerDown(x, y, state);
239 }
240 }

## ◆ 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 255 of file flutter_windows_view.cc.

258 {
259 SendPointerLeave(x, y, GetOrCreatePointerState(device_kind, device_id));
260 }

## ◆ 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 220 of file flutter_windows_view.cc.

224 {
225 engine_->keyboard_key_handler()->SyncModifiersIfNeeded(modifiers_state);
226 SendPointerMove(x, y, GetOrCreatePointerState(device_kind, device_id));
227 }

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 275 of file flutter_windows_view.cc.

275 {
276 SendPointerPanZoomEnd(device_id);
277 }

## ◆ OnPointerPanZoomStart()

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

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 262 of file flutter_windows_view.cc.

262 {
263 PointerLocation point = binding_handler_->GetPrimaryPointerLocation();
264 SendPointerPanZoomStart(device_id, point.x, point.y);
265 }

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 267 of file flutter_windows_view.cc.

271 {
272 SendPointerPanZoomUpdate(device_id, pan_x, pan_y, scale, rotation);
273 }

## ◆ 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 242 of file flutter_windows_view.cc.

247 {
248 if (flutter_button != 0) {
249 auto state = GetOrCreatePointerState(device_kind, device_id);
250 state->buttons &= ~flutter_button;
251 SendPointerUp(x, y, state);
252 }
253 }

## ◆ OnResetImeComposing()

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

Definition at line 342 of file flutter_windows_view.cc.

342 {
343 binding_handler_->OnResetImeComposing();
344 }

## ◆ 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 310 of file flutter_windows_view.cc.

316 {
317 SendScroll(x, y, delta_x, delta_y, scroll_offset_multiplier, device_kind,
318 device_id);
319 }

## ◆ OnScrollInertiaCancel()

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

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 321 of file flutter_windows_view.cc.

321 {
322 PointerLocation point = binding_handler_->GetPrimaryPointerLocation();
323 SendScrollInertiaCancel(device_id, point.x, point.y);
324 }

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 279 of file flutter_windows_view.cc.

279 {
280 SendText(text);
281 }

References text.

## ◆ OnUpdateSemanticsEnabled()

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

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 326 of file flutter_windows_view.cc.

326 {
327 engine_->UpdateSemanticsEnabled(enabled);
328 }

References flutter::FlutterWindowsEngine::UpdateSemanticsEnabled().

## ◆ OnWindowRepaint()

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

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 216 of file flutter_windows_view.cc.

216 {
217 ForceRedraw();
218 }

References ForceRedraw().

## ◆ OnWindowSizeChanged()

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

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 178 of file flutter_windows_view.cc.

178 {
179 // Called on the platform thread.
180 std::unique_lock<std::mutex> lock(resize_mutex_);
181
182 if (!engine_->egl_manager()) {
183 SendWindowMetrics(width, height, binding_handler_->GetDpiScale());
184 return true;
185 }
186
187 if (!surface_ || !surface_->IsValid()) {
188 SendWindowMetrics(width, height, binding_handler_->GetDpiScale());
189 return true;
190 }
191
192 // We're using OpenGL rendering. Resizing the surface must happen on the
193 // raster thread.
194 bool surface_will_update =
195 SurfaceWillUpdate(surface_->width(), surface_->height(), width, height);
196 if (!surface_will_update) {
197 SendWindowMetrics(width, height, binding_handler_->GetDpiScale());
198 return true;
199 }
200
201 resize_status_ = ResizeState::kResizeStarted;
202 resize_target_width_ = width;
203 resize_target_height_ = height;
204
205 SendWindowMetrics(width, height, binding_handler_->GetDpiScale());
206
207 // Block the platform thread until a frame is presented with the target
208 // size. See |OnFrameGenerated|, |OnEmptyFrameGenerated|, and
209 // |OnFramePresented|.
210 return resize_cv_.wait_for(lock, kWindowResizeTimeout,
211 [&resize_status = resize_status_] {
212 return resize_status == ResizeState::kDone;
213 });
214 }

References flutter::FlutterWindowsEngine::egl_manager().

## ◆ OnWindowStateEvent()

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

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 781 of file flutter_windows_view.cc.

781 {
782 engine_->OnWindowStateEvent(hwnd, event);
783 }

References flutter::FlutterWindowsEngine::OnWindowStateEvent().

## ◆ PresentSoftwareBitmap()

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

Definition at line 649 of file flutter_windows_view.cc.

651 {
652 return binding_handler_->OnBitmapSurfaceUpdated(allocation, row_bytes,
653 height);
654 }

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

## ◆ SendInitialBounds()

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

Definition at line 359 of file flutter_windows_view.cc.

359 {
360 PhysicalWindowBounds bounds = binding_handler_->GetPhysicalWindowBounds();
361
362 SendWindowMetrics(bounds.width, bounds.height,
363 binding_handler_->GetDpiScale());
364 }

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

## ◆ SetFlutterCursor()

void flutter::FlutterWindowsView::SetFlutterCursor | ( | HCURSOR | cursor | ) |

Definition at line 167 of file flutter_windows_view.cc.

167 {
168 binding_handler_->SetFlutterCursor(cursor);
169 }

## ◆ surface()

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

Definition at line 719 of file flutter_windows_view.cc.

719 {
720 return surface_.get();
721 }

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

## ◆ UpdateFlutterCursor()

void flutter::FlutterWindowsView::UpdateFlutterCursor | ( | const std::string & | cursor_name | ) |

Definition at line 163 of file flutter_windows_view.cc.

163 {
164 binding_handler_->UpdateFlutterCursor(cursor_name);
165 }

## ◆ UpdateSemanticsEnabled()

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

Definition at line 765 of file flutter_windows_view.cc.

765 {
766 if (semantics_enabled_ != enabled) {
767 semantics_enabled_ = enabled;
768
769 if (!semantics_enabled_ && accessibility_bridge_) {
770 accessibility_bridge_.reset();
771 } else if (semantics_enabled_ && !accessibility_bridge_) {
772 accessibility_bridge_ = CreateAccessibilityBridge();
773 }
774 }
775 }

References CreateAccessibilityBridge().

## ◆ view_id()

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

Definition at line 656 of file flutter_windows_view.cc.

656 {
657 return view_id_;
658 }

## Friends And Related Function Documentation

## ◆ ViewModifier

friend class ViewModifier
| friend

Definition at line 237 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

flutter::WindowStateEvent::kHide
@ kHide
scancode
int scancode
Definition: keyboard_key_handler_unittests.cc:115
was_down
bool was_down
Definition: keyboard_key_handler_unittests.cc:119
extended
bool extended
Definition: keyboard_key_handler_unittests.cc:118
character
char32_t character
Definition: keyboard_key_handler_unittests.cc:117
flutter::FlutterWindowsView::ForceRedraw
void ForceRedraw()
Definition: flutter_windows_view.cc:171
flutter::FlutterWindowsView::DestroyRenderSurface
void DestroyRenderSurface()
Definition: flutter_windows_view.cc:713
flutter::FlutterWindowsView::GetWindowHandle
virtual HWND GetWindowHandle() const
Definition: flutter_windows_view.cc:727
flutter::FlutterWindowsEngine::Stop
virtual bool Stop()
Definition: flutter_windows_engine.cc:479
text
std::u16string text
Definition: keyboard_unittests.cc:332
flutter::FlutterWindowsView::view_id
FlutterViewId view_id() const
Definition: flutter_windows_view.cc:656
flutter::KeyboardHandlerBase::SyncModifiersIfNeeded
virtual void SyncModifiersIfNeeded(int modifiers_state)=0
flutter::FlutterWindowsEngine::keyboard_key_handler
KeyboardHandlerBase * keyboard_key_handler()
Definition: flutter_windows_engine.h:176
flutter::FlutterWindowsView::NotifyWinEventWrapper
virtual void NotifyWinEventWrapper(ui::AXPlatformNodeWin *node, ax::mojom::Event event)
Definition: flutter_windows_view.cc:745
flutter::FlutterWindowsEngine::ScheduleFrame
void ScheduleFrame()
Definition: flutter_windows_engine.cc:633
flutter::FlutterWindowsEngine::UpdateHighContrastMode
void UpdateHighContrastMode()
Definition: flutter_windows_engine.cc:799
flutter::FlutterWindowsView::CreateAccessibilityBridge
virtual std::shared_ptr< AccessibilityBridgeWindows > CreateAccessibilityBridge()
Definition: flutter_windows_view.cc:761
action
int action
Definition: keyboard_key_handler_unittests.cc:116
flutter::FlutterWindowsEngine::UpdateSemanticsEnabled
void UpdateSemanticsEnabled(bool enabled)
Definition: flutter_windows_engine.cc:764
flutter::FlutterWindowsEngine::egl_manager
egl::Manager * egl_manager() const
Definition: flutter_windows_engine.h:159
key
int key
Definition: keyboard_key_handler_unittests.cc:114
flutter::FlutterWindowsEngine::OnWindowStateEvent
void OnWindowStateEvent(HWND hwnd, WindowStateEvent event)
Definition: flutter_windows_engine.cc:838
flutter::egl::Manager::CreateWindowSurface
virtual std::unique_ptr< WindowSurface > CreateWindowSurface(HWND hwnd, size_t width, size_t height)
Definition: manager.cc:266
callback
FlutterDesktopBinaryReply callback
Definition: flutter_windows_view_unittests.cc:51