Flutter Windows Embedder
window_manager.h File Reference
#include <windows.h>
#include <functional>
#include <optional>
#include <unordered_map>
#include <vector>
#include "flutter/shell/platform/common/public/flutter_export.h"
#include "flutter/fml/macros.h"
#include "flutter/shell/platform/common/isolate_scope.h"
#include "flutter/shell/platform/embedder/embedder.h"

Go to the source code of this file.

Classes

struct  flutter::WindowSizeRequest
 
struct  flutter::WindowConstraints
 
struct  flutter::WindowRect
 
struct  flutter::WindowSize
 
struct  flutter::RegularWindowCreationRequest
 
struct  flutter::DialogWindowCreationRequest
 
struct  flutter::TooltipWindowCreationRequest
 
struct  flutter::PopupWindowCreationRequest
 
struct  flutter::SatelliteWindowCreationRequest
 
struct  flutter::WindowsMessage
 
struct  flutter::WindowingInitRequest
 
struct  flutter::ActualWindowSize
 
struct  flutter::FullscreenRequest
 
class  flutter::WindowManager
 

Namespaces

 flutter
 

Typedefs

typedef void(* flutter::GetWindowPositionCallback) (const WindowSize &child_size, const WindowRect &parent_rect, const WindowRect &display_rect, WindowRect &output_rect)
 

Functions

FLUTTER_EXPORT void InternalFlutterWindows_WindowManager_Initialize (int64_t engine_id, const flutter::WindowingInitRequest *request)
 
FLUTTER_EXPORT FlutterViewId InternalFlutterWindows_WindowManager_CreateRegularWindow (int64_t engine_id, const flutter::RegularWindowCreationRequest *request)
 
FLUTTER_EXPORT FlutterViewId InternalFlutterWindows_WindowManager_CreateDialogWindow (int64_t engine_id, const flutter::DialogWindowCreationRequest *request)
 
FLUTTER_EXPORT FlutterViewId InternalFlutterWindows_WindowManager_CreateTooltipWindow (int64_t engine_id, const flutter::TooltipWindowCreationRequest *request)
 
FLUTTER_EXPORT FlutterViewId InternalFlutterWindows_WindowManager_CreatePopupWindow (int64_t engine_id, const flutter::PopupWindowCreationRequest *request)
 
FLUTTER_EXPORT HWND InternalFlutterWindows_WindowManager_GetTopLevelWindowHandle (int64_t engine_id, FlutterViewId view_id)
 
FLUTTER_EXPORT flutter::ActualWindowSize InternalFlutterWindows_WindowManager_GetWindowContentSize (HWND hwnd)
 
FLUTTER_EXPORT void InternalFlutterWindows_WindowManager_SetWindowSize (HWND hwnd, const flutter::WindowSizeRequest *size)
 
FLUTTER_EXPORT void InternalFlutterWindows_WindowManager_SetWindowConstraints (HWND hwnd, const flutter::WindowConstraints *constraints)
 
FLUTTER_EXPORT void InternalFlutterWindows_WindowManager_SetFullscreen (HWND hwnd, const flutter::FullscreenRequest *request)
 
FLUTTER_EXPORT void InternalFlutterWindows_WindowManager_OnDestroyWindow (HWND hwnd)
 
FLUTTER_EXPORT bool InternalFlutterWindows_WindowManager_GetFullscreen (HWND hwnd)
 
FLUTTER_EXPORT void InternalFlutterWindows_WindowManager_UpdateTooltipPosition (HWND hwnd)
 
FLUTTER_EXPORT void InternalFlutterWindows_WindowManager_UpdatePopupPosition (HWND hwnd)
 
FLUTTER_EXPORT FlutterViewId InternalFlutterWindows_WindowManager_CreateSatelliteWindow (int64_t engine_id, const flutter::SatelliteWindowCreationRequest *request)
 
FLUTTER_EXPORT void InternalFlutterWindows_WindowManager_SetSatelliteParent (HWND satellite_hwnd, HWND new_parent)
 

Function Documentation

◆ InternalFlutterWindows_WindowManager_CreateDialogWindow()

FLUTTER_EXPORT FlutterViewId InternalFlutterWindows_WindowManager_CreateDialogWindow ( int64_t  engine_id,
const flutter::DialogWindowCreationRequest *  request 
)

Definition at line 216 of file window_manager.cc.

218  {
221  return engine->window_manager()->CreateDialogWindow(request);
222 }
static FlutterWindowsEngine * GetEngineForId(int64_t engine_id)
FlutterViewId CreateDialogWindow(const DialogWindowCreationRequest *request)

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

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

◆ InternalFlutterWindows_WindowManager_CreatePopupWindow()

FLUTTER_EXPORT FlutterViewId InternalFlutterWindows_WindowManager_CreatePopupWindow ( int64_t  engine_id,
const flutter::PopupWindowCreationRequest *  request 
)

Definition at line 234 of file window_manager.cc.

236  {
239  return engine->window_manager()->CreatePopupWindow(request);
240 }
FlutterViewId CreatePopupWindow(const PopupWindowCreationRequest *request)

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

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

◆ InternalFlutterWindows_WindowManager_CreateRegularWindow()

FLUTTER_EXPORT FlutterViewId InternalFlutterWindows_WindowManager_CreateRegularWindow ( int64_t  engine_id,
const flutter::RegularWindowCreationRequest *  request 
)

Definition at line 207 of file window_manager.cc.

209  {
212  return engine->window_manager()->CreateRegularWindow(request);
213 }
FlutterViewId CreateRegularWindow(const RegularWindowCreationRequest *request)

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

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

◆ InternalFlutterWindows_WindowManager_CreateSatelliteWindow()

FLUTTER_EXPORT FlutterViewId InternalFlutterWindows_WindowManager_CreateSatelliteWindow ( int64_t  engine_id,
const flutter::SatelliteWindowCreationRequest *  request 
)

Definition at line 321 of file window_manager.cc.

323  {
326  return engine->window_manager()->CreateSatelliteWindow(request);
327 }
FlutterViewId CreateSatelliteWindow(const SatelliteWindowCreationRequest *request)

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

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

◆ InternalFlutterWindows_WindowManager_CreateTooltipWindow()

FLUTTER_EXPORT FlutterViewId InternalFlutterWindows_WindowManager_CreateTooltipWindow ( int64_t  engine_id,
const flutter::TooltipWindowCreationRequest *  request 
)

Definition at line 225 of file window_manager.cc.

227  {
230  return engine->window_manager()->CreateTooltipWindow(request);
231 }
FlutterViewId CreateTooltipWindow(const TooltipWindowCreationRequest *request)

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

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

◆ InternalFlutterWindows_WindowManager_GetFullscreen()

FLUTTER_EXPORT bool InternalFlutterWindows_WindowManager_GetFullscreen ( HWND  hwnd)

Definition at line 295 of file window_manager.cc.

295  {
297  if (window) {
298  return window->GetFullscreen();
299  }
300 
301  return false;
302 }
static HostWindow * GetThisFromHandle(HWND hwnd)
Definition: host_window.cc:362
virtual bool GetFullscreen() const
Definition: host_window.cc:788

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

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

◆ InternalFlutterWindows_WindowManager_GetTopLevelWindowHandle()

FLUTTER_EXPORT HWND InternalFlutterWindows_WindowManager_GetTopLevelWindowHandle ( int64_t  engine_id,
FlutterViewId  view_id 
)

Definition at line 242 of file window_manager.cc.

244  {
247  flutter::FlutterWindowsView* view = engine->view(view_id);
248  if (view == nullptr) {
249  return nullptr;
250  } else {
251  return GetAncestor(view->GetWindowHandle(), GA_ROOT);
252  }
253 }
FlutterWindowsView * view(FlutterViewId view_id) const
virtual HWND GetWindowHandle() const

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

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

◆ InternalFlutterWindows_WindowManager_GetWindowContentSize()

FLUTTER_EXPORT flutter::ActualWindowSize InternalFlutterWindows_WindowManager_GetWindowContentSize ( HWND  hwnd)

Definition at line 256 of file window_manager.cc.

256  {
258 }
static ActualWindowSize GetWindowContentSize(HWND hwnd)
Definition: host_window.cc:792

References flutter::HostWindow::GetWindowContentSize().

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

◆ InternalFlutterWindows_WindowManager_Initialize()

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

◆ InternalFlutterWindows_WindowManager_OnDestroyWindow()

FLUTTER_EXPORT void InternalFlutterWindows_WindowManager_OnDestroyWindow ( HWND  hwnd)

Definition at line 269 of file window_manager.cc.

269  {
270  DestroyWindow(hwnd);
271 }

Referenced by flutter::WindowManager::OnEngineShutdown().

◆ InternalFlutterWindows_WindowManager_SetFullscreen()

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

Definition at line 282 of file window_manager.cc.

284  {
286  const std::optional<FlutterEngineDisplayId> display_id =
287  request->has_display_id
288  ? std::optional<FlutterEngineDisplayId>(request->display_id)
289  : std::nullopt;
290  if (window) {
291  window->SetFullscreen(request->fullscreen, display_id);
292  }
293 }
virtual void SetFullscreen(bool fullscreen, std::optional< FlutterEngineDisplayId > display_id)
Definition: host_window.cc:642
FlutterEngineDisplayId display_id

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_SetSatelliteParent()

FLUTTER_EXPORT void InternalFlutterWindows_WindowManager_SetSatelliteParent ( HWND  satellite_hwnd,
HWND  new_parent 
)

Definition at line 330 of file window_manager.cc.

332  {
333  if (flutter::HostWindowSatellite* satellite =
335  satellite_hwnd)) {
336  satellite->SetSatelliteParent(new_parent);
337  }
338 }
static HostWindowSatellite * GetSatelliteWindowFromHandle(HWND hwnd)

References flutter::WindowManager::GetSatelliteWindowFromHandle().

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

◆ InternalFlutterWindows_WindowManager_SetWindowConstraints()

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

Definition at line 273 of file window_manager.cc.

275  {
277  if (window) {
278  window->SetConstraints(*constraints);
279  }
280 }
void SetConstraints(const WindowConstraints &constraints)
Definition: host_window.cc:601

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

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

◆ InternalFlutterWindows_WindowManager_SetWindowSize()

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

Definition at line 260 of file window_manager.cc.

262  {
264  if (window) {
265  window->SetContentSize(*size);
266  }
267 }
void SetContentSize(const WindowSizeRequest &size)
Definition: host_window.cc:559

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

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

◆ InternalFlutterWindows_WindowManager_UpdatePopupPosition()

FLUTTER_EXPORT void InternalFlutterWindows_WindowManager_UpdatePopupPosition ( HWND  hwnd)

◆ InternalFlutterWindows_WindowManager_UpdateTooltipPosition()

FLUTTER_EXPORT void InternalFlutterWindows_WindowManager_UpdateTooltipPosition ( HWND  hwnd)