Package org.gnome.gobject
Class TypeInfo
java.lang.Object
io.github.jwharm.javagi.base.ProxyInstance
org.gnome.gobject.TypeInfo
- All Implemented Interfaces:
Proxy
This structure is used to provide the type system with the information
required to initialize and destruct (finalize) a type's class and
its instances.
The initialized structure is passed to the g_type_register_static() function
(or is copied into the provided GTypeInfo
structure in the
g_type_plugin_complete_type_info()). The type system will perform a deep
copy of this structure, so its memory does not need to be persistent
across invocation of g_type_register_static().
-
Constructor Summary
ConstructorDescriptionTypeInfo()
Allocate a new TypeInfo.TypeInfo
(short classSize, BaseInitFunc baseInit, BaseFinalizeFunc baseFinalize, ClassInitFunc classInit, ClassFinalizeFunc classFinalize, MemorySegment classData, short instanceSize, short nPreallocs, InstanceInitFunc instanceInit, TypeValueTable valueTable) Allocate a new TypeInfo with the fields set to the provided values.TypeInfo
(short classSize, BaseInitFunc baseInit, BaseFinalizeFunc baseFinalize, ClassInitFunc classInit, ClassFinalizeFunc classFinalize, MemorySegment classData, short instanceSize, short nPreallocs, InstanceInitFunc instanceInit, TypeValueTable valueTable, Arena arena) Allocate a new TypeInfo with the fields set to the provided values.Allocate a new TypeInfo.TypeInfo
(MemorySegment address) Create a TypeInfo proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionstatic MemoryLayout
The memory layout of the native struct.Read the value of the fieldbase_finalize
.Read the value of the fieldbase_init
.Read the value of the fieldclass_data
.Read the value of the fieldclass_finalize
.Read the value of the fieldclass_init
.short
Read the value of the fieldclass_size
.Read the value of the fieldinstance_init
.short
Read the value of the fieldinstance_size
.short
Read the value of the fieldn_preallocs
.Read the value of the fieldvalue_table
.void
writeBaseFinalize
(BaseFinalizeFunc baseFinalize, Arena _arena) Write a value in the fieldbase_finalize
.void
writeBaseInit
(BaseInitFunc baseInit, Arena _arena) Write a value in the fieldbase_init
.void
writeClassData
(MemorySegment classData) Write a value in the fieldclass_data
.void
writeClassFinalize
(ClassFinalizeFunc classFinalize, Arena _arena) Write a value in the fieldclass_finalize
.void
writeClassInit
(ClassInitFunc classInit, Arena _arena) Write a value in the fieldclass_init
.void
writeClassSize
(short classSize) Write a value in the fieldclass_size
.void
writeInstanceInit
(InstanceInitFunc instanceInit, Arena _arena) Write a value in the fieldinstance_init
.void
writeInstanceSize
(short instanceSize) Write a value in the fieldinstance_size
.void
writeNPreallocs
(short nPreallocs) Write a value in the fieldn_preallocs
.void
writeValueTable
(TypeValueTable valueTable) Write a value in the fieldvalue_table
.Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
TypeInfo
Create a TypeInfo proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
TypeInfo
Allocate a new TypeInfo.- Parameters:
arena
- to control the memory allocation scope
-
TypeInfo
public TypeInfo()Allocate a new TypeInfo. The memory is allocated withArena.ofAuto()
. -
TypeInfo
public TypeInfo(short classSize, BaseInitFunc baseInit, BaseFinalizeFunc baseFinalize, ClassInitFunc classInit, ClassFinalizeFunc classFinalize, MemorySegment classData, short instanceSize, short nPreallocs, InstanceInitFunc instanceInit, TypeValueTable valueTable, Arena arena) Allocate a new TypeInfo with the fields set to the provided values.- Parameters:
classSize
- value for the fieldclassSize
baseInit
- value for the fieldbaseInit
baseFinalize
- value for the fieldbaseFinalize
classInit
- value for the fieldclassInit
classFinalize
- value for the fieldclassFinalize
classData
- value for the fieldclassData
instanceSize
- value for the fieldinstanceSize
nPreallocs
- value for the fieldnPreallocs
instanceInit
- value for the fieldinstanceInit
valueTable
- value for the fieldvalueTable
arena
- to control the memory allocation scope
-
TypeInfo
public TypeInfo(short classSize, BaseInitFunc baseInit, BaseFinalizeFunc baseFinalize, ClassInitFunc classInit, ClassFinalizeFunc classFinalize, MemorySegment classData, short instanceSize, short nPreallocs, InstanceInitFunc instanceInit, TypeValueTable valueTable) Allocate a new TypeInfo with the fields set to the provided values. The memory is allocated withArena.ofAuto()
.- Parameters:
classSize
- value for the fieldclassSize
baseInit
- value for the fieldbaseInit
baseFinalize
- value for the fieldbaseFinalize
classInit
- value for the fieldclassInit
classFinalize
- value for the fieldclassFinalize
classData
- value for the fieldclassData
instanceSize
- value for the fieldinstanceSize
nPreallocs
- value for the fieldnPreallocs
instanceInit
- value for the fieldinstanceInit
valueTable
- value for the fieldvalueTable
-
-
Method Details
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
readClassSize
public short readClassSize()Read the value of the fieldclass_size
.- Returns:
- The value of the field
class_size
-
writeClassSize
public void writeClassSize(short classSize) Write a value in the fieldclass_size
.- Parameters:
classSize
- The new value for the fieldclass_size
-
readBaseInit
Read the value of the fieldbase_init
.- Returns:
- The value of the field
base_init
-
writeBaseInit
Write a value in the fieldbase_init
.- Parameters:
baseInit
- The new value for the fieldbase_init
_arena
- to control the memory allocation scope
-
readBaseFinalize
Read the value of the fieldbase_finalize
.- Returns:
- The value of the field
base_finalize
-
writeBaseFinalize
Write a value in the fieldbase_finalize
.- Parameters:
baseFinalize
- The new value for the fieldbase_finalize
_arena
- to control the memory allocation scope
-
readClassInit
Read the value of the fieldclass_init
.- Returns:
- The value of the field
class_init
-
writeClassInit
Write a value in the fieldclass_init
.- Parameters:
classInit
- The new value for the fieldclass_init
_arena
- to control the memory allocation scope
-
readClassFinalize
Read the value of the fieldclass_finalize
.- Returns:
- The value of the field
class_finalize
-
writeClassFinalize
Write a value in the fieldclass_finalize
.- Parameters:
classFinalize
- The new value for the fieldclass_finalize
_arena
- to control the memory allocation scope
-
readClassData
Read the value of the fieldclass_data
.- Returns:
- The value of the field
class_data
-
writeClassData
Write a value in the fieldclass_data
.- Parameters:
classData
- The new value for the fieldclass_data
-
readInstanceSize
public short readInstanceSize()Read the value of the fieldinstance_size
.- Returns:
- The value of the field
instance_size
-
writeInstanceSize
public void writeInstanceSize(short instanceSize) Write a value in the fieldinstance_size
.- Parameters:
instanceSize
- The new value for the fieldinstance_size
-
readNPreallocs
public short readNPreallocs()Read the value of the fieldn_preallocs
.- Returns:
- The value of the field
n_preallocs
-
writeNPreallocs
public void writeNPreallocs(short nPreallocs) Write a value in the fieldn_preallocs
.- Parameters:
nPreallocs
- The new value for the fieldn_preallocs
-
readInstanceInit
Read the value of the fieldinstance_init
.- Returns:
- The value of the field
instance_init
-
writeInstanceInit
Write a value in the fieldinstance_init
.- Parameters:
instanceInit
- The new value for the fieldinstance_init
_arena
- to control the memory allocation scope
-
readValueTable
Read the value of the fieldvalue_table
.- Returns:
- The value of the field
value_table
-
writeValueTable
Write a value in the fieldvalue_table
.- Parameters:
valueTable
- The new value for the fieldvalue_table
-