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::WindowCreationRequest
 
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 bool InternalFlutterWindows_WindowManager_HasTopLevelWindows (int64_t engine_id)
 
FLUTTER_EXPORT FlutterViewId InternalFlutterWindows_WindowManager_CreateRegularWindow (int64_t engine_id, const flutter::WindowCreationRequest *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_CreateRegularWindow()

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

Definition at line 117 of file window_manager.cc.

119  {
122  return engine->window_manager()->CreateRegularWindow(request);
123 }
static FlutterWindowsEngine * GetEngineForId(int64_t engine_id)
FlutterViewId CreateRegularWindow(const WindowCreationRequest *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 174 of file window_manager.cc.

174  {
176  if (window) {
177  return window->GetFullscreen();
178  }
179 
180  return false;
181 }
static HostWindow * GetThisFromHandle(HWND hwnd)
Definition: host_window.cc:396
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()

FLUTTER_EXPORT HWND InternalFlutterWindows_WindowManager_GetTopLevelWindowHandle ( int64_t  engine_id,
FlutterViewId  view_id 
)

Definition at line 125 of file window_manager.cc.

127  {
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 }
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 139 of file window_manager.cc.

139  {
141 }
static ActualWindowSize GetWindowContentSize(HWND hwnd)
Definition: host_window.cc:752

References flutter::HostWindow::GetWindowContentSize().

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

◆ InternalFlutterWindows_WindowManager_HasTopLevelWindows()

FLUTTER_EXPORT bool InternalFlutterWindows_WindowManager_HasTopLevelWindows ( int64_t  engine_id)

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

163  {
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 }
void SetFullscreen(bool fullscreen, std::optional< FlutterEngineDisplayId > display_id)
Definition: host_window.cc:602
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 152 of file window_manager.cc.

154  {
156  if (window) {
157  window->SetConstraints(*constraints);
158  }
159 }
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()

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

Definition at line 143 of file window_manager.cc.

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

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

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