gobject.global

Global functions for gobject2 library

fn boxedCopy boxedFree clearSignalHandler enumGetValue enumGetValueByName enumGetValueByNick enumRegisterStatic enumToString flagsGetFirstValue flagsGetValueByName flagsGetValueByNick flagsRegisterStatic flagsToString gtypeGetType paramSpecBoolean paramSpecBoxed paramSpecChar paramSpecDouble paramSpecEnum paramSpecFlags paramSpecFloat paramSpecGtype paramSpecInt paramSpecInt64 paramSpecLong paramSpecObject paramSpecParam paramSpecPointer paramSpecString paramSpecUchar paramSpecUint paramSpecUint64 paramSpecUlong paramSpecUnichar paramSpecVariant paramTypeRegisterStatic paramValueConvert paramValueDefaults paramValueIsValid paramValuesCmp paramValueSetDefault paramValueValidate pointerTypeRegisterStatic setClosure setDummyCallback signalAccumulatorFirstWins signalAccumulatorTrueHandled signalAddEmissionHook signalConnectClosure signalConnectClosureById signalGetInvocationHint signalHandlerBlock signalHandlerDisconnect signalHandlerFind signalHandlerIsConnected signalHandlersBlockMatched signalHandlersDestroy signalHandlersDisconnectMatched signalHandlersUnblockMatched signalHandlerUnblock signalHasHandlerPending signalIsValidName signalListIds signalLookup signalName signalNewv signalOverrideClassClosure signalParseName signalQuery signalRemoveEmissionHook signalStopEmission signalStopEmissionByName signalTypeCclosureNew strdupValueContents typeAddClassPrivate typeAddInstancePrivate typeCheckInstance typeCheckInstanceIsA typeCheckInstanceIsFundamentallyA typeCheckIsValueType typeCheckValue typeCheckValueHolds typeChildren typeDepth typeEnsure typeFreeInstance typeFromName typeFundamental typeFundamentalNext typeGetInstanceCount typeGetQdata typeGetTypeRegistrationSerial typeInit typeInitWithDebugFlags typeInterfaces typeIsA typeName typeNameFromInstance typeNextBase typeParent typeQname typeQuery typeSetQdata typeTestFlags

Functions 104

fnvoid signalHandlerDisconnect(gobject.object.ObjectWrap instance, gulong handlerId)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 re...
fnvoid signalHandlersDestroy(gobject.object.ObjectWrap instance)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.
fnvoid setClosure(glib.source.Source source, gobject.closure.Closure closure)Set the callback for a source as a #GClosure.
fnvoid setDummyCallback(glib.source.Source source)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 wi...
fnvoid * boxedCopy(gobject.types.GType boxedType, const(void) * srcBoxed)Provide a copy of a boxed structure srcboxed which is of type boxedtype.
fnvoid boxedFree(gobject.types.GType boxedType, void * boxed)Free the boxed structure boxed which is of type boxed_type.
fnvoid clearSignalHandler(ref gulong handlerIdPtr, gobject.object.ObjectWrap instance)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 handleridptr is then set to zero, which is ...
fngobject.enum_value.EnumValue enumGetValue(gobject.enum_class.EnumClass enumClass, int value)Returns the #GEnumValue for a value.
fngobject.enum_value.EnumValue enumGetValueByName(gobject.enum_class.EnumClass enumClass, string name)Looks up a #GEnumValue by name.
fngobject.enum_value.EnumValue enumGetValueByNick(gobject.enum_class.EnumClass enumClass, string nick)Looks up a #GEnumValue by nickname.
fngobject.types.GType enumRegisterStatic(string name, gobject.enum_value.EnumValue constStaticValues)Registers a new static enumeration type with the name name.
fnstring enumToString(gobject.types.GType gEnumType, int value)Pretty-prints value in the form of the enum’s name.
fngobject.flags_value.FlagsValue flagsGetFirstValue(gobject.flags_class.FlagsClass flagsClass, uint value)Returns the first #GFlagsValue which is set in value.
fngobject.flags_value.FlagsValue flagsGetValueByName(gobject.flags_class.FlagsClass flagsClass, string name)Looks up a #GFlagsValue by name.
fngobject.flags_value.FlagsValue flagsGetValueByNick(gobject.flags_class.FlagsClass flagsClass, string nick)Looks up a #GFlagsValue by nickname.
fngobject.types.GType flagsRegisterStatic(string name, gobject.flags_value.FlagsValue constStaticValues)Registers a new static flags type with the name name.
fnstring flagsToString(gobject.types.GType flagsType, uint value)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.
fngobject.param_spec.ParamSpec paramSpecBoolean(string name, string nick, string blurb, bool defaultValue, gobject.types.ParamFlags flags)Creates a new #GParamSpecBoolean instance specifying a `GTYPEBOOLEAN` property. In many cases, it may be more appropriate to use an enum with [gobject.global.paramSpecEnum], both to improve code cl...
fngobject.param_spec.ParamSpec paramSpecBoxed(string name, string nick, string blurb, gobject.types.GType boxedType, gobject.types.ParamFlags flags)Creates a new #GParamSpecBoxed instance specifying a `GTYPEBOXED` derived property.
fngobject.param_spec.ParamSpec paramSpecChar(string name, string nick, string blurb, byte minimum, byte maximum, byte defaultValue, gobject.types.ParamFlags flags)Creates a new #GParamSpecChar instance specifying a `GTYPECHAR` property.
fngobject.param_spec.ParamSpec paramSpecDouble(string name, string nick, string blurb, double minimum, double maximum, double defaultValue, gobject.types.ParamFlags flags)Creates a new #GParamSpecDouble instance specifying a `GTYPEDOUBLE` property.
fngobject.param_spec.ParamSpec paramSpecEnum(string name, string nick, string blurb, gobject.types.GType enumType, int defaultValue, gobject.types.ParamFlags flags)Creates a new #GParamSpecEnum instance specifying a `GTYPEENUM` property.
fngobject.param_spec.ParamSpec paramSpecFlags(string name, string nick, string blurb, gobject.types.GType flagsType, uint defaultValue, gobject.types.ParamFlags flags)Creates a new #GParamSpecFlags instance specifying a `GTYPEFLAGS` property.
fngobject.param_spec.ParamSpec paramSpecFloat(string name, string nick, string blurb, float minimum, float maximum, float defaultValue, gobject.types.ParamFlags flags)Creates a new #GParamSpecFloat instance specifying a `GTYPEFLOAT` property.
fngobject.param_spec.ParamSpec paramSpecGtype(string name, string nick, string blurb, gobject.types.GType isAType, gobject.types.ParamFlags flags)Creates a new #GParamSpecGType instance specifying a `GTYPEGTYPE` property.
fngobject.param_spec.ParamSpec paramSpecInt(string name, string nick, string blurb, int minimum, int maximum, int defaultValue, gobject.types.ParamFlags flags)Creates a new #GParamSpecInt instance specifying a `GTYPEINT` property.
fngobject.param_spec.ParamSpec paramSpecInt64(string name, string nick, string blurb, long minimum, long maximum, long defaultValue, gobject.types.ParamFlags flags)Creates a new #GParamSpecInt64 instance specifying a `GTYPEINT64` property.
fngobject.param_spec.ParamSpec paramSpecLong(string name, string nick, string blurb, glong minimum, glong maximum, glong defaultValue, gobject.types.ParamFlags flags)Creates a new #GParamSpecLong instance specifying a `GTYPELONG` property.
fngobject.param_spec.ParamSpec paramSpecObject(string name, string nick, string blurb, gobject.types.GType objectType, gobject.types.ParamFlags flags)Creates a new #GParamSpecBoxed instance specifying a `GTYPEOBJECT` derived property.
fngobject.param_spec.ParamSpec paramSpecParam(string name, string nick, string blurb, gobject.types.GType paramType, gobject.types.ParamFlags flags)Creates a new #GParamSpecParam instance specifying a `GTYPEPARAM` property.
fngobject.param_spec.ParamSpec paramSpecPointer(string name, string nick, string blurb, gobject.types.ParamFlags flags)Creates a new #GParamSpecPointer instance specifying a pointer property. Where possible, it is better to use [gobject.global.paramSpecObject] or [gobject.global.paramSpecBoxed] to expose memory man...
fngobject.param_spec.ParamSpec paramSpecString(string name, string nick, string blurb, string defaultValue, gobject.types.ParamFlags flags)Creates a new #GParamSpecString instance.
fngobject.param_spec.ParamSpec paramSpecUchar(string name, string nick, string blurb, ubyte minimum, ubyte maximum, ubyte defaultValue, gobject.types.ParamFlags flags)Creates a new #GParamSpecUChar instance specifying a `GTYPEUCHAR` property.
fngobject.param_spec.ParamSpec paramSpecUint(string name, string nick, string blurb, uint minimum, uint maximum, uint defaultValue, gobject.types.ParamFlags flags)Creates a new #GParamSpecUInt instance specifying a `GTYPEUINT` property.
fngobject.param_spec.ParamSpec paramSpecUint64(string name, string nick, string blurb, ulong minimum, ulong maximum, ulong defaultValue, gobject.types.ParamFlags flags)Creates a new #GParamSpecUInt64 instance specifying a `GTYPEUINT64` property.
fngobject.param_spec.ParamSpec paramSpecUlong(string name, string nick, string blurb, gulong minimum, gulong maximum, gulong defaultValue, gobject.types.ParamFlags flags)Creates a new #GParamSpecULong instance specifying a `GTYPEULONG` property.
fngobject.param_spec.ParamSpec paramSpecUnichar(string name, string nick, string blurb, dchar defaultValue, gobject.types.ParamFlags flags)Creates a new #GParamSpecUnichar instance specifying a `GTYPEUINT` property. #GValue structures for this property can be accessed with [gobject.value.Value.setUint] and [gobject.value.Value.getUint].
fngobject.param_spec.ParamSpec paramSpecVariant(string name, string nick, string blurb, glib.variant_type.VariantType type, glib.variant.Variant defaultValue, gobject.types.ParamFlags flags)Creates a new #GParamSpecVariant instance specifying a #GVariant property.
fngobject.types.GType paramTypeRegisterStatic(string name, gobject.types.ParamSpecTypeInfo pspecInfo)Registers name as the name of a new static type derived from `GTYPEPARAM`.
fnbool paramValueConvert(gobject.param_spec.ParamSpec pspec, gobject.value.Value srcValue, gobject.value.Value destValue, bool strictValidation)Transforms srcvalue into destvalue if possible, and then validates destvalue, in order for it to conform to pspec. If strictvalidation is true this function will only succeed if the transformed de...
fnbool paramValueDefaults(gobject.param_spec.ParamSpec pspec, gobject.value.Value value)Checks whether value contains the default value as specified in pspec.
fnbool paramValueIsValid(gobject.param_spec.ParamSpec pspec, gobject.value.Value value)Return whether the contents of value comply with the specifications set out by pspec.
fnvoid paramValueSetDefault(gobject.param_spec.ParamSpec pspec, gobject.value.Value value)Sets value to its default value as specified in pspec.
fnbool paramValueValidate(gobject.param_spec.ParamSpec pspec, gobject.value.Value value)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 ...
fnint paramValuesCmp(gobject.param_spec.ParamSpec pspec, gobject.value.Value value1, gobject.value.Value value2)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.
fngobject.types.GType pointerTypeRegisterStatic(string name)Creates a new `GTYPEPOINTER` derived type id for a new pointer type with name name.
fnbool signalAccumulatorFirstWins(gobject.types.SignalInvocationHint ihint, gobject.value.Value returnAccu, gobject.value.Value handlerReturn, void * dummy = null)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 ...
fnbool signalAccumulatorTrueHandled(gobject.types.SignalInvocationHint ihint, gobject.value.Value returnAccu, gobject.value.Value handlerReturn, void * dummy = null)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 ...
fngulong signalAddEmissionHook(uint signalId, glib.types.Quark detail, gobject.types.SignalEmissionHook hookFunc)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 `GSIGNALNO_HOOKS` flag set.
fngulong signalConnectClosure(gobject.object.ObjectWrap instance, string detailedSignal, gobject.closure.Closure closure, bool after)Connects a closure to a signal for a particular object.
fngulong signalConnectClosureById(gobject.object.ObjectWrap instance, uint signalId, glib.types.Quark detail, gobject.closure.Closure closure, bool after)Connects a closure to a signal for a particular object.
fngobject.types.SignalInvocationHint signalGetInvocationHint(gobject.object.ObjectWrap instance)Returns the invocation hint of the innermost signal emission of instance.
fnvoid signalHandlerBlock(gobject.object.ObjectWrap instance, gulong handlerId)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 deactivate it, a signal hand...
fngulong signalHandlerFind(gobject.object.ObjectWrap instance, gobject.types.SignalMatchType mask, uint signalId, glib.types.Quark detail, gobject.closure.Closure closure = null, void * func = null)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 argumen...
fnbool signalHandlerIsConnected(gobject.object.ObjectWrap instance, gulong handlerId)Returns whether handler_id is the ID of a handler connected to instance.
fnvoid signalHandlerUnblock(gobject.object.ObjectWrap instance, gulong handlerId)Undoes the effect of a previous [gobject.global.signalHandlerBlock] call. A blocked handler is skipped during signal emissions and will not be invoked, unblocking it (for exactly the amount of tim...
fnuint signalHandlersBlockMatched(gobject.object.ObjectWrap instance, gobject.types.SignalMatchType mask, uint signalId, glib.types.Quark detail, gobject.closure.Closure closure = null, void * func = null)Blocks all handlers on an instance that match a certain selection criteria.
fnuint signalHandlersDisconnectMatched(gobject.object.ObjectWrap instance, gobject.types.SignalMatchType mask, uint signalId, glib.types.Quark detail, gobject.closure.Closure closure = null, void * func = null)Disconnects all handlers on an instance that match a certain selection criteria.
fnuint signalHandlersUnblockMatched(gobject.object.ObjectWrap instance, gobject.types.SignalMatchType mask, uint signalId, glib.types.Quark detail, gobject.closure.Closure closure = null, void * func = null)Unblocks all handlers on an instance that match a certain selection criteria.
fnbool signalHasHandlerPending(gobject.object.ObjectWrap instance, uint signalId, glib.types.Quark detail, bool mayBeBlocked)Returns whether there are any handlers connected to instance for the given signal id and detail.
fnbool signalIsValidName(string name)Validate a signal name. This can be useful for dynamically-generated signals which need to be validated at run-time before actually trying to create them.
fnuint[] signalListIds(gobject.types.GType itype)Lists the signals by id that a certain instance or interface type created. Further information about the signals can be acquired through [gobject.global.signalQuery].
fnuint signalLookup(string name, gobject.types.GType itype)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.
fnstring signalName(uint signalId)Given the signal's identifier, finds its name.
fnuint signalNewv(string signalName, gobject.types.GType itype, gobject.types.SignalFlags signalFlags, gobject.closure.Closure classClosure, gobject.types.SignalAccumulator accumulator, gobject.types.SignalCMarshaller cMarshaller, gobject.types.GType returnType, gobject.types.GType[] paramTypes = null)Creates a new signal. (This is usually done in the class initializer.)
fnvoid signalOverrideClassClosure(uint signalId, gobject.types.GType instanceType, gobject.closure.Closure classClosure)Overrides the class closure (i.e. the default handler) for the given signal for emissions on instances of instancetype. instancetype must be derived from the type to which the signal belongs.
fnbool signalParseName(string detailedSignal, gobject.types.GType itype, out uint signalIdP, out glib.types.Quark detailP, bool forceDetailQuark)Internal function to parse a signal name into its signal_id and detail quark.
fnvoid signalQuery(uint signalId, out gobject.signal_query.SignalQuery query)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 pass...
fnvoid signalRemoveEmissionHook(uint signalId, gulong hookId)Deletes an emission hook.
fnvoid signalStopEmission(gobject.object.ObjectWrap instance, uint signalId, glib.types.Quark detail)Stops a signal's current emission.
fnvoid signalStopEmissionByName(gobject.object.ObjectWrap instance, string detailedSignal)Stops a signal's current emission.
fngobject.closure.Closure signalTypeCclosureNew(gobject.types.GType itype, uint structOffset)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.
fnstring strdupValueContents(gobject.value.Value value)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 ar...
fnvoid typeAddClassPrivate(gobject.types.GType classType, size_t privateSize)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 b...
fnint typeAddInstancePrivate(gobject.types.GType classType, size_t privateSize)
fnbool typeCheckInstance(gobject.type_instance.TypeInstance instance)Private helper function to aid implementation of the GTYPECHECK_INSTANCE() macro.
fngobject.types.GType[] typeChildren(gobject.types.GType type)Return a newly allocated and 0-terminated array of type IDs, listing the child types of type.
fnuint typeDepth(gobject.types.GType type)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.
fnvoid typeEnsure(gobject.types.GType type)Ensures that the indicated type has been registered with the type system, and its classinit() method has been run.
fnvoid typeFreeInstance(gobject.type_instance.TypeInstance instance)Frees an instance of a type, returning it to the instance pool for the type, if there is one.
fngobject.types.GType typeFromName(string name)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 ...
fngobject.types.GType typeFundamental(gobject.types.GType typeId)Internal function, used to extract the fundamental type ID portion. Use GTYPEFUNDAMENTAL() instead.
fngobject.types.GType typeFundamentalNext()Returns the next free fundamental type id which can be used to register a new fundamental type with [gobject.global.typeRegisterFundamental]. The returned type ID represents the highest currently r...
fnint typeGetInstanceCount(gobject.types.GType type)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_...
fnvoid * typeGetQdata(gobject.types.GType type, glib.types.Quark quark)Obtains data which has previously been attached to type with [gobject.global.typeSetQdata].
fnuint typeGetTypeRegistrationSerial()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 look...
fnvoid typeInit()This function used to initialise the type system. Since GLib 2.36, the type system is initialised automatically and this function does nothing.
fnvoid typeInitWithDebugFlags(gobject.types.TypeDebugFlags debugFlags)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.
fngobject.types.GType[] typeInterfaces(gobject.types.GType type)Return a newly allocated and 0-terminated array of type IDs, listing the interface types that type conforms to.
fnbool typeIsA(gobject.types.GType type, gobject.types.GType isAType)If isatype is a derivable type, check whether type is a descendant of isatype. If isatype is an interface, check whether type conforms to it.
fnstring typeName(gobject.types.GType type)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. `GTYPEINVALID` may be passed to this function, as may be an...
fngobject.types.GType typeNextBase(gobject.types.GType leafType, gobject.types.GType rootType)Given a leaftype and a roottype which is contained in its ancestry, return the type that roottype is the immediate parent of. In other words, this function determines the type that is derived direc...
fngobject.types.GType typeParent(gobject.types.GType type)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.
fnglib.types.Quark typeQname(gobject.types.GType type)Get the corresponding quark of the type IDs name.
fnvoid typeQuery(gobject.types.GType type, out gobject.type_query.TypeQuery query)Queries the type system for information about a specific type.
fnvoid typeSetQdata(gobject.types.GType type, glib.types.Quark quark, void * data = null)Attaches arbitrary data to a type.
fnbool typeTestFlags(gobject.types.GType type, uint flags)