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 g_weak_ref_clear(&self->view);
48 g_clear_object(&self->messenger);
49 g_clear_object(&self->texture_registrar);
51 G_OBJECT_CLASS(fl_plugin_registrar_impl_parent_class)->dispose(
object);
55 FlPluginRegistrarImplClass* klass) {
60 FlPluginRegistrarImpl*
self = FL_PLUGIN_REGISTRAR_IMPL(registrar);
61 return self->messenger;
65 FlPluginRegistrarImpl*
self = FL_PLUGIN_REGISTRAR_IMPL(registrar);
66 return self->texture_registrar;
69 static FlView*
get_view(FlPluginRegistrar* registrar) {
70 FlPluginRegistrarImpl*
self = FL_PLUGIN_REGISTRAR_IMPL(registrar);
71 g_autoptr(FlView)
view = FL_VIEW(g_weak_ref_get(&self->view));
76 FlPluginRegistrarInterface* iface) {
86 FlBinaryMessenger* messenger,
87 FlTextureRegistrar* texture_registrar) {
88 g_return_val_if_fail(
view ==
nullptr || FL_IS_VIEW(
view),
nullptr);
89 g_return_val_if_fail(FL_IS_BINARY_MESSENGER(messenger),
nullptr);
90 g_return_val_if_fail(FL_IS_TEXTURE_REGISTRAR(texture_registrar),
nullptr);
92 FlPluginRegistrarImpl*
self = FL_PLUGIN_REGISTRAR_IMPL(
93 g_object_new(fl_plugin_registrar_impl_get_type(),
nullptr));
96 FL_IS_PLUGIN_REGISTRAR_IMPL(
self);
98 g_weak_ref_init(&self->view,
view);
99 self->messenger = FL_BINARY_MESSENGER(g_object_ref(messenger));
100 self->texture_registrar =
101 FL_TEXTURE_REGISTRAR(g_object_ref(texture_registrar));
103 return FL_PLUGIN_REGISTRAR(
self);
107 FlPluginRegistrar*
self) {
108 g_return_val_if_fail(FL_IS_PLUGIN_REGISTRAR(
self),
nullptr);
110 return FL_PLUGIN_REGISTRAR_GET_IFACE(
self)->get_messenger(
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_texture_registrar(
self);
121 g_return_val_if_fail(FL_IS_PLUGIN_REGISTRAR(
self),
nullptr);
123 return FL_PLUGIN_REGISTRAR_GET_IFACE(
self)->get_view(
self);
G_DEFINE_INTERFACE(FlKeyboardViewDelegate, fl_keyboard_view_delegate, G_TYPE_OBJECT) static void fl_keyboard_view_delegate_default_init(FlKeyboardViewDelegateInterface *iface)
G_DEFINE_TYPE_WITH_CODE(FlPluginRegistrarImpl, fl_plugin_registrar_impl, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE(fl_plugin_registrar_get_type(), fl_plugin_registrar_impl_iface_init)) static void fl_plugin_registrar_default_init(FlPluginRegistrarInterface *iface)
static FlView * get_view(FlPluginRegistrar *registrar)
G_MODULE_EXPORT FlTextureRegistrar * fl_plugin_registrar_get_texture_registrar(FlPluginRegistrar *self)
FlPluginRegistrar * fl_plugin_registrar_new(FlView *view, FlBinaryMessenger *messenger, FlTextureRegistrar *texture_registrar)
static void fl_plugin_registrar_impl_dispose(GObject *object)
static FlTextureRegistrar * get_texture_registrar(FlPluginRegistrar *registrar)
static void fl_plugin_registrar_impl_init(FlPluginRegistrarImpl *self)
static FlBinaryMessenger * get_messenger(FlPluginRegistrar *registrar)
static void fl_plugin_registrar_impl_class_init(FlPluginRegistrarImplClass *klass)
G_MODULE_EXPORT FlView * fl_plugin_registrar_get_view(FlPluginRegistrar *self)
G_DECLARE_FINAL_TYPE(FlPluginRegistrarImpl, fl_plugin_registrar_impl, FL, PLUGIN_REGISTRAR_IMPL, GObject) struct _FlPluginRegistrarImpl
static void fl_plugin_registrar_impl_iface_init(FlPluginRegistrarInterface *iface)
G_MODULE_EXPORT FlBinaryMessenger * fl_plugin_registrar_get_messenger(FlPluginRegistrar *self)