diff --git a/changelog.md b/changelog.md index e28696951b..91e0329f45 100644 --- a/changelog.md +++ b/changelog.md @@ -3,6 +3,8 @@ when upgrading from a version of rust-sdl2 to another. ### v0.39.0 +[PR #1516](https://github.com/Rust-SDL2/rust-sdl2/pull/1516) **BREAKING CHANGE** Remove X11 and Wayland specific items from pregenerated bindings. Use bindgen (`use-bindgen` feature flag) if those bindings are needed. Remove unused aliases to integer types and update bindings. + [PR #1413](https://github.com/Rust-SDL2/rust-sdl2/pull/1413) Deprecate `From` implementation of `SwapInterval` that could panic, add `TryFrom`-like inherent function. [PR #1507](https://github.com/Rust-SDL2/rust-sdl2/pull/1507) **BREAKING CHANGE** Add binding for `SDL_ComposeCustomBlendMode`. This should only be a breaking change for users relying on internal details of `BlendMode` and `SDL_BlendMode`. diff --git a/sdl2-sys/Cargo.toml b/sdl2-sys/Cargo.toml index 142d8f625f..4fa098810a 100644 --- a/sdl2-sys/Cargo.toml +++ b/sdl2-sys/Cargo.toml @@ -10,7 +10,7 @@ categories = ["rendering","external-ffi-bindings","game-engines","multimedia"] license = "MIT AND Zlib" links = "SDL2" build = "build.rs" -edition = "2018" +edition = "2021" [lib] name = "sdl2_sys" @@ -41,7 +41,6 @@ optional = true [build-dependencies] version-compare = "0.1" -cfg-if = "^1.0" [features] @@ -59,4 +58,4 @@ ttf = [] gfx = [] [lints.rust] -unexpected_cfgs = { level = "warn", check-cfg = ['cfg(mac_framework)','cfg(ios_framework)'] } +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(mac_framework)','cfg(ios_framework)','cfg(update_pregenerated_bindings)'] } diff --git a/sdl2-sys/build.rs b/sdl2-sys/build.rs index b92d3373b8..abfcd91a77 100644 --- a/sdl2-sys/build.rs +++ b/sdl2-sys/build.rs @@ -1,37 +1,16 @@ #![allow(unused_imports, dead_code, unused_variables)] -#[cfg(feature = "bindgen")] -extern crate bindgen; -#[macro_use] -extern crate cfg_if; -#[cfg(feature = "bundled")] -extern crate cmake; -#[cfg(feature = "pkg-config")] -extern crate pkg_config; +#[cfg(all( + update_pregenerated_bindings, + not(feature = "bindgen"), + not(feature = "bundled"), +))] +compile_error!("Enable 'bindgen' and 'bundled' features when using update_pregenerated_bindings"); use std::path::{Path, PathBuf}; use std::process::Command; use std::{env, fs, io}; -#[cfg(feature = "bindgen")] -macro_rules! add_msvc_includes_to_bindings { - ($bindings:expr) => { - $bindings = $bindings.clang_arg(format!( - "-IC:/Program Files (x86)/Windows Kits/8.1/Include/shared" - )); - $bindings = $bindings.clang_arg(format!("-IC:/Program Files/LLVM/lib/clang/5.0.0/include")); - $bindings = $bindings.clang_arg(format!( - "-IC:/Program Files (x86)/Windows Kits/10/Include/10.0.10240.0/ucrt" - )); - $bindings = $bindings.clang_arg(format!( - "-IC:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include" - )); - $bindings = $bindings.clang_arg(format!( - "-IC:/Program Files (x86)/Windows Kits/8.1/Include/um" - )); - }; -} - #[cfg(feature = "bundled")] fn init_submodule(sdl_path: &Path) { if !sdl_path.join("CMakeLists.txt").exists() { @@ -329,10 +308,9 @@ fn link_sdl2(target_os: &str) { if target_os.contains("linux") || target_os.contains("freebsd") || target_os.contains("openbsd") + || target_os.contains("windows") { println!("cargo:rustc-flags=-l SDL2_mixer"); - } else if target_os.contains("windows") { - println!("cargo:rustc-flags=-l SDL2_mixer"); } else if target_os.contains("darwin") { let use_framework = cfg!(any(mac_framework, feature = "use_mac_framework")); if use_framework { @@ -353,10 +331,9 @@ fn link_sdl2(target_os: &str) { if target_os.contains("linux") || target_os.contains("freebsd") || target_os.contains("openbsd") + || target_os.contains("windows") { println!("cargo:rustc-flags=-l SDL2_image"); - } else if target_os.contains("windows") { - println!("cargo:rustc-flags=-l SDL2_image"); } else if target_os.contains("darwin") { let use_framework = cfg!(any(mac_framework, feature = "use_mac_framework")); if use_framework { @@ -377,10 +354,9 @@ fn link_sdl2(target_os: &str) { if target_os.contains("linux") || target_os.contains("freebsd") || target_os.contains("openbsd") + || target_os.contains("windows") { println!("cargo:rustc-flags=-l SDL2_ttf"); - } else if target_os.contains("windows") { - println!("cargo:rustc-flags=-l SDL2_ttf"); } else if target_os.contains("darwin") { let use_framework = cfg!(any(mac_framework, feature = "use_mac_framework")); if use_framework { @@ -401,10 +377,9 @@ fn link_sdl2(target_os: &str) { if target_os.contains("linux") || target_os.contains("freebsd") || target_os.contains("openbsd") + || target_os.contains("windows") { println!("cargo:rustc-flags=-l SDL2_gfx"); - } else if target_os.contains("windows") { - println!("cargo:rustc-flags=-l SDL2_gfx"); } else if target_os.contains("darwin") { let use_framework = cfg!(any(mac_framework, feature = "use_mac_framework")); if use_framework { @@ -590,62 +565,46 @@ fn main() { } } -#[cfg(not(feature = "bindgen"))] +#[cfg(any(not(feature = "bindgen"), update_pregenerated_bindings))] fn copy_pregenerated_bindings() { let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); let crate_path = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap()); - fs::copy( - crate_path.join("sdl_bindings.rs"), - out_path.join("sdl_bindings.rs"), - ) - .expect("Couldn't find pregenerated bindings!"); - if cfg!(feature = "image") { - fs::copy( - crate_path.join("sdl_image_bindings.rs"), - out_path.join("sdl_image_bindings.rs"), - ) - .expect("Couldn't find pregenerated SDL_image bindings!"); - } - if cfg!(feature = "ttf") { - fs::copy( - crate_path.join("sdl_ttf_bindings.rs"), - out_path.join("sdl_ttf_bindings.rs"), - ) - .expect("Couldn't find pregenerated SDL_ttf bindings!"); - } - if cfg!(feature = "mixer") { - fs::copy( - crate_path.join("sdl_mixer_bindings.rs"), - out_path.join("sdl_mixer_bindings.rs"), - ) - .expect("Couldn't find pregenerated SDL_mixer bindings!"); - } + #[allow(unused_mut)] + let mut paths = vec!["sdl_bindings.rs"]; - if cfg!(feature = "gfx") { - fs::copy( - crate_path.join("sdl_gfx_framerate_bindings.rs"), - out_path.join("sdl_gfx_framerate_bindings.rs"), - ) - .expect("Couldn't find pregenerated SDL_gfx framerate bindings!"); - - fs::copy( - crate_path.join("sdl_gfx_primitives_bindings.rs"), - out_path.join("sdl_gfx_primitives_bindings.rs"), - ) - .expect("Couldn't find pregenerated SDL_gfx primitives bindings!"); - - fs::copy( - crate_path.join("sdl_gfx_imagefilter_bindings.rs"), - out_path.join("sdl_gfx_imagefilter_bindings.rs"), - ) - .expect("Couldn't find pregenerated SDL_gfx imagefilter bindings!"); - - fs::copy( - crate_path.join("sdl_gfx_rotozoom_bindings.rs"), - out_path.join("sdl_gfx_rotozoom_bindings.rs"), - ) - .expect("Couldn't find pregenerated SDL_gfx rotozoom bindings!"); + #[cfg(feature = "image")] + paths.push("sdl_image_bindings.rs"); + + #[cfg(feature = "ttf")] + paths.push("sdl_ttf_bindings.rs"); + + #[cfg(feature = "mixer")] + paths.push("sdl_mixer_bindings.rs"); + + #[cfg(feature = "gfx")] + paths.extend([ + "sdl_gfx_framerate_bindings.rs", + "sdl_gfx_primitives_bindings.rs", + "sdl_gfx_imagefilter_bindings.rs", + "sdl_gfx_rotozoom_bindings.rs", + ]); + + for path in paths { + let from = crate_path.join(path); + let to = out_path.join(path); + + // Copy from OUT_DIR to the crate root when updating the pregenerated bindings + #[cfg(update_pregenerated_bindings)] + let (from, to) = (to, from); + + if let Err(err) = fs::copy(&from, &to) { + panic!( + "unable to copy {} to {}: {err}", + from.display(), + to.display(), + ); + } } } @@ -654,221 +613,117 @@ fn copy_pregenerated_bindings() { // to be found by bindgen (should point to the include/ directories) fn generate_bindings(target: &str, host: &str, headers_paths: &[String]) { let target_os = get_os_from_triple(target).unwrap(); - let mut bindings = bindgen::Builder::default() - // enable no_std-friendly output by only using core definitions - .use_core() - .allowlist_item("(SDL|AUDIO|RW)_.*") - .bitfield_enum("SDL_RendererFlip") - .newtype_enum("SDL_Keymod") - .newtype_enum("SDL_BlendMode") - .default_enum_style(bindgen::EnumVariation::Rust { - non_exhaustive: false, - }) - .ctypes_prefix("libc"); - let mut image_bindings = bindgen::Builder::default() - .use_core() - .raw_line("use crate::*;") - .ctypes_prefix("libc"); - - let mut ttf_bindings = bindgen::Builder::default() - .use_core() - .raw_line("use crate::*;") - .ctypes_prefix("libc"); - - let mut mixer_bindings = bindgen::Builder::default() - .use_core() - .raw_line("use crate::*;") - .ctypes_prefix("libc"); + let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); - let mut gfx_framerate_bindings = bindgen::Builder::default().use_core().ctypes_prefix("libc"); - let mut gfx_primitives_bindings = bindgen::Builder::default() - .use_core() - .raw_line("use crate::*;") - .ctypes_prefix("libc"); - let mut gfx_imagefilter_bindings = bindgen::Builder::default().use_core().ctypes_prefix("libc"); - let mut gfx_rotozoom_bindings = bindgen::Builder::default() + let mut all_bindings = bindgen::builder() + // enable no_std-friendly output by only using core definitions .use_core() - .raw_line("use crate::*;") .ctypes_prefix("libc"); - // Set correct target triple for bindgen when cross-compiling - if target != host { - bindings = bindings.clang_arg("-target"); - bindings = bindings.clang_arg(target); - - if cfg!(feature = "image") { - image_bindings = image_bindings.clang_arg("-target"); - image_bindings = image_bindings.clang_arg(target); - } - - if cfg!(feature = "ttf") { - ttf_bindings = ttf_bindings.clang_arg("-target"); - ttf_bindings = ttf_bindings.clang_arg(target); - } + #[derive(Debug)] + struct ParseCallbacks; - if cfg!(feature = "mixer") { - mixer_bindings = mixer_bindings.clang_arg("-target"); - mixer_bindings = mixer_bindings.clang_arg(target); + impl bindgen::callbacks::ParseCallbacks for ParseCallbacks { + fn add_derives(&self, info: &bindgen::callbacks::DeriveInfo<'_>) -> Vec { + // bindgen has too little information on these types to know they can derive these traits + // see https://github.com/rust-lang/rust-bindgen/issues/2079 + if ["Mix_Chunk", "FPSmanager"].contains(&info.name) { + ["Debug", "Copy", "Clone"].map(Into::into).into() + } else { + vec![] + } } + } - if cfg!(feature = "gfx") { - gfx_framerate_bindings = gfx_framerate_bindings.clang_arg("-target"); - gfx_framerate_bindings = gfx_framerate_bindings.clang_arg(target); - - gfx_primitives_bindings = gfx_primitives_bindings.clang_arg("-target"); - gfx_primitives_bindings = gfx_primitives_bindings.clang_arg(target); - - gfx_imagefilter_bindings = gfx_imagefilter_bindings.clang_arg("-target"); - gfx_imagefilter_bindings = gfx_imagefilter_bindings.clang_arg(target); + all_bindings = all_bindings.parse_callbacks(Box::new(ParseCallbacks)); - gfx_rotozoom_bindings = gfx_rotozoom_bindings.clang_arg("-target"); - gfx_rotozoom_bindings = gfx_rotozoom_bindings.clang_arg(target); - } + // Set correct target triple for bindgen when cross-compiling + if target != host { + all_bindings = all_bindings.clang_args(["-target", target]); } for headers_path in headers_paths { - bindings = bindings.clang_arg(format!("-I{}", headers_path)); - if cfg!(feature = "image") { - image_bindings = image_bindings.clang_arg(format!("-I{}", headers_path)); - } - if cfg!(feature = "ttf") { - ttf_bindings = ttf_bindings.clang_arg(format!("-I{}", headers_path)); - } - if cfg!(feature = "mixer") { - mixer_bindings = mixer_bindings.clang_arg(format!("-I{}", headers_path)); - } - if cfg!(feature = "gfx") { - gfx_framerate_bindings = - gfx_framerate_bindings.clang_arg(format!("-I{}", headers_path)); - gfx_primitives_bindings = - gfx_primitives_bindings.clang_arg(format!("-I{}", headers_path)); - gfx_imagefilter_bindings = - gfx_imagefilter_bindings.clang_arg(format!("-I{}", headers_path)); - gfx_rotozoom_bindings = gfx_rotozoom_bindings.clang_arg(format!("-I{}", headers_path)); - } + all_bindings = all_bindings.clang_arg(format!("-I{headers_path}")); } if target_os == "windows-msvc" { - add_msvc_includes_to_bindings!(bindings); - if cfg!(feature = "image") { - add_msvc_includes_to_bindings!(image_bindings); - } - if cfg!(feature = "ttf") { - add_msvc_includes_to_bindings!(ttf_bindings); - } - if cfg!(feature = "mixer") { - add_msvc_includes_to_bindings!(mixer_bindings); - } - if cfg!(feature = "gfx") { - add_msvc_includes_to_bindings!(gfx_framerate_bindings); - add_msvc_includes_to_bindings!(gfx_primitives_bindings); - add_msvc_includes_to_bindings!(gfx_imagefilter_bindings); - add_msvc_includes_to_bindings!(gfx_rotozoom_bindings); - } - }; - - // SDL2 hasn't a default configuration for Linux + all_bindings = all_bindings.clang_args([ + "-IC:/Program Files (x86)/Windows Kits/8.1/Include/shared", + "-IC:/Program Files/LLVM/lib/clang/5.0.0/include", + "-IC:/Program Files (x86)/Windows Kits/10/Include/10.0.10240.0/ucrt", + "-IC:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include", + "-IC:/Program Files (x86)/Windows Kits/8.1/Include/um", + ]); + } + + // Don't put OS specific (X11 and Wayland related) items in the pregenerated bindings. + // This assumes you are on Linux when generating these. + #[cfg(not(update_pregenerated_bindings))] + // SDL2 doesn't have a default configuration for Linux if target_os == "linux-gnu" { - bindings = bindings.clang_arg("-DSDL_VIDEO_DRIVER_X11"); - bindings = bindings.clang_arg("-DSDL_VIDEO_DRIVER_WAYLAND"); - if cfg!(feature = "image") { - image_bindings = image_bindings.clang_arg("-DSDL_VIDEO_DRIVER_X11"); - image_bindings = image_bindings.clang_arg("-DSDL_VIDEO_DRIVER_WAYLAND"); - } - if cfg!(feature = "ttf") { - ttf_bindings = ttf_bindings.clang_arg("-DSDL_VIDEO_DRIVER_X11"); - ttf_bindings = ttf_bindings.clang_arg("-DSDL_VIDEO_DRIVER_WAYLAND"); - } - if cfg!(feature = "mixer") { - mixer_bindings = mixer_bindings.clang_arg("-DSDL_VIDEO_DRIVER_X11"); - mixer_bindings = mixer_bindings.clang_arg("-DSDL_VIDEO_DRIVER_WAYLAND"); - } - if cfg!(feature = "gfx") { - gfx_framerate_bindings = gfx_framerate_bindings.clang_arg("-DSDL_VIDEO_DRIVER_X11"); - gfx_framerate_bindings = gfx_framerate_bindings.clang_arg("-DSDL_VIDEO_DRIVER_WAYLAND"); - gfx_primitives_bindings = gfx_primitives_bindings.clang_arg("-DSDL_VIDEO_DRIVER_X11"); - gfx_primitives_bindings = - gfx_primitives_bindings.clang_arg("-DSDL_VIDEO_DRIVER_WAYLAND"); - gfx_imagefilter_bindings = gfx_imagefilter_bindings.clang_arg("-DSDL_VIDEO_DRIVER_X11"); - gfx_imagefilter_bindings = - gfx_imagefilter_bindings.clang_arg("-DSDL_VIDEO_DRIVER_WAYLAND"); - gfx_rotozoom_bindings = gfx_rotozoom_bindings.clang_arg("-DSDL_VIDEO_DRIVER_X11"); - gfx_rotozoom_bindings = gfx_rotozoom_bindings.clang_arg("-DSDL_VIDEO_DRIVER_WAYLAND"); - } + all_bindings = + all_bindings.clang_args(["-DSDL_VIDEO_DRIVER_X11", "-DSDL_VIDEO_DRIVER_WAYLAND"]); } - let bindings = bindings + let bindings = all_bindings + .clone() + .allowlist_item("(SDL|AUDIO|RW)_.*") + .bitfield_enum("SDL_RendererFlip") + .newtype_enum("SDL_Keymod") + .newtype_enum("SDL_BlendMode") + .default_enum_style(bindgen::EnumVariation::Rust { + non_exhaustive: false, + }) .header("wrapper.h") - .blocklist_item("FP_NAN") - .blocklist_item("FP_INFINITE") - .blocklist_item("FP_ZERO") - .blocklist_item("FP_SUBNORMAL") - .blocklist_item("FP_NORMAL") .derive_debug(false) .generate() .expect("Unable to generate bindings!"); - let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); - bindings .write_to_file(out_path.join("sdl_bindings.rs")) .expect("Couldn't write bindings!"); + let other_lib_bindings = all_bindings + .raw_line("#[allow(unused)]\nuse crate::*;") + .blocklist_item("__.*|_IO.*|FILE|((U|S)int\\d+)"); + if cfg!(feature = "image") { - let image_bindings = image_bindings + let image_bindings = other_lib_bindings + .clone() .header("wrapper_image.h") - .blocklist_item("FP_NAN") - .blocklist_item("FP_INFINITE") - .blocklist_item("FP_ZERO") - .blocklist_item("FP_SUBNORMAL") - .blocklist_item("FP_NORMAL") .allowlist_type("IMG.*") .allowlist_function("IMG.*") .allowlist_var("IMG.*") .blocklist_type("SDL_.*") - .blocklist_type("_IO.*|FILE") .generate() .expect("Unable to generate image_bindings!"); - let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); - image_bindings .write_to_file(out_path.join("sdl_image_bindings.rs")) .expect("Couldn't write image_bindings!"); } if cfg!(feature = "ttf") { - let ttf_bindings = ttf_bindings + let ttf_bindings = other_lib_bindings + .clone() .header("wrapper_ttf.h") - .blocklist_item("FP_NAN") - .blocklist_item("FP_INFINITE") - .blocklist_item("FP_ZERO") - .blocklist_item("FP_SUBNORMAL") - .blocklist_item("FP_NORMAL") .allowlist_type("TTF.*") .allowlist_function("TTF.*") .allowlist_var("TTF.*") .blocklist_type("SDL_.*") - .blocklist_type("_IO.*|FILE") .generate() .expect("Unable to generate ttf_bindings!"); - let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); - ttf_bindings .write_to_file(out_path.join("sdl_ttf_bindings.rs")) .expect("Couldn't write ttf_bindings!"); } if cfg!(feature = "mixer") { - let mixer_bindings = mixer_bindings + let mixer_bindings = other_lib_bindings + .clone() .header("wrapper_mixer.h") - .blocklist_item("FP_NAN") - .blocklist_item("FP_INFINITE") - .blocklist_item("FP_ZERO") - .blocklist_item("FP_SUBNORMAL") - .blocklist_item("FP_NORMAL") .allowlist_type("MIX.*") .allowlist_type("Mix.*") .allowlist_type("MUS.*") @@ -876,45 +731,31 @@ fn generate_bindings(target: &str, host: &str, headers_paths: &[String]) { .allowlist_var("MIX.*") .allowlist_var("MUS.*") .blocklist_type("SDL_.*") - .blocklist_type("_IO.*|FILE") .generate() .expect("Unable to generate mixer_bindings!"); - let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); - mixer_bindings .write_to_file(out_path.join("sdl_mixer_bindings.rs")) .expect("Couldn't write mixer_bindings!"); } if cfg!(feature = "gfx") { - let gfx_framerate_bindings = gfx_framerate_bindings + let gfx_framerate_bindings = other_lib_bindings + .clone() .header("wrapper_gfx_framerate.h") - .blocklist_item("FP_NAN") - .blocklist_item("FP_INFINITE") - .blocklist_item("FP_ZERO") - .blocklist_item("FP_SUBNORMAL") - .blocklist_item("FP_NORMAL") .allowlist_type("FPS.*") .allowlist_function("SDL_.*rame.*") .allowlist_var("FPS.*") - .blocklist_type("_IO.*|FILE") .generate() .expect("Unable to generate gfx_framerate_bindings!"); - let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); - gfx_framerate_bindings .write_to_file(out_path.join("sdl_gfx_framerate_bindings.rs")) .expect("Couldn't write gfx_framerate_bindings!"); - let gfx_primitives_bindings = gfx_primitives_bindings + let gfx_primitives_bindings = other_lib_bindings + .clone() .header("wrapper_gfx_primitives.h") - .blocklist_item("FP_NAN") - .blocklist_item("FP_INFINITE") - .blocklist_item("FP_ZERO") - .blocklist_item("FP_SUBNORMAL") - .blocklist_item("FP_NORMAL") .blocklist_type("SDL_.*") .allowlist_function("pixel.*") .allowlist_function("rectangle.*") @@ -924,6 +765,7 @@ fn generate_bindings(target: &str, host: &str, headers_paths: &[String]) { .allowlist_function("thick.*") .allowlist_function(".*circle.*") .allowlist_function("arc.*") + .blocklist_function("arc4random.*") .allowlist_function("filled.*") .allowlist_function(".*ellipse.*") .allowlist_function("pie.*") @@ -934,56 +776,42 @@ fn generate_bindings(target: &str, host: &str, headers_paths: &[String]) { .allowlist_function("character.*") .allowlist_function("string.*") .allowlist_function("gfx.*") - .blocklist_type("_IO.*|FILE") .generate() .expect("Unable to generate gfx_primitives_bindings!"); - let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); - gfx_primitives_bindings .write_to_file(out_path.join("sdl_gfx_primitives_bindings.rs")) .expect("Couldn't write gfx_primitives_bindings!"); - let gfx_imagefilter_bindings = gfx_imagefilter_bindings + let gfx_imagefilter_bindings = other_lib_bindings + .clone() .header("wrapper_gfx_imagefilter.h") .allowlist_function("SDL_image.*") - .blocklist_item("FP_NAN") - .blocklist_item("FP_INFINITE") - .blocklist_item("FP_ZERO") - .blocklist_item("FP_SUBNORMAL") - .blocklist_item("FP_NORMAL") - .blocklist_type("_IO.*|FILE") .generate() .expect("Unable to generate gfx_imagefilter_bindings!"); - let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); - gfx_imagefilter_bindings .write_to_file(out_path.join("sdl_gfx_imagefilter_bindings.rs")) .expect("Couldn't write gfx_imagefilter_bindings!"); - let gfx_rotozoom_bindings = gfx_rotozoom_bindings + let gfx_rotozoom_bindings = other_lib_bindings + .clone() .header("wrapper_gfx_rotozoom.h") .blocklist_type("SDL_.*") .allowlist_function("rotozoom.*") .allowlist_function("zoom.*") .allowlist_function("shrink.*") .allowlist_function("rotate.*") - .blocklist_item("FP_NAN") - .blocklist_item("FP_INFINITE") - .blocklist_item("FP_ZERO") - .blocklist_item("FP_SUBNORMAL") - .blocklist_item("FP_NORMAL") - .blocklist_type("_IO.*|FILE") .generate() .expect("Unable to generate gfx_rotozoom_bindings!"); - let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); - gfx_rotozoom_bindings .write_to_file(out_path.join("sdl_gfx_rotozoom_bindings.rs")) .expect("Couldn't write gfx_rotozoom_bindings!"); } + + #[cfg(update_pregenerated_bindings)] + copy_pregenerated_bindings(); } fn get_os_from_triple(triple: &str) -> Option<&str> { diff --git a/sdl2-sys/sdl_bindings.rs b/sdl2-sys/sdl_bindings.rs index c7cba76505..af12f39276 100644 --- a/sdl2-sys/sdl_bindings.rs +++ b/sdl2-sys/sdl_bindings.rs @@ -9019,1275 +9019,6 @@ unsafe extern "C" { #[doc = " Clean up all initialized subsystems.\n\n You should call this function even if you have already shutdown each\n initialized subsystem with SDL_QuitSubSystem(). It is safe to call this\n function even in the case of errors in initialization.\n\n If you start a subsystem using a call to that subsystem's init function\n (for example SDL_VideoInit()) instead of SDL_Init() or SDL_InitSubSystem(),\n then you must use that subsystem's quit function (SDL_VideoQuit()) to shut\n it down before calling SDL_Quit(). But generally, you should not be using\n those functions directly anyhow; use SDL_Init() instead.\n\n You can use this function with atexit() to ensure that it is run when your\n application is shutdown, but it is not wise to do this from a library or\n other dynamically loaded code.\n\n \\since This function is available since SDL 2.0.0.\n\n \\sa SDL_Init\n \\sa SDL_QuitSubSystem"] pub fn SDL_Quit(); } -pub type XID = libc::c_ulong; -pub type Atom = libc::c_ulong; -pub type Time = libc::c_ulong; -pub type Window = XID; -pub type Drawable = XID; -pub type Colormap = XID; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct _XDisplay { - _unused: [u8; 0], -} -pub type Display = _XDisplay; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct XKeyEvent { - pub type_: libc::c_int, - pub serial: libc::c_ulong, - pub send_event: libc::c_int, - pub display: *mut Display, - pub window: Window, - pub root: Window, - pub subwindow: Window, - pub time: Time, - pub x: libc::c_int, - pub y: libc::c_int, - pub x_root: libc::c_int, - pub y_root: libc::c_int, - pub state: libc::c_uint, - pub keycode: libc::c_uint, - pub same_screen: libc::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of XKeyEvent"][::core::mem::size_of::() - 96usize]; - ["Alignment of XKeyEvent"][::core::mem::align_of::() - 8usize]; - ["Offset of field: XKeyEvent::type_"][::core::mem::offset_of!(XKeyEvent, type_) - 0usize]; - ["Offset of field: XKeyEvent::serial"][::core::mem::offset_of!(XKeyEvent, serial) - 8usize]; - ["Offset of field: XKeyEvent::send_event"] - [::core::mem::offset_of!(XKeyEvent, send_event) - 16usize]; - ["Offset of field: XKeyEvent::display"][::core::mem::offset_of!(XKeyEvent, display) - 24usize]; - ["Offset of field: XKeyEvent::window"][::core::mem::offset_of!(XKeyEvent, window) - 32usize]; - ["Offset of field: XKeyEvent::root"][::core::mem::offset_of!(XKeyEvent, root) - 40usize]; - ["Offset of field: XKeyEvent::subwindow"] - [::core::mem::offset_of!(XKeyEvent, subwindow) - 48usize]; - ["Offset of field: XKeyEvent::time"][::core::mem::offset_of!(XKeyEvent, time) - 56usize]; - ["Offset of field: XKeyEvent::x"][::core::mem::offset_of!(XKeyEvent, x) - 64usize]; - ["Offset of field: XKeyEvent::y"][::core::mem::offset_of!(XKeyEvent, y) - 68usize]; - ["Offset of field: XKeyEvent::x_root"][::core::mem::offset_of!(XKeyEvent, x_root) - 72usize]; - ["Offset of field: XKeyEvent::y_root"][::core::mem::offset_of!(XKeyEvent, y_root) - 76usize]; - ["Offset of field: XKeyEvent::state"][::core::mem::offset_of!(XKeyEvent, state) - 80usize]; - ["Offset of field: XKeyEvent::keycode"][::core::mem::offset_of!(XKeyEvent, keycode) - 84usize]; - ["Offset of field: XKeyEvent::same_screen"] - [::core::mem::offset_of!(XKeyEvent, same_screen) - 88usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct XButtonEvent { - pub type_: libc::c_int, - pub serial: libc::c_ulong, - pub send_event: libc::c_int, - pub display: *mut Display, - pub window: Window, - pub root: Window, - pub subwindow: Window, - pub time: Time, - pub x: libc::c_int, - pub y: libc::c_int, - pub x_root: libc::c_int, - pub y_root: libc::c_int, - pub state: libc::c_uint, - pub button: libc::c_uint, - pub same_screen: libc::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of XButtonEvent"][::core::mem::size_of::() - 96usize]; - ["Alignment of XButtonEvent"][::core::mem::align_of::() - 8usize]; - ["Offset of field: XButtonEvent::type_"][::core::mem::offset_of!(XButtonEvent, type_) - 0usize]; - ["Offset of field: XButtonEvent::serial"] - [::core::mem::offset_of!(XButtonEvent, serial) - 8usize]; - ["Offset of field: XButtonEvent::send_event"] - [::core::mem::offset_of!(XButtonEvent, send_event) - 16usize]; - ["Offset of field: XButtonEvent::display"] - [::core::mem::offset_of!(XButtonEvent, display) - 24usize]; - ["Offset of field: XButtonEvent::window"] - [::core::mem::offset_of!(XButtonEvent, window) - 32usize]; - ["Offset of field: XButtonEvent::root"][::core::mem::offset_of!(XButtonEvent, root) - 40usize]; - ["Offset of field: XButtonEvent::subwindow"] - [::core::mem::offset_of!(XButtonEvent, subwindow) - 48usize]; - ["Offset of field: XButtonEvent::time"][::core::mem::offset_of!(XButtonEvent, time) - 56usize]; - ["Offset of field: XButtonEvent::x"][::core::mem::offset_of!(XButtonEvent, x) - 64usize]; - ["Offset of field: XButtonEvent::y"][::core::mem::offset_of!(XButtonEvent, y) - 68usize]; - ["Offset of field: XButtonEvent::x_root"] - [::core::mem::offset_of!(XButtonEvent, x_root) - 72usize]; - ["Offset of field: XButtonEvent::y_root"] - [::core::mem::offset_of!(XButtonEvent, y_root) - 76usize]; - ["Offset of field: XButtonEvent::state"] - [::core::mem::offset_of!(XButtonEvent, state) - 80usize]; - ["Offset of field: XButtonEvent::button"] - [::core::mem::offset_of!(XButtonEvent, button) - 84usize]; - ["Offset of field: XButtonEvent::same_screen"] - [::core::mem::offset_of!(XButtonEvent, same_screen) - 88usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct XMotionEvent { - pub type_: libc::c_int, - pub serial: libc::c_ulong, - pub send_event: libc::c_int, - pub display: *mut Display, - pub window: Window, - pub root: Window, - pub subwindow: Window, - pub time: Time, - pub x: libc::c_int, - pub y: libc::c_int, - pub x_root: libc::c_int, - pub y_root: libc::c_int, - pub state: libc::c_uint, - pub is_hint: libc::c_char, - pub same_screen: libc::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of XMotionEvent"][::core::mem::size_of::() - 96usize]; - ["Alignment of XMotionEvent"][::core::mem::align_of::() - 8usize]; - ["Offset of field: XMotionEvent::type_"][::core::mem::offset_of!(XMotionEvent, type_) - 0usize]; - ["Offset of field: XMotionEvent::serial"] - [::core::mem::offset_of!(XMotionEvent, serial) - 8usize]; - ["Offset of field: XMotionEvent::send_event"] - [::core::mem::offset_of!(XMotionEvent, send_event) - 16usize]; - ["Offset of field: XMotionEvent::display"] - [::core::mem::offset_of!(XMotionEvent, display) - 24usize]; - ["Offset of field: XMotionEvent::window"] - [::core::mem::offset_of!(XMotionEvent, window) - 32usize]; - ["Offset of field: XMotionEvent::root"][::core::mem::offset_of!(XMotionEvent, root) - 40usize]; - ["Offset of field: XMotionEvent::subwindow"] - [::core::mem::offset_of!(XMotionEvent, subwindow) - 48usize]; - ["Offset of field: XMotionEvent::time"][::core::mem::offset_of!(XMotionEvent, time) - 56usize]; - ["Offset of field: XMotionEvent::x"][::core::mem::offset_of!(XMotionEvent, x) - 64usize]; - ["Offset of field: XMotionEvent::y"][::core::mem::offset_of!(XMotionEvent, y) - 68usize]; - ["Offset of field: XMotionEvent::x_root"] - [::core::mem::offset_of!(XMotionEvent, x_root) - 72usize]; - ["Offset of field: XMotionEvent::y_root"] - [::core::mem::offset_of!(XMotionEvent, y_root) - 76usize]; - ["Offset of field: XMotionEvent::state"] - [::core::mem::offset_of!(XMotionEvent, state) - 80usize]; - ["Offset of field: XMotionEvent::is_hint"] - [::core::mem::offset_of!(XMotionEvent, is_hint) - 84usize]; - ["Offset of field: XMotionEvent::same_screen"] - [::core::mem::offset_of!(XMotionEvent, same_screen) - 88usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct XCrossingEvent { - pub type_: libc::c_int, - pub serial: libc::c_ulong, - pub send_event: libc::c_int, - pub display: *mut Display, - pub window: Window, - pub root: Window, - pub subwindow: Window, - pub time: Time, - pub x: libc::c_int, - pub y: libc::c_int, - pub x_root: libc::c_int, - pub y_root: libc::c_int, - pub mode: libc::c_int, - pub detail: libc::c_int, - pub same_screen: libc::c_int, - pub focus: libc::c_int, - pub state: libc::c_uint, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of XCrossingEvent"][::core::mem::size_of::() - 104usize]; - ["Alignment of XCrossingEvent"][::core::mem::align_of::() - 8usize]; - ["Offset of field: XCrossingEvent::type_"] - [::core::mem::offset_of!(XCrossingEvent, type_) - 0usize]; - ["Offset of field: XCrossingEvent::serial"] - [::core::mem::offset_of!(XCrossingEvent, serial) - 8usize]; - ["Offset of field: XCrossingEvent::send_event"] - [::core::mem::offset_of!(XCrossingEvent, send_event) - 16usize]; - ["Offset of field: XCrossingEvent::display"] - [::core::mem::offset_of!(XCrossingEvent, display) - 24usize]; - ["Offset of field: XCrossingEvent::window"] - [::core::mem::offset_of!(XCrossingEvent, window) - 32usize]; - ["Offset of field: XCrossingEvent::root"] - [::core::mem::offset_of!(XCrossingEvent, root) - 40usize]; - ["Offset of field: XCrossingEvent::subwindow"] - [::core::mem::offset_of!(XCrossingEvent, subwindow) - 48usize]; - ["Offset of field: XCrossingEvent::time"] - [::core::mem::offset_of!(XCrossingEvent, time) - 56usize]; - ["Offset of field: XCrossingEvent::x"][::core::mem::offset_of!(XCrossingEvent, x) - 64usize]; - ["Offset of field: XCrossingEvent::y"][::core::mem::offset_of!(XCrossingEvent, y) - 68usize]; - ["Offset of field: XCrossingEvent::x_root"] - [::core::mem::offset_of!(XCrossingEvent, x_root) - 72usize]; - ["Offset of field: XCrossingEvent::y_root"] - [::core::mem::offset_of!(XCrossingEvent, y_root) - 76usize]; - ["Offset of field: XCrossingEvent::mode"] - [::core::mem::offset_of!(XCrossingEvent, mode) - 80usize]; - ["Offset of field: XCrossingEvent::detail"] - [::core::mem::offset_of!(XCrossingEvent, detail) - 84usize]; - ["Offset of field: XCrossingEvent::same_screen"] - [::core::mem::offset_of!(XCrossingEvent, same_screen) - 88usize]; - ["Offset of field: XCrossingEvent::focus"] - [::core::mem::offset_of!(XCrossingEvent, focus) - 92usize]; - ["Offset of field: XCrossingEvent::state"] - [::core::mem::offset_of!(XCrossingEvent, state) - 96usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct XFocusChangeEvent { - pub type_: libc::c_int, - pub serial: libc::c_ulong, - pub send_event: libc::c_int, - pub display: *mut Display, - pub window: Window, - pub mode: libc::c_int, - pub detail: libc::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of XFocusChangeEvent"][::core::mem::size_of::() - 48usize]; - ["Alignment of XFocusChangeEvent"][::core::mem::align_of::() - 8usize]; - ["Offset of field: XFocusChangeEvent::type_"] - [::core::mem::offset_of!(XFocusChangeEvent, type_) - 0usize]; - ["Offset of field: XFocusChangeEvent::serial"] - [::core::mem::offset_of!(XFocusChangeEvent, serial) - 8usize]; - ["Offset of field: XFocusChangeEvent::send_event"] - [::core::mem::offset_of!(XFocusChangeEvent, send_event) - 16usize]; - ["Offset of field: XFocusChangeEvent::display"] - [::core::mem::offset_of!(XFocusChangeEvent, display) - 24usize]; - ["Offset of field: XFocusChangeEvent::window"] - [::core::mem::offset_of!(XFocusChangeEvent, window) - 32usize]; - ["Offset of field: XFocusChangeEvent::mode"] - [::core::mem::offset_of!(XFocusChangeEvent, mode) - 40usize]; - ["Offset of field: XFocusChangeEvent::detail"] - [::core::mem::offset_of!(XFocusChangeEvent, detail) - 44usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct XKeymapEvent { - pub type_: libc::c_int, - pub serial: libc::c_ulong, - pub send_event: libc::c_int, - pub display: *mut Display, - pub window: Window, - pub key_vector: [libc::c_char; 32usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of XKeymapEvent"][::core::mem::size_of::() - 72usize]; - ["Alignment of XKeymapEvent"][::core::mem::align_of::() - 8usize]; - ["Offset of field: XKeymapEvent::type_"][::core::mem::offset_of!(XKeymapEvent, type_) - 0usize]; - ["Offset of field: XKeymapEvent::serial"] - [::core::mem::offset_of!(XKeymapEvent, serial) - 8usize]; - ["Offset of field: XKeymapEvent::send_event"] - [::core::mem::offset_of!(XKeymapEvent, send_event) - 16usize]; - ["Offset of field: XKeymapEvent::display"] - [::core::mem::offset_of!(XKeymapEvent, display) - 24usize]; - ["Offset of field: XKeymapEvent::window"] - [::core::mem::offset_of!(XKeymapEvent, window) - 32usize]; - ["Offset of field: XKeymapEvent::key_vector"] - [::core::mem::offset_of!(XKeymapEvent, key_vector) - 40usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct XExposeEvent { - pub type_: libc::c_int, - pub serial: libc::c_ulong, - pub send_event: libc::c_int, - pub display: *mut Display, - pub window: Window, - pub x: libc::c_int, - pub y: libc::c_int, - pub width: libc::c_int, - pub height: libc::c_int, - pub count: libc::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of XExposeEvent"][::core::mem::size_of::() - 64usize]; - ["Alignment of XExposeEvent"][::core::mem::align_of::() - 8usize]; - ["Offset of field: XExposeEvent::type_"][::core::mem::offset_of!(XExposeEvent, type_) - 0usize]; - ["Offset of field: XExposeEvent::serial"] - [::core::mem::offset_of!(XExposeEvent, serial) - 8usize]; - ["Offset of field: XExposeEvent::send_event"] - [::core::mem::offset_of!(XExposeEvent, send_event) - 16usize]; - ["Offset of field: XExposeEvent::display"] - [::core::mem::offset_of!(XExposeEvent, display) - 24usize]; - ["Offset of field: XExposeEvent::window"] - [::core::mem::offset_of!(XExposeEvent, window) - 32usize]; - ["Offset of field: XExposeEvent::x"][::core::mem::offset_of!(XExposeEvent, x) - 40usize]; - ["Offset of field: XExposeEvent::y"][::core::mem::offset_of!(XExposeEvent, y) - 44usize]; - ["Offset of field: XExposeEvent::width"] - [::core::mem::offset_of!(XExposeEvent, width) - 48usize]; - ["Offset of field: XExposeEvent::height"] - [::core::mem::offset_of!(XExposeEvent, height) - 52usize]; - ["Offset of field: XExposeEvent::count"] - [::core::mem::offset_of!(XExposeEvent, count) - 56usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct XGraphicsExposeEvent { - pub type_: libc::c_int, - pub serial: libc::c_ulong, - pub send_event: libc::c_int, - pub display: *mut Display, - pub drawable: Drawable, - pub x: libc::c_int, - pub y: libc::c_int, - pub width: libc::c_int, - pub height: libc::c_int, - pub count: libc::c_int, - pub major_code: libc::c_int, - pub minor_code: libc::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of XGraphicsExposeEvent"][::core::mem::size_of::() - 72usize]; - ["Alignment of XGraphicsExposeEvent"][::core::mem::align_of::() - 8usize]; - ["Offset of field: XGraphicsExposeEvent::type_"] - [::core::mem::offset_of!(XGraphicsExposeEvent, type_) - 0usize]; - ["Offset of field: XGraphicsExposeEvent::serial"] - [::core::mem::offset_of!(XGraphicsExposeEvent, serial) - 8usize]; - ["Offset of field: XGraphicsExposeEvent::send_event"] - [::core::mem::offset_of!(XGraphicsExposeEvent, send_event) - 16usize]; - ["Offset of field: XGraphicsExposeEvent::display"] - [::core::mem::offset_of!(XGraphicsExposeEvent, display) - 24usize]; - ["Offset of field: XGraphicsExposeEvent::drawable"] - [::core::mem::offset_of!(XGraphicsExposeEvent, drawable) - 32usize]; - ["Offset of field: XGraphicsExposeEvent::x"] - [::core::mem::offset_of!(XGraphicsExposeEvent, x) - 40usize]; - ["Offset of field: XGraphicsExposeEvent::y"] - [::core::mem::offset_of!(XGraphicsExposeEvent, y) - 44usize]; - ["Offset of field: XGraphicsExposeEvent::width"] - [::core::mem::offset_of!(XGraphicsExposeEvent, width) - 48usize]; - ["Offset of field: XGraphicsExposeEvent::height"] - [::core::mem::offset_of!(XGraphicsExposeEvent, height) - 52usize]; - ["Offset of field: XGraphicsExposeEvent::count"] - [::core::mem::offset_of!(XGraphicsExposeEvent, count) - 56usize]; - ["Offset of field: XGraphicsExposeEvent::major_code"] - [::core::mem::offset_of!(XGraphicsExposeEvent, major_code) - 60usize]; - ["Offset of field: XGraphicsExposeEvent::minor_code"] - [::core::mem::offset_of!(XGraphicsExposeEvent, minor_code) - 64usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct XNoExposeEvent { - pub type_: libc::c_int, - pub serial: libc::c_ulong, - pub send_event: libc::c_int, - pub display: *mut Display, - pub drawable: Drawable, - pub major_code: libc::c_int, - pub minor_code: libc::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of XNoExposeEvent"][::core::mem::size_of::() - 48usize]; - ["Alignment of XNoExposeEvent"][::core::mem::align_of::() - 8usize]; - ["Offset of field: XNoExposeEvent::type_"] - [::core::mem::offset_of!(XNoExposeEvent, type_) - 0usize]; - ["Offset of field: XNoExposeEvent::serial"] - [::core::mem::offset_of!(XNoExposeEvent, serial) - 8usize]; - ["Offset of field: XNoExposeEvent::send_event"] - [::core::mem::offset_of!(XNoExposeEvent, send_event) - 16usize]; - ["Offset of field: XNoExposeEvent::display"] - [::core::mem::offset_of!(XNoExposeEvent, display) - 24usize]; - ["Offset of field: XNoExposeEvent::drawable"] - [::core::mem::offset_of!(XNoExposeEvent, drawable) - 32usize]; - ["Offset of field: XNoExposeEvent::major_code"] - [::core::mem::offset_of!(XNoExposeEvent, major_code) - 40usize]; - ["Offset of field: XNoExposeEvent::minor_code"] - [::core::mem::offset_of!(XNoExposeEvent, minor_code) - 44usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct XVisibilityEvent { - pub type_: libc::c_int, - pub serial: libc::c_ulong, - pub send_event: libc::c_int, - pub display: *mut Display, - pub window: Window, - pub state: libc::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of XVisibilityEvent"][::core::mem::size_of::() - 48usize]; - ["Alignment of XVisibilityEvent"][::core::mem::align_of::() - 8usize]; - ["Offset of field: XVisibilityEvent::type_"] - [::core::mem::offset_of!(XVisibilityEvent, type_) - 0usize]; - ["Offset of field: XVisibilityEvent::serial"] - [::core::mem::offset_of!(XVisibilityEvent, serial) - 8usize]; - ["Offset of field: XVisibilityEvent::send_event"] - [::core::mem::offset_of!(XVisibilityEvent, send_event) - 16usize]; - ["Offset of field: XVisibilityEvent::display"] - [::core::mem::offset_of!(XVisibilityEvent, display) - 24usize]; - ["Offset of field: XVisibilityEvent::window"] - [::core::mem::offset_of!(XVisibilityEvent, window) - 32usize]; - ["Offset of field: XVisibilityEvent::state"] - [::core::mem::offset_of!(XVisibilityEvent, state) - 40usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct XCreateWindowEvent { - pub type_: libc::c_int, - pub serial: libc::c_ulong, - pub send_event: libc::c_int, - pub display: *mut Display, - pub parent: Window, - pub window: Window, - pub x: libc::c_int, - pub y: libc::c_int, - pub width: libc::c_int, - pub height: libc::c_int, - pub border_width: libc::c_int, - pub override_redirect: libc::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of XCreateWindowEvent"][::core::mem::size_of::() - 72usize]; - ["Alignment of XCreateWindowEvent"][::core::mem::align_of::() - 8usize]; - ["Offset of field: XCreateWindowEvent::type_"] - [::core::mem::offset_of!(XCreateWindowEvent, type_) - 0usize]; - ["Offset of field: XCreateWindowEvent::serial"] - [::core::mem::offset_of!(XCreateWindowEvent, serial) - 8usize]; - ["Offset of field: XCreateWindowEvent::send_event"] - [::core::mem::offset_of!(XCreateWindowEvent, send_event) - 16usize]; - ["Offset of field: XCreateWindowEvent::display"] - [::core::mem::offset_of!(XCreateWindowEvent, display) - 24usize]; - ["Offset of field: XCreateWindowEvent::parent"] - [::core::mem::offset_of!(XCreateWindowEvent, parent) - 32usize]; - ["Offset of field: XCreateWindowEvent::window"] - [::core::mem::offset_of!(XCreateWindowEvent, window) - 40usize]; - ["Offset of field: XCreateWindowEvent::x"] - [::core::mem::offset_of!(XCreateWindowEvent, x) - 48usize]; - ["Offset of field: XCreateWindowEvent::y"] - [::core::mem::offset_of!(XCreateWindowEvent, y) - 52usize]; - ["Offset of field: XCreateWindowEvent::width"] - [::core::mem::offset_of!(XCreateWindowEvent, width) - 56usize]; - ["Offset of field: XCreateWindowEvent::height"] - [::core::mem::offset_of!(XCreateWindowEvent, height) - 60usize]; - ["Offset of field: XCreateWindowEvent::border_width"] - [::core::mem::offset_of!(XCreateWindowEvent, border_width) - 64usize]; - ["Offset of field: XCreateWindowEvent::override_redirect"] - [::core::mem::offset_of!(XCreateWindowEvent, override_redirect) - 68usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct XDestroyWindowEvent { - pub type_: libc::c_int, - pub serial: libc::c_ulong, - pub send_event: libc::c_int, - pub display: *mut Display, - pub event: Window, - pub window: Window, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of XDestroyWindowEvent"][::core::mem::size_of::() - 48usize]; - ["Alignment of XDestroyWindowEvent"][::core::mem::align_of::() - 8usize]; - ["Offset of field: XDestroyWindowEvent::type_"] - [::core::mem::offset_of!(XDestroyWindowEvent, type_) - 0usize]; - ["Offset of field: XDestroyWindowEvent::serial"] - [::core::mem::offset_of!(XDestroyWindowEvent, serial) - 8usize]; - ["Offset of field: XDestroyWindowEvent::send_event"] - [::core::mem::offset_of!(XDestroyWindowEvent, send_event) - 16usize]; - ["Offset of field: XDestroyWindowEvent::display"] - [::core::mem::offset_of!(XDestroyWindowEvent, display) - 24usize]; - ["Offset of field: XDestroyWindowEvent::event"] - [::core::mem::offset_of!(XDestroyWindowEvent, event) - 32usize]; - ["Offset of field: XDestroyWindowEvent::window"] - [::core::mem::offset_of!(XDestroyWindowEvent, window) - 40usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct XUnmapEvent { - pub type_: libc::c_int, - pub serial: libc::c_ulong, - pub send_event: libc::c_int, - pub display: *mut Display, - pub event: Window, - pub window: Window, - pub from_configure: libc::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of XUnmapEvent"][::core::mem::size_of::() - 56usize]; - ["Alignment of XUnmapEvent"][::core::mem::align_of::() - 8usize]; - ["Offset of field: XUnmapEvent::type_"][::core::mem::offset_of!(XUnmapEvent, type_) - 0usize]; - ["Offset of field: XUnmapEvent::serial"][::core::mem::offset_of!(XUnmapEvent, serial) - 8usize]; - ["Offset of field: XUnmapEvent::send_event"] - [::core::mem::offset_of!(XUnmapEvent, send_event) - 16usize]; - ["Offset of field: XUnmapEvent::display"] - [::core::mem::offset_of!(XUnmapEvent, display) - 24usize]; - ["Offset of field: XUnmapEvent::event"][::core::mem::offset_of!(XUnmapEvent, event) - 32usize]; - ["Offset of field: XUnmapEvent::window"] - [::core::mem::offset_of!(XUnmapEvent, window) - 40usize]; - ["Offset of field: XUnmapEvent::from_configure"] - [::core::mem::offset_of!(XUnmapEvent, from_configure) - 48usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct XMapEvent { - pub type_: libc::c_int, - pub serial: libc::c_ulong, - pub send_event: libc::c_int, - pub display: *mut Display, - pub event: Window, - pub window: Window, - pub override_redirect: libc::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of XMapEvent"][::core::mem::size_of::() - 56usize]; - ["Alignment of XMapEvent"][::core::mem::align_of::() - 8usize]; - ["Offset of field: XMapEvent::type_"][::core::mem::offset_of!(XMapEvent, type_) - 0usize]; - ["Offset of field: XMapEvent::serial"][::core::mem::offset_of!(XMapEvent, serial) - 8usize]; - ["Offset of field: XMapEvent::send_event"] - [::core::mem::offset_of!(XMapEvent, send_event) - 16usize]; - ["Offset of field: XMapEvent::display"][::core::mem::offset_of!(XMapEvent, display) - 24usize]; - ["Offset of field: XMapEvent::event"][::core::mem::offset_of!(XMapEvent, event) - 32usize]; - ["Offset of field: XMapEvent::window"][::core::mem::offset_of!(XMapEvent, window) - 40usize]; - ["Offset of field: XMapEvent::override_redirect"] - [::core::mem::offset_of!(XMapEvent, override_redirect) - 48usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct XMapRequestEvent { - pub type_: libc::c_int, - pub serial: libc::c_ulong, - pub send_event: libc::c_int, - pub display: *mut Display, - pub parent: Window, - pub window: Window, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of XMapRequestEvent"][::core::mem::size_of::() - 48usize]; - ["Alignment of XMapRequestEvent"][::core::mem::align_of::() - 8usize]; - ["Offset of field: XMapRequestEvent::type_"] - [::core::mem::offset_of!(XMapRequestEvent, type_) - 0usize]; - ["Offset of field: XMapRequestEvent::serial"] - [::core::mem::offset_of!(XMapRequestEvent, serial) - 8usize]; - ["Offset of field: XMapRequestEvent::send_event"] - [::core::mem::offset_of!(XMapRequestEvent, send_event) - 16usize]; - ["Offset of field: XMapRequestEvent::display"] - [::core::mem::offset_of!(XMapRequestEvent, display) - 24usize]; - ["Offset of field: XMapRequestEvent::parent"] - [::core::mem::offset_of!(XMapRequestEvent, parent) - 32usize]; - ["Offset of field: XMapRequestEvent::window"] - [::core::mem::offset_of!(XMapRequestEvent, window) - 40usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct XReparentEvent { - pub type_: libc::c_int, - pub serial: libc::c_ulong, - pub send_event: libc::c_int, - pub display: *mut Display, - pub event: Window, - pub window: Window, - pub parent: Window, - pub x: libc::c_int, - pub y: libc::c_int, - pub override_redirect: libc::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of XReparentEvent"][::core::mem::size_of::() - 72usize]; - ["Alignment of XReparentEvent"][::core::mem::align_of::() - 8usize]; - ["Offset of field: XReparentEvent::type_"] - [::core::mem::offset_of!(XReparentEvent, type_) - 0usize]; - ["Offset of field: XReparentEvent::serial"] - [::core::mem::offset_of!(XReparentEvent, serial) - 8usize]; - ["Offset of field: XReparentEvent::send_event"] - [::core::mem::offset_of!(XReparentEvent, send_event) - 16usize]; - ["Offset of field: XReparentEvent::display"] - [::core::mem::offset_of!(XReparentEvent, display) - 24usize]; - ["Offset of field: XReparentEvent::event"] - [::core::mem::offset_of!(XReparentEvent, event) - 32usize]; - ["Offset of field: XReparentEvent::window"] - [::core::mem::offset_of!(XReparentEvent, window) - 40usize]; - ["Offset of field: XReparentEvent::parent"] - [::core::mem::offset_of!(XReparentEvent, parent) - 48usize]; - ["Offset of field: XReparentEvent::x"][::core::mem::offset_of!(XReparentEvent, x) - 56usize]; - ["Offset of field: XReparentEvent::y"][::core::mem::offset_of!(XReparentEvent, y) - 60usize]; - ["Offset of field: XReparentEvent::override_redirect"] - [::core::mem::offset_of!(XReparentEvent, override_redirect) - 64usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct XConfigureEvent { - pub type_: libc::c_int, - pub serial: libc::c_ulong, - pub send_event: libc::c_int, - pub display: *mut Display, - pub event: Window, - pub window: Window, - pub x: libc::c_int, - pub y: libc::c_int, - pub width: libc::c_int, - pub height: libc::c_int, - pub border_width: libc::c_int, - pub above: Window, - pub override_redirect: libc::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of XConfigureEvent"][::core::mem::size_of::() - 88usize]; - ["Alignment of XConfigureEvent"][::core::mem::align_of::() - 8usize]; - ["Offset of field: XConfigureEvent::type_"] - [::core::mem::offset_of!(XConfigureEvent, type_) - 0usize]; - ["Offset of field: XConfigureEvent::serial"] - [::core::mem::offset_of!(XConfigureEvent, serial) - 8usize]; - ["Offset of field: XConfigureEvent::send_event"] - [::core::mem::offset_of!(XConfigureEvent, send_event) - 16usize]; - ["Offset of field: XConfigureEvent::display"] - [::core::mem::offset_of!(XConfigureEvent, display) - 24usize]; - ["Offset of field: XConfigureEvent::event"] - [::core::mem::offset_of!(XConfigureEvent, event) - 32usize]; - ["Offset of field: XConfigureEvent::window"] - [::core::mem::offset_of!(XConfigureEvent, window) - 40usize]; - ["Offset of field: XConfigureEvent::x"][::core::mem::offset_of!(XConfigureEvent, x) - 48usize]; - ["Offset of field: XConfigureEvent::y"][::core::mem::offset_of!(XConfigureEvent, y) - 52usize]; - ["Offset of field: XConfigureEvent::width"] - [::core::mem::offset_of!(XConfigureEvent, width) - 56usize]; - ["Offset of field: XConfigureEvent::height"] - [::core::mem::offset_of!(XConfigureEvent, height) - 60usize]; - ["Offset of field: XConfigureEvent::border_width"] - [::core::mem::offset_of!(XConfigureEvent, border_width) - 64usize]; - ["Offset of field: XConfigureEvent::above"] - [::core::mem::offset_of!(XConfigureEvent, above) - 72usize]; - ["Offset of field: XConfigureEvent::override_redirect"] - [::core::mem::offset_of!(XConfigureEvent, override_redirect) - 80usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct XGravityEvent { - pub type_: libc::c_int, - pub serial: libc::c_ulong, - pub send_event: libc::c_int, - pub display: *mut Display, - pub event: Window, - pub window: Window, - pub x: libc::c_int, - pub y: libc::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of XGravityEvent"][::core::mem::size_of::() - 56usize]; - ["Alignment of XGravityEvent"][::core::mem::align_of::() - 8usize]; - ["Offset of field: XGravityEvent::type_"] - [::core::mem::offset_of!(XGravityEvent, type_) - 0usize]; - ["Offset of field: XGravityEvent::serial"] - [::core::mem::offset_of!(XGravityEvent, serial) - 8usize]; - ["Offset of field: XGravityEvent::send_event"] - [::core::mem::offset_of!(XGravityEvent, send_event) - 16usize]; - ["Offset of field: XGravityEvent::display"] - [::core::mem::offset_of!(XGravityEvent, display) - 24usize]; - ["Offset of field: XGravityEvent::event"] - [::core::mem::offset_of!(XGravityEvent, event) - 32usize]; - ["Offset of field: XGravityEvent::window"] - [::core::mem::offset_of!(XGravityEvent, window) - 40usize]; - ["Offset of field: XGravityEvent::x"][::core::mem::offset_of!(XGravityEvent, x) - 48usize]; - ["Offset of field: XGravityEvent::y"][::core::mem::offset_of!(XGravityEvent, y) - 52usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct XResizeRequestEvent { - pub type_: libc::c_int, - pub serial: libc::c_ulong, - pub send_event: libc::c_int, - pub display: *mut Display, - pub window: Window, - pub width: libc::c_int, - pub height: libc::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of XResizeRequestEvent"][::core::mem::size_of::() - 48usize]; - ["Alignment of XResizeRequestEvent"][::core::mem::align_of::() - 8usize]; - ["Offset of field: XResizeRequestEvent::type_"] - [::core::mem::offset_of!(XResizeRequestEvent, type_) - 0usize]; - ["Offset of field: XResizeRequestEvent::serial"] - [::core::mem::offset_of!(XResizeRequestEvent, serial) - 8usize]; - ["Offset of field: XResizeRequestEvent::send_event"] - [::core::mem::offset_of!(XResizeRequestEvent, send_event) - 16usize]; - ["Offset of field: XResizeRequestEvent::display"] - [::core::mem::offset_of!(XResizeRequestEvent, display) - 24usize]; - ["Offset of field: XResizeRequestEvent::window"] - [::core::mem::offset_of!(XResizeRequestEvent, window) - 32usize]; - ["Offset of field: XResizeRequestEvent::width"] - [::core::mem::offset_of!(XResizeRequestEvent, width) - 40usize]; - ["Offset of field: XResizeRequestEvent::height"] - [::core::mem::offset_of!(XResizeRequestEvent, height) - 44usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct XConfigureRequestEvent { - pub type_: libc::c_int, - pub serial: libc::c_ulong, - pub send_event: libc::c_int, - pub display: *mut Display, - pub parent: Window, - pub window: Window, - pub x: libc::c_int, - pub y: libc::c_int, - pub width: libc::c_int, - pub height: libc::c_int, - pub border_width: libc::c_int, - pub above: Window, - pub detail: libc::c_int, - pub value_mask: libc::c_ulong, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of XConfigureRequestEvent"][::core::mem::size_of::() - 96usize]; - ["Alignment of XConfigureRequestEvent"] - [::core::mem::align_of::() - 8usize]; - ["Offset of field: XConfigureRequestEvent::type_"] - [::core::mem::offset_of!(XConfigureRequestEvent, type_) - 0usize]; - ["Offset of field: XConfigureRequestEvent::serial"] - [::core::mem::offset_of!(XConfigureRequestEvent, serial) - 8usize]; - ["Offset of field: XConfigureRequestEvent::send_event"] - [::core::mem::offset_of!(XConfigureRequestEvent, send_event) - 16usize]; - ["Offset of field: XConfigureRequestEvent::display"] - [::core::mem::offset_of!(XConfigureRequestEvent, display) - 24usize]; - ["Offset of field: XConfigureRequestEvent::parent"] - [::core::mem::offset_of!(XConfigureRequestEvent, parent) - 32usize]; - ["Offset of field: XConfigureRequestEvent::window"] - [::core::mem::offset_of!(XConfigureRequestEvent, window) - 40usize]; - ["Offset of field: XConfigureRequestEvent::x"] - [::core::mem::offset_of!(XConfigureRequestEvent, x) - 48usize]; - ["Offset of field: XConfigureRequestEvent::y"] - [::core::mem::offset_of!(XConfigureRequestEvent, y) - 52usize]; - ["Offset of field: XConfigureRequestEvent::width"] - [::core::mem::offset_of!(XConfigureRequestEvent, width) - 56usize]; - ["Offset of field: XConfigureRequestEvent::height"] - [::core::mem::offset_of!(XConfigureRequestEvent, height) - 60usize]; - ["Offset of field: XConfigureRequestEvent::border_width"] - [::core::mem::offset_of!(XConfigureRequestEvent, border_width) - 64usize]; - ["Offset of field: XConfigureRequestEvent::above"] - [::core::mem::offset_of!(XConfigureRequestEvent, above) - 72usize]; - ["Offset of field: XConfigureRequestEvent::detail"] - [::core::mem::offset_of!(XConfigureRequestEvent, detail) - 80usize]; - ["Offset of field: XConfigureRequestEvent::value_mask"] - [::core::mem::offset_of!(XConfigureRequestEvent, value_mask) - 88usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct XCirculateEvent { - pub type_: libc::c_int, - pub serial: libc::c_ulong, - pub send_event: libc::c_int, - pub display: *mut Display, - pub event: Window, - pub window: Window, - pub place: libc::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of XCirculateEvent"][::core::mem::size_of::() - 56usize]; - ["Alignment of XCirculateEvent"][::core::mem::align_of::() - 8usize]; - ["Offset of field: XCirculateEvent::type_"] - [::core::mem::offset_of!(XCirculateEvent, type_) - 0usize]; - ["Offset of field: XCirculateEvent::serial"] - [::core::mem::offset_of!(XCirculateEvent, serial) - 8usize]; - ["Offset of field: XCirculateEvent::send_event"] - [::core::mem::offset_of!(XCirculateEvent, send_event) - 16usize]; - ["Offset of field: XCirculateEvent::display"] - [::core::mem::offset_of!(XCirculateEvent, display) - 24usize]; - ["Offset of field: XCirculateEvent::event"] - [::core::mem::offset_of!(XCirculateEvent, event) - 32usize]; - ["Offset of field: XCirculateEvent::window"] - [::core::mem::offset_of!(XCirculateEvent, window) - 40usize]; - ["Offset of field: XCirculateEvent::place"] - [::core::mem::offset_of!(XCirculateEvent, place) - 48usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct XCirculateRequestEvent { - pub type_: libc::c_int, - pub serial: libc::c_ulong, - pub send_event: libc::c_int, - pub display: *mut Display, - pub parent: Window, - pub window: Window, - pub place: libc::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of XCirculateRequestEvent"][::core::mem::size_of::() - 56usize]; - ["Alignment of XCirculateRequestEvent"] - [::core::mem::align_of::() - 8usize]; - ["Offset of field: XCirculateRequestEvent::type_"] - [::core::mem::offset_of!(XCirculateRequestEvent, type_) - 0usize]; - ["Offset of field: XCirculateRequestEvent::serial"] - [::core::mem::offset_of!(XCirculateRequestEvent, serial) - 8usize]; - ["Offset of field: XCirculateRequestEvent::send_event"] - [::core::mem::offset_of!(XCirculateRequestEvent, send_event) - 16usize]; - ["Offset of field: XCirculateRequestEvent::display"] - [::core::mem::offset_of!(XCirculateRequestEvent, display) - 24usize]; - ["Offset of field: XCirculateRequestEvent::parent"] - [::core::mem::offset_of!(XCirculateRequestEvent, parent) - 32usize]; - ["Offset of field: XCirculateRequestEvent::window"] - [::core::mem::offset_of!(XCirculateRequestEvent, window) - 40usize]; - ["Offset of field: XCirculateRequestEvent::place"] - [::core::mem::offset_of!(XCirculateRequestEvent, place) - 48usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct XPropertyEvent { - pub type_: libc::c_int, - pub serial: libc::c_ulong, - pub send_event: libc::c_int, - pub display: *mut Display, - pub window: Window, - pub atom: Atom, - pub time: Time, - pub state: libc::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of XPropertyEvent"][::core::mem::size_of::() - 64usize]; - ["Alignment of XPropertyEvent"][::core::mem::align_of::() - 8usize]; - ["Offset of field: XPropertyEvent::type_"] - [::core::mem::offset_of!(XPropertyEvent, type_) - 0usize]; - ["Offset of field: XPropertyEvent::serial"] - [::core::mem::offset_of!(XPropertyEvent, serial) - 8usize]; - ["Offset of field: XPropertyEvent::send_event"] - [::core::mem::offset_of!(XPropertyEvent, send_event) - 16usize]; - ["Offset of field: XPropertyEvent::display"] - [::core::mem::offset_of!(XPropertyEvent, display) - 24usize]; - ["Offset of field: XPropertyEvent::window"] - [::core::mem::offset_of!(XPropertyEvent, window) - 32usize]; - ["Offset of field: XPropertyEvent::atom"] - [::core::mem::offset_of!(XPropertyEvent, atom) - 40usize]; - ["Offset of field: XPropertyEvent::time"] - [::core::mem::offset_of!(XPropertyEvent, time) - 48usize]; - ["Offset of field: XPropertyEvent::state"] - [::core::mem::offset_of!(XPropertyEvent, state) - 56usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct XSelectionClearEvent { - pub type_: libc::c_int, - pub serial: libc::c_ulong, - pub send_event: libc::c_int, - pub display: *mut Display, - pub window: Window, - pub selection: Atom, - pub time: Time, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of XSelectionClearEvent"][::core::mem::size_of::() - 56usize]; - ["Alignment of XSelectionClearEvent"][::core::mem::align_of::() - 8usize]; - ["Offset of field: XSelectionClearEvent::type_"] - [::core::mem::offset_of!(XSelectionClearEvent, type_) - 0usize]; - ["Offset of field: XSelectionClearEvent::serial"] - [::core::mem::offset_of!(XSelectionClearEvent, serial) - 8usize]; - ["Offset of field: XSelectionClearEvent::send_event"] - [::core::mem::offset_of!(XSelectionClearEvent, send_event) - 16usize]; - ["Offset of field: XSelectionClearEvent::display"] - [::core::mem::offset_of!(XSelectionClearEvent, display) - 24usize]; - ["Offset of field: XSelectionClearEvent::window"] - [::core::mem::offset_of!(XSelectionClearEvent, window) - 32usize]; - ["Offset of field: XSelectionClearEvent::selection"] - [::core::mem::offset_of!(XSelectionClearEvent, selection) - 40usize]; - ["Offset of field: XSelectionClearEvent::time"] - [::core::mem::offset_of!(XSelectionClearEvent, time) - 48usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct XSelectionRequestEvent { - pub type_: libc::c_int, - pub serial: libc::c_ulong, - pub send_event: libc::c_int, - pub display: *mut Display, - pub owner: Window, - pub requestor: Window, - pub selection: Atom, - pub target: Atom, - pub property: Atom, - pub time: Time, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of XSelectionRequestEvent"][::core::mem::size_of::() - 80usize]; - ["Alignment of XSelectionRequestEvent"] - [::core::mem::align_of::() - 8usize]; - ["Offset of field: XSelectionRequestEvent::type_"] - [::core::mem::offset_of!(XSelectionRequestEvent, type_) - 0usize]; - ["Offset of field: XSelectionRequestEvent::serial"] - [::core::mem::offset_of!(XSelectionRequestEvent, serial) - 8usize]; - ["Offset of field: XSelectionRequestEvent::send_event"] - [::core::mem::offset_of!(XSelectionRequestEvent, send_event) - 16usize]; - ["Offset of field: XSelectionRequestEvent::display"] - [::core::mem::offset_of!(XSelectionRequestEvent, display) - 24usize]; - ["Offset of field: XSelectionRequestEvent::owner"] - [::core::mem::offset_of!(XSelectionRequestEvent, owner) - 32usize]; - ["Offset of field: XSelectionRequestEvent::requestor"] - [::core::mem::offset_of!(XSelectionRequestEvent, requestor) - 40usize]; - ["Offset of field: XSelectionRequestEvent::selection"] - [::core::mem::offset_of!(XSelectionRequestEvent, selection) - 48usize]; - ["Offset of field: XSelectionRequestEvent::target"] - [::core::mem::offset_of!(XSelectionRequestEvent, target) - 56usize]; - ["Offset of field: XSelectionRequestEvent::property"] - [::core::mem::offset_of!(XSelectionRequestEvent, property) - 64usize]; - ["Offset of field: XSelectionRequestEvent::time"] - [::core::mem::offset_of!(XSelectionRequestEvent, time) - 72usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct XSelectionEvent { - pub type_: libc::c_int, - pub serial: libc::c_ulong, - pub send_event: libc::c_int, - pub display: *mut Display, - pub requestor: Window, - pub selection: Atom, - pub target: Atom, - pub property: Atom, - pub time: Time, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of XSelectionEvent"][::core::mem::size_of::() - 72usize]; - ["Alignment of XSelectionEvent"][::core::mem::align_of::() - 8usize]; - ["Offset of field: XSelectionEvent::type_"] - [::core::mem::offset_of!(XSelectionEvent, type_) - 0usize]; - ["Offset of field: XSelectionEvent::serial"] - [::core::mem::offset_of!(XSelectionEvent, serial) - 8usize]; - ["Offset of field: XSelectionEvent::send_event"] - [::core::mem::offset_of!(XSelectionEvent, send_event) - 16usize]; - ["Offset of field: XSelectionEvent::display"] - [::core::mem::offset_of!(XSelectionEvent, display) - 24usize]; - ["Offset of field: XSelectionEvent::requestor"] - [::core::mem::offset_of!(XSelectionEvent, requestor) - 32usize]; - ["Offset of field: XSelectionEvent::selection"] - [::core::mem::offset_of!(XSelectionEvent, selection) - 40usize]; - ["Offset of field: XSelectionEvent::target"] - [::core::mem::offset_of!(XSelectionEvent, target) - 48usize]; - ["Offset of field: XSelectionEvent::property"] - [::core::mem::offset_of!(XSelectionEvent, property) - 56usize]; - ["Offset of field: XSelectionEvent::time"] - [::core::mem::offset_of!(XSelectionEvent, time) - 64usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct XColormapEvent { - pub type_: libc::c_int, - pub serial: libc::c_ulong, - pub send_event: libc::c_int, - pub display: *mut Display, - pub window: Window, - pub colormap: Colormap, - pub new: libc::c_int, - pub state: libc::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of XColormapEvent"][::core::mem::size_of::() - 56usize]; - ["Alignment of XColormapEvent"][::core::mem::align_of::() - 8usize]; - ["Offset of field: XColormapEvent::type_"] - [::core::mem::offset_of!(XColormapEvent, type_) - 0usize]; - ["Offset of field: XColormapEvent::serial"] - [::core::mem::offset_of!(XColormapEvent, serial) - 8usize]; - ["Offset of field: XColormapEvent::send_event"] - [::core::mem::offset_of!(XColormapEvent, send_event) - 16usize]; - ["Offset of field: XColormapEvent::display"] - [::core::mem::offset_of!(XColormapEvent, display) - 24usize]; - ["Offset of field: XColormapEvent::window"] - [::core::mem::offset_of!(XColormapEvent, window) - 32usize]; - ["Offset of field: XColormapEvent::colormap"] - [::core::mem::offset_of!(XColormapEvent, colormap) - 40usize]; - ["Offset of field: XColormapEvent::new"] - [::core::mem::offset_of!(XColormapEvent, new) - 48usize]; - ["Offset of field: XColormapEvent::state"] - [::core::mem::offset_of!(XColormapEvent, state) - 52usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct XClientMessageEvent { - pub type_: libc::c_int, - pub serial: libc::c_ulong, - pub send_event: libc::c_int, - pub display: *mut Display, - pub window: Window, - pub message_type: Atom, - pub format: libc::c_int, - pub data: XClientMessageEvent__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union XClientMessageEvent__bindgen_ty_1 { - pub b: [libc::c_char; 20usize], - pub s: [libc::c_short; 10usize], - pub l: [libc::c_long; 5usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of XClientMessageEvent__bindgen_ty_1"] - [::core::mem::size_of::() - 40usize]; - ["Alignment of XClientMessageEvent__bindgen_ty_1"] - [::core::mem::align_of::() - 8usize]; - ["Offset of field: XClientMessageEvent__bindgen_ty_1::b"] - [::core::mem::offset_of!(XClientMessageEvent__bindgen_ty_1, b) - 0usize]; - ["Offset of field: XClientMessageEvent__bindgen_ty_1::s"] - [::core::mem::offset_of!(XClientMessageEvent__bindgen_ty_1, s) - 0usize]; - ["Offset of field: XClientMessageEvent__bindgen_ty_1::l"] - [::core::mem::offset_of!(XClientMessageEvent__bindgen_ty_1, l) - 0usize]; -}; -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of XClientMessageEvent"][::core::mem::size_of::() - 96usize]; - ["Alignment of XClientMessageEvent"][::core::mem::align_of::() - 8usize]; - ["Offset of field: XClientMessageEvent::type_"] - [::core::mem::offset_of!(XClientMessageEvent, type_) - 0usize]; - ["Offset of field: XClientMessageEvent::serial"] - [::core::mem::offset_of!(XClientMessageEvent, serial) - 8usize]; - ["Offset of field: XClientMessageEvent::send_event"] - [::core::mem::offset_of!(XClientMessageEvent, send_event) - 16usize]; - ["Offset of field: XClientMessageEvent::display"] - [::core::mem::offset_of!(XClientMessageEvent, display) - 24usize]; - ["Offset of field: XClientMessageEvent::window"] - [::core::mem::offset_of!(XClientMessageEvent, window) - 32usize]; - ["Offset of field: XClientMessageEvent::message_type"] - [::core::mem::offset_of!(XClientMessageEvent, message_type) - 40usize]; - ["Offset of field: XClientMessageEvent::format"] - [::core::mem::offset_of!(XClientMessageEvent, format) - 48usize]; - ["Offset of field: XClientMessageEvent::data"] - [::core::mem::offset_of!(XClientMessageEvent, data) - 56usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct XMappingEvent { - pub type_: libc::c_int, - pub serial: libc::c_ulong, - pub send_event: libc::c_int, - pub display: *mut Display, - pub window: Window, - pub request: libc::c_int, - pub first_keycode: libc::c_int, - pub count: libc::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of XMappingEvent"][::core::mem::size_of::() - 56usize]; - ["Alignment of XMappingEvent"][::core::mem::align_of::() - 8usize]; - ["Offset of field: XMappingEvent::type_"] - [::core::mem::offset_of!(XMappingEvent, type_) - 0usize]; - ["Offset of field: XMappingEvent::serial"] - [::core::mem::offset_of!(XMappingEvent, serial) - 8usize]; - ["Offset of field: XMappingEvent::send_event"] - [::core::mem::offset_of!(XMappingEvent, send_event) - 16usize]; - ["Offset of field: XMappingEvent::display"] - [::core::mem::offset_of!(XMappingEvent, display) - 24usize]; - ["Offset of field: XMappingEvent::window"] - [::core::mem::offset_of!(XMappingEvent, window) - 32usize]; - ["Offset of field: XMappingEvent::request"] - [::core::mem::offset_of!(XMappingEvent, request) - 40usize]; - ["Offset of field: XMappingEvent::first_keycode"] - [::core::mem::offset_of!(XMappingEvent, first_keycode) - 44usize]; - ["Offset of field: XMappingEvent::count"] - [::core::mem::offset_of!(XMappingEvent, count) - 48usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct XErrorEvent { - pub type_: libc::c_int, - pub display: *mut Display, - pub resourceid: XID, - pub serial: libc::c_ulong, - pub error_code: libc::c_uchar, - pub request_code: libc::c_uchar, - pub minor_code: libc::c_uchar, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of XErrorEvent"][::core::mem::size_of::() - 40usize]; - ["Alignment of XErrorEvent"][::core::mem::align_of::() - 8usize]; - ["Offset of field: XErrorEvent::type_"][::core::mem::offset_of!(XErrorEvent, type_) - 0usize]; - ["Offset of field: XErrorEvent::display"] - [::core::mem::offset_of!(XErrorEvent, display) - 8usize]; - ["Offset of field: XErrorEvent::resourceid"] - [::core::mem::offset_of!(XErrorEvent, resourceid) - 16usize]; - ["Offset of field: XErrorEvent::serial"] - [::core::mem::offset_of!(XErrorEvent, serial) - 24usize]; - ["Offset of field: XErrorEvent::error_code"] - [::core::mem::offset_of!(XErrorEvent, error_code) - 32usize]; - ["Offset of field: XErrorEvent::request_code"] - [::core::mem::offset_of!(XErrorEvent, request_code) - 33usize]; - ["Offset of field: XErrorEvent::minor_code"] - [::core::mem::offset_of!(XErrorEvent, minor_code) - 34usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct XAnyEvent { - pub type_: libc::c_int, - pub serial: libc::c_ulong, - pub send_event: libc::c_int, - pub display: *mut Display, - pub window: Window, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of XAnyEvent"][::core::mem::size_of::() - 40usize]; - ["Alignment of XAnyEvent"][::core::mem::align_of::() - 8usize]; - ["Offset of field: XAnyEvent::type_"][::core::mem::offset_of!(XAnyEvent, type_) - 0usize]; - ["Offset of field: XAnyEvent::serial"][::core::mem::offset_of!(XAnyEvent, serial) - 8usize]; - ["Offset of field: XAnyEvent::send_event"] - [::core::mem::offset_of!(XAnyEvent, send_event) - 16usize]; - ["Offset of field: XAnyEvent::display"][::core::mem::offset_of!(XAnyEvent, display) - 24usize]; - ["Offset of field: XAnyEvent::window"][::core::mem::offset_of!(XAnyEvent, window) - 32usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct XGenericEvent { - pub type_: libc::c_int, - pub serial: libc::c_ulong, - pub send_event: libc::c_int, - pub display: *mut Display, - pub extension: libc::c_int, - pub evtype: libc::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of XGenericEvent"][::core::mem::size_of::() - 40usize]; - ["Alignment of XGenericEvent"][::core::mem::align_of::() - 8usize]; - ["Offset of field: XGenericEvent::type_"] - [::core::mem::offset_of!(XGenericEvent, type_) - 0usize]; - ["Offset of field: XGenericEvent::serial"] - [::core::mem::offset_of!(XGenericEvent, serial) - 8usize]; - ["Offset of field: XGenericEvent::send_event"] - [::core::mem::offset_of!(XGenericEvent, send_event) - 16usize]; - ["Offset of field: XGenericEvent::display"] - [::core::mem::offset_of!(XGenericEvent, display) - 24usize]; - ["Offset of field: XGenericEvent::extension"] - [::core::mem::offset_of!(XGenericEvent, extension) - 32usize]; - ["Offset of field: XGenericEvent::evtype"] - [::core::mem::offset_of!(XGenericEvent, evtype) - 36usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct XGenericEventCookie { - pub type_: libc::c_int, - pub serial: libc::c_ulong, - pub send_event: libc::c_int, - pub display: *mut Display, - pub extension: libc::c_int, - pub evtype: libc::c_int, - pub cookie: libc::c_uint, - pub data: *mut libc::c_void, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of XGenericEventCookie"][::core::mem::size_of::() - 56usize]; - ["Alignment of XGenericEventCookie"][::core::mem::align_of::() - 8usize]; - ["Offset of field: XGenericEventCookie::type_"] - [::core::mem::offset_of!(XGenericEventCookie, type_) - 0usize]; - ["Offset of field: XGenericEventCookie::serial"] - [::core::mem::offset_of!(XGenericEventCookie, serial) - 8usize]; - ["Offset of field: XGenericEventCookie::send_event"] - [::core::mem::offset_of!(XGenericEventCookie, send_event) - 16usize]; - ["Offset of field: XGenericEventCookie::display"] - [::core::mem::offset_of!(XGenericEventCookie, display) - 24usize]; - ["Offset of field: XGenericEventCookie::extension"] - [::core::mem::offset_of!(XGenericEventCookie, extension) - 32usize]; - ["Offset of field: XGenericEventCookie::evtype"] - [::core::mem::offset_of!(XGenericEventCookie, evtype) - 36usize]; - ["Offset of field: XGenericEventCookie::cookie"] - [::core::mem::offset_of!(XGenericEventCookie, cookie) - 40usize]; - ["Offset of field: XGenericEventCookie::data"] - [::core::mem::offset_of!(XGenericEventCookie, data) - 48usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub union _XEvent { - pub type_: libc::c_int, - pub xany: XAnyEvent, - pub xkey: XKeyEvent, - pub xbutton: XButtonEvent, - pub xmotion: XMotionEvent, - pub xcrossing: XCrossingEvent, - pub xfocus: XFocusChangeEvent, - pub xexpose: XExposeEvent, - pub xgraphicsexpose: XGraphicsExposeEvent, - pub xnoexpose: XNoExposeEvent, - pub xvisibility: XVisibilityEvent, - pub xcreatewindow: XCreateWindowEvent, - pub xdestroywindow: XDestroyWindowEvent, - pub xunmap: XUnmapEvent, - pub xmap: XMapEvent, - pub xmaprequest: XMapRequestEvent, - pub xreparent: XReparentEvent, - pub xconfigure: XConfigureEvent, - pub xgravity: XGravityEvent, - pub xresizerequest: XResizeRequestEvent, - pub xconfigurerequest: XConfigureRequestEvent, - pub xcirculate: XCirculateEvent, - pub xcirculaterequest: XCirculateRequestEvent, - pub xproperty: XPropertyEvent, - pub xselectionclear: XSelectionClearEvent, - pub xselectionrequest: XSelectionRequestEvent, - pub xselection: XSelectionEvent, - pub xcolormap: XColormapEvent, - pub xclient: XClientMessageEvent, - pub xmapping: XMappingEvent, - pub xerror: XErrorEvent, - pub xkeymap: XKeymapEvent, - pub xgeneric: XGenericEvent, - pub xcookie: XGenericEventCookie, - pub pad: [libc::c_long; 24usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of _XEvent"][::core::mem::size_of::<_XEvent>() - 192usize]; - ["Alignment of _XEvent"][::core::mem::align_of::<_XEvent>() - 8usize]; - ["Offset of field: _XEvent::type_"][::core::mem::offset_of!(_XEvent, type_) - 0usize]; - ["Offset of field: _XEvent::xany"][::core::mem::offset_of!(_XEvent, xany) - 0usize]; - ["Offset of field: _XEvent::xkey"][::core::mem::offset_of!(_XEvent, xkey) - 0usize]; - ["Offset of field: _XEvent::xbutton"][::core::mem::offset_of!(_XEvent, xbutton) - 0usize]; - ["Offset of field: _XEvent::xmotion"][::core::mem::offset_of!(_XEvent, xmotion) - 0usize]; - ["Offset of field: _XEvent::xcrossing"][::core::mem::offset_of!(_XEvent, xcrossing) - 0usize]; - ["Offset of field: _XEvent::xfocus"][::core::mem::offset_of!(_XEvent, xfocus) - 0usize]; - ["Offset of field: _XEvent::xexpose"][::core::mem::offset_of!(_XEvent, xexpose) - 0usize]; - ["Offset of field: _XEvent::xgraphicsexpose"] - [::core::mem::offset_of!(_XEvent, xgraphicsexpose) - 0usize]; - ["Offset of field: _XEvent::xnoexpose"][::core::mem::offset_of!(_XEvent, xnoexpose) - 0usize]; - ["Offset of field: _XEvent::xvisibility"] - [::core::mem::offset_of!(_XEvent, xvisibility) - 0usize]; - ["Offset of field: _XEvent::xcreatewindow"] - [::core::mem::offset_of!(_XEvent, xcreatewindow) - 0usize]; - ["Offset of field: _XEvent::xdestroywindow"] - [::core::mem::offset_of!(_XEvent, xdestroywindow) - 0usize]; - ["Offset of field: _XEvent::xunmap"][::core::mem::offset_of!(_XEvent, xunmap) - 0usize]; - ["Offset of field: _XEvent::xmap"][::core::mem::offset_of!(_XEvent, xmap) - 0usize]; - ["Offset of field: _XEvent::xmaprequest"] - [::core::mem::offset_of!(_XEvent, xmaprequest) - 0usize]; - ["Offset of field: _XEvent::xreparent"][::core::mem::offset_of!(_XEvent, xreparent) - 0usize]; - ["Offset of field: _XEvent::xconfigure"][::core::mem::offset_of!(_XEvent, xconfigure) - 0usize]; - ["Offset of field: _XEvent::xgravity"][::core::mem::offset_of!(_XEvent, xgravity) - 0usize]; - ["Offset of field: _XEvent::xresizerequest"] - [::core::mem::offset_of!(_XEvent, xresizerequest) - 0usize]; - ["Offset of field: _XEvent::xconfigurerequest"] - [::core::mem::offset_of!(_XEvent, xconfigurerequest) - 0usize]; - ["Offset of field: _XEvent::xcirculate"][::core::mem::offset_of!(_XEvent, xcirculate) - 0usize]; - ["Offset of field: _XEvent::xcirculaterequest"] - [::core::mem::offset_of!(_XEvent, xcirculaterequest) - 0usize]; - ["Offset of field: _XEvent::xproperty"][::core::mem::offset_of!(_XEvent, xproperty) - 0usize]; - ["Offset of field: _XEvent::xselectionclear"] - [::core::mem::offset_of!(_XEvent, xselectionclear) - 0usize]; - ["Offset of field: _XEvent::xselectionrequest"] - [::core::mem::offset_of!(_XEvent, xselectionrequest) - 0usize]; - ["Offset of field: _XEvent::xselection"][::core::mem::offset_of!(_XEvent, xselection) - 0usize]; - ["Offset of field: _XEvent::xcolormap"][::core::mem::offset_of!(_XEvent, xcolormap) - 0usize]; - ["Offset of field: _XEvent::xclient"][::core::mem::offset_of!(_XEvent, xclient) - 0usize]; - ["Offset of field: _XEvent::xmapping"][::core::mem::offset_of!(_XEvent, xmapping) - 0usize]; - ["Offset of field: _XEvent::xerror"][::core::mem::offset_of!(_XEvent, xerror) - 0usize]; - ["Offset of field: _XEvent::xkeymap"][::core::mem::offset_of!(_XEvent, xkeymap) - 0usize]; - ["Offset of field: _XEvent::xgeneric"][::core::mem::offset_of!(_XEvent, xgeneric) - 0usize]; - ["Offset of field: _XEvent::xcookie"][::core::mem::offset_of!(_XEvent, xcookie) - 0usize]; - ["Offset of field: _XEvent::pad"][::core::mem::offset_of!(_XEvent, pad) - 0usize]; -}; -pub type XEvent = _XEvent; #[repr(u32)] #[doc = " These are the various supported windowing subsystems"] #[derive(Copy, Clone, Hash, PartialEq, Eq)] @@ -10319,38 +9050,21 @@ pub struct SDL_SysWMmsg { #[repr(C)] #[derive(Copy, Clone)] pub union SDL_SysWMmsg__bindgen_ty_1 { - pub x11: SDL_SysWMmsg__bindgen_ty_1__bindgen_ty_1, pub dummy: libc::c_int, } -#[repr(C)] -#[derive(Copy, Clone)] -pub struct SDL_SysWMmsg__bindgen_ty_1__bindgen_ty_1 { - pub event: XEvent, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of SDL_SysWMmsg__bindgen_ty_1__bindgen_ty_1"] - [::core::mem::size_of::() - 192usize]; - ["Alignment of SDL_SysWMmsg__bindgen_ty_1__bindgen_ty_1"] - [::core::mem::align_of::() - 8usize]; - ["Offset of field: SDL_SysWMmsg__bindgen_ty_1__bindgen_ty_1::event"] - [::core::mem::offset_of!(SDL_SysWMmsg__bindgen_ty_1__bindgen_ty_1, event) - 0usize]; -}; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of SDL_SysWMmsg__bindgen_ty_1"] - [::core::mem::size_of::() - 192usize]; + [::core::mem::size_of::() - 4usize]; ["Alignment of SDL_SysWMmsg__bindgen_ty_1"] - [::core::mem::align_of::() - 8usize]; - ["Offset of field: SDL_SysWMmsg__bindgen_ty_1::x11"] - [::core::mem::offset_of!(SDL_SysWMmsg__bindgen_ty_1, x11) - 0usize]; + [::core::mem::align_of::() - 4usize]; ["Offset of field: SDL_SysWMmsg__bindgen_ty_1::dummy"] [::core::mem::offset_of!(SDL_SysWMmsg__bindgen_ty_1, dummy) - 0usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { - ["Size of SDL_SysWMmsg"][::core::mem::size_of::() - 200usize]; - ["Alignment of SDL_SysWMmsg"][::core::mem::align_of::() - 8usize]; + ["Size of SDL_SysWMmsg"][::core::mem::size_of::() - 12usize]; + ["Alignment of SDL_SysWMmsg"][::core::mem::align_of::() - 4usize]; ["Offset of field: SDL_SysWMmsg::version"] [::core::mem::offset_of!(SDL_SysWMmsg, version) - 0usize]; ["Offset of field: SDL_SysWMmsg::subsystem"] @@ -10368,95 +9082,21 @@ pub struct SDL_SysWMinfo { #[repr(C)] #[derive(Copy, Clone)] pub union SDL_SysWMinfo__bindgen_ty_1 { - pub x11: SDL_SysWMinfo__bindgen_ty_1__bindgen_ty_1, - pub wl: SDL_SysWMinfo__bindgen_ty_1__bindgen_ty_2, pub dummy: [Uint8; 64usize], } -#[repr(C)] -#[derive(Copy, Clone)] -pub struct SDL_SysWMinfo__bindgen_ty_1__bindgen_ty_1 { - #[doc = "< The X11 display"] - pub display: *mut Display, - #[doc = "< The X11 window"] - pub window: Window, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of SDL_SysWMinfo__bindgen_ty_1__bindgen_ty_1"] - [::core::mem::size_of::() - 16usize]; - ["Alignment of SDL_SysWMinfo__bindgen_ty_1__bindgen_ty_1"] - [::core::mem::align_of::() - 8usize]; - ["Offset of field: SDL_SysWMinfo__bindgen_ty_1__bindgen_ty_1::display"] - [::core::mem::offset_of!(SDL_SysWMinfo__bindgen_ty_1__bindgen_ty_1, display) - 0usize]; - ["Offset of field: SDL_SysWMinfo__bindgen_ty_1__bindgen_ty_1::window"] - [::core::mem::offset_of!(SDL_SysWMinfo__bindgen_ty_1__bindgen_ty_1, window) - 8usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct SDL_SysWMinfo__bindgen_ty_1__bindgen_ty_2 { - #[doc = "< Wayland display"] - pub display: *mut wl_display, - #[doc = "< Wayland surface"] - pub surface: *mut wl_surface, - #[doc = "< DEPRECATED Wayland shell_surface (window manager handle)"] - pub shell_surface: *mut libc::c_void, - #[doc = "< Wayland EGL window (native window)"] - pub egl_window: *mut wl_egl_window, - #[doc = "< Wayland xdg surface (window manager handle)"] - pub xdg_surface: *mut xdg_surface, - #[doc = "< Wayland xdg toplevel role"] - pub xdg_toplevel: *mut xdg_toplevel, - #[doc = "< Wayland xdg popup role"] - pub xdg_popup: *mut xdg_popup, - #[doc = "< Wayland xdg positioner, for popup"] - pub xdg_positioner: *mut xdg_positioner, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of SDL_SysWMinfo__bindgen_ty_1__bindgen_ty_2"] - [::core::mem::size_of::() - 64usize]; - ["Alignment of SDL_SysWMinfo__bindgen_ty_1__bindgen_ty_2"] - [::core::mem::align_of::() - 8usize]; - ["Offset of field: SDL_SysWMinfo__bindgen_ty_1__bindgen_ty_2::display"] - [::core::mem::offset_of!(SDL_SysWMinfo__bindgen_ty_1__bindgen_ty_2, display) - 0usize]; - ["Offset of field: SDL_SysWMinfo__bindgen_ty_1__bindgen_ty_2::surface"] - [::core::mem::offset_of!(SDL_SysWMinfo__bindgen_ty_1__bindgen_ty_2, surface) - 8usize]; - ["Offset of field: SDL_SysWMinfo__bindgen_ty_1__bindgen_ty_2::shell_surface"][::core::mem::offset_of!( - SDL_SysWMinfo__bindgen_ty_1__bindgen_ty_2, - shell_surface - ) - 16usize]; - ["Offset of field: SDL_SysWMinfo__bindgen_ty_1__bindgen_ty_2::egl_window"] - [::core::mem::offset_of!(SDL_SysWMinfo__bindgen_ty_1__bindgen_ty_2, egl_window) - 24usize]; - ["Offset of field: SDL_SysWMinfo__bindgen_ty_1__bindgen_ty_2::xdg_surface"] - [::core::mem::offset_of!(SDL_SysWMinfo__bindgen_ty_1__bindgen_ty_2, xdg_surface) - 32usize]; - ["Offset of field: SDL_SysWMinfo__bindgen_ty_1__bindgen_ty_2::xdg_toplevel"][::core::mem::offset_of!( - SDL_SysWMinfo__bindgen_ty_1__bindgen_ty_2, - xdg_toplevel - ) - 40usize]; - ["Offset of field: SDL_SysWMinfo__bindgen_ty_1__bindgen_ty_2::xdg_popup"] - [::core::mem::offset_of!(SDL_SysWMinfo__bindgen_ty_1__bindgen_ty_2, xdg_popup) - 48usize]; - ["Offset of field: SDL_SysWMinfo__bindgen_ty_1__bindgen_ty_2::xdg_positioner"][::core::mem::offset_of!( - SDL_SysWMinfo__bindgen_ty_1__bindgen_ty_2, - xdg_positioner - ) - 56usize]; -}; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of SDL_SysWMinfo__bindgen_ty_1"] [::core::mem::size_of::() - 64usize]; ["Alignment of SDL_SysWMinfo__bindgen_ty_1"] - [::core::mem::align_of::() - 8usize]; - ["Offset of field: SDL_SysWMinfo__bindgen_ty_1::x11"] - [::core::mem::offset_of!(SDL_SysWMinfo__bindgen_ty_1, x11) - 0usize]; - ["Offset of field: SDL_SysWMinfo__bindgen_ty_1::wl"] - [::core::mem::offset_of!(SDL_SysWMinfo__bindgen_ty_1, wl) - 0usize]; + [::core::mem::align_of::() - 1usize]; ["Offset of field: SDL_SysWMinfo__bindgen_ty_1::dummy"] [::core::mem::offset_of!(SDL_SysWMinfo__bindgen_ty_1, dummy) - 0usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of SDL_SysWMinfo"][::core::mem::size_of::() - 72usize]; - ["Alignment of SDL_SysWMinfo"][::core::mem::align_of::() - 8usize]; + ["Alignment of SDL_SysWMinfo"][::core::mem::align_of::() - 4usize]; ["Offset of field: SDL_SysWMinfo::version"] [::core::mem::offset_of!(SDL_SysWMinfo, version) - 0usize]; ["Offset of field: SDL_SysWMinfo::subsystem"] @@ -10531,45 +9171,3 @@ const _: () = { ["Offset of field: __va_list_tag::reg_save_area"] [::core::mem::offset_of!(__va_list_tag, reg_save_area) - 16usize]; }; -#[doc = "< Wayland display"] -#[repr(C)] -#[derive(Copy, Clone)] -pub struct wl_display { - pub _address: u8, -} -#[doc = "< Wayland surface"] -#[repr(C)] -#[derive(Copy, Clone)] -pub struct wl_surface { - pub _address: u8, -} -#[doc = "< Wayland EGL window (native window)"] -#[repr(C)] -#[derive(Copy, Clone)] -pub struct wl_egl_window { - pub _address: u8, -} -#[doc = "< Wayland xdg surface (window manager handle)"] -#[repr(C)] -#[derive(Copy, Clone)] -pub struct xdg_surface { - pub _address: u8, -} -#[doc = "< Wayland xdg toplevel role"] -#[repr(C)] -#[derive(Copy, Clone)] -pub struct xdg_toplevel { - pub _address: u8, -} -#[doc = "< Wayland xdg popup role"] -#[repr(C)] -#[derive(Copy, Clone)] -pub struct xdg_popup { - pub _address: u8, -} -#[doc = "< Wayland xdg positioner, for popup"] -#[repr(C)] -#[derive(Copy, Clone)] -pub struct xdg_positioner { - pub _address: u8, -} diff --git a/sdl2-sys/sdl_gfx_framerate_bindings.rs b/sdl2-sys/sdl_gfx_framerate_bindings.rs index e1d54a1274..fcac7e10ff 100644 --- a/sdl2-sys/sdl_gfx_framerate_bindings.rs +++ b/sdl2-sys/sdl_gfx_framerate_bindings.rs @@ -1,10 +1,11 @@ -/* automatically generated by rust-bindgen */ +/* automatically generated by rust-bindgen 0.72.1 */ + +#[allow(unused)] +use crate::*; pub const FPS_UPPER_LIMIT: u32 = 200; pub const FPS_LOWER_LIMIT: u32 = 1; pub const FPS_DEFAULT: u32 = 30; -pub type __uint32_t = libc::c_uint; -pub type Uint32 = u32; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct FPSmanager { @@ -14,81 +15,32 @@ pub struct FPSmanager { pub lastticks: Uint32, pub rate: Uint32, } -#[test] -fn bindgen_test_layout_FPSmanager() { - assert_eq!( - ::core::mem::size_of::(), - 20usize, - concat!("Size of: ", stringify!(FPSmanager)) - ); - assert_eq!( - ::core::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(FPSmanager)) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::())).framecount as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(FPSmanager), - "::", - stringify!(framecount) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::())).rateticks as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(FPSmanager), - "::", - stringify!(rateticks) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::())).baseticks as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(FPSmanager), - "::", - stringify!(baseticks) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::())).lastticks as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(FPSmanager), - "::", - stringify!(lastticks) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::())).rate as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(FPSmanager), - "::", - stringify!(rate) - ) - ); -} -extern "C" { +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of FPSmanager"][::core::mem::size_of::() - 20usize]; + ["Alignment of FPSmanager"][::core::mem::align_of::() - 4usize]; + ["Offset of field: FPSmanager::framecount"] + [::core::mem::offset_of!(FPSmanager, framecount) - 0usize]; + ["Offset of field: FPSmanager::rateticks"] + [::core::mem::offset_of!(FPSmanager, rateticks) - 4usize]; + ["Offset of field: FPSmanager::baseticks"] + [::core::mem::offset_of!(FPSmanager, baseticks) - 8usize]; + ["Offset of field: FPSmanager::lastticks"] + [::core::mem::offset_of!(FPSmanager, lastticks) - 12usize]; + ["Offset of field: FPSmanager::rate"][::core::mem::offset_of!(FPSmanager, rate) - 16usize]; +}; +unsafe extern "C" { pub fn SDL_initFramerate(manager: *mut FPSmanager); } -extern "C" { +unsafe extern "C" { pub fn SDL_setFramerate(manager: *mut FPSmanager, rate: Uint32) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn SDL_getFramerate(manager: *mut FPSmanager) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn SDL_getFramecount(manager: *mut FPSmanager) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn SDL_framerateDelay(manager: *mut FPSmanager) -> Uint32; } diff --git a/sdl2-sys/sdl_gfx_imagefilter_bindings.rs b/sdl2-sys/sdl_gfx_imagefilter_bindings.rs index ca5d68c5de..742db62c6f 100644 --- a/sdl2-sys/sdl_gfx_imagefilter_bindings.rs +++ b/sdl2-sys/sdl_gfx_imagefilter_bindings.rs @@ -1,15 +1,18 @@ -/* automatically generated by rust-bindgen */ +/* automatically generated by rust-bindgen 0.72.1 */ -extern "C" { +#[allow(unused)] +use crate::*; + +unsafe extern "C" { pub fn SDL_imageFilterMMXdetect() -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn SDL_imageFilterMMXoff(); } -extern "C" { +unsafe extern "C" { pub fn SDL_imageFilterMMXon(); } -extern "C" { +unsafe extern "C" { pub fn SDL_imageFilterAdd( Src1: *mut libc::c_uchar, Src2: *mut libc::c_uchar, @@ -17,7 +20,7 @@ extern "C" { length: libc::c_uint, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn SDL_imageFilterMean( Src1: *mut libc::c_uchar, Src2: *mut libc::c_uchar, @@ -25,7 +28,7 @@ extern "C" { length: libc::c_uint, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn SDL_imageFilterSub( Src1: *mut libc::c_uchar, Src2: *mut libc::c_uchar, @@ -33,7 +36,7 @@ extern "C" { length: libc::c_uint, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn SDL_imageFilterAbsDiff( Src1: *mut libc::c_uchar, Src2: *mut libc::c_uchar, @@ -41,7 +44,7 @@ extern "C" { length: libc::c_uint, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn SDL_imageFilterMult( Src1: *mut libc::c_uchar, Src2: *mut libc::c_uchar, @@ -49,7 +52,7 @@ extern "C" { length: libc::c_uint, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn SDL_imageFilterMultNor( Src1: *mut libc::c_uchar, Src2: *mut libc::c_uchar, @@ -57,7 +60,7 @@ extern "C" { length: libc::c_uint, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn SDL_imageFilterMultDivby2( Src1: *mut libc::c_uchar, Src2: *mut libc::c_uchar, @@ -65,7 +68,7 @@ extern "C" { length: libc::c_uint, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn SDL_imageFilterMultDivby4( Src1: *mut libc::c_uchar, Src2: *mut libc::c_uchar, @@ -73,7 +76,7 @@ extern "C" { length: libc::c_uint, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn SDL_imageFilterBitAnd( Src1: *mut libc::c_uchar, Src2: *mut libc::c_uchar, @@ -81,7 +84,7 @@ extern "C" { length: libc::c_uint, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn SDL_imageFilterBitOr( Src1: *mut libc::c_uchar, Src2: *mut libc::c_uchar, @@ -89,7 +92,7 @@ extern "C" { length: libc::c_uint, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn SDL_imageFilterDiv( Src1: *mut libc::c_uchar, Src2: *mut libc::c_uchar, @@ -97,14 +100,14 @@ extern "C" { length: libc::c_uint, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn SDL_imageFilterBitNegation( Src1: *mut libc::c_uchar, Dest: *mut libc::c_uchar, length: libc::c_uint, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn SDL_imageFilterAddByte( Src1: *mut libc::c_uchar, Dest: *mut libc::c_uchar, @@ -112,7 +115,7 @@ extern "C" { C: libc::c_uchar, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn SDL_imageFilterAddUint( Src1: *mut libc::c_uchar, Dest: *mut libc::c_uchar, @@ -120,7 +123,7 @@ extern "C" { C: libc::c_uint, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn SDL_imageFilterAddByteToHalf( Src1: *mut libc::c_uchar, Dest: *mut libc::c_uchar, @@ -128,7 +131,7 @@ extern "C" { C: libc::c_uchar, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn SDL_imageFilterSubByte( Src1: *mut libc::c_uchar, Dest: *mut libc::c_uchar, @@ -136,7 +139,7 @@ extern "C" { C: libc::c_uchar, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn SDL_imageFilterSubUint( Src1: *mut libc::c_uchar, Dest: *mut libc::c_uchar, @@ -144,7 +147,7 @@ extern "C" { C: libc::c_uint, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn SDL_imageFilterShiftRight( Src1: *mut libc::c_uchar, Dest: *mut libc::c_uchar, @@ -152,7 +155,7 @@ extern "C" { N: libc::c_uchar, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn SDL_imageFilterShiftRightUint( Src1: *mut libc::c_uchar, Dest: *mut libc::c_uchar, @@ -160,7 +163,7 @@ extern "C" { N: libc::c_uchar, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn SDL_imageFilterMultByByte( Src1: *mut libc::c_uchar, Dest: *mut libc::c_uchar, @@ -168,7 +171,7 @@ extern "C" { C: libc::c_uchar, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn SDL_imageFilterShiftRightAndMultByByte( Src1: *mut libc::c_uchar, Dest: *mut libc::c_uchar, @@ -177,7 +180,7 @@ extern "C" { C: libc::c_uchar, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn SDL_imageFilterShiftLeftByte( Src1: *mut libc::c_uchar, Dest: *mut libc::c_uchar, @@ -185,7 +188,7 @@ extern "C" { N: libc::c_uchar, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn SDL_imageFilterShiftLeftUint( Src1: *mut libc::c_uchar, Dest: *mut libc::c_uchar, @@ -193,7 +196,7 @@ extern "C" { N: libc::c_uchar, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn SDL_imageFilterShiftLeft( Src1: *mut libc::c_uchar, Dest: *mut libc::c_uchar, @@ -201,7 +204,7 @@ extern "C" { N: libc::c_uchar, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn SDL_imageFilterBinarizeUsingThreshold( Src1: *mut libc::c_uchar, Dest: *mut libc::c_uchar, @@ -209,7 +212,7 @@ extern "C" { T: libc::c_uchar, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn SDL_imageFilterClipToRange( Src1: *mut libc::c_uchar, Dest: *mut libc::c_uchar, @@ -218,7 +221,7 @@ extern "C" { Tmax: libc::c_uchar, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn SDL_imageFilterNormalizeLinear( Src: *mut libc::c_uchar, Dest: *mut libc::c_uchar, diff --git a/sdl2-sys/sdl_gfx_primitives_bindings.rs b/sdl2-sys/sdl_gfx_primitives_bindings.rs index 4df10c1ce4..c0f898c384 100644 --- a/sdl2-sys/sdl_gfx_primitives_bindings.rs +++ b/sdl2-sys/sdl_gfx_primitives_bindings.rs @@ -1,14 +1,9 @@ -/* automatically generated by rust-bindgen */ +/* automatically generated by rust-bindgen 0.72.1 */ +#[allow(unused)] use crate::*; -pub type __uint8_t = libc::c_uchar; -pub type __int16_t = libc::c_short; -pub type __uint32_t = libc::c_uint; -pub type Uint8 = u8; -pub type Sint16 = i16; -pub type Uint32 = u32; -extern "C" { +unsafe extern "C" { pub fn pixelColor( renderer: *mut SDL_Renderer, x: Sint16, @@ -16,7 +11,7 @@ extern "C" { color: Uint32, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn pixelRGBA( renderer: *mut SDL_Renderer, x: Sint16, @@ -27,7 +22,7 @@ extern "C" { a: Uint8, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn hlineColor( renderer: *mut SDL_Renderer, x1: Sint16, @@ -36,7 +31,7 @@ extern "C" { color: Uint32, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn hlineRGBA( renderer: *mut SDL_Renderer, x1: Sint16, @@ -48,7 +43,7 @@ extern "C" { a: Uint8, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn vlineColor( renderer: *mut SDL_Renderer, x: Sint16, @@ -57,7 +52,7 @@ extern "C" { color: Uint32, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn vlineRGBA( renderer: *mut SDL_Renderer, x: Sint16, @@ -69,7 +64,7 @@ extern "C" { a: Uint8, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn rectangleColor( renderer: *mut SDL_Renderer, x1: Sint16, @@ -79,7 +74,7 @@ extern "C" { color: Uint32, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn rectangleRGBA( renderer: *mut SDL_Renderer, x1: Sint16, @@ -92,7 +87,7 @@ extern "C" { a: Uint8, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn roundedRectangleColor( renderer: *mut SDL_Renderer, x1: Sint16, @@ -103,7 +98,7 @@ extern "C" { color: Uint32, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn roundedRectangleRGBA( renderer: *mut SDL_Renderer, x1: Sint16, @@ -117,7 +112,7 @@ extern "C" { a: Uint8, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn boxColor( renderer: *mut SDL_Renderer, x1: Sint16, @@ -127,7 +122,7 @@ extern "C" { color: Uint32, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn boxRGBA( renderer: *mut SDL_Renderer, x1: Sint16, @@ -140,7 +135,7 @@ extern "C" { a: Uint8, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn roundedBoxColor( renderer: *mut SDL_Renderer, x1: Sint16, @@ -151,7 +146,7 @@ extern "C" { color: Uint32, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn roundedBoxRGBA( renderer: *mut SDL_Renderer, x1: Sint16, @@ -165,7 +160,7 @@ extern "C" { a: Uint8, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn lineColor( renderer: *mut SDL_Renderer, x1: Sint16, @@ -175,7 +170,7 @@ extern "C" { color: Uint32, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn lineRGBA( renderer: *mut SDL_Renderer, x1: Sint16, @@ -188,7 +183,7 @@ extern "C" { a: Uint8, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn aalineColor( renderer: *mut SDL_Renderer, x1: Sint16, @@ -198,7 +193,7 @@ extern "C" { color: Uint32, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn aalineRGBA( renderer: *mut SDL_Renderer, x1: Sint16, @@ -211,7 +206,7 @@ extern "C" { a: Uint8, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn thickLineColor( renderer: *mut SDL_Renderer, x1: Sint16, @@ -222,7 +217,7 @@ extern "C" { color: Uint32, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn thickLineRGBA( renderer: *mut SDL_Renderer, x1: Sint16, @@ -236,7 +231,7 @@ extern "C" { a: Uint8, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn circleColor( renderer: *mut SDL_Renderer, x: Sint16, @@ -245,7 +240,7 @@ extern "C" { color: Uint32, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn circleRGBA( renderer: *mut SDL_Renderer, x: Sint16, @@ -257,7 +252,7 @@ extern "C" { a: Uint8, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn arcColor( renderer: *mut SDL_Renderer, x: Sint16, @@ -268,7 +263,7 @@ extern "C" { color: Uint32, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn arcRGBA( renderer: *mut SDL_Renderer, x: Sint16, @@ -282,7 +277,7 @@ extern "C" { a: Uint8, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn aacircleColor( renderer: *mut SDL_Renderer, x: Sint16, @@ -291,7 +286,7 @@ extern "C" { color: Uint32, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn aacircleRGBA( renderer: *mut SDL_Renderer, x: Sint16, @@ -303,7 +298,7 @@ extern "C" { a: Uint8, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn filledCircleColor( renderer: *mut SDL_Renderer, x: Sint16, @@ -312,7 +307,7 @@ extern "C" { color: Uint32, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn filledCircleRGBA( renderer: *mut SDL_Renderer, x: Sint16, @@ -324,7 +319,7 @@ extern "C" { a: Uint8, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn ellipseColor( renderer: *mut SDL_Renderer, x: Sint16, @@ -334,7 +329,7 @@ extern "C" { color: Uint32, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn ellipseRGBA( renderer: *mut SDL_Renderer, x: Sint16, @@ -347,7 +342,7 @@ extern "C" { a: Uint8, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn aaellipseColor( renderer: *mut SDL_Renderer, x: Sint16, @@ -357,7 +352,7 @@ extern "C" { color: Uint32, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn aaellipseRGBA( renderer: *mut SDL_Renderer, x: Sint16, @@ -370,7 +365,7 @@ extern "C" { a: Uint8, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn filledEllipseColor( renderer: *mut SDL_Renderer, x: Sint16, @@ -380,7 +375,7 @@ extern "C" { color: Uint32, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn filledEllipseRGBA( renderer: *mut SDL_Renderer, x: Sint16, @@ -393,7 +388,7 @@ extern "C" { a: Uint8, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn pieColor( renderer: *mut SDL_Renderer, x: Sint16, @@ -404,7 +399,7 @@ extern "C" { color: Uint32, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn pieRGBA( renderer: *mut SDL_Renderer, x: Sint16, @@ -418,7 +413,7 @@ extern "C" { a: Uint8, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn filledPieColor( renderer: *mut SDL_Renderer, x: Sint16, @@ -429,7 +424,7 @@ extern "C" { color: Uint32, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn filledPieRGBA( renderer: *mut SDL_Renderer, x: Sint16, @@ -443,7 +438,7 @@ extern "C" { a: Uint8, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn trigonColor( renderer: *mut SDL_Renderer, x1: Sint16, @@ -455,7 +450,7 @@ extern "C" { color: Uint32, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn trigonRGBA( renderer: *mut SDL_Renderer, x1: Sint16, @@ -470,7 +465,7 @@ extern "C" { a: Uint8, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn aatrigonColor( renderer: *mut SDL_Renderer, x1: Sint16, @@ -482,7 +477,7 @@ extern "C" { color: Uint32, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn aatrigonRGBA( renderer: *mut SDL_Renderer, x1: Sint16, @@ -497,7 +492,7 @@ extern "C" { a: Uint8, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn filledTrigonColor( renderer: *mut SDL_Renderer, x1: Sint16, @@ -509,7 +504,7 @@ extern "C" { color: Uint32, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn filledTrigonRGBA( renderer: *mut SDL_Renderer, x1: Sint16, @@ -524,7 +519,7 @@ extern "C" { a: Uint8, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn polygonColor( renderer: *mut SDL_Renderer, vx: *const Sint16, @@ -533,7 +528,7 @@ extern "C" { color: Uint32, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn polygonRGBA( renderer: *mut SDL_Renderer, vx: *const Sint16, @@ -545,7 +540,7 @@ extern "C" { a: Uint8, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn aapolygonColor( renderer: *mut SDL_Renderer, vx: *const Sint16, @@ -554,7 +549,7 @@ extern "C" { color: Uint32, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn aapolygonRGBA( renderer: *mut SDL_Renderer, vx: *const Sint16, @@ -566,7 +561,7 @@ extern "C" { a: Uint8, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn filledPolygonColor( renderer: *mut SDL_Renderer, vx: *const Sint16, @@ -575,7 +570,7 @@ extern "C" { color: Uint32, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn filledPolygonRGBA( renderer: *mut SDL_Renderer, vx: *const Sint16, @@ -587,7 +582,7 @@ extern "C" { a: Uint8, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn texturedPolygon( renderer: *mut SDL_Renderer, vx: *const Sint16, @@ -598,7 +593,7 @@ extern "C" { texture_dy: libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn bezierColor( renderer: *mut SDL_Renderer, vx: *const Sint16, @@ -608,7 +603,7 @@ extern "C" { color: Uint32, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn bezierRGBA( renderer: *mut SDL_Renderer, vx: *const Sint16, @@ -621,13 +616,13 @@ extern "C" { a: Uint8, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn gfxPrimitivesSetFont(fontdata: *const libc::c_void, cw: Uint32, ch: Uint32); } -extern "C" { +unsafe extern "C" { pub fn gfxPrimitivesSetFontRotation(rotation: Uint32); } -extern "C" { +unsafe extern "C" { pub fn characterColor( renderer: *mut SDL_Renderer, x: Sint16, @@ -636,7 +631,7 @@ extern "C" { color: Uint32, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn characterRGBA( renderer: *mut SDL_Renderer, x: Sint16, @@ -648,7 +643,7 @@ extern "C" { a: Uint8, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn stringColor( renderer: *mut SDL_Renderer, x: Sint16, @@ -657,7 +652,7 @@ extern "C" { color: Uint32, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn stringRGBA( renderer: *mut SDL_Renderer, x: Sint16, diff --git a/sdl2-sys/sdl_gfx_rotozoom_bindings.rs b/sdl2-sys/sdl_gfx_rotozoom_bindings.rs index 370cc9109d..5abfd4b00e 100644 --- a/sdl2-sys/sdl_gfx_rotozoom_bindings.rs +++ b/sdl2-sys/sdl_gfx_rotozoom_bindings.rs @@ -1,12 +1,9 @@ -/* automatically generated by rust-bindgen */ +/* automatically generated by rust-bindgen 0.72.1 */ +#[allow(unused)] use crate::*; -pub type __uint8_t = libc::c_uchar; -pub type __uint32_t = libc::c_uint; -pub type Uint8 = u8; -pub type Uint32 = u32; -extern "C" { +unsafe extern "C" { pub fn rotozoomSurface( src: *mut SDL_Surface, angle: f64, @@ -14,7 +11,7 @@ extern "C" { smooth: libc::c_int, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn rotozoomSurfaceXY( src: *mut SDL_Surface, angle: f64, @@ -23,7 +20,7 @@ extern "C" { smooth: libc::c_int, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn rotozoomSurfaceSize( width: libc::c_int, height: libc::c_int, @@ -33,7 +30,7 @@ extern "C" { dstheight: *mut libc::c_int, ); } -extern "C" { +unsafe extern "C" { pub fn rotozoomSurfaceSizeXY( width: libc::c_int, height: libc::c_int, @@ -44,7 +41,7 @@ extern "C" { dstheight: *mut libc::c_int, ); } -extern "C" { +unsafe extern "C" { pub fn zoomSurface( src: *mut SDL_Surface, zoomx: f64, @@ -52,7 +49,7 @@ extern "C" { smooth: libc::c_int, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn zoomSurfaceSize( width: libc::c_int, height: libc::c_int, @@ -62,14 +59,14 @@ extern "C" { dstheight: *mut libc::c_int, ); } -extern "C" { +unsafe extern "C" { pub fn shrinkSurface( src: *mut SDL_Surface, factorx: libc::c_int, factory: libc::c_int, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn rotateSurface90Degrees( src: *mut SDL_Surface, numClockwiseTurns: libc::c_int, diff --git a/sdl2-sys/sdl_image_bindings.rs b/sdl2-sys/sdl_image_bindings.rs index 8fa66d3baa..bbe771c43f 100644 --- a/sdl2-sys/sdl_image_bindings.rs +++ b/sdl2-sys/sdl_image_bindings.rs @@ -1,56 +1,51 @@ -/* automatically generated by rust-bindgen */ +/* automatically generated by rust-bindgen 0.72.1 */ +#[allow(unused)] use crate::*; -pub type __uint8_t = libc::c_uchar; -pub type __uint32_t = libc::c_uint; -pub type __int64_t = libc::c_long; -pub type __off_t = libc::c_long; -pub type __off64_t = libc::c_long; -pub type Uint8 = u8; -pub type Uint32 = u32; -pub type Sint64 = i64; -extern "C" { +unsafe extern "C" { pub fn IMG_Linked_Version() -> *const SDL_version; } pub const IMG_InitFlags_IMG_INIT_JPG: IMG_InitFlags = 1; pub const IMG_InitFlags_IMG_INIT_PNG: IMG_InitFlags = 2; pub const IMG_InitFlags_IMG_INIT_TIF: IMG_InitFlags = 4; pub const IMG_InitFlags_IMG_INIT_WEBP: IMG_InitFlags = 8; -pub type IMG_InitFlags = u32; -extern "C" { +pub const IMG_InitFlags_IMG_INIT_JXL: IMG_InitFlags = 16; +pub const IMG_InitFlags_IMG_INIT_AVIF: IMG_InitFlags = 32; +pub type IMG_InitFlags = libc::c_uint; +unsafe extern "C" { pub fn IMG_Init(flags: libc::c_int) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn IMG_Quit(); } -extern "C" { +unsafe extern "C" { pub fn IMG_LoadTyped_RW( src: *mut SDL_RWops, freesrc: libc::c_int, type_: *const libc::c_char, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn IMG_Load(file: *const libc::c_char) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn IMG_Load_RW(src: *mut SDL_RWops, freesrc: libc::c_int) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn IMG_LoadTexture( renderer: *mut SDL_Renderer, file: *const libc::c_char, ) -> *mut SDL_Texture; } -extern "C" { +unsafe extern "C" { pub fn IMG_LoadTexture_RW( renderer: *mut SDL_Renderer, src: *mut SDL_RWops, freesrc: libc::c_int, ) -> *mut SDL_Texture; } -extern "C" { +unsafe extern "C" { pub fn IMG_LoadTextureTyped_RW( renderer: *mut SDL_Renderer, src: *mut SDL_RWops, @@ -58,120 +53,148 @@ extern "C" { type_: *const libc::c_char, ) -> *mut SDL_Texture; } -extern "C" { +unsafe extern "C" { + pub fn IMG_isAVIF(src: *mut SDL_RWops) -> libc::c_int; +} +unsafe extern "C" { pub fn IMG_isICO(src: *mut SDL_RWops) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn IMG_isCUR(src: *mut SDL_RWops) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn IMG_isBMP(src: *mut SDL_RWops) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn IMG_isGIF(src: *mut SDL_RWops) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn IMG_isJPG(src: *mut SDL_RWops) -> libc::c_int; } -extern "C" { +unsafe extern "C" { + pub fn IMG_isJXL(src: *mut SDL_RWops) -> libc::c_int; +} +unsafe extern "C" { pub fn IMG_isLBM(src: *mut SDL_RWops) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn IMG_isPCX(src: *mut SDL_RWops) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn IMG_isPNG(src: *mut SDL_RWops) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn IMG_isPNM(src: *mut SDL_RWops) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn IMG_isSVG(src: *mut SDL_RWops) -> libc::c_int; } -extern "C" { +unsafe extern "C" { + pub fn IMG_isQOI(src: *mut SDL_RWops) -> libc::c_int; +} +unsafe extern "C" { pub fn IMG_isTIF(src: *mut SDL_RWops) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn IMG_isXCF(src: *mut SDL_RWops) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn IMG_isXPM(src: *mut SDL_RWops) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn IMG_isXV(src: *mut SDL_RWops) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn IMG_isWEBP(src: *mut SDL_RWops) -> libc::c_int; } -extern "C" { +unsafe extern "C" { + pub fn IMG_LoadAVIF_RW(src: *mut SDL_RWops) -> *mut SDL_Surface; +} +unsafe extern "C" { pub fn IMG_LoadICO_RW(src: *mut SDL_RWops) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn IMG_LoadCUR_RW(src: *mut SDL_RWops) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn IMG_LoadBMP_RW(src: *mut SDL_RWops) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn IMG_LoadGIF_RW(src: *mut SDL_RWops) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn IMG_LoadJPG_RW(src: *mut SDL_RWops) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { + pub fn IMG_LoadJXL_RW(src: *mut SDL_RWops) -> *mut SDL_Surface; +} +unsafe extern "C" { pub fn IMG_LoadLBM_RW(src: *mut SDL_RWops) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn IMG_LoadPCX_RW(src: *mut SDL_RWops) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn IMG_LoadPNG_RW(src: *mut SDL_RWops) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn IMG_LoadPNM_RW(src: *mut SDL_RWops) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn IMG_LoadSVG_RW(src: *mut SDL_RWops) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { + pub fn IMG_LoadQOI_RW(src: *mut SDL_RWops) -> *mut SDL_Surface; +} +unsafe extern "C" { pub fn IMG_LoadTGA_RW(src: *mut SDL_RWops) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn IMG_LoadTIF_RW(src: *mut SDL_RWops) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn IMG_LoadXCF_RW(src: *mut SDL_RWops) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn IMG_LoadXPM_RW(src: *mut SDL_RWops) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn IMG_LoadXV_RW(src: *mut SDL_RWops) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn IMG_LoadWEBP_RW(src: *mut SDL_RWops) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { + pub fn IMG_LoadSizedSVG_RW( + src: *mut SDL_RWops, + width: libc::c_int, + height: libc::c_int, + ) -> *mut SDL_Surface; +} +unsafe extern "C" { pub fn IMG_ReadXPMFromArray(xpm: *mut *mut libc::c_char) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { + pub fn IMG_ReadXPMFromArrayToRGB888(xpm: *mut *mut libc::c_char) -> *mut SDL_Surface; +} +unsafe extern "C" { pub fn IMG_SavePNG(surface: *mut SDL_Surface, file: *const libc::c_char) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn IMG_SavePNG_RW( surface: *mut SDL_Surface, dst: *mut SDL_RWops, freedst: libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn IMG_SaveJPG( surface: *mut SDL_Surface, file: *const libc::c_char, quality: libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn IMG_SaveJPG_RW( surface: *mut SDL_Surface, dst: *mut SDL_RWops, @@ -179,3 +202,47 @@ extern "C" { quality: libc::c_int, ) -> libc::c_int; } +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct IMG_Animation { + pub w: libc::c_int, + pub h: libc::c_int, + pub count: libc::c_int, + pub frames: *mut *mut SDL_Surface, + pub delays: *mut libc::c_int, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of IMG_Animation"][::core::mem::size_of::() - 32usize]; + ["Alignment of IMG_Animation"][::core::mem::align_of::() - 8usize]; + ["Offset of field: IMG_Animation::w"][::core::mem::offset_of!(IMG_Animation, w) - 0usize]; + ["Offset of field: IMG_Animation::h"][::core::mem::offset_of!(IMG_Animation, h) - 4usize]; + ["Offset of field: IMG_Animation::count"] + [::core::mem::offset_of!(IMG_Animation, count) - 8usize]; + ["Offset of field: IMG_Animation::frames"] + [::core::mem::offset_of!(IMG_Animation, frames) - 16usize]; + ["Offset of field: IMG_Animation::delays"] + [::core::mem::offset_of!(IMG_Animation, delays) - 24usize]; +}; +unsafe extern "C" { + pub fn IMG_LoadAnimation(file: *const libc::c_char) -> *mut IMG_Animation; +} +unsafe extern "C" { + pub fn IMG_LoadAnimation_RW(src: *mut SDL_RWops, freesrc: libc::c_int) -> *mut IMG_Animation; +} +unsafe extern "C" { + pub fn IMG_LoadAnimationTyped_RW( + src: *mut SDL_RWops, + freesrc: libc::c_int, + type_: *const libc::c_char, + ) -> *mut IMG_Animation; +} +unsafe extern "C" { + pub fn IMG_FreeAnimation(anim: *mut IMG_Animation); +} +unsafe extern "C" { + pub fn IMG_LoadGIFAnimation_RW(src: *mut SDL_RWops) -> *mut IMG_Animation; +} +unsafe extern "C" { + pub fn IMG_LoadWEBPAnimation_RW(src: *mut SDL_RWops) -> *mut IMG_Animation; +} diff --git a/sdl2-sys/sdl_mixer_bindings.rs b/sdl2-sys/sdl_mixer_bindings.rs index 5f91ceaacb..fc5f88e935 100644 --- a/sdl2-sys/sdl_mixer_bindings.rs +++ b/sdl2-sys/sdl_mixer_bindings.rs @@ -1,30 +1,19 @@ -/* automatically generated by rust-bindgen */ +/* automatically generated by rust-bindgen 0.72.1 */ +#[allow(unused)] use crate::*; pub const MIX_MAJOR_VERSION: u32 = 2; -pub const MIX_MINOR_VERSION: u32 = 0; -pub const MIX_PATCHLEVEL: u32 = 4; +pub const MIX_MINOR_VERSION: u32 = 8; +pub const MIX_PATCHLEVEL: u32 = 1; pub const MIX_CHANNELS: u32 = 8; -pub const MIX_DEFAULT_FREQUENCY: u32 = 22050; +pub const MIX_DEFAULT_FREQUENCY: u32 = 44100; pub const MIX_DEFAULT_FORMAT: u32 = 32784; pub const MIX_DEFAULT_CHANNELS: u32 = 2; pub const MIX_MAX_VOLUME: u32 = 128; pub const MIX_CHANNEL_POST: i32 = -2; -pub const MIX_EFFECTSMAXSPEED: &'static [u8; 20usize] = b"MIX_EFFECTSMAXSPEED\0"; -pub type __uint8_t = libc::c_uchar; -pub type __int16_t = libc::c_short; -pub type __uint16_t = libc::c_ushort; -pub type __uint32_t = libc::c_uint; -pub type __int64_t = libc::c_long; -pub type __off_t = libc::c_long; -pub type __off64_t = libc::c_long; -pub type Uint8 = u8; -pub type Sint16 = i16; -pub type Uint16 = u16; -pub type Uint32 = u32; -pub type Sint64 = i64; -extern "C" { +pub const MIX_EFFECTSMAXSPEED: &[u8; 20] = b"MIX_EFFECTSMAXSPEED\0"; +unsafe extern "C" { pub fn Mix_Linked_Version() -> *const SDL_version; } pub const MIX_InitFlags_MIX_INIT_FLAC: MIX_InitFlags = 1; @@ -33,11 +22,12 @@ pub const MIX_InitFlags_MIX_INIT_MP3: MIX_InitFlags = 8; pub const MIX_InitFlags_MIX_INIT_OGG: MIX_InitFlags = 16; pub const MIX_InitFlags_MIX_INIT_MID: MIX_InitFlags = 32; pub const MIX_InitFlags_MIX_INIT_OPUS: MIX_InitFlags = 64; -pub type MIX_InitFlags = u32; -extern "C" { +pub const MIX_InitFlags_MIX_INIT_WAVPACK: MIX_InitFlags = 128; +pub type MIX_InitFlags = libc::c_uint; +unsafe extern "C" { pub fn Mix_Init(flags: libc::c_int) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_Quit(); } #[repr(C)] @@ -48,63 +38,20 @@ pub struct Mix_Chunk { pub alen: Uint32, pub volume: Uint8, } -#[test] -fn bindgen_test_layout_Mix_Chunk() { - assert_eq!( - ::core::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(Mix_Chunk)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Mix_Chunk)) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::())).allocated as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Mix_Chunk), - "::", - stringify!(allocated) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::())).abuf as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Mix_Chunk), - "::", - stringify!(abuf) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::())).alen as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(Mix_Chunk), - "::", - stringify!(alen) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::())).volume as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(Mix_Chunk), - "::", - stringify!(volume) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of Mix_Chunk"][::core::mem::size_of::() - 24usize]; + ["Alignment of Mix_Chunk"][::core::mem::align_of::() - 8usize]; + ["Offset of field: Mix_Chunk::allocated"] + [::core::mem::offset_of!(Mix_Chunk, allocated) - 0usize]; + ["Offset of field: Mix_Chunk::abuf"][::core::mem::offset_of!(Mix_Chunk, abuf) - 8usize]; + ["Offset of field: Mix_Chunk::alen"][::core::mem::offset_of!(Mix_Chunk, alen) - 16usize]; + ["Offset of field: Mix_Chunk::volume"][::core::mem::offset_of!(Mix_Chunk, volume) - 20usize]; +}; pub const Mix_Fading_MIX_NO_FADING: Mix_Fading = 0; pub const Mix_Fading_MIX_FADING_OUT: Mix_Fading = 1; pub const Mix_Fading_MIX_FADING_IN: Mix_Fading = 2; -pub type Mix_Fading = u32; +pub type Mix_Fading = libc::c_uint; pub const Mix_MusicType_MUS_NONE: Mix_MusicType = 0; pub const Mix_MusicType_MUS_CMD: Mix_MusicType = 1; pub const Mix_MusicType_MUS_WAV: Mix_MusicType = 2; @@ -116,14 +63,15 @@ pub const Mix_MusicType_MUS_MP3_MAD_UNUSED: Mix_MusicType = 7; pub const Mix_MusicType_MUS_FLAC: Mix_MusicType = 8; pub const Mix_MusicType_MUS_MODPLUG_UNUSED: Mix_MusicType = 9; pub const Mix_MusicType_MUS_OPUS: Mix_MusicType = 10; -pub type Mix_MusicType = u32; +pub const Mix_MusicType_MUS_WAVPACK: Mix_MusicType = 11; +pub const Mix_MusicType_MUS_GME: Mix_MusicType = 12; +pub type Mix_MusicType = libc::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct _Mix_Music { +pub struct Mix_Music { _unused: [u8; 0], } -pub type Mix_Music = _Mix_Music; -extern "C" { +unsafe extern "C" { pub fn Mix_OpenAudio( frequency: libc::c_int, format: Uint16, @@ -131,7 +79,7 @@ extern "C" { chunksize: libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_OpenAudioDevice( frequency: libc::c_int, format: Uint16, @@ -141,91 +89,106 @@ extern "C" { allowed_changes: libc::c_int, ) -> libc::c_int; } -extern "C" { - pub fn Mix_AllocateChannels(numchans: libc::c_int) -> libc::c_int; +unsafe extern "C" { + pub fn Mix_PauseAudio(pause_on: libc::c_int); } -extern "C" { +unsafe extern "C" { pub fn Mix_QuerySpec( frequency: *mut libc::c_int, format: *mut Uint16, channels: *mut libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { + pub fn Mix_AllocateChannels(numchans: libc::c_int) -> libc::c_int; +} +unsafe extern "C" { pub fn Mix_LoadWAV_RW(src: *mut SDL_RWops, freesrc: libc::c_int) -> *mut Mix_Chunk; } -extern "C" { +unsafe extern "C" { + pub fn Mix_LoadWAV(file: *const libc::c_char) -> *mut Mix_Chunk; +} +unsafe extern "C" { pub fn Mix_LoadMUS(file: *const libc::c_char) -> *mut Mix_Music; } -extern "C" { +unsafe extern "C" { pub fn Mix_LoadMUS_RW(src: *mut SDL_RWops, freesrc: libc::c_int) -> *mut Mix_Music; } -extern "C" { +unsafe extern "C" { pub fn Mix_LoadMUSType_RW( src: *mut SDL_RWops, type_: Mix_MusicType, freesrc: libc::c_int, ) -> *mut Mix_Music; } -extern "C" { +unsafe extern "C" { pub fn Mix_QuickLoad_WAV(mem: *mut Uint8) -> *mut Mix_Chunk; } -extern "C" { +unsafe extern "C" { pub fn Mix_QuickLoad_RAW(mem: *mut Uint8, len: Uint32) -> *mut Mix_Chunk; } -extern "C" { +unsafe extern "C" { pub fn Mix_FreeChunk(chunk: *mut Mix_Chunk); } -extern "C" { +unsafe extern "C" { pub fn Mix_FreeMusic(music: *mut Mix_Music); } -extern "C" { +unsafe extern "C" { pub fn Mix_GetNumChunkDecoders() -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_GetChunkDecoder(index: libc::c_int) -> *const libc::c_char; } -extern "C" { +unsafe extern "C" { pub fn Mix_HasChunkDecoder(name: *const libc::c_char) -> SDL_bool; } -extern "C" { +unsafe extern "C" { pub fn Mix_GetNumMusicDecoders() -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_GetMusicDecoder(index: libc::c_int) -> *const libc::c_char; } -extern "C" { +unsafe extern "C" { pub fn Mix_HasMusicDecoder(name: *const libc::c_char) -> SDL_bool; } -extern "C" { +unsafe extern "C" { pub fn Mix_GetMusicType(music: *const Mix_Music) -> Mix_MusicType; } -extern "C" { - pub fn Mix_SetPostMix( - mix_func: ::core::option::Option< - unsafe extern "C" fn(udata: *mut libc::c_void, stream: *mut Uint8, len: libc::c_int), - >, - arg: *mut libc::c_void, - ); +unsafe extern "C" { + pub fn Mix_GetMusicTitle(music: *const Mix_Music) -> *const libc::c_char; } -extern "C" { - pub fn Mix_HookMusic( - mix_func: ::core::option::Option< - unsafe extern "C" fn(udata: *mut libc::c_void, stream: *mut Uint8, len: libc::c_int), - >, - arg: *mut libc::c_void, - ); +unsafe extern "C" { + pub fn Mix_GetMusicTitleTag(music: *const Mix_Music) -> *const libc::c_char; +} +unsafe extern "C" { + pub fn Mix_GetMusicArtistTag(music: *const Mix_Music) -> *const libc::c_char; } -extern "C" { - pub fn Mix_HookMusicFinished(music_finished: ::core::option::Option); +unsafe extern "C" { + pub fn Mix_GetMusicAlbumTag(music: *const Mix_Music) -> *const libc::c_char; } -extern "C" { +unsafe extern "C" { + pub fn Mix_GetMusicCopyrightTag(music: *const Mix_Music) -> *const libc::c_char; +} +pub type Mix_MixCallback = ::core::option::Option< + unsafe extern "C" fn(udata: *mut libc::c_void, stream: *mut Uint8, len: libc::c_int), +>; +unsafe extern "C" { + pub fn Mix_SetPostMix(mix_func: Mix_MixCallback, arg: *mut libc::c_void); +} +unsafe extern "C" { + pub fn Mix_HookMusic(mix_func: Mix_MixCallback, arg: *mut libc::c_void); +} +pub type Mix_MusicFinishedCallback = ::core::option::Option; +unsafe extern "C" { + pub fn Mix_HookMusicFinished(music_finished: Mix_MusicFinishedCallback); +} +unsafe extern "C" { pub fn Mix_GetMusicHookData() -> *mut libc::c_void; } -extern "C" { - pub fn Mix_ChannelFinished( - channel_finished: ::core::option::Option, - ); +pub type Mix_ChannelFinishedCallback = + ::core::option::Option; +unsafe extern "C" { + pub fn Mix_ChannelFinished(channel_finished: Mix_ChannelFinishedCallback); } pub type Mix_EffectFunc_t = ::core::option::Option< unsafe extern "C" fn( @@ -237,7 +200,7 @@ pub type Mix_EffectFunc_t = ::core::option::Option< >; pub type Mix_EffectDone_t = ::core::option::Option; -extern "C" { +unsafe extern "C" { pub fn Mix_RegisterEffect( chan: libc::c_int, f: Mix_EffectFunc_t, @@ -245,46 +208,53 @@ extern "C" { arg: *mut libc::c_void, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_UnregisterEffect(channel: libc::c_int, f: Mix_EffectFunc_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_UnregisterAllEffects(channel: libc::c_int) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_SetPanning(channel: libc::c_int, left: Uint8, right: Uint8) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_SetPosition(channel: libc::c_int, angle: Sint16, distance: Uint8) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_SetDistance(channel: libc::c_int, distance: Uint8) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_SetReverseStereo(channel: libc::c_int, flip: libc::c_int) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_ReserveChannels(num: libc::c_int) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_GroupChannel(which: libc::c_int, tag: libc::c_int) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_GroupChannels(from: libc::c_int, to: libc::c_int, tag: libc::c_int) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_GroupAvailable(tag: libc::c_int) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_GroupCount(tag: libc::c_int) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_GroupOldest(tag: libc::c_int) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_GroupNewer(tag: libc::c_int) -> libc::c_int; } -extern "C" { +unsafe extern "C" { + pub fn Mix_PlayChannel( + channel: libc::c_int, + chunk: *mut Mix_Chunk, + loops: libc::c_int, + ) -> libc::c_int; +} +unsafe extern "C" { pub fn Mix_PlayChannelTimed( channel: libc::c_int, chunk: *mut Mix_Chunk, @@ -292,17 +262,17 @@ extern "C" { ticks: libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_PlayMusic(music: *mut Mix_Music, loops: libc::c_int) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_FadeInMusic( music: *mut Mix_Music, loops: libc::c_int, ms: libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_FadeInMusicPos( music: *mut Mix_Music, loops: libc::c_int, @@ -310,7 +280,15 @@ extern "C" { position: f64, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { + pub fn Mix_FadeInChannel( + channel: libc::c_int, + chunk: *mut Mix_Chunk, + loops: libc::c_int, + ms: libc::c_int, + ) -> libc::c_int; +} +unsafe extern "C" { pub fn Mix_FadeInChannelTimed( channel: libc::c_int, chunk: *mut Mix_Chunk, @@ -319,98 +297,135 @@ extern "C" { ticks: libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_Volume(channel: libc::c_int, volume: libc::c_int) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_VolumeChunk(chunk: *mut Mix_Chunk, volume: libc::c_int) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_VolumeMusic(volume: libc::c_int) -> libc::c_int; } -extern "C" { +unsafe extern "C" { + pub fn Mix_GetMusicVolume(music: *mut Mix_Music) -> libc::c_int; +} +unsafe extern "C" { + pub fn Mix_MasterVolume(volume: libc::c_int) -> libc::c_int; +} +unsafe extern "C" { pub fn Mix_HaltChannel(channel: libc::c_int) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_HaltGroup(tag: libc::c_int) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_HaltMusic() -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_ExpireChannel(channel: libc::c_int, ticks: libc::c_int) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_FadeOutChannel(which: libc::c_int, ms: libc::c_int) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_FadeOutGroup(tag: libc::c_int, ms: libc::c_int) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_FadeOutMusic(ms: libc::c_int) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_FadingMusic() -> Mix_Fading; } -extern "C" { +unsafe extern "C" { pub fn Mix_FadingChannel(which: libc::c_int) -> Mix_Fading; } -extern "C" { +unsafe extern "C" { pub fn Mix_Pause(channel: libc::c_int); } -extern "C" { +unsafe extern "C" { pub fn Mix_Resume(channel: libc::c_int); } -extern "C" { +unsafe extern "C" { pub fn Mix_Paused(channel: libc::c_int) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_PauseMusic(); } -extern "C" { +unsafe extern "C" { pub fn Mix_ResumeMusic(); } -extern "C" { +unsafe extern "C" { pub fn Mix_RewindMusic(); } -extern "C" { +unsafe extern "C" { pub fn Mix_PausedMusic() -> libc::c_int; } -extern "C" { +unsafe extern "C" { + pub fn Mix_ModMusicJumpToOrder(order: libc::c_int) -> libc::c_int; +} +unsafe extern "C" { + pub fn Mix_StartTrack(music: *mut Mix_Music, track: libc::c_int) -> libc::c_int; +} +unsafe extern "C" { + pub fn Mix_GetNumTracks(music: *mut Mix_Music) -> libc::c_int; +} +unsafe extern "C" { pub fn Mix_SetMusicPosition(position: f64) -> libc::c_int; } -extern "C" { +unsafe extern "C" { + pub fn Mix_GetMusicPosition(music: *mut Mix_Music) -> f64; +} +unsafe extern "C" { + pub fn Mix_MusicDuration(music: *mut Mix_Music) -> f64; +} +unsafe extern "C" { + pub fn Mix_GetMusicLoopStartTime(music: *mut Mix_Music) -> f64; +} +unsafe extern "C" { + pub fn Mix_GetMusicLoopEndTime(music: *mut Mix_Music) -> f64; +} +unsafe extern "C" { + pub fn Mix_GetMusicLoopLengthTime(music: *mut Mix_Music) -> f64; +} +unsafe extern "C" { pub fn Mix_Playing(channel: libc::c_int) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_PlayingMusic() -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_SetMusicCMD(command: *const libc::c_char) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_SetSynchroValue(value: libc::c_int) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_GetSynchroValue() -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_SetSoundFonts(paths: *const libc::c_char) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn Mix_GetSoundFonts() -> *const libc::c_char; } -extern "C" { +pub type Mix_EachSoundFontCallback = ::core::option::Option< + unsafe extern "C" fn(arg1: *const libc::c_char, arg2: *mut libc::c_void) -> libc::c_int, +>; +unsafe extern "C" { pub fn Mix_EachSoundFont( - function: ::core::option::Option< - unsafe extern "C" fn(arg1: *const libc::c_char, arg2: *mut libc::c_void) -> libc::c_int, - >, + function: Mix_EachSoundFontCallback, data: *mut libc::c_void, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { + pub fn Mix_SetTimidityCfg(path: *const libc::c_char) -> libc::c_int; +} +unsafe extern "C" { + pub fn Mix_GetTimidityCfg() -> *const libc::c_char; +} +unsafe extern "C" { pub fn Mix_GetChunk(channel: libc::c_int) -> *mut Mix_Chunk; } -extern "C" { +unsafe extern "C" { pub fn Mix_CloseAudio(); } diff --git a/sdl2-sys/sdl_ttf_bindings.rs b/sdl2-sys/sdl_ttf_bindings.rs index 503c452cef..049b5663b3 100644 --- a/sdl2-sys/sdl_ttf_bindings.rs +++ b/sdl2-sys/sdl_ttf_bindings.rs @@ -1,9 +1,10 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.72.1 */ +#[allow(unused)] use crate::*; pub const TTF_MAJOR_VERSION: u32 = 2; -pub const TTF_MINOR_VERSION: u32 = 22; +pub const TTF_MINOR_VERSION: u32 = 24; pub const TTF_PATCHLEVEL: u32 = 0; pub const TTF_STYLE_NORMAL: u32 = 0; pub const TTF_STYLE_BOLD: u32 = 1; @@ -18,59 +19,52 @@ pub const TTF_HINTING_LIGHT_SUBPIXEL: u32 = 4; pub const TTF_WRAPPED_ALIGN_LEFT: u32 = 0; pub const TTF_WRAPPED_ALIGN_CENTER: u32 = 1; pub const TTF_WRAPPED_ALIGN_RIGHT: u32 = 2; -pub type __off_t = libc::c_long; -pub type __off64_t = libc::c_long; -pub type Uint8 = u8; -pub type Uint16 = u16; -pub type Uint32 = u32; -pub type Sint64 = i64; -extern "C" { +unsafe extern "C" { pub fn TTF_Linked_Version() -> *const SDL_version; } -extern "C" { +unsafe extern "C" { pub fn TTF_GetFreeTypeVersion( major: *mut libc::c_int, minor: *mut libc::c_int, patch: *mut libc::c_int, ); } -extern "C" { +unsafe extern "C" { pub fn TTF_GetHarfBuzzVersion( major: *mut libc::c_int, minor: *mut libc::c_int, patch: *mut libc::c_int, ); } -extern "C" { +unsafe extern "C" { pub fn TTF_ByteSwappedUNICODE(swapped: SDL_bool); } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct _TTF_Font { +pub struct TTF_Font { _unused: [u8; 0], } -pub type TTF_Font = _TTF_Font; -extern "C" { +unsafe extern "C" { pub fn TTF_Init() -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn TTF_OpenFont(file: *const libc::c_char, ptsize: libc::c_int) -> *mut TTF_Font; } -extern "C" { +unsafe extern "C" { pub fn TTF_OpenFontIndex( file: *const libc::c_char, ptsize: libc::c_int, index: libc::c_long, ) -> *mut TTF_Font; } -extern "C" { +unsafe extern "C" { pub fn TTF_OpenFontRW( src: *mut SDL_RWops, freesrc: libc::c_int, ptsize: libc::c_int, ) -> *mut TTF_Font; } -extern "C" { +unsafe extern "C" { pub fn TTF_OpenFontIndexRW( src: *mut SDL_RWops, freesrc: libc::c_int, @@ -78,7 +72,7 @@ extern "C" { index: libc::c_long, ) -> *mut TTF_Font; } -extern "C" { +unsafe extern "C" { pub fn TTF_OpenFontDPI( file: *const libc::c_char, ptsize: libc::c_int, @@ -86,7 +80,7 @@ extern "C" { vdpi: libc::c_uint, ) -> *mut TTF_Font; } -extern "C" { +unsafe extern "C" { pub fn TTF_OpenFontIndexDPI( file: *const libc::c_char, ptsize: libc::c_int, @@ -95,7 +89,7 @@ extern "C" { vdpi: libc::c_uint, ) -> *mut TTF_Font; } -extern "C" { +unsafe extern "C" { pub fn TTF_OpenFontDPIRW( src: *mut SDL_RWops, freesrc: libc::c_int, @@ -104,7 +98,7 @@ extern "C" { vdpi: libc::c_uint, ) -> *mut TTF_Font; } -extern "C" { +unsafe extern "C" { pub fn TTF_OpenFontIndexDPIRW( src: *mut SDL_RWops, freesrc: libc::c_int, @@ -114,10 +108,10 @@ extern "C" { vdpi: libc::c_uint, ) -> *mut TTF_Font; } -extern "C" { +unsafe extern "C" { pub fn TTF_SetFontSize(font: *mut TTF_Font, ptsize: libc::c_int) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn TTF_SetFontSizeDPI( font: *mut TTF_Font, ptsize: libc::c_int, @@ -125,67 +119,70 @@ extern "C" { vdpi: libc::c_uint, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn TTF_GetFontStyle(font: *const TTF_Font) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn TTF_SetFontStyle(font: *mut TTF_Font, style: libc::c_int); } -extern "C" { +unsafe extern "C" { pub fn TTF_GetFontOutline(font: *const TTF_Font) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn TTF_SetFontOutline(font: *mut TTF_Font, outline: libc::c_int); } -extern "C" { +unsafe extern "C" { pub fn TTF_GetFontHinting(font: *const TTF_Font) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn TTF_SetFontHinting(font: *mut TTF_Font, hinting: libc::c_int); } -extern "C" { +unsafe extern "C" { pub fn TTF_GetFontWrappedAlign(font: *const TTF_Font) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn TTF_SetFontWrappedAlign(font: *mut TTF_Font, align: libc::c_int); } -extern "C" { +unsafe extern "C" { pub fn TTF_FontHeight(font: *const TTF_Font) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn TTF_FontAscent(font: *const TTF_Font) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn TTF_FontDescent(font: *const TTF_Font) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn TTF_FontLineSkip(font: *const TTF_Font) -> libc::c_int; } -extern "C" { +unsafe extern "C" { + pub fn TTF_SetFontLineSkip(font: *mut TTF_Font, lineskip: libc::c_int); +} +unsafe extern "C" { pub fn TTF_GetFontKerning(font: *const TTF_Font) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn TTF_SetFontKerning(font: *mut TTF_Font, allowed: libc::c_int); } -extern "C" { +unsafe extern "C" { pub fn TTF_FontFaces(font: *const TTF_Font) -> libc::c_long; } -extern "C" { +unsafe extern "C" { pub fn TTF_FontFaceIsFixedWidth(font: *const TTF_Font) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn TTF_FontFaceFamilyName(font: *const TTF_Font) -> *const libc::c_char; } -extern "C" { +unsafe extern "C" { pub fn TTF_FontFaceStyleName(font: *const TTF_Font) -> *const libc::c_char; } -extern "C" { +unsafe extern "C" { pub fn TTF_GlyphIsProvided(font: *mut TTF_Font, ch: Uint16) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn TTF_GlyphIsProvided32(font: *mut TTF_Font, ch: Uint32) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn TTF_GlyphMetrics( font: *mut TTF_Font, ch: Uint16, @@ -196,7 +193,7 @@ extern "C" { advance: *mut libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn TTF_GlyphMetrics32( font: *mut TTF_Font, ch: Uint32, @@ -207,7 +204,7 @@ extern "C" { advance: *mut libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn TTF_SizeText( font: *mut TTF_Font, text: *const libc::c_char, @@ -215,7 +212,7 @@ extern "C" { h: *mut libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn TTF_SizeUTF8( font: *mut TTF_Font, text: *const libc::c_char, @@ -223,7 +220,7 @@ extern "C" { h: *mut libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn TTF_SizeUNICODE( font: *mut TTF_Font, text: *const Uint16, @@ -231,7 +228,7 @@ extern "C" { h: *mut libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn TTF_MeasureText( font: *mut TTF_Font, text: *const libc::c_char, @@ -240,7 +237,7 @@ extern "C" { count: *mut libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn TTF_MeasureUTF8( font: *mut TTF_Font, text: *const libc::c_char, @@ -249,7 +246,7 @@ extern "C" { count: *mut libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn TTF_MeasureUNICODE( font: *mut TTF_Font, text: *const Uint16, @@ -258,28 +255,28 @@ extern "C" { count: *mut libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn TTF_RenderText_Solid( font: *mut TTF_Font, text: *const libc::c_char, fg: SDL_Color, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn TTF_RenderUTF8_Solid( font: *mut TTF_Font, text: *const libc::c_char, fg: SDL_Color, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn TTF_RenderUNICODE_Solid( font: *mut TTF_Font, text: *const Uint16, fg: SDL_Color, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn TTF_RenderText_Solid_Wrapped( font: *mut TTF_Font, text: *const libc::c_char, @@ -287,7 +284,7 @@ extern "C" { wrapLength: Uint32, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn TTF_RenderUTF8_Solid_Wrapped( font: *mut TTF_Font, text: *const libc::c_char, @@ -295,7 +292,7 @@ extern "C" { wrapLength: Uint32, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn TTF_RenderUNICODE_Solid_Wrapped( font: *mut TTF_Font, text: *const Uint16, @@ -303,21 +300,21 @@ extern "C" { wrapLength: Uint32, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn TTF_RenderGlyph_Solid( font: *mut TTF_Font, ch: Uint16, fg: SDL_Color, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn TTF_RenderGlyph32_Solid( font: *mut TTF_Font, ch: Uint32, fg: SDL_Color, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn TTF_RenderText_Shaded( font: *mut TTF_Font, text: *const libc::c_char, @@ -325,7 +322,7 @@ extern "C" { bg: SDL_Color, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn TTF_RenderUTF8_Shaded( font: *mut TTF_Font, text: *const libc::c_char, @@ -333,7 +330,7 @@ extern "C" { bg: SDL_Color, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn TTF_RenderUNICODE_Shaded( font: *mut TTF_Font, text: *const Uint16, @@ -341,7 +338,7 @@ extern "C" { bg: SDL_Color, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn TTF_RenderText_Shaded_Wrapped( font: *mut TTF_Font, text: *const libc::c_char, @@ -350,7 +347,7 @@ extern "C" { wrapLength: Uint32, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn TTF_RenderUTF8_Shaded_Wrapped( font: *mut TTF_Font, text: *const libc::c_char, @@ -359,7 +356,7 @@ extern "C" { wrapLength: Uint32, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn TTF_RenderUNICODE_Shaded_Wrapped( font: *mut TTF_Font, text: *const Uint16, @@ -368,7 +365,7 @@ extern "C" { wrapLength: Uint32, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn TTF_RenderGlyph_Shaded( font: *mut TTF_Font, ch: Uint16, @@ -376,7 +373,7 @@ extern "C" { bg: SDL_Color, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn TTF_RenderGlyph32_Shaded( font: *mut TTF_Font, ch: Uint32, @@ -384,28 +381,28 @@ extern "C" { bg: SDL_Color, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn TTF_RenderText_Blended( font: *mut TTF_Font, text: *const libc::c_char, fg: SDL_Color, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn TTF_RenderUTF8_Blended( font: *mut TTF_Font, text: *const libc::c_char, fg: SDL_Color, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn TTF_RenderUNICODE_Blended( font: *mut TTF_Font, text: *const Uint16, fg: SDL_Color, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn TTF_RenderText_Blended_Wrapped( font: *mut TTF_Font, text: *const libc::c_char, @@ -413,7 +410,7 @@ extern "C" { wrapLength: Uint32, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn TTF_RenderUTF8_Blended_Wrapped( font: *mut TTF_Font, text: *const libc::c_char, @@ -421,7 +418,7 @@ extern "C" { wrapLength: Uint32, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn TTF_RenderUNICODE_Blended_Wrapped( font: *mut TTF_Font, text: *const Uint16, @@ -429,21 +426,21 @@ extern "C" { wrapLength: Uint32, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn TTF_RenderGlyph_Blended( font: *mut TTF_Font, ch: Uint16, fg: SDL_Color, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn TTF_RenderGlyph32_Blended( font: *mut TTF_Font, ch: Uint32, fg: SDL_Color, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn TTF_RenderText_LCD( font: *mut TTF_Font, text: *const libc::c_char, @@ -451,7 +448,7 @@ extern "C" { bg: SDL_Color, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn TTF_RenderUTF8_LCD( font: *mut TTF_Font, text: *const libc::c_char, @@ -459,7 +456,7 @@ extern "C" { bg: SDL_Color, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn TTF_RenderUNICODE_LCD( font: *mut TTF_Font, text: *const Uint16, @@ -467,7 +464,7 @@ extern "C" { bg: SDL_Color, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn TTF_RenderText_LCD_Wrapped( font: *mut TTF_Font, text: *const libc::c_char, @@ -476,7 +473,7 @@ extern "C" { wrapLength: Uint32, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn TTF_RenderUTF8_LCD_Wrapped( font: *mut TTF_Font, text: *const libc::c_char, @@ -485,7 +482,7 @@ extern "C" { wrapLength: Uint32, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn TTF_RenderUNICODE_LCD_Wrapped( font: *mut TTF_Font, text: *const Uint16, @@ -494,7 +491,7 @@ extern "C" { wrapLength: Uint32, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn TTF_RenderGlyph_LCD( font: *mut TTF_Font, ch: Uint16, @@ -502,7 +499,7 @@ extern "C" { bg: SDL_Color, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn TTF_RenderGlyph32_LCD( font: *mut TTF_Font, ch: Uint32, @@ -510,40 +507,40 @@ extern "C" { bg: SDL_Color, ) -> *mut SDL_Surface; } -extern "C" { +unsafe extern "C" { pub fn TTF_CloseFont(font: *mut TTF_Font); } -extern "C" { +unsafe extern "C" { pub fn TTF_Quit(); } -extern "C" { +unsafe extern "C" { pub fn TTF_WasInit() -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn TTF_GetFontKerningSize( font: *mut TTF_Font, prev_index: libc::c_int, index: libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn TTF_GetFontKerningSizeGlyphs( font: *mut TTF_Font, previous_ch: Uint16, ch: Uint16, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn TTF_GetFontKerningSizeGlyphs32( font: *mut TTF_Font, previous_ch: Uint32, ch: Uint32, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn TTF_SetFontSDF(font: *mut TTF_Font, on_off: SDL_bool) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn TTF_GetFontSDF(font: *const TTF_Font) -> SDL_bool; } pub const TTF_Direction_TTF_DIRECTION_LTR: TTF_Direction = 0; @@ -551,15 +548,15 @@ pub const TTF_Direction_TTF_DIRECTION_RTL: TTF_Direction = 1; pub const TTF_Direction_TTF_DIRECTION_TTB: TTF_Direction = 2; pub const TTF_Direction_TTF_DIRECTION_BTT: TTF_Direction = 3; pub type TTF_Direction = libc::c_uint; -extern "C" { +unsafe extern "C" { pub fn TTF_SetDirection(direction: libc::c_int) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn TTF_SetScript(script: libc::c_int) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn TTF_SetFontDirection(font: *mut TTF_Font, direction: TTF_Direction) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn TTF_SetFontScriptName(font: *mut TTF_Font, script: *const libc::c_char) -> libc::c_int; }