Class GObjects

java.lang.Object
org.gnome.gobject.GObjects

@Generated("org.javagi.JavaGI") public final class GObjects extends Object
Constants and functions that are declared in the global GObject namespace.
  • Field Details

    • PARAM_MASK

      public static final int PARAM_MASK
      Mask containing the bits of GParamSpec.flags which are reserved for GLib.
      See Also:
    • PARAM_STATIC_STRINGS

      public static final int PARAM_STATIC_STRINGS

      GParamFlags value alias for ParamFlags.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_SHIFT
      Minimum shift count to be used for user defined flags, to be stored in GParamSpec.flags. The maximum allowed is 10.
      See Also:
    • SIGNAL_FLAGS_MASK

      public static final int SIGNAL_FLAGS_MASK
      A mask for all GSignalFlags bits.
      See Also:
    • SIGNAL_MATCH_MASK

      public static final int SIGNAL_MATCH_MASK
      A mask for all GSignalMatchType bits.
      See Also:
    • TYPE_FLAG_RESERVED_ID_BIT

      public static final long TYPE_FLAG_RESERVED_ID_BIT
      A bit in the type number that's supposed to be left untouched.
      See Also:
    • TYPE_FUNDAMENTAL_MAX

      public static final int TYPE_FUNDAMENTAL_MAX
      An 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_SHIFT
      Shift value used in converting numbers to type IDs.
      See Also:
    • TYPE_RESERVED_BSE_FIRST

      public static final int TYPE_RESERVED_BSE_FIRST
      First 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_LAST
      Last fundamental type number reserved for BSE.
      See Also:
    • TYPE_RESERVED_GLIB_FIRST

      public static final int TYPE_RESERVED_GLIB_FIRST
      First 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_LAST
      Last fundamental type number reserved for GLib.
      See Also:
    • TYPE_RESERVED_USER_FIRST

      public static final int TYPE_RESERVED_USER_FIRST
      First 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_LENGTH
      The maximal number of GTypeCValues which can be collected for a single GValue.
      See Also:
    • VALUE_INTERNED_STRING

      public static final int VALUE_INTERNED_STRING

      Flag to indicate that a string in a GObject.Value is canonical and will exist for the duration of the process.

      See Value.setInternedString(String).

      This flag should be checked by implementations of GObject.TypeValueFreeFunc, GObject.TypeValueCollectFunc and GObject.TypeValueLCopyFunc.

      Since:
      2.66
      See Also:
    • VALUE_NOCOPY_CONTENTS

      public static final int VALUE_NOCOPY_CONTENTS

      Flag to indicate that allocated data in a GObject.Value shouldn’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(Value): the data will be copied if it is not ref-counted.

      This flag should be checked by implementations of GObject.TypeValueFreeFunc, GObject.TypeValueCollectFunc and GObject.TypeValueLCopyFunc.

      See Also:
  • Constructor Details

    • GObjects

      public GObjects()
  • Method Details

    • javagi$ensureInitialized

      public static void javagi$ensureInitialized()
    • boxedCopy

      public static MemorySegment boxedCopy(Type boxedType, MemorySegment srcBoxed)
      Provide a copy of a boxed structure srcBoxed which is of type boxedType.
      Parameters:
      boxedType - The type of srcBoxed.
      srcBoxed - The boxed structure to be copied.
      Returns:
      The newly created copy of the boxed structure.
    • boxedFree

      public static void boxedFree(Type boxedType, MemorySegment boxed)
      Free the boxed structure boxed which is of type boxedType.
      Parameters:
      boxedType - The type of boxed.
      boxed - The boxed structure to be freed.
    • boxedTypeRegisterStatic

      public static Type boxedTypeRegisterStatic(String name, @Nullable BoxedCopyFunc boxedCopy, @Nullable BoxedFreeFunc boxedFree)

      This function creates a new G_TYPE_BOXED derived type id for a new boxed type with name name.

      Boxed type handling functions have to be provided to copy and free opaque boxed structures of this type.

      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_BOXED derived type id for name.
    • clearObject

      public static void clearObject(GObject[] objectPtr)

      Clears a reference to a GObject.

      objectPtr must not be null.

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

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

      Parameters:
      objectPtr - a pointer to a GObject reference
      Since:
      2.28
    • clearSignalHandler

      public static void clearSignalHandler(MemorySegment handlerIdPtr, GObject instance)

      Disconnects a handler from instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to. The handlerIdPtr is then set to zero, which is 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 type gulong) of the handler to be disconnected.
      instance - The instance to remove the signal handler from. This pointer may be null or 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 the complete_type_info function of a GTypePlugin implementation, 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 completed
      info - the GTypeInfo struct to be filled in
      constValues - An array of GEnumValue structs for the possible enumeration values. The array is terminated by a struct with all members being 0.
    • enumGetValue

      public static @Nullable EnumValue enumGetValue(EnumClass enumClass, int value)
      Returns the GEnumValue for a value.
      Parameters:
      enumClass - a GEnumClass
      value - the value to look up
      Returns:
      the GEnumValue for value, or null if value is not a member of the enumeration
    • enumGetValueByName

      public static @Nullable EnumValue enumGetValueByName(EnumClass enumClass, String name)
      Looks up a GEnumValue by name.
      Parameters:
      enumClass - a GEnumClass
      name - the name to look up
      Returns:
      the GEnumValue with name name, or null if the enumeration doesn't have a member with that name
    • enumGetValueByNick

      public static @Nullable EnumValue enumGetValueByNick(EnumClass enumClass, String nick)
      Looks up a GEnumValue by nickname.
      Parameters:
      enumClass - a GEnumClass
      nick - the nickname to look up
      Returns:
      the GEnumValue with nickname nick, or null if 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 name name.

      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 of GEnumValue structs 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

      public static String enumToString(Type gEnumType, int value)

      Pretty-prints value in the form of the enum’s name.

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

      Parameters:
      gEnumType - the type identifier of a GEnumClass type
      value - 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 a GTypePlugin implementation, see the example for g_enum_complete_type_info() above.
      Parameters:
      gFlagsType - the type identifier of the type being completed
      info - the GTypeInfo struct to be filled in
      constValues - An array of GFlagsValue structs for the possible enumeration values. The array is terminated by a struct with all members being 0.
    • flagsGetFirstValue

      public static @Nullable FlagsValue flagsGetFirstValue(FlagsClass flagsClass, int value)
      Returns the first GFlagsValue which is set in value.
      Parameters:
      flagsClass - a GFlagsClass
      value - the value
      Returns:
      the first GFlagsValue which is set in value, or null if none is set
    • flagsGetValueByName

      public static @Nullable FlagsValue flagsGetValueByName(FlagsClass flagsClass, String name)
      Looks up a GFlagsValue by name.
      Parameters:
      flagsClass - a GFlagsClass
      name - the name to look up
      Returns:
      the GFlagsValue with name name, or null if there is no flag with that name
    • flagsGetValueByNick

      public static @Nullable FlagsValue flagsGetValueByNick(FlagsClass flagsClass, String nick)
      Looks up a GFlagsValue by nickname.
      Parameters:
      flagsClass - a GFlagsClass
      nick - the nickname to look up
      Returns:
      the GFlagsValue with nickname nick, or null if 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 name name.

      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 of GFlagsValue structs 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

      public static String flagsToString(Type flagsType, int value)

      Pretty-prints value in the form of the flag names separated by | and sorted. Any extra bits will be shown at the end as a hexadecimal number.

      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 a GFlagsClass type
      value - the value
      Returns:
      a newly-allocated text string
      Since:
      2.54
    • gtypeGetType

      public static Type gtypeGetType()
    • paramSpecBoolean

      public static ParamSpec paramSpecBoolean(String name, @Nullable String nick, @Nullable String blurb, boolean defaultValue, Set<ParamFlags> flags)

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

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      defaultValue - default value for the property specified
      flags - 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 new GParamSpecBoolean instance specifying a G_TYPE_BOOLEAN property. In many cases, it may be more appropriate to use an enum with g_param_spec_enum(), both to improve code clarity by using explicitly named values, and to allow for more values to be added in future without breaking API.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      defaultValue - default value for the property specified
      flags - 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 new GParamSpecBoxed instance specifying a G_TYPE_BOXED derived property.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      boxedType - G_TYPE_BOXED derived type of this property
      flags - 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 new GParamSpecBoxed instance specifying a G_TYPE_BOXED derived property.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      boxedType - G_TYPE_BOXED derived type of this property
      flags - 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 new GParamSpecChar instance specifying a G_TYPE_CHAR property.
      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      minimum - minimum value for the property specified
      maximum - maximum value for the property specified
      defaultValue - default value for the property specified
      flags - 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 new GParamSpecChar instance specifying a G_TYPE_CHAR property.
      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      minimum - minimum value for the property specified
      maximum - maximum value for the property specified
      defaultValue - default value for the property specified
      flags - 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 new GParamSpecDouble instance specifying a G_TYPE_DOUBLE property.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      minimum - minimum value for the property specified
      maximum - maximum value for the property specified
      defaultValue - default value for the property specified
      flags - 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 new GParamSpecDouble instance specifying a G_TYPE_DOUBLE property.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      minimum - minimum value for the property specified
      maximum - maximum value for the property specified
      defaultValue - default value for the property specified
      flags - 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 new GParamSpecEnum instance specifying a G_TYPE_ENUM property.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      enumType - a GType derived from G_TYPE_ENUM
      defaultValue - default value for the property specified
      flags - 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 new GParamSpecEnum instance specifying a G_TYPE_ENUM property.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      enumType - a GType derived from G_TYPE_ENUM
      defaultValue - default value for the property specified
      flags - 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 new GParamSpecFlags instance specifying a G_TYPE_FLAGS property.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      flagsType - a GType derived from G_TYPE_FLAGS
      defaultValue - default value for the property specified
      flags - 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 new GParamSpecFlags instance specifying a G_TYPE_FLAGS property.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      flagsType - a GType derived from G_TYPE_FLAGS
      defaultValue - default value for the property specified
      flags - 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 new GParamSpecFloat instance specifying a G_TYPE_FLOAT property.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      minimum - minimum value for the property specified
      maximum - maximum value for the property specified
      defaultValue - default value for the property specified
      flags - 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 new GParamSpecFloat instance specifying a G_TYPE_FLOAT property.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      minimum - minimum value for the property specified
      maximum - maximum value for the property specified
      defaultValue - default value for the property specified
      flags - 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 new GParamSpecGType instance specifying a G_TYPE_GTYPE property.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      isAType - a GType whose subtypes are allowed as values of the property (use G_TYPE_NONE for 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 new GParamSpecGType instance specifying a G_TYPE_GTYPE property.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      isAType - a GType whose subtypes are allowed as values of the property (use G_TYPE_NONE for 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 new GParamSpecInt instance specifying a G_TYPE_INT property.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      minimum - minimum value for the property specified
      maximum - maximum value for the property specified
      defaultValue - default value for the property specified
      flags - 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 new GParamSpecInt instance specifying a G_TYPE_INT property.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      minimum - minimum value for the property specified
      maximum - maximum value for the property specified
      defaultValue - default value for the property specified
      flags - 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 new GParamSpecInt64 instance specifying a G_TYPE_INT64 property.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      minimum - minimum value for the property specified
      maximum - maximum value for the property specified
      defaultValue - default value for the property specified
      flags - 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 new GParamSpecInt64 instance specifying a G_TYPE_INT64 property.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      minimum - minimum value for the property specified
      maximum - maximum value for the property specified
      defaultValue - default value for the property specified
      flags - 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 new GParamSpecLong instance specifying a G_TYPE_LONG property.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      minimum - minimum value for the property specified
      maximum - maximum value for the property specified
      defaultValue - default value for the property specified
      flags - 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 new GParamSpecLong instance specifying a G_TYPE_LONG property.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      minimum - minimum value for the property specified
      maximum - maximum value for the property specified
      defaultValue - default value for the property specified
      flags - 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 new GParamSpecBoxed instance specifying a G_TYPE_OBJECT derived property.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      objectType - G_TYPE_OBJECT derived type of this property
      flags - 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 new GParamSpecBoxed instance specifying a G_TYPE_OBJECT derived property.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      objectType - G_TYPE_OBJECT derived type of this property
      flags - flags for the property specified
      Returns:
      a newly created parameter specification
    • paramSpecOverride

      public static ParamSpec paramSpecOverride(String name, ParamSpec overridden)
      Creates a new property of type GParamSpecOverride. This is used to direct operations to another paramspec, and will not be directly useful unless you are implementing a new base type similar to GObject.
      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 new GParamSpecParam instance specifying a G_TYPE_PARAM property.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      paramType - a GType derived from G_TYPE_PARAM
      flags - 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 new GParamSpecParam instance specifying a G_TYPE_PARAM property.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      paramType - a GType derived from G_TYPE_PARAM
      flags - 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 new GParamSpecPointer instance specifying a pointer property. Where possible, it is better to use g_param_spec_object() or g_param_spec_boxed() to expose memory management information.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      flags - 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 new GParamSpecPointer instance specifying a pointer property. Where possible, it is better to use g_param_spec_object() or g_param_spec_boxed() to expose memory management information.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      flags - 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 new GParamSpecString instance.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      defaultValue - default value for the property specified
      flags - 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 new GParamSpecString instance.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      defaultValue - default value for the property specified
      flags - 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 new GParamSpecUChar instance specifying a G_TYPE_UCHAR property.
      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      minimum - minimum value for the property specified
      maximum - maximum value for the property specified
      defaultValue - default value for the property specified
      flags - 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 new GParamSpecUChar instance specifying a G_TYPE_UCHAR property.
      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      minimum - minimum value for the property specified
      maximum - maximum value for the property specified
      defaultValue - default value for the property specified
      flags - 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 new GParamSpecUInt instance specifying a G_TYPE_UINT property.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      minimum - minimum value for the property specified
      maximum - maximum value for the property specified
      defaultValue - default value for the property specified
      flags - 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 new GParamSpecUInt instance specifying a G_TYPE_UINT property.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      minimum - minimum value for the property specified
      maximum - maximum value for the property specified
      defaultValue - default value for the property specified
      flags - 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 new GParamSpecUInt64 instance specifying a G_TYPE_UINT64 property.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      minimum - minimum value for the property specified
      maximum - maximum value for the property specified
      defaultValue - default value for the property specified
      flags - 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 new GParamSpecUInt64 instance specifying a G_TYPE_UINT64 property.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      minimum - minimum value for the property specified
      maximum - maximum value for the property specified
      defaultValue - default value for the property specified
      flags - 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 new GParamSpecULong instance specifying a G_TYPE_ULONG property.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      minimum - minimum value for the property specified
      maximum - maximum value for the property specified
      defaultValue - default value for the property specified
      flags - 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 new GParamSpecULong instance specifying a G_TYPE_ULONG property.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      minimum - minimum value for the property specified
      maximum - maximum value for the property specified
      defaultValue - default value for the property specified
      flags - 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 new GParamSpecUnichar instance specifying a G_TYPE_UINT property. GValue structures for this property can be accessed with g_value_set_uint() and g_value_get_uint().

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      defaultValue - default value for the property specified
      flags - 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 new GParamSpecUnichar instance specifying a G_TYPE_UINT property. GValue structures for this property can be accessed with g_value_set_uint() and g_value_get_uint().

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      defaultValue - default value for the property specified
      flags - 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 new GParamSpecValueArray instance specifying a G_TYPE_VALUE_ARRAY property. G_TYPE_VALUE_ARRAY is a G_TYPE_BOXED type, as such, GValue structures for this property can be accessed with g_value_set_boxed() and g_value_get_boxed().

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      elementSpec - a GParamSpec describing the elements contained in arrays of this property, may be null
      flags - 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 new GParamSpecValueArray instance specifying a G_TYPE_VALUE_ARRAY property. G_TYPE_VALUE_ARRAY is a G_TYPE_BOXED type, as such, GValue structures for this property can be accessed with g_value_set_boxed() and g_value_get_boxed().

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      elementSpec - a GParamSpec describing the elements contained in arrays of this property, may be null
      flags - 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 new GParamSpecVariant instance specifying a GVariant property.

      If defaultValue is floating, it is consumed.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      type - a GVariantType
      defaultValue - a GVariant of type type to use as the default value, or null
      flags - 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 new GParamSpecVariant instance specifying a GVariant property.

      If defaultValue is floating, it is consumed.

      See g_param_spec_internal() for details on property names.

      Parameters:
      name - canonical name of the property specified
      nick - nick name for the property specified
      blurb - description of the property specified
      type - a GVariantType
      defaultValue - a GVariant of type type to use as the default value, or null
      flags - flags for the property specified
      Returns:
      the newly created GParamSpec
      Since:
      2.26
    • paramTypeRegisterStatic

      public static Type paramTypeRegisterStatic(String name, ParamSpecTypeInfo pspecInfo)

      Registers name as the name of a new static type derived from G_TYPE_PARAM.

      The type system uses the information contained in the GParamSpecTypeInfo structure pointed to by info to manage the GParamSpec type and its instances.

      Parameters:
      name - 0-terminated string used as the name of the new GParamSpec type.
      pspecInfo - The GParamSpecTypeInfo for this GParamSpec type.
      Returns:
      The new type identifier.
    • paramValueConvert

      public static boolean paramValueConvert(ParamSpec pspec, Value srcValue, Value destValue, boolean strictValidation)

      Transforms srcValue into destValue if possible, and then validates destValue, in order for it to conform to pspec. If strictValidation is true this function will only succeed if the transformed destValue complied to pspec without modifications.

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

      Parameters:
      pspec - a valid GParamSpec
      srcValue - source GValue
      destValue - destination GValue of correct type for pspec
      strictValidation - true requires destValue to conform to pspec without modifications
      Returns:
      true if transformation and validation were successful, false otherwise and destValue is left untouched.
    • paramValueDefaults

      public static boolean paramValueDefaults(ParamSpec pspec, Value value)
      Checks whether value contains the default value as specified in pspec.
      Parameters:
      pspec - a valid GParamSpec
      value - a GValue of correct type for pspec
      Returns:
      whether value contains the canonical default for this pspec
    • paramValueIsValid

      public static boolean paramValueIsValid(ParamSpec pspec, Value value)
      Return whether the contents of value comply with the specifications set out by pspec.
      Parameters:
      pspec - a valid GParamSpec
      value - a GValue of correct type for pspec
      Returns:
      whether the contents of value comply with the specifications set out by pspec.
      Since:
      2.74
    • paramValueSetDefault

      public static void paramValueSetDefault(ParamSpec pspec, Value value)
      Sets value to its default value as specified in pspec.
      Parameters:
      pspec - a valid GParamSpec
      value - a GValue of correct type for pspec; since 2.64, you can also pass an empty GValue, initialized with G_VALUE_INIT
    • paramValueValidate

      public static boolean paramValueValidate(ParamSpec pspec, Value value)
      Ensures that the contents of value comply with the specifications set out by pspec. For example, a GParamSpecInt might require that integers stored in value may not be smaller than -42 and not be greater than +42. If value contains an integer outside of this range, it is modified accordingly, so the resulting value will fit into the range -42 .. +42.
      Parameters:
      pspec - a valid GParamSpec
      value - a GValue of correct type for pspec
      Returns:
      whether modifying value was necessary to ensure validity
    • paramValuesCmp

      public static int paramValuesCmp(ParamSpec pspec, Value value1, Value value2)
      Compares value1 with value2 according to pspec, and return -1, 0 or +1, if value1 is found to be less than, equal to or greater than value2, respectively.
      Parameters:
      pspec - a valid GParamSpec
      value1 - a GValue of correct type for pspec
      value2 - a GValue of correct type for pspec
      Returns:
      -1, 0 or +1, for a less than, equal to or greater than result
    • pointerTypeRegisterStatic

      public static Type pointerTypeRegisterStatic(String name)
      Creates a new G_TYPE_POINTER derived type id for a new pointer type with name name.
      Parameters:
      name - the name of the new pointer type.
      Returns:
      a new G_TYPE_POINTER derived type id for name.
    • signalAccumulatorFirstWins

      public static boolean signalAccumulatorFirstWins(SignalInvocationHint ihint, Value returnAccu, Value handlerReturn, @Nullable MemorySegment dummy)

      A predefined GSignalAccumulator for signals intended to be used as a hook for application code to provide a particular value. Usually only one such value is desired and multiple handlers for the same signal don't make much sense (except for the case of the default handler defined in the class structure, in which case you will usually want the signal connection to override the class handler).

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

      Parameters:
      ihint - standard GSignalAccumulator parameter
      returnAccu - standard GSignalAccumulator parameter
      handlerReturn - standard GSignalAccumulator parameter
      dummy - standard GSignalAccumulator parameter
      Returns:
      standard GSignalAccumulator result
      Since:
      2.28
    • signalAccumulatorTrueHandled

      public static boolean signalAccumulatorTrueHandled(SignalInvocationHint ihint, Value returnAccu, Value handlerReturn, @Nullable MemorySegment dummy)
      A predefined GSignalAccumulator for signals that return a boolean values. The behavior that this accumulator gives is that a return of true stops the signal emission: no further callbacks will be invoked, while a return of false allows the emission to continue. The idea here is that a true return indicates that the callback handled the signal, and no further handling is needed.
      Parameters:
      ihint - standard GSignalAccumulator parameter
      returnAccu - standard GSignalAccumulator parameter
      handlerReturn - standard GSignalAccumulator parameter
      dummy - standard GSignalAccumulator parameter
      Returns:
      standard GSignalAccumulator result
      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 have SignalFlags.NO_HOOKS flag set.
      Parameters:
      signalId - the signal identifier, as returned by g_signal_lookup().
      detail - the detail on which to call the hook.
      hookFunc - a GSignalEmissionHook function.
      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 a GValue for 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

      public static void signalChainFromOverriddenHandler(TypeInstance instance, Object... varargs)
      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 is G_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 closure is a floating reference (see g_closure_sink()), this function takes ownership of closure.

      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 closure is a floating reference (see g_closure_sink()), this function takes ownership of closure.

      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 a GCallback function to a signal for a particular object. Similar to g_signal_connect(), but allows to provide a GClosureNotify for the data which will be called when the signal handler is disconnected and no longer used. Specify connectFlags if 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 - the GCallback to connect.
      destroyData - a GClosureNotify for data.
      connectFlags - a combination of GConnectFlags.
      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 a GCallback function to a signal for a particular object. Similar to g_signal_connect(), but allows to provide a GClosureNotify for the data which will be called when the signal handler is disconnected and no longer used. Specify connectFlags if 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 - the GCallback to connect.
      destroyData - a GClosureNotify for data.
      connectFlags - a combination of GConnectFlags.
      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 the gobject stays alive during the call to cHandler by temporarily adding a reference count to gobject.

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

      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 - the GCallback to connect.
      gobject - the object to pass as data to cHandler.
      connectFlags - a combination of GConnectFlags.
      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 the gobject stays alive during the call to cHandler by temporarily adding a reference count to gobject.

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

      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 - the GCallback to connect.
      gobject - the object to pass as data to cHandler.
      connectFlags - a combination of GConnectFlags.
      Returns:
      the handler id.
    • signalEmit

      public static void signalEmit(GObject instance, int signalId, Quark detail, Object... varargs)

      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 id
      detail - the detail
      varargs - parameters to be passed to the signal, followed by a location for the return value. If the return type of the signal is G_TYPE_NONE, the return value location can be omitted.
    • signalEmitByName

      public static void signalEmitByName(GObject instance, String detailedSignal, Object... varargs)

      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 is G_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 returnValue if 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 a GValue for the instance the signal is being emitted on. The rest are any arguments to be passed to the signal.
      signalId - the signal id
      detail - the detail
      returnValue - 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

      public static @Nullable SignalInvocationHint signalGetInvocationHint(GObject instance)
      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 null if not found.
    • signalHandlerBlock

      public static void signalHandlerBlock(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. 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 handlerId has to be a valid signal handler id, connected to a signal of instance.

      Parameters:
      instance - The instance to block the signal handler of.
      handlerId - Handler id of the handler to be blocked.
    • signalHandlerDisconnect

      public static void signalHandlerDisconnect(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. The handlerId becomes invalid and may be reused.

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

      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 of GSignalMatchType flags, and the criteria values are passed as arguments. The match mask has to be non-0 for successful matches. If no handler was found, 0 is returned.
      Parameters:
      instance - The instance owning the signal handler to be found.
      mask - Mask indicating which of signalId, detail, closure, func and/or data the 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 of GSignalMatchType flags, and the criteria values are passed as arguments. The match mask has to be non-0 for successful matches. If no handler was found, 0 is returned.
      Parameters:
      instance - The instance owning the signal handler to be found.
      mask - Mask indicating which of signalId, detail, closure, func and/or data the 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

      public static boolean signalHandlerIsConnected(GObject instance, int handlerId)
      Returns whether handlerId is the ID of a handler connected to instance.
      Parameters:
      instance - The instance where a signal handler is sought.
      handlerId - the handler ID.
      Returns:
      whether handlerId identifies a handler connected to instance.
    • signalHandlerUnblock

      public static void signalHandlerUnblock(GObject instance, int handlerId)

      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 handlerId has to be a valid id of a signal handler that is connected to a signal of instance and 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 GSignalMatchType flags, and the criteria values are passed as arguments. A handler must match on all flags set in mask to be blocked (i.e. the match is conjunctive).

      Passing at least one of the SignalMatchType.ID, SignalMatchType.CLOSURE, SignalMatchType.FUNC or SignalMatchType.DATA match flags is required for successful matches. If no handlers were found, 0 is returned, the number of blocked handlers otherwise.

      Support for SignalMatchType.ID was added in GLib 2.78.

      Parameters:
      instance - The instance to block handlers from.
      mask - Mask indicating which of signalId, detail, closure, func and/or data the 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 GSignalMatchType flags, and the criteria values are passed as arguments. A handler must match on all flags set in mask to be blocked (i.e. the match is conjunctive).

      Passing at least one of the SignalMatchType.ID, SignalMatchType.CLOSURE, SignalMatchType.FUNC or SignalMatchType.DATA match flags is required for successful matches. If no handlers were found, 0 is returned, the number of blocked handlers otherwise.

      Support for SignalMatchType.ID was added in GLib 2.78.

      Parameters:
      instance - The instance to block handlers from.
      mask - Mask indicating which of signalId, detail, closure, func and/or data the 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

      public static void signalHandlersDestroy(GObject instance)
      Destroy all signal handlers of a type instance. This function is an implementation detail of the GObject dispose implementation, and should not be used outside of the type system.
      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 GSignalMatchType flags, and the criteria values are passed as arguments. A handler must match on all flags set in mask to be disconnected (i.e. the match is conjunctive).

      Passing at least one of the SignalMatchType.ID, SignalMatchType.CLOSURE, SignalMatchType.FUNC or SignalMatchType.DATA match flags is required for successful matches. If no handlers were found, 0 is returned, the number of disconnected handlers otherwise.

      Support for SignalMatchType.ID was added in GLib 2.78.

      Parameters:
      instance - The instance to remove handlers from.
      mask - Mask indicating which of signalId, detail, closure, func and/or data the 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 GSignalMatchType flags, and the criteria values are passed as arguments. A handler must match on all flags set in mask to be disconnected (i.e. the match is conjunctive).

      Passing at least one of the SignalMatchType.ID, SignalMatchType.CLOSURE, SignalMatchType.FUNC or SignalMatchType.DATA match flags is required for successful matches. If no handlers were found, 0 is returned, the number of disconnected handlers otherwise.

      Support for SignalMatchType.ID was added in GLib 2.78.

      Parameters:
      instance - The instance to remove handlers from.
      mask - Mask indicating which of signalId, detail, closure, func and/or data the 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 GSignalMatchType flags, and the criteria values are passed as arguments. A handler must match on all flags set in mask to be unblocked (i.e. the match is conjunctive).

      Passing at least one of the SignalMatchType.ID, SignalMatchType.CLOSURE, SignalMatchType.FUNC or SignalMatchType.DATA match flags is required for successful matches. If no handlers were found, 0 is returned, the number of unblocked handlers otherwise. The match criteria should not apply to any handlers that are not currently blocked.

      Support for SignalMatchType.ID was added in GLib 2.78.

      Parameters:
      instance - The instance to unblock handlers from.
      mask - Mask indicating which of signalId, detail, closure, func and/or data the 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 GSignalMatchType flags, and the criteria values are passed as arguments. A handler must match on all flags set in mask to be unblocked (i.e. the match is conjunctive).

      Passing at least one of the SignalMatchType.ID, SignalMatchType.CLOSURE, SignalMatchType.FUNC or SignalMatchType.DATA match flags is required for successful matches. If no handlers were found, 0 is returned, the number of unblocked handlers otherwise. The match criteria should not apply to any handlers that are not currently blocked.

      Support for SignalMatchType.ID was added in GLib 2.78.

      Parameters:
      instance - The instance to unblock handlers from.
      mask - Mask indicating which of signalId, detail, closure, func and/or data the 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 to instance for the given signal id and detail.

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

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

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

      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:
      true if a handler is connected to the signal, false otherwise.
    • signalIsValidName

      public static boolean signalIsValidName(String name)

      Validate a signal name. This can be useful for dynamically-generated signals which need to be validated at run-time before actually trying to create them.

      See signalNew(String, Type, Set, int, SignalAccumulator, SignalCMarshaller, Type, int, 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:
      true if name is a valid signal name, false otherwise.
      Since:
      2.66
    • signalListIds

      public static int[] signalListIds(Type itype)
      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

      public static int signalLookup(String name, Type itype)

      Given the name of the signal and the type of object it connects to, gets the signal's identifying integer. Emitting the signal by number is somewhat faster than using the name each time.

      Also tries the ancestors of the given type.

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

      See g_signal_new() for details on allowed signal names.

      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

      public static @Nullable String signalName(int signalId)

      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 null if 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 classOffset subclasses 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 cMarshaller is null, 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 cMarshaller is 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 signal
      itype - the type this signal pertains to. It will also pertain to types which are derived from this type.
      signalFlags - a combination of GSignalFlags specifying detail of when the default handler is to be invoked. You should at least specify SignalFlags.RUN_FIRST or SignalFlags.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 be null.
      cMarshaller - the function to translate arrays of parameter values to signal emissions into C language callback invocations or null.
      returnType - the type of return value, or G_TYPE_NONE for 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 classOffset subclasses 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 cMarshaller is null, 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 cMarshaller is 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 signal
      itype - the type this signal pertains to. It will also pertain to types which are derived from this type.
      signalFlags - a combination of GSignalFlags specifying detail of when the default handler is to be invoked. You should at least specify SignalFlags.RUN_FIRST or SignalFlags.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 be null.
      cMarshaller - the function to translate arrays of parameter values to signal emissions into C language callback invocations or null.
      returnType - the type of return value, or G_TYPE_NONE for 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 signal
      itype - the type this signal pertains to. It will also pertain to types which are derived from this type.
      signalFlags - a combination of GSignalFlags specifying detail of when the default handler is to be invoked. You should at least specify SignalFlags.RUN_FIRST or SignalFlags.RUN_LAST.
      classHandler - a GCallback which acts as class implementation of this signal. Used to invoke a class method generically. Pass null to not associate a class method with this signal.
      accumulator - the accumulator for this signal; may be null.
      cMarshaller - the function to translate arrays of parameter values to signal emissions into C language callback invocations or null.
      returnType - the type of return value, or G_TYPE_NONE for 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 signal
      itype - the type this signal pertains to. It will also pertain to types which are derived from this type.
      signalFlags - a combination of GSignalFlags specifying detail of when the default handler is to be invoked. You should at least specify SignalFlags.RUN_FIRST or SignalFlags.RUN_LAST.
      classHandler - a GCallback which acts as class implementation of this signal. Used to invoke a class method generically. Pass null to not associate a class method with this signal.
      accumulator - the accumulator for this signal; may be null.
      cMarshaller - the function to translate arrays of parameter values to signal emissions into C language callback invocations or null.
      returnType - the type of return value, or G_TYPE_NONE for 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 signal
      itype - the type this signal pertains to. It will also pertain to types which are derived from this type
      signalFlags - a combination of GSignalFlags specifying detail of when the default handler is to be invoked. You should at least specify SignalFlags.RUN_FIRST or SignalFlags.RUN_LAST
      classClosure - The closure to invoke on signal emission; may be null
      accumulator - the accumulator for this signal; may be null
      cMarshaller - the function to translate arrays of parameter values to signal emissions into C language callback invocations or null
      returnType - the type of return value, or G_TYPE_NONE for a signal without a return value
      paramTypes - an array of types, one for each parameter (may be null if nParams is 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 signal
      itype - the type this signal pertains to. It will also pertain to types which are derived from this type
      signalFlags - a combination of GSignalFlags specifying detail of when the default handler is to be invoked. You should at least specify SignalFlags.RUN_FIRST or SignalFlags.RUN_LAST
      classClosure - The closure to invoke on signal emission; may be null
      accumulator - the accumulator for this signal; may be null
      cMarshaller - the function to translate arrays of parameter values to signal emissions into C language callback invocations or null
      returnType - the type of return value, or G_TYPE_NONE for a signal without a return value
      paramTypes - an array of types, one for each parameter (may be null if nParams is 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 of instanceType. instanceType must be derived from the type to which the signal belongs.

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

      Parameters:
      signalId - the signal id
      instanceType - 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 of instanceType with callback classHandler. instanceType must be derived from the type to which the signal belongs.

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

      Parameters:
      signalName - the name for the signal
      instanceType - 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 its signalId and detail quark.
      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 - true forces creation of a GQuark for the detail.
      Returns:
      Whether the signal name could successfully be parsed and signalIdP and detailP contain valid return values.
    • signalQuery

      public static void signalQuery(int signalId, SignalQuery query)
      Queries the signal system for in-depth information about a specific signal. This function will fill in a user-provided structure to hold signal-specific information. If an invalid signal id is passed in, the signalId member of the GSignalQuery is 0. All members filled into the GSignalQuery structure 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 signal
      hookId - the id of the emission hook, as returned by g_signal_add_emission_hook()
    • signalStopEmission

      public static void signalStopEmission(GObject instance, int signalId, Quark detail)

      Stops a signal's current emission.

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

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

      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

      public static void signalStopEmissionByName(GObject instance, String detailedSignal)

      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

      public static Closure signalTypeCclosureNew(Type itype, int structOffset)
      Creates a new closure which invokes the function found at the offset structOffset in the class structure of the interface or classed type identified by itype.
      Parameters:
      itype - the GType identifier of an interface or classed type
      structOffset - the offset of the member function of itype's class structure which is to be invoked by the new closure
      Returns:
      a floating reference to a new GCClosure
    • strdupValueContents

      public static String strdupValueContents(Value value)
      Return a newly allocated string, which describes the contents of a GValue. The main purpose of this function is to describe GValue contents for debugging output, the way in which the contents are described may change between different GLib versions.
      Parameters:
      value - GValue which contents are to be described.
      Returns:
      Newly allocated string.
    • typeAddClassCacheFunc

      public static void typeAddClassCacheFunc(@Nullable MemorySegment cacheData, @Nullable TypeClassCacheFunc cacheFunc)
      Adds a GTypeClassCacheFunc to be called before the reference count of a class goes from one to zero. This can be used to prevent premature class destruction. All installed GTypeClassCacheFunc functions will be chained until one of them returns true. The functions have to check the class id passed in to figure whether they actually want to cache the class of this type, since all classes are routed through the same GTypeClassCacheFunc chain.
      Parameters:
      cacheData - data to be passed to cacheFunc
      cacheFunc - a GTypeClassCacheFunc
    • typeAddClassPrivate

      public static void typeAddClassPrivate(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.

      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 type
      privateSize - size of private structure
      Since:
      2.24
    • typeAddInstancePrivate

      public static int typeAddInstancePrivate(Type classType, long privateSize)
    • 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 the interfaceInit member of GInterfaceInfo has been called).

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

      Parameters:
      checkData - data to pass to checkFunc
      checkFunc - function to be called after each interface is initialized
      Since:
      2.4
    • typeAddInterfaceDynamic

      public static void typeAddInterfaceDynamic(Type instanceType, Type interfaceType, TypePlugin plugin)
      Adds interfaceType to the dynamic instanceType. The information contained in the GTypePlugin structure pointed to by plugin is used to manage the relationship.
      Parameters:
      instanceType - GType value of an instantiatable type
      interfaceType - GType value of an interface type
      plugin - GTypePlugin structure to retrieve the GInterfaceInfo from
    • typeAddInterfaceStatic

      public static void typeAddInterfaceStatic(Type instanceType, Type interfaceType, InterfaceInfo info)
      Adds interfaceType to the static instanceType. The information contained in the GInterfaceInfo structure pointed to by info is used to manage the relationship.
      Parameters:
      instanceType - GType value of an instantiatable type
      interfaceType - GType value of an interface type
      info - GInterfaceInfo structure for this (instanceType, interfaceType) combination
    • typeCheckClassCast

      public static TypeClass typeCheckClassCast(TypeClass gClass, Type isAType)
    • typeCheckClassIsA

      public static boolean typeCheckClassIsA(TypeClass gClass, Type isAType)
    • typeCheckInstance

      public static boolean typeCheckInstance(TypeInstance instance)
      Private helper function to aid implementation of the G_TYPE_CHECK_INSTANCE() macro.
      Parameters:
      instance - a valid GTypeInstance structure
      Returns:
      true if instance is valid, false otherwise
    • typeCheckInstanceCast

      public static TypeInstance typeCheckInstanceCast(TypeInstance instance, Type ifaceType)
    • typeCheckInstanceIsA

      public static boolean typeCheckInstanceIsA(TypeInstance instance, Type ifaceType)
    • typeCheckInstanceIsFundamentallyA

      public static boolean typeCheckInstanceIsFundamentallyA(TypeInstance instance, Type fundamentalType)
    • typeCheckIsValueType

      public static boolean typeCheckIsValueType(Type type)
    • typeCheckValue

      public static boolean typeCheckValue(Value value)
    • typeCheckValueHolds

      public static boolean typeCheckValueHolds(Value value, Type type)
    • typeChildren

      public static Type[] typeChildren(Type type)
      Return a newly allocated and 0-terminated array of type IDs, listing the child types of type.
      Parameters:
      type - the parent type
      Returns:
      Newly allocated and 0-terminated array of child types, free with g_free()
    • typeCreateInstance

      public static TypeInstance typeCreateInstance(Type type)

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

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

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

      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

      public static TypeInterface typeDefaultInterfaceGet(Type gType)

      Returns the default interface vtable for the given gType.

      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 baseInit and classInit members of GTypeInfo).

      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

      public static TypeInterface typeDefaultInterfacePeek(Type gType)
      If the interface type gType is currently in use, returns its default interface vtable.
      Parameters:
      gType - an interface type
      Returns:
      the default vtable for the interface, or null if the type is not currently in use
      Since:
      2.4
    • typeDefaultInterfaceRef

      @Deprecated public static TypeInterface typeDefaultInterfaceRef(Type gType)
      Deprecated.
      Use g_type_default_interface_get() instead

      Increments the reference count for the interface type gType, 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 baseInit and classInit members of GTypeInfo). Calling g_type_default_interface_ref() is useful when you want to make sure that signals and properties for an interface have been installed.

      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 public static void typeDefaultInterfaceUnref(TypeInterface gIface)
      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 vtable gIface.

      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 classFinalize member of GTypeInfo) will be called.

      Parameters:
      gIface - the default vtable structure for an interface, as returned by g_type_default_interface_ref()
      Since:
      2.4
    • typeDepth

      public static int typeDepth(Type type)
      Returns the length of the ancestry of the passed in type. This includes the type itself, so that e.g. a fundamental type has depth 1.
      Parameters:
      type - a GType
      Returns:
      the depth of type
    • typeEnsure

      public static void typeEnsure(Type type)

      Ensures that the indicated type has been registered with the type system, and its _class_init() method has been run.

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

      Parameters:
      type - a GType
      Since:
      2.34
    • typeFreeInstance

      public static void typeFreeInstance(TypeInstance instance)

      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

      public static Type typeFromName(String name)
      Look up the type ID from a given type name, returning 0 if no type has been registered under this name (this is the preferred method to find out by name whether a specific type has been registered yet).
      Parameters:
      name - type name to look up
      Returns:
      corresponding type ID or 0
    • typeFundamental

      public static Type typeFundamental(Type typeId)
      Internal function, used to extract the fundamental type ID portion. Use G_TYPE_FUNDAMENTAL() instead.
      Parameters:
      typeId - valid type ID
      Returns:
      fundamental type ID
    • typeFundamentalNext

      public static Type 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

      public static int typeGetInstanceCount(Type type)
      Returns the number of instances allocated of the particular type; this is only available if GLib is built with debugging support and the instance-count debug flag is set (by setting the GOBJECT_DEBUG variable to include instance-count).
      Parameters:
      type - a GType
      Returns:
      the number of instances allocated of the given type; if instance counts are not available, returns 0.
      Since:
      2.44
    • typeGetPlugin

      public static TypePlugin typeGetPlugin(Type type)
      Returns the GTypePlugin structure for type.
      Parameters:
      type - GType to retrieve the plugin for
      Returns:
      the corresponding plugin if type is a dynamic type, null otherwise
    • typeGetQdata

      public static @Nullable MemorySegment typeGetQdata(Type type, Quark quark)

      Obtains data which has previously been attached to type with g_type_set_qdata().

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

      Parameters:
      type - a GType
      quark - a GQuark id to identify the data
      Returns:
      the data, or null if 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 public static void typeInit()
      Deprecated.
      the type system is now initialised automatically
      This function used to initialise the type system. Since GLib 2.36, the type system is initialised automatically and this function does nothing.
    • typeInitWithDebugFlags

      @Deprecated public static void typeInitWithDebugFlags(Set<TypeDebugFlags> debugFlags)
      Deprecated.
      the type system is now initialised automatically

      This function used to initialise the type system with debugging flags. Since GLib 2.36, the type system is initialised automatically and this function does nothing.

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

      Parameters:
      debugFlags - bitwise combination of GTypeDebugFlags values for debugging purposes
    • typeInitWithDebugFlags

      @Deprecated public static void typeInitWithDebugFlags(TypeDebugFlags... debugFlags)
      Deprecated.
      the type system is now initialised automatically

      This function used to initialise the type system with debugging flags. Since GLib 2.36, the type system is initialised automatically and this function does nothing.

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

      Parameters:
      debugFlags - bitwise combination of GTypeDebugFlags values for debugging purposes
    • typeInterfaces

      public static Type[] typeInterfaces(Type type)
      Return a newly allocated and 0-terminated array of type IDs, listing the interface types that type conforms 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

      public static boolean typeIsA(Type type, Type isAType)
      If isAType is a derivable type, check whether type is a descendant of isAType. If isAType is an interface, check whether type conforms to it.
      Parameters:
      type - type to check ancestry for
      isAType - possible ancestor of type or interface that type could conform to
      Returns:
      true if type is a isAType
    • typeName

      public static @Nullable String typeName(Type type)

      Get the unique name that is assigned to a type ID.

      Note that this function (like all other GType API) cannot cope with invalid type IDs. G_TYPE_INVALID may be passed to this function, as may be any other validly registered type ID, but randomized type IDs should not be passed in and will most likely lead to a crash.

      Parameters:
      type - type to return name for
      Returns:
      static type name or null
    • typeNameFromClass

      public static String typeNameFromClass(TypeClass gClass)
    • typeNameFromInstance

      public static String typeNameFromInstance(TypeInstance instance)
    • typeNextBase

      public static Type typeNextBase(Type leafType, Type rootType)
      Given a leafType and a rootType which is contained in its ancestry, return the type that rootType is the immediate parent of. In other words, this function determines the type that is derived directly from rootType which is also a base class of leafType. 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 of rootType and the type to be returned
      rootType - immediate parent of the returned type
      Returns:
      immediate child of rootType and ancestor of leafType
    • typeParent

      public static Type typeParent(Type type)
      Return the direct parent type of the passed in type. If the passed in type has no parent, i.e. is a fundamental type, 0 is returned.
      Parameters:
      type - the derived type
      Returns:
      the parent type
    • typeQname

      public static Quark typeQname(Type type)
      Get the corresponding quark of the type IDs name.
      Parameters:
      type - type to return quark of type name for
      Returns:
      the type names quark or 0
    • typeQuery

      public static void typeQuery(Type type, TypeQuery query)

      Queries the type system for information about a specific type.

      This function will fill in a user-provided structure to hold type-specific information. If an invalid GType is passed in, the type member of the GTypeQuery is 0. All members filled into the GTypeQuery structure should be considered constant and have to be left untouched.

      Since GLib 2.78, this function allows queries on dynamic types. Previously it only supported static types.

      Parameters:
      type - GType of a static, classed type
      query - 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)
      Registers typeName as the name of a new dynamic type derived from parentType. The type system uses the information contained in the GTypePlugin structure pointed to by plugin to manage the type and its instances (if not abstract). The value of flags determines the nature (e.g. abstract or not) of the type.
      Parameters:
      parentType - type from which this type will be derived
      typeName - 0-terminated string used as the name of the new type
      plugin - GTypePlugin structure to retrieve the GTypeInfo from
      flags - bitwise combination of GTypeFlags values
      Returns:
      the new type identifier or G_TYPE_INVALID if registration failed
    • typeRegisterDynamic

      public static Type typeRegisterDynamic(Type parentType, String typeName, TypePlugin plugin, TypeFlags... flags)
      Registers typeName as the name of a new dynamic type derived from parentType. The type system uses the information contained in the GTypePlugin structure pointed to by plugin to manage the type and its instances (if not abstract). The value of flags determines the nature (e.g. abstract or not) of the type.
      Parameters:
      parentType - type from which this type will be derived
      typeName - 0-terminated string used as the name of the new type
      plugin - GTypePlugin structure to retrieve the GTypeInfo from
      flags - bitwise combination of GTypeFlags values
      Returns:
      the new type identifier or G_TYPE_INVALID if registration failed
    • typeRegisterFundamental

      public static Type typeRegisterFundamental(Type typeId, String typeName, TypeInfo info, TypeFundamentalInfo finfo, Set<TypeFlags> flags)
      Registers typeId as the predefined identifier and typeName as the name of a fundamental type. If typeId is already registered, or a type named typeName is already registered, the behaviour is undefined. The type system uses the information contained in the GTypeInfo structure pointed to by info and the GTypeFundamentalInfo structure pointed to by finfo to manage the type and its instances. The value of flags determines additional characteristics of the fundamental type.
      Parameters:
      typeId - a predefined type identifier
      typeName - 0-terminated string used as the name of the new type
      info - GTypeInfo structure for this type
      finfo - GTypeFundamentalInfo structure for this type
      flags - bitwise combination of GTypeFlags values
      Returns:
      the predefined type identifier
    • typeRegisterFundamental

      public static Type typeRegisterFundamental(Type typeId, String typeName, TypeInfo info, TypeFundamentalInfo finfo, TypeFlags... flags)
      Registers typeId as the predefined identifier and typeName as the name of a fundamental type. If typeId is already registered, or a type named typeName is already registered, the behaviour is undefined. The type system uses the information contained in the GTypeInfo structure pointed to by info and the GTypeFundamentalInfo structure pointed to by finfo to manage the type and its instances. The value of flags determines additional characteristics of the fundamental type.
      Parameters:
      typeId - a predefined type identifier
      typeName - 0-terminated string used as the name of the new type
      info - GTypeInfo structure for this type
      finfo - GTypeFundamentalInfo structure for this type
      flags - bitwise combination of GTypeFlags values
      Returns:
      the predefined type identifier
    • typeRegisterStatic

      public static Type typeRegisterStatic(Type parentType, String typeName, TypeInfo info, Set<TypeFlags> flags)
      Registers typeName as the name of a new static type derived from parentType. The type system uses the information contained in the GTypeInfo structure pointed to by info to manage the type and its instances (if not abstract). The value of flags determines the nature (e.g. abstract or not) of the type.
      Parameters:
      parentType - type from which this type will be derived
      typeName - 0-terminated string used as the name of the new type
      info - GTypeInfo structure for this type
      flags - bitwise combination of GTypeFlags values
      Returns:
      the new type identifier
    • typeRegisterStatic

      public static Type typeRegisterStatic(Type parentType, String typeName, TypeInfo info, TypeFlags... flags)
      Registers typeName as the name of a new static type derived from parentType. The type system uses the information contained in the GTypeInfo structure pointed to by info to manage the type and its instances (if not abstract). The value of flags determines the nature (e.g. abstract or not) of the type.
      Parameters:
      parentType - type from which this type will be derived
      typeName - 0-terminated string used as the name of the new type
      info - GTypeInfo structure for this type
      flags - bitwise combination of GTypeFlags values
      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)
      Registers typeName as the name of a new static type derived from parentType. The value of flags determines the nature (e.g. abstract or not) of the type. It works by filling a GTypeInfo struct and calling g_type_register_static().
      Parameters:
      parentType - type from which this type will be derived
      typeName - 0-terminated string used as the name of the new type
      classSize - size of the class structure (see GTypeInfo)
      classInit - location of the class initialization function (see GTypeInfo)
      instanceSize - size of the instance structure (see GTypeInfo)
      instanceInit - location of the instance initialization function (see GTypeInfo)
      flags - bitwise combination of GTypeFlags values
      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)
      Registers typeName as the name of a new static type derived from parentType. The value of flags determines the nature (e.g. abstract or not) of the type. It works by filling a GTypeInfo struct and calling g_type_register_static().
      Parameters:
      parentType - type from which this type will be derived
      typeName - 0-terminated string used as the name of the new type
      classSize - size of the class structure (see GTypeInfo)
      classInit - location of the class initialization function (see GTypeInfo)
      instanceSize - size of the instance structure (see GTypeInfo)
      instanceInit - location of the instance initialization function (see GTypeInfo)
      flags - bitwise combination of GTypeFlags values
      Returns:
      the new type identifier
      Since:
      2.12
    • typeRemoveClassCacheFunc

      public static void typeRemoveClassCacheFunc(@Nullable MemorySegment cacheData, @Nullable TypeClassCacheFunc cacheFunc)
      Removes a previously installed GTypeClassCacheFunc. The cache maintained by cacheFunc has to be empty when calling g_type_remove_class_cache_func() to avoid leaks.
      Parameters:
      cacheData - data that was given when adding cacheFunc
      cacheFunc - a GTypeClassCacheFunc
    • 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

      public static void typeSetQdata(Type type, Quark quark, @Nullable MemorySegment data)
      Attaches arbitrary data to a type.
      Parameters:
      type - a GType
      quark - a GQuark id to identify the data
      data - the data
    • typeTestFlags

      public static boolean typeTestFlags(Type type, int flags)
    • variantGetGtype

      public static Type variantGetGtype()