Package org.gnome.gobject
Class TypeInterface
java.lang.Object
org.javagi.base.ProxyInstance
org.gnome.gobject.TypeInterface
- All Implemented Interfaces:
Proxy
- Direct Known Subclasses:
Accessible.AccessibleInterface,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
An opaque structure used as the base of all interface types.
-
Constructor Summary
ConstructorsConstructorDescriptionAllocate a new TypeInterface.TypeInterface(Arena arena) Allocate a new TypeInterface.TypeInterface(MemorySegment address) 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 TypeMethodDescriptionstatic voidaddPrerequisite(Type interfaceType, Type prerequisiteType) AddsprerequisiteTypeto the list of prerequisites ofinterfaceType.This means that any type implementinginterfaceTypemust also implementprerequisiteType.Prerequisites can be thought of as an alternative to interface derivation (which GType doesn't support).static MemoryLayoutThe memory layout of the native struct.static TypePluginReturns theGTypePluginstructure for the dynamic interfaceinterfaceTypewhich has been added toinstanceType,ornullifinterfaceTypehas not been added toinstanceTypeor does not have aGTypePluginstructure.static TypeinstantiatablePrerequisite(Type interfaceType) Returns the most specific instantiatable prerequisite of an interface type.static @Nullable TypeInterfaceReturns theGTypeInterfacestructure of an interface to which the passed in class conforms.@Nullable TypeInterfaceReturns the correspondingGTypeInterfacestructure 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 fieldg_instance_type.Read the value of the fieldg_type.voidwriteGInstanceType(Type gInstanceType) Write a value in the fieldg_instance_type.voidwriteGType(Type gType) Write a value in the fieldg_type.Methods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
TypeInterface
Create a TypeInterface proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
TypeInterface
Allocate a new TypeInterface.- Parameters:
arena- to control the memory allocation scope
-
TypeInterface
public TypeInterface()Allocate a new TypeInterface. The memory is allocated withArena.ofAuto(). -
TypeInterface
-
TypeInterface
Allocate a new TypeInterface with the fields set to the provided values. The memory is allocated withArena.ofAuto().- Parameters:
gType- value for the fieldgTypegInstanceType- value for the fieldgInstanceType
-
-
Method Details
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
readGType
-
writeGType
Write a value in the fieldg_type.- Parameters:
gType- The new value for the fieldg_type
-
readGInstanceType
Read the value of the fieldg_instance_type.- Returns:
- The value of the field
g_instance_type
-
writeGInstanceType
Write a value in the fieldg_instance_type.- Parameters:
gInstanceType- The new value for the fieldg_instance_type
-
addPrerequisite
AddsprerequisiteTypeto the list of prerequisites ofinterfaceType.This means that any type implementinginterfaceTypemust also implementprerequisiteType.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-GTypevalue of an interface typeprerequisiteType-GTypevalue of an interface or instantiatable type
-
getPlugin
Returns theGTypePluginstructure for the dynamic interfaceinterfaceTypewhich has been added toinstanceType,ornullifinterfaceTypehas not been added toinstanceTypeor does not have aGTypePluginstructure. See g_type_add_interface_dynamic().- Parameters:
instanceType-GTypeof an instantiatable typeinterfaceType-GTypeof an interface type- Returns:
- the
GTypePluginfor the dynamic interfaceinterfaceTypeofinstanceType
-
instantiatablePrerequisite
Returns the most specific instantiatable prerequisite of an interface type. If the interface type has no instantiatable prerequisite,G_TYPE_INVALIDis 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_INVALIDif none - Since:
- 2.68
-
peek
Returns theGTypeInterfacestructure of an interface to which the passed in class conforms.- Parameters:
instanceClass- aGTypeClassstructureifaceType- an interface ID which this class conforms to- Returns:
- the
GTypeInterfacestructure ofifaceTypeif implemented byinstanceClass,nullotherwise
-
prerequisites
-
peekParent
Returns the correspondingGTypeInterfacestructure 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
GTypeInterfacestructure of the parent type of the instance type to which this TypeInterface belongs, ornullif the parent type doesn't conform to the interface
-