EnumValueProtocol
public protocol EnumValueProtocol
A structure which contains a single enum value, its name, and its nickname.
The EnumValueProtocol
protocol exposes the methods and properties of an underlying GEnumValue
instance.
The default implementation of these can be found in the protocol extension below.
For a concrete class that implements these methods and properties, see EnumValue
.
Alternatively, use EnumValueRef
as a lighweight, unowned
reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GEnumValue
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
_ptr
Default implementationTyped pointer to the underlying
GEnumValue
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GEnumValue
instance.Declaration
Swift
var _ptr: UnsafeMutablePointer<GEnumValue>! { get }
-
Required Initialiser for types conforming to
EnumValueProtocol
Declaration
Swift
init(raw: UnsafeMutableRawPointer)
-
enumCompleteTypeInfo(gEnumType:
Extension methodinfo: ) This function is meant to be called from the
complete_type_info
function of aGTypePlugin
implementation, as in the following example:(C Language Example):
static void my_enum_complete_type_info (GTypePlugin *plugin, GType g_type, GTypeInfo *info, GTypeValueTable *value_table) { static const GEnumValue values[] = { { MY_ENUM_FOO, "MY_ENUM_FOO", "foo" }, { MY_ENUM_BAR, "MY_ENUM_BAR", "bar" }, { 0, NULL, NULL } }; g_enum_complete_type_info (type, info, values); }
Declaration
Swift
@inlinable func enumCompleteTypeInfo<TypeInfoT>(gEnumType: GType, info: TypeInfoT) where TypeInfoT : TypeInfoProtocol
-
enumRegisterStatic(name:
Extension method) Registers a new static enumeration type with the name
name
.It is normally more convenient to let glib-mkenums, generate a
my_enum_get_type()
function from a usual C enumeration definition than to write one yourself usingg_enum_register_static()
.Declaration
Swift
@inlinable func enumRegisterStatic(name: UnsafePointer<gchar>!) -> GType
-
value
Extension methodthe enum value
Declaration
Swift
@inlinable var value: gint { get set }
-
valueName
Extension methodthe name of the value
Declaration
Swift
@inlinable var valueName: UnsafePointer<gchar>! { get set }
-
valueNick
Extension methodthe nickname of the value
Declaration
Swift
@inlinable var valueNick: UnsafePointer<gchar>! { get set }