Class PixbufModulePattern
- All Implemented Interfaces:
Proxy
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.
-
Constructor Summary
ConstructorDescriptionAllocate a new PixbufModulePattern.PixbufModulePattern
(Arena arena) Allocate a new PixbufModulePattern.PixbufModulePattern
(MemorySegment address) Create a PixbufModulePattern proxy instance for the provided memory address.PixbufModulePattern
(String prefix, String mask, int relevance) Allocate a new PixbufModulePattern with the fields set to the provided values.PixbufModulePattern
(String prefix, String mask, int relevance, Arena arena) Allocate a new PixbufModulePattern with the fields set to the provided values. -
Method Summary
Modifier and TypeMethodDescriptionstatic MemoryLayout
The memory layout of the native struct.readMask()
Read the value of the fieldmask
.Read the value of the fieldprefix
.int
Read the value of the fieldrelevance
.void
Write a value in the fieldmask
.void
writePrefix
(String prefix, Arena _arena) Write a value in the fieldprefix
.void
writeRelevance
(int relevance) Write a value in the fieldrelevance
.Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
PixbufModulePattern
Create a PixbufModulePattern proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
PixbufModulePattern
Allocate a new PixbufModulePattern.- Parameters:
arena
- to control the memory allocation scope
-
PixbufModulePattern
public PixbufModulePattern()Allocate a new PixbufModulePattern. The memory is allocated withArena.ofAuto()
. -
PixbufModulePattern
Allocate a new PixbufModulePattern with the fields set to the provided values.- Parameters:
prefix
- value for the fieldprefix
mask
- value for the fieldmask
relevance
- value for the fieldrelevance
arena
- to control the memory allocation scope
-
PixbufModulePattern
Allocate a new PixbufModulePattern with the fields set to the provided values. The memory is allocated withArena.ofAuto()
.- Parameters:
prefix
- value for the fieldprefix
mask
- value for the fieldmask
relevance
- value for the fieldrelevance
-
-
Method Details
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
readPrefix
Read the value of the fieldprefix
.- Returns:
- The value of the field
prefix
-
writePrefix
-
readMask
-
writeMask
-
readRelevance
public int readRelevance()Read the value of the fieldrelevance
.- Returns:
- The value of the field
relevance
-
writeRelevance
public void writeRelevance(int relevance) Write a value in the fieldrelevance
.- Parameters:
relevance
- The new value for the fieldrelevance
-