def values_for_enum(gtype):
    """Get all values for a enum (gtype)."""

    g_type_class = gobject_lib.g_type_class_ref(gtype)
    g_enum_class = ffi.cast('GEnumClass *', g_type_class)

    values = []

    # -1 since we always have a "last" member.
    for i in range(0, g_enum_class.n_values - 1):
        value = _to_string(g_enum_class.values[i].value_nick)
        values.append(value)

    return values
Get all values for a enum (gtype).