11 fl_plugin_registrar_impl,
13 PLUGIN_REGISTRAR_IMPL,
16 struct _FlPluginRegistrarImpl {
17 GObject parent_instance;
23 FlBinaryMessenger* messenger;
26 FlTextureRegistrar* texture_registrar;
30 FlPluginRegistrarInterface* iface);
35 FlPluginRegistrarImpl,
36 fl_plugin_registrar_impl,
38 G_IMPLEMENT_INTERFACE(fl_plugin_registrar_get_type(),
41 static
void fl_plugin_registrar_default_init(
42 FlPluginRegistrarInterface* iface) {}
45 FlPluginRegistrarImpl*
self = FL_PLUGIN_REGISTRAR_IMPL(
object);
47 if (self->view !=
nullptr) {
48 g_object_remove_weak_pointer(G_OBJECT(self->view),
49 reinterpret_cast<gpointer*
>(&(self->view)));
52 g_clear_object(&self->messenger);
53 g_clear_object(&self->texture_registrar);
55 G_OBJECT_CLASS(fl_plugin_registrar_impl_parent_class)->dispose(
object);
59 FlPluginRegistrarImplClass* klass) {
64 FlPluginRegistrarImpl*
self = FL_PLUGIN_REGISTRAR_IMPL(registrar);
65 return self->messenger;
69 FlPluginRegistrarImpl*
self = FL_PLUGIN_REGISTRAR_IMPL(registrar);
70 return self->texture_registrar;
73 static FlView*
get_view(FlPluginRegistrar* registrar) {
74 FlPluginRegistrarImpl*
self = FL_PLUGIN_REGISTRAR_IMPL(registrar);
79 FlPluginRegistrarInterface* iface) {
89 FlBinaryMessenger* messenger,
90 FlTextureRegistrar* texture_registrar) {
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);
95 FlPluginRegistrarImpl*
self = FL_PLUGIN_REGISTRAR_IMPL(
96 g_object_new(fl_plugin_registrar_impl_get_type(),
nullptr));
99 FL_IS_PLUGIN_REGISTRAR_IMPL(
self);
102 if (view !=
nullptr) {
103 g_object_add_weak_pointer(G_OBJECT(view),
104 reinterpret_cast<gpointer*
>(&(self->view)));
106 self->messenger = FL_BINARY_MESSENGER(g_object_ref(messenger));
107 self->texture_registrar =
108 FL_TEXTURE_REGISTRAR(g_object_ref(texture_registrar));
110 return FL_PLUGIN_REGISTRAR(
self);
114 FlPluginRegistrar*
self) {
115 g_return_val_if_fail(FL_IS_PLUGIN_REGISTRAR(
self),
nullptr);
117 return FL_PLUGIN_REGISTRAR_GET_IFACE(
self)->get_messenger(
self);
121 FlPluginRegistrar*
self) {
122 g_return_val_if_fail(FL_IS_PLUGIN_REGISTRAR(
self),
nullptr);
124 return FL_PLUGIN_REGISTRAR_GET_IFACE(
self)->get_texture_registrar(
self);
128 g_return_val_if_fail(FL_IS_PLUGIN_REGISTRAR(
self),
nullptr);
130 return FL_PLUGIN_REGISTRAR_GET_IFACE(
self)->get_view(
self);