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 
75 // Creates a view controller that might own the engine.
76 //
77 // If `owns_engine` is true, then the returned `FlutterDesktopViewControllerRef`
78 // owns `engine_ref` and will deallocate `engine_ref` upon its own destruction.
80  FlutterDesktopEngineRef engine_ref,
81  int width,
82  int height,
83  bool owns_engine) {
84  flutter::FlutterWindowsEngine* engine_ptr = EngineFromHandle(engine_ref);
85  std::unique_ptr<flutter::WindowBindingHandler> window_wrapper =
86  std::make_unique<flutter::FlutterWindow>(
87  width, height, engine_ptr->windows_proc_table());
88 
89  std::unique_ptr<flutter::FlutterWindowsEngine> engine;
90  if (owns_engine) {
91  engine = std::unique_ptr<flutter::FlutterWindowsEngine>(engine_ptr);
92  }
93 
94  std::unique_ptr<flutter::FlutterWindowsView> view =
95  engine_ptr->CreateView(std::move(window_wrapper));
96  if (!view) {
97  return nullptr;
98  }
99 
100  auto controller = std::make_unique<flutter::FlutterWindowsViewController>(
101  std::move(engine), std::move(view));
102 
103  // Launch the engine if it is not running already.
104  if (!controller->engine()->running()) {
105  if (!controller->engine()->Run()) {
106  return nullptr;
107  }
108  }
109 
110  // Must happen after engine is running.
111  controller->view()->SendInitialBounds();
112 
113  // The Windows embedder listens to accessibility updates using the
114  // view's HWND. The embedder's accessibility features may be stale if
115  // the app was in headless mode.
116  controller->engine()->UpdateAccessibilityFeatures();
117 
118  return HandleForViewController(controller.release());
119 }
120 
122  int width,
123  int height,
124  FlutterDesktopEngineRef engine) {
125  return CreateViewController(engine, width, height, /*owns_engine=*/true);
126 }
127 
130  const FlutterDesktopViewControllerProperties* properties) {
131  return CreateViewController(engine, properties->width, properties->height,
132  /*owns_engine=*/false);
133 }
134 
136  auto controller = ViewControllerFromHandle(ref);
137  controller->Destroy();
138  delete controller;
139 }
140 
143  auto controller = ViewControllerFromHandle(ref);
144  return static_cast<FlutterDesktopViewId>(controller->view()->view_id());
145 }
146 
149  auto controller = ViewControllerFromHandle(ref);
150  return HandleForEngine(controller->engine());
151 }
152 
155  auto controller = ViewControllerFromHandle(ref);
156  return HandleForView(controller->view());
157 }
158 
161  auto controller = ViewControllerFromHandle(ref);
162  controller->view()->ForceRedraw();
163 }
164 
167  HWND hwnd,
168  UINT message,
169  WPARAM wparam,
170  LPARAM lparam,
171  LRESULT* result) {
172  auto controller = ViewControllerFromHandle(ref);
173  std::optional<LRESULT> delegate_result =
174  controller->engine()
175  ->window_proc_delegate_manager()
176  ->OnTopLevelWindowProc(hwnd, message, wparam, lparam);
177  if (delegate_result) {
178  *result = *delegate_result;
179  }
180  return delegate_result.has_value();
181 }
182 
184  const FlutterDesktopEngineProperties* engine_properties) {
185  flutter::FlutterProjectBundle project(*engine_properties);
186  auto engine = std::make_unique<flutter::FlutterWindowsEngine>(project);
187  return HandleForEngine(engine.release());
188 }
189 
191  flutter::FlutterWindowsEngine* engine = EngineFromHandle(engine_ref);
192  bool result = true;
193  if (engine->running()) {
194  result = engine->Stop();
195  }
196  delete engine;
197  return result;
198 }
199 
201  const char* entry_point) {
202  std::string_view entry_point_view{""};
203  if (entry_point != nullptr) {
204  entry_point_view = entry_point;
205  }
206 
207  return EngineFromHandle(engine)->Run(entry_point_view);
208 }
209 
211  return std::chrono::nanoseconds::max().count();
212 }
213 
216 }
217 
220  const char* plugin_name) {
221  // Currently, one registrar acts as the registrar for all plugins, so the
222  // name is ignored. It is part of the API to reduce churn in the future when
223  // aligning more closely with the Flutter registrar system.
224 
225  return EngineFromHandle(engine)->GetRegistrar();
226 }
227 
229  FlutterDesktopEngineRef engine) {
230  return EngineFromHandle(engine)->messenger();
231 }
232 
234  FlutterDesktopEngineRef engine) {
236  EngineFromHandle(engine)->texture_registrar());
237 }
238 
241  void* user_data) {
243  [callback, user_data]() { callback(user_data); });
244 }
245 
247  return ViewFromHandle(view)->GetWindowHandle();
248 }
249 
251  auto egl_manager = ViewFromHandle(view)->GetEngine()->egl_manager();
252  if (egl_manager) {
253  Microsoft::WRL::ComPtr<ID3D11Device> d3d_device;
254  Microsoft::WRL::ComPtr<IDXGIDevice> dxgi_device;
255  if (egl_manager->GetDevice(d3d_device.GetAddressOf()) &&
256  SUCCEEDED(d3d_device.As(&dxgi_device))) {
257  IDXGIAdapter* adapter;
258  if (SUCCEEDED(dxgi_device->GetAdapter(&adapter))) {
259  return adapter;
260  }
261  }
262  }
263  return nullptr;
264 }
265 
268  HWND hwnd,
269  UINT message,
270  WPARAM wparam,
271  LPARAM lparam,
272  LRESULT* result) {
273  std::optional<LRESULT> lresult =
275  wparam, lparam);
276  if (result && lresult.has_value()) {
277  *result = lresult.value();
278  }
279  return lresult.has_value();
280 }
281 
284  const char* view_type_name,
285  FlutterPlatformViewTypeEntry view_type) {
286  // TODO(schectman): forward to platform view manager.
287  // https://github.com/flutter/flutter/issues/143375
288 }
289 
292  return HandleForView(registrar->engine->view(flutter::kImplicitViewId));
293 }
294 
297  FlutterDesktopViewId view_id) {
298  return HandleForView(registrar->engine->view(view_id));
299 }
300 
304  void* user_data) {
307 }
308 
314 }
315 
317  return flutter::GetDpiForHWND(hwnd);
318 }
319 
320 UINT FlutterDesktopGetDpiForMonitor(HMONITOR monitor) {
321  return flutter::GetDpiForMonitor(monitor);
322 }
323 
325  FILE* unused;
326  if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
327  _dup2(_fileno(stdout), 1);
328  }
329  if (freopen_s(&unused, "CONOUT$", "w", stderr)) {
330  _dup2(_fileno(stdout), 2);
331  }
332  std::ios::sync_with_stdio();
333 }
334 
335 // Implementations of common/ API methods.
336 
339  return registrar->engine->messenger();
340 }
341 
345  registrar->engine->AddPluginRegistrarDestructionCallback(callback, registrar);
346 }
347 
349  const char* channel,
350  const uint8_t* message,
351  const size_t message_size,
352  const FlutterDesktopBinaryReply reply,
353  void* user_data) {
354  FML_DCHECK(FlutterDesktopMessengerIsAvailable(messenger))
355  << "Messenger must reference a running engine to send a message";
356 
358  ->GetEngine()
359  ->SendPlatformMessage(channel, message, message_size, reply, user_data);
360 }
361 
363  const char* channel,
364  const uint8_t* message,
365  const size_t message_size) {
366  return FlutterDesktopMessengerSendWithReply(messenger, channel, message,
367  message_size, nullptr, nullptr);
368 }
369 
371  FlutterDesktopMessengerRef messenger,
373  const uint8_t* data,
374  size_t data_length) {
375  FML_DCHECK(FlutterDesktopMessengerIsAvailable(messenger))
376  << "Messenger must reference a running engine to send a response";
377 
379  ->GetEngine()
380  ->SendPlatformMessageResponse(handle, data, data_length);
381 }
382 
384  const char* channel,
386  void* user_data) {
387  FML_DCHECK(FlutterDesktopMessengerIsAvailable(messenger))
388  << "Messenger must reference a running engine to set a callback";
389 
391  ->GetEngine()
394 }
395 
397  FlutterDesktopMessengerRef messenger) {
399  ->AddRef()
400  ->ToRef();
401 }
402 
405 }
406 
409  nullptr;
410 }
411 
413  FlutterDesktopMessengerRef messenger) {
415  return messenger;
416 }
417 
420 }
421 
424  return HandleForTextureRegistrar(registrar->engine->texture_registrar());
425 }
426 
428  FlutterDesktopTextureRegistrarRef texture_registrar,
429  const FlutterDesktopTextureInfo* texture_info) {
430  return TextureRegistrarFromHandle(texture_registrar)
431  ->RegisterTexture(texture_info);
432 }
433 
435  FlutterDesktopTextureRegistrarRef texture_registrar,
436  int64_t texture_id,
437  void (*callback)(void* user_data),
438  void* user_data) {
439  auto registrar = TextureRegistrarFromHandle(texture_registrar);
440  if (callback) {
441  registrar->UnregisterTexture(
443  return;
444  }
445  registrar->UnregisterTexture(texture_id);
446 }
447 
449  FlutterDesktopTextureRegistrarRef texture_registrar,
450  int64_t texture_id) {
451  return TextureRegistrarFromHandle(texture_registrar)
453 }
FlutterDesktopViewControllerProperties::height
int height
Definition: flutter_windows_internal.h:23
flutter::kImplicitViewId
constexpr FlutterViewId kImplicitViewId
Definition: flutter_windows_engine.h:55
FlutterDesktopViewControllerHandleTopLevelWindowProc
bool FlutterDesktopViewControllerHandleTopLevelWindowProc(FlutterDesktopViewControllerRef ref, HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam, LRESULT *result)
Definition: flutter_windows.cc:165
flutter::FlutterWindowsEngine::GetRegistrar
FlutterDesktopPluginRegistrarRef GetRegistrar()
Definition: flutter_windows_engine.cc:668
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:246
FlutterDesktopViewControllerGetView
FlutterDesktopViewRef FlutterDesktopViewControllerGetView(FlutterDesktopViewControllerRef ref)
Definition: flutter_windows.cc:153
FlutterDesktopEngineGetTextureRegistrar
FlutterDesktopTextureRegistrarRef FlutterDesktopEngineGetTextureRegistrar(FlutterDesktopEngineRef engine)
Definition: flutter_windows.cc:233
FlutterDesktopPluginRegistrarGetView
FlutterDesktopViewRef FlutterDesktopPluginRegistrarGetView(FlutterDesktopPluginRegistrarRef registrar)
Definition: flutter_windows.cc:290
flutter::FlutterWindowsEngine::view
FlutterWindowsView * view(FlutterViewId view_id) const
Definition: flutter_windows_engine.cc:656
FlutterDesktopEngineGetMessenger
FlutterDesktopMessengerRef FlutterDesktopEngineGetMessenger(FlutterDesktopEngineRef engine)
Definition: flutter_windows.cc:228
FlutterDesktopPluginRegistrarRegisterTopLevelWindowProcDelegate
void FlutterDesktopPluginRegistrarRegisterTopLevelWindowProcDelegate(FlutterDesktopPluginRegistrarRef registrar, FlutterDesktopWindowProcCallback delegate, void *user_data)
Definition: flutter_windows.cc:301
flutter::FlutterWindowsView
Definition: flutter_windows_view.h:34
HandleForView
static FlutterDesktopViewRef HandleForView(flutter::FlutterWindowsView *view)
Definition: flutter_windows.cc:59
FlutterDesktopEngineProperties
Definition: flutter_windows.h:39
plugin_registrar.h
FlutterDesktopMessengerUnlock
void FlutterDesktopMessengerUnlock(FlutterDesktopMessengerRef messenger)
Definition: flutter_windows.cc:418
CreateViewController
static FlutterDesktopViewControllerRef CreateViewController(FlutterDesktopEngineRef engine_ref, int width, int height, bool owns_engine)
Definition: flutter_windows.cc:79
FlutterDesktopMessengerSend
bool FlutterDesktopMessengerSend(FlutterDesktopMessengerRef messenger, const char *channel, const uint8_t *message, const size_t message_size)
Definition: flutter_windows.cc:362
FlutterDesktopBinaryReply
void(* FlutterDesktopBinaryReply)(const uint8_t *data, size_t data_size, void *user_data)
Definition: flutter_messenger.h:26
FlutterDesktopViewId
int64_t FlutterDesktopViewId
Definition: flutter_windows.h:36
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:762
flutter::GetDpiForMonitor
UINT GetDpiForMonitor(HMONITOR monitor)
Definition: dpi_utils.cc:134
user_data
void * user_data
Definition: flutter_windows_view_unittests.cc:53
flutter::FlutterWindowsTextureRegistrar::MarkTextureFrameAvailable
bool MarkTextureFrameAvailable(int64_t texture_id)
Definition: flutter_windows_texture_registrar.cc:103
flutter::FlutterWindowsEngine
Definition: flutter_windows_engine.h:90
flutter::FlutterWindowsEngine::window_proc_delegate_manager
WindowProcDelegateManager * window_proc_delegate_manager()
Definition: flutter_windows_engine.h:167
flutter::FlutterWindowsEngine::running
virtual bool running() const
Definition: flutter_windows_engine.h:117
FlutterDesktopEngineRegisterPlatformViewType
void FlutterDesktopEngineRegisterPlatformViewType(FlutterDesktopEngineRef engine, const char *view_type_name, FlutterPlatformViewTypeEntry view_type)
Definition: flutter_windows.cc:282
FlutterDesktopViewControllerProperties
Definition: flutter_windows_internal.h:18
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:266
FlutterDesktopPluginRegistrarSetDestructionHandler
void FlutterDesktopPluginRegistrarSetDestructionHandler(FlutterDesktopPluginRegistrarRef registrar, FlutterDesktopOnPluginRegistrarDestroyed callback)
Definition: flutter_windows.cc:342
FlutterDesktopEngineGetPluginRegistrar
FlutterDesktopPluginRegistrarRef FlutterDesktopEngineGetPluginRegistrar(FlutterDesktopEngineRef engine, const char *plugin_name)
Definition: flutter_windows.cc:218
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:297
EngineFromHandle
static flutter::FlutterWindowsEngine * EngineFromHandle(FlutterDesktopEngineRef ref)
Definition: flutter_windows.cc:32
FlutterDesktopPluginRegistrarGetMessenger
FlutterDesktopMessengerRef FlutterDesktopPluginRegistrarGetMessenger(FlutterDesktopPluginRegistrarRef registrar)
Definition: flutter_windows.cc:337
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:758
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:699
FlutterDesktopResyncOutputStreams
void FlutterDesktopResyncOutputStreams()
Definition: flutter_windows.cc:324
FlutterDesktopViewControllerGetViewId
FlutterDesktopViewId FlutterDesktopViewControllerGetViewId(FlutterDesktopViewControllerRef ref)
Definition: flutter_windows.cc:141
flutter::FlutterWindowsEngine::Stop
virtual bool Stop()
Definition: flutter_windows_engine.cc:482
flutter::FlutterWindowsEngine::messenger
FlutterDesktopMessengerRef messenger()
Definition: flutter_windows_engine.h:149
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:966
FlutterPlatformViewTypeEntry
Definition: flutter_windows_internal.h:57
path_utils.h
FlutterDesktopMessengerLock
FlutterDesktopMessengerRef FlutterDesktopMessengerLock(FlutterDesktopMessengerRef messenger)
Definition: flutter_windows.cc:412
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::FlutterWindowsTextureRegistrar
Definition: flutter_windows_texture_registrar.h:24
flutter_window.h
flutter::FlutterWindowsEngine::CreateView
std::unique_ptr< FlutterWindowsView > CreateView(std::unique_ptr< WindowBindingHandler > window)
Definition: flutter_windows_engine.cc:495
flutter::FlutterWindowsEngine::texture_registrar
FlutterWindowsTextureRegistrar * texture_registrar()
Definition: flutter_windows_engine.h:159
flutter::FlutterWindowsViewController
Controls a view that displays Flutter content.
Definition: flutter_windows_view_controller.h:17
FlutterDesktopRegistrarGetTextureRegistrar
FlutterDesktopTextureRegistrarRef FlutterDesktopRegistrarGetTextureRegistrar(FlutterDesktopPluginRegistrarRef registrar)
Definition: flutter_windows.cc:422
flutter::FlutterWindowsEngine::AddPluginRegistrarDestructionCallback
void AddPluginRegistrarDestructionCallback(FlutterDesktopOnPluginRegistrarDestroyed callback, FlutterDesktopPluginRegistrarRef registrar)
Definition: flutter_windows_engine.cc:672
FlutterDesktopTextureRegistrarRef
struct FlutterDesktopTextureRegistrar * FlutterDesktopTextureRegistrarRef
Definition: flutter_texture_registrar.h:19
FlutterDesktopGetDpiForMonitor
UINT FlutterDesktopGetDpiForMonitor(HMONITOR monitor)
Definition: flutter_windows.cc:320
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:210
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:434
flutter::FlutterWindowsEngine::SendPlatformMessageResponse
void SendPlatformMessageResponse(const FlutterDesktopMessageResponseHandle *handle, const uint8_t *data, size_t data_length)
Definition: flutter_windows_engine.cc:733
flutter_windows_view_controller.h
flutter::FlutterDesktopMessenger::GetEngine
flutter::FlutterWindowsEngine * GetEngine() const
Getter for the engine field.
Definition: flutter_desktop_messenger.h:38
FlutterDesktopViewControllerCreate
FlutterDesktopViewControllerRef FlutterDesktopViewControllerCreate(int width, int height, FlutterDesktopEngineRef engine)
Definition: flutter_windows.cc:121
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:309
FlutterDesktopOnPluginRegistrarDestroyed
void(* FlutterDesktopOnPluginRegistrarDestroyed)(FlutterDesktopPluginRegistrarRef)
Definition: flutter_plugin_registrar.h:23
FlutterDesktopViewControllerForceRedraw
void FlutterDesktopViewControllerForceRedraw(FlutterDesktopViewControllerRef ref)
Definition: flutter_windows.cc:159
flutter::WindowProcDelegateManager::UnregisterTopLevelWindowProcDelegate
void UnregisterTopLevelWindowProcDelegate(FlutterDesktopWindowProcCallback callback)
Definition: window_proc_delegate_manager.cc:27
flutter::FlutterWindowsEngine::message_dispatcher
IncomingMessageDispatcher * message_dispatcher()
Definition: flutter_windows_engine.h:151
flutter::FlutterDesktopMessenger::AddRef
FlutterDesktopMessenger * AddRef()
Definition: flutter_desktop_messenger.h:50
flutter::FlutterWindowsView::GetEngine
FlutterWindowsEngine * GetEngine() const
Definition: flutter_windows_view.cc:762
FlutterDesktopTextureRegistrarMarkExternalTextureFrameAvailable
bool FlutterDesktopTextureRegistrarMarkExternalTextureFrameAvailable(FlutterDesktopTextureRegistrarRef texture_registrar, int64_t texture_id)
Definition: flutter_windows.cc:448
FlutterDesktopEngineDestroy
bool FlutterDesktopEngineDestroy(FlutterDesktopEngineRef engine_ref)
Definition: flutter_windows.cc:190
flutter_windows_engine.h
FlutterDesktopEngineCreate
FlutterDesktopEngineRef FlutterDesktopEngineCreate(const FlutterDesktopEngineProperties *engine_properties)
Definition: flutter_windows.cc:183
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:370
FlutterDesktopMessengerIsAvailable
bool FlutterDesktopMessengerIsAvailable(FlutterDesktopMessengerRef messenger)
Definition: flutter_windows.cc:407
FlutterDesktopViewControllerGetEngine
FlutterDesktopEngineRef FlutterDesktopViewControllerGetEngine(FlutterDesktopViewControllerRef ref)
Definition: flutter_windows.cc:147
HandleForEngine
static FlutterDesktopEngineRef HandleForEngine(flutter::FlutterWindowsEngine *engine)
Definition: flutter_windows.cc:38
ViewFromHandle
static flutter::FlutterWindowsView * ViewFromHandle(FlutterDesktopViewRef ref)
Definition: flutter_windows.cc:54
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:135
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:239
FlutterDesktopEngineCreateViewController
FlutterDesktopViewControllerRef FlutterDesktopEngineCreateViewController(FlutterDesktopEngineRef engine, const FlutterDesktopViewControllerProperties *properties)
Definition: flutter_windows.cc:128
FlutterDesktopViewControllerProperties::width
int width
Definition: flutter_windows_internal.h:20
incoming_message_dispatcher.h
FlutterDesktopMessengerRelease
void FlutterDesktopMessengerRelease(FlutterDesktopMessengerRef messenger)
Definition: flutter_windows.cc:403
FlutterDesktopTextureRegistrarRegisterExternalTexture
int64_t FlutterDesktopTextureRegistrarRegisterExternalTexture(FlutterDesktopTextureRegistrarRef texture_registrar, const FlutterDesktopTextureInfo *texture_info)
Definition: flutter_windows.cc:427
FlutterDesktopMessengerSetCallback
void FlutterDesktopMessengerSetCallback(FlutterDesktopMessengerRef messenger, const char *channel, FlutterDesktopMessageCallback callback, void *user_data)
Definition: flutter_windows.cc:383
FlutterDesktopViewGetGraphicsAdapter
IDXGIAdapter * FlutterDesktopViewGetGraphicsAdapter(FlutterDesktopViewRef view)
Definition: flutter_windows.cc:250
flutter::FlutterWindowsEngine::egl_manager
egl::Manager * egl_manager() const
Definition: flutter_windows_engine.h:165
FlutterDesktopMessageCallback
void(* FlutterDesktopMessageCallback)(FlutterDesktopMessengerRef, const FlutterDesktopMessage *, void *)
Definition: flutter_messenger.h:49
FlutterDesktopGetDpiForHWND
UINT FlutterDesktopGetDpiForHWND(HWND hwnd)
Definition: flutter_windows.cc:316
FlutterDesktopPluginRegistrar
Definition: window_state.h:23
FlutterDesktopEngineRun
bool FlutterDesktopEngineRun(FlutterDesktopEngineRef engine, const char *entry_point)
Definition: flutter_windows.cc:200
flutter::FlutterWindowsEngine::Run
bool Run()
Definition: flutter_windows_engine.cc:239
texture_id
uint32_t texture_id
Definition: compositor_opengl.cc:20
FlutterDesktopPluginRegistrarGetViewById
FlutterDesktopViewRef FlutterDesktopPluginRegistrarGetViewById(FlutterDesktopPluginRegistrarRef registrar, FlutterDesktopViewId view_id)
Definition: flutter_windows.cc:295
FlutterDesktopWindowProcCallback
bool(* FlutterDesktopWindowProcCallback)(HWND, UINT, WPARAM, LPARAM, void *, LRESULT *result)
Definition: flutter_windows.h:245
flutter::WindowProcDelegateManager::RegisterTopLevelWindowProcDelegate
void RegisterTopLevelWindowProcDelegate(FlutterDesktopWindowProcCallback callback, void *user_data)
Definition: window_proc_delegate_manager.cc:16
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:348
flutter::FlutterWindowsEngine::ReloadSystemFonts
void ReloadSystemFonts()
Definition: flutter_windows_engine.cc:754
FlutterDesktopEngineReloadSystemFonts
void FlutterDesktopEngineReloadSystemFonts(FlutterDesktopEngineRef engine)
Definition: flutter_windows.cc:214
callback
FlutterDesktopBinaryReply callback
Definition: flutter_windows_view_unittests.cc:52
FlutterDesktopMessengerAddRef
FlutterDesktopMessengerRef FlutterDesktopMessengerAddRef(FlutterDesktopMessengerRef messenger)
Definition: flutter_windows.cc:396