Class GObjects
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMask containing the bits ofGParamSpec.flags which are reserved for GLib.static final intGParamFlagsvalue alias forParamFlags.STATIC_NAME|ParamFlags.STATIC_NICK|ParamFlags.STATIC_BLURB.static final intMinimum shift count to be used for user defined flags, to be stored inGParamSpec.flags.static final intA mask for allGSignalFlagsbits.static final intA mask for allGSignalMatchTypebits.static final longA bit in the type number that's supposed to be left untouched.static final intAn integer constant that represents the number of identifiers reserved for types that are assigned at compile-time.static final intShift value used in converting numbers to type IDs.static final intFirst fundamental type number to create a new fundamental type id with G_TYPE_MAKE_FUNDAMENTAL() reserved for BSE.static final intLast fundamental type number reserved for BSE.static final intFirst fundamental type number to create a new fundamental type id with G_TYPE_MAKE_FUNDAMENTAL() reserved for GLib.static final intLast fundamental type number reserved for GLib.static final intFirst available fundamental type number to create new fundamental type id with G_TYPE_MAKE_FUNDAMENTAL().static final intThe maximal number ofGTypeCValueswhich can be collected for a singleGValue.static final intFlag to indicate that a string in aGObject.Valueis canonical and will exist for the duration of the process.static final intFlag to indicate that allocated data in aGObject.Valueshouldn’t be copied. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MemorySegmentboxedCopy(Type boxedType, MemorySegment srcBoxed) Provide a copy of a boxed structuresrcBoxedwhich is of typeboxedType.static voidboxedFree(Type boxedType, MemorySegment boxed) Free the boxed structureboxedwhich is of typeboxedType.static TypeboxedTypeRegisterStatic(String name, @Nullable BoxedCopyFunc boxedCopy, @Nullable BoxedFreeFunc boxedFree) This function creates a newG_TYPE_BOXEDderived type id for a new boxed type with namename.static voidclearObject(GObject[] objectPtr) Clears a reference to aGObject.static voidclearSignalHandler(MemorySegment handlerIdPtr, GObject instance) Disconnects a handler frominstanceso it will not be called during any future or currently ongoing emissions of the signal it has been connected to.static voidenumCompleteTypeInfo(Type gEnumType, TypeInfo info, @Nullable EnumValue @Nullable [] constValues) This function is meant to be called from thecomplete_type_infofunction of aGTypePluginimplementation, as in the following example:static @Nullable EnumValueenumGetValue(EnumClass enumClass, int value) Returns theGEnumValuefor a value.static @Nullable EnumValueenumGetValueByName(EnumClass enumClass, String name) Looks up aGEnumValueby name.static @Nullable EnumValueenumGetValueByNick(EnumClass enumClass, String nick) Looks up aGEnumValueby nickname.static TypeenumRegisterStatic(String name, @Nullable EnumValue @Nullable [] constStaticValues) Registers a new static enumeration type with the namename.static StringenumToString(Type gEnumType, int value) Pretty-printsvaluein the form of the enum’s name.static voidflagsCompleteTypeInfo(Type gFlagsType, TypeInfo info, @Nullable FlagsValue @Nullable [] constValues) This function is meant to be called from the complete_type_info() function of aGTypePluginimplementation, see the example for g_enum_complete_type_info() above.static @Nullable FlagsValueflagsGetFirstValue(FlagsClass flagsClass, int value) Returns the firstGFlagsValuewhich is set invalue.static @Nullable FlagsValueflagsGetValueByName(FlagsClass flagsClass, String name) Looks up aGFlagsValueby name.static @Nullable FlagsValueflagsGetValueByNick(FlagsClass flagsClass, String nick) Looks up aGFlagsValueby nickname.static TypeflagsRegisterStatic(String name, @Nullable FlagsValue @Nullable [] constStaticValues) Registers a new static flags type with the namename.static StringflagsToString(Type flagsType, int value) Pretty-printsvaluein the form of the flag names separated by|and sorted.static Typestatic voidstatic ParamSpecparamSpecBoolean(String name, @Nullable String nick, @Nullable String blurb, boolean defaultValue, Set<ParamFlags> flags) Creates a newGParamSpecBooleaninstance specifying aG_TYPE_BOOLEANproperty.static ParamSpecparamSpecBoolean(String name, @Nullable String nick, @Nullable String blurb, boolean defaultValue, ParamFlags... flags) Creates a newGParamSpecBooleaninstance specifying aG_TYPE_BOOLEANproperty.static ParamSpecparamSpecBoxed(String name, @Nullable String nick, @Nullable String blurb, Type boxedType, Set<ParamFlags> flags) Creates a newGParamSpecBoxedinstance specifying aG_TYPE_BOXEDderived property.static ParamSpecparamSpecBoxed(String name, @Nullable String nick, @Nullable String blurb, Type boxedType, ParamFlags... flags) Creates a newGParamSpecBoxedinstance specifying aG_TYPE_BOXEDderived property.static ParamSpecparamSpecChar(String name, @Nullable String nick, @Nullable String blurb, byte minimum, byte maximum, byte defaultValue, Set<ParamFlags> flags) Creates a newGParamSpecCharinstance specifying aG_TYPE_CHARproperty.static ParamSpecparamSpecChar(String name, @Nullable String nick, @Nullable String blurb, byte minimum, byte maximum, byte defaultValue, ParamFlags... flags) Creates a newGParamSpecCharinstance specifying aG_TYPE_CHARproperty.static ParamSpecparamSpecDouble(String name, @Nullable String nick, @Nullable String blurb, double minimum, double maximum, double defaultValue, Set<ParamFlags> flags) Creates a newGParamSpecDoubleinstance specifying aG_TYPE_DOUBLEproperty.static ParamSpecparamSpecDouble(String name, @Nullable String nick, @Nullable String blurb, double minimum, double maximum, double defaultValue, ParamFlags... flags) Creates a newGParamSpecDoubleinstance specifying aG_TYPE_DOUBLEproperty.static ParamSpecparamSpecEnum(String name, @Nullable String nick, @Nullable String blurb, Type enumType, int defaultValue, Set<ParamFlags> flags) Creates a newGParamSpecEnuminstance specifying aG_TYPE_ENUMproperty.static ParamSpecparamSpecEnum(String name, @Nullable String nick, @Nullable String blurb, Type enumType, int defaultValue, ParamFlags... flags) Creates a newGParamSpecEnuminstance specifying aG_TYPE_ENUMproperty.static ParamSpecparamSpecFlags(String name, @Nullable String nick, @Nullable String blurb, Type flagsType, int defaultValue, Set<ParamFlags> flags) Creates a newGParamSpecFlagsinstance specifying aG_TYPE_FLAGSproperty.static ParamSpecparamSpecFlags(String name, @Nullable String nick, @Nullable String blurb, Type flagsType, int defaultValue, ParamFlags... flags) Creates a newGParamSpecFlagsinstance specifying aG_TYPE_FLAGSproperty.static ParamSpecparamSpecFloat(String name, @Nullable String nick, @Nullable String blurb, float minimum, float maximum, float defaultValue, Set<ParamFlags> flags) Creates a newGParamSpecFloatinstance specifying aG_TYPE_FLOATproperty.static ParamSpecparamSpecFloat(String name, @Nullable String nick, @Nullable String blurb, float minimum, float maximum, float defaultValue, ParamFlags... flags) Creates a newGParamSpecFloatinstance specifying aG_TYPE_FLOATproperty.static ParamSpecparamSpecGtype(String name, @Nullable String nick, @Nullable String blurb, Type isAType, Set<ParamFlags> flags) Creates a newGParamSpecGTypeinstance specifying aG_TYPE_GTYPEproperty.static ParamSpecparamSpecGtype(String name, @Nullable String nick, @Nullable String blurb, Type isAType, ParamFlags... flags) Creates a newGParamSpecGTypeinstance specifying aG_TYPE_GTYPEproperty.static ParamSpecparamSpecInt(String name, @Nullable String nick, @Nullable String blurb, int minimum, int maximum, int defaultValue, Set<ParamFlags> flags) Creates a newGParamSpecIntinstance specifying aG_TYPE_INTproperty.static ParamSpecparamSpecInt(String name, @Nullable String nick, @Nullable String blurb, int minimum, int maximum, int defaultValue, ParamFlags... flags) Creates a newGParamSpecIntinstance specifying aG_TYPE_INTproperty.static ParamSpecparamSpecInt64(String name, @Nullable String nick, @Nullable String blurb, long minimum, long maximum, long defaultValue, Set<ParamFlags> flags) Creates a newGParamSpecInt64instance specifying aG_TYPE_INT64property.static ParamSpecparamSpecInt64(String name, @Nullable String nick, @Nullable String blurb, long minimum, long maximum, long defaultValue, ParamFlags... flags) Creates a newGParamSpecInt64instance specifying aG_TYPE_INT64property.static ParamSpecparamSpecLong(String name, @Nullable String nick, @Nullable String blurb, int minimum, int maximum, int defaultValue, Set<ParamFlags> flags) Creates a newGParamSpecLonginstance specifying aG_TYPE_LONGproperty.static ParamSpecparamSpecLong(String name, @Nullable String nick, @Nullable String blurb, int minimum, int maximum, int defaultValue, ParamFlags... flags) Creates a newGParamSpecLonginstance specifying aG_TYPE_LONGproperty.static ParamSpecparamSpecObject(String name, @Nullable String nick, @Nullable String blurb, Type objectType, Set<ParamFlags> flags) Creates a newGParamSpecBoxedinstance specifying aG_TYPE_OBJECTderived property.static ParamSpecparamSpecObject(String name, @Nullable String nick, @Nullable String blurb, Type objectType, ParamFlags... flags) Creates a newGParamSpecBoxedinstance specifying aG_TYPE_OBJECTderived property.static ParamSpecparamSpecOverride(String name, ParamSpec overridden) Creates a new property of typeGParamSpecOverride.static ParamSpecparamSpecParam(String name, @Nullable String nick, @Nullable String blurb, Type paramType, Set<ParamFlags> flags) Creates a newGParamSpecParaminstance specifying aG_TYPE_PARAMproperty.static ParamSpecparamSpecParam(String name, @Nullable String nick, @Nullable String blurb, Type paramType, ParamFlags... flags) Creates a newGParamSpecParaminstance specifying aG_TYPE_PARAMproperty.static ParamSpecparamSpecPointer(String name, @Nullable String nick, @Nullable String blurb, Set<ParamFlags> flags) Creates a newGParamSpecPointerinstance specifying a pointer property.static ParamSpecparamSpecPointer(String name, @Nullable String nick, @Nullable String blurb, ParamFlags... flags) Creates a newGParamSpecPointerinstance specifying a pointer property.static ParamSpecparamSpecString(String name, @Nullable String nick, @Nullable String blurb, @Nullable String defaultValue, Set<ParamFlags> flags) Creates a newGParamSpecStringinstance.static ParamSpecparamSpecString(String name, @Nullable String nick, @Nullable String blurb, @Nullable String defaultValue, ParamFlags... flags) Creates a newGParamSpecStringinstance.static ParamSpecparamSpecUchar(String name, @Nullable String nick, @Nullable String blurb, byte minimum, byte maximum, byte defaultValue, Set<ParamFlags> flags) Creates a newGParamSpecUCharinstance specifying aG_TYPE_UCHARproperty.static ParamSpecparamSpecUchar(String name, @Nullable String nick, @Nullable String blurb, byte minimum, byte maximum, byte defaultValue, ParamFlags... flags) Creates a newGParamSpecUCharinstance specifying aG_TYPE_UCHARproperty.static ParamSpecparamSpecUint(String name, @Nullable String nick, @Nullable String blurb, int minimum, int maximum, int defaultValue, Set<ParamFlags> flags) Creates a newGParamSpecUIntinstance specifying aG_TYPE_UINTproperty.static ParamSpecparamSpecUint(String name, @Nullable String nick, @Nullable String blurb, int minimum, int maximum, int defaultValue, ParamFlags... flags) Creates a newGParamSpecUIntinstance specifying aG_TYPE_UINTproperty.static ParamSpecparamSpecUint64(String name, @Nullable String nick, @Nullable String blurb, long minimum, long maximum, long defaultValue, Set<ParamFlags> flags) Creates a newGParamSpecUInt64instance specifying aG_TYPE_UINT64property.static ParamSpecparamSpecUint64(String name, @Nullable String nick, @Nullable String blurb, long minimum, long maximum, long defaultValue, ParamFlags... flags) Creates a newGParamSpecUInt64instance specifying aG_TYPE_UINT64property.static ParamSpecparamSpecUlong(String name, @Nullable String nick, @Nullable String blurb, int minimum, int maximum, int defaultValue, Set<ParamFlags> flags) Creates a newGParamSpecULonginstance specifying aG_TYPE_ULONGproperty.static ParamSpecparamSpecUlong(String name, @Nullable String nick, @Nullable String blurb, int minimum, int maximum, int defaultValue, ParamFlags... flags) Creates a newGParamSpecULonginstance specifying aG_TYPE_ULONGproperty.static ParamSpecparamSpecUnichar(String name, @Nullable String nick, @Nullable String blurb, int defaultValue, Set<ParamFlags> flags) Creates a newGParamSpecUnicharinstance specifying aG_TYPE_UINTproperty.static ParamSpecparamSpecUnichar(String name, @Nullable String nick, @Nullable String blurb, int defaultValue, ParamFlags... flags) Creates a newGParamSpecUnicharinstance specifying aG_TYPE_UINTproperty.static ParamSpecparamSpecValueArray(String name, @Nullable String nick, @Nullable String blurb, ParamSpec elementSpec, Set<ParamFlags> flags) Creates a newGParamSpecValueArrayinstance specifying aG_TYPE_VALUE_ARRAYproperty.static ParamSpecparamSpecValueArray(String name, @Nullable String nick, @Nullable String blurb, ParamSpec elementSpec, ParamFlags... flags) Creates a newGParamSpecValueArrayinstance specifying aG_TYPE_VALUE_ARRAYproperty.static ParamSpecparamSpecVariant(String name, @Nullable String nick, @Nullable String blurb, VariantType type, @Nullable Variant defaultValue, Set<ParamFlags> flags) Creates a newGParamSpecVariantinstance specifying aGVariantproperty.static ParamSpecparamSpecVariant(String name, @Nullable String nick, @Nullable String blurb, VariantType type, @Nullable Variant defaultValue, ParamFlags... flags) Creates a newGParamSpecVariantinstance specifying aGVariantproperty.static TypeparamTypeRegisterStatic(String name, ParamSpecTypeInfo pspecInfo) Registersnameas the name of a new static type derived fromG_TYPE_PARAM.static booleanparamValueConvert(ParamSpec pspec, Value srcValue, Value destValue, boolean strictValidation) TransformssrcValueintodestValueif possible, and then validatesdestValue,in order for it to conform topspec.IfstrictValidationistruethis function will only succeed if the transformeddestValuecomplied topspecwithout modifications.static booleanparamValueDefaults(ParamSpec pspec, Value value) Checks whethervaluecontains the default value as specified inpspec.static booleanparamValueIsValid(ParamSpec pspec, Value value) Return whether the contents ofvaluecomply with the specifications set out bypspec.static intparamValuesCmp(ParamSpec pspec, Value value1, Value value2) Comparesvalue1withvalue2according topspec,and return -1, 0 or +1, ifvalue1is found to be less than, equal to or greater thanvalue2,respectively.static voidparamValueSetDefault(ParamSpec pspec, Value value) Setsvalueto its default value as specified inpspec.static booleanparamValueValidate(ParamSpec pspec, Value value) Ensures that the contents ofvaluecomply with the specifications set out bypspec.For example, aGParamSpecIntmight require that integers stored invaluemay not be smaller than -42 and not be greater than +42.static TypeCreates a newG_TYPE_POINTERderived type id for a new pointer type with namename.static booleansignalAccumulatorFirstWins(SignalInvocationHint ihint, Value returnAccu, Value handlerReturn, @Nullable MemorySegment dummy) A predefinedGSignalAccumulatorfor signals intended to be used as a hook for application code to provide a particular value.static booleansignalAccumulatorTrueHandled(SignalInvocationHint ihint, Value returnAccu, Value handlerReturn, @Nullable MemorySegment dummy) A predefinedGSignalAccumulatorfor signals that return a boolean values.static intsignalAddEmissionHook(int signalId, Quark detail, @Nullable SignalEmissionHook hookFunc) Adds an emission hook for a signal, which will get called for any emission of that signal, independent of the instance.static voidsignalChainFromOverridden(@Nullable Value @Nullable [] instanceAndParams, Value returnValue) Calls the original class closure of a signal.static voidsignalChainFromOverriddenHandler(TypeInstance instance, Object... varargs) Calls the original class closure of a signal.static intsignalConnectClosure(GObject instance, String detailedSignal, Closure closure, boolean after) Connects a closure to a signal for a particular object.static intsignalConnectClosureById(GObject instance, int signalId, Quark detail, Closure closure, boolean after) Connects a closure to a signal for a particular object.static intsignalConnectData(GObject instance, String detailedSignal, @Nullable Callback cHandler, @Nullable ClosureNotify destroyData, Set<ConnectFlags> connectFlags) Connects aGCallbackfunction to a signal for a particular object.static intsignalConnectData(GObject instance, String detailedSignal, @Nullable Callback cHandler, @Nullable ClosureNotify destroyData, ConnectFlags... connectFlags) Connects aGCallbackfunction to a signal for a particular object.static intsignalConnectObject(TypeInstance instance, String detailedSignal, @Nullable Callback cHandler, @Nullable GObject gobject, Set<ConnectFlags> connectFlags) This is similar to g_signal_connect_data(), but uses a closure which ensures that thegobjectstays alive during the call tocHandlerby temporarily adding a reference count togobject.static intsignalConnectObject(TypeInstance instance, String detailedSignal, @Nullable Callback cHandler, @Nullable GObject gobject, ConnectFlags... connectFlags) This is similar to g_signal_connect_data(), but uses a closure which ensures that thegobjectstays alive during the call tocHandlerby temporarily adding a reference count togobject.static voidsignalEmit(GObject instance, int signalId, Quark detail, Object... varargs) Emits a signal.static voidsignalEmitByName(GObject instance, String detailedSignal, Object... varargs) Emits a signal.static voidsignalEmitv(@Nullable Value @Nullable [] instanceAndParams, int signalId, Quark detail, @Nullable Value returnValue) Emits a signal.static @Nullable SignalInvocationHintsignalGetInvocationHint(GObject instance) Returns the invocation hint of the innermost signal emission of instance.static voidsignalHandlerBlock(GObject instance, int handlerId) Blocks a handler of an instance so it will not be called during any signal emissions unless it is unblocked again.static voidsignalHandlerDisconnect(GObject instance, int 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.static intsignalHandlerFind(GObject instance, Set<SignalMatchType> mask, int signalId, Quark detail, @Nullable Closure closure, @Nullable MemorySegment func, @Nullable MemorySegment data) Finds the first signal handler that matches certain selection criteria.static intsignalHandlerFind(GObject instance, SignalMatchType mask, int signalId, Quark detail, @Nullable Closure closure, @Nullable MemorySegment func, @Nullable MemorySegment data) Finds the first signal handler that matches certain selection criteria.static booleansignalHandlerIsConnected(GObject instance, int handlerId) Returns whetherhandlerIdis the ID of a handler connected toinstance.static intsignalHandlersBlockMatched(GObject instance, Set<SignalMatchType> mask, int signalId, Quark detail, @Nullable Closure closure, @Nullable MemorySegment func, @Nullable MemorySegment data) Blocks all handlers on an instance that match a certain selection criteria.static intsignalHandlersBlockMatched(GObject instance, SignalMatchType mask, int signalId, Quark detail, @Nullable Closure closure, @Nullable MemorySegment func, @Nullable MemorySegment data) Blocks all handlers on an instance that match a certain selection criteria.static voidsignalHandlersDestroy(GObject instance) Destroy all signal handlers of a type instance.static intsignalHandlersDisconnectMatched(GObject instance, Set<SignalMatchType> mask, int signalId, Quark detail, @Nullable Closure closure, @Nullable MemorySegment func, @Nullable MemorySegment data) Disconnects all handlers on an instance that match a certain selection criteria.static intsignalHandlersDisconnectMatched(GObject instance, SignalMatchType mask, int signalId, Quark detail, @Nullable Closure closure, @Nullable MemorySegment func, @Nullable MemorySegment data) Disconnects all handlers on an instance that match a certain selection criteria.static intsignalHandlersUnblockMatched(GObject instance, Set<SignalMatchType> mask, int signalId, Quark detail, @Nullable Closure closure, @Nullable MemorySegment func, @Nullable MemorySegment data) Unblocks all handlers on an instance that match a certain selection criteria.static intsignalHandlersUnblockMatched(GObject instance, SignalMatchType mask, int signalId, Quark detail, @Nullable Closure closure, @Nullable MemorySegment func, @Nullable MemorySegment data) Unblocks all handlers on an instance that match a certain selection criteria.static voidsignalHandlerUnblock(GObject instance, int handlerId) Undoes the effect of a previous g_signal_handler_block() call.static booleansignalHasHandlerPending(GObject instance, int signalId, Quark detail, boolean mayBeBlocked) Returns whether there are any handlers connected toinstancefor the given signal id and detail.static booleansignalIsValidName(String name) Validate a signal name.static int[]signalListIds(Type itype) Lists the signals by id that a certain instance or interface type created.static intsignalLookup(String name, Type itype) Given the name of the signal and the type of object it connects to, gets the signal's identifying integer.static @Nullable StringsignalName(int signalId) Given the signal's identifier, finds its name.static intsignalNew(String signalName, Type itype, Set<SignalFlags> signalFlags, int classOffset, @Nullable SignalAccumulator accumulator, @Nullable SignalCMarshaller cMarshaller, Type returnType, int nParams, Object... varargs) Creates a new signal.static intsignalNew(String signalName, Type itype, SignalFlags signalFlags, int classOffset, @Nullable SignalAccumulator accumulator, @Nullable SignalCMarshaller cMarshaller, Type returnType, int nParams, Object... varargs) Creates a new signal.static intsignalNewClassHandler(String signalName, Type itype, Set<SignalFlags> signalFlags, @Nullable Callback classHandler, @Nullable SignalAccumulator accumulator, @Nullable SignalCMarshaller cMarshaller, Type returnType, int nParams, Object... varargs) Creates a new signal.static intsignalNewClassHandler(String signalName, Type itype, SignalFlags signalFlags, @Nullable Callback classHandler, @Nullable SignalAccumulator accumulator, @Nullable SignalCMarshaller cMarshaller, Type returnType, int nParams, Object... varargs) Creates a new signal.static intsignalNewv(String signalName, Type itype, Set<SignalFlags> signalFlags, @Nullable Closure classClosure, @Nullable SignalAccumulator accumulator, @Nullable SignalCMarshaller cMarshaller, Type returnType, @Nullable Type @Nullable [] paramTypes) Creates a new signal.static intsignalNewv(String signalName, Type itype, SignalFlags signalFlags, @Nullable Closure classClosure, @Nullable SignalAccumulator accumulator, @Nullable SignalCMarshaller cMarshaller, Type returnType, @Nullable Type @Nullable [] paramTypes) Creates a new signal.static voidsignalOverrideClassClosure(int signalId, Type instanceType, Closure classClosure) Overrides the class closure (i.e.static voidsignalOverrideClassHandler(String signalName, Type instanceType, @Nullable Callback classHandler) Overrides the class closure (i.e.static booleansignalParseName(String detailedSignal, Type itype, Out<Integer> signalIdP, Quark detailP, boolean forceDetailQuark) Internal function to parse a signal name into itssignalIdanddetailquark.static voidsignalQuery(int signalId, SignalQuery query) Queries the signal system for in-depth information about a specific signal.static voidsignalRemoveEmissionHook(int signalId, int hookId) Deletes an emission hook.static voidsignalStopEmission(GObject instance, int signalId, Quark detail) Stops a signal's current emission.static voidsignalStopEmissionByName(GObject instance, String detailedSignal) Stops a signal's current emission.static ClosuresignalTypeCclosureNew(Type itype, int structOffset) Creates a new closure which invokes the function found at the offsetstructOffsetin the class structure of the interface or classed type identified byitype.static StringstrdupValueContents(Value value) Return a newly allocated string, which describes the contents of aGValue.static voidtypeAddClassCacheFunc(@Nullable MemorySegment cacheData, @Nullable TypeClassCacheFunc cacheFunc) Adds aGTypeClassCacheFuncto be called before the reference count of a class goes from one to zero.static voidtypeAddClassPrivate(Type classType, long 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 block as the public structures, and are zero-filled.static inttypeAddInstancePrivate(Type classType, long privateSize) static voidtypeAddInterfaceCheck(@Nullable MemorySegment checkData, @Nullable TypeInterfaceCheckFunc checkFunc) Adds a function to be called after an interface vtable is initialized for any class (i.e.static voidtypeAddInterfaceDynamic(Type instanceType, Type interfaceType, TypePlugin plugin) AddsinterfaceTypeto the dynamicinstanceType.The information contained in theGTypePluginstructure pointed to bypluginis used to manage the relationship.static voidtypeAddInterfaceStatic(Type instanceType, Type interfaceType, InterfaceInfo info) AddsinterfaceTypeto the staticinstanceType.The information contained in theGInterfaceInfostructure pointed to byinfois used to manage the relationship.static TypeClasstypeCheckClassCast(TypeClass gClass, Type isAType) static booleantypeCheckClassIsA(TypeClass gClass, Type isAType) static booleantypeCheckInstance(TypeInstance instance) Private helper function to aid implementation of the G_TYPE_CHECK_INSTANCE() macro.static TypeInstancetypeCheckInstanceCast(TypeInstance instance, Type ifaceType) static booleantypeCheckInstanceIsA(TypeInstance instance, Type ifaceType) static booleantypeCheckInstanceIsFundamentallyA(TypeInstance instance, Type fundamentalType) static booleantypeCheckIsValueType(Type type) static booleantypeCheckValue(Value value) static booleantypeCheckValueHolds(Value value, Type type) static Type[]typeChildren(Type type) Return a newly allocated and 0-terminated array of type IDs, listing the child types oftype.static TypeInstancetypeCreateInstance(Type type) Creates and initializes an instance oftypeiftypeis valid and can be instantiated.static TypeInterfacetypeDefaultInterfaceGet(Type gType) Returns the default interface vtable for the givengType.static TypeInterfacetypeDefaultInterfacePeek(Type gType) If the interface typegTypeis currently in use, returns its default interface vtable.static TypeInterfacetypeDefaultInterfaceRef(Type gType) Deprecated.Use g_type_default_interface_get() insteadstatic voidDeprecated.Interface reference counting has been removed and interface types now cannot be finalized.static intReturns the length of the ancestry of the passed in type.static voidtypeEnsure(Type type) Ensures that the indicatedtypehas been registered with the type system, and its _class_init() method has been run.static voidtypeFreeInstance(TypeInstance instance) Frees an instance of a type, returning it to the instance pool for the type, if there is one.static TypetypeFromName(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 yet).static TypetypeFundamental(Type typeId) Internal function, used to extract the fundamental type ID portion.static TypeReturns the next free fundamental type id which can be used to register a new fundamental type with g_type_register_fundamental().static inttypeGetInstanceCount(Type type) Returns the number of instances allocated of the particular type; this is only available if GLib is built with debugging support and theinstance-countdebug flag is set (by setting theGOBJECT_DEBUGvariable to includeinstance-count).static TypePlugintypeGetPlugin(Type type) Returns theGTypePluginstructure fortype.static @Nullable MemorySegmenttypeGetQdata(Type type, Quark quark) Obtains data which has previously been attached totypewith g_type_set_qdata().static intReturns an opaque serial number that represents the state of the set of registered types.static voidtypeInit()Deprecated.the type system is now initialised automaticallystatic voidtypeInitWithDebugFlags(Set<TypeDebugFlags> debugFlags) Deprecated.the type system is now initialised automaticallystatic voidtypeInitWithDebugFlags(TypeDebugFlags... debugFlags) Deprecated.the type system is now initialised automaticallystatic Type[]typeInterfaces(Type type) Return a newly allocated and 0-terminated array of type IDs, listing the interface types thattypeconforms to.static booleanIfisATypeis a derivable type, check whethertypeis a descendant ofisAType.IfisATypeis an interface, check whethertypeconforms to it.static @Nullable StringGet the unique name that is assigned to a type ID.static StringtypeNameFromClass(TypeClass gClass) static StringtypeNameFromInstance(TypeInstance instance) static TypetypeNextBase(Type leafType, Type rootType) Given aleafTypeand arootTypewhich is contained in its ancestry, return the type thatrootTypeis the immediate parent of.static TypetypeParent(Type type) Return the direct parent type of the passed in type.static QuarkGet the corresponding quark of the type IDs name.static voidQueries the type system for information about a specific type.static TypetypeRegisterDynamic(Type parentType, String typeName, TypePlugin plugin, Set<TypeFlags> flags) RegisterstypeNameas the name of a new dynamic type derived fromparentType.The type system uses the information contained in theGTypePluginstructure pointed to bypluginto manage the type and its instances (if not abstract).static TypetypeRegisterDynamic(Type parentType, String typeName, TypePlugin plugin, TypeFlags... flags) RegisterstypeNameas the name of a new dynamic type derived fromparentType.The type system uses the information contained in theGTypePluginstructure pointed to bypluginto manage the type and its instances (if not abstract).static TypetypeRegisterFundamental(Type typeId, String typeName, TypeInfo info, TypeFundamentalInfo finfo, Set<TypeFlags> flags) RegisterstypeIdas the predefined identifier andtypeNameas the name of a fundamental type.static TypetypeRegisterFundamental(Type typeId, String typeName, TypeInfo info, TypeFundamentalInfo finfo, TypeFlags... flags) RegisterstypeIdas the predefined identifier andtypeNameas the name of a fundamental type.static TypeRegisterstypeNameas the name of a new static type derived fromparentType.The type system uses the information contained in theGTypeInfostructure pointed to byinfoto manage the type and its instances (if not abstract).static TypetypeRegisterStatic(Type parentType, String typeName, TypeInfo info, TypeFlags... flags) RegisterstypeNameas the name of a new static type derived fromparentType.The type system uses the information contained in theGTypeInfostructure pointed to byinfoto manage the type and its instances (if not abstract).static TypetypeRegisterStaticSimple(Type parentType, String typeName, int classSize, @Nullable ClassInitFunc classInit, int instanceSize, @Nullable InstanceInitFunc instanceInit, Set<TypeFlags> flags) RegisterstypeNameas the name of a new static type derived fromparentType.The value offlagsdetermines the nature (e.g.static TypetypeRegisterStaticSimple(Type parentType, String typeName, int classSize, @Nullable ClassInitFunc classInit, int instanceSize, @Nullable InstanceInitFunc instanceInit, TypeFlags... flags) RegisterstypeNameas the name of a new static type derived fromparentType.The value offlagsdetermines the nature (e.g.static voidtypeRemoveClassCacheFunc(@Nullable MemorySegment cacheData, @Nullable TypeClassCacheFunc cacheFunc) Removes a previously installedGTypeClassCacheFunc.static voidtypeRemoveInterfaceCheck(@Nullable MemorySegment checkData, @Nullable TypeInterfaceCheckFunc checkFunc) Removes an interface check function added with g_type_add_interface_check().static voidtypeSetQdata(Type type, Quark quark, @Nullable MemorySegment data) Attaches arbitrary data to a type.static booleantypeTestFlags(Type type, int flags) static Type
-
Field Details
-
PARAM_MASK
public static final int PARAM_MASKMask containing the bits ofGParamSpec.flags which are reserved for GLib.- See Also:
-
PARAM_STATIC_STRINGS
public static final int PARAM_STATIC_STRINGSGParamFlagsvalue alias forParamFlags.STATIC_NAME|ParamFlags.STATIC_NICK|ParamFlags.STATIC_BLURB.It is recommended to use this for all properties by default, as it allows for internal performance improvements in GObject.
It is very rare that a property would have a dynamically constructed name, nickname or blurb.
Since 2.13.0
- See Also:
-
PARAM_USER_SHIFT
public static final int PARAM_USER_SHIFTMinimum shift count to be used for user defined flags, to be stored inGParamSpec.flags. The maximum allowed is 10.- See Also:
-
SIGNAL_FLAGS_MASK
public static final int SIGNAL_FLAGS_MASKA mask for allGSignalFlagsbits.- See Also:
-
SIGNAL_MATCH_MASK
public static final int SIGNAL_MATCH_MASKA mask for allGSignalMatchTypebits.- See Also:
-
TYPE_FLAG_RESERVED_ID_BIT
public static final long TYPE_FLAG_RESERVED_ID_BITA bit in the type number that's supposed to be left untouched.- See Also:
-
TYPE_FUNDAMENTAL_MAX
public static final int TYPE_FUNDAMENTAL_MAXAn integer constant that represents the number of identifiers reserved for types that are assigned at compile-time.- See Also:
-
TYPE_FUNDAMENTAL_SHIFT
public static final int TYPE_FUNDAMENTAL_SHIFTShift value used in converting numbers to type IDs.- See Also:
-
TYPE_RESERVED_BSE_FIRST
public static final int TYPE_RESERVED_BSE_FIRSTFirst fundamental type number to create a new fundamental type id with G_TYPE_MAKE_FUNDAMENTAL() reserved for BSE.- See Also:
-
TYPE_RESERVED_BSE_LAST
public static final int TYPE_RESERVED_BSE_LASTLast fundamental type number reserved for BSE.- See Also:
-
TYPE_RESERVED_GLIB_FIRST
public static final int TYPE_RESERVED_GLIB_FIRSTFirst fundamental type number to create a new fundamental type id with G_TYPE_MAKE_FUNDAMENTAL() reserved for GLib.- See Also:
-
TYPE_RESERVED_GLIB_LAST
public static final int TYPE_RESERVED_GLIB_LASTLast fundamental type number reserved for GLib.- See Also:
-
TYPE_RESERVED_USER_FIRST
public static final int TYPE_RESERVED_USER_FIRSTFirst available fundamental type number to create new fundamental type id with G_TYPE_MAKE_FUNDAMENTAL().- See Also:
-
VALUE_COLLECT_FORMAT_MAX_LENGTH
public static final int VALUE_COLLECT_FORMAT_MAX_LENGTHThe maximal number ofGTypeCValueswhich can be collected for a singleGValue.- See Also:
-
VALUE_INTERNED_STRING
public static final int VALUE_INTERNED_STRINGFlag to indicate that a string in aGObject.Valueis canonical and will exist for the duration of the process.See
Value.setInternedString(java.lang.String).This flag should be checked by implementations of
GObject.TypeValueFreeFunc,GObject.TypeValueCollectFuncandGObject.TypeValueLCopyFunc.- Since:
- 2.66
- See Also:
-
VALUE_NOCOPY_CONTENTS
public static final int VALUE_NOCOPY_CONTENTSFlag to indicate that allocated data in aGObject.Valueshouldn’t be copied.If passed to
GObjects#VALUECOLLECT, allocated data won’t be copied but used verbatim. This does not affect ref-counted types like objects.This does not affect usage of
Value.copy(org.gnome.gobject.Value): the data will be copied if it is not ref-counted.This flag should be checked by implementations of
GObject.TypeValueFreeFunc,GObject.TypeValueCollectFuncandGObject.TypeValueLCopyFunc.- See Also:
-
-
Constructor Details
-
GObjects
public GObjects()
-
-
Method Details
-
javagi$ensureInitialized
public static void javagi$ensureInitialized() -
boxedCopy
Provide a copy of a boxed structuresrcBoxedwhich is of typeboxedType.- Parameters:
boxedType- The type ofsrcBoxed.srcBoxed- The boxed structure to be copied.- Returns:
- The newly created copy of the boxed structure.
-
boxedFree
Free the boxed structureboxedwhich is of typeboxedType.- Parameters:
boxedType- The type ofboxed.boxed- The boxed structure to be freed.
-
boxedTypeRegisterStatic
public static Type boxedTypeRegisterStatic(String name, @Nullable BoxedCopyFunc boxedCopy, @Nullable BoxedFreeFunc boxedFree) This function creates a newG_TYPE_BOXEDderived type id for a new boxed type with namename.Boxed type handling functions have to be provided to copy and free opaque boxed structures of this type.
For the general case, it is recommended to use G_DEFINE_BOXED_TYPE() instead of calling g_boxed_type_register_static() directly. The macro will create the appropriate
*_get_type()function for the boxed type.- Parameters:
name- Name of the new boxed type.boxedCopy- Boxed structure copy function.boxedFree- Boxed structure free function.- Returns:
- New
G_TYPE_BOXEDderived type id forname.
-
clearObject
Clears a reference to aGObject.objectPtrmust not benull.If the reference is
nullthen this function does nothing. Otherwise, the reference count of the object is decreased and the pointer is set tonull.A macro is also included that allows this function to be used without pointer casts.
- Parameters:
objectPtr- a pointer to aGObjectreference- Since:
- 2.28
-
clearSignalHandler
Disconnects a handler frominstanceso it will not be called during any future or currently ongoing emissions of the signal it has been connected to. ThehandlerIdPtris 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.
There is also a macro version of this function so that the code will be inlined.
- Parameters:
handlerIdPtr- A pointer to a handler ID (of typegulong) of the handler to be disconnected.instance- The instance to remove the signal handler from. This pointer may benullor invalid, if the handler ID is zero.- Since:
- 2.62
-
enumCompleteTypeInfo
public static void enumCompleteTypeInfo(Type gEnumType, TypeInfo info, @Nullable EnumValue @Nullable [] constValues) This function is meant to be called from thecomplete_type_infofunction of aGTypePluginimplementation, as in the following 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); }- Parameters:
gEnumType- the type identifier of the type being completedinfo- theGTypeInfostruct to be filled inconstValues- An array ofGEnumValuestructs for the possible enumeration values. The array is terminated by a struct with all members being 0.
-
enumGetValue
-
enumGetValueByName
-
enumGetValueByNick
Looks up aGEnumValueby nickname.- Parameters:
enumClass- aGEnumClassnick- the nickname to look up- Returns:
- the
GEnumValuewith nicknamenick,ornullif the enumeration doesn't have a member with that nickname
-
enumRegisterStatic
public static Type enumRegisterStatic(String name, @Nullable EnumValue @Nullable [] constStaticValues) Registers a new static enumeration type with the namename.It is normally more convenient to let [glib-mkenums][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().
- Parameters:
name- A nul-terminated string used as the name of the new type.constStaticValues- An array ofGEnumValuestructs for the possible enumeration values. The array is terminated by a struct with all members being 0. GObject keeps a reference to the data, so it cannot be stack-allocated.- Returns:
- The new type identifier.
-
enumToString
Pretty-printsvaluein 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.
- Parameters:
gEnumType- the type identifier of aGEnumClasstypevalue- the value- Returns:
- a newly-allocated text string
- Since:
- 2.54
-
flagsCompleteTypeInfo
public static void flagsCompleteTypeInfo(Type gFlagsType, TypeInfo info, @Nullable FlagsValue @Nullable [] constValues) This function is meant to be called from the complete_type_info() function of aGTypePluginimplementation, see the example for g_enum_complete_type_info() above.- Parameters:
gFlagsType- the type identifier of the type being completedinfo- theGTypeInfostruct to be filled inconstValues- An array ofGFlagsValuestructs for the possible enumeration values. The array is terminated by a struct with all members being 0.
-
flagsGetFirstValue
Returns the firstGFlagsValuewhich is set invalue.- Parameters:
flagsClass- aGFlagsClassvalue- the value- Returns:
- the first
GFlagsValuewhich is set invalue,ornullif none is set
-
flagsGetValueByName
Looks up aGFlagsValueby name.- Parameters:
flagsClass- aGFlagsClassname- the name to look up- Returns:
- the
GFlagsValuewith namename,ornullif there is no flag with that name
-
flagsGetValueByNick
Looks up aGFlagsValueby nickname.- Parameters:
flagsClass- aGFlagsClassnick- the nickname to look up- Returns:
- the
GFlagsValuewith nicknamenick,ornullif there is no flag with that nickname
-
flagsRegisterStatic
public static Type flagsRegisterStatic(String name, @Nullable FlagsValue @Nullable [] constStaticValues) Registers a new static flags type with the namename.It is normally more convenient to let [glib-mkenums][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().
- Parameters:
name- A nul-terminated string used as the name of the new type.constStaticValues- An array ofGFlagsValuestructs for the possible flags values. The array is terminated by a struct with all members being 0. GObject keeps a reference to the data, so it cannot be stack-allocated.- Returns:
- The new type identifier.
-
flagsToString
Pretty-printsvaluein 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.
- Parameters:
flagsType- the type identifier of aGFlagsClasstypevalue- the value- Returns:
- a newly-allocated text string
- Since:
- 2.54
-
gtypeGetType
-
paramSpecBoolean
public static ParamSpec paramSpecBoolean(String name, @Nullable String nick, @Nullable String blurb, boolean defaultValue, Set<ParamFlags> flags) Creates a newGParamSpecBooleaninstance specifying aG_TYPE_BOOLEANproperty. 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.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifieddefaultValue- default value for the property specifiedflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecBoolean
public static ParamSpec paramSpecBoolean(String name, @Nullable String nick, @Nullable String blurb, boolean defaultValue, ParamFlags... flags) Creates a newGParamSpecBooleaninstance specifying aG_TYPE_BOOLEANproperty. 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.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifieddefaultValue- default value for the property specifiedflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecBoxed
public static ParamSpec paramSpecBoxed(String name, @Nullable String nick, @Nullable String blurb, Type boxedType, Set<ParamFlags> flags) Creates a newGParamSpecBoxedinstance specifying aG_TYPE_BOXEDderived property.See g_param_spec_internal() for details on property names.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedboxedType-G_TYPE_BOXEDderived type of this propertyflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecBoxed
public static ParamSpec paramSpecBoxed(String name, @Nullable String nick, @Nullable String blurb, Type boxedType, ParamFlags... flags) Creates a newGParamSpecBoxedinstance specifying aG_TYPE_BOXEDderived property.See g_param_spec_internal() for details on property names.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedboxedType-G_TYPE_BOXEDderived type of this propertyflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecChar
public static ParamSpec paramSpecChar(String name, @Nullable String nick, @Nullable String blurb, byte minimum, byte maximum, byte defaultValue, Set<ParamFlags> flags) Creates a newGParamSpecCharinstance specifying aG_TYPE_CHARproperty.- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedminimum- minimum value for the property specifiedmaximum- maximum value for the property specifieddefaultValue- default value for the property specifiedflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecChar
public static ParamSpec paramSpecChar(String name, @Nullable String nick, @Nullable String blurb, byte minimum, byte maximum, byte defaultValue, ParamFlags... flags) Creates a newGParamSpecCharinstance specifying aG_TYPE_CHARproperty.- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedminimum- minimum value for the property specifiedmaximum- maximum value for the property specifieddefaultValue- default value for the property specifiedflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecDouble
public static ParamSpec paramSpecDouble(String name, @Nullable String nick, @Nullable String blurb, double minimum, double maximum, double defaultValue, Set<ParamFlags> flags) Creates a newGParamSpecDoubleinstance specifying aG_TYPE_DOUBLEproperty.See g_param_spec_internal() for details on property names.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedminimum- minimum value for the property specifiedmaximum- maximum value for the property specifieddefaultValue- default value for the property specifiedflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecDouble
public static ParamSpec paramSpecDouble(String name, @Nullable String nick, @Nullable String blurb, double minimum, double maximum, double defaultValue, ParamFlags... flags) Creates a newGParamSpecDoubleinstance specifying aG_TYPE_DOUBLEproperty.See g_param_spec_internal() for details on property names.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedminimum- minimum value for the property specifiedmaximum- maximum value for the property specifieddefaultValue- default value for the property specifiedflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecEnum
public static ParamSpec paramSpecEnum(String name, @Nullable String nick, @Nullable String blurb, Type enumType, int defaultValue, Set<ParamFlags> flags) Creates a newGParamSpecEnuminstance specifying aG_TYPE_ENUMproperty.See g_param_spec_internal() for details on property names.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedenumType- aGTypederived fromG_TYPE_ENUMdefaultValue- default value for the property specifiedflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecEnum
public static ParamSpec paramSpecEnum(String name, @Nullable String nick, @Nullable String blurb, Type enumType, int defaultValue, ParamFlags... flags) Creates a newGParamSpecEnuminstance specifying aG_TYPE_ENUMproperty.See g_param_spec_internal() for details on property names.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedenumType- aGTypederived fromG_TYPE_ENUMdefaultValue- default value for the property specifiedflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecFlags
public static ParamSpec paramSpecFlags(String name, @Nullable String nick, @Nullable String blurb, Type flagsType, int defaultValue, Set<ParamFlags> flags) Creates a newGParamSpecFlagsinstance specifying aG_TYPE_FLAGSproperty.See g_param_spec_internal() for details on property names.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedflagsType- aGTypederived fromG_TYPE_FLAGSdefaultValue- default value for the property specifiedflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecFlags
public static ParamSpec paramSpecFlags(String name, @Nullable String nick, @Nullable String blurb, Type flagsType, int defaultValue, ParamFlags... flags) Creates a newGParamSpecFlagsinstance specifying aG_TYPE_FLAGSproperty.See g_param_spec_internal() for details on property names.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedflagsType- aGTypederived fromG_TYPE_FLAGSdefaultValue- default value for the property specifiedflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecFloat
public static ParamSpec paramSpecFloat(String name, @Nullable String nick, @Nullable String blurb, float minimum, float maximum, float defaultValue, Set<ParamFlags> flags) Creates a newGParamSpecFloatinstance specifying aG_TYPE_FLOATproperty.See g_param_spec_internal() for details on property names.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedminimum- minimum value for the property specifiedmaximum- maximum value for the property specifieddefaultValue- default value for the property specifiedflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecFloat
public static ParamSpec paramSpecFloat(String name, @Nullable String nick, @Nullable String blurb, float minimum, float maximum, float defaultValue, ParamFlags... flags) Creates a newGParamSpecFloatinstance specifying aG_TYPE_FLOATproperty.See g_param_spec_internal() for details on property names.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedminimum- minimum value for the property specifiedmaximum- maximum value for the property specifieddefaultValue- default value for the property specifiedflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecGtype
public static ParamSpec paramSpecGtype(String name, @Nullable String nick, @Nullable String blurb, Type isAType, Set<ParamFlags> flags) Creates a newGParamSpecGTypeinstance specifying aG_TYPE_GTYPEproperty.See g_param_spec_internal() for details on property names.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedisAType- aGTypewhose subtypes are allowed as values of the property (useG_TYPE_NONEfor any type)flags- flags for the property specified- Returns:
- a newly created parameter specification
- Since:
- 2.10
-
paramSpecGtype
public static ParamSpec paramSpecGtype(String name, @Nullable String nick, @Nullable String blurb, Type isAType, ParamFlags... flags) Creates a newGParamSpecGTypeinstance specifying aG_TYPE_GTYPEproperty.See g_param_spec_internal() for details on property names.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedisAType- aGTypewhose subtypes are allowed as values of the property (useG_TYPE_NONEfor any type)flags- flags for the property specified- Returns:
- a newly created parameter specification
- Since:
- 2.10
-
paramSpecInt
public static ParamSpec paramSpecInt(String name, @Nullable String nick, @Nullable String blurb, int minimum, int maximum, int defaultValue, Set<ParamFlags> flags) Creates a newGParamSpecIntinstance specifying aG_TYPE_INTproperty.See g_param_spec_internal() for details on property names.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedminimum- minimum value for the property specifiedmaximum- maximum value for the property specifieddefaultValue- default value for the property specifiedflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecInt
public static ParamSpec paramSpecInt(String name, @Nullable String nick, @Nullable String blurb, int minimum, int maximum, int defaultValue, ParamFlags... flags) Creates a newGParamSpecIntinstance specifying aG_TYPE_INTproperty.See g_param_spec_internal() for details on property names.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedminimum- minimum value for the property specifiedmaximum- maximum value for the property specifieddefaultValue- default value for the property specifiedflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecInt64
public static ParamSpec paramSpecInt64(String name, @Nullable String nick, @Nullable String blurb, long minimum, long maximum, long defaultValue, Set<ParamFlags> flags) Creates a newGParamSpecInt64instance specifying aG_TYPE_INT64property.See g_param_spec_internal() for details on property names.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedminimum- minimum value for the property specifiedmaximum- maximum value for the property specifieddefaultValue- default value for the property specifiedflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecInt64
public static ParamSpec paramSpecInt64(String name, @Nullable String nick, @Nullable String blurb, long minimum, long maximum, long defaultValue, ParamFlags... flags) Creates a newGParamSpecInt64instance specifying aG_TYPE_INT64property.See g_param_spec_internal() for details on property names.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedminimum- minimum value for the property specifiedmaximum- maximum value for the property specifieddefaultValue- default value for the property specifiedflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecLong
public static ParamSpec paramSpecLong(String name, @Nullable String nick, @Nullable String blurb, int minimum, int maximum, int defaultValue, Set<ParamFlags> flags) Creates a newGParamSpecLonginstance specifying aG_TYPE_LONGproperty.See g_param_spec_internal() for details on property names.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedminimum- minimum value for the property specifiedmaximum- maximum value for the property specifieddefaultValue- default value for the property specifiedflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecLong
public static ParamSpec paramSpecLong(String name, @Nullable String nick, @Nullable String blurb, int minimum, int maximum, int defaultValue, ParamFlags... flags) Creates a newGParamSpecLonginstance specifying aG_TYPE_LONGproperty.See g_param_spec_internal() for details on property names.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedminimum- minimum value for the property specifiedmaximum- maximum value for the property specifieddefaultValue- default value for the property specifiedflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecObject
public static ParamSpec paramSpecObject(String name, @Nullable String nick, @Nullable String blurb, Type objectType, Set<ParamFlags> flags) Creates a newGParamSpecBoxedinstance specifying aG_TYPE_OBJECTderived property.See g_param_spec_internal() for details on property names.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedobjectType-G_TYPE_OBJECTderived type of this propertyflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecObject
public static ParamSpec paramSpecObject(String name, @Nullable String nick, @Nullable String blurb, Type objectType, ParamFlags... flags) Creates a newGParamSpecBoxedinstance specifying aG_TYPE_OBJECTderived property.See g_param_spec_internal() for details on property names.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedobjectType-G_TYPE_OBJECTderived type of this propertyflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecOverride
Creates a new property of typeGParamSpecOverride. 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.- Parameters:
name- the name of the property.overridden- The property that is being overridden- Returns:
- the newly created
GParamSpec - Since:
- 2.4
-
paramSpecParam
public static ParamSpec paramSpecParam(String name, @Nullable String nick, @Nullable String blurb, Type paramType, Set<ParamFlags> flags) Creates a newGParamSpecParaminstance specifying aG_TYPE_PARAMproperty.See g_param_spec_internal() for details on property names.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedparamType- aGTypederived fromG_TYPE_PARAMflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecParam
public static ParamSpec paramSpecParam(String name, @Nullable String nick, @Nullable String blurb, Type paramType, ParamFlags... flags) Creates a newGParamSpecParaminstance specifying aG_TYPE_PARAMproperty.See g_param_spec_internal() for details on property names.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedparamType- aGTypederived fromG_TYPE_PARAMflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecPointer
public static ParamSpec paramSpecPointer(String name, @Nullable String nick, @Nullable String blurb, Set<ParamFlags> flags) Creates a newGParamSpecPointerinstance 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.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecPointer
public static ParamSpec paramSpecPointer(String name, @Nullable String nick, @Nullable String blurb, ParamFlags... flags) Creates a newGParamSpecPointerinstance 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.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecString
public static ParamSpec paramSpecString(String name, @Nullable String nick, @Nullable String blurb, @Nullable String defaultValue, Set<ParamFlags> flags) Creates a newGParamSpecStringinstance.See g_param_spec_internal() for details on property names.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifieddefaultValue- default value for the property specifiedflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecString
public static ParamSpec paramSpecString(String name, @Nullable String nick, @Nullable String blurb, @Nullable String defaultValue, ParamFlags... flags) Creates a newGParamSpecStringinstance.See g_param_spec_internal() for details on property names.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifieddefaultValue- default value for the property specifiedflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecUchar
public static ParamSpec paramSpecUchar(String name, @Nullable String nick, @Nullable String blurb, byte minimum, byte maximum, byte defaultValue, Set<ParamFlags> flags) Creates a newGParamSpecUCharinstance specifying aG_TYPE_UCHARproperty.- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedminimum- minimum value for the property specifiedmaximum- maximum value for the property specifieddefaultValue- default value for the property specifiedflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecUchar
public static ParamSpec paramSpecUchar(String name, @Nullable String nick, @Nullable String blurb, byte minimum, byte maximum, byte defaultValue, ParamFlags... flags) Creates a newGParamSpecUCharinstance specifying aG_TYPE_UCHARproperty.- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedminimum- minimum value for the property specifiedmaximum- maximum value for the property specifieddefaultValue- default value for the property specifiedflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecUint
public static ParamSpec paramSpecUint(String name, @Nullable String nick, @Nullable String blurb, int minimum, int maximum, int defaultValue, Set<ParamFlags> flags) Creates a newGParamSpecUIntinstance specifying aG_TYPE_UINTproperty.See g_param_spec_internal() for details on property names.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedminimum- minimum value for the property specifiedmaximum- maximum value for the property specifieddefaultValue- default value for the property specifiedflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecUint
public static ParamSpec paramSpecUint(String name, @Nullable String nick, @Nullable String blurb, int minimum, int maximum, int defaultValue, ParamFlags... flags) Creates a newGParamSpecUIntinstance specifying aG_TYPE_UINTproperty.See g_param_spec_internal() for details on property names.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedminimum- minimum value for the property specifiedmaximum- maximum value for the property specifieddefaultValue- default value for the property specifiedflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecUint64
public static ParamSpec paramSpecUint64(String name, @Nullable String nick, @Nullable String blurb, long minimum, long maximum, long defaultValue, Set<ParamFlags> flags) Creates a newGParamSpecUInt64instance specifying aG_TYPE_UINT64property.See g_param_spec_internal() for details on property names.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedminimum- minimum value for the property specifiedmaximum- maximum value for the property specifieddefaultValue- default value for the property specifiedflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecUint64
public static ParamSpec paramSpecUint64(String name, @Nullable String nick, @Nullable String blurb, long minimum, long maximum, long defaultValue, ParamFlags... flags) Creates a newGParamSpecUInt64instance specifying aG_TYPE_UINT64property.See g_param_spec_internal() for details on property names.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedminimum- minimum value for the property specifiedmaximum- maximum value for the property specifieddefaultValue- default value for the property specifiedflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecUlong
public static ParamSpec paramSpecUlong(String name, @Nullable String nick, @Nullable String blurb, int minimum, int maximum, int defaultValue, Set<ParamFlags> flags) Creates a newGParamSpecULonginstance specifying aG_TYPE_ULONGproperty.See g_param_spec_internal() for details on property names.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedminimum- minimum value for the property specifiedmaximum- maximum value for the property specifieddefaultValue- default value for the property specifiedflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecUlong
public static ParamSpec paramSpecUlong(String name, @Nullable String nick, @Nullable String blurb, int minimum, int maximum, int defaultValue, ParamFlags... flags) Creates a newGParamSpecULonginstance specifying aG_TYPE_ULONGproperty.See g_param_spec_internal() for details on property names.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedminimum- minimum value for the property specifiedmaximum- maximum value for the property specifieddefaultValue- default value for the property specifiedflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecUnichar
public static ParamSpec paramSpecUnichar(String name, @Nullable String nick, @Nullable String blurb, int defaultValue, Set<ParamFlags> flags) Creates a newGParamSpecUnicharinstance specifying aG_TYPE_UINTproperty.GValuestructures 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.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifieddefaultValue- default value for the property specifiedflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecUnichar
public static ParamSpec paramSpecUnichar(String name, @Nullable String nick, @Nullable String blurb, int defaultValue, ParamFlags... flags) Creates a newGParamSpecUnicharinstance specifying aG_TYPE_UINTproperty.GValuestructures 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.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifieddefaultValue- default value for the property specifiedflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecValueArray
public static ParamSpec paramSpecValueArray(String name, @Nullable String nick, @Nullable String blurb, ParamSpec elementSpec, Set<ParamFlags> flags) Creates a newGParamSpecValueArrayinstance specifying aG_TYPE_VALUE_ARRAYproperty.G_TYPE_VALUE_ARRAYis aG_TYPE_BOXEDtype, as such,GValuestructures 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.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedelementSpec- aGParamSpecdescribing the elements contained in arrays of this property, may benullflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecValueArray
public static ParamSpec paramSpecValueArray(String name, @Nullable String nick, @Nullable String blurb, ParamSpec elementSpec, ParamFlags... flags) Creates a newGParamSpecValueArrayinstance specifying aG_TYPE_VALUE_ARRAYproperty.G_TYPE_VALUE_ARRAYis aG_TYPE_BOXEDtype, as such,GValuestructures 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.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedelementSpec- aGParamSpecdescribing the elements contained in arrays of this property, may benullflags- flags for the property specified- Returns:
- a newly created parameter specification
-
paramSpecVariant
public static ParamSpec paramSpecVariant(String name, @Nullable String nick, @Nullable String blurb, VariantType type, @Nullable Variant defaultValue, Set<ParamFlags> flags) Creates a newGParamSpecVariantinstance specifying aGVariantproperty.If
defaultValueis floating, it is consumed.See g_param_spec_internal() for details on property names.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedtype- aGVariantTypedefaultValue- aGVariantof typetypeto use as the default value, ornullflags- flags for the property specified- Returns:
- the newly created
GParamSpec - Since:
- 2.26
-
paramSpecVariant
public static ParamSpec paramSpecVariant(String name, @Nullable String nick, @Nullable String blurb, VariantType type, @Nullable Variant defaultValue, ParamFlags... flags) Creates a newGParamSpecVariantinstance specifying aGVariantproperty.If
defaultValueis floating, it is consumed.See g_param_spec_internal() for details on property names.
- Parameters:
name- canonical name of the property specifiednick- nick name for the property specifiedblurb- description of the property specifiedtype- aGVariantTypedefaultValue- aGVariantof typetypeto use as the default value, ornullflags- flags for the property specified- Returns:
- the newly created
GParamSpec - Since:
- 2.26
-
paramTypeRegisterStatic
Registersnameas the name of a new static type derived fromG_TYPE_PARAM.The type system uses the information contained in the
GParamSpecTypeInfostructure pointed to byinfoto manage theGParamSpectype and its instances.- Parameters:
name- 0-terminated string used as the name of the newGParamSpectype.pspecInfo- TheGParamSpecTypeInfofor thisGParamSpectype.- Returns:
- The new type identifier.
-
paramValueConvert
public static boolean paramValueConvert(ParamSpec pspec, Value srcValue, Value destValue, boolean strictValidation) TransformssrcValueintodestValueif possible, and then validatesdestValue,in order for it to conform topspec.IfstrictValidationistruethis function will only succeed if the transformeddestValuecomplied topspecwithout modifications.See also g_value_type_transformable(), g_value_transform() and g_param_value_validate().
- Parameters:
pspec- a validGParamSpecsrcValue- sourceGValuedestValue- destinationGValueof correct type forpspecstrictValidation-truerequiresdestValueto conform topspecwithout modifications- Returns:
trueif transformation and validation were successful,falseotherwise anddestValueis left untouched.
-
paramValueDefaults
-
paramValueIsValid
Return whether the contents ofvaluecomply with the specifications set out bypspec.- Parameters:
pspec- a validGParamSpecvalue- aGValueof correct type forpspec- Returns:
- whether the contents of
valuecomply with the specifications set out bypspec. - Since:
- 2.74
-
paramValueSetDefault
-
paramValueValidate
Ensures that the contents ofvaluecomply with the specifications set out bypspec.For example, aGParamSpecIntmight require that integers stored invaluemay not be smaller than -42 and not be greater than +42. Ifvaluecontains an integer outside of this range, it is modified accordingly, so the resulting value will fit into the range -42 .. +42.- Parameters:
pspec- a validGParamSpecvalue- aGValueof correct type forpspec- Returns:
- whether modifying
valuewas necessary to ensure validity
-
paramValuesCmp
Comparesvalue1withvalue2according topspec,and return -1, 0 or +1, ifvalue1is found to be less than, equal to or greater thanvalue2,respectively.- Parameters:
pspec- a validGParamSpecvalue1- aGValueof correct type forpspecvalue2- aGValueof correct type forpspec- Returns:
- -1, 0 or +1, for a less than, equal to or greater than result
-
pointerTypeRegisterStatic
-
signalAccumulatorFirstWins
public static boolean signalAccumulatorFirstWins(SignalInvocationHint ihint, Value returnAccu, Value handlerReturn, @Nullable MemorySegment dummy) A predefinedGSignalAccumulatorfor 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").
- Parameters:
ihint- standardGSignalAccumulatorparameterreturnAccu- standardGSignalAccumulatorparameterhandlerReturn- standardGSignalAccumulatorparameterdummy- standardGSignalAccumulatorparameter- Returns:
- standard
GSignalAccumulatorresult - Since:
- 2.28
-
signalAccumulatorTrueHandled
public static boolean signalAccumulatorTrueHandled(SignalInvocationHint ihint, Value returnAccu, Value handlerReturn, @Nullable MemorySegment dummy) A predefinedGSignalAccumulatorfor signals that return a boolean values. The behavior that this accumulator gives is that a return oftruestops the signal emission: no further callbacks will be invoked, while a return offalseallows the emission to continue. The idea here is that atruereturn indicates that the callback handled the signal, and no further handling is needed.- Parameters:
ihint- standardGSignalAccumulatorparameterreturnAccu- standardGSignalAccumulatorparameterhandlerReturn- standardGSignalAccumulatorparameterdummy- standardGSignalAccumulatorparameter- Returns:
- standard
GSignalAccumulatorresult - Since:
- 2.4
-
signalAddEmissionHook
public static int signalAddEmissionHook(int signalId, Quark detail, @Nullable 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 haveSignalFlags.NO_HOOKSflag set.- Parameters:
signalId- the signal identifier, as returned by g_signal_lookup().detail- the detail on which to call the hook.hookFunc- aGSignalEmissionHookfunction.- Returns:
- the hook id, for later use with g_signal_remove_emission_hook().
-
signalChainFromOverridden
public static void signalChainFromOverridden(@Nullable Value @Nullable [] instanceAndParams, Value returnValue) 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().- Parameters:
instanceAndParams- the argument list of the signal emission. The first element in the array is aGValuefor the instance the signal is being emitted on. The rest are any arguments to be passed to the signal.returnValue- Location for the return value.
-
signalChainFromOverriddenHandler
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().- Parameters:
instance- the instance the signal is being emitted on.varargs- parameters to be passed to the parent class closure, followed by a location for the return value. If the return type of the signal isG_TYPE_NONE, the return value location can be omitted.- Since:
- 2.18
-
signalConnectClosure
public static int signalConnectClosure(GObject instance, String detailedSignal, Closure closure, boolean after) Connects a closure to a signal for a particular object.If
closureis a floating reference (see g_closure_sink()), this function takes ownership ofclosure.This function cannot fail. If the given signal name doesn’t exist, a critical warning is emitted. No validation is performed on the ‘detail’ string when specified in
detailedSignal,other than a non-empty check.Refer to the signals documentation for more details.
- Parameters:
instance- the instance to connect to.detailedSignal- a string of the form "signal-name::detail".closure- the closure to connect.after- whether the handler should be called before or after the default handler of the signal.- Returns:
- the handler ID (always greater than 0)
-
signalConnectClosureById
public static int signalConnectClosureById(GObject instance, int signalId, Quark detail, Closure closure, boolean after) Connects a closure to a signal for a particular object.If
closureis a floating reference (see g_closure_sink()), this function takes ownership ofclosure.This function cannot fail. If the given signal name doesn’t exist, a critical warning is emitted. No validation is performed on the ‘detail’ string when specified in
detailedSignal,other than a non-empty check.Refer to the signals documentation for more details.
- Parameters:
instance- the instance to connect to.signalId- the id of the signal.detail- the detail.closure- the closure to connect.after- whether the handler should be called before or after the default handler of the signal.- Returns:
- the handler ID (always greater than 0)
-
signalConnectData
public static int signalConnectData(GObject instance, String detailedSignal, @Nullable Callback cHandler, @Nullable ClosureNotify destroyData, Set<ConnectFlags> connectFlags) Connects aGCallbackfunction to a signal for a particular object. Similar to g_signal_connect(), but allows to provide aGClosureNotifyfor the data which will be called when the signal handler is disconnected and no longer used. SpecifyconnectFlagsif you need..._after()or..._swapped()variants of this function.This function cannot fail. If the given signal name doesn’t exist, a critical warning is emitted. No validation is performed on the ‘detail’ string when specified in
detailedSignal,other than a non-empty check.Refer to the signals documentation for more details.
- Parameters:
instance- the instance to connect to.detailedSignal- a string of the form "signal-name::detail".cHandler- theGCallbackto connect.destroyData- aGClosureNotifyfordata.connectFlags- a combination ofGConnectFlags.- Returns:
- the handler ID (always greater than 0)
-
signalConnectData
public static int signalConnectData(GObject instance, String detailedSignal, @Nullable Callback cHandler, @Nullable ClosureNotify destroyData, ConnectFlags... connectFlags) Connects aGCallbackfunction to a signal for a particular object. Similar to g_signal_connect(), but allows to provide aGClosureNotifyfor the data which will be called when the signal handler is disconnected and no longer used. SpecifyconnectFlagsif you need..._after()or..._swapped()variants of this function.This function cannot fail. If the given signal name doesn’t exist, a critical warning is emitted. No validation is performed on the ‘detail’ string when specified in
detailedSignal,other than a non-empty check.Refer to the signals documentation for more details.
- Parameters:
instance- the instance to connect to.detailedSignal- a string of the form "signal-name::detail".cHandler- theGCallbackto connect.destroyData- aGClosureNotifyfordata.connectFlags- a combination ofGConnectFlags.- Returns:
- the handler ID (always greater than 0)
-
signalConnectObject
public static int signalConnectObject(TypeInstance instance, String detailedSignal, @Nullable Callback cHandler, @Nullable GObject gobject, Set<ConnectFlags> connectFlags) This is similar to g_signal_connect_data(), but uses a closure which ensures that thegobjectstays alive during the call tocHandlerby temporarily adding a reference count togobject.When the
gobjectis destroyed the signal handler will be automatically disconnected. Note that this is not currently threadsafe (ie: emitting a signal whilegobjectis being destroyed in another thread is not safe).This function cannot fail. If the given signal name doesn’t exist, a critical warning is emitted. No validation is performed on the "detail" string when specified in
detailedSignal,other than a non-empty check.Refer to the signals documentation for more details.
- Parameters:
instance- the instance to connect to.detailedSignal- a string of the form "signal-name::detail".cHandler- theGCallbackto connect.gobject- the object to pass as data tocHandler.connectFlags- a combination ofGConnectFlags.- Returns:
- the handler id.
-
signalConnectObject
public static int signalConnectObject(TypeInstance instance, String detailedSignal, @Nullable Callback cHandler, @Nullable GObject gobject, ConnectFlags... connectFlags) This is similar to g_signal_connect_data(), but uses a closure which ensures that thegobjectstays alive during the call tocHandlerby temporarily adding a reference count togobject.When the
gobjectis destroyed the signal handler will be automatically disconnected. Note that this is not currently threadsafe (ie: emitting a signal whilegobjectis being destroyed in another thread is not safe).This function cannot fail. If the given signal name doesn’t exist, a critical warning is emitted. No validation is performed on the "detail" string when specified in
detailedSignal,other than a non-empty check.Refer to the signals documentation for more details.
- Parameters:
instance- the instance to connect to.detailedSignal- a string of the form "signal-name::detail".cHandler- theGCallbackto connect.gobject- the object to pass as data tocHandler.connectFlags- a combination ofGConnectFlags.- Returns:
- the handler id.
-
signalEmit
Emits a signal. Signal emission is done synchronously. The method will only return control after all handlers are called or signal emission was stopped.Note that g_signal_emit() resets the return value to the default if no handlers are connected, in contrast to g_signal_emitv().
- Parameters:
instance- the instance the signal is being emitted on.signalId- the signal iddetail- the detailvarargs- parameters to be passed to the signal, followed by a location for the return value. If the return type of the signal isG_TYPE_NONE, the return value location can be omitted.
-
signalEmitByName
Emits a signal. Signal emission is done synchronously. The method will only return control after all handlers are called or signal emission was stopped.Note that g_signal_emit_by_name() resets the return value to the default if no handlers are connected, in contrast to g_signal_emitv().
- Parameters:
instance- the instance the signal is being emitted on.detailedSignal- a string of the form "signal-name::detail".varargs- parameters to be passed to the signal, followed by a location for the return value. If the return type of the signal isG_TYPE_NONE, the return value location can be omitted. The number of parameters to pass to this function is defined when creating the signal.
-
signalEmitv
public static void signalEmitv(@Nullable Value @Nullable [] instanceAndParams, int signalId, Quark detail, @Nullable Value returnValue) Emits a signal. Signal emission is done synchronously. The method will only return control after all handlers are called or signal emission was stopped.Note that g_signal_emitv() doesn't change
returnValueif no handlers are connected, in contrast to g_signal_emit() and g_signal_emit_valist().- Parameters:
instanceAndParams- argument list for the signal emission. The first element in the array is aGValuefor the instance the signal is being emitted on. The rest are any arguments to be passed to the signal.signalId- the signal iddetail- the detailreturnValue- Location to store the return value of the signal emission. This must be provided if the specified signal returns a value, but may be ignored otherwise.
-
signalGetInvocationHint
Returns the invocation hint of the innermost signal emission of instance.- Parameters:
instance- the instance to query- Returns:
- the invocation hint of the innermost
signal emission, or
nullif not found.
-
signalHandlerBlock
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 handler has to be unblocked exactly the same amount of times it has been blocked before to become active again.The
handlerIdhas to be a valid signal handler id, connected to a signal ofinstance.- Parameters:
instance- The instance to block the signal handler of.handlerId- Handler id of the handler to be blocked.
-
signalHandlerDisconnect
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. ThehandlerIdbecomes invalid and may be reused.The
handlerIdhas to be a valid signal handler id, connected to a signal ofinstance.- Parameters:
instance- The instance to remove the signal handler from.handlerId- Handler id of the handler to be disconnected.
-
signalHandlerFind
public static int signalHandlerFind(GObject instance, Set<SignalMatchType> mask, int signalId, Quark detail, @Nullable Closure closure, @Nullable MemorySegment func, @Nullable MemorySegment data) Finds the first signal handler that matches certain selection criteria. The criteria mask is passed as an OR-ed combination ofGSignalMatchTypeflags, and the criteria values are passed as arguments. The matchmaskhas to be non-0 for successful matches. If no handler was found, 0 is returned.- Parameters:
instance- The instance owning the signal handler to be found.mask- Mask indicating which ofsignalId,detail,closure,funcand/ordatathe handler has to match.signalId- Signal the handler has to be connected to.detail- Signal detail the handler has to be connected to.closure- The closure the handler will invoke.func- The C closure callback of the handler (useless for non-C closures).data- The closure data of the handler's closure.- Returns:
- A valid non-0 signal handler id for a successful match.
-
signalHandlerFind
public static int signalHandlerFind(GObject instance, SignalMatchType mask, int signalId, Quark detail, @Nullable Closure closure, @Nullable MemorySegment func, @Nullable MemorySegment data) Finds the first signal handler that matches certain selection criteria. The criteria mask is passed as an OR-ed combination ofGSignalMatchTypeflags, and the criteria values are passed as arguments. The matchmaskhas to be non-0 for successful matches. If no handler was found, 0 is returned.- Parameters:
instance- The instance owning the signal handler to be found.mask- Mask indicating which ofsignalId,detail,closure,funcand/ordatathe handler has to match.signalId- Signal the handler has to be connected to.detail- Signal detail the handler has to be connected to.closure- The closure the handler will invoke.func- The C closure callback of the handler (useless for non-C closures).data- The closure data of the handler's closure.- Returns:
- A valid non-0 signal handler id for a successful match.
-
signalHandlerIsConnected
Returns whetherhandlerIdis the ID of a handler connected toinstance.- Parameters:
instance- The instance where a signal handler is sought.handlerId- the handler ID.- Returns:
- whether
handlerIdidentifies a handler connected toinstance.
-
signalHandlerUnblock
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
handlerIdhas to be a valid id of a signal handler that is connected to a signal ofinstanceand is currently blocked.- Parameters:
instance- The instance to unblock the signal handler of.handlerId- Handler id of the handler to be unblocked.
-
signalHandlersBlockMatched
public static int signalHandlersBlockMatched(GObject instance, Set<SignalMatchType> mask, int signalId, Quark detail, @Nullable Closure closure, @Nullable MemorySegment func, @Nullable MemorySegment data) Blocks all handlers on an instance that match a certain selection criteria.The criteria mask is passed as a combination of
GSignalMatchTypeflags, and the criteria values are passed as arguments. A handler must match on all flags set inmaskto be blocked (i.e. the match is conjunctive).Passing at least one of the
SignalMatchType.ID,SignalMatchType.CLOSURE,SignalMatchType.FUNCorSignalMatchType.DATAmatch flags is required for successful matches. If no handlers were found, 0 is returned, the number of blocked handlers otherwise.Support for
SignalMatchType.IDwas added in GLib 2.78.- Parameters:
instance- The instance to block handlers from.mask- Mask indicating which ofsignalId,detail,closure,funcand/ordatathe handlers have to match.signalId- Signal the handlers have to be connected to.detail- Signal detail the handlers have to be connected to.closure- The closure the handlers will invoke.func- The C closure callback of the handlers (useless for non-C closures).data- The closure data of the handlers' closures.- Returns:
- The number of handlers that matched.
-
signalHandlersBlockMatched
public static int signalHandlersBlockMatched(GObject instance, SignalMatchType mask, int signalId, Quark detail, @Nullable Closure closure, @Nullable MemorySegment func, @Nullable MemorySegment data) Blocks all handlers on an instance that match a certain selection criteria.The criteria mask is passed as a combination of
GSignalMatchTypeflags, and the criteria values are passed as arguments. A handler must match on all flags set inmaskto be blocked (i.e. the match is conjunctive).Passing at least one of the
SignalMatchType.ID,SignalMatchType.CLOSURE,SignalMatchType.FUNCorSignalMatchType.DATAmatch flags is required for successful matches. If no handlers were found, 0 is returned, the number of blocked handlers otherwise.Support for
SignalMatchType.IDwas added in GLib 2.78.- Parameters:
instance- The instance to block handlers from.mask- Mask indicating which ofsignalId,detail,closure,funcand/ordatathe handlers have to match.signalId- Signal the handlers have to be connected to.detail- Signal detail the handlers have to be connected to.closure- The closure the handlers will invoke.func- The C closure callback of the handlers (useless for non-C closures).data- The closure data of the handlers' closures.- Returns:
- The number of handlers that matched.
-
signalHandlersDestroy
Destroy all signal handlers of a type instance. This function is an implementation detail of theGObjectdispose implementation, and should not be used outside of the type system.- Parameters:
instance- The instance whose signal handlers are destroyed
-
signalHandlersDisconnectMatched
public static int signalHandlersDisconnectMatched(GObject instance, Set<SignalMatchType> mask, int signalId, Quark detail, @Nullable Closure closure, @Nullable MemorySegment func, @Nullable MemorySegment data) Disconnects all handlers on an instance that match a certain selection criteria.The criteria mask is passed as a combination of
GSignalMatchTypeflags, and the criteria values are passed as arguments. A handler must match on all flags set inmaskto be disconnected (i.e. the match is conjunctive).Passing at least one of the
SignalMatchType.ID,SignalMatchType.CLOSURE,SignalMatchType.FUNCorSignalMatchType.DATAmatch flags is required for successful matches. If no handlers were found, 0 is returned, the number of disconnected handlers otherwise.Support for
SignalMatchType.IDwas added in GLib 2.78.- Parameters:
instance- The instance to remove handlers from.mask- Mask indicating which ofsignalId,detail,closure,funcand/ordatathe handlers have to match.signalId- Signal the handlers have to be connected to.detail- Signal detail the handlers have to be connected to.closure- The closure the handlers will invoke.func- The C closure callback of the handlers (useless for non-C closures).data- The closure data of the handlers' closures.- Returns:
- The number of handlers that matched.
-
signalHandlersDisconnectMatched
public static int signalHandlersDisconnectMatched(GObject instance, SignalMatchType mask, int signalId, Quark detail, @Nullable Closure closure, @Nullable MemorySegment func, @Nullable MemorySegment data) Disconnects all handlers on an instance that match a certain selection criteria.The criteria mask is passed as a combination of
GSignalMatchTypeflags, and the criteria values are passed as arguments. A handler must match on all flags set inmaskto be disconnected (i.e. the match is conjunctive).Passing at least one of the
SignalMatchType.ID,SignalMatchType.CLOSURE,SignalMatchType.FUNCorSignalMatchType.DATAmatch flags is required for successful matches. If no handlers were found, 0 is returned, the number of disconnected handlers otherwise.Support for
SignalMatchType.IDwas added in GLib 2.78.- Parameters:
instance- The instance to remove handlers from.mask- Mask indicating which ofsignalId,detail,closure,funcand/ordatathe handlers have to match.signalId- Signal the handlers have to be connected to.detail- Signal detail the handlers have to be connected to.closure- The closure the handlers will invoke.func- The C closure callback of the handlers (useless for non-C closures).data- The closure data of the handlers' closures.- Returns:
- The number of handlers that matched.
-
signalHandlersUnblockMatched
public static int signalHandlersUnblockMatched(GObject instance, Set<SignalMatchType> mask, int signalId, Quark detail, @Nullable Closure closure, @Nullable MemorySegment func, @Nullable MemorySegment data) Unblocks all handlers on an instance that match a certain selection criteria.The criteria mask is passed as a combination of
GSignalMatchTypeflags, and the criteria values are passed as arguments. A handler must match on all flags set inmaskto be unblocked (i.e. the match is conjunctive).Passing at least one of the
SignalMatchType.ID,SignalMatchType.CLOSURE,SignalMatchType.FUNCorSignalMatchType.DATAmatch 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.Support for
SignalMatchType.IDwas added in GLib 2.78.- Parameters:
instance- The instance to unblock handlers from.mask- Mask indicating which ofsignalId,detail,closure,funcand/ordatathe handlers have to match.signalId- Signal the handlers have to be connected to.detail- Signal detail the handlers have to be connected to.closure- The closure the handlers will invoke.func- The C closure callback of the handlers (useless for non-C closures).data- The closure data of the handlers' closures.- Returns:
- The number of handlers that matched.
-
signalHandlersUnblockMatched
public static int signalHandlersUnblockMatched(GObject instance, SignalMatchType mask, int signalId, Quark detail, @Nullable Closure closure, @Nullable MemorySegment func, @Nullable MemorySegment data) Unblocks all handlers on an instance that match a certain selection criteria.The criteria mask is passed as a combination of
GSignalMatchTypeflags, and the criteria values are passed as arguments. A handler must match on all flags set inmaskto be unblocked (i.e. the match is conjunctive).Passing at least one of the
SignalMatchType.ID,SignalMatchType.CLOSURE,SignalMatchType.FUNCorSignalMatchType.DATAmatch 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.Support for
SignalMatchType.IDwas added in GLib 2.78.- Parameters:
instance- The instance to unblock handlers from.mask- Mask indicating which ofsignalId,detail,closure,funcand/ordatathe handlers have to match.signalId- Signal the handlers have to be connected to.detail- Signal detail the handlers have to be connected to.closure- The closure the handlers will invoke.func- The C closure callback of the handlers (useless for non-C closures).data- The closure data of the handlers' closures.- Returns:
- The number of handlers that matched.
-
signalHasHandlerPending
public static boolean signalHasHandlerPending(GObject instance, int signalId, Quark detail, boolean mayBeBlocked) Returns whether there are any handlers connected toinstancefor the given signal id and detail.If
detailis 0 then it will only match handlers that were connected without detail. Ifdetailis non-zero then it will match handlers connected both without detail and with the given detail. This is consistent with how a signal emitted withdetailwould 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.
- Parameters:
instance- the object whose signal handlers are sought.signalId- the signal id.detail- the detail.mayBeBlocked- whether blocked handlers should count as match.- Returns:
trueif a handler is connected to the signal,falseotherwise.
-
signalIsValidName
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.See
signalNew(java.lang.String, org.gnome.glib.Type, java.util.Set<org.gnome.gobject.SignalFlags>, int, org.gnome.gobject.SignalAccumulator, org.gnome.gobject.SignalCMarshaller, org.gnome.glib.Type, int, java.lang.Object...)for details of the rules for valid names. The rules for signal names are the same as those for property names.- Parameters:
name- the canonical name of the signal- Returns:
trueifnameis a valid signal name,falseotherwise.- Since:
- 2.66
-
signalListIds
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().- Parameters:
itype- Instance or interface type.- Returns:
- Newly allocated array of signal IDs.
-
signalLookup
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
itypemust 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.
- Parameters:
name- the signal's name.itype- the type that the signal operates on.- Returns:
- the signal's identifying number, or 0 if no signal was found.
-
signalName
Given the signal's identifier, finds its name.Two different signals may have the same name, if they have differing types.
- Parameters:
signalId- the signal's identifying number.- Returns:
- the signal name, or
nullif the signal number was invalid.
-
signalNew
public static int signalNew(String signalName, Type itype, Set<SignalFlags> signalFlags, int classOffset, @Nullable SignalAccumulator accumulator, @Nullable SignalCMarshaller cMarshaller, Type returnType, int nParams, Object... varargs) Creates a new signal. (This is usually done in the class initializer.)A signal name consists of segments consisting of ASCII letters and digits, separated by either the
-or_character. The first character of a signal name must be a letter. Names which violate these rules lead to undefined behaviour. These are the same rules as for property naming (see g_param_spec_internal()).When registering a signal and looking up a signal, either separator can be used, but they cannot be mixed. Using
-is considerably more efficient. Using_is discouraged.If 0 is used for
classOffsetsubclasses cannot override the class handler in their class_init method by doing super_class->signal_handler = my_signal_handler. Instead they will have to use g_signal_override_class_handler().If
cMarshallerisnull, g_cclosure_marshal_generic() will be used as the marshaller for this signal. In some simple cases, g_signal_new() will use a more optimized c_marshaller and va_marshaller for the signal instead of g_cclosure_marshal_generic().If
cMarshalleris non-null, you need to also specify a va_marshaller using g_signal_set_va_marshaller() or the generic va_marshaller will be used.- Parameters:
signalName- the name for the signalitype- the type this signal pertains to. It will also pertain to types which are derived from this type.signalFlags- a combination ofGSignalFlagsspecifying detail of when the default handler is to be invoked. You should at least specifySignalFlags.RUN_FIRSTorSignalFlags.RUN_LAST.classOffset- The offset of the function pointer in the class structure for this type. Used to invoke a class method generically. Pass 0 to not associate a class method slot with this signal.accumulator- the accumulator for this signal; may benull.cMarshaller- the function to translate arrays of parameter values to signal emissions into C language callback invocations ornull.returnType- the type of return value, orG_TYPE_NONEfor a signal without a return value.nParams- the number of parameter types to follow.varargs- a list of types, one for each parameter.- Returns:
- the signal id
-
signalNew
public static int signalNew(String signalName, Type itype, SignalFlags signalFlags, int classOffset, @Nullable SignalAccumulator accumulator, @Nullable SignalCMarshaller cMarshaller, Type returnType, int nParams, Object... varargs) Creates a new signal. (This is usually done in the class initializer.)A signal name consists of segments consisting of ASCII letters and digits, separated by either the
-or_character. The first character of a signal name must be a letter. Names which violate these rules lead to undefined behaviour. These are the same rules as for property naming (see g_param_spec_internal()).When registering a signal and looking up a signal, either separator can be used, but they cannot be mixed. Using
-is considerably more efficient. Using_is discouraged.If 0 is used for
classOffsetsubclasses cannot override the class handler in their class_init method by doing super_class->signal_handler = my_signal_handler. Instead they will have to use g_signal_override_class_handler().If
cMarshallerisnull, g_cclosure_marshal_generic() will be used as the marshaller for this signal. In some simple cases, g_signal_new() will use a more optimized c_marshaller and va_marshaller for the signal instead of g_cclosure_marshal_generic().If
cMarshalleris non-null, you need to also specify a va_marshaller using g_signal_set_va_marshaller() or the generic va_marshaller will be used.- Parameters:
signalName- the name for the signalitype- the type this signal pertains to. It will also pertain to types which are derived from this type.signalFlags- a combination ofGSignalFlagsspecifying detail of when the default handler is to be invoked. You should at least specifySignalFlags.RUN_FIRSTorSignalFlags.RUN_LAST.classOffset- The offset of the function pointer in the class structure for this type. Used to invoke a class method generically. Pass 0 to not associate a class method slot with this signal.accumulator- the accumulator for this signal; may benull.cMarshaller- the function to translate arrays of parameter values to signal emissions into C language callback invocations ornull.returnType- the type of return value, orG_TYPE_NONEfor a signal without a return value.nParams- the number of parameter types to follow.varargs- a list of types, one for each parameter.- Returns:
- the signal id
-
signalNewClassHandler
public static int signalNewClassHandler(String signalName, Type itype, Set<SignalFlags> signalFlags, @Nullable Callback classHandler, @Nullable SignalAccumulator accumulator, @Nullable SignalCMarshaller cMarshaller, Type returnType, int nParams, Object... varargs) Creates a new signal. (This is usually done in the class initializer.)This is a variant of g_signal_new() that takes a C callback instead of a class offset for the signal's class handler. This function doesn't need a function pointer exposed in the class structure of an object definition, instead the function pointer is passed directly and can be overridden by derived classes with g_signal_override_class_closure() or g_signal_override_class_handler() and chained to with g_signal_chain_from_overridden() or g_signal_chain_from_overridden_handler().
See g_signal_new() for information about signal names.
If c_marshaller is
null, g_cclosure_marshal_generic() will be used as the marshaller for this signal.- Parameters:
signalName- the name for the signalitype- the type this signal pertains to. It will also pertain to types which are derived from this type.signalFlags- a combination ofGSignalFlagsspecifying detail of when the default handler is to be invoked. You should at least specifySignalFlags.RUN_FIRSTorSignalFlags.RUN_LAST.classHandler- aGCallbackwhich acts as class implementation of this signal. Used to invoke a class method generically. Passnullto not associate a class method with this signal.accumulator- the accumulator for this signal; may benull.cMarshaller- the function to translate arrays of parameter values to signal emissions into C language callback invocations ornull.returnType- the type of return value, orG_TYPE_NONEfor a signal without a return value.nParams- the number of parameter types to follow.varargs- a list of types, one for each parameter.- Returns:
- the signal id
- Since:
- 2.18
-
signalNewClassHandler
public static int signalNewClassHandler(String signalName, Type itype, SignalFlags signalFlags, @Nullable Callback classHandler, @Nullable SignalAccumulator accumulator, @Nullable SignalCMarshaller cMarshaller, Type returnType, int nParams, Object... varargs) Creates a new signal. (This is usually done in the class initializer.)This is a variant of g_signal_new() that takes a C callback instead of a class offset for the signal's class handler. This function doesn't need a function pointer exposed in the class structure of an object definition, instead the function pointer is passed directly and can be overridden by derived classes with g_signal_override_class_closure() or g_signal_override_class_handler() and chained to with g_signal_chain_from_overridden() or g_signal_chain_from_overridden_handler().
See g_signal_new() for information about signal names.
If c_marshaller is
null, g_cclosure_marshal_generic() will be used as the marshaller for this signal.- Parameters:
signalName- the name for the signalitype- the type this signal pertains to. It will also pertain to types which are derived from this type.signalFlags- a combination ofGSignalFlagsspecifying detail of when the default handler is to be invoked. You should at least specifySignalFlags.RUN_FIRSTorSignalFlags.RUN_LAST.classHandler- aGCallbackwhich acts as class implementation of this signal. Used to invoke a class method generically. Passnullto not associate a class method with this signal.accumulator- the accumulator for this signal; may benull.cMarshaller- the function to translate arrays of parameter values to signal emissions into C language callback invocations ornull.returnType- the type of return value, orG_TYPE_NONEfor a signal without a return value.nParams- the number of parameter types to follow.varargs- a list of types, one for each parameter.- Returns:
- the signal id
- Since:
- 2.18
-
signalNewv
public static int signalNewv(String signalName, Type itype, Set<SignalFlags> signalFlags, @Nullable Closure classClosure, @Nullable SignalAccumulator accumulator, @Nullable SignalCMarshaller cMarshaller, Type returnType, @Nullable Type @Nullable [] paramTypes) 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
null, g_cclosure_marshal_generic() will be used as the marshaller for this signal.- Parameters:
signalName- the name for the signalitype- the type this signal pertains to. It will also pertain to types which are derived from this typesignalFlags- a combination ofGSignalFlagsspecifying detail of when the default handler is to be invoked. You should at least specifySignalFlags.RUN_FIRSTorSignalFlags.RUN_LASTclassClosure- The closure to invoke on signal emission; may benullaccumulator- the accumulator for this signal; may benullcMarshaller- the function to translate arrays of parameter values to signal emissions into C language callback invocations ornullreturnType- the type of return value, orG_TYPE_NONEfor a signal without a return valueparamTypes- an array of types, one for each parameter (may benullifnParamsis zero)- Returns:
- the signal id
-
signalNewv
public static int signalNewv(String signalName, Type itype, SignalFlags signalFlags, @Nullable Closure classClosure, @Nullable SignalAccumulator accumulator, @Nullable SignalCMarshaller cMarshaller, Type returnType, @Nullable Type @Nullable [] paramTypes) 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
null, g_cclosure_marshal_generic() will be used as the marshaller for this signal.- Parameters:
signalName- the name for the signalitype- the type this signal pertains to. It will also pertain to types which are derived from this typesignalFlags- a combination ofGSignalFlagsspecifying detail of when the default handler is to be invoked. You should at least specifySignalFlags.RUN_FIRSTorSignalFlags.RUN_LASTclassClosure- The closure to invoke on signal emission; may benullaccumulator- the accumulator for this signal; may benullcMarshaller- the function to translate arrays of parameter values to signal emissions into C language callback invocations ornullreturnType- the type of return value, orG_TYPE_NONEfor a signal without a return valueparamTypes- an array of types, one for each parameter (may benullifnParamsis zero)- Returns:
- the signal id
-
signalOverrideClassClosure
public static void signalOverrideClassClosure(int signalId, Type instanceType, Closure classClosure) Overrides the class closure (i.e. the default handler) for the given signal for emissions on instances ofinstanceType.instanceTypemust 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.
- Parameters:
signalId- the signal idinstanceType- the instance type on which to override the class closure for the signal.classClosure- the closure.
-
signalOverrideClassHandler
public static void signalOverrideClassHandler(String signalName, Type instanceType, @Nullable Callback classHandler) Overrides the class closure (i.e. the default handler) for the given signal for emissions on instances ofinstanceTypewith callbackclassHandler.instanceTypemust 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.
- Parameters:
signalName- the name for the signalinstanceType- the instance type on which to override the class handler for the signal.classHandler- the handler.- Since:
- 2.18
-
signalParseName
public static boolean signalParseName(String detailedSignal, Type itype, Out<Integer> signalIdP, Quark detailP, boolean forceDetailQuark) Internal function to parse a signal name into itssignalIdanddetailquark.- Parameters:
detailedSignal- a string of the form "signal-name::detail".itype- The interface/instance type that introduced "signal-name".signalIdP- Location to store the signal id.detailP- Location to store the detail quark.forceDetailQuark-trueforces creation of aGQuarkfor the detail.- Returns:
- Whether the signal name could successfully be parsed and
signalIdPanddetailPcontain valid return values.
-
signalQuery
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, thesignalIdmember of theGSignalQueryis 0. All members filled into theGSignalQuerystructure should be considered constant and have to be left untouched.- Parameters:
signalId- The signal id of the signal to query information for.query- A user provided structure that is filled in with constant values upon success.
-
signalRemoveEmissionHook
public static void signalRemoveEmissionHook(int signalId, int hookId) Deletes an emission hook.- Parameters:
signalId- the id of the signalhookId- the id of the emission hook, as returned by g_signal_add_emission_hook()
-
signalStopEmission
Stops a signal's current emission.This will prevent the default method from running, if the signal was
SignalFlags.RUN_LASTand you connected normally (i.e. without the "after" flag).Prints a warning if used on a signal which isn't being emitted.
- Parameters:
instance- the object whose signal handlers you wish to stop.signalId- the signal identifier, as returned by g_signal_lookup().detail- the detail which the signal was emitted with.
-
signalStopEmissionByName
Stops a signal's current emission.This is just like g_signal_stop_emission() except it will look up the signal id for you.
- Parameters:
instance- the object whose signal handlers you wish to stop.detailedSignal- a string of the form "signal-name::detail".
-
signalTypeCclosureNew
Creates a new closure which invokes the function found at the offsetstructOffsetin the class structure of the interface or classed type identified byitype.- Parameters:
itype- theGTypeidentifier of an interface or classed typestructOffset- the offset of the member function ofitype'sclass structure which is to be invoked by the new closure- Returns:
- a floating reference to a new
GCClosure
-
strdupValueContents
Return a newly allocated string, which describes the contents of aGValue. The main purpose of this function is to describeGValuecontents for debugging output, the way in which the contents are described may change between different GLib versions.- Parameters:
value-GValuewhich contents are to be described.- Returns:
- Newly allocated string.
-
typeAddClassCacheFunc
public static void typeAddClassCacheFunc(@Nullable MemorySegment cacheData, @Nullable TypeClassCacheFunc cacheFunc) Adds aGTypeClassCacheFuncto be called before the reference count of a class goes from one to zero. This can be used to prevent premature class destruction. All installedGTypeClassCacheFuncfunctions will be chained until one of them returnstrue. 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 sameGTypeClassCacheFuncchain.- Parameters:
cacheData- data to be passed tocacheFunccacheFunc- aGTypeClassCacheFunc
-
typeAddClassPrivate
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.
- Parameters:
classType- GType of a classed typeprivateSize- size of private structure- Since:
- 2.24
-
typeAddInstancePrivate
-
typeAddInterfaceCheck
public static void typeAddInterfaceCheck(@Nullable MemorySegment checkData, @Nullable TypeInterfaceCheckFunc checkFunc) Adds a function to be called after an interface vtable is initialized for any class (i.e. after theinterfaceInitmember ofGInterfaceInfohas 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
GObjectuses this facility to check that an object implements all of the properties that are defined on its interfaces.- Parameters:
checkData- data to pass tocheckFunccheckFunc- function to be called after each interface is initialized- Since:
- 2.4
-
typeAddInterfaceDynamic
public static void typeAddInterfaceDynamic(Type instanceType, Type interfaceType, TypePlugin plugin) AddsinterfaceTypeto the dynamicinstanceType.The information contained in theGTypePluginstructure pointed to bypluginis used to manage the relationship.- Parameters:
instanceType-GTypevalue of an instantiatable typeinterfaceType-GTypevalue of an interface typeplugin-GTypePluginstructure to retrieve theGInterfaceInfofrom
-
typeAddInterfaceStatic
public static void typeAddInterfaceStatic(Type instanceType, Type interfaceType, InterfaceInfo info) AddsinterfaceTypeto the staticinstanceType.The information contained in theGInterfaceInfostructure pointed to byinfois used to manage the relationship.- Parameters:
instanceType-GTypevalue of an instantiatable typeinterfaceType-GTypevalue of an interface typeinfo-GInterfaceInfostructure for this (instanceType,interfaceType)combination
-
typeCheckClassCast
-
typeCheckClassIsA
-
typeCheckInstance
Private helper function to aid implementation of the G_TYPE_CHECK_INSTANCE() macro.- Parameters:
instance- a validGTypeInstancestructure- Returns:
trueifinstanceis valid,falseotherwise
-
typeCheckInstanceCast
-
typeCheckInstanceIsA
-
typeCheckInstanceIsFundamentallyA
public static boolean typeCheckInstanceIsFundamentallyA(TypeInstance instance, Type fundamentalType) -
typeCheckIsValueType
-
typeCheckValue
-
typeCheckValueHolds
-
typeChildren
-
typeCreateInstance
Creates and initializes an instance oftypeiftypeis 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 implementers of fundamental types only. E.g. instances of theGObjecthierarchy 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.
- Parameters:
type- an instantiatable type to create an instance for- Returns:
- an allocated and initialized instance, subject to further treatment by the fundamental type implementation
-
typeDefaultInterfaceGet
Returns the default interface vtable for the givengType.If the type is not currently in use, then the default vtable for the type will be created and initialized by calling the base interface init and default vtable init functions for the type (the
baseInitandclassInitmembers ofGTypeInfo).If you don't want to create the interface vtable, you should use g_type_default_interface_peek() instead.
Calling g_type_default_interface_get() is useful when you want to make sure that signals and properties for an interface have been installed.
- Parameters:
gType- an interface type- Returns:
- the default vtable for the interface.
- Since:
- 2.84
-
typeDefaultInterfacePeek
If the interface typegTypeis currently in use, returns its default interface vtable.- Parameters:
gType- an interface type- Returns:
- the default
vtable for the interface, or
nullif the type is not currently in use - Since:
- 2.4
-
typeDefaultInterfaceRef
Deprecated.Use g_type_default_interface_get() insteadIncrements the reference count for the interface typegType,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 initialized by calling the base interface init and default vtable init functions for the type (the
baseInitandclassInitmembers ofGTypeInfo). Calling g_type_default_interface_ref() is useful when you want to make sure that signals and properties for an interface have been installed.- Parameters:
gType- an interface type- Returns:
- the default vtable for the interface; call g_type_default_interface_unref() when you are done using the interface.
- Since:
- 2.4
-
typeDefaultInterfaceUnref
Deprecated.Interface reference counting has been removed and interface types now cannot be finalized. This function no longer does anything.Decrements the reference count for the type corresponding to the interface default vtablegIface.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
classFinalizemember ofGTypeInfo) will be called.- Parameters:
gIface- the default vtable structure for an interface, as returned by g_type_default_interface_ref()- Since:
- 2.4
-
typeDepth
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.- Parameters:
type- aGType- Returns:
- the depth of
type
-
typeEnsure
Ensures that the indicatedtypehas 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_CONSTfor performance reasons, even though this is technically incorrect (sinceG_GNUC_CONSTrequires 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.- Parameters:
type- aGType- Since:
- 2.34
-
typeFreeInstance
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.
- Parameters:
instance- an instance of a type
-
typeFromName
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).- Parameters:
name- type name to look up- Returns:
- corresponding type ID or 0
-
typeFundamental
-
typeFundamentalNext
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.- Returns:
- the next available fundamental type ID to be registered, or 0 if the type system ran out of fundamental type IDs
-
typeGetInstanceCount
Returns the number of instances allocated of the particular type; this is only available if GLib is built with debugging support and theinstance-countdebug flag is set (by setting theGOBJECT_DEBUGvariable to includeinstance-count).- Parameters:
type- aGType- Returns:
- the number of instances allocated of the given type; if instance counts are not available, returns 0.
- Since:
- 2.44
-
typeGetPlugin
Returns theGTypePluginstructure fortype.- Parameters:
type-GTypeto retrieve the plugin for- Returns:
- the corresponding plugin
if
typeis a dynamic type,nullotherwise
-
typeGetQdata
Obtains data which has previously been attached totypewith 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().
- Parameters:
type- aGTypequark- aGQuarkid to identify the data- Returns:
- the data, or
nullif no data was found
-
typeGetTypeRegistrationSerial
public static int 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 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.- Returns:
- An unsigned int, representing the state of type registrations
- Since:
- 2.36
-
typeInit
Deprecated.the type system is now initialised automaticallyThis function used to initialise the type system. Since GLib 2.36, the type system is initialised automatically and this function does nothing. -
typeInitWithDebugFlags
Deprecated.the type system is now initialised automaticallyThis 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_DEBUGenvironment variable.- Parameters:
debugFlags- bitwise combination ofGTypeDebugFlagsvalues for debugging purposes
-
typeInitWithDebugFlags
Deprecated.the type system is now initialised automaticallyThis 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_DEBUGenvironment variable.- Parameters:
debugFlags- bitwise combination ofGTypeDebugFlagsvalues for debugging purposes
-
typeInterfaces
Return a newly allocated and 0-terminated array of type IDs, listing the interface types thattypeconforms to.- Parameters:
type- the type to list interface types for- Returns:
- Newly allocated and 0-terminated array of interface types, free with g_free()
-
typeIsA
IfisATypeis a derivable type, check whethertypeis a descendant ofisAType.IfisATypeis an interface, check whethertypeconforms to it.- Parameters:
type- type to check ancestry forisAType- possible ancestor oftypeor interface thattypecould conform to- Returns:
trueiftypeis aisAType
-
typeName
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_INVALIDmay 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.- Parameters:
type- type to return name for- Returns:
- static type name or
null
-
typeNameFromClass
-
typeNameFromInstance
-
typeNextBase
Given aleafTypeand arootTypewhich is contained in its ancestry, return the type thatrootTypeis the immediate parent of. In other words, this function determines the type that is derived directly fromrootTypewhich is also a base class ofleafType.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.- Parameters:
leafType- descendant ofrootTypeand the type to be returnedrootType- immediate parent of the returned type- Returns:
- immediate child of
rootTypeand ancestor ofleafType
-
typeParent
-
typeQname
-
typeQuery
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
GTypeis passed in, thetypemember of theGTypeQueryis 0. All members filled into theGTypeQuerystructure should be considered constant and have to be left untouched.Since GLib 2.78, this function allows queries on dynamic types. Previously it only supported static types.
- Parameters:
type-GTypeof a static, classed typequery- a user provided structure that is filled in with constant values upon success
-
typeRegisterDynamic
public static Type typeRegisterDynamic(Type parentType, String typeName, TypePlugin plugin, Set<TypeFlags> flags) RegisterstypeNameas the name of a new dynamic type derived fromparentType.The type system uses the information contained in theGTypePluginstructure pointed to bypluginto manage the type and its instances (if not abstract). The value offlagsdetermines the nature (e.g. abstract or not) of the type.- Parameters:
parentType- type from which this type will be derivedtypeName- 0-terminated string used as the name of the new typeplugin-GTypePluginstructure to retrieve theGTypeInfofromflags- bitwise combination ofGTypeFlagsvalues- Returns:
- the new type identifier or
G_TYPE_INVALIDif registration failed
-
typeRegisterDynamic
public static Type typeRegisterDynamic(Type parentType, String typeName, TypePlugin plugin, TypeFlags... flags) RegisterstypeNameas the name of a new dynamic type derived fromparentType.The type system uses the information contained in theGTypePluginstructure pointed to bypluginto manage the type and its instances (if not abstract). The value offlagsdetermines the nature (e.g. abstract or not) of the type.- Parameters:
parentType- type from which this type will be derivedtypeName- 0-terminated string used as the name of the new typeplugin-GTypePluginstructure to retrieve theGTypeInfofromflags- bitwise combination ofGTypeFlagsvalues- Returns:
- the new type identifier or
G_TYPE_INVALIDif registration failed
-
typeRegisterFundamental
public static Type typeRegisterFundamental(Type typeId, String typeName, TypeInfo info, TypeFundamentalInfo finfo, Set<TypeFlags> flags) RegisterstypeIdas the predefined identifier andtypeNameas the name of a fundamental type. IftypeIdis already registered, or a type namedtypeNameis already registered, the behaviour is undefined. The type system uses the information contained in theGTypeInfostructure pointed to byinfoand theGTypeFundamentalInfostructure pointed to byfinfoto manage the type and its instances. The value offlagsdetermines additional characteristics of the fundamental type.- Parameters:
typeId- a predefined type identifiertypeName- 0-terminated string used as the name of the new typeinfo-GTypeInfostructure for this typefinfo-GTypeFundamentalInfostructure for this typeflags- bitwise combination ofGTypeFlagsvalues- Returns:
- the predefined type identifier
-
typeRegisterFundamental
public static Type typeRegisterFundamental(Type typeId, String typeName, TypeInfo info, TypeFundamentalInfo finfo, TypeFlags... flags) RegisterstypeIdas the predefined identifier andtypeNameas the name of a fundamental type. IftypeIdis already registered, or a type namedtypeNameis already registered, the behaviour is undefined. The type system uses the information contained in theGTypeInfostructure pointed to byinfoand theGTypeFundamentalInfostructure pointed to byfinfoto manage the type and its instances. The value offlagsdetermines additional characteristics of the fundamental type.- Parameters:
typeId- a predefined type identifiertypeName- 0-terminated string used as the name of the new typeinfo-GTypeInfostructure for this typefinfo-GTypeFundamentalInfostructure for this typeflags- bitwise combination ofGTypeFlagsvalues- Returns:
- the predefined type identifier
-
typeRegisterStatic
public static Type typeRegisterStatic(Type parentType, String typeName, TypeInfo info, Set<TypeFlags> flags) RegisterstypeNameas the name of a new static type derived fromparentType.The type system uses the information contained in theGTypeInfostructure pointed to byinfoto manage the type and its instances (if not abstract). The value offlagsdetermines the nature (e.g. abstract or not) of the type.- Parameters:
parentType- type from which this type will be derivedtypeName- 0-terminated string used as the name of the new typeinfo-GTypeInfostructure for this typeflags- bitwise combination ofGTypeFlagsvalues- Returns:
- the new type identifier
-
typeRegisterStatic
public static Type typeRegisterStatic(Type parentType, String typeName, TypeInfo info, TypeFlags... flags) RegisterstypeNameas the name of a new static type derived fromparentType.The type system uses the information contained in theGTypeInfostructure pointed to byinfoto manage the type and its instances (if not abstract). The value offlagsdetermines the nature (e.g. abstract or not) of the type.- Parameters:
parentType- type from which this type will be derivedtypeName- 0-terminated string used as the name of the new typeinfo-GTypeInfostructure for this typeflags- bitwise combination ofGTypeFlagsvalues- Returns:
- the new type identifier
-
typeRegisterStaticSimple
public static Type typeRegisterStaticSimple(Type parentType, String typeName, int classSize, @Nullable ClassInitFunc classInit, int instanceSize, @Nullable InstanceInitFunc instanceInit, Set<TypeFlags> flags) RegisterstypeNameas the name of a new static type derived fromparentType.The value offlagsdetermines the nature (e.g. abstract or not) of the type. It works by filling aGTypeInfostruct and calling g_type_register_static().- Parameters:
parentType- type from which this type will be derivedtypeName- 0-terminated string used as the name of the new typeclassSize- size of the class structure (seeGTypeInfo)classInit- location of the class initialization function (seeGTypeInfo)instanceSize- size of the instance structure (seeGTypeInfo)instanceInit- location of the instance initialization function (seeGTypeInfo)flags- bitwise combination ofGTypeFlagsvalues- Returns:
- the new type identifier
- Since:
- 2.12
-
typeRegisterStaticSimple
public static Type typeRegisterStaticSimple(Type parentType, String typeName, int classSize, @Nullable ClassInitFunc classInit, int instanceSize, @Nullable InstanceInitFunc instanceInit, TypeFlags... flags) RegisterstypeNameas the name of a new static type derived fromparentType.The value offlagsdetermines the nature (e.g. abstract or not) of the type. It works by filling aGTypeInfostruct and calling g_type_register_static().- Parameters:
parentType- type from which this type will be derivedtypeName- 0-terminated string used as the name of the new typeclassSize- size of the class structure (seeGTypeInfo)classInit- location of the class initialization function (seeGTypeInfo)instanceSize- size of the instance structure (seeGTypeInfo)instanceInit- location of the instance initialization function (seeGTypeInfo)flags- bitwise combination ofGTypeFlagsvalues- Returns:
- the new type identifier
- Since:
- 2.12
-
typeRemoveClassCacheFunc
public static void typeRemoveClassCacheFunc(@Nullable MemorySegment cacheData, @Nullable TypeClassCacheFunc cacheFunc) Removes a previously installedGTypeClassCacheFunc. The cache maintained bycacheFunchas to be empty when calling g_type_remove_class_cache_func() to avoid leaks.- Parameters:
cacheData- data that was given when addingcacheFunccacheFunc- aGTypeClassCacheFunc
-
typeRemoveInterfaceCheck
public static void typeRemoveInterfaceCheck(@Nullable MemorySegment checkData, @Nullable TypeInterfaceCheckFunc checkFunc) Removes an interface check function added with g_type_add_interface_check().- Parameters:
checkData- callback data passed to g_type_add_interface_check()checkFunc- callback function passed to g_type_add_interface_check()- Since:
- 2.4
-
typeSetQdata
Attaches arbitrary data to a type.- Parameters:
type- aGTypequark- aGQuarkid to identify the datadata- the data
-
typeTestFlags
-
variantGetGtype
-