Flutter Engine
 
Loading...
Searching...
No Matches
host_window_regular.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
6
8
9namespace flutter {
12 const WindowSizeRequest& preferred_size,
13 const BoxConstraints& constraints,
14 LPCWSTR title)
15
16 : HostWindow(window_manager,
17 engine,
19 WS_OVERLAPPEDWINDOW,
20 0,
21 constraints,
22 GetInitialRect(engine, preferred_size, constraints),
23 title,
24 std::nullopt) {
25 // TODO(knopp): Investigate sizing the window to its content with the help of
26 // https://github.com/flutter/flutter/pull/173610.
27 FML_CHECK(preferred_size.has_preferred_view_size);
28}
29
30Rect HostWindowRegular::GetInitialRect(FlutterWindowsEngine* engine,
31 const WindowSizeRequest& preferred_size,
32 const BoxConstraints& constraints) {
33 std::optional<Size> const window_size =
35 *engine->windows_proc_table(),
36 Size(preferred_size.preferred_view_width,
37 preferred_size.preferred_view_height),
38 constraints.smallest(), constraints.biggest(), WS_OVERLAPPEDWINDOW, 0,
39 nullptr);
40 return {{CW_USEDEFAULT, CW_USEDEFAULT},
41 window_size ? *window_size : Size{CW_USEDEFAULT, CW_USEDEFAULT}};
42}
43
44} // namespace flutter
Size smallest() const
Definition geometry.h:94
Size biggest() const
Definition geometry.h:93
static std::optional< Size > GetWindowSizeForClientSize(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)
HostWindowRegular(WindowManager *window_manager, FlutterWindowsEngine *engine, const WindowSizeRequest &preferred_size, const BoxConstraints &constraints, LPCWSTR title)
FlutterEngine engine
Definition main.cc:84
#define FML_CHECK(condition)
Definition logging.h:104
WindowArchetype
Definition windowing.h:11
Definition ref_ptr.h:261