libshumate-sys-0.7.0/.cargo_vcs_info.json0000644000000001540000000000100140110ustar { "git": { "sha1": "c79a7738e14f11f206c4e74e833f20d74198ee78" }, "path_in_vcs": "libshumate/sys" }libshumate-sys-0.7.0/Cargo.lock0000644000000271310000000000100117700ustar # This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 4 [[package]] name = "bitflags" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "cairo-sys-rs" version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cab7e9f13c802625aad1ad2b4ae3989f4ce9339ff388f335a6f109f9338705e2" dependencies = [ "libc", "system-deps", ] [[package]] name = "cfg-expr" version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d0390889d58f934f01cd49736275b4c2da15bcfc328c78ff2349907e6cabf22" dependencies = [ "smallvec", "target-lexicon", ] [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "equivalent" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "fastrand" version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" dependencies = [ "instant", ] [[package]] name = "gdk-pixbuf-sys" version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5af1823d3d1cb72616873ba0a593bd440eb92da700fdfb047505a21ee3ec3e10" dependencies = [ "gio-sys", "glib-sys", "gobject-sys", "libc", "system-deps", ] [[package]] name = "gdk4-sys" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2edbda0d879eb85317bdb49a3da591ed70a804a10776e358ef416be38c6db2c5" dependencies = [ "cairo-sys-rs", "gdk-pixbuf-sys", "gio-sys", "glib-sys", "gobject-sys", "libc", "pango-sys", "pkg-config", "system-deps", ] [[package]] name = "gio-sys" version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c8130f5810a839d74afc3a929c34a700bf194972bb034f2ecfe639682dd13cc" dependencies = [ "glib-sys", "gobject-sys", "libc", "system-deps", "windows-sys", ] [[package]] name = "glib-sys" version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b2be4c74454fb4a6bd3328320737d0fa3d6939e2d570f5d846da00cb222f6a0" dependencies = [ "libc", "system-deps", ] [[package]] name = "gobject-sys" version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab318a786f9abd49d388013b9161fa0ef8218ea6118ee7111c95e62186f7d31f" dependencies = [ "glib-sys", "libc", "system-deps", ] [[package]] name = "graphene-sys" version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "270cefb6b270fcb2ef9708c3a35c0e25c2e831dac28d75c4f87e5ad3540c9543" dependencies = [ "glib-sys", "libc", "pkg-config", "system-deps", ] [[package]] name = "gsk4-sys" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d76011d55dd19fde16ffdedee08877ae6ec942818cfa7bc08a91259bc0b9fc9" dependencies = [ "cairo-sys-rs", "gdk4-sys", "glib-sys", "gobject-sys", "graphene-sys", "libc", "pango-sys", "system-deps", ] [[package]] name = "gtk4-sys" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a923bdcf00e46723801162de24432cbce38a6810e0178a2d0b6dd4ecc26a1c74" dependencies = [ "cairo-sys-rs", "gdk-pixbuf-sys", "gdk4-sys", "gio-sys", "glib-sys", "gobject-sys", "graphene-sys", "gsk4-sys", "libc", "pango-sys", "system-deps", ] [[package]] name = "hashbrown" version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" [[package]] name = "heck" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "indexmap" version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" dependencies = [ "equivalent", "hashbrown", ] [[package]] name = "instant" version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if", ] [[package]] name = "libc" version = "0.2.133" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0f80d65747a3e43d1596c7c5492d95d5edddaabd45a7fcdb02b95f644164966" [[package]] name = "libshumate-sys" version = "0.7.0" dependencies = [ "gdk-pixbuf-sys", "gdk4-sys", "gio-sys", "glib-sys", "gobject-sys", "gtk4-sys", "libc", "shell-words", "system-deps", "tempfile", ] [[package]] name = "memchr" version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] name = "pango-sys" version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "66872b3cfd328ad6d1a4f89ebd5357119bd4c592a4ddbb8f6bc2386f8ce7b898" dependencies = [ "glib-sys", "gobject-sys", "libc", "system-deps", ] [[package]] name = "pkg-config" version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "redox_syscall" version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ "bitflags", ] [[package]] name = "remove_dir_all" version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" dependencies = [ "winapi", ] [[package]] name = "serde" version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b" [[package]] name = "serde_spanned" version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" dependencies = [ "serde", ] [[package]] name = "shell-words" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" [[package]] name = "smallvec" version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "system-deps" version = "7.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4be53aa0cba896d2dc615bd42bbc130acdcffa239e0a2d965ea5b3b2a86ffdb" dependencies = [ "cfg-expr", "heck", "pkg-config", "toml", "version-compare", ] [[package]] name = "target-lexicon" version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e502f78cdbb8ba4718f566c418c52bc729126ffd16baee5baa718cf25dd5a69a" [[package]] name = "tempfile" version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" dependencies = [ "cfg-if", "fastrand", "libc", "redox_syscall", "remove_dir_all", "winapi", ] [[package]] name = "toml" version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" dependencies = [ "serde", "serde_spanned", "toml_datetime", "toml_edit", ] [[package]] name = "toml_datetime" version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" dependencies = [ "serde", ] [[package]] name = "toml_edit" version = "0.22.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" dependencies = [ "indexmap", "serde", "serde_spanned", "toml_datetime", "winnow", ] [[package]] name = "version-compare" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b" [[package]] name = "winapi" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" dependencies = [ "winapi-i686-pc-windows-gnu", "winapi-x86_64-pc-windows-gnu", ] [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-sys" version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" dependencies = [ "windows-targets", ] [[package]] name = "windows-targets" version = "0.53.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", "windows_i686_gnu", "windows_i686_gnullvm", "windows_i686_msvc", "windows_x86_64_gnu", "windows_x86_64_gnullvm", "windows_x86_64_msvc", ] [[package]] name = "windows_aarch64_gnullvm" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" [[package]] name = "windows_aarch64_msvc" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" [[package]] name = "windows_i686_gnu" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" [[package]] name = "windows_i686_gnullvm" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" [[package]] name = "windows_i686_msvc" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" [[package]] name = "windows_x86_64_gnu" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" [[package]] name = "windows_x86_64_gnullvm" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" [[package]] name = "windows_x86_64_msvc" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" [[package]] name = "winnow" version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3edebf492c8125044983378ecb5766203ad3b4c2f7a922bd7dd207f6d443e95" dependencies = [ "memchr", ] libshumate-sys-0.7.0/Cargo.toml0000644000000044120000000000100120100ustar # 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" name = "libshumate-sys" version = "0.7.0" authors = ["Corentin Noël "] build = "build.rs" links = "libshumate-1.0" autolib = false autobins = false autoexamples = false autotests = false autobenches = false description = "FFI bindings for libshumate" homepage = "https://world.pages.gitlab.gnome.org/Rust/libshumate-rs/" documentation = "https://world.pages.gitlab.gnome.org/Rust/libshumate-rs/stable/latest/docs/libshumate_sys" readme = false keywords = [ "gtk4-rs", "gnome", "Map", "GUI", ] categories = [ "api-bindings", "gui", ] license = "MIT" repository = "https://gitlab.gnome.org/World/Rust/libshumate-rs" [package.metadata.docs.rs] features = [] rustc-args = [ "--cfg", "docsrs", ] rustdoc-args = [ "--cfg", "docsrs", "--generate-link-to-definition", ] [package.metadata.system-deps.shumate_1_0] name = "shumate-1.0" version = "0" [package.metadata.system-deps.shumate_1_0.v1_1] version = "1.1" [package.metadata.system-deps.shumate_1_0.v1_2] version = "1.2" [package.metadata.system-deps.shumate_1_0.v1_4] version = "1.4" [package.metadata.system-deps.shumate_1_0.v1_5] version = "1.5" [features] v1_1 = [] v1_2 = ["v1_1"] v1_4 = ["v1_2"] v1_5 = ["v1_4"] [lib] name = "libshumate_sys" path = "src/lib.rs" [[test]] name = "abi" path = "tests/abi.rs" [dependencies.gdk-pixbuf-sys] version = "0.21" [dependencies.gdk-sys] version = "0.10" package = "gdk4-sys" [dependencies.gio-sys] version = "0.21" [dependencies.glib-sys] version = "0.21" [dependencies.gobject-sys] version = "0.21" [dependencies.gtk-sys] version = "0.10" package = "gtk4-sys" [dependencies.libc] version = "0.2" [dev-dependencies.shell-words] version = "1.0.0" [dev-dependencies.tempfile] version = "3" [build-dependencies.system-deps] version = "7" libshumate-sys-0.7.0/Cargo.toml.orig000064400000000000000000000036131046102023000154730ustar 00000000000000[package] name = "libshumate-sys" version = "0.7.0" authors = ["Corentin Noël "] edition = "2021" build = "build.rs" links = "libshumate-1.0" categories = ["api-bindings", "gui"] keywords = ["gtk4-rs", "gnome", "Map", "GUI"] description = "FFI bindings for libshumate" license = "MIT" homepage = "https://world.pages.gitlab.gnome.org/Rust/libshumate-rs/" repository = "https://gitlab.gnome.org/World/Rust/libshumate-rs" documentation = "https://world.pages.gitlab.gnome.org/Rust/libshumate-rs/stable/latest/docs/libshumate_sys" [package.metadata.system-deps.shumate_1_0] name = "shumate-1.0" version = "0" [package.metadata.system-deps.shumate_1_0.v1_1] version = "1.1" [package.metadata.system-deps.shumate_1_0.v1_2] version = "1.2" [package.metadata.system-deps.shumate_1_0.v1_4] version = "1.4" [package.metadata.system-deps.shumate_1_0.v1_5] version = "1.5" [package.metadata.docs.rs] features = [] rustc-args = ["--cfg", "docsrs"] rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"] [lib] name = "libshumate_sys" [dependencies] libc = "0.2" [dependencies.gio-sys] git = "https://github.com/gtk-rs/gtk-rs-core" branch = "0.21" version = "0.21" [dependencies.glib-sys] git = "https://github.com/gtk-rs/gtk-rs-core" branch = "0.21" version = "0.21" [dependencies.gobject-sys] git = "https://github.com/gtk-rs/gtk-rs-core" branch = "0.21" version = "0.21" [dependencies.gtk-sys] package = "gtk4-sys" git = "https://github.com/gtk-rs/gtk4-rs" branch = "0.10" version = "0.10" [dependencies.gdk-sys] package = "gdk4-sys" git = "https://github.com/gtk-rs/gtk4-rs" branch = "0.10" version = "0.10" [dependencies.gdk-pixbuf-sys] git = "https://github.com/gtk-rs/gtk-rs-core" branch = "0.21" version = "0.21" [build-dependencies] system-deps = "7" [dev-dependencies] shell-words = "1.0.0" tempfile = "3" [features] v1_1 = [] v1_2 = ["v1_1"] v1_4 = ["v1_2"] v1_5 = ["v1_4"] libshumate-sys-0.7.0/Gir.toml000064400000000000000000000004171046102023000142210ustar 00000000000000[options] work_mode = "sys" library = "Shumate" version = "1.0" girs_directories = ["../../gir-files", "../../"] min_cfg_version = "1" external_libraries = [ "GLib", "GObject", "Gdk", "Gio", "Gtk", "GdkPixbuf", ] ignore = [ "Shumate.MINOR_VERSION" ]libshumate-sys-0.7.0/build.rs000064400000000000000000000007101046102023000142440ustar 00000000000000// Generated by gir (https://github.com/gtk-rs/gir @ b3d444a058cf) // from // from gir-files (https://github.com/gtk-rs/gir-files.git @ 5c1e490fe50a) // 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); } } libshumate-sys-0.7.0/src/lib.rs000064400000000000000000002141341046102023000145110ustar 00000000000000// Generated by gir (https://github.com/gtk-rs/gir @ b3d444a058cf) // from // from gir-files (https://github.com/gtk-rs/gir-files.git @ 5c1e490fe50a) // 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 gdk_pixbuf_sys as gdk_pixbuf; use gdk_sys as gdk; use gio_sys as gio; use glib_sys as glib; use gobject_sys as gobject; use gtk_sys as gtk; #[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 ShumateFileCacheError = c_int; pub const SHUMATE_FILE_CACHE_ERROR_FAILED: ShumateFileCacheError = 0; pub type ShumateGeometryType = c_int; pub const SHUMATE_GEOMETRY_TYPE_UNKNOWN: ShumateGeometryType = 0; pub const SHUMATE_GEOMETRY_TYPE_POINT: ShumateGeometryType = 1; pub const SHUMATE_GEOMETRY_TYPE_MULTIPOINT: ShumateGeometryType = 2; pub const SHUMATE_GEOMETRY_TYPE_LINESTRING: ShumateGeometryType = 3; pub const SHUMATE_GEOMETRY_TYPE_MULTILINESTRING: ShumateGeometryType = 4; pub const SHUMATE_GEOMETRY_TYPE_POLYGON: ShumateGeometryType = 5; pub const SHUMATE_GEOMETRY_TYPE_MULTIPOLYGON: ShumateGeometryType = 6; pub type ShumateMapProjection = c_int; pub const SHUMATE_MAP_PROJECTION_MERCATOR: ShumateMapProjection = 0; pub type ShumateState = c_int; pub const SHUMATE_STATE_NONE: ShumateState = 0; pub const SHUMATE_STATE_LOADING: ShumateState = 1; pub const SHUMATE_STATE_LOADED: ShumateState = 2; pub const SHUMATE_STATE_DONE: ShumateState = 3; pub type ShumateStyleError = c_int; pub const SHUMATE_STYLE_ERROR_FAILED: ShumateStyleError = 0; pub const SHUMATE_STYLE_ERROR_MALFORMED_STYLE: ShumateStyleError = 1; pub const SHUMATE_STYLE_ERROR_UNSUPPORTED_LAYER: ShumateStyleError = 2; pub const SHUMATE_STYLE_ERROR_INVALID_EXPRESSION: ShumateStyleError = 3; pub const SHUMATE_STYLE_ERROR_SUPPORT_OMITTED: ShumateStyleError = 4; pub const SHUMATE_STYLE_ERROR_UNSUPPORTED: ShumateStyleError = 5; pub type ShumateTileDownloaderError = c_int; pub const SHUMATE_TILE_DOWNLOADER_ERROR_FAILED: ShumateTileDownloaderError = 0; pub const SHUMATE_TILE_DOWNLOADER_ERROR_BAD_RESPONSE: ShumateTileDownloaderError = 1; pub const SHUMATE_TILE_DOWNLOADER_ERROR_COULD_NOT_CONNECT: ShumateTileDownloaderError = 2; pub const SHUMATE_TILE_DOWNLOADER_ERROR_MALFORMED_URL: ShumateTileDownloaderError = 3; pub const SHUMATE_TILE_DOWNLOADER_ERROR_OFFLINE: ShumateTileDownloaderError = 4; pub type ShumateUnit = c_int; pub const SHUMATE_UNIT_BOTH: ShumateUnit = 0; pub const SHUMATE_UNIT_METRIC: ShumateUnit = 1; pub const SHUMATE_UNIT_IMPERIAL: ShumateUnit = 2; // Constants pub const SHUMATE_MAJOR_VERSION: c_int = 1; pub const SHUMATE_MAP_SOURCE_MFF_RELIEF: &[u8] = b"mff-relief\0"; pub const SHUMATE_MAP_SOURCE_OSM_CYCLE_MAP: &[u8] = b"osm-cyclemap\0"; pub const SHUMATE_MAP_SOURCE_OSM_MAPNIK: &[u8] = b"osm-mapnik\0"; pub const SHUMATE_MAP_SOURCE_OSM_TRANSPORT_MAP: &[u8] = b"osm-transportmap\0"; pub const SHUMATE_MAP_SOURCE_OWM_CLOUDS: &[u8] = b"owm-clouds\0"; pub const SHUMATE_MAP_SOURCE_OWM_PRECIPITATION: &[u8] = b"owm-precipitation\0"; pub const SHUMATE_MAP_SOURCE_OWM_PRESSURE: &[u8] = b"owm-pressure\0"; pub const SHUMATE_MAP_SOURCE_OWM_TEMPERATURE: &[u8] = b"owm-temperature\0"; pub const SHUMATE_MAP_SOURCE_OWM_WIND: &[u8] = b"owm-wind\0"; pub const SHUMATE_MAX_LATITUDE: c_double = 85.0511287798; pub const SHUMATE_MAX_LONGITUDE: c_double = 180.0; pub const SHUMATE_MIN_LATITUDE: c_double = -85.0511287798; pub const SHUMATE_MIN_LONGITUDE: c_double = -180.0; // Callbacks pub type ShumateVectorSpriteFallbackFunc = Option< unsafe extern "C" fn( *mut ShumateVectorSpriteSheet, *const c_char, c_double, gpointer, ) -> *mut ShumateVectorSprite, >; // Records #[derive(Copy, Clone)] #[repr(C)] pub struct ShumateCompassClass { pub parent_class: gtk::GtkWidgetClass, } impl ::std::fmt::Debug for ShumateCompassClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateCompassClass @ {self:p}")) .field("parent_class", &self.parent_class) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct ShumateCoordinateClass { pub parent_class: gobject::GInitiallyUnownedClass, pub padding: [gpointer; 16], } impl ::std::fmt::Debug for ShumateCoordinateClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateCoordinateClass @ {self:p}")) .field("parent_class", &self.parent_class) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct ShumateDataSourceClass { pub parent_class: gobject::GObjectClass, pub get_tile_data_async: Option< unsafe extern "C" fn( *mut ShumateDataSource, c_int, c_int, c_int, *mut gio::GCancellable, gio::GAsyncReadyCallback, gpointer, ), >, pub get_tile_data_finish: Option< unsafe extern "C" fn( *mut ShumateDataSource, *mut gio::GAsyncResult, *mut *mut glib::GError, ) -> *mut glib::GBytes, >, pub start_request: Option< unsafe extern "C" fn( *mut ShumateDataSource, c_int, c_int, c_int, *mut gio::GCancellable, ) -> *mut ShumateDataSourceRequest, >, pub padding: [gpointer; 15], } impl ::std::fmt::Debug for ShumateDataSourceClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateDataSourceClass @ {self:p}")) .field("parent_class", &self.parent_class) .field("get_tile_data_async", &self.get_tile_data_async) .field("get_tile_data_finish", &self.get_tile_data_finish) .field("start_request", &self.start_request) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct ShumateDataSourceRequestClass { pub parent_class: gobject::GObjectClass, pub padding: [gpointer; 16], } impl ::std::fmt::Debug for ShumateDataSourceRequestClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateDataSourceRequestClass @ {self:p}")) .field("parent_class", &self.parent_class) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct ShumateFileCacheClass { pub parent_class: gobject::GObjectClass, } impl ::std::fmt::Debug for ShumateFileCacheClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateFileCacheClass @ {self:p}")) .field("parent_class", &self.parent_class) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct ShumateLayerClass { pub parent_class: gtk::GtkWidgetClass, pub get_debug_text: Option *mut c_char>, pub padding: [gpointer; 15], } impl ::std::fmt::Debug for ShumateLayerClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateLayerClass @ {self:p}")) .field("parent_class", &self.parent_class) .field("get_debug_text", &self.get_debug_text) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct ShumateLicenseClass { pub parent_class: gtk::GtkWidgetClass, } impl ::std::fmt::Debug for ShumateLicenseClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateLicenseClass @ {self:p}")) .field("parent_class", &self.parent_class) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct ShumateLocationInterface { pub g_iface: gobject::GTypeInterface, pub get_latitude: Option c_double>, pub get_longitude: Option c_double>, pub set_location: Option, } impl ::std::fmt::Debug for ShumateLocationInterface { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateLocationInterface @ {self:p}")) .field("get_latitude", &self.get_latitude) .field("get_longitude", &self.get_longitude) .field("set_location", &self.set_location) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct ShumateMapClass { pub parent_class: gtk::GtkWidgetClass, } impl ::std::fmt::Debug for ShumateMapClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateMapClass @ {self:p}")) .field("parent_class", &self.parent_class) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct ShumateMapLayerClass { pub parent_class: ShumateLayerClass, } impl ::std::fmt::Debug for ShumateMapLayerClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateMapLayerClass @ {self:p}")) .field("parent_class", &self.parent_class) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct ShumateMapSourceClass { pub parent_class: gobject::GObjectClass, pub fill_tile_async: Option< unsafe extern "C" fn( *mut ShumateMapSource, *mut ShumateTile, *mut gio::GCancellable, gio::GAsyncReadyCallback, gpointer, ), >, pub fill_tile_finish: Option< unsafe extern "C" fn( *mut ShumateMapSource, *mut gio::GAsyncResult, *mut *mut glib::GError, ) -> gboolean, >, pub padding: [gpointer; 16], } impl ::std::fmt::Debug for ShumateMapSourceClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateMapSourceClass @ {self:p}")) .field("parent_class", &self.parent_class) .field("fill_tile_async", &self.fill_tile_async) .field("fill_tile_finish", &self.fill_tile_finish) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct ShumateMapSourceRegistryClass { pub parent_class: gobject::GObjectClass, } impl ::std::fmt::Debug for ShumateMapSourceRegistryClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateMapSourceRegistryClass @ {self:p}")) .field("parent_class", &self.parent_class) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct ShumateMarkerClass { pub parent_class: gtk::GtkWidgetClass, pub padding: [gpointer; 16], } impl ::std::fmt::Debug for ShumateMarkerClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateMarkerClass @ {self:p}")) .field("parent_class", &self.parent_class) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct ShumateMarkerLayerClass { pub parent_class: ShumateLayerClass, } impl ::std::fmt::Debug for ShumateMarkerLayerClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateMarkerLayerClass @ {self:p}")) .field("parent_class", &self.parent_class) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct ShumatePathLayerClass { pub parent_class: ShumateLayerClass, } impl ::std::fmt::Debug for ShumatePathLayerClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumatePathLayerClass @ {self:p}")) .field("parent_class", &self.parent_class) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct ShumatePointClass { pub parent_class: ShumateMarkerClass, } impl ::std::fmt::Debug for ShumatePointClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumatePointClass @ {self:p}")) .field("parent_class", &self.parent_class) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct ShumateRasterRendererClass { pub parent_class: ShumateMapSourceClass, } impl ::std::fmt::Debug for ShumateRasterRendererClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateRasterRendererClass @ {self:p}")) .field("parent_class", &self.parent_class) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct ShumateScaleClass { pub parent_class: gtk::GtkWidgetClass, } impl ::std::fmt::Debug for ShumateScaleClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateScaleClass @ {self:p}")) .field("parent_class", &self.parent_class) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct ShumateSimpleMapClass { pub parent_class: gtk::GtkWidgetClass, } impl ::std::fmt::Debug for ShumateSimpleMapClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateSimpleMapClass @ {self:p}")) .field("parent_class", &self.parent_class) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct ShumateSymbolEventClass { pub parent_class: gobject::GObjectClass, } impl ::std::fmt::Debug for ShumateSymbolEventClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateSymbolEventClass @ {self:p}")) .field("parent_class", &self.parent_class) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct ShumateTileClass { pub parent_class: gobject::GObjectClass, } impl ::std::fmt::Debug for ShumateTileClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateTileClass @ {self:p}")) .field("parent_class", &self.parent_class) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct ShumateTileDownloaderClass { pub parent_class: ShumateDataSourceClass, } impl ::std::fmt::Debug for ShumateTileDownloaderClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateTileDownloaderClass @ {self:p}")) .field("parent_class", &self.parent_class) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct ShumateVectorReaderClass { pub parent_class: gobject::GObjectClass, } impl ::std::fmt::Debug for ShumateVectorReaderClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateVectorReaderClass @ {self:p}")) .field("parent_class", &self.parent_class) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct ShumateVectorReaderIterClass { pub parent_class: gobject::GObjectClass, } impl ::std::fmt::Debug for ShumateVectorReaderIterClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateVectorReaderIterClass @ {self:p}")) .field("parent_class", &self.parent_class) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct ShumateVectorRendererClass { pub parent_class: ShumateMapSourceClass, } impl ::std::fmt::Debug for ShumateVectorRendererClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateVectorRendererClass @ {self:p}")) .field("parent_class", &self.parent_class) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct ShumateVectorSpriteClass { pub parent_class: gobject::GObjectClass, } impl ::std::fmt::Debug for ShumateVectorSpriteClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateVectorSpriteClass @ {self:p}")) .field("parent_class", &self.parent_class) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct ShumateVectorSpriteSheetClass { pub parent_class: gobject::GObjectClass, } impl ::std::fmt::Debug for ShumateVectorSpriteSheetClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateVectorSpriteSheetClass @ {self:p}")) .field("parent_class", &self.parent_class) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct ShumateViewportClass { pub parent_class: gobject::GObjectClass, } impl ::std::fmt::Debug for ShumateViewportClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateViewportClass @ {self:p}")) .field("parent_class", &self.parent_class) .finish() } } // Classes #[repr(C)] #[allow(dead_code)] pub struct ShumateCompass { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } impl ::std::fmt::Debug for ShumateCompass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateCompass @ {self:p}")) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct ShumateCoordinate { pub parent_instance: gobject::GInitiallyUnowned, } impl ::std::fmt::Debug for ShumateCoordinate { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateCoordinate @ {self:p}")) .field("parent_instance", &self.parent_instance) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct ShumateDataSource { pub parent_instance: gobject::GObject, } impl ::std::fmt::Debug for ShumateDataSource { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateDataSource @ {self:p}")) .field("parent_instance", &self.parent_instance) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct ShumateDataSourceRequest { pub parent_instance: gobject::GObject, } impl ::std::fmt::Debug for ShumateDataSourceRequest { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateDataSourceRequest @ {self:p}")) .field("parent_instance", &self.parent_instance) .finish() } } #[repr(C)] #[allow(dead_code)] pub struct ShumateFileCache { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } impl ::std::fmt::Debug for ShumateFileCache { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateFileCache @ {self:p}")) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct ShumateLayer { pub parent_instance: gtk::GtkWidget, } impl ::std::fmt::Debug for ShumateLayer { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateLayer @ {self:p}")) .field("parent_instance", &self.parent_instance) .finish() } } #[repr(C)] #[allow(dead_code)] pub struct ShumateLicense { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } impl ::std::fmt::Debug for ShumateLicense { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateLicense @ {self:p}")) .finish() } } #[repr(C)] #[allow(dead_code)] pub struct ShumateMap { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } impl ::std::fmt::Debug for ShumateMap { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateMap @ {self:p}")).finish() } } #[repr(C)] #[allow(dead_code)] pub struct ShumateMapLayer { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } impl ::std::fmt::Debug for ShumateMapLayer { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateMapLayer @ {self:p}")) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct ShumateMapSource { pub parent_instance: gobject::GObject, } impl ::std::fmt::Debug for ShumateMapSource { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateMapSource @ {self:p}")) .field("parent_instance", &self.parent_instance) .finish() } } #[repr(C)] #[allow(dead_code)] pub struct ShumateMapSourceRegistry { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } impl ::std::fmt::Debug for ShumateMapSourceRegistry { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateMapSourceRegistry @ {self:p}")) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct ShumateMarker { pub parent_instance: gtk::GtkWidget, } impl ::std::fmt::Debug for ShumateMarker { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateMarker @ {self:p}")) .field("parent_instance", &self.parent_instance) .finish() } } #[repr(C)] #[allow(dead_code)] pub struct ShumateMarkerLayer { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } impl ::std::fmt::Debug for ShumateMarkerLayer { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateMarkerLayer @ {self:p}")) .finish() } } #[repr(C)] #[allow(dead_code)] pub struct ShumatePathLayer { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } impl ::std::fmt::Debug for ShumatePathLayer { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumatePathLayer @ {self:p}")) .finish() } } #[repr(C)] #[allow(dead_code)] pub struct ShumatePoint { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } impl ::std::fmt::Debug for ShumatePoint { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumatePoint @ {self:p}")).finish() } } #[repr(C)] #[allow(dead_code)] pub struct ShumateRasterRenderer { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } impl ::std::fmt::Debug for ShumateRasterRenderer { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateRasterRenderer @ {self:p}")) .finish() } } #[repr(C)] #[allow(dead_code)] pub struct ShumateScale { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } impl ::std::fmt::Debug for ShumateScale { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateScale @ {self:p}")).finish() } } #[repr(C)] #[allow(dead_code)] pub struct ShumateSimpleMap { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } impl ::std::fmt::Debug for ShumateSimpleMap { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateSimpleMap @ {self:p}")) .finish() } } #[repr(C)] #[allow(dead_code)] pub struct ShumateSymbolEvent { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } impl ::std::fmt::Debug for ShumateSymbolEvent { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateSymbolEvent @ {self:p}")) .finish() } } #[repr(C)] #[allow(dead_code)] pub struct ShumateTile { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } impl ::std::fmt::Debug for ShumateTile { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateTile @ {self:p}")).finish() } } #[repr(C)] #[allow(dead_code)] pub struct ShumateTileDownloader { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } impl ::std::fmt::Debug for ShumateTileDownloader { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateTileDownloader @ {self:p}")) .finish() } } #[repr(C)] #[allow(dead_code)] pub struct ShumateVectorReader { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } impl ::std::fmt::Debug for ShumateVectorReader { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateVectorReader @ {self:p}")) .finish() } } #[repr(C)] #[allow(dead_code)] pub struct ShumateVectorReaderIter { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } impl ::std::fmt::Debug for ShumateVectorReaderIter { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateVectorReaderIter @ {self:p}")) .finish() } } #[repr(C)] #[allow(dead_code)] pub struct ShumateVectorRenderer { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } impl ::std::fmt::Debug for ShumateVectorRenderer { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateVectorRenderer @ {self:p}")) .finish() } } #[repr(C)] #[allow(dead_code)] pub struct ShumateVectorSprite { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } impl ::std::fmt::Debug for ShumateVectorSprite { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateVectorSprite @ {self:p}")) .finish() } } #[repr(C)] #[allow(dead_code)] pub struct ShumateVectorSpriteSheet { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } impl ::std::fmt::Debug for ShumateVectorSpriteSheet { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateVectorSpriteSheet @ {self:p}")) .finish() } } #[repr(C)] #[allow(dead_code)] pub struct ShumateViewport { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } impl ::std::fmt::Debug for ShumateViewport { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ShumateViewport @ {self:p}")) .finish() } } // Interfaces #[repr(C)] #[allow(dead_code)] pub struct ShumateLocation { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } impl ::std::fmt::Debug for ShumateLocation { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { write!(f, "ShumateLocation @ {self:p}") } } extern "C" { //========================================================================= // ShumateFileCacheError //========================================================================= pub fn shumate_file_cache_error_get_type() -> GType; pub fn shumate_file_cache_error_quark() -> glib::GQuark; //========================================================================= // ShumateGeometryType //========================================================================= #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn shumate_geometry_type_get_type() -> GType; //========================================================================= // ShumateMapProjection //========================================================================= pub fn shumate_map_projection_get_type() -> GType; //========================================================================= // ShumateState //========================================================================= pub fn shumate_state_get_type() -> GType; //========================================================================= // ShumateStyleError //========================================================================= pub fn shumate_style_error_get_type() -> GType; pub fn shumate_style_error_quark() -> glib::GQuark; //========================================================================= // ShumateTileDownloaderError //========================================================================= pub fn shumate_tile_downloader_error_get_type() -> GType; pub fn shumate_tile_downloader_error_quark() -> glib::GQuark; //========================================================================= // ShumateUnit //========================================================================= pub fn shumate_unit_get_type() -> GType; //========================================================================= // ShumateCompass //========================================================================= pub fn shumate_compass_get_type() -> GType; pub fn shumate_compass_new(viewport: *mut ShumateViewport) -> *mut ShumateCompass; pub fn shumate_compass_get_viewport(compass: *mut ShumateCompass) -> *mut ShumateViewport; pub fn shumate_compass_set_viewport( compass: *mut ShumateCompass, viewport: *mut ShumateViewport, ); //========================================================================= // ShumateCoordinate //========================================================================= pub fn shumate_coordinate_get_type() -> GType; pub fn shumate_coordinate_new() -> *mut ShumateCoordinate; pub fn shumate_coordinate_new_full( latitude: c_double, longitude: c_double, ) -> *mut ShumateCoordinate; //========================================================================= // ShumateDataSource //========================================================================= pub fn shumate_data_source_get_type() -> GType; #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_data_source_get_max_zoom_level(self_: *mut ShumateDataSource) -> c_uint; #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_data_source_get_min_zoom_level(self_: *mut ShumateDataSource) -> c_uint; pub fn shumate_data_source_get_tile_data_async( self_: *mut ShumateDataSource, x: c_int, y: c_int, zoom_level: c_int, cancellable: *mut gio::GCancellable, callback: gio::GAsyncReadyCallback, user_data: gpointer, ); pub fn shumate_data_source_get_tile_data_finish( self_: *mut ShumateDataSource, result: *mut gio::GAsyncResult, error: *mut *mut glib::GError, ) -> *mut glib::GBytes; #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_data_source_set_max_zoom_level( self_: *mut ShumateDataSource, zoom_level: c_uint, ); #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_data_source_set_min_zoom_level( self_: *mut ShumateDataSource, zoom_level: c_uint, ); #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_data_source_start_request( self_: *mut ShumateDataSource, x: c_int, y: c_int, zoom_level: c_int, cancellable: *mut gio::GCancellable, ) -> *mut ShumateDataSourceRequest; //========================================================================= // ShumateDataSourceRequest //========================================================================= #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_data_source_request_get_type() -> GType; #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_data_source_request_new( x: c_int, y: c_int, zoom_level: c_int, ) -> *mut ShumateDataSourceRequest; #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_data_source_request_complete(self_: *mut ShumateDataSourceRequest); #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_data_source_request_emit_data( self_: *mut ShumateDataSourceRequest, data: *mut glib::GBytes, complete: gboolean, ); #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_data_source_request_emit_error( self_: *mut ShumateDataSourceRequest, error: *const glib::GError, ); #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_data_source_request_get_data( self_: *mut ShumateDataSourceRequest, ) -> *mut glib::GBytes; #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_data_source_request_get_error( self_: *mut ShumateDataSourceRequest, ) -> *mut glib::GError; #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_data_source_request_get_x(self_: *mut ShumateDataSourceRequest) -> c_int; #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_data_source_request_get_y(self_: *mut ShumateDataSourceRequest) -> c_int; #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_data_source_request_get_zoom_level( self_: *mut ShumateDataSourceRequest, ) -> c_int; #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_data_source_request_is_completed( self_: *mut ShumateDataSourceRequest, ) -> gboolean; //========================================================================= // ShumateFileCache //========================================================================= pub fn shumate_file_cache_get_type() -> GType; pub fn shumate_file_cache_new_full( size_limit: c_uint, cache_key: *const c_char, cache_dir: *const c_char, ) -> *mut ShumateFileCache; pub fn shumate_file_cache_get_cache_dir(self_: *mut ShumateFileCache) -> *const c_char; pub fn shumate_file_cache_get_cache_key(self_: *mut ShumateFileCache) -> *const c_char; pub fn shumate_file_cache_get_size_limit(self_: *mut ShumateFileCache) -> c_uint; pub fn shumate_file_cache_get_tile_async( self_: *mut ShumateFileCache, x: c_int, y: c_int, zoom_level: c_int, cancellable: *mut gio::GCancellable, callback: gio::GAsyncReadyCallback, user_data: gpointer, ); pub fn shumate_file_cache_get_tile_finish( self_: *mut ShumateFileCache, etag: *mut *mut c_char, modtime: *mut *mut glib::GDateTime, result: *mut gio::GAsyncResult, error: *mut *mut glib::GError, ) -> *mut glib::GBytes; pub fn shumate_file_cache_mark_up_to_date( self_: *mut ShumateFileCache, x: c_int, y: c_int, zoom_level: c_int, ); pub fn shumate_file_cache_purge_cache_async( self_: *mut ShumateFileCache, cancellable: *mut gio::GCancellable, callback: gio::GAsyncReadyCallback, user_data: gpointer, ); pub fn shumate_file_cache_purge_cache_finish( self_: *mut ShumateFileCache, result: *mut gio::GAsyncResult, error: *mut *mut glib::GError, ) -> gboolean; pub fn shumate_file_cache_set_size_limit(self_: *mut ShumateFileCache, size_limit: c_uint); pub fn shumate_file_cache_store_tile_async( self_: *mut ShumateFileCache, x: c_int, y: c_int, zoom_level: c_int, bytes: *mut glib::GBytes, etag: *const c_char, cancellable: *mut gio::GCancellable, callback: gio::GAsyncReadyCallback, user_data: gpointer, ); pub fn shumate_file_cache_store_tile_finish( self_: *mut ShumateFileCache, result: *mut gio::GAsyncResult, error: *mut *mut glib::GError, ) -> gboolean; //========================================================================= // ShumateLayer //========================================================================= pub fn shumate_layer_get_type() -> GType; pub fn shumate_layer_get_viewport(self_: *mut ShumateLayer) -> *mut ShumateViewport; //========================================================================= // ShumateLicense //========================================================================= pub fn shumate_license_get_type() -> GType; pub fn shumate_license_new() -> *mut ShumateLicense; pub fn shumate_license_append_map_source( license: *mut ShumateLicense, map_source: *mut ShumateMapSource, ); pub fn shumate_license_get_extra_text(license: *mut ShumateLicense) -> *const c_char; pub fn shumate_license_get_xalign(license: *mut ShumateLicense) -> c_float; pub fn shumate_license_prepend_map_source( license: *mut ShumateLicense, map_source: *mut ShumateMapSource, ); pub fn shumate_license_remove_map_source( license: *mut ShumateLicense, map_source: *mut ShumateMapSource, ); pub fn shumate_license_set_extra_text(license: *mut ShumateLicense, text: *const c_char); pub fn shumate_license_set_xalign(license: *mut ShumateLicense, xalign: c_float); //========================================================================= // ShumateMap //========================================================================= pub fn shumate_map_get_type() -> GType; pub fn shumate_map_new() -> *mut ShumateMap; pub fn shumate_map_new_simple() -> *mut ShumateMap; pub fn shumate_map_add_layer(self_: *mut ShumateMap, layer: *mut ShumateLayer); pub fn shumate_map_center_on(self_: *mut ShumateMap, latitude: c_double, longitude: c_double); pub fn shumate_map_get_animate_zoom(self_: *mut ShumateMap) -> gboolean; pub fn shumate_map_get_go_to_duration(self_: *mut ShumateMap) -> c_uint; pub fn shumate_map_get_state(self_: *mut ShumateMap) -> ShumateState; pub fn shumate_map_get_viewport(self_: *mut ShumateMap) -> *mut ShumateViewport; pub fn shumate_map_get_zoom_on_double_click(self_: *mut ShumateMap) -> gboolean; pub fn shumate_map_go_to(self_: *mut ShumateMap, latitude: c_double, longitude: c_double); pub fn shumate_map_go_to_full( self_: *mut ShumateMap, latitude: c_double, longitude: c_double, zoom_level: c_double, ); pub fn shumate_map_go_to_full_with_duration( self_: *mut ShumateMap, latitude: c_double, longitude: c_double, zoom_level: c_double, duration_ms: c_uint, ); pub fn shumate_map_insert_layer_above( self_: *mut ShumateMap, layer: *mut ShumateLayer, next_sibling: *mut ShumateLayer, ); pub fn shumate_map_insert_layer_behind( self_: *mut ShumateMap, layer: *mut ShumateLayer, next_sibling: *mut ShumateLayer, ); pub fn shumate_map_remove_layer(self_: *mut ShumateMap, layer: *mut ShumateLayer); pub fn shumate_map_set_animate_zoom(self_: *mut ShumateMap, value: gboolean); pub fn shumate_map_set_go_to_duration(self_: *mut ShumateMap, duration: c_uint); pub fn shumate_map_set_map_source(self_: *mut ShumateMap, map_source: *mut ShumateMapSource); pub fn shumate_map_set_zoom_on_double_click(self_: *mut ShumateMap, value: gboolean); pub fn shumate_map_stop_go_to(self_: *mut ShumateMap); pub fn shumate_map_zoom_in(self_: *mut ShumateMap); pub fn shumate_map_zoom_out(self_: *mut ShumateMap); //========================================================================= // ShumateMapLayer //========================================================================= pub fn shumate_map_layer_get_type() -> GType; pub fn shumate_map_layer_new( map_source: *mut ShumateMapSource, viewport: *mut ShumateViewport, ) -> *mut ShumateMapLayer; //========================================================================= // ShumateMapSource //========================================================================= pub fn shumate_map_source_get_type() -> GType; pub fn shumate_map_source_fill_tile_async( self_: *mut ShumateMapSource, tile: *mut ShumateTile, cancellable: *mut gio::GCancellable, callback: gio::GAsyncReadyCallback, user_data: gpointer, ); pub fn shumate_map_source_fill_tile_finish( self_: *mut ShumateMapSource, result: *mut gio::GAsyncResult, error: *mut *mut glib::GError, ) -> gboolean; pub fn shumate_map_source_get_column_count( map_source: *mut ShumateMapSource, zoom_level: c_uint, ) -> c_uint; pub fn shumate_map_source_get_id(map_source: *mut ShumateMapSource) -> *const c_char; pub fn shumate_map_source_get_latitude( map_source: *mut ShumateMapSource, zoom_level: c_double, y: c_double, ) -> c_double; pub fn shumate_map_source_get_license(map_source: *mut ShumateMapSource) -> *const c_char; pub fn shumate_map_source_get_license_uri(map_source: *mut ShumateMapSource) -> *const c_char; pub fn shumate_map_source_get_longitude( map_source: *mut ShumateMapSource, zoom_level: c_double, x: c_double, ) -> c_double; pub fn shumate_map_source_get_max_zoom_level(map_source: *mut ShumateMapSource) -> c_uint; pub fn shumate_map_source_get_meters_per_pixel( map_source: *mut ShumateMapSource, zoom_level: c_double, latitude: c_double, longitude: c_double, ) -> c_double; pub fn shumate_map_source_get_min_zoom_level(map_source: *mut ShumateMapSource) -> c_uint; pub fn shumate_map_source_get_name(map_source: *mut ShumateMapSource) -> *const c_char; pub fn shumate_map_source_get_projection( map_source: *mut ShumateMapSource, ) -> ShumateMapProjection; pub fn shumate_map_source_get_row_count( map_source: *mut ShumateMapSource, zoom_level: c_uint, ) -> c_uint; pub fn shumate_map_source_get_tile_size(map_source: *mut ShumateMapSource) -> c_uint; pub fn shumate_map_source_get_tile_size_at_zoom( map_source: *mut ShumateMapSource, zoom_level: c_double, ) -> c_double; pub fn shumate_map_source_get_x( map_source: *mut ShumateMapSource, zoom_level: c_double, longitude: c_double, ) -> c_double; pub fn shumate_map_source_get_y( map_source: *mut ShumateMapSource, zoom_level: c_double, latitude: c_double, ) -> c_double; pub fn shumate_map_source_set_id(map_source: *mut ShumateMapSource, id: *const c_char); pub fn shumate_map_source_set_license( map_source: *mut ShumateMapSource, license: *const c_char, ); pub fn shumate_map_source_set_license_uri( map_source: *mut ShumateMapSource, license_uri: *const c_char, ); pub fn shumate_map_source_set_max_zoom_level( map_source: *mut ShumateMapSource, zoom_level: c_uint, ); pub fn shumate_map_source_set_min_zoom_level( map_source: *mut ShumateMapSource, zoom_level: c_uint, ); pub fn shumate_map_source_set_name(map_source: *mut ShumateMapSource, name: *const c_char); pub fn shumate_map_source_set_projection( map_source: *mut ShumateMapSource, projection: ShumateMapProjection, ); pub fn shumate_map_source_set_tile_size(map_source: *mut ShumateMapSource, tile_size: c_uint); //========================================================================= // ShumateMapSourceRegistry //========================================================================= pub fn shumate_map_source_registry_get_type() -> GType; pub fn shumate_map_source_registry_new() -> *mut ShumateMapSourceRegistry; pub fn shumate_map_source_registry_new_with_defaults() -> *mut ShumateMapSourceRegistry; pub fn shumate_map_source_registry_add( self_: *mut ShumateMapSourceRegistry, map_source: *mut ShumateMapSource, ); pub fn shumate_map_source_registry_get_by_id( self_: *mut ShumateMapSourceRegistry, id: *const c_char, ) -> *mut ShumateMapSource; pub fn shumate_map_source_registry_populate_defaults(self_: *mut ShumateMapSourceRegistry); pub fn shumate_map_source_registry_remove( self_: *mut ShumateMapSourceRegistry, id: *const c_char, ); //========================================================================= // ShumateMarker //========================================================================= pub fn shumate_marker_get_type() -> GType; pub fn shumate_marker_new() -> *mut ShumateMarker; pub fn shumate_marker_animate_in(marker: *mut ShumateMarker); pub fn shumate_marker_animate_in_with_delay(marker: *mut ShumateMarker, delay: c_uint); pub fn shumate_marker_animate_out(marker: *mut ShumateMarker); pub fn shumate_marker_animate_out_with_delay(marker: *mut ShumateMarker, delay: c_uint); pub fn shumate_marker_get_child(marker: *mut ShumateMarker) -> *mut gtk::GtkWidget; pub fn shumate_marker_get_draggable(marker: *mut ShumateMarker) -> gboolean; pub fn shumate_marker_get_selectable(marker: *mut ShumateMarker) -> gboolean; pub fn shumate_marker_is_selected(marker: *mut ShumateMarker) -> gboolean; pub fn shumate_marker_set_child(marker: *mut ShumateMarker, child: *mut gtk::GtkWidget); pub fn shumate_marker_set_draggable(marker: *mut ShumateMarker, value: gboolean); pub fn shumate_marker_set_selectable(marker: *mut ShumateMarker, value: gboolean); //========================================================================= // ShumateMarkerLayer //========================================================================= pub fn shumate_marker_layer_get_type() -> GType; pub fn shumate_marker_layer_new(viewport: *mut ShumateViewport) -> *mut ShumateMarkerLayer; pub fn shumate_marker_layer_new_full( viewport: *mut ShumateViewport, mode: gtk::GtkSelectionMode, ) -> *mut ShumateMarkerLayer; pub fn shumate_marker_layer_add_marker( self_: *mut ShumateMarkerLayer, marker: *mut ShumateMarker, ); pub fn shumate_marker_layer_get_markers(self_: *mut ShumateMarkerLayer) -> *mut glib::GList; pub fn shumate_marker_layer_get_selected(self_: *mut ShumateMarkerLayer) -> *mut glib::GList; pub fn shumate_marker_layer_get_selection_mode( self_: *mut ShumateMarkerLayer, ) -> gtk::GtkSelectionMode; pub fn shumate_marker_layer_remove_all(self_: *mut ShumateMarkerLayer); pub fn shumate_marker_layer_remove_marker( self_: *mut ShumateMarkerLayer, marker: *mut ShumateMarker, ); pub fn shumate_marker_layer_select_all_markers(self_: *mut ShumateMarkerLayer); pub fn shumate_marker_layer_select_marker( self_: *mut ShumateMarkerLayer, marker: *mut ShumateMarker, ) -> gboolean; pub fn shumate_marker_layer_set_selection_mode( self_: *mut ShumateMarkerLayer, mode: gtk::GtkSelectionMode, ); pub fn shumate_marker_layer_unselect_all_markers(self_: *mut ShumateMarkerLayer); pub fn shumate_marker_layer_unselect_marker( self_: *mut ShumateMarkerLayer, marker: *mut ShumateMarker, ); //========================================================================= // ShumatePathLayer //========================================================================= pub fn shumate_path_layer_get_type() -> GType; pub fn shumate_path_layer_new(viewport: *mut ShumateViewport) -> *mut ShumatePathLayer; pub fn shumate_path_layer_add_node( self_: *mut ShumatePathLayer, location: *mut ShumateLocation, ); pub fn shumate_path_layer_get_closed(self_: *mut ShumatePathLayer) -> gboolean; pub fn shumate_path_layer_get_dash(self_: *mut ShumatePathLayer) -> *mut glib::GList; pub fn shumate_path_layer_get_fill(self_: *mut ShumatePathLayer) -> gboolean; pub fn shumate_path_layer_get_fill_color(self_: *mut ShumatePathLayer) -> *mut gdk::GdkRGBA; pub fn shumate_path_layer_get_nodes(self_: *mut ShumatePathLayer) -> *mut glib::GList; pub fn shumate_path_layer_get_outline_color(self_: *mut ShumatePathLayer) -> *mut gdk::GdkRGBA; pub fn shumate_path_layer_get_outline_width(self_: *mut ShumatePathLayer) -> c_double; pub fn shumate_path_layer_get_stroke(self_: *mut ShumatePathLayer) -> gboolean; pub fn shumate_path_layer_get_stroke_color(self_: *mut ShumatePathLayer) -> *mut gdk::GdkRGBA; pub fn shumate_path_layer_get_stroke_width(self_: *mut ShumatePathLayer) -> c_double; pub fn shumate_path_layer_insert_node( self_: *mut ShumatePathLayer, location: *mut ShumateLocation, position: c_uint, ); pub fn shumate_path_layer_remove_all(self_: *mut ShumatePathLayer); pub fn shumate_path_layer_remove_node( self_: *mut ShumatePathLayer, location: *mut ShumateLocation, ); pub fn shumate_path_layer_set_closed(self_: *mut ShumatePathLayer, value: gboolean); pub fn shumate_path_layer_set_dash( self_: *mut ShumatePathLayer, dash_pattern: *mut glib::GList, ); pub fn shumate_path_layer_set_fill(self_: *mut ShumatePathLayer, value: gboolean); pub fn shumate_path_layer_set_fill_color( self_: *mut ShumatePathLayer, color: *const gdk::GdkRGBA, ); pub fn shumate_path_layer_set_outline_color( self_: *mut ShumatePathLayer, color: *const gdk::GdkRGBA, ); pub fn shumate_path_layer_set_outline_width(self_: *mut ShumatePathLayer, value: c_double); pub fn shumate_path_layer_set_stroke(self_: *mut ShumatePathLayer, value: gboolean); pub fn shumate_path_layer_set_stroke_color( self_: *mut ShumatePathLayer, color: *const gdk::GdkRGBA, ); pub fn shumate_path_layer_set_stroke_width(self_: *mut ShumatePathLayer, value: c_double); //========================================================================= // ShumatePoint //========================================================================= pub fn shumate_point_get_type() -> GType; pub fn shumate_point_new() -> *mut ShumatePoint; //========================================================================= // ShumateRasterRenderer //========================================================================= pub fn shumate_raster_renderer_get_type() -> GType; pub fn shumate_raster_renderer_new( data_source: *mut ShumateDataSource, ) -> *mut ShumateRasterRenderer; pub fn shumate_raster_renderer_new_from_url( url_template: *const c_char, ) -> *mut ShumateRasterRenderer; pub fn shumate_raster_renderer_new_full( id: *const c_char, name: *const c_char, license: *const c_char, license_uri: *const c_char, min_zoom: c_uint, max_zoom: c_uint, tile_size: c_uint, projection: ShumateMapProjection, data_source: *mut ShumateDataSource, ) -> *mut ShumateRasterRenderer; pub fn shumate_raster_renderer_new_full_from_url( id: *const c_char, name: *const c_char, license: *const c_char, license_uri: *const c_char, min_zoom: c_uint, max_zoom: c_uint, tile_size: c_uint, projection: ShumateMapProjection, url_template: *const c_char, ) -> *mut ShumateRasterRenderer; //========================================================================= // ShumateScale //========================================================================= pub fn shumate_scale_get_type() -> GType; pub fn shumate_scale_new(viewport: *mut ShumateViewport) -> *mut ShumateScale; pub fn shumate_scale_get_max_width(scale: *mut ShumateScale) -> c_uint; pub fn shumate_scale_get_unit(scale: *mut ShumateScale) -> ShumateUnit; pub fn shumate_scale_get_viewport(scale: *mut ShumateScale) -> *mut ShumateViewport; pub fn shumate_scale_set_max_width(scale: *mut ShumateScale, value: c_uint); pub fn shumate_scale_set_unit(scale: *mut ShumateScale, unit: ShumateUnit); pub fn shumate_scale_set_viewport(scale: *mut ShumateScale, viewport: *mut ShumateViewport); //========================================================================= // ShumateSimpleMap //========================================================================= pub fn shumate_simple_map_get_type() -> GType; pub fn shumate_simple_map_new() -> *mut ShumateSimpleMap; pub fn shumate_simple_map_add_overlay_layer( self_: *mut ShumateSimpleMap, layer: *mut ShumateLayer, ); #[cfg(feature = "v1_4")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))] pub fn shumate_simple_map_get_base_map_layer( self_: *mut ShumateSimpleMap, ) -> *mut ShumateMapLayer; pub fn shumate_simple_map_get_compass(self_: *mut ShumateSimpleMap) -> *mut ShumateCompass; pub fn shumate_simple_map_get_license(self_: *mut ShumateSimpleMap) -> *mut ShumateLicense; pub fn shumate_simple_map_get_map(self_: *mut ShumateSimpleMap) -> *mut ShumateMap; pub fn shumate_simple_map_get_map_source(self_: *mut ShumateSimpleMap) -> *mut ShumateMapSource; pub fn shumate_simple_map_get_scale(self_: *mut ShumateSimpleMap) -> *mut ShumateScale; pub fn shumate_simple_map_get_show_zoom_buttons(self_: *mut ShumateSimpleMap) -> gboolean; pub fn shumate_simple_map_get_viewport(self_: *mut ShumateSimpleMap) -> *mut ShumateViewport; pub fn shumate_simple_map_insert_overlay_layer_above( self_: *mut ShumateSimpleMap, layer: *mut ShumateLayer, sibling: *mut ShumateLayer, ); pub fn shumate_simple_map_insert_overlay_layer_behind( self_: *mut ShumateSimpleMap, layer: *mut ShumateLayer, sibling: *mut ShumateLayer, ); pub fn shumate_simple_map_remove_overlay_layer( self_: *mut ShumateSimpleMap, layer: *mut ShumateLayer, ); pub fn shumate_simple_map_set_map_source( self_: *mut ShumateSimpleMap, map_source: *mut ShumateMapSource, ); pub fn shumate_simple_map_set_show_zoom_buttons( self_: *mut ShumateSimpleMap, show_zoom_buttons: gboolean, ); //========================================================================= // ShumateSymbolEvent //========================================================================= #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_symbol_event_get_type() -> GType; #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_symbol_event_get_feature_id(self_: *mut ShumateSymbolEvent) -> *const c_char; #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_symbol_event_get_keys(self_: *mut ShumateSymbolEvent) -> c_char; #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_symbol_event_get_layer(self_: *mut ShumateSymbolEvent) -> *const c_char; #[cfg(feature = "v1_5")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_5")))] pub fn shumate_symbol_event_get_n_press(self_: *mut ShumateSymbolEvent) -> c_int; #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_symbol_event_get_source_layer(self_: *mut ShumateSymbolEvent) -> *const c_char; #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_symbol_event_get_tag( self_: *mut ShumateSymbolEvent, tag_name: *const c_char, ) -> *const c_char; //========================================================================= // ShumateTile //========================================================================= pub fn shumate_tile_get_type() -> GType; pub fn shumate_tile_new() -> *mut ShumateTile; pub fn shumate_tile_new_full( x: c_uint, y: c_uint, size: c_uint, zoom_level: c_uint, ) -> *mut ShumateTile; pub fn shumate_tile_get_fade_in(self_: *mut ShumateTile) -> gboolean; pub fn shumate_tile_get_paintable(self_: *mut ShumateTile) -> *mut gdk::GdkPaintable; #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_tile_get_scale_factor(self_: *mut ShumateTile) -> c_double; pub fn shumate_tile_get_size(self_: *mut ShumateTile) -> c_uint; pub fn shumate_tile_get_state(self_: *mut ShumateTile) -> ShumateState; pub fn shumate_tile_get_x(self_: *mut ShumateTile) -> c_uint; pub fn shumate_tile_get_y(self_: *mut ShumateTile) -> c_uint; pub fn shumate_tile_get_zoom_level(self_: *mut ShumateTile) -> c_uint; pub fn shumate_tile_set_fade_in(self_: *mut ShumateTile, fade_in: gboolean); pub fn shumate_tile_set_paintable(self_: *mut ShumateTile, paintable: *mut gdk::GdkPaintable); #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_tile_set_scale_factor(self_: *mut ShumateTile, scale_factor: c_double); pub fn shumate_tile_set_size(self_: *mut ShumateTile, size: c_uint); pub fn shumate_tile_set_state(self_: *mut ShumateTile, state: ShumateState); pub fn shumate_tile_set_x(self_: *mut ShumateTile, x: c_uint); pub fn shumate_tile_set_y(self_: *mut ShumateTile, y: c_uint); pub fn shumate_tile_set_zoom_level(self_: *mut ShumateTile, zoom_level: c_uint); //========================================================================= // ShumateTileDownloader //========================================================================= pub fn shumate_tile_downloader_get_type() -> GType; pub fn shumate_tile_downloader_new(url_template: *const c_char) -> *mut ShumateTileDownloader; //========================================================================= // ShumateVectorReader //========================================================================= #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn shumate_vector_reader_get_type() -> GType; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn shumate_vector_reader_new(bytes: *mut glib::GBytes) -> *mut ShumateVectorReader; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn shumate_vector_reader_iterate( self_: *mut ShumateVectorReader, ) -> *mut ShumateVectorReaderIter; //========================================================================= // ShumateVectorReaderIter //========================================================================= #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn shumate_vector_reader_iter_get_type() -> GType; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn shumate_vector_reader_iter_feature_contains_point( self_: *mut ShumateVectorReaderIter, x: c_double, y: c_double, ) -> gboolean; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn shumate_vector_reader_iter_get_feature_geometry_type( self_: *mut ShumateVectorReaderIter, ) -> ShumateGeometryType; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn shumate_vector_reader_iter_get_feature_id(self_: *mut ShumateVectorReaderIter) -> u64; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn shumate_vector_reader_iter_get_feature_keys( self_: *mut ShumateVectorReaderIter, ) -> *mut *const c_char; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn shumate_vector_reader_iter_get_feature_point( self_: *mut ShumateVectorReaderIter, x: *mut c_double, y: *mut c_double, ) -> gboolean; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn shumate_vector_reader_iter_get_feature_tag( self_: *mut ShumateVectorReaderIter, key: *const c_char, value: *mut gobject::GValue, ) -> gboolean; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn shumate_vector_reader_iter_get_layer_count( self_: *mut ShumateVectorReaderIter, ) -> c_uint; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn shumate_vector_reader_iter_get_layer_extent( self_: *mut ShumateVectorReaderIter, ) -> c_uint; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn shumate_vector_reader_iter_get_layer_feature_count( self_: *mut ShumateVectorReaderIter, ) -> c_uint; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn shumate_vector_reader_iter_get_layer_name( self_: *mut ShumateVectorReaderIter, ) -> *const c_char; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn shumate_vector_reader_iter_get_reader( self_: *mut ShumateVectorReaderIter, ) -> *mut ShumateVectorReader; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn shumate_vector_reader_iter_next_feature(self_: *mut ShumateVectorReaderIter) -> gboolean; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn shumate_vector_reader_iter_read_feature( self_: *mut ShumateVectorReaderIter, index: c_int, ); #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn shumate_vector_reader_iter_read_layer(self_: *mut ShumateVectorReaderIter, index: c_int); #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn shumate_vector_reader_iter_read_layer_by_name( self_: *mut ShumateVectorReaderIter, name: *const c_char, ) -> gboolean; //========================================================================= // ShumateVectorRenderer //========================================================================= pub fn shumate_vector_renderer_get_type() -> GType; pub fn shumate_vector_renderer_new( id: *const c_char, style_json: *const c_char, error: *mut *mut glib::GError, ) -> *mut ShumateVectorRenderer; pub fn shumate_vector_renderer_is_supported() -> gboolean; #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_vector_renderer_get_sprite_sheet( self_: *mut ShumateVectorRenderer, ) -> *mut ShumateVectorSpriteSheet; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn shumate_vector_renderer_set_data_source( self_: *mut ShumateVectorRenderer, name: *const c_char, data_source: *mut ShumateDataSource, ); #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_vector_renderer_set_sprite_sheet( self_: *mut ShumateVectorRenderer, sprites: *mut ShumateVectorSpriteSheet, ); pub fn shumate_vector_renderer_set_sprite_sheet_data( self_: *mut ShumateVectorRenderer, sprites_pixbuf: *mut gdk_pixbuf::GdkPixbuf, sprites_json: *const c_char, error: *mut *mut glib::GError, ) -> gboolean; //========================================================================= // ShumateVectorSprite //========================================================================= #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_vector_sprite_get_type() -> GType; #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_vector_sprite_new( source_paintable: *mut gdk::GdkPaintable, ) -> *mut ShumateVectorSprite; #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_vector_sprite_new_full( source_paintable: *mut gdk::GdkPaintable, width: c_int, height: c_int, scale_factor: c_double, source_rect: *mut gdk::GdkRectangle, ) -> *mut ShumateVectorSprite; #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_vector_sprite_get_height(self_: *mut ShumateVectorSprite) -> c_int; #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_vector_sprite_get_scale_factor(self_: *mut ShumateVectorSprite) -> c_double; #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_vector_sprite_get_source_paintable( self_: *mut ShumateVectorSprite, ) -> *mut gdk::GdkPaintable; #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_vector_sprite_get_source_rect( self_: *mut ShumateVectorSprite, ) -> *mut gdk::GdkRectangle; #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_vector_sprite_get_width(self_: *mut ShumateVectorSprite) -> c_int; //========================================================================= // ShumateVectorSpriteSheet //========================================================================= #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_vector_sprite_sheet_get_type() -> GType; #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_vector_sprite_sheet_new() -> *mut ShumateVectorSpriteSheet; #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_vector_sprite_sheet_add_page( self_: *mut ShumateVectorSpriteSheet, texture: *mut gdk::GdkTexture, json: *const c_char, default_scale: c_double, error: *mut *mut glib::GError, ) -> gboolean; #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_vector_sprite_sheet_add_sprite( self_: *mut ShumateVectorSpriteSheet, name: *const c_char, sprite: *mut ShumateVectorSprite, ); #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_vector_sprite_sheet_get_sprite( self_: *mut ShumateVectorSpriteSheet, name: *const c_char, scale: c_double, ) -> *mut ShumateVectorSprite; #[cfg(feature = "v1_1")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))] pub fn shumate_vector_sprite_sheet_set_fallback( self_: *mut ShumateVectorSpriteSheet, fallback: ShumateVectorSpriteFallbackFunc, user_data: gpointer, notify: glib::GDestroyNotify, ); //========================================================================= // ShumateViewport //========================================================================= pub fn shumate_viewport_get_type() -> GType; pub fn shumate_viewport_new() -> *mut ShumateViewport; pub fn shumate_viewport_get_max_zoom_level(self_: *mut ShumateViewport) -> c_uint; pub fn shumate_viewport_get_min_zoom_level(self_: *mut ShumateViewport) -> c_uint; pub fn shumate_viewport_get_reference_map_source( self_: *mut ShumateViewport, ) -> *mut ShumateMapSource; pub fn shumate_viewport_get_rotation(self_: *mut ShumateViewport) -> c_double; pub fn shumate_viewport_get_zoom_level(self_: *mut ShumateViewport) -> c_double; pub fn shumate_viewport_location_to_widget_coords( self_: *mut ShumateViewport, widget: *mut gtk::GtkWidget, latitude: c_double, longitude: c_double, x: *mut c_double, y: *mut c_double, ); pub fn shumate_viewport_set_max_zoom_level(self_: *mut ShumateViewport, max_zoom_level: c_uint); pub fn shumate_viewport_set_min_zoom_level(self_: *mut ShumateViewport, min_zoom_level: c_uint); pub fn shumate_viewport_set_reference_map_source( self_: *mut ShumateViewport, map_source: *mut ShumateMapSource, ); pub fn shumate_viewport_set_rotation(self_: *mut ShumateViewport, rotation: c_double); pub fn shumate_viewport_set_zoom_level(self_: *mut ShumateViewport, zoom_level: c_double); pub fn shumate_viewport_widget_coords_to_location( self_: *mut ShumateViewport, widget: *mut gtk::GtkWidget, x: c_double, y: c_double, latitude: *mut c_double, longitude: *mut c_double, ); //========================================================================= // ShumateLocation //========================================================================= pub fn shumate_location_get_type() -> GType; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn shumate_location_distance( self_: *mut ShumateLocation, other: *mut ShumateLocation, ) -> c_double; pub fn shumate_location_get_latitude(location: *mut ShumateLocation) -> c_double; pub fn shumate_location_get_longitude(location: *mut ShumateLocation) -> c_double; pub fn shumate_location_set_location( location: *mut ShumateLocation, latitude: c_double, longitude: c_double, ); //========================================================================= // Other functions //========================================================================= pub fn shumate_get_user_agent() -> *const c_char; pub fn shumate_set_user_agent(new_user_agent: *const c_char); } libshumate-sys-0.7.0/tests/abi.rs000064400000000000000000000373461046102023000150610ustar 00000000000000// Generated by gir (https://github.com/gtk-rs/gir @ b3d444a058cf) // from // from gir-files (https://github.com/gtk-rs/gir-files.git @ 5c1e490fe50a) // DO NOT EDIT #![cfg(unix)] use libshumate_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] = &["shumate-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)] = &[ ( "ShumateCompassClass", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateCoordinate", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateCoordinateClass", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateDataSource", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateDataSourceClass", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateDataSourceRequest", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateDataSourceRequestClass", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateFileCacheClass", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateFileCacheError", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateGeometryType", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateLayer", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateLayerClass", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateLicenseClass", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateLocationInterface", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateMapClass", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateMapLayerClass", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateMapProjection", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateMapSource", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateMapSourceClass", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateMapSourceRegistryClass", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateMarker", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateMarkerClass", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateMarkerLayerClass", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumatePathLayerClass", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumatePointClass", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateRasterRendererClass", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateScaleClass", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateSimpleMapClass", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateState", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateStyleError", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateSymbolEventClass", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateTileClass", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateTileDownloaderClass", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateTileDownloaderError", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateUnit", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateVectorReaderClass", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateVectorReaderIterClass", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateVectorRendererClass", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateVectorSpriteClass", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateVectorSpriteSheetClass", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "ShumateViewportClass", Layout { size: size_of::(), alignment: align_of::(), }, ), ]; const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(gint) SHUMATE_FILE_CACHE_ERROR_FAILED", "0"), ("(gint) SHUMATE_GEOMETRY_TYPE_LINESTRING", "3"), ("(gint) SHUMATE_GEOMETRY_TYPE_MULTILINESTRING", "4"), ("(gint) SHUMATE_GEOMETRY_TYPE_MULTIPOINT", "2"), ("(gint) SHUMATE_GEOMETRY_TYPE_MULTIPOLYGON", "6"), ("(gint) SHUMATE_GEOMETRY_TYPE_POINT", "1"), ("(gint) SHUMATE_GEOMETRY_TYPE_POLYGON", "5"), ("(gint) SHUMATE_GEOMETRY_TYPE_UNKNOWN", "0"), ("SHUMATE_MAJOR_VERSION", "1"), ("(gint) SHUMATE_MAP_PROJECTION_MERCATOR", "0"), ("SHUMATE_MAP_SOURCE_MFF_RELIEF", "mff-relief"), ("SHUMATE_MAP_SOURCE_OSM_CYCLE_MAP", "osm-cyclemap"), ("SHUMATE_MAP_SOURCE_OSM_MAPNIK", "osm-mapnik"), ("SHUMATE_MAP_SOURCE_OSM_TRANSPORT_MAP", "osm-transportmap"), ("SHUMATE_MAP_SOURCE_OWM_CLOUDS", "owm-clouds"), ("SHUMATE_MAP_SOURCE_OWM_PRECIPITATION", "owm-precipitation"), ("SHUMATE_MAP_SOURCE_OWM_PRESSURE", "owm-pressure"), ("SHUMATE_MAP_SOURCE_OWM_TEMPERATURE", "owm-temperature"), ("SHUMATE_MAP_SOURCE_OWM_WIND", "owm-wind"), ("SHUMATE_MAX_LATITUDE", "85.0511287798"), ("SHUMATE_MAX_LONGITUDE", "180.0"), ("SHUMATE_MIN_LATITUDE", "-85.0511287798"), ("SHUMATE_MIN_LONGITUDE", "-180.0"), ("(gint) SHUMATE_STATE_DONE", "3"), ("(gint) SHUMATE_STATE_LOADED", "2"), ("(gint) SHUMATE_STATE_LOADING", "1"), ("(gint) SHUMATE_STATE_NONE", "0"), ("(gint) SHUMATE_STYLE_ERROR_FAILED", "0"), ("(gint) SHUMATE_STYLE_ERROR_INVALID_EXPRESSION", "3"), ("(gint) SHUMATE_STYLE_ERROR_MALFORMED_STYLE", "1"), ("(gint) SHUMATE_STYLE_ERROR_SUPPORT_OMITTED", "4"), ("(gint) SHUMATE_STYLE_ERROR_UNSUPPORTED", "5"), ("(gint) SHUMATE_STYLE_ERROR_UNSUPPORTED_LAYER", "2"), ("(gint) SHUMATE_TILE_DOWNLOADER_ERROR_BAD_RESPONSE", "1"), ( "(gint) SHUMATE_TILE_DOWNLOADER_ERROR_COULD_NOT_CONNECT", "2", ), ("(gint) SHUMATE_TILE_DOWNLOADER_ERROR_FAILED", "0"), ("(gint) SHUMATE_TILE_DOWNLOADER_ERROR_MALFORMED_URL", "3"), ("(gint) SHUMATE_TILE_DOWNLOADER_ERROR_OFFLINE", "4"), ("(gint) SHUMATE_UNIT_BOTH", "0"), ("(gint) SHUMATE_UNIT_IMPERIAL", "2"), ("(gint) SHUMATE_UNIT_METRIC", "1"), ]; libshumate-sys-0.7.0/tests/constant.c000064400000000000000000000064241046102023000157460ustar 00000000000000// Generated by gir (https://github.com/gtk-rs/gir @ b3d444a058cf) // from // from gir-files (https://github.com/gtk-rs/gir-files.git @ 5c1e490fe50a) // 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) SHUMATE_FILE_CACHE_ERROR_FAILED); PRINT_CONSTANT((gint) SHUMATE_GEOMETRY_TYPE_LINESTRING); PRINT_CONSTANT((gint) SHUMATE_GEOMETRY_TYPE_MULTILINESTRING); PRINT_CONSTANT((gint) SHUMATE_GEOMETRY_TYPE_MULTIPOINT); PRINT_CONSTANT((gint) SHUMATE_GEOMETRY_TYPE_MULTIPOLYGON); PRINT_CONSTANT((gint) SHUMATE_GEOMETRY_TYPE_POINT); PRINT_CONSTANT((gint) SHUMATE_GEOMETRY_TYPE_POLYGON); PRINT_CONSTANT((gint) SHUMATE_GEOMETRY_TYPE_UNKNOWN); PRINT_CONSTANT(SHUMATE_MAJOR_VERSION); PRINT_CONSTANT((gint) SHUMATE_MAP_PROJECTION_MERCATOR); PRINT_CONSTANT(SHUMATE_MAP_SOURCE_MFF_RELIEF); PRINT_CONSTANT(SHUMATE_MAP_SOURCE_OSM_CYCLE_MAP); PRINT_CONSTANT(SHUMATE_MAP_SOURCE_OSM_MAPNIK); PRINT_CONSTANT(SHUMATE_MAP_SOURCE_OSM_TRANSPORT_MAP); PRINT_CONSTANT(SHUMATE_MAP_SOURCE_OWM_CLOUDS); PRINT_CONSTANT(SHUMATE_MAP_SOURCE_OWM_PRECIPITATION); PRINT_CONSTANT(SHUMATE_MAP_SOURCE_OWM_PRESSURE); PRINT_CONSTANT(SHUMATE_MAP_SOURCE_OWM_TEMPERATURE); PRINT_CONSTANT(SHUMATE_MAP_SOURCE_OWM_WIND); PRINT_CONSTANT(SHUMATE_MAX_LATITUDE); PRINT_CONSTANT(SHUMATE_MAX_LONGITUDE); PRINT_CONSTANT(SHUMATE_MIN_LATITUDE); PRINT_CONSTANT(SHUMATE_MIN_LONGITUDE); PRINT_CONSTANT((gint) SHUMATE_STATE_DONE); PRINT_CONSTANT((gint) SHUMATE_STATE_LOADED); PRINT_CONSTANT((gint) SHUMATE_STATE_LOADING); PRINT_CONSTANT((gint) SHUMATE_STATE_NONE); PRINT_CONSTANT((gint) SHUMATE_STYLE_ERROR_FAILED); PRINT_CONSTANT((gint) SHUMATE_STYLE_ERROR_INVALID_EXPRESSION); PRINT_CONSTANT((gint) SHUMATE_STYLE_ERROR_MALFORMED_STYLE); PRINT_CONSTANT((gint) SHUMATE_STYLE_ERROR_SUPPORT_OMITTED); PRINT_CONSTANT((gint) SHUMATE_STYLE_ERROR_UNSUPPORTED); PRINT_CONSTANT((gint) SHUMATE_STYLE_ERROR_UNSUPPORTED_LAYER); PRINT_CONSTANT((gint) SHUMATE_TILE_DOWNLOADER_ERROR_BAD_RESPONSE); PRINT_CONSTANT((gint) SHUMATE_TILE_DOWNLOADER_ERROR_COULD_NOT_CONNECT); PRINT_CONSTANT((gint) SHUMATE_TILE_DOWNLOADER_ERROR_FAILED); PRINT_CONSTANT((gint) SHUMATE_TILE_DOWNLOADER_ERROR_MALFORMED_URL); PRINT_CONSTANT((gint) SHUMATE_TILE_DOWNLOADER_ERROR_OFFLINE); PRINT_CONSTANT((gint) SHUMATE_UNIT_BOTH); PRINT_CONSTANT((gint) SHUMATE_UNIT_IMPERIAL); PRINT_CONSTANT((gint) SHUMATE_UNIT_METRIC); return 0; } libshumate-sys-0.7.0/tests/layout.c000064400000000000000000000115351046102023000154310ustar 00000000000000// Generated by gir (https://github.com/gtk-rs/gir @ b3d444a058cf) // from // from gir-files (https://github.com/gtk-rs/gir-files.git @ 5c1e490fe50a) // DO NOT EDIT #include "manual.h" #include #include int main() { printf("%s;%zu;%zu\n", "ShumateCompassClass", sizeof(ShumateCompassClass), alignof(ShumateCompassClass)); printf("%s;%zu;%zu\n", "ShumateCoordinate", sizeof(ShumateCoordinate), alignof(ShumateCoordinate)); printf("%s;%zu;%zu\n", "ShumateCoordinateClass", sizeof(ShumateCoordinateClass), alignof(ShumateCoordinateClass)); printf("%s;%zu;%zu\n", "ShumateDataSource", sizeof(ShumateDataSource), alignof(ShumateDataSource)); printf("%s;%zu;%zu\n", "ShumateDataSourceClass", sizeof(ShumateDataSourceClass), alignof(ShumateDataSourceClass)); printf("%s;%zu;%zu\n", "ShumateDataSourceRequest", sizeof(ShumateDataSourceRequest), alignof(ShumateDataSourceRequest)); printf("%s;%zu;%zu\n", "ShumateDataSourceRequestClass", sizeof(ShumateDataSourceRequestClass), alignof(ShumateDataSourceRequestClass)); printf("%s;%zu;%zu\n", "ShumateFileCacheClass", sizeof(ShumateFileCacheClass), alignof(ShumateFileCacheClass)); printf("%s;%zu;%zu\n", "ShumateFileCacheError", sizeof(ShumateFileCacheError), alignof(ShumateFileCacheError)); printf("%s;%zu;%zu\n", "ShumateGeometryType", sizeof(ShumateGeometryType), alignof(ShumateGeometryType)); printf("%s;%zu;%zu\n", "ShumateLayer", sizeof(ShumateLayer), alignof(ShumateLayer)); printf("%s;%zu;%zu\n", "ShumateLayerClass", sizeof(ShumateLayerClass), alignof(ShumateLayerClass)); printf("%s;%zu;%zu\n", "ShumateLicenseClass", sizeof(ShumateLicenseClass), alignof(ShumateLicenseClass)); printf("%s;%zu;%zu\n", "ShumateLocationInterface", sizeof(ShumateLocationInterface), alignof(ShumateLocationInterface)); printf("%s;%zu;%zu\n", "ShumateMapClass", sizeof(ShumateMapClass), alignof(ShumateMapClass)); printf("%s;%zu;%zu\n", "ShumateMapLayerClass", sizeof(ShumateMapLayerClass), alignof(ShumateMapLayerClass)); printf("%s;%zu;%zu\n", "ShumateMapProjection", sizeof(ShumateMapProjection), alignof(ShumateMapProjection)); printf("%s;%zu;%zu\n", "ShumateMapSource", sizeof(ShumateMapSource), alignof(ShumateMapSource)); printf("%s;%zu;%zu\n", "ShumateMapSourceClass", sizeof(ShumateMapSourceClass), alignof(ShumateMapSourceClass)); printf("%s;%zu;%zu\n", "ShumateMapSourceRegistryClass", sizeof(ShumateMapSourceRegistryClass), alignof(ShumateMapSourceRegistryClass)); printf("%s;%zu;%zu\n", "ShumateMarker", sizeof(ShumateMarker), alignof(ShumateMarker)); printf("%s;%zu;%zu\n", "ShumateMarkerClass", sizeof(ShumateMarkerClass), alignof(ShumateMarkerClass)); printf("%s;%zu;%zu\n", "ShumateMarkerLayerClass", sizeof(ShumateMarkerLayerClass), alignof(ShumateMarkerLayerClass)); printf("%s;%zu;%zu\n", "ShumatePathLayerClass", sizeof(ShumatePathLayerClass), alignof(ShumatePathLayerClass)); printf("%s;%zu;%zu\n", "ShumatePointClass", sizeof(ShumatePointClass), alignof(ShumatePointClass)); printf("%s;%zu;%zu\n", "ShumateRasterRendererClass", sizeof(ShumateRasterRendererClass), alignof(ShumateRasterRendererClass)); printf("%s;%zu;%zu\n", "ShumateScaleClass", sizeof(ShumateScaleClass), alignof(ShumateScaleClass)); printf("%s;%zu;%zu\n", "ShumateSimpleMapClass", sizeof(ShumateSimpleMapClass), alignof(ShumateSimpleMapClass)); printf("%s;%zu;%zu\n", "ShumateState", sizeof(ShumateState), alignof(ShumateState)); printf("%s;%zu;%zu\n", "ShumateStyleError", sizeof(ShumateStyleError), alignof(ShumateStyleError)); printf("%s;%zu;%zu\n", "ShumateSymbolEventClass", sizeof(ShumateSymbolEventClass), alignof(ShumateSymbolEventClass)); printf("%s;%zu;%zu\n", "ShumateTileClass", sizeof(ShumateTileClass), alignof(ShumateTileClass)); printf("%s;%zu;%zu\n", "ShumateTileDownloaderClass", sizeof(ShumateTileDownloaderClass), alignof(ShumateTileDownloaderClass)); printf("%s;%zu;%zu\n", "ShumateTileDownloaderError", sizeof(ShumateTileDownloaderError), alignof(ShumateTileDownloaderError)); printf("%s;%zu;%zu\n", "ShumateUnit", sizeof(ShumateUnit), alignof(ShumateUnit)); printf("%s;%zu;%zu\n", "ShumateVectorReaderClass", sizeof(ShumateVectorReaderClass), alignof(ShumateVectorReaderClass)); printf("%s;%zu;%zu\n", "ShumateVectorReaderIterClass", sizeof(ShumateVectorReaderIterClass), alignof(ShumateVectorReaderIterClass)); printf("%s;%zu;%zu\n", "ShumateVectorRendererClass", sizeof(ShumateVectorRendererClass), alignof(ShumateVectorRendererClass)); printf("%s;%zu;%zu\n", "ShumateVectorSpriteClass", sizeof(ShumateVectorSpriteClass), alignof(ShumateVectorSpriteClass)); printf("%s;%zu;%zu\n", "ShumateVectorSpriteSheetClass", sizeof(ShumateVectorSpriteSheetClass), alignof(ShumateVectorSpriteSheetClass)); printf("%s;%zu;%zu\n", "ShumateViewportClass", sizeof(ShumateViewportClass), alignof(ShumateViewportClass)); return 0; } libshumate-sys-0.7.0/tests/manual.h000064400000000000000000000001671046102023000153750ustar 00000000000000// Feel free to edit this file, it won't be regenerated by gir generator unless removed. #include