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::WindowsMessage
 
struct  flutter::WindowSizing
 
struct  flutter::WindowingInitRequest
 
struct  flutter::WindowCreationRequest
 
class  flutter::WindowManager
 
struct  FlutterWindowSize
 

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

Function Documentation

◆ InternalFlutterWindows_WindowManager_CreateRegularWindow()

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

Definition at line 116 of file window_manager.cc.

118  {
121  return engine->window_manager()->CreateRegularWindow(request);
122 }
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_GetTopLevelWindowHandle()

FLUTTER_EXPORT HWND InternalFlutterWindows_WindowManager_GetTopLevelWindowHandle ( int64_t  engine_id,
FlutterViewId  view_id 
)

Definition at line 124 of file window_manager.cc.

126  {
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 }
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 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 }
UINT FlutterDesktopGetDpiForHWND(HWND hwnd)

References FlutterDesktopGetDpiForHWND().

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

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

Definition at line 151 of file window_manager.cc.

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

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

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