summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavlo Solntsev <p.sun.fun@gmail.com>2018-05-24 23:32:00 -0500
committerPavlo Solntsev <p.sun.fun@gmail.com>2018-05-25 12:50:21 -0500
commit9e62a425bdc4f3bd37f8145596dd8430acda01a5 (patch)
treebba77646e64b93fddf359ba7830a872785880820
parentd9df5d72e144f537167fe1ebfe1b8c54a8f952e4 (diff)
downloadglib-9e62a425bdc4f3bd37f8145596dd8430acda01a5.tar.gz
doc: Interface for derivable object
-rw-r--r--docs/reference/gobject/tut_howto.xml14
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/reference/gobject/tut_howto.xml b/docs/reference/gobject/tut_howto.xml
index 0e119009b..daaad4697 100644
--- a/docs/reference/gobject/tut_howto.xml
+++ b/docs/reference/gobject/tut_howto.xml
@@ -1071,6 +1071,20 @@ viewer_file_init (ViewerFile *self)
}
</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>
<sect1 id="howto-interface-prerequisite">