Flutter Engine
The Flutter Engine
Functions
fl_plugin_registrar_private.h File Reference
#include "flutter/shell/platform/linux/public/flutter_linux/fl_binary_messenger.h"
#include "flutter/shell/platform/linux/public/flutter_linux/fl_plugin_registrar.h"

Go to the source code of this file.

Functions

G_BEGIN_DECLS FlPluginRegistrar * fl_plugin_registrar_new (FlView *view, FlBinaryMessenger *messenger, FlTextureRegistrar *texture_registrar)
 

Function Documentation

◆ fl_plugin_registrar_new()

G_BEGIN_DECLS FlPluginRegistrar * fl_plugin_registrar_new ( FlView *  view,
FlBinaryMessenger *  messenger,
FlTextureRegistrar *  texture_registrar 
)

fl_plugin_registrar_new: @view: (allow-none): the #FlView that is being plugged into or NULL for headless mode. @messenger: the #FlBinaryMessenger to communicate with. @texture_registrar: the #FlTextureRegistrar to communicate with.

Creates a new #FlPluginRegistrar.

Returns: a new #FlPluginRegistrar.

Definition at line 87 of file fl_plugin_registrar.cc.

90 {
91 g_return_val_if_fail(view == nullptr || FL_IS_VIEW(view), nullptr);
92 g_return_val_if_fail(FL_IS_BINARY_MESSENGER(messenger), nullptr);
93 g_return_val_if_fail(FL_IS_TEXTURE_REGISTRAR(texture_registrar), nullptr);
94
95 FlPluginRegistrarImpl* self = FL_PLUGIN_REGISTRAR_IMPL(
96 g_object_new(fl_plugin_registrar_impl_get_type(), nullptr));
97
98 // Added to stop compiler complaining about an unused function.
99 FL_IS_PLUGIN_REGISTRAR_IMPL(self);
100
101 self->view = view;
102 if (view != nullptr) {
103 g_object_add_weak_pointer(G_OBJECT(view),
104 reinterpret_cast<gpointer*>(&(self->view)));
105 }
106 self->messenger = FL_BINARY_MESSENGER(g_object_ref(messenger));
107 self->texture_registrar =
108 FL_TEXTURE_REGISTRAR(g_object_ref(texture_registrar));
109
110 return FL_PLUGIN_REGISTRAR(self);
111}
G_BEGIN_DECLS FlTextureRegistrar * texture_registrar