| 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)
FlutterWindowSize | InternalFlutterWindows_WindowManager_GetWindowContentSize (HWND hwnd)
void | InternalFlutterWindows_WindowManager_SetWindowContentSize (HWND hwnd, const flutter::WindowSizing *size)

## Function Documentation

## ◆ InternalFlutterWindows_WindowManager_CreateRegularWindow()

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

Definition at line 116 of file window_manager.cc.

118 {
119 flutter::FlutterWindowsEngine* engine =
120 flutter::FlutterWindowsEngine::GetEngineForId(engine_id);
121 return engine->window_manager()->CreateRegularWindow(request);
122 }
flutter::FlutterWindowsEngine
Definition: flutter_windows_engine.h:91
flutter::FlutterWindowsEngine::GetEngineForId
static FlutterWindowsEngine * GetEngineForId(int64_t engine_id)
Definition: flutter_windows_engine.cc:248
flutter::FlutterWindowsEngine::window_manager
WindowManager * window_manager()
Definition: flutter_windows_engine.h:319
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_GetTopLevelWindowHandle()

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

Definition at line 124 of file window_manager.cc.

126 {
127 flutter::FlutterWindowsEngine* engine =
128 flutter::FlutterWindowsEngine::GetEngineForId(engine_id);
129 flutter::FlutterWindowsView* view = engine->view(view_id);
130 if (view == nullptr) {
131 return nullptr;
132 } else {
133 return GetAncestor(view->GetWindowHandle(), GA_ROOT);
134 }
135 }
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:778

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

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

## ◆ InternalFlutterWindows_WindowManager_GetWindowContentSize()

FlutterWindowSize InternalFlutterWindows_WindowManager_GetWindowContentSize | ( | HWND | hwnd | ) |

Definition at line 137 of file window_manager.cc.

138 {
139 RECT rect;
140 GetClientRect(hwnd, &rect);
141 double const dpr = FlutterDesktopGetDpiForHWND(hwnd) /
142 static_cast<double>(USER_DEFAULT_SCREEN_DPI);
143 double const width = rect.right / dpr;
144 double const height = rect.bottom / dpr;
145 return {
146 .width = rect.right / dpr,
147 .height = rect.bottom / dpr,
148 };
149 }
FlutterDesktopGetDpiForHWND
UINT FlutterDesktopGetDpiForHWND(HWND hwnd)
Definition: flutter_windows.cc:322

References FlutterDesktopGetDpiForHWND().

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

## ◆ InternalFlutterWindows_WindowManager_HasTopLevelWindows()

bool InternalFlutterWindows_WindowManager_HasTopLevelWindows | ( | int64_t | engine_id | ) |

Definition at line 109 of file window_manager.cc.

110 {
111 flutter::FlutterWindowsEngine* engine =
112 flutter::FlutterWindowsEngine::GetEngineForId(engine_id);
113 return engine->window_manager()->HasTopLevelWindows();
114 }
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 101 of file window_manager.cc.

103 {
104 flutter::FlutterWindowsEngine* engine =
105 flutter::FlutterWindowsEngine::GetEngineForId(engine_id);
106 engine->window_manager()->Initialize(request);
107 }
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_SetWindowContentSize()

void InternalFlutterWindows_WindowManager_SetWindowContentSize | ( | HWND | hwnd,
|  | const flutter::WindowSizing * | size
| ) |  |

Definition at line 151 of file window_manager.cc.

153 {
154 flutter::HostWindow* window = flutter::HostWindow::GetThisFromHandle(hwnd);
155 if (window) {
156 window->SetContentSize(*size);
157 }
158 }
flutter::HostWindow
Definition: host_window.h:24
flutter::HostWindow::SetContentSize
void SetContentSize(const WindowSizing &size)
Definition: host_window.cc:466
flutter::HostWindow::GetThisFromHandle
static HostWindow * GetThisFromHandle(HWND hwnd)
Definition: host_window.cc:343

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

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