Functions

The following functions are available globally.

  • Provide a copy of a boxed structure src_boxed which is of type boxed_type.

    Declaration

    Swift

    public func boxedCopy(boxedType boxed_type: GType, srcBoxed src_boxed: gconstpointer) -> UnsafeMutableRawPointer!
  • Free the boxed structure boxed which is of type boxed_type.

    Declaration

    Swift

    public func boxedFree(boxedType boxed_type: GType, boxed: UnsafeMutableRawPointer)
  • This function creates a new G_TYPE_BOXED derived type id for a new boxed type with name name. Boxed type handling functions have to be provided to copy and free opaque boxed structures of this type.

    Declaration

    Swift

    public func boxedTypeRegisterStatic(name: UnsafePointer<gchar>, boxedCopy boxed_copy: @escaping BoxedCopyFunc, boxedFree boxed_free: @escaping BoxedFreeFunc) -> GType
  • A GClosureMarshal function for use with signals with handlers that take two boxed pointers as arguments and return a boolean. If you have such a signal, you will probably also need to use an accumulator, such as g_signal_accumulator_true_handled().

    Declaration

    Swift

    public func cclosureMarshalBOOLEAN_BOXEDBOXED(closure: ClosureProtocol, returnValue return_value: ValueProtocol, nParamValues n_param_values: CUnsignedInt, paramValues param_values: ValueProtocol, invocationHint invocation_hint: UnsafeMutableRawPointer, marshalData marshal_data: UnsafeMutableRawPointer)
  • A marshaller for a GCClosure with a callback of type gboolean (*callback) (gpointer instance, gint arg1, gpointer user_data) where the gint parameter denotes a flags type.

    Declaration

    Swift

    public func cclosureMarshalBOOLEAN_FLAGS(closure: ClosureProtocol, returnValue return_value: ValueProtocol, nParamValues n_param_values: CUnsignedInt, paramValues param_values: ValueProtocol, invocationHint invocation_hint: UnsafeMutableRawPointer, marshalData marshal_data: UnsafeMutableRawPointer)
  • A marshaller for a GCClosure with a callback of type gchar* (*callback) (gpointer instance, GObject *arg1, gpointer arg2, gpointer user_data).

    Declaration

    Swift

    public func cclosureMarshalSTRING_OBJECTPOINTER(closure: ClosureProtocol, returnValue return_value: ValueProtocol, nParamValues n_param_values: CUnsignedInt, paramValues param_values: ValueProtocol, invocationHint invocation_hint: UnsafeMutableRawPointer, marshalData marshal_data: UnsafeMutableRawPointer)
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, gboolean arg1, gpointer user_data).

    Declaration

    Swift

    public func cclosureMarshalVOID_BOOLEAN(closure: ClosureProtocol, returnValue return_value: ValueProtocol, nParamValues n_param_values: CUnsignedInt, paramValues param_values: ValueProtocol, invocationHint invocation_hint: UnsafeMutableRawPointer, marshalData marshal_data: UnsafeMutableRawPointer)
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, GBoxed *arg1, gpointer user_data).

    Declaration

    Swift

    public func cclosureMarshalVOID_BOXED(closure: ClosureProtocol, returnValue return_value: ValueProtocol, nParamValues n_param_values: CUnsignedInt, paramValues param_values: ValueProtocol, invocationHint invocation_hint: UnsafeMutableRawPointer, marshalData marshal_data: UnsafeMutableRawPointer)
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, gchar arg1, gpointer user_data).

    Declaration

    Swift

    public func cclosureMarshalVOID_CHAR(closure: ClosureProtocol, returnValue return_value: ValueProtocol, nParamValues n_param_values: CUnsignedInt, paramValues param_values: ValueProtocol, invocationHint invocation_hint: UnsafeMutableRawPointer, marshalData marshal_data: UnsafeMutableRawPointer)
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, gdouble arg1, gpointer user_data).

    Declaration

    Swift

    public func cclosureMarshalVOID_DOUBLE(closure: ClosureProtocol, returnValue return_value: ValueProtocol, nParamValues n_param_values: CUnsignedInt, paramValues param_values: ValueProtocol, invocationHint invocation_hint: UnsafeMutableRawPointer, marshalData marshal_data: UnsafeMutableRawPointer)
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, gint arg1, gpointer user_data) where the gint parameter denotes an enumeration type..

    Declaration

    Swift

    public func cclosureMarshalVOID_ENUM(closure: ClosureProtocol, returnValue return_value: ValueProtocol, nParamValues n_param_values: CUnsignedInt, paramValues param_values: ValueProtocol, invocationHint invocation_hint: UnsafeMutableRawPointer, marshalData marshal_data: UnsafeMutableRawPointer)
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, gint arg1, gpointer user_data) where the gint parameter denotes a flags type.

    Declaration

    Swift

    public func cclosureMarshalVOID_FLAGS(closure: ClosureProtocol, returnValue return_value: ValueProtocol, nParamValues n_param_values: CUnsignedInt, paramValues param_values: ValueProtocol, invocationHint invocation_hint: UnsafeMutableRawPointer, marshalData marshal_data: UnsafeMutableRawPointer)
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, gfloat arg1, gpointer user_data).

    Declaration

    Swift

    public func cclosureMarshalVOID_FLOAT(closure: ClosureProtocol, returnValue return_value: ValueProtocol, nParamValues n_param_values: CUnsignedInt, paramValues param_values: ValueProtocol, invocationHint invocation_hint: UnsafeMutableRawPointer, marshalData marshal_data: UnsafeMutableRawPointer)
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, gint arg1, gpointer user_data).

    Declaration

    Swift

    public func cclosureMarshalVOID_INT(closure: ClosureProtocol, returnValue return_value: ValueProtocol, nParamValues n_param_values: CUnsignedInt, paramValues param_values: ValueProtocol, invocationHint invocation_hint: UnsafeMutableRawPointer, marshalData marshal_data: UnsafeMutableRawPointer)
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, glong arg1, gpointer user_data).

    Declaration

    Swift

    public func cclosureMarshalVOID_LONG(closure: ClosureProtocol, returnValue return_value: ValueProtocol, nParamValues n_param_values: CUnsignedInt, paramValues param_values: ValueProtocol, invocationHint invocation_hint: UnsafeMutableRawPointer, marshalData marshal_data: UnsafeMutableRawPointer)
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, GObject *arg1, gpointer user_data).

    Declaration

    Swift

    public func cclosureMarshalVOID_OBJECT(closure: ClosureProtocol, returnValue return_value: ValueProtocol, nParamValues n_param_values: CUnsignedInt, paramValues param_values: ValueProtocol, invocationHint invocation_hint: UnsafeMutableRawPointer, marshalData marshal_data: UnsafeMutableRawPointer)
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, GParamSpec *arg1, gpointer user_data).

    Declaration

    Swift

    public func cclosureMarshalVOID_PARAM(closure: ClosureProtocol, returnValue return_value: ValueProtocol, nParamValues n_param_values: CUnsignedInt, paramValues param_values: ValueProtocol, invocationHint invocation_hint: UnsafeMutableRawPointer, marshalData marshal_data: UnsafeMutableRawPointer)
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, gpointer arg1, gpointer user_data).

    Declaration

    Swift

    public func cclosureMarshalVOID_POINTER(closure: ClosureProtocol, returnValue return_value: ValueProtocol, nParamValues n_param_values: CUnsignedInt, paramValues param_values: ValueProtocol, invocationHint invocation_hint: UnsafeMutableRawPointer, marshalData marshal_data: UnsafeMutableRawPointer)
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, const gchar *arg1, gpointer user_data).

    Declaration

    Swift

    public func cclosureMarshalVOID_STRING(closure: ClosureProtocol, returnValue return_value: ValueProtocol, nParamValues n_param_values: CUnsignedInt, paramValues param_values: ValueProtocol, invocationHint invocation_hint: UnsafeMutableRawPointer, marshalData marshal_data: UnsafeMutableRawPointer)
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, guchar arg1, gpointer user_data).

    Declaration

    Swift

    public func cclosureMarshalVOID_UCHAR(closure: ClosureProtocol, returnValue return_value: ValueProtocol, nParamValues n_param_values: CUnsignedInt, paramValues param_values: ValueProtocol, invocationHint invocation_hint: UnsafeMutableRawPointer, marshalData marshal_data: UnsafeMutableRawPointer)
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, guint arg1, gpointer user_data).

    Declaration

    Swift

    public func cclosureMarshalVOID_UINT(closure: ClosureProtocol, returnValue return_value: ValueProtocol, nParamValues n_param_values: CUnsignedInt, paramValues param_values: ValueProtocol, invocationHint invocation_hint: UnsafeMutableRawPointer, marshalData marshal_data: UnsafeMutableRawPointer)
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, guint arg1, gpointer arg2, gpointer user_data).

    Declaration

    Swift

    public func cclosureMarshalVOID_UINTPOINTER(closure: ClosureProtocol, returnValue return_value: ValueProtocol, nParamValues n_param_values: CUnsignedInt, paramValues param_values: ValueProtocol, invocationHint invocation_hint: UnsafeMutableRawPointer, marshalData marshal_data: UnsafeMutableRawPointer)
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, gulong arg1, gpointer user_data).

    Declaration

    Swift

    public func cclosureMarshalVOID_ULONG(closure: ClosureProtocol, returnValue return_value: ValueProtocol, nParamValues n_param_values: CUnsignedInt, paramValues param_values: ValueProtocol, invocationHint invocation_hint: UnsafeMutableRawPointer, marshalData marshal_data: UnsafeMutableRawPointer)
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, GVariant *arg1, gpointer user_data).

    Declaration

    Swift

    public func cclosureMarshalVOID_VARIANT(closure: ClosureProtocol, returnValue return_value: ValueProtocol, nParamValues n_param_values: CUnsignedInt, paramValues param_values: ValueProtocol, invocationHint invocation_hint: UnsafeMutableRawPointer, marshalData marshal_data: UnsafeMutableRawPointer)
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, gpointer user_data).

    Declaration

    Swift

    public func cclosureMarshalVOID_VOID(closure: ClosureProtocol, returnValue return_value: ValueProtocol, nParamValues n_param_values: CUnsignedInt, paramValues param_values: ValueProtocol, invocationHint invocation_hint: UnsafeMutableRawPointer, marshalData marshal_data: UnsafeMutableRawPointer)
  • A generic marshaller function implemented via libffi.

    Normally this function is not passed explicitly to g_signal_new(), but used automatically by GLib when specifying a nil marshaller.

    Declaration

    Swift

    public func cclosureMarshalGeneric(closure: ClosureProtocol, returnGvalue return_gvalue: ValueProtocol, nParamValues n_param_values: CUnsignedInt, paramValues param_values: ValueProtocol, invocationHint invocation_hint: UnsafeMutableRawPointer, marshalData marshal_data: UnsafeMutableRawPointer)
  • Creates a new closure which invokes callback_func with user_data as the last parameter.

    destroy_data will be called as a finalize notifier on the GClosure.

    Declaration

    Swift

    public func cclosureNew(callbackFunc callback_func: @escaping Callback, userData user_data: UnsafeMutableRawPointer, destroyData destroy_data: @escaping ClosureNotify) -> UnsafeMutablePointer<GClosure>!
  • A variant of g_cclosure_new() which uses object as user_data and calls g_object_watch_closure() on object and the created closure. This function is useful when you have a callback closely associated with a GObject, and want the callback to no longer run after the object is is freed.

    Declaration

    Swift

    public func cclosureNewObject(callbackFunc callback_func: @escaping Callback, object: ObjectProtocol) -> UnsafeMutablePointer<GClosure>!
  • A variant of g_cclosure_new_swap() which uses object as user_data and calls g_object_watch_closure() on object and the created closure. This function is useful when you have a callback closely associated with a GObject, and want the callback to no longer run after the object is is freed.

    Declaration

    Swift

    public func cclosureNewObjectSwap(callbackFunc callback_func: @escaping Callback, object: ObjectProtocol) -> UnsafeMutablePointer<GClosure>!
  • Creates a new closure which invokes callback_func with user_data as the first parameter.

    destroy_data will be called as a finalize notifier on the GClosure.

    Declaration

    Swift

    public func cclosureNewSwap(callbackFunc callback_func: @escaping Callback, userData user_data: UnsafeMutableRawPointer, destroyData destroy_data: @escaping ClosureNotify) -> UnsafeMutablePointer<GClosure>!
  • Clears a reference to a GObject.

    object_ptr must not be nil.

    If the reference is nil then this function does nothing. Otherwise, the reference count of the object is decreased and the pointer is set to nil.

    A macro is also included that allows this function to be used without pointer casts.

    Declaration

    Swift

    public func clearObject(objectPtr object_ptr: ObjectProtocol)
  • Disconnects a handler from instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to. The handler_id_ptr is then set to zero, which is never a valid handler ID value (see g_signal_connect()).

    If the handler ID is 0 then this function does nothing.

    A macro is also included that allows this function to be used without pointer casts.

    Declaration

    Swift

    public func clearSignalHandler(handlerIDPtr handler_id_ptr: UnsafeMutablePointer<CUnsignedLong>, instance: ObjectProtocol)
  • 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

    public func enumCompleteTypeInfo(gEnumType g_enum_type: GType, info: TypeInfoProtocol, constValues const_values: EnumValueProtocol)
  • Returns the GEnumValue for a value.

    Declaration

    Swift

    public func enumGetValue(enumClass enum_class: EnumClassProtocol, value: CInt) -> UnsafeMutablePointer<GEnumValue>!
  • Looks up a GEnumValue by name.

    Declaration

    Swift

    public func enumGetValueByName(enumClass enum_class: EnumClassProtocol, name: UnsafePointer<gchar>) -> UnsafeMutablePointer<GEnumValue>!
  • Looks up a GEnumValue by nickname.

    Declaration

    Swift

    public func enumGetValueByNick(enumClass enum_class: EnumClassProtocol, nick: UnsafePointer<gchar>) -> UnsafeMutablePointer<GEnumValue>!
  • 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

    public func enumRegisterStatic(name: UnsafePointer<gchar>, constStaticValues const_static_values: EnumValueProtocol) -> GType
  • Pretty-prints value in the form of the enum’s name.

    This is intended to be used for debugging purposes. The format of the output may change in the future.

    Declaration

    Swift

    public func enumToString(gEnumType g_enum_type: GType, value: CInt) -> String!
  • This function is meant to be called from the complete_type_info() function of a GTypePlugin implementation, see the example for g_enum_complete_type_info() above.

    Declaration

    Swift

    public func flagsCompleteTypeInfo(gFlagsType g_flags_type: GType, info: TypeInfoProtocol, constValues const_values: FlagsValueProtocol)
  • Returns the first GFlagsValue which is set in value.

    Declaration

    Swift

    public func flagsGetFirstValue(flagsClass flags_class: FlagsClassProtocol, value: CUnsignedInt) -> UnsafeMutablePointer<GFlagsValue>!
  • Looks up a GFlagsValue by name.

    Declaration

    Swift

    public func flagsGetValueByName(flagsClass flags_class: FlagsClassProtocol, name: UnsafePointer<gchar>) -> UnsafeMutablePointer<GFlagsValue>!
  • Looks up a GFlagsValue by nickname.

    Declaration

    Swift

    public func flagsGetValueByNick(flagsClass flags_class: FlagsClassProtocol, nick: UnsafePointer<gchar>) -> UnsafeMutablePointer<GFlagsValue>!
  • Registers a new static flags type with the name name.

    It is normally more convenient to let glib-mkenums generate a my_flags_get_type() function from a usual C enumeration definition than to write one yourself using g_flags_register_static().

    Declaration

    Swift

    public func flagsRegisterStatic(name: UnsafePointer<gchar>, constStaticValues const_static_values: FlagsValueProtocol) -> GType
  • Pretty-prints value in the form of the flag names separated by | and sorted. Any extra bits will be shown at the end as a hexadecimal number.

    This is intended to be used for debugging purposes. The format of the output may change in the future.

    Declaration

    Swift

    public func flagsToString(flagsType flags_type: GType, value: CUnsignedInt) -> String!
  • Undocumented

    Declaration

    Swift

    public func gtypeGetType() -> GType
  • Creates a new GParamSpecBoolean instance specifying a G_TYPE_BOOLEAN property. In many cases, it may be more appropriate to use an enum with g_param_spec_enum(), both to improve code clarity by using explicitly named values, and to allow for more values to be added in future without breaking API.

    See g_param_spec_internal() for details on property names.

    Declaration

    Swift

    public func paramSpecBoolean(name: UnsafePointer<gchar>, nick: UnsafePointer<gchar>, blurb: UnsafePointer<gchar>, defaultValue default_value: Bool, flags: ParamFlags) -> UnsafeMutablePointer<GParamSpec>!
  • Creates a new GParamSpecBoxed instance specifying a G_TYPE_BOXED derived property.

    See g_param_spec_internal() for details on property names.

    Declaration

    Swift

    public func paramSpecBoxed(name: UnsafePointer<gchar>, nick: UnsafePointer<gchar>, blurb: UnsafePointer<gchar>, boxedType boxed_type: GType, flags: ParamFlags) -> UnsafeMutablePointer<GParamSpec>!
  • Creates a new GParamSpecChar instance specifying a G_TYPE_CHAR property.

    Declaration

    Swift

    public func paramSpecChar(name: UnsafePointer<gchar>, nick: UnsafePointer<gchar>, blurb: UnsafePointer<gchar>, minimum: Int8, maximum: Int8, defaultValue default_value: Int8, flags: ParamFlags) -> UnsafeMutablePointer<GParamSpec>!
  • Creates a new GParamSpecDouble instance specifying a G_TYPE_DOUBLE property.

    See g_param_spec_internal() for details on property names.

    Declaration

    Swift

    public func paramSpecDouble(name: UnsafePointer<gchar>, nick: UnsafePointer<gchar>, blurb: UnsafePointer<gchar>, minimum: gdouble, maximum: gdouble, defaultValue default_value: gdouble, flags: ParamFlags) -> UnsafeMutablePointer<GParamSpec>!
  • Creates a new GParamSpecEnum instance specifying a G_TYPE_ENUM property.

    See g_param_spec_internal() for details on property names.

    Declaration

    Swift

    public func paramSpecEnum(name: UnsafePointer<gchar>, nick: UnsafePointer<gchar>, blurb: UnsafePointer<gchar>, enumType enum_type: GType, defaultValue default_value: CInt, flags: ParamFlags) -> UnsafeMutablePointer<GParamSpec>!
  • Creates a new GParamSpecFlags instance specifying a G_TYPE_FLAGS property.

    See g_param_spec_internal() for details on property names.

    Declaration

    Swift

    public func paramSpecFlags(name: UnsafePointer<gchar>, nick: UnsafePointer<gchar>, blurb: UnsafePointer<gchar>, flagsType flags_type: GType, defaultValue default_value: CUnsignedInt, flags: ParamFlags) -> UnsafeMutablePointer<GParamSpec>!
  • Creates a new GParamSpecFloat instance specifying a G_TYPE_FLOAT property.

    See g_param_spec_internal() for details on property names.

    Declaration

    Swift

    public func paramSpecFloat(name: UnsafePointer<gchar>, nick: UnsafePointer<gchar>, blurb: UnsafePointer<gchar>, minimum: gfloat, maximum: gfloat, defaultValue default_value: gfloat, flags: ParamFlags) -> UnsafeMutablePointer<GParamSpec>!
  • Creates a new GParamSpecGType instance specifying a G_TYPE_GTYPE property.

    See g_param_spec_internal() for details on property names.

    Declaration

    Swift

    public func paramSpecGtype(name: UnsafePointer<gchar>, nick: UnsafePointer<gchar>, blurb: UnsafePointer<gchar>, isAType is_a_type: GType, flags: ParamFlags) -> UnsafeMutablePointer<GParamSpec>!
  • Creates a new GParamSpecInt instance specifying a G_TYPE_INT property.

    See g_param_spec_internal() for details on property names.

    Declaration

    Swift

    public func paramSpecInt(name: UnsafePointer<gchar>, nick: UnsafePointer<gchar>, blurb: UnsafePointer<gchar>, minimum: CInt, maximum: CInt, defaultValue default_value: CInt, flags: ParamFlags) -> UnsafeMutablePointer<GParamSpec>!
  • Creates a new GParamSpecInt64 instance specifying a G_TYPE_INT64 property.

    See g_param_spec_internal() for details on property names.

    Declaration

    Swift

    public func paramSpecInt64(name: UnsafePointer<gchar>, nick: UnsafePointer<gchar>, blurb: UnsafePointer<gchar>, minimum: Int64, maximum: Int64, defaultValue default_value: Int64, flags: ParamFlags) -> UnsafeMutablePointer<GParamSpec>!
  • Creates a new GParamSpecLong instance specifying a G_TYPE_LONG property.

    See g_param_spec_internal() for details on property names.

    Declaration

    Swift

    public func paramSpecLong(name: UnsafePointer<gchar>, nick: UnsafePointer<gchar>, blurb: UnsafePointer<gchar>, minimum: CLong, maximum: CLong, defaultValue default_value: CLong, flags: ParamFlags) -> UnsafeMutablePointer<GParamSpec>!
  • Creates a new GParamSpecBoxed instance specifying a G_TYPE_OBJECT derived property.

    See g_param_spec_internal() for details on property names.

    Declaration

    Swift

    public func paramSpecObject(name: UnsafePointer<gchar>, nick: UnsafePointer<gchar>, blurb: UnsafePointer<gchar>, objectType object_type: GType, flags: ParamFlags) -> UnsafeMutablePointer<GParamSpec>!
  • Creates a new property of type GParamSpecOverride. This is used to direct operations to another paramspec, and will not be directly useful unless you are implementing a new base type similar to GObject.

    Declaration

    Swift

    public func paramSpecOverride(name: UnsafePointer<gchar>, overridden: ParamSpecProtocol) -> UnsafeMutablePointer<GParamSpec>!
  • Creates a new GParamSpecParam instance specifying a G_TYPE_PARAM property.

    See g_param_spec_internal() for details on property names.

    Declaration

    Swift

    public func paramSpecParam(name: UnsafePointer<gchar>, nick: UnsafePointer<gchar>, blurb: UnsafePointer<gchar>, paramType param_type: GType, flags: ParamFlags) -> UnsafeMutablePointer<GParamSpec>!
  • Creates a new GParamSpecPointer instance specifying a pointer property. Where possible, it is better to use g_param_spec_object() or g_param_spec_boxed() to expose memory management information.

    See g_param_spec_internal() for details on property names.

    Declaration

    Swift

    public func paramSpecPointer(name: UnsafePointer<gchar>, nick: UnsafePointer<gchar>, blurb: UnsafePointer<gchar>, flags: ParamFlags) -> UnsafeMutablePointer<GParamSpec>!
  • Creates a new GParamSpecPool.

    If type_prefixing is true, lookups in the newly created pool will allow to specify the owner as a colon-separated prefix of the property name, like “GtkContainer:border-width”. This feature is deprecated, so you should always set type_prefixing to false.

    Declaration

    Swift

    public func paramSpecPoolNew(typePrefixing type_prefixing: Bool) -> UnsafeMutablePointer<GParamSpecPool>!
  • Creates a new GParamSpecString instance.

    See g_param_spec_internal() for details on property names.

    Declaration

    Swift

    public func paramSpecString(name: UnsafePointer<gchar>, nick: UnsafePointer<gchar>, blurb: UnsafePointer<gchar>, defaultValue default_value: UnsafePointer<gchar>, flags: ParamFlags) -> UnsafeMutablePointer<GParamSpec>!
  • Creates a new GParamSpecUChar instance specifying a G_TYPE_UCHAR property.

    Declaration

    Swift

    public func paramSpecUchar(name: UnsafePointer<gchar>, nick: UnsafePointer<gchar>, blurb: UnsafePointer<gchar>, minimum: UInt8, maximum: UInt8, defaultValue default_value: UInt8, flags: ParamFlags) -> UnsafeMutablePointer<GParamSpec>!
  • Creates a new GParamSpecUInt instance specifying a G_TYPE_UINT property.

    See g_param_spec_internal() for details on property names.

    Declaration

    Swift

    public func paramSpecUint(name: UnsafePointer<gchar>, nick: UnsafePointer<gchar>, blurb: UnsafePointer<gchar>, minimum: CUnsignedInt, maximum: CUnsignedInt, defaultValue default_value: CUnsignedInt, flags: ParamFlags) -> UnsafeMutablePointer<GParamSpec>!
  • Creates a new GParamSpecUInt64 instance specifying a G_TYPE_UINT64 property.

    See g_param_spec_internal() for details on property names.

    Declaration

    Swift

    public func paramSpecUint64(name: UnsafePointer<gchar>, nick: UnsafePointer<gchar>, blurb: UnsafePointer<gchar>, minimum: UInt64, maximum: UInt64, defaultValue default_value: UInt64, flags: ParamFlags) -> UnsafeMutablePointer<GParamSpec>!
  • Creates a new GParamSpecULong instance specifying a G_TYPE_ULONG property.

    See g_param_spec_internal() for details on property names.

    Declaration

    Swift

    public func paramSpecUlong(name: UnsafePointer<gchar>, nick: UnsafePointer<gchar>, blurb: UnsafePointer<gchar>, minimum: CUnsignedLong, maximum: CUnsignedLong, defaultValue default_value: CUnsignedLong, flags: ParamFlags) -> UnsafeMutablePointer<GParamSpec>!
  • Creates a new GParamSpecUnichar instance specifying a G_TYPE_UINT property. GValue structures for this property can be accessed with g_value_set_uint() and g_value_get_uint().

    See g_param_spec_internal() for details on property names.

    Declaration

    Swift

    public func paramSpecUnichar(name: UnsafePointer<gchar>, nick: UnsafePointer<gchar>, blurb: UnsafePointer<gchar>, defaultValue default_value: gunichar, flags: ParamFlags) -> UnsafeMutablePointer<GParamSpec>!
  • Creates a new GParamSpecValueArray instance specifying a G_TYPE_VALUE_ARRAY property. G_TYPE_VALUE_ARRAY is a G_TYPE_BOXED type, as such, GValue structures for this property can be accessed with g_value_set_boxed() and g_value_get_boxed().

    See g_param_spec_internal() for details on property names.

    Declaration

    Swift

    public func paramSpecValueArray(name: UnsafePointer<gchar>, nick: UnsafePointer<gchar>, blurb: UnsafePointer<gchar>, elementSpec element_spec: ParamSpecProtocol, flags: ParamFlags) -> UnsafeMutablePointer<GParamSpec>!
  • Creates a new GParamSpecVariant instance specifying a GVariant property.

    If default_value is floating, it is consumed.

    See g_param_spec_internal() for details on property names.

    Declaration

    Swift

    public func paramSpecVariant(name: UnsafePointer<gchar>, nick: UnsafePointer<gchar>, blurb: UnsafePointer<gchar>, type: VariantTypeProtocol, defaultValue default_value: VariantProtocol, flags: ParamFlags) -> UnsafeMutablePointer<GParamSpec>!
  • Registers name as the name of a new static type derived from G_TYPE_PARAM. The type system uses the information contained in the GParamSpecTypeInfo structure pointed to by info to manage the GParamSpec type and its instances.

    Declaration

    Swift

    public func paramTypeRegisterStatic(name: UnsafePointer<gchar>, pspecInfo pspec_info: ParamSpecTypeInfoProtocol) -> GType
  • Transforms src_value into dest_value if possible, and then validates dest_value, in order for it to conform to pspec. If strict_validation is true this function will only succeed if the transformed dest_value complied to pspec without modifications.

    See also g_value_type_transformable(), g_value_transform() and g_param_value_validate().

    Declaration

    Swift

    public func paramValueConvert(pspec: ParamSpecProtocol, srcValue src_value: ValueProtocol, destValue dest_value: ValueProtocol, strictValidation strict_validation: Bool) -> Bool
  • Checks whether value contains the default value as specified in pspec.

    Declaration

    Swift

    public func paramValueDefaults(pspec: ParamSpecProtocol, value: ValueProtocol) -> Bool
  • Sets value to its default value as specified in pspec.

    Declaration

    Swift

    public func paramValueSetDefault(pspec: ParamSpecProtocol, value: ValueProtocol)
  • Ensures that the contents of value comply with the specifications set out by pspec. For example, a GParamSpecInt might require that integers stored in value may not be smaller than -42 and not be greater than +42. If value contains an integer outside of this range, it is modified accordingly, so the resulting value will fit into the range -42 .. +42.

    Declaration

    Swift

    public func paramValueValidate(pspec: ParamSpecProtocol, value: ValueProtocol) -> Bool
  • Compares value1 with value2 according to pspec, and return -1, 0 or +1, if value1 is found to be less than, equal to or greater than value2, respectively.

    Declaration

    Swift

    public func paramValuesCmp(pspec: ParamSpecProtocol, value1: ValueProtocol, value2: ValueProtocol) -> Int
  • Creates a new G_TYPE_POINTER derived type id for a new pointer type with name name.

    Declaration

    Swift

    public func pointerTypeRegisterStatic(name: UnsafePointer<gchar>) -> GType
  • A predefined GSignalAccumulator for signals intended to be used as a hook for application code to provide a particular value. Usually only one such value is desired and multiple handlers for the same signal don’t make much sense (except for the case of the default handler defined in the class structure, in which case you will usually want the signal connection to override the class handler).

    This accumulator will use the return value from the first signal handler that is run as the return value for the signal and not run any further handlers (ie: the first handler “wins”).

    Declaration

    Swift

    public func signalAccumulatorFirstWins(ihint: SignalInvocationHintProtocol, returnAccu return_accu: ValueProtocol, handlerReturn handler_return: ValueProtocol, dummy: UnsafeMutableRawPointer) -> Bool
  • A predefined GSignalAccumulator for signals that return a boolean values. The behavior that this accumulator gives is that a return of true stops the signal emission: no further callbacks will be invoked, while a return of false allows the emission to continue. The idea here is that a true return indicates that the callback handled the signal, and no further handling is needed.

    Declaration

    Swift

    public func signalAccumulatorTrueHandled(ihint: SignalInvocationHintProtocol, returnAccu return_accu: ValueProtocol, handlerReturn handler_return: ValueProtocol, dummy: UnsafeMutableRawPointer) -> Bool
  • Adds an emission hook for a signal, which will get called for any emission of that signal, independent of the instance. This is possible only for signals which don’t have G_SIGNAL_NO_HOOKS flag set.

    Declaration

    Swift

    public func signalAddEmissionHook(signalID signal_id: CUnsignedInt, detail: GLib.Quark, hookFunc hook_func: @escaping SignalEmissionHook, hookData hook_data: UnsafeMutableRawPointer, dataDestroy data_destroy: @escaping GLib.DestroyNotify) -> Int
  • Calls the original class closure of a signal. This function should only be called from an overridden class closure; see g_signal_override_class_closure() and g_signal_override_class_handler().

    Declaration

    Swift

    public func signalChainFromOverridden(instanceAndParams instance_and_params: UnsafePointer<GValue>, returnValue return_value: ValueProtocol)
  • Connects a closure to a signal for a particular object.

    Declaration

    Swift

    public func signalConnectClosure(instance: ObjectProtocol, detailedSignal detailed_signal: UnsafePointer<gchar>, closure: ClosureProtocol, after: Bool) -> Int
  • Connects a closure to a signal for a particular object.

    Declaration

    Swift

    public func signalConnectClosureByID(instance: ObjectProtocol, signalID signal_id: CUnsignedInt, detail: GLib.Quark, closure: ClosureProtocol, after: Bool) -> Int
  • Connects a GCallback function to a signal for a particular object. Similar to g_signal_connect(), but allows to provide a GClosureNotify for the data which will be called when the signal handler is disconnected and no longer used. Specify connect_flags if you need ..._after() or ..._swapped() variants of this function.

    Declaration

    Swift

    public func signalConnectData(instance: ObjectProtocol, detailedSignal detailed_signal: UnsafePointer<gchar>, cHandler c_handler: @escaping Callback, data: UnsafeMutableRawPointer, destroyData destroy_data: @escaping ClosureNotify, connectFlags connect_flags: ConnectFlags) -> Int
  • This is similar to g_signal_connect_data(), but uses a closure which ensures that the gobject stays alive during the call to c_handler by temporarily adding a reference count to gobject.

    When the gobject is destroyed the signal handler will be automatically disconnected. Note that this is not currently threadsafe (ie: emitting a signal while gobject is being destroyed in another thread is not safe).

    Declaration

    Swift

    public func signalConnectObject(instance: TypeInstanceProtocol, detailedSignal detailed_signal: UnsafePointer<gchar>, cHandler c_handler: @escaping Callback, gobject: ObjectProtocol, connectFlags connect_flags: ConnectFlags) -> Int
  • Emits a signal.

    Note that g_signal_emit_valist() resets the return value to the default if no handlers are connected, in contrast to g_signal_emitv().

    Declaration

    Swift

    public func signalEmitValist(instance: TypeInstanceProtocol, signalID signal_id: CUnsignedInt, detail: GLib.Quark, varArgs var_args: CVaListPointer)
  • Emits a signal.

    Note that g_signal_emitv() doesn’t change return_value if no handlers are connected, in contrast to g_signal_emit() and g_signal_emit_valist().

    Declaration

    Swift

    public func signalEmitv(instanceAndParams instance_and_params: UnsafePointer<GValue>, signalID signal_id: CUnsignedInt, detail: GLib.Quark, returnValue return_value: ValueProtocol)
  • Returns the invocation hint of the innermost signal emission of instance.

    Declaration

    Swift

    public func signalGetInvocationHint(instance: ObjectProtocol) -> UnsafeMutablePointer<GSignalInvocationHint>!
  • Blocks a handler of an instance so it will not be called during any signal emissions unless it is unblocked again. Thus “blocking” a signal handler means to temporarily deactive it, a signal handler has to be unblocked exactly the same amount of times it has been blocked before to become active again.

    The handler_id has to be a valid signal handler id, connected to a signal of instance.

    Declaration

    Swift

    public func signalHandlerBlock(instance: ObjectProtocol, handlerID handler_id: CUnsignedLong)
  • Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to. The handler_id becomes invalid and may be reused.

    The handler_id has to be a valid signal handler id, connected to a signal of instance.

    Declaration

    Swift

    public func signalHandlerDisconnect(instance: ObjectProtocol, handlerID handler_id: CUnsignedLong)
  • Finds the first signal handler that matches certain selection criteria. The criteria mask is passed as an OR-ed combination of GSignalMatchType flags, and the criteria values are passed as arguments. The match mask has to be non-0 for successful matches. If no handler was found, 0 is returned.

    Declaration

    Swift

    public func signalHandlerFind(instance: ObjectProtocol, mask: SignalMatchType, signalID signal_id: CUnsignedInt, detail: GLib.Quark, closure: ClosureProtocol, func_: UnsafeMutableRawPointer, data: UnsafeMutableRawPointer) -> Int
  • Returns whether handler_id is the ID of a handler connected to instance.

    Declaration

    Swift

    public func signalHandlerIsConnected(instance: ObjectProtocol, handlerID handler_id: CUnsignedLong) -> Bool
  • Undoes the effect of a previous g_signal_handler_block() call. A blocked handler is skipped during signal emissions and will not be invoked, unblocking it (for exactly the amount of times it has been blocked before) reverts its “blocked” state, so the handler will be recognized by the signal system and is called upon future or currently ongoing signal emissions (since the order in which handlers are called during signal emissions is deterministic, whether the unblocked handler in question is called as part of a currently ongoing emission depends on how far that emission has proceeded yet).

    The handler_id has to be a valid id of a signal handler that is connected to a signal of instance and is currently blocked.

    Declaration

    Swift

    public func signalHandlerUnblock(instance: ObjectProtocol, handlerID handler_id: CUnsignedLong)
  • Blocks all handlers on an instance that match a certain selection criteria. The criteria mask is passed as an OR-ed combination of GSignalMatchType flags, and the criteria values are passed as arguments. Passing at least one of the G_SIGNAL_MATCH_CLOSURE, G_SIGNAL_MATCH_FUNC or G_SIGNAL_MATCH_DATA match flags is required for successful matches. If no handlers were found, 0 is returned, the number of blocked handlers otherwise.

    Declaration

    Swift

    public func signalHandlersBlockMatched(instance: ObjectProtocol, mask: SignalMatchType, signalID signal_id: CUnsignedInt, detail: GLib.Quark, closure: ClosureProtocol, func_: UnsafeMutableRawPointer, data: UnsafeMutableRawPointer) -> Int
  • Destroy all signal handlers of a type instance. This function is an implementation detail of the GObject dispose implementation, and should not be used outside of the type system.

    Declaration

    Swift

    public func signalHandlersDestroy(instance: ObjectProtocol)
  • Disconnects all handlers on an instance that match a certain selection criteria. The criteria mask is passed as an OR-ed combination of GSignalMatchType flags, and the criteria values are passed as arguments. Passing at least one of the G_SIGNAL_MATCH_CLOSURE, G_SIGNAL_MATCH_FUNC or G_SIGNAL_MATCH_DATA match flags is required for successful matches. If no handlers were found, 0 is returned, the number of disconnected handlers otherwise.

    Declaration

    Swift

    public func signalHandlersDisconnectMatched(instance: ObjectProtocol, mask: SignalMatchType, signalID signal_id: CUnsignedInt, detail: GLib.Quark, closure: ClosureProtocol, func_: UnsafeMutableRawPointer, data: UnsafeMutableRawPointer) -> Int
  • Unblocks all handlers on an instance that match a certain selection criteria. The criteria mask is passed as an OR-ed combination of GSignalMatchType flags, and the criteria values are passed as arguments. Passing at least one of the G_SIGNAL_MATCH_CLOSURE, G_SIGNAL_MATCH_FUNC or G_SIGNAL_MATCH_DATA match flags is required for successful matches. If no handlers were found, 0 is returned, the number of unblocked handlers otherwise. The match criteria should not apply to any handlers that are not currently blocked.

    Declaration

    Swift

    public func signalHandlersUnblockMatched(instance: ObjectProtocol, mask: SignalMatchType, signalID signal_id: CUnsignedInt, detail: GLib.Quark, closure: ClosureProtocol, func_: UnsafeMutableRawPointer, data: UnsafeMutableRawPointer) -> Int
  • Returns whether there are any handlers connected to instance for the given signal id and detail.

    If detail is 0 then it will only match handlers that were connected without detail. If detail is non-zero then it will match handlers connected both without detail and with the given detail. This is consistent with how a signal emitted with detail would be delivered to those handlers.

    Since 2.46 this also checks for a non-default class closure being installed, as this is basically always what you want.

    One example of when you might use this is when the arguments to the signal are difficult to compute. A class implementor may opt to not emit the signal if no one is attached anyway, thus saving the cost of building the arguments.

    Declaration

    Swift

    public func signalHasHandlerPending(instance: ObjectProtocol, signalID signal_id: CUnsignedInt, detail: GLib.Quark, mayBeBlocked may_be_blocked: Bool) -> Bool
  • Lists the signals by id that a certain instance or interface type created. Further information about the signals can be acquired through g_signal_query().

    Declaration

    Swift

    public func signalListIDs(itype: GType, nIDs n_ids: UnsafeMutablePointer<CUnsignedInt>) -> UnsafeMutablePointer<CUnsignedInt>!
  • Given the name of the signal and the type of object it connects to, gets the signal’s identifying integer. Emitting the signal by number is somewhat faster than using the name each time.

    Also tries the ancestors of the given type.

    The type class passed as itype must already have been instantiated (for example, using g_type_class_ref()) for this function to work, as signals are always installed during class initialization.

    See g_signal_new() for details on allowed signal names.

    Declaration

    Swift

    public func signalLookup(name: UnsafePointer<gchar>, itype: GType) -> Int
  • Given the signal’s identifier, finds its name.

    Two different signals may have the same name, if they have differing types.

    Declaration

    Swift

    public func signalName(signalID signal_id: CUnsignedInt) -> String!
  • Creates a new signal. (This is usually done in the class initializer.)

    See g_signal_new() for details on allowed signal names.

    If c_marshaller is nil, g_cclosure_marshal_generic() will be used as the marshaller for this signal.

    Declaration

    Swift

    public func signalNewValist(signalName signal_name: UnsafePointer<gchar>, itype: GType, signalFlags signal_flags: SignalFlags, classClosure class_closure: ClosureProtocol, accumulator: @escaping SignalAccumulator, accuData accu_data: UnsafeMutableRawPointer, cMarshaller c_marshaller: @escaping SignalCMarshaller, returnType return_type: GType, nParams n_params: CUnsignedInt, args: CVaListPointer) -> Int
  • Creates a new signal. (This is usually done in the class initializer.)

    See g_signal_new() for details on allowed signal names.

    If c_marshaller is nil, g_cclosure_marshal_generic() will be used as the marshaller for this signal.

    Declaration

    Swift

    public func signalNewv(signalName signal_name: UnsafePointer<gchar>, itype: GType, signalFlags signal_flags: SignalFlags, classClosure class_closure: ClosureProtocol, accumulator: @escaping SignalAccumulator, accuData accu_data: UnsafeMutableRawPointer, cMarshaller c_marshaller: @escaping SignalCMarshaller, returnType return_type: GType, nParams n_params: CUnsignedInt, paramTypes param_types: UnsafeMutablePointer<GType>) -> Int
  • Overrides the class closure (i.e. the default handler) for the given signal for emissions on instances of instance_type. instance_type must be derived from the type to which the signal belongs.

    See g_signal_chain_from_overridden() and g_signal_chain_from_overridden_handler() for how to chain up to the parent class closure from inside the overridden one.

    Declaration

    Swift

    public func signalOverrideClassClosure(signalID signal_id: CUnsignedInt, instanceType instance_type: GType, classClosure class_closure: ClosureProtocol)
  • Overrides the class closure (i.e. the default handler) for the given signal for emissions on instances of instance_type with callback class_handler. instance_type must be derived from the type to which the signal belongs.

    See g_signal_chain_from_overridden() and g_signal_chain_from_overridden_handler() for how to chain up to the parent class closure from inside the overridden one.

    Declaration

    Swift

    public func signalOverrideClassHandler(signalName signal_name: UnsafePointer<gchar>, instanceType instance_type: GType, classHandler class_handler: @escaping Callback)
  • Internal function to parse a signal name into its signal_id and detail quark.

    Declaration

    Swift

    public func signalParseName(detailedSignal detailed_signal: UnsafePointer<gchar>, itype: GType, signalIDP signal_id_p: UnsafeMutablePointer<CUnsignedInt>, detailP detail_p: UnsafeMutablePointer<GQuark>, forceDetailQuark force_detail_quark: Bool) -> Bool
  • Queries the signal system for in-depth information about a specific signal. This function will fill in a user-provided structure to hold signal-specific information. If an invalid signal id is passed in, the signal_id member of the GSignalQuery is 0. All members filled into the GSignalQuery structure should be considered constant and have to be left untouched.

    Declaration

    Swift

    public func signalQuery(signalID signal_id: CUnsignedInt, query: SignalQueryProtocol)
  • Deletes an emission hook.

    Declaration

    Swift

    public func signalRemoveEmissionHook(signalID signal_id: CUnsignedInt, hookID hook_id: CUnsignedLong)
  • Change the GSignalCVaMarshaller used for a given signal. This is a specialised form of the marshaller that can often be used for the common case of a single connected signal handler and avoids the overhead of GValue. Its use is optional.

    Declaration

    Swift

    public func signalSetVaMarshaller(signalID signal_id: CUnsignedInt, instanceType instance_type: GType, vaMarshaller va_marshaller: @escaping SignalCVaMarshaller)
  • Stops a signal’s current emission.

    This will prevent the default method from running, if the signal was G_SIGNAL_RUN_LAST and you connected normally (i.e. without the “after” flag).

    Prints a warning if used on a signal which isn’t being emitted.

    Declaration

    Swift

    public func signalStopEmission(instance: ObjectProtocol, signalID signal_id: CUnsignedInt, detail: GLib.Quark)
  • Stops a signal’s current emission.

    This is just like g_signal_stop_emission() except it will look up the signal id for you.

    Declaration

    Swift

    public func signalStopEmissionByName(instance: ObjectProtocol, detailedSignal detailed_signal: UnsafePointer<gchar>)
  • Creates a new closure which invokes the function found at the offset struct_offset in the class structure of the interface or classed type identified by itype.

    Declaration

    Swift

    public func signalTypeCclosureNew(itype: GType, structOffset struct_offset: CUnsignedInt) -> UnsafeMutablePointer<GClosure>!
  • Set the callback for a source as a GClosure.

    If the source is not one of the standard GLib types, the closure_callback and closure_marshal fields of the GSourceFuncs structure must have been filled in with pointers to appropriate functions.

    Declaration

    Swift

    public func sourceSetClosure(source: SourceProtocol, closure: ClosureProtocol)
  • Sets a dummy callback for source. The callback will do nothing, and if the source expects a gboolean return value, it will return true. (If the source expects any other type of return value, it will return a 0/nil value; whatever g_value_init() initializes a GValue to for that type.)

    If the source is not one of the standard GLib types, the closure_callback and closure_marshal fields of the GSourceFuncs structure must have been filled in with pointers to appropriate functions.

    Declaration

    Swift

    public func sourceSetDummyCallback(source: SourceProtocol)
  • Return a newly allocated string, which describes the contents of a GValue. The main purpose of this function is to describe GValue contents for debugging output, the way in which the contents are described may change between different GLib versions.

    Declaration

    Swift

    public func strdupValueContents(value: ValueProtocol) -> String!
  • Adds a GTypeClassCacheFunc to be called before the reference count of a class goes from one to zero. This can be used to prevent premature class destruction. All installed GTypeClassCacheFunc functions will be chained until one of them returns true. The functions have to check the class id passed in to figure whether they actually want to cache the class of this type, since all classes are routed through the same GTypeClassCacheFunc chain.

    Declaration

    Swift

    public func typeAddClassCacheFunc(cacheData cache_data: UnsafeMutableRawPointer, cacheFunc cache_func: @escaping TypeClassCacheFunc)
  • Registers a private class structure for a classed type; when the class is allocated, the private structures for the class and all of its parent types are allocated sequentially in the same memory block as the public structures, and are zero-filled.

    This function should be called in the type’s get_type() function after the type is registered. The private structure can be retrieved using the G_TYPE_CLASS_GET_PRIVATE() macro.

    Declaration

    Swift

    public func typeAddClassPrivate(classType class_type: GType, privateSize private_size: Int)
  • Undocumented

    Declaration

    Swift

    public func typeAddInstancePrivate(classType class_type: GType, privateSize private_size: Int) -> Int
  • Adds a function to be called after an interface vtable is initialized for any class (i.e. after the interface_init member of GInterfaceInfo has been called).

    This function is useful when you want to check an invariant that depends on the interfaces of a class. For instance, the implementation of GObject uses this facility to check that an object implements all of the properties that are defined on its interfaces.

    Declaration

    Swift

    public func typeAddInterfaceCheck(checkData check_data: UnsafeMutableRawPointer, checkFunc check_func: @escaping TypeInterfaceCheckFunc)
  • Adds interface_type to the dynamic instantiable_type. The information contained in the GTypePlugin structure pointed to by plugin is used to manage the relationship.

    Declaration

    Swift

    public func typeAddInterfaceDynamic(instanceType instance_type: GType, interfaceType interface_type: GType, plugin: TypePluginProtocol)
  • Adds interface_type to the static instantiable_type. The information contained in the GInterfaceInfo structure pointed to by info is used to manage the relationship.

    Declaration

    Swift

    public func typeAddInterfaceStatic(instanceType instance_type: GType, interfaceType interface_type: GType, info: InterfaceInfoProtocol)
  • Undocumented

    Declaration

    Swift

    public func typeCheckClassCast(gClass g_class: TypeClassProtocol, isAType is_a_type: GType) -> UnsafeMutablePointer<GTypeClass>!
  • Undocumented

    Declaration

    Swift

    public func typeCheckClassIsA(gClass g_class: TypeClassProtocol, isAType is_a_type: GType) -> Bool
  • Private helper function to aid implementation of the G_TYPE_CHECK_INSTANCE() macro.

    Declaration

    Swift

    public func typeCheck(instance: TypeInstanceProtocol) -> Bool
  • Undocumented

    Declaration

    Swift

    public func typeCheckInstanceCast(instance: TypeInstanceProtocol, ifaceType iface_type: GType) -> UnsafeMutablePointer<GTypeInstance>!
  • Undocumented

    Declaration

    Swift

    public func typeCheckInstanceIsA(instance: TypeInstanceProtocol, ifaceType iface_type: GType) -> Bool
  • Undocumented

    Declaration

    Swift

    public func typeCheckInstanceIsFundamentallyA(instance: TypeInstanceProtocol, fundamentalType fundamental_type: GType) -> Bool
  • Undocumented

    Declaration

    Swift

    public func typeCheckIsValue(type: GType) -> Bool
  • Undocumented

    Declaration

    Swift

    public func typeCheck(value: ValueProtocol) -> Bool
  • Undocumented

    Declaration

    Swift

    public func typeCheckValueHolds(value: ValueProtocol, type: GType) -> Bool
  • Return a newly allocated and 0-terminated array of type IDs, listing the child types of type.

    Declaration

    Swift

    public func typeChildren(type: GType, nChildren n_children: UnsafeMutablePointer<CUnsignedInt>) -> UnsafeMutablePointer<GType>!
  • Undocumented

    Declaration

    Swift

    public func typeClassAdjustPrivateOffset(gClass g_class: UnsafeMutableRawPointer, privateSizeOrOffset private_size_or_offset: UnsafeMutablePointer<CInt>)
  • This function is essentially the same as g_type_class_ref(), except that the classes reference count isn’t incremented. As a consequence, this function may return nil if the class of the type passed in does not currently exist (hasn’t been referenced before).

    Declaration

    Swift

    public func typeClassPeek(type: GType) -> UnsafeMutableRawPointer!
  • A more efficient version of g_type_class_peek() which works only for static types.

    Declaration

    Swift

    public func typeClassPeekStatic(type: GType) -> UnsafeMutableRawPointer!
  • Increments the reference count of the class structure belonging to type. This function will demand-create the class if it doesn’t exist already.

    Declaration

    Swift

    public func typeClassRef(type: GType) -> UnsafeMutableRawPointer!
  • Creates and initializes an instance of type if type is valid and can be instantiated. The type system only performs basic allocation and structure setups for instances: actual instance creation should happen through functions supplied by the type’s fundamental type implementation. So use of g_type_create_instance() is reserved for implementators of fundamental types only. E.g. instances of the GObject hierarchy should be created via g_object_new() and never directly through g_type_create_instance() which doesn’t handle things like singleton objects or object construction.

    The extended members of the returned instance are guaranteed to be filled with zeros.

    Note: Do not use this function, unless you’re implementing a fundamental type. Also language bindings should not use this function, but g_object_new() instead.

    Declaration

    Swift

    public func typeCreateInstance(type: GType) -> UnsafeMutablePointer<GTypeInstance>!
  • If the interface type g_type is currently in use, returns its default interface vtable.

    Declaration

    Swift

    public func typeDefaultInterfacePeek(gType g_type: GType) -> UnsafeMutableRawPointer!
  • Increments the reference count for the interface type g_type, and returns the default interface vtable for the type.

    If the type is not currently in use, then the default vtable for the type will be created and initalized by calling the base interface init and default vtable init functions for the type (the base_init and class_init members of GTypeInfo). Calling g_type_default_interface_ref() is useful when you want to make sure that signals and properties for an interface have been installed.

    Declaration

    Swift

    public func typeDefaultInterfaceRef(gType g_type: GType) -> UnsafeMutableRawPointer!
  • Decrements the reference count for the type corresponding to the interface default vtable g_iface. If the type is dynamic, then when no one is using the interface and all references have been released, the finalize function for the interface’s default vtable (the class_finalize member of GTypeInfo) will be called.

    Declaration

    Swift

    public func typeDefaultInterfaceUnref(gIface g_iface: TypeInterfaceProtocol)
  • Returns the length of the ancestry of the passed in type. This includes the type itself, so that e.g. a fundamental type has depth 1.

    Declaration

    Swift

    public func typeDepth(type: GType) -> Int
  • Ensures that the indicated type has been registered with the type system, and its _class_init() method has been run.

    In theory, simply calling the type’s _get_type() method (or using the corresponding macro) is supposed take care of this. However, _get_type() methods are often marked G_GNUC_CONST for performance reasons, even though this is technically incorrect (since G_GNUC_CONST requires that the function not have side effects, which _get_type() methods do on the first call). As a result, if you write a bare call to a _get_type() macro, it may get optimized out by the compiler. Using g_type_ensure() guarantees that the type’s _get_type() method is called.

    Declaration

    Swift

    public func typeEnsure(type: GType)
  • Frees an instance of a type, returning it to the instance pool for the type, if there is one.

    Like g_type_create_instance(), this function is reserved for implementors of fundamental types.

    Declaration

    Swift

    public func typeFree(instance: TypeInstanceProtocol)
  • Look up the type ID from a given type name, returning 0 if no type has been registered under this name (this is the preferred method to find out by name whether a specific type has been registered yet).

    Declaration

    Swift

    public func typeFrom(name: UnsafePointer<gchar>) -> GType
  • Internal function, used to extract the fundamental type ID portion. Use G_TYPE_FUNDAMENTAL() instead.

    Declaration

    Swift

    public func typeFundamental(typeID type_id: GType) -> GType
  • Returns the next free fundamental type id which can be used to register a new fundamental type with g_type_register_fundamental(). The returned type ID represents the highest currently registered fundamental type identifier.

    Declaration

    Swift

    public func typeFundamentalNext() -> GType
  • Returns the number of instances allocated of the particular type; this is only available if GLib is built with debugging support and the instance_count debug flag is set (by setting the GOBJECT_DEBUG variable to include instance-count).

    Declaration

    Swift

    public func typeGetInstanceCount(type: GType) -> Int
  • Returns the GTypePlugin structure for type.

    Declaration

    Swift

    public func typeGetPlugin(type: GType) -> UnsafeMutablePointer<GTypePlugin>!
  • Obtains data which has previously been attached to type with g_type_set_qdata().

    Note that this does not take subtyping into account; data attached to one type with g_type_set_qdata() cannot be retrieved from a subtype using g_type_get_qdata().

    Declaration

    Swift

    public func typeGetQdata(type: GType, quark: GLib.Quark) -> UnsafeMutableRawPointer!
  • Returns an opaque serial number that represents the state of the set of registered types. Any time a type is registered this serial changes, which means you can cache information based on type lookups (such as g_type_from_name()) and know if the cache is still valid at a later time by comparing the current serial with the one at the type lookup.

    Declaration

    Swift

    public func typeGetTypeRegistrationSerial() -> Int
  • This function used to initialise the type system. Since GLib 2.36, the type system is initialised automatically and this function does nothing.

    type_init is deprecated: the type system is now initialised automatically

    Declaration

    Swift

    @available(*, deprecated)
    public func typeInit()
  • This function used to initialise the type system with debugging flags. Since GLib 2.36, the type system is initialised automatically and this function does nothing.

    If you need to enable debugging features, use the GOBJECT_DEBUG environment variable.

    type_init_with_debug_flags is deprecated: the type system is now initialised automatically

    Declaration

    Swift

    @available(*, deprecated)
    public func typeInitWith(debugFlags debug_flags: TypeDebugFlags)
  • Adds prerequisite_type to the list of prerequisites of interface_type. This means that any type implementing interface_type must also implement prerequisite_type. Prerequisites can be thought of as an alternative to interface derivation (which GType doesn’t support). An interface can have at most one instantiatable prerequisite type.

    Declaration

    Swift

    public func typeInterfaceAddPrerequisite(interfaceType interface_type: GType, prerequisiteType prerequisite_type: GType)
  • Returns the GTypePlugin structure for the dynamic interface interface_type which has been added to instance_type, or nil if interface_type has not been added to instance_type or does not have a GTypePlugin structure. See g_type_add_interface_dynamic().

    Declaration

    Swift

    public func typeInterfaceGetPlugin(instanceType instance_type: GType, interfaceType interface_type: GType) -> UnsafeMutablePointer<GTypePlugin>!
  • Returns the GTypeInterface structure of an interface to which the passed in class conforms.

    Declaration

    Swift

    public func typeInterfacePeek(instanceClass instance_class: TypeClassProtocol, ifaceType iface_type: GType) -> UnsafeMutableRawPointer!
  • Returns the prerequisites of an interfaces type.

    Declaration

    Swift

    public func typeInterfacePrerequisites(interfaceType interface_type: GType, nPrerequisites n_prerequisites: UnsafeMutablePointer<CUnsignedInt>) -> UnsafeMutablePointer<GType>!
  • Return a newly allocated and 0-terminated array of type IDs, listing the interface types that type conforms to.

    Declaration

    Swift

    public func typeInterfaces(type: GType, nInterfaces n_interfaces: UnsafeMutablePointer<CUnsignedInt>) -> UnsafeMutablePointer<GType>!
  • If is_a_type is a derivable type, check whether type is a descendant of is_a_type. If is_a_type is an interface, check whether type conforms to it.

    Declaration

    Swift

    public func typeIsA(type: GType, isAType is_a_type: GType) -> Bool
  • Get the unique name that is assigned to a type ID. Note that this function (like all other GType API) cannot cope with invalid type IDs. G_TYPE_INVALID may be passed to this function, as may be any other validly registered type ID, but randomized type IDs should not be passed in and will most likely lead to a crash.

    Declaration

    Swift

    public func typeName(type: GType) -> String!
  • Undocumented

    Declaration

    Swift

    public func typeNameFromClass(gClass g_class: TypeClassProtocol) -> String!
  • Undocumented

    Declaration

    Swift

    public func typeNameFrom(instance: TypeInstanceProtocol) -> String!
  • Given a leaf_type and a root_type which is contained in its anchestry, return the type that root_type is the immediate parent of. In other words, this function determines the type that is derived directly from root_type which is also a base class of leaf_type. Given a root type and a leaf type, this function can be used to determine the types and order in which the leaf type is descended from the root type.

    Declaration

    Swift

    public func typeNextBase(leafType leaf_type: GType, rootType root_type: GType) -> GType
  • Return the direct parent type of the passed in type. If the passed in type has no parent, i.e. is a fundamental type, 0 is returned.

    Declaration

    Swift

    public func typeParent(type: GType) -> GType
  • Get the corresponding quark of the type IDs name.

    Declaration

    Swift

    public func typeQname(type: GType) -> GQuark
  • Queries the type system for information about a specific type. This function will fill in a user-provided structure to hold type-specific information. If an invalid GType is passed in, the type member of the GTypeQuery is 0. All members filled into the GTypeQuery structure should be considered constant and have to be left untouched.

    Declaration

    Swift

    public func typeQuery(type: GType, query: TypeQueryProtocol)
  • Registers type_name as the name of a new dynamic type derived from parent_type. The type system uses the information contained in the GTypePlugin structure pointed to by plugin to manage the type and its instances (if not abstract). The value of flags determines the nature (e.g. abstract or not) of the type.

    Declaration

    Swift

    public func typeRegisterDynamic(parentType parent_type: GType, typeName type_name: UnsafePointer<gchar>, plugin: TypePluginProtocol, flags: TypeFlags) -> GType
  • Registers type_id as the predefined identifier and type_name as the name of a fundamental type. If type_id is already registered, or a type named type_name is already registered, the behaviour is undefined. The type system uses the information contained in the GTypeInfo structure pointed to by info and the GTypeFundamentalInfo structure pointed to by finfo to manage the type and its instances. The value of flags determines additional characteristics of the fundamental type.

    Declaration

    Swift

    public func typeRegisterFundamental(typeID type_id: GType, typeName type_name: UnsafePointer<gchar>, info: TypeInfoProtocol, finfo: TypeFundamentalInfoProtocol, flags: TypeFlags) -> GType
  • Registers type_name as the name of a new static type derived from parent_type. The type system uses the information contained in the GTypeInfo structure pointed to by info to manage the type and its instances (if not abstract). The value of flags determines the nature (e.g. abstract or not) of the type.

    Declaration

    Swift

    public func typeRegisterStatic(parentType parent_type: GType, typeName type_name: UnsafePointer<gchar>, info: TypeInfoProtocol, flags: TypeFlags) -> GType
  • Registers type_name as the name of a new static type derived from parent_type. The value of flags determines the nature (e.g. abstract or not) of the type. It works by filling a GTypeInfo struct and calling g_type_register_static().

    Declaration

    Swift

    public func typeRegisterStaticSimple(parentType parent_type: GType, typeName type_name: UnsafePointer<gchar>, classSize class_size: CUnsignedInt, classInit class_init: @escaping ClassInitFunc, instanceSize instance_size: CUnsignedInt, instanceInit instance_init: @escaping InstanceInitFunc, flags: TypeFlags) -> GType
  • Removes a previously installed GTypeClassCacheFunc. The cache maintained by cache_func has to be empty when calling g_type_remove_class_cache_func() to avoid leaks.

    Declaration

    Swift

    public func typeRemoveClassCacheFunc(cacheData cache_data: UnsafeMutableRawPointer, cacheFunc cache_func: @escaping TypeClassCacheFunc)
  • Removes an interface check function added with g_type_add_interface_check().

    Declaration

    Swift

    public func typeRemoveInterfaceCheck(checkData check_data: UnsafeMutableRawPointer, checkFunc check_func: @escaping TypeInterfaceCheckFunc)
  • Attaches arbitrary data to a type.

    Declaration

    Swift

    public func typeSetQdata(type: GType, quark: GLib.Quark, data: UnsafeMutableRawPointer)
  • Undocumented

    Declaration

    Swift

    public func typeTestFlags(type: GType, flags: CUnsignedInt) -> Bool
  • Returns the location of the GTypeValueTable associated with type.

    Note that this function should only be used from source code that implements or has internal knowledge of the implementation of type.

    Declaration

    Swift

    public func typeValueTablePeek(type: GType) -> UnsafeMutablePointer<GTypeValueTable>!
  • Registers a value transformation function for use in g_value_transform(). A previously registered transformation function for src_type and dest_type will be replaced.

    Declaration

    Swift

    public func valueRegisterTransformFunc(srcType src_type: GType, destType dest_type: GType, transformFunc transform_func: @escaping ValueTransform)
  • Returns whether a GValue of type src_type can be copied into a GValue of type dest_type.

    Declaration

    Swift

    public func valueTypeCompatible(srcType src_type: GType, destType dest_type: GType) -> Bool
  • Check whether g_value_transform() is able to transform values of type src_type into values of type dest_type. Note that for the types to be transformable, they must be compatible or a transformation function must be registered.

    Declaration

    Swift

    public func valueTypeTransformable(srcType src_type: GType, destType dest_type: GType) -> Bool