GTK's interfaces and language bindings
- Date: Tue, 18 Jul 2017 22:00:52 +0200
- From: Stefan Salewski <mail@xxxxxxxxxxxx>
- Subject: GTK's interfaces and language bindings
Recently someone tried to style a widget using CSS,
and so I discovered that there is still some labor for me...
Before I start coding, maybe it is better to verify my understanding of
the gobject interfaces...
For example, we have
which may be called from C like
So the second parameter is of type GtkStyleProvider, which is an
interface. GtkCssProvider provides that interface, so we can pass a
variable of that type. GTK_STYLE_PROVIDER() is basically only a cast, a
re-interpretation of the bit pattern, maybe with additional security
As we generally do not want such casts in higher level languages, we
may just provide an additional function with the same name which
accepts a GtkCssProvider.
For this special case that is clear, and already tested. So I assume,
that for all functions which has interfaces as parameters, I can just
pass all objects (gobjects) which provides that interface?
I even guess hat interfaces are fully abstract entities, so we will
never pass an instance of an interface, but always only objects
providing the interface. So we have only to provide functions which can
accepts all the objects providing the that interface, but we do not
really need functions which would accepts the interface parameter type
gtk-list mailing list