gdk-pixbuf-sys-0.9.0/Cargo.toml.orig010064400007650000024000000011551350341713700155100ustar0000000000000000[build-dependencies] pkg-config = "0.3.7" [dependencies] gio-sys = "0.9.0" glib-sys = "0.9.0" gobject-sys = "0.9.0" libc = "0.2" [dev-dependencies] shell-words = "0.1.0" tempdir = "0.3" [features] v2_32 = [] v2_36 = ["v2_32"] v2_36_8 = ["v2_36"] dox = [] [lib] name = "gdk_pixbuf_sys" [package] authors = ["The Gtk-rs Project Developers"] build = "build.rs" description = "FFI bindings to libgdk_pixbuf-2.0" homepage = "http://gtk-rs.org/" keywords = ["gdk-pixbuf", "ffi", "gtk-rs", "gnome"] license = "MIT" links = "gdk_pixbuf" name = "gdk-pixbuf-sys" repository = "https://github.com/gtk-rs/sys" version = "0.9.0" gdk-pixbuf-sys-0.9.0/Cargo.toml0000644000000023630000000000000117570ustar00# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies # # If you believe there's an error in this file please file an # issue against the rust-lang/cargo repository. If you're # editing this file be aware that the upstream Cargo.toml # will likely look very different (and much more reasonable) [package] name = "gdk-pixbuf-sys" version = "0.9.0" authors = ["The Gtk-rs Project Developers"] build = "build.rs" links = "gdk_pixbuf" description = "FFI bindings to libgdk_pixbuf-2.0" homepage = "http://gtk-rs.org/" keywords = ["gdk-pixbuf", "ffi", "gtk-rs", "gnome"] license = "MIT" repository = "https://github.com/gtk-rs/sys" [lib] name = "gdk_pixbuf_sys" [dependencies.gio-sys] version = "0.9.0" [dependencies.glib-sys] version = "0.9.0" [dependencies.gobject-sys] version = "0.9.0" [dependencies.libc] version = "0.2" [dev-dependencies.shell-words] version = "0.1.0" [dev-dependencies.tempdir] version = "0.3" [build-dependencies.pkg-config] version = "0.3.7" [features] dox = [] v2_32 = [] v2_36 = ["v2_32"] v2_36_8 = ["v2_36"] gdk-pixbuf-sys-0.9.0/LICENSE010064400007650000024000000021201350341526700136210ustar0000000000000000The MIT License (MIT) Copyright (c) 2013-2015, The Gtk-rs Project Developers. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. gdk-pixbuf-sys-0.9.0/build.rs010064400007650000024000000045241350341607000142640ustar0000000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT extern crate pkg_config; use pkg_config::{Config, Error}; use std::env; use std::io; use std::io::prelude::*; use std::process; fn main() { if let Err(s) = find() { let _ = writeln!(io::stderr(), "{}", s); process::exit(1); } } fn find() -> Result<(), Error> { let package_name = "gdk-pixbuf-2.0"; let shared_libs = ["gdk_pixbuf-2.0"]; let version = if cfg!(feature = "v2_36_8") { "2.36.8" } else if cfg!(feature = "v2_36") { "2.36" } else if cfg!(feature = "v2_32") { "2.32" } else { "2.30" }; if let Ok(inc_dir) = env::var("GTK_INCLUDE_DIR") { println!("cargo:include={}", inc_dir); } if let Ok(lib_dir) = env::var("GTK_LIB_DIR") { for lib_ in shared_libs.iter() { println!("cargo:rustc-link-lib=dylib={}", lib_); } println!("cargo:rustc-link-search=native={}", lib_dir); return Ok(()); } let target = env::var("TARGET").expect("TARGET environment variable doesn't exist"); let hardcode_shared_libs = target.contains("windows"); let mut config = Config::new(); config.atleast_version(version); config.print_system_libs(false); if hardcode_shared_libs { config.cargo_metadata(false); } match config.probe(package_name) { Ok(library) => { if let Ok(paths) = std::env::join_paths(library.include_paths) { println!("cargo:include={}", paths.to_string_lossy()); } if hardcode_shared_libs { for lib_ in shared_libs.iter() { println!("cargo:rustc-link-lib=dylib={}", lib_); } for path in library.link_paths.iter() { println!( "cargo:rustc-link-search=native={}", path.to_str().expect("library path doesn't exist") ); } } Ok(()) } Err(Error::EnvNoPkgConfig(_)) | Err(Error::Command { .. }) => { for lib_ in shared_libs.iter() { println!("cargo:rustc-link-lib=dylib={}", lib_); } Ok(()) } Err(err) => Err(err), } } gdk-pixbuf-sys-0.9.0/src/lib.rs010064400007650000024000000642031350341607000145220ustar0000000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT #![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] #![allow( clippy::approx_constant, clippy::type_complexity, clippy::unreadable_literal )] extern crate gio_sys as gio; extern crate glib_sys as glib; extern crate gobject_sys as gobject; extern crate libc; #[allow(unused_imports)] use libc::{ c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void, intptr_t, size_t, ssize_t, time_t, uintptr_t, FILE, }; #[allow(unused_imports)] use glib::{gboolean, gconstpointer, gpointer, GType}; // Enums pub type GdkColorspace = c_int; pub const GDK_COLORSPACE_RGB: GdkColorspace = 0; pub type GdkInterpType = c_int; pub const GDK_INTERP_NEAREST: GdkInterpType = 0; pub const GDK_INTERP_TILES: GdkInterpType = 1; pub const GDK_INTERP_BILINEAR: GdkInterpType = 2; pub const GDK_INTERP_HYPER: GdkInterpType = 3; pub type GdkPixbufAlphaMode = c_int; pub const GDK_PIXBUF_ALPHA_BILEVEL: GdkPixbufAlphaMode = 0; pub const GDK_PIXBUF_ALPHA_FULL: GdkPixbufAlphaMode = 1; pub type GdkPixbufError = c_int; pub const GDK_PIXBUF_ERROR_CORRUPT_IMAGE: GdkPixbufError = 0; pub const GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY: GdkPixbufError = 1; pub const GDK_PIXBUF_ERROR_BAD_OPTION: GdkPixbufError = 2; pub const GDK_PIXBUF_ERROR_UNKNOWN_TYPE: GdkPixbufError = 3; pub const GDK_PIXBUF_ERROR_UNSUPPORTED_OPERATION: GdkPixbufError = 4; pub const GDK_PIXBUF_ERROR_FAILED: GdkPixbufError = 5; pub const GDK_PIXBUF_ERROR_INCOMPLETE_ANIMATION: GdkPixbufError = 6; pub type GdkPixbufRotation = c_int; pub const GDK_PIXBUF_ROTATE_NONE: GdkPixbufRotation = 0; pub const GDK_PIXBUF_ROTATE_COUNTERCLOCKWISE: GdkPixbufRotation = 90; pub const GDK_PIXBUF_ROTATE_UPSIDEDOWN: GdkPixbufRotation = 180; pub const GDK_PIXBUF_ROTATE_CLOCKWISE: GdkPixbufRotation = 270; // Constants // Callbacks pub type GdkPixbufDestroyNotify = Option; pub type GdkPixbufSaveFunc = Option gboolean>; // Records #[repr(C)] pub struct GdkPixbufFormat(c_void); impl ::std::fmt::Debug for GdkPixbufFormat { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("GdkPixbufFormat @ {:?}", self as *const _)) .finish() } } #[repr(C)] #[derive(Copy, Clone)] pub struct GdkPixbufLoaderClass { pub parent_class: gobject::GObjectClass, pub size_prepared: Option, pub area_prepared: Option, pub area_updated: Option, pub closed: Option, } impl ::std::fmt::Debug for GdkPixbufLoaderClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("GdkPixbufLoaderClass @ {:?}", self as *const _)) .field("parent_class", &self.parent_class) .field("size_prepared", &self.size_prepared) .field("area_prepared", &self.area_prepared) .field("area_updated", &self.area_updated) .field("closed", &self.closed) .finish() } } #[repr(C)] pub struct _GdkPixbufSimpleAnimClass(c_void); pub type GdkPixbufSimpleAnimClass = *mut _GdkPixbufSimpleAnimClass; // Classes #[repr(C)] pub struct GdkPixbuf(c_void); impl ::std::fmt::Debug for GdkPixbuf { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("GdkPixbuf @ {:?}", self as *const _)) .finish() } } #[repr(C)] pub struct GdkPixbufAnimation(c_void); impl ::std::fmt::Debug for GdkPixbufAnimation { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("GdkPixbufAnimation @ {:?}", self as *const _)) .finish() } } #[repr(C)] pub struct GdkPixbufAnimationIter(c_void); impl ::std::fmt::Debug for GdkPixbufAnimationIter { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("GdkPixbufAnimationIter @ {:?}", self as *const _)) .finish() } } #[repr(C)] #[derive(Copy, Clone)] pub struct GdkPixbufLoader { pub parent_instance: gobject::GObject, pub priv_: gpointer, } impl ::std::fmt::Debug for GdkPixbufLoader { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("GdkPixbufLoader @ {:?}", self as *const _)) .field("parent_instance", &self.parent_instance) .finish() } } #[repr(C)] pub struct GdkPixbufSimpleAnim(c_void); impl ::std::fmt::Debug for GdkPixbufSimpleAnim { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("GdkPixbufSimpleAnim @ {:?}", self as *const _)) .finish() } } #[repr(C)] pub struct GdkPixbufSimpleAnimIter(c_void); impl ::std::fmt::Debug for GdkPixbufSimpleAnimIter { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("GdkPixbufSimpleAnimIter @ {:?}", self as *const _)) .finish() } } extern "C" { //========================================================================= // GdkColorspace //========================================================================= pub fn gdk_colorspace_get_type() -> GType; //========================================================================= // GdkInterpType //========================================================================= pub fn gdk_interp_type_get_type() -> GType; //========================================================================= // GdkPixbufAlphaMode //========================================================================= pub fn gdk_pixbuf_alpha_mode_get_type() -> GType; //========================================================================= // GdkPixbufError //========================================================================= pub fn gdk_pixbuf_error_get_type() -> GType; pub fn gdk_pixbuf_error_quark() -> glib::GQuark; //========================================================================= // GdkPixbufRotation //========================================================================= pub fn gdk_pixbuf_rotation_get_type() -> GType; //========================================================================= // GdkPixbufFormat //========================================================================= pub fn gdk_pixbuf_format_get_type() -> GType; pub fn gdk_pixbuf_format_copy(format: *const GdkPixbufFormat) -> *mut GdkPixbufFormat; pub fn gdk_pixbuf_format_free(format: *mut GdkPixbufFormat); pub fn gdk_pixbuf_format_get_description(format: *mut GdkPixbufFormat) -> *mut c_char; pub fn gdk_pixbuf_format_get_extensions(format: *mut GdkPixbufFormat) -> *mut *mut c_char; pub fn gdk_pixbuf_format_get_license(format: *mut GdkPixbufFormat) -> *mut c_char; pub fn gdk_pixbuf_format_get_mime_types(format: *mut GdkPixbufFormat) -> *mut *mut c_char; pub fn gdk_pixbuf_format_get_name(format: *mut GdkPixbufFormat) -> *mut c_char; pub fn gdk_pixbuf_format_is_disabled(format: *mut GdkPixbufFormat) -> gboolean; #[cfg(any(feature = "v2_36", feature = "dox"))] pub fn gdk_pixbuf_format_is_save_option_supported( format: *mut GdkPixbufFormat, option_key: *const c_char, ) -> gboolean; pub fn gdk_pixbuf_format_is_scalable(format: *mut GdkPixbufFormat) -> gboolean; pub fn gdk_pixbuf_format_is_writable(format: *mut GdkPixbufFormat) -> gboolean; pub fn gdk_pixbuf_format_set_disabled(format: *mut GdkPixbufFormat, disabled: gboolean); //========================================================================= // GdkPixbuf //========================================================================= pub fn gdk_pixbuf_get_type() -> GType; pub fn gdk_pixbuf_new( colorspace: GdkColorspace, has_alpha: gboolean, bits_per_sample: c_int, width: c_int, height: c_int, ) -> *mut GdkPixbuf; #[cfg(any(feature = "v2_32", feature = "dox"))] pub fn gdk_pixbuf_new_from_bytes( data: *mut glib::GBytes, colorspace: GdkColorspace, has_alpha: gboolean, bits_per_sample: c_int, width: c_int, height: c_int, rowstride: c_int, ) -> *mut GdkPixbuf; pub fn gdk_pixbuf_new_from_data( data: *const u8, colorspace: GdkColorspace, has_alpha: gboolean, bits_per_sample: c_int, width: c_int, height: c_int, rowstride: c_int, destroy_fn: GdkPixbufDestroyNotify, destroy_fn_data: gpointer, ) -> *mut GdkPixbuf; #[cfg(any(windows, feature = "dox"))] pub fn gdk_pixbuf_new_from_file_utf8( filename: *const c_char, error: *mut *mut glib::GError, ) -> *mut GdkPixbuf; pub fn gdk_pixbuf_new_from_file( filename: *const c_char, error: *mut *mut glib::GError, ) -> *mut GdkPixbuf; #[cfg(any(windows, feature = "dox"))] pub fn gdk_pixbuf_new_from_file_at_scale_utf8( filename: *const c_char, width: c_int, height: c_int, preserve_aspect_ratio: gboolean, error: *mut *mut glib::GError, ) -> *mut GdkPixbuf; pub fn gdk_pixbuf_new_from_file_at_scale( filename: *const c_char, width: c_int, height: c_int, preserve_aspect_ratio: gboolean, error: *mut *mut glib::GError, ) -> *mut GdkPixbuf; #[cfg(any(windows, feature = "dox"))] pub fn gdk_pixbuf_new_from_file_at_size_utf8( filename: *const c_char, width: c_int, height: c_int, error: *mut *mut glib::GError, ) -> *mut GdkPixbuf; pub fn gdk_pixbuf_new_from_file_at_size( filename: *const c_char, width: c_int, height: c_int, error: *mut *mut glib::GError, ) -> *mut GdkPixbuf; pub fn gdk_pixbuf_new_from_inline( data_length: c_int, data: *const u8, copy_pixels: gboolean, error: *mut *mut glib::GError, ) -> *mut GdkPixbuf; pub fn gdk_pixbuf_new_from_resource( resource_path: *const c_char, error: *mut *mut glib::GError, ) -> *mut GdkPixbuf; pub fn gdk_pixbuf_new_from_resource_at_scale( resource_path: *const c_char, width: c_int, height: c_int, preserve_aspect_ratio: gboolean, error: *mut *mut glib::GError, ) -> *mut GdkPixbuf; pub fn gdk_pixbuf_new_from_stream( stream: *mut gio::GInputStream, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> *mut GdkPixbuf; pub fn gdk_pixbuf_new_from_stream_at_scale( stream: *mut gio::GInputStream, width: c_int, height: c_int, preserve_aspect_ratio: gboolean, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> *mut GdkPixbuf; pub fn gdk_pixbuf_new_from_stream_finish( async_result: *mut gio::GAsyncResult, error: *mut *mut glib::GError, ) -> *mut GdkPixbuf; pub fn gdk_pixbuf_new_from_xpm_data(data: *mut *const c_char) -> *mut GdkPixbuf; #[cfg(any(feature = "v2_36_8", feature = "dox"))] pub fn gdk_pixbuf_calculate_rowstride( colorspace: GdkColorspace, has_alpha: gboolean, bits_per_sample: c_int, width: c_int, height: c_int, ) -> c_int; pub fn gdk_pixbuf_get_file_info( filename: *const c_char, width: *mut c_int, height: *mut c_int, ) -> *mut GdkPixbufFormat; #[cfg(any(feature = "v2_32", feature = "dox"))] pub fn gdk_pixbuf_get_file_info_async( filename: *const c_char, cancellable: *mut gio::GCancellable, callback: gio::GAsyncReadyCallback, user_data: gpointer, ); #[cfg(any(feature = "v2_32", feature = "dox"))] pub fn gdk_pixbuf_get_file_info_finish( async_result: *mut gio::GAsyncResult, width: *mut c_int, height: *mut c_int, error: *mut *mut glib::GError, ) -> *mut GdkPixbufFormat; pub fn gdk_pixbuf_get_formats() -> *mut glib::GSList; pub fn gdk_pixbuf_new_from_stream_async( stream: *mut gio::GInputStream, cancellable: *mut gio::GCancellable, callback: gio::GAsyncReadyCallback, user_data: gpointer, ); pub fn gdk_pixbuf_new_from_stream_at_scale_async( stream: *mut gio::GInputStream, width: c_int, height: c_int, preserve_aspect_ratio: gboolean, cancellable: *mut gio::GCancellable, callback: gio::GAsyncReadyCallback, user_data: gpointer, ); pub fn gdk_pixbuf_save_to_stream_finish( async_result: *mut gio::GAsyncResult, error: *mut *mut glib::GError, ) -> gboolean; pub fn gdk_pixbuf_add_alpha( pixbuf: *const GdkPixbuf, substitute_color: gboolean, r: c_uchar, g: c_uchar, b: c_uchar, ) -> *mut GdkPixbuf; pub fn gdk_pixbuf_apply_embedded_orientation(src: *mut GdkPixbuf) -> *mut GdkPixbuf; pub fn gdk_pixbuf_composite( src: *const GdkPixbuf, dest: *mut GdkPixbuf, dest_x: c_int, dest_y: c_int, dest_width: c_int, dest_height: c_int, offset_x: c_double, offset_y: c_double, scale_x: c_double, scale_y: c_double, interp_type: GdkInterpType, overall_alpha: c_int, ); pub fn gdk_pixbuf_composite_color( src: *const GdkPixbuf, dest: *mut GdkPixbuf, dest_x: c_int, dest_y: c_int, dest_width: c_int, dest_height: c_int, offset_x: c_double, offset_y: c_double, scale_x: c_double, scale_y: c_double, interp_type: GdkInterpType, overall_alpha: c_int, check_x: c_int, check_y: c_int, check_size: c_int, color1: u32, color2: u32, ); pub fn gdk_pixbuf_composite_color_simple( src: *const GdkPixbuf, dest_width: c_int, dest_height: c_int, interp_type: GdkInterpType, overall_alpha: c_int, check_size: c_int, color1: u32, color2: u32, ) -> *mut GdkPixbuf; pub fn gdk_pixbuf_copy(pixbuf: *const GdkPixbuf) -> *mut GdkPixbuf; pub fn gdk_pixbuf_copy_area( src_pixbuf: *const GdkPixbuf, src_x: c_int, src_y: c_int, width: c_int, height: c_int, dest_pixbuf: *mut GdkPixbuf, dest_x: c_int, dest_y: c_int, ); #[cfg(any(feature = "v2_36", feature = "dox"))] pub fn gdk_pixbuf_copy_options( src_pixbuf: *mut GdkPixbuf, dest_pixbuf: *mut GdkPixbuf, ) -> gboolean; pub fn gdk_pixbuf_fill(pixbuf: *mut GdkPixbuf, pixel: u32); pub fn gdk_pixbuf_flip(src: *const GdkPixbuf, horizontal: gboolean) -> *mut GdkPixbuf; pub fn gdk_pixbuf_get_bits_per_sample(pixbuf: *const GdkPixbuf) -> c_int; pub fn gdk_pixbuf_get_byte_length(pixbuf: *const GdkPixbuf) -> size_t; pub fn gdk_pixbuf_get_colorspace(pixbuf: *const GdkPixbuf) -> GdkColorspace; pub fn gdk_pixbuf_get_has_alpha(pixbuf: *const GdkPixbuf) -> gboolean; pub fn gdk_pixbuf_get_height(pixbuf: *const GdkPixbuf) -> c_int; pub fn gdk_pixbuf_get_n_channels(pixbuf: *const GdkPixbuf) -> c_int; pub fn gdk_pixbuf_get_option(pixbuf: *mut GdkPixbuf, key: *const c_char) -> *const c_char; #[cfg(any(feature = "v2_32", feature = "dox"))] pub fn gdk_pixbuf_get_options(pixbuf: *mut GdkPixbuf) -> *mut glib::GHashTable; pub fn gdk_pixbuf_get_pixels(pixbuf: *const GdkPixbuf) -> *mut u8; pub fn gdk_pixbuf_get_pixels_with_length( pixbuf: *const GdkPixbuf, length: *mut c_uint, ) -> *mut u8; pub fn gdk_pixbuf_get_rowstride(pixbuf: *const GdkPixbuf) -> c_int; pub fn gdk_pixbuf_get_width(pixbuf: *const GdkPixbuf) -> c_int; pub fn gdk_pixbuf_new_subpixbuf( src_pixbuf: *mut GdkPixbuf, src_x: c_int, src_y: c_int, width: c_int, height: c_int, ) -> *mut GdkPixbuf; #[cfg(any(feature = "v2_32", feature = "dox"))] pub fn gdk_pixbuf_read_pixel_bytes(pixbuf: *const GdkPixbuf) -> *mut glib::GBytes; #[cfg(any(feature = "v2_32", feature = "dox"))] pub fn gdk_pixbuf_read_pixels(pixbuf: *const GdkPixbuf) -> *const u8; pub fn gdk_pixbuf_ref(pixbuf: *mut GdkPixbuf) -> *mut GdkPixbuf; #[cfg(any(feature = "v2_36", feature = "dox"))] pub fn gdk_pixbuf_remove_option(pixbuf: *mut GdkPixbuf, key: *const c_char) -> gboolean; pub fn gdk_pixbuf_rotate_simple( src: *const GdkPixbuf, angle: GdkPixbufRotation, ) -> *mut GdkPixbuf; pub fn gdk_pixbuf_saturate_and_pixelate( src: *const GdkPixbuf, dest: *mut GdkPixbuf, saturation: c_float, pixelate: gboolean, ); #[cfg(any(windows, feature = "dox"))] pub fn gdk_pixbuf_save_utf8( pixbuf: *mut GdkPixbuf, filename: *const c_char, type_: *const c_char, error: *mut *mut glib::GError, ... ) -> gboolean; pub fn gdk_pixbuf_save( pixbuf: *mut GdkPixbuf, filename: *const c_char, type_: *const c_char, error: *mut *mut glib::GError, ... ) -> gboolean; pub fn gdk_pixbuf_save_to_buffer( pixbuf: *mut GdkPixbuf, buffer: *mut *mut u8, buffer_size: *mut size_t, type_: *const c_char, error: *mut *mut glib::GError, ... ) -> gboolean; pub fn gdk_pixbuf_save_to_bufferv( pixbuf: *mut GdkPixbuf, buffer: *mut *mut u8, buffer_size: *mut size_t, type_: *const c_char, option_keys: *mut *mut c_char, option_values: *mut *mut c_char, error: *mut *mut glib::GError, ) -> gboolean; pub fn gdk_pixbuf_save_to_callback( pixbuf: *mut GdkPixbuf, save_func: GdkPixbufSaveFunc, user_data: gpointer, type_: *const c_char, error: *mut *mut glib::GError, ... ) -> gboolean; pub fn gdk_pixbuf_save_to_callbackv( pixbuf: *mut GdkPixbuf, save_func: GdkPixbufSaveFunc, user_data: gpointer, type_: *const c_char, option_keys: *mut *mut c_char, option_values: *mut *mut c_char, error: *mut *mut glib::GError, ) -> gboolean; pub fn gdk_pixbuf_save_to_stream( pixbuf: *mut GdkPixbuf, stream: *mut gio::GOutputStream, type_: *const c_char, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ... ) -> gboolean; pub fn gdk_pixbuf_save_to_stream_async( pixbuf: *mut GdkPixbuf, stream: *mut gio::GOutputStream, type_: *const c_char, cancellable: *mut gio::GCancellable, callback: gio::GAsyncReadyCallback, user_data: gpointer, ... ); #[cfg(any(feature = "v2_36", feature = "dox"))] pub fn gdk_pixbuf_save_to_streamv( pixbuf: *mut GdkPixbuf, stream: *mut gio::GOutputStream, type_: *const c_char, option_keys: *mut *mut c_char, option_values: *mut *mut c_char, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; #[cfg(any(feature = "v2_36", feature = "dox"))] pub fn gdk_pixbuf_save_to_streamv_async( pixbuf: *mut GdkPixbuf, stream: *mut gio::GOutputStream, type_: *const c_char, option_keys: *mut *mut c_char, option_values: *mut *mut c_char, cancellable: *mut gio::GCancellable, callback: gio::GAsyncReadyCallback, user_data: gpointer, ); #[cfg(any(windows, feature = "dox"))] pub fn gdk_pixbuf_savev_utf8( pixbuf: *mut GdkPixbuf, filename: *const c_char, type_: *const c_char, option_keys: *mut *mut c_char, option_values: *mut *mut c_char, error: *mut *mut glib::GError, ) -> gboolean; pub fn gdk_pixbuf_savev( pixbuf: *mut GdkPixbuf, filename: *const c_char, type_: *const c_char, option_keys: *mut *mut c_char, option_values: *mut *mut c_char, error: *mut *mut glib::GError, ) -> gboolean; pub fn gdk_pixbuf_scale( src: *const GdkPixbuf, dest: *mut GdkPixbuf, dest_x: c_int, dest_y: c_int, dest_width: c_int, dest_height: c_int, offset_x: c_double, offset_y: c_double, scale_x: c_double, scale_y: c_double, interp_type: GdkInterpType, ); pub fn gdk_pixbuf_scale_simple( src: *const GdkPixbuf, dest_width: c_int, dest_height: c_int, interp_type: GdkInterpType, ) -> *mut GdkPixbuf; pub fn gdk_pixbuf_set_option( pixbuf: *mut GdkPixbuf, key: *const c_char, value: *const c_char, ) -> gboolean; pub fn gdk_pixbuf_unref(pixbuf: *mut GdkPixbuf); //========================================================================= // GdkPixbufAnimation //========================================================================= pub fn gdk_pixbuf_animation_get_type() -> GType; #[cfg(any(windows, feature = "dox"))] pub fn gdk_pixbuf_animation_new_from_file_utf8( filename: *const c_char, error: *mut *mut glib::GError, ) -> *mut GdkPixbufAnimation; pub fn gdk_pixbuf_animation_new_from_file( filename: *const c_char, error: *mut *mut glib::GError, ) -> *mut GdkPixbufAnimation; pub fn gdk_pixbuf_animation_new_from_resource( resource_path: *const c_char, error: *mut *mut glib::GError, ) -> *mut GdkPixbufAnimation; pub fn gdk_pixbuf_animation_new_from_stream( stream: *mut gio::GInputStream, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> *mut GdkPixbufAnimation; pub fn gdk_pixbuf_animation_new_from_stream_finish( async_result: *mut gio::GAsyncResult, error: *mut *mut glib::GError, ) -> *mut GdkPixbufAnimation; pub fn gdk_pixbuf_animation_new_from_stream_async( stream: *mut gio::GInputStream, cancellable: *mut gio::GCancellable, callback: gio::GAsyncReadyCallback, user_data: gpointer, ); pub fn gdk_pixbuf_animation_get_height(animation: *mut GdkPixbufAnimation) -> c_int; pub fn gdk_pixbuf_animation_get_iter( animation: *mut GdkPixbufAnimation, start_time: *const glib::GTimeVal, ) -> *mut GdkPixbufAnimationIter; pub fn gdk_pixbuf_animation_get_static_image( animation: *mut GdkPixbufAnimation, ) -> *mut GdkPixbuf; pub fn gdk_pixbuf_animation_get_width(animation: *mut GdkPixbufAnimation) -> c_int; pub fn gdk_pixbuf_animation_is_static_image(animation: *mut GdkPixbufAnimation) -> gboolean; pub fn gdk_pixbuf_animation_ref(animation: *mut GdkPixbufAnimation) -> *mut GdkPixbufAnimation; pub fn gdk_pixbuf_animation_unref(animation: *mut GdkPixbufAnimation); //========================================================================= // GdkPixbufAnimationIter //========================================================================= pub fn gdk_pixbuf_animation_iter_get_type() -> GType; pub fn gdk_pixbuf_animation_iter_advance( iter: *mut GdkPixbufAnimationIter, current_time: *const glib::GTimeVal, ) -> gboolean; pub fn gdk_pixbuf_animation_iter_get_delay_time(iter: *mut GdkPixbufAnimationIter) -> c_int; pub fn gdk_pixbuf_animation_iter_get_pixbuf( iter: *mut GdkPixbufAnimationIter, ) -> *mut GdkPixbuf; pub fn gdk_pixbuf_animation_iter_on_currently_loading_frame( iter: *mut GdkPixbufAnimationIter, ) -> gboolean; //========================================================================= // GdkPixbufLoader //========================================================================= pub fn gdk_pixbuf_loader_get_type() -> GType; pub fn gdk_pixbuf_loader_new() -> *mut GdkPixbufLoader; pub fn gdk_pixbuf_loader_new_with_mime_type( mime_type: *const c_char, error: *mut *mut glib::GError, ) -> *mut GdkPixbufLoader; pub fn gdk_pixbuf_loader_new_with_type( image_type: *const c_char, error: *mut *mut glib::GError, ) -> *mut GdkPixbufLoader; pub fn gdk_pixbuf_loader_close( loader: *mut GdkPixbufLoader, error: *mut *mut glib::GError, ) -> gboolean; pub fn gdk_pixbuf_loader_get_animation(loader: *mut GdkPixbufLoader) -> *mut GdkPixbufAnimation; pub fn gdk_pixbuf_loader_get_format(loader: *mut GdkPixbufLoader) -> *mut GdkPixbufFormat; pub fn gdk_pixbuf_loader_get_pixbuf(loader: *mut GdkPixbufLoader) -> *mut GdkPixbuf; pub fn gdk_pixbuf_loader_set_size(loader: *mut GdkPixbufLoader, width: c_int, height: c_int); pub fn gdk_pixbuf_loader_write( loader: *mut GdkPixbufLoader, buf: *const u8, count: size_t, error: *mut *mut glib::GError, ) -> gboolean; pub fn gdk_pixbuf_loader_write_bytes( loader: *mut GdkPixbufLoader, buffer: *mut glib::GBytes, error: *mut *mut glib::GError, ) -> gboolean; //========================================================================= // GdkPixbufSimpleAnim //========================================================================= pub fn gdk_pixbuf_simple_anim_get_type() -> GType; pub fn gdk_pixbuf_simple_anim_new( width: c_int, height: c_int, rate: c_float, ) -> *mut GdkPixbufSimpleAnim; pub fn gdk_pixbuf_simple_anim_add_frame( animation: *mut GdkPixbufSimpleAnim, pixbuf: *mut GdkPixbuf, ); pub fn gdk_pixbuf_simple_anim_get_loop(animation: *mut GdkPixbufSimpleAnim) -> gboolean; pub fn gdk_pixbuf_simple_anim_set_loop(animation: *mut GdkPixbufSimpleAnim, loop_: gboolean); //========================================================================= // GdkPixbufSimpleAnimIter //========================================================================= pub fn gdk_pixbuf_simple_anim_iter_get_type() -> GType; } gdk-pixbuf-sys-0.9.0/tests/abi.rs010064400007650000024000000230261350341607000150600ustar0000000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT extern crate gdk_pixbuf_sys; extern crate shell_words; extern crate tempdir; use gdk_pixbuf_sys::*; use std::env; use std::error::Error; use std::mem::{align_of, size_of}; use std::path::Path; use std::process::Command; use std::str; static PACKAGES: &[&str] = &["gdk-pixbuf-2.0"]; #[derive(Clone, Debug)] struct Compiler { pub args: Vec, } impl Compiler { pub fn new() -> Result> { let mut args = get_var("CC", "cc")?; args.push("-Wno-deprecated-declarations".to_owned()); // For %z support in printf when using MinGW. args.push("-D__USE_MINGW_ANSI_STDIO".to_owned()); args.extend(get_var("CFLAGS", "")?); args.extend(get_var("CPPFLAGS", "")?); args.extend(pkg_config_cflags(PACKAGES)?); Ok(Compiler { args }) } pub fn define<'a, V: Into>>(&mut self, var: &str, val: V) { let arg = match val.into() { None => format!("-D{}", var), Some(val) => format!("-D{}={}", var, val), }; self.args.push(arg); } pub fn compile(&self, src: &Path, out: &Path) -> Result<(), Box> { let mut cmd = self.to_command(); cmd.arg(src); cmd.arg("-o"); cmd.arg(out); let status = cmd.spawn()?.wait()?; if !status.success() { return Err(format!("compilation command {:?} failed, {}", &cmd, status).into()); } Ok(()) } fn to_command(&self) -> Command { let mut cmd = Command::new(&self.args[0]); cmd.args(&self.args[1..]); cmd } } fn get_var(name: &str, default: &str) -> Result, Box> { match env::var(name) { Ok(value) => Ok(shell_words::split(&value)?), Err(env::VarError::NotPresent) => Ok(shell_words::split(default)?), Err(err) => Err(format!("{} {}", name, err).into()), } } fn pkg_config_cflags(packages: &[&str]) -> Result, Box> { if packages.is_empty() { return Ok(Vec::new()); } let mut cmd = Command::new("pkg-config"); cmd.arg("--cflags"); cmd.args(packages); let out = cmd.output()?; if !out.status.success() { return Err(format!("command {:?} returned {}", &cmd, out.status).into()); } let stdout = str::from_utf8(&out.stdout)?; Ok(shell_words::split(stdout.trim())?) } #[derive(Copy, Clone, Debug, Eq, PartialEq)] struct Layout { size: usize, alignment: usize, } #[derive(Copy, Clone, Debug, Default, Eq, PartialEq)] struct Results { /// Number of successfully completed tests. passed: usize, /// Total number of failed tests (including those that failed to compile). failed: usize, /// Number of tests that failed to compile. failed_to_compile: usize, } impl Results { fn record_passed(&mut self) { self.passed += 1; } fn record_failed(&mut self) { self.failed += 1; } fn record_failed_to_compile(&mut self) { self.failed += 1; self.failed_to_compile += 1; } fn summary(&self) -> String { format!( "{} passed; {} failed (compilation errors: {})", self.passed, self.failed, self.failed_to_compile ) } fn expect_total_success(&self) { if self.failed == 0 { println!("OK: {}", self.summary()); } else { panic!("FAILED: {}", self.summary()); }; } } #[test] fn cross_validate_constants_with_c() { let tmpdir = tempdir::TempDir::new("abi").expect("temporary directory"); let cc = Compiler::new().expect("configured compiler"); assert_eq!( "1", get_c_value(tmpdir.path(), &cc, "1").expect("C constant"), "failed to obtain correct constant value for 1" ); let mut results: Results = Default::default(); for (i, &(name, rust_value)) in RUST_CONSTANTS.iter().enumerate() { match get_c_value(tmpdir.path(), &cc, name) { Err(e) => { results.record_failed_to_compile(); eprintln!("{}", e); } Ok(ref c_value) => { if rust_value == c_value { results.record_passed(); } else { results.record_failed(); eprintln!( "Constant value mismatch for {}\nRust: {:?}\nC: {:?}", name, rust_value, c_value ); } } }; if (i + 1) % 25 == 0 { println!("constants ... {}", results.summary()); } } results.expect_total_success(); } #[test] fn cross_validate_layout_with_c() { let tmpdir = tempdir::TempDir::new("abi").expect("temporary directory"); let cc = Compiler::new().expect("configured compiler"); assert_eq!( Layout { size: 1, alignment: 1 }, get_c_layout(tmpdir.path(), &cc, "char").expect("C layout"), "failed to obtain correct layout for char type" ); let mut results: Results = Default::default(); for (i, &(name, rust_layout)) in RUST_LAYOUTS.iter().enumerate() { match get_c_layout(tmpdir.path(), &cc, name) { Err(e) => { results.record_failed_to_compile(); eprintln!("{}", e); } Ok(c_layout) => { if rust_layout == c_layout { results.record_passed(); } else { results.record_failed(); eprintln!( "Layout mismatch for {}\nRust: {:?}\nC: {:?}", name, rust_layout, &c_layout ); } } }; if (i + 1) % 25 == 0 { println!("layout ... {}", results.summary()); } } results.expect_total_success(); } fn get_c_layout(dir: &Path, cc: &Compiler, name: &str) -> Result> { let exe = dir.join("layout"); let mut cc = cc.clone(); cc.define("ABI_TYPE_NAME", name); cc.compile(Path::new("tests/layout.c"), &exe)?; let mut abi_cmd = Command::new(exe); let output = abi_cmd.output()?; if !output.status.success() { return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into()); } let stdout = str::from_utf8(&output.stdout)?; let mut words = stdout.trim().split_whitespace(); let size = words.next().unwrap().parse().unwrap(); let alignment = words.next().unwrap().parse().unwrap(); Ok(Layout { size, alignment }) } fn get_c_value(dir: &Path, cc: &Compiler, name: &str) -> Result> { let exe = dir.join("constant"); let mut cc = cc.clone(); cc.define("ABI_CONSTANT_NAME", name); cc.compile(Path::new("tests/constant.c"), &exe)?; let mut abi_cmd = Command::new(exe); let output = abi_cmd.output()?; if !output.status.success() { return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into()); } let output = str::from_utf8(&output.stdout)?.trim(); if !output.starts_with("###gir test###") || !output.ends_with("###gir test###") { return Err(format!( "command {:?} return invalid output, {:?}", &abi_cmd, &output ) .into()); } Ok(String::from(&output[14..(output.len() - 14)])) } const RUST_LAYOUTS: &[(&str, Layout)] = &[ ( "GdkColorspace", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "GdkInterpType", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "GdkPixbufAlphaMode", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "GdkPixbufError", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "GdkPixbufLoader", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "GdkPixbufLoaderClass", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "GdkPixbufRotation", Layout { size: size_of::(), alignment: align_of::(), }, ), ]; const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(gint) GDK_COLORSPACE_RGB", "0"), ("(gint) GDK_INTERP_BILINEAR", "2"), ("(gint) GDK_INTERP_HYPER", "3"), ("(gint) GDK_INTERP_NEAREST", "0"), ("(gint) GDK_INTERP_TILES", "1"), ("(gint) GDK_PIXBUF_ALPHA_BILEVEL", "0"), ("(gint) GDK_PIXBUF_ALPHA_FULL", "1"), ("(gint) GDK_PIXBUF_ERROR_BAD_OPTION", "2"), ("(gint) GDK_PIXBUF_ERROR_CORRUPT_IMAGE", "0"), ("(gint) GDK_PIXBUF_ERROR_FAILED", "5"), ("(gint) GDK_PIXBUF_ERROR_INCOMPLETE_ANIMATION", "6"), ("(gint) GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY", "1"), ("(gint) GDK_PIXBUF_ERROR_UNKNOWN_TYPE", "3"), ("(gint) GDK_PIXBUF_ERROR_UNSUPPORTED_OPERATION", "4"), ("(gint) GDK_PIXBUF_ROTATE_CLOCKWISE", "270"), ("(gint) GDK_PIXBUF_ROTATE_COUNTERCLOCKWISE", "90"), ("(gint) GDK_PIXBUF_ROTATE_NONE", "0"), ("(gint) GDK_PIXBUF_ROTATE_UPSIDEDOWN", "180"), ]; gdk-pixbuf-sys-0.9.0/tests/constant.c010064400007650000024000000024401350341526700157600ustar0000000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT #include "manual.h" #include int main() { printf(_Generic((ABI_CONSTANT_NAME), char *: "###gir test###%s###gir test###\n", const char *: "###gir test###%s###gir test###\n", char: "###gir test###%c###gir test###\n", signed char: "###gir test###%hhd###gir test###\n", unsigned char: "###gir test###%hhu###gir test###\n", short int: "###gir test###%hd###gir test###\n", unsigned short int: "###gir test###%hu###gir test###\n", int: "###gir test###%d###gir test###\n", unsigned int: "###gir test###%u###gir test###\n", long: "###gir test###%ld###gir test###\n", unsigned long: "###gir test###%lu###gir test###\n", long long: "###gir test###%lld###gir test###\n", unsigned long long: "###gir test###%llu###gir test###\n", double: "###gir test###%f###gir test###\n", long double: "###gir test###%ld###gir test###\n"), ABI_CONSTANT_NAME); return 0; } gdk-pixbuf-sys-0.9.0/tests/layout.c010064400007650000024000000004541350341526700154470ustar0000000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT #include "manual.h" #include #include int main() { printf("%zu\n%zu", sizeof(ABI_TYPE_NAME), alignof(ABI_TYPE_NAME)); return 0; } gdk-pixbuf-sys-0.9.0/tests/manual.h010064400007650000024000000002411350341526700154060ustar0000000000000000// Feel free to edit this file, it won't be regenerated by gir generator unless removed. #include #include gdk-pixbuf-sys-0.9.0/versions.txt010064400007650000024000000001721350341607000152230ustar0000000000000000Generated by gir (https://github.com/gtk-rs/gir @ fab39bc) from gir-files (https://github.com/gtk-rs/gir-files @ 02dfee2) gdk-pixbuf-sys-0.9.0/.cargo_vcs_info.json0000644000000001120000000000000137470ustar00{ "git": { "sha1": "ed19f4b308103c3533023b69dfc8ae4e040bdaec" } }