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"
12
13namespace 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.
25 protected:
26 HostWindowSized(WindowManager* window_manager,
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.
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.
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_
std::shared_ptr< int > view_alive_
FlutterWindowsViewSizingDelegate * AsSizingDelegate()
FlutterEngine engine
Definition main.cc:84
int32_t height
int32_t width