13 #include "flutter/fml/logging.h"
14 #include "flutter/shell/platform/embedder/embedder.h"
27 constexpr
int base_dpi = 96;
29 static const int kMinTouchDeviceId = 0;
30 static const int kMaxTouchDeviceId = 128;
32 static const int kLinesPerScrollWindowsDefault = 3;
34 static constexpr int32_t kDefaultPointerDeviceId = 0;
36 static int GetCursorPositionForComposition(
const TextInputManager& manager,
39 if (!(lparam & GCS_CURSORPOS)) {
43 return static_cast<int>(text_length);
46 int position =
static_cast<int>(manager.GetComposingCursorPosition());
47 if (position < 0 ||
static_cast<size_t>(position) > text_length) {
48 return static_cast<int>(text_length);
50 return static_cast<int>(position);
57 static FlutterPointerDeviceKind GetFlutterPointerDeviceKind() {
58 constexpr LPARAM kTouchOrPenSignature = 0xFF515700;
59 constexpr LPARAM kTouchSignature = kTouchOrPenSignature | 0x80;
60 constexpr LPARAM kSignatureMask = 0xFFFFFF00;
61 LPARAM info = GetMessageExtraInfo();
62 if ((info & kSignatureMask) == kTouchOrPenSignature) {
63 if ((info & kTouchSignature) == kTouchSignature) {
64 return kFlutterPointerDeviceKindTouch;
66 return kFlutterPointerDeviceKindStylus;
68 return kFlutterPointerDeviceKindMouse;
72 static uint64_t ConvertWinButtonToFlutterButton(UINT button) {
76 return kFlutterPointerButtonMousePrimary;
79 return kFlutterPointerButtonMouseSecondary;
82 return kFlutterPointerButtonMouseMiddle;
84 return kFlutterPointerButtonMouseBack;
86 return kFlutterPointerButtonMouseForward;
88 FML_LOG(WARNING) <<
"Mouse button not recognized: " << button;
93 static uint64_t ConvertWinMouseStateToFlutterButtons(WPARAM wparam) {
94 uint64_t flutter_buttons = 0;
95 if (wparam & MK_LBUTTON) {
96 flutter_buttons |= kFlutterPointerButtonMousePrimary;
98 if (wparam & MK_RBUTTON) {
99 flutter_buttons |= kFlutterPointerButtonMouseSecondary;
101 if (wparam & MK_MBUTTON) {
102 flutter_buttons |= kFlutterPointerButtonMouseMiddle;
104 if (wparam & MK_XBUTTON1) {
105 flutter_buttons |= kFlutterPointerButtonMouseBack;
107 if (wparam & MK_XBUTTON2) {
108 flutter_buttons |= kFlutterPointerButtonMouseForward;
110 return flutter_buttons;
114 static uint64_t ConvertWinStylusFlagsToFlutterButtons(UINT pen_flags,
115 UINT pointer_flags) {
116 uint64_t flutter_buttons = 0;
117 if ((pointer_flags & POINTER_FLAG_INCONTACT) == 0) {
118 return flutter_buttons;
120 flutter_buttons |= kFlutterPointerButtonStylusContact;
121 if (pen_flags & PEN_FLAG_BARREL) {
122 flutter_buttons |= kFlutterPointerButtonStylusPrimary;
124 if (pen_flags & PEN_FLAG_ERASER) {
125 flutter_buttons |= kFlutterPointerButtonStylusSecondary;
127 return flutter_buttons;
131 static uint64_t ConvertWinPointerFlagsToFlutterButtons(UINT flags) {
132 uint64_t flutter_buttons = 0;
133 if ((flags & POINTER_FLAG_INCONTACT) == 0) {
135 return flutter_buttons;
137 if (flags & POINTER_FLAG_FIRSTBUTTON) {
138 flutter_buttons |= kFlutterPointerButtonMousePrimary;
140 if (flags & POINTER_FLAG_SECONDBUTTON) {
141 flutter_buttons |= kFlutterPointerButtonMouseSecondary;
143 if (flags & POINTER_FLAG_THIRDBUTTON) {
144 flutter_buttons |= kFlutterPointerButtonMouseMiddle;
146 return flutter_buttons;
155 std::shared_ptr<WindowsProcTable> windows_proc_table,
156 std::unique_ptr<TextInputManager> text_input_manager)
157 : touch_id_generator_(kMinTouchDeviceId, kMaxTouchDeviceId),
159 windows_proc_table_(std::move(windows_proc_table)),
160 text_input_manager_(std::move(text_input_manager)),
161 ax_fragment_root_(nullptr) {
170 UpdateScrollOffsetMultiplier();
172 if (windows_proc_table_ ==
nullptr) {
173 windows_proc_table_ = std::make_unique<WindowsProcTable>();
175 if (text_input_manager_ ==
nullptr) {
176 text_input_manager_ = std::make_unique<TextInputManager>();
178 keyboard_manager_ = std::make_unique<KeyboardManager>(
this);
185 : touch_id_generator_(kMinTouchDeviceId, kMaxTouchDeviceId) {}
192 binding_handler_delegate_ = window;
196 if (restored_ && window) {
199 if (focused_ && window) {
205 return static_cast<float>(
GetCurrentDPI()) /
static_cast<float>(base_dpi);
214 if (hwnd ==
nullptr) {
218 HWND prevFocus = ::SetFocus(hwnd);
219 if (prevFocus ==
nullptr) {
231 if (binding_handler_delegate_ !=
nullptr) {
237 if (binding_handler_delegate_ !=
nullptr) {
244 FlutterPointerDeviceKind device_kind,
249 int modifiers_state) {
250 binding_handler_delegate_->
OnPointerMove(x, y, device_kind, device_id,
251 buttons, rotation, pressure,
257 FlutterPointerDeviceKind device_kind,
263 binding_handler_delegate_->
OnPointerDown(x, y, device_kind, device_id,
264 buttons, rotation, pressure);
270 FlutterPointerDeviceKind device_kind,
273 binding_handler_delegate_->
OnPointerUp(x, y, device_kind, device_id, buttons);
278 FlutterPointerDeviceKind device_kind,
280 binding_handler_delegate_->
OnPointerLeave(x, y, device_kind, device_id);
321 FlutterPointerDeviceKind device_kind,
324 GetCursorPos(&point);
327 binding_handler_delegate_->
OnScroll(point.x, point.y, delta_x, delta_y,
335 Point origin(rect.left() * scale, rect.top() * scale);
336 Size size(rect.width() * scale, rect.height() * scale);
346 bool result = ::PatBlt(dc, 0, 0, current_width_, current_height_, BLACKNESS);
356 bmi.bmiHeader.biSize =
sizeof(BITMAPINFOHEADER);
357 bmi.bmiHeader.biWidth = row_bytes / 4;
358 bmi.bmiHeader.biHeight = -height;
359 bmi.bmiHeader.biPlanes = 1;
360 bmi.bmiHeader.biBitCount = 32;
361 bmi.bmiHeader.biCompression = BI_RGB;
362 bmi.bmiHeader.biSizeImage = 0;
363 int ret = ::SetDIBitsToDevice(dc, 0, 0, row_bytes / 4, height, 0, 0, 0,
364 height, allocation, &bmi, DIB_RGB_COLORS);
370 if (binding_handler_delegate_ ==
nullptr) {
379 GetCursorPos(&point);
381 return {(size_t)point.x, (
size_t)point.y};
385 FlutterEngineDisplayId
const display_id =
386 reinterpret_cast<FlutterEngineDisplayId
>(
388 if (!display_manager_->FindById(display_id)) {
389 FML_LOG(ERROR) <<
"Current monitor not found in display list.";
403 CreateAxFragmentRoot();
408 CreateAxFragmentRoot();
423 if (binding_handler_delegate_) {
424 binding_handler_delegate_->
OnFocus(
425 FlutterViewFocusState::kFocused,
426 FlutterViewFocusDirection::kUndefined);
431 if (binding_handler_delegate_) {
432 binding_handler_delegate_->
OnFocus(
433 FlutterViewFocusState::kUnfocused,
434 FlutterViewFocusDirection::kUndefined);
439 if (hwnd && binding_handler_delegate_) {
444 void FlutterWindow::TrackMouseLeaveEvent(HWND hwnd) {
445 if (!tracking_mouse_leave_) {
447 tme.cbSize =
sizeof(tme);
448 tme.hwndTrack = hwnd;
449 tme.dwFlags = TME_LEAVE;
450 TrackMouseEvent(&tme);
451 tracking_mouse_leave_ =
true;
455 void FlutterWindow::HandleResize(UINT width, UINT height) {
456 current_width_ = width;
457 current_height_ = height;
464 FlutterWindow* FlutterWindow::GetThisFromHandle(HWND
const window) noexcept {
465 return reinterpret_cast<FlutterWindow*
>(
466 GetWindowLongPtr(window, GWLP_USERDATA));
469 void FlutterWindow::UpdateScrollOffsetMultiplier() {
470 UINT lines_per_scroll = kLinesPerScrollWindowsDefault;
473 SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &lines_per_scroll, 0);
477 scroll_offset_multiplier_ =
478 static_cast<float>(lines_per_scroll) * 100.0 / 3.0;
483 unsigned int height) {
487 WNDCLASS window_class = RegisterWindowClass(converted_title);
489 auto* result = CreateWindowEx(
490 0, window_class.lpszClassName, converted_title.c_str(),
491 WS_CHILD | WS_VISIBLE, CW_DEFAULT, CW_DEFAULT, width, height,
492 HWND_MESSAGE,
nullptr, window_class.hInstance,
this);
494 if (result ==
nullptr) {
495 auto error = GetLastError();
497 size_t size = FormatMessageW(
498 FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
499 FORMAT_MESSAGE_IGNORE_INSERTS,
500 NULL, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
501 reinterpret_cast<LPWSTR
>(&
message), 0, NULL);
505 SetUserObjectInformationA(GetCurrentProcess(),
506 UOI_TIMERPROC_EXCEPTION_SUPPRESSION, FALSE, 1);
511 SetTimer(result, kDirectManipulationTimer, 14,
nullptr);
517 return window_handle_;
524 return ::PeekMessage(lpMsg, window_handle_, wMsgFilterMin, wMsgFilterMax,
529 return ::MapVirtualKey(virtual_key, MAPVK_VK_TO_CHAR);
535 return ::SendMessage(window_handle_, Msg, wParam, lParam);
539 size_t length = strlen(source);
541 std::wstring wideTitle(length, L
'#');
542 mbstowcs_s(&outlen, &wideTitle[0], length + 1, source, length);
546 WNDCLASS FlutterWindow::RegisterWindowClass(std::wstring& title) {
547 window_class_name_ = title;
549 WNDCLASS window_class{};
550 window_class.hCursor = LoadCursor(
nullptr, IDC_ARROW);
551 window_class.lpszClassName = title.c_str();
552 window_class.style = CS_HREDRAW | CS_VREDRAW;
553 window_class.cbClsExtra = 0;
554 window_class.cbWndExtra = 0;
555 window_class.hInstance = GetModuleHandle(
nullptr);
556 window_class.hIcon =
nullptr;
557 window_class.hbrBackground = 0;
558 window_class.lpszMenuName =
nullptr;
559 window_class.lpfnWndProc = WndProc;
560 RegisterClass(&window_class);
564 LRESULT CALLBACK FlutterWindow::WndProc(HWND
const window,
567 LPARAM
const lparam) noexcept {
569 auto cs =
reinterpret_cast<CREATESTRUCT*
>(lparam);
570 SetWindowLongPtr(window, GWLP_USERDATA,
571 reinterpret_cast<LONG_PTR
>(cs->lpCreateParams));
573 auto that =
static_cast<FlutterWindow*
>(cs->lpCreateParams);
574 that->window_handle_ = window;
575 that->text_input_manager_->SetWindowHandle(window);
576 }
else if (FlutterWindow* that = GetThisFromHandle(window)) {
577 return that->HandleMessage(
message, wparam, lparam);
580 return DefWindowProc(window,
message, wparam, lparam);
586 LPARAM
const lparam) noexcept {
587 LPARAM result_lparam = lparam;
588 int x_pos = 0, y_pos = 0;
589 UINT width = 0, height = 0;
590 UINT button_pressed = 0;
591 uint64_t flutter_button = 0;
592 FlutterPointerDeviceKind device_kind;
595 case kWmDpiChangedBeforeParent:
597 OnDpiScale(current_dpi_);
600 width = LOWORD(lparam);
601 height = HIWORD(lparam);
603 current_width_ = width;
604 current_height_ = height;
605 HandleResize(width, height);
614 case WM_POINTERUPDATE:
616 case WM_POINTERLEAVE: {
617 POINT pt = {GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam)};
618 ScreenToClient(window_handle_, &pt);
619 auto const x =
static_cast<double>(pt.x);
620 auto const y =
static_cast<double>(pt.y);
621 auto const pointerId = GET_POINTERID_WPARAM(wparam);
622 POINTER_INFO pointerInfo;
623 if (windows_proc_table_->GetPointerInfo(pointerId, &pointerInfo)) {
626 bool is_inverted =
false;
628 ConvertWinPointerFlagsToFlutterButtons(pointerInfo.pointerFlags);
629 if (pointerInfo.pointerType == PT_PEN) {
630 POINTER_PEN_INFO penInfo;
631 if (windows_proc_table_->GetPointerPenInfo(pointerId, &penInfo)) {
632 pressure = penInfo.pressure;
633 rotation = penInfo.rotation;
634 is_inverted = (penInfo.penFlags & PEN_FLAG_INVERTED) != 0;
635 flutter_button = ConvertWinStylusFlagsToFlutterButtons(
636 penInfo.penFlags, pointerInfo.pointerFlags);
639 auto touch_id = touch_id_generator_.GetGeneratedId(pointerId);
640 FlutterPointerDeviceKind device_kind = kFlutterPointerDeviceKindMouse;
641 switch (pointerInfo.pointerType) {
643 device_kind = kFlutterPointerDeviceKindTouch;
646 device_kind = is_inverted ? kFlutterPointerDeviceKindInvertedStylus
647 : kFlutterPointerDeviceKindStylus;
650 device_kind = kFlutterPointerDeviceKindMouse;
653 device_kind = kFlutterPointerDeviceKindTrackpad;
656 FML_LOG(ERROR) <<
"Unrecognized device key "
657 << pointerInfo.pointerType;
660 if (
message == WM_POINTERDOWN) {
661 OnPointerDown(x, y, device_kind, touch_id, flutter_button, rotation,
663 }
else if (
message == WM_POINTERUPDATE) {
664 OnPointerMove(x, y, device_kind, touch_id, flutter_button, rotation,
667 }
else if (
message == WM_POINTERUP) {
668 OnPointerUp(x, y, device_kind, touch_id, flutter_button);
671 }
else if (
message == WM_POINTERLEAVE) {
672 OnPointerLeave(x, y, device_kind, touch_id);
673 touch_id_generator_.ReleaseNumber(pointerId);
679 device_kind = GetFlutterPointerDeviceKind();
680 if (device_kind == kFlutterPointerDeviceKindMouse) {
681 TrackMouseLeaveEvent(window_handle_);
683 x_pos = GET_X_LPARAM(lparam);
684 y_pos = GET_Y_LPARAM(lparam);
685 mouse_x_ =
static_cast<double>(x_pos);
686 mouse_y_ =
static_cast<double>(y_pos);
689 if (wparam & MK_CONTROL) {
692 if (wparam & MK_SHIFT) {
704 auto buttons = ConvertWinMouseStateToFlutterButtons(wparam);
705 if (buttons != 0 && GetCapture() != window_handle_) {
709 OnPointerMove(mouse_x_, mouse_y_, device_kind, kDefaultPointerDeviceId,
710 buttons, 0, 0, mods);
714 device_kind = GetFlutterPointerDeviceKind();
715 if (device_kind == kFlutterPointerDeviceKindMouse) {
716 OnPointerLeave(mouse_x_, mouse_y_, device_kind,
717 kDefaultPointerDeviceId);
723 tracking_mouse_leave_ =
false;
726 UINT hit_test_result = LOWORD(lparam);
727 if (hit_test_result == HTCLIENT) {
736 ::CreateCaret(window_handle_,
nullptr, 1, 1);
746 device_kind = GetFlutterPointerDeviceKind();
747 if (device_kind != kFlutterPointerDeviceKindMouse) {
754 SetCapture(window_handle_);
757 if (
message == WM_XBUTTONDOWN) {
758 button_pressed = GET_XBUTTON_WPARAM(wparam);
760 x_pos = GET_X_LPARAM(lparam);
761 y_pos = GET_Y_LPARAM(lparam);
762 flutter_button = ConvertWinButtonToFlutterButton(button_pressed);
764 OnPointerDown(
static_cast<double>(x_pos),
static_cast<double>(y_pos),
765 device_kind, kDefaultPointerDeviceId, flutter_button,
772 device_kind = GetFlutterPointerDeviceKind();
773 if (device_kind != kFlutterPointerDeviceKindMouse) {
779 button_pressed = GET_XBUTTON_WPARAM(wparam);
781 x_pos = GET_X_LPARAM(lparam);
782 y_pos = GET_Y_LPARAM(lparam);
783 flutter_button = ConvertWinButtonToFlutterButton(button_pressed);
791 if ((wparam & (MK_LBUTTON | MK_RBUTTON | MK_MBUTTON | MK_XBUTTON1 |
792 MK_XBUTTON2)) == 0) {
796 OnPointerUp(
static_cast<double>(x_pos),
static_cast<double>(y_pos),
797 device_kind, kDefaultPointerDeviceId, flutter_button);
801 -(
static_cast<short>(HIWORD(wparam)) /
802 static_cast<double>(WHEEL_DELTA)),
803 kFlutterPointerDeviceKindMouse, kDefaultPointerDeviceId);
806 OnScroll((
static_cast<short>(HIWORD(wparam)) /
807 static_cast<double>(WHEEL_DELTA)),
808 0.0, kFlutterPointerDeviceKindMouse, kDefaultPointerDeviceId);
811 LRESULT lresult = OnGetObject(
message, wparam, lparam);
818 if (wparam == kDirectManipulationTimer) {
819 direct_manipulation_owner_->Update();
823 case DM_POINTERHITTEST: {
824 if (direct_manipulation_owner_) {
825 UINT contact_id = GET_POINTERID_WPARAM(wparam);
826 POINTER_INPUT_TYPE pointer_type;
827 if (windows_proc_table_->GetPointerType(contact_id, &pointer_type) &&
828 pointer_type == PT_TOUCHPAD) {
829 direct_manipulation_owner_->SetContact(contact_id);
834 case WM_INPUTLANGCHANGE:
838 case WM_IME_SETCONTEXT:
839 OnImeSetContext(
message, wparam, lparam);
843 result_lparam &= ~ISC_SHOWUICOMPOSITIONWINDOW;
845 case WM_IME_STARTCOMPOSITION:
846 OnImeStartComposition(
message, wparam, lparam);
851 case WM_IME_COMPOSITION:
852 OnImeComposition(
message, wparam, lparam);
853 if (lparam & GCS_RESULTSTR || lparam & GCS_COMPSTR) {
862 case WM_IME_ENDCOMPOSITION:
863 OnImeEndComposition(
message, wparam, lparam);
866 OnImeRequest(
message, wparam, lparam);
870 if (wparam == UNICODE_NOCHAR)
875 case WM_THEMECHANGED:
886 if (keyboard_manager_->HandleMessage(
message, wparam, lparam)) {
897 return Win32DefWindowProc(window_handle_,
message, wparam, result_lparam);
902 LPARAM
const lparam) {
903 LRESULT reference_result =
static_cast<LRESULT
>(0L);
907 DWORD obj_id =
static_cast<DWORD
>(
static_cast<DWORD_PTR
>(lparam));
909 bool is_uia_request =
static_cast<DWORD
>(UiaRootObjectId) == obj_id;
910 bool is_msaa_request =
static_cast<DWORD
>(OBJID_CLIENT) == obj_id;
912 if (is_uia_request || is_msaa_request) {
928 CreateAxFragmentRoot();
929 if (is_uia_request) {
930 #ifdef FLUTTER_ENGINE_USE_UIA
932 Microsoft::WRL::ComPtr<IRawElementProviderSimple> root;
934 ax_fragment_root_->GetNativeViewAccessible()->QueryInterface(
935 IID_PPV_ARGS(&root)))) {
938 reference_result = UiaReturnRawElementProvider(window_handle_, wparam,
941 FML_LOG(ERROR) <<
"Failed to query AX fragment root.";
944 }
else if (is_msaa_request) {
947 Microsoft::WRL::ComPtr<IAccessible> root;
948 ax_fragment_root_->GetNativeViewAccessible()->QueryInterface(
949 IID_PPV_ARGS(&root));
950 reference_result = LresultFromObject(IID_IAccessible, wparam, root.Get());
953 return reference_result;
958 LPARAM
const lparam) {
960 text_input_manager_->CreateImeWindow();
966 LPARAM
const lparam) {
967 text_input_manager_->CreateImeWindow();
973 LPARAM
const lparam) {
975 text_input_manager_->UpdateImeWindow();
985 if (lparam & GCS_RESULTSTR) {
988 std::optional<std::u16string>
text = text_input_manager_->GetResultString();
990 int pos = GetCursorPositionForComposition(*text_input_manager_, lparam,
996 if (lparam & GCS_COMPSTR) {
998 std::optional<std::u16string>
text =
999 text_input_manager_->GetComposingString();
1001 int pos = GetCursorPositionForComposition(*text_input_manager_, lparam,
1009 WPARAM
const wparam,
1010 LPARAM
const lparam) {
1011 text_input_manager_->DestroyImeWindow();
1016 WPARAM
const wparam,
1017 LPARAM
const lparam) {
1024 text_input_manager_->AbortComposing();
1028 text_input_manager_->UpdateCaretRect(rect);
1032 return current_dpi_;
1036 return current_width_;
1040 return current_height_;
1044 return scroll_offset_multiplier_;
1051 return ::DefWindowProc(hWnd, Msg, wParam, lParam);
1054 void FlutterWindow::Destroy() {
1055 if (window_handle_) {
1056 text_input_manager_->SetWindowHandle(
nullptr);
1057 DestroyWindow(window_handle_);
1058 window_handle_ =
nullptr;
1061 UnregisterClass(window_class_name_.c_str(),
nullptr);
1064 void FlutterWindow::CreateAxFragmentRoot() {
1065 if (ax_fragment_root_) {
1068 ax_fragment_root_ = std::make_unique<ui::AXFragmentRootWin>(
1071 std::make_unique<AlertPlatformNodeDelegate>(*ax_fragment_root_);
1072 ui::AXPlatformNode* alert_node =
1074 alert_node_.reset(
static_cast<ui::AXPlatformNodeWin*
>(alert_node));
1075 ax_fragment_root_->SetAlertNode(
alert_node_.get());
virtual void OnCursorRectUpdated(const Rect &rect) override
virtual void OnPointerLeave(double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id)
virtual float GetScrollOffsetMultiplier()
virtual bool Focus() override
virtual ui::AXPlatformNodeWin * GetAlert() override
virtual void OnText(const std::u16string &text) override
virtual UINT Win32DispatchMessage(UINT Msg, WPARAM wParam, LPARAM lParam) override
virtual BOOL Win32PeekMessage(LPMSG lpMsg, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg) override
virtual void OnThemeChange()
std::unique_ptr< AlertPlatformNodeDelegate > alert_delegate_
virtual bool OnBitmapSurfaceUpdated(const void *allocation, size_t row_bytes, size_t height) override
virtual void OnPointerDown(double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id, uint64_t buttons, uint32_t rotation, uint32_t pressure)
virtual void OnImeRequest(UINT const message, WPARAM const wparam, LPARAM const lparam)
virtual void OnPointerMove(double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id, uint64_t buttons, uint32_t rotation, uint32_t pressure, int modifiers_state)
virtual LRESULT Win32DefWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
virtual void OnImeStartComposition(UINT const message, WPARAM const wparam, LPARAM const lparam)
virtual void OnPointerUp(double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id, uint64_t buttons)
std::wstring NarrowToWide(const char *source)
virtual FlutterEngineDisplayId GetDisplayId() override
virtual ui::AXFragmentRootDelegateWin * GetAxFragmentRootDelegate()
virtual void OnScroll(double delta_x, double delta_y, FlutterPointerDeviceKind device_kind, int32_t device_id)
void InitializeChild(const char *title, unsigned int width, unsigned int height)
virtual AlertPlatformNodeDelegate * GetAlertDelegate() override
std::unique_ptr< DirectManipulationOwner > direct_manipulation_owner_
virtual HWND GetWindowHandle() override
virtual void OnComposeCommit()
virtual void UpdateCursorRect(const Rect &rect)
virtual PhysicalWindowBounds GetPhysicalWindowBounds() override
virtual void OnImeSetContext(UINT const message, WPARAM const wparam, LPARAM const lparam)
virtual void OnWindowStateEvent(WindowStateEvent event)
virtual void OnKey(int key, int scancode, int action, char32_t character, bool extended, bool was_down, KeyEventCallback callback) override
std::unique_ptr< ui::AXPlatformNodeWin > alert_node_
virtual PointerLocation GetPrimaryPointerLocation() override
virtual void OnComposeEnd()
virtual void SetView(WindowBindingHandlerDelegate *view) override
LRESULT HandleMessage(UINT const message, WPARAM const wparam, LPARAM const lparam) noexcept
virtual void OnComposeChange(const std::u16string &text, int cursor_pos)
virtual void OnResetImeComposing() override
virtual uint32_t Win32MapVkToChar(uint32_t virtual_key) override
virtual void OnImeComposition(UINT const message, WPARAM const wparam, LPARAM const lparam)
virtual void OnDpiScale(unsigned int dpi)
virtual void AbortImeComposing()
virtual float GetDpiScale() override
virtual void OnUpdateSemanticsEnabled(bool enabled)
virtual LRESULT OnGetObject(UINT const message, WPARAM const wparam, LPARAM const lparam)
virtual gfx::NativeViewAccessible GetNativeViewAccessible()
virtual void OnComposeBegin()
virtual bool OnBitmapSurfaceCleared() override
virtual void OnResize(unsigned int width, unsigned int height)
virtual void OnImeEndComposition(UINT const message, WPARAM const wparam, LPARAM const lparam)
std::function< void(bool)> KeyEventCallback
virtual void OnComposeChange(const std::u16string &text, int cursor_pos)=0
virtual void OnHighContrastChanged()=0
virtual void OnText(const std::u16string &)=0
virtual void OnPointerLeave(double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id)=0
virtual void OnKey(int key, int scancode, int action, char32_t character, bool extended, bool was_down, KeyEventCallback callback)=0
virtual void OnUpdateSemanticsEnabled(bool enabled)=0
virtual void OnWindowStateEvent(HWND hwnd, WindowStateEvent event)=0
virtual ui::AXFragmentRootDelegateWin * GetAxFragmentRootDelegate()=0
virtual void OnComposeEnd()=0
virtual void OnWindowRepaint()=0
virtual gfx::NativeViewAccessible GetNativeViewAccessible()=0
virtual bool OnWindowSizeChanged(size_t width, size_t height)=0
virtual void OnComposeBegin()=0
virtual void OnPointerUp(double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id, uint64_t buttons)=0
virtual void OnFocus(FlutterViewFocusState focus_state, FlutterViewFocusDirection direction)=0
virtual void OnPointerDown(double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id, uint64_t buttons, uint32_t rotation, uint32_t pressure)=0
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
virtual void OnComposeCommit()=0
virtual void OnPointerMove(double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id, uint64_t buttons, uint32_t rotation, uint32_t pressure, int modifiers_state)=0
const DisplayManagerWin32 * display_manager
FlutterDesktopBinaryReply callback
UINT GetDpiForHWND(HWND hwnd)
WindowStateEvent
An event representing a change in window state that may update the.