Top |
A NcmObjArray is a GPtrArray that holds GObject's. It is used to store GObject's that can be serialized to a GVariant.
NcmObjArray *
ncm_obj_array_sized_new (guint n
);
Creates a new NcmObjArray with n
elements preallocated.
NcmObjArray *
ncm_obj_array_ref (NcmObjArray *oa
);
Increases the reference count of oa
by one.
void
ncm_obj_array_unref (NcmObjArray *oa
);
Decreases the reference count of oa
by one. If the reference count
reaches zero, all objects in the array are unreferenced.
void
ncm_obj_array_clear (NcmObjArray **oa
);
If *oa
is not NULL
, unreferences it and sets *oa
to NULL
.
void ncm_obj_array_add (NcmObjArray *oa
,GObject *obj
);
Adds a GObject to a NcmObjArray.
void ncm_obj_array_set (NcmObjArray *oa
,guint i
,GObject *obj
);
Sets a GObject to a NcmObjArray. If there is already a GObject
at position i
, it is unreferenced.
GObject * ncm_obj_array_get (NcmObjArray *oa
,guint i
);
Gets a GObject from a NcmObjArray at position i
.
GObject * ncm_obj_array_peek (NcmObjArray *oa
,guint i
);
Peeks a GObject from a NcmObjArray at position i
without increasing its reference
count.
NcmObjDictStr *
ncm_obj_dict_str_ref (NcmObjDictStr *ods
);
Increases the reference count of ods
by one.
void
ncm_obj_dict_str_unref (NcmObjDictStr *ods
);
Decreases the reference count of ods
by one. If the reference count
reaches zero, all objects in the dictionary are unreferenced.
void
ncm_obj_dict_str_clear (NcmObjDictStr **ods
);
If *ods
is not NULL
, unreferences it and sets *ods
to NULL
.
void ncm_obj_dict_str_add (NcmObjDictStr *ods
,const gchar *key
,GObject *obj
);
Adds a GObject to a NcmObjDictStr.
void ncm_obj_dict_str_set (NcmObjDictStr *ods
,const gchar *key
,GObject *obj
);
Sets a GObject to a NcmObjDictStr. If there is already a GObject
with key key
, it is unreferenced.
GObject * ncm_obj_dict_str_get (NcmObjDictStr *ods
,const gchar *key
);
Gets a GObject from a NcmObjDictStr with key key
.
GObject * ncm_obj_dict_str_peek (NcmObjDictStr *ods
,const gchar *key
);
Peeks a GObject from a NcmObjDictStr with key key
without increasing its reference
count.
guint
ncm_obj_dict_str_len (NcmObjDictStr *ods
);
Gets the length of a NcmObjDictStr.
GStrv
ncm_obj_dict_str_keys (NcmObjDictStr *ods
);
Gets the keys of a NcmObjDictStr.
NcmObjDictInt *
ncm_obj_dict_int_ref (NcmObjDictInt *odi
);
Increases the reference count of odi
by one.
void
ncm_obj_dict_int_unref (NcmObjDictInt *odi
);
Decreases the reference count of odi
by one. If the reference count
reaches zero, all objects in the dictionary are unreferenced.
void
ncm_obj_dict_int_clear (NcmObjDictInt **odi
);
If *odi
is not NULL
, unreferences it and sets *odi
to NULL
.
void ncm_obj_dict_int_add (NcmObjDictInt *odi
,gint key
,GObject *obj
);
Adds a GObject to a NcmObjDictInt.
void ncm_obj_dict_int_set (NcmObjDictInt *odi
,gint key
,GObject *obj
);
Sets a GObject to a NcmObjDictInt. If there is already a GObject
with key key
, it is unreferenced.
GObject * ncm_obj_dict_int_get (NcmObjDictInt *odi
,gint key
);
Gets a GObject from a NcmObjDictInt with key key
.
GObject * ncm_obj_dict_int_peek (NcmObjDictInt *odi
,gint key
);
Peeks a GObject from a NcmObjDictInt with key key
without increasing its reference
count.
guint
ncm_obj_dict_int_len (NcmObjDictInt *odi
);
Gets the length of a NcmObjDictInt.
GArray *
ncm_obj_dict_int_keys (NcmObjDictInt *odi
);
Gets the keys of a NcmObjDictInt.
NcmVarDict *
ncm_var_dict_ref (NcmVarDict *vd
);
Increases the reference count of vd
by one.
void
ncm_var_dict_unref (NcmVarDict *vd
);
Decreases the reference count of vd
by one. If the reference count
reaches zero, all objects in the dictionary are unreferenced.
void
ncm_var_dict_clear (NcmVarDict **vd
);
If *vd
is not NULL
, unreferences it and sets *vd
to NULL
.
void ncm_var_dict_set_string (NcmVarDict *vd
,const gchar *key
,const gchar *value
);
Sets a string to a NcmVarDict. If there is already a string
with key key
, it is unreferenced.
void ncm_var_dict_set_int (NcmVarDict *vd
,const gchar *key
,gint value
);
Sets an integer to a NcmVarDict. If there is already an integer
with key key
, it is unreferenced.
void ncm_var_dict_set_double (NcmVarDict *vd
,const gchar *key
,gdouble value
);
Sets a double to a NcmVarDict. If there is already a double
with key key
, it is unreferenced.
void ncm_var_dict_set_boolean (NcmVarDict *vd
,const gchar *key
,gboolean value
);
Sets a boolean to a NcmVarDict. If there is already a boolean
with key key
, it is unreferenced.
void ncm_var_dict_set_int_array (NcmVarDict *vd
,const gchar *key
,GArray *value
);
Sets an array of integers to a NcmVarDict. If there is already an array
of integers with key key
, it is unreferenced.
void ncm_var_dict_set_double_array (NcmVarDict *vd
,const gchar *key
,GArray *value
);
Sets an array of doubles to a NcmVarDict. If there is already an array
of doubles with key key
, it is unreferenced.
void ncm_var_dict_set_boolean_array (NcmVarDict *vd
,const gchar *key
,GArray *value
);
Sets an array of booleans to a NcmVarDict. If there is already an array
of booleans with key key
, it is unreferenced.
void ncm_var_dict_set_variant (NcmVarDict *vd
,const gchar *key
,GVariant *value
);
Sets a GVariant to a NcmVarDict. If there is already a GVariant
with key key
, it is unreferenced.
Valid GVariant types are:
G_VARIANT_TYPE_STRING
G_VARIANT_TYPE_INT32
G_VARIANT_TYPE_DOUBLE
G_VARIANT_TYPE_BOOLEAN
G_VARIANT_TYPE_ARRAY
(element-type int)
G_VARIANT_TYPE_ARRAY
(element-type double)
G_VARIANT_TYPE_ARRAY
(element-type boolean)
gboolean ncm_var_dict_has_key (NcmVarDict *vd
,const gchar *key
);
Checks if a NcmVarDict has a key key
.
gboolean ncm_var_dict_get_string (NcmVarDict *vd
,const gchar *key
,gchar **value
);
Gets a string from a NcmVarDict with key key
.
gboolean ncm_var_dict_get_int (NcmVarDict *vd
,const gchar *key
,gint *value
);
Gets an integer from a NcmVarDict with key key
.
gboolean ncm_var_dict_get_double (NcmVarDict *vd
,const gchar *key
,gdouble *value
);
Gets a double from a NcmVarDict with key key
.
gboolean ncm_var_dict_get_boolean (NcmVarDict *vd
,const gchar *key
,gboolean *value
);
Gets a boolean from a NcmVarDict with key key
.
gboolean ncm_var_dict_get_int_array (NcmVarDict *vd
,const gchar *key
,GArray **value
);
Gets an array of integers from a NcmVarDict with key key
.
gboolean ncm_var_dict_get_double_array (NcmVarDict *vd
,const gchar *key
,GArray **value
);
Gets an array of doubles from a NcmVarDict with key key
.
gboolean ncm_var_dict_get_boolean_array (NcmVarDict *vd
,const gchar *key
,GArray **value
);
Gets an array of booleans from a NcmVarDict with key key
.
gboolean ncm_var_dict_get_variant (NcmVarDict *vd
,const gchar *key
,GVariant **value
);
Gets a GVariant from a NcmVarDict with key key
.