|
Flutter Windows Embedder
|
|
Go to the documentation of this file.
5 #ifndef FLUTTER_SHELL_PLATFORM_WINDOWS_FLUTTER_WINDOW_H_
6 #define FLUTTER_SHELL_PLATFORM_WINDOWS_FLUTTER_WINDOW_H_
11 #include "flutter/fml/macros.h"
14 #include "flutter/shell/platform/embedder/embedder.h"
24 #include "flutter/third_party/accessibility/ax/platform/ax_fragment_root_delegate_win.h"
25 #include "flutter/third_party/accessibility/ax/platform/ax_fragment_root_win.h"
26 #include "flutter/third_party/accessibility/ax/platform/ax_platform_node_win.h"
27 #include "flutter/third_party/accessibility/gfx/native_widget_types.h"
41 std::shared_ptr<WindowsProcTable> windows_proc_table =
nullptr,
42 std::unique_ptr<TextInputManager> text_input_manager =
nullptr);
57 UINT wRemoveMsg)
override;
65 LPARAM lParam)
override;
73 virtual void OnResize(
unsigned int width,
unsigned int height);
82 FlutterPointerDeviceKind device_kind,
89 FlutterPointerDeviceKind device_kind,
97 FlutterPointerDeviceKind device_kind,
104 FlutterPointerDeviceKind device_kind,
111 virtual void OnText(
const std::u16string&
text)
override;
144 virtual void OnScroll(
double delta_x,
146 FlutterPointerDeviceKind device_kind,
176 size_t height)
override;
188 virtual ui::AXPlatformNodeWin*
GetAlert()
override;
217 LPARAM
const lparam) noexcept;
225 LPARAM
const lparam);
231 LPARAM
const lparam);
236 LPARAM
const lparam);
241 LPARAM
const lparam);
246 LPARAM
const lparam);
253 LPARAM
const lparam);
289 static LRESULT CALLBACK WndProc(HWND
const window,
292 LPARAM
const lparam) noexcept;
296 static const long kWmDpiChangedBeforeParent = 0x02E2;
299 static const int kDirectManipulationTimer = 1;
306 WNDCLASS RegisterWindowClass(std::wstring& title);
309 static FlutterWindow* GetThisFromHandle(HWND
const window) noexcept;
312 void TrackMouseLeaveEvent(HWND hwnd);
315 void HandleResize(UINT width, UINT height);
318 void UpdateScrollOffsetMultiplier();
323 void CreateAxFragmentRoot();
330 HCURSOR current_cursor_;
338 bool restored_ =
false;
339 bool focused_ =
false;
341 int current_dpi_ = 0;
342 int current_width_ = 0;
343 int current_height_ = 0;
346 float scroll_offset_multiplier_;
349 HWND window_handle_ =
nullptr;
352 std::wstring window_class_name_;
355 bool tracking_mouse_leave_ =
false;
359 int keycode_for_char_message_ = 0;
370 std::shared_ptr<WindowsProcTable> windows_proc_table_;
373 std::unique_ptr<TextInputManager> text_input_manager_;
376 std::unique_ptr<KeyboardManager> keyboard_manager_;
379 std::vector<TOUCHINPUT> touch_points_;
382 std::unique_ptr<ui::AXFragmentRootWin> ax_fragment_root_;
392 #endif // FLUTTER_SHELL_PLATFORM_WINDOWS_FLUTTER_WINDOW_H_
WindowStateEvent
An event representing a change in window state that may update the.
virtual HWND GetWindowHandle() override
virtual void OnComposeBegin()
virtual float GetDpiScale() override
virtual bool OnBitmapSurfaceCleared() override
virtual UINT Win32DispatchMessage(UINT Msg, WPARAM wParam, LPARAM lParam) override
virtual void OnThemeChange()
virtual void OnPointerDown(double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id, UINT button)
virtual void OnCursorRectUpdated(const Rect &rect) override
std::function< void(bool)> KeyEventCallback
std::wstring NarrowToWide(const char *source)
virtual void OnImeEndComposition(UINT const message, WPARAM const wparam, LPARAM const lparam)
virtual LRESULT OnGetObject(UINT const message, WPARAM const wparam, LPARAM const lparam)
void InitializeChild(const char *title, unsigned int width, unsigned int height)
virtual void AbortImeComposing()
virtual bool OnBitmapSurfaceUpdated(const void *allocation, size_t row_bytes, size_t height) override
virtual void OnPointerMove(double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id, int modifiers_state)
virtual ui::AXFragmentRootDelegateWin * GetAxFragmentRootDelegate()
virtual void OnText(const std::u16string &text) override
virtual ui::AXPlatformNodeWin * GetAlert() override
friend class WindowAXFragmentRootDelegate
std::unique_ptr< DirectManipulationOwner > direct_manipulation_owner_
virtual BOOL Win32PeekMessage(LPMSG lpMsg, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg) override
virtual void OnPointerLeave(double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id)
virtual void OnUpdateSemanticsEnabled(bool enabled)
virtual void OnPointerUp(double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id, UINT button)
virtual gfx::NativeViewAccessible GetNativeViewAccessible()
virtual void UpdateFlutterCursor(const std::string &cursor_name) override
virtual void OnImeSetContext(UINT const message, WPARAM const wparam, LPARAM const lparam)
virtual void SetFlutterCursor(HCURSOR cursor) override
virtual void SetView(WindowBindingHandlerDelegate *view) override
virtual PointerLocation GetPrimaryPointerLocation() override
virtual void OnComposeChange(const std::u16string &text, int cursor_pos)
virtual void OnImeStartComposition(UINT const message, WPARAM const wparam, LPARAM const lparam)
virtual void OnSetCursor()
virtual void OnResetImeComposing() override
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
virtual void OnResize(unsigned int width, unsigned int height)
virtual uint32_t Win32MapVkToChar(uint32_t virtual_key) override
virtual AlertPlatformNodeDelegate * GetAlertDelegate() override
virtual void OnComposeCommit()
LRESULT HandleMessage(UINT const message, WPARAM const wparam, LPARAM const lparam) noexcept
std::unique_ptr< ui::AXPlatformNodeWin > alert_node_
virtual void OnImeRequest(UINT const message, WPARAM const wparam, LPARAM const lparam)
virtual float GetScrollOffsetMultiplier()
virtual LRESULT Win32DefWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
virtual void OnScroll(double delta_x, double delta_y, FlutterPointerDeviceKind device_kind, int32_t device_id)
virtual void OnImeComposition(UINT const message, WPARAM const wparam, LPARAM const lparam)
virtual void OnComposeEnd()
virtual PhysicalWindowBounds GetPhysicalWindowBounds() override
std::unique_ptr< AlertPlatformNodeDelegate > alert_delegate_
virtual void OnDpiScale(unsigned int dpi)
FlutterDesktopBinaryReply callback
virtual void UpdateCursorRect(const Rect &rect)