GIArgInfo

GIArgInfo — Struct representing an argument

Synopsis

typedef             GIArgInfo;
enum                GIDirection;
enum                GIScopeType;
enum                GITransfer;
GIDirection         g_arg_info_get_direction            (GIArgInfo *info);
gboolean            g_arg_info_is_return_value          (GIArgInfo *info);
gboolean            g_arg_info_is_optional              (GIArgInfo *info);
gboolean            g_arg_info_may_be_null              (GIArgInfo *info);
GITransfer          g_arg_info_get_ownership_transfer   (GIArgInfo *info);
GIScopeType         g_arg_info_get_scope                (GIArgInfo *info);
gint                g_arg_info_get_closure              (GIArgInfo *info);
gint                g_arg_info_get_destroy              (GIArgInfo *info);
GITypeInfo *        g_arg_info_get_type                 (GIArgInfo *info);
void                g_arg_info_load_type                (GIArgInfo *info,
                                                         GITypeInfo *type);

Description

GIArgInfo represents an argument. An argument is always part of a GICallableInfo.

Details

GIArgInfo

typedef GIBaseInfo GIArgInfo;

Represents an argument.


enum GIDirection

typedef enum  {
  GI_DIRECTION_IN,
  GI_DIRECTION_OUT,
  GI_DIRECTION_INOUT
} GIDirection;

The direction of a GIArgInfo.

GI_DIRECTION_IN

in argument.

GI_DIRECTION_OUT

out argument.

GI_DIRECTION_INOUT

in and out argument.

enum GIScopeType

typedef enum {
  GI_SCOPE_TYPE_INVALID,
  GI_SCOPE_TYPE_CALL,
  GI_SCOPE_TYPE_ASYNC,
  GI_SCOPE_TYPE_NOTIFIED
} GIScopeType;

Scope type of a GIArgInfo representing callback, determines how the callback is invoked and is used to decided when the invoke structs can be freed.

GI_SCOPE_TYPE_INVALID

The argument is not of callback type.

GI_SCOPE_TYPE_CALL

The callback and associated user_data is only used during the call to this function.

GI_SCOPE_TYPE_ASYNC

The callback and associated user_data is only used until the callback is invoked, and the callback. is invoked always exactly once.

GI_SCOPE_TYPE_NOTIFIED

The callback and and associated user_data is used until the caller is notfied via the destroy_notify.

enum GITransfer

typedef enum {
  GI_TRANSFER_NOTHING,
  GI_TRANSFER_CONTAINER,
  GI_TRANSFER_EVERYTHING
} GITransfer;

Represent the transfer ownership information of a GICallableInfo or a GIArgInfo.

GI_TRANSFER_NOTHING

transfer nothing to the caller

GI_TRANSFER_CONTAINER

transfer the container (eg list, array, hashtable), but no the contents to the caller.

GI_TRANSFER_EVERYTHING

transfer everything to the caller.

g_arg_info_get_direction ()

GIDirection         g_arg_info_get_direction            (GIArgInfo *info);

Obtain the direction of the argument. Check GIDirection for possible direction values.

info :

a GIArgInfo

Returns :

the direction

g_arg_info_is_return_value ()

gboolean            g_arg_info_is_return_value          (GIArgInfo *info);

Obtain if the argument is a return value. It can either be a parameter or a return value.

info :

a GIArgInfo

Returns :

TRUE if it is a return value

g_arg_info_is_optional ()

gboolean            g_arg_info_is_optional              (GIArgInfo *info);

Obtain if the argument is optional.

info :

a GIArgInfo

Returns :

TRUE if it is an optional argument

g_arg_info_may_be_null ()

gboolean            g_arg_info_may_be_null              (GIArgInfo *info);

Obtain if the argument accepts NULL.

info :

a GIArgInfo

Returns :

TRUE if it accepts NULL

g_arg_info_get_ownership_transfer ()

GITransfer          g_arg_info_get_ownership_transfer   (GIArgInfo *info);

Obtain the ownership transfer for this argument. GITransfer contains a list of possible values.

info :

a GIArgInfo

Returns :

the transfer

g_arg_info_get_scope ()

GIScopeType         g_arg_info_get_scope                (GIArgInfo *info);

Obtain the scope type for this argument. The scope type explains how a callback is going to be invoked, most importantly when the resources required to invoke it can be freed. GIScopeType contains a list of possible values.

info :

a GIArgInfo

Returns :

the scope type

g_arg_info_get_closure ()

gint                g_arg_info_get_closure              (GIArgInfo *info);

Obtain the index of the user data argument. This is only valid for arguments which are callbacks.

info :

a GIArgInfo

Returns :

index of the user data argument or -1 if there is none

g_arg_info_get_destroy ()

gint                g_arg_info_get_destroy              (GIArgInfo *info);

Obtains the index of the GDestroyNotify argument. This is only valid for arguments which are callbacks.

info :

a GIArgInfo

Returns :

index of the GDestroyNotify argument or -1 if there is none

g_arg_info_get_type ()

GITypeInfo *        g_arg_info_get_type                 (GIArgInfo *info);

Obtain the type information for info.

info :

a GIArgInfo

Returns :

the GIArgInfo, free it with g_base_info_unref() when done. [transfer full]

g_arg_info_load_type ()

void                g_arg_info_load_type                (GIArgInfo *info,
                                                         GITypeInfo *type);

Obtain information about a the type of given argument info; this function is a variant of g_arg_info_get_type() designed for stack allocation.

The initialized type must not be referenced after info is deallocated.

info :

a GIArgInfo

type :

Initialized with information about type of info. [out caller-allocates]