A 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.
function Convert is new Ada.Unchecked_Conversion
(Gdk_Pixbuf_Format_Access, System.Address);
function Convert is new Ada.Unchecked_Conversion
(System.Address, Gdk_Pixbuf_Format_Access);
function Copy
(Self : Gdk_Pixbuf_Format_Access) return Gdk_Pixbuf_Format_Access
Creates a copy of format. Since: gtk+ 2.22
the newly allocated copy of a GdkPixbufFormat. Use Gdk.Pixbuf_Format.Free to free the resources when done
package Format_List is new Glib.GSlist.Generic_SList
(Gdk_Pixbuf_Format_Access);
procedure Free (Self : Gdk_Pixbuf_Format_Access)
Frees the resources allocated when copying a GdkPixbufFormat using Gdk.Pixbuf_Format.Copy Since: gtk+ 2.22
function From_Object_Free
(B : not null access Gdk_Pixbuf_Format) return Gdk_Pixbuf_Format
Return the underlying object and free the pointer. This is meant to be used internally by GtkAda, and should not in general be called by user code.
function From_Object_Free
(B : not null access Gdk_Pixbuf_Module_Pattern) return Gdk_Pixbuf_Module_Pattern
Return the underlying object and free the pointer. This is meant to be used internally by GtkAda, and should not in general be called by user code.
type Gdk_Pixbuf_Format is record
Name : Gtkada.Types.Chars_Ptr;
Signature : System.Address := System.Null_Address;
Domain : Gtkada.Types.Chars_Ptr;
Description : Gtkada.Types.Chars_Ptr;
Mime_Types : Gtkada.Types.char_array_access;
Extensions : Gtkada.Types.char_array_access;
Flags : Guint32;
Disabled : Glib.Gboolean;
License : Gtkada.Types.Chars_Ptr;
end record;
A 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.
type Gdk_Pixbuf_Format_Access is access all Gdk_Pixbuf_Format;
type Gdk_Pixbuf_Module_Pattern is record
Prefix : Gtkada.Types.Chars_Ptr;
Mask : Gtkada.Types.Chars_Ptr;
Relevance : Glib.Gint;
end record;
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.
{ "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.
function Get_Description
(Self : Gdk_Pixbuf_Format_Access) return UTF8_String
Returns a description of the format. Since: gtk+ 2.2
a description of the format.
function Get_Extensions
(Self : Gdk_Pixbuf_Format_Access) return GNAT.Strings.String_List
Returns the filename extensions typically used for files in the given format. Since: gtk+ 2.2
an array of filename extensions
function Get_License (Self : Gdk_Pixbuf_Format_Access) return UTF8_String
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. Since: gtk+ 2.6
a string describing the license of the pixbuf format
function Get_Mime_Types
(Self : Gdk_Pixbuf_Format_Access) return GNAT.Strings.String_List
Returns the mime types supported by the format. Since: gtk+ 2.2
an array of mime types
function Get_Name (Self : Gdk_Pixbuf_Format_Access) return UTF8_String
Returns the name of the format. Since: gtk+ 2.2
the name of the format.
function Get_Type return Glib.GType
function Is_Disabled (Self : Gdk_Pixbuf_Format_Access) return Boolean
Returns whether this image format is disabled. See Gdk.Pixbuf_Format.Set_Disabled. Since: gtk+ 2.6
whether this image format is disabled.
function Is_Save_Option_Supported
(Self : Gdk_Pixbuf_Format_Access;
Option_Key : UTF8_String) return Boolean
Returns TRUE if the save option specified by Option_Key is supported when saving a pixbuf using the module implementing Format. See gdk_pixbuf_save for more information about option keys. Since: gtk+ 2.36
the name of an option
TRUE if the specified option is supported
function Is_Scalable (Self : Gdk_Pixbuf_Format_Access) return Boolean
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. Since: gtk+ 2.6
whether this image format is scalable.
function Is_Writable (Self : Gdk_Pixbuf_Format_Access) return Boolean
Returns whether pixbufs can be saved in the given format. Since: gtk+ 2.2
whether pixbufs can be saved in the given format.
procedure Set_Disabled
(Self : Gdk_Pixbuf_Format_Access;
Disabled : Boolean)
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. Since: gtk+ 2.6
TRUE to disable the format Format