Package org.gnome.gobject
Class TypeInstance
java.lang.Object
io.github.jwharm.javagi.base.ProxyInstance
org.gnome.gobject.TypeInstance
- All Implemented Interfaces:
Proxy
- Direct Known Subclasses:
Bitmask
,DoubleRange
,Event
,Expression
,FlagSet
,Fraction
,FractionRange
,GObject
,Int64Range
,IntRange
,ParamSpec
,RenderNode
,ValueArray
,ValueList
An opaque structure used as the base of all type instances.
-
Constructor Summary
ConstructorDescriptionAllocate a new TypeInstance.TypeInstance
(Arena arena) Allocate a new TypeInstance.TypeInstance
(MemorySegment address) Create a TypeInstance proxy instance for the provided memory address.TypeInstance
(TypeClass gClass) Allocate a new TypeInstance with the fields set to the provided values.TypeInstance
(TypeClass gClass, Arena arena) Allocate a new TypeInstance with the fields set to the provided values. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the flag that determines if for virtual method calls,g_type_class_peek_parent()
is used to obtain the function pointer of the parent type instead of the instance class.protected void
callParent
(boolean callParent) Set the flag that determines if for virtual method calls,g_type_class_peek_parent()
is used to obtain the function pointer of the parent type instead of the instance class.static MemoryLayout
The memory layout of the native struct.getPrivate
(Type privateType) Read the value of the fieldg_class
.void
writeGClass
(TypeClass gClass) Write a value in the fieldg_class
.Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
TypeInstance
Create a TypeInstance proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
TypeInstance
Allocate a new TypeInstance.- Parameters:
arena
- to control the memory allocation scope
-
TypeInstance
public TypeInstance()Allocate a new TypeInstance. The memory is allocated withArena.ofAuto()
. -
TypeInstance
-
TypeInstance
Allocate a new TypeInstance with the fields set to the provided values. The memory is allocated withArena.ofAuto()
.- Parameters:
gClass
- value for the fieldgClass
-
-
Method Details
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
readGClass
Read the value of the fieldg_class
.- Returns:
- The value of the field
g_class
-
writeGClass
Write a value in the fieldg_class
.- Parameters:
gClass
- The new value for the fieldg_class
-
getPrivate
-
callParent
protected void callParent(boolean callParent) Set the flag that determines if for virtual method calls,g_type_class_peek_parent()
is used to obtain the function pointer of the parent type instead of the instance class.- Parameters:
callParent
- true to call the parent vfunc instead of an overridden vfunc
-
callParent
public boolean callParent()Returns the flag that determines if for virtual method calls,g_type_class_peek_parent()
is used to obtain the function pointer of the parent type instead of the instance class.- Returns:
- true when parent vfunc is called instead of an overridden vfunc, or false when the overridden vfunc of the instance is called.
-