Flutter Windows Embedder
flutter::PluginRegistrarWindows Class Reference

#include <plugin_registrar_windows.h>

Inheritance diagram for flutter::PluginRegistrarWindows:
flutter::PluginRegistrar

Public Member Functions

 PluginRegistrarWindows (FlutterDesktopPluginRegistrarRef core_registrar)
 
virtual ~PluginRegistrarWindows ()
 
 PluginRegistrarWindows (PluginRegistrarWindows const &)=delete
 
PluginRegistrarWindowsoperator= (PluginRegistrarWindows const &)=delete
 
FlutterViewGetView ()
 
std::shared_ptr< FlutterViewGetViewById (FlutterViewId view_id) const
 
int RegisterTopLevelWindowProcDelegate (WindowProcDelegate delegate)
 
void UnregisterTopLevelWindowProcDelegate (int proc_id)
 
- Public Member Functions inherited from flutter::PluginRegistrar
 PluginRegistrar (FlutterDesktopPluginRegistrarRef core_registrar)
 
virtual ~PluginRegistrar ()
 
 PluginRegistrar (PluginRegistrar const &)=delete
 
PluginRegistraroperator= (PluginRegistrar const &)=delete
 
BinaryMessengermessenger ()
 
TextureRegistrartexture_registrar ()
 
void AddPlugin (std::unique_ptr< Plugin > plugin)
 

Additional Inherited Members

- Protected Member Functions inherited from flutter::PluginRegistrar
FlutterDesktopPluginRegistrarRef registrar () const
 
void ClearPlugins ()
 

Detailed Description

Definition at line 28 of file plugin_registrar_windows.h.

Constructor & Destructor Documentation

◆ PluginRegistrarWindows() [1/2]

flutter::PluginRegistrarWindows::PluginRegistrarWindows ( FlutterDesktopPluginRegistrarRef  core_registrar)
inlineexplicit

Definition at line 32 of file plugin_registrar_windows.h.

34  : PluginRegistrar(core_registrar) {
35  FlutterDesktopViewRef implicit_view =
37  if (implicit_view) {
38  implicit_view_ = std::make_unique<FlutterView>(implicit_view);
39  }
40  }

References FlutterDesktopPluginRegistrarGetView().

◆ ~PluginRegistrarWindows()

virtual flutter::PluginRegistrarWindows::~PluginRegistrarWindows ( )
inlinevirtual

Definition at line 42 of file plugin_registrar_windows.h.

42  {
43  // Must be the first call.
44  ClearPlugins();
45  // Explicitly cleared to facilitate destruction order testing.
46  implicit_view_.reset();
47  }

References flutter::PluginRegistrar::ClearPlugins().

◆ PluginRegistrarWindows() [2/2]

flutter::PluginRegistrarWindows::PluginRegistrarWindows ( PluginRegistrarWindows const &  )
delete

Member Function Documentation

◆ GetView()

FlutterView* flutter::PluginRegistrarWindows::GetView ( )
inline

Definition at line 59 of file plugin_registrar_windows.h.

59 { return implicit_view_.get(); }

Referenced by flutter::TEST().

◆ GetViewById()

std::shared_ptr<FlutterView> flutter::PluginRegistrarWindows::GetViewById ( FlutterViewId  view_id) const
inline

Definition at line 65 of file plugin_registrar_windows.h.

65  {
68  if (!view) {
69  return nullptr;
70  }
71 
72  return std::make_shared<FlutterView>(view);
73  }

References FlutterDesktopPluginRegistrarGetViewById(), and flutter::PluginRegistrar::registrar().

Referenced by flutter::TEST().

◆ operator=()

PluginRegistrarWindows& flutter::PluginRegistrarWindows::operator= ( PluginRegistrarWindows const &  )
delete

◆ RegisterTopLevelWindowProcDelegate()

int flutter::PluginRegistrarWindows::RegisterTopLevelWindowProcDelegate ( WindowProcDelegate  delegate)
inline

Definition at line 88 of file plugin_registrar_windows.h.

88  {
89  if (window_proc_delegates_.empty()) {
91  registrar(), PluginRegistrarWindows::OnTopLevelWindowProc, this);
92  }
93  int delegate_id = next_window_proc_delegate_id_++;
94  window_proc_delegates_.emplace(delegate_id, std::move(delegate));
95  return delegate_id;
96  }

References delegate_id, FlutterDesktopPluginRegistrarRegisterTopLevelWindowProcDelegate(), and flutter::PluginRegistrar::registrar().

Referenced by flutter::TEST().

◆ UnregisterTopLevelWindowProcDelegate()

void flutter::PluginRegistrarWindows::UnregisterTopLevelWindowProcDelegate ( int  proc_id)
inline

Definition at line 99 of file plugin_registrar_windows.h.

99  {
100  window_proc_delegates_.erase(proc_id);
101  if (window_proc_delegates_.empty()) {
103  registrar(), PluginRegistrarWindows::OnTopLevelWindowProc);
104  }
105  }

References FlutterDesktopPluginRegistrarUnregisterTopLevelWindowProcDelegate(), and flutter::PluginRegistrar::registrar().

Referenced by flutter::TEST().


The documentation for this class was generated from the following file:
FlutterDesktopPluginRegistrarGetView
FlutterDesktopViewRef FlutterDesktopPluginRegistrarGetView(FlutterDesktopPluginRegistrarRef registrar)
Definition: flutter_windows.cc:290
FlutterDesktopPluginRegistrarRegisterTopLevelWindowProcDelegate
void FlutterDesktopPluginRegistrarRegisterTopLevelWindowProcDelegate(FlutterDesktopPluginRegistrarRef registrar, FlutterDesktopWindowProcCallback delegate, void *user_data)
Definition: flutter_windows.cc:301
flutter::PluginRegistrar::registrar
FlutterDesktopPluginRegistrarRef registrar() const
Definition: plugin_registrar.h:57
flutter::PluginRegistrar::ClearPlugins
void ClearPlugins()
Definition: plugin_registrar.cc:42
FlutterDesktopViewRef
struct FlutterDesktopView * FlutterDesktopViewRef
Definition: flutter_windows.h:29
flutter::PluginRegistrar::PluginRegistrar
PluginRegistrar(FlutterDesktopPluginRegistrarRef core_registrar)
Definition: plugin_registrar.cc:19
FlutterDesktopPluginRegistrarUnregisterTopLevelWindowProcDelegate
void FlutterDesktopPluginRegistrarUnregisterTopLevelWindowProcDelegate(FlutterDesktopPluginRegistrarRef registrar, FlutterDesktopWindowProcCallback delegate)
Definition: flutter_windows.cc:309
delegate_id
int delegate_id
Definition: keyboard_key_handler_unittests.cc:113
FlutterDesktopPluginRegistrarGetViewById
FlutterDesktopViewRef FlutterDesktopPluginRegistrarGetViewById(FlutterDesktopPluginRegistrarRef registrar, FlutterDesktopViewId view_id)
Definition: flutter_windows.cc:295