package ocgtk
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054
doc/ocgtk.common/Gobject/Value/index.html
Module Gobject.ValueSource
Type-specific getters/setters
Get a GVariant from a GValue of G_TYPE_VARIANT. The returned value is a new reference (ref-counted); the caller may use it freely and the OCaml GC will unref it when the value is collected.
Set a GVariant on a GValue of G_TYPE_VARIANT. Transfer-none: the GValue takes its own reference.
Get the raw integer value of a GValue holding an enum type. Raises Invalid_argument if the GValue does not hold an enum type.
Set the raw integer value of a GValue holding an enum type. Raises Invalid_argument if the GValue does not hold an enum type.
Get the raw integer bitmask of a GValue holding a flags type. Raises Invalid_argument if the GValue does not hold a flags type.
Set the raw integer bitmask of a GValue holding a flags type. Raises Invalid_argument if the GValue does not hold a flags type.
Get a boxed GIR record from a GValue holding a boxed GType. Returns a gir_record custom block (ocgtk_gir_record_ops) carrying the GType and an owned copy of the boxed data (g_boxed_copy was called). The existing gir_record finalizer calls g_boxed_free when the block is collected. The caller must ascribe the correct record type at the call site, e.g. (Gobject.Value.get_boxed v : Gtk.Tree_iter.t). Raises Invalid_argument if the GValue does not hold a boxed type.
Set a boxed GIR record on a GValue holding a boxed GType. The argument must be a gir_record custom block created by the ocgtk GIR record infrastructure and backed by a registered boxed GType (i.e. G_TYPE_IS_BOXED(type) must be true for the record's GType). Passing a plain non-boxed GIR record yields type confusion at GValue finalization because g_value_set_boxed will call g_boxed_copy and g_boxed_free internally using the GType stored in the GValue, not the record's own type. Transfer-none: the GValue copies the data via g_boxed_copy internally. The caller must ascribe the correct record type at the call site.
Get a GObject from a GValue, raising Failure if the value is NULL. Use this when the GIR declares the parameter non-nullable.