| Flutter Windows Embedder |

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
flutter::FlutterWindow Class Reference

`#include <flutter_window.h>`

Inheritance diagram for flutter::FlutterWindow:

## Public Member Functions
| FlutterWindow (int width, int height, std::unique_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)
HWND | GetWindowHandle ()
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 WindowsRenderTarget | GetRenderTarget () override
virtual PlatformWindow | GetPlatformWindow () 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 void | OnWindowResized () override
virtual bool | OnBitmapSurfaceUpdated (const void *allocation, size_t row_bytes, size_t height) override
virtual PointerLocation | GetPrimaryPointerLocation () override
virtual void | OnThemeChange ()
virtual void | SendInitialAccessibilityFeatures () override
virtual AlertPlatformNodeDelegate * | GetAlertDelegate () override
virtual ui::AXPlatformNodeWin * | GetAlert () override
virtual bool | NeedsVSync () 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 ()
virtual bool | GetHighContrastEnabled ()

## Protected Attributes
std::unique_ptr< AlertPlatformNodeDelegate > | alert_delegate_
std::unique_ptr< ui::AXPlatformNodeWin > | alert_node_
std::unique_ptr< DirectManipulationOwner > | direct_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::unique_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 {
152 OnWindowStateEvent(WindowStateEvent::kHide);
153 Destroy();
154 }

References flutter::kHide, and OnWindowStateEvent().

## Member Function Documentation

## ◆ AbortImeComposing()

void flutter::FlutterWindow::AbortImeComposing | ( |  | ) |
| protected virtual

Definition at line 929 of file flutter_window.cc.

929 {
930 text_input_manager_->AbortComposing();
931 }

Referenced by OnResetImeComposing().

## ◆ GetAlert()

ui::AXPlatformNodeWin * flutter::FlutterWindow::GetAlert | ( |  | ) |
| override virtual

Implements flutter::WindowBindingHandler.

Definition at line 376 of file flutter_window.cc.

376 {
377 CreateAxFragmentRoot();
378 return alert_node_.get();
379 }

References alert_node_.

## ◆ GetAlertDelegate()

AlertPlatformNodeDelegate * flutter::FlutterWindow::GetAlertDelegate | ( |  | ) |
| override virtual

Implements flutter::WindowBindingHandler.

Definition at line 371 of file flutter_window.cc.

371 {
372 CreateAxFragmentRoot();
373 return alert_delegate_.get();
374 }

References alert_delegate_.

## ◆ GetAxFragmentRootDelegate()

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

Definition at line 367 of file flutter_window.cc.

367 {
368 return binding_handler_delegate_->GetAxFragmentRootDelegate();
369 }

References flutter::WindowBindingHandlerDelegate::GetAxFragmentRootDelegate().

## ◆ GetCurrentDPI()

UINT flutter::FlutterWindow::GetCurrentDPI | ( |  | ) |
| protected

Definition at line 937 of file flutter_window.cc.

937 {
938 return current_dpi_;
939 }

Referenced by GetDpiScale().

## ◆ GetCurrentHeight()

UINT flutter::FlutterWindow::GetCurrentHeight | ( |  | ) |
| protected

Definition at line 945 of file flutter_window.cc.

945 {
946 return current_height_;
947 }

Referenced by GetPhysicalWindowBounds().

## ◆ GetCurrentWidth()

UINT flutter::FlutterWindow::GetCurrentWidth | ( |  | ) |
| protected

Definition at line 941 of file flutter_window.cc.

941 {
942 return current_width_;
943 }

Referenced by GetPhysicalWindowBounds().

## ◆ GetDpiScale()

float flutter::FlutterWindow::GetDpiScale | ( |  | ) |
| override virtual

Implements flutter::WindowBindingHandler.

Definition at line 175 of file flutter_window.cc.

175 {
176 return static_cast<float>(GetCurrentDPI()) / static_cast<float>(base_dpi);
177 }

References GetCurrentDPI().

Referenced by OnCursorRectUpdated().

## ◆ GetHighContrastEnabled()

bool flutter::FlutterWindow::GetHighContrastEnabled | ( |  | ) |
| protected virtual

Definition at line 953 of file flutter_window.cc.

953 {
954 HIGHCONTRAST high_contrast = {.cbSize = sizeof(HIGHCONTRAST)};
955 // API call is only supported on Windows 8+
956 if (SystemParametersInfoW(SPI_GETHIGHCONTRAST, sizeof(HIGHCONTRAST),
957 &high_contrast, 0)) {
958 return high_contrast.dwFlags & HCF_HIGHCONTRASTON;
959 } else {
960 FML_LOG(INFO) << "Failed to get status of high contrast feature,"
961 << "support only for Windows 8 + ";
962 return false;
963 }
964 }

Referenced by OnThemeChange().

## ◆ GetNativeViewAccessible()

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

Definition at line 343 of file flutter_window.cc.

343 {
344 if (binding_handler_delegate_ == nullptr) {
345 return nullptr;
346 }
347
348 return binding_handler_delegate_->GetNativeViewAccessible();
349 }

References flutter::WindowBindingHandlerDelegate::GetNativeViewAccessible().

Referenced by OnGetObject().

## ◆ GetPhysicalWindowBounds()

PhysicalWindowBounds flutter::FlutterWindow::GetPhysicalWindowBounds | ( |  | ) |
| override virtual

Implements flutter::WindowBindingHandler.

Definition at line 183 of file flutter_window.cc.

183 {
184 return {GetCurrentWidth(), GetCurrentHeight()};
185 }

References GetCurrentHeight(), and GetCurrentWidth().

## ◆ GetPlatformWindow()

PlatformWindow flutter::FlutterWindow::GetPlatformWindow | ( |  | ) |
| override virtual

Implements flutter::WindowBindingHandler.

Definition at line 171 of file flutter_window.cc.

171 {
172 return GetWindowHandle();
173 }

References GetWindowHandle().

Referenced by OnWindowStateEvent().

## ◆ GetPrimaryPointerLocation()

PointerLocation flutter::FlutterWindow::GetPrimaryPointerLocation | ( |  | ) |
| override virtual

Implements flutter::WindowBindingHandler.

Definition at line 351 of file flutter_window.cc.

351 {
352 POINT point;
353 GetCursorPos(&point);
354 ScreenToClient(GetWindowHandle(), &point);
355 return {(size_t)point.x, (size_t)point.y};
356 }

References GetWindowHandle().

## ◆ GetRenderTarget()

WindowsRenderTarget flutter::FlutterWindow::GetRenderTarget | ( |  | ) |
| override virtual

Implements flutter::WindowBindingHandler.

Definition at line 167 of file flutter_window.cc.

167 {
168 return WindowsRenderTarget(GetWindowHandle());
169 }

References GetWindowHandle().

## ◆ GetScrollOffsetMultiplier()

float flutter::FlutterWindow::GetScrollOffsetMultiplier | ( |  | ) |
| protected virtual

Definition at line 949 of file flutter_window.cc.

949 {
950 return scroll_offset_multiplier_;
951 }

Referenced by OnScroll().

## ◆ GetWindowHandle()

HWND flutter::FlutterWindow::GetWindowHandle | ( |  | ) |

Definition at line 487 of file flutter_window.cc.

487 {
488 return window_handle_;
489 }

Referenced by flutter::DirectManipulationOwner::Destroy(), GetPlatformWindow(), GetPrimaryPointerLocation(), GetRenderTarget(), flutter::DirectManipulationOwner::Init(), IsVisible(), OnBitmapSurfaceUpdated(), and OnScroll().

## ◆ HandleMessage()

LRESULT flutter::FlutterWindow::HandleMessage | ( | UINT const | message,
|  | WPARAM const | wparam,
|  | LPARAM const | lparam
| ) |  |
| protected noexcept

Definition at line 556 of file flutter_window.cc.

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

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 452 of file flutter_window.cc.

454 {
455 Destroy();
456 std::wstring converted_title = NarrowToWide(title);
457
458 WNDCLASS window_class = RegisterWindowClass(converted_title);
459
460 auto* result = CreateWindowEx(
461 0, window_class.lpszClassName, converted_title.c_str(),
462 WS_CHILD | WS_VISIBLE, CW_DEFAULT, CW_DEFAULT, width, height,
463 HWND_MESSAGE, nullptr, window_class.hInstance, this);
464
465 if (result == nullptr) {
466 auto error = GetLastError();
467 LPWSTR message = nullptr;
468 size_t size = FormatMessageW(
469 FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
470 FORMAT_MESSAGE_IGNORE_INSERTS,
471 NULL, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
472 reinterpret_cast<LPWSTR>(&message), 0, NULL);
473 OutputDebugString(message);
474 LocalFree(message);
475 }
476 SetUserObjectInformationA(GetCurrentProcess(),
477 UOI_TIMERPROC_EXCEPTION_SUPPRESSION, FALSE, 1);
478 // SetTimer is not precise, if a 16 ms interval is requested, it will instead
479 // often fire in an interval of 32 ms. Providing a value of 14 will ensure it
480 // runs every 16 ms, which will allow for 60 Hz trackpad gesture events, which
481 // is the maximal frequency supported by SetTimer.
482 SetTimer(result, kDirectManipulationTimer, 14, nullptr);
483 direct_manipulation_owner_ = std::make_unique<DirectManipulationOwner>(this);
484 direct_manipulation_owner_->Init(width, height);
485 }

References direct_manipulation_owner_, message, and NarrowToWide().

Referenced by FlutterWindow().

## ◆ IsVisible()

bool flutter::FlutterWindow::IsVisible | ( |  | ) |
| override virtual

Implements flutter::WindowBindingHandler.

Definition at line 179 of file flutter_window.cc.

179 {
180 return IsWindowVisible(GetWindowHandle());
181 }

References GetWindowHandle().

## ◆ NarrowToWide()

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

Definition at line 509 of file flutter_window.cc.

509 {
510 size_t length = strlen(source);
511 size_t outlen = 0;
512 std::wstring wideTitle(length, L'#');
513 mbstowcs_s(&outlen, &wideTitle[0], length + 1, source, length);
514 return wideTitle;
515 }

Referenced by InitializeChild().

## ◆ NeedsVSync()

bool flutter::FlutterWindow::NeedsVSync | ( |  | ) |
| override virtual

Implements flutter::WindowBindingHandler.

Definition at line 381 of file flutter_window.cc.

381 {
382 // If the Desktop Window Manager composition is enabled,
383 // the system itself synchronizes with v-sync.
384 // See: https://learn.microsoft.com/windows/win32/dwm/composition-ovw
385 BOOL composition_enabled;
386 if (SUCCEEDED(::DwmIsCompositionEnabled(&composition_enabled))) {
387 return !composition_enabled;
388 }
389
390 return true;
391 }

## ◆ OnBitmapSurfaceUpdated()

bool flutter::FlutterWindow::OnBitmapSurfaceUpdated | ( | const void * | allocation,
|  | size_t | row_bytes,
|  | size_t | height
| ) |  |
| override virtual

Implements flutter::WindowBindingHandler.

Definition at line 325 of file flutter_window.cc.

327 {
328 HDC dc = ::GetDC(GetWindowHandle());
329 BITMAPINFO bmi = {};
330 bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
331 bmi.bmiHeader.biWidth = row_bytes / 4;
332 bmi.bmiHeader.biHeight = -height;
333 bmi.bmiHeader.biPlanes = 1;
334 bmi.bmiHeader.biBitCount = 32;
335 bmi.bmiHeader.biCompression = BI_RGB;
336 bmi.bmiHeader.biSizeImage = 0;
337 int ret = SetDIBitsToDevice(dc, 0, 0, row_bytes / 4, height, 0, 0, 0, height,
338 allocation, &bmi, DIB_RGB_COLORS);
339 ::ReleaseDC(GetWindowHandle(), dc);
340 return ret != 0;
341 }

References GetWindowHandle().

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

## ◆ OnComposeBegin()

void flutter::FlutterWindow::OnComposeBegin | ( |  | ) |
| virtual

Definition at line 279 of file flutter_window.cc.

279 {
280 binding_handler_delegate_->OnComposeBegin();
281 }

References flutter::WindowBindingHandlerDelegate::OnComposeBegin().

Referenced by OnImeStartComposition().

## ◆ OnComposeChange()

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

Definition at line 291 of file flutter_window.cc.

292 {
293 binding_handler_delegate_->OnComposeChange(text, cursor_pos);
294 }

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

Referenced by OnImeComposition().

## ◆ OnComposeCommit()

void flutter::FlutterWindow::OnComposeCommit | ( |  | ) |
| virtual

Definition at line 283 of file flutter_window.cc.

283 {
284 binding_handler_delegate_->OnComposeCommit();
285 }

References flutter::WindowBindingHandlerDelegate::OnComposeCommit().

Referenced by OnImeComposition().

## ◆ OnComposeEnd()

void flutter::FlutterWindow::OnComposeEnd | ( |  | ) |
| virtual

Definition at line 287 of file flutter_window.cc.

287 {
288 binding_handler_delegate_->OnComposeEnd();
289 }

References flutter::WindowBindingHandlerDelegate::OnComposeEnd().

Referenced by OnImeEndComposition().

## ◆ OnCursorRectUpdated()

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

Implements flutter::WindowBindingHandler.

Definition at line 313 of file flutter_window.cc.

313 {
314 // Convert the rect from Flutter logical coordinates to device coordinates.
315 auto scale = GetDpiScale();
316 Point origin(rect.left() * scale, rect.top() * scale);
317 Size size(rect.width() * scale, rect.height() * scale);
318 UpdateCursorRect(Rect(origin, size));
319 }

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 202 of file flutter_window.cc.

202 {};

## ◆ OnGetObject()

LRESULT flutter::FlutterWindow::OnGetObject | ( | UINT const | message,
|  | WPARAM const | wparam,
|  | LPARAM const | lparam
| ) |  |
| protected virtual

Definition at line 808 of file flutter_window.cc.

810 {
811 LRESULT reference_result = static_cast<LRESULT>(0L);
812
813 // Only the lower 32 bits of lparam are valid when checking the object id
814 // because it sometimes gets sign-extended incorrectly (but not always).
815 DWORD obj_id = static_cast<DWORD>(static_cast<DWORD_PTR>(lparam));
816
817 bool is_uia_request = static_cast<DWORD>(UiaRootObjectId) == obj_id;
818 bool is_msaa_request = static_cast<DWORD>(OBJID_CLIENT) == obj_id;
819
820 if (is_uia_request || is_msaa_request) {
821 // On Windows, we don't get a notification that the screen reader has been
822 // enabled or disabled. There is an API to query for screen reader state,
823 // but that state isn't set by all screen readers, including by Narrator,
824 // the screen reader that ships with Windows:
825 // https://docs.microsoft.com/en-us/windows/win32/winauto/screen-reader-parameter
826 //
827 // Instead, we enable semantics in Flutter if Windows issues queries for
828 // Microsoft Active Accessibility (MSAA) COM objects.
829 OnUpdateSemanticsEnabled(true);
830 }
831
832 gfx::NativeViewAccessible root_view = GetNativeViewAccessible();
833 // TODO(schectman): UIA is currently disabled by default.
834 // https://github.com/flutter/flutter/issues/114547
835 if (root_view) {
836 CreateAxFragmentRoot();
837 if (is_uia_request) {
838 #ifdef FLUTTER_ENGINE_USE_UIA
839 // Retrieve UIA object for the root view.
840 Microsoft::WRL::ComPtr<IRawElementProviderSimple> root;
841 if (SUCCEEDED(
842 ax_fragment_root_->GetNativeViewAccessible()->QueryInterface(
843 IID_PPV_ARGS(&root)))) {
844 // Return the UIA object via UiaReturnRawElementProvider(). See:
845 // https://docs.microsoft.com/en-us/windows/win32/winauto/wm-getobject
846 reference_result = UiaReturnRawElementProvider(window_handle_, wparam,
847 lparam, root.Get());
848 } else {
849 FML_LOG(ERROR) << "Failed to query AX fragment root.";
850 }
851 #endif // FLUTTER_ENGINE_USE_UIA
852 } else if (is_msaa_request) {
853 // Create the accessibility root if it does not already exist.
854 // Return the IAccessible for the root view.
855 Microsoft::WRL::ComPtr<IAccessible> root;
856 ax_fragment_root_->GetNativeViewAccessible()->QueryInterface(
857 IID_PPV_ARGS(&root));
858 reference_result = LresultFromObject(IID_IAccessible, wparam, root.Get());
859 }
860 }
861 return reference_result;
862 }

References GetNativeViewAccessible(), and OnUpdateSemanticsEnabled().

## ◆ OnImeComposition()

void flutter::FlutterWindow::OnImeComposition | ( | UINT const | message,
|  | WPARAM const | wparam,
|  | LPARAM const | lparam
| ) |  |
| protected virtual

Definition at line 879 of file flutter_window.cc.

881 {
882 // Update the IME window position.
883 text_input_manager_->UpdateImeWindow();
884
885 if (lparam == 0) {
886 OnComposeChange(u"", 0);
887 OnComposeCommit();
888 }
889
890 // Process GCS_RESULTSTR at fisrt, because Google Japanese Input and ATOK send
891 // both GCS_RESULTSTR and GCS_COMPSTR to commit composed text and send new
892 // composing text.
893 if (lparam & GCS_RESULTSTR) {
894 // Commit but don't end composing.
895 // Read the committed composing string.
896 long pos = text_input_manager_->GetComposingCursorPosition();
897 std::optional<std::u16string> text = text_input_manager_->GetResultString();
898 if (text) {
899 OnComposeChange(text.value(), pos);
900 OnComposeCommit();
901 }
902 }
903 if (lparam & GCS_COMPSTR) {
904 // Read the in-progress composing string.
905 long pos = text_input_manager_->GetComposingCursorPosition();
906 std::optional<std::u16string> text =
907 text_input_manager_->GetComposingString();
908 if (text) {
909 OnComposeChange(text.value(), pos);
910 }
911 }
912 }

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

## ◆ OnImeEndComposition()

void flutter::FlutterWindow::OnImeEndComposition | ( | UINT const | message,
|  | WPARAM const | wparam,
|  | LPARAM const | lparam
| ) |  |
| protected virtual

Definition at line 914 of file flutter_window.cc.

916 {
917 text_input_manager_->DestroyImeWindow();
918 OnComposeEnd();
919 }

References OnComposeEnd().

## ◆ OnImeRequest()

void flutter::FlutterWindow::OnImeRequest | ( | UINT const | message,
|  | WPARAM const | wparam,
|  | LPARAM const | lparam
| ) |  |
| protected virtual

Definition at line 921 of file flutter_window.cc.

923 {
924 // TODO(cbracken): Handle IMR_RECONVERTSTRING, IMR_DOCUMENTFEED,
925 // and IMR_QUERYCHARPOSITION messages.
926 // https://github.com/flutter/flutter/issues/74547
927 }

## ◆ OnImeSetContext()

void flutter::FlutterWindow::OnImeSetContext | ( | UINT const | message,
|  | WPARAM const | wparam,
|  | LPARAM const | lparam
| ) |  |
| protected virtual

Definition at line 864 of file flutter_window.cc.

866 {
867 if (wparam != 0) {
868 text_input_manager_->CreateImeWindow();
869 }
870 }

## ◆ OnImeStartComposition()

void flutter::FlutterWindow::OnImeStartComposition | ( | UINT const | message,
|  | WPARAM const | wparam,
|  | LPARAM const | lparam
| ) |  |
| protected virtual

Definition at line 872 of file flutter_window.cc.

874 {
875 text_input_manager_->CreateImeWindow();
876 OnComposeBegin();
877 }

References OnComposeBegin().

## ◆ OnKey()

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

Implements flutter::KeyboardManager::WindowDelegate.

Definition at line 268 of file flutter_window.cc.

274 {
275 binding_handler_delegate_->OnKey(key, scancode, action, character, extended,
276 was_down, std::move(callback));
277 }

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

## ◆ OnPaint()

void flutter::FlutterWindow::OnPaint | ( |  | ) |
| virtual

Definition at line 212 of file flutter_window.cc.

212 {
213 if (binding_handler_delegate_ != nullptr) {
214 binding_handler_delegate_->OnWindowRepaint();
215 }
216 }

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 227 of file flutter_window.cc.

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

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 253 of file flutter_window.cc.

256 {
257 binding_handler_delegate_->OnPointerLeave(x, y, device_kind, device_id);
258 }

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 218 of file flutter_window.cc.

222 {
223 binding_handler_delegate_->OnPointerMove(x, y, device_kind, device_id,
224 modifiers_state);
225 }

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 240 of file flutter_window.cc.

244 {
245 uint64_t flutter_button = ConvertWinButtonToFlutterButton(button);
246 if (flutter_button != 0) {
247 binding_handler_delegate_->OnPointerUp(
248 x, y, device_kind, device_id,
249 static_cast<FlutterPointerMouseButtons>(flutter_button));
250 }
251 }

References flutter::WindowBindingHandlerDelegate::OnPointerUp().

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

## ◆ OnResetImeComposing()

void flutter::FlutterWindow::OnResetImeComposing | ( |  | ) |
| override virtual

Implements flutter::WindowBindingHandler.

Definition at line 321 of file flutter_window.cc.

321 {
322 AbortImeComposing();
323 }

References AbortImeComposing().

## ◆ OnResize()

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

Definition at line 206 of file flutter_window.cc.

206 {
207 if (binding_handler_delegate_ != nullptr) {
208 binding_handler_delegate_->OnWindowSizeChanged(width, height);
209 }
210 }

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 300 of file flutter_window.cc.

303 {
304 POINT point;
305 GetCursorPos(&point);
306
307 ScreenToClient(GetWindowHandle(), &point);
308 binding_handler_delegate_->OnScroll(point.x, point.y, delta_x, delta_y,
309 GetScrollOffsetMultiplier(), device_kind,
310 device_id);
311 }

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

## ◆ OnSetCursor()

void flutter::FlutterWindow::OnSetCursor | ( |  | ) |
| virtual

Definition at line 260 of file flutter_window.cc.

260 {
261 ::SetCursor(current_cursor_);
262 }

## ◆ OnText()

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

Implements flutter::KeyboardManager::WindowDelegate.

Definition at line 264 of file flutter_window.cc.

264 {
265 binding_handler_delegate_->OnText(text);
266 }

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

## ◆ OnThemeChange()

void flutter::FlutterWindow::OnThemeChange | ( |  | ) |
| virtual

Definition at line 358 of file flutter_window.cc.

358 {
359 binding_handler_delegate_->UpdateHighContrastEnabled(
360 GetHighContrastEnabled());
361 }

References GetHighContrastEnabled(), and flutter::WindowBindingHandlerDelegate::UpdateHighContrastEnabled().

Referenced by SendInitialAccessibilityFeatures().

## ◆ OnUpdateSemanticsEnabled()

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

Definition at line 296 of file flutter_window.cc.

296 {
297 binding_handler_delegate_->OnUpdateSemanticsEnabled(enabled);
298 }

References flutter::WindowBindingHandlerDelegate::OnUpdateSemanticsEnabled().

Referenced by OnGetObject().

## ◆ OnWindowResized()

void flutter::FlutterWindow::OnWindowResized | ( |  | ) |
| override virtual

Implements flutter::WindowBindingHandler.

Definition at line 196 of file flutter_window.cc.

196 {
197 // Blocking the raster thread until DWM flushes alleviates glitches where
198 // previous size surface is stretched over current size view.
199 DwmFlush();
200 }

## ◆ OnWindowStateEvent()

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

Definition at line 393 of file flutter_window.cc.

393 {
394 switch (event) {
395 case WindowStateEvent::kShow:
396 restored_ = true;
397 break;
398 case WindowStateEvent::kHide:
399 restored_ = false;
400 focused_ = false;
401 break;
402 case WindowStateEvent::kFocus:
403 focused_ = true;
404 break;
405 case WindowStateEvent::kUnfocus:
406 focused_ = false;
407 break;
408 }
409 HWND hwnd = GetPlatformWindow();
410 if (hwnd && binding_handler_delegate_) {
411 binding_handler_delegate_->OnWindowStateEvent(hwnd, event);
412 }
413 }

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

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

## ◆ SendInitialAccessibilityFeatures()

void flutter::FlutterWindow::SendInitialAccessibilityFeatures | ( |  | ) |
| override virtual

Implements flutter::WindowBindingHandler.

Definition at line 363 of file flutter_window.cc.

363 {
364 OnThemeChange();
365 }

References OnThemeChange().

## ◆ SetFlutterCursor()

void flutter::FlutterWindow::SetFlutterCursor | ( | HCURSOR | cursor | ) |
| override virtual

Implements flutter::WindowBindingHandler.

Definition at line 191 of file flutter_window.cc.

191 {
192 current_cursor_ = cursor;
193 ::SetCursor(current_cursor_);
194 }

## ◆ SetView()

void flutter::FlutterWindow::SetView | ( | WindowBindingHandlerDelegate * | view | ) |
| override virtual

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) {
160 OnWindowStateEvent(WindowStateEvent::kShow);
161 }
162 if (focused_ && window) {
163 OnWindowStateEvent(WindowStateEvent::kFocus);
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 | ) |
| protected virtual

Definition at line 933 of file flutter_window.cc.

933 {
934 text_input_manager_->UpdateCaretRect(rect);
935 }

Referenced by OnCursorRectUpdated().

## ◆ UpdateFlutterCursor()

void flutter::FlutterWindow::UpdateFlutterCursor | ( | const std::string & | cursor_name | ) |
| override virtual

Implements flutter::WindowBindingHandler.

Definition at line 187 of file flutter_window.cc.

187 {
188 current_cursor_ = GetCursorByName(cursor_name);
189 }

## ◆ Win32DefWindowProc()

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

Definition at line 966 of file flutter_window.cc.

969 {
970 return ::DefWindowProc(hWnd, Msg, wParam, lParam);
971 }

## ◆ Win32DispatchMessage()

UINT flutter::FlutterWindow::Win32DispatchMessage | ( | UINT | Msg,
|  | WPARAM | wParam,
|  | LPARAM | lParam
| ) |  |
| override virtual

Implements flutter::KeyboardManager::WindowDelegate.

Definition at line 503 of file flutter_window.cc.

505 {
506 return ::SendMessage(window_handle_, Msg, wParam, lParam);
507 }

## ◆ Win32MapVkToChar()

uint32_t flutter::FlutterWindow::Win32MapVkToChar | ( | uint32_t | virtual_key | ) |
| override virtual

Implements flutter::KeyboardManager::WindowDelegate.

Definition at line 499 of file flutter_window.cc.

499 {
500 return ::MapVirtualKey(virtual_key, MAPVK_VK_TO_CHAR);
501 }

## ◆ Win32PeekMessage()

BOOL flutter::FlutterWindow::Win32PeekMessage | ( | LPMSG | lpMsg,
|  | UINT | wMsgFilterMin,
|  | UINT | wMsgFilterMax,
|  | UINT | wRemoveMsg
| ) |  |
| override virtual

Implements flutter::KeyboardManager::WindowDelegate.

Definition at line 491 of file flutter_window.cc.

494 {
495 return ::PeekMessage(lpMsg, window_handle_, wMsgFilterMin, wMsgFilterMax,
496 wRemoveMsg);
497 }

## Friends And Related Function Documentation

## ◆ WindowAXFragmentRootDelegate

friend class WindowAXFragmentRootDelegate
| friend

Definition at line 399 of file flutter_window.h.

## Member Data Documentation

## ◆ alert_delegate_

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

Definition at line 288 of file flutter_window.h.

Referenced by GetAlertDelegate().

## ◆ alert_node_

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

Definition at line 291 of file flutter_window.h.

Referenced by GetAlert().

## ◆ direct_manipulation_owner_

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

Definition at line 295 of file flutter_window.h.

Referenced by InitializeChild(), and SetView().

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

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

flutter::WindowBindingHandlerDelegate::OnWindowRepaint
virtual void OnWindowRepaint()=0
flutter::FlutterWindow::GetCurrentHeight
UINT GetCurrentHeight()
Definition: flutter_window.cc:945
flutter::WindowStateEvent::kHide
@ kHide
flutter::FlutterWindow::OnComposeBegin
virtual void OnComposeBegin()
Definition: flutter_window.cc:279
scancode
int scancode
Definition: keyboard_key_handler_unittests.cc:115
flutter::FlutterWindow::GetDpiScale
virtual float GetDpiScale() override
Definition: flutter_window.cc:175
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:358
flutter::FlutterWindow::OnPointerDown
virtual void OnPointerDown(double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id, UINT button)
Definition: flutter_window.cc:227
flutter::FlutterWindow::GetHighContrastEnabled
virtual bool GetHighContrastEnabled()
Definition: flutter_window.cc:953
character
char32_t character
Definition: keyboard_key_handler_unittests.cc:117
flutter::FlutterWindow::GetCurrentWidth
UINT GetCurrentWidth()
Definition: flutter_window.cc:941
flutter::FlutterWindow::NarrowToWide
std::wstring NarrowToWide(const char *source)
Definition: flutter_window.cc:509
flutter::WindowsRenderTarget
std::variant< HWND > WindowsRenderTarget
Definition: window_binding_handler.h:44
flutter::FlutterWindow::OnImeEndComposition
virtual void OnImeEndComposition(UINT const message, WPARAM const wparam, LPARAM const lparam)
Definition: flutter_window.cc:914
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:808
flutter::FlutterWindow::InitializeChild
void InitializeChild(const char *title, unsigned int width, unsigned int height)
Definition: flutter_window.cc:452
flutter::FlutterWindow::AbortImeComposing
virtual void AbortImeComposing()
Definition: flutter_window.cc:929
flutter::WindowBindingHandlerDelegate::GetAxFragmentRootDelegate
virtual ui::AXFragmentRootDelegateWin * GetAxFragmentRootDelegate()=0
flutter::FlutterWindow::GetWindowHandle
HWND GetWindowHandle()
Definition: flutter_window.cc:487
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:218
flutter::FlutterWindow::direct_manipulation_owner_
std::unique_ptr< DirectManipulationOwner > direct_manipulation_owner_
Definition: flutter_window.h:295
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:253
flutter::FlutterWindow::GetCurrentDPI
UINT GetCurrentDPI()
Definition: flutter_window.cc:937
flutter::FlutterWindow::OnUpdateSemanticsEnabled
virtual void OnUpdateSemanticsEnabled(bool enabled)
Definition: flutter_window.cc:296
flutter::FlutterWindow::OnPointerUp
virtual void OnPointerUp(double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id, UINT button)
Definition: flutter_window.cc:240
flutter::FlutterWindow::GetNativeViewAccessible
virtual gfx::NativeViewAccessible GetNativeViewAccessible()
Definition: flutter_window.cc:343
flutter::FlutterWindow::OnImeSetContext
virtual void OnImeSetContext(UINT const message, WPARAM const wparam, LPARAM const lparam)
Definition: flutter_window.cc:864
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:291
flutter::WindowStateEvent::kShow
@ kShow
flutter::FlutterWindow::OnImeStartComposition
virtual void OnImeStartComposition(UINT const message, WPARAM const wparam, LPARAM const lparam)
Definition: flutter_window.cc:872
flutter::FlutterWindow::OnPaint
virtual void OnPaint()
Definition: flutter_window.cc:212
flutter::FlutterWindow::GetPlatformWindow
virtual PlatformWindow GetPlatformWindow() override
Definition: flutter_window.cc:171
flutter::FlutterWindow::OnSetCursor
virtual void OnSetCursor()
Definition: flutter_window.cc:260
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:393
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:283
flutter::WindowBindingHandlerDelegate::UpdateHighContrastEnabled
virtual void UpdateHighContrastEnabled(bool enabled)=0
flutter::FlutterWindow::alert_node_
std::unique_ptr< ui::AXPlatformNodeWin > alert_node_
Definition: flutter_window.h:291
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:921
flutter::WindowStateEvent::kUnfocus
@ kUnfocus
flutter::FlutterWindow::GetScrollOffsetMultiplier
virtual float GetScrollOffsetMultiplier()
Definition: flutter_window.cc:949
flutter::FlutterWindow::Win32DefWindowProc
virtual LRESULT Win32DefWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: flutter_window.cc:966
flutter::FlutterWindow::OnScroll
virtual void OnScroll(double delta_x, double delta_y, FlutterPointerDeviceKind device_kind, int32_t device_id)
Definition: flutter_window.cc:300
flutter::FlutterWindow::OnImeComposition
virtual void OnImeComposition(UINT const message, WPARAM const wparam, LPARAM const lparam)
Definition: flutter_window.cc:879
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:287
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:288
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:202
callback
FlutterDesktopBinaryReply callback
Definition: flutter_windows_view_unittests.cc:46
flutter::FlutterWindow::UpdateCursorRect
virtual void UpdateCursorRect(const Rect &rect)
Definition: flutter_window.cc:933