mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-14 19:55:12 +01:00
Merge branch 'docpriv' into 'master'
doc: Interface for derivable object See merge request GNOME/glib!6
This commit is contained in:
commit
0c1494ca1f
@ -1069,6 +1069,20 @@ viewer_file_init (ViewerFile *self)
|
||||
{
|
||||
/* Instance variable initialisation code. */
|
||||
}
|
||||
</programlisting></informalexample>
|
||||
</para>
|
||||
<para>
|
||||
If the object is not of final type, e.g. was declared using
|
||||
<function><link linkend="G-DECLARE-DERIVABLE-TYPE:CAPS">G_DECLARE_DERIVABLE_TYPE</link></function>
|
||||
then
|
||||
<function><link linkend="G-ADD-PRIVATE:CAPS">G_ADD_PRIVATE</link></function>
|
||||
macro should be added. The private structure should be declared exactly
|
||||
as for a normal derivable object, see <xref linkend="howto-gobject-code"/>.
|
||||
<informalexample><programlisting>
|
||||
G_DEFINE_TYPE_WITH_CODE (ViewerFile, viewer_file, G_TYPE_OBJECT,
|
||||
G_ADD_PRIVATE (ViewerFile)
|
||||
G_IMPLEMENT_INTERFACE (VIEWER_TYPE_EDITABLE,
|
||||
viewer_file_editable_interface_init))
|
||||
</programlisting></informalexample>
|
||||
</para>
|
||||
</sect1>
|
||||
|
Loading…
x
Reference in New Issue
Block a user