Class PixbufFormat
- All Implemented Interfaces:
Proxy
GdkPixbufFormat
contains information about the image format accepted
by a module.
Only modules should access the fields directly, applications should
use the gdk_pixbuf_format_*
family of functions.
-
Constructor Summary
ConstructorDescriptionAllocate a new PixbufFormat.PixbufFormat
(Arena arena) Allocate a new PixbufFormat.PixbufFormat
(MemorySegment address) Create a PixbufFormat proxy instance for the provided memory address.PixbufFormat
(String name, PixbufModulePattern signature, String domain, String description, String[] mimeTypes, String[] extensions, int flags, boolean disabled, String license) Allocate a new PixbufFormat with the fields set to the provided values.PixbufFormat
(String name, PixbufModulePattern signature, String domain, String description, String[] mimeTypes, String[] extensions, int flags, boolean disabled, String license, Arena arena) Allocate a new PixbufFormat with the fields set to the provided values. -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Creates a copy offormat
.void
free()
Frees the resources allocated when copying aGdkPixbufFormat
using gdk_pixbuf_format_copy()Returns a description of the format.String[]
Returns the filename extensions typically used for files in the given format.Returns information about the license of the image loader for the format.static MemoryLayout
The memory layout of the native struct.String[]
Returns the mime types supported by the format.getName()
Returns the name of the format.static Type
getType()
Get the GType of the PixbufFormat classboolean
Returns whether this image format is disabled.boolean
isSaveOptionSupported
(String optionKey) ReturnsTRUE
if the save option specified byoptionKey
is supported when saving a pixbuf using the module implementing this PixbufFormat.boolean
Returns whether this image format is scalable.boolean
Returns whether pixbufs can be saved in the given format.Read the value of the fielddescription
.boolean
Read the value of the fielddisabled
.Read the value of the fielddomain
.String[]
Read the value of the fieldextensions
.int
Read the value of the fieldflags
.Read the value of the fieldlicense
.String[]
Read the value of the fieldmime_types
.readName()
Read the value of the fieldname
.Read the value of the fieldsignature
.void
setDisabled
(boolean disabled) Disables or enables an image format.void
writeDescription
(String description, Arena _arena) Write a value in the fielddescription
.void
writeDisabled
(boolean disabled) Write a value in the fielddisabled
.void
writeDomain
(String domain, Arena _arena) Write a value in the fielddomain
.void
writeExtensions
(String[] extensions, Arena _arena) Write a value in the fieldextensions
.void
writeFlags
(int flags) Write a value in the fieldflags
.void
writeLicense
(String license, Arena _arena) Write a value in the fieldlicense
.void
writeMimeTypes
(String[] mimeTypes, Arena _arena) Write a value in the fieldmime_types
.void
Write a value in the fieldname
.void
writeSignature
(PixbufModulePattern signature) Write a value in the fieldsignature
.Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
PixbufFormat
Create a PixbufFormat proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
PixbufFormat
Allocate a new PixbufFormat.- Parameters:
arena
- to control the memory allocation scope
-
PixbufFormat
public PixbufFormat()Allocate a new PixbufFormat. The memory is allocated withArena.ofAuto()
. -
PixbufFormat
public PixbufFormat(String name, PixbufModulePattern signature, String domain, String description, String[] mimeTypes, String[] extensions, int flags, boolean disabled, String license, Arena arena) Allocate a new PixbufFormat with the fields set to the provided values.- Parameters:
name
- value for the fieldname
signature
- value for the fieldsignature
domain
- value for the fielddomain
description
- value for the fielddescription
mimeTypes
- value for the fieldmimeTypes
extensions
- value for the fieldextensions
flags
- value for the fieldflags
disabled
- value for the fielddisabled
license
- value for the fieldlicense
arena
- to control the memory allocation scope
-
PixbufFormat
public PixbufFormat(String name, PixbufModulePattern signature, String domain, String description, String[] mimeTypes, String[] extensions, int flags, boolean disabled, String license) Allocate a new PixbufFormat with the fields set to the provided values. The memory is allocated withArena.ofAuto()
.- Parameters:
name
- value for the fieldname
signature
- value for the fieldsignature
domain
- value for the fielddomain
description
- value for the fielddescription
mimeTypes
- value for the fieldmimeTypes
extensions
- value for the fieldextensions
flags
- value for the fieldflags
disabled
- value for the fielddisabled
license
- value for the fieldlicense
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
readName
-
writeName
-
readSignature
Read the value of the fieldsignature
.- Returns:
- The value of the field
signature
-
writeSignature
Write a value in the fieldsignature
.- Parameters:
signature
- The new value for the fieldsignature
-
readDomain
Read the value of the fielddomain
.- Returns:
- The value of the field
domain
-
writeDomain
-
readDescription
Read the value of the fielddescription
.- Returns:
- The value of the field
description
-
writeDescription
-
readMimeTypes
Read the value of the fieldmime_types
.- Returns:
- The value of the field
mime_types
-
writeMimeTypes
-
readExtensions
Read the value of the fieldextensions
.- Returns:
- The value of the field
extensions
-
writeExtensions
-
readFlags
public int readFlags()Read the value of the fieldflags
.- Returns:
- The value of the field
flags
-
writeFlags
public void writeFlags(int flags) Write a value in the fieldflags
.- Parameters:
flags
- The new value for the fieldflags
-
readDisabled
public boolean readDisabled()Read the value of the fielddisabled
.- Returns:
- The value of the field
disabled
-
writeDisabled
public void writeDisabled(boolean disabled) Write a value in the fielddisabled
.- Parameters:
disabled
- The new value for the fielddisabled
-
readLicense
Read the value of the fieldlicense
.- Returns:
- The value of the field
license
-
writeLicense
-
copy
Creates a copy offormat
.- Returns:
- the newly allocated copy of a
GdkPixbufFormat
. Use gdk_pixbuf_format_free() to free the resources when done
-
free
public void free()Frees the resources allocated when copying aGdkPixbufFormat
using gdk_pixbuf_format_copy() -
getDescription
Returns a description of the format.- Returns:
- a description of the format.
-
getExtensions
Returns the filename extensions typically used for files in the given format.- Returns:
- an array of filename extensions
-
getLicense
Returns information about the license of the image loader for the format.The returned string should be a shorthand for a well known license, e.g. "LGPL", "GPL", "QPL", "GPL/QPL", or "other" to indicate some other license.
- Returns:
- a string describing the license of the pixbuf format
-
getMimeTypes
Returns the mime types supported by the format.- Returns:
- an array of mime types
-
getName
-
isDisabled
public boolean isDisabled()Returns whether this image format is disabled.See gdk_pixbuf_format_set_disabled().
- Returns:
- whether this image format is disabled.
-
isSaveOptionSupported
ReturnsTRUE
if the save option specified byoptionKey
is supported when saving a pixbuf using the module implementing this PixbufFormat.See gdk_pixbuf_save() for more information about option keys.
- Parameters:
optionKey
- the name of an option- Returns:
TRUE
if the specified option is supported
-
isScalable
public boolean isScalable()Returns whether this image format is scalable.If a file is in a scalable format, it is preferable to load it at the desired size, rather than loading it at the default size and scaling the resulting pixbuf to the desired size.
- Returns:
- whether this image format is scalable.
-
isWritable
public boolean isWritable()Returns whether pixbufs can be saved in the given format.- Returns:
- whether pixbufs can be saved in the given format.
-
setDisabled
public void setDisabled(boolean disabled) Disables or enables an image format.If a format is disabled, GdkPixbuf won't use the image loader for this format to load images.
Applications can use this to avoid using image loaders with an inappropriate license, see gdk_pixbuf_format_get_license().
- Parameters:
disabled
-TRUE
to disable the format this PixbufFormat
-