Class PixbufModulePattern

java.lang.Object
org.javagi.base.ProxyInstance
org.gnome.gdkpixbuf.PixbufModulePattern
All Implemented Interfaces:
Proxy

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

The signature prefix for a module.

The signature of a module is a set of prefixes. Prefixes are encoded as pairs of ordinary strings, where the second string, called the mask, if not NULL, must be of the same length as the first one and may contain ' ', '!', 'x', 'z', and 'n' to indicate bytes that must be matched, not matched, "don't-care"-bytes, zeros and non-zeros, respectively.

Each prefix has an associated integer that describes the relevance of the prefix, with 0 meaning a mismatch and 100 a "perfect match".

Starting with gdk-pixbuf 2.8, the first byte of the mask may be '', indicating an unanchored pattern that matches not only at the beginning, but also in the middle. Versions prior to 2.8 will interpret the '' like an 'x'.

The signature of a module is stored as an array of GdkPixbufModulePatterns. The array is terminated by a pattern where the prefix is NULL.

GdkPixbufModulePattern *signature[] = {
  { "abcdx", " !x z", 100 },
  { "bla", NULL,  90 },
  { NULL, NULL, 0 }
};

In the example above, the signature matches e.g. "auud\0" with relevance 100, and "blau" with relevance 90.

Since:
2.2
  • Constructor Details

    • PixbufModulePattern

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

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

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

      public PixbufModulePattern(String prefix, String mask, int relevance, Arena arena)
      Allocate a new PixbufModulePattern with the fields set to the provided values.
      Parameters:
      prefix - value for the field prefix
      mask - value for the field mask
      relevance - value for the field relevance
      arena - to control the memory allocation scope
    • PixbufModulePattern

      public PixbufModulePattern(String prefix, String mask, int relevance)
      Allocate a new PixbufModulePattern with the fields set to the provided values. The memory is allocated with Arena.ofAuto().
      Parameters:
      prefix - value for the field prefix
      mask - value for the field mask
      relevance - value for the field relevance
  • Method Details

    • getMemoryLayout

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

      public String readPrefix()
      Read the value of the field prefix.
      Returns:
      The value of the field prefix
    • writePrefix

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

      public String readMask()
      Read the value of the field mask.
      Returns:
      The value of the field mask
    • writeMask

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

      public int readRelevance()
      Read the value of the field relevance.
      Returns:
      The value of the field relevance
    • writeRelevance

      public void writeRelevance(int relevance)
      Write a value in the field relevance.
      Parameters:
      relevance - The new value for the field relevance