Package org.gnome.gobject
Class TypeInterface
java.lang.Object
io.github.jwharm.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
,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
,DesktopAppInfoLookup.DesktopAppInfoLookupIface
,DevicePad.DevicePadInterface
,DragSurface.DragSurfaceInterface
,Drive.DriveIface
,DtlsClientConnection.DtlsClientConnectionInterface
,DtlsConnection.DtlsConnectionInterface
,DtlsServerConnection.DtlsServerConnectionInterface
,Editable.EditableInterface
,File.FileIface
,FileDescriptorBased.FileDescriptorBasedIface
,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
,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
ConstructorDescriptionAllocate 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 void
addPrerequisite
(Type interfaceType, Type prerequisiteType) AddsprerequisiteType
to the list of prerequisites ofinterfaceType
.static MemoryLayout
The memory layout of the native struct.static TypePlugin
Returns theGTypePlugin
structure for the dynamic interfaceinterfaceType
which has been added toinstanceType
, ornull
ifinterfaceType
has not been added toinstanceType
or does not have aGTypePlugin
structure.static Type
instantiatablePrerequisite
(Type interfaceType) Returns the most specific instantiatable prerequisite of an interface type.static TypeInterface
Returns theGTypeInterface
structure of an interface to which the passed in class conforms.Returns the correspondingGTypeInterface
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 fieldg_instance_type
.Read the value of the fieldg_type
.void
writeGInstanceType
(Type gInstanceType) Write a value in the fieldg_instance_type
.void
writeGType
(Type gType) Write a value in the fieldg_type
.Methods inherited from class io.github.jwharm.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 fieldgType
gInstanceType
- 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
AddsprerequisiteType
to the list of prerequisites ofinterfaceType
. This means that any type implementinginterfaceType
must 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
-GType
value of an interface typeprerequisiteType
-GType
value of an interface or instantiatable type
-
getPlugin
Returns theGTypePlugin
structure for the dynamic interfaceinterfaceType
which has been added toinstanceType
, ornull
ifinterfaceType
has not been added toinstanceType
or does not have aGTypePlugin
structure. See g_type_add_interface_dynamic().- Parameters:
instanceType
-GType
of an instantiatable typeinterfaceType
-GType
of an interface type- Returns:
- the
GTypePlugin
for the dynamic interfaceinterfaceType
ofinstanceType
-
instantiatablePrerequisite
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
-
peek
Returns theGTypeInterface
structure of an interface to which the passed in class conforms.- Parameters:
instanceClass
- aGTypeClass
structureifaceType
- an interface ID which this class conforms to- Returns:
- the
GTypeInterface
structure ofifaceType
if implemented byinstanceClass
,null
otherwise
-
prerequisites
-
peekParent
Returns the correspondingGTypeInterface
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, ornull
if the parent type doesn't conform to the interface
-