1#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
6#![allow(
7 clippy::approx_constant,
8 clippy::type_complexity,
9 clippy::unreadable_literal,
10 clippy::upper_case_acronyms
11)]
12#![cfg_attr(docsrs, feature(doc_cfg))]
13
14use gio_sys as gio;
15use glib_sys as glib;
16use gobject_sys as gobject;
17
18#[cfg(unix)]
19#[allow(unused_imports)]
20use libc::{dev_t, gid_t, pid_t, socklen_t, uid_t};
21#[allow(unused_imports)]
22use libc::{intptr_t, off_t, size_t, ssize_t, time_t, uintptr_t, FILE};
23#[allow(unused_imports)]
24use std::ffi::{
25 c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void,
26};
27
28#[allow(unused_imports)]
29use glib::{gboolean, gconstpointer, gpointer, GType};
30
31pub type GdkColorspace = c_int;
33pub const GDK_COLORSPACE_RGB: GdkColorspace = 0;
34
35pub type GdkInterpType = c_int;
36pub const GDK_INTERP_NEAREST: GdkInterpType = 0;
37pub const GDK_INTERP_TILES: GdkInterpType = 1;
38pub const GDK_INTERP_BILINEAR: GdkInterpType = 2;
39pub const GDK_INTERP_HYPER: GdkInterpType = 3;
40
41pub type GdkPixbufAlphaMode = c_int;
42pub const GDK_PIXBUF_ALPHA_BILEVEL: GdkPixbufAlphaMode = 0;
43pub const GDK_PIXBUF_ALPHA_FULL: GdkPixbufAlphaMode = 1;
44
45pub type GdkPixbufError = c_int;
46pub const GDK_PIXBUF_ERROR_CORRUPT_IMAGE: GdkPixbufError = 0;
47pub const GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY: GdkPixbufError = 1;
48pub const GDK_PIXBUF_ERROR_BAD_OPTION: GdkPixbufError = 2;
49pub const GDK_PIXBUF_ERROR_UNKNOWN_TYPE: GdkPixbufError = 3;
50pub const GDK_PIXBUF_ERROR_UNSUPPORTED_OPERATION: GdkPixbufError = 4;
51pub const GDK_PIXBUF_ERROR_FAILED: GdkPixbufError = 5;
52pub const GDK_PIXBUF_ERROR_INCOMPLETE_ANIMATION: GdkPixbufError = 6;
53
54pub type GdkPixbufRotation = c_int;
55pub const GDK_PIXBUF_ROTATE_NONE: GdkPixbufRotation = 0;
56pub const GDK_PIXBUF_ROTATE_COUNTERCLOCKWISE: GdkPixbufRotation = 90;
57pub const GDK_PIXBUF_ROTATE_UPSIDEDOWN: GdkPixbufRotation = 180;
58pub const GDK_PIXBUF_ROTATE_CLOCKWISE: GdkPixbufRotation = 270;
59
60pub type GdkPixbufFormatFlags = c_uint;
64pub const GDK_PIXBUF_FORMAT_WRITABLE: GdkPixbufFormatFlags = 1;
65pub const GDK_PIXBUF_FORMAT_SCALABLE: GdkPixbufFormatFlags = 2;
66pub const GDK_PIXBUF_FORMAT_THREADSAFE: GdkPixbufFormatFlags = 4;
67
68pub type GdkPixbufDestroyNotify = Option<unsafe extern "C" fn(*mut u8, gpointer)>;
70pub type GdkPixbufModuleBeginLoadFunc = Option<
71 unsafe extern "C" fn(
72 GdkPixbufModuleSizeFunc,
73 GdkPixbufModulePreparedFunc,
74 GdkPixbufModuleUpdatedFunc,
75 gpointer,
76 *mut *mut glib::GError,
77 ) -> gpointer,
78>;
79pub type GdkPixbufModuleFillInfoFunc = Option<unsafe extern "C" fn(*mut GdkPixbufFormat)>;
80pub type GdkPixbufModuleFillVtableFunc = Option<unsafe extern "C" fn(*mut GdkPixbufModule)>;
81pub type GdkPixbufModuleIncrementLoadFunc =
82 Option<unsafe extern "C" fn(gpointer, *const u8, c_uint, *mut *mut glib::GError) -> gboolean>;
83pub type GdkPixbufModuleLoadAnimationFunc =
84 Option<unsafe extern "C" fn(*mut FILE, *mut *mut glib::GError) -> *mut GdkPixbufAnimation>;
85pub type GdkPixbufModuleLoadFunc =
86 Option<unsafe extern "C" fn(*mut FILE, *mut *mut glib::GError) -> *mut GdkPixbuf>;
87pub type GdkPixbufModuleLoadXpmDataFunc =
88 Option<unsafe extern "C" fn(*mut *const c_char) -> *mut GdkPixbuf>;
89pub type GdkPixbufModulePreparedFunc =
90 Option<unsafe extern "C" fn(*mut GdkPixbuf, *mut GdkPixbufAnimation, gpointer)>;
91pub type GdkPixbufModuleSaveCallbackFunc = Option<
92 unsafe extern "C" fn(
93 GdkPixbufSaveFunc,
94 gpointer,
95 *mut GdkPixbuf,
96 *mut *mut c_char,
97 *mut *mut c_char,
98 *mut *mut glib::GError,
99 ) -> gboolean,
100>;
101pub type GdkPixbufModuleSaveFunc = Option<
102 unsafe extern "C" fn(
103 *mut FILE,
104 *mut GdkPixbuf,
105 *mut *mut c_char,
106 *mut *mut c_char,
107 *mut *mut glib::GError,
108 ) -> gboolean,
109>;
110pub type GdkPixbufModuleSaveOptionSupportedFunc =
111 Option<unsafe extern "C" fn(*const c_char) -> gboolean>;
112pub type GdkPixbufModuleSizeFunc = Option<unsafe extern "C" fn(*mut c_int, *mut c_int, gpointer)>;
113pub type GdkPixbufModuleStopLoadFunc =
114 Option<unsafe extern "C" fn(gpointer, *mut *mut glib::GError) -> gboolean>;
115pub type GdkPixbufModuleUpdatedFunc =
116 Option<unsafe extern "C" fn(*mut GdkPixbuf, c_int, c_int, c_int, c_int, gpointer)>;
117pub type GdkPixbufSaveFunc =
118 Option<unsafe extern "C" fn(*const u8, size_t, *mut *mut glib::GError, gpointer) -> gboolean>;
119
120#[derive(Copy, Clone)]
122#[repr(C)]
123pub struct GdkPixbufAnimationClass {
124 pub parent_class: gobject::GObjectClass,
125 pub is_static_image: Option<unsafe extern "C" fn(*mut GdkPixbufAnimation) -> gboolean>,
126 pub get_static_image: Option<unsafe extern "C" fn(*mut GdkPixbufAnimation) -> *mut GdkPixbuf>,
127 pub get_size: Option<unsafe extern "C" fn(*mut GdkPixbufAnimation, *mut c_int, *mut c_int)>,
128 pub get_iter: Option<
129 unsafe extern "C" fn(
130 *mut GdkPixbufAnimation,
131 *const glib::GTimeVal,
132 ) -> *mut GdkPixbufAnimationIter,
133 >,
134}
135
136impl ::std::fmt::Debug for GdkPixbufAnimationClass {
137 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
138 f.debug_struct(&format!("GdkPixbufAnimationClass @ {self:p}"))
139 .field("parent_class", &self.parent_class)
140 .field("is_static_image", &self.is_static_image)
141 .field("get_static_image", &self.get_static_image)
142 .field("get_size", &self.get_size)
143 .field("get_iter", &self.get_iter)
144 .finish()
145 }
146}
147
148#[derive(Copy, Clone)]
149#[repr(C)]
150pub struct GdkPixbufAnimationIterClass {
151 pub parent_class: gobject::GObjectClass,
152 pub get_delay_time: Option<unsafe extern "C" fn(*mut GdkPixbufAnimationIter) -> c_int>,
153 pub get_pixbuf: Option<unsafe extern "C" fn(*mut GdkPixbufAnimationIter) -> *mut GdkPixbuf>,
154 pub on_currently_loading_frame:
155 Option<unsafe extern "C" fn(*mut GdkPixbufAnimationIter) -> gboolean>,
156 pub advance: Option<
157 unsafe extern "C" fn(*mut GdkPixbufAnimationIter, *const glib::GTimeVal) -> gboolean,
158 >,
159}
160
161impl ::std::fmt::Debug for GdkPixbufAnimationIterClass {
162 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
163 f.debug_struct(&format!("GdkPixbufAnimationIterClass @ {self:p}"))
164 .field("parent_class", &self.parent_class)
165 .field("get_delay_time", &self.get_delay_time)
166 .field("get_pixbuf", &self.get_pixbuf)
167 .field(
168 "on_currently_loading_frame",
169 &self.on_currently_loading_frame,
170 )
171 .field("advance", &self.advance)
172 .finish()
173 }
174}
175
176#[derive(Copy, Clone)]
177#[repr(C)]
178pub struct GdkPixbufFormat {
179 pub name: *mut c_char,
180 pub signature: *mut GdkPixbufModulePattern,
181 pub domain: *mut c_char,
182 pub description: *mut c_char,
183 pub mime_types: *mut *mut c_char,
184 pub extensions: *mut *mut c_char,
185 pub flags: u32,
186 pub disabled: gboolean,
187 pub license: *mut c_char,
188}
189
190impl ::std::fmt::Debug for GdkPixbufFormat {
191 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
192 f.debug_struct(&format!("GdkPixbufFormat @ {self:p}"))
193 .field("name", &self.name)
194 .field("signature", &self.signature)
195 .field("domain", &self.domain)
196 .field("description", &self.description)
197 .field("mime_types", &self.mime_types)
198 .field("extensions", &self.extensions)
199 .field("flags", &self.flags)
200 .field("disabled", &self.disabled)
201 .field("license", &self.license)
202 .finish()
203 }
204}
205
206#[derive(Copy, Clone)]
207#[repr(C)]
208pub struct GdkPixbufLoaderClass {
209 pub parent_class: gobject::GObjectClass,
210 pub size_prepared: Option<unsafe extern "C" fn(*mut GdkPixbufLoader, c_int, c_int)>,
211 pub area_prepared: Option<unsafe extern "C" fn(*mut GdkPixbufLoader)>,
212 pub area_updated:
213 Option<unsafe extern "C" fn(*mut GdkPixbufLoader, c_int, c_int, c_int, c_int)>,
214 pub closed: Option<unsafe extern "C" fn(*mut GdkPixbufLoader)>,
215}
216
217impl ::std::fmt::Debug for GdkPixbufLoaderClass {
218 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
219 f.debug_struct(&format!("GdkPixbufLoaderClass @ {self:p}"))
220 .field("parent_class", &self.parent_class)
221 .field("size_prepared", &self.size_prepared)
222 .field("area_prepared", &self.area_prepared)
223 .field("area_updated", &self.area_updated)
224 .field("closed", &self.closed)
225 .finish()
226 }
227}
228
229#[derive(Copy, Clone)]
230#[repr(C)]
231pub struct GdkPixbufModule {
232 pub module_name: *mut c_char,
233 pub module_path: *mut c_char,
234 pub module: gpointer,
235 pub info: *mut GdkPixbufFormat,
236 pub load: GdkPixbufModuleLoadFunc,
237 pub load_xpm_data: GdkPixbufModuleLoadXpmDataFunc,
238 pub begin_load: GdkPixbufModuleBeginLoadFunc,
239 pub stop_load: GdkPixbufModuleStopLoadFunc,
240 pub load_increment: GdkPixbufModuleIncrementLoadFunc,
241 pub load_animation: GdkPixbufModuleLoadAnimationFunc,
242 pub save: GdkPixbufModuleSaveFunc,
243 pub save_to_callback: GdkPixbufModuleSaveCallbackFunc,
244 pub is_save_option_supported: GdkPixbufModuleSaveOptionSupportedFunc,
245 pub _reserved1: Option<unsafe extern "C" fn()>,
246 pub _reserved2: Option<unsafe extern "C" fn()>,
247 pub _reserved3: Option<unsafe extern "C" fn()>,
248 pub _reserved4: Option<unsafe extern "C" fn()>,
249}
250
251impl ::std::fmt::Debug for GdkPixbufModule {
252 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
253 f.debug_struct(&format!("GdkPixbufModule @ {self:p}"))
254 .field("module_name", &self.module_name)
255 .field("module_path", &self.module_path)
256 .field("module", &self.module)
257 .field("info", &self.info)
258 .field("load", &self.load)
259 .field("load_xpm_data", &self.load_xpm_data)
260 .field("begin_load", &self.begin_load)
261 .field("stop_load", &self.stop_load)
262 .field("load_increment", &self.load_increment)
263 .field("load_animation", &self.load_animation)
264 .field("save", &self.save)
265 .field("save_to_callback", &self.save_to_callback)
266 .field("is_save_option_supported", &self.is_save_option_supported)
267 .field("_reserved1", &self._reserved1)
268 .field("_reserved2", &self._reserved2)
269 .field("_reserved3", &self._reserved3)
270 .field("_reserved4", &self._reserved4)
271 .finish()
272 }
273}
274
275#[derive(Copy, Clone)]
276#[repr(C)]
277pub struct GdkPixbufModulePattern {
278 pub prefix: *mut c_char,
279 pub mask: *mut c_char,
280 pub relevance: c_int,
281}
282
283impl ::std::fmt::Debug for GdkPixbufModulePattern {
284 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
285 f.debug_struct(&format!("GdkPixbufModulePattern @ {self:p}"))
286 .field("prefix", &self.prefix)
287 .field("mask", &self.mask)
288 .field("relevance", &self.relevance)
289 .finish()
290 }
291}
292
293#[repr(C)]
294#[allow(dead_code)]
295pub struct _GdkPixbufSimpleAnimClass {
296 _data: [u8; 0],
297 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
298}
299
300pub type GdkPixbufSimpleAnimClass = _GdkPixbufSimpleAnimClass;
301
302#[repr(C)]
304#[allow(dead_code)]
305pub struct GdkPixbuf {
306 _data: [u8; 0],
307 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
308}
309
310impl ::std::fmt::Debug for GdkPixbuf {
311 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
312 f.debug_struct(&format!("GdkPixbuf @ {self:p}")).finish()
313 }
314}
315
316#[derive(Copy, Clone)]
317#[repr(C)]
318pub struct GdkPixbufAnimation {
319 pub parent_instance: gobject::GObject,
320}
321
322impl ::std::fmt::Debug for GdkPixbufAnimation {
323 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
324 f.debug_struct(&format!("GdkPixbufAnimation @ {self:p}"))
325 .field("parent_instance", &self.parent_instance)
326 .finish()
327 }
328}
329
330#[derive(Copy, Clone)]
331#[repr(C)]
332pub struct GdkPixbufAnimationIter {
333 pub parent_instance: gobject::GObject,
334}
335
336impl ::std::fmt::Debug for GdkPixbufAnimationIter {
337 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
338 f.debug_struct(&format!("GdkPixbufAnimationIter @ {self:p}"))
339 .field("parent_instance", &self.parent_instance)
340 .finish()
341 }
342}
343
344#[derive(Copy, Clone)]
345#[repr(C)]
346pub struct GdkPixbufLoader {
347 pub parent_instance: gobject::GObject,
348 pub priv_: gpointer,
349}
350
351impl ::std::fmt::Debug for GdkPixbufLoader {
352 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
353 f.debug_struct(&format!("GdkPixbufLoader @ {self:p}"))
354 .finish()
355 }
356}
357
358#[repr(C)]
359#[allow(dead_code)]
360pub struct GdkPixbufNonAnim {
361 _data: [u8; 0],
362 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
363}
364
365impl ::std::fmt::Debug for GdkPixbufNonAnim {
366 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
367 f.debug_struct(&format!("GdkPixbufNonAnim @ {self:p}"))
368 .finish()
369 }
370}
371
372#[repr(C)]
373#[allow(dead_code)]
374pub struct GdkPixbufSimpleAnim {
375 _data: [u8; 0],
376 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
377}
378
379impl ::std::fmt::Debug for GdkPixbufSimpleAnim {
380 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
381 f.debug_struct(&format!("GdkPixbufSimpleAnim @ {self:p}"))
382 .finish()
383 }
384}
385
386#[repr(C)]
387#[allow(dead_code)]
388pub struct GdkPixbufSimpleAnimIter {
389 _data: [u8; 0],
390 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
391}
392
393impl ::std::fmt::Debug for GdkPixbufSimpleAnimIter {
394 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
395 f.debug_struct(&format!("GdkPixbufSimpleAnimIter @ {self:p}"))
396 .finish()
397 }
398}
399
400extern "C" {
401
402 pub fn gdk_colorspace_get_type() -> GType;
406
407 pub fn gdk_interp_type_get_type() -> GType;
411
412 pub fn gdk_pixbuf_alpha_mode_get_type() -> GType;
416
417 pub fn gdk_pixbuf_error_get_type() -> GType;
421 pub fn gdk_pixbuf_error_quark() -> glib::GQuark;
422
423 pub fn gdk_pixbuf_rotation_get_type() -> GType;
427
428 pub fn gdk_pixbuf_format_get_type() -> GType;
432 pub fn gdk_pixbuf_format_copy(format: *const GdkPixbufFormat) -> *mut GdkPixbufFormat;
433 pub fn gdk_pixbuf_format_free(format: *mut GdkPixbufFormat);
434 pub fn gdk_pixbuf_format_get_description(format: *mut GdkPixbufFormat) -> *mut c_char;
435 pub fn gdk_pixbuf_format_get_extensions(format: *mut GdkPixbufFormat) -> *mut *mut c_char;
436 pub fn gdk_pixbuf_format_get_license(format: *mut GdkPixbufFormat) -> *mut c_char;
437 pub fn gdk_pixbuf_format_get_mime_types(format: *mut GdkPixbufFormat) -> *mut *mut c_char;
438 pub fn gdk_pixbuf_format_get_name(format: *mut GdkPixbufFormat) -> *mut c_char;
439 pub fn gdk_pixbuf_format_is_disabled(format: *mut GdkPixbufFormat) -> gboolean;
440 pub fn gdk_pixbuf_format_is_save_option_supported(
441 format: *mut GdkPixbufFormat,
442 option_key: *const c_char,
443 ) -> gboolean;
444 pub fn gdk_pixbuf_format_is_scalable(format: *mut GdkPixbufFormat) -> gboolean;
445 pub fn gdk_pixbuf_format_is_writable(format: *mut GdkPixbufFormat) -> gboolean;
446 pub fn gdk_pixbuf_format_set_disabled(format: *mut GdkPixbufFormat, disabled: gboolean);
447
448 pub fn gdk_pixbuf_get_type() -> GType;
452 pub fn gdk_pixbuf_new(
453 colorspace: GdkColorspace,
454 has_alpha: gboolean,
455 bits_per_sample: c_int,
456 width: c_int,
457 height: c_int,
458 ) -> *mut GdkPixbuf;
459 pub fn gdk_pixbuf_new_from_bytes(
460 data: *mut glib::GBytes,
461 colorspace: GdkColorspace,
462 has_alpha: gboolean,
463 bits_per_sample: c_int,
464 width: c_int,
465 height: c_int,
466 rowstride: c_int,
467 ) -> *mut GdkPixbuf;
468 pub fn gdk_pixbuf_new_from_data(
469 data: *const u8,
470 colorspace: GdkColorspace,
471 has_alpha: gboolean,
472 bits_per_sample: c_int,
473 width: c_int,
474 height: c_int,
475 rowstride: c_int,
476 destroy_fn: GdkPixbufDestroyNotify,
477 destroy_fn_data: gpointer,
478 ) -> *mut GdkPixbuf;
479 pub fn gdk_pixbuf_new_from_file(
480 filename: *const c_char,
481 error: *mut *mut glib::GError,
482 ) -> *mut GdkPixbuf;
483 pub fn gdk_pixbuf_new_from_file_at_scale(
484 filename: *const c_char,
485 width: c_int,
486 height: c_int,
487 preserve_aspect_ratio: gboolean,
488 error: *mut *mut glib::GError,
489 ) -> *mut GdkPixbuf;
490 pub fn gdk_pixbuf_new_from_file_at_size(
491 filename: *const c_char,
492 width: c_int,
493 height: c_int,
494 error: *mut *mut glib::GError,
495 ) -> *mut GdkPixbuf;
496 pub fn gdk_pixbuf_new_from_inline(
497 data_length: c_int,
498 data: *const u8,
499 copy_pixels: gboolean,
500 error: *mut *mut glib::GError,
501 ) -> *mut GdkPixbuf;
502 pub fn gdk_pixbuf_new_from_resource(
503 resource_path: *const c_char,
504 error: *mut *mut glib::GError,
505 ) -> *mut GdkPixbuf;
506 pub fn gdk_pixbuf_new_from_resource_at_scale(
507 resource_path: *const c_char,
508 width: c_int,
509 height: c_int,
510 preserve_aspect_ratio: gboolean,
511 error: *mut *mut glib::GError,
512 ) -> *mut GdkPixbuf;
513 pub fn gdk_pixbuf_new_from_stream(
514 stream: *mut gio::GInputStream,
515 cancellable: *mut gio::GCancellable,
516 error: *mut *mut glib::GError,
517 ) -> *mut GdkPixbuf;
518 pub fn gdk_pixbuf_new_from_stream_at_scale(
519 stream: *mut gio::GInputStream,
520 width: c_int,
521 height: c_int,
522 preserve_aspect_ratio: gboolean,
523 cancellable: *mut gio::GCancellable,
524 error: *mut *mut glib::GError,
525 ) -> *mut GdkPixbuf;
526 pub fn gdk_pixbuf_new_from_stream_finish(
527 async_result: *mut gio::GAsyncResult,
528 error: *mut *mut glib::GError,
529 ) -> *mut GdkPixbuf;
530 pub fn gdk_pixbuf_new_from_xpm_data(data: *mut *const c_char) -> *mut GdkPixbuf;
531 pub fn gdk_pixbuf_calculate_rowstride(
532 colorspace: GdkColorspace,
533 has_alpha: gboolean,
534 bits_per_sample: c_int,
535 width: c_int,
536 height: c_int,
537 ) -> c_int;
538 pub fn gdk_pixbuf_get_file_info(
539 filename: *const c_char,
540 width: *mut c_int,
541 height: *mut c_int,
542 ) -> *mut GdkPixbufFormat;
543 pub fn gdk_pixbuf_get_file_info_async(
544 filename: *const c_char,
545 cancellable: *mut gio::GCancellable,
546 callback: gio::GAsyncReadyCallback,
547 user_data: gpointer,
548 );
549 pub fn gdk_pixbuf_get_file_info_finish(
550 async_result: *mut gio::GAsyncResult,
551 width: *mut c_int,
552 height: *mut c_int,
553 error: *mut *mut glib::GError,
554 ) -> *mut GdkPixbufFormat;
555 pub fn gdk_pixbuf_get_formats() -> *mut glib::GSList;
556 #[cfg(feature = "v2_40")]
557 #[cfg_attr(docsrs, doc(cfg(feature = "v2_40")))]
558 pub fn gdk_pixbuf_init_modules(path: *const c_char, error: *mut *mut glib::GError) -> gboolean;
559 pub fn gdk_pixbuf_new_from_stream_async(
560 stream: *mut gio::GInputStream,
561 cancellable: *mut gio::GCancellable,
562 callback: gio::GAsyncReadyCallback,
563 user_data: gpointer,
564 );
565 pub fn gdk_pixbuf_new_from_stream_at_scale_async(
566 stream: *mut gio::GInputStream,
567 width: c_int,
568 height: c_int,
569 preserve_aspect_ratio: gboolean,
570 cancellable: *mut gio::GCancellable,
571 callback: gio::GAsyncReadyCallback,
572 user_data: gpointer,
573 );
574 pub fn gdk_pixbuf_save_to_stream_finish(
575 async_result: *mut gio::GAsyncResult,
576 error: *mut *mut glib::GError,
577 ) -> gboolean;
578 pub fn gdk_pixbuf_add_alpha(
579 pixbuf: *const GdkPixbuf,
580 substitute_color: gboolean,
581 r: c_uchar,
582 g: c_uchar,
583 b: c_uchar,
584 ) -> *mut GdkPixbuf;
585 pub fn gdk_pixbuf_apply_embedded_orientation(src: *mut GdkPixbuf) -> *mut GdkPixbuf;
586 pub fn gdk_pixbuf_composite(
587 src: *const GdkPixbuf,
588 dest: *mut GdkPixbuf,
589 dest_x: c_int,
590 dest_y: c_int,
591 dest_width: c_int,
592 dest_height: c_int,
593 offset_x: c_double,
594 offset_y: c_double,
595 scale_x: c_double,
596 scale_y: c_double,
597 interp_type: GdkInterpType,
598 overall_alpha: c_int,
599 );
600 pub fn gdk_pixbuf_composite_color(
601 src: *const GdkPixbuf,
602 dest: *mut GdkPixbuf,
603 dest_x: c_int,
604 dest_y: c_int,
605 dest_width: c_int,
606 dest_height: c_int,
607 offset_x: c_double,
608 offset_y: c_double,
609 scale_x: c_double,
610 scale_y: c_double,
611 interp_type: GdkInterpType,
612 overall_alpha: c_int,
613 check_x: c_int,
614 check_y: c_int,
615 check_size: c_int,
616 color1: u32,
617 color2: u32,
618 );
619 pub fn gdk_pixbuf_composite_color_simple(
620 src: *const GdkPixbuf,
621 dest_width: c_int,
622 dest_height: c_int,
623 interp_type: GdkInterpType,
624 overall_alpha: c_int,
625 check_size: c_int,
626 color1: u32,
627 color2: u32,
628 ) -> *mut GdkPixbuf;
629 pub fn gdk_pixbuf_copy(pixbuf: *const GdkPixbuf) -> *mut GdkPixbuf;
630 pub fn gdk_pixbuf_copy_area(
631 src_pixbuf: *const GdkPixbuf,
632 src_x: c_int,
633 src_y: c_int,
634 width: c_int,
635 height: c_int,
636 dest_pixbuf: *mut GdkPixbuf,
637 dest_x: c_int,
638 dest_y: c_int,
639 );
640 pub fn gdk_pixbuf_copy_options(
641 src_pixbuf: *mut GdkPixbuf,
642 dest_pixbuf: *mut GdkPixbuf,
643 ) -> gboolean;
644 pub fn gdk_pixbuf_fill(pixbuf: *mut GdkPixbuf, pixel: u32);
645 pub fn gdk_pixbuf_flip(src: *const GdkPixbuf, horizontal: gboolean) -> *mut GdkPixbuf;
646 pub fn gdk_pixbuf_get_bits_per_sample(pixbuf: *const GdkPixbuf) -> c_int;
647 pub fn gdk_pixbuf_get_byte_length(pixbuf: *const GdkPixbuf) -> size_t;
648 pub fn gdk_pixbuf_get_colorspace(pixbuf: *const GdkPixbuf) -> GdkColorspace;
649 pub fn gdk_pixbuf_get_has_alpha(pixbuf: *const GdkPixbuf) -> gboolean;
650 pub fn gdk_pixbuf_get_height(pixbuf: *const GdkPixbuf) -> c_int;
651 pub fn gdk_pixbuf_get_n_channels(pixbuf: *const GdkPixbuf) -> c_int;
652 pub fn gdk_pixbuf_get_option(pixbuf: *mut GdkPixbuf, key: *const c_char) -> *const c_char;
653 pub fn gdk_pixbuf_get_options(pixbuf: *mut GdkPixbuf) -> *mut glib::GHashTable;
654 pub fn gdk_pixbuf_get_pixels(pixbuf: *const GdkPixbuf) -> *mut u8;
655 pub fn gdk_pixbuf_get_pixels_with_length(
656 pixbuf: *const GdkPixbuf,
657 length: *mut c_uint,
658 ) -> *mut u8;
659 pub fn gdk_pixbuf_get_rowstride(pixbuf: *const GdkPixbuf) -> c_int;
660 pub fn gdk_pixbuf_get_width(pixbuf: *const GdkPixbuf) -> c_int;
661 pub fn gdk_pixbuf_new_subpixbuf(
662 src_pixbuf: *mut GdkPixbuf,
663 src_x: c_int,
664 src_y: c_int,
665 width: c_int,
666 height: c_int,
667 ) -> *mut GdkPixbuf;
668 pub fn gdk_pixbuf_read_pixel_bytes(pixbuf: *const GdkPixbuf) -> *mut glib::GBytes;
669 pub fn gdk_pixbuf_read_pixels(pixbuf: *const GdkPixbuf) -> *const u8;
670 pub fn gdk_pixbuf_ref(pixbuf: *mut GdkPixbuf) -> *mut GdkPixbuf;
671 pub fn gdk_pixbuf_remove_option(pixbuf: *mut GdkPixbuf, key: *const c_char) -> gboolean;
672 pub fn gdk_pixbuf_rotate_simple(
673 src: *const GdkPixbuf,
674 angle: GdkPixbufRotation,
675 ) -> *mut GdkPixbuf;
676 pub fn gdk_pixbuf_saturate_and_pixelate(
677 src: *const GdkPixbuf,
678 dest: *mut GdkPixbuf,
679 saturation: c_float,
680 pixelate: gboolean,
681 );
682 pub fn gdk_pixbuf_save(
683 pixbuf: *mut GdkPixbuf,
684 filename: *const c_char,
685 type_: *const c_char,
686 error: *mut *mut glib::GError,
687 ...
688 ) -> gboolean;
689 pub fn gdk_pixbuf_save_to_buffer(
690 pixbuf: *mut GdkPixbuf,
691 buffer: *mut *mut u8,
692 buffer_size: *mut size_t,
693 type_: *const c_char,
694 error: *mut *mut glib::GError,
695 ...
696 ) -> gboolean;
697 pub fn gdk_pixbuf_save_to_bufferv(
698 pixbuf: *mut GdkPixbuf,
699 buffer: *mut *mut u8,
700 buffer_size: *mut size_t,
701 type_: *const c_char,
702 option_keys: *mut *mut c_char,
703 option_values: *mut *mut c_char,
704 error: *mut *mut glib::GError,
705 ) -> gboolean;
706 pub fn gdk_pixbuf_save_to_callback(
707 pixbuf: *mut GdkPixbuf,
708 save_func: GdkPixbufSaveFunc,
709 user_data: gpointer,
710 type_: *const c_char,
711 error: *mut *mut glib::GError,
712 ...
713 ) -> gboolean;
714 pub fn gdk_pixbuf_save_to_callbackv(
715 pixbuf: *mut GdkPixbuf,
716 save_func: GdkPixbufSaveFunc,
717 user_data: gpointer,
718 type_: *const c_char,
719 option_keys: *mut *mut c_char,
720 option_values: *mut *mut c_char,
721 error: *mut *mut glib::GError,
722 ) -> gboolean;
723 pub fn gdk_pixbuf_save_to_stream(
724 pixbuf: *mut GdkPixbuf,
725 stream: *mut gio::GOutputStream,
726 type_: *const c_char,
727 cancellable: *mut gio::GCancellable,
728 error: *mut *mut glib::GError,
729 ...
730 ) -> gboolean;
731 pub fn gdk_pixbuf_save_to_stream_async(
732 pixbuf: *mut GdkPixbuf,
733 stream: *mut gio::GOutputStream,
734 type_: *const c_char,
735 cancellable: *mut gio::GCancellable,
736 callback: gio::GAsyncReadyCallback,
737 user_data: gpointer,
738 ...
739 );
740 pub fn gdk_pixbuf_save_to_streamv(
741 pixbuf: *mut GdkPixbuf,
742 stream: *mut gio::GOutputStream,
743 type_: *const c_char,
744 option_keys: *mut *mut c_char,
745 option_values: *mut *mut c_char,
746 cancellable: *mut gio::GCancellable,
747 error: *mut *mut glib::GError,
748 ) -> gboolean;
749 pub fn gdk_pixbuf_save_to_streamv_async(
750 pixbuf: *mut GdkPixbuf,
751 stream: *mut gio::GOutputStream,
752 type_: *const c_char,
753 option_keys: *mut *mut c_char,
754 option_values: *mut *mut c_char,
755 cancellable: *mut gio::GCancellable,
756 callback: gio::GAsyncReadyCallback,
757 user_data: gpointer,
758 );
759 pub fn gdk_pixbuf_savev(
760 pixbuf: *mut GdkPixbuf,
761 filename: *const c_char,
762 type_: *const c_char,
763 option_keys: *mut *mut c_char,
764 option_values: *mut *mut c_char,
765 error: *mut *mut glib::GError,
766 ) -> gboolean;
767 pub fn gdk_pixbuf_scale(
768 src: *const GdkPixbuf,
769 dest: *mut GdkPixbuf,
770 dest_x: c_int,
771 dest_y: c_int,
772 dest_width: c_int,
773 dest_height: c_int,
774 offset_x: c_double,
775 offset_y: c_double,
776 scale_x: c_double,
777 scale_y: c_double,
778 interp_type: GdkInterpType,
779 );
780 pub fn gdk_pixbuf_scale_simple(
781 src: *const GdkPixbuf,
782 dest_width: c_int,
783 dest_height: c_int,
784 interp_type: GdkInterpType,
785 ) -> *mut GdkPixbuf;
786 pub fn gdk_pixbuf_set_option(
787 pixbuf: *mut GdkPixbuf,
788 key: *const c_char,
789 value: *const c_char,
790 ) -> gboolean;
791 pub fn gdk_pixbuf_unref(pixbuf: *mut GdkPixbuf);
792
793 pub fn gdk_pixbuf_animation_get_type() -> GType;
797 pub fn gdk_pixbuf_animation_new_from_file(
798 filename: *const c_char,
799 error: *mut *mut glib::GError,
800 ) -> *mut GdkPixbufAnimation;
801 pub fn gdk_pixbuf_animation_new_from_resource(
802 resource_path: *const c_char,
803 error: *mut *mut glib::GError,
804 ) -> *mut GdkPixbufAnimation;
805 pub fn gdk_pixbuf_animation_new_from_stream(
806 stream: *mut gio::GInputStream,
807 cancellable: *mut gio::GCancellable,
808 error: *mut *mut glib::GError,
809 ) -> *mut GdkPixbufAnimation;
810 pub fn gdk_pixbuf_animation_new_from_stream_finish(
811 async_result: *mut gio::GAsyncResult,
812 error: *mut *mut glib::GError,
813 ) -> *mut GdkPixbufAnimation;
814 pub fn gdk_pixbuf_animation_new_from_stream_async(
815 stream: *mut gio::GInputStream,
816 cancellable: *mut gio::GCancellable,
817 callback: gio::GAsyncReadyCallback,
818 user_data: gpointer,
819 );
820 pub fn gdk_pixbuf_animation_get_height(animation: *mut GdkPixbufAnimation) -> c_int;
821 pub fn gdk_pixbuf_animation_get_iter(
822 animation: *mut GdkPixbufAnimation,
823 start_time: *const glib::GTimeVal,
824 ) -> *mut GdkPixbufAnimationIter;
825 pub fn gdk_pixbuf_animation_get_static_image(
826 animation: *mut GdkPixbufAnimation,
827 ) -> *mut GdkPixbuf;
828 pub fn gdk_pixbuf_animation_get_width(animation: *mut GdkPixbufAnimation) -> c_int;
829 pub fn gdk_pixbuf_animation_is_static_image(animation: *mut GdkPixbufAnimation) -> gboolean;
830 pub fn gdk_pixbuf_animation_ref(animation: *mut GdkPixbufAnimation) -> *mut GdkPixbufAnimation;
831 pub fn gdk_pixbuf_animation_unref(animation: *mut GdkPixbufAnimation);
832
833 pub fn gdk_pixbuf_animation_iter_get_type() -> GType;
837 pub fn gdk_pixbuf_animation_iter_advance(
838 iter: *mut GdkPixbufAnimationIter,
839 current_time: *const glib::GTimeVal,
840 ) -> gboolean;
841 pub fn gdk_pixbuf_animation_iter_get_delay_time(iter: *mut GdkPixbufAnimationIter) -> c_int;
842 pub fn gdk_pixbuf_animation_iter_get_pixbuf(
843 iter: *mut GdkPixbufAnimationIter,
844 ) -> *mut GdkPixbuf;
845 pub fn gdk_pixbuf_animation_iter_on_currently_loading_frame(
846 iter: *mut GdkPixbufAnimationIter,
847 ) -> gboolean;
848
849 pub fn gdk_pixbuf_loader_get_type() -> GType;
853 pub fn gdk_pixbuf_loader_new() -> *mut GdkPixbufLoader;
854 pub fn gdk_pixbuf_loader_new_with_mime_type(
855 mime_type: *const c_char,
856 error: *mut *mut glib::GError,
857 ) -> *mut GdkPixbufLoader;
858 pub fn gdk_pixbuf_loader_new_with_type(
859 image_type: *const c_char,
860 error: *mut *mut glib::GError,
861 ) -> *mut GdkPixbufLoader;
862 pub fn gdk_pixbuf_loader_close(
863 loader: *mut GdkPixbufLoader,
864 error: *mut *mut glib::GError,
865 ) -> gboolean;
866 pub fn gdk_pixbuf_loader_get_animation(loader: *mut GdkPixbufLoader)
867 -> *mut GdkPixbufAnimation;
868 pub fn gdk_pixbuf_loader_get_format(loader: *mut GdkPixbufLoader) -> *mut GdkPixbufFormat;
869 pub fn gdk_pixbuf_loader_get_pixbuf(loader: *mut GdkPixbufLoader) -> *mut GdkPixbuf;
870 pub fn gdk_pixbuf_loader_set_size(loader: *mut GdkPixbufLoader, width: c_int, height: c_int);
871 pub fn gdk_pixbuf_loader_write(
872 loader: *mut GdkPixbufLoader,
873 buf: *const u8,
874 count: size_t,
875 error: *mut *mut glib::GError,
876 ) -> gboolean;
877 pub fn gdk_pixbuf_loader_write_bytes(
878 loader: *mut GdkPixbufLoader,
879 buffer: *mut glib::GBytes,
880 error: *mut *mut glib::GError,
881 ) -> gboolean;
882
883 pub fn gdk_pixbuf_non_anim_get_type() -> GType;
887 pub fn gdk_pixbuf_non_anim_new(pixbuf: *mut GdkPixbuf) -> *mut GdkPixbufAnimation;
888
889 pub fn gdk_pixbuf_simple_anim_get_type() -> GType;
893 pub fn gdk_pixbuf_simple_anim_new(
894 width: c_int,
895 height: c_int,
896 rate: c_float,
897 ) -> *mut GdkPixbufSimpleAnim;
898 pub fn gdk_pixbuf_simple_anim_add_frame(
899 animation: *mut GdkPixbufSimpleAnim,
900 pixbuf: *mut GdkPixbuf,
901 );
902 pub fn gdk_pixbuf_simple_anim_get_loop(animation: *mut GdkPixbufSimpleAnim) -> gboolean;
903 pub fn gdk_pixbuf_simple_anim_set_loop(animation: *mut GdkPixbufSimpleAnim, loop_: gboolean);
904
905 pub fn gdk_pixbuf_simple_anim_iter_get_type() -> GType;
909
910}