Class ActionEntry

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class ActionEntry extends ProxyInstance

This struct defines a single action. It is for use with ActionMap.addActionEntries(ActionEntry[], MemorySegment).

The order of the items in the structure are intended to reflect frequency of use. It is permissible to use an incomplete initialiser in order to leave some of the later values as NULL. All values after name are optional. Additional optional fields may be added in the future.

See ActionMap.addActionEntries(ActionEntry[], MemorySegment) for an example.

  • Constructor Details

    • ActionEntry

      public ActionEntry(MemorySegment address)
      Create a ActionEntry proxy instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • ActionEntry

      public ActionEntry(Arena arena)
      Allocate a new ActionEntry.
      Parameters:
      arena - to control the memory allocation scope
    • ActionEntry

      public ActionEntry()
      Allocate a new ActionEntry. The memory is allocated with Arena.ofAuto().
    • ActionEntry

      public ActionEntry(String name, ActionEntry.ActivateCallback activate, String parameterType, String state, ActionEntry.ChangeStateCallback changeState, Arena arena)
      Allocate a new ActionEntry with the fields set to the provided values.
      Parameters:
      name - value for the field name
      activate - callback function for the field activate
      parameterType - value for the field parameterType
      state - value for the field state
      changeState - callback function for the field changeState
      arena - to control the memory allocation scope
    • ActionEntry

      public ActionEntry(String name, ActionEntry.ActivateCallback activate, String parameterType, String state, ActionEntry.ChangeStateCallback changeState)
      Allocate a new ActionEntry with the fields set to the provided values. The memory is allocated with Arena.ofAuto().
      Parameters:
      name - value for the field name
      activate - callback function for the field activate
      parameterType - value for the field parameterType
      state - value for the field state
      changeState - callback function for the field changeState
  • Method Details

    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • readName

      public String readName()
      Read the value of the field name.
      Returns:
      The value of the field name
    • writeName

      public void writeName(String name, Arena _arena)
      Write a value in the field name.
      Parameters:
      name - The new value for the field name
      _arena - to control the memory allocation scope
    • overrideActivate

      public void overrideActivate(ActionEntry.ActivateCallback activate, Arena _arena)
      Write a value in the field activate.
      Parameters:
      activate - The new value for the field activate
      _arena - to control the memory allocation scope
    • readParameterType

      public String readParameterType()
      Read the value of the field parameter_type.
      Returns:
      The value of the field parameter_type
    • writeParameterType

      public void writeParameterType(String parameterType, Arena _arena)
      Write a value in the field parameter_type.
      Parameters:
      parameterType - The new value for the field parameter_type
      _arena - to control the memory allocation scope
    • readState

      public String readState()
      Read the value of the field state.
      Returns:
      The value of the field state
    • writeState

      public void writeState(String state, Arena _arena)
      Write a value in the field state.
      Parameters:
      state - The new value for the field state
      _arena - to control the memory allocation scope
    • overrideChangeState

      public void overrideChangeState(ActionEntry.ChangeStateCallback changeState, Arena _arena)
      Write a value in the field change_state.
      Parameters:
      changeState - The new value for the field change_state
      _arena - to control the memory allocation scope