Class TypeInterface

java.lang.Object
org.javagi.base.ProxyInstance
org.gnome.gobject.TypeInterface
All Implemented Interfaces:
Proxy
Direct Known Subclasses:
Accessible.AccessibleInterface, AccessibleHypertext.AccessibleHypertextInterface, AccessibleRange.AccessibleRangeInterface, AccessibleText.AccessibleTextInterface, Action.ActionInterface, Actionable.ActionableInterface, ActionGroup.ActionGroupInterface, ActionMap.ActionMapInterface, AppInfo.AppInfoIface, AsyncInitable.AsyncInitableIface, AsyncResult.AsyncResultIface, Backend.BackendInterface, Buildable.BuildableIface, BuilderScope.BuilderScopeInterface, CellEditable.CellEditableIface, CellLayout.CellLayoutIface, ChildProxy.ChildProxyInterface, ColorBalance.ColorBalanceInterface, ColorChooser.ColorChooserInterface, CompletionProposal.CompletionProposalInterface, CompletionProvider.CompletionProviderInterface, ConstraintTarget.ConstraintTargetInterface, Converter.ConverterIface, DatagramBased.DatagramBasedInterface, DBusInterface.DBusInterfaceIface, DBusObject.DBusObjectIface, DBusObjectManager.DBusObjectManagerIface, DebugController.DebugControllerInterface, DevicePad.DevicePadInterface, DragSurface.DragSurfaceInterface, Drive.DriveIface, DtlsClientConnection.DtlsClientConnectionInterface, DtlsConnection.DtlsConnectionInterface, DtlsServerConnection.DtlsServerConnectionInterface, Editable.EditableInterface, File.FileIface, FontChooser.FontChooserIface, HoverProvider.HoverProviderInterface, Icon.IconIface, Indenter.IndenterInterface, Initable.InitableIface, ListModel.ListModelInterface, LoadableIcon.LoadableIconIface, MemoryMonitor.MemoryMonitorInterface, Mount.MountIface, Native.NativeInterface, Navigation.NavigationInterface, NetworkMonitor.NetworkMonitorInterface, Orientable.OrientableIface, Paintable.PaintableInterface, PermissionRequest.PermissionRequestInterface, PollableInputStream.PollableInputStreamInterface, PollableOutputStream.PollableOutputStreamInterface, Popup.PopupInterface, PowerProfileMonitor.PowerProfileMonitorInterface, Preset.PresetInterface, PrintOperationPreview.PrintOperationPreviewIface, Proxy.ProxyInterface, ProxyResolver.ProxyResolverInterface, RemoteActionGroup.RemoteActionGroupInterface, Retrievable.RetrievableInterface, Root.RootInterface, Scrollable.ScrollableInterface, SectionModel.SectionModelInterface, Seekable.SeekableIface, SelectionModel.SelectionModelInterface, SessionFeature.SessionFeatureInterface, ShortcutManager.ShortcutManagerInterface, SocketConnectable.SocketConnectableIface, StreamVolume.StreamVolumeInterface, StyleSchemeChooser.StyleSchemeChooserInterface, Swipeable.SwipeableInterface, SymbolicPaintable.SymbolicPaintableInterface, TagSetter.TagSetterInterface, TlsBackend.TlsBackendInterface, TlsClientConnection.TlsClientConnectionInterface, TlsFileDatabase.TlsFileDatabaseInterface, TlsServerConnection.TlsServerConnectionInterface, TocSetter.TocSetterInterface, Toplevel.ToplevelInterface, TreeDragDest.TreeDragDestIface, TreeDragSource.TreeDragSourceIface, TreeModel.TreeModelIface, TreeSortable.TreeSortableIface, URIHandler.URIHandlerInterface, VideoDirection.VideoDirectionInterface, VideoOrientation.VideoOrientationInterface, VideoOverlay.VideoOverlayInterface, Volume.VolumeIface

@Generated("org.javagi.JavaGI") public class TypeInterface extends ProxyInstance
An opaque structure used as the base of all interface types.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Allocate a new TypeInterface.
    Allocate a new TypeInterface.
    Create a TypeInterface proxy instance for the provided memory address.
    TypeInterface(Type gType, Type gInstanceType)
    Allocate a new TypeInterface with the fields set to the provided values.
    TypeInterface(Type gType, Type gInstanceType, Arena arena)
    Allocate a new TypeInterface with the fields set to the provided values.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addPrerequisite(Type interfaceType, Type prerequisiteType)
    Adds prerequisiteType to the list of prerequisites of interfaceType. This means that any type implementing interfaceType must also implement prerequisiteType. Prerequisites can be thought of as an alternative to interface derivation (which GType doesn't support).
    The memory layout of the native struct.
    static TypePlugin
    getPlugin(Type instanceType, Type interfaceType)
    Returns the GTypePlugin structure for the dynamic interface interfaceType which has been added to instanceType, or null if interfaceType has not been added to instanceType or does not have a GTypePlugin structure.
    static Type
    Returns the most specific instantiatable prerequisite of an interface type.
    static @Nullable TypeInterface
    peek(TypeClass instanceClass, Type ifaceType)
    Returns the GTypeInterface structure of an interface to which the passed in class conforms.
    @Nullable TypeInterface
    Returns the corresponding GTypeInterface structure of the parent type of the instance type to which this TypeInterface belongs.
    static Type[]
    prerequisites(Type interfaceType)
    Returns the prerequisites of an interfaces type.
    Read the value of the field g_instance_type.
    Read the value of the field g_type.
    void
    writeGInstanceType(Type gInstanceType)
    Write a value in the field g_instance_type.
    void
    Write a value in the field g_type.

    Methods inherited from class ProxyInstance

    equals, handle, hashCode

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TypeInterface

      public TypeInterface(MemorySegment address)
      Create a TypeInterface proxy instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • TypeInterface

      public TypeInterface(Arena arena)
      Allocate a new TypeInterface.
      Parameters:
      arena - to control the memory allocation scope
    • TypeInterface

      public TypeInterface()
      Allocate a new TypeInterface. The memory is allocated with Arena.ofAuto().
    • TypeInterface

      public TypeInterface(Type gType, Type gInstanceType, Arena arena)
      Allocate a new TypeInterface with the fields set to the provided values.
      Parameters:
      gType - value for the field gType
      gInstanceType - value for the field gInstanceType
      arena - to control the memory allocation scope
    • TypeInterface

      public TypeInterface(Type gType, Type gInstanceType)
      Allocate a new TypeInterface with the fields set to the provided values. The memory is allocated with Arena.ofAuto().
      Parameters:
      gType - value for the field gType
      gInstanceType - value for the field gInstanceType
  • Method Details

    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • readGType

      public Type readGType()
      Read the value of the field g_type.
      Returns:
      The value of the field g_type
    • writeGType

      public void writeGType(Type gType)
      Write a value in the field g_type.
      Parameters:
      gType - The new value for the field g_type
    • readGInstanceType

      public Type readGInstanceType()
      Read the value of the field g_instance_type.
      Returns:
      The value of the field g_instance_type
    • writeGInstanceType

      public void writeGInstanceType(Type gInstanceType)
      Write a value in the field g_instance_type.
      Parameters:
      gInstanceType - The new value for the field g_instance_type
    • addPrerequisite

      public static void addPrerequisite(Type interfaceType, Type prerequisiteType)
      Adds prerequisiteType to the list of prerequisites of interfaceType. This means that any type implementing interfaceType must also implement prerequisiteType. Prerequisites can be thought of as an alternative to interface derivation (which GType doesn't support). An interface can have at most one instantiatable prerequisite type.
      Parameters:
      interfaceType - GType value of an interface type
      prerequisiteType - GType value of an interface or instantiatable type
    • getPlugin

      public static TypePlugin getPlugin(Type instanceType, Type interfaceType)
      Returns the GTypePlugin structure for the dynamic interface interfaceType which has been added to instanceType, or null if interfaceType has not been added to instanceType or does not have a GTypePlugin structure. See g_type_add_interface_dynamic().
      Parameters:
      instanceType - GType of an instantiatable type
      interfaceType - GType of an interface type
      Returns:
      the GTypePlugin for the dynamic interface interfaceType of instanceType
    • instantiatablePrerequisite

      public static Type instantiatablePrerequisite(Type interfaceType)

      Returns the most specific instantiatable prerequisite of an interface type. If the interface type has no instantiatable prerequisite, G_TYPE_INVALID is returned.

      See g_type_interface_add_prerequisite() for more information about prerequisites.

      Parameters:
      interfaceType - an interface type
      Returns:
      the instantiatable prerequisite type or G_TYPE_INVALID if none
      Since:
      2.68
    • peek

      public static @Nullable TypeInterface peek(TypeClass instanceClass, Type ifaceType)
      Returns the GTypeInterface structure of an interface to which the passed in class conforms.
      Parameters:
      instanceClass - a GTypeClass structure
      ifaceType - an interface ID which this class conforms to
      Returns:
      the GTypeInterface structure of ifaceType if implemented by instanceClass, null otherwise
    • prerequisites

      public static Type[] prerequisites(Type interfaceType)
      Returns the prerequisites of an interfaces type.
      Parameters:
      interfaceType - an interface type
      Returns:
      a newly-allocated zero-terminated array of GType containing the prerequisites of interfaceType
      Since:
      2.2
    • peekParent

      public @Nullable TypeInterface peekParent()

      Returns the corresponding GTypeInterface structure of the parent type of the instance type to which this TypeInterface belongs.

      This is useful when deriving the implementation of an interface from the parent type and then possibly overriding some methods.

      Returns:
      the corresponding GTypeInterface structure of the parent type of the instance type to which this TypeInterface belongs, or null if the parent type doesn't conform to the interface