| Flutter Windows Embedder |

Public Member Functions | List of all members
flutter::DisplayManagerWin32 Class Reference

`#include <display_manager.h>`

## Public Member Functions
| DisplayManagerWin32 (FlutterWindowsEngine *engine)
| ~DisplayManagerWin32 ()
void | UpdateDisplays ()
bool | HandleWindowMessage (HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam, LRESULT *result)
std::optional< FlutterEngineDisplay > | FindById (FlutterEngineDisplayId id)
std::vector< FlutterEngineDisplay > | GetDisplays () const

## Detailed Description

Definition at line 18 of file display_manager.h.

## Constructor & Destructor Documentation

## ◆ DisplayManagerWin32()

flutter::DisplayManagerWin32::DisplayManagerWin32 | ( | FlutterWindowsEngine * | engine | ) |
| explicit

Definition at line 24 of file display_manager.cc.

25 : engine_(engine), win32_(engine->windows_proc_table()) {}

## ◆ ~DisplayManagerWin32()

flutter::DisplayManagerWin32::~DisplayManagerWin32 | ( |  | ) |
| default

## Member Function Documentation

## ◆ FindById()

std::optional< FlutterEngineDisplay > flutter::DisplayManagerWin32::FindById | ( | FlutterEngineDisplayId | id | ) |

Definition at line 96 of file display_manager.cc.

97 {
98 for (auto const& display : GetDisplays()) {
99 if (display.display_id == id) {
100 return display;
101 }
102 }
103
104 return std::nullopt;
105 }
flutter::DisplayManagerWin32::GetDisplays
std::vector< FlutterEngineDisplay > GetDisplays() const
Definition: display_manager.cc:107

References GetDisplays().

## ◆ GetDisplays()

std::vector< FlutterEngineDisplay > flutter::DisplayManagerWin32::GetDisplays | ( |  | ) | const

Definition at line 107 of file display_manager.cc.

107 {
108 std::vector<FlutterEngineDisplay> displays;
109 MonitorEnumState state = {this, &displays};
110 win32_->EnumDisplayMonitors(nullptr, nullptr, EnumMonitorCallback,
111 reinterpret_cast<LPARAM>(&state));
112
113 if (displays.size() == 1) {
114 displays[0].single_display = true;
115 }
116
117 return displays;
118 }
displays
std::vector< FlutterEngineDisplay > * displays
Definition: display_manager.cc:19

References displays.

Referenced by FindById(), and UpdateDisplays().

## ◆ HandleWindowMessage()

bool flutter::DisplayManagerWin32::HandleWindowMessage | ( | HWND | hwnd,
|  | UINT | message,
|  | WPARAM | wparam,
|  | LPARAM | lparam,
|  | LRESULT * | result
| ) |  |

Definition at line 82 of file display_manager.cc.

86 {
87 switch (message) {
88 case WM_DISPLAYCHANGE:
89 case WM_DPICHANGED:
90 UpdateDisplays();
91 break;
92 }
93 return false;
94 }
flutter::DisplayManagerWin32::UpdateDisplays
void UpdateDisplays()
Definition: display_manager.cc:77
message
Win32Message message
Definition: keyboard_unittests.cc:137

References message, and UpdateDisplays().

## ◆ UpdateDisplays()

void flutter::DisplayManagerWin32::UpdateDisplays | ( |  | ) |

Definition at line 77 of file display_manager.cc.

77 {
78 auto displays = GetDisplays();
79 engine_->UpdateDisplay(displays);
80 }
flutter::FlutterWindowsEngine::UpdateDisplay
void UpdateDisplay(const std::vector< FlutterEngineDisplay > &displays)
Definition: flutter_windows_engine.cc:710

References displays, GetDisplays(), and flutter::FlutterWindowsEngine::UpdateDisplay().

Referenced by HandleWindowMessage().

The documentation for this class was generated from the following files:

- shell/platform/windows/display_manager.h
- shell/platform/windows/display_manager.cc