Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
Loading...
Searching...
No Matches
host_window_sized.h
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
5
#ifndef FLUTTER_SHELL_PLATFORM_WINDOWS_HOST_WINDOW_SIZED_H_
6
#define FLUTTER_SHELL_PLATFORM_WINDOWS_HOST_WINDOW_SIZED_H_
7
8
#include <memory>
9
10
#include "
host_window.h
"
11
#include "
shell/platform/windows/flutter_windows_view.h
"
12
13
namespace
flutter
{
14
15
// Base class for HostWindowRegular and HostWindowDialog.
16
//
17
// Provides the shared sized-to-content implementation used by both archetypes:
18
// tracking the last rendered content size, calling SetContentSize() after each
19
// frame, and optionally disabling content-size tracking once the user resizes
20
// the window. HostWindowPopup and HostWindowTooltip are not derived from this
21
// class because they position themselves relative to a parent window rather
22
// than sizing to their own content.
23
class
HostWindowSized
:
public
HostWindow
,
24
private
FlutterWindowsViewSizingDelegate
{
25
protected
:
26
HostWindowSized
(
WindowManager
* window_manager,
27
FlutterWindowsEngine
*
engine
,
28
bool
resizable);
29
30
// Returns a pointer to this as a FlutterWindowsViewSizingDelegate, for use
31
// as HostWindowInitializationParams::sizing_delegate. This is necessary
32
// because FlutterWindowsViewSizingDelegate is a private base of this class
33
// and the conversion is therefore inaccessible to derived classes.
34
FlutterWindowsViewSizingDelegate
*
AsSizingDelegate
() {
return
this
; }
35
36
// Whether the user can manually resize this window.
37
const
bool
resizable_
;
38
39
// Used to track whether the view is still alive in tasks posted from the
40
// raster thread.
41
std::shared_ptr<int>
view_alive_
;
42
43
// The last physical-pixel size reported to DidUpdateViewSize.
44
int
physical_width_
= 0;
45
int
physical_height_
= 0;
46
47
private
:
48
// FlutterWindowsViewSizingDelegate:
49
void
DidUpdateViewSize(int32_t
width
, int32_t
height
)
override
;
50
WindowRect
GetWorkArea()
const override
;
51
};
52
53
}
// namespace flutter
54
55
#endif
// FLUTTER_SHELL_PLATFORM_WINDOWS_HOST_WINDOW_SIZED_H_
flutter::FlutterWindowsEngine
Definition
flutter_windows_engine.h:92
flutter::FlutterWindowsViewSizingDelegate
Definition
flutter_windows_view.h:35
flutter::HostWindow
Definition
host_window.h:29
flutter::HostWindowSized
Definition
host_window_sized.h:24
flutter::HostWindowSized::view_alive_
std::shared_ptr< int > view_alive_
Definition
host_window_sized.h:41
flutter::HostWindowSized::resizable_
const bool resizable_
Definition
host_window_sized.h:37
flutter::HostWindowSized::physical_width_
int physical_width_
Definition
host_window_sized.h:44
flutter::HostWindowSized::AsSizingDelegate
FlutterWindowsViewSizingDelegate * AsSizingDelegate()
Definition
host_window_sized.h:34
flutter::HostWindowSized::physical_height_
int physical_height_
Definition
host_window_sized.h:45
flutter::WindowManager
Definition
window_manager.h:118
engine
FlutterEngine engine
Definition
main.cc:84
flutter_windows_view.h
host_window.h
flutter
Definition
asset_manager.cc:10
height
int32_t height
Definition
serialization_callbacks.cc:1
width
int32_t width
Definition
serialization_callbacks.cc:0
flutter::WindowRect
Definition
window_manager.h:42
shell
platform
windows
host_window_sized.h
Generated on Sun Jun 14 2026 06:12:37 for Flutter Engine Uber Docs by
1.9.8