gtype: Improve documentation for G_TYPE_IS_CLASSED and interfaces

The documentation previously implicitly said in a few places that
interfaces are classed, but reading through the implementation of
`GType`, I don’t think they are. If they were, the registration of the
fundamental `G_TYPE_INTERFACE` in `gobject_init()` would specify
`G_TYPE_FLAG_CLASSED`. It only specifies `G_TYPE_FLAG_DERIVABLE`.

I think this makes sense, because you can’t subclass an interface.
Subclassing is a key property of being classed.

Tweak the `GType` tutorial to remove that implicit statement, and expand
the documentation for `G_TYPE_IS_CLASSED`.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #252
This commit is contained in:
Philip Withnall
2023-04-13 15:37:00 +01:00
parent c1e0506d86
commit 783f1b8640
4 changed files with 19 additions and 10 deletions

View File

@@ -854,7 +854,7 @@ b_method_to_call (B *obj, gint some_param)
<para>
The theory behind how GObject interfaces work is given in
<xref linkend="gtype-non-instantiatable-classed"/>; this section covers how to
<xref linkend="gtype-non-instantiatable-non-classed"/>; this section covers how to
define and implement an interface.
</para>