EnumValueProtocol

public protocol EnumValueProtocol

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.

A structure which contains a single enum value, its name, and its nickname.

  • ptr

    Untyped pointer to the underlying GEnumValue instance.

    Declaration

    Swift

    var ptr: UnsafeMutableRawPointer! { get }
  • _ptr Default implementation

    Typed 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 }

EnumValue Record: EnumValueProtocol extension (methods and fields)

  • This function is meant to be called from the complete_type_info function of a GTypePlugin 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 using g_enum_register_static().

    Declaration

    Swift

    @inlinable
    func enumRegisterStatic(name: UnsafePointer<gchar>!) -> GType
  • value Extension method

    the enum value

    Declaration

    Swift

    @inlinable
    var value: gint { get set }
  • valueName Extension method

    the name of the value

    Declaration

    Swift

    @inlinable
    var valueName: UnsafePointer<gchar>! { get set }
  • valueNick Extension method

    the nickname of the value

    Declaration

    Swift

    @inlinable
    var valueNick: UnsafePointer<gchar>! { get set }