Top | ![]() |
![]() |
![]() |
![]() |
TeplAbstractFactoryValaTeplAbstractFactoryVala — TeplAbstractFactory subclass to work-around Vala bugs |
TeplAbstractFactoryVala is a subclass of TeplAbstractFactory to work-around Vala bugs.
There are two bugs:
For the functions or vfuncs in TeplAbstractFactory which have a (transfer floating) return value: apparently when a Vala function returns a newly created GInitiallyUnowned object, the return value is (transfer full). Which is not correct, it should be (transfer floating) instead (i.e. equal to (transfer none)). So to be able to implement easily those vfuncs in Vala, new Vala-specific vfuncs have been added which have a (transfer full) return value. The original vfuncs are implemented by TeplAbstractFactoryVala by calling the Vala ones and transforming the strong ref into a floating ref.
It would have been possible to modify the TeplAbstractFactory API so that it's usable in Vala as well, but in that case the API would be less convenient and less natural in C. So TeplAbstractFactoryVala has been implemented as something separate, to not clutter TeplAbstractFactory.
void
tepl_abstract_factory_vala_set_singleton_vala
(TeplAbstractFactoryVala *factory_vala
);
Like tepl_abstract_factory_set_singleton()
, but with (transfer none) for the
factory_vala
parameter.
Apparently Vala doesn't support (transfer full) for the self parameter,
resulting to a double unref if tepl_abstract_factory_set_singleton()
is
called in Vala...
Since: 4.0
GtkApplicationWindow * tepl_abstract_factory_vala_create_main_window_vala (TeplAbstractFactoryVala *factory_vala
,GtkApplication *app
);
Like tepl_abstract_factory_create_main_window()
, but with a (transfer full)
return value.
a new main application window, or NULL
if the vfunc is not implemented.
[transfer full][nullable]
Since: 4.0
struct TeplAbstractFactoryValaClass { TeplAbstractFactoryClass parent_class; GtkApplicationWindow * (* create_main_window_vala) (TeplAbstractFactoryVala *factory_vala, GtkApplication *app); };
Virtual function pointer for
|