Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
flutter::HostWindowDialog Class Reference

#include <host_window_dialog.h>

Inheritance diagram for flutter::HostWindowDialog:
flutter::HostWindowSized flutter::HostWindow flutter::FlutterWindowsViewSizingDelegate

Public Member Functions

 HostWindowDialog (WindowManager *window_manager, FlutterWindowsEngine *engine, const WindowSizeRequest &preferred_size, const BoxConstraints &constraints, LPCWSTR title, std::optional< HWND > const &owner_window, bool sized_to_content, bool resizable)
 
 ~HostWindowDialog () override
 
void SetFullscreen (bool fullscreen, std::optional< FlutterEngineDisplayId > display_id) override
 
bool GetFullscreen () const override
 
- Public Member Functions inherited from flutter::HostWindow
virtual ~HostWindow ()
 
HWND GetWindowHandle () const
 
HWND GetFlutterViewWindowHandle () const
 
void SetContentSize (const WindowSizeRequest &size)
 
void SetConstraints (const WindowConstraints &constraints)
 
HostWindowGetOwnerWindow () const
 
void UpdateModalStateLayer ()
 

Protected Member Functions

LRESULT HandleMessage (HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) override
 
- Protected Member Functions inherited from flutter::HostWindowSized
 HostWindowSized (WindowManager *window_manager, FlutterWindowsEngine *engine, bool resizable)
 
 ~HostWindowSized () override=0
 
FlutterWindowsViewSizingDelegateAsSizingDelegate ()
 
virtual void ApplyContentSize (int32_t physical_width, int32_t physical_height)
 
- Protected Member Functions inherited from flutter::HostWindow
void InitializeFlutterView (HostWindowInitializationParams const &params)
 
 HostWindow (WindowManager *window_manager, FlutterWindowsEngine *engine)
 
void HandleWindowActivation (HWND hwnd, WPARAM wparam)
 
void EnableRecursively (bool enable)
 
HostWindowFindFirstEnabledDescendant () const
 
WindowArchetype GetArchetype () const
 
std::vector< HostWindow * > GetOwnedWindows () const
 
void DisableRecursively ()
 
 FML_DISALLOW_COPY_AND_ASSIGN (HostWindow)
 

Additional Inherited Members

- Static Public Member Functions inherited from flutter::HostWindow
static std::unique_ptr< HostWindowCreateRegularWindow (WindowManager *window_manager, FlutterWindowsEngine *engine, const WindowSizeRequest &preferred_size, const WindowConstraints &preferred_constraints, LPCWSTR title, bool sized_to_content, bool resizable)
 
static std::unique_ptr< HostWindowCreateDialogWindow (WindowManager *window_manager, FlutterWindowsEngine *engine, const WindowSizeRequest &preferred_size, const WindowConstraints &preferred_constraints, LPCWSTR title, HWND parent, bool sized_to_content, bool resizable)
 
static std::unique_ptr< HostWindowCreateTooltipWindow (WindowManager *window_manager, FlutterWindowsEngine *engine, const WindowConstraints &preferred_constraints, GetWindowPositionCallback get_position_callback, HWND parent)
 
static std::unique_ptr< HostWindowCreatePopupWindow (WindowManager *window_manager, FlutterWindowsEngine *engine, const WindowConstraints &preferred_constraints, GetWindowPositionCallback get_position_callback, HWND parent)
 
static HostWindowGetThisFromHandle (HWND hwnd)
 
static ActualWindowSize GetWindowContentSize (HWND hwnd)
 
- Static Protected Member Functions inherited from flutter::HostWindow
static std::optional< SizeGetWindowSizeForClientSize (WindowsProcTable const &win32, Size const &client_size, std::optional< Size > smallest, std::optional< Size > biggest, DWORD window_style, DWORD extended_window_style, std::optional< HWND > const &owner_hwnd)
 
static void FocusRootViewOf (HostWindow *window)
 
static LRESULT WndProc (HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
 
- Protected Attributes inherited from flutter::HostWindowSized
const bool resizable_
 
std::shared_ptr< int > view_alive_
 
int physical_width_ = 0
 
int physical_height_ = 0
 
- Protected Attributes inherited from flutter::HostWindow
friend WindowManager
 
WindowManager *const window_manager_ = nullptr
 
FlutterWindowsEngineengine_
 
std::unique_ptr< FlutterWindowsViewControllerview_controller_
 
WindowArchetype archetype_ = WindowArchetype::kRegular
 
HWND window_handle_
 
BoxConstraints box_constraints_
 
bool is_being_destroyed_ = false
 
bool is_fullscreen_ = false
 
SavedWindowInfo saved_window_info_
 
Microsoft::WRL::ComPtr< ITaskbarList2 > task_bar_list_
 

Detailed Description

Definition at line 13 of file host_window_dialog.h.

Constructor & Destructor Documentation

◆ HostWindowDialog()

flutter::HostWindowDialog::HostWindowDialog ( WindowManager window_manager,
FlutterWindowsEngine engine,
const WindowSizeRequest preferred_size,
const BoxConstraints constraints,
LPCWSTR  title,
std::optional< HWND > const &  owner_window,
bool  sized_to_content,
bool  resizable 
)

Definition at line 40 of file host_window_dialog.cc.

48 : HostWindowSized(window_manager, engine, resizable) {
49 FML_CHECK(sized_to_content || preferred_size.has_preferred_view_size);
50 InitializeFlutterView(HostWindowInitializationParams{
51 .archetype = WindowArchetype::kDialog,
52 .window_style = GetWindowStyleForDialog(owner_window, resizable),
53 .extended_window_style = GetExtendedWindowStyleForDialog(owner_window),
54 .box_constraints = constraints,
55 .initial_window_rect =
56 GetInitialRect(engine, preferred_size, constraints, owner_window,
57 sized_to_content, resizable),
58 .title = title,
59 .owner_window = owner_window,
60 .sizing_delegate = sized_to_content ? AsSizingDelegate() : nullptr,
61 .is_sized_to_content = sized_to_content,
62 });
63
64 auto hwnd = window_handle_;
65 if (owner_window) {
66 if (HMENU hMenu = GetSystemMenu(hwnd, FALSE)) {
67 EnableMenuItem(hMenu, SC_CLOSE, MF_BYCOMMAND | MF_GRAYED);
68 }
69 }
70
71 if (owner_window) {
72 UpdateModalState();
73 }
74}
void InitializeFlutterView(HostWindowInitializationParams const &params)
HostWindowSized(WindowManager *window_manager, FlutterWindowsEngine *engine, bool resizable)
FlutterWindowsViewSizingDelegate * AsSizingDelegate()
FlutterEngine engine
Definition main.cc:84
G_BEGIN_DECLS gboolean sized_to_content
#define FML_CHECK(condition)
Definition logging.h:104

References flutter::HostWindow::HostWindowInitializationParams::archetype, flutter::HostWindowSized::AsSizingDelegate(), engine, FML_CHECK, flutter::WindowSizeRequest::has_preferred_view_size, flutter::HostWindow::InitializeFlutterView(), flutter::kDialog, sized_to_content, and flutter::HostWindow::window_handle_.

◆ ~HostWindowDialog()

flutter::HostWindowDialog::~HostWindowDialog ( )
override

Definition at line 76 of file host_window_dialog.cc.

76 {
77 // Reset the view while this most-derived object is still fully alive, to stop
78 // the raster thread from sizing it before any subobject is torn down. See the
79 // destructor comment in host_window_sized.h for the rationale.
80 view_controller_.reset();
81}
std::unique_ptr< FlutterWindowsViewController > view_controller_

References flutter::HostWindow::view_controller_.

Member Function Documentation

◆ GetFullscreen()

bool flutter::HostWindowDialog::GetFullscreen ( ) const
overridevirtual

Reimplemented from flutter::HostWindow.

Definition at line 169 of file host_window_dialog.cc.

169 {
170 return false;
171}

◆ HandleMessage()

LRESULT flutter::HostWindowDialog::HandleMessage ( HWND  hwnd,
UINT  message,
WPARAM  wparam,
LPARAM  lparam 
)
overrideprotectedvirtual

Reimplemented from flutter::HostWindow.

Definition at line 125 of file host_window_dialog.cc.

128 {
129 switch (message) {
130 case WM_DESTROY:
131 is_being_destroyed_ = true;
132 if (HostWindow* const owner_window = GetOwnerWindow()) {
133 UpdateModalState();
134 FocusRootViewOf(owner_window);
135 }
136 break;
137
138 case WM_ACTIVATE:
139 // Forward the message to Dart before handling it on the C++ side.
140 // This ensures that Dart-side handlers (e.g. popup dismiss logic)
141 // can observe activation changes caused by dialog windows.
142 if (auto const result =
144 window_handle_, message, wparam, lparam)) {
145 return *result;
146 }
147
148 HandleWindowActivation(hwnd, wparam);
149 return 0;
150 }
151
152 return HostWindow::HandleMessage(hwnd, message, wparam, lparam);
153}
WindowProcDelegateManager * window_proc_delegate_manager()
void HandleWindowActivation(HWND hwnd, WPARAM wparam)
HostWindow * GetOwnerWindow() const
static void FocusRootViewOf(HostWindow *window)
FlutterWindowsEngine * engine_
virtual LRESULT HandleMessage(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
std::optional< LRESULT > OnTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) const
const char * message

References flutter::HostWindow::engine_, flutter::HostWindow::FocusRootViewOf(), flutter::HostWindow::GetOwnerWindow(), flutter::HostWindow::HandleMessage(), flutter::HostWindow::HandleWindowActivation(), flutter::HostWindow::is_being_destroyed_, message, flutter::WindowProcDelegateManager::OnTopLevelWindowProc(), flutter::HostWindow::window_handle_, and flutter::FlutterWindowsEngine::window_proc_delegate_manager().

◆ SetFullscreen()

void flutter::HostWindowDialog::SetFullscreen ( bool  fullscreen,
std::optional< FlutterEngineDisplayId display_id 
)
overridevirtual

Reimplemented from flutter::HostWindow.

Definition at line 165 of file host_window_dialog.cc.

167 {}

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