graphene-sys-0.20.7/.cargo_vcs_info.json0000644000000001520000000000100135250ustar { "git": { "sha1": "1b119dc9e96dec43959e040c9def5da2bd4fa24b" }, "path_in_vcs": "graphene/sys" }graphene-sys-0.20.7/Cargo.toml0000644000000031330000000000100115250ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" rust-version = "1.70" name = "graphene-sys" version = "0.20.7" authors = ["The gtk-rs Project Developers"] build = "build.rs" exclude = ["gir-files/*"] autolib = false autobins = false autoexamples = false autotests = false autobenches = false description = "FFI bindings to libgraphene-1.0" homepage = "https://gtk-rs.org/" readme = false keywords = [ "graphene", "ffi", "gtk-rs", "gnome", ] license = "MIT" repository = "https://github.com/gtk-rs/gtk-rs-core" [package.metadata.docs.rs] all-features = true rustc-args = [ "--cfg", "docsrs", ] rustdoc-args = [ "--cfg", "docsrs", "--generate-link-to-definition", ] [package.metadata.system-deps.graphene_gobject_1_0] name = "graphene-gobject-1.0" version = "1.10" [lib] name = "graphene_sys" path = "src/lib.rs" [[test]] name = "abi" path = "tests/abi.rs" [dependencies.glib-sys] version = "0.20.6" [dependencies.libc] version = "0.2" [dev-dependencies.shell-words] version = "1.0.0" [dev-dependencies.tempfile] version = "3" [build-dependencies.pkg-config] version = "0.3.29" [build-dependencies.system-deps] version = "7" [features] graphene-sys-0.20.7/Cargo.toml.orig000064400000000000000000000016361046102023000152140ustar 00000000000000[build-dependencies] pkg-config = "0.3.29" system-deps = "7" [dependencies] libc = "0.2" [dependencies.glib-sys] workspace = true [dev-dependencies] shell-words = "1.0.0" tempfile = "3" [lib] name = "graphene_sys" [package] build = "build.rs" description = "FFI bindings to libgraphene-1.0" keywords = ["graphene", "ffi", "gtk-rs", "gnome"] name = "graphene-sys" [package.authors] workspace = true [package.edition] workspace = true [package.exclude] workspace = true [package.homepage] workspace = true [package.license] workspace = true [package.repository] workspace = true [package.rust-version] workspace = true [package.version] workspace = true [package.metadata.system-deps.graphene_gobject_1_0] name = "graphene-gobject-1.0" version = "1.10" [package.metadata.docs.rs] rustc-args = ["--cfg", "docsrs"] rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"] all-features = true [features] graphene-sys-0.20.7/Gir.toml000064400000000000000000000015041046102023000137350ustar 00000000000000[options] work_mode = "sys" library = "Graphene" version = "1.0" min_cfg_version = "1.10" girs_dir = "../gir-files" target_path = "." single_version_file = "." girs_directories = ["../../gir-files"] external_libraries = [ "GLib", ] ignore = [ "Graphene.true", "Graphene.false", "Graphene.HAS_GCC", "Graphene.HAS_SCALAR", "Graphene.HAS_SSE", "Graphene.SIMD_S", "Graphene.PI", "Graphene.PI_2", ] [[object]] name = "Graphene.Matrix" status = "generate" align = 16 [[object]] name = "Graphene.Simd4F" status = "generate" align = 16 [[object]] name = "Graphene.Simd4X4F" status = "generate" align = 16 [[object]] name = "Graphene.Vec2" status = "generate" align = 16 [[object]] name = "Graphene.Vec3" status = "generate" align = 16 [[object]] name = "Graphene.Vec4" status = "generate" align = 16 graphene-sys-0.20.7/LICENSE000064400000000000000000000020001046102023000133140ustar 00000000000000Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. graphene-sys-0.20.7/build.rs000064400000000000000000000006541046102023000137710ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT #[cfg(not(docsrs))] use std::process; #[cfg(docsrs)] fn main() {} // prevent linking libraries to avoid documentation failure #[cfg(not(docsrs))] fn main() { if let Err(s) = system_deps::Config::new().probe() { println!("cargo:warning={s}"); process::exit(1); } } graphene-sys-0.20.7/src/lib.rs000064400000000000000000001676401046102023000142400ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT #![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] #![allow( clippy::approx_constant, clippy::type_complexity, clippy::unreadable_literal, clippy::upper_case_acronyms )] #![cfg_attr(docsrs, feature(doc_cfg))] use glib_sys as glib; #[cfg(unix)] #[allow(unused_imports)] use libc::{dev_t, gid_t, pid_t, socklen_t, uid_t}; #[allow(unused_imports)] use libc::{intptr_t, off_t, size_t, ssize_t, time_t, uintptr_t, FILE}; #[allow(unused_imports)] use std::ffi::{ c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void, }; #[allow(unused_imports)] use glib::{gboolean, gconstpointer, gpointer, GType}; // Enums pub type graphene_euler_order_t = c_int; pub const GRAPHENE_EULER_ORDER_DEFAULT: graphene_euler_order_t = -1; pub const GRAPHENE_EULER_ORDER_XYZ: graphene_euler_order_t = 0; pub const GRAPHENE_EULER_ORDER_YZX: graphene_euler_order_t = 1; pub const GRAPHENE_EULER_ORDER_ZXY: graphene_euler_order_t = 2; pub const GRAPHENE_EULER_ORDER_XZY: graphene_euler_order_t = 3; pub const GRAPHENE_EULER_ORDER_YXZ: graphene_euler_order_t = 4; pub const GRAPHENE_EULER_ORDER_ZYX: graphene_euler_order_t = 5; pub const GRAPHENE_EULER_ORDER_SXYZ: graphene_euler_order_t = 6; pub const GRAPHENE_EULER_ORDER_SXYX: graphene_euler_order_t = 7; pub const GRAPHENE_EULER_ORDER_SXZY: graphene_euler_order_t = 8; pub const GRAPHENE_EULER_ORDER_SXZX: graphene_euler_order_t = 9; pub const GRAPHENE_EULER_ORDER_SYZX: graphene_euler_order_t = 10; pub const GRAPHENE_EULER_ORDER_SYZY: graphene_euler_order_t = 11; pub const GRAPHENE_EULER_ORDER_SYXZ: graphene_euler_order_t = 12; pub const GRAPHENE_EULER_ORDER_SYXY: graphene_euler_order_t = 13; pub const GRAPHENE_EULER_ORDER_SZXY: graphene_euler_order_t = 14; pub const GRAPHENE_EULER_ORDER_SZXZ: graphene_euler_order_t = 15; pub const GRAPHENE_EULER_ORDER_SZYX: graphene_euler_order_t = 16; pub const GRAPHENE_EULER_ORDER_SZYZ: graphene_euler_order_t = 17; pub const GRAPHENE_EULER_ORDER_RZYX: graphene_euler_order_t = 18; pub const GRAPHENE_EULER_ORDER_RXYX: graphene_euler_order_t = 19; pub const GRAPHENE_EULER_ORDER_RYZX: graphene_euler_order_t = 20; pub const GRAPHENE_EULER_ORDER_RXZX: graphene_euler_order_t = 21; pub const GRAPHENE_EULER_ORDER_RXZY: graphene_euler_order_t = 22; pub const GRAPHENE_EULER_ORDER_RYZY: graphene_euler_order_t = 23; pub const GRAPHENE_EULER_ORDER_RZXY: graphene_euler_order_t = 24; pub const GRAPHENE_EULER_ORDER_RYXY: graphene_euler_order_t = 25; pub const GRAPHENE_EULER_ORDER_RYXZ: graphene_euler_order_t = 26; pub const GRAPHENE_EULER_ORDER_RZXZ: graphene_euler_order_t = 27; pub const GRAPHENE_EULER_ORDER_RXYZ: graphene_euler_order_t = 28; pub const GRAPHENE_EULER_ORDER_RZYZ: graphene_euler_order_t = 29; pub type graphene_ray_intersection_kind_t = c_int; pub const GRAPHENE_RAY_INTERSECTION_KIND_NONE: graphene_ray_intersection_kind_t = 0; pub const GRAPHENE_RAY_INTERSECTION_KIND_ENTER: graphene_ray_intersection_kind_t = 1; pub const GRAPHENE_RAY_INTERSECTION_KIND_LEAVE: graphene_ray_intersection_kind_t = 2; // Constants pub const GRAPHENE_VEC2_LEN: c_int = 2; pub const GRAPHENE_VEC3_LEN: c_int = 3; pub const GRAPHENE_VEC4_LEN: c_int = 4; // Records #[derive(Copy, Clone)] #[repr(C)] pub struct graphene_box_t { pub min: graphene_vec3_t, pub max: graphene_vec3_t, } impl ::std::fmt::Debug for graphene_box_t { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("graphene_box_t @ {self:p}")) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct graphene_euler_t { pub angles: graphene_vec3_t, pub order: graphene_euler_order_t, } impl ::std::fmt::Debug for graphene_euler_t { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("graphene_euler_t @ {self:p}")) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct graphene_frustum_t { pub planes: [graphene_plane_t; 6], } impl ::std::fmt::Debug for graphene_frustum_t { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("graphene_frustum_t @ {self:p}")) .finish() } } #[repr(align(16))] #[derive(Copy, Clone)] #[repr(C)] pub struct graphene_matrix_t { pub value: graphene_simd4x4f_t, } impl ::std::fmt::Debug for graphene_matrix_t { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("graphene_matrix_t @ {self:p}")) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct graphene_plane_t { pub normal: graphene_vec3_t, pub constant: c_float, } impl ::std::fmt::Debug for graphene_plane_t { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("graphene_plane_t @ {self:p}")) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct graphene_point3d_t { pub x: c_float, pub y: c_float, pub z: c_float, } impl ::std::fmt::Debug for graphene_point3d_t { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("graphene_point3d_t @ {self:p}")) .field("x", &self.x) .field("y", &self.y) .field("z", &self.z) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct graphene_point_t { pub x: c_float, pub y: c_float, } impl ::std::fmt::Debug for graphene_point_t { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("graphene_point_t @ {self:p}")) .field("x", &self.x) .field("y", &self.y) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct graphene_quad_t { pub points: [graphene_point_t; 4], } impl ::std::fmt::Debug for graphene_quad_t { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("graphene_quad_t @ {self:p}")) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct graphene_quaternion_t { pub x: c_float, pub y: c_float, pub z: c_float, pub w: c_float, } impl ::std::fmt::Debug for graphene_quaternion_t { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("graphene_quaternion_t @ {self:p}")) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct graphene_ray_t { pub origin: graphene_vec3_t, pub direction: graphene_vec3_t, } impl ::std::fmt::Debug for graphene_ray_t { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("graphene_ray_t @ {self:p}")) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct graphene_rect_t { pub origin: graphene_point_t, pub size: graphene_size_t, } impl ::std::fmt::Debug for graphene_rect_t { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("graphene_rect_t @ {self:p}")) .field("origin", &self.origin) .field("size", &self.size) .finish() } } #[repr(align(16))] #[derive(Copy, Clone)] #[repr(C)] pub struct graphene_simd4f_t { pub x: c_float, pub y: c_float, pub z: c_float, pub w: c_float, } impl ::std::fmt::Debug for graphene_simd4f_t { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("graphene_simd4f_t @ {self:p}")) .finish() } } #[repr(align(16))] #[derive(Copy, Clone)] #[repr(C)] pub struct graphene_simd4x4f_t { pub x: graphene_simd4f_t, pub y: graphene_simd4f_t, pub z: graphene_simd4f_t, pub w: graphene_simd4f_t, } impl ::std::fmt::Debug for graphene_simd4x4f_t { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("graphene_simd4x4f_t @ {self:p}")) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct graphene_size_t { pub width: c_float, pub height: c_float, } impl ::std::fmt::Debug for graphene_size_t { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("graphene_size_t @ {self:p}")) .field("width", &self.width) .field("height", &self.height) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct graphene_sphere_t { pub center: graphene_vec3_t, pub radius: c_float, } impl ::std::fmt::Debug for graphene_sphere_t { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("graphene_sphere_t @ {self:p}")) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct graphene_triangle_t { pub a: graphene_vec3_t, pub b: graphene_vec3_t, pub c: graphene_vec3_t, } impl ::std::fmt::Debug for graphene_triangle_t { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("graphene_triangle_t @ {self:p}")) .finish() } } #[repr(align(16))] #[derive(Copy, Clone)] #[repr(C)] pub struct graphene_vec2_t { pub value: graphene_simd4f_t, } impl ::std::fmt::Debug for graphene_vec2_t { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("graphene_vec2_t @ {self:p}")) .finish() } } #[repr(align(16))] #[derive(Copy, Clone)] #[repr(C)] pub struct graphene_vec3_t { pub value: graphene_simd4f_t, } impl ::std::fmt::Debug for graphene_vec3_t { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("graphene_vec3_t @ {self:p}")) .finish() } } #[repr(align(16))] #[derive(Copy, Clone)] #[repr(C)] pub struct graphene_vec4_t { pub value: graphene_simd4f_t, } impl ::std::fmt::Debug for graphene_vec4_t { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("graphene_vec4_t @ {self:p}")) .finish() } } extern "C" { //========================================================================= // graphene_box_t //========================================================================= pub fn graphene_box_get_type() -> GType; pub fn graphene_box_alloc() -> *mut graphene_box_t; pub fn graphene_box_contains_box(a: *const graphene_box_t, b: *const graphene_box_t) -> bool; pub fn graphene_box_contains_point( box_: *const graphene_box_t, point: *const graphene_point3d_t, ) -> bool; pub fn graphene_box_equal(a: *const graphene_box_t, b: *const graphene_box_t) -> bool; pub fn graphene_box_expand( box_: *const graphene_box_t, point: *const graphene_point3d_t, res: *mut graphene_box_t, ); pub fn graphene_box_expand_scalar( box_: *const graphene_box_t, scalar: c_float, res: *mut graphene_box_t, ); pub fn graphene_box_expand_vec3( box_: *const graphene_box_t, vec: *const graphene_vec3_t, res: *mut graphene_box_t, ); pub fn graphene_box_free(box_: *mut graphene_box_t); pub fn graphene_box_get_bounding_sphere( box_: *const graphene_box_t, sphere: *mut graphene_sphere_t, ); pub fn graphene_box_get_center(box_: *const graphene_box_t, center: *mut graphene_point3d_t); pub fn graphene_box_get_depth(box_: *const graphene_box_t) -> c_float; pub fn graphene_box_get_height(box_: *const graphene_box_t) -> c_float; pub fn graphene_box_get_max(box_: *const graphene_box_t, max: *mut graphene_point3d_t); pub fn graphene_box_get_min(box_: *const graphene_box_t, min: *mut graphene_point3d_t); pub fn graphene_box_get_size(box_: *const graphene_box_t, size: *mut graphene_vec3_t); pub fn graphene_box_get_vertices( box_: *const graphene_box_t, vertices: *mut [graphene_vec3_t; 8], ); pub fn graphene_box_get_width(box_: *const graphene_box_t) -> c_float; pub fn graphene_box_init( box_: *mut graphene_box_t, min: *const graphene_point3d_t, max: *const graphene_point3d_t, ) -> *mut graphene_box_t; pub fn graphene_box_init_from_box( box_: *mut graphene_box_t, src: *const graphene_box_t, ) -> *mut graphene_box_t; pub fn graphene_box_init_from_points( box_: *mut graphene_box_t, n_points: c_uint, points: *const graphene_point3d_t, ) -> *mut graphene_box_t; pub fn graphene_box_init_from_vec3( box_: *mut graphene_box_t, min: *const graphene_vec3_t, max: *const graphene_vec3_t, ) -> *mut graphene_box_t; pub fn graphene_box_init_from_vectors( box_: *mut graphene_box_t, n_vectors: c_uint, vectors: *const graphene_vec3_t, ) -> *mut graphene_box_t; pub fn graphene_box_intersection( a: *const graphene_box_t, b: *const graphene_box_t, res: *mut graphene_box_t, ) -> bool; pub fn graphene_box_union( a: *const graphene_box_t, b: *const graphene_box_t, res: *mut graphene_box_t, ); pub fn graphene_box_empty() -> *const graphene_box_t; pub fn graphene_box_infinite() -> *const graphene_box_t; pub fn graphene_box_minus_one() -> *const graphene_box_t; pub fn graphene_box_one() -> *const graphene_box_t; pub fn graphene_box_one_minus_one() -> *const graphene_box_t; pub fn graphene_box_zero() -> *const graphene_box_t; //========================================================================= // graphene_euler_t //========================================================================= pub fn graphene_euler_get_type() -> GType; pub fn graphene_euler_alloc() -> *mut graphene_euler_t; pub fn graphene_euler_equal(a: *const graphene_euler_t, b: *const graphene_euler_t) -> bool; pub fn graphene_euler_free(e: *mut graphene_euler_t); pub fn graphene_euler_get_alpha(e: *const graphene_euler_t) -> c_float; pub fn graphene_euler_get_beta(e: *const graphene_euler_t) -> c_float; pub fn graphene_euler_get_gamma(e: *const graphene_euler_t) -> c_float; pub fn graphene_euler_get_order(e: *const graphene_euler_t) -> graphene_euler_order_t; pub fn graphene_euler_get_x(e: *const graphene_euler_t) -> c_float; pub fn graphene_euler_get_y(e: *const graphene_euler_t) -> c_float; pub fn graphene_euler_get_z(e: *const graphene_euler_t) -> c_float; pub fn graphene_euler_init( e: *mut graphene_euler_t, x: c_float, y: c_float, z: c_float, ) -> *mut graphene_euler_t; pub fn graphene_euler_init_from_euler( e: *mut graphene_euler_t, src: *const graphene_euler_t, ) -> *mut graphene_euler_t; pub fn graphene_euler_init_from_matrix( e: *mut graphene_euler_t, m: *const graphene_matrix_t, order: graphene_euler_order_t, ) -> *mut graphene_euler_t; pub fn graphene_euler_init_from_quaternion( e: *mut graphene_euler_t, q: *const graphene_quaternion_t, order: graphene_euler_order_t, ) -> *mut graphene_euler_t; pub fn graphene_euler_init_from_radians( e: *mut graphene_euler_t, x: c_float, y: c_float, z: c_float, order: graphene_euler_order_t, ) -> *mut graphene_euler_t; pub fn graphene_euler_init_from_vec3( e: *mut graphene_euler_t, v: *const graphene_vec3_t, order: graphene_euler_order_t, ) -> *mut graphene_euler_t; pub fn graphene_euler_init_with_order( e: *mut graphene_euler_t, x: c_float, y: c_float, z: c_float, order: graphene_euler_order_t, ) -> *mut graphene_euler_t; pub fn graphene_euler_reorder( e: *const graphene_euler_t, order: graphene_euler_order_t, res: *mut graphene_euler_t, ); pub fn graphene_euler_to_matrix(e: *const graphene_euler_t, res: *mut graphene_matrix_t); pub fn graphene_euler_to_quaternion( e: *const graphene_euler_t, res: *mut graphene_quaternion_t, ); pub fn graphene_euler_to_vec3(e: *const graphene_euler_t, res: *mut graphene_vec3_t); //========================================================================= // graphene_frustum_t //========================================================================= pub fn graphene_frustum_get_type() -> GType; pub fn graphene_frustum_alloc() -> *mut graphene_frustum_t; pub fn graphene_frustum_contains_point( f: *const graphene_frustum_t, point: *const graphene_point3d_t, ) -> bool; pub fn graphene_frustum_equal( a: *const graphene_frustum_t, b: *const graphene_frustum_t, ) -> bool; pub fn graphene_frustum_free(f: *mut graphene_frustum_t); pub fn graphene_frustum_get_planes( f: *const graphene_frustum_t, planes: *mut [graphene_plane_t; 6], ); pub fn graphene_frustum_init( f: *mut graphene_frustum_t, p0: *const graphene_plane_t, p1: *const graphene_plane_t, p2: *const graphene_plane_t, p3: *const graphene_plane_t, p4: *const graphene_plane_t, p5: *const graphene_plane_t, ) -> *mut graphene_frustum_t; pub fn graphene_frustum_init_from_frustum( f: *mut graphene_frustum_t, src: *const graphene_frustum_t, ) -> *mut graphene_frustum_t; pub fn graphene_frustum_init_from_matrix( f: *mut graphene_frustum_t, matrix: *const graphene_matrix_t, ) -> *mut graphene_frustum_t; pub fn graphene_frustum_intersects_box( f: *const graphene_frustum_t, box_: *const graphene_box_t, ) -> bool; pub fn graphene_frustum_intersects_sphere( f: *const graphene_frustum_t, sphere: *const graphene_sphere_t, ) -> bool; //========================================================================= // graphene_matrix_t //========================================================================= pub fn graphene_matrix_get_type() -> GType; pub fn graphene_matrix_alloc() -> *mut graphene_matrix_t; pub fn graphene_matrix_decompose( m: *const graphene_matrix_t, translate: *mut graphene_vec3_t, scale: *mut graphene_vec3_t, rotate: *mut graphene_quaternion_t, shear: *mut graphene_vec3_t, perspective: *mut graphene_vec4_t, ) -> bool; pub fn graphene_matrix_determinant(m: *const graphene_matrix_t) -> c_float; pub fn graphene_matrix_equal(a: *const graphene_matrix_t, b: *const graphene_matrix_t) -> bool; pub fn graphene_matrix_equal_fast( a: *const graphene_matrix_t, b: *const graphene_matrix_t, ) -> bool; pub fn graphene_matrix_free(m: *mut graphene_matrix_t); pub fn graphene_matrix_get_row( m: *const graphene_matrix_t, index_: c_uint, res: *mut graphene_vec4_t, ); pub fn graphene_matrix_get_value( m: *const graphene_matrix_t, row: c_uint, col: c_uint, ) -> c_float; pub fn graphene_matrix_get_x_scale(m: *const graphene_matrix_t) -> c_float; pub fn graphene_matrix_get_x_translation(m: *const graphene_matrix_t) -> c_float; pub fn graphene_matrix_get_y_scale(m: *const graphene_matrix_t) -> c_float; pub fn graphene_matrix_get_y_translation(m: *const graphene_matrix_t) -> c_float; pub fn graphene_matrix_get_z_scale(m: *const graphene_matrix_t) -> c_float; pub fn graphene_matrix_get_z_translation(m: *const graphene_matrix_t) -> c_float; pub fn graphene_matrix_init_from_2d( m: *mut graphene_matrix_t, xx: c_double, yx: c_double, xy: c_double, yy: c_double, x_0: c_double, y_0: c_double, ) -> *mut graphene_matrix_t; pub fn graphene_matrix_init_from_float( m: *mut graphene_matrix_t, v: *const [c_float; 16], ) -> *mut graphene_matrix_t; pub fn graphene_matrix_init_from_matrix( m: *mut graphene_matrix_t, src: *const graphene_matrix_t, ) -> *mut graphene_matrix_t; pub fn graphene_matrix_init_from_vec4( m: *mut graphene_matrix_t, v0: *const graphene_vec4_t, v1: *const graphene_vec4_t, v2: *const graphene_vec4_t, v3: *const graphene_vec4_t, ) -> *mut graphene_matrix_t; pub fn graphene_matrix_init_frustum( m: *mut graphene_matrix_t, left: c_float, right: c_float, bottom: c_float, top: c_float, z_near: c_float, z_far: c_float, ) -> *mut graphene_matrix_t; pub fn graphene_matrix_init_identity(m: *mut graphene_matrix_t) -> *mut graphene_matrix_t; pub fn graphene_matrix_init_look_at( m: *mut graphene_matrix_t, eye: *const graphene_vec3_t, center: *const graphene_vec3_t, up: *const graphene_vec3_t, ) -> *mut graphene_matrix_t; pub fn graphene_matrix_init_ortho( m: *mut graphene_matrix_t, left: c_float, right: c_float, top: c_float, bottom: c_float, z_near: c_float, z_far: c_float, ) -> *mut graphene_matrix_t; pub fn graphene_matrix_init_perspective( m: *mut graphene_matrix_t, fovy: c_float, aspect: c_float, z_near: c_float, z_far: c_float, ) -> *mut graphene_matrix_t; pub fn graphene_matrix_init_rotate( m: *mut graphene_matrix_t, angle: c_float, axis: *const graphene_vec3_t, ) -> *mut graphene_matrix_t; pub fn graphene_matrix_init_scale( m: *mut graphene_matrix_t, x: c_float, y: c_float, z: c_float, ) -> *mut graphene_matrix_t; pub fn graphene_matrix_init_skew( m: *mut graphene_matrix_t, x_skew: c_float, y_skew: c_float, ) -> *mut graphene_matrix_t; pub fn graphene_matrix_init_translate( m: *mut graphene_matrix_t, p: *const graphene_point3d_t, ) -> *mut graphene_matrix_t; pub fn graphene_matrix_interpolate( a: *const graphene_matrix_t, b: *const graphene_matrix_t, factor: c_double, res: *mut graphene_matrix_t, ); pub fn graphene_matrix_inverse( m: *const graphene_matrix_t, res: *mut graphene_matrix_t, ) -> bool; pub fn graphene_matrix_is_2d(m: *const graphene_matrix_t) -> bool; pub fn graphene_matrix_is_backface_visible(m: *const graphene_matrix_t) -> bool; pub fn graphene_matrix_is_identity(m: *const graphene_matrix_t) -> bool; pub fn graphene_matrix_is_singular(m: *const graphene_matrix_t) -> bool; pub fn graphene_matrix_multiply( a: *const graphene_matrix_t, b: *const graphene_matrix_t, res: *mut graphene_matrix_t, ); pub fn graphene_matrix_near( a: *const graphene_matrix_t, b: *const graphene_matrix_t, epsilon: c_float, ) -> bool; pub fn graphene_matrix_normalize(m: *const graphene_matrix_t, res: *mut graphene_matrix_t); pub fn graphene_matrix_perspective( m: *const graphene_matrix_t, depth: c_float, res: *mut graphene_matrix_t, ); pub fn graphene_matrix_print(m: *const graphene_matrix_t); pub fn graphene_matrix_project_point( m: *const graphene_matrix_t, p: *const graphene_point_t, res: *mut graphene_point_t, ); pub fn graphene_matrix_project_rect( m: *const graphene_matrix_t, r: *const graphene_rect_t, res: *mut graphene_quad_t, ); pub fn graphene_matrix_project_rect_bounds( m: *const graphene_matrix_t, r: *const graphene_rect_t, res: *mut graphene_rect_t, ); pub fn graphene_matrix_rotate( m: *mut graphene_matrix_t, angle: c_float, axis: *const graphene_vec3_t, ); pub fn graphene_matrix_rotate_euler(m: *mut graphene_matrix_t, e: *const graphene_euler_t); pub fn graphene_matrix_rotate_quaternion( m: *mut graphene_matrix_t, q: *const graphene_quaternion_t, ); pub fn graphene_matrix_rotate_x(m: *mut graphene_matrix_t, angle: c_float); pub fn graphene_matrix_rotate_y(m: *mut graphene_matrix_t, angle: c_float); pub fn graphene_matrix_rotate_z(m: *mut graphene_matrix_t, angle: c_float); pub fn graphene_matrix_scale( m: *mut graphene_matrix_t, factor_x: c_float, factor_y: c_float, factor_z: c_float, ); pub fn graphene_matrix_skew_xy(m: *mut graphene_matrix_t, factor: c_float); pub fn graphene_matrix_skew_xz(m: *mut graphene_matrix_t, factor: c_float); pub fn graphene_matrix_skew_yz(m: *mut graphene_matrix_t, factor: c_float); pub fn graphene_matrix_to_2d( m: *const graphene_matrix_t, xx: *mut c_double, yx: *mut c_double, xy: *mut c_double, yy: *mut c_double, x_0: *mut c_double, y_0: *mut c_double, ) -> bool; pub fn graphene_matrix_to_float(m: *const graphene_matrix_t, v: *mut [c_float; 16]); pub fn graphene_matrix_transform_bounds( m: *const graphene_matrix_t, r: *const graphene_rect_t, res: *mut graphene_rect_t, ); pub fn graphene_matrix_transform_box( m: *const graphene_matrix_t, b: *const graphene_box_t, res: *mut graphene_box_t, ); pub fn graphene_matrix_transform_point( m: *const graphene_matrix_t, p: *const graphene_point_t, res: *mut graphene_point_t, ); pub fn graphene_matrix_transform_point3d( m: *const graphene_matrix_t, p: *const graphene_point3d_t, res: *mut graphene_point3d_t, ); pub fn graphene_matrix_transform_ray( m: *const graphene_matrix_t, r: *const graphene_ray_t, res: *mut graphene_ray_t, ); pub fn graphene_matrix_transform_rect( m: *const graphene_matrix_t, r: *const graphene_rect_t, res: *mut graphene_quad_t, ); pub fn graphene_matrix_transform_sphere( m: *const graphene_matrix_t, s: *const graphene_sphere_t, res: *mut graphene_sphere_t, ); pub fn graphene_matrix_transform_vec3( m: *const graphene_matrix_t, v: *const graphene_vec3_t, res: *mut graphene_vec3_t, ); pub fn graphene_matrix_transform_vec4( m: *const graphene_matrix_t, v: *const graphene_vec4_t, res: *mut graphene_vec4_t, ); pub fn graphene_matrix_translate(m: *mut graphene_matrix_t, pos: *const graphene_point3d_t); pub fn graphene_matrix_transpose(m: *const graphene_matrix_t, res: *mut graphene_matrix_t); pub fn graphene_matrix_unproject_point3d( projection: *const graphene_matrix_t, modelview: *const graphene_matrix_t, point: *const graphene_point3d_t, res: *mut graphene_point3d_t, ); pub fn graphene_matrix_untransform_bounds( m: *const graphene_matrix_t, r: *const graphene_rect_t, bounds: *const graphene_rect_t, res: *mut graphene_rect_t, ); pub fn graphene_matrix_untransform_point( m: *const graphene_matrix_t, p: *const graphene_point_t, bounds: *const graphene_rect_t, res: *mut graphene_point_t, ) -> bool; //========================================================================= // graphene_plane_t //========================================================================= pub fn graphene_plane_get_type() -> GType; pub fn graphene_plane_alloc() -> *mut graphene_plane_t; pub fn graphene_plane_distance( p: *const graphene_plane_t, point: *const graphene_point3d_t, ) -> c_float; pub fn graphene_plane_equal(a: *const graphene_plane_t, b: *const graphene_plane_t) -> bool; pub fn graphene_plane_free(p: *mut graphene_plane_t); pub fn graphene_plane_get_constant(p: *const graphene_plane_t) -> c_float; pub fn graphene_plane_get_normal(p: *const graphene_plane_t, normal: *mut graphene_vec3_t); pub fn graphene_plane_init( p: *mut graphene_plane_t, normal: *const graphene_vec3_t, constant: c_float, ) -> *mut graphene_plane_t; pub fn graphene_plane_init_from_plane( p: *mut graphene_plane_t, src: *const graphene_plane_t, ) -> *mut graphene_plane_t; pub fn graphene_plane_init_from_point( p: *mut graphene_plane_t, normal: *const graphene_vec3_t, point: *const graphene_point3d_t, ) -> *mut graphene_plane_t; pub fn graphene_plane_init_from_points( p: *mut graphene_plane_t, a: *const graphene_point3d_t, b: *const graphene_point3d_t, c: *const graphene_point3d_t, ) -> *mut graphene_plane_t; pub fn graphene_plane_init_from_vec4( p: *mut graphene_plane_t, src: *const graphene_vec4_t, ) -> *mut graphene_plane_t; pub fn graphene_plane_negate(p: *const graphene_plane_t, res: *mut graphene_plane_t); pub fn graphene_plane_normalize(p: *const graphene_plane_t, res: *mut graphene_plane_t); pub fn graphene_plane_transform( p: *const graphene_plane_t, matrix: *const graphene_matrix_t, normal_matrix: *const graphene_matrix_t, res: *mut graphene_plane_t, ); //========================================================================= // graphene_point3d_t //========================================================================= pub fn graphene_point3d_get_type() -> GType; pub fn graphene_point3d_alloc() -> *mut graphene_point3d_t; pub fn graphene_point3d_cross( a: *const graphene_point3d_t, b: *const graphene_point3d_t, res: *mut graphene_point3d_t, ); pub fn graphene_point3d_distance( a: *const graphene_point3d_t, b: *const graphene_point3d_t, delta: *mut graphene_vec3_t, ) -> c_float; pub fn graphene_point3d_dot( a: *const graphene_point3d_t, b: *const graphene_point3d_t, ) -> c_float; pub fn graphene_point3d_equal( a: *const graphene_point3d_t, b: *const graphene_point3d_t, ) -> bool; pub fn graphene_point3d_free(p: *mut graphene_point3d_t); pub fn graphene_point3d_init( p: *mut graphene_point3d_t, x: c_float, y: c_float, z: c_float, ) -> *mut graphene_point3d_t; pub fn graphene_point3d_init_from_point( p: *mut graphene_point3d_t, src: *const graphene_point3d_t, ) -> *mut graphene_point3d_t; pub fn graphene_point3d_init_from_vec3( p: *mut graphene_point3d_t, v: *const graphene_vec3_t, ) -> *mut graphene_point3d_t; pub fn graphene_point3d_interpolate( a: *const graphene_point3d_t, b: *const graphene_point3d_t, factor: c_double, res: *mut graphene_point3d_t, ); pub fn graphene_point3d_length(p: *const graphene_point3d_t) -> c_float; pub fn graphene_point3d_near( a: *const graphene_point3d_t, b: *const graphene_point3d_t, epsilon: c_float, ) -> bool; pub fn graphene_point3d_normalize(p: *const graphene_point3d_t, res: *mut graphene_point3d_t); pub fn graphene_point3d_normalize_viewport( p: *const graphene_point3d_t, viewport: *const graphene_rect_t, z_near: c_float, z_far: c_float, res: *mut graphene_point3d_t, ); pub fn graphene_point3d_scale( p: *const graphene_point3d_t, factor: c_float, res: *mut graphene_point3d_t, ); pub fn graphene_point3d_to_vec3(p: *const graphene_point3d_t, v: *mut graphene_vec3_t); pub fn graphene_point3d_zero() -> *const graphene_point3d_t; //========================================================================= // graphene_point_t //========================================================================= pub fn graphene_point_get_type() -> GType; pub fn graphene_point_alloc() -> *mut graphene_point_t; pub fn graphene_point_distance( a: *const graphene_point_t, b: *const graphene_point_t, d_x: *mut c_float, d_y: *mut c_float, ) -> c_float; pub fn graphene_point_equal(a: *const graphene_point_t, b: *const graphene_point_t) -> bool; pub fn graphene_point_free(p: *mut graphene_point_t); pub fn graphene_point_init( p: *mut graphene_point_t, x: c_float, y: c_float, ) -> *mut graphene_point_t; pub fn graphene_point_init_from_point( p: *mut graphene_point_t, src: *const graphene_point_t, ) -> *mut graphene_point_t; pub fn graphene_point_init_from_vec2( p: *mut graphene_point_t, src: *const graphene_vec2_t, ) -> *mut graphene_point_t; pub fn graphene_point_interpolate( a: *const graphene_point_t, b: *const graphene_point_t, factor: c_double, res: *mut graphene_point_t, ); pub fn graphene_point_near( a: *const graphene_point_t, b: *const graphene_point_t, epsilon: c_float, ) -> bool; pub fn graphene_point_to_vec2(p: *const graphene_point_t, v: *mut graphene_vec2_t); pub fn graphene_point_zero() -> *const graphene_point_t; //========================================================================= // graphene_quad_t //========================================================================= pub fn graphene_quad_get_type() -> GType; pub fn graphene_quad_alloc() -> *mut graphene_quad_t; pub fn graphene_quad_bounds(q: *const graphene_quad_t, r: *mut graphene_rect_t); pub fn graphene_quad_contains(q: *const graphene_quad_t, p: *const graphene_point_t) -> bool; pub fn graphene_quad_free(q: *mut graphene_quad_t); pub fn graphene_quad_get_point( q: *const graphene_quad_t, index_: c_uint, ) -> *const graphene_point_t; pub fn graphene_quad_init( q: *mut graphene_quad_t, p1: *const graphene_point_t, p2: *const graphene_point_t, p3: *const graphene_point_t, p4: *const graphene_point_t, ) -> *mut graphene_quad_t; pub fn graphene_quad_init_from_points( q: *mut graphene_quad_t, points: *const [graphene_point_t; 4], ) -> *mut graphene_quad_t; pub fn graphene_quad_init_from_rect( q: *mut graphene_quad_t, r: *const graphene_rect_t, ) -> *mut graphene_quad_t; //========================================================================= // graphene_quaternion_t //========================================================================= pub fn graphene_quaternion_get_type() -> GType; pub fn graphene_quaternion_alloc() -> *mut graphene_quaternion_t; pub fn graphene_quaternion_add( a: *const graphene_quaternion_t, b: *const graphene_quaternion_t, res: *mut graphene_quaternion_t, ); pub fn graphene_quaternion_dot( a: *const graphene_quaternion_t, b: *const graphene_quaternion_t, ) -> c_float; pub fn graphene_quaternion_equal( a: *const graphene_quaternion_t, b: *const graphene_quaternion_t, ) -> bool; pub fn graphene_quaternion_free(q: *mut graphene_quaternion_t); pub fn graphene_quaternion_init( q: *mut graphene_quaternion_t, x: c_float, y: c_float, z: c_float, w: c_float, ) -> *mut graphene_quaternion_t; pub fn graphene_quaternion_init_from_angle_vec3( q: *mut graphene_quaternion_t, angle: c_float, axis: *const graphene_vec3_t, ) -> *mut graphene_quaternion_t; pub fn graphene_quaternion_init_from_angles( q: *mut graphene_quaternion_t, deg_x: c_float, deg_y: c_float, deg_z: c_float, ) -> *mut graphene_quaternion_t; pub fn graphene_quaternion_init_from_euler( q: *mut graphene_quaternion_t, e: *const graphene_euler_t, ) -> *mut graphene_quaternion_t; pub fn graphene_quaternion_init_from_matrix( q: *mut graphene_quaternion_t, m: *const graphene_matrix_t, ) -> *mut graphene_quaternion_t; pub fn graphene_quaternion_init_from_quaternion( q: *mut graphene_quaternion_t, src: *const graphene_quaternion_t, ) -> *mut graphene_quaternion_t; pub fn graphene_quaternion_init_from_radians( q: *mut graphene_quaternion_t, rad_x: c_float, rad_y: c_float, rad_z: c_float, ) -> *mut graphene_quaternion_t; pub fn graphene_quaternion_init_from_vec4( q: *mut graphene_quaternion_t, src: *const graphene_vec4_t, ) -> *mut graphene_quaternion_t; pub fn graphene_quaternion_init_identity( q: *mut graphene_quaternion_t, ) -> *mut graphene_quaternion_t; pub fn graphene_quaternion_invert( q: *const graphene_quaternion_t, res: *mut graphene_quaternion_t, ); pub fn graphene_quaternion_multiply( a: *const graphene_quaternion_t, b: *const graphene_quaternion_t, res: *mut graphene_quaternion_t, ); pub fn graphene_quaternion_normalize( q: *const graphene_quaternion_t, res: *mut graphene_quaternion_t, ); pub fn graphene_quaternion_scale( q: *const graphene_quaternion_t, factor: c_float, res: *mut graphene_quaternion_t, ); pub fn graphene_quaternion_slerp( a: *const graphene_quaternion_t, b: *const graphene_quaternion_t, factor: c_float, res: *mut graphene_quaternion_t, ); pub fn graphene_quaternion_to_angle_vec3( q: *const graphene_quaternion_t, angle: *mut c_float, axis: *mut graphene_vec3_t, ); pub fn graphene_quaternion_to_angles( q: *const graphene_quaternion_t, deg_x: *mut c_float, deg_y: *mut c_float, deg_z: *mut c_float, ); pub fn graphene_quaternion_to_matrix( q: *const graphene_quaternion_t, m: *mut graphene_matrix_t, ); pub fn graphene_quaternion_to_radians( q: *const graphene_quaternion_t, rad_x: *mut c_float, rad_y: *mut c_float, rad_z: *mut c_float, ); pub fn graphene_quaternion_to_vec4(q: *const graphene_quaternion_t, res: *mut graphene_vec4_t); //========================================================================= // graphene_ray_t //========================================================================= pub fn graphene_ray_get_type() -> GType; pub fn graphene_ray_alloc() -> *mut graphene_ray_t; pub fn graphene_ray_equal(a: *const graphene_ray_t, b: *const graphene_ray_t) -> bool; pub fn graphene_ray_free(r: *mut graphene_ray_t); pub fn graphene_ray_get_closest_point_to_point( r: *const graphene_ray_t, p: *const graphene_point3d_t, res: *mut graphene_point3d_t, ); pub fn graphene_ray_get_direction(r: *const graphene_ray_t, direction: *mut graphene_vec3_t); pub fn graphene_ray_get_distance_to_plane( r: *const graphene_ray_t, p: *const graphene_plane_t, ) -> c_float; pub fn graphene_ray_get_distance_to_point( r: *const graphene_ray_t, p: *const graphene_point3d_t, ) -> c_float; pub fn graphene_ray_get_origin(r: *const graphene_ray_t, origin: *mut graphene_point3d_t); pub fn graphene_ray_get_position_at( r: *const graphene_ray_t, t: c_float, position: *mut graphene_point3d_t, ); pub fn graphene_ray_init( r: *mut graphene_ray_t, origin: *const graphene_point3d_t, direction: *const graphene_vec3_t, ) -> *mut graphene_ray_t; pub fn graphene_ray_init_from_ray( r: *mut graphene_ray_t, src: *const graphene_ray_t, ) -> *mut graphene_ray_t; pub fn graphene_ray_init_from_vec3( r: *mut graphene_ray_t, origin: *const graphene_vec3_t, direction: *const graphene_vec3_t, ) -> *mut graphene_ray_t; pub fn graphene_ray_intersect_box( r: *const graphene_ray_t, b: *const graphene_box_t, t_out: *mut c_float, ) -> graphene_ray_intersection_kind_t; pub fn graphene_ray_intersect_sphere( r: *const graphene_ray_t, s: *const graphene_sphere_t, t_out: *mut c_float, ) -> graphene_ray_intersection_kind_t; pub fn graphene_ray_intersect_triangle( r: *const graphene_ray_t, t: *const graphene_triangle_t, t_out: *mut c_float, ) -> graphene_ray_intersection_kind_t; pub fn graphene_ray_intersects_box(r: *const graphene_ray_t, b: *const graphene_box_t) -> bool; pub fn graphene_ray_intersects_sphere( r: *const graphene_ray_t, s: *const graphene_sphere_t, ) -> bool; pub fn graphene_ray_intersects_triangle( r: *const graphene_ray_t, t: *const graphene_triangle_t, ) -> bool; //========================================================================= // graphene_rect_t //========================================================================= pub fn graphene_rect_get_type() -> GType; pub fn graphene_rect_contains_point( r: *const graphene_rect_t, p: *const graphene_point_t, ) -> bool; pub fn graphene_rect_contains_rect( a: *const graphene_rect_t, b: *const graphene_rect_t, ) -> bool; pub fn graphene_rect_equal(a: *const graphene_rect_t, b: *const graphene_rect_t) -> bool; pub fn graphene_rect_expand( r: *const graphene_rect_t, p: *const graphene_point_t, res: *mut graphene_rect_t, ); pub fn graphene_rect_free(r: *mut graphene_rect_t); pub fn graphene_rect_get_area(r: *const graphene_rect_t) -> c_float; pub fn graphene_rect_get_bottom_left(r: *const graphene_rect_t, p: *mut graphene_point_t); pub fn graphene_rect_get_bottom_right(r: *const graphene_rect_t, p: *mut graphene_point_t); pub fn graphene_rect_get_center(r: *const graphene_rect_t, p: *mut graphene_point_t); pub fn graphene_rect_get_height(r: *const graphene_rect_t) -> c_float; pub fn graphene_rect_get_top_left(r: *const graphene_rect_t, p: *mut graphene_point_t); pub fn graphene_rect_get_top_right(r: *const graphene_rect_t, p: *mut graphene_point_t); pub fn graphene_rect_get_vertices( r: *const graphene_rect_t, vertices: *mut [graphene_vec2_t; 4], ); pub fn graphene_rect_get_width(r: *const graphene_rect_t) -> c_float; pub fn graphene_rect_get_x(r: *const graphene_rect_t) -> c_float; pub fn graphene_rect_get_y(r: *const graphene_rect_t) -> c_float; pub fn graphene_rect_init( r: *mut graphene_rect_t, x: c_float, y: c_float, width: c_float, height: c_float, ) -> *mut graphene_rect_t; pub fn graphene_rect_init_from_rect( r: *mut graphene_rect_t, src: *const graphene_rect_t, ) -> *mut graphene_rect_t; pub fn graphene_rect_inset( r: *mut graphene_rect_t, d_x: c_float, d_y: c_float, ) -> *mut graphene_rect_t; pub fn graphene_rect_inset_r( r: *const graphene_rect_t, d_x: c_float, d_y: c_float, res: *mut graphene_rect_t, ); pub fn graphene_rect_interpolate( a: *const graphene_rect_t, b: *const graphene_rect_t, factor: c_double, res: *mut graphene_rect_t, ); pub fn graphene_rect_intersection( a: *const graphene_rect_t, b: *const graphene_rect_t, res: *mut graphene_rect_t, ) -> bool; pub fn graphene_rect_normalize(r: *mut graphene_rect_t) -> *mut graphene_rect_t; pub fn graphene_rect_normalize_r(r: *const graphene_rect_t, res: *mut graphene_rect_t); pub fn graphene_rect_offset( r: *mut graphene_rect_t, d_x: c_float, d_y: c_float, ) -> *mut graphene_rect_t; pub fn graphene_rect_offset_r( r: *const graphene_rect_t, d_x: c_float, d_y: c_float, res: *mut graphene_rect_t, ); pub fn graphene_rect_round(r: *const graphene_rect_t, res: *mut graphene_rect_t); pub fn graphene_rect_round_extents(r: *const graphene_rect_t, res: *mut graphene_rect_t); pub fn graphene_rect_round_to_pixel(r: *mut graphene_rect_t) -> *mut graphene_rect_t; pub fn graphene_rect_scale( r: *const graphene_rect_t, s_h: c_float, s_v: c_float, res: *mut graphene_rect_t, ); pub fn graphene_rect_union( a: *const graphene_rect_t, b: *const graphene_rect_t, res: *mut graphene_rect_t, ); pub fn graphene_rect_alloc() -> *mut graphene_rect_t; pub fn graphene_rect_zero() -> *const graphene_rect_t; //========================================================================= // graphene_size_t //========================================================================= pub fn graphene_size_get_type() -> GType; pub fn graphene_size_alloc() -> *mut graphene_size_t; pub fn graphene_size_equal(a: *const graphene_size_t, b: *const graphene_size_t) -> bool; pub fn graphene_size_free(s: *mut graphene_size_t); pub fn graphene_size_init( s: *mut graphene_size_t, width: c_float, height: c_float, ) -> *mut graphene_size_t; pub fn graphene_size_init_from_size( s: *mut graphene_size_t, src: *const graphene_size_t, ) -> *mut graphene_size_t; pub fn graphene_size_interpolate( a: *const graphene_size_t, b: *const graphene_size_t, factor: c_double, res: *mut graphene_size_t, ); pub fn graphene_size_scale( s: *const graphene_size_t, factor: c_float, res: *mut graphene_size_t, ); pub fn graphene_size_zero() -> *const graphene_size_t; //========================================================================= // graphene_sphere_t //========================================================================= pub fn graphene_sphere_get_type() -> GType; pub fn graphene_sphere_alloc() -> *mut graphene_sphere_t; pub fn graphene_sphere_contains_point( s: *const graphene_sphere_t, point: *const graphene_point3d_t, ) -> bool; pub fn graphene_sphere_distance( s: *const graphene_sphere_t, point: *const graphene_point3d_t, ) -> c_float; pub fn graphene_sphere_equal(a: *const graphene_sphere_t, b: *const graphene_sphere_t) -> bool; pub fn graphene_sphere_free(s: *mut graphene_sphere_t); pub fn graphene_sphere_get_bounding_box(s: *const graphene_sphere_t, box_: *mut graphene_box_t); pub fn graphene_sphere_get_center(s: *const graphene_sphere_t, center: *mut graphene_point3d_t); pub fn graphene_sphere_get_radius(s: *const graphene_sphere_t) -> c_float; pub fn graphene_sphere_init( s: *mut graphene_sphere_t, center: *const graphene_point3d_t, radius: c_float, ) -> *mut graphene_sphere_t; pub fn graphene_sphere_init_from_points( s: *mut graphene_sphere_t, n_points: c_uint, points: *const graphene_point3d_t, center: *const graphene_point3d_t, ) -> *mut graphene_sphere_t; pub fn graphene_sphere_init_from_vectors( s: *mut graphene_sphere_t, n_vectors: c_uint, vectors: *const graphene_vec3_t, center: *const graphene_point3d_t, ) -> *mut graphene_sphere_t; pub fn graphene_sphere_is_empty(s: *const graphene_sphere_t) -> bool; pub fn graphene_sphere_translate( s: *const graphene_sphere_t, point: *const graphene_point3d_t, res: *mut graphene_sphere_t, ); //========================================================================= // graphene_triangle_t //========================================================================= pub fn graphene_triangle_get_type() -> GType; pub fn graphene_triangle_alloc() -> *mut graphene_triangle_t; pub fn graphene_triangle_contains_point( t: *const graphene_triangle_t, p: *const graphene_point3d_t, ) -> bool; pub fn graphene_triangle_equal( a: *const graphene_triangle_t, b: *const graphene_triangle_t, ) -> bool; pub fn graphene_triangle_free(t: *mut graphene_triangle_t); pub fn graphene_triangle_get_area(t: *const graphene_triangle_t) -> c_float; pub fn graphene_triangle_get_barycoords( t: *const graphene_triangle_t, p: *const graphene_point3d_t, res: *mut graphene_vec2_t, ) -> bool; pub fn graphene_triangle_get_bounding_box( t: *const graphene_triangle_t, res: *mut graphene_box_t, ); pub fn graphene_triangle_get_midpoint( t: *const graphene_triangle_t, res: *mut graphene_point3d_t, ); pub fn graphene_triangle_get_normal(t: *const graphene_triangle_t, res: *mut graphene_vec3_t); pub fn graphene_triangle_get_plane(t: *const graphene_triangle_t, res: *mut graphene_plane_t); pub fn graphene_triangle_get_points( t: *const graphene_triangle_t, a: *mut graphene_point3d_t, b: *mut graphene_point3d_t, c: *mut graphene_point3d_t, ); pub fn graphene_triangle_get_uv( t: *const graphene_triangle_t, p: *const graphene_point3d_t, uv_a: *const graphene_vec2_t, uv_b: *const graphene_vec2_t, uv_c: *const graphene_vec2_t, res: *mut graphene_vec2_t, ) -> bool; pub fn graphene_triangle_get_vertices( t: *const graphene_triangle_t, a: *mut graphene_vec3_t, b: *mut graphene_vec3_t, c: *mut graphene_vec3_t, ); pub fn graphene_triangle_init_from_float( t: *mut graphene_triangle_t, a: *const [c_float; 3], b: *const [c_float; 3], c: *const [c_float; 3], ) -> *mut graphene_triangle_t; pub fn graphene_triangle_init_from_point3d( t: *mut graphene_triangle_t, a: *const graphene_point3d_t, b: *const graphene_point3d_t, c: *const graphene_point3d_t, ) -> *mut graphene_triangle_t; pub fn graphene_triangle_init_from_vec3( t: *mut graphene_triangle_t, a: *const graphene_vec3_t, b: *const graphene_vec3_t, c: *const graphene_vec3_t, ) -> *mut graphene_triangle_t; //========================================================================= // graphene_vec2_t //========================================================================= pub fn graphene_vec2_get_type() -> GType; pub fn graphene_vec2_alloc() -> *mut graphene_vec2_t; pub fn graphene_vec2_add( a: *const graphene_vec2_t, b: *const graphene_vec2_t, res: *mut graphene_vec2_t, ); pub fn graphene_vec2_divide( a: *const graphene_vec2_t, b: *const graphene_vec2_t, res: *mut graphene_vec2_t, ); pub fn graphene_vec2_dot(a: *const graphene_vec2_t, b: *const graphene_vec2_t) -> c_float; pub fn graphene_vec2_equal(v1: *const graphene_vec2_t, v2: *const graphene_vec2_t) -> bool; pub fn graphene_vec2_free(v: *mut graphene_vec2_t); pub fn graphene_vec2_get_x(v: *const graphene_vec2_t) -> c_float; pub fn graphene_vec2_get_y(v: *const graphene_vec2_t) -> c_float; pub fn graphene_vec2_init( v: *mut graphene_vec2_t, x: c_float, y: c_float, ) -> *mut graphene_vec2_t; pub fn graphene_vec2_init_from_float( v: *mut graphene_vec2_t, src: *const [c_float; 2], ) -> *mut graphene_vec2_t; pub fn graphene_vec2_init_from_vec2( v: *mut graphene_vec2_t, src: *const graphene_vec2_t, ) -> *mut graphene_vec2_t; pub fn graphene_vec2_interpolate( v1: *const graphene_vec2_t, v2: *const graphene_vec2_t, factor: c_double, res: *mut graphene_vec2_t, ); pub fn graphene_vec2_length(v: *const graphene_vec2_t) -> c_float; pub fn graphene_vec2_max( a: *const graphene_vec2_t, b: *const graphene_vec2_t, res: *mut graphene_vec2_t, ); pub fn graphene_vec2_min( a: *const graphene_vec2_t, b: *const graphene_vec2_t, res: *mut graphene_vec2_t, ); pub fn graphene_vec2_multiply( a: *const graphene_vec2_t, b: *const graphene_vec2_t, res: *mut graphene_vec2_t, ); pub fn graphene_vec2_near( v1: *const graphene_vec2_t, v2: *const graphene_vec2_t, epsilon: c_float, ) -> bool; pub fn graphene_vec2_negate(v: *const graphene_vec2_t, res: *mut graphene_vec2_t); pub fn graphene_vec2_normalize(v: *const graphene_vec2_t, res: *mut graphene_vec2_t); pub fn graphene_vec2_scale( v: *const graphene_vec2_t, factor: c_float, res: *mut graphene_vec2_t, ); pub fn graphene_vec2_subtract( a: *const graphene_vec2_t, b: *const graphene_vec2_t, res: *mut graphene_vec2_t, ); pub fn graphene_vec2_to_float(v: *const graphene_vec2_t, dest: *mut [c_float; 2]); pub fn graphene_vec2_one() -> *const graphene_vec2_t; pub fn graphene_vec2_x_axis() -> *const graphene_vec2_t; pub fn graphene_vec2_y_axis() -> *const graphene_vec2_t; pub fn graphene_vec2_zero() -> *const graphene_vec2_t; //========================================================================= // graphene_vec3_t //========================================================================= pub fn graphene_vec3_get_type() -> GType; pub fn graphene_vec3_alloc() -> *mut graphene_vec3_t; pub fn graphene_vec3_add( a: *const graphene_vec3_t, b: *const graphene_vec3_t, res: *mut graphene_vec3_t, ); pub fn graphene_vec3_cross( a: *const graphene_vec3_t, b: *const graphene_vec3_t, res: *mut graphene_vec3_t, ); pub fn graphene_vec3_divide( a: *const graphene_vec3_t, b: *const graphene_vec3_t, res: *mut graphene_vec3_t, ); pub fn graphene_vec3_dot(a: *const graphene_vec3_t, b: *const graphene_vec3_t) -> c_float; pub fn graphene_vec3_equal(v1: *const graphene_vec3_t, v2: *const graphene_vec3_t) -> bool; pub fn graphene_vec3_free(v: *mut graphene_vec3_t); pub fn graphene_vec3_get_x(v: *const graphene_vec3_t) -> c_float; pub fn graphene_vec3_get_xy(v: *const graphene_vec3_t, res: *mut graphene_vec2_t); pub fn graphene_vec3_get_xy0(v: *const graphene_vec3_t, res: *mut graphene_vec3_t); pub fn graphene_vec3_get_xyz0(v: *const graphene_vec3_t, res: *mut graphene_vec4_t); pub fn graphene_vec3_get_xyz1(v: *const graphene_vec3_t, res: *mut graphene_vec4_t); pub fn graphene_vec3_get_xyzw(v: *const graphene_vec3_t, w: c_float, res: *mut graphene_vec4_t); pub fn graphene_vec3_get_y(v: *const graphene_vec3_t) -> c_float; pub fn graphene_vec3_get_z(v: *const graphene_vec3_t) -> c_float; pub fn graphene_vec3_init( v: *mut graphene_vec3_t, x: c_float, y: c_float, z: c_float, ) -> *mut graphene_vec3_t; pub fn graphene_vec3_init_from_float( v: *mut graphene_vec3_t, src: *const [c_float; 3], ) -> *mut graphene_vec3_t; pub fn graphene_vec3_init_from_vec3( v: *mut graphene_vec3_t, src: *const graphene_vec3_t, ) -> *mut graphene_vec3_t; pub fn graphene_vec3_interpolate( v1: *const graphene_vec3_t, v2: *const graphene_vec3_t, factor: c_double, res: *mut graphene_vec3_t, ); pub fn graphene_vec3_length(v: *const graphene_vec3_t) -> c_float; pub fn graphene_vec3_max( a: *const graphene_vec3_t, b: *const graphene_vec3_t, res: *mut graphene_vec3_t, ); pub fn graphene_vec3_min( a: *const graphene_vec3_t, b: *const graphene_vec3_t, res: *mut graphene_vec3_t, ); pub fn graphene_vec3_multiply( a: *const graphene_vec3_t, b: *const graphene_vec3_t, res: *mut graphene_vec3_t, ); pub fn graphene_vec3_near( v1: *const graphene_vec3_t, v2: *const graphene_vec3_t, epsilon: c_float, ) -> bool; pub fn graphene_vec3_negate(v: *const graphene_vec3_t, res: *mut graphene_vec3_t); pub fn graphene_vec3_normalize(v: *const graphene_vec3_t, res: *mut graphene_vec3_t); pub fn graphene_vec3_scale( v: *const graphene_vec3_t, factor: c_float, res: *mut graphene_vec3_t, ); pub fn graphene_vec3_subtract( a: *const graphene_vec3_t, b: *const graphene_vec3_t, res: *mut graphene_vec3_t, ); pub fn graphene_vec3_to_float(v: *const graphene_vec3_t, dest: *mut [c_float; 3]); pub fn graphene_vec3_one() -> *const graphene_vec3_t; pub fn graphene_vec3_x_axis() -> *const graphene_vec3_t; pub fn graphene_vec3_y_axis() -> *const graphene_vec3_t; pub fn graphene_vec3_z_axis() -> *const graphene_vec3_t; pub fn graphene_vec3_zero() -> *const graphene_vec3_t; //========================================================================= // graphene_vec4_t //========================================================================= pub fn graphene_vec4_get_type() -> GType; pub fn graphene_vec4_alloc() -> *mut graphene_vec4_t; pub fn graphene_vec4_add( a: *const graphene_vec4_t, b: *const graphene_vec4_t, res: *mut graphene_vec4_t, ); pub fn graphene_vec4_divide( a: *const graphene_vec4_t, b: *const graphene_vec4_t, res: *mut graphene_vec4_t, ); pub fn graphene_vec4_dot(a: *const graphene_vec4_t, b: *const graphene_vec4_t) -> c_float; pub fn graphene_vec4_equal(v1: *const graphene_vec4_t, v2: *const graphene_vec4_t) -> bool; pub fn graphene_vec4_free(v: *mut graphene_vec4_t); pub fn graphene_vec4_get_w(v: *const graphene_vec4_t) -> c_float; pub fn graphene_vec4_get_x(v: *const graphene_vec4_t) -> c_float; pub fn graphene_vec4_get_xy(v: *const graphene_vec4_t, res: *mut graphene_vec2_t); pub fn graphene_vec4_get_xyz(v: *const graphene_vec4_t, res: *mut graphene_vec3_t); pub fn graphene_vec4_get_y(v: *const graphene_vec4_t) -> c_float; pub fn graphene_vec4_get_z(v: *const graphene_vec4_t) -> c_float; pub fn graphene_vec4_init( v: *mut graphene_vec4_t, x: c_float, y: c_float, z: c_float, w: c_float, ) -> *mut graphene_vec4_t; pub fn graphene_vec4_init_from_float( v: *mut graphene_vec4_t, src: *const [c_float; 4], ) -> *mut graphene_vec4_t; pub fn graphene_vec4_init_from_vec2( v: *mut graphene_vec4_t, src: *const graphene_vec2_t, z: c_float, w: c_float, ) -> *mut graphene_vec4_t; pub fn graphene_vec4_init_from_vec3( v: *mut graphene_vec4_t, src: *const graphene_vec3_t, w: c_float, ) -> *mut graphene_vec4_t; pub fn graphene_vec4_init_from_vec4( v: *mut graphene_vec4_t, src: *const graphene_vec4_t, ) -> *mut graphene_vec4_t; pub fn graphene_vec4_interpolate( v1: *const graphene_vec4_t, v2: *const graphene_vec4_t, factor: c_double, res: *mut graphene_vec4_t, ); pub fn graphene_vec4_length(v: *const graphene_vec4_t) -> c_float; pub fn graphene_vec4_max( a: *const graphene_vec4_t, b: *const graphene_vec4_t, res: *mut graphene_vec4_t, ); pub fn graphene_vec4_min( a: *const graphene_vec4_t, b: *const graphene_vec4_t, res: *mut graphene_vec4_t, ); pub fn graphene_vec4_multiply( a: *const graphene_vec4_t, b: *const graphene_vec4_t, res: *mut graphene_vec4_t, ); pub fn graphene_vec4_near( v1: *const graphene_vec4_t, v2: *const graphene_vec4_t, epsilon: c_float, ) -> bool; pub fn graphene_vec4_negate(v: *const graphene_vec4_t, res: *mut graphene_vec4_t); pub fn graphene_vec4_normalize(v: *const graphene_vec4_t, res: *mut graphene_vec4_t); pub fn graphene_vec4_scale( v: *const graphene_vec4_t, factor: c_float, res: *mut graphene_vec4_t, ); pub fn graphene_vec4_subtract( a: *const graphene_vec4_t, b: *const graphene_vec4_t, res: *mut graphene_vec4_t, ); pub fn graphene_vec4_to_float(v: *const graphene_vec4_t, dest: *mut [c_float; 4]); pub fn graphene_vec4_one() -> *const graphene_vec4_t; pub fn graphene_vec4_w_axis() -> *const graphene_vec4_t; pub fn graphene_vec4_x_axis() -> *const graphene_vec4_t; pub fn graphene_vec4_y_axis() -> *const graphene_vec4_t; pub fn graphene_vec4_z_axis() -> *const graphene_vec4_t; pub fn graphene_vec4_zero() -> *const graphene_vec4_t; } graphene-sys-0.20.7/tests/abi.rs000064400000000000000000000267161046102023000145760ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT #![cfg(unix)] use graphene_sys::*; use std::env; use std::error::Error; use std::ffi::OsString; use std::mem::{align_of, size_of}; use std::path::Path; use std::process::{Command, Stdio}; use std::str; use tempfile::Builder; static PACKAGES: &[&str] = &["graphene-gobject-1.0"]; #[derive(Clone, Debug)] struct Compiler { pub args: Vec, } impl Compiler { pub fn new() -> Result> { let mut args = get_var("CC", "cc")?; args.push("-Wno-deprecated-declarations".to_owned()); // For _Generic args.push("-std=c11".to_owned()); // For %z support in printf when using MinGW. args.push("-D__USE_MINGW_ANSI_STDIO".to_owned()); args.extend(get_var("CFLAGS", "")?); args.extend(get_var("CPPFLAGS", "")?); args.extend(pkg_config_cflags(PACKAGES)?); Ok(Self { args }) } pub fn compile(&self, src: &Path, out: &Path) -> Result<(), Box> { let mut cmd = self.to_command(); cmd.arg(src); cmd.arg("-o"); cmd.arg(out); let status = cmd.spawn()?.wait()?; if !status.success() { return Err(format!("compilation command {cmd:?} failed, {status}").into()); } Ok(()) } fn to_command(&self) -> Command { let mut cmd = Command::new(&self.args[0]); cmd.args(&self.args[1..]); cmd } } fn get_var(name: &str, default: &str) -> Result, Box> { match env::var(name) { Ok(value) => Ok(shell_words::split(&value)?), Err(env::VarError::NotPresent) => Ok(shell_words::split(default)?), Err(err) => Err(format!("{name} {err}").into()), } } fn pkg_config_cflags(packages: &[&str]) -> Result, Box> { if packages.is_empty() { return Ok(Vec::new()); } let pkg_config = env::var_os("PKG_CONFIG").unwrap_or_else(|| OsString::from("pkg-config")); let mut cmd = Command::new(pkg_config); cmd.arg("--cflags"); cmd.args(packages); cmd.stderr(Stdio::inherit()); let out = cmd.output()?; if !out.status.success() { let (status, stdout) = (out.status, String::from_utf8_lossy(&out.stdout)); return Err(format!("command {cmd:?} failed, {status:?}\nstdout: {stdout}").into()); } let stdout = str::from_utf8(&out.stdout)?; Ok(shell_words::split(stdout.trim())?) } #[derive(Copy, Clone, Debug, Eq, PartialEq)] struct Layout { size: usize, alignment: usize, } #[derive(Copy, Clone, Debug, Default, Eq, PartialEq)] struct Results { /// Number of successfully completed tests. passed: usize, /// Total number of failed tests (including those that failed to compile). failed: usize, } impl Results { fn record_passed(&mut self) { self.passed += 1; } fn record_failed(&mut self) { self.failed += 1; } fn summary(&self) -> String { format!("{} passed; {} failed", self.passed, self.failed) } fn expect_total_success(&self) { if self.failed == 0 { println!("OK: {}", self.summary()); } else { panic!("FAILED: {}", self.summary()); }; } } #[test] fn cross_validate_constants_with_c() { let mut c_constants: Vec<(String, String)> = Vec::new(); for l in get_c_output("constant").unwrap().lines() { let (name, value) = l.split_once(';').expect("Missing ';' separator"); c_constants.push((name.to_owned(), value.to_owned())); } let mut results = Results::default(); for ((rust_name, rust_value), (c_name, c_value)) in RUST_CONSTANTS.iter().zip(c_constants.iter()) { if rust_name != c_name { results.record_failed(); eprintln!("Name mismatch:\nRust: {rust_name:?}\nC: {c_name:?}"); continue; } if rust_value != c_value { results.record_failed(); eprintln!( "Constant value mismatch for {rust_name}\nRust: {rust_value:?}\nC: {c_value:?}", ); continue; } results.record_passed(); } results.expect_total_success(); } #[test] fn cross_validate_layout_with_c() { let mut c_layouts = Vec::new(); for l in get_c_output("layout").unwrap().lines() { let (name, value) = l.split_once(';').expect("Missing first ';' separator"); let (size, alignment) = value.split_once(';').expect("Missing second ';' separator"); let size = size.parse().expect("Failed to parse size"); let alignment = alignment.parse().expect("Failed to parse alignment"); c_layouts.push((name.to_owned(), Layout { size, alignment })); } let mut results = Results::default(); for ((rust_name, rust_layout), (c_name, c_layout)) in RUST_LAYOUTS.iter().zip(c_layouts.iter()) { if rust_name != c_name { results.record_failed(); eprintln!("Name mismatch:\nRust: {rust_name:?}\nC: {c_name:?}"); continue; } if rust_layout != c_layout { results.record_failed(); eprintln!("Layout mismatch for {rust_name}\nRust: {rust_layout:?}\nC: {c_layout:?}",); continue; } results.record_passed(); } results.expect_total_success(); } fn get_c_output(name: &str) -> Result> { let tmpdir = Builder::new().prefix("abi").tempdir()?; let exe = tmpdir.path().join(name); let c_file = Path::new("tests").join(name).with_extension("c"); let cc = Compiler::new().expect("configured compiler"); cc.compile(&c_file, &exe)?; let mut cmd = Command::new(exe); cmd.stderr(Stdio::inherit()); let out = cmd.output()?; if !out.status.success() { let (status, stdout) = (out.status, String::from_utf8_lossy(&out.stdout)); return Err(format!("command {cmd:?} failed, {status:?}\nstdout: {stdout}").into()); } Ok(String::from_utf8(out.stdout)?) } const RUST_LAYOUTS: &[(&str, Layout)] = &[ ( "graphene_box_t", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "graphene_euler_order_t", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "graphene_euler_t", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "graphene_frustum_t", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "graphene_matrix_t", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "graphene_plane_t", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "graphene_point3d_t", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "graphene_point_t", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "graphene_quad_t", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "graphene_quaternion_t", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "graphene_ray_intersection_kind_t", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "graphene_ray_t", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "graphene_rect_t", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "graphene_simd4f_t", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "graphene_simd4x4f_t", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "graphene_size_t", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "graphene_sphere_t", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "graphene_triangle_t", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "graphene_vec2_t", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "graphene_vec3_t", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "graphene_vec4_t", Layout { size: size_of::(), alignment: align_of::(), }, ), ]; const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(gint) GRAPHENE_EULER_ORDER_DEFAULT", "-1"), ("(gint) GRAPHENE_EULER_ORDER_RXYX", "19"), ("(gint) GRAPHENE_EULER_ORDER_RXYZ", "28"), ("(gint) GRAPHENE_EULER_ORDER_RXZX", "21"), ("(gint) GRAPHENE_EULER_ORDER_RXZY", "22"), ("(gint) GRAPHENE_EULER_ORDER_RYXY", "25"), ("(gint) GRAPHENE_EULER_ORDER_RYXZ", "26"), ("(gint) GRAPHENE_EULER_ORDER_RYZX", "20"), ("(gint) GRAPHENE_EULER_ORDER_RYZY", "23"), ("(gint) GRAPHENE_EULER_ORDER_RZXY", "24"), ("(gint) GRAPHENE_EULER_ORDER_RZXZ", "27"), ("(gint) GRAPHENE_EULER_ORDER_RZYX", "18"), ("(gint) GRAPHENE_EULER_ORDER_RZYZ", "29"), ("(gint) GRAPHENE_EULER_ORDER_SXYX", "7"), ("(gint) GRAPHENE_EULER_ORDER_SXYZ", "6"), ("(gint) GRAPHENE_EULER_ORDER_SXZX", "9"), ("(gint) GRAPHENE_EULER_ORDER_SXZY", "8"), ("(gint) GRAPHENE_EULER_ORDER_SYXY", "13"), ("(gint) GRAPHENE_EULER_ORDER_SYXZ", "12"), ("(gint) GRAPHENE_EULER_ORDER_SYZX", "10"), ("(gint) GRAPHENE_EULER_ORDER_SYZY", "11"), ("(gint) GRAPHENE_EULER_ORDER_SZXY", "14"), ("(gint) GRAPHENE_EULER_ORDER_SZXZ", "15"), ("(gint) GRAPHENE_EULER_ORDER_SZYX", "16"), ("(gint) GRAPHENE_EULER_ORDER_SZYZ", "17"), ("(gint) GRAPHENE_EULER_ORDER_XYZ", "0"), ("(gint) GRAPHENE_EULER_ORDER_XZY", "3"), ("(gint) GRAPHENE_EULER_ORDER_YXZ", "4"), ("(gint) GRAPHENE_EULER_ORDER_YZX", "1"), ("(gint) GRAPHENE_EULER_ORDER_ZXY", "2"), ("(gint) GRAPHENE_EULER_ORDER_ZYX", "5"), ("(gint) GRAPHENE_RAY_INTERSECTION_KIND_ENTER", "1"), ("(gint) GRAPHENE_RAY_INTERSECTION_KIND_LEAVE", "2"), ("(gint) GRAPHENE_RAY_INTERSECTION_KIND_NONE", "0"), ("GRAPHENE_VEC2_LEN", "2"), ("GRAPHENE_VEC3_LEN", "3"), ("GRAPHENE_VEC4_LEN", "4"), ]; graphene-sys-0.20.7/tests/constant.c000064400000000000000000000056711046102023000154670ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT #include "manual.h" #include #define PRINT_CONSTANT(CONSTANT_NAME) \ printf("%s;", #CONSTANT_NAME); \ printf(_Generic((CONSTANT_NAME), \ char *: "%s", \ const char *: "%s", \ char: "%c", \ signed char: "%hhd", \ unsigned char: "%hhu", \ short int: "%hd", \ unsigned short int: "%hu", \ int: "%d", \ unsigned int: "%u", \ long: "%ld", \ unsigned long: "%lu", \ long long: "%lld", \ unsigned long long: "%llu", \ float: "%f", \ double: "%f", \ long double: "%ld"), \ CONSTANT_NAME); \ printf("\n"); int main() { PRINT_CONSTANT((gint) GRAPHENE_EULER_ORDER_DEFAULT); PRINT_CONSTANT((gint) GRAPHENE_EULER_ORDER_RXYX); PRINT_CONSTANT((gint) GRAPHENE_EULER_ORDER_RXYZ); PRINT_CONSTANT((gint) GRAPHENE_EULER_ORDER_RXZX); PRINT_CONSTANT((gint) GRAPHENE_EULER_ORDER_RXZY); PRINT_CONSTANT((gint) GRAPHENE_EULER_ORDER_RYXY); PRINT_CONSTANT((gint) GRAPHENE_EULER_ORDER_RYXZ); PRINT_CONSTANT((gint) GRAPHENE_EULER_ORDER_RYZX); PRINT_CONSTANT((gint) GRAPHENE_EULER_ORDER_RYZY); PRINT_CONSTANT((gint) GRAPHENE_EULER_ORDER_RZXY); PRINT_CONSTANT((gint) GRAPHENE_EULER_ORDER_RZXZ); PRINT_CONSTANT((gint) GRAPHENE_EULER_ORDER_RZYX); PRINT_CONSTANT((gint) GRAPHENE_EULER_ORDER_RZYZ); PRINT_CONSTANT((gint) GRAPHENE_EULER_ORDER_SXYX); PRINT_CONSTANT((gint) GRAPHENE_EULER_ORDER_SXYZ); PRINT_CONSTANT((gint) GRAPHENE_EULER_ORDER_SXZX); PRINT_CONSTANT((gint) GRAPHENE_EULER_ORDER_SXZY); PRINT_CONSTANT((gint) GRAPHENE_EULER_ORDER_SYXY); PRINT_CONSTANT((gint) GRAPHENE_EULER_ORDER_SYXZ); PRINT_CONSTANT((gint) GRAPHENE_EULER_ORDER_SYZX); PRINT_CONSTANT((gint) GRAPHENE_EULER_ORDER_SYZY); PRINT_CONSTANT((gint) GRAPHENE_EULER_ORDER_SZXY); PRINT_CONSTANT((gint) GRAPHENE_EULER_ORDER_SZXZ); PRINT_CONSTANT((gint) GRAPHENE_EULER_ORDER_SZYX); PRINT_CONSTANT((gint) GRAPHENE_EULER_ORDER_SZYZ); PRINT_CONSTANT((gint) GRAPHENE_EULER_ORDER_XYZ); PRINT_CONSTANT((gint) GRAPHENE_EULER_ORDER_XZY); PRINT_CONSTANT((gint) GRAPHENE_EULER_ORDER_YXZ); PRINT_CONSTANT((gint) GRAPHENE_EULER_ORDER_YZX); PRINT_CONSTANT((gint) GRAPHENE_EULER_ORDER_ZXY); PRINT_CONSTANT((gint) GRAPHENE_EULER_ORDER_ZYX); PRINT_CONSTANT((gint) GRAPHENE_RAY_INTERSECTION_KIND_ENTER); PRINT_CONSTANT((gint) GRAPHENE_RAY_INTERSECTION_KIND_LEAVE); PRINT_CONSTANT((gint) GRAPHENE_RAY_INTERSECTION_KIND_NONE); PRINT_CONSTANT(GRAPHENE_VEC2_LEN); PRINT_CONSTANT(GRAPHENE_VEC3_LEN); PRINT_CONSTANT(GRAPHENE_VEC4_LEN); return 0; } graphene-sys-0.20.7/tests/layout.c000064400000000000000000000046101046102023000151430ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT #include "manual.h" #include #include int main() { printf("%s;%zu;%zu\n", "graphene_box_t", sizeof(graphene_box_t), alignof(graphene_box_t)); printf("%s;%zu;%zu\n", "graphene_euler_order_t", sizeof(graphene_euler_order_t), alignof(graphene_euler_order_t)); printf("%s;%zu;%zu\n", "graphene_euler_t", sizeof(graphene_euler_t), alignof(graphene_euler_t)); printf("%s;%zu;%zu\n", "graphene_frustum_t", sizeof(graphene_frustum_t), alignof(graphene_frustum_t)); printf("%s;%zu;%zu\n", "graphene_matrix_t", sizeof(graphene_matrix_t), alignof(graphene_matrix_t)); printf("%s;%zu;%zu\n", "graphene_plane_t", sizeof(graphene_plane_t), alignof(graphene_plane_t)); printf("%s;%zu;%zu\n", "graphene_point3d_t", sizeof(graphene_point3d_t), alignof(graphene_point3d_t)); printf("%s;%zu;%zu\n", "graphene_point_t", sizeof(graphene_point_t), alignof(graphene_point_t)); printf("%s;%zu;%zu\n", "graphene_quad_t", sizeof(graphene_quad_t), alignof(graphene_quad_t)); printf("%s;%zu;%zu\n", "graphene_quaternion_t", sizeof(graphene_quaternion_t), alignof(graphene_quaternion_t)); printf("%s;%zu;%zu\n", "graphene_ray_intersection_kind_t", sizeof(graphene_ray_intersection_kind_t), alignof(graphene_ray_intersection_kind_t)); printf("%s;%zu;%zu\n", "graphene_ray_t", sizeof(graphene_ray_t), alignof(graphene_ray_t)); printf("%s;%zu;%zu\n", "graphene_rect_t", sizeof(graphene_rect_t), alignof(graphene_rect_t)); printf("%s;%zu;%zu\n", "graphene_simd4f_t", sizeof(graphene_simd4f_t), alignof(graphene_simd4f_t)); printf("%s;%zu;%zu\n", "graphene_simd4x4f_t", sizeof(graphene_simd4x4f_t), alignof(graphene_simd4x4f_t)); printf("%s;%zu;%zu\n", "graphene_size_t", sizeof(graphene_size_t), alignof(graphene_size_t)); printf("%s;%zu;%zu\n", "graphene_sphere_t", sizeof(graphene_sphere_t), alignof(graphene_sphere_t)); printf("%s;%zu;%zu\n", "graphene_triangle_t", sizeof(graphene_triangle_t), alignof(graphene_triangle_t)); printf("%s;%zu;%zu\n", "graphene_vec2_t", sizeof(graphene_vec2_t), alignof(graphene_vec2_t)); printf("%s;%zu;%zu\n", "graphene_vec3_t", sizeof(graphene_vec3_t), alignof(graphene_vec3_t)); printf("%s;%zu;%zu\n", "graphene_vec4_t", sizeof(graphene_vec4_t), alignof(graphene_vec4_t)); return 0; } graphene-sys-0.20.7/tests/manual.h000064400000000000000000000001701046102023000151050ustar 00000000000000// Feel free to edit this file, it won't be regenerated by gir generator unless removed. #include graphene-sys-0.20.7/versions.txt000064400000000000000000000002041046102023000147240ustar 00000000000000Generated by gir (https://github.com/gtk-rs/gir @ e06125dad46a) from gir-files (https://github.com/gtk-rs/gir-files @ 01066bc7d926)