Flutter Windows Embedder
flutter::FlutterWindow Class Reference

#include <flutter_window.h>

Inheritance diagram for flutter::FlutterWindow:
flutter::KeyboardManager::WindowDelegate flutter::WindowBindingHandler

Public Member Functions

 FlutterWindow (int width, int height, std::shared_ptr< WindowsProcTable > windows_proc_table=nullptr, std::unique_ptr< TextInputManager > text_input_manager=nullptr)
 
virtual ~FlutterWindow ()
 
void InitializeChild (const char *title, unsigned int width, unsigned int height)
 
virtual BOOL Win32PeekMessage (LPMSG lpMsg, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg) override
 
virtual uint32_t Win32MapVkToChar (uint32_t virtual_key) override
 
virtual UINT Win32DispatchMessage (UINT Msg, WPARAM wParam, LPARAM lParam) override
 
virtual void OnDpiScale (unsigned int dpi)
 
virtual void OnResize (unsigned int width, unsigned int height)
 
virtual void OnPaint ()
 
virtual void OnPointerMove (double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id, int modifiers_state)
 
virtual void OnPointerDown (double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id, UINT button)
 
virtual void OnPointerUp (double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id, UINT button)
 
virtual void OnPointerLeave (double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id)
 
virtual void OnSetCursor ()
 
virtual void OnText (const std::u16string &text) override
 
virtual void OnKey (int key, int scancode, int action, char32_t character, bool extended, bool was_down, KeyEventCallback callback) override
 
virtual void OnComposeBegin ()
 
virtual void OnComposeCommit ()
 
virtual void OnComposeEnd ()
 
virtual void OnComposeChange (const std::u16string &text, int cursor_pos)
 
virtual void OnCursorRectUpdated (const Rect &rect) override
 
virtual void OnResetImeComposing () override
 
virtual void OnUpdateSemanticsEnabled (bool enabled)
 
virtual void OnScroll (double delta_x, double delta_y, FlutterPointerDeviceKind device_kind, int32_t device_id)
 
virtual gfx::NativeViewAccessible GetNativeViewAccessible ()
 
virtual void SetView (WindowBindingHandlerDelegate *view) override
 
virtual HWND GetWindowHandle () override
 
virtual float GetDpiScale () override
 
virtual bool IsVisible () override
 
virtual PhysicalWindowBounds GetPhysicalWindowBounds () override
 
virtual void UpdateFlutterCursor (const std::string &cursor_name) override
 
virtual void SetFlutterCursor (HCURSOR cursor) override
 
virtual bool OnBitmapSurfaceUpdated (const void *allocation, size_t row_bytes, size_t height) override
 
virtual PointerLocation GetPrimaryPointerLocation () override
 
virtual void OnThemeChange ()
 
virtual AlertPlatformNodeDelegateGetAlertDelegate () override
 
virtual ui::AXPlatformNodeWin * GetAlert () override
 
virtual ui::AXFragmentRootDelegateWin * GetAxFragmentRootDelegate ()
 
virtual void OnWindowStateEvent (WindowStateEvent event)
 
- Public Member Functions inherited from flutter::KeyboardManager::WindowDelegate
virtual ~WindowDelegate ()=default
 
- Public Member Functions inherited from flutter::WindowBindingHandler
virtual ~WindowBindingHandler ()=default
 

Protected Member Functions

virtual LRESULT Win32DefWindowProc (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
 
std::wstring NarrowToWide (const char *source)
 
LRESULT HandleMessage (UINT const message, WPARAM const wparam, LPARAM const lparam) noexcept
 
virtual LRESULT OnGetObject (UINT const message, WPARAM const wparam, LPARAM const lparam)
 
virtual void OnImeSetContext (UINT const message, WPARAM const wparam, LPARAM const lparam)
 
virtual void OnImeStartComposition (UINT const message, WPARAM const wparam, LPARAM const lparam)
 
virtual void OnImeComposition (UINT const message, WPARAM const wparam, LPARAM const lparam)
 
virtual void OnImeEndComposition (UINT const message, WPARAM const wparam, LPARAM const lparam)
 
virtual void OnImeRequest (UINT const message, WPARAM const wparam, LPARAM const lparam)
 
virtual void AbortImeComposing ()
 
virtual void UpdateCursorRect (const Rect &rect)
 
UINT GetCurrentDPI ()
 
UINT GetCurrentWidth ()
 
UINT GetCurrentHeight ()
 
virtual float GetScrollOffsetMultiplier ()
 

Protected Attributes

std::unique_ptr< AlertPlatformNodeDelegatealert_delegate_
 
std::unique_ptr< ui::AXPlatformNodeWin > alert_node_
 
std::unique_ptr< DirectManipulationOwnerdirect_manipulation_owner_
 

Friends

class WindowAXFragmentRootDelegate
 

Additional Inherited Members

- Public Types inherited from flutter::KeyboardManager::WindowDelegate
using KeyEventCallback = std::function< void(bool)>
 

Detailed Description

Definition at line 35 of file flutter_window.h.

Constructor & Destructor Documentation

◆ FlutterWindow()

flutter::FlutterWindow::FlutterWindow ( int  width,
int  height,
std::shared_ptr< WindowsProcTable windows_proc_table = nullptr,
std::unique_ptr< TextInputManager text_input_manager = nullptr 
)

Definition at line 119 of file flutter_window.cc.

124  : binding_handler_delegate_(nullptr),
125  touch_id_generator_(kMinTouchDeviceId, kMaxTouchDeviceId),
126  windows_proc_table_(std::move(windows_proc_table)),
127  text_input_manager_(std::move(text_input_manager)),
128  ax_fragment_root_(nullptr) {
129  // Get the DPI of the primary monitor as the initial DPI. If Per-Monitor V2 is
130  // supported, |current_dpi_| should be updated in the
131  // kWmDpiChangedBeforeParent message.
132  current_dpi_ = GetDpiForHWND(nullptr);
133 
134  // Get initial value for wheel scroll lines
135  // TODO: Listen to changes for this value
136  // https://github.com/flutter/flutter/issues/107248
137  UpdateScrollOffsetMultiplier();
138 
139  if (windows_proc_table_ == nullptr) {
140  windows_proc_table_ = std::make_unique<WindowsProcTable>();
141  }
142  if (text_input_manager_ == nullptr) {
143  text_input_manager_ = std::make_unique<TextInputManager>();
144  }
145  keyboard_manager_ = std::make_unique<KeyboardManager>(this);
146 
147  InitializeChild("FLUTTERVIEW", width, height);
148  current_cursor_ = ::LoadCursor(nullptr, IDC_ARROW);
149 }

References flutter::GetDpiForHWND(), and InitializeChild().

◆ ~FlutterWindow()

flutter::FlutterWindow::~FlutterWindow ( )
virtual

Definition at line 151 of file flutter_window.cc.

151  {
153  Destroy();
154 }

References flutter::kHide, and OnWindowStateEvent().

Member Function Documentation

◆ AbortImeComposing()

void flutter::FlutterWindow::AbortImeComposing ( )
protectedvirtual

Definition at line 898 of file flutter_window.cc.

898  {
899  text_input_manager_->AbortComposing();
900 }

Referenced by OnResetImeComposing().

◆ GetAlert()

ui::AXPlatformNodeWin * flutter::FlutterWindow::GetAlert ( )
overridevirtual

Implements flutter::WindowBindingHandler.

Definition at line 357 of file flutter_window.cc.

357  {
358  CreateAxFragmentRoot();
359  return alert_node_.get();
360 }

References alert_node_.

◆ GetAlertDelegate()

AlertPlatformNodeDelegate * flutter::FlutterWindow::GetAlertDelegate ( )
overridevirtual

Implements flutter::WindowBindingHandler.

Definition at line 352 of file flutter_window.cc.

352  {
353  CreateAxFragmentRoot();
354  return alert_delegate_.get();
355 }

References alert_delegate_.

◆ GetAxFragmentRootDelegate()

ui::AXFragmentRootDelegateWin * flutter::FlutterWindow::GetAxFragmentRootDelegate ( )
virtual

Definition at line 348 of file flutter_window.cc.

348  {
349  return binding_handler_delegate_->GetAxFragmentRootDelegate();
350 }

References flutter::WindowBindingHandlerDelegate::GetAxFragmentRootDelegate().

◆ GetCurrentDPI()

UINT flutter::FlutterWindow::GetCurrentDPI ( )
protected

Definition at line 906 of file flutter_window.cc.

906  {
907  return current_dpi_;
908 }

Referenced by GetDpiScale().

◆ GetCurrentHeight()

UINT flutter::FlutterWindow::GetCurrentHeight ( )
protected

Definition at line 914 of file flutter_window.cc.

914  {
915  return current_height_;
916 }

Referenced by GetPhysicalWindowBounds().

◆ GetCurrentWidth()

UINT flutter::FlutterWindow::GetCurrentWidth ( )
protected

Definition at line 910 of file flutter_window.cc.

910  {
911  return current_width_;
912 }

Referenced by GetPhysicalWindowBounds().

◆ GetDpiScale()

float flutter::FlutterWindow::GetDpiScale ( )
overridevirtual

Implements flutter::WindowBindingHandler.

Definition at line 167 of file flutter_window.cc.

167  {
168  return static_cast<float>(GetCurrentDPI()) / static_cast<float>(base_dpi);
169 }

References GetCurrentDPI().

Referenced by OnCursorRectUpdated().

◆ GetNativeViewAccessible()

gfx::NativeViewAccessible flutter::FlutterWindow::GetNativeViewAccessible ( )
virtual

Definition at line 329 of file flutter_window.cc.

329  {
330  if (binding_handler_delegate_ == nullptr) {
331  return nullptr;
332  }
333 
334  return binding_handler_delegate_->GetNativeViewAccessible();
335 }

References flutter::WindowBindingHandlerDelegate::GetNativeViewAccessible().

Referenced by OnGetObject().

◆ GetPhysicalWindowBounds()

PhysicalWindowBounds flutter::FlutterWindow::GetPhysicalWindowBounds ( )
overridevirtual

Implements flutter::WindowBindingHandler.

Definition at line 175 of file flutter_window.cc.

175  {
176  return {GetCurrentWidth(), GetCurrentHeight()};
177 }

References GetCurrentHeight(), and GetCurrentWidth().

◆ GetPrimaryPointerLocation()

PointerLocation flutter::FlutterWindow::GetPrimaryPointerLocation ( )
overridevirtual

Implements flutter::WindowBindingHandler.

Definition at line 337 of file flutter_window.cc.

337  {
338  POINT point;
339  GetCursorPos(&point);
340  ScreenToClient(GetWindowHandle(), &point);
341  return {(size_t)point.x, (size_t)point.y};
342 }

References GetWindowHandle().

◆ GetScrollOffsetMultiplier()

float flutter::FlutterWindow::GetScrollOffsetMultiplier ( )
protectedvirtual

Definition at line 918 of file flutter_window.cc.

918  {
919  return scroll_offset_multiplier_;
920 }

Referenced by OnScroll().

◆ GetWindowHandle()

HWND flutter::FlutterWindow::GetWindowHandle ( )
overridevirtual

◆ HandleMessage()

LRESULT flutter::FlutterWindow::HandleMessage ( UINT const  message,
WPARAM const  wparam,
LPARAM const  lparam 
)
protectednoexcept

Definition at line 525 of file flutter_window.cc.

527  {
528  LPARAM result_lparam = lparam;
529  int xPos = 0, yPos = 0;
530  UINT width = 0, height = 0;
531  UINT button_pressed = 0;
532  FlutterPointerDeviceKind device_kind;
533 
534  switch (message) {
535  case kWmDpiChangedBeforeParent:
536  current_dpi_ = GetDpiForHWND(window_handle_);
537  OnDpiScale(current_dpi_);
538  return 0;
539  case WM_SIZE:
540  width = LOWORD(lparam);
541  height = HIWORD(lparam);
542 
543  current_width_ = width;
544  current_height_ = height;
545  HandleResize(width, height);
546 
547  OnWindowStateEvent(width == 0 && height == 0 ? WindowStateEvent::kHide
549  break;
550  case WM_PAINT:
551  OnPaint();
552  break;
553  case WM_TOUCH: {
554  UINT num_points = LOWORD(wparam);
555  touch_points_.resize(num_points);
556  auto touch_input_handle = reinterpret_cast<HTOUCHINPUT>(lparam);
557  if (GetTouchInputInfo(touch_input_handle, num_points,
558  touch_points_.data(), sizeof(TOUCHINPUT))) {
559  for (const auto& touch : touch_points_) {
560  // Generate a mapped ID for the Windows-provided touch ID
561  auto touch_id = touch_id_generator_.GetGeneratedId(touch.dwID);
562 
563  POINT pt = {TOUCH_COORD_TO_PIXEL(touch.x),
564  TOUCH_COORD_TO_PIXEL(touch.y)};
565  ScreenToClient(window_handle_, &pt);
566  auto x = static_cast<double>(pt.x);
567  auto y = static_cast<double>(pt.y);
568 
569  if (touch.dwFlags & TOUCHEVENTF_DOWN) {
570  OnPointerDown(x, y, kFlutterPointerDeviceKindTouch, touch_id,
571  WM_LBUTTONDOWN);
572  } else if (touch.dwFlags & TOUCHEVENTF_MOVE) {
573  OnPointerMove(x, y, kFlutterPointerDeviceKindTouch, touch_id, 0);
574  } else if (touch.dwFlags & TOUCHEVENTF_UP) {
575  OnPointerUp(x, y, kFlutterPointerDeviceKindTouch, touch_id,
576  WM_LBUTTONDOWN);
577  OnPointerLeave(x, y, kFlutterPointerDeviceKindTouch, touch_id);
578  touch_id_generator_.ReleaseNumber(touch.dwID);
579  }
580  }
581  CloseTouchInputHandle(touch_input_handle);
582  }
583  return 0;
584  }
585  case WM_MOUSEMOVE:
586  device_kind = GetFlutterPointerDeviceKind();
587  if (device_kind == kFlutterPointerDeviceKindMouse) {
588  TrackMouseLeaveEvent(window_handle_);
589 
590  xPos = GET_X_LPARAM(lparam);
591  yPos = GET_Y_LPARAM(lparam);
592  mouse_x_ = static_cast<double>(xPos);
593  mouse_y_ = static_cast<double>(yPos);
594 
595  int mods = 0;
596  if (wparam & MK_CONTROL) {
597  mods |= kControl;
598  }
599  if (wparam & MK_SHIFT) {
600  mods |= kShift;
601  }
602  OnPointerMove(mouse_x_, mouse_y_, device_kind, kDefaultPointerDeviceId,
603  mods);
604  }
605  break;
606  case WM_MOUSELEAVE:
607  device_kind = GetFlutterPointerDeviceKind();
608  if (device_kind == kFlutterPointerDeviceKindMouse) {
609  OnPointerLeave(mouse_x_, mouse_y_, device_kind,
610  kDefaultPointerDeviceId);
611  }
612 
613  // Once the tracked event is received, the TrackMouseEvent function
614  // resets. Set to false to make sure it's called once mouse movement is
615  // detected again.
616  tracking_mouse_leave_ = false;
617  break;
618  case WM_SETCURSOR: {
619  UINT hit_test_result = LOWORD(lparam);
620  if (hit_test_result == HTCLIENT) {
621  OnSetCursor();
622  return TRUE;
623  }
624  break;
625  }
626  case WM_SETFOCUS:
628  ::CreateCaret(window_handle_, nullptr, 1, 1);
629  break;
630  case WM_KILLFOCUS:
632  ::DestroyCaret();
633  break;
634  case WM_LBUTTONDOWN:
635  case WM_RBUTTONDOWN:
636  case WM_MBUTTONDOWN:
637  case WM_XBUTTONDOWN:
638  device_kind = GetFlutterPointerDeviceKind();
639  if (device_kind != kFlutterPointerDeviceKindMouse) {
640  break;
641  }
642 
643  if (message == WM_LBUTTONDOWN) {
644  // Capture the pointer in case the user drags outside the client area.
645  // In this case, the "mouse leave" event is delayed until the user
646  // releases the button. It's only activated on left click given that
647  // it's more common for apps to handle dragging with only the left
648  // button.
649  SetCapture(window_handle_);
650  }
651  button_pressed = message;
652  if (message == WM_XBUTTONDOWN) {
653  button_pressed = GET_XBUTTON_WPARAM(wparam);
654  }
655  xPos = GET_X_LPARAM(lparam);
656  yPos = GET_Y_LPARAM(lparam);
657  OnPointerDown(static_cast<double>(xPos), static_cast<double>(yPos),
658  device_kind, kDefaultPointerDeviceId, button_pressed);
659  break;
660  case WM_LBUTTONUP:
661  case WM_RBUTTONUP:
662  case WM_MBUTTONUP:
663  case WM_XBUTTONUP:
664  device_kind = GetFlutterPointerDeviceKind();
665  if (device_kind != kFlutterPointerDeviceKindMouse) {
666  break;
667  }
668 
669  if (message == WM_LBUTTONUP) {
670  ReleaseCapture();
671  }
672  button_pressed = message;
673  if (message == WM_XBUTTONUP) {
674  button_pressed = GET_XBUTTON_WPARAM(wparam);
675  }
676  xPos = GET_X_LPARAM(lparam);
677  yPos = GET_Y_LPARAM(lparam);
678  OnPointerUp(static_cast<double>(xPos), static_cast<double>(yPos),
679  device_kind, kDefaultPointerDeviceId, button_pressed);
680  break;
681  case WM_MOUSEWHEEL:
682  OnScroll(0.0,
683  -(static_cast<short>(HIWORD(wparam)) /
684  static_cast<double>(WHEEL_DELTA)),
685  kFlutterPointerDeviceKindMouse, kDefaultPointerDeviceId);
686  break;
687  case WM_MOUSEHWHEEL:
688  OnScroll((static_cast<short>(HIWORD(wparam)) /
689  static_cast<double>(WHEEL_DELTA)),
690  0.0, kFlutterPointerDeviceKindMouse, kDefaultPointerDeviceId);
691  break;
692  case WM_GETOBJECT: {
693  LRESULT lresult = OnGetObject(message, wparam, lparam);
694  if (lresult) {
695  return lresult;
696  }
697  break;
698  }
699  case WM_TIMER:
700  if (wparam == kDirectManipulationTimer) {
701  direct_manipulation_owner_->Update();
702  return 0;
703  }
704  break;
705  case DM_POINTERHITTEST: {
707  UINT contact_id = GET_POINTERID_WPARAM(wparam);
708  POINTER_INPUT_TYPE pointer_type;
709  if (windows_proc_table_->GetPointerType(contact_id, &pointer_type) &&
710  pointer_type == PT_TOUCHPAD) {
711  direct_manipulation_owner_->SetContact(contact_id);
712  }
713  }
714  break;
715  }
716  case WM_INPUTLANGCHANGE:
717  // TODO(cbracken): pass this to TextInputManager to aid with
718  // language-specific issues.
719  break;
720  case WM_IME_SETCONTEXT:
721  OnImeSetContext(message, wparam, lparam);
722  // Strip the ISC_SHOWUICOMPOSITIONWINDOW bit from lparam before passing it
723  // to DefWindowProc() so that the composition window is hidden since
724  // Flutter renders the composing string itself.
725  result_lparam &= ~ISC_SHOWUICOMPOSITIONWINDOW;
726  break;
727  case WM_IME_STARTCOMPOSITION:
728  OnImeStartComposition(message, wparam, lparam);
729  // Suppress further processing by DefWindowProc() so that the default
730  // system IME style isn't used, but rather the one set in the
731  // WM_IME_SETCONTEXT handler.
732  return TRUE;
733  case WM_IME_COMPOSITION:
734  OnImeComposition(message, wparam, lparam);
735  if (lparam & GCS_RESULTSTR || lparam & GCS_COMPSTR) {
736  // Suppress further processing by DefWindowProc() since otherwise it
737  // will emit the result string as WM_CHAR messages on commit. Instead,
738  // committing the composing text to the EditableText string is handled
739  // in TextInputModel::CommitComposing, triggered by
740  // OnImeEndComposition().
741  return TRUE;
742  }
743  break;
744  case WM_IME_ENDCOMPOSITION:
745  OnImeEndComposition(message, wparam, lparam);
746  return TRUE;
747  case WM_IME_REQUEST:
748  OnImeRequest(message, wparam, lparam);
749  break;
750  case WM_UNICHAR: {
751  // Tell third-pary app, we can support Unicode.
752  if (wparam == UNICODE_NOCHAR)
753  return TRUE;
754  // DefWindowProc will send WM_CHAR for this WM_UNICHAR.
755  break;
756  }
757  case WM_THEMECHANGED:
758  OnThemeChange();
759  break;
760  case WM_DEADCHAR:
761  case WM_SYSDEADCHAR:
762  case WM_CHAR:
763  case WM_SYSCHAR:
764  case WM_KEYDOWN:
765  case WM_SYSKEYDOWN:
766  case WM_KEYUP:
767  case WM_SYSKEYUP:
768  if (keyboard_manager_->HandleMessage(message, wparam, lparam)) {
769  return 0;
770  }
771  break;
772  }
773 
774  return Win32DefWindowProc(window_handle_, message, wparam, result_lparam);
775 }

References flutter::GetDpiForHWND(), flutter::kControl, flutter::kFocus, flutter::kHide, flutter::kShift, flutter::kShow, flutter::kUnfocus, and message.

◆ InitializeChild()

void flutter::FlutterWindow::InitializeChild ( const char *  title,
unsigned int  width,
unsigned int  height 
)

Definition at line 421 of file flutter_window.cc.

423  {
424  Destroy();
425  std::wstring converted_title = NarrowToWide(title);
426 
427  WNDCLASS window_class = RegisterWindowClass(converted_title);
428 
429  auto* result = CreateWindowEx(
430  0, window_class.lpszClassName, converted_title.c_str(),
431  WS_CHILD | WS_VISIBLE, CW_DEFAULT, CW_DEFAULT, width, height,
432  HWND_MESSAGE, nullptr, window_class.hInstance, this);
433 
434  if (result == nullptr) {
435  auto error = GetLastError();
436  LPWSTR message = nullptr;
437  size_t size = FormatMessageW(
438  FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
439  FORMAT_MESSAGE_IGNORE_INSERTS,
440  NULL, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
441  reinterpret_cast<LPWSTR>(&message), 0, NULL);
442  OutputDebugString(message);
443  LocalFree(message);
444  }
445  SetUserObjectInformationA(GetCurrentProcess(),
446  UOI_TIMERPROC_EXCEPTION_SUPPRESSION, FALSE, 1);
447  // SetTimer is not precise, if a 16 ms interval is requested, it will instead
448  // often fire in an interval of 32 ms. Providing a value of 14 will ensure it
449  // runs every 16 ms, which will allow for 60 Hz trackpad gesture events, which
450  // is the maximal frequency supported by SetTimer.
451  SetTimer(result, kDirectManipulationTimer, 14, nullptr);
452  direct_manipulation_owner_ = std::make_unique<DirectManipulationOwner>(this);
453  direct_manipulation_owner_->Init(width, height);
454 }

References direct_manipulation_owner_, message, and NarrowToWide().

Referenced by FlutterWindow().

◆ IsVisible()

bool flutter::FlutterWindow::IsVisible ( )
overridevirtual

Implements flutter::WindowBindingHandler.

Definition at line 171 of file flutter_window.cc.

171  {
172  return IsWindowVisible(GetWindowHandle());
173 }

References GetWindowHandle().

◆ NarrowToWide()

std::wstring flutter::FlutterWindow::NarrowToWide ( const char *  source)
protected

Definition at line 478 of file flutter_window.cc.

478  {
479  size_t length = strlen(source);
480  size_t outlen = 0;
481  std::wstring wideTitle(length, L'#');
482  mbstowcs_s(&outlen, &wideTitle[0], length + 1, source, length);
483  return wideTitle;
484 }

Referenced by InitializeChild().

◆ OnBitmapSurfaceUpdated()

bool flutter::FlutterWindow::OnBitmapSurfaceUpdated ( const void *  allocation,
size_t  row_bytes,
size_t  height 
)
overridevirtual

Implements flutter::WindowBindingHandler.

Definition at line 311 of file flutter_window.cc.

313  {
314  HDC dc = ::GetDC(GetWindowHandle());
315  BITMAPINFO bmi = {};
316  bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
317  bmi.bmiHeader.biWidth = row_bytes / 4;
318  bmi.bmiHeader.biHeight = -height;
319  bmi.bmiHeader.biPlanes = 1;
320  bmi.bmiHeader.biBitCount = 32;
321  bmi.bmiHeader.biCompression = BI_RGB;
322  bmi.bmiHeader.biSizeImage = 0;
323  int ret = SetDIBitsToDevice(dc, 0, 0, row_bytes / 4, height, 0, 0, 0, height,
324  allocation, &bmi, DIB_RGB_COLORS);
325  ::ReleaseDC(GetWindowHandle(), dc);
326  return ret != 0;
327 }

References GetWindowHandle().

Referenced by flutter::testing::TEST().

◆ OnComposeBegin()

void flutter::FlutterWindow::OnComposeBegin ( )
virtual

Definition at line 265 of file flutter_window.cc.

265  {
266  binding_handler_delegate_->OnComposeBegin();
267 }

References flutter::WindowBindingHandlerDelegate::OnComposeBegin().

Referenced by OnImeStartComposition().

◆ OnComposeChange()

void flutter::FlutterWindow::OnComposeChange ( const std::u16string &  text,
int  cursor_pos 
)
virtual

Definition at line 277 of file flutter_window.cc.

278  {
279  binding_handler_delegate_->OnComposeChange(text, cursor_pos);
280 }

References flutter::WindowBindingHandlerDelegate::OnComposeChange(), and text.

Referenced by OnImeComposition().

◆ OnComposeCommit()

void flutter::FlutterWindow::OnComposeCommit ( )
virtual

Definition at line 269 of file flutter_window.cc.

269  {
270  binding_handler_delegate_->OnComposeCommit();
271 }

References flutter::WindowBindingHandlerDelegate::OnComposeCommit().

Referenced by OnImeComposition().

◆ OnComposeEnd()

void flutter::FlutterWindow::OnComposeEnd ( )
virtual

Definition at line 273 of file flutter_window.cc.

273  {
274  binding_handler_delegate_->OnComposeEnd();
275 }

References flutter::WindowBindingHandlerDelegate::OnComposeEnd().

Referenced by OnImeEndComposition().

◆ OnCursorRectUpdated()

void flutter::FlutterWindow::OnCursorRectUpdated ( const Rect rect)
overridevirtual

Implements flutter::WindowBindingHandler.

Definition at line 299 of file flutter_window.cc.

299  {
300  // Convert the rect from Flutter logical coordinates to device coordinates.
301  auto scale = GetDpiScale();
302  Point origin(rect.left() * scale, rect.top() * scale);
303  Size size(rect.width() * scale, rect.height() * scale);
304  UpdateCursorRect(Rect(origin, size));
305 }

References GetDpiScale(), flutter::Rect::height(), flutter::Rect::left(), flutter::Rect::top(), UpdateCursorRect(), and flutter::Rect::width().

◆ OnDpiScale()

void flutter::FlutterWindow::OnDpiScale ( unsigned int  dpi)
virtual

Definition at line 188 of file flutter_window.cc.

188 {};

◆ OnGetObject()

LRESULT flutter::FlutterWindow::OnGetObject ( UINT const  message,
WPARAM const  wparam,
LPARAM const  lparam 
)
protectedvirtual

Definition at line 777 of file flutter_window.cc.

779  {
780  LRESULT reference_result = static_cast<LRESULT>(0L);
781 
782  // Only the lower 32 bits of lparam are valid when checking the object id
783  // because it sometimes gets sign-extended incorrectly (but not always).
784  DWORD obj_id = static_cast<DWORD>(static_cast<DWORD_PTR>(lparam));
785 
786  bool is_uia_request = static_cast<DWORD>(UiaRootObjectId) == obj_id;
787  bool is_msaa_request = static_cast<DWORD>(OBJID_CLIENT) == obj_id;
788 
789  if (is_uia_request || is_msaa_request) {
790  // On Windows, we don't get a notification that the screen reader has been
791  // enabled or disabled. There is an API to query for screen reader state,
792  // but that state isn't set by all screen readers, including by Narrator,
793  // the screen reader that ships with Windows:
794  // https://docs.microsoft.com/en-us/windows/win32/winauto/screen-reader-parameter
795  //
796  // Instead, we enable semantics in Flutter if Windows issues queries for
797  // Microsoft Active Accessibility (MSAA) COM objects.
799  }
800 
801  gfx::NativeViewAccessible root_view = GetNativeViewAccessible();
802  // TODO(schectman): UIA is currently disabled by default.
803  // https://github.com/flutter/flutter/issues/114547
804  if (root_view) {
805  CreateAxFragmentRoot();
806  if (is_uia_request) {
807 #ifdef FLUTTER_ENGINE_USE_UIA
808  // Retrieve UIA object for the root view.
809  Microsoft::WRL::ComPtr<IRawElementProviderSimple> root;
810  if (SUCCEEDED(
811  ax_fragment_root_->GetNativeViewAccessible()->QueryInterface(
812  IID_PPV_ARGS(&root)))) {
813  // Return the UIA object via UiaReturnRawElementProvider(). See:
814  // https://docs.microsoft.com/en-us/windows/win32/winauto/wm-getobject
815  reference_result = UiaReturnRawElementProvider(window_handle_, wparam,
816  lparam, root.Get());
817  } else {
818  FML_LOG(ERROR) << "Failed to query AX fragment root.";
819  }
820 #endif // FLUTTER_ENGINE_USE_UIA
821  } else if (is_msaa_request) {
822  // Create the accessibility root if it does not already exist.
823  // Return the IAccessible for the root view.
824  Microsoft::WRL::ComPtr<IAccessible> root;
825  ax_fragment_root_->GetNativeViewAccessible()->QueryInterface(
826  IID_PPV_ARGS(&root));
827  reference_result = LresultFromObject(IID_IAccessible, wparam, root.Get());
828  }
829  }
830  return reference_result;
831 }

References GetNativeViewAccessible(), and OnUpdateSemanticsEnabled().

◆ OnImeComposition()

void flutter::FlutterWindow::OnImeComposition ( UINT const  message,
WPARAM const  wparam,
LPARAM const  lparam 
)
protectedvirtual

Definition at line 848 of file flutter_window.cc.

850  {
851  // Update the IME window position.
852  text_input_manager_->UpdateImeWindow();
853 
854  if (lparam == 0) {
855  OnComposeChange(u"", 0);
856  OnComposeCommit();
857  }
858 
859  // Process GCS_RESULTSTR at fisrt, because Google Japanese Input and ATOK send
860  // both GCS_RESULTSTR and GCS_COMPSTR to commit composed text and send new
861  // composing text.
862  if (lparam & GCS_RESULTSTR) {
863  // Commit but don't end composing.
864  // Read the committed composing string.
865  long pos = text_input_manager_->GetComposingCursorPosition();
866  std::optional<std::u16string> text = text_input_manager_->GetResultString();
867  if (text) {
868  OnComposeChange(text.value(), pos);
869  OnComposeCommit();
870  }
871  }
872  if (lparam & GCS_COMPSTR) {
873  // Read the in-progress composing string.
874  long pos = text_input_manager_->GetComposingCursorPosition();
875  std::optional<std::u16string> text =
876  text_input_manager_->GetComposingString();
877  if (text) {
878  OnComposeChange(text.value(), pos);
879  }
880  }
881 }

References OnComposeChange(), OnComposeCommit(), and text.

◆ OnImeEndComposition()

void flutter::FlutterWindow::OnImeEndComposition ( UINT const  message,
WPARAM const  wparam,
LPARAM const  lparam 
)
protectedvirtual

Definition at line 883 of file flutter_window.cc.

885  {
886  text_input_manager_->DestroyImeWindow();
887  OnComposeEnd();
888 }

References OnComposeEnd().

◆ OnImeRequest()

void flutter::FlutterWindow::OnImeRequest ( UINT const  message,
WPARAM const  wparam,
LPARAM const  lparam 
)
protectedvirtual

Definition at line 890 of file flutter_window.cc.

892  {
893  // TODO(cbracken): Handle IMR_RECONVERTSTRING, IMR_DOCUMENTFEED,
894  // and IMR_QUERYCHARPOSITION messages.
895  // https://github.com/flutter/flutter/issues/74547
896 }

◆ OnImeSetContext()

void flutter::FlutterWindow::OnImeSetContext ( UINT const  message,
WPARAM const  wparam,
LPARAM const  lparam 
)
protectedvirtual

Definition at line 833 of file flutter_window.cc.

835  {
836  if (wparam != 0) {
837  text_input_manager_->CreateImeWindow();
838  }
839 }

◆ OnImeStartComposition()

void flutter::FlutterWindow::OnImeStartComposition ( UINT const  message,
WPARAM const  wparam,
LPARAM const  lparam 
)
protectedvirtual

Definition at line 841 of file flutter_window.cc.

843  {
844  text_input_manager_->CreateImeWindow();
845  OnComposeBegin();
846 }

References OnComposeBegin().

◆ OnKey()

void flutter::FlutterWindow::OnKey ( int  key,
int  scancode,
int  action,
char32_t  character,
bool  extended,
bool  was_down,
KeyEventCallback  callback 
)
overridevirtual

Implements flutter::KeyboardManager::WindowDelegate.

Definition at line 254 of file flutter_window.cc.

260  {
261  binding_handler_delegate_->OnKey(key, scancode, action, character, extended,
262  was_down, std::move(callback));
263 }

References action, callback, character, extended, key, flutter::WindowBindingHandlerDelegate::OnKey(), scancode, and was_down.

◆ OnPaint()

void flutter::FlutterWindow::OnPaint ( )
virtual

Definition at line 198 of file flutter_window.cc.

198  {
199  if (binding_handler_delegate_ != nullptr) {
200  binding_handler_delegate_->OnWindowRepaint();
201  }
202 }

References flutter::WindowBindingHandlerDelegate::OnWindowRepaint().

◆ OnPointerDown()

void flutter::FlutterWindow::OnPointerDown ( double  x,
double  y,
FlutterPointerDeviceKind  device_kind,
int32_t  device_id,
UINT  button 
)
virtual

Definition at line 213 of file flutter_window.cc.

217  {
218  uint64_t flutter_button = ConvertWinButtonToFlutterButton(button);
219  if (flutter_button != 0) {
220  binding_handler_delegate_->OnPointerDown(
221  x, y, device_kind, device_id,
222  static_cast<FlutterPointerMouseButtons>(flutter_button));
223  }
224 }

References flutter::WindowBindingHandlerDelegate::OnPointerDown().

Referenced by flutter::testing::TEST().

◆ OnPointerLeave()

void flutter::FlutterWindow::OnPointerLeave ( double  x,
double  y,
FlutterPointerDeviceKind  device_kind,
int32_t  device_id 
)
virtual

Definition at line 239 of file flutter_window.cc.

242  {
243  binding_handler_delegate_->OnPointerLeave(x, y, device_kind, device_id);
244 }

References flutter::WindowBindingHandlerDelegate::OnPointerLeave().

Referenced by flutter::testing::TEST().

◆ OnPointerMove()

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

Definition at line 204 of file flutter_window.cc.

208  {
209  binding_handler_delegate_->OnPointerMove(x, y, device_kind, device_id,
210  modifiers_state);
211 }

References flutter::WindowBindingHandlerDelegate::OnPointerMove().

Referenced by flutter::testing::TEST().

◆ OnPointerUp()

void flutter::FlutterWindow::OnPointerUp ( double  x,
double  y,
FlutterPointerDeviceKind  device_kind,
int32_t  device_id,
UINT  button 
)
virtual

Definition at line 226 of file flutter_window.cc.

230  {
231  uint64_t flutter_button = ConvertWinButtonToFlutterButton(button);
232  if (flutter_button != 0) {
233  binding_handler_delegate_->OnPointerUp(
234  x, y, device_kind, device_id,
235  static_cast<FlutterPointerMouseButtons>(flutter_button));
236  }
237 }

References flutter::WindowBindingHandlerDelegate::OnPointerUp().

Referenced by flutter::testing::TEST().

◆ OnResetImeComposing()

void flutter::FlutterWindow::OnResetImeComposing ( )
overridevirtual

Implements flutter::WindowBindingHandler.

Definition at line 307 of file flutter_window.cc.

307  {
309 }

References AbortImeComposing().

◆ OnResize()

void flutter::FlutterWindow::OnResize ( unsigned int  width,
unsigned int  height 
)
virtual

Definition at line 192 of file flutter_window.cc.

192  {
193  if (binding_handler_delegate_ != nullptr) {
194  binding_handler_delegate_->OnWindowSizeChanged(width, height);
195  }
196 }

References flutter::WindowBindingHandlerDelegate::OnWindowSizeChanged().

◆ OnScroll()

void flutter::FlutterWindow::OnScroll ( double  delta_x,
double  delta_y,
FlutterPointerDeviceKind  device_kind,
int32_t  device_id 
)
virtual

Definition at line 286 of file flutter_window.cc.

289  {
290  POINT point;
291  GetCursorPos(&point);
292 
293  ScreenToClient(GetWindowHandle(), &point);
294  binding_handler_delegate_->OnScroll(point.x, point.y, delta_x, delta_y,
295  GetScrollOffsetMultiplier(), device_kind,
296  device_id);
297 }

References GetScrollOffsetMultiplier(), GetWindowHandle(), and flutter::WindowBindingHandlerDelegate::OnScroll().

◆ OnSetCursor()

void flutter::FlutterWindow::OnSetCursor ( )
virtual

Definition at line 246 of file flutter_window.cc.

246  {
247  ::SetCursor(current_cursor_);
248 }

◆ OnText()

void flutter::FlutterWindow::OnText ( const std::u16string &  text)
overridevirtual

Implements flutter::KeyboardManager::WindowDelegate.

Definition at line 250 of file flutter_window.cc.

250  {
251  binding_handler_delegate_->OnText(text);
252 }

References flutter::WindowBindingHandlerDelegate::OnText(), and text.

◆ OnThemeChange()

void flutter::FlutterWindow::OnThemeChange ( )
virtual

Definition at line 344 of file flutter_window.cc.

344  {
345  binding_handler_delegate_->OnHighContrastChanged();
346 }

References flutter::WindowBindingHandlerDelegate::OnHighContrastChanged().

◆ OnUpdateSemanticsEnabled()

void flutter::FlutterWindow::OnUpdateSemanticsEnabled ( bool  enabled)
virtual

Definition at line 282 of file flutter_window.cc.

282  {
283  binding_handler_delegate_->OnUpdateSemanticsEnabled(enabled);
284 }

References flutter::WindowBindingHandlerDelegate::OnUpdateSemanticsEnabled().

Referenced by OnGetObject().

◆ OnWindowStateEvent()

void flutter::FlutterWindow::OnWindowStateEvent ( WindowStateEvent  event)
virtual

Definition at line 362 of file flutter_window.cc.

362  {
363  switch (event) {
365  restored_ = true;
366  break;
368  restored_ = false;
369  focused_ = false;
370  break;
372  focused_ = true;
373  break;
375  focused_ = false;
376  break;
377  }
378  HWND hwnd = GetWindowHandle();
379  if (hwnd && binding_handler_delegate_) {
380  binding_handler_delegate_->OnWindowStateEvent(hwnd, event);
381  }
382 }

References GetWindowHandle(), flutter::kFocus, flutter::kHide, flutter::kShow, flutter::kUnfocus, and flutter::WindowBindingHandlerDelegate::OnWindowStateEvent().

Referenced by SetView(), and ~FlutterWindow().

◆ SetFlutterCursor()

void flutter::FlutterWindow::SetFlutterCursor ( HCURSOR  cursor)
overridevirtual

Implements flutter::WindowBindingHandler.

Definition at line 183 of file flutter_window.cc.

183  {
184  current_cursor_ = cursor;
185  ::SetCursor(current_cursor_);
186 }

◆ SetView()

void flutter::FlutterWindow::SetView ( WindowBindingHandlerDelegate view)
overridevirtual

Implements flutter::WindowBindingHandler.

Definition at line 156 of file flutter_window.cc.

156  {
157  binding_handler_delegate_ = window;
158  direct_manipulation_owner_->SetBindingHandlerDelegate(window);
159  if (restored_ && window) {
161  }
162  if (focused_ && window) {
164  }
165 }

References direct_manipulation_owner_, flutter::kFocus, flutter::kShow, and OnWindowStateEvent().

Referenced by flutter::testing::TEST().

◆ UpdateCursorRect()

void flutter::FlutterWindow::UpdateCursorRect ( const Rect rect)
protectedvirtual

Definition at line 902 of file flutter_window.cc.

902  {
903  text_input_manager_->UpdateCaretRect(rect);
904 }

Referenced by OnCursorRectUpdated().

◆ UpdateFlutterCursor()

void flutter::FlutterWindow::UpdateFlutterCursor ( const std::string &  cursor_name)
overridevirtual

Implements flutter::WindowBindingHandler.

Definition at line 179 of file flutter_window.cc.

179  {
180  current_cursor_ = GetCursorByName(cursor_name);
181 }

◆ Win32DefWindowProc()

LRESULT flutter::FlutterWindow::Win32DefWindowProc ( HWND  hWnd,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam 
)
protectedvirtual

Definition at line 922 of file flutter_window.cc.

925  {
926  return ::DefWindowProc(hWnd, Msg, wParam, lParam);
927 }

◆ Win32DispatchMessage()

UINT flutter::FlutterWindow::Win32DispatchMessage ( UINT  Msg,
WPARAM  wParam,
LPARAM  lParam 
)
overridevirtual

Implements flutter::KeyboardManager::WindowDelegate.

Definition at line 472 of file flutter_window.cc.

474  {
475  return ::SendMessage(window_handle_, Msg, wParam, lParam);
476 }

◆ Win32MapVkToChar()

uint32_t flutter::FlutterWindow::Win32MapVkToChar ( uint32_t  virtual_key)
overridevirtual

Implements flutter::KeyboardManager::WindowDelegate.

Definition at line 468 of file flutter_window.cc.

468  {
469  return ::MapVirtualKey(virtual_key, MAPVK_VK_TO_CHAR);
470 }

◆ Win32PeekMessage()

BOOL flutter::FlutterWindow::Win32PeekMessage ( LPMSG  lpMsg,
UINT  wMsgFilterMin,
UINT  wMsgFilterMax,
UINT  wRemoveMsg 
)
overridevirtual

Implements flutter::KeyboardManager::WindowDelegate.

Definition at line 460 of file flutter_window.cc.

463  {
464  return ::PeekMessage(lpMsg, window_handle_, wMsgFilterMin, wMsgFilterMax,
465  wRemoveMsg);
466 }

Friends And Related Function Documentation

◆ WindowAXFragmentRootDelegate

friend class WindowAXFragmentRootDelegate
friend

Definition at line 382 of file flutter_window.h.

Member Data Documentation

◆ alert_delegate_

std::unique_ptr<AlertPlatformNodeDelegate> flutter::FlutterWindow::alert_delegate_
protected

Definition at line 271 of file flutter_window.h.

Referenced by GetAlertDelegate().

◆ alert_node_

std::unique_ptr<ui::AXPlatformNodeWin> flutter::FlutterWindow::alert_node_
protected

Definition at line 274 of file flutter_window.h.

Referenced by GetAlert().

◆ direct_manipulation_owner_

std::unique_ptr<DirectManipulationOwner> flutter::FlutterWindow::direct_manipulation_owner_
protected

Definition at line 278 of file flutter_window.h.

Referenced by InitializeChild(), and SetView().


The documentation for this class was generated from the following files:
flutter::FlutterWindow::GetWindowHandle
virtual HWND GetWindowHandle() override
Definition: flutter_window.cc:456
flutter::WindowBindingHandlerDelegate::OnWindowRepaint
virtual void OnWindowRepaint()=0
flutter::FlutterWindow::GetCurrentHeight
UINT GetCurrentHeight()
Definition: flutter_window.cc:914
flutter::WindowStateEvent::kHide
@ kHide
flutter::FlutterWindow::OnComposeBegin
virtual void OnComposeBegin()
Definition: flutter_window.cc:265
scancode
int scancode
Definition: keyboard_key_handler_unittests.cc:115
flutter::FlutterWindow::GetDpiScale
virtual float GetDpiScale() override
Definition: flutter_window.cc:167
was_down
bool was_down
Definition: keyboard_key_handler_unittests.cc:119
extended
bool extended
Definition: keyboard_key_handler_unittests.cc:118
flutter::FlutterWindow::OnThemeChange
virtual void OnThemeChange()
Definition: flutter_window.cc:344
flutter::FlutterWindow::OnPointerDown
virtual void OnPointerDown(double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id, UINT button)
Definition: flutter_window.cc:213
character
char32_t character
Definition: keyboard_key_handler_unittests.cc:117
flutter::FlutterWindow::GetCurrentWidth
UINT GetCurrentWidth()
Definition: flutter_window.cc:910
flutter::FlutterWindow::NarrowToWide
std::wstring NarrowToWide(const char *source)
Definition: flutter_window.cc:478
flutter::FlutterWindow::OnImeEndComposition
virtual void OnImeEndComposition(UINT const message, WPARAM const wparam, LPARAM const lparam)
Definition: flutter_window.cc:883
flutter::WindowBindingHandlerDelegate::OnPointerMove
virtual void OnPointerMove(double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id, int modifiers_state)=0
flutter::FlutterWindow::OnGetObject
virtual LRESULT OnGetObject(UINT const message, WPARAM const wparam, LPARAM const lparam)
Definition: flutter_window.cc:777
flutter::FlutterWindow::InitializeChild
void InitializeChild(const char *title, unsigned int width, unsigned int height)
Definition: flutter_window.cc:421
flutter::FlutterWindow::AbortImeComposing
virtual void AbortImeComposing()
Definition: flutter_window.cc:898
flutter::WindowBindingHandlerDelegate::GetAxFragmentRootDelegate
virtual ui::AXFragmentRootDelegateWin * GetAxFragmentRootDelegate()=0
flutter::WindowBindingHandlerDelegate::OnHighContrastChanged
virtual void OnHighContrastChanged()=0
flutter::GetDpiForHWND
UINT GetDpiForHWND(HWND hwnd)
Definition: dpi_utils.cc:130
flutter::FlutterWindow::OnPointerMove
virtual void OnPointerMove(double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id, int modifiers_state)
Definition: flutter_window.cc:204
flutter::FlutterWindow::direct_manipulation_owner_
std::unique_ptr< DirectManipulationOwner > direct_manipulation_owner_
Definition: flutter_window.h:278
flutter::WindowBindingHandlerDelegate::OnText
virtual void OnText(const std::u16string &)=0
flutter::FlutterWindow::OnPointerLeave
virtual void OnPointerLeave(double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id)
Definition: flutter_window.cc:239
flutter::FlutterWindow::GetCurrentDPI
UINT GetCurrentDPI()
Definition: flutter_window.cc:906
flutter::FlutterWindow::OnUpdateSemanticsEnabled
virtual void OnUpdateSemanticsEnabled(bool enabled)
Definition: flutter_window.cc:282
flutter::FlutterWindow::OnPointerUp
virtual void OnPointerUp(double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id, UINT button)
Definition: flutter_window.cc:226
flutter::FlutterWindow::GetNativeViewAccessible
virtual gfx::NativeViewAccessible GetNativeViewAccessible()
Definition: flutter_window.cc:329
flutter::FlutterWindow::OnImeSetContext
virtual void OnImeSetContext(UINT const message, WPARAM const wparam, LPARAM const lparam)
Definition: flutter_window.cc:833
text
std::u16string text
Definition: keyboard_unittests.cc:332
flutter::WindowStateEvent::kFocus
@ kFocus
flutter::SequentialIdGenerator::ReleaseNumber
void ReleaseNumber(uint32_t number)
Definition: sequential_id_generator.cc:47
flutter::FlutterWindow::OnComposeChange
virtual void OnComposeChange(const std::u16string &text, int cursor_pos)
Definition: flutter_window.cc:277
flutter::WindowStateEvent::kShow
@ kShow
flutter::FlutterWindow::OnImeStartComposition
virtual void OnImeStartComposition(UINT const message, WPARAM const wparam, LPARAM const lparam)
Definition: flutter_window.cc:841
flutter::FlutterWindow::OnPaint
virtual void OnPaint()
Definition: flutter_window.cc:198
flutter::FlutterWindow::OnSetCursor
virtual void OnSetCursor()
Definition: flutter_window.cc:246
flutter::WindowBindingHandlerDelegate::OnPointerLeave
virtual void OnPointerLeave(double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id)=0
flutter::FlutterWindow::OnWindowStateEvent
virtual void OnWindowStateEvent(WindowStateEvent event)
Definition: flutter_window.cc:362
flutter::WindowBindingHandlerDelegate::OnWindowStateEvent
virtual void OnWindowStateEvent(HWND hwnd, WindowStateEvent event)=0
flutter::WindowBindingHandlerDelegate::OnComposeBegin
virtual void OnComposeBegin()=0
flutter::WindowBindingHandlerDelegate::OnComposeEnd
virtual void OnComposeEnd()=0
flutter::kShift
constexpr int kShift
Definition: keyboard_utils.h:14
flutter::WindowBindingHandlerDelegate::OnComposeCommit
virtual void OnComposeCommit()=0
flutter::FlutterWindow::OnComposeCommit
virtual void OnComposeCommit()
Definition: flutter_window.cc:269
flutter::FlutterWindow::alert_node_
std::unique_ptr< ui::AXPlatformNodeWin > alert_node_
Definition: flutter_window.h:274
flutter::WindowBindingHandlerDelegate::OnPointerDown
virtual void OnPointerDown(double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id, FlutterPointerMouseButtons button)=0
flutter::FlutterWindow::OnImeRequest
virtual void OnImeRequest(UINT const message, WPARAM const wparam, LPARAM const lparam)
Definition: flutter_window.cc:890
flutter::WindowStateEvent::kUnfocus
@ kUnfocus
flutter::FlutterWindow::GetScrollOffsetMultiplier
virtual float GetScrollOffsetMultiplier()
Definition: flutter_window.cc:918
flutter::FlutterWindow::Win32DefWindowProc
virtual LRESULT Win32DefWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: flutter_window.cc:922
flutter::FlutterWindow::OnScroll
virtual void OnScroll(double delta_x, double delta_y, FlutterPointerDeviceKind device_kind, int32_t device_id)
Definition: flutter_window.cc:286
flutter::FlutterWindow::OnImeComposition
virtual void OnImeComposition(UINT const message, WPARAM const wparam, LPARAM const lparam)
Definition: flutter_window.cc:848
flutter::SequentialIdGenerator::GetGeneratedId
uint32_t GetGeneratedId(uint32_t number)
Definition: sequential_id_generator.cc:32
flutter::FlutterWindow::OnComposeEnd
virtual void OnComposeEnd()
Definition: flutter_window.cc:273
message
Win32Message message
Definition: keyboard_unittests.cc:137
action
int action
Definition: keyboard_key_handler_unittests.cc:116
flutter::WindowBindingHandlerDelegate::GetNativeViewAccessible
virtual gfx::NativeViewAccessible GetNativeViewAccessible()=0
flutter::WindowBindingHandlerDelegate::OnKey
virtual void OnKey(int key, int scancode, int action, char32_t character, bool extended, bool was_down, KeyEventCallback callback)=0
flutter::kControl
constexpr int kControl
Definition: keyboard_utils.h:15
flutter::FlutterWindow::alert_delegate_
std::unique_ptr< AlertPlatformNodeDelegate > alert_delegate_
Definition: flutter_window.h:271
flutter::WindowBindingHandlerDelegate::OnScroll
virtual void OnScroll(double x, double y, double delta_x, double delta_y, int scroll_offset_multiplier, FlutterPointerDeviceKind device_kind, int32_t device_id)=0
key
int key
Definition: keyboard_key_handler_unittests.cc:114
flutter::WindowBindingHandlerDelegate::OnPointerUp
virtual void OnPointerUp(double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id, FlutterPointerMouseButtons button)=0
flutter::WindowBindingHandlerDelegate::OnComposeChange
virtual void OnComposeChange(const std::u16string &text, int cursor_pos)=0
flutter::WindowBindingHandlerDelegate::OnUpdateSemanticsEnabled
virtual void OnUpdateSemanticsEnabled(bool enabled)=0
flutter::WindowBindingHandlerDelegate::OnWindowSizeChanged
virtual void OnWindowSizeChanged(size_t width, size_t height)=0
flutter::FlutterWindow::OnDpiScale
virtual void OnDpiScale(unsigned int dpi)
Definition: flutter_window.cc:188
callback
FlutterDesktopBinaryReply callback
Definition: flutter_windows_view_unittests.cc:48
flutter::FlutterWindow::UpdateCursorRect
virtual void UpdateCursorRect(const Rect &rect)
Definition: flutter_window.cc:902