girepository: Update docs for GIVFuncInfo for gi-docgen

Move the SECTION into the struct docs, update the documentation comment
syntax, and add `Since: 2.80` everywhere.

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

Helps: #3155
This commit is contained in:
Philip Withnall 2023-11-08 23:36:19 +00:00
parent c42e63c637
commit 458cc700ce
3 changed files with 38 additions and 31 deletions

View File

@ -145,11 +145,7 @@ typedef GIBaseInfo GIValueInfo;
*/ */
typedef GIBaseInfo GISignalInfo; typedef GIBaseInfo GISignalInfo;
/** /* Documented in givfuncinfo.c */
* GIVFuncInfo:
*
* Represents a virtual function.
*/
typedef GIBaseInfo GIVFuncInfo; typedef GIBaseInfo GIVFuncInfo;
/** /**

View File

@ -34,14 +34,14 @@
#include "givfuncinfo.h" #include "givfuncinfo.h"
/** /**
* SECTION:givfuncinfo * GIVFuncInfo:
* @title: GIVFuncInfo
* @short_description: Struct representing a virtual function
* *
* GIVfuncInfo represents a virtual function. * `GIVfuncInfo` represents a virtual function.
* *
* A virtual function is a callable object that belongs to either a * A virtual function is a callable object that belongs to either a
* #GIObjectInfo or a #GIInterfaceInfo. * [alias@GIRepository.ObjectInfo] or a [alias@GIRepository.InterfaceInfo].
*
* Since: 2.80
*/ */
GIVFuncInfo * GIVFuncInfo *
@ -73,10 +73,13 @@ gi_base_info_find_vfunc (GIRealInfo *rinfo,
* gi_vfunc_info_get_flags: * gi_vfunc_info_get_flags:
* @info: a #GIVFuncInfo * @info: a #GIVFuncInfo
* *
* Obtain the flags for this virtual function info. See #GIVFuncInfoFlags for * Obtain the flags for this virtual function info.
* more information about possible flag values. *
* See [flags@GIRepository.VFuncInfoFlags] for more information about possible
* flag values.
* *
* Returns: the flags * Returns: the flags
* Since: 2.80
*/ */
GIVFuncInfoFlags GIVFuncInfoFlags
gi_vfunc_info_get_flags (GIVFuncInfo *info) gi_vfunc_info_get_flags (GIVFuncInfo *info)
@ -112,9 +115,10 @@ gi_vfunc_info_get_flags (GIVFuncInfo *info)
* @info: a #GIVFuncInfo * @info: a #GIVFuncInfo
* *
* Obtain the offset of the function pointer in the class struct. The value * Obtain the offset of the function pointer in the class struct. The value
* 0xFFFF indicates that the struct offset is unknown. * `0xFFFF` indicates that the struct offset is unknown.
* *
* Returns: the struct offset or 0xFFFF if it's unknown * Returns: the struct offset or `0xFFFF` if its unknown
* Since: 2.80
*/ */
gint gint
gi_vfunc_info_get_offset (GIVFuncInfo *info) gi_vfunc_info_get_offset (GIVFuncInfo *info)
@ -135,10 +139,12 @@ gi_vfunc_info_get_offset (GIVFuncInfo *info)
* @info: a #GIVFuncInfo * @info: a #GIVFuncInfo
* *
* Obtain the signal for the virtual function if one is set. * Obtain the signal for the virtual function if one is set.
*
* The signal comes from the object or interface to which * The signal comes from the object or interface to which
* this virtual function belongs. * this virtual function belongs.
* *
* Returns: (transfer full): the signal or %NULL if none set * Returns: (transfer full): the signal or `NULL` if none set
* Since: 2.80
*/ */
GISignalInfo * GISignalInfo *
gi_vfunc_info_get_signal (GIVFuncInfo *info) gi_vfunc_info_get_signal (GIVFuncInfo *info)
@ -166,8 +172,9 @@ gi_vfunc_info_get_signal (GIVFuncInfo *info)
* *
* Not all virtuals will have invokers. * Not all virtuals will have invokers.
* *
* Returns: (transfer full): the #GIVFuncInfo or %NULL. Free it with * Returns: (transfer full): the [alias@GIRepository.FunctionInfo] or `NULL`.
* gi_base_info_unref() when done. * Free it with gi_base_info_unref() when done.
* Since: 2.80
*/ */
GIFunctionInfo * GIFunctionInfo *
gi_vfunc_info_get_invoker (GIVFuncInfo *info) gi_vfunc_info_get_invoker (GIVFuncInfo *info)
@ -202,10 +209,11 @@ gi_vfunc_info_get_invoker (GIVFuncInfo *info)
* @implementor_gtype: #GType implementing this virtual function * @implementor_gtype: #GType implementing this virtual function
* @error: return location for a #GError * @error: return location for a #GError
* *
* This method will look up where inside the type struct of @implementor_gtype * Looks up where inside the type struct of @implementor_gtype is the
* is the implementation for @info. * implementation for @info.
* *
* Returns: address to a function or %NULL if an error happened * Returns: address to a function or `NULL` if an error happened
* Since: 2.80
*/ */
gpointer gpointer
gi_vfunc_info_get_address (GIVFuncInfo *vfunc_info, gi_vfunc_info_get_address (GIVFuncInfo *vfunc_info,
@ -299,25 +307,26 @@ gi_vfunc_info_get_address (GIVFuncInfo *vfunc_info,
* gi_vfunc_info_invoke: (skip) * gi_vfunc_info_invoke: (skip)
* @info: a #GIVFuncInfo describing the virtual function to invoke * @info: a #GIVFuncInfo describing the virtual function to invoke
* @implementor: #GType of the type that implements this virtual function * @implementor: #GType of the type that implements this virtual function
* @in_args: (array length=n_in_args): an array of #GIArgument<!-- -->s, one for each in * @in_args: (array length=n_in_args): an array of [struct@GIRepository.Argument]s,
* parameter of @info. If there are no in parameter, @in_args * one for each in parameter of @info. If there are no in parameter, @in_args
* can be %NULL * can be `NULL`
* @n_in_args: the length of the @in_args array * @n_in_args: the length of the @in_args array
* @out_args: (array length=n_out_args): an array of #GIArgument<!-- -->s, one for each out * @out_args: (array length=n_out_args): an array of [struct@GIRepository.Argument]s,
* parameter of @info. If there are no out parameters, @out_args * one for each out parameter of @info. If there are no out parameters,
* may be %NULL * @out_args may be `NULL`
* @n_out_args: the length of the @out_args array * @n_out_args: the length of the @out_args array
* @return_value: return location for the return value of the * @return_value: return location for the return value of the
* function. If the function returns void, @return_value may be * function. If the function returns void, @return_value may be
* %NULL * `NULL`
* @error: return location for detailed error information, or %NULL * @error: return location for detailed error information, or `NULL`
* *
* Invokes the function described in @info with the given * Invokes the function described in @info with the given
* arguments. Note that inout parameters must appear in both * arguments. Note that inout parameters must appear in both
* argument lists. * argument lists.
* *
* Returns: %TRUE if the function has been invoked, %FALSE if an * Returns: true if the function has been invoked, false if an
* error occurred. * error occurred.
* Since: 2.80
*/ */
gboolean gboolean
gi_vfunc_info_invoke (GIVFuncInfo *info, gi_vfunc_info_invoke (GIVFuncInfo *info,

View File

@ -33,10 +33,12 @@
G_BEGIN_DECLS G_BEGIN_DECLS
/** /**
* GI_IS_VFUNC_INFO * GI_IS_VFUNC_INFO:
* @info: an info structure * @info: an info structure
* *
* Checks if @info is a #GIVfuncInfo. * Checks if @info is a [struct@GIRepository.VFuncInfo].
*
* Since: 2.80
*/ */
#define GI_IS_VFUNC_INFO(info) \ #define GI_IS_VFUNC_INFO(info) \
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_VFUNC) (gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_VFUNC)