Package org.gnome.webkit.jsc
Class ClassVTable
java.lang.Object
io.github.jwharm.javagi.base.ProxyInstance
org.gnome.webkit.jsc.ClassVTable
- All Implemented Interfaces:
Proxy
Virtual table for a JSCClass. This can be optionally used when registering a
JSCClass
in a JSCContext
to provide a custom implementation for the class. All virtual functions are optional and can be set to
null
to fallback to the default implementation.-
Constructor Summary
ConstructorDescriptionAllocate a new ClassVTable.ClassVTable
(Arena arena) Allocate a new ClassVTable.ClassVTable
(MemorySegment address) Create a ClassVTable proxy instance for the provided memory address.ClassVTable
(ClassGetPropertyFunction getProperty, ClassSetPropertyFunction setProperty, ClassHasPropertyFunction hasProperty, ClassDeletePropertyFunction deleteProperty, ClassEnumeratePropertiesFunction enumerateProperties) Allocate a new ClassVTable with the fields set to the provided values.ClassVTable
(ClassGetPropertyFunction getProperty, ClassSetPropertyFunction setProperty, ClassHasPropertyFunction hasProperty, ClassDeletePropertyFunction deleteProperty, ClassEnumeratePropertiesFunction enumerateProperties, Arena arena) Allocate a new ClassVTable with the fields set to the provided values. -
Method Summary
Modifier and TypeMethodDescriptionstatic MemoryLayout
The memory layout of the native struct.Read the value of the fielddelete_property
.Read the value of the fieldenumerate_properties
.Read the value of the fieldget_property
.Read the value of the fieldhas_property
.Read the value of the fieldset_property
.void
writeDeleteProperty
(ClassDeletePropertyFunction deleteProperty, Arena _arena) Write a value in the fielddelete_property
.void
writeEnumerateProperties
(ClassEnumeratePropertiesFunction enumerateProperties, Arena _arena) Write a value in the fieldenumerate_properties
.void
writeGetProperty
(ClassGetPropertyFunction getProperty, Arena _arena) Write a value in the fieldget_property
.void
writeHasProperty
(ClassHasPropertyFunction hasProperty, Arena _arena) Write a value in the fieldhas_property
.void
writeSetProperty
(ClassSetPropertyFunction setProperty, Arena _arena) Write a value in the fieldset_property
.Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
ClassVTable
Create a ClassVTable proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
ClassVTable
Allocate a new ClassVTable.- Parameters:
arena
- to control the memory allocation scope
-
ClassVTable
public ClassVTable()Allocate a new ClassVTable. The memory is allocated withArena.ofAuto()
. -
ClassVTable
public ClassVTable(ClassGetPropertyFunction getProperty, ClassSetPropertyFunction setProperty, ClassHasPropertyFunction hasProperty, ClassDeletePropertyFunction deleteProperty, ClassEnumeratePropertiesFunction enumerateProperties, Arena arena) Allocate a new ClassVTable with the fields set to the provided values.- Parameters:
getProperty
- value for the fieldgetProperty
setProperty
- value for the fieldsetProperty
hasProperty
- value for the fieldhasProperty
deleteProperty
- value for the fielddeleteProperty
enumerateProperties
- value for the fieldenumerateProperties
arena
- to control the memory allocation scope
-
ClassVTable
public ClassVTable(ClassGetPropertyFunction getProperty, ClassSetPropertyFunction setProperty, ClassHasPropertyFunction hasProperty, ClassDeletePropertyFunction deleteProperty, ClassEnumeratePropertiesFunction enumerateProperties) Allocate a new ClassVTable with the fields set to the provided values. The memory is allocated withArena.ofAuto()
.- Parameters:
getProperty
- value for the fieldgetProperty
setProperty
- value for the fieldsetProperty
hasProperty
- value for the fieldhasProperty
deleteProperty
- value for the fielddeleteProperty
enumerateProperties
- value for the fieldenumerateProperties
-
-
Method Details
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
readGetProperty
Read the value of the fieldget_property
.- Returns:
- The value of the field
get_property
-
writeGetProperty
Write a value in the fieldget_property
.- Parameters:
getProperty
- The new value for the fieldget_property
_arena
- to control the memory allocation scope
-
readSetProperty
Read the value of the fieldset_property
.- Returns:
- The value of the field
set_property
-
writeSetProperty
Write a value in the fieldset_property
.- Parameters:
setProperty
- The new value for the fieldset_property
_arena
- to control the memory allocation scope
-
readHasProperty
Read the value of the fieldhas_property
.- Returns:
- The value of the field
has_property
-
writeHasProperty
Write a value in the fieldhas_property
.- Parameters:
hasProperty
- The new value for the fieldhas_property
_arena
- to control the memory allocation scope
-
readDeleteProperty
Read the value of the fielddelete_property
.- Returns:
- The value of the field
delete_property
-
writeDeleteProperty
Write a value in the fielddelete_property
.- Parameters:
deleteProperty
- The new value for the fielddelete_property
_arena
- to control the memory allocation scope
-
readEnumerateProperties
Read the value of the fieldenumerate_properties
.- Returns:
- The value of the field
enumerate_properties
-
writeEnumerateProperties
public void writeEnumerateProperties(ClassEnumeratePropertiesFunction enumerateProperties, Arena _arena) Write a value in the fieldenumerate_properties
.- Parameters:
enumerateProperties
- The new value for the fieldenumerate_properties
_arena
- to control the memory allocation scope
-