2 * This file is part of duit.
4 * duit is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * duit is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with duit; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = gdk-pixbuf-Module-Interface.html
27 * outFile = PixbufFormat
28 * strct = GdkPixbufFormat
39 * - gdk_pixbuf_format_
49 * - GdkPixbuf* -> Pixbuf
53 module gdkpixbuf
.PixbufFormat
;
55 private import gdkpixbuf
.gdkpixbuftypes
;
57 private import lib
.gdkpixbuf
;
59 private import gdk
.Pixbuf
;
60 private import glib
.ListSG
;
61 private import glib
.Str
;
65 * If gdk-pixbuf has been compiled with GModule support, it can be extended by
66 * modules which can load (and perhaps also save) new image and animation
67 * formats. Each loadable module must export a
68 * GdkPixbufModuleFillInfoFunc function named fill_info and
69 * a GdkPixbufModuleFillVtableFunc function named
71 * In order to make format-checking work before actually loading the modules
72 * (which may require dlopening image libraries), modules export their
73 * signatures (and other information) via the fill_info
74 * function. An external utility, gdk-pixbuf-query-loaders,
75 * uses this to create a text file containing a list of all available loaders and
76 * their signatures. This file is then read at runtime by gdk-pixbuf to obtain
77 * the list of available loaders and their signatures.
78 * Modules may only implement a subset of the functionality available via
79 * GdkPixbufModule. If a particular functionality is not implemented, the
80 * fill_vtable function will simply not set the corresponding
81 * function pointers of the GdkPixbufModule structure. If a module supports
82 * incremental loading (i.e. provides begin_load, stop_load and
83 * load_increment), it doesn't have to implement load, since gdk-pixbuf can
84 * supply a generic load implementation wrapping the incremental loading.
85 * Installing a module is a two-step process:
86 * copy the module file(s) to the loader directory (normally
87 * libdir/gtk-2.0/version/loaders,
88 * unless overridden by the environment variable
89 * GDK_PIXBUF_MODULEDIR)
90 * call gdk-pixbuf-query-loaders to update the
91 * module file (normally
92 * sysconfdir/gtk-2.0/gdk-pixbuf.loaders,
93 * unless overridden by the environment variable
94 * GDK_PIXBUF_MODULE_FILE)
95 * The gdk-pixbuf interfaces needed for implementing modules are contained in
96 * gdk-pixbuf-io.h (and
97 * gdk-pixbuf-animation.h if the module supports animations).
98 * They are not covered by the same stability guarantees as the regular
99 * gdk-pixbuf API. To underline this fact, they are protected by
100 * ifdef GDK_PIXBUF_ENABLE_BACKEND.
102 public class PixbufFormat
105 /** the main Gtk struct */
106 protected GdkPixbufFormat
* gdkPixbufFormat
;
109 public GdkPixbufFormat
* getPixbufFormatStruct()
111 return gdkPixbufFormat
;
115 /** the main Gtk struct as a void* */
116 protected void* getStruct()
118 return cast(void*)gdkPixbufFormat
;
122 * Sets our main struct and passes it to the parent class
124 public this (GdkPixbufFormat
* gdkPixbufFormat
)
126 this.gdkPixbufFormat
= gdkPixbufFormat
;
131 * The gdk-pixbuf library provides a simple mechanism for loading
132 * an image from a file in synchronous fashion. This means that the
133 * library takes control of the application while the file is being
134 * loaded; from the user's point of view, the application will block
135 * until the image is done loading.
136 * This interface can be used by applications in which blocking is
137 * acceptable while an image is being loaded. It can also be used to
138 * load small images in general. Applications that need progressive
139 * loading can use the GdkPixbufLoader functionality instead.
143 * Attaches a key/value pair as an option to a GdkPixbuf. If key already
144 * exists in the list of options attached to pixbuf, the new value is
145 * ignored and FALSE is returned.
149 * a nul-terminated string.
151 * a nul-terminated string.
156 public static int gdkPixbufSetOption(Pixbuf pixbuf
, char[] key
, char[] value
)
158 // gboolean gdk_pixbuf_set_option (GdkPixbuf *pixbuf, const gchar *key, const gchar *value);
159 return gdk_pixbuf_set_option((pixbuf
is null) ?
null : pixbuf
.getPixbufStruct(), Str
.toStringz(key
), Str
.toStringz(value
));
163 * Obtains the available information about the image formats supported
166 * A list of GdkPixbufFormats describing the supported
167 * image formats. The list should be freed when it is no longer needed,
168 * but the structures themselves are owned by GdkPixbuf and should not be
172 public static ListSG
gdkPixbufGetFormats()
174 // GSList* gdk_pixbuf_get_formats (void);
175 return new ListSG( gdk_pixbuf_get_formats() );
179 * Returns the name of the format.
183 * the name of the format.
186 public char[] getName()
188 // gchar* gdk_pixbuf_format_get_name (GdkPixbufFormat *format);
189 return Str
.toString(gdk_pixbuf_format_get_name(gdkPixbufFormat
) );
193 * Returns a description of the format.
197 * a description of the format.
200 public char[] getDescription()
202 // gchar* gdk_pixbuf_format_get_description (GdkPixbufFormat *format);
203 return Str
.toString(gdk_pixbuf_format_get_description(gdkPixbufFormat
) );
207 * Returns the mime types supported by the format.
211 * a NULL-terminated array of mime types which must be freed with
212 * g_strfreev() when it is no longer needed.
215 public char** getMimeTypes()
217 // gchar** gdk_pixbuf_format_get_mime_types (GdkPixbufFormat *format);
218 return gdk_pixbuf_format_get_mime_types(gdkPixbufFormat
);
222 * Returns the filename extensions typically used for files in the
227 * a NULL-terminated array of filename extensions which must be
228 * freed with g_strfreev() when it is no longer needed.
231 public char** getExtensions()
233 // gchar** gdk_pixbuf_format_get_extensions (GdkPixbufFormat *format);
234 return gdk_pixbuf_format_get_extensions(gdkPixbufFormat
);
238 * Returns whether pixbufs can be saved in the given format.
242 * whether pixbufs can be saved in the given format.
245 public int isWritable()
247 // gboolean gdk_pixbuf_format_is_writable (GdkPixbufFormat *format);
248 return gdk_pixbuf_format_is_writable(gdkPixbufFormat
);
252 * Returns whether this image format is scalable. If a file is in a
253 * scalable format, it is preferable to load it at the desired size,
254 * rather than loading it at the default size and scaling the
255 * resulting pixbuf to the desired size.
259 * whether this image format is scalable.
262 public int isScalable()
264 // gboolean gdk_pixbuf_format_is_scalable (GdkPixbufFormat *format);
265 return gdk_pixbuf_format_is_scalable(gdkPixbufFormat
);
269 * Returns whether this image format is disabled. See
270 * gdk_pixbuf_format_set_disabled().
274 * whether this image format is disabled.
277 public int isDisabled()
279 // gboolean gdk_pixbuf_format_is_disabled (GdkPixbufFormat *format);
280 return gdk_pixbuf_format_is_disabled(gdkPixbufFormat
);
284 * Disables or enables an image format. If a format is disabled,
285 * gdk-pixbuf won't use the image loader for this format to load
286 * images. Applications can use this to avoid using image loaders
287 * with an inappropriate license, see gdk_pixbuf_format_get_license().
291 * TRUE to disable the format format
294 public void setDisabled(int disabled
)
296 // void gdk_pixbuf_format_set_disabled (GdkPixbufFormat *format, gboolean disabled);
297 gdk_pixbuf_format_set_disabled(gdkPixbufFormat
, disabled
);
301 * Returns information about the license of the image loader for the format. The
302 * returned string should be a shorthand for a wellknown license, e.g. "LGPL",
303 * "GPL", "QPL", "GPL/QPL", or "other" to indicate some other license. This
304 * string should be freed with g_free() when it's no longer needed.
308 * a string describing the license of format.
311 public char[] getLicense()
313 // gchar* gdk_pixbuf_format_get_license (GdkPixbufFormat *format);
314 return Str
.toString(gdk_pixbuf_format_get_license(gdkPixbufFormat
) );
332 * Parses an image file far enough to determine its format and size.
334 * The name of the file to identify.
336 * Return location for the width of the image, or NULL
338 * Return location for the height of the image, or NULL
340 * A GdkPixbufFormat describing the image format of the file
341 * or NULL if the image format wasn't recognized. The return value
342 * is owned by GdkPixbuf and should not be freed.
347 public static GdkPixbufFormat
* getFileInfo(char[] filename
, int* width
, int* height
)
349 // GdkPixbufFormat* gdk_pixbuf_get_file_info (const gchar *filename, gint *width, gint *height);
350 return gdk_pixbuf_get_file_info(Str
.toStringz(filename
), width
, height
);