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::RegularWindowCreationRequest
 
struct  flutter::DialogWindowCreationRequest
 
struct  flutter::WindowsMessage
 
struct  flutter::WindowingInitRequest
 
struct  flutter::ActualWindowSize
 
struct  flutter::FullscreenRequest
 
class  flutter::WindowManager
 

Namespaces

 flutter
 

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 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 bool InternalFlutterWindows_WindowManager_GetFullscreen (HWND hwnd)
 

Function Documentation

◆ InternalFlutterWindows_WindowManager_CreateDialogWindow()

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

Definition at line 129 of file window_manager.cc.

131  {
134  return engine->window_manager()->CreateDialogWindow(request);
135 }
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_CreateRegularWindow()

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

Definition at line 120 of file window_manager.cc.

122  {
125  return engine->window_manager()->CreateRegularWindow(request);
126 }
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_GetFullscreen()

FLUTTER_EXPORT bool InternalFlutterWindows_WindowManager_GetFullscreen ( HWND  hwnd)

Definition at line 186 of file window_manager.cc.

186  {
188  if (window) {
189  return window->GetFullscreen();
190  }
191 
192  return false;
193 }
static HostWindow * GetThisFromHandle(HWND hwnd)
Definition: host_window.cc:327
virtual bool GetFullscreen() const
Definition: host_window.cc:708

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 137 of file window_manager.cc.

139  {
142  flutter::FlutterWindowsView* view = engine->view(view_id);
143  if (view == nullptr) {
144  return nullptr;
145  } else {
146  return GetAncestor(view->GetWindowHandle(), GA_ROOT);
147  }
148 }
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 151 of file window_manager.cc.

151  {
153 }
static ActualWindowSize GetWindowContentSize(HWND hwnd)
Definition: host_window.cc:712

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

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

Definition at line 173 of file window_manager.cc.

175  {
177  const std::optional<FlutterEngineDisplayId> display_id =
178  request->has_display_id
179  ? std::optional<FlutterEngineDisplayId>(request->display_id)
180  : std::nullopt;
181  if (window) {
182  window->SetFullscreen(request->fullscreen, display_id);
183  }
184 }
virtual void SetFullscreen(bool fullscreen, std::optional< FlutterEngineDisplayId > display_id)
Definition: host_window.cc:562
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_SetWindowConstraints()

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

Definition at line 164 of file window_manager.cc.

166  {
168  if (window) {
169  window->SetConstraints(*constraints);
170  }
171 }
void SetConstraints(const WindowConstraints &constraints)
Definition: host_window.cc:521

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 155 of file window_manager.cc.

157  {
159  if (window) {
160  window->SetContentSize(*size);
161  }
162 }
void SetContentSize(const WindowSizeRequest &size)
Definition: host_window.cc:479

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

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