| Flutter Windows Embedder |

Namespaces | Functions
window_manager.cc File Reference
`#include "flutter/shell/platform/windows/window_manager.h"`
`#include <dwmapi.h>`
`#include <optional>`
`#include <vector>`
`#include "embedder.h"`
`#include "flutter/shell/platform/common/windowing.h"`
`#include "flutter/shell/platform/windows/flutter_windows_engine.h"`
`#include "flutter/shell/platform/windows/flutter_windows_view_controller.h"`
`#include "flutter/shell/platform/windows/host_window.h"`
`#include "fml/logging.h"`
`#include "shell/platform/windows/client_wrapper/include/flutter/flutter_view.h"`
`#include "shell/platform/windows/flutter_windows_view.h"`

Go to the source code of this file.

## Namespaces
| flutter

## Functions
void | InternalFlutterWindows_WindowManager_Initialize (int64_t engine_id, const flutter::WindowingInitRequest *request)
bool | InternalFlutterWindows_WindowManager_HasTopLevelWindows (int64_t engine_id)
FlutterViewId | InternalFlutterWindows_WindowManager_CreateRegularWindow (int64_t engine_id, const flutter::WindowCreationRequest *request)
HWND | InternalFlutterWindows_WindowManager_GetTopLevelWindowHandle (int64_t engine_id, FlutterViewId view_id)
flutter::ActualWindowSize | InternalFlutterWindows_WindowManager_GetWindowContentSize (HWND hwnd)
void | InternalFlutterWindows_WindowManager_SetWindowSize (HWND hwnd, const flutter::WindowSizeRequest *size)
void | InternalFlutterWindows_WindowManager_SetWindowConstraints (HWND hwnd, const flutter::WindowConstraints *constraints)
void | InternalFlutterWindows_WindowManager_SetFullscreen (HWND hwnd, const flutter::FullscreenRequest *request)
bool | InternalFlutterWindows_WindowManager_GetFullscreen (HWND hwnd)

## Function Documentation

## ◆ InternalFlutterWindows_WindowManager_CreateRegularWindow()

FlutterViewId InternalFlutterWindows_WindowManager_CreateRegularWindow | ( | int64_t | engine_id,
|  | const flutter::WindowCreationRequest * | request
| ) |  |

Definition at line 117 of file window_manager.cc.

119 {
120 flutter::FlutterWindowsEngine* engine =
121 flutter::FlutterWindowsEngine::GetEngineForId(engine_id);
122 return engine->window_manager()->CreateRegularWindow(request);
123 }
flutter::FlutterWindowsEngine
Definition: flutter_windows_engine.h:92
flutter::FlutterWindowsEngine::GetEngineForId
static FlutterWindowsEngine * GetEngineForId(int64_t engine_id)
Definition: flutter_windows_engine.cc:259
flutter::FlutterWindowsEngine::window_manager
WindowManager * window_manager()
Definition: flutter_windows_engine.h:325
flutter::WindowManager::CreateRegularWindow
FlutterViewId CreateRegularWindow(const WindowCreationRequest *request)
Definition: window_manager.cc:34

References flutter::WindowManager::CreateRegularWindow(), flutter::FlutterWindowsEngine::GetEngineForId(), and flutter::FlutterWindowsEngine::window_manager().

Referenced by flutter::testing::TEST_F().

## ◆ InternalFlutterWindows_WindowManager_GetFullscreen()

bool InternalFlutterWindows_WindowManager_GetFullscreen | ( | HWND | hwnd | ) |

Definition at line 174 of file window_manager.cc.

174 {
175 flutter::HostWindow* window = flutter::HostWindow::GetThisFromHandle(hwnd);
176 if (window) {
177 return window->GetFullscreen();
178 }
179
180 return false;
181 }
flutter::HostWindow
Definition: host_window.h:26
flutter::HostWindow::GetThisFromHandle
static HostWindow * GetThisFromHandle(HWND hwnd)
Definition: host_window.cc:396
flutter::HostWindow::GetFullscreen
bool GetFullscreen() const
Definition: host_window.cc:748

References flutter::HostWindow::GetFullscreen(), and flutter::HostWindow::GetThisFromHandle().

Referenced by flutter::testing::TEST_F().

## ◆ InternalFlutterWindows_WindowManager_GetTopLevelWindowHandle()

HWND InternalFlutterWindows_WindowManager_GetTopLevelWindowHandle | ( | int64_t | engine_id,
|  | FlutterViewId | view_id
| ) |  |

Definition at line 125 of file window_manager.cc.

127 {
128 flutter::FlutterWindowsEngine* engine =
129 flutter::FlutterWindowsEngine::GetEngineForId(engine_id);
130 flutter::FlutterWindowsView* view = engine->view(view_id);
131 if (view == nullptr) {
132 return nullptr;
133 } else {
134 return GetAncestor(view->GetWindowHandle(), GA_ROOT);
135 }
136 }
flutter::FlutterWindowsEngine::view
FlutterWindowsView * view(FlutterViewId view_id) const
Definition: flutter_windows_engine.cc:688
flutter::FlutterWindowsView
Definition: flutter_windows_view.h:34
flutter::FlutterWindowsView::GetWindowHandle
virtual HWND GetWindowHandle() const
Definition: flutter_windows_view.cc:780

References flutter::FlutterWindowsEngine::GetEngineForId(), flutter::FlutterWindowsView::GetWindowHandle(), and flutter::FlutterWindowsEngine::view().

Referenced by flutter::testing::TEST_F().

## ◆ InternalFlutterWindows_WindowManager_GetWindowContentSize()

flutter::ActualWindowSize InternalFlutterWindows_WindowManager_GetWindowContentSize | ( | HWND | hwnd | ) |

Definition at line 139 of file window_manager.cc.

139 {
140 return flutter::HostWindow::GetWindowContentSize(hwnd);
141 }
flutter::HostWindow::GetWindowContentSize
static ActualWindowSize GetWindowContentSize(HWND hwnd)
Definition: host_window.cc:752

References flutter::HostWindow::GetWindowContentSize().

Referenced by flutter::testing::TEST_F().

## ◆ InternalFlutterWindows_WindowManager_HasTopLevelWindows()

bool InternalFlutterWindows_WindowManager_HasTopLevelWindows | ( | int64_t | engine_id | ) |

Definition at line 110 of file window_manager.cc.

111 {
112 flutter::FlutterWindowsEngine* engine =
113 flutter::FlutterWindowsEngine::GetEngineForId(engine_id);
114 return engine->window_manager()->HasTopLevelWindows();
115 }
flutter::WindowManager::HasTopLevelWindows
bool HasTopLevelWindows() const
Definition: window_manager.cc:30

References flutter::FlutterWindowsEngine::GetEngineForId(), flutter::WindowManager::HasTopLevelWindows(), and flutter::FlutterWindowsEngine::window_manager().

Referenced by flutter::testing::TEST_F().

## ◆ InternalFlutterWindows_WindowManager_Initialize()

void InternalFlutterWindows_WindowManager_Initialize | ( | int64_t | engine_id,
|  | const flutter::WindowingInitRequest * | request
| ) |  |

Definition at line 102 of file window_manager.cc.

104 {
105 flutter::FlutterWindowsEngine* engine =
106 flutter::FlutterWindowsEngine::GetEngineForId(engine_id);
107 engine->window_manager()->Initialize(request);
108 }
flutter::WindowManager::Initialize
void Initialize(const WindowingInitRequest *request)
Definition: window_manager.cc:25

References flutter::FlutterWindowsEngine::GetEngineForId(), flutter::WindowManager::Initialize(), and flutter::FlutterWindowsEngine::window_manager().

Referenced by flutter::testing::TEST_F().

## ◆ InternalFlutterWindows_WindowManager_SetFullscreen()

void InternalFlutterWindows_WindowManager_SetFullscreen | ( | HWND | hwnd,
|  | const flutter::FullscreenRequest * | request
| ) |  |

Definition at line 161 of file window_manager.cc.

163 {
164 flutter::HostWindow* window = flutter::HostWindow::GetThisFromHandle(hwnd);
165 const std::optional<FlutterEngineDisplayId> display_id =
166 request->has_display_id
167 ? std::optional<FlutterEngineDisplayId>(request->display_id)
168 : std::nullopt;
169 if (window) {
170 window->SetFullscreen(request->fullscreen, display_id);
171 }
172 }
flutter::HostWindow::SetFullscreen
void SetFullscreen(bool fullscreen, std::optional< FlutterEngineDisplayId > display_id)
Definition: host_window.cc:602
flutter::FullscreenRequest::has_display_id
bool has_display_id
Definition: window_manager.h:71
flutter::FullscreenRequest::fullscreen
bool fullscreen
Definition: window_manager.h:70
flutter::FullscreenRequest::display_id
FlutterEngineDisplayId display_id
Definition: window_manager.h:72

References flutter::FullscreenRequest::display_id, flutter::FullscreenRequest::fullscreen, flutter::HostWindow::GetThisFromHandle(), flutter::FullscreenRequest::has_display_id, and flutter::HostWindow::SetFullscreen().

Referenced by flutter::testing::TEST_F().

## ◆ InternalFlutterWindows_WindowManager_SetWindowConstraints()

void InternalFlutterWindows_WindowManager_SetWindowConstraints | ( | HWND | hwnd,
|  | const flutter::WindowConstraints * | constraints
| ) |  |

Definition at line 152 of file window_manager.cc.

154 {
155 flutter::HostWindow* window = flutter::HostWindow::GetThisFromHandle(hwnd);
156 if (window) {
157 window->SetConstraints(*constraints);
158 }
159 }
flutter::HostWindow::SetConstraints
void SetConstraints(const WindowConstraints &constraints)
Definition: host_window.cc:561

References flutter::HostWindow::GetThisFromHandle(), and flutter::HostWindow::SetConstraints().

Referenced by flutter::testing::TEST_F().

## ◆ InternalFlutterWindows_WindowManager_SetWindowSize()

void InternalFlutterWindows_WindowManager_SetWindowSize | ( | HWND | hwnd,
|  | const flutter::WindowSizeRequest * | size
| ) |  |

Definition at line 143 of file window_manager.cc.

145 {
146 flutter::HostWindow* window = flutter::HostWindow::GetThisFromHandle(hwnd);
147 if (window) {
148 window->SetContentSize(*size);
149 }
150 }
flutter::HostWindow::SetContentSize
void SetContentSize(const WindowSizeRequest &size)
Definition: host_window.cc:519

References flutter::HostWindow::GetThisFromHandle(), and flutter::HostWindow::SetContentSize().

Referenced by flutter::testing::TEST_F().