Flutter Windows Embedder
flutter_windows.cc
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
6 
7 #include <io.h>
8 
9 #include <algorithm>
10 #include <chrono>
11 #include <cstdlib>
12 #include <filesystem>
13 #include <memory>
14 #include <vector>
15 
19 #include "flutter/shell/platform/embedder/embedder.h"
28 
29 static_assert(FLUTTER_ENGINE_VERSION == 1, "");
30 
31 // Returns the engine corresponding to the given opaque API handle.
34  return reinterpret_cast<flutter::FlutterWindowsEngine*>(ref);
35 }
36 
37 // Returns the opaque API handle for the given engine instance.
40  return reinterpret_cast<FlutterDesktopEngineRef>(engine);
41 }
42 
45  return reinterpret_cast<flutter::FlutterWindowsViewController*>(ref);
46 }
47 
49  flutter::FlutterWindowsViewController* view_controller) {
50  return reinterpret_cast<FlutterDesktopViewControllerRef>(view_controller);
51 }
52 
53 // Returns the view corresponding to the given opaque API handle.
55  return reinterpret_cast<flutter::FlutterWindowsView*>(ref);
56 }
57 
58 // Returns the opaque API handle for the given view instance.
60  return reinterpret_cast<FlutterDesktopViewRef>(view);
61 }
62 
63 // Returns the texture registrar corresponding to the given opaque API handle.
66  return reinterpret_cast<flutter::FlutterWindowsTextureRegistrar*>(ref);
67 }
68 
69 // Returns the opaque API handle for the given texture registrar instance.
72  return reinterpret_cast<FlutterDesktopTextureRegistrarRef>(registrar);
73 }
74 
76  int width,
77  int height,
78  FlutterDesktopEngineRef engine_ref) {
79  flutter::FlutterWindowsEngine* engine_ptr = EngineFromHandle(engine_ref);
80  std::unique_ptr<flutter::WindowBindingHandler> window_wrapper =
81  std::make_unique<flutter::FlutterWindow>(
82  width, height, engine_ptr->windows_proc_table());
83 
84  auto engine = std::unique_ptr<flutter::FlutterWindowsEngine>(engine_ptr);
85  auto view = std::make_unique<flutter::FlutterWindowsView>(
86  std::move(window_wrapper), engine_ptr->windows_proc_table());
87  auto controller = std::make_unique<flutter::FlutterWindowsViewController>(
88  std::move(engine), std::move(view));
89 
90  controller->view()->SetEngine(controller->engine());
91  controller->view()->CreateRenderSurface();
92  if (!controller->engine()->running()) {
93  if (!controller->engine()->Run()) {
94  return nullptr;
95  }
96  }
97 
98  // Must happen after engine is running.
99  controller->view()->SendInitialBounds();
100 
101  // The Windows embedder listens to accessibility updates using the
102  // view's HWND. The embedder's accessibility features may be stale if
103  // the app was in headless mode.
104  controller->engine()->UpdateAccessibilityFeatures();
105 
106  return HandleForViewController(controller.release());
107 }
108 
110  auto controller = ViewControllerFromHandle(ref);
111  delete controller;
112 }
113 
116  auto controller = ViewControllerFromHandle(ref);
117  return HandleForEngine(controller->engine());
118 }
119 
122  auto controller = ViewControllerFromHandle(ref);
123  return HandleForView(controller->view());
124 }
125 
128  auto controller = ViewControllerFromHandle(ref);
129  controller->view()->ForceRedraw();
130 }
131 
134  HWND hwnd,
135  UINT message,
136  WPARAM wparam,
137  LPARAM lparam,
138  LRESULT* result) {
139  auto controller = ViewControllerFromHandle(ref);
140  std::optional<LRESULT> delegate_result =
141  controller->engine()
142  ->window_proc_delegate_manager()
143  ->OnTopLevelWindowProc(hwnd, message, wparam, lparam);
144  if (delegate_result) {
145  *result = *delegate_result;
146  }
147  return delegate_result.has_value();
148 }
149 
151  const FlutterDesktopEngineProperties* engine_properties) {
152  flutter::FlutterProjectBundle project(*engine_properties);
153  auto engine = std::make_unique<flutter::FlutterWindowsEngine>(project);
154  return HandleForEngine(engine.release());
155 }
156 
158  flutter::FlutterWindowsEngine* engine = EngineFromHandle(engine_ref);
159  bool result = true;
160  if (engine->running()) {
161  result = engine->Stop();
162  }
163  delete engine;
164  return result;
165 }
166 
168  const char* entry_point) {
169  std::string_view entry_point_view{""};
170  if (entry_point != nullptr) {
171  entry_point_view = entry_point;
172  }
173 
174  return EngineFromHandle(engine)->Run(entry_point_view);
175 }
176 
178  return std::chrono::nanoseconds::max().count();
179 }
180 
183 }
184 
187  const char* plugin_name) {
188  // Currently, one registrar acts as the registrar for all plugins, so the
189  // name is ignored. It is part of the API to reduce churn in the future when
190  // aligning more closely with the Flutter registrar system.
191 
192  return EngineFromHandle(engine)->GetRegistrar();
193 }
194 
196  FlutterDesktopEngineRef engine) {
197  return EngineFromHandle(engine)->messenger();
198 }
199 
201  FlutterDesktopEngineRef engine) {
203  EngineFromHandle(engine)->texture_registrar());
204 }
205 
208  void* user_data) {
210  [callback, user_data]() { callback(user_data); });
211 }
212 
214  return ViewFromHandle(view)->GetWindowHandle();
215 }
216 
218  auto surface_manager = ViewFromHandle(view)->GetEngine()->surface_manager();
219  if (surface_manager) {
220  Microsoft::WRL::ComPtr<ID3D11Device> d3d_device;
221  Microsoft::WRL::ComPtr<IDXGIDevice> dxgi_device;
222  if (surface_manager->GetDevice(d3d_device.GetAddressOf()) &&
223  SUCCEEDED(d3d_device.As(&dxgi_device))) {
224  IDXGIAdapter* adapter;
225  if (SUCCEEDED(dxgi_device->GetAdapter(&adapter))) {
226  return adapter;
227  }
228  }
229  }
230  return nullptr;
231 }
232 
235  HWND hwnd,
236  UINT message,
237  WPARAM wparam,
238  LPARAM lparam,
239  LRESULT* result) {
240  std::optional<LRESULT> lresult =
242  wparam, lparam);
243  if (result && lresult.has_value()) {
244  *result = lresult.value();
245  }
246  return lresult.has_value();
247 }
248 
251  return HandleForView(registrar->engine->view());
252 }
253 
257  void* user_data) {
260 }
261 
267 }
268 
270  return flutter::GetDpiForHWND(hwnd);
271 }
272 
273 UINT FlutterDesktopGetDpiForMonitor(HMONITOR monitor) {
274  return flutter::GetDpiForMonitor(monitor);
275 }
276 
278  FILE* unused;
279  if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
280  _dup2(_fileno(stdout), 1);
281  }
282  if (freopen_s(&unused, "CONOUT$", "w", stderr)) {
283  _dup2(_fileno(stdout), 2);
284  }
285  std::ios::sync_with_stdio();
286 }
287 
288 // Implementations of common/ API methods.
289 
292  return registrar->engine->messenger();
293 }
294 
298  registrar->engine->AddPluginRegistrarDestructionCallback(callback, registrar);
299 }
300 
302  const char* channel,
303  const uint8_t* message,
304  const size_t message_size,
305  const FlutterDesktopBinaryReply reply,
306  void* user_data) {
307  FML_DCHECK(FlutterDesktopMessengerIsAvailable(messenger))
308  << "Messenger must reference a running engine to send a message";
309 
311  ->GetEngine()
312  ->SendPlatformMessage(channel, message, message_size, reply, user_data);
313 }
314 
316  const char* channel,
317  const uint8_t* message,
318  const size_t message_size) {
319  return FlutterDesktopMessengerSendWithReply(messenger, channel, message,
320  message_size, nullptr, nullptr);
321 }
322 
324  FlutterDesktopMessengerRef messenger,
326  const uint8_t* data,
327  size_t data_length) {
328  FML_DCHECK(FlutterDesktopMessengerIsAvailable(messenger))
329  << "Messenger must reference a running engine to send a response";
330 
332  ->GetEngine()
333  ->SendPlatformMessageResponse(handle, data, data_length);
334 }
335 
337  const char* channel,
339  void* user_data) {
340  FML_DCHECK(FlutterDesktopMessengerIsAvailable(messenger))
341  << "Messenger must reference a running engine to set a callback";
342 
344  ->GetEngine()
347 }
348 
350  FlutterDesktopMessengerRef messenger) {
352  ->AddRef()
353  ->ToRef();
354 }
355 
358 }
359 
362  nullptr;
363 }
364 
366  FlutterDesktopMessengerRef messenger) {
368  return messenger;
369 }
370 
373 }
374 
377  return HandleForTextureRegistrar(registrar->engine->texture_registrar());
378 }
379 
381  FlutterDesktopTextureRegistrarRef texture_registrar,
382  const FlutterDesktopTextureInfo* texture_info) {
383  return TextureRegistrarFromHandle(texture_registrar)
384  ->RegisterTexture(texture_info);
385 }
386 
388  FlutterDesktopTextureRegistrarRef texture_registrar,
389  int64_t texture_id,
390  void (*callback)(void* user_data),
391  void* user_data) {
392  auto registrar = TextureRegistrarFromHandle(texture_registrar);
393  if (callback) {
394  registrar->UnregisterTexture(
396  return;
397  }
398  registrar->UnregisterTexture(texture_id);
399 }
400 
402  FlutterDesktopTextureRegistrarRef texture_registrar,
403  int64_t texture_id) {
404  return TextureRegistrarFromHandle(texture_registrar)
406 }
FlutterDesktopViewControllerHandleTopLevelWindowProc
bool FlutterDesktopViewControllerHandleTopLevelWindowProc(FlutterDesktopViewControllerRef ref, HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam, LRESULT *result)
Definition: flutter_windows.cc:132
flutter::FlutterWindowsEngine::GetRegistrar
FlutterDesktopPluginRegistrarRef GetRegistrar()
Definition: flutter_windows_engine.cc:497
TextureRegistrarFromHandle
static flutter::FlutterWindowsTextureRegistrar * TextureRegistrarFromHandle(FlutterDesktopTextureRegistrarRef ref)
Definition: flutter_windows.cc:64
flutter::FlutterProjectBundle
Definition: flutter_project_bundle.h:21
FlutterDesktopViewGetHWND
HWND FlutterDesktopViewGetHWND(FlutterDesktopViewRef view)
Definition: flutter_windows.cc:213
FlutterDesktopViewControllerGetView
FlutterDesktopViewRef FlutterDesktopViewControllerGetView(FlutterDesktopViewControllerRef ref)
Definition: flutter_windows.cc:120
FlutterDesktopEngineGetTextureRegistrar
FlutterDesktopTextureRegistrarRef FlutterDesktopEngineGetTextureRegistrar(FlutterDesktopEngineRef engine)
Definition: flutter_windows.cc:200
FlutterDesktopPluginRegistrarGetView
FlutterDesktopViewRef FlutterDesktopPluginRegistrarGetView(FlutterDesktopPluginRegistrarRef registrar)
Definition: flutter_windows.cc:249
FlutterDesktopEngineGetMessenger
FlutterDesktopMessengerRef FlutterDesktopEngineGetMessenger(FlutterDesktopEngineRef engine)
Definition: flutter_windows.cc:195
FlutterDesktopPluginRegistrarRegisterTopLevelWindowProcDelegate
void FlutterDesktopPluginRegistrarRegisterTopLevelWindowProcDelegate(FlutterDesktopPluginRegistrarRef registrar, FlutterDesktopWindowProcCallback delegate, void *user_data)
Definition: flutter_windows.cc:254
flutter::FlutterWindowsView
Definition: flutter_windows_view.h:35
HandleForView
static FlutterDesktopViewRef HandleForView(flutter::FlutterWindowsView *view)
Definition: flutter_windows.cc:59
FlutterDesktopEngineProperties
Definition: flutter_windows.h:36
plugin_registrar.h
FlutterDesktopMessengerUnlock
void FlutterDesktopMessengerUnlock(FlutterDesktopMessengerRef messenger)
Definition: flutter_windows.cc:371
FlutterDesktopMessengerSend
bool FlutterDesktopMessengerSend(FlutterDesktopMessengerRef messenger, const char *channel, const uint8_t *message, const size_t message_size)
Definition: flutter_windows.cc:315
FlutterDesktopBinaryReply
void(* FlutterDesktopBinaryReply)(const uint8_t *data, size_t data_size, void *user_data)
Definition: flutter_messenger.h:26
HandleForTextureRegistrar
static FlutterDesktopTextureRegistrarRef HandleForTextureRegistrar(flutter::FlutterWindowsTextureRegistrar *registrar)
Definition: flutter_windows.cc:70
flutter::FlutterWindowsEngine::SetNextFrameCallback
void SetNextFrameCallback(fml::closure callback)
Definition: flutter_windows_engine.cc:591
flutter::GetDpiForMonitor
UINT GetDpiForMonitor(HMONITOR monitor)
Definition: dpi_utils.cc:134
user_data
void * user_data
Definition: flutter_windows_view_unittests.cc:49
flutter::FlutterWindowsTextureRegistrar::MarkTextureFrameAvailable
bool MarkTextureFrameAvailable(int64_t texture_id)
Definition: flutter_windows_texture_registrar.cc:103
flutter::FlutterWindowsEngine
Definition: flutter_windows_engine.h:78
flutter::FlutterWindowsEngine::window_proc_delegate_manager
WindowProcDelegateManager * window_proc_delegate_manager()
Definition: flutter_windows_engine.h:148
flutter::FlutterWindowsEngine::running
virtual bool running() const
Definition: flutter_windows_engine.h:105
flutter::WindowProcDelegateManager::RegisterTopLevelWindowProcDelegate
void RegisterTopLevelWindowProcDelegate(FlutterDesktopWindowProcCallback delegate, void *user_data)
Definition: window_proc_delegate_manager.cc:14
FlutterDesktopMessageResponseHandle
struct _FlutterPlatformMessageResponseHandle FlutterDesktopMessageResponseHandle
Definition: flutter_messenger.h:22
FlutterDesktopEngineProcessExternalWindowMessage
bool FlutterDesktopEngineProcessExternalWindowMessage(FlutterDesktopEngineRef engine, HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam, LRESULT *result)
Definition: flutter_windows.cc:233
FlutterDesktopPluginRegistrarSetDestructionHandler
void FlutterDesktopPluginRegistrarSetDestructionHandler(FlutterDesktopPluginRegistrarRef registrar, FlutterDesktopOnPluginRegistrarDestroyed callback)
Definition: flutter_windows.cc:295
FlutterDesktopEngineGetPluginRegistrar
FlutterDesktopPluginRegistrarRef FlutterDesktopEngineGetPluginRegistrar(FlutterDesktopEngineRef engine, const char *plugin_name)
Definition: flutter_windows.cc:185
flutter::GetDpiForHWND
UINT GetDpiForHWND(HWND hwnd)
Definition: dpi_utils.cc:130
flutter::FlutterWindowsEngine::windows_proc_table
std::shared_ptr< WindowsProcTable > windows_proc_table()
Definition: flutter_windows_engine.h:278
EngineFromHandle
static flutter::FlutterWindowsEngine * EngineFromHandle(FlutterDesktopEngineRef ref)
Definition: flutter_windows.cc:32
FlutterDesktopPluginRegistrarGetMessenger
FlutterDesktopMessengerRef FlutterDesktopPluginRegistrarGetMessenger(FlutterDesktopPluginRegistrarRef registrar)
Definition: flutter_windows.cc:290
flutter::FlutterDesktopMessenger::ToRef
FlutterDesktopMessengerRef ToRef()
Convert to FlutterDesktopMessengerRef.
Definition: flutter_desktop_messenger.h:28
flutter::FlutterWindowsView::GetWindowHandle
virtual HWND GetWindowHandle() const
Definition: flutter_windows_view.cc:645
flutter::FlutterWindowsEngine::SendPlatformMessage
bool SendPlatformMessage(const char *channel, const uint8_t *message, const size_t message_size, const FlutterDesktopBinaryReply reply, void *user_data)
Definition: flutter_windows_engine.cc:528
FlutterDesktopResyncOutputStreams
void FlutterDesktopResyncOutputStreams()
Definition: flutter_windows.cc:277
flutter::FlutterWindowsEngine::Stop
virtual bool Stop()
Definition: flutter_windows_engine.cc:450
flutter::FlutterWindowsEngine::messenger
FlutterDesktopMessengerRef messenger()
Definition: flutter_windows_engine.h:130
HandleForViewController
static FlutterDesktopViewControllerRef HandleForViewController(flutter::FlutterWindowsViewController *view_controller)
Definition: flutter_windows.cc:48
flutter::FlutterWindowsEngine::ProcessExternalWindowMessage
std::optional< LRESULT > ProcessExternalWindowMessage(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
Definition: flutter_windows_engine.cc:814
path_utils.h
FlutterDesktopMessengerLock
FlutterDesktopMessengerRef FlutterDesktopMessengerLock(FlutterDesktopMessengerRef messenger)
Definition: flutter_windows.cc:365
flutter_windows_view.h
flutter::FlutterDesktopMessenger::GetMutex
std::mutex & GetMutex()
Definition: flutter_desktop_messenger.h:70
flutter::FlutterDesktopMessenger::Release
void Release()
Definition: flutter_desktop_messenger.h:59
FlutterDesktopViewRef
struct FlutterDesktopView * FlutterDesktopViewRef
Definition: flutter_windows.h:29
FlutterDesktopEngineRef
struct FlutterDesktopEngine * FlutterDesktopEngineRef
Definition: flutter_windows.h:33
flutter::WindowProcDelegateManager::UnregisterTopLevelWindowProcDelegate
void UnregisterTopLevelWindowProcDelegate(FlutterDesktopWindowProcCallback delegate)
Definition: window_proc_delegate_manager.cc:20
flutter::FlutterWindowsTextureRegistrar
Definition: flutter_windows_texture_registrar.h:24
flutter_window.h
flutter::FlutterWindowsEngine::texture_registrar
FlutterWindowsTextureRegistrar * texture_registrar()
Definition: flutter_windows_engine.h:138
flutter::FlutterWindowsViewController
Controls a view that displays Flutter content.
Definition: flutter_windows_view_controller.h:16
FlutterDesktopRegistrarGetTextureRegistrar
FlutterDesktopTextureRegistrarRef FlutterDesktopRegistrarGetTextureRegistrar(FlutterDesktopPluginRegistrarRef registrar)
Definition: flutter_windows.cc:375
flutter::FlutterWindowsEngine::AddPluginRegistrarDestructionCallback
void AddPluginRegistrarDestructionCallback(FlutterDesktopOnPluginRegistrarDestroyed callback, FlutterDesktopPluginRegistrarRef registrar)
Definition: flutter_windows_engine.cc:501
FlutterDesktopTextureRegistrarRef
struct FlutterDesktopTextureRegistrar * FlutterDesktopTextureRegistrarRef
Definition: flutter_texture_registrar.h:19
FlutterDesktopGetDpiForMonitor
UINT FlutterDesktopGetDpiForMonitor(HMONITOR monitor)
Definition: flutter_windows.cc:273
window_binding_handler.h
flutter_project_bundle.h
dpi_utils.h
FlutterDesktopTextureInfo
Definition: flutter_texture_registrar.h:151
FlutterDesktopEngineProcessMessages
uint64_t FlutterDesktopEngineProcessMessages(FlutterDesktopEngineRef engine)
Definition: flutter_windows.cc:177
window_state.h
FlutterDesktopViewControllerRef
struct FlutterDesktopViewController * FlutterDesktopViewControllerRef
Definition: flutter_windows.h:25
FlutterDesktopPluginRegistrar::engine
flutter::FlutterWindowsEngine * engine
Definition: window_state.h:25
FlutterDesktopTextureRegistrarUnregisterExternalTexture
void FlutterDesktopTextureRegistrarUnregisterExternalTexture(FlutterDesktopTextureRegistrarRef texture_registrar, int64_t texture_id, void(*callback)(void *user_data), void *user_data)
Definition: flutter_windows.cc:387
flutter::FlutterWindowsEngine::SendPlatformMessageResponse
void SendPlatformMessageResponse(const FlutterDesktopMessageResponseHandle *handle, const uint8_t *data, size_t data_length)
Definition: flutter_windows_engine.cc:562
flutter_windows_view_controller.h
flutter::FlutterDesktopMessenger::GetEngine
flutter::FlutterWindowsEngine * GetEngine() const
Getter for the engine field.
Definition: flutter_desktop_messenger.h:38
flutter::IncomingMessageDispatcher::SetMessageCallback
void SetMessageCallback(const std::string &channel, FlutterDesktopMessageCallback callback, void *user_data)
Definition: incoming_message_dispatcher.cc:43
FlutterDesktopPluginRegistrarUnregisterTopLevelWindowProcDelegate
void FlutterDesktopPluginRegistrarUnregisterTopLevelWindowProcDelegate(FlutterDesktopPluginRegistrarRef registrar, FlutterDesktopWindowProcCallback delegate)
Definition: flutter_windows.cc:262
FlutterDesktopOnPluginRegistrarDestroyed
void(* FlutterDesktopOnPluginRegistrarDestroyed)(FlutterDesktopPluginRegistrarRef)
Definition: flutter_plugin_registrar.h:23
FlutterDesktopViewControllerForceRedraw
void FlutterDesktopViewControllerForceRedraw(FlutterDesktopViewControllerRef ref)
Definition: flutter_windows.cc:126
flutter::FlutterWindowsEngine::surface_manager
AngleSurfaceManager * surface_manager() const
Definition: flutter_windows_engine.h:144
flutter::FlutterWindowsEngine::message_dispatcher
IncomingMessageDispatcher * message_dispatcher()
Definition: flutter_windows_engine.h:132
flutter::FlutterDesktopMessenger::AddRef
FlutterDesktopMessenger * AddRef()
Definition: flutter_desktop_messenger.h:50
FlutterDesktopTextureRegistrarMarkExternalTextureFrameAvailable
bool FlutterDesktopTextureRegistrarMarkExternalTextureFrameAvailable(FlutterDesktopTextureRegistrarRef texture_registrar, int64_t texture_id)
Definition: flutter_windows.cc:401
FlutterDesktopEngineDestroy
bool FlutterDesktopEngineDestroy(FlutterDesktopEngineRef engine_ref)
Definition: flutter_windows.cc:157
flutter_windows_engine.h
FlutterDesktopEngineCreate
FlutterDesktopEngineRef FlutterDesktopEngineCreate(const FlutterDesktopEngineProperties *engine_properties)
Definition: flutter_windows.cc:150
FlutterDesktopMessengerRef
struct FlutterDesktopMessenger * FlutterDesktopMessengerRef
Definition: flutter_messenger.h:19
FlutterDesktopMessengerSendResponse
void FlutterDesktopMessengerSendResponse(FlutterDesktopMessengerRef messenger, const FlutterDesktopMessageResponseHandle *handle, const uint8_t *data, size_t data_length)
Definition: flutter_windows.cc:323
FlutterDesktopMessengerIsAvailable
bool FlutterDesktopMessengerIsAvailable(FlutterDesktopMessengerRef messenger)
Definition: flutter_windows.cc:360
FlutterDesktopViewControllerGetEngine
FlutterDesktopEngineRef FlutterDesktopViewControllerGetEngine(FlutterDesktopViewControllerRef ref)
Definition: flutter_windows.cc:114
HandleForEngine
static FlutterDesktopEngineRef HandleForEngine(flutter::FlutterWindowsEngine *engine)
Definition: flutter_windows.cc:38
ViewFromHandle
static flutter::FlutterWindowsView * ViewFromHandle(FlutterDesktopViewRef ref)
Definition: flutter_windows.cc:54
flutter::FlutterWindowsEngine::view
FlutterWindowsView * view()
Definition: flutter_windows_engine.h:117
ViewControllerFromHandle
static flutter::FlutterWindowsViewController * ViewControllerFromHandle(FlutterDesktopViewControllerRef ref)
Definition: flutter_windows.cc:43
VoidCallback
void(* VoidCallback)(void *)
Definition: flutter_windows.h:21
flutter_windows.h
message
Win32Message message
Definition: keyboard_unittests.cc:137
FlutterDesktopViewControllerDestroy
void FlutterDesktopViewControllerDestroy(FlutterDesktopViewControllerRef ref)
Definition: flutter_windows.cc:109
flutter::FlutterDesktopMessenger::FromRef
static FlutterDesktopMessenger * FromRef(FlutterDesktopMessengerRef ref)
Convert from FlutterDesktopMessengerRef.
Definition: flutter_desktop_messenger.h:33
FlutterDesktopEngineSetNextFrameCallback
void FlutterDesktopEngineSetNextFrameCallback(FlutterDesktopEngineRef engine, VoidCallback callback, void *user_data)
Definition: flutter_windows.cc:206
incoming_message_dispatcher.h
FlutterDesktopMessengerRelease
void FlutterDesktopMessengerRelease(FlutterDesktopMessengerRef messenger)
Definition: flutter_windows.cc:356
FlutterDesktopTextureRegistrarRegisterExternalTexture
int64_t FlutterDesktopTextureRegistrarRegisterExternalTexture(FlutterDesktopTextureRegistrarRef texture_registrar, const FlutterDesktopTextureInfo *texture_info)
Definition: flutter_windows.cc:380
FlutterDesktopMessengerSetCallback
void FlutterDesktopMessengerSetCallback(FlutterDesktopMessengerRef messenger, const char *channel, FlutterDesktopMessageCallback callback, void *user_data)
Definition: flutter_windows.cc:336
FlutterDesktopViewGetGraphicsAdapter
IDXGIAdapter * FlutterDesktopViewGetGraphicsAdapter(FlutterDesktopViewRef view)
Definition: flutter_windows.cc:217
texture_id
int64_t texture_id
Definition: texture_registrar_unittests.cc:24
FlutterDesktopMessageCallback
void(* FlutterDesktopMessageCallback)(FlutterDesktopMessengerRef, const FlutterDesktopMessage *, void *)
Definition: flutter_messenger.h:49
FlutterDesktopGetDpiForHWND
UINT FlutterDesktopGetDpiForHWND(HWND hwnd)
Definition: flutter_windows.cc:269
FlutterDesktopPluginRegistrar
Definition: window_state.h:23
FlutterDesktopEngineRun
bool FlutterDesktopEngineRun(FlutterDesktopEngineRef engine, const char *entry_point)
Definition: flutter_windows.cc:167
flutter::FlutterWindowsEngine::Run
bool Run()
Definition: flutter_windows_engine.cc:254
flutter::FlutterWindowsView::GetEngine
FlutterWindowsEngine * GetEngine()
Definition: flutter_windows_view.cc:649
FlutterDesktopWindowProcCallback
bool(* FlutterDesktopWindowProcCallback)(HWND, UINT, WPARAM, LPARAM, void *, LRESULT *result)
Definition: flutter_windows.h:238
flutter::FlutterWindowsTextureRegistrar::RegisterTexture
int64_t RegisterTexture(const FlutterDesktopTextureInfo *texture_info)
Definition: flutter_windows_texture_registrar.cc:26
FlutterDesktopMessengerSendWithReply
bool FlutterDesktopMessengerSendWithReply(FlutterDesktopMessengerRef messenger, const char *channel, const uint8_t *message, const size_t message_size, const FlutterDesktopBinaryReply reply, void *user_data)
Definition: flutter_windows.cc:301
FlutterDesktopViewControllerCreate
FlutterDesktopViewControllerRef FlutterDesktopViewControllerCreate(int width, int height, FlutterDesktopEngineRef engine_ref)
Definition: flutter_windows.cc:75
flutter::FlutterWindowsEngine::ReloadSystemFonts
void ReloadSystemFonts()
Definition: flutter_windows_engine.cc:583
FlutterDesktopEngineReloadSystemFonts
void FlutterDesktopEngineReloadSystemFonts(FlutterDesktopEngineRef engine)
Definition: flutter_windows.cc:181
callback
FlutterDesktopBinaryReply callback
Definition: flutter_windows_view_unittests.cc:48
FlutterDesktopMessengerAddRef
FlutterDesktopMessengerRef FlutterDesktopMessengerAddRef(FlutterDesktopMessengerRef messenger)
Definition: flutter_windows.cc:349