Class DeviceTool

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class DeviceTool extends GObject
A physical tool associated to a GdkDevice.
  • Constructor Details

    • DeviceTool

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

      public DeviceTool()
      Create a new DeviceTool.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the DeviceTool class.
      Returns:
      the GType
    • getMemoryLayout

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

      protected DeviceTool asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class GObject
      Returns:
      the instance as if it were its parent type
    • getAxes

      public Set<AxisFlags> getAxes()
      Gets the axes of the tool.
      Returns:
      the axes of this DeviceTool
    • getHardwareId

      public long getHardwareId()

      Gets the hardware ID of this tool, or 0 if it's not known.

      When non-zero, the identifier is unique for the given tool model, meaning that two identical tools will share the same hardwareId, but will have different serial numbers (see getSerial()).

      This is a more concrete (and device specific) method to identify a GdkDeviceTool than getToolType(), as a tablet may support multiple devices with the same GdkDeviceToolType, but different hardware identifiers.

      Returns:
      The hardware identifier of this tool.
    • getSerial

      public long getSerial()

      Gets the serial number of this tool.

      This value can be used to identify a physical tool (eg. a tablet pen) across program executions.

      Returns:
      The serial ID for this tool
    • getToolType

      public DeviceToolType getToolType()
      Gets the GdkDeviceToolType of the tool.
      Returns:
      The physical type for this tool. This can be used to figure out what sort of pen is being used, such as an airbrush or a pencil.
    • builder

      public static DeviceTool.Builder<? extends DeviceTool.Builder> builder()
      A DeviceTool.Builder object constructs a DeviceTool with the specified properties. Use the various set...() methods to set properties, and finish construction with DeviceTool.Builder.build().
      Returns:
      the builder object